@hazem3500/palette 0.9.115 → 0.9.116

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.
@@ -6,10 +6,10 @@ var vj=Object.create;var jx=Object.defineProperty;var wj=Object.getOwnPropertyDe
6
6
  `+l[o].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=o&&0<=i);break}}}finally{nw=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?gl(n):""}function aP(e,t){switch(e.tag){case 26:case 27:case 5:return gl(e.type);case 16:return gl("Lazy");case 13:return e.child!==t&&t!==null?gl("Suspense Fallback"):gl("Suspense");case 19:return gl("SuspenseList");case 0:case 15:return ow(e.type,!1);case 11:return ow(e.type.render,!1);case 1:return ow(e.type,!0);case 31:return gl("Activity");default:return""}}function BC(e){try{var t="",n=null;do t+=aP(e,n),n=e,e=e.return;while(e);return t}catch(o){return`
7
7
  Error generating stack: `+o.message+`
8
8
  `+o.stack}}var Vw=Object.prototype.hasOwnProperty,D1=oo.unstable_scheduleCallback,iw=oo.unstable_cancelCallback,sP=oo.unstable_shouldYield,lP=oo.unstable_requestPaint,vi=oo.unstable_now,cP=oo.unstable_getCurrentPriorityLevel,g_=oo.unstable_ImmediatePriority,h_=oo.unstable_UserBlockingPriority,ah=oo.unstable_NormalPriority,dP=oo.unstable_LowPriority,b_=oo.unstable_IdlePriority,uP=oo.log,pP=oo.unstable_setDisableYieldValue,Ip=null,wi=null;function gs(e){if(typeof uP=="function"&&pP(e),wi&&typeof wi.setStrictMode=="function")try{wi.setStrictMode(Ip,e)}catch{}}var Ei=Math.clz32?Math.clz32:gP,fP=Math.log,mP=Math.LN2;function gP(e){return e>>>=0,e===0?32:31-(fP(e)/mP|0)|0}var Tg=256,Ag=262144,Mg=4194304;function hl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Rh(e,t,n){var o=e.pendingLanes;if(o===0)return 0;var i=0,r=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var s=o&134217727;return s!==0?(o=s&~r,o!==0?i=hl(o):(a&=s,a!==0?i=hl(a):n||(n=s&~e,n!==0&&(i=hl(n))))):(s=o&~r,s!==0?i=hl(s):a!==0?i=hl(a):n||(n=o&~e,n!==0&&(i=hl(n)))),i===0?0:t!==0&&t!==i&&(t&r)===0&&(r=i&-i,n=t&-t,r>=n||r===32&&(n&4194048)!==0)?t:i}function Gp(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function hP(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function y_(){var e=Mg;return Mg<<=1,(Mg&62914560)===0&&(Mg=4194304),e}function rw(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Fp(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function bP(e,t,n,o,i,r){var a=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(n=a&~n;0<n;){var u=31-Ei(n),d=1<<u;s[u]=0,l[u]=-1;var p=c[u];if(p!==null)for(c[u]=null,u=0;u<p.length;u++){var g=p[u];g!==null&&(g.lane&=-536870913)}n&=~d}o!==0&&x_(e,o,0),r!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=r&~(a&~t))}function x_(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-Ei(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|n&261930}function v_(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var o=31-Ei(n),i=1<<o;i&t|e[o]&t&&(e[o]|=t),n&=~i}}function w_(e,t){var n=t&-t;return n=(n&42)!==0?1:R1(n),(n&(e.suspendedLanes|t))!==0?0:n}function R1(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function H1(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function E_(){var e=qt.p;return e!==0?e:(e=window.event,e===void 0?32:I4(e.type))}function VC(e,t){var n=qt.p;try{return qt.p=e,t()}finally{qt.p=n}}var Hs=Math.random().toString(36).slice(2),yo="__reactFiber$"+Hs,ti="__reactProps$"+Hs,Sd="__reactContainer$"+Hs,Uw="__reactEvents$"+Hs,yP="__reactListeners$"+Hs,xP="__reactHandles$"+Hs,UC="__reactResources$"+Hs,Yp="__reactMarker$"+Hs;function z1(e){delete e[yo],delete e[ti],delete e[Uw],delete e[yP],delete e[xP]}function Wc(e){var t=e[yo];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Sd]||n[yo]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=WL(e);e!==null;){if(n=e[yo])return n;e=WL(e)}return t}e=n,n=e.parentNode}return null}function Td(e){if(e=e[yo]||e[Sd]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function mp(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(ke(33))}function ad(e){var t=e[UC];return t||(t=e[UC]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function co(e){e[Yp]=!0}var k_=new Set,S_={};function Ll(e,t){md(e,t),md(e+"Capture",t)}function md(e,t){for(S_[e]=t,e=0;e<t.length;e++)k_.add(t[e])}var vP=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),qC={},KC={};function wP(e){return Vw.call(KC,e)?!0:Vw.call(qC,e)?!1:vP.test(e)?KC[e]=!0:(qC[e]=!0,!1)}function Ug(e,t,n){if(wP(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var o=t.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Cg(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function va(e,t,n,o){if(o===null)e.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+o)}}function Ki(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function T_(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function EP(e,t,n){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var i=o.get,r=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){n=""+a,r.call(this,a)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function qw(e){if(!e._valueTracker){var t=T_(e)?"checked":"value";e._valueTracker=EP(e,t,""+e[t])}}function A_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),o="";return e&&(o=T_(e)?e.checked?"true":"false":e.value),e=o,e!==n?(t.setValue(e),!0):!1}function sh(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var kP=/[\n"\\]/g;function Fi(e){return e.replace(kP,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Kw(e,t,n,o,i,r,a,s){e.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.type=a:e.removeAttribute("type"),t!=null?a==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ki(t)):e.value!==""+Ki(t)&&(e.value=""+Ki(t)):a!=="submit"&&a!=="reset"||e.removeAttribute("value"),t!=null?Iw(e,a,Ki(t)):n!=null?Iw(e,a,Ki(n)):o!=null&&e.removeAttribute("value"),i==null&&r!=null&&(e.defaultChecked=!!r),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.name=""+Ki(s):e.removeAttribute("name")}function M_(e,t,n,o,i,r,a,s){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){qw(e);return}n=n!=null?""+Ki(n):"",t=t!=null?""+Ki(t):n,s||t===e.value||(e.value=t),e.defaultValue=t}o=o??i,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=s?e.checked:!!o,e.defaultChecked=!!o,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.name=a),qw(e)}function Iw(e,t,n){t==="number"&&sh(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function sd(e,t,n,o){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&o&&(e[n].defaultSelected=!0)}else{for(n=""+Ki(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,o&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function C_(e,t,n){if(t!=null&&(t=""+Ki(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Ki(n):""}function L_(e,t,n,o){if(t==null){if(o!=null){if(n!=null)throw Error(ke(92));if(fp(o)){if(1<o.length)throw Error(ke(93));o=o[0]}n=o}n==null&&(n=""),t=n}n=Ki(t),e.defaultValue=n,o=e.textContent,o===n&&o!==""&&o!==null&&(e.value=o),qw(e)}function gd(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var SP=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function IC(e,t,n){var o=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?o?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":o?e.setProperty(t,n):typeof n!="number"||n===0||SP.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function __(e,t,n){if(t!=null&&typeof t!="object")throw Error(ke(62));if(e=e.style,n!=null){for(var o in n)!n.hasOwnProperty(o)||t!=null&&t.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var i in t)o=t[i],t.hasOwnProperty(i)&&n[i]!==o&&IC(e,i,o)}else for(var r in t)t.hasOwnProperty(r)&&IC(e,r,t[r])}function O1(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var TP=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),AP=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function qg(e){return AP.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ca(){}var Gw=null;function $1(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zc=null,ld=null;function GC(e){var t=Td(e);if(t&&(e=t.stateNode)){var n=e[ti]||null;e:switch(e=t.stateNode,t.type){case"input":if(Kw(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Fi(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var o=n[t];if(o!==e&&o.form===e.form){var i=o[ti]||null;if(!i)throw Error(ke(90));Kw(o,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)o=n[t],o.form===e.form&&A_(o)}break e;case"textarea":C_(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&sd(e,!!n.multiple,t,!1)}}}var aw=!1;function D_(e,t,n){if(aw)return e(t,n);aw=!0;try{var o=e(t);return o}finally{if(aw=!1,(Zc!==null||ld!==null)&&(Kh(),Zc&&(t=Zc,e=ld,ld=Zc=null,GC(t),e)))for(t=0;t<e.length;t++)GC(e[t])}}function Dp(e,t){var n=e.stateNode;if(n===null)return null;var o=n[ti]||null;if(o===null)return null;n=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(ke(231,t,typeof n));return n}var Ha=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fw=!1;if(Ha)try{qc={},Object.defineProperty(qc,"passive",{get:function(){Fw=!0}}),window.addEventListener("test",qc,qc),window.removeEventListener("test",qc,qc)}catch{Fw=!1}var qc,hs=null,N1=null,Kg=null;function R_(){if(Kg)return Kg;var e,t=N1,n=t.length,o,i="value"in hs?hs.value:hs.textContent,r=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(o=1;o<=a&&t[n-o]===i[r-o];o++);return Kg=i.slice(e,1<o?1-o:void 0)}function Ig(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Lg(){return!0}function FC(){return!1}function ni(e){function t(n,o,i,r,a){this._reactName=n,this._targetInst=i,this.type=o,this.nativeEvent=r,this.target=a,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(r):r[s]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?Lg:FC,this.isPropagationStopped=FC,this}return yn(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Lg)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Lg)},persist:function(){},isPersistent:Lg}),t}var _l={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hh=ni(_l),Xp=yn({},_l,{view:0,detail:0}),MP=ni(Xp),sw,lw,ap,zh=yn({},Xp,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:j1,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ap&&(ap&&e.type==="mousemove"?(sw=e.screenX-ap.screenX,lw=e.screenY-ap.screenY):lw=sw=0,ap=e),sw)},movementY:function(e){return"movementY"in e?e.movementY:lw}}),YC=ni(zh),CP=yn({},zh,{dataTransfer:0}),LP=ni(CP),_P=yn({},Xp,{relatedTarget:0}),cw=ni(_P),DP=yn({},_l,{animationName:0,elapsedTime:0,pseudoElement:0}),RP=ni(DP),HP=yn({},_l,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),zP=ni(HP),OP=yn({},_l,{data:0}),XC=ni(OP),$P={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},NP={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},jP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function PP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jP[e])?!!t[e]:!1}function j1(){return PP}var BP=yn({},Xp,{key:function(e){if(e.key){var t=$P[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ig(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?NP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:j1,charCode:function(e){return e.type==="keypress"?Ig(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ig(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),VP=ni(BP),UP=yn({},zh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),WC=ni(UP),qP=yn({},Xp,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:j1}),KP=ni(qP),IP=yn({},_l,{propertyName:0,elapsedTime:0,pseudoElement:0}),GP=ni(IP),FP=yn({},zh,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),YP=ni(FP),XP=yn({},_l,{newState:0,oldState:0}),WP=ni(XP),ZP=[9,13,27,32],P1=Ha&&"CompositionEvent"in window,bp=null;Ha&&"documentMode"in document&&(bp=document.documentMode);var QP=Ha&&"TextEvent"in window&&!bp,H_=Ha&&(!P1||bp&&8<bp&&11>=bp),ZC=" ",QC=!1;function z_(e,t){switch(e){case"keyup":return ZP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function O_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qc=!1;function JP(e,t){switch(e){case"compositionend":return O_(t);case"keypress":return t.which!==32?null:(QC=!0,ZC);case"textInput":return e=t.data,e===ZC&&QC?null:e;default:return null}}function eB(e,t){if(Qc)return e==="compositionend"||!P1&&z_(e,t)?(e=R_(),Kg=N1=hs=null,Qc=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return H_&&t.locale!=="ko"?null:t.data;default:return null}}var tB={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function JC(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!tB[e.type]:t==="textarea"}function $_(e,t,n,o){Zc?ld?ld.push(o):ld=[o]:Zc=o,t=Th(t,"onChange"),0<t.length&&(n=new Hh("onChange","change",null,n,o),e.push({event:n,listeners:t}))}var yp=null,Rp=null;function nB(e){D4(e,0)}function Oh(e){var t=mp(e);if(A_(t))return e}function eL(e,t){if(e==="change")return t}var N_=!1;Ha&&(Ha?(Dg="oninput"in document,Dg||(dw=document.createElement("div"),dw.setAttribute("oninput","return;"),Dg=typeof dw.oninput=="function"),_g=Dg):_g=!1,N_=_g&&(!document.documentMode||9<document.documentMode));var _g,Dg,dw;function tL(){yp&&(yp.detachEvent("onpropertychange",j_),Rp=yp=null)}function j_(e){if(e.propertyName==="value"&&Oh(Rp)){var t=[];$_(t,Rp,e,$1(e)),D_(nB,t)}}function oB(e,t,n){e==="focusin"?(tL(),yp=t,Rp=n,yp.attachEvent("onpropertychange",j_)):e==="focusout"&&tL()}function iB(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Oh(Rp)}function rB(e,t){if(e==="click")return Oh(t)}function aB(e,t){if(e==="input"||e==="change")return Oh(t)}function sB(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Si=typeof Object.is=="function"?Object.is:sB;function Hp(e,t){if(Si(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(o=0;o<n.length;o++){var i=n[o];if(!Vw.call(t,i)||!Si(e[i],t[i]))return!1}return!0}function nL(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function oL(e,t){var n=nL(e);e=0;for(var o;n;){if(n.nodeType===3){if(o=e+n.textContent.length,e<=t&&o>=t)return{node:n,offset:t-e};e=o}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=nL(n)}}function P_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?P_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function B_(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=sh(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=sh(e.document)}return t}function B1(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var lB=Ha&&"documentMode"in document&&11>=document.documentMode,Jc=null,Yw=null,xp=null,Xw=!1;function iL(e,t,n){var o=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xw||Jc==null||Jc!==sh(o)||(o=Jc,"selectionStart"in o&&B1(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),xp&&Hp(xp,o)||(xp=o,o=Th(Yw,"onSelect"),0<o.length&&(t=new Hh("onSelect","select",null,t,n),e.push({event:t,listeners:o}),t.target=Jc)))}function ml(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ed={animationend:ml("Animation","AnimationEnd"),animationiteration:ml("Animation","AnimationIteration"),animationstart:ml("Animation","AnimationStart"),transitionrun:ml("Transition","TransitionRun"),transitionstart:ml("Transition","TransitionStart"),transitioncancel:ml("Transition","TransitionCancel"),transitionend:ml("Transition","TransitionEnd")},uw={},V_={};Ha&&(V_=document.createElement("div").style,"AnimationEvent"in window||(delete ed.animationend.animation,delete ed.animationiteration.animation,delete ed.animationstart.animation),"TransitionEvent"in window||delete ed.transitionend.transition);function Dl(e){if(uw[e])return uw[e];if(!ed[e])return e;var t=ed[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in V_)return uw[e]=t[n];return e}var U_=Dl("animationend"),q_=Dl("animationiteration"),K_=Dl("animationstart"),cB=Dl("transitionrun"),dB=Dl("transitionstart"),uB=Dl("transitioncancel"),I_=Dl("transitionend"),G_=new Map,Ww="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ww.push("scrollEnd");function wr(e,t){G_.set(e,t),Ll(t,[e])}var lh=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},qi=[],td=0,V1=0;function $h(){for(var e=td,t=V1=td=0;t<e;){var n=qi[t];qi[t++]=null;var o=qi[t];qi[t++]=null;var i=qi[t];qi[t++]=null;var r=qi[t];if(qi[t++]=null,o!==null&&i!==null){var a=o.pending;a===null?i.next=i:(i.next=a.next,a.next=i),o.pending=i}r!==0&&F_(n,i,r)}}function Nh(e,t,n,o){qi[td++]=e,qi[td++]=t,qi[td++]=n,qi[td++]=o,V1|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function U1(e,t,n,o){return Nh(e,t,n,o),ch(e)}function Rl(e,t){return Nh(e,null,null,t),ch(e)}function F_(e,t,n){e.lanes|=n;var o=e.alternate;o!==null&&(o.lanes|=n);for(var i=!1,r=e.return;r!==null;)r.childLanes|=n,o=r.alternate,o!==null&&(o.childLanes|=n),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(i=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,i&&t!==null&&(i=31-Ei(n),e=r.hiddenUpdates,o=e[i],o===null?e[i]=[t]:o.push(t),t.lane=n|536870912),r):null}function ch(e){if(50<Cp)throw Cp=0,b1=null,Error(ke(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var nd={};function pB(e,t,n,o){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yi(e,t,n,o){return new pB(e,t,n,o)}function q1(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _a(e,t){var n=e.alternate;return n===null?(n=yi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Y_(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Gg(e,t,n,o,i,r){var a=0;if(o=e,typeof e=="function")q1(e)&&(a=1);else if(typeof e=="string")a=g9(e,n,qr.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Nw:return e=yi(31,n,t,i),e.elementType=Nw,e.lanes=r,e;case Yc:return vl(n.children,i,r,t);case f_:a=8,i|=24;break;case zw:return e=yi(12,n,t,i|2),e.elementType=zw,e.lanes=r,e;case Ow:return e=yi(13,n,t,i),e.elementType=Ow,e.lanes=r,e;case $w:return e=yi(19,n,t,i),e.elementType=$w,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ma:a=10;break e;case m_:a=9;break e;case L1:a=11;break e;case _1:a=14;break e;case cs:a=16,o=null;break e}a=29,n=Error(ke(130,e===null?"null":typeof e,"")),o=null}return t=yi(a,n,t,i),t.elementType=e,t.type=o,t.lanes=r,t}function vl(e,t,n,o){return e=yi(7,e,o,t),e.lanes=n,e}function pw(e,t,n){return e=yi(6,e,null,t),e.lanes=n,e}function X_(e){var t=yi(18,null,null,0);return t.stateNode=e,t}function fw(e,t,n){return t=yi(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var rL=new WeakMap;function Yi(e,t){if(typeof e=="object"&&e!==null){var n=rL.get(e);return n!==void 0?n:(t={value:e,source:t,stack:BC(t)},rL.set(e,t),t)}return{value:e,source:t,stack:BC(t)}}var od=[],id=0,dh=null,zp=0,Ii=[],Gi=0,Ls=null,Br=1,Vr="";function Ta(e,t){od[id++]=zp,od[id++]=dh,dh=e,zp=t}function W_(e,t,n){Ii[Gi++]=Br,Ii[Gi++]=Vr,Ii[Gi++]=Ls,Ls=e;var o=Br;e=Vr;var i=32-Ei(o)-1;o&=~(1<<i),n+=1;var r=32-Ei(t)+i;if(30<r){var a=i-i%5;r=(o&(1<<a)-1).toString(32),o>>=a,i-=a,Br=1<<32-Ei(t)+i|n<<i|o,Vr=r+e}else Br=1<<r|n<<i|o,Vr=e}function K1(e){e.return!==null&&(Ta(e,1),W_(e,1,0))}function I1(e){for(;e===dh;)dh=od[--id],od[id]=null,zp=od[--id],od[id]=null;for(;e===Ls;)Ls=Ii[--Gi],Ii[Gi]=null,Vr=Ii[--Gi],Ii[Gi]=null,Br=Ii[--Gi],Ii[Gi]=null}function Z_(e,t){Ii[Gi++]=Br,Ii[Gi++]=Vr,Ii[Gi++]=Ls,Br=t.id,Vr=t.overflow,Ls=e}var xo=null,bn=null,Rt=!1,ws=null,Xi=!1,Zw=Error(ke(519));function _s(e){var t=Error(ke(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Op(Yi(t,e)),Zw}function aL(e){var t=e.stateNode,n=e.type,o=e.memoizedProps;switch(t[yo]=e,t[ti]=o,n){case"dialog":St("cancel",t),St("close",t);break;case"iframe":case"object":case"embed":St("load",t);break;case"video":case"audio":for(n=0;n<Pp.length;n++)St(Pp[n],t);break;case"source":St("error",t);break;case"img":case"image":case"link":St("error",t),St("load",t);break;case"details":St("toggle",t);break;case"input":St("invalid",t),M_(t,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":St("invalid",t);break;case"textarea":St("invalid",t),L_(t,o.value,o.defaultValue,o.children)}n=o.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||o.suppressHydrationWarning===!0||H4(t.textContent,n)?(o.popover!=null&&(St("beforetoggle",t),St("toggle",t)),o.onScroll!=null&&St("scroll",t),o.onScrollEnd!=null&&St("scrollend",t),o.onClick!=null&&(t.onclick=Ca),t=!0):t=!1,t||_s(e,!0)}function sL(e){for(xo=e.return;xo;)switch(xo.tag){case 5:case 31:case 13:Xi=!1;return;case 27:case 3:Xi=!0;return;default:xo=xo.return}}function Kc(e){if(e!==xo)return!1;if(!Rt)return sL(e),Rt=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||E1(e.type,e.memoizedProps)),n=!n),n&&bn&&_s(e),sL(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ke(317));bn=XL(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ke(317));bn=XL(e)}else t===27?(t=bn,zs(e.type)?(e=A1,A1=null,bn=e):bn=t):bn=xo?Zi(e.stateNode.nextSibling):null;return!0}function Sl(){bn=xo=null,Rt=!1}function mw(){var e=ws;return e!==null&&(Jo===null?Jo=e:Jo.push.apply(Jo,e),ws=null),e}function Op(e){ws===null?ws=[e]:ws.push(e)}var Qw=Kr(null),Hl=null,La=null;function us(e,t,n){pn(Qw,t._currentValue),t._currentValue=n}function Da(e){e._currentValue=Qw.current,uo(Qw)}function Jw(e,t,n){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===n)break;e=e.return}}function e1(e,t,n,o){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var r=i.dependencies;if(r!==null){var a=i.child;r=r.firstContext;e:for(;r!==null;){var s=r;r=i;for(var l=0;l<t.length;l++)if(s.context===t[l]){r.lanes|=n,s=r.alternate,s!==null&&(s.lanes|=n),Jw(r.return,n,e),o||(a=null);break e}r=s.next}}else if(i.tag===18){if(a=i.return,a===null)throw Error(ke(341));a.lanes|=n,r=a.alternate,r!==null&&(r.lanes|=n),Jw(a,n,e),a=null}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===e){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}}function Ad(e,t,n,o){e=null;for(var i=t,r=!1;i!==null;){if(!r){if((i.flags&524288)!==0)r=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var a=i.alternate;if(a===null)throw Error(ke(387));if(a=a.memoizedProps,a!==null){var s=i.type;Si(i.pendingProps.value,a.value)||(e!==null?e.push(s):e=[s])}}else if(i===oh.current){if(a=i.alternate,a===null)throw Error(ke(387));a.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Vp):e=[Vp])}i=i.return}e!==null&&e1(t,e,n,o),t.flags|=262144}function uh(e){for(e=e.firstContext;e!==null;){if(!Si(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Tl(e){Hl=e,La=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function vo(e){return Q_(Hl,e)}function Rg(e,t){return Hl===null&&Tl(e),Q_(e,t)}function Q_(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},La===null){if(e===null)throw Error(ke(308));La=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else La=La.next=t;return n}var fB=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,o){e.push(o)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},mB=oo.unstable_scheduleCallback,gB=oo.unstable_NormalPriority,Qn={$$typeof:Ma,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function G1(){return{controller:new fB,data:new Map,refCount:0}}function Wp(e){e.refCount--,e.refCount===0&&mB(gB,function(){e.controller.abort()})}var vp=null,t1=0,hd=0,cd=null;function hB(e,t){if(vp===null){var n=vp=[];t1=0,hd=bE(),cd={status:"pending",value:void 0,then:function(o){n.push(o)}}}return t1++,t.then(lL,lL),t}function lL(){if(--t1===0&&vp!==null){cd!==null&&(cd.status="fulfilled");var e=vp;vp=null,hd=0,cd=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function bB(e,t){var n=[],o={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){o.status="fulfilled",o.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(o.status="rejected",o.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),o}var cL=rt.S;rt.S=function(e,t){p4=vi(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&hB(e,t),cL!==null&&cL(e,t)};var wl=Kr(null);function F1(){var e=wl.current;return e!==null?e:sn.pooledCache}function Fg(e,t){t===null?pn(wl,wl.current):pn(wl,t.pool)}function J_(){var e=F1();return e===null?null:{parent:Qn._currentValue,pool:e}}var Md=Error(ke(460)),Y1=Error(ke(474)),jh=Error(ke(542)),ph={then:function(){}};function dL(e){return e=e.status,e==="fulfilled"||e==="rejected"}function e5(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ca,Ca),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,pL(e),e;default:if(typeof t.status=="string")t.then(Ca,Ca);else{if(e=sn,e!==null&&100<e.shellSuspendCounter)throw Error(ke(482));e=t,e.status="pending",e.then(function(o){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=o}},function(o){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=o}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,pL(e),e}throw El=t,Md}}function bl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(El=n,Md):n}}var El=null;function uL(){if(El===null)throw Error(ke(459));var e=El;return El=null,e}function pL(e){if(e===Md||e===jh)throw Error(ke(483))}var dd=null,$p=0;function Hg(e){var t=$p;return $p+=1,dd===null&&(dd=[]),e5(dd,e,t)}function sp(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function zg(e,t){throw t.$$typeof===oP?Error(ke(525)):(e=Object.prototype.toString.call(t),Error(ke(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function t5(e){function t(h,m){if(e){var b=h.deletions;b===null?(h.deletions=[m],h.flags|=16):b.push(m)}}function n(h,m){if(!e)return null;for(;m!==null;)t(h,m),m=m.sibling;return null}function o(h){for(var m=new Map;h!==null;)h.key!==null?m.set(h.key,h):m.set(h.index,h),h=h.sibling;return m}function i(h,m){return h=_a(h,m),h.index=0,h.sibling=null,h}function r(h,m,b){return h.index=b,e?(b=h.alternate,b!==null?(b=b.index,b<m?(h.flags|=67108866,m):b):(h.flags|=67108866,m)):(h.flags|=1048576,m)}function a(h){return e&&h.alternate===null&&(h.flags|=67108866),h}function s(h,m,b,E){return m===null||m.tag!==6?(m=pw(b,h.mode,E),m.return=h,m):(m=i(m,b),m.return=h,m)}function l(h,m,b,E){var S=b.type;return S===Yc?u(h,m,b.props.children,E,b.key):m!==null&&(m.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===cs&&bl(S)===m.type)?(m=i(m,b.props),sp(m,b),m.return=h,m):(m=Gg(b.type,b.key,b.props,null,h.mode,E),sp(m,b),m.return=h,m)}function c(h,m,b,E){return m===null||m.tag!==4||m.stateNode.containerInfo!==b.containerInfo||m.stateNode.implementation!==b.implementation?(m=fw(b,h.mode,E),m.return=h,m):(m=i(m,b.children||[]),m.return=h,m)}function u(h,m,b,E,S){return m===null||m.tag!==7?(m=vl(b,h.mode,E,S),m.return=h,m):(m=i(m,b),m.return=h,m)}function d(h,m,b){if(typeof m=="string"&&m!==""||typeof m=="number"||typeof m=="bigint")return m=pw(""+m,h.mode,b),m.return=h,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Sg:return b=Gg(m.type,m.key,m.props,null,h.mode,b),sp(b,m),b.return=h,b;case pp:return m=fw(m,h.mode,b),m.return=h,m;case cs:return m=bl(m),d(h,m,b)}if(fp(m)||rp(m))return m=vl(m,h.mode,b,null),m.return=h,m;if(typeof m.then=="function")return d(h,Hg(m),b);if(m.$$typeof===Ma)return d(h,Rg(h,m),b);zg(h,m)}return null}function p(h,m,b,E){var S=m!==null?m.key:null;if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return S!==null?null:s(h,m,""+b,E);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Sg:return b.key===S?l(h,m,b,E):null;case pp:return b.key===S?c(h,m,b,E):null;case cs:return b=bl(b),p(h,m,b,E)}if(fp(b)||rp(b))return S!==null?null:u(h,m,b,E,null);if(typeof b.then=="function")return p(h,m,Hg(b),E);if(b.$$typeof===Ma)return p(h,m,Rg(h,b),E);zg(h,b)}return null}function g(h,m,b,E,S){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return h=h.get(b)||null,s(m,h,""+E,S);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case Sg:return h=h.get(E.key===null?b:E.key)||null,l(m,h,E,S);case pp:return h=h.get(E.key===null?b:E.key)||null,c(m,h,E,S);case cs:return E=bl(E),g(h,m,b,E,S)}if(fp(E)||rp(E))return h=h.get(b)||null,u(m,h,E,S,null);if(typeof E.then=="function")return g(h,m,b,Hg(E),S);if(E.$$typeof===Ma)return g(h,m,b,Rg(m,E),S);zg(m,E)}return null}function y(h,m,b,E){for(var S=null,A=null,_=m,T=m=0,H=null;_!==null&&T<b.length;T++){_.index>T?(H=_,_=null):H=_.sibling;var R=p(h,_,b[T],E);if(R===null){_===null&&(_=H);break}e&&_&&R.alternate===null&&t(h,_),m=r(R,m,T),A===null?S=R:A.sibling=R,A=R,_=H}if(T===b.length)return n(h,_),Rt&&Ta(h,T),S;if(_===null){for(;T<b.length;T++)_=d(h,b[T],E),_!==null&&(m=r(_,m,T),A===null?S=_:A.sibling=_,A=_);return Rt&&Ta(h,T),S}for(_=o(_);T<b.length;T++)H=g(_,h,T,b[T],E),H!==null&&(e&&H.alternate!==null&&_.delete(H.key===null?T:H.key),m=r(H,m,T),A===null?S=H:A.sibling=H,A=H);return e&&_.forEach(function(z){return t(h,z)}),Rt&&Ta(h,T),S}function v(h,m,b,E){if(b==null)throw Error(ke(151));for(var S=null,A=null,_=m,T=m=0,H=null,R=b.next();_!==null&&!R.done;T++,R=b.next()){_.index>T?(H=_,_=null):H=_.sibling;var z=p(h,_,R.value,E);if(z===null){_===null&&(_=H);break}e&&_&&z.alternate===null&&t(h,_),m=r(z,m,T),A===null?S=z:A.sibling=z,A=z,_=H}if(R.done)return n(h,_),Rt&&Ta(h,T),S;if(_===null){for(;!R.done;T++,R=b.next())R=d(h,R.value,E),R!==null&&(m=r(R,m,T),A===null?S=R:A.sibling=R,A=R);return Rt&&Ta(h,T),S}for(_=o(_);!R.done;T++,R=b.next())R=g(_,h,T,R.value,E),R!==null&&(e&&R.alternate!==null&&_.delete(R.key===null?T:R.key),m=r(R,m,T),A===null?S=R:A.sibling=R,A=R);return e&&_.forEach(function(F){return t(h,F)}),Rt&&Ta(h,T),S}function x(h,m,b,E){if(typeof b=="object"&&b!==null&&b.type===Yc&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Sg:e:{for(var S=b.key;m!==null;){if(m.key===S){if(S=b.type,S===Yc){if(m.tag===7){n(h,m.sibling),E=i(m,b.props.children),E.return=h,h=E;break e}}else if(m.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===cs&&bl(S)===m.type){n(h,m.sibling),E=i(m,b.props),sp(E,b),E.return=h,h=E;break e}n(h,m);break}else t(h,m);m=m.sibling}b.type===Yc?(E=vl(b.props.children,h.mode,E,b.key),E.return=h,h=E):(E=Gg(b.type,b.key,b.props,null,h.mode,E),sp(E,b),E.return=h,h=E)}return a(h);case pp:e:{for(S=b.key;m!==null;){if(m.key===S)if(m.tag===4&&m.stateNode.containerInfo===b.containerInfo&&m.stateNode.implementation===b.implementation){n(h,m.sibling),E=i(m,b.children||[]),E.return=h,h=E;break e}else{n(h,m);break}else t(h,m);m=m.sibling}E=fw(b,h.mode,E),E.return=h,h=E}return a(h);case cs:return b=bl(b),x(h,m,b,E)}if(fp(b))return y(h,m,b,E);if(rp(b)){if(S=rp(b),typeof S!="function")throw Error(ke(150));return b=S.call(b),v(h,m,b,E)}if(typeof b.then=="function")return x(h,m,Hg(b),E);if(b.$$typeof===Ma)return x(h,m,Rg(h,b),E);zg(h,b)}return typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint"?(b=""+b,m!==null&&m.tag===6?(n(h,m.sibling),E=i(m,b),E.return=h,h=E):(n(h,m),E=pw(b,h.mode,E),E.return=h,h=E),a(h)):n(h,m)}return function(h,m,b,E){try{$p=0;var S=x(h,m,b,E);return dd=null,S}catch(_){if(_===Md||_===jh)throw _;var A=yi(29,_,null,h.mode);return A.lanes=E,A.return=h,A}}}var Al=t5(!0),n5=t5(!1),ds=!1;function X1(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function n1(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Es(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ks(e,t,n){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Ut&2)!==0){var i=o.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),o.pending=t,t=ch(e),F_(e,null,n),t}return Nh(e,o,t,n),ch(e)}function wp(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,v_(e,n)}}function gw(e,t){var n=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,n===o)){var i=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?i=r=a:r=r.next=a,n=n.next}while(n!==null);r===null?i=r=t:r=r.next=t}else i=r=t;n={baseState:o.baseState,firstBaseUpdate:i,lastBaseUpdate:r,shared:o.shared,callbacks:o.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var o1=!1;function Ep(){if(o1){var e=cd;if(e!==null)throw e}}function kp(e,t,n,o){o1=!1;var i=e.updateQueue;ds=!1;var r=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,c=l.next;l.next=null,a===null?r=c:a.next=c,a=l;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==a&&(s===null?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(r!==null){var d=i.baseState;a=0,u=c=l=null,s=r;do{var p=s.lane&-536870913,g=p!==s.lane;if(g?(Lt&p)===p:(o&p)===p){p!==0&&p===hd&&(o1=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var y=e,v=s;p=t;var x=n;switch(v.tag){case 1:if(y=v.payload,typeof y=="function"){d=y.call(x,d,p);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,p=typeof y=="function"?y.call(x,d,p):y,p==null)break e;d=yn({},d,p);break e;case 2:ds=!0}}p=s.callback,p!==null&&(e.flags|=64,g&&(e.flags|=8192),g=i.callbacks,g===null?i.callbacks=[p]:g.push(p))}else g={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(c=u=g,l=d):u=u.next=g,a|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;g=s,s=g.next,g.next=null,i.lastBaseUpdate=g,i.shared.pending=null}}while(!0);u===null&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,r===null&&(i.shared.lanes=0),Rs|=a,e.lanes=a,e.memoizedState=d}}function o5(e,t){if(typeof e!="function")throw Error(ke(191,e));e.call(t)}function i5(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)o5(n[e],t)}var bd=Kr(null),fh=Kr(0);function fL(e,t){e=Na,pn(fh,e),pn(bd,t),Na=e|t.baseLanes}function i1(){pn(fh,Na),pn(bd,bd.current)}function W1(){Na=fh.current,uo(bd),uo(fh)}var Ti=Kr(null),Wi=null;function ps(e){var t=e.alternate;pn(In,In.current&1),pn(Ti,e),Wi===null&&(t===null||bd.current!==null||t.memoizedState!==null)&&(Wi=e)}function r1(e){pn(In,In.current),pn(Ti,e),Wi===null&&(Wi=e)}function r5(e){e.tag===22?(pn(In,In.current),pn(Ti,e),Wi===null&&(Wi=e)):fs(e)}function fs(){pn(In,In.current),pn(Ti,Ti.current)}function bi(e){uo(Ti),Wi===e&&(Wi=null),uo(In)}var In=Kr(0);function mh(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||S1(n)||T1(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var za=0,mt=null,nn=null,Wn=null,gh=!1,ud=!1,Ml=!1,hh=0,Np=0,pd=null,yB=0;function zn(){throw Error(ke(321))}function Z1(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Si(e[n],t[n]))return!1;return!0}function Q1(e,t,n,o,i,r){return za=r,mt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,rt.H=e===null||e.memoizedState===null?$5:cE,Ml=!1,r=n(o,i),Ml=!1,ud&&(r=s5(t,n,o,i)),a5(e),r}function a5(e){rt.H=jp;var t=nn!==null&&nn.next!==null;if(za=0,Wn=nn=mt=null,gh=!1,Np=0,pd=null,t)throw Error(ke(300));e===null||Jn||(e=e.dependencies,e!==null&&uh(e)&&(Jn=!0))}function s5(e,t,n,o){mt=e;var i=0;do{if(ud&&(pd=null),Np=0,ud=!1,25<=i)throw Error(ke(301));if(i+=1,Wn=nn=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}rt.H=N5,r=t(n,o)}while(ud);return r}function xB(){var e=rt.H,t=e.useState()[0];return t=typeof t.then=="function"?Zp(t):t,e=e.useState()[0],(nn!==null?nn.memoizedState:null)!==e&&(mt.flags|=1024),t}function J1(){var e=hh!==0;return hh=0,e}function eE(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function tE(e){if(gh){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}gh=!1}za=0,Wn=nn=mt=null,ud=!1,Np=hh=0,pd=null}function No(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wn===null?mt.memoizedState=Wn=e:Wn=Wn.next=e,Wn}function Gn(){if(nn===null){var e=mt.alternate;e=e!==null?e.memoizedState:null}else e=nn.next;var t=Wn===null?mt.memoizedState:Wn.next;if(t!==null)Wn=t,nn=e;else{if(e===null)throw mt.alternate===null?Error(ke(467)):Error(ke(310));nn=e,e={memoizedState:nn.memoizedState,baseState:nn.baseState,baseQueue:nn.baseQueue,queue:nn.queue,next:null},Wn===null?mt.memoizedState=Wn=e:Wn=Wn.next=e}return Wn}function Ph(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zp(e){var t=Np;return Np+=1,pd===null&&(pd=[]),e=e5(pd,e,t),t=mt,(Wn===null?t.memoizedState:Wn.next)===null&&(t=t.alternate,rt.H=t===null||t.memoizedState===null?$5:cE),e}function Bh(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Zp(e);if(e.$$typeof===Ma)return vo(e)}throw Error(ke(438,String(e)))}function nE(e){var t=null,n=mt.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var o=mt.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(t={data:o.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Ph(),mt.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),o=0;o<e;o++)n[o]=iP;return t.index++,n}function Oa(e,t){return typeof t=="function"?t(e):t}function Yg(e){var t=Gn();return oE(t,nn,e)}function oE(e,t,n){var o=e.queue;if(o===null)throw Error(ke(311));o.lastRenderedReducer=n;var i=e.baseQueue,r=o.pending;if(r!==null){if(i!==null){var a=i.next;i.next=r.next,r.next=a}t.baseQueue=i=r,o.pending=null}if(r=e.baseState,i===null)e.memoizedState=r;else{t=i.next;var s=a=null,l=null,c=t,u=!1;do{var d=c.lane&-536870913;if(d!==c.lane?(Lt&d)===d:(za&d)===d){var p=c.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),d===hd&&(u=!0);else if((za&p)===p){c=c.next,p===hd&&(u=!0);continue}else d={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=d,a=r):l=l.next=d,mt.lanes|=p,Rs|=p;d=c.action,Ml&&n(r,d),r=c.hasEagerState?c.eagerState:n(r,d)}else p={lane:d,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=p,a=r):l=l.next=p,mt.lanes|=d,Rs|=d;c=c.next}while(c!==null&&c!==t);if(l===null?a=r:l.next=s,!Si(r,e.memoizedState)&&(Jn=!0,u&&(n=cd,n!==null)))throw n;e.memoizedState=r,e.baseState=a,e.baseQueue=l,o.lastRenderedState=r}return i===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function hw(e){var t=Gn(),n=t.queue;if(n===null)throw Error(ke(311));n.lastRenderedReducer=e;var o=n.dispatch,i=n.pending,r=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do r=e(r,a.action),a=a.next;while(a!==i);Si(r,t.memoizedState)||(Jn=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),n.lastRenderedState=r}return[r,o]}function l5(e,t,n){var o=mt,i=Gn(),r=Rt;if(r){if(n===void 0)throw Error(ke(407));n=n()}else n=t();var a=!Si((nn||i).memoizedState,n);if(a&&(i.memoizedState=n,Jn=!0),i=i.queue,iE(u5.bind(null,o,i,e),[e]),i.getSnapshot!==t||a||Wn!==null&&Wn.memoizedState.tag&1){if(o.flags|=2048,yd(9,{destroy:void 0},d5.bind(null,o,i,n,t),null),sn===null)throw Error(ke(349));r||(za&127)!==0||c5(o,t,n)}return n}function c5(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=mt.updateQueue,t===null?(t=Ph(),mt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function d5(e,t,n,o){t.value=n,t.getSnapshot=o,p5(t)&&f5(e)}function u5(e,t,n){return n(function(){p5(t)&&f5(e)})}function p5(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Si(e,n)}catch{return!0}}function f5(e){var t=Rl(e,2);t!==null&&ei(t,e,2)}function a1(e){var t=No();if(typeof e=="function"){var n=e;if(e=n(),Ml){gs(!0);try{n()}finally{gs(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oa,lastRenderedState:e},t}function m5(e,t,n,o){return e.baseState=n,oE(e,nn,typeof o=="function"?o:Oa)}function vB(e,t,n,o,i){if(Uh(e))throw Error(ke(485));if(e=t.action,e!==null){var r={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){r.listeners.push(a)}};rt.T!==null?n(!0):r.isTransition=!1,o(r),n=t.pending,n===null?(r.next=t.pending=r,g5(t,r)):(r.next=n.next,t.pending=n.next=r)}}function g5(e,t){var n=t.action,o=t.payload,i=e.state;if(t.isTransition){var r=rt.T,a={};rt.T=a;try{var s=n(i,o),l=rt.S;l!==null&&l(a,s),mL(e,t,s)}catch(c){s1(e,t,c)}finally{r!==null&&a.types!==null&&(r.types=a.types),rt.T=r}}else try{r=n(i,o),mL(e,t,r)}catch(c){s1(e,t,c)}}function mL(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(o){gL(e,t,o)},function(o){return s1(e,t,o)}):gL(e,t,n)}function gL(e,t,n){t.status="fulfilled",t.value=n,h5(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,g5(e,n)))}function s1(e,t,n){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status="rejected",t.reason=n,h5(t),t=t.next;while(t!==o)}e.action=null}function h5(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function b5(e,t){return t}function hL(e,t){if(Rt){var n=sn.formState;if(n!==null){e:{var o=mt;if(Rt){if(bn){t:{for(var i=bn,r=Xi;i.nodeType!==8;){if(!r){i=null;break t}if(i=Zi(i.nextSibling),i===null){i=null;break t}}r=i.data,i=r==="F!"||r==="F"?i:null}if(i){bn=Zi(i.nextSibling),o=i.data==="F!";break e}}_s(o)}o=!1}o&&(t=n[0])}}return n=No(),n.memoizedState=n.baseState=t,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:b5,lastRenderedState:t},n.queue=o,n=H5.bind(null,mt,o),o.dispatch=n,o=a1(!1),r=lE.bind(null,mt,!1,o.queue),o=No(),i={state:t,dispatch:null,action:e,pending:null},o.queue=i,n=vB.bind(null,mt,i,r,n),i.dispatch=n,o.memoizedState=e,[t,n,!1]}function bL(e){var t=Gn();return y5(t,nn,e)}function y5(e,t,n){if(t=oE(e,t,b5)[0],e=Yg(Oa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var o=Zp(t)}catch(a){throw a===Md?jh:a}else o=t;t=Gn();var i=t.queue,r=i.dispatch;return n!==t.memoizedState&&(mt.flags|=2048,yd(9,{destroy:void 0},wB.bind(null,i,n),null)),[o,r,e]}function wB(e,t){e.action=t}function yL(e){var t=Gn(),n=nn;if(n!==null)return y5(t,n,e);Gn(),t=t.memoizedState,n=Gn();var o=n.queue.dispatch;return n.memoizedState=e,[t,o,!1]}function yd(e,t,n,o){return e={tag:e,create:n,deps:o,inst:t,next:null},t=mt.updateQueue,t===null&&(t=Ph(),mt.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(o=n.next,n.next=e,e.next=o,t.lastEffect=e),e}function x5(){return Gn().memoizedState}function Xg(e,t,n,o){var i=No();mt.flags|=e,i.memoizedState=yd(1|t,{destroy:void 0},n,o===void 0?null:o)}function Vh(e,t,n,o){var i=Gn();o=o===void 0?null:o;var r=i.memoizedState.inst;nn!==null&&o!==null&&Z1(o,nn.memoizedState.deps)?i.memoizedState=yd(t,r,n,o):(mt.flags|=e,i.memoizedState=yd(1|t,r,n,o))}function xL(e,t){Xg(8390656,8,e,t)}function iE(e,t){Vh(2048,8,e,t)}function EB(e){mt.flags|=4;var t=mt.updateQueue;if(t===null)t=Ph(),mt.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function v5(e){var t=Gn().memoizedState;return EB({ref:t,nextImpl:e}),function(){if((Ut&2)!==0)throw Error(ke(440));return t.impl.apply(void 0,arguments)}}function w5(e,t){return Vh(4,2,e,t)}function E5(e,t){return Vh(4,4,e,t)}function k5(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function S5(e,t,n){n=n!=null?n.concat([e]):null,Vh(4,4,k5.bind(null,t,e),n)}function rE(){}function T5(e,t){var n=Gn();t=t===void 0?null:t;var o=n.memoizedState;return t!==null&&Z1(t,o[1])?o[0]:(n.memoizedState=[e,t],e)}function A5(e,t){var n=Gn();t=t===void 0?null:t;var o=n.memoizedState;if(t!==null&&Z1(t,o[1]))return o[0];if(o=e(),Ml){gs(!0);try{e()}finally{gs(!1)}}return n.memoizedState=[o,t],o}function aE(e,t,n){return n===void 0||(za&1073741824)!==0&&(Lt&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=m4(),mt.lanes|=e,Rs|=e,n)}function M5(e,t,n,o){return Si(n,t)?n:bd.current!==null?(e=aE(e,n,o),Si(e,t)||(Jn=!0),e):(za&42)===0||(za&1073741824)!==0&&(Lt&261930)===0?(Jn=!0,e.memoizedState=n):(e=m4(),mt.lanes|=e,Rs|=e,t)}function C5(e,t,n,o,i){var r=qt.p;qt.p=r!==0&&8>r?r:8;var a=rt.T,s={};rt.T=s,lE(e,!1,t,n);try{var l=i(),c=rt.S;if(c!==null&&c(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=bB(l,o);Sp(e,t,u,ki(e))}else Sp(e,t,o,ki(e))}catch(d){Sp(e,t,{then:function(){},status:"rejected",reason:d},ki())}finally{qt.p=r,a!==null&&s.types!==null&&(a.types=s.types),rt.T=a}}function kB(){}function l1(e,t,n,o){if(e.tag!==5)throw Error(ke(476));var i=L5(e).queue;C5(e,i,t,xl,n===null?kB:function(){return _5(e),n(o)})}function L5(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:xl,baseState:xl,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oa,lastRenderedState:xl},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oa,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function _5(e){var t=L5(e);t.next===null&&(t=e.alternate.memoizedState),Sp(e,t.next.queue,{},ki())}function sE(){return vo(Vp)}function D5(){return Gn().memoizedState}function R5(){return Gn().memoizedState}function SB(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=ki();e=Es(n);var o=ks(t,e,n);o!==null&&(ei(o,t,n),wp(o,t,n)),t={cache:G1()},e.payload=t;return}t=t.return}}function TB(e,t,n){var o=ki();n={lane:o,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Uh(e)?z5(t,n):(n=U1(e,t,n,o),n!==null&&(ei(n,e,o),O5(n,t,o)))}function H5(e,t,n){var o=ki();Sp(e,t,n,o)}function Sp(e,t,n,o){var i={lane:o,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Uh(e))z5(t,i);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var a=t.lastRenderedState,s=r(a,n);if(i.hasEagerState=!0,i.eagerState=s,Si(s,a))return Nh(e,t,i,0),sn===null&&$h(),!1}catch{}if(n=U1(e,t,i,o),n!==null)return ei(n,e,o),O5(n,t,o),!0}return!1}function lE(e,t,n,o){if(o={lane:2,revertLane:bE(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Uh(e)){if(t)throw Error(ke(479))}else t=U1(e,n,o,2),t!==null&&ei(t,e,2)}function Uh(e){var t=e.alternate;return e===mt||t!==null&&t===mt}function z5(e,t){ud=gh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function O5(e,t,n){if((n&4194048)!==0){var o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,v_(e,n)}}var jp={readContext:vo,use:Bh,useCallback:zn,useContext:zn,useEffect:zn,useImperativeHandle:zn,useLayoutEffect:zn,useInsertionEffect:zn,useMemo:zn,useReducer:zn,useRef:zn,useState:zn,useDebugValue:zn,useDeferredValue:zn,useTransition:zn,useSyncExternalStore:zn,useId:zn,useHostTransitionStatus:zn,useFormState:zn,useActionState:zn,useOptimistic:zn,useMemoCache:zn,useCacheRefresh:zn};jp.useEffectEvent=zn;var $5={readContext:vo,use:Bh,useCallback:function(e,t){return No().memoizedState=[e,t===void 0?null:t],e},useContext:vo,useEffect:xL,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Xg(4194308,4,k5.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Xg(4194308,4,e,t)},useInsertionEffect:function(e,t){Xg(4,2,e,t)},useMemo:function(e,t){var n=No();t=t===void 0?null:t;var o=e();if(Ml){gs(!0);try{e()}finally{gs(!1)}}return n.memoizedState=[o,t],o},useReducer:function(e,t,n){var o=No();if(n!==void 0){var i=n(t);if(Ml){gs(!0);try{n(t)}finally{gs(!1)}}}else i=t;return o.memoizedState=o.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},o.queue=e,e=e.dispatch=TB.bind(null,mt,e),[o.memoizedState,e]},useRef:function(e){var t=No();return e={current:e},t.memoizedState=e},useState:function(e){e=a1(e);var t=e.queue,n=H5.bind(null,mt,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:rE,useDeferredValue:function(e,t){var n=No();return aE(n,e,t)},useTransition:function(){var e=a1(!1);return e=C5.bind(null,mt,e.queue,!0,!1),No().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var o=mt,i=No();if(Rt){if(n===void 0)throw Error(ke(407));n=n()}else{if(n=t(),sn===null)throw Error(ke(349));(Lt&127)!==0||c5(o,t,n)}i.memoizedState=n;var r={value:n,getSnapshot:t};return i.queue=r,xL(u5.bind(null,o,r,e),[e]),o.flags|=2048,yd(9,{destroy:void 0},d5.bind(null,o,r,n,t),null),n},useId:function(){var e=No(),t=sn.identifierPrefix;if(Rt){var n=Vr,o=Br;n=(o&~(1<<32-Ei(o)-1)).toString(32)+n,t="_"+t+"R_"+n,n=hh++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=yB++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:sE,useFormState:hL,useActionState:hL,useOptimistic:function(e){var t=No();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=lE.bind(null,mt,!0,n),n.dispatch=t,[e,t]},useMemoCache:nE,useCacheRefresh:function(){return No().memoizedState=SB.bind(null,mt)},useEffectEvent:function(e){var t=No(),n={impl:e};return t.memoizedState=n,function(){if((Ut&2)!==0)throw Error(ke(440));return n.impl.apply(void 0,arguments)}}},cE={readContext:vo,use:Bh,useCallback:T5,useContext:vo,useEffect:iE,useImperativeHandle:S5,useInsertionEffect:w5,useLayoutEffect:E5,useMemo:A5,useReducer:Yg,useRef:x5,useState:function(){return Yg(Oa)},useDebugValue:rE,useDeferredValue:function(e,t){var n=Gn();return M5(n,nn.memoizedState,e,t)},useTransition:function(){var e=Yg(Oa)[0],t=Gn().memoizedState;return[typeof e=="boolean"?e:Zp(e),t]},useSyncExternalStore:l5,useId:D5,useHostTransitionStatus:sE,useFormState:bL,useActionState:bL,useOptimistic:function(e,t){var n=Gn();return m5(n,nn,e,t)},useMemoCache:nE,useCacheRefresh:R5};cE.useEffectEvent=v5;var N5={readContext:vo,use:Bh,useCallback:T5,useContext:vo,useEffect:iE,useImperativeHandle:S5,useInsertionEffect:w5,useLayoutEffect:E5,useMemo:A5,useReducer:hw,useRef:x5,useState:function(){return hw(Oa)},useDebugValue:rE,useDeferredValue:function(e,t){var n=Gn();return nn===null?aE(n,e,t):M5(n,nn.memoizedState,e,t)},useTransition:function(){var e=hw(Oa)[0],t=Gn().memoizedState;return[typeof e=="boolean"?e:Zp(e),t]},useSyncExternalStore:l5,useId:D5,useHostTransitionStatus:sE,useFormState:yL,useActionState:yL,useOptimistic:function(e,t){var n=Gn();return nn!==null?m5(n,nn,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:nE,useCacheRefresh:R5};N5.useEffectEvent=v5;function bw(e,t,n,o){t=e.memoizedState,n=n(o,t),n=n==null?t:yn({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var c1={enqueueSetState:function(e,t,n){e=e._reactInternals;var o=ki(),i=Es(o);i.payload=t,n!=null&&(i.callback=n),t=ks(e,i,o),t!==null&&(ei(t,e,o),wp(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var o=ki(),i=Es(o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ks(e,i,o),t!==null&&(ei(t,e,o),wp(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ki(),o=Es(n);o.tag=2,t!=null&&(o.callback=t),t=ks(e,o,n),t!==null&&(ei(t,e,n),wp(t,e,n))}};function vL(e,t,n,o,i,r,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,r,a):t.prototype&&t.prototype.isPureReactComponent?!Hp(n,o)||!Hp(i,r):!0}function wL(e,t,n,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,o),t.state!==e&&c1.enqueueReplaceState(t,t.state,null)}function Cl(e,t){var n=t;if("ref"in t){n={};for(var o in t)o!=="ref"&&(n[o]=t[o])}if(e=e.defaultProps){n===t&&(n=yn({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function j5(e){lh(e)}function P5(e){console.error(e)}function B5(e){lh(e)}function bh(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(o){setTimeout(function(){throw o})}}function EL(e,t,n){try{var o=e.onCaughtError;o(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function d1(e,t,n){return n=Es(n),n.tag=3,n.payload={element:null},n.callback=function(){bh(e,t)},n}function V5(e){return e=Es(e),e.tag=3,e}function U5(e,t,n,o){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var r=o.value;e.payload=function(){return i(r)},e.callback=function(){EL(t,n,o)}}var a=n.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(e.callback=function(){EL(t,n,o),typeof i!="function"&&(Ss===null?Ss=new Set([this]):Ss.add(this));var s=o.stack;this.componentDidCatch(o.value,{componentStack:s!==null?s:""})})}function AB(e,t,n,o,i){if(n.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(t=n.alternate,t!==null&&Ad(t,n,i,!0),n=Ti.current,n!==null){switch(n.tag){case 31:case 13:return Wi===null?Eh():n.alternate===null&&On===0&&(On=3),n.flags&=-257,n.flags|=65536,n.lanes=i,o===ph?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([o]):t.add(o),Cw(e,o,i)),!1;case 22:return n.flags|=65536,o===ph?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([o]):n.add(o)),Cw(e,o,i)),!1}throw Error(ke(435,n.tag))}return Cw(e,o,i),Eh(),!1}if(Rt)return t=Ti.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,o!==Zw&&(e=Error(ke(422),{cause:o}),Op(Yi(e,n)))):(o!==Zw&&(t=Error(ke(423),{cause:o}),Op(Yi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,o=Yi(o,n),i=d1(e.stateNode,o,i),gw(e,i),On!==4&&(On=2)),!1;var r=Error(ke(520),{cause:o});if(r=Yi(r,n),Mp===null?Mp=[r]:Mp.push(r),On!==4&&(On=2),t===null)return!0;o=Yi(o,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=d1(n.stateNode,o,e),gw(n,e),!1;case 1:if(t=n.type,r=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(Ss===null||!Ss.has(r))))return n.flags|=65536,i&=-i,n.lanes|=i,i=V5(i),U5(i,e,n,o),gw(n,i),!1}n=n.return}while(n!==null);return!1}var dE=Error(ke(461)),Jn=!1;function bo(e,t,n,o){t.child=e===null?n5(t,null,n,o):Al(t,e.child,n,o)}function kL(e,t,n,o,i){n=n.render;var r=t.ref;if("ref"in o){var a={};for(var s in o)s!=="ref"&&(a[s]=o[s])}else a=o;return Tl(t),o=Q1(e,t,n,a,r,i),s=J1(),e!==null&&!Jn?(eE(e,t,i),$a(e,t,i)):(Rt&&s&&K1(t),t.flags|=1,bo(e,t,o,i),t.child)}function SL(e,t,n,o,i){if(e===null){var r=n.type;return typeof r=="function"&&!q1(r)&&r.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=r,q5(e,t,r,o,i)):(e=Gg(n.type,null,o,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!uE(e,i)){var a=r.memoizedProps;if(n=n.compare,n=n!==null?n:Hp,n(a,o)&&e.ref===t.ref)return $a(e,t,i)}return t.flags|=1,e=_a(r,o),e.ref=t.ref,e.return=t,t.child=e}function q5(e,t,n,o,i){if(e!==null){var r=e.memoizedProps;if(Hp(r,o)&&e.ref===t.ref)if(Jn=!1,t.pendingProps=o=r,uE(e,i))(e.flags&131072)!==0&&(Jn=!0);else return t.lanes=e.lanes,$a(e,t,i)}return u1(e,t,n,o,i)}function K5(e,t,n,o){var i=o.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|n:n,e!==null){for(o=t.child=e.child,i=0;o!==null;)i=i|o.lanes|o.childLanes,o=o.sibling;o=i&~r}else o=0,t.child=null;return TL(e,t,r,n,o)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Fg(t,r!==null?r.cachePool:null),r!==null?fL(t,r):i1(),r5(t);else return o=t.lanes=536870912,TL(e,t,r!==null?r.baseLanes|n:n,n,o)}else r!==null?(Fg(t,r.cachePool),fL(t,r),fs(t),t.memoizedState=null):(e!==null&&Fg(t,null),i1(),fs(t));return bo(e,t,i,n),t.child}function gp(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function TL(e,t,n,o,i){var r=F1();return r=r===null?null:{parent:Qn._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&Fg(t,null),i1(),r5(t),e!==null&&Ad(e,t,o,!0),t.childLanes=i,null}function Wg(e,t){return t=yh({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function AL(e,t,n){return Al(t,e.child,null,n),e=Wg(t,t.pendingProps),e.flags|=2,bi(t),t.memoizedState=null,e}function MB(e,t,n){var o=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Rt){if(o.mode==="hidden")return e=Wg(t,o),t.lanes=536870912,gp(null,e);if(r1(t),(e=bn)?(e=$4(e,Xi),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ls!==null?{id:Br,overflow:Vr}:null,retryLane:536870912,hydrationErrors:null},n=X_(e),n.return=t,t.child=n,xo=t,bn=null)):e=null,e===null)throw _s(t);return t.lanes=536870912,null}return Wg(t,o)}var r=e.memoizedState;if(r!==null){var a=r.dehydrated;if(r1(t),i)if(t.flags&256)t.flags&=-257,t=AL(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(ke(558));else if(Jn||Ad(e,t,n,!1),i=(n&e.childLanes)!==0,Jn||i){if(o=sn,o!==null&&(a=w_(o,n),a!==0&&a!==r.retryLane))throw r.retryLane=a,Rl(e,a),ei(o,e,a),dE;Eh(),t=AL(e,t,n)}else e=r.treeContext,bn=Zi(a.nextSibling),xo=t,Rt=!0,ws=null,Xi=!1,e!==null&&Z_(t,e),t=Wg(t,o),t.flags|=4096;return t}return e=_a(e.child,{mode:o.mode,children:o.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Zg(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(ke(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function u1(e,t,n,o,i){return Tl(t),n=Q1(e,t,n,o,void 0,i),o=J1(),e!==null&&!Jn?(eE(e,t,i),$a(e,t,i)):(Rt&&o&&K1(t),t.flags|=1,bo(e,t,n,i),t.child)}function ML(e,t,n,o,i,r){return Tl(t),t.updateQueue=null,n=s5(t,o,n,i),a5(e),o=J1(),e!==null&&!Jn?(eE(e,t,r),$a(e,t,r)):(Rt&&o&&K1(t),t.flags|=1,bo(e,t,n,r),t.child)}function CL(e,t,n,o,i){if(Tl(t),t.stateNode===null){var r=nd,a=n.contextType;typeof a=="object"&&a!==null&&(r=vo(a)),r=new n(o,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=c1,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=o,r.state=t.memoizedState,r.refs={},X1(t),a=n.contextType,r.context=typeof a=="object"&&a!==null?vo(a):nd,r.state=t.memoizedState,a=n.getDerivedStateFromProps,typeof a=="function"&&(bw(t,n,a,o),r.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(a=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),a!==r.state&&c1.enqueueReplaceState(r,r.state,null),kp(t,o,r,i),Ep(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),o=!0}else if(e===null){r=t.stateNode;var s=t.memoizedProps,l=Cl(n,s);r.props=l;var c=r.context,u=n.contextType;a=nd,typeof u=="object"&&u!==null&&(a=vo(u));var d=n.getDerivedStateFromProps;u=typeof d=="function"||typeof r.getSnapshotBeforeUpdate=="function",s=t.pendingProps!==s,u||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(s||c!==a)&&wL(t,r,o,a),ds=!1;var p=t.memoizedState;r.state=p,kp(t,o,r,i),Ep(),c=t.memoizedState,s||p!==c||ds?(typeof d=="function"&&(bw(t,n,d,o),c=t.memoizedState),(l=ds||vL(t,n,l,o,p,c,a))?(u||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=c),r.props=o,r.state=c,r.context=a,o=l):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{r=t.stateNode,n1(e,t),a=t.memoizedProps,u=Cl(n,a),r.props=u,d=t.pendingProps,p=r.context,c=n.contextType,l=nd,typeof c=="object"&&c!==null&&(l=vo(c)),s=n.getDerivedStateFromProps,(c=typeof s=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(a!==d||p!==l)&&wL(t,r,o,l),ds=!1,p=t.memoizedState,r.state=p,kp(t,o,r,i),Ep();var g=t.memoizedState;a!==d||p!==g||ds||e!==null&&e.dependencies!==null&&uh(e.dependencies)?(typeof s=="function"&&(bw(t,n,s,o),g=t.memoizedState),(u=ds||vL(t,n,u,o,p,g,l)||e!==null&&e.dependencies!==null&&uh(e.dependencies))?(c||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(o,g,l),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(o,g,l)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=g),r.props=o,r.state=g,r.context=l,o=u):(typeof r.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),o=!1)}return r=o,Zg(e,t),o=(t.flags&128)!==0,r||o?(r=t.stateNode,n=o&&typeof n.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&o?(t.child=Al(t,e.child,null,i),t.child=Al(t,null,n,i)):bo(e,t,n,i),t.memoizedState=r.state,e=t.child):e=$a(e,t,i),e}function LL(e,t,n,o){return Sl(),t.flags|=256,bo(e,t,n,o),t.child}var yw={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xw(e){return{baseLanes:e,cachePool:J_()}}function vw(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=xi),e}function I5(e,t,n){var o=t.pendingProps,i=!1,r=(t.flags&128)!==0,a;if((a=r)||(a=e!==null&&e.memoizedState===null?!1:(In.current&2)!==0),a&&(i=!0,t.flags&=-129),a=(t.flags&32)!==0,t.flags&=-33,e===null){if(Rt){if(i?ps(t):fs(t),(e=bn)?(e=$4(e,Xi),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ls!==null?{id:Br,overflow:Vr}:null,retryLane:536870912,hydrationErrors:null},n=X_(e),n.return=t,t.child=n,xo=t,bn=null)):e=null,e===null)throw _s(t);return T1(e)?t.lanes=32:t.lanes=536870912,null}var s=o.children;return o=o.fallback,i?(fs(t),i=t.mode,s=yh({mode:"hidden",children:s},i),o=vl(o,i,n,null),s.return=t,o.return=t,s.sibling=o,t.child=s,o=t.child,o.memoizedState=xw(n),o.childLanes=vw(e,a,n),t.memoizedState=yw,gp(null,o)):(ps(t),p1(t,s))}var l=e.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(r)t.flags&256?(ps(t),t.flags&=-257,t=ww(e,t,n)):t.memoizedState!==null?(fs(t),t.child=e.child,t.flags|=128,t=null):(fs(t),s=o.fallback,i=t.mode,o=yh({mode:"visible",children:o.children},i),s=vl(s,i,n,null),s.flags|=2,o.return=t,s.return=t,o.sibling=s,t.child=o,Al(t,e.child,null,n),o=t.child,o.memoizedState=xw(n),o.childLanes=vw(e,a,n),t.memoizedState=yw,t=gp(null,o));else if(ps(t),T1(s)){if(a=s.nextSibling&&s.nextSibling.dataset,a)var c=a.dgst;a=c,o=Error(ke(419)),o.stack="",o.digest=a,Op({value:o,source:null,stack:null}),t=ww(e,t,n)}else if(Jn||Ad(e,t,n,!1),a=(n&e.childLanes)!==0,Jn||a){if(a=sn,a!==null&&(o=w_(a,n),o!==0&&o!==l.retryLane))throw l.retryLane=o,Rl(e,o),ei(a,e,o),dE;S1(s)||Eh(),t=ww(e,t,n)}else S1(s)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,bn=Zi(s.nextSibling),xo=t,Rt=!0,ws=null,Xi=!1,e!==null&&Z_(t,e),t=p1(t,o.children),t.flags|=4096);return t}return i?(fs(t),s=o.fallback,i=t.mode,l=e.child,c=l.sibling,o=_a(l,{mode:"hidden",children:o.children}),o.subtreeFlags=l.subtreeFlags&65011712,c!==null?s=_a(c,s):(s=vl(s,i,n,null),s.flags|=2),s.return=t,o.return=t,o.sibling=s,t.child=o,gp(null,o),o=t.child,s=e.child.memoizedState,s===null?s=xw(n):(i=s.cachePool,i!==null?(l=Qn._currentValue,i=i.parent!==l?{parent:l,pool:l}:i):i=J_(),s={baseLanes:s.baseLanes|n,cachePool:i}),o.memoizedState=s,o.childLanes=vw(e,a,n),t.memoizedState=yw,gp(e.child,o)):(ps(t),n=e.child,e=n.sibling,n=_a(n,{mode:"visible",children:o.children}),n.return=t,n.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=n,t.memoizedState=null,n)}function p1(e,t){return t=yh({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function yh(e,t){return e=yi(22,e,null,t),e.lanes=0,e}function ww(e,t,n){return Al(t,e.child,null,n),e=p1(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function _L(e,t,n){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),Jw(e.return,t,n)}function Ew(e,t,n,o,i,r){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:n,tailMode:i,treeForkCount:r}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=o,a.tail=n,a.tailMode=i,a.treeForkCount=r)}function G5(e,t,n){var o=t.pendingProps,i=o.revealOrder,r=o.tail;o=o.children;var a=In.current,s=(a&2)!==0;if(s?(a=a&1|2,t.flags|=128):a&=1,pn(In,a),bo(e,t,o,n),o=Rt?zp:0,!s&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&_L(e,n,t);else if(e.tag===19)_L(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&mh(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ew(t,!1,i,n,r,o);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&mh(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ew(t,!0,n,null,r,o);break;case"together":Ew(t,!1,null,null,void 0,o);break;default:t.memoizedState=null}return t.child}function $a(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Rs|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ad(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(ke(153));if(t.child!==null){for(e=t.child,n=_a(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=_a(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function uE(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&uh(e)))}function CB(e,t,n){switch(t.tag){case 3:ih(t,t.stateNode.containerInfo),us(t,Qn,e.memoizedState.cache),Sl();break;case 27:case 5:Bw(t);break;case 4:ih(t,t.stateNode.containerInfo);break;case 10:us(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,r1(t),null;break;case 13:var o=t.memoizedState;if(o!==null)return o.dehydrated!==null?(ps(t),t.flags|=128,null):(n&t.child.childLanes)!==0?I5(e,t,n):(ps(t),e=$a(e,t,n),e!==null?e.sibling:null);ps(t);break;case 19:var i=(e.flags&128)!==0;if(o=(n&t.childLanes)!==0,o||(Ad(e,t,n,!1),o=(n&t.childLanes)!==0),i){if(o)return G5(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),pn(In,In.current),o)break;return null;case 22:return t.lanes=0,K5(e,t,n,t.pendingProps);case 24:us(t,Qn,e.memoizedState.cache)}return $a(e,t,n)}function F5(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Jn=!0;else{if(!uE(e,n)&&(t.flags&128)===0)return Jn=!1,CB(e,t,n);Jn=(e.flags&131072)!==0}else Jn=!1,Rt&&(t.flags&1048576)!==0&&W_(t,zp,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=bl(t.elementType),t.type=e,typeof e=="function")q1(e)?(o=Cl(e,o),t.tag=1,t=CL(null,t,e,o,n)):(t.tag=0,t=u1(null,t,e,o,n));else{if(e!=null){var i=e.$$typeof;if(i===L1){t.tag=11,t=kL(null,t,e,o,n);break e}else if(i===_1){t.tag=14,t=SL(null,t,e,o,n);break e}}throw t=jw(e)||e,Error(ke(306,t,""))}}return t;case 0:return u1(e,t,t.type,t.pendingProps,n);case 1:return o=t.type,i=Cl(o,t.pendingProps),CL(e,t,o,i,n);case 3:e:{if(ih(t,t.stateNode.containerInfo),e===null)throw Error(ke(387));o=t.pendingProps;var r=t.memoizedState;i=r.element,n1(e,t),kp(t,o,null,n);var a=t.memoizedState;if(o=a.cache,us(t,Qn,o),o!==r.cache&&e1(t,[Qn],n,!0),Ep(),o=a.element,r.isDehydrated)if(r={element:o,isDehydrated:!1,cache:a.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=LL(e,t,o,n);break e}else if(o!==i){i=Yi(Error(ke(424)),t),Op(i),t=LL(e,t,o,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,bn=Zi(e.firstChild),xo=t,Rt=!0,ws=null,Xi=!0,n=n5(t,null,o,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Sl(),o===i){t=$a(e,t,n);break e}bo(e,t,o,n)}t=t.child}return t;case 26:return Zg(e,t),e===null?(n=QL(t.type,null,t.pendingProps,null))?t.memoizedState=n:Rt||(n=t.type,e=t.pendingProps,o=Ah(vs.current).createElement(n),o[yo]=t,o[ti]=e,wo(o,n,e),co(o),t.stateNode=o):t.memoizedState=QL(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Bw(t),e===null&&Rt&&(o=t.stateNode=N4(t.type,t.pendingProps,vs.current),xo=t,Xi=!0,i=bn,zs(t.type)?(A1=i,bn=Zi(o.firstChild)):bn=i),bo(e,t,t.pendingProps.children,n),Zg(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Rt&&((i=o=bn)&&(o=n9(o,t.type,t.pendingProps,Xi),o!==null?(t.stateNode=o,xo=t,bn=Zi(o.firstChild),Xi=!1,i=!0):i=!1),i||_s(t)),Bw(t),i=t.type,r=t.pendingProps,a=e!==null?e.memoizedProps:null,o=r.children,E1(i,r)?o=null:a!==null&&E1(i,a)&&(t.flags|=32),t.memoizedState!==null&&(i=Q1(e,t,xB,null,null,n),Vp._currentValue=i),Zg(e,t),bo(e,t,o,n),t.child;case 6:return e===null&&Rt&&((e=n=bn)&&(n=o9(n,t.pendingProps,Xi),n!==null?(t.stateNode=n,xo=t,bn=null,e=!0):e=!1),e||_s(t)),null;case 13:return I5(e,t,n);case 4:return ih(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=Al(t,null,o,n):bo(e,t,o,n),t.child;case 11:return kL(e,t,t.type,t.pendingProps,n);case 7:return bo(e,t,t.pendingProps,n),t.child;case 8:return bo(e,t,t.pendingProps.children,n),t.child;case 12:return bo(e,t,t.pendingProps.children,n),t.child;case 10:return o=t.pendingProps,us(t,t.type,o.value),bo(e,t,o.children,n),t.child;case 9:return i=t.type._context,o=t.pendingProps.children,Tl(t),i=vo(i),o=o(i),t.flags|=1,bo(e,t,o,n),t.child;case 14:return SL(e,t,t.type,t.pendingProps,n);case 15:return q5(e,t,t.type,t.pendingProps,n);case 19:return G5(e,t,n);case 31:return MB(e,t,n);case 22:return K5(e,t,n,t.pendingProps);case 24:return Tl(t),o=vo(Qn),e===null?(i=F1(),i===null&&(i=sn,r=G1(),i.pooledCache=r,r.refCount++,r!==null&&(i.pooledCacheLanes|=n),i=r),t.memoizedState={parent:o,cache:i},X1(t),us(t,Qn,i)):((e.lanes&n)!==0&&(n1(e,t),kp(t,null,null,n),Ep()),i=e.memoizedState,r=t.memoizedState,i.parent!==o?(i={parent:o,cache:o},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),us(t,Qn,o)):(o=r.cache,us(t,Qn,o),o!==i.cache&&e1(t,[Qn],n,!0))),bo(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(ke(156,t.tag))}function wa(e){e.flags|=4}function kw(e,t,n,o,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(b4())e.flags|=8192;else throw El=ph,Y1}else e.flags&=-16777217}function DL(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!B4(t))if(b4())e.flags|=8192;else throw El=ph,Y1}function Og(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?y_():536870912,e.lanes|=t,xd|=t)}function lp(e,t){if(!Rt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function hn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,o=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,o|=i.subtreeFlags&65011712,o|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,o|=i.subtreeFlags,o|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=o,e.childLanes=n,t}function LB(e,t,n){var o=t.pendingProps;switch(I1(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return hn(t),null;case 1:return hn(t),null;case 3:return n=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),Da(Qn),fd(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Kc(t)?wa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,mw())),hn(t),null;case 26:var i=t.type,r=t.memoizedState;return e===null?(wa(t),r!==null?(hn(t),DL(t,r)):(hn(t),kw(t,i,null,o,n))):r?r!==e.memoizedState?(wa(t),hn(t),DL(t,r)):(hn(t),t.flags&=-16777217):(e=e.memoizedProps,e!==o&&wa(t),hn(t),kw(t,i,e,o,n)),null;case 27:if(rh(t),n=vs.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&wa(t);else{if(!o){if(t.stateNode===null)throw Error(ke(166));return hn(t),null}e=qr.current,Kc(t)?aL(t,e):(e=N4(i,o,n),t.stateNode=e,wa(t))}return hn(t),null;case 5:if(rh(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&wa(t);else{if(!o){if(t.stateNode===null)throw Error(ke(166));return hn(t),null}if(r=qr.current,Kc(t))aL(t,r);else{var a=Ah(vs.current);switch(r){case 1:r=a.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:r=a.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":r=a.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":r=a.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":r=a.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof o.is=="string"?a.createElement("select",{is:o.is}):a.createElement("select"),o.multiple?r.multiple=!0:o.size&&(r.size=o.size);break;default:r=typeof o.is=="string"?a.createElement(i,{is:o.is}):a.createElement(i)}}r[yo]=t,r[ti]=o;e:for(a=t.child;a!==null;){if(a.tag===5||a.tag===6)r.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=r;e:switch(wo(r,i,o),i){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&wa(t)}}return hn(t),kw(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==o&&wa(t);else{if(typeof o!="string"&&t.stateNode===null)throw Error(ke(166));if(e=vs.current,Kc(t)){if(e=t.stateNode,n=t.memoizedProps,o=null,i=xo,i!==null)switch(i.tag){case 27:case 5:o=i.memoizedProps}e[yo]=t,e=!!(e.nodeValue===n||o!==null&&o.suppressHydrationWarning===!0||H4(e.nodeValue,n)),e||_s(t,!0)}else e=Ah(e).createTextNode(o),e[yo]=t,t.stateNode=e}return hn(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(o=Kc(t),n!==null){if(e===null){if(!o)throw Error(ke(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ke(557));e[yo]=t}else Sl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;hn(t),e=!1}else n=mw(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(bi(t),t):(bi(t),null);if((t.flags&128)!==0)throw Error(ke(558))}return hn(t),null;case 13:if(o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Kc(t),o!==null&&o.dehydrated!==null){if(e===null){if(!i)throw Error(ke(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(ke(317));i[yo]=t}else Sl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;hn(t),i=!1}else i=mw(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(bi(t),t):(bi(t),null)}return bi(t),(t.flags&128)!==0?(t.lanes=n,t):(n=o!==null,e=e!==null&&e.memoizedState!==null,n&&(o=t.child,i=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(i=o.alternate.memoizedState.cachePool.pool),r=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(r=o.memoizedState.cachePool.pool),r!==i&&(o.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Og(t,t.updateQueue),hn(t),null);case 4:return fd(),e===null&&yE(t.stateNode.containerInfo),hn(t),null;case 10:return Da(t.type),hn(t),null;case 19:if(uo(In),o=t.memoizedState,o===null)return hn(t),null;if(i=(t.flags&128)!==0,r=o.rendering,r===null)if(i)lp(o,!1);else{if(On!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=mh(e),r!==null){for(t.flags|=128,lp(o,!1),e=r.updateQueue,t.updateQueue=e,Og(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Y_(n,e),n=n.sibling;return pn(In,In.current&1|2),Rt&&Ta(t,o.treeForkCount),t.child}e=e.sibling}o.tail!==null&&vi()>vh&&(t.flags|=128,i=!0,lp(o,!1),t.lanes=4194304)}else{if(!i)if(e=mh(r),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Og(t,e),lp(o,!0),o.tail===null&&o.tailMode==="hidden"&&!r.alternate&&!Rt)return hn(t),null}else 2*vi()-o.renderingStartTime>vh&&n!==536870912&&(t.flags|=128,i=!0,lp(o,!1),t.lanes=4194304);o.isBackwards?(r.sibling=t.child,t.child=r):(e=o.last,e!==null?e.sibling=r:t.child=r,o.last=r)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=vi(),e.sibling=null,n=In.current,pn(In,i?n&1|2:n&1),Rt&&Ta(t,o.treeForkCount),e):(hn(t),null);case 22:case 23:return bi(t),W1(),o=t.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?(n&536870912)!==0&&(t.flags&128)===0&&(hn(t),t.subtreeFlags&6&&(t.flags|=8192)):hn(t),n=t.updateQueue,n!==null&&Og(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),o=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),o!==n&&(t.flags|=2048),e!==null&&uo(wl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Da(Qn),hn(t),null;case 25:return null;case 30:return null}throw Error(ke(156,t.tag))}function _B(e,t){switch(I1(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Da(Qn),fd(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return rh(t),null;case 31:if(t.memoizedState!==null){if(bi(t),t.alternate===null)throw Error(ke(340));Sl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(bi(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ke(340));Sl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return uo(In),null;case 4:return fd(),null;case 10:return Da(t.type),null;case 22:case 23:return bi(t),W1(),e!==null&&uo(wl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Da(Qn),null;case 25:return null;default:return null}}function Y5(e,t){switch(I1(t),t.tag){case 3:Da(Qn),fd();break;case 26:case 27:case 5:rh(t);break;case 4:fd();break;case 31:t.memoizedState!==null&&bi(t);break;case 13:bi(t);break;case 19:uo(In);break;case 10:Da(t.type);break;case 22:case 23:bi(t),W1(),e!==null&&uo(wl);break;case 24:Da(Qn)}}function Qp(e,t){try{var n=t.updateQueue,o=n!==null?n.lastEffect:null;if(o!==null){var i=o.next;n=i;do{if((n.tag&e)===e){o=void 0;var r=n.create,a=n.inst;o=r(),a.destroy=o}n=n.next}while(n!==i)}}catch(s){Wt(t,t.return,s)}}function Ds(e,t,n){try{var o=t.updateQueue,i=o!==null?o.lastEffect:null;if(i!==null){var r=i.next;o=r;do{if((o.tag&e)===e){var a=o.inst,s=a.destroy;if(s!==void 0){a.destroy=void 0,i=t;var l=n,c=s;try{c()}catch(u){Wt(i,l,u)}}}o=o.next}while(o!==r)}}catch(u){Wt(t,t.return,u)}}function X5(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{i5(t,n)}catch(o){Wt(e,e.return,o)}}}function W5(e,t,n){n.props=Cl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(o){Wt(e,t,o)}}function Tp(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof n=="function"?e.refCleanup=n(o):n.current=o}}catch(i){Wt(e,t,i)}}function Ur(e,t){var n=e.ref,o=e.refCleanup;if(n!==null)if(typeof o=="function")try{o()}catch(i){Wt(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Wt(e,t,i)}else n.current=null}function Z5(e){var t=e.type,n=e.memoizedProps,o=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&o.focus();break e;case"img":n.src?o.src=n.src:n.srcSet&&(o.srcset=n.srcSet)}}catch(i){Wt(e,e.return,i)}}function Sw(e,t,n){try{var o=e.stateNode;WB(o,e.type,n,t),o[ti]=t}catch(i){Wt(e,e.return,i)}}function Q5(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&zs(e.type)||e.tag===4}function Tw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Q5(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&zs(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function f1(e,t,n){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ca));else if(o!==4&&(o===27&&zs(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(f1(e,t,n),e=e.sibling;e!==null;)f1(e,t,n),e=e.sibling}function xh(e,t,n){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(o!==4&&(o===27&&zs(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(xh(e,t,n),e=e.sibling;e!==null;)xh(e,t,n),e=e.sibling}function J5(e){var t=e.stateNode,n=e.memoizedProps;try{for(var o=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);wo(t,o,n),t[yo]=e,t[ti]=n}catch(r){Wt(e,e.return,r)}}var Aa=!1,Zn=!1,Aw=!1,RL=typeof WeakSet=="function"?WeakSet:Set,lo=null;function DB(e,t){if(e=e.containerInfo,v1=_h,e=B_(e),B1(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var o=n.getSelection&&n.getSelection();if(o&&o.rangeCount!==0){n=o.anchorNode;var i=o.anchorOffset,r=o.focusNode;o=o.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,c=0,u=0,d=e,p=null;t:for(;;){for(var g;d!==n||i!==0&&d.nodeType!==3||(s=a+i),d!==r||o!==0&&d.nodeType!==3||(l=a+o),d.nodeType===3&&(a+=d.nodeValue.length),(g=d.firstChild)!==null;)p=d,d=g;for(;;){if(d===e)break t;if(p===n&&++c===i&&(s=a),p===r&&++u===o&&(l=a),(g=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=g}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(w1={focusedElem:e,selectionRange:n},_h=!1,lo=t;lo!==null;)if(t=lo,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,lo=e;else for(;lo!==null;){switch(t=lo,r=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&r!==null){e=void 0,n=t,i=r.memoizedProps,r=r.memoizedState,o=n.stateNode;try{var y=Cl(n.type,i);e=o.getSnapshotBeforeUpdate(y,r),o.__reactInternalSnapshotBeforeUpdate=e}catch(v){Wt(n,n.return,v)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)k1(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":k1(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(ke(163))}if(e=t.sibling,e!==null){e.return=t.return,lo=e;break}lo=t.return}}function e4(e,t,n){var o=n.flags;switch(n.tag){case 0:case 11:case 15:ka(e,n),o&4&&Qp(5,n);break;case 1:if(ka(e,n),o&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(a){Wt(n,n.return,a)}else{var i=Cl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(a){Wt(n,n.return,a)}}o&64&&X5(n),o&512&&Tp(n,n.return);break;case 3:if(ka(e,n),o&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{i5(e,t)}catch(a){Wt(n,n.return,a)}}break;case 27:t===null&&o&4&&J5(n);case 26:case 5:ka(e,n),t===null&&o&4&&Z5(n),o&512&&Tp(n,n.return);break;case 12:ka(e,n);break;case 31:ka(e,n),o&4&&o4(e,n);break;case 13:ka(e,n),o&4&&i4(e,n),o&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=BB.bind(null,n),i9(e,n))));break;case 22:if(o=n.memoizedState!==null||Aa,!o){t=t!==null&&t.memoizedState!==null||Zn,i=Aa;var r=Zn;Aa=o,(Zn=t)&&!r?Sa(e,n,(n.subtreeFlags&8772)!==0):ka(e,n),Aa=i,Zn=r}break;case 30:break;default:ka(e,n)}}function t4(e){var t=e.alternate;t!==null&&(e.alternate=null,t4(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&z1(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Sn=null,Qo=!1;function Ea(e,t,n){for(n=n.child;n!==null;)n4(e,t,n),n=n.sibling}function n4(e,t,n){if(wi&&typeof wi.onCommitFiberUnmount=="function")try{wi.onCommitFiberUnmount(Ip,n)}catch{}switch(n.tag){case 26:Zn||Ur(n,t),Ea(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Zn||Ur(n,t);var o=Sn,i=Qo;zs(n.type)&&(Sn=n.stateNode,Qo=!1),Ea(e,t,n),Lp(n.stateNode),Sn=o,Qo=i;break;case 5:Zn||Ur(n,t);case 6:if(o=Sn,i=Qo,Sn=null,Ea(e,t,n),Sn=o,Qo=i,Sn!==null)if(Qo)try{(Sn.nodeType===9?Sn.body:Sn.nodeName==="HTML"?Sn.ownerDocument.body:Sn).removeChild(n.stateNode)}catch(r){Wt(n,t,r)}else try{Sn.removeChild(n.stateNode)}catch(r){Wt(n,t,r)}break;case 18:Sn!==null&&(Qo?(e=Sn,FL(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),kd(e)):FL(Sn,n.stateNode));break;case 4:o=Sn,i=Qo,Sn=n.stateNode.containerInfo,Qo=!0,Ea(e,t,n),Sn=o,Qo=i;break;case 0:case 11:case 14:case 15:Ds(2,n,t),Zn||Ds(4,n,t),Ea(e,t,n);break;case 1:Zn||(Ur(n,t),o=n.stateNode,typeof o.componentWillUnmount=="function"&&W5(n,t,o)),Ea(e,t,n);break;case 21:Ea(e,t,n);break;case 22:Zn=(o=Zn)||n.memoizedState!==null,Ea(e,t,n),Zn=o;break;default:Ea(e,t,n)}}function o4(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{kd(e)}catch(n){Wt(t,t.return,n)}}}function i4(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{kd(e)}catch(n){Wt(t,t.return,n)}}function RB(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new RL),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new RL),t;default:throw Error(ke(435,e.tag))}}function $g(e,t){var n=RB(e);t.forEach(function(o){if(!n.has(o)){n.add(o);var i=VB.bind(null,e,o);o.then(i,i)}})}function Wo(e,t){var n=t.deletions;if(n!==null)for(var o=0;o<n.length;o++){var i=n[o],r=e,a=t,s=a;e:for(;s!==null;){switch(s.tag){case 27:if(zs(s.type)){Sn=s.stateNode,Qo=!1;break e}break;case 5:Sn=s.stateNode,Qo=!1;break e;case 3:case 4:Sn=s.stateNode.containerInfo,Qo=!0;break e}s=s.return}if(Sn===null)throw Error(ke(160));n4(r,a,i),Sn=null,Qo=!1,r=i.alternate,r!==null&&(r.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)r4(t,e),t=t.sibling}var vr=null;function r4(e,t){var n=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Wo(t,e),Zo(e),o&4&&(Ds(3,e,e.return),Qp(3,e),Ds(5,e,e.return));break;case 1:Wo(t,e),Zo(e),o&512&&(Zn||n===null||Ur(n,n.return)),o&64&&Aa&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?o:n.concat(o))));break;case 26:var i=vr;if(Wo(t,e),Zo(e),o&512&&(Zn||n===null||Ur(n,n.return)),o&4){var r=n!==null?n.memoizedState:null;if(o=e.memoizedState,n===null)if(o===null)if(e.stateNode===null){e:{o=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(o){case"title":r=i.getElementsByTagName("title")[0],(!r||r[Yp]||r[yo]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=i.createElement(o),i.head.insertBefore(r,i.querySelector("head > title"))),wo(r,o,n),r[yo]=e,co(r),o=r;break e;case"link":var a=e_("link","href",i).get(o+(n.href||""));if(a){for(var s=0;s<a.length;s++)if(r=a[s],r.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&r.getAttribute("rel")===(n.rel==null?null:n.rel)&&r.getAttribute("title")===(n.title==null?null:n.title)&&r.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(s,1);break t}}r=i.createElement(o),wo(r,o,n),i.head.appendChild(r);break;case"meta":if(a=e_("meta","content",i).get(o+(n.content||""))){for(s=0;s<a.length;s++)if(r=a[s],r.getAttribute("content")===(n.content==null?null:""+n.content)&&r.getAttribute("name")===(n.name==null?null:n.name)&&r.getAttribute("property")===(n.property==null?null:n.property)&&r.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute("charset")===(n.charSet==null?null:n.charSet)){a.splice(s,1);break t}}r=i.createElement(o),wo(r,o,n),i.head.appendChild(r);break;default:throw Error(ke(468,o))}r[yo]=e,co(r),o=r}e.stateNode=o}else t_(i,e.type,e.stateNode);else e.stateNode=JL(i,o,e.memoizedProps);else r!==o?(r===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):r.count--,o===null?t_(i,e.type,e.stateNode):JL(i,o,e.memoizedProps)):o===null&&e.stateNode!==null&&Sw(e,e.memoizedProps,n.memoizedProps)}break;case 27:Wo(t,e),Zo(e),o&512&&(Zn||n===null||Ur(n,n.return)),n!==null&&o&4&&Sw(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Wo(t,e),Zo(e),o&512&&(Zn||n===null||Ur(n,n.return)),e.flags&32){i=e.stateNode;try{gd(i,"")}catch(y){Wt(e,e.return,y)}}o&4&&e.stateNode!=null&&(i=e.memoizedProps,Sw(e,i,n!==null?n.memoizedProps:i)),o&1024&&(Aw=!0);break;case 6:if(Wo(t,e),Zo(e),o&4){if(e.stateNode===null)throw Error(ke(162));o=e.memoizedProps,n=e.stateNode;try{n.nodeValue=o}catch(y){Wt(e,e.return,y)}}break;case 3:if(eh=null,i=vr,vr=Mh(t.containerInfo),Wo(t,e),vr=i,Zo(e),o&4&&n!==null&&n.memoizedState.isDehydrated)try{kd(t.containerInfo)}catch(y){Wt(e,e.return,y)}Aw&&(Aw=!1,a4(e));break;case 4:o=vr,vr=Mh(e.stateNode.containerInfo),Wo(t,e),Zo(e),vr=o;break;case 12:Wo(t,e),Zo(e);break;case 31:Wo(t,e),Zo(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,$g(e,o)));break;case 13:Wo(t,e),Zo(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(qh=vi()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,$g(e,o)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,c=Aa,u=Zn;if(Aa=c||i,Zn=u||l,Wo(t,e),Zn=u,Aa=c,Zo(e),o&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||Aa||Zn||yl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(r=l.stateNode,i)a=r.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none";else{s=l.stateNode;var d=l.memoizedProps.style,p=d!=null&&d.hasOwnProperty("display")?d.display:null;s.style.display=p==null||typeof p=="boolean"?"":(""+p).trim()}}catch(y){Wt(l,l.return,y)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?"":l.memoizedProps}catch(y){Wt(l,l.return,y)}}}else if(t.tag===18){if(n===null){l=t;try{var g=l.stateNode;i?YL(g,!0):YL(l.stateNode,!1)}catch(y){Wt(l,l.return,y)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}o&4&&(o=e.updateQueue,o!==null&&(n=o.retryQueue,n!==null&&(o.retryQueue=null,$g(e,n))));break;case 19:Wo(t,e),Zo(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,$g(e,o)));break;case 30:break;case 21:break;default:Wo(t,e),Zo(e)}}function Zo(e){var t=e.flags;if(t&2){try{for(var n,o=e.return;o!==null;){if(Q5(o)){n=o;break}o=o.return}if(n==null)throw Error(ke(160));switch(n.tag){case 27:var i=n.stateNode,r=Tw(e);xh(e,r,i);break;case 5:var a=n.stateNode;n.flags&32&&(gd(a,""),n.flags&=-33);var s=Tw(e);xh(e,s,a);break;case 3:case 4:var l=n.stateNode.containerInfo,c=Tw(e);f1(e,c,l);break;default:throw Error(ke(161))}}catch(u){Wt(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function a4(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;a4(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ka(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)e4(e,t.alternate,t),t=t.sibling}function yl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ds(4,t,t.return),yl(t);break;case 1:Ur(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&W5(t,t.return,n),yl(t);break;case 27:Lp(t.stateNode);case 26:case 5:Ur(t,t.return),yl(t);break;case 22:t.memoizedState===null&&yl(t);break;case 30:yl(t);break;default:yl(t)}e=e.sibling}}function Sa(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var o=t.alternate,i=e,r=t,a=r.flags;switch(r.tag){case 0:case 11:case 15:Sa(i,r,n),Qp(4,r);break;case 1:if(Sa(i,r,n),o=r,i=o.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(c){Wt(o,o.return,c)}if(o=r,i=o.updateQueue,i!==null){var s=o.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)o5(l[i],s)}catch(c){Wt(o,o.return,c)}}n&&a&64&&X5(r),Tp(r,r.return);break;case 27:J5(r);case 26:case 5:Sa(i,r,n),n&&o===null&&a&4&&Z5(r),Tp(r,r.return);break;case 12:Sa(i,r,n);break;case 31:Sa(i,r,n),n&&a&4&&o4(i,r);break;case 13:Sa(i,r,n),n&&a&4&&i4(i,r);break;case 22:r.memoizedState===null&&Sa(i,r,n),Tp(r,r.return);break;case 30:break;default:Sa(i,r,n)}t=t.sibling}}function pE(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Wp(n))}function fE(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Wp(e))}function xr(e,t,n,o){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)s4(e,t,n,o),t=t.sibling}function s4(e,t,n,o){var i=t.flags;switch(t.tag){case 0:case 11:case 15:xr(e,t,n,o),i&2048&&Qp(9,t);break;case 1:xr(e,t,n,o);break;case 3:xr(e,t,n,o),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Wp(e)));break;case 12:if(i&2048){xr(e,t,n,o),e=t.stateNode;try{var r=t.memoizedProps,a=r.id,s=r.onPostCommit;typeof s=="function"&&s(a,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(l){Wt(t,t.return,l)}}else xr(e,t,n,o);break;case 31:xr(e,t,n,o);break;case 13:xr(e,t,n,o);break;case 23:break;case 22:r=t.stateNode,a=t.alternate,t.memoizedState!==null?r._visibility&2?xr(e,t,n,o):Ap(e,t):r._visibility&2?xr(e,t,n,o):(r._visibility|=2,Gc(e,t,n,o,(t.subtreeFlags&10256)!==0||!1)),i&2048&&pE(a,t);break;case 24:xr(e,t,n,o),i&2048&&fE(t.alternate,t);break;default:xr(e,t,n,o)}}function Gc(e,t,n,o,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,a=t,s=n,l=o,c=a.flags;switch(a.tag){case 0:case 11:case 15:Gc(r,a,s,l,i),Qp(8,a);break;case 23:break;case 22:var u=a.stateNode;a.memoizedState!==null?u._visibility&2?Gc(r,a,s,l,i):Ap(r,a):(u._visibility|=2,Gc(r,a,s,l,i)),i&&c&2048&&pE(a.alternate,a);break;case 24:Gc(r,a,s,l,i),i&&c&2048&&fE(a.alternate,a);break;default:Gc(r,a,s,l,i)}t=t.sibling}}function Ap(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,o=t,i=o.flags;switch(o.tag){case 22:Ap(n,o),i&2048&&pE(o.alternate,o);break;case 24:Ap(n,o),i&2048&&fE(o.alternate,o);break;default:Ap(n,o)}t=t.sibling}}var hp=8192;function Ic(e,t,n){if(e.subtreeFlags&hp)for(e=e.child;e!==null;)l4(e,t,n),e=e.sibling}function l4(e,t,n){switch(e.tag){case 26:Ic(e,t,n),e.flags&hp&&e.memoizedState!==null&&h9(n,vr,e.memoizedState,e.memoizedProps);break;case 5:Ic(e,t,n);break;case 3:case 4:var o=vr;vr=Mh(e.stateNode.containerInfo),Ic(e,t,n),vr=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=hp,hp=16777216,Ic(e,t,n),hp=o):Ic(e,t,n));break;default:Ic(e,t,n)}}function c4(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function cp(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var o=t[n];lo=o,u4(o,e)}c4(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)d4(e),e=e.sibling}function d4(e){switch(e.tag){case 0:case 11:case 15:cp(e),e.flags&2048&&Ds(9,e,e.return);break;case 3:cp(e);break;case 12:cp(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Qg(e)):cp(e);break;default:cp(e)}}function Qg(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var o=t[n];lo=o,u4(o,e)}c4(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ds(8,t,t.return),Qg(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Qg(t));break;default:Qg(t)}e=e.sibling}}function u4(e,t){for(;lo!==null;){var n=lo;switch(n.tag){case 0:case 11:case 15:Ds(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var o=n.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:Wp(n.memoizedState.cache)}if(o=n.child,o!==null)o.return=n,lo=o;else e:for(n=e;lo!==null;){o=lo;var i=o.sibling,r=o.return;if(t4(o),o===n){lo=null;break e}if(i!==null){i.return=r,lo=i;break e}lo=r}}}var HB={getCacheForType:function(e){var t=vo(Qn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return vo(Qn).controller.signal}},zB=typeof WeakMap=="function"?WeakMap:Map,Ut=0,sn=null,Tt=null,Lt=0,Xt=0,hi=null,bs=!1,Cd=!1,mE=!1,Na=0,On=0,Rs=0,kl=0,gE=0,xi=0,xd=0,Mp=null,Jo=null,m1=!1,qh=0,p4=0,vh=1/0,wh=null,Ss=null,no=0,Ts=null,vd=null,Ra=0,g1=0,h1=null,f4=null,Cp=0,b1=null;function ki(){return(Ut&2)!==0&&Lt!==0?Lt&-Lt:rt.T!==null?bE():E_()}function m4(){if(xi===0)if((Lt&536870912)===0||Rt){var e=Ag;Ag<<=1,(Ag&3932160)===0&&(Ag=262144),xi=e}else xi=536870912;return e=Ti.current,e!==null&&(e.flags|=32),xi}function ei(e,t,n){(e===sn&&(Xt===2||Xt===9)||e.cancelPendingCommit!==null)&&(wd(e,0),ys(e,Lt,xi,!1)),Fp(e,n),((Ut&2)===0||e!==sn)&&(e===sn&&((Ut&2)===0&&(kl|=n),On===4&&ys(e,Lt,xi,!1)),Ir(e))}function g4(e,t,n){if((Ut&6)!==0)throw Error(ke(327));var o=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Gp(e,t),i=o?NB(e,t):Mw(e,t,!0),r=o;do{if(i===0){Cd&&!o&&ys(e,t,0,!1);break}else{if(n=e.current.alternate,r&&!OB(n)){i=Mw(e,t,!1),r=!1;continue}if(i===2){if(r=t,e.errorRecoveryDisabledLanes&r)var a=0;else a=e.pendingLanes&-536870913,a=a!==0?a:a&536870912?536870912:0;if(a!==0){t=a;e:{var s=e;i=Mp;var l=s.current.memoizedState.isDehydrated;if(l&&(wd(s,a).flags|=256),a=Mw(s,a,!1),a!==2){if(mE&&!l){s.errorRecoveryDisabledLanes|=r,kl|=r,i=4;break e}r=Jo,Jo=i,r!==null&&(Jo===null?Jo=r:Jo.push.apply(Jo,r))}i=a}if(r=!1,i!==2)continue}}if(i===1){wd(e,0),ys(e,t,0,!0);break}e:{switch(o=e,r=i,r){case 0:case 1:throw Error(ke(345));case 4:if((t&4194048)!==t)break;case 6:ys(o,t,xi,!bs);break e;case 2:Jo=null;break;case 3:case 5:break;default:throw Error(ke(329))}if((t&62914560)===t&&(i=qh+300-vi(),10<i)){if(ys(o,t,xi,!bs),Rh(o,0,!0)!==0)break e;Ra=t,o.timeoutHandle=O4(HL.bind(null,o,n,Jo,wh,m1,t,xi,kl,xd,bs,r,"Throttled",-0,0),i);break e}HL(o,n,Jo,wh,m1,t,xi,kl,xd,bs,r,null,-0,0)}}break}while(!0);Ir(e)}function HL(e,t,n,o,i,r,a,s,l,c,u,d,p,g){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)===16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ca},l4(t,r,d);var y=(r&62914560)===r?qh-vi():(r&4194048)===r?p4-vi():0;if(y=b9(d,y),y!==null){Ra=r,e.cancelPendingCommit=y(OL.bind(null,e,t,r,n,o,i,a,s,l,u,d,null,p,g)),ys(e,r,a,!c);return}}OL(e,t,r,n,o,i,a,s,l)}function OB(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var o=0;o<n.length;o++){var i=n[o],r=i.getSnapshot;i=i.value;try{if(!Si(r(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ys(e,t,n,o){t&=~gE,t&=~kl,e.suspendedLanes|=t,e.pingedLanes&=~t,o&&(e.warmLanes|=t),o=e.expirationTimes;for(var i=t;0<i;){var r=31-Ei(i),a=1<<r;o[r]=-1,i&=~a}n!==0&&x_(e,n,t)}function Kh(){return(Ut&6)===0?(Jp(0,!1),!1):!0}function hE(){if(Tt!==null){if(Xt===0)var e=Tt.return;else e=Tt,La=Hl=null,tE(e),dd=null,$p=0,e=Tt;for(;e!==null;)Y5(e.alternate,e),e=e.return;Tt=null}}function wd(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,JB(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ra=0,hE(),sn=e,Tt=n=_a(e.current,null),Lt=t,Xt=0,hi=null,bs=!1,Cd=Gp(e,t),mE=!1,xd=xi=gE=kl=Rs=On=0,Jo=Mp=null,m1=!1,(t&8)!==0&&(t|=t&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=t;0<o;){var i=31-Ei(o),r=1<<i;t|=e[i],o&=~r}return Na=t,$h(),n}function h4(e,t){mt=null,rt.H=jp,t===Md||t===jh?(t=uL(),Xt=3):t===Y1?(t=uL(),Xt=4):Xt=t===dE?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,hi=t,Tt===null&&(On=1,bh(e,Yi(t,e.current)))}function b4(){var e=Ti.current;return e===null?!0:(Lt&4194048)===Lt?Wi===null:(Lt&62914560)===Lt||(Lt&536870912)!==0?e===Wi:!1}function y4(){var e=rt.H;return rt.H=jp,e===null?jp:e}function x4(){var e=rt.A;return rt.A=HB,e}function Eh(){On=4,bs||(Lt&4194048)!==Lt&&Ti.current!==null||(Cd=!0),(Rs&134217727)===0&&(kl&134217727)===0||sn===null||ys(sn,Lt,xi,!1)}function Mw(e,t,n){var o=Ut;Ut|=2;var i=y4(),r=x4();(sn!==e||Lt!==t)&&(wh=null,wd(e,t)),t=!1;var a=On;e:do try{if(Xt!==0&&Tt!==null){var s=Tt,l=hi;switch(Xt){case 8:hE(),a=6;break e;case 3:case 2:case 9:case 6:Ti.current===null&&(t=!0);var c=Xt;if(Xt=0,hi=null,rd(e,s,l,c),n&&Cd){a=0;break e}break;default:c=Xt,Xt=0,hi=null,rd(e,s,l,c)}}$B(),a=On;break}catch(u){h4(e,u)}while(!0);return t&&e.shellSuspendCounter++,La=Hl=null,Ut=o,rt.H=i,rt.A=r,Tt===null&&(sn=null,Lt=0,$h()),a}function $B(){for(;Tt!==null;)v4(Tt)}function NB(e,t){var n=Ut;Ut|=2;var o=y4(),i=x4();sn!==e||Lt!==t?(wh=null,vh=vi()+500,wd(e,t)):Cd=Gp(e,t);e:do try{if(Xt!==0&&Tt!==null){t=Tt;var r=hi;t:switch(Xt){case 1:Xt=0,hi=null,rd(e,t,r,1);break;case 2:case 9:if(dL(r)){Xt=0,hi=null,zL(t);break}t=function(){Xt!==2&&Xt!==9||sn!==e||(Xt=7),Ir(e)},r.then(t,t);break e;case 3:Xt=7;break e;case 4:Xt=5;break e;case 7:dL(r)?(Xt=0,hi=null,zL(t)):(Xt=0,hi=null,rd(e,t,r,7));break;case 5:var a=null;switch(Tt.tag){case 26:a=Tt.memoizedState;case 5:case 27:var s=Tt;if(a?B4(a):s.stateNode.complete){Xt=0,hi=null;var l=s.sibling;if(l!==null)Tt=l;else{var c=s.return;c!==null?(Tt=c,Ih(c)):Tt=null}break t}}Xt=0,hi=null,rd(e,t,r,5);break;case 6:Xt=0,hi=null,rd(e,t,r,6);break;case 8:hE(),On=6;break e;default:throw Error(ke(462))}}jB();break}catch(u){h4(e,u)}while(!0);return La=Hl=null,rt.H=o,rt.A=i,Ut=n,Tt!==null?0:(sn=null,Lt=0,$h(),On)}function jB(){for(;Tt!==null&&!sP();)v4(Tt)}function v4(e){var t=F5(e.alternate,e,Na);e.memoizedProps=e.pendingProps,t===null?Ih(e):Tt=t}function zL(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=ML(n,t,t.pendingProps,t.type,void 0,Lt);break;case 11:t=ML(n,t,t.pendingProps,t.type.render,t.ref,Lt);break;case 5:tE(t);default:Y5(n,t),t=Tt=Y_(t,Na),t=F5(n,t,Na)}e.memoizedProps=e.pendingProps,t===null?Ih(e):Tt=t}function rd(e,t,n,o){La=Hl=null,tE(t),dd=null,$p=0;var i=t.return;try{if(AB(e,i,t,n,Lt)){On=1,bh(e,Yi(n,e.current)),Tt=null;return}}catch(r){if(i!==null)throw Tt=i,r;On=1,bh(e,Yi(n,e.current)),Tt=null;return}t.flags&32768?(Rt||o===1?e=!0:Cd||(Lt&536870912)!==0?e=!1:(bs=e=!0,(o===2||o===9||o===3||o===6)&&(o=Ti.current,o!==null&&o.tag===13&&(o.flags|=16384))),w4(t,e)):Ih(t)}function Ih(e){var t=e;do{if((t.flags&32768)!==0){w4(t,bs);return}e=t.return;var n=LB(t.alternate,t,Na);if(n!==null){Tt=n;return}if(t=t.sibling,t!==null){Tt=t;return}Tt=t=e}while(t!==null);On===0&&(On=5)}function w4(e,t){do{var n=_B(e.alternate,e);if(n!==null){n.flags&=32767,Tt=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Tt=e;return}Tt=e=n}while(e!==null);On=6,Tt=null}function OL(e,t,n,o,i,r,a,s,l){e.cancelPendingCommit=null;do Gh();while(no!==0);if((Ut&6)!==0)throw Error(ke(327));if(t!==null){if(t===e.current)throw Error(ke(177));if(r=t.lanes|t.childLanes,r|=V1,bP(e,n,r,a,s,l),e===sn&&(Tt=sn=null,Lt=0),vd=t,Ts=e,Ra=n,g1=r,h1=i,f4=o,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,UB(ah,function(){return A4(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||o){o=rt.T,rt.T=null,i=qt.p,qt.p=2,a=Ut,Ut|=4;try{DB(e,t,n)}finally{Ut=a,qt.p=i,rt.T=o}}no=1,E4(),k4(),S4()}}function E4(){if(no===1){no=0;var e=Ts,t=vd,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=rt.T,rt.T=null;var o=qt.p;qt.p=2;var i=Ut;Ut|=4;try{r4(t,e);var r=w1,a=B_(e.containerInfo),s=r.focusedElem,l=r.selectionRange;if(a!==s&&s&&s.ownerDocument&&P_(s.ownerDocument.documentElement,s)){if(l!==null&&B1(s)){var c=l.start,u=l.end;if(u===void 0&&(u=c),"selectionStart"in s)s.selectionStart=c,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,p=d&&d.defaultView||window;if(p.getSelection){var g=p.getSelection(),y=s.textContent.length,v=Math.min(l.start,y),x=l.end===void 0?v:Math.min(l.end,y);!g.extend&&v>x&&(a=x,x=v,v=a);var h=oL(s,v),m=oL(s,x);if(h&&m&&(g.rangeCount!==1||g.anchorNode!==h.node||g.anchorOffset!==h.offset||g.focusNode!==m.node||g.focusOffset!==m.offset)){var b=d.createRange();b.setStart(h.node,h.offset),g.removeAllRanges(),v>x?(g.addRange(b),g.extend(m.node,m.offset)):(b.setEnd(m.node,m.offset),g.addRange(b))}}}}for(d=[],g=s;g=g.parentNode;)g.nodeType===1&&d.push({element:g,left:g.scrollLeft,top:g.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<d.length;s++){var E=d[s];E.element.scrollLeft=E.left,E.element.scrollTop=E.top}}_h=!!v1,w1=v1=null}finally{Ut=i,qt.p=o,rt.T=n}}e.current=t,no=2}}function k4(){if(no===2){no=0;var e=Ts,t=vd,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=rt.T,rt.T=null;var o=qt.p;qt.p=2;var i=Ut;Ut|=4;try{e4(e,t.alternate,t)}finally{Ut=i,qt.p=o,rt.T=n}}no=3}}function S4(){if(no===4||no===3){no=0,lP();var e=Ts,t=vd,n=Ra,o=f4;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?no=5:(no=0,vd=Ts=null,T4(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Ss=null),H1(n),t=t.stateNode,wi&&typeof wi.onCommitFiberRoot=="function")try{wi.onCommitFiberRoot(Ip,t,void 0,(t.current.flags&128)===128)}catch{}if(o!==null){t=rt.T,i=qt.p,qt.p=2,rt.T=null;try{for(var r=e.onRecoverableError,a=0;a<o.length;a++){var s=o[a];r(s.value,{componentStack:s.stack})}}finally{rt.T=t,qt.p=i}}(Ra&3)!==0&&Gh(),Ir(e),i=e.pendingLanes,(n&261930)!==0&&(i&42)!==0?e===b1?Cp++:(Cp=0,b1=e):Cp=0,Jp(0,!1)}}function T4(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Wp(t)))}function Gh(){return E4(),k4(),S4(),A4()}function A4(){if(no!==5)return!1;var e=Ts,t=g1;g1=0;var n=H1(Ra),o=rt.T,i=qt.p;try{qt.p=32>n?32:n,rt.T=null,n=h1,h1=null;var r=Ts,a=Ra;if(no=0,vd=Ts=null,Ra=0,(Ut&6)!==0)throw Error(ke(331));var s=Ut;if(Ut|=4,d4(r.current),s4(r,r.current,a,n),Ut=s,Jp(0,!1),wi&&typeof wi.onPostCommitFiberRoot=="function")try{wi.onPostCommitFiberRoot(Ip,r)}catch{}return!0}finally{qt.p=i,rt.T=o,T4(e,t)}}function $L(e,t,n){t=Yi(n,t),t=d1(e.stateNode,t,2),e=ks(e,t,2),e!==null&&(Fp(e,2),Ir(e))}function Wt(e,t,n){if(e.tag===3)$L(e,e,n);else for(;t!==null;){if(t.tag===3){$L(t,e,n);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Ss===null||!Ss.has(o))){e=Yi(n,e),n=V5(2),o=ks(t,n,2),o!==null&&(U5(n,o,t,e),Fp(o,2),Ir(o));break}}t=t.return}}function Cw(e,t,n){var o=e.pingCache;if(o===null){o=e.pingCache=new zB;var i=new Set;o.set(t,i)}else i=o.get(t),i===void 0&&(i=new Set,o.set(t,i));i.has(n)||(mE=!0,i.add(n),e=PB.bind(null,e,t,n),t.then(e,e))}function PB(e,t,n){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,sn===e&&(Lt&n)===n&&(On===4||On===3&&(Lt&62914560)===Lt&&300>vi()-qh?(Ut&2)===0&&wd(e,0):gE|=n,xd===Lt&&(xd=0)),Ir(e)}function M4(e,t){t===0&&(t=y_()),e=Rl(e,t),e!==null&&(Fp(e,t),Ir(e))}function BB(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),M4(e,n)}function VB(e,t){var n=0;switch(e.tag){case 31:case 13:var o=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(ke(314))}o!==null&&o.delete(t),M4(e,n)}function UB(e,t){return D1(e,t)}var kh=null,Fc=null,y1=!1,Sh=!1,Lw=!1,xs=0;function Ir(e){e!==Fc&&e.next===null&&(Fc===null?kh=Fc=e:Fc=Fc.next=e),Sh=!0,y1||(y1=!0,KB())}function Jp(e,t){if(!Lw&&Sh){Lw=!0;do for(var n=!1,o=kh;o!==null;){if(!t)if(e!==0){var i=o.pendingLanes;if(i===0)var r=0;else{var a=o.suspendedLanes,s=o.pingedLanes;r=(1<<31-Ei(42|e)+1)-1,r&=i&~(a&~s),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(n=!0,NL(o,r))}else r=Lt,r=Rh(o,o===sn?r:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(r&3)===0||Gp(o,r)||(n=!0,NL(o,r));o=o.next}while(n);Lw=!1}}function qB(){C4()}function C4(){Sh=y1=!1;var e=0;xs!==0&&QB()&&(e=xs);for(var t=vi(),n=null,o=kh;o!==null;){var i=o.next,r=L4(o,t);r===0?(o.next=null,n===null?kh=i:n.next=i,i===null&&(Fc=n)):(n=o,(e!==0||(r&3)!==0)&&(Sh=!0)),o=i}no!==0&&no!==5||Jp(e,!1),xs!==0&&(xs=0)}function L4(e,t){for(var n=e.suspendedLanes,o=e.pingedLanes,i=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var a=31-Ei(r),s=1<<a,l=i[a];l===-1?((s&n)===0||(s&o)!==0)&&(i[a]=hP(s,t)):l<=t&&(e.expiredLanes|=s),r&=~s}if(t=sn,n=Lt,n=Rh(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,n===0||e===t&&(Xt===2||Xt===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&iw(o),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Gp(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(o!==null&&iw(o),H1(n)){case 2:case 8:n=h_;break;case 32:n=ah;break;case 268435456:n=b_;break;default:n=ah}return o=_4.bind(null,e),n=D1(n,o),e.callbackPriority=t,e.callbackNode=n,t}return o!==null&&o!==null&&iw(o),e.callbackPriority=2,e.callbackNode=null,2}function _4(e,t){if(no!==0&&no!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Gh()&&e.callbackNode!==n)return null;var o=Lt;return o=Rh(e,e===sn?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(g4(e,o,t),L4(e,vi()),e.callbackNode!=null&&e.callbackNode===n?_4.bind(null,e):null)}function NL(e,t){if(Gh())return null;g4(e,t,!0)}function KB(){e9(function(){(Ut&6)!==0?D1(g_,qB):C4()})}function bE(){if(xs===0){var e=hd;e===0&&(e=Tg,Tg<<=1,(Tg&261888)===0&&(Tg=256)),xs=e}return xs}function jL(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:qg(""+e)}function PL(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function IB(e,t,n,o,i){if(t==="submit"&&n&&n.stateNode===i){var r=jL((i[ti]||null).action),a=o.submitter;a&&(t=(t=a[ti]||null)?jL(t.formAction):a.getAttribute("formAction"),t!==null&&(r=t,a=null));var s=new Hh("action","action",null,o,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(xs!==0){var l=a?PL(i,a):new FormData(i);l1(n,{pending:!0,data:l,method:i.method,action:r},null,l)}}else typeof r=="function"&&(s.preventDefault(),l=a?PL(i,a):new FormData(i),l1(n,{pending:!0,data:l,method:i.method,action:r},r,l))},currentTarget:i}]})}}for(Ng=0;Ng<Ww.length;Ng++)jg=Ww[Ng],BL=jg.toLowerCase(),VL=jg[0].toUpperCase()+jg.slice(1),wr(BL,"on"+VL);var jg,BL,VL,Ng;wr(U_,"onAnimationEnd");wr(q_,"onAnimationIteration");wr(K_,"onAnimationStart");wr("dblclick","onDoubleClick");wr("focusin","onFocus");wr("focusout","onBlur");wr(cB,"onTransitionRun");wr(dB,"onTransitionStart");wr(uB,"onTransitionCancel");wr(I_,"onTransitionEnd");md("onMouseEnter",["mouseout","mouseover"]);md("onMouseLeave",["mouseout","mouseover"]);md("onPointerEnter",["pointerout","pointerover"]);md("onPointerLeave",["pointerout","pointerover"]);Ll("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ll("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ll("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ll("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ll("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ll("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pp="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),GB=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Pp));function D4(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var o=e[n],i=o.event;o=o.listeners;e:{var r=void 0;if(t)for(var a=o.length-1;0<=a;a--){var s=o[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==r&&i.isPropagationStopped())break e;r=s,i.currentTarget=c;try{r(i)}catch(u){lh(u)}i.currentTarget=null,r=l}else for(a=0;a<o.length;a++){if(s=o[a],l=s.instance,c=s.currentTarget,s=s.listener,l!==r&&i.isPropagationStopped())break e;r=s,i.currentTarget=c;try{r(i)}catch(u){lh(u)}i.currentTarget=null,r=l}}}}function St(e,t){var n=t[Uw];n===void 0&&(n=t[Uw]=new Set);var o=e+"__bubble";n.has(o)||(R4(t,e,2,!1),n.add(o))}function _w(e,t,n){var o=0;t&&(o|=4),R4(n,e,o,t)}var Pg="_reactListening"+Math.random().toString(36).slice(2);function yE(e){if(!e[Pg]){e[Pg]=!0,k_.forEach(function(n){n!=="selectionchange"&&(GB.has(n)||_w(n,!1,e),_w(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Pg]||(t[Pg]=!0,_w("selectionchange",!1,t))}}function R4(e,t,n,o){switch(I4(t)){case 2:var i=v9;break;case 8:i=w9;break;default:i=EE}n=i.bind(null,t,n,e),i=void 0,!Fw||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),o?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Dw(e,t,n,o,i){var r=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var a=o.tag;if(a===3||a===4){var s=o.stateNode.containerInfo;if(s===i)break;if(a===4)for(a=o.return;a!==null;){var l=a.tag;if((l===3||l===4)&&a.stateNode.containerInfo===i)return;a=a.return}for(;s!==null;){if(a=Wc(s),a===null)return;if(l=a.tag,l===5||l===6||l===26||l===27){o=r=a;continue e}s=s.parentNode}}o=o.return}D_(function(){var c=r,u=$1(n),d=[];e:{var p=G_.get(e);if(p!==void 0){var g=Hh,y=e;switch(e){case"keypress":if(Ig(n)===0)break e;case"keydown":case"keyup":g=VP;break;case"focusin":y="focus",g=cw;break;case"focusout":y="blur",g=cw;break;case"beforeblur":case"afterblur":g=cw;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=YC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=LP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=KP;break;case U_:case q_:case K_:g=RP;break;case I_:g=GP;break;case"scroll":case"scrollend":g=MP;break;case"wheel":g=YP;break;case"copy":case"cut":case"paste":g=zP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=WC;break;case"toggle":case"beforetoggle":g=WP}var v=(t&4)!==0,x=!v&&(e==="scroll"||e==="scrollend"),h=v?p!==null?p+"Capture":null:p;v=[];for(var m=c,b;m!==null;){var E=m;if(b=E.stateNode,E=E.tag,E!==5&&E!==26&&E!==27||b===null||h===null||(E=Dp(m,h),E!=null&&v.push(Bp(m,E,b))),x)break;m=m.return}0<v.length&&(p=new g(p,y,null,n,u),d.push({event:p,listeners:v}))}}if((t&7)===0){e:{if(p=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",p&&n!==Gw&&(y=n.relatedTarget||n.fromElement)&&(Wc(y)||y[Sd]))break e;if((g||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,g?(y=n.relatedTarget||n.toElement,g=c,y=y?Wc(y):null,y!==null&&(x=Kp(y),v=y.tag,y!==x||v!==5&&v!==27&&v!==6)&&(y=null)):(g=null,y=c),g!==y)){if(v=YC,E="onMouseLeave",h="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(v=WC,E="onPointerLeave",h="onPointerEnter",m="pointer"),x=g==null?p:mp(g),b=y==null?p:mp(y),p=new v(E,m+"leave",g,n,u),p.target=x,p.relatedTarget=b,E=null,Wc(u)===c&&(v=new v(h,m+"enter",y,n,u),v.target=b,v.relatedTarget=x,E=v),x=E,g&&y)t:{for(v=FB,h=g,m=y,b=0,E=h;E;E=v(E))b++;E=0;for(var S=m;S;S=v(S))E++;for(;0<b-E;)h=v(h),b--;for(;0<E-b;)m=v(m),E--;for(;b--;){if(h===m||m!==null&&h===m.alternate){v=h;break t}h=v(h),m=v(m)}v=null}else v=null;g!==null&&UL(d,p,g,v,!1),y!==null&&x!==null&&UL(d,x,y,v,!0)}}e:{if(p=c?mp(c):window,g=p.nodeName&&p.nodeName.toLowerCase(),g==="select"||g==="input"&&p.type==="file")var A=eL;else if(JC(p))if(N_)A=aB;else{A=iB;var _=oB}else g=p.nodeName,!g||g.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?c&&O1(c.elementType)&&(A=eL):A=rB;if(A&&(A=A(e,c))){$_(d,A,n,u);break e}_&&_(e,p,c),e==="focusout"&&c&&p.type==="number"&&c.memoizedProps.value!=null&&Iw(p,"number",p.value)}switch(_=c?mp(c):window,e){case"focusin":(JC(_)||_.contentEditable==="true")&&(Jc=_,Yw=c,xp=null);break;case"focusout":xp=Yw=Jc=null;break;case"mousedown":Xw=!0;break;case"contextmenu":case"mouseup":case"dragend":Xw=!1,iL(d,n,u);break;case"selectionchange":if(lB)break;case"keydown":case"keyup":iL(d,n,u)}var T;if(P1)e:{switch(e){case"compositionstart":var H="onCompositionStart";break e;case"compositionend":H="onCompositionEnd";break e;case"compositionupdate":H="onCompositionUpdate";break e}H=void 0}else Qc?z_(e,n)&&(H="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(H="onCompositionStart");H&&(H_&&n.locale!=="ko"&&(Qc||H!=="onCompositionStart"?H==="onCompositionEnd"&&Qc&&(T=R_()):(hs=u,N1="value"in hs?hs.value:hs.textContent,Qc=!0)),_=Th(c,H),0<_.length&&(H=new XC(H,e,null,n,u),d.push({event:H,listeners:_}),T?H.data=T:(T=O_(n),T!==null&&(H.data=T)))),(T=QP?JP(e,n):eB(e,n))&&(H=Th(c,"onBeforeInput"),0<H.length&&(_=new XC("onBeforeInput","beforeinput",null,n,u),d.push({event:_,listeners:H}),_.data=T)),IB(d,e,c,n,u)}D4(d,t)})}function Bp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Th(e,t){for(var n=t+"Capture",o=[];e!==null;){var i=e,r=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||r===null||(i=Dp(e,n),i!=null&&o.unshift(Bp(e,i,r)),i=Dp(e,t),i!=null&&o.push(Bp(e,i,r))),e.tag===3)return o;e=e.return}return[]}function FB(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function UL(e,t,n,o,i){for(var r=t._reactName,a=[];n!==null&&n!==o;){var s=n,l=s.alternate,c=s.stateNode;if(s=s.tag,l!==null&&l===o)break;s!==5&&s!==26&&s!==27||c===null||(l=c,i?(c=Dp(n,r),c!=null&&a.unshift(Bp(n,c,l))):i||(c=Dp(n,r),c!=null&&a.push(Bp(n,c,l)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var YB=/\r\n?/g,XB=/\u0000|\uFFFD/g;function qL(e){return(typeof e=="string"?e:""+e).replace(YB,`
9
- `).replace(XB,"")}function H4(e,t){return t=qL(t),qL(e)===t}function tn(e,t,n,o,i,r){switch(n){case"children":typeof o=="string"?t==="body"||t==="textarea"&&o===""||gd(e,o):(typeof o=="number"||typeof o=="bigint")&&t!=="body"&&gd(e,""+o);break;case"className":Cg(e,"class",o);break;case"tabIndex":Cg(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Cg(e,n,o);break;case"style":__(e,o,r);break;case"data":if(t!=="object"){Cg(e,"data",o);break}case"src":case"href":if(o===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(n);break}o=qg(""+o),e.setAttribute(n,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof r=="function"&&(n==="formAction"?(t!=="input"&&tn(e,t,"name",i.name,i,null),tn(e,t,"formEncType",i.formEncType,i,null),tn(e,t,"formMethod",i.formMethod,i,null),tn(e,t,"formTarget",i.formTarget,i,null)):(tn(e,t,"encType",i.encType,i,null),tn(e,t,"method",i.method,i,null),tn(e,t,"target",i.target,i,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(n);break}o=qg(""+o),e.setAttribute(n,o);break;case"onClick":o!=null&&(e.onclick=Ca);break;case"onScroll":o!=null&&St("scroll",e);break;case"onScrollEnd":o!=null&&St("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(ke(61));if(n=o.__html,n!=null){if(i.children!=null)throw Error(ke(60));e.innerHTML=n}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}n=qg(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(n,""+o):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":o===!0?e.setAttribute(n,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(n,o):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(n,o):e.removeAttribute(n);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(n):e.setAttribute(n,o);break;case"popover":St("beforetoggle",e),St("toggle",e),Ug(e,"popover",o);break;case"xlinkActuate":va(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":va(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":va(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":va(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":va(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":va(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":va(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":va(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":va(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Ug(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=TP.get(n)||n,Ug(e,n,o))}}function x1(e,t,n,o,i,r){switch(n){case"style":__(e,o,r);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(ke(61));if(n=o.__html,n!=null){if(i.children!=null)throw Error(ke(60));e.innerHTML=n}}break;case"children":typeof o=="string"?gd(e,o):(typeof o=="number"||typeof o=="bigint")&&gd(e,""+o);break;case"onScroll":o!=null&&St("scroll",e);break;case"onScrollEnd":o!=null&&St("scrollend",e);break;case"onClick":o!=null&&(e.onclick=Ca);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!S_.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),r=e[ti]||null,r=r!=null?r[n]:null,typeof r=="function"&&e.removeEventListener(t,r,i),typeof o=="function")){typeof r!="function"&&r!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,o,i);break e}n in e?e[n]=o:o===!0?e.setAttribute(n,""):Ug(e,n,o)}}}function wo(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":St("error",e),St("load",e);var o=!1,i=!1,r;for(r in n)if(n.hasOwnProperty(r)){var a=n[r];if(a!=null)switch(r){case"src":o=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(ke(137,t));default:tn(e,t,r,a,n,null)}}i&&tn(e,t,"srcSet",n.srcSet,n,null),o&&tn(e,t,"src",n.src,n,null);return;case"input":St("invalid",e);var s=r=a=i=null,l=null,c=null;for(o in n)if(n.hasOwnProperty(o)){var u=n[o];if(u!=null)switch(o){case"name":i=u;break;case"type":a=u;break;case"checked":l=u;break;case"defaultChecked":c=u;break;case"value":r=u;break;case"defaultValue":s=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(ke(137,t));break;default:tn(e,t,o,u,n,null)}}M_(e,r,s,l,c,a,i,!1);return;case"select":St("invalid",e),o=a=r=null;for(i in n)if(n.hasOwnProperty(i)&&(s=n[i],s!=null))switch(i){case"value":r=s;break;case"defaultValue":a=s;break;case"multiple":o=s;default:tn(e,t,i,s,n,null)}t=r,n=a,e.multiple=!!o,t!=null?sd(e,!!o,t,!1):n!=null&&sd(e,!!o,n,!0);return;case"textarea":St("invalid",e),r=i=o=null;for(a in n)if(n.hasOwnProperty(a)&&(s=n[a],s!=null))switch(a){case"value":o=s;break;case"defaultValue":i=s;break;case"children":r=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(ke(91));break;default:tn(e,t,a,s,n,null)}L_(e,o,i,r);return;case"option":for(l in n)n.hasOwnProperty(l)&&(o=n[l],o!=null)&&(l==="selected"?e.selected=o&&typeof o!="function"&&typeof o!="symbol":tn(e,t,l,o,n,null));return;case"dialog":St("beforetoggle",e),St("toggle",e),St("cancel",e),St("close",e);break;case"iframe":case"object":St("load",e);break;case"video":case"audio":for(o=0;o<Pp.length;o++)St(Pp[o],e);break;case"image":St("error",e),St("load",e);break;case"details":St("toggle",e);break;case"embed":case"source":case"link":St("error",e),St("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(o=n[c],o!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(ke(137,t));default:tn(e,t,c,o,n,null)}return;default:if(O1(t)){for(u in n)n.hasOwnProperty(u)&&(o=n[u],o!==void 0&&x1(e,t,u,o,n,void 0));return}}for(s in n)n.hasOwnProperty(s)&&(o=n[s],o!=null&&tn(e,t,s,o,n,null))}function WB(e,t,n,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,r=null,a=null,s=null,l=null,c=null,u=null;for(g in n){var d=n[g];if(n.hasOwnProperty(g)&&d!=null)switch(g){case"checked":break;case"value":break;case"defaultValue":l=d;default:o.hasOwnProperty(g)||tn(e,t,g,null,o,d)}}for(var p in o){var g=o[p];if(d=n[p],o.hasOwnProperty(p)&&(g!=null||d!=null))switch(p){case"type":r=g;break;case"name":i=g;break;case"checked":c=g;break;case"defaultChecked":u=g;break;case"value":a=g;break;case"defaultValue":s=g;break;case"children":case"dangerouslySetInnerHTML":if(g!=null)throw Error(ke(137,t));break;default:g!==d&&tn(e,t,p,g,o,d)}}Kw(e,a,s,l,c,u,r,i);return;case"select":g=a=s=p=null;for(r in n)if(l=n[r],n.hasOwnProperty(r)&&l!=null)switch(r){case"value":break;case"multiple":g=l;default:o.hasOwnProperty(r)||tn(e,t,r,null,o,l)}for(i in o)if(r=o[i],l=n[i],o.hasOwnProperty(i)&&(r!=null||l!=null))switch(i){case"value":p=r;break;case"defaultValue":s=r;break;case"multiple":a=r;default:r!==l&&tn(e,t,i,r,o,l)}t=s,n=a,o=g,p!=null?sd(e,!!n,p,!1):!!o!=!!n&&(t!=null?sd(e,!!n,t,!0):sd(e,!!n,n?[]:"",!1));return;case"textarea":g=p=null;for(s in n)if(i=n[s],n.hasOwnProperty(s)&&i!=null&&!o.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:tn(e,t,s,null,o,i)}for(a in o)if(i=o[a],r=n[a],o.hasOwnProperty(a)&&(i!=null||r!=null))switch(a){case"value":p=i;break;case"defaultValue":g=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(ke(91));break;default:i!==r&&tn(e,t,a,i,o,r)}C_(e,p,g);return;case"option":for(var y in n)p=n[y],n.hasOwnProperty(y)&&p!=null&&!o.hasOwnProperty(y)&&(y==="selected"?e.selected=!1:tn(e,t,y,null,o,p));for(l in o)p=o[l],g=n[l],o.hasOwnProperty(l)&&p!==g&&(p!=null||g!=null)&&(l==="selected"?e.selected=p&&typeof p!="function"&&typeof p!="symbol":tn(e,t,l,p,o,g));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!o.hasOwnProperty(v)&&tn(e,t,v,null,o,p);for(c in o)if(p=o[c],g=n[c],o.hasOwnProperty(c)&&p!==g&&(p!=null||g!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(ke(137,t));break;default:tn(e,t,c,p,o,g)}return;default:if(O1(t)){for(var x in n)p=n[x],n.hasOwnProperty(x)&&p!==void 0&&!o.hasOwnProperty(x)&&x1(e,t,x,void 0,o,p);for(u in o)p=o[u],g=n[u],!o.hasOwnProperty(u)||p===g||p===void 0&&g===void 0||x1(e,t,u,p,o,g);return}}for(var h in n)p=n[h],n.hasOwnProperty(h)&&p!=null&&!o.hasOwnProperty(h)&&tn(e,t,h,null,o,p);for(d in o)p=o[d],g=n[d],!o.hasOwnProperty(d)||p===g||p==null&&g==null||tn(e,t,d,p,o,g)}function KL(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ZB(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),o=0;o<n.length;o++){var i=n[o],r=i.transferSize,a=i.initiatorType,s=i.duration;if(r&&s&&KL(a)){for(a=0,s=i.responseEnd,o+=1;o<n.length;o++){var l=n[o],c=l.startTime;if(c>s)break;var u=l.transferSize,d=l.initiatorType;u&&KL(d)&&(l=l.responseEnd,a+=u*(l<s?1:(s-c)/(l-c)))}if(--o,t+=8*(r+a)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var v1=null,w1=null;function Ah(e){return e.nodeType===9?e:e.ownerDocument}function IL(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function z4(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function E1(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Rw=null;function QB(){var e=window.event;return e&&e.type==="popstate"?e===Rw?!1:(Rw=e,!0):(Rw=null,!1)}var O4=typeof setTimeout=="function"?setTimeout:void 0,JB=typeof clearTimeout=="function"?clearTimeout:void 0,GL=typeof Promise=="function"?Promise:void 0,e9=typeof queueMicrotask=="function"?queueMicrotask:typeof GL<"u"?function(e){return GL.resolve(null).then(e).catch(t9)}:O4;function t9(e){setTimeout(function(){throw e})}function zs(e){return e==="head"}function FL(e,t){var n=t,o=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(o===0){e.removeChild(i),kd(t);return}o--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")o++;else if(n==="html")Lp(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Lp(n);for(var r=n.firstChild;r;){var a=r.nextSibling,s=r.nodeName;r[Yp]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&r.rel.toLowerCase()==="stylesheet"||n.removeChild(r),r=a}}else n==="body"&&Lp(e.ownerDocument.body);n=i}while(n);kd(t)}function YL(e,t){var n=e;e=0;do{var o=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=o}while(n)}function k1(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":k1(n),z1(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function n9(e,t,n,o){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[Yp])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=Zi(e.nextSibling),e===null)break}return null}function o9(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Zi(e.nextSibling),e===null))return null;return e}function $4(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Zi(e.nextSibling),e===null))return null;return e}function S1(e){return e.data==="$?"||e.data==="$~"}function T1(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function i9(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var o=function(){t(),n.removeEventListener("DOMContentLoaded",o)};n.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function Zi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var A1=null;function XL(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Zi(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function WL(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function N4(e,t,n){switch(t=Ah(n),e){case"html":if(e=t.documentElement,!e)throw Error(ke(452));return e;case"head":if(e=t.head,!e)throw Error(ke(453));return e;case"body":if(e=t.body,!e)throw Error(ke(454));return e;default:throw Error(ke(451))}}function Lp(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);z1(e)}var Qi=new Map,ZL=new Set;function Mh(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ja=qt.d;qt.d={f:r9,r:a9,D:s9,C:l9,L:c9,m:d9,X:p9,S:u9,M:f9};function r9(){var e=ja.f(),t=Kh();return e||t}function a9(e){var t=Td(e);t!==null&&t.tag===5&&t.type==="form"?_5(t):ja.r(e)}var Ld=typeof document>"u"?null:document;function j4(e,t,n){var o=Ld;if(o&&typeof t=="string"&&t){var i=Fi(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),ZL.has(i)||(ZL.add(i),e={rel:e,crossOrigin:n,href:t},o.querySelector(i)===null&&(t=o.createElement("link"),wo(t,"link",e),co(t),o.head.appendChild(t)))}}function s9(e){ja.D(e),j4("dns-prefetch",e,null)}function l9(e,t){ja.C(e,t),j4("preconnect",e,t)}function c9(e,t,n){ja.L(e,t,n);var o=Ld;if(o&&e&&t){var i='link[rel="preload"][as="'+Fi(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Fi(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Fi(n.imageSizes)+'"]')):i+='[href="'+Fi(e)+'"]';var r=i;switch(t){case"style":r=Ed(e);break;case"script":r=_d(e)}Qi.has(r)||(e=yn({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Qi.set(r,e),o.querySelector(i)!==null||t==="style"&&o.querySelector(ef(r))||t==="script"&&o.querySelector(tf(r))||(t=o.createElement("link"),wo(t,"link",e),co(t),o.head.appendChild(t)))}}function d9(e,t){ja.m(e,t);var n=Ld;if(n&&e){var o=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Fi(o)+'"][href="'+Fi(e)+'"]',r=i;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=_d(e)}if(!Qi.has(r)&&(e=yn({rel:"modulepreload",href:e},t),Qi.set(r,e),n.querySelector(i)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(tf(r)))return}o=n.createElement("link"),wo(o,"link",e),co(o),n.head.appendChild(o)}}}function u9(e,t,n){ja.S(e,t,n);var o=Ld;if(o&&e){var i=ad(o).hoistableStyles,r=Ed(e);t=t||"default";var a=i.get(r);if(!a){var s={loading:0,preload:null};if(a=o.querySelector(ef(r)))s.loading=5;else{e=yn({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Qi.get(r))&&xE(e,n);var l=a=o.createElement("link");co(l),wo(l,"link",e),l._p=new Promise(function(c,u){l.onload=c,l.onerror=u}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Jg(a,t,o)}a={type:"stylesheet",instance:a,count:1,state:s},i.set(r,a)}}}function p9(e,t){ja.X(e,t);var n=Ld;if(n&&e){var o=ad(n).hoistableScripts,i=_d(e),r=o.get(i);r||(r=n.querySelector(tf(i)),r||(e=yn({src:e,async:!0},t),(t=Qi.get(i))&&vE(e,t),r=n.createElement("script"),co(r),wo(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},o.set(i,r))}}function f9(e,t){ja.M(e,t);var n=Ld;if(n&&e){var o=ad(n).hoistableScripts,i=_d(e),r=o.get(i);r||(r=n.querySelector(tf(i)),r||(e=yn({src:e,async:!0,type:"module"},t),(t=Qi.get(i))&&vE(e,t),r=n.createElement("script"),co(r),wo(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},o.set(i,r))}}function QL(e,t,n,o){var i=(i=vs.current)?Mh(i):null;if(!i)throw Error(ke(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ed(n.href),n=ad(i).hoistableStyles,o=n.get(t),o||(o={type:"style",instance:null,count:0,state:null},n.set(t,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ed(n.href);var r=ad(i).hoistableStyles,a=r.get(e);if(a||(i=i.ownerDocument||i,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,a),(r=i.querySelector(ef(e)))&&!r._p&&(a.instance=r,a.state.loading=5),Qi.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Qi.set(e,n),r||m9(i,e,n,a.state))),t&&o===null)throw Error(ke(528,""));return a}if(t&&o!==null)throw Error(ke(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=_d(n),n=ad(i).hoistableScripts,o=n.get(t),o||(o={type:"script",instance:null,count:0,state:null},n.set(t,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(ke(444,e))}}function Ed(e){return'href="'+Fi(e)+'"'}function ef(e){return'link[rel="stylesheet"]['+e+"]"}function P4(e){return yn({},e,{"data-precedence":e.precedence,precedence:null})}function m9(e,t,n,o){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?o.loading=1:(t=e.createElement("link"),o.preload=t,t.addEventListener("load",function(){return o.loading|=1}),t.addEventListener("error",function(){return o.loading|=2}),wo(t,"link",n),co(t),e.head.appendChild(t))}function _d(e){return'[src="'+Fi(e)+'"]'}function tf(e){return"script[async]"+e}function JL(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+Fi(n.href)+'"]');if(o)return t.instance=o,co(o),o;var i=yn({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),co(o),wo(o,"style",i),Jg(o,n.precedence,e),t.instance=o;case"stylesheet":i=Ed(n.href);var r=e.querySelector(ef(i));if(r)return t.state.loading|=4,t.instance=r,co(r),r;o=P4(n),(i=Qi.get(i))&&xE(o,i),r=(e.ownerDocument||e).createElement("link"),co(r);var a=r;return a._p=new Promise(function(s,l){a.onload=s,a.onerror=l}),wo(r,"link",o),t.state.loading|=4,Jg(r,n.precedence,e),t.instance=r;case"script":return r=_d(n.src),(i=e.querySelector(tf(r)))?(t.instance=i,co(i),i):(o=n,(i=Qi.get(r))&&(o=yn({},n),vE(o,i)),e=e.ownerDocument||e,i=e.createElement("script"),co(i),wo(i,"link",o),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(ke(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(o=t.instance,t.state.loading|=4,Jg(o,n.precedence,e));return t.instance}function Jg(e,t,n){for(var o=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=o.length?o[o.length-1]:null,r=i,a=0;a<o.length;a++){var s=o[a];if(s.dataset.precedence===t)r=s;else if(r!==i)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function xE(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function vE(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var eh=null;function e_(e,t,n){if(eh===null){var o=new Map,i=eh=new Map;i.set(n,o)}else i=eh,o=i.get(n),o||(o=new Map,i.set(n,o));if(o.has(e))return o;for(o.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var r=n[i];if(!(r[Yp]||r[yo]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var a=r.getAttribute(t)||"";a=e+a;var s=o.get(a);s?s.push(r):o.set(a,[r])}}return o}function t_(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function g9(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function B4(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function h9(e,t,n,o){if(n.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=Ed(o.href),r=t.querySelector(ef(i));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ch.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=r,co(r);return}r=t.ownerDocument||t,o=P4(o),(i=Qi.get(i))&&xE(o,i),r=r.createElement("link"),co(r);var a=r;a._p=new Promise(function(s,l){a.onload=s,a.onerror=l}),wo(r,"link",o),n.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Ch.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Hw=0;function b9(e,t){return e.stylesheets&&e.count===0&&th(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var o=setTimeout(function(){if(e.stylesheets&&th(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&Hw===0&&(Hw=62500*ZB());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&th(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>Hw?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(i)}}:null}function Ch(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)th(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Lh=null;function th(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Lh=new Map,t.forEach(y9,e),Lh=null,Ch.call(e))}function y9(e,t){if(!(t.state.loading&4)){var n=Lh.get(e);if(n)var o=n.get(null);else{n=new Map,Lh.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<i.length;r++){var a=i[r];(a.nodeName==="LINK"||a.getAttribute("media")!=="not all")&&(n.set(a.dataset.precedence,a),o=a)}o&&n.set(null,o)}i=t.instance,a=i.getAttribute("data-precedence"),r=n.get(a)||o,r===o&&n.set(null,i),n.set(a,i),this.count++,o=Ch.bind(this),i.addEventListener("load",o),i.addEventListener("error",o),r?r.parentNode.insertBefore(i,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Vp={$$typeof:Ma,Provider:null,Consumer:null,_currentValue:xl,_currentValue2:xl,_threadCount:0};function x9(e,t,n,o,i,r,a,s,l){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=rw(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rw(0),this.hiddenUpdates=rw(null),this.identifierPrefix=o,this.onUncaughtError=i,this.onCaughtError=r,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function V4(e,t,n,o,i,r,a,s,l,c,u,d){return e=new x9(e,t,n,a,l,c,u,d,s),t=1,r===!0&&(t|=24),r=yi(3,null,null,t),e.current=r,r.stateNode=e,t=G1(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:o,isDehydrated:n,cache:t},X1(r),e}function U4(e){return e?(e=nd,e):nd}function q4(e,t,n,o,i,r){i=U4(i),o.context===null?o.context=i:o.pendingContext=i,o=Es(t),o.payload={element:n},r=r===void 0?null:r,r!==null&&(o.callback=r),n=ks(e,o,t),n!==null&&(ei(n,e,t),wp(n,e,t))}function n_(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function wE(e,t){n_(e,t),(e=e.alternate)&&n_(e,t)}function K4(e){if(e.tag===13||e.tag===31){var t=Rl(e,67108864);t!==null&&ei(t,e,67108864),wE(e,67108864)}}function o_(e){if(e.tag===13||e.tag===31){var t=ki();t=R1(t);var n=Rl(e,t);n!==null&&ei(n,e,t),wE(e,t)}}var _h=!0;function v9(e,t,n,o){var i=rt.T;rt.T=null;var r=qt.p;try{qt.p=2,EE(e,t,n,o)}finally{qt.p=r,rt.T=i}}function w9(e,t,n,o){var i=rt.T;rt.T=null;var r=qt.p;try{qt.p=8,EE(e,t,n,o)}finally{qt.p=r,rt.T=i}}function EE(e,t,n,o){if(_h){var i=M1(o);if(i===null)Dw(e,t,o,Dh,n),i_(e,o);else if(k9(i,e,t,n,o))o.stopPropagation();else if(i_(e,o),t&4&&-1<E9.indexOf(e)){for(;i!==null;){var r=Td(i);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var a=hl(r.pendingLanes);if(a!==0){var s=r;for(s.pendingLanes|=2,s.entangledLanes|=2;a;){var l=1<<31-Ei(a);s.entanglements[1]|=l,a&=~l}Ir(r),(Ut&6)===0&&(vh=vi()+500,Jp(0,!1))}}break;case 31:case 13:s=Rl(r,2),s!==null&&ei(s,r,2),Kh(),wE(r,2)}if(r=M1(o),r===null&&Dw(e,t,o,Dh,n),r===i)break;i=r}i!==null&&o.stopPropagation()}else Dw(e,t,o,null,n)}}function M1(e){return e=$1(e),kE(e)}var Dh=null;function kE(e){if(Dh=null,e=Wc(e),e!==null){var t=Kp(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=d_(t),e!==null)return e;e=null}else if(n===31){if(e=u_(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Dh=e,null}function I4(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(cP()){case g_:return 2;case h_:return 8;case ah:case dP:return 32;case b_:return 268435456;default:return 32}default:return 32}}var C1=!1,As=null,Ms=null,Cs=null,Up=new Map,qp=new Map,ms=[],E9="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function i_(e,t){switch(e){case"focusin":case"focusout":As=null;break;case"dragenter":case"dragleave":Ms=null;break;case"mouseover":case"mouseout":Cs=null;break;case"pointerover":case"pointerout":Up.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":qp.delete(t.pointerId)}}function dp(e,t,n,o,i,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:n,eventSystemFlags:o,nativeEvent:r,targetContainers:[i]},t!==null&&(t=Td(t),t!==null&&K4(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function k9(e,t,n,o,i){switch(t){case"focusin":return As=dp(As,e,t,n,o,i),!0;case"dragenter":return Ms=dp(Ms,e,t,n,o,i),!0;case"mouseover":return Cs=dp(Cs,e,t,n,o,i),!0;case"pointerover":var r=i.pointerId;return Up.set(r,dp(Up.get(r)||null,e,t,n,o,i)),!0;case"gotpointercapture":return r=i.pointerId,qp.set(r,dp(qp.get(r)||null,e,t,n,o,i)),!0}return!1}function G4(e){var t=Wc(e.target);if(t!==null){var n=Kp(t);if(n!==null){if(t=n.tag,t===13){if(t=d_(n),t!==null){e.blockedOn=t,VC(e.priority,function(){o_(n)});return}}else if(t===31){if(t=u_(n),t!==null){e.blockedOn=t,VC(e.priority,function(){o_(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function nh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=M1(e.nativeEvent);if(n===null){n=e.nativeEvent;var o=new n.constructor(n.type,n);Gw=o,n.target.dispatchEvent(o),Gw=null}else return t=Td(n),t!==null&&K4(t),e.blockedOn=n,!1;t.shift()}return!0}function r_(e,t,n){nh(e)&&n.delete(t)}function S9(){C1=!1,As!==null&&nh(As)&&(As=null),Ms!==null&&nh(Ms)&&(Ms=null),Cs!==null&&nh(Cs)&&(Cs=null),Up.forEach(r_),qp.forEach(r_)}function Bg(e,t){e.blockedOn===t&&(e.blockedOn=null,C1||(C1=!0,oo.unstable_scheduleCallback(oo.unstable_NormalPriority,S9)))}var Vg=null;function a_(e){Vg!==e&&(Vg=e,oo.unstable_scheduleCallback(oo.unstable_NormalPriority,function(){Vg===e&&(Vg=null);for(var t=0;t<e.length;t+=3){var n=e[t],o=e[t+1],i=e[t+2];if(typeof o!="function"){if(kE(o||n)===null)continue;break}var r=Td(n);r!==null&&(e.splice(t,3),t-=3,l1(r,{pending:!0,data:i,method:n.method,action:o},o,i))}}))}function kd(e){function t(l){return Bg(l,e)}As!==null&&Bg(As,e),Ms!==null&&Bg(Ms,e),Cs!==null&&Bg(Cs,e),Up.forEach(t),qp.forEach(t);for(var n=0;n<ms.length;n++){var o=ms[n];o.blockedOn===e&&(o.blockedOn=null)}for(;0<ms.length&&(n=ms[0],n.blockedOn===null);)G4(n),n.blockedOn===null&&ms.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(o=0;o<n.length;o+=3){var i=n[o],r=n[o+1],a=i[ti]||null;if(typeof r=="function")a||a_(n);else if(a){var s=null;if(r&&r.hasAttribute("formAction")){if(i=r,a=r[ti]||null)s=a.formAction;else if(kE(i)!==null)continue}else s=a.action;typeof s=="function"?n[o+1]=s:(n.splice(o,3),o-=3),a_(n)}}}function F4(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(a){return i=a})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),o||setTimeout(n,20)}function n(){if(!o&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function SE(e){this._internalRoot=e}Fh.prototype.render=SE.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ke(409));var n=t.current,o=ki();q4(n,o,e,t,null,null)};Fh.prototype.unmount=SE.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;q4(e.current,2,null,e,null,null),Kh(),t[Sd]=null}};function Fh(e){this._internalRoot=e}Fh.prototype.unstable_scheduleHydration=function(e){if(e){var t=E_();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ms.length&&t!==0&&t<ms[n].priority;n++);ms.splice(n,0,e),n===0&&G4(e)}};var s_=l_.version;if(s_!=="19.2.7")throw Error(ke(527,s_,"19.2.7"));qt.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ke(188)):(e=Object.keys(e).join(","),Error(ke(268,e)));return e=nP(t),e=e!==null?p_(e):null,e=e===null?null:e.stateNode,e};var T9={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:rt,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(up=__REACT_DEVTOOLS_GLOBAL_HOOK__,!up.isDisabled&&up.supportsFiber))try{Ip=up.inject(T9),wi=up}catch{}var up;Yh.createRoot=function(e,t){if(!c_(e))throw Error(ke(299));var n=!1,o="",i=j5,r=P5,a=B5;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=V4(e,1,!1,null,null,n,o,null,i,r,a,F4),e[Sd]=t.current,yE(e),new SE(t)};Yh.hydrateRoot=function(e,t,n){if(!c_(e))throw Error(ke(299));var o=!1,i="",r=j5,a=P5,s=B5,l=null;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(r=n.onUncaughtError),n.onCaughtError!==void 0&&(a=n.onCaughtError),n.onRecoverableError!==void 0&&(s=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),t=V4(e,1,!0,t,n??null,o,i,l,r,a,s,F4),t.context=U4(null),n=t.current,o=ki(),o=R1(o),i=Es(o),i.callback=null,ks(n,i,o),n=o,t.current.lanes=n,Fp(t,n),Ir(t),e[Sd]=t.current,yE(e),new Fh(t)};Yh.version="19.2.7"});var TE=Nr((cY,W4)=>{"use strict";function X4(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(X4)}catch(e){console.error(e)}}X4(),W4.exports=Y4()});function Dd(){return(Dd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function Wh(e,t){if(e==null)return{};var n,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)t.indexOf(n=r[o])>=0||(i[n]=e[n]);return i}function zl(e){var t=(0,at.useRef)(e),n=(0,at.useRef)(function(o){t.current&&t.current(o)});return t.current=e,n.current}function O9(e,t,n,o){var i=zl(n),r=zl(o),a=(0,at.useState)(function(){return e.toHsva(t)}),s=a[0],l=a[1],c=(0,at.useRef)({color:t,hsva:s}),u=(0,at.useRef)(!1);(0,at.useEffect)(function(){if(!e.equal(t,c.current.color)){var g=e.toHsva(t);c.current={hsva:g,color:t},l(g),u.current=!1}},[t,e]),(0,at.useEffect)(function(){var g;o6(s,c.current.hsva)||e.equal(g=e.fromHsva(s),c.current.color)||(c.current={hsva:s,color:g},i(g),u.current=!0)},[s,e,i]);var d=(0,at.useCallback)(function(g){l(function(y){return Object.assign({},y,g)})},[]),p=(0,at.useCallback)(function(){u.current&&(u.current=!1,r(c.current.color))},[r]);return[s,d,p]}var at,of,nf,AE,Z4,Q4,t6,LE,n6,oi,dY,A9,ME,M9,C9,CE,L9,Xh,_9,D9,R9,H9,o6,z9,$9,N9,j9,J4,P9,B9,V9,i6,U9,q9,e6,r6,a6=O(()=>{at=kt(Yt(),1);of=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},nf=function(e){return"touches"in e},AE=function(e){return e&&e.ownerDocument.defaultView||self},Z4=function(e,t,n){var o=e.getBoundingClientRect(),i=nf(t)?(function(r,a){for(var s=0;s<r.length;s++)if(r[s].identifier===a)return r[s];return r[0]})(t.touches,n):t;return{left:of((i.pageX-(o.left+AE(e).pageXOffset))/o.width),top:of((i.pageY-(o.top+AE(e).pageYOffset))/o.height)}},Q4=function(e){!nf(e)&&e.preventDefault()},t6=at.default.memo(function(e){var t=e.onMove,n=e.onKey,o=e.onEnd,i=Wh(e,["onMove","onKey","onEnd"]),r=(0,at.useRef)(null),a=zl(t),s=zl(n),l=zl(o),c=(0,at.useRef)(null),u=(0,at.useRef)(!1),d=(0,at.useMemo)(function(){var x=function(b){Q4(b),(nf(b)?b.touches.length>0:b.buttons>0)&&r.current?a(Z4(r.current,b,c.current)):(m(!1),l())},h=function(){m(!1),l()};function m(b){var E=u.current,S=AE(r.current),A=b?S.addEventListener:S.removeEventListener;A(E?"touchmove":"mousemove",x),A(E?"touchend":"mouseup",h)}return[function(b){var E=b.nativeEvent,S=r.current;if(S&&(Q4(E),!(function(_,T){return T&&!nf(_)})(E,u.current)&&S)){if(nf(E)){u.current=!0;var A=E.changedTouches||[];A.length&&(c.current=A[0].identifier)}S.focus(),a(Z4(S,E,c.current)),m(!0)}},function(b){var E=b.which||b.keyCode;E<37||E>40||(b.preventDefault(),s({left:E===39?.05:E===37?-.05:0,top:E===40?.05:E===38?-.05:0}))},function(b){var E=b.which||b.keyCode;E>=37&&E<=40&&l()},m]},[s,a,l]),p=d[0],g=d[1],y=d[2],v=d[3];return(0,at.useEffect)(function(){return v},[v]),at.default.createElement("div",Dd({},i,{onTouchStart:p,onMouseDown:p,className:"react-colorful__interactive",ref:r,onKeyDown:g,onKeyUp:y,tabIndex:0,role:"slider"}))}),LE=function(e){return e.filter(Boolean).join(" ")},n6=function(e){var t=e.color,n=e.left,o=e.top,i=o===void 0?.5:o,r=LE(["react-colorful__pointer",e.className]);return at.default.createElement("div",{className:r,style:{top:100*i+"%",left:100*n+"%"}},at.default.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},oi=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},dY={grad:.9,turn:360,rad:360/(2*Math.PI)},A9=function(e){return D9(ME(e))},ME=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?oi(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?oi(parseInt(e.substring(6,8),16)/255,2):1}},M9=function(e){return _9(L9(e))},C9=function(e){var t=e.s,n=e.v,o=e.a,i=(200-t)*n/100;return{h:oi(e.h),s:oi(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:oi(i/2),a:oi(o,2)}},CE=function(e){var t=C9(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},L9=function(e){var t=e.h,n=e.s,o=e.v,i=e.a;t=t/360*6,n/=100,o/=100;var r=Math.floor(t),a=o*(1-n),s=o*(1-(t-r)*n),l=o*(1-(1-t+r)*n),c=r%6;return{r:oi(255*[o,s,a,a,l,o][c]),g:oi(255*[l,o,o,s,a,a][c]),b:oi(255*[a,a,l,o,o,s][c]),a:oi(i,2)}},Xh=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},_9=function(e){var t=e.r,n=e.g,o=e.b,i=e.a,r=i<1?Xh(oi(255*i)):"";return"#"+Xh(t)+Xh(n)+Xh(o)+r},D9=function(e){var t=e.r,n=e.g,o=e.b,i=e.a,r=Math.max(t,n,o),a=r-Math.min(t,n,o),s=a?r===t?(n-o)/a:r===n?2+(o-t)/a:4+(t-n)/a:0;return{h:60*(s<0?s+6:s),s:r?a/r*100:0,v:r/255*100,a:i}},R9=at.default.memo(function(e){var t=e.hue,n=e.onChange,o=e.onChangeEnd,i=LE(["react-colorful__hue",e.className]);return at.default.createElement("div",{className:i},at.default.createElement(t6,{onMove:function(r){n({h:360*r.left})},onKey:function(r){n({h:of(t+360*r.left,0,360)})},onEnd:o,"aria-label":"Hue","aria-valuenow":oi(t),"aria-valuemax":"360","aria-valuemin":"0"},at.default.createElement(n6,{className:"react-colorful__hue-pointer",left:t/360,color:CE({h:t,s:100,v:100,a:1})})))}),H9=at.default.memo(function(e){var t=e.hsva,n=e.onChange,o=e.onChangeEnd,i={backgroundColor:CE({h:t.h,s:100,v:100,a:1})};return at.default.createElement("div",{className:"react-colorful__saturation",style:i},at.default.createElement(t6,{onMove:function(r){n({s:100*r.left,v:100-100*r.top})},onKey:function(r){n({s:of(t.s+100*r.left,0,100),v:of(t.v-100*r.top,0,100)})},onEnd:o,"aria-label":"Color","aria-valuetext":"Saturation "+oi(t.s)+"%, Brightness "+oi(t.v)+"%"},at.default.createElement(n6,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:CE(t)})))}),o6=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},z9=function(e,t){return e.toLowerCase()===t.toLowerCase()||o6(ME(e),ME(t))};N9=typeof window<"u"?at.useLayoutEffect:at.useEffect,j9=function(){return $9||(typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0)},J4=new WeakMap,P9=function(e){N9(function(){var t=e.current;if(typeof document<"u"&&t){var n=t.getRootNode?t.getRootNode():t.ownerDocument,o=n&&("head"in n||"host"in n)?n:t.ownerDocument;if(!J4.has(o)){var i="head"in o?o.head:o,r=(i.ownerDocument||document).createElement("style");r.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`;var a=j9();a&&r.setAttribute("nonce",a),J4.set(o,r),i.appendChild(r)}}},[])},B9=function(e){var t=e.className,n=e.colorModel,o=e.color,i=o===void 0?n.defaultColor:o,r=e.onChange,a=e.onChangeEnd,s=Wh(e,["className","colorModel","color","onChange","onChangeEnd"]),l=(0,at.useRef)(null);P9(l);var c=O9(n,i,r,a),u=c[0],d=c[1],p=c[2],g=LE(["react-colorful",t]);return at.default.createElement("div",Dd({},s,{ref:l,className:g}),at.default.createElement(H9,{hsva:u,onChange:d,onChangeEnd:p}),at.default.createElement(R9,{hue:u.h,onChange:d,onChangeEnd:p,className:"react-colorful__last-control"}))},V9={defaultColor:"000",toHsva:A9,fromHsva:function(e){return M9({h:e.h,s:e.s,v:e.v,a:1})},equal:z9},i6=function(e){return at.default.createElement(B9,Dd({},e,{colorModel:V9}))},U9=/^#?([0-9A-F]{3,8})$/i,q9=function(e){var t=e.color,n=t===void 0?"":t,o=e.onChange,i=e.onBlur,r=e.escape,a=e.validate,s=e.format,l=e.process,c=Wh(e,["color","onChange","onBlur","escape","validate","format","process"]),u=(0,at.useState)(function(){return r(n)}),d=u[0],p=u[1],g=zl(o),y=zl(i),v=(0,at.useCallback)(function(h){var m=r(h.target.value);p(m),a(m)&&g(l?l(m):m)},[r,l,a,g]),x=(0,at.useCallback)(function(h){a(h.target.value)||p(r(n)),y(h)},[n,r,a,y]);return(0,at.useEffect)(function(){p(r(n))},[n,r]),at.default.createElement("input",Dd({},c,{value:s?s(d):d,spellCheck:"false",onChange:v,onBlur:x}))},e6=function(e){return"#"+e},r6=function(e){var t=e.prefixed,n=e.alpha,o=Wh(e,["prefixed","alpha"]),i=(0,at.useCallback)(function(a){return a.replace(/([^0-9A-F]+)/gi,"").substring(0,n?8:6)},[n]),r=(0,at.useCallback)(function(a){return(function(s,l){var c=U9.exec(s),u=c?c[1].length:0;return u===3||u===6||!!l&&u===4||!!l&&u===8})(a,n)},[n]);return at.default.createElement(q9,Dd({},o,{escape:i,format:t?e6:void 0,process:e6,validate:r}))}});var c6={};Ft(c6,{accentPicker:()=>I9});function K9({initial:e,onChange:t}){let[n,o]=(0,Gr.useState)(e),[i,r]=(0,Gr.useState)(!1),a=(0,Gr.useRef)(null),s=(0,Gr.useRef)(null),l=!s6.some(([,u])=>u===n),c=u=>{if(!/^#[0-9a-f]{6}$/i.test(u))return;let d=u.toLowerCase();o(d),t(d)};return(0,Gr.useLayoutEffect)(()=>{let u=a.current;if(!u)return;if(!i){let p=window.setTimeout(()=>u.hidePopover(),150);return()=>clearTimeout(p)}u.showPopover();let d=()=>{let p=s.current.getBoundingClientRect();u.style.left=`${Math.max(8,Math.min(p.right-u.offsetWidth,innerWidth-u.offsetWidth-8))}px`,u.style.top=`${Math.max(8,p.top-u.offsetHeight-8)}px`};return d(),u.querySelector('[role="slider"]')?.focus({preventScroll:!0}),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[i]),(0,Gr.useEffect)(()=>{if(!i)return;let u=p=>{!p.composedPath().includes(a.current)&&!p.composedPath().includes(s.current)&&r(!1)},d=new AbortController;return jr(s.current,"pointerdown",u,{signal:d.signal}),()=>d.abort()},[i]),(0,To.jsxs)("div",{className:"account-accent",children:[(0,To.jsx)("span",{className:"account-accent-label",children:"Accent color"}),(0,To.jsxs)("div",{className:"accent-swatches",role:"group","aria-label":"Accent color",children:[s6.map(([u,d])=>(0,To.jsx)("button",{type:"button",className:"accent-swatch","aria-label":u,title:u,"aria-pressed":n===d,style:{"--swatch":d},onClick:()=>{c(d),r(!1)}},u)),(0,To.jsx)("button",{ref:s,type:"button",className:"accent-swatch accent-custom","aria-label":"Custom accent color","aria-haspopup":"dialog","aria-expanded":i,"aria-pressed":l,onClick:()=>r(!i),children:(0,To.jsx)(Zu,{"aria-hidden":"true"})})]}),(0,To.jsxs)("div",{ref:a,popover:"manual",role:"dialog","aria-label":"Custom accent color",className:i?"accent-popover t-dropdown is-open":"accent-popover t-dropdown is-closing",onKeyDown:u=>{u.stopPropagation(),u.key==="Escape"&&(u.preventDefault(),r(!1),s.current?.focus())},children:[(0,To.jsxs)("div",{className:"accent-popover-head",children:[(0,To.jsx)("span",{children:"Color"}),(0,To.jsx)("span",{children:n})]}),(0,To.jsxs)("div",{className:"accent-picker-body",children:[(0,To.jsx)(i6,{color:n,onChange:c}),(0,To.jsx)(r6,{"aria-label":"Hex accent color",className:"accent-hex",color:n,onChange:c,prefixed:!0})]})]})]})}function I9(e,t){let n=w("div","account-accent-mount"),o=(0,l6.createRoot)(n);return o.render((0,To.jsx)(K9,{initial:e,onChange:t})),{element:n,destroy:()=>o.unmount()}}var Gr,l6,To,s6,d6=O(()=>{"use strict";Gr=kt(Yt(),1),l6=kt(TE(),1);a6();Tv();It();To=kt(ya(),1),s6=[["Lavender","#c8b5f4"],["Blue","#85b5ff"],["Mint","#84d9bb"],["Yellow","#f4d779"],["Peach","#f5af87"],["Pink","#efa5c6"]]});function k6(e,t){return{width:Math.min(e,e>250?280:200),height:t>52?32:28}}function S6(e,t,n,o){return{left:e-n/2,top:t-o,width:n,height:o}}var Ol,eb,tb,DE,RE,HE,E6,zE=O(()=>{"use strict";Ol={type:"spring",duration:.4,bounce:.24},eb={duration:.1,ease:[.4,0,.2,1]},tb={duration:.25,ease:[.22,1,.36,1]},DE={type:"spring",duration:.4,bounce:.3},RE={type:"spring",duration:.12,bounce:.3},HE=.2,E6=.02});function nb(e){if(typeof e!="string"||!e)throw new Error("expected a non-empty string, got: "+e)}function jE(e){if(typeof e!="number")throw new Error("expected a number, got: "+e)}function nV(e,t){let n=new Set,o=[];for(let i of e){let r=t(i);n.has(r)||(n.add(r),o.push(i))}return o}function C6(e){return nV(e,t=>t.unicode)}function oV(e){function t(n,o,i){let r=o?e.createObjectStore(n,{keyPath:o}):e.createObjectStore(n);if(i)for(let[a,[s,l]]of Object.entries(i))r.createIndex(a,s,{multiEntry:l});return r}t(Hd),t(Nl,W9,{[_6]:[X9,!0],[R6]:[[Z9,Q9]],[H6]:[J9,!0]}),t(UE,void 0,{[D6]:[""]})}function z6(e,t,n){n.onerror=()=>t(n.error),n.onblocked=()=>t(new Error("IDB blocked")),n.onsuccess=()=>e(n.result)}async function iV(e){let t=await new Promise((n,o)=>{let i=indexedDB.open(e,F9);BE[e]=i,i.onupgradeneeded=r=>{r.oldVersion<Y9&&oV(i.result)},z6(n,o,i)});return t.onclose=()=>KE(e),t}function rV(e){return ib[e]||(ib[e]=iV(e)),ib[e]}function Ba(e,t,n,o){return new Promise((i,r)=>{let a=e.transaction(t,n,{durability:"relaxed"}),s=typeof t=="string"?a.objectStore(t):t.map(c=>a.objectStore(c)),l;o(s,a,c=>{l=c}),a.oncomplete=()=>i(l),a.onerror=()=>r(a.error)})}function KE(e){let t=BE[e],n=t&&t.result;if(n){n.close();let o=ab[e];if(o)for(let i of o)i()}delete BE[e],delete ib[e],delete ab[e]}function aV(e){return new Promise((t,n)=>{KE(e);let o=indexedDB.deleteDatabase(e);z6(t,n,o)})}function sV(e,t){let n=ab[e];n||(n=ab[e]=[]),n.push(t)}function Rd(e){return e.split(/[\s_]+/).map(t=>!t.match(/\w/)||lV.has(t)?t.toLowerCase():t.replace(/[)(:,]/g,"").replace(/’/g,"'").toLowerCase()).filter(Boolean)}function O6(e){return e.filter(Boolean).map(t=>t.toLowerCase()).filter(t=>t.length>=cV)}function dV(e){return e.map(({annotation:n,emoticon:o,group:i,order:r,shortcodes:a,skins:s,tags:l,emoji:c,version:u})=>{let d=[...new Set(O6([...(a||[]).map(Rd).flat(),...(l||[]).map(Rd).flat(),...Rd(n),o]))].sort(),p={annotation:n,group:i,order:r,tags:l,tokens:d,unicode:c,version:u};if(o&&(p.emoticon=o),a&&(p.shortcodes=a),s){p.skinTones=[],p.skinUnicodes=[],p.skinVersions=[];for(let{tone:g,emoji:y,version:v}of s)p.skinTones.push(g),p.skinUnicodes.push(y),p.skinVersions.push(v)}return p})}function $6(e,t,n,o){e[t](n).onsuccess=i=>o&&o(i.target.result)}function $l(e,t,n){$6(e,"get",t,n)}function N6(e,t,n){$6(e,"getAll",t,n)}function IE(e){e.commit&&e.commit()}function uV(e,t){let n=e[0];for(let o=1;o<e.length;o++){let i=e[o];t(n)>t(i)&&(n=i)}return n}function j6(e,t){let n=uV(e,i=>i.length),o=[];for(let i of n)e.some(r=>r.findIndex(a=>t(a)===t(i))===-1)||o.push(i);return o}async function pV(e){return!await GE(e,Hd,rb)}async function fV(e,t,n){let[o,i]=await Promise.all([PE,rb].map(r=>GE(e,Hd,r)));return o===n&&i===t}async function mV(e,t){return Ba(e,Nl,zd,(o,i,r)=>{let a,s=()=>{o.getAll(a&&IDBKeyRange.lowerBound(a,!0),50).onsuccess=l=>{let c=l.target.result;for(let u of c)if(a=u.unicode,t(u))return r(u);if(c.length<50)return r();s()}};s()})}async function P6(e,t,n,o){{let i=dV(t);await Ba(e,[Nl,Hd],qE,([r,a],s)=>{let l,c,u=0;function d(){++u===2&&p()}function p(){if(!(l===o&&c===n)){r.clear();for(let g of i)r.put(g);a.put(o,PE),a.put(n,rb),IE(s)}}$l(a,PE,g=>{l=g,d()}),$l(a,rb,g=>{c=g,d()})})}}async function gV(e,t){return Ba(e,Nl,zd,(n,o,i)=>{let r=IDBKeyRange.bound([t,0],[t+1,0],!1,!0);N6(n.index(R6),r,i)})}async function B6(e,t){let n=O6(Rd(t));return n.length?Ba(e,Nl,zd,(o,i,r)=>{let a=[],s=()=>{a.length===n.length&&l()},l=()=>{let c=j6(a,u=>u.unicode);r(c.sort((u,d)=>u.order<d.order?-1:1))};for(let c=0;c<n.length;c++){let u=n[c],d=c===n.length-1?IDBKeyRange.bound(u,u+"\uFFFF",!1,!0):IDBKeyRange.only(u);N6(o.index(_6),d,p=>{a.push(p),s()})}}):[]}async function hV(e,t){let n=await B6(e,t);return n.length?n.filter(o=>(o.shortcodes||[]).map(r=>r.toLowerCase()).includes(t.toLowerCase()))[0]||null:await mV(e,i=>(i.shortcodes||[]).includes(t.toLowerCase()))||null}async function bV(e,t){return Ba(e,Nl,zd,(n,o,i)=>$l(n,t,r=>{if(r)return i(r);$l(n.index(H6),t,a=>i(a||null))}))}function GE(e,t,n){return Ba(e,t,zd,(o,i,r)=>$l(o,n,r))}function yV(e,t,n,o){return Ba(e,t,qE,(i,r)=>{i.put(o,n),IE(r)})}function xV(e,t){return Ba(e,UE,qE,(n,o)=>$l(n,t,i=>{n.put((i||0)+1,t),IE(o)}))}function vV(e,t,n){return n===0?[]:Ba(e,[UE,Nl],zd,([o,i],r,a)=>{let s=[];o.index(D6).openCursor(void 0,"prev").onsuccess=l=>{let c=l.target.result;if(!c)return a(s);function u(g){if(s.push(g),s.length===n)return a(s);c.continue()}let d=c.primaryKey,p=t.byName(d);if(p)return u(p);$l(i,d,g=>{if(g)return u(g);c.continue()})}})}function wV(e,t){let n=new Map;for(let i of e){let r=t(i);for(let a of r){let s=n;for(let c=0;c<a.length;c++){let u=a.charAt(c),d=s.get(u);d||(d=new Map,s.set(u,d)),s=d}let l=s.get(ob);l||(l=[],s.set(ob,l)),l.push(i)}}return(i,r)=>{let a=n;for(let c=0;c<i.length;c++){let u=i.charAt(c),d=a.get(u);if(d)a=d;else return[]}if(r)return a.get(ob)||[];let s=[],l=[a];for(;l.length;){let u=[...l.shift().entries()].sort((d,p)=>d[0]<p[0]?-1:1);for(let[d,p]of u)d===ob?s.push(...p):l.push(p)}return s}}function kV(e){let t=e&&Array.isArray(e),n=t&&e.length&&(!e[0]||EV.some(o=>!(o in e[0])));if(!t||n)throw new Error("Custom emojis are in the wrong format")}function L6(e){kV(e);let t=(p,g)=>p.name.toLowerCase()<g.name.toLowerCase()?-1:1,n=e.sort(t),i=wV(e,p=>{let g=new Set;if(p.shortcodes)for(let y of p.shortcodes)for(let v of Rd(y))g.add(v);return g}),r=p=>i(p,!0),a=p=>i(p,!1),s=p=>{let g=Rd(p),y=g.map((v,x)=>(x<g.length-1?r:a)(v));return j6(y,v=>v.name).sort(t)},l=new Map,c=new Map;for(let p of e){c.set(p.name.toLowerCase(),p);for(let g of p.shortcodes||[])l.set(g.toLowerCase(),p)}return{all:n,search:s,byShortcode:p=>l.get(p.toLowerCase()),byName:p=>c.get(p.toLowerCase())}}function sf(e){if(!e)return e;if(SV&&(e=structuredClone(e)),delete e.tokens,e.skinTones){let t=e.skinTones.length;e.skins=Array(t);for(let n=0;n<t;n++)e.skins[n]={tone:e.skinTones[n],unicode:e.skinUnicodes[n],version:e.skinVersions[n]};delete e.skinTones,delete e.skinUnicodes,delete e.skinVersions}return e}function V6(e){e||console.warn("emoji-picker-element is more efficient if the dataSource server exposes an ETag header.")}function AV(e){if(!e||!Array.isArray(e)||!e[0]||typeof e[0]!="object"||TV.some(t=>!(t in e[0])))throw new Error("Emoji data is in the wrong format")}function U6(e,t){if(Math.floor(e.status/100)!==2)throw new Error("Failed to fetch: "+t+": "+e.status)}async function MV(e){let t=await fetch(e,{method:"HEAD"});U6(t,e);let n=t.headers.get("etag");return V6(n),n}async function VE(e){let t=await fetch(e);U6(t,e);let n=t.headers.get("etag");V6(n);let o=await t.json();return AV(o),[n,o]}function CV(e){for(var t="",n=new Uint8Array(e),o=n.byteLength,i=-1;++i<o;)t+=String.fromCharCode(n[i]);return t}function LV(e){for(var t=e.length,n=new ArrayBuffer(t),o=new Uint8Array(n),i=-1;++i<t;)o[i]=e.charCodeAt(i);return n}async function q6(e){let t=JSON.stringify(e),n=LV(t),o=await crypto.subtle.digest("SHA-1",n),i=CV(o);return btoa(i)}async function _V(e,t){let n,o=await MV(t);if(!o){let i=await VE(t);o=i[0],n=i[1],o||(o=await q6(n))}await fV(e,t,o)||(n||(n=(await VE(t))[1]),await P6(e,n,t,o))}async function DV(e,t){let[n,o]=await VE(t);n||(n=await q6(o)),await P6(e,o,t,n)}async function RV(e,t){try{await _V(e,t)}catch(n){if(n.name!=="InvalidStateError")throw n}}var F9,Y9,Nl,Hd,UE,X9,_6,W9,D6,Z9,Q9,R6,PE,rb,M6,zd,qE,H6,J9,eV,tV,BE,ib,ab,lV,cV,ob,EV,SV,TV,sb,K6=O(()=>{F9=1,Y9=1,Nl="emoji",Hd="keyvalue",UE="favorites",X9="tokens",_6="tokens",W9="unicode",D6="count",Z9="group",Q9="order",R6="group-order",PE="eTag",rb="url",M6="skinTone",zd="readonly",qE="readwrite",H6="skinUnicodes",J9="skinUnicodes",eV="https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json",tV="en";BE={},ib={},ab={};lV=new Set([":D","XD",":'D","O:)",":X",":P",";P","XP",":L",":Z",":j","8D","XO","8)",":B",":O",":S",":'o","Dx","X(","D:",":C",">0)",":3","</3","<3","\\M/",":E","8#"]);cV=2;ob="";EV=["name","url"];SV=typeof wrappedJSObject<"u";TV=["annotation","emoji","group","order","version"];sb=class{constructor({dataSource:t=eV,locale:n=tV,customEmoji:o=[]}={}){this.dataSource=t,this.locale=n,this._dbName=`emoji-picker-element-${this.locale}`,this._db=void 0,this._lazyUpdate=void 0,this._custom=L6(o),this._clear=this._clear.bind(this),this._ready=this._init()}async _init(){let t=this._db=await rV(this._dbName);sV(this._dbName,this._clear);let n=this.dataSource;await pV(t)?await DV(t,n):this._lazyUpdate=RV(t,n)}async ready(){let t=async()=>(this._ready||(this._ready=this._init()),this._ready);await t(),this._db||await t()}async getEmojiByGroup(t){return jE(t),await this.ready(),C6(await gV(this._db,t)).map(sf)}async getEmojiBySearchQuery(t){nb(t),await this.ready();let n=this._custom.search(t),o=C6(await B6(this._db,t)).map(sf);return[...n,...o]}async getEmojiByShortcode(t){nb(t),await this.ready();let n=this._custom.byShortcode(t);return n||sf(await hV(this._db,t))}async getEmojiByUnicodeOrName(t){nb(t),await this.ready();let n=this._custom.byName(t);return n||sf(await bV(this._db,t))}async getPreferredSkinTone(){return await this.ready(),await GE(this._db,Hd,M6)||0}async setPreferredSkinTone(t){return jE(t),await this.ready(),yV(this._db,Hd,M6,t)}async incrementFavoriteEmojiCount(t){return nb(t),await this.ready(),xV(this._db,t)}async getTopFavoriteEmoji(t){return jE(t),await this.ready(),(await vV(this._db,this._custom,t)).map(sf)}set customEmoji(t){this._custom=L6(t)}get customEmoji(){return this._custom.all}async _shutdown(){await this.ready();try{await this._lazyUpdate}catch{}}_clear(){this._db=this._ready=this._lazyUpdate=void 0}async close(){await this._shutdown(),await KE(this._dbName)}async delete(){await this._shutdown(),await aV(this._dbName)}}});var iD={};Ft(iD,{default:()=>Od,rescueElementPrototype:()=>nk});function G6(e){return e.unicode.includes("\u200D")}function VV(e){let t=F6(e,"#000"),n=F6(e,"#fff");return t&&n&&BV(t,n)}function UV(){let e=Object.entries(zV);try{for(let[t,n]of e)if(VV(t))return n}catch{}return e[0][1]}function YV(e,t){if(t===0)return e;let n=e.indexOf(IV);return n!==-1?e.substring(0,n)+String.fromCodePoint(GV+t-1)+e.substring(n):(e.endsWith(qV)&&(e=e.substring(0,e.length-1)),e+KV+String.fromCodePoint(FV+t-1))}function Fr(e){e.preventDefault(),e.stopPropagation()}function WE(e,t,n){return t+=e?-1:1,t<0?t=n.length-1:t>=n.length&&(t=0),t}function tD(e,t){let n=new Set,o=[];for(let i of e){let r=t(i);n.has(r)||(n.add(r),o.push(i))}return o}function XV(e,t){let n=o=>{let i={};for(let r of o)typeof r.tone=="number"&&r.version<=t&&(i[r.tone]=r.unicode);return i};return e.map(({unicode:o,skins:i,shortcodes:r,url:a,name:s,category:l,annotation:c})=>({unicode:o,name:s,shortcodes:r,url:a,category:l,annotation:c,id:o||s,skins:i&&n(i)}))}function ZV(e,t,n){let o;WV?(o=new ResizeObserver(n),o.observe(e)):cb(n),t.addEventListener("abort",()=>{o&&o.disconnect()})}function Y6(e){{let t=document.createRange();return t.selectNode(e.firstChild),t.getBoundingClientRect().width}}function X6(e,t,n){let o=Y6(t);if(!o){if(!jl){jl=n.cloneNode(!0);let i=getComputedStyle(n);for(let r of["font-family","line-height","width","height","font-size","display","align-items","justify-content"])jl.style.setProperty(r,i.getPropertyValue(r),"important")}try{return document.body.appendChild(jl),jl.firstChild.nodeValue=e,Y6(jl)}finally{jl.remove()}}return o}function JV(e,t,n){let o=!0;for(let i of e){let r=n(i);if(!r)continue;typeof ZE>"u"&&(ZE=X6(QV,t,t));let s=X6(i.unicode,r,t)/1.8<ZE;tk.set(i.unicode,s),s||(o=!1)}return o}function e7(e){return tD(e,t=>t)}function t7(e){e&&(e.scrollTop=0)}function lf(e,t,n){let o=e.get(t);return o||(o=n(),e.set(t,o)),o}function W6(e){return""+e}function n7(e){let t=document.createElement("template");return t.innerHTML=e,t}function s7(e,t){a7?e.replaceChildren(...t):(e.innerHTML="",e.append(...t))}function l7(e,t){let n=e.firstChild,o=0;for(;n;){if(t[o]!==n)return!0;n=n.nextSibling,o++}return o!==t.length}function c7(e,t){let{targetNode:n}=t,{targetParentNode:o}=t,i=!1;o?i=l7(o,e):(i=!0,t.targetNode=void 0,t.targetParentNode=o=n.parentNode),i&&s7(o,e)}function d7(e,t){for(let n of t){let{targetNode:o,currentExpression:i,binding:{expressionIndex:r,attributeName:a,attributeValuePre:s,attributeValuePost:l}}=n,c=e[r];if(i!==c)if(n.currentExpression=c,a)if(c===null)o.removeAttribute(a);else{let u=s+W6(c)+l;o.setAttribute(a,u)}else{let u;Array.isArray(c)?c7(c,n):c instanceof Element?(u=c,o.replaceWith(u)):o.nodeValue=W6(c),u&&(n.targetNode=u)}}}function u7(e){let t="",n=!1,o=!1,i=-1,r=new Map,a=[],s=0;for(let c=0,u=e.length;c<u;c++){let d=e[c];if(t+=d.slice(s),c===u-1)break;for(let m=0;m<d.length;m++)switch(d.charAt(m)){case"<":{d.charAt(m+1)==="/"?a.pop():(n=!0,a.push(++i));break}case">":{n=!1,o=!1;break}case"=":{o=!0;break}}let p=a[a.length-1],g=lf(r,p,()=>[]),y,v,x;if(o){let m=/(\S+)="?([^"=]*)$/.exec(d);y=m[1],v=m[2];let b=/^([^">]*)("?)/.exec(e[c+1]);x=b[1],t=t.slice(0,-1*m[0].length),s=b[0].length}else s=0;let h={attributeName:y,attributeValuePre:v,attributeValuePost:x,expressionIndex:c};g.push(h),!n&&!o&&(t+=" ")}return{template:n7(t),elementsToBindings:r}}function Z6(e,t,n){for(let o=0;o<e.length;o++){let i=e[o],r=i.attributeName?t:t.firstChild,a={binding:i,targetNode:r,targetParentNode:void 0,currentExpression:void 0};n.push(a)}}function p7(e,t){let n=[],o;if(t.size===1&&(o=t.get(0)))Z6(o,e,n);else{let i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r=e,a=-1;do{let s=t.get(++a);s&&Z6(s,r,n)}while(r=i.nextNode())}return n}function f7(e){let{template:t,elementsToBindings:n}=lf(o7,e,()=>u7(e)),o=t.cloneNode(!0).content.firstElementChild,i=p7(o,n);return function(a){return d7(a,i),o}}function m7(e){let t=lf(i7,e,()=>new Map),n=r7;function o(r,...a){let s=lf(t,r,()=>new Map);return lf(s,n,()=>f7(r))(a)}function i(r,a,s){return r.map((l,c)=>{let u=n;n=s(l);try{return a(l,c)}finally{n=u}})}return{map:i,html:o}}function g7(e,t,n,o,i,r,a,s,l){let{labelWithSkin:c,titleForEmoji:u,unicodeWithSkin:d}=n,{html:p,map:g}=m7(t);function y(m,b,E){return g(m,(S,A)=>p`<button role="${b?"option":"menuitem"}" aria-selected="${b?A===t.activeSearchItem:null}" aria-label="${c(S,t.currentSkinTone)}" title="${u(S)}" class="${"emoji"+(b&&A===t.activeSearchItem?" active":"")+(S.unicode?"":" custom-emoji")}" id="${`${E}-${S.id}`}" style="${S.unicode?null:`--custom-emoji-background: url(${JSON.stringify(S.url)})`}">${S.unicode?d(S,t.currentSkinTone):""}</button>`,S=>`${E}-${S.id}`)}let x=p`<section data-ref="rootElement" class="picker" aria-label="${t.i18n.regionLabel}" style="${t.pickerStyle||""}"><div class="pad-top"></div><div class="search-row"><div class="search-wrapper"><input id="search" class="search" type="search" role="combobox" enterkeyhint="search" placeholder="${t.i18n.searchLabel}" autocapitalize="none" autocomplete="off" spellcheck="true" aria-expanded="${!!(t.searchMode&&t.currentEmojis.length)}" aria-controls="search-results" aria-describedby="search-description" aria-autocomplete="list" aria-activedescendant="${t.activeSearchItemId?`emo-${t.activeSearchItemId}`:null}" data-ref="searchElement" data-on-input="onSearchInput" data-on-keydown="onSearchKeydown"><label class="sr-only" for="search">${t.i18n.searchLabel}</label> <span id="search-description" class="sr-only">${t.i18n.searchDescription}</span></div><div class="skintone-button-wrapper ${t.skinTonePickerExpandedAfterAnimation?"expanded":""}"><button id="skintone-button" class="emoji ${t.skinTonePickerExpanded?"hide-focus":""}" aria-label="${t.skinToneButtonLabel}" title="${t.skinToneButtonLabel}" aria-describedby="skintone-description" aria-haspopup="listbox" aria-expanded="${t.skinTonePickerExpanded}" aria-controls="skintone-list" data-on-click="onClickSkinToneButton">${t.skinToneButtonText||""}</button></div><span id="skintone-description" class="sr-only">${t.i18n.skinToneDescription}</span><div data-ref="skinToneDropdown" id="skintone-list" class="skintone-list hide-focus ${t.skinTonePickerExpanded?"":"hidden no-animate"}" style="transform:translateY(${t.skinTonePickerExpanded?0:"calc(-1 * var(--num-skintones) * var(--total-emoji-size))"})" role="listbox" aria-label="${t.i18n.skinTonesLabel}" aria-activedescendant="skintone-${t.activeSkinTone}" aria-hidden="${!t.skinTonePickerExpanded}" tabIndex="-1" data-on-focusout="onSkinToneOptionsFocusOut" data-on-click="onSkinToneOptionsClick" data-on-keydown="onSkinToneOptionsKeydown" data-on-keyup="onSkinToneOptionsKeyup">${g(t.skinTones,(m,b)=>p`<div id="skintone-${b}" class="emoji ${b===t.activeSkinTone?"active":""}" aria-selected="${b===t.activeSkinTone}" role="option" title="${t.i18n.skinTones[b]}" aria-label="${t.i18n.skinTones[b]}">${m}</div>`,m=>m)}</div></div><div class="nav" role="tablist" style="grid-template-columns:repeat(${t.groups.length},1fr)" aria-label="${t.i18n.categoriesLabel}" data-on-keydown="onNavKeydown" data-on-click="onNavClick">${g(t.groups,m=>p`<button role="tab" class="nav-button" aria-controls="tab-${m.id}" aria-label="${t.i18n.categories[m.name]}" aria-selected="${!t.searchMode&&t.currentGroup.id===m.id}" title="${t.i18n.categories[m.name]}" data-group-id="${m.id}"><div class="nav-emoji emoji">${m.emoji}</div></button>`,m=>m.id)}</div><div class="indicator-wrapper"><div class="indicator" style="transform:translateX(${(t.isRtl?-1:1)*t.currentGroupIndex*100}%)"></div></div><div class="message ${t.message?"":"gone"}" role="alert" aria-live="polite">${t.message||""}</div><div data-ref="tabpanelElement" class="tabpanel ${!t.databaseLoaded||t.message?"gone":""}" role="${t.searchMode?"region":"tabpanel"}" aria-label="${t.searchMode?t.i18n.searchResultsLabel:t.i18n.categories[t.currentGroup.name]}" id="${t.searchMode?null:`tab-${t.currentGroup.id}`}" tabIndex="0" data-on-click="onEmojiClick"><div data-action="calculateEmojiGridStyle">${g(t.currentEmojisWithCategories,(m,b)=>p`<div><div id="menu-label-${b}" class="category ${t.currentEmojisWithCategories.length===1&&t.currentEmojisWithCategories[0].category===""?"gone":""}" aria-hidden="true">${t.searchMode?t.i18n.searchResultsLabel:m.category?m.category:t.currentEmojisWithCategories.length>1?t.i18n.categories.custom:t.i18n.categories[t.currentGroup.name]}</div><div class="emoji-menu ${b!==0&&!t.searchMode&&t.currentGroup.id===-1?"visibility-auto":""}" style="${`--num-rows: ${Math.ceil(m.emojis.length/t.numColumns)}`}" data-action="updateOnIntersection" role="${t.searchMode?"listbox":"menu"}" aria-labelledby="menu-label-${b}" id="${t.searchMode?"search-results":null}">${y(m.emojis,t.searchMode,"emo")}</div></div>`,m=>m.category)}</div></div><div class="favorites onscreen emoji-menu ${t.message?"gone":""}" role="menu" aria-label="${t.i18n.favoritesLabel}" data-on-click="onEmojiClick">${y(t.currentFavorites,!1,"fav")}</div><button data-ref="baselineEmoji" aria-hidden="true" tabindex="-1" class="abs-pos hidden emoji baseline-emoji">😀</button></section>`,h=(m,b)=>{for(let E of e.querySelectorAll(`[${m}]`))b(E,E.getAttribute(m))};if(l){e.appendChild(x);for(let m of["click","focusout","input","keydown","keyup"])h(`data-on-${m}`,(b,E)=>{b.addEventListener(m,o[E])});h("data-ref",(m,b)=>{r[b]=m}),a.addEventListener("abort",()=>{e.removeChild(x)})}h("data-action",(m,b)=>{let E=s.get(b);E||s.set(b,E=new WeakSet),E.has(m)||(E.add(m),i[b](m))})}function h7(e){let t=!1,n,o=new Map,i=new Set,r,a=()=>{if(t)return;let c=[...i];i.clear();try{for(let u of c)u()}finally{r=!1,i.size&&(r=!0,db(a))}},s=new Proxy({},{get(c,u){if(n){let d=o.get(u);d||(d=new Set,o.set(u,d)),d.add(n)}return c[u]},set(c,u,d){if(c[u]!==d){c[u]=d;let p=o.get(u);if(p){for(let g of p)i.add(g);r||(r=!0,db(a))}}return!0}}),l=c=>{let u=()=>{let d=n;n=u;try{return c()}finally{n=d}};return u()};return e.addEventListener("abort",()=>{t=!0}),{state:s,createEffect:l}}function QE(e,t,n){if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(!n(e[o],t[o]))return!1;return!0}function b7(e,t,n){{let o=e.closest(".tabpanel"),i=Q6.get(o);i||(i=new IntersectionObserver(n,{root:o,rootMargin:"50% 0px 50% 0px",threshold:0}),Q6.set(o,i),t.addEventListener("abort",()=>{i.disconnect()})),i.observe(e)}}function y7(e,t){let n={},o=new AbortController,i=o.signal,{state:r,createEffect:a}=h7(i),s=new Map;lb(r,{skinToneEmoji:void 0,i18n:void 0,database:void 0,customEmoji:void 0,customCategorySorting:void 0,emojiVersion:void 0}),lb(r,t),lb(r,{initialLoad:!0,currentEmojis:[],currentEmojisWithCategories:[],rawSearchText:"",searchText:"",searchMode:!1,activeSearchItem:-1,message:void 0,skinTonePickerExpanded:!1,skinTonePickerExpandedAfterAnimation:!1,currentSkinTone:0,activeSkinTone:0,skinToneButtonText:void 0,pickerStyle:void 0,skinToneButtonLabel:"",skinTones:[],currentFavorites:[],defaultFavoriteEmojis:void 0,numColumns:NV,isRtl:!1,currentGroupIndex:0,groups:FE,databaseLoaded:!1,activeSearchItemId:void 0}),a(()=>{r.currentGroup!==r.groups[r.currentGroupIndex]&&(r.currentGroup=r.groups[r.currentGroupIndex])});let l=L=>{e.getElementById(L).focus()},c=L=>e.getElementById(`emo-${L.id}`),u=(L,Q)=>{n.rootElement.dispatchEvent(new CustomEvent(L,{detail:Q,bubbles:!0,composed:!0}))},d=(L,Q)=>L.id===Q.id,p=(L,Q)=>{let{category:Z,emojis:ae}=L,{category:we,emojis:Te}=Q;return Z!==we?!1:QE(ae,Te,d)},g=L=>{QE(r.currentEmojis,L,d)||(r.currentEmojis=L)},y=L=>{r.searchMode!==L&&(r.searchMode=L)},v=L=>{QE(r.currentEmojisWithCategories,L,p)||(r.currentEmojisWithCategories=L)},x=(L,Q)=>Q&&L.skins&&L.skins[Q]||L.unicode,b={labelWithSkin:(L,Q)=>e7([L.name||x(L,Q),L.annotation,...L.shortcodes||JE].filter(Boolean)).join(", "),titleForEmoji:L=>L.annotation||(L.shortcodes||JE).join(", "),unicodeWithSkin:x},E={onClickSkinToneButton:G,onEmojiClick:C,onNavClick:ue,onNavKeydown:q,onSearchKeydown:oe,onSkinToneOptionsClick:I,onSkinToneOptionsFocusOut:pe,onSkinToneOptionsKeydown:te,onSkinToneOptionsKeyup:ie,onSearchInput:xe},S={calculateEmojiGridStyle:T,updateOnIntersection:H},A=!0;a(()=>{g7(e,r,b,E,S,n,i,s,A),A=!1}),r.emojiVersion||XE().then(L=>{L||(r.message=r.i18n.emojiUnsupportedMessage)}),a(()=>{async function L(){let Q=!1,Z=setTimeout(()=>{Q=!0,r.message=r.i18n.loadingMessage},OV);try{await r.database.ready(),r.databaseLoaded=!0}catch(ae){console.error(ae),r.message=r.i18n.networkErrorMessage}finally{clearTimeout(Z),Q&&(Q=!1,r.message="")}}r.database&&L()}),a(()=>{r.pickerStyle=`
9
+ `).replace(XB,"")}function H4(e,t){return t=qL(t),qL(e)===t}function tn(e,t,n,o,i,r){switch(n){case"children":typeof o=="string"?t==="body"||t==="textarea"&&o===""||gd(e,o):(typeof o=="number"||typeof o=="bigint")&&t!=="body"&&gd(e,""+o);break;case"className":Cg(e,"class",o);break;case"tabIndex":Cg(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Cg(e,n,o);break;case"style":__(e,o,r);break;case"data":if(t!=="object"){Cg(e,"data",o);break}case"src":case"href":if(o===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(n);break}o=qg(""+o),e.setAttribute(n,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof r=="function"&&(n==="formAction"?(t!=="input"&&tn(e,t,"name",i.name,i,null),tn(e,t,"formEncType",i.formEncType,i,null),tn(e,t,"formMethod",i.formMethod,i,null),tn(e,t,"formTarget",i.formTarget,i,null)):(tn(e,t,"encType",i.encType,i,null),tn(e,t,"method",i.method,i,null),tn(e,t,"target",i.target,i,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(n);break}o=qg(""+o),e.setAttribute(n,o);break;case"onClick":o!=null&&(e.onclick=Ca);break;case"onScroll":o!=null&&St("scroll",e);break;case"onScrollEnd":o!=null&&St("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(ke(61));if(n=o.__html,n!=null){if(i.children!=null)throw Error(ke(60));e.innerHTML=n}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}n=qg(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(n,""+o):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":o===!0?e.setAttribute(n,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(n,o):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(n,o):e.removeAttribute(n);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(n):e.setAttribute(n,o);break;case"popover":St("beforetoggle",e),St("toggle",e),Ug(e,"popover",o);break;case"xlinkActuate":va(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":va(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":va(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":va(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":va(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":va(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":va(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":va(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":va(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Ug(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=TP.get(n)||n,Ug(e,n,o))}}function x1(e,t,n,o,i,r){switch(n){case"style":__(e,o,r);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(ke(61));if(n=o.__html,n!=null){if(i.children!=null)throw Error(ke(60));e.innerHTML=n}}break;case"children":typeof o=="string"?gd(e,o):(typeof o=="number"||typeof o=="bigint")&&gd(e,""+o);break;case"onScroll":o!=null&&St("scroll",e);break;case"onScrollEnd":o!=null&&St("scrollend",e);break;case"onClick":o!=null&&(e.onclick=Ca);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!S_.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),r=e[ti]||null,r=r!=null?r[n]:null,typeof r=="function"&&e.removeEventListener(t,r,i),typeof o=="function")){typeof r!="function"&&r!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,o,i);break e}n in e?e[n]=o:o===!0?e.setAttribute(n,""):Ug(e,n,o)}}}function wo(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":St("error",e),St("load",e);var o=!1,i=!1,r;for(r in n)if(n.hasOwnProperty(r)){var a=n[r];if(a!=null)switch(r){case"src":o=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(ke(137,t));default:tn(e,t,r,a,n,null)}}i&&tn(e,t,"srcSet",n.srcSet,n,null),o&&tn(e,t,"src",n.src,n,null);return;case"input":St("invalid",e);var s=r=a=i=null,l=null,c=null;for(o in n)if(n.hasOwnProperty(o)){var u=n[o];if(u!=null)switch(o){case"name":i=u;break;case"type":a=u;break;case"checked":l=u;break;case"defaultChecked":c=u;break;case"value":r=u;break;case"defaultValue":s=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(ke(137,t));break;default:tn(e,t,o,u,n,null)}}M_(e,r,s,l,c,a,i,!1);return;case"select":St("invalid",e),o=a=r=null;for(i in n)if(n.hasOwnProperty(i)&&(s=n[i],s!=null))switch(i){case"value":r=s;break;case"defaultValue":a=s;break;case"multiple":o=s;default:tn(e,t,i,s,n,null)}t=r,n=a,e.multiple=!!o,t!=null?sd(e,!!o,t,!1):n!=null&&sd(e,!!o,n,!0);return;case"textarea":St("invalid",e),r=i=o=null;for(a in n)if(n.hasOwnProperty(a)&&(s=n[a],s!=null))switch(a){case"value":o=s;break;case"defaultValue":i=s;break;case"children":r=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(ke(91));break;default:tn(e,t,a,s,n,null)}L_(e,o,i,r);return;case"option":for(l in n)n.hasOwnProperty(l)&&(o=n[l],o!=null)&&(l==="selected"?e.selected=o&&typeof o!="function"&&typeof o!="symbol":tn(e,t,l,o,n,null));return;case"dialog":St("beforetoggle",e),St("toggle",e),St("cancel",e),St("close",e);break;case"iframe":case"object":St("load",e);break;case"video":case"audio":for(o=0;o<Pp.length;o++)St(Pp[o],e);break;case"image":St("error",e),St("load",e);break;case"details":St("toggle",e);break;case"embed":case"source":case"link":St("error",e),St("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(o=n[c],o!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(ke(137,t));default:tn(e,t,c,o,n,null)}return;default:if(O1(t)){for(u in n)n.hasOwnProperty(u)&&(o=n[u],o!==void 0&&x1(e,t,u,o,n,void 0));return}}for(s in n)n.hasOwnProperty(s)&&(o=n[s],o!=null&&tn(e,t,s,o,n,null))}function WB(e,t,n,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,r=null,a=null,s=null,l=null,c=null,u=null;for(g in n){var d=n[g];if(n.hasOwnProperty(g)&&d!=null)switch(g){case"checked":break;case"value":break;case"defaultValue":l=d;default:o.hasOwnProperty(g)||tn(e,t,g,null,o,d)}}for(var p in o){var g=o[p];if(d=n[p],o.hasOwnProperty(p)&&(g!=null||d!=null))switch(p){case"type":r=g;break;case"name":i=g;break;case"checked":c=g;break;case"defaultChecked":u=g;break;case"value":a=g;break;case"defaultValue":s=g;break;case"children":case"dangerouslySetInnerHTML":if(g!=null)throw Error(ke(137,t));break;default:g!==d&&tn(e,t,p,g,o,d)}}Kw(e,a,s,l,c,u,r,i);return;case"select":g=a=s=p=null;for(r in n)if(l=n[r],n.hasOwnProperty(r)&&l!=null)switch(r){case"value":break;case"multiple":g=l;default:o.hasOwnProperty(r)||tn(e,t,r,null,o,l)}for(i in o)if(r=o[i],l=n[i],o.hasOwnProperty(i)&&(r!=null||l!=null))switch(i){case"value":p=r;break;case"defaultValue":s=r;break;case"multiple":a=r;default:r!==l&&tn(e,t,i,r,o,l)}t=s,n=a,o=g,p!=null?sd(e,!!n,p,!1):!!o!=!!n&&(t!=null?sd(e,!!n,t,!0):sd(e,!!n,n?[]:"",!1));return;case"textarea":g=p=null;for(s in n)if(i=n[s],n.hasOwnProperty(s)&&i!=null&&!o.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:tn(e,t,s,null,o,i)}for(a in o)if(i=o[a],r=n[a],o.hasOwnProperty(a)&&(i!=null||r!=null))switch(a){case"value":p=i;break;case"defaultValue":g=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(ke(91));break;default:i!==r&&tn(e,t,a,i,o,r)}C_(e,p,g);return;case"option":for(var y in n)p=n[y],n.hasOwnProperty(y)&&p!=null&&!o.hasOwnProperty(y)&&(y==="selected"?e.selected=!1:tn(e,t,y,null,o,p));for(l in o)p=o[l],g=n[l],o.hasOwnProperty(l)&&p!==g&&(p!=null||g!=null)&&(l==="selected"?e.selected=p&&typeof p!="function"&&typeof p!="symbol":tn(e,t,l,p,o,g));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!o.hasOwnProperty(v)&&tn(e,t,v,null,o,p);for(c in o)if(p=o[c],g=n[c],o.hasOwnProperty(c)&&p!==g&&(p!=null||g!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(ke(137,t));break;default:tn(e,t,c,p,o,g)}return;default:if(O1(t)){for(var x in n)p=n[x],n.hasOwnProperty(x)&&p!==void 0&&!o.hasOwnProperty(x)&&x1(e,t,x,void 0,o,p);for(u in o)p=o[u],g=n[u],!o.hasOwnProperty(u)||p===g||p===void 0&&g===void 0||x1(e,t,u,p,o,g);return}}for(var h in n)p=n[h],n.hasOwnProperty(h)&&p!=null&&!o.hasOwnProperty(h)&&tn(e,t,h,null,o,p);for(d in o)p=o[d],g=n[d],!o.hasOwnProperty(d)||p===g||p==null&&g==null||tn(e,t,d,p,o,g)}function KL(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ZB(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),o=0;o<n.length;o++){var i=n[o],r=i.transferSize,a=i.initiatorType,s=i.duration;if(r&&s&&KL(a)){for(a=0,s=i.responseEnd,o+=1;o<n.length;o++){var l=n[o],c=l.startTime;if(c>s)break;var u=l.transferSize,d=l.initiatorType;u&&KL(d)&&(l=l.responseEnd,a+=u*(l<s?1:(s-c)/(l-c)))}if(--o,t+=8*(r+a)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var v1=null,w1=null;function Ah(e){return e.nodeType===9?e:e.ownerDocument}function IL(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function z4(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function E1(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Rw=null;function QB(){var e=window.event;return e&&e.type==="popstate"?e===Rw?!1:(Rw=e,!0):(Rw=null,!1)}var O4=typeof setTimeout=="function"?setTimeout:void 0,JB=typeof clearTimeout=="function"?clearTimeout:void 0,GL=typeof Promise=="function"?Promise:void 0,e9=typeof queueMicrotask=="function"?queueMicrotask:typeof GL<"u"?function(e){return GL.resolve(null).then(e).catch(t9)}:O4;function t9(e){setTimeout(function(){throw e})}function zs(e){return e==="head"}function FL(e,t){var n=t,o=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(o===0){e.removeChild(i),kd(t);return}o--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")o++;else if(n==="html")Lp(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Lp(n);for(var r=n.firstChild;r;){var a=r.nextSibling,s=r.nodeName;r[Yp]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&r.rel.toLowerCase()==="stylesheet"||n.removeChild(r),r=a}}else n==="body"&&Lp(e.ownerDocument.body);n=i}while(n);kd(t)}function YL(e,t){var n=e;e=0;do{var o=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=o}while(n)}function k1(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":k1(n),z1(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function n9(e,t,n,o){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[Yp])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=Zi(e.nextSibling),e===null)break}return null}function o9(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Zi(e.nextSibling),e===null))return null;return e}function $4(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Zi(e.nextSibling),e===null))return null;return e}function S1(e){return e.data==="$?"||e.data==="$~"}function T1(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function i9(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var o=function(){t(),n.removeEventListener("DOMContentLoaded",o)};n.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function Zi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var A1=null;function XL(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Zi(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function WL(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function N4(e,t,n){switch(t=Ah(n),e){case"html":if(e=t.documentElement,!e)throw Error(ke(452));return e;case"head":if(e=t.head,!e)throw Error(ke(453));return e;case"body":if(e=t.body,!e)throw Error(ke(454));return e;default:throw Error(ke(451))}}function Lp(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);z1(e)}var Qi=new Map,ZL=new Set;function Mh(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ja=qt.d;qt.d={f:r9,r:a9,D:s9,C:l9,L:c9,m:d9,X:p9,S:u9,M:f9};function r9(){var e=ja.f(),t=Kh();return e||t}function a9(e){var t=Td(e);t!==null&&t.tag===5&&t.type==="form"?_5(t):ja.r(e)}var Ld=typeof document>"u"?null:document;function j4(e,t,n){var o=Ld;if(o&&typeof t=="string"&&t){var i=Fi(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),ZL.has(i)||(ZL.add(i),e={rel:e,crossOrigin:n,href:t},o.querySelector(i)===null&&(t=o.createElement("link"),wo(t,"link",e),co(t),o.head.appendChild(t)))}}function s9(e){ja.D(e),j4("dns-prefetch",e,null)}function l9(e,t){ja.C(e,t),j4("preconnect",e,t)}function c9(e,t,n){ja.L(e,t,n);var o=Ld;if(o&&e&&t){var i='link[rel="preload"][as="'+Fi(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Fi(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Fi(n.imageSizes)+'"]')):i+='[href="'+Fi(e)+'"]';var r=i;switch(t){case"style":r=Ed(e);break;case"script":r=_d(e)}Qi.has(r)||(e=yn({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Qi.set(r,e),o.querySelector(i)!==null||t==="style"&&o.querySelector(ef(r))||t==="script"&&o.querySelector(tf(r))||(t=o.createElement("link"),wo(t,"link",e),co(t),o.head.appendChild(t)))}}function d9(e,t){ja.m(e,t);var n=Ld;if(n&&e){var o=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Fi(o)+'"][href="'+Fi(e)+'"]',r=i;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=_d(e)}if(!Qi.has(r)&&(e=yn({rel:"modulepreload",href:e},t),Qi.set(r,e),n.querySelector(i)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(tf(r)))return}o=n.createElement("link"),wo(o,"link",e),co(o),n.head.appendChild(o)}}}function u9(e,t,n){ja.S(e,t,n);var o=Ld;if(o&&e){var i=ad(o).hoistableStyles,r=Ed(e);t=t||"default";var a=i.get(r);if(!a){var s={loading:0,preload:null};if(a=o.querySelector(ef(r)))s.loading=5;else{e=yn({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Qi.get(r))&&xE(e,n);var l=a=o.createElement("link");co(l),wo(l,"link",e),l._p=new Promise(function(c,u){l.onload=c,l.onerror=u}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Jg(a,t,o)}a={type:"stylesheet",instance:a,count:1,state:s},i.set(r,a)}}}function p9(e,t){ja.X(e,t);var n=Ld;if(n&&e){var o=ad(n).hoistableScripts,i=_d(e),r=o.get(i);r||(r=n.querySelector(tf(i)),r||(e=yn({src:e,async:!0},t),(t=Qi.get(i))&&vE(e,t),r=n.createElement("script"),co(r),wo(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},o.set(i,r))}}function f9(e,t){ja.M(e,t);var n=Ld;if(n&&e){var o=ad(n).hoistableScripts,i=_d(e),r=o.get(i);r||(r=n.querySelector(tf(i)),r||(e=yn({src:e,async:!0,type:"module"},t),(t=Qi.get(i))&&vE(e,t),r=n.createElement("script"),co(r),wo(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},o.set(i,r))}}function QL(e,t,n,o){var i=(i=vs.current)?Mh(i):null;if(!i)throw Error(ke(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ed(n.href),n=ad(i).hoistableStyles,o=n.get(t),o||(o={type:"style",instance:null,count:0,state:null},n.set(t,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ed(n.href);var r=ad(i).hoistableStyles,a=r.get(e);if(a||(i=i.ownerDocument||i,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,a),(r=i.querySelector(ef(e)))&&!r._p&&(a.instance=r,a.state.loading=5),Qi.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Qi.set(e,n),r||m9(i,e,n,a.state))),t&&o===null)throw Error(ke(528,""));return a}if(t&&o!==null)throw Error(ke(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=_d(n),n=ad(i).hoistableScripts,o=n.get(t),o||(o={type:"script",instance:null,count:0,state:null},n.set(t,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(ke(444,e))}}function Ed(e){return'href="'+Fi(e)+'"'}function ef(e){return'link[rel="stylesheet"]['+e+"]"}function P4(e){return yn({},e,{"data-precedence":e.precedence,precedence:null})}function m9(e,t,n,o){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?o.loading=1:(t=e.createElement("link"),o.preload=t,t.addEventListener("load",function(){return o.loading|=1}),t.addEventListener("error",function(){return o.loading|=2}),wo(t,"link",n),co(t),e.head.appendChild(t))}function _d(e){return'[src="'+Fi(e)+'"]'}function tf(e){return"script[async]"+e}function JL(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+Fi(n.href)+'"]');if(o)return t.instance=o,co(o),o;var i=yn({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),co(o),wo(o,"style",i),Jg(o,n.precedence,e),t.instance=o;case"stylesheet":i=Ed(n.href);var r=e.querySelector(ef(i));if(r)return t.state.loading|=4,t.instance=r,co(r),r;o=P4(n),(i=Qi.get(i))&&xE(o,i),r=(e.ownerDocument||e).createElement("link"),co(r);var a=r;return a._p=new Promise(function(s,l){a.onload=s,a.onerror=l}),wo(r,"link",o),t.state.loading|=4,Jg(r,n.precedence,e),t.instance=r;case"script":return r=_d(n.src),(i=e.querySelector(tf(r)))?(t.instance=i,co(i),i):(o=n,(i=Qi.get(r))&&(o=yn({},n),vE(o,i)),e=e.ownerDocument||e,i=e.createElement("script"),co(i),wo(i,"link",o),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(ke(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(o=t.instance,t.state.loading|=4,Jg(o,n.precedence,e));return t.instance}function Jg(e,t,n){for(var o=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=o.length?o[o.length-1]:null,r=i,a=0;a<o.length;a++){var s=o[a];if(s.dataset.precedence===t)r=s;else if(r!==i)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function xE(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function vE(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var eh=null;function e_(e,t,n){if(eh===null){var o=new Map,i=eh=new Map;i.set(n,o)}else i=eh,o=i.get(n),o||(o=new Map,i.set(n,o));if(o.has(e))return o;for(o.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var r=n[i];if(!(r[Yp]||r[yo]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var a=r.getAttribute(t)||"";a=e+a;var s=o.get(a);s?s.push(r):o.set(a,[r])}}return o}function t_(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function g9(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function B4(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function h9(e,t,n,o){if(n.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=Ed(o.href),r=t.querySelector(ef(i));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ch.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=r,co(r);return}r=t.ownerDocument||t,o=P4(o),(i=Qi.get(i))&&xE(o,i),r=r.createElement("link"),co(r);var a=r;a._p=new Promise(function(s,l){a.onload=s,a.onerror=l}),wo(r,"link",o),n.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Ch.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Hw=0;function b9(e,t){return e.stylesheets&&e.count===0&&th(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var o=setTimeout(function(){if(e.stylesheets&&th(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&Hw===0&&(Hw=62500*ZB());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&th(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>Hw?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(i)}}:null}function Ch(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)th(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Lh=null;function th(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Lh=new Map,t.forEach(y9,e),Lh=null,Ch.call(e))}function y9(e,t){if(!(t.state.loading&4)){var n=Lh.get(e);if(n)var o=n.get(null);else{n=new Map,Lh.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<i.length;r++){var a=i[r];(a.nodeName==="LINK"||a.getAttribute("media")!=="not all")&&(n.set(a.dataset.precedence,a),o=a)}o&&n.set(null,o)}i=t.instance,a=i.getAttribute("data-precedence"),r=n.get(a)||o,r===o&&n.set(null,i),n.set(a,i),this.count++,o=Ch.bind(this),i.addEventListener("load",o),i.addEventListener("error",o),r?r.parentNode.insertBefore(i,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Vp={$$typeof:Ma,Provider:null,Consumer:null,_currentValue:xl,_currentValue2:xl,_threadCount:0};function x9(e,t,n,o,i,r,a,s,l){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=rw(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rw(0),this.hiddenUpdates=rw(null),this.identifierPrefix=o,this.onUncaughtError=i,this.onCaughtError=r,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function V4(e,t,n,o,i,r,a,s,l,c,u,d){return e=new x9(e,t,n,a,l,c,u,d,s),t=1,r===!0&&(t|=24),r=yi(3,null,null,t),e.current=r,r.stateNode=e,t=G1(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:o,isDehydrated:n,cache:t},X1(r),e}function U4(e){return e?(e=nd,e):nd}function q4(e,t,n,o,i,r){i=U4(i),o.context===null?o.context=i:o.pendingContext=i,o=Es(t),o.payload={element:n},r=r===void 0?null:r,r!==null&&(o.callback=r),n=ks(e,o,t),n!==null&&(ei(n,e,t),wp(n,e,t))}function n_(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function wE(e,t){n_(e,t),(e=e.alternate)&&n_(e,t)}function K4(e){if(e.tag===13||e.tag===31){var t=Rl(e,67108864);t!==null&&ei(t,e,67108864),wE(e,67108864)}}function o_(e){if(e.tag===13||e.tag===31){var t=ki();t=R1(t);var n=Rl(e,t);n!==null&&ei(n,e,t),wE(e,t)}}var _h=!0;function v9(e,t,n,o){var i=rt.T;rt.T=null;var r=qt.p;try{qt.p=2,EE(e,t,n,o)}finally{qt.p=r,rt.T=i}}function w9(e,t,n,o){var i=rt.T;rt.T=null;var r=qt.p;try{qt.p=8,EE(e,t,n,o)}finally{qt.p=r,rt.T=i}}function EE(e,t,n,o){if(_h){var i=M1(o);if(i===null)Dw(e,t,o,Dh,n),i_(e,o);else if(k9(i,e,t,n,o))o.stopPropagation();else if(i_(e,o),t&4&&-1<E9.indexOf(e)){for(;i!==null;){var r=Td(i);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var a=hl(r.pendingLanes);if(a!==0){var s=r;for(s.pendingLanes|=2,s.entangledLanes|=2;a;){var l=1<<31-Ei(a);s.entanglements[1]|=l,a&=~l}Ir(r),(Ut&6)===0&&(vh=vi()+500,Jp(0,!1))}}break;case 31:case 13:s=Rl(r,2),s!==null&&ei(s,r,2),Kh(),wE(r,2)}if(r=M1(o),r===null&&Dw(e,t,o,Dh,n),r===i)break;i=r}i!==null&&o.stopPropagation()}else Dw(e,t,o,null,n)}}function M1(e){return e=$1(e),kE(e)}var Dh=null;function kE(e){if(Dh=null,e=Wc(e),e!==null){var t=Kp(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=d_(t),e!==null)return e;e=null}else if(n===31){if(e=u_(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Dh=e,null}function I4(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(cP()){case g_:return 2;case h_:return 8;case ah:case dP:return 32;case b_:return 268435456;default:return 32}default:return 32}}var C1=!1,As=null,Ms=null,Cs=null,Up=new Map,qp=new Map,ms=[],E9="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function i_(e,t){switch(e){case"focusin":case"focusout":As=null;break;case"dragenter":case"dragleave":Ms=null;break;case"mouseover":case"mouseout":Cs=null;break;case"pointerover":case"pointerout":Up.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":qp.delete(t.pointerId)}}function dp(e,t,n,o,i,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:n,eventSystemFlags:o,nativeEvent:r,targetContainers:[i]},t!==null&&(t=Td(t),t!==null&&K4(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function k9(e,t,n,o,i){switch(t){case"focusin":return As=dp(As,e,t,n,o,i),!0;case"dragenter":return Ms=dp(Ms,e,t,n,o,i),!0;case"mouseover":return Cs=dp(Cs,e,t,n,o,i),!0;case"pointerover":var r=i.pointerId;return Up.set(r,dp(Up.get(r)||null,e,t,n,o,i)),!0;case"gotpointercapture":return r=i.pointerId,qp.set(r,dp(qp.get(r)||null,e,t,n,o,i)),!0}return!1}function G4(e){var t=Wc(e.target);if(t!==null){var n=Kp(t);if(n!==null){if(t=n.tag,t===13){if(t=d_(n),t!==null){e.blockedOn=t,VC(e.priority,function(){o_(n)});return}}else if(t===31){if(t=u_(n),t!==null){e.blockedOn=t,VC(e.priority,function(){o_(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function nh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=M1(e.nativeEvent);if(n===null){n=e.nativeEvent;var o=new n.constructor(n.type,n);Gw=o,n.target.dispatchEvent(o),Gw=null}else return t=Td(n),t!==null&&K4(t),e.blockedOn=n,!1;t.shift()}return!0}function r_(e,t,n){nh(e)&&n.delete(t)}function S9(){C1=!1,As!==null&&nh(As)&&(As=null),Ms!==null&&nh(Ms)&&(Ms=null),Cs!==null&&nh(Cs)&&(Cs=null),Up.forEach(r_),qp.forEach(r_)}function Bg(e,t){e.blockedOn===t&&(e.blockedOn=null,C1||(C1=!0,oo.unstable_scheduleCallback(oo.unstable_NormalPriority,S9)))}var Vg=null;function a_(e){Vg!==e&&(Vg=e,oo.unstable_scheduleCallback(oo.unstable_NormalPriority,function(){Vg===e&&(Vg=null);for(var t=0;t<e.length;t+=3){var n=e[t],o=e[t+1],i=e[t+2];if(typeof o!="function"){if(kE(o||n)===null)continue;break}var r=Td(n);r!==null&&(e.splice(t,3),t-=3,l1(r,{pending:!0,data:i,method:n.method,action:o},o,i))}}))}function kd(e){function t(l){return Bg(l,e)}As!==null&&Bg(As,e),Ms!==null&&Bg(Ms,e),Cs!==null&&Bg(Cs,e),Up.forEach(t),qp.forEach(t);for(var n=0;n<ms.length;n++){var o=ms[n];o.blockedOn===e&&(o.blockedOn=null)}for(;0<ms.length&&(n=ms[0],n.blockedOn===null);)G4(n),n.blockedOn===null&&ms.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(o=0;o<n.length;o+=3){var i=n[o],r=n[o+1],a=i[ti]||null;if(typeof r=="function")a||a_(n);else if(a){var s=null;if(r&&r.hasAttribute("formAction")){if(i=r,a=r[ti]||null)s=a.formAction;else if(kE(i)!==null)continue}else s=a.action;typeof s=="function"?n[o+1]=s:(n.splice(o,3),o-=3),a_(n)}}}function F4(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(a){return i=a})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),o||setTimeout(n,20)}function n(){if(!o&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function SE(e){this._internalRoot=e}Fh.prototype.render=SE.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ke(409));var n=t.current,o=ki();q4(n,o,e,t,null,null)};Fh.prototype.unmount=SE.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;q4(e.current,2,null,e,null,null),Kh(),t[Sd]=null}};function Fh(e){this._internalRoot=e}Fh.prototype.unstable_scheduleHydration=function(e){if(e){var t=E_();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ms.length&&t!==0&&t<ms[n].priority;n++);ms.splice(n,0,e),n===0&&G4(e)}};var s_=l_.version;if(s_!=="19.2.7")throw Error(ke(527,s_,"19.2.7"));qt.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ke(188)):(e=Object.keys(e).join(","),Error(ke(268,e)));return e=nP(t),e=e!==null?p_(e):null,e=e===null?null:e.stateNode,e};var T9={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:rt,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(up=__REACT_DEVTOOLS_GLOBAL_HOOK__,!up.isDisabled&&up.supportsFiber))try{Ip=up.inject(T9),wi=up}catch{}var up;Yh.createRoot=function(e,t){if(!c_(e))throw Error(ke(299));var n=!1,o="",i=j5,r=P5,a=B5;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=V4(e,1,!1,null,null,n,o,null,i,r,a,F4),e[Sd]=t.current,yE(e),new SE(t)};Yh.hydrateRoot=function(e,t,n){if(!c_(e))throw Error(ke(299));var o=!1,i="",r=j5,a=P5,s=B5,l=null;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(r=n.onUncaughtError),n.onCaughtError!==void 0&&(a=n.onCaughtError),n.onRecoverableError!==void 0&&(s=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),t=V4(e,1,!0,t,n??null,o,i,l,r,a,s,F4),t.context=U4(null),n=t.current,o=ki(),o=R1(o),i=Es(o),i.callback=null,ks(n,i,o),n=o,t.current.lanes=n,Fp(t,n),Ir(t),e[Sd]=t.current,yE(e),new Fh(t)};Yh.version="19.2.7"});var TE=Nr((cY,W4)=>{"use strict";function X4(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(X4)}catch(e){console.error(e)}}X4(),W4.exports=Y4()});function Dd(){return(Dd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function Wh(e,t){if(e==null)return{};var n,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)t.indexOf(n=r[o])>=0||(i[n]=e[n]);return i}function zl(e){var t=(0,at.useRef)(e),n=(0,at.useRef)(function(o){t.current&&t.current(o)});return t.current=e,n.current}function O9(e,t,n,o){var i=zl(n),r=zl(o),a=(0,at.useState)(function(){return e.toHsva(t)}),s=a[0],l=a[1],c=(0,at.useRef)({color:t,hsva:s}),u=(0,at.useRef)(!1);(0,at.useEffect)(function(){if(!e.equal(t,c.current.color)){var g=e.toHsva(t);c.current={hsva:g,color:t},l(g),u.current=!1}},[t,e]),(0,at.useEffect)(function(){var g;o6(s,c.current.hsva)||e.equal(g=e.fromHsva(s),c.current.color)||(c.current={hsva:s,color:g},i(g),u.current=!0)},[s,e,i]);var d=(0,at.useCallback)(function(g){l(function(y){return Object.assign({},y,g)})},[]),p=(0,at.useCallback)(function(){u.current&&(u.current=!1,r(c.current.color))},[r]);return[s,d,p]}var at,of,nf,AE,Z4,Q4,t6,LE,n6,oi,dY,A9,ME,M9,C9,CE,L9,Xh,_9,D9,R9,H9,o6,z9,$9,N9,j9,J4,P9,B9,V9,i6,U9,q9,e6,r6,a6=O(()=>{at=kt(Yt(),1);of=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},nf=function(e){return"touches"in e},AE=function(e){return e&&e.ownerDocument.defaultView||self},Z4=function(e,t,n){var o=e.getBoundingClientRect(),i=nf(t)?(function(r,a){for(var s=0;s<r.length;s++)if(r[s].identifier===a)return r[s];return r[0]})(t.touches,n):t;return{left:of((i.pageX-(o.left+AE(e).pageXOffset))/o.width),top:of((i.pageY-(o.top+AE(e).pageYOffset))/o.height)}},Q4=function(e){!nf(e)&&e.preventDefault()},t6=at.default.memo(function(e){var t=e.onMove,n=e.onKey,o=e.onEnd,i=Wh(e,["onMove","onKey","onEnd"]),r=(0,at.useRef)(null),a=zl(t),s=zl(n),l=zl(o),c=(0,at.useRef)(null),u=(0,at.useRef)(!1),d=(0,at.useMemo)(function(){var x=function(b){Q4(b),(nf(b)?b.touches.length>0:b.buttons>0)&&r.current?a(Z4(r.current,b,c.current)):(m(!1),l())},h=function(){m(!1),l()};function m(b){var E=u.current,S=AE(r.current),A=b?S.addEventListener:S.removeEventListener;A(E?"touchmove":"mousemove",x),A(E?"touchend":"mouseup",h)}return[function(b){var E=b.nativeEvent,S=r.current;if(S&&(Q4(E),!(function(_,T){return T&&!nf(_)})(E,u.current)&&S)){if(nf(E)){u.current=!0;var A=E.changedTouches||[];A.length&&(c.current=A[0].identifier)}S.focus(),a(Z4(S,E,c.current)),m(!0)}},function(b){var E=b.which||b.keyCode;E<37||E>40||(b.preventDefault(),s({left:E===39?.05:E===37?-.05:0,top:E===40?.05:E===38?-.05:0}))},function(b){var E=b.which||b.keyCode;E>=37&&E<=40&&l()},m]},[s,a,l]),p=d[0],g=d[1],y=d[2],v=d[3];return(0,at.useEffect)(function(){return v},[v]),at.default.createElement("div",Dd({},i,{onTouchStart:p,onMouseDown:p,className:"react-colorful__interactive",ref:r,onKeyDown:g,onKeyUp:y,tabIndex:0,role:"slider"}))}),LE=function(e){return e.filter(Boolean).join(" ")},n6=function(e){var t=e.color,n=e.left,o=e.top,i=o===void 0?.5:o,r=LE(["react-colorful__pointer",e.className]);return at.default.createElement("div",{className:r,style:{top:100*i+"%",left:100*n+"%"}},at.default.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},oi=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},dY={grad:.9,turn:360,rad:360/(2*Math.PI)},A9=function(e){return D9(ME(e))},ME=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?oi(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?oi(parseInt(e.substring(6,8),16)/255,2):1}},M9=function(e){return _9(L9(e))},C9=function(e){var t=e.s,n=e.v,o=e.a,i=(200-t)*n/100;return{h:oi(e.h),s:oi(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:oi(i/2),a:oi(o,2)}},CE=function(e){var t=C9(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},L9=function(e){var t=e.h,n=e.s,o=e.v,i=e.a;t=t/360*6,n/=100,o/=100;var r=Math.floor(t),a=o*(1-n),s=o*(1-(t-r)*n),l=o*(1-(1-t+r)*n),c=r%6;return{r:oi(255*[o,s,a,a,l,o][c]),g:oi(255*[l,o,o,s,a,a][c]),b:oi(255*[a,a,l,o,o,s][c]),a:oi(i,2)}},Xh=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},_9=function(e){var t=e.r,n=e.g,o=e.b,i=e.a,r=i<1?Xh(oi(255*i)):"";return"#"+Xh(t)+Xh(n)+Xh(o)+r},D9=function(e){var t=e.r,n=e.g,o=e.b,i=e.a,r=Math.max(t,n,o),a=r-Math.min(t,n,o),s=a?r===t?(n-o)/a:r===n?2+(o-t)/a:4+(t-n)/a:0;return{h:60*(s<0?s+6:s),s:r?a/r*100:0,v:r/255*100,a:i}},R9=at.default.memo(function(e){var t=e.hue,n=e.onChange,o=e.onChangeEnd,i=LE(["react-colorful__hue",e.className]);return at.default.createElement("div",{className:i},at.default.createElement(t6,{onMove:function(r){n({h:360*r.left})},onKey:function(r){n({h:of(t+360*r.left,0,360)})},onEnd:o,"aria-label":"Hue","aria-valuenow":oi(t),"aria-valuemax":"360","aria-valuemin":"0"},at.default.createElement(n6,{className:"react-colorful__hue-pointer",left:t/360,color:CE({h:t,s:100,v:100,a:1})})))}),H9=at.default.memo(function(e){var t=e.hsva,n=e.onChange,o=e.onChangeEnd,i={backgroundColor:CE({h:t.h,s:100,v:100,a:1})};return at.default.createElement("div",{className:"react-colorful__saturation",style:i},at.default.createElement(t6,{onMove:function(r){n({s:100*r.left,v:100-100*r.top})},onKey:function(r){n({s:of(t.s+100*r.left,0,100),v:of(t.v-100*r.top,0,100)})},onEnd:o,"aria-label":"Color","aria-valuetext":"Saturation "+oi(t.s)+"%, Brightness "+oi(t.v)+"%"},at.default.createElement(n6,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:CE(t)})))}),o6=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},z9=function(e,t){return e.toLowerCase()===t.toLowerCase()||o6(ME(e),ME(t))};N9=typeof window<"u"?at.useLayoutEffect:at.useEffect,j9=function(){return $9||(typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0)},J4=new WeakMap,P9=function(e){N9(function(){var t=e.current;if(typeof document<"u"&&t){var n=t.getRootNode?t.getRootNode():t.ownerDocument,o=n&&("head"in n||"host"in n)?n:t.ownerDocument;if(!J4.has(o)){var i="head"in o?o.head:o,r=(i.ownerDocument||document).createElement("style");r.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`;var a=j9();a&&r.setAttribute("nonce",a),J4.set(o,r),i.appendChild(r)}}},[])},B9=function(e){var t=e.className,n=e.colorModel,o=e.color,i=o===void 0?n.defaultColor:o,r=e.onChange,a=e.onChangeEnd,s=Wh(e,["className","colorModel","color","onChange","onChangeEnd"]),l=(0,at.useRef)(null);P9(l);var c=O9(n,i,r,a),u=c[0],d=c[1],p=c[2],g=LE(["react-colorful",t]);return at.default.createElement("div",Dd({},s,{ref:l,className:g}),at.default.createElement(H9,{hsva:u,onChange:d,onChangeEnd:p}),at.default.createElement(R9,{hue:u.h,onChange:d,onChangeEnd:p,className:"react-colorful__last-control"}))},V9={defaultColor:"000",toHsva:A9,fromHsva:function(e){return M9({h:e.h,s:e.s,v:e.v,a:1})},equal:z9},i6=function(e){return at.default.createElement(B9,Dd({},e,{colorModel:V9}))},U9=/^#?([0-9A-F]{3,8})$/i,q9=function(e){var t=e.color,n=t===void 0?"":t,o=e.onChange,i=e.onBlur,r=e.escape,a=e.validate,s=e.format,l=e.process,c=Wh(e,["color","onChange","onBlur","escape","validate","format","process"]),u=(0,at.useState)(function(){return r(n)}),d=u[0],p=u[1],g=zl(o),y=zl(i),v=(0,at.useCallback)(function(h){var m=r(h.target.value);p(m),a(m)&&g(l?l(m):m)},[r,l,a,g]),x=(0,at.useCallback)(function(h){a(h.target.value)||p(r(n)),y(h)},[n,r,a,y]);return(0,at.useEffect)(function(){p(r(n))},[n,r]),at.default.createElement("input",Dd({},c,{value:s?s(d):d,spellCheck:"false",onChange:v,onBlur:x}))},e6=function(e){return"#"+e},r6=function(e){var t=e.prefixed,n=e.alpha,o=Wh(e,["prefixed","alpha"]),i=(0,at.useCallback)(function(a){return a.replace(/([^0-9A-F]+)/gi,"").substring(0,n?8:6)},[n]),r=(0,at.useCallback)(function(a){return(function(s,l){var c=U9.exec(s),u=c?c[1].length:0;return u===3||u===6||!!l&&u===4||!!l&&u===8})(a,n)},[n]);return at.default.createElement(q9,Dd({},o,{escape:i,format:t?e6:void 0,process:e6,validate:r}))}});var c6={};Ft(c6,{accentPicker:()=>I9});function K9({initial:e,onChange:t}){let[n,o]=(0,Gr.useState)(e),[i,r]=(0,Gr.useState)(!1),a=(0,Gr.useRef)(null),s=(0,Gr.useRef)(null),l=!s6.some(([,u])=>u===n),c=u=>{if(!/^#[0-9a-f]{6}$/i.test(u))return;let d=u.toLowerCase();o(d),t(d)};return(0,Gr.useLayoutEffect)(()=>{let u=a.current;if(!u)return;if(!i){let p=window.setTimeout(()=>u.hidePopover(),150);return()=>clearTimeout(p)}u.showPopover();let d=()=>{let p=s.current.getBoundingClientRect();u.style.left=`${Math.max(8,Math.min(p.right-u.offsetWidth,innerWidth-u.offsetWidth-8))}px`,u.style.top=`${Math.max(8,p.top-u.offsetHeight-8)}px`};return d(),u.querySelector('[role="slider"]')?.focus({preventScroll:!0}),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[i]),(0,Gr.useEffect)(()=>{if(!i)return;let u=p=>{!p.composedPath().includes(a.current)&&!p.composedPath().includes(s.current)&&r(!1)},d=new AbortController;return jr(s.current,"pointerdown",u,{signal:d.signal}),()=>d.abort()},[i]),(0,To.jsxs)("div",{className:"account-accent",children:[(0,To.jsx)("span",{className:"account-accent-label",children:"Accent color"}),(0,To.jsxs)("div",{className:"accent-swatches",role:"group","aria-label":"Accent color",children:[s6.map(([u,d])=>(0,To.jsx)("button",{type:"button",className:"accent-swatch","aria-label":u,title:u,"aria-pressed":n===d,style:{"--swatch":d},onClick:()=>{c(d),r(!1)}},u)),(0,To.jsx)("button",{ref:s,type:"button",className:"accent-swatch accent-custom","aria-label":"Custom accent color","aria-haspopup":"dialog","aria-expanded":i,"aria-pressed":l,onClick:()=>r(!i),children:(0,To.jsx)(Zu,{"aria-hidden":"true"})})]}),(0,To.jsxs)("div",{ref:a,popover:"manual",role:"dialog","aria-label":"Custom accent color",className:i?"accent-popover t-dropdown is-open":"accent-popover t-dropdown is-closing",onKeyDown:u=>{u.stopPropagation(),u.key==="Escape"&&(u.preventDefault(),r(!1),s.current?.focus())},children:[(0,To.jsxs)("div",{className:"accent-popover-head",children:[(0,To.jsx)("span",{children:"Color"}),(0,To.jsx)("span",{children:n})]}),(0,To.jsxs)("div",{className:"accent-picker-body",children:[(0,To.jsx)(i6,{color:n,onChange:c}),(0,To.jsx)(r6,{"aria-label":"Hex accent color",className:"accent-hex",color:n,onChange:c,prefixed:!0})]})]})]})}function I9(e,t){let n=w("div","account-accent-mount"),o=(0,l6.createRoot)(n);return o.render((0,To.jsx)(K9,{initial:e,onChange:t})),{element:n,destroy:()=>o.unmount()}}var Gr,l6,To,s6,d6=O(()=>{"use strict";Gr=kt(Yt(),1),l6=kt(TE(),1);a6();Tv();It();To=kt(ya(),1),s6=[["Lavender","#c8b5f4"],["Blue","#85b5ff"],["Mint","#84d9bb"],["Yellow","#f4d779"],["Peach","#f5af87"],["Pink","#efa5c6"]]});function k6(e,t){return{width:Math.min(e,e>250?280:200),height:t>52?32:28}}function S6(e,t,n,o){return{left:e-n/2,top:t-o,width:n,height:o}}var Ol,eb,tb,DE,RE,HE,E6,zE=O(()=>{"use strict";Ol={type:"spring",duration:.4,bounce:.24},eb={duration:.1,ease:[.4,0,.2,1]},tb={duration:.25,ease:[.22,1,.36,1]},DE={type:"spring",duration:.4,bounce:.3},RE={type:"spring",duration:.12,bounce:.3},HE=.2,E6=.02});function nb(e){if(typeof e!="string"||!e)throw new Error("expected a non-empty string, got: "+e)}function jE(e){if(typeof e!="number")throw new Error("expected a number, got: "+e)}function nV(e,t){let n=new Set,o=[];for(let i of e){let r=t(i);n.has(r)||(n.add(r),o.push(i))}return o}function C6(e){return nV(e,t=>t.unicode)}function oV(e){function t(n,o,i){let r=o?e.createObjectStore(n,{keyPath:o}):e.createObjectStore(n);if(i)for(let[a,[s,l]]of Object.entries(i))r.createIndex(a,s,{multiEntry:l});return r}t(Hd),t(Nl,W9,{[_6]:[X9,!0],[R6]:[[Z9,Q9]],[H6]:[J9,!0]}),t(UE,void 0,{[D6]:[""]})}function z6(e,t,n){n.onerror=()=>t(n.error),n.onblocked=()=>t(new Error("IDB blocked")),n.onsuccess=()=>e(n.result)}async function iV(e){let t=await new Promise((n,o)=>{let i=indexedDB.open(e,F9);BE[e]=i,i.onupgradeneeded=r=>{r.oldVersion<Y9&&oV(i.result)},z6(n,o,i)});return t.onclose=()=>KE(e),t}function rV(e){return ib[e]||(ib[e]=iV(e)),ib[e]}function Ba(e,t,n,o){return new Promise((i,r)=>{let a=e.transaction(t,n,{durability:"relaxed"}),s=typeof t=="string"?a.objectStore(t):t.map(c=>a.objectStore(c)),l;o(s,a,c=>{l=c}),a.oncomplete=()=>i(l),a.onerror=()=>r(a.error)})}function KE(e){let t=BE[e],n=t&&t.result;if(n){n.close();let o=ab[e];if(o)for(let i of o)i()}delete BE[e],delete ib[e],delete ab[e]}function aV(e){return new Promise((t,n)=>{KE(e);let o=indexedDB.deleteDatabase(e);z6(t,n,o)})}function sV(e,t){let n=ab[e];n||(n=ab[e]=[]),n.push(t)}function Rd(e){return e.split(/[\s_]+/).map(t=>!t.match(/\w/)||lV.has(t)?t.toLowerCase():t.replace(/[)(:,]/g,"").replace(/’/g,"'").toLowerCase()).filter(Boolean)}function O6(e){return e.filter(Boolean).map(t=>t.toLowerCase()).filter(t=>t.length>=cV)}function dV(e){return e.map(({annotation:n,emoticon:o,group:i,order:r,shortcodes:a,skins:s,tags:l,emoji:c,version:u})=>{let d=[...new Set(O6([...(a||[]).map(Rd).flat(),...(l||[]).map(Rd).flat(),...Rd(n),o]))].sort(),p={annotation:n,group:i,order:r,tags:l,tokens:d,unicode:c,version:u};if(o&&(p.emoticon=o),a&&(p.shortcodes=a),s){p.skinTones=[],p.skinUnicodes=[],p.skinVersions=[];for(let{tone:g,emoji:y,version:v}of s)p.skinTones.push(g),p.skinUnicodes.push(y),p.skinVersions.push(v)}return p})}function $6(e,t,n,o){e[t](n).onsuccess=i=>o&&o(i.target.result)}function $l(e,t,n){$6(e,"get",t,n)}function N6(e,t,n){$6(e,"getAll",t,n)}function IE(e){e.commit&&e.commit()}function uV(e,t){let n=e[0];for(let o=1;o<e.length;o++){let i=e[o];t(n)>t(i)&&(n=i)}return n}function j6(e,t){let n=uV(e,i=>i.length),o=[];for(let i of n)e.some(r=>r.findIndex(a=>t(a)===t(i))===-1)||o.push(i);return o}async function pV(e){return!await GE(e,Hd,rb)}async function fV(e,t,n){let[o,i]=await Promise.all([PE,rb].map(r=>GE(e,Hd,r)));return o===n&&i===t}async function mV(e,t){return Ba(e,Nl,zd,(o,i,r)=>{let a,s=()=>{o.getAll(a&&IDBKeyRange.lowerBound(a,!0),50).onsuccess=l=>{let c=l.target.result;for(let u of c)if(a=u.unicode,t(u))return r(u);if(c.length<50)return r();s()}};s()})}async function P6(e,t,n,o){{let i=dV(t);await Ba(e,[Nl,Hd],qE,([r,a],s)=>{let l,c,u=0;function d(){++u===2&&p()}function p(){if(!(l===o&&c===n)){r.clear();for(let g of i)r.put(g);a.put(o,PE),a.put(n,rb),IE(s)}}$l(a,PE,g=>{l=g,d()}),$l(a,rb,g=>{c=g,d()})})}}async function gV(e,t){return Ba(e,Nl,zd,(n,o,i)=>{let r=IDBKeyRange.bound([t,0],[t+1,0],!1,!0);N6(n.index(R6),r,i)})}async function B6(e,t){let n=O6(Rd(t));return n.length?Ba(e,Nl,zd,(o,i,r)=>{let a=[],s=()=>{a.length===n.length&&l()},l=()=>{let c=j6(a,u=>u.unicode);r(c.sort((u,d)=>u.order<d.order?-1:1))};for(let c=0;c<n.length;c++){let u=n[c],d=c===n.length-1?IDBKeyRange.bound(u,u+"\uFFFF",!1,!0):IDBKeyRange.only(u);N6(o.index(_6),d,p=>{a.push(p),s()})}}):[]}async function hV(e,t){let n=await B6(e,t);return n.length?n.filter(o=>(o.shortcodes||[]).map(r=>r.toLowerCase()).includes(t.toLowerCase()))[0]||null:await mV(e,i=>(i.shortcodes||[]).includes(t.toLowerCase()))||null}async function bV(e,t){return Ba(e,Nl,zd,(n,o,i)=>$l(n,t,r=>{if(r)return i(r);$l(n.index(H6),t,a=>i(a||null))}))}function GE(e,t,n){return Ba(e,t,zd,(o,i,r)=>$l(o,n,r))}function yV(e,t,n,o){return Ba(e,t,qE,(i,r)=>{i.put(o,n),IE(r)})}function xV(e,t){return Ba(e,UE,qE,(n,o)=>$l(n,t,i=>{n.put((i||0)+1,t),IE(o)}))}function vV(e,t,n){return n===0?[]:Ba(e,[UE,Nl],zd,([o,i],r,a)=>{let s=[];o.index(D6).openCursor(void 0,"prev").onsuccess=l=>{let c=l.target.result;if(!c)return a(s);function u(g){if(s.push(g),s.length===n)return a(s);c.continue()}let d=c.primaryKey,p=t.byName(d);if(p)return u(p);$l(i,d,g=>{if(g)return u(g);c.continue()})}})}function wV(e,t){let n=new Map;for(let i of e){let r=t(i);for(let a of r){let s=n;for(let c=0;c<a.length;c++){let u=a.charAt(c),d=s.get(u);d||(d=new Map,s.set(u,d)),s=d}let l=s.get(ob);l||(l=[],s.set(ob,l)),l.push(i)}}return(i,r)=>{let a=n;for(let c=0;c<i.length;c++){let u=i.charAt(c),d=a.get(u);if(d)a=d;else return[]}if(r)return a.get(ob)||[];let s=[],l=[a];for(;l.length;){let u=[...l.shift().entries()].sort((d,p)=>d[0]<p[0]?-1:1);for(let[d,p]of u)d===ob?s.push(...p):l.push(p)}return s}}function kV(e){let t=e&&Array.isArray(e),n=t&&e.length&&(!e[0]||EV.some(o=>!(o in e[0])));if(!t||n)throw new Error("Custom emojis are in the wrong format")}function L6(e){kV(e);let t=(p,g)=>p.name.toLowerCase()<g.name.toLowerCase()?-1:1,n=e.sort(t),i=wV(e,p=>{let g=new Set;if(p.shortcodes)for(let y of p.shortcodes)for(let v of Rd(y))g.add(v);return g}),r=p=>i(p,!0),a=p=>i(p,!1),s=p=>{let g=Rd(p),y=g.map((v,x)=>(x<g.length-1?r:a)(v));return j6(y,v=>v.name).sort(t)},l=new Map,c=new Map;for(let p of e){c.set(p.name.toLowerCase(),p);for(let g of p.shortcodes||[])l.set(g.toLowerCase(),p)}return{all:n,search:s,byShortcode:p=>l.get(p.toLowerCase()),byName:p=>c.get(p.toLowerCase())}}function sf(e){if(!e)return e;if(SV&&(e=structuredClone(e)),delete e.tokens,e.skinTones){let t=e.skinTones.length;e.skins=Array(t);for(let n=0;n<t;n++)e.skins[n]={tone:e.skinTones[n],unicode:e.skinUnicodes[n],version:e.skinVersions[n]};delete e.skinTones,delete e.skinUnicodes,delete e.skinVersions}return e}function V6(e){e||console.warn("emoji-picker-element is more efficient if the dataSource server exposes an ETag header.")}function AV(e){if(!e||!Array.isArray(e)||!e[0]||typeof e[0]!="object"||TV.some(t=>!(t in e[0])))throw new Error("Emoji data is in the wrong format")}function U6(e,t){if(Math.floor(e.status/100)!==2)throw new Error("Failed to fetch: "+t+": "+e.status)}async function MV(e){let t=await fetch(e,{method:"HEAD"});U6(t,e);let n=t.headers.get("etag");return V6(n),n}async function VE(e){let t=await fetch(e);U6(t,e);let n=t.headers.get("etag");V6(n);let o=await t.json();return AV(o),[n,o]}function CV(e){for(var t="",n=new Uint8Array(e),o=n.byteLength,i=-1;++i<o;)t+=String.fromCharCode(n[i]);return t}function LV(e){for(var t=e.length,n=new ArrayBuffer(t),o=new Uint8Array(n),i=-1;++i<t;)o[i]=e.charCodeAt(i);return n}async function q6(e){let t=JSON.stringify(e),n=LV(t),o=await crypto.subtle.digest("SHA-1",n),i=CV(o);return btoa(i)}async function _V(e,t){let n,o=await MV(t);if(!o){let i=await VE(t);o=i[0],n=i[1],o||(o=await q6(n))}await fV(e,t,o)||(n||(n=(await VE(t))[1]),await P6(e,n,t,o))}async function DV(e,t){let[n,o]=await VE(t);n||(n=await q6(o)),await P6(e,o,t,n)}async function RV(e,t){try{await _V(e,t)}catch(n){if(n.name!=="InvalidStateError")throw n}}var F9,Y9,Nl,Hd,UE,X9,_6,W9,D6,Z9,Q9,R6,PE,rb,M6,zd,qE,H6,J9,eV,tV,BE,ib,ab,lV,cV,ob,EV,SV,TV,sb,K6=O(()=>{F9=1,Y9=1,Nl="emoji",Hd="keyvalue",UE="favorites",X9="tokens",_6="tokens",W9="unicode",D6="count",Z9="group",Q9="order",R6="group-order",PE="eTag",rb="url",M6="skinTone",zd="readonly",qE="readwrite",H6="skinUnicodes",J9="skinUnicodes",eV="https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json",tV="en";BE={},ib={},ab={};lV=new Set([":D","XD",":'D","O:)",":X",":P",";P","XP",":L",":Z",":j","8D","XO","8)",":B",":O",":S",":'o","Dx","X(","D:",":C",">0)",":3","</3","<3","\\M/",":E","8#"]);cV=2;ob="";EV=["name","url"];SV=typeof wrappedJSObject<"u";TV=["annotation","emoji","group","order","version"];sb=class{constructor({dataSource:t=eV,locale:n=tV,customEmoji:o=[]}={}){this.dataSource=t,this.locale=n,this._dbName=`emoji-picker-element-${this.locale}`,this._db=void 0,this._lazyUpdate=void 0,this._custom=L6(o),this._clear=this._clear.bind(this),this._ready=this._init()}async _init(){let t=this._db=await rV(this._dbName);sV(this._dbName,this._clear);let n=this.dataSource;await pV(t)?await DV(t,n):this._lazyUpdate=RV(t,n)}async ready(){let t=async()=>(this._ready||(this._ready=this._init()),this._ready);await t(),this._db||await t()}async getEmojiByGroup(t){return jE(t),await this.ready(),C6(await gV(this._db,t)).map(sf)}async getEmojiBySearchQuery(t){nb(t),await this.ready();let n=this._custom.search(t),o=C6(await B6(this._db,t)).map(sf);return[...n,...o]}async getEmojiByShortcode(t){nb(t),await this.ready();let n=this._custom.byShortcode(t);return n||sf(await hV(this._db,t))}async getEmojiByUnicodeOrName(t){nb(t),await this.ready();let n=this._custom.byName(t);return n||sf(await bV(this._db,t))}async getPreferredSkinTone(){return await this.ready(),await GE(this._db,Hd,M6)||0}async setPreferredSkinTone(t){return jE(t),await this.ready(),yV(this._db,Hd,M6,t)}async incrementFavoriteEmojiCount(t){return nb(t),await this.ready(),xV(this._db,t)}async getTopFavoriteEmoji(t){return jE(t),await this.ready(),(await vV(this._db,this._custom,t)).map(sf)}set customEmoji(t){this._custom=L6(t)}get customEmoji(){return this._custom.all}async _shutdown(){await this.ready();try{await this._lazyUpdate}catch{}}_clear(){this._db=this._ready=this._lazyUpdate=void 0}async close(){await this._shutdown(),await KE(this._dbName)}async delete(){await this._shutdown(),await aV(this._dbName)}}});var iD={};Ft(iD,{default:()=>Od,rescueElementPrototype:()=>nk});function G6(e){return e.unicode.includes("\u200D")}function VV(e){let t=F6(e,"#000"),n=F6(e,"#fff");return t&&n&&BV(t,n)}function UV(){let e=Object.entries(zV);try{for(let[t,n]of e)if(VV(t))return n}catch{}return e[0][1]}function YV(e,t){if(t===0)return e;let n=e.indexOf(IV);return n!==-1?e.substring(0,n)+String.fromCodePoint(GV+t-1)+e.substring(n):(e.endsWith(qV)&&(e=e.substring(0,e.length-1)),e+KV+String.fromCodePoint(FV+t-1))}function Fr(e){e.preventDefault(),e.stopPropagation()}function WE(e,t,n){return t+=e?-1:1,t<0?t=n.length-1:t>=n.length&&(t=0),t}function tD(e,t){let n=new Set,o=[];for(let i of e){let r=t(i);n.has(r)||(n.add(r),o.push(i))}return o}function XV(e,t){let n=o=>{let i={};for(let r of o)typeof r.tone=="number"&&r.version<=t&&(i[r.tone]=r.unicode);return i};return e.map(({unicode:o,skins:i,shortcodes:r,url:a,name:s,category:l,annotation:c})=>({unicode:o,name:s,shortcodes:r,url:a,category:l,annotation:c,id:o||s,skins:i&&n(i)}))}function ZV(e,t,n){let o;WV?(o=new ResizeObserver(n),o.observe(e)):cb(n),t.addEventListener("abort",()=>{o&&o.disconnect()})}function Y6(e){{let t=document.createRange();return t.selectNode(e.firstChild),t.getBoundingClientRect().width}}function X6(e,t,n){let o=Y6(t);if(!o){if(!jl){jl=n.cloneNode(!0);let i=getComputedStyle(n);for(let r of["font-family","line-height","width","height","font-size","display","align-items","justify-content"])jl.style.setProperty(r,i.getPropertyValue(r),"important")}try{return document.body.appendChild(jl),jl.firstChild.nodeValue=e,Y6(jl)}finally{jl.remove()}}return o}function JV(e,t,n){let o=!0;for(let i of e){let r=n(i);if(!r)continue;typeof ZE>"u"&&(ZE=X6(QV,t,t));let s=X6(i.unicode,r,t)/1.8<ZE;tk.set(i.unicode,s),s||(o=!1)}return o}function e7(e){return tD(e,t=>t)}function t7(e){e&&(e.scrollTop=0)}function lf(e,t,n){let o=e.get(t);return o||(o=n(),e.set(t,o)),o}function W6(e){return""+e}function n7(e){let t=document.createElement("template");return t.innerHTML=e,t}function s7(e,t){a7?e.replaceChildren(...t):(e.innerHTML="",e.append(...t))}function l7(e,t){let n=e.firstChild,o=0;for(;n;){if(t[o]!==n)return!0;n=n.nextSibling,o++}return o!==t.length}function c7(e,t){let{targetNode:n}=t,{targetParentNode:o}=t,i=!1;o?i=l7(o,e):(i=!0,t.targetNode=void 0,t.targetParentNode=o=n.parentNode),i&&s7(o,e)}function d7(e,t){for(let n of t){let{targetNode:o,currentExpression:i,binding:{expressionIndex:r,attributeName:a,attributeValuePre:s,attributeValuePost:l}}=n,c=e[r];if(i!==c)if(n.currentExpression=c,a)if(c===null)o.removeAttribute(a);else{let u=s+W6(c)+l;o.setAttribute(a,u)}else{let u;Array.isArray(c)?c7(c,n):c instanceof Element?(u=c,o.replaceWith(u)):o.nodeValue=W6(c),u&&(n.targetNode=u)}}}function u7(e){let t="",n=!1,o=!1,i=-1,r=new Map,a=[],s=0;for(let c=0,u=e.length;c<u;c++){let d=e[c];if(t+=d.slice(s),c===u-1)break;for(let m=0;m<d.length;m++)switch(d.charAt(m)){case"<":{d.charAt(m+1)==="/"?a.pop():(n=!0,a.push(++i));break}case">":{n=!1,o=!1;break}case"=":{o=!0;break}}let p=a[a.length-1],g=lf(r,p,()=>[]),y,v,x;if(o){let m=/(\S+)="?([^"=]*)$/.exec(d);y=m[1],v=m[2];let b=/^([^">]*)("?)/.exec(e[c+1]);x=b[1],t=t.slice(0,-1*m[0].length),s=b[0].length}else s=0;let h={attributeName:y,attributeValuePre:v,attributeValuePost:x,expressionIndex:c};g.push(h),!n&&!o&&(t+=" ")}return{template:n7(t),elementsToBindings:r}}function Z6(e,t,n){for(let o=0;o<e.length;o++){let i=e[o],r=i.attributeName?t:t.firstChild,a={binding:i,targetNode:r,targetParentNode:void 0,currentExpression:void 0};n.push(a)}}function p7(e,t){let n=[],o;if(t.size===1&&(o=t.get(0)))Z6(o,e,n);else{let i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r=e,a=-1;do{let s=t.get(++a);s&&Z6(s,r,n)}while(r=i.nextNode())}return n}function f7(e){let{template:t,elementsToBindings:n}=lf(o7,e,()=>u7(e)),o=t.cloneNode(!0).content.firstElementChild,i=p7(o,n);return function(a){return d7(a,i),o}}function m7(e){let t=lf(i7,e,()=>new Map),n=r7;function o(r,...a){let s=lf(t,r,()=>new Map);return lf(s,n,()=>f7(r))(a)}function i(r,a,s){return r.map((l,c)=>{let u=n;n=s(l);try{return a(l,c)}finally{n=u}})}return{map:i,html:o}}function g7(e,t,n,o,i,r,a,s,l){let{labelWithSkin:c,titleForEmoji:u,unicodeWithSkin:d}=n,{html:p,map:g}=m7(t);function y(m,b,E){return g(m,(S,A)=>p`<button role="${b?"option":"menuitem"}" aria-selected="${b?A===t.activeSearchItem:null}" aria-label="${c(S,t.currentSkinTone)}" title="${u(S)}" class="${"emoji"+(b&&A===t.activeSearchItem?" active":"")+(S.unicode?"":" custom-emoji")}" id="${`${E}-${S.id}`}" style="${S.unicode?null:`--custom-emoji-background: url(${JSON.stringify(S.url)})`}">${S.unicode?d(S,t.currentSkinTone):""}</button>`,S=>`${E}-${S.id}`)}let x=p`<section data-ref="rootElement" class="picker" aria-label="${t.i18n.regionLabel}" style="${t.pickerStyle||""}"><div class="pad-top"></div><div class="search-row"><div class="search-wrapper"><input id="search" class="search" type="search" role="combobox" enterkeyhint="search" placeholder="${t.i18n.searchLabel}" autocapitalize="none" autocomplete="off" spellcheck="true" aria-expanded="${!!(t.searchMode&&t.currentEmojis.length)}" aria-controls="search-results" aria-describedby="search-description" aria-autocomplete="list" aria-activedescendant="${t.activeSearchItemId?`emo-${t.activeSearchItemId}`:null}" data-ref="searchElement" data-on-input="onSearchInput" data-on-keydown="onSearchKeydown"><label class="sr-only" for="search">${t.i18n.searchLabel}</label> <span id="search-description" class="sr-only">${t.i18n.searchDescription}</span></div><div class="skintone-button-wrapper ${t.skinTonePickerExpandedAfterAnimation?"expanded":""}"><button id="skintone-button" class="emoji ${t.skinTonePickerExpanded?"hide-focus":""}" aria-label="${t.skinToneButtonLabel}" title="${t.skinToneButtonLabel}" aria-describedby="skintone-description" aria-haspopup="listbox" aria-expanded="${t.skinTonePickerExpanded}" aria-controls="skintone-list" data-on-click="onClickSkinToneButton">${t.skinToneButtonText||""}</button></div><span id="skintone-description" class="sr-only">${t.i18n.skinToneDescription}</span><div data-ref="skinToneDropdown" id="skintone-list" class="skintone-list hide-focus ${t.skinTonePickerExpanded?"":"hidden no-animate"}" style="transform:translateY(${t.skinTonePickerExpanded?0:"calc(-1 * var(--num-skintones) * var(--total-emoji-size))"})" role="listbox" aria-label="${t.i18n.skinTonesLabel}" aria-activedescendant="skintone-${t.activeSkinTone}" aria-hidden="${!t.skinTonePickerExpanded}" tabIndex="-1" data-on-focusout="onSkinToneOptionsFocusOut" data-on-click="onSkinToneOptionsClick" data-on-keydown="onSkinToneOptionsKeydown" data-on-keyup="onSkinToneOptionsKeyup">${g(t.skinTones,(m,b)=>p`<div id="skintone-${b}" class="emoji ${b===t.activeSkinTone?"active":""}" aria-selected="${b===t.activeSkinTone}" role="option" title="${t.i18n.skinTones[b]}" aria-label="${t.i18n.skinTones[b]}">${m}</div>`,m=>m)}</div></div><div class="nav" role="tablist" style="grid-template-columns:repeat(${t.groups.length},1fr)" aria-label="${t.i18n.categoriesLabel}" data-on-keydown="onNavKeydown" data-on-click="onNavClick">${g(t.groups,m=>p`<button role="tab" class="nav-button" aria-controls="tab-${m.id}" aria-label="${t.i18n.categories[m.name]}" aria-selected="${!t.searchMode&&t.currentGroup.id===m.id}" title="${t.i18n.categories[m.name]}" data-group-id="${m.id}"><div class="nav-emoji emoji">${m.emoji}</div></button>`,m=>m.id)}</div><div class="indicator-wrapper"><div class="indicator" style="transform:translateX(${(t.isRtl?-1:1)*t.currentGroupIndex*100}%)"></div></div><div class="message ${t.message?"":"gone"}" role="alert" aria-live="polite">${t.message||""}</div><div data-ref="tabpanelElement" class="tabpanel ${!t.databaseLoaded||t.message?"gone":""}" role="${t.searchMode?"region":"tabpanel"}" aria-label="${t.searchMode?t.i18n.searchResultsLabel:t.i18n.categories[t.currentGroup.name]}" id="${t.searchMode?null:`tab-${t.currentGroup.id}`}" tabIndex="0" data-on-click="onEmojiClick"><div data-action="calculateEmojiGridStyle">${g(t.currentEmojisWithCategories,(m,b)=>p`<div><div id="menu-label-${b}" class="category ${t.currentEmojisWithCategories.length===1&&t.currentEmojisWithCategories[0].category===""?"gone":""}" aria-hidden="true">${t.searchMode?t.i18n.searchResultsLabel:m.category?m.category:t.currentEmojisWithCategories.length>1?t.i18n.categories.custom:t.i18n.categories[t.currentGroup.name]}</div><div class="emoji-menu ${b!==0&&!t.searchMode&&t.currentGroup.id===-1?"visibility-auto":""}" style="${`--num-rows: ${Math.ceil(m.emojis.length/t.numColumns)}`}" data-action="updateOnIntersection" role="${t.searchMode?"listbox":"menu"}" aria-labelledby="menu-label-${b}" id="${t.searchMode?"search-results":null}">${y(m.emojis,t.searchMode,"emo")}</div></div>`,m=>m.category)}</div></div><div class="favorites onscreen emoji-menu ${t.message?"gone":""}" role="menu" aria-label="${t.i18n.favoritesLabel}" data-on-click="onEmojiClick">${y(t.currentFavorites,!1,"fav")}</div><button data-ref="baselineEmoji" aria-hidden="true" tabindex="-1" class="abs-pos hidden emoji baseline-emoji">😀</button></section>`,h=(m,b)=>{for(let E of e.querySelectorAll(`[${m}]`))b(E,E.getAttribute(m))};if(l){e.appendChild(x);for(let m of["click","focusout","input","keydown","keyup"])h(`data-on-${m}`,(b,E)=>{b.addEventListener(m,o[E])});h("data-ref",(m,b)=>{r[b]=m}),a.addEventListener("abort",()=>{e.removeChild(x)})}h("data-action",(m,b)=>{let E=s.get(b);E||s.set(b,E=new WeakSet),E.has(m)||(E.add(m),i[b](m))})}function h7(e){let t=!1,n,o=new Map,i=new Set,r,a=()=>{if(t)return;let c=[...i];i.clear();try{for(let u of c)u()}finally{r=!1,i.size&&(r=!0,db(a))}},s=new Proxy({},{get(c,u){if(n){let d=o.get(u);d||(d=new Set,o.set(u,d)),d.add(n)}return c[u]},set(c,u,d){if(c[u]!==d){c[u]=d;let p=o.get(u);if(p){for(let g of p)i.add(g);r||(r=!0,db(a))}}return!0}}),l=c=>{let u=()=>{let d=n;n=u;try{return c()}finally{n=d}};return u()};return e.addEventListener("abort",()=>{t=!0}),{state:s,createEffect:l}}function QE(e,t,n){if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(!n(e[o],t[o]))return!1;return!0}function b7(e,t,n){{let o=e.closest(".tabpanel"),i=Q6.get(o);i||(i=new IntersectionObserver(n,{root:o,rootMargin:"50% 0px 50% 0px",threshold:0}),Q6.set(o,i),t.addEventListener("abort",()=>{i.disconnect()})),i.observe(e)}}function y7(e,t){let n={},o=new AbortController,i=o.signal,{state:r,createEffect:a}=h7(i),s=new Map;lb(r,{skinToneEmoji:void 0,i18n:void 0,database:void 0,customEmoji:void 0,customCategorySorting:void 0,emojiVersion:void 0}),lb(r,t),lb(r,{initialLoad:!0,currentEmojis:[],currentEmojisWithCategories:[],rawSearchText:"",searchText:"",searchMode:!1,activeSearchItem:-1,message:void 0,skinTonePickerExpanded:!1,skinTonePickerExpandedAfterAnimation:!1,currentSkinTone:0,activeSkinTone:0,skinToneButtonText:void 0,pickerStyle:void 0,skinToneButtonLabel:"",skinTones:[],currentFavorites:[],defaultFavoriteEmojis:void 0,numColumns:NV,isRtl:!1,currentGroupIndex:0,groups:FE,databaseLoaded:!1,activeSearchItemId:void 0}),a(()=>{r.currentGroup!==r.groups[r.currentGroupIndex]&&(r.currentGroup=r.groups[r.currentGroupIndex])});let l=L=>{e.getElementById(L).focus()},c=L=>e.getElementById(`emo-${L.id}`),u=(L,Q)=>{n.rootElement.dispatchEvent(new CustomEvent(L,{detail:Q,bubbles:!0,composed:!0}))},d=(L,Q)=>L.id===Q.id,p=(L,Q)=>{let{category:Z,emojis:se}=L,{category:we,emojis:Te}=Q;return Z!==we?!1:QE(se,Te,d)},g=L=>{QE(r.currentEmojis,L,d)||(r.currentEmojis=L)},y=L=>{r.searchMode!==L&&(r.searchMode=L)},v=L=>{QE(r.currentEmojisWithCategories,L,p)||(r.currentEmojisWithCategories=L)},x=(L,Q)=>Q&&L.skins&&L.skins[Q]||L.unicode,b={labelWithSkin:(L,Q)=>e7([L.name||x(L,Q),L.annotation,...L.shortcodes||JE].filter(Boolean)).join(", "),titleForEmoji:L=>L.annotation||(L.shortcodes||JE).join(", "),unicodeWithSkin:x},E={onClickSkinToneButton:G,onEmojiClick:C,onNavClick:ue,onNavKeydown:q,onSearchKeydown:oe,onSkinToneOptionsClick:I,onSkinToneOptionsFocusOut:pe,onSkinToneOptionsKeydown:te,onSkinToneOptionsKeyup:ie,onSearchInput:xe},S={calculateEmojiGridStyle:T,updateOnIntersection:H},A=!0;a(()=>{g7(e,r,b,E,S,n,i,s,A),A=!1}),r.emojiVersion||XE().then(L=>{L||(r.message=r.i18n.emojiUnsupportedMessage)}),a(()=>{async function L(){let Q=!1,Z=setTimeout(()=>{Q=!0,r.message=r.i18n.loadingMessage},OV);try{await r.database.ready(),r.databaseLoaded=!0}catch(se){console.error(se),r.message=r.i18n.networkErrorMessage}finally{clearTimeout(Z),Q&&(Q=!1,r.message="")}}r.database&&L()}),a(()=>{r.pickerStyle=`
10
10
  --num-groups: ${r.groups.length};
11
11
  --indicator-opacity: ${r.searchMode?0:1};
12
- --num-skintones: ${I6};`}),a(()=>{r.customEmoji&&r.database&&_()}),a(()=>{r.customEmoji&&r.customEmoji.length?r.groups!==ek&&(r.groups=ek):r.groups!==FE&&(r.currentGroupIndex&&r.currentGroupIndex--,r.groups=FE)}),a(()=>{async function L(){r.databaseLoaded&&(r.currentSkinTone=await r.database.getPreferredSkinTone())}L()}),a(()=>{r.skinTones=Array(I6).fill().map((L,Q)=>YV(r.skinToneEmoji,Q))}),a(()=>{r.skinToneButtonText=r.skinTones[r.currentSkinTone]}),a(()=>{r.skinToneButtonLabel=r.i18n.skinToneLabel.replace("{skinTone}",r.i18n.skinTones[r.currentSkinTone])}),a(()=>{async function L(){let{database:Q}=r,Z=(await Promise.all(jV.map(ae=>Q.getEmojiByUnicodeOrName(ae)))).filter(Boolean);r.defaultFavoriteEmojis=Z}r.databaseLoaded&&L()});function _(){let{customEmoji:L,database:Q}=r,Z=L||JE;Q.customEmoji!==Z&&(Q.customEmoji=Z)}a(()=>{async function L(){_();let{database:Q,defaultFavoriteEmojis:Z,numColumns:ae}=r,we=await Q.getTopFavoriteEmoji(ae),Te=await le(tD([...we,...Z],$=>$.unicode||$.name).slice(0,ae));r.currentFavorites=Te}r.databaseLoaded&&r.defaultFavoriteEmojis&&L()});function T(L){ZV(L,i,()=>{{let Q=getComputedStyle(n.rootElement),Z=parseInt(Q.getPropertyValue("--num-columns"),10),ae=Q.getPropertyValue("direction")==="rtl";r.numColumns=Z,r.isRtl=ae}})}function H(L){b7(L,i,Q=>{for(let{target:Z,isIntersecting:ae}of Q)Z.classList.toggle("onscreen",ae)})}a(()=>{async function L(){let{searchText:Q,currentGroup:Z,databaseLoaded:ae,customEmoji:we}=r;if(!ae)r.currentEmojis=[],r.searchMode=!1;else if(Q.length>=HV){let Te=await V(Q);r.searchText===Q&&(g(Te),y(!0))}else{let{id:Te}=Z;if(Te!==-1||we&&we.length){let $=await J(Te);r.currentGroup.id===Te&&(g($),y(!1))}}}L()});let R=()=>{cb(()=>t7(n.tabpanelElement))};a(()=>{let{currentEmojis:L,emojiVersion:Q}=r,Z=L.filter(ae=>ae.unicode).filter(ae=>G6(ae)&&!tk.has(ae.unicode));if(!Q&&Z.length)g(L),cb(()=>z(Z));else{let ae=Q?L:L.filter(F);g(ae),R()}});function z(L){JV(L,n.baselineEmoji,c)?R():r.currentEmojis=[...r.currentEmojis]}function F(L){return!L.unicode||!G6(L)||tk.get(L.unicode)}async function B(L){let Q=r.emojiVersion||await XE();return L.filter(({version:Z})=>!Z||Z<=Q)}async function le(L){return XV(L,r.emojiVersion||await XE())}async function J(L){let Q=L===-1?r.customEmoji:await r.database.getEmojiByGroup(L);return le(await B(Q))}async function V(L){return le(await B(await r.database.getEmojiBySearchQuery(L)))}a(()=>{}),a(()=>{function L(){let{searchMode:Z,currentEmojis:ae}=r;if(Z)return[{category:"",emojis:ae}];let we=new Map;for(let Te of ae){let $=Te.category||"",D=we.get($);D||(D=[],we.set($,D)),D.push(Te)}return[...we.entries()].map(([Te,$])=>({category:Te,emojis:$})).sort((Te,$)=>r.customCategorySorting(Te.category,$.category))}let Q=L();v(Q)}),a(()=>{r.activeSearchItemId=r.activeSearchItem!==-1&&r.currentEmojis[r.activeSearchItem].id}),a(()=>{let{rawSearchText:L}=r;J6(()=>{r.searchText=(L||"").trim(),r.activeSearchItem=-1})});function oe(L){if(!r.searchMode||!r.currentEmojis.length)return;let Q=Z=>{Fr(L),r.activeSearchItem=WE(Z,r.activeSearchItem,r.currentEmojis)};switch(L.key){case"ArrowDown":return Q(!1);case"ArrowUp":return Q(!0);case"Enter":if(r.activeSearchItem===-1)r.activeSearchItem=0;else return Fr(L),W(r.currentEmojis[r.activeSearchItem].id)}}function ue(L){let{target:Q}=L,Z=Q.closest(".nav-button");if(!Z)return;let ae=parseInt(Z.dataset.groupId,10);n.searchElement.value="",r.rawSearchText="",r.searchText="",r.activeSearchItem=-1,r.currentGroupIndex=r.groups.findIndex(we=>we.id===ae)}function q(L){let{target:Q,key:Z}=L,ae=we=>{we&&(Fr(L),we.focus())};switch(Z){case"ArrowLeft":return ae(Q.previousElementSibling);case"ArrowRight":return ae(Q.nextElementSibling);case"Home":return ae(Q.parentElement.firstElementChild);case"End":return ae(Q.parentElement.lastElementChild)}}async function Y(L){let Q=await r.database.getEmojiByUnicodeOrName(L),Z=[...r.currentEmojis,...r.currentFavorites].find(we=>we.id===L),ae=Z.unicode&&x(Z,r.currentSkinTone);return await r.database.incrementFavoriteEmojiCount(L),{emoji:Q,skinTone:r.currentSkinTone,...ae&&{unicode:ae},...Z.name&&{name:Z.name}}}async function W(L){let Q=Y(L);u("emoji-click-sync",Q),u("emoji-click",await Q)}function C(L){let{target:Q}=L;if(!Q.classList.contains("emoji"))return;Fr(L);let Z=Q.id.substring(4);W(Z)}function U(L){r.currentSkinTone=L,r.skinTonePickerExpanded=!1,l("skintone-button"),u("skin-tone-change",{skinTone:L}),r.database.setPreferredSkinTone(L)}function I(L){let{target:{id:Q}}=L,Z=Q&&Q.match(/^skintone-(\d)/);if(!Z)return;Fr(L);let ae=parseInt(Z[1],10);U(ae)}function G(L){r.skinTonePickerExpanded=!r.skinTonePickerExpanded,r.activeSkinTone=r.currentSkinTone,r.skinTonePickerExpanded&&(Fr(L),cb(()=>l("skintone-list")))}a(()=>{r.skinTonePickerExpanded?n.skinToneDropdown.addEventListener("transitionend",()=>{r.skinTonePickerExpandedAfterAnimation=!0},{once:!0}):r.skinTonePickerExpandedAfterAnimation=!1});function te(L){if(!r.skinTonePickerExpanded)return;let Q=async Z=>{Fr(L),r.activeSkinTone=Z};switch(L.key){case"ArrowUp":return Q(WE(!0,r.activeSkinTone,r.skinTones));case"ArrowDown":return Q(WE(!1,r.activeSkinTone,r.skinTones));case"Home":return Q(0);case"End":return Q(r.skinTones.length-1);case"Enter":return Fr(L),U(r.activeSkinTone);case"Escape":return Fr(L),r.skinTonePickerExpanded=!1,l("skintone-button")}}function ie(L){if(r.skinTonePickerExpanded&&L.key===" ")return Fr(L),U(r.activeSkinTone)}async function pe(L){let{relatedTarget:Q}=L;(!Q||Q.id!=="skintone-list")&&(r.skinTonePickerExpanded=!1)}function xe(L){r.rawSearchText=L.target.value}return{$set(L){lb(r,L)},$destroy(){o.abort()}}}function nk(e){e instanceof Od||Object.setPrototypeOf(e,customElements.get(e.tagName.toLowerCase()).prototype)}var ek,FE,HV,I6,J6,zV,OV,$V,NV,jV,eD,PV,F6,BV,YE,XE,tk,qV,KV,IV,GV,FV,cb,WV,QV,ZE,jl,o7,i7,r7,a7,db,Q6,JE,lb,x7,v7,w7,E7,nD,k7,Od,oD,rD=O(()=>{K6();ek=[[-1,"\u2728","custom"],[0,"\u{1F600}","smileys-emotion"],[1,"\u{1F44B}","people-body"],[3,"\u{1F431}","animals-nature"],[4,"\u{1F34E}","food-drink"],[5,"\u{1F3E0}\uFE0F","travel-places"],[6,"\u26BD","activities"],[7,"\u{1F4DD}","objects"],[8,"\u26D4\uFE0F","symbols"],[9,"\u{1F3C1}","flags"]].map(([e,t,n])=>({id:e,emoji:t,name:n})),FE=ek.slice(1),HV=2,I6=6,J6=typeof requestIdleCallback=="function"?requestIdleCallback:setTimeout;zV={"\u{1FAEA}":17,"\u{1FAE9}":16,"\u{1FAE8}":15.1,"\u{1FAE0}":14,"\u{1F972}":13.1,"\u{1F97B}":12.1,"\u{1F970}":11,"\u{1F929}":5,"\u{1F471}\u200D\u2640\uFE0F":4,"\u{1F923}":3,"\u{1F441}\uFE0F\u200D\u{1F5E8}\uFE0F":2,"\u{1F600}":1,"\u{1F610}\uFE0F":.7,"\u{1F603}":.6},OV=1e3,$V="\u{1F590}\uFE0F",NV=8,jV=["\u{1F60A}","\u{1F612}","\u2764\uFE0F","\u{1F44D}\uFE0F","\u{1F60D}","\u{1F602}","\u{1F62D}","\u263A\uFE0F","\u{1F614}","\u{1F629}","\u{1F60F}","\u{1F495}","\u{1F64C}","\u{1F618}"],eD='"Twemoji Mozilla","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif',PV=(e,t)=>e<t?-1:e>t?1:0,F6=(e,t)=>{let n=document.createElement("canvas");n.width=n.height=1;let o=n.getContext("2d",{willReadFrequently:!0});return o.textBaseline="top",o.font=`100px ${eD}`,o.fillStyle=t,o.scale(.01,.01),o.fillText(e,0,0),o.getImageData(0,0,1,1).data},BV=(e,t)=>{let n=[...e].join(","),o=[...t].join(",");return n===o&&!n.startsWith("0,0,0,")};XE=()=>(YE||(YE=new Promise(e=>J6(()=>e(UV())))),YE),tk=new Map,qV="\uFE0F",KV="\uD83C",IV="\u200D",GV=127995,FV=57339;cb=requestAnimationFrame,WV=typeof ResizeObserver=="function";QV="\u{1F600}";o7=new WeakMap,i7=new WeakMap,r7=Symbol("un-keyed"),a7="replaceChildren"in Element.prototype;db=typeof queueMicrotask=="function"?queueMicrotask:e=>Promise.resolve().then(e);Q6=new WeakMap;JE=[],{assign:lb}=Object;x7="https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json",v7="en",w7={categoriesLabel:"Categories",emojiUnsupportedMessage:"Your browser does not support color emoji.",favoritesLabel:"Favorites",loadingMessage:"Loading\u2026",networkErrorMessage:"Could not load emoji.",regionLabel:"Emoji picker",searchDescription:"When search results are available, press up or down to select and enter to choose.",searchLabel:"Search",searchResultsLabel:"Search results",skinToneDescription:"When expanded, press up or down to select and enter to choose.",skinToneLabel:"Choose a skin tone (currently {skinTone})",skinTonesLabel:"Skin tones",skinTones:["Default","Light","Medium-Light","Medium","Medium-Dark","Dark"],categories:{custom:"Custom","smileys-emotion":"Smileys and emoticons","people-body":"People and body","animals-nature":"Animals and nature","food-drink":"Food and drink","travel-places":"Travel and places",activities:"Activities",objects:"Objects",symbols:"Symbols",flags:"Flags"}},E7=':host{--emoji-size:1.375rem;--emoji-padding:0.5rem;--category-emoji-size:var(--emoji-size);--category-emoji-padding:var(--emoji-padding);--indicator-height:3px;--input-border-radius:0.5rem;--input-border-size:1px;--input-font-size:1rem;--input-line-height:1.5;--input-padding:0.25rem;--num-columns:8;--outline-size:2px;--border-size:1px;--border-radius:0;--skintone-border-radius:1rem;--category-font-size:1rem;display:flex;width:min-content;height:400px}:host,:host(.light){color-scheme:light;--background:#fff;--border-color:#e0e0e0;--indicator-color:#385ac1;--input-border-color:#999;--input-font-color:#111;--input-placeholder-color:#999;--outline-color:#999;--category-font-color:#111;--button-active-background:#e6e6e6;--button-hover-background:#d9d9d9}:host(.dark){color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}@media (prefers-color-scheme:dark){:host{color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}}:host([hidden]){display:none}button{margin:0;padding:0;border:0;background:0 0;box-shadow:none;-webkit-tap-highlight-color:transparent}button::-moz-focus-inner{border:0}input{padding:0;margin:0;line-height:1.15;font-family:inherit}input[type=search]{-webkit-appearance:none}:focus{outline:var(--outline-color) solid var(--outline-size);outline-offset:calc(-1*var(--outline-size))}:host([data-js-focus-visible]) :focus:not([data-focus-visible-added]){outline:0}:focus:not(:focus-visible){outline:0}.hide-focus{outline:0}*{box-sizing:border-box}.picker{contain:content;display:flex;flex-direction:column;background:var(--background);border:var(--border-size) solid var(--border-color);border-radius:var(--border-radius);width:100%;height:100%;overflow:hidden;--total-emoji-size:calc(var(--emoji-size) + (2 * var(--emoji-padding)));--total-category-emoji-size:calc(var(--category-emoji-size) + (2 * var(--category-emoji-padding)))}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.hidden{opacity:0;pointer-events:none}.abs-pos{position:absolute;left:0;top:0}.gone{display:none!important}.skintone-button-wrapper,.skintone-list{background:var(--background);z-index:3}.skintone-button-wrapper.expanded{z-index:1}.skintone-list{position:absolute;inset-inline-end:0;top:0;z-index:2;overflow:visible;border-bottom:var(--border-size) solid var(--border-color);border-radius:0 0 var(--skintone-border-radius) var(--skintone-border-radius);will-change:transform;transition:transform .2s ease-in-out;transform-origin:center 0}@media (prefers-reduced-motion:reduce){.skintone-list{transition-duration:.001s}}@supports not (inset-inline-end:0){.skintone-list{right:0}}.skintone-list.no-animate{transition:none}.tabpanel{overflow-y:auto;scrollbar-gutter:stable;-webkit-overflow-scrolling:touch;will-change:transform;min-height:0;flex:1;contain:content}.emoji-menu{display:grid;grid-template-columns:repeat(var(--num-columns),var(--total-emoji-size));justify-content:space-around;align-items:flex-start;width:100%}.emoji-menu.visibility-auto{content-visibility:auto;contain-intrinsic-size:calc(var(--num-columns)*var(--total-emoji-size)) calc(var(--num-rows)*var(--total-emoji-size))}.category{padding:var(--emoji-padding);font-size:var(--category-font-size);color:var(--category-font-color)}.emoji,button.emoji{font-size:var(--emoji-size);display:flex;align-items:center;justify-content:center;border-radius:100%;height:var(--total-emoji-size);width:var(--total-emoji-size);line-height:1;overflow:hidden;font-family:var(--emoji-font-family);cursor:pointer}@media (hover:hover) and (pointer:fine){.emoji:hover,button.emoji:hover{background:var(--button-hover-background)}}.emoji.active,.emoji:active,button.emoji.active,button.emoji:active{background:var(--button-active-background)}.onscreen .custom-emoji::after{content:"";width:var(--emoji-size);height:var(--emoji-size);background-repeat:no-repeat;background-position:center center;background-size:contain;background-image:var(--custom-emoji-background)}.nav,.nav-button{align-items:center}.nav{display:grid;justify-content:space-between;contain:content}.nav-button{display:flex;justify-content:center}.nav-emoji{font-size:var(--category-emoji-size);width:var(--total-category-emoji-size);height:var(--total-category-emoji-size)}.indicator-wrapper{display:flex;border-bottom:1px solid var(--border-color)}.indicator{width:calc(100%/var(--num-groups));height:var(--indicator-height);opacity:var(--indicator-opacity);background-color:var(--indicator-color);will-change:transform,opacity;transition:opacity .1s linear,transform .25s ease-in-out}@media (prefers-reduced-motion:reduce){.indicator{will-change:opacity;transition:opacity .1s linear}}.pad-top,input.search{background:var(--background);width:100%}.pad-top{height:var(--emoji-padding);z-index:3}.search-row{display:flex;align-items:center;position:relative;padding-inline-start:var(--emoji-padding);padding-bottom:var(--emoji-padding)}.search-wrapper{flex:1;min-width:0}input.search{padding:var(--input-padding);border-radius:var(--input-border-radius);border:var(--input-border-size) solid var(--input-border-color);color:var(--input-font-color);font-size:var(--input-font-size);line-height:var(--input-line-height)}input.search::placeholder{color:var(--input-placeholder-color)}.favorites{overflow-y:auto;scrollbar-gutter:stable;display:flex;flex-direction:row;border-top:var(--border-size) solid var(--border-color);contain:content}.message{padding:var(--emoji-padding)}',nD=["customEmoji","customCategorySorting","database","dataSource","i18n","locale","skinToneEmoji","emojiVersion"],k7=`:host{--emoji-font-family:${eD}}`,Od=class extends HTMLElement{constructor(t){super(),this.attachShadow({mode:"open"});let n=document.createElement("style");n.textContent=E7+k7,this.shadowRoot.appendChild(n),this._ctx={locale:v7,dataSource:x7,skinToneEmoji:$V,customCategorySorting:PV,customEmoji:null,i18n:w7,emojiVersion:null,...t};for(let o of nD)o!=="database"&&Object.prototype.hasOwnProperty.call(this,o)&&(this._ctx[o]=this[o],delete this[o]);this._dbFlush()}connectedCallback(){nk(this),this._cmp||(this._cmp=y7(this.shadowRoot,this._ctx))}disconnectedCallback(){nk(this),db(()=>{if(!this.isConnected&&this._cmp){this._cmp.$destroy(),this._cmp=void 0;let{database:t}=this._ctx;t.close().catch(n=>console.error(n))}})}static get observedAttributes(){return["locale","data-source","skin-tone-emoji","emoji-version"]}attributeChangedCallback(t,n,o){this._set(t.replace(/-([a-z])/g,(i,r)=>r.toUpperCase()),t==="emoji-version"?parseFloat(o):o)}_set(t,n){this._ctx[t]=n,this._cmp&&this._cmp.$set({[t]:n}),["locale","dataSource"].includes(t)&&this._dbFlush()}_dbCreate(){let{locale:t,dataSource:n,database:o}=this._ctx;(!o||o.locale!==t||o.dataSource!==n)&&this._set("database",new sb({locale:t,dataSource:n}))}_dbFlush(){db(()=>this._dbCreate())}},oD={};for(let e of nD)oD[e]={get(){return e==="database"&&this._dbCreate(),this._ctx[e]},set(t){if(e==="database")throw new Error("database is read-only");this._set(e,t)}};Object.defineProperties(Od.prototype,oD);customElements.get("emoji-picker")||customElements.define("emoji-picker",Od)});function ik(e,t){e.indexOf(t)===-1&&e.push(t)}function Pl(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var rk=O(()=>{});var jo,sD=O(()=>{jo=(e,t,n)=>n>t?t:n<e?e:n});var Er,ii,ak=O(()=>{Er=()=>{},ii=()=>{}});var Po,lD=O(()=>{Po={}});var cf,cD=O(()=>{cf=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e)});var sk,dD=O(()=>{sk=e=>typeof e=="object"&&e!==null});var df,uD=O(()=>{df=e=>/^0[^.\s]+$/u.test(e)});function uf(e){let t;return()=>(t===void 0&&(t=e()),t)}var pD=O(()=>{});var Ai,ub=O(()=>{Ai=e=>e});var Bl,fD=O(()=>{Bl=(...e)=>e.reduce((t,n)=>o=>n(t(o)))});var Vl,mD=O(()=>{Vl=(e,t,n)=>{let o=t-e;return o?(n-e)/o:1}});var Ul,gD=O(()=>{rk();Ul=class{constructor(){this.subscriptions=[]}add(t){return ik(this.subscriptions,t),()=>Pl(this.subscriptions,t)}notify(t,n,o){let i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,o);else for(let r=0;r<i;r++){let a=this.subscriptions[r];a&&a(t,n,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}});var eo,Ao,hD=O(()=>{eo=e=>e*1e3,Ao=e=>e/1e3});var pf,bD=O(()=>{pf=(e,t)=>t?e*(1e3/t):0});var yD,xD=O(()=>{yD=(e,t,n)=>{let o=t-e;return((n-e)%o+o)%o+e}});function C7(e,t,n,o,i){let r,a,s=0;do a=t+(n-t)/2,r=vD(a,o,i)-e,r>0?n=a:t=a;while(Math.abs(r)>A7&&++s<M7);return a}function $s(e,t,n,o){if(e===t&&n===o)return Ai;let i=r=>C7(r,0,1,e,n);return r=>r===0||r===1?r:vD(i(r),t,o)}var vD,A7,M7,pb=O(()=>{ub();vD=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,A7=1e-7,M7=12});var fb,lk=O(()=>{fb=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2});var ql,mb=O(()=>{ql=e=>t=>1-e(1-t)});var gb,$d,ff,hb=O(()=>{pb();lk();mb();gb=$s(.33,1.53,.69,.99),$d=ql(gb),ff=fb($d)});var mf,ck=O(()=>{hb();mf=e=>e>=1?1:(e*=2)<1?.5*$d(e):.5*(2-Math.pow(2,-10*(e-1)))});var gf,dk,hf,uk=O(()=>{lk();mb();gf=e=>1-Math.sin(Math.acos(e)),dk=ql(gf),hf=fb(gf)});var pk,fk,bf,mk=O(()=>{pb();pk=$s(.42,0,1,1),fk=$s(0,0,.58,1),bf=$s(.42,0,.58,1)});var yf,gk=O(()=>{yf=e=>Array.isArray(e)&&typeof e[0]!="number"});function xf(e,t){return yf(e)?e[yD(0,e.length,t)]:e}var wD=O(()=>{xD();gk()});var vf,hk=O(()=>{vf=e=>Array.isArray(e)&&typeof e[0]=="number"});var ED,L7,bb,kD=O(()=>{ak();ub();ck();hb();uk();pb();mk();hk();ED={linear:Ai,easeIn:pk,easeInOut:bf,easeOut:fk,circIn:gf,circInOut:hf,circOut:dk,backIn:$d,backInOut:ff,backOut:gb,anticipate:mf},L7=e=>typeof e=="string",bb=e=>{if(vf(e)){ii(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,n,o,i]=e;return $s(t,n,o,i)}else if(L7(e))return ii(ED[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),ED[e];return e}});var At=O(()=>{rk();sD();ak();lD();cD();dD();uD();pD();ub();fD();mD();gD();hD();bD();ck();hb();uk();mk();mb();wD();hk();gk();kD()});var wf,SD=O(()=>{wf=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"]});function TD(e){let t=new Set,n=new Set,o=!1,i=!1,r=new WeakSet,a={delta:0,timestamp:0,isProcessing:!1};function s(c){r.has(c)&&(l.schedule(c),e()),c(a)}let l={schedule:(c,u=!1,d=!1)=>{let g=d&&o?t:n;return u&&r.add(c),g.add(c),c},cancel:c=>{n.delete(c),r.delete(c)},process:c=>{if(a=c,o){i=!0;return}o=!0;let u=t;t=n,n=u,t.forEach(s),t.clear(),o=!1,i&&(i=!1,l.process(c))}};return l}var AD=O(()=>{});function yb(e,t){let n=!1,o=!0,i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,a=wf.reduce((b,E)=>(b[E]=TD(r),b),{}),{setup:s,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:p,render:g,postRender:y}=a,v=()=>{let b=Po.useManualTiming,E=b?i.timestamp:performance.now();n=!1,b||(i.delta=o?1e3/60:Math.max(Math.min(E-i.timestamp,_7),1)),i.timestamp=E,i.isProcessing=!0,s.process(i),l.process(i),c.process(i),u.process(i),d.process(i),p.process(i),g.process(i),y.process(i),i.isProcessing=!1,n&&t&&(o=!1,e(v))},x=()=>{n=!0,o=!0,i.isProcessing||e(v)};return{schedule:wf.reduce((b,E)=>{let S=a[E];return b[E]=(A,_=!1,T=!1)=>(n||x(),S.schedule(A,_,T)),b},{}),cancel:b=>{for(let E=0;E<wf.length;E++)a[wf[E]].cancel(b)},state:i,steps:a}}var _7,bk=O(()=>{At();SD();AD();_7=40});var Mo,Ef,Nd,oW,Ns=O(()=>{At();bk();({schedule:Mo,cancel:Ef,state:Nd,steps:oW}=yb(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ai,!0))});function D7(){xb=void 0}var xb,io,Kl=O(()=>{At();Ns();io={now:()=>(xb===void 0&&io.set(Nd.isProcessing||Po.useManualTiming?Nd.timestamp:performance.now()),xb),set:e=>{xb=e,queueMicrotask(D7)}}});function yk(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}var MD,vb,R7,jd,H7,Pd=O(()=>{MD=e=>t=>typeof t=="string"&&t.startsWith(e),vb=MD("--"),R7=MD("var(--"),jd=e=>R7(e)?H7.test(e.split("/*")[0].trim()):!1,H7=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu});var Yr,Va,kf,js=O(()=>{At();Yr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Va={...Yr,transform:e=>jo(0,1,e)},kf={...Yr,default:1}});var Ps,wb=O(()=>{Ps=e=>Math.round(e*1e5)/1e5});var Bd,Eb=O(()=>{Bd=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu});function CD(e){return e==null}var LD=O(()=>{});var _D,DD=O(()=>{_D=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu});var Vd,kb,Sb=O(()=>{Eb();LD();DD();Vd=(e,t)=>n=>!!(typeof n=="string"&&_D.test(n)&&n.startsWith(e)||t&&!CD(n)&&Object.prototype.hasOwnProperty.call(n,t)),kb=(e,t,n)=>o=>{if(typeof o!="string")return o;let[i,r,a,s]=o.match(Bd);return{[e]:parseFloat(i),[t]:parseFloat(r),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}}});var z7,xk,Xr,Tb=O(()=>{At();js();wb();Sb();z7=e=>jo(0,255,e),xk={...Yr,transform:e=>Math.round(z7(e))},Xr={test:Vd("rgb","red"),parse:kb("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:o=1})=>"rgba("+xk.transform(e)+", "+xk.transform(t)+", "+xk.transform(n)+", "+Ps(Va.transform(o))+")"}});function O7(e){let t="",n="",o="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),o=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),o=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,o+=o,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}}var Sf,vk=O(()=>{Tb();Sb();Sf={test:Vd("#"),parse:O7,transform:Xr.transform}});var Tf,kr,Bs,Ge,RD,HD,wk,Il=O(()=>{Tf=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),kr=Tf("deg"),Bs=Tf("%"),Ge=Tf("px"),RD=Tf("vh"),HD=Tf("vw"),wk={...Bs,parse:e=>Bs.parse(e)/100,transform:e=>Bs.transform(e*100)}});var Vs,Ek=O(()=>{js();Il();wb();Sb();Vs={test:Vd("hsl","hue"),parse:kb("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:o=1})=>"hsla("+Math.round(e)+", "+Bs.transform(Ps(t))+", "+Bs.transform(Ps(n))+", "+Ps(Va.transform(o))+")"}});var Tn,Af=O(()=>{vk();Ek();Tb();Tn={test:e=>Xr.test(e)||Sf.test(e)||Vs.test(e),parse:e=>Xr.test(e)?Xr.parse(e):Vs.test(e)?Vs.parse(e):Sf.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Xr.transform(e):Vs.transform(e),getAnimatableNone:e=>{let t=Tn.parse(e);return t.alpha=0,Tn.transform(t)}}});var zD,OD=O(()=>{zD=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu});function $7(e){return isNaN(e)&&typeof e=="string"&&(e.match(Bd)?.length||0)+(e.match(zD)?.length||0)>0}function Us(e){let t=e.toString(),n=[],o={color:[],number:[],var:[]},i=[],r=0,s=t.replace(P7,l=>(Tn.test(l)?(o.color.push(r),i.push(jD),n.push(Tn.parse(l))):l.startsWith(j7)?(o.var.push(r),i.push(N7),n.push(l)):(o.number.push(r),i.push(ND),n.push(parseFloat(l))),++r,$D)).split($D);return{values:n,split:s,indexes:o,types:i}}function B7(e){return Us(e).values}function PD({split:e,types:t}){let n=e.length;return o=>{let i="";for(let r=0;r<n;r++)if(i+=e[r],o[r]!==void 0){let a=t[r];a===ND?i+=Ps(o[r]):a===jD?i+=Tn.transform(o[r]):i+=o[r]}return i}}function V7(e){return PD(Us(e))}function K7(e){let t=Us(e);return PD(t)(t.values.map((o,i)=>q7(o,t.split[i])))}var ND,jD,N7,j7,$D,P7,U7,q7,ro,Wr=O(()=>{Af();OD();Eb();wb();ND="number",jD="color",N7="var",j7="var(",$D="${}",P7=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;U7=e=>typeof e=="number"?0:Tn.test(e)?Tn.getAnimatableNone(e):e,q7=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:U7(e);ro={test:$7,parse:B7,createTransformer:V7,getAnimatableNone:K7}});function kk(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function BD({hue:e,saturation:t,lightness:n,alpha:o}){e/=360,t/=100,n/=100;let i=0,r=0,a=0;if(!t)i=r=a=n;else{let s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=kk(l,s,e+1/3),r=kk(l,s,e),a=kk(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(a*255),alpha:o}}var VD=O(()=>{});function Ud(e,t){return n=>n>0?t:e}var Sk=O(()=>{});var Mi,Gl=O(()=>{Mi=(e,t,n)=>e+(t-e)*n});function UD(e){let t=G7(e);if(Er(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===Vs&&(n=BD(n)),n}var Tk,I7,G7,Ak,qD=O(()=>{At();vk();Ek();VD();Tb();Sk();Gl();Tk=(e,t,n)=>{let o=e*e,i=n*(t*t-o)+o;return i<0?0:Math.sqrt(i)},I7=[Sf,Xr,Vs],G7=e=>I7.find(t=>t.test(e));Ak=(e,t)=>{let n=UD(e),o=UD(t);if(!n||!o)return Ud(e,t);let i={...n};return r=>(i.red=Tk(n.red,o.red,r),i.green=Tk(n.green,o.green,r),i.blue=Tk(n.blue,o.blue,r),i.alpha=Mi(n.alpha,o.alpha,r),Xr.transform(i))}});function KD(e,t){return Ab.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}var Ab,ID=O(()=>{Ab=new Set(["none","hidden"])});function F7(e,t){return n=>Mi(e,t,n)}function Mb(e){return typeof e=="number"?F7:typeof e=="string"?jd(e)?Ud:Tn.test(e)?Ak:W7:Array.isArray(e)?GD:typeof e=="object"?Tn.test(e)?Ak:Y7:Ud}function GD(e,t){let n=[...e],o=n.length,i=e.map((r,a)=>Mb(r)(r,t[a]));return r=>{for(let a=0;a<o;a++)n[a]=i[a](r);return n}}function Y7(e,t){let n={...e,...t},o={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(o[i]=Mb(e[i])(e[i],t[i]));return i=>{for(let r in o)n[r]=o[r](i);return n}}function X7(e,t){let n=[],o={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let r=t.types[i],a=e.indexes[r][o[r]],s=e.values[a]??0;n[i]=s,o[r]++}return n}var W7,FD=O(()=>{At();Pd();Af();Wr();qD();Sk();Gl();ID();W7=(e,t)=>{let n=ro.createTransformer(t),o=Us(e),i=Us(t);return o.indexes.var.length===i.indexes.var.length&&o.indexes.color.length===i.indexes.color.length&&o.indexes.number.length>=i.indexes.number.length?Ab.has(e)&&!i.values.length||Ab.has(t)&&!o.values.length?KD(e,t):Bl(GD(X7(o,i),i.values),n):(Er(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Ud(e,t))}});function Cb(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Mi(e,t,n):Mb(e)(e,t)}var Mk=O(()=>{FD();Gl()});var YD,XD=O(()=>{Kl();Ns();YD=e=>{let t=({timestamp:n})=>e(n);return{start:(n=!0)=>Mo.update(t,n),stop:()=>Ef(t),now:()=>Nd.isProcessing?Nd.timestamp:io.now()}}});var Lb,Ck=O(()=>{Lb=(e,t,n=10)=>{let o="",i=Math.max(Math.round(t/n),2);for(let r=0;r<i;r++)o+=Math.round(e(r/(i-1))*1e4)/1e4+", ";return`linear(${o.substring(0,o.length-2)})`}});function qd(e){let t=0,n=50,o=e.next(t);for(;!o.done&&t<2e4;)t+=n,o=e.next(t);return t>=2e4?1/0:t}var _b=O(()=>{});function Mf(e,t=100,n){let o=n({...e,keyframes:[0,t]}),i=Math.min(qd(o),2e4);return{type:"keyframes",ease:r=>o.next(i*r).value/t,duration:Ao(i)}}var _k=O(()=>{At();_b()});function Rk(e,t){return e*Math.sqrt(1-t*t)}function Q7(e,t,n){let o=n;for(let i=1;i<Z7;i++)o=o-e(o)/t(o);return o}function J7({duration:e=Cn.duration,bounce:t=Cn.bounce,velocity:n=Cn.velocity,mass:o=Cn.mass}){let i,r;Er(e<=eo(Cn.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-t;a=jo(Cn.minDamping,Cn.maxDamping,a),e=jo(Cn.minDuration,Cn.maxDuration,Ao(e)),a<1?(i=c=>{let u=c*a,d=u*e,p=u-n,g=Rk(c,a),y=Math.exp(-d);return Dk-p/g*y},r=c=>{let d=c*a*e,p=d*n+n,g=Math.pow(a,2)*Math.pow(c,2)*e,y=Math.exp(-d),v=Rk(Math.pow(c,2),a);return(-i(c)+Dk>0?-1:1)*((p-g)*y)/v}):(i=c=>{let u=Math.exp(-c*e),d=(c-n)*e+1;return-Dk+u*d},r=c=>{let u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});let s=5/e,l=Q7(i,r,s);if(e=eo(e),isNaN(l))return{stiffness:Cn.stiffness,damping:Cn.damping,duration:e};{let c=Math.pow(l,2)*o;return{stiffness:c,damping:a*2*Math.sqrt(o*c),duration:e}}}function WD(e,t){return t.some(n=>e[n]!==void 0)}function nU(e){let t={velocity:Cn.velocity,stiffness:Cn.stiffness,damping:Cn.damping,mass:Cn.mass,isResolvedFromDuration:!1,...e};if(!WD(e,tU)&&WD(e,eU))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,o=2*Math.PI/(n*1.2),i=o*o,r=2*jo(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Cn.mass,stiffness:i,damping:r}}else{let n=J7({...e,velocity:0});t={...t,...n,mass:Cn.mass},t.isResolvedFromDuration=!0}return t}function Ua(e=Cn.visualDuration,t=Cn.bounce){let n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:o,restDelta:i}=n,r=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],s={done:!1,value:r},{stiffness:l,damping:c,mass:u,duration:d,velocity:p,isResolvedFromDuration:g}=nU({...n,velocity:-Ao(n.velocity||0)}),y=p||0,v=c/(2*Math.sqrt(l*u)),x=a-r,h=Ao(Math.sqrt(l/u)),m=Math.abs(x)<5;o||(o=m?Cn.restSpeed.granular:Cn.restSpeed.default),i||(i=m?Cn.restDelta.granular:Cn.restDelta.default);let b,E,S,A,_,T;if(v<1)S=Rk(h,v),A=(y+v*h*x)/S,b=R=>{let z=Math.exp(-v*h*R);return a-z*(A*Math.sin(S*R)+x*Math.cos(S*R))},_=v*h*A+x*S,T=v*h*x-A*S,E=R=>Math.exp(-v*h*R)*(_*Math.sin(S*R)+T*Math.cos(S*R));else if(v===1){b=z=>a-Math.exp(-h*z)*(x+(y+h*x)*z);let R=y+h*x;E=z=>Math.exp(-h*z)*(h*R*z-y)}else{let R=h*Math.sqrt(v*v-1);b=le=>{let J=Math.exp(-v*h*le),V=Math.min(R*le,300);return a-J*((y+v*h*x)*Math.sinh(V)+R*x*Math.cosh(V))/R};let z=(y+v*h*x)/R,F=v*h*z-x*R,B=v*h*x-z*R;E=le=>{let J=Math.exp(-v*h*le),V=Math.min(R*le,300);return J*(F*Math.sinh(V)+B*Math.cosh(V))}}let H={calculatedDuration:g&&d||null,velocity:R=>eo(E(R)),next:R=>{if(!g&&v<1){let F=Math.exp(-v*h*R),B=Math.sin(S*R),le=Math.cos(S*R),J=a-F*(A*B+x*le),V=eo(F*(_*B+T*le));return s.done=Math.abs(V)<=o&&Math.abs(a-J)<=i,s.value=s.done?a:J,s}let z=b(R);if(g)s.done=R>=d;else{let F=eo(E(R));s.done=Math.abs(F)<=o&&Math.abs(a-z)<=i}return s.value=s.done?a:z,s},toString:()=>{let R=Math.min(qd(H),2e4),z=Lb(F=>H.next(R*F).value,R,30);return R+"ms "+z},toTransition:()=>{}};return H}var Cn,Z7,Dk,eU,tU,Db=O(()=>{At();Ck();_b();_k();Cn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};Z7=12;Dk=.001;eU=["duration","bounce"],tU=["stiffness","damping","mass"];Ua.applyToOptions=e=>{let t=Mf(e,100,Ua);return e.ease=t.ease,e.duration=eo(t.duration),e.type="keyframes",e}});function Rb(e,t,n){let o=Math.max(t-oU,0);return pf(n-e(o),t-o)}var oU,Hk=O(()=>{At();oU=5});function Cf({keyframes:e,velocity:t=0,power:n=.8,timeConstant:o=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:a,min:s,max:l,restDelta:c=.5,restSpeed:u}){let d=e[0],p={done:!1,value:d},g=T=>s!==void 0&&T<s||l!==void 0&&T>l,y=T=>s===void 0?l:l===void 0||Math.abs(s-T)<Math.abs(l-T)?s:l,v=n*t,x=d+v,h=a===void 0?x:a(x);h!==x&&(v=h-d);let m=T=>-v*Math.exp(-T/o),b=T=>h+m(T),E=T=>{let H=m(T),R=b(T);p.done=Math.abs(H)<=c,p.value=p.done?h:R},S,A,_=T=>{g(p.value)&&(S=T,A=Ua({keyframes:[p.value,y(p.value)],velocity:Rb(b,T,p.value),damping:i,stiffness:r,restDelta:c,restSpeed:u}))};return _(0),{calculatedDuration:null,next:T=>{let H=!1;return!A&&S===void 0&&(H=!0,E(T),_(T)),S!==void 0&&T>=S?A.next(T-S):(!H&&E(T),p)}}}var zk=O(()=>{Db();Hk()});function iU(e,t,n){let o=[],i=n||Po.mix||Cb,r=e.length-1;for(let a=0;a<r;a++){let s=i(e[a],e[a+1]);if(t){let l=Array.isArray(t)?t[a]||Ai:t;s=Bl(l,s)}o.push(s)}return o}function ZD(e,t,{clamp:n=!0,ease:o,mixer:i}={}){let r=e.length;if(ii(r===t.length,"Both input and output ranges must be the same length","range-length"),r===1)return()=>t[0];if(r===2&&t[0]===t[1])return()=>t[1];let a=e[0]===e[1];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=iU(t,o,i),l=s.length,c=u=>{if(a&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);let p=Vl(e[d],e[d+1],u);return s[d](p)};return n?u=>c(jo(e[0],e[r-1],u)):c}var QD=O(()=>{At();Mk()});function Lf(e,t){let n=e[e.length-1];for(let o=1;o<=t;o++){let i=Vl(0,t,o);e.push(Mi(n,1,i))}}var Ok=O(()=>{At();Gl()});function _f(e){let t=[0];return Lf(t,e.length-1),t}var $k=O(()=>{Ok()});function JD(e,t){return e.map(n=>n*t)}var e3=O(()=>{});function rU(e,t){return e.map(()=>t||bf).splice(0,e.length-1)}function Fl({duration:e=300,keyframes:t,times:n,ease:o="easeInOut"}){let i=yf(o)?o.map(bb):bb(o),r={done:!1,value:t[0]},a=JD(n&&n.length===t.length?n:_f(t),e),s=ZD(a,t,{ease:Array.isArray(i)?i:rU(t,i)});return{calculatedDuration:e,next:l=>(r.value=s(l),r.done=l>=e,r)}}var Nk=O(()=>{At();QD();$k();e3()});function qs(e,{repeat:t,repeatType:n="loop"},o,i=1){let r=e.filter(aU),s=i<0||t&&n!=="loop"&&t%2===1?0:r.length-1;return!s||o===void 0?r[s]:o}var aU,Df=O(()=>{aU=e=>e!==null});function Hb(e){typeof e.type=="string"&&(e.type=sU[e.type])}var sU,jk=O(()=>{zk();Nk();Db();sU={decay:Cf,inertia:Cf,tween:Fl,keyframes:Fl,spring:Ua}});var Ks,zb=O(()=>{Ks=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}});var lU,qa,Ob=O(()=>{At();Kl();Mk();XD();zk();Nk();_b();Hk();Df();jk();zb();lU=e=>e/100,qa=class extends Ks{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:n}=this.options;n&&n.updatedAt!==io.now()&&this.tick(io.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){let{options:t}=this;Hb(t);let{type:n=Fl,repeat:o=0,repeatDelay:i=0,repeatType:r,velocity:a=0}=t,{keyframes:s}=t,l=n||Fl;l!==Fl&&typeof s[0]!="number"&&(this.mixKeyframes=Bl(lU,Cb(s[0],s[1])),s=[0,100]);let c=l({...t,keyframes:s});r==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...s].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=qd(c));let{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(o+1)-i,this.generator=c}updateTime(t){let n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){let{generator:o,totalDuration:i,mixKeyframes:r,mirroredGenerator:a,resolvedDuration:s,calculatedDuration:l}=this;if(this.startTime===null)return o.next(0);let{delay:c=0,keyframes:u,repeat:d,repeatType:p,repeatDelay:g,type:y,onUpdate:v,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);let h=this.currentTime-c*(this.playbackSpeed>=0?1:-1),m=this.playbackSpeed>=0?h<0:h>i;this.currentTime=Math.max(h,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let b=this.currentTime,E=o;if(d){let T=Math.min(this.currentTime,i)/s,H=Math.floor(T),R=T%1;!R&&T>=1&&(R=1),R===1&&H--,H=Math.min(H,d+1),H%2&&(p==="reverse"?(R=1-R,g&&(R-=g/s)):p==="mirror"&&(E=a)),b=jo(0,1,R)*s}let S;m?(this.delayState.value=u[0],S=this.delayState):S=E.next(b),r&&!m&&(S.value=r(S.value));let{done:A}=S;!m&&l!==null&&(A=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);let _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return _&&y!==Cf&&(S.value=qs(u,this.options,x,this.speed)),v&&v(S.value),_&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return Ao(this.calculatedDuration)}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+Ao(t)}get time(){return Ao(this.currentTime)}set time(t){t=eo(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){let t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);let n=this.generator.next(t).value;return Rb(o=>this.generator.next(o).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){let n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(io.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Ao(this.currentTime))}play(){if(this.isStopped)return;let{driver:t=YD,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),this.options.onPlay?.();let o=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=o):this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime||(this.startTime=n??o),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(io.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}});function t3(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var n3=O(()=>{});function $b(e){return e.includes("scale")?1:0}function Nb(e,t){if(!e||e==="none")return $b(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),o,i;if(n)o=dU,i=n;else{let s=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);o=cU,i=s}if(!i)return $b(t);let r=o[t],a=i[1].split(",").map(uU);return typeof r=="function"?r(a):a[r]}function uU(e){return parseFloat(e.trim())}var Yl,Pk,cU,Bk,o3,i3,r3,dU,a3,Vk=O(()=>{Yl=e=>e*180/Math.PI,Pk=e=>{let t=Yl(Math.atan2(e[1],e[0]));return Bk(t)},cU={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Pk,rotateZ:Pk,skewX:e=>Yl(Math.atan(e[1])),skewY:e=>Yl(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Bk=e=>(e=e%360,e<0&&(e+=360),e),o3=Pk,i3=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),r3=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),dU={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:i3,scaleY:r3,scale:e=>(i3(e)+r3(e))/2,rotateX:e=>Bk(Yl(Math.atan2(e[6],e[5]))),rotateY:e=>Bk(Yl(Math.atan2(-e[2],e[0]))),rotateZ:o3,rotate:o3,skewX:e=>Yl(Math.atan(e[4])),skewY:e=>Yl(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};a3=(e,t)=>{let{transform:n="none"}=getComputedStyle(e);return Nb(n,t)}});var Zr,er,Sr=O(()=>{Zr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],er=new Set([...Zr,"pathRotation"])});function s3(e){let t=[];return fU.forEach(n=>{let o=e.getValue(n);o!==void 0&&(t.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))}),t}var Uk,pU,fU,Ka,qk=O(()=>{Vk();Sr();js();Il();Uk=e=>e===Yr||e===Ge,pU=new Set(["x","y","z"]),fU=Zr.filter(e=>!pU.has(e));Ka={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:o})=>{let i=e.max-e.min;return o==="border-box"?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:o})=>{let i=e.max-e.min;return o==="border-box"?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Nb(t,"x"),y:(e,{transform:t})=>Nb(t,"y")};Ka.translateX=Ka.x;Ka.translateY=Ka.y});function l3(){if(Ik){let e=Array.from(Xl).filter(o=>o.needsMeasurement),t=new Set(e.map(o=>o.element)),n=new Map;t.forEach(o=>{let i=s3(o);i.length&&(n.set(o,i),o.render())}),e.forEach(o=>o.measureInitialState()),t.forEach(o=>{o.render();let i=n.get(o);i&&i.forEach(([r,a])=>{o.getValue(r)?.set(a)})}),e.forEach(o=>o.measureEndState()),e.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}Ik=!1,Kk=!1,Xl.forEach(e=>e.complete(Gk)),Xl.clear()}function c3(){Xl.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ik=!0)})}function d3(){Gk=!0,c3(),l3(),Gk=!1}var Xl,Kk,Ik,Gk,Is,jb=O(()=>{n3();qk();Ns();Xl=new Set,Kk=!1,Ik=!1,Gk=!1;Is=class{constructor(t,n,o,i,r,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=o,this.motionValue=i,this.element=r,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Xl.add(this),Kk||(Kk=!0,Mo.read(c3),Mo.resolveKeyframes(l3))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:n,element:o,motionValue:i}=this;if(t[0]===null){let r=i?.get(),a=t[t.length-1];if(r!==void 0)t[0]=r;else if(o&&n){let s=o.readValue(n,a);s!=null&&(t[0]=s)}t[0]===void 0&&(t[0]=a),i&&r===void 0&&i.set(t[0])}t3(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Xl.delete(this)}cancel(){this.state==="scheduled"&&(Xl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}});var u3,p3=O(()=>{u3=e=>e.startsWith("--")});function Pb(e,t,n){u3(t)?e.style.setProperty(t,n):e.style[t]=n}var Fk=O(()=>{p3()});var f3,m3=O(()=>{f3={}});function Bb(e,t){let n=uf(e);return()=>f3[t]??n()}var Yk=O(()=>{At();m3()});var g3,h3=O(()=>{Yk();g3=Bb(()=>window.ScrollTimeline!==void 0,"scrollTimeline")});var Vb,Xk=O(()=>{Yk();Vb=Bb(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing")});var Wl,Wk=O(()=>{Wl=([e,t,n,o])=>`cubic-bezier(${e}, ${t}, ${n}, ${o})`});var Zk,b3=O(()=>{Wk();Zk={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wl([0,.65,.55,1]),circOut:Wl([.55,0,1,.45]),backIn:Wl([.31,.01,.66,-.59]),backOut:Wl([.33,1.53,.69,.99])}});function Qk(e,t){if(e)return typeof e=="function"?Vb()?Lb(e,t):"ease-out":vf(e)?Wl(e):Array.isArray(e)?e.map(n=>Qk(n,t)||Zk.easeOut):Zk[e]}var y3=O(()=>{At();Xk();Ck();Wk();b3()});function x3(e,t,n,{delay:o=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:s="easeOut",times:l}={},c=void 0){let u={[t]:n};l&&(u.offset=l);let d=Qk(s,i);Array.isArray(d)&&(u.easing=d);let p={delay:o,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:r+1,direction:a==="reverse"?"alternate":"normal"};return c&&(p.pseudoElement=c),e.animate(u,p)}var v3=O(()=>{y3()});function Zl(e){return typeof e=="function"&&"applyToOptions"in e}var Ub=O(()=>{});function w3({type:e,...t}){return Zl(e)&&Vb()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}var E3=O(()=>{Xk();Ub()});var Kd,Jk=O(()=>{At();Fk();h3();Df();zb();v3();E3();Kd=class extends Ks{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;let{element:n,name:o,keyframes:i,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:s,onComplete:l}=t;this.isPseudoElement=!!r,this.allowFlatten=a,this.options=t,ii(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let c=w3(t);this.animation=x3(n,o,i,c,r),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){let u=qs(i,this.options,s,this.speed);this.updateMotionValue&&this.updateMotionValue(u),Pb(n,o,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){let t=this.animation.effect?.getComputedTiming?.().duration||0;return Ao(Number(t))}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+Ao(t)}get time(){return Ao(Number(this.animation.currentTime)||0)}set time(t){let n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=eo(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:o,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&g3()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),o&&(this.animation.rangeEnd=o),Ai):i(this)}}});function mU(e){return e in k3}function S3(e){typeof e.ease=="string"&&mU(e.ease)&&(e.ease=k3[e.ease])}var k3,T3=O(()=>{At();k3={anticipate:mf,backInOut:ff,circInOut:hf}});var eS,qb,A3=O(()=>{At();Kl();Fk();Ob();Jk();jk();T3();eS=10,qb=class extends Kd{constructor(t){S3(t),Hb(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){let{motionValue:n,onUpdate:o,onComplete:i,element:r,...a}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}let s=new qa({...a,autoplay:!1}),l=Math.max(eS,io.now()-this.startTime),c=jo(0,eS,l-eS),u=s.sample(l).value,{name:d}=this.options;r&&d&&Pb(r,d,u),n.setWithVelocity(s.sample(Math.max(0,l-c)).value,u,c),s.stop()}}});var tS,M3=O(()=>{Wr();tS=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ro.test(e)||e==="0")&&!e.startsWith("url("))});function gU(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function C3(e,t,n,o){let i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;let r=e[e.length-1],a=tS(i,t),s=tS(r,t);return Er(a===s,`You are trying to animate ${t} from "${i}" to "${r}". "${a?r:i}" is not an animatable value.`,"value-not-animatable"),!a||!s?!1:gU(e)||(n==="spring"||Zl(n))&&o}var L3=O(()=>{At();Ub();M3()});function Rf(e){e.duration=0,e.type="keyframes"}var nS=O(()=>{});var Kb,oS=O(()=>{Kb=new Set(["opacity","clipPath","filter","transform","backgroundColor"])});function _3(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&hU.test(e[t]))return!0;return!1}var hU,D3=O(()=>{hU=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/});function R3(e){let{motionValue:t,name:n,repeatDelay:o,repeatType:i,damping:r,type:a,keyframes:s}=e,l=t?.owner?.current;if(!(l instanceof HTMLElement)&&!(l instanceof SVGElement))return!1;let{onUpdate:c,transformTemplate:u}=t.owner.getProps();return yU()&&n&&(Kb.has(n)||bU.has(n)&&_3(s))&&(n!=="transform"||!u)&&!c&&!o&&i!=="mirror"&&r!==0&&a!=="inertia"}var bU,yU,H3=O(()=>{At();oS();D3();bU=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),yU=uf(()=>Object.hasOwnProperty.call(Element.prototype,"animate"))});var xU,Ib,z3=O(()=>{At();Kl();Ob();Df();jb();A3();L3();nS();zb();H3();xU=40,Ib=class extends Ks{constructor({autoplay:t=!0,delay:n=0,type:o="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:a="loop",keyframes:s,name:l,motionValue:c,element:u,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=io.now();let p={autoplay:t,delay:n,type:o,repeat:i,repeatDelay:r,repeatType:a,name:l,motionValue:c,element:u,...d},g=u?.KeyframeResolver||Is;this.keyframeResolver=new g(s,(y,v,x)=>this.onKeyframesResolved(y,v,p,!x),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,o,i){this.keyframeResolver=void 0;let{name:r,type:a,velocity:s,delay:l,isHandoff:c,onUpdate:u}=o;this.resolvedAt=io.now();let d=!0;C3(t,r,a,s)||(d=!1,(Po.instantAnimations||!l)&&u?.(qs(t,o,n)),t[0]=t[t.length-1],Rf(o),o.repeat=0);let g={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>xU?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...o,keyframes:t},y=d&&!c&&R3(g),v=g.motionValue?.owner?.current,x;if(y)try{x=new qb({...g,element:v})}catch{x=new qa(g)}else x=new qa(g);x.finished.then(()=>{this.notifyFinished()}).catch(Ai),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),d3()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}});function O3(e,t){let n=0;for(let o=0;o<e.length;o++){let i=e[o][t];i!==null&&i>n&&(n=i)}return n}var Gb,$3=O(()=>{Gb=class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let o=0;o<this.animations.length;o++)this.animations[o][t]=n}attachTimeline(t){let n=this.animations.map(o=>o.attachTimeline(t));return()=>{n.forEach((o,i)=>{o&&o(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return O3(this.animations,"duration")}get iterationDuration(){return O3(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(n=>n[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}});var Hf,N3=O(()=>{$3();Hf=class extends Gb{then(t,n){return this.finished.finally(t).then(()=>{})}}});function tr(e,t){return new Fb(e,t)}var j3,vU,iS,Fb,Id=O(()=>{At();Kl();Ns();j3=30,vU=e=>!isNaN(parseFloat(e)),iS={current:void 0},Fb=class{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=o=>{let i=io.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=io.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=vU(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Ul);let o=this.events[t].add(n);return t==="change"?()=>{o(),Mo.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,o){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-o}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return iS.current&&iS.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=io.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>j3)return 0;let n=Math.min(this.updatedAt-this.prevUpdatedAt,j3);return pf(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}});function Yb(e,t){if(e?.inherit&&t){let{inherit:n,...o}=e;return{...t,...o}}return e}var rS=O(()=>{});function Xb(e,t){let n=e?.[t]??e?.default??e;return n!==e?Yb(n,e):n}var aS=O(()=>{rS()});var wU,EU,kU,SU,P3,B3=O(()=>{Sr();wU={type:"spring",stiffness:500,damping:25,restSpeed:10},EU=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),kU={type:"keyframes",duration:.8},SU={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},P3=(e,{keyframes:t})=>t.length>2?kU:er.has(e)?e.startsWith("scale")?EU(t[1]):wU:SU});function V3(e){for(let t in e)if(!TU.has(t))return!0;return!1}var TU,U3=O(()=>{TU=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"])});var Wb,sS=O(()=>{At();z3();Ob();aS();nS();B3();Df();U3();Ns();Wb=(e,t,n,o={},i,r)=>a=>{let s=Xb(o,e)||{},l=s.delay||o.delay||0,{elapsed:c=0}=o;c=c-eo(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:p=>{t.set(p),s.onUpdate&&s.onUpdate(p)},onComplete:()=>{a(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:r?void 0:i};V3(s)||Object.assign(u,P3(e,u)),u.duration&&(u.duration=eo(u.duration)),u.repeatDelay&&(u.repeatDelay=eo(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Rf(u),u.delay===0&&(d=!0)),(Po.instantAnimations||Po.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,Rf(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!r&&t.get()!==void 0){let p=qs(u.keyframes,s);if(p!==void 0){Mo.update(()=>{u.onUpdate(p),u.onComplete()});return}}return s.isSync?new qa(u):new Ib(u)}});function MU(e){let t=AU.exec(e);if(!t)return[,];let[,n,o,i]=t;return[`--${n??o}`,i]}function lS(e,t,n=1){ii(n<=CU,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[o,i]=MU(e);if(!o)return;let r=window.getComputedStyle(t).getPropertyValue(o);if(r){let a=r.trim();return cf(a)?parseFloat(a):a}return jd(i)?lS(i,t,n+1):i}var AU,CU,q3=O(()=>{At();Pd();AU=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;CU=4});function K3(e){let t=[{},{}];return e?.values.forEach((n,o)=>{t[0][o]=n.get(),t[1][o]=n.getVelocity()}),t}function Zb(e,t,n,o){if(typeof t=="function"){let[i,r]=K3(o);t=t(n!==void 0?n:e.custom,i,r)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[i,r]=K3(o);t=t(n!==void 0?n:e.custom,i,r)}return t}var cS=O(()=>{});function I3(e,t,n){let o=e.getProps();return Zb(o,t,n!==void 0?n:o.custom,e)}var G3=O(()=>{cS()});var Qb,dS=O(()=>{Sr();Qb=new Set(["width","height","top","left","right","bottom",...Zr])});var F3,Y3=O(()=>{F3=e=>Array.isArray(e)});function LU(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,tr(n))}function _U(e){return F3(e)?e[e.length-1]||0:e}function X3(e,t){let n=I3(e,t),{transitionEnd:o={},transition:i={},...r}=n||{};r={...r,...o};for(let a in r){let s=_U(r[a]);LU(e,a,s)}}var W3=O(()=>{Id();G3();Y3()});var xn,Ia=O(()=>{xn=e=>!!(e&&e.getVelocity)});function Z3(e){return!!(xn(e)&&e.add)}var Q3=O(()=>{Ia()});function J3(e,t){let n=e.getValue("willChange");if(Z3(n))return n.add(t);if(!n&&Po.WillChange){let o=new Po.WillChange("auto");e.addValue("willChange",o),o.add(t)}}var e8=O(()=>{At();Q3()});function Gd(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Jb=O(()=>{});var DU,t8,n8=O(()=>{Jb();DU="framerAppearId",t8="data-"+Gd(DU)});function o8(e){return e.props[t8]}var i8=O(()=>{n8()});function RU({protectedKeys:e,needsAnimating:t},n){let o=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,o}function uS(e,t,{delay:n=0,transitionOverride:o,type:i}={}){let{transition:r,transitionEnd:a,...s}=t,l=e.getDefaultTransition();r=r?Yb(r,l):l;let c=r?.reduceMotion,u=r?.skipAnimations;o&&(r=o);let d=[],p=i&&e.animationState&&e.animationState.getState()[i],g=r?.path;g&&g.animateVisualElement(e,s,r,n,d);for(let y in s){let v=e.getValue(y,e.latestValues[y]??null),x=s[y];if(x===void 0||p&&RU(p,y))continue;let h={delay:n,...Xb(r||{},y)};u&&(h.skipAnimations=!0);let m=v.get();if(m!==void 0&&!v.isAnimating()&&!Array.isArray(x)&&x===m&&!h.velocity){Mo.update(()=>v.set(x));continue}let b=!1;if(window.MotionHandoffAnimation){let A=o8(e);if(A){let _=window.MotionHandoffAnimation(A,y,Mo);_!==null&&(h.startTime=_,b=!0)}}J3(e,y);let E=c??e.shouldReduceMotion;v.start(Wb(y,v,x,E&&Qb.has(y)?{type:!1}:h,e,b));let S=v.animation;S&&d.push(S)}if(a){let y=()=>Mo.update(()=>{a&&X3(e,a)});d.length?Promise.all(d).then(y):y()}return d}var r8=O(()=>{aS();rS();dS();W3();e8();i8();sS();Ns()});var a8,s8=O(()=>{a8={test:e=>e==="auto",parse:e=>e}});var ey,pS=O(()=>{ey=e=>t=>t.test(e)});var fS,mS,gS=O(()=>{s8();js();Il();pS();fS=[Yr,Ge,Bs,kr,HD,RD,a8],mS=e=>fS.find(ey(e))});function l8(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||df(e):!0}var c8=O(()=>{At()});function zU(e){let[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[o]=n.match(Bd)||[];if(!o)return e;let i=n.replace(o,""),r=HU.has(t)?1:0;return o!==n&&(r*=100),t+"("+r+i+")"}var HU,OU,zf,hS=O(()=>{Wr();Eb();HU=new Set(["brightness","contrast","saturate","opacity"]);OU=/\b([a-z-]*)\(.*?\)/gu,zf={...ro,getAnimatableNone:e=>{let t=e.match(OU);return t?t.map(zU).join(" "):e}}});var Of,bS=O(()=>{Wr();Of={...ro,getAnimatableNone:e=>{let t=ro.parse(e);return ro.createTransformer(e)(t.map(o=>typeof o=="number"?0:typeof o=="object"?{...o,alpha:1}:o))}}});var yS,d8=O(()=>{js();yS={...Yr,transform:Math.round}});var u8,p8=O(()=>{js();Il();u8={rotate:kr,pathRotation:kr,rotateX:kr,rotateY:kr,rotateZ:kr,scale:kf,scaleX:kf,scaleY:kf,scaleZ:kf,skew:kr,skewX:kr,skewY:kr,distance:Ge,translateX:Ge,translateY:Ge,translateZ:Ge,x:Ge,y:Ge,z:Ge,perspective:Ge,transformPerspective:Ge,opacity:Va,originX:wk,originY:wk,originZ:Ge}});var Ql,ty=O(()=>{d8();js();Il();p8();Ql={borderWidth:Ge,borderTopWidth:Ge,borderRightWidth:Ge,borderBottomWidth:Ge,borderLeftWidth:Ge,borderRadius:Ge,borderTopLeftRadius:Ge,borderTopRightRadius:Ge,borderBottomRightRadius:Ge,borderBottomLeftRadius:Ge,width:Ge,maxWidth:Ge,height:Ge,maxHeight:Ge,top:Ge,right:Ge,bottom:Ge,left:Ge,inset:Ge,insetBlock:Ge,insetBlockStart:Ge,insetBlockEnd:Ge,insetInline:Ge,insetInlineStart:Ge,insetInlineEnd:Ge,padding:Ge,paddingTop:Ge,paddingRight:Ge,paddingBottom:Ge,paddingLeft:Ge,paddingBlock:Ge,paddingBlockStart:Ge,paddingBlockEnd:Ge,paddingInline:Ge,paddingInlineStart:Ge,paddingInlineEnd:Ge,margin:Ge,marginTop:Ge,marginRight:Ge,marginBottom:Ge,marginLeft:Ge,marginBlock:Ge,marginBlockStart:Ge,marginBlockEnd:Ge,marginInline:Ge,marginInlineStart:Ge,marginInlineEnd:Ge,fontSize:Ge,backgroundPositionX:Ge,backgroundPositionY:Ge,...u8,zIndex:yS,fillOpacity:Va,strokeOpacity:Va,numOctaves:yS}});var $U,ny,xS=O(()=>{Af();hS();bS();ty();$U={...Ql,color:Tn,backgroundColor:Tn,outlineColor:Tn,fill:Tn,stroke:Tn,borderColor:Tn,borderTopColor:Tn,borderRightColor:Tn,borderBottomColor:Tn,borderLeftColor:Tn,filter:zf,WebkitFilter:zf,mask:Of,WebkitMask:Of},ny=e=>$U[e]});function oy(e,t){let n=ny(e);return NU.has(n)||(n=ro),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var NU,vS=O(()=>{Wr();hS();bS();xS();NU=new Set([zf,Of])});function f8(e,t,n){let o=0,i;for(;o<e.length&&!i;){let r=e[o];typeof r=="string"&&!jU.has(r)&&Us(r).values.length&&(i=e[o]),o++}if(i&&n)for(let r of t)e[r]=oy(n,i)}var jU,m8=O(()=>{Wr();vS();jU=new Set(["auto","none","0"])});var iy,g8=O(()=>{dS();gS();q3();Pd();jb();c8();m8();qk();iy=class extends Is{constructor(t,n,o,i,r){super(t,n,o,i,r,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:n,name:o}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let d=t[u];if(typeof d=="string"&&(d=d.trim(),jd(d))){let p=lS(d,n.current);p!==void 0&&(t[u]=p),u===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!Qb.has(o)||t.length!==2)return;let[i,r]=t,a=mS(i),s=mS(r),l=yk(i),c=yk(r);if(l!==c&&Ka[o]){this.needsMeasurement=!0;return}if(a!==s)if(Uk(a)&&Uk(s))for(let u=0;u<t.length;u++){let d=t[u];typeof d=="string"&&(t[u]=parseFloat(d))}else Ka[o]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:n}=this,o=[];for(let i=0;i<t.length;i++)(t[i]===null||l8(t[i]))&&o.push(i);o.length&&f8(t,o,n)}measureInitialState(){let{element:t,unresolvedKeyframes:n,name:o}=this;if(!t||!t.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ka[o](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;let i=n[n.length-1];i!==void 0&&t.getValue(o,i).jump(i,!1)}measureEndState(){let{element:t,name:n,unresolvedKeyframes:o}=this;if(!t||!t.current)return;let i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);let r=o.length-1,a=o[r];o[r]=Ka[n](t.measureViewportBox(),window.getComputedStyle(t.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([s,l])=>{t.getValue(s).set(l)}),this.resolveNoneKeyframes()}}});var h8,b8=O(()=>{h8=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"]});function wS(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let o=document;t&&(o=t.current);let i=n?.[e]??o.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(o=>o!=null)}var y8=O(()=>{});var $f,ES=O(()=>{$f=(e,t)=>t&&typeof e=="number"?t.transform(e):e});var x8,Ote,v8=O(()=>{bk();({schedule:x8,cancel:Ote}=yb(queueMicrotask,!1))});function Nf(e){return sk(e)&&"ownerSVGElement"in e}var kS=O(()=>{At()});function SS(e){return Nf(e)&&e.tagName==="svg"}var w8=O(()=>{kS()});var PU,E8,k8=O(()=>{Af();Wr();gS();pS();PU=[...fS,Tn,ro],E8=e=>PU.find(ey(e))});var S8,Fd,ry=O(()=>{S8=()=>({min:0,max:0}),Fd=()=>({x:S8(),y:S8()})});var Ga,TS=O(()=>{Ga=new WeakMap});function T8(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}var A8=O(()=>{});function M8(e){return typeof e=="string"||Array.isArray(e)}var C8=O(()=>{});var BU,L8,_8=O(()=>{BU=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],L8=["initial",...BU]});function AS(e){return T8(e.animate)||L8.some(t=>M8(e[t]))}function D8(e){return!!(AS(e)||e.variants)}var R8=O(()=>{A8();C8();_8()});function H8(e,t,n){for(let o in t){let i=t[o],r=n[o];if(xn(i))e.addValue(o,i);else if(xn(r))e.addValue(o,tr(i,{owner:e}));else if(r!==i)if(e.hasValue(o)){let a=e.getValue(o);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{let a=e.getStaticValue(o);e.addValue(o,tr(a!==void 0?a:i,{owner:e}))}}for(let o in n)t[o]===void 0&&e.removeValue(o);return t}var z8=O(()=>{Id();Ia()});var Gs,Jl,ay=O(()=>{Gs={current:null},Jl={current:!1}});function jf(){if(Jl.current=!0,!!VU)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Gs.current=e.matches;e.addEventListener("change",t),t()}else Gs.current=!1}var VU,MS=O(()=>{ay();VU=typeof window<"u"});var O8,$8,Yd,CS=O(()=>{At();jb();Jk();oS();v8();Kl();ry();Id();Wr();vS();k8();Ia();TS();R8();Sr();z8();MS();cS();ay();Ns();O8=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],$8={},Yd=class{scrapeMotionValuesFromProps(t,n,o){return{}}constructor({parent:t,props:n,presenceContext:o,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:a,visualState:s},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Is,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let g=io.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,Mo.render(this.render,!1,!0))};let{latestValues:c,renderState:u}=s;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=o,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=AS(n),this.isVariantNode=D8(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:d,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(let g in p){let y=p[g];c[g]!==void 0&&xn(y)&&y.set(c[g])}}mount(t){if(this.hasBeenMounted)for(let n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,Ga.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,o)=>this.bindToMotionValue(o,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Jl.current||jf(),this.shouldReduceMotion=Gs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Ef(this.notifyUpdate),Ef(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let t in this.events)this.events[t].clear();for(let t in this.features){let n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Kb.has(t)&&this.current instanceof HTMLElement){let{factory:a,keyframes:s,times:l,ease:c,duration:u}=n.accelerate,d=new Kd({element:this.current,name:t,keyframes:s,times:l,ease:c,duration:eo(u)}),p=a(d);this.valueSubscriptions.set(t,()=>{p(),d.cancel()});return}let o=er.has(t);o&&this.onBindTransform&&this.onBindTransform();let i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Mo.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),r&&r()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in $8){let n=$8[t];if(!n)continue;let{isEnabled:o,Feature:i}=n;if(!this.features[t]&&i&&o(this.props)&&(this.features[t]=new i(this)),this.features[t]){let r=this.features[t];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Fd()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let o=0;o<O8.length;o++){let i=O8[o];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);let r="on"+i,a=t[r];a&&(this.propEventSubscriptions[i]=this.on(i,a))}this.prevMotionValues=H8(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){let n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){let o=this.values.get(t);n!==o&&(o&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);let n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let o=this.values.get(t);return o===void 0&&n!==void 0&&(o=tr(n===null?void 0:n,{owner:this}),this.addValue(t,o)),o}readValue(t,n){let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(cf(o)||df(o))?o=parseFloat(o):!E8(o)&&ro.test(n)&&(o=oy(t,n)),this.setBaseTarget(t,xn(o)?o.get():o)),xn(o)?o.get():o}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){let{initial:n}=this.props,o;if(typeof n=="string"||typeof n=="object"){let r=Zb(this.props,n,this.presenceContext?.custom);r&&(o=r[t])}if(n&&o!==void 0)return o;let i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!xn(i)?i:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ul),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){x8.render(this.render)}}});var Xd,LS=O(()=>{Ia();g8();CS();Xd=class extends Yd{constructor(){super(...arguments),this.KeyframeResolver=iy}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){let o=t.style;return o?o[n]:void 0}removeValueFromRenderState(t,{vars:n,style:o}){delete n[t],delete o[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;xn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}});function N8({top:e,left:t,right:n,bottom:o}){return{x:{min:t,max:n},y:{min:e,max:o}}}function j8(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),o=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:o.y,right:o.x}}var P8=O(()=>{});function B8(e,t){return N8(j8(e.getBoundingClientRect(),t))}var V8=O(()=>{P8()});function U8(e,t,n){let o="",i=!0;for(let a=0;a<qU;a++){let s=Zr[a],l=e[s];if(l===void 0)continue;let c=!0;if(typeof l=="number")c=l===(s.startsWith("scale")?1:0);else{let u=parseFloat(l);c=s.startsWith("scale")?u===1:u===0}if(!c||n){let u=$f(l,Ql[s]);if(!c){i=!1;let d=UU[s]||s;o+=`${d}(${u}) `}n&&(t[s]=u)}}let r=e.pathRotation;return r&&(i=!1,o+=`rotate(${$f(r,Ql.pathRotation)}) `),o=o.trim(),n?o=n(t,i?"":o):i&&(o="none"),o}var UU,qU,q8=O(()=>{ES();ty();Sr();UU={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},qU=Zr.length});function sy(e,t,n){let{style:o,vars:i,transformOrigin:r}=e,a=!1,s=!1;for(let l in t){let c=t[l];if(er.has(l)){a=!0;continue}else if(vb(l)){i[l]=c;continue}else{let u=$f(c,Ql[l]);l.startsWith("origin")?(s=!0,r[l]=u):o[l]=u}}if(t.transform||(a||n?o.transform=U8(t,e.transform,n):o.transform&&(o.transform="none")),s){let{originX:l="50%",originY:c="50%",originZ:u=0}=r;o.transformOrigin=`${l} ${c} ${u}`}}var _S=O(()=>{ES();ty();Sr();Pd();q8()});function ly(e,{style:t,vars:n},o,i){let r=e.style,a;for(a in t)r[a]=t[a];i?.applyProjectionStyles(r,o);for(a in n)r.setProperty(a,n[a])}var DS=O(()=>{});function K8(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Wd,I8=O(()=>{Il();Wd={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ge.test(e))e=parseFloat(e);else return e;let n=K8(e,t.target.x),o=K8(e,t.target.y);return`${n}% ${o}%`}}});var G8,F8=O(()=>{Wr();Gl();G8={correct:(e,{treeScale:t,projectionDelta:n})=>{let o=e,i=ro.parse(e);if(i.length>5)return o;let r=ro.createTransformer(e),a=typeof i[0]!="number"?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;i[0+a]/=s,i[1+a]/=l;let c=Mi(s,l,.5);return typeof i[2+a]=="number"&&(i[2+a]/=c),typeof i[3+a]=="number"&&(i[3+a]/=c),r(i)}}});var Y8,X8=O(()=>{b8();I8();F8();Y8={borderRadius:{...Wd,applyTo:[...h8]},borderTopLeftRadius:Wd,borderTopRightRadius:Wd,borderBottomLeftRadius:Wd,borderBottomRightRadius:Wd,boxShadow:G8}});function W8(e,{layout:t,layoutId:n}){return er.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Y8[e]||e==="opacity")}var Z8=O(()=>{Sr();X8()});function cy(e,t,n){let o=e.style,i=t?.style,r={};if(!o)return r;for(let a in o)(xn(o[a])||i&&xn(i[a])||W8(a,e)||n?.getValue(a)?.liveStyle!==void 0)&&(r[a]=o[a]);return r}var RS=O(()=>{Ia();Z8()});function KU(e){return window.getComputedStyle(e)}var Pf,Q8=O(()=>{At();Pd();Sr();Vk();V8();LS();_S();DS();RS();Pf=class extends Xd{constructor(){super(...arguments),this.type="html",this.renderInstance=ly}mount(t){ii(!!t.style,"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,n){if(er.has(n))return this.projection?.isProjecting?$b(n):a3(t,n);{let o=KU(t),i=(vb(n)?o.getPropertyValue(n):o[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return B8(t,n)}build(t,n,o){sy(t,n,o.transformTemplate)}scrapeMotionValuesFromProps(t,n,o){return cy(t,n,o)}}});function IU(e,t){return e in t}var Bf,J8=O(()=>{ry();CS();Bf=class extends Yd{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(IU(n,t)){let o=t[n];if(typeof o=="string"||typeof o=="number")return o}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return Fd()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}}});function eR(e,t,n=1,o=0,i=!0){e.pathLength=1;let r=i?GU:FU;e[r.offset]=`${-o}`,e[r.array]=`${t} ${n}`}var GU,FU,tR=O(()=>{GU={offset:"stroke-dashoffset",array:"stroke-dasharray"},FU={offset:"strokeDashoffset",array:"strokeDasharray"}});function nR(e,{attrX:t,attrY:n,attrScale:o,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...s},l,c,u){if(sy(e,s,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:p}=e;d.transform&&(p.transform=d.transform,delete d.transform),(p.transform||d.transformOrigin)&&(p.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),p.transform&&(p.transformBox=u?.transformBox??"fill-box",delete d.transformBox);for(let g of YU)d[g]!==void 0&&(p[g]=d[g],delete d[g]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),o!==void 0&&(d.scale=o),i!==void 0&&eR(d,i,r,a,!1)}var YU,oR=O(()=>{_S();tR();YU=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"]});var dy,HS=O(()=>{dy=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"])});var iR,rR=O(()=>{iR=e=>typeof e=="string"&&e.toLowerCase()==="svg"});function aR(e,t,n,o){ly(e,t,void 0,o);for(let i in t.attrs)e.setAttribute(dy.has(i)?i:Gd(i),t.attrs[i])}var sR=O(()=>{Jb();DS();HS()});function lR(e,t,n){let o=cy(e,t,n);for(let i in e)if(xn(e[i])||xn(t[i])){let r=Zr.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;o[r]=e[i]}return o}var cR=O(()=>{Ia();Sr();RS()});var Vf,dR=O(()=>{Sr();xS();ry();LS();Jb();oR();HS();rR();sR();cR();Vf=class extends Xd{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Fd}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(er.has(n)){let o=ny(n);return o&&o.default||0}return n=dy.has(n)?n:Gd(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,o){return lR(t,n,o)}build(t,n,o){nR(t,n,this.isSVGTag,o.transformTemplate,o.style)}renderInstance(t,n,o,i){aR(t,n,o,i)}mount(t){this.isSVGTag=iR(t.tagName),super.mount(t)}}});function zS(e,t,n){let o=xn(e)?e:tr(e);return o.start(Wb("",o,t,n)),o.animation}var uR=O(()=>{sS();Id();Ia()});var Tr=O(()=>{N3();r8();Db();_k();Ub();$k();Ok();kS();w8();Gl();y8();Id();Ia();Q8();J8();TS();dR();MS();uR();ay()});function Uf(e){return typeof e=="object"&&!Array.isArray(e)}var OS=O(()=>{});function uy(e,t,n,o){return e==null?[]:typeof e=="string"&&Uf(t)?wS(e,n,o):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(i=>i!=null):[e]}var $S=O(()=>{Tr();OS()});function pR(e,t,n){return e*(t+1)+n*t}var fR=O(()=>{});function NS(e,t,n,o){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?n:t.startsWith("<")?Math.max(0,n+parseFloat(t.slice(1))):o.get(t)??e}var mR=O(()=>{});function XU(e,t,n){for(let o=0;o<e.length;o++){let i=e[o];i.at>t&&i.at<n&&(Pl(e,i),o--)}}function gR(e,t,n,o,i,r){XU(e,i,r);for(let a=0;a<t.length;a++)e.push({value:t[a],at:Mi(i,r,o[a]),easing:xf(n,a)})}var hR=O(()=>{Tr();At()});function bR(e,t,n=0){let o=t+1+t*n;for(let i=0;i<e.length;i++)e[i]=e[i]/o}var yR=O(()=>{});function xR(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var vR=O(()=>{});function kR(e,{defaultTransition:t={},...n}={},o,i){let r=t.duration||.3,a=new Map,s=new Map,l={},c=new Map,u=0,d=0,p=0;for(let g=0;g<e.length;g++){let y=e[g];if(typeof y=="string"){c.set(y,d);continue}else if(!Array.isArray(y)){c.set(y.name,NS(d,y.at,u,c));continue}let[v,x,h={}]=y;h.at!==void 0&&(d=NS(d,h.at,u,c));let m=0,b=(E,S,A,_=0,T=0)=>{let H=ZU(E),{delay:R=0,times:z=_f(H),type:F=t.type||"keyframes",repeat:B,repeatType:le,repeatDelay:J=0,...V}=S,{ease:oe=t.ease||"easeOut",duration:ue}=S,q=typeof R=="function"?R(_,T):R,Y=H.length,W=Zl(F)?F:i?.[F||"keyframes"];if(Y<=2&&W){let G=100;if(Y===2&&eq(H)){let pe=H[1]-H[0];G=Math.abs(pe)}let te={...t,...V};ue!==void 0&&(te.duration=eo(ue));let ie=Mf(te,G,W);oe=ie.ease,ue=ie.duration}ue??(ue=r);let C=d+q;z.length===1&&z[0]===0&&(z[1]=1);let U=z.length-H.length;if(U>0&&Lf(z,U),H.length===1&&H.unshift(null),B&&Er(B<jS,`Sequence segments can't repeat ${B} times \u2014 ignoring repeat option. Use a value below ${jS} or apply repeat at the sequence level instead.`),B&&B<jS){let G=ue>0?J/ue:0;ue=pR(ue,B,J);let te=[...H],ie=[...z];oe=Array.isArray(oe)?[...oe]:[oe];let pe=[...oe],xe=le==="reverse"||le==="mirror",L=te,Q=pe;xe&&(L=[...te].reverse(),le==="reverse"&&(Q=[...pe].reverse().map(Z=>typeof Z=="function"?ql(Z):Z)));for(let Z=0;Z<B;Z++){let ae=xe&&Z%2===0,we=ae?L:te,Te=ae?Q:pe,$=(Z+1)*(1+G);G>0&&(H.push(H[H.length-1]),z.push($),oe.push("linear")),H.push(...we);for(let D=0;D<we.length;D++)z.push(ie[D]+$),oe.push(D===0?"linear":xf(Te,D-1))}bR(z,B,G)}let I=C+ue;gR(A,H,oe,z,C,I),m=Math.max(q+ue,m),p=Math.max(I,p)};if(xn(v)){let E=wR(v,s);b(x,h,ER("default",E))}else{let E=uy(v,x,o,l),S=E.length;for(let A=0;A<S;A++){x=x,h=h;let _=E[A],T=wR(_,s);for(let H in x)b(x[H],QU(h,H),ER(H,T),A,S)}}u=d,d+=m}return s.forEach((g,y)=>{for(let v in g){let x=g[v];x.sort(xR);let h=[],m=[],b=[];for(let _=0;_<x.length;_++){let{at:T,value:H,easing:R}=x[_];h.push(H),m.push(Vl(0,p,T)),b.push(R||"easeOut")}m[0]!==0&&(m.unshift(0),h.unshift(h[0]),b.unshift(WU)),m[m.length-1]!==1&&(m.push(1),h.push(null)),a.has(y)||a.set(y,{keyframes:{},transition:{}});let E=a.get(y);E.keyframes[v]=h;let{type:S,...A}=t;E.transition[v]={...A,duration:p,ease:b,times:m,...n}}}),a}function wR(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function ER(e,t){return t[e]||(t[e]=[]),t[e]}function ZU(e){return Array.isArray(e)?e:[e]}function QU(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var WU,jS,JU,eq,SR=O(()=>{Tr();At();$S();fR();mR();hR();yR();vR();WU="easeInOut",jS=20;JU=e=>typeof e=="number",eq=e=>e.every(JU)});function TR(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Nf(e)&&!SS(e)?new Vf(t):new Pf(t);n.mount(e),Ga.set(e,n)}function AR(e){let t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new Bf(t);n.mount(e),Ga.set(e,n)}var MR=O(()=>{Tr()});function tq(e,t){return xn(e)||typeof e=="number"||typeof e=="string"&&!Uf(t)}function py(e,t,n,o){let i=[];if(tq(e,t))i.push(zS(e,Uf(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let r=uy(e,t,o),a=r.length;ii(!!a,"No valid elements provided.","no-valid-elements");for(let s=0;s<a;s++){let l=r[s],c=l instanceof Element?TR:AR;Ga.has(l)||c(l);let u=Ga.get(l),d={...n};"delay"in d&&typeof d.delay=="function"&&(d.delay=d.delay(s,a)),i.push(...uS(u,{...t,transition:d},{}))}}return i}var PS=O(()=>{Tr();At();MR();OS();$S()});function CR(e,t,n){let o=[],i=e.map(a=>{if(Array.isArray(a)&&typeof a[0]=="function"){let s=a[0],l=tr(0);return l.on("change",s),a.length===1?[l,[0,1]]:a.length===2?[l,[0,1],a[1]]:[l,a[1],a[2]]}return a});return kR(i,t,n,{spring:Ua}).forEach(({keyframes:a,transition:s},l)=>{o.push(...py(l,a,s))}),o}var LR=O(()=>{Tr();SR();PS()});function nq(e){return Array.isArray(e)&&e.some(Array.isArray)}function _R(e={}){let{scope:t,reduceMotion:n,skipAnimations:o}=e;function i(r,a,s){let l=[],c,u={};if(n!==void 0&&(u.reduceMotion=n),o!==void 0&&(u.skipAnimations=o),nq(r)){let{onComplete:p,...g}=a||{};typeof p=="function"&&(c=p),l=CR(r,{...u,...g},t)}else{let{onComplete:p,...g}=s||{};typeof p=="function"&&(c=p),l=py(r,a,{...u,...g},t)}let d=new Hf(l);return c&&d.finished.then(c),t&&(t.animations.push(d),d.finished.then(()=>{Pl(t.animations,d)})),d}return i}var Ar,DR=O(()=>{Tr();At();LR();PS();Ar=_R()});var RR=O(()=>{Tr();At();DR()});var BS=O(()=>{RR()});var HR={};Ft(HR,{animate:()=>Ar});var zR=O(()=>{"use strict";BS()});function qf(e,t){let n=w("details","comment-menu"),o=w("summary","icon");o.setAttribute("aria-label",e),o.setAttribute("aria-haspopup","menu"),o.setAttribute("aria-expanded","false"),o.title=e,o.append(yt("more"));let i=w("div","comment-menu-items");i.popover="manual",i.setAttribute("role","menu"),i.setAttribute("aria-label",e);let r=t.map(a=>{let s=Oe(a.label,()=>{n.open=!1,o.focus({preventScroll:!0}),a.onSelect()},`menu-action${a.destructive?" destructive":""}`,a.icon);return s.append(w("span","",a.label)),s.setAttribute("role","menuitem"),s.tabIndex=-1,i.append(s),s});return n.addEventListener("toggle",()=>{if(o.setAttribute("aria-expanded",String(n.open)),n.open){i.showPopover();let a=o.getBoundingClientRect();i.style.left=`${Math.max(8,Math.min(a.right-i.offsetWidth,innerWidth-i.offsetWidth-8))}px`,i.style.top=`${Math.max(8,Math.min(a.bottom+6,innerHeight-i.offsetHeight-8))}px`,(r.find(s=>s.getAttribute("aria-checked")==="true")??r[0])?.focus({preventScroll:!0})}else i.hidePopover()}),n.addEventListener("keydown",a=>{if(!n.open)return;let s=r.indexOf(a.target),l;a.key==="ArrowDown"&&(l=(s+1)%r.length),a.key==="ArrowUp"&&(l=(s-1+r.length)%r.length),a.key==="Home"&&(l=0),a.key==="End"&&(l=r.length-1),l!==void 0&&(a.preventDefault(),r[l]?.focus()),a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),n.open=!1,o.focus({preventScroll:!0})),a.key==="Tab"&&(n.open=!1)}),n.append(o,i),n}function ec(e,t,n,o){let i=qf(e,t.map(([a,s])=>({label:s,icon:"check",onSelect:()=>o(a)})));i.classList.add("selection-menu");let r=i.querySelector("summary");return r.className="selection-trigger",r.replaceChildren(w("span","selection-label",t.find(([a])=>a===n)?.[1]),yt("chevron")),i.querySelectorAll("[role=menuitem]").forEach((a,s)=>{a.setAttribute("role","menuitemradio"),a.setAttribute("aria-checked",String(t[s][0]===n))}),i}var qS=O(()=>{"use strict";It()});function Jr(e,t=po()){let n=[e.ctrl&&"Control",e.alt&&"Alt",e.shift&&"Shift",e.meta&&"Meta",iq(e.key)].filter(Boolean),o=t?{Control:"\u2303",Alt:"\u2325",Shift:"\u21E7",Meta:"\u2318"}:{Control:"Ctrl",Meta:"Meta"};return{aria:n.join("+"),spoken:n.map(i=>i==="Meta"&&t?"Command":i==="Alt"&&t?"Option":i).join(" + "),keys:n.map(i=>o[i]??{ArrowLeft:"\u2190",ArrowRight:"\u2192",ArrowUp:"\u2191",ArrowDown:"\u2193",Enter:"\u21B5",Escape:"Esc"}[i]??i)}}function Zd(e,t,n="surface"){let o=Jr(e,t);return Qd(o.keys,o.spoken,n)}function Qd(e,t,n="surface"){let o=document.createElement("span");o.className="palette-kbd",o.dataset.variant=n,o.setAttribute("role","img"),o.setAttribute("aria-label",t);for(let i of e){let r=document.createElement("kbd");r.textContent=i,r.setAttribute("aria-hidden","true"),o.append(r)}return o}var po,oq,iq,ea=O(()=>{"use strict";po=()=>/mac|iphone|ipad/i.test(navigator.userAgentData?.platform||navigator.platform),oq=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter","Escape","Tab","Backspace","Delete","Home","End","PageUp","PageDown"],iq=e=>e.length===1?e.toUpperCase():oq.find(t=>t.toLowerCase()===e.toLowerCase())??e});function PR(e){if(e===void 0)return fy;let t=[],n=[];if(!Array.isArray(e))n.push(e);else for(let o of e)o==="|"||rq.has(o)&&!t.includes(o)?t.push(o):n.push(o);return n.length&&console.warn(`Palette: ignoring invalid or repeated toolbar.items: ${n.map(o=>String(JSON.stringify(o))).join(", ")}.`),Array.isArray(e)?t:fy}function BR(e,t){let n=[];for(let o of e)(o!=="|"?t(o):n.length&&n.at(-1)!=="|")&&n.push(o);return n.at(-1)==="|"&&n.pop(),n}function my(e,t){if(t)return t;let n=e.filter(o=>o.showInBar!==!1).map(o=>o.id);return[...n.filter(o=>o!=="dismiss"),"more",...n.filter(o=>o==="dismiss")]}var rq,fy,gy,hy,by=O(()=>{"use strict";rq=new Set(["browse","comment","design","comments","more","account","dismiss"]),fy=["browse","comment","design","|","comments","|","more","account","|","dismiss"];gy=e=>e>99?"99+":String(e),hy=(e,t)=>t?`${e}, ${t} open comment${t===1?"":"s"}`:e});var FS,YS,VR=O(()=>{FS=kt(Yt(),1),YS=({size:e=24,color:t="currentColor",...n})=>FS.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},FS.createElement("path",{d:"M19 12H5m0 0 7 7m-7-7 7-7"}));YS.displayName="ArrowLeft"});var XS,WS,UR=O(()=>{XS=kt(Yt(),1),WS=({size:e=24,color:t="currentColor",...n})=>XS.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},XS.createElement("path",{d:"m9 18 6-6-6-6"}));WS.displayName="ChevronRight"});function ZS(){!Jl.current&&jf();let[e]=(0,qR.useState)(Gs.current);return e}var qR,KR=O(()=>{"use client";Tr();qR=kt(Yt(),1)});var IR=O(()=>{Tr();KR();At()});var GR=O(()=>{IR()});function YR({items:e,bar:t,defaultActiveId:n,activeId:o,edge:i="bottom",alignEnd:r=!1,onActiveChange:a,label:s="App navigation",moreLabel:l="More",backLabel:c="Back",className:u="",style:d}){let p=(0,Mt.useId)(),[g,y]=(0,Mt.useState)({kind:"collapsed"}),[v,x]=(0,Mt.useState)(n??e[0]?.id),[h,m]=(0,Mt.useState)(null),b=(0,Mt.useRef)(null),E=(0,Mt.useRef)(null),S=(0,Mt.useRef)(i),A=i==="left"||i==="right";(0,Mt.useLayoutEffect)(()=>{let D=E.current;if(!D||!h)return;let j=0,X=0,fe=document.documentElement.clientWidth,ye=window.innerHeight;for(let Ne=D.parentNode;Ne instanceof Element&&Ne!==document.body;Ne=Ne.parentNode instanceof ShadowRoot?Ne.parentNode.host:Ne.parentNode){let Le=getComputedStyle(Ne),Ie=Ne.getBoundingClientRect();Le.overflowX!=="visible"&&(j=Math.max(j,Ie.left),fe=Math.min(fe,Ie.right)),Le.overflowY!=="visible"&&(X=Math.max(X,Ie.top),ye=Math.min(ye,Ie.bottom))}D.style.maxWidth=`${Math.max(0,fe-j-16)}px`,D.style.left=`${h.x}px`,D.style.top=`${h.y}px`;let De=D.getBoundingClientRect(),Ce=Math.max(j+8-De.left,Math.min(0,fe-8-De.right)),Pe=Math.max(X+8-De.top,Math.min(0,ye-8-De.bottom));D.style.left=`${h.x+Ce}px`,D.style.top=`${h.y+Pe}px`},[h]);let _=(0,Mt.useRef)(null),T=(0,Mt.useRef)(null),H=(0,Mt.useRef)(g),R=(0,Mt.useRef)("more"),z=(0,Mt.useRef)(!1),F=(0,Mt.useRef)(!1),B=(0,Mt.useRef)(!1),le=(0,Mt.useRef)(null),J=(0,Mt.useRef)(void 0),V=(0,Mt.useRef)(void 0),oe=(0,Mt.useRef)(!1),ue=(0,Mt.useRef)(!1),q=ZS(),Y=o??v,W=g.kind!=="collapsed",C=my(e,t).filter(D=>D==="|"||D==="more"||e.some(j=>j.id===D)),U=C.filter(D=>D!=="|").length,I=e.filter(D=>D.children?.length),G=(0,Mt.useRef)(new Map),te=(0,Mt.useRef)(new Map),ie=C.join(" ");(0,Mt.useLayoutEffect)(()=>{let D=new Map,j=[...T.current?.querySelectorAll("[data-menu-item]")??[]].map(X=>{let fe=X.dataset.menuItem,ye=[X.offsetLeft,X.offsetTop];return D.set(fe,ye),{node:X,id:fe,position:ye,before:G.current.get(fe)}});for(let{node:X,id:fe,position:ye,before:De}of j)q||z.current?(te.current.get(fe)?.complete(),te.current.delete(fe)):De&&(De[0]!==ye[0]||De[1]!==ye[1])&&(te.current.get(fe)?.complete(),te.current.set(fe,Ar(X,{x:[De[0]-ye[0],0],y:[De[1]-ye[1],0]},Ol)));for(let[X,fe]of te.current)D.has(X)||(fe.stop(),te.current.delete(X));G.current=D},[ie,i,g,q]),(0,Mt.useEffect)(()=>()=>{for(let D of te.current.values())D.stop()},[]);function pe(){clearTimeout(J.current),m(null)}function xe(){pe(),clearTimeout(V.current),oe.current=!1}function L(D,j,X=!1){clearTimeout(J.current);let fe=b.current,ye=T.current;if(!fe||!ye||W||F.current||B.current&&!X)return;let De=fe.getBoundingClientRect(),Ce=D.getBoundingClientRect(),Pe={label:j?j.count?`${j.label} \xB7 ${j.count} open`:j.label:l,shortcut:j?.shortcut,x:i==="left"?De.width+8:i==="right"?-8:Ce.left-De.left+Ce.width/2,y:i==="top"?De.height+8:i==="bottom"?-8:Ce.top-De.top+Ce.height/2};clearTimeout(V.current);let Ne=()=>{oe.current=!0,m(Pe)};X||oe.current?Ne():J.current=setTimeout(Ne,aq)}function Q(D,j,X){xe(),W||(R.current=j,z.current=X),le.current="first",y(D)}function Z(D=!0,j=R.current){xe(),B.current=!0,le.current=D&&z.current?j:null,y({kind:"collapsed"})}function ae(){g.kind==="group"&&(le.current=g.id,y({kind:"main"}))}function we(D){x(D.id),a?.(D.id),W&&!D.keepOpenOnSelect?Z(!0,g.kind==="group"?g.id:D.id):xe(),D.onSelect?.()}(0,Mt.useLayoutEffect)(()=>{let D=b.current,j=_.current,X=T.current;if(!D||!j||!X)return;let fe=S.current!==i;S.current=i;let ye=H.current;H.current=g;let De=[...D.querySelectorAll(".morphing-menu__panel")],Ce=De.find($e=>$e.getAttribute("aria-hidden")==="false"),Pe=[],Ne=!1,Le=$e=>(Pe.push($e),$e),Ie=()=>({width:Ce?.offsetWidth??X.offsetWidth,height:Ce?.offsetHeight??X.offsetHeight}),ut=()=>{let $e=Ie();j.style.width=`${$e.width}px`,j.style.height=`${$e.height}px`},ct=fe||ye.kind!==g.kind||ye.kind==="group"&&g.kind==="group"&&ye.id!==g.id,de=ye.kind==="collapsed"!=(g.kind==="collapsed"),Ae=q||!ct;if(Ae)ut();else if(de&&!W)Le(Ar(j,Ie(),tb));else if(de){let $e=Math.min(X.offsetWidth,X.offsetWidth>250?280:200);Le(Ar(j,{width:$e,height:X.offsetHeight>52?32:28},eb)).finished.then(()=>{Ne||Le(Ar(j,Ie(),{...Ol,bounce:W?.24:.15}))}).catch(()=>{})}else Le(Ar(j,Ie(),{...Ol,duration:.25,bounce:.1}));Le(Ar(X,{opacity:W?0:1,scale:W&&!q?.8:1,filter:W&&!q?"blur(8px)":"blur(0px)"},{duration:Ae?0:W?.15:.22,delay:!Ae&&!W?.08:0,...W?{}:{ease:"easeOut"}}));for(let $e of De){let ot=$e===Ce;for(let[rn,Zt]of[...$e.querySelectorAll(".morphing-menu__row")].entries())ot&&de&&!Ae&&Object.assign(Zt.style,{opacity:"0",transform:"translateY(48px)",filter:"blur(4px)"}),Le(Ar(Zt,{opacity:ot?1:0,y:ot||q?0:16,filter:ot||q?"blur(0px)":"blur(2px)"},{...Ol,duration:Ae?0:ot?de?.4:.25:.12,bounce:de?.3:0,delay:!Ae&&ot?(de?.2:0)+rn*.02:0}))}let Re=[...(W?Ce:X)?.querySelectorAll("[data-menu-item]")??[]],Fe=le.current;le.current=null,Fe&&(F.current=!0,((Fe==="first"?Re[0]:Re.find(ot=>ot.dataset.menuItem===Fe))??(W?void 0:Re.find(ot=>ot.dataset.menuItem==="more")))?.focus({preventScroll:!0}),F.current=!1);let Ye=()=>y($e=>({...$e}));return window.addEventListener("resize",Ye),()=>{Ne=!0,Pe.forEach($e=>$e.stop()),window.removeEventListener("resize",Ye)}},[g,q,i,e.length,ie]),(0,Mt.useEffect)(()=>{if(!W)return;let D=X=>{X.target instanceof Node&&!X.composedPath().includes(b.current)&&Z(!1)},j=new AbortController;return jr(b.current,"pointerdown",D,{signal:j.signal}),()=>j.abort()},[W]),(0,Mt.useEffect)(()=>()=>{clearTimeout(J.current),clearTimeout(V.current)},[]);function Te(D,j){let X=!!D.children?.length,fe=Y===D.id||!!D.children?.some(Le=>Le.id===Y),ye=!j&&D.keepOpenOnSelect,De=(Le,Ie=!1)=>(0,_t.jsx)(cq,{label:D.label,icon:Ie,reduced:!!q,children:Le}),Ce=fe&&D.activeIcon?D.activeIcon:D.icon,Pe=(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)("span",{className:"morphing-menu__icon","aria-hidden":"true",style:ye?{display:"grid"}:void 0,children:ye?De(Ce,!0):Ce}),!j&&(0,_t.jsx)("span",{className:"morphing-menu__label",style:ye?{display:"grid"}:void 0,children:ye?De(D.label):D.label}),j&&!!D.count&&(0,_t.jsx)("span",{className:"morphing-menu__badge","aria-hidden":"true",children:gy(D.count)}),!j&&(0,_t.jsxs)("span",{className:"morphing-menu__trailing",children:[!!D.count&&(0,_t.jsx)("span",{className:"morphing-menu__count","aria-hidden":"true",children:D.count}),D.shortcut&&(0,_t.jsx)(FR,{shortcut:D.shortcut})]}),!j&&X&&(0,_t.jsx)(lq,{})]}),Ne={className:j?"morphing-menu__shortcut":"morphing-menu__row","data-menu-item":D.id,"aria-label":hy(D.label,D.count),"aria-keyshortcuts":D.shortcut?Jr(D.shortcut).aria:void 0,"aria-pressed":D.checked,"aria-current":fe?X?"true":"page":void 0,"aria-expanded":X?g.kind==="group"&&g.id===D.id:void 0,"aria-controls":X?`${p}-group-${D.id}`:void 0,onClick:Le=>X?Q({kind:"group",id:D.id},D.id,Le.detail===0):we(D),onPointerEnter:Le=>{j&&Le.pointerType==="mouse"&&L(Le.currentTarget,D)},onPointerLeave:pe,onPointerDown:xe,onFocus:Le=>{j&&Le.currentTarget.matches(":focus-visible")&&L(Le.currentTarget,D,!0)},onBlur:pe};return D.href&&!X?(0,_t.jsx)("a",{href:D.href,...Ne,children:Pe},D.id):(0,_t.jsx)("button",{type:"button",...Ne,children:Pe},D.id)}let $=(0,_t.jsxs)("button",{type:"button",className:"morphing-menu__row","data-menu-item":"close",onClick:()=>Z(!0,"more"),children:[(0,_t.jsx)(Qu,{"aria-hidden":"true"}),(0,_t.jsx)("span",{className:"morphing-menu__label",children:"Close menu"})]});return(0,_t.jsxs)("nav",{ref:b,"aria-label":s,className:["morphing-menu",u].filter(Boolean).join(" "),"data-view":g.kind,"data-edge":i,"data-vertical":A,"data-align-end":r,style:{"--mm-count":U,"--mm-gaps":C.length-U,...d},onPointerMove:D=>{if(!B.current||D.pointerType!=="mouse"||!D.movementX&&!D.movementY)return;B.current=!1;let j=D.target instanceof Element?D.target.closest(".morphing-menu__shortcut"):null;j&&L(j,e.find(X=>X.id===j.dataset.menuItem)??null)},onKeyDown:D=>{D.key==="Escape"&&(B.current=!0,xe(),W&&(D.preventDefault(),D.stopPropagation(),g.kind==="group"?ae():Z()))},onBlur:D=>{D.relatedTarget instanceof Node&&D.currentTarget.contains(D.relatedTarget)||(W?D.relatedTarget instanceof Node&&Z(!1):ue.current||xe())},children:[(0,_t.jsxs)("div",{ref:_,className:"morphing-menu__shell",children:[(0,_t.jsx)("div",{ref:T,className:"morphing-menu__bar","aria-hidden":W,inert:W,onPointerEnter:D=>{D.pointerType==="mouse"&&(ue.current=!0,clearTimeout(V.current))},onPointerLeave:D=>{D.pointerType==="mouse"&&(ue.current=!1,pe(),clearTimeout(V.current),V.current=setTimeout(()=>{oe.current=!1},sq))},onKeyDown:D=>{let j={ArrowLeft:-1,ArrowUp:-1,ArrowRight:1,ArrowDown:1}[D.key],X=[...D.currentTarget.querySelectorAll("[data-menu-item]")],fe=X.indexOf(D.target);fe<0||D.altKey||D.ctrlKey||D.metaKey||D.shiftKey||!j&&D.key!=="Home"&&D.key!=="End"||(D.preventDefault(),X[D.key==="Home"?0:D.key==="End"?X.length-1:(fe+j+X.length)%X.length].focus({preventScroll:!0}))},children:C.map((D,j)=>D==="|"?(0,_t.jsx)("span",{className:"morphing-menu__separator","aria-hidden":"true"},`separator-${j}`):D!=="more"?Te(e.find(X=>X.id===D),!0):(0,_t.jsx)("button",{type:"button",className:"morphing-menu__shortcut","data-menu-item":"more","aria-label":l,"aria-expanded":W,"aria-controls":`${p}-main`,onClick:X=>Q({kind:"main"},"more",X.detail===0),onPointerEnter:X=>{X.pointerType==="mouse"&&L(X.currentTarget,null)},onPointerLeave:pe,onPointerDown:xe,onBlur:pe,onFocus:X=>{X.currentTarget.matches(":focus-visible")&&L(X.currentTarget,null,!0)},children:(0,_t.jsx)(Wu,{"aria-hidden":"true"})},"more"))}),(0,_t.jsxs)("div",{id:`${p}-main`,className:"morphing-menu__panel","aria-hidden":g.kind!=="main",inert:g.kind!=="main",children:[$,[...new Set(e.map(D=>D.group??""))].map(D=>(0,_t.jsxs)("section",{"aria-label":D||void 0,className:"morphing-menu__section",children:[D&&(0,_t.jsx)("h3",{children:D}),[...e].filter(j=>(j.group??"")===D).sort((j,X)=>(j.expandedOrder??0)-(X.expandedOrder??0)).map(j=>Te(j,!1))]},D))]}),I.map(D=>{let j=g.kind==="group"&&g.id===D.id;return(0,_t.jsxs)("div",{id:`${p}-group-${D.id}`,className:"morphing-menu__panel","aria-label":D.label,"aria-hidden":!j,inert:!j,children:[(0,_t.jsxs)("button",{type:"button",className:"morphing-menu__row","data-menu-item":"back",onClick:ae,children:[(0,_t.jsx)(YS,{"aria-hidden":"true"}),(0,_t.jsx)("span",{children:c})]}),D.children.map(X=>Te(X,!1)),$]},D.id)})]}),h&&!W&&(0,_t.jsxs)("div",{ref:E,className:"morphing-menu__tooltip","aria-hidden":"true",style:{left:h.x,top:h.y},children:[h.label,h.shortcut&&(0,_t.jsx)(FR,{shortcut:h.shortcut})]})]})}function lq(){return(0,_t.jsx)(WS,{className:"morphing-menu__chevron","aria-hidden":"true"})}function cq({label:e,icon:t,reduced:n,children:o}){let i=(0,Mt.useRef)(null),r=(0,Mt.useRef)(null);return(0,Mt.useLayoutEffect)(()=>{let a=i.current,s=r.current;if(r.current={label:e,node:a.cloneNode(!0)},!s||s.label===e||n)return;let l=s.node;l.setAttribute("aria-hidden","true"),a.parentElement.append(l);let c={duration:200,easing:"cubic-bezier(.22,1,.36,1)"},u=a.animate([{opacity:0,transform:t?"scale(.7)":"translateY(4px)",filter:"blur(2px)"},{opacity:1,transform:"none",filter:"blur(0px)"}],c),d=l.animate([{opacity:1,transform:"none",filter:"blur(0px)"},{opacity:0,transform:t?"scale(.7)":"translateY(-4px)",filter:"blur(2px)"}],c);return d.finished.then(()=>l.remove()).catch(()=>{}),()=>{u.cancel(),d.cancel(),l.remove()}},[e,t,n]),(0,_t.jsx)("span",{ref:i,style:{gridArea:"1 / 1",display:"flex",alignItems:"center"},children:o})}function FR({shortcut:e}){let t=(0,Mt.useRef)(null);return(0,Mt.useLayoutEffect)(()=>{t.current?.replaceChildren(Zd(e))},[e.label]),(0,_t.jsx)("span",{ref:t})}var Mt,_t,aq,sq,XR=O(()=>{"use strict";"use client";xv();Rv();VR();UR();Mt=kt(Yt(),1);ea();It();by();BS();GR();zE();_t=kt(ya(),1),aq=400,sq=300});var JR={};Ft(JR,{mountToolbar:()=>dq});function QS(e){if("glyph"in e)return(0,Kf.createElement)("span",{style:{display:"contents"},dangerouslySetInnerHTML:{__html:xg[e.glyph]}});let{user:t}=e,n=t&&Kv(t);return(0,Kf.createElement)("span",{className:"review-avatar"},t?ep(t.name):QS({glyph:"person"}),n&&(0,Kf.createElement)("img",{key:n,src:n,alt:"",referrerPolicy:"no-referrer",decoding:"async",onError:o=>{o.currentTarget.hidden=!0}}))}function dq(e,t){e.replaceChildren();let n=(0,ZR.createRoot)(e);return(0,QR.flushSync)(()=>n.render(WR(t))),{render:o=>n.render(WR(o)),unmount:()=>n.unmount()}}var ZR,QR,Kf,WR,eH=O(()=>{"use strict";ZR=kt(TE(),1),QR=kt(ew(),1),Kf=kt(Yt(),1);XR();It();WR=e=>(0,Kf.createElement)(YR,{...e,items:e.items.map(t=>({...t,icon:QS(t.icon),children:t.children?.map(n=>({...n,icon:QS(n.icon)}))}))})});function If(e){return!!e&&typeof e.id=="string"&&typeof e.name=="string"&&typeof e.verified=="boolean"&&[e.avatarUrl,e.accentColor].every(t=>t===void 0||typeof t=="string")}function uq(e){if(e===void 0)return!0;if(!e||typeof e!="object"||Array.isArray(e))return!1;let t={tag:32,role:80,label:160,nearby:160,classes:200,selectedText:200,styles:500,scope:2e3};return Object.entries(e).every(([n,o])=>typeof t[n]=="number"&&typeof o=="string"&&o.length<=t[n])}function aH(e){return Array.isArray(e)&&e.every(t=>t&&typeof t.id=="string"&&typeof t.page=="string"&&typeof t.resolved=="boolean"&&Number.isFinite(t.createdAt)&&Number.isFinite(t.updatedAt)&&(t.resolvedBy===null||If(t.resolvedBy))&&t.anchor&&(!("context"in t.anchor)||uq(t.anchor.context))&&typeof t.anchor.selector=="string"&&typeof t.anchor.text=="string"&&[t.anchor.x,t.anchor.y,t.anchor.width,t.anchor.height,t.anchor.pageX,t.anchor.pageY,t.anchor.viewportWidth].every(Number.isFinite)&&Array.isArray(t.comments)&&t.comments.every(n=>n&&typeof n.id=="string"&&typeof n.body=="string"&&If(n.author)&&Number.isFinite(n.createdAt)&&(n.editedAt===null||Number.isFinite(n.editedAt))&&n.reactions&&typeof n.reactions=="object"&&!Array.isArray(n.reactions)&&Object.values(n.reactions).every(o=>Array.isArray(o)&&o.every(i=>typeof i=="string"))))}function sH(e,t){if(!t||!Array.isArray(e))return e;let n=o=>typeof o=="string"?Object.hasOwn(t,o)?t[o]:void 0:o;return e.map(o=>o&&{...o,resolvedBy:n(o.resolvedBy),comments:Array.isArray(o.comments)&&o.comments.map(i=>i&&{...i,author:n(i.author)})})}function yy(){return new to(0,"Could not read comments. Try again.","invalid_response")}var to,tc,Gf=O(()=>{"use strict";Yu();to=class extends Error{constructor(n,o,i){super(o);this.status=n;this.code=i}status;code};tc=class{constructor(t){this.options=t;let n=new URL(t.sessionEndpoint??t.endpoint).href.replace(/\/$/,""),o=t.sessionDomain?.replace(/^\./,"")??"";this.cookieDomain=o&&(location.hostname===o||location.hostname.endsWith(`.${o}`))?o:"",this.cookieName=`${this.cookieDomain?"__Secure-":"__Host-"}bc-session-${encodeURIComponent(JSON.stringify([n,t.project]))}`,this.key=`palette:${t.endpoint}:${t.project}`;let i=!1;try{let r=document.cookie.split("; ").find(a=>a.startsWith(`${this.cookieName}=`));i=r!==void 0,this.token=r?.slice(this.cookieName.length+1)||null}catch{}try{let r;try{r=JSON.parse(localStorage.getItem(this.userKey)??"null")}catch{}let a=localStorage.getItem(this.key)??(If(r?.user)&&typeof r.token=="string"?r.token:null);i?!this.token&&a&&this.clear():this.token=a,this.token&&r?.token===this.token&&If(r.user)&&(this.user=r.user)}catch{}try{let r=`bc-session-${encodeURIComponent(t.project)}`,a=location.hostname.match(/^[^.]+\.([^.]+\.(?:workers|pages)\.dev)$/)?.[1];for(let s of new Set(["",this.cookieDomain,a]))s!==void 0&&(document.cookie=`${r}=; Max-Age=0; Path=/${s?`; Domain=${s}`:""}`)}catch{}}options;token=null;user=null;transient=!1;revision;cachedThreads=[];reads=new AbortController;persistenceQueued=!1;persistenceBlocked=!1;key;cookieName;cookieDomain;get sessionKey(){return this.key}get userKey(){return`${this.key}:user`}rememberUser(){try{this.token&&this.user?localStorage.setItem(this.userKey,JSON.stringify({token:this.token,user:this.user})):zo(localStorage,this.userKey)}catch{}}cancelReads(){this.reads.abort(),this.reads=new AbortController}async request(t,n="GET",o,i){let r=new URL(t,this.options.endpoint.replace(/\/?$/,"/"));r.searchParams.set("project",this.options.project),r.searchParams.set("repo",this.options.repo),r.searchParams.set("branch",this.options.branch);let a={},s=this.token;s&&(a.Authorization=`Bearer ${s}`),o!==void 0&&(a["Content-Type"]=i??"application/json");let l=n==="GET"?this.reads.signal:void 0,c=AbortSignal.timeout(15e3),u=await fetch(r,{method:n,headers:a,body:o===void 0?void 0:i?o:JSON.stringify(o),credentials:"omit",cache:"no-store",signal:l?AbortSignal.any([l,c]):c}).catch(p=>{throw p instanceof TypeError?navigator.onLine===!1?new to(0,"You\u2019re offline.","offline"):new to(0,"Can\u2019t connect to comments.","unreachable"):p});l?.throwIfAborted();let d=await u.json().catch(()=>{if(l?.throwIfAborted(),u.ok)throw yy();return{}});if(l?.throwIfAborted(),u.ok&&(!d||typeof d!="object"||Array.isArray(d)))throw yy();if(!u.ok)throw u.status===401&&s&&this.token===s&&this.clear(),d?.code==="site_not_approved"?new to(u.status,"Comments aren\u2019t turned on for this site yet.",d?.code):new to(u.status,d?.error??"Could not load comments.",d?.code);return d}get listKey(){return`${this.key}:${JSON.stringify([this.options.repo,this.options.branch])}:threads`}cached(){try{let t=JSON.parse(localStorage.getItem(this.listKey)??"null");return t&&(t.threads=sH(t.threads,t.authors)),t?.token!==(this.token??"")||!aH(t.threads)||t.revision!==void 0&&(!Number.isSafeInteger(t.revision)||t.revision<0)?null:(this.revision=t.revision,this.cachedThreads=t.threads,t.threads)}catch{return null}}persist(){this.persistenceQueued||this.persistenceBlocked||(this.persistenceQueued=!0,queueMicrotask(()=>{this.persistenceQueued=!1;try{let t=Object.create(null),n=[],o=0,i=!1,r=this.options.page?.()??location.pathname,a=[...this.cachedThreads].sort((s,l)=>+(l.page===r)-+(s.page===r));for(let s of a){let l=Object.create(null),c=p=>(p&&(l[p.id]={...t[p.id],...l[p.id],...p}),p?.id??null),u={...s,resolvedBy:c(s.resolvedBy),comments:s.comments.map(p=>({...p,author:c(p.author)}))},d=JSON.stringify(u).length+Object.entries(l).reduce((p,[g,y])=>p+JSON.stringify([g,y]).length-(t[g]?JSON.stringify([g,t[g]]).length:0),0)+2;if(o+d>25e4){i=!0;continue}o+=d,Object.assign(t,l),n.push(u)}if(i&&!n.length){zo(localStorage,this.listKey);return}localStorage.setItem(this.listKey,JSON.stringify({token:this.token??"",revision:i?void 0:this.revision,threads:n,authors:t}))}catch{this.persistenceBlocked=!0;try{zo(localStorage,this.listKey)}catch{}}}))}async list(){let t=this.token,n=this.reads.signal,o=[],i=0,r,a;for(;i!==null;){let s=await this.request(`threads?authors=1&offset=${i}${r?`&cursor=${encodeURIComponent(r)}`:""}${i===0&&this.revision!==void 0?`&revision=${this.revision}`:""}`).catch(l=>{throw l instanceof to&&l.status===403&&this.token===t&&(this.revision=void 0,this.cachedThreads=[],this.persist()),l});if(n.throwIfAborted(),s.threads=sH(s.threads,s.authors),s.notModified===!0&&i===0&&this.revision!==void 0)return this.cachedThreads;if(!aH(s.threads)||s.nextCursor!=null&&(typeof s.nextCursor!="string"||s.nextCursor.length>200||s.nextCursor===r)||s.revision!==void 0&&(!Number.isSafeInteger(s.revision)||s.revision<0)||s.next!=null&&(!Number.isSafeInteger(s.next)||s.next<=i))throw yy();i===0&&(a=s.revision),o.push(...s.threads??[]),r=s.nextCursor??void 0,i=s.next??null}return this.revision=a,this.cachedThreads=o,this.persist(),o}save(t){t.token!==this.token&&(this.cancelReads(),this.revision=void 0,this.cachedThreads=[]),this.token=t.token,this.user=t.user,this.rememberUser();let n=!1;try{localStorage.setItem(this.key,t.token),n=!0}catch{}this.transient=!this.writeCookie(t.token,400*86400)&&!n}writeCookie(t,n){if(location.protocol!=="https:")return;let o="Path=/; SameSite=Lax; Secure";try{return this.cookieDomain&&(document.cookie=`${this.cookieName}=; Max-Age=0; ${o}`),document.cookie=`${this.cookieName}=${t}; Max-Age=${n}; ${o}${this.cookieDomain?`; Domain=${this.cookieDomain}`:""}`,document.cookie.split("; ").includes(`${this.cookieName}=${t}`)}catch{}}clear(){this.cancelReads();try{zo(localStorage,this.listKey);let t=Qx(this.key);for(let n of Object.keys(localStorage))(n.startsWith(`${this.key}:`)||t&&n.startsWith(`${t}:`))&&localStorage.removeItem(n)}catch{}this.revision=void 0,this.cachedThreads=[],this.token=null,this.user=null,this.transient=!1,this.rememberUser(),this.writeCookie("",400*86400);try{zo(localStorage,this.key)}catch{}}async restore(){if(!this.token)return;let t=this.token,n=await this.request("me");if(this.token===t){if(!If(n.user))throw yy();this.save({token:t,user:n.user})}}async guest(t){this.save(await this.request("auth/guest","POST",{name:t}))}async logout(){let t=this.request("me","DELETE");this.clear(),await t}}});function hH(e,t,n=!1){let o=t.split("+").map(s=>s.trim());o.length>1&&o.at(-1)===""&&o.at(-2)===""&&o.splice(-2,2,"+");let i=o.pop()??"",r=new Set;for(let s of o){let l=gH.find(c=>c.toLowerCase()===s.toLowerCase());if(!l||r.has(l))throw new Error(`Invalid Palette shortcut for ${e}: "${t}".`);r.add(l)}if(!i||xq.has(i.toLowerCase())&&!(n&&i.toLowerCase()==="tab"))throw new Error(`Invalid Palette shortcut for ${e}: "${t}".`);let a=i.length===1?i.toUpperCase():i;return{key:i.toLowerCase(),shift:r.has("Shift"),alt:r.has("Alt"),ctrl:r.has("Ctrl"),meta:r.has("Meta"),label:[...gH.filter(s=>r.has(s)),a].join("+")}}function eu(e={}){let t={...e.compare,...e.select},n={},o=new Map;for(let[i,r]of Object.entries(vq)){let a=t[i]??r;if(a===!1){n[i]=null;continue}let s=hH(i,a,!0),l=o.get(s.label.toLowerCase());if(l)throw new Error(`Palette shortcuts for ${l} and ${i} both use ${s.label}.`);o.set(s.label.toLowerCase(),i),n[i]=s}return n}function bH(e={}){let t={},n=new Map;for(let o of Object.keys(mH)){let i=e[o]??mH[o];if(i===!1){t[o]=null;continue}if(typeof i!="string")throw new Error(`Invalid Palette shortcut for ${o}.`);let r=hH(o,i),a=n.get(r.label.toLowerCase());if(a&&e[o]===void 0&&yq.has(o)){t[o]=null;continue}if(a)throw new Error(`Palette shortcuts for ${a} and ${o} both use ${r.label}.`);n.set(r.label.toLowerCase(),o),t[o]=r}return t}function Bo(e,t){if(!t||e.shiftKey!==t.shift||e.altKey!==t.alt||e.ctrlKey!==t.ctrl||e.metaKey!==t.meta)return!1;let{key:n}=t;if(e.key.toLowerCase()===n)return!0;let o=/^[a-z]$/.test(n)?`Key${n.toUpperCase()}`:/^\d$/.test(n)&&`Digit${n}`;return e.code===o&&(t.shift||t.alt||t.ctrl||t.meta||!/^[a-z\d]$/i.test(e.key))}var mH,yq,gH,xq,vq,wy=O(()=>{"use strict";mH={comment:"C",browse:"V",design:"D",restore:"Shift+K",comments:"L",visibility:"H"},yq=new Set(["visibility"]),gH=["Ctrl","Alt","Shift","Meta"],xq=new Set(["escape","tab"]);vq={before:"ArrowLeft",after:"ArrowRight",next:"Tab",prev:"Shift+Tab",parent:"Shift+Enter",child:!1}});function fn(e){return vH(e)||e?.namespaceURI==="http://www.w3.org/1999/xhtml"}function Ey(e,t=!1){return fn(e)?!t&&vH(e)?e.closest("svg")??e:e:null}var vH,Fs=O(()=>{"use strict";vH=e=>e?.namespaceURI==="http://www.w3.org/2000/svg"});function oc(e,t=e?.localName??"",n){let o=e?.getAttribute("role"),i=o?`${o[0].toUpperCase()}${o.slice(1)}`:Eq[/^h[1-6]$/.test(t)?"h":t],r=(n??e?.getAttribute("aria-label")??e?.getAttribute("alt")??e?.textContent??"").replace(/\s+/g," ").trim(),a=r.length>28?`${r.slice(0,27)}\u2026`:r;return[i,a&&`\u201C${a}\u201D`].filter(Boolean).join(" ")||t||"Element"}function nu(e){let t=e?.trim().replace(/^(?:ForwardRef|Memo)\((.+)\)$/,"$1");return t&&!kq.test(t)?t:void 0}var Eq,kq,ky=O(()=>{"use strict";Eq={h:"Heading",a:"Link",button:"Button",img:"Image",p:"Paragraph",li:"List item",input:"Field",textarea:"Field"};kq=/^(?:Primitive(?:\.\w+)?|Slot|Slottable|ForwardRef|Memo|Anonymous|Unknown|Fragment|Suspense|Presence|Context|[\w$]*\.(?:Provider|Consumer))$/});function Tq(e){try{return e?.ownerDocument?.defaultView?.[Sq]}catch{return}}function Ys(e,t){let n=Tq(e),o=t?.components;if(!n||n===o)return o??n;if(!o)return n;let i=wH.get(n);i||wH.set(n,i=new WeakMap);let r=i.get(o);if(!r){let a=new WeakMap;r={identify(s){let l=EH(n,s),c=EH(o,s),u=c&&(!l||c.element!==l.element&&l.element.contains(c.element))?c:l;return u&&a.set(u,u===l?n:o),u},editor:s=>a.get(s)?.editor?.(s)??null,panel:s=>a.get(s)?.panel?.(s)??null},i.set(o,r)}return r}var Sq,wH,EH,Sy=O(()=>{"use strict";Sq=Symbol.for("palette.instrumented-components"),wH=new WeakMap;EH=(e,t)=>{try{let n=e.identify(t);return n?.name?n:null}catch{return null}}});function kH(e){let t=new WeakMap,n=new WeakMap;return{begin(o,i){t.set(o,i)},override(o,i){let r=t.get(o);i&&r&&!r.bindingUndo&&!n.has(o)&&(r.bindingUndo=i)},commit(o,i,r,a){let s={value:i.style.getPropertyValue(r),priority:i.style.getPropertyPriority(r)},l=n.get(o),c=l?.before??t.get(o)??{value:"",priority:""};if(s.value===c.value&&s.priority===c.priority&&!c.bindingUndo)l&&e.splice(e.indexOf(l),1),n.delete(o);else if(l)l.after=s;else{let u={kind:"style",element:i,property:r,before:c,after:s};e.push(u),n.set(o,u)}a&&(t.set(o,s),n.delete(o))},cancel(o,i,r){let a=n.get(o);a&&(Ty(i,r,a.before),a.before.bindingUndo?.(),e.splice(e.indexOf(a),1)),n.delete(o),t.delete(o)},isDirty(o){return n.has(o)}}}function Ty(e,t,n){n?.restore?n.restore():e.style.setProperty(t,n?.value??"",n?.priority)}function ic(e){if(/^#[\da-f]{6}$/i.test(e))return e;if(/^#[\da-f]{3}$/i.test(e))return`#${[...e.slice(1)].map(n=>n+n).join("")}`;let t=e.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);return t?`#${t.slice(1,4).map(n=>Number(n).toString(16).padStart(2,"0")).join("")}`:"#000000"}function Ay(e,t){if(!t)return null;let n="",o=0,i=!1;for(let a of t)if(i)i=!1;else if(a==="\\")i=!0;else if(n)a===n&&(n="");else if(a==='"'||a==="'")n=a;else if(a==="(")o++;else if(a===")"&&--o<0)return null;if(n||o||i)return null;let r=document.createElement("span").style;return r.setProperty(e,t),r.getPropertyValue(e)?t:null}function $n(e,t){let n=e.getAttribute("style"),o=e.style.cssText,i=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t),a=getComputedStyle(e).getPropertyValue(t).trim(),s=u=>{let d=e.ownerDocument.createElement("span").style;return d.cssText=u,d.setProperty(t,""),d.cssText},l=s(o),c={value:i,priority:r,computed:a,absent:n===null,restore(){sT.get(e)?.push(()=>{e.style.getPropertyValue(t)===i&&e.style.getPropertyPriority(t)===r&&c.restore()}),s(e.style.cssText)===l?n===null?(e.getAttribute("style"),e.removeAttribute("style")):e.setAttribute("style",n):(e.style.setProperty(t,i,r),n===null&&!e.style.length&&rc(e))}};return c}function rc(e){e.style.length||(e.getAttribute("style"),e.removeAttribute("style"))}function Fa(e,t,n){if(!fn(e))return()=>{};let o=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t),r=!e.hasAttribute("style");return e.style.setProperty(t,n,i),()=>{o?e.style.setProperty(t,o,i):e.style.removeProperty(t),r&&rc(e)}}function ri(e,t,n,o=!1,i=!1){let r=aT.get(e);r&&(clearTimeout(r.timer),r.restore());let a=e.style.getPropertyValue("transition"),s=e.style.getPropertyPriority("transition"),l=!e.hasAttribute("style"),c=o?[...t].map(g=>`${g} .3s cubic-bezier(.22,1,.36,1)`).join():"none";e.style.setProperty("transition",c,"important");let u=e.style.getPropertyValue("transition"),d=[],p=()=>{if(aT.delete(e),!(e.style.getPropertyValue("transition")!==u||e.style.getPropertyPriority("transition")!=="important")){a?e.style.setProperty("transition",a,s):e.style.removeProperty("transition"),(i||l)&&rc(e);for(let g of d)g()}};sT.set(e,d);try{n()}finally{sT.delete(e)}o?aT.set(e,{restore:p,timer:window.setTimeout(p,320)}):(getComputedStyle(e).color,p())}var Xf,sT,aT,Li=O(()=>{"use strict";Fs();Xf="Runtime preview \xB7 Undo, Reset or reload to restore";sT=new WeakMap;aT=new WeakMap});function ta(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=[];for(;t.nextNode();){let o=t.currentNode;n.push([o,o.data])}return n}function SH(e,t,n){let o=t.startContainer===e&&e.childNodes.length===1?e.firstChild:t.startContainer;if(o?.nodeType!==Node.TEXT_NODE||t.startContainer!==t.endContainer||!e.contains(o)||o.parentElement?.closest(ac))return null;let i=t.startContainer===e?t.startOffset?o.length:0:t.startOffset,a=(t.endContainer===e?t.endOffset?o.length:0:t.endOffset)-i,s=n.replace(/\r\n?/g,`
12
+ --num-skintones: ${I6};`}),a(()=>{r.customEmoji&&r.database&&_()}),a(()=>{r.customEmoji&&r.customEmoji.length?r.groups!==ek&&(r.groups=ek):r.groups!==FE&&(r.currentGroupIndex&&r.currentGroupIndex--,r.groups=FE)}),a(()=>{async function L(){r.databaseLoaded&&(r.currentSkinTone=await r.database.getPreferredSkinTone())}L()}),a(()=>{r.skinTones=Array(I6).fill().map((L,Q)=>YV(r.skinToneEmoji,Q))}),a(()=>{r.skinToneButtonText=r.skinTones[r.currentSkinTone]}),a(()=>{r.skinToneButtonLabel=r.i18n.skinToneLabel.replace("{skinTone}",r.i18n.skinTones[r.currentSkinTone])}),a(()=>{async function L(){let{database:Q}=r,Z=(await Promise.all(jV.map(se=>Q.getEmojiByUnicodeOrName(se)))).filter(Boolean);r.defaultFavoriteEmojis=Z}r.databaseLoaded&&L()});function _(){let{customEmoji:L,database:Q}=r,Z=L||JE;Q.customEmoji!==Z&&(Q.customEmoji=Z)}a(()=>{async function L(){_();let{database:Q,defaultFavoriteEmojis:Z,numColumns:se}=r,we=await Q.getTopFavoriteEmoji(se),Te=await le(tD([...we,...Z],$=>$.unicode||$.name).slice(0,se));r.currentFavorites=Te}r.databaseLoaded&&r.defaultFavoriteEmojis&&L()});function T(L){ZV(L,i,()=>{{let Q=getComputedStyle(n.rootElement),Z=parseInt(Q.getPropertyValue("--num-columns"),10),se=Q.getPropertyValue("direction")==="rtl";r.numColumns=Z,r.isRtl=se}})}function H(L){b7(L,i,Q=>{for(let{target:Z,isIntersecting:se}of Q)Z.classList.toggle("onscreen",se)})}a(()=>{async function L(){let{searchText:Q,currentGroup:Z,databaseLoaded:se,customEmoji:we}=r;if(!se)r.currentEmojis=[],r.searchMode=!1;else if(Q.length>=HV){let Te=await V(Q);r.searchText===Q&&(g(Te),y(!0))}else{let{id:Te}=Z;if(Te!==-1||we&&we.length){let $=await J(Te);r.currentGroup.id===Te&&(g($),y(!1))}}}L()});let R=()=>{cb(()=>t7(n.tabpanelElement))};a(()=>{let{currentEmojis:L,emojiVersion:Q}=r,Z=L.filter(se=>se.unicode).filter(se=>G6(se)&&!tk.has(se.unicode));if(!Q&&Z.length)g(L),cb(()=>z(Z));else{let se=Q?L:L.filter(F);g(se),R()}});function z(L){JV(L,n.baselineEmoji,c)?R():r.currentEmojis=[...r.currentEmojis]}function F(L){return!L.unicode||!G6(L)||tk.get(L.unicode)}async function B(L){let Q=r.emojiVersion||await XE();return L.filter(({version:Z})=>!Z||Z<=Q)}async function le(L){return XV(L,r.emojiVersion||await XE())}async function J(L){let Q=L===-1?r.customEmoji:await r.database.getEmojiByGroup(L);return le(await B(Q))}async function V(L){return le(await B(await r.database.getEmojiBySearchQuery(L)))}a(()=>{}),a(()=>{function L(){let{searchMode:Z,currentEmojis:se}=r;if(Z)return[{category:"",emojis:se}];let we=new Map;for(let Te of se){let $=Te.category||"",D=we.get($);D||(D=[],we.set($,D)),D.push(Te)}return[...we.entries()].map(([Te,$])=>({category:Te,emojis:$})).sort((Te,$)=>r.customCategorySorting(Te.category,$.category))}let Q=L();v(Q)}),a(()=>{r.activeSearchItemId=r.activeSearchItem!==-1&&r.currentEmojis[r.activeSearchItem].id}),a(()=>{let{rawSearchText:L}=r;J6(()=>{r.searchText=(L||"").trim(),r.activeSearchItem=-1})});function oe(L){if(!r.searchMode||!r.currentEmojis.length)return;let Q=Z=>{Fr(L),r.activeSearchItem=WE(Z,r.activeSearchItem,r.currentEmojis)};switch(L.key){case"ArrowDown":return Q(!1);case"ArrowUp":return Q(!0);case"Enter":if(r.activeSearchItem===-1)r.activeSearchItem=0;else return Fr(L),W(r.currentEmojis[r.activeSearchItem].id)}}function ue(L){let{target:Q}=L,Z=Q.closest(".nav-button");if(!Z)return;let se=parseInt(Z.dataset.groupId,10);n.searchElement.value="",r.rawSearchText="",r.searchText="",r.activeSearchItem=-1,r.currentGroupIndex=r.groups.findIndex(we=>we.id===se)}function q(L){let{target:Q,key:Z}=L,se=we=>{we&&(Fr(L),we.focus())};switch(Z){case"ArrowLeft":return se(Q.previousElementSibling);case"ArrowRight":return se(Q.nextElementSibling);case"Home":return se(Q.parentElement.firstElementChild);case"End":return se(Q.parentElement.lastElementChild)}}async function Y(L){let Q=await r.database.getEmojiByUnicodeOrName(L),Z=[...r.currentEmojis,...r.currentFavorites].find(we=>we.id===L),se=Z.unicode&&x(Z,r.currentSkinTone);return await r.database.incrementFavoriteEmojiCount(L),{emoji:Q,skinTone:r.currentSkinTone,...se&&{unicode:se},...Z.name&&{name:Z.name}}}async function W(L){let Q=Y(L);u("emoji-click-sync",Q),u("emoji-click",await Q)}function C(L){let{target:Q}=L;if(!Q.classList.contains("emoji"))return;Fr(L);let Z=Q.id.substring(4);W(Z)}function U(L){r.currentSkinTone=L,r.skinTonePickerExpanded=!1,l("skintone-button"),u("skin-tone-change",{skinTone:L}),r.database.setPreferredSkinTone(L)}function I(L){let{target:{id:Q}}=L,Z=Q&&Q.match(/^skintone-(\d)/);if(!Z)return;Fr(L);let se=parseInt(Z[1],10);U(se)}function G(L){r.skinTonePickerExpanded=!r.skinTonePickerExpanded,r.activeSkinTone=r.currentSkinTone,r.skinTonePickerExpanded&&(Fr(L),cb(()=>l("skintone-list")))}a(()=>{r.skinTonePickerExpanded?n.skinToneDropdown.addEventListener("transitionend",()=>{r.skinTonePickerExpandedAfterAnimation=!0},{once:!0}):r.skinTonePickerExpandedAfterAnimation=!1});function te(L){if(!r.skinTonePickerExpanded)return;let Q=async Z=>{Fr(L),r.activeSkinTone=Z};switch(L.key){case"ArrowUp":return Q(WE(!0,r.activeSkinTone,r.skinTones));case"ArrowDown":return Q(WE(!1,r.activeSkinTone,r.skinTones));case"Home":return Q(0);case"End":return Q(r.skinTones.length-1);case"Enter":return Fr(L),U(r.activeSkinTone);case"Escape":return Fr(L),r.skinTonePickerExpanded=!1,l("skintone-button")}}function ie(L){if(r.skinTonePickerExpanded&&L.key===" ")return Fr(L),U(r.activeSkinTone)}async function pe(L){let{relatedTarget:Q}=L;(!Q||Q.id!=="skintone-list")&&(r.skinTonePickerExpanded=!1)}function xe(L){r.rawSearchText=L.target.value}return{$set(L){lb(r,L)},$destroy(){o.abort()}}}function nk(e){e instanceof Od||Object.setPrototypeOf(e,customElements.get(e.tagName.toLowerCase()).prototype)}var ek,FE,HV,I6,J6,zV,OV,$V,NV,jV,eD,PV,F6,BV,YE,XE,tk,qV,KV,IV,GV,FV,cb,WV,QV,ZE,jl,o7,i7,r7,a7,db,Q6,JE,lb,x7,v7,w7,E7,nD,k7,Od,oD,rD=O(()=>{K6();ek=[[-1,"\u2728","custom"],[0,"\u{1F600}","smileys-emotion"],[1,"\u{1F44B}","people-body"],[3,"\u{1F431}","animals-nature"],[4,"\u{1F34E}","food-drink"],[5,"\u{1F3E0}\uFE0F","travel-places"],[6,"\u26BD","activities"],[7,"\u{1F4DD}","objects"],[8,"\u26D4\uFE0F","symbols"],[9,"\u{1F3C1}","flags"]].map(([e,t,n])=>({id:e,emoji:t,name:n})),FE=ek.slice(1),HV=2,I6=6,J6=typeof requestIdleCallback=="function"?requestIdleCallback:setTimeout;zV={"\u{1FAEA}":17,"\u{1FAE9}":16,"\u{1FAE8}":15.1,"\u{1FAE0}":14,"\u{1F972}":13.1,"\u{1F97B}":12.1,"\u{1F970}":11,"\u{1F929}":5,"\u{1F471}\u200D\u2640\uFE0F":4,"\u{1F923}":3,"\u{1F441}\uFE0F\u200D\u{1F5E8}\uFE0F":2,"\u{1F600}":1,"\u{1F610}\uFE0F":.7,"\u{1F603}":.6},OV=1e3,$V="\u{1F590}\uFE0F",NV=8,jV=["\u{1F60A}","\u{1F612}","\u2764\uFE0F","\u{1F44D}\uFE0F","\u{1F60D}","\u{1F602}","\u{1F62D}","\u263A\uFE0F","\u{1F614}","\u{1F629}","\u{1F60F}","\u{1F495}","\u{1F64C}","\u{1F618}"],eD='"Twemoji Mozilla","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif',PV=(e,t)=>e<t?-1:e>t?1:0,F6=(e,t)=>{let n=document.createElement("canvas");n.width=n.height=1;let o=n.getContext("2d",{willReadFrequently:!0});return o.textBaseline="top",o.font=`100px ${eD}`,o.fillStyle=t,o.scale(.01,.01),o.fillText(e,0,0),o.getImageData(0,0,1,1).data},BV=(e,t)=>{let n=[...e].join(","),o=[...t].join(",");return n===o&&!n.startsWith("0,0,0,")};XE=()=>(YE||(YE=new Promise(e=>J6(()=>e(UV())))),YE),tk=new Map,qV="\uFE0F",KV="\uD83C",IV="\u200D",GV=127995,FV=57339;cb=requestAnimationFrame,WV=typeof ResizeObserver=="function";QV="\u{1F600}";o7=new WeakMap,i7=new WeakMap,r7=Symbol("un-keyed"),a7="replaceChildren"in Element.prototype;db=typeof queueMicrotask=="function"?queueMicrotask:e=>Promise.resolve().then(e);Q6=new WeakMap;JE=[],{assign:lb}=Object;x7="https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json",v7="en",w7={categoriesLabel:"Categories",emojiUnsupportedMessage:"Your browser does not support color emoji.",favoritesLabel:"Favorites",loadingMessage:"Loading\u2026",networkErrorMessage:"Could not load emoji.",regionLabel:"Emoji picker",searchDescription:"When search results are available, press up or down to select and enter to choose.",searchLabel:"Search",searchResultsLabel:"Search results",skinToneDescription:"When expanded, press up or down to select and enter to choose.",skinToneLabel:"Choose a skin tone (currently {skinTone})",skinTonesLabel:"Skin tones",skinTones:["Default","Light","Medium-Light","Medium","Medium-Dark","Dark"],categories:{custom:"Custom","smileys-emotion":"Smileys and emoticons","people-body":"People and body","animals-nature":"Animals and nature","food-drink":"Food and drink","travel-places":"Travel and places",activities:"Activities",objects:"Objects",symbols:"Symbols",flags:"Flags"}},E7=':host{--emoji-size:1.375rem;--emoji-padding:0.5rem;--category-emoji-size:var(--emoji-size);--category-emoji-padding:var(--emoji-padding);--indicator-height:3px;--input-border-radius:0.5rem;--input-border-size:1px;--input-font-size:1rem;--input-line-height:1.5;--input-padding:0.25rem;--num-columns:8;--outline-size:2px;--border-size:1px;--border-radius:0;--skintone-border-radius:1rem;--category-font-size:1rem;display:flex;width:min-content;height:400px}:host,:host(.light){color-scheme:light;--background:#fff;--border-color:#e0e0e0;--indicator-color:#385ac1;--input-border-color:#999;--input-font-color:#111;--input-placeholder-color:#999;--outline-color:#999;--category-font-color:#111;--button-active-background:#e6e6e6;--button-hover-background:#d9d9d9}:host(.dark){color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}@media (prefers-color-scheme:dark){:host{color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}}:host([hidden]){display:none}button{margin:0;padding:0;border:0;background:0 0;box-shadow:none;-webkit-tap-highlight-color:transparent}button::-moz-focus-inner{border:0}input{padding:0;margin:0;line-height:1.15;font-family:inherit}input[type=search]{-webkit-appearance:none}:focus{outline:var(--outline-color) solid var(--outline-size);outline-offset:calc(-1*var(--outline-size))}:host([data-js-focus-visible]) :focus:not([data-focus-visible-added]){outline:0}:focus:not(:focus-visible){outline:0}.hide-focus{outline:0}*{box-sizing:border-box}.picker{contain:content;display:flex;flex-direction:column;background:var(--background);border:var(--border-size) solid var(--border-color);border-radius:var(--border-radius);width:100%;height:100%;overflow:hidden;--total-emoji-size:calc(var(--emoji-size) + (2 * var(--emoji-padding)));--total-category-emoji-size:calc(var(--category-emoji-size) + (2 * var(--category-emoji-padding)))}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.hidden{opacity:0;pointer-events:none}.abs-pos{position:absolute;left:0;top:0}.gone{display:none!important}.skintone-button-wrapper,.skintone-list{background:var(--background);z-index:3}.skintone-button-wrapper.expanded{z-index:1}.skintone-list{position:absolute;inset-inline-end:0;top:0;z-index:2;overflow:visible;border-bottom:var(--border-size) solid var(--border-color);border-radius:0 0 var(--skintone-border-radius) var(--skintone-border-radius);will-change:transform;transition:transform .2s ease-in-out;transform-origin:center 0}@media (prefers-reduced-motion:reduce){.skintone-list{transition-duration:.001s}}@supports not (inset-inline-end:0){.skintone-list{right:0}}.skintone-list.no-animate{transition:none}.tabpanel{overflow-y:auto;scrollbar-gutter:stable;-webkit-overflow-scrolling:touch;will-change:transform;min-height:0;flex:1;contain:content}.emoji-menu{display:grid;grid-template-columns:repeat(var(--num-columns),var(--total-emoji-size));justify-content:space-around;align-items:flex-start;width:100%}.emoji-menu.visibility-auto{content-visibility:auto;contain-intrinsic-size:calc(var(--num-columns)*var(--total-emoji-size)) calc(var(--num-rows)*var(--total-emoji-size))}.category{padding:var(--emoji-padding);font-size:var(--category-font-size);color:var(--category-font-color)}.emoji,button.emoji{font-size:var(--emoji-size);display:flex;align-items:center;justify-content:center;border-radius:100%;height:var(--total-emoji-size);width:var(--total-emoji-size);line-height:1;overflow:hidden;font-family:var(--emoji-font-family);cursor:pointer}@media (hover:hover) and (pointer:fine){.emoji:hover,button.emoji:hover{background:var(--button-hover-background)}}.emoji.active,.emoji:active,button.emoji.active,button.emoji:active{background:var(--button-active-background)}.onscreen .custom-emoji::after{content:"";width:var(--emoji-size);height:var(--emoji-size);background-repeat:no-repeat;background-position:center center;background-size:contain;background-image:var(--custom-emoji-background)}.nav,.nav-button{align-items:center}.nav{display:grid;justify-content:space-between;contain:content}.nav-button{display:flex;justify-content:center}.nav-emoji{font-size:var(--category-emoji-size);width:var(--total-category-emoji-size);height:var(--total-category-emoji-size)}.indicator-wrapper{display:flex;border-bottom:1px solid var(--border-color)}.indicator{width:calc(100%/var(--num-groups));height:var(--indicator-height);opacity:var(--indicator-opacity);background-color:var(--indicator-color);will-change:transform,opacity;transition:opacity .1s linear,transform .25s ease-in-out}@media (prefers-reduced-motion:reduce){.indicator{will-change:opacity;transition:opacity .1s linear}}.pad-top,input.search{background:var(--background);width:100%}.pad-top{height:var(--emoji-padding);z-index:3}.search-row{display:flex;align-items:center;position:relative;padding-inline-start:var(--emoji-padding);padding-bottom:var(--emoji-padding)}.search-wrapper{flex:1;min-width:0}input.search{padding:var(--input-padding);border-radius:var(--input-border-radius);border:var(--input-border-size) solid var(--input-border-color);color:var(--input-font-color);font-size:var(--input-font-size);line-height:var(--input-line-height)}input.search::placeholder{color:var(--input-placeholder-color)}.favorites{overflow-y:auto;scrollbar-gutter:stable;display:flex;flex-direction:row;border-top:var(--border-size) solid var(--border-color);contain:content}.message{padding:var(--emoji-padding)}',nD=["customEmoji","customCategorySorting","database","dataSource","i18n","locale","skinToneEmoji","emojiVersion"],k7=`:host{--emoji-font-family:${eD}}`,Od=class extends HTMLElement{constructor(t){super(),this.attachShadow({mode:"open"});let n=document.createElement("style");n.textContent=E7+k7,this.shadowRoot.appendChild(n),this._ctx={locale:v7,dataSource:x7,skinToneEmoji:$V,customCategorySorting:PV,customEmoji:null,i18n:w7,emojiVersion:null,...t};for(let o of nD)o!=="database"&&Object.prototype.hasOwnProperty.call(this,o)&&(this._ctx[o]=this[o],delete this[o]);this._dbFlush()}connectedCallback(){nk(this),this._cmp||(this._cmp=y7(this.shadowRoot,this._ctx))}disconnectedCallback(){nk(this),db(()=>{if(!this.isConnected&&this._cmp){this._cmp.$destroy(),this._cmp=void 0;let{database:t}=this._ctx;t.close().catch(n=>console.error(n))}})}static get observedAttributes(){return["locale","data-source","skin-tone-emoji","emoji-version"]}attributeChangedCallback(t,n,o){this._set(t.replace(/-([a-z])/g,(i,r)=>r.toUpperCase()),t==="emoji-version"?parseFloat(o):o)}_set(t,n){this._ctx[t]=n,this._cmp&&this._cmp.$set({[t]:n}),["locale","dataSource"].includes(t)&&this._dbFlush()}_dbCreate(){let{locale:t,dataSource:n,database:o}=this._ctx;(!o||o.locale!==t||o.dataSource!==n)&&this._set("database",new sb({locale:t,dataSource:n}))}_dbFlush(){db(()=>this._dbCreate())}},oD={};for(let e of nD)oD[e]={get(){return e==="database"&&this._dbCreate(),this._ctx[e]},set(t){if(e==="database")throw new Error("database is read-only");this._set(e,t)}};Object.defineProperties(Od.prototype,oD);customElements.get("emoji-picker")||customElements.define("emoji-picker",Od)});function ik(e,t){e.indexOf(t)===-1&&e.push(t)}function Pl(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var rk=O(()=>{});var jo,sD=O(()=>{jo=(e,t,n)=>n>t?t:n<e?e:n});var Er,ii,ak=O(()=>{Er=()=>{},ii=()=>{}});var Po,lD=O(()=>{Po={}});var cf,cD=O(()=>{cf=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e)});var sk,dD=O(()=>{sk=e=>typeof e=="object"&&e!==null});var df,uD=O(()=>{df=e=>/^0[^.\s]+$/u.test(e)});function uf(e){let t;return()=>(t===void 0&&(t=e()),t)}var pD=O(()=>{});var Ai,ub=O(()=>{Ai=e=>e});var Bl,fD=O(()=>{Bl=(...e)=>e.reduce((t,n)=>o=>n(t(o)))});var Vl,mD=O(()=>{Vl=(e,t,n)=>{let o=t-e;return o?(n-e)/o:1}});var Ul,gD=O(()=>{rk();Ul=class{constructor(){this.subscriptions=[]}add(t){return ik(this.subscriptions,t),()=>Pl(this.subscriptions,t)}notify(t,n,o){let i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,o);else for(let r=0;r<i;r++){let a=this.subscriptions[r];a&&a(t,n,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}});var eo,Ao,hD=O(()=>{eo=e=>e*1e3,Ao=e=>e/1e3});var pf,bD=O(()=>{pf=(e,t)=>t?e*(1e3/t):0});var yD,xD=O(()=>{yD=(e,t,n)=>{let o=t-e;return((n-e)%o+o)%o+e}});function C7(e,t,n,o,i){let r,a,s=0;do a=t+(n-t)/2,r=vD(a,o,i)-e,r>0?n=a:t=a;while(Math.abs(r)>A7&&++s<M7);return a}function $s(e,t,n,o){if(e===t&&n===o)return Ai;let i=r=>C7(r,0,1,e,n);return r=>r===0||r===1?r:vD(i(r),t,o)}var vD,A7,M7,pb=O(()=>{ub();vD=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,A7=1e-7,M7=12});var fb,lk=O(()=>{fb=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2});var ql,mb=O(()=>{ql=e=>t=>1-e(1-t)});var gb,$d,ff,hb=O(()=>{pb();lk();mb();gb=$s(.33,1.53,.69,.99),$d=ql(gb),ff=fb($d)});var mf,ck=O(()=>{hb();mf=e=>e>=1?1:(e*=2)<1?.5*$d(e):.5*(2-Math.pow(2,-10*(e-1)))});var gf,dk,hf,uk=O(()=>{lk();mb();gf=e=>1-Math.sin(Math.acos(e)),dk=ql(gf),hf=fb(gf)});var pk,fk,bf,mk=O(()=>{pb();pk=$s(.42,0,1,1),fk=$s(0,0,.58,1),bf=$s(.42,0,.58,1)});var yf,gk=O(()=>{yf=e=>Array.isArray(e)&&typeof e[0]!="number"});function xf(e,t){return yf(e)?e[yD(0,e.length,t)]:e}var wD=O(()=>{xD();gk()});var vf,hk=O(()=>{vf=e=>Array.isArray(e)&&typeof e[0]=="number"});var ED,L7,bb,kD=O(()=>{ak();ub();ck();hb();uk();pb();mk();hk();ED={linear:Ai,easeIn:pk,easeInOut:bf,easeOut:fk,circIn:gf,circInOut:hf,circOut:dk,backIn:$d,backInOut:ff,backOut:gb,anticipate:mf},L7=e=>typeof e=="string",bb=e=>{if(vf(e)){ii(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,n,o,i]=e;return $s(t,n,o,i)}else if(L7(e))return ii(ED[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),ED[e];return e}});var At=O(()=>{rk();sD();ak();lD();cD();dD();uD();pD();ub();fD();mD();gD();hD();bD();ck();hb();uk();mk();mb();wD();hk();gk();kD()});var wf,SD=O(()=>{wf=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"]});function TD(e){let t=new Set,n=new Set,o=!1,i=!1,r=new WeakSet,a={delta:0,timestamp:0,isProcessing:!1};function s(c){r.has(c)&&(l.schedule(c),e()),c(a)}let l={schedule:(c,u=!1,d=!1)=>{let g=d&&o?t:n;return u&&r.add(c),g.add(c),c},cancel:c=>{n.delete(c),r.delete(c)},process:c=>{if(a=c,o){i=!0;return}o=!0;let u=t;t=n,n=u,t.forEach(s),t.clear(),o=!1,i&&(i=!1,l.process(c))}};return l}var AD=O(()=>{});function yb(e,t){let n=!1,o=!0,i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,a=wf.reduce((b,E)=>(b[E]=TD(r),b),{}),{setup:s,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:p,render:g,postRender:y}=a,v=()=>{let b=Po.useManualTiming,E=b?i.timestamp:performance.now();n=!1,b||(i.delta=o?1e3/60:Math.max(Math.min(E-i.timestamp,_7),1)),i.timestamp=E,i.isProcessing=!0,s.process(i),l.process(i),c.process(i),u.process(i),d.process(i),p.process(i),g.process(i),y.process(i),i.isProcessing=!1,n&&t&&(o=!1,e(v))},x=()=>{n=!0,o=!0,i.isProcessing||e(v)};return{schedule:wf.reduce((b,E)=>{let S=a[E];return b[E]=(A,_=!1,T=!1)=>(n||x(),S.schedule(A,_,T)),b},{}),cancel:b=>{for(let E=0;E<wf.length;E++)a[wf[E]].cancel(b)},state:i,steps:a}}var _7,bk=O(()=>{At();SD();AD();_7=40});var Mo,Ef,Nd,oW,Ns=O(()=>{At();bk();({schedule:Mo,cancel:Ef,state:Nd,steps:oW}=yb(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ai,!0))});function D7(){xb=void 0}var xb,io,Kl=O(()=>{At();Ns();io={now:()=>(xb===void 0&&io.set(Nd.isProcessing||Po.useManualTiming?Nd.timestamp:performance.now()),xb),set:e=>{xb=e,queueMicrotask(D7)}}});function yk(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}var MD,vb,R7,jd,H7,Pd=O(()=>{MD=e=>t=>typeof t=="string"&&t.startsWith(e),vb=MD("--"),R7=MD("var(--"),jd=e=>R7(e)?H7.test(e.split("/*")[0].trim()):!1,H7=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu});var Yr,Va,kf,js=O(()=>{At();Yr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Va={...Yr,transform:e=>jo(0,1,e)},kf={...Yr,default:1}});var Ps,wb=O(()=>{Ps=e=>Math.round(e*1e5)/1e5});var Bd,Eb=O(()=>{Bd=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu});function CD(e){return e==null}var LD=O(()=>{});var _D,DD=O(()=>{_D=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu});var Vd,kb,Sb=O(()=>{Eb();LD();DD();Vd=(e,t)=>n=>!!(typeof n=="string"&&_D.test(n)&&n.startsWith(e)||t&&!CD(n)&&Object.prototype.hasOwnProperty.call(n,t)),kb=(e,t,n)=>o=>{if(typeof o!="string")return o;let[i,r,a,s]=o.match(Bd);return{[e]:parseFloat(i),[t]:parseFloat(r),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}}});var z7,xk,Xr,Tb=O(()=>{At();js();wb();Sb();z7=e=>jo(0,255,e),xk={...Yr,transform:e=>Math.round(z7(e))},Xr={test:Vd("rgb","red"),parse:kb("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:o=1})=>"rgba("+xk.transform(e)+", "+xk.transform(t)+", "+xk.transform(n)+", "+Ps(Va.transform(o))+")"}});function O7(e){let t="",n="",o="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),o=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),o=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,o+=o,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}}var Sf,vk=O(()=>{Tb();Sb();Sf={test:Vd("#"),parse:O7,transform:Xr.transform}});var Tf,kr,Bs,Ge,RD,HD,wk,Il=O(()=>{Tf=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),kr=Tf("deg"),Bs=Tf("%"),Ge=Tf("px"),RD=Tf("vh"),HD=Tf("vw"),wk={...Bs,parse:e=>Bs.parse(e)/100,transform:e=>Bs.transform(e*100)}});var Vs,Ek=O(()=>{js();Il();wb();Sb();Vs={test:Vd("hsl","hue"),parse:kb("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:o=1})=>"hsla("+Math.round(e)+", "+Bs.transform(Ps(t))+", "+Bs.transform(Ps(n))+", "+Ps(Va.transform(o))+")"}});var Tn,Af=O(()=>{vk();Ek();Tb();Tn={test:e=>Xr.test(e)||Sf.test(e)||Vs.test(e),parse:e=>Xr.test(e)?Xr.parse(e):Vs.test(e)?Vs.parse(e):Sf.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Xr.transform(e):Vs.transform(e),getAnimatableNone:e=>{let t=Tn.parse(e);return t.alpha=0,Tn.transform(t)}}});var zD,OD=O(()=>{zD=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu});function $7(e){return isNaN(e)&&typeof e=="string"&&(e.match(Bd)?.length||0)+(e.match(zD)?.length||0)>0}function Us(e){let t=e.toString(),n=[],o={color:[],number:[],var:[]},i=[],r=0,s=t.replace(P7,l=>(Tn.test(l)?(o.color.push(r),i.push(jD),n.push(Tn.parse(l))):l.startsWith(j7)?(o.var.push(r),i.push(N7),n.push(l)):(o.number.push(r),i.push(ND),n.push(parseFloat(l))),++r,$D)).split($D);return{values:n,split:s,indexes:o,types:i}}function B7(e){return Us(e).values}function PD({split:e,types:t}){let n=e.length;return o=>{let i="";for(let r=0;r<n;r++)if(i+=e[r],o[r]!==void 0){let a=t[r];a===ND?i+=Ps(o[r]):a===jD?i+=Tn.transform(o[r]):i+=o[r]}return i}}function V7(e){return PD(Us(e))}function K7(e){let t=Us(e);return PD(t)(t.values.map((o,i)=>q7(o,t.split[i])))}var ND,jD,N7,j7,$D,P7,U7,q7,ro,Wr=O(()=>{Af();OD();Eb();wb();ND="number",jD="color",N7="var",j7="var(",$D="${}",P7=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;U7=e=>typeof e=="number"?0:Tn.test(e)?Tn.getAnimatableNone(e):e,q7=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:U7(e);ro={test:$7,parse:B7,createTransformer:V7,getAnimatableNone:K7}});function kk(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function BD({hue:e,saturation:t,lightness:n,alpha:o}){e/=360,t/=100,n/=100;let i=0,r=0,a=0;if(!t)i=r=a=n;else{let s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=kk(l,s,e+1/3),r=kk(l,s,e),a=kk(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(a*255),alpha:o}}var VD=O(()=>{});function Ud(e,t){return n=>n>0?t:e}var Sk=O(()=>{});var Mi,Gl=O(()=>{Mi=(e,t,n)=>e+(t-e)*n});function UD(e){let t=G7(e);if(Er(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===Vs&&(n=BD(n)),n}var Tk,I7,G7,Ak,qD=O(()=>{At();vk();Ek();VD();Tb();Sk();Gl();Tk=(e,t,n)=>{let o=e*e,i=n*(t*t-o)+o;return i<0?0:Math.sqrt(i)},I7=[Sf,Xr,Vs],G7=e=>I7.find(t=>t.test(e));Ak=(e,t)=>{let n=UD(e),o=UD(t);if(!n||!o)return Ud(e,t);let i={...n};return r=>(i.red=Tk(n.red,o.red,r),i.green=Tk(n.green,o.green,r),i.blue=Tk(n.blue,o.blue,r),i.alpha=Mi(n.alpha,o.alpha,r),Xr.transform(i))}});function KD(e,t){return Ab.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}var Ab,ID=O(()=>{Ab=new Set(["none","hidden"])});function F7(e,t){return n=>Mi(e,t,n)}function Mb(e){return typeof e=="number"?F7:typeof e=="string"?jd(e)?Ud:Tn.test(e)?Ak:W7:Array.isArray(e)?GD:typeof e=="object"?Tn.test(e)?Ak:Y7:Ud}function GD(e,t){let n=[...e],o=n.length,i=e.map((r,a)=>Mb(r)(r,t[a]));return r=>{for(let a=0;a<o;a++)n[a]=i[a](r);return n}}function Y7(e,t){let n={...e,...t},o={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(o[i]=Mb(e[i])(e[i],t[i]));return i=>{for(let r in o)n[r]=o[r](i);return n}}function X7(e,t){let n=[],o={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let r=t.types[i],a=e.indexes[r][o[r]],s=e.values[a]??0;n[i]=s,o[r]++}return n}var W7,FD=O(()=>{At();Pd();Af();Wr();qD();Sk();Gl();ID();W7=(e,t)=>{let n=ro.createTransformer(t),o=Us(e),i=Us(t);return o.indexes.var.length===i.indexes.var.length&&o.indexes.color.length===i.indexes.color.length&&o.indexes.number.length>=i.indexes.number.length?Ab.has(e)&&!i.values.length||Ab.has(t)&&!o.values.length?KD(e,t):Bl(GD(X7(o,i),i.values),n):(Er(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Ud(e,t))}});function Cb(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Mi(e,t,n):Mb(e)(e,t)}var Mk=O(()=>{FD();Gl()});var YD,XD=O(()=>{Kl();Ns();YD=e=>{let t=({timestamp:n})=>e(n);return{start:(n=!0)=>Mo.update(t,n),stop:()=>Ef(t),now:()=>Nd.isProcessing?Nd.timestamp:io.now()}}});var Lb,Ck=O(()=>{Lb=(e,t,n=10)=>{let o="",i=Math.max(Math.round(t/n),2);for(let r=0;r<i;r++)o+=Math.round(e(r/(i-1))*1e4)/1e4+", ";return`linear(${o.substring(0,o.length-2)})`}});function qd(e){let t=0,n=50,o=e.next(t);for(;!o.done&&t<2e4;)t+=n,o=e.next(t);return t>=2e4?1/0:t}var _b=O(()=>{});function Mf(e,t=100,n){let o=n({...e,keyframes:[0,t]}),i=Math.min(qd(o),2e4);return{type:"keyframes",ease:r=>o.next(i*r).value/t,duration:Ao(i)}}var _k=O(()=>{At();_b()});function Rk(e,t){return e*Math.sqrt(1-t*t)}function Q7(e,t,n){let o=n;for(let i=1;i<Z7;i++)o=o-e(o)/t(o);return o}function J7({duration:e=Cn.duration,bounce:t=Cn.bounce,velocity:n=Cn.velocity,mass:o=Cn.mass}){let i,r;Er(e<=eo(Cn.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-t;a=jo(Cn.minDamping,Cn.maxDamping,a),e=jo(Cn.minDuration,Cn.maxDuration,Ao(e)),a<1?(i=c=>{let u=c*a,d=u*e,p=u-n,g=Rk(c,a),y=Math.exp(-d);return Dk-p/g*y},r=c=>{let d=c*a*e,p=d*n+n,g=Math.pow(a,2)*Math.pow(c,2)*e,y=Math.exp(-d),v=Rk(Math.pow(c,2),a);return(-i(c)+Dk>0?-1:1)*((p-g)*y)/v}):(i=c=>{let u=Math.exp(-c*e),d=(c-n)*e+1;return-Dk+u*d},r=c=>{let u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});let s=5/e,l=Q7(i,r,s);if(e=eo(e),isNaN(l))return{stiffness:Cn.stiffness,damping:Cn.damping,duration:e};{let c=Math.pow(l,2)*o;return{stiffness:c,damping:a*2*Math.sqrt(o*c),duration:e}}}function WD(e,t){return t.some(n=>e[n]!==void 0)}function nU(e){let t={velocity:Cn.velocity,stiffness:Cn.stiffness,damping:Cn.damping,mass:Cn.mass,isResolvedFromDuration:!1,...e};if(!WD(e,tU)&&WD(e,eU))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,o=2*Math.PI/(n*1.2),i=o*o,r=2*jo(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Cn.mass,stiffness:i,damping:r}}else{let n=J7({...e,velocity:0});t={...t,...n,mass:Cn.mass},t.isResolvedFromDuration=!0}return t}function Ua(e=Cn.visualDuration,t=Cn.bounce){let n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:o,restDelta:i}=n,r=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],s={done:!1,value:r},{stiffness:l,damping:c,mass:u,duration:d,velocity:p,isResolvedFromDuration:g}=nU({...n,velocity:-Ao(n.velocity||0)}),y=p||0,v=c/(2*Math.sqrt(l*u)),x=a-r,h=Ao(Math.sqrt(l/u)),m=Math.abs(x)<5;o||(o=m?Cn.restSpeed.granular:Cn.restSpeed.default),i||(i=m?Cn.restDelta.granular:Cn.restDelta.default);let b,E,S,A,_,T;if(v<1)S=Rk(h,v),A=(y+v*h*x)/S,b=R=>{let z=Math.exp(-v*h*R);return a-z*(A*Math.sin(S*R)+x*Math.cos(S*R))},_=v*h*A+x*S,T=v*h*x-A*S,E=R=>Math.exp(-v*h*R)*(_*Math.sin(S*R)+T*Math.cos(S*R));else if(v===1){b=z=>a-Math.exp(-h*z)*(x+(y+h*x)*z);let R=y+h*x;E=z=>Math.exp(-h*z)*(h*R*z-y)}else{let R=h*Math.sqrt(v*v-1);b=le=>{let J=Math.exp(-v*h*le),V=Math.min(R*le,300);return a-J*((y+v*h*x)*Math.sinh(V)+R*x*Math.cosh(V))/R};let z=(y+v*h*x)/R,F=v*h*z-x*R,B=v*h*x-z*R;E=le=>{let J=Math.exp(-v*h*le),V=Math.min(R*le,300);return J*(F*Math.sinh(V)+B*Math.cosh(V))}}let H={calculatedDuration:g&&d||null,velocity:R=>eo(E(R)),next:R=>{if(!g&&v<1){let F=Math.exp(-v*h*R),B=Math.sin(S*R),le=Math.cos(S*R),J=a-F*(A*B+x*le),V=eo(F*(_*B+T*le));return s.done=Math.abs(V)<=o&&Math.abs(a-J)<=i,s.value=s.done?a:J,s}let z=b(R);if(g)s.done=R>=d;else{let F=eo(E(R));s.done=Math.abs(F)<=o&&Math.abs(a-z)<=i}return s.value=s.done?a:z,s},toString:()=>{let R=Math.min(qd(H),2e4),z=Lb(F=>H.next(R*F).value,R,30);return R+"ms "+z},toTransition:()=>{}};return H}var Cn,Z7,Dk,eU,tU,Db=O(()=>{At();Ck();_b();_k();Cn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};Z7=12;Dk=.001;eU=["duration","bounce"],tU=["stiffness","damping","mass"];Ua.applyToOptions=e=>{let t=Mf(e,100,Ua);return e.ease=t.ease,e.duration=eo(t.duration),e.type="keyframes",e}});function Rb(e,t,n){let o=Math.max(t-oU,0);return pf(n-e(o),t-o)}var oU,Hk=O(()=>{At();oU=5});function Cf({keyframes:e,velocity:t=0,power:n=.8,timeConstant:o=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:a,min:s,max:l,restDelta:c=.5,restSpeed:u}){let d=e[0],p={done:!1,value:d},g=T=>s!==void 0&&T<s||l!==void 0&&T>l,y=T=>s===void 0?l:l===void 0||Math.abs(s-T)<Math.abs(l-T)?s:l,v=n*t,x=d+v,h=a===void 0?x:a(x);h!==x&&(v=h-d);let m=T=>-v*Math.exp(-T/o),b=T=>h+m(T),E=T=>{let H=m(T),R=b(T);p.done=Math.abs(H)<=c,p.value=p.done?h:R},S,A,_=T=>{g(p.value)&&(S=T,A=Ua({keyframes:[p.value,y(p.value)],velocity:Rb(b,T,p.value),damping:i,stiffness:r,restDelta:c,restSpeed:u}))};return _(0),{calculatedDuration:null,next:T=>{let H=!1;return!A&&S===void 0&&(H=!0,E(T),_(T)),S!==void 0&&T>=S?A.next(T-S):(!H&&E(T),p)}}}var zk=O(()=>{Db();Hk()});function iU(e,t,n){let o=[],i=n||Po.mix||Cb,r=e.length-1;for(let a=0;a<r;a++){let s=i(e[a],e[a+1]);if(t){let l=Array.isArray(t)?t[a]||Ai:t;s=Bl(l,s)}o.push(s)}return o}function ZD(e,t,{clamp:n=!0,ease:o,mixer:i}={}){let r=e.length;if(ii(r===t.length,"Both input and output ranges must be the same length","range-length"),r===1)return()=>t[0];if(r===2&&t[0]===t[1])return()=>t[1];let a=e[0]===e[1];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=iU(t,o,i),l=s.length,c=u=>{if(a&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);let p=Vl(e[d],e[d+1],u);return s[d](p)};return n?u=>c(jo(e[0],e[r-1],u)):c}var QD=O(()=>{At();Mk()});function Lf(e,t){let n=e[e.length-1];for(let o=1;o<=t;o++){let i=Vl(0,t,o);e.push(Mi(n,1,i))}}var Ok=O(()=>{At();Gl()});function _f(e){let t=[0];return Lf(t,e.length-1),t}var $k=O(()=>{Ok()});function JD(e,t){return e.map(n=>n*t)}var e3=O(()=>{});function rU(e,t){return e.map(()=>t||bf).splice(0,e.length-1)}function Fl({duration:e=300,keyframes:t,times:n,ease:o="easeInOut"}){let i=yf(o)?o.map(bb):bb(o),r={done:!1,value:t[0]},a=JD(n&&n.length===t.length?n:_f(t),e),s=ZD(a,t,{ease:Array.isArray(i)?i:rU(t,i)});return{calculatedDuration:e,next:l=>(r.value=s(l),r.done=l>=e,r)}}var Nk=O(()=>{At();QD();$k();e3()});function qs(e,{repeat:t,repeatType:n="loop"},o,i=1){let r=e.filter(aU),s=i<0||t&&n!=="loop"&&t%2===1?0:r.length-1;return!s||o===void 0?r[s]:o}var aU,Df=O(()=>{aU=e=>e!==null});function Hb(e){typeof e.type=="string"&&(e.type=sU[e.type])}var sU,jk=O(()=>{zk();Nk();Db();sU={decay:Cf,inertia:Cf,tween:Fl,keyframes:Fl,spring:Ua}});var Ks,zb=O(()=>{Ks=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}});var lU,qa,Ob=O(()=>{At();Kl();Mk();XD();zk();Nk();_b();Hk();Df();jk();zb();lU=e=>e/100,qa=class extends Ks{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:n}=this.options;n&&n.updatedAt!==io.now()&&this.tick(io.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){let{options:t}=this;Hb(t);let{type:n=Fl,repeat:o=0,repeatDelay:i=0,repeatType:r,velocity:a=0}=t,{keyframes:s}=t,l=n||Fl;l!==Fl&&typeof s[0]!="number"&&(this.mixKeyframes=Bl(lU,Cb(s[0],s[1])),s=[0,100]);let c=l({...t,keyframes:s});r==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...s].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=qd(c));let{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(o+1)-i,this.generator=c}updateTime(t){let n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){let{generator:o,totalDuration:i,mixKeyframes:r,mirroredGenerator:a,resolvedDuration:s,calculatedDuration:l}=this;if(this.startTime===null)return o.next(0);let{delay:c=0,keyframes:u,repeat:d,repeatType:p,repeatDelay:g,type:y,onUpdate:v,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);let h=this.currentTime-c*(this.playbackSpeed>=0?1:-1),m=this.playbackSpeed>=0?h<0:h>i;this.currentTime=Math.max(h,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let b=this.currentTime,E=o;if(d){let T=Math.min(this.currentTime,i)/s,H=Math.floor(T),R=T%1;!R&&T>=1&&(R=1),R===1&&H--,H=Math.min(H,d+1),H%2&&(p==="reverse"?(R=1-R,g&&(R-=g/s)):p==="mirror"&&(E=a)),b=jo(0,1,R)*s}let S;m?(this.delayState.value=u[0],S=this.delayState):S=E.next(b),r&&!m&&(S.value=r(S.value));let{done:A}=S;!m&&l!==null&&(A=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);let _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return _&&y!==Cf&&(S.value=qs(u,this.options,x,this.speed)),v&&v(S.value),_&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return Ao(this.calculatedDuration)}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+Ao(t)}get time(){return Ao(this.currentTime)}set time(t){t=eo(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){let t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);let n=this.generator.next(t).value;return Rb(o=>this.generator.next(o).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){let n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(io.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Ao(this.currentTime))}play(){if(this.isStopped)return;let{driver:t=YD,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),this.options.onPlay?.();let o=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=o):this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime||(this.startTime=n??o),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(io.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}});function t3(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var n3=O(()=>{});function $b(e){return e.includes("scale")?1:0}function Nb(e,t){if(!e||e==="none")return $b(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),o,i;if(n)o=dU,i=n;else{let s=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);o=cU,i=s}if(!i)return $b(t);let r=o[t],a=i[1].split(",").map(uU);return typeof r=="function"?r(a):a[r]}function uU(e){return parseFloat(e.trim())}var Yl,Pk,cU,Bk,o3,i3,r3,dU,a3,Vk=O(()=>{Yl=e=>e*180/Math.PI,Pk=e=>{let t=Yl(Math.atan2(e[1],e[0]));return Bk(t)},cU={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Pk,rotateZ:Pk,skewX:e=>Yl(Math.atan(e[1])),skewY:e=>Yl(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Bk=e=>(e=e%360,e<0&&(e+=360),e),o3=Pk,i3=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),r3=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),dU={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:i3,scaleY:r3,scale:e=>(i3(e)+r3(e))/2,rotateX:e=>Bk(Yl(Math.atan2(e[6],e[5]))),rotateY:e=>Bk(Yl(Math.atan2(-e[2],e[0]))),rotateZ:o3,rotate:o3,skewX:e=>Yl(Math.atan(e[4])),skewY:e=>Yl(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};a3=(e,t)=>{let{transform:n="none"}=getComputedStyle(e);return Nb(n,t)}});var Zr,er,Sr=O(()=>{Zr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],er=new Set([...Zr,"pathRotation"])});function s3(e){let t=[];return fU.forEach(n=>{let o=e.getValue(n);o!==void 0&&(t.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))}),t}var Uk,pU,fU,Ka,qk=O(()=>{Vk();Sr();js();Il();Uk=e=>e===Yr||e===Ge,pU=new Set(["x","y","z"]),fU=Zr.filter(e=>!pU.has(e));Ka={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:o})=>{let i=e.max-e.min;return o==="border-box"?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:o})=>{let i=e.max-e.min;return o==="border-box"?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Nb(t,"x"),y:(e,{transform:t})=>Nb(t,"y")};Ka.translateX=Ka.x;Ka.translateY=Ka.y});function l3(){if(Ik){let e=Array.from(Xl).filter(o=>o.needsMeasurement),t=new Set(e.map(o=>o.element)),n=new Map;t.forEach(o=>{let i=s3(o);i.length&&(n.set(o,i),o.render())}),e.forEach(o=>o.measureInitialState()),t.forEach(o=>{o.render();let i=n.get(o);i&&i.forEach(([r,a])=>{o.getValue(r)?.set(a)})}),e.forEach(o=>o.measureEndState()),e.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}Ik=!1,Kk=!1,Xl.forEach(e=>e.complete(Gk)),Xl.clear()}function c3(){Xl.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ik=!0)})}function d3(){Gk=!0,c3(),l3(),Gk=!1}var Xl,Kk,Ik,Gk,Is,jb=O(()=>{n3();qk();Ns();Xl=new Set,Kk=!1,Ik=!1,Gk=!1;Is=class{constructor(t,n,o,i,r,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=o,this.motionValue=i,this.element=r,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Xl.add(this),Kk||(Kk=!0,Mo.read(c3),Mo.resolveKeyframes(l3))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:n,element:o,motionValue:i}=this;if(t[0]===null){let r=i?.get(),a=t[t.length-1];if(r!==void 0)t[0]=r;else if(o&&n){let s=o.readValue(n,a);s!=null&&(t[0]=s)}t[0]===void 0&&(t[0]=a),i&&r===void 0&&i.set(t[0])}t3(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Xl.delete(this)}cancel(){this.state==="scheduled"&&(Xl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}});var u3,p3=O(()=>{u3=e=>e.startsWith("--")});function Pb(e,t,n){u3(t)?e.style.setProperty(t,n):e.style[t]=n}var Fk=O(()=>{p3()});var f3,m3=O(()=>{f3={}});function Bb(e,t){let n=uf(e);return()=>f3[t]??n()}var Yk=O(()=>{At();m3()});var g3,h3=O(()=>{Yk();g3=Bb(()=>window.ScrollTimeline!==void 0,"scrollTimeline")});var Vb,Xk=O(()=>{Yk();Vb=Bb(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing")});var Wl,Wk=O(()=>{Wl=([e,t,n,o])=>`cubic-bezier(${e}, ${t}, ${n}, ${o})`});var Zk,b3=O(()=>{Wk();Zk={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wl([0,.65,.55,1]),circOut:Wl([.55,0,1,.45]),backIn:Wl([.31,.01,.66,-.59]),backOut:Wl([.33,1.53,.69,.99])}});function Qk(e,t){if(e)return typeof e=="function"?Vb()?Lb(e,t):"ease-out":vf(e)?Wl(e):Array.isArray(e)?e.map(n=>Qk(n,t)||Zk.easeOut):Zk[e]}var y3=O(()=>{At();Xk();Ck();Wk();b3()});function x3(e,t,n,{delay:o=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:s="easeOut",times:l}={},c=void 0){let u={[t]:n};l&&(u.offset=l);let d=Qk(s,i);Array.isArray(d)&&(u.easing=d);let p={delay:o,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:r+1,direction:a==="reverse"?"alternate":"normal"};return c&&(p.pseudoElement=c),e.animate(u,p)}var v3=O(()=>{y3()});function Zl(e){return typeof e=="function"&&"applyToOptions"in e}var Ub=O(()=>{});function w3({type:e,...t}){return Zl(e)&&Vb()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}var E3=O(()=>{Xk();Ub()});var Kd,Jk=O(()=>{At();Fk();h3();Df();zb();v3();E3();Kd=class extends Ks{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;let{element:n,name:o,keyframes:i,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:s,onComplete:l}=t;this.isPseudoElement=!!r,this.allowFlatten=a,this.options=t,ii(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let c=w3(t);this.animation=x3(n,o,i,c,r),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){let u=qs(i,this.options,s,this.speed);this.updateMotionValue&&this.updateMotionValue(u),Pb(n,o,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){let t=this.animation.effect?.getComputedTiming?.().duration||0;return Ao(Number(t))}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+Ao(t)}get time(){return Ao(Number(this.animation.currentTime)||0)}set time(t){let n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=eo(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:o,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&g3()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),o&&(this.animation.rangeEnd=o),Ai):i(this)}}});function mU(e){return e in k3}function S3(e){typeof e.ease=="string"&&mU(e.ease)&&(e.ease=k3[e.ease])}var k3,T3=O(()=>{At();k3={anticipate:mf,backInOut:ff,circInOut:hf}});var eS,qb,A3=O(()=>{At();Kl();Fk();Ob();Jk();jk();T3();eS=10,qb=class extends Kd{constructor(t){S3(t),Hb(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){let{motionValue:n,onUpdate:o,onComplete:i,element:r,...a}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}let s=new qa({...a,autoplay:!1}),l=Math.max(eS,io.now()-this.startTime),c=jo(0,eS,l-eS),u=s.sample(l).value,{name:d}=this.options;r&&d&&Pb(r,d,u),n.setWithVelocity(s.sample(Math.max(0,l-c)).value,u,c),s.stop()}}});var tS,M3=O(()=>{Wr();tS=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ro.test(e)||e==="0")&&!e.startsWith("url("))});function gU(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function C3(e,t,n,o){let i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;let r=e[e.length-1],a=tS(i,t),s=tS(r,t);return Er(a===s,`You are trying to animate ${t} from "${i}" to "${r}". "${a?r:i}" is not an animatable value.`,"value-not-animatable"),!a||!s?!1:gU(e)||(n==="spring"||Zl(n))&&o}var L3=O(()=>{At();Ub();M3()});function Rf(e){e.duration=0,e.type="keyframes"}var nS=O(()=>{});var Kb,oS=O(()=>{Kb=new Set(["opacity","clipPath","filter","transform","backgroundColor"])});function _3(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&hU.test(e[t]))return!0;return!1}var hU,D3=O(()=>{hU=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/});function R3(e){let{motionValue:t,name:n,repeatDelay:o,repeatType:i,damping:r,type:a,keyframes:s}=e,l=t?.owner?.current;if(!(l instanceof HTMLElement)&&!(l instanceof SVGElement))return!1;let{onUpdate:c,transformTemplate:u}=t.owner.getProps();return yU()&&n&&(Kb.has(n)||bU.has(n)&&_3(s))&&(n!=="transform"||!u)&&!c&&!o&&i!=="mirror"&&r!==0&&a!=="inertia"}var bU,yU,H3=O(()=>{At();oS();D3();bU=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),yU=uf(()=>Object.hasOwnProperty.call(Element.prototype,"animate"))});var xU,Ib,z3=O(()=>{At();Kl();Ob();Df();jb();A3();L3();nS();zb();H3();xU=40,Ib=class extends Ks{constructor({autoplay:t=!0,delay:n=0,type:o="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:a="loop",keyframes:s,name:l,motionValue:c,element:u,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=io.now();let p={autoplay:t,delay:n,type:o,repeat:i,repeatDelay:r,repeatType:a,name:l,motionValue:c,element:u,...d},g=u?.KeyframeResolver||Is;this.keyframeResolver=new g(s,(y,v,x)=>this.onKeyframesResolved(y,v,p,!x),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,o,i){this.keyframeResolver=void 0;let{name:r,type:a,velocity:s,delay:l,isHandoff:c,onUpdate:u}=o;this.resolvedAt=io.now();let d=!0;C3(t,r,a,s)||(d=!1,(Po.instantAnimations||!l)&&u?.(qs(t,o,n)),t[0]=t[t.length-1],Rf(o),o.repeat=0);let g={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>xU?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...o,keyframes:t},y=d&&!c&&R3(g),v=g.motionValue?.owner?.current,x;if(y)try{x=new qb({...g,element:v})}catch{x=new qa(g)}else x=new qa(g);x.finished.then(()=>{this.notifyFinished()}).catch(Ai),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),d3()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}});function O3(e,t){let n=0;for(let o=0;o<e.length;o++){let i=e[o][t];i!==null&&i>n&&(n=i)}return n}var Gb,$3=O(()=>{Gb=class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let o=0;o<this.animations.length;o++)this.animations[o][t]=n}attachTimeline(t){let n=this.animations.map(o=>o.attachTimeline(t));return()=>{n.forEach((o,i)=>{o&&o(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return O3(this.animations,"duration")}get iterationDuration(){return O3(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(n=>n[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}});var Hf,N3=O(()=>{$3();Hf=class extends Gb{then(t,n){return this.finished.finally(t).then(()=>{})}}});function tr(e,t){return new Fb(e,t)}var j3,vU,iS,Fb,Id=O(()=>{At();Kl();Ns();j3=30,vU=e=>!isNaN(parseFloat(e)),iS={current:void 0},Fb=class{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=o=>{let i=io.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=io.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=vU(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Ul);let o=this.events[t].add(n);return t==="change"?()=>{o(),Mo.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,o){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-o}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return iS.current&&iS.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=io.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>j3)return 0;let n=Math.min(this.updatedAt-this.prevUpdatedAt,j3);return pf(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}});function Yb(e,t){if(e?.inherit&&t){let{inherit:n,...o}=e;return{...t,...o}}return e}var rS=O(()=>{});function Xb(e,t){let n=e?.[t]??e?.default??e;return n!==e?Yb(n,e):n}var aS=O(()=>{rS()});var wU,EU,kU,SU,P3,B3=O(()=>{Sr();wU={type:"spring",stiffness:500,damping:25,restSpeed:10},EU=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),kU={type:"keyframes",duration:.8},SU={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},P3=(e,{keyframes:t})=>t.length>2?kU:er.has(e)?e.startsWith("scale")?EU(t[1]):wU:SU});function V3(e){for(let t in e)if(!TU.has(t))return!0;return!1}var TU,U3=O(()=>{TU=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"])});var Wb,sS=O(()=>{At();z3();Ob();aS();nS();B3();Df();U3();Ns();Wb=(e,t,n,o={},i,r)=>a=>{let s=Xb(o,e)||{},l=s.delay||o.delay||0,{elapsed:c=0}=o;c=c-eo(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:p=>{t.set(p),s.onUpdate&&s.onUpdate(p)},onComplete:()=>{a(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:r?void 0:i};V3(s)||Object.assign(u,P3(e,u)),u.duration&&(u.duration=eo(u.duration)),u.repeatDelay&&(u.repeatDelay=eo(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Rf(u),u.delay===0&&(d=!0)),(Po.instantAnimations||Po.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,Rf(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!r&&t.get()!==void 0){let p=qs(u.keyframes,s);if(p!==void 0){Mo.update(()=>{u.onUpdate(p),u.onComplete()});return}}return s.isSync?new qa(u):new Ib(u)}});function MU(e){let t=AU.exec(e);if(!t)return[,];let[,n,o,i]=t;return[`--${n??o}`,i]}function lS(e,t,n=1){ii(n<=CU,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[o,i]=MU(e);if(!o)return;let r=window.getComputedStyle(t).getPropertyValue(o);if(r){let a=r.trim();return cf(a)?parseFloat(a):a}return jd(i)?lS(i,t,n+1):i}var AU,CU,q3=O(()=>{At();Pd();AU=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;CU=4});function K3(e){let t=[{},{}];return e?.values.forEach((n,o)=>{t[0][o]=n.get(),t[1][o]=n.getVelocity()}),t}function Zb(e,t,n,o){if(typeof t=="function"){let[i,r]=K3(o);t=t(n!==void 0?n:e.custom,i,r)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[i,r]=K3(o);t=t(n!==void 0?n:e.custom,i,r)}return t}var cS=O(()=>{});function I3(e,t,n){let o=e.getProps();return Zb(o,t,n!==void 0?n:o.custom,e)}var G3=O(()=>{cS()});var Qb,dS=O(()=>{Sr();Qb=new Set(["width","height","top","left","right","bottom",...Zr])});var F3,Y3=O(()=>{F3=e=>Array.isArray(e)});function LU(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,tr(n))}function _U(e){return F3(e)?e[e.length-1]||0:e}function X3(e,t){let n=I3(e,t),{transitionEnd:o={},transition:i={},...r}=n||{};r={...r,...o};for(let a in r){let s=_U(r[a]);LU(e,a,s)}}var W3=O(()=>{Id();G3();Y3()});var xn,Ia=O(()=>{xn=e=>!!(e&&e.getVelocity)});function Z3(e){return!!(xn(e)&&e.add)}var Q3=O(()=>{Ia()});function J3(e,t){let n=e.getValue("willChange");if(Z3(n))return n.add(t);if(!n&&Po.WillChange){let o=new Po.WillChange("auto");e.addValue("willChange",o),o.add(t)}}var e8=O(()=>{At();Q3()});function Gd(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Jb=O(()=>{});var DU,t8,n8=O(()=>{Jb();DU="framerAppearId",t8="data-"+Gd(DU)});function o8(e){return e.props[t8]}var i8=O(()=>{n8()});function RU({protectedKeys:e,needsAnimating:t},n){let o=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,o}function uS(e,t,{delay:n=0,transitionOverride:o,type:i}={}){let{transition:r,transitionEnd:a,...s}=t,l=e.getDefaultTransition();r=r?Yb(r,l):l;let c=r?.reduceMotion,u=r?.skipAnimations;o&&(r=o);let d=[],p=i&&e.animationState&&e.animationState.getState()[i],g=r?.path;g&&g.animateVisualElement(e,s,r,n,d);for(let y in s){let v=e.getValue(y,e.latestValues[y]??null),x=s[y];if(x===void 0||p&&RU(p,y))continue;let h={delay:n,...Xb(r||{},y)};u&&(h.skipAnimations=!0);let m=v.get();if(m!==void 0&&!v.isAnimating()&&!Array.isArray(x)&&x===m&&!h.velocity){Mo.update(()=>v.set(x));continue}let b=!1;if(window.MotionHandoffAnimation){let A=o8(e);if(A){let _=window.MotionHandoffAnimation(A,y,Mo);_!==null&&(h.startTime=_,b=!0)}}J3(e,y);let E=c??e.shouldReduceMotion;v.start(Wb(y,v,x,E&&Qb.has(y)?{type:!1}:h,e,b));let S=v.animation;S&&d.push(S)}if(a){let y=()=>Mo.update(()=>{a&&X3(e,a)});d.length?Promise.all(d).then(y):y()}return d}var r8=O(()=>{aS();rS();dS();W3();e8();i8();sS();Ns()});var a8,s8=O(()=>{a8={test:e=>e==="auto",parse:e=>e}});var ey,pS=O(()=>{ey=e=>t=>t.test(e)});var fS,mS,gS=O(()=>{s8();js();Il();pS();fS=[Yr,Ge,Bs,kr,HD,RD,a8],mS=e=>fS.find(ey(e))});function l8(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||df(e):!0}var c8=O(()=>{At()});function zU(e){let[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[o]=n.match(Bd)||[];if(!o)return e;let i=n.replace(o,""),r=HU.has(t)?1:0;return o!==n&&(r*=100),t+"("+r+i+")"}var HU,OU,zf,hS=O(()=>{Wr();Eb();HU=new Set(["brightness","contrast","saturate","opacity"]);OU=/\b([a-z-]*)\(.*?\)/gu,zf={...ro,getAnimatableNone:e=>{let t=e.match(OU);return t?t.map(zU).join(" "):e}}});var Of,bS=O(()=>{Wr();Of={...ro,getAnimatableNone:e=>{let t=ro.parse(e);return ro.createTransformer(e)(t.map(o=>typeof o=="number"?0:typeof o=="object"?{...o,alpha:1}:o))}}});var yS,d8=O(()=>{js();yS={...Yr,transform:Math.round}});var u8,p8=O(()=>{js();Il();u8={rotate:kr,pathRotation:kr,rotateX:kr,rotateY:kr,rotateZ:kr,scale:kf,scaleX:kf,scaleY:kf,scaleZ:kf,skew:kr,skewX:kr,skewY:kr,distance:Ge,translateX:Ge,translateY:Ge,translateZ:Ge,x:Ge,y:Ge,z:Ge,perspective:Ge,transformPerspective:Ge,opacity:Va,originX:wk,originY:wk,originZ:Ge}});var Ql,ty=O(()=>{d8();js();Il();p8();Ql={borderWidth:Ge,borderTopWidth:Ge,borderRightWidth:Ge,borderBottomWidth:Ge,borderLeftWidth:Ge,borderRadius:Ge,borderTopLeftRadius:Ge,borderTopRightRadius:Ge,borderBottomRightRadius:Ge,borderBottomLeftRadius:Ge,width:Ge,maxWidth:Ge,height:Ge,maxHeight:Ge,top:Ge,right:Ge,bottom:Ge,left:Ge,inset:Ge,insetBlock:Ge,insetBlockStart:Ge,insetBlockEnd:Ge,insetInline:Ge,insetInlineStart:Ge,insetInlineEnd:Ge,padding:Ge,paddingTop:Ge,paddingRight:Ge,paddingBottom:Ge,paddingLeft:Ge,paddingBlock:Ge,paddingBlockStart:Ge,paddingBlockEnd:Ge,paddingInline:Ge,paddingInlineStart:Ge,paddingInlineEnd:Ge,margin:Ge,marginTop:Ge,marginRight:Ge,marginBottom:Ge,marginLeft:Ge,marginBlock:Ge,marginBlockStart:Ge,marginBlockEnd:Ge,marginInline:Ge,marginInlineStart:Ge,marginInlineEnd:Ge,fontSize:Ge,backgroundPositionX:Ge,backgroundPositionY:Ge,...u8,zIndex:yS,fillOpacity:Va,strokeOpacity:Va,numOctaves:yS}});var $U,ny,xS=O(()=>{Af();hS();bS();ty();$U={...Ql,color:Tn,backgroundColor:Tn,outlineColor:Tn,fill:Tn,stroke:Tn,borderColor:Tn,borderTopColor:Tn,borderRightColor:Tn,borderBottomColor:Tn,borderLeftColor:Tn,filter:zf,WebkitFilter:zf,mask:Of,WebkitMask:Of},ny=e=>$U[e]});function oy(e,t){let n=ny(e);return NU.has(n)||(n=ro),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var NU,vS=O(()=>{Wr();hS();bS();xS();NU=new Set([zf,Of])});function f8(e,t,n){let o=0,i;for(;o<e.length&&!i;){let r=e[o];typeof r=="string"&&!jU.has(r)&&Us(r).values.length&&(i=e[o]),o++}if(i&&n)for(let r of t)e[r]=oy(n,i)}var jU,m8=O(()=>{Wr();vS();jU=new Set(["auto","none","0"])});var iy,g8=O(()=>{dS();gS();q3();Pd();jb();c8();m8();qk();iy=class extends Is{constructor(t,n,o,i,r){super(t,n,o,i,r,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:n,name:o}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let d=t[u];if(typeof d=="string"&&(d=d.trim(),jd(d))){let p=lS(d,n.current);p!==void 0&&(t[u]=p),u===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!Qb.has(o)||t.length!==2)return;let[i,r]=t,a=mS(i),s=mS(r),l=yk(i),c=yk(r);if(l!==c&&Ka[o]){this.needsMeasurement=!0;return}if(a!==s)if(Uk(a)&&Uk(s))for(let u=0;u<t.length;u++){let d=t[u];typeof d=="string"&&(t[u]=parseFloat(d))}else Ka[o]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:n}=this,o=[];for(let i=0;i<t.length;i++)(t[i]===null||l8(t[i]))&&o.push(i);o.length&&f8(t,o,n)}measureInitialState(){let{element:t,unresolvedKeyframes:n,name:o}=this;if(!t||!t.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ka[o](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;let i=n[n.length-1];i!==void 0&&t.getValue(o,i).jump(i,!1)}measureEndState(){let{element:t,name:n,unresolvedKeyframes:o}=this;if(!t||!t.current)return;let i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);let r=o.length-1,a=o[r];o[r]=Ka[n](t.measureViewportBox(),window.getComputedStyle(t.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([s,l])=>{t.getValue(s).set(l)}),this.resolveNoneKeyframes()}}});var h8,b8=O(()=>{h8=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"]});function wS(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let o=document;t&&(o=t.current);let i=n?.[e]??o.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(o=>o!=null)}var y8=O(()=>{});var $f,ES=O(()=>{$f=(e,t)=>t&&typeof e=="number"?t.transform(e):e});var x8,Ote,v8=O(()=>{bk();({schedule:x8,cancel:Ote}=yb(queueMicrotask,!1))});function Nf(e){return sk(e)&&"ownerSVGElement"in e}var kS=O(()=>{At()});function SS(e){return Nf(e)&&e.tagName==="svg"}var w8=O(()=>{kS()});var PU,E8,k8=O(()=>{Af();Wr();gS();pS();PU=[...fS,Tn,ro],E8=e=>PU.find(ey(e))});var S8,Fd,ry=O(()=>{S8=()=>({min:0,max:0}),Fd=()=>({x:S8(),y:S8()})});var Ga,TS=O(()=>{Ga=new WeakMap});function T8(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}var A8=O(()=>{});function M8(e){return typeof e=="string"||Array.isArray(e)}var C8=O(()=>{});var BU,L8,_8=O(()=>{BU=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],L8=["initial",...BU]});function AS(e){return T8(e.animate)||L8.some(t=>M8(e[t]))}function D8(e){return!!(AS(e)||e.variants)}var R8=O(()=>{A8();C8();_8()});function H8(e,t,n){for(let o in t){let i=t[o],r=n[o];if(xn(i))e.addValue(o,i);else if(xn(r))e.addValue(o,tr(i,{owner:e}));else if(r!==i)if(e.hasValue(o)){let a=e.getValue(o);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{let a=e.getStaticValue(o);e.addValue(o,tr(a!==void 0?a:i,{owner:e}))}}for(let o in n)t[o]===void 0&&e.removeValue(o);return t}var z8=O(()=>{Id();Ia()});var Gs,Jl,ay=O(()=>{Gs={current:null},Jl={current:!1}});function jf(){if(Jl.current=!0,!!VU)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Gs.current=e.matches;e.addEventListener("change",t),t()}else Gs.current=!1}var VU,MS=O(()=>{ay();VU=typeof window<"u"});var O8,$8,Yd,CS=O(()=>{At();jb();Jk();oS();v8();Kl();ry();Id();Wr();vS();k8();Ia();TS();R8();Sr();z8();MS();cS();ay();Ns();O8=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],$8={},Yd=class{scrapeMotionValuesFromProps(t,n,o){return{}}constructor({parent:t,props:n,presenceContext:o,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:a,visualState:s},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Is,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let g=io.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,Mo.render(this.render,!1,!0))};let{latestValues:c,renderState:u}=s;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=o,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=AS(n),this.isVariantNode=D8(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:d,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(let g in p){let y=p[g];c[g]!==void 0&&xn(y)&&y.set(c[g])}}mount(t){if(this.hasBeenMounted)for(let n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,Ga.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,o)=>this.bindToMotionValue(o,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Jl.current||jf(),this.shouldReduceMotion=Gs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Ef(this.notifyUpdate),Ef(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let t in this.events)this.events[t].clear();for(let t in this.features){let n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Kb.has(t)&&this.current instanceof HTMLElement){let{factory:a,keyframes:s,times:l,ease:c,duration:u}=n.accelerate,d=new Kd({element:this.current,name:t,keyframes:s,times:l,ease:c,duration:eo(u)}),p=a(d);this.valueSubscriptions.set(t,()=>{p(),d.cancel()});return}let o=er.has(t);o&&this.onBindTransform&&this.onBindTransform();let i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Mo.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),r&&r()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in $8){let n=$8[t];if(!n)continue;let{isEnabled:o,Feature:i}=n;if(!this.features[t]&&i&&o(this.props)&&(this.features[t]=new i(this)),this.features[t]){let r=this.features[t];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Fd()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let o=0;o<O8.length;o++){let i=O8[o];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);let r="on"+i,a=t[r];a&&(this.propEventSubscriptions[i]=this.on(i,a))}this.prevMotionValues=H8(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){let n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){let o=this.values.get(t);n!==o&&(o&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);let n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let o=this.values.get(t);return o===void 0&&n!==void 0&&(o=tr(n===null?void 0:n,{owner:this}),this.addValue(t,o)),o}readValue(t,n){let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(cf(o)||df(o))?o=parseFloat(o):!E8(o)&&ro.test(n)&&(o=oy(t,n)),this.setBaseTarget(t,xn(o)?o.get():o)),xn(o)?o.get():o}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){let{initial:n}=this.props,o;if(typeof n=="string"||typeof n=="object"){let r=Zb(this.props,n,this.presenceContext?.custom);r&&(o=r[t])}if(n&&o!==void 0)return o;let i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!xn(i)?i:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ul),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){x8.render(this.render)}}});var Xd,LS=O(()=>{Ia();g8();CS();Xd=class extends Yd{constructor(){super(...arguments),this.KeyframeResolver=iy}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){let o=t.style;return o?o[n]:void 0}removeValueFromRenderState(t,{vars:n,style:o}){delete n[t],delete o[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;xn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}});function N8({top:e,left:t,right:n,bottom:o}){return{x:{min:t,max:n},y:{min:e,max:o}}}function j8(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),o=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:o.y,right:o.x}}var P8=O(()=>{});function B8(e,t){return N8(j8(e.getBoundingClientRect(),t))}var V8=O(()=>{P8()});function U8(e,t,n){let o="",i=!0;for(let a=0;a<qU;a++){let s=Zr[a],l=e[s];if(l===void 0)continue;let c=!0;if(typeof l=="number")c=l===(s.startsWith("scale")?1:0);else{let u=parseFloat(l);c=s.startsWith("scale")?u===1:u===0}if(!c||n){let u=$f(l,Ql[s]);if(!c){i=!1;let d=UU[s]||s;o+=`${d}(${u}) `}n&&(t[s]=u)}}let r=e.pathRotation;return r&&(i=!1,o+=`rotate(${$f(r,Ql.pathRotation)}) `),o=o.trim(),n?o=n(t,i?"":o):i&&(o="none"),o}var UU,qU,q8=O(()=>{ES();ty();Sr();UU={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},qU=Zr.length});function sy(e,t,n){let{style:o,vars:i,transformOrigin:r}=e,a=!1,s=!1;for(let l in t){let c=t[l];if(er.has(l)){a=!0;continue}else if(vb(l)){i[l]=c;continue}else{let u=$f(c,Ql[l]);l.startsWith("origin")?(s=!0,r[l]=u):o[l]=u}}if(t.transform||(a||n?o.transform=U8(t,e.transform,n):o.transform&&(o.transform="none")),s){let{originX:l="50%",originY:c="50%",originZ:u=0}=r;o.transformOrigin=`${l} ${c} ${u}`}}var _S=O(()=>{ES();ty();Sr();Pd();q8()});function ly(e,{style:t,vars:n},o,i){let r=e.style,a;for(a in t)r[a]=t[a];i?.applyProjectionStyles(r,o);for(a in n)r.setProperty(a,n[a])}var DS=O(()=>{});function K8(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Wd,I8=O(()=>{Il();Wd={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ge.test(e))e=parseFloat(e);else return e;let n=K8(e,t.target.x),o=K8(e,t.target.y);return`${n}% ${o}%`}}});var G8,F8=O(()=>{Wr();Gl();G8={correct:(e,{treeScale:t,projectionDelta:n})=>{let o=e,i=ro.parse(e);if(i.length>5)return o;let r=ro.createTransformer(e),a=typeof i[0]!="number"?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;i[0+a]/=s,i[1+a]/=l;let c=Mi(s,l,.5);return typeof i[2+a]=="number"&&(i[2+a]/=c),typeof i[3+a]=="number"&&(i[3+a]/=c),r(i)}}});var Y8,X8=O(()=>{b8();I8();F8();Y8={borderRadius:{...Wd,applyTo:[...h8]},borderTopLeftRadius:Wd,borderTopRightRadius:Wd,borderBottomLeftRadius:Wd,borderBottomRightRadius:Wd,boxShadow:G8}});function W8(e,{layout:t,layoutId:n}){return er.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Y8[e]||e==="opacity")}var Z8=O(()=>{Sr();X8()});function cy(e,t,n){let o=e.style,i=t?.style,r={};if(!o)return r;for(let a in o)(xn(o[a])||i&&xn(i[a])||W8(a,e)||n?.getValue(a)?.liveStyle!==void 0)&&(r[a]=o[a]);return r}var RS=O(()=>{Ia();Z8()});function KU(e){return window.getComputedStyle(e)}var Pf,Q8=O(()=>{At();Pd();Sr();Vk();V8();LS();_S();DS();RS();Pf=class extends Xd{constructor(){super(...arguments),this.type="html",this.renderInstance=ly}mount(t){ii(!!t.style,"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,n){if(er.has(n))return this.projection?.isProjecting?$b(n):a3(t,n);{let o=KU(t),i=(vb(n)?o.getPropertyValue(n):o[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return B8(t,n)}build(t,n,o){sy(t,n,o.transformTemplate)}scrapeMotionValuesFromProps(t,n,o){return cy(t,n,o)}}});function IU(e,t){return e in t}var Bf,J8=O(()=>{ry();CS();Bf=class extends Yd{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(IU(n,t)){let o=t[n];if(typeof o=="string"||typeof o=="number")return o}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return Fd()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}}});function eR(e,t,n=1,o=0,i=!0){e.pathLength=1;let r=i?GU:FU;e[r.offset]=`${-o}`,e[r.array]=`${t} ${n}`}var GU,FU,tR=O(()=>{GU={offset:"stroke-dashoffset",array:"stroke-dasharray"},FU={offset:"strokeDashoffset",array:"strokeDasharray"}});function nR(e,{attrX:t,attrY:n,attrScale:o,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...s},l,c,u){if(sy(e,s,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:p}=e;d.transform&&(p.transform=d.transform,delete d.transform),(p.transform||d.transformOrigin)&&(p.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),p.transform&&(p.transformBox=u?.transformBox??"fill-box",delete d.transformBox);for(let g of YU)d[g]!==void 0&&(p[g]=d[g],delete d[g]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),o!==void 0&&(d.scale=o),i!==void 0&&eR(d,i,r,a,!1)}var YU,oR=O(()=>{_S();tR();YU=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"]});var dy,HS=O(()=>{dy=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"])});var iR,rR=O(()=>{iR=e=>typeof e=="string"&&e.toLowerCase()==="svg"});function aR(e,t,n,o){ly(e,t,void 0,o);for(let i in t.attrs)e.setAttribute(dy.has(i)?i:Gd(i),t.attrs[i])}var sR=O(()=>{Jb();DS();HS()});function lR(e,t,n){let o=cy(e,t,n);for(let i in e)if(xn(e[i])||xn(t[i])){let r=Zr.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;o[r]=e[i]}return o}var cR=O(()=>{Ia();Sr();RS()});var Vf,dR=O(()=>{Sr();xS();ry();LS();Jb();oR();HS();rR();sR();cR();Vf=class extends Xd{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Fd}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(er.has(n)){let o=ny(n);return o&&o.default||0}return n=dy.has(n)?n:Gd(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,o){return lR(t,n,o)}build(t,n,o){nR(t,n,this.isSVGTag,o.transformTemplate,o.style)}renderInstance(t,n,o,i){aR(t,n,o,i)}mount(t){this.isSVGTag=iR(t.tagName),super.mount(t)}}});function zS(e,t,n){let o=xn(e)?e:tr(e);return o.start(Wb("",o,t,n)),o.animation}var uR=O(()=>{sS();Id();Ia()});var Tr=O(()=>{N3();r8();Db();_k();Ub();$k();Ok();kS();w8();Gl();y8();Id();Ia();Q8();J8();TS();dR();MS();uR();ay()});function Uf(e){return typeof e=="object"&&!Array.isArray(e)}var OS=O(()=>{});function uy(e,t,n,o){return e==null?[]:typeof e=="string"&&Uf(t)?wS(e,n,o):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(i=>i!=null):[e]}var $S=O(()=>{Tr();OS()});function pR(e,t,n){return e*(t+1)+n*t}var fR=O(()=>{});function NS(e,t,n,o){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?n:t.startsWith("<")?Math.max(0,n+parseFloat(t.slice(1))):o.get(t)??e}var mR=O(()=>{});function XU(e,t,n){for(let o=0;o<e.length;o++){let i=e[o];i.at>t&&i.at<n&&(Pl(e,i),o--)}}function gR(e,t,n,o,i,r){XU(e,i,r);for(let a=0;a<t.length;a++)e.push({value:t[a],at:Mi(i,r,o[a]),easing:xf(n,a)})}var hR=O(()=>{Tr();At()});function bR(e,t,n=0){let o=t+1+t*n;for(let i=0;i<e.length;i++)e[i]=e[i]/o}var yR=O(()=>{});function xR(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var vR=O(()=>{});function kR(e,{defaultTransition:t={},...n}={},o,i){let r=t.duration||.3,a=new Map,s=new Map,l={},c=new Map,u=0,d=0,p=0;for(let g=0;g<e.length;g++){let y=e[g];if(typeof y=="string"){c.set(y,d);continue}else if(!Array.isArray(y)){c.set(y.name,NS(d,y.at,u,c));continue}let[v,x,h={}]=y;h.at!==void 0&&(d=NS(d,h.at,u,c));let m=0,b=(E,S,A,_=0,T=0)=>{let H=ZU(E),{delay:R=0,times:z=_f(H),type:F=t.type||"keyframes",repeat:B,repeatType:le,repeatDelay:J=0,...V}=S,{ease:oe=t.ease||"easeOut",duration:ue}=S,q=typeof R=="function"?R(_,T):R,Y=H.length,W=Zl(F)?F:i?.[F||"keyframes"];if(Y<=2&&W){let G=100;if(Y===2&&eq(H)){let pe=H[1]-H[0];G=Math.abs(pe)}let te={...t,...V};ue!==void 0&&(te.duration=eo(ue));let ie=Mf(te,G,W);oe=ie.ease,ue=ie.duration}ue??(ue=r);let C=d+q;z.length===1&&z[0]===0&&(z[1]=1);let U=z.length-H.length;if(U>0&&Lf(z,U),H.length===1&&H.unshift(null),B&&Er(B<jS,`Sequence segments can't repeat ${B} times \u2014 ignoring repeat option. Use a value below ${jS} or apply repeat at the sequence level instead.`),B&&B<jS){let G=ue>0?J/ue:0;ue=pR(ue,B,J);let te=[...H],ie=[...z];oe=Array.isArray(oe)?[...oe]:[oe];let pe=[...oe],xe=le==="reverse"||le==="mirror",L=te,Q=pe;xe&&(L=[...te].reverse(),le==="reverse"&&(Q=[...pe].reverse().map(Z=>typeof Z=="function"?ql(Z):Z)));for(let Z=0;Z<B;Z++){let se=xe&&Z%2===0,we=se?L:te,Te=se?Q:pe,$=(Z+1)*(1+G);G>0&&(H.push(H[H.length-1]),z.push($),oe.push("linear")),H.push(...we);for(let D=0;D<we.length;D++)z.push(ie[D]+$),oe.push(D===0?"linear":xf(Te,D-1))}bR(z,B,G)}let I=C+ue;gR(A,H,oe,z,C,I),m=Math.max(q+ue,m),p=Math.max(I,p)};if(xn(v)){let E=wR(v,s);b(x,h,ER("default",E))}else{let E=uy(v,x,o,l),S=E.length;for(let A=0;A<S;A++){x=x,h=h;let _=E[A],T=wR(_,s);for(let H in x)b(x[H],QU(h,H),ER(H,T),A,S)}}u=d,d+=m}return s.forEach((g,y)=>{for(let v in g){let x=g[v];x.sort(xR);let h=[],m=[],b=[];for(let _=0;_<x.length;_++){let{at:T,value:H,easing:R}=x[_];h.push(H),m.push(Vl(0,p,T)),b.push(R||"easeOut")}m[0]!==0&&(m.unshift(0),h.unshift(h[0]),b.unshift(WU)),m[m.length-1]!==1&&(m.push(1),h.push(null)),a.has(y)||a.set(y,{keyframes:{},transition:{}});let E=a.get(y);E.keyframes[v]=h;let{type:S,...A}=t;E.transition[v]={...A,duration:p,ease:b,times:m,...n}}}),a}function wR(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function ER(e,t){return t[e]||(t[e]=[]),t[e]}function ZU(e){return Array.isArray(e)?e:[e]}function QU(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var WU,jS,JU,eq,SR=O(()=>{Tr();At();$S();fR();mR();hR();yR();vR();WU="easeInOut",jS=20;JU=e=>typeof e=="number",eq=e=>e.every(JU)});function TR(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Nf(e)&&!SS(e)?new Vf(t):new Pf(t);n.mount(e),Ga.set(e,n)}function AR(e){let t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new Bf(t);n.mount(e),Ga.set(e,n)}var MR=O(()=>{Tr()});function tq(e,t){return xn(e)||typeof e=="number"||typeof e=="string"&&!Uf(t)}function py(e,t,n,o){let i=[];if(tq(e,t))i.push(zS(e,Uf(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let r=uy(e,t,o),a=r.length;ii(!!a,"No valid elements provided.","no-valid-elements");for(let s=0;s<a;s++){let l=r[s],c=l instanceof Element?TR:AR;Ga.has(l)||c(l);let u=Ga.get(l),d={...n};"delay"in d&&typeof d.delay=="function"&&(d.delay=d.delay(s,a)),i.push(...uS(u,{...t,transition:d},{}))}}return i}var PS=O(()=>{Tr();At();MR();OS();$S()});function CR(e,t,n){let o=[],i=e.map(a=>{if(Array.isArray(a)&&typeof a[0]=="function"){let s=a[0],l=tr(0);return l.on("change",s),a.length===1?[l,[0,1]]:a.length===2?[l,[0,1],a[1]]:[l,a[1],a[2]]}return a});return kR(i,t,n,{spring:Ua}).forEach(({keyframes:a,transition:s},l)=>{o.push(...py(l,a,s))}),o}var LR=O(()=>{Tr();SR();PS()});function nq(e){return Array.isArray(e)&&e.some(Array.isArray)}function _R(e={}){let{scope:t,reduceMotion:n,skipAnimations:o}=e;function i(r,a,s){let l=[],c,u={};if(n!==void 0&&(u.reduceMotion=n),o!==void 0&&(u.skipAnimations=o),nq(r)){let{onComplete:p,...g}=a||{};typeof p=="function"&&(c=p),l=CR(r,{...u,...g},t)}else{let{onComplete:p,...g}=s||{};typeof p=="function"&&(c=p),l=py(r,a,{...u,...g},t)}let d=new Hf(l);return c&&d.finished.then(c),t&&(t.animations.push(d),d.finished.then(()=>{Pl(t.animations,d)})),d}return i}var Ar,DR=O(()=>{Tr();At();LR();PS();Ar=_R()});var RR=O(()=>{Tr();At();DR()});var BS=O(()=>{RR()});var HR={};Ft(HR,{animate:()=>Ar});var zR=O(()=>{"use strict";BS()});function qf(e,t){let n=w("details","comment-menu"),o=w("summary","icon");o.setAttribute("aria-label",e),o.setAttribute("aria-haspopup","menu"),o.setAttribute("aria-expanded","false"),o.title=e,o.append(yt("more"));let i=w("div","comment-menu-items");i.popover="manual",i.setAttribute("role","menu"),i.setAttribute("aria-label",e);let r=t.map(a=>{let s=Oe(a.label,()=>{n.open=!1,o.focus({preventScroll:!0}),a.onSelect()},`menu-action${a.destructive?" destructive":""}`,a.icon);return s.append(w("span","",a.label)),s.setAttribute("role","menuitem"),s.tabIndex=-1,i.append(s),s});return n.addEventListener("toggle",()=>{if(o.setAttribute("aria-expanded",String(n.open)),n.open){i.showPopover();let a=o.getBoundingClientRect();i.style.left=`${Math.max(8,Math.min(a.right-i.offsetWidth,innerWidth-i.offsetWidth-8))}px`,i.style.top=`${Math.max(8,Math.min(a.bottom+6,innerHeight-i.offsetHeight-8))}px`,(r.find(s=>s.getAttribute("aria-checked")==="true")??r[0])?.focus({preventScroll:!0})}else i.hidePopover()}),n.addEventListener("keydown",a=>{if(!n.open)return;let s=r.indexOf(a.target),l;a.key==="ArrowDown"&&(l=(s+1)%r.length),a.key==="ArrowUp"&&(l=(s-1+r.length)%r.length),a.key==="Home"&&(l=0),a.key==="End"&&(l=r.length-1),l!==void 0&&(a.preventDefault(),r[l]?.focus()),a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),n.open=!1,o.focus({preventScroll:!0})),a.key==="Tab"&&(n.open=!1)}),n.append(o,i),n}function ec(e,t,n,o){let i=qf(e,t.map(([a,s])=>({label:s,icon:"check",onSelect:()=>o(a)})));i.classList.add("selection-menu");let r=i.querySelector("summary");return r.className="selection-trigger",r.replaceChildren(w("span","selection-label",t.find(([a])=>a===n)?.[1]),yt("chevron")),i.querySelectorAll("[role=menuitem]").forEach((a,s)=>{a.setAttribute("role","menuitemradio"),a.setAttribute("aria-checked",String(t[s][0]===n))}),i}var qS=O(()=>{"use strict";It()});function Jr(e,t=po()){let n=[e.ctrl&&"Control",e.alt&&"Alt",e.shift&&"Shift",e.meta&&"Meta",iq(e.key)].filter(Boolean),o=t?{Control:"\u2303",Alt:"\u2325",Shift:"\u21E7",Meta:"\u2318"}:{Control:"Ctrl",Meta:"Meta"};return{aria:n.join("+"),spoken:n.map(i=>i==="Meta"&&t?"Command":i==="Alt"&&t?"Option":i).join(" + "),keys:n.map(i=>o[i]??{ArrowLeft:"\u2190",ArrowRight:"\u2192",ArrowUp:"\u2191",ArrowDown:"\u2193",Enter:"\u21B5",Escape:"Esc"}[i]??i)}}function Zd(e,t,n="surface"){let o=Jr(e,t);return Qd(o.keys,o.spoken,n)}function Qd(e,t,n="surface"){let o=document.createElement("span");o.className="palette-kbd",o.dataset.variant=n,o.setAttribute("role","img"),o.setAttribute("aria-label",t);for(let i of e){let r=document.createElement("kbd");r.textContent=i,r.setAttribute("aria-hidden","true"),o.append(r)}return o}var po,oq,iq,ea=O(()=>{"use strict";po=()=>/mac|iphone|ipad/i.test(navigator.userAgentData?.platform||navigator.platform),oq=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter","Escape","Tab","Backspace","Delete","Home","End","PageUp","PageDown"],iq=e=>e.length===1?e.toUpperCase():oq.find(t=>t.toLowerCase()===e.toLowerCase())??e});function PR(e){if(e===void 0)return fy;let t=[],n=[];if(!Array.isArray(e))n.push(e);else for(let o of e)o==="|"||rq.has(o)&&!t.includes(o)?t.push(o):n.push(o);return n.length&&console.warn(`Palette: ignoring invalid or repeated toolbar.items: ${n.map(o=>String(JSON.stringify(o))).join(", ")}.`),Array.isArray(e)?t:fy}function BR(e,t){let n=[];for(let o of e)(o!=="|"?t(o):n.length&&n.at(-1)!=="|")&&n.push(o);return n.at(-1)==="|"&&n.pop(),n}function my(e,t){if(t)return t;let n=e.filter(o=>o.showInBar!==!1).map(o=>o.id);return[...n.filter(o=>o!=="dismiss"),"more",...n.filter(o=>o==="dismiss")]}var rq,fy,gy,hy,by=O(()=>{"use strict";rq=new Set(["browse","comment","design","comments","more","account","dismiss"]),fy=["browse","comment","design","|","comments","|","more","account","|","dismiss"];gy=e=>e>99?"99+":String(e),hy=(e,t)=>t?`${e}, ${t} open comment${t===1?"":"s"}`:e});var FS,YS,VR=O(()=>{FS=kt(Yt(),1),YS=({size:e=24,color:t="currentColor",...n})=>FS.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},FS.createElement("path",{d:"M19 12H5m0 0 7 7m-7-7 7-7"}));YS.displayName="ArrowLeft"});var XS,WS,UR=O(()=>{XS=kt(Yt(),1),WS=({size:e=24,color:t="currentColor",...n})=>XS.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},XS.createElement("path",{d:"m9 18 6-6-6-6"}));WS.displayName="ChevronRight"});function ZS(){!Jl.current&&jf();let[e]=(0,qR.useState)(Gs.current);return e}var qR,KR=O(()=>{"use client";Tr();qR=kt(Yt(),1)});var IR=O(()=>{Tr();KR();At()});var GR=O(()=>{IR()});function YR({items:e,bar:t,defaultActiveId:n,activeId:o,edge:i="bottom",alignEnd:r=!1,onActiveChange:a,label:s="App navigation",moreLabel:l="More",backLabel:c="Back",className:u="",style:d}){let p=(0,Mt.useId)(),[g,y]=(0,Mt.useState)({kind:"collapsed"}),[v,x]=(0,Mt.useState)(n??e[0]?.id),[h,m]=(0,Mt.useState)(null),b=(0,Mt.useRef)(null),E=(0,Mt.useRef)(null),S=(0,Mt.useRef)(i),A=i==="left"||i==="right";(0,Mt.useLayoutEffect)(()=>{let D=E.current;if(!D||!h)return;let j=0,X=0,fe=document.documentElement.clientWidth,ye=window.innerHeight;for(let Ne=D.parentNode;Ne instanceof Element&&Ne!==document.body;Ne=Ne.parentNode instanceof ShadowRoot?Ne.parentNode.host:Ne.parentNode){let Le=getComputedStyle(Ne),Ie=Ne.getBoundingClientRect();Le.overflowX!=="visible"&&(j=Math.max(j,Ie.left),fe=Math.min(fe,Ie.right)),Le.overflowY!=="visible"&&(X=Math.max(X,Ie.top),ye=Math.min(ye,Ie.bottom))}D.style.maxWidth=`${Math.max(0,fe-j-16)}px`,D.style.left=`${h.x}px`,D.style.top=`${h.y}px`;let De=D.getBoundingClientRect(),Ce=Math.max(j+8-De.left,Math.min(0,fe-8-De.right)),Pe=Math.max(X+8-De.top,Math.min(0,ye-8-De.bottom));D.style.left=`${h.x+Ce}px`,D.style.top=`${h.y+Pe}px`},[h]);let _=(0,Mt.useRef)(null),T=(0,Mt.useRef)(null),H=(0,Mt.useRef)(g),R=(0,Mt.useRef)("more"),z=(0,Mt.useRef)(!1),F=(0,Mt.useRef)(!1),B=(0,Mt.useRef)(!1),le=(0,Mt.useRef)(null),J=(0,Mt.useRef)(void 0),V=(0,Mt.useRef)(void 0),oe=(0,Mt.useRef)(!1),ue=(0,Mt.useRef)(!1),q=ZS(),Y=o??v,W=g.kind!=="collapsed",C=my(e,t).filter(D=>D==="|"||D==="more"||e.some(j=>j.id===D)),U=C.filter(D=>D!=="|").length,I=e.filter(D=>D.children?.length),G=(0,Mt.useRef)(new Map),te=(0,Mt.useRef)(new Map),ie=C.join(" ");(0,Mt.useLayoutEffect)(()=>{let D=new Map,j=[...T.current?.querySelectorAll("[data-menu-item]")??[]].map(X=>{let fe=X.dataset.menuItem,ye=[X.offsetLeft,X.offsetTop];return D.set(fe,ye),{node:X,id:fe,position:ye,before:G.current.get(fe)}});for(let{node:X,id:fe,position:ye,before:De}of j)q||z.current?(te.current.get(fe)?.complete(),te.current.delete(fe)):De&&(De[0]!==ye[0]||De[1]!==ye[1])&&(te.current.get(fe)?.complete(),te.current.set(fe,Ar(X,{x:[De[0]-ye[0],0],y:[De[1]-ye[1],0]},Ol)));for(let[X,fe]of te.current)D.has(X)||(fe.stop(),te.current.delete(X));G.current=D},[ie,i,g,q]),(0,Mt.useEffect)(()=>()=>{for(let D of te.current.values())D.stop()},[]);function pe(){clearTimeout(J.current),m(null)}function xe(){pe(),clearTimeout(V.current),oe.current=!1}function L(D,j,X=!1){clearTimeout(J.current);let fe=b.current,ye=T.current;if(!fe||!ye||W||F.current||B.current&&!X)return;let De=fe.getBoundingClientRect(),Ce=D.getBoundingClientRect(),Pe={label:j?j.count?`${j.label} \xB7 ${j.count} open`:j.label:l,shortcut:j?.shortcut,x:i==="left"?De.width+8:i==="right"?-8:Ce.left-De.left+Ce.width/2,y:i==="top"?De.height+8:i==="bottom"?-8:Ce.top-De.top+Ce.height/2};clearTimeout(V.current);let Ne=()=>{oe.current=!0,m(Pe)};X||oe.current?Ne():J.current=setTimeout(Ne,aq)}function Q(D,j,X){xe(),W||(R.current=j,z.current=X),le.current="first",y(D)}function Z(D=!0,j=R.current){xe(),B.current=!0,le.current=D&&z.current?j:null,y({kind:"collapsed"})}function se(){g.kind==="group"&&(le.current=g.id,y({kind:"main"}))}function we(D){x(D.id),a?.(D.id),W&&!D.keepOpenOnSelect?Z(!0,g.kind==="group"?g.id:D.id):xe(),D.onSelect?.()}(0,Mt.useLayoutEffect)(()=>{let D=b.current,j=_.current,X=T.current;if(!D||!j||!X)return;let fe=S.current!==i;S.current=i;let ye=H.current;H.current=g;let De=[...D.querySelectorAll(".morphing-menu__panel")],Ce=De.find($e=>$e.getAttribute("aria-hidden")==="false"),Pe=[],Ne=!1,Le=$e=>(Pe.push($e),$e),Ie=()=>({width:Ce?.offsetWidth??X.offsetWidth,height:Ce?.offsetHeight??X.offsetHeight}),ut=()=>{let $e=Ie();j.style.width=`${$e.width}px`,j.style.height=`${$e.height}px`},ct=fe||ye.kind!==g.kind||ye.kind==="group"&&g.kind==="group"&&ye.id!==g.id,de=ye.kind==="collapsed"!=(g.kind==="collapsed"),Ae=q||!ct;if(Ae)ut();else if(de&&!W)Le(Ar(j,Ie(),tb));else if(de){let $e=Math.min(X.offsetWidth,X.offsetWidth>250?280:200);Le(Ar(j,{width:$e,height:X.offsetHeight>52?32:28},eb)).finished.then(()=>{Ne||Le(Ar(j,Ie(),{...Ol,bounce:W?.24:.15}))}).catch(()=>{})}else Le(Ar(j,Ie(),{...Ol,duration:.25,bounce:.1}));Le(Ar(X,{opacity:W?0:1,scale:W&&!q?.8:1,filter:W&&!q?"blur(8px)":"blur(0px)"},{duration:Ae?0:W?.15:.22,delay:!Ae&&!W?.08:0,...W?{}:{ease:"easeOut"}}));for(let $e of De){let ot=$e===Ce;for(let[rn,Zt]of[...$e.querySelectorAll(".morphing-menu__row")].entries())ot&&de&&!Ae&&Object.assign(Zt.style,{opacity:"0",transform:"translateY(48px)",filter:"blur(4px)"}),Le(Ar(Zt,{opacity:ot?1:0,y:ot||q?0:16,filter:ot||q?"blur(0px)":"blur(2px)"},{...Ol,duration:Ae?0:ot?de?.4:.25:.12,bounce:de?.3:0,delay:!Ae&&ot?(de?.2:0)+rn*.02:0}))}let Re=[...(W?Ce:X)?.querySelectorAll("[data-menu-item]")??[]],Fe=le.current;le.current=null,Fe&&(F.current=!0,((Fe==="first"?Re[0]:Re.find(ot=>ot.dataset.menuItem===Fe))??(W?void 0:Re.find(ot=>ot.dataset.menuItem==="more")))?.focus({preventScroll:!0}),F.current=!1);let Ye=()=>y($e=>({...$e}));return window.addEventListener("resize",Ye),()=>{Ne=!0,Pe.forEach($e=>$e.stop()),window.removeEventListener("resize",Ye)}},[g,q,i,e.length,ie]),(0,Mt.useEffect)(()=>{if(!W)return;let D=X=>{X.target instanceof Node&&!X.composedPath().includes(b.current)&&Z(!1)},j=new AbortController;return jr(b.current,"pointerdown",D,{signal:j.signal}),()=>j.abort()},[W]),(0,Mt.useEffect)(()=>()=>{clearTimeout(J.current),clearTimeout(V.current)},[]);function Te(D,j){let X=!!D.children?.length,fe=Y===D.id||!!D.children?.some(Le=>Le.id===Y),ye=!j&&D.keepOpenOnSelect,De=(Le,Ie=!1)=>(0,_t.jsx)(cq,{label:D.label,icon:Ie,reduced:!!q,children:Le}),Ce=fe&&D.activeIcon?D.activeIcon:D.icon,Pe=(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)("span",{className:"morphing-menu__icon","aria-hidden":"true",style:ye?{display:"grid"}:void 0,children:ye?De(Ce,!0):Ce}),!j&&(0,_t.jsx)("span",{className:"morphing-menu__label",style:ye?{display:"grid"}:void 0,children:ye?De(D.label):D.label}),j&&!!D.count&&(0,_t.jsx)("span",{className:"morphing-menu__badge","aria-hidden":"true",children:gy(D.count)}),!j&&(0,_t.jsxs)("span",{className:"morphing-menu__trailing",children:[!!D.count&&(0,_t.jsx)("span",{className:"morphing-menu__count","aria-hidden":"true",children:D.count}),D.shortcut&&(0,_t.jsx)(FR,{shortcut:D.shortcut})]}),!j&&X&&(0,_t.jsx)(lq,{})]}),Ne={className:j?"morphing-menu__shortcut":"morphing-menu__row","data-menu-item":D.id,"aria-label":hy(D.label,D.count),"aria-keyshortcuts":D.shortcut?Jr(D.shortcut).aria:void 0,"aria-pressed":D.checked,"aria-current":fe?X?"true":"page":void 0,"aria-expanded":X?g.kind==="group"&&g.id===D.id:void 0,"aria-controls":X?`${p}-group-${D.id}`:void 0,onClick:Le=>X?Q({kind:"group",id:D.id},D.id,Le.detail===0):we(D),onPointerEnter:Le=>{j&&Le.pointerType==="mouse"&&L(Le.currentTarget,D)},onPointerLeave:pe,onPointerDown:xe,onFocus:Le=>{j&&Le.currentTarget.matches(":focus-visible")&&L(Le.currentTarget,D,!0)},onBlur:pe};return D.href&&!X?(0,_t.jsx)("a",{href:D.href,...Ne,children:Pe},D.id):(0,_t.jsx)("button",{type:"button",...Ne,children:Pe},D.id)}let $=(0,_t.jsxs)("button",{type:"button",className:"morphing-menu__row","data-menu-item":"close",onClick:()=>Z(!0,"more"),children:[(0,_t.jsx)(Qu,{"aria-hidden":"true"}),(0,_t.jsx)("span",{className:"morphing-menu__label",children:"Close menu"})]});return(0,_t.jsxs)("nav",{ref:b,"aria-label":s,className:["morphing-menu",u].filter(Boolean).join(" "),"data-view":g.kind,"data-edge":i,"data-vertical":A,"data-align-end":r,style:{"--mm-count":U,"--mm-gaps":C.length-U,...d},onPointerMove:D=>{if(!B.current||D.pointerType!=="mouse"||!D.movementX&&!D.movementY)return;B.current=!1;let j=D.target instanceof Element?D.target.closest(".morphing-menu__shortcut"):null;j&&L(j,e.find(X=>X.id===j.dataset.menuItem)??null)},onKeyDown:D=>{D.key==="Escape"&&(B.current=!0,xe(),W&&(D.preventDefault(),D.stopPropagation(),g.kind==="group"?se():Z()))},onBlur:D=>{D.relatedTarget instanceof Node&&D.currentTarget.contains(D.relatedTarget)||(W?D.relatedTarget instanceof Node&&Z(!1):ue.current||xe())},children:[(0,_t.jsxs)("div",{ref:_,className:"morphing-menu__shell",children:[(0,_t.jsx)("div",{ref:T,className:"morphing-menu__bar","aria-hidden":W,inert:W,onPointerEnter:D=>{D.pointerType==="mouse"&&(ue.current=!0,clearTimeout(V.current))},onPointerLeave:D=>{D.pointerType==="mouse"&&(ue.current=!1,pe(),clearTimeout(V.current),V.current=setTimeout(()=>{oe.current=!1},sq))},onKeyDown:D=>{let j={ArrowLeft:-1,ArrowUp:-1,ArrowRight:1,ArrowDown:1}[D.key],X=[...D.currentTarget.querySelectorAll("[data-menu-item]")],fe=X.indexOf(D.target);fe<0||D.altKey||D.ctrlKey||D.metaKey||D.shiftKey||!j&&D.key!=="Home"&&D.key!=="End"||(D.preventDefault(),X[D.key==="Home"?0:D.key==="End"?X.length-1:(fe+j+X.length)%X.length].focus({preventScroll:!0}))},children:C.map((D,j)=>D==="|"?(0,_t.jsx)("span",{className:"morphing-menu__separator","aria-hidden":"true"},`separator-${j}`):D!=="more"?Te(e.find(X=>X.id===D),!0):(0,_t.jsx)("button",{type:"button",className:"morphing-menu__shortcut","data-menu-item":"more","aria-label":l,"aria-expanded":W,"aria-controls":`${p}-main`,onClick:X=>Q({kind:"main"},"more",X.detail===0),onPointerEnter:X=>{X.pointerType==="mouse"&&L(X.currentTarget,null)},onPointerLeave:pe,onPointerDown:xe,onBlur:pe,onFocus:X=>{X.currentTarget.matches(":focus-visible")&&L(X.currentTarget,null,!0)},children:(0,_t.jsx)(Wu,{"aria-hidden":"true"})},"more"))}),(0,_t.jsxs)("div",{id:`${p}-main`,className:"morphing-menu__panel","aria-hidden":g.kind!=="main",inert:g.kind!=="main",children:[$,[...new Set(e.map(D=>D.group??""))].map(D=>(0,_t.jsxs)("section",{"aria-label":D||void 0,className:"morphing-menu__section",children:[D&&(0,_t.jsx)("h3",{children:D}),[...e].filter(j=>(j.group??"")===D).sort((j,X)=>(j.expandedOrder??0)-(X.expandedOrder??0)).map(j=>Te(j,!1))]},D))]}),I.map(D=>{let j=g.kind==="group"&&g.id===D.id;return(0,_t.jsxs)("div",{id:`${p}-group-${D.id}`,className:"morphing-menu__panel","aria-label":D.label,"aria-hidden":!j,inert:!j,children:[(0,_t.jsxs)("button",{type:"button",className:"morphing-menu__row","data-menu-item":"back",onClick:se,children:[(0,_t.jsx)(YS,{"aria-hidden":"true"}),(0,_t.jsx)("span",{children:c})]}),D.children.map(X=>Te(X,!1)),$]},D.id)})]}),h&&!W&&(0,_t.jsxs)("div",{ref:E,className:"morphing-menu__tooltip","aria-hidden":"true",style:{left:h.x,top:h.y},children:[h.label,h.shortcut&&(0,_t.jsx)(FR,{shortcut:h.shortcut})]})]})}function lq(){return(0,_t.jsx)(WS,{className:"morphing-menu__chevron","aria-hidden":"true"})}function cq({label:e,icon:t,reduced:n,children:o}){let i=(0,Mt.useRef)(null),r=(0,Mt.useRef)(null);return(0,Mt.useLayoutEffect)(()=>{let a=i.current,s=r.current;if(r.current={label:e,node:a.cloneNode(!0)},!s||s.label===e||n)return;let l=s.node;l.setAttribute("aria-hidden","true"),a.parentElement.append(l);let c={duration:200,easing:"cubic-bezier(.22,1,.36,1)"},u=a.animate([{opacity:0,transform:t?"scale(.7)":"translateY(4px)",filter:"blur(2px)"},{opacity:1,transform:"none",filter:"blur(0px)"}],c),d=l.animate([{opacity:1,transform:"none",filter:"blur(0px)"},{opacity:0,transform:t?"scale(.7)":"translateY(-4px)",filter:"blur(2px)"}],c);return d.finished.then(()=>l.remove()).catch(()=>{}),()=>{u.cancel(),d.cancel(),l.remove()}},[e,t,n]),(0,_t.jsx)("span",{ref:i,style:{gridArea:"1 / 1",display:"flex",alignItems:"center"},children:o})}function FR({shortcut:e}){let t=(0,Mt.useRef)(null);return(0,Mt.useLayoutEffect)(()=>{t.current?.replaceChildren(Zd(e))},[e.label]),(0,_t.jsx)("span",{ref:t})}var Mt,_t,aq,sq,XR=O(()=>{"use strict";"use client";xv();Rv();VR();UR();Mt=kt(Yt(),1);ea();It();by();BS();GR();zE();_t=kt(ya(),1),aq=400,sq=300});var JR={};Ft(JR,{mountToolbar:()=>dq});function QS(e){if("glyph"in e)return(0,Kf.createElement)("span",{style:{display:"contents"},dangerouslySetInnerHTML:{__html:xg[e.glyph]}});let{user:t}=e,n=t&&Kv(t);return(0,Kf.createElement)("span",{className:"review-avatar"},t?ep(t.name):QS({glyph:"person"}),n&&(0,Kf.createElement)("img",{key:n,src:n,alt:"",referrerPolicy:"no-referrer",decoding:"async",onError:o=>{o.currentTarget.hidden=!0}}))}function dq(e,t){e.replaceChildren();let n=(0,ZR.createRoot)(e);return(0,QR.flushSync)(()=>n.render(WR(t))),{render:o=>n.render(WR(o)),unmount:()=>n.unmount()}}var ZR,QR,Kf,WR,eH=O(()=>{"use strict";ZR=kt(TE(),1),QR=kt(ew(),1),Kf=kt(Yt(),1);XR();It();WR=e=>(0,Kf.createElement)(YR,{...e,items:e.items.map(t=>({...t,icon:QS(t.icon),children:t.children?.map(n=>({...n,icon:QS(n.icon)}))}))})});function If(e){return!!e&&typeof e.id=="string"&&typeof e.name=="string"&&typeof e.verified=="boolean"&&[e.avatarUrl,e.accentColor].every(t=>t===void 0||typeof t=="string")}function uq(e){if(e===void 0)return!0;if(!e||typeof e!="object"||Array.isArray(e))return!1;let t={tag:32,role:80,label:160,nearby:160,classes:200,selectedText:200,styles:500,scope:2e3};return Object.entries(e).every(([n,o])=>typeof t[n]=="number"&&typeof o=="string"&&o.length<=t[n])}function aH(e){return Array.isArray(e)&&e.every(t=>t&&typeof t.id=="string"&&typeof t.page=="string"&&typeof t.resolved=="boolean"&&Number.isFinite(t.createdAt)&&Number.isFinite(t.updatedAt)&&(t.resolvedBy===null||If(t.resolvedBy))&&t.anchor&&(!("context"in t.anchor)||uq(t.anchor.context))&&typeof t.anchor.selector=="string"&&typeof t.anchor.text=="string"&&[t.anchor.x,t.anchor.y,t.anchor.width,t.anchor.height,t.anchor.pageX,t.anchor.pageY,t.anchor.viewportWidth].every(Number.isFinite)&&Array.isArray(t.comments)&&t.comments.every(n=>n&&typeof n.id=="string"&&typeof n.body=="string"&&If(n.author)&&Number.isFinite(n.createdAt)&&(n.editedAt===null||Number.isFinite(n.editedAt))&&n.reactions&&typeof n.reactions=="object"&&!Array.isArray(n.reactions)&&Object.values(n.reactions).every(o=>Array.isArray(o)&&o.every(i=>typeof i=="string"))))}function sH(e,t){if(!t||!Array.isArray(e))return e;let n=o=>typeof o=="string"?Object.hasOwn(t,o)?t[o]:void 0:o;return e.map(o=>o&&{...o,resolvedBy:n(o.resolvedBy),comments:Array.isArray(o.comments)&&o.comments.map(i=>i&&{...i,author:n(i.author)})})}function yy(){return new to(0,"Could not read comments. Try again.","invalid_response")}var to,tc,Gf=O(()=>{"use strict";Yu();to=class extends Error{constructor(n,o,i){super(o);this.status=n;this.code=i}status;code};tc=class{constructor(t){this.options=t;let n=new URL(t.sessionEndpoint??t.endpoint).href.replace(/\/$/,""),o=t.sessionDomain?.replace(/^\./,"")??"";this.cookieDomain=o&&(location.hostname===o||location.hostname.endsWith(`.${o}`))?o:"",this.cookieName=`${this.cookieDomain?"__Secure-":"__Host-"}bc-session-${encodeURIComponent(JSON.stringify([n,t.project]))}`,this.key=`palette:${t.endpoint}:${t.project}`;let i=!1;try{let r=document.cookie.split("; ").find(a=>a.startsWith(`${this.cookieName}=`));i=r!==void 0,this.token=r?.slice(this.cookieName.length+1)||null}catch{}try{let r;try{r=JSON.parse(localStorage.getItem(this.userKey)??"null")}catch{}let a=localStorage.getItem(this.key)??(If(r?.user)&&typeof r.token=="string"?r.token:null);i?!this.token&&a&&this.clear():this.token=a,this.token&&r?.token===this.token&&If(r.user)&&(this.user=r.user)}catch{}try{let r=`bc-session-${encodeURIComponent(t.project)}`,a=location.hostname.match(/^[^.]+\.([^.]+\.(?:workers|pages)\.dev)$/)?.[1];for(let s of new Set(["",this.cookieDomain,a]))s!==void 0&&(document.cookie=`${r}=; Max-Age=0; Path=/${s?`; Domain=${s}`:""}`)}catch{}}options;token=null;user=null;transient=!1;revision;cachedThreads=[];reads=new AbortController;persistenceQueued=!1;persistenceBlocked=!1;key;cookieName;cookieDomain;get sessionKey(){return this.key}get userKey(){return`${this.key}:user`}rememberUser(){try{this.token&&this.user?localStorage.setItem(this.userKey,JSON.stringify({token:this.token,user:this.user})):zo(localStorage,this.userKey)}catch{}}cancelReads(){this.reads.abort(),this.reads=new AbortController}async request(t,n="GET",o,i){let r=new URL(t,this.options.endpoint.replace(/\/?$/,"/"));r.searchParams.set("project",this.options.project),r.searchParams.set("repo",this.options.repo),r.searchParams.set("branch",this.options.branch);let a={},s=this.token;s&&(a.Authorization=`Bearer ${s}`),o!==void 0&&(a["Content-Type"]=i??"application/json");let l=n==="GET"?this.reads.signal:void 0,c=AbortSignal.timeout(15e3),u=await fetch(r,{method:n,headers:a,body:o===void 0?void 0:i?o:JSON.stringify(o),credentials:"omit",cache:"no-store",signal:l?AbortSignal.any([l,c]):c}).catch(p=>{throw p instanceof TypeError?navigator.onLine===!1?new to(0,"You\u2019re offline.","offline"):new to(0,"Can\u2019t connect to comments.","unreachable"):p});l?.throwIfAborted();let d=await u.json().catch(()=>{if(l?.throwIfAborted(),u.ok)throw yy();return{}});if(l?.throwIfAborted(),u.ok&&(!d||typeof d!="object"||Array.isArray(d)))throw yy();if(!u.ok)throw u.status===401&&s&&this.token===s&&this.clear(),d?.code==="site_not_approved"?new to(u.status,"Comments aren\u2019t turned on for this site yet.",d?.code):new to(u.status,d?.error??"Could not load comments.",d?.code);return d}get listKey(){return`${this.key}:${JSON.stringify([this.options.repo,this.options.branch])}:threads`}cached(){try{let t=JSON.parse(localStorage.getItem(this.listKey)??"null");return t&&(t.threads=sH(t.threads,t.authors)),t?.token!==(this.token??"")||!aH(t.threads)||t.revision!==void 0&&(!Number.isSafeInteger(t.revision)||t.revision<0)?null:(this.revision=t.revision,this.cachedThreads=t.threads,t.threads)}catch{return null}}persist(){this.persistenceQueued||this.persistenceBlocked||(this.persistenceQueued=!0,queueMicrotask(()=>{this.persistenceQueued=!1;try{let t=Object.create(null),n=[],o=0,i=!1,r=this.options.page?.()??location.pathname,a=[...this.cachedThreads].sort((s,l)=>+(l.page===r)-+(s.page===r));for(let s of a){let l=Object.create(null),c=p=>(p&&(l[p.id]={...t[p.id],...l[p.id],...p}),p?.id??null),u={...s,resolvedBy:c(s.resolvedBy),comments:s.comments.map(p=>({...p,author:c(p.author)}))},d=JSON.stringify(u).length+Object.entries(l).reduce((p,[g,y])=>p+JSON.stringify([g,y]).length-(t[g]?JSON.stringify([g,t[g]]).length:0),0)+2;if(o+d>25e4){i=!0;continue}o+=d,Object.assign(t,l),n.push(u)}if(i&&!n.length){zo(localStorage,this.listKey);return}localStorage.setItem(this.listKey,JSON.stringify({token:this.token??"",revision:i?void 0:this.revision,threads:n,authors:t}))}catch{this.persistenceBlocked=!0;try{zo(localStorage,this.listKey)}catch{}}}))}async list(){let t=this.token,n=this.reads.signal,o=[],i=0,r,a;for(;i!==null;){let s=await this.request(`threads?authors=1&offset=${i}${r?`&cursor=${encodeURIComponent(r)}`:""}${i===0&&this.revision!==void 0?`&revision=${this.revision}`:""}`).catch(l=>{throw l instanceof to&&l.status===403&&this.token===t&&(this.revision=void 0,this.cachedThreads=[],this.persist()),l});if(n.throwIfAborted(),s.threads=sH(s.threads,s.authors),s.notModified===!0&&i===0&&this.revision!==void 0)return this.cachedThreads;if(!aH(s.threads)||s.nextCursor!=null&&(typeof s.nextCursor!="string"||s.nextCursor.length>200||s.nextCursor===r)||s.revision!==void 0&&(!Number.isSafeInteger(s.revision)||s.revision<0)||s.next!=null&&(!Number.isSafeInteger(s.next)||s.next<=i))throw yy();i===0&&(a=s.revision),o.push(...s.threads??[]),r=s.nextCursor??void 0,i=s.next??null}return this.revision=a,this.cachedThreads=o,this.persist(),o}save(t){t.token!==this.token&&(this.cancelReads(),this.revision=void 0,this.cachedThreads=[]),this.token=t.token,this.user=t.user,this.rememberUser();let n=!1;try{localStorage.setItem(this.key,t.token),n=!0}catch{}this.transient=!this.writeCookie(t.token,400*86400)&&!n}writeCookie(t,n){if(location.protocol!=="https:")return;let o="Path=/; SameSite=Lax; Secure";try{return this.cookieDomain&&(document.cookie=`${this.cookieName}=; Max-Age=0; ${o}`),document.cookie=`${this.cookieName}=${t}; Max-Age=${n}; ${o}${this.cookieDomain?`; Domain=${this.cookieDomain}`:""}`,document.cookie.split("; ").includes(`${this.cookieName}=${t}`)}catch{}}clear(){this.cancelReads();try{zo(localStorage,this.listKey);let t=Qx(this.key);for(let n of Object.keys(localStorage))(n.startsWith(`${this.key}:`)||t&&n.startsWith(`${t}:`))&&localStorage.removeItem(n)}catch{}this.revision=void 0,this.cachedThreads=[],this.token=null,this.user=null,this.transient=!1,this.rememberUser(),this.writeCookie("",400*86400);try{zo(localStorage,this.key)}catch{}}async restore(){if(!this.token)return;let t=this.token,n=await this.request("me");if(this.token===t){if(!If(n.user))throw yy();this.save({token:t,user:n.user})}}async guest(t){this.save(await this.request("auth/guest","POST",{name:t}))}async logout(){let t=this.request("me","DELETE");this.clear(),await t}}});function hH(e,t,n=!1){let o=t.split("+").map(s=>s.trim());o.length>1&&o.at(-1)===""&&o.at(-2)===""&&o.splice(-2,2,"+");let i=o.pop()??"",r=new Set;for(let s of o){let l=gH.find(c=>c.toLowerCase()===s.toLowerCase());if(!l||r.has(l))throw new Error(`Invalid Palette shortcut for ${e}: "${t}".`);r.add(l)}if(!i||xq.has(i.toLowerCase())&&!(n&&i.toLowerCase()==="tab"))throw new Error(`Invalid Palette shortcut for ${e}: "${t}".`);let a=i.length===1?i.toUpperCase():i;return{key:i.toLowerCase(),shift:r.has("Shift"),alt:r.has("Alt"),ctrl:r.has("Ctrl"),meta:r.has("Meta"),label:[...gH.filter(s=>r.has(s)),a].join("+")}}function eu(e={}){let t={...e.compare,...e.select},n={},o=new Map;for(let[i,r]of Object.entries(vq)){let a=t[i]??r;if(a===!1){n[i]=null;continue}let s=hH(i,a,!0),l=o.get(s.label.toLowerCase());if(l)throw new Error(`Palette shortcuts for ${l} and ${i} both use ${s.label}.`);o.set(s.label.toLowerCase(),i),n[i]=s}return n}function bH(e={}){let t={},n=new Map;for(let o of Object.keys(mH)){let i=e[o]??mH[o];if(i===!1){t[o]=null;continue}if(typeof i!="string")throw new Error(`Invalid Palette shortcut for ${o}.`);let r=hH(o,i),a=n.get(r.label.toLowerCase());if(a&&e[o]===void 0&&yq.has(o)){t[o]=null;continue}if(a)throw new Error(`Palette shortcuts for ${a} and ${o} both use ${r.label}.`);n.set(r.label.toLowerCase(),o),t[o]=r}return t}function Bo(e,t){if(!t||e.shiftKey!==t.shift||e.altKey!==t.alt||e.ctrlKey!==t.ctrl||e.metaKey!==t.meta)return!1;let{key:n}=t;if(e.key.toLowerCase()===n)return!0;let o=/^[a-z]$/.test(n)?`Key${n.toUpperCase()}`:/^\d$/.test(n)&&`Digit${n}`;return e.code===o&&(t.shift||t.alt||t.ctrl||t.meta||!/^[a-z\d]$/i.test(e.key))}var mH,yq,gH,xq,vq,wy=O(()=>{"use strict";mH={comment:"C",browse:"V",design:"D",restore:"Shift+K",comments:"L",visibility:"H"},yq=new Set(["visibility"]),gH=["Ctrl","Alt","Shift","Meta"],xq=new Set(["escape","tab"]);vq={before:"ArrowLeft",after:"ArrowRight",next:"Tab",prev:"Shift+Tab",parent:"Shift+Enter",child:!1}});function fn(e){return vH(e)||e?.namespaceURI==="http://www.w3.org/1999/xhtml"}function Ey(e,t=!1){return fn(e)?!t&&vH(e)?e.closest("svg")??e:e:null}var vH,Fs=O(()=>{"use strict";vH=e=>e?.namespaceURI==="http://www.w3.org/2000/svg"});function oc(e,t=e?.localName??"",n){let o=e?.getAttribute("role"),i=o?`${o[0].toUpperCase()}${o.slice(1)}`:Eq[/^h[1-6]$/.test(t)?"h":t],r=(n??e?.getAttribute("aria-label")??e?.getAttribute("alt")??e?.textContent??"").replace(/\s+/g," ").trim(),a=r.length>28?`${r.slice(0,27)}\u2026`:r;return[i,a&&`\u201C${a}\u201D`].filter(Boolean).join(" ")||t||"Element"}function nu(e){let t=e?.trim().replace(/^(?:ForwardRef|Memo)\((.+)\)$/,"$1");return t&&!kq.test(t)?t:void 0}var Eq,kq,ky=O(()=>{"use strict";Eq={h:"Heading",a:"Link",button:"Button",img:"Image",p:"Paragraph",li:"List item",input:"Field",textarea:"Field"};kq=/^(?:Primitive(?:\.\w+)?|Slot|Slottable|ForwardRef|Memo|Anonymous|Unknown|Fragment|Suspense|Presence|Context|[\w$]*\.(?:Provider|Consumer))$/});function Tq(e){try{return e?.ownerDocument?.defaultView?.[Sq]}catch{return}}function Ys(e,t){let n=Tq(e),o=t?.components;if(!n||n===o)return o??n;if(!o)return n;let i=wH.get(n);i||wH.set(n,i=new WeakMap);let r=i.get(o);if(!r){let a=new WeakMap;r={identify(s){let l=EH(n,s),c=EH(o,s),u=c&&(!l||c.element!==l.element&&l.element.contains(c.element))?c:l;return u&&a.set(u,u===l?n:o),u},editor:s=>a.get(s)?.editor?.(s)??null,panel:s=>a.get(s)?.panel?.(s)??null},i.set(o,r)}return r}var Sq,wH,EH,Sy=O(()=>{"use strict";Sq=Symbol.for("palette.instrumented-components"),wH=new WeakMap;EH=(e,t)=>{try{let n=e.identify(t);return n?.name?n:null}catch{return null}}});function kH(e){let t=new WeakMap,n=new WeakMap;return{begin(o,i){t.set(o,i)},override(o,i){let r=t.get(o);i&&r&&!r.bindingUndo&&!n.has(o)&&(r.bindingUndo=i)},commit(o,i,r,a){let s={value:i.style.getPropertyValue(r),priority:i.style.getPropertyPriority(r)},l=n.get(o),c=l?.before??t.get(o)??{value:"",priority:""};if(s.value===c.value&&s.priority===c.priority&&!c.bindingUndo)l&&e.splice(e.indexOf(l),1),n.delete(o);else if(l)l.after=s;else{let u={kind:"style",element:i,property:r,before:c,after:s};e.push(u),n.set(o,u)}a&&(t.set(o,s),n.delete(o))},cancel(o,i,r){let a=n.get(o);a&&(Ty(i,r,a.before),a.before.bindingUndo?.(),e.splice(e.indexOf(a),1)),n.delete(o),t.delete(o)},isDirty(o){return n.has(o)}}}function Ty(e,t,n){n?.restore?n.restore():e.style.setProperty(t,n?.value??"",n?.priority)}function ic(e){if(/^#[\da-f]{6}$/i.test(e))return e;if(/^#[\da-f]{3}$/i.test(e))return`#${[...e.slice(1)].map(n=>n+n).join("")}`;let t=e.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);return t?`#${t.slice(1,4).map(n=>Number(n).toString(16).padStart(2,"0")).join("")}`:"#000000"}function Ay(e,t){if(!t)return null;let n="",o=0,i=!1;for(let a of t)if(i)i=!1;else if(a==="\\")i=!0;else if(n)a===n&&(n="");else if(a==='"'||a==="'")n=a;else if(a==="(")o++;else if(a===")"&&--o<0)return null;if(n||o||i)return null;let r=document.createElement("span").style;return r.setProperty(e,t),r.getPropertyValue(e)?t:null}function $n(e,t){let n=e.getAttribute("style"),o=e.style.cssText,i=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t),a=getComputedStyle(e).getPropertyValue(t).trim(),s=u=>{let d=e.ownerDocument.createElement("span").style;return d.cssText=u,d.setProperty(t,""),d.cssText},l=s(o),c={value:i,priority:r,computed:a,absent:n===null,restore(){sT.get(e)?.push(()=>{e.style.getPropertyValue(t)===i&&e.style.getPropertyPriority(t)===r&&c.restore()}),s(e.style.cssText)===l?n===null?(e.getAttribute("style"),e.removeAttribute("style")):e.setAttribute("style",n):(e.style.setProperty(t,i,r),n===null&&!e.style.length&&rc(e))}};return c}function rc(e){e.style.length||(e.getAttribute("style"),e.removeAttribute("style"))}function Fa(e,t,n){if(!fn(e))return()=>{};let o=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t),r=!e.hasAttribute("style");return e.style.setProperty(t,n,i),()=>{o?e.style.setProperty(t,o,i):e.style.removeProperty(t),r&&rc(e)}}function ri(e,t,n,o=!1,i=!1){let r=aT.get(e);r&&(clearTimeout(r.timer),r.restore());let a=e.style.getPropertyValue("transition"),s=e.style.getPropertyPriority("transition"),l=!e.hasAttribute("style"),c=o?[...t].map(g=>`${g} .3s cubic-bezier(.22,1,.36,1)`).join():"none";e.style.setProperty("transition",c,"important");let u=e.style.getPropertyValue("transition"),d=[],p=()=>{if(aT.delete(e),!(e.style.getPropertyValue("transition")!==u||e.style.getPropertyPriority("transition")!=="important")){a?e.style.setProperty("transition",a,s):e.style.removeProperty("transition"),(i||l)&&rc(e);for(let g of d)g()}};sT.set(e,d);try{n()}finally{sT.delete(e)}o?aT.set(e,{restore:p,timer:window.setTimeout(p,320)}):(getComputedStyle(e).color,p())}var Xf,sT,aT,Li=O(()=>{"use strict";Fs();Xf="Runtime preview \xB7 Undo, Reset or reload to restore";sT=new WeakMap;aT=new WeakMap});function ta(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=[];for(;t.nextNode();){let o=t.currentNode;n.push([o,o.data])}return n}function SH(e,t,n){let o=t.startContainer===e&&e.childNodes.length===1?e.firstChild:t.startContainer;if(o?.nodeType!==Node.TEXT_NODE||t.startContainer!==t.endContainer||!e.contains(o)||o.parentElement?.closest(ac))return null;let i=t.startContainer===e?t.startOffset?o.length:0:t.startOffset,a=(t.endContainer===e?t.endOffset?o.length:0:t.endOffset)-i,s=n.replace(/\r\n?/g,`
13
13
  `).slice(0,Math.max(0,500-(e.textContent??"").length+a));o.replaceData(i,a,s);let l=e.ownerDocument.createRange();return l.setStart(o,i+s.length),l.collapse(!0),l}function Ya(e,t){for(let[n,o]of e)(!n.isConnected||t.contains(n))&&!n.parentElement?.closest(ac)&&n.data!==o&&(n.data=o)}function My(e,t,n){let o=t.multiline&&getComputedStyle(e).whiteSpace!=="pre-wrap"?$n(e,"white-space"):void 0;o&&e.style.setProperty("white-space","pre-wrap","important"),Ya(t,e);let i=new MutationObserver(()=>{!e.isConnected||t.some(([a])=>!e.contains(a))?(i.disconnect(),o?.restore(),n?.()):(Ya(t,e),r())}),r=()=>{i.disconnect(),i.observe(e,{childList:!0,characterData:!0,subtree:!0});for(let a=e.parentNode;a;a=a.parentNode??a.host??null)i.observe(a,{childList:!0})};return r(),()=>{i.disconnect(),o?.restore()}}function TH(e,t,n,o){if(!e.isConnected)return;let i=ta(e);if(i.map(([,p])=>p).join("")!==t)return;let r=0,a=t.length;for(;r<t.length&&r<n.length&&t[r]===n[r];)r++;for(;a>r&&n.length-(t.length-a)>r&&t[a-1]===n[n.length-(t.length-a)-1];)a--;let s=n.slice(r,n.length-(t.length-a)),l=[],c=0,u=!1;for(let[p,g]of i){let y=c+g.length;if(r===a?!u&&r>=c&&r<=y&&!p.parentElement?.closest(ac):r<y&&a>c){if(p.parentElement?.closest(ac))return;let x=Math.max(0,r-c),h=Math.min(g.length,Math.max(x,a-c));l.push([p,g.slice(0,x)+(u?"":s)+g.slice(h)]),u=!0}else l.push([p,g]);c=y}if(!u)return;let d=My(e,l,o);return()=>{d(),Ya(i,e)}}function Cy(){let e=new Map,t=[],n=[],o=new Map,i=new Map,r=l=>{o.get(l)?.(),o.delete(l)},a=(l,c)=>{r(l),o.set(l,My(l,c))},s=l=>{r(l),e.delete(l),i.delete(l)};return{pause:r,resume(l){let c=i.get(l);c&&a(l,c)},record(l){if(l.reactProp||l.before===l.after)return;n.length=0,e.has(l.element)||e.set(l.element,{text:l.before,nodes:l.nodes??ta(l.element),whitespace:getComputedStyle(l.element).whiteSpace||"normal"});let c=i.get(l.element)?.multiline;l.nodes&&(l.nodes.multiline=c),t.push(l);let u=ta(l.element);u.multiline=(l.multiline||c)&&l.after.includes(`
14
14
  `),i.set(l.element,u),a(l.element,u)},remember(l,c){e.has(l)||e.set(l,{text:c,nodes:ta(l),whitespace:getComputedStyle(l).whiteSpace||"normal"})},original(l){return e.get(l)?.text},reconcile(l,c){e.get(l)?.text===c&&s(l)},reset(l){r(l),Ya(e.get(l)?.nodes??[],l),s(l);for(let c=t.length-1;c>=0;c--)t[c].element===l&&t.splice(c,1);n.length=0},proposal(l){let c=e.get(l)?.text,u=i.get(l)?.map(([,d])=>d).join("")??l.textContent??"";return c!==void 0&&c!==u?`Proposed inline text change (preview only)
15
15
  - Text: ${JSON.stringify(c)} \u2192 ${JSON.stringify(u)}${i.get(l)?.multiline?`
@@ -95,7 +95,7 @@ ${c.innerHTML}`&&v();let m=GH(u,c)[r.index]??null;(d.parentNode!==u||d.nextEleme
95
95
  @media (prefers-reduced-motion:reduce){.palette-snapshot-viewer[open]{animation:none}}
96
96
  @media (pointer:coarse){.palette-snapshot-viewer .icon,.palette-snapshot-draft .icon{width:44px;height:44px}}`,hz=new WeakMap;MT=20,Fy=[],CT=0,dc=[],AT=0;uK=()=>new Promise(e=>{Fy.push(()=>e(()=>(CT--,LT()))),LT()}),uc=new Map;vz=new WeakMap,pc=new Map,bz=new WeakSet,im="img[data-palette-snapshot]";gK=/^<!-- (?:palette|komo): (no image snapshot, [^>]*?)\.? -->\s*/;Yy=new Map});var Lz={};Ft(Lz,{enterShell:()=>kK,leaveShellPage:()=>EK,shellUrl:()=>Zy,syncShell:()=>SK});function Zy(e,t){let n=new URL(e,location.href);return n.searchParams.delete("komo-shell"),t?n.searchParams.set(Mz,t):n.searchParams.delete(Mz),n.href}function EK(e,t=""){try{sessionStorage.removeItem(Cz),sessionStorage.removeItem("komo:shell"),t&&sessionStorage.setItem("palette:shell-off",t)}catch{}location.replace(Zy(e,""))}function kK(e,t,n,o){try{let i=sessionStorage.getItem("palette:shell-off");if(i)return o(i);if(t&&!confirm(`Reload in Frame?
97
97
 
98
- Unsaved app changes${n?" and unposted Design changes":""} will be lost.`))return o("Reload cancelled.");let r=Array.from(crypto.getRandomValues(new Uint8Array(16)),a=>a.toString(16).padStart(2,"0")).join("");sessionStorage.setItem(Cz,JSON.stringify({v:1,project:e,nonce:r,origin:location.origin})),location.replace(Zy(location.href,r))}catch{return o("Storage blocked.")}setTimeout(o,3e3,"Reload cancelled.")}function SK(e,t){try{let n=e.location.href,o=Zy(n,t);n.startsWith(location.origin)&&o!==location.href&&history.replaceState(history.state,"",o)}catch{}}var Mz,Cz,_z=O(()=>{"use strict";Mz="palette-shell",Cz="palette:shell"});var zz={};Ft(zz,{frameFailure:()=>Hz,openFrameViewport:()=>AK});function Rz(e){let t=e&&e!==window?e.frameElement:null;if(!t)return null;let n=t.getBoundingClientRect(),o=n.width/(t.offsetWidth||1)||1;return{left:n.left+t.clientLeft*o,top:n.top+t.clientTop*o,scale:o}}function DT(e,t){let n=Rz(t);return n?new DOMRect(n.left+e.left*n.scale,n.top+e.top*n.scale,e.width*n.scale,e.height*n.scale):new DOMRect(e.left,e.top,e.width,e.height)}function Dz(e,t,n){let o=Rz(n);return o?{x:(e-o.left)/o.scale,y:(t-o.top)/o.scale}:{x:e,y:t}}async function Hz(e){if(new URL(e,location.href).origin!==location.origin)return"The viewport URL is on another origin, so Palette can't reach into it.";let t=w("iframe");t.hidden=!0,document.body.append(t);try{let n=await(t.contentWindow?.fetch??fetch)(e,{redirect:"manual",credentials:"include"});if(n.type==="opaqueredirect")return"The page redirected to another origin, so Palette can't reach into it.";if((n.headers.get("x-frame-options")?.toLowerCase()??"").includes("deny"))return"The page sends X-Frame-Options: DENY, which blocks a separate viewport.";let i=/frame-ancestors([^;,]*)/i.exec(n.headers.get("content-security-policy")??"")?.[1].trim();if(i!==void 0&&!/'self'|\*|https?:/.test(i))return`The page's Content-Security-Policy (frame-ancestors ${i||"'none'"}) blocks a separate viewport.`}catch{}finally{t.remove()}return"The page didn't load as a same-origin document in a separate viewport."}function AK(e){let t=w("style");t.textContent=TK;let n=w("div","frame-stage"),o=w("div","frame-port");n.dataset.loading="",o.style.background=e.background;let i=w("iframe");i.name=hM,i.dataset.paletteViewport=i.dataset.komoViewport="",i.title="Page viewport",o.append(i),n.append(o),e.parent.insertBefore(t,e.before),e.parent.insertBefore(n,e.before);let r=new AbortController,a=null,s=!1,l=d=>{s||(s=!0,clearTimeout(c),dg(null),e.failed(d))},c=window.setTimeout(()=>l(`The page took longer than ${Math.round((e.timeout??15e3)/1e3)} seconds to load in a separate viewport.`),e.timeout??15e3);function u(d,p){let g=()=>queueMicrotask(()=>!s&&e.changed());for(let v of["pushState","replaceState"]){let x=d.history[v];d.history[v]=function(...h){let m=x.apply(this,h);return g(),m}}for(let v of["popstate","hashchange","resize"])d.addEventListener(v,g,{signal:p});let y=new MutationObserver(g);y.observe(d.document.documentElement,{childList:!0,subtree:!0,characterData:!0}),p.addEventListener("abort",()=>y.disconnect(),{once:!0})}return i.addEventListener("load",()=>{if(s)return;let d=null;try{d=i.contentDocument,d&&i.contentWindow.location.origin!==location.origin&&(d=null)}catch{d=null}if(!d||d.URL==="about:blank"){if(a)return l("The page navigated to another origin, so Palette can't reach into it.");Hz(e.url).then(l);return}clearTimeout(c),a||i.contentWindow.scrollTo({top:e.scroll,behavior:"instant"}),a=d,dg(i),u(i.contentWindow,r.signal),delete n.dataset.loading,e.ready()},{signal:r.signal}),o.addEventListener("scroll",()=>e.changed(),{passive:!0,signal:r.signal}),i.src=e.url,{iframe:i,port:o,place({left:d,top:p,width:g,height:y,logical:v,scale:x,pan:h}){Object.assign(o.style,{left:`${d}px`,top:`${p}px`,width:`${g}px`,height:`${y}px`}),h||o.scrollTo(0,0),o.toggleAttribute("data-pan",h),Object.assign(i.style,{width:`${v[0]}px`,height:`${v[1]}px`,transform:x===1?"":`scale(${x})`})},destroy(){s=!0,clearTimeout(c),r.abort(),dg(null),n.remove(),t.remove()}}}var TK,Oz=O(()=>{"use strict";It();ho();yM({toScreen:DT,toView:Dz,screenRect(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView;return n===window?t:DT(t,n)},clientPoint(e){let t=e.view;if(!t||t===window)return{x:e.clientX,y:e.clientY};let n=DT({left:e.clientX,top:e.clientY,width:0,height:0},t);return{x:n.left,y:n.top}},pageElementsAt(e,t){let n=as(),o=n?.parentElement?.getBoundingClientRect();if(!n||!o||e<o.left||e>=o.right||t<o.top||t>=o.bottom)return document.elementsFromPoint(e,t);let i=Dz(e,t,n.contentWindow);return n.contentDocument.elementsFromPoint(i.x,i.y)},counterpart(e,t){if(e.ownerDocument===t)return e;let n=[];for(let o=e;o&&o!==o.ownerDocument.documentElement;o=o.parentElement){if(o.id||o===o.ownerDocument.body){n.unshift(o.id?`#${CSS.escape(o.id)}`:"body");break}n.unshift(`${o.localName}:nth-child(${[...o.parentElement.children].indexOf(o)+1})`)}try{return n.length?t.querySelector(n.join(">")):t.documentElement}catch{return null}}});TK=".frame-stage{position:fixed;inset:0;z-index:0;background:#080808;pointer-events:auto}.frame-port{position:absolute;overflow:clip;border-radius:12px;overscroll-behavior:contain}.frame-port[data-pan]{overflow:auto;scrollbar-width:thin;scrollbar-color:#5a5a5a transparent}.frame-stage[data-loading]{visibility:hidden;pointer-events:none}.frame-port iframe{display:block;border:0;transform-origin:0 0;color-scheme:normal}"});var Uz={};Ft(Uz,{FRAME_PRESETS:()=>$z,anchoredPan:()=>Vz,clampPan:()=>HT,frameSizeRecord:()=>RT,mountFrameSize:()=>CK,readFrameSize:()=>jz,scrollsFirst:()=>Bz,wheelTravel:()=>Pz});function jz(e){try{let t=JSON.parse(e??"null");return t?.v!==Nz?{size:"window",actual:!1}:{size:t.size==="available"?"available":Array.isArray(t.size)&&t.size.length===2&&t.size.every(Number.isFinite)?[Zs(t.size[0]),Zs(t.size[1],1)]:"window",actual:t.actual===!0,...typeof t.inPlace=="boolean"?{inPlace:t.inPlace}:{}}}catch{return{size:"window",actual:!1}}}function Pz(e,t){let n=i=>e.deltaMode===1?16:e.deltaMode===2?t[i]:1,o=[e.deltaX*n(0),e.deltaY*n(1)];return e.shiftKey&&!o[0]?[o[1],0]:o}function Bz(e,t,n){let o=(i,r,a,s,l)=>!!r&&/auto|scroll|overlay/.test(i)&&s>l+1&&(r>0?a+l<s-1:a>0);for(let i=e?.nodeType===1?e:e?.parentElement;i&&i!==i.ownerDocument.body&&i!==i.ownerDocument.documentElement;i=i.parentElement??i.getRootNode().host){let r=getComputedStyle(i);if(o(r.overflowX,t,i.scrollLeft,i.scrollWidth,i.clientWidth)||o(r.overflowY,n,i.scrollTop,i.scrollHeight,i.clientHeight))return!0}return!1}function CK(e,t,n,o,i,r=!1,a={}){let s=null;try{s=localStorage.getItem(n)}catch{}let l=jz(s),{size:c,actual:u}=l,d=l.inPlace!==void 0,p=!!r&&(d?!l.inPlace:r==="iframe"),g={active:!1},y,v=()=>r?d?!p:void 0:l.inPlace,x=()=>{try{let K=RT(c,u,v());K?localStorage.setItem(n,K):zo(localStorage,n)}catch{}};s!==null&&s!==RT(c,u,v())&&x();let h=[0,0],m=[0,0],b=null,E=(K,ce,_e=!0,et=p)=>{if(ce&&!u&&y&&Le&&!g.active){let gt=a.anchor?.()??b??{x:y.left+y.width*y.scale/2,y:y.top+y.height*y.scale/2};h=Vz(gt,y,{left:Le.left/Ie,top:Le.top/Ie})}else ce||(h=[0,0]);c=K,u=ce;let Ve=et!==p||et&&!!g.reason&&!g.active;p=et,o(Ve),_e&&x()},S=Dt("div","frame-size"),A=Dt("style","",{},MK),_=Dt("div","frame-bar",{role:"toolbar","aria-label":"Frame size"}),T=Dt("button","frame-size-trigger",{type:"button","aria-haspopup":"menu","aria-expanded":"false"}),H=Dt("span","frame-name"),R=Dt("span",""),z=Dt("span","frame-scale");T.append(H,R,Dt("span","frame-at",{},"\xB7"),z);let F=Dt("span","frame-note",{hidden:""}),B=Dt("button","frame-info",{type:"button"}),le=Dt("span","frame-tip",{role:"tooltip","aria-hidden":"true"}),J=`Layout follows your browser window, not this size.${r?" Turn on Simulate real viewport in this menu for real breakpoints.":""}`,V=Dt("span","frame-loading",{role:"status"});F.append(V,B,le),_.append(T,F);let oe=Dt("div","frame-menu",{role:"menu","aria-label":"Frame size",hidden:""}),ue=[["Desktop","Your window","window"],["Available","Available space","available"],...$z.map(([K,ce,_e])=>[K,`${K} ${ce}`,[ce,_e]])],q=[],Y=ue.map(([,K,ce])=>{let _e=Dt("button","",{type:"button",role:"menuitemradio"}),et=Dt("span","",{},typeof ce=="string"?"":fu(ce));return q.push(et),_e.append(K,et),_e.addEventListener("click",()=>{Ye(),E(ce,u)}),_e}),W=Dt("form","frame-custom",{"aria-label":"Custom size"}),C=["Width","Height"].map((K,ce)=>Dt("input","",{"aria-label":K,inputmode:"numeric",type:"number",min:String(mu[ce][0]),max:String(mu[ce][1]),required:""}));W.append(C[0],"\xD7",C[1],Dt("button","",{type:"submit"},"Set")),W.addEventListener("submit",K=>{K.preventDefault(),Ye(),E([Zs(+C[0].value),Zs(+C[1].value,1)],u)});let U=["1","0"].map(K=>({key:K,shift:!0,alt:!1,ctrl:!1,meta:!1,label:`Shift+${K}`})),I=["Fit","100%"].map((K,ce)=>{let _e=Dt("button","",{type:"button",role:"menuitemradio","aria-keyshortcuts":U[ce].label},K),et=Dt("span","palette-kbd",{"aria-hidden":"true","data-variant":"surface"});for(let Ve of[/mac|iphone|ipad/i.test(navigator.platform)?"\u21E7":"Shift",U[ce].key])et.append(Dt("kbd","",{},Ve));return _e.append(et),_e.addEventListener("click",()=>{Ye(),ot(!!ce)}),_e}),G=()=>Dt("div","frame-sep",{role:"separator"});oe.append(...Y,W,G(),Dt("div","frame-heading",{"aria-hidden":"true"},"Zoom"),...I);let te=Dt("button","frame-sim",{type:"button",role:"menuitemcheckbox","aria-labelledby":"frame-sim-label","aria-describedby":"frame-sim-hint"});te.append(Dt("b","",{id:"frame-sim-label"},"Simulate real viewport"),Dt("span","",{id:"frame-sim-hint"},a.shell?"Reloads this page inside a frame so breakpoints and popovers match this size.":"Reloads the page in a frame so breakpoints and popovers match this size. Runs a second copy of the app.")),r&&oe.append(G(),te);let ie=Dt("div","frame-handle",{role:"slider",tabindex:"0","aria-label":"Frame width","aria-orientation":"horizontal","aria-valuemin":String(mu[0][0]),"aria-valuemax":String(mu[0][1])}),pe=Dt("div","frame-corner",{role:"button",tabindex:"0","aria-label":"Frame size: arrow keys change width and height"}),xe=Dt("div","frame-readout",{hidden:"",role:"status"}),L=`${n}:scaled-tip`,Q=Dt("div","frame-hint",{role:"note",hidden:""}),Z=Dt("button","",{type:"button"},"Use 100%"),ae=Dt("button","frame-hint-close",{type:"button","aria-label":"Dismiss tip"},"\xD7");Q.append(Dt("span","",{},"Some floating UI may be offset while scaled. Use 100% to check exact positions."),Z,ae);let we=!1;try{we=localStorage.getItem(L)==="1"}catch{}let Te=()=>{we=!0,Q.hidden=!0;try{localStorage.setItem(L,"1")}catch{}};S.append(_,oe,Q,ie,pe,xe),e.append(A,S);let $=1,D=e.host,j=()=>!!y?.pan&&!S.hidden&&!g.active,X=()=>!!y?.pan&&!S.hidden,fe=(K,ce)=>{let _e=HT([K,ce],m);_e[0]===h[0]&&_e[1]===h[1]||(h=_e,a.pan?.())},ye=(K,ce)=>fe(h[0]+K/$,h[1]+ce/$),De=["x","y"].map(K=>{let ce=Dt("div","frame-scroll",{"data-axis":K,role:"scrollbar",tabindex:"0",hidden:"","aria-orientation":K==="x"?"horizontal":"vertical","aria-label":`Pan the frame ${K==="x"?"horizontally":"vertically"}: arrow, Page and Home/End keys`,"aria-valuemin":"0"}),_e=Dt("div","frame-thumb");return ce.append(_e),{axis:K,track:ce,thumb:_e,length:0,thumbLength:0}}),Ce=Dt("div","frame-hand",{hidden:"","aria-hidden":"true"}),Pe=null,Ne=!1;S.append(Ce,...De.map(K=>K.track));let Le=null,Ie=1,ut=0,ct=null,de=0,Ae=()=>[y?.width??0,y?.height??0],ve=(K,ce)=>{clearTimeout(ut),xe.textContent=fu(K),xe.hidden=!1,ct=K,ce?(cancelAnimationFrame(de),de=0,E(K,u),ut=window.setTimeout(()=>xe.hidden=!0,900)):de||=requestAnimationFrame(()=>{de=0,ct&&E(ct,u,!1)})},Re=!1,Fe=()=>Q.hidden=we||!Re||!oe.hidden;function Ye(){oe.hidden=!0,T.setAttribute("aria-expanded","false"),Fe()}T.addEventListener("click",()=>{let K=oe.hidden;oe.hidden=!K,Fe(),T.setAttribute("aria-expanded",String(K)),K&&(C.forEach((ce,_e)=>ce.value=String(Math.round(Ae()[_e]))),(Y.find(ce=>ce.getAttribute("aria-checked")==="true")??Y[0]).focus())}),oe.addEventListener("keydown",K=>{K.key==="Escape"&&(K.stopPropagation(),Ye(),T.focus())});let $e=new AbortController;document.addEventListener("pointerdown",K=>{!oe.hidden&&!K.composedPath().some(ce=>ce===oe||ce===T)&&Ye()},{capture:!0,signal:$e.signal});function ot(K){K&&Te(),E(c,K)}te.addEventListener("click",()=>{d=!0,E(c,u,!0,!p),te.setAttribute("aria-checked",String(p))}),Z.addEventListener("click",()=>ot(!0));let rn=U.map(({key:K})=>Object.values(a.shortcuts??{}).some(ce=>!!ce?.shift&&!ce.alt&&!ce.ctrl&&!ce.meta&&ce.key===K)),Zt=K=>{let ce=["Digit1","Digit0"].indexOf(K.code);if(ce<0||rn[ce]||S.hidden||!K.shiftKey||K.altKey||K.ctrlKey||K.metaKey||K.defaultPrevented||K.isComposing)return;let _e=document.activeElement;for(;_e?.shadowRoot?.activeElement;)_e=_e.shadowRoot.activeElement;let et=a.textEntry??Ht;et(K.composedPath()[0])||_e?.localName!=="iframe"&&et(_e??void 0)||(K.preventDefault(),ot(!!ce))};window.addEventListener("keydown",Zt,{signal:$e.signal}),a.onFrame?.("keydown",Zt,{signal:$e.signal},"window"),ae.addEventListener("click",Te);let Ht=K=>!!K?.isContentEditable||!!K?.matches?.("input,textarea,select");window.addEventListener("wheel",K=>{if(!j()||K.ctrlKey||K.defaultPrevented)return;let ce=K.composedPath();if(ce.includes(D)&&!De.some(Ve=>ce.includes(Ve.track))&&!ce.includes(Ce))return;let[_e,et]=Pz(K,[Le?.width??innerWidth,Le?.height??innerHeight]);!ce.includes(D)&&Bz(ce[0],_e,et)||(K.preventDefault(),ye(_e,et))},{capture:!0,passive:!1,signal:$e.signal}),document.addEventListener("pointermove",K=>{if(!Le||K.pointerType==="touch"||K.composedPath().includes(S))return;b=K.clientX>=Le.left&&K.clientX<=Le.left+Le.width&&K.clientY>=Le.top&&K.clientY<=Le.top+Le.height?{x:K.clientX/Ie,y:K.clientY/Ie}:b},{capture:!0,passive:!0,signal:$e.signal});let pt=()=>{Ne=!1,Pe||(Ce.hidden=!0)},Qt=(K,ce)=>{window.addEventListener(K,ce,{capture:!0,signal:$e.signal}),a.onFrame?.(K,ce,{capture:!0,signal:$e.signal},"window")};Qt("keydown",K=>{if(K.key!==" "||K.ctrlKey||K.metaKey||K.altKey)return;if(!Ce.hidden){K.preventDefault(),K.stopPropagation();return}let ce=K.composedPath();!X()||K.repeat||ce.includes(D)||Ht(ce[0])||(K.preventDefault(),K.stopPropagation(),Ne=!0,Ce.hidden=!1)}),Qt("keyup",K=>{K.key!==" "||Ce.hidden||(K.preventDefault(),K.stopPropagation(),pt())}),window.addEventListener("blur",pt,{signal:$e.signal}),a.onFrame?.("blur",()=>setTimeout(()=>document.hasFocus()||pt()),{signal:$e.signal},"window"),Ce.addEventListener("pointerdown",K=>{if(K.button)return;K.preventDefault(),Ce.setPointerCapture(K.pointerId),Ce.dataset.grabbing="";let ce=g.active?t():null;Pe={x:K.clientX,y:K.clientY,pan:ce?[ce.scrollLeft,ce.scrollTop]:h,id:K.pointerId,port:ce}}),Ce.addEventListener("pointermove",K=>{if(Pe?.id!==K.pointerId)return;let[ce,_e]=[K.clientX-Pe.x,K.clientY-Pe.y];Pe.port?Pe.port.scrollTo(Pe.pan[0]-ce,Pe.pan[1]-_e):fe(Pe.pan[0]-ce/$,Pe.pan[1]-_e/$)});let Mn=()=>{Pe=null,delete Ce.dataset.grabbing,Ne||(Ce.hidden=!0)};Ce.addEventListener("pointerup",Mn),Ce.addEventListener("pointercancel",Mn);for(let K of De){let ce=K.axis==="x"?0:1,_e=null;K.track.addEventListener("pointerdown",Ve=>{if(Ve.button)return;Ve.preventDefault(),K.track.focus({preventScroll:!0});let gt=ce?Ve.clientY:Ve.clientX;if(Ve.target!==K.thumb){let Ct=K.thumb.getBoundingClientRect(),ht=(ce?Le?.height:Le?.width)??0,Gt=gt<(ce?Ct.top:Ct.left);ce?ye(0,Gt?-ht*.9:ht*.9):ye(Gt?-ht*.9:ht*.9,0);return}K.track.setPointerCapture(Ve.pointerId),K.thumb.dataset.active="",_e={start:gt,pan:h[ce],id:Ve.pointerId}}),K.track.addEventListener("pointermove",Ve=>{if(_e?.id!==Ve.pointerId)return;let gt=((ce?Ve.clientY:Ve.clientX)-_e.start)*m[ce]/Math.max(1,K.length-K.thumbLength);ce?fe(h[0],_e.pan+gt):fe(_e.pan+gt,h[1])});let et=()=>{_e=null,delete K.thumb.dataset.active};K.track.addEventListener("pointerup",et),K.track.addEventListener("pointercancel",et),K.track.addEventListener("keydown",Ve=>{let gt=[Le?.width??0,Le?.height??0].map(ht=>ht*.9/Ie),Ct={ArrowLeft:[-40,0],ArrowRight:[40,0],ArrowUp:[0,-40],ArrowDown:[0,40],PageUp:[0,-gt[1]],PageDown:[0,gt[1]]}[Ve.key];if(Ve.key==="Home"||Ve.key==="End"){Ve.preventDefault();let ht=Ve.key==="End"?1e9:0;Ve.shiftKey||ce===0?fe(ht,h[1]):fe(h[0],ht);return}Ct&&(Ve.preventDefault(),fe(h[0]+Ct[0],h[1]+Ct[1]))})}document.addEventListener("focusin",K=>{let ce=K.composedPath()[0];if(!j()||!Le||!t().contains(ce)||!ce.getBoundingClientRect)return;let _e=ce.getBoundingClientRect(),et=(Ct,ht,Gt,wt)=>Ct<Gt?Ct-Gt-24:Ct+ht>Gt+wt?Math.min(Ct-Gt-24,Ct+ht-Gt-wt+24):0,Ve=et(_e.left,_e.width,Le.left,Le.width),gt=et(_e.top,_e.height,Le.top,Le.height);(Ve||gt)&&ye(Ve,gt)},{capture:!0,signal:$e.signal}),document.addEventListener("mousedown",K=>{let ce=K.composedPath()[0];!j()||ce!==document.documentElement&&ce!==document.body||(K.preventDefault(),(De[1].track.hidden?De[0]:De[1]).track.focus({preventScroll:!0}))},{capture:!0,signal:$e.signal});for(let[K,ce]of[[ie,!1],[pe,!0]]){let _e=null;K.addEventListener("pointerdown",Ve=>{Ve.button||(Ve.preventDefault(),K.setPointerCapture(Ve.pointerId),K.dataset.active="",_e={x:Ve.clientX,y:Ve.clientY,size:Ae(),ratio:$})}),K.addEventListener("pointermove",Ve=>{_e&&ve([Zs(_e.size[0]+(Ve.clientX-_e.x)/_e.ratio),ce?Zs(_e.size[1]+(Ve.clientY-_e.y)/_e.ratio,1):Math.round(_e.size[1])],!1)});let et=()=>{_e&&(_e=null,delete K.dataset.active,ve(ct??Ae(),!0))};K.addEventListener("pointerup",et),K.addEventListener("pointercancel",et),K.addEventListener("keydown",Ve=>{let gt=Ve.shiftKey?100:10,Ct={ArrowRight:[gt,0],ArrowLeft:[-gt,0],...ce?{ArrowDown:[0,gt],ArrowUp:[0,-gt]}:{}}[Ve.key];if(!Ct)return;Ve.preventDefault(),Ve.stopPropagation();let[ht,Gt]=Ae();ve([Zs(ht+Ct[0]),Zs(Gt+Ct[1],1)],!0)})}return{view(K,ce){let _e=i(K,c==="window"?ce:c==="available"?[K.width,K.height]:c,u);m=_e.pan?[Math.max(0,_e.width*_e.scale-K.width),Math.max(0,_e.height*_e.scale-K.height)]:[0,0],h=HT(h,m);let et=g.active?[0,0]:h;return y={..._e,left:_e.left-et[0],top:_e.top-et[1]}},sized:c!=="window"||u,get separate(){return p},status(K){g=K,y&&this.update(Le,Ie)},update(K,ce=1){Le=K,Ie=ce;let _e=y??=K&&i({left:K.left/ce,top:K.top/ce,width:K.width/ce,height:K.height/ce},[innerWidth/ce,innerHeight/ce],!1);if(S.hidden=!K||!_e,!K||!_e)return Ye();$=_e.scale*ce;let et=t(),Ve=et.getBoundingClientRect();g.active||(et.style.clipPath=_e.pan?`inset(${[K.top-Ve.top,Ve.right-K.left-K.width,Ve.bottom-K.top-K.height,K.left-Ve.left].map(wt=>`${Math.max(0,wt)/ce}px`).join(" ")} round ${12/ce}px)`:et.style.clipPath);let gt=ue.findIndex(([,,wt])=>typeof wt=="string"||typeof c=="string"?wt===c:wt[0]===c[0]&&wt[1]===c[1]),Ct=gt<0?"":ue[gt][0];H.textContent=Ct,H.hidden=!Ct,R.textContent=fu(Ae()),z.textContent=`${Math.round(_e.scale*100)}%`,T.setAttribute("aria-label",`${Ct} ${R.textContent} \xB7 ${z.textContent}`.trim()),q[0].textContent=fu([innerWidth/ce,innerHeight/ce]),q[1].textContent=fu([K.width/ce,K.height/ce]),Y.forEach((wt,jn)=>wt.setAttribute("aria-checked",String(jn===gt))),I.forEach((wt,jn)=>wt.setAttribute("aria-checked",String(!!jn===u))),te.setAttribute("aria-checked",String(p));let ht=p&&!g.active&&!g.loading&&!!g.reason;le.textContent=ht?`Simulated viewport unavailable. ${g.reason} Showing the page itself.`:J,B.setAttribute("aria-label",ht?"Why the simulated viewport is unavailable":"Why the layout follows your browser window"),B.setAttribute("aria-description",le.textContent),F.toggleAttribute("data-reason",ht),V.textContent=g.loading?"Loading\u2026":"",B.hidden=!!g.loading,F.hidden=g.active||!ht&&!g.loading&&Math.abs(_e.width-innerWidth/ce)<1,ie.setAttribute("aria-valuenow",String(Math.round(_e.width))),ie.setAttribute("aria-valuetext",`${fu(Ae())} pixels`);let Gt=Math.max(8,K.top-40);pu(_,K.left,Gt),_.style.width=`${K.width}px`,pu(oe,K.left,Gt+34),Re=_e.scale<=.999&&!g.active,Fe(),Q.style.maxWidth=`${K.width-24}px`,pu(Q,K.left+12,K.top+K.height-12-(Q.offsetHeight||38)),ie.hidden=pe.hidden=_e.pan,pu(ie,Ve.right,Ve.top,Ve.height),pu(pe,Ve.right,Ve.bottom),pu(xe,Math.max(Ve.left+8,Ve.right-120),Ve.bottom-36);for(let wt of De){let jn=wt.axis==="x"?0:1,Ze=(jn?K.height:K.width)-12,Et=m[jn]*ce;if(wt.track.hidden=!_e.pan||Et<1||g.active,wt.track.hidden)continue;wt.length=Ze,wt.thumbLength=Math.max(32,Ze*Ze/(Ze+Et));let Pn=(Ze-wt.thumbLength)*h[jn]/(m[jn]||1);Object.assign(wt.track.style,jn?{left:`${K.left+K.width-12}px`,top:`${K.top}px`,width:"",height:`${Ze}px`}:{left:`${K.left}px`,top:`${K.top+K.height-12}px`,width:`${Ze}px`,height:""}),Object.assign(wt.thumb.style,jn?{top:`${Pn}px`,height:`${wt.thumbLength}px`,left:"",width:""}:{left:`${Pn}px`,width:`${wt.thumbLength}px`,top:"",height:""}),wt.track.setAttribute("aria-valuemax",String(Math.round(m[jn]))),wt.track.setAttribute("aria-valuenow",String(Math.round(h[jn])))}_e.pan||pt(),Object.assign(Ce.style,{left:`${K.left}px`,top:`${K.top}px`,width:`${K.width}px`,height:`${K.height}px`})},destroy(){clearTimeout(ut),cancelAnimationFrame(de),$e.abort(),A.remove(),S.remove()}}}var $z,mu,Nz,MK,Dt,pu,Zs,RT,HT,Vz,fu,qz=O(()=>{"use strict";Yu();$z=[["Wide",1440,900],["Laptop",1280,800],["Tablet",768,1024],["Mobile",390,844]],mu=[[240,3840],[240,2160]],Nz=2,MK=`.frame-size{position:fixed;inset:0;pointer-events:none;z-index:3;font-size:12px;font-weight:500;line-height:1;color:#d6d3ce}.frame-size>*{pointer-events:auto;position:fixed}.frame-size [hidden]{display:none}.frame-bar,.frame-custom{display:flex;align-items:center;gap:6px}.frame-size button,.frame-size input,.frame-menu{font:inherit;color:inherit;background:#1c1c1c;border:1px solid #ffffff14;border-radius:8px;height:28px;padding:0 10px;cursor:pointer}.frame-size button:hover{background:#262626}.frame-size :focus-visible{outline:2px solid var(--accent,#bda6ef);outline-offset:1px}.frame-size [aria-checked=true]{background:#ffffff1f;color:#f1efeb}.frame-menu{display:grid;height:auto;min-width:200px;padding:4px;border:0;border-radius:10px;background:#232323;box-shadow:0 0 0 1px #ffffff14,0 12px 32px #0008;font-size:11px;cursor:auto}.frame-menu>button{display:flex;gap:12px;padding:0 8px;border:0;background:none}.frame-menu>button>span{margin-left:auto}.frame-menu>button::after{content:"";width:7px;height:3.5px;align-self:center;margin:-3px 3px 0 0;border:solid #0000;border-width:0 0 1.5px 1.5px;rotate:-45deg}.frame-menu>[aria-checked=true]::after{border-color:#bda6ef}.frame-size .frame-menu>[aria-checked=true]{background:none}.frame-size span,.frame-readout,.frame-custom{color:#898680;font-variant-numeric:tabular-nums}.frame-custom{gap:4px;padding:4px 4px 2px;border-top:1px solid #ffffff0d}.frame-custom input{width:64px;padding:0 6px;cursor:text}.frame-handle{width:10px;margin-left:-5px;cursor:ew-resize;touch-action:none}.frame-corner{width:18px;height:18px;margin:-9px 0 0 -9px;cursor:nwse-resize;touch-action:none}.frame-handle::after,.frame-corner::after{content:'';position:absolute;left:3px;top:calc(50% - 20px);width:4px;height:40px;border-radius:2px;background:#ffffff40}.frame-corner::after{inset:4px;width:auto;height:auto;background:none;border:solid #ffffff59;border-width:0 2px 2px 0;border-radius:0 0 4px 0}.frame-handle:hover::after,.frame-handle[data-active]::after{background:var(--accent,#bda6ef)}.frame-corner:hover::after,.frame-corner[data-active]::after{border-color:var(--accent,#bda6ef)}.frame-readout{padding:5px 8px;border-radius:6px;background:#1c1c1cf2;color:#f1efeb}.frame-scroll{box-sizing:border-box;touch-action:none}.frame-scroll[data-axis=y]{width:12px}.frame-scroll[data-axis=x]{height:12px}.frame-thumb{position:absolute;border-radius:4px;background:#2a2a2ad9;box-shadow:0 0 0 1px #ffffff2e}.frame-scroll[data-axis=y] .frame-thumb{left:3px;right:3px}.frame-scroll[data-axis=x] .frame-thumb{top:3px;bottom:3px}.frame-scroll:hover .frame-thumb,.frame-scroll:focus-visible .frame-thumb,.frame-thumb[data-active]{background:#3a3a3af2;box-shadow:0 0 0 1px #ffffff59}.frame-hand{cursor:grab;touch-action:none}.frame-hand[data-grabbing]{cursor:grabbing}.frame-hint{display:flex;align-items:center;gap:8px;box-sizing:border-box;padding:4px 4px 4px 12px;border:1px solid #ffffff14;border-radius:10px;background:#1c1c1cf2;box-shadow:0 8px 24px #0006;line-height:1.35}.frame-hint span{color:#d6d3ce}.frame-size .frame-hint-close{width:28px;padding:0;border:0;background:none;color:#898680;font-size:16px}.frame-bar{gap:2px;white-space:nowrap;pointer-events:none;container-type:inline-size}.frame-bar>*{flex:none;pointer-events:auto}.frame-size .frame-size-trigger{display:flex;align-items:center;gap:0;padding-right:9px;font-variant-numeric:tabular-nums}.frame-name{margin-right:4px}.frame-at{margin:0 4px}.frame-size-trigger span{color:inherit}.frame-size-trigger::after{content:"";width:5px;height:5px;margin:-3px 0 0 9px;border:solid;border-width:0 1.5px 1.5px 0;rotate:45deg;opacity:.6}@container (max-width:240px){.frame-name,.frame-at,.frame-scale{display:none}}.frame-note{position:relative;display:flex;align-items:center}.frame-loading:not(:empty){padding:0 6px}.frame-bar .frame-info{flex:none;width:22px;height:22px;padding:0;border:0;border-radius:6px;background:none;color:#898680}.frame-bar .frame-info:hover{background:#ffffff12;color:#f1efeb}.frame-info::before{content:"i";display:inline-grid;place-items:center;width:12px;height:12px;border:1.2px solid;border-radius:50%;font:italic 600 9px/1 Georgia,serif}.frame-size .frame-tip{position:absolute;z-index:1;top:calc(100% + 8px);left:0;width:260px;padding:10px;border-radius:10px;background:#191819;box-shadow:0 0 0 1px #ffffff1a,0 12px 40px #0008;color:#e9e6e1;font-weight:400;line-height:1.45;white-space:normal;opacity:0;visibility:hidden;transition:opacity .15s}.frame-info:is(:hover,:focus-visible)+.frame-tip{opacity:1;visibility:visible}.frame-bar [data-reason] .frame-info{color:#f3c27a}.frame-sep{height:1px;margin:4px 0;background:#ffffff0d}.frame-heading{padding:6px 8px 2px;color:#898680;font-size:10px}.frame-menu>.frame-sim{position:relative;display:grid;gap:3px;width:0;min-width:100%;height:auto;margin-top:4px;padding:8px 32px 8px 8px;text-align:left;line-height:1.3;white-space:normal}.frame-sim::before{content:"";position:absolute;top:8px;right:8px;width:14px;height:14px;box-sizing:border-box;border:1.5px solid #ffffff59;border-radius:4px;transition:background-color .15s,border-color .15s}.frame-sim[aria-checked=true]::before{border-color:var(--accent,#bda6ef);background:var(--accent,#bda6ef)}.frame-menu>.frame-sim::after{position:absolute;top:12px;right:11.5px;margin:0}.frame-menu>.frame-sim[aria-checked=true]::after{border-color:#1c1c1c}.frame-sim>b{font-weight:inherit}.frame-menu>.frame-sim>span{margin:0;font-weight:400;color:#a19d96}`,Dt=(e,t,n={},o="")=>{let i=document.createElement(e);i.className=t;for(let[r,a]of Object.entries(n))i.setAttribute(r,a);return i.textContent=o,i},pu=(e,t,n,o)=>Object.assign(e.style,{left:`${t}px`,top:`${n}px`,height:o===void 0?"":`${o}px`}),Zs=(e,t=0)=>Math.round(Math.min(mu[t][1],Math.max(mu[t][0],e)));RT=(e,t,n)=>e==="window"&&!t&&n===void 0?null:JSON.stringify({v:Nz,size:e==="window"?null:e,actual:t,...n===void 0?{}:{inPlace:n}}),HT=(e,t)=>e.map((n,o)=>Math.round(Math.min(t[o],Math.max(0,n))));Vz=(e,t,n)=>[n.left+(e.x-t.left)/t.scale-e.x,n.top+(e.y-t.top)/t.scale-e.y],fu=([e,t])=>`${Math.round(e)} \xD7 ${Math.round(t)}`});var Gz={};Ft(Gz,{accountTokens:()=>HK,relativeTime:()=>Iz});function Iz(e,t=Date.now()){let n=e-t,o=new Intl.RelativeTimeFormat(void 0,{numeric:"auto",style:"short"});for(let[i,r]of _K)if(Math.abs(n)>=r)return o.format(Math.round(n/r),i);return"just now"}function HK(e,t,n){let o=w("div","account account-tokens");o.setAttribute("role","region");let i=w("style");i.textContent=DK;let r=w("div","api-tokens-head"),a=Oe("Back to account",()=>T(),"icon api-tokens-back","chevron"),s=w("h2","","API tokens");s.id=`api-tokens-${++RK}`,s.tabIndex=-1,s.dataset.focusKey="api-tokens-title",o.setAttribute("aria-labelledby",s.id),r.append(a,s);let l=w("p","api-tokens-lede","Let bots and CI read or write comments as you. Treat tokens like passwords."),c=w("p","sr-only");c.setAttribute("role","status"),c.setAttribute("aria-live","polite");let u=w("div"),d=w("div"),p=w("div","morphing-menu__tooltip sidebar-tooltip");p.setAttribute("aria-hidden","true"),o.append(i,r,l,u,d,c,p),a.dataset.focusKey="api-tokens-back";let g=null,y=null,v=!1,x=!1,h="",m=null,b=new Map,E=C=>{c.textContent="",setTimeout(()=>c.textContent=C,30)},S=C=>{En()||C.animate([{opacity:0,transform:"translateY(4px)"},{opacity:1,transform:"none"}],{duration:250,easing:"cubic-bezier(.22,1,.36,1)"})},A=C=>requestAnimationFrame(()=>o.querySelector(`[data-focus-key="${C}"]`)?.focus()),_=C=>C instanceof to&&C.status===404?"This Palette server doesn\u2019t support API tokens.":C instanceof Error?C.message:"Something went wrong. Try again.";o.focusStart=()=>A("api-tokens-title"),o.dispose=()=>{R(),p.remove()};let T=()=>{o.dispose(),n()};o.addEventListener("keydown",C=>{if(C.key==="Escape")if(C.stopPropagation(),C.preventDefault(),h){let U=h;h="",Y(),A(`api-tokens-revoke-${U}`)}else m?A("api-tokens-done"):v?V():T()});let H=0,R=()=>{clearTimeout(H),delete p.dataset.open};o.addEventListener("pointerover",C=>{let U=C.target.closest?.("[data-tip]");if(!U)return R();clearTimeout(H),H=window.setTimeout(()=>{if(!U.isConnected)return;let I=o.getRootNode();p.parentNode!==I&&I instanceof ShadowRoot&&I.append(p);let G=U.getBoundingClientRect();p.textContent=U.dataset.tip??"";let te=p.offsetWidth/2;p.style.left=`${Math.max(8+te,Math.min(document.documentElement.clientWidth-8-te,G.left+G.width/2))}px`,p.style.top=`${G.top-8-p.offsetHeight}px`,p.dataset.open="true"},p.dataset.open?0:400)}),o.addEventListener("pointerleave",o.dispose),o.addEventListener("pointerdown",o.dispose);let z=(C,U,I)=>{let G=w("div"),te=w("dd");if(U===null)te.textContent=I;else{let ie=w("time","",Iz(U));ie.dateTime=new Date(U).toISOString(),ie.dataset.tip=Kz(U),te.append(ie,w("span","sr-only",` (${Kz(U)})`))}return G.append(w("dt","",C),te),G},F=(C,U,I)=>{let G=w("span","api-token-chip",C);return U&&(G.dataset.tone=U),I&&(G.dataset.tip=I),G},B=C=>C?C.length===1&&C[0]===t?"This project":C.length===1?C[0]:`${C.length} projects`:"All projects";function le(C){let U=w("li","api-token");U.dataset.token=C.id;let I=w("div","api-token-row"),G=w("strong","",C.name);G.id=`api-token-${C.id}-${s.id}`,U.setAttribute("aria-labelledby",G.id),I.append(G),C.expired&&I.append(F("Expired","warn"));let te=Oe(`Revoke ${C.name}`,()=>{h=C.id,b.delete(C.id),Y(),A(`api-tokens-keep-${C.id}`)},"api-token-revoke");te.textContent="Revoke",te.removeAttribute("title"),te.dataset.focusKey=`api-tokens-revoke-${C.id}`,te.disabled=h===C.id,I.append(te);let ie=w("div","api-token-chips");for(let L of C.scopes)ie.append(F(zT[L]??L,"",L));ie.append(F(B(C.projects),"",C.projects?.join(", ")??"Every project you can access"));let pe=w("dl","api-token-meta");pe.append(z("Created",C.createdAt,""),z("Last used",C.lastUsedAt,"Never"),z(C.expired?"Expired":"Expires",C.expiresAt,"Never")),U.append(I,w("code","api-token-id",`${C.prefix}\u2026${C.last4}`),ie,pe);let xe=b.get(C.id);if(xe){let L=w("p","api-tokens-error",xe);L.setAttribute("role","alert"),U.append(L)}if(h===C.id){let L=w("div","api-token-confirm");L.setAttribute("role","group"),L.setAttribute("aria-label",`Revoke ${C.name}`);let Q=w("div","api-tokens-actions"),Z=Oe("Keep token",()=>{h="",Y(),A(`api-tokens-revoke-${C.id}`)},"secondary");Z.dataset.focusKey=`api-tokens-keep-${C.id}`;let ae=Oe("Revoke token",()=>{J(C)},"secondary api-tokens-danger");ae.dataset.focusKey=`api-tokens-confirm-${C.id}`,Q.append(Z,ae),L.append(w("p","","Anything using this token stops working right away. This can\u2019t be undone."),Q),U.append(L),S(L)}return U}async function J(C){if(!g)return;let U=g,I=U.tokens.findIndex(te=>te.id===C.id);if(I<0)return;U.tokens.splice(I,1),h="",Y();let G=U.tokens[I]??U.tokens[I-1];A(G?`api-tokens-revoke-${G.id}`:"api-tokens-new");try{await e.request(`account/tokens/${encodeURIComponent(C.id)}`,"DELETE"),E(`Revoked ${C.name}.`)}catch(te){if(te instanceof to&&te.status===404){E(`Revoked ${C.name}.`);return}if(g!==U)return;U.tokens.splice(Math.min(I,U.tokens.length),0,C),b.set(C.id,`Couldn\u2019t revoke: ${_(te)}`),Y(),E(`Couldn\u2019t revoke ${C.name}.`),A(`api-tokens-revoke-${C.id}`)}}function V(){v=!1,Y(),A("api-tokens-new")}function oe(C){let U=w("form","api-tokens-sheet");U.noValidate=!0,U.setAttribute("aria-labelledby",`${s.id}-new`);let I=w("h3","","New token");I.id=`${s.id}-new`;let G=w("label","account-name-label","Name"),te=w("input");te.type="text",te.maxLength=60,te.required=!0,te.autocomplete="off",te.placeholder="e.g. Deploy bot",te.dataset.focusKey="api-tokens-name",G.append(te);let ie=(D,j,X,fe)=>{let ye=w("fieldset"),De=w("div","api-tokens-choices");for(let[Ce,Pe,Ne,Le]of fe){let Ie=w("label","api-tokens-choice",Pe),ut=w("input");ut.type=j,ut.name=X,ut.value=Ce,ut.checked=Ne,ut.dataset.focusKey=`api-tokens-${X}-${Ce}`,Le&&Ie.append(w("small","",Le)),Ie.prepend(ut),De.append(Ie)}return ye.append(w("legend","",D),De),ye},pe=ie("Access","checkbox","scope",C.scopes.map(D=>[D,zT[D]?`${zT[D]} comments`:D,D==="comments:read"])),xe=C.projects.includes(t),L=C.policy?.explicitProjects?C.projects.map(D=>[D,D===t?"This project":D,D===(xe?t:C.projects[0])]):[...xe?[["this","This project",!0]]:[],["all","All your projects",!xe]],Q=ie("Projects","radio","projects",L),Z=ie("Expires","radio","expiry",LK.filter(([,D])=>!C.policy||(D?D<=C.policy.maxLifetimeDays:C.policy.noExpiry)).map(([D,j])=>[String(j),D,j===30])),ae=w("p","api-tokens-error");ae.setAttribute("role","alert");let we=w("div","api-tokens-actions"),Te=Oe("Cancel",V,"secondary");Te.dataset.focusKey="api-tokens-cancel";let $=Oe("Create token",()=>{},"primary");return $.type="submit",$.dataset.focusKey="api-tokens-create",we.append(Te,$),U.append(I,G,pe,Q,Z,ae,we),U.addEventListener("submit",async D=>{if(D.preventDefault(),x)return;let j=[...U.querySelectorAll("input[name=scope]:checked")].map(ye=>ye.value),X=U.querySelector("input[name=expiry]:checked")?.value,fe=te.value.trim()?j.length?null:pe.querySelector("input"):te;if(ae.textContent=te.value.trim()?j.length?"":"Choose read, write, or both.":"Name your token.",fe){fe.focus();return}x=!0,$.disabled=Te.disabled=!0,$.setAttribute("aria-busy","true");try{let ye=await e.request("account/tokens","POST",{name:te.value.trim(),scopes:j,expiresInDays:X&&X!=="null"?Number(X):null,projects:C.policy?.explicitProjects?[U.querySelector("input[name=projects]:checked")?.value].filter(De=>!!De):U.querySelector("input[name=projects]:checked")?.value==="this"?[t]:[]});if(g!==C)return;C.tokens.unshift(ye.item),v=!1,m=ye,Y(),E("Token created. Copy it now. You won\u2019t see it again."),A("api-tokens-copy")}catch(ye){ae.textContent=ye instanceof to&&ye.status===429?"You\u2019ve created several tokens recently. Try again later.":_(ye),$.focus()}finally{x=!1,$.disabled=Te.disabled=!1,$.removeAttribute("aria-busy")}}),U}function ue(C){let U=w("section","api-tokens-sheet");U.setAttribute("aria-labelledby",`${s.id}-secret`);let I=w("h3","",`Copy \u201C${C.item.name}\u201D`);I.id=`${s.id}-secret`;let G=w("p","api-tokens-warning");G.append(yt("info"),w("span","","You won\u2019t see this token again. Store it in a secret manager, never in source control."));let te=w("div","api-tokens-secret"),ie=w("code","",C.token);ie.setAttribute("aria-label","New API token"),ie.tabIndex=0,ie.dataset.focusKey="api-tokens-secret";let pe=Oe("Copy token",async()=>{try{await navigator.clipboard.writeText(C.token),pe.replaceChildren(yt("check"),document.createTextNode("Copied")),E("Token copied to the clipboard.")}catch{getSelection()?.selectAllChildren(ie),E("Couldn\u2019t copy. The token is selected; copy it with your keyboard.")}},"primary");pe.replaceChildren(yt("copy"),document.createTextNode("Copy")),pe.removeAttribute("title"),pe.dataset.focusKey="api-tokens-copy",te.append(ie,pe);let xe=w("div","api-tokens-actions"),L=Oe("Done",()=>{m=null,Y(),A("api-tokens-new")},"secondary");return L.dataset.focusKey="api-tokens-done",xe.append(L),U.append(I,G,te,xe),U}let q="";function Y(){R();let C=g?m?"secret":v?"form":"list":y?"error":"loading",U=[];if(g&&C==="list"){let te=Oe("New token",()=>{v=!0,Y(),A("api-tokens-name")},"secondary");te.replaceChildren(yt("plus"),document.createTextNode("New token")),te.removeAttribute("title"),te.dataset.focusKey="api-tokens-new",U.push(te)}else g&&C==="form"?U.push(oe(g)):m&&U.push(ue(m));if(C!==q&&U[0]&&S(U[0]),q=C,u.replaceChildren(...U),d.setAttribute("aria-busy",String(!g&&!y)),!g){if(y){let te=w("p","api-tokens-error",_(y));te.setAttribute("role","alert");let ie=y instanceof to&&[403,404].includes(y.status),pe=Oe("Try again",()=>{W()},"secondary");pe.dataset.focusKey="api-tokens-retry",d.replaceChildren(te,...ie?[]:[pe])}else{let te=w("div","api-tokens-list");te.setAttribute("aria-hidden","true"),te.append(w("div","api-tokens-skeleton"),w("div","api-tokens-skeleton"));let ie=w("span","sr-only","Loading API tokens");ie.setAttribute("role","status"),d.replaceChildren(te,ie)}return}if(!g.tokens.length){let te=w("p","api-tokens-empty");te.append(w("strong","","No tokens yet"),w("span","","Create one for a bot, a script, or a CI job.")),d.replaceChildren(te);return}let I=w("ul","api-tokens-list");I.setAttribute("aria-label","Your API tokens"),I.append(...g.tokens.map(le));let G=w("p","api-tokens-note");G.append(document.createTextNode("Use a token as "),w("code","","PALETTE_TOKEN"),document.createTextNode(" with the palette CLI.")),d.replaceChildren(I,G)}async function W(){y=null,g=null,Y();try{let C=await e.request("account/tokens");if(!Array.isArray(C.tokens)||!Array.isArray(C.projects))throw new to(0,"Couldn\u2019t read your tokens. Try again.");g={...C,scopes:Array.isArray(C.scopes)?C.scopes:["comments:read","comments:write"]}}catch(C){y=C instanceof Error?C:new Error(String(C))}Y()}return W(),o}var Qy,LK,zT,_K,Kz,DK,RK,Fz=O(()=>{"use strict";Gf();It();Qy=864e5,LK=[["7 days",7],["30 days",30],["90 days",90],["1 year",365],["Never",null]],zT={"comments:read":"Read","comments:write":"Write"},_K=[["year",365*Qy],["month",30*Qy],["week",7*Qy],["day",Qy],["hour",36e5],["minute",6e4]];Kz=e=>new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(e),DK=`.account-layer .account.account-tokens{padding-top:16px;gap:16px}
98
+ Unsaved app changes${n?" and unposted Design changes":""} will be lost.`))return o("Reload cancelled.");let r=Array.from(crypto.getRandomValues(new Uint8Array(16)),a=>a.toString(16).padStart(2,"0")).join("");sessionStorage.setItem(Cz,JSON.stringify({v:1,project:e,nonce:r,origin:location.origin})),location.replace(Zy(location.href,r))}catch{return o("Storage blocked.")}setTimeout(o,3e3,"Reload cancelled.")}function SK(e,t){try{let n=e.location.href,o=Zy(n,t);n.startsWith(location.origin)&&o!==location.href&&history.replaceState(history.state,"",o)}catch{}}var Mz,Cz,_z=O(()=>{"use strict";Mz="palette-shell",Cz="palette:shell"});var zz={};Ft(zz,{frameFailure:()=>Hz,openFrameViewport:()=>AK});function Rz(e){let t=e&&e!==window?e.frameElement:null;if(!t)return null;let n=t.getBoundingClientRect(),o=n.width/(t.offsetWidth||1)||1;return{left:n.left+t.clientLeft*o,top:n.top+t.clientTop*o,scale:o}}function DT(e,t){let n=Rz(t);return n?new DOMRect(n.left+e.left*n.scale,n.top+e.top*n.scale,e.width*n.scale,e.height*n.scale):new DOMRect(e.left,e.top,e.width,e.height)}function Dz(e,t,n){let o=Rz(n);return o?{x:(e-o.left)/o.scale,y:(t-o.top)/o.scale}:{x:e,y:t}}async function Hz(e){if(new URL(e,location.href).origin!==location.origin)return"The viewport URL is on another origin, so Palette can't reach into it.";let t=w("iframe");t.hidden=!0,document.body.append(t);try{let n=await(t.contentWindow?.fetch??fetch)(e,{redirect:"manual",credentials:"include"});if(n.type==="opaqueredirect")return"The page redirected to another origin, so Palette can't reach into it.";if((n.headers.get("x-frame-options")?.toLowerCase()??"").includes("deny"))return"The page sends X-Frame-Options: DENY, which blocks a separate viewport.";let i=/frame-ancestors([^;,]*)/i.exec(n.headers.get("content-security-policy")??"")?.[1].trim();if(i!==void 0&&!/'self'|\*|https?:/.test(i))return`The page's Content-Security-Policy (frame-ancestors ${i||"'none'"}) blocks a separate viewport.`}catch{}finally{t.remove()}return"The page didn't load as a same-origin document in a separate viewport."}function AK(e){let t=w("style");t.textContent=TK;let n=w("div","frame-stage"),o=w("div","frame-port");n.dataset.loading="",o.style.background=e.background;let i=w("iframe");i.name=hM,i.dataset.paletteViewport=i.dataset.komoViewport="",i.title="Page viewport",o.append(i),n.append(o),e.parent.insertBefore(t,e.before),e.parent.insertBefore(n,e.before);let r=new AbortController,a=null,s=!1,l=d=>{s||(s=!0,clearTimeout(c),dg(null),e.failed(d))},c=window.setTimeout(()=>l(`The page took longer than ${Math.round((e.timeout??15e3)/1e3)} seconds to load in a separate viewport.`),e.timeout??15e3);function u(d,p){let g=()=>queueMicrotask(()=>!s&&e.changed());for(let v of["pushState","replaceState"]){let x=d.history[v];d.history[v]=function(...h){let m=x.apply(this,h);return g(),m}}for(let v of["popstate","hashchange","resize"])d.addEventListener(v,g,{signal:p});let y=new MutationObserver(g);y.observe(d.document.documentElement,{childList:!0,subtree:!0,characterData:!0}),p.addEventListener("abort",()=>y.disconnect(),{once:!0})}return i.addEventListener("load",()=>{if(s)return;let d=null;try{d=i.contentDocument,d&&i.contentWindow.location.origin!==location.origin&&(d=null)}catch{d=null}if(!d||d.URL==="about:blank"){if(a)return l("The page navigated to another origin, so Palette can't reach into it.");Hz(e.url).then(l);return}clearTimeout(c),a||i.contentWindow.scrollTo({top:e.scroll,behavior:"instant"}),a=d,dg(i),u(i.contentWindow,r.signal),delete n.dataset.loading,e.ready()},{signal:r.signal}),o.addEventListener("scroll",()=>e.changed(),{passive:!0,signal:r.signal}),i.src=e.url,{iframe:i,port:o,place({left:d,top:p,width:g,height:y,logical:v,scale:x,pan:h}){Object.assign(o.style,{left:`${d}px`,top:`${p}px`,width:`${g}px`,height:`${y}px`}),h||o.scrollTo(0,0),o.toggleAttribute("data-pan",h),Object.assign(i.style,{width:`${v[0]}px`,height:`${v[1]}px`,transform:x===1?"":`scale(${x})`})},destroy(){s=!0,clearTimeout(c),r.abort(),dg(null),n.remove(),t.remove()}}}var TK,Oz=O(()=>{"use strict";It();ho();yM({toScreen:DT,toView:Dz,screenRect(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView;return n===window?t:DT(t,n)},clientPoint(e){let t=e.view;if(!t||t===window)return{x:e.clientX,y:e.clientY};let n=DT({left:e.clientX,top:e.clientY,width:0,height:0},t);return{x:n.left,y:n.top}},pageElementsAt(e,t){let n=as(),o=n?.parentElement?.getBoundingClientRect();if(!n||!o||e<o.left||e>=o.right||t<o.top||t>=o.bottom)return document.elementsFromPoint(e,t);let i=Dz(e,t,n.contentWindow);return n.contentDocument.elementsFromPoint(i.x,i.y)},counterpart(e,t){if(e.ownerDocument===t)return e;let n=[];for(let o=e;o&&o!==o.ownerDocument.documentElement;o=o.parentElement){if(o.id||o===o.ownerDocument.body){n.unshift(o.id?`#${CSS.escape(o.id)}`:"body");break}n.unshift(`${o.localName}:nth-child(${[...o.parentElement.children].indexOf(o)+1})`)}try{return n.length?t.querySelector(n.join(">")):t.documentElement}catch{return null}}});TK=".frame-stage{position:fixed;inset:0;z-index:0;background:#080808;pointer-events:auto}.frame-port{position:absolute;overflow:clip;border-radius:12px;overscroll-behavior:contain}.frame-port[data-pan]{overflow:auto;scrollbar-width:thin;scrollbar-color:#5a5a5a transparent}.frame-stage[data-loading]{visibility:hidden;pointer-events:none}.frame-port iframe{display:block;border:0;transform-origin:0 0;color-scheme:normal}"});var Uz={};Ft(Uz,{FRAME_PRESETS:()=>$z,anchoredPan:()=>Vz,clampPan:()=>HT,frameSizeRecord:()=>RT,mountFrameSize:()=>CK,readFrameSize:()=>jz,scrollsFirst:()=>Bz,wheelTravel:()=>Pz});function jz(e){try{let t=JSON.parse(e??"null");return t?.v!==Nz?{size:"window",actual:!1}:{size:t.size==="available"?"available":Array.isArray(t.size)&&t.size.length===2&&t.size.every(Number.isFinite)?[Zs(t.size[0]),Zs(t.size[1],1)]:"window",actual:t.actual===!0,...typeof t.inPlace=="boolean"?{inPlace:t.inPlace}:{}}}catch{return{size:"window",actual:!1}}}function Pz(e,t){let n=i=>e.deltaMode===1?16:e.deltaMode===2?t[i]:1,o=[e.deltaX*n(0),e.deltaY*n(1)];return e.shiftKey&&!o[0]?[o[1],0]:o}function Bz(e,t,n){let o=(i,r,a,s,l)=>!!r&&/auto|scroll|overlay/.test(i)&&s>l+1&&(r>0?a+l<s-1:a>0);for(let i=e?.nodeType===1?e:e?.parentElement;i&&i!==i.ownerDocument.body&&i!==i.ownerDocument.documentElement;i=i.parentElement??i.getRootNode().host){let r=getComputedStyle(i);if(o(r.overflowX,t,i.scrollLeft,i.scrollWidth,i.clientWidth)||o(r.overflowY,n,i.scrollTop,i.scrollHeight,i.clientHeight))return!0}return!1}function CK(e,t,n,o,i,r=!1,a={}){let s=null;try{s=localStorage.getItem(n)}catch{}let l=jz(s),{size:c,actual:u}=l,d=l.inPlace!==void 0,p=!!r&&(d?!l.inPlace:r==="iframe"),g={active:!1},y,v=()=>r?d?!p:void 0:l.inPlace,x=()=>{try{let K=RT(c,u,v());K?localStorage.setItem(n,K):zo(localStorage,n)}catch{}};s!==null&&s!==RT(c,u,v())&&x();let h=[0,0],m=[0,0],b=null,E=(K,ce,_e=!0,et=p)=>{if(ce&&!u&&y&&Le&&!g.active){let gt=a.anchor?.()??b??{x:y.left+y.width*y.scale/2,y:y.top+y.height*y.scale/2};h=Vz(gt,y,{left:Le.left/Ie,top:Le.top/Ie})}else ce||(h=[0,0]);c=K,u=ce;let Ve=et!==p||et&&!!g.reason&&!g.active;p=et,o(Ve),_e&&x()},S=Dt("div","frame-size"),A=Dt("style","",{},MK),_=Dt("div","frame-bar",{role:"toolbar","aria-label":"Frame size"}),T=Dt("button","frame-size-trigger",{type:"button","aria-haspopup":"menu","aria-expanded":"false"}),H=Dt("span","frame-name"),R=Dt("span",""),z=Dt("span","frame-scale");T.append(H,R,Dt("span","frame-at",{},"\xB7"),z);let F=Dt("span","frame-note",{hidden:""}),B=Dt("button","frame-info",{type:"button"}),le=Dt("span","frame-tip",{role:"tooltip","aria-hidden":"true"}),J=`Uses window size.${r?" Use Simulate real viewport.":""}`,V=Dt("span","frame-loading",{role:"status"});F.append(V,B,le),_.append(T,F);let oe=Dt("div","frame-menu",{role:"menu","aria-label":"Frame size",hidden:""}),ue=[["Desktop","Your window","window"],["Available","Available space","available"],...$z.map(([K,ce,_e])=>[K,`${K} ${ce}`,[ce,_e]])],q=[],Y=ue.map(([,K,ce])=>{let _e=Dt("button","",{type:"button",role:"menuitemradio"}),et=Dt("span","",{},typeof ce=="string"?"":fu(ce));return q.push(et),_e.append(K,et),_e.addEventListener("click",()=>{Ye(),E(ce,u)}),_e}),W=Dt("form","frame-custom",{"aria-label":"Custom size"}),C=["Width","Height"].map((K,ce)=>Dt("input","",{"aria-label":K,inputmode:"numeric",type:"number",min:String(mu[ce][0]),max:String(mu[ce][1]),required:""}));W.append(C[0],"\xD7",C[1],Dt("button","",{type:"submit"},"Set")),W.addEventListener("submit",K=>{K.preventDefault(),Ye(),E([Zs(+C[0].value),Zs(+C[1].value,1)],u)});let U=["1","0"].map(K=>({key:K,shift:!0,alt:!1,ctrl:!1,meta:!1,label:`Shift+${K}`})),I=["Fit","100%"].map((K,ce)=>{let _e=Dt("button","",{type:"button",role:"menuitemradio","aria-keyshortcuts":U[ce].label},K),et=Dt("span","palette-kbd",{"aria-hidden":"true","data-variant":"surface"});for(let Ve of[/mac|iphone|ipad/i.test(navigator.platform)?"\u21E7":"Shift",U[ce].key])et.append(Dt("kbd","",{},Ve));return _e.append(et),_e.addEventListener("click",()=>{Ye(),ot(!!ce)}),_e}),G=()=>Dt("div","frame-sep",{role:"separator"});oe.append(...Y,W,G(),Dt("div","frame-heading",{"aria-hidden":"true"},"Zoom"),...I);let te=Dt("button","frame-sim",{type:"button",role:"menuitemcheckbox","aria-labelledby":"frame-sim-label","aria-describedby":"frame-sim-hint"});te.append(Dt("b","",{id:"frame-sim-label"},"Simulate real viewport"),Dt("span","",{id:"frame-sim-hint"},a.shell?"Reloads this page inside a frame so breakpoints and popovers match this size.":"Reloads the page in a frame so breakpoints and popovers match this size. Runs a second copy of the app.")),r&&oe.append(G(),te);let ie=Dt("div","frame-handle",{role:"slider",tabindex:"0","aria-label":"Frame width","aria-orientation":"horizontal","aria-valuemin":String(mu[0][0]),"aria-valuemax":String(mu[0][1])}),pe=Dt("div","frame-corner",{role:"button",tabindex:"0","aria-label":"Frame size: arrow keys change width and height"}),xe=Dt("div","frame-readout",{hidden:"",role:"status"}),L=`${n}:scaled-tip`,Q=Dt("div","frame-hint",{role:"note",hidden:""}),Z=Dt("button","",{type:"button"},"Use 100%"),se=Dt("button","frame-hint-close",{type:"button","aria-label":"Dismiss tip"},"\xD7");Q.append(Dt("span","",{},"Some floating UI may be offset while scaled. Use 100% to check exact positions."),Z,se);let we=!1;try{we=localStorage.getItem(L)==="1"}catch{}let Te=()=>{we=!0,Q.hidden=!0;try{localStorage.setItem(L,"1")}catch{}};S.append(_,oe,Q,ie,pe,xe),e.append(A,S);let $=1,D=e.host,j=()=>!!y?.pan&&!S.hidden&&!g.active,X=()=>!!y?.pan&&!S.hidden,fe=(K,ce)=>{let _e=HT([K,ce],m);_e[0]===h[0]&&_e[1]===h[1]||(h=_e,a.pan?.())},ye=(K,ce)=>fe(h[0]+K/$,h[1]+ce/$),De=["x","y"].map(K=>{let ce=Dt("div","frame-scroll",{"data-axis":K,role:"scrollbar",tabindex:"0",hidden:"","aria-orientation":K==="x"?"horizontal":"vertical","aria-label":`Pan the frame ${K==="x"?"horizontally":"vertically"}: arrow, Page and Home/End keys`,"aria-valuemin":"0"}),_e=Dt("div","frame-thumb");return ce.append(_e),{axis:K,track:ce,thumb:_e,length:0,thumbLength:0}}),Ce=Dt("div","frame-hand",{hidden:"","aria-hidden":"true"}),Pe=null,Ne=!1;S.append(Ce,...De.map(K=>K.track));let Le=null,Ie=1,ut=0,ct=null,de=0,Ae=()=>[y?.width??0,y?.height??0],ve=(K,ce)=>{clearTimeout(ut),xe.textContent=fu(K),xe.hidden=!1,ct=K,ce?(cancelAnimationFrame(de),de=0,E(K,u),ut=window.setTimeout(()=>xe.hidden=!0,900)):de||=requestAnimationFrame(()=>{de=0,ct&&E(ct,u,!1)})},Re=!1,Fe=()=>Q.hidden=we||!Re||!oe.hidden;function Ye(){oe.hidden=!0,T.setAttribute("aria-expanded","false"),Fe()}T.addEventListener("click",()=>{let K=oe.hidden;oe.hidden=!K,Fe(),T.setAttribute("aria-expanded",String(K)),K&&(C.forEach((ce,_e)=>ce.value=String(Math.round(Ae()[_e]))),(Y.find(ce=>ce.getAttribute("aria-checked")==="true")??Y[0]).focus())}),oe.addEventListener("keydown",K=>{K.key==="Escape"&&(K.stopPropagation(),Ye(),T.focus())});let $e=new AbortController;document.addEventListener("pointerdown",K=>{!oe.hidden&&!K.composedPath().some(ce=>ce===oe||ce===T)&&Ye()},{capture:!0,signal:$e.signal});function ot(K){K&&Te(),E(c,K)}te.addEventListener("click",()=>{d=!0,E(c,u,!0,!p),te.setAttribute("aria-checked",String(p))}),Z.addEventListener("click",()=>ot(!0));let rn=U.map(({key:K})=>Object.values(a.shortcuts??{}).some(ce=>!!ce?.shift&&!ce.alt&&!ce.ctrl&&!ce.meta&&ce.key===K)),Zt=K=>{let ce=["Digit1","Digit0"].indexOf(K.code);if(ce<0||rn[ce]||S.hidden||!K.shiftKey||K.altKey||K.ctrlKey||K.metaKey||K.defaultPrevented||K.isComposing)return;let _e=document.activeElement;for(;_e?.shadowRoot?.activeElement;)_e=_e.shadowRoot.activeElement;let et=a.textEntry??Ht;et(K.composedPath()[0])||_e?.localName!=="iframe"&&et(_e??void 0)||(K.preventDefault(),ot(!!ce))};window.addEventListener("keydown",Zt,{signal:$e.signal}),a.onFrame?.("keydown",Zt,{signal:$e.signal},"window"),se.addEventListener("click",Te);let Ht=K=>!!K?.isContentEditable||!!K?.matches?.("input,textarea,select");window.addEventListener("wheel",K=>{if(!j()||K.ctrlKey||K.defaultPrevented)return;let ce=K.composedPath();if(ce.includes(D)&&!De.some(Ve=>ce.includes(Ve.track))&&!ce.includes(Ce))return;let[_e,et]=Pz(K,[Le?.width??innerWidth,Le?.height??innerHeight]);!ce.includes(D)&&Bz(ce[0],_e,et)||(K.preventDefault(),ye(_e,et))},{capture:!0,passive:!1,signal:$e.signal}),document.addEventListener("pointermove",K=>{if(!Le||K.pointerType==="touch"||K.composedPath().includes(S))return;b=K.clientX>=Le.left&&K.clientX<=Le.left+Le.width&&K.clientY>=Le.top&&K.clientY<=Le.top+Le.height?{x:K.clientX/Ie,y:K.clientY/Ie}:b},{capture:!0,passive:!0,signal:$e.signal});let pt=()=>{Ne=!1,Pe||(Ce.hidden=!0)},Qt=(K,ce)=>{window.addEventListener(K,ce,{capture:!0,signal:$e.signal}),a.onFrame?.(K,ce,{capture:!0,signal:$e.signal},"window")};Qt("keydown",K=>{if(K.key!==" "||K.ctrlKey||K.metaKey||K.altKey)return;if(!Ce.hidden){K.preventDefault(),K.stopPropagation();return}let ce=K.composedPath();!X()||K.repeat||ce.includes(D)||Ht(ce[0])||(K.preventDefault(),K.stopPropagation(),Ne=!0,Ce.hidden=!1)}),Qt("keyup",K=>{K.key!==" "||Ce.hidden||(K.preventDefault(),K.stopPropagation(),pt())}),window.addEventListener("blur",pt,{signal:$e.signal}),a.onFrame?.("blur",()=>setTimeout(()=>document.hasFocus()||pt()),{signal:$e.signal},"window"),Ce.addEventListener("pointerdown",K=>{if(K.button)return;K.preventDefault(),Ce.setPointerCapture(K.pointerId),Ce.dataset.grabbing="";let ce=g.active?t():null;Pe={x:K.clientX,y:K.clientY,pan:ce?[ce.scrollLeft,ce.scrollTop]:h,id:K.pointerId,port:ce}}),Ce.addEventListener("pointermove",K=>{if(Pe?.id!==K.pointerId)return;let[ce,_e]=[K.clientX-Pe.x,K.clientY-Pe.y];Pe.port?Pe.port.scrollTo(Pe.pan[0]-ce,Pe.pan[1]-_e):fe(Pe.pan[0]-ce/$,Pe.pan[1]-_e/$)});let Mn=()=>{Pe=null,delete Ce.dataset.grabbing,Ne||(Ce.hidden=!0)};Ce.addEventListener("pointerup",Mn),Ce.addEventListener("pointercancel",Mn);for(let K of De){let ce=K.axis==="x"?0:1,_e=null;K.track.addEventListener("pointerdown",Ve=>{if(Ve.button)return;Ve.preventDefault(),K.track.focus({preventScroll:!0});let gt=ce?Ve.clientY:Ve.clientX;if(Ve.target!==K.thumb){let Ct=K.thumb.getBoundingClientRect(),ht=(ce?Le?.height:Le?.width)??0,Gt=gt<(ce?Ct.top:Ct.left);ce?ye(0,Gt?-ht*.9:ht*.9):ye(Gt?-ht*.9:ht*.9,0);return}K.track.setPointerCapture(Ve.pointerId),K.thumb.dataset.active="",_e={start:gt,pan:h[ce],id:Ve.pointerId}}),K.track.addEventListener("pointermove",Ve=>{if(_e?.id!==Ve.pointerId)return;let gt=((ce?Ve.clientY:Ve.clientX)-_e.start)*m[ce]/Math.max(1,K.length-K.thumbLength);ce?fe(h[0],_e.pan+gt):fe(_e.pan+gt,h[1])});let et=()=>{_e=null,delete K.thumb.dataset.active};K.track.addEventListener("pointerup",et),K.track.addEventListener("pointercancel",et),K.track.addEventListener("keydown",Ve=>{let gt=[Le?.width??0,Le?.height??0].map(ht=>ht*.9/Ie),Ct={ArrowLeft:[-40,0],ArrowRight:[40,0],ArrowUp:[0,-40],ArrowDown:[0,40],PageUp:[0,-gt[1]],PageDown:[0,gt[1]]}[Ve.key];if(Ve.key==="Home"||Ve.key==="End"){Ve.preventDefault();let ht=Ve.key==="End"?1e9:0;Ve.shiftKey||ce===0?fe(ht,h[1]):fe(h[0],ht);return}Ct&&(Ve.preventDefault(),fe(h[0]+Ct[0],h[1]+Ct[1]))})}document.addEventListener("focusin",K=>{let ce=K.composedPath()[0];if(!j()||!Le||!t().contains(ce)||!ce.getBoundingClientRect)return;let _e=ce.getBoundingClientRect(),et=(Ct,ht,Gt,wt)=>Ct<Gt?Ct-Gt-24:Ct+ht>Gt+wt?Math.min(Ct-Gt-24,Ct+ht-Gt-wt+24):0,Ve=et(_e.left,_e.width,Le.left,Le.width),gt=et(_e.top,_e.height,Le.top,Le.height);(Ve||gt)&&ye(Ve,gt)},{capture:!0,signal:$e.signal}),document.addEventListener("mousedown",K=>{let ce=K.composedPath()[0];!j()||ce!==document.documentElement&&ce!==document.body||(K.preventDefault(),(De[1].track.hidden?De[0]:De[1]).track.focus({preventScroll:!0}))},{capture:!0,signal:$e.signal});for(let[K,ce]of[[ie,!1],[pe,!0]]){let _e=null;K.addEventListener("pointerdown",Ve=>{Ve.button||(Ve.preventDefault(),K.setPointerCapture(Ve.pointerId),K.dataset.active="",_e={x:Ve.clientX,y:Ve.clientY,size:Ae(),ratio:$})}),K.addEventListener("pointermove",Ve=>{_e&&ve([Zs(_e.size[0]+(Ve.clientX-_e.x)/_e.ratio),ce?Zs(_e.size[1]+(Ve.clientY-_e.y)/_e.ratio,1):Math.round(_e.size[1])],!1)});let et=()=>{_e&&(_e=null,delete K.dataset.active,ve(ct??Ae(),!0))};K.addEventListener("pointerup",et),K.addEventListener("pointercancel",et),K.addEventListener("keydown",Ve=>{let gt=Ve.shiftKey?100:10,Ct={ArrowRight:[gt,0],ArrowLeft:[-gt,0],...ce?{ArrowDown:[0,gt],ArrowUp:[0,-gt]}:{}}[Ve.key];if(!Ct)return;Ve.preventDefault(),Ve.stopPropagation();let[ht,Gt]=Ae();ve([Zs(ht+Ct[0]),Zs(Gt+Ct[1],1)],!0)})}return{view(K,ce){let _e=i(K,c==="window"?ce:c==="available"?[K.width,K.height]:c,u);m=_e.pan?[Math.max(0,_e.width*_e.scale-K.width),Math.max(0,_e.height*_e.scale-K.height)]:[0,0],h=HT(h,m);let et=g.active?[0,0]:h;return y={..._e,left:_e.left-et[0],top:_e.top-et[1]}},sized:c!=="window"||u,get separate(){return p},status(K){g=K,y&&this.update(Le,Ie)},update(K,ce=1){Le=K,Ie=ce;let _e=y??=K&&i({left:K.left/ce,top:K.top/ce,width:K.width/ce,height:K.height/ce},[innerWidth/ce,innerHeight/ce],!1);if(S.hidden=!K||!_e,!K||!_e)return Ye();$=_e.scale*ce;let et=t(),Ve=et.getBoundingClientRect();g.active||(et.style.clipPath=_e.pan?`inset(${[K.top-Ve.top,Ve.right-K.left-K.width,Ve.bottom-K.top-K.height,K.left-Ve.left].map(wt=>`${Math.max(0,wt)/ce}px`).join(" ")} round ${12/ce}px)`:et.style.clipPath);let gt=ue.findIndex(([,,wt])=>typeof wt=="string"||typeof c=="string"?wt===c:wt[0]===c[0]&&wt[1]===c[1]),Ct=gt<0?"":ue[gt][0];H.textContent=Ct,H.hidden=!Ct,R.textContent=fu(Ae()),z.textContent=`${Math.round(_e.scale*100)}%`,T.setAttribute("aria-label",`${Ct} ${R.textContent} \xB7 ${z.textContent}`.trim()),q[0].textContent=fu([innerWidth/ce,innerHeight/ce]),q[1].textContent=fu([K.width/ce,K.height/ce]),Y.forEach((wt,jn)=>wt.setAttribute("aria-checked",String(jn===gt))),I.forEach((wt,jn)=>wt.setAttribute("aria-checked",String(!!jn===u))),te.setAttribute("aria-checked",String(p));let ht=p&&!g.active&&!g.loading&&!!g.reason;le.textContent=ht?`${g.reason} Using current page.`:J,B.setAttribute("aria-label",ht?"Why the simulated viewport is unavailable":"Viewport layout"),B.setAttribute("aria-description",le.textContent),F.toggleAttribute("data-reason",ht),V.textContent=g.loading?"Loading\u2026":"",B.hidden=!!g.loading,F.hidden=g.active||!ht&&!g.loading&&Math.abs(_e.width-innerWidth/ce)<1,ie.setAttribute("aria-valuenow",String(Math.round(_e.width))),ie.setAttribute("aria-valuetext",`${fu(Ae())} pixels`);let Gt=Math.max(8,K.top-40);pu(_,K.left,Gt),_.style.width=`${K.width}px`,pu(oe,K.left,Gt+34),Re=_e.scale<=.999&&!g.active,Fe(),Q.style.maxWidth=`${K.width-24}px`,pu(Q,K.left+12,K.top+K.height-12-(Q.offsetHeight||38)),ie.hidden=pe.hidden=_e.pan,pu(ie,Ve.right,Ve.top,Ve.height),pu(pe,Ve.right,Ve.bottom),pu(xe,Math.max(Ve.left+8,Ve.right-120),Ve.bottom-36);for(let wt of De){let jn=wt.axis==="x"?0:1,Ze=(jn?K.height:K.width)-12,Et=m[jn]*ce;if(wt.track.hidden=!_e.pan||Et<1||g.active,wt.track.hidden)continue;wt.length=Ze,wt.thumbLength=Math.max(32,Ze*Ze/(Ze+Et));let Pn=(Ze-wt.thumbLength)*h[jn]/(m[jn]||1);Object.assign(wt.track.style,jn?{left:`${K.left+K.width-12}px`,top:`${K.top}px`,width:"",height:`${Ze}px`}:{left:`${K.left}px`,top:`${K.top+K.height-12}px`,width:`${Ze}px`,height:""}),Object.assign(wt.thumb.style,jn?{top:`${Pn}px`,height:`${wt.thumbLength}px`,left:"",width:""}:{left:`${Pn}px`,width:`${wt.thumbLength}px`,top:"",height:""}),wt.track.setAttribute("aria-valuemax",String(Math.round(m[jn]))),wt.track.setAttribute("aria-valuenow",String(Math.round(h[jn])))}_e.pan||pt(),Object.assign(Ce.style,{left:`${K.left}px`,top:`${K.top}px`,width:`${K.width}px`,height:`${K.height}px`})},destroy(){clearTimeout(ut),cancelAnimationFrame(de),$e.abort(),A.remove(),S.remove()}}}var $z,mu,Nz,MK,Dt,pu,Zs,RT,HT,Vz,fu,qz=O(()=>{"use strict";Yu();$z=[["Wide",1440,900],["Laptop",1280,800],["Tablet",768,1024],["Mobile",390,844]],mu=[[240,3840],[240,2160]],Nz=2,MK=`.frame-size{position:fixed;inset:0;pointer-events:none;z-index:3;font-size:12px;font-weight:500;line-height:1;color:#d6d3ce}.frame-size>*{pointer-events:auto;position:fixed}.frame-size [hidden]{display:none}.frame-bar,.frame-custom{display:flex;align-items:center;gap:6px}.frame-size button,.frame-size input,.frame-menu{font:inherit;color:inherit;background:#1c1c1c;border:1px solid #ffffff14;border-radius:8px;height:28px;padding:0 10px;cursor:pointer}.frame-size button:hover{background:#262626}.frame-size :focus-visible{outline:2px solid var(--accent,#bda6ef);outline-offset:1px}.frame-size [aria-checked=true]{background:#ffffff1f;color:#f1efeb}.frame-menu{display:grid;height:auto;min-width:200px;padding:4px;border:0;border-radius:10px;background:#232323;box-shadow:0 0 0 1px #ffffff14,0 12px 32px #0008;font-size:11px;cursor:auto}.frame-menu>button{display:flex;gap:12px;padding:0 8px;border:0;background:none}.frame-menu>button>span{margin-left:auto}.frame-menu>button::after{content:"";width:7px;height:3.5px;align-self:center;margin:-3px 3px 0 0;border:solid #0000;border-width:0 0 1.5px 1.5px;rotate:-45deg}.frame-menu>[aria-checked=true]::after{border-color:#bda6ef}.frame-size .frame-menu>[aria-checked=true]{background:none}.frame-size span,.frame-readout,.frame-custom{color:#898680;font-variant-numeric:tabular-nums}.frame-custom{gap:4px;padding:4px 4px 2px;border-top:1px solid #ffffff0d}.frame-custom input{width:64px;padding:0 6px;cursor:text}.frame-handle{width:10px;margin-left:-5px;cursor:ew-resize;touch-action:none}.frame-corner{width:18px;height:18px;margin:-9px 0 0 -9px;cursor:nwse-resize;touch-action:none}.frame-handle::after,.frame-corner::after{content:'';position:absolute;left:3px;top:calc(50% - 20px);width:4px;height:40px;border-radius:2px;background:#ffffff40}.frame-corner::after{inset:4px;width:auto;height:auto;background:none;border:solid #ffffff59;border-width:0 2px 2px 0;border-radius:0 0 4px 0}.frame-handle:hover::after,.frame-handle[data-active]::after{background:var(--accent,#bda6ef)}.frame-corner:hover::after,.frame-corner[data-active]::after{border-color:var(--accent,#bda6ef)}.frame-readout{padding:5px 8px;border-radius:6px;background:#1c1c1cf2;color:#f1efeb}.frame-scroll{box-sizing:border-box;touch-action:none}.frame-scroll[data-axis=y]{width:12px}.frame-scroll[data-axis=x]{height:12px}.frame-thumb{position:absolute;border-radius:4px;background:#2a2a2ad9;box-shadow:0 0 0 1px #ffffff2e}.frame-scroll[data-axis=y] .frame-thumb{left:3px;right:3px}.frame-scroll[data-axis=x] .frame-thumb{top:3px;bottom:3px}.frame-scroll:hover .frame-thumb,.frame-scroll:focus-visible .frame-thumb,.frame-thumb[data-active]{background:#3a3a3af2;box-shadow:0 0 0 1px #ffffff59}.frame-hand{cursor:grab;touch-action:none}.frame-hand[data-grabbing]{cursor:grabbing}.frame-hint{display:flex;align-items:center;gap:8px;box-sizing:border-box;padding:4px 4px 4px 12px;border:1px solid #ffffff14;border-radius:10px;background:#1c1c1cf2;box-shadow:0 8px 24px #0006;line-height:1.35}.frame-hint span{color:#d6d3ce}.frame-size .frame-hint-close{width:28px;padding:0;border:0;background:none;color:#898680;font-size:16px}.frame-bar{gap:2px;white-space:nowrap;pointer-events:none;container-type:inline-size}.frame-bar>*{flex:none;pointer-events:auto}.frame-size .frame-size-trigger{display:flex;align-items:center;gap:0;padding-right:9px;font-variant-numeric:tabular-nums}.frame-name{margin-right:4px}.frame-at{margin:0 4px}.frame-size-trigger span{color:inherit}.frame-size-trigger::after{content:"";width:5px;height:5px;margin:-3px 0 0 9px;border:solid;border-width:0 1.5px 1.5px 0;rotate:45deg;opacity:.6}@container (max-width:240px){.frame-name,.frame-at,.frame-scale{display:none}}.frame-note{position:relative;display:flex;align-items:center}.frame-loading:not(:empty){padding:0 6px}.frame-bar .frame-info{flex:none;width:22px;height:22px;padding:0;border:0;border-radius:6px;background:none;color:#898680}.frame-bar .frame-info:hover{background:#ffffff12;color:#f1efeb}.frame-info::before{content:"i";display:inline-grid;place-items:center;width:12px;height:12px;border:1.2px solid;border-radius:50%;font:italic 600 9px/1 Georgia,serif}.frame-size .frame-tip{position:absolute;z-index:1;top:calc(100% + 8px);left:0;width:260px;padding:10px;border-radius:10px;background:#191819;box-shadow:0 0 0 1px #ffffff1a,0 12px 40px #0008;color:#e9e6e1;font-weight:400;line-height:1.45;white-space:normal;opacity:0;visibility:hidden;transition:opacity .15s}.frame-info:is(:hover,:focus-visible)+.frame-tip{opacity:1;visibility:visible}.frame-bar [data-reason] .frame-info{color:#f3c27a}.frame-sep{height:1px;margin:4px 0;background:#ffffff0d}.frame-heading{padding:6px 8px 2px;color:#898680;font-size:10px}.frame-menu>.frame-sim{position:relative;display:grid;gap:3px;width:0;min-width:100%;height:auto;margin-top:4px;padding:8px 32px 8px 8px;text-align:left;line-height:1.3;white-space:normal}.frame-sim::before{content:"";position:absolute;top:8px;right:8px;width:14px;height:14px;box-sizing:border-box;border:1.5px solid #ffffff59;border-radius:4px;transition:background-color .15s,border-color .15s}.frame-sim[aria-checked=true]::before{border-color:var(--accent,#bda6ef);background:var(--accent,#bda6ef)}.frame-menu>.frame-sim::after{position:absolute;top:12px;right:11.5px;margin:0}.frame-menu>.frame-sim[aria-checked=true]::after{border-color:#1c1c1c}.frame-sim>b{font-weight:inherit}.frame-menu>.frame-sim>span{margin:0;font-weight:400;color:#a19d96}`,Dt=(e,t,n={},o="")=>{let i=document.createElement(e);i.className=t;for(let[r,a]of Object.entries(n))i.setAttribute(r,a);return i.textContent=o,i},pu=(e,t,n,o)=>Object.assign(e.style,{left:`${t}px`,top:`${n}px`,height:o===void 0?"":`${o}px`}),Zs=(e,t=0)=>Math.round(Math.min(mu[t][1],Math.max(mu[t][0],e)));RT=(e,t,n)=>e==="window"&&!t&&n===void 0?null:JSON.stringify({v:Nz,size:e==="window"?null:e,actual:t,...n===void 0?{}:{inPlace:n}}),HT=(e,t)=>e.map((n,o)=>Math.round(Math.min(t[o],Math.max(0,n))));Vz=(e,t,n)=>[n.left+(e.x-t.left)/t.scale-e.x,n.top+(e.y-t.top)/t.scale-e.y],fu=([e,t])=>`${Math.round(e)} \xD7 ${Math.round(t)}`});var Gz={};Ft(Gz,{accountTokens:()=>HK,relativeTime:()=>Iz});function Iz(e,t=Date.now()){let n=e-t,o=new Intl.RelativeTimeFormat(void 0,{numeric:"auto",style:"short"});for(let[i,r]of _K)if(Math.abs(n)>=r)return o.format(Math.round(n/r),i);return"just now"}function HK(e,t,n){let o=w("div","account account-tokens");o.setAttribute("role","region");let i=w("style");i.textContent=DK;let r=w("div","api-tokens-head"),a=Oe("Back to account",()=>T(),"icon api-tokens-back","chevron"),s=w("h2","","API tokens");s.id=`api-tokens-${++RK}`,s.tabIndex=-1,s.dataset.focusKey="api-tokens-title",o.setAttribute("aria-labelledby",s.id),r.append(a,s);let l=w("p","api-tokens-lede","Let bots and CI read or write comments as you. Treat tokens like passwords."),c=w("p","sr-only");c.setAttribute("role","status"),c.setAttribute("aria-live","polite");let u=w("div"),d=w("div"),p=w("div","morphing-menu__tooltip sidebar-tooltip");p.setAttribute("aria-hidden","true"),o.append(i,r,l,u,d,c,p),a.dataset.focusKey="api-tokens-back";let g=null,y=null,v=!1,x=!1,h="",m=null,b=new Map,E=C=>{c.textContent="",setTimeout(()=>c.textContent=C,30)},S=C=>{En()||C.animate([{opacity:0,transform:"translateY(4px)"},{opacity:1,transform:"none"}],{duration:250,easing:"cubic-bezier(.22,1,.36,1)"})},A=C=>requestAnimationFrame(()=>o.querySelector(`[data-focus-key="${C}"]`)?.focus()),_=C=>C instanceof to&&C.status===404?"This Palette server doesn\u2019t support API tokens.":C instanceof Error?C.message:"Something went wrong. Try again.";o.focusStart=()=>A("api-tokens-title"),o.dispose=()=>{R(),p.remove()};let T=()=>{o.dispose(),n()};o.addEventListener("keydown",C=>{if(C.key==="Escape")if(C.stopPropagation(),C.preventDefault(),h){let U=h;h="",Y(),A(`api-tokens-revoke-${U}`)}else m?A("api-tokens-done"):v?V():T()});let H=0,R=()=>{clearTimeout(H),delete p.dataset.open};o.addEventListener("pointerover",C=>{let U=C.target.closest?.("[data-tip]");if(!U)return R();clearTimeout(H),H=window.setTimeout(()=>{if(!U.isConnected)return;let I=o.getRootNode();p.parentNode!==I&&I instanceof ShadowRoot&&I.append(p);let G=U.getBoundingClientRect();p.textContent=U.dataset.tip??"";let te=p.offsetWidth/2;p.style.left=`${Math.max(8+te,Math.min(document.documentElement.clientWidth-8-te,G.left+G.width/2))}px`,p.style.top=`${G.top-8-p.offsetHeight}px`,p.dataset.open="true"},p.dataset.open?0:400)}),o.addEventListener("pointerleave",o.dispose),o.addEventListener("pointerdown",o.dispose);let z=(C,U,I)=>{let G=w("div"),te=w("dd");if(U===null)te.textContent=I;else{let ie=w("time","",Iz(U));ie.dateTime=new Date(U).toISOString(),ie.dataset.tip=Kz(U),te.append(ie,w("span","sr-only",` (${Kz(U)})`))}return G.append(w("dt","",C),te),G},F=(C,U,I)=>{let G=w("span","api-token-chip",C);return U&&(G.dataset.tone=U),I&&(G.dataset.tip=I),G},B=C=>C?C.length===1&&C[0]===t?"This project":C.length===1?C[0]:`${C.length} projects`:"All projects";function le(C){let U=w("li","api-token");U.dataset.token=C.id;let I=w("div","api-token-row"),G=w("strong","",C.name);G.id=`api-token-${C.id}-${s.id}`,U.setAttribute("aria-labelledby",G.id),I.append(G),C.expired&&I.append(F("Expired","warn"));let te=Oe(`Revoke ${C.name}`,()=>{h=C.id,b.delete(C.id),Y(),A(`api-tokens-keep-${C.id}`)},"api-token-revoke");te.textContent="Revoke",te.removeAttribute("title"),te.dataset.focusKey=`api-tokens-revoke-${C.id}`,te.disabled=h===C.id,I.append(te);let ie=w("div","api-token-chips");for(let L of C.scopes)ie.append(F(zT[L]??L,"",L));ie.append(F(B(C.projects),"",C.projects?.join(", ")??"Every project you can access"));let pe=w("dl","api-token-meta");pe.append(z("Created",C.createdAt,""),z("Last used",C.lastUsedAt,"Never"),z(C.expired?"Expired":"Expires",C.expiresAt,"Never")),U.append(I,w("code","api-token-id",`${C.prefix}\u2026${C.last4}`),ie,pe);let xe=b.get(C.id);if(xe){let L=w("p","api-tokens-error",xe);L.setAttribute("role","alert"),U.append(L)}if(h===C.id){let L=w("div","api-token-confirm");L.setAttribute("role","group"),L.setAttribute("aria-label",`Revoke ${C.name}`);let Q=w("div","api-tokens-actions"),Z=Oe("Keep token",()=>{h="",Y(),A(`api-tokens-revoke-${C.id}`)},"secondary");Z.dataset.focusKey=`api-tokens-keep-${C.id}`;let se=Oe("Revoke token",()=>{J(C)},"secondary api-tokens-danger");se.dataset.focusKey=`api-tokens-confirm-${C.id}`,Q.append(Z,se),L.append(w("p","","Anything using this token stops working right away. This can\u2019t be undone."),Q),U.append(L),S(L)}return U}async function J(C){if(!g)return;let U=g,I=U.tokens.findIndex(te=>te.id===C.id);if(I<0)return;U.tokens.splice(I,1),h="",Y();let G=U.tokens[I]??U.tokens[I-1];A(G?`api-tokens-revoke-${G.id}`:"api-tokens-new");try{await e.request(`account/tokens/${encodeURIComponent(C.id)}`,"DELETE"),E(`Revoked ${C.name}.`)}catch(te){if(te instanceof to&&te.status===404){E(`Revoked ${C.name}.`);return}if(g!==U)return;U.tokens.splice(Math.min(I,U.tokens.length),0,C),b.set(C.id,`Couldn\u2019t revoke: ${_(te)}`),Y(),E(`Couldn\u2019t revoke ${C.name}.`),A(`api-tokens-revoke-${C.id}`)}}function V(){v=!1,Y(),A("api-tokens-new")}function oe(C){let U=w("form","api-tokens-sheet");U.noValidate=!0,U.setAttribute("aria-labelledby",`${s.id}-new`);let I=w("h3","","New token");I.id=`${s.id}-new`;let G=w("label","account-name-label","Name"),te=w("input");te.type="text",te.maxLength=60,te.required=!0,te.autocomplete="off",te.placeholder="e.g. Deploy bot",te.dataset.focusKey="api-tokens-name",G.append(te);let ie=(D,j,X,fe)=>{let ye=w("fieldset"),De=w("div","api-tokens-choices");for(let[Ce,Pe,Ne,Le]of fe){let Ie=w("label","api-tokens-choice",Pe),ut=w("input");ut.type=j,ut.name=X,ut.value=Ce,ut.checked=Ne,ut.dataset.focusKey=`api-tokens-${X}-${Ce}`,Le&&Ie.append(w("small","",Le)),Ie.prepend(ut),De.append(Ie)}return ye.append(w("legend","",D),De),ye},pe=ie("Access","checkbox","scope",C.scopes.map(D=>[D,zT[D]?`${zT[D]} comments`:D,D==="comments:read"])),xe=C.projects.includes(t),L=C.policy?.explicitProjects?C.projects.map(D=>[D,D===t?"This project":D,D===(xe?t:C.projects[0])]):[...xe?[["this","This project",!0]]:[],["all","All your projects",!xe]],Q=ie("Projects","radio","projects",L),Z=ie("Expires","radio","expiry",LK.filter(([,D])=>!C.policy||(D?D<=C.policy.maxLifetimeDays:C.policy.noExpiry)).map(([D,j])=>[String(j),D,j===30])),se=w("p","api-tokens-error");se.setAttribute("role","alert");let we=w("div","api-tokens-actions"),Te=Oe("Cancel",V,"secondary");Te.dataset.focusKey="api-tokens-cancel";let $=Oe("Create token",()=>{},"primary");return $.type="submit",$.dataset.focusKey="api-tokens-create",we.append(Te,$),U.append(I,G,pe,Q,Z,se,we),U.addEventListener("submit",async D=>{if(D.preventDefault(),x)return;let j=[...U.querySelectorAll("input[name=scope]:checked")].map(ye=>ye.value),X=U.querySelector("input[name=expiry]:checked")?.value,fe=te.value.trim()?j.length?null:pe.querySelector("input"):te;if(se.textContent=te.value.trim()?j.length?"":"Choose read, write, or both.":"Name your token.",fe){fe.focus();return}x=!0,$.disabled=Te.disabled=!0,$.setAttribute("aria-busy","true");try{let ye=await e.request("account/tokens","POST",{name:te.value.trim(),scopes:j,expiresInDays:X&&X!=="null"?Number(X):null,projects:C.policy?.explicitProjects?[U.querySelector("input[name=projects]:checked")?.value].filter(De=>!!De):U.querySelector("input[name=projects]:checked")?.value==="this"?[t]:[]});if(g!==C)return;C.tokens.unshift(ye.item),v=!1,m=ye,Y(),E("Token created. Copy it now. You won\u2019t see it again."),A("api-tokens-copy")}catch(ye){se.textContent=ye instanceof to&&ye.status===429?"You\u2019ve created several tokens recently. Try again later.":_(ye),$.focus()}finally{x=!1,$.disabled=Te.disabled=!1,$.removeAttribute("aria-busy")}}),U}function ue(C){let U=w("section","api-tokens-sheet");U.setAttribute("aria-labelledby",`${s.id}-secret`);let I=w("h3","",`Copy \u201C${C.item.name}\u201D`);I.id=`${s.id}-secret`;let G=w("p","api-tokens-warning");G.append(yt("info"),w("span","","You won\u2019t see this token again. Store it in a secret manager, never in source control."));let te=w("div","api-tokens-secret"),ie=w("code","",C.token);ie.setAttribute("aria-label","New API token"),ie.tabIndex=0,ie.dataset.focusKey="api-tokens-secret";let pe=Oe("Copy token",async()=>{try{await navigator.clipboard.writeText(C.token),pe.replaceChildren(yt("check"),document.createTextNode("Copied")),E("Token copied to the clipboard.")}catch{getSelection()?.selectAllChildren(ie),E("Couldn\u2019t copy. The token is selected; copy it with your keyboard.")}},"primary");pe.replaceChildren(yt("copy"),document.createTextNode("Copy")),pe.removeAttribute("title"),pe.dataset.focusKey="api-tokens-copy",te.append(ie,pe);let xe=w("div","api-tokens-actions"),L=Oe("Done",()=>{m=null,Y(),A("api-tokens-new")},"secondary");return L.dataset.focusKey="api-tokens-done",xe.append(L),U.append(I,G,te,xe),U}let q="";function Y(){R();let C=g?m?"secret":v?"form":"list":y?"error":"loading",U=[];if(g&&C==="list"){let te=Oe("New token",()=>{v=!0,Y(),A("api-tokens-name")},"secondary");te.replaceChildren(yt("plus"),document.createTextNode("New token")),te.removeAttribute("title"),te.dataset.focusKey="api-tokens-new",U.push(te)}else g&&C==="form"?U.push(oe(g)):m&&U.push(ue(m));if(C!==q&&U[0]&&S(U[0]),q=C,u.replaceChildren(...U),d.setAttribute("aria-busy",String(!g&&!y)),!g){if(y){let te=w("p","api-tokens-error",_(y));te.setAttribute("role","alert");let ie=y instanceof to&&[403,404].includes(y.status),pe=Oe("Try again",()=>{W()},"secondary");pe.dataset.focusKey="api-tokens-retry",d.replaceChildren(te,...ie?[]:[pe])}else{let te=w("div","api-tokens-list");te.setAttribute("aria-hidden","true"),te.append(w("div","api-tokens-skeleton"),w("div","api-tokens-skeleton"));let ie=w("span","sr-only","Loading API tokens");ie.setAttribute("role","status"),d.replaceChildren(te,ie)}return}if(!g.tokens.length){let te=w("p","api-tokens-empty");te.append(w("strong","","No tokens yet"),w("span","","Create one for a bot, a script, or a CI job.")),d.replaceChildren(te);return}let I=w("ul","api-tokens-list");I.setAttribute("aria-label","Your API tokens"),I.append(...g.tokens.map(le));let G=w("p","api-tokens-note");G.append(document.createTextNode("Use a token as "),w("code","","PALETTE_TOKEN"),document.createTextNode(" with the palette CLI.")),d.replaceChildren(I,G)}async function W(){y=null,g=null,Y();try{let C=await e.request("account/tokens");if(!Array.isArray(C.tokens)||!Array.isArray(C.projects))throw new to(0,"Couldn\u2019t read your tokens. Try again.");g={...C,scopes:Array.isArray(C.scopes)?C.scopes:["comments:read","comments:write"]}}catch(C){y=C instanceof Error?C:new Error(String(C))}Y()}return W(),o}var Qy,LK,zT,_K,Kz,DK,RK,Fz=O(()=>{"use strict";Gf();It();Qy=864e5,LK=[["7 days",7],["30 days",30],["90 days",90],["1 year",365],["Never",null]],zT={"comments:read":"Read","comments:write":"Write"},_K=[["year",365*Qy],["month",30*Qy],["week",7*Qy],["day",Qy],["hour",36e5],["minute",6e4]];Kz=e=>new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(e),DK=`.account-layer .account.account-tokens{padding-top:16px;gap:16px}
99
99
  .api-tokens-head{display:flex;align-items:center;gap:6px;margin-right:36px;min-height:30px}
100
100
  .api-tokens-head h2{margin:0;font-size:15px;font-weight:500;letter-spacing:-.01em}
101
101
  .api-tokens-head h2:focus{outline:none}
@@ -346,12 +346,12 @@ Unsaved app changes${n?" and unposted Design changes":""} will be lost.`))return
346
346
  .design-field input[type="color"]::-webkit-color-swatch-wrapper { padding:0; }
347
347
  .design-field input[type="color"]::-webkit-color-swatch { border:0; border-radius:4px; box-shadow:inset 0 0 0 1px #ffffff26; }
348
348
  .design-field input[type="color"]::-moz-color-swatch { border:0; border-radius:4px; }
349
- `});function SO(e,t,n){let o=e;if(!o.adoptedStyleSheets)return;let i=jT.get(e);try{if(n&&!i){let r=new(t.ownerDocument.defaultView??window).CSSStyleSheet;r.replaceSync(YK),jT.set(e,i={sheet:r,count:0}),o.adoptedStyleSheets=[...o.adoptedStyleSheets,r]}if(!i||(i.count+=n?1:-1,i.count))return;jT.delete(e),o.adoptedStyleSheets=o.adoptedStyleSheets.filter(r=>r!==i.sheet)}catch{}}function TO(e,t){e.getBoundingClientRect();for(let n of AO(e))if(!t.seen.has(n)&&Number.isFinite(n.effect?.getComputedTiming().endTime))try{n.finish()}catch{}}function PT(e){let t=cm.get(e);t?cancelAnimationFrame(t.frame):(cm.set(e,t={count:0,root:e.getRootNode(),seen:new Set(AO(e))}),e.setAttribute(nr,""),SO(t.root,e,!0));let n=t;n.count++,requestAnimationFrame(()=>{cm.get(e)===n&&TO(e,n)});let o=!0;return()=>{o&&(o=!1,!--n.count&&(n.frame=requestAnimationFrame(()=>n.frame=requestAnimationFrame(()=>{n.count||cm.get(e)!==n||(TO(e,n),cm.delete(e),e.removeAttribute(nr),SO(n.root,e,!1))}))))}}function dm(e,t){let n=e?PT(e):()=>{},o;try{o=t()}catch(i){throw n(),i}return()=>{try{o?.()}finally{n()}}}var nr,YK,cm,jT,AO,um=O(()=>{"use strict";nr="data-palette-still",YK=`:is([${nr}],[${nr}] *),:is([${nr}],[${nr}] *)::before,:is([${nr}],[${nr}] *)::after{transition:none!important}`,cm=new Map,jT=new Map,AO=e=>e.getAnimations?.({subtree:!0})??[]});var BT={};Ft(BT,{attach:()=>ZK});function ZK(e,t,n){t&&r0.set(e,t),n&&CO.set(e,n),ia&&!ia.select.isConnected&&ia.close();let o=e.getRootNode();if((o instanceof ShadowRoot||o===document)&&!LO.has(o)){LO.add(o);let r=document.createElement("style");r.textContent=Ry+XK,(o instanceof ShadowRoot?o:document.head).append(r)}if(MO.has(e))return;MO.add(e);let i=r=>{let a=r.composedPath()[0];return a instanceof HTMLSelectElement&&!a.disabled&&!a.multiple&&!a.dataset.picker?a:null};e.addEventListener("focusin",r=>{let a=i(r);a&&!a.hasAttribute("aria-haspopup")&&(a.setAttribute("aria-haspopup","listbox"),a.setAttribute("aria-expanded","false"))}),e.addEventListener("pointerdown",r=>{fc=r.pointerType==="mouse"?void 0:r;let a=i(r);!a||r.button||(r.preventDefault(),fc||_O(a,r0.get(e)))},!0),e.addEventListener("pointerup",r=>{let a=i(r);a&&fc&&!DO(r)&&_O(a,r0.get(e))},!0);for(let r of["mousedown","touchend"])e.addEventListener(r,a=>{i(a)&&a.cancelable&&a.preventDefault()},!0);e.addEventListener("keydown",r=>{let a=i(r);if(!a||ia?.select===a||r.ctrlKey||r.metaKey)return;let s=r.key.length===1&&r.key!==" "&&!r.altKey;s&&(/^[b?]$/i.test(r.key)||CO.get(e)?.(r))||!s&&!["Enter"," ","ArrowDown","ArrowUp"].includes(r.key)||(r.preventDefault(),RO(a,r0.get(e),s?r.key:""))},!0)}function _O(e,t){if(ia?.select===e)return ia.close();fc||e.focus(),RO(e,t)}function RO(e,t,n=""){ia?.close(),fc=void 0;let o=`palette-select-${++WK}`,i=document.createElement("div");i.className="palette-select",i.id=o,i.setAttribute("role","listbox"),i.setAttribute("aria-label",e.getAttribute("aria-label")??e.title);let r=[],a=(V,oe)=>{let ue=document.createElement("div");ue.id=`${o}-${r.length}`,ue.setAttribute("role","option"),ue.setAttribute("aria-selected",String(V.selected)),V.disabled&&ue.setAttribute("aria-disabled","true"),V.title&&(ue.title=V.title);let q=document.createElement("span");q.textContent=V.label,q.style.cssText=V.style.cssText,ue.append(q),oe.append(ue),r.push({node:ue,option:V})};for(let V of e.children)if(V instanceof HTMLOptionElement)a(V,i);else if(V instanceof HTMLOptGroupElement){let oe=document.createElement("div");oe.setAttribute("role","group"),oe.setAttribute("aria-labelledby",`${o}-g${r.length}`);let ue=document.createElement("small");ue.id=`${o}-g${r.length}`,ue.textContent=V.label,oe.append(ue);for(let q of V.querySelectorAll("option"))a(q,oe);i.append(oe)}let s=-1,l=e.dataset.property,c,u=()=>{let V=c;c=void 0,V?.()},d=r.flatMap((V,oe)=>V.option.disabled?[]:[oe]),p=(V,oe=!0)=>{if(!(V>=0))return;if(V!==s&&oe){u();let{value:W,selected:C}=r[V].option;if(!C){let U=I=>e.dispatchEvent(new CustomEvent("palette-preview",{detail:I}));c=dm(t,()=>t&&l?Fa(t,l,W):(U(W),()=>U(null)))}}r[s]?.node.removeAttribute("data-active"),s=V;let ue=r[V].node;ue.toggleAttribute("data-active",!0),e.setAttribute("aria-activedescendant",ue.id);let q=ue.offsetTop,Y=q+ue.offsetHeight;q<i.scrollTop?i.scrollTop=q-4:Y>i.scrollTop+i.clientHeight&&(i.scrollTop=Y-i.clientHeight+4)},g=V=>{let oe=d.indexOf(s);p(d[oe<0?0:Math.max(0,Math.min(d.length-1,oe+V))])},y=V=>{let oe=r[V]?.option;h(),!(!oe||oe.disabled||oe.selected)&&(oe.selected=!0,e.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))},v=new AbortController,{signal:x}=v;function h(){ia?.close===h&&(ia=void 0,u(),v.abort(),i.remove(),e.setAttribute("aria-expanded","false"),e.removeAttribute("aria-activedescendant"),e.removeAttribute("aria-controls"))}ia={select:e,close:h};let m="",b=0,E=(V,oe)=>{m=oe-b<1e3?m+V.toLowerCase():V.toLowerCase(),b=oe;let ue=Math.max(0,d.indexOf(s)+(m[1]?0:1)),Y=[...d.slice(ue),...d.slice(0,ue)].find(W=>r[W].option.label.toLowerCase().startsWith(m));Y!==void 0&&p(Y)};addEventListener("keydown",V=>{if(!e.isConnected||V.composedPath()[0]!==e)return h();let oe=V.key;if(!(V.ctrlKey||V.metaKey||V.altKey&&!oe.startsWith("Arrow"))){if(oe==="Tab")return h();if(oe==="ArrowDown"||oe==="ArrowUp")g(oe==="ArrowDown"?1:-1);else if(oe==="Home"||oe==="PageUp")p(d[0]);else if(oe==="End"||oe==="PageDown")p(d[d.length-1]);else if(oe==="Escape")h();else if(oe==="Enter"||oe===" "&&!m)y(s);else if(oe.length===1)E(oe,V.timeStamp);else if(oe!=="ArrowLeft"&&oe!=="ArrowRight")return;V.preventDefault(),V.stopImmediatePropagation()}},{capture:!0,signal:x}),addEventListener("pointerdown",V=>{let oe=V.composedPath();!oe.includes(i)&&!oe.includes(e)&&h()},{capture:!0,signal:x});let S,A=V=>{let oe=e.getBoundingClientRect();V.target!==i&&(!S||Math.abs(oe.top-S.top)+Math.abs(oe.left-S.left)>1)&&h()};addEventListener("scroll",A,{capture:!0,signal:x}),e.getRootNode().addEventListener("scroll",A,{capture:!0,signal:x}),addEventListener("resize",h,{signal:x}),sc(e,h,x),e.addEventListener("blur",h,{signal:x}),i.addEventListener("mousedown",V=>V.preventDefault(),{signal:x}),i.addEventListener("pointerleave",()=>{u(),r[s]?.node.removeAttribute("data-active"),e.removeAttribute("aria-activedescendant"),s=-1},{signal:x}),i.addEventListener("pointermove",V=>{let oe=V.target.closest?.("[role=option]"),ue=r.findIndex(q=>q.node===oe);d.includes(ue)&&ue!==s&&p(ue)},{signal:x}),i.addEventListener("click",V=>{if(V.preventDefault(),DO(V))return;let oe=V.target.closest?.("[role=option]"),ue=r.findIndex(q=>q.node===oe);d.includes(ue)&&y(ue)},{signal:x});let _=e.closest(".design-field")??e.parentElement;i.popover="manual",(e.closest(".palette-tokens")??_).append(i),i.showPopover?.(),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls",o),S=e.getBoundingClientRect();let T=(e.offsetWidth<60?_:e).getBoundingClientRect(),H=Math.min(Math.max(T.width,i.offsetWidth+2,120),innerWidth-16),R=innerHeight-T.bottom-8,z=T.top-8,F=i.scrollHeight,B=F>R&&z>R,le=Math.max(B?z:R,60),J=Math.min(F,240,le);i.style.width=`${H}px`,i.style.maxHeight=`${Math.min(240,le)}px`,i.style.left=`${Math.max(8,Math.min(T.left,innerWidth-H-8))}px`,i.style.top=`${B?T.top-J-4:T.bottom+4}px`,i.toggleAttribute("data-up",B);for(let{node:V,option:oe}of r)!V.title&&V.firstElementChild.scrollWidth>V.firstElementChild.clientWidth&&(V.title=oe.label);p(r.findIndex(V=>V.option.selected&&!V.option.disabled),!1),s<0&&g(0),n&&E(n,performance.now())}var XK,MO,r0,CO,LO,WK,ia,fc,DO,VT=O(()=>{"use strict";Wf();um();XK=`.design-field>select{appearance:none;padding-right:20px;cursor:pointer;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 3 4 5.5 6.5 3' fill='none' stroke='%23898680' stroke-width='1.2'/%3E%3C/svg%3E") right 7px center/8px no-repeat}.palette-select{width:max-content;max-height:240px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:4px;line-height:1.2}.palette-select[popover]{position:fixed;inset:auto;margin:0;border:0}.palette-select [role=option]{display:flex;align-items:center;gap:8px;box-sizing:border-box;min-height:28px;padding:0 8px;border-radius:6px;white-space:nowrap;cursor:pointer}.palette-select [role=option] span{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.palette-select [role=option]::after{content:'';flex:none;width:7px;height:3.5px;margin:-3px 1px 0 0;border:solid transparent;border-width:0 0 1.5px 1.5px;rotate:-45deg}.palette-select [data-active]{background:#ffffff14;color:#f1efeb}.palette-select [aria-selected=true]{color:#f1efeb}.palette-select [aria-selected=true]::after{border-color:#bda6ef}.palette-select [aria-disabled=true]{opacity:.4;cursor:default}.palette-select small{display:block;padding:8px 8px 4px;color:#77736f;font-size:10px;font-weight:500}.palette-select [role=group]+[role=group],.palette-select [role=option]+[role=group]{margin-top:4px;border-top:1px solid #ffffff0d}@media (pointer:coarse){.palette-select{font-size:13px}.palette-select [role=option]{min-height:40px}}`,MO=new WeakSet,r0=new WeakMap,CO=new WeakMap,LO=new WeakSet,WK=0;DO=e=>fc&&Math.abs(e.clientY-fc.clientY)>10});var HO={};Ft(HO,{liveColors:()=>QK});function QK(e,t,n){let o=new AbortController,i=new MutationObserver(()=>s()),r=!1,a=!1,s=()=>{r||(r=!0,requestAnimationFrame(l))},l=()=>{if(r=!1,!e[0].isConnected)return o.abort();for(let u of e){let d=u.querySelector("[data-property]"),p=u.querySelector('input[type="color"]'),g=u.querySelector(".design-token-binding")?.dataset.value,y=n({property:d.dataset.property,kind:"color"},t,g);y===d.value||d.matches(":focus")||d.getAttribute("aria-invalid")==="true"||(d.value=y,p&&(p.value=ic(y)),u.dispatchEvent(new Event("palette-field-sync")))}let c=t.ownerDocument.getAnimations?.().filter(u=>/color|fill|stroke/.test(String(u.transitionProperty))&&u.effect?.target?.contains(t));!c?.length||a||(a=!0,Promise.race([Promise.allSettled(c.map(u=>u.finished)),new Promise(u=>setTimeout(u,1e3))]).then(()=>{a=!1,s()}))};for(let c of["pointerover","pointerout","pointerup","focusin","focusout","transitionend","transitioncancel"])addEventListener(c,s,{capture:!0,signal:o.signal});i.observe(t.ownerDocument,{attributes:!0,subtree:!0}),o.signal.addEventListener("abort",()=>i.disconnect()),s()}var zO=O(()=>{"use strict";Li()});var jO={};Ft(jO,{enhance:()=>nI});function NO(e,t){let n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),"value");Object.defineProperty(e,"value",{configurable:!0,get:()=>n.get.call(e),set:o=>{n.set.call(e,o),t()}}),e.addEventListener("input",t),t()}function nI(e,t){let n=e.getRootNode();if((n instanceof ShadowRoot||n===document)&&!$O.has(n)){$O.add(n);let o=document.createElement("style");o.textContent=JK,(n instanceof ShadowRoot?n:document.head).append(o)}for(let o of e.querySelectorAll(".design-field[data-field-property]")){if(o.dataset.enhanced)continue;o.dataset.enhanced="";let i=o.dataset.fieldProperty,r=o.querySelector(":scope > [data-property]");if(!r)continue;if(r instanceof HTMLSelectElement&&i==="font-weight")for(let u of r.options)u.style.fontWeight=u.value;r instanceof HTMLSelectElement&&OO[i]&&oI(o,r,t,OO[i]);let a=eI.has(i);if(!(r instanceof HTMLInputElement)||!(a||/design-field--(length|size)/.test(o.className)))continue;let s=document.createElement("span");s.className="design-field__unit",s.setAttribute("aria-hidden","true"),r.after(s);let l=()=>{a&&!o.querySelector(":scope > .palette-tokens")&&o.toggleAttribute("data-inline-token",!/\s/.test(getComputedStyle(t).getPropertyValue(i).trim()))},c=()=>{let u=o.querySelector(".design-token-chip");u&&tI?.observe(u)};a&&new MutationObserver(()=>{c(),l()}).observe(o,{childList:!0}),c(),NO(r,()=>{s.textContent=i!=="line-height"&&/^-?\d*\.?\d+$/.test(r.value.trim())?"px":"",l()})}}function oI(e,t,n,o){let i=document.createElement("div");i.className="design-segments",i.setAttribute("role","radiogroup"),i.setAttribute("aria-label",t.getAttribute("aria-label")??"");let r,a=()=>{let c=r;r=void 0,c?.()},s=[...t.options].filter(c=>o[c.value]).map(c=>{let u=document.createElement("button");return u.type="button",u.setAttribute("role","radio"),u.value=c.value,u.title=c.label,u.setAttribute("aria-label",c.label),u.innerHTML=`<svg viewBox="0 0 12 12" aria-hidden="true"><path d="${o[c.value]}"/></svg>`,u.addEventListener("pointerenter",()=>{a(),t.value!==c.value&&(r=Fa(n,t.dataset.property,c.value))}),u.addEventListener("pointerleave",a),u.addEventListener("click",()=>l(c.value)),u}),l=c=>{a(),t.value!==c&&(t.dispatchEvent(new Event("focus")),t.value=c,t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0})))};i.addEventListener("keydown",c=>{let u={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[c.key];if(c.key==="Escape"&&r){a(),c.stopPropagation();return}if(!u)return;c.preventDefault();let p=(Math.max(0,s.findIndex(g=>g.getAttribute("aria-checked")==="true"))+u+s.length)%s.length;l(s[p].value),s[p].focus()}),i.append(...s),t.after(i),NO(t,()=>{let c={start:"left",end:"right"}[t.value]??t.value,u=s.findIndex(d=>d.value===c);s.forEach((d,p)=>{d.setAttribute("aria-checked",String(p===u)),d.tabIndex=p===Math.max(u,0)?0:-1})})}var JK,OO,eI,$O,tI,PO=O(()=>{"use strict";Li();JK=".design-segments{display:flex;flex:1;gap:2px;min-width:0;height:100%;box-sizing:border-box;padding:2px}.design-field:has(>.design-segments)>select{display:none}.design-field:has(>.design-token-binding)>.design-segments{margin-right:24px}.design-segments button{flex:1;display:grid;place-items:center;min-width:0;padding:0;border:0;border-radius:4px;background:none;color:#898680;font:inherit;font-size:10px;cursor:pointer}.design-segments button:hover{color:#f1efeb}.design-segments button[aria-checked=true]{background:#ffffff1a;color:#f1efeb}.design-segments button:focus-visible{outline:1px solid #bda6ef;outline-offset:-1px}.design-segments svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.2;stroke-linecap:round}.design-field__unit{flex:none;padding-right:8px;color:#77736f;font-size:10px;pointer-events:none}.design-field__unit:empty{display:none}.design-field.design-field:has(>.design-field__unit:not(:empty))>input[data-property]{padding-right:2px}.design-field:has(>.design-token-binding)>.design-field__unit{margin-right:20px}.design-field:is([data-token-mode=token],[data-token-mode=connected])>.design-field__unit{visibility:hidden}.design-field:has(>.design-token-binding>.design-token-off:not([hidden]))>.design-field__unit{margin-right:30px}.design-field.design-field[data-inline-token]:is([data-token-mode=token],[data-token-mode=connected])>:is([data-property],.design-field__unit){visibility:visible}.design-field.design-field[data-inline-token]:is([data-token-mode=token],[data-token-mode=connected])>.design-field__unit{display:block;margin-right:calc(var(--chip,50%) + 30px)}.design-field.design-field[data-inline-token]:is([data-token-mode=token],[data-token-mode=connected]) .design-token-chip{left:auto;width:max-content;max-width:50%;box-sizing:border-box;overflow:clip;overflow-clip-margin:content-box}.design-field.design-field[data-inline-token]:is([data-token-mode=token],[data-token-mode=connected]) .design-token-binding select{left:auto;width:var(--chip,50%)}.design-token-chip__verb{display:contents}.design-field[data-inline-token] .design-token-chip__verb{display:none}.design-field.design-field[data-inline-token]:is([data-token-mode=token],[data-token-mode=connected])>input[data-property]{padding-right:2px}.design-field[data-inline-token]>.palette-tokens:not([data-custom])>.palette-tokens__head,.design-field[data-inline-token] .palette-custom__body>.palette-typed:not(.palette-typed__advanced){display:none}",OO={"text-align":{left:"M1.5 2.5h9M1.5 5h6M1.5 7.5h9M1.5 10h6",center:"M1.5 2.5h9M3 5h6M1.5 7.5h9M3 10h6",right:"M1.5 2.5h9M4.5 5h6M1.5 7.5h9M4.5 10h6",justify:"M1.5 2.5h9M1.5 5h9M1.5 7.5h9M1.5 10h9"},"border-style":{none:"M3 3l6 6M9 3 3 9",solid:"M1.5 6h9",dashed:"M1.5 6h2M5 6h2M8.5 6h2",dotted:"M2 6h.01M4.67 6h.01M7.33 6h.01M10 6h.01"}},eI=new Set(["font-size","line-height","letter-spacing","gap","border-width","padding","margin","border-radius"]),$O=new WeakSet,tI=globalThis.ResizeObserver&&new ResizeObserver(e=>{for(let{target:t}of e)t.closest(".design-field")?.style.setProperty("--chip",`${t.offsetWidth}px`)})});var IO={};Ft(IO,{designPanelStyles:()=>EO,fieldControl:()=>KO,fields:()=>UO,renderPanel:()=>lI,syncFields:()=>yO,toHex:()=>ic,valueFor:()=>UT});function qO(e){let t=e.match(/^rgba\(.*,\s*([\d.]+)\)$/)?.[1];return t===void 0?/^rgb\(/.test(e)?ic(e):e||"transparent":Number(t)?e:"transparent"}function UT(e,t,n){let o=(n||getComputedStyle(t).getPropertyValue(e.property)).trim();if(e.kind==="color")return qO(o);if(e.kind==="length"||e.kind==="size"){let i=o.match(/^(-?\d+(?:\.\d+)?)px$/);return i?String(Math.round(Number(i[1])*10)/10):e.kind==="size"?o||"auto":"0"}return o}function KO(e,t){let{element:n}=t,o=document.createElement("div");o.className=`design-field design-field--${e.kind}`,o.dataset.fieldProperty=e.property,o.toggleAttribute("data-wide",!!e.wide);let i=e.kind==="select"?document.createElement("select"):document.createElement("input");if(i instanceof HTMLSelectElement)for(let d of e.values??[]){let p=document.createElement("option");p.value=p.textContent=d,i.append(p)}else i.type=e.kind==="length"?"number":"text",i.autocomplete="off",i.spellcheck=!1,i.placeholder=e.placeholder??"",e.kind==="length"&&(i.min=String(e.min??0),i.max=String(e.max??1e3),i.setAttribute("inputmode","decimal"));let r=vO(i,e,o);o.append(r),i.dataset.property=e.property,i.setAttribute("aria-label",e.label);let a=()=>{let d=UT(e,n);i instanceof HTMLSelectElement&&![...i.options].some(g=>g.value===d)&&i.prepend(new Option(d,d)),i.value=d;let p=o.querySelector('input[type="color"]');p&&(p.value=ic(d))};a();let s=()=>t.begin(i,e.property),l=()=>u(()=>{t.apply(i,e.property,xO(e,i)),t.commit(i,e.property,!1)}),c=()=>u(()=>t.commit(i,e.property));if(i.addEventListener("focus",s),i.addEventListener("input",l),i.addEventListener("change",c),i.addEventListener("blur",c),e.kind==="color"){let d=document.createElement("input");d.type="color",d.setAttribute("aria-label",`${e.label} picker`);let p=()=>{d.value=ic(i.value)};p(),d.addEventListener("pointerdown",s),d.addEventListener("focus",s),d.addEventListener("input",()=>{i.value=d.value,l()}),d.addEventListener("change",c),i.addEventListener("input",p),o.append(d)}if(e.glyph){let d=g=>{let y=i.value.trim().match(/^(-?\d*\.?\d+)([a-z%]*)$/i),v=y?y[2]:e.kind==="text"?"px":"",x=y?Number(y[1]):parseFloat(getComputedStyle(n).getPropertyValue(e.property))||0,h=Math.round((x+g*(e.step??(e.kind==="text"&&!v?.1:1)))*100)/100;(e.kind!=="text"||e.max)&&(h=Math.min(e.max??1e4,Math.max(e.min??0,h))),i.value=`${h}${v}`,l()},p=document.createElement("span");p.className="design-field__glyph",p.setAttribute("aria-hidden","true"),p.title=`${e.label} \xB7 drag to adjust`,e.glyph.length>1?p.innerHTML=`<svg viewBox="0 0 12 12"><path d="${e.glyph}"/></svg>`:p.textContent=e.glyph,r.style.cssText+=";cursor:ew-resize;user-select:none;touch-action:none";for(let g of[p,r])g.addEventListener("pointerdown",y=>{if(y.button)return;y.preventDefault(),s(),g.setPointerCapture?.(y.pointerId);let v=y.clientX,x=m=>{let b=Math.trunc((m.clientX-v)/2);b&&(v+=b*2,d(b*(m.shiftKey?10:1)))},h=()=>{g.removeEventListener("pointermove",x),c()};g.addEventListener("pointermove",x),g.addEventListener("pointerup",h,{once:!0}),g.addEventListener("pointercancel",h,{once:!0})});i.addEventListener("keydown",g=>{g.key!=="ArrowUp"&&g.key!=="ArrowDown"||(g.preventDefault(),d((g.key==="ArrowUp"?1:-1)*(g.shiftKey?10:1)))}),o.append(p)}i instanceof HTMLInputElement&&i.addEventListener("keydown",d=>{d.key==="Enter"&&i.blur()}),o.addEventListener("keydown",d=>{if(d.key!=="Escape")return;let p=d.target===i;if(!t.cancel)return p&&i.blur();d.preventDefault(),d.stopImmediatePropagation(),t.cancel(i,e.property),a(),p&&i.blur(),queueMicrotask(()=>{o.dataset.tokenMode!=="custom"&&o.querySelector(".design-token-binding select")?.focus()})}),o.append(i);let u=bO(i,e,t,a);return o}function sI(e,t,n){let o=document.createElement("button");return o.type="button",o.title=e,o.setAttribute("aria-label",e),o.textContent=t,o.addEventListener("click",n),o}function Xa(e,t,n,o=[]){let i=document.createElement("section");i.className="design-section";let r=document.createElement("div");if(r.className="design-section__tools",r.append(...o),!n){let c=document.createElement("span");return c.className="design-section__title",c.textContent=t,i.append(c,r),i}let a=document.createElement("details");a.className="design-group",a.open=!e.collapsed.has(t);let s=document.createElement("summary");s.textContent=t;let l=document.createElement("div");l.className="design-grid";for(let c of n){let u=UO.find(d=>d.property===c);l.append(KO(e.element.namespaceURI==="http://www.w3.org/2000/svg"&&c==="color"?{...u,label:"Color"}:u,e))}return a.append(s,l),a.addEventListener("toggle",()=>{a.isConnected&&(a.open?e.collapsed.delete(t):e.collapsed.add(t))}),i.append(r,a),i}function VO(e,t){let n=[...e.querySelectorAll(".design-field--color")];n.length&&rI.then(o=>o?.liveColors(n,t,UT))}function lI(e,t){let{element:n,changed:o}=t;iI.then(p=>p?.attach(e,t.element,t.reserved)),aI.then(p=>p?.enhance(e,t.element));let i=getComputedStyle(n);if(n.namespaceURI==="http://www.w3.org/2000/svg")return e.append(Xa(t,"Layout",n.localName==="svg"?["width","height","display"]:["display"]),Xa(t,"Appearance",["color","fill","stroke","stroke-width"])),VO(e,n);let r=p=>p.some(g=>o?.has(g)),a=!!n.textContent?.trim()||/(?:^|;)\s*(?:color|font|line-height|text-align)/.test(n.getAttribute("style")??"")||r(BO),s=/flex|grid/.test(i.display)||r(["gap"]),l=qO(i.backgroundColor)!=="transparent"||r(["background-color"]),c=["top","right","bottom","left"].some(p=>parseFloat(i.getPropertyValue(`border-${p}-width`))>0&&i.getPropertyValue(`border-${p}-style`)!=="none")||r(["border","border-width","border-style","border-color"]),u=i.boxShadow&&i.boxShadow!=="none"||r(["box-shadow"]),d=(p,g,y,v)=>sI(`Add ${p}`,"+",()=>{let x=document.createElement("input");t.begin(x,g),t.apply(x,g,y),t.commit(x,g),t.rerender(),e.querySelector(`[data-property="${v}"]`)?.focus()});e.append(Xa(t,"Layout",["width","height","padding",...s?["gap"]:[],"margin",...c?[]:["border-radius"],"display"])),a&&e.append(Xa(t,"Typography",BO,[t.editText])),e.append(l?Xa(t,"Fill",["background-color"]):Xa(t,"Fill",null,[d("fill","background-color","#ffffff","background-color")]),c?Xa(t,"Border",["border-width","border-radius","border-style","border-color"]):Xa(t,"Border",null,[d("border","border","1px solid","border-width")]),Xa(t,"Effects",u?["opacity","box-shadow"]:["opacity"],u?[]:[d("shadow","box-shadow","0 1px 3px rgba(0, 0, 0, 0.12)","box-shadow")])),VO(e,n)}var UO,iI,rI,aI,BO,GO=O(()=>{"use strict";i0();i0();wO();kO();Li();UO=[{property:"width",label:"Width",kind:"size",glyph:"W"},{property:"height",label:"Height",kind:"size",glyph:"H"},{property:"padding",label:"Padding",kind:"length",glyph:"M1.5 1.5h9v9h-9zM4.5 4.5h3v3h-3z",max:200},{property:"gap",label:"Gap",kind:"length",glyph:"M1.5 1.5h3v9h-3zM7.5 1.5h3v9h-3z",max:200},{property:"margin",label:"Margin",kind:"length",glyph:"M4 4h4v4H4zM1 3V1h2m6 0h2v2m0 6v2H9m-6 0H1V9",max:200},{property:"border-radius",label:"Corner radius",kind:"length",glyph:"M1.5 10.5V6A4.5 4.5 0 0 1 6 1.5h4.5",max:96},{property:"display",label:"Layout",kind:"select",values:["block","flex","grid","inline-flex","inline-grid"]},{property:"font-family",label:"Font family",kind:"text",wide:!0,placeholder:"system-ui, sans-serif"},{property:"font-size",label:"Font size",kind:"length",wide:!0,glyph:"M2 3V1.5h8V3M6 1.5v9m-1.5 0h3",min:1,max:160},{property:"line-height",label:"Line height",kind:"text",glyph:"M1 1.5h10M1 10.5h10M3.5 8.5 6 3l2.5 5.5",placeholder:"1.4 or 24px"},{property:"letter-spacing",label:"Letter spacing",kind:"text",glyph:"M1 2.5v7M11 2.5v7M3.5 9.5 6 2.5l2.5 7M4.4 7h3.2",placeholder:"0 or 0.02em"},{property:"font-weight",label:"Weight",kind:"select",values:["300","400","500","600","700","800"]},{property:"text-align",label:"Alignment",kind:"select",values:["left","center","right","justify"]},{property:"color",label:"Text color",kind:"color",wide:!0},{property:"background-color",label:"Fill",kind:"color",wide:!0},{property:"border-width",label:"Border width",kind:"length",glyph:"M1 2.5h10M1 6h10M1 9.5h10",max:24},{property:"border-style",label:"Border style",kind:"select",values:["none","solid","dashed","dotted"]},{property:"border-color",label:"Border color",kind:"color"},{property:"fill",label:"Fill",kind:"color",wide:!0},{property:"stroke",label:"Stroke",kind:"color",wide:!0},{property:"opacity",label:"Layer opacity",kind:"text",glyph:"M6 1.5a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9v9",min:0,max:1,step:.01,placeholder:"0\u20131"},{property:"box-shadow",label:"Shadow",kind:"text",wide:!0},{property:"stroke-width",label:"Stroke width",kind:"length",min:0,max:24}],iI=Promise.resolve().then(()=>(VT(),BT)).catch(()=>null),rI=Promise.resolve().then(()=>(zO(),HO)).catch(()=>null),aI=Promise.resolve().then(()=>(PO(),jO)).catch(()=>null),BO=["font-family","font-size","line-height","letter-spacing","font-weight","text-align","color"]});function FO(e,t=!1){return e.composedPath().some(n=>Kn(n)&&!(t&&n.matches("button,a[href],summary")&&!n.matches("[contenteditable],[inert],[role]:not([role=button]):not([role=link])"))&&n.matches('input,textarea,select,button,a[href],summary,dialog,[contenteditable]:not([contenteditable="false"]),[inert],[role]:not([role="none"]):not([role="presentation"]):not([role="img"]):not([role="group"]):not([role="region"]):not([role="main"]):not([role="article"]):not([role="heading"]):not([role="paragraph"]):not([role="generic"])'))}function YO(e){let t=e.keys??eu(),n=a=>{let s=a.composedPath()[0];s instanceof HTMLSelectElement&&a.composedPath().includes(e.host)&&!br(s)&&!a.ctrlKey&&!a.metaKey&&!a.altKey&&(/^[b?]$/i.test(a.key)||e.reserved?.(a))&&a.preventDefault()},{root:o,signal:i}=e;addEventListener("keydown",n,{signal:i}),o?.addEventListener("keydown",a=>Ju(a,o)&&n(a),{signal:i});let r=(a,s)=>{let l=o?.activeElement??document.activeElement,c=l?.closest("[data-field-property]")?.dataset.fieldProperty;a.click();let u=e.selected();u&&(!s.includes(e.host)||l?.matches(".design-geometry__frame"))&&e.select(u);let d=l?.isConnected?l:c&&o?.querySelector(`[data-field-property="${CSS.escape(c)}"] ${l.localName}`);d instanceof HTMLElement&&d.focus({preventScroll:!0}),!s.includes(e.host)&&o?.activeElement!==as()&&o?.activeElement?.blur()};return a=>{if(a.isComposing||a.keyCode===229)return!1;let s=a.key.toLowerCase(),l=a.composedPath(),c=br(l[0]),u=po()?a.metaKey&&!a.ctrlKey:a.ctrlKey&&!a.metaKey,d=c||!u||a.altKey?void 0:s==="z"?a.shiftKey?e.redo:e.undo:s==="y"&&!po()&&!a.shiftKey?e.redo:void 0;if(d)return d.disabled?!1:(a.preventDefault(),a.stopImmediatePropagation(),r(d,l),!0);if(s==="escape")return c?(l.some(H=>Kn(H)&&H.matches("[data-field-property]"))||(a.preventDefault(),l[0].blur()),!0):l.some(H=>Kn(H)&&H.matches("[popover],[role=listbox]"));if(a.defaultPrevented||e.reserved?.(a))return!1;let p=!a.altKey&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey,g=Bo(a,t.before)?!0:Bo(a,t.after)?!1:void 0,y=c||l.some(H=>Kn(H)&&H.matches("input[type=range],[role=slider],.design-geometry__frame"));if(!e.compare.hidden&&(g!==void 0&&!y||p&&s==="b"&&!c))return a.preventDefault(),a.stopImmediatePropagation(),e.compareBefore(g),!0;if(a.key==="?"&&e.help&&!c&&!a.altKey&&!a.ctrlKey&&!a.metaKey)return a.preventDefault(),a.stopImmediatePropagation(),e.help(),!0;let v=p&&s===" ";if(p&&s==="enter"&&!a.repeat){let H=c||l.some(z=>Kn(z)&&z.matches("[data-field-property],[popover],[role=listbox],[role=menu],textarea,.new-comment-composer,.reply-composer")),R=l.includes(e.host)&&FO(a);if(!H&&!R)return e.selected()?.isConnected&&e.comment?.()?(a.preventDefault(),a.stopImmediatePropagation(),!0):!1}if(l.includes(e.host)||FO(a,v))return!1;let h=e.selected(),m=H=>fn(H)&&H.isConnected&&H!==H.ownerDocument.body&&H!==H.ownerDocument.documentElement&&!e.host.contains(H)&&!H.matches("script,style,defs,title,desc,metadata,[hidden],[inert]")&&getComputedStyle(H).display!=="none"&&getComputedStyle(H).visibility!=="hidden",b=Xn(),E=b.activeElement,S=!E||E===b.body||E===b.documentElement||E===h,A=null,_=Bo(a,t.next)?"nextElementSibling":Bo(a,t.prev)?"previousElementSibling":void 0,T=a.altKey&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey;if(h?.isConnected&&_){for(A=h[_];A&&!m(A);)A=A[_];a.preventDefault(),a.stopImmediatePropagation()}else h?.isConnected&&S&&(Bo(a,t.child)||T&&s==="arrowdown")?A=[...h.children].find(m)??null:h?.isConnected&&(Bo(a,t.parent)||T&&s==="arrowup")?A=h.parentElement:v&&(A=E);return m(A)?(a.preventDefault(),a.stopImmediatePropagation(),A.scrollIntoView?.({block:"nearest",inline:"nearest"}),e.select(A),!0):a.defaultPrevented}}function cI(e){let t=e.closest("[data-field-property]")?.dataset.fieldProperty,n=t?`[data-field-property=${JSON.stringify(t)}] `:"",o=e.getAttribute("data-property"),i=e.getAttribute("aria-label");return o?`${e.localName}[data-property=${JSON.stringify(o)}]`:i?`${n}${e.localName}[aria-label=${JSON.stringify(i)}]`:e.id?`[id=${JSON.stringify(e.id)}]`:n&&`${n}${e.localName}`}function XO(e,t,n,o){let i=e.getRootNode(),r=cI(t),a=()=>!i.activeElement&&(!document.activeElement||document.activeElement===document.body),s=d=>{c.disconnect(),clearTimeout(u),n(),d&&a()&&o()},l=()=>{if(!a())return s(!1);let d=r?e.querySelector(r):null;d&&(d.focus({preventScroll:!0}),s(!1))},c=new MutationObserver(l);c.observe(e,{childList:!0,subtree:!0});let u=setTimeout(s,400,!0);return s}var WO=O(()=>{"use strict";Fs();It();ea();ho();wy()});var XT={};Ft(XT,{colorChannels:()=>t$,documentColors:()=>n$,formatColor:()=>aa,formats:()=>KT,hslToRgb:()=>GT,hsvToRgb:()=>IT,matchingToken:()=>r$,parseColor:()=>hu,pickerEditor:()=>pI,recentColors:()=>YT,rememberColor:()=>i$,rgbToHsl:()=>FT,rgbToHsv:()=>e$});function IT(e,t,n){let o=i=>{let r=(i+e/60)%6;return(n-n*t*Eo(Math.min(r,4-r),0,1))*255};return[o(5),o(3),o(1)]}function GT(e,t,n){let o=t*Math.min(n,1-n),i=r=>{let a=(r+e/30)%12;return(n-o*Eo(Math.min(a-3,9-a),-1,1))*255};return[i(0),i(8),i(4)]}function e$(e,t,n){let o=Math.max(e,t,n),i=o-Math.min(e,t,n);return[JO(e,t,n,o,i),o?i/o:0,o/255]}function FT(e,t,n){let o=Math.max(e,t,n),i=Math.min(e,t,n),r=o-i,a=(o+i)/510;return[JO(e,t,n,o,r),r?r/255/(1-Math.abs(2*a-1)):0,a]}function hu(e){let t=e.trim().toLowerCase();if(t==="transparent")return[0,0,0,0];let n=/^#?([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/.exec(t)?.[1];if(n){let c=n.length<5?[...n].map(d=>d+d).join(""):n,u=d=>parseInt(c.slice(d,d+2),16);return[u(0),u(2),u(4),c.length>6?u(6)/255:1]}let o=/^(rgb|hsl|hs[bv])a?\(([^)]*)\)$/.exec(t);if(o){let c=o[2].split(/[\s,/]+/).filter(Boolean),u=(x="1",h=1)=>/^-?(\d+\.?\d*|\.\d+)(%|deg)?$/.test(x)?parseFloat(x)/(x.endsWith("%")?100:1)*(x.endsWith("%")?h:1):NaN;if(c.length<3||c.length>4)return;let[d,p,g]=o[1]==="rgb"?c.slice(0,3).map(x=>u(x,255)):[u(c[0]),parseFloat(c[1])/100,parseFloat(c[2])/100],y=o[1]==="rgb"?[d,p,g]:(o[1]==="hsl"?GT:IT)((d%360+360)%360,Eo(p,0,1),Eo(g,0,1)),v=u(c[3]);return[...y,v].some(Number.isNaN)?void 0:[...y.map(x=>Eo(x,0,255)),Eo(v,0,1)]}if(/var\(|currentcolor|^$/.test(t)||!globalThis.CSS?.supports?.("color",t))return;let i=w("canvas").getContext?.("2d",{willReadFrequently:!0});if(!i)return;i.fillStyle=t,i.fillRect(0,0,1,1);let[r,a,s,l]=i.getImageData(0,0,1,1).data;return[r,a,s,l/255]}function aa([e,t,n,o],i,r){if(i==="RGB"||i==="CSS")return`rgb(${si(e)} ${si(t)} ${si(n)}${ZO(o)})`;if(i==="HSL"){let[a,s,l]=FT(e,t,n);return`hsl(${si(s?a:r??a)} ${ra(s)}% ${ra(l)}%${ZO(o)})`}return`#${a0(e)}${a0(t)}${a0(n)}${o<1?a0(o*255):""}`}function t$(e,t,n){let[o,i,r,a]=e;if(t==="CSS")return[aa(e,"CSS")];if(t==="Hex")return[aa([o,i,r,1],"Hex").slice(1).toUpperCase(),String(ra(a))];let[s,l,c]=t==="HSL"?FT(o,i,r):n;return[...(t==="RGB"?[o,i,r]:[t==="HSB"||l?s:n[0],l*100,c*100]).map(d=>String(si(d))),String(ra(a))]}function n$(e=document.body,t=12,n=600){let o=new Map,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(let r=i.nextNode(),a=0;r&&a<n;r=i.nextNode(),a++){if(r.hasAttribute("data-branch-comments"))continue;let s=getComputedStyle(r);for(let l of["color","background-color","border-top-color","fill","stroke"]){if(l==="border-top-color"&&!parseFloat(s.borderTopWidth))continue;let c=hu(s.getPropertyValue(l));if(!c?.[3])continue;let u=aa(c,"Hex");o.set(u,(o.get(u)??0)+1)}}return[...o].sort((r,a)=>a[1]-r[1]).slice(0,t).map(([r])=>r)}function YT(){try{let e=JSON.parse(localStorage.getItem(o$())??"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"&&hu(t)).slice(0,8):[]}catch{return[]}}function i$(e){try{localStorage.setItem(o$(),JSON.stringify([e,...YT().filter(t=>t!==e)].slice(0,8)))}catch{}}function r$(e,t,n){let o=aa(e,"Hex");return Xs(t,n).find(i=>i.type==="color"&&i.value&&!/var\(/i.test(i.value)&&(()=>{let r=hu(i.value);return r&&aa(r,"Hex")===o})())}function pI(e,t){let{property:n}=e,o=w("div","palette-color"),i=w("style","",dI),[r,a,s,l]=[0,0,0,1],c="Hex";try{c=KT.find(I=>I===localStorage.getItem("palette:color-format"))??c}catch{}let u=!1,d=!1,p,g=()=>[...IT(r,a,s),l],y=()=>p??aa(g(),c,r),v=()=>p??aa(g(),"Hex"),x=I=>{let[G,te,ie]=e$(I[0],I[1],I[2]);ie&&te&&(r=G),ie&&(a=te),s=ie,l=I[3]},h=I=>{let G=hu(I);return G&&x(G),!!G};h(e.custom.value);let m=v(),b=(I,G)=>{let te=w("div",I);return te.tabIndex=0,te.setAttribute("role","slider"),te.setAttribute("aria-label",G),te.append(w("i")),te},E=b("palette-color__area","Saturation and brightness"),S=b("palette-color__track palette-color__hue","Hue"),A=b("palette-color__track palette-color__alpha","Opacity");S.setAttribute("aria-valuemax","360");for(let I of[E,S,A])I.setAttribute("aria-valuemin","0");E.setAttribute("aria-valuemax","100"),A.setAttribute("aria-valuemax","100");let _=w("span","palette-color__chip");_.setAttribute("aria-hidden","true");let T=w("div","palette-color__tools"),H=globalThis.EyeDropper;if(H&&isSecureContext){let I=w("button","palette-color__drop");I.type="button",I.title="Pick from screen",I.setAttribute("aria-label","Pick color from screen"),I.innerHTML=uI,I.onclick=async()=>{try{let{sRGBHex:G}=await new H().open();o.isConnected&&h(G)&&q(!0)}catch{}},T.append(I)}T.append(_);let R=w("div","palette-color__sliders");R.append(S,A);let z=w("div","palette-color__row");z.append(T,R);let F=w("select");F.setAttribute("aria-label","Color format");for(let I of KT)F.append(new Option(I,I));let B=w("div","palette-color__channels"),le=w("div","palette-color__value");le.append(F,B);let J=w("div","palette-color__swatches"),V=w("div","palette-color__match");V.hidden=!0,o.append(i,E,z,le,J,V);let oe;function ue(I){let G=g(),[te,ie,pe]=G,xe=`rgb(${si(te)} ${si(ie)} ${si(pe)})`;o.style.setProperty("--hue",`hsl(${si(r)} 100% 50%)`),o.style.setProperty("--solid",xe),o.style.setProperty("--color",aa(G,"RGB"));let L=(ae,we,Te=50)=>{let $=ae.firstElementChild;$.style.left=`${we}%`,$.style.top=`${Te}%`};L(E,a*100,100-s*100),L(S,r/3.6),L(A,l*100),E.setAttribute("aria-valuenow",String(ra(a))),E.setAttribute("aria-valuetext",`Saturation ${ra(a)}%, brightness ${ra(s)}%`),S.setAttribute("aria-valuenow",String(si(r))),S.setAttribute("aria-valuetext",`Hue ${si(r)}\xB0`),A.setAttribute("aria-valuenow",String(ra(l))),A.setAttribute("aria-valuetext",`Opacity ${ra(l)}%`),F.value=c;let Q=t$(G,c,[r,a,s]);B.dataset.format!==c&&Y(),B.querySelectorAll("input").forEach((ae,we)=>{let Te=c==="CSS"?y():Q[we];if(ae===I||ae.value===Te)return;let{selectionStart:$,selectionEnd:D}=ae;ae.value=Te,ae.removeAttribute("aria-invalid"),$!==null&&ae===ae.getRootNode().activeElement&&ae.setSelectionRange($,D)});let Z=r$(G,e.tokens,n);if(V.hidden=!Z,Z&&Z!==oe){oe=Z;let ae=Z.label||Z.path;V.replaceChildren(w("span","",`Matches ${ae}`),Object.assign(w("button","","Use it"),{type:"button",onclick:()=>t.token(Z)})),V.lastElementChild.setAttribute("aria-label",`Use token ${ae}`)}}function q(I,G){if(!d){if(u=!0,G||(p=void 0),ue(G===!0?void 0:G),!I)return t.preview(y());v()!==m&&(t.commit(y()),i$(aa(g(),"Hex"))),m=v()}}function Y(){B.dataset.format=c,B.replaceChildren(...qT[c].map((I,G)=>{let te=w("label"),ie=w("span","",c==="Hex"?G?"%":"#":c==="CSS"?"":I[0]),pe=w("input");pe.setAttribute("aria-label",c==="Hex"&&G?"Opacity":I),pe.spellcheck=!1,pe.autocomplete="off";let xe=c!=="CSS"&&!(c==="Hex"&&!G);xe&&(pe.inputMode="decimal");let L=Z=>{if(c==="CSS"){let fe=!!Z.trim()&&!!globalThis.CSS?.supports?.(n,Z)&&!/[{};]/.test(Z);return fe&&(p=Z.trim(),h(Z)),fe}if(!xe){let fe=l,ye=/^[\da-f]{3}([\da-f]{3})?$/i.test(Z.trim())&&h(Z);return l=fe,ye}let ae=Number(Z);if(Z.trim()===""||!Number.isFinite(ae))return!1;let we=[...B.querySelectorAll("input")].map(fe=>Number(fe===pe?ae:fe.value)),[Te,$,D]=we,j=Eo(we[we.length-1],0,100)/100;if(c==="Hex")return l=j,!0;let X=[Eo(Te,0,QO[qT[c][0]]),Eo($,0,c==="RGB"?255:100),Eo(D,0,c==="RGB"?255:100)];return c==="HSB"?[r,a,s]=[X[0]%360,X[1]/100,X[2]/100]:(x([...c==="RGB"?X:GT(X[0]%360,X[1]/100,X[2]/100),1]),c==="HSL"&&(r=X[0]%360)),l=j,!0};pe.oninput=()=>{u=!0;let Z=L(pe.value);pe.setAttribute("aria-invalid",String(!Z)),Z&&q(!1,pe)},pe.onkeydown=Z=>{Z.key==="Enter"?(Z.preventDefault(),Z.stopPropagation(),pe.getAttribute("aria-invalid")!=="true"&&q(!0,!0)):xe&&(Z.key==="ArrowUp"||Z.key==="ArrowDown")&&(Z.preventDefault(),Q((Z.key==="ArrowUp"?1:-1)*(Z.shiftKey?10:1),!0))},pe.onblur=()=>{pe.getAttribute("aria-invalid")!=="true"&&v()!==m&&q(!0,!0)},pe.onpaste=Z=>{let ae=Z.clipboardData?.getData("text")??"",we=hu(ae);!we||!xe&&/^#?[\da-f]{6}$/i.test(ae.trim())||(Z.preventDefault(),c==="CSS"?p=ae.trim():x(we),q(!0,c==="CSS"||void 0))};let Q=(Z,ae)=>{let we=Number(pe.value)||0,Te=c==="Hex"||G===qT[c].length-1?100:QO[I]??(c==="RGB"?255:100);pe.value=String(Eo(si(we+Z),0,Te)),L(pe.value)&&q(ae)};return xe&&(ie.title=`${I} \xB7 drag to adjust`,ie.onpointerdown=Z=>{Z.preventDefault(),ie.setPointerCapture?.(Z.pointerId);let ae=Z.clientX;ie.onpointermove=we=>{let Te=Math.trunc((we.clientX-ae)/2);Te&&(ae+=Te*2,Q(Te*(we.shiftKey?10:1),!1))},ie.onpointerup=ie.onpointercancel=()=>{ie.onpointermove=null,q(!0)}}),te.append(ie,pe),te}))}F.onchange=()=>{c=F.value,p=void 0;try{localStorage.setItem("palette:color-format",c)}catch{}ue()};let W=(I,G,te)=>{let ie=pe=>{let xe=I.getBoundingClientRect();G(Eo((pe.clientX-xe.left)/xe.width,0,1),Eo((pe.clientY-xe.top)/xe.height,0,1)),q(!1)};I.onpointerdown=pe=>{pe.button||(pe.preventDefault(),I.focus({preventScroll:!0,focusVisible:!1}),I.setPointerCapture?.(pe.pointerId),ie(pe),I.onpointermove=ie,I.onpointerup=I.onpointercancel=()=>{I.onpointermove=null,q(!0)})},I.onkeydown=pe=>{te(pe.key,pe.shiftKey?10:1)&&(pe.preventDefault(),pe.stopPropagation(),q(!0))}};W(E,(I,G)=>{a=I,s=1-G},(I,G)=>{let te=G/100;if(I==="ArrowLeft"||I==="ArrowRight")a=Eo(a+(I==="ArrowRight"?te:-te),0,1);else if(I==="ArrowUp"||I==="ArrowDown")s=Eo(s+(I==="ArrowUp"?te:-te),0,1);else if(I==="Home"||I==="End")a=I==="End"?1:0;else if(I==="PageUp"||I==="PageDown")s=Eo(s+(I==="PageUp"?.1:-.1),0,1);else return!1;return!0});let C=(I,G,te)=>(ie,pe)=>{let xe=ie==="Home"?0:ie==="End"?te:G()+{ArrowRight:pe,ArrowUp:pe,ArrowLeft:-pe,ArrowDown:-pe,PageUp:10,PageDown:-10}[ie];return Number.isNaN(xe)?!1:(I(Eo(xe,0,te)),!0)};W(S,I=>{r=I*360},C(I=>{r=I},()=>r,360)),W(A,I=>{l=I},C(I=>{l=I/100},()=>l*100,100));let U=()=>{let I=YT(),G=new Set(I.map(pe=>pe.toLowerCase())),te=[...I.map(pe=>[pe,"Recent"]),...n$().filter(pe=>!G.has(pe.toLowerCase())).map(pe=>[pe,"Document"])].slice(0,8),ie=w("div");ie.setAttribute("role","group"),ie.setAttribute("aria-label","Recent and page colors"),ie.append(...te.map(([pe,xe])=>{let L=w("button");return L.type="button",L.title=pe,L.setAttribute("aria-label",`${xe} color ${pe}`),L.style.setProperty("--color",pe),L.onclick=()=>{h(pe)&&q(!0)},L})),J.replaceChildren(...te.length?[ie]:[]),J.hidden=!te.length};return setTimeout(()=>{o.isConnected&&U()},16),ue(),Object.assign(o,{live:!0,destroy(){d=!0},refresh(I){u||!h(I)||(m=v(),ue())}})}var KT,Eo,si,ra,a0,JO,ZO,qT,QO,o$,dI,uI,WT=O(()=>{"use strict";It();lc();KT=["Hex","RGB","HSL","HSB","CSS"],Eo=(e,t,n)=>Math.min(n,Math.max(t,e)),{round:si}=Math,ra=e=>si(e*100),a0=e=>si(e).toString(16).padStart(2,"0");JO=(e,t,n,o,i)=>i?60*(o===e?((t-n)/i+6)%6:o===t?(n-e)/i+2:(e-t)/i+4):0;ZO=(e,t=!1)=>e<1?`${t?",":" /"} ${ra(e)}%`:"";qT={Hex:["Hex","Opacity"],RGB:["Red","Green","Blue","Opacity"],HSL:["Hue","Saturation","Lightness","Opacity"],HSB:["Hue","Saturation","Brightness","Opacity"],CSS:["CSS color"]},QO={Red:255,Green:255,Blue:255,Hue:360};o$=()=>`palette:colors:${document.querySelector("[data-branch-comments]")?.getAttribute("data-branch-comments")||location.host}`;dI=`.palette-color{display:grid;gap:8px;padding:8px}.palette-color__area{position:relative;aspect-ratio:4/3;border-radius:6px;background:linear-gradient(to top,#000,#0000),linear-gradient(to right,#fff,#0000),var(--hue);cursor:crosshair;touch-action:none}.palette-color__area>i,.palette-color__track>i{position:absolute;width:12px;height:12px;box-sizing:border-box;border:2px solid #fff;border-radius:50%;box-shadow:0 0 0 1px #0006,inset 0 0 0 1px #0004;translate:-50% -50%;pointer-events:none}.palette-color__row{display:flex;align-items:center;gap:8px}.palette-color__tools{display:flex;align-items:center;gap:4px}.palette-color__sliders{display:grid;flex:1;gap:8px;min-width:0}.palette-color__track{position:relative;height:10px;border-radius:5px;cursor:pointer;touch-action:none}.palette-color__track>i{top:50%;width:14px;height:14px}.palette-color__hue{background:linear-gradient(to right,red,#ff0,lime,cyan,blue,#f0f,red)}.palette-color__alpha,.palette-color__chip,.palette-color__swatches button{background:linear-gradient(var(--color),var(--color)),repeating-conic-gradient(#ffffff40 0 25%,#ffffff12 0 50%) 0 0/8px 8px}.palette-color__alpha{background:linear-gradient(to right,#0000,var(--solid)),repeating-conic-gradient(#ffffff40 0 25%,#ffffff12 0 50%) 0 0/8px 8px}.palette-color__chip{width:20px;height:20px;border-radius:5px;box-shadow:inset 0 0 0 1px #ffffff26}.palette-color__drop{display:grid;place-items:center;width:24px;height:24px;padding:0;border:0;border-radius:5px;background:none;color:#b5b1ab;cursor:pointer}.palette-color__drop:hover{background:#ffffff14;color:#f1efeb}.palette-color__drop svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}.palette-color__value{display:flex;gap:4px;min-width:0}.palette-color__value select{flex:none;width:64px;height:24px;padding:0 16px 0 6px;border:0;border-radius:5px;box-shadow:none;appearance:none;background:#ffffff0a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 3 4 5.5 6.5 3' fill='none' stroke='%23898680' stroke-width='1.2'/%3E%3C/svg%3E") right 5px center/8px no-repeat;color:#f1efeb;font:inherit;cursor:pointer}.palette-color__channels{display:flex;flex:1;min-width:0;border-radius:5px;background:#ffffff0a}.palette-color__channels label{display:flex;flex:1;align-items:center;min-width:0}.palette-color__channels label:first-child{flex:2.2}.palette-color__channels[data-format=RGB] label:first-child,.palette-color__channels[data-format=HSL] label:first-child,.palette-color__channels[data-format=HSB] label:first-child{flex:1}.palette-color__channels span{flex:none;width:12px;color:#77736f;font-size:9px;text-align:center;cursor:ew-resize;user-select:none;touch-action:none}.palette-color__channels span:hover{color:#e9e6e1}.palette-color__channels input{width:100%;min-width:0;height:24px;box-sizing:border-box;padding:0 2px;border:0;border-radius:0;outline:0;box-shadow:none;background:none;color:#f1efeb;font:inherit;font-variant-numeric:tabular-nums}.palette-color__channels input:focus,.palette-color__channels input:focus-visible{outline:0;box-shadow:none}.palette-color__channels:hover{box-shadow:inset 0 0 0 1px #ffffff1c}.palette-color__channels:focus-within{box-shadow:inset 0 0 0 1px #bda6ef}.palette-color__channels [aria-invalid=true]{color:#f8a898}.palette-tokens .palette-color small{position:static;display:block;margin:2px 0 4px;padding:0;background:none;color:#77736f;font-size:10px}.palette-color__swatches>div{display:flex;gap:4px;overflow:hidden}.palette-color__swatches button{width:16px;height:16px;padding:0;border:0;border-radius:4px;box-shadow:inset 0 0 0 1px #ffffff26;cursor:pointer}.palette-color__match{display:flex;align-items:center;gap:6px;color:#b5b1ab;font-size:10px}.palette-color__match span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.palette-color__match button{padding:0;border:0;background:none;color:#bda6ef;font:inherit;cursor:pointer}.palette-color [role=slider]:focus-visible,.palette-color button:focus-visible{outline:1px solid #bda6ef;outline-offset:2px}.palette-color select:focus-visible{outline:0;box-shadow:inset 0 0 0 1px #bda6ef}@media (pointer:coarse){.palette-color__track{height:16px}.palette-color__value select,.palette-color__channels input{height:32px}.palette-color__swatches button{width:24px;height:24px}}`,uI='<svg viewBox="0 0 16 16" aria-hidden="true"><path d="m9.5 3.5 3 3M11 2a1.4 1.4 0 0 1 2 2l-1.5 1.5-2-2zM10 5 4 11l-1 3 3-1 6-6"/></svg>'});function fI(e,t="box-shadow"){if(e==="none")return[];let n=[];for(let o of gu(e,!0)){let i=gu(o),r=[],a="",s=!1,l=!1;for(let c of i){if(c==="inset"&&t==="box-shadow"&&!s){s=!0;continue}if(bu.test(c)){if(l)return;r.push(c)}else if(!a&&!/var\(/i.test(c)&&CSS.supports("color",c))a=c,l=r.length>0;else return}if(r.length<2||r.length>(t==="box-shadow"?4:3))return;n.push({lengths:r,color:a,inset:s})}return n.length?n:void 0}function pm(e){return e.filter(t=>!t.hidden).map(t=>[...t.inset?["inset"]:[],...t.lengths,t.color].filter(Boolean).join(" ")).join(", ")||"none"}function mI(e){let t=document.createElement("i").style;t.color=e.trim(),t.color&&(e=t.color);let n=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:\s*[,/]\s*([\d.]+)(%?))?\s*\)$/i.exec(e.trim());if(!n)return e||"currentColor";let o=`#${n.slice(1,4).map(r=>Math.round(Number(r)).toString(16).padStart(2,"0")).join("")}`,i=n[4]===void 0?1:Number(n[4])/(n[5]?100:1);return i<1?`${o} \xB7 ${Math.round(i*100)}%`:o}function JT(e){let t=gI.exec(e);if(!t)return;let n=t[1].trim().split(/\s+/).filter(Boolean);return{style:n.filter(o=>/^(italic|oblique|small-caps)$/i.test(o)).join(" "),weight:n.find(o=>/^(bold|bolder|lighter|[1-9]00)$/i.test(o))??"",size:t[2],lineHeight:t[3]??"",family:t[4]??""}}function ZT(e){return[e.style,e.weight,e.size+(e.lineHeight?`/${e.lineHeight}`:""),e.family].filter(Boolean).join(" ")}function hI(e,t){let n=bu.exec(e.trim());if(!n)return e;let o=!n[2]||/^r?em$/i.test(n[2]);return`${Math.round((parseFloat(n[1])+t*(o?.1:1))*1e3)/1e3}${n[2]}`}function QT(e,t,n,o){let i=w("button","palette-typed__icon");return i.type="button",i.innerHTML=t,i.title=e,i.setAttribute("aria-label",e),o!==void 0&&i.setAttribute("aria-pressed",String(o)),i.onclick=n,i}function s0(e,t,n,o,i,{unitless:r=!1,optional:a=!1}={}){let s=w("div","palette-typed__field"),l=w("span");t?l.textContent=t:l.innerHTML=wI,l.title=`${e} \xB7 drag to adjust`;let c=w("input");c.setAttribute("aria-label",e),c.inputMode="decimal",c.autocomplete="off",c.spellcheck=!1;let u=w("select");u.setAttribute("aria-label",`${e} unit`);let d=bu.exec(n)??["","",""];c.value=d[1];let p=d[2]||(r||!d[1]&&a?"":"px");for(let x of new Set([p,...bI,...r?[""]:[]])){let h=w("option","",x||"\u2014");h.value=x,x||(h.title="No unit"),u.append(h)}u.value=p;let g=!1,y=x=>{let h=a&&!c.value.trim(),m=h||bu.test(c.value.trim()+u.value);m?i.delete(c):i.add(c);let b=m&&o(h?"":c.value.trim()+u.value,x);return c.setAttribute("aria-invalid",String(!m)),x&&(g=!1),b},v=(x,h)=>{let m=bu.exec(hI(c.value.trim()+u.value,x));m&&(c.value=m[1],y(h))};return c.oninput=()=>{g=!0,y(!1)},c.onkeydown=x=>{x.key==="Enter"?(x.preventDefault(),x.stopPropagation(),y(!0)):(x.key==="ArrowUp"||x.key==="ArrowDown")&&(x.preventDefault(),v((x.key==="ArrowUp"?1:-1)*(x.shiftKey?10:1),!0))},c.onblur=()=>{g&&y(!0)},u.onchange=()=>y(!0),l.onpointerdown=x=>{if(x.button)return;x.preventDefault(),l.setPointerCapture?.(x.pointerId);let h=x.clientX,m=!1;l.onpointermove=b=>{let E=Math.trunc((b.clientX-h)/2);E&&(h+=E*2,m=!0,v(E*(b.shiftKey?10:1),!1))},l.onpointerup=l.onpointercancel=()=>{l.onpointermove=l.onpointerup=l.onpointercancel=null,m?y(!0):c.focus()}},s.append(l,c,u),s}function s$(e,t,n,o,i,r,a=[],s=()=>{}){let l=w("div","palette-typed"),c=w("details","palette-typed palette-typed__advanced"),u=w("summary","","Edit as CSS");u.onclick=x=>{x.preventDefault(),x.stopPropagation(),c.open=!c.open};let d=w("div","palette-typed__field");o.title=t,o.autocomplete="off",o.spellcheck=!1,d.append(w("span","","CSS"),o),c.append(u,d),e.append(l,c);let p=!1,g=new Set;o.oninput=()=>{p=!0,i(o.value,!1)&&v(o.value,!0)},o.onkeydown=x=>{x.key==="Enter"&&(x.preventDefault(),x.stopPropagation(),p=!1,i(o.value,!0))},o.onblur=()=>{p&&(p=!1,i(o.value,!0))};let y=(x,h,m,b,E,S)=>{let A=w("select","palette-typed__menu");A.setAttribute("aria-label",x);for(let[_,T]of h){let H=w("option","",T);H.value=_,H.title=_,S&&_&&(H.style[S]=_),A.append(H)}return A.value=m,A.onchange=()=>b(A.value),E&&A.addEventListener("palette-preview",_=>{let T=_.detail;s(T===null?void 0:E(T))}),A};function v(x,h=!1){if(h||(o.value=x),g.clear(),l.replaceChildren(),t==="font-family"){let m=w("div","palette-typed__sample"),b=w("b","","Aa"),E=w("span","",Qs(x));m.title=x,b.style.fontFamily=x,m.append(b,E),l.append(m);let S=a.filter(A=>A.type==="fontFamily"&&A.value&&CSS.supports(t,A.value));S.length?l.append(y("Font family choices",[[x,`Custom \xB7 ${Qs(x)}`],...S.map(A=>[A.value,A.label||Qs(A.value)])],x,A=>{i(A,!0)&&v(A)},A=>A,"fontFamily")):c.open=!0}else if(/^(box|text)-shadow$/.test(t)){let m=fI(x,t);if(!m){l.append(w("span","palette-typed__hint","Complex shadow \xB7 edit it as CSS below.")),c.open=!0;return}let b=t==="box-shadow",E=w("div","palette-typed__tile"),S=w("i","",b?"":"Ag");E.setAttribute("aria-hidden","true"),E.append(S);let A=T=>(S.style.setProperty(t,pm(m)),i(pm(m),T));S.style.setProperty(t,pm(m));let _=w("div","palette-typed__head");_.append(w("b","","Layers"),QT("Add shadow layer",vI,()=>{m.push({lengths:["0px","2px","4px","0px"].slice(0,b?4:3),color:"#00000040",inset:!1}),A(!0)&&v(pm(m))})),l.append(E,_),m.forEach((T,H)=>{let R=`Layer ${H+1}`,z=w("div","palette-typed__layer");z.setAttribute("role","group"),z.setAttribute("aria-label",`Shadow layer ${H+1}`),z.toggleAttribute("data-hidden",!!T.hidden);let F=w("div","palette-typed__row");b&&F.append(y(`${R} type`,[["drop","Drop"],["inner","Inner"]],T.inset?"inner":"drop",C=>{T.inset=C==="inner",A(!0)}));let B=w("button","palette-typed__color");B.type="button",B.setAttribute("aria-label",`${R} color`),B.setAttribute("aria-expanded","false");let le=w("i"),J=w("span"),V=w("span","palette-typed__alpha");B.append(le,J,V);let oe=()=>{let[C,U="100%"]=mI(T.color).split(" \xB7 ");le.style.setProperty("--c",T.color||"currentColor"),J.textContent=C.replace(/^#/,"").toUpperCase(),V.textContent=T.color?U:"",B.title=T.color||"currentColor"};oe();let ue;B.onclick=async()=>{if(ue){ue.remove(),ue=void 0,B.setAttribute("aria-expanded","false");return}B.setAttribute("aria-expanded","true");let{pickerEditor:C}=await Promise.resolve().then(()=>(WT(),XT));!B.isConnected||ue||(ue=C({trigger:B,tokens:a,property:"color",onSelect(){},custom:{value:T.color||"#000000",onPreview:()=>()=>{},onSelect(){}}},{preview(U){T.color=U,oe(),A(!1)},commit(U){T.color=U,oe(),A(!0)},token(U){T.color=U.value,oe(),A(!0)}}),z.append(ue))};let q=QT(`${R} visible`,yI,()=>{T.hidden=!T.hidden,q.setAttribute("aria-pressed",String(!T.hidden)),z.toggleAttribute("data-hidden",!!T.hidden),A(!0)},!T.hidden);F.append(B,q,QT(`Remove layer ${H+1}`,xI,()=>{m.splice(H,1),A(!0)&&v(pm(m))}));let Y=w("div","palette-typed__grid");[["X offset","X"],["Y offset","Y"],["Blur","Blur"],["Spread","Spread"]].slice(0,b?4:3).forEach(([C,U],I)=>Y.append(s0(`${R} ${C.toLowerCase()}`,U,T.lengths[I]||"0px",(G,te)=>{for(;T.lengths.length<=I;)T.lengths.push("0px");return T.lengths[I]=G,!g.size&&A(te)},g))),z.append(F,Y),l.append(z)})}else if(t==="font"){let m=JT(x);if(!m){l.append(w("span","palette-typed__hint","Custom expression \xB7 edit it as CSS below.")),c.open=!0;return}let b=w("div","palette-typed__sample"),E=w("b","","Aa"),S=w("span");b.setAttribute("aria-hidden","true"),b.append(E,S);let A=()=>{Object.assign(E.style,{fontStyle:m.style,fontWeight:m.weight,fontFamily:m.family}),S.textContent=[m.family?Qs(m.family):"Inherited family",m.weight,m.size+(m.lineHeight?`/${m.lineHeight}`:"")].filter(Boolean).join(" \xB7 ")},_=R=>(A(),i(ZT(m),R));A();let T=a.filter(R=>R.type==="fontFamily"&&R.value&&CSS.supports("font-family",R.value)&&R.value!==m.family),H=w("div","palette-typed__grid palette-typed__font");H.append(y("Font weight",[...new Set([m.weight||"400","100","200","300","400","500","600","700","800","900"])].map(R=>[R,R]),m.weight||"400",R=>{m.weight=R,_(!0)},R=>ZT({...m,weight:R}),"fontWeight"),s0("Font size","Size",m.size,(R,z)=>(m.size=R,!g.size&&_(z)),g),s0("Line height","LH",m.lineHeight,(R,z)=>(m.lineHeight=R,!g.size&&_(z)),g,{unitless:!0,optional:!0})),l.append(b,y("Font family",[[m.family,m.family?Qs(m.family):"Inherited family"],...T.map(R=>[R.value,R.label||Qs(R.value)])],m.family,R=>{m.family=R,_(!0)},R=>ZT({...m,family:R}),"fontFamily"),H)}else if(r?.values?.length)l.append(y(r.label,[...new Set([x,...r.values])].map(m=>[m,m]),x,m=>i(m,!0),m=>m));else{let m=gu(x),b=/^(padding|margin|border-(width|radius)|gap)$/.test(t);if(m.length&&m.every(E=>bu.test(E))&&(m.length===1||b&&m.length<=4)){let E=r?.label||t,S=m.length===1?[[E,""]]:t==="gap"?[["Row gap","Row"],["Column gap","Col"]]:t==="border-radius"?[["Top left","TL"],["Top right","TR"],["Bottom right","BR"],["Bottom left","BL"]]:[["Top","T"],["Right","R"],["Bottom","B"],["Left","L"]];if(m.length>1&&t!=="gap"){let[_,T=_,H=_,R=T]=m;m.splice(0,m.length,_,T,H,R)}let A=m.map((_,T)=>s0(S[T][0],S[T][1],_,(H,R)=>(m[T]=H,!g.size&&i(m.join(" "),R)),g));if(A.length>1){let _=w("div","palette-typed__grid");_.append(...A),l.append(_)}else l.append(...A)}else l.append(w("span","palette-typed__hint","Custom expression \xB7 preserved exactly below.")),c.open=!0}}return v(n),v}var bu,gI,a$,bI,yI,xI,vI,wI,l$=O(()=>{"use strict";OT();It();bu=/^([+-]?(?:\d*\.)?\d+)([a-z%]*)$/i;gI=/^\s*((?:(?:italic|oblique|normal|small-caps|bold|bolder|lighter|[1-9]00)\s+)*)([+-]?(?:\d*\.)?\d+[a-z%]*)(?:\s*\/\s*((?:\d*\.)?\d+[a-z%]*|normal))?(?:\s+([\s\S]+?))?\s*$/i;a$=`.palette-custom{display:flex;flex:1;flex-direction:column;min-height:0}.palette-custom__body{display:grid;gap:8px;padding:8px;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}.palette-typed{display:grid;gap:6px;min-width:0}.palette-typed__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.palette-typed__field,.palette-typed__color,.palette-typed__menu{display:flex;align-items:center;box-sizing:border-box;width:100%;min-width:0;height:28px;border-radius:6px;background:#ffffff0a;box-shadow:none;color:#f1efeb;font:inherit;font-size:11px}.palette-typed__field:hover,.palette-typed__color:hover,.palette-typed__menu:hover{box-shadow:inset 0 0 0 1px #ffffff1c}.palette-typed__field:focus-within,.palette-typed__color:focus-visible,.palette-typed__menu:focus-visible{outline:0;box-shadow:inset 0 0 0 1px #bda6ef}.palette-typed__field>span{flex:none;display:grid;place-items:center;min-width:24px;height:100%;padding:0 2px 0 6px;color:#77736f;font-size:10px;font-weight:500;cursor:ew-resize;user-select:none;touch-action:none}.palette-typed__field>span:hover{color:#e9e6e1}.palette-typed__field>span svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.1}.palette-typed__field input{flex:1;width:100%;min-width:0;height:100%;margin:0;padding:0 2px;border:0;border-radius:0;outline:0;box-shadow:none;background:none;color:inherit;font:inherit;font-variant-numeric:tabular-nums}.palette-typed__field input:focus,.palette-typed__field input:focus-visible,.palette-typed__field select:focus,.palette-typed__field select:focus-visible{outline:0;box-shadow:none}.palette-typed__field select{flex:none;width:auto;max-width:44px;height:100%;margin:0;padding:0 8px 0 2px;border:0;border-radius:0 6px 6px 0;box-shadow:none;appearance:none;background:none;color:#77736f;font:inherit;font-size:10px;text-align:right;cursor:pointer}.palette-typed__field select:hover{color:#f1efeb}.palette-typed__menu{padding:0 20px 0 8px;border:0;appearance:none;background:#ffffff0a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 3 4 5.5 6.5 3' fill='none' stroke='%23898680' stroke-width='1.2'/%3E%3C/svg%3E") right 7px center/8px no-repeat;cursor:pointer}.palette-typed [aria-invalid=true]{color:#f8a898}.palette-typed__layer{display:grid;gap:6px}.palette-typed__layer[data-hidden] .palette-typed__grid{opacity:.45}.palette-typed__row{display:flex;align-items:center;gap:4px;min-width:0}.palette-typed__row>.palette-typed__menu{flex:none;width:64px}.palette-typed__row>.palette-typed__color{flex:1;gap:6px;padding:0 6px}.palette-typed__color .palette-typed__alpha{flex:none;margin-left:auto;color:#898680;font-size:10px}.palette-typed button.palette-typed__icon{display:grid;place-items:center;flex:none;width:24px;padding:0}.palette-typed__icon svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}.palette-typed__tile{display:grid;place-items:center;height:56px;border-radius:6px;background:repeating-conic-gradient(#ffffff0a 0 25%,#ffffff04 0 50%) 0 0/12px 12px}.palette-typed__tile i{display:grid;place-items:center;width:32px;height:32px;border-radius:6px;background:#f1efeb;color:#f1efeb;font-style:normal;font-size:20px;font-weight:600}.palette-typed__tile i:not(:empty){width:auto;height:auto;background:none}.palette-typed__layer+.palette-typed__layer{padding-top:8px;border-top:1px solid #ffffff0d}.palette-typed__head{display:flex;align-items:center;gap:2px;min-height:24px}.palette-typed__head b{flex:1;color:#b5b1ab;font-size:10px;font-weight:500}.palette-typed button:not(.palette-typed__color,.palette-color *){height:24px;padding:0 8px;border:0;border-radius:5px;background:none;color:#898680;font:inherit;font-size:10px;cursor:pointer}.palette-typed button:not(.palette-typed__color,.palette-color *):hover{background:#ffffff14;color:#f1efeb}.palette-typed button[aria-pressed=true]{background:#bda6ef24;color:#e6dcfb}.palette-typed button:focus-visible{outline:1px solid #bda6ef;outline-offset:-1px}.palette-typed__color{gap:8px;padding:0 8px;border:0;justify-content:flex-start;text-align:left;font-variant-numeric:tabular-nums;cursor:pointer}.palette-typed__color i{flex:none;width:14px;height:14px;border-radius:3px;box-shadow:inset 0 0 0 1px #ffffff26;background:linear-gradient(var(--c),var(--c)),repeating-conic-gradient(#ffffff40 0 25%,#ffffff12 0 50%) 0 0/8px 8px}.palette-typed__color span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.palette-typed .palette-color{padding:0}.palette-typed__sample{display:flex;align-items:center;gap:8px;min-width:0;height:36px;padding:0 8px;border-radius:6px;background:#ffffff08}.palette-typed__sample b{flex:none;font-size:20px;font-weight:400}.palette-typed__sample span{overflow:hidden;color:#b5b1ab;text-overflow:ellipsis;white-space:nowrap}.palette-typed__hint{color:#898680;font-size:10px;line-height:1.5}.palette-custom .palette-typed__advanced>summary{display:flex;align-items:center;height:auto;min-height:24px;color:#77736f;font-size:10px;font-weight:500;list-style:none;cursor:pointer}.palette-typed__advanced>summary::-webkit-details-marker{display:none}.palette-custom .palette-typed__advanced>summary:hover{color:#e9e6e1}.palette-typed__advanced>summary:focus-visible{outline:1px solid #bda6ef;outline-offset:-1px;border-radius:4px}@media (max-width:520px){.palette-typed__font{grid-template-columns:minmax(0,1fr)}}@media (pointer:coarse){.palette-typed__field,.palette-typed__color,.palette-typed__menu{height:36px}.palette-typed button:not(.palette-typed__color,.palette-color *){height:32px}}`,bI=["px","%","rem","em","vw","vh","ch","vmin","vmax","dvh"],yI='<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M1.5 8s2.4-4.5 6.5-4.5S14.5 8 14.5 8 12.1 12.5 8 12.5 1.5 8 1.5 8Z"/><circle cx="8" cy="8" r="2"/></svg>',xI='<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8h9"/></svg>',vI='<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 3.5v9M3.5 8h9"/></svg>';wI='<svg viewBox="0 0 12 12" aria-hidden="true"><path d="M1 6h10M3 4 1 6l2 2M9 4l2 2-2 2"/></svg>'});var c$={};Ft(c$,{pickerEditor:()=>EI});function EI(e,t){let{property:n}=e,o=e.custom.value,i=w("div","palette-custom"),r=w("div","palette-custom__body"),a=w("input");a.value=o,a.setAttribute("aria-label","CSS value");let s=!1,l=!1,c=(d,p)=>{if(l)return!1;s=!0;let g=!!d.trim()&&(CSS.supports(n,d)||n==="font"&&!!JT(d))&&!/[{};]/.test(d);return a.setAttribute("aria-invalid",String(!g)),g?(a!==a.getRootNode().activeElement&&(a.value=d),p?t.commit(d):t.preview(d),!0):!1};i.append(w("style","",a$),r);let u=s$(r,n,o,a,c,e.custom?.field,e.tokens,d=>{l||t.hover?.(d)});return Object.assign(i,{live:!0,destroy(){l=!0},refresh(d){if(s)return;let{selectionStart:p,selectionEnd:g}=a;u(d),p!==null&&g!==null&&a.setSelectionRange(p,g)}})}var d$=O(()=>{"use strict";l$();It()});var n2={};Ft(n2,{openTokenPicker:()=>LI,refreshTokenPicker:()=>CI,stylePicker:()=>g$,tokenLabel:()=>t2,tokenPreview:()=>f$});function t2(e){return e.label||e.path.slice(e.path.lastIndexOf(".")+1)||e.path}function AI(e){let t=/^(-?[\d.]+)(px|r?em)?$/.exec(e.trim());return t?parseFloat(t[1])*(t[2]?t[2]==="px"?1:16:1):void 0}function f$(e){let t=w("span","palette-tokens__pv");t.setAttribute("aria-hidden","true");let n=r=>{let a=w("span",`palette-tokens__${r}`);return t.append(a),a},o=e.value??"",{type:i}=e;if(i==="color"){let r=n("sw"),a=w("span");m$(o)?a.style.background=o:(a.dataset.unresolved="",a.textContent="?"),r.append(a)}else if(i==="dimension"||i==="letterSpacing"){let r=AI(o);if(r===void 0)return t;let a=/radius/.test(`${e.path} ${e.properties?.join(" ")}`),s=n(a?"corner":"dim");a?s.style.borderTopLeftRadius=`${fm(r,0,12)}px`:s.style.width=`${fm(r/2,2,24)}px`}else if(i==="shadow")n("shadow").style.boxShadow=o;else if(i==="typography"||i==="fontWeight"||i==="fontFamily"){let r=n("ag");r.textContent="Ag",i==="typography"?(r.style.font=o,r.style.fontSize="13px",r.style.lineHeight="1"):i==="fontWeight"?r.style.fontWeight=o:r.style.fontFamily=o}return t}function m$(e){if(!e||/var\(/i.test(e))return!1;let t=w("span").style;return t.color=e,!!t.color}function MI(e,t,n,o){let i=w("div");i.id=t,i.setAttribute("role","option"),i.setAttribute("aria-selected",String(n));let r=w("span","palette-tokens__name"),a=w("span","",t2(e));r.append(a);let s=w("span","palette-tokens__check");s.setAttribute("aria-hidden","true");let l=e.type==="color"&&!m$(e.value),c=o.flatMap(p=>{let g=p.values.get(e.path);return g&&e.type==="color"?[`${p.label} ${g}`]:[]}),u=c.length>1?c.join(", "):e.value??"",d=w("span","palette-tokens__sub",[e.path,u].filter(Boolean).join(" \xB7 "));return d.setAttribute("aria-hidden","true"),i.append(f$(e),r,s,d),i.setAttribute("aria-label",[e.label,em(e,u,l?"Unresolved; no swatch available":"")].filter(Boolean).join(" \xB7 ")),i}function g$(e){let t=e.getRootNode();if((t instanceof ShadowRoot||t===document)&&!p$.has(t)){p$.add(t);let n=w("style");n.textContent=Ry+kI+SI,(t instanceof ShadowRoot?t:document.head).append(n)}return t}function CI(e,t){sa?.trigger===e&&sa.refresh(t)}function LI(e,t=!1){let n=e.trigger.dataset.start;if(delete e.trigger.dataset.start,t&&sa?.trigger===e.trigger)return sa.close(!0);sa?.close();let{trigger:o,property:i}=e,r=e.tokens,a=g$(o),s=`palette-tokens-${++TI}`,l=/color|^(fill|stroke)$/.test(i),c=w("div","palette-tokens");c.id=`${s}-popup`,c.setAttribute("role","dialog"),c.setAttribute("aria-label",`Edit ${i}`);let u=w("div","palette-tokens__head"),d=w("button","palette-tokens__back");d.type="button",d.setAttribute("aria-label","Back to tokens"),d.innerHTML='<svg viewBox="0 0 12 12" aria-hidden="true"><path d="M7.5 2.5 4 6l3.5 3.5"/></svg>';let p=w("span","",e.title||e.custom?.field?.label||u$[i]||i);u.append(d,p);let g=w("div","palette-tokens__bar"),y=w("input");y.type="text",y.placeholder="Search tokens",y.autocomplete="off",y.spellcheck=!1,y.setAttribute("role","combobox"),y.setAttribute("aria-expanded","true"),y.setAttribute("aria-controls",s),y.setAttribute("aria-autocomplete","list"),y.setAttribute("aria-label",`Search tokens for ${i}`);let v=w("div","palette-tokens__list");v.id=s,v.tabIndex=0,v.setAttribute("role","listbox"),v.setAttribute("aria-label",`Tokens for ${i}`);let x=Xs(r,i),h=!x.length,m=w("button","palette-tokens__widen");m.type="button",g.append(y);let b=w("button","palette-tokens__more");b.type="button";let E=w("i"),S=w("span");b.append(w("b","","Custom\u2026"),E,S);let A=w("div","palette-tokens__custom");c.append(u,g,v,m,b),e.custom&&c.append(A);let _=()=>new Map(r.map(de=>[de,`${t2(de)} ${de.path} ${de.ref??""} ${de.value??""}`.toLowerCase()])),T=_(),H=[],R=[],z=0,F=-1,B=v,le,J,V=-1,oe=!1,ue=!1,q,Y,W=!1,C=()=>{let de=J;J=void 0,V=-1,de?.()},U=de=>{C(),q=de,J=e.custom?.onPreview(de)},I=()=>{V<0||(C(),q!==void 0&&U(q))},G=()=>!e.custom||!!x.length,te=()=>{let de=G()&&!W,Ae=h||y.value?r:x;v.hidden=g.hidden=!de,y.hidden=!de||!ue&&Ae.length<=8&&!y.value,g.hidden||=y.hidden,m.hidden=!de||!!y.value||!x.length||x.length===r.length,m.textContent=h?"Show relevant tokens":`Show all ${r.length} tokens`,m.setAttribute("aria-pressed",String(h)),b.hidden=!de||!e.custom,A.hidden=de,d.hidden=!W||!G(),p.textContent=W&&G()?l?"Custom colour":"Custom value":e.title||e.custom?.field?.label||u$[i]||i,c.toggleAttribute("data-custom",!de);let ve=e.custom?.value??"",Re=/^rgba?\((\d+)[ ,]+(\d+)[ ,]+(\d+)(?:[ ,/]+([\d.]+))?/.exec(ve);S.textContent=l?Re?Re.slice(1,4).map(Fe=>Number(Fe).toString(16).padStart(2,"0")).join("").toUpperCase()+(Re[4]&&+Re[4]<1?` ${Math.round(+Re[4]*100)}%`:""):ve.replace(/^#/,"").toUpperCase():ve,E.hidden=!l||!ve,E.style.setProperty("--c",ve),b.title=ve},ie=de=>{for(;z<Math.min(de,R.length);z++){let{token:Ae,group:ve}=R[z];if(ve!==le&&(le=ve,B=v,ve)){B=w("div"),B.setAttribute("role","group");let Re=w("small");Re.id=`${s}-g${z}`,Re.textContent=ve,B.setAttribute("aria-labelledby",Re.id),B.append(Re),v.append(B)}B.append(MI(Ae,`${s}-${z}`,Ae.path===e.current,H))}},pe=de=>v.querySelector(`#${s}-${de}`),xe=(de,Ae=!0,ve=!0)=>{if(de<0||de>=R.length)return;if(de!==V&&ve){C(),V=de;let $e=R[de].token;$e.path!==e.current&&(J=e.onPreview?.($e))}ie(de+e2),pe(F)?.removeAttribute("data-active"),F=de;let Re=pe(de);if(Re.toggleAttribute("data-active",!0),y.setAttribute("aria-activedescendant",Re.id),v.setAttribute("aria-activedescendant",Re.id),!Ae)return;let Fe=Re.offsetTop-(Re.parentElement===v?0:Re.parentElement.firstElementChild.offsetHeight),Ye=Re.offsetTop+Re.offsetHeight;Fe<v.scrollTop?v.scrollTop=Fe-4:Ye>v.scrollTop+v.clientHeight&&(v.scrollTop=Ye-v.clientHeight+4)},L=(de=!1,Ae=!1)=>{let ve=Ae?R[F]?.token.path:void 0,Re=v.scrollTop,Fe=Ae?z:e2;V>=0&&C();let Ye=y.value.toLowerCase().split(/\s+/).filter(Boolean),$e=h||Ye.length?r:x,ot=Ye.length?$e.filter(Ht=>Ye.every(pt=>T.get(Ht).includes(pt))):$e,rn=h?ot:[...ot.filter(Ht=>x.includes(Ht)),...ot.filter(Ht=>!x.includes(Ht))],Zt=new Map([["",[]]]);for(let Ht of rn){let pt=Ht.group??"";Zt.set(pt,[...Zt.get(pt)??[],Ht])}if(R=[...[...Zt].flatMap(([Ht,pt])=>pt.map(Qt=>({token:Qt,group:Ht})))],v.replaceChildren(),v.scrollTop=0,z=0,F=-1,le=void 0,y.removeAttribute("aria-activedescendant"),v.removeAttribute("aria-activedescendant"),te(),!R.length){let Ht=w("div","palette-tokens__empty",Ye.length?"No matching tokens":"No tokens");v.append(Ht);return}ie(Fe),xe(Math.max(0,R.findIndex(Ht=>Ht.token.path===ve)),!1,de),Ae&&(v.scrollTop=Re)},Q=new AbortController,{signal:Z}=Q,ae=!!globalThis.matchMedia?.("(pointer:coarse)")?.matches;function we(de=!1,Ae=!1){if(sa?.close!==we)return;sa=void 0;let ve=Y?.live&&q;C(),ve&&!Ae&&(e.custom?.onCommit??e.custom?.onSelect)?.(ve),e.custom?.[Ae?"onCancel":"onDone"]?.(),Q.abort(),Y?.destroy(),c.remove(),o.setAttribute("aria-expanded","false"),o.removeAttribute("aria-controls"),de&&o.isConnected&&o.focus({preventScroll:!0})}sa={trigger:o,close:we,refresh(de){if(!de)return oe||=V>=0,C();let Ae=oe||V>=0;oe=!1,e=de,r=de.tokens,x=Xs(r,i),T=_(),H=[],L(Ae&&!W,!0),e.current&&e.custom&&Y?.refresh(e.custom.value),V<0&&!J&&q!==void 0&&U(q),ct()}};let Te=460,$=de=>{C(),q=void 0,e.custom?.onCancel?.(),we(!0),de.path!==e.current&&e.onSelect(de)},D=e.custom?l?Promise.resolve().then(()=>(WT(),XT)):Promise.resolve().then(()=>(d$(),c$)):void 0;async function j(de){let Ae=await D;if(sa?.close!==we)return;Y||(Y=Ae.pickerEditor(e,{preview:U,commit(Fe){if(!e.custom?.onCommit)return U(Fe);C(),q=void 0,e.custom.onCommit(Fe)},token:$,hover(Fe){C(),Fe!==void 0?J=e.custom?.onPreview(Fe):q!==void 0&&U(q)}}),A.append(Y)),Pe="",Ne();let ve=!!c.getClientRects().length,Re=[...c.querySelectorAll("input,select,summary,button")].filter(Fe=>(!ve||Fe.getClientRects().length)&&!Fe.closest("[hidden]")&&!Fe.matches("details:not([open]) :not(summary)"));de&&(Re.find(Fe=>Fe instanceof HTMLInputElement&&A.contains(Fe))??Re[0])?.focus({preventScroll:!0})}function X(de,Ae=!ae){if(I(),W=de,te(),Pe="",Ne(),W)return void j(Ae);Ae&&(y.hidden?b:y).focus({preventScroll:!0})}let fe=de=>{let Ae=R[de]?.token;Ae&&$(Ae)};b.addEventListener("click",()=>X(!0),{signal:Z}),d.addEventListener("click",()=>X(!1),{signal:Z}),y.addEventListener("input",()=>L(!0),{signal:Z}),m.addEventListener("click",()=>{h=!h,L(!0),ae||(y.hidden?v:y).focus({preventScroll:!0})},{signal:Z}),addEventListener("keydown",de=>{if(!o.isConnected)return we();let Ae=de.composedPath();if(!Ae.includes(c)&&!Ae.includes(o))return;let{key:ve}=de,Re={ArrowDown:1,ArrowUp:-1,PageDown:8,PageUp:-8}[ve];if(!(de.ctrlKey||de.metaKey||de.altKey)&&!(ve==="Escape"&&Ae[0]instanceof HTMLSelectElement&&Ae[0]!==o&&Ae[0].getAttribute("aria-expanded")==="true")){if(ve==="Escape")we(!0,!0);else if(ve==="Tab"){let Fe=[...c.querySelectorAll("button,input,select,summary,[tabindex='0']")].filter(Ye=>!Ye.closest("[hidden]")&&!Ye.matches("details:not([open]) :not(summary)")&&Ye.getClientRects().length);if(Ae[0]!==Fe[de.shiftKey?0:Fe.length-1])return;Fe[de.shiftKey?Fe.length-1:0]?.focus()}else if(Ae[0]===b&&ve==="ArrowUp"&&R.length)v.focus({preventScroll:!0}),xe(R.length-1);else{if(v.hidden||Ae[0]!==y&&Ae[0]!==o&&Ae[0]!==v)return;if(Re>0&&Ae[0]===v&&F===R.length-1&&!b.hidden)I(),b.focus({preventScroll:!0});else if(Re)xe(fm(F+Re,0,R.length-1));else if((ve==="Home"||ve==="End")&&Ae[0]!==y)xe(ve==="Home"?0:R.length-1);else if(ve==="Enter")fe(F);else if(Ae[0]===v&&ve.length===1&&ve!==" ")ue=!0,y.value+=ve,L(!0),y.focus({preventScroll:!0});else return}de.preventDefault(),de.stopImmediatePropagation()}},{capture:!0,signal:Z}),addEventListener("pointerdown",de=>{let Ae=de.composedPath();!Ae.includes(c)&&!Ae.includes(o)&&we()},{capture:!0,signal:Z}),addEventListener("focusin",de=>{let Ae=de.composedPath();!Ae.includes(c)&&!Ae.includes(o)&&we()},{capture:!0,signal:Z});let ye=de=>{de.target===v?v.scrollTop+v.clientHeight>v.scrollHeight-200&&ie(z+e2):de.target instanceof Node&&c.contains(de.target)||we()};addEventListener("scroll",ye,{capture:!0,signal:Z}),a.addEventListener("scroll",ye,{capture:!0,signal:Z}),addEventListener("resize",()=>we(),{signal:Z}),sc(o,()=>we(),Z),v.addEventListener("mousedown",de=>de.preventDefault(),{signal:Z});let De=de=>{let Ae=de.target.closest?.("[role=option]");return Ae&&v.contains(Ae)?Number(Ae.id.slice(s.length+1)):-1};v.addEventListener("pointermove",de=>{let Ae=De(de);Ae>=0&&xe(Ae,!1)},{signal:Z}),v.addEventListener("pointerleave",I,{signal:Z}),b.addEventListener("focusin",I,{signal:Z}),A.addEventListener("focusin",I,{signal:Z}),c.addEventListener("click",de=>{de.target instanceof HTMLInputElement||de.target instanceof HTMLSelectElement||de.target instanceof HTMLButtonElement||de.preventDefault();let Ae=De(de);Ae>=0&&fe(Ae)},{signal:Z}),L();let Ce=o.closest(".design-field")??o.parentElement;c.popover="manual",Ce.append(c),c.showPopover?.(),Ce.addEventListener("palette-field-sync",()=>{J||!e.custom||(Y?.refresh(e.custom.value),te())},{signal:Z}),o.setAttribute("aria-expanded","true"),o.setAttribute("aria-controls",c.id);let Pe="",Ne=()=>{let de=Ce.getBoundingClientRect();if(Pe===`${de.left} ${de.top}`)return;Pe=`${de.left} ${de.top}`;let Ae=AH(Ce),ve=fm(Ae.right-Ae.left-8,120,256),Re=innerHeight-de.bottom-12,Fe=de.top-12;c.style.maxHeight="";let Ye=Math.min(Te,Math.max(c.scrollHeight,200)),$e=Re<Ye&&Fe>Re,ot=Math.min(Te,innerHeight-16,Math.max($e?Fe:Re,200));c.style.width=`${ve}px`,c.style.maxHeight=`${ot}px`,c.style.left=`${fm(de.left,Ae.left+4,Ae.right-ve-4)}px`,c.style.top=$e?"":`${Math.min(de.bottom+4,innerHeight-8-ot)}px`,c.style.bottom=$e?`${Math.min(innerHeight-de.top+4,innerHeight-8-ot)}px`:"",c.toggleAttribute("data-up",$e)};Ne();let Le=new MutationObserver(Ne);Le.observe(a,{attributes:!0,childList:!0,subtree:!0}),Z.addEventListener("abort",()=>Le.disconnect());let Ie=R.findIndex(de=>de.token.path===e.current);Ie>=0&&xe(Ie,!0,!1),!G()||n==="custom"&&e.custom?X(!0):ae||(y.hidden?v:y).focus({preventScroll:!0,focusVisible:!1});let ut=0;function ct(){let de=++ut;Promise.resolve(e.themes?.()).then(Ae=>{!Ae||Ae.length<2||sa?.close!==we||de!==ut||(H=Ae,v.hidden||L(V>=0,!0))},()=>{})}return ct(),()=>we()}var kI,SI,u$,p$,e2,TI,sa,fm,o2=O(()=>{"use strict";Wf();It();lc();kI=".palette-tokens{display:flex;flex-direction:column;overflow:hidden}.palette-tokens__head{flex:none;display:flex;align-items:center;gap:4px;min-height:36px;padding:0 12px;color:#f1efeb;font-weight:500}.palette-tokens__back{display:grid;place-items:center;width:20px;height:20px;margin-left:-6px;padding:0;border:0;border-radius:5px;background:none;color:#898680;cursor:pointer}.palette-tokens__back:hover{background:#ffffff14;color:#f1efeb}.palette-tokens__back svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}.palette-tokens__bar{flex:none;display:flex;gap:4px;padding:0 8px 8px;background:#232323;border-bottom:1px solid #ffffff0d}.palette-tokens__bar input{flex:1;min-width:0;height:28px;box-sizing:border-box;margin:0;padding:0 8px;border:0;border-radius:6px;outline:0;box-shadow:none;background:#ffffff0a;color:#f1efeb;font:inherit}.palette-tokens__bar input:focus{outline:0;box-shadow:inset 0 0 0 1px #bda6ef}.palette-tokens__widen{flex:none;height:28px;margin:0 4px 4px;padding:0 8px;border:0;border-radius:6px;background:none;color:#898680;font:inherit;text-align:left;cursor:pointer}.palette-tokens__widen:hover,.palette-tokens__more:hover{background:#ffffff0f;color:#f1efeb}.palette-tokens__more{flex:none;display:flex;align-items:center;gap:8px;min-height:36px;padding:0 12px;border:0;border-top:1px solid #ffffff0d;background:none;color:#d9d6d1;font:inherit;text-align:left;cursor:pointer}.palette-tokens__more b{margin-right:auto;font-weight:500}.palette-tokens__more i{flex:none;width:14px;height:14px;border-radius:3px;box-shadow:inset 0 0 0 1px #ffffff26;background:linear-gradient(var(--c),var(--c)),repeating-conic-gradient(#ffffff40 0 25%,#ffffff12 0 50%) 0 0/8px 8px}.palette-tokens__more span{max-width:50%;overflow:hidden;color:#898680;font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap}.palette-tokens [role=listbox]{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:0 4px 4px}.palette-tokens small:not(.palette-select *){position:sticky;top:0;z-index:1;display:block;padding:8px 8px 4px;background:#232323;color:#77736f;font-size:10px;font-weight:500}.palette-tokens [role=option]:not(.palette-select *){display:grid;grid-template-columns:20px minmax(0,1fr) 14px;align-items:center;gap:4px 8px;box-sizing:border-box;min-height:32px;padding:6px 8px;border-radius:7px;cursor:pointer}.palette-tokens [data-active]{background:#ffffff14;color:#f1efeb}.palette-tokens [aria-selected=true] .palette-tokens__name{color:#e6dcfb}.palette-tokens__name{grid-column:2;min-width:0;font-weight:500}.palette-tokens__name>span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.palette-tokens__sub{grid-column:2/4;display:none;min-width:0;overflow:hidden;color:#77736f;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.palette-tokens [data-active] .palette-tokens__sub{display:block}.palette-tokens__check{grid-column:3;justify-self:center}.palette-tokens [aria-selected=true] .palette-tokens__check{width:7px;height:3.5px;margin-top:-3px;border:solid #bda6ef;border-width:0 0 1.5px 1.5px;rotate:-45deg}.palette-tokens__pv{display:flex;align-items:center;height:16px;overflow:hidden}.palette-tokens__sw{display:flex;width:16px;height:16px;border-radius:4px;overflow:hidden;background:repeating-conic-gradient(#ffffff40 0 25%,#ffffff0d 0 50%) 0 0/8px 8px;outline:1px solid #ffffff1f;outline-offset:-1px}.palette-tokens__sw>span{flex:1}.palette-tokens__sw>[data-unresolved]{display:grid;place-items:center;background:#393939;color:#b6b1aa;font-size:10px}.palette-tokens__dim{height:4px;min-width:2px;border-radius:2px;background:#bda6ef}.palette-tokens__corner{width:12px;height:12px;box-sizing:border-box;border:solid #bda6ef;border-width:1.5px 0 0 1.5px}.palette-tokens__shadow{width:16px;height:12px;margin-left:2px;border-radius:3px;background:#f1efeb}.palette-tokens__ag{color:#f1efeb;font-size:13px;line-height:1;white-space:nowrap}.palette-tokens__empty{padding:12px 8px;color:#77736f}@media (pointer:coarse){.palette-tokens{font-size:13px}.palette-tokens [role=option]:not(.palette-select *){min-height:44px}.palette-tokens__bar input,.palette-tokens__bar button{height:36px}}",SI=".palette-tokens__custom{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}.palette-tokens__custom>.palette-custom{flex:none}.palette-tokens__custom .palette-custom__body{overflow:visible}.palette-tokens [hidden]{display:none!important}.palette-tokens button:focus-visible,.palette-tokens [role=listbox]:focus-visible{outline:1px solid #bda6ef;outline-offset:-2px}.palette-tokens[popover]{position:fixed;inset:auto;margin:0;border:0;padding:0}",u$={font:"Typography","box-shadow":"Shadow","text-shadow":"Text shadow"},p$=new WeakSet,e2=60,TI=0;fm=(e,t,n)=>Math.min(n,Math.max(t,e))});function b$(e,t){let n=mm.get(e.element);if(n?.editor===t)return n.component;let o={id:e.name,name:e.name,source:e.source??"",line:0,props:t.schema},i={definition:o,preview:"adapter",releaseProps:r=>t.release?.(r),subscribe:t.subscribe?.bind(t),get props(){return h$(o,t.read())},onChange:r=>t.apply(r),setProps(r){if(t.available?.()===!1)throw new Error("This component instance is no longer available.");let a=h$(o,r);if(Object.keys(r).some(s=>!(s in a))||o.props.some(s=>s.kind!=="unsupported"&&s.required&&!(s.name in a)))throw new Error("Component props no longer match the editor schema.");t.apply(a)}};return mm.set(e.element,{editor:t,component:i}),i}function i2(e){let t=$c(e)?.currentInspectableElement,n=t?.(e);if(n)return n;let o=mm.get(e);if(!o||o.editor.available?.()===!1)return null;let i=o.editor.currentElement?.();return i?.isConnected?(i!==e&&mm.set(i,o),i):null}function DI(e){return e===void 0||typeof e=="string"||typeof e=="number"&&Number.isFinite(e)||typeof e=="boolean"}function l0(e,t){return t===void 0?!e.required:!DI(t)||e.kind==="unsupported"?!1:e.kind==="string"?typeof t=="string"&&t.length<=500:e.kind==="number"?typeof t=="number"&&Number.isFinite(t):e.kind==="boolean"?typeof t=="boolean":e.kind==="enum"&&(e.values??[]).includes(t)}function h$(e,t){let n={};for(let o of e.props){if(o.kind==="unsupported")continue;let i=t[o.name];l0(o,i)&&(n[o.name]=i)}return n}function Uo(e){let t=$c(e)?.inspectableFor,n=t?.(e);if(n)return n;let o=e&&_I.get(e);if(o&&e.getAttribute("data-palette-inspectable")===o.definition.id)return o;let i=e&&mm.get(e);return i&&i.editor.available?.()!==!1?i.component:null}function c0(e){for(let t=e?.parentElement;t;t=t.parentElement){let n=Uo(t);if(n)return{root:t,component:n}}return null}var _I,mm,y$=O(()=>{"use strict";ho();_I=new WeakMap,mm=new WeakMap;lg({inspectableFor:Uo,currentInspectableElement:i2})});function d0(){let e=$c(sg())?.tokenSources;return e?e():u0}function Lo(e){if(!e)return null;let t=$c(e)?.tokenSourceFor;if(t)return t(e);let n=null;for(let o of u0){let i=ul(o.root,e.ownerDocument);i&&(i===e||i.contains(e))&&(!n||n.root.contains(o.root))&&(n=o)}return n}function gc(e,t){return e.root.ownerDocument.defaultView?.getComputedStyle(e.root).getPropertyValue(t.cssVariable).trim()??""}function r2(e,t){try{return e.root.querySelectorAll(t.impactSelector).length}catch{return 0}}function v$(e,t,n){if(!n||n.length>160||/[{};]/.test(n)||/(?:url|expression)\s*\(/i.test(n))return!1;let i=e.root.ownerDocument.defaultView?.CSS;return!i?.supports||t.properties.some(r=>i.supports(r,n))}function w$(e,t,n,o=!1){if(!e.tokens.some(u=>u===t||u.path===t.path)||!v$(e,t,n))return!1;let i=gc(e,t),r=e.themeEdits.get(t.path),a=e.root.style.getPropertyValue(t.cssVariable),s=r?.inlineBefore??a,l=or.get(e)??[];if(i===n)return!0;e.root.style.setProperty(t.cssVariable,n),n===(r?.before??i)?e.themeEdits.delete(t.path):e.themeEdits.set(t.path,{before:r?.before??i,after:n,inlineBefore:s});let c=l.at(-1);return o&&c?.kind==="theme"&&c.token.path===t.path?n===c.before?l.pop():c.after=n:l.push({kind:"theme",source:e,token:t,before:i,after:n,inlineBefore:a}),or.set(e,l),!0}function E$(e){for(let t of d0())for(let[n,o]of t.themeEdits){let i=t.tokens.find(a=>a.path===n)?.cssVariable;if(!i)continue;let r=e?o.inlineBefore:o.after;r?t.root.style.setProperty(i,r):t.root.style.removeProperty(i)}}function k$(e,t){let n=e.themeEdits.get(t.path),o=or.get(e)??[],i=o.find(a=>a.kind==="theme"&&a.token.path===t.path),r=n?.inlineBefore??(i?.kind==="theme"?i.inlineBefore:void 0);r!==void 0&&(r?e.root.style.setProperty(t.cssVariable,r):e.root.style.removeProperty(t.cssVariable),e.themeEdits.delete(t.path),or.set(e,o.filter(a=>a.kind!=="theme"||a.token.path!==t.path)))}function a2(e,t,n,o,i={}){if(!e.tokens.some(y=>y.path===n.path)||!n.properties.includes(o))return!1;let r=e.elementOriginals.get(t);r||e.elementOriginals.set(t,r=new Map),r.has(o)||r.set(o,{value:t.style.getPropertyValue(o),priority:t.style.getPropertyPriority(o)});let a=t.style.getPropertyValue(o),s=t.style.getPropertyPriority(o),l=`var(${n.cssVariable})`,c=e.elementBindings.get(t);c||e.elementBindings.set(t,c=new Map);let u=c.get(o);if(c.set(o,{tokenPath:n.path,initialValue:u?.initialValue??a,initialPriority:u?.initialPriority??s,mode:"token",declaredPath:u?u.declaredPath:yu(e,t,o)?.token.path}),t.style.setProperty(o,l,s),i.recordHistory===!1)return!0;let d={kind:"element",element:t,property:o,before:a,priority:s,after:l},p=or.get(e)??[];p.push(d),or.set(e,p);let g=mc.get(t)??[];return g.push(d),mc.set(t,g),!0}function s2(e,t,n,o){let i=e.elementBindings.get(t),r=i?.get(n);if(!r){let a=yu(e,t,n);if(!a)return;i||e.elementBindings.set(t,i=new Map),r={tokenPath:a.token.path,initialValue:t.style.getPropertyValue(n),initialPriority:t.style.getPropertyPriority(n),mode:"custom",declaredPath:a.token.path},i.set(n,r)}r.mode="custom",r.customValue=o}function l2(e,t,n){let o=e.elementBindings.get(t)?.get(n);if(!o)return;let i=t.style.getPropertyValue(n);if(i===o.initialValue&&t.style.getPropertyPriority(n)===o.initialPriority){e.elementBindings.get(t)?.delete(n);return}e.tokens.find(a=>a.path===o.tokenPath&&a.properties.includes(n)&&i===`var(${a.cssVariable})`)?(o.mode="token",delete o.customValue):(o.mode="custom",o.customValue=i)}function c2(e,t,n){let o=e.elementBindings.get(t)?.get(n);return o?{...o}:null}function x$(e,t,n,o){let i=[...n.matchAll(/var\(\s*(--[\w-]+)/g)].map(a=>a[1]);if(!i.length||o&&!/^var\(\s*--[\w-]+\s*(?:,[^;{}]*)?\)$/.test(n.trim()))return;let r=e.tokens.filter(a=>a.properties.includes(t)&&i.includes(a.cssVariable));return r.length===1?r[0]:void 0}function HI(e){let t=e.replace(/:(?:where)\([^)]*\)/g,"").replace(/"[^"]*"|'[^']*'/g,""),n=t.match(/#[\w-]+/g)?.length??0,o=t.match(/\.[\w-]+|\[[^\]]*\]|:(?!:)[\w-]+/g)?.length??0,i=t.match(/(?:^|[\s>+~(])[a-z][\w-]*/gi)?.length??0;return n*1e4+o*100+i}function zI(e){let t=[],n=0,o=0;for(let i=0;i<e.length;i++){let r=e[i];r==="("||r==="["?n++:r===")"||r==="]"?n--:r===","&&n===0&&(t.push(e.slice(o,i)),o=i+1)}return t.push(e.slice(o)),t.map(i=>i.trim()).filter(Boolean)}function yu(e,t,n,o=t.style.getPropertyValue(n),i=t.style.getPropertyPriority(n)){let r=t.ownerDocument.defaultView,a=null,s=0,l=d=>{for(let p of d){s++;let g=p.media;if(g&&r?.matchMedia&&g.mediaText&&!r.matchMedia(g.mediaText).matches)continue;let y=p.style,v=p.selectorText;if(y&&v)for(let h of[n,...RI[n]??[]]){let m=y.getPropertyValue(h).trim();if(!m)continue;let b=-1;for(let E of zI(v))try{t.matches(E)&&(b=Math.max(b,HI(E)))}catch{}if(!(b<0)){b+=y.getPropertyPriority(h)?1e9:0,(!a||b>a.rank||b===a.rank&&s>=a.order)&&(a={value:m,property:h,rank:b,order:s});break}}let x=p.cssRules;x&&!y&&l(x)}};for(let d of t.ownerDocument.styleSheets)try{d.disabled||l(d.cssRules)}catch{}let c=a;if(o&&!(c&&c.rank>=1e9&&!i)){let d=x$(e,n,o,!0);return d?{token:d,origin:"inline"}:null}if(!c)return null;let u=x$(e,n,c.value,c.property===n);return u?{token:u,origin:"stylesheet"}:null}function S$(e,t,n){let o=e.elementBindings.get(t)?.get(n),i=e.elementOriginals.get(t)?.get(n),r=o?.initialValue??i?.value??"",a=o?.initialPriority??i?.priority??"";r?t.style.setProperty(n,r,a):t.style.removeProperty(n),e.elementBindings.get(t)?.delete(n)}function d2(e,t){return e.tokens.filter(n=>n.properties.includes(t))}function T$(e){let t=Lo(e);return!!t&&(t.themeEdits.size>0||!!mc.get(e)?.length||!!t.elementBindings.get(e)?.size)}function A$(e){let t=Lo(e);return!!t&&!!or.get(t)?.length}function M$(e){let t=Lo(e),n=t&&or.get(t)?.pop();if(!t||!n)return;if(n.kind==="theme"){n.inlineBefore?t.root.style.setProperty(n.token.cssVariable,n.inlineBefore):t.root.style.removeProperty(n.token.cssVariable);let i=t.themeEdits.get(n.token.path);if(i&&i.after===n.after)i.before===n.before?t.themeEdits.delete(n.token.path):t.themeEdits.set(n.token.path,{...i,after:n.before});else if(!i){let r=or.get(t).find(a=>a.kind==="theme"&&a.token.path===n.token.path);t.themeEdits.set(n.token.path,{before:n.after,after:n.before,inlineBefore:(r?.kind==="theme"?r:n).inlineBefore})}return}n.before?n.element.style.setProperty(n.property,n.before,n.priority):n.element.style.removeProperty(n.property);let o=mc.get(n.element)??[];o.pop(),o.length||mc.delete(n.element)}function u2(e){let t=Lo(e);if(!t)return;for(let[o,i]of t.themeEdits){let r=t.tokens.find(a=>a.path===o);r&&(i.inlineBefore?t.root.style.setProperty(r.cssVariable,i.inlineBefore):t.root.style.removeProperty(r.cssVariable))}t.themeEdits.clear();let n=t.elementOriginals.get(e);for(let[o,i]of n??[])i.value?e.style.setProperty(o,i.value,i.priority):e.style.removeProperty(o);t.elementOriginals.delete(e),t.elementBindings.delete(e),mc.delete(e),or.set(t,(or.get(t)??[]).filter(o=>o.kind==="element"&&o.element!==e))}function C$(){for(let e of new Set([...u0,...d0()])){for(let t of[e.root,...e.elementOriginals.keys(),...e.elementBindings.keys()])u2(t);or.set(e,[])}}function p2(e){let t=Lo(e);if(!t)return;let n=[];for(let[o,i]of t.elementBindings.get(e)??[]){let r=t.tokens.find(l=>l.path===i.tokenPath&&l.properties.includes(o));if(!r)continue;let a=t.tokens.find(l=>l.path===i.declaredPath),s=a?`var(${a.cssVariable}) [${a.path}]`:i.initialValue||"(unset)";i.mode==="token"?a!==r&&n.push(`Element ${o}: ${s} \u2192 var(${r.cssVariable}) [${r.path}]${a?" [rebind]":""}`):n.push(`Element ${o}: ${s} \u2192 ${i.customValue||"(unset)"} [${a?"custom override":"custom value"}]`)}for(let o of mc.get(e)??[]){if(o.kind!=="element"||t.elementBindings.get(e)?.has(o.property))continue;let i=t.tokens.find(r=>o.after===`var(${r.cssVariable})`);i&&n.push(`Element ${o.property}: ${o.before||"(unset)"} \u2192 var(${i.cssVariable}) [${i.path}]`)}for(let[o,i]of t.themeEdits){let r=t.tokens.find(a=>a.path===o);r&&n.push(`Shared theme ${o} (${r.cssVariable}): ${i.before} \u2192 ${i.after}; preview scope ${r.impactSelector} (${r2(t,r)} matching elements)`)}if(n.length)return["Proposed design-token changes (preview only)",...n,"Token references are preserved for element assignments; refresh resets previews."].join(`
349
+ `});function SO(e,t,n){let o=e;if(!o.adoptedStyleSheets)return;let i=jT.get(e);try{if(n&&!i){let r=new(t.ownerDocument.defaultView??window).CSSStyleSheet;r.replaceSync(YK),jT.set(e,i={sheet:r,count:0}),o.adoptedStyleSheets=[...o.adoptedStyleSheets,r]}if(!i||(i.count+=n?1:-1,i.count))return;jT.delete(e),o.adoptedStyleSheets=o.adoptedStyleSheets.filter(r=>r!==i.sheet)}catch{}}function TO(e,t){e.getBoundingClientRect();for(let n of AO(e))if(!t.seen.has(n)&&Number.isFinite(n.effect?.getComputedTiming().endTime))try{n.finish()}catch{}}function PT(e){let t=cm.get(e);t?cancelAnimationFrame(t.frame):(cm.set(e,t={count:0,root:e.getRootNode(),seen:new Set(AO(e))}),e.setAttribute(nr,""),SO(t.root,e,!0));let n=t;n.count++,requestAnimationFrame(()=>{cm.get(e)===n&&TO(e,n)});let o=!0;return()=>{o&&(o=!1,!--n.count&&(n.frame=requestAnimationFrame(()=>n.frame=requestAnimationFrame(()=>{n.count||cm.get(e)!==n||(TO(e,n),cm.delete(e),e.removeAttribute(nr),SO(n.root,e,!1))}))))}}function dm(e,t){let n=e?PT(e):()=>{},o;try{o=t()}catch(i){throw n(),i}return()=>{try{o?.()}finally{n()}}}var nr,YK,cm,jT,AO,um=O(()=>{"use strict";nr="data-palette-still",YK=`:is([${nr}],[${nr}] *),:is([${nr}],[${nr}] *)::before,:is([${nr}],[${nr}] *)::after{transition:none!important}`,cm=new Map,jT=new Map,AO=e=>e.getAnimations?.({subtree:!0})??[]});var BT={};Ft(BT,{attach:()=>ZK});function ZK(e,t,n){t&&r0.set(e,t),n&&CO.set(e,n),ia&&!ia.select.isConnected&&ia.close();let o=e.getRootNode();if((o instanceof ShadowRoot||o===document)&&!LO.has(o)){LO.add(o);let r=document.createElement("style");r.textContent=Ry+XK,(o instanceof ShadowRoot?o:document.head).append(r)}if(MO.has(e))return;MO.add(e);let i=r=>{let a=r.composedPath()[0];return a instanceof HTMLSelectElement&&!a.disabled&&!a.multiple&&!a.dataset.picker?a:null};e.addEventListener("focusin",r=>{let a=i(r);a&&!a.hasAttribute("aria-haspopup")&&(a.setAttribute("aria-haspopup","listbox"),a.setAttribute("aria-expanded","false"))}),e.addEventListener("pointerdown",r=>{fc=r.pointerType==="mouse"?void 0:r;let a=i(r);!a||r.button||(r.preventDefault(),fc||_O(a,r0.get(e)))},!0),e.addEventListener("pointerup",r=>{let a=i(r);a&&fc&&!DO(r)&&_O(a,r0.get(e))},!0);for(let r of["mousedown","touchend"])e.addEventListener(r,a=>{i(a)&&a.cancelable&&a.preventDefault()},!0);e.addEventListener("keydown",r=>{let a=i(r);if(!a||ia?.select===a||r.ctrlKey||r.metaKey)return;let s=r.key.length===1&&r.key!==" "&&!r.altKey;s&&(/^[b?]$/i.test(r.key)||CO.get(e)?.(r))||!s&&!["Enter"," ","ArrowDown","ArrowUp"].includes(r.key)||(r.preventDefault(),RO(a,r0.get(e),s?r.key:""))},!0)}function _O(e,t){if(ia?.select===e)return ia.close();fc||e.focus(),RO(e,t)}function RO(e,t,n=""){ia?.close(),fc=void 0;let o=`palette-select-${++WK}`,i=document.createElement("div");i.className="palette-select",i.id=o,i.setAttribute("role","listbox"),i.setAttribute("aria-label",e.getAttribute("aria-label")??e.title);let r=[],a=(V,oe)=>{let ue=document.createElement("div");ue.id=`${o}-${r.length}`,ue.setAttribute("role","option"),ue.setAttribute("aria-selected",String(V.selected)),V.disabled&&ue.setAttribute("aria-disabled","true"),V.title&&(ue.title=V.title);let q=document.createElement("span");q.textContent=V.label,q.style.cssText=V.style.cssText,ue.append(q),oe.append(ue),r.push({node:ue,option:V})};for(let V of e.children)if(V instanceof HTMLOptionElement)a(V,i);else if(V instanceof HTMLOptGroupElement){let oe=document.createElement("div");oe.setAttribute("role","group"),oe.setAttribute("aria-labelledby",`${o}-g${r.length}`);let ue=document.createElement("small");ue.id=`${o}-g${r.length}`,ue.textContent=V.label,oe.append(ue);for(let q of V.querySelectorAll("option"))a(q,oe);i.append(oe)}let s=-1,l=e.dataset.property,c,u=()=>{let V=c;c=void 0,V?.()},d=r.flatMap((V,oe)=>V.option.disabled?[]:[oe]),p=(V,oe=!0)=>{if(!(V>=0))return;if(V!==s&&oe){u();let{value:W,selected:C}=r[V].option;if(!C){let U=I=>e.dispatchEvent(new CustomEvent("palette-preview",{detail:I}));c=dm(t,()=>t&&l?Fa(t,l,W):(U(W),()=>U(null)))}}r[s]?.node.removeAttribute("data-active"),s=V;let ue=r[V].node;ue.toggleAttribute("data-active",!0),e.setAttribute("aria-activedescendant",ue.id);let q=ue.offsetTop,Y=q+ue.offsetHeight;q<i.scrollTop?i.scrollTop=q-4:Y>i.scrollTop+i.clientHeight&&(i.scrollTop=Y-i.clientHeight+4)},g=V=>{let oe=d.indexOf(s);p(d[oe<0?0:Math.max(0,Math.min(d.length-1,oe+V))])},y=V=>{let oe=r[V]?.option;h(),!(!oe||oe.disabled||oe.selected)&&(oe.selected=!0,e.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))},v=new AbortController,{signal:x}=v;function h(){ia?.close===h&&(ia=void 0,u(),v.abort(),i.remove(),e.setAttribute("aria-expanded","false"),e.removeAttribute("aria-activedescendant"),e.removeAttribute("aria-controls"))}ia={select:e,close:h};let m="",b=0,E=(V,oe)=>{m=oe-b<1e3?m+V.toLowerCase():V.toLowerCase(),b=oe;let ue=Math.max(0,d.indexOf(s)+(m[1]?0:1)),Y=[...d.slice(ue),...d.slice(0,ue)].find(W=>r[W].option.label.toLowerCase().startsWith(m));Y!==void 0&&p(Y)};addEventListener("keydown",V=>{if(!e.isConnected||V.composedPath()[0]!==e)return h();let oe=V.key;if(!(V.ctrlKey||V.metaKey||V.altKey&&!oe.startsWith("Arrow"))){if(oe==="Tab")return h();if(oe==="ArrowDown"||oe==="ArrowUp")g(oe==="ArrowDown"?1:-1);else if(oe==="Home"||oe==="PageUp")p(d[0]);else if(oe==="End"||oe==="PageDown")p(d[d.length-1]);else if(oe==="Escape")h();else if(oe==="Enter"||oe===" "&&!m)y(s);else if(oe.length===1)E(oe,V.timeStamp);else if(oe!=="ArrowLeft"&&oe!=="ArrowRight")return;V.preventDefault(),V.stopImmediatePropagation()}},{capture:!0,signal:x}),addEventListener("pointerdown",V=>{let oe=V.composedPath();!oe.includes(i)&&!oe.includes(e)&&h()},{capture:!0,signal:x});let S,A=V=>{let oe=e.getBoundingClientRect();V.target!==i&&(!S||Math.abs(oe.top-S.top)+Math.abs(oe.left-S.left)>1)&&h()};addEventListener("scroll",A,{capture:!0,signal:x}),e.getRootNode().addEventListener("scroll",A,{capture:!0,signal:x}),addEventListener("resize",h,{signal:x}),sc(e,h,x),e.addEventListener("blur",h,{signal:x}),i.addEventListener("mousedown",V=>V.preventDefault(),{signal:x}),i.addEventListener("pointerleave",()=>{u(),r[s]?.node.removeAttribute("data-active"),e.removeAttribute("aria-activedescendant"),s=-1},{signal:x}),i.addEventListener("pointermove",V=>{let oe=V.target.closest?.("[role=option]"),ue=r.findIndex(q=>q.node===oe);d.includes(ue)&&ue!==s&&p(ue)},{signal:x}),i.addEventListener("click",V=>{if(V.preventDefault(),DO(V))return;let oe=V.target.closest?.("[role=option]"),ue=r.findIndex(q=>q.node===oe);d.includes(ue)&&y(ue)},{signal:x});let _=e.closest(".design-field")??e.parentElement;i.popover="manual",(e.closest(".palette-tokens")??_).append(i),i.showPopover?.(),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls",o),S=e.getBoundingClientRect();let T=(e.offsetWidth<60?_:e).getBoundingClientRect(),H=Math.min(Math.max(T.width,i.offsetWidth+2,120),innerWidth-16),R=innerHeight-T.bottom-8,z=T.top-8,F=i.scrollHeight,B=F>R&&z>R,le=Math.max(B?z:R,60),J=Math.min(F,240,le);i.style.width=`${H}px`,i.style.maxHeight=`${Math.min(240,le)}px`,i.style.left=`${Math.max(8,Math.min(T.left,innerWidth-H-8))}px`,i.style.top=`${B?T.top-J-4:T.bottom+4}px`,i.toggleAttribute("data-up",B);for(let{node:V,option:oe}of r)!V.title&&V.firstElementChild.scrollWidth>V.firstElementChild.clientWidth&&(V.title=oe.label);p(r.findIndex(V=>V.option.selected&&!V.option.disabled),!1),s<0&&g(0),n&&E(n,performance.now())}var XK,MO,r0,CO,LO,WK,ia,fc,DO,VT=O(()=>{"use strict";Wf();um();XK=`.design-field>select{appearance:none;padding-right:20px;cursor:pointer;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 3 4 5.5 6.5 3' fill='none' stroke='%23898680' stroke-width='1.2'/%3E%3C/svg%3E") right 7px center/8px no-repeat}.palette-select{width:max-content;max-height:240px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:4px;line-height:1.2}.palette-select[popover]{position:fixed;inset:auto;margin:0;border:0}.palette-select [role=option]{display:flex;align-items:center;gap:8px;box-sizing:border-box;min-height:28px;padding:0 8px;border-radius:6px;white-space:nowrap;cursor:pointer}.palette-select [role=option] span{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.palette-select [role=option]::after{content:'';flex:none;width:7px;height:3.5px;margin:-3px 1px 0 0;border:solid transparent;border-width:0 0 1.5px 1.5px;rotate:-45deg}.palette-select [data-active]{background:#ffffff14;color:#f1efeb}.palette-select [aria-selected=true]{color:#f1efeb}.palette-select [aria-selected=true]::after{border-color:#bda6ef}.palette-select [aria-disabled=true]{opacity:.4;cursor:default}.palette-select small{display:block;padding:8px 8px 4px;color:#77736f;font-size:10px;font-weight:500}.palette-select [role=group]+[role=group],.palette-select [role=option]+[role=group]{margin-top:4px;border-top:1px solid #ffffff0d}@media (pointer:coarse){.palette-select{font-size:13px}.palette-select [role=option]{min-height:40px}}`,MO=new WeakSet,r0=new WeakMap,CO=new WeakMap,LO=new WeakSet,WK=0;DO=e=>fc&&Math.abs(e.clientY-fc.clientY)>10});var HO={};Ft(HO,{liveColors:()=>QK});function QK(e,t,n){let o=new AbortController,i=new MutationObserver(()=>s()),r=!1,a=!1,s=()=>{r||(r=!0,requestAnimationFrame(l))},l=()=>{if(r=!1,!e[0].isConnected)return o.abort();for(let u of e){let d=u.querySelector("[data-property]"),p=u.querySelector('input[type="color"]'),g=u.querySelector(".design-token-binding")?.dataset.value,y=n({property:d.dataset.property,kind:"color"},t,g);y===d.value||d.matches(":focus")||d.getAttribute("aria-invalid")==="true"||(d.value=y,p&&(p.value=ic(y)),u.dispatchEvent(new Event("palette-field-sync")))}let c=t.ownerDocument.getAnimations?.().filter(u=>/color|fill|stroke/.test(String(u.transitionProperty))&&u.effect?.target?.contains(t));!c?.length||a||(a=!0,Promise.race([Promise.allSettled(c.map(u=>u.finished)),new Promise(u=>setTimeout(u,1e3))]).then(()=>{a=!1,s()}))};for(let c of["pointerover","pointerout","pointerup","focusin","focusout","transitionend","transitioncancel"])addEventListener(c,s,{capture:!0,signal:o.signal});i.observe(t.ownerDocument,{attributes:!0,subtree:!0}),o.signal.addEventListener("abort",()=>i.disconnect()),s()}var zO=O(()=>{"use strict";Li()});var jO={};Ft(jO,{enhance:()=>nI});function NO(e,t){let n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),"value");Object.defineProperty(e,"value",{configurable:!0,get:()=>n.get.call(e),set:o=>{n.set.call(e,o),t()}}),e.addEventListener("input",t),t()}function nI(e,t){let n=e.getRootNode();if((n instanceof ShadowRoot||n===document)&&!$O.has(n)){$O.add(n);let o=document.createElement("style");o.textContent=JK,(n instanceof ShadowRoot?n:document.head).append(o)}for(let o of e.querySelectorAll(".design-field[data-field-property]")){if(o.dataset.enhanced)continue;o.dataset.enhanced="";let i=o.dataset.fieldProperty,r=o.querySelector(":scope > [data-property]");if(!r)continue;if(r instanceof HTMLSelectElement&&i==="font-weight")for(let u of r.options)u.style.fontWeight=u.value;r instanceof HTMLSelectElement&&OO[i]&&oI(o,r,t,OO[i]);let a=eI.has(i);if(!(r instanceof HTMLInputElement)||!(a||/design-field--(length|size)/.test(o.className)))continue;let s=document.createElement("span");s.className="design-field__unit",s.setAttribute("aria-hidden","true"),r.after(s);let l=()=>{a&&!o.querySelector(":scope > .palette-tokens")&&o.toggleAttribute("data-inline-token",!/\s/.test(getComputedStyle(t).getPropertyValue(i).trim()))},c=()=>{let u=o.querySelector(".design-token-chip");u&&tI?.observe(u)};a&&new MutationObserver(()=>{c(),l()}).observe(o,{childList:!0}),c(),NO(r,()=>{s.textContent=i!=="line-height"&&/^-?\d*\.?\d+$/.test(r.value.trim())?"px":"",l()})}}function oI(e,t,n,o){let i=document.createElement("div");i.className="design-segments",i.setAttribute("role","radiogroup"),i.setAttribute("aria-label",t.getAttribute("aria-label")??"");let r,a=()=>{let c=r;r=void 0,c?.()},s=[...t.options].filter(c=>o[c.value]).map(c=>{let u=document.createElement("button");return u.type="button",u.setAttribute("role","radio"),u.value=c.value,u.title=c.label,u.setAttribute("aria-label",c.label),u.innerHTML=`<svg viewBox="0 0 12 12" aria-hidden="true"><path d="${o[c.value]}"/></svg>`,u.addEventListener("pointerenter",()=>{a(),t.value!==c.value&&(r=Fa(n,t.dataset.property,c.value))}),u.addEventListener("pointerleave",a),u.addEventListener("click",()=>l(c.value)),u}),l=c=>{a(),t.value!==c&&(t.dispatchEvent(new Event("focus")),t.value=c,t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0})))};i.addEventListener("keydown",c=>{let u={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[c.key];if(c.key==="Escape"&&r){a(),c.stopPropagation();return}if(!u)return;c.preventDefault();let p=(Math.max(0,s.findIndex(g=>g.getAttribute("aria-checked")==="true"))+u+s.length)%s.length;l(s[p].value),s[p].focus()}),i.append(...s),t.after(i),NO(t,()=>{let c={start:"left",end:"right"}[t.value]??t.value,u=s.findIndex(d=>d.value===c);s.forEach((d,p)=>{d.setAttribute("aria-checked",String(p===u)),d.tabIndex=p===Math.max(u,0)?0:-1})})}var JK,OO,eI,$O,tI,PO=O(()=>{"use strict";Li();JK=".design-segments{display:flex;flex:1;gap:2px;min-width:0;height:100%;box-sizing:border-box;padding:2px}.design-field:has(>.design-segments)>select{display:none}.design-field:has(>.design-token-binding)>.design-segments{margin-right:24px}.design-segments button{flex:1;display:grid;place-items:center;min-width:0;padding:0;border:0;border-radius:4px;background:none;color:#898680;font:inherit;font-size:10px;cursor:pointer}.design-segments button:hover{color:#f1efeb}.design-segments button[aria-checked=true]{background:#ffffff1a;color:#f1efeb}.design-segments button:focus-visible{outline:1px solid #bda6ef;outline-offset:-1px}.design-segments svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.2;stroke-linecap:round}.design-field__unit{flex:none;padding-right:8px;color:#77736f;font-size:10px;pointer-events:none}.design-field__unit:empty{display:none}.design-field.design-field:has(>.design-field__unit:not(:empty))>input[data-property]{padding-right:2px}.design-field:has(>.design-token-binding)>.design-field__unit{margin-right:20px}.design-field:is([data-token-mode=token],[data-token-mode=connected])>.design-field__unit{visibility:hidden}.design-field:has(>.design-token-binding>.design-token-off:not([hidden]))>.design-field__unit{margin-right:30px}.design-field.design-field[data-inline-token]:is([data-token-mode=token],[data-token-mode=connected])>:is([data-property],.design-field__unit){visibility:visible}.design-field.design-field[data-inline-token]:is([data-token-mode=token],[data-token-mode=connected])>.design-field__unit{display:block;margin-right:calc(var(--chip,50%) + 30px)}.design-field.design-field[data-inline-token]:is([data-token-mode=token],[data-token-mode=connected]) .design-token-chip{left:auto;width:max-content;max-width:50%;box-sizing:border-box;overflow:clip;overflow-clip-margin:content-box}.design-field.design-field[data-inline-token]:is([data-token-mode=token],[data-token-mode=connected]) .design-token-binding select{left:auto;width:var(--chip,50%)}.design-token-chip__verb{display:contents}.design-field[data-inline-token] .design-token-chip__verb{display:none}.design-field.design-field[data-inline-token]:is([data-token-mode=token],[data-token-mode=connected])>input[data-property]{padding-right:2px}.design-field[data-inline-token]>.palette-tokens:not([data-custom])>.palette-tokens__head,.design-field[data-inline-token] .palette-custom__body>.palette-typed:not(.palette-typed__advanced){display:none}",OO={"text-align":{left:"M1.5 2.5h9M1.5 5h6M1.5 7.5h9M1.5 10h6",center:"M1.5 2.5h9M3 5h6M1.5 7.5h9M3 10h6",right:"M1.5 2.5h9M4.5 5h6M1.5 7.5h9M4.5 10h6",justify:"M1.5 2.5h9M1.5 5h9M1.5 7.5h9M1.5 10h9"},"border-style":{none:"M3 3l6 6M9 3 3 9",solid:"M1.5 6h9",dashed:"M1.5 6h2M5 6h2M8.5 6h2",dotted:"M2 6h.01M4.67 6h.01M7.33 6h.01M10 6h.01"}},eI=new Set(["font-size","line-height","letter-spacing","gap","border-width","padding","margin","border-radius"]),$O=new WeakSet,tI=globalThis.ResizeObserver&&new ResizeObserver(e=>{for(let{target:t}of e)t.closest(".design-field")?.style.setProperty("--chip",`${t.offsetWidth}px`)})});var IO={};Ft(IO,{designPanelStyles:()=>EO,fieldControl:()=>KO,fields:()=>UO,renderPanel:()=>lI,syncFields:()=>yO,toHex:()=>ic,valueFor:()=>UT});function qO(e){let t=e.match(/^rgba\(.*,\s*([\d.]+)\)$/)?.[1];return t===void 0?/^rgb\(/.test(e)?ic(e):e||"transparent":Number(t)?e:"transparent"}function UT(e,t,n){let o=(n||getComputedStyle(t).getPropertyValue(e.property)).trim();if(e.kind==="color")return qO(o);if(e.kind==="length"||e.kind==="size"){let i=o.match(/^(-?\d+(?:\.\d+)?)px$/);return i?String(Math.round(Number(i[1])*10)/10):e.kind==="size"?o||"auto":"0"}return o}function KO(e,t){let{element:n}=t,o=document.createElement("div");o.className=`design-field design-field--${e.kind}`,o.dataset.fieldProperty=e.property,o.toggleAttribute("data-wide",!!e.wide);let i=e.kind==="select"?document.createElement("select"):document.createElement("input");if(i instanceof HTMLSelectElement)for(let d of e.values??[]){let p=document.createElement("option");p.value=p.textContent=d,i.append(p)}else i.type=e.kind==="length"?"number":"text",i.autocomplete="off",i.spellcheck=!1,i.placeholder=e.placeholder??"",e.kind==="length"&&(i.min=String(e.min??0),i.max=String(e.max??1e3),i.setAttribute("inputmode","decimal"));let r=vO(i,e,o);o.append(r),i.dataset.property=e.property,i.setAttribute("aria-label",e.label);let a=()=>{let d=UT(e,n);i instanceof HTMLSelectElement&&![...i.options].some(g=>g.value===d)&&i.prepend(new Option(d,d)),i.value=d;let p=o.querySelector('input[type="color"]');p&&(p.value=ic(d))};a();let s=()=>t.begin(i,e.property),l=()=>u(()=>{t.apply(i,e.property,xO(e,i)),t.commit(i,e.property,!1)}),c=()=>u(()=>t.commit(i,e.property));if(i.addEventListener("focus",s),i.addEventListener("input",l),i.addEventListener("change",c),i.addEventListener("blur",c),e.kind==="color"){let d=document.createElement("input");d.type="color",d.setAttribute("aria-label",`${e.label} picker`);let p=()=>{d.value=ic(i.value)};p(),d.addEventListener("pointerdown",s),d.addEventListener("focus",s),d.addEventListener("input",()=>{i.value=d.value,l()}),d.addEventListener("change",c),i.addEventListener("input",p),o.append(d)}if(e.glyph){let d=g=>{let y=i.value.trim().match(/^(-?\d*\.?\d+)([a-z%]*)$/i),v=y?y[2]:e.kind==="text"?"px":"",x=y?Number(y[1]):parseFloat(getComputedStyle(n).getPropertyValue(e.property))||0,h=Math.round((x+g*(e.step??(e.kind==="text"&&!v?.1:1)))*100)/100;(e.kind!=="text"||e.max)&&(h=Math.min(e.max??1e4,Math.max(e.min??0,h))),i.value=`${h}${v}`,l()},p=document.createElement("span");p.className="design-field__glyph",p.setAttribute("aria-hidden","true"),p.title=`${e.label} \xB7 drag to adjust`,e.glyph.length>1?p.innerHTML=`<svg viewBox="0 0 12 12"><path d="${e.glyph}"/></svg>`:p.textContent=e.glyph,r.style.cssText+=";cursor:ew-resize;user-select:none;touch-action:none";for(let g of[p,r])g.addEventListener("pointerdown",y=>{if(y.button)return;y.preventDefault(),s(),g.setPointerCapture?.(y.pointerId);let v=y.clientX,x=m=>{let b=Math.trunc((m.clientX-v)/2);b&&(v+=b*2,d(b*(m.shiftKey?10:1)))},h=()=>{g.removeEventListener("pointermove",x),c()};g.addEventListener("pointermove",x),g.addEventListener("pointerup",h,{once:!0}),g.addEventListener("pointercancel",h,{once:!0})});i.addEventListener("keydown",g=>{g.key!=="ArrowUp"&&g.key!=="ArrowDown"||(g.preventDefault(),d((g.key==="ArrowUp"?1:-1)*(g.shiftKey?10:1)))}),o.append(p)}i instanceof HTMLInputElement&&i.addEventListener("keydown",d=>{d.key==="Enter"&&i.blur()}),o.addEventListener("keydown",d=>{if(d.key!=="Escape")return;let p=d.target===i;if(!t.cancel)return p&&i.blur();d.preventDefault(),d.stopImmediatePropagation(),t.cancel(i,e.property),a(),p&&i.blur(),queueMicrotask(()=>{o.dataset.tokenMode!=="custom"&&o.querySelector(".design-token-binding select")?.focus()})}),o.append(i);let u=bO(i,e,t,a);return o}function sI(e,t,n){let o=document.createElement("button");return o.type="button",o.title=e,o.setAttribute("aria-label",e),o.textContent=t,o.addEventListener("click",n),o}function Xa(e,t,n,o=[]){let i=document.createElement("section");i.className="design-section";let r=document.createElement("div");if(r.className="design-section__tools",r.append(...o),!n){let c=document.createElement("span");return c.className="design-section__title",c.textContent=t,i.append(c,r),i}let a=document.createElement("details");a.className="design-group",a.open=!e.collapsed.has(t);let s=document.createElement("summary");s.textContent=t;let l=document.createElement("div");l.className="design-grid";for(let c of n){let u=UO.find(d=>d.property===c);l.append(KO(e.element.namespaceURI==="http://www.w3.org/2000/svg"&&c==="color"?{...u,label:"Color"}:u,e))}return a.append(s,l),a.addEventListener("toggle",()=>{a.isConnected&&(a.open?e.collapsed.delete(t):e.collapsed.add(t))}),i.append(r,a),i}function VO(e,t){let n=[...e.querySelectorAll(".design-field--color")];n.length&&rI.then(o=>o?.liveColors(n,t,UT))}function lI(e,t){let{element:n,changed:o}=t;iI.then(p=>p?.attach(e,t.element,t.reserved)),aI.then(p=>p?.enhance(e,t.element));let i=getComputedStyle(n);if(n.namespaceURI==="http://www.w3.org/2000/svg")return e.append(Xa(t,"Layout",n.localName==="svg"?["width","height","display"]:["display"]),Xa(t,"Appearance",["color","fill","stroke","stroke-width"])),VO(e,n);let r=p=>p.some(g=>o?.has(g)),a=!!n.textContent?.trim()||/(?:^|;)\s*(?:color|font|line-height|text-align)/.test(n.getAttribute("style")??"")||r(BO),s=/flex|grid/.test(i.display)||r(["gap"]),l=qO(i.backgroundColor)!=="transparent"||r(["background-color"]),c=["top","right","bottom","left"].some(p=>parseFloat(i.getPropertyValue(`border-${p}-width`))>0&&i.getPropertyValue(`border-${p}-style`)!=="none")||r(["border","border-width","border-style","border-color"]),u=i.boxShadow&&i.boxShadow!=="none"||r(["box-shadow"]),d=(p,g,y,v)=>sI(`Add ${p}`,"+",()=>{let x=document.createElement("input");t.begin(x,g),t.apply(x,g,y),t.commit(x,g),t.rerender(),e.querySelector(`[data-property="${v}"]`)?.focus()});e.append(Xa(t,"Layout",["width","height","padding",...s?["gap"]:[],"margin",...c?[]:["border-radius"],"display"])),a&&e.append(Xa(t,"Typography",BO,[t.editText])),e.append(l?Xa(t,"Fill",["background-color"]):Xa(t,"Fill",null,[d("fill","background-color","#ffffff","background-color")]),c?Xa(t,"Border",["border-width","border-radius","border-style","border-color"]):Xa(t,"Border",null,[d("border","border","1px solid","border-width")]),Xa(t,"Effects",u?["opacity","box-shadow"]:["opacity"],u?[]:[d("shadow","box-shadow","0 1px 3px rgba(0, 0, 0, 0.12)","box-shadow")])),VO(e,n)}var UO,iI,rI,aI,BO,GO=O(()=>{"use strict";i0();i0();wO();kO();Li();UO=[{property:"width",label:"Width",kind:"size",glyph:"W"},{property:"height",label:"Height",kind:"size",glyph:"H"},{property:"padding",label:"Padding",kind:"length",glyph:"M1.5 1.5h9v9h-9zM4.5 4.5h3v3h-3z",max:200},{property:"gap",label:"Gap",kind:"length",glyph:"M1.5 1.5h3v9h-3zM7.5 1.5h3v9h-3z",max:200},{property:"margin",label:"Margin",kind:"length",glyph:"M4 4h4v4H4zM1 3V1h2m6 0h2v2m0 6v2H9m-6 0H1V9",max:200},{property:"border-radius",label:"Corner radius",kind:"length",glyph:"M1.5 10.5V6A4.5 4.5 0 0 1 6 1.5h4.5",max:96},{property:"display",label:"Layout",kind:"select",values:["block","flex","grid","inline-flex","inline-grid"]},{property:"font-family",label:"Font family",kind:"text",wide:!0,placeholder:"system-ui, sans-serif"},{property:"font-size",label:"Font size",kind:"length",wide:!0,glyph:"M2 3V1.5h8V3M6 1.5v9m-1.5 0h3",min:1,max:160},{property:"line-height",label:"Line height",kind:"text",glyph:"M1 1.5h10M1 10.5h10M3.5 8.5 6 3l2.5 5.5",placeholder:"1.4 or 24px"},{property:"letter-spacing",label:"Letter spacing",kind:"text",glyph:"M1 2.5v7M11 2.5v7M3.5 9.5 6 2.5l2.5 7M4.4 7h3.2",placeholder:"0 or 0.02em"},{property:"font-weight",label:"Weight",kind:"select",values:["300","400","500","600","700","800"]},{property:"text-align",label:"Alignment",kind:"select",values:["left","center","right","justify"]},{property:"color",label:"Text color",kind:"color",wide:!0},{property:"background-color",label:"Fill",kind:"color",wide:!0},{property:"border-width",label:"Border width",kind:"length",glyph:"M1 2.5h10M1 6h10M1 9.5h10",max:24},{property:"border-style",label:"Border style",kind:"select",values:["none","solid","dashed","dotted"]},{property:"border-color",label:"Border color",kind:"color"},{property:"fill",label:"Fill",kind:"color",wide:!0},{property:"stroke",label:"Stroke",kind:"color",wide:!0},{property:"opacity",label:"Layer opacity",kind:"text",glyph:"M6 1.5a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9v9",min:0,max:1,step:.01,placeholder:"0\u20131"},{property:"box-shadow",label:"Shadow",kind:"text",wide:!0},{property:"stroke-width",label:"Stroke width",kind:"length",min:0,max:24}],iI=Promise.resolve().then(()=>(VT(),BT)).catch(()=>null),rI=Promise.resolve().then(()=>(zO(),HO)).catch(()=>null),aI=Promise.resolve().then(()=>(PO(),jO)).catch(()=>null),BO=["font-family","font-size","line-height","letter-spacing","font-weight","text-align","color"]});function FO(e,t=!1){return e.composedPath().some(n=>Kn(n)&&!(t&&n.matches("button,a[href],summary")&&!n.matches("[contenteditable],[inert],[role]:not([role=button]):not([role=link])"))&&n.matches('input,textarea,select,button,a[href],summary,dialog,[contenteditable]:not([contenteditable="false"]),[inert],[role]:not([role="none"]):not([role="presentation"]):not([role="img"]):not([role="group"]):not([role="region"]):not([role="main"]):not([role="article"]):not([role="heading"]):not([role="paragraph"]):not([role="generic"])'))}function YO(e){let t=e.keys??eu(),n=a=>{let s=a.composedPath()[0];s instanceof HTMLSelectElement&&a.composedPath().includes(e.host)&&!br(s)&&!a.ctrlKey&&!a.metaKey&&!a.altKey&&(/^[b?]$/i.test(a.key)||e.reserved?.(a))&&a.preventDefault()},{root:o,signal:i}=e;addEventListener("keydown",n,{signal:i}),o?.addEventListener("keydown",a=>Ju(a,o)&&n(a),{signal:i});let r=(a,s)=>{let l=o?.activeElement??document.activeElement,c=l?.closest("[data-field-property]")?.dataset.fieldProperty;a.click();let u=e.selected();u&&(!s.includes(e.host)||l?.matches(".design-geometry__frame"))&&e.select(u);let d=l?.isConnected?l:c&&o?.querySelector(`[data-field-property="${CSS.escape(c)}"] ${l.localName}`);d instanceof HTMLElement&&d.focus({preventScroll:!0}),!s.includes(e.host)&&o?.activeElement!==as()&&o?.activeElement?.blur()};return a=>{if(a.isComposing||a.keyCode===229)return!1;let s=a.key.toLowerCase(),l=a.composedPath(),c=br(l[0]),u=po()?a.metaKey&&!a.ctrlKey:a.ctrlKey&&!a.metaKey,d=c||!u||a.altKey?void 0:s==="z"?a.shiftKey?e.redo:e.undo:s==="y"&&!po()&&!a.shiftKey?e.redo:void 0;if(d)return d.disabled?!1:(a.preventDefault(),a.stopImmediatePropagation(),r(d,l),!0);if(s==="escape")return c?(l.some(H=>Kn(H)&&H.matches("[data-field-property]"))||(a.preventDefault(),l[0].blur()),!0):l.some(H=>Kn(H)&&H.matches("[popover],[role=listbox]"));if(a.defaultPrevented||e.reserved?.(a))return!1;let p=!a.altKey&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey,g=Bo(a,t.before)?!0:Bo(a,t.after)?!1:void 0,y=c||l.some(H=>Kn(H)&&H.matches("input[type=range],[role=slider],.design-geometry__frame"));if(!e.compare.hidden&&(g!==void 0&&!y||p&&s==="b"&&!c))return a.preventDefault(),a.stopImmediatePropagation(),e.compareBefore(g),!0;if(a.key==="?"&&e.help&&!c&&!a.altKey&&!a.ctrlKey&&!a.metaKey)return a.preventDefault(),a.stopImmediatePropagation(),e.help(),!0;let v=p&&s===" ";if(p&&s==="enter"&&!a.repeat){let H=c||l.some(z=>Kn(z)&&z.matches("[data-field-property],[popover],[role=listbox],[role=menu],textarea,.new-comment-composer,.reply-composer")),R=l.includes(e.host)&&FO(a);if(!H&&!R)return e.selected()?.isConnected&&e.comment?.()?(a.preventDefault(),a.stopImmediatePropagation(),!0):!1}if(l.includes(e.host)||FO(a,v))return!1;let h=e.selected(),m=H=>fn(H)&&H.isConnected&&H!==H.ownerDocument.body&&H!==H.ownerDocument.documentElement&&!e.host.contains(H)&&!H.matches("script,style,defs,title,desc,metadata,[hidden],[inert]")&&getComputedStyle(H).display!=="none"&&getComputedStyle(H).visibility!=="hidden",b=Xn(),E=b.activeElement,S=!E||E===b.body||E===b.documentElement||E===h,A=null,_=Bo(a,t.next)?"nextElementSibling":Bo(a,t.prev)?"previousElementSibling":void 0,T=a.altKey&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey;if(h?.isConnected&&_){for(A=h[_];A&&!m(A);)A=A[_];a.preventDefault(),a.stopImmediatePropagation()}else h?.isConnected&&S&&(Bo(a,t.child)||T&&s==="arrowdown")?A=[...h.children].find(m)??null:h?.isConnected&&(Bo(a,t.parent)||T&&s==="arrowup")?A=h.parentElement:v&&(A=E);return m(A)?(a.preventDefault(),a.stopImmediatePropagation(),A.scrollIntoView?.({block:"nearest",inline:"nearest"}),e.select(A),!0):a.defaultPrevented}}function cI(e){let t=e.closest("[data-field-property]")?.dataset.fieldProperty,n=t?`[data-field-property=${JSON.stringify(t)}] `:"",o=e.getAttribute("data-property"),i=e.getAttribute("aria-label");return o?`${e.localName}[data-property=${JSON.stringify(o)}]`:i?`${n}${e.localName}[aria-label=${JSON.stringify(i)}]`:e.id?`[id=${JSON.stringify(e.id)}]`:n&&`${n}${e.localName}`}function XO(e,t,n,o){let i=e.getRootNode(),r=cI(t),a=()=>!i.activeElement&&(!document.activeElement||document.activeElement===document.body),s=d=>{c.disconnect(),clearTimeout(u),n(),d&&a()&&o()},l=()=>{if(!a())return s(!1);let d=r?e.querySelector(r):null;d&&(d.focus({preventScroll:!0}),s(!1))},c=new MutationObserver(l);c.observe(e,{childList:!0,subtree:!0});let u=setTimeout(s,400,!0);return s}var WO=O(()=>{"use strict";Fs();It();ea();ho();wy()});var XT={};Ft(XT,{colorChannels:()=>t$,documentColors:()=>n$,formatColor:()=>aa,formats:()=>KT,hslToRgb:()=>GT,hsvToRgb:()=>IT,matchingToken:()=>r$,parseColor:()=>hu,pickerEditor:()=>pI,recentColors:()=>YT,rememberColor:()=>i$,rgbToHsl:()=>FT,rgbToHsv:()=>e$});function IT(e,t,n){let o=i=>{let r=(i+e/60)%6;return(n-n*t*Eo(Math.min(r,4-r),0,1))*255};return[o(5),o(3),o(1)]}function GT(e,t,n){let o=t*Math.min(n,1-n),i=r=>{let a=(r+e/30)%12;return(n-o*Eo(Math.min(a-3,9-a),-1,1))*255};return[i(0),i(8),i(4)]}function e$(e,t,n){let o=Math.max(e,t,n),i=o-Math.min(e,t,n);return[JO(e,t,n,o,i),o?i/o:0,o/255]}function FT(e,t,n){let o=Math.max(e,t,n),i=Math.min(e,t,n),r=o-i,a=(o+i)/510;return[JO(e,t,n,o,r),r?r/255/(1-Math.abs(2*a-1)):0,a]}function hu(e){let t=e.trim().toLowerCase();if(t==="transparent")return[0,0,0,0];let n=/^#?([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/.exec(t)?.[1];if(n){let c=n.length<5?[...n].map(d=>d+d).join(""):n,u=d=>parseInt(c.slice(d,d+2),16);return[u(0),u(2),u(4),c.length>6?u(6)/255:1]}let o=/^(rgb|hsl|hs[bv])a?\(([^)]*)\)$/.exec(t);if(o){let c=o[2].split(/[\s,/]+/).filter(Boolean),u=(x="1",h=1)=>/^-?(\d+\.?\d*|\.\d+)(%|deg)?$/.test(x)?parseFloat(x)/(x.endsWith("%")?100:1)*(x.endsWith("%")?h:1):NaN;if(c.length<3||c.length>4)return;let[d,p,g]=o[1]==="rgb"?c.slice(0,3).map(x=>u(x,255)):[u(c[0]),parseFloat(c[1])/100,parseFloat(c[2])/100],y=o[1]==="rgb"?[d,p,g]:(o[1]==="hsl"?GT:IT)((d%360+360)%360,Eo(p,0,1),Eo(g,0,1)),v=u(c[3]);return[...y,v].some(Number.isNaN)?void 0:[...y.map(x=>Eo(x,0,255)),Eo(v,0,1)]}if(/var\(|currentcolor|^$/.test(t)||!globalThis.CSS?.supports?.("color",t))return;let i=w("canvas").getContext?.("2d",{willReadFrequently:!0});if(!i)return;i.fillStyle=t,i.fillRect(0,0,1,1);let[r,a,s,l]=i.getImageData(0,0,1,1).data;return[r,a,s,l/255]}function aa([e,t,n,o],i,r){if(i==="RGB"||i==="CSS")return`rgb(${si(e)} ${si(t)} ${si(n)}${ZO(o)})`;if(i==="HSL"){let[a,s,l]=FT(e,t,n);return`hsl(${si(s?a:r??a)} ${ra(s)}% ${ra(l)}%${ZO(o)})`}return`#${a0(e)}${a0(t)}${a0(n)}${o<1?a0(o*255):""}`}function t$(e,t,n){let[o,i,r,a]=e;if(t==="CSS")return[aa(e,"CSS")];if(t==="Hex")return[aa([o,i,r,1],"Hex").slice(1).toUpperCase(),String(ra(a))];let[s,l,c]=t==="HSL"?FT(o,i,r):n;return[...(t==="RGB"?[o,i,r]:[t==="HSB"||l?s:n[0],l*100,c*100]).map(d=>String(si(d))),String(ra(a))]}function n$(e=document.body,t=12,n=600){let o=new Map,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(let r=i.nextNode(),a=0;r&&a<n;r=i.nextNode(),a++){if(r.hasAttribute("data-branch-comments"))continue;let s=getComputedStyle(r);for(let l of["color","background-color","border-top-color","fill","stroke"]){if(l==="border-top-color"&&!parseFloat(s.borderTopWidth))continue;let c=hu(s.getPropertyValue(l));if(!c?.[3])continue;let u=aa(c,"Hex");o.set(u,(o.get(u)??0)+1)}}return[...o].sort((r,a)=>a[1]-r[1]).slice(0,t).map(([r])=>r)}function YT(){try{let e=JSON.parse(localStorage.getItem(o$())??"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"&&hu(t)).slice(0,8):[]}catch{return[]}}function i$(e){try{localStorage.setItem(o$(),JSON.stringify([e,...YT().filter(t=>t!==e)].slice(0,8)))}catch{}}function r$(e,t,n){let o=aa(e,"Hex");return Xs(t,n).find(i=>i.type==="color"&&i.value&&!/var\(/i.test(i.value)&&(()=>{let r=hu(i.value);return r&&aa(r,"Hex")===o})())}function pI(e,t){let{property:n}=e,o=w("div","palette-color"),i=w("style","",dI),[r,a,s,l]=[0,0,0,1],c="Hex";try{c=KT.find(I=>I===localStorage.getItem("palette:color-format"))??c}catch{}let u=!1,d=!1,p,g=()=>[...IT(r,a,s),l],y=()=>p??aa(g(),c,r),v=()=>p??aa(g(),"Hex"),x=I=>{let[G,te,ie]=e$(I[0],I[1],I[2]);ie&&te&&(r=G),ie&&(a=te),s=ie,l=I[3]},h=I=>{let G=hu(I);return G&&x(G),!!G};h(e.custom.value);let m=v(),b=(I,G)=>{let te=w("div",I);return te.tabIndex=0,te.setAttribute("role","slider"),te.setAttribute("aria-label",G),te.append(w("i")),te},E=b("palette-color__area","Saturation and brightness"),S=b("palette-color__track palette-color__hue","Hue"),A=b("palette-color__track palette-color__alpha","Opacity");S.setAttribute("aria-valuemax","360");for(let I of[E,S,A])I.setAttribute("aria-valuemin","0");E.setAttribute("aria-valuemax","100"),A.setAttribute("aria-valuemax","100");let _=w("span","palette-color__chip");_.setAttribute("aria-hidden","true");let T=w("div","palette-color__tools"),H=globalThis.EyeDropper;if(H&&isSecureContext){let I=w("button","palette-color__drop");I.type="button",I.title="Pick from screen",I.setAttribute("aria-label","Pick color from screen"),I.innerHTML=uI,I.onclick=async()=>{try{let{sRGBHex:G}=await new H().open();o.isConnected&&h(G)&&q(!0)}catch{}},T.append(I)}T.append(_);let R=w("div","palette-color__sliders");R.append(S,A);let z=w("div","palette-color__row");z.append(T,R);let F=w("select");F.setAttribute("aria-label","Color format");for(let I of KT)F.append(new Option(I,I));let B=w("div","palette-color__channels"),le=w("div","palette-color__value");le.append(F,B);let J=w("div","palette-color__swatches"),V=w("div","palette-color__match");V.hidden=!0,o.append(i,E,z,le,J,V);let oe;function ue(I){let G=g(),[te,ie,pe]=G,xe=`rgb(${si(te)} ${si(ie)} ${si(pe)})`;o.style.setProperty("--hue",`hsl(${si(r)} 100% 50%)`),o.style.setProperty("--solid",xe),o.style.setProperty("--color",aa(G,"RGB"));let L=(se,we,Te=50)=>{let $=se.firstElementChild;$.style.left=`${we}%`,$.style.top=`${Te}%`};L(E,a*100,100-s*100),L(S,r/3.6),L(A,l*100),E.setAttribute("aria-valuenow",String(ra(a))),E.setAttribute("aria-valuetext",`Saturation ${ra(a)}%, brightness ${ra(s)}%`),S.setAttribute("aria-valuenow",String(si(r))),S.setAttribute("aria-valuetext",`Hue ${si(r)}\xB0`),A.setAttribute("aria-valuenow",String(ra(l))),A.setAttribute("aria-valuetext",`Opacity ${ra(l)}%`),F.value=c;let Q=t$(G,c,[r,a,s]);B.dataset.format!==c&&Y(),B.querySelectorAll("input").forEach((se,we)=>{let Te=c==="CSS"?y():Q[we];if(se===I||se.value===Te)return;let{selectionStart:$,selectionEnd:D}=se;se.value=Te,se.removeAttribute("aria-invalid"),$!==null&&se===se.getRootNode().activeElement&&se.setSelectionRange($,D)});let Z=r$(G,e.tokens,n);if(V.hidden=!Z,Z&&Z!==oe){oe=Z;let se=Z.label||Z.path;V.replaceChildren(w("span","",`Matches ${se}`),Object.assign(w("button","","Use it"),{type:"button",onclick:()=>t.token(Z)})),V.lastElementChild.setAttribute("aria-label",`Use token ${se}`)}}function q(I,G){if(!d){if(u=!0,G||(p=void 0),ue(G===!0?void 0:G),!I)return t.preview(y());v()!==m&&(t.commit(y()),i$(aa(g(),"Hex"))),m=v()}}function Y(){B.dataset.format=c,B.replaceChildren(...qT[c].map((I,G)=>{let te=w("label"),ie=w("span","",c==="Hex"?G?"%":"#":c==="CSS"?"":I[0]),pe=w("input");pe.setAttribute("aria-label",c==="Hex"&&G?"Opacity":I),pe.spellcheck=!1,pe.autocomplete="off";let xe=c!=="CSS"&&!(c==="Hex"&&!G);xe&&(pe.inputMode="decimal");let L=Z=>{if(c==="CSS"){let fe=!!Z.trim()&&!!globalThis.CSS?.supports?.(n,Z)&&!/[{};]/.test(Z);return fe&&(p=Z.trim(),h(Z)),fe}if(!xe){let fe=l,ye=/^[\da-f]{3}([\da-f]{3})?$/i.test(Z.trim())&&h(Z);return l=fe,ye}let se=Number(Z);if(Z.trim()===""||!Number.isFinite(se))return!1;let we=[...B.querySelectorAll("input")].map(fe=>Number(fe===pe?se:fe.value)),[Te,$,D]=we,j=Eo(we[we.length-1],0,100)/100;if(c==="Hex")return l=j,!0;let X=[Eo(Te,0,QO[qT[c][0]]),Eo($,0,c==="RGB"?255:100),Eo(D,0,c==="RGB"?255:100)];return c==="HSB"?[r,a,s]=[X[0]%360,X[1]/100,X[2]/100]:(x([...c==="RGB"?X:GT(X[0]%360,X[1]/100,X[2]/100),1]),c==="HSL"&&(r=X[0]%360)),l=j,!0};pe.oninput=()=>{u=!0;let Z=L(pe.value);pe.setAttribute("aria-invalid",String(!Z)),Z&&q(!1,pe)},pe.onkeydown=Z=>{Z.key==="Enter"?(Z.preventDefault(),Z.stopPropagation(),pe.getAttribute("aria-invalid")!=="true"&&q(!0,!0)):xe&&(Z.key==="ArrowUp"||Z.key==="ArrowDown")&&(Z.preventDefault(),Q((Z.key==="ArrowUp"?1:-1)*(Z.shiftKey?10:1),!0))},pe.onblur=()=>{pe.getAttribute("aria-invalid")!=="true"&&v()!==m&&q(!0,!0)},pe.onpaste=Z=>{let se=Z.clipboardData?.getData("text")??"",we=hu(se);!we||!xe&&/^#?[\da-f]{6}$/i.test(se.trim())||(Z.preventDefault(),c==="CSS"?p=se.trim():x(we),q(!0,c==="CSS"||void 0))};let Q=(Z,se)=>{let we=Number(pe.value)||0,Te=c==="Hex"||G===qT[c].length-1?100:QO[I]??(c==="RGB"?255:100);pe.value=String(Eo(si(we+Z),0,Te)),L(pe.value)&&q(se)};return xe&&(ie.title=`${I} \xB7 drag to adjust`,ie.onpointerdown=Z=>{Z.preventDefault(),ie.setPointerCapture?.(Z.pointerId);let se=Z.clientX;ie.onpointermove=we=>{let Te=Math.trunc((we.clientX-se)/2);Te&&(se+=Te*2,Q(Te*(we.shiftKey?10:1),!1))},ie.onpointerup=ie.onpointercancel=()=>{ie.onpointermove=null,q(!0)}}),te.append(ie,pe),te}))}F.onchange=()=>{c=F.value,p=void 0;try{localStorage.setItem("palette:color-format",c)}catch{}ue()};let W=(I,G,te)=>{let ie=pe=>{let xe=I.getBoundingClientRect();G(Eo((pe.clientX-xe.left)/xe.width,0,1),Eo((pe.clientY-xe.top)/xe.height,0,1)),q(!1)};I.onpointerdown=pe=>{pe.button||(pe.preventDefault(),I.focus({preventScroll:!0,focusVisible:!1}),I.setPointerCapture?.(pe.pointerId),ie(pe),I.onpointermove=ie,I.onpointerup=I.onpointercancel=()=>{I.onpointermove=null,q(!0)})},I.onkeydown=pe=>{te(pe.key,pe.shiftKey?10:1)&&(pe.preventDefault(),pe.stopPropagation(),q(!0))}};W(E,(I,G)=>{a=I,s=1-G},(I,G)=>{let te=G/100;if(I==="ArrowLeft"||I==="ArrowRight")a=Eo(a+(I==="ArrowRight"?te:-te),0,1);else if(I==="ArrowUp"||I==="ArrowDown")s=Eo(s+(I==="ArrowUp"?te:-te),0,1);else if(I==="Home"||I==="End")a=I==="End"?1:0;else if(I==="PageUp"||I==="PageDown")s=Eo(s+(I==="PageUp"?.1:-.1),0,1);else return!1;return!0});let C=(I,G,te)=>(ie,pe)=>{let xe=ie==="Home"?0:ie==="End"?te:G()+{ArrowRight:pe,ArrowUp:pe,ArrowLeft:-pe,ArrowDown:-pe,PageUp:10,PageDown:-10}[ie];return Number.isNaN(xe)?!1:(I(Eo(xe,0,te)),!0)};W(S,I=>{r=I*360},C(I=>{r=I},()=>r,360)),W(A,I=>{l=I},C(I=>{l=I/100},()=>l*100,100));let U=()=>{let I=YT(),G=new Set(I.map(pe=>pe.toLowerCase())),te=[...I.map(pe=>[pe,"Recent"]),...n$().filter(pe=>!G.has(pe.toLowerCase())).map(pe=>[pe,"Document"])].slice(0,8),ie=w("div");ie.setAttribute("role","group"),ie.setAttribute("aria-label","Recent and page colors"),ie.append(...te.map(([pe,xe])=>{let L=w("button");return L.type="button",L.title=pe,L.setAttribute("aria-label",`${xe} color ${pe}`),L.style.setProperty("--color",pe),L.onclick=()=>{h(pe)&&q(!0)},L})),J.replaceChildren(...te.length?[ie]:[]),J.hidden=!te.length};return setTimeout(()=>{o.isConnected&&U()},16),ue(),Object.assign(o,{live:!0,destroy(){d=!0},refresh(I){u||!h(I)||(m=v(),ue())}})}var KT,Eo,si,ra,a0,JO,ZO,qT,QO,o$,dI,uI,WT=O(()=>{"use strict";It();lc();KT=["Hex","RGB","HSL","HSB","CSS"],Eo=(e,t,n)=>Math.min(n,Math.max(t,e)),{round:si}=Math,ra=e=>si(e*100),a0=e=>si(e).toString(16).padStart(2,"0");JO=(e,t,n,o,i)=>i?60*(o===e?((t-n)/i+6)%6:o===t?(n-e)/i+2:(e-t)/i+4):0;ZO=(e,t=!1)=>e<1?`${t?",":" /"} ${ra(e)}%`:"";qT={Hex:["Hex","Opacity"],RGB:["Red","Green","Blue","Opacity"],HSL:["Hue","Saturation","Lightness","Opacity"],HSB:["Hue","Saturation","Brightness","Opacity"],CSS:["CSS color"]},QO={Red:255,Green:255,Blue:255,Hue:360};o$=()=>`palette:colors:${document.querySelector("[data-branch-comments]")?.getAttribute("data-branch-comments")||location.host}`;dI=`.palette-color{display:grid;gap:8px;padding:8px}.palette-color__area{position:relative;aspect-ratio:4/3;border-radius:6px;background:linear-gradient(to top,#000,#0000),linear-gradient(to right,#fff,#0000),var(--hue);cursor:crosshair;touch-action:none}.palette-color__area>i,.palette-color__track>i{position:absolute;width:12px;height:12px;box-sizing:border-box;border:2px solid #fff;border-radius:50%;box-shadow:0 0 0 1px #0006,inset 0 0 0 1px #0004;translate:-50% -50%;pointer-events:none}.palette-color__row{display:flex;align-items:center;gap:8px}.palette-color__tools{display:flex;align-items:center;gap:4px}.palette-color__sliders{display:grid;flex:1;gap:8px;min-width:0}.palette-color__track{position:relative;height:10px;border-radius:5px;cursor:pointer;touch-action:none}.palette-color__track>i{top:50%;width:14px;height:14px}.palette-color__hue{background:linear-gradient(to right,red,#ff0,lime,cyan,blue,#f0f,red)}.palette-color__alpha,.palette-color__chip,.palette-color__swatches button{background:linear-gradient(var(--color),var(--color)),repeating-conic-gradient(#ffffff40 0 25%,#ffffff12 0 50%) 0 0/8px 8px}.palette-color__alpha{background:linear-gradient(to right,#0000,var(--solid)),repeating-conic-gradient(#ffffff40 0 25%,#ffffff12 0 50%) 0 0/8px 8px}.palette-color__chip{width:20px;height:20px;border-radius:5px;box-shadow:inset 0 0 0 1px #ffffff26}.palette-color__drop{display:grid;place-items:center;width:24px;height:24px;padding:0;border:0;border-radius:5px;background:none;color:#b5b1ab;cursor:pointer}.palette-color__drop:hover{background:#ffffff14;color:#f1efeb}.palette-color__drop svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}.palette-color__value{display:flex;gap:4px;min-width:0}.palette-color__value select{flex:none;width:64px;height:24px;padding:0 16px 0 6px;border:0;border-radius:5px;box-shadow:none;appearance:none;background:#ffffff0a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 3 4 5.5 6.5 3' fill='none' stroke='%23898680' stroke-width='1.2'/%3E%3C/svg%3E") right 5px center/8px no-repeat;color:#f1efeb;font:inherit;cursor:pointer}.palette-color__channels{display:flex;flex:1;min-width:0;border-radius:5px;background:#ffffff0a}.palette-color__channels label{display:flex;flex:1;align-items:center;min-width:0}.palette-color__channels label:first-child{flex:2.2}.palette-color__channels[data-format=RGB] label:first-child,.palette-color__channels[data-format=HSL] label:first-child,.palette-color__channels[data-format=HSB] label:first-child{flex:1}.palette-color__channels span{flex:none;width:12px;color:#77736f;font-size:9px;text-align:center;cursor:ew-resize;user-select:none;touch-action:none}.palette-color__channels span:hover{color:#e9e6e1}.palette-color__channels input{width:100%;min-width:0;height:24px;box-sizing:border-box;padding:0 2px;border:0;border-radius:0;outline:0;box-shadow:none;background:none;color:#f1efeb;font:inherit;font-variant-numeric:tabular-nums}.palette-color__channels input:focus,.palette-color__channels input:focus-visible{outline:0;box-shadow:none}.palette-color__channels:hover{box-shadow:inset 0 0 0 1px #ffffff1c}.palette-color__channels:focus-within{box-shadow:inset 0 0 0 1px #bda6ef}.palette-color__channels [aria-invalid=true]{color:#f8a898}.palette-tokens .palette-color small{position:static;display:block;margin:2px 0 4px;padding:0;background:none;color:#77736f;font-size:10px}.palette-color__swatches>div{display:flex;gap:4px;overflow:hidden}.palette-color__swatches button{width:16px;height:16px;padding:0;border:0;border-radius:4px;box-shadow:inset 0 0 0 1px #ffffff26;cursor:pointer}.palette-color__match{display:flex;align-items:center;gap:6px;color:#b5b1ab;font-size:10px}.palette-color__match span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.palette-color__match button{padding:0;border:0;background:none;color:#bda6ef;font:inherit;cursor:pointer}.palette-color [role=slider]:focus-visible,.palette-color button:focus-visible{outline:1px solid #bda6ef;outline-offset:2px}.palette-color select:focus-visible{outline:0;box-shadow:inset 0 0 0 1px #bda6ef}@media (pointer:coarse){.palette-color__track{height:16px}.palette-color__value select,.palette-color__channels input{height:32px}.palette-color__swatches button{width:24px;height:24px}}`,uI='<svg viewBox="0 0 16 16" aria-hidden="true"><path d="m9.5 3.5 3 3M11 2a1.4 1.4 0 0 1 2 2l-1.5 1.5-2-2zM10 5 4 11l-1 3 3-1 6-6"/></svg>'});function fI(e,t="box-shadow"){if(e==="none")return[];let n=[];for(let o of gu(e,!0)){let i=gu(o),r=[],a="",s=!1,l=!1;for(let c of i){if(c==="inset"&&t==="box-shadow"&&!s){s=!0;continue}if(bu.test(c)){if(l)return;r.push(c)}else if(!a&&!/var\(/i.test(c)&&CSS.supports("color",c))a=c,l=r.length>0;else return}if(r.length<2||r.length>(t==="box-shadow"?4:3))return;n.push({lengths:r,color:a,inset:s})}return n.length?n:void 0}function pm(e){return e.filter(t=>!t.hidden).map(t=>[...t.inset?["inset"]:[],...t.lengths,t.color].filter(Boolean).join(" ")).join(", ")||"none"}function mI(e){let t=document.createElement("i").style;t.color=e.trim(),t.color&&(e=t.color);let n=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:\s*[,/]\s*([\d.]+)(%?))?\s*\)$/i.exec(e.trim());if(!n)return e||"currentColor";let o=`#${n.slice(1,4).map(r=>Math.round(Number(r)).toString(16).padStart(2,"0")).join("")}`,i=n[4]===void 0?1:Number(n[4])/(n[5]?100:1);return i<1?`${o} \xB7 ${Math.round(i*100)}%`:o}function JT(e){let t=gI.exec(e);if(!t)return;let n=t[1].trim().split(/\s+/).filter(Boolean);return{style:n.filter(o=>/^(italic|oblique|small-caps)$/i.test(o)).join(" "),weight:n.find(o=>/^(bold|bolder|lighter|[1-9]00)$/i.test(o))??"",size:t[2],lineHeight:t[3]??"",family:t[4]??""}}function ZT(e){return[e.style,e.weight,e.size+(e.lineHeight?`/${e.lineHeight}`:""),e.family].filter(Boolean).join(" ")}function hI(e,t){let n=bu.exec(e.trim());if(!n)return e;let o=!n[2]||/^r?em$/i.test(n[2]);return`${Math.round((parseFloat(n[1])+t*(o?.1:1))*1e3)/1e3}${n[2]}`}function QT(e,t,n,o){let i=w("button","palette-typed__icon");return i.type="button",i.innerHTML=t,i.title=e,i.setAttribute("aria-label",e),o!==void 0&&i.setAttribute("aria-pressed",String(o)),i.onclick=n,i}function s0(e,t,n,o,i,{unitless:r=!1,optional:a=!1}={}){let s=w("div","palette-typed__field"),l=w("span");t?l.textContent=t:l.innerHTML=wI,l.title=`${e} \xB7 drag to adjust`;let c=w("input");c.setAttribute("aria-label",e),c.inputMode="decimal",c.autocomplete="off",c.spellcheck=!1;let u=w("select");u.setAttribute("aria-label",`${e} unit`);let d=bu.exec(n)??["","",""];c.value=d[1];let p=d[2]||(r||!d[1]&&a?"":"px");for(let x of new Set([p,...bI,...r?[""]:[]])){let h=w("option","",x||"\u2014");h.value=x,x||(h.title="No unit"),u.append(h)}u.value=p;let g=!1,y=x=>{let h=a&&!c.value.trim(),m=h||bu.test(c.value.trim()+u.value);m?i.delete(c):i.add(c);let b=m&&o(h?"":c.value.trim()+u.value,x);return c.setAttribute("aria-invalid",String(!m)),x&&(g=!1),b},v=(x,h)=>{let m=bu.exec(hI(c.value.trim()+u.value,x));m&&(c.value=m[1],y(h))};return c.oninput=()=>{g=!0,y(!1)},c.onkeydown=x=>{x.key==="Enter"?(x.preventDefault(),x.stopPropagation(),y(!0)):(x.key==="ArrowUp"||x.key==="ArrowDown")&&(x.preventDefault(),v((x.key==="ArrowUp"?1:-1)*(x.shiftKey?10:1),!0))},c.onblur=()=>{g&&y(!0)},u.onchange=()=>y(!0),l.onpointerdown=x=>{if(x.button)return;x.preventDefault(),l.setPointerCapture?.(x.pointerId);let h=x.clientX,m=!1;l.onpointermove=b=>{let E=Math.trunc((b.clientX-h)/2);E&&(h+=E*2,m=!0,v(E*(b.shiftKey?10:1),!1))},l.onpointerup=l.onpointercancel=()=>{l.onpointermove=l.onpointerup=l.onpointercancel=null,m?y(!0):c.focus()}},s.append(l,c,u),s}function s$(e,t,n,o,i,r,a=[],s=()=>{}){let l=w("div","palette-typed"),c=w("details","palette-typed palette-typed__advanced"),u=w("summary","","Edit as CSS");u.onclick=x=>{x.preventDefault(),x.stopPropagation(),c.open=!c.open};let d=w("div","palette-typed__field");o.title=t,o.autocomplete="off",o.spellcheck=!1,d.append(w("span","","CSS"),o),c.append(u,d),e.append(l,c);let p=!1,g=new Set;o.oninput=()=>{p=!0,i(o.value,!1)&&v(o.value,!0)},o.onkeydown=x=>{x.key==="Enter"&&(x.preventDefault(),x.stopPropagation(),p=!1,i(o.value,!0))},o.onblur=()=>{p&&(p=!1,i(o.value,!0))};let y=(x,h,m,b,E,S)=>{let A=w("select","palette-typed__menu");A.setAttribute("aria-label",x);for(let[_,T]of h){let H=w("option","",T);H.value=_,H.title=_,S&&_&&(H.style[S]=_),A.append(H)}return A.value=m,A.onchange=()=>b(A.value),E&&A.addEventListener("palette-preview",_=>{let T=_.detail;s(T===null?void 0:E(T))}),A};function v(x,h=!1){if(h||(o.value=x),g.clear(),l.replaceChildren(),t==="font-family"){let m=w("div","palette-typed__sample"),b=w("b","","Aa"),E=w("span","",Qs(x));m.title=x,b.style.fontFamily=x,m.append(b,E),l.append(m);let S=a.filter(A=>A.type==="fontFamily"&&A.value&&CSS.supports(t,A.value));S.length?l.append(y("Font family choices",[[x,`Custom \xB7 ${Qs(x)}`],...S.map(A=>[A.value,A.label||Qs(A.value)])],x,A=>{i(A,!0)&&v(A)},A=>A,"fontFamily")):c.open=!0}else if(/^(box|text)-shadow$/.test(t)){let m=fI(x,t);if(!m){l.append(w("span","palette-typed__hint","Complex shadow \xB7 edit it as CSS below.")),c.open=!0;return}let b=t==="box-shadow",E=w("div","palette-typed__tile"),S=w("i","",b?"":"Ag");E.setAttribute("aria-hidden","true"),E.append(S);let A=T=>(S.style.setProperty(t,pm(m)),i(pm(m),T));S.style.setProperty(t,pm(m));let _=w("div","palette-typed__head");_.append(w("b","","Layers"),QT("Add shadow layer",vI,()=>{m.push({lengths:["0px","2px","4px","0px"].slice(0,b?4:3),color:"#00000040",inset:!1}),A(!0)&&v(pm(m))})),l.append(E,_),m.forEach((T,H)=>{let R=`Layer ${H+1}`,z=w("div","palette-typed__layer");z.setAttribute("role","group"),z.setAttribute("aria-label",`Shadow layer ${H+1}`),z.toggleAttribute("data-hidden",!!T.hidden);let F=w("div","palette-typed__row");b&&F.append(y(`${R} type`,[["drop","Drop"],["inner","Inner"]],T.inset?"inner":"drop",C=>{T.inset=C==="inner",A(!0)}));let B=w("button","palette-typed__color");B.type="button",B.setAttribute("aria-label",`${R} color`),B.setAttribute("aria-expanded","false");let le=w("i"),J=w("span"),V=w("span","palette-typed__alpha");B.append(le,J,V);let oe=()=>{let[C,U="100%"]=mI(T.color).split(" \xB7 ");le.style.setProperty("--c",T.color||"currentColor"),J.textContent=C.replace(/^#/,"").toUpperCase(),V.textContent=T.color?U:"",B.title=T.color||"currentColor"};oe();let ue;B.onclick=async()=>{if(ue){ue.remove(),ue=void 0,B.setAttribute("aria-expanded","false");return}B.setAttribute("aria-expanded","true");let{pickerEditor:C}=await Promise.resolve().then(()=>(WT(),XT));!B.isConnected||ue||(ue=C({trigger:B,tokens:a,property:"color",onSelect(){},custom:{value:T.color||"#000000",onPreview:()=>()=>{},onSelect(){}}},{preview(U){T.color=U,oe(),A(!1)},commit(U){T.color=U,oe(),A(!0)},token(U){T.color=U.value,oe(),A(!0)}}),z.append(ue))};let q=QT(`${R} visible`,yI,()=>{T.hidden=!T.hidden,q.setAttribute("aria-pressed",String(!T.hidden)),z.toggleAttribute("data-hidden",!!T.hidden),A(!0)},!T.hidden);F.append(B,q,QT(`Remove layer ${H+1}`,xI,()=>{m.splice(H,1),A(!0)&&v(pm(m))}));let Y=w("div","palette-typed__grid");[["X offset","X"],["Y offset","Y"],["Blur","Blur"],["Spread","Spread"]].slice(0,b?4:3).forEach(([C,U],I)=>Y.append(s0(`${R} ${C.toLowerCase()}`,U,T.lengths[I]||"0px",(G,te)=>{for(;T.lengths.length<=I;)T.lengths.push("0px");return T.lengths[I]=G,!g.size&&A(te)},g))),z.append(F,Y),l.append(z)})}else if(t==="font"){let m=JT(x);if(!m){l.append(w("span","palette-typed__hint","Custom expression \xB7 edit it as CSS below.")),c.open=!0;return}let b=w("div","palette-typed__sample"),E=w("b","","Aa"),S=w("span");b.setAttribute("aria-hidden","true"),b.append(E,S);let A=()=>{Object.assign(E.style,{fontStyle:m.style,fontWeight:m.weight,fontFamily:m.family}),S.textContent=[m.family?Qs(m.family):"Inherited family",m.weight,m.size+(m.lineHeight?`/${m.lineHeight}`:"")].filter(Boolean).join(" \xB7 ")},_=R=>(A(),i(ZT(m),R));A();let T=a.filter(R=>R.type==="fontFamily"&&R.value&&CSS.supports("font-family",R.value)&&R.value!==m.family),H=w("div","palette-typed__grid palette-typed__font");H.append(y("Font weight",[...new Set([m.weight||"400","100","200","300","400","500","600","700","800","900"])].map(R=>[R,R]),m.weight||"400",R=>{m.weight=R,_(!0)},R=>ZT({...m,weight:R}),"fontWeight"),s0("Font size","Size",m.size,(R,z)=>(m.size=R,!g.size&&_(z)),g),s0("Line height","LH",m.lineHeight,(R,z)=>(m.lineHeight=R,!g.size&&_(z)),g,{unitless:!0,optional:!0})),l.append(b,y("Font family",[[m.family,m.family?Qs(m.family):"Inherited family"],...T.map(R=>[R.value,R.label||Qs(R.value)])],m.family,R=>{m.family=R,_(!0)},R=>ZT({...m,family:R}),"fontFamily"),H)}else if(r?.values?.length)l.append(y(r.label,[...new Set([x,...r.values])].map(m=>[m,m]),x,m=>i(m,!0),m=>m));else{let m=gu(x),b=/^(padding|margin|border-(width|radius)|gap)$/.test(t);if(m.length&&m.every(E=>bu.test(E))&&(m.length===1||b&&m.length<=4)){let E=r?.label||t,S=m.length===1?[[E,""]]:t==="gap"?[["Row gap","Row"],["Column gap","Col"]]:t==="border-radius"?[["Top left","TL"],["Top right","TR"],["Bottom right","BR"],["Bottom left","BL"]]:[["Top","T"],["Right","R"],["Bottom","B"],["Left","L"]];if(m.length>1&&t!=="gap"){let[_,T=_,H=_,R=T]=m;m.splice(0,m.length,_,T,H,R)}let A=m.map((_,T)=>s0(S[T][0],S[T][1],_,(H,R)=>(m[T]=H,!g.size&&i(m.join(" "),R)),g));if(A.length>1){let _=w("div","palette-typed__grid");_.append(...A),l.append(_)}else l.append(...A)}else l.append(w("span","palette-typed__hint","Custom expression \xB7 preserved exactly below.")),c.open=!0}}return v(n),v}var bu,gI,a$,bI,yI,xI,vI,wI,l$=O(()=>{"use strict";OT();It();bu=/^([+-]?(?:\d*\.)?\d+)([a-z%]*)$/i;gI=/^\s*((?:(?:italic|oblique|normal|small-caps|bold|bolder|lighter|[1-9]00)\s+)*)([+-]?(?:\d*\.)?\d+[a-z%]*)(?:\s*\/\s*((?:\d*\.)?\d+[a-z%]*|normal))?(?:\s+([\s\S]+?))?\s*$/i;a$=`.palette-custom{display:flex;flex:1;flex-direction:column;min-height:0}.palette-custom__body{display:grid;gap:8px;padding:8px;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}.palette-typed{display:grid;gap:6px;min-width:0}.palette-typed__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.palette-typed__field,.palette-typed__color,.palette-typed__menu{display:flex;align-items:center;box-sizing:border-box;width:100%;min-width:0;height:28px;border-radius:6px;background:#ffffff0a;box-shadow:none;color:#f1efeb;font:inherit;font-size:11px}.palette-typed__field:hover,.palette-typed__color:hover,.palette-typed__menu:hover{box-shadow:inset 0 0 0 1px #ffffff1c}.palette-typed__field:focus-within,.palette-typed__color:focus-visible,.palette-typed__menu:focus-visible{outline:0;box-shadow:inset 0 0 0 1px #bda6ef}.palette-typed__field>span{flex:none;display:grid;place-items:center;min-width:24px;height:100%;padding:0 2px 0 6px;color:#77736f;font-size:10px;font-weight:500;cursor:ew-resize;user-select:none;touch-action:none}.palette-typed__field>span:hover{color:#e9e6e1}.palette-typed__field>span svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.1}.palette-typed__field input{flex:1;width:100%;min-width:0;height:100%;margin:0;padding:0 2px;border:0;border-radius:0;outline:0;box-shadow:none;background:none;color:inherit;font:inherit;font-variant-numeric:tabular-nums}.palette-typed__field input:focus,.palette-typed__field input:focus-visible,.palette-typed__field select:focus,.palette-typed__field select:focus-visible{outline:0;box-shadow:none}.palette-typed__field select{flex:none;width:auto;max-width:44px;height:100%;margin:0;padding:0 8px 0 2px;border:0;border-radius:0 6px 6px 0;box-shadow:none;appearance:none;background:none;color:#77736f;font:inherit;font-size:10px;text-align:right;cursor:pointer}.palette-typed__field select:hover{color:#f1efeb}.palette-typed__menu{padding:0 20px 0 8px;border:0;appearance:none;background:#ffffff0a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 3 4 5.5 6.5 3' fill='none' stroke='%23898680' stroke-width='1.2'/%3E%3C/svg%3E") right 7px center/8px no-repeat;cursor:pointer}.palette-typed [aria-invalid=true]{color:#f8a898}.palette-typed__layer{display:grid;gap:6px}.palette-typed__layer[data-hidden] .palette-typed__grid{opacity:.45}.palette-typed__row{display:flex;align-items:center;gap:4px;min-width:0}.palette-typed__row>.palette-typed__menu{flex:none;width:64px}.palette-typed__row>.palette-typed__color{flex:1;gap:6px;padding:0 6px}.palette-typed__color .palette-typed__alpha{flex:none;margin-left:auto;color:#898680;font-size:10px}.palette-typed button.palette-typed__icon{display:grid;place-items:center;flex:none;width:24px;padding:0}.palette-typed__icon svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}.palette-typed__tile{display:grid;place-items:center;height:56px;border-radius:6px;background:repeating-conic-gradient(#ffffff0a 0 25%,#ffffff04 0 50%) 0 0/12px 12px}.palette-typed__tile i{display:grid;place-items:center;width:32px;height:32px;border-radius:6px;background:#f1efeb;color:#f1efeb;font-style:normal;font-size:20px;font-weight:600}.palette-typed__tile i:not(:empty){width:auto;height:auto;background:none}.palette-typed__layer+.palette-typed__layer{padding-top:8px;border-top:1px solid #ffffff0d}.palette-typed__head{display:flex;align-items:center;gap:2px;min-height:24px}.palette-typed__head b{flex:1;color:#b5b1ab;font-size:10px;font-weight:500}.palette-typed button:not(.palette-typed__color,.palette-color *){height:24px;padding:0 8px;border:0;border-radius:5px;background:none;color:#898680;font:inherit;font-size:10px;cursor:pointer}.palette-typed button:not(.palette-typed__color,.palette-color *):hover{background:#ffffff14;color:#f1efeb}.palette-typed button[aria-pressed=true]{background:#bda6ef24;color:#e6dcfb}.palette-typed button:focus-visible{outline:1px solid #bda6ef;outline-offset:-1px}.palette-typed__color{gap:8px;padding:0 8px;border:0;justify-content:flex-start;text-align:left;font-variant-numeric:tabular-nums;cursor:pointer}.palette-typed__color i{flex:none;width:14px;height:14px;border-radius:3px;box-shadow:inset 0 0 0 1px #ffffff26;background:linear-gradient(var(--c),var(--c)),repeating-conic-gradient(#ffffff40 0 25%,#ffffff12 0 50%) 0 0/8px 8px}.palette-typed__color span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.palette-typed .palette-color{padding:0}.palette-typed__sample{display:flex;align-items:center;gap:8px;min-width:0;height:36px;padding:0 8px;border-radius:6px;background:#ffffff08}.palette-typed__sample b{flex:none;font-size:20px;font-weight:400}.palette-typed__sample span{overflow:hidden;color:#b5b1ab;text-overflow:ellipsis;white-space:nowrap}.palette-typed__hint{color:#898680;font-size:10px;line-height:1.5}.palette-custom .palette-typed__advanced>summary{display:flex;align-items:center;height:auto;min-height:24px;color:#77736f;font-size:10px;font-weight:500;list-style:none;cursor:pointer}.palette-typed__advanced>summary::-webkit-details-marker{display:none}.palette-custom .palette-typed__advanced>summary:hover{color:#e9e6e1}.palette-typed__advanced>summary:focus-visible{outline:1px solid #bda6ef;outline-offset:-1px;border-radius:4px}@media (max-width:520px){.palette-typed__font{grid-template-columns:minmax(0,1fr)}}@media (pointer:coarse){.palette-typed__field,.palette-typed__color,.palette-typed__menu{height:36px}.palette-typed button:not(.palette-typed__color,.palette-color *){height:32px}}`,bI=["px","%","rem","em","vw","vh","ch","vmin","vmax","dvh"],yI='<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M1.5 8s2.4-4.5 6.5-4.5S14.5 8 14.5 8 12.1 12.5 8 12.5 1.5 8 1.5 8Z"/><circle cx="8" cy="8" r="2"/></svg>',xI='<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8h9"/></svg>',vI='<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 3.5v9M3.5 8h9"/></svg>';wI='<svg viewBox="0 0 12 12" aria-hidden="true"><path d="M1 6h10M3 4 1 6l2 2M9 4l2 2-2 2"/></svg>'});var c$={};Ft(c$,{pickerEditor:()=>EI});function EI(e,t){let{property:n}=e,o=e.custom.value,i=w("div","palette-custom"),r=w("div","palette-custom__body"),a=w("input");a.value=o,a.setAttribute("aria-label","CSS value");let s=!1,l=!1,c=(d,p)=>{if(l)return!1;s=!0;let g=!!d.trim()&&(CSS.supports(n,d)||n==="font"&&!!JT(d))&&!/[{};]/.test(d);return a.setAttribute("aria-invalid",String(!g)),g?(a!==a.getRootNode().activeElement&&(a.value=d),p?t.commit(d):t.preview(d),!0):!1};i.append(w("style","",a$),r);let u=s$(r,n,o,a,c,e.custom?.field,e.tokens,d=>{l||t.hover?.(d)});return Object.assign(i,{live:!0,destroy(){l=!0},refresh(d){if(s)return;let{selectionStart:p,selectionEnd:g}=a;u(d),p!==null&&g!==null&&a.setSelectionRange(p,g)}})}var d$=O(()=>{"use strict";l$();It()});var n2={};Ft(n2,{openTokenPicker:()=>LI,refreshTokenPicker:()=>CI,stylePicker:()=>g$,tokenLabel:()=>t2,tokenPreview:()=>f$});function t2(e){return e.label||e.path.slice(e.path.lastIndexOf(".")+1)||e.path}function AI(e){let t=/^(-?[\d.]+)(px|r?em)?$/.exec(e.trim());return t?parseFloat(t[1])*(t[2]?t[2]==="px"?1:16:1):void 0}function f$(e){let t=w("span","palette-tokens__pv");t.setAttribute("aria-hidden","true");let n=r=>{let a=w("span",`palette-tokens__${r}`);return t.append(a),a},o=e.value??"",{type:i}=e;if(i==="color"){let r=n("sw"),a=w("span");m$(o)?a.style.background=o:(a.dataset.unresolved="",a.textContent="?"),r.append(a)}else if(i==="dimension"||i==="letterSpacing"){let r=AI(o);if(r===void 0)return t;let a=/radius/.test(`${e.path} ${e.properties?.join(" ")}`),s=n(a?"corner":"dim");a?s.style.borderTopLeftRadius=`${fm(r,0,12)}px`:s.style.width=`${fm(r/2,2,24)}px`}else if(i==="shadow")n("shadow").style.boxShadow=o;else if(i==="typography"||i==="fontWeight"||i==="fontFamily"){let r=n("ag");r.textContent="Ag",i==="typography"?(r.style.font=o,r.style.fontSize="13px",r.style.lineHeight="1"):i==="fontWeight"?r.style.fontWeight=o:r.style.fontFamily=o}return t}function m$(e){if(!e||/var\(/i.test(e))return!1;let t=w("span").style;return t.color=e,!!t.color}function MI(e,t,n,o){let i=w("div");i.id=t,i.setAttribute("role","option"),i.setAttribute("aria-selected",String(n));let r=w("span","palette-tokens__name"),a=w("span","",t2(e));r.append(a);let s=w("span","palette-tokens__check");s.setAttribute("aria-hidden","true");let l=e.type==="color"&&!m$(e.value),c=o.flatMap(p=>{let g=p.values.get(e.path);return g&&e.type==="color"?[`${p.label} ${g}`]:[]}),u=c.length>1?c.join(", "):e.value??"",d=w("span","palette-tokens__sub",[e.path,u].filter(Boolean).join(" \xB7 "));return d.setAttribute("aria-hidden","true"),i.append(f$(e),r,s,d),i.setAttribute("aria-label",[e.label,em(e,u,l?"Unresolved; no swatch available":"")].filter(Boolean).join(" \xB7 ")),i}function g$(e){let t=e.getRootNode();if((t instanceof ShadowRoot||t===document)&&!p$.has(t)){p$.add(t);let n=w("style");n.textContent=Ry+kI+SI,(t instanceof ShadowRoot?t:document.head).append(n)}return t}function CI(e,t){sa?.trigger===e&&sa.refresh(t)}function LI(e,t=!1){let n=e.trigger.dataset.start;if(delete e.trigger.dataset.start,t&&sa?.trigger===e.trigger)return sa.close(!0);sa?.close();let{trigger:o,property:i}=e,r=e.tokens,a=g$(o),s=`palette-tokens-${++TI}`,l=/color|^(fill|stroke)$/.test(i),c=w("div","palette-tokens");c.id=`${s}-popup`,c.setAttribute("role","dialog"),c.setAttribute("aria-label",`Edit ${i}`);let u=w("div","palette-tokens__head"),d=w("button","palette-tokens__back");d.type="button",d.setAttribute("aria-label","Back to tokens"),d.innerHTML='<svg viewBox="0 0 12 12" aria-hidden="true"><path d="M7.5 2.5 4 6l3.5 3.5"/></svg>';let p=w("span","",e.title||e.custom?.field?.label||u$[i]||i);u.append(d,p);let g=w("div","palette-tokens__bar"),y=w("input");y.type="text",y.placeholder="Search tokens",y.autocomplete="off",y.spellcheck=!1,y.setAttribute("role","combobox"),y.setAttribute("aria-expanded","true"),y.setAttribute("aria-controls",s),y.setAttribute("aria-autocomplete","list"),y.setAttribute("aria-label",`Search tokens for ${i}`);let v=w("div","palette-tokens__list");v.id=s,v.tabIndex=0,v.setAttribute("role","listbox"),v.setAttribute("aria-label",`Tokens for ${i}`);let x=Xs(r,i),h=!x.length,m=w("button","palette-tokens__widen");m.type="button",g.append(y);let b=w("button","palette-tokens__more");b.type="button";let E=w("i"),S=w("span");b.append(w("b","","Custom\u2026"),E,S);let A=w("div","palette-tokens__custom");c.append(u,g,v,m,b),e.custom&&c.append(A);let _=()=>new Map(r.map(de=>[de,`${t2(de)} ${de.path} ${de.ref??""} ${de.value??""}`.toLowerCase()])),T=_(),H=[],R=[],z=0,F=-1,B=v,le,J,V=-1,oe=!1,ue=!1,q,Y,W=!1,C=()=>{let de=J;J=void 0,V=-1,de?.()},U=de=>{C(),q=de,J=e.custom?.onPreview(de)},I=()=>{V<0||(C(),q!==void 0&&U(q))},G=()=>!e.custom||!!x.length,te=()=>{let de=G()&&!W,Ae=h||y.value?r:x;v.hidden=g.hidden=!de,y.hidden=!de||!ue&&Ae.length<=8&&!y.value,g.hidden||=y.hidden,m.hidden=!de||!!y.value||!x.length||x.length===r.length,m.textContent=h?"Show relevant tokens":`Show all ${r.length} tokens`,m.setAttribute("aria-pressed",String(h)),b.hidden=!de||!e.custom,A.hidden=de,d.hidden=!W||!G(),p.textContent=W&&G()?l?"Custom colour":"Custom value":e.title||e.custom?.field?.label||u$[i]||i,c.toggleAttribute("data-custom",!de);let ve=e.custom?.value??"",Re=/^rgba?\((\d+)[ ,]+(\d+)[ ,]+(\d+)(?:[ ,/]+([\d.]+))?/.exec(ve);S.textContent=l?Re?Re.slice(1,4).map(Fe=>Number(Fe).toString(16).padStart(2,"0")).join("").toUpperCase()+(Re[4]&&+Re[4]<1?` ${Math.round(+Re[4]*100)}%`:""):ve.replace(/^#/,"").toUpperCase():ve,E.hidden=!l||!ve,E.style.setProperty("--c",ve),b.title=ve},ie=de=>{for(;z<Math.min(de,R.length);z++){let{token:Ae,group:ve}=R[z];if(ve!==le&&(le=ve,B=v,ve)){B=w("div"),B.setAttribute("role","group");let Re=w("small");Re.id=`${s}-g${z}`,Re.textContent=ve,B.setAttribute("aria-labelledby",Re.id),B.append(Re),v.append(B)}B.append(MI(Ae,`${s}-${z}`,Ae.path===e.current,H))}},pe=de=>v.querySelector(`#${s}-${de}`),xe=(de,Ae=!0,ve=!0)=>{if(de<0||de>=R.length)return;if(de!==V&&ve){C(),V=de;let $e=R[de].token;$e.path!==e.current&&(J=e.onPreview?.($e))}ie(de+e2),pe(F)?.removeAttribute("data-active"),F=de;let Re=pe(de);if(Re.toggleAttribute("data-active",!0),y.setAttribute("aria-activedescendant",Re.id),v.setAttribute("aria-activedescendant",Re.id),!Ae)return;let Fe=Re.offsetTop-(Re.parentElement===v?0:Re.parentElement.firstElementChild.offsetHeight),Ye=Re.offsetTop+Re.offsetHeight;Fe<v.scrollTop?v.scrollTop=Fe-4:Ye>v.scrollTop+v.clientHeight&&(v.scrollTop=Ye-v.clientHeight+4)},L=(de=!1,Ae=!1)=>{let ve=Ae?R[F]?.token.path:void 0,Re=v.scrollTop,Fe=Ae?z:e2;V>=0&&C();let Ye=y.value.toLowerCase().split(/\s+/).filter(Boolean),$e=h||Ye.length?r:x,ot=Ye.length?$e.filter(Ht=>Ye.every(pt=>T.get(Ht).includes(pt))):$e,rn=h?ot:[...ot.filter(Ht=>x.includes(Ht)),...ot.filter(Ht=>!x.includes(Ht))],Zt=new Map([["",[]]]);for(let Ht of rn){let pt=Ht.group??"";Zt.set(pt,[...Zt.get(pt)??[],Ht])}if(R=[...[...Zt].flatMap(([Ht,pt])=>pt.map(Qt=>({token:Qt,group:Ht})))],v.replaceChildren(),v.scrollTop=0,z=0,F=-1,le=void 0,y.removeAttribute("aria-activedescendant"),v.removeAttribute("aria-activedescendant"),te(),!R.length){let Ht=w("div","palette-tokens__empty",Ye.length?"No matching tokens":"No tokens");v.append(Ht);return}ie(Fe),xe(Math.max(0,R.findIndex(Ht=>Ht.token.path===ve)),!1,de),Ae&&(v.scrollTop=Re)},Q=new AbortController,{signal:Z}=Q,se=!!globalThis.matchMedia?.("(pointer:coarse)")?.matches;function we(de=!1,Ae=!1){if(sa?.close!==we)return;sa=void 0;let ve=Y?.live&&q;C(),ve&&!Ae&&(e.custom?.onCommit??e.custom?.onSelect)?.(ve),e.custom?.[Ae?"onCancel":"onDone"]?.(),Q.abort(),Y?.destroy(),c.remove(),o.setAttribute("aria-expanded","false"),o.removeAttribute("aria-controls"),de&&o.isConnected&&o.focus({preventScroll:!0})}sa={trigger:o,close:we,refresh(de){if(!de)return oe||=V>=0,C();let Ae=oe||V>=0;oe=!1,e=de,r=de.tokens,x=Xs(r,i),T=_(),H=[],L(Ae&&!W,!0),e.current&&e.custom&&Y?.refresh(e.custom.value),V<0&&!J&&q!==void 0&&U(q),ct()}};let Te=460,$=de=>{C(),q=void 0,e.custom?.onCancel?.(),we(!0),de.path!==e.current&&e.onSelect(de)},D=e.custom?l?Promise.resolve().then(()=>(WT(),XT)):Promise.resolve().then(()=>(d$(),c$)):void 0;async function j(de){let Ae=await D;if(sa?.close!==we)return;Y||(Y=Ae.pickerEditor(e,{preview:U,commit(Fe){if(!e.custom?.onCommit)return U(Fe);C(),q=void 0,e.custom.onCommit(Fe)},token:$,hover(Fe){C(),Fe!==void 0?J=e.custom?.onPreview(Fe):q!==void 0&&U(q)}}),A.append(Y)),Pe="",Ne();let ve=!!c.getClientRects().length,Re=[...c.querySelectorAll("input,select,summary,button")].filter(Fe=>(!ve||Fe.getClientRects().length)&&!Fe.closest("[hidden]")&&!Fe.matches("details:not([open]) :not(summary)"));de&&(Re.find(Fe=>Fe instanceof HTMLInputElement&&A.contains(Fe))??Re[0])?.focus({preventScroll:!0})}function X(de,Ae=!se){if(I(),W=de,te(),Pe="",Ne(),W)return void j(Ae);Ae&&(y.hidden?b:y).focus({preventScroll:!0})}let fe=de=>{let Ae=R[de]?.token;Ae&&$(Ae)};b.addEventListener("click",()=>X(!0),{signal:Z}),d.addEventListener("click",()=>X(!1),{signal:Z}),y.addEventListener("input",()=>L(!0),{signal:Z}),m.addEventListener("click",()=>{h=!h,L(!0),se||(y.hidden?v:y).focus({preventScroll:!0})},{signal:Z}),addEventListener("keydown",de=>{if(!o.isConnected)return we();let Ae=de.composedPath();if(!Ae.includes(c)&&!Ae.includes(o))return;let{key:ve}=de,Re={ArrowDown:1,ArrowUp:-1,PageDown:8,PageUp:-8}[ve];if(!(de.ctrlKey||de.metaKey||de.altKey)&&!(ve==="Escape"&&Ae[0]instanceof HTMLSelectElement&&Ae[0]!==o&&Ae[0].getAttribute("aria-expanded")==="true")){if(ve==="Escape")we(!0,!0);else if(ve==="Tab"){let Fe=[...c.querySelectorAll("button,input,select,summary,[tabindex='0']")].filter(Ye=>!Ye.closest("[hidden]")&&!Ye.matches("details:not([open]) :not(summary)")&&Ye.getClientRects().length);if(Ae[0]!==Fe[de.shiftKey?0:Fe.length-1])return;Fe[de.shiftKey?Fe.length-1:0]?.focus()}else if(Ae[0]===b&&ve==="ArrowUp"&&R.length)v.focus({preventScroll:!0}),xe(R.length-1);else{if(v.hidden||Ae[0]!==y&&Ae[0]!==o&&Ae[0]!==v)return;if(Re>0&&Ae[0]===v&&F===R.length-1&&!b.hidden)I(),b.focus({preventScroll:!0});else if(Re)xe(fm(F+Re,0,R.length-1));else if((ve==="Home"||ve==="End")&&Ae[0]!==y)xe(ve==="Home"?0:R.length-1);else if(ve==="Enter")fe(F);else if(Ae[0]===v&&ve.length===1&&ve!==" ")ue=!0,y.value+=ve,L(!0),y.focus({preventScroll:!0});else return}de.preventDefault(),de.stopImmediatePropagation()}},{capture:!0,signal:Z}),addEventListener("pointerdown",de=>{let Ae=de.composedPath();!Ae.includes(c)&&!Ae.includes(o)&&we()},{capture:!0,signal:Z}),addEventListener("focusin",de=>{let Ae=de.composedPath();!Ae.includes(c)&&!Ae.includes(o)&&we()},{capture:!0,signal:Z});let ye=de=>{de.target===v?v.scrollTop+v.clientHeight>v.scrollHeight-200&&ie(z+e2):de.target instanceof Node&&c.contains(de.target)||we()};addEventListener("scroll",ye,{capture:!0,signal:Z}),a.addEventListener("scroll",ye,{capture:!0,signal:Z}),addEventListener("resize",()=>we(),{signal:Z}),sc(o,()=>we(),Z),v.addEventListener("mousedown",de=>de.preventDefault(),{signal:Z});let De=de=>{let Ae=de.target.closest?.("[role=option]");return Ae&&v.contains(Ae)?Number(Ae.id.slice(s.length+1)):-1};v.addEventListener("pointermove",de=>{let Ae=De(de);Ae>=0&&xe(Ae,!1)},{signal:Z}),v.addEventListener("pointerleave",I,{signal:Z}),b.addEventListener("focusin",I,{signal:Z}),A.addEventListener("focusin",I,{signal:Z}),c.addEventListener("click",de=>{de.target instanceof HTMLInputElement||de.target instanceof HTMLSelectElement||de.target instanceof HTMLButtonElement||de.preventDefault();let Ae=De(de);Ae>=0&&fe(Ae)},{signal:Z}),L();let Ce=o.closest(".design-field")??o.parentElement;c.popover="manual",Ce.append(c),c.showPopover?.(),Ce.addEventListener("palette-field-sync",()=>{J||!e.custom||(Y?.refresh(e.custom.value),te())},{signal:Z}),o.setAttribute("aria-expanded","true"),o.setAttribute("aria-controls",c.id);let Pe="",Ne=()=>{let de=Ce.getBoundingClientRect();if(Pe===`${de.left} ${de.top}`)return;Pe=`${de.left} ${de.top}`;let Ae=AH(Ce),ve=fm(Ae.right-Ae.left-8,120,256),Re=innerHeight-de.bottom-12,Fe=de.top-12;c.style.maxHeight="";let Ye=Math.min(Te,Math.max(c.scrollHeight,200)),$e=Re<Ye&&Fe>Re,ot=Math.min(Te,innerHeight-16,Math.max($e?Fe:Re,200));c.style.width=`${ve}px`,c.style.maxHeight=`${ot}px`,c.style.left=`${fm(de.left,Ae.left+4,Ae.right-ve-4)}px`,c.style.top=$e?"":`${Math.min(de.bottom+4,innerHeight-8-ot)}px`,c.style.bottom=$e?`${Math.min(innerHeight-de.top+4,innerHeight-8-ot)}px`:"",c.toggleAttribute("data-up",$e)};Ne();let Le=new MutationObserver(Ne);Le.observe(a,{attributes:!0,childList:!0,subtree:!0}),Z.addEventListener("abort",()=>Le.disconnect());let Ie=R.findIndex(de=>de.token.path===e.current);Ie>=0&&xe(Ie,!0,!1),!G()||n==="custom"&&e.custom?X(!0):se||(y.hidden?v:y).focus({preventScroll:!0,focusVisible:!1});let ut=0;function ct(){let de=++ut;Promise.resolve(e.themes?.()).then(Ae=>{!Ae||Ae.length<2||sa?.close!==we||de!==ut||(H=Ae,v.hidden||L(V>=0,!0))},()=>{})}return ct(),()=>we()}var kI,SI,u$,p$,e2,TI,sa,fm,o2=O(()=>{"use strict";Wf();It();lc();kI=".palette-tokens{display:flex;flex-direction:column;overflow:hidden}.palette-tokens__head{flex:none;display:flex;align-items:center;gap:4px;min-height:36px;padding:0 12px;color:#f1efeb;font-weight:500}.palette-tokens__back{display:grid;place-items:center;width:20px;height:20px;margin-left:-6px;padding:0;border:0;border-radius:5px;background:none;color:#898680;cursor:pointer}.palette-tokens__back:hover{background:#ffffff14;color:#f1efeb}.palette-tokens__back svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}.palette-tokens__bar{flex:none;display:flex;gap:4px;padding:0 8px 8px;background:#232323;border-bottom:1px solid #ffffff0d}.palette-tokens__bar input{flex:1;min-width:0;height:28px;box-sizing:border-box;margin:0;padding:0 8px;border:0;border-radius:6px;outline:0;box-shadow:none;background:#ffffff0a;color:#f1efeb;font:inherit}.palette-tokens__bar input:focus{outline:0;box-shadow:inset 0 0 0 1px #bda6ef}.palette-tokens__widen{flex:none;height:28px;margin:0 4px 4px;padding:0 8px;border:0;border-radius:6px;background:none;color:#898680;font:inherit;text-align:left;cursor:pointer}.palette-tokens__widen:hover,.palette-tokens__more:hover{background:#ffffff0f;color:#f1efeb}.palette-tokens__more{flex:none;display:flex;align-items:center;gap:8px;min-height:36px;padding:0 12px;border:0;border-top:1px solid #ffffff0d;background:none;color:#d9d6d1;font:inherit;text-align:left;cursor:pointer}.palette-tokens__more b{margin-right:auto;font-weight:500}.palette-tokens__more i{flex:none;width:14px;height:14px;border-radius:3px;box-shadow:inset 0 0 0 1px #ffffff26;background:linear-gradient(var(--c),var(--c)),repeating-conic-gradient(#ffffff40 0 25%,#ffffff12 0 50%) 0 0/8px 8px}.palette-tokens__more span{max-width:50%;overflow:hidden;color:#898680;font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap}.palette-tokens [role=listbox]{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:0 4px 4px}.palette-tokens small:not(.palette-select *){position:sticky;top:0;z-index:1;display:block;padding:8px 8px 4px;background:#232323;color:#77736f;font-size:10px;font-weight:500}.palette-tokens [role=option]:not(.palette-select *){display:grid;grid-template-columns:20px minmax(0,1fr) 14px;align-items:center;gap:4px 8px;box-sizing:border-box;min-height:32px;padding:6px 8px;border-radius:7px;cursor:pointer}.palette-tokens [data-active]{background:#ffffff14;color:#f1efeb}.palette-tokens [aria-selected=true] .palette-tokens__name{color:#e6dcfb}.palette-tokens__name{grid-column:2;min-width:0;font-weight:500}.palette-tokens__name>span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.palette-tokens__sub{grid-column:2/4;display:none;min-width:0;overflow:hidden;color:#77736f;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.palette-tokens [data-active] .palette-tokens__sub{display:block}.palette-tokens__check{grid-column:3;justify-self:center}.palette-tokens [aria-selected=true] .palette-tokens__check{width:7px;height:3.5px;margin-top:-3px;border:solid #bda6ef;border-width:0 0 1.5px 1.5px;rotate:-45deg}.palette-tokens__pv{display:flex;align-items:center;height:16px;overflow:hidden}.palette-tokens__sw{display:flex;width:16px;height:16px;border-radius:4px;overflow:hidden;background:repeating-conic-gradient(#ffffff40 0 25%,#ffffff0d 0 50%) 0 0/8px 8px;outline:1px solid #ffffff1f;outline-offset:-1px}.palette-tokens__sw>span{flex:1}.palette-tokens__sw>[data-unresolved]{display:grid;place-items:center;background:#393939;color:#b6b1aa;font-size:10px}.palette-tokens__dim{height:4px;min-width:2px;border-radius:2px;background:#bda6ef}.palette-tokens__corner{width:12px;height:12px;box-sizing:border-box;border:solid #bda6ef;border-width:1.5px 0 0 1.5px}.palette-tokens__shadow{width:16px;height:12px;margin-left:2px;border-radius:3px;background:#f1efeb}.palette-tokens__ag{color:#f1efeb;font-size:13px;line-height:1;white-space:nowrap}.palette-tokens__empty{padding:12px 8px;color:#77736f}@media (pointer:coarse){.palette-tokens{font-size:13px}.palette-tokens [role=option]:not(.palette-select *){min-height:44px}.palette-tokens__bar input,.palette-tokens__bar button{height:36px}}",SI=".palette-tokens__custom{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}.palette-tokens__custom>.palette-custom{flex:none}.palette-tokens__custom .palette-custom__body{overflow:visible}.palette-tokens [hidden]{display:none!important}.palette-tokens button:focus-visible,.palette-tokens [role=listbox]:focus-visible{outline:1px solid #bda6ef;outline-offset:-2px}.palette-tokens[popover]{position:fixed;inset:auto;margin:0;border:0;padding:0}",u$={font:"Typography","box-shadow":"Shadow","text-shadow":"Text shadow"},p$=new WeakSet,e2=60,TI=0;fm=(e,t,n)=>Math.min(n,Math.max(t,e))});function b$(e,t){let n=mm.get(e.element);if(n?.editor===t)return n.component;let o={id:e.name,name:e.name,source:e.source??"",line:0,props:t.schema},i={definition:o,preview:"adapter",releaseProps:r=>t.release?.(r),subscribe:t.subscribe?.bind(t),get props(){return h$(o,t.read())},onChange:r=>t.apply(r),setProps(r){if(t.available?.()===!1)throw new Error("This component instance is no longer available.");let a=h$(o,r);if(Object.keys(r).some(s=>!(s in a))||o.props.some(s=>s.kind!=="unsupported"&&s.required&&!(s.name in a)))throw new Error("Component props no longer match the editor schema.");t.apply(a)}};return mm.set(e.element,{editor:t,component:i}),i}function i2(e){let t=$c(e)?.currentInspectableElement,n=t?.(e);if(n)return n;let o=mm.get(e);if(!o||o.editor.available?.()===!1)return null;let i=o.editor.currentElement?.();return i?.isConnected?(i!==e&&mm.set(i,o),i):null}function DI(e){return e===void 0||typeof e=="string"||typeof e=="number"&&Number.isFinite(e)||typeof e=="boolean"}function l0(e,t){return t===void 0?!e.required:!DI(t)||e.kind==="unsupported"?!1:e.kind==="string"?typeof t=="string"&&t.length<=500:e.kind==="number"?typeof t=="number"&&Number.isFinite(t):e.kind==="boolean"?typeof t=="boolean":e.kind==="enum"&&(e.values??[]).includes(t)}function h$(e,t){let n={};for(let o of e.props){if(o.kind==="unsupported")continue;let i=t[o.name];l0(o,i)&&(n[o.name]=i)}return n}function Uo(e){let t=$c(e)?.inspectableFor,n=t?.(e);if(n)return n;let o=e&&_I.get(e);if(o&&e.getAttribute("data-palette-inspectable")===o.definition.id)return o;let i=e&&mm.get(e);return i&&i.editor.available?.()!==!1?i.component:null}function c0(e){for(let t=e?.parentElement;t;t=t.parentElement){let n=Uo(t);if(n)return{root:t,component:n}}return null}var _I,mm,y$=O(()=>{"use strict";ho();_I=new WeakMap,mm=new WeakMap;lg({inspectableFor:Uo,currentInspectableElement:i2})});function d0(){let e=$c(sg())?.tokenSources;return e?e():u0}function Lo(e){if(!e)return null;let t=$c(e)?.tokenSourceFor;if(t)return t(e);let n=null;for(let o of u0){let i=ul(o.root,e.ownerDocument);i&&(i===e||i.contains(e))&&(!n||n.root.contains(o.root))&&(n=o)}return n}function gc(e,t){return e.root.ownerDocument.defaultView?.getComputedStyle(e.root).getPropertyValue(t.cssVariable).trim()??""}function r2(e,t){try{return e.root.querySelectorAll(t.impactSelector).length}catch{return 0}}function v$(e,t,n){if(!n||n.length>160||/[{};]/.test(n)||/(?:url|expression)\s*\(/i.test(n))return!1;let i=e.root.ownerDocument.defaultView?.CSS;return!i?.supports||t.properties.some(r=>i.supports(r,n))}function w$(e,t,n,o=!1){if(!e.tokens.some(u=>u===t||u.path===t.path)||!v$(e,t,n))return!1;let i=gc(e,t),r=e.themeEdits.get(t.path),a=e.root.style.getPropertyValue(t.cssVariable),s=r?.inlineBefore??a,l=or.get(e)??[];if(i===n)return!0;e.root.style.setProperty(t.cssVariable,n),n===(r?.before??i)?e.themeEdits.delete(t.path):e.themeEdits.set(t.path,{before:r?.before??i,after:n,inlineBefore:s});let c=l.at(-1);return o&&c?.kind==="theme"&&c.token.path===t.path?n===c.before?l.pop():c.after=n:l.push({kind:"theme",source:e,token:t,before:i,after:n,inlineBefore:a}),or.set(e,l),!0}function E$(e){for(let t of d0())for(let[n,o]of t.themeEdits){let i=t.tokens.find(a=>a.path===n)?.cssVariable;if(!i)continue;let r=e?o.inlineBefore:o.after;r?t.root.style.setProperty(i,r):t.root.style.removeProperty(i)}}function k$(e,t){let n=e.themeEdits.get(t.path),o=or.get(e)??[],i=o.find(a=>a.kind==="theme"&&a.token.path===t.path),r=n?.inlineBefore??(i?.kind==="theme"?i.inlineBefore:void 0);r!==void 0&&(r?e.root.style.setProperty(t.cssVariable,r):e.root.style.removeProperty(t.cssVariable),e.themeEdits.delete(t.path),or.set(e,o.filter(a=>a.kind!=="theme"||a.token.path!==t.path)))}function a2(e,t,n,o,i={}){if(!e.tokens.some(y=>y.path===n.path)||!n.properties.includes(o))return!1;let r=e.elementOriginals.get(t);r||e.elementOriginals.set(t,r=new Map),r.has(o)||r.set(o,{value:t.style.getPropertyValue(o),priority:t.style.getPropertyPriority(o)});let a=t.style.getPropertyValue(o),s=t.style.getPropertyPriority(o),l=`var(${n.cssVariable})`,c=e.elementBindings.get(t);c||e.elementBindings.set(t,c=new Map);let u=c.get(o);if(c.set(o,{tokenPath:n.path,initialValue:u?.initialValue??a,initialPriority:u?.initialPriority??s,mode:"token",declaredPath:u?u.declaredPath:yu(e,t,o)?.token.path}),t.style.setProperty(o,l,s),i.recordHistory===!1)return!0;let d={kind:"element",element:t,property:o,before:a,priority:s,after:l},p=or.get(e)??[];p.push(d),or.set(e,p);let g=mc.get(t)??[];return g.push(d),mc.set(t,g),!0}function s2(e,t,n,o){let i=e.elementBindings.get(t),r=i?.get(n);if(!r){let a=yu(e,t,n);if(!a)return;i||e.elementBindings.set(t,i=new Map),r={tokenPath:a.token.path,initialValue:t.style.getPropertyValue(n),initialPriority:t.style.getPropertyPriority(n),mode:"custom",declaredPath:a.token.path},i.set(n,r)}r.mode="custom",r.customValue=o}function l2(e,t,n){let o=e.elementBindings.get(t)?.get(n);if(!o)return;let i=t.style.getPropertyValue(n);if(i===o.initialValue&&t.style.getPropertyPriority(n)===o.initialPriority){e.elementBindings.get(t)?.delete(n);return}e.tokens.find(a=>a.path===o.tokenPath&&a.properties.includes(n)&&i===`var(${a.cssVariable})`)?(o.mode="token",delete o.customValue):(o.mode="custom",o.customValue=i)}function c2(e,t,n){let o=e.elementBindings.get(t)?.get(n);return o?{...o}:null}function x$(e,t,n,o){let i=[...n.matchAll(/var\(\s*(--[\w-]+)/g)].map(a=>a[1]);if(!i.length||o&&!/^var\(\s*--[\w-]+\s*(?:,[^;{}]*)?\)$/.test(n.trim()))return;let r=e.tokens.filter(a=>a.properties.includes(t)&&i.includes(a.cssVariable));return r.length===1?r[0]:void 0}function HI(e){let t=e.replace(/:(?:where)\([^)]*\)/g,"").replace(/"[^"]*"|'[^']*'/g,""),n=t.match(/#[\w-]+/g)?.length??0,o=t.match(/\.[\w-]+|\[[^\]]*\]|:(?!:)[\w-]+/g)?.length??0,i=t.match(/(?:^|[\s>+~(])[a-z][\w-]*/gi)?.length??0;return n*1e4+o*100+i}function zI(e){let t=[],n=0,o=0;for(let i=0;i<e.length;i++){let r=e[i];r==="("||r==="["?n++:r===")"||r==="]"?n--:r===","&&n===0&&(t.push(e.slice(o,i)),o=i+1)}return t.push(e.slice(o)),t.map(i=>i.trim()).filter(Boolean)}function yu(e,t,n,o=t.style.getPropertyValue(n),i=t.style.getPropertyPriority(n)){let r=t.ownerDocument.defaultView,a=null,s=0,l=d=>{for(let p of d){s++;let g=p.media;if(g&&r?.matchMedia&&g.mediaText&&!r.matchMedia(g.mediaText).matches)continue;let y=p.style,v=p.selectorText;if(y&&v)for(let h of[n,...RI[n]??[]]){let m=y.getPropertyValue(h).trim();if(!m)continue;let b=-1;for(let E of zI(v))try{t.matches(E)&&(b=Math.max(b,HI(E)))}catch{}if(!(b<0)){b+=y.getPropertyPriority(h)?1e9:0,(!a||b>a.rank||b===a.rank&&s>=a.order)&&(a={value:m,property:h,rank:b,order:s});break}}let x=p.cssRules;x&&!y&&l(x)}};for(let d of t.ownerDocument.styleSheets)try{d.disabled||l(d.cssRules)}catch{}let c=a;if(o&&!(c&&c.rank>=1e9&&!i)){let d=x$(e,n,o,!0);return d?{token:d,origin:"inline"}:null}if(!c)return null;let u=x$(e,n,c.value,c.property===n);return u?{token:u,origin:"stylesheet"}:null}function S$(e,t,n){let o=e.elementBindings.get(t)?.get(n),i=e.elementOriginals.get(t)?.get(n),r=o?.initialValue??i?.value??"",a=o?.initialPriority??i?.priority??"";r?t.style.setProperty(n,r,a):t.style.removeProperty(n),e.elementBindings.get(t)?.delete(n)}function d2(e,t){return e.tokens.filter(n=>n.properties.includes(t))}function T$(e){let t=Lo(e);return!!t&&(t.themeEdits.size>0||!!mc.get(e)?.length||!!t.elementBindings.get(e)?.size)}function A$(e){let t=Lo(e);return!!t&&!!or.get(t)?.length}function M$(e){let t=Lo(e),n=t&&or.get(t)?.pop();if(!t||!n)return;if(n.kind==="theme"){n.inlineBefore?t.root.style.setProperty(n.token.cssVariable,n.inlineBefore):t.root.style.removeProperty(n.token.cssVariable);let i=t.themeEdits.get(n.token.path);if(i&&i.after===n.after)i.before===n.before?t.themeEdits.delete(n.token.path):t.themeEdits.set(n.token.path,{...i,after:n.before});else if(!i){let r=or.get(t).find(a=>a.kind==="theme"&&a.token.path===n.token.path);t.themeEdits.set(n.token.path,{before:n.after,after:n.before,inlineBefore:(r?.kind==="theme"?r:n).inlineBefore})}return}n.before?n.element.style.setProperty(n.property,n.before,n.priority):n.element.style.removeProperty(n.property);let o=mc.get(n.element)??[];o.pop(),o.length||mc.delete(n.element)}function u2(e){let t=Lo(e);if(!t)return;for(let[o,i]of t.themeEdits){let r=t.tokens.find(a=>a.path===o);r&&(i.inlineBefore?t.root.style.setProperty(r.cssVariable,i.inlineBefore):t.root.style.removeProperty(r.cssVariable))}t.themeEdits.clear();let n=t.elementOriginals.get(e);for(let[o,i]of n??[])i.value?e.style.setProperty(o,i.value,i.priority):e.style.removeProperty(o);t.elementOriginals.delete(e),t.elementBindings.delete(e),mc.delete(e),or.set(t,(or.get(t)??[]).filter(o=>o.kind==="element"&&o.element!==e))}function C$(){for(let e of new Set([...u0,...d0()])){for(let t of[e.root,...e.elementOriginals.keys(),...e.elementBindings.keys()])u2(t);or.set(e,[])}}function p2(e){let t=Lo(e);if(!t)return;let n=[];for(let[o,i]of t.elementBindings.get(e)??[]){let r=t.tokens.find(l=>l.path===i.tokenPath&&l.properties.includes(o));if(!r)continue;let a=t.tokens.find(l=>l.path===i.declaredPath),s=a?`var(${a.cssVariable}) [${a.path}]`:i.initialValue||"(unset)";i.mode==="token"?a!==r&&n.push(`Element ${o}: ${s} \u2192 var(${r.cssVariable}) [${r.path}]${a?" [rebind]":""}`):n.push(`Element ${o}: ${s} \u2192 ${i.customValue||"(unset)"} [${a?"custom override":"custom value"}]`)}for(let o of mc.get(e)??[]){if(o.kind!=="element"||t.elementBindings.get(e)?.has(o.property))continue;let i=t.tokens.find(r=>o.after===`var(${r.cssVariable})`);i&&n.push(`Element ${o.property}: ${o.before||"(unset)"} \u2192 var(${i.cssVariable}) [${i.path}]`)}for(let[o,i]of t.themeEdits){let r=t.tokens.find(a=>a.path===o);r&&n.push(`Shared theme ${o} (${r.cssVariable}): ${i.before} \u2192 ${i.after}; preview scope ${r.impactSelector} (${r2(t,r)} matching elements)`)}if(n.length)return["Proposed design-token changes (preview only)",...n,"Token references are preserved for element assignments; refresh resets previews."].join(`
350
350
  `)}function OI(e,t){return{path:t.path,type:t.type,value:gc(e,t),properties:[...t.properties],group:t.path.split(".")[0],ref:t.cssVariable,cssVariable:t.cssVariable}}function L$(){return{id:"css-variables",list:()=>[...d0()].flatMap(e=>e.tokens.map(t=>OI(e,t))),resolve(e){let t=Lo(e),n={};if(!t||!fn(e))return n;let o=e.ownerDocument.defaultView?.getComputedStyle(e);for(let i of new Set(t.tokens.flatMap(r=>r.properties))){let r=yu(t,e,i);n[i]=r?{path:r.token.path}:{offToken:o?.getPropertyValue(i).trim()??""}}return n},preview(e,t,n){let o=Lo(e),i=o?.tokens.find(s=>s.path===n.path);if(!o||!i||!fn(e))return()=>{};let r=e.style.getPropertyValue(t),a=e.style.getPropertyPriority(t);return a2(o,e,i,t,{recordHistory:!1}),()=>{r?e.style.setProperty(t,r,a):e.style.removeProperty(t),l2(o,e,t)}},describe:(e,t,n,o)=>`Set ${t} to var(${o.ref})`,previewValues(e,t,n){let o=[];for(let i of e)if(!(i.theme&&i.theme!==t))for(let r of d0()){let a=r.tokens.find(g=>g.path===i.path),s=i.alias&&r.tokens.find(g=>g.path===i.alias),l=s?`var(${s.cssVariable})`:i.value;if(!a||!v$(r,a,l))continue;let c=n?ul(r.root,n.document):r.root;if(!c?.style)continue;let u=c.hasAttribute("style"),d=c.style.getPropertyValue(a.cssVariable),p=c.style.getPropertyPriority(a.cssVariable);c.style.setProperty(a.cssVariable,l,"important"),o.unshift(()=>{d?c.style.setProperty(a.cssVariable,d,p):c.style.removeProperty(a.cssVariable),!u&&!c.getAttribute("style")&&c.removeAttribute("style")})}return()=>{for(let i of o.splice(0))i()}}}}var u0,mc,or,RI,f2=O(()=>{"use strict";Fs();ho();u0=new Set,mc=new WeakMap,or=new WeakMap;RI={"background-color":["background"],"border-color":["border"],"font-family":["font"],"font-size":["font"],"font-weight":["font"],"line-height":["font"]};lg({tokenSourceFor:Lo,tokenSources:()=>u0})});var y0={};Ft(y0,{attachDesignSystemControls:()=>NI,attachStyleTokenControls:()=>I$,attachThemeSwitcher:()=>Z$,beginReactTextEdit:()=>UI,canUndoDesignTokenEdit:()=>YI,canUndoReactProp:()=>II,cancelReactTextEdit:()=>KI,createAdapterTokenControl:()=>G$,createDesignThemePanel:()=>F$,createElementTokenControl:()=>K$,createReactPropsPanel:()=>J$,cssVariableTokens:()=>L$,designContext:()=>GI,finishReactTextEdit:()=>qI,hasDesignTokenEdit:()=>XI,hasReactPropChanges:()=>VI,installCommentCapture:()=>FI,listTokens:()=>na,noteDesignTokenOverride:()=>iG,originalDesignTokenStyle:()=>LH,previewReactTextEdit:()=>$$,proposedDesignChanges:()=>P$,proposedReactChanges:()=>N$,redoReactProp:()=>aG,resetDesignTokenEdits:()=>ZI,resetPreviews:()=>sG,resetReactProps:()=>Q$,restoreThemes:()=>W$,retainReactPropSelection:()=>$I,retainReactPropTarget:()=>Wa,showDesignBefore:()=>BI,syncDesignTokenBinding:()=>rG,themeState:()=>ai,tokenBoundProperties:()=>tG,undoDesignTokenEdit:()=>WI,undoReactProp:()=>Y$});function Wa(e){let t=i2(e);if(!fn(t))return null;if(t!==e)for(let n of[ln,qo,f0])n.has(e)&&(n.set(t,n.get(e)),n.delete(e));return t}function $I(e,t,n,o,i,r){if(mn(e)&&(i?.element===e||i?.hasChanges(e)))return!1;let a=Wa(e);if(!a||a===e||n.host.contains(a))return!1;let s=t.querySelector(".design-react-group:not(.design-react-discovered)")??void 0,l=n.root.activeElement;for(let c of o)!c.kind&&c.props&&c.element===e&&(c.element=a);return r(a,s),l instanceof HTMLElement&&s?.contains(l)&&l.focus({preventScroll:!0}),!0}function NI(e,t,n,o,i){let{root:r,design:a}=o,{retainedProps:s,syncStyles:l,updateActions:c}=i;if(!s&&t.querySelector(".design-react-group, .design-theme-group"))return;let u=(g,y=!1)=>{g&&i.history.push({element:y?Wa(e)??e:e,props:y,undo:()=>{g(),l()}}),l(),c()};Z$(t,a,()=>i.select(e),r,i.signal);let d=s??J$(e,g=>u(g,!0),r,i.select,a,i.refresh,o.sourceHref);d&&!s&&t.prepend(d),I$(e,n.fields,t,i.onStyleEdit,r,n.valueFor,n.toHex,a,u,i.isFieldDirty);let p=F$(e,n,i.updateActions,r);p&&t.append(p)}function R$(e){return e===void 0?"unset":JSON.stringify(e)??"unset"}function BI(e){let t=PT(ko().root);try{if(e)for(let[n,o]of ln){let i=Uo(n);i&&(f0.set(n,i.props),i.setProps({...i.props,...Object.fromEntries(o)}))}else for(let[n,o]of f0)Uo(n)?.setProps(o);e||f0.clear(),E$(e),iu(e)}finally{t()}}function VI(e){return!!ln.get(e)?.size}function UI(e){let t=Uo(e),n=t?.definition.textProp,o=t?.definition.props.find(a=>a.name===n);if(!t||!n||o?.kind!=="string")return null;let i=t.props[n];if(typeof i!="string"||i.length>500)return null;let r=ln.get(e);return r||ln.set(e,r=new Map),r.has(n)||r.set(n,i),{propName:n,before:i}}function $$(e,t,n){let o=Uo(e),i=o?.definition.props.find(r=>r.name===t);return!o||o.definition.textProp!==t||i?.kind!=="string"||n.length>500||!l0(i,n)?!1:(o.setProps({...o.props,[t]:n}),!0)}function qI(e,t,n,o){if(n===o){let r=ln.get(e);r?.get(t)===n&&!(qo.get(e)??[]).some(a=>a.propName===t)&&(r.delete(t),r.size||ln.delete(e));return}let i=qo.get(e);i||qo.set(e,i=[]),i.push({propName:t,before:n,after:o})}function KI(e,t,n){$$(e,t,n);let o=ln.get(e);o?.get(t)===n&&!(qo.get(e)??[]).some(i=>i.propName===t)&&(o.delete(t),o.size||ln.delete(e))}function II(e){return!!e&&!!qo.get(e)?.length}function N$(e){let t=ln.get(e),n=Uo(e);if(!t?.size||!n)return;let o=Lo(e),i=[...t].map(([r,a])=>{let l=n.definition.props.find(d=>d.name===r)?.styleProperty,c=n.props[r],u=l&&typeof c=="string"?o?.tokens.find(d=>d.properties.includes(l)&&c===`var(${d.cssVariable})`):void 0;return`- ${r}: ${R$(a)} \u2192 ${R$(c)}${u?` [${u.path}]`:" [custom value]"}`});return["Proposed React prop changes (preview only)",`Component: ${n.definition.name}`,...h0(n)?[`Source: ${h0(n)}`]:[],...i,"Runtime preview only; inline feedback does not write source files."].join(`
351
351
  `)}function j$(e,t){if(Uo(e))return null;let n;try{n=Ys(e,t)?.identify(e)}catch{}let o=c0(e);return n?.name&&(!o||o.root!==n.element&&o.root.contains(n.element))?n:null}function GI(e,t){let n=Object.entries(ai(t)).map(([s,l])=>`${gm(s)}=${gm(l)}`).join(", "),o=j$(e,t),i=Uo(e),r=i?{root:e,component:i}:o?void 0:c0(e);if(r){let{definition:s,props:l}=r.component;o={name:s.name,source:h0(r.component),props:{...l,...Object.fromEntries(ln.get(r.root)??[])}}}let a=Object.entries(o?.props??{}).filter(([,s])=>s===null||["boolean","number"].includes(typeof s)||typeof s=="string"&&s.length<=80).slice(0,12).map(([s,l])=>`${gm(s)}=${JSON.stringify(l).replace(/→/g,"\\u2192")}`);return[n&&`Theme: ${n}`,o?.name&&`Component: ${gm(o.name)}${o.source?` (${gm(o.source)})`:""}`,a.length&&`Props: ${a.join(", ")}`].filter(s=>!!s)}function P$(e){return[N$(e),p2(e),NH(e)].filter(t=>!!t).join(`
352
352
 
353
353
  `)||void 0}function FI(e,t,n){D$.get(e)?.abort();let o=new AbortController;D$.set(e,o),e.addEventListener("click",i=>{let r=t();if(!r)return;let a=p2(r)||mT(r);!Uo(r)&&!a||(i.stopImmediatePropagation(),n(r,P$(r)))},{capture:!0,signal:o.signal})}function YI(e){return A$(e)}function XI(e){return T$(e)||mT(e)||HH(e)}function WI(e){M$(e)}function ZI(e){u2(e),gT(e)}function Js(e){if(!e||_$.has(e))return;let t=document.createElement("style");t.textContent=jI+PI+_y,e.append(t),_$.add(e)}function B$(e,t){e.dataset.picker="token",e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-expanded","false");let n,o=r=>Promise.resolve().then(()=>(o2(),n2)).then(a=>{n=a,!(!e.isConnected||e.disabled||!r&&e.getAttribute("aria-expanded")==="true")&&a.openTokenPicker({trigger:e,...t()},r)},()=>{}),i;e.addEventListener("pointerdown",r=>{r.button||(r.preventDefault(),i=r.pointerType==="mouse"?void 0:r,!i&&(e.focus(),o(!0)))}),e.addEventListener("pointerup",r=>{i&&Math.abs(r.clientY-i.clientY)<=10&&o(!0),i=void 0});for(let r of["mousedown","touchend"])e.addEventListener(r,a=>{a.cancelable&&a.preventDefault()});return e.addEventListener("keydown",r=>{r.ctrlKey||r.metaKey||!["Enter"," ","ArrowDown","ArrowUp"].includes(r.key)||(r.preventDefault(),o(!1))}),{prepare:()=>n?.refreshTokenPicker(e),refresh:()=>n?.refreshTokenPicker(e,{trigger:e,...t()})}}function QI(e,t,n){if(n.aborted)return;let o=e.ownerDocument.defaultView;if(!o)return;t();let i=0,r=0,a=()=>{n.aborted||(t(),!(++r>120)&&(i=o.requestAnimationFrame(()=>{i=0;for(let s=e;s;s=s.parentElement)if(s.getAnimations?.().some(l=>l.playState==="running")){a();return}})))};a(),o.setTimeout(()=>{n.aborted||t()},320)}function JI(e,t,n,o,i){let r=e.getRootNode(),a=new AbortController,s=new MutationObserver(()=>{n.isConnected||a.abort()});s.observe(r instanceof ShadowRoot?r:document,{childList:!0,subtree:!0}),r.addEventListener("palette-theme-change",()=>{i?.(n)||QI(t,o,a.signal)},{signal:a.signal}),a.signal.addEventListener("abort",()=>s.disconnect(),{once:!0})}function V$(e,t){let n=document.createElement("div");n.className="design-token-match",n.hidden=!0;let o=document.createElement("span"),i=document.createElement("button");i.type="button",i.textContent="Use token",n.append(o,i);let r=()=>{};return i.addEventListener("click",a=>{a.preventDefault(),r()}),{show(a,s){n.isConnected||(e??t.parentElement)?.after(n),n.hidden=!a,r=s;let l=(e??t.parentElement)?.dataset.fieldLabel;o.textContent=a?`${l?`${l} \xB7 `:""}Same ${a.type==="color"?"color":"value"} as ${a.label||a.path}`:"",o.title=a?`${a.path}${a.ref?` \xB7 ${a.ref}`:""} \xB7 ${a.value}`:"",i.setAttribute("aria-label",a?`Use token ${a.label||a.path}`:"Use token")}}}function eG(e,t){let n=(Array.isArray(t?.themes)?t.themes:[]).find(o=>Array.isArray(o?.options)&&o.options.length>1&&o.options.length<4);if(n)return()=>Promise.all(n.options.map(o=>na(e,{...ai(t),[n.id]:o.id}).then(i=>({label:m0(o.label,o.id),values:new Map(i.map(r=>[r.path,r.value]))})))).catch(()=>[])}function b2(e,t){let n=e?.getAttribute("aria-describedby")?.split(" ")??[];e&&!n.includes(t)&&e.setAttribute("aria-describedby",[...n,t].join(" "))}function U$(e,t){let n=document.createElement("small");return n.className="design-token-binding__state",n.id=`palette-token-${t}-${Math.random().toString(36).slice(2,8)}`,b2(e,n.id),n}function q$(e,t){e.dispatchEvent(new CustomEvent("palette-announce",{detail:t,bubbles:!0,composed:!0}))}function K$(e,t,n,o){let i=Lo(e);if(!i)return null;let r=d2(i,t);if(!r.length)return null;Js(o);let a=document.createElement("span");a.className="design-token-binding",a.setAttribute("data-mode","custom");let s=document.createElement("span");s.className="design-token-icon",s.setAttribute("aria-hidden","true");let l=document.createElement("span");l.className="design-token-chip",l.setAttribute("aria-hidden","true");let c=document.createElement("button");c.type="button",c.className="design-token-detach",c.title="Detach token",c.setAttribute("aria-label",`Detach token from ${t}`),c.innerHTML='<svg viewBox="0 0 12 12"><path d="M5 3.5 6.5 2a2.1 2.1 0 0 1 3 3L8 6.5M7 8.5 5.5 10a2.1 2.1 0 0 1-3-3L4 5.5M2 2l8 8"/></svg>';let u=document.createElement("select");u.setAttribute("aria-label",`Style token for ${t}`);let d=U$(u,t),p=document.createElement("option");p.value="custom",p.textContent="Custom value",u.append(p);for(let E of r){let S=document.createElement("option"),A=gc(i,E);S.value=E.path,S.textContent=A?`${E.path} \xB7 ${A}`:E.path,u.append(S)}let g=fT(),y=E=>({path:E.path,type:E.type,value:gc(i,E),properties:E.properties,group:E.path.split(".")[0],ref:E.cssVariable}),v=V$(null,a),x=E=>{u.value=E,u.dispatchEvent(new Event("change"))};B$(u,()=>({tokens:r.map(y),property:t,current:u.value,custom:o0(e,t,a.parentElement?.querySelector("[data-property]")),onPreview:E=>{let S=r.find(A=>A.path===E.path);return dm(e,()=>Fa(e,t,`var(${S.cssVariable})`))},onSelect:E=>x(E.path)}));let h=()=>{let E=c2(i,e,t),S=E?null:yu(i,e,t),A=E?.mode==="token"?r.find(F=>F.path===E.tokenPath):void 0,_=A??S?.token;u.value=_?.path??"custom",l.textContent=_?`Uses ${_.path}`:"";let T=E?.declaredPath,H=A?"token":S?"connected":T?"override":"custom";a.dataset.mode=H,a.parentElement?.setAttribute("data-token-mode",H),d.textContent=H==="token"?T&&T!==A?.path?`Rebound from ${T} \xB7 preview`:`Linked to ${A?.path} \xB7 preview`:H==="connected"?`Connected ${S?.origin==="inline"?"inline":"from stylesheet"}`:H==="override"?`Custom override \xB7 was ${T}`:"",u.title=d.textContent||"Choose a token",b2(a.parentElement?.querySelector("[data-property]"),d.id),g.hidden=H!=="custom";let R=H==="custom"?getComputedStyle(e).getPropertyValue(t).trim():"",z=H==="custom"?Ny(r.map(y),R):void 0;H==="custom"&&jy(g,R,z),v.show(z,()=>z&&x(z.path))},m=new MutationObserver(h);m.observe(e,{attributes:!0,attributeFilter:["style"]});let b=new MutationObserver(()=>{a.isConnected||(m.disconnect(),b.disconnect())});return b.observe(a.ownerDocument,{childList:!0,subtree:!0}),u.addEventListener("change",()=>{let E=e.style.getPropertyValue(t),S=r.find(_=>_.path===u.value),A=c2(i,e,t);if(S&&A&&S.path===A.declaredPath)S$(i,e,t),n(E,e.style.getPropertyValue(t),S.path);else if(S)(S.path!==yu(i,e,t)?.token.path||A)&&a2(i,e,S,t,{recordHistory:!1})&&n(E,e.style.getPropertyValue(t),S.path),q$(a,`${t} uses ${S.path}`);else{let T=a.parentElement?.querySelector("[data-property]")?.value??getComputedStyle(e).getPropertyValue(t).trim(),H=/^-?[\d.]+$/.test(T.trim())&&!/weight|line/.test(t)?`${T.trim()}px`:T;s2(i,e,t,H),e.style.setProperty(t,H),n(E,H)}h()}),c.addEventListener("click",()=>{let E=r.find(_=>_.path===u.value),S=a.parentElement?.querySelector("input[data-property]"),A=E&&gc(i,E);S&&A&&(S.value=S.type==="number"?String(parseFloat(A)):A),u.value="custom",u.dispatchEvent(new Event("change")),a.parentElement?.querySelector("[data-property]")?.focus()}),a.append(l,u,s,c,g,d),queueMicrotask(h),h(),a}function tG(e){let t=Lo(e);return new Set([...t?.elementBindings.get(e)?.keys()??[],...OH(e)])}function I$(e,t,n,o,i,r,a,s,l,c){let u=t.flatMap(y=>{let v=[...n.querySelectorAll("[data-field-property]")].find(h=>h.dataset.fieldProperty===y.property),x=v?.querySelector("[data-property]");return v&&x?[{field:y,label:v,input:x}]:[]}),d=y=>{for(let{field:v,label:x,input:h}of u){if(x.querySelector(".design-token-binding")||!n.contains(x))continue;let m=()=>{r&&(h.value=r(v,e,x.querySelector(".design-token-binding")?.dataset.value));let E=x.querySelector('input[type="range"],input[type="color"]');E&&(E.value=v.kind==="color"&&a?a(h.value):h.value)},b=y(v,x,h,m);if(b){x.append(b),m();let E=x.querySelector('input[type="color"]'),S=b.querySelector("select"),A=_=>{_.preventDefault(),S?.focus(),S&&(S.dataset.start="custom"),S?.dispatchEvent(new KeyboardEvent("keydown",{key:"Enter",bubbles:!0,cancelable:!0}))};E?.addEventListener("click",A),E?.addEventListener("keydown",_=>{(_.key==="Enter"||_.key===" ")&&A(_)})}JI(x,e,h,m,c)}},p=s?.tokens;if(!p){d((y,v,x,h)=>K$(e,y.property,m=>{o(y,x,m),h()},i));return}Js(i);let g=eG(p,s);return Promise.all([na(p,ai(s)),_H(p,e)]).then(([y,v])=>{d((x,h,m,b)=>G$(p,e,x.property,y,v[x.property],E=>{l?.(E),b()},h,m,g,b,()=>na(p,ai(s))))},()=>{})}function G$(e,t,n,o,i,r,a,s,l,c,u){let d=Xs(o,n),p=o0(t,n,s);if(!d.length&&!i&&!p)return null;let g=MH(t,n,i,e,o),y=i&&"offToken"in i?i.offToken:void 0,v=y===void 0?void 0:Ny(d,y),x=document.createElement("span");x.className="design-token-binding";let h=document.createElement("span");h.className="design-token-chip",h.setAttribute("aria-hidden","true");let m=document.createElement("span");m.className="design-token-icon",m.setAttribute("aria-hidden","true");let b=document.createElement("button");b.type="button",b.className="design-token-detach",b.title="Edit the value",b.setAttribute("aria-label",`Edit ${n} value`),b.innerHTML='<svg viewBox="0 0 12 12"><path d="M5 3.5 6.5 2a2.1 2.1 0 0 1 3 3L8 6.5M7 8.5 5.5 10a2.1 2.1 0 0 1-3-3L4 5.5M2 2l8 8"/></svg>';let E=document.createElement("select");E.setAttribute("aria-label",`Style token for ${n}`),E.disabled=!d.length&&!p;let S=document.createElement("option");S.value="",S.textContent="Choose a token",E.append(S);let A=()=>{E.replaceChildren(S),E.disabled=!d.length&&!p;let Y=new Map([["",E]]);for(let W of d){let C=W.group??"",U=Y.get(C);U||(U=document.createElement("optgroup"),U.label=C,Y.set(C,U));let I=document.createElement("option");I.value=W.path,I.textContent=`${Jf(W)}${W.ref?` \xB7 ${W.ref}`:""}${W===v?" \xB7 same value":""}`,I.title=em(W),U.append(I)}for(let[W,C]of Y)W&&E.append(C)};A();let _=fT();y!==void 0&&jy(_,y,v);let T=U$(E,n);b2(s,T.id);let H=!1,R=V$(a,x),z=()=>{let Y=pT(t,n,i);return H?void 0:Y&&"path"in Y?Y.path:void 0},F=B$(E,()=>({tokens:o,property:n,current:z(),themes:l,custom:o0(t,n,s),onPreview:Y=>dm(t,()=>{let W=au(e,t,n,Y);return c?.(),()=>{W(),c?.()}}),onSelect:le})),B=()=>{let Y=Py(t,n),W=z(),C=W?o.find(L=>L.path===W):void 0;E.value=W&&d.some(L=>L.path===W)?W:"";let U=C?Jf(C):W;h.replaceChildren(...U?[w("span","design-token-chip__verb","Uses"),` ${U}`]:[]);let I=W?Y?"token":"connected":"custom";x.dataset.mode=I;let G=document.createElement("i").style;C&&/color|fill|stroke/.test(n)&&(G.color=C.value);let te=/^rgba?\(/.test(G.color)?G.color:"";x.dataset.value!==te&&(x.dataset.value=te,x.isConnected&&c?.()),(a??x.parentElement)?.setAttribute("data-token-mode",I),_.hidden=!!W;let ie=pT(t,n,i),pe=ie&&"offToken"in ie?ie.offToken:getComputedStyle(t).getPropertyValue(n).trim()||y||"",xe=W?void 0:Ny(d,pe);W||jy(_,pe,xe),T.textContent=C?`${Y?"Preview":"Uses"} ${em(C)}`:W?`Uses ${W}`:_.hidden?"":_.title,E.title=T.textContent||"Choose a token",R.show(_.hidden?void 0:xe,()=>xe&&le(xe))};function le(Y){H=!1;let W=g??{offToken:getComputedStyle(t).getPropertyValue(n).trim()},C="path"in W?o.find(U=>U.path===W.path):void 0;r(DH(e,t,n,Y,W,C)),B(),q$(x,`${n} uses ${Jf(Y)}`)}E.addEventListener("change",()=>{let Y=d.find(W=>W.path===E.value);Y?le(Y):B()}),b.addEventListener("click",()=>{H=!0,B(),s?.focus()}),x.append(h,E,m,b,_,T);let J=new MutationObserver(B);J.observe(t,{attributes:!0,attributeFilter:["style","class"]});let V=new AbortController,oe=new MutationObserver(()=>{x.isConnected||(J.disconnect(),oe.disconnect(),V.abort())});oe.observe(document,{childList:!0,subtree:!0});let ue=a?.getRootNode();ue instanceof ShadowRoot&&oe.observe(ue,{childList:!0,subtree:!0}),ue?.addEventListener("palette-theme-changing",F.prepare,{signal:V.signal});let q=0;return ue?.addEventListener("palette-theme-change",()=>{let Y=++q;(u?.()??Promise.resolve([...o])).then(W=>{V.signal.aborted||Y!==q||(o=W,ru(t,e,o),d=Xs(o,n),A(),B(),F.refresh())},()=>{})},{signal:V.signal}),B(),x}function nG(e,t,n){let o=0;$y(e,t.ownerDocument,()=>{let i=++o,r=e?.tokens;t.dispatchEvent(new Event("palette-theme-changing")),(r?na(r,ai(e)):Promise.resolve([])).then(a=>{n.aborted||i!==o||(t.dispatchEvent(new Event("palette-theme-changing")),r&&$H(r,a),t.dispatchEvent(new Event("palette-theme-change")))},()=>{})},n)}function F$(e,t,n,o){let i=Lo(e);if(!i||!i.tokens.length)return null;Js(o);let r=document.createElement("details");r.className="design-group design-theme-group",r.open=H$,r.addEventListener("toggle",()=>{r.isConnected&&(H$=r.open)});let a=document.createElement("summary");a.textContent="Shared theme";let s=document.createElement("small");s.className="design-react-source",s.textContent="Changes every element using these tokens",r.append(a,s);let l=new Map;for(let u of i.tokens){let d=u.path.split(".")[0];l.set(d,[...l.get(d)??[],u])}let c=i.tokens.length>6&&l.size>1;for(let[u,d]of c?l:new Map([["",i.tokens]])){if(u){let p=document.createElement("small");p.className="design-theme-heading",p.textContent=u,r.append(p)}for(let p of d)r.append(oG(i,p,t,n,u))}return r}function oG(e,t,n,o,i){let r=document.createElement("div");r.className="design-theme-token";let a=document.createElement("span");a.textContent=i&&t.path.slice(i.length+1)||t.path,a.title=`${t.path} \xB7 ${r2(e,t)} matching \xB7 ${t.impactSelector}`;let s=n.fields.find(x=>t.properties.includes(x.property)),l={property:t.cssVariable,label:`Shared theme value for ${t.path}`,kind:t.type==="dimension"?"size":s?.kind??"text",glyph:t.type==="color"?void 0:s?.glyph,values:s?.values},c=!1,u=n.fieldControl(l,{element:e.root,begin:()=>{c=!1},apply:(x,h,m)=>{let b=m!==null&&w$(e,t,m.trim(),c);x.setAttribute("aria-invalid",String(!b)),b&&(c=!0,y(),o())},commit:(x,h,m)=>{m!==!1&&(c=!1,x.getAttribute("aria-invalid")==="true"&&g())}}),d=u.querySelector("[data-property]"),p=u.querySelector('input[type="color"]'),g=()=>{let x=gc(e,t);d.value=x,p&&(p.value=n.toHex(x)),d.removeAttribute("aria-invalid"),y()},y=()=>{v.disabled=!r.toggleAttribute("data-changed",e.themeEdits.has(t.path)),t.type==="fontFamily"&&(d.title=d.value)},v=document.createElement("button");return v.type="button",v.className="design-theme-reset",v.title="Reset to page value",v.setAttribute("aria-label",`Reset ${t.path}`),v.innerHTML='<svg viewBox="0 0 16 16"><path d="M2.5 2.5v3h3M3 5.5a5.5 5.5 0 1 1-.5 2.5"/></svg>',v.addEventListener("click",()=>{k$(e,t),g(),o()}),g(),r.append(a,u,v),r}function iG(e,t,n){let o=Lo(e);return o&&s2(o,e,t,n),CH(e,t)}function rG(e,t){let n=Lo(e);n&&l2(n,e,t)}function Y$(e){e=Wa(e)??e;let t=qo.get(e),n=t?.at(-1),o=Uo(e);if(!n||!o)return;let i=t.find(a=>a.propName===n.propName).before;t.pop(),g0.set(e,[...g0.get(e)??[],n]),o.setProps({...o.props,[n.propName]:n.before});let r=ln.get(e);r||ln.set(e,r=new Map),Object.is(i,n.before)?(r.delete(n.propName),o.releaseProps?.([n.propName])):r.set(n.propName,i),r.size||ln.delete(e)}function aG(e){e=Wa(e)??e;let t=g0.get(e)?.pop(),n=Uo(e);if(!t||!n)return;n.setProps({...n.props,[t.propName]:t.after});let o=ln.get(e);o||ln.set(e,o=new Map);let i=o.has(t.propName)?o.get(t.propName):t.before;Object.is(i,t.after)?(o.delete(t.propName),n.releaseProps?.([t.propName])):o.set(t.propName,i),o.size||ln.delete(e),qo.has(e)||qo.set(e,[]),qo.get(e).push(t)}function sG(){for(let e of[...ln.keys()])Q$(e);ln.clear(),qo.clear(),C$(),zH(),W$()}function hm(e){try{return String(e.current(ko()))}catch{return}}function W$(e){for(let[n,o]of b0)try{hm(n)!==o&&n.apply(o,ko())}catch{}b0.clear();let t=e?.querySelector(X$);t&&(h2.get(t)?.(),t.remove())}function dG(e,t,n){let o=w("div","morphing-menu__tooltip sidebar-tooltip");o.setAttribute("aria-hidden","true");let i=0,r=()=>{clearTimeout(i),delete o.dataset.open},a=()=>{if(!e.isConnected)return r();o.textContent=e.dataset.tip??"";let l=e.getBoundingClientRect(),c=o.offsetWidth/2;o.style.left=`${Math.max(8+c,Math.min(innerWidth-8-c,l.left+l.width/2))}px`,o.style.top=`${l.bottom+8}px`,o.dataset.open=""},s=l=>{l.type==="focusin"&&!e.matches(":focus-visible")||(clearTimeout(i),i=window.setTimeout(a,l.type==="focusin"?0:400))};(t??e.ownerDocument.body).append(o),e.addEventListener("pointerenter",s,{signal:n}),e.addEventListener("focusin",s,{signal:n});for(let l of["pointerleave","pointerdown","focusout"])e.addEventListener(l,r,{signal:n});return n.addEventListener("abort",()=>{r(),o.remove()}),()=>{o.dataset.open!==void 0&&a()}}function Z$(e,t,n,o,i){o&&i&&!z$.has(i)&&(z$.add(i),nG(t,o,i));let r=e.closest(".design-inspector")?.querySelector(".design-inspector__heading"),a=(r??e).querySelector(X$),s=a instanceof HTMLDetailsElement&&a.open;a&&h2.get(a)?.(),a?.remove();let l=t?.themes,c=(Array.isArray(l)?l:[]).flatMap(b=>{let E=hm(b),S=Array.isArray(b?.options)?b.options.filter(A=>typeof A?.id=="string"):[];return E===void 0||S.length<2?[]:[{axis:b,current:E,options:S,names:S.map(A=>m0(A.label,A.id))}]}),u=m2;if(m2=void 0,!c.length)return;let d=(b,E,S)=>{let A=hm(b);if(S===A)return;b0.has(b)||b0.set(b,A??E);let _=y.getRootNode().activeElement;(!_||y.contains(_))&&(m2=b);try{b.apply(S,ko())}catch{}n(),v()},p=new AbortController,g=p.signal,y,v,x,h=()=>{};if(c.length===1&&c[0].options.length===2){let{axis:b,current:E,options:S,names:A}=c[0],_=S.map(F=>[F.id,F.label].map(B=>String(B??"").toLowerCase()).find(B=>B==="light"||B==="dark")),T=_.includes("light")&&_.includes("dark"),H=y=w("button","design-theme-toggle");H.type="button",H.setAttribute("role","switch"),T||H.append(...A.map(F=>w("span","",F)));let R=dG(H,o,g),z=0;v=()=>{z=Math.max(0,S.findIndex(F=>F.id===(hm(b)??E))),H.setAttribute("aria-checked",String(z===1)),H.setAttribute("aria-label",`Theme: ${A[z]}`),H.dataset.tip=`Switch to ${A[1-z]}`,T?H.innerHTML=_[z]==="dark"?cG:lG:H.dataset.on=String(z),R()},H.addEventListener("click",()=>d(b,E,S[1-z].id)),u===b&&(x=H)}else{let b=y=w("details","design-theme-switch"),E=w("summary");E.setAttribute("aria-label","Preview theme");let S=w("div","design-theme-popup");S.setAttribute("role","group"),S.setAttribute("aria-label","Theme preview options"),b.append(E,S);let A=[];for(let{axis:_,current:T,options:H,names:R}of c){let z=m0(_.label,String(_.id)),F=w(H.length>3?"label":"div","design-field design-react-field"),B;if(H.length>3){let le=B=w("select");H.forEach((J,V)=>le.append(new Option(R[V],J.id))),le.value=T,le.addEventListener("change",()=>d(_,T,le.value)),Promise.resolve().then(()=>(VT(),BT)).then(J=>J.attach(S),()=>{})}else B=w("div","design-theme-options"),B.setAttribute("role","group"),H.forEach((le,J)=>{let V=w("button","",R[J]);V.type="button",V.setAttribute("aria-pressed",String(le.id===T)),V.addEventListener("click",()=>d(_,T,le.id)),B.append(V)});B.setAttribute("aria-label",`${z} theme`),u===_&&(x=B.querySelector("[aria-pressed=true]")??B),A.push(()=>{let le=hm(_)??T;B instanceof HTMLSelectElement?B.value=le:B.querySelectorAll("button").forEach((V,oe)=>V.setAttribute("aria-pressed",String(H[oe].id===le)));let J=H.findIndex(V=>V.id===le);return`${z}: ${J<0?m0(void 0,le):R[J]}`}),F.append(w("span","",z),B),S.append(F)}v=()=>{let _=A.map(T=>T());E.textContent=_[0].split(": ").slice(1).join(": ")+(_.length>1?` +${_.length-1}`:""),E.title=`Preview theme \xB7 ${_.join(" \xB7 ")}`},b.open=s||!!x,h=()=>{b.open=!1},b.addEventListener("keydown",_=>{_.key==="ArrowDown"&&_.target===E&&(_.preventDefault(),b.open=!0,S.querySelector("button,select")?.focus())}),b.addEventListener("focusout",_=>{_.relatedTarget instanceof Node&&!b.contains(_.relatedTarget)&&h()}),b.ownerDocument.defaultView?.addEventListener("keydown",_=>{!b.open||_.key!=="Escape"||!_.composedPath().includes(b)||b.querySelector("select[aria-expanded=true]")||(_.preventDefault(),_.stopImmediatePropagation(),h(),E.focus())},{capture:!0,signal:g})}v(),h2.set(y,()=>{h(),p.abort()}),Js(o),r?r.insertBefore(y,r.querySelector(".design-inspector__close")):e.prepend(y);let m=y.getRootNode();m.addEventListener("palette-theme-change",v,{signal:g}),m.addEventListener("pointerdown",b=>{b.composedPath().includes(y)||h()},{capture:!0,signal:g}),sc(y,()=>{h(),y.isConnected||p.abort()},g),x?.focus({preventScroll:!0})}function Q$(e){e=Wa(e)??e;let t=ln.get(e),n=Uo(e);!t?.size||!n||(n.setProps({...n.props,...Object.fromEntries(t)}),n.releaseProps?.([...t.keys()]),ln.delete(e),qo.delete(e))}function p0(e,t){if(e.title=t===void 0?"unset":t===""?"Empty string":"",e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=t===!0,e.toggleAttribute("data-unset",t===void 0);return}e.value=t===void 0?"":String(t),e instanceof HTMLInputElement&&(e.placeholder=t===void 0?"unset":'""')}function uG(e,t){e.className="design-react-scrub";let n=()=>Number(t.value)||0,o=i=>{t.value=String(Math.round(i*100)/100)};e.addEventListener("pointerdown",i=>{if(i.button||t.disabled)return;i.preventDefault(),e.setPointerCapture?.(i.pointerId);let r=i.clientX,a=!1,s=n();e.onpointermove=l=>{let c=Math.trunc((l.clientX-r)/2);c&&(r+=c*2,a=!0,o(n()+c*(l.shiftKey?10:1)),t.dispatchEvent(new CustomEvent("palette-preview",{detail:t.value})))},e.onpointerup=e.onpointercancel=()=>{if(e.onpointermove=e.onpointerup=e.onpointercancel=null,!a)return t.focus();t.dispatchEvent(new CustomEvent("palette-preview",{detail:null})),n()!==s&&t.dispatchEvent(new Event("change",{bubbles:!0}))}}),t.addEventListener("keydown",i=>{i.key!=="ArrowUp"&&i.key!=="ArrowDown"||(i.preventDefault(),o(n()+(i.key==="ArrowUp"?1:-1)*(i.shiftKey?10:1)),t.dispatchEvent(new Event("change",{bubbles:!0})))})}function O$(e,t,n,o,i){if(!i){i=w("summary");let r=w("span","design-react-name",t);r.title=t,i.append(r),e.append(i)}n&&i.after(Dy(t,n,o))}function pG(e,t,n){let o=c0(e);if(!o)return null;Js(n);let i=document.createElement("small");if(i.className="design-react-source design-react-group design-react-inside",i.append(`Inside ${o.component.definition.name}`),t){let r=document.createElement("button");r.type="button",r.textContent="Select component",r.addEventListener("click",()=>t(o.root)),i.append(" \xB7 ",r)}return i}function g2(e,t,n,o,i,r){e=Wa(e)??e;let a=t.definition.props.find(d=>d.name===n);if(!a||!l0(a,o))return i.setAttribute("aria-invalid","true"),!1;i.removeAttribute("aria-invalid");let s;try{let d=t.props;if(s=d[n],Object.is(s,o))return!0;t.setProps({...d,[n]:o})}catch{return i.setAttribute("aria-invalid","true"),i.title="Runtime preview is unavailable. The component kept its current props.",!1}let l=ln.get(e);l||ln.set(e,l=new Map);let c=l.has(n)?l.get(n):(qo.get(e)?.find(d=>d.propName===n)??{before:s}).before;Object.is(c,o)?(l.delete(n),t.releaseProps?.([n])):l.set(n,c),l.size||ln.delete(e);let u=qo.get(e);return u||qo.set(e,u=[]),u.push({propName:n,before:s,after:o}),g0.delete(e),r(()=>Y$(e)),!0}function J$(e,t,n,o,i,r,a){let s=Uo(e);if(!s){let d=j$(e,i),p;try{p=d&&Ys(e,i)?.editor?.(d)}catch{}if(p&&d&&fn(d.element)){if(d.element!==e){Js(n);let g=document.createElement("small");if(g.className="design-react-source design-react-group design-react-inside",g.append(`Inside ${d.name}`),o){let y=document.createElement("button");y.type="button",y.textContent="Select component",y.addEventListener("click",()=>o(d.element)),g.append(" \xB7 ",y)}return g}s=b$(d,p)}if(!s){let g=null;try{g=d&&Ys(e,i)?.panel?.(d)||null}catch{}if(g){Js(n);let y=g.querySelector("summary");y&&d&&O$(g,d.name,d.source??"",a,y)}return g??pG(e,o,n)}}Js(n);let l=document.createElement("details");l.className="design-group design-react-group",l.open=!0,O$(l,s.definition.name,h0(s),a);let c=s,u=[];if(r&&s.subscribe){let d=0,p=!1,g=new AbortController,y=l.getRootNode(),v=()=>{d||!l.isConnected||(d=requestAnimationFrame(()=>{if(d=0,!l.isConnected)return;let b=l.getRootNode(),E=b.activeElement;u.forEach(S=>S()),!(E?.closest(".design-inspector,.palette-tokens,.palette-select")||b.querySelector(".palette-tokens,.palette-select"))&&(p=!1,r(e.isConnected?l:void 0))}))},x=s.subscribe(()=>{e=Wa(e)??e,p=!0,v()});(n??y).addEventListener("focusout",()=>{queueMicrotask(()=>{p&&v()})},{signal:g.signal});let m=()=>{x(),cancelAnimationFrame(d),g.abort()};queueMicrotask(()=>{l.isConnected?sc(l,()=>{l.isConnected||m()},g.signal):m()})}for(let d of s.definition.props.filter(p=>p.kind!=="unsupported")){let p=d.styleProperty,g=document.createElement("label");g.className="design-field design-react-field";let y=document.createElement("span");y.textContent=d.name;let v=s.props[d.name],x;if(d.kind==="enum"){let S=document.createElement("select");for(let A of d.values??[]){let _=document.createElement("option");_.value=String(A),_.textContent=String(A),S.append(_)}if(v===void 0&&!d.required){let A=document.createElement("option");A.value="",A.textContent="unset",S.prepend(A)}x=S}else{let S=document.createElement("input");d.kind==="boolean"?(S.type="checkbox",S.setAttribute("role","switch"),S.className="design-react-switch"):d.kind==="number"?(S.type="number",S.step="any",uG(y,S)):(S.type="text",S.maxLength=500,S.autocomplete="off"),x=S}if(p0(x,v),x.setAttribute("aria-label",`${s.definition.name} ${d.name}`),d.kind==="unsupported")x=document.createElement("input"),x.disabled=!0,x.value=`Read only \xB7 ${d.typeLabel}`,x.setAttribute("aria-label",`${s.definition.name} ${d.name}, read only`),g.title=`Inline feedback does not edit ${d.typeLabel} props.`;else{let S=()=>{let T=x instanceof HTMLInputElement&&x.type==="checkbox"?x.checked:x.value,H=T;d.kind==="number"?H=String(T).trim()===""?void 0:Number(T):d.kind==="enum"?H=A(String(T)):d.kind==="boolean"&&(H=T===!0),g2(e,c,d.name,H,x,t)&&d.kind==="boolean"&&p0(x,H)},A=T=>T===""&&!d.required?void 0:(d.values??[]).find(H=>String(H)===T);x.addEventListener("change",S);let _;(d.kind==="enum"||d.kind==="number")&&x.addEventListener("palette-preview",T=>{e=Wa(e)??e;let H=T.detail,R=c.props,z=R[d.name];try{H!==null?(_??={opening:z},_.shown=d.kind==="number"?Number(H):A(H),c.setProps({...R,[d.name]:_.shown})):_&&(Object.is(z,_.shown)||Object.is(z,_.opening))&&(c.setProps({...R,[d.name]:_.opening}),ln.get(e)?.has(d.name)||c.releaseProps?.([d.name]))}catch{}H===null&&(_=void 0)})}y.title=d.name,g.append(y,x);let h=document.createElement("div");h.className="design-react-row";let m=document.createElement("button");m.type="button",m.className="design-theme-reset",m.setAttribute("aria-label",`Reset ${s.definition.name} ${d.name}`),m.title="Restore the value before editing",m.innerHTML='<svg viewBox="0 0 16 16"><path d="M2.5 2.5v3h3M3 5.5a5.5 5.5 0 1 1-.5 2.5"/></svg>';let b=()=>{m.hidden=!ln.get(e)?.has(d.name)};u.push(()=>{x===x.getRootNode().activeElement||x.getAttribute("aria-expanded")==="true"||(p0(x,c.props[d.name]),b())}),x.addEventListener("change",b),m.addEventListener("click",()=>{let S=ln.get(e);S?.has(d.name)&&(g2(e,c,d.name,S.get(d.name),x,t),p0(x,c.props[d.name]),b(),x.focus())}),b(),h.append(g,m);let E=document.createElement("small");if(E.className="design-react-type",E.textContent=`${d.typeLabel}${d.required?" \xB7 required":" \xB7 optional"}`,g.append(E),g.title||=E.textContent,d.kind==="string"&&p){let S=Lo(e),A=S?d2(S,p):[];if(A.length){let _=document.createElement("span");_.className="design-token-binding";let T=document.createElement("span");T.textContent="Style token";let H=document.createElement("select");H.setAttribute("aria-label",`Style token for ${d.name}`);let R=document.createElement("option");R.value="custom",R.textContent="Custom value",H.append(R);for(let F of A){let B=document.createElement("option");B.value=F.path,B.textContent=F.path,H.append(B)}let z=()=>{let F=A.find(B=>s.props[d.name]===`var(${B.cssVariable})`);H.value=F?.path??"custom",_.dataset.mode=F?"token":"custom"};H.addEventListener("change",()=>{let F=A.find(le=>le.path===H.value),B=F?`var(${F.cssVariable})`:typeof s.props[d.name]=="string"&&String(s.props[d.name]).startsWith("var(")?e.ownerDocument.defaultView?.getComputedStyle(e).getPropertyValue(p).trim()??"":typeof s.props[d.name]=="string"?s.props[d.name]:"";g2(e,s,d.name,B,x,t)&&z()}),_.append(T,H),g.append(_),z()}}l.append(h)}return l.toggleAttribute("data-empty",!l.querySelector(".design-react-row")),l}var ln,qo,g0,_$,D$,jI,PI,f0,h0,gm,H$,b0,m2,h2,z$,X$,m0,lG,cG,x0=O(()=>{"use strict";i0();It();lT();Wf();Fs();um();ho();Sy();y$();f2();lc();lc();lc();f2();ln=new Map,qo=new Map,g0=new Map;_$=new WeakSet,D$=new WeakMap,jI=`.design-react-source{display:block;padding:0 0 8px;color:#77736f;font-size:10px;overflow-wrap:anywhere}.design-react-inside{padding:10px 12px}.design-react-inside button{padding:0;border:0;background:none;color:#bda6ef;font:inherit;cursor:pointer}.design-react-inside button:hover{text-decoration:underline}.design-react-field.design-field{display:grid;grid-template-columns:clamp(56px,24%,80px) minmax(0,1fr);align-items:center;gap:0 8px;height:auto;min-height:28px;margin-top:4px;background:none;box-shadow:none;color:#898680;font-size:11px}.design-react-field>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.design-react-scrub{cursor:ew-resize;user-select:none;touch-action:none}.design-react-scrub:hover{color:#e9e6e1}.design-react-field.design-field>:is(input,select){box-sizing:border-box;width:100%;min-width:0;height:28px;padding:0 8px;border:0;border-radius:6px;background-color:#ffffff0a;color:#f1efeb;font:inherit;font-size:11px}.design-react-field.design-field>:is(input,select):focus-visible{outline:1px solid #bda6ef;outline-offset:-1px}.design-react-field.design-field>select{padding-right:20px}.design-react-field.design-field>.design-react-switch{position:relative;justify-self:start;appearance:none;width:28px;min-width:0;height:16px;margin:0;padding:0;border-radius:8px;background:#ffffff29;cursor:pointer;transition:background-color .12s}.design-react-switch::before{content:"";position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #0006;transition:translate .12s var(--ease-smooth-out,ease)}.design-react-field.design-field>.design-react-switch:checked{background:#8b6ff0}.design-react-switch:checked::before{translate:12px}.design-react-field.design-field>.design-react-switch[data-unset]{border:1px dashed #ffffff4d;background:none}.design-react-switch[data-unset]::before{display:none}.design-react-switch[data-unset]::after{content:"unset";position:absolute;top:-1px;left:34px;color:#77736f;font-size:10px;line-height:16px;white-space:nowrap}.design-react-field.design-field>.design-react-switch:focus-visible{outline:2px solid #bda6ef;outline-offset:2px}@media (prefers-reduced-motion:reduce){.design-react-field.design-field>.design-react-switch,.design-react-switch::before{transition:none}}.design-react-field input:disabled{opacity:.55;cursor:not-allowed}.design-react-type{display:none}.design-react-field.design-field>.design-token-binding{display:grid}.design-react-field.design-field>.design-token-binding select{position:static;width:auto;height:24px;padding:0 18px 0 6px;box-shadow:none;opacity:1}.design-react-field .design-token-binding{grid-column:2;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:6px;margin-top:4px;color:#77736f;font-size:10px}.design-react-field .design-token-binding select{min-width:0;height:24px;border:0;border-radius:6px;appearance:none;background:#ffffff0a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 3 4 5.5 6.5 3' fill='none' stroke='%23898680' stroke-width='1.2'/%3E%3C/svg%3E") right 6px center/8px no-repeat;color:#e9e6e1;padding:0 18px 0 6px;font:inherit;font-size:10px;cursor:pointer}.design-react-field .design-token-binding[data-mode=token] select{background-color:#bda6ef24;color:#e6dcfb}.design-token-binding__state{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.design-field>.design-token-binding{display:contents}.design-field:has(>.design-token-binding)>input[data-property]{padding-right:28px}.design-token-icon,.design-token-detach,.design-field>.design-token-binding select{position:absolute;top:4px;right:4px;width:20px;height:20px;box-sizing:border-box;border-radius:5px}.design-token-icon{display:grid;place-items:center;color:#77736f;opacity:0;pointer-events:none;transition:opacity .12s}.design-token-icon::before{content:'';width:6px;height:6px;border:1.2px solid currentColor;border-radius:1.5px;rotate:45deg}.design-field:is(:hover,:focus-within) .design-token-icon{opacity:1}.design-field>.design-token-binding select{margin:0;padding:0;border:0;opacity:0;cursor:pointer;appearance:none}.design-field>.design-token-binding select:hover+.design-token-icon,.design-field:has(.design-token-binding select:hover) .design-token-icon{background:#ffffff14;color:#e9e6e1}.design-field:has(.design-token-binding select:focus-visible) :is(.design-token-icon,.design-token-chip){outline:2px solid #bda6ef;outline-offset:1px;opacity:1}.design-field[data-token-mode=override] .design-token-icon{opacity:1;color:#e7c27d}.design-token-chip,.design-token-detach{display:none}.design-field:is([data-token-mode=token],[data-token-mode=connected])>[data-property]{visibility:hidden}.design-field:is([data-token-mode=token],[data-token-mode=connected]) .design-token-chip{position:absolute;inset:4px 28px 4px var(--lead,4px);display:flex;align-items:center;gap:5px;padding:0 18px 0 6px;border-radius:4px;background:#bda6ef1f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 3 4 5.5 6.5 3' fill='none' stroke='%23c8b5f4' stroke-width='1.2'/%3E%3C/svg%3E") right 6px center/8px no-repeat;color:#e6dcfb;font-size:11px;white-space:nowrap;overflow:hidden;pointer-events:none}.design-token-chip::before{content:'';flex:none;width:5px;height:5px;border:1.2px solid #c8b5f4;border-radius:1px;rotate:45deg}.design-field:is([data-token-mode=token],[data-token-mode=connected]) .design-token-binding select{left:var(--lead,4px);right:28px;width:auto}.design-field:is([data-token-mode=token],[data-token-mode=connected]) .design-token-icon{display:none}.design-field:is([data-token-mode=token],[data-token-mode=connected]) .design-token-detach{display:grid;place-items:center;color:#898680}.design-token-detach:hover{background:#ffffff14;color:#f1efeb}.design-token-detach svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.2;stroke-linecap:round}.design-theme-group .design-react-source{padding:0 0 6px}.design-theme-heading{display:block;padding:8px 0 2px;color:#77736f;font-size:10px;text-transform:capitalize}.design-theme-token{position:relative;display:grid;grid-template-columns:96px minmax(0,1fr) 20px;align-items:center;gap:6px;margin-top:4px}.design-theme-token>span{overflow:hidden;color:#898680;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.design-theme-token[data-changed]>span{color:#e6dcfb}.design-theme-token[data-changed]::before{content:'';position:absolute;top:calc(50% - 2px);left:-8px;width:4px;height:4px;border-radius:50%;background:#bda6ef}.design-theme-reset{display:grid;place-items:center;width:20px;height:20px;padding:0;border:0;border-radius:5px;background:none;color:#77736f;cursor:pointer}.design-theme-reset:disabled{visibility:hidden}.design-theme-reset:hover{background:#ffffff14;color:#f1efeb}.design-theme-reset svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}.design-token-off{position:absolute;top:8px;right:24px;display:grid;place-items:center;width:12px;height:12px}.design-token-off::before{content:'';width:4px;height:4px;border-radius:50%;background:#e7c27d;opacity:.7}.design-token-off[hidden]{display:none}.design-field:has(>.design-token-binding>.design-token-off:not([hidden]))>input[data-property]{padding-right:38px}.design-theme-switch{padding:6px 12px 8px}.design-theme-switch .design-react-field>span{text-transform:capitalize}.design-theme-options{display:flex;min-width:0;padding:2px;border-radius:6px;background:#ffffff0a}.design-theme-options button{flex:1;min-width:0;height:24px;padding:0 6px;border:0;border-radius:4px;background:none;color:#898680;font:inherit;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.design-theme-options button:hover{color:#f1efeb}.design-theme-options button[aria-pressed=true]{background:#ffffff1a;color:#f1efeb}.design-theme-options button:focus-visible{outline:1px solid #bda6ef;outline-offset:-1px}@media (max-width:520px){.design-theme-options button{height:30px}.design-react-field.design-field>:is(input,select){height:34px}.design-token-icon,.design-token-detach,.design-field>.design-token-binding select{top:7px}.design-token-off{top:11px}}.design-react-row{display:grid;grid-template-columns:minmax(0,1fr) 28px;align-items:center;gap:4px}.design-react-row>.design-react-field{min-width:0;margin-top:4px}.design-react-row>.design-theme-reset{flex:none;width:28px;height:28px;margin-top:4px}.design-react-row>.design-theme-reset[hidden]{display:none}.design-react-group{position:relative}.design-react-group>summary{padding-right:32px}.design-react-group[data-empty]{padding-bottom:0}.design-react-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.design-react-status{flex:none;margin-left:4px;padding:1px 5px;border-radius:4px;background:#ffffff0f;color:#898680;font-size:10px;font-weight:500}.design-react-group>.palette-source{position:absolute;z-index:3;top:6px;right:8px}.design-react-advanced{margin-top:10px}.design-react-advanced>summary{color:#898680;font-size:11px;cursor:pointer}.design-react-field.design-field>input[readonly]{width:100%;min-width:0;padding:0;background:none;color:#c9c5bf;cursor:text}@media(max-width:520px){.design-react-row .design-react-field>:is(input,select){height:36px}.design-react-row>.design-theme-reset{width:32px;height:32px}.design-react-group>.palette-source{top:2px}}.design-theme-switch{position:relative;flex:none;padding:0}.design-theme-switch>summary{display:flex;align-items:center;gap:5px;max-width:90px;min-height:28px;padding:0 8px;border-radius:7px;background:#ffffff08;color:#b7b1c2;font-size:11px;list-style:none;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.design-theme-switch>summary::-webkit-details-marker{display:none}.design-theme-switch>summary::after{content:"\u2304";color:#77736f}.design-theme-switch[open]>summary,.design-theme-switch>summary:hover{background:#ffffff14;color:#f1efeb}.design-theme-popup{position:absolute;z-index:12;top:calc(100% + 6px);right:0;box-sizing:border-box;width:min(280px,calc(100vw - 48px));max-height:50dvh;overflow:auto;padding:10px 12px;border:1px solid #ffffff1a;border-radius:10px;background:#191819;box-shadow:0 12px 40px #0008}.design-theme-popup .design-react-field{grid-template-columns:68px minmax(0,1fr)}.design-theme-popup .design-react-field+ .design-react-field{margin-top:8px}.design-theme-toggle{flex:none;display:flex;align-items:center;min-width:28px;height:28px;padding:0;border:0;border-radius:7px;background:none;color:#909090;font:inherit;font-size:11px}.design-theme-toggle:hover{background:#161616;color:#eee}.design-theme-toggle>svg{width:16px;height:16px;margin:auto;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}.design-theme-toggle:has(span){padding:2px;background:#ffffff0a}.design-theme-toggle span{max-width:72px;padding:0 6px;border-radius:5px;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.design-theme-toggle[data-on="0"] span:first-child,.design-theme-toggle[data-on="1"] span:last-child{background:#ffffff1a;color:#f1efeb}`,PI=".design-token-match{grid-column:1/-1;display:flex;align-items:center;gap:6px;min-width:0;margin-top:-2px;padding:0 4px;color:#77736f;font-size:10px}.design-token-match[hidden]{display:none}.design-token-match>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.design-token-match button{flex:none;padding:0;border:0;background:none;color:#bda6ef;font:inherit;cursor:pointer}.design-token-match button:hover{text-decoration:underline}.design-token-match button:focus-visible{outline:1px solid #bda6ef;outline-offset:2px;border-radius:2px}@media (pointer:coarse){.design-token-match button{min-height:32px}}";f0=new Map,h0=e=>e.definition.source?`${e.definition.source}${e.definition.line?`:${e.definition.line}`:""}`:"";gm=e=>String(e).replace(/\s+/g," ").trim();H$=!1;b0=new Map,h2=new WeakMap,z$=new WeakSet,X$=".design-theme-switch,.design-theme-toggle";m0=(e,t)=>e||t.charAt(0).toUpperCase()+t.slice(1),lG='<svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="2.75"/><path d="M8 1.75v1.5m0 9.5v1.5M1.75 8h1.5m9.5 0h1.5M3.6 3.6l1 1m6.8 6.8 1 1m-8.8 0 1-1m6.8-6.8 1-1"/></svg>',cG='<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M13.25 9.6A5.5 5.5 0 1 1 6.4 2.75a4.4 4.4 0 0 0 6.85 6.85Z"/></svg>'});var rN={};Ft(rN,{openTokenPage:()=>yG,themeKey:()=>xu,tokenEdits:()=>nN,tokenProposal:()=>oN,tokenValueChanges:()=>fG});function xu(e){let t=[];for(let n of Array.isArray(e?.themes)?e.themes:[])if(!(!Array.isArray(n?.options)||n.options.length<2))try{t.push(String(n.current(ko())))}catch{}return t.length?t.join("+"):void 0}function nN(e,t={}){let n=()=>!!t.before?.(),o=new Map,i=[],r=[],a,s="",l=d=>{let p=d.map(({path:x,value:h,theme:m,alias:b})=>({path:x,value:h,...m?{theme:m}:{},...b?{alias:b}:{}})),g=t.theme?.(),y=p.length?JSON.stringify([g,p]):"";if(y===s)return;let v=a;a=void 0,s=y;try{v?.()}catch{}if(p.length&&e.previewValues)try{a=e.previewValues(p,g,ko())}catch{}},c=()=>l(n()?[]:[...o.values()]),u=d=>[...o].filter(([p])=>p!==d).map(([,p])=>p);return{get size(){return o.size},get canUndo(){return i.length>0},get steps(){return i},list:()=>[...o.values()],get:(d,p)=>o.get(v0(d,p)),set(d){let p=v0(d.path,d.theme),g=o.get(p);return(g?.to??d.from)===d.to?!1:(i.push({key:p,edit:g}),r.length=0,d.to===d.from?o.delete(p):o.set(p,d),c(),!0)},preview(d){return l(n()?[]:[...u(v0(d.path,d.theme)),...d.to===d.from?[]:[d]]),c},undo(){let d=i.pop();d&&(r.push({key:d.key,edit:o.get(d.key)}),d.edit?o.set(d.key,d.edit):o.delete(d.key),c())},redo(){let d=r.pop();d&&(i.push({key:d.key,edit:o.get(d.key)}),d.edit?o.set(d.key,d.edit):o.delete(d.key),c())},reset(d,p){let g=v0(d,p);o.delete(g);for(let y=i.length;y--;)i[y].key===g&&i.splice(y,1);c()},resetAll(){o.clear(),i.length=0,c()},sync:c,stop(){o.clear(),i.length=0,l([])}}}function oN(e,t){if(e.length)return["Proposed token changes (preview only)",...e.map(n=>`Token: ${n.path}${n.theme?` (${n.theme})`:""} ${eN(n.from)} \u2192 ${eN(n.to)}`),`Token adapter: ${t}`].join(`
354
- `)}function fG(e){return e.map(({path:t,theme:n,from:o,to:i})=>({kind:"token-value",path:t,...n?{theme:n}:{},from:o,to:i}))}async function yG(e,t){let n=await Promise.all([Promise.resolve().then(()=>(o2(),n2)),Promise.resolve().then(()=>(x0(),y0)),Promise.resolve().then(()=>(w0(),x2))]),o=y2.get(e);o||y2.set(e,o=xG(e,t,n)),o.open()}function Nn(e,t="",n){let o=document.createElement(e);return o.className=t,n!==void 0&&(o.textContent=n),o}function xG(e,t,[n,o,i]){let r=t.design?.tokens??o.cssVariableTokens(),a=typeof r.previewValues=="function",s=()=>e.hasAttribute("data-before"),l=nN(r,{before:s,theme:()=>xu(t.design)}),c=Nn("style");c.textContent=hG,t.root.append(c),n.stylePicker(e);let u=Nn("section","design-token-page");u.setAttribute("aria-label","Tokens");let d=Nn("p","","No live preview \xB7 edits are recorded as proposals");d.hidden=a;let p=Nn("div","palette-tokens__bar"),g=Nn("input");g.type="search",g.placeholder="Search tokens",g.autocomplete="off",g.spellcheck=!1,g.setAttribute("aria-label","Search tokens"),p.append(g);let y=Nn("div","design-token-page__list");u.append(d,p,y);let v=(L,Q)=>{let Z=Q.getBoundingClientRect(),ae=e.getBoundingClientRect();ae.left-16>L.offsetWidth?(L.style.left=`${ae.left-8-L.offsetWidth/2}px`,L.style.top=`${Z.top+(Z.height-L.offsetHeight)/2}px`):ae.top-16>L.offsetHeight&&(L.style.top=`${ae.top-8-L.offsetHeight}px`)},x=Nn("div","design-inspector__bar design-token-bar"),h=Nn("span","design-inspector__count"),m=Nn("div","design-inspector__compare");m.setAttribute("role","group"),m.setAttribute("aria-label","Compare with the page");let b=["Before","After"].map((L,Q)=>{let Z=Nn("button","",L);return Z.type="button",Z.dataset.tip=`${L} \xB7 ${Q?"\u2192":"\u2190"} or B`,Z.addEventListener("click",()=>V(!Q)),m.append(Z),Z}),E=Nn("p","design-inspector__status");E.setAttribute("role","status");let S=Nn("div","design-inspector__actions"),A=(L,Q,Z)=>{let ae=Nn("button","design-inspector__tool");return ae.type="button",ae.dataset.tip=L,ae.setAttribute("aria-label",L),ae.innerHTML=Q,ae.addEventListener("click",()=>{V(!1),Z(),ue()}),ae},_=A("Undo",bG,()=>l.undo()),T=A("Reset all",tN,()=>l.resetAll()),H=Nn("button","","Comment");H.type="button";let R=()=>oN(l.list(),r.id),z=()=>{l.resetAll(),ue()};H.addEventListener("click",()=>{let L=R();L&&(z(),t.onComment(ko().document.body,L))}),S.append(_,T,H),x.append(h,m,E,S);let F=[],B=0,le,J=new Map;function V(L){L!==s()&&e.querySelectorAll(".design-inspector__bar:not(.design-token-bar) .design-inspector__compare button")[L?0:1]?.click(),l.sync(),oe()}function oe(){let L=l.size;h.textContent=L?`${L} change${L>1?"s":""}`:"",x.toggleAttribute("data-changes",L>0||l.canUndo),_.disabled=!l.canUndo,T.disabled=H.disabled=!L,m.hidden=!a||!L&&!s(),b.forEach((Q,Z)=>Q.setAttribute("aria-pressed",String(!Z===s()))),L?e.dataset.tokenEdits=String(L):delete e.dataset.tokenEdits,xe?.()}function ue(){for(let L of J.values())L();oe()}let q=L=>{let Q=F.find(Z=>Z.path===L);return Q?n.tokenLabel(Q):L};function Y(L,Q){let Z=xu(t.design),ae=l.get(L.path,Z),we=L.alias?`{${L.alias}}`:L.value,Te=(j,X)=>({path:L.path,value:j,from:we,to:X?`{${X}}`:j,...Z?{theme:Z}:{},...X?{alias:X}:{}}),$=j=>{l.set(j)&&ue()},D=L.alias?F.filter(j=>j.type===L.type&&j.path!==L.path&&j.alias!==L.path):[];n.openTokenPicker({trigger:Q,tokens:D,property:gG(L),title:n.tokenLabel(L),current:ae?ae.alias:L.alias,onPreview:j=>l.preview(Te(j.value,j.path)),onSelect:j=>$(Te(j.value,j.path)),custom:{value:ae?.value??L.value,onPreview:j=>l.preview(Te(j)),onSelect:j=>$(Te(j))}},!0)}let W=new Map;function C(L){let Q=()=>W.get(L.path)??L,Z=Nn("div","design-token-row"),ae=Nn("button");ae.type="button",ae.setAttribute("aria-haspopup","dialog");let we=Nn("b","",n.tokenLabel(L)),Te=Nn("i"),$=Nn("button");$.type="button",$.title="Reset to page value",$.setAttribute("aria-label",`Reset ${L.path}`),$.innerHTML=tN,Z.append(ae,$);let D=()=>{let j=Q();we.textContent=n.tokenLabel(j);let X=l.get(j.path,xu(t.design)),fe=X?X.alias:j.alias,ye=X?.value??j.value;Te.textContent=fe?q(fe):ye,ae.replaceChildren(n.tokenPreview({...j,value:ye}),we,Te),ae.dataset.tip=[j.path,j.ref,fe?`${fe} \xB7 ${ye}`:ye,j.description].filter(Boolean).join(" \xB7 "),ae.setAttribute("aria-label",`${we.textContent}, ${Te.textContent}${X?", edited":""}`),Z.toggleAttribute("data-changed",!!X),$.disabled=!X};return ae.addEventListener("click",()=>Y(Q(),ae)),$.addEventListener("click",()=>{V(!1),l.reset(L.path,xu(t.design)),ue(),ae.focus({preventScroll:!0})}),J.set(L.path,D),D(),Z}let U="";function I(){for(let Te of F)W.set(Te.path,Te);let L=g.value.toLowerCase().split(/\s+/).filter(Boolean),Q=new Map([["",[]]]);for(let Te of F){let $=l.get(Te.path,xu(t.design))?.to??Te.value,D=`${n.tokenLabel(Te)} ${Te.path} ${Te.ref??""} ${$}`.toLowerCase();if(!L.every(X=>D.includes(X)))continue;let j=Te.group??"";Q.set(j,[...Q.get(j)??[],Te])}let Z=JSON.stringify([...Q].map(([Te,$])=>[Te,$.map(D=>D.path)]));if(Z===U&&J.size)return ue();U=Z,J.clear(),y.replaceChildren();let ae=0;for(let[Te,$]of Q){if(!$.length)continue;let D=y;if(Te){D=Nn("div"),D.setAttribute("role","group");let j=Nn("small","",Te);j.id=`design-token-group-${++ae}`,D.setAttribute("aria-labelledby",j.id),D.append(j),y.append(D)}for(let j of $)D.append(C(j))}J.size||y.append(Nn("p","",L.length?"No matching tokens":"No tokens"));let we=e.querySelector(".design-inspector__identity small");we&&(we.textContent=`${F.length} token${F.length===1?"":"s"}`),oe()}async function G(){let L=++B,Q=[];try{Q=await o.listTokens(r,o.themeState(t.design))}catch{E.textContent="Tokens unavailable \xB7 try again"}l.sync(),!(L!==B||!u.isConnected)&&(F=Q,I())}function te(){le?.abort(),le=void 0,e.removeAttribute("data-tokens"),x.remove()}let ie=new AbortController;new MutationObserver((L,Q)=>{if(e.getAttribute("aria-hidden")==="true"&&o.restoreThemes(e),e.isConnected)return l.sync(),oe();Q.disconnect(),ie.abort(),te(),l.stop(),xe?.(),c.remove(),y2.delete(e)}).observe(e,{attributes:!0,attributeFilter:["data-before","aria-hidden"]}),t.root.addEventListener("palette-theme-change",()=>l.sync(),{signal:ie.signal}),g.addEventListener("input",I);let pe={open(){let L=e.querySelector(".design-inspector__controls");if(L){if(!u.isConnected){le=new AbortController;let{signal:Q}=le;e.toggleAttribute("data-tokens",!0),L.replaceChildren(u),e.append(x);let Z=e.querySelector(".design-inspector__target");Z&&(Z.textContent="Tokens");let ae=new MutationObserver(()=>{u.isConnected||te()});ae.observe(L,{childList:!0}),Q.addEventListener("abort",()=>ae.disconnect(),{once:!0}),o.attachThemeSwitcher(u,t.design,()=>{G()},t.root,Q),t.root.addEventListener("palette-theme-change",()=>{G()},{signal:Q});let we=!1,Te=X=>{we||i.footerTips(x,t.root,Q,X),we=!0};x.addEventListener("pointerover",Te,{signal:Q}),x.addEventListener("focusin",Te,{signal:Q});let $=!1,D=X=>{$||i.footerTips(y,t.root,Q,X,v),$=!0};y.addEventListener("pointerover",D,{signal:Q}),y.addEventListener("focusin",D,{signal:Q});let j=X=>{let fe=X.key.toLowerCase(),ye=X.composedPath()[0];m.hidden||X.metaKey||X.ctrlKey||X.altKey||!["b","arrowleft","arrowright"].includes(fe)||br(ye)||fe!=="b"&&ye.matches?.("input,select,[role=slider],[role=radio]")||(X.preventDefault(),X.stopImmediatePropagation(),V(fe==="b"?!s():fe==="arrowleft"))};document.addEventListener("keydown",j,{capture:!0,signal:Q}),so("keydown",j,{capture:!0,signal:Q}),I(),G()}globalThis.matchMedia?.("(pointer:coarse)")?.matches||g.focus({preventScroll:!0})}}},xe=t.link?.({get size(){return l.size},get steps(){return l.steps},undo(){l.undo(),ue()},redo(){l.redo(),ue()},reset:z,proposal:R,open:pe.open});return pe}var v0,eN,mG,gG,hG,iN,tN,bG,y2,aN=O(()=>{"use strict";It();ho();v0=(e,t)=>`${t??""} ${e}`,eN=e=>e.replace(/→/g,"->").replace(/\s+/g," ").trim()||"(unset)";mG={color:"color",dimension:"width",fontFamily:"font-family",fontWeight:"font-weight",lineHeight:"line-height",letterSpacing:"letter-spacing",shadow:"box-shadow",typography:"font",duration:"transition-duration"},gG=e=>e.properties?.[0]??mG[e.type]??"--token",hG=".design-inspector[data-tokens] .design-inspector__identity{visibility:visible}.design-inspector[data-tokens] .design-inspector__controls{display:flex;flex-direction:column;place-items:stretch;overflow:hidden}.design-inspector[data-tokens] .design-inspector__parent{display:none}.design-inspector[data-tokens]>.design-inspector__bar:not(.design-token-bar),.design-inspector[data-tokens] .design-inspector__pending,.design-inspector:not([data-tokens])>.design-token-bar{display:none}.design-token-page{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;height:min(520px,calc(100dvh - 190px))}:host([data-sidebar=background]) .design-token-page{height:auto}.design-token-page>.palette-tokens__bar{flex:none;padding:0 12px 8px;background:none;border:0}.design-token-page>p{margin:0 12px 8px;color:#e7c27d;font-size:11px}.design-token-page>p[hidden]{display:none}.design-token-page__list{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:0 8px 8px}.design-token-page__list small{position:sticky;top:0;z-index:1;display:block;padding:8px 8px 4px;background:#0d0d0d;color:#77736f;font-size:10px;font-weight:500}.design-token-page__list>p{margin:0;padding:12px 8px;color:#77736f}.design-token-row{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 24px;align-items:center;gap:2px;border-radius:7px}.design-token-row:hover{background:#ffffff0a}.design-token-row>button{border:0;background:none;color:inherit;font:inherit}.design-token-row>button:first-child{display:grid;grid-template-columns:20px minmax(0,1fr) auto;align-items:center;gap:8px;min-width:0;min-height:32px;padding:6px 8px;border-radius:7px;color:#d9d6d1;text-align:left}.design-token-row b{overflow:hidden;font-weight:500;text-overflow:ellipsis;white-space:nowrap}.design-token-row i{max-width:110px;overflow:hidden;color:#77736f;font-style:normal;font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap}.design-token-row[data-changed] b{color:#e6dcfb}.design-token-row[data-changed]::before{content:'';position:absolute;top:calc(50% - 2px);left:-2px;width:4px;height:4px;border-radius:50%;background:#bda6ef}.design-token-row>button+button{display:grid;place-items:center;width:24px;height:24px;padding:0;border-radius:5px;color:#77736f}.design-token-row>button+button:disabled{visibility:hidden}.design-token-row>button+button:hover{background:#ffffff14;color:#f1efeb}.design-token-row svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}.design-token-row .palette-tokens{font-size:11px}@media (pointer:coarse){.design-token-row>button:first-child{min-height:44px}.design-token-row>button+button{width:32px;height:32px}}",iN=e=>`<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="${e}"/></svg>`,tN=iN("M2.5 2.5v3h3M3 5.5a5.5 5.5 0 1 1-.5 2.5"),bG=iN("M5.5 3.5 2.5 6.5l3 3m-3-3h7a4 4 0 0 1 0 8h-2"),y2=new WeakMap});var x2={};Ft(x2,{changeKind:()=>lN,changeRow:()=>S0,cssSelector:()=>la,cssText:()=>EG,designKeyboard:()=>YO,designProposal:()=>kG,footerTips:()=>cN,keepFocus:()=>XO,selectionViews:()=>wG,watchDesignStatus:()=>SG});function lN(e=""){let t=[...e.matchAll(/^Proposed (.+?) changes? \(preview only\)$/gm)].map(([,n])=>vG[n]);return t.includes("geometry")?"geometry":t.find(Boolean)??"style"}function S0(e,t,n,o){e.innerHTML=E0(sN[t]??sN.style),e.dataset.kind=t,e.append(w("span","",n),w("small","",String(o))),e.setAttribute("aria-label",`${n} \xB7 ${k0(o)}`)}function wG(e){let t=w("div","design-inspector__empty");t.append(yt("design"),w("strong","","Select an element"),w("p","","Click to inspect \xB7 Double-click text to edit"));let n=(J,V,oe="")=>{let ue=w("button",oe,J);return ue.type="button",ue.addEventListener("click",V),ue},o=(J,V,oe=V)=>(J.setAttribute("aria-label",V),J.dataset.tip=oe,J),i=w("section","design-inspector__pending design-card");i.setAttribute("aria-label","Unsaved changes"),i.hidden=!0;let r=w("div","design-card-head"),a=w("div","design-card-label"),s=w("h3","design-card-title");a.append(s,w("p","design-card-target","Preview only. Nothing is saved until you comment or copy.")),r.append(a);let l=w("div","design-rows design-pending__list"),c=w("div","design-pending__actions");i.append(r,l,c);let u=J=>e.mode?.root.dispatchEvent(new CustomEvent("palette-announce",{detail:J})),d=[],p=[],g=0,y=0,v=()=>[...d.map(J=>J.proposal),S?.proposal()].filter(Boolean).join(`
354
+ `)}function fG(e){return e.map(({path:t,theme:n,from:o,to:i})=>({kind:"token-value",path:t,...n?{theme:n}:{},from:o,to:i}))}async function yG(e,t){let n=await Promise.all([Promise.resolve().then(()=>(o2(),n2)),Promise.resolve().then(()=>(x0(),y0)),Promise.resolve().then(()=>(w0(),x2))]),o=y2.get(e);o||y2.set(e,o=xG(e,t,n)),o.open()}function Nn(e,t="",n){let o=document.createElement(e);return o.className=t,n!==void 0&&(o.textContent=n),o}function xG(e,t,[n,o,i]){let r=t.design?.tokens??o.cssVariableTokens(),a=typeof r.previewValues=="function",s=()=>e.hasAttribute("data-before"),l=nN(r,{before:s,theme:()=>xu(t.design)}),c=Nn("style");c.textContent=hG,t.root.append(c),n.stylePicker(e);let u=Nn("section","design-token-page");u.setAttribute("aria-label","Tokens");let d=Nn("p","","No live preview \xB7 edits are recorded as proposals");d.hidden=a;let p=Nn("div","palette-tokens__bar"),g=Nn("input");g.type="search",g.placeholder="Search tokens",g.autocomplete="off",g.spellcheck=!1,g.setAttribute("aria-label","Search tokens"),p.append(g);let y=Nn("div","design-token-page__list");u.append(d,p,y);let v=(L,Q)=>{let Z=Q.getBoundingClientRect(),se=e.getBoundingClientRect();se.left-16>L.offsetWidth?(L.style.left=`${se.left-8-L.offsetWidth/2}px`,L.style.top=`${Z.top+(Z.height-L.offsetHeight)/2}px`):se.top-16>L.offsetHeight&&(L.style.top=`${se.top-8-L.offsetHeight}px`)},x=Nn("div","design-inspector__bar design-token-bar"),h=Nn("span","design-inspector__count"),m=Nn("div","design-inspector__compare");m.setAttribute("role","group"),m.setAttribute("aria-label","Compare with the page");let b=["Before","After"].map((L,Q)=>{let Z=Nn("button","",L);return Z.type="button",Z.dataset.tip=`${L} \xB7 ${Q?"\u2192":"\u2190"} or B`,Z.addEventListener("click",()=>V(!Q)),m.append(Z),Z}),E=Nn("p","design-inspector__status");E.setAttribute("role","status");let S=Nn("div","design-inspector__actions"),A=(L,Q,Z)=>{let se=Nn("button","design-inspector__tool");return se.type="button",se.dataset.tip=L,se.setAttribute("aria-label",L),se.innerHTML=Q,se.addEventListener("click",()=>{V(!1),Z(),ue()}),se},_=A("Undo",bG,()=>l.undo()),T=A("Reset all",tN,()=>l.resetAll()),H=Nn("button","","Comment");H.type="button";let R=()=>oN(l.list(),r.id),z=()=>{l.resetAll(),ue()};H.addEventListener("click",()=>{let L=R();L&&(z(),t.onComment(ko().document.body,L))}),S.append(_,T,H),x.append(h,m,E,S);let F=[],B=0,le,J=new Map;function V(L){L!==s()&&e.querySelectorAll(".design-inspector__bar:not(.design-token-bar) .design-inspector__compare button")[L?0:1]?.click(),l.sync(),oe()}function oe(){let L=l.size;h.textContent=L?`${L} change${L>1?"s":""}`:"",x.toggleAttribute("data-changes",L>0||l.canUndo),_.disabled=!l.canUndo,T.disabled=H.disabled=!L,m.hidden=!a||!L&&!s(),b.forEach((Q,Z)=>Q.setAttribute("aria-pressed",String(!Z===s()))),L?e.dataset.tokenEdits=String(L):delete e.dataset.tokenEdits,xe?.()}function ue(){for(let L of J.values())L();oe()}let q=L=>{let Q=F.find(Z=>Z.path===L);return Q?n.tokenLabel(Q):L};function Y(L,Q){let Z=xu(t.design),se=l.get(L.path,Z),we=L.alias?`{${L.alias}}`:L.value,Te=(j,X)=>({path:L.path,value:j,from:we,to:X?`{${X}}`:j,...Z?{theme:Z}:{},...X?{alias:X}:{}}),$=j=>{l.set(j)&&ue()},D=L.alias?F.filter(j=>j.type===L.type&&j.path!==L.path&&j.alias!==L.path):[];n.openTokenPicker({trigger:Q,tokens:D,property:gG(L),title:n.tokenLabel(L),current:se?se.alias:L.alias,onPreview:j=>l.preview(Te(j.value,j.path)),onSelect:j=>$(Te(j.value,j.path)),custom:{value:se?.value??L.value,onPreview:j=>l.preview(Te(j)),onSelect:j=>$(Te(j))}},!0)}let W=new Map;function C(L){let Q=()=>W.get(L.path)??L,Z=Nn("div","design-token-row"),se=Nn("button");se.type="button",se.setAttribute("aria-haspopup","dialog");let we=Nn("b","",n.tokenLabel(L)),Te=Nn("i"),$=Nn("button");$.type="button",$.title="Reset to page value",$.setAttribute("aria-label",`Reset ${L.path}`),$.innerHTML=tN,Z.append(se,$);let D=()=>{let j=Q();we.textContent=n.tokenLabel(j);let X=l.get(j.path,xu(t.design)),fe=X?X.alias:j.alias,ye=X?.value??j.value;Te.textContent=fe?q(fe):ye,se.replaceChildren(n.tokenPreview({...j,value:ye}),we,Te),se.dataset.tip=[j.path,j.ref,fe?`${fe} \xB7 ${ye}`:ye,j.description].filter(Boolean).join(" \xB7 "),se.setAttribute("aria-label",`${we.textContent}, ${Te.textContent}${X?", edited":""}`),Z.toggleAttribute("data-changed",!!X),$.disabled=!X};return se.addEventListener("click",()=>Y(Q(),se)),$.addEventListener("click",()=>{V(!1),l.reset(L.path,xu(t.design)),ue(),se.focus({preventScroll:!0})}),J.set(L.path,D),D(),Z}let U="";function I(){for(let Te of F)W.set(Te.path,Te);let L=g.value.toLowerCase().split(/\s+/).filter(Boolean),Q=new Map([["",[]]]);for(let Te of F){let $=l.get(Te.path,xu(t.design))?.to??Te.value,D=`${n.tokenLabel(Te)} ${Te.path} ${Te.ref??""} ${$}`.toLowerCase();if(!L.every(X=>D.includes(X)))continue;let j=Te.group??"";Q.set(j,[...Q.get(j)??[],Te])}let Z=JSON.stringify([...Q].map(([Te,$])=>[Te,$.map(D=>D.path)]));if(Z===U&&J.size)return ue();U=Z,J.clear(),y.replaceChildren();let se=0;for(let[Te,$]of Q){if(!$.length)continue;let D=y;if(Te){D=Nn("div"),D.setAttribute("role","group");let j=Nn("small","",Te);j.id=`design-token-group-${++se}`,D.setAttribute("aria-labelledby",j.id),D.append(j),y.append(D)}for(let j of $)D.append(C(j))}J.size||y.append(Nn("p","",L.length?"No matching tokens":"No tokens"));let we=e.querySelector(".design-inspector__identity small");we&&(we.textContent=`${F.length} token${F.length===1?"":"s"}`),oe()}async function G(){let L=++B,Q=[];try{Q=await o.listTokens(r,o.themeState(t.design))}catch{E.textContent="Tokens unavailable \xB7 try again"}l.sync(),!(L!==B||!u.isConnected)&&(F=Q,I())}function te(){le?.abort(),le=void 0,e.removeAttribute("data-tokens"),x.remove()}let ie=new AbortController;new MutationObserver((L,Q)=>{if(e.getAttribute("aria-hidden")==="true"&&o.restoreThemes(e),e.isConnected)return l.sync(),oe();Q.disconnect(),ie.abort(),te(),l.stop(),xe?.(),c.remove(),y2.delete(e)}).observe(e,{attributes:!0,attributeFilter:["data-before","aria-hidden"]}),t.root.addEventListener("palette-theme-change",()=>l.sync(),{signal:ie.signal}),g.addEventListener("input",I);let pe={open(){let L=e.querySelector(".design-inspector__controls");if(L){if(!u.isConnected){le=new AbortController;let{signal:Q}=le;e.toggleAttribute("data-tokens",!0),L.replaceChildren(u),e.append(x);let Z=e.querySelector(".design-inspector__target");Z&&(Z.textContent="Tokens");let se=new MutationObserver(()=>{u.isConnected||te()});se.observe(L,{childList:!0}),Q.addEventListener("abort",()=>se.disconnect(),{once:!0}),o.attachThemeSwitcher(u,t.design,()=>{G()},t.root,Q),t.root.addEventListener("palette-theme-change",()=>{G()},{signal:Q});let we=!1,Te=X=>{we||i.footerTips(x,t.root,Q,X),we=!0};x.addEventListener("pointerover",Te,{signal:Q}),x.addEventListener("focusin",Te,{signal:Q});let $=!1,D=X=>{$||i.footerTips(y,t.root,Q,X,v),$=!0};y.addEventListener("pointerover",D,{signal:Q}),y.addEventListener("focusin",D,{signal:Q});let j=X=>{let fe=X.key.toLowerCase(),ye=X.composedPath()[0];m.hidden||X.metaKey||X.ctrlKey||X.altKey||!["b","arrowleft","arrowright"].includes(fe)||br(ye)||fe!=="b"&&ye.matches?.("input,select,[role=slider],[role=radio]")||(X.preventDefault(),X.stopImmediatePropagation(),V(fe==="b"?!s():fe==="arrowleft"))};document.addEventListener("keydown",j,{capture:!0,signal:Q}),so("keydown",j,{capture:!0,signal:Q}),I(),G()}globalThis.matchMedia?.("(pointer:coarse)")?.matches||g.focus({preventScroll:!0})}}},xe=t.link?.({get size(){return l.size},get steps(){return l.steps},undo(){l.undo(),ue()},redo(){l.redo(),ue()},reset:z,proposal:R,open:pe.open});return pe}var v0,eN,mG,gG,hG,iN,tN,bG,y2,aN=O(()=>{"use strict";It();ho();v0=(e,t)=>`${t??""} ${e}`,eN=e=>e.replace(/→/g,"->").replace(/\s+/g," ").trim()||"(unset)";mG={color:"color",dimension:"width",fontFamily:"font-family",fontWeight:"font-weight",lineHeight:"line-height",letterSpacing:"letter-spacing",shadow:"box-shadow",typography:"font",duration:"transition-duration"},gG=e=>e.properties?.[0]??mG[e.type]??"--token",hG=".design-inspector[data-tokens] .design-inspector__identity{visibility:visible}.design-inspector[data-tokens] .design-inspector__controls{display:flex;flex-direction:column;place-items:stretch;overflow:hidden}.design-inspector[data-tokens] .design-inspector__parent{display:none}.design-inspector[data-tokens]>.design-inspector__bar:not(.design-token-bar),.design-inspector[data-tokens] .design-inspector__pending,.design-inspector:not([data-tokens])>.design-token-bar{display:none}.design-token-page{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;height:min(520px,calc(100dvh - 190px))}:host([data-sidebar=background]) .design-token-page{height:auto}.design-token-page>.palette-tokens__bar{flex:none;padding:0 12px 8px;background:none;border:0}.design-token-page>p{margin:0 12px 8px;color:#e7c27d;font-size:11px}.design-token-page>p[hidden]{display:none}.design-token-page__list{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:0 8px 8px}.design-token-page__list small{position:sticky;top:0;z-index:1;display:block;padding:8px 8px 4px;background:#0d0d0d;color:#77736f;font-size:10px;font-weight:500}.design-token-page__list>p{margin:0;padding:12px 8px;color:#77736f}.design-token-row{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 24px;align-items:center;gap:2px;border-radius:7px}.design-token-row:hover{background:#ffffff0a}.design-token-row>button{border:0;background:none;color:inherit;font:inherit}.design-token-row>button:first-child{display:grid;grid-template-columns:20px minmax(0,1fr) auto;align-items:center;gap:8px;min-width:0;min-height:32px;padding:6px 8px;border-radius:7px;color:#d9d6d1;text-align:left}.design-token-row b{overflow:hidden;font-weight:500;text-overflow:ellipsis;white-space:nowrap}.design-token-row i{max-width:110px;overflow:hidden;color:#77736f;font-style:normal;font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap}.design-token-row[data-changed] b{color:#e6dcfb}.design-token-row[data-changed]::before{content:'';position:absolute;top:calc(50% - 2px);left:-2px;width:4px;height:4px;border-radius:50%;background:#bda6ef}.design-token-row>button+button{display:grid;place-items:center;width:24px;height:24px;padding:0;border-radius:5px;color:#77736f}.design-token-row>button+button:disabled{visibility:hidden}.design-token-row>button+button:hover{background:#ffffff14;color:#f1efeb}.design-token-row svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}.design-token-row .palette-tokens{font-size:11px}@media (pointer:coarse){.design-token-row>button:first-child{min-height:44px}.design-token-row>button+button{width:32px;height:32px}}",iN=e=>`<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="${e}"/></svg>`,tN=iN("M2.5 2.5v3h3M3 5.5a5.5 5.5 0 1 1-.5 2.5"),bG=iN("M5.5 3.5 2.5 6.5l3 3m-3-3h7a4 4 0 0 1 0 8h-2"),y2=new WeakMap});var x2={};Ft(x2,{changeKind:()=>lN,changeRow:()=>S0,cssSelector:()=>la,cssText:()=>EG,designKeyboard:()=>YO,designProposal:()=>kG,footerTips:()=>cN,keepFocus:()=>XO,selectionViews:()=>wG,watchDesignStatus:()=>SG});function lN(e=""){let t=[...e.matchAll(/^Proposed (.+?) changes? \(preview only\)$/gm)].map(([,n])=>vG[n]);return t.includes("geometry")?"geometry":t.find(Boolean)??"style"}function S0(e,t,n,o){e.innerHTML=E0(sN[t]??sN.style),e.dataset.kind=t,e.append(w("span","",n),w("small","",String(o))),e.setAttribute("aria-label",`${n} \xB7 ${k0(o)}`)}function wG(e){let t=w("div","design-inspector__empty");t.append(yt("design"),w("strong","","Select an element"),w("p","","Click to inspect \xB7 Double-click text to edit"));let n=(J,V,oe="")=>{let ue=w("button",oe,J);return ue.type="button",ue.addEventListener("click",V),ue},o=(J,V,oe=V)=>(J.setAttribute("aria-label",V),J.dataset.tip=oe,J),i=w("section","design-inspector__pending design-card");i.setAttribute("aria-label","Unsaved changes"),i.hidden=!0;let r=w("div","design-card-head"),a=w("div","design-card-label"),s=w("h3","design-card-title");a.append(s,w("p","design-card-target","Preview only. Nothing is saved until you comment or copy.")),r.append(a);let l=w("div","design-rows design-pending__list"),c=w("div","design-pending__actions");i.append(r,l,c);let u=J=>e.mode?.root.dispatchEvent(new CustomEvent("palette-announce",{detail:J})),d=[],p=[],g=0,y=0,v=()=>[...d.map(J=>J.proposal),S?.proposal()].filter(Boolean).join(`
355
355
 
356
356
  `),x=o(n("",async()=>{try{await navigator.clipboard.writeText(v()),e.message("Changes copied")}catch{e.message("Couldn't copy changes. Try again.")}}),"Copy changes");x.append(yt("copy")),c.append(n("Comment with changes",()=>{let J=v(),[V]=d,oe=d.length===1&&!S?.size&&V.here?V.element:Xn().body;e.reset(),e.mode?.onComment(oe,J||void 0)}),x,o(n("Discard all",()=>{m(),e.mode?.root.querySelector(".design-inspector__target")?.focus({preventScroll:!0})}),"Discard all",`Undo \xB7 ${po()?"\u2318Z":"Ctrl+Z"}`));let h=J=>{i.removeEventListener("pointerover",h),i.removeEventListener("focusin",h),e.mode&&e.signal&&cN(i,e.mode.root,e.signal,J)};i.addEventListener("pointerover",h),i.addEventListener("focusin",h);function m(){y=g,e.before(!0),u(`${k0(y)} discarded`)}let b=()=>{y&&(y=0,e.reset())},E=()=>e.mode?.root.querySelector(".design-inspector"),S,{history:A=[]}=e,_=()=>{let J=new Set(S?.steps);for(let V=A.length;V--;)A[V].kind==="token"&&!J.delete(A[V].step)&&A.splice(V,1);for(let V of J)A.push({kind:"token",step:V});e.update?.()},T=e.mode&&{...e.mode,link(J){return S=J,_}},H=n("Edit tokens",()=>{b();let J=E();J&&T&&Promise.resolve().then(()=>(aN(),rN)).then(V=>V.openTokenPage(J,T),()=>e.message("Tokens unavailable \xB7 try again"))},"design-inspector__tokens"),R=n("Keyboard shortcuts",()=>e.help?.(),"design-inspector__help");R.setAttribute("aria-label","Keyboard shortcuts"),R.setAttribute("aria-keyshortcuts","?"),R.append(Qd(["?"],"?")),R.hidden=!e.help,t.append(H,R);let z=()=>{e.clear?.(),S?.open()},F=n("",z,"design-change-row"),B=n("",z,"design-change-row design-inspector__token-chip");B.title="Open the Tokens view",B.hidden=!0;function le(J){e.peek(null),l.replaceChildren(...d.map(V=>{let oe=n("",()=>{V.here&&(e.peek(null),V.element.scrollIntoView?.({block:"nearest",inline:"nearest"}),e.select(V.element))},"design-change-row"),ue=/^Component: (.+?)(?: \(.*\))?$/m.exec(V.proposal??"")?.[1];if(S0(oe,lN(V.proposal),ue||oc(V.element),V.count),!V.here)oe.setAttribute("aria-disabled","true"),oe.dataset.tip="On another page";else for(let[q,Y]of[["pointerenter",V.element],["pointerleave",null],["focus",V.element],["blur",null]])oe.addEventListener(q,()=>e.peek(Y));return oe})),J&&(S0(F,"token","Token changes",J),l.append(F))}return{empty:t,pending:i,chip:B,get tokens(){return S},get parked(){return y>0},settle:b,discard:m,restore(){return y?(u(`${k0(y)} restored`),y=0,e.before(!1),!0):!1},icons:{undo:E0("M5.5 3.5 2.5 6.5l3 3m-3-3h7a4 4 0 0 1 0 8h-2"),redo:E0("M10.5 3.5 13.5 6.5l-3 3m3-3h-7a4 4 0 0 0 0 8h2"),reset:E0("M2.5 2.5v3h3M3 5.5a5.5 5.5 0 1 1-.5 2.5")},styles:'@keyframes design-status{from{opacity:0;translate:0 2px}}.design-inspector__count{white-space:nowrap;font-variant-numeric:tabular-nums}.design-inspector__status{display:none;min-width:0;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;animation:design-status .2s var(--ease-smooth-out)}.design-inspector__bar[data-message] .design-inspector__status{display:block}.design-inspector__bar[data-message] .design-inspector__count,.design-inspector__bar:not([data-changes]) .design-inspector__tool{display:none}.design-inspector__compare { display:inline-flex; flex:none; padding:2px; border-radius:7px; background:#ffffff0a; }.design-inspector__compare[hidden],.design-inspector__bar[data-message] .design-inspector__compare { display:none; }.design-inspector__compare button { height:22px; padding:0 8px; border-radius:5px; color:#9a9a9a; font:inherit; font-size:11px; }.design-inspector__compare button:hover { color:#fff; }.design-inspector__compare button[aria-pressed="true"] { color:#fff; background:#ffffff1a; }.design-inspector__empty { display:flex; flex-direction:column; align-items:center; gap:4px; padding:0 24px 28px; color:#898680; font-size:11px; text-align:center; }.design-inspector__empty > svg { box-sizing:content-box; width:20px; height:20px; margin-bottom:8px; padding:8px; border-radius:10px; background:#ffffff0a; color:#77736f; }.design-inspector__empty strong { color:#e9e6e1; font-size:12px; font-weight:600; }.design-inspector__empty p { margin:2px 0 0; line-height:1.5; }.design-inspector__pick-hint{flex:none;margin:0 12px 10px;color:#989898;font-size:10px;line-height:1.5}.design-inspector__pending{margin:0 12px 12px;min-width:0;border-radius:10px;background:#ffffff08;box-shadow:inset 0 0 0 1px #ffffff0d;font-size:12px;animation:design-status .2s var(--ease-smooth-out)}.design-inspector__pending[hidden]{display:none}.design-inspector__pending .design-card-head{display:flex;min-width:0;padding:10px 12px}.design-inspector__pending .design-card-label{display:grid;flex:1;min-width:0;gap:2px}.design-inspector__pending .design-card-title{margin:0;overflow:hidden;color:#eee;font-size:12px;font-weight:600;font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap}.design-inspector__pending .design-card-target{margin:0;color:#8a8a8a;font-size:11px;line-height:1.45}.design-pending__list{display:flex;flex-direction:column;max-height:168px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;border-top:1px solid #ffffff0a}.design-pending__list .design-change-row{padding:0 12px;border-radius:0}.design-pending__list .design-change-row+.design-change-row{border-top:1px solid #ffffff06}.design-change-row{display:grid;grid-template-columns:12px minmax(0,1fr) auto;align-items:center;gap:8px;flex:none;box-sizing:border-box;height:28px;padding:0 8px;border-radius:6px;color:#ddd;font:inherit;font-size:12px;text-align:left}.design-change-row:hover:not([aria-disabled]){background:#ffffff0a;color:#fff}.design-change-row:focus-visible{outline:1px solid #bda6ef;outline-offset:-1px}.design-change-row[aria-disabled]{opacity:.5;cursor:default}.design-change-row svg{width:12px;height:12px;color:#8a8a8a}.design-change-row[data-kind=token] svg{color:var(--accent,#bda6ef)}.design-change-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.design-change-row small{color:#8a8a8a;font-size:11px;font-variant-numeric:tabular-nums}.design-pending__actions{display:flex;align-items:center;gap:4px;padding:8px 8px 8px 12px;border-top:1px solid #ffffff0a}.design-pending__actions button{display:grid;place-items:center;min-width:28px;height:28px;padding:0 8px;border-radius:7px;color:#9a9a9a;font:inherit;font-size:12px}.design-pending__actions button:hover{background:#ffffff0f;color:#fff}.design-pending__actions button:first-child{padding:0 12px;background:var(--accent,#bda6ef);color:#211b2d;font-weight:500}.design-pending__actions button:first-child:hover{background:var(--accent,#bda6ef);color:#211b2d;filter:brightness(1.08)}.design-pending__actions button:last-child{margin-left:auto}.design-pending__actions svg{width:16px;height:16px}.design-pending__actions button:focus-visible{outline:2px solid #bda6ef;outline-offset:1px}@media (prefers-reduced-motion:reduce){.design-inspector__pending{animation:none}}@media (pointer:coarse){.design-change-row,.design-pending__actions button{height:36px}}.design-inspector__tokens{margin-top:16px;min-height:34px;padding:0 14px;border-radius:8px;background:var(--accent,#bda6ef);color:#211b2d;font:inherit;font-size:12px;font-weight:500}.design-inspector__tokens:hover{filter:brightness(1.08)}.design-inspector__help{gap:6px;margin-top:8px;min-height:28px;padding:0 8px;border-radius:7px;color:#898680;font:inherit;font-size:11px}.design-inspector__tokens[hidden]+.design-inspector__help{margin-top:14px}.design-inspector__help:hover{background:#ffffff0a;color:#e9e6e1}.design-inspector__tokens[hidden],.design-inspector__help[hidden]{display:none}.design-inspector__token-chip{flex:none;align-self:flex-start;margin:0 12px 8px;background:#ffffff08;box-shadow:inset 0 0 0 1px #ffffff0d}.design-inspector__token-chip[hidden]{display:none}',update(J=!1){let V=y?0:S?.size??0;d=J||y?[]:e.items().reverse(),g=d.reduce((ue,q)=>ue+q.count,V),i.hidden=J||!!y||!g,s.textContent=`${g} unsaved change${g===1?"":"s"}`;let oe=[...d.flatMap(ue=>[ue.element,ue.count,ue.here,ue.proposal]),V];(oe.length!==p.length||oe.some((ue,q)=>ue!==p[q]))&&(p=oe,le(V)),H.hidden=!e.mode?.design?.tokens&&!Xn().querySelector("[data-palette-design-tokens],[data-komo-design-tokens]"),H.textContent=V?`Edit tokens \xB7 ${k0(V)}`:"Edit tokens",B.hidden=!J||!V,S0(B,"token","Token changes",V)}}}function la(e){let t=[];for(let n=e;n;n=n.parentElement){let o=n.id&&!/^radix-|^:r|_r_|«r/.test(n.id)?`#${CSS.escape(n.id)}`:"";if(o&&n.ownerDocument.querySelectorAll(o).length===1)return[o,...t].join(" > ");if(n===n.ownerDocument.body||!n.parentElement)return[n.tagName.toLowerCase(),...t].join(" > ");let i=n===e?[...n.classList].slice(0,2).map(a=>`.${CSS.escape(a)}`).join(""):"",r=[...n.parentElement.children].filter(a=>a.tagName===n.tagName).indexOf(n)+1;t.unshift(`${n.tagName.toLowerCase()}${i}:nth-of-type(${r})`)}return t.join(" > ")}function EG(e,t){return`${la(e)} {
357
357
  ${[...t].map(([n,o])=>` ${n}: ${o};`).join(`
@@ -368,15 +368,15 @@ Target: ${la(e)}
368
368
 
369
369
  `)||void 0}function cN(e,t,n,o,i){if(n.aborted)return;let r=w("div","morphing-menu__tooltip sidebar-tooltip");r.setAttribute("aria-hidden","true"),t.append(r);let a=0,s=()=>{clearTimeout(a),delete r.dataset.open},l=c=>{let u=c.target?.closest?.("[data-tip]");if(!u||c.type==="focusin"&&!u.matches(":focus-visible"))return s();clearTimeout(a),a=window.setTimeout(()=>{if(!u.isConnected)return;let d=u.getBoundingClientRect();r.textContent=u.dataset.tip??"";let p=r.offsetWidth/2;r.style.left=`${Math.max(8+p,Math.min(document.documentElement.clientWidth-8-p,d.left+d.width/2))}px`,r.style.top=`${d.top-8-r.offsetHeight}px`,i?.(r,u),r.dataset.open="true"},r.dataset.open?0:400)};e.addEventListener("pointerover",l,{signal:n}),e.addEventListener("focusin",l,{signal:n});for(let c of["pointerleave","pointerdown","focusout","scroll"])e.addEventListener(c,s,{signal:n});n.addEventListener("abort",()=>{s(),r.remove()}),(o.type==="focusin"||e.matches(":hover"))&&l(o)}function SG(e,t,n,o){let i=0,r=new MutationObserver(()=>{let a=e.textContent??"";e.title=a,t.toggleAttribute("data-message",!!a),clearTimeout(i),a&&(i=window.setTimeout(function s(){n()?i=window.setTimeout(s,2600):e.textContent=""},2600))});r.observe(e,{childList:!0,characterData:!0,subtree:!0}),o.addEventListener("abort",()=>{r.disconnect(),clearTimeout(i)},{once:!0})}var vG,E0,sN,k0,w0=O(()=>{"use strict";WO();ea();It();ho();ky();vG={style:"style","inline text":"text","design-token":"token",token:"token","React prop":"prop",geometry:"geometry"};E0=e=>`<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="${e}"/></svg>`,sN={style:"M8 2.5c2 2.4 4 4.6 4 6.8a4 4 0 0 1-8 0c0-2.2 2-4.4 4-6.8z",token:"M8 2.5 13.5 8 8 13.5 2.5 8z",text:"M3.5 4.5V3h9v1.5M8 3v10M6 13h4",prop:"M2.5 5h6m3 0h2m-11 6h2m3 0h6M10 3.5v3m-4 3v3",geometry:"M2.5 6V2.5H6m4 0h3.5V6m0 4v3.5H10m-4 0H2.5V10"},k0=e=>`${e} change${e===1?"":"s"}`});function uN(e,t,n){let o=t?e.nextElementSibling:e.previousElementSibling;for(;o&&(o===n||xm(o)||/^(none|contents)$/.test(hc(o)));)o=t?o.nextElementSibling:o.previousElementSibling;return o}function pN(e){let t=e.parentElement,n=Pt(e),o=bm(t,e).map(i=>Pt(i));if(!o.length){let i=getComputedStyle(t);return/flex/.test(i.display)&&i.flexDirection.startsWith("row")}return o.some(i=>i.top<n.bottom-1&&i.bottom>n.top+1)}function ym(e,t=e){let n=e?.parentElement;if(!e?.isConnected||!n)return"Select an element on the page.";let o=e.ownerDocument;if(e===o.body||n===o.body||n===o.documentElement)return"The page and app roots can't be moved.";if(Gu(e)&&e.ownerSVGElement)return"SVG shapes can't be moved. Select the SVG root.";if(e.matches("thead,tbody,tfoot,caption,colgroup,col"))return"Table sections can't be moved. Select the table.";for(let i=e;i&&i!==o.body;i=i.parentElement)if(hc(i)==="inline"&&i.localName!=="svg"&&!i.matches("img,video,canvas,iframe,embed,object,input,select,textarea,button")||i===n&&i.matches(AG))return"Inline text runs can't be moved. Select the paragraph or the block around them.";return!t||/^(none|contents)$/.test(hc(t))||!t.getClientRects().length?"This element has no box to move.":null}function T0(e,t,n){return e===t||t.contains(e)||xm(e)||e.closest(`[${v2}]`)||n.contains(e)?!1:t.matches("tr")?e===t.parentElement:t.matches("td,th")?e.matches("tr")&&e.closest("table")===t.closest("table"):mn(e)&&e!==e.ownerDocument.body&&e!==e.ownerDocument.documentElement&&!e.matches(TG)&&!/^(inline|contents|none)$/.test(hc(e))}function fN(e){let t=new Set,n=Xn(),o=new(n.defaultView??window).CSSStyleSheet;n.adoptedStyleSheets=[...n.adoptedStyleSheets,o];let i="",r,a=!1,s=null,l=0,c=C=>[...e.history].reverse().find(U=>U.element===C&&U.place),u=C=>!!C&&c(C.element)===C&&!e.before()&&C.element.isConnected,d=C=>{let U=c(C);return u(U)&&U.clone?.isConnected?U.clone:C},p=()=>t.forEach(C=>C.clone?.remove()),g=C=>nu(e.component(C)),y=C=>g(C)??oc(C),v=C=>g(C)??(C.matches("[role],[aria-label]")?oc(C):`${C.localName}${C.id?`#${C.id}`:C.classList[0]?`.${C.classList[0]}`:""}`),x=(C,U,I)=>{let G=nu(e.component(C));return{parent:la(C),label:v(C),index:U,...G?{component:G}:{},...I?{position:I}:{}}},h=(C,U,I)=>{let G=bm(C,I),te=U?G.findIndex(ie=>ie===U||!!(U.compareDocumentPosition(ie)&Node.DOCUMENT_POSITION_FOLLOWING)):-1;return te<0?G.length:te},m=(C,U)=>C.position==="inside"?`Into ${v(C.parent)} \xB7 position ${h(C.parent,C.before,U)+1}`:`${C.position==="before"?"Before":"After"} ${y(C.ref)}`;function b(C,U){let I=C.cloneNode(!0),G=[C,...C.querySelectorAll("*")];return[I,...I.querySelectorAll("*")].forEach((ie,pe)=>{ie.removeAttribute("id"),(!pe||G.length<400)&&E(ie,G[pe])}),I.style.display=U.display,I.setAttribute(v2,""),I.removeAttribute(nr),I.setAttribute("aria-hidden","true"),I.inert=!0,I}function E(C,U){let I=getComputedStyle(U),G=C.style;for(let te of I)G.setProperty(te,I.getPropertyValue(te));G.setProperty("transition","none"),G.setProperty("animation","none")}function S(){for(let G of t){let{element:te,place:ie}=G;if(e.history.includes(G)||t.delete(G),!u(G)||!ie){G.clone?.remove();continue}if(te.style.getPropertyValue("display")!=="none"&&te.style.setProperty("display","none",G.priority),!ie.parent.isConnected||ie.before&&ie.before.parentNode!==ie.parent){p(),ie.parent=n.querySelector(ie.selectors[0])??ie.parent;let L=ie.selectors[1]?n.querySelector(ie.selectors[1]):null;ie.before=L?.parentNode===ie.parent?L:null}if(!ie.parent.isConnected){G.clone?.remove();continue}let pe=`${te.getAttribute("style")}
370
370
  ${te.getAttribute("class")}
371
- ${te.innerHTML}`;G.sig!==pe&&(G.clone?.remove(),G.clone=void 0,G.sig=pe),G.clone??=b(te,G);let xe=G.clone.nextSibling;for(;Kn(xe)&&xm(xe);)xe=xe.nextSibling;(G.clone.parentNode!==ie.parent||xe!==ie.before)&&ie.parent.insertBefore(G.clone,ie.before)}let C=e.selected(),U=!a&&e.enabled()&&C&&d(C)===C&&!ym(C)&&la(C),I=a?"*{cursor:grabbing!important}":U?`${U},${U} *{cursor:move}`:"";I!==i&&o.replaceSync(i=I)}let A=new MutationObserver(()=>{t.size&&!l&&(l=requestAnimationFrame(()=>{l=0,S()}))});A.observe(n.documentElement,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class"]});function _(C,U){for(;U.before&&xm(U.before);)U.before=U.before.nextElementSibling;let I=c(C),G=I?.clone?.isConnected?I.clone:C;if(U.parent===G.parentElement&&(U.before===G||U.before===uN(G,!0)))return null;p();let te=C.parentElement,ie=I?.geometry[0].move.from??x(te,bm(te).indexOf(C)),pe={label:y(C),target:I?.geometry[0].move.target??la(C),from:ie,to:x(U.parent,h(U.parent,U.before,C),U.position)},xe=$n(C,"display"),L={element:C,display:I?.display??hc(C),priority:xe.priority,place:{parent:U.parent,before:U.before,selectors:[la(U.parent),U.before?la(U.before):null]},geometry:[{mode:"structure",layout:e.layout(C),move:pe,effects:[]}],undo(){ri(C,["display"],()=>xe.restore()),e.track(C,"display")},redo(){t.add(L),ri(C,["display"],()=>C.style.setProperty("display","none",xe.priority)),e.track(C,"display")}};t.add(L),e.history.push(L),e.remember(C,"display"),ri(C,["display"],()=>C.style.setProperty("display","none",xe.priority)),e.track(C,"display"),S(),e.update();try{localStorage.setItem("palette:geometry-moved","1")}catch{}return`Moved ${U.position==="inside"?`into ${v(U.parent)}`:`${U.position} ${y(U.ref)}`}`}function T(C,U,I){let G=e.targetAt(C,U);for(;G&&G!==G.ownerDocument.body&&(!G.parentElement||!T0(G.parentElement,I,e.host)||/^(inline|contents)$/.test(hc(G)));)G=G.parentElement;if(!G||G===G.ownerDocument.body||I.contains(G))return null;let te=Pt(G),ie=pN(G),[pe,xe,L]=ie?[te.left,te.width,C]:[te.top,te.height,U],Q=Math.min(12,xe/4);if(![...G.childNodes].some(we=>we.nodeType===Node.TEXT_NODE&&we.textContent.trim())&&T0(G,I,e.host)&&L>pe+Q&&L<pe+xe-Q){let we=bm(G,I).find(Te=>MG(Pt(Te),C,U))??null;return{parent:G,before:we,position:"inside",ref:null}}let ae=L>=pe+xe/2;return{parent:G.parentElement,before:ae?G.nextElementSibling:G,position:ae?"after":"before",ref:G}}function H(C,U,I){let G=c(C),te=u(G)&&G.clone?.isConnected?G.clone:C,ie=te.parentElement;if(I&&!U){let xe=ie.parentElement;return xe&&T0(xe,C,e.host)?{parent:xe,before:ie.nextElementSibling,position:"after",ref:ie}:null}let pe=uN(te,U&&!I,C);return I?pe&&T0(pe,C,e.host)?{parent:pe,before:null,position:"inside",ref:null}:null:pe?{parent:ie,before:U?pe.nextElementSibling:pe,position:U?"after":"before",ref:pe}:null}let R=document.createElement("div"),z=document.createElement("div"),F=document.createElement("div");R.className="design-geometry__line",z.className="design-geometry__drop",F.className="design-geometry__readout design-geometry__chip";for(let C of[R,z,F])C.hidden=!0;let B=C=>`${Math.round(C*100)/100}px`;function le(C,U,I,G){if(R.hidden=z.hidden=F.hidden=!C,!C)return;let te=(ae,we,Te,$,D)=>Object.assign(ae.style,{left:B(we),top:B(Te),width:B($),height:B(D)});z.hidden=C.position!=="inside";let ie=Pt(C.parent);te(z,ie.left,ie.top,ie.width,ie.height);let pe=bm(C.parent,U),xe=h(C.parent,C.before,U),[L,Q]=[pe[xe-1],pe[xe]].map(ae=>ae&&Pt(ae)),Z=pe[xe]??pe[xe-1];if(R.hidden=!Z,Z){let ae=Q??L;pN(Z)?te(R,Q?(L&&L.top<Q.bottom&&L.bottom>Q.top?(L.right+Q.left)/2:Q.left-2)-1:L.right+1,ae.top,2,ae.height):te(R,ae.left,Q?(L?(L.bottom+Q.top)/2:Q.top-2)-1:L.bottom+1,ae.width,2)}F.textContent=m(C,U),Object.assign(F.style,{left:B(I+14),top:B(G+18)})}function J(){r=void 0,s=null,a&&(a=!1,e.drag(null)),le(null,n.body,0,0),S()}let V={capture:!0,signal:e.signal},oe=C=>{let U=e.selected();if(C.button||C.metaKey||C.ctrlKey||!e.enabled()||!U||C.composedPath().includes(e.host)||ym(U,d(U)))return;let I=Pt(d(U)),G=Vi(C);G.x<I.left||G.x>I.right||G.y<I.top||G.y>I.bottom||(C.preventDefault(),C.stopImmediatePropagation(),r={...G,id:C.pointerId})},ue=C=>{let U=e.selected();if(!r||C.pointerId!==r.id||!U)return;let I=Vi(C),G=I.x-r.x,te=I.y-r.y;!a&&Math.hypot(G,te)<4||(C.stopImmediatePropagation(),a||(a=!0,S()),e.drag([G,te]),s=T(I.x,I.y,U),le(s,U,I.x,I.y))},q=C=>{let U=e.selected();if(!r||C.pointerId!==r.id)return;let I=a,G=s,te=Vi(C);if(J(),!I){U&&d(U)===U&&e.pick(te.x,te.y);return}C.stopImmediatePropagation();let ie=U&&G&&_(U,G);ie&&e.announce(ie)},Y=()=>r&&J(),W=C=>{!a||C.key!=="Escape"||(C.preventDefault(),C.stopImmediatePropagation(),J())};for(let[C,U]of[["pointerdown",oe],["pointermove",ue],["pointerup",q],["pointercancel",Y],["keydown",W]])window.addEventListener(C,U,V),so(C,U,V,"window");return e.signal.addEventListener("abort",()=>{A.disconnect(),cancelAnimationFrame(l),p(),n.adoptedStyleSheets=n.adoptedStyleSheets.filter(C=>C!==o)},{once:!0}),{nodes:[R,z,F],shown:d,sync:S,key(C,U,I){let G=ym(C,d(C)),te=G?null:H(C,U,I);e.announce(G??(te&&_(C,te))??(I?U?"No container before it to move into":"Can't move out of this parent":U?"Already last":"Already first"))},detach(){p(),l||(l=requestAnimationFrame(()=>{l=0,S()}))}}}function w2(e){let t=n=>`${n.parent} \xB7 index ${n.index}${n.position?` \xB7 ${n.position}`:""}${n.component?` \xB7 component ${n.component}`:""}`;return[`- Move ${e.label}: from ${e.from.label} (${dN(e.from.index+1)}) \u2192 ${e.to.label} (${dN(e.to.index+1)})`,`From: ${t(e.from)}`,`To: ${t(e.to)}`]}var v2,TG,AG,hc,xm,dN,bm,MG,mN=O(()=>{"use strict";w0();ky();Li();um();ho();v2="data-palette-move-clone",TG="p,h1,h2,h3,h4,h5,h6,a,button,label,select,option,textarea,input,img,video,audio,canvas,iframe,embed,object,svg,br,hr,pre,picture,table,thead,tbody,tfoot,tr,colgroup,col,caption,script,style,template,slot",AG="p,h1,h2,h3,h4,h5,h6,a,label,button,span,em,strong,b,i,small,code",hc=e=>getComputedStyle(e).display,xm=e=>e.hasAttribute(v2),dN=e=>`${e}${e%100>10&&e%100<14?"th":["th","st","nd","rd"][e%10]??"th"}`,bm=(e,t)=>[...e.children].filter(n=>n!==t&&!xm(n)&&!/^(none|contents)$/.test(hc(n))&&!n.matches("script,style,template"));MG=(e,t,n)=>e.top<n&&e.bottom>n?e.left+e.width/2>t:e.top+e.height/2>n});var wN={};Ft(wN,{WAIT:()=>wm,bindGeometry:()=>NG,eligibleAncestor:()=>T2,geometryProposal:()=>xN,geometryReason:()=>Em,spanFor:()=>A2});function _G(e){let t=e.assignedSlot??Sm(e);for(;t&&getComputedStyle(t).display==="contents";)t=t.assignedSlot??Sm(t);return t}function Em(e){if(!e?.isConnected)return"Select an element on the page.";let t=e.ownerDocument;if(e===t.body||e===t.documentElement)return"The page root can't be moved or resized.";if(Gu(e)&&!C0(e))return"SVG shapes can't be moved or resized. Select the SVG root.";if(!mn(e)&&!C0(e))return"Only HTML boxes and SVG roots can be moved or resized.";let o=getComputedStyle(e).display;if(o==="none")return"display: none has no box";if(o==="contents")return"display: contents has no box";if(o==="inline"&&!C0(e)&&!e.matches(`${yN},${CG}`))return"Inline text box can't be resized";if(o.startsWith("table-"))return"Table cells and rows size with their table. Select the table.";if(/ruby|math/.test(o))return`display: ${o} boxes can't be moved or resized.`;let i=e.getClientRects().length,r=Pt(e);if(!i||!r.width||!r.height)return"This element has no rendered box.";if(i>1)return"Boxes split across lines or columns can't be previewed.";for(let a=e;a&&a!==t.documentElement;a=Sm(a)){let s=getComputedStyle(a),l=s.transform&&s.transform!=="none"?new DOMMatrix(s.transform):null,c=!s.scale||s.scale==="none"?[1]:s.scale.split(/\s+/).map(Number);if(s.rotate&&s.rotate!=="none"||l&&(!l.is2D||l.b||l.c||l.a<=0||l.d<=0)||c.length>2||c.some(u=>!(u>0)))return"Rotated, skewed, 3D or mirrored boxes can't be previewed.";if(!a.closest(`[${nr}]`)&&a.getAnimations?.().some(u=>u.playState==="running"&&u.effect?.getKeyframes?.().some(d=>Object.keys(d).some(p=>/^(transform|translate|scale|rotate|inset|left|top|right|bottom|flex|grid)|(width|height)$/i.test(p)))))return wm}return null}function T2(e){for(let t=Sm(e);t&&t!==e.ownerDocument.body&&t!==e.ownerDocument.documentElement;t=Sm(t))if(!Em(t))return t;return null}function E2(e){let n=getComputedStyle(e).position,o=_G(e),i=o?getComputedStyle(o):void 0,a=n==="absolute"||n==="fixed"?"":i?.display??"",s=n==="static"?"":`, position: ${n}`;if(/flex/.test(a)){let l=i.flexDirection.startsWith("row")===!i.writingMode.startsWith("vertical");return{kind:"flex",row:l,parent:o,parentStyle:i,position:n,label:`flex item, ${l?"row":"column"}${s}`}}return/grid/.test(a)?{kind:"grid",parent:o,parentStyle:i,position:n,label:`grid item${s}`}:{kind:n==="static"?"flow":"positioned",parent:o,parentStyle:i,position:n,label:n==="static"?"normal flow":`position: ${n}`}}function DG(e,t,n){let o=(n?t.gridTemplateColumns:t.gridTemplateRows).split(/\s+/).filter(d=>/^[\d.]+px$/.test(d)).map(Za),i=Za(n?t.columnGap:t.rowGap),r=[],a=[],s=0;for(let d of o)r.push(s),a.push(s+d),s+=d+i;let l=Pt(e),c=(n?l.width/e.offsetWidth:l.height/e.offsetHeight)||1,u=(n?l.left:l.top)+c*_i(t,n?["padding-left","border-left-width"]:["padding-top","border-top-width"]);return{starts:r,ends:a,gap:i,scale:c,origin:u,size:o.at(-1)??0}}function A2(e,t,n,o,i,r){let a=[...t];for(;o>0&&a.length<e.length+12&&a.at(-1)+n/2<r;)a.push(a.at(-1)+n+o);let s=i;for(let l=i;l<a.length;l++)Math.abs(a[l]-r)<Math.abs(a[s]-r)&&(s=l);return s-i+1}function xN(e){let{moves:t,sizes:n,layout:o}=vN(e),i=a=>a.map(s=>` \xB7 ${s}`).join(""),r=[...t.flatMap(a=>a.move?w2(a.move):[`- Move (${a.mode}): \u0394x ${on(a.dx)}, \u0394y ${on(a.dy)}${i(a.effects)}`]),...n.map(a=>`- Resize (${a.mode}) ${a.property}: ${a.from} \u2192 ${a.to}${i(a.effects)}`)];return r.length?`Proposed geometry changes (preview only)
371
+ ${te.innerHTML}`;G.sig!==pe&&(G.clone?.remove(),G.clone=void 0,G.sig=pe),G.clone??=b(te,G);let xe=G.clone.nextSibling;for(;Kn(xe)&&xm(xe);)xe=xe.nextSibling;(G.clone.parentNode!==ie.parent||xe!==ie.before)&&ie.parent.insertBefore(G.clone,ie.before)}let C=e.selected(),U=!a&&e.enabled()&&C&&d(C)===C&&!ym(C)&&la(C),I=a?"*{cursor:grabbing!important}":U?`${U},${U} *{cursor:move}`:"";I!==i&&o.replaceSync(i=I)}let A=new MutationObserver(()=>{t.size&&!l&&(l=requestAnimationFrame(()=>{l=0,S()}))});A.observe(n.documentElement,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class"]});function _(C,U){for(;U.before&&xm(U.before);)U.before=U.before.nextElementSibling;let I=c(C),G=I?.clone?.isConnected?I.clone:C;if(U.parent===G.parentElement&&(U.before===G||U.before===uN(G,!0)))return null;p();let te=C.parentElement,ie=I?.geometry[0].move.from??x(te,bm(te).indexOf(C)),pe={label:y(C),target:I?.geometry[0].move.target??la(C),from:ie,to:x(U.parent,h(U.parent,U.before,C),U.position)},xe=$n(C,"display"),L={element:C,display:I?.display??hc(C),priority:xe.priority,place:{parent:U.parent,before:U.before,selectors:[la(U.parent),U.before?la(U.before):null]},geometry:[{mode:"structure",layout:e.layout(C),move:pe,effects:[]}],undo(){ri(C,["display"],()=>xe.restore()),e.track(C,"display")},redo(){t.add(L),ri(C,["display"],()=>C.style.setProperty("display","none",xe.priority)),e.track(C,"display")}};t.add(L),e.history.push(L),e.remember(C,"display"),ri(C,["display"],()=>C.style.setProperty("display","none",xe.priority)),e.track(C,"display"),S(),e.update();try{localStorage.setItem("palette:geometry-moved","1")}catch{}return`Moved ${U.position==="inside"?`into ${v(U.parent)}`:`${U.position} ${y(U.ref)}`}`}function T(C,U,I){let G=e.targetAt(C,U);for(;G&&G!==G.ownerDocument.body&&(!G.parentElement||!T0(G.parentElement,I,e.host)||/^(inline|contents)$/.test(hc(G)));)G=G.parentElement;if(!G||G===G.ownerDocument.body||I.contains(G))return null;let te=Pt(G),ie=pN(G),[pe,xe,L]=ie?[te.left,te.width,C]:[te.top,te.height,U],Q=Math.min(12,xe/4);if(![...G.childNodes].some(we=>we.nodeType===Node.TEXT_NODE&&we.textContent.trim())&&T0(G,I,e.host)&&L>pe+Q&&L<pe+xe-Q){let we=bm(G,I).find(Te=>MG(Pt(Te),C,U))??null;return{parent:G,before:we,position:"inside",ref:null}}let se=L>=pe+xe/2;return{parent:G.parentElement,before:se?G.nextElementSibling:G,position:se?"after":"before",ref:G}}function H(C,U,I){let G=c(C),te=u(G)&&G.clone?.isConnected?G.clone:C,ie=te.parentElement;if(I&&!U){let xe=ie.parentElement;return xe&&T0(xe,C,e.host)?{parent:xe,before:ie.nextElementSibling,position:"after",ref:ie}:null}let pe=uN(te,U&&!I,C);return I?pe&&T0(pe,C,e.host)?{parent:pe,before:null,position:"inside",ref:null}:null:pe?{parent:ie,before:U?pe.nextElementSibling:pe,position:U?"after":"before",ref:pe}:null}let R=document.createElement("div"),z=document.createElement("div"),F=document.createElement("div");R.className="design-geometry__line",z.className="design-geometry__drop",F.className="design-geometry__readout design-geometry__chip";for(let C of[R,z,F])C.hidden=!0;let B=C=>`${Math.round(C*100)/100}px`;function le(C,U,I,G){if(R.hidden=z.hidden=F.hidden=!C,!C)return;let te=(se,we,Te,$,D)=>Object.assign(se.style,{left:B(we),top:B(Te),width:B($),height:B(D)});z.hidden=C.position!=="inside";let ie=Pt(C.parent);te(z,ie.left,ie.top,ie.width,ie.height);let pe=bm(C.parent,U),xe=h(C.parent,C.before,U),[L,Q]=[pe[xe-1],pe[xe]].map(se=>se&&Pt(se)),Z=pe[xe]??pe[xe-1];if(R.hidden=!Z,Z){let se=Q??L;pN(Z)?te(R,Q?(L&&L.top<Q.bottom&&L.bottom>Q.top?(L.right+Q.left)/2:Q.left-2)-1:L.right+1,se.top,2,se.height):te(R,se.left,Q?(L?(L.bottom+Q.top)/2:Q.top-2)-1:L.bottom+1,se.width,2)}F.textContent=m(C,U),Object.assign(F.style,{left:B(I+14),top:B(G+18)})}function J(){r=void 0,s=null,a&&(a=!1,e.drag(null)),le(null,n.body,0,0),S()}let V={capture:!0,signal:e.signal},oe=C=>{let U=e.selected();if(C.button||C.metaKey||C.ctrlKey||!e.enabled()||!U||C.composedPath().includes(e.host)||ym(U,d(U)))return;let I=Pt(d(U)),G=Vi(C);G.x<I.left||G.x>I.right||G.y<I.top||G.y>I.bottom||(C.preventDefault(),C.stopImmediatePropagation(),r={...G,id:C.pointerId})},ue=C=>{let U=e.selected();if(!r||C.pointerId!==r.id||!U)return;let I=Vi(C),G=I.x-r.x,te=I.y-r.y;!a&&Math.hypot(G,te)<4||(C.stopImmediatePropagation(),a||(a=!0,S()),e.drag([G,te]),s=T(I.x,I.y,U),le(s,U,I.x,I.y))},q=C=>{let U=e.selected();if(!r||C.pointerId!==r.id)return;let I=a,G=s,te=Vi(C);if(J(),!I){U&&d(U)===U&&e.pick(te.x,te.y);return}C.stopImmediatePropagation();let ie=U&&G&&_(U,G);ie&&e.announce(ie)},Y=()=>r&&J(),W=C=>{!a||C.key!=="Escape"||(C.preventDefault(),C.stopImmediatePropagation(),J())};for(let[C,U]of[["pointerdown",oe],["pointermove",ue],["pointerup",q],["pointercancel",Y],["keydown",W]])window.addEventListener(C,U,V),so(C,U,V,"window");return e.signal.addEventListener("abort",()=>{A.disconnect(),cancelAnimationFrame(l),p(),n.adoptedStyleSheets=n.adoptedStyleSheets.filter(C=>C!==o)},{once:!0}),{nodes:[R,z,F],shown:d,sync:S,key(C,U,I){let G=ym(C,d(C)),te=G?null:H(C,U,I);e.announce(G??(te&&_(C,te))??(I?U?"No container before it to move into":"Can't move out of this parent":U?"Already last":"Already first"))},detach(){p(),l||(l=requestAnimationFrame(()=>{l=0,S()}))}}}function w2(e){let t=n=>`${n.parent} \xB7 index ${n.index}${n.position?` \xB7 ${n.position}`:""}${n.component?` \xB7 component ${n.component}`:""}`;return[`- Move ${e.label}: from ${e.from.label} (${dN(e.from.index+1)}) \u2192 ${e.to.label} (${dN(e.to.index+1)})`,`From: ${t(e.from)}`,`To: ${t(e.to)}`]}var v2,TG,AG,hc,xm,dN,bm,MG,mN=O(()=>{"use strict";w0();ky();Li();um();ho();v2="data-palette-move-clone",TG="p,h1,h2,h3,h4,h5,h6,a,button,label,select,option,textarea,input,img,video,audio,canvas,iframe,embed,object,svg,br,hr,pre,picture,table,thead,tbody,tfoot,tr,colgroup,col,caption,script,style,template,slot",AG="p,h1,h2,h3,h4,h5,h6,a,label,button,span,em,strong,b,i,small,code",hc=e=>getComputedStyle(e).display,xm=e=>e.hasAttribute(v2),dN=e=>`${e}${e%100>10&&e%100<14?"th":["th","st","nd","rd"][e%10]??"th"}`,bm=(e,t)=>[...e.children].filter(n=>n!==t&&!xm(n)&&!/^(none|contents)$/.test(hc(n))&&!n.matches("script,style,template"));MG=(e,t,n)=>e.top<n&&e.bottom>n?e.left+e.width/2>t:e.top+e.height/2>n});var wN={};Ft(wN,{WAIT:()=>wm,bindGeometry:()=>NG,eligibleAncestor:()=>T2,geometryProposal:()=>xN,geometryReason:()=>Em,spanFor:()=>A2});function _G(e){let t=e.assignedSlot??Sm(e);for(;t&&getComputedStyle(t).display==="contents";)t=t.assignedSlot??Sm(t);return t}function Em(e){if(!e?.isConnected)return"Select an element on the page.";let t=e.ownerDocument;if(e===t.body||e===t.documentElement)return"The page root can't be moved or resized.";if(Gu(e)&&!C0(e))return"SVG shapes can't be moved or resized. Select the SVG root.";if(!mn(e)&&!C0(e))return"Only HTML boxes and SVG roots can be moved or resized.";let o=getComputedStyle(e).display;if(o==="none")return"display: none has no box";if(o==="contents")return"display: contents has no box";if(o==="inline"&&!C0(e)&&!e.matches(`${yN},${CG}`))return"Inline text box can't be resized";if(o.startsWith("table-"))return"Table cells and rows size with their table. Select the table.";if(/ruby|math/.test(o))return`display: ${o} boxes can't be moved or resized.`;let i=e.getClientRects().length,r=Pt(e);if(!i||!r.width||!r.height)return"This element has no rendered box.";if(i>1)return"Boxes split across lines or columns can't be previewed.";for(let a=e;a&&a!==t.documentElement;a=Sm(a)){let s=getComputedStyle(a),l=s.transform&&s.transform!=="none"?new DOMMatrix(s.transform):null,c=!s.scale||s.scale==="none"?[1]:s.scale.split(/\s+/).map(Number);if(s.rotate&&s.rotate!=="none"||l&&(!l.is2D||l.b||l.c||l.a<=0||l.d<=0)||c.length>2||c.some(u=>!(u>0)))return"Rotated, skewed, 3D or mirrored boxes can't be previewed.";if(!a.closest(`[${nr}]`)&&a.getAnimations?.().some(u=>u.playState==="running"&&u.effect?.getKeyframes?.().some(d=>Object.keys(d).some(p=>/^(transform|translate|scale|rotate|inset|left|top|right|bottom|flex|grid)|(width|height)$/i.test(p)))))return wm}return null}function T2(e){for(let t=Sm(e);t&&t!==e.ownerDocument.body&&t!==e.ownerDocument.documentElement;t=Sm(t))if(!Em(t))return t;return null}function E2(e){let n=getComputedStyle(e).position,o=_G(e),i=o?getComputedStyle(o):void 0,a=n==="absolute"||n==="fixed"?"":i?.display??"",s=n==="static"?"":`, position: ${n}`;if(/flex/.test(a)){let l=i.flexDirection.startsWith("row")===!i.writingMode.startsWith("vertical");return{kind:"flex",row:l,parent:o,parentStyle:i,position:n,label:`flex item, ${l?"row":"column"}${s}`}}return/grid/.test(a)?{kind:"grid",parent:o,parentStyle:i,position:n,label:`grid item${s}`}:{kind:n==="static"?"flow":"positioned",parent:o,parentStyle:i,position:n,label:n==="static"?"normal flow":`position: ${n}`}}function DG(e,t,n){let o=(n?t.gridTemplateColumns:t.gridTemplateRows).split(/\s+/).filter(d=>/^[\d.]+px$/.test(d)).map(Za),i=Za(n?t.columnGap:t.rowGap),r=[],a=[],s=0;for(let d of o)r.push(s),a.push(s+d),s+=d+i;let l=Pt(e),c=(n?l.width/e.offsetWidth:l.height/e.offsetHeight)||1,u=(n?l.left:l.top)+c*_i(t,n?["padding-left","border-left-width"]:["padding-top","border-top-width"]);return{starts:r,ends:a,gap:i,scale:c,origin:u,size:o.at(-1)??0}}function A2(e,t,n,o,i,r){let a=[...t];for(;o>0&&a.length<e.length+12&&a.at(-1)+n/2<r;)a.push(a.at(-1)+n+o);let s=i;for(let l=i;l<a.length;l++)Math.abs(a[l]-r)<Math.abs(a[s]-r)&&(s=l);return s-i+1}function xN(e){let{moves:t,sizes:n,layout:o}=vN(e),i=a=>a.map(s=>` \xB7 ${s}`).join(""),r=[...t.flatMap(a=>a.move?w2(a.move):[`- Move (${a.mode}): \u0394x ${on(a.dx)}, \u0394y ${on(a.dy)}${i(a.effects)}`]),...n.map(a=>`- Resize (${a.mode}) ${a.property}: ${a.from} \u2192 ${a.to}${i(a.effects)}`)];return r.length?`Proposed geometry changes (preview only)
372
372
  Layout: ${o}
373
373
  ${r.join(`
374
- `)}`:void 0}function vN(e){let t=new Map,n=new Map,o="";for(let i of e)if(o=i.layout,i.property){let r=n.get(i.property);n.delete(i.property),n.set(i.property,{...i,from:r?.from??i.from})}else if(i.move){let r=t.get(i.mode);t.set(i.mode,{...i,move:{...i.move,from:r?.move?.from??i.move.from}})}else{let r=t.get(i.mode);t.set(i.mode,{...i,dx:(r?.dx??0)+i.dx,dy:(r?.dy??0)+i.dy,effects:[...new Set([...r?.effects??[],...i.effects])]})}return{layout:o,moves:[...t.values()].filter(({move:i,dx:r,dy:a})=>i?i.from.parent!==i.to.parent||i.from.index!==i.to.index:km(r)||km(a)),sizes:[...n.values()].filter(i=>i.from!==i.to)}}function hN(e){let t=getComputedStyle(e),n=t.boxSizing==="border-box",o=Za(t.width),i=Za(t.height),r=C0(e)||e.matches(yN),a=t.aspectRatio&&t.aspectRatio!=="auto"?t.aspectRatio.replace(/^auto\s*/,""):"",s=u=>/px$/.test(t.getPropertyValue(`max-${u}`))&&Za(t.getPropertyValue(`max-${u}`))<=Za(t.getPropertyValue(`min-${u}`)),l=(r||a)&&i?o/i:0,c=!s("width")&&!s("height");return{css:t,border:n,width:o,height:i,replaced:r,aspect:a,ratio:l,borderWidth:o+(n?0:_i(t,k2)),borderHeight:i+(n?0:_i(t,S2)),axes:l?[c,c]:[!s("width"),!s("height")]}}function RG(e,{parent:t,kind:n,row:o},i,r){let a=[],s=[];if(!t)return{x:a,y:s};let l=n==="flow"||n==="flex"&&!o,c=n!=="flex"||!o,u=Pt(t),d=getComputedStyle(t),p=u.left+i*_i(d,["padding-left","border-left-width"]),g=u.right-i*_i(d,["padding-right","border-right-width"]),y=u.top+r*_i(d,["padding-top","border-top-width"]),v=u.bottom-r*_i(d,["padding-bottom","border-bottom-width"]);for(let x of[p,g,(p+g)/2])a.push({at:x,from:u.top,to:u.bottom});for(let x of l?[y]:[y,v,(y+v)/2])s.push({at:x,from:u.left,to:u.right});for(let x of[...t.children].slice(0,60)){let h=Pt(x);x===e||!h.width&&!h.height||(c&&a.push({at:h.left,from:h.top,to:h.bottom},{at:h.right,from:h.top,to:h.bottom}),l||s.push({at:h.top,from:h.left,to:h.right},{at:h.bottom,from:h.left,to:h.right}))}return{x:a,y:s}}function NG(e){let t=($,D,j)=>j.appendChild(Object.assign(document.createElement($),{className:D})),n=document.createElement("div");n.className="design-geometry";let o=document.createElement("style");o.textContent=`.design-geometry{--palette-sel:var(--palette-selection,var(--komo-selection,#0c93f5));position:fixed;inset:0;pointer-events:none;z-index:2}.design-geometry[hidden],.design-geometry [hidden],.design-geometry-note[hidden],.design-geometry-note [hidden]{display:none}.design-geometry:not([data-on])>*{display:none}.design-outline[data-kind=selected]:has(~.design-geometry[data-on]:not([hidden])){outline:0}:host(.design-active[data-palette-overlays-hidden]) :is(.design-geometry,.design-outline,.pins){visibility:hidden}.design-geometry>*{position:fixed;box-sizing:border-box}.design-geometry__frame{border:1px solid var(--palette-sel);outline:0}.design-geometry__frame:focus-visible{box-shadow:0 0 0 2px color-mix(in oklab,var(--palette-sel) 35%,transparent)}.design-geometry__frame,.design-geometry__handle{transition:opacity .12s ease}.design-geometry__handle{opacity:0;pointer-events:auto;touch-action:none}.design-geometry:is([data-near],[data-active],[data-focus]) .design-geometry__handle{opacity:1}.design-geometry[data-quiet] .design-geometry__handle{opacity:0;pointer-events:none}.design-geometry[data-quiet] .design-geometry__frame{opacity:.4}.design-geometry[data-preview] .design-geometry__frame{opacity:0}.design-geometry__handle::before{content:'';position:absolute;left:var(--x);top:var(--y);width:${bc}px;height:${bc}px;box-sizing:border-box;border-radius:1px;background:#fff;border:1px solid var(--palette-sel);box-shadow:0 1px 2px #0000001f}.design-geometry__handle:hover::before,.design-geometry__handle[data-active]::before{background:var(--palette-sel)}.design-geometry__handle[data-small]::before{display:none}[data-handle=n],[data-handle=s]{cursor:ns-resize}[data-handle=e],[data-handle=w]{cursor:ew-resize}[data-handle=nw],[data-handle=se]{cursor:nwse-resize}[data-handle=ne],[data-handle=sw]{cursor:nesw-resize}.design-geometry__guide{background:var(--palette-selection,var(--komo-selection,#0c93f5))}.design-geometry__readout{translate:-50% 0;padding:2px 6px;border-radius:4px;background:var(--palette-sel);color:#fff;font:500 11px/16px system-ui,sans-serif;font-variant-numeric:tabular-nums;white-space:nowrap;box-shadow:0 1px 3px #0003}.design-geometry[data-dragging] :is(.design-geometry__handle,.design-geometry__guide){display:none}.design-geometry__line{background:var(--palette-sel);border-radius:1px}.design-geometry__drop{border:2px dashed var(--palette-sel);border-radius:4px}.design-geometry__chip{translate:none}@media (prefers-reduced-motion:reduce){.design-geometry__frame,.design-geometry__handle{transition:none}}.design-geometry-note{display:grid;gap:8px;padding:0 12px 12px;color:#a19d97;font-size:11px;line-height:1.45}.design-geometry-note p{margin:0}.design-geometry-note div{display:flex;flex-wrap:wrap;gap:6px}.design-geometry-note button{height:24px;padding:0 8px;border-radius:6px;background:#ffffff0f;color:#e9e6e1;font-size:11px}.design-geometry-note button:hover{background:#ffffff1a}.design-geometry-note button[aria-pressed=true]{background:color-mix(in oklab,var(--accent,#bda6ef) 32%,transparent)}.design-inspector__eye{display:grid;place-items:center;flex:none;min-width:28px;height:28px;border-radius:7px;color:#909090}.design-inspector__eye:hover{background:#161616;color:#eee}.design-inspector__eye svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.3}.design-geometry-wait{order:1;width:5px;height:5px;margin-left:4px;border-radius:50%;background:#e7c27d;opacity:.7}`;let i=t("div","design-geometry__frame",n);i.tabIndex=0,i.setAttribute("role","group"),i.setAttribute("aria-roledescription","selection");let r=HG.map($=>{let D=t("div","design-geometry__handle",n);return D.dataset.handle=$,D.setAttribute("aria-hidden","true"),{name:$,handle:D,ex:$.includes("e")?1:$.includes("w")?-1:0,ey:$.includes("s")?1:$.includes("n")?-1:0}}),a=[t("div","design-geometry__guide",n),t("div","design-geometry__guide",n)],s=t("div","design-geometry__readout",n);s.setAttribute("aria-hidden","true");let l=$=>n.dispatchEvent(new CustomEvent("palette-announce",{detail:$,bubbles:!0,composed:!0})),c=document.createElement("div");c.className="design-geometry-note",c.title=Xf;let u=t("p","",c),d=t("div","",c),p=$=>Object.assign(t("button","",d),{type:"button",textContent:$}),g=p("Select parent"),y=p("Snap to grid tracks");y.setAttribute("aria-pressed","false"),y.title="Resize changes grid-column-end / grid-row-end spans instead of width and height";let v=t("i","design-geometry-wait",c);v.title=wm,v.setAttribute("role","img"),v.setAttribute("aria-label",wm);let x=0,h=0;e.options.root.append(o,n);let m,b=null,E=!1,S=[!1,!1],A=null,_={x:-1e4,y:-1e4},T=[],H=0,R=!1,z,F=e.options.visibility,B=F?` (${Jr(F).keys.join(po()?"":"+")})`:"",le=po()?"Meta":"Control",J=($,D)=>($=["Control","Alt","Shift","Meta"].filter(j=>$.includes(j)),po()?`${$.map(j=>({Alt:"\u2325",Shift:"\u21E7",Meta:"\u2318"})[j]).join("")}${D.length>3?" ":""}${D}`:`${$.map(j=>j==="Control"?"Ctrl":j).join("+")}+${D}`),V=$=>{z&&$-z.at>350&&ue(z.was),z=void 0},oe=Object.assign(document.createElement("button"),{type:"button",className:"design-inspector__eye"});function ue($){R=$,e.options.host.toggleAttribute("data-palette-overlays-hidden",$),oe.setAttribute("aria-pressed",String($)),oe.setAttribute("aria-label",oe.title=`${$?"Show":"Hide"} selection${B}`),oe.innerHTML=`<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M1.5 8s2.4-4.5 6.5-4.5S14.5 8 14.5 8 12.1 12.5 8 12.5 1.5 8 1.5 8z"/><circle cx="8" cy="8" r="2"/>${$?'<path d="M2.5 13.5l11-11"/>':""}</svg>`}ue(!1);let q=e.options.design?.selectionColor;q&&e.options.host.style.setProperty("--palette-selection",q),oe.addEventListener("click",()=>ue(!R));function Y(){let $=e.options.root,D=e.panel().closest(".design-inspector"),j=$.activeElement,X=$.querySelector(".palette-select:popover-open,.palette-tokens:popover-open"),fe=!!j&&!!D?.contains(j)&&j.matches("input,textarea,select,[contenteditable]");n.toggleAttribute("data-quiet",!m&&(!!X||fe||!!$.querySelector(".palette-color")||!!D&&T.includes(D))),n.toggleAttribute("data-preview",!!X&&T.includes(X)),n.toggleAttribute("data-near",!!A&&_.x>A.left-M0&&_.x<A.right+M0&&_.y>A.top-M0&&_.y<A.bottom+M0),n.toggleAttribute("data-active",!!m||n.hasAttribute("data-dragging")),n.toggleAttribute("data-focus",j===i)}let W=()=>{H||(H=requestAnimationFrame(()=>{H=0,Y()}))},C=new AbortController,U=$=>e.history.reduce((D,j)=>j.element!==$?D:j.geometry?[...D,...j.geometry]:j.property?D.filter(X=>X.property!==j.property):D,[]),I=fN({signal:C.signal,host:e.options.host,targetAt:e.options.targetAt,history:e.history,selected:e.selected,pick:e.pick,enabled:e.enabled,before:e.before,remember:e.remember,track:e.track,update:e.update,component:$=>e.tokens()?.designContext($,e.options.design).find(D=>D.startsWith("Component: "))?.slice(11).replace(/ \(.*\)$/,""),layout:$=>E2($).label,announce:l,drag($){n.toggleAttribute("data-dragging",!!$),i.style.translate=$?`${$[0]}px ${$[1]}px`:""}});n.append(...I.nodes);let G=$=>$.map(D=>`${D.property} ${D.to}`).join(", ");function te($=!1){let D=m;if(!D)return;m=void 0;let{element:j,before:X}=D,fe=new Map([...X.keys()].map(De=>[De,[j.style.getPropertyValue(De),j.style.getPropertyPriority(De)]]));for(let[De,[Ce,Pe]]of fe)Ce===X.get(De).value&&Pe===X.get(De).priority&&fe.delete(De);let ye=()=>[...X.values()].reverse().forEach(De=>De.restore());if(ri(j,X.keys(),ye),ye(),!$&&fe.size){let De=[];for(let Ce of fe.keys())e.remember(j,Ce);ri(j,fe.keys(),()=>{for(let[Ce,[Pe]]of fe){let Ne=e.tokens()?.noteDesignTokenOverride(j,Ce,Pe);De.push(Ne?.undo),j.style.setProperty(Ce,Pe,Ne?.priority??X.get(Ce).priority),e.track(j,Ce)}}),e.history.push({element:j,geometry:D.changes,undo(){ri(j,X.keys(),()=>{ye(),De.reverse().forEach(Ce=>Ce?.());for(let Ce of X.keys())e.tokens()?.syncDesignTokenBinding(j,Ce),e.track(j,Ce)}),ye()},redo(){ri(j,fe.keys(),()=>{for(let[Ce,[Pe,Ne]]of fe)j.style.setProperty(Ce,Pe,Ne),e.tokens()?.syncDesignTokenBinding(j,Ce),e.track(j,Ce)})}}),l(`Resized: ${G(D.changes)}`)}D.pointer!==void 0&&D.source.hasPointerCapture(D.pointer)&&D.source.releasePointerCapture(D.pointer),D.source.removeAttribute("data-active"),s.hidden=a[0].hidden=a[1].hidden=!0,e.update(),Q()}function ie($,D,j,X,fe){te(!0);let ye=e.selected();if(!e.enabled()||!ye||Em(ye)||ye===b)return;let De=hN(ye),{css:Ce,width:Pe,height:Ne,borderWidth:Le,borderHeight:Ie,border:ut,replaced:ct,aspect:de,ratio:Ae}=De;if(!De.axes[$===2?1:0]||!De.axes[$===1?0:1])return;let ve=Pt(ye),Re=E2(ye),Fe=E&&Re.kind==="grid",Ye={},$e=Re.parentStyle,ot=Re.parent&&Pt(Re.parent),rn=(K,ce)=>["stretch","normal"].includes(K==="auto"?ce:K)&&!ct&&!de,Zt=(K,ce)=>Math.abs((K?ve.width+_i(Ce,["margin-left","margin-right"])*ve.width/Le:ve.height+_i(Ce,["margin-top","margin-bottom"])*ve.height/Ie)-ce)<1.5,Ht;if(Re.kind==="flex"&&ot&&$e&&rn(Ce.alignSelf,$e.alignItems)){let K=Re.row?ve.height/Ie:ve.width/Le,ce=Re.row?ot.height-K*_i($e,S2):ot.width-K*_i($e,k2);Zt(!Re.row,ce)&&(Ye[Re.row?"height":"width"]="align-self")}Re.kind==="grid"&&$e&&(Ht=[!0,!1].map(K=>{let ce=DG(Re.parent,$e,K),_e=(K?ve.left:ve.top)-ce.origin,et=(K?ve.right:ve.bottom)-ce.origin,Ve=0;ce.starts.forEach((Ct,ht)=>{Math.abs(Ct*ce.scale-_e)<Math.abs(ce.starts[Ve]*ce.scale-_e)&&(Ve=ht)});let gt=A2(ce.starts,ce.ends,ce.gap,ce.size,Ve,et/ce.scale)+Ve-1;return(K?rn(Ce.justifySelf,$e.justifyItems):rn(Ce.alignSelf,$e.alignItems))&&ce.ends.length&&Zt(K,((ce.ends[gt]??ce.ends.at(-1))-ce.starts[Ve])*ce.scale)&&(Ye[K?"width":"height"]=K?"justify-self":"align-self"),{...ce,start:Ve,edge:et/ce.scale,from:K?Ce.gridColumnEnd:Ce.gridRowEnd}}));let pt=Fe?["grid-column-end","grid-row-end"]:["width","height","flex-basis","flex-grow","flex-shrink"],Qt=ve.width/Le,Mn=ve.height/Ie;m={element:ye,kind:$,ex:D,ey:j,source:X,pointer:fe?.pointerId,x:fe?.clientX??0,y:fe?.clientY??0,dx:0,dy:0,sx:Qt,sy:Mn,width:Pe,height:Ne,start:{left:ve.left,top:ve.top,right:ve.right,bottom:ve.bottom,width:ve.width,height:ve.height},rect:ve,layout:Re,snap:Fe,ratio:Ae,lock:!1,stretch:Ye,grid:Ht,lines:RG(ye,Re,Qt,Mn),css:Object.fromEntries(LG.map(K=>[K,Ce.getPropertyValue(K)])),ratioText:de||`${km(Pe)} / ${km(Ne)}`,minWidth:ut?Math.max(16,_i(Ce,k2)):16,minHeight:ut?Math.max(16,_i(Ce,S2)):16,changes:[],before:new Map(pt.map(K=>[K,$n(ye,K)]))}}function pe($,D,j,X){$.changes=[];for(let fe of[!0,!1]){if($.kind===(fe?2:1))continue;let ye=$.grid[fe?0:1];if(!ye.ends.length)return!1;let De=A2(ye.starts,ye.ends,ye.gap,ye.size,ye.start,ye.edge+(fe?D:j)/ye.scale),Ce=fe?"grid-column-end":"grid-row-end";X(Ce,`span ${De}`),$.changes.push({mode:"span",layout:$.layout.label,property:Ce,from:ye.from,to:`span ${De}`,effects:[`spans ${De} ${fe?"column":"row"} track${De>1?"s":""}`]})}return!0}function xe($,D,j,X){let{element:fe,kind:ye,layout:De,css:Ce}=$,Pe=$.ratio||($.lock?$.width/$.height:0),Ne=$.width+D/$.sx,Le=$.height+j/$.sy;if(Pe){ye===1||ye===3&&Math.abs(D/$.sx)/$.width>=Math.abs(j/$.sy)/$.height?Le=Ne/Pe:Ne=Le*Pe;let ve=Math.max(1,$.minWidth/Ne,$.minHeight/Le);Ne*=ve,Le*=ve}else Ne=Math.max($.minWidth,Ne),Le=Math.max($.minHeight,Le);let Ie=new Map([...Pe||ye!==2?[["width",Ne]]:[],...Pe||ye!==1?[["height",Le]]:[]]),ut=new Map([...Ie.keys()].map(ve=>[ve,[]])),ct=De.kind==="flex"&&De.position!=="absolute"&&De.position!=="fixed"?De.row?"width":"height":"",de=!!ct&&Ie.has(ct)&&Ce["flex-basis"]!=="auto",Ae=Ce["flex-grow"]!=="0";for(let[ve,Re]of Ie)X(ve,on(Re));if(ct&&Ie.has(ct)){let ve=ut.get(ct);(de||Ae)&&ve.push(`${ct} overrides flex: ${Ce.flex||`${Ce["flex-grow"]} ${Ce["flex-shrink"]} ${Ce["flex-basis"]}`}`),de&&(X("flex-basis",on(Ie.get(ct))),ve.push(`sets flex-basis: ${on(Ie.get(ct))}`)),Ae&&(X("flex-grow","0"),ve.push("sets flex-grow: 0")),Za(getComputedStyle(fe).getPropertyValue(ct))<Ie.get(ct)-.5&&Ce["flex-shrink"]!=="0"&&(X("flex-shrink","0"),ve.push("sets flex-shrink: 0"))}for(let[ve,Re]of Ie){let Fe=ut.get(ve),Ye=Za(getComputedStyle(fe).getPropertyValue(ve));if($.stretch[ve]&&Fe.push(`${ve} overrides ${$.stretch[ve]}: stretch`),$.ratio&&Fe.length<9&&ve===(ye===2?"height":"width")&&Fe.push(`keeps aspect ratio ${$.ratioText}`),Math.abs(Ye-Re)>.5){let $e=Ce[`${Ye<Re?"max":"min"}-${ve}`];Fe.push(Ye<Re?`limited by ${$e!=="none"?`max-${ve}: ${$e}`:"its container"}`:`held at ${["auto","0px"].includes($e)?"its content size":`min-${ve}: ${$e}`}`),Ie.set(ve,Ye),X(ve,on(Ye)),ve===ct&&de&&X("flex-basis",on(Ye))}}return $.changes=[...Ie].map(([ve,Re])=>({mode:ve===ct&&de?"flex-basis":"size",layout:De.label,property:ve,from:on(ve==="width"?$.width:$.height),to:on(Re),effects:ut.get(ve)})),!0}function L($,D,j=!0){let X=m;if(!X)return;if(!e.enabled()||e.selected()!==X.element||Em(X.element)){te(!0);return}let{element:fe,before:ye,start:De,kind:Ce}=X,Pe=(Ae,ve)=>{X.dx=Ae,X.dy=ve;let Re=!0;return ri(fe,ye.keys(),()=>{let Fe=(Ye,$e)=>fe.style.setProperty(Ye,$e,ye.get(Ye).priority);for(let[Ye,$e]of ye)fe.style.setProperty(Ye,$e.value,$e.priority);Re=(X.snap?pe:xe)(X,Ae*X.ex,ve*X.ey,Fe)}),Re};if(!Pe($,D)){b=fe,te(!0);return}let Ne=Pt(fe),Le=Ae=>Ae?[[Ne.left,Ne.left-De.left],[Ne.right,Ne.right-De.right]]:[[Ne.top,Ne.top-De.top],[Ne.bottom,Ne.bottom-De.bottom]],Ie=!j&&!X.snap,ut=Ae=>{let ve=Ae?Ne.width-De.width:Ne.height-De.height,Re=0,Fe=OG;if(Ie&&Ce&(Ae?1:2)&&Math.abs(ve)>.5){for(let[Ye,$e]of Le(Ae))if(Math.abs($e)>.5&&Math.abs($e)>=Math.abs(ve)/3)for(let ot of X.lines[Ae?"x":"y"])Math.abs(ot.at-Ye)<=Fe&&(Fe=Math.abs(ot.at-Ye),Re=(ot.at-Ye)*ve/$e)}return Re},ct=ut(!0),de=ut(!1);(ct||de)&&(Pe($+ct*X.ex,D+de*X.ey),Ne=Pt(fe)),a.forEach((Ae,ve)=>{let Re=!ve;if(Ae.hidden=!0,Ie&&Ce&(Re?1:2))for(let[Fe,Ye]of Le(Re)){let $e=Math.abs(Ye)>.5&&Math.abs(Ye)>=Math.abs(Re?Ne.width-De.width:Ne.height-De.height)/3&&X.lines[Re?"x":"y"].find(Zt=>Math.abs(Zt.at-Fe)<.75);if(!$e)continue;let ot=Math.min($e.from,Re?Ne.top:Ne.left),rn=Math.max($e.to,Re?Ne.bottom:Ne.right);Ae.hidden=!1,Object.assign(Ae.style,Re?{left:on($e.at),top:on(ot),width:"1px",height:on(rn-ot)}:{left:on(ot),top:on($e.at),width:on(rn-ot),height:"1px"})}}),X.rect=Ne,s.textContent=`${Math.round(Ne.width/X.sx)} \xD7 ${Math.round(Ne.height/X.sy)}`,s.hidden=!1,Q()}function Q(){I.sync();let $=e.selected(),D=e.enabled()&&!!$?.isConnected;if(n.hidden=!D,n.removeAttribute("data-on"),A=null,c.hidden=!$?.isConnected,v.hidden=!0,D||te(!0),!$?.isConnected)return;$!==b&&(b=null);let j=I.shown($),X=j!==$,fe=X?null:Em($),ye=fe===wm,De=performance.now();x=ye?x||De:0,clearTimeout(h),ye&&(h=window.setTimeout(Q,gN));let Ce=ye&&De-x>=gN,Pe=ye||X?null:fe??(b?"Host styles override this preview. Select the parent or another element.":null),Ne=ym($,j);(Pe||X||ye)&&m&&te(!0);let Le=e.panel(),Ie=[...Le.querySelectorAll(".design-section")].find(Ze=>Ze.querySelector("summary")?.textContent==="Layout")??Le;c.parentElement!==Ie&&Ie.append(c);let ut=Ie!==Le&&Ie.querySelector("summary");ut&&v.parentElement!==ut&&ut.append(v),v.hidden=!Ce;let ct=Pe||Ne?T2($):null;g.hidden=!ct,ct&&g.setAttribute("aria-label",`Select movable parent ${ct.tagName.toLowerCase()}`),y.hidden=!!Pe||X||E2($).kind!=="grid",y.setAttribute("aria-pressed",String(E));let{moves:de,sizes:Ae}=vN(U($)),ve=de.flatMap(Ze=>Ze.move?[w2(Ze.move)[0].slice(2)]:[]),Re=!0;try{Re=!!localStorage.getItem("palette:geometry-moved")}catch{}u.textContent=[Pe,Ne].filter(Boolean).join(" \xB7 ")||[...new Set([...ve,...[...m?.changes??[],...de,...Ae].flatMap(Ze=>Ze.effects)])].join(" \xB7 ")||(Re||X?"":"Drag to reorder \xB7 M, then \u2325\u2191/\u2325\u2193");let Fe=Le.closest(".design-inspector")?.querySelector(".design-inspector__heading");Fe&&oe.parentElement!==Fe&&Fe.querySelector(".design-inspector__fold")?.before(oe),u.hidden=!u.textContent,c.hidden=u.hidden&&g.hidden&&y.hidden;let Ye=Pt(j),$e=e.options.bounds?.(j)??{left:0,top:0,right:innerWidth,bottom:innerHeight};if((Pe||Ce)&&Ne||!D||Ye.right<=$e.left||Ye.left>=$e.right||Ye.bottom<=$e.top||Ye.top>=$e.bottom)return;n.setAttribute("data-on","");let ot=hN($);S=Pe||X||Ce?[!1,!1]:ot.axes;let rn=`${$.tagName.toLowerCase()}${$.id?`#${$.id}`:""}`;i.setAttribute("aria-label",`${Ne?"Resize":"Move or resize"} ${rn}: ${Ne?"":`${J(["Alt"],"\u2191/\u2193")} move, ${J(["Alt","Shift"],"\u2191/\u2193")} move out or into, `}${J([le],"arrows")} resize, ${J(["Shift",le],"arrows")} by 10px`);let Zt=devicePixelRatio||1,Ht=Ze=>Math.round(Ze*Zt)/Zt,pt=Ht(Ye.left),Qt=Ht(Ye.top),Mn=Ht(Ye.right),K=Ht(Ye.bottom);A={left:pt,top:Qt,right:Mn,bottom:K};let ce=(Ze,Et)=>getComputedStyle(Ze)[Et].match(/[\d.]+/g)?.map(Number)??[],[_e,et]=[ce(j,"backgroundColor"),ce(a[0],"backgroundColor")];n.style.setProperty("--palette-sel",_e.length>2&&(_e[3]??1)>.5&&Math.hypot(_e[0]-et[0],_e[1]-et[1],_e[2]-et[2])<90?"#e5359b":""),Object.assign(i.style,{left:on(pt),top:on(Qt),width:on(Mn-pt),height:on(K-Qt),clipPath:`inset(${[$e.top-Qt,Mn-$e.right,K-$e.bottom,$e.left-pt].map(Ze=>on(Math.max(0,Ze))).join(" ")})`});let Ve=Mn-pt<bN||K-Qt<bN,gt=Ve?0:vm,Ct=A0+vm-gt,ht=S[0]&&S[1],Gt=(Ze,Et,Pn)=>Pn<0?Ze+.5:Pn>0?Et-.5:Ht((Ze+Et)/2)+.5,wt=(Ze,Et,Pn)=>Pn<0?[Ze-Ct,Ze+gt]:Pn>0?[Et-gt,Et+Ct]:Et-Ze-2*gt>=A0+vm?[Ze+gt,Et-gt]:[(Ze+Et-A0-vm)/2,(Ze+Et+A0+vm)/2];for(let{handle:Ze,ex:Et,ey:Pn}of r){let ir=Gt(pt,Mn,Et),li=Gt(Qt,K,Pn),ci=!Et||!Pn,[rr,Di]=wt(pt,Mn,Et),[_o,ar]=wt(Qt,K,Pn);Ze.hidden=(ci?!S[Et?0:1]||!!ot.ratio:!ht)||ir<$e.left||ir>$e.right||li<$e.top||li>$e.bottom,Ze.toggleAttribute("data-small",Ve||ci&&ht&&(Et?K-Qt:Mn-pt)<zG),Object.assign(Ze.style,{left:on(rr),top:on(_o),width:on(Di-rr),height:on(ar-_o)}),Ze.style.setProperty("--x",on(ir-bc/2-rr)),Ze.style.setProperty("--y",on(li-bc/2-_o))}let jn=K+bc+30<$e.bottom;Object.assign(s.style,{left:on(Math.max($e.left+40,Math.min($e.right-40,(pt+Mn)/2))),top:on(jn?K+bc+4:Qt-bc-24)}),Y()}g.addEventListener("click",()=>{let $=e.selected(),D=$&&T2($);D&&e.select(D)}),y.addEventListener("click",()=>{te(!0),E=!E,Q()});for(let{handle:$,ex:D,ey:j}of r){let X=(D?1:0)+(j?2:0);$.addEventListener("pointerdown",fe=>{fe.button===0&&(fe.preventDefault(),fe.stopPropagation(),ie(X,D,j,$,fe),$.toggleAttribute("data-active",!!m),Y(),m&&$.setPointerCapture(fe.pointerId))}),$.addEventListener("pointermove",fe=>{m?.pointer===fe.pointerId&&(m.lock=fe.shiftKey&&X===3,L(fe.clientX-m.x,fe.clientY-m.y,fe.altKey))}),$.addEventListener("pointerup",()=>te()),$.addEventListener("pointercancel",()=>te(!0)),$.addEventListener("lostpointercapture",()=>te(!0)),$.addEventListener("click",fe=>{fe.preventDefault(),fe.stopPropagation()})}i.addEventListener("blur",()=>{m?.keyboard&&te()});let Z=$=>{let D=$G[$.key],j=$.composedPath(),X=j[0]===i,fe=!$.altKey&&!$.ctrlKey&&!$.metaKey&&!$.shiftKey,ye=j.some(ut=>Kn(ut)&&ut.matches("input,textarea,select,[contenteditable]:not([contenteditable=false])")),De=F;if(De&&!ye&&e.options.host.classList.contains("design-active")&&$.key.toLowerCase()===De.key&&$.shiftKey===De.shift&&$.altKey===De.alt&&$.ctrlKey===De.ctrl&&$.metaKey===De.meta){$.preventDefault(),$.stopImmediatePropagation(),$.repeat||(z={at:$.timeStamp,was:R},ue(!R));return}let Ce=e.selected(),Pe;if(!m&&X&&$.key==="Escape"?Pe=()=>i.blur():fe&&$.key.toLowerCase()==="m"&&!X&&!ye&&!j.includes(e.options.host)&&n.hasAttribute("data-on")&&!e.options.reservedKey?.($)?Pe=()=>i.focus({preventScroll:!0}):X&&D&&Ce&&$.altKey&&!$.ctrlKey&&!$.metaKey&&!m&&(Pe=()=>I.key(Ce,D[0]+D[1]>0,$.shiftKey)),Pe){$.preventDefault(),$.stopImmediatePropagation(),Pe();return}if(!($.key==="Escape"&&m)&&(!X||!D||!($.ctrlKey||$.metaKey)||$.altKey))return;if($.preventDefault(),$.stopImmediatePropagation(),!D)return te(!0);let Ne=D[0]?1:2;if(m&&m.kind!==Ne&&te(),!m&&S[Ne-1]&&ie(Ne,1,1,i),!m)return;m.keyboard=!0;let Le=m.grid?.[Ne-1],Ie=m.snap?(Le.size+Le.gap)*Le.scale:($.shiftKey?10:1)*(Ne===1?m.sx:m.sy);L(m.dx+D[0]*Ie,m.dy+D[1]*Ie)};window.addEventListener("keydown",Z,{capture:!0,signal:C.signal}),so("keydown",Z,{capture:!0,signal:C.signal},"window");let ae=$=>{z&&F&&($.key.toLowerCase()===F.key||{Shift:F.shift,Alt:F.alt,Control:F.ctrl,Meta:F.meta}[$.key])&&V($.timeStamp),m?.keyboard&&/^(Arrow|Control|Meta)/.test($.key)&&te()};window.addEventListener("keyup",ae,{capture:!0,signal:C.signal}),so("keyup",ae,{capture:!0,signal:C.signal},"window");let we=()=>{if(m?.pointer!==void 0){let $=Pt(m.element),D=$.left-m.rect.left,j=$.top-m.rect.top;m.x+=D,m.y+=j;for(let X of["left","right"])m.start[X]+=D;for(let X of["top","bottom"])m.start[X]+=j;for(let X of m.lines.x)X.at+=D,X.from+=j,X.to+=j;for(let X of m.lines.y)X.at+=j,X.from+=D,X.to+=D;L(m.dx-D,m.dy-j)}Q()},Te=$=>{_=Vi($),T=$.composedPath(),W()};for(let[$,D]of[["scroll",we],["pointermove",Te],["focusin",W],["focusout",W]]){let j={capture:!0,passive:$!=="focusin"&&$!=="focusout",signal:C.signal};window.addEventListener($,D,j),so($,D,j,"window")}return window.addEventListener("blur",()=>V(1/0),{signal:C.signal}),so("blur",()=>setTimeout(()=>document.hasFocus()||V(1/0)),{signal:C.signal},"window"),document.addEventListener("visibilitychange",()=>{document.hidden&&V(1/0)},{signal:C.signal}),s.hidden=a[0].hidden=a[1].hidden=!0,Q(),e.signal.addEventListener("abort",()=>{te(!0),C.abort(),clearTimeout(h),cancelAnimationFrame(H),ue(!1),n.remove(),o.remove(),c.remove(),oe.remove(),v.remove()},{once:!0}),{render:Q,cancel:()=>te(!0),proposal:$=>(I.detach(),xN(U($))),moved:$=>U($).some(D=>D.move)}}var km,on,Za,_i,k2,S2,yN,CG,LG,Sm,C0,wm,gN,HG,bc,A0,vm,bN,zG,OG,M0,$G,EN=O(()=>{"use strict";ho();Li();um();mN();ea();km=e=>Math.round(e*100)/100,on=e=>`${km(e)}px`,Za=e=>parseFloat(e)||0,_i=(e,t)=>t.reduce((n,o)=>n+Za(e.getPropertyValue(o)),0),k2=["padding-left","padding-right","border-left-width","border-right-width"],S2=["padding-top","padding-bottom","border-top-width","border-bottom-width"],yN="img,video,canvas,iframe,embed,object",CG="input,select,textarea,button",LG=["flex","flex-grow","flex-shrink","flex-basis","max-width","max-height","min-width","min-height"],Sm=e=>e.parentElement??e.getRootNode().host??null,C0=e=>e.localName==="svg"&&Gu(e)&&!e.ownerSVGElement;wm="Wait for this element's animation to finish.",gN=400;HG=["n","s","e","w","nw","ne","sw","se"],bc=7,A0=8,vm=4,bN=24,zG=40,OG=4,M0=12,$G={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}});var AN={};Ft(AN,{bindInlineTextTools:()=>jG,canEditText:()=>SN,createInlineTextTools:()=>kN,createTextPreviewHistory:()=>Cy,startInlineTextEditor:()=>TN,textEditBlocker:()=>C2});function M2(e,t,n){n?Ya(n,e):e.firstChild?.nodeType===Node.TEXT_NODE&&!e.childElementCount&&(e.firstChild.data=t)}function kN(e){let t=Cy(),n=null,o=!1;function i(a=!1){let s=n;s&&(n=null,s.finish(a),t.resume(s.element),e.onChange())}async function r(a){let s=e.selected();if(n&&n.element===s){i();return}if(!s||!e.active()||o||n)return;let l=C2(s);if(l){e.status.textContent=l;return}o=!0,t.pause(s),e.status.textContent="Loading inline text editor\u2026",e.onChange();try{let c=await TN(s,{accent:getComputedStyle(e.button).getPropertyValue("--accent").trim()||"#bda6ef",async loadReactBridge(){return await Promise.resolve().then(()=>(x0(),y0))},onFinish(u,d){!d&&!u.reactProp&&u.before!==u.after?(t.record(u),e.onCommit(s),e.status.textContent="Text preview \xB7 resets on exit"):u.reactProp&&(e.status.textContent="React state preview \xB7 resets on exit")}});c?e.active()&&e.selected()===s?(n=c,a&&PG(s,a.clientX,a.clientY),e.status.textContent=s.hasAttribute("data-palette-text-prop")?"React state preview \xB7 resets on exit":"Editing text \xB7 preview only"):c.finish(!0):e.status.textContent="This text couldn't be connected to its component prop."}catch{e.status.textContent="Inline text editing is unavailable."}finally{o=!1,n||t.resume(s),e.onChange()}}return{get element(){return n?.element??null},get busy(){return o},isEditing(a){return!!n&&n.element===a},toggle:r,finish:i,handleKey(a){if(!n||!a.composedPath().includes(n.element)||!n.handleKey(a))return!1;let s=n.element;return i(a.key==="Escape"),s.blur(),!0},hasChanges(a){return t.original(a)!==void 0},undo(){let a=t.undo();return e.onChange(),a},redo(){let a=t.redo();return e.onChange(),a},reset(a){t.reset(a),e.onChange()},reconcile(a,s){t.reconcile(a,s),e.onChange()},proposal(a){return t.proposal(a)},restoreAll(){t.restoreAll()},showBefore:t.showBefore}}function jG(e){let t=kN(e);return e.button.addEventListener("click",n=>{t.toggle(n)}),t}function PG(e,t,n){let o=e.ownerDocument.caretPositionFromPoint?.(t,n),i=o?e.ownerDocument.createRange():e.ownerDocument.caretRangeFromPoint?.(t,n);if(o&&i&&i.setStart(o.offsetNode,o.offset),!i||!e.contains(i.startContainer))return;i.collapse(!0);let r=e.ownerDocument.getSelection();r?.removeAllRanges(),r?.addRange(i)}function C2(e){return e.matches("input,textarea,select")?"Form fields can't be edited as text.":e.matches("script,style,svg,canvas,video,audio,iframe")?"Graphics, media, and frames can't be edited.":e.closest("[data-private],[data-sensitive]")?"This text is marked private, so it stays read-only.":e.closest("[contenteditable]")?"This text is already editable on the page.":ta(e).some(([t])=>t.data.trim()&&!t.parentElement?.closest(ac))?null:"No text here. Double-click the text itself."}function SN(e){return!C2(e)}function BG(e){let t=e.textContent??"",n=e.ownerDocument.getSelection(),o=n?.rangeCount?n.getRangeAt(0):null;return!o||!e.contains(o.commonAncestorContainer)?-1:o.startContainer===e?Math.min([...e.childNodes].slice(0,o.startOffset).reduce((i,r)=>i+(r.textContent?.length??0),0),t.length):o.startContainer.nodeType===Node.TEXT_NODE?Math.min(o.startOffset,t.length):t.length}function VG(e,t){let n=e.firstChild,o=e.ownerDocument.getSelection();if(!n||!o)return;let i=e.ownerDocument.createRange();i.setStart(n,Math.min(t,n.textContent?.length??0)),i.collapse(!0),o.removeAllRanges(),o.addRange(i)}async function TN(e,t){if(!SN(e))return null;let n=null,o=null;if(e.dataset.paletteTextProp&&(n=await t.loadReactBridge(),o=n.beginReactTextEdit(e),!o))return null;let i=o?.before??(e.textContent??"").slice(0,500),r=!o&&e.childElementCount>0,a=o?void 0:ta(e),s=a?.map(([B,le])=>[B,le]),l=()=>{for(let B of s??[])B[1]=B[0].data},c=s?My(e,s):()=>{},u=["outline","outline-offset","box-shadow","white-space"].map(B=>$n(e,B)),d={role:e.getAttribute("role"),label:e.getAttribute("aria-label"),multiline:e.getAttribute("aria-multiline"),spellcheck:e.getAttribute("spellcheck")},p=new AbortController,g=!1,y=!1;function v(){e.removeAttribute("contenteditable"),e.removeAttribute("data-palette-inline-editing");for(let[B,le]of[["role",d.role],["aria-label",d.label],["aria-multiline",d.multiline],["spellcheck",d.spellcheck]])le===null?e.removeAttribute(B):e.setAttribute(B,le)}let x=-1,h=new MutationObserver(()=>{x>=0&&VG(e,x)}),m=()=>{l(),!(y||r)&&((e.textContent??"").length>500&&M2(e,(e.textContent??"").slice(0,500)),o&&n&&(x=BG(e),n.previewReactTextEdit(e,o.propName,e.textContent??"")||M2(e,i)))},b=null,E=!1,S=(B,le)=>{b&&(B=b),b=null;let J=SH(e,B,le);if(!J)return;l(),le.includes(`
374
+ `)}`:void 0}function vN(e){let t=new Map,n=new Map,o="";for(let i of e)if(o=i.layout,i.property){let r=n.get(i.property);n.delete(i.property),n.set(i.property,{...i,from:r?.from??i.from})}else if(i.move){let r=t.get(i.mode);t.set(i.mode,{...i,move:{...i.move,from:r?.move?.from??i.move.from}})}else{let r=t.get(i.mode);t.set(i.mode,{...i,dx:(r?.dx??0)+i.dx,dy:(r?.dy??0)+i.dy,effects:[...new Set([...r?.effects??[],...i.effects])]})}return{layout:o,moves:[...t.values()].filter(({move:i,dx:r,dy:a})=>i?i.from.parent!==i.to.parent||i.from.index!==i.to.index:km(r)||km(a)),sizes:[...n.values()].filter(i=>i.from!==i.to)}}function hN(e){let t=getComputedStyle(e),n=t.boxSizing==="border-box",o=Za(t.width),i=Za(t.height),r=C0(e)||e.matches(yN),a=t.aspectRatio&&t.aspectRatio!=="auto"?t.aspectRatio.replace(/^auto\s*/,""):"",s=u=>/px$/.test(t.getPropertyValue(`max-${u}`))&&Za(t.getPropertyValue(`max-${u}`))<=Za(t.getPropertyValue(`min-${u}`)),l=(r||a)&&i?o/i:0,c=!s("width")&&!s("height");return{css:t,border:n,width:o,height:i,replaced:r,aspect:a,ratio:l,borderWidth:o+(n?0:_i(t,k2)),borderHeight:i+(n?0:_i(t,S2)),axes:l?[c,c]:[!s("width"),!s("height")]}}function RG(e,{parent:t,kind:n,row:o},i,r){let a=[],s=[];if(!t)return{x:a,y:s};let l=n==="flow"||n==="flex"&&!o,c=n!=="flex"||!o,u=Pt(t),d=getComputedStyle(t),p=u.left+i*_i(d,["padding-left","border-left-width"]),g=u.right-i*_i(d,["padding-right","border-right-width"]),y=u.top+r*_i(d,["padding-top","border-top-width"]),v=u.bottom-r*_i(d,["padding-bottom","border-bottom-width"]);for(let x of[p,g,(p+g)/2])a.push({at:x,from:u.top,to:u.bottom});for(let x of l?[y]:[y,v,(y+v)/2])s.push({at:x,from:u.left,to:u.right});for(let x of[...t.children].slice(0,60)){let h=Pt(x);x===e||!h.width&&!h.height||(c&&a.push({at:h.left,from:h.top,to:h.bottom},{at:h.right,from:h.top,to:h.bottom}),l||s.push({at:h.top,from:h.left,to:h.right},{at:h.bottom,from:h.left,to:h.right}))}return{x:a,y:s}}function NG(e){let t=($,D,j)=>j.appendChild(Object.assign(document.createElement($),{className:D})),n=document.createElement("div");n.className="design-geometry";let o=document.createElement("style");o.textContent=`.design-geometry{--palette-sel:var(--palette-selection,var(--komo-selection,#0c93f5));position:fixed;inset:0;pointer-events:none;z-index:2}.design-geometry[hidden],.design-geometry [hidden],.design-geometry-note[hidden],.design-geometry-note [hidden]{display:none}.design-geometry:not([data-on])>*{display:none}.design-outline[data-kind=selected]:has(~.design-geometry[data-on]:not([hidden])){outline:0}:host(.design-active[data-palette-overlays-hidden]) :is(.design-geometry,.design-outline,.pins){visibility:hidden}.design-geometry>*{position:fixed;box-sizing:border-box}.design-geometry__frame{border:1px solid var(--palette-sel);outline:0}.design-geometry__frame:focus-visible{box-shadow:0 0 0 2px color-mix(in oklab,var(--palette-sel) 35%,transparent)}.design-geometry__frame,.design-geometry__handle{transition:opacity .12s ease}.design-geometry__handle{opacity:0;pointer-events:auto;touch-action:none}.design-geometry:is([data-near],[data-active],[data-focus]) .design-geometry__handle{opacity:1}.design-geometry[data-quiet] .design-geometry__handle{opacity:0;pointer-events:none}.design-geometry[data-quiet] .design-geometry__frame{opacity:.4}.design-geometry[data-preview] .design-geometry__frame{opacity:0}.design-geometry__handle::before{content:'';position:absolute;left:var(--x);top:var(--y);width:${bc}px;height:${bc}px;box-sizing:border-box;border-radius:1px;background:#fff;border:1px solid var(--palette-sel);box-shadow:0 1px 2px #0000001f}.design-geometry__handle:hover::before,.design-geometry__handle[data-active]::before{background:var(--palette-sel)}.design-geometry__handle[data-small]::before{display:none}[data-handle=n],[data-handle=s]{cursor:ns-resize}[data-handle=e],[data-handle=w]{cursor:ew-resize}[data-handle=nw],[data-handle=se]{cursor:nwse-resize}[data-handle=ne],[data-handle=sw]{cursor:nesw-resize}.design-geometry__guide{background:var(--palette-selection,var(--komo-selection,#0c93f5))}.design-geometry__readout{translate:-50% 0;padding:2px 6px;border-radius:4px;background:var(--palette-sel);color:#fff;font:500 11px/16px system-ui,sans-serif;font-variant-numeric:tabular-nums;white-space:nowrap;box-shadow:0 1px 3px #0003}.design-geometry[data-dragging] :is(.design-geometry__handle,.design-geometry__guide){display:none}.design-geometry__line{background:var(--palette-sel);border-radius:1px}.design-geometry__drop{border:2px dashed var(--palette-sel);border-radius:4px}.design-geometry__chip{translate:none}@media (prefers-reduced-motion:reduce){.design-geometry__frame,.design-geometry__handle{transition:none}}.design-geometry-note{display:grid;gap:8px;padding:0 12px 12px;color:#a19d97;font-size:11px;line-height:1.45}.design-geometry-note p{margin:0}.design-geometry-note div{display:flex;flex-wrap:wrap;gap:6px}.design-geometry-note button{height:24px;padding:0 8px;border-radius:6px;background:#ffffff0f;color:#e9e6e1;font-size:11px}.design-geometry-note button:hover{background:#ffffff1a}.design-geometry-note button[aria-pressed=true]{background:color-mix(in oklab,var(--accent,#bda6ef) 32%,transparent)}.design-inspector__eye{display:grid;place-items:center;flex:none;min-width:28px;height:28px;border-radius:7px;color:#909090}.design-inspector__eye:hover{background:#161616;color:#eee}.design-inspector__eye svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.3}.design-geometry-wait{order:1;width:5px;height:5px;margin-left:4px;border-radius:50%;background:#e7c27d;opacity:.7}`;let i=t("div","design-geometry__frame",n);i.tabIndex=0,i.setAttribute("role","group"),i.setAttribute("aria-roledescription","selection");let r=HG.map($=>{let D=t("div","design-geometry__handle",n);return D.dataset.handle=$,D.setAttribute("aria-hidden","true"),{name:$,handle:D,ex:$.includes("e")?1:$.includes("w")?-1:0,ey:$.includes("s")?1:$.includes("n")?-1:0}}),a=[t("div","design-geometry__guide",n),t("div","design-geometry__guide",n)],s=t("div","design-geometry__readout",n);s.setAttribute("aria-hidden","true");let l=$=>n.dispatchEvent(new CustomEvent("palette-announce",{detail:$,bubbles:!0,composed:!0})),c=document.createElement("div");c.className="design-geometry-note",c.title=Xf;let u=t("p","",c),d=t("div","",c),p=$=>Object.assign(t("button","",d),{type:"button",textContent:$}),g=p("Select parent"),y=p("Snap to grid tracks");y.setAttribute("aria-pressed","false"),y.title="Resize changes grid-column-end / grid-row-end spans instead of width and height";let v=t("i","design-geometry-wait",c);v.title=wm,v.setAttribute("role","img"),v.setAttribute("aria-label",wm);let x=0,h=0;e.options.root.append(o,n);let m,b=null,E=!1,S=[!1,!1],A=null,_={x:-1e4,y:-1e4},T=[],H=0,R=!1,z,F=e.options.visibility,B=F?` (${Jr(F).keys.join(po()?"":"+")})`:"",le=po()?"Meta":"Control",J=($,D)=>($=["Control","Alt","Shift","Meta"].filter(j=>$.includes(j)),po()?`${$.map(j=>({Alt:"\u2325",Shift:"\u21E7",Meta:"\u2318"})[j]).join("")}${D.length>3?" ":""}${D}`:`${$.map(j=>j==="Control"?"Ctrl":j).join("+")}+${D}`),V=$=>{z&&$-z.at>350&&ue(z.was),z=void 0},oe=Object.assign(document.createElement("button"),{type:"button",className:"design-inspector__eye"});function ue($){R=$,e.options.host.toggleAttribute("data-palette-overlays-hidden",$),oe.setAttribute("aria-pressed",String($)),oe.setAttribute("aria-label",oe.title=`${$?"Show":"Hide"} selection${B}`),oe.innerHTML=`<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M1.5 8s2.4-4.5 6.5-4.5S14.5 8 14.5 8 12.1 12.5 8 12.5 1.5 8 1.5 8z"/><circle cx="8" cy="8" r="2"/>${$?'<path d="M2.5 13.5l11-11"/>':""}</svg>`}ue(!1);let q=e.options.design?.selectionColor;q&&e.options.host.style.setProperty("--palette-selection",q),oe.addEventListener("click",()=>ue(!R));function Y(){let $=e.options.root,D=e.panel().closest(".design-inspector"),j=$.activeElement,X=$.querySelector(".palette-select:popover-open,.palette-tokens:popover-open"),fe=!!j&&!!D?.contains(j)&&j.matches("input,textarea,select,[contenteditable]");n.toggleAttribute("data-quiet",!m&&(!!X||fe||!!$.querySelector(".palette-color")||!!D&&T.includes(D))),n.toggleAttribute("data-preview",!!X&&T.includes(X)),n.toggleAttribute("data-near",!!A&&_.x>A.left-M0&&_.x<A.right+M0&&_.y>A.top-M0&&_.y<A.bottom+M0),n.toggleAttribute("data-active",!!m||n.hasAttribute("data-dragging")),n.toggleAttribute("data-focus",j===i)}let W=()=>{H||(H=requestAnimationFrame(()=>{H=0,Y()}))},C=new AbortController,U=$=>e.history.reduce((D,j)=>j.element!==$?D:j.geometry?[...D,...j.geometry]:j.property?D.filter(X=>X.property!==j.property):D,[]),I=fN({signal:C.signal,host:e.options.host,targetAt:e.options.targetAt,history:e.history,selected:e.selected,pick:e.pick,enabled:e.enabled,before:e.before,remember:e.remember,track:e.track,update:e.update,component:$=>e.tokens()?.designContext($,e.options.design).find(D=>D.startsWith("Component: "))?.slice(11).replace(/ \(.*\)$/,""),layout:$=>E2($).label,announce:l,drag($){n.toggleAttribute("data-dragging",!!$),i.style.translate=$?`${$[0]}px ${$[1]}px`:""}});n.append(...I.nodes);let G=$=>$.map(D=>`${D.property} ${D.to}`).join(", ");function te($=!1){let D=m;if(!D)return;m=void 0;let{element:j,before:X}=D,fe=new Map([...X.keys()].map(De=>[De,[j.style.getPropertyValue(De),j.style.getPropertyPriority(De)]]));for(let[De,[Ce,Pe]]of fe)Ce===X.get(De).value&&Pe===X.get(De).priority&&fe.delete(De);let ye=()=>[...X.values()].reverse().forEach(De=>De.restore());if(ri(j,X.keys(),ye),ye(),!$&&fe.size){let De=[];for(let Ce of fe.keys())e.remember(j,Ce);ri(j,fe.keys(),()=>{for(let[Ce,[Pe]]of fe){let Ne=e.tokens()?.noteDesignTokenOverride(j,Ce,Pe);De.push(Ne?.undo),j.style.setProperty(Ce,Pe,Ne?.priority??X.get(Ce).priority),e.track(j,Ce)}}),e.history.push({element:j,geometry:D.changes,undo(){ri(j,X.keys(),()=>{ye(),De.reverse().forEach(Ce=>Ce?.());for(let Ce of X.keys())e.tokens()?.syncDesignTokenBinding(j,Ce),e.track(j,Ce)}),ye()},redo(){ri(j,fe.keys(),()=>{for(let[Ce,[Pe,Ne]]of fe)j.style.setProperty(Ce,Pe,Ne),e.tokens()?.syncDesignTokenBinding(j,Ce),e.track(j,Ce)})}}),l(`Resized: ${G(D.changes)}`)}D.pointer!==void 0&&D.source.hasPointerCapture(D.pointer)&&D.source.releasePointerCapture(D.pointer),D.source.removeAttribute("data-active"),s.hidden=a[0].hidden=a[1].hidden=!0,e.update(),Q()}function ie($,D,j,X,fe){te(!0);let ye=e.selected();if(!e.enabled()||!ye||Em(ye)||ye===b)return;let De=hN(ye),{css:Ce,width:Pe,height:Ne,borderWidth:Le,borderHeight:Ie,border:ut,replaced:ct,aspect:de,ratio:Ae}=De;if(!De.axes[$===2?1:0]||!De.axes[$===1?0:1])return;let ve=Pt(ye),Re=E2(ye),Fe=E&&Re.kind==="grid",Ye={},$e=Re.parentStyle,ot=Re.parent&&Pt(Re.parent),rn=(K,ce)=>["stretch","normal"].includes(K==="auto"?ce:K)&&!ct&&!de,Zt=(K,ce)=>Math.abs((K?ve.width+_i(Ce,["margin-left","margin-right"])*ve.width/Le:ve.height+_i(Ce,["margin-top","margin-bottom"])*ve.height/Ie)-ce)<1.5,Ht;if(Re.kind==="flex"&&ot&&$e&&rn(Ce.alignSelf,$e.alignItems)){let K=Re.row?ve.height/Ie:ve.width/Le,ce=Re.row?ot.height-K*_i($e,S2):ot.width-K*_i($e,k2);Zt(!Re.row,ce)&&(Ye[Re.row?"height":"width"]="align-self")}Re.kind==="grid"&&$e&&(Ht=[!0,!1].map(K=>{let ce=DG(Re.parent,$e,K),_e=(K?ve.left:ve.top)-ce.origin,et=(K?ve.right:ve.bottom)-ce.origin,Ve=0;ce.starts.forEach((Ct,ht)=>{Math.abs(Ct*ce.scale-_e)<Math.abs(ce.starts[Ve]*ce.scale-_e)&&(Ve=ht)});let gt=A2(ce.starts,ce.ends,ce.gap,ce.size,Ve,et/ce.scale)+Ve-1;return(K?rn(Ce.justifySelf,$e.justifyItems):rn(Ce.alignSelf,$e.alignItems))&&ce.ends.length&&Zt(K,((ce.ends[gt]??ce.ends.at(-1))-ce.starts[Ve])*ce.scale)&&(Ye[K?"width":"height"]=K?"justify-self":"align-self"),{...ce,start:Ve,edge:et/ce.scale,from:K?Ce.gridColumnEnd:Ce.gridRowEnd}}));let pt=Fe?["grid-column-end","grid-row-end"]:["width","height","flex-basis","flex-grow","flex-shrink"],Qt=ve.width/Le,Mn=ve.height/Ie;m={element:ye,kind:$,ex:D,ey:j,source:X,pointer:fe?.pointerId,x:fe?.clientX??0,y:fe?.clientY??0,dx:0,dy:0,sx:Qt,sy:Mn,width:Pe,height:Ne,start:{left:ve.left,top:ve.top,right:ve.right,bottom:ve.bottom,width:ve.width,height:ve.height},rect:ve,layout:Re,snap:Fe,ratio:Ae,lock:!1,stretch:Ye,grid:Ht,lines:RG(ye,Re,Qt,Mn),css:Object.fromEntries(LG.map(K=>[K,Ce.getPropertyValue(K)])),ratioText:de||`${km(Pe)} / ${km(Ne)}`,minWidth:ut?Math.max(16,_i(Ce,k2)):16,minHeight:ut?Math.max(16,_i(Ce,S2)):16,changes:[],before:new Map(pt.map(K=>[K,$n(ye,K)]))}}function pe($,D,j,X){$.changes=[];for(let fe of[!0,!1]){if($.kind===(fe?2:1))continue;let ye=$.grid[fe?0:1];if(!ye.ends.length)return!1;let De=A2(ye.starts,ye.ends,ye.gap,ye.size,ye.start,ye.edge+(fe?D:j)/ye.scale),Ce=fe?"grid-column-end":"grid-row-end";X(Ce,`span ${De}`),$.changes.push({mode:"span",layout:$.layout.label,property:Ce,from:ye.from,to:`span ${De}`,effects:[`spans ${De} ${fe?"column":"row"} track${De>1?"s":""}`]})}return!0}function xe($,D,j,X){let{element:fe,kind:ye,layout:De,css:Ce}=$,Pe=$.ratio||($.lock?$.width/$.height:0),Ne=$.width+D/$.sx,Le=$.height+j/$.sy;if(Pe){ye===1||ye===3&&Math.abs(D/$.sx)/$.width>=Math.abs(j/$.sy)/$.height?Le=Ne/Pe:Ne=Le*Pe;let ve=Math.max(1,$.minWidth/Ne,$.minHeight/Le);Ne*=ve,Le*=ve}else Ne=Math.max($.minWidth,Ne),Le=Math.max($.minHeight,Le);let Ie=new Map([...Pe||ye!==2?[["width",Ne]]:[],...Pe||ye!==1?[["height",Le]]:[]]),ut=new Map([...Ie.keys()].map(ve=>[ve,[]])),ct=De.kind==="flex"&&De.position!=="absolute"&&De.position!=="fixed"?De.row?"width":"height":"",de=!!ct&&Ie.has(ct)&&Ce["flex-basis"]!=="auto",Ae=Ce["flex-grow"]!=="0";for(let[ve,Re]of Ie)X(ve,on(Re));if(ct&&Ie.has(ct)){let ve=ut.get(ct);(de||Ae)&&ve.push(`${ct} overrides flex: ${Ce.flex||`${Ce["flex-grow"]} ${Ce["flex-shrink"]} ${Ce["flex-basis"]}`}`),de&&(X("flex-basis",on(Ie.get(ct))),ve.push(`sets flex-basis: ${on(Ie.get(ct))}`)),Ae&&(X("flex-grow","0"),ve.push("sets flex-grow: 0")),Za(getComputedStyle(fe).getPropertyValue(ct))<Ie.get(ct)-.5&&Ce["flex-shrink"]!=="0"&&(X("flex-shrink","0"),ve.push("sets flex-shrink: 0"))}for(let[ve,Re]of Ie){let Fe=ut.get(ve),Ye=Za(getComputedStyle(fe).getPropertyValue(ve));if($.stretch[ve]&&Fe.push(`${ve} overrides ${$.stretch[ve]}: stretch`),$.ratio&&Fe.length<9&&ve===(ye===2?"height":"width")&&Fe.push(`keeps aspect ratio ${$.ratioText}`),Math.abs(Ye-Re)>.5){let $e=Ce[`${Ye<Re?"max":"min"}-${ve}`];Fe.push(Ye<Re?`limited by ${$e!=="none"?`max-${ve}: ${$e}`:"its container"}`:`held at ${["auto","0px"].includes($e)?"its content size":`min-${ve}: ${$e}`}`),Ie.set(ve,Ye),X(ve,on(Ye)),ve===ct&&de&&X("flex-basis",on(Ye))}}return $.changes=[...Ie].map(([ve,Re])=>({mode:ve===ct&&de?"flex-basis":"size",layout:De.label,property:ve,from:on(ve==="width"?$.width:$.height),to:on(Re),effects:ut.get(ve)})),!0}function L($,D,j=!0){let X=m;if(!X)return;if(!e.enabled()||e.selected()!==X.element||Em(X.element)){te(!0);return}let{element:fe,before:ye,start:De,kind:Ce}=X,Pe=(Ae,ve)=>{X.dx=Ae,X.dy=ve;let Re=!0;return ri(fe,ye.keys(),()=>{let Fe=(Ye,$e)=>fe.style.setProperty(Ye,$e,ye.get(Ye).priority);for(let[Ye,$e]of ye)fe.style.setProperty(Ye,$e.value,$e.priority);Re=(X.snap?pe:xe)(X,Ae*X.ex,ve*X.ey,Fe)}),Re};if(!Pe($,D)){b=fe,te(!0);return}let Ne=Pt(fe),Le=Ae=>Ae?[[Ne.left,Ne.left-De.left],[Ne.right,Ne.right-De.right]]:[[Ne.top,Ne.top-De.top],[Ne.bottom,Ne.bottom-De.bottom]],Ie=!j&&!X.snap,ut=Ae=>{let ve=Ae?Ne.width-De.width:Ne.height-De.height,Re=0,Fe=OG;if(Ie&&Ce&(Ae?1:2)&&Math.abs(ve)>.5){for(let[Ye,$e]of Le(Ae))if(Math.abs($e)>.5&&Math.abs($e)>=Math.abs(ve)/3)for(let ot of X.lines[Ae?"x":"y"])Math.abs(ot.at-Ye)<=Fe&&(Fe=Math.abs(ot.at-Ye),Re=(ot.at-Ye)*ve/$e)}return Re},ct=ut(!0),de=ut(!1);(ct||de)&&(Pe($+ct*X.ex,D+de*X.ey),Ne=Pt(fe)),a.forEach((Ae,ve)=>{let Re=!ve;if(Ae.hidden=!0,Ie&&Ce&(Re?1:2))for(let[Fe,Ye]of Le(Re)){let $e=Math.abs(Ye)>.5&&Math.abs(Ye)>=Math.abs(Re?Ne.width-De.width:Ne.height-De.height)/3&&X.lines[Re?"x":"y"].find(Zt=>Math.abs(Zt.at-Fe)<.75);if(!$e)continue;let ot=Math.min($e.from,Re?Ne.top:Ne.left),rn=Math.max($e.to,Re?Ne.bottom:Ne.right);Ae.hidden=!1,Object.assign(Ae.style,Re?{left:on($e.at),top:on(ot),width:"1px",height:on(rn-ot)}:{left:on(ot),top:on($e.at),width:on(rn-ot),height:"1px"})}}),X.rect=Ne,s.textContent=`${Math.round(Ne.width/X.sx)} \xD7 ${Math.round(Ne.height/X.sy)}`,s.hidden=!1,Q()}function Q(){I.sync();let $=e.selected(),D=e.enabled()&&!!$?.isConnected;if(n.hidden=!D,n.removeAttribute("data-on"),A=null,c.hidden=!$?.isConnected,v.hidden=!0,D||te(!0),!$?.isConnected)return;$!==b&&(b=null);let j=I.shown($),X=j!==$,fe=X?null:Em($),ye=fe===wm,De=performance.now();x=ye?x||De:0,clearTimeout(h),ye&&(h=window.setTimeout(Q,gN));let Ce=ye&&De-x>=gN,Pe=ye||X?null:fe??(b?"Host styles override this preview. Select the parent or another element.":null),Ne=ym($,j);(Pe||X||ye)&&m&&te(!0);let Le=e.panel(),Ie=[...Le.querySelectorAll(".design-section")].find(Ze=>Ze.querySelector("summary")?.textContent==="Layout")??Le;c.parentElement!==Ie&&Ie.append(c);let ut=Ie!==Le&&Ie.querySelector("summary");ut&&v.parentElement!==ut&&ut.append(v),v.hidden=!Ce;let ct=Pe||Ne?T2($):null;g.hidden=!ct,ct&&g.setAttribute("aria-label",`Select movable parent ${ct.tagName.toLowerCase()}`),y.hidden=!!Pe||X||E2($).kind!=="grid",y.setAttribute("aria-pressed",String(E));let{moves:de,sizes:Ae}=vN(U($)),ve=de.flatMap(Ze=>Ze.move?[w2(Ze.move)[0].slice(2)]:[]),Re=!0;try{Re=!!localStorage.getItem("palette:geometry-moved")}catch{}u.textContent=[Pe,Ne].filter(Boolean).join(" \xB7 ")||[...new Set([...ve,...[...m?.changes??[],...de,...Ae].flatMap(Ze=>Ze.effects)])].join(" \xB7 ")||(Re||X?"":"Drag to reorder \xB7 M, then \u2325\u2191/\u2325\u2193");let Fe=Le.closest(".design-inspector")?.querySelector(".design-inspector__heading");Fe&&oe.parentElement!==Fe&&Fe.querySelector(".design-inspector__fold")?.before(oe),u.hidden=!u.textContent,c.hidden=u.hidden&&g.hidden&&y.hidden;let Ye=Pt(j),$e=e.options.bounds?.(j)??{left:0,top:0,right:innerWidth,bottom:innerHeight};if((Pe||Ce)&&Ne||!D||Ye.right<=$e.left||Ye.left>=$e.right||Ye.bottom<=$e.top||Ye.top>=$e.bottom)return;n.setAttribute("data-on","");let ot=hN($);S=Pe||X||Ce?[!1,!1]:ot.axes;let rn=`${$.tagName.toLowerCase()}${$.id?`#${$.id}`:""}`;i.setAttribute("aria-label",`${Ne?"Resize":"Move or resize"} ${rn}: ${Ne?"":`${J(["Alt"],"\u2191/\u2193")} move, ${J(["Alt","Shift"],"\u2191/\u2193")} move out or into, `}${J([le],"arrows")} resize, ${J(["Shift",le],"arrows")} by 10px`);let Zt=devicePixelRatio||1,Ht=Ze=>Math.round(Ze*Zt)/Zt,pt=Ht(Ye.left),Qt=Ht(Ye.top),Mn=Ht(Ye.right),K=Ht(Ye.bottom);A={left:pt,top:Qt,right:Mn,bottom:K};let ce=(Ze,Et)=>getComputedStyle(Ze)[Et].match(/[\d.]+/g)?.map(Number)??[],[_e,et]=[ce(j,"backgroundColor"),ce(a[0],"backgroundColor")];n.style.setProperty("--palette-sel",_e.length>2&&(_e[3]??1)>.5&&Math.hypot(_e[0]-et[0],_e[1]-et[1],_e[2]-et[2])<90?"#e5359b":""),Object.assign(i.style,{left:on(pt),top:on(Qt),width:on(Mn-pt),height:on(K-Qt),clipPath:`inset(${[$e.top-Qt,Mn-$e.right,K-$e.bottom,$e.left-pt].map(Ze=>on(Math.max(0,Ze))).join(" ")})`});let Ve=Mn-pt<bN||K-Qt<bN,gt=Ve?0:vm,Ct=A0+vm-gt,ht=S[0]&&S[1],Gt=(Ze,Et,Pn)=>Pn<0?Ze+.5:Pn>0?Et-.5:Ht((Ze+Et)/2)+.5,wt=(Ze,Et,Pn)=>Pn<0?[Ze-Ct,Ze+gt]:Pn>0?[Et-gt,Et+Ct]:Et-Ze-2*gt>=A0+vm?[Ze+gt,Et-gt]:[(Ze+Et-A0-vm)/2,(Ze+Et+A0+vm)/2];for(let{handle:Ze,ex:Et,ey:Pn}of r){let ir=Gt(pt,Mn,Et),li=Gt(Qt,K,Pn),ci=!Et||!Pn,[rr,Di]=wt(pt,Mn,Et),[_o,ar]=wt(Qt,K,Pn);Ze.hidden=(ci?!S[Et?0:1]||!!ot.ratio:!ht)||ir<$e.left||ir>$e.right||li<$e.top||li>$e.bottom,Ze.toggleAttribute("data-small",Ve||ci&&ht&&(Et?K-Qt:Mn-pt)<zG),Object.assign(Ze.style,{left:on(rr),top:on(_o),width:on(Di-rr),height:on(ar-_o)}),Ze.style.setProperty("--x",on(ir-bc/2-rr)),Ze.style.setProperty("--y",on(li-bc/2-_o))}let jn=K+bc+30<$e.bottom;Object.assign(s.style,{left:on(Math.max($e.left+40,Math.min($e.right-40,(pt+Mn)/2))),top:on(jn?K+bc+4:Qt-bc-24)}),Y()}g.addEventListener("click",()=>{let $=e.selected(),D=$&&T2($);D&&e.select(D)}),y.addEventListener("click",()=>{te(!0),E=!E,Q()});for(let{handle:$,ex:D,ey:j}of r){let X=(D?1:0)+(j?2:0);$.addEventListener("pointerdown",fe=>{fe.button===0&&(fe.preventDefault(),fe.stopPropagation(),ie(X,D,j,$,fe),$.toggleAttribute("data-active",!!m),Y(),m&&$.setPointerCapture(fe.pointerId))}),$.addEventListener("pointermove",fe=>{m?.pointer===fe.pointerId&&(m.lock=fe.shiftKey&&X===3,L(fe.clientX-m.x,fe.clientY-m.y,fe.altKey))}),$.addEventListener("pointerup",()=>te()),$.addEventListener("pointercancel",()=>te(!0)),$.addEventListener("lostpointercapture",()=>te(!0)),$.addEventListener("click",fe=>{fe.preventDefault(),fe.stopPropagation()})}i.addEventListener("blur",()=>{m?.keyboard&&te()});let Z=$=>{let D=$G[$.key],j=$.composedPath(),X=j[0]===i,fe=!$.altKey&&!$.ctrlKey&&!$.metaKey&&!$.shiftKey,ye=j.some(ut=>Kn(ut)&&ut.matches("input,textarea,select,[contenteditable]:not([contenteditable=false])")),De=F;if(De&&!ye&&e.options.host.classList.contains("design-active")&&$.key.toLowerCase()===De.key&&$.shiftKey===De.shift&&$.altKey===De.alt&&$.ctrlKey===De.ctrl&&$.metaKey===De.meta){$.preventDefault(),$.stopImmediatePropagation(),$.repeat||(z={at:$.timeStamp,was:R},ue(!R));return}let Ce=e.selected(),Pe;if(!m&&X&&$.key==="Escape"?Pe=()=>i.blur():fe&&$.key.toLowerCase()==="m"&&!X&&!ye&&!j.includes(e.options.host)&&n.hasAttribute("data-on")&&!e.options.reservedKey?.($)?Pe=()=>i.focus({preventScroll:!0}):X&&D&&Ce&&$.altKey&&!$.ctrlKey&&!$.metaKey&&!m&&(Pe=()=>I.key(Ce,D[0]+D[1]>0,$.shiftKey)),Pe){$.preventDefault(),$.stopImmediatePropagation(),Pe();return}if(!($.key==="Escape"&&m)&&(!X||!D||!($.ctrlKey||$.metaKey)||$.altKey))return;if($.preventDefault(),$.stopImmediatePropagation(),!D)return te(!0);let Ne=D[0]?1:2;if(m&&m.kind!==Ne&&te(),!m&&S[Ne-1]&&ie(Ne,1,1,i),!m)return;m.keyboard=!0;let Le=m.grid?.[Ne-1],Ie=m.snap?(Le.size+Le.gap)*Le.scale:($.shiftKey?10:1)*(Ne===1?m.sx:m.sy);L(m.dx+D[0]*Ie,m.dy+D[1]*Ie)};window.addEventListener("keydown",Z,{capture:!0,signal:C.signal}),so("keydown",Z,{capture:!0,signal:C.signal},"window");let se=$=>{z&&F&&($.key.toLowerCase()===F.key||{Shift:F.shift,Alt:F.alt,Control:F.ctrl,Meta:F.meta}[$.key])&&V($.timeStamp),m?.keyboard&&/^(Arrow|Control|Meta)/.test($.key)&&te()};window.addEventListener("keyup",se,{capture:!0,signal:C.signal}),so("keyup",se,{capture:!0,signal:C.signal},"window");let we=()=>{if(m?.pointer!==void 0){let $=Pt(m.element),D=$.left-m.rect.left,j=$.top-m.rect.top;m.x+=D,m.y+=j;for(let X of["left","right"])m.start[X]+=D;for(let X of["top","bottom"])m.start[X]+=j;for(let X of m.lines.x)X.at+=D,X.from+=j,X.to+=j;for(let X of m.lines.y)X.at+=j,X.from+=D,X.to+=D;L(m.dx-D,m.dy-j)}Q()},Te=$=>{_=Vi($),T=$.composedPath(),W()};for(let[$,D]of[["scroll",we],["pointermove",Te],["focusin",W],["focusout",W]]){let j={capture:!0,passive:$!=="focusin"&&$!=="focusout",signal:C.signal};window.addEventListener($,D,j),so($,D,j,"window")}return window.addEventListener("blur",()=>V(1/0),{signal:C.signal}),so("blur",()=>setTimeout(()=>document.hasFocus()||V(1/0)),{signal:C.signal},"window"),document.addEventListener("visibilitychange",()=>{document.hidden&&V(1/0)},{signal:C.signal}),s.hidden=a[0].hidden=a[1].hidden=!0,Q(),e.signal.addEventListener("abort",()=>{te(!0),C.abort(),clearTimeout(h),cancelAnimationFrame(H),ue(!1),n.remove(),o.remove(),c.remove(),oe.remove(),v.remove()},{once:!0}),{render:Q,cancel:()=>te(!0),proposal:$=>(I.detach(),xN(U($))),moved:$=>U($).some(D=>D.move)}}var km,on,Za,_i,k2,S2,yN,CG,LG,Sm,C0,wm,gN,HG,bc,A0,vm,bN,zG,OG,M0,$G,EN=O(()=>{"use strict";ho();Li();um();mN();ea();km=e=>Math.round(e*100)/100,on=e=>`${km(e)}px`,Za=e=>parseFloat(e)||0,_i=(e,t)=>t.reduce((n,o)=>n+Za(e.getPropertyValue(o)),0),k2=["padding-left","padding-right","border-left-width","border-right-width"],S2=["padding-top","padding-bottom","border-top-width","border-bottom-width"],yN="img,video,canvas,iframe,embed,object",CG="input,select,textarea,button",LG=["flex","flex-grow","flex-shrink","flex-basis","max-width","max-height","min-width","min-height"],Sm=e=>e.parentElement??e.getRootNode().host??null,C0=e=>e.localName==="svg"&&Gu(e)&&!e.ownerSVGElement;wm="Wait for this element's animation to finish.",gN=400;HG=["n","s","e","w","nw","ne","sw","se"],bc=7,A0=8,vm=4,bN=24,zG=40,OG=4,M0=12,$G={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}});var AN={};Ft(AN,{bindInlineTextTools:()=>jG,canEditText:()=>SN,createInlineTextTools:()=>kN,createTextPreviewHistory:()=>Cy,startInlineTextEditor:()=>TN,textEditBlocker:()=>C2});function M2(e,t,n){n?Ya(n,e):e.firstChild?.nodeType===Node.TEXT_NODE&&!e.childElementCount&&(e.firstChild.data=t)}function kN(e){let t=Cy(),n=null,o=!1;function i(a=!1){let s=n;s&&(n=null,s.finish(a),t.resume(s.element),e.onChange())}async function r(a){let s=e.selected();if(n&&n.element===s){i();return}if(!s||!e.active()||o||n)return;let l=C2(s);if(l){e.status.textContent=l;return}o=!0,t.pause(s),e.status.textContent="Loading inline text editor\u2026",e.onChange();try{let c=await TN(s,{accent:getComputedStyle(e.button).getPropertyValue("--accent").trim()||"#bda6ef",async loadReactBridge(){return await Promise.resolve().then(()=>(x0(),y0))},onFinish(u,d){!d&&!u.reactProp&&u.before!==u.after?(t.record(u),e.onCommit(s),e.status.textContent="Text preview \xB7 resets on exit"):u.reactProp&&(e.status.textContent="React state preview \xB7 resets on exit")}});c?e.active()&&e.selected()===s?(n=c,a&&PG(s,a.clientX,a.clientY),e.status.textContent=s.hasAttribute("data-palette-text-prop")?"React state preview \xB7 resets on exit":"Editing text \xB7 preview only"):c.finish(!0):e.status.textContent="This text couldn't be connected to its component prop."}catch{e.status.textContent="Inline text editing is unavailable."}finally{o=!1,n||t.resume(s),e.onChange()}}return{get element(){return n?.element??null},get busy(){return o},isEditing(a){return!!n&&n.element===a},toggle:r,finish:i,handleKey(a){if(!n||!a.composedPath().includes(n.element)||!n.handleKey(a))return!1;let s=n.element;return i(a.key==="Escape"),s.blur(),!0},hasChanges(a){return t.original(a)!==void 0},undo(){let a=t.undo();return e.onChange(),a},redo(){let a=t.redo();return e.onChange(),a},reset(a){t.reset(a),e.onChange()},reconcile(a,s){t.reconcile(a,s),e.onChange()},proposal(a){return t.proposal(a)},restoreAll(){t.restoreAll()},showBefore:t.showBefore}}function jG(e){let t=kN(e);return e.button.addEventListener("click",n=>{t.toggle(n)}),t}function PG(e,t,n){let o=e.ownerDocument.caretPositionFromPoint?.(t,n),i=o?e.ownerDocument.createRange():e.ownerDocument.caretRangeFromPoint?.(t,n);if(o&&i&&i.setStart(o.offsetNode,o.offset),!i||!e.contains(i.startContainer))return;i.collapse(!0);let r=e.ownerDocument.getSelection();r?.removeAllRanges(),r?.addRange(i)}function C2(e){return e.matches("input,textarea,select")?"Form fields can't be edited as text.":e.matches("script,style,svg,canvas,video,audio,iframe")?"Graphics, media, and frames can't be edited.":e.closest("[data-private],[data-sensitive]")?"This text is marked private, so it stays read-only.":e.closest("[contenteditable]")?"This text is already editable on the page.":ta(e).some(([t])=>t.data.trim()&&!t.parentElement?.closest(ac))?null:"No text here. Double-click the text itself."}function SN(e){return!C2(e)}function BG(e){let t=e.textContent??"",n=e.ownerDocument.getSelection(),o=n?.rangeCount?n.getRangeAt(0):null;return!o||!e.contains(o.commonAncestorContainer)?-1:o.startContainer===e?Math.min([...e.childNodes].slice(0,o.startOffset).reduce((i,r)=>i+(r.textContent?.length??0),0),t.length):o.startContainer.nodeType===Node.TEXT_NODE?Math.min(o.startOffset,t.length):t.length}function VG(e,t){let n=e.firstChild,o=e.ownerDocument.getSelection();if(!n||!o)return;let i=e.ownerDocument.createRange();i.setStart(n,Math.min(t,n.textContent?.length??0)),i.collapse(!0),o.removeAllRanges(),o.addRange(i)}async function TN(e,t){if(!SN(e))return null;let n=null,o=null;if(e.dataset.paletteTextProp&&(n=await t.loadReactBridge(),o=n.beginReactTextEdit(e),!o))return null;let i=o?.before??(e.textContent??"").slice(0,500),r=!o&&e.childElementCount>0,a=o?void 0:ta(e),s=a?.map(([B,le])=>[B,le]),l=()=>{for(let B of s??[])B[1]=B[0].data},c=s?My(e,s):()=>{},u=["outline","outline-offset","box-shadow","white-space"].map(B=>$n(e,B)),d={role:e.getAttribute("role"),label:e.getAttribute("aria-label"),multiline:e.getAttribute("aria-multiline"),spellcheck:e.getAttribute("spellcheck")},p=new AbortController,g=!1,y=!1;function v(){e.removeAttribute("contenteditable"),e.removeAttribute("data-palette-inline-editing");for(let[B,le]of[["role",d.role],["aria-label",d.label],["aria-multiline",d.multiline],["spellcheck",d.spellcheck]])le===null?e.removeAttribute(B):e.setAttribute(B,le)}let x=-1,h=new MutationObserver(()=>{x>=0&&VG(e,x)}),m=()=>{l(),!(y||r)&&((e.textContent??"").length>500&&M2(e,(e.textContent??"").slice(0,500)),o&&n&&(x=BG(e),n.previewReactTextEdit(e,o.propName,e.textContent??"")||M2(e,i)))},b=null,E=!1,S=(B,le)=>{b&&(B=b),b=null;let J=SH(e,B,le);if(!J)return;l(),le.includes(`
375
375
  `)&&(E=!0),le.endsWith(`
376
376
  `)&&(b=new StaticRange({startContainer:J.startContainer,endContainer:J.endContainer,startOffset:J.startOffset,endOffset:J.endOffset}));let V=e.ownerDocument.getSelection();V?.removeAllRanges(),V?.addRange(J)},A=B=>{if(x=-1,y||B.isComposing||B.inputType==="insertCompositionText")return;if(B.inputType==="insertLineBreak"||B.inputType==="insertParagraph"){B.preventDefault();let V=e.ownerDocument.getSelection(),oe=B.getTargetRanges()[0]??(V?.rangeCount?V.getRangeAt(0):null);oe&&S(oe,`
377
- `),m();return}if(o&&!b)return;B.preventDefault();let le=B.getTargetRanges()[0],J=B.inputType;b&&J==="deleteContentBackward"&&(b=new StaticRange({startContainer:b.startContainer,endContainer:b.endContainer,startOffset:Math.max(0,b.startOffset-1),endOffset:b.endOffset})),le&&(J.startsWith("delete")||J==="insertText"||J==="insertReplacementText")&&S(le,J.startsWith("delete")?"":B.data??B.dataTransfer?.getData("text/plain")??""),o&&m()},_=B=>{B.preventDefault();let le=B.clipboardData?.getData("text/plain")??"",J=e.ownerDocument.getSelection();J?.rangeCount&&S(J.getRangeAt(0),le),m()},T=B=>B.preventDefault();e.addEventListener("beforeinput",A,{signal:p.signal}),e.addEventListener("input",m,{signal:p.signal}),e.addEventListener("compositionstart",()=>{y=!0},{signal:p.signal}),e.addEventListener("compositionend",()=>{y=!1,m()},{signal:p.signal}),o&&h.observe(e,{childList:!0,characterData:!0,subtree:!0}),e.addEventListener("paste",_,{signal:p.signal}),e.addEventListener("drop",T,{signal:p.signal}),e.addEventListener("pointerdown",()=>{b=null},{signal:p.signal}),e.setAttribute("contenteditable","true"),e.setAttribute("role","textbox"),e.setAttribute("aria-label","Inline text preview"),e.setAttribute("aria-multiline","true"),e.dataset.paletteInlineEditing="true",e.spellcheck=!1,e.style.setProperty("outline",`2px solid ${t.accent??"#bda6ef"}`,"important"),e.style.setProperty("outline-offset","2px","important"),e.style.setProperty("box-shadow","none","important"),e.style.setProperty("white-space","pre-wrap","important"),e.focus({preventScroll:!0});let H=e.ownerDocument.getSelection(),R=e.ownerDocument.createRange(),z=ta(e).reverse().find(([B])=>!B.parentElement?.closest(ac))?.[0];return z?R.setStart(z,z.length):R.selectNodeContents(e),R.collapse(!0),H?.removeAllRanges(),H?.addRange(R),{element:e,finish(B=!1){if(g)return;g=!0,p.abort(),h.disconnect(),c();for(let J of u.reverse())J.restore();let le=(e.textContent??"").slice(0,500);v(),B?(o&&n&&n.cancelReactTextEdit(e,o.propName,i),M2(e,i,a)):o&&n&&n.finishReactTextEdit(e,o.propName,i,le),t.onFinish({element:e,before:i,after:le,nodes:a,multiline:E,...o?{reactProp:o.propName}:{}},B)},handleKey(B){return(/^(Arrow|Home|End|Page)/.test(B.key)||B.metaKey||B.ctrlKey)&&(b=null),y||B.isComposing||B.keyCode===229?(B.stopImmediatePropagation(),!1):B.key==="Enter"&&B.shiftKey&&!B.metaKey&&!B.ctrlKey&&!B.altKey?!1:B.key==="Enter"||B.key==="Escape"?(B.preventDefault(),B.stopImmediatePropagation(),!0):!1}}}var MN=O(()=>{"use strict";Ly();Li();Ly()});var LN={};Ft(LN,{createDesignMode:()=>UG});function UG(e){let t=w("style");t.textContent=mO;let n=null,o=Promise.resolve().then(()=>(GO(),IO)).then(N=>{t.textContent+=N.designPanelStyles,n=N},()=>{b.textContent="Design controls unavailable \xB7 try again"}),i=w("aside","design-inspector");i.setAttribute("role","dialog"),i.setAttribute("aria-label","Design mode inspector"),i.setAttribute("aria-hidden","true"),i.hidden=!0;let r=w("div","design-outline");r.setAttribute("aria-hidden","true");let a=w("div","design-outline design-outline--prospective");a.setAttribute("aria-hidden","true"),a.dataset.kind="hover",a.hidden=!0;let s=w("div","design-inspector__heading"),l=null,c=el("design-inspector__back");c.hidden=!0,c.append(yt("chevron")),c.addEventListener("click",()=>l?.run());let u=el("design-inspector__parent");u.hidden=!0;let d=w("span","design-inspector__target");d.tabIndex=-1;let p=w("small"),g=el("design-inspector__close");g.setAttribute("aria-label","Exit design mode"),g.append(yt("close"));let y=el("design-inspector__fold");y.append(yt("chevron"));let v=w("div","design-inspector__identity");v.append(u,d,p),s.append(c,v,y,g);let x=w("div","design-inspector__controls"),h=w("div","design-inspector__bar"),m=w("span","design-inspector__count");m.title=Xf;let b=w("p","design-inspector__status");b.setAttribute("role","status");let E=w("div","design-inspector__actions"),S=N=>{let Me=el("design-inspector__tool");return Me.dataset.tip=N,Me.setAttribute("aria-label",N),Me},A=S("Undo"),_=S("Redo");A.dataset.tip=`Undo \xB7 ${po()?"\u2318Z":"Ctrl+Z"}`,_.dataset.tip=`Redo \xB7 ${po()?"\u2318\u21E7Z":"Ctrl+Y"}`;let T=S("Reset"),H=S("Copy CSS");H.append(yt("copy"));let R=el("","Comment"),z=el("design-text-edit","Edit text");z.title="Edit text",z.setAttribute("aria-label","Edit selected text inline"),E.append(A,_,T,H,R);let F=w("div","design-inspector__compare");F.setAttribute("role","group"),F.setAttribute("aria-label","Compare with the page");let B=["Before","After"].map((N,Me)=>{let He=el("",N);return He.dataset.tip=`${N} \xB7 ${Me?"\u2192":"\u2190"} or B`,He.setAttribute("aria-pressed",String(!!Me)),He.addEventListener("click",()=>Re(!Me)),F.append(He),He});h.append(m,F,b,E);let le=w("div"),J;i.append(s,le,x,h),e.root.append(t,r,a),(e.panelRoot??e.root).append(i);let V=!1,oe=null,ue=!0,q=0,Y=null,W=null,C=()=>e.page?.()??location.pathname,U=C(),I=new Map,G=null,te=0,ie=0,pe=null,xe="",L=null,Q=null,Z=new Map,ae=new WeakSet,we=new Map,Te=new AbortController,$=()=>Promise.resolve().then(()=>(w0(),x2)),D,j=N=>{D??=$().then(({footerTips:Me})=>Me(h,e.root,Te.signal,N),()=>{D=void 0})};h.addEventListener("pointerover",j),h.addEventListener("focusin",j);let X=new Set,fe=[],ye=[],De=!1,Ce=fe.push.bind(fe);fe.push=(...N)=>(De||(ye.length=0),Ce(...N));let Pe=kH(fe),Ne;e.design?.experimentalGeometry&&Promise.resolve().then(()=>(EN(),wN)).then(N=>{Te.signal.aborted||(Ne=N.bindGeometry({options:e,signal:Te.signal,selected:()=>Y,enabled:()=>V&&ue&&!de&&!G?.element,remember:Le,track:Ie,history:fe,update:Ze,select:ht,tokens:()=>L,panel:()=>x,before:()=>de,pick(Me,He){let Je=Ey(e.targetAt(Me,He));Je&&!e.host.contains(Je)&&(ue=!0,li(Je))}}))});function Le(N,Me,He=N.style.getPropertyValue(Me),Je=N.style.getPropertyPriority(Me)){let cn=L?.originalDesignTokenStyle(N,Me),dt=Z.get(N);dt||(Z.set(N,dt=new Map),(cn?.absent||!N.hasAttribute("style"))&&ae.add(N)),dt.has(Me)||dt.set(Me,cn??{...$n(N,Me),value:He,priority:Je})}function Ie(N,Me){let He=we.get(N);He||we.set(N,He=new Map);let Je=N.style.getPropertyValue(Me);Je===(Z.get(N)?.get(Me)?.value??"")?He.delete(Me):He.set(Me,Je),He.size||we.delete(N),et()}function ut(){let N=Y,Me=N?ct(N):0,He=Me+(N&&J?.tokens?.size||0);return m.textContent=He?`${He} change${He>1?"s":""}`:"",h.toggleAttribute("data-changes",He>0||!A.disabled),F.hidden=!!J?.parked||!He&&!de,Me}function ct(N){return(we.get(N)?.size??0)+Number(mn(N)&&!!G?.hasChanges(N))+ +!!L?.hasReactPropChanges(N)||+!!L?.hasDesignTokenEdit(N)}let de=!1,Ae,ve=0;function Re(N,Me=!0){if(Ne?.cancel(),ue=!1,et(),N===de)return;N&&G?.element&&Et(),de=N,N&&L?.showDesignBefore(!0);let He=Me&&!L2();for(let[Je,cn]of Z){let dt=we.get(Je);ri(Je,cn.keys(),()=>{for(let Bn of cn.keys()){let Vn=Z.get(Je)?.get(Bn);N?Fe(Je,Bn,Vn):dt?.has(Bn)&&Je.style.setProperty(Bn,dt.get(Bn),Vn?.priority)}},He,ae.has(Je))}He&&(clearTimeout(ve),ve=window.setTimeout(()=>{ve=0,Ze()},330)),G?.showBefore(N,Me),N||L?.showDesignBefore(!1),B.forEach((Je,cn)=>Je.setAttribute("aria-pressed",String(!cn===N))),i.toggleAttribute("data-before",N),Ze()}function Fe(N,Me,He){Ty(N,Me,He),ae.has(N)&&rc(N)}function Ye(N,Me,He){if(!Y||(N.setAttribute("aria-invalid",String(He===null)),He===null))return;Le(Y,Me);let Je=L?.noteDesignTokenOverride(Y,Me,He);Pe.override(N,Je?.undo),Y.style.setProperty(Me,He,Je?.priority??Z.get(Y)?.get(Me)?.priority),Ie(Y,Me),Ze()}function $e(N,Me,He=!0){Y&&(Pe.commit(N,Y,Me,He),Ze())}let ot=()=>d.focus({preventScroll:!0}),rn,Zt,Ht=null;function pt(N){let Me=i.getRootNode().activeElement,He=Me&&Y===Ht&&x.contains(Me)&&Zt;if(Ht=Y,He&&rn?.(!1),nl(),x.replaceChildren(),He&&(rn=He(x,Me,()=>{rn=void 0},()=>{V&&Y&&ot()})),Qt(),!Y){J&&x.append(J.empty),d.textContent="Select an element",p.textContent="",u.hidden=!0;return}let Je=`${Y.tagName.toLowerCase()}${Y.id?`#${Y.id}`:""}`;d.textContent=Je,p.textContent=Y.localName==="iframe"?"Frame only \xB7 contents are isolated":Y.classList.length?`.${[...Y.classList].slice(0,2).join(".")}`:"";let cn=Y.parentElement;u.hidden=!cn||cn===Y.ownerDocument.body||cn===Y.ownerDocument.documentElement,u.textContent=cn?.tagName.toLowerCase()??"",u.setAttribute("aria-label",`Select parent ${u.textContent}`);let dt=Y,Bn=n;if(!Bn){o.then(()=>{V&&Y===dt&&pt()});return}Bn.renderPanel(x,{element:dt,changed:we.get(dt),collapsed:X,editText:z,begin:(Vn,mo)=>Pe.begin(Vn,$n(dt,mo)),apply:Ye,commit:$e,cancel(Vn,mo){Pe.cancel(Vn,dt,mo),Ie(dt,mo),Ze()},rerender:pt,reserved:e.reservedKey}),N&&x.prepend(N),(e.design?.tokens||e.design?.themes||Ys(dt,e.design)||dt.closest("[data-palette-inspectable],[data-komo-inspectable],[data-palette-design-tokens],[data-komo-design-tokens]"))&&(Q??=Promise.resolve().then(()=>(x0(),y0)).then(Vn=>L=Vn).catch(Vn=>{throw Q=null,Vn}),Q.then(Vn=>{!V||Y!==dt||Vn.attachDesignSystemControls(dt,x,Bn,e,{signal:Te.signal,select:ht,refresh:pt,retainedProps:N,updateActions:Ze,history:fe,isFieldDirty:Pe.isDirty,syncStyles(){for(let mo of Z.get(dt)?.keys()??[])Ie(dt,mo)},onStyleEdit(mo,vu,wu){Le(dt,mo.property,wu),Ie(dt,mo.property),Pe.begin(vu,{value:wu,priority:dt.style.getPropertyPriority(mo.property)}),$e(vu,mo.property)}})}).catch(()=>{}))}function Qt(){i.toggleAttribute("data-empty",R.hidden=!Y),i.parentElement?.toggleAttribute("data-design-empty",V&&!Y),J?.update(!!Y)}function Mn(N){return!!(we.get(N)?.size||mn(N)&&G?.hasChanges(N)||L?.hasReactPropChanges(N)||L?.hasDesignTokenEdit(N))}function K(){Et(),Ct?.disconnect(),Y=null,W=null,r.hidden=a.hidden=!0,pt(),Ze()}function ce(N,Me,He=!1,Je=r){if(!V||!ue||!N?.isConnected){Je.hidden=!0;return}let cn=Pt(N);if(!cn.width||!cn.height){Je.hidden=!0;return}if(Je.dataset.kind=Me,He&&(N!==pe||Me!==xe)){pe=N,xe=Me,clearTimeout(ie);let dt=i.getBoundingClientRect(),Bn=Vn=>cn.left<Vn+dt.width&&cn.right>Vn&&cn.top<dt.bottom&&cn.bottom>dt.top;e.flip&&dt.width&&Bn(dt.left)&&!Bn(document.documentElement.clientWidth-dt.right)&&(ie=window.setTimeout(e.flip,Me==="hover"?350:0))}Je.hidden=!ug(Je,cn,N,e.bounds?.(N))}let _e=null;function et(N=!1){Ne?.render(),ce(Y??W??_e,Y||!W?"selected":"hover",N),ce(Y&&W!==Y?W:null,"hover",!1,a)}function Ve(){te||(te=requestAnimationFrame(()=>{te=0,Y&&(U!==C()||!Y.isConnected&&!gt())&&K(),W&&!W.isConnected&&(W=null),et()}))}function gt(){let N=Y;return!N||U!==C()||!L?.retainReactPropSelection(N,x,e,fe,G,(He,Je)=>{Y=He,W=He,Ct?.disconnect(),Ct?.observe(He),Mn(N)||I.delete(N),I.set(He,U),pt(Je)})?!1:(Ze(),!0)}let Ct=typeof ResizeObserver=="function"?new ResizeObserver(Ve):null;function ht(N){!fn(N)||!N.isConnected||e.host.contains(N)||(J?.settle(),G?.element&&G.element!==N&&Et(),Ct?.disconnect(),Ct?.observe(N),Y=N,W=N,U=C(),I.set(N,U),pt(),et(!0),Ze())}let Gt=()=>CN("(max-width:520px)");function wt(N){i.toggleAttribute("data-folded",N&&Gt()),y.setAttribute("aria-expanded",String(!i.hasAttribute("data-folded"))),y.setAttribute("aria-label",i.hasAttribute("data-folded")?"Expand inspector":"Collapse inspector")}function jn(N){wt(!1),Gt()&&requestAnimationFrame(()=>{let Me=Pt(N),He=i.getBoundingClientRect().top-12;Me.top>=12&&Me.bottom<=He||window.scrollBy({top:Me.top-Math.max(12,(He-Me.height)/2),behavior:L2()?"auto":"smooth"})})}function Ze(){Ve(),A.disabled=!J?.parked&&!fe.length&&!L?.canUndoReactProp(Y)&&!L?.canUndoDesignTokenEdit(Y),_.disabled=!ye.length,T.disabled=!ut(),H.disabled=!Y||!we.get(Y)?.size,R.disabled=!Y,z.disabled=!!G?.busy||!Y?.isConnected||!mn(Y),z.textContent=G?.isEditing(mn(Y)?Y:null)?"Done editing":"Edit text",z.setAttribute("aria-label",G?.isEditing(mn(Y)?Y:null)?"Finish inline text editing":"Edit selected text inline"),Y&&!ve&&n?.syncFields(x,Pe.isDirty),Qt()}function Et(N=!1){G?.finish(N),Ze()}z.addEventListener("click",N=>{G||Y&&(b.textContent="Loading inline text editor\u2026",Promise.resolve().then(()=>(MN(),AN)).then(Me=>{G||!Y||!V||(G=Me.bindInlineTextTools({button:z,status:b,selected:()=>mn(Y)?Y:null,active:()=>V,onChange:Ze,onCommit(He){fe.push({kind:"text",element:He})}}),G.toggle(N))}).catch(()=>{b.textContent="Inline text editing is unavailable."}))});function Pn(N){if(!V)return;if(N.composedPath().includes(e.host)){W=null,et();return}let Me=Vi(N),He=Ey(e.targetAt(Me.x,Me.y),N.metaKey||N.ctrlKey);W=He&&!e.host.contains(He)?He:null,W&&(ue=!0),et(!Y)}function ir(N){if(!V||N.button!==0)return;let Me=N.composedPath();if(Me.includes(e.host))return void(mn(Me[0])&&Me[0].matches(".frame-stage")&&K());let He=Vi(N),Je=Ey(e.targetAt(He.x,He.y),N.metaKey||N.ctrlKey);if(!Je||Je===Je.ownerDocument.body||Je===Je.ownerDocument.documentElement){G?.element||K();return}e.host.contains(Je)||(ue=!0,!(G?.element&&(Je===G.element||G.element.contains(Je)))&&(N.preventDefault(),N.stopImmediatePropagation(),li(Je)))}function li(N){G?.element&&Et(),ht(N);let Me=e.root.activeElement??document.activeElement;mn(Me)&&Me.blur(),rn?.(!1)}function ci(N){!V||N.composedPath().includes(e.host)||(N.preventDefault(),N.stopImmediatePropagation(),Y&&jn(Y),N.detail===2&&Y?.contains(N.target)&&!z.disabled&&!G?.element&&z.dispatchEvent(new MouseEvent("click",N)))}let rr;function Di(N){if(!(N.isComposing||N.keyCode===229)){if(G?.handleKey(N)){z.focus({preventScroll:!0});return}V&&rr?.(N)||N.composedPath().includes(e.host)&&_o(N)}}function _o(N){!V||N.key!=="Escape"||N.isComposing||N.keyCode===229||N.defaultPrevented&&!N.composedPath().includes(e.host)||(N.preventDefault(),N.stopImmediatePropagation(),oe=Y&&[Y,C()],K(),ar(!1),e.onExit())}function ar(N){if(N||(nl(),G?.finish(),V&&(Ae=de,Re(!0,!1)),L?.restoreThemes(i)),N&&!V&&Ae!==void 0){let Me=Ae;Ae=void 0,Re(Me,!1)}N&&Y&&(U!==C()||!Y.isConnected&&!gt())&&K(),N&&!V&&!Y&&oe?.[0].isConnected&&oe[1]===C()&&ht(oe[0]),N&&(oe=null),clearTimeout(q),q=0,V=N,Qt(),N?(i.hidden=!1,i.setAttribute("aria-hidden","false"),requestAnimationFrame(()=>{V&&(i.dataset.state="active")}),pt(),wt(!Y),et(),g.focus({preventScroll:!0})):(W=null,r.hidden=a.hidden=!0,i.setAttribute("aria-hidden","true"),i.dataset.state="closing",L2()?(i.hidden=!0,delete i.dataset.state):q=window.setTimeout(()=>{q=0,V||(i.hidden=!0,delete i.dataset.state)},250))}y.addEventListener("click",()=>wt(!i.hasAttribute("data-folded"))),u.addEventListener("click",()=>ht(Y?.parentElement??null)),g.addEventListener("click",()=>{G?.element&&Et(),K(),ar(!1),e.onExit()});function Ln(){nl(),Re(!1,!1),L?.resetPreviews();for(let[N,Me]of Z)ri(N,Me.keys(),()=>{for(let[He,Je]of Me)Fe(N,He,Je)},!1,ae.has(N)),ae.delete(N);Z.clear(),we.clear(),fe.length=ye.length=0,G?.restoreAll(),J?.tokens?.reset(),I.clear(),Ze()}function nl(){Ne?.cancel(),e.root.dispatchEvent(new Event("palette-preview-cancel"))}function yc(N){let Me=we.get(N);return Me&&Ne?.moved(N)?new Map([...Me].filter(([He])=>He!=="display")):Me}function ca(N,Me){return Me(N,yc(N),He=>Z.get(N)?.get(He)?.computed,L?.tokenBoundProperties(N),[mn(N)?G?.proposal(N):void 0,L?.proposedDesignChanges(N),Ne?.proposal(N)],L?.designContext(N,e.design))}A.addEventListener("click",()=>{if(J?.restore())return ye.push([{kind:"discard"},()=>J?.discard()]),Ze();let N=fe.pop();if(!N)Y&&(L?.undoDesignTokenEdit(Y),L?.undoReactProp(Y),pt()),b.textContent=Xf;else if(N.kind)N.kind==="text"?(Y===(G?.undo()??N.element)&&pt(),ye.push([N,()=>G?.redo()])):N.kind==="token"?(J?.tokens?.undo(),ye.push([N,()=>J?.tokens?.redo()])):(ye.push([N,()=>{Ty(N.element,N.property,N.after),L?.syncDesignTokenBinding(N.element,N.property),Ie(N.element,N.property)}]),Fe(N.element,N.property,N.before),N.before.bindingUndo?.(),L?.syncDesignTokenBinding(N.element,N.property),Ie(N.element,N.property),Y===N.element&&pt(),et());else{let He=N.element.getAttribute("style");N.undo(),ye.push([N,N.redo??(N.props?()=>L?.redoReactProp(N.element):()=>He===null?N.element.removeAttribute("style"):N.element.setAttribute("style",He))]),pt()}Ze(),e.root.dispatchEvent(new CustomEvent("palette-announce",{detail:"Undone"}));let Me=e.root.activeElement;!rn&&(!Me||Me===A||!Me.getClientRects().length)&&(A.disabled?ot():A.focus({preventScroll:!0}))}),_.addEventListener("click",()=>{let N=ye.pop();if(!N)return;De=!0,N[0].kind!=="token"&&N[0].kind!=="discard"&&fe.push(N[0]),N[1](),De=!1,pt(),et(),Ze(),e.root.dispatchEvent(new CustomEvent("palette-announce",{detail:"Redone"}));let Me=e.root.activeElement;!rn&&(!Me||Me===_||!Me.getClientRects().length)&&(_.disabled?ot():_.focus({preventScroll:!0}))});function sr(N){G?.isEditing(mn(N)?N:null)&&Et(!0);let Me=we.get(N),He=(mn(N)&&G?.hasChanges(N))??!1,Je=L?.hasReactPropChanges(N)??!1,cn=L?.hasDesignTokenEdit(N)??!1;if(!(!Me?.size&&!He&&!Je&&!cn)){He&&mn(N)&&G?.reset(N),cn&&L?.resetDesignTokenEdits(N),ri(N,Me?.keys()??[],()=>{for(let dt of Me?.keys()??[])Fe(N,dt,Z.get(N)?.get(dt))},!1,ae.has(N)),we.delete(N),Z.delete(N),ae.delete(N),I.delete(N),Je&&L?.resetReactProps(N);for(let dt=fe.length-1;dt>=0;dt--)fe[dt].element===N&&fe.splice(dt,1);ye.length=0}}T.addEventListener("click",()=>{Y&&(sr(Y),pt(),et(),Ze(),rn||ot())}),H.addEventListener("click",()=>{let N=Y,Me=N?yc(N):void 0;!N||!Me?.size||$().then(async({cssText:He})=>{let Je=He(N,Me);try{await navigator.clipboard.writeText(Je),b.textContent="CSS copied"}catch{b.textContent=Je}})}),R.addEventListener("click",()=>{let N=Y;N&&(G?.isEditing(mn(N)?N:null)&&Et(),$().then(({designProposal:Me})=>{if(!V||Y!==N||!N.isConnected)return;let He=[ca(N,Me),J?.tokens?.proposal()].filter(Boolean).join(`
377
+ `),m();return}if(o&&!b)return;B.preventDefault();let le=B.getTargetRanges()[0],J=B.inputType;b&&J==="deleteContentBackward"&&(b=new StaticRange({startContainer:b.startContainer,endContainer:b.endContainer,startOffset:Math.max(0,b.startOffset-1),endOffset:b.endOffset})),le&&(J.startsWith("delete")||J==="insertText"||J==="insertReplacementText")&&S(le,J.startsWith("delete")?"":B.data??B.dataTransfer?.getData("text/plain")??""),o&&m()},_=B=>{B.preventDefault();let le=B.clipboardData?.getData("text/plain")??"",J=e.ownerDocument.getSelection();J?.rangeCount&&S(J.getRangeAt(0),le),m()},T=B=>B.preventDefault();e.addEventListener("beforeinput",A,{signal:p.signal}),e.addEventListener("input",m,{signal:p.signal}),e.addEventListener("compositionstart",()=>{y=!0},{signal:p.signal}),e.addEventListener("compositionend",()=>{y=!1,m()},{signal:p.signal}),o&&h.observe(e,{childList:!0,characterData:!0,subtree:!0}),e.addEventListener("paste",_,{signal:p.signal}),e.addEventListener("drop",T,{signal:p.signal}),e.addEventListener("pointerdown",()=>{b=null},{signal:p.signal}),e.setAttribute("contenteditable","true"),e.setAttribute("role","textbox"),e.setAttribute("aria-label","Inline text preview"),e.setAttribute("aria-multiline","true"),e.dataset.paletteInlineEditing="true",e.spellcheck=!1,e.style.setProperty("outline",`2px solid ${t.accent??"#bda6ef"}`,"important"),e.style.setProperty("outline-offset","2px","important"),e.style.setProperty("box-shadow","none","important"),e.style.setProperty("white-space","pre-wrap","important"),e.focus({preventScroll:!0});let H=e.ownerDocument.getSelection(),R=e.ownerDocument.createRange(),z=ta(e).reverse().find(([B])=>!B.parentElement?.closest(ac))?.[0];return z?R.setStart(z,z.length):R.selectNodeContents(e),R.collapse(!0),H?.removeAllRanges(),H?.addRange(R),{element:e,finish(B=!1){if(g)return;g=!0,p.abort(),h.disconnect(),c();for(let J of u.reverse())J.restore();let le=(e.textContent??"").slice(0,500);v(),B?(o&&n&&n.cancelReactTextEdit(e,o.propName,i),M2(e,i,a)):o&&n&&n.finishReactTextEdit(e,o.propName,i,le),t.onFinish({element:e,before:i,after:le,nodes:a,multiline:E,...o?{reactProp:o.propName}:{}},B)},handleKey(B){return(/^(Arrow|Home|End|Page)/.test(B.key)||B.metaKey||B.ctrlKey)&&(b=null),y||B.isComposing||B.keyCode===229?(B.stopImmediatePropagation(),!1):B.key==="Enter"&&B.shiftKey&&!B.metaKey&&!B.ctrlKey&&!B.altKey?!1:B.key==="Enter"||B.key==="Escape"?(B.preventDefault(),B.stopImmediatePropagation(),!0):!1}}}var MN=O(()=>{"use strict";Ly();Li();Ly()});var LN={};Ft(LN,{createDesignMode:()=>UG});function UG(e){let t=w("style");t.textContent=mO;let n=null,o=Promise.resolve().then(()=>(GO(),IO)).then(N=>{t.textContent+=N.designPanelStyles,n=N},()=>{b.textContent="Design controls unavailable \xB7 try again"}),i=w("aside","design-inspector");i.setAttribute("role","dialog"),i.setAttribute("aria-label","Design mode inspector"),i.setAttribute("aria-hidden","true"),i.hidden=!0;let r=w("div","design-outline");r.setAttribute("aria-hidden","true");let a=w("div","design-outline design-outline--prospective");a.setAttribute("aria-hidden","true"),a.dataset.kind="hover",a.hidden=!0;let s=w("div","design-inspector__heading"),l=null,c=el("design-inspector__back");c.hidden=!0,c.append(yt("chevron")),c.addEventListener("click",()=>l?.run());let u=el("design-inspector__parent");u.hidden=!0;let d=w("span","design-inspector__target");d.tabIndex=-1;let p=w("small"),g=el("design-inspector__close");g.setAttribute("aria-label","Exit design mode"),g.append(yt("close"));let y=el("design-inspector__fold");y.append(yt("chevron"));let v=w("div","design-inspector__identity");v.append(u,d,p),s.append(c,v,y,g);let x=w("div","design-inspector__controls"),h=w("div","design-inspector__bar"),m=w("span","design-inspector__count");m.title=Xf;let b=w("p","design-inspector__status");b.setAttribute("role","status");let E=w("div","design-inspector__actions"),S=N=>{let Me=el("design-inspector__tool");return Me.dataset.tip=N,Me.setAttribute("aria-label",N),Me},A=S("Undo"),_=S("Redo");A.dataset.tip=`Undo \xB7 ${po()?"\u2318Z":"Ctrl+Z"}`,_.dataset.tip=`Redo \xB7 ${po()?"\u2318\u21E7Z":"Ctrl+Y"}`;let T=S("Reset"),H=S("Copy CSS");H.append(yt("copy"));let R=el("","Comment"),z=el("design-text-edit","Edit text");z.title="Edit text",z.setAttribute("aria-label","Edit selected text inline"),E.append(A,_,T,H,R);let F=w("div","design-inspector__compare");F.setAttribute("role","group"),F.setAttribute("aria-label","Compare with the page");let B=["Before","After"].map((N,Me)=>{let He=el("",N);return He.dataset.tip=`${N} \xB7 ${Me?"\u2192":"\u2190"} or B`,He.setAttribute("aria-pressed",String(!!Me)),He.addEventListener("click",()=>Re(!Me)),F.append(He),He});h.append(m,F,b,E);let le=w("div"),J;i.append(s,le,x,h),e.root.append(t,r,a),(e.panelRoot??e.root).append(i);let V=!1,oe=null,ue=!0,q=0,Y=null,W=null,C=()=>e.page?.()??location.pathname,U=C(),I=new Map,G=null,te=0,ie=0,pe=null,xe="",L=null,Q=null,Z=new Map,se=new WeakSet,we=new Map,Te=new AbortController,$=()=>Promise.resolve().then(()=>(w0(),x2)),D,j=N=>{D??=$().then(({footerTips:Me})=>Me(h,e.root,Te.signal,N),()=>{D=void 0})};h.addEventListener("pointerover",j),h.addEventListener("focusin",j);let X=new Set,fe=[],ye=[],De=!1,Ce=fe.push.bind(fe);fe.push=(...N)=>(De||(ye.length=0),Ce(...N));let Pe=kH(fe),Ne;e.design?.experimentalGeometry&&Promise.resolve().then(()=>(EN(),wN)).then(N=>{Te.signal.aborted||(Ne=N.bindGeometry({options:e,signal:Te.signal,selected:()=>Y,enabled:()=>V&&ue&&!de&&!G?.element,remember:Le,track:Ie,history:fe,update:Ze,select:ht,tokens:()=>L,panel:()=>x,before:()=>de,pick(Me,He){let Je=Ey(e.targetAt(Me,He));Je&&!e.host.contains(Je)&&(ue=!0,li(Je))}}))});function Le(N,Me,He=N.style.getPropertyValue(Me),Je=N.style.getPropertyPriority(Me)){let cn=L?.originalDesignTokenStyle(N,Me),dt=Z.get(N);dt||(Z.set(N,dt=new Map),(cn?.absent||!N.hasAttribute("style"))&&se.add(N)),dt.has(Me)||dt.set(Me,cn??{...$n(N,Me),value:He,priority:Je})}function Ie(N,Me){let He=we.get(N);He||we.set(N,He=new Map);let Je=N.style.getPropertyValue(Me);Je===(Z.get(N)?.get(Me)?.value??"")?He.delete(Me):He.set(Me,Je),He.size||we.delete(N),et()}function ut(){let N=Y,Me=N?ct(N):0,He=Me+(N&&J?.tokens?.size||0);return m.textContent=He?`${He} change${He>1?"s":""}`:"",h.toggleAttribute("data-changes",He>0||!A.disabled),F.hidden=!!J?.parked||!He&&!de,Me}function ct(N){return(we.get(N)?.size??0)+Number(mn(N)&&!!G?.hasChanges(N))+ +!!L?.hasReactPropChanges(N)||+!!L?.hasDesignTokenEdit(N)}let de=!1,Ae,ve=0;function Re(N,Me=!0){if(Ne?.cancel(),ue=!1,et(),N===de)return;N&&G?.element&&Et(),de=N,N&&L?.showDesignBefore(!0);let He=Me&&!L2();for(let[Je,cn]of Z){let dt=we.get(Je);ri(Je,cn.keys(),()=>{for(let Bn of cn.keys()){let Vn=Z.get(Je)?.get(Bn);N?Fe(Je,Bn,Vn):dt?.has(Bn)&&Je.style.setProperty(Bn,dt.get(Bn),Vn?.priority)}},He,se.has(Je))}He&&(clearTimeout(ve),ve=window.setTimeout(()=>{ve=0,Ze()},330)),G?.showBefore(N,Me),N||L?.showDesignBefore(!1),B.forEach((Je,cn)=>Je.setAttribute("aria-pressed",String(!cn===N))),i.toggleAttribute("data-before",N),Ze()}function Fe(N,Me,He){Ty(N,Me,He),se.has(N)&&rc(N)}function Ye(N,Me,He){if(!Y||(N.setAttribute("aria-invalid",String(He===null)),He===null))return;Le(Y,Me);let Je=L?.noteDesignTokenOverride(Y,Me,He);Pe.override(N,Je?.undo),Y.style.setProperty(Me,He,Je?.priority??Z.get(Y)?.get(Me)?.priority),Ie(Y,Me),Ze()}function $e(N,Me,He=!0){Y&&(Pe.commit(N,Y,Me,He),Ze())}let ot=()=>d.focus({preventScroll:!0}),rn,Zt,Ht=null;function pt(N){let Me=i.getRootNode().activeElement,He=Me&&Y===Ht&&x.contains(Me)&&Zt;if(Ht=Y,He&&rn?.(!1),nl(),x.replaceChildren(),He&&(rn=He(x,Me,()=>{rn=void 0},()=>{V&&Y&&ot()})),Qt(),!Y){J&&x.append(J.empty),d.textContent="Select an element",p.textContent="",u.hidden=!0;return}let Je=`${Y.tagName.toLowerCase()}${Y.id?`#${Y.id}`:""}`;d.textContent=Je,p.textContent=Y.localName==="iframe"?"Frame only \xB7 contents are isolated":Y.classList.length?`.${[...Y.classList].slice(0,2).join(".")}`:"";let cn=Y.parentElement;u.hidden=!cn||cn===Y.ownerDocument.body||cn===Y.ownerDocument.documentElement,u.textContent=cn?.tagName.toLowerCase()??"",u.setAttribute("aria-label",`Select parent ${u.textContent}`);let dt=Y,Bn=n;if(!Bn){o.then(()=>{V&&Y===dt&&pt()});return}Bn.renderPanel(x,{element:dt,changed:we.get(dt),collapsed:X,editText:z,begin:(Vn,mo)=>Pe.begin(Vn,$n(dt,mo)),apply:Ye,commit:$e,cancel(Vn,mo){Pe.cancel(Vn,dt,mo),Ie(dt,mo),Ze()},rerender:pt,reserved:e.reservedKey}),N&&x.prepend(N),(e.design?.tokens||e.design?.themes||Ys(dt,e.design)||dt.closest("[data-palette-inspectable],[data-komo-inspectable],[data-palette-design-tokens],[data-komo-design-tokens]"))&&(Q??=Promise.resolve().then(()=>(x0(),y0)).then(Vn=>L=Vn).catch(Vn=>{throw Q=null,Vn}),Q.then(Vn=>{!V||Y!==dt||Vn.attachDesignSystemControls(dt,x,Bn,e,{signal:Te.signal,select:ht,refresh:pt,retainedProps:N,updateActions:Ze,history:fe,isFieldDirty:Pe.isDirty,syncStyles(){for(let mo of Z.get(dt)?.keys()??[])Ie(dt,mo)},onStyleEdit(mo,vu,wu){Le(dt,mo.property,wu),Ie(dt,mo.property),Pe.begin(vu,{value:wu,priority:dt.style.getPropertyPriority(mo.property)}),$e(vu,mo.property)}})}).catch(()=>{}))}function Qt(){i.toggleAttribute("data-empty",R.hidden=!Y),i.parentElement?.toggleAttribute("data-design-empty",V&&!Y),J?.update(!!Y)}function Mn(N){return!!(we.get(N)?.size||mn(N)&&G?.hasChanges(N)||L?.hasReactPropChanges(N)||L?.hasDesignTokenEdit(N))}function K(){Et(),Ct?.disconnect(),Y=null,W=null,r.hidden=a.hidden=!0,pt(),Ze()}function ce(N,Me,He=!1,Je=r){if(!V||!ue||!N?.isConnected){Je.hidden=!0;return}let cn=Pt(N);if(!cn.width||!cn.height){Je.hidden=!0;return}if(Je.dataset.kind=Me,He&&(N!==pe||Me!==xe)){pe=N,xe=Me,clearTimeout(ie);let dt=i.getBoundingClientRect(),Bn=Vn=>cn.left<Vn+dt.width&&cn.right>Vn&&cn.top<dt.bottom&&cn.bottom>dt.top;e.flip&&dt.width&&Bn(dt.left)&&!Bn(document.documentElement.clientWidth-dt.right)&&(ie=window.setTimeout(e.flip,Me==="hover"?350:0))}Je.hidden=!ug(Je,cn,N,e.bounds?.(N))}let _e=null;function et(N=!1){Ne?.render(),ce(Y??W??_e,Y||!W?"selected":"hover",N),ce(Y&&W!==Y?W:null,"hover",!1,a)}function Ve(){te||(te=requestAnimationFrame(()=>{te=0,Y&&(U!==C()||!Y.isConnected&&!gt())&&K(),W&&!W.isConnected&&(W=null),et()}))}function gt(){let N=Y;return!N||U!==C()||!L?.retainReactPropSelection(N,x,e,fe,G,(He,Je)=>{Y=He,W=He,Ct?.disconnect(),Ct?.observe(He),Mn(N)||I.delete(N),I.set(He,U),pt(Je)})?!1:(Ze(),!0)}let Ct=typeof ResizeObserver=="function"?new ResizeObserver(Ve):null;function ht(N){!fn(N)||!N.isConnected||e.host.contains(N)||(J?.settle(),G?.element&&G.element!==N&&Et(),Ct?.disconnect(),Ct?.observe(N),Y=N,W=N,U=C(),I.set(N,U),pt(),et(!0),Ze())}let Gt=()=>CN("(max-width:520px)");function wt(N){i.toggleAttribute("data-folded",N&&Gt()),y.setAttribute("aria-expanded",String(!i.hasAttribute("data-folded"))),y.setAttribute("aria-label",i.hasAttribute("data-folded")?"Expand inspector":"Collapse inspector")}function jn(N){wt(!1),Gt()&&requestAnimationFrame(()=>{let Me=Pt(N),He=i.getBoundingClientRect().top-12;Me.top>=12&&Me.bottom<=He||window.scrollBy({top:Me.top-Math.max(12,(He-Me.height)/2),behavior:L2()?"auto":"smooth"})})}function Ze(){Ve(),A.disabled=!J?.parked&&!fe.length&&!L?.canUndoReactProp(Y)&&!L?.canUndoDesignTokenEdit(Y),_.disabled=!ye.length,T.disabled=!ut(),H.disabled=!Y||!we.get(Y)?.size,R.disabled=!Y,z.disabled=!!G?.busy||!Y?.isConnected||!mn(Y),z.textContent=G?.isEditing(mn(Y)?Y:null)?"Done editing":"Edit text",z.setAttribute("aria-label",G?.isEditing(mn(Y)?Y:null)?"Finish inline text editing":"Edit selected text inline"),Y&&!ve&&n?.syncFields(x,Pe.isDirty),Qt()}function Et(N=!1){G?.finish(N),Ze()}z.addEventListener("click",N=>{G||Y&&(b.textContent="Loading inline text editor\u2026",Promise.resolve().then(()=>(MN(),AN)).then(Me=>{G||!Y||!V||(G=Me.bindInlineTextTools({button:z,status:b,selected:()=>mn(Y)?Y:null,active:()=>V,onChange:Ze,onCommit(He){fe.push({kind:"text",element:He})}}),G.toggle(N))}).catch(()=>{b.textContent="Inline text editing is unavailable."}))});function Pn(N){if(!V)return;if(N.composedPath().includes(e.host)){W=null,et();return}let Me=Vi(N),He=Ey(e.targetAt(Me.x,Me.y),N.metaKey||N.ctrlKey);W=He&&!e.host.contains(He)?He:null,W&&(ue=!0),et(!Y)}function ir(N){if(!V||N.button!==0)return;let Me=N.composedPath();if(Me.includes(e.host))return void(mn(Me[0])&&Me[0].matches(".frame-stage")&&K());let He=Vi(N),Je=Ey(e.targetAt(He.x,He.y),N.metaKey||N.ctrlKey);if(!Je||Je===Je.ownerDocument.body||Je===Je.ownerDocument.documentElement){G?.element||K();return}e.host.contains(Je)||(ue=!0,!(G?.element&&(Je===G.element||G.element.contains(Je)))&&(N.preventDefault(),N.stopImmediatePropagation(),li(Je)))}function li(N){G?.element&&Et(),ht(N);let Me=e.root.activeElement??document.activeElement;mn(Me)&&Me.blur(),rn?.(!1)}function ci(N){!V||N.composedPath().includes(e.host)||(N.preventDefault(),N.stopImmediatePropagation(),Y&&jn(Y),N.detail===2&&Y?.contains(N.target)&&!z.disabled&&!G?.element&&z.dispatchEvent(new MouseEvent("click",N)))}let rr;function Di(N){if(!(N.isComposing||N.keyCode===229)){if(G?.handleKey(N)){z.focus({preventScroll:!0});return}V&&rr?.(N)||N.composedPath().includes(e.host)&&_o(N)}}function _o(N){!V||N.key!=="Escape"||N.isComposing||N.keyCode===229||N.defaultPrevented&&!N.composedPath().includes(e.host)||(N.preventDefault(),N.stopImmediatePropagation(),oe=Y&&[Y,C()],K(),ar(!1),e.onExit())}function ar(N){if(N||(nl(),G?.finish(),V&&(Ae=de,Re(!0,!1)),L?.restoreThemes(i)),N&&!V&&Ae!==void 0){let Me=Ae;Ae=void 0,Re(Me,!1)}N&&Y&&(U!==C()||!Y.isConnected&&!gt())&&K(),N&&!V&&!Y&&oe?.[0].isConnected&&oe[1]===C()&&ht(oe[0]),N&&(oe=null),clearTimeout(q),q=0,V=N,Qt(),N?(i.hidden=!1,i.setAttribute("aria-hidden","false"),requestAnimationFrame(()=>{V&&(i.dataset.state="active")}),pt(),wt(!Y),et(),g.focus({preventScroll:!0})):(W=null,r.hidden=a.hidden=!0,i.setAttribute("aria-hidden","true"),i.dataset.state="closing",L2()?(i.hidden=!0,delete i.dataset.state):q=window.setTimeout(()=>{q=0,V||(i.hidden=!0,delete i.dataset.state)},250))}y.addEventListener("click",()=>wt(!i.hasAttribute("data-folded"))),u.addEventListener("click",()=>ht(Y?.parentElement??null)),g.addEventListener("click",()=>{G?.element&&Et(),K(),ar(!1),e.onExit()});function Ln(){nl(),Re(!1,!1),L?.resetPreviews();for(let[N,Me]of Z)ri(N,Me.keys(),()=>{for(let[He,Je]of Me)Fe(N,He,Je)},!1,se.has(N)),se.delete(N);Z.clear(),we.clear(),fe.length=ye.length=0,G?.restoreAll(),J?.tokens?.reset(),I.clear(),Ze()}function nl(){Ne?.cancel(),e.root.dispatchEvent(new Event("palette-preview-cancel"))}function yc(N){let Me=we.get(N);return Me&&Ne?.moved(N)?new Map([...Me].filter(([He])=>He!=="display")):Me}function ca(N,Me){return Me(N,yc(N),He=>Z.get(N)?.get(He)?.computed,L?.tokenBoundProperties(N),[mn(N)?G?.proposal(N):void 0,L?.proposedDesignChanges(N),Ne?.proposal(N)],L?.designContext(N,e.design))}A.addEventListener("click",()=>{if(J?.restore())return ye.push([{kind:"discard"},()=>J?.discard()]),Ze();let N=fe.pop();if(!N)Y&&(L?.undoDesignTokenEdit(Y),L?.undoReactProp(Y),pt()),b.textContent=Xf;else if(N.kind)N.kind==="text"?(Y===(G?.undo()??N.element)&&pt(),ye.push([N,()=>G?.redo()])):N.kind==="token"?(J?.tokens?.undo(),ye.push([N,()=>J?.tokens?.redo()])):(ye.push([N,()=>{Ty(N.element,N.property,N.after),L?.syncDesignTokenBinding(N.element,N.property),Ie(N.element,N.property)}]),Fe(N.element,N.property,N.before),N.before.bindingUndo?.(),L?.syncDesignTokenBinding(N.element,N.property),Ie(N.element,N.property),Y===N.element&&pt(),et());else{let He=N.element.getAttribute("style");N.undo(),ye.push([N,N.redo??(N.props?()=>L?.redoReactProp(N.element):()=>He===null?N.element.removeAttribute("style"):N.element.setAttribute("style",He))]),pt()}Ze(),e.root.dispatchEvent(new CustomEvent("palette-announce",{detail:"Undone"}));let Me=e.root.activeElement;!rn&&(!Me||Me===A||!Me.getClientRects().length)&&(A.disabled?ot():A.focus({preventScroll:!0}))}),_.addEventListener("click",()=>{let N=ye.pop();if(!N)return;De=!0,N[0].kind!=="token"&&N[0].kind!=="discard"&&fe.push(N[0]),N[1](),De=!1,pt(),et(),Ze(),e.root.dispatchEvent(new CustomEvent("palette-announce",{detail:"Redone"}));let Me=e.root.activeElement;!rn&&(!Me||Me===_||!Me.getClientRects().length)&&(_.disabled?ot():_.focus({preventScroll:!0}))});function sr(N){G?.isEditing(mn(N)?N:null)&&Et(!0);let Me=we.get(N),He=(mn(N)&&G?.hasChanges(N))??!1,Je=L?.hasReactPropChanges(N)??!1,cn=L?.hasDesignTokenEdit(N)??!1;if(!(!Me?.size&&!He&&!Je&&!cn)){He&&mn(N)&&G?.reset(N),cn&&L?.resetDesignTokenEdits(N),ri(N,Me?.keys()??[],()=>{for(let dt of Me?.keys()??[])Fe(N,dt,Z.get(N)?.get(dt))},!1,se.has(N)),we.delete(N),Z.delete(N),se.delete(N),I.delete(N),Je&&L?.resetReactProps(N);for(let dt=fe.length-1;dt>=0;dt--)fe[dt].element===N&&fe.splice(dt,1);ye.length=0}}T.addEventListener("click",()=>{Y&&(sr(Y),pt(),et(),Ze(),rn||ot())}),H.addEventListener("click",()=>{let N=Y,Me=N?yc(N):void 0;!N||!Me?.size||$().then(async({cssText:He})=>{let Je=He(N,Me);try{await navigator.clipboard.writeText(Je),b.textContent="CSS copied"}catch{b.textContent=Je}})}),R.addEventListener("click",()=>{let N=Y;N&&(G?.isEditing(mn(N)?N:null)&&Et(),$().then(({designProposal:Me})=>{if(!V||Y!==N||!N.isConnected)return;let He=[ca(N,Me),J?.tokens?.proposal()].filter(Boolean).join(`
378
378
 
379
- `)||void 0;sr(N),J?.tokens?.reset(),Ze(),e.onComment(N,He)},()=>{b.textContent="Comment unavailable \xB7 try again"}))});let vn=()=>Re(!1);for(let N of[x,E,z])for(let Me of["pointerdown","focusin","click","input"])N.addEventListener(Me,vn,!0);e.root.addEventListener("palette-announce",N=>{let Me=e.root.querySelector(".sr-only[aria-live]");Me&&(Me.textContent=N.detail)},{signal:Te.signal}),document.addEventListener("pointermove",Pn,{capture:!0,signal:Te.signal}),document.addEventListener("pointerdown",ir,{capture:!0,signal:Te.signal}),document.addEventListener("click",ci,{capture:!0,signal:Te.signal}),document.addEventListener("keydown",Di,{capture:!0,signal:Te.signal}),window.addEventListener("keydown",_o,{signal:Te.signal}),window.addEventListener("scroll",Ve,{capture:!0,passive:!0,signal:Te.signal}),window.addEventListener("resize",Ve,{passive:!0,signal:Te.signal});for(let[N,Me,He]of[["pointermove",Pn],["pointerdown",ir],["click",ci],["keydown",Di],["keydown",_o,1],["scroll",Ve,1],["resize",Ve,1]])so(N,Me,{capture:N!=="resize"&&!(He&&N==="keydown"),passive:N==="scroll"||N==="resize",signal:Te.signal},He?"window":"document");pg(e.host,()=>V?[Y??W,W]:[],Ve,Te.signal,()=>{gt()||K()});let Tm=$().then(N=>{if(Te.signal.aborted)return;Zt=N.keepFocus;let Me=He=>{ue=!0,ht(He),jn(He)};rr=N.designKeyboard({host:e.host,compare:F,reserved:e.reservedKey,root:e.root,undo:A,redo:_,keys:e.keys,signal:Te.signal,selected:()=>U===C()?Y:null,comment(){return!Y||R.disabled?!1:(R.click(),!0)},select:Me,compareBefore(He){Re(He??!de)},help:e.shortcutHelp}),N.watchDesignStatus(b,h,()=>!!G?.element,Te.signal),J=N.selectionViews({help:e.shortcutHelp,select:Me,peek(He){_e=He,ue=!0,et()},before(He){ye.length=0,Re(He)},reset:Ln,items:()=>[...I].filter(([He])=>Mn(He)).map(([He,Je])=>({element:He,here:Je===C()&&He.isConnected,count:ct(He),proposal:ca(He,N.designProposal)})),message:He=>{b.textContent=He},mode:e,signal:Te.signal,history:fe,update:Ze,clear:K}),h.before(J.chip),t.textContent+=J.styles,A.innerHTML=J.icons.undo,_.innerHTML=J.icons.redo,T.innerHTML=J.icons.reset,le.append(J.pending),V?pt():Qt()},()=>{b.textContent="Selection tools unavailable \xB7 try again"});return{setActive:ar,select:ht,clearSelection:K,setReturnAction(N){l=N,c.hidden=!N,N&&(c.setAttribute("aria-label",N.label),c.title=N.label)},mountPanel(N){i.parentElement!==N&&(i.parentElement?.removeAttribute("data-design-empty"),N.append(i),Qt())},get active(){return V},get selected(){return Y},get edited(){return fe.length>0},ready:Promise.all([o,Tm]).then(()=>{i.dataset.ready=""}),destroy(){G?.finish(!0),ar(!1),Ln(),clearTimeout(q),clearTimeout(ie),clearTimeout(ve),Ct?.disconnect(),Te.abort(),cancelAnimationFrame(te),i.remove(),r.remove(),a.remove(),t.remove()}}}var el,CN,L2,_N=O(()=>{"use strict";Fs();Li();gO();It();ea();Gx();ho();Sy();el=(e,t)=>Object.assign(w("button",e,t),{type:"button"}),CN=e=>typeof matchMedia=="function"&&matchMedia(e).matches,L2=()=>CN("(prefers-reduced-motion: reduce)")});var DN={};Ft(DN,{startPinMove:()=>qG});function qG(e){let{pin:t,root:n}=e,o=t.ownerDocument.defaultView,i=new AbortController,r=i.signal,a={...e.point},s=null,l=!1,c=!1,u=w("section","pin-move");u.setAttribute("role","group"),u.setAttribute("aria-label","Move pin");let d=w("p","","Drag this pin. Arrow keys move it; Shift moves farther. Enter saves; Escape cancels.");d.id=`pin-move-${Math.random().toString(36).slice(2,8)}`;let p=w("span","pin-move-status");p.setAttribute("role","status");let g=v=>{if(c)return;c=!0,i.abort(),s&&t.hasPointerCapture?.(s.pointer)&&t.releasePointerCapture(s.pointer),s=null,u.remove(),delete t.dataset.moving,delete t.dataset.dragging,t.removeAttribute("aria-describedby");let x=a.x!==e.point.x||a.y!==e.point.y;e.finish(v&&x?a:null)},y=(v,x=!1)=>{let h=e.bounds();a={x:Math.max(h.left,Math.min(h.right,v.x)),y:Math.max(h.top,Math.min(h.bottom,v.y))},e.preview(a),x&&(p.textContent=`Pin moved ${Math.round(a.x-e.point.x)} pixels horizontally, ${Math.round(a.y-e.point.y)} vertically. Enter saves.`)};u.append(d,Oe("Save position",()=>g(!0),"primary"),Oe("Cancel move",()=>g(!1),"secondary"),p),n.append(u),t.dataset.moving="true",t.dataset.dragging="true",t.setAttribute("aria-describedby",d.id),t.addEventListener("pointerdown",v=>{v.button!==0||s||(v.preventDefault(),v.stopPropagation(),s={pointer:v.pointerId,x:v.clientX,y:v.clientY,point:a},l=!1,t.setPointerCapture(v.pointerId))},{signal:r}),t.addEventListener("pointermove",v=>{if(!s||v.pointerId!==s.pointer)return;let x=v.clientX-s.x,h=v.clientY-s.y;!l&&Math.hypot(x,h)<4||(l=!0,v.preventDefault(),y({x:s.point.x+x,y:s.point.y+h}))},{signal:r}),t.addEventListener("pointerup",v=>{if(!s||v.pointerId!==s.pointer)return;let x=s.pointer;l&&y({x:s.point.x+v.clientX-s.x,y:s.point.y+v.clientY-s.y}),s=null,t.hasPointerCapture?.(x)&&t.releasePointerCapture(x),l&&g(!0)},{signal:r});for(let v of["pointercancel","lostpointercapture"])t.addEventListener(v,()=>{s&&g(!1)},{signal:r});return t.addEventListener("click",v=>{v.preventDefault(),v.stopImmediatePropagation()},{capture:!0,signal:r}),o.addEventListener("keydown",v=>{if(v.key==="Escape"){v.preventDefault(),v.stopImmediatePropagation(),g(!1);return}if(!v.composedPath().includes(t)||v.altKey||v.ctrlKey||v.metaKey||v.isComposing)return;let x=v.shiftKey?10:1,m={ArrowLeft:{x:-x,y:0},ArrowRight:{x,y:0},ArrowUp:{x:0,y:-x},ArrowDown:{x:0,y:x}}[v.key];!m&&v.key!=="Enter"&&v.key!==" "||(v.preventDefault(),v.stopImmediatePropagation(),m?y({x:a.x+m.x,y:a.y+m.y},!0):g(!0))},{capture:!0,signal:r}),o.addEventListener("resize",()=>g(!1),{signal:r}),t.focus({preventScroll:!0}),{cancel:()=>g(!1)}}var RN=O(()=>{"use strict";It()});function rM(e){let t=e.pathname.split("/").filter(Boolean).map(o=>{try{return decodeURIComponent(o)}catch{return o}});return t.filter(o=>!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(o)).map(o=>o.replace(/(?<=\p{L})-(?=\p{L})/gu," ").replace(/_/g," ").replace(/\s+/g," ").trim()).filter(Boolean).join(" \u203A ")||(t.length?"Page link":"Home")}var aM=e=>`palette:setup:${e.endpoint}:${e.onboarding?.code}`;function sM(e,t){try{localStorage.setItem(aM(e),JSON.stringify({project:t.project,repo:t.repo}))}catch{}}function lM(e){if(!e.onboarding?.inProject)return e;try{let t=JSON.parse(localStorage.getItem(aM(e))||"null");if(typeof t?.project=="string"&&t.project.startsWith("komo_")&&typeof t.repo=="string")return{...e,project:t.project,repo:t.repo,onboarding:void 0}}catch{}return e}function cM(e,t){let n=e.split(/\s+/).filter(Boolean).map(i=>{let r;try{r=new URL(i)}catch{throw new Error("Enter a full HTTPS site address, such as https://your-site.com.")}if(r.protocol!=="https:"||r.username||r.password)throw new Error("Use HTTPS addresses for production and preview sites.");return r.origin}),o=[...new Set([t,...n])];if(o.length>10)throw new Error("Connect up to ten sites at a time.");return o}function dM(e,t,n=[location.origin]){let o=new URL(e.endpoint),i=new URL("/setup/connect",o);i.searchParams.set("code",e.onboarding.code),i.searchParams.set("origin",location.origin),i.searchParams.set("sites",JSON.stringify(n));let r=window.open("about:blank","palette-connect","popup,width=600,height=720");return r?new Promise((a,s)=>{let l=()=>{window.removeEventListener("message",d),t.removeEventListener("abort",u),clearInterval(p),clearTimeout(g),r.close()},c=y=>{l(),s(new Error(y))},u=()=>c("Setup closed. Reopen inline feedback to try again."),d=y=>{let v=y.data;y.origin!==o.origin||y.source!==r||v?.type!=="komo:setup"||v.code!==e.onboarding?.code||typeof v.project!="string"||!/^komo_[a-f0-9]{32}$/.test(v.project)||typeof v.repo!="string"||typeof v.token!="string"||!v.token||v.user?.verified!==!0||typeof v.user.id!="string"||!v.user.id.startsWith("google:")||typeof v.user.name!="string"||(l(),a(v))},p=window.setInterval(()=>{r.closed&&c("Sign-in closed. Try connecting again.")},1e3),g=window.setTimeout(()=>c("Setup expired. Run palette init again."),6e5);window.addEventListener("message",d),t.addEventListener("abort",u,{once:!0}),t.aborted?u():r.location.href=i.href}):Promise.reject(new Error("Allow popups to set up inline feedback."))}function uM(e){let t,n=!1,o=!1,i=!1,r=0,a=()=>{if(clearTimeout(t),o||!e.enabled())return;let c=e.active()?Math.min(Math.max(15e3,e.interval),e.interval*2**Math.min(r,3)):Math.max(6e4,e.interval);t=setTimeout(s,c*(.9+Math.random()*.2))},s=async()=>{if(!(o||!e.enabled())){if(n){i=!0;return}n=!0;try{r=await e.read()?0:r+1}catch{r++}finally{n=!1,i?(i=!1,l()):a()}}};function l(c=!0){r=0,clearTimeout(t),c?s():n||a()}return{wake:l,stop(){o=!0,clearTimeout(t)}}}function rg(e,t){let n=e.x<t/2?"right":"left",o=e.component;if(!o)return n;let{left:i,top:r,right:a,bottom:s}=o;if(a<=i||s<=r)return n;let c=Math.hypot(Math.max(i-e.x,0,e.x-a),Math.max(r-e.y,0,e.y-s))||Math.min(e.x-i,a-e.x,e.y-r,s-e.y),u=(i+a)/2;return c>100||e.x===u?n:e.x<u?"right":"left"}function pM(e,t){let n=new Map;for(let i of e){if(i.resolved||i.anchor.unstacked)continue;let r=t(i);if(r===null)continue;let a=n.get(r)??[];a.push(i),n.set(r,a)}let o=new Map;for(let i of n.values())if(!(i.length<2)){i.sort(Px);for(let r of i)o.set(r.id,i)}return o}var Px=(e,t)=>e.createdAt-t.createdAt||e.id.localeCompare(t.id),Aj=e=>e>3?1:e;function fM(e,t){let n=Aj(e);return Math.max(24,t*(1+(n-1)*.4)+(e>3?26:0)+4)}function mM(e,t,n,o=24){let i=n?e+9-o:e-9;return{left:i,top:t-18,right:i+o,bottom:t+6}}function gM(e){let t=e.map((i,r)=>r),n=i=>t[i]===i?i:t[i]=n(t[i]);e.forEach((i,r)=>{for(let a=r+1;i&&a<e.length;a++){let s=e[a];s&&i.left<s.right&&s.left<i.right&&i.top<s.bottom&&s.top<i.bottom&&(t[n(a)]=n(r))}});let o=new Map;return e.forEach((i,r)=>{let a=n(r);o.set(a,[...o.get(a)??[],r])}),[...o.values()]}Gx();var Xo=(e,t)=>({value:e.style.getPropertyValue(t),priority:e.style.getPropertyPriority(t)}),pl=(e,t,n)=>{e.style.setProperty(t,n.value,n.priority)},wM=(e,t)=>{t&&!e.style.length&&(e.getAttribute("style"),e.removeAttribute("style"))};function Fu(e,t){let n=e.getAttribute("style"),o=e.style.cssText,i=t.map(r=>[r,Xo(e,r)]);return()=>{for(let[r,a]of i)pl(e,r,a);e.style.cssText===o&&(n===null?(e.getAttribute("style"),e.removeAttribute("style")):e.setAttribute("style",n))}}var Fx=e=>e&&e!=="none"?e.match(/calc\(.*?\)|[^\s(]+/g)??[]:[],Yx=(e,t="0px 0px")=>[{scale:String(e),translate:t},{scale:String(e),translate:t}];function Nc(e,t){for(let n of e.getAnimations?.()??[])"transitionProperty"in n&&t.includes(String(n.transitionProperty))&&n.cancel()}function EM(e,t,n,o){let i=new Map,r=null,a=0,s,l=!1,c=0,u=()=>{c||(c=requestAnimationFrame(()=>{c=0,e.ownerDocument.defaultView?.dispatchEvent(new Event("resize")),g()}))},d=new ResizeObserver(g),p=new MutationObserver(S=>{r&&S.some(A=>{let _=A.target;return!(_ instanceof HTMLElement)||_===t||t.contains(_)||_===e||e.contains(_)?!1:A.type!=="attributes"||A.attributeName!=="style"||i.get(_)?.style!==_.getAttribute("style")&&![...i.values()].some(T=>T.constraints?.get(_)?.style===_.getAttribute("style"))})&&g()});function g(){a||!r||(a=requestAnimationFrame(()=>{a=0,b(),o()}))}function y(S,A){!A.animation&&S.style.translate!==A.appliedTranslate&&(A.translate=Xo(S,"translate")),!A.animation&&S.style.scale!==A.appliedScale&&(A.scale=Xo(S,"scale")),A.animation?.cancel(),A.animation||(pl(S,"translate",A.translate),pl(S,"scale",A.scale),Nc(S,["translate","scale"]));for(let[_,T]of A.constraints??[])h(_,T);v(S,A),wM(S,A.bare),d.unobserve(S)}function v(S,A){let _=[];for(let[T,H,R]of A.layout??[])pl(S,T,S.style.getPropertyValue(T)===R?H:Xo(S,T)),_.push(T);Nc(S,_),A.layout=void 0}function x(S,A){let _=S.computedStyleMap?.(),T=r.bounds,H=r.zoom??1;if(!_||!T)return;let R=[T.width,T.height].map(B=>B/r.scale),z=[innerWidth/H-R[0],innerHeight/H-R[1]];if(Math.abs(z[0])<.5&&Math.abs(z[1])<.5)return;let F=A.layout=[];["left","right","width","top","bottom","height"].forEach((B,le)=>{let J=+(le>2),V=le%3===1,oe,ue;try{[oe,ue]=[..._.get(B).toSum("px","percent").values].map(Y=>Y.value)}catch{return}if(!ue&&!V)return;let q=Xo(S,B);S.style.setProperty(B,`${oe+ue/100*R[J]+(V?z[J]:0)}px`,"important"),F.push([B,q,S.style.getPropertyValue(B)])}),Nc(S,F.map(([B])=>B))}function h(S,A,_=!1){for(let[T,H]of A.properties)S.style.getPropertyValue(T)!==H.applied&&(H.original=Xo(S,T)),pl(S,T,H.original);wM(S,A.bare),_||d.unobserve(S)}function m(S,A,_,T){A.constraints??=new Map;let H=A.constraints.get(S);H||(H={properties:new Map,style:null,bare:!S.hasAttribute("style")},A.constraints.set(S,H),d.observe(S));let R=getComputedStyle(S),z=B=>R.boxSizing==="border-box"?0:B==="Width"?(parseFloat(R.paddingLeft)||0)+(parseFloat(R.paddingRight)||0)+(parseFloat(R.borderLeftWidth)||0)+(parseFloat(R.borderRightWidth)||0):(parseFloat(R.paddingTop)||0)+(parseFloat(R.paddingBottom)||0)+(parseFloat(R.borderTopWidth)||0)+(parseFloat(R.borderBottomWidth)||0),F={"min-width":"0px","min-height":"0px","max-width":`${Math.max(1,_-z("Width"))}px`,"max-height":`${Math.max(1,T-z("Height"))}px`,overflow:"auto"};for(let[B,le]of Object.entries(F)){let J=H.properties.get(B);J?S.style.getPropertyValue(B)!==J.applied&&(J.original=Xo(S,B),B.startsWith("max-")&&(J.maximum=R.getPropertyValue(B))):H.properties.set(B,J={original:Xo(S,B),applied:"",maximum:B.startsWith("max-")?R.getPropertyValue(B):void 0});let V=J.maximum;S.style.setProperty(B,V&&V!=="none"?`min(${V}, ${le})`:le,"important"),J.applied=S.style.getPropertyValue(B)}Nc(S,Object.keys(F)),H.style=S.getAttribute("style")}function b(){if(!r)return;let S=new Set,A=!1,_=(T,H)=>{if(T===t||T.contains(e))return;let R=getComputedStyle(T).position;if(H===!1)return;if(H!==!0&&R!=="fixed"){for(let xe of T.children)xe instanceof HTMLElement&&_(xe);return}S.add(T);let z=i.get(T);if(z)z.animation&&(T.style.getPropertyPriority("translate")||T.style.getPropertyPriority("scale"))&&(z.animation.cancel(),z.animation=void 0,z.translate=Xo(T,"translate"),z.scale=Xo(T,"scale"),z.appliedTranslate=T.style.translate,z.appliedScale=T.style.scale),!z.animation&&T.style.translate!==z.appliedTranslate&&(z.translate=Xo(T,"translate")),!z.animation&&T.style.scale!==z.appliedScale&&(z.scale=Xo(T,"scale")),T.style.transform!==z.transform&&(z.transform=T.style.transform,z.positioningFrame={...r});else{if(z={translate:Xo(T,"translate"),scale:Xo(T,"scale"),appliedTranslate:T.style.translate,appliedScale:T.style.scale,style:T.getAttribute("style"),bare:!T.hasAttribute("style"),transform:T.style.transform,positioningFrame:l?null:{...r}},typeof T.animate=="function"&&!z.scale.priority&&!z.translate.priority)try{let xe=T.animate(Yx(1),{duration:1,fill:"both",composite:"add"});xe.effect?.composite==="add"?(z.animation=xe,xe.pause(),xe.currentTime=0):xe.cancel()}catch{}i.set(T,z),d.observe(T)}z.animation?z.animation.effect.setKeyframes(Yx(1)):(pl(T,"translate",z.translate),pl(T,"scale",z.scale),Nc(T,["translate","scale"])),v(T,z),R==="fixed"&&x(T,z);let F='[role="dialog"], [role="alertdialog"]',B=T.matches(F)?null:T.querySelector(F);for(let[xe,L]of z.constraints??[])xe!==T&&(h(xe,L,xe===B),z.constraints.delete(xe));let le=getComputedStyle(T),J=Fx(le.translate),V=r.scale,oe=r.zoom??1,ue=H!==!0&&!!T.style.transform&&!T.style.transform.includes("%")&&/^(?:translate(?:3d|X|Y)?\([^%]+\)\s*)+$/i.test(T.style.transform),q=T.getBoundingClientRect(),Y=[r.left,r.top],W=r.bounds??e.getBoundingClientRect(),C=ue?8/oe:0,U=[W.width-2*C,W.height-2*C];if(W.width&&W.height&&(z.constraints?.has(T)||q.width/oe*V>U[0]||q.height/oe*V>U[1])&&m(T,z,U[0]/V,U[1]/V),B instanceof HTMLElement&&W.width&&W.height){let xe=B.getBoundingClientRect();if(z.constraints?.has(T)||xe.width/oe*V>U[0]||xe.height/oe*V>U[1]){let L=Q=>{let Z=Q==="Width"?["left","right"]:["top","bottom"],ae=0;for(let we=B;we!==T&&we.parentElement;we=we.parentElement){let Te=getComputedStyle(we),$=getComputedStyle(we.parentElement);for(let D of Z)ae+=(parseFloat(Te.getPropertyValue(`margin-${D}`))||0)+(parseFloat($.getPropertyValue(`padding-${D}`))||0)+(we.parentElement===T?0:parseFloat($.getPropertyValue(`border-${D}-width`))||0)}return Math.min(U[Q==="Width"?0:1]/V,T[`client${Q}`])-ae};m(B,z,L("Width"),L("Height"))}z.constraints?.has(B)||d.unobserve(B)}let I=T.getBoundingClientRect(),G=ue?[I.left/oe,I.top/oe]:null,te=getComputedStyle(T).transformOrigin.split(" ").map(parseFloat),ie=[T.offsetLeft,T.offsetTop],pe=Y.map((xe,L)=>{let Q=ie[L]+(te[L]||0),Z=xe-(1-V)*Q;if(G&&I){let ae=z.positioningFrame,we=xe+V*(G[L]-(ae?[ae.left,ae.top][L]:0))/(ae?.scale??1);if(W.width&&W.height){let Te=[W.left,W.top][L]+C,$=[W.right,W.bottom][L]-C-[I.width,I.height][L]/oe*V;we=Math.max(Te,Math.min($,we))}Z=we-V*G[L]-(1-V)*Q}return`calc(${Z}px + ${z.animation?V-1:V} * ${J[L]??"0px"})`}).join(" ");z.animation?z.animation.effect.setKeyframes(Yx(V,pe)):(T.style.setProperty("translate",pe,z.translate.priority),T.style.setProperty("scale",Fx(le.scale).length?Fx(le.scale).map(xe=>String(Number(xe)*V)).join(" "):String(V),z.scale.priority),Nc(T,["translate","scale"])),z.appliedTranslate=T.style.translate,z.appliedScale=T.style.scale,z.style=T.getAttribute("style"),A||=(T.getAnimations?.()??[]).some(xe=>xe!==z.animation&&xe.playState==="running"&&xe.effect?.getKeyframes().some(L=>Object.keys(L).some(Q=>/^(transform|translate|scale|left|top|width|height)$/.test(Q))))};for(let T of document.body.children)T instanceof HTMLElement&&_(T,n?.(T));for(let[T,H]of i)S.has(T)||(y(T,H),i.delete(T));A&&g()}function E(){cancelAnimationFrame(a),a=0,s?.abort(),s=void 0,p.disconnect(),d.disconnect();for(let[S,A]of i)y(S,A);i.clear()}return{update(S){let A=r;if(l=!A&&!!S,r=S,!S){E(),A&&u();return}if(!s){s=new AbortController,p.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class","data-state"]});for(let _ of["animationend","animationcancel","transitionend","transitioncancel"])document.addEventListener(_,g,{capture:!0,signal:s.signal});e.addEventListener("scroll",u,{passive:!0,signal:s.signal})}b(),l=!1,(!A||A.scale!==S.scale||A.left!==S.left||A.top!==S.top)&&u()},reposition:u,destroy(){r=null,E(),cancelAnimationFrame(c)}}}var Mj=/(?<![\w.#-])(-?[\d.]+)[sld]?v(w|h|i|b|min|max)\b/g,Xx='[style*="vw"],[style*="vh"],[style*="vmin"],[style*="vmax"]';function kM(e){let t=new Map,n=null,o=-1,i=0,r=null,a=!1,s=x=>x.includes("url(")?x:x.replace(Mj,(h,m,b)=>{let[E,S]=n,A=b==="w"||b==="i"?E:b==="h"||b==="b"?S:Math[b](E,S);return`${+m*A/100}px`});function l(x,h){let m=t.get(x);for(let b=0;b<x.length;b++){let E=x[b],S=x.getPropertyValue(E),A=m?.values.get(E),_=A&&A[2]===S?A[0]:S,T=s(_);if(T===_){m?.values.delete(E);continue}if(T===S)continue;m||t.set(x,m={node:h,attribute:h?.getAttribute("style")??null,css:x.cssText,values:new Map});let H=x.getPropertyPriority(E);x.setProperty(E,T,H),m.values.set(E,[_,H,x.getPropertyValue(E)])}}let c=x=>{for(let h of x){let{style:m,cssRules:b,styleSheet:E}=h;m&&l(m),b&&c(b),E&&u(E,c)}},u=(x,h)=>{try{h(x.cssRules)}catch{}},d=()=>[...document.styleSheets,...document.adoptedStyleSheets??[]],p=x=>{x!==e&&x instanceof HTMLElement&&(t.has(x.style)||x.matches(Xx))&&l(x.style,x)};function g(x){if(n){if(x){for(let h of d())u(h,c);for(let h of[...[...t.values()].map(m=>m.node),...document.querySelectorAll(Xx)])h&&p(h)}else for(let h of r??[]){p(h);for(let m of h.querySelectorAll(Xx))p(m)}r=null,y.takeRecords()}}let y=new MutationObserver(x=>{for(let{target:h,addedNodes:m}of x){/^(STYLE|LINK)$/.test(h.nodeName)&&(a=!0);for(let b of[h,...m])b instanceof Element&&(/^(STYLE|LINK)$/.test(b.nodeName)&&(a=!0),(r??=new Set).add(b))}i||=requestAnimationFrame(()=>{i=0,g(a),a=!1})}),v=x=>{x.target instanceof HTMLLinkElement&&g(!0)};return{update(x){if(!x){if(!n)return;n=null,y.disconnect(),cancelAnimationFrame(i),i=0,r=null,document.removeEventListener("load",v,!0);for(let[m,{node:b,attribute:E,css:S,values:A}]of t){for(let[_,[T,H,R]]of A)m.getPropertyValue(_)===R&&m.setProperty(_,T,H);b&&E!==null&&m.cssText===S&&b.setAttribute("style",E)}t.clear(),o=-1;return}n||(y.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),document.addEventListener("load",v,!0));let h=0;for(let m of d())u(m,b=>h+=b.length);n&&n[0]===x[0]&&n[1]===x[1]&&h===o||(n=x,o=h,g(!0))}}}var Wx="palette-shell",Zx="komo-shell",Cj="palette:shell",SM="palette:shell-off";function TM(e){try{if(/^(palette|komo)-viewport$/.test(window.name))return"";let t=new URL(location.href).searchParams,n=t.get(Wx)??t.get(Zx),o=JSON.parse(sessionStorage.getItem(Cj)??sessionStorage.getItem("komo:shell")??"null");return n&&o?.v===1&&o.nonce===n&&o.project===e&&o.origin===location.origin?n:""}catch{return""}}var Lj=()=>[Symbol.for("palette.shell"),Symbol.for("komo.shell")];function AM(e){for(let t of Lj())window[t]=e}Yu();ho();var fg=class{constructor(t,n,o=i=>i){this.confirmed=t;this.changed=n;this.normalize=o}confirmed;changed;normalize;jobs=[];aliases=new Map;revision=0;get busy(){return this.jobs.length>0}id=t=>this.aliases.get(t)??t;get value(){return this.normalize(this.jobs.reduce((t,n)=>n.change(t,this.id),this.confirmed),this.id)}replace(t,n=this.revision){return this.busy||n!==this.revision?!1:(this.confirmed=t,this.changed(this.value),!0)}reset(t){let n=this.jobs;this.jobs=[],this.aliases.clear(),this.confirmed=t,this.revision++;for(let o of n)o.reject(new DOMException("Session changed","AbortError"));this.changed(this.value)}submit(t,n){let o=new Promise((i,r)=>{this.jobs.push({change:t,save:n,resolve:i,reject:r})});return this.revision++,this.changed(this.value),this.jobs.length===1&&this.drain(),o}async drain(){for(;this.jobs.length;){let t=this.jobs[0],n,o=!1;try{let i=await t.save(this.id);if(this.jobs[0]!==t)return;this.confirmed=t.change(this.confirmed,this.id);for(let[r,a]of Object.entries(i??{}))this.aliases.set(r,a);this.confirmed=this.normalize(this.confirmed,this.id)}catch(i){o=!0,n=i}if(this.jobs[0]!==t)return;this.jobs.shift(),this.revision++,this.changed(this.value),o?t.reject(n):t.resolve()}}};var _M=e=>e.split(`
379
+ `)||void 0;sr(N),J?.tokens?.reset(),Ze(),e.onComment(N,He)},()=>{b.textContent="Comment unavailable \xB7 try again"}))});let vn=()=>Re(!1);for(let N of[x,E,z])for(let Me of["pointerdown","focusin","click","input"])N.addEventListener(Me,vn,!0);e.root.addEventListener("palette-announce",N=>{let Me=e.root.querySelector(".sr-only[aria-live]");Me&&(Me.textContent=N.detail)},{signal:Te.signal}),document.addEventListener("pointermove",Pn,{capture:!0,signal:Te.signal}),document.addEventListener("pointerdown",ir,{capture:!0,signal:Te.signal}),document.addEventListener("click",ci,{capture:!0,signal:Te.signal}),document.addEventListener("keydown",Di,{capture:!0,signal:Te.signal}),window.addEventListener("keydown",_o,{signal:Te.signal}),window.addEventListener("scroll",Ve,{capture:!0,passive:!0,signal:Te.signal}),window.addEventListener("resize",Ve,{passive:!0,signal:Te.signal});for(let[N,Me,He]of[["pointermove",Pn],["pointerdown",ir],["click",ci],["keydown",Di],["keydown",_o,1],["scroll",Ve,1],["resize",Ve,1]])so(N,Me,{capture:N!=="resize"&&!(He&&N==="keydown"),passive:N==="scroll"||N==="resize",signal:Te.signal},He?"window":"document");pg(e.host,()=>V?[Y??W,W]:[],Ve,Te.signal,()=>{gt()||K()});let Tm=$().then(N=>{if(Te.signal.aborted)return;Zt=N.keepFocus;let Me=He=>{ue=!0,ht(He),jn(He)};rr=N.designKeyboard({host:e.host,compare:F,reserved:e.reservedKey,root:e.root,undo:A,redo:_,keys:e.keys,signal:Te.signal,selected:()=>U===C()?Y:null,comment(){return!Y||R.disabled?!1:(R.click(),!0)},select:Me,compareBefore(He){Re(He??!de)},help:e.shortcutHelp}),N.watchDesignStatus(b,h,()=>!!G?.element,Te.signal),J=N.selectionViews({help:e.shortcutHelp,select:Me,peek(He){_e=He,ue=!0,et()},before(He){ye.length=0,Re(He)},reset:Ln,items:()=>[...I].filter(([He])=>Mn(He)).map(([He,Je])=>({element:He,here:Je===C()&&He.isConnected,count:ct(He),proposal:ca(He,N.designProposal)})),message:He=>{b.textContent=He},mode:e,signal:Te.signal,history:fe,update:Ze,clear:K}),h.before(J.chip),t.textContent+=J.styles,A.innerHTML=J.icons.undo,_.innerHTML=J.icons.redo,T.innerHTML=J.icons.reset,le.append(J.pending),V?pt():Qt()},()=>{b.textContent="Selection tools unavailable \xB7 try again"});return{setActive:ar,select:ht,clearSelection:K,setReturnAction(N){l=N,c.hidden=!N,N&&(c.setAttribute("aria-label",N.label),c.title=N.label)},mountPanel(N){i.parentElement!==N&&(i.parentElement?.removeAttribute("data-design-empty"),N.append(i),Qt())},get active(){return V},get selected(){return Y},get edited(){return fe.length>0},ready:Promise.all([o,Tm]).then(()=>{i.dataset.ready=""}),destroy(){G?.finish(!0),ar(!1),Ln(),clearTimeout(q),clearTimeout(ie),clearTimeout(ve),Ct?.disconnect(),Te.abort(),cancelAnimationFrame(te),i.remove(),r.remove(),a.remove(),t.remove()}}}var el,CN,L2,_N=O(()=>{"use strict";Fs();Li();gO();It();ea();Gx();ho();Sy();el=(e,t)=>Object.assign(w("button",e,t),{type:"button"}),CN=e=>typeof matchMedia=="function"&&matchMedia(e).matches,L2=()=>CN("(prefers-reduced-motion: reduce)")});var DN={};Ft(DN,{startPinMove:()=>qG});function qG(e){let{pin:t,root:n}=e,o=t.ownerDocument.defaultView,i=new AbortController,r=i.signal,a={...e.point},s=null,l=!1,c=!1,u=w("section","pin-move");u.setAttribute("role","group"),u.setAttribute("aria-label","Move pin");let d=w("p","","Drag this pin. Arrow keys move it; Shift moves farther. Enter saves; Escape cancels.");d.id=`pin-move-${Math.random().toString(36).slice(2,8)}`;let p=w("span","pin-move-status");p.setAttribute("role","status");let g=v=>{if(c)return;c=!0,i.abort(),s&&t.hasPointerCapture?.(s.pointer)&&t.releasePointerCapture(s.pointer),s=null,u.remove(),delete t.dataset.moving,delete t.dataset.dragging,t.removeAttribute("aria-describedby");let x=a.x!==e.point.x||a.y!==e.point.y;e.finish(v&&x?a:null)},y=(v,x=!1)=>{let h=e.bounds();a={x:Math.max(h.left,Math.min(h.right,v.x)),y:Math.max(h.top,Math.min(h.bottom,v.y))},e.preview(a),x&&(p.textContent=`Pin moved ${Math.round(a.x-e.point.x)} pixels horizontally, ${Math.round(a.y-e.point.y)} vertically. Enter saves.`)};u.append(d,Oe("Save position",()=>g(!0),"primary"),Oe("Cancel move",()=>g(!1),"secondary"),p),n.append(u),t.dataset.moving="true",t.dataset.dragging="true",t.setAttribute("aria-describedby",d.id),t.addEventListener("pointerdown",v=>{v.button!==0||s||(v.preventDefault(),v.stopPropagation(),s={pointer:v.pointerId,x:v.clientX,y:v.clientY,point:a},l=!1,t.setPointerCapture(v.pointerId))},{signal:r}),t.addEventListener("pointermove",v=>{if(!s||v.pointerId!==s.pointer)return;let x=v.clientX-s.x,h=v.clientY-s.y;!l&&Math.hypot(x,h)<4||(l=!0,v.preventDefault(),y({x:s.point.x+x,y:s.point.y+h}))},{signal:r}),t.addEventListener("pointerup",v=>{if(!s||v.pointerId!==s.pointer)return;let x=s.pointer;l&&y({x:s.point.x+v.clientX-s.x,y:s.point.y+v.clientY-s.y}),s=null,t.hasPointerCapture?.(x)&&t.releasePointerCapture(x),l&&g(!0)},{signal:r});for(let v of["pointercancel","lostpointercapture"])t.addEventListener(v,()=>{s&&g(!1)},{signal:r});return t.addEventListener("click",v=>{v.preventDefault(),v.stopImmediatePropagation()},{capture:!0,signal:r}),o.addEventListener("keydown",v=>{if(v.key==="Escape"){v.preventDefault(),v.stopImmediatePropagation(),g(!1);return}if(!v.composedPath().includes(t)||v.altKey||v.ctrlKey||v.metaKey||v.isComposing)return;let x=v.shiftKey?10:1,m={ArrowLeft:{x:-x,y:0},ArrowRight:{x,y:0},ArrowUp:{x:0,y:-x},ArrowDown:{x:0,y:x}}[v.key];!m&&v.key!=="Enter"&&v.key!==" "||(v.preventDefault(),v.stopImmediatePropagation(),m?y({x:a.x+m.x,y:a.y+m.y},!0):g(!0))},{capture:!0,signal:r}),o.addEventListener("resize",()=>g(!1),{signal:r}),t.focus({preventScroll:!0}),{cancel:()=>g(!1)}}var RN=O(()=>{"use strict";It()});function rM(e){let t=e.pathname.split("/").filter(Boolean).map(o=>{try{return decodeURIComponent(o)}catch{return o}});return t.filter(o=>!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(o)).map(o=>o.replace(/(?<=\p{L})-(?=\p{L})/gu," ").replace(/_/g," ").replace(/\s+/g," ").trim()).filter(Boolean).join(" \u203A ")||(t.length?"Page link":"Home")}var aM=e=>`palette:setup:${e.endpoint}:${e.onboarding?.code}`;function sM(e,t){try{localStorage.setItem(aM(e),JSON.stringify({project:t.project,repo:t.repo}))}catch{}}function lM(e){if(!e.onboarding?.inProject)return e;try{let t=JSON.parse(localStorage.getItem(aM(e))||"null");if(typeof t?.project=="string"&&t.project.startsWith("komo_")&&typeof t.repo=="string")return{...e,project:t.project,repo:t.repo,onboarding:void 0}}catch{}return e}function cM(e,t){let n=e.split(/\s+/).filter(Boolean).map(i=>{let r;try{r=new URL(i)}catch{throw new Error("Enter a full HTTPS site address, such as https://your-site.com.")}if(r.protocol!=="https:"||r.username||r.password)throw new Error("Use HTTPS addresses for production and preview sites.");return r.origin}),o=[...new Set([t,...n])];if(o.length>10)throw new Error("Connect up to ten sites at a time.");return o}function dM(e,t,n=[location.origin]){let o=new URL(e.endpoint),i=new URL("/setup/connect",o);i.searchParams.set("code",e.onboarding.code),i.searchParams.set("origin",location.origin),i.searchParams.set("sites",JSON.stringify(n));let r=window.open("about:blank","palette-connect","popup,width=600,height=720");return r?new Promise((a,s)=>{let l=()=>{window.removeEventListener("message",d),t.removeEventListener("abort",u),clearInterval(p),clearTimeout(g),r.close()},c=y=>{l(),s(new Error(y))},u=()=>c("Setup closed. Reopen inline feedback to try again."),d=y=>{let v=y.data;y.origin!==o.origin||y.source!==r||v?.type!=="komo:setup"||v.code!==e.onboarding?.code||typeof v.project!="string"||!/^komo_[a-f0-9]{32}$/.test(v.project)||typeof v.repo!="string"||typeof v.token!="string"||!v.token||v.user?.verified!==!0||typeof v.user.id!="string"||!v.user.id.startsWith("google:")||typeof v.user.name!="string"||(l(),a(v))},p=window.setInterval(()=>{r.closed&&c("Sign-in closed. Try connecting again.")},1e3),g=window.setTimeout(()=>c("Setup expired. Run palette init again."),6e5);window.addEventListener("message",d),t.addEventListener("abort",u,{once:!0}),t.aborted?u():r.location.href=i.href}):Promise.reject(new Error("Allow popups to set up inline feedback."))}function uM(e){let t,n=!1,o=!1,i=!1,r=0,a=()=>{if(clearTimeout(t),o||!e.enabled())return;let c=e.active()?Math.min(Math.max(15e3,e.interval),e.interval*2**Math.min(r,3)):Math.max(6e4,e.interval);t=setTimeout(s,c*(.9+Math.random()*.2))},s=async()=>{if(!(o||!e.enabled())){if(n){i=!0;return}n=!0;try{r=await e.read()?0:r+1}catch{r++}finally{n=!1,i?(i=!1,l()):a()}}};function l(c=!0){r=0,clearTimeout(t),c?s():n||a()}return{wake:l,stop(){o=!0,clearTimeout(t)}}}function rg(e,t){let n=e.x<t/2?"right":"left",o=e.component;if(!o)return n;let{left:i,top:r,right:a,bottom:s}=o;if(a<=i||s<=r)return n;let c=Math.hypot(Math.max(i-e.x,0,e.x-a),Math.max(r-e.y,0,e.y-s))||Math.min(e.x-i,a-e.x,e.y-r,s-e.y),u=(i+a)/2;return c>100||e.x===u?n:e.x<u?"right":"left"}function pM(e,t){let n=new Map;for(let i of e){if(i.resolved||i.anchor.unstacked)continue;let r=t(i);if(r===null)continue;let a=n.get(r)??[];a.push(i),n.set(r,a)}let o=new Map;for(let i of n.values())if(!(i.length<2)){i.sort(Px);for(let r of i)o.set(r.id,i)}return o}var Px=(e,t)=>e.createdAt-t.createdAt||e.id.localeCompare(t.id),Aj=e=>e>3?1:e;function fM(e,t){let n=Aj(e);return Math.max(24,t*(1+(n-1)*.4)+(e>3?26:0)+4)}function mM(e,t,n,o=24){let i=n?e+9-o:e-9;return{left:i,top:t-18,right:i+o,bottom:t+6}}function gM(e){let t=e.map((i,r)=>r),n=i=>t[i]===i?i:t[i]=n(t[i]);e.forEach((i,r)=>{for(let a=r+1;i&&a<e.length;a++){let s=e[a];s&&i.left<s.right&&s.left<i.right&&i.top<s.bottom&&s.top<i.bottom&&(t[n(a)]=n(r))}});let o=new Map;return e.forEach((i,r)=>{let a=n(r);o.set(a,[...o.get(a)??[],r])}),[...o.values()]}Gx();var Xo=(e,t)=>({value:e.style.getPropertyValue(t),priority:e.style.getPropertyPriority(t)}),pl=(e,t,n)=>{e.style.setProperty(t,n.value,n.priority)},wM=(e,t)=>{t&&!e.style.length&&(e.getAttribute("style"),e.removeAttribute("style"))};function Fu(e,t){let n=e.getAttribute("style"),o=e.style.cssText,i=t.map(r=>[r,Xo(e,r)]);return()=>{for(let[r,a]of i)pl(e,r,a);e.style.cssText===o&&(n===null?(e.getAttribute("style"),e.removeAttribute("style")):e.setAttribute("style",n))}}var Fx=e=>e&&e!=="none"?e.match(/calc\(.*?\)|[^\s(]+/g)??[]:[],Yx=(e,t="0px 0px")=>[{scale:String(e),translate:t},{scale:String(e),translate:t}];function Nc(e,t){for(let n of e.getAnimations?.()??[])"transitionProperty"in n&&t.includes(String(n.transitionProperty))&&n.cancel()}function EM(e,t,n,o){let i=new Map,r=null,a=0,s,l=!1,c=0,u=()=>{c||(c=requestAnimationFrame(()=>{c=0,e.ownerDocument.defaultView?.dispatchEvent(new Event("resize")),g()}))},d=new ResizeObserver(g),p=new MutationObserver(S=>{r&&S.some(A=>{let _=A.target;return!(_ instanceof HTMLElement)||_===t||t.contains(_)||_===e||e.contains(_)?!1:A.type!=="attributes"||A.attributeName!=="style"||i.get(_)?.style!==_.getAttribute("style")&&![...i.values()].some(T=>T.constraints?.get(_)?.style===_.getAttribute("style"))})&&g()});function g(){a||!r||(a=requestAnimationFrame(()=>{a=0,b(),o()}))}function y(S,A){!A.animation&&S.style.translate!==A.appliedTranslate&&(A.translate=Xo(S,"translate")),!A.animation&&S.style.scale!==A.appliedScale&&(A.scale=Xo(S,"scale")),A.animation?.cancel(),A.animation||(pl(S,"translate",A.translate),pl(S,"scale",A.scale),Nc(S,["translate","scale"]));for(let[_,T]of A.constraints??[])h(_,T);v(S,A),wM(S,A.bare),d.unobserve(S)}function v(S,A){let _=[];for(let[T,H,R]of A.layout??[])pl(S,T,S.style.getPropertyValue(T)===R?H:Xo(S,T)),_.push(T);Nc(S,_),A.layout=void 0}function x(S,A){let _=S.computedStyleMap?.(),T=r.bounds,H=r.zoom??1;if(!_||!T)return;let R=[T.width,T.height].map(B=>B/r.scale),z=[innerWidth/H-R[0],innerHeight/H-R[1]];if(Math.abs(z[0])<.5&&Math.abs(z[1])<.5)return;let F=A.layout=[];["left","right","width","top","bottom","height"].forEach((B,le)=>{let J=+(le>2),V=le%3===1,oe,ue;try{[oe,ue]=[..._.get(B).toSum("px","percent").values].map(Y=>Y.value)}catch{return}if(!ue&&!V)return;let q=Xo(S,B);S.style.setProperty(B,`${oe+ue/100*R[J]+(V?z[J]:0)}px`,"important"),F.push([B,q,S.style.getPropertyValue(B)])}),Nc(S,F.map(([B])=>B))}function h(S,A,_=!1){for(let[T,H]of A.properties)S.style.getPropertyValue(T)!==H.applied&&(H.original=Xo(S,T)),pl(S,T,H.original);wM(S,A.bare),_||d.unobserve(S)}function m(S,A,_,T){A.constraints??=new Map;let H=A.constraints.get(S);H||(H={properties:new Map,style:null,bare:!S.hasAttribute("style")},A.constraints.set(S,H),d.observe(S));let R=getComputedStyle(S),z=B=>R.boxSizing==="border-box"?0:B==="Width"?(parseFloat(R.paddingLeft)||0)+(parseFloat(R.paddingRight)||0)+(parseFloat(R.borderLeftWidth)||0)+(parseFloat(R.borderRightWidth)||0):(parseFloat(R.paddingTop)||0)+(parseFloat(R.paddingBottom)||0)+(parseFloat(R.borderTopWidth)||0)+(parseFloat(R.borderBottomWidth)||0),F={"min-width":"0px","min-height":"0px","max-width":`${Math.max(1,_-z("Width"))}px`,"max-height":`${Math.max(1,T-z("Height"))}px`,overflow:"auto"};for(let[B,le]of Object.entries(F)){let J=H.properties.get(B);J?S.style.getPropertyValue(B)!==J.applied&&(J.original=Xo(S,B),B.startsWith("max-")&&(J.maximum=R.getPropertyValue(B))):H.properties.set(B,J={original:Xo(S,B),applied:"",maximum:B.startsWith("max-")?R.getPropertyValue(B):void 0});let V=J.maximum;S.style.setProperty(B,V&&V!=="none"?`min(${V}, ${le})`:le,"important"),J.applied=S.style.getPropertyValue(B)}Nc(S,Object.keys(F)),H.style=S.getAttribute("style")}function b(){if(!r)return;let S=new Set,A=!1,_=(T,H)=>{if(T===t||T.contains(e))return;let R=getComputedStyle(T).position;if(H===!1)return;if(H!==!0&&R!=="fixed"){for(let xe of T.children)xe instanceof HTMLElement&&_(xe);return}S.add(T);let z=i.get(T);if(z)z.animation&&(T.style.getPropertyPriority("translate")||T.style.getPropertyPriority("scale"))&&(z.animation.cancel(),z.animation=void 0,z.translate=Xo(T,"translate"),z.scale=Xo(T,"scale"),z.appliedTranslate=T.style.translate,z.appliedScale=T.style.scale),!z.animation&&T.style.translate!==z.appliedTranslate&&(z.translate=Xo(T,"translate")),!z.animation&&T.style.scale!==z.appliedScale&&(z.scale=Xo(T,"scale")),T.style.transform!==z.transform&&(z.transform=T.style.transform,z.positioningFrame={...r});else{if(z={translate:Xo(T,"translate"),scale:Xo(T,"scale"),appliedTranslate:T.style.translate,appliedScale:T.style.scale,style:T.getAttribute("style"),bare:!T.hasAttribute("style"),transform:T.style.transform,positioningFrame:l?null:{...r}},typeof T.animate=="function"&&!z.scale.priority&&!z.translate.priority)try{let xe=T.animate(Yx(1),{duration:1,fill:"both",composite:"add"});xe.effect?.composite==="add"?(z.animation=xe,xe.pause(),xe.currentTime=0):xe.cancel()}catch{}i.set(T,z),d.observe(T)}z.animation?z.animation.effect.setKeyframes(Yx(1)):(pl(T,"translate",z.translate),pl(T,"scale",z.scale),Nc(T,["translate","scale"])),v(T,z),R==="fixed"&&x(T,z);let F='[role="dialog"], [role="alertdialog"]',B=T.matches(F)?null:T.querySelector(F);for(let[xe,L]of z.constraints??[])xe!==T&&(h(xe,L,xe===B),z.constraints.delete(xe));let le=getComputedStyle(T),J=Fx(le.translate),V=r.scale,oe=r.zoom??1,ue=H!==!0&&!!T.style.transform&&!T.style.transform.includes("%")&&/^(?:translate(?:3d|X|Y)?\([^%]+\)\s*)+$/i.test(T.style.transform),q=T.getBoundingClientRect(),Y=[r.left,r.top],W=r.bounds??e.getBoundingClientRect(),C=ue?8/oe:0,U=[W.width-2*C,W.height-2*C];if(W.width&&W.height&&(z.constraints?.has(T)||q.width/oe*V>U[0]||q.height/oe*V>U[1])&&m(T,z,U[0]/V,U[1]/V),B instanceof HTMLElement&&W.width&&W.height){let xe=B.getBoundingClientRect();if(z.constraints?.has(T)||xe.width/oe*V>U[0]||xe.height/oe*V>U[1]){let L=Q=>{let Z=Q==="Width"?["left","right"]:["top","bottom"],se=0;for(let we=B;we!==T&&we.parentElement;we=we.parentElement){let Te=getComputedStyle(we),$=getComputedStyle(we.parentElement);for(let D of Z)se+=(parseFloat(Te.getPropertyValue(`margin-${D}`))||0)+(parseFloat($.getPropertyValue(`padding-${D}`))||0)+(we.parentElement===T?0:parseFloat($.getPropertyValue(`border-${D}-width`))||0)}return Math.min(U[Q==="Width"?0:1]/V,T[`client${Q}`])-se};m(B,z,L("Width"),L("Height"))}z.constraints?.has(B)||d.unobserve(B)}let I=T.getBoundingClientRect(),G=ue?[I.left/oe,I.top/oe]:null,te=getComputedStyle(T).transformOrigin.split(" ").map(parseFloat),ie=[T.offsetLeft,T.offsetTop],pe=Y.map((xe,L)=>{let Q=ie[L]+(te[L]||0),Z=xe-(1-V)*Q;if(G&&I){let se=z.positioningFrame,we=xe+V*(G[L]-(se?[se.left,se.top][L]:0))/(se?.scale??1);if(W.width&&W.height){let Te=[W.left,W.top][L]+C,$=[W.right,W.bottom][L]-C-[I.width,I.height][L]/oe*V;we=Math.max(Te,Math.min($,we))}Z=we-V*G[L]-(1-V)*Q}return`calc(${Z}px + ${z.animation?V-1:V} * ${J[L]??"0px"})`}).join(" ");z.animation?z.animation.effect.setKeyframes(Yx(V,pe)):(T.style.setProperty("translate",pe,z.translate.priority),T.style.setProperty("scale",Fx(le.scale).length?Fx(le.scale).map(xe=>String(Number(xe)*V)).join(" "):String(V),z.scale.priority),Nc(T,["translate","scale"])),z.appliedTranslate=T.style.translate,z.appliedScale=T.style.scale,z.style=T.getAttribute("style"),A||=(T.getAnimations?.()??[]).some(xe=>xe!==z.animation&&xe.playState==="running"&&xe.effect?.getKeyframes().some(L=>Object.keys(L).some(Q=>/^(transform|translate|scale|left|top|width|height)$/.test(Q))))};for(let T of document.body.children)T instanceof HTMLElement&&_(T,n?.(T));for(let[T,H]of i)S.has(T)||(y(T,H),i.delete(T));A&&g()}function E(){cancelAnimationFrame(a),a=0,s?.abort(),s=void 0,p.disconnect(),d.disconnect();for(let[S,A]of i)y(S,A);i.clear()}return{update(S){let A=r;if(l=!A&&!!S,r=S,!S){E(),A&&u();return}if(!s){s=new AbortController,p.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class","data-state"]});for(let _ of["animationend","animationcancel","transitionend","transitioncancel"])document.addEventListener(_,g,{capture:!0,signal:s.signal});e.addEventListener("scroll",u,{passive:!0,signal:s.signal})}b(),l=!1,(!A||A.scale!==S.scale||A.left!==S.left||A.top!==S.top)&&u()},reposition:u,destroy(){r=null,E(),cancelAnimationFrame(c)}}}var Mj=/(?<![\w.#-])(-?[\d.]+)[sld]?v(w|h|i|b|min|max)\b/g,Xx='[style*="vw"],[style*="vh"],[style*="vmin"],[style*="vmax"]';function kM(e){let t=new Map,n=null,o=-1,i=0,r=null,a=!1,s=x=>x.includes("url(")?x:x.replace(Mj,(h,m,b)=>{let[E,S]=n,A=b==="w"||b==="i"?E:b==="h"||b==="b"?S:Math[b](E,S);return`${+m*A/100}px`});function l(x,h){let m=t.get(x);for(let b=0;b<x.length;b++){let E=x[b],S=x.getPropertyValue(E),A=m?.values.get(E),_=A&&A[2]===S?A[0]:S,T=s(_);if(T===_){m?.values.delete(E);continue}if(T===S)continue;m||t.set(x,m={node:h,attribute:h?.getAttribute("style")??null,css:x.cssText,values:new Map});let H=x.getPropertyPriority(E);x.setProperty(E,T,H),m.values.set(E,[_,H,x.getPropertyValue(E)])}}let c=x=>{for(let h of x){let{style:m,cssRules:b,styleSheet:E}=h;m&&l(m),b&&c(b),E&&u(E,c)}},u=(x,h)=>{try{h(x.cssRules)}catch{}},d=()=>[...document.styleSheets,...document.adoptedStyleSheets??[]],p=x=>{x!==e&&x instanceof HTMLElement&&(t.has(x.style)||x.matches(Xx))&&l(x.style,x)};function g(x){if(n){if(x){for(let h of d())u(h,c);for(let h of[...[...t.values()].map(m=>m.node),...document.querySelectorAll(Xx)])h&&p(h)}else for(let h of r??[]){p(h);for(let m of h.querySelectorAll(Xx))p(m)}r=null,y.takeRecords()}}let y=new MutationObserver(x=>{for(let{target:h,addedNodes:m}of x){/^(STYLE|LINK)$/.test(h.nodeName)&&(a=!0);for(let b of[h,...m])b instanceof Element&&(/^(STYLE|LINK)$/.test(b.nodeName)&&(a=!0),(r??=new Set).add(b))}i||=requestAnimationFrame(()=>{i=0,g(a),a=!1})}),v=x=>{x.target instanceof HTMLLinkElement&&g(!0)};return{update(x){if(!x){if(!n)return;n=null,y.disconnect(),cancelAnimationFrame(i),i=0,r=null,document.removeEventListener("load",v,!0);for(let[m,{node:b,attribute:E,css:S,values:A}]of t){for(let[_,[T,H,R]]of A)m.getPropertyValue(_)===R&&m.setProperty(_,T,H);b&&E!==null&&m.cssText===S&&b.setAttribute("style",E)}t.clear(),o=-1;return}n||(y.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),document.addEventListener("load",v,!0));let h=0;for(let m of d())u(m,b=>h+=b.length);n&&n[0]===x[0]&&n[1]===x[1]&&h===o||(n=x,o=h,g(!0))}}}var Wx="palette-shell",Zx="komo-shell",Cj="palette:shell",SM="palette:shell-off";function TM(e){try{if(/^(palette|komo)-viewport$/.test(window.name))return"";let t=new URL(location.href).searchParams,n=t.get(Wx)??t.get(Zx),o=JSON.parse(sessionStorage.getItem(Cj)??sessionStorage.getItem("komo:shell")??"null");return n&&o?.v===1&&o.nonce===n&&o.project===e&&o.origin===location.origin?n:""}catch{return""}}var Lj=()=>[Symbol.for("palette.shell"),Symbol.for("komo.shell")];function AM(e){for(let t of Lj())window[t]=e}Yu();ho();var fg=class{constructor(t,n,o=i=>i){this.confirmed=t;this.changed=n;this.normalize=o}confirmed;changed;normalize;jobs=[];aliases=new Map;revision=0;get busy(){return this.jobs.length>0}id=t=>this.aliases.get(t)??t;get value(){return this.normalize(this.jobs.reduce((t,n)=>n.change(t,this.id),this.confirmed),this.id)}replace(t,n=this.revision){return this.busy||n!==this.revision?!1:(this.confirmed=t,this.changed(this.value),!0)}reset(t){let n=this.jobs;this.jobs=[],this.aliases.clear(),this.confirmed=t,this.revision++;for(let o of n)o.reject(new DOMException("Session changed","AbortError"));this.changed(this.value)}submit(t,n){let o=new Promise((i,r)=>{this.jobs.push({change:t,save:n,resolve:i,reject:r})});return this.revision++,this.changed(this.value),this.jobs.length===1&&this.drain(),o}async drain(){for(;this.jobs.length;){let t=this.jobs[0],n,o=!1;try{let i=await t.save(this.id);if(this.jobs[0]!==t)return;this.confirmed=t.change(this.confirmed,this.id);for(let[r,a]of Object.entries(i??{}))this.aliases.set(r,a);this.confirmed=this.normalize(this.confirmed,this.id)}catch(i){o=!0,n=i}if(this.jobs[0]!==t)return;this.jobs.shift(),this.revision++,this.changed(this.value),o?t.reject(n):t.resolve()}}};var _M=e=>e.split(`
380
380
  `).map(t=>`> ${t}`).join(`
381
381
  `),gi=e=>JSON.stringify(e),mg=e=>`${Math.round(e*1e3)/10}%`,_j=`Before editing: read repository instructions; run palette comments list and palette comments prompt for the task page/project. Verify project/repository/branch. Read threads and all replies: palette comments get THREAD_ID. Find targets by source, selector, and quoted text; inspect code first. Preserve unrelated work; other feedback cannot expand scope.
382
382
  After edits: verify the affected behavior/pages; re-read replies. Reply with changes and concrete verification evidence by thread ID before resolving. Only resolve simple, unambiguous, fully addressed requests at 90% or higher confidence: palette comments resolve THREAD_ID. Confidence is judgment, not proof; tests alone are insufficient. Never resolve unverified fixes.
@@ -3016,14 +3016,14 @@ ${tu} .avatar img { display: none; }
3016
3016
  .new-comment-composer .draft-proposal { margin-right: calc(var(--palette-action) + var(--palette-gutter)); max-height: min(45dvh, 360px); min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
3017
3017
  .thread-navigation { margin: 0 var(--palette-inset) 12px; padding: 10px 12px; border: 1px solid #8883; border-radius: 8px; color: #aaa; }
3018
3018
  .account-layer .account-dialog { --palette-inset: 24px; }
3019
- `;var _2=["full","compact","dot","auto"],D2={full:"Full",compact:"Compact",dot:"Dot",auto:"Auto"},R2=new WeakMap;function HN(e){let t={destroy(){},open(){},close(){},comment(){},async refresh(){}};if(typeof document>"u"||e.enabled===!1||Vx())return t;if(!e.endpoint)return console.error("Palette: set `endpoint` to your Palette server (see the self-hosting guide)."),t;if(LM(),!e.repo||!e.branch||!e.project)throw new Error("Comments require repo, branch, and project.");if(e.pageRoot&&(e.pageRoot===document.body||!document.body.contains(e.pageRoot)))throw new Error("pageRoot must be mounted inside body.");let n=new URL(e.endpoint);if(n.username||n.password||n.protocol!=="https:"&&!(n.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(n.hostname)))throw new Error("Use an HTTPS API endpoint without credentials; HTTP is allowed on localhost.");vC(e.avatar);let o=bH(e.shortcuts),i=eu(e.shortcuts),r=e.pins?.size??"full";if(!_2.includes(r))throw new Error(`Invalid Palette pins.size: "${r}".`);let a=e.features?.designMode!==!1,s=[],l=PR(e.toolbar?.items),c=e.features?.tags!==!1,u=JSON.stringify([n.href,e.project,e.repo,e.branch]),d=R2.get(document);if(d){if(d.scope!==u)throw new Error("Destroy the current Palette instance before changing projects or branches.");return d.controller}e={...lM(e)};let p=[...document.body.childNodes].filter(f=>f instanceof Element?!f.matches("script,style,link,meta,template,noscript"):f.nodeType===3&&f.textContent?.trim()),g=e.pageRoot??(p.length===1&&p[0]instanceof HTMLElement?p[0]:document.body),y=getComputedStyle(g).display==="contents"?document.body:g,v=y!==document.body,x=e.frame?.mode==="iframe"&&e.frame.scale!==!0&&e.frame.shell===!0,h=x?TM(e.project):"",m=`palette:sidebar-mode:${e.project}:${e.repo}`,b=(()=>{if(!v)return"edge";if(h)return"background";try{let f=localStorage.getItem(m);if(f==="edge"||f==="background")return f}catch{}return e.sidebar==="background"?"background":"edge"})(),E=`palette:pin-size:${e.project}:${e.repo}`,S=r;try{let f=localStorage.getItem(E);f&&_2.includes(f)&&(S=f)}catch{}let A=`palette:read:${e.project}:${e.repo}`,_={};try{let f=JSON.parse(localStorage.getItem(A)??"{}");f&&typeof f=="object"&&(_=f)}catch{}let T=f=>{let k=f.comments.at(-1);return!!k&&k.author.id!==q.user?.id&&!(_[f.id]>=k.createdAt)};function H(f){let k=f.comments.at(-1)?.createdAt??0;if(_[f.id]>=k)return;delete _[f.id],_[f.id]=k;let M=Object.keys(_);for(let P of M.slice(0,Math.max(0,M.length-500)))delete _[P];try{localStorage.setItem(A,JSON.stringify(_))}catch{}}let R=Mr(window.innerWidth,window.innerHeight),z=!R&&b==="edge",F=!1,B=!1,le=!1,J=["localhost","127.0.0.1","[::1]"].includes(location.hostname),V=e.branch,oe=`palette:channel:${e.project}:${e.repo}`,ue="local";try{localStorage.getItem(oe)==="shared"&&(ue="shared")}catch{}J&&ue==="local"&&(e={...e,branch:"local"});let q=new tc(e),Y=new AbortController,W=!1,C=!!e.onboarding,U=!1,I=!1,G=e.showToolbar===!1,te=e.showToolbar===!1,ie=!1,pe=!1,xe=0,L=!!e.onboarding,Q=!1,Z=!1,ae=!!e.onboarding,we=0,Te=null,$=[],D=null,j=null,X=null,fe=new Set;function ye(){X&&!X.opened&&fe.add(X.id),X=null}let De=(f,k=Ci,M=Ni())=>iH(f,M,k);function Ce(f){return De(f)&&!(X?.id===f.id&&(X.pending||X.rejected))}let Pe=null,Ne=null,Le=new fg([],f=>{if(!W){if(D){let k=Le.id(D);k!==D&&(di.has(D)&&(di.set(k,di.get(D)),di.delete(D)),Ln===D&&(Ln=k),D=k)}Ri&&(Ri=Le.id(Ri)),$=f,fa="",mr(),pi(),Ho(),L||gr()}},(f,k)=>f.map(M=>({...M,id:k(M.id),comments:M.comments.map(P=>({...P,id:k(P.id)}))})));function Ie(f,k){return(M,P)=>M.flatMap(ee=>{if(ee.id!==P(f))return[ee];let se=k(ee);return se?[se]:[]})}async function ut(f,k,M){let P=q,ee=q.token,se=we,ge=()=>W||q!==P||se!==we||q.token!==ee;try{await Le.submit(f,async re=>{if(ge())throw new DOMException("Session changed","AbortError");return k(re)})}catch(re){throw ge()?new DOMException("Session changed","AbortError"):(M?.(),$t(),new Error(`Couldn't save. Your change was reverted. ${re instanceof Error?re.message:"Try again."}`,{cause:re}))}if(ge())throw new DOMException("Session changed","AbortError");Le.busy||Ot(fr)}let ct="open",de="",Ae=!0,ve="",Re="Connecting",Fe="",Ye=null,$e,ot=0,rn=0,Zt=null,Ht=Promise.resolve(),pt=null;function Qt(){clearTimeout(ot);let f=pt;return pt=null,f&&(Ht=Ht.catch(()=>{}).then(async()=>{if(q.token===f.token)try{let k=await q.request("me","PATCH",{name:f.name,avatarUrl:f.avatarUrl,accentColor:f.accentColor});if(q.token!==f.token)return;Zt=k.user,rn===f.revision&&q.save({token:f.token,user:k.user}),W||(Ho(),Ot(fr))}catch(k){throw q.token===f.token&&rn===f.revision&&(q.user=Zt,Ye=null,$t()),new Error(`Couldn't save your profile. ${k instanceof Error?k.message:"Try again."}`,{cause:k})}})),Ht}function Mn(f,k=!1){!q.token||!f.name.trim()||((!Zt||Zt.id!==q.user?.id)&&(Zt=q.user?{...q.user}:null),pt={...f,name:f.name.trim(),token:q.token,revision:++rn},q.user&&(q.user={...q.user,...f,name:f.name.trim()}),Ho(),clearTimeout(ot),k?Ot(Qt):ot=window.setTimeout(()=>Ot(Qt),500))}function K(){let f=Oe("Continue with Google",()=>Ot(()=>Sx("google")),"google-signin secondary");return f.prepend(Iv()),f}let ce="",_e=null,et=!1,Ve=!1,gt=!1,Ct=e.onboarding?.sites?.filter(f=>f.startsWith("https://")&&f!==location.origin).join(`
3019
+ `;var _2=["full","compact","dot","auto"],D2={full:"Full",compact:"Compact",dot:"Dot",auto:"Auto"},R2=new WeakMap;function HN(e){let t={destroy(){},open(){},close(){},comment(){},async refresh(){}};if(typeof document>"u"||e.enabled===!1||Vx())return t;if(!e.endpoint)return console.error("Palette: set `endpoint` to your Palette server (see the self-hosting guide)."),t;if(LM(),!e.repo||!e.branch||!e.project)throw new Error("Comments require repo, branch, and project.");if(e.pageRoot&&(e.pageRoot===document.body||!document.body.contains(e.pageRoot)))throw new Error("pageRoot must be mounted inside body.");let n=new URL(e.endpoint);if(n.username||n.password||n.protocol!=="https:"&&!(n.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(n.hostname)))throw new Error("Use an HTTPS API endpoint without credentials; HTTP is allowed on localhost.");vC(e.avatar);let o=bH(e.shortcuts),i=eu(e.shortcuts),r=e.pins?.size??"full";if(!_2.includes(r))throw new Error(`Invalid Palette pins.size: "${r}".`);let a=e.features?.designMode!==!1,s=[],l=PR(e.toolbar?.items),c=e.features?.tags!==!1,u=JSON.stringify([n.href,e.project,e.repo,e.branch]),d=R2.get(document);if(d){if(d.scope!==u)throw new Error("Destroy the current Palette instance before changing projects or branches.");return d.controller}e={...lM(e)};let p=[...document.body.childNodes].filter(f=>f instanceof Element?!f.matches("script,style,link,meta,template,noscript"):f.nodeType===3&&f.textContent?.trim()),g=e.pageRoot??(p.length===1&&p[0]instanceof HTMLElement?p[0]:document.body),y=getComputedStyle(g).display==="contents"?document.body:g,v=y!==document.body,x=e.frame?.mode==="iframe"&&e.frame.scale!==!0&&e.frame.shell===!0,h=x?TM(e.project):"",m=`palette:sidebar-mode:${e.project}:${e.repo}`,b=(()=>{if(!v)return"edge";if(h)return"background";try{let f=localStorage.getItem(m);if(f==="edge"||f==="background")return f}catch{}return e.sidebar==="background"?"background":"edge"})(),E=`palette:pin-size:${e.project}:${e.repo}`,S=r;try{let f=localStorage.getItem(E);f&&_2.includes(f)&&(S=f)}catch{}let A=`palette:read:${e.project}:${e.repo}`,_={};try{let f=JSON.parse(localStorage.getItem(A)??"{}");f&&typeof f=="object"&&(_=f)}catch{}let T=f=>{let k=f.comments.at(-1);return!!k&&k.author.id!==q.user?.id&&!(_[f.id]>=k.createdAt)};function H(f){let k=f.comments.at(-1)?.createdAt??0;if(_[f.id]>=k)return;delete _[f.id],_[f.id]=k;let M=Object.keys(_);for(let P of M.slice(0,Math.max(0,M.length-500)))delete _[P];try{localStorage.setItem(A,JSON.stringify(_))}catch{}}let R=Mr(window.innerWidth,window.innerHeight),z=!R&&b==="edge",F=!1,B=!1,le=!1,J=["localhost","127.0.0.1","[::1]"].includes(location.hostname),V=e.branch,oe=`palette:channel:${e.project}:${e.repo}`,ue="local";try{localStorage.getItem(oe)==="shared"&&(ue="shared")}catch{}J&&ue==="local"&&(e={...e,branch:"local"});let q=new tc(e),Y=new AbortController,W=!1,C=!!e.onboarding,U=!1,I=!1,G=e.showToolbar===!1,te=e.showToolbar===!1,ie=!1,pe=!1,xe=0,L=!!e.onboarding,Q=!1,Z=!1,se=!!e.onboarding,we=0,Te=null,$=[],D=null,j=null,X=null,fe=new Set;function ye(){X&&!X.opened&&fe.add(X.id),X=null}let De=(f,k=Ci,M=Ni())=>iH(f,M,k);function Ce(f){return De(f)&&!(X?.id===f.id&&(X.pending||X.rejected))}let Pe=null,Ne=null,Le=new fg([],f=>{if(!W){if(D){let k=Le.id(D);k!==D&&(di.has(D)&&(di.set(k,di.get(D)),di.delete(D)),Ln===D&&(Ln=k),D=k)}Ri&&(Ri=Le.id(Ri)),$=f,fa="",mr(),pi(),Ho(),L||gr()}},(f,k)=>f.map(M=>({...M,id:k(M.id),comments:M.comments.map(P=>({...P,id:k(P.id)}))})));function Ie(f,k){return(M,P)=>M.flatMap(ee=>{if(ee.id!==P(f))return[ee];let ae=k(ee);return ae?[ae]:[]})}async function ut(f,k,M){let P=q,ee=q.token,ae=we,ge=()=>W||q!==P||ae!==we||q.token!==ee;try{await Le.submit(f,async re=>{if(ge())throw new DOMException("Session changed","AbortError");return k(re)})}catch(re){throw ge()?new DOMException("Session changed","AbortError"):(M?.(),$t(),new Error(`Couldn't save. Your change was reverted. ${re instanceof Error?re.message:"Try again."}`,{cause:re}))}if(ge())throw new DOMException("Session changed","AbortError");Le.busy||Ot(fr)}let ct="open",de="",Ae=!0,ve="",Re="Connecting",Fe="",Ye=null,$e,ot=0,rn=0,Zt=null,Ht=Promise.resolve(),pt=null;function Qt(){clearTimeout(ot);let f=pt;return pt=null,f&&(Ht=Ht.catch(()=>{}).then(async()=>{if(q.token===f.token)try{let k=await q.request("me","PATCH",{name:f.name,avatarUrl:f.avatarUrl,accentColor:f.accentColor});if(q.token!==f.token)return;Zt=k.user,rn===f.revision&&q.save({token:f.token,user:k.user}),W||(Ho(),Ot(fr))}catch(k){throw q.token===f.token&&rn===f.revision&&(q.user=Zt,Ye=null,$t()),new Error(`Couldn't save your profile. ${k instanceof Error?k.message:"Try again."}`,{cause:k})}})),Ht}function Mn(f,k=!1){!q.token||!f.name.trim()||((!Zt||Zt.id!==q.user?.id)&&(Zt=q.user?{...q.user}:null),pt={...f,name:f.name.trim(),token:q.token,revision:++rn},q.user&&(q.user={...q.user,...f,name:f.name.trim()}),Ho(),clearTimeout(ot),k?Ot(Qt):ot=window.setTimeout(()=>Ot(Qt),500))}function K(){let f=Oe("Continue with Google",()=>Ot(()=>Sx("google")),"google-signin secondary");return f.prepend(Iv()),f}let ce="",_e=null,et=!1,Ve=!1,gt=!1,Ct=e.onboarding?.sites?.filter(f=>f.startsWith("https://")&&f!==location.origin).join(`
3020
3020
  `)??"",ht=!1,Gt=null,wt=null,jn=0,Ze=!1,Et=!1,Pn=!1,ir=!1,li,ci,rr,Di,_o=null,ar=[],Ln=null,nl=null,yc=new Map,ca=p6(()=>pa()),sr=null,vn,Tm=`palette:drawer:${e.project}:${e.repo}`,N;try{let f=JSON.parse(localStorage.getItem(Tm)??"null");f&&Number.isFinite(f.x)&&Number.isFinite(f.y)&&(N={x:f.x,y:f.y,edgeX:["left","right"].includes(f.edgeX)?f.edgeX:void 0,edgeY:["top","bottom"].includes(f.edgeY)?f.edgeY:void 0},vn=N)}catch{}let Me=`palette:sidebar:${e.project}:${e.repo}`,He,Je,cn=!1,dt=y6,Bn=null;try{let f=JSON.parse(localStorage.getItem(Me)??"null");Number.isFinite(f?.width)&&(dt=f.width),Number.isFinite(f?.height)&&(Bn=f.height),f&&Number.isFinite(f.x)&&Number.isFinite(f.y)&&(He={x:f.x,y:f.y,edgeX:["left","right"].includes(f.edgeX)?f.edgeX:void 0,edgeY:["top","bottom"].includes(f.edgeY)?f.edgeY:void 0},Je=He)}catch{}let Vn=new Map,mo=/^Proposed .+ \(preview only\)$/m,vu,wu,ol,Eu=()=>vu??=Promise.resolve().then(()=>(WH(),XH)).then(f=>(ol=f,wu=f.summarizeDesignComment,W||(fa="",mr(!0)),f)),L0=f=>k=>{let M=Ci(f),P=[];try{k&&(P=[...Xn().querySelectorAll(k)])}catch{}return P.length!==1||M&&P.includes(M)?M??P[0]??null:P[0]},_0=(f,k)=>(e.snapshots?.image||e.snapshots?.html)&&li&&q.user&&(q.user.verified||li.guests)?Promise.resolve().then(()=>(gz(),mz)).then(M=>M.snapshotFor(f,Ci,e.snapshots,li,k),()=>null):void 0,H2,z2=()=>H2??=Promise.resolve().then(()=>(Az(),Tz)),D0=new WeakSet,ku=(f,k,M)=>{let P=w("div");return z2().then(ee=>W||ee.mountSnapshot(P,j2,f,k,M),()=>{}),P},O2=f=>mo.test(f)?wu?.(f)??(Eu(),"Design change"):f,$2=f=>O2(f).trim().split(`
3021
- `)[0].slice(0,100),Do="",lr="",_r=[],da="",Ri=null,Su="",Tu,Au=null,R0=!1,N2=Ni(),Am=0,Mm=0,Cm=0,H0=0,di=new Map,Lm=new Map,st=w("div");st.dataset.branchComments=e.project,st.dataset.sidebar=R?"mobile":z?"edge":"background",Object.assign(st.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"2147483647",isolation:"isolate"});let it=st.attachShadow({mode:"open"}),j2={root:it,token:()=>q.token,origin:()=>new URL(e.endpoint).origin,dropped:D0,go:f=>{Hx(f)},notify:Dn,remove:f=>Ot(()=>ut(Ie(f.id,({snapshot:k,...M})=>M),async k=>{for(let M in f.snapshot)await q.request(`threads/${k(f.id)}/snapshot/${M}`,"DELETE")}))},P2=w("style");P2.textContent=xH;let ui=w("div","catch");ui.hidden=!0;let bt=w("div","pins"),zt=w("div"),Xe=w("div","toolbar"),he=w("div"),B2=w("div");he.tabIndex=-1,z&&he.classList.add("edge-sidebar");let Dr=w("div","edge-sidebar-sensor");Dr.hidden=!0,Object.assign(bt.style,{position:"fixed",inset:"0"});let Fn=w("div","pin-preview");Fn.hidden=!0;let _m=0,xc=!1,Dm=!1,Mu=null,vc=null,wc=null,z0="",Hi=(f=!1)=>{if(window.clearTimeout(_m),Fn.hidden||Dm&&!f)return;if(ol?.resetDesignPreviews(new Set([...$.find(M=>M.id===D&&Ce(M))?.comments.map(M=>M.id)??[],"draft"])),Dm=!0,vc?.cancel(),f||En()){Fn.hidden=!0,Mu=null;return}let k=Fn.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"translateY(3px) scale(.99)"}],{duration:150,easing:"cubic-bezier(.22,1,.36,1)",fill:"forwards"});vc=k,k.finished.then(()=>{vc===k&&(Fn.hidden=!0,Mu=null)}).catch(()=>{})};Fn.addEventListener("pointerenter",()=>{xc||Gt||sr||(Dm=!1,window.clearTimeout(_m),vc?.cancel())}),Fn.addEventListener("pointerleave",()=>Hi());let zi=w("div","component-hover");zi.setAttribute("aria-hidden","true");let Ko=null,Qa=null,Rm=0,Ja=w("div","sr-only");Ja.setAttribute("aria-live","polite");let V2=tH(Xe,f=>{if(f==="account"){if(!q.user)return yt("person");let k=yr(q.user);return k.classList.add("review-avatar"),k}return yt(f)});it.append(P2,ui,zi,bt,he,Dr,zt,Fn,B2,Xe,Ja),document.body.append(st);let U2=0,q2=0,K2=new MutationObserver(f=>{if(Date.now()-q2>1e3&&([U2,q2]=[0,Date.now()]),++U2<20)for(let k of f)st.removeAttribute(k.attributeName)});K2.observe(st,{attributeFilter:["aria-hidden","inert"]});let Un=document.documentElement;function O0(f,k){return Object.fromEntries(k.map(M=>[M,f.style[M]]))}let il=O0(y,["width","boxSizing","zoom","transformOrigin","transform","position","left","top","height","minHeight","paddingBottom","overflow","borderRadius","background","borderRight","borderBottom","clipPath"]),$N=Object.keys(il).map(f=>f.replace(/[A-Z]/g,k=>`-${k.toLowerCase()}`)),NN=Fu(y,$N),jN=O0(document.body,["overflow","background"]),PN=Fu(document.body,["overflow","background"]),BN=Fu(Un,["overflow","background"]),Hm=new Map,VN=Un.style.background,$0=EM(y,st,e.frame?.include,Fo),I2=kM(st),_n={left:0,top:0,width:0,height:0,logical:[0,0],pan:!1},N0=`palette:frame-size:${e.project}:${e.repo}`,Yn,G2=!1,cr=null,F2=e.frame?.mode==="iframe"&&e.frame.scale!==!0,ao,zm=!1,es=!1,ts=!1,Ec="",Y2=e.frame?.defaultMode==="transform";try{let f=JSON.parse(localStorage.getItem(N0)??"{}");Y2=f.v===2&&typeof f.inPlace=="boolean"?f.inPlace:e.frame?.defaultMode==="transform"}catch{}let X2=()=>F2&&!Ec&&(Yn?Yn.separate:!Y2),j0=!1,Cu=!1,UN,P0=()=>UN??=Promise.resolve().then(()=>(_z(),Lz));function qN(f=!Go){Cu||(Cu=!0,Yn?.status({active:!1,loading:!0}),P0().then(({enterShell:k})=>!W&&k(e.project,f,!!Pe?.edited,M=>{W||(Cu=!1,Ec=M,Yn?.status({active:!1,reason:M}),Om())})))}function Lu(f=""){if(Cu)return;Cu=!0;let k=location.href;try{let M=ao?.iframe.contentWindow?.location.href;M?.startsWith(location.origin)&&(k=M)}catch{}P0().then(({leaveShellPage:M})=>M(k,f))}let W2=()=>{P0().then(({syncShell:f})=>f(ao?.iframe.contentWindow,h))};function B0(){ao&&(ao.destroy(),ao=void 0,es=!1,Yn?.status({active:!1}),Z2())}function Z2(){let f=Pe?.selected;if(!f||f.ownerDocument===Xn())return;let k=ul(f,Xn());Pe.clearSelection(),k&&Pe.select(k)}let Om=()=>{Lc="",ji(),zc(),Fo()};function KN(){if(ao||zm)return;zm=!0,Yn?.status({active:!1,loading:!0});let f=Jt&&!ts?y.scrollTop:window.scrollY/pr();Promise.resolve().then(()=>(Oz(),zz)).then(({openFrameViewport:k})=>{if(zm=!1,W||!Jt||ao||!X2())return;let M=ao=k({parent:it,before:ui,url:IN(),background:rl,scroll:f,ready(){ao===M&&(es=!0,h&&W2(),Z2(),Yn?.status({active:!0}),Om())},failed(P){if(ao===M){if(h)return Lu(P);Ec=P,B0(),Yn?.status({active:!1,reason:P}),Om()}},changed(){h&&W2(),zc(),Fo()}});Om()})}function IN(){let f=new URL(e.frame?.iframeUrl?.(location)??location.href,location.href);if(h)for(let k of[Wx,Zx])f.searchParams.delete(k);return f.href}let _u=()=>(es&&ao?ao.port:y).getBoundingClientRect(),V0=f=>es?f.ownerDocument===Xn():y.contains(f),$m=()=>{let f=Xn();return f===document?y:v&&ul(y,f)||f.body};function Q2(){G2||(G2=!0,Promise.resolve().then(()=>(qz(),Uz)).then(({mountFrameSize:f})=>{W||(Yn=f(it,()=>es&&ao?ao.port:y,N0,k=>{if(k){Ec="";try{zo(sessionStorage,SM)}catch{}}Lc="",ji(),Fo()},IS,F2&&(e.frame?.defaultMode==="transform"?"transform":"iframe"),{pan:GN,onFrame:so,shortcuts:o,textEntry:br,shell:x,anchor(){let k=$.find(ee=>ee.id===D),M=j??(k&&Ce(k)?k.anchor:null),P=M&&ga(M);return P&&P.attached?{x:P.x/pr(),y:P.y/pr()}:null}}),Yn.status(es?{active:!0}:Ec?{active:!1,reason:Ec}:{active:!1,loading:!!ao||zm}),Yn.sized?(Lc="",ji()):Yn.update(cr,pr()))}))}try{localStorage.getItem(N0)&&Q2()}catch{}let Nm=0,U0=!1,J2=()=>{U0=!0,document.dispatchEvent(new Event("scroll",{bubbles:!0})),U0=!1};function GN(){Nm||(Nm=requestAnimationFrame(FN),J2())}function FN(){if(Nm=0,!Jt||!cr||!Yn||W||ts)return;let f=pr(),k=Yn.view({left:cr.left/f,top:cr.top/f,width:cr.width/f,height:cr.height/f},[window.innerWidth/f,window.innerHeight/f]);_n.left=k.left,_n.top=k.top,y.style.left=`${k.left}px`,y.style.top=`${k.top}px`,Rr(),Yn.update(cr,f),mr(!0),fi(),pa(),dl(),J2()}function Rr(){let f=pr(),k=_n.left,M=_n.top,{width:P,height:ee}=_n,se=Jt&&!W&&!ts,ge=se&&e.frame?.scale!==!0;ge&&I2.update(_n.logical),$0.update(se?{scale:Ro,left:k,top:M,zoom:f,bounds:{left:k,top:M,right:k+P,bottom:M+ee,width:P,height:ee}}:null),ge||I2.update(null)}function eA(){let f=Jt||dr,k=[document.body.style.background,Un.style.background];f&&(document.body.style.background=jN.background,Un.style.background=VN);let M=[document.body,Un].map(P=>getComputedStyle(P).backgroundColor).find(P=>P!=="rgba(0, 0, 0, 0)")??"#fff";return f&&([document.body.style.background,Un.style.background]=k,K0.takeRecords()),M}let q0=0,K0=new MutationObserver(()=>{q0||=requestAnimationFrame(()=>{q0=0,rl=eA(),tA(),(Jt||dr)&&(y.style.background=rl)})});function tA(){let[f,k,M]=/^rgb/.test(rl)?rl.match(/[\d.]+/g).map(Number):[255,255,255];bt.dataset.page=.2126*f+.7152*k+.0722*M<128?"dark":"light"}let Jt=!1,dr=!1,rl=eA();tA();for(let f of[Un,document.body])K0.observe(f,{attributes:!0});let Io=0,Oi;function nA(){let f=Number(getComputedStyle(y).opacity);return y.animate([{opacity:f*.94},{opacity:f}],{duration:250,easing:"cubic-bezier(0.22, 1, 0.36, 1)"})}let Go=!1,oA=rH(`palette:open:${e.project}:${e.repo}`,e.restoreOpen),I0=`palette:toolbar-dismissed:${e.project}:${e.repo}`;try{sessionStorage.getItem(I0)==="1"&&(te=!0,G=!0)}catch{}let G0=`palette:comments-hidden:${e.project}:${e.repo}`,go=!1,jm=!1,F0=0;try{go=!e.onboarding&&sessionStorage.getItem(G0)==="1"}catch{}let kc=!1,ns,Y0=[],Sc=0,$i=!1,iA=null,Tc,Pm;function Bm(f){!Xe.offsetWidth||!Xe.offsetHeight||(vn=Pa(f,Xe.offsetWidth,Xe.offsetHeight,Un.clientWidth,window.innerHeight),Xe.style.left=`${vn.x+Xe.offsetWidth/2}px`,vn.edgeY==="bottom"&&!R?(Xe.style.top="auto",Xe.style.bottom="calc(16px + env(safe-area-inset-bottom,0px))"):(Xe.style.top=`${vn.y}px`,Xe.style.bottom="auto"))}function rA(f){if(he.dataset.dragging==="true"){Je=f,he.style.left=`${f.x}px`,he.style.top=`${f.y}px`;return}he.offsetWidth&&(Je=Pa(f,he.offsetWidth,he.offsetHeight,Un.clientWidth,window.innerHeight),ua())}function aA(){he.style.width=`${dt}px`,he.style.height=Bn==null?"":`${Bn}px`,wx()}function sA(){He=Je;try{localStorage.setItem(Me,JSON.stringify({...He,width:dt,height:Bn}))}catch{}}function lA(){let f=Un.clientWidth,k=window.innerHeight;dt=Math.min(Math.max(dt,rf),Math.max(rf,f-2*Ji)),Bn!=null&&(Bn=Math.min(Math.max(Bn,af),Math.max(af,Math.min(k-2*Ji,Jh)))),aA()}function ua(){if(R||!z)return;lA();let f=he.offsetHeight||Math.min(window.innerHeight-2*Ji,Jh),k=v6(Je,dt,f,Un.clientWidth,window.innerHeight),M=w6(k,Un.clientWidth);he.style.left=`${k.x}px`,he.style.top=`${k.y}px`,he.style.setProperty("--edge-account-max-height",`${Math.max(0,window.innerHeight-k.y-28)}px`),he.style.right="auto",he.style.bottom="auto",he.style.transformOrigin=k.side==="left"?"left center":"right center",he.style.setProperty("--edge-park-x",`${M.parked}px`),he.style.setProperty("--edge-peek-x",`${M.peek}px`),Dr.style.left=k.side==="left"?"0px":"",Dr.style.right=k.side==="right"?"0px":"",C?(delete he.dataset.collapsed,delete he.dataset.peek,Dr.hidden=!0):(he.dataset.collapsed="true",cn?he.dataset.peek="true":delete he.dataset.peek,Dr.hidden=!1)}function X0(){st.dataset.sidebar=R?"mobile":z?"edge":"background",he.classList.toggle("edge-sidebar",z),he.style.transition="none",he.style.translate="",he.style.opacity="",zu(!0),z?Hr.isConnected||he.prepend(Hr):(Hr.remove(),delete he.dataset.collapsed,delete he.dataset.peek,Dr.hidden=!0),he.offsetWidth,he.style.transition=""}let al=[],W0=!1;function Du(){for(let f of al)f.cancel();al=[],dr=!1,bt.style.opacity=""}function Z0(f,k){if(R||f===b||W||!v&&f==="background")return;let M=()=>[y,he.querySelector(".panel"),Xe,zt.querySelector(".account-dialog")],P=M().map(se=>se?.getBoundingClientRect());if(Du(),Oi?.cancel(),Oi=void 0,ns?.stop(),ns=void 0,zu(!0),Im(),_c(),Xe.style.translate="",Tc=void 0,W0=!0,b=f,z=f==="edge",!k){F=!1,e={...e,sidebar:f};try{localStorage.setItem(m,f)}catch{}}if(X0(),ji(),$t(),W0=!1,En())return;M().forEach((se,ge)=>{let re=P[ge];if(!se?.isConnected||!re?.width)return;if(se===y&&e.frame?.scale!==!0){al.push(nA());return}se!==y&&se.getAnimations().forEach(lt=>lt.cancel());let be=se.getBoundingClientRect();if(!be.width)return;let je=be.width/se.offsetWidth,We=getComputedStyle(se).transform;al.push(se.animate([{transform:`${We==="none"?"":We} translate(${(re.left-be.left)/je}px, ${(re.top-be.top)/je}px) scale(${re.width/be.width})`,transformOrigin:"top left"},{transform:We,transformOrigin:"top left"}],{duration:250,easing:"cubic-bezier(0.22, 1, 0.36, 1)"}))});let ee=al;dr=!0,bt.style.opacity="0",Promise.all(ee.map(se=>se.finished)).then(()=>{W||ee!==al||(al=[],dr=!1,bt.style.opacity="",Rr(),$0.reposition(),Fo())}).catch(()=>{})}function Q0(f,k,M,P,ee){let se=w("div","account-setting"),ge=w("span","account-setting-label",k),re=ec(k,M,P,be=>ee(be));return re.querySelector("summary").dataset.focusKey=`setting-${f}`,se.append(ge,re),se}function YN(){return R?Q0("sidebar","Sidebar",[["mobile","Floating sidebar"]],"mobile",()=>{}):v?Q0("sidebar","Sidebar",[["edge","Floating"],["background","Frame"]],b,Z0):w("p","muted","Floating sidebar \xB7 Set pageRoot for Frame.")}function XN(){let f=Q0("channel","Comments",[["local","Local development"],["shared","Site comments"]],ue,WN);return f.append(w("p","muted","Separate channels, both saved to this project.")),f}function WN(f){if(!(f===ue||W)){if(Q||Le.busy){Dn("Wait for your changes to save.");return}ue=f;try{localStorage.setItem(oe,f)}catch{}e={...e,branch:f==="local"?"local":V},q.cancelReads(),q=new tc(e),Z=et=!1,Ru=void 0,ce="",_e=null,Re="Connecting",ht=Ze=Et=Pn=Ve=ir=!1,D=null,j=null,_o=null,sl(),$t(),qm()}}function sl(){ye(),we++,Z=!1,ce="",D=null,Ru=void 0;let f=q.cached();ae=f!==null,Le.reset(ix(f??[]))}let Hr=w("div","edge-sidebar-grip");Hr.setAttribute("aria-hidden","true");let cA=f=>Zh(he,f,rA,Y.signal,()=>{B=!1,le=!0,ur.show()},()=>{sA(),ur.update()},()=>C&&z&&!$i);cA(Hr),he.prepend(Hr);let ZN=["n","s","e","w","ne","nw","se","sw"];for(let f of ZN){let k=w("div",`edge-sidebar-resize edge-sidebar-resize-${f}`);k.addEventListener("pointerdown",M=>{if(M.button!==0||!C||!z||$i)return;M.preventDefault(),M.stopPropagation();for(let be of he.getAnimations())be.cancel();he.style.transition="none";let P=he.getBoundingClientRect(),ee=M.clientX,se=M.clientY,ge=be=>{if(be.pointerId!==M.pointerId)return;let je=x6(f,P,be.clientX-ee,be.clientY-se,Un.clientWidth,window.innerHeight);dt=je.width,(f.includes("n")||f.includes("s"))&&(Bn=je.height),Je={x:je.left,y:je.top},he.style.left=`${je.left}px`,he.style.top=`${je.top}px`,aA()},re=be=>{be.pointerId===M.pointerId&&(window.removeEventListener("pointermove",ge,!0),window.removeEventListener("pointerup",re,!0),window.removeEventListener("pointercancel",re,!0),he.style.transition="",sA(),ua())};window.addEventListener("pointermove",ge,{capture:!0,passive:!1}),window.addEventListener("pointerup",re,!0),window.addEventListener("pointercancel",re,!0)},{signal:Y.signal}),he.append(k)}for(let f of["left","right","top","bottom"])he.append(w("div",`edge-sidebar-snap edge-sidebar-snap-${f}`));let Vm=f=>{cn=f,!C&&z&&!$i&&ua()};Dr.addEventListener("pointerenter",()=>Vm(!0)),Dr.addEventListener("pointerleave",()=>Vm(!1)),Dr.addEventListener("pointerup",f=>{f.button===0&&!C&&wn(!0)}),he.addEventListener("pointerenter",()=>Vm(!0)),he.addEventListener("pointerleave",()=>Vm(!1)),window.addEventListener("resize",()=>{W||!z||$i||(lA(),ua())},{signal:Y.signal,passive:!0}),X0();let ur=f6(Xe,()=>C||U||L||!!j||!!D,Y.signal,e.autoHideDrawer);Zh(Xe,Xe,Bm,Y.signal,()=>{ur.show(),ns?.stop(),Xe.style.translate="0px 0px"},()=>{N=vn;try{localStorage.setItem(Tm,JSON.stringify(N))}catch{}Ho(),ur.update()},()=>!C,f=>!!f.closest(".morphing-menu__shortcut"));let J0=new ResizeObserver(()=>{Xe.dataset.edgeTabs!=="true"&&(vn?Bm(vn):e.drawerContainer&&Ho())});J0.observe(Xe),e.drawerContainer&&J0.observe(e.drawerContainer);let pr=()=>Un.currentCSSZoom??1;function Ni(){let f=as()?.contentWindow?.location??location;return nH(e.page?.(f)??f.pathname)}let dA=new WeakMap,ll=null,ex=0,tx=new WeakMap;function uA(){cancelAnimationFrame(ex),!(W||!it.querySelector(".floating-notice"))&&(pa(),ex=requestAnimationFrame(uA))}function nx(f=j??$.find(k=>k.id===D)?.anchor){let k=zt.firstElementChild?.getBoundingClientRect();if(!k||L)return;let M=f?ga(f):null;return{cardKey:Ln,left:k.left,top:k.top,anchor:f,offsetX:k.left-(M?.x??0),offsetY:k.top-(M?.y??0),scrollX:window.scrollX,scrollY:window.scrollY}}function Um(f){if(f.dataset.closing)return;if(f.dataset.closing="true",f.inert=!0,f.setAttribute("aria-hidden","true"),ll===f&&(ll=null,clearTimeout(Am)),En()){f.remove();return}f.animate([{opacity:getComputedStyle(f).opacity,translate:"0px 0px",scale:1},{opacity:0,translate:f.dataset.attached==="true"?`0px ${(f.dataset.placement==="above"?1:-1)*(f.offsetHeight/2+10)}px`:"0px 3px",scale:f.dataset.attached==="true"?.94:.99}],{duration:150,easing:"cubic-bezier(.22,1,.36,1)",fill:"forwards"}).finished.catch(()=>{}).finally(()=>f.remove())}function Dn(f,k,M=nx()){Ja.textContent=f,ll&&Um(ll);let P=w("div","toast floating-notice");ll=P,M&&dA.set(P,M),P.setAttribute("role",k?"alertdialog":"status"),P.setAttribute("aria-label",f),P.append(yt("info"),w("span","",f)),k&&P.append(Oe(k.label,()=>{Um(P),k.run()},"notice-action")),P.append(Oe("Dismiss notice",()=>Um(P),"icon","close")),it.append(P),pa(),uA(),En()||P.animate([{opacity:0,translate:P.dataset.attached==="true"?`0px ${(P.dataset.placement==="above"?1:-1)*(P.offsetHeight/2+10)}px`:"0px 6px",scale:P.dataset.attached==="true"?.94:.97},{opacity:1,translate:"0px 0px",scale:1}],{duration:250,easing:"cubic-bezier(.22,1,.36,1)"}),clearTimeout(Am),Am=window.setTimeout(()=>Um(P),5e3)}function pa(){for(let f of it.querySelectorAll(".floating-notice")){let k=dA.get(f);if(!k)continue;let M=k.anchor?ga(k.anchor):null,ee=(!L&&Ln===k.cardKey?zt.firstElementChild:null)?.getBoundingClientRect();ee&&(f.style.maxWidth=`${Math.min(360,ee.width,innerWidth-24)}px`,k.left=ee.left,k.top=ee.top,k.offsetX=ee.left-(M?.x??0),k.offsetY=ee.top-(M?.y??0),k.scrollX=window.scrollX,k.scrollY=window.scrollY);let se=ee?ee.left+(ee.width-f.offsetWidth)/2:M?M.x+k.offsetX:k.left+k.scrollX-window.scrollX,ge=!!ee&&ee.bottom+10+f.offsetHeight>innerHeight-12;f.dataset.placement=ge?"above":"below";let re=ee?ge?ee.top-f.offsetHeight-10:ee.bottom+10:M?M.y+k.offsetY:k.top+k.scrollY-window.scrollY,be=String(!!ee),je=f.dataset.attached!==void 0&&f.dataset.attached!==be,We=je?f.getBoundingClientRect():null,lt=tx.get(f);if(lt&&(je||Math.abs(lt.left-se)>.5||Math.abs(lt.top-re)>.5)&&(lt.animation.cancel(),tx.delete(f)),f.dataset.attached=be,Object.assign(f.style,{left:`${se}px`,top:`${re}px`,bottom:"auto",transform:"none",transformOrigin:ee?ge?"50% 100%":"50% 0%":"0% 0%"}),We&&!f.dataset.closing&&!En()){let tt=f.animate([{left:`${We.left}px`,top:`${We.top}px`},{left:`${se}px`,top:`${re}px`}],{duration:250,easing:"cubic-bezier(.22,1,.36,1)"});tx.set(f,{animation:tt,left:se,top:re})}}}function pA(f){W||f instanceof DOMException&&f.name==="AbortError"||(Fe=f instanceof Error?f.message:"Something went wrong. Try again.",Dn(Fe))}function Ot(f){f().catch(pA)}function ox(f,k){return k.then(M=>{f.isConnected&&f.replaceWith(M)}).catch(pA),f}let fA=()=>L&&ir&&!e.onboarding&&!!q.user?.verified&&q.user.id.startsWith("google:");function mA(){ci?.dispose(),ci=rr=Di=void 0}function QN(){Di=q,gr(),zt.querySelector(".account-dialog").scrollTop=0}function JN(){if(ci)return ci;let f=q;return rr??=Promise.resolve().then(()=>(Fz(),Gz)).then(({accountTokens:k})=>Di!==f?w("div"):(ci=k(f,e.project,()=>{mA(),gr(),zt.querySelector('[data-focus-key="account-tokens"]')?.focus()}),ci.focusStart(),ci),k=>{throw rr=Di=void 0,gr(),k}),ox(w("p","account account-usage-status","Loading API tokens\u2026"),rr)}function gA(f){return ox(w("section","account-usage"),Promise.resolve().then(()=>(e0(),Jy)).then(({accountUsage:k})=>k(q,f,!0,J&&ue==="local")))}function qm(){Ot(et?fr:Iu)}async function ej(f){if(!Q){Q=!0,Fe="",gr();try{for(await f();Z&&!W;)await new Promise(k=>setTimeout(k,20));await fr()}finally{Q=!1,$t()}}}let ix=f=>f.map(k=>({...k,comments:k.comments.filter(M=>M.body!=="[Comment deleted]")})).filter(k=>k.comments.length>0),zr,Ru,hA=-1;async function fr(){if(W||Z||Le.busy||e.onboarding)return;let f=Le.revision,k=q,M=k.token,P=we;Z=!0;try{let ee=await k.list();if(W||k!==q||P!==we||M!==k.token||Le.busy||f!==Le.revision)return;if(ee===Ru&&f===hA&&Re==="Live")return!1;Ru=ee,hA=f,ae=!0;let se=ix(ee),ge=JSON.stringify(se)!==JSON.stringify($),re=Re!=="Live";return ce="",et&&(_e=null),Re=_e?"Offline":"Live",D&&!se.some(be=>be.id===D)&&(D=null),ge?Le.replace(se,f):re&&(pi(),Ho()),ge}catch(ee){if(W||k!==q||P!==we||ee instanceof DOMException&&ee.name==="AbortError")return;throw M!==k.token&&sl(),ee instanceof to&&(ee.status===401||ee.status===403)&&ee.code!=="site_not_approved"&&(ce=ee.message,D=null,Ru=void 0,Le.replace([],f)),_e=ce?null:JS(ee),Re="Offline",pi(),Ho(),ee}finally{k===q&&P===we&&(Z=!1)}}function Ac(){!ie&&B&&(B=!1,Je=He,ua()),!(F===ie||ie&&(!v||R||b!=="edge"))&&(F=ie,R?b="edge":Z0(ie?"background":"edge",!0))}let Km=()=>C&&!z&&!R&&!F;function Mc(f){if(ye(),$r(),e.onboarding)return;ie&&(ie=!1,Pe?.setActive(!1),Ac()),I=f,f&&Ou(),C&&!Km()&&wn(!1);let k=f?_o??ar.shift():null;if(k){j=k.anchor,Do=k.text,_o=null,D=null,L=!1,U=!1,$t(),zt.querySelector("textarea")?.focus();return}U=f,zr?.wake(!1),G=!1,L=!1,f&&(D=null,j=null),$t()}function bA(){pe&&(pe=!1,wn(Te??!0),Te=null,requestAnimationFrame(()=>{let f=he.querySelector(".list");f&&(f.scrollTop=xe),(it.querySelector('.dialog [aria-label="Comment actions"]')??it.querySelector('[data-menu-item="design"]'))?.focus({preventScroll:!0})}))}function Cc(f){e.onboarding||j||f&&!a||(f&&(Te=null,D||Pe?.setReturnAction(null),pe=!0,C&&(xe=he.querySelector(".list")?.scrollTop??0),Mc(!1),ie=!0,le=!1,Ac(),C||wn(!0),L=!1,he.querySelector(".panel")?.contains(it.activeElement)&&he.focus({preventScroll:!0})),ie=f,f?UA().then(k=>k?.setActive(ie)):(Pe?.setActive(!1),Ac(),bA()),$t())}let rx=0;function tj(){let f=Mr(window.innerWidth,window.innerHeight);f!==R&&(it.append(he),Du(),zu(!0),Im(),_c(),R=f,f||(Xe.style.translate="",vn||(Xe.style.bottom="")),z=!f&&b==="edge",he.removeAttribute("style"),X0(),Lc="",$t())}let Ro=1,Lc="",yA=()=>(window.visualViewport?.offsetTop??0)+Math.min(window.innerHeight,window.visualViewport?.height??window.innerHeight)-window.innerHeight;function nj(){let f=Math.max(1,Math.min(window.innerHeight,window.visualViewport?.height??window.innerHeight)*.9),k=yA(),M=cx().getBoundingClientRect();st.style.setProperty("--mobile-pill-x",`${M.left+M.width/2-window.innerWidth/2}px`),st.style.setProperty("--mobile-pill-y",`${M.bottom-(window.innerHeight+k-6)}px`),st.style.setProperty("--mobile-pill-scale-x",String(Math.max(.01,M.width/Math.max(1,window.innerWidth-24)))),st.style.setProperty("--mobile-pill-scale-y",String(Math.max(.01,M.height/f)))}function Hu(){for(let f of Hm.values())f();Hm.clear(),NN(),PN(),BN()}function ji(){let f=pr(),k=Mr(window.innerWidth,window.innerHeight)?Math.min(window.innerHeight,window.visualViewport?.height??window.innerHeight):window.innerHeight,M=`${window.innerWidth}:${window.innerHeight}:${k}:${f}:${C}:${L}:${b}:${ie}:${window.visualViewport?.offsetTop??0}`;if(Lc===M)return;if(R||Du(),Lc=M,st.style.zoom=String(1/f),st.style.width=`${window.innerWidth}px`,bt.style.opacity="",z||R){if(h&&j0)return Lu();Oi?.cancel(),dr=!1;let me=Jt?y.scrollTop*f:null;if(Jt&&(Hu(),Ro=1),me!==null&&window.scrollTo({top:me,behavior:"instant"}),st.style.height=R?`${window.innerHeight}px`:"",st.style.top=R?"":"0px",R){let ne=yA();Xe.style.translate=`0 ${ne}px`,st.style.setProperty("--mobile-panel-height",`${Math.max(1,k*.9)}px`),st.style.setProperty("--mobile-panel-bottom",`${-ne}px`)}st.classList.toggle("review-open",C),Jt=!1,Rr(),Yn?.update(null),bt.style.clipPath="",Object.assign(ui.style,{left:"",top:"",width:"",height:""});return}let P=Jt&&!ts?y.scrollTop:window.scrollY/(f*Ro),ee=Jt,se=Jt?y.getBoundingClientRect():{left:0,top:0,width:window.innerWidth};Oi?.cancel(),dr=!1;let ge=KS(window.innerWidth,k,C,window.innerHeight,L,!0,e.frame?.scale===!0),re=ge.framed,be=e.frame?.scale===!0,je={left:ge.left,top:ge.top,width:ge.visibleWidth,height:ge.height},We={left:je.left/f,top:je.top/f,width:je.width/f,height:je.height/f},lt=[window.innerWidth/f,window.innerHeight/f],tt=be?{...We,scale:1,pan:!1}:Yn?.view(We,lt)??IS(We,lt,!1);if(re&&!be&&X2())x&&!h?qN():KN();else{if(h&&j0)return Lu();ao&&B0()}let en=re&&!be&&es,Bt=re&&!be&&tt.pan&&!en;if(cr=re&&!be?je:null,st.style.setProperty("--review-viewport-height",`${k}px`),st.style.height=`${k}px`,st.style.top="",st.classList.toggle("review-open",C),st.classList.toggle("design-active",ie),en&&ao)ee&&!ts&&(Hu(),window.scrollTo({left:_n.pan?0:window.scrollX,top:P*f,behavior:"instant"})),Un.style.overflow="hidden",Ro=1,_n={left:tt.left,top:tt.top,width:Math.min(We.width,tt.width*tt.scale),height:Math.min(We.height,tt.height*tt.scale),logical:[tt.width,tt.height],pan:!1},ao.place({left:_n.left*f,top:_n.top*f,width:_n.width*f,height:_n.height*f,logical:_n.logical,scale:tt.scale,pan:tt.pan});else if(re){Ro=be?ge.scale:tt.scale;let me=Ro*f;_n=be?{left:ge.left/f,top:ge.top/f,width:window.innerWidth/f*Ro,height:ge.height/f,logical:[window.innerWidth/f,ge.height/me],pan:!1}:{left:tt.left,top:tt.top,width:tt.width*tt.scale,height:tt.height*tt.scale,logical:[tt.width,tt.height],pan:Bt},Object.assign(y.style,{position:"fixed",transform:Ro!==1?`scale(${Ro})`:il.transform,transformOrigin:"top left",left:`${_n.left}px`,top:`${_n.top}px`,width:`${be?window.innerWidth/f:tt.width}px`,boxSizing:"border-box",height:`${be?ge.height/me:tt.height}px`,paddingBottom:il.paddingBottom,zoom:il.zoom,overflow:be?"hidden auto":"auto",borderRadius:`${12/me}px`,background:rl,borderRight:il.borderRight,borderBottom:il.borderBottom,clipPath:il.clipPath});for(let ne of y.querySelectorAll("header"))!Hm.has(ne)&&getComputedStyle(ne).position==="fixed"&&(Hm.set(ne,Fu(ne,["position","margin-bottom"])),ne.style.position="sticky",ne.style.marginBottom=`-${ne.offsetHeight}px`);Un.style.overflow="hidden",document.body.style.overflow="hidden",Un.style.background=document.body.style.background="#080808",y.scrollTop=P}else Hu(),Jt&&!ts&&window.scrollTo({left:window.scrollX,top:P*f,behavior:"instant"}),Ro=1,_n.pan=!1;if(ts=en,Jt=re,Rr(),cr&&Q2(),Yn?.update(cr,f),!re&&e.drawerContainer?.isConnected){let me=e.drawerContainer.getBoundingClientRect();Pm=me.width?me.left+me.width/2:void 0}if(re!==ee&&!W0&&!Go&&!En()){if(bt.style.opacity="0",dr=!0,e.frame?.scale===!0){let ne=re?y.getBoundingClientRect():{left:0,top:0,width:window.innerWidth},Ee=`translate(${(se.left-ne.left)/f}px, ${(se.top-ne.top)/f}px) scale(${Ro*se.width/ne.width})`;if(y.style.transformOrigin=re?"top left":`0 ${P}px`,!re){Un.style.background=document.body.style.background="#080808",y.style.background=rl;let ze=getComputedStyle(y).minHeight;y.style.minHeight=`max(${ze==="auto"?"0px":ze}, ${window.innerHeight/f}px)`}Oi=y.animate([{transform:Ee},{transform:`translate(0px, 0px) scale(${Ro})`}],{duration:250,easing:"cubic-bezier(0.32, 0.72, 0, 1)"})}else Oi=nA();let me=Oi;me.finished.then(()=>{W||Oi!==me||(me.cancel(),Oi=void 0,dr=!1,Jt||Hu(),bt.style.opacity="",Rr(),$0.reposition(),Fo())}).catch(()=>{})}let Ke=(me,ne,Ee,ze)=>{let Be=Math.max(me,Ee);return[Be,Math.max(0,Math.min(me+ne,Ee+ze)-Be)]},[an,nt]=Ke(_n.left*f,_n.width*f,je.left,je.width),[qe,Se]=Ke(_n.top*f,_n.height*f,je.top,je.height),Ue=be?{left:ge.visibleLeft,top:ge.visibleTop,width:ge.visibleWidth,height:ge.visibleHeight}:{left:an,top:qe,width:nt,height:Se};bt.style.clipPath=re?`inset(${Ue.top}px ${window.innerWidth-Ue.left-Ue.width}px ${k-Ue.top-Ue.height}px ${Ue.left}px)`:"",Object.assign(ui.style,re?{left:`${Ue.left}px`,top:`${Ue.top}px`,width:`${Ue.width}px`,height:`${Ue.height}px`}:{left:"",top:"",width:"",height:""})}let ax;function sx(){Xe.dataset.edgeTabs!=="true"&&(ax=O0(Xe,["left","top","bottom","transform"])),Object.assign(Xe.style,{left:"",top:"",bottom:"",transform:""}),Xe.parentElement!==he&&he.append(Xe),Xe.dataset.edgeTabs="true",C?Xe.dataset.edgeOrient="horizontal":delete Xe.dataset.edgeOrient}function _c(){Xe.dataset.edgeTabs==="true"&&(Object.assign(Xe.style,ax),ax=void 0),delete Xe.dataset.edgeTabs,delete Xe.dataset.edgeOrient,Xe.parentElement===he&&Ja.before(Xe)}function lx(){return D&&!L&&!j&&C&&!R&&!ie&&!e.onboarding?he.querySelector(".panel"):null}function oj(f){let k=f??(z&&L?he:it);zt.parentNode!==k&&(k===it?Fn.before(zt):k.append(zt)),zt.classList.toggle("thread-pane",!!f),he.querySelector(".panel")?.toggleAttribute("data-thread",!!f)}function cx(){return Xe.querySelector(".morphing-menu__shell")??Xe}function dx(){return Xe.querySelector(".morphing-menu")}function ij(){return Xe.querySelector(".morphing-menu__bar")}function ux(){return[...he.querySelectorAll(".panel-head, .panel .empty, .thread-card")]}function cl(f){return Y0.push(f),f}function Im(){for(let f of ux())Object.assign(f.style,{opacity:"",transform:"",filter:""});Hr.style.opacity=""}function Gm(f,k){for(let M of he.getAnimations())M.cancel();Object.assign(he.style,{transition:"none",transform:"none",translate:"none",opacity:"1",left:`${f.left}px`,top:`${f.top}px`,width:`${f.width}px`,height:`${f.height}px`,borderRadius:k})}function xA(){Object.assign(he.style,{width:"",height:"",borderRadius:"",transform:"",opacity:""}),z&&ua(),he.offsetWidth,he.style.transition=""}function vA(f=dx()){delete he.dataset.morphing,delete Xe.dataset.edgeSurface,delete Xe.dataset.edgeMorph,delete Xe.dataset.hidden,f&&(f.style.transition="")}function zu(f=!1){Sc+=1;for(let M of Y0)M.stop();Y0=[];let k=$i;$i=!1,f&&he.toggleAttribute("data-tips-ready",C),!(!f||!k)&&(vA(),_c(),Im(),xA())}function rj(f,k,M){let P=he.getBoundingClientRect(),ee=f?null:{left:P.left,top:P.top,width:P.width,height:P.height,radius:he.style.borderRadius||"16px"};zu(!1),ee&&Gm(ee,ee.radius);let se=Sc;$i=!0;let ge=dx();ge&&(ge.style.transition="none");let re=ij(),be=cx(),je=!1,We=()=>{je||se!==Sc||W||(je=!0,$i=!1,vA(ge),f||(Im(),he.style.opacity="0",_c()),xA(),f&&(he.dataset.tipsReady=""))},lt=Go||En();if(f){let nt=k?he.getBoundingClientRect():null,qe=he.style.borderRadius||"16px";he.style.transition="none",he.style.width="",he.style.height="",he.style.borderRadius="",he.style.transform="none";let Se=be.getBoundingClientRect(),Ue=!k&&M&&M.width>0?M:Se;!k&&Ue.width>0&&(iA={left:Ue.left,top:Ue.top,width:Ue.width,height:Ue.height}),sx(),delete he.dataset.morphing,ua();let me=he.getBoundingClientRect();if(he.dataset.morphing="true",lt||Ue.width<=0||me.width<=0||k&&!nt){We();return}let ne=`${Ue.height/2}px`;k&&nt?Gm(nt,qe):Gm(Ue,ne),ux().forEach((xt,Kt)=>{xt.style.opacity="0",xt.style.transform="translateY(48px)",xt.style.filter="blur(4px)",cl(Qr(xt,{opacity:1,y:0,filter:"blur(0px)"},{...DE,delay:HE+Kt*E6}))}),Hr.style.opacity="0",cl(Qr(Hr,{opacity:1},{...DE,delay:HE}));let Ee=()=>{if(se!==Sc||W)return;delete he.dataset.morphing;let xt=he.getBoundingClientRect();cl(Qr(he,{left:[`${xt.left}px`,`${me.left}px`],top:[`${xt.top}px`,`${me.top}px`],width:[`${xt.width}px`,`${me.width}px`],height:[`${xt.height}px`,`${me.height}px`],borderRadius:[he.style.borderRadius||"16px","16px"]},Ol)).finished.then(We).catch(()=>{se===Sc&&We()})};if(k||Ue.height>Ue.width+8){Ee();return}let ze=k6(re?.offsetWidth||Ue.width,re?.offsetHeight||Ue.height),Be=S6(Ue.left+Ue.width/2,Ue.top+Ue.height,ze.width,ze.height),Qe=he.getBoundingClientRect();cl(Qr(he,{left:[`${Qe.left}px`,`${Be.left}px`],top:[`${Qe.top}px`,`${Be.top}px`],width:[`${Qe.width}px`,`${Be.width}px`],height:[`${Qe.height}px`,`${Be.height}px`]},eb)).finished.then(Ee).catch(()=>{});return}let tt=ee??he.getBoundingClientRect(),en=ee?.radius||he.style.borderRadius||"16px";delete Xe.dataset.hidden,he.dataset.morphing="true",sx();let Bt=Xe.getBoundingClientRect(),Ke=iA??{left:(window.innerWidth-(Bt.width||228))/2,top:window.innerHeight-24-(Bt.height||52),width:Bt.width||228,height:Bt.height||52};if(lt||Ke.width<=0||tt.width<=0){We();return}Gm(tt,en);for(let nt of ux())cl(Qr(nt,{opacity:0,y:16,filter:"blur(2px)"},RE));cl(Qr(Hr,{opacity:0},RE)),cl(Qr(he,{left:[`${tt.left}px`,`${Ke.left}px`],top:[`${tt.top}px`,`${Ke.top}px`],width:[`${tt.width}px`,`${Ke.width}px`],height:[`${tt.height}px`,`${Ke.height}px`],borderRadius:[en,`${Ke.height/2}px`]},tb)).finished.then(We).catch(()=>{se===Sc&&We()})}function wn(f,k=!1){!f&&X&&!X.opened&&ye(),f!==C&&$r(),f&&Ou(),Du();let M=f&&!C;if(C=f,Go||zr?.wake(M),delete he.dataset.tipsReady,he.toggleAttribute("data-tips-restored",Go),!e.onboarding&&!k&&oA.set(f),f&&(U=!1),f||(clearTimeout(Io),Io=0,L=!1,Vu=Uu="",qu()),R){cancelAnimationFrame(rx),nj(),M&&!Go&&!En()?st.dataset.mobileEntering="":delete st.dataset.mobileEntering,G=!1,ji(),$t(),ur.show(),ur.update(),st.dataset.mobileEntering!==void 0&&(rx=requestAnimationFrame(()=>{delete st.dataset.mobileEntering}));return}if(z){let se=$i,ge=f?cx().getBoundingClientRect():null;f||delete Xe.dataset.edgeOrient,vn=f?vn:N,Tc=void 0,G=!1,$i=!0;let re=dx();re&&(re.style.transition="none"),ur.show(),ji(),$t(),rj(f,se,ge),ur.update();return}let P=Xe.getBoundingClientRect();vn=f?void 0:N,Tc=void 0,G=!1,ji(),$t(),ns?.stop(),Xe.style.translate="0px 0px";let ee=Xe.getBoundingClientRect();!Go&&!En()&&(ns=Qr(Xe,{translate:[`${P.left-ee.left}px ${P.top-ee.top}px`,"0px 0px"]},{type:"spring",stiffness:680,damping:32,mass:.55})),ur.show(),ur.update()}function Or(){if(ye(),$r(),I=!1,clearTimeout(Io),Io=0,L){Ot(Qt),Au=null,L=!1,$t();return}D=null,j=null,L=!1,Ri=null,Fe="",U=!1,$t()}function aj(){pe=!1,ie=!1,Pe?.setActive(!1),Ac(),Or(),C&&wn(!1),U=!1,I=!1,G=!0,te=!0;try{sessionStorage.setItem(I0,"1")}catch{}$t()}function Ou(){if(!go)return;go=!1,jm=!1;try{zo(sessionStorage,G0)}catch{}Ja.textContent="Comments shown";let f=F0;F0=0,f&&requestAnimationFrame(()=>{let k=he.querySelector(".list");k&&(k.scrollTop=f)})}function wA(f){if(f===go||W||e.onboarding||f&&ie)return;if(!f){let M=jm&&!C;Ou(),M?wn(!0):$t();return}$r(),go=!0;try{sessionStorage.setItem(G0,"1")}catch{}Ja.textContent="Comments hidden",U=I=!1,clearTimeout(Io),Io=0,L=!1;let k=C;k?(F0=he.querySelector(".list")?.scrollTop??0,wn(!1,!0)):$t(),jm=k}function EA(){te=!1,G=!1;try{zo(sessionStorage,I0)}catch{}$t()}function os(f,k=!1){if(k||ye(),$r(),Ou(),R0=!!it.activeElement?.matches(":focus-visible")&&he.contains(it.activeElement),I=!1,clearTimeout(Io),Io=0,!k&&!De(f)){let ee=new URL(f.page,location.origin);ee.searchParams.set("comment",f.id),Hx(ee);return}k||(fe.delete(f.id),X={id:f.id,inspect:!1,pending:!1,rejected:!1,opened:!0}),wc=Mu===f.id&&!Fn.hidden?Fn.getBoundingClientRect():null,wc&&Hi(!0),D=f.id,j=null,L=!1,Ri=null,Fe="",U=!1;let M=R&&C;M&&wn(!1);let P=Ce(f)?ga(f.anchor):null;P?.attached&&!wc&&(M||!R)&&(Jt?y:window).scrollBy({top:(P.y-(M?Math.min(window.innerHeight,window.visualViewport?.height??window.innerHeight):window.innerHeight)*.35)/(Jt?Ro*pr():1),behavior:M&&!En()?"smooth":"instant"}),$t()}function px(){let f=iT(),k=Ni();return $.filter(M=>(ct==="all"||M.resolved===(ct==="resolved"))&&(!de||!!M.tags?.includes(de))&&(!ve||M.comments.some(P=>`${P.body} ${P.author.name}`.toLowerCase().includes(ve.toLowerCase()))||M.page.toLowerCase().includes(ve.toLowerCase()))&&(Ae||De(M,f.resolve,k))).sort((M,P)=>P.updatedAt-M.updatedAt)}function kA(){Promise.resolve().then(()=>(aO(),rO)).then(({showShortcutHelp:f})=>f(it,[...s.map(({label:k,shortcut:M,group:P})=>({label:k,shortcut:M,group:P==="Comments & view"?"Comments":"General"})),{label:"Restore feedback",shortcut:o.restore,group:"General"}],a,ie?"design":I?"comment":void 0,i,v))}function Ho(){Xe.style.display=te?"none":"",ur.update();let{dockCenter:f}=KS(window.innerWidth,window.innerHeight,C);if(R)_c(),Object.assign(Xe.style,{left:"50%",top:"auto",bottom:"calc(16px + env(safe-area-inset-bottom,0px))",transform:"translateX(-50%)"});else if(z)$i||(delete Xe.dataset.hidden,C?sx():(_c(),vn&&Bm(vn)),ua());else{delete Xe.dataset.hidden;let se=!C&&e.drawerContainer?.isConnected?e.drawerContainer.getBoundingClientRect():void 0;se?.width&&!dr&&(Pm=se.left+se.width/2);let ge=Xe.offsetWidth/2,re=se?.width&&Pm!==void 0?Math.max(16+ge,Math.min(window.innerWidth-16-ge,Pm)):f;if(vn)Bm(vn);else if(re!==Tc){let be=Xe.getBoundingClientRect(),je=be.left+be.width/2;ns?.stop(),Xe.style.top="",Xe.style.bottom="",Xe.style.left=`${re}px`,Xe.style.translate="0px 0px",Tc!==void 0&&!En()&&(ns=Qr(Xe,{translate:[`${je-re}px ${be.top-Xe.getBoundingClientRect().top}px`,"0px 0px"]},{type:"spring",stiffness:680,damping:32,mass:.55})),Tc=re}}let k=se=>({glyph:se}),M=[{id:"browse",label:"Browse website",group:"Modes",shortcut:o.browse,icon:k("pointer"),onSelect:()=>Mc(!1)},{id:"comment",label:"Add comment",group:"Modes",shortcut:o.comment,icon:k("comment"),onSelect:()=>Mc(!I)},...a?[{id:"design",label:"Design mode",group:"Modes",shortcut:o.design,icon:k("design"),onSelect:()=>Cc(!ie)}]:[],{id:"comments",group:"Comments & view",label:e.onboarding?C?"Close project panel":"Project settings":C?"Close comments panel":"All comments",shortcut:e.onboarding?null:o.comments,count:e.onboarding||C?void 0:$.filter(se=>!se.resolved).length,icon:k("expand"),onSelect:()=>wn(!C)},{id:"account",group:"Account & help",label:q.user?`${q.user.name} \xB7 Account`:e.onboarding?.inProject?"Set up inline feedback":"Enter your name",icon:{user:q.user},onSelect:()=>{L||Io?(clearTimeout(Io),Io=0,L=!1,$t()):ma()}},{id:"copy-prompts",group:"Comments & view",keepOpenOnSelect:!0,label:Dc==="all"?"Copied prompt":"Copy comments for agent",icon:k(Dc==="all"?"check":"copy"),showInBar:!1,onSelect:()=>Ot(()=>LA("all"))},...v&&!R&&!ie?[{id:"layout",group:"Comments & view",label:b==="edge"?"Frame view":"Floating view",icon:k("expand"),showInBar:!1,onSelect:()=>Z0(b==="edge"?"background":"edge")}]:[],{id:"dismiss",group:"Feedback",label:"Dismiss feedback",icon:k("close"),onSelect:aj},{id:"visibility",group:"Comments & view",label:go?"Show comments":"Hide comments",shortcut:o.visibility,icon:k("comment"),showInBar:!1,onSelect:()=>wA(!go)},{id:"pin-size",group:"Comments & view",label:`Pin size: ${D2[S]}`,icon:k("pointer"),showInBar:!1,children:_2.map(se=>({id:`pin-size-${se}`,label:D2[se],icon:k("check"),checked:se===S,onSelect:()=>sj(se)}))}];M.push({id:"shortcuts",group:"Account & help",label:"Keyboard shortcuts",icon:k("info"),showInBar:!1,onSelect:kA}),s=M,Re==="Offline"&&M.push({id:"retry",label:`${_e?.title??"Offline"} \xB7 Retry`,icon:k("info"),showInBar:!1,onSelect:qm});let P=e.onboarding?M.filter(se=>se.id==="account"||se.id==="comments"):M,ee=BR(e.onboarding?fy:l,se=>se==="more"||P.some(ge=>ge.id===se));ee.length||(Xe.style.display="none"),V2.render({items:P,bar:ee,alignEnd:C&&z?!1:!!vn&&vn.y>window.innerHeight/2,edge:C&&z?"bottom":vn?.edgeX??vn?.edgeY??(vn&&vn.y<window.innerHeight/2?"top":"bottom"),activeId:ie?"design":I?"comment":"browse",label:"Website review",moreLabel:"More review tools"})}function sj(f){if(!(f===S||W)){S=f;try{localStorage.setItem(E,f)}catch{}Ja.textContent=`Pin size: ${D2[f]}`,fa="",mr(),Ho()}}let lj=()=>S==="auto"?U||I||C?"full":"dot":S,is=null,fx=0;function mx(){fx=0;for(let f of bt.querySelectorAll(":scope > .pin")){let k=f.getBoundingClientRect(),M=!!is&&Math.hypot(Math.max(k.left-is.x,0,is.x-k.right),Math.max(k.top-is.y,0,is.y-k.bottom))<=24;f.toggleAttribute("data-near",M)}}let SA=new Set,TA=0,gx=0;function cj(f){let k=!1;for(let M of f)T(M)&&!SA.has(M.id)&&(k=!!SA.add(M.id));!k||En()||(TA=performance.now(),bt.style.setProperty("--pin-breathe-delay","0ms"),bt.dataset.breathe="",clearTimeout(gx),gx=window.setTimeout(()=>delete bt.dataset.breathe,5400))}let fa="",Fm=new Set,AA=new Map;function hx(f,k){let M=f.querySelector(".page");if(!M)return;let P=new URL(k.page,location.origin).href,ee=Jd(k),se=k.page===Ni();M.href=P,M.title=P,M.setAttribute("aria-label",`Open page: ${P}`);let ge=M.closest(".card-page-row");ge.hidden=se&&!ee,ge.querySelector(".card-page-url").textContent=P;let re=ee?"":P;if(M.dataset.url!==re){M.dataset.url=re;let je=ee?"All pages":rM(new URL(P));if(M.textContent=je,e.pageLabel&&!ee){let We=AA.get(P);We||(We=Promise.resolve().then(()=>e.pageLabel(new URL(P))).then(lt=>lt?.trim()||je,()=>je),AA.set(P,We)),We.then(lt=>{!W&&M.dataset.url===P&&(M.textContent=lt)})}}let be=f.querySelector(".card-status");be.textContent=k.resolved?"Resolved":Fm.has(k.id)&&se?"Not found on page":"",be.hidden=!be.textContent,f.classList.toggle("resolved",k.resolved),f.classList.toggle("active",D===k.id),f.querySelector(".thread-card").setAttribute("aria-description",[ee&&"All pages",P,be.textContent].filter(Boolean).join(" \xB7 "))}let bx=!1,yx=0,xx=e.pins?.cluster!==!1,Ym,MA=!1;function dj(){MA||(MA=!0,Promise.resolve().then(()=>(dO(),cO)).then(f=>Ym=f,()=>xx=!1).then(()=>{fa="",mr()}))}let CA=()=>Jt?_u():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight};function mr(f=!1){let k=G||go;if(k&&$r(),Gt||bx&&!f)return;if(k){fa="",Hi(),bt.replaceChildren();return}let M=lj();M==="full"?delete bt.dataset.size:bt.dataset.size=M;let P=$.find(Se=>Se.id===D);P&&H(P);let ee=iT(),se=Ni(),ge=$.filter(Se=>!Se.resolved&&(!de||!!Se.tags?.includes(de))&&De(Se,ee.resolve,se));M==="dot"&&cj(ge);let re=new Map,be=xx?pM(ge,Se=>{let Ue=ee.resolve(Se.anchor),me=Ue&&Yf(Ue,y,e.anchorTarget);return!me||me===y||me===document.body?null:(re.set(Se.id,me),me)}):new Map,je=ge.map(Se=>{let Ue=ee.locate(Se.anchor);if(Ue.y<-Ue.height-40||Ue.y>window.innerHeight+40)return{thread:Se,rect:Ue,blocked:!1};let me=ee.resolve(Se.anchor),ne=Lx(Ue.x+8,Ue.y-10),Ee=!!(me&&ne&&!me.contains(ne)&&!ne.contains(me));return{thread:Se,rect:Ue,blocked:Ee}});for(let{thread:Se,rect:Ue}of je){if(Fm.has(Se.id)===!Ue.attached)continue;Ue.attached?Fm.delete(Se.id):Fm.add(Se.id);let me=it.querySelector(`.thread-item[data-thread="${CSS.escape(Se.id)}"]`);me&&hx(me,Se)}let We=JSON.stringify([D,M,j&&ee.locate(j),je.map(({thread:Se,rect:Ue,blocked:me})=>[Se.id,Ue,me,rg(Ue,window.innerWidth),be.get(Se.id)?.[0].id])]);if(We===fa)return;fa=We,ol?.isPreviewing(z0)||Hi();let lt=it.activeElement?.matches(".pins :focus-visible")?it.activeElement.dataset:void 0,tt=bt.querySelector(".pin-cluster[open]")?.dataset.cluster;bt.replaceChildren(),"breathe"in bt.dataset&&bt.style.setProperty("--pin-breathe-delay",`${(TA-performance.now())%1800}ms`);let en=new Map(je.map(Se=>[Se.thread.id,Se])),Bt=CA(),Ke=[],an=new Set;for(let{thread:Se,rect:Ue,blocked:me}of je){if(!Ue.attached)continue;let ne=be.get(Se.id),Ee=ne&&en.get(ne[0].id),ze=Ee?.rect.attached?Ee:{rect:Ue,blocked:me};if(ze.rect.y<-ze.rect.height-40||ze.rect.y>window.innerHeight+40||ze.blocked)continue;if(Ue.width&&Ue.height){let xt=w("div","area");Object.assign(xt.style,{left:`${Ue.x}px`,top:`${Ue.y}px`,width:`${Ue.width}px`,height:`${Ue.height}px`,opacity:Se.id===D?"1":".45"}),bt.append(xt)}let Be=Ee?.rect.attached?ne:null;if(Be&&an.has(Be))continue;let Qe=ze.rect,Nt=Be?Qe.x-9+Math.min(Be.length,6)*38>Bt.right:rg(Qe,window.innerWidth)==="right";Be&&an.add(Be),Ke.push({threads:Be??[Se],rect:Qe,right:Nt,owner:Be?re.get(Be[0].id):void 0,box:Se.anchor.unstacked||Se.id===D?null:mM(Qe.x,Qe.y,Nt,Be?fM(Be.length,M==="dot"?12:20):24)})}let nt=(Se,Ue)=>{let me=$.indexOf(Se)+1,ne=Se.comments[0],Ee=Oe(ne?`Comment ${me} by ${ne.author.name}: ${$2(ne.body)}`:`Comment ${me}`,()=>os(Se),`pin${Se.id===D?" active":""}${Se.id===Bu?" hot":""}${Se.resolved?" resolved":""}${Ue.attached?"":" detached"}`);if(Ee.textContent="",Ee.title="",Ee.toggleAttribute("data-read",!T(Se)),ne){let Be=ne.author;Xu(Ee,Be.accentColor);let Qe=yr(Be);Qe.dataset.initial=ep(Be.name).slice(0,1),Ee.append(Qe);let Nt=Ee.querySelector("img");Nt&&(Nt.draggable=!1)}if(Se.resolved){let Be=w("span","pin-check");Be.append(yt("check")),Ee.append(Be)}let ze=()=>{if(D||j||U||Gt||sr||xc)return;Dm=!1,window.clearTimeout(_m);let Be=Fn.hidden||Mu!==Se.id;vc?.cancel(),Mu=Se.id,Fn.replaceChildren();let Qe=Se.comments[0];if(!Qe)return;let Nt=Oe("Open comment",()=>os(Se),"pin-preview-open");Nt.textContent="";let xt=mo.test(Qe.body),Kt=w(xt?"div":"p","hover-message",O2(Qe.body));xt&&Eu().then(({renderDesignComment:jt})=>jt(Kt,Qe.body,{key:z0=`hover:${Qe.id}`,resolve:Rn=>Ce(Se)?L0(Se.anchor)(Rn):null,note:(Rn,Yo)=>Rn.textContent=Yo,compact:!0,design:e.design})),Nt.append(zA(Qe)),xt?(Kt.classList.add("pin-preview-card"),Kt.addEventListener("click",jt=>{jt.target.closest(".design-toggle")||os(Se)})):Nt.append(Kt);let Bi=Oe(Se.resolved?"Reopen comment":"Resolve comment",()=>{Hi(),kx(Se)},"icon pin-preview-resolve","check");Bi.disabled=!Zm(),Fn.append(Nt,...xt?[Kt]:[],Bi),Fn.hidden=!1;let mi=_x(Ee,Ue),vt=C&&!R?396:12,Vt=GS(KA(Ee),Fn.offsetWidth||320,Fn.offsetHeight,{left:12,top:12,right:window.innerWidth-vt,bottom:Jt?Math.min(window.innerHeight,_u().bottom)-12:window.innerHeight-92});Object.assign(Fn.style,{left:`${Vt.x}px`,transformOrigin:mi.x<Vt.x+160?"top left":"top right",top:`${Vt.y}px`}),Be&&!En()&&(vc=Fn.animate([{opacity:0,transform:"translateY(6px) scale(.97)"},{opacity:1,transform:"none"}],{duration:250,easing:"cubic-bezier(.22,1,.36,1)"}))};return Ee.addEventListener("pointerenter",ze),Ee.addEventListener("pointermove",Be=>{xc&&!Gt&&!sr&&Be.buttons===0&&(Be.movementX||Be.movementY)&&(xc=!1,ze())}),Ee.addEventListener("focus",ze),Ee.addEventListener("blur",()=>Hi()),Ee.addEventListener("pointerleave",()=>{_m=window.setTimeout(Hi,120)}),Ee.dataset.thread=Se.id,Ee},qe={root:it,bounds:Bt,pin:Se=>nt(Se,en.get(Se.id).rect),summary:Se=>$2(Se.comments[0]?.body??""),open:Se=>os(Se),menu:qf};for(let Se of xx?gM(Ke.map(Ue=>Ue.box)):Ke.map((Ue,me)=>[me])){let Ue=Ke[Se[0]];if(Se.length>1||Ue.threads.length>1)Ym?bt.append(Se.length>1?Ym.bubble(Se.map(me=>Ke[me]),Se.flatMap(me=>Ke[me].threads).sort(Px),qe):Ym.stack(Ue,qe)):dj();else{let me=qe.pin(Ue.threads[0]);me.dataset.pointer=Ue.right?"right":"left",Object.assign(me.style,{left:`${Ue.rect.x}px`,top:`${Ue.rect.y}px`}),bt.append(me)}}if((lt?.thread||lt?.cluster)&&bt.querySelector(lt.thread?`.pin[data-thread="${CSS.escape(lt.thread)}"]`:`[data-cluster="${CSS.escape(lt.cluster)}"]`)?.focus({preventScroll:!0}),tt&&bt.querySelector(`[data-cluster="${CSS.escape(tt)}"]`)?.setAttribute("open",""),bt.dataset.size&&is&&mx(),j&&j.width>0&&j.height>0){let Se=ga(j),Ue=w("div","area");Object.assign(Ue.style,{left:`${Se.x}px`,top:`${Se.y}px`,width:`${Math.max(8,Se.width)}px`,height:`${Math.max(8,Se.height)}px`}),bt.append(Ue)}}let Dc=null,vx=0;async function LA(f){let k=DM(f==="page"?$.filter(M=>De(M)):$,{...e,origin:location.origin,page:f==="page"?Ni():void 0});if(!k){Dn(f==="page"?"No open comments on this page":"No open comments to copy");return}await navigator.clipboard.writeText(k),!W&&(Dc=f,Ja.textContent="Agent prompt copied",clearTimeout(vx),Ho(),pi(),vx=window.setTimeout(()=>{Dc=null,Ho(),pi()},2e3))}let $u,Nu,Xm=f=>{f.removeAttribute("title"),f.addEventListener("pointerenter",k=>{k.pointerType==="mouse"&&Nu?.show(f)}),f.addEventListener("focus",()=>Nu?.show(f));for(let k of["pointerleave","blur","pointerdown"])f.addEventListener(k,()=>Nu?.hide())},Wm=new Set,_A="palette:dismissed-tips",DA=[["copy","Copy comments for your agent."]];o.comment&&DA.push(["shortcut",`Press ${o.comment.label} to comment.`]);function uj(f){try{let k=JSON.parse(localStorage.getItem(_A)??"[]");if(Array.isArray(k))for(let M of k)typeof M=="string"&&Wm.add(M)}catch{}for(let[k,M]of DA){let P=he.querySelector(`[data-tip="${k}"]`);if(!f||Wm.has(k)){P?.remove();continue}if(P)continue;P=w("div","morphing-menu__tooltip sidebar-tip"),P.dataset.tip=k;let ee=P;P.append(w("p","",M),Oe("Dismiss tip",()=>{Wm.add(k);try{localStorage.setItem(_A,JSON.stringify([...Wm]))}catch{}ee.dataset.leaving="",setTimeout(()=>ee.remove(),150)},"icon","close")),he.append(P)}wx()}function wx(){let f=he.getBoundingClientRect();for(let k of he.querySelectorAll(".sidebar-tip")){let M=k.dataset.tip==="copy",P=he.querySelector(M?".copy-page-prompt":'.toolbar [aria-label^="Add comment"]')?.getBoundingClientRect();if(k.hidden=!P?.width,!P?.width)continue;let ee=P.left+P.width/2-f.left,se=Math.max(12,Math.min(f.width-12-k.offsetWidth,ee-k.offsetWidth/2));k.style.left=`${se}px`,k.style.top=M?`${P.bottom-f.top+10}px`:`${P.top-f.top-10-k.offsetHeight}px`,k.style.setProperty("--caret-x",`${ee-se}px`)}}let Ex,ju=!1;function pj(f){if(!ju||Le.busy)return;let k=px().filter(ge=>ge.resolved).map(ge=>ge.id);if(!k.length)return;let M=w("div","cleanup-confirm");M.popover="auto",M.setAttribute("role","alertdialog"),M.setAttribute("aria-label","Delete resolved comments permanently"),M.append(w("strong","",`Delete ${k.length} resolved ${k.length===1?"thread":"threads"}?`),w("p","","Their replies will be deleted too. This can\u2019t be undone."));let P=w("div","cleanup-actions"),ee=()=>{M.hidePopover(),f.focus({preventScroll:!0})};P.append(Oe("Cancel",ee,"secondary"),Oe("Delete permanently",()=>{ee(),Ot(async()=>{try{for(let ge=0;ge<k.length;ge+=250){let re=k.slice(ge,ge+250),be=new Set(re);await Le.submit(je=>je.filter(We=>!be.has(We.id)),async()=>{await q.request("project/clear-resolved","POST",{confirm:e.project,threadIds:re})})}}finally{await fr()}})},"secondary destructive")),M.append(P),he.append(M),M.addEventListener("toggle",()=>{M.matches(":popover-open")||M.remove()}),M.showPopover();let se=f.getBoundingClientRect();M.style.left=`${Math.max(12,Math.min(se.right-M.offsetWidth,innerWidth-M.offsetWidth-12))}px`,M.style.top=`${Math.max(12,Math.min(se.bottom+8,innerHeight-M.offsetHeight-12))}px`,P.querySelector("button")?.focus()}let Zm=()=>!Q&&(Pn||!!q.user?.verified);function kx(f,k){if(!q.user&&(!Et||!da.trim())){ma();return}let M=D===f.id,P=ee=>{let se=D;return M&&(D=ee?null:f.id),ut(Ie(f.id,ge=>({...ge,resolved:ee,resolvedBy:ee?q.user:null})),async ge=>{q.user||await q.guest(da),await q.request(`threads/${ge(f.id)}`,"PATCH",{resolved:ee})},()=>{D||(D=se)})};Ot(()=>P(!f.resolved)),Dn(f.resolved?"Comment reopened":"Comment resolved",{label:"Undo",run:()=>Ot(()=>P(f.resolved))},k)}let RA=new WeakMap,Rc=new Set;function HA(f,k){return f.textContent=k,mo.test(k)&&(f.textContent="Design change",Eu().then(({summarizeDesignComment:M})=>{f.textContent=M(k)})),f}function pi(){if(e.onboarding){if($u?.(),he.replaceChildren(),e.onboarding.inProject)return;if(C){let ne=w("aside","panel");ne.setAttribute("aria-label","Project settings");let Ee=w("div","panel-head","Project settings"),ze=w("div","empty");ze.append(w("p","","Leave comments on your connected website."),Oe("Manage project",()=>{ma()},"secondary")),ne.append(Ee,ze),he.append(ne)}return}if(!C&&(z||R))return;let f=he.querySelector(".list"),k=f?.scrollTop??0,M=it.activeElement?.closest(".thread-item"),P=M?.querySelector(".reply-composer")?.contains(it.activeElement)?M:null,ee=w("div"),se=it.activeElement?.getAttribute("aria-label")==="Search comments",ge=se?it.activeElement.selectionStart:null;if(!C&&!z&&!R){$u?.(),he.replaceChildren();return}let re=he.querySelector(".panel");if(!re){re=w("aside","panel"),re.setAttribute("aria-label","All comments");let ne=w("div","panel-head"),Ee=w("div","row between sidebar-title"),ze=w("div","filter-slot"),Be=w("div","row"),Qe=Hn=>{let qn=re.querySelector(".sidebar-search-field"),hr=Be.querySelector('[aria-label="Search comments"]'),un=(Hn?hr:qn).getBoundingClientRect();kc=Hn,Hn||(ve="",qn.querySelector("input").value=""),pi();let ba=(Hn?qn:hr).getBoundingClientRect();En()||qn.animate(Hn?[{transform:`translate(${un.left-ba.left}px, ${un.top-ba.top}px)`,width:`${un.width}px`,height:`${un.height}px`,borderRadius:"50%",opacity:.4},{transform:"none",width:`${ba.width}px`,height:`${ba.height}px`,borderRadius:"10px",opacity:1}]:[{transform:"none",opacity:1},{transform:`translate(${ba.left-un.left}px, ${ba.top-un.top}px) scale(.2)`,opacity:0}],{duration:280,easing:"cubic-bezier(.22,1,.36,1)"}),Hn?qn.querySelector("input")?.focus():hr.focus()};Be.append(Oe("Copy page comments",()=>ct==="resolved"?pj(re.querySelector(".copy-page-prompt")):Ot(()=>LA("page")),"icon copy-page-prompt","copy"),w("div","tag-filter-slot"),Oe("Search comments",()=>Qe(!0),"icon sidebar-search-trigger","search"),Oe("Close sidebar",()=>wn(!1),"icon","close"));let Nt=w("div","sidebar-selector");Nt.append(ze,w("div","scope-slot")),Ee.append(Nt,Be);let xt=w("div","sidebar-search"),Kt=w("div","sidebar-search-inner"),Bi=w("div","sidebar-search-row"),mi=w("div","sidebar-search-field"),vt=w("input");vt.type="search",vt.placeholder="Search",vt.setAttribute("aria-label","Search comments"),vt.addEventListener("input",()=>{ve=vt.value,pi()}),vt.addEventListener("keydown",Hn=>{Hn.key==="Escape"&&(Hn.stopPropagation(),Vt())}),mi.append(yt("search"),vt);let Vt=()=>Qe(!1);mi.append(Oe("Close search",Vt,"icon search-cancel","close")),Bi.append(mi),Kt.append(Bi),xt.append(Kt),ne.append(Ee,xt);let jt=w("div","morphing-menu__tooltip sidebar-tooltip");jt.setAttribute("aria-hidden","true"),it.append(jt);let Rn=0,Yo=0,ha=()=>{clearTimeout(Rn),jt.dataset.open&&(delete jt.dataset.open,Yo=Date.now()+300)};$u=()=>{clearTimeout(Rn),jt.remove(),$u=void 0,Nu=void 0};let dn=Hn=>{clearTimeout(Rn);let qn=()=>{if(!Hn.isConnected)return;let hr=Hn.getBoundingClientRect();jt.textContent=Hn.ariaLabel;let un=jt.offsetWidth/2;jt.style.left=`${Math.max(8+un,Math.min(innerWidth-8-un,hr.left+hr.width/2))}px`,jt.style.top=`${hr.bottom+8}px`,jt.dataset.open="true"};jt.dataset.open||Date.now()<Yo?qn():Rn=window.setTimeout(qn,400)};Be.querySelectorAll("button").forEach(Xm),Nu={show:dn,hide:ha},re.append(ne),he.append(re)}let be=re.querySelector(".copy-page-prompt");if(ct==="resolved"&&Ex!==q.token){Ex=q.token,ju=!1;let ne=Ex;ne&&q.request("project").then(()=>{q.token===ne&&(ju=!0,pi())}).catch(()=>{})}let je=ct==="resolved";be.disabled=je&&(!ju||Le.busy||!px().length),be.classList.toggle("destructive",je);let We=je?"trash":Dc==="page"?"check":"copy";if(be.dataset.glyph!==We){let ne=be.querySelector("svg:not([data-leaving])"),Ee=yt(We),ze=be.dataset.glyph!==void 0&&!En();if(be.dataset.glyph=We,ze&&ne){ne.setAttribute("data-leaving","true"),be.append(Ee);let Be={duration:200,easing:"cubic-bezier(.22,1,.36,1)"},Qe={opacity:0,transform:"scale(.7)",filter:"blur(2px)"},Nt={opacity:1,transform:"scale(1)",filter:"blur(0px)"};ne.animate([Nt,Qe],{...Be,fill:"forwards"}).finished.then(()=>ne.remove()).catch(()=>ne.remove()),Ee.animate([Qe,Nt],Be)}else be.replaceChildren(Ee)}be.setAttribute("aria-label",je?ju?"Delete resolved comments permanently":"Project owner only":Dc==="page"?"Copied prompt":"Copy page comments"),re.dataset.search=String(kc),re.querySelector(".filter-slot").inert=kc,re.querySelector(".scope-slot").inert=!kc,re.querySelector(".sidebar-search-trigger").inert=kc;let lt=re.querySelector(".sidebar-search");lt.inert=!kc;let tt=re.querySelector(".filter-slot"),en=c?[...new Set($.flatMap(ne=>ne.tags??[]))].sort():[];de&&!en.includes(de)&&(de=""),tt.dataset.value!==ct&&(tt.dataset.value=ct,tt.replaceChildren(ec("Filter comments",[["open","Comments"],["all","All comments"],["resolved","Resolved"]],ct,ne=>{ct=ne,pi(),mr()})));let Bt=re.querySelector(".tag-filter-slot"),Ke=`${de} ${en}`;if(Bt&&Bt.dataset.value!==Ke&&(Bt.dataset.value=Ke,Bt.replaceChildren(),en.length)){let ne=de?`Filtered by #${de}`:"Filter by tag",Ee=ec(ne,[["","All tags"],...en.map(Be=>[Be,`#${Be}`])],de,Be=>{de=Be,pi(),mr()}),ze=Ee.querySelector("summary");ze.className=`icon tag-filter-trigger${de?" active":""}`,ze.setAttribute("aria-label",ne),ze.title=ne,ze.replaceChildren(yt("tag")),Bt.append(Ee)}let an=re.querySelector(".scope-slot");an.dataset.value!==String(Ae)&&(an.dataset.value=String(Ae),an.replaceChildren(ec("Comment pages",[["page","This page"],["all","All pages"]],Ae?"all":"page",ne=>{Ae=ne==="all",pi()})));let nt=!R&&!Go&&!En(),qe=new Map;if(nt&&f){let ne=f.getBoundingClientRect();for(let Ee of f.querySelectorAll("[data-thread]")){let ze=Ee.getBoundingClientRect();ze.bottom>=ne.top&&ze.top<=ne.bottom&&qe.set(Ee.dataset.thread,ze.top)}}let Se=w("div","list"),Ue=px();Ue.length>40&&(Se.dataset.long="");let me=!ae&&Re==="Connecting";Se.setAttribute("aria-busy",String(me)),clearTimeout(Mm),Se.addEventListener("scroll",()=>{Se.dataset.scrolling="true",clearTimeout(Mm),Mm=window.setTimeout(()=>{delete Se.dataset.scrolling},800)},{passive:!0});for(let ne of Ue){let Ee=ne.comments[0];if(!Ee)continue;let ze=RA.get(ne);if(ze){ze.querySelector(".thread-card").classList.toggle("active",D===ne.id),ze.querySelector(".card-resolve").disabled=!Zm(),ze.querySelector("small").textContent=Bc(Ee.createdAt),ze.querySelectorAll(".reply-meta small").forEach((Hn,qn)=>{Hn.textContent=Bc(ne.comments[qn+1].createdAt)}),hx(ze,ne);let dn=ze.querySelector("textarea");dn&&it.activeElement!==dn&&requestAnimationFrame(()=>dn.dispatchEvent(new Event("palette-sync-reply"))),Se.append(ze===P?ee:ze);continue}let Be=Oe(`Open comment by ${Ee.author.name}`,()=>os(ne),`thread-card${D===ne.id?" active":""}`);Be.replaceChildren(),Be.removeAttribute("title");let Qe=w("div","row"),Nt=w("span","card-status");Qe.append(yr(Ee.author),w("span","author",Ee.author.name),Nt,w("small","",Bc(Ee.createdAt)));let xt=w("div","card-page-row"),Kt=w("a","page","Page link");Kt.addEventListener("click",dn=>{dn.preventDefault(),os(ne)});let Bi=Oe("Copy page URL",()=>Ot(async()=>{await navigator.clipboard.writeText(new URL(ne.page,location.origin).href),Dn("Page URL copied")}),"icon card-page-copy","copy"),mi=w("span","card-page-url");xt.append(yt("link"),Kt,Bi,mi);let vt=HA(w("p","preview"),Ee.body);if(Be.append(Qe,vt),c&&ne.tags?.length){let dn=w("div","card-tags");dn.setAttribute("role","group"),dn.setAttribute("aria-label","Tags");for(let Hn of ne.tags){let qn=w("span","card-tag",`#${Hn}`);qn.title=Hn,dn.append(qn)}Be.append(dn)}let Vt=P?.dataset.thread===ne.id?P:null,jt=Vt??w("div","thread-item"),Rn=Vt?.querySelector(".sidebar-replies"),Yo=Rn?.querySelector(".reply-composer");if(Vt)for(let dn of[...Vt.children])dn!==Rn&&dn.remove();jt.dataset.thread=ne.id;let ha=Oe(ne.resolved?"Reopen comment":"Resolve comment",()=>kx(ne),"icon card-resolve","check");ha.disabled=!Zm(),Xm(ha),jt.insertBefore(Be,Rn??null),jt.insertBefore(ha,Rn??null),ne.snapshot?.image&&jt.insertBefore(ku(0,ne),Rn??null),jt.insertBefore(xt,Rn??null),hx(jt,ne);{let dn=Rn??w("div","sidebar-replies");if(Yo)for(let un of[...dn.children])un!==Yo&&un.remove();dn.id=`replies-${ne.id}`,dn.setAttribute("role","group"),dn.setAttribute("aria-label",`Replies to ${Ee.author.name}`);let Hn=ne.comments.length===1?"Reply":`${ne.comments.length-1} ${ne.comments.length===2?"reply":"replies"}`,qn=Oe(Hn,()=>{Rc.has(ne.id)?Rc.delete(ne.id):Rc.add(ne.id),hr()},"card-reply-toggle");qn.replaceChildren(yt("comment"),w("span","",Hn),yt("chevron")),qn.removeAttribute("title"),qn.setAttribute("aria-controls",dn.id);let hr=()=>{let un=Rc.has(ne.id);dn.hidden=!un,qn.setAttribute("aria-expanded",String(un)),qn.setAttribute("aria-label",`${un?"Hide":"Show"} ${Hn}`),un&&requestAnimationFrame(()=>dn.querySelector("textarea")?.dispatchEvent(new Event("palette-sync-reply")))};hr();for(let un of ne.comments.slice(1)){let ba=w("div","sidebar-reply"),iM=w("div","row reply-meta");iM.append(yr(un.author),w("span","author",un.author.name),w("small","",Bc(un.createdAt))),ba.append(iM,w("p","",un.body)),dn.insertBefore(ba,Yo??null)}Yo||dn.append(Ax(ne)),jt.insertBefore(qn,Rn??null),Rn||jt.append(dn),jt.onkeydown=un=>{un.key!=="Escape"||!Rc.has(ne.id)||(un.preventDefault(),un.stopPropagation(),Rc.delete(ne.id),hr(),qn.focus({preventScroll:!0}))}}RA.set(ne,jt),Se.append(Vt?ee:jt)}if(!Se.childElementCount){let ne=w("div","empty");if(me&&ne.setAttribute("role","status"),ne.append(yt("comment"),w("strong","",ce?Ve?"Private project":"Sign in required":Re==="Offline"&&_e?_e.title:me?"Loading comments\u2026":ve?"No matching comments":ct==="resolved"?"Nothing resolved yet":"No comments yet")),ce)ne.append(w("p","",ce)),q.user?.verified||ne.append(Oe("Sign in",ma,"secondary"));else if(Re==="Offline"&&_e){ne.append(w("p","",_e.detail));let Ee=w("div","empty-actions");_e.kind==="site"&&Ee.append(Oe("Turn on comments",()=>{let ze=new URL("setup",e.endpoint.replace(/\/?$/,"/"));ze.searchParams.set("workspace",e.project),ze.searchParams.set("site",location.origin),window.open(ze,"_blank","noopener")},"primary"),Oe("Copy link",()=>{navigator.clipboard.writeText(location.origin).then(()=>Dn("Link copied")).catch(()=>Dn(location.origin))},"secondary")),_e.kind!=="site"&&Ee.append(Oe("Try again",qm,"secondary")),ne.append(Ee)}else ae&&!ve&&ct!=="resolved"&&ne.append(Oe("Add a comment",()=>{Mr(window.innerWidth,window.innerHeight)&&wn(!1),Mc(!0)},"secondary"));Se.append(ne),Se.dataset.empty=""}if($.length&&Re==="Offline"&&Se.prepend(Oe("Saved comments \xB7 Try again",qm,"secondary")),f&&P&&ee.parentNode===Se){for(let ne of[...f.children])ne!==P&&ne.remove();for(let ne of[...Se.children]){if(ne===ee)break;f.insertBefore(ne,P)}ee.remove(),f.append(...Se.childNodes),f.setAttribute("aria-busy",String(me)),Ue.length>40?f.dataset.long="":delete f.dataset.long,Se=f}else f?f.replaceWith(Se):re.append(Se);if(uj(!!Se.querySelector(".empty [aria-label='Add a comment']")),requestAnimationFrame(wx),Se.scrollTop=k,Se.style.setProperty("--palette-scrollbar",`${Se.offsetWidth-Se.clientWidth}px`),nt){let ne=0,Ee=Se.getBoundingClientRect();for(let ze of Se.querySelectorAll("[data-thread]")){let Be=ze.getBoundingClientRect();if(Be.bottom<Ee.top||Be.top>Ee.bottom)continue;let Qe=qe.get(ze.dataset.thread),Nt=Qe===void 0?8:Qe-Be.top;Math.abs(Nt)>.5&&ze.animate([{opacity:Qe===void 0?0:1,transform:`translateY(${Math.max(-40,Math.min(40,Nt))}px)`},{opacity:1,transform:"translateY(0)"}],{duration:250,delay:Qe===void 0?Math.min(ne++,5)*40:0,easing:"cubic-bezier(0.22, 1, 0.36, 1)",fill:"backwards"})}Se.querySelector("[data-thread]")||Se.animate([{opacity:0},{opacity:1}],{duration:150})}if(se){let ne=re.querySelector('input[type="search"]');ne.focus(),ge!==null&&ne.setSelectionRange(ge,ge)}}function zA(f){let k=w("div","row");return k.append(yr(f.author),w("span","author",f.author.name),w("small","",Bc(f.createdAt))),k.title=f.author.verified?"Verified":"Guest",k}function OA(f,k){return q.user?.id!==f.author.id||f.body==="[Comment deleted]"?[]:[{label:"Edit",icon:"edit",onSelect:()=>{Ri=f.id,Su=f.body,gr()}},{label:"Delete",icon:"trash",destructive:!0,onSelect:()=>{let M=nx(k.anchor);Dn("Delete this comment?",{label:"Delete",run:()=>{let P=D;k.comments.length===1&&(D=null),Ot(()=>ut(Ie(k.id,ee=>{let se=ee.comments.filter(ge=>ge.id!==Le.id(f.id));return se.length?{...ee,comments:se}:null}),async ee=>{await q.request(`threads/${ee(k.id)}/comments/${ee(f.id)}`,"DELETE")},()=>{D||(D=P)})),Dn("Comment deleted",void 0,M)}})}}]}function fj(f,k){let M=w("article","message");if(M.dataset.comment=f.id,M.append(zA(f)),Ri===f.id){let re=w("div","message-content message-edit"),be=w("textarea","message-editor");be.value=Su,be.rows=1,be.maxLength=4e3,be.setAttribute("aria-label","Edit comment"),be.dataset.focusKey="edit";let je=()=>{be.style.height="auto",be.style.height=`${be.scrollHeight+be.offsetHeight-be.clientHeight}px`};be.addEventListener("input",()=>{Su=be.value,je()}),requestAnimationFrame(()=>be.isConnected&&je());let We=()=>{Ri=null,gr()},lt=Oe("Save changes",()=>{let Ke=Su;Ri=null,Ot(()=>ut(Ie(k.id,an=>({...an,comments:an.comments.map(nt=>nt.id===Le.id(f.id)?{...nt,body:Ke,editedAt:Date.now()}:nt)})),async an=>{await q.request(`threads/${an(k.id)}/comments/${an(f.id)}`,"PATCH",{body:Ke})},()=>{Ri||(Ri=Le.id(f.id),Su=Ke)}))},"primary");lt.disabled=Q;let tt=po(),en=(Ke,an,nt,qe=!1)=>(Ke.replaceChildren(an,Zd({key:nt,ctrl:qe&&!tt,meta:qe&&tt},tt)),Ke.removeAttribute("title"),Ke);be.addEventListener("keydown",Ke=>{Ke.isComposing||(Ke.key==="Escape"?(Ke.preventDefault(),Ke.stopPropagation(),We()):Ke.key==="Enter"&&(tt?Ke.metaKey:Ke.ctrlKey)&&!lt.disabled&&(Ke.preventDefault(),lt.click()))});let Bt=w("div","edit-actions");return Bt.append(en(Oe("Cancel",We,"secondary"),"Cancel","Escape"),en(lt,"Save","Enter",!0)),re.append(be,Bt),M.append(re),M}let P=w("div","message-content"),ee=mo.test(f.body),se=w(ee?"div":"p","message-text");if(ok(se,f.body),ee){let re=({renderDesignComment:be})=>be(se,f.body,{key:f.id,resolve:je=>Ce(k)?L0(k.anchor)(je):null,note:ok,sourceHref:ng,design:e.design,tip:Xm,onSwitch:()=>fi(),blocked:()=>Ce(k)?ie&&it.querySelector(".design-inspector__compare")?.hidden===!1?"Send or reset your Design mode edits first":void 0:"Proposed on another page"});ol?re(ol):Eu().then(re)}if(P.append(se),f.body!=="[Comment deleted]"){let re=Oe("Add reaction",()=>{Tu?.(!0),Tu=aD(it,re,je=>mj(f,k,je,!(q.user&&f.reactions[je]?.includes(q.user.id))),Object.entries(f.reactions).find(([,je])=>q.user&&je.includes(q.user.id))?.[0],`palette:emoji:${e.project}:${q.user?.id??"guest"}`,e.emojiDataSource)},"icon message-reaction","smile"),be=Object.entries(f.reactions).filter(([,je])=>je.length>0);if(re.dataset.reactions=JSON.stringify(be),be.length){re.replaceChildren(),re.classList.add("has-reactions");for(let[je,We]of be)re.append(w("span","reaction-value",`${je}${We.length>1?` ${We.length}`:""}`));re.setAttribute("aria-label","Change reactions")}re.setAttribute("aria-haspopup","menu"),re.setAttribute("aria-expanded","false"),P.append(re)}M.append(P);let ge=w("div","actions");if(q.user?.id===f.author.id&&f.body!=="[Comment deleted]"){let re=qf("Message actions",OA(f,k));k.comments[0]?.id!==f.id&&M.firstElementChild?.append(re)}return f.editedAt&&ge.append(w("small","","Edited")),ge.childElementCount&&M.append(ge),M}function mj(f,k,M,P){if(!q.user&&(!Et||!da.trim())){ma();return}Ot(async()=>{q.user||await q.guest(da);let ee=q.user;await ut(Ie(k.id,se=>({...se,comments:se.comments.map(ge=>{if(ge.id!==Le.id(f.id))return ge;let re=Object.fromEntries(Object.entries(ge.reactions).map(([be,je])=>[be,je.filter(We=>We!==ee.id)]));return P&&(re[M]=[...re[M]??[],ee.id]),{...ge,reactions:re}})})),async se=>{await q.request(`threads/${se(k.id)}/comments/${se(f.id)}/reactions`,"POST",{emoji:M,active:P})}),P&&A6(`palette:emoji:${e.project}:${ee.id}`,M)})}async function Sx(f="github"){let k=window.open("about:blank","branch-comments-signin","popup,width=600,height=720");if(!k)throw new Error("Allow popups to sign in.");try{let M=await q.request(`auth/${f}/start`,"POST",{}),P=new URL(M.url).origin,ee=se=>{if(se.origin!==P||se.source!==k||se.data?.type!=="branch-comments:auth")return;let{token:ge,user:re}=se.data;typeof ge!="string"||!re?.id||!re?.name||re.verified!==!0||(q.save({token:ge,user:re}),sl(),Ye=null,window.removeEventListener("message",ee),clearTimeout(H0),k.close(),L=!!e.onboarding,$t(),!e.onboarding&&(Au?Ot(PA):(Ot(fr),Dn(`Signed in as ${re.name}`))))};window.addEventListener("message",ee,{signal:Y.signal}),H0=window.setTimeout(()=>{window.removeEventListener("message",ee)},6e5),k.location.href=M.url}catch(M){throw k.close(),M}}let Tx;function $A(f,k,M,P){let ee=w("div","tag-slot");ee.hidden=!!P&&!f.length;let se=({tagEditor:ge})=>ge(ee,{tags:f,suggestions:[...new Set($.flatMap(re=>re.tags??[]))].sort(),onAdd:k,onRemove:M,trigger:P});if(Tx)se(Tx);else{let ge=!1;P&&(P.onclick=()=>{ge=!0}),Promise.resolve().then(()=>(fO(),pO)).then(re=>{Tx=re,se(re),ge&&P?.isConnected&&P.click(),fi()})}return ee}function NA(f,k){if(!q.user){ma();return}Ot(async()=>{let{tags:M}=await q.request(`threads/${Le.id(f.id)}`,"PATCH",k);$=$.map(P=>P.id===f.id?{...P,tags:M}:P),pi()})}function Ax(f){let k=w("form",`composer ${f?"reply-composer":"new-comment-composer"}`),M=w("textarea"),P=f?"":lr;if(M.placeholder=f?"Reply\u2026":P?"Add a note\u2026":"Add a comment\u2026",M.rows=1,M.maxLength=4e3,M.required=!!f||!lr,M.value=f?di.get(f.id)??"":Do,M.setAttribute("aria-label",f?"Reply":"Comment"),M.dataset.focusKey="body",f){let re=Lm.get(f.id);re&&M.setSelectionRange(...re);let be=()=>Lm.set(f.id,[M.selectionStart,M.selectionEnd,M.selectionDirection]);M.addEventListener("select",be),M.addEventListener("keyup",be),M.addEventListener("pointerup",be)}let ee=()=>{M.style.height="auto",M.style.height=`${Math.min(128,Math.max(f?34:28,M.scrollHeight))}px`,M.style.overflowY=M.scrollHeight>128?"auto":"hidden",fi()};M.addEventListener("input",ee),M.addEventListener("input",()=>{f?di.set(f.id,M.value):Do=M.value}),M.addEventListener("keydown",re=>{re.key==="Enter"&&!re.shiftKey&&!re.isComposing&&(re.preventDefault(),k.requestSubmit())});let se=Oe(f?"Send reply":"Post comment",()=>{},"send","arrow");if(se.type="submit",se.disabled=Q,f)q.user&&k.append(yr(q.user)),k.append(M,se);else{let re=w("div","draft-body");q.user&&re.append(yr(q.user)),re.append(M,se),c&&re.append($A(_r,be=>_r=[..._r,be],be=>_r=_r.filter(je=>je!==be))),k.append(re)}M.addEventListener("input",()=>{se.disabled=Q||!M.value.trim()&&!P}),se.disabled||=!M.value.trim()&&!P,M.addEventListener("palette-sync-reply",()=>{if(!f||!M.isConnected||it.activeElement===M&&di.has(f.id))return;M.value=di.get(f.id)??"";let re=Lm.get(f.id);re&&M.setSelectionRange(...re),se.disabled=Q||!M.value.trim(),M.closest(".sidebar-replies")?.hidden||ee()});let ge=!f&&j&&!D0.has(j)&&_0(j);if(ge&&k.append(ku(3,{anchor:j,page:"",id:""},ge)),P){let re=w("div","draft-proposal");re.textContent=P;let be=j?L0(j):()=>null;Eu().then(({renderDraftProposal:je})=>{if(!re.isConnected||lr!==P)return;let We=j;return Promise.resolve(je(re,P,be,{design:e.design,sourceHref:ng,tip:Xm,onUpdate(lt){j===We&&lr&&(lr=lt)}})).then(fi)}),k.prepend(re)}return k.addEventListener("submit",re=>{if(re.preventDefault(),!(!M.value.trim()&&!P||Q)){if(!q.user){Au=()=>jA(f),ma();return}Ot(()=>jA(f))}}),requestAnimationFrame(()=>{M.isConnected&&ee()}),k}async function jA(f){if(e.onboarding)throw new Error("Open your connected website to leave a comment.");if(!q.user)throw new Error("Enter your name to leave a comment.");let k=Date.now(),M={id:`pending-${crypto.randomUUID()}`,body:f?di.get(f.id)??"":[Do.trim(),lr].filter(Boolean).join(`
3021
+ `)[0].slice(0,100),Do="",lr="",_r=[],da="",Ri=null,Su="",Tu,Au=null,R0=!1,N2=Ni(),Am=0,Mm=0,Cm=0,H0=0,di=new Map,Lm=new Map,st=w("div");st.dataset.branchComments=e.project,st.dataset.sidebar=R?"mobile":z?"edge":"background",Object.assign(st.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"2147483647",isolation:"isolate"});let it=st.attachShadow({mode:"open"}),j2={root:it,token:()=>q.token,origin:()=>new URL(e.endpoint).origin,dropped:D0,go:f=>{Hx(f)},notify:Dn,remove:f=>Ot(()=>ut(Ie(f.id,({snapshot:k,...M})=>M),async k=>{for(let M in f.snapshot)await q.request(`threads/${k(f.id)}/snapshot/${M}`,"DELETE")}))},P2=w("style");P2.textContent=xH;let ui=w("div","catch");ui.hidden=!0;let bt=w("div","pins"),zt=w("div"),Xe=w("div","toolbar"),he=w("div"),B2=w("div");he.tabIndex=-1,z&&he.classList.add("edge-sidebar");let Dr=w("div","edge-sidebar-sensor");Dr.hidden=!0,Object.assign(bt.style,{position:"fixed",inset:"0"});let Fn=w("div","pin-preview");Fn.hidden=!0;let _m=0,xc=!1,Dm=!1,Mu=null,vc=null,wc=null,z0="",Hi=(f=!1)=>{if(window.clearTimeout(_m),Fn.hidden||Dm&&!f)return;if(ol?.resetDesignPreviews(new Set([...$.find(M=>M.id===D&&Ce(M))?.comments.map(M=>M.id)??[],"draft"])),Dm=!0,vc?.cancel(),f||En()){Fn.hidden=!0,Mu=null;return}let k=Fn.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"translateY(3px) scale(.99)"}],{duration:150,easing:"cubic-bezier(.22,1,.36,1)",fill:"forwards"});vc=k,k.finished.then(()=>{vc===k&&(Fn.hidden=!0,Mu=null)}).catch(()=>{})};Fn.addEventListener("pointerenter",()=>{xc||Gt||sr||(Dm=!1,window.clearTimeout(_m),vc?.cancel())}),Fn.addEventListener("pointerleave",()=>Hi());let zi=w("div","component-hover");zi.setAttribute("aria-hidden","true");let Ko=null,Qa=null,Rm=0,Ja=w("div","sr-only");Ja.setAttribute("aria-live","polite");let V2=tH(Xe,f=>{if(f==="account"){if(!q.user)return yt("person");let k=yr(q.user);return k.classList.add("review-avatar"),k}return yt(f)});it.append(P2,ui,zi,bt,he,Dr,zt,Fn,B2,Xe,Ja),document.body.append(st);let U2=0,q2=0,K2=new MutationObserver(f=>{if(Date.now()-q2>1e3&&([U2,q2]=[0,Date.now()]),++U2<20)for(let k of f)st.removeAttribute(k.attributeName)});K2.observe(st,{attributeFilter:["aria-hidden","inert"]});let Un=document.documentElement;function O0(f,k){return Object.fromEntries(k.map(M=>[M,f.style[M]]))}let il=O0(y,["width","boxSizing","zoom","transformOrigin","transform","position","left","top","height","minHeight","paddingBottom","overflow","borderRadius","background","borderRight","borderBottom","clipPath"]),$N=Object.keys(il).map(f=>f.replace(/[A-Z]/g,k=>`-${k.toLowerCase()}`)),NN=Fu(y,$N),jN=O0(document.body,["overflow","background"]),PN=Fu(document.body,["overflow","background"]),BN=Fu(Un,["overflow","background"]),Hm=new Map,VN=Un.style.background,$0=EM(y,st,e.frame?.include,Fo),I2=kM(st),_n={left:0,top:0,width:0,height:0,logical:[0,0],pan:!1},N0=`palette:frame-size:${e.project}:${e.repo}`,Yn,G2=!1,cr=null,F2=e.frame?.mode==="iframe"&&e.frame.scale!==!0,ao,zm=!1,es=!1,ts=!1,Ec="",Y2=e.frame?.defaultMode==="transform";try{let f=JSON.parse(localStorage.getItem(N0)??"{}");Y2=f.v===2&&typeof f.inPlace=="boolean"?f.inPlace:e.frame?.defaultMode==="transform"}catch{}let X2=()=>F2&&!Ec&&(Yn?Yn.separate:!Y2),j0=!1,Cu=!1,UN,P0=()=>UN??=Promise.resolve().then(()=>(_z(),Lz));function qN(f=!Go){Cu||(Cu=!0,Yn?.status({active:!1,loading:!0}),P0().then(({enterShell:k})=>!W&&k(e.project,f,!!Pe?.edited,M=>{W||(Cu=!1,Ec=M,Yn?.status({active:!1,reason:M}),Om())})))}function Lu(f=""){if(Cu)return;Cu=!0;let k=location.href;try{let M=ao?.iframe.contentWindow?.location.href;M?.startsWith(location.origin)&&(k=M)}catch{}P0().then(({leaveShellPage:M})=>M(k,f))}let W2=()=>{P0().then(({syncShell:f})=>f(ao?.iframe.contentWindow,h))};function B0(){ao&&(ao.destroy(),ao=void 0,es=!1,Yn?.status({active:!1}),Z2())}function Z2(){let f=Pe?.selected;if(!f||f.ownerDocument===Xn())return;let k=ul(f,Xn());Pe.clearSelection(),k&&Pe.select(k)}let Om=()=>{Lc="",ji(),zc(),Fo()};function KN(){if(ao||zm)return;zm=!0,Yn?.status({active:!1,loading:!0});let f=Jt&&!ts?y.scrollTop:window.scrollY/pr();Promise.resolve().then(()=>(Oz(),zz)).then(({openFrameViewport:k})=>{if(zm=!1,W||!Jt||ao||!X2())return;let M=ao=k({parent:it,before:ui,url:IN(),background:rl,scroll:f,ready(){ao===M&&(es=!0,h&&W2(),Z2(),Yn?.status({active:!0}),Om())},failed(P){if(ao===M){if(h)return Lu(P);Ec=P,B0(),Yn?.status({active:!1,reason:P}),Om()}},changed(){h&&W2(),zc(),Fo()}});Om()})}function IN(){let f=new URL(e.frame?.iframeUrl?.(location)??location.href,location.href);if(h)for(let k of[Wx,Zx])f.searchParams.delete(k);return f.href}let _u=()=>(es&&ao?ao.port:y).getBoundingClientRect(),V0=f=>es?f.ownerDocument===Xn():y.contains(f),$m=()=>{let f=Xn();return f===document?y:v&&ul(y,f)||f.body};function Q2(){G2||(G2=!0,Promise.resolve().then(()=>(qz(),Uz)).then(({mountFrameSize:f})=>{W||(Yn=f(it,()=>es&&ao?ao.port:y,N0,k=>{if(k){Ec="";try{zo(sessionStorage,SM)}catch{}}Lc="",ji(),Fo()},IS,F2&&(e.frame?.defaultMode==="transform"?"transform":"iframe"),{pan:GN,onFrame:so,shortcuts:o,textEntry:br,shell:x,anchor(){let k=$.find(ee=>ee.id===D),M=j??(k&&Ce(k)?k.anchor:null),P=M&&ga(M);return P&&P.attached?{x:P.x/pr(),y:P.y/pr()}:null}}),Yn.status(es?{active:!0}:Ec?{active:!1,reason:Ec}:{active:!1,loading:!!ao||zm}),Yn.sized?(Lc="",ji()):Yn.update(cr,pr()))}))}try{localStorage.getItem(N0)&&Q2()}catch{}let Nm=0,U0=!1,J2=()=>{U0=!0,document.dispatchEvent(new Event("scroll",{bubbles:!0})),U0=!1};function GN(){Nm||(Nm=requestAnimationFrame(FN),J2())}function FN(){if(Nm=0,!Jt||!cr||!Yn||W||ts)return;let f=pr(),k=Yn.view({left:cr.left/f,top:cr.top/f,width:cr.width/f,height:cr.height/f},[window.innerWidth/f,window.innerHeight/f]);_n.left=k.left,_n.top=k.top,y.style.left=`${k.left}px`,y.style.top=`${k.top}px`,Rr(),Yn.update(cr,f),mr(!0),fi(),pa(),dl(),J2()}function Rr(){let f=pr(),k=_n.left,M=_n.top,{width:P,height:ee}=_n,ae=Jt&&!W&&!ts,ge=ae&&e.frame?.scale!==!0;ge&&I2.update(_n.logical),$0.update(ae?{scale:Ro,left:k,top:M,zoom:f,bounds:{left:k,top:M,right:k+P,bottom:M+ee,width:P,height:ee}}:null),ge||I2.update(null)}function eA(){let f=Jt||dr,k=[document.body.style.background,Un.style.background];f&&(document.body.style.background=jN.background,Un.style.background=VN);let M=[document.body,Un].map(P=>getComputedStyle(P).backgroundColor).find(P=>P!=="rgba(0, 0, 0, 0)")??"#fff";return f&&([document.body.style.background,Un.style.background]=k,K0.takeRecords()),M}let q0=0,K0=new MutationObserver(()=>{q0||=requestAnimationFrame(()=>{q0=0,rl=eA(),tA(),(Jt||dr)&&(y.style.background=rl)})});function tA(){let[f,k,M]=/^rgb/.test(rl)?rl.match(/[\d.]+/g).map(Number):[255,255,255];bt.dataset.page=.2126*f+.7152*k+.0722*M<128?"dark":"light"}let Jt=!1,dr=!1,rl=eA();tA();for(let f of[Un,document.body])K0.observe(f,{attributes:!0});let Io=0,Oi;function nA(){let f=Number(getComputedStyle(y).opacity);return y.animate([{opacity:f*.94},{opacity:f}],{duration:250,easing:"cubic-bezier(0.22, 1, 0.36, 1)"})}let Go=!1,oA=rH(`palette:open:${e.project}:${e.repo}`,e.restoreOpen),I0=`palette:toolbar-dismissed:${e.project}:${e.repo}`;try{sessionStorage.getItem(I0)==="1"&&(te=!0,G=!0)}catch{}let G0=`palette:comments-hidden:${e.project}:${e.repo}`,go=!1,jm=!1,F0=0;try{go=!e.onboarding&&sessionStorage.getItem(G0)==="1"}catch{}let kc=!1,ns,Y0=[],Sc=0,$i=!1,iA=null,Tc,Pm;function Bm(f){!Xe.offsetWidth||!Xe.offsetHeight||(vn=Pa(f,Xe.offsetWidth,Xe.offsetHeight,Un.clientWidth,window.innerHeight),Xe.style.left=`${vn.x+Xe.offsetWidth/2}px`,vn.edgeY==="bottom"&&!R?(Xe.style.top="auto",Xe.style.bottom="calc(16px + env(safe-area-inset-bottom,0px))"):(Xe.style.top=`${vn.y}px`,Xe.style.bottom="auto"))}function rA(f){if(he.dataset.dragging==="true"){Je=f,he.style.left=`${f.x}px`,he.style.top=`${f.y}px`;return}he.offsetWidth&&(Je=Pa(f,he.offsetWidth,he.offsetHeight,Un.clientWidth,window.innerHeight),ua())}function aA(){he.style.width=`${dt}px`,he.style.height=Bn==null?"":`${Bn}px`,wx()}function sA(){He=Je;try{localStorage.setItem(Me,JSON.stringify({...He,width:dt,height:Bn}))}catch{}}function lA(){let f=Un.clientWidth,k=window.innerHeight;dt=Math.min(Math.max(dt,rf),Math.max(rf,f-2*Ji)),Bn!=null&&(Bn=Math.min(Math.max(Bn,af),Math.max(af,Math.min(k-2*Ji,Jh)))),aA()}function ua(){if(R||!z)return;lA();let f=he.offsetHeight||Math.min(window.innerHeight-2*Ji,Jh),k=v6(Je,dt,f,Un.clientWidth,window.innerHeight),M=w6(k,Un.clientWidth);he.style.left=`${k.x}px`,he.style.top=`${k.y}px`,he.style.setProperty("--edge-account-max-height",`${Math.max(0,window.innerHeight-k.y-28)}px`),he.style.right="auto",he.style.bottom="auto",he.style.transformOrigin=k.side==="left"?"left center":"right center",he.style.setProperty("--edge-park-x",`${M.parked}px`),he.style.setProperty("--edge-peek-x",`${M.peek}px`),Dr.style.left=k.side==="left"?"0px":"",Dr.style.right=k.side==="right"?"0px":"",C?(delete he.dataset.collapsed,delete he.dataset.peek,Dr.hidden=!0):(he.dataset.collapsed="true",cn?he.dataset.peek="true":delete he.dataset.peek,Dr.hidden=!1)}function X0(){st.dataset.sidebar=R?"mobile":z?"edge":"background",he.classList.toggle("edge-sidebar",z),he.style.transition="none",he.style.translate="",he.style.opacity="",zu(!0),z?Hr.isConnected||he.prepend(Hr):(Hr.remove(),delete he.dataset.collapsed,delete he.dataset.peek,Dr.hidden=!0),he.offsetWidth,he.style.transition=""}let al=[],W0=!1;function Du(){for(let f of al)f.cancel();al=[],dr=!1,bt.style.opacity=""}function Z0(f,k){if(R||f===b||W||!v&&f==="background")return;let M=()=>[y,he.querySelector(".panel"),Xe,zt.querySelector(".account-dialog")],P=M().map(ae=>ae?.getBoundingClientRect());if(Du(),Oi?.cancel(),Oi=void 0,ns?.stop(),ns=void 0,zu(!0),Im(),_c(),Xe.style.translate="",Tc=void 0,W0=!0,b=f,z=f==="edge",!k){F=!1,e={...e,sidebar:f};try{localStorage.setItem(m,f)}catch{}}if(X0(),ji(),$t(),W0=!1,En())return;M().forEach((ae,ge)=>{let re=P[ge];if(!ae?.isConnected||!re?.width)return;if(ae===y&&e.frame?.scale!==!0){al.push(nA());return}ae!==y&&ae.getAnimations().forEach(lt=>lt.cancel());let be=ae.getBoundingClientRect();if(!be.width)return;let je=be.width/ae.offsetWidth,We=getComputedStyle(ae).transform;al.push(ae.animate([{transform:`${We==="none"?"":We} translate(${(re.left-be.left)/je}px, ${(re.top-be.top)/je}px) scale(${re.width/be.width})`,transformOrigin:"top left"},{transform:We,transformOrigin:"top left"}],{duration:250,easing:"cubic-bezier(0.22, 1, 0.36, 1)"}))});let ee=al;dr=!0,bt.style.opacity="0",Promise.all(ee.map(ae=>ae.finished)).then(()=>{W||ee!==al||(al=[],dr=!1,bt.style.opacity="",Rr(),$0.reposition(),Fo())}).catch(()=>{})}function Q0(f,k,M,P,ee){let ae=w("div","account-setting"),ge=w("span","account-setting-label",k),re=ec(k,M,P,be=>ee(be));return re.querySelector("summary").dataset.focusKey=`setting-${f}`,ae.append(ge,re),ae}function YN(){return R?Q0("sidebar","Sidebar",[["mobile","Floating sidebar"]],"mobile",()=>{}):v?Q0("sidebar","Sidebar",[["edge","Floating"],["background","Frame"]],b,Z0):w("p","muted","Floating sidebar \xB7 Set pageRoot for Frame.")}function XN(){let f=Q0("channel","Comments",[["local","Local development"],["shared","Site comments"]],ue,WN);return f.append(w("p","muted","Separate channels, both saved to this project.")),f}function WN(f){if(!(f===ue||W)){if(Q||Le.busy){Dn("Wait for your changes to save.");return}ue=f;try{localStorage.setItem(oe,f)}catch{}e={...e,branch:f==="local"?"local":V},q.cancelReads(),q=new tc(e),Z=et=!1,Ru=void 0,ce="",_e=null,Re="Connecting",ht=Ze=Et=Pn=Ve=ir=!1,D=null,j=null,_o=null,sl(),$t(),qm()}}function sl(){ye(),we++,Z=!1,ce="",D=null,Ru=void 0;let f=q.cached();se=f!==null,Le.reset(ix(f??[]))}let Hr=w("div","edge-sidebar-grip");Hr.setAttribute("aria-hidden","true");let cA=f=>Zh(he,f,rA,Y.signal,()=>{B=!1,le=!0,ur.show()},()=>{sA(),ur.update()},()=>C&&z&&!$i);cA(Hr),he.prepend(Hr);let ZN=["n","s","e","w","ne","nw","se","sw"];for(let f of ZN){let k=w("div",`edge-sidebar-resize edge-sidebar-resize-${f}`);k.addEventListener("pointerdown",M=>{if(M.button!==0||!C||!z||$i)return;M.preventDefault(),M.stopPropagation();for(let be of he.getAnimations())be.cancel();he.style.transition="none";let P=he.getBoundingClientRect(),ee=M.clientX,ae=M.clientY,ge=be=>{if(be.pointerId!==M.pointerId)return;let je=x6(f,P,be.clientX-ee,be.clientY-ae,Un.clientWidth,window.innerHeight);dt=je.width,(f.includes("n")||f.includes("s"))&&(Bn=je.height),Je={x:je.left,y:je.top},he.style.left=`${je.left}px`,he.style.top=`${je.top}px`,aA()},re=be=>{be.pointerId===M.pointerId&&(window.removeEventListener("pointermove",ge,!0),window.removeEventListener("pointerup",re,!0),window.removeEventListener("pointercancel",re,!0),he.style.transition="",sA(),ua())};window.addEventListener("pointermove",ge,{capture:!0,passive:!1}),window.addEventListener("pointerup",re,!0),window.addEventListener("pointercancel",re,!0)},{signal:Y.signal}),he.append(k)}for(let f of["left","right","top","bottom"])he.append(w("div",`edge-sidebar-snap edge-sidebar-snap-${f}`));let Vm=f=>{cn=f,!C&&z&&!$i&&ua()};Dr.addEventListener("pointerenter",()=>Vm(!0)),Dr.addEventListener("pointerleave",()=>Vm(!1)),Dr.addEventListener("pointerup",f=>{f.button===0&&!C&&wn(!0)}),he.addEventListener("pointerenter",()=>Vm(!0)),he.addEventListener("pointerleave",()=>Vm(!1)),window.addEventListener("resize",()=>{W||!z||$i||(lA(),ua())},{signal:Y.signal,passive:!0}),X0();let ur=f6(Xe,()=>C||U||L||!!j||!!D,Y.signal,e.autoHideDrawer);Zh(Xe,Xe,Bm,Y.signal,()=>{ur.show(),ns?.stop(),Xe.style.translate="0px 0px"},()=>{N=vn;try{localStorage.setItem(Tm,JSON.stringify(N))}catch{}Ho(),ur.update()},()=>!C,f=>!!f.closest(".morphing-menu__shortcut"));let J0=new ResizeObserver(()=>{Xe.dataset.edgeTabs!=="true"&&(vn?Bm(vn):e.drawerContainer&&Ho())});J0.observe(Xe),e.drawerContainer&&J0.observe(e.drawerContainer);let pr=()=>Un.currentCSSZoom??1;function Ni(){let f=as()?.contentWindow?.location??location;return nH(e.page?.(f)??f.pathname)}let dA=new WeakMap,ll=null,ex=0,tx=new WeakMap;function uA(){cancelAnimationFrame(ex),!(W||!it.querySelector(".floating-notice"))&&(pa(),ex=requestAnimationFrame(uA))}function nx(f=j??$.find(k=>k.id===D)?.anchor){let k=zt.firstElementChild?.getBoundingClientRect();if(!k||L)return;let M=f?ga(f):null;return{cardKey:Ln,left:k.left,top:k.top,anchor:f,offsetX:k.left-(M?.x??0),offsetY:k.top-(M?.y??0),scrollX:window.scrollX,scrollY:window.scrollY}}function Um(f){if(f.dataset.closing)return;if(f.dataset.closing="true",f.inert=!0,f.setAttribute("aria-hidden","true"),ll===f&&(ll=null,clearTimeout(Am)),En()){f.remove();return}f.animate([{opacity:getComputedStyle(f).opacity,translate:"0px 0px",scale:1},{opacity:0,translate:f.dataset.attached==="true"?`0px ${(f.dataset.placement==="above"?1:-1)*(f.offsetHeight/2+10)}px`:"0px 3px",scale:f.dataset.attached==="true"?.94:.99}],{duration:150,easing:"cubic-bezier(.22,1,.36,1)",fill:"forwards"}).finished.catch(()=>{}).finally(()=>f.remove())}function Dn(f,k,M=nx()){Ja.textContent=f,ll&&Um(ll);let P=w("div","toast floating-notice");ll=P,M&&dA.set(P,M),P.setAttribute("role",k?"alertdialog":"status"),P.setAttribute("aria-label",f),P.append(yt("info"),w("span","",f)),k&&P.append(Oe(k.label,()=>{Um(P),k.run()},"notice-action")),P.append(Oe("Dismiss notice",()=>Um(P),"icon","close")),it.append(P),pa(),uA(),En()||P.animate([{opacity:0,translate:P.dataset.attached==="true"?`0px ${(P.dataset.placement==="above"?1:-1)*(P.offsetHeight/2+10)}px`:"0px 6px",scale:P.dataset.attached==="true"?.94:.97},{opacity:1,translate:"0px 0px",scale:1}],{duration:250,easing:"cubic-bezier(.22,1,.36,1)"}),clearTimeout(Am),Am=window.setTimeout(()=>Um(P),5e3)}function pa(){for(let f of it.querySelectorAll(".floating-notice")){let k=dA.get(f);if(!k)continue;let M=k.anchor?ga(k.anchor):null,ee=(!L&&Ln===k.cardKey?zt.firstElementChild:null)?.getBoundingClientRect();ee&&(f.style.maxWidth=`${Math.min(360,ee.width,innerWidth-24)}px`,k.left=ee.left,k.top=ee.top,k.offsetX=ee.left-(M?.x??0),k.offsetY=ee.top-(M?.y??0),k.scrollX=window.scrollX,k.scrollY=window.scrollY);let ae=ee?ee.left+(ee.width-f.offsetWidth)/2:M?M.x+k.offsetX:k.left+k.scrollX-window.scrollX,ge=!!ee&&ee.bottom+10+f.offsetHeight>innerHeight-12;f.dataset.placement=ge?"above":"below";let re=ee?ge?ee.top-f.offsetHeight-10:ee.bottom+10:M?M.y+k.offsetY:k.top+k.scrollY-window.scrollY,be=String(!!ee),je=f.dataset.attached!==void 0&&f.dataset.attached!==be,We=je?f.getBoundingClientRect():null,lt=tx.get(f);if(lt&&(je||Math.abs(lt.left-ae)>.5||Math.abs(lt.top-re)>.5)&&(lt.animation.cancel(),tx.delete(f)),f.dataset.attached=be,Object.assign(f.style,{left:`${ae}px`,top:`${re}px`,bottom:"auto",transform:"none",transformOrigin:ee?ge?"50% 100%":"50% 0%":"0% 0%"}),We&&!f.dataset.closing&&!En()){let tt=f.animate([{left:`${We.left}px`,top:`${We.top}px`},{left:`${ae}px`,top:`${re}px`}],{duration:250,easing:"cubic-bezier(.22,1,.36,1)"});tx.set(f,{animation:tt,left:ae,top:re})}}}function pA(f){W||f instanceof DOMException&&f.name==="AbortError"||(Fe=f instanceof Error?f.message:"Something went wrong. Try again.",Dn(Fe))}function Ot(f){f().catch(pA)}function ox(f,k){return k.then(M=>{f.isConnected&&f.replaceWith(M)}).catch(pA),f}let fA=()=>L&&ir&&!e.onboarding&&!!q.user?.verified&&q.user.id.startsWith("google:");function mA(){ci?.dispose(),ci=rr=Di=void 0}function QN(){Di=q,gr(),zt.querySelector(".account-dialog").scrollTop=0}function JN(){if(ci)return ci;let f=q;return rr??=Promise.resolve().then(()=>(Fz(),Gz)).then(({accountTokens:k})=>Di!==f?w("div"):(ci=k(f,e.project,()=>{mA(),gr(),zt.querySelector('[data-focus-key="account-tokens"]')?.focus()}),ci.focusStart(),ci),k=>{throw rr=Di=void 0,gr(),k}),ox(w("p","account account-usage-status","Loading API tokens\u2026"),rr)}function gA(f){return ox(w("section","account-usage"),Promise.resolve().then(()=>(e0(),Jy)).then(({accountUsage:k})=>k(q,f,!0,J&&ue==="local")))}function qm(){Ot(et?fr:Iu)}async function ej(f){if(!Q){Q=!0,Fe="",gr();try{for(await f();Z&&!W;)await new Promise(k=>setTimeout(k,20));await fr()}finally{Q=!1,$t()}}}let ix=f=>f.map(k=>({...k,comments:k.comments.filter(M=>M.body!=="[Comment deleted]")})).filter(k=>k.comments.length>0),zr,Ru,hA=-1;async function fr(){if(W||Z||Le.busy||e.onboarding)return;let f=Le.revision,k=q,M=k.token,P=we;Z=!0;try{let ee=await k.list();if(W||k!==q||P!==we||M!==k.token||Le.busy||f!==Le.revision)return;if(ee===Ru&&f===hA&&Re==="Live")return!1;Ru=ee,hA=f,se=!0;let ae=ix(ee),ge=JSON.stringify(ae)!==JSON.stringify($),re=Re!=="Live";return ce="",et&&(_e=null),Re=_e?"Offline":"Live",D&&!ae.some(be=>be.id===D)&&(D=null),ge?Le.replace(ae,f):re&&(pi(),Ho()),ge}catch(ee){if(W||k!==q||P!==we||ee instanceof DOMException&&ee.name==="AbortError")return;throw M!==k.token&&sl(),ee instanceof to&&(ee.status===401||ee.status===403)&&ee.code!=="site_not_approved"&&(ce=ee.message,D=null,Ru=void 0,Le.replace([],f)),_e=ce?null:JS(ee),Re="Offline",pi(),Ho(),ee}finally{k===q&&P===we&&(Z=!1)}}function Ac(){!ie&&B&&(B=!1,Je=He,ua()),!(F===ie||ie&&(!v||R||b!=="edge"))&&(F=ie,R?b="edge":Z0(ie?"background":"edge",!0))}let Km=()=>C&&!z&&!R&&!F;function Mc(f){if(ye(),$r(),e.onboarding)return;ie&&(ie=!1,Pe?.setActive(!1),Ac()),I=f,f&&Ou(),C&&!Km()&&wn(!1);let k=f?_o??ar.shift():null;if(k){j=k.anchor,Do=k.text,_o=null,D=null,L=!1,U=!1,$t(),zt.querySelector("textarea")?.focus();return}U=f,zr?.wake(!1),G=!1,L=!1,f&&(D=null,j=null),$t()}function bA(){pe&&(pe=!1,wn(Te??!0),Te=null,requestAnimationFrame(()=>{let f=he.querySelector(".list");f&&(f.scrollTop=xe),(it.querySelector('.dialog [aria-label="Comment actions"]')??it.querySelector('[data-menu-item="design"]'))?.focus({preventScroll:!0})}))}function Cc(f){e.onboarding||j||f&&!a||(f&&(Te=null,D||Pe?.setReturnAction(null),pe=!0,C&&(xe=he.querySelector(".list")?.scrollTop??0),Mc(!1),ie=!0,le=!1,Ac(),C||wn(!0),L=!1,he.querySelector(".panel")?.contains(it.activeElement)&&he.focus({preventScroll:!0})),ie=f,f?UA().then(k=>k?.setActive(ie)):(Pe?.setActive(!1),Ac(),bA()),$t())}let rx=0;function tj(){let f=Mr(window.innerWidth,window.innerHeight);f!==R&&(it.append(he),Du(),zu(!0),Im(),_c(),R=f,f||(Xe.style.translate="",vn||(Xe.style.bottom="")),z=!f&&b==="edge",he.removeAttribute("style"),X0(),Lc="",$t())}let Ro=1,Lc="",yA=()=>(window.visualViewport?.offsetTop??0)+Math.min(window.innerHeight,window.visualViewport?.height??window.innerHeight)-window.innerHeight;function nj(){let f=Math.max(1,Math.min(window.innerHeight,window.visualViewport?.height??window.innerHeight)*.9),k=yA(),M=cx().getBoundingClientRect();st.style.setProperty("--mobile-pill-x",`${M.left+M.width/2-window.innerWidth/2}px`),st.style.setProperty("--mobile-pill-y",`${M.bottom-(window.innerHeight+k-6)}px`),st.style.setProperty("--mobile-pill-scale-x",String(Math.max(.01,M.width/Math.max(1,window.innerWidth-24)))),st.style.setProperty("--mobile-pill-scale-y",String(Math.max(.01,M.height/f)))}function Hu(){for(let f of Hm.values())f();Hm.clear(),NN(),PN(),BN()}function ji(){let f=pr(),k=Mr(window.innerWidth,window.innerHeight)?Math.min(window.innerHeight,window.visualViewport?.height??window.innerHeight):window.innerHeight,M=`${window.innerWidth}:${window.innerHeight}:${k}:${f}:${C}:${L}:${b}:${ie}:${window.visualViewport?.offsetTop??0}`;if(Lc===M)return;if(R||Du(),Lc=M,st.style.zoom=String(1/f),st.style.width=`${window.innerWidth}px`,bt.style.opacity="",z||R){if(h&&j0)return Lu();Oi?.cancel(),dr=!1;let me=Jt?y.scrollTop*f:null;if(Jt&&(Hu(),Ro=1),me!==null&&window.scrollTo({top:me,behavior:"instant"}),st.style.height=R?`${window.innerHeight}px`:"",st.style.top=R?"":"0px",R){let ne=yA();Xe.style.translate=`0 ${ne}px`,st.style.setProperty("--mobile-panel-height",`${Math.max(1,k*.9)}px`),st.style.setProperty("--mobile-panel-bottom",`${-ne}px`)}st.classList.toggle("review-open",C),Jt=!1,Rr(),Yn?.update(null),bt.style.clipPath="",Object.assign(ui.style,{left:"",top:"",width:"",height:""});return}let P=Jt&&!ts?y.scrollTop:window.scrollY/(f*Ro),ee=Jt,ae=Jt?y.getBoundingClientRect():{left:0,top:0,width:window.innerWidth};Oi?.cancel(),dr=!1;let ge=KS(window.innerWidth,k,C,window.innerHeight,L,!0,e.frame?.scale===!0),re=ge.framed,be=e.frame?.scale===!0,je={left:ge.left,top:ge.top,width:ge.visibleWidth,height:ge.height},We={left:je.left/f,top:je.top/f,width:je.width/f,height:je.height/f},lt=[window.innerWidth/f,window.innerHeight/f],tt=be?{...We,scale:1,pan:!1}:Yn?.view(We,lt)??IS(We,lt,!1);if(re&&!be&&X2())x&&!h?qN():KN();else{if(h&&j0)return Lu();ao&&B0()}let en=re&&!be&&es,Bt=re&&!be&&tt.pan&&!en;if(cr=re&&!be?je:null,st.style.setProperty("--review-viewport-height",`${k}px`),st.style.height=`${k}px`,st.style.top="",st.classList.toggle("review-open",C),st.classList.toggle("design-active",ie),en&&ao)ee&&!ts&&(Hu(),window.scrollTo({left:_n.pan?0:window.scrollX,top:P*f,behavior:"instant"})),Un.style.overflow="hidden",Ro=1,_n={left:tt.left,top:tt.top,width:Math.min(We.width,tt.width*tt.scale),height:Math.min(We.height,tt.height*tt.scale),logical:[tt.width,tt.height],pan:!1},ao.place({left:_n.left*f,top:_n.top*f,width:_n.width*f,height:_n.height*f,logical:_n.logical,scale:tt.scale,pan:tt.pan});else if(re){Ro=be?ge.scale:tt.scale;let me=Ro*f;_n=be?{left:ge.left/f,top:ge.top/f,width:window.innerWidth/f*Ro,height:ge.height/f,logical:[window.innerWidth/f,ge.height/me],pan:!1}:{left:tt.left,top:tt.top,width:tt.width*tt.scale,height:tt.height*tt.scale,logical:[tt.width,tt.height],pan:Bt},Object.assign(y.style,{position:"fixed",transform:Ro!==1?`scale(${Ro})`:il.transform,transformOrigin:"top left",left:`${_n.left}px`,top:`${_n.top}px`,width:`${be?window.innerWidth/f:tt.width}px`,boxSizing:"border-box",height:`${be?ge.height/me:tt.height}px`,paddingBottom:il.paddingBottom,zoom:il.zoom,overflow:be?"hidden auto":"auto",borderRadius:`${12/me}px`,background:rl,borderRight:il.borderRight,borderBottom:il.borderBottom,clipPath:il.clipPath});for(let ne of y.querySelectorAll("header"))!Hm.has(ne)&&getComputedStyle(ne).position==="fixed"&&(Hm.set(ne,Fu(ne,["position","margin-bottom"])),ne.style.position="sticky",ne.style.marginBottom=`-${ne.offsetHeight}px`);Un.style.overflow="hidden",document.body.style.overflow="hidden",Un.style.background=document.body.style.background="#080808",y.scrollTop=P}else Hu(),Jt&&!ts&&window.scrollTo({left:window.scrollX,top:P*f,behavior:"instant"}),Ro=1,_n.pan=!1;if(ts=en,Jt=re,Rr(),cr&&Q2(),Yn?.update(cr,f),!re&&e.drawerContainer?.isConnected){let me=e.drawerContainer.getBoundingClientRect();Pm=me.width?me.left+me.width/2:void 0}if(re!==ee&&!W0&&!Go&&!En()){if(bt.style.opacity="0",dr=!0,e.frame?.scale===!0){let ne=re?y.getBoundingClientRect():{left:0,top:0,width:window.innerWidth},Ee=`translate(${(ae.left-ne.left)/f}px, ${(ae.top-ne.top)/f}px) scale(${Ro*ae.width/ne.width})`;if(y.style.transformOrigin=re?"top left":`0 ${P}px`,!re){Un.style.background=document.body.style.background="#080808",y.style.background=rl;let ze=getComputedStyle(y).minHeight;y.style.minHeight=`max(${ze==="auto"?"0px":ze}, ${window.innerHeight/f}px)`}Oi=y.animate([{transform:Ee},{transform:`translate(0px, 0px) scale(${Ro})`}],{duration:250,easing:"cubic-bezier(0.32, 0.72, 0, 1)"})}else Oi=nA();let me=Oi;me.finished.then(()=>{W||Oi!==me||(me.cancel(),Oi=void 0,dr=!1,Jt||Hu(),bt.style.opacity="",Rr(),$0.reposition(),Fo())}).catch(()=>{})}let Ke=(me,ne,Ee,ze)=>{let Be=Math.max(me,Ee);return[Be,Math.max(0,Math.min(me+ne,Ee+ze)-Be)]},[an,nt]=Ke(_n.left*f,_n.width*f,je.left,je.width),[qe,Se]=Ke(_n.top*f,_n.height*f,je.top,je.height),Ue=be?{left:ge.visibleLeft,top:ge.visibleTop,width:ge.visibleWidth,height:ge.visibleHeight}:{left:an,top:qe,width:nt,height:Se};bt.style.clipPath=re?`inset(${Ue.top}px ${window.innerWidth-Ue.left-Ue.width}px ${k-Ue.top-Ue.height}px ${Ue.left}px)`:"",Object.assign(ui.style,re?{left:`${Ue.left}px`,top:`${Ue.top}px`,width:`${Ue.width}px`,height:`${Ue.height}px`}:{left:"",top:"",width:"",height:""})}let ax;function sx(){Xe.dataset.edgeTabs!=="true"&&(ax=O0(Xe,["left","top","bottom","transform"])),Object.assign(Xe.style,{left:"",top:"",bottom:"",transform:""}),Xe.parentElement!==he&&he.append(Xe),Xe.dataset.edgeTabs="true",C?Xe.dataset.edgeOrient="horizontal":delete Xe.dataset.edgeOrient}function _c(){Xe.dataset.edgeTabs==="true"&&(Object.assign(Xe.style,ax),ax=void 0),delete Xe.dataset.edgeTabs,delete Xe.dataset.edgeOrient,Xe.parentElement===he&&Ja.before(Xe)}function lx(){return D&&!L&&!j&&C&&!R&&!ie&&!e.onboarding?he.querySelector(".panel"):null}function oj(f){let k=f??(z&&L?he:it);zt.parentNode!==k&&(k===it?Fn.before(zt):k.append(zt)),zt.classList.toggle("thread-pane",!!f),he.querySelector(".panel")?.toggleAttribute("data-thread",!!f)}function cx(){return Xe.querySelector(".morphing-menu__shell")??Xe}function dx(){return Xe.querySelector(".morphing-menu")}function ij(){return Xe.querySelector(".morphing-menu__bar")}function ux(){return[...he.querySelectorAll(".panel-head, .panel .empty, .thread-card")]}function cl(f){return Y0.push(f),f}function Im(){for(let f of ux())Object.assign(f.style,{opacity:"",transform:"",filter:""});Hr.style.opacity=""}function Gm(f,k){for(let M of he.getAnimations())M.cancel();Object.assign(he.style,{transition:"none",transform:"none",translate:"none",opacity:"1",left:`${f.left}px`,top:`${f.top}px`,width:`${f.width}px`,height:`${f.height}px`,borderRadius:k})}function xA(){Object.assign(he.style,{width:"",height:"",borderRadius:"",transform:"",opacity:""}),z&&ua(),he.offsetWidth,he.style.transition=""}function vA(f=dx()){delete he.dataset.morphing,delete Xe.dataset.edgeSurface,delete Xe.dataset.edgeMorph,delete Xe.dataset.hidden,f&&(f.style.transition="")}function zu(f=!1){Sc+=1;for(let M of Y0)M.stop();Y0=[];let k=$i;$i=!1,f&&he.toggleAttribute("data-tips-ready",C),!(!f||!k)&&(vA(),_c(),Im(),xA())}function rj(f,k,M){let P=he.getBoundingClientRect(),ee=f?null:{left:P.left,top:P.top,width:P.width,height:P.height,radius:he.style.borderRadius||"16px"};zu(!1),ee&&Gm(ee,ee.radius);let ae=Sc;$i=!0;let ge=dx();ge&&(ge.style.transition="none");let re=ij(),be=cx(),je=!1,We=()=>{je||ae!==Sc||W||(je=!0,$i=!1,vA(ge),f||(Im(),he.style.opacity="0",_c()),xA(),f&&(he.dataset.tipsReady=""))},lt=Go||En();if(f){let nt=k?he.getBoundingClientRect():null,qe=he.style.borderRadius||"16px";he.style.transition="none",he.style.width="",he.style.height="",he.style.borderRadius="",he.style.transform="none";let Se=be.getBoundingClientRect(),Ue=!k&&M&&M.width>0?M:Se;!k&&Ue.width>0&&(iA={left:Ue.left,top:Ue.top,width:Ue.width,height:Ue.height}),sx(),delete he.dataset.morphing,ua();let me=he.getBoundingClientRect();if(he.dataset.morphing="true",lt||Ue.width<=0||me.width<=0||k&&!nt){We();return}let ne=`${Ue.height/2}px`;k&&nt?Gm(nt,qe):Gm(Ue,ne),ux().forEach((xt,Kt)=>{xt.style.opacity="0",xt.style.transform="translateY(48px)",xt.style.filter="blur(4px)",cl(Qr(xt,{opacity:1,y:0,filter:"blur(0px)"},{...DE,delay:HE+Kt*E6}))}),Hr.style.opacity="0",cl(Qr(Hr,{opacity:1},{...DE,delay:HE}));let Ee=()=>{if(ae!==Sc||W)return;delete he.dataset.morphing;let xt=he.getBoundingClientRect();cl(Qr(he,{left:[`${xt.left}px`,`${me.left}px`],top:[`${xt.top}px`,`${me.top}px`],width:[`${xt.width}px`,`${me.width}px`],height:[`${xt.height}px`,`${me.height}px`],borderRadius:[he.style.borderRadius||"16px","16px"]},Ol)).finished.then(We).catch(()=>{ae===Sc&&We()})};if(k||Ue.height>Ue.width+8){Ee();return}let ze=k6(re?.offsetWidth||Ue.width,re?.offsetHeight||Ue.height),Be=S6(Ue.left+Ue.width/2,Ue.top+Ue.height,ze.width,ze.height),Qe=he.getBoundingClientRect();cl(Qr(he,{left:[`${Qe.left}px`,`${Be.left}px`],top:[`${Qe.top}px`,`${Be.top}px`],width:[`${Qe.width}px`,`${Be.width}px`],height:[`${Qe.height}px`,`${Be.height}px`]},eb)).finished.then(Ee).catch(()=>{});return}let tt=ee??he.getBoundingClientRect(),en=ee?.radius||he.style.borderRadius||"16px";delete Xe.dataset.hidden,he.dataset.morphing="true",sx();let Bt=Xe.getBoundingClientRect(),Ke=iA??{left:(window.innerWidth-(Bt.width||228))/2,top:window.innerHeight-24-(Bt.height||52),width:Bt.width||228,height:Bt.height||52};if(lt||Ke.width<=0||tt.width<=0){We();return}Gm(tt,en);for(let nt of ux())cl(Qr(nt,{opacity:0,y:16,filter:"blur(2px)"},RE));cl(Qr(Hr,{opacity:0},RE)),cl(Qr(he,{left:[`${tt.left}px`,`${Ke.left}px`],top:[`${tt.top}px`,`${Ke.top}px`],width:[`${tt.width}px`,`${Ke.width}px`],height:[`${tt.height}px`,`${Ke.height}px`],borderRadius:[en,`${Ke.height/2}px`]},tb)).finished.then(We).catch(()=>{ae===Sc&&We()})}function wn(f,k=!1){!f&&X&&!X.opened&&ye(),f!==C&&$r(),f&&Ou(),Du();let M=f&&!C;if(C=f,Go||zr?.wake(M),delete he.dataset.tipsReady,he.toggleAttribute("data-tips-restored",Go),!e.onboarding&&!k&&oA.set(f),f&&(U=!1),f||(clearTimeout(Io),Io=0,L=!1,Vu=Uu="",qu()),R){cancelAnimationFrame(rx),nj(),M&&!Go&&!En()?st.dataset.mobileEntering="":delete st.dataset.mobileEntering,G=!1,ji(),$t(),ur.show(),ur.update(),st.dataset.mobileEntering!==void 0&&(rx=requestAnimationFrame(()=>{delete st.dataset.mobileEntering}));return}if(z){let ae=$i,ge=f?cx().getBoundingClientRect():null;f||delete Xe.dataset.edgeOrient,vn=f?vn:N,Tc=void 0,G=!1,$i=!0;let re=dx();re&&(re.style.transition="none"),ur.show(),ji(),$t(),rj(f,ae,ge),ur.update();return}let P=Xe.getBoundingClientRect();vn=f?void 0:N,Tc=void 0,G=!1,ji(),$t(),ns?.stop(),Xe.style.translate="0px 0px";let ee=Xe.getBoundingClientRect();!Go&&!En()&&(ns=Qr(Xe,{translate:[`${P.left-ee.left}px ${P.top-ee.top}px`,"0px 0px"]},{type:"spring",stiffness:680,damping:32,mass:.55})),ur.show(),ur.update()}function Or(){if(ye(),$r(),I=!1,clearTimeout(Io),Io=0,L){Ot(Qt),Au=null,L=!1,$t();return}D=null,j=null,L=!1,Ri=null,Fe="",U=!1,$t()}function aj(){pe=!1,ie=!1,Pe?.setActive(!1),Ac(),Or(),C&&wn(!1),U=!1,I=!1,G=!0,te=!0;try{sessionStorage.setItem(I0,"1")}catch{}$t()}function Ou(){if(!go)return;go=!1,jm=!1;try{zo(sessionStorage,G0)}catch{}Ja.textContent="Comments shown";let f=F0;F0=0,f&&requestAnimationFrame(()=>{let k=he.querySelector(".list");k&&(k.scrollTop=f)})}function wA(f){if(f===go||W||e.onboarding||f&&ie)return;if(!f){let M=jm&&!C;Ou(),M?wn(!0):$t();return}$r(),go=!0;try{sessionStorage.setItem(G0,"1")}catch{}Ja.textContent="Comments hidden",U=I=!1,clearTimeout(Io),Io=0,L=!1;let k=C;k?(F0=he.querySelector(".list")?.scrollTop??0,wn(!1,!0)):$t(),jm=k}function EA(){te=!1,G=!1;try{zo(sessionStorage,I0)}catch{}$t()}function os(f,k=!1){if(k||ye(),$r(),Ou(),R0=!!it.activeElement?.matches(":focus-visible")&&he.contains(it.activeElement),I=!1,clearTimeout(Io),Io=0,!k&&!De(f)){let ee=new URL(f.page,location.origin);ee.searchParams.set("comment",f.id),Hx(ee);return}k||(fe.delete(f.id),X={id:f.id,inspect:!1,pending:!1,rejected:!1,opened:!0}),wc=Mu===f.id&&!Fn.hidden?Fn.getBoundingClientRect():null,wc&&Hi(!0),D=f.id,j=null,L=!1,Ri=null,Fe="",U=!1;let M=R&&C;M&&wn(!1);let P=Ce(f)?ga(f.anchor):null;P?.attached&&!wc&&(M||!R)&&(Jt?y:window).scrollBy({top:(P.y-(M?Math.min(window.innerHeight,window.visualViewport?.height??window.innerHeight):window.innerHeight)*.35)/(Jt?Ro*pr():1),behavior:M&&!En()?"smooth":"instant"}),$t()}function px(){let f=iT(),k=Ni();return $.filter(M=>(ct==="all"||M.resolved===(ct==="resolved"))&&(!de||!!M.tags?.includes(de))&&(!ve||M.comments.some(P=>`${P.body} ${P.author.name}`.toLowerCase().includes(ve.toLowerCase()))||M.page.toLowerCase().includes(ve.toLowerCase()))&&(Ae||De(M,f.resolve,k))).sort((M,P)=>P.updatedAt-M.updatedAt)}function kA(){Promise.resolve().then(()=>(aO(),rO)).then(({showShortcutHelp:f})=>f(it,[...s.map(({label:k,shortcut:M,group:P})=>({label:k,shortcut:M,group:P==="Comments & view"?"Comments":"General"})),{label:"Restore feedback",shortcut:o.restore,group:"General"}],a,ie?"design":I?"comment":void 0,i,v))}function Ho(){Xe.style.display=te?"none":"",ur.update();let{dockCenter:f}=KS(window.innerWidth,window.innerHeight,C);if(R)_c(),Object.assign(Xe.style,{left:"50%",top:"auto",bottom:"calc(16px + env(safe-area-inset-bottom,0px))",transform:"translateX(-50%)"});else if(z)$i||(delete Xe.dataset.hidden,C?sx():(_c(),vn&&Bm(vn)),ua());else{delete Xe.dataset.hidden;let ae=!C&&e.drawerContainer?.isConnected?e.drawerContainer.getBoundingClientRect():void 0;ae?.width&&!dr&&(Pm=ae.left+ae.width/2);let ge=Xe.offsetWidth/2,re=ae?.width&&Pm!==void 0?Math.max(16+ge,Math.min(window.innerWidth-16-ge,Pm)):f;if(vn)Bm(vn);else if(re!==Tc){let be=Xe.getBoundingClientRect(),je=be.left+be.width/2;ns?.stop(),Xe.style.top="",Xe.style.bottom="",Xe.style.left=`${re}px`,Xe.style.translate="0px 0px",Tc!==void 0&&!En()&&(ns=Qr(Xe,{translate:[`${je-re}px ${be.top-Xe.getBoundingClientRect().top}px`,"0px 0px"]},{type:"spring",stiffness:680,damping:32,mass:.55})),Tc=re}}let k=ae=>({glyph:ae}),M=[{id:"browse",label:"Browse website",group:"Modes",shortcut:o.browse,icon:k("pointer"),onSelect:()=>Mc(!1)},{id:"comment",label:"Add comment",group:"Modes",shortcut:o.comment,icon:k("comment"),onSelect:()=>Mc(!I)},...a?[{id:"design",label:"Design mode",group:"Modes",shortcut:o.design,icon:k("design"),onSelect:()=>Cc(!ie)}]:[],{id:"comments",group:"Comments & view",label:e.onboarding?C?"Close project panel":"Project settings":C?"Close comments panel":"All comments",shortcut:e.onboarding?null:o.comments,count:e.onboarding||C?void 0:$.filter(ae=>!ae.resolved).length,icon:k("expand"),onSelect:()=>wn(!C)},{id:"account",group:"Account & help",label:q.user?`${q.user.name} \xB7 Account`:e.onboarding?.inProject?"Set up inline feedback":"Enter your name",icon:{user:q.user},onSelect:()=>{L||Io?(clearTimeout(Io),Io=0,L=!1,$t()):ma()}},{id:"copy-prompts",group:"Comments & view",keepOpenOnSelect:!0,label:Dc==="all"?"Copied prompt":"Copy comments for agent",icon:k(Dc==="all"?"check":"copy"),showInBar:!1,onSelect:()=>Ot(()=>LA("all"))},...v&&!R&&!ie?[{id:"layout",group:"Comments & view",label:b==="edge"?"Frame view":"Floating view",icon:k("expand"),showInBar:!1,onSelect:()=>Z0(b==="edge"?"background":"edge")}]:[],{id:"dismiss",group:"Feedback",label:"Dismiss feedback",icon:k("close"),onSelect:aj},{id:"visibility",group:"Comments & view",label:go?"Show comments":"Hide comments",shortcut:o.visibility,icon:k("comment"),showInBar:!1,onSelect:()=>wA(!go)},{id:"pin-size",group:"Comments & view",label:`Pin size: ${D2[S]}`,icon:k("pointer"),showInBar:!1,children:_2.map(ae=>({id:`pin-size-${ae}`,label:D2[ae],icon:k("check"),checked:ae===S,onSelect:()=>sj(ae)}))}];M.push({id:"shortcuts",group:"Account & help",label:"Keyboard shortcuts",icon:k("info"),showInBar:!1,onSelect:kA}),s=M,Re==="Offline"&&M.push({id:"retry",label:`${_e?.title??"Offline"} \xB7 Retry`,icon:k("info"),showInBar:!1,onSelect:qm});let P=e.onboarding?M.filter(ae=>ae.id==="account"||ae.id==="comments"):M,ee=BR(e.onboarding?fy:l,ae=>ae==="more"||P.some(ge=>ge.id===ae));ee.length||(Xe.style.display="none"),V2.render({items:P,bar:ee,alignEnd:C&&z?!1:!!vn&&vn.y>window.innerHeight/2,edge:C&&z?"bottom":vn?.edgeX??vn?.edgeY??(vn&&vn.y<window.innerHeight/2?"top":"bottom"),activeId:ie?"design":I?"comment":"browse",label:"Website review",moreLabel:"More review tools"})}function sj(f){if(!(f===S||W)){S=f;try{localStorage.setItem(E,f)}catch{}Ja.textContent=`Pin size: ${D2[f]}`,fa="",mr(),Ho()}}let lj=()=>S==="auto"?U||I||C?"full":"dot":S,is=null,fx=0;function mx(){fx=0;for(let f of bt.querySelectorAll(":scope > .pin")){let k=f.getBoundingClientRect(),M=!!is&&Math.hypot(Math.max(k.left-is.x,0,is.x-k.right),Math.max(k.top-is.y,0,is.y-k.bottom))<=24;f.toggleAttribute("data-near",M)}}let SA=new Set,TA=0,gx=0;function cj(f){let k=!1;for(let M of f)T(M)&&!SA.has(M.id)&&(k=!!SA.add(M.id));!k||En()||(TA=performance.now(),bt.style.setProperty("--pin-breathe-delay","0ms"),bt.dataset.breathe="",clearTimeout(gx),gx=window.setTimeout(()=>delete bt.dataset.breathe,5400))}let fa="",Fm=new Set,AA=new Map;function hx(f,k){let M=f.querySelector(".page");if(!M)return;let P=new URL(k.page,location.origin).href,ee=Jd(k),ae=k.page===Ni();M.href=P,M.title=P,M.setAttribute("aria-label",`Open page: ${P}`);let ge=M.closest(".card-page-row");ge.hidden=ae&&!ee,ge.querySelector(".card-page-url").textContent=P;let re=ee?"":P;if(M.dataset.url!==re){M.dataset.url=re;let je=ee?"All pages":rM(new URL(P));if(M.textContent=je,e.pageLabel&&!ee){let We=AA.get(P);We||(We=Promise.resolve().then(()=>e.pageLabel(new URL(P))).then(lt=>lt?.trim()||je,()=>je),AA.set(P,We)),We.then(lt=>{!W&&M.dataset.url===P&&(M.textContent=lt)})}}let be=f.querySelector(".card-status");be.textContent=k.resolved?"Resolved":Fm.has(k.id)&&ae?"Not found on page":"",be.hidden=!be.textContent,f.classList.toggle("resolved",k.resolved),f.classList.toggle("active",D===k.id),f.querySelector(".thread-card").setAttribute("aria-description",[ee&&"All pages",P,be.textContent].filter(Boolean).join(" \xB7 "))}let bx=!1,yx=0,xx=e.pins?.cluster!==!1,Ym,MA=!1;function dj(){MA||(MA=!0,Promise.resolve().then(()=>(dO(),cO)).then(f=>Ym=f,()=>xx=!1).then(()=>{fa="",mr()}))}let CA=()=>Jt?_u():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight};function mr(f=!1){let k=G||go;if(k&&$r(),Gt||bx&&!f)return;if(k){fa="",Hi(),bt.replaceChildren();return}let M=lj();M==="full"?delete bt.dataset.size:bt.dataset.size=M;let P=$.find(Se=>Se.id===D);P&&H(P);let ee=iT(),ae=Ni(),ge=$.filter(Se=>!Se.resolved&&(!de||!!Se.tags?.includes(de))&&De(Se,ee.resolve,ae));M==="dot"&&cj(ge);let re=new Map,be=xx?pM(ge,Se=>{let Ue=ee.resolve(Se.anchor),me=Ue&&Yf(Ue,y,e.anchorTarget);return!me||me===y||me===document.body?null:(re.set(Se.id,me),me)}):new Map,je=ge.map(Se=>{let Ue=ee.locate(Se.anchor);if(Ue.y<-Ue.height-40||Ue.y>window.innerHeight+40)return{thread:Se,rect:Ue,blocked:!1};let me=ee.resolve(Se.anchor),ne=Lx(Ue.x+8,Ue.y-10),Ee=!!(me&&ne&&!me.contains(ne)&&!ne.contains(me));return{thread:Se,rect:Ue,blocked:Ee}});for(let{thread:Se,rect:Ue}of je){if(Fm.has(Se.id)===!Ue.attached)continue;Ue.attached?Fm.delete(Se.id):Fm.add(Se.id);let me=it.querySelector(`.thread-item[data-thread="${CSS.escape(Se.id)}"]`);me&&hx(me,Se)}let We=JSON.stringify([D,M,j&&ee.locate(j),je.map(({thread:Se,rect:Ue,blocked:me})=>[Se.id,Ue,me,rg(Ue,window.innerWidth),be.get(Se.id)?.[0].id])]);if(We===fa)return;fa=We,ol?.isPreviewing(z0)||Hi();let lt=it.activeElement?.matches(".pins :focus-visible")?it.activeElement.dataset:void 0,tt=bt.querySelector(".pin-cluster[open]")?.dataset.cluster;bt.replaceChildren(),"breathe"in bt.dataset&&bt.style.setProperty("--pin-breathe-delay",`${(TA-performance.now())%1800}ms`);let en=new Map(je.map(Se=>[Se.thread.id,Se])),Bt=CA(),Ke=[],an=new Set;for(let{thread:Se,rect:Ue,blocked:me}of je){if(!Ue.attached)continue;let ne=be.get(Se.id),Ee=ne&&en.get(ne[0].id),ze=Ee?.rect.attached?Ee:{rect:Ue,blocked:me};if(ze.rect.y<-ze.rect.height-40||ze.rect.y>window.innerHeight+40||ze.blocked)continue;if(Ue.width&&Ue.height){let xt=w("div","area");Object.assign(xt.style,{left:`${Ue.x}px`,top:`${Ue.y}px`,width:`${Ue.width}px`,height:`${Ue.height}px`,opacity:Se.id===D?"1":".45"}),bt.append(xt)}let Be=Ee?.rect.attached?ne:null;if(Be&&an.has(Be))continue;let Qe=ze.rect,Nt=Be?Qe.x-9+Math.min(Be.length,6)*38>Bt.right:rg(Qe,window.innerWidth)==="right";Be&&an.add(Be),Ke.push({threads:Be??[Se],rect:Qe,right:Nt,owner:Be?re.get(Be[0].id):void 0,box:Se.anchor.unstacked||Se.id===D?null:mM(Qe.x,Qe.y,Nt,Be?fM(Be.length,M==="dot"?12:20):24)})}let nt=(Se,Ue)=>{let me=$.indexOf(Se)+1,ne=Se.comments[0],Ee=Oe(ne?`Comment ${me} by ${ne.author.name}: ${$2(ne.body)}`:`Comment ${me}`,()=>os(Se),`pin${Se.id===D?" active":""}${Se.id===Bu?" hot":""}${Se.resolved?" resolved":""}${Ue.attached?"":" detached"}`);if(Ee.textContent="",Ee.title="",Ee.toggleAttribute("data-read",!T(Se)),ne){let Be=ne.author;Xu(Ee,Be.accentColor);let Qe=yr(Be);Qe.dataset.initial=ep(Be.name).slice(0,1),Ee.append(Qe);let Nt=Ee.querySelector("img");Nt&&(Nt.draggable=!1)}if(Se.resolved){let Be=w("span","pin-check");Be.append(yt("check")),Ee.append(Be)}let ze=()=>{if(D||j||U||Gt||sr||xc)return;Dm=!1,window.clearTimeout(_m);let Be=Fn.hidden||Mu!==Se.id;vc?.cancel(),Mu=Se.id,Fn.replaceChildren();let Qe=Se.comments[0];if(!Qe)return;let Nt=Oe("Open comment",()=>os(Se),"pin-preview-open");Nt.textContent="";let xt=mo.test(Qe.body),Kt=w(xt?"div":"p","hover-message",O2(Qe.body));xt&&Eu().then(({renderDesignComment:jt})=>jt(Kt,Qe.body,{key:z0=`hover:${Qe.id}`,resolve:Rn=>Ce(Se)?L0(Se.anchor)(Rn):null,note:(Rn,Yo)=>Rn.textContent=Yo,compact:!0,design:e.design})),Nt.append(zA(Qe)),xt?(Kt.classList.add("pin-preview-card"),Kt.addEventListener("click",jt=>{jt.target.closest(".design-toggle")||os(Se)})):Nt.append(Kt);let Bi=Oe(Se.resolved?"Reopen comment":"Resolve comment",()=>{Hi(),kx(Se)},"icon pin-preview-resolve","check");Bi.disabled=!Zm(),Fn.append(Nt,...xt?[Kt]:[],Bi),Fn.hidden=!1;let mi=_x(Ee,Ue),vt=C&&!R?396:12,Vt=GS(KA(Ee),Fn.offsetWidth||320,Fn.offsetHeight,{left:12,top:12,right:window.innerWidth-vt,bottom:Jt?Math.min(window.innerHeight,_u().bottom)-12:window.innerHeight-92});Object.assign(Fn.style,{left:`${Vt.x}px`,transformOrigin:mi.x<Vt.x+160?"top left":"top right",top:`${Vt.y}px`}),Be&&!En()&&(vc=Fn.animate([{opacity:0,transform:"translateY(6px) scale(.97)"},{opacity:1,transform:"none"}],{duration:250,easing:"cubic-bezier(.22,1,.36,1)"}))};return Ee.addEventListener("pointerenter",ze),Ee.addEventListener("pointermove",Be=>{xc&&!Gt&&!sr&&Be.buttons===0&&(Be.movementX||Be.movementY)&&(xc=!1,ze())}),Ee.addEventListener("focus",ze),Ee.addEventListener("blur",()=>Hi()),Ee.addEventListener("pointerleave",()=>{_m=window.setTimeout(Hi,120)}),Ee.dataset.thread=Se.id,Ee},qe={root:it,bounds:Bt,pin:Se=>nt(Se,en.get(Se.id).rect),summary:Se=>$2(Se.comments[0]?.body??""),open:Se=>os(Se),menu:qf};for(let Se of xx?gM(Ke.map(Ue=>Ue.box)):Ke.map((Ue,me)=>[me])){let Ue=Ke[Se[0]];if(Se.length>1||Ue.threads.length>1)Ym?bt.append(Se.length>1?Ym.bubble(Se.map(me=>Ke[me]),Se.flatMap(me=>Ke[me].threads).sort(Px),qe):Ym.stack(Ue,qe)):dj();else{let me=qe.pin(Ue.threads[0]);me.dataset.pointer=Ue.right?"right":"left",Object.assign(me.style,{left:`${Ue.rect.x}px`,top:`${Ue.rect.y}px`}),bt.append(me)}}if((lt?.thread||lt?.cluster)&&bt.querySelector(lt.thread?`.pin[data-thread="${CSS.escape(lt.thread)}"]`:`[data-cluster="${CSS.escape(lt.cluster)}"]`)?.focus({preventScroll:!0}),tt&&bt.querySelector(`[data-cluster="${CSS.escape(tt)}"]`)?.setAttribute("open",""),bt.dataset.size&&is&&mx(),j&&j.width>0&&j.height>0){let Se=ga(j),Ue=w("div","area");Object.assign(Ue.style,{left:`${Se.x}px`,top:`${Se.y}px`,width:`${Math.max(8,Se.width)}px`,height:`${Math.max(8,Se.height)}px`}),bt.append(Ue)}}let Dc=null,vx=0;async function LA(f){let k=DM(f==="page"?$.filter(M=>De(M)):$,{...e,origin:location.origin,page:f==="page"?Ni():void 0});if(!k){Dn(f==="page"?"No open comments on this page":"No open comments to copy");return}await navigator.clipboard.writeText(k),!W&&(Dc=f,Ja.textContent="Agent prompt copied",clearTimeout(vx),Ho(),pi(),vx=window.setTimeout(()=>{Dc=null,Ho(),pi()},2e3))}let $u,Nu,Xm=f=>{f.removeAttribute("title"),f.addEventListener("pointerenter",k=>{k.pointerType==="mouse"&&Nu?.show(f)}),f.addEventListener("focus",()=>Nu?.show(f));for(let k of["pointerleave","blur","pointerdown"])f.addEventListener(k,()=>Nu?.hide())},Wm=new Set,_A="palette:dismissed-tips",DA=[["copy","Copy comments for your agent."]];o.comment&&DA.push(["shortcut",`Press ${o.comment.label} to comment.`]);function uj(f){try{let k=JSON.parse(localStorage.getItem(_A)??"[]");if(Array.isArray(k))for(let M of k)typeof M=="string"&&Wm.add(M)}catch{}for(let[k,M]of DA){let P=he.querySelector(`[data-tip="${k}"]`);if(!f||Wm.has(k)){P?.remove();continue}if(P)continue;P=w("div","morphing-menu__tooltip sidebar-tip"),P.dataset.tip=k;let ee=P;P.append(w("p","",M),Oe("Dismiss tip",()=>{Wm.add(k);try{localStorage.setItem(_A,JSON.stringify([...Wm]))}catch{}ee.dataset.leaving="",setTimeout(()=>ee.remove(),150)},"icon","close")),he.append(P)}wx()}function wx(){let f=he.getBoundingClientRect();for(let k of he.querySelectorAll(".sidebar-tip")){let M=k.dataset.tip==="copy",P=he.querySelector(M?".copy-page-prompt":'.toolbar [aria-label^="Add comment"]')?.getBoundingClientRect();if(k.hidden=!P?.width,!P?.width)continue;let ee=P.left+P.width/2-f.left,ae=Math.max(12,Math.min(f.width-12-k.offsetWidth,ee-k.offsetWidth/2));k.style.left=`${ae}px`,k.style.top=M?`${P.bottom-f.top+10}px`:`${P.top-f.top-10-k.offsetHeight}px`,k.style.setProperty("--caret-x",`${ee-ae}px`)}}let Ex,ju=!1;function pj(f){if(!ju||Le.busy)return;let k=px().filter(ge=>ge.resolved).map(ge=>ge.id);if(!k.length)return;let M=w("div","cleanup-confirm");M.popover="auto",M.setAttribute("role","alertdialog"),M.setAttribute("aria-label","Delete resolved comments permanently"),M.append(w("strong","",`Delete ${k.length} resolved ${k.length===1?"thread":"threads"}?`),w("p","","Their replies will be deleted too. This can\u2019t be undone."));let P=w("div","cleanup-actions"),ee=()=>{M.hidePopover(),f.focus({preventScroll:!0})};P.append(Oe("Cancel",ee,"secondary"),Oe("Delete permanently",()=>{ee(),Ot(async()=>{try{for(let ge=0;ge<k.length;ge+=250){let re=k.slice(ge,ge+250),be=new Set(re);await Le.submit(je=>je.filter(We=>!be.has(We.id)),async()=>{await q.request("project/clear-resolved","POST",{confirm:e.project,threadIds:re})})}}finally{await fr()}})},"secondary destructive")),M.append(P),he.append(M),M.addEventListener("toggle",()=>{M.matches(":popover-open")||M.remove()}),M.showPopover();let ae=f.getBoundingClientRect();M.style.left=`${Math.max(12,Math.min(ae.right-M.offsetWidth,innerWidth-M.offsetWidth-12))}px`,M.style.top=`${Math.max(12,Math.min(ae.bottom+8,innerHeight-M.offsetHeight-12))}px`,P.querySelector("button")?.focus()}let Zm=()=>!Q&&(Pn||!!q.user?.verified);function kx(f,k){if(!q.user&&(!Et||!da.trim())){ma();return}let M=D===f.id,P=ee=>{let ae=D;return M&&(D=ee?null:f.id),ut(Ie(f.id,ge=>({...ge,resolved:ee,resolvedBy:ee?q.user:null})),async ge=>{q.user||await q.guest(da),await q.request(`threads/${ge(f.id)}`,"PATCH",{resolved:ee})},()=>{D||(D=ae)})};Ot(()=>P(!f.resolved)),Dn(f.resolved?"Comment reopened":"Comment resolved",{label:"Undo",run:()=>Ot(()=>P(f.resolved))},k)}let RA=new WeakMap,Rc=new Set;function HA(f,k){return f.textContent=k,mo.test(k)&&(f.textContent="Design change",Eu().then(({summarizeDesignComment:M})=>{f.textContent=M(k)})),f}function pi(){if(e.onboarding){if($u?.(),he.replaceChildren(),e.onboarding.inProject)return;if(C){let ne=w("aside","panel");ne.setAttribute("aria-label","Project settings");let Ee=w("div","panel-head","Project settings"),ze=w("div","empty");ze.append(w("p","","Leave comments on your connected website."),Oe("Manage project",()=>{ma()},"secondary")),ne.append(Ee,ze),he.append(ne)}return}if(!C&&(z||R))return;let f=he.querySelector(".list"),k=f?.scrollTop??0,M=it.activeElement?.closest(".thread-item"),P=M?.querySelector(".reply-composer")?.contains(it.activeElement)?M:null,ee=w("div"),ae=it.activeElement?.getAttribute("aria-label")==="Search comments",ge=ae?it.activeElement.selectionStart:null;if(!C&&!z&&!R){$u?.(),he.replaceChildren();return}let re=he.querySelector(".panel");if(!re){re=w("aside","panel"),re.setAttribute("aria-label","All comments");let ne=w("div","panel-head"),Ee=w("div","row between sidebar-title"),ze=w("div","filter-slot"),Be=w("div","row"),Qe=Hn=>{let qn=re.querySelector(".sidebar-search-field"),hr=Be.querySelector('[aria-label="Search comments"]'),un=(Hn?hr:qn).getBoundingClientRect();kc=Hn,Hn||(ve="",qn.querySelector("input").value=""),pi();let ba=(Hn?qn:hr).getBoundingClientRect();En()||qn.animate(Hn?[{transform:`translate(${un.left-ba.left}px, ${un.top-ba.top}px)`,width:`${un.width}px`,height:`${un.height}px`,borderRadius:"50%",opacity:.4},{transform:"none",width:`${ba.width}px`,height:`${ba.height}px`,borderRadius:"10px",opacity:1}]:[{transform:"none",opacity:1},{transform:`translate(${ba.left-un.left}px, ${ba.top-un.top}px) scale(.2)`,opacity:0}],{duration:280,easing:"cubic-bezier(.22,1,.36,1)"}),Hn?qn.querySelector("input")?.focus():hr.focus()};Be.append(Oe("Copy page comments",()=>ct==="resolved"?pj(re.querySelector(".copy-page-prompt")):Ot(()=>LA("page")),"icon copy-page-prompt","copy"),w("div","tag-filter-slot"),Oe("Search comments",()=>Qe(!0),"icon sidebar-search-trigger","search"),Oe("Close sidebar",()=>wn(!1),"icon","close"));let Nt=w("div","sidebar-selector");Nt.append(ze,w("div","scope-slot")),Ee.append(Nt,Be);let xt=w("div","sidebar-search"),Kt=w("div","sidebar-search-inner"),Bi=w("div","sidebar-search-row"),mi=w("div","sidebar-search-field"),vt=w("input");vt.type="search",vt.placeholder="Search",vt.setAttribute("aria-label","Search comments"),vt.addEventListener("input",()=>{ve=vt.value,pi()}),vt.addEventListener("keydown",Hn=>{Hn.key==="Escape"&&(Hn.stopPropagation(),Vt())}),mi.append(yt("search"),vt);let Vt=()=>Qe(!1);mi.append(Oe("Close search",Vt,"icon search-cancel","close")),Bi.append(mi),Kt.append(Bi),xt.append(Kt),ne.append(Ee,xt);let jt=w("div","morphing-menu__tooltip sidebar-tooltip");jt.setAttribute("aria-hidden","true"),it.append(jt);let Rn=0,Yo=0,ha=()=>{clearTimeout(Rn),jt.dataset.open&&(delete jt.dataset.open,Yo=Date.now()+300)};$u=()=>{clearTimeout(Rn),jt.remove(),$u=void 0,Nu=void 0};let dn=Hn=>{clearTimeout(Rn);let qn=()=>{if(!Hn.isConnected)return;let hr=Hn.getBoundingClientRect();jt.textContent=Hn.ariaLabel;let un=jt.offsetWidth/2;jt.style.left=`${Math.max(8+un,Math.min(innerWidth-8-un,hr.left+hr.width/2))}px`,jt.style.top=`${hr.bottom+8}px`,jt.dataset.open="true"};jt.dataset.open||Date.now()<Yo?qn():Rn=window.setTimeout(qn,400)};Be.querySelectorAll("button").forEach(Xm),Nu={show:dn,hide:ha},re.append(ne),he.append(re)}let be=re.querySelector(".copy-page-prompt");if(ct==="resolved"&&Ex!==q.token){Ex=q.token,ju=!1;let ne=Ex;ne&&q.request("project").then(()=>{q.token===ne&&(ju=!0,pi())}).catch(()=>{})}let je=ct==="resolved";be.disabled=je&&(!ju||Le.busy||!px().length),be.classList.toggle("destructive",je);let We=je?"trash":Dc==="page"?"check":"copy";if(be.dataset.glyph!==We){let ne=be.querySelector("svg:not([data-leaving])"),Ee=yt(We),ze=be.dataset.glyph!==void 0&&!En();if(be.dataset.glyph=We,ze&&ne){ne.setAttribute("data-leaving","true"),be.append(Ee);let Be={duration:200,easing:"cubic-bezier(.22,1,.36,1)"},Qe={opacity:0,transform:"scale(.7)",filter:"blur(2px)"},Nt={opacity:1,transform:"scale(1)",filter:"blur(0px)"};ne.animate([Nt,Qe],{...Be,fill:"forwards"}).finished.then(()=>ne.remove()).catch(()=>ne.remove()),Ee.animate([Qe,Nt],Be)}else be.replaceChildren(Ee)}be.setAttribute("aria-label",je?ju?"Delete resolved comments permanently":"Project owner only":Dc==="page"?"Copied prompt":"Copy page comments"),re.dataset.search=String(kc),re.querySelector(".filter-slot").inert=kc,re.querySelector(".scope-slot").inert=!kc,re.querySelector(".sidebar-search-trigger").inert=kc;let lt=re.querySelector(".sidebar-search");lt.inert=!kc;let tt=re.querySelector(".filter-slot"),en=c?[...new Set($.flatMap(ne=>ne.tags??[]))].sort():[];de&&!en.includes(de)&&(de=""),tt.dataset.value!==ct&&(tt.dataset.value=ct,tt.replaceChildren(ec("Filter comments",[["open","Comments"],["all","All comments"],["resolved","Resolved"]],ct,ne=>{ct=ne,pi(),mr()})));let Bt=re.querySelector(".tag-filter-slot"),Ke=`${de} ${en}`;if(Bt&&Bt.dataset.value!==Ke&&(Bt.dataset.value=Ke,Bt.replaceChildren(),en.length)){let ne=de?`Filtered by #${de}`:"Filter by tag",Ee=ec(ne,[["","All tags"],...en.map(Be=>[Be,`#${Be}`])],de,Be=>{de=Be,pi(),mr()}),ze=Ee.querySelector("summary");ze.className=`icon tag-filter-trigger${de?" active":""}`,ze.setAttribute("aria-label",ne),ze.title=ne,ze.replaceChildren(yt("tag")),Bt.append(Ee)}let an=re.querySelector(".scope-slot");an.dataset.value!==String(Ae)&&(an.dataset.value=String(Ae),an.replaceChildren(ec("Comment pages",[["page","This page"],["all","All pages"]],Ae?"all":"page",ne=>{Ae=ne==="all",pi()})));let nt=!R&&!Go&&!En(),qe=new Map;if(nt&&f){let ne=f.getBoundingClientRect();for(let Ee of f.querySelectorAll("[data-thread]")){let ze=Ee.getBoundingClientRect();ze.bottom>=ne.top&&ze.top<=ne.bottom&&qe.set(Ee.dataset.thread,ze.top)}}let Se=w("div","list"),Ue=px();Ue.length>40&&(Se.dataset.long="");let me=!se&&Re==="Connecting";Se.setAttribute("aria-busy",String(me)),clearTimeout(Mm),Se.addEventListener("scroll",()=>{Se.dataset.scrolling="true",clearTimeout(Mm),Mm=window.setTimeout(()=>{delete Se.dataset.scrolling},800)},{passive:!0});for(let ne of Ue){let Ee=ne.comments[0];if(!Ee)continue;let ze=RA.get(ne);if(ze){ze.querySelector(".thread-card").classList.toggle("active",D===ne.id),ze.querySelector(".card-resolve").disabled=!Zm(),ze.querySelector("small").textContent=Bc(Ee.createdAt),ze.querySelectorAll(".reply-meta small").forEach((Hn,qn)=>{Hn.textContent=Bc(ne.comments[qn+1].createdAt)}),hx(ze,ne);let dn=ze.querySelector("textarea");dn&&it.activeElement!==dn&&requestAnimationFrame(()=>dn.dispatchEvent(new Event("palette-sync-reply"))),Se.append(ze===P?ee:ze);continue}let Be=Oe(`Open comment by ${Ee.author.name}`,()=>os(ne),`thread-card${D===ne.id?" active":""}`);Be.replaceChildren(),Be.removeAttribute("title");let Qe=w("div","row"),Nt=w("span","card-status");Qe.append(yr(Ee.author),w("span","author",Ee.author.name),Nt,w("small","",Bc(Ee.createdAt)));let xt=w("div","card-page-row"),Kt=w("a","page","Page link");Kt.addEventListener("click",dn=>{dn.preventDefault(),os(ne)});let Bi=Oe("Copy page URL",()=>Ot(async()=>{await navigator.clipboard.writeText(new URL(ne.page,location.origin).href),Dn("Page URL copied")}),"icon card-page-copy","copy"),mi=w("span","card-page-url");xt.append(yt("link"),Kt,Bi,mi);let vt=HA(w("p","preview"),Ee.body);if(Be.append(Qe,vt),c&&ne.tags?.length){let dn=w("div","card-tags");dn.setAttribute("role","group"),dn.setAttribute("aria-label","Tags");for(let Hn of ne.tags){let qn=w("span","card-tag",`#${Hn}`);qn.title=Hn,dn.append(qn)}Be.append(dn)}let Vt=P?.dataset.thread===ne.id?P:null,jt=Vt??w("div","thread-item"),Rn=Vt?.querySelector(".sidebar-replies"),Yo=Rn?.querySelector(".reply-composer");if(Vt)for(let dn of[...Vt.children])dn!==Rn&&dn.remove();jt.dataset.thread=ne.id;let ha=Oe(ne.resolved?"Reopen comment":"Resolve comment",()=>kx(ne),"icon card-resolve","check");ha.disabled=!Zm(),Xm(ha),jt.insertBefore(Be,Rn??null),jt.insertBefore(ha,Rn??null),ne.snapshot?.image&&jt.insertBefore(ku(0,ne),Rn??null),jt.insertBefore(xt,Rn??null),hx(jt,ne);{let dn=Rn??w("div","sidebar-replies");if(Yo)for(let un of[...dn.children])un!==Yo&&un.remove();dn.id=`replies-${ne.id}`,dn.setAttribute("role","group"),dn.setAttribute("aria-label",`Replies to ${Ee.author.name}`);let Hn=ne.comments.length===1?"Reply":`${ne.comments.length-1} ${ne.comments.length===2?"reply":"replies"}`,qn=Oe(Hn,()=>{Rc.has(ne.id)?Rc.delete(ne.id):Rc.add(ne.id),hr()},"card-reply-toggle");qn.replaceChildren(yt("comment"),w("span","",Hn),yt("chevron")),qn.removeAttribute("title"),qn.setAttribute("aria-controls",dn.id);let hr=()=>{let un=Rc.has(ne.id);dn.hidden=!un,qn.setAttribute("aria-expanded",String(un)),qn.setAttribute("aria-label",`${un?"Hide":"Show"} ${Hn}`),un&&requestAnimationFrame(()=>dn.querySelector("textarea")?.dispatchEvent(new Event("palette-sync-reply")))};hr();for(let un of ne.comments.slice(1)){let ba=w("div","sidebar-reply"),iM=w("div","row reply-meta");iM.append(yr(un.author),w("span","author",un.author.name),w("small","",Bc(un.createdAt))),ba.append(iM,w("p","",un.body)),dn.insertBefore(ba,Yo??null)}Yo||dn.append(Ax(ne)),jt.insertBefore(qn,Rn??null),Rn||jt.append(dn),jt.onkeydown=un=>{un.key!=="Escape"||!Rc.has(ne.id)||(un.preventDefault(),un.stopPropagation(),Rc.delete(ne.id),hr(),qn.focus({preventScroll:!0}))}}RA.set(ne,jt),Se.append(Vt?ee:jt)}if(!Se.childElementCount){let ne=w("div","empty");if(me&&ne.setAttribute("role","status"),ne.append(yt("comment"),w("strong","",ce?Ve?"Private project":"Sign in required":Re==="Offline"&&_e?_e.title:me?"Loading comments\u2026":ve?"No matching comments":ct==="resolved"?"Nothing resolved yet":"No comments yet")),ce)ne.append(w("p","",ce)),q.user?.verified||ne.append(Oe("Sign in",ma,"secondary"));else if(Re==="Offline"&&_e){ne.append(w("p","",_e.detail));let Ee=w("div","empty-actions");_e.kind==="site"&&Ee.append(Oe("Turn on comments",()=>{let ze=new URL("setup",e.endpoint.replace(/\/?$/,"/"));ze.searchParams.set("workspace",e.project),ze.searchParams.set("site",location.origin),window.open(ze,"_blank","noopener")},"primary"),Oe("Copy link",()=>{navigator.clipboard.writeText(location.origin).then(()=>Dn("Link copied")).catch(()=>Dn(location.origin))},"secondary")),_e.kind!=="site"&&Ee.append(Oe("Try again",qm,"secondary")),ne.append(Ee)}else se&&!ve&&ct!=="resolved"&&ne.append(Oe("Add a comment",()=>{Mr(window.innerWidth,window.innerHeight)&&wn(!1),Mc(!0)},"secondary"));Se.append(ne),Se.dataset.empty=""}if($.length&&Re==="Offline"&&Se.prepend(Oe("Saved comments \xB7 Try again",qm,"secondary")),f&&P&&ee.parentNode===Se){for(let ne of[...f.children])ne!==P&&ne.remove();for(let ne of[...Se.children]){if(ne===ee)break;f.insertBefore(ne,P)}ee.remove(),f.append(...Se.childNodes),f.setAttribute("aria-busy",String(me)),Ue.length>40?f.dataset.long="":delete f.dataset.long,Se=f}else f?f.replaceWith(Se):re.append(Se);if(uj(!!Se.querySelector(".empty [aria-label='Add a comment']")),requestAnimationFrame(wx),Se.scrollTop=k,Se.style.setProperty("--palette-scrollbar",`${Se.offsetWidth-Se.clientWidth}px`),nt){let ne=0,Ee=Se.getBoundingClientRect();for(let ze of Se.querySelectorAll("[data-thread]")){let Be=ze.getBoundingClientRect();if(Be.bottom<Ee.top||Be.top>Ee.bottom)continue;let Qe=qe.get(ze.dataset.thread),Nt=Qe===void 0?8:Qe-Be.top;Math.abs(Nt)>.5&&ze.animate([{opacity:Qe===void 0?0:1,transform:`translateY(${Math.max(-40,Math.min(40,Nt))}px)`},{opacity:1,transform:"translateY(0)"}],{duration:250,delay:Qe===void 0?Math.min(ne++,5)*40:0,easing:"cubic-bezier(0.22, 1, 0.36, 1)",fill:"backwards"})}Se.querySelector("[data-thread]")||Se.animate([{opacity:0},{opacity:1}],{duration:150})}if(ae){let ne=re.querySelector('input[type="search"]');ne.focus(),ge!==null&&ne.setSelectionRange(ge,ge)}}function zA(f){let k=w("div","row");return k.append(yr(f.author),w("span","author",f.author.name),w("small","",Bc(f.createdAt))),k.title=f.author.verified?"Verified":"Guest",k}function OA(f,k){return q.user?.id!==f.author.id||f.body==="[Comment deleted]"?[]:[{label:"Edit",icon:"edit",onSelect:()=>{Ri=f.id,Su=f.body,gr()}},{label:"Delete",icon:"trash",destructive:!0,onSelect:()=>{let M=nx(k.anchor);Dn("Delete this comment?",{label:"Delete",run:()=>{let P=D;k.comments.length===1&&(D=null),Ot(()=>ut(Ie(k.id,ee=>{let ae=ee.comments.filter(ge=>ge.id!==Le.id(f.id));return ae.length?{...ee,comments:ae}:null}),async ee=>{await q.request(`threads/${ee(k.id)}/comments/${ee(f.id)}`,"DELETE")},()=>{D||(D=P)})),Dn("Comment deleted",void 0,M)}})}}]}function fj(f,k){let M=w("article","message");if(M.dataset.comment=f.id,M.append(zA(f)),Ri===f.id){let re=w("div","message-content message-edit"),be=w("textarea","message-editor");be.value=Su,be.rows=1,be.maxLength=4e3,be.setAttribute("aria-label","Edit comment"),be.dataset.focusKey="edit";let je=()=>{be.style.height="auto",be.style.height=`${be.scrollHeight+be.offsetHeight-be.clientHeight}px`};be.addEventListener("input",()=>{Su=be.value,je()}),requestAnimationFrame(()=>be.isConnected&&je());let We=()=>{Ri=null,gr()},lt=Oe("Save changes",()=>{let Ke=Su;Ri=null,Ot(()=>ut(Ie(k.id,an=>({...an,comments:an.comments.map(nt=>nt.id===Le.id(f.id)?{...nt,body:Ke,editedAt:Date.now()}:nt)})),async an=>{await q.request(`threads/${an(k.id)}/comments/${an(f.id)}`,"PATCH",{body:Ke})},()=>{Ri||(Ri=Le.id(f.id),Su=Ke)}))},"primary");lt.disabled=Q;let tt=po(),en=(Ke,an,nt,qe=!1)=>(Ke.replaceChildren(an,Zd({key:nt,ctrl:qe&&!tt,meta:qe&&tt},tt)),Ke.removeAttribute("title"),Ke);be.addEventListener("keydown",Ke=>{Ke.isComposing||(Ke.key==="Escape"?(Ke.preventDefault(),Ke.stopPropagation(),We()):Ke.key==="Enter"&&(tt?Ke.metaKey:Ke.ctrlKey)&&!lt.disabled&&(Ke.preventDefault(),lt.click()))});let Bt=w("div","edit-actions");return Bt.append(en(Oe("Cancel",We,"secondary"),"Cancel","Escape"),en(lt,"Save","Enter",!0)),re.append(be,Bt),M.append(re),M}let P=w("div","message-content"),ee=mo.test(f.body),ae=w(ee?"div":"p","message-text");if(ok(ae,f.body),ee){let re=({renderDesignComment:be})=>be(ae,f.body,{key:f.id,resolve:je=>Ce(k)?L0(k.anchor)(je):null,note:ok,sourceHref:ng,design:e.design,tip:Xm,onSwitch:()=>fi(),blocked:()=>Ce(k)?ie&&it.querySelector(".design-inspector__compare")?.hidden===!1?"Send or reset your Design mode edits first":void 0:"Proposed on another page"});ol?re(ol):Eu().then(re)}if(P.append(ae),f.body!=="[Comment deleted]"){let re=Oe("Add reaction",()=>{Tu?.(!0),Tu=aD(it,re,je=>mj(f,k,je,!(q.user&&f.reactions[je]?.includes(q.user.id))),Object.entries(f.reactions).find(([,je])=>q.user&&je.includes(q.user.id))?.[0],`palette:emoji:${e.project}:${q.user?.id??"guest"}`,e.emojiDataSource)},"icon message-reaction","smile"),be=Object.entries(f.reactions).filter(([,je])=>je.length>0);if(re.dataset.reactions=JSON.stringify(be),be.length){re.replaceChildren(),re.classList.add("has-reactions");for(let[je,We]of be)re.append(w("span","reaction-value",`${je}${We.length>1?` ${We.length}`:""}`));re.setAttribute("aria-label","Change reactions")}re.setAttribute("aria-haspopup","menu"),re.setAttribute("aria-expanded","false"),P.append(re)}M.append(P);let ge=w("div","actions");if(q.user?.id===f.author.id&&f.body!=="[Comment deleted]"){let re=qf("Message actions",OA(f,k));k.comments[0]?.id!==f.id&&M.firstElementChild?.append(re)}return f.editedAt&&ge.append(w("small","","Edited")),ge.childElementCount&&M.append(ge),M}function mj(f,k,M,P){if(!q.user&&(!Et||!da.trim())){ma();return}Ot(async()=>{q.user||await q.guest(da);let ee=q.user;await ut(Ie(k.id,ae=>({...ae,comments:ae.comments.map(ge=>{if(ge.id!==Le.id(f.id))return ge;let re=Object.fromEntries(Object.entries(ge.reactions).map(([be,je])=>[be,je.filter(We=>We!==ee.id)]));return P&&(re[M]=[...re[M]??[],ee.id]),{...ge,reactions:re}})})),async ae=>{await q.request(`threads/${ae(k.id)}/comments/${ae(f.id)}/reactions`,"POST",{emoji:M,active:P})}),P&&A6(`palette:emoji:${e.project}:${ee.id}`,M)})}async function Sx(f="github"){let k=window.open("about:blank","branch-comments-signin","popup,width=600,height=720");if(!k)throw new Error("Allow popups to sign in.");try{let M=await q.request(`auth/${f}/start`,"POST",{}),P=new URL(M.url).origin,ee=ae=>{if(ae.origin!==P||ae.source!==k||ae.data?.type!=="branch-comments:auth")return;let{token:ge,user:re}=ae.data;typeof ge!="string"||!re?.id||!re?.name||re.verified!==!0||(q.save({token:ge,user:re}),sl(),Ye=null,window.removeEventListener("message",ee),clearTimeout(H0),k.close(),L=!!e.onboarding,$t(),!e.onboarding&&(Au?Ot(PA):(Ot(fr),Dn(`Signed in as ${re.name}`))))};window.addEventListener("message",ee,{signal:Y.signal}),H0=window.setTimeout(()=>{window.removeEventListener("message",ee)},6e5),k.location.href=M.url}catch(M){throw k.close(),M}}let Tx;function $A(f,k,M,P){let ee=w("div","tag-slot");ee.hidden=!!P&&!f.length;let ae=({tagEditor:ge})=>ge(ee,{tags:f,suggestions:[...new Set($.flatMap(re=>re.tags??[]))].sort(),onAdd:k,onRemove:M,trigger:P});if(Tx)ae(Tx);else{let ge=!1;P&&(P.onclick=()=>{ge=!0}),Promise.resolve().then(()=>(fO(),pO)).then(re=>{Tx=re,ae(re),ge&&P?.isConnected&&P.click(),fi()})}return ee}function NA(f,k){if(!q.user){ma();return}Ot(async()=>{let{tags:M}=await q.request(`threads/${Le.id(f.id)}`,"PATCH",k);$=$.map(P=>P.id===f.id?{...P,tags:M}:P),pi()})}function Ax(f){let k=w("form",`composer ${f?"reply-composer":"new-comment-composer"}`),M=w("textarea"),P=f?"":lr;if(M.placeholder=f?"Reply\u2026":P?"Add a note\u2026":"Add a comment\u2026",M.rows=1,M.maxLength=4e3,M.required=!!f||!lr,M.value=f?di.get(f.id)??"":Do,M.setAttribute("aria-label",f?"Reply":"Comment"),M.dataset.focusKey="body",f){let re=Lm.get(f.id);re&&M.setSelectionRange(...re);let be=()=>Lm.set(f.id,[M.selectionStart,M.selectionEnd,M.selectionDirection]);M.addEventListener("select",be),M.addEventListener("keyup",be),M.addEventListener("pointerup",be)}let ee=()=>{M.style.height="auto",M.style.height=`${Math.min(128,Math.max(f?34:28,M.scrollHeight))}px`,M.style.overflowY=M.scrollHeight>128?"auto":"hidden",fi()};M.addEventListener("input",ee),M.addEventListener("input",()=>{f?di.set(f.id,M.value):Do=M.value}),M.addEventListener("keydown",re=>{re.key==="Enter"&&!re.shiftKey&&!re.isComposing&&(re.preventDefault(),k.requestSubmit())});let ae=Oe(f?"Send reply":"Post comment",()=>{},"send","arrow");if(ae.type="submit",ae.disabled=Q,f)q.user&&k.append(yr(q.user)),k.append(M,ae);else{let re=w("div","draft-body");q.user&&re.append(yr(q.user)),re.append(M,ae),c&&re.append($A(_r,be=>_r=[..._r,be],be=>_r=_r.filter(je=>je!==be))),k.append(re)}M.addEventListener("input",()=>{ae.disabled=Q||!M.value.trim()&&!P}),ae.disabled||=!M.value.trim()&&!P,M.addEventListener("palette-sync-reply",()=>{if(!f||!M.isConnected||it.activeElement===M&&di.has(f.id))return;M.value=di.get(f.id)??"";let re=Lm.get(f.id);re&&M.setSelectionRange(...re),ae.disabled=Q||!M.value.trim(),M.closest(".sidebar-replies")?.hidden||ee()});let ge=!f&&j&&!D0.has(j)&&_0(j);if(ge&&k.append(ku(3,{anchor:j,page:"",id:""},ge)),P){let re=w("div","draft-proposal");re.textContent=P;let be=j?L0(j):()=>null;Eu().then(({renderDraftProposal:je})=>{if(!re.isConnected||lr!==P)return;let We=j;return Promise.resolve(je(re,P,be,{design:e.design,sourceHref:ng,tip:Xm,onUpdate(lt){j===We&&lr&&(lr=lt)}})).then(fi)}),k.prepend(re)}return k.addEventListener("submit",re=>{if(re.preventDefault(),!(!M.value.trim()&&!P||Q)){if(!q.user){Au=()=>jA(f),ma();return}Ot(()=>jA(f))}}),requestAnimationFrame(()=>{M.isConnected&&ee()}),k}async function jA(f){if(e.onboarding)throw new Error("Open your connected website to leave a comment.");if(!q.user)throw new Error("Enter your name to leave a comment.");let k=Date.now(),M={id:`pending-${crypto.randomUUID()}`,body:f?di.get(f.id)??"":[Do.trim(),lr].filter(Boolean).join(`
3022
3022
 
3023
- `),author:{...q.user},createdAt:k,editedAt:null,reactions:{}};if(M.body.trim()){if(f)di.delete(f.id),await ut(Ie(f.id,P=>({...P,updatedAt:k,comments:[...P.comments,M]})),async P=>{let se=(await q.request(`threads/${P(f.id)}/comments`,"POST",{body:M.body})).id??(await q.list()).find(ge=>ge.id===P(f.id))?.comments.filter(ge=>ge.author.id===M.author.id&&ge.body===M.body).at(-1)?.id;return se?{[M.id]:se}:{}},()=>{let P=Le.id(f.id);$.some(ee=>ee.id===P)?di.set(P,[M.body,di.get(P)].filter(Boolean).join(`
3023
+ `),author:{...q.user},createdAt:k,editedAt:null,reactions:{}};if(M.body.trim()){if(f)di.delete(f.id),await ut(Ie(f.id,P=>({...P,updatedAt:k,comments:[...P.comments,M]})),async P=>{let ae=(await q.request(`threads/${P(f.id)}/comments`,"POST",{body:M.body})).id??(await q.list()).find(ge=>ge.id===P(f.id))?.comments.filter(ge=>ge.author.id===M.author.id&&ge.body===M.body).at(-1)?.id;return ae?{[M.id]:ae}:{}},()=>{let P=Le.id(f.id);$.some(ee=>ee.id===P)?di.set(P,[M.body,di.get(P)].filter(Boolean).join(`
3024
3024
  `)):j===f.anchor?Do=[Do,M.body].filter(Boolean).join(`
3025
- `):ar.push({anchor:f.anchor,text:M.body})});else if(j){let P=j,ee=_r,se=Do,ge=lr,re=Ci(P),be=re&&oH(re,e)?"all":void 0,je=q,We={id:`pending-${crypto.randomUUID()}`,page:Ni(),anchor:P,tags:ee,...be&&{scope:be},resolved:!1,resolvedBy:null,createdAt:k,updatedAt:k,comments:[M]};D=We.id,j=null,Do=lr="",_r=[],await ut(lt=>[...lt,We],async()=>{let lt=!D0.has(P)&&_0(P),tt=await q.request("threads","POST",{page:We.page,anchor:P,snapshotIntent:li?.readiness?!!lt:void 0,body:M.body,...ee.length?{tags:ee}:{},...be&&{scope:be}});lt&&_0(P,(Bt,Ke)=>je.request(`threads/${tt.id}/snapshot?kind=${Bt}`,"POST",Ke,Ke.type));let en=tt.commentId??(await q.list()).find(Bt=>Bt.id===tt.id)?.comments[0]?.id;return{[We.id]:tt.id,...en?{[M.id]:en}:{}}},()=>{j?ar.push({anchor:P,text:M.body}):(D=null,j=P,Do=se,lr=ge,_r=ee)}),I&&!j&&!L&&D===Le.id(We.id)&&(Km()||(D=null,C&&wn(!1)),U=!0,$t())}}}async function PA(){let f=Au;Au=null,f&&await f()}let Pu=new Map;function gr(){Di&&(Di!==q||!fA())&&mA(),vu?.then(({resetDesignPreviews:me})=>me(new Set([...L?[]:$.find(ne=>ne.id===D&&Ce(ne))?.comments.map(ne=>ne.id)??[],...Fn.hidden?[]:[z0],...j?["draft"]:[]])));let f=$e;$e=void 0,Tu?.(!0),Tu=void 0;let k=it.activeElement,M=k?.dataset.focusKey,P=M?k?.selectionStart:null,ee=!!k?.matches(":focus-visible"),se=zt.querySelector(".messages")?.scrollTop??0,ge=zt.querySelector(".account-dialog")?.scrollTop??0,re=L?"account":j?"draft":D;re!==Ln&&(nl=null);let be=zt.firstElementChild,je=lx(),We=zt.classList.contains("thread-pane"),lt=Ln!==re,tt=be?.getBoundingClientRect(),en=new Map([...be?.querySelectorAll("[data-comment]")??[]].map(me=>[me.dataset.comment,me.querySelector(".message-reaction")]));if(be&&lt&&!En()&&!(We&&(je||!zt.isConnected))){let me=getComputedStyle(be),ne={opacity:me.opacity,transform:me.transform};be.getAnimations().forEach(Qe=>Qe.cancel());let Ee={duration:150,easing:"cubic-bezier(.22,1,.36,1)",fill:"forwards"},ze=Ln==="account"?w("div","account-layer"):We?w("div","thread-pane"):be;ze!==be&&ze.append(be),be.animate([{transform:ne.transform},{transform:We?"translateX(24px)":"translateY(4px) scale(.99)"}],Ee);let Be=ze.animate([{opacity:ne.opacity},{opacity:0}],Ee);ze.inert=!0,ze.setAttribute("aria-hidden","true"),be.style.pointerEvents="none",(We?zt.parentElement:ze!==be&&z?he:it).append(ze),Vn.set(ze,f),f=void 0,Be.finished.catch(()=>{}).finally(()=>{ze.remove(),Vn.get(ze)?.(),Vn.delete(ze)})}f?.(),zt.replaceChildren(),oj(je);let Bt=he.querySelector(".panel");if(Bt&&We!==!!je){if(!En())for(let ne of Bt.querySelectorAll(":scope > :not(.thread-pane)")){let Ee=[{visibility:"visible",opacity:1,transform:"none"},{visibility:"visible",opacity:0,transform:"translateX(-24px)"}];ne.animate(je?Ee:Ee.reverse(),{duration:250,easing:"cubic-bezier(.22,1,.36,1)"})}let me=`[data-thread="${CSS.escape(Ln??"")}"] .thread-card`;(je?R0:!j&&ee&&(Bt.contains(k)||!k.isConnected))&&queueMicrotask(()=>(je?zt:Bt).querySelector(je?".thread-back":me)?.focus({preventScroll:!0})),R0=!1}if(Ln=re,zt.classList.toggle("account-layer",L),!j&&!D&&!L){pa();return}let Ke=w("section",L?"dialog account-dialog":"dialog");L&&Ke.setAttribute("aria-modal","false"),Ke.setAttribute("role","dialog"),Ke.setAttribute("aria-label",L?"Reviewer account":j?"New comment":"Comment thread");let an=w("div","dialog-head row between"),nt=w("div","row"),qe=$.find(me=>me.id===D)??null,Se;if(qe&&!L){let me=(Qe,Nt)=>({label:Qe,icon:Qe==="Copy link"?"link":Qe==="Copy selector"?"code":"comment",onSelect:()=>Ot(async()=>{await navigator.clipboard.writeText(Nt()),Dn("Copied")})}),ne=qe.anchor.source,Ee=ne?ng(ne):"",ze=qf("Comment actions",[...OA(qe.comments[0],qe),...Ku(qe)?[{label:"Move pin",icon:"pointer",onSelect:()=>{xj(qe)}}]:[],...bj(qe)?[{label:Jd(qe)?`Only on ${qe.page===Ni()?"this":"its own"} page`:"Show on all pages",icon:"expand",onSelect:()=>yj(qe)}]:[],...qe.snapshot&&q.user&&(q.user.verified||li?.guests&&qe.comments[0]?.author.id===q.user.id)?[{label:"Remove snapshot",icon:"trash",destructive:!0,onSelect:()=>{z2().then(Qe=>Qe.confirmRemove(qe,j2))}}]:[],...a?[{label:"Open in Design",icon:"design",onSelect:()=>{qA(qe)}}]:[],...Ee&&/^(https?:|vscode:|cursor:)/.test(Ee)?[{label:"Open source",icon:"code",onSelect:()=>window.open(Ee,"_blank","noopener,noreferrer")}]:[],me("Copy link",()=>{let Qe=new URL(qe.page,location.origin);return Qe.searchParams.set("comment",qe.id),Qe.href}),me("Copy feedback",()=>[`Repository: ${e.repo}`,`Branch: ${e.branch}`,`Page: ${new URL(qe.page,location.origin).href}`,`Target: ${qe.anchor.selector||"Page position"}`,...qe.anchor.source?[`Source: ${qe.anchor.source}`]:[],...qe.anchor.text?[`Element text: ${qe.anchor.text}`]:[],"",...qe.comments.map(Qe=>`${Qe.author.name}: ${Qe.body}`)].join(`
3026
- `)),me("Copy selector",()=>qe.anchor.selector)]);nt.append(ze),c&&(Se=Oe(qe.tags?.length?"Manage tags":"Add tag",()=>{},"icon thread-tag-action","tag"),nt.append(Se));let Be=Oe(qe.resolved?"Reopen comment":"Resolve comment",()=>kx(qe,nx(qe.anchor)),"icon","check");Be.disabled=!Zm(),nt.append(Be)}if(nt.append(je?Oe("Close sidebar",()=>{Or(),wn(!1)},"icon","close"):Oe(L?"Close account":"Close comment",Or,"icon","close")),je&&an.append(Oe("Back to comments",Or,"icon thread-back","chevron"),HA(w("strong","thread-title"),qe?.comments[0]?.body??"")),an.append(nt),qe||L||je?Ke.append(an):Ke.append(Oe("Close comment",Or,"draft-close icon","close")),Di)Ke.append(JN());else if(L){let me=w("form","account");if(q.user){Ye??={name:q.user.name,avatarUrl:q.user.avatarUrl??"",accentColor:q.user.accentColor??Jx};let ne=Ye,Ee=yr({...q.user,...ne}),ze=w("div","account-summary"),Be=w("span","account-status");q.user.verified?(Be.append(document.createTextNode("Connected with ")),q.user.id.startsWith("google:")&&Be.append(Iv()),Be.append(document.createTextNode(q.user.id.startsWith("google:")?"Google":"GitHub"))):Be.textContent="Guest account";let Qe=Oe("Update profile photo",()=>Kt.click(),"account-avatar-button");Qe.replaceChildren(Ee),ze.append(Qe,w("h2","","Your profile"),Be),me.append(ze);let Nt=w("label","account-name-label","Display name"),xt=w("input");xt.value=ne.name,xt.name="name",xt.autocomplete="name",xt.required=!0,xt.maxLength=60,xt.dataset.focusKey="profile-name",xt.addEventListener("input",()=>{ne.name=xt.value,Mn(ne)}),xt.addEventListener("blur",()=>{Mn(ne,!0)}),Nt.append(xt);let Kt=w("input");Kt.type="file",Kt.accept="image/png,image/jpeg,image/webp",Kt.hidden=!0,Kt.setAttribute("aria-label","Choose profile photo"),Kt.addEventListener("change",()=>Ot(async()=>{let vt=Kt.files?.[0];if(!vt)return;if(vt.size>10*1024*1024)throw new Error("Choose a photo under 10 MB.");let Vt=await createImageBitmap(vt),jt=document.createElement("canvas");jt.width=jt.height=128;let Rn=jt.getContext("2d"),Yo=Math.min(Vt.width,Vt.height);Rn.drawImage(Vt,(Vt.width-Yo)/2,(Vt.height-Yo)/2,Yo,Yo,0,0,128,128),Vt.close();let ha=.8;do ne.avatarUrl=jt.toDataURL("image/jpeg",ha),ha-=.15;while(ne.avatarUrl.length>12e3&&ha>.1);if(ne.avatarUrl.length>12e3)throw new Error("Choose a smaller photo.");Mn(ne,!0),gr()})),ze.append(Kt);let Bi=u6(ne.accentColor,vt=>{ne.accentColor=vt,Xu(Ee,vt),Mn(ne)});if($e=Bi.destroy,me.append(Nt,Bi.element),e.onboarding){let vt=e.onboarding;me.append(ox(w("section","onboarding-panel"),Promise.resolve().then(()=>(e0(),Jy)).then(({onboardingPanel:Vt})=>Vt(q,vt))))}else me.append(YN()),J&&me.append(XN()),me.append(gA());if(q.user?.verified&&!e.onboarding?.code&&!e.onboarding?.claimKey&&!e.onboarding?.invite){let vt=w("div");me.append(vt),Promise.resolve().then(()=>(e0(),Jy)).then(({projectManagement:Vt})=>{vt.isConnected&&vt.replaceWith(Vt(q,e.onboarding?.workspace,jt=>{if(jt)D=null,Le.replace([],Le.revision),me.querySelector(".account-usage")?.remove();else{let Rn=e.onboarding?.workspace?`usage?workspace=${encodeURIComponent(e.onboarding.workspace)}`:"usage";me.querySelector(".account-usage")?.replaceWith(gA(Rn)),fr().catch(()=>{})}}))})}me.addEventListener("submit",vt=>{vt.preventDefault(),Mn(ne,!0)});let mi=w("div","account-session");if(mi.append(Oe("Sign out",()=>Ot(async()=>{if(Le.busy||Q){Dn("Wait for your changes to save.");return}clearTimeout(ot),pt=null;let vt=q.logout();sl(),Ye=null,Zt=null,$t();try{await vt}finally{sl(),Ot(fr),$t()}}),"secondary")),fA()){let vt=Oe("API tokens",QN,"account-sites-summary account-tokens-entry");vt.removeAttribute("title"),vt.replaceChildren(w("span","","API tokens"),yt("chevron")),vt.dataset.focusKey="account-tokens";let Vt=w("div","account-sites");Vt.append(vt),me.append(Vt)}me.append(mi),!q.user.verified&&ht&&me.append(K()),!q.user.verified&&Ze&&me.append(Oe("Sign in with GitHub",()=>Ot(()=>Sx()),"primary"))}else{if(me.append(w("h2","",e.onboarding?"Set up inline feedback":"Leave comments")),e.onboarding?.inProject){me.append(w("p","","Add the sites where you want to leave feedback. One site per line."));let ne=w("label","account-name-label","Production and preview sites"),Ee=w("textarea");Ee.rows=2,Ee.placeholder="https://your-site.com",Ee.value=Ct,Ee.dataset.focusKey="setup-sites",Ee.addEventListener("input",()=>{Ct=Ee.value}),ne.append(Ee),me.append(ne);let ze=Oe("Connect",()=>Ot(async()=>{if(!gt){gt=!0,ze.disabled=!0;try{let Be=await dM(e,Y.signal,cM(Ct,location.origin));if(W)return;sM(e,Be),e={...e,project:Be.project,repo:Be.repo,onboarding:void 0},q=new tc(e),q.save(Be),L=!1,Ye=null,Ln=null,await Iu(),$t(),Dn("Inline feedback is connected. Select an element to comment.")}finally{gt=!1,W||$t()}}}),"primary");ze.disabled=gt,me.append(ze)}if(Et){let ne=w("label","account-name-label","Your name"),Ee=w("input");Ee.name="name",Ee.autocomplete="name",Ee.placeholder="Your name",Ee.required=!0,Ee.maxLength=60,Ee.value=da,Ee.dataset.focusKey="account-name",Ee.addEventListener("input",()=>da=Ee.value),ne.append(Ee),me.append(ne);let ze=Oe("Continue",()=>{},"primary");ze.type="submit",ze.disabled=Q,Q&&ze.setAttribute("aria-busy","true"),me.append(ze)}Et&&(ht||Ze)&&me.append(w("div","account-divider","or")),ht&&me.append(K()),Ze&&me.append(Oe("Continue with GitHub",()=>Ot(()=>Sx()),"secondary")),me.addEventListener("submit",ne=>{ne.preventDefault(),Ot(async()=>{await ej(async()=>{await q.guest(da),L=!1}),await PA()})})}Ke.append(me)}else if(j)Ke.append(Ax(null));else if(qe){if(Ce(qe)){if(!Ci(qe.anchor)){let Ee=w("div","notice thread-navigation thread-anchor-status");Ee.setAttribute("role","status"),Ee.append(w("p","","Element not found on this page. The conversation is still available."),ku(4,qe)),Ke.append(Ee)}}else{let Ee=w("div","notice thread-navigation");Ee.setAttribute("role","status"),Ee.append(w("p","",X?.id===qe.id&&X.rejected?"Navigation could not be completed. The conversation is still available.":X?.pending?"Opening this comment\u2019s page\u2026":"The app is on a different page. The conversation is still available."));let ze=w("a","thread-destination","Open destination");ze.dataset.focusKey="thread-destination",ze.href=new URL(qe.page,location.origin).href,ze.title=ze.href,ze.setAttribute("aria-label",`Open destination: ${ze.href}`),ze.setAttribute("aria-disabled",String(!!X?.pending)),ze.addEventListener("click",Be=>{Be.preventDefault(),X?.pending||os(qe)}),Ee.append(ze),qe.snapshot&&Ee.append(ku(2,qe)),Ke.append(Ee)}let me=w("div","messages");for(let Ee of qe.comments)me.append(fj(Ee,qe));Ke.append(me);let ne=()=>me.dataset.fade=`${me.scrollTop>2?"top":""} ${me.scrollTop+me.clientHeight<me.scrollHeight-2?"bottom":""}`;if(me.addEventListener("scroll",ne,{passive:!0}),requestAnimationFrame(ne),qe.snapshot&&me.querySelector(".message .message-text")?.after(ku(1,qe)),c){let Ee=$A(qe.tags??[],Qe=>NA(qe,{tag:Qe}),Qe=>NA(qe,{untag:Qe}),Se);Ee.classList.add("thread-tags");let ze=me.querySelector(".message"),Be=ze?.querySelector(".message-text, .edit-actions");Be?Be.after(Ee):ze?.append(Ee)}Ke.append(Ax(qe))}else Ke.append(w("div","empty","This comment is no longer available."));if(zt.append(Ke),L&&lt&&!En()&&(zt.animate([{opacity:0},{opacity:1}],{duration:250,easing:"ease-out"}),Ke.animate([{opacity:0,transform:"translateY(8px) scale(.97)"},{opacity:1,transform:"none"}],{duration:250,easing:"cubic-bezier(.22,1,.36,1)"})),!L&&!je){let me=w("div","comment-drag-handle");me.setAttribute("aria-hidden","true"),Ke.prepend(me),Zh(Ke,me,ne=>{Ln&&yc.set(Ln,ne),fi()},Y.signal,()=>ca.stop())}if(fi(),je){lt&&(Jm=!1,eg(!0,1200));let me=ne=>{Jm=ne,eg(ne)};for(let ne of[an,Ke.querySelector(".messages")])ne?.addEventListener("pointermove",()=>Jm||me(!0)),ne?.addEventListener("pointerleave",()=>me(!1)),ne?.addEventListener("focusin",Ee=>{Ee.target.matches(":focus-visible")&&me(!0)}),ne?.addEventListener("focusout",()=>me(!1));Ke.addEventListener("click",()=>eg(!1,600)),Ke.addEventListener("pointerover",ne=>ne.target.closest(".design-card-target")?.removeAttribute("title"))}if(!L&&!En()){let me=Ke.getBoundingClientRect(),ne=wc??(lt?null:tt);je?lt&&Ke.animate([{opacity:0,transform:We?"none":"translateX(24px)"},{opacity:1,transform:"none"}],{duration:250,easing:"cubic-bezier(.22,1,.36,1)"}):ne&&(wc||Math.abs(ne.height-me.height)>1||Math.abs(ne.width-me.width)>1)?Ke.animate([{left:`${ne.left}px`,top:`${ne.top}px`,width:`${ne.width}px`,height:`${ne.height}px`,opacity:1},{left:`${me.left}px`,top:`${me.top}px`,width:`${me.width}px`,height:`${me.height}px`,opacity:1}],{duration:250,easing:"cubic-bezier(.22,1,.36,1)"}):lt&&Ke.animate([{opacity:0,transform:"translateY(6px) scale(.97)"},{opacity:1,transform:"none"}],{duration:250,easing:"cubic-bezier(.22,1,.36,1)"});for(let Ee of Ke.querySelectorAll("[data-comment]")){let ze=Ee.querySelector(".message-reaction"),Be=en.get(Ee.dataset.comment),Qe=Ee.dataset.comment;ze&&Be&&Be.dataset.reactions!==ze.dataset.reactions&&Pu.set(Qe,{from:Be,to:ze.dataset.reactions,started:performance.now()});let Nt=Pu.get(Qe),xt=Nt?performance.now()-Nt.started:470;if(ze&&Nt&&xt<470&&Nt.to===ze.dataset.reactions){let Kt=w("span","reaction-leaving");Kt.setAttribute("aria-hidden","true");for(let vt of Nt.from.children){if(vt.classList.contains("reaction-leaving"))continue;let Vt=vt.cloneNode(!0);Kt.append(Vt)}let Bi=[...ze.children];ze.append(Kt);let mi=Kt.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"scale(.2, .35)"}],{duration:110,easing:"ease-in",fill:"forwards"});mi.currentTime=xt,mi.finished.then(()=>Kt.remove()).catch(()=>Kt.remove());for(let vt of Bi){let Vt=vt.animate([{opacity:0,transform:"scale(.25, .4)",offset:0},{opacity:1,transform:"scale(1.16, .92)",offset:.38},{opacity:1,transform:"scale(.95, 1.07)",offset:.6},{opacity:1,transform:"scale(1.025, .985)",offset:.8},{opacity:1,transform:"scale(1)",offset:1}],{duration:380,delay:90,easing:"ease-in-out",fill:"backwards"});Vt.currentTime=xt,Vt.finished.then(()=>{Pu.get(Qe)===Nt&&Pu.delete(Qe)}).catch(()=>{})}}}}wc=null;let Ue=Ke.querySelector(".messages");if(Ue&&(Ue.scrollTop=se),L&&!lt&&(Ke.scrollTop=ge),M){let me=Ke.querySelector(`[data-focus-key="${M}"]`);me&&(me.focus({preventScroll:!0}),P!=null&&me.setSelectionRange(P,P))}}let gj,Qm=0,Mx=!1,Jm=!1,BA=0,Bu="",Vu="",Uu="",Cx=0;function qu(f=Vu||Uu){if(clearTimeout(Cx),f!==Bu){Bu=f;for(let k of bt.querySelectorAll(".pin"))k.classList.toggle("hot",k.dataset.thread===f);dl()}}function eg(f,k=0){clearTimeout(BA),Mx=f,dl(),k&&(BA=window.setTimeout(()=>eg(Jm),k))}function fi(){let f=Math.min(window.innerHeight,window.visualViewport?.height??window.innerHeight),k=zt.firstElementChild;if(!k||L)return;let M=$.find(nt=>nt.id===D),P=k.querySelector(".thread-anchor-status");if(P&&(P.hidden=!!(M&&Ce(M)&&Ci(M.anchor))),zt.classList.contains("thread-pane")){let nt=Qm;Qm=performance.now()+500;let qe=()=>{dl(),performance.now()<Qm?requestAnimationFrame(qe):Qm=0};nt||qe();return}if(R&&k.querySelector("textarea:focus")){let qe=window.visualViewport?.offsetTop??0;k.style.maxHeight=`${Math.max(0,f-24)}px`;let Se=NR(window.innerWidth,f,qe,k.offsetWidth,k.offsetHeight);ca.place(Ln,k,Se.x,Se.y,!0),k.style.bottom="auto",k.style.transformOrigin="bottom center",pa();return}let ee=Jt?Math.min(f,_u().bottom)-12:f-92;k.style.maxHeight=`${ee-12}px`,(gj??=new ResizeObserver(()=>fi())).observe(k);let se=j??(M&&Ce(M)?M.anchor:null),ge,re,be=sr?.id===D?sr:se?(()=>{let nt=ga(se);if(!nt.attached)return nl===Ln?!1:null;nl=Ln,ge=nt.width>16&&nt.height>16?{left:nt.x,top:nt.y,right:nt.x+nt.width,bottom:nt.y+nt.height}:(j?YA:mo.test(M?.comments[0]?.body??""))?nt.component:void 0;let qe=D&&bt.querySelector(`[data-thread="${CSS.escape(D)}"]`);return re=qe?KA(qe):void 0,qe?_x(qe,nt):nt})():null;if(be===!1)return j&&Do.trim()&&(_o={anchor:j,text:Do}),Or();let je=sr?.id===D,We=()=>{k.style.transformOrigin=!be||be.x<k.offsetLeft+k.offsetWidth/2?"top left":"top right"},lt=!je&&Ln&&yc.get(Ln);if(lt){let nt=Pa(lt,k.offsetWidth,k.offsetHeight,Un.clientWidth,f);ca.place(Ln,k,nt.x,nt.y,je),We(),pa();return}let tt=(window.innerWidth-354)/2,en=f-450,Bt=C&&!R?396:12,Ke=k.offsetWidth,an=k.offsetHeight;if(be&&({x:tt,y:en}=GS(re?.width&&!je?re:jR(be),Ke,an,{left:12,top:12,right:window.innerWidth-Bt,bottom:ee})),ge&&!R&&!je){let nt=ee-ge.bottom-14,qe=ge.top-26;if(ge.right+14+Ke<=window.innerWidth-Bt)[tt,en]=[ge.right+14,ge.top];else if(ge.left-14-Ke>=12)[tt,en]=[ge.left-14-Ke,ge.top];else if(Math.max(nt,qe)>=Math.min(an,200)){let Se=nt>=an||nt>=qe?nt:qe;k.style.maxHeight=`${Se}px`,[tt,en]=[ge.left,Se===nt?ge.bottom+14:ge.top-14-Math.min(an,Se)]}}ca.place(Ln,k,Math.max(12,Math.min(tt,window.innerWidth-k.offsetWidth-Bt)),Math.max(12,Math.min(en,ee-k.offsetHeight)),je),We(),pa()}function ma(){ye(),$r(),clearTimeout(Io),Ye=null,U=!1;let f=R;f&&!C&&wn(!0),Io=0,!(W||f&&!C)&&(L=!0,$t(),hj())}function hj(){queueMicrotask(()=>{if(!L)return;let f=R,k=f?zt.querySelector(".account-dialog"):zt.querySelector("input,button");f&&k&&(k.tabIndex=-1),k?.focus({preventScroll:!0})})}let VA=Ci,ga=pH;function Lx(f,k){return Kx(f,k).find(M=>M!==st&&!st.contains(M))??null}function tg(f){let k=Xn();return!!f&&f!==$m()&&f!==k.body&&(k===document&&e.pickRoots?[y,...e.pickRoots()]:[k.body]).some(M=>M.contains(f))}function ng(f,k){return e.sourceUrl?.(f,e.branch)??`https://github.com/${e.repo}/blob/${encodeURIComponent(e.branch)}/${f.split("/").map(encodeURIComponent).join("/")}${k?`#L${k}`:""}`}function UA(){return Pe?Promise.resolve(Pe):(Ne||(Ne=Promise.resolve().then(()=>(_N(),LN)).then(({createDesignMode:f})=>{let k=f({root:it,panelRoot:he,host:st,shortcutHelp:kA,visibility:o.visibility,keys:i,reservedKey:M=>Object.values(o).some(P=>Bo(M,P)),design:e.design,sourceHref:ng,page:Ni,bounds:M=>Jt&&V0(M)?_u():void 0,flip(){if(!z||!C||le||$i)return;let M=he.getBoundingClientRect();rA({x:Un.clientWidth-M.right,y:M.top}),B=!0,he.animate([{transform:`translateX(${M.left-he.getBoundingClientRect().left}px)`},{}],{duration:320,easing:"cubic-bezier(.22,1,.36,1)"})},targetAt(M,P){let ee=Lx(M,P);return tg(ee)?ee:null},onComment(M,P){pe=!1,C&&!Km()&&wn(!1),Cc(!1),Do="",lr=P??"",_r=[];let ee=Pt(M),se={x:(Math.max(ee.left,0)+Math.min(ee.right,innerWidth))/2,y:(Math.max(ee.top,0)+Math.min(ee.bottom,innerHeight))/2};Rx(M,se,se,!0)},onExit(){ie=!1,Pe?.setReturnAction(null),Ac(),Ho(),bA()}});return Promise.race([k.ready,new Promise(M=>setTimeout(M,2e3))]).then(()=>W?(k.destroy(),null):(Pe=k,k.setActive(ie),k))}).catch(()=>(ie=!1,Ac(),Ho(),null)).finally(()=>{Ne=null})),Ne)}async function qA(f){if(!a||W)return;if(!De(f)){let ee=new URL(f.page,location.origin);ee.searchParams.set("comment",f.id),ee.searchParams.set("comment-view","design"),await Hx(ee);return}if(!Ce(f)){Dn("Design is unavailable until this comment\u2019s page is reached.");return}let k=Ci(f.anchor);if(!k||!tg(k)||!ga(f.anchor).attached){Dn("Design is unavailable: this comment\u2019s element isn\u2019t visible on this page.");return}let M=C;Cc(!0),Te=M;let P=await UA();if(!(!P||!ie||W||D!==f.id||!De(f))){if(!k.isConnected||Ci(f.anchor)!==k){Cc(!1),Dn("Design is unavailable: this comment\u2019s element has changed.");return}P.select(k),P.setReturnAction({label:"Back to comment",run:()=>Cc(!1)})}}function KA(f){let k=f.parentElement;if(!k.matches(".pin-stack"))return f.getBoundingClientRect();let M=k.getBoundingClientRect(),P=Math.min(k.children.length,6)*38+4,ee=k.dataset.pointer==="right"?M.right-P:M.left,se=k.hasAttribute("data-below")?M.top:M.bottom-38;return{left:ee,right:ee+P,top:se,bottom:se+38,width:P}}function _x(f,k){if(!f.closest(".pin-stack")||f.dataset.dragging)return k;let M=f.getBoundingClientRect();return{x:M.left+(f.dataset.pointer==="right"?25:9),y:M.top+28}}function Ku(f){return!!q.user&&(q.user.verified||f.comments[0]?.author.id===q.user.id)}let bj=f=>Pn||Ku(f);function yj(f){if(!q.user&&(!Et||!da.trim()))return ma();let k=Jd(f)?"page":"all";Ot(async()=>{await ut(Ie(f.id,M=>({...M,scope:k})),async M=>{q.user||await q.guest(da),await q.request(`threads/${M(f.id)}`,"PATCH",{scope:k})}),Dn(`Shown on ${k==="all"?"all pages":"its own page"}`)})}function $r(){jn++,wt?.cancel()}async function xj(f){$r();let k=jn,M=we;if(Q||!Ku(f))return;let P=await Promise.resolve().then(()=>(RN(),DN)).catch(()=>null);if(!P){Dn("Moving is unavailable. Try again.");return}if(W||k!==jn||M!==we||!Ku(f))return;let ee=bt.querySelector(`.pin[data-thread="${CSS.escape(f.id)}"]`),se=ga(f.anchor);if(!De(f)||!se.attached||!ee){Dn("This pin isn\u2019t visible on this page. Open its page before moving it.");return}let ge=_x(ee,se);Gt=f.id,xc=!0,Hi(),ca.stop(),bt.append(ee),Object.assign(ee.style,{position:"fixed",margin:"0",left:`${ge.x}px`,top:`${ge.y}px`}),wt=P.startPinMove({root:it,pin:ee,point:ge,bounds:CA,preview(re){ee.dataset.pointer=rg(re,window.innerWidth),ee.style.left=`${re.x}px`,ee.style.top=`${re.y}px`,sr={id:f.id,...re},fi()},finish(re){if(wt=null,Gt=null,sr=null,fa="",mr(),fi(),zt.querySelector('summary[aria-label="Comment actions"]')?.focus({preventScroll:!0}),!re||W||!De(f)||!Ku(f))return;let be=Dx(re.x,re.y);if(!be){Dn("Pin unchanged. Choose an element on this page.");return}let je=oT(Yf(be,$m(),e.anchorTarget),re,{x:re.x+se.width,y:re.y+se.height},e.source);je.unstacked=!0,yc.delete(f.id),Ot(async()=>{await ut(Ie(f.id,We=>({...We,anchor:je})),async We=>{await q.request(`threads/${We(f.id)}`,"PATCH",{anchor:je})}),Dn("Pin moved")})}})}function Dx(f,k){let M=Lx(f,k);if(!tg(M))return null;let P=M.closest("button,a,input,textarea,select,[role=button],[role=link],[data-comment-anchor],h1,h2,h3,h4,h5,h6,p,li,figure,svg,canvas,img,video")??M,ee=P.closest("button,a,[role=button],[role=link]");return tg(ee)?ee:P}function dl(){let f=!U&&!!lx(),k=f?D:C&&!j&&!lx()&&he.querySelector(`.list [data-thread="${CSS.escape(Bu)}"]`)&&Bu,M=k&&$.find(se=>se.id===k),P=M&&Ce(M)&&ga(M.anchor),ee=P&&P.attached&&(P.width&&P.height?{left:P.x,top:P.y,right:P.x+P.width,bottom:P.y+P.height}:P.component);if(zi.toggleAttribute("data-thread",!!ee),bt.toggleAttribute("data-quiet",!!ee&&f),bt.toggleAttribute("data-outlined",!!ee&&f&&Mx),ee){let se=VA(M.anchor);GA(ee,P.width&&P.height?null:se,Jt&&!!se&&V0(se)),f&&!Mx&&(zi.style.opacity="0");return}if(!U&&!j||Pi||j&&j.width>0&&j.height>0){zi.style.opacity="0",!U&&!j&&(Ko=null,Qa=null);return}if(j&&(Ko=VA(j)),U&&Qa&&(Ko=Dx(Qa.x,Qa.y)),U&&Ko&&(Ko=Yf(Ko,$m(),e.anchorTarget)),!Ko?.isConnected){zi.style.opacity="0";return}GA(Pt(Ko),Ko,Jt&&V0(Ko))}let IA=null;function GA(f,k,M){IA=k,zi.style.opacity=ug(zi,f,k,M?_u():void 0)?"1":"0"}function FA(){Rm||(Rm=requestAnimationFrame(()=>{Rm=0,dl()}))}function $t(){if(W)return;if(st.classList.toggle("design-active",ie),L&&!C){Mr(window.innerWidth,window.innerHeight)?(L=!1,ma()):wn(!0);return}ji();let f=!!j&&!L&&Mr(window.innerWidth,window.innerHeight);st.classList.toggle("mobile-composing",f),he.inert=R?!C||L:z?!C:L,(D||j||U||G||go||L)&&Hi(!0),st.toggleAttribute("data-comments-hidden",go),zt.style.display=go&&!L?"none":"",ui.hidden=!U,dl(),B2.replaceChildren(),Ho(),Xe.inert=ie,mr(),pi(),gr();let k=he.querySelector(".panel");k&&(k.inert=ie,k.setAttribute("aria-hidden",String(ie)),k.hidden=ie),ie&&Pe?.mountPanel(he);let M=he.querySelector(".design-inspector__heading");M&&!M.dataset.drag&&(M.dataset.drag="",cA(M))}let Pi=null,rs=null;ui.addEventListener("pointerdown",f=>{if(f.button!==0)return;f.preventDefault(),f.stopPropagation();let k=Dx(f.clientX,f.clientY);k&&(Ko=k,Qa=null,zi.style.opacity="0",Pi={x:f.clientX,y:f.clientY,element:k,pointerId:f.pointerId},ui.setPointerCapture(f.pointerId),rs=w("div","selection"),it.append(rs))}),ui.addEventListener("pointermove",f=>{if(!Pi||!rs){Qa={x:f.clientX,y:f.clientY},FA();return}Object.assign(rs.style,{left:`${Math.min(Pi.x,f.clientX)}px`,top:`${Math.min(Pi.y,f.clientY)}px`,width:`${Math.abs(Pi.x-f.clientX)}px`,height:`${Math.abs(Pi.y-f.clientY)}px`})});let YA=!1;function Rx(f,k,M=k,P=!1){if(ye(),Ou(),YA=P,Hi(),f=Yf(f,$m(),e.anchorTarget),j=oT(f,k,M,e.source),Jt&&!es){let ee=y.getBoundingClientRect(),se=Ro*pr();j.pageX=(Math.min(k.x,M.x)-ee.left)/se+y.scrollLeft,j.pageY=(Math.min(k.y,M.y)-ee.top)/se+y.scrollTop}Ko=f,U=!1,D=null,L=!1,Ri=null,Fe="",$t(),zt.querySelector('[data-focus-key="body"]')?.focus({preventScroll:!0}),fi()}ui.addEventListener("pointerup",f=>{if(!Pi)return;let k=Pi;rs?.remove(),rs=null,Pi=null,Rx(k.element,k,{x:f.clientX,y:f.clientY})}),ui.addEventListener("pointerleave",()=>{Pi||j||(Qa=null,Ko=null,zi.style.opacity="0")}),ui.addEventListener("pointercancel",()=>{Pi=null,rs?.remove(),rs=null,Qa=null,Ko=null,zi.style.opacity="0"});function Fo(){if(Gt&&!$.some(k=>k.id===Gt&&De(k))&&$r(),Cm||W||document.hidden)return;let f=Ni();!ll&&(go&&!L||!j&&!D&&!U&&(G||!$.some(k=>(k.page===f||Jd(k))&&!k.resolved)))||(Cm=requestAnimationFrame(()=>{Cm=0,mr(),fi(),pa(),dl()}))}let XA=f=>{if(U0)return;xc=!0,Hi();let k=f.target;if(k===st||!k||k instanceof Node&&k.getRootNode()===it)return;let M=k.nodeType===Node.DOCUMENT_NODE?k.scrollingElement:k;Kn(M)&&(Jt&&_n.pan&&k===document&&(Rr(),Yn?.update(cr,pr())),Gt||(bx=!0,bt.dataset.scrolling="true",clearTimeout(yx),yx=window.setTimeout(()=>{W||(fa="",mr(!0),bx=!1,delete bt.dataset.scrolling)},180)),Fo())},WA={capture:!0,passive:!0,signal:Y.signal};document.addEventListener("scroll",XA,WA),so("scroll",XA,WA);for(let f of["focusin","focusout","click"])zt.addEventListener(f,()=>requestAnimationFrame(fi),{signal:Y.signal});window.visualViewport?.addEventListener("scroll",()=>{Mr(window.innerWidth,window.innerHeight)&&(ji(),(L||j||D)&&Fo())},{signal:Y.signal}),window.visualViewport?.addEventListener("resize",()=>{Mr(window.innerWidth,window.innerHeight)&&(ji(),Fo())},{signal:Y.signal}),window.addEventListener("resize",()=>{tj(),ji(),R||Ho(),Fo()},{signal:Y.signal}),jr(it,"keydown",f=>{let k=f.composedPath()[0];if((L||R&&C)&&f.key==="Tab"){let se=[...(L?zt:ie?it.querySelector(".design-inspector")??it:it).querySelectorAll("button:not(:disabled),input:not(:disabled):not([type=hidden]),select:not(:disabled),textarea:not(:disabled),summary,a[href],[tabindex]")].filter(be=>be.tabIndex>=0&&be.getClientRects().length>0&&!be.closest("[inert]")&&(L||ie||!R||!!be.closest(".panel,.toolbar"))),ge=se[0],re=se.at(-1);f.shiftKey&&(it.activeElement===ge||!se.includes(it.activeElement))?(f.preventDefault(),re?.focus()):!f.shiftKey&&(it.activeElement===re||!se.includes(it.activeElement))&&(f.preventDefault(),ge?.focus())}let M=document.activeElement;for(;M?.shadowRoot?.activeElement;)M=M.shadowRoot.activeElement;M===as()&&(M=Xn().activeElement);let P=br(k)||br(M)||f.isComposing;if(f.key==="Escape"){if(ie||f.defaultPrevented&&!f.composedPath().includes(st)||go&&!L)return;U||j||D||L?(f.preventDefault(),Or()):C&&(f.preventDefault(),wn(!1));return}if(!P){if(te&&Bo(f,o.restore)){f.preventDefault(),EA();return}e.onboarding||(Bo(f,o.comment)?(f.preventDefault(),Mc(!I)):Bo(f,o.browse)?(f.preventDefault(),Mc(!1)):a&&Bo(f,o.design)?(f.preventDefault(),Cc(!ie)):Bo(f,o.comments)?(f.preventDefault(),wn(!C)):!ie&&Bo(f,o.visibility)&&(f.preventDefault(),wA(!go)))}},{signal:Y.signal}),jr(it,"pointermove",f=>{f.pointerType!=="touch"&&(is=Vi(f),bt.dataset.size&&(fx||=requestAnimationFrame(mx)))},{passive:!0,signal:Y.signal}),Un.addEventListener("pointerleave",()=>{is=null,mx()},{signal:Y.signal}),jr(it,"pointerdown",f=>{let k=f.composedPath(),M=k.some(P=>P instanceof Element&&P.getRootNode()===it&&P.matches("button,input,textarea,summary,[role=menu],[role=listbox],.emoji-menu,.emoji-keyboard,.floating-notice"));f.button===0&&(D||j)&&!go&&!(j&&Mr(window.innerWidth,window.innerHeight))&&!L&&!k.includes(zt)&&!k.includes(Xe)&&!k.includes(bt)&&!(U&&k.includes(ui))&&!M&&(j&&Do.trim()&&(_o={anchor:j,text:Do}),Or());for(let P of it.querySelectorAll(".comment-menu[open]"))f.composedPath().includes(P)||(P.open=!1)},{signal:Y.signal});let ZA=new ResizeObserver(()=>{Rr(),Fo()});ZA.observe(y);let Hc=0,og=new MutationObserver(f=>{if(f.some(k=>k.target===document.body)&&Rr(),j||D||U||ll)return Fo();Hc||(Hc=window.setTimeout(()=>{Hc=0,Fo()},80))});og.observe(document.body,{childList:!0,subtree:!0,characterData:!0}),pg(st,()=>zi.style.opacity!=="0"?[IA]:[],FA,Y.signal),zt.addEventListener("pointerdown",f=>{L&&f.target===zt&&Or()});function zc(){W||Ni()===N2||(N2=Ni(),ol?.resetDesignPreviews(),Pe?.clearSelection(),Pe?.setReturnAction(null),_o=null,D=X?.id===D?D:null,j=null,$t())}let QA=()=>setTimeout(()=>(zc(),zx()));window.addEventListener("popstate",QA,{signal:Y.signal}),window.navigation?.addEventListener("navigatesuccess",QA,{signal:Y.signal});async function Hx(f){let k=as()?.contentWindow;if(k&&f.origin===location.origin)return f.searchParams.delete("comment"),f.searchParams.delete("comment-view"),k.location.assign(f);if(!e.navigate||f.origin!==location.origin)return location.assign(f);let M=f.searchParams.get("comment");if(!M)return;ye(),fe.delete(M);let P={id:M,inspect:f.searchParams.get("comment-view")==="design",pending:!0,rejected:!1};X=P,D===M&&gr();try{await e.navigate(f)}catch{P.rejected=!0}W||X!==P||(P.pending=!1,zc(),await JA(P))}let ig=null;async function JA(f){let k=$.find(P=>P.id===f.id);if(!k||ig===f||f.opened)return;ig=f;for(let P=0;P<5e3&&Ce(k)&&!Ci(k.anchor)&&(await new Promise(ee=>setTimeout(ee,100)),!(W||X!==f));P+=100);if(ig===f&&(ig=null),W||X!==f||!$.some(P=>P.id===k.id))return;let M=new URL(location.href);M.searchParams.get("comment")===f.id&&(M.searchParams.delete("comment"),M.searchParams.delete("comment-view"),history.replaceState(history.state,"",M)),zc(),f.opened=!0,C||wn(!0),os(k,!0),f.inspect&&Ce(k)&&qA(k)}async function zx(){let f=new URL(location.href),k=f.searchParams.get("comment");if(k&&fe.has(k)){f.searchParams.delete("comment"),f.searchParams.delete("comment-view"),history.replaceState(history.state,"",f);return}let M=$.find(P=>P.id===k);!M||X?.pending||(X?.id!==M.id&&(ye(),X={id:M.id,inspect:f.searchParams.get("comment-view")==="design",pending:!1,rejected:!1}),await JA(X))}function Ox(){let f=new tc(e);return f.token===q.token||q.transient&&!f.token?!1:(q.cancelReads(),q=f,et=!1,_e=null,Re="Connecting",ht=Ze=Et=Pn=Ve=ir=!1,j=_o=null,Do=lr="",_r=[],di.clear(),Lm.clear(),ar.length=0,pt=Ye=Zt=null,rn++,clearTimeout(ot),sl(),$t(),Ot(Iu),!0)}window.addEventListener("storage",f=>{f.storageArea===localStorage&&f.key===q.sessionKey&&f.newValue!==q.token&&Ox()},{signal:Y.signal}),window.addEventListener("focus",()=>{Ox()||zr?.wake()},{signal:Y.signal});let eM=f=>f.target.closest?.(".list .thread-item")?.dataset.thread??"",$x=()=>{clearTimeout(Cx),Cx=window.setTimeout(()=>qu(),80)};for(let[f,k]of[["pointerover",M=>(Vu=eM(M))?qu():$x()],["pointerleave",()=>{Vu="",$x()}],["focusin",M=>{Uu=eM(M),qu()}],["focusout",()=>{Uu="",$x()}],["scroll",()=>{Vu=Uu="",qu()}]])he.addEventListener(f,k,{capture:!0,signal:Y.signal});zr=uM({interval:Math.max(2e3,e.pollInterval??4e3),enabled:()=>!W&&!document.hidden&&navigator.onLine!==!1&&!e.onboarding,active:()=>C||L||U||!!j||!!D,read:async()=>(zc(),et?fr():Iu())});for(let f of["online","offline"])window.addEventListener(f,()=>zr?.wake(),{signal:Y.signal});if(st.addEventListener("click",()=>zr?.wake(!1),{signal:Y.signal}),st.addEventListener("keydown",()=>zr?.wake(!1),{signal:Y.signal}),e.isolateEvents!==!1){st.setAttribute("data-isolate",""),yC(st,Y.signal);for(let f of bC)st.addEventListener(f,k=>Ju(k,it)&&k.stopPropagation(),{passive:!0,signal:Y.signal});document.addEventListener("focusout",f=>f.relatedTarget===st&&f.stopImmediatePropagation(),{signal:Y.signal})}document.addEventListener("visibilitychange",()=>{document.hidden?(og.disconnect(),clearTimeout(Hc),Hc=0):(og.observe(document.body,{childList:!0,subtree:!0,characterData:!0}),Rr(),Fo()),(document.hidden||!Ox())&&zr?.wake()},{signal:Y.signal});let tM={destroy(){if(W)return;h&&Lu(),W=!0,Yn?.destroy(),ye(),$r(),zr?.stop(),Pe?.destroy(),ol?.resetDesignPreviews(),q.cancelReads(),Du(),$u?.(),cancelAnimationFrame(rx),clearTimeout(Hc),clearTimeout(yx),clearTimeout(gx),clearTimeout(Io),clearTimeout(vx),Pu.clear(),H2?.then(k=>k.disposeSnapshots(it)),ca.stop(),Ot(Qt),$e?.(),Tu?.(!0);for(let[k,M]of Vn)M?.(),k.getAnimations().forEach(P=>P.cancel()),k.remove();Vn.clear(),Oi?.cancel(),ns?.stop(),zu(!0),Y.abort(),clearTimeout(Am),clearTimeout(Mm),clearTimeout(H0),cancelAnimationFrame(Cm),cancelAnimationFrame(Rm),cancelAnimationFrame(fx),cancelAnimationFrame(Nm),cancelAnimationFrame(ex),Hi(),ZA.disconnect(),og.disconnect(),K0.disconnect(),K2.disconnect(),cancelAnimationFrame(q0);let f=Jt&&!ts?y.scrollTop*pr():window.scrollY/Ro;B0(),Rr(),(Jt||!z)&&(Hu(),window.scrollTo({top:f,behavior:"instant"})),J0.disconnect(),V2.unmount(),st.remove(),R2.delete(document)},comment(f){let k=()=>{if(W||!f.isConnected)return;let M=f.getBoundingClientRect();!M.width||!M.height||Rx(f,{x:M.left+M.width/2,y:M.top+M.height/2})};C&&!Km()?(wn(!1),Oi&&dr?Oi.finished.then(k).catch(()=>{}):k()):k()},open(){W||(EA(),wn(!0))},close(){W||(Or(),wn(!1))},async refresh(){await fr()}};R2.set(document,{scope:u,controller:tM}),Go=!!h||!e.onboarding&&oA.get(),ji();let Nx=e.onboarding?null:q.cached();ae||=Nx!==null;let nM=Go;if(Go=!0,Nx&&Le.replace(ix(Nx)),$t(),z&&(he.style.transition="none",ua(),he.offsetWidth,he.style.transition=""),jm=nM&&go,Go=nM&&!go,Go&&(wn(!0),Go=!1,!En()))for(let f of[st,Jt?y:null])f?.animate([{opacity:0},{opacity:1}],{duration:200,easing:"cubic-bezier(0.22, 1, 0.36, 1)"});h&&(AM(h),j0=!0,v?C||wn(!0):Lu("Single-copy mode needs the app's root element in the page's HTML.")),zx();async function Iu(){let f=q,k=f.token,M;try{await f.restore()}catch{}if(W||f!==q)return;k!==f.token&&sl(),Ho(),L&&gr();let P=fr();P.catch(()=>{});try{M=await f.request("config")}catch(se){if(W||f!==q||se instanceof DOMException&&se.name==="AbortError")return;let ge=JS(se),re=_e?.detail!==ge.detail;throw _e=ge,Re="Offline",re&&$t(),se}if(W||f!==q)return;et=!0,ht=!!M.google,Ze=M.github,Et=M.guests,Pn=M.guestResolve,Ve=!!M.private,ir=M.tokens===!0,li=M.snapshots,$t();let ee=await P;if(!(W||f!==q))return zx(),$t(),ee}e.onboarding?.inProject||Ot(()=>Iu().finally(()=>zr?.wake(!1)));let oM=()=>{US().catch(()=>{})};return"requestIdleCallback"in window?requestIdleCallback(oM,{timeout:2e3}):setTimeout(oM,200),tM}var tl=new URL(location.href),zN=tl.searchParams.get("project")||"_komo",ON=new URLSearchParams(tl.hash.slice(1)).get("invite")||void 0,KG=ON?void 0:tl.hash.slice(1)||void 0;history.replaceState(null,"",tl.pathname+tl.search);HN({endpoint:location.origin+location.pathname.replace(/\/setup$/,""),project:zN,repo:zN,branch:"shared",pageRoot:document.querySelector("main"),onboarding:{code:tl.searchParams.get("code")||void 0,workspace:tl.searchParams.get("workspace")||void 0,site:tl.searchParams.get("site")||void 0,claimKey:KG,invite:ON}});
3025
+ `):ar.push({anchor:f.anchor,text:M.body})});else if(j){let P=j,ee=_r,ae=Do,ge=lr,re=Ci(P),be=re&&oH(re,e)?"all":void 0,je=q,We={id:`pending-${crypto.randomUUID()}`,page:Ni(),anchor:P,tags:ee,...be&&{scope:be},resolved:!1,resolvedBy:null,createdAt:k,updatedAt:k,comments:[M]};D=We.id,j=null,Do=lr="",_r=[],await ut(lt=>[...lt,We],async()=>{let lt=!D0.has(P)&&_0(P),tt=await q.request("threads","POST",{page:We.page,anchor:P,snapshotIntent:li?.readiness?!!lt:void 0,body:M.body,...ee.length?{tags:ee}:{},...be&&{scope:be}});lt&&_0(P,(Bt,Ke)=>je.request(`threads/${tt.id}/snapshot?kind=${Bt}`,"POST",Ke,Ke.type));let en=tt.commentId??(await q.list()).find(Bt=>Bt.id===tt.id)?.comments[0]?.id;return{[We.id]:tt.id,...en?{[M.id]:en}:{}}},()=>{j?ar.push({anchor:P,text:M.body}):(D=null,j=P,Do=ae,lr=ge,_r=ee)}),I&&!j&&!L&&D===Le.id(We.id)&&(Km()||(D=null,C&&wn(!1)),U=!0,$t())}}}async function PA(){let f=Au;Au=null,f&&await f()}let Pu=new Map;function gr(){Di&&(Di!==q||!fA())&&mA(),vu?.then(({resetDesignPreviews:me})=>me(new Set([...L?[]:$.find(ne=>ne.id===D&&Ce(ne))?.comments.map(ne=>ne.id)??[],...Fn.hidden?[]:[z0],...j?["draft"]:[]])));let f=$e;$e=void 0,Tu?.(!0),Tu=void 0;let k=it.activeElement,M=k?.dataset.focusKey,P=M?k?.selectionStart:null,ee=!!k?.matches(":focus-visible"),ae=zt.querySelector(".messages")?.scrollTop??0,ge=zt.querySelector(".account-dialog")?.scrollTop??0,re=L?"account":j?"draft":D;re!==Ln&&(nl=null);let be=zt.firstElementChild,je=lx(),We=zt.classList.contains("thread-pane"),lt=Ln!==re,tt=be?.getBoundingClientRect(),en=new Map([...be?.querySelectorAll("[data-comment]")??[]].map(me=>[me.dataset.comment,me.querySelector(".message-reaction")]));if(be&&lt&&!En()&&!(We&&(je||!zt.isConnected))){let me=getComputedStyle(be),ne={opacity:me.opacity,transform:me.transform};be.getAnimations().forEach(Qe=>Qe.cancel());let Ee={duration:150,easing:"cubic-bezier(.22,1,.36,1)",fill:"forwards"},ze=Ln==="account"?w("div","account-layer"):We?w("div","thread-pane"):be;ze!==be&&ze.append(be),be.animate([{transform:ne.transform},{transform:We?"translateX(24px)":"translateY(4px) scale(.99)"}],Ee);let Be=ze.animate([{opacity:ne.opacity},{opacity:0}],Ee);ze.inert=!0,ze.setAttribute("aria-hidden","true"),be.style.pointerEvents="none",(We?zt.parentElement:ze!==be&&z?he:it).append(ze),Vn.set(ze,f),f=void 0,Be.finished.catch(()=>{}).finally(()=>{ze.remove(),Vn.get(ze)?.(),Vn.delete(ze)})}f?.(),zt.replaceChildren(),oj(je);let Bt=he.querySelector(".panel");if(Bt&&We!==!!je){if(!En())for(let ne of Bt.querySelectorAll(":scope > :not(.thread-pane)")){let Ee=[{visibility:"visible",opacity:1,transform:"none"},{visibility:"visible",opacity:0,transform:"translateX(-24px)"}];ne.animate(je?Ee:Ee.reverse(),{duration:250,easing:"cubic-bezier(.22,1,.36,1)"})}let me=`[data-thread="${CSS.escape(Ln??"")}"] .thread-card`;(je?R0:!j&&ee&&(Bt.contains(k)||!k.isConnected))&&queueMicrotask(()=>(je?zt:Bt).querySelector(je?".thread-back":me)?.focus({preventScroll:!0})),R0=!1}if(Ln=re,zt.classList.toggle("account-layer",L),!j&&!D&&!L){pa();return}let Ke=w("section",L?"dialog account-dialog":"dialog");L&&Ke.setAttribute("aria-modal","false"),Ke.setAttribute("role","dialog"),Ke.setAttribute("aria-label",L?"Reviewer account":j?"New comment":"Comment thread");let an=w("div","dialog-head row between"),nt=w("div","row"),qe=$.find(me=>me.id===D)??null,Se;if(qe&&!L){let me=(Qe,Nt)=>({label:Qe,icon:Qe==="Copy link"?"link":Qe==="Copy selector"?"code":"comment",onSelect:()=>Ot(async()=>{await navigator.clipboard.writeText(Nt()),Dn("Copied")})}),ne=qe.anchor.source,Ee=ne?ng(ne):"",ze=qf("Comment actions",[...OA(qe.comments[0],qe),...Ku(qe)?[{label:"Move pin",icon:"pointer",onSelect:()=>{xj(qe)}}]:[],...bj(qe)?[{label:Jd(qe)?`Only on ${qe.page===Ni()?"this":"its own"} page`:"Show on all pages",icon:"expand",onSelect:()=>yj(qe)}]:[],...qe.snapshot&&q.user&&(q.user.verified||li?.guests&&qe.comments[0]?.author.id===q.user.id)?[{label:"Remove snapshot",icon:"trash",destructive:!0,onSelect:()=>{z2().then(Qe=>Qe.confirmRemove(qe,j2))}}]:[],...a?[{label:"Open in Design",icon:"design",onSelect:()=>{qA(qe)}}]:[],...Ee&&/^(https?:|vscode:|cursor:)/.test(Ee)?[{label:"Open source",icon:"code",onSelect:()=>window.open(Ee,"_blank","noopener,noreferrer")}]:[],me("Copy link",()=>{let Qe=new URL(qe.page,location.origin);return Qe.searchParams.set("comment",qe.id),Qe.href}),me("Copy feedback",()=>[`Repository: ${e.repo}`,`Branch: ${e.branch}`,`Page: ${new URL(qe.page,location.origin).href}`,`Target: ${qe.anchor.selector||"Page position"}`,...qe.anchor.source?[`Source: ${qe.anchor.source}`]:[],...qe.anchor.text?[`Element text: ${qe.anchor.text}`]:[],"",...qe.comments.map(Qe=>`${Qe.author.name}: ${Qe.body}`)].join(`
3026
+ `)),me("Copy selector",()=>qe.anchor.selector)]);nt.append(ze),c&&(Se=Oe(qe.tags?.length?"Manage tags":"Add tag",()=>{},"icon thread-tag-action","tag"),nt.append(Se));let Be=Oe(qe.resolved?"Reopen comment":"Resolve comment",()=>kx(qe,nx(qe.anchor)),"icon","check");Be.disabled=!Zm(),nt.append(Be)}if(nt.append(je?Oe("Close sidebar",()=>{Or(),wn(!1)},"icon","close"):Oe(L?"Close account":"Close comment",Or,"icon","close")),je&&an.append(Oe("Back to comments",Or,"icon thread-back","chevron"),HA(w("strong","thread-title"),qe?.comments[0]?.body??"")),an.append(nt),qe||L||je?Ke.append(an):Ke.append(Oe("Close comment",Or,"draft-close icon","close")),Di)Ke.append(JN());else if(L){let me=w("form","account");if(q.user){Ye??={name:q.user.name,avatarUrl:q.user.avatarUrl??"",accentColor:q.user.accentColor??Jx};let ne=Ye,Ee=yr({...q.user,...ne}),ze=w("div","account-summary"),Be=w("span","account-status");q.user.verified?(Be.append(document.createTextNode("Connected with ")),q.user.id.startsWith("google:")&&Be.append(Iv()),Be.append(document.createTextNode(q.user.id.startsWith("google:")?"Google":"GitHub"))):Be.textContent="Guest account";let Qe=Oe("Update profile photo",()=>Kt.click(),"account-avatar-button");Qe.replaceChildren(Ee),ze.append(Qe,w("h2","","Your profile"),Be),me.append(ze);let Nt=w("label","account-name-label","Display name"),xt=w("input");xt.value=ne.name,xt.name="name",xt.autocomplete="name",xt.required=!0,xt.maxLength=60,xt.dataset.focusKey="profile-name",xt.addEventListener("input",()=>{ne.name=xt.value,Mn(ne)}),xt.addEventListener("blur",()=>{Mn(ne,!0)}),Nt.append(xt);let Kt=w("input");Kt.type="file",Kt.accept="image/png,image/jpeg,image/webp",Kt.hidden=!0,Kt.setAttribute("aria-label","Choose profile photo"),Kt.addEventListener("change",()=>Ot(async()=>{let vt=Kt.files?.[0];if(!vt)return;if(vt.size>10*1024*1024)throw new Error("Choose a photo under 10 MB.");let Vt=await createImageBitmap(vt),jt=document.createElement("canvas");jt.width=jt.height=128;let Rn=jt.getContext("2d"),Yo=Math.min(Vt.width,Vt.height);Rn.drawImage(Vt,(Vt.width-Yo)/2,(Vt.height-Yo)/2,Yo,Yo,0,0,128,128),Vt.close();let ha=.8;do ne.avatarUrl=jt.toDataURL("image/jpeg",ha),ha-=.15;while(ne.avatarUrl.length>12e3&&ha>.1);if(ne.avatarUrl.length>12e3)throw new Error("Choose a smaller photo.");Mn(ne,!0),gr()})),ze.append(Kt);let Bi=u6(ne.accentColor,vt=>{ne.accentColor=vt,Xu(Ee,vt),Mn(ne)});if($e=Bi.destroy,me.append(Nt,Bi.element),e.onboarding){let vt=e.onboarding;me.append(ox(w("section","onboarding-panel"),Promise.resolve().then(()=>(e0(),Jy)).then(({onboardingPanel:Vt})=>Vt(q,vt))))}else me.append(YN()),J&&me.append(XN()),me.append(gA());if(q.user?.verified&&!e.onboarding?.code&&!e.onboarding?.claimKey&&!e.onboarding?.invite){let vt=w("div");me.append(vt),Promise.resolve().then(()=>(e0(),Jy)).then(({projectManagement:Vt})=>{vt.isConnected&&vt.replaceWith(Vt(q,e.onboarding?.workspace,jt=>{if(jt)D=null,Le.replace([],Le.revision),me.querySelector(".account-usage")?.remove();else{let Rn=e.onboarding?.workspace?`usage?workspace=${encodeURIComponent(e.onboarding.workspace)}`:"usage";me.querySelector(".account-usage")?.replaceWith(gA(Rn)),fr().catch(()=>{})}}))})}me.addEventListener("submit",vt=>{vt.preventDefault(),Mn(ne,!0)});let mi=w("div","account-session");if(mi.append(Oe("Sign out",()=>Ot(async()=>{if(Le.busy||Q){Dn("Wait for your changes to save.");return}clearTimeout(ot),pt=null;let vt=q.logout();sl(),Ye=null,Zt=null,$t();try{await vt}finally{sl(),Ot(fr),$t()}}),"secondary")),fA()){let vt=Oe("API tokens",QN,"account-sites-summary account-tokens-entry");vt.removeAttribute("title"),vt.replaceChildren(w("span","","API tokens"),yt("chevron")),vt.dataset.focusKey="account-tokens";let Vt=w("div","account-sites");Vt.append(vt),me.append(Vt)}me.append(mi),!q.user.verified&&ht&&me.append(K()),!q.user.verified&&Ze&&me.append(Oe("Sign in with GitHub",()=>Ot(()=>Sx()),"primary"))}else{if(me.append(w("h2","",e.onboarding?"Set up inline feedback":"Leave comments")),e.onboarding?.inProject){me.append(w("p","","Add the sites where you want to leave feedback. One site per line."));let ne=w("label","account-name-label","Production and preview sites"),Ee=w("textarea");Ee.rows=2,Ee.placeholder="https://your-site.com",Ee.value=Ct,Ee.dataset.focusKey="setup-sites",Ee.addEventListener("input",()=>{Ct=Ee.value}),ne.append(Ee),me.append(ne);let ze=Oe("Connect",()=>Ot(async()=>{if(!gt){gt=!0,ze.disabled=!0;try{let Be=await dM(e,Y.signal,cM(Ct,location.origin));if(W)return;sM(e,Be),e={...e,project:Be.project,repo:Be.repo,onboarding:void 0},q=new tc(e),q.save(Be),L=!1,Ye=null,Ln=null,await Iu(),$t(),Dn("Inline feedback is connected. Select an element to comment.")}finally{gt=!1,W||$t()}}}),"primary");ze.disabled=gt,me.append(ze)}if(Et){let ne=w("label","account-name-label","Your name"),Ee=w("input");Ee.name="name",Ee.autocomplete="name",Ee.placeholder="Your name",Ee.required=!0,Ee.maxLength=60,Ee.value=da,Ee.dataset.focusKey="account-name",Ee.addEventListener("input",()=>da=Ee.value),ne.append(Ee),me.append(ne);let ze=Oe("Continue",()=>{},"primary");ze.type="submit",ze.disabled=Q,Q&&ze.setAttribute("aria-busy","true"),me.append(ze)}Et&&(ht||Ze)&&me.append(w("div","account-divider","or")),ht&&me.append(K()),Ze&&me.append(Oe("Continue with GitHub",()=>Ot(()=>Sx()),"secondary")),me.addEventListener("submit",ne=>{ne.preventDefault(),Ot(async()=>{await ej(async()=>{await q.guest(da),L=!1}),await PA()})})}Ke.append(me)}else if(j)Ke.append(Ax(null));else if(qe){if(Ce(qe)){if(!Ci(qe.anchor)){let Ee=w("div","notice thread-navigation thread-anchor-status");Ee.setAttribute("role","status"),Ee.append(w("p","","Element not found on this page. The conversation is still available."),ku(4,qe)),Ke.append(Ee)}}else{let Ee=w("div","notice thread-navigation");Ee.setAttribute("role","status"),Ee.append(w("p","",X?.id===qe.id&&X.rejected?"Navigation could not be completed. The conversation is still available.":X?.pending?"Opening this comment\u2019s page\u2026":"The app is on a different page. The conversation is still available."));let ze=w("a","thread-destination","Open destination");ze.dataset.focusKey="thread-destination",ze.href=new URL(qe.page,location.origin).href,ze.title=ze.href,ze.setAttribute("aria-label",`Open destination: ${ze.href}`),ze.setAttribute("aria-disabled",String(!!X?.pending)),ze.addEventListener("click",Be=>{Be.preventDefault(),X?.pending||os(qe)}),Ee.append(ze),qe.snapshot&&Ee.append(ku(2,qe)),Ke.append(Ee)}let me=w("div","messages");for(let Ee of qe.comments)me.append(fj(Ee,qe));Ke.append(me);let ne=()=>me.dataset.fade=`${me.scrollTop>2?"top":""} ${me.scrollTop+me.clientHeight<me.scrollHeight-2?"bottom":""}`;if(me.addEventListener("scroll",ne,{passive:!0}),requestAnimationFrame(ne),qe.snapshot&&me.querySelector(".message .message-text")?.after(ku(1,qe)),c){let Ee=$A(qe.tags??[],Qe=>NA(qe,{tag:Qe}),Qe=>NA(qe,{untag:Qe}),Se);Ee.classList.add("thread-tags");let ze=me.querySelector(".message"),Be=ze?.querySelector(".message-text, .edit-actions");Be?Be.after(Ee):ze?.append(Ee)}Ke.append(Ax(qe))}else Ke.append(w("div","empty","This comment is no longer available."));if(zt.append(Ke),L&&lt&&!En()&&(zt.animate([{opacity:0},{opacity:1}],{duration:250,easing:"ease-out"}),Ke.animate([{opacity:0,transform:"translateY(8px) scale(.97)"},{opacity:1,transform:"none"}],{duration:250,easing:"cubic-bezier(.22,1,.36,1)"})),!L&&!je){let me=w("div","comment-drag-handle");me.setAttribute("aria-hidden","true"),Ke.prepend(me),Zh(Ke,me,ne=>{Ln&&yc.set(Ln,ne),fi()},Y.signal,()=>ca.stop())}if(fi(),je){lt&&(Jm=!1,eg(!0,1200));let me=ne=>{Jm=ne,eg(ne)};for(let ne of[an,Ke.querySelector(".messages")])ne?.addEventListener("pointermove",()=>Jm||me(!0)),ne?.addEventListener("pointerleave",()=>me(!1)),ne?.addEventListener("focusin",Ee=>{Ee.target.matches(":focus-visible")&&me(!0)}),ne?.addEventListener("focusout",()=>me(!1));Ke.addEventListener("click",()=>eg(!1,600)),Ke.addEventListener("pointerover",ne=>ne.target.closest(".design-card-target")?.removeAttribute("title"))}if(!L&&!En()){let me=Ke.getBoundingClientRect(),ne=wc??(lt?null:tt);je?lt&&Ke.animate([{opacity:0,transform:We?"none":"translateX(24px)"},{opacity:1,transform:"none"}],{duration:250,easing:"cubic-bezier(.22,1,.36,1)"}):ne&&(wc||Math.abs(ne.height-me.height)>1||Math.abs(ne.width-me.width)>1)?Ke.animate([{left:`${ne.left}px`,top:`${ne.top}px`,width:`${ne.width}px`,height:`${ne.height}px`,opacity:1},{left:`${me.left}px`,top:`${me.top}px`,width:`${me.width}px`,height:`${me.height}px`,opacity:1}],{duration:250,easing:"cubic-bezier(.22,1,.36,1)"}):lt&&Ke.animate([{opacity:0,transform:"translateY(6px) scale(.97)"},{opacity:1,transform:"none"}],{duration:250,easing:"cubic-bezier(.22,1,.36,1)"});for(let Ee of Ke.querySelectorAll("[data-comment]")){let ze=Ee.querySelector(".message-reaction"),Be=en.get(Ee.dataset.comment),Qe=Ee.dataset.comment;ze&&Be&&Be.dataset.reactions!==ze.dataset.reactions&&Pu.set(Qe,{from:Be,to:ze.dataset.reactions,started:performance.now()});let Nt=Pu.get(Qe),xt=Nt?performance.now()-Nt.started:470;if(ze&&Nt&&xt<470&&Nt.to===ze.dataset.reactions){let Kt=w("span","reaction-leaving");Kt.setAttribute("aria-hidden","true");for(let vt of Nt.from.children){if(vt.classList.contains("reaction-leaving"))continue;let Vt=vt.cloneNode(!0);Kt.append(Vt)}let Bi=[...ze.children];ze.append(Kt);let mi=Kt.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"scale(.2, .35)"}],{duration:110,easing:"ease-in",fill:"forwards"});mi.currentTime=xt,mi.finished.then(()=>Kt.remove()).catch(()=>Kt.remove());for(let vt of Bi){let Vt=vt.animate([{opacity:0,transform:"scale(.25, .4)",offset:0},{opacity:1,transform:"scale(1.16, .92)",offset:.38},{opacity:1,transform:"scale(.95, 1.07)",offset:.6},{opacity:1,transform:"scale(1.025, .985)",offset:.8},{opacity:1,transform:"scale(1)",offset:1}],{duration:380,delay:90,easing:"ease-in-out",fill:"backwards"});Vt.currentTime=xt,Vt.finished.then(()=>{Pu.get(Qe)===Nt&&Pu.delete(Qe)}).catch(()=>{})}}}}wc=null;let Ue=Ke.querySelector(".messages");if(Ue&&(Ue.scrollTop=ae),L&&!lt&&(Ke.scrollTop=ge),M){let me=Ke.querySelector(`[data-focus-key="${M}"]`);me&&(me.focus({preventScroll:!0}),P!=null&&me.setSelectionRange(P,P))}}let gj,Qm=0,Mx=!1,Jm=!1,BA=0,Bu="",Vu="",Uu="",Cx=0;function qu(f=Vu||Uu){if(clearTimeout(Cx),f!==Bu){Bu=f;for(let k of bt.querySelectorAll(".pin"))k.classList.toggle("hot",k.dataset.thread===f);dl()}}function eg(f,k=0){clearTimeout(BA),Mx=f,dl(),k&&(BA=window.setTimeout(()=>eg(Jm),k))}function fi(){let f=Math.min(window.innerHeight,window.visualViewport?.height??window.innerHeight),k=zt.firstElementChild;if(!k||L)return;let M=$.find(nt=>nt.id===D),P=k.querySelector(".thread-anchor-status");if(P&&(P.hidden=!!(M&&Ce(M)&&Ci(M.anchor))),zt.classList.contains("thread-pane")){let nt=Qm;Qm=performance.now()+500;let qe=()=>{dl(),performance.now()<Qm?requestAnimationFrame(qe):Qm=0};nt||qe();return}if(R&&k.querySelector("textarea:focus")){let qe=window.visualViewport?.offsetTop??0;k.style.maxHeight=`${Math.max(0,f-24)}px`;let Se=NR(window.innerWidth,f,qe,k.offsetWidth,k.offsetHeight);ca.place(Ln,k,Se.x,Se.y,!0),k.style.bottom="auto",k.style.transformOrigin="bottom center",pa();return}let ee=Jt?Math.min(f,_u().bottom)-12:f-92;k.style.maxHeight=`${ee-12}px`,(gj??=new ResizeObserver(()=>fi())).observe(k);let ae=j??(M&&Ce(M)?M.anchor:null),ge,re,be=sr?.id===D?sr:ae?(()=>{let nt=ga(ae);if(!nt.attached)return nl===Ln?!1:null;nl=Ln,ge=nt.width>16&&nt.height>16?{left:nt.x,top:nt.y,right:nt.x+nt.width,bottom:nt.y+nt.height}:(j?YA:mo.test(M?.comments[0]?.body??""))?nt.component:void 0;let qe=D&&bt.querySelector(`[data-thread="${CSS.escape(D)}"]`);return re=qe?KA(qe):void 0,qe?_x(qe,nt):nt})():null;if(be===!1)return j&&Do.trim()&&(_o={anchor:j,text:Do}),Or();let je=sr?.id===D,We=()=>{k.style.transformOrigin=!be||be.x<k.offsetLeft+k.offsetWidth/2?"top left":"top right"},lt=!je&&Ln&&yc.get(Ln);if(lt){let nt=Pa(lt,k.offsetWidth,k.offsetHeight,Un.clientWidth,f);ca.place(Ln,k,nt.x,nt.y,je),We(),pa();return}let tt=(window.innerWidth-354)/2,en=f-450,Bt=C&&!R?396:12,Ke=k.offsetWidth,an=k.offsetHeight;if(be&&({x:tt,y:en}=GS(re?.width&&!je?re:jR(be),Ke,an,{left:12,top:12,right:window.innerWidth-Bt,bottom:ee})),ge&&!R&&!je){let nt=ee-ge.bottom-14,qe=ge.top-26;if(ge.right+14+Ke<=window.innerWidth-Bt)[tt,en]=[ge.right+14,ge.top];else if(ge.left-14-Ke>=12)[tt,en]=[ge.left-14-Ke,ge.top];else if(Math.max(nt,qe)>=Math.min(an,200)){let Se=nt>=an||nt>=qe?nt:qe;k.style.maxHeight=`${Se}px`,[tt,en]=[ge.left,Se===nt?ge.bottom+14:ge.top-14-Math.min(an,Se)]}}ca.place(Ln,k,Math.max(12,Math.min(tt,window.innerWidth-k.offsetWidth-Bt)),Math.max(12,Math.min(en,ee-k.offsetHeight)),je),We(),pa()}function ma(){ye(),$r(),clearTimeout(Io),Ye=null,U=!1;let f=R;f&&!C&&wn(!0),Io=0,!(W||f&&!C)&&(L=!0,$t(),hj())}function hj(){queueMicrotask(()=>{if(!L)return;let f=R,k=f?zt.querySelector(".account-dialog"):zt.querySelector("input,button");f&&k&&(k.tabIndex=-1),k?.focus({preventScroll:!0})})}let VA=Ci,ga=pH;function Lx(f,k){return Kx(f,k).find(M=>M!==st&&!st.contains(M))??null}function tg(f){let k=Xn();return!!f&&f!==$m()&&f!==k.body&&(k===document&&e.pickRoots?[y,...e.pickRoots()]:[k.body]).some(M=>M.contains(f))}function ng(f,k){return e.sourceUrl?.(f,e.branch)??`https://github.com/${e.repo}/blob/${encodeURIComponent(e.branch)}/${f.split("/").map(encodeURIComponent).join("/")}${k?`#L${k}`:""}`}function UA(){return Pe?Promise.resolve(Pe):(Ne||(Ne=Promise.resolve().then(()=>(_N(),LN)).then(({createDesignMode:f})=>{let k=f({root:it,panelRoot:he,host:st,shortcutHelp:kA,visibility:o.visibility,keys:i,reservedKey:M=>Object.values(o).some(P=>Bo(M,P)),design:e.design,sourceHref:ng,page:Ni,bounds:M=>Jt&&V0(M)?_u():void 0,flip(){if(!z||!C||le||$i)return;let M=he.getBoundingClientRect();rA({x:Un.clientWidth-M.right,y:M.top}),B=!0,he.animate([{transform:`translateX(${M.left-he.getBoundingClientRect().left}px)`},{}],{duration:320,easing:"cubic-bezier(.22,1,.36,1)"})},targetAt(M,P){let ee=Lx(M,P);return tg(ee)?ee:null},onComment(M,P){pe=!1,C&&!Km()&&wn(!1),Cc(!1),Do="",lr=P??"",_r=[];let ee=Pt(M),ae={x:(Math.max(ee.left,0)+Math.min(ee.right,innerWidth))/2,y:(Math.max(ee.top,0)+Math.min(ee.bottom,innerHeight))/2};Rx(M,ae,ae,!0)},onExit(){ie=!1,Pe?.setReturnAction(null),Ac(),Ho(),bA()}});return Promise.race([k.ready,new Promise(M=>setTimeout(M,2e3))]).then(()=>W?(k.destroy(),null):(Pe=k,k.setActive(ie),k))}).catch(()=>(ie=!1,Ac(),Ho(),null)).finally(()=>{Ne=null})),Ne)}async function qA(f){if(!a||W)return;if(!De(f)){let ee=new URL(f.page,location.origin);ee.searchParams.set("comment",f.id),ee.searchParams.set("comment-view","design"),await Hx(ee);return}if(!Ce(f)){Dn("Design is unavailable until this comment\u2019s page is reached.");return}let k=Ci(f.anchor);if(!k||!tg(k)||!ga(f.anchor).attached){Dn("Design is unavailable: this comment\u2019s element isn\u2019t visible on this page.");return}let M=C;Cc(!0),Te=M;let P=await UA();if(!(!P||!ie||W||D!==f.id||!De(f))){if(!k.isConnected||Ci(f.anchor)!==k){Cc(!1),Dn("Design is unavailable: this comment\u2019s element has changed.");return}P.select(k),P.setReturnAction({label:"Back to comment",run:()=>Cc(!1)})}}function KA(f){let k=f.parentElement;if(!k.matches(".pin-stack"))return f.getBoundingClientRect();let M=k.getBoundingClientRect(),P=Math.min(k.children.length,6)*38+4,ee=k.dataset.pointer==="right"?M.right-P:M.left,ae=k.hasAttribute("data-below")?M.top:M.bottom-38;return{left:ee,right:ee+P,top:ae,bottom:ae+38,width:P}}function _x(f,k){if(!f.closest(".pin-stack")||f.dataset.dragging)return k;let M=f.getBoundingClientRect();return{x:M.left+(f.dataset.pointer==="right"?25:9),y:M.top+28}}function Ku(f){return!!q.user&&(q.user.verified||f.comments[0]?.author.id===q.user.id)}let bj=f=>Pn||Ku(f);function yj(f){if(!q.user&&(!Et||!da.trim()))return ma();let k=Jd(f)?"page":"all";Ot(async()=>{await ut(Ie(f.id,M=>({...M,scope:k})),async M=>{q.user||await q.guest(da),await q.request(`threads/${M(f.id)}`,"PATCH",{scope:k})}),Dn(`Shown on ${k==="all"?"all pages":"its own page"}`)})}function $r(){jn++,wt?.cancel()}async function xj(f){$r();let k=jn,M=we;if(Q||!Ku(f))return;let P=await Promise.resolve().then(()=>(RN(),DN)).catch(()=>null);if(!P){Dn("Moving is unavailable. Try again.");return}if(W||k!==jn||M!==we||!Ku(f))return;let ee=bt.querySelector(`.pin[data-thread="${CSS.escape(f.id)}"]`),ae=ga(f.anchor);if(!De(f)||!ae.attached||!ee){Dn("This pin isn\u2019t visible on this page. Open its page before moving it.");return}let ge=_x(ee,ae);Gt=f.id,xc=!0,Hi(),ca.stop(),bt.append(ee),Object.assign(ee.style,{position:"fixed",margin:"0",left:`${ge.x}px`,top:`${ge.y}px`}),wt=P.startPinMove({root:it,pin:ee,point:ge,bounds:CA,preview(re){ee.dataset.pointer=rg(re,window.innerWidth),ee.style.left=`${re.x}px`,ee.style.top=`${re.y}px`,sr={id:f.id,...re},fi()},finish(re){if(wt=null,Gt=null,sr=null,fa="",mr(),fi(),zt.querySelector('summary[aria-label="Comment actions"]')?.focus({preventScroll:!0}),!re||W||!De(f)||!Ku(f))return;let be=Dx(re.x,re.y);if(!be){Dn("Pin unchanged. Choose an element on this page.");return}let je=oT(Yf(be,$m(),e.anchorTarget),re,{x:re.x+ae.width,y:re.y+ae.height},e.source);je.unstacked=!0,yc.delete(f.id),Ot(async()=>{await ut(Ie(f.id,We=>({...We,anchor:je})),async We=>{await q.request(`threads/${We(f.id)}`,"PATCH",{anchor:je})}),Dn("Pin moved")})}})}function Dx(f,k){let M=Lx(f,k);if(!tg(M))return null;let P=M.closest("button,a,input,textarea,select,[role=button],[role=link],[data-comment-anchor],h1,h2,h3,h4,h5,h6,p,li,figure,svg,canvas,img,video")??M,ee=P.closest("button,a,[role=button],[role=link]");return tg(ee)?ee:P}function dl(){let f=!U&&!!lx(),k=f?D:C&&!j&&!lx()&&he.querySelector(`.list [data-thread="${CSS.escape(Bu)}"]`)&&Bu,M=k&&$.find(ae=>ae.id===k),P=M&&Ce(M)&&ga(M.anchor),ee=P&&P.attached&&(P.width&&P.height?{left:P.x,top:P.y,right:P.x+P.width,bottom:P.y+P.height}:P.component);if(zi.toggleAttribute("data-thread",!!ee),bt.toggleAttribute("data-quiet",!!ee&&f),bt.toggleAttribute("data-outlined",!!ee&&f&&Mx),ee){let ae=VA(M.anchor);GA(ee,P.width&&P.height?null:ae,Jt&&!!ae&&V0(ae)),f&&!Mx&&(zi.style.opacity="0");return}if(!U&&!j||Pi||j&&j.width>0&&j.height>0){zi.style.opacity="0",!U&&!j&&(Ko=null,Qa=null);return}if(j&&(Ko=VA(j)),U&&Qa&&(Ko=Dx(Qa.x,Qa.y)),U&&Ko&&(Ko=Yf(Ko,$m(),e.anchorTarget)),!Ko?.isConnected){zi.style.opacity="0";return}GA(Pt(Ko),Ko,Jt&&V0(Ko))}let IA=null;function GA(f,k,M){IA=k,zi.style.opacity=ug(zi,f,k,M?_u():void 0)?"1":"0"}function FA(){Rm||(Rm=requestAnimationFrame(()=>{Rm=0,dl()}))}function $t(){if(W)return;if(st.classList.toggle("design-active",ie),L&&!C){Mr(window.innerWidth,window.innerHeight)?(L=!1,ma()):wn(!0);return}ji();let f=!!j&&!L&&Mr(window.innerWidth,window.innerHeight);st.classList.toggle("mobile-composing",f),he.inert=R?!C||L:z?!C:L,(D||j||U||G||go||L)&&Hi(!0),st.toggleAttribute("data-comments-hidden",go),zt.style.display=go&&!L?"none":"",ui.hidden=!U,dl(),B2.replaceChildren(),Ho(),Xe.inert=ie,mr(),pi(),gr();let k=he.querySelector(".panel");k&&(k.inert=ie,k.setAttribute("aria-hidden",String(ie)),k.hidden=ie),ie&&Pe?.mountPanel(he);let M=he.querySelector(".design-inspector__heading");M&&!M.dataset.drag&&(M.dataset.drag="",cA(M))}let Pi=null,rs=null;ui.addEventListener("pointerdown",f=>{if(f.button!==0)return;f.preventDefault(),f.stopPropagation();let k=Dx(f.clientX,f.clientY);k&&(Ko=k,Qa=null,zi.style.opacity="0",Pi={x:f.clientX,y:f.clientY,element:k,pointerId:f.pointerId},ui.setPointerCapture(f.pointerId),rs=w("div","selection"),it.append(rs))}),ui.addEventListener("pointermove",f=>{if(!Pi||!rs){Qa={x:f.clientX,y:f.clientY},FA();return}Object.assign(rs.style,{left:`${Math.min(Pi.x,f.clientX)}px`,top:`${Math.min(Pi.y,f.clientY)}px`,width:`${Math.abs(Pi.x-f.clientX)}px`,height:`${Math.abs(Pi.y-f.clientY)}px`})});let YA=!1;function Rx(f,k,M=k,P=!1){if(ye(),Ou(),YA=P,Hi(),f=Yf(f,$m(),e.anchorTarget),j=oT(f,k,M,e.source),Jt&&!es){let ee=y.getBoundingClientRect(),ae=Ro*pr();j.pageX=(Math.min(k.x,M.x)-ee.left)/ae+y.scrollLeft,j.pageY=(Math.min(k.y,M.y)-ee.top)/ae+y.scrollTop}Ko=f,U=!1,D=null,L=!1,Ri=null,Fe="",$t(),zt.querySelector('[data-focus-key="body"]')?.focus({preventScroll:!0}),fi()}ui.addEventListener("pointerup",f=>{if(!Pi)return;let k=Pi;rs?.remove(),rs=null,Pi=null,Rx(k.element,k,{x:f.clientX,y:f.clientY})}),ui.addEventListener("pointerleave",()=>{Pi||j||(Qa=null,Ko=null,zi.style.opacity="0")}),ui.addEventListener("pointercancel",()=>{Pi=null,rs?.remove(),rs=null,Qa=null,Ko=null,zi.style.opacity="0"});function Fo(){if(Gt&&!$.some(k=>k.id===Gt&&De(k))&&$r(),Cm||W||document.hidden)return;let f=Ni();!ll&&(go&&!L||!j&&!D&&!U&&(G||!$.some(k=>(k.page===f||Jd(k))&&!k.resolved)))||(Cm=requestAnimationFrame(()=>{Cm=0,mr(),fi(),pa(),dl()}))}let XA=f=>{if(U0)return;xc=!0,Hi();let k=f.target;if(k===st||!k||k instanceof Node&&k.getRootNode()===it)return;let M=k.nodeType===Node.DOCUMENT_NODE?k.scrollingElement:k;Kn(M)&&(Jt&&_n.pan&&k===document&&(Rr(),Yn?.update(cr,pr())),Gt||(bx=!0,bt.dataset.scrolling="true",clearTimeout(yx),yx=window.setTimeout(()=>{W||(fa="",mr(!0),bx=!1,delete bt.dataset.scrolling)},180)),Fo())},WA={capture:!0,passive:!0,signal:Y.signal};document.addEventListener("scroll",XA,WA),so("scroll",XA,WA);for(let f of["focusin","focusout","click"])zt.addEventListener(f,()=>requestAnimationFrame(fi),{signal:Y.signal});window.visualViewport?.addEventListener("scroll",()=>{Mr(window.innerWidth,window.innerHeight)&&(ji(),(L||j||D)&&Fo())},{signal:Y.signal}),window.visualViewport?.addEventListener("resize",()=>{Mr(window.innerWidth,window.innerHeight)&&(ji(),Fo())},{signal:Y.signal}),window.addEventListener("resize",()=>{tj(),ji(),R||Ho(),Fo()},{signal:Y.signal}),jr(it,"keydown",f=>{let k=f.composedPath()[0];if((L||R&&C)&&f.key==="Tab"){let ae=[...(L?zt:ie?it.querySelector(".design-inspector")??it:it).querySelectorAll("button:not(:disabled),input:not(:disabled):not([type=hidden]),select:not(:disabled),textarea:not(:disabled),summary,a[href],[tabindex]")].filter(be=>be.tabIndex>=0&&be.getClientRects().length>0&&!be.closest("[inert]")&&(L||ie||!R||!!be.closest(".panel,.toolbar"))),ge=ae[0],re=ae.at(-1);f.shiftKey&&(it.activeElement===ge||!ae.includes(it.activeElement))?(f.preventDefault(),re?.focus()):!f.shiftKey&&(it.activeElement===re||!ae.includes(it.activeElement))&&(f.preventDefault(),ge?.focus())}let M=document.activeElement;for(;M?.shadowRoot?.activeElement;)M=M.shadowRoot.activeElement;M===as()&&(M=Xn().activeElement);let P=br(k)||br(M)||f.isComposing;if(f.key==="Escape"){if(ie||f.defaultPrevented&&!f.composedPath().includes(st)||go&&!L)return;U||j||D||L?(f.preventDefault(),Or()):C&&(f.preventDefault(),wn(!1));return}if(!P){if(te&&Bo(f,o.restore)){f.preventDefault(),EA();return}e.onboarding||(Bo(f,o.comment)?(f.preventDefault(),Mc(!I)):Bo(f,o.browse)?(f.preventDefault(),Mc(!1)):a&&Bo(f,o.design)?(f.preventDefault(),Cc(!ie)):Bo(f,o.comments)?(f.preventDefault(),wn(!C)):!ie&&Bo(f,o.visibility)&&(f.preventDefault(),wA(!go)))}},{signal:Y.signal}),jr(it,"pointermove",f=>{f.pointerType!=="touch"&&(is=Vi(f),bt.dataset.size&&(fx||=requestAnimationFrame(mx)))},{passive:!0,signal:Y.signal}),Un.addEventListener("pointerleave",()=>{is=null,mx()},{signal:Y.signal}),jr(it,"pointerdown",f=>{let k=f.composedPath(),M=k.some(P=>P instanceof Element&&P.getRootNode()===it&&P.matches("button,input,textarea,summary,[role=menu],[role=listbox],.emoji-menu,.emoji-keyboard,.floating-notice"));f.button===0&&(D||j)&&!go&&!(j&&Mr(window.innerWidth,window.innerHeight))&&!L&&!k.includes(zt)&&!k.includes(Xe)&&!k.includes(bt)&&!(U&&k.includes(ui))&&!M&&(j&&Do.trim()&&(_o={anchor:j,text:Do}),Or());for(let P of it.querySelectorAll(".comment-menu[open]"))f.composedPath().includes(P)||(P.open=!1)},{signal:Y.signal});let ZA=new ResizeObserver(()=>{Rr(),Fo()});ZA.observe(y);let Hc=0,og=new MutationObserver(f=>{if(f.some(k=>k.target===document.body)&&Rr(),j||D||U||ll)return Fo();Hc||(Hc=window.setTimeout(()=>{Hc=0,Fo()},80))});og.observe(document.body,{childList:!0,subtree:!0,characterData:!0}),pg(st,()=>zi.style.opacity!=="0"?[IA]:[],FA,Y.signal),zt.addEventListener("pointerdown",f=>{L&&f.target===zt&&Or()});function zc(){W||Ni()===N2||(N2=Ni(),ol?.resetDesignPreviews(),Pe?.clearSelection(),Pe?.setReturnAction(null),_o=null,D=X?.id===D?D:null,j=null,$t())}let QA=()=>setTimeout(()=>(zc(),zx()));window.addEventListener("popstate",QA,{signal:Y.signal}),window.navigation?.addEventListener("navigatesuccess",QA,{signal:Y.signal});async function Hx(f){let k=as()?.contentWindow;if(!k&&!e.navigate||f.origin!==location.origin)return location.assign(f);let M=f.searchParams.get("comment");if(!M)return;ye(),fe.delete(M);let P={id:M,inspect:f.searchParams.get("comment-view")==="design",pending:!0,rejected:!1};X=P,D===M&&gr();try{if(k){let ee=e.frame?.resolveUrl,ae=ee?ee(f,k.location):f;if(ae?.origin!==location.origin)throw new Error;ae.searchParams.delete("comment"),ae.searchParams.delete("comment-view"),k.location.assign(ae.href)}else await e.navigate(f)}catch{P.rejected=!0}W||X!==P||(P.pending=!1,zc(),await JA(P))}let ig=null;async function JA(f){let k=$.find(P=>P.id===f.id);if(!k||ig===f||f.opened)return;ig=f;for(let P=0;P<5e3&&Ce(k)&&!Ci(k.anchor)&&(await new Promise(ee=>setTimeout(ee,100)),!(W||X!==f));P+=100);if(ig===f&&(ig=null),W||X!==f||!$.some(P=>P.id===k.id))return;let M=new URL(location.href);M.searchParams.get("comment")===f.id&&(M.searchParams.delete("comment"),M.searchParams.delete("comment-view"),history.replaceState(history.state,"",M)),zc(),f.opened=!0,C||wn(!0),os(k,!0),f.inspect&&Ce(k)&&qA(k)}async function zx(){let f=new URL(location.href),k=f.searchParams.get("comment");if(k&&fe.has(k)){f.searchParams.delete("comment"),f.searchParams.delete("comment-view"),history.replaceState(history.state,"",f);return}let M=$.find(P=>P.id===k);!M||X?.pending||(X?.id!==M.id&&(ye(),X={id:M.id,inspect:f.searchParams.get("comment-view")==="design",pending:!1,rejected:!1}),await JA(X))}function Ox(){let f=new tc(e);return f.token===q.token||q.transient&&!f.token?!1:(q.cancelReads(),q=f,et=!1,_e=null,Re="Connecting",ht=Ze=Et=Pn=Ve=ir=!1,j=_o=null,Do=lr="",_r=[],di.clear(),Lm.clear(),ar.length=0,pt=Ye=Zt=null,rn++,clearTimeout(ot),sl(),$t(),Ot(Iu),!0)}window.addEventListener("storage",f=>{f.storageArea===localStorage&&f.key===q.sessionKey&&f.newValue!==q.token&&Ox()},{signal:Y.signal}),window.addEventListener("focus",()=>{Ox()||zr?.wake()},{signal:Y.signal});let eM=f=>f.target.closest?.(".list .thread-item")?.dataset.thread??"",$x=()=>{clearTimeout(Cx),Cx=window.setTimeout(()=>qu(),80)};for(let[f,k]of[["pointerover",M=>(Vu=eM(M))?qu():$x()],["pointerleave",()=>{Vu="",$x()}],["focusin",M=>{Uu=eM(M),qu()}],["focusout",()=>{Uu="",$x()}],["scroll",()=>{Vu=Uu="",qu()}]])he.addEventListener(f,k,{capture:!0,signal:Y.signal});zr=uM({interval:Math.max(2e3,e.pollInterval??4e3),enabled:()=>!W&&!document.hidden&&navigator.onLine!==!1&&!e.onboarding,active:()=>C||L||U||!!j||!!D,read:async()=>(zc(),et?fr():Iu())});for(let f of["online","offline"])window.addEventListener(f,()=>zr?.wake(),{signal:Y.signal});if(st.addEventListener("click",()=>zr?.wake(!1),{signal:Y.signal}),st.addEventListener("keydown",()=>zr?.wake(!1),{signal:Y.signal}),e.isolateEvents!==!1){st.setAttribute("data-isolate",""),yC(st,Y.signal);for(let f of bC)st.addEventListener(f,k=>Ju(k,it)&&k.stopPropagation(),{passive:!0,signal:Y.signal});document.addEventListener("focusout",f=>f.relatedTarget===st&&f.stopImmediatePropagation(),{signal:Y.signal})}document.addEventListener("visibilitychange",()=>{document.hidden?(og.disconnect(),clearTimeout(Hc),Hc=0):(og.observe(document.body,{childList:!0,subtree:!0,characterData:!0}),Rr(),Fo()),(document.hidden||!Ox())&&zr?.wake()},{signal:Y.signal});let tM={destroy(){if(W)return;h&&Lu(),W=!0,Yn?.destroy(),ye(),$r(),zr?.stop(),Pe?.destroy(),ol?.resetDesignPreviews(),q.cancelReads(),Du(),$u?.(),cancelAnimationFrame(rx),clearTimeout(Hc),clearTimeout(yx),clearTimeout(gx),clearTimeout(Io),clearTimeout(vx),Pu.clear(),H2?.then(k=>k.disposeSnapshots(it)),ca.stop(),Ot(Qt),$e?.(),Tu?.(!0);for(let[k,M]of Vn)M?.(),k.getAnimations().forEach(P=>P.cancel()),k.remove();Vn.clear(),Oi?.cancel(),ns?.stop(),zu(!0),Y.abort(),clearTimeout(Am),clearTimeout(Mm),clearTimeout(H0),cancelAnimationFrame(Cm),cancelAnimationFrame(Rm),cancelAnimationFrame(fx),cancelAnimationFrame(Nm),cancelAnimationFrame(ex),Hi(),ZA.disconnect(),og.disconnect(),K0.disconnect(),K2.disconnect(),cancelAnimationFrame(q0);let f=Jt&&!ts?y.scrollTop*pr():window.scrollY/Ro;B0(),Rr(),(Jt||!z)&&(Hu(),window.scrollTo({top:f,behavior:"instant"})),J0.disconnect(),V2.unmount(),st.remove(),R2.delete(document)},comment(f){let k=()=>{if(W||!f.isConnected)return;let M=f.getBoundingClientRect();!M.width||!M.height||Rx(f,{x:M.left+M.width/2,y:M.top+M.height/2})};C&&!Km()?(wn(!1),Oi&&dr?Oi.finished.then(k).catch(()=>{}):k()):k()},open(){W||(EA(),wn(!0))},close(){W||(Or(),wn(!1))},async refresh(){await fr()}};R2.set(document,{scope:u,controller:tM}),Go=!!h||!e.onboarding&&oA.get(),ji();let Nx=e.onboarding?null:q.cached();se||=Nx!==null;let nM=Go;if(Go=!0,Nx&&Le.replace(ix(Nx)),$t(),z&&(he.style.transition="none",ua(),he.offsetWidth,he.style.transition=""),jm=nM&&go,Go=nM&&!go,Go&&(wn(!0),Go=!1,!En()))for(let f of[st,Jt?y:null])f?.animate([{opacity:0},{opacity:1}],{duration:200,easing:"cubic-bezier(0.22, 1, 0.36, 1)"});h&&(AM(h),j0=!0,v?C||wn(!0):Lu("Single-copy mode needs the app's root element in the page's HTML.")),zx();async function Iu(){let f=q,k=f.token,M;try{await f.restore()}catch{}if(W||f!==q)return;k!==f.token&&sl(),Ho(),L&&gr();let P=fr();P.catch(()=>{});try{M=await f.request("config")}catch(ae){if(W||f!==q||ae instanceof DOMException&&ae.name==="AbortError")return;let ge=JS(ae),re=_e?.detail!==ge.detail;throw _e=ge,Re="Offline",re&&$t(),ae}if(W||f!==q)return;et=!0,ht=!!M.google,Ze=M.github,Et=M.guests,Pn=M.guestResolve,Ve=!!M.private,ir=M.tokens===!0,li=M.snapshots,$t();let ee=await P;if(!(W||f!==q))return zx(),$t(),ee}e.onboarding?.inProject||Ot(()=>Iu().finally(()=>zr?.wake(!1)));let oM=()=>{US().catch(()=>{})};return"requestIdleCallback"in window?requestIdleCallback(oM,{timeout:2e3}):setTimeout(oM,200),tM}var tl=new URL(location.href),zN=tl.searchParams.get("project")||"_komo",ON=new URLSearchParams(tl.hash.slice(1)).get("invite")||void 0,KG=ON?void 0:tl.hash.slice(1)||void 0;history.replaceState(null,"",tl.pathname+tl.search);HN({endpoint:location.origin+location.pathname.replace(/\/setup$/,""),project:zN,repo:zN,branch:"shared",pageRoot:document.querySelector("main"),onboarding:{code:tl.searchParams.get("code")||void 0,workspace:tl.searchParams.get("workspace")||void 0,site:tl.searchParams.get("site")||void 0,claimKey:KG,invite:ON}});
3027
3027
  /*! Bundled license information:
3028
3028
 
3029
3029
  react/cjs/react.production.js: