From d53b2e72b3cb607b1959f599c6b1ea97d2e43a1b Mon Sep 17 00:00:00 2001 From: Ravindra Kele Date: Tue, 24 Sep 2024 14:45:33 +0530 Subject: [PATCH] Added label story --- dist/force-ui.asset.php | 2 +- dist/force-ui.js | 2 +- src/components/label/label.stories.js | 87 +++++++++++++++++++++++++++ 3 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 src/components/label/label.stories.js diff --git a/dist/force-ui.asset.php b/dist/force-ui.asset.php index 057122b8..1e1d14d5 100644 --- a/dist/force-ui.asset.php +++ b/dist/force-ui.asset.php @@ -1 +1 @@ - array('react', 'react-dom'), 'version' => '3841f7c324ffa1d4415d'); + array('react', 'react-dom'), 'version' => '2313942efbf357138322'); diff --git a/dist/force-ui.js b/dist/force-ui.js index b305fdc7..03d153fd 100644 --- a/dist/force-ui.js +++ b/dist/force-ui.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["force-ui.[file].js"]=t():e["force-ui.[file].js"]=t()}("undefined"!=typeof self?self:this,(function(){return function(){"use strict";var e={316:function(e,t,n){function r(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}n.d(t,{A:function(){return i}});var o=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,i=r((function(e){return o.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}))},20:function(e,t,n){var r=n(609),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,r)&&!l.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:i,_owner:a.current}}t.Fragment=i,t.jsx=c,t.jsxs=c},848:function(e,t,n){e.exports=n(20)},609:function(e){e.exports=window.React}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{Alert:function(){return Qh},Avatar:function(){return Ye},Badge:function(){return Be},Button:function(){return oe},ButtonGroup:function(){return ci},Checkbox:function(){return Ee},Container:function(){return Zh},EditorInput:function(){return Mw},Input:function(){return nt},Label:function(){return it},Loader:function(){return lt},Menu:function(){return Xw},ProgressBar:function(){return ct},ProgressSteps:function(){return Bw},RadioButton:function(){return De},Select:function(){return ah},Skeleton:function(){return $w},Switch:function(){return fe},Tabs:function(){return Wf},TextArea:function(){return qe},Title:function(){return st},Toaster:function(){return Kh},Tooltip:function(){return ni},toast:function(){return Eh}});var o=n(609),i=n.n(o);const s=e=>{const t=u(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),a(n,t)||c(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},a=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?a(e.slice(1),r):void 0;if(o)return o;if(0===t.validators.length)return;const i=e.join("-");return t.validators.find((({validator:e})=>e(i)))?.classGroupId},l=/^\[(.+)\]$/,c=e=>{if(l.test(e)){const t=l.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},u=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return p(Object.entries(e.classGroups),n).forEach((([e,n])=>{d(n,r,e,t)})),r},d=(e,t,n,r)=>{e.forEach((e=>{if("string"!=typeof e){if("function"==typeof e)return h(e)?void d(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach((([e,o])=>{d(o,f(t,e),n,r)}))}else(""===e?t:f(t,e)).classGroupId=n}))},f=(e,t)=>{let n=e;return t.split("-").forEach((e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)})),n},h=e=>e.isThemeGetter,p=(e,t)=>t?e.map((([e,n])=>[e,n.map((e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map((([e,n])=>[t+e,n]))):e))])):e,m=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(o(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):o(e,t)}}},g=e=>{const{separator:t,experimentalParseClassName:n}=e,r=1===t.length,o=t[0],i=t.length,s=e=>{const n=[];let s,a=0,l=0;for(let c=0;cl?s-l:void 0}};return n?e=>n({className:e,parseClassName:s}):s},v=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach((e=>{"["===e[0]?(t.push(...n.sort(),e),n=[]):n.push(e)})),t.push(...n.sort()),t},y=/\s+/;function b(){let e,t,n=0,r="";for(;n{if("string"==typeof e)return e;let t,n="";for(let r=0;rt(e)),e());return n=(e=>({cache:m(e.cacheSize),parseClassName:g(e),...s(e)}))(c),r=n.cache.get,o=n.cache.set,i=a,a(l)};function a(e){const t=r(e);if(t)return t;const i=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(y);let a="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{modifiers:l,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=n(t);let f=Boolean(d),h=r(f?u.substring(0,d):u);if(!h){if(!f){a=t+(a.length>0?" "+a:a);continue}if(h=r(u),!h){a=t+(a.length>0?" "+a:a);continue}f=!1}const p=v(l).join(":"),m=c?p+"!":p,g=m+h;if(i.includes(g))continue;i.push(g);const y=o(h,f);for(let e=0;e0?" "+a:a)}return a})(e,n);return o(e,i),i}return function(){return i(b.apply(null,arguments))}}const _=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},S=/^\[(?:([a-z-]+):)?(.+)\]$/i,E=/^\d+\/\d+$/,k=new Set(["px","full","screen"]),C=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,T=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,P=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,R=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,O=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,A=e=>M(e)||k.has(e)||E.test(e),N=e=>H(e,"length",q),M=e=>Boolean(e)&&!Number.isNaN(Number(e)),j=e=>H(e,"number",M),I=e=>Boolean(e)&&Number.isInteger(Number(e)),D=e=>e.endsWith("%")&&M(e.slice(0,-1)),L=e=>S.test(e),F=e=>C.test(e),z=new Set(["length","size","percentage"]),V=e=>H(e,z,Y),B=e=>H(e,"position",Y),W=new Set(["image","url"]),U=e=>H(e,W,G),$=e=>H(e,"",X),K=()=>!0,H=(e,t,n)=>{const r=S.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},q=e=>T.test(e)&&!P.test(e),Y=()=>!1,X=e=>R.test(e),G=e=>O.test(e),J=(Symbol.toStringTag,()=>{const e=_("colors"),t=_("spacing"),n=_("blur"),r=_("brightness"),o=_("borderColor"),i=_("borderRadius"),s=_("borderSpacing"),a=_("borderWidth"),l=_("contrast"),c=_("grayscale"),u=_("hueRotate"),d=_("invert"),f=_("gap"),h=_("gradientColorStops"),p=_("gradientColorStopPositions"),m=_("inset"),g=_("margin"),v=_("opacity"),y=_("padding"),b=_("saturate"),x=_("scale"),w=_("sepia"),S=_("skew"),E=_("space"),k=_("translate"),C=()=>["auto",L,t],T=()=>[L,t],P=()=>["",A,N],R=()=>["auto",M,L],O=()=>["","0",L],z=()=>[M,L];return{cacheSize:500,separator:":",theme:{colors:[K],spacing:[A,N],blur:["none","",F,L],brightness:z(),borderColor:[e],borderRadius:["none","","full",F,L],borderSpacing:T(),borderWidth:P(),contrast:z(),grayscale:O(),hueRotate:z(),invert:O(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[D,N],inset:C(),margin:C(),opacity:z(),padding:T(),saturate:z(),scale:z(),sepia:O(),skew:z(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",L]}],container:["container"],columns:[{columns:[F]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",L]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",I,L]}],basis:[{basis:C()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",L]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",I,L]}],"grid-cols":[{"grid-cols":[K]}],"col-start-end":[{col:["auto",{span:["full",I,L]},L]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[K]}],"row-start-end":[{row:["auto",{span:[I,L]},L]}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",L]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",L]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",L,t]}],"min-w":[{"min-w":[L,t,"min","max","fit"]}],"max-w":[{"max-w":[L,t,"none","full","min","max","fit","prose",{screen:[F]},F]}],h:[{h:[L,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[L,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[L,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[L,t,"auto","min","max","fit"]}],"font-size":[{text:["base",F,N]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",j]}],"font-family":[{font:[K]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",L]}],"line-clamp":[{"line-clamp":["none",M,j]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",A,L]}],"list-image":[{"list-image":["none",L]}],"list-style-type":[{list:["none","disc","decimal",L]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",A,N]}],"underline-offset":[{"underline-offset":["auto",A,L]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",L]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",L]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",B]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",V]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},U]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[A,L]}],"outline-w":[{outline:[A,N]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[A,N]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",F,$]}],"shadow-color":[{shadow:[K]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",F,L]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",L]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",L]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",L]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[I,L]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",L]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",L]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",L]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[A,N,j]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}),Z=w(J);function Q(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;tsvg]:h-4 [&>svg]:w-4",sm:"p-2 rounded-sm [&>svg]:h-4 [&>svg]:w-4",md:"p-2.5 rounded-md text-sm [&>svg]:h-5 [&>svg]:w-5",lg:"p-3 rounded-lg text-base [&>svg]:h-6 [&>svg]:w-6"})||void 0===r?void 0:r[c],A=null,N="";w&&(N="flex items-center justify-center gap-1","left"===S?o=w:A=w);var M=h;return i().createElement(M,re({type:d,className:te(N,"border border-solid cursor-pointer transition-colors duration-300 ease-in-out text-xs font-semibold focus:ring-2 focus:ring-toggle-on focus:ring-offset-2 disabled:text-text-disabled",O,P,R,T,p),disabled:v},C),o,m,A)};let ie=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};var se=["id","onChange","value","defaultValue","size","disabled","label","name","className"];function ae(){return ae=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ne.filter(((e,t,n)=>Boolean(e)&&n.indexOf(e)===t)).join(" ");var pe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const me=(0,o.forwardRef)((({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...l},c)=>(0,o.createElement)("svg",{ref:c,...pe,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:he("lucide",i),...l},[...a.map((([e,t])=>(0,o.createElement)(e,t))),...Array.isArray(s)?s:[s]]))),ge=(e,t)=>{const n=(0,o.forwardRef)((({className:n,...r},i)=>{return(0,o.createElement)(me,{ref:i,iconNode:t,className:he(`lucide-${s=e,s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var s}));return n.displayName=`${e}`,n},ve=ge("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),ye=ge("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var be=["id","label","defaultChecked","checked","onChange","value","indeterminate","disabled","size"];function xe(){return xe=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:h-4 [&>svg]:w-4",sm:"py-2 px-2 text-base gap-1 [&>svg]:h-4 [&>svg]:w-4",md:"py-2.5 px-2.5 text-base gap-1 [&>svg]:h-5 [&>svg]:w-5"}[l],"border-0 border-r border-border-subtle border-solid");return i().createElement(i().Fragment,null,i().createElement("button",Te({type:"button",id:v,className:te(x,"first:rounded-tl first:rounded-bl first:border-0 first:border-r first:border-border-subtle last:rounded-tr last:rounded-br last:border-0",b&&"bg-button-disabled"),onClick:function(){p&&p(r)},disabled:y},c),i().createElement("input",{type:"hidden",value:r,name:d,checked:b,onChange:p}),n))},De={Group:function(e){var t,n,r=e.children,s=e.name,a=e.value,l=e.defaultValue,c=e.by,u=void 0===c?"id":c,d=e.as,f=void 0===d?o.Fragment:d,h=e.onChange,p=e.className,m=e.style,g=void 0===m?"simple":m,v=e.disabled,y=void 0!==v&&v,b=(0,o.useMemo)((function(){return void 0!==a}),[a]),x=(0,o.useMemo)((function(){return s||"radio-button-group-".concat(ie())}),[s]),w=(t=(0,o.useState)(b?a:l),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(t,n)||function(e,t){if(e){if("string"==typeof e)return Oe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Oe(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),_=w[0],S=w[1],E=(0,o.useCallback)((function(e){var t;t="tile"===g?e:e.target.value,b||S(t),"function"==typeof h&&h(t)}),[h]),k=te("tile"===g?"inline-flex border border-border-subtle border-solid rounded shadow-sm":"flex gap-6",p),C=function(){return i().createElement(Ae.Provider,{value:{name:x,value:b?a:_,by:u,onChange:E,isControlled:b,disableAll:y,style:g}},i().Children.map(r,(function(e){return(0,o.isValidElement)(e)?e:null})))};return i().createElement(i().Fragment,null,"tile"===g?i().createElement("div",{className:k},C()):i().createElement(f,f===o.Fragment?{}:{className:p},C()))},Button:je};const Le=ge("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Fe=ge("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var ze=function(e,t){var n=e.label,r=void 0===n?"":n,o=e.size,i=void 0===o?"sm":o,s=e.className,a=void 0===s?"":s,l=e.type,c=void 0===l?"pill":l,u=e.variant,d=void 0===u?"neutral":u,f=e.icon,h=void 0===f?React.createElement(Le,null):f,p=e.disabled,m=void 0!==p&&p,g=e.onClose,v=void 0===g?function(){}:g,y=e.closable,b=void 0===y||y,x=e.onMouseDown,w=void 0===x?function(){}:x,_={neutral:"bg-badge-background-gray hover:bg-badge-hover-gray text-badge-color-gray border-badge-border-gray",red:"bg-badge-background-red hover:bg-badge-hover-red text-badge-color-red border-badge-border-red",yellow:"bg-badge-background-yellow hover:bg-badge-hover-yellow text-badge-color-yellow border-badge-border-yellow",green:"bg-badge-background-green hover:bg-badge-hover-green text-badge-color-green border-badge-border-green",blue:"bg-badge-background-sky hover:bg-badge-hover-sky text-badge-color-sky border-badge-border-sky",inverse:"bg-background-inverse hover:bg-badge-hover-inverse text-text-inverse border-background-inverse",disabled:"bg-badge-background-disabled hover:bg-badge-hover-disabled text-badge-color-disabled border-badge-border-disabled disabled cursor-not-allowed"},S="",E="group relative justify-center flex items-center [&>svg]:h-4 [&>svg]:w-4 cursor-pointer";return m?(S=_.disabled,E+=" cursor-not-allowed disabled"):S=_[d],r?React.createElement("span",{className:te("font-medium border-badge-border-gray flex gap-1 items-center justify-center border border-solid",{xs:"py-0.5 px-1 text-xs",sm:"py-1 px-1.5 text-xs",md:"py-1 px-1.5 text-sm",lg:"py-1 px-1.5 text-base"}[i],{pill:"rounded-full",rounded:"rounded"}[c],S,a),ref:t},h?React.createElement("span",{className:"justify-center flex items-center [&>svg]:h-4 [&>svg]:w-4"},h):null,r,b&&React.createElement("span",{className:E,onClick:m?null:v,onMouseDown:w,role:"button",tabIndex:0},React.createElement("span",{className:"sr-only"},"Remove ".concat(r)),React.createElement(Fe,null),React.createElement("span",{className:"absolute -inset-1"}))):null},Ve=(0,o.forwardRef)(ze);Ve.displayName="Badge";var Be=Ve,We=["id","defaultValue","value","size","className","disabled","onChange","error","onError"];function Ue(){return Ue=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:h-3 [&>svg]:w-3 text-xs",sm:"w-6 h-6 [&>svg]:h-4 [&>svg]:w-4 text-sm",md:"w-8 h-8 [&>svg]:h-5 [&>svg]:w-5 text-base",lg:"w-10 h-10 [&>svg]:h-6 [&>svg]:w-6 text-lg"})||void 0===n?void 0:n[l],v=null===(r={none:"",subtle:"border border-solid border-border-transparent-subtle",ring:"border-4 border-solid border-border-white"})||void 0===r?void 0:r[f&&"none"===u?"subtle":u],y=f?"bg-cover bg-center bg-no-repeat":"";return React.createElement("div",{className:te("rounded-full overflow-hidden flex items-center justify-center",!f&&m,g,v,y,p),style:f?{backgroundImage:"url(".concat(f,")")}:{}},h?"string"==typeof h?null==h||null===(o=h[0])||void 0===o?void 0:o.toUpperCase():h:null)};const Xe=ge("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);var Ge=["id","type","defaultValue","value","size","className","disabled","onChange","error","onError","prefix","suffix"];function Je(){return Je=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0?M(t[0].name):M(null):t=e.target.value,T||"file"===i||O(t),"function"==typeof g&&g(t))},D="border border-solid border-border-subtle bg-field-secondary-background font-normal placeholder-text-tertiary text-text-primary w-full focus:outline-none",L={sm:"px-2 py-2 rounded",md:"px-2.5 py-2.5 rounded-md",lg:"px-3 py-3 rounded-lg"},F={sm:"text-xs",md:"text-base",lg:"text-base"},z={sm:_?"pl-8":"",md:_?"pl-9":"",lg:_?"pl-10":""},V={sm:E?"pr-8":"",md:E?"pr-9":"",lg:E?"pr-10":""},B=p?"hover:border-border-disabled":"hover:border-border-strong",W="focus:border-focus-border focus:ring-2 focus:ring-toggle-on focus:ring-offset-2",U=y?"focus:border-focus-error-border focus:ring-field-color-error bg-field-background-error":"",$=y?"focus:border-focus-error-border focus:ring-field-color-error":"",K=p?"border-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled":"",H=p?"border-border-disabled cursor-not-allowed text-text-disabled file:text-text-tertiary":"",q="font-normal placeholder-text-tertiary text-text-primary pointer-events-none absolute inset-y-0 flex flex-1 items-center [&>svg]:h-4 [&>svg]:w-4",Y=p?"font-normal placeholder-text-tertiary text-icon-disabled pointer-events-none absolute inset-y-0 flex flex-1 items-center":"font-normal placeholder-text-tertiary text-field-placeholder pointer-events-none absolute inset-y-0 flex flex-1 items-center",X=N?"file:border-0 file:bg-transparent":"text-text-tertiary file:border-0 file:bg-transparent";return"file"===i?React.createElement("div",{className:te("relative flex focus-within:z-10",f)},React.createElement("input",Je({ref:t,id:C,type:"file",className:te(D,H,L[u],F[u],W,B,$,X),disabled:p,onChange:I,onInvalid:x},k)),React.createElement("div",{className:te(Y,"right-0 pr-3",{sm:"[&>svg]:h-4 [&>svg]:w-4",md:"[&>svg]:h-5 [&>svg]:w-5",lg:"[&>svg]:h-6 [&>svg]:w-6"}[u])},React.createElement(Xe,null))):React.createElement("div",{className:te("relative flex focus-within:z-10",f)},_?React.createElement("div",{className:te(q,"left-0 pl-3",F[u])},_):null,React.createElement("input",Je({ref:t,id:C,type:i,className:te(D,K,L[u],F[u],z[u],V[u],W,B,U),disabled:p,onChange:I,onInvalid:x,value:j()},k)),E?React.createElement("div",{className:te(q,"right-0 pr-3",F[u])},E):null)},tt=(0,o.forwardRef)(et);tt.displayName="Input";var nt=tt,rt=["children","tag","size","className","variant","required"];function ot(){return ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t*]:text-xs [&>svg]:h-3 [&>svg]:w-3",sm:"text-sm [&>*]:text-sm [&>svg]:h-4 [&>svg]:w-4",md:"text-base [&>*]:text-base [&>svg]:h-5 [&>svg]:w-5"}[s],{neutral:"text-field-label [&>*]:text-field-label",help:"text-field-helper [&>*]:text-field-helper",error:"text-support-error [&>*]:text-support-error",disabled:"text-field-color-disabled disabled cursor-not-allowed [&>*]:text-field-color-disabled"}[u],p,l)},h),n)},st=function(e){var t=e.title,n=void 0===t?null:t,r=e.description,o=void 0===r?null:r,i=e.icon,s=void 0===i?null:i,a=e.iconPosition,l=void 0===a?"right":a,c=e.tag,u=void 0===c?"h2":c,d=e.size,f=void 0===d?"sm":d,h=e.className,p=void 0===h?"":h,m={xs:"gap-1 [&>svg]:size-3.5",sm:"gap-1 [&>svg]:size-4",md:"gap-1.5 [&>svg]:size-5",lg:"gap-1.5 [&>svg]:size-5"};if(!n)return null;var g=function(){var e=u;return React.createElement(e,{className:te("font-semibold p-0 m-0",{xs:"text-base [&>*]:text-base gap-1",sm:"text-lg [&>*]:text-lg gap-1",md:"text-xl [&>*]:text-xl gap-1.5",lg:"text-2xl [&>*]:text-2xl gap-1.5"}[f])},n)};return o?React.createElement("div",{className:p},React.createElement("div",null,s&&"left"===l&&React.createElement("div",{className:te("flex items-center",m[f])},s,g()),s&&"right"===l&&React.createElement("div",{className:te("flex items-center",m[f])},g(),s),!s&&g()),React.createElement("span",{className:te("text-text-secondary font-normal",{xs:"text-base",sm:"text-lg",md:"text-xl",lg:"text-2xl"}[f])},o)):React.createElement("div",{className:p},s&&"left"===l&&React.createElement("div",{className:te("flex items-center",m[f])},s,g()),s&&"right"===l&&React.createElement("div",{className:te("flex items-center",m[f])},g(),s),!s&&g())};const at=ge("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);var lt=function(e){var t,n,r=e.variant,o=void 0===r?"primary":r,i=e.size,s=void 0===i?"md":i,a=e.icon,l=void 0===a?null:a,c=e.className,u=void 0===c?"":c,d=null===(t={primary:"text-brand-primary-600 bg-background-primary",secondary:"text-background-primary bg-brand-primary-600"})||void 0===t?void 0:t[o],f=null===(n={sm:"[&>svg]:h-4 [&>svg]:w-4",md:"[&>svg]:h-5 [&>svg]:w-5",lg:"[&>svg]:h-6 [&>svg]:w-6",xl:"[&>svg]:h-8 [&>svg]:w-8"})||void 0===n?void 0:n[s];return React.createElement("span",{className:te("flex",f,d,u)},l||React.createElement(at,{className:"animate-spin"}))},ct=function(e){var t=e.progress,n=void 0===t?0:t,r=e.speed,o=void 0===r?200:r,i=e.className,s=void 0===i?"":i;if(!n)return null;var a=n;n<0&&(a=0),n>100&&(a=100);var l="translateX(-".concat(100-a,"%)"),c="h-2 rounded-full bg-background-brand absolute left-0 top-0 w-full bottom-0 origin-left transition-transform duration-".concat(o," ease-linear");return React.createElement("div",{className:te("h-2 rounded-full bg-misc-progress-background overflow-hidden relative",s),role:"progressbar","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},React.createElement("div",{className:c,style:{transform:l}}))};function ut(e){return ht(e)?(e.nodeName||"").toLowerCase():"#document"}function dt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ft(e){var t;return null==(t=(ht(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ht(e){return e instanceof Node||e instanceof dt(e).Node}function pt(e){return e instanceof Element||e instanceof dt(e).Element}function mt(e){return e instanceof HTMLElement||e instanceof dt(e).HTMLElement}function gt(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof dt(e).ShadowRoot)}function vt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=St(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function yt(e){return["table","td","th"].includes(ut(e))}function bt(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function xt(e){const t=wt(),n=pt(e)?St(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function wt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function _t(e){return["html","body","#document"].includes(ut(e))}function St(e){return dt(e).getComputedStyle(e)}function Et(e){return pt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kt(e){if("html"===ut(e))return e;const t=e.assignedSlot||e.parentNode||gt(e)&&e.host||ft(e);return gt(t)?t.host:t}function Ct(e){const t=kt(e);return _t(t)?e.ownerDocument?e.ownerDocument.body:e.body:mt(t)&&vt(t)?t:Ct(t)}function Tt(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Ct(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=dt(o);if(i){const e=Pt(s);return t.concat(s,s.visualViewport||[],vt(o)?o:[],e&&n?Tt(e):[])}return t.concat(o,Tt(o,[],n))}function Pt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Rt(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function Ot(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&>(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function At(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function Nt(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function Mt(e){return!(0!==e.mozInputSource||!e.isTrusted)||(Dt()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function jt(e){return!Nt().includes("jsdom/")&&(!Dt()&&0===e.width&&0===e.height||Dt()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function It(){return/apple/i.test(navigator.vendor)}function Dt(){const e=/android/i;return e.test(At())||e.test(Nt())}function Lt(){return At().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Ft(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function zt(e){return(null==e?void 0:e.ownerDocument)||document}function Vt(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function Bt(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Wt="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Ut(e){return mt(e)&&e.matches(Wt)}function $t(e){e.preventDefault(),e.stopPropagation()}function Kt(e){return!!e&&"combobox"===e.getAttribute("role")&&Ut(e)}const Ht=Math.min,qt=Math.max,Yt=Math.round,Xt=Math.floor,Gt=e=>({x:e,y:e}),Jt={left:"right",right:"left",bottom:"top",top:"bottom"},Zt={start:"end",end:"start"};function Qt(e,t,n){return qt(e,Ht(t,n))}function en(e,t){return"function"==typeof e?e(t):e}function tn(e){return e.split("-")[0]}function nn(e){return e.split("-")[1]}function rn(e){return"x"===e?"y":"x"}function on(e){return"y"===e?"height":"width"}function sn(e){return["top","bottom"].includes(tn(e))?"y":"x"}function an(e){return rn(sn(e))}function ln(e){return e.replace(/start|end/g,(e=>Zt[e]))}function cn(e){return e.replace(/left|right|bottom|top/g,(e=>Jt[e]))}function un(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function dn(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}var fn=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),hn="undefined"==typeof Element,pn=hn?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,mn=!hn&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},gn=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},vn=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!gn(s,!1))if("SLOT"===s.tagName){var a=s.assignedElements(),l=e(a.length?a:s.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:s,candidates:l})}else{pn.call(s,fn)&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var c=s.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(s),u=!gn(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(c&&u){var d=e(!0===c?s.children:c.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:s,candidates:d})}else i.unshift.apply(i,s.children)}}return o},yn=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},bn=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!yn(e)?0:e.tabIndex},xn=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},wn=function(e){return"INPUT"===e.tagName},Sn=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},En=function(e,t){return!(t.disabled||gn(t)||function(e){return wn(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=pn.call(e,"details>summary:first-of-type")?e.parentElement:e;if(pn.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Sn(e)}else{if("function"==typeof r){for(var i=e;e;){var s=e.parentElement,a=mn(e);if(s&&!s.shadowRoot&&!0===r(s))return Sn(e);e=e.assignedSlot?e.assignedSlot:s||a===e.ownerDocument?s:a.host}e=i}if(function(e){var t,n,r,o,i=e&&mn(e),s=null===(t=i)||void 0===t?void 0:t.host,a=!1;if(i&&i!==e)for(a=!!(null!==(n=s)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(s)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!a&&s;){var l,c,u;a=!(null===(c=s=null===(l=i=mn(s))||void 0===l?void 0:l.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(s))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n=0)},Tn=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,s=i?t.scopeParent:t,a=function(e,t){var n=bn(e);return n<0&&t&&!yn(e)?0:n}(s,i),l=i?e(t.candidates):s;0===a?i?n.push.apply(n,l):n.push(s):r.push({documentOrder:o,tabIndex:a,item:t,isScope:i,content:l})})),r.sort(xn).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Pn=function(e,t){var n;return n=(t=t||{}).getShadowRoot?vn([e],t.includeContainer,{filter:kn.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Cn}):function(e,t,n){if(gn(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(fn));return t&&pn.call(e,fn)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,kn.bind(null,t)),Tn(n)},Rn=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==pn.call(e,fn)&&kn(t,e)},On=window.ReactDOM;function An(e,t,n){let{reference:r,floating:o}=e;const i=sn(t),s=an(t),a=on(s),l=tn(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(nn(t)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1)}return h}async function Nn(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=en(t,e),p=un(h),m=a[f?"floating"===d?"reference":"floating":d],g=dn(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=dn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}function Mn(e){const t=St(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=mt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Yt(n)!==i||Yt(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function jn(e){return pt(e)?e:e.contextElement}function In(e){const t=jn(e);if(!mt(t))return Gt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Mn(t);let s=(i?Yt(n.width):n.width)/r,a=(i?Yt(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Dn=Gt(0);function Ln(e){const t=dt(e);return wt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Dn}function Fn(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=jn(e);let s=Gt(1);t&&(r?pt(r)&&(s=In(r)):s=In(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==dt(e))&&t}(i,n,r)?Ln(i):Gt(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=dt(i),t=r&&pt(r)?dt(r):r;let n=e,o=Pt(n);for(;o&&r&&t!==n;){const e=In(o),t=o.getBoundingClientRect(),r=St(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=dt(o),o=Pt(n)}}return dn({width:u,height:d,x:l,y:c})}function zn(e){return Fn(ft(e)).left+Et(e).scrollLeft}function Vn(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=dt(e),r=ft(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=wt();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=ft(e),n=Et(e),r=e.ownerDocument.body,o=qt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=qt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+zn(e);const a=-n.scrollTop;return"rtl"===St(r).direction&&(s+=qt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(ft(e));else if(pt(t))r=function(e,t){const n=Fn(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=mt(e)?In(e):Gt(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Ln(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return dn(r)}function Bn(e,t){const n=kt(e);return!(n===t||!pt(n)||_t(n))&&("fixed"===St(n).position||Bn(n,t))}function Wn(e,t,n){const r=mt(t),o=ft(t),i="fixed"===n,s=Fn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Gt(0);if(r||!r&&!i)if(("body"!==ut(t)||vt(o))&&(a=Et(t)),r){const e=Fn(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=zn(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Un(e){return"static"===St(e).position}function $n(e,t){return mt(e)&&"fixed"!==St(e).position?t?t(e):e.offsetParent:null}function Kn(e,t){const n=dt(e);if(bt(e))return n;if(!mt(e)){let t=kt(e);for(;t&&!_t(t);){if(pt(t)&&!Un(t))return t;t=kt(t)}return n}let r=$n(e,t);for(;r&&yt(r)&&Un(r);)r=$n(r,t);return r&&_t(r)&&Un(r)&&!xt(r)?n:r||function(e){let t=kt(e);for(;mt(t)&&!_t(t);){if(xt(t))return t;if(bt(t))return null;t=kt(t)}return null}(e)||n}const Hn={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=ft(r),a=!!t&&bt(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Gt(1);const u=Gt(0),d=mt(r);if((d||!d&&!i)&&(("body"!==ut(r)||vt(s))&&(l=Et(r)),mt(r))){const e=Fn(r);c=In(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:ft,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?bt(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Tt(e,[],!1).filter((e=>pt(e)&&"body"!==ut(e))),o=null;const i="fixed"===St(e).position;let s=i?kt(e):e;for(;pt(s)&&!_t(s);){const t=St(s),n=xt(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||vt(s)&&!n&&Bn(e,s))?r=r.filter((e=>e!==s)):o=t,s=kt(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i[0],a=i.reduce(((e,n)=>{const r=Vn(t,n,o);return e.top=qt(r.top,e.top),e.right=Ht(r.right,e.right),e.bottom=Ht(r.bottom,e.bottom),e.left=qt(r.left,e.left),e}),Vn(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Kn,getElementRects:async function(e){const t=this.getOffsetParent||Kn,n=this.getDimensions,r=await n(e.floating);return{reference:Wn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Mn(e);return{width:t,height:n}},getScale:In,isElement:pt,isRTL:function(e){return"rtl"===St(e).direction}};function qn(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=jn(e),u=o||i?[...c?Tt(c):[],...Tt(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=ft(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h={rootMargin:-Xt(u)+"px "+-Xt(o.clientWidth-(c+d))+"px "+-Xt(o.clientHeight-(u+f))+"px "+-Xt(c)+"px",threshold:qt(0,Ht(1,l))||1};let p=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}p=!1}try{r=new IntersectionObserver(m,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(m,h)}r.observe(e)}(!0),i}(c,n):null;let f,h=-1,p=null;s&&(p=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),n()})),c&&!l&&p.observe(c),p.observe(t));let m=l?Fn(e):null;return l&&function t(){const r=Fn(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n(),m=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(f)}}const Yn=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=tn(n),a=nn(n),l="y"===sn(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=en(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof p&&(h="end"===a?-1*p:p),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Xn=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=en(e,t),c={x:n,y:r},u=await Nn(t,l),d=sn(tn(o)),f=rn(d);let h=c[f],p=c[d];if(i){const e="y"===f?"bottom":"right";h=Qt(h+u["y"===f?"top":"left"],h,h-u[e])}if(s){const e="y"===d?"bottom":"right";p=Qt(p+u["y"===d?"top":"left"],p,p-u[e])}const m=a.fn({...t,[f]:h,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},Gn=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=en(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=tn(o),y=sn(a),b=tn(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=f||(b||!m?[cn(a)]:function(e){const t=cn(e);return[ln(e),t,ln(t)]}(a)),_="none"!==p;!f&&_&&w.push(...function(e,t,n,r){const o=nn(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}(tn(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(ln)))),i}(a,m,p,x));const S=[a,...w],E=await Nn(t,g),k=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&k.push(E[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=nn(e),o=an(e),i=on(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=cn(s)),[s,cn(s)]}(o,s,x);k.push(E[e[0]],E[e[1]])}if(C=[...C,{placement:o,overflows:k}],!k.every((e=>e<=0))){var T,P;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=S[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(P=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:P.placement;if(!n)switch(h){case"bestFit":{var R;const e=null==(R=C.filter((e=>{if(_){const t=sn(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:R[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},Jn=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=en(e,t),l=await Nn(t,a),c=tn(n),u=nn(n),d="y"===sn(n),{width:f,height:h}=r.floating;let p,m;"top"===c||"bottom"===c?(p=c,m=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,p="end"===u?"top":"bottom");const g=h-l.top-l.bottom,v=f-l.left-l.right,y=Ht(h-l[p],g),b=Ht(f-l[m],v),x=!t.middlewareData.shift;let w=y,_=b;if(d?_=u||x?Ht(b,v):v:w=u||x?Ht(y,g):g,x&&!u){const e=qt(l.left,0),t=qt(l.right,0),n=qt(l.top,0),r=qt(l.bottom,0);d?_=f-2*(0!==e||0!==t?e+t:qt(l.left,l.right)):w=h-2*(0!==n||0!==r?n+r:qt(l.top,l.bottom))}await s({...t,availableWidth:_,availableHeight:w});const S=await o.getDimensions(i.floating);return f!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}},Zn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=en(e,t)||{};if(null==c)return{};const d=un(u),f={x:n,y:r},h=an(o),p=on(h),m=await s.getDimensions(c),g="y"===h,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[h]-f[h]-i.floating[p],w=f[h]-i.reference[h],_=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let S=_?_[b]:0;S&&await(null==s.isElement?void 0:s.isElement(_))||(S=a.floating[b]||i.floating[p]);const E=x/2-w/2,k=S/2-m[p]/2-1,C=Ht(d[v],k),T=Ht(d[y],k),P=C,R=S-m[p]-T,O=S/2-m[p]/2+E,A=Qt(P,O,R),N=!l.arrow&&null!=nn(o)&&O!==A&&i.reference[p]/2-(O{const r=new Map,o={platform:Hn,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=An(c,r,l),f=r,h={},p=0;for(let n=0;n{t.current=e})),t}const ir=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?Zn({element:n.current,padding:r}).fn(t):{}:n?Zn({element:n,padding:r}).fn(t):{};var o}}),sr=(e,t)=>({...Yn(e),options:[e,t]}),ar=(e,t)=>({...Gn(e),options:[e,t]}),lr=(e,t)=>({...ir(e),options:[e,t]}),cr={...o},ur=cr.useInsertionEffect||(e=>e());function dr(e){const t=o.useRef((()=>{}));return ur((()=>{t.current=e})),o.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r=e.current.length}function yr(e,t){return xr(e,{disabledIndices:t})}function br(e,t){return xr(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function xr(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:i=1}=void 0===t?{}:t;const s=e.current;let a=n;do{a+=r?-i:i}while(a>=0&&a<=s.length-1&&Sr(s,a,o));return a}function wr(e,t,n,r,o){if(-1===e)return-1;const i=n.indexOf(e),s=t[e];switch(o){case"tl":return i;case"tr":return s?i+s.width-1:i;case"bl":return s?i+(s.height-1)*r:i;case"br":return n.lastIndexOf(e)}}function _r(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function Sr(e,t,n){if(n)return n.includes(t);const r=e[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}let Er=0;function kr(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Er);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Er=requestAnimationFrame(i)}var Cr="undefined"!=typeof document?o.useLayoutEffect:o.useEffect;function Tr(){return Tr=Object.assign?Object.assign.bind():function(e){for(var t=1;t"floating-ui-"+Math.random().toString(36).slice(2,6)+Rr++,Ar=cr.useId||function(){const[e,t]=o.useState((()=>Pr?Or():void 0));return Cr((()=>{null==e&&t(Or())}),[]),o.useEffect((()=>{Pr=!0}),[]),e},Nr=o.forwardRef((function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:i,shift:s}},width:a=14,height:l=7,tipRadius:c=0,strokeWidth:u=0,staticOffset:d,stroke:f,d:h,style:{transform:p,...m}={},...g}=e,v=Ar(),[y,b]=o.useState(!1);if(Cr((()=>{r&&"rtl"===St(r).direction&&b(!0)}),[r]),!r)return null;const[x,w]=n.split("-"),_="top"===x||"bottom"===x;let S=d;(_&&null!=s&&s.x||!_&&null!=s&&s.y)&&(S=null);const E=2*u,k=E/2,C=a/2*(c/-8+1),T=l/2*c/4,P=!!h,R=S&&"end"===w?"bottom":"top";let O=S&&"end"===w?"right":"left";S&&y&&(O="end"===w?"left":"right");const A=null!=(null==i?void 0:i.x)?S||i.x:"",N=null!=(null==i?void 0:i.y)?S||i.y:"",M=h||"M0,0 H"+a+" L"+(a-C)+","+(l-T)+" Q"+a/2+","+l+" "+C+","+(l-T)+" Z",j={top:P?"rotate(180deg)":"",left:P?"rotate(90deg)":"rotate(-90deg)",bottom:P?"":"rotate(180deg)",right:P?"rotate(-90deg)":"rotate(90deg)"}[x];return o.createElement("svg",Tr({},g,{"aria-hidden":!0,ref:t,width:P?a:a+E,height:a,viewBox:"0 0 "+a+" "+(l>a?l:a),style:{position:"absolute",pointerEvents:"none",[O]:A,[R]:N,[x]:_||P?"100%":"calc(100% - "+E/2+"px)",transform:""+j+(null!=p?p:""),...m}}),E>0&&o.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:f,strokeWidth:E+(h?0:1),d:M}),o.createElement("path",{stroke:E&&!h?g.fill:"none",d:M}),o.createElement("clipPath",{id:v},o.createElement("rect",{x:-k,y:k*(P?-1:1),width:a+E,height:a})))}));const Mr=o.createContext(null),jr=o.createContext(null),Ir=()=>{var e;return(null==(e=o.useContext(Mr))?void 0:e.id)||null},Dr=()=>o.useContext(jr);function Lr(e){return"data-floating-ui-"+e}function Fr(e){const t=(0,o.useRef)(e);return Cr((()=>{t.current=e})),t}const zr=Lr("safe-polygon");function Vr(e,t,n){return n&&!Ft(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function Br(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let Wr=new WeakMap,Ur=new WeakSet,$r={},Kr=0;const Hr=e=>e&&(e.host||Hr(e.parentNode)),qr=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=Hr(t);return e.contains(n)?n:null})).filter((e=>null!=e));function Yr(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=zt(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,s=qr(t,e),a=new Set,l=new Set(s),c=[];$r[o]||($r[o]=new WeakMap);const u=$r[o];return s.forEach((function e(t){t&&!a.has(t)&&(a.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!l.has(t)&&[].forEach.call(t.children,(t=>{if("script"!==ut(t))if(a.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=(Wr.get(t)||0)+1,s=(u.get(t)||0)+1;Wr.set(t,r),u.set(t,s),c.push(t),1===r&&n&&Ur.add(t),1===s&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),a.clear(),Kr++,()=>{c.forEach((e=>{const t=(Wr.get(e)||0)-1,n=(u.get(e)||0)-1;Wr.set(e,t),u.set(e,n),t||(!Ur.has(e)&&i&&e.removeAttribute(i),Ur.delete(e)),n||e.removeAttribute(o)})),Kr--,Kr||(Wr=new WeakMap,Wr=new WeakMap,Ur=new WeakSet,$r={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Xr=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Gr(e,t){const n=Pn(e,Xr());"prev"===t&&n.reverse();const r=n.indexOf(Rt(zt(e)));return n.slice(r+1)[0]}function Jr(){return Gr(document.body,"next")}function Zr(){return Gr(document.body,"prev")}function Qr(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ot(n,r)}function eo(e){Pn(e,Xr()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function to(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const no={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function ro(e){"Tab"===e.key&&(e.target,clearTimeout(void 0))}const oo=o.forwardRef((function(e,t){const[n,r]=o.useState();Cr((()=>(It()&&r("button"),document.addEventListener("keydown",ro),()=>{document.removeEventListener("keydown",ro)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Lr("focus-guard")]:"",style:no};return o.createElement("span",Tr({},e,i))})),io=o.createContext(null),so=Lr("portal");function ao(e){const{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e,s=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=Ar(),i=lo(),[s,a]=o.useState(null),l=o.useRef(null);return Cr((()=>()=>{null==s||s.remove(),queueMicrotask((()=>{l.current=null}))}),[s]),Cr((()=>{if(!r)return;if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(so,""),e.appendChild(n),l.current=n,a(n)}),[t,r]),Cr((()=>{if(!r)return;if(l.current)return;let e=n||(null==i?void 0:i.portalNode);e&&!pt(e)&&(e=e.current),e=e||document.body;let o=null;t&&(o=document.createElement("div"),o.id=t,e.appendChild(o));const s=document.createElement("div");s.id=r,s.setAttribute(so,""),e=o||e,e.appendChild(s),l.current=s,a(s)}),[t,n,r,i]),s}({id:n,root:r}),[a,l]=o.useState(null),c=o.useRef(null),u=o.useRef(null),d=o.useRef(null),f=o.useRef(null),h=null==a?void 0:a.modal,p=null==a?void 0:a.open,m=!!a&&!a.modal&&a.open&&i&&!(!r&&!s);return o.useEffect((()=>{if(s&&i&&!h)return s.addEventListener("focusin",e,!0),s.addEventListener("focusout",e,!0),()=>{s.removeEventListener("focusin",e,!0),s.removeEventListener("focusout",e,!0)};function e(e){s&&Qr(e)&&("focusin"===e.type?to:eo)(s)}}),[s,i,h]),o.useEffect((()=>{s&&(p||to(s))}),[p,s]),o.createElement(io.Provider,{value:o.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:f,portalNode:s,setFocusManagerState:l})),[i,s])},m&&s&&o.createElement(oo,{"data-type":"outside",ref:c,onFocus:e=>{if(Qr(e,s)){var t;null==(t=d.current)||t.focus()}else{const e=Zr()||(null==a?void 0:a.refs.domReference.current);null==e||e.focus()}}}),m&&s&&o.createElement("span",{"aria-owns":s.id,style:no}),s&&On.createPortal(t,s),m&&s&&o.createElement(oo,{"data-type":"outside",ref:u,onFocus:e=>{if(Qr(e,s)){var t;null==(t=f.current)||t.focus()}else{const t=Jr()||(null==a?void 0:a.refs.domReference.current);null==t||t.focus(),(null==a?void 0:a.closeOnFocusOut)&&(null==a||a.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const lo=()=>o.useContext(io),co="data-floating-ui-focusable";function uo(e){return e?e.hasAttribute(co)?e:e.querySelector("["+co+"]")||e:null}const fo=20;let ho=[];function po(e){ho=ho.filter((e=>e.isConnected));let t=e;if(t&&"body"!==ut(t)){if(!Rn(t,Xr())){const e=Pn(t,Xr())[0];e&&(t=e)}ho.push(t),ho.length>fo&&(ho=ho.slice(-fo))}}function mo(){return ho.slice().reverse().find((e=>e.isConnected))}const go=o.forwardRef((function(e,t){return o.createElement("button",Tr({},e,{type:"button",ref:t,tabIndex:-1,style:no}))}));function vo(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:s=!0,initialFocus:a=0,returnFocus:l=!0,restoreFocus:c=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0}=e,{open:h,refs:p,nodeId:m,onOpenChange:g,events:v,dataRef:y,floatingId:b,elements:{domReference:x,floating:w}}=t,_="number"==typeof a&&a<0,S=Kt(x)&&_,E=!("undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype)||s,k=Fr(i),C=Fr(a),T=Fr(l),P=Dr(),R=lo(),O=o.useRef(null),A=o.useRef(null),N=o.useRef(!1),M=o.useRef(!1),j=o.useRef(-1),I=null!=R,D=uo(w),L=dr((function(e){return void 0===e&&(e=D),e?Pn(e,Xr()):[]})),F=dr((e=>{const t=L(e);return k.current.map((e=>x&&"reference"===e?x:D&&"floating"===e?D:t)).filter(Boolean).flat()}));function z(e){return!r&&d&&u?o.createElement(go,{ref:"start"===e?O:A,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}o.useEffect((()=>{N.current=!1}),[r]),o.useEffect((()=>{if(r)return;if(!u)return;function e(e){if("Tab"===e.key){Ot(D,Rt(zt(D)))&&0===L().length&&!S&&$t(e);const t=F(),n=Bt(e);"reference"===k.current[0]&&n===x&&($t(e),e.shiftKey?kr(t[t.length-1]):kr(t[1])),"floating"===k.current[1]&&n===D&&e.shiftKey&&($t(e),kr(t[0]))}}const t=zt(D);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,x,D,u,k,S,L,F]),o.useEffect((()=>{if(!r&&w)return w.addEventListener("focusin",e),()=>{w.removeEventListener("focusin",e)};function e(e){const t=Bt(e),n=L().indexOf(t);-1!==n&&(j.current=n)}}),[r,w,L]),o.useEffect((()=>{if(!r&&f)return w&&mt(x)?(x.addEventListener("focusout",t),x.addEventListener("pointerdown",e),w.addEventListener("focusout",t),()=>{x.removeEventListener("focusout",t),x.removeEventListener("pointerdown",e),w.removeEventListener("focusout",t)}):void 0;function e(){M.current=!0,setTimeout((()=>{M.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(Ot(x,t)||Ot(w,t)||Ot(t,w)||Ot(null==R?void 0:R.portalNode,t)||null!=t&&t.hasAttribute(Lr("focus-guard"))||P&&(Br(P.nodesRef.current,m).find((e=>{var n,r;return Ot(null==(n=e.context)?void 0:n.elements.floating,t)||Ot(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(P.nodesRef.current,m).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));if(c&&n&&Rt(zt(D))===zt(D).body){mt(D)&&D.focus();const e=j.current,t=L(),n=t[e]||t[t.length-1]||D;mt(n)&&n.focus()}!S&&u||!t||!n||M.current||t===mo()||(N.current=!0,g(!1,e,"focus-out"))}))}}),[r,x,w,D,u,m,P,R,g,f,c,L,S]),o.useEffect((()=>{var e;if(r)return;const t=Array.from((null==R||null==(e=R.portalNode)?void 0:e.querySelectorAll("["+Lr("portal")+"]"))||[]);if(w){const e=[w,...t,O.current,A.current,k.current.includes("reference")||S?x:null].filter((e=>null!=e)),n=u||S?Yr(e,E,!E):Yr(e);return()=>{n()}}}),[r,x,w,u,k,R,S,E]),Cr((()=>{if(r||!mt(D))return;const e=Rt(zt(D));queueMicrotask((()=>{const t=F(D),n=C.current,r=("number"==typeof n?t[n]:n.current)||D,o=Ot(D,e);_||o||!h||kr(r,{preventScroll:r===D})}))}),[r,h,D,_,F,C]),Cr((()=>{if(r||!D)return;let e=!1;const t=zt(D),n=Rt(t);let o=y.current.openEvent;const i=p.domReference.current;function s(t){let{open:n,reason:r,event:i,nested:s}=t;n&&(o=i),"escape-key"===r&&p.domReference.current&&po(p.domReference.current),"hover"===r&&"mouseleave"===i.type&&(N.current=!0),"outside-press"===r&&(s?(N.current=!1,e=!0):N.current=!(Mt(i)||jt(i)))}return po(n),v.on("openchange",s),()=>{v.off("openchange",s);const r=Rt(t),a=Ot(w,r)||P&&Br(P.nodesRef.current,m).some((e=>{var t;return Ot(null==(t=e.context)?void 0:t.elements.floating,r)}));(a||o&&["click","mousedown"].includes(o.type))&&p.domReference.current&&po(p.domReference.current);const l=i||n,c=Pn(zt(l).body,Xr());queueMicrotask((()=>{let n=mo();!n&&mt(l)&&w&&(n=function(e,t,n){const r=e.indexOf(t);function o(t){const o=Lr("focus-guard");let i=r+(t?1:0),s=e[i];for(;s&&(!s.isConnected||s.hasAttribute(o)||Ot(n,s));)t?i++:i--,s=e[i];return s}return o(!0)||o(!1)}(c,l,w)),T.current&&!N.current&&mt(n)&&(n===r||r===t.body||a)&&n.focus({preventScroll:e})}))}}),[r,w,D,T,y,p,v,P,m]),Cr((()=>{if(!r&&R)return R.setFocusManagerState({modal:u,closeOnFocusOut:f,open:h,onOpenChange:g,refs:p}),()=>{R.setFocusManagerState(null)}}),[r,R,u,h,g,p,f]),Cr((()=>{if(r)return;if(!D)return;if("function"!=typeof MutationObserver)return;if(_)return;const e=()=>{const e=D.getAttribute("tabindex"),t=L(),n=Rt(zt(w)),r=t.indexOf(n);-1!==r&&(j.current=r),k.current.includes("floating")||n!==p.domReference.current&&0===t.length?"0"!==e&&D.setAttribute("tabindex","0"):"-1"!==e&&D.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(D,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[r,w,D,p,k,L,_]);const V=!r&&E&&(!u||!S)&&(I||u);return o.createElement(o.Fragment,null,V&&o.createElement(oo,{"data-type":"inside",ref:null==R?void 0:R.beforeInsideRef,onFocus:e=>{if(u){const e=F();kr("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=R&&R.preserveTabOrder&&R.portalNode)if(N.current=!1,Qr(e,R.portalNode)){const e=Jr()||x;null==e||e.focus()}else{var t;null==(t=R.beforeOutsideRef.current)||t.focus()}}}),!S&&z("start"),n,z("end"),V&&o.createElement(oo,{"data-type":"inside",ref:null==R?void 0:R.afterInsideRef,onFocus:e=>{if(u)kr(F()[0]);else if(null!=R&&R.preserveTabOrder&&R.portalNode)if(f&&(N.current=!0),Qr(e,R.portalNode)){const e=Zr()||x;null==e||e.focus()}else{var t;null==(t=R.afterOutsideRef.current)||t.focus()}}}))}function yo(e){return mt(e.target)&&"BUTTON"===e.target.tagName}function bo(e){return Ut(e)}function xo(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:s}}=e,{enabled:a=!0,event:l="click",toggle:c=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0}=t,f=o.useRef(),h=o.useRef(!1),p=o.useMemo((()=>({onPointerDown(e){f.current=e.pointerType},onMouseDown(e){const t=f.current;0===e.button&&"click"!==l&&(Ft(t,!0)&&u||(!n||!c||i.current.openEvent&&"mousedown"!==i.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=f.current;"mousedown"===l&&f.current?f.current=void 0:Ft(t,!0)&&u||(!n||!c||i.current.openEvent&&"click"!==i.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){f.current=void 0,e.defaultPrevented||!d||yo(e)||(" "!==e.key||bo(s)||(e.preventDefault(),h.current=!0),"Enter"===e.key&&r(!n||!c,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!d||yo(e)||bo(s)||" "===e.key&&h.current&&(h.current=!1,r(!n||!c,e.nativeEvent,"click"))}})),[i,s,l,u,d,r,n,c]);return o.useMemo((()=>a?{reference:p}:{}),[a,p])}const wo={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},_o={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},So=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Eo(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:s}=e,{enabled:a=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:p,capture:m}=t,g=Dr(),v=dr("function"==typeof c?c:()=>!1),y="function"==typeof c?v:c,b=o.useRef(!1),x=o.useRef(!1),{escapeKey:w,outsidePress:_}=So(p),{escapeKey:S,outsidePress:E}=So(m),k=dr((e=>{var t;if(!n||!a||!l||"Escape"!==e.key)return;const o=null==(t=s.current.floatingContext)?void 0:t.nodeId,i=g?Br(g.nodesRef.current,o):[];if(!w&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),C=dr((e=>{var t;const n=()=>{var t;k(e),null==(t=Bt(e))||t.removeEventListener("keydown",n)};null==(t=Bt(e))||t.addEventListener("keydown",n)})),T=dr((e=>{var t;const n=b.current;b.current=!1;const o=x.current;if(x.current=!1,"click"===u&&o)return;if(n)return;if("function"==typeof y&&!y(e))return;const a=Bt(e),l="["+Lr("inert")+"]",c=zt(i.floating).querySelectorAll(l);let d=pt(a)?a:null;for(;d&&!_t(d);){const e=kt(d);if(_t(e)||!pt(e))break;d=e}if(c.length&&pt(a)&&!a.matches("html,body")&&!Ot(a,i.floating)&&Array.from(c).every((e=>!Ot(d,e))))return;if(mt(a)&&O){const t=a.clientWidth>0&&a.scrollWidth>a.clientWidth,n=a.clientHeight>0&&a.scrollHeight>a.clientHeight;let r=n&&e.offsetX>a.clientWidth;if(n&&"rtl"===St(a).direction&&(r=e.offsetX<=a.offsetWidth-a.clientWidth),r||t&&e.offsetY>a.clientHeight)return}const f=null==(t=s.current.floatingContext)?void 0:t.nodeId,h=g&&Br(g.nodesRef.current,f).some((t=>{var n;return Vt(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Vt(e,i.floating)||Vt(e,i.domReference)||h)return;const p=g?Br(g.nodesRef.current,f):[];if(p.length>0){let e=!0;if(p.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}r(!1,e,"outside-press")})),P=dr((e=>{var t;const n=()=>{var t;T(e),null==(t=Bt(e))||t.removeEventListener(u,n)};null==(t=Bt(e))||t.addEventListener(u,n)}));o.useEffect((()=>{if(!n||!a)return;function e(e){r(!1,e,"ancestor-scroll")}s.current.__escapeKeyBubbles=w,s.current.__outsidePressBubbles=_;const t=zt(i.floating);l&&t.addEventListener("keydown",S?C:k,S),y&&t.addEventListener(u,E?P:T,E);let o=[];return h&&(pt(i.domReference)&&(o=Tt(i.domReference)),pt(i.floating)&&(o=o.concat(Tt(i.floating))),!pt(i.reference)&&i.reference&&i.reference.contextElement&&(o=o.concat(Tt(i.reference.contextElement)))),o=o.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),o.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{l&&t.removeEventListener("keydown",S?C:k,S),y&&t.removeEventListener(u,E?P:T,E),o.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[s,i,l,y,u,n,r,h,a,w,_,k,S,C,T,E,P]),o.useEffect((()=>{b.current=!1}),[y,u]);const R=o.useMemo((()=>({onKeyDown:k,[wo[f]]:e=>{d&&r(!1,e.nativeEvent,"reference-press")}})),[k,r,d,f]),O=o.useMemo((()=>({onKeyDown:k,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[_o[u]]:()=>{b.current=!0}})),[k,u]);return o.useMemo((()=>a?{reference:R,floating:O}:{}),[a,R,O])}function ko(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=Ar(),s=o.useRef({}),[a]=o.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),l=null!=Ir(),[c,u]=o.useState(r.reference),d=dr(((e,t,r)=>{s.current.openEvent=e?t:void 0,a.emit("openchange",{open:e,event:t,reason:r,nested:l}),null==n||n(e,t,r)})),f=o.useMemo((()=>({setPositionReference:u})),[]),h=o.useMemo((()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference})),[c,r.reference,r.floating]);return o.useMemo((()=>({dataRef:s,open:t,onOpenChange:d,elements:h,events:a,floatingId:i,refs:f})),[t,d,h,a,i,f])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[s,a]=o.useState(null),[l,c]=o.useState(null),u=(null==i?void 0:i.reference)||s,d=o.useRef(null),f=Dr();Cr((()=>{u&&(d.current=u)}),[u]);const h=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=o.useState(r);tr(h,r)||p(r);const[m,g]=o.useState(null),[v,y]=o.useState(null),b=o.useCallback((e=>{e!==S.current&&(S.current=e,g(e))}),[]),x=o.useCallback((e=>{e!==E.current&&(E.current=e,y(e))}),[]),w=s||m,_=a||v,S=o.useRef(null),E=o.useRef(null),k=o.useRef(d),C=null!=c,T=or(c),P=or(i),R=o.useCallback((()=>{if(!S.current||!E.current)return;const e={placement:t,strategy:n,middleware:h};P.current&&(e.platform=P.current),Qn(S.current,E.current,e).then((e=>{const t={...e,isPositioned:!0};O.current&&!tr(k.current,t)&&(k.current=t,On.flushSync((()=>{f(t)})))}))}),[h,t,n,P]);er((()=>{!1===u&&k.current.isPositioned&&(k.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[u]);const O=o.useRef(!1);er((()=>(O.current=!0,()=>{O.current=!1})),[]),er((()=>{if(w&&(S.current=w),_&&(E.current=_),w&&_){if(T.current)return T.current(w,_,R);R()}}),[w,_,R,T,C]);const A=o.useMemo((()=>({reference:S,floating:E,setReference:b,setFloating:x})),[b,x]),N=o.useMemo((()=>({reference:w,floating:_})),[w,_]),M=o.useMemo((()=>{const e={position:n,left:0,top:0};if(!N.floating)return e;const t=rr(N.floating,d.x),r=rr(N.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...nr(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,l,N.floating,d.x,d.y]);return o.useMemo((()=>({...d,update:R,refs:A,elements:N,floatingStyles:M})),[d,R,A,N,M])}({...e,elements:{...i,...l&&{reference:l}}}),p=o.useCallback((e=>{const t=pt(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c(t),h.refs.setReference(t)}),[h.refs]),m=o.useCallback((e=>{(pt(e)||null===e)&&(d.current=e,a(e)),(pt(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!pt(e))&&h.refs.setReference(e)}),[h.refs]),g=o.useMemo((()=>({...h.refs,setReference:m,setPositionReference:p,domReference:d})),[h.refs,m,p]),v=o.useMemo((()=>({...h.elements,domReference:u})),[h.elements,u]),y=o.useMemo((()=>({...h,...r,refs:g,elements:v,nodeId:t})),[h,g,v,t,r]);return Cr((()=>{r.dataRef.current.floatingContext=y;const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===t));e&&(e.context=y)})),o.useMemo((()=>({...h,context:y,refs:g,elements:v})),[h,g,v,y])}const Co="active",To="selected";function Po(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[Co]:t,[To]:__,...n}=e;i=n}return{..."floating"===n&&{tabIndex:-1,[co]:""},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var s;o&&[Co,To].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(s=r.get(n))||s.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;ie(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}function Ro(e){void 0===e&&(e=[]);const t=e.map((e=>null==e?void 0:e.reference)),n=e.map((e=>null==e?void 0:e.floating)),r=e.map((e=>null==e?void 0:e.item)),i=o.useCallback((t=>Po(t,e,"reference")),t),s=o.useCallback((t=>Po(t,e,"floating")),n),a=o.useCallback((t=>Po(t,e,"item")),r);return o.useMemo((()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:a})),[i,s,a])}let Oo=!1;function Ao(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function No(e,t){return Ao(t,e===fr||e===hr,e===pr||e===mr)}function Mo(e,t,n){return Ao(t,e===hr,n?e===pr:e===mr)||"Enter"===e||" "===e||""===e}function jo(e,t,n){return Ao(t,n?e===mr:e===pr,e===fr)}function Io(e,t){const{open:n,onOpenChange:r,elements:i}=e,{listRef:s,activeIndex:a,onNavigate:l=()=>{},enabled:c=!0,selectedIndex:u=null,allowEscape:d=!1,loop:f=!1,nested:h=!1,rtl:p=!1,virtual:m=!1,focusItemOnOpen:g="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:y=!0,disabledIndices:b,orientation:x="vertical",cols:w=1,scrollItemIntoView:_=!0,virtualItemRef:S,itemSizes:E,dense:k=!1}=t,C=Fr(uo(i.floating)),T=Ir(),P=Dr(),R=dr(l),O=o.useRef(g),A=o.useRef(null!=u?u:-1),N=o.useRef(null),M=o.useRef(!0),j=o.useRef(R),I=o.useRef(!!i.floating),D=o.useRef(n),L=o.useRef(!1),F=o.useRef(!1),z=Fr(b),V=Fr(n),B=Fr(_),W=Fr(u),[U,$]=o.useState(),[K,H]=o.useState(),q=dr((function(e,t,n){function r(e){m?($(e.id),null==P||P.events.emit("virtualfocus",e),S&&(S.current=e)):kr(e,{preventScroll:!0,sync:!(!Lt()||!It())&&(Oo||L.current)})}void 0===n&&(n=!1);const o=e.current[t.current];o&&r(o),requestAnimationFrame((()=>{const i=e.current[t.current]||o;if(!i)return;o||r(i);const s=B.current;s&&X&&(n||!M.current)&&(null==i.scrollIntoView||i.scrollIntoView("boolean"==typeof s?{block:"nearest",inline:"nearest"}:s))}))}));Cr((()=>{document.createElement("div").focus({get preventScroll(){return Oo=!0,!1}})}),[]),Cr((()=>{c&&(n&&i.floating?O.current&&null!=u&&(F.current=!0,A.current=u,R(u)):I.current&&(A.current=-1,j.current(null)))}),[c,n,i.floating,u,R]),Cr((()=>{if(c&&n&&i.floating)if(null==a){if(L.current=!1,null!=W.current)return;if(I.current&&(A.current=-1,q(s,A)),(!D.current||!I.current)&&O.current&&(null!=N.current||!0===O.current&&null==N.current)){let e=0;const t=()=>{null==s.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(A.current=null==N.current||Mo(N.current,x,p)||h?yr(s,z.current):br(s,z.current),N.current=null,R(A.current))};t()}}else vr(s,a)||(A.current=a,q(s,A,F.current),F.current=!1)}),[c,n,i.floating,a,W,h,s,x,p,R,q,z]),Cr((()=>{var e;if(!c||i.floating||!P||m||!I.current)return;const t=P.nodesRef.current,n=null==(e=t.find((e=>e.id===T)))||null==(e=e.context)?void 0:e.elements.floating,r=Rt(zt(i.floating)),o=t.some((e=>e.context&&Ot(e.context.elements.floating,r)));n&&!o&&M.current&&n.focus({preventScroll:!0})}),[c,i.floating,P,T,m]),Cr((()=>{if(c&&P&&m&&!T)return P.events.on("virtualfocus",e),()=>{P.events.off("virtualfocus",e)};function e(e){H(e.id),S&&(S.current=e)}}),[c,P,m,T,S]),Cr((()=>{j.current=R,I.current=!!i.floating})),Cr((()=>{n||(N.current=null)}),[n]),Cr((()=>{D.current=n}),[n]);const Y=null!=a,X=o.useMemo((()=>{function e(e){if(!n)return;const t=s.current.indexOf(e);-1!==t&&R(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...v&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;M.current&&"touch"!==t&&(A.current=-1,q(s,A),R(null),m||kr(C.current,{preventScroll:!0}))}}}}),[n,C,q,v,s,R,m]),G=dr((e=>{if(M.current=!1,L.current=!0,!V.current&&e.currentTarget===C.current)return;if(h&&jo(e.key,x,p))return $t(e),r(!1,e.nativeEvent,"list-navigation"),void(mt(i.domReference)&&!m&&i.domReference.focus());const t=A.current,o=yr(s,b),a=br(s,b);if("Home"===e.key&&($t(e),A.current=o,R(A.current)),"End"===e.key&&($t(e),A.current=a,R(A.current)),w>1){const t=E||Array.from({length:s.current.length},(()=>({width:1,height:1}))),n=function(e,t,n){const r=[];let o=0;return e.forEach(((e,i)=>{let{width:s,height:a}=e,l=!1;for(n&&(o=0);!l;){const e=[];for(let n=0;nnull==r[e]))?(e.forEach((e=>{r[e]=i})),l=!0):o++}})),[...r]}(t,w,k),r=n.findIndex((e=>null!=e&&!Sr(s.current,e,b))),i=n.reduce(((e,t,n)=>null==t||Sr(s.current,t,b)?e:n),-1),l=n[function(e,t){let{event:n,orientation:r,loop:o,cols:i,disabledIndices:s,minIndex:a,maxIndex:l,prevIndex:c,stopEvent:u=!1}=t,d=c;if(n.key===fr){if(u&&$t(n),-1===c)d=l;else if(d=xr(e,{startingIndex:d,amount:i,decrement:!0,disabledIndices:s}),o&&(c-ie?n:n-i}vr(e,d)&&(d=c)}if(n.key===hr&&(u&&$t(n),-1===c?d=a:(d=xr(e,{startingIndex:c,amount:i,disabledIndices:s}),o&&c+i>l&&(d=xr(e,{startingIndex:c%i-i,amount:i,disabledIndices:s}))),vr(e,d)&&(d=c)),"both"===r){const t=Xt(c/i);n.key===mr&&(u&&$t(n),c%i!=i-1?(d=xr(e,{startingIndex:c,disabledIndices:s}),o&&gr(d,i,t)&&(d=xr(e,{startingIndex:c-c%i-1,disabledIndices:s}))):o&&(d=xr(e,{startingIndex:c-c%i-1,disabledIndices:s})),gr(d,i,t)&&(d=c)),n.key===pr&&(u&&$t(n),c%i!=0?(d=xr(e,{startingIndex:c,decrement:!0,disabledIndices:s}),o&&gr(d,i,t)&&(d=xr(e,{startingIndex:c+(i-c%i),decrement:!0,disabledIndices:s}))):o&&(d=xr(e,{startingIndex:c+(i-c%i),decrement:!0,disabledIndices:s})),gr(d,i,t)&&(d=c));const r=Xt(l/i)===t;vr(e,d)&&(d=o&&r?n.key===pr?l:xr(e,{startingIndex:c-c%i-1,disabledIndices:s}):c)}return d}({current:n.map((e=>null!=e?s.current[e]:null))},{event:e,orientation:x,loop:f,cols:w,disabledIndices:_r([...b||s.current.map(((e,t)=>Sr(s.current,t)?t:void 0)),void 0],n),minIndex:r,maxIndex:i,prevIndex:wr(A.current>a?o:A.current,t,n,w,e.key===hr?"bl":e.key===mr?"tr":"tl"),stopEvent:!0})];if(null!=l&&(A.current=l,R(A.current)),"both"===x)return}if(No(e.key,x)){if($t(e),n&&!m&&Rt(e.currentTarget.ownerDocument)===e.currentTarget)return A.current=Mo(e.key,x,p)?o:a,void R(A.current);Mo(e.key,x,p)?A.current=f?t>=a?d&&t!==s.current.length?-1:o:xr(s,{startingIndex:t,disabledIndices:b}):Math.min(a,xr(s,{startingIndex:t,disabledIndices:b})):A.current=f?t<=o?d&&-1!==t?s.current.length:a:xr(s,{startingIndex:t,decrement:!0,disabledIndices:b}):Math.max(o,xr(s,{startingIndex:t,decrement:!0,disabledIndices:b})),vr(s,A.current)?R(null):R(A.current)}})),J=o.useMemo((()=>m&&n&&Y&&{"aria-activedescendant":K||U}),[m,n,Y,K,U]),Z=o.useMemo((()=>({"aria-orientation":"both"===x?void 0:x,...!Kt(i.domReference)&&J,onKeyDown:G,onPointerMove(){M.current=!0}})),[J,G,i.domReference,x]),Q=o.useMemo((()=>{function e(e){"auto"===g&&Mt(e.nativeEvent)&&(O.current=!0)}return{...J,onKeyDown(e){M.current=!1;const t=0===e.key.indexOf("Arrow"),o=function(e,t,n){return Ao(t,n?e===pr:e===mr,e===hr)}(e.key,x,p),i=jo(e.key,x,p),a=No(e.key,x),l=(h?o:a)||"Enter"===e.key||""===e.key.trim();if(m&&n){const n=null==P?void 0:P.nodesRef.current.find((e=>null==e.parentId)),r=P&&n?function(e,t){let n,r=-1;return function t(o,i){i>r&&(n=o,r=i),Br(e,o).forEach((e=>{t(e.id,i+1)}))}(t,0),e.find((e=>e.id===n))}(P.nodesRef.current,n.id):null;if(t&&r&&S){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(o||i){var c,d;const n=(null==(c=r.context)?void 0:c.elements.domReference)===e.currentTarget,a=i&&!n?null==(d=r.context)?void 0:d.elements.domReference:o?s.current.find((e=>(null==e?void 0:e.id)===U)):null;a&&($t(e),a.dispatchEvent(t),H(void 0))}var f;if(a&&r.context&&r.context.open&&r.parentId&&e.currentTarget!==r.context.elements.domReference)return $t(e),void(null==(f=r.context.elements.domReference)||f.dispatchEvent(t))}return G(e)}(n||y||!t)&&(l&&(N.current=h&&a?null:e.key),h?o&&($t(e),n?(A.current=yr(s,z.current),R(A.current)):r(!0,e.nativeEvent,"list-navigation")):a&&(null!=u&&(A.current=u),$t(e),!n&&y?r(!0,e.nativeEvent,"list-navigation"):G(e),n&&R(A.current)))},onFocus(){n&&!m&&R(null)},onPointerDown:function(e){O.current=g,"auto"===g&&jt(e.nativeEvent)&&(O.current=!0)},onMouseDown:e,onClick:e}}),[U,J,G,z,g,s,h,R,r,n,y,x,p,u,P,m,S]);return o.useMemo((()=>c?{reference:Q,floating:Z,item:X}:{}),[c,Q,Z,X])}const Do=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Lo(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:i}=e,{enabled:s=!0,role:a="dialog"}=t,l=null!=(n=Do.get(a))?n:a,c=Ar(),u=null!=Ir(),d=o.useMemo((()=>"tooltip"===l||"label"===a?{["aria-"+("label"===a?"labelledby":"describedby")]:r?i:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===l?"dialog":l,"aria-controls":r?i:void 0,..."listbox"===l&&{role:"combobox"},..."menu"===l&&{id:c},..."menu"===l&&u&&{role:"menuitem"},..."select"===a&&{"aria-autocomplete":"none"},..."combobox"===a&&{"aria-autocomplete":"list"}}),[l,i,u,r,c,a]),f=o.useMemo((()=>{const e={id:i,...l&&{role:l}};return"tooltip"===l||"label"===a?e:{...e,..."menu"===l&&{"aria-labelledby":c}}}),[l,i,c,a]),h=o.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(a){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,a]);return o.useMemo((()=>s?{reference:d,floating:f,item:h}:{}),[s,d,f,h])}const Fo=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function zo(e,t){return"function"==typeof e?e(t):e}function Vo(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let e=0,s=i-1;e=r!=c>=r&&n<=(l-i)*(r-a)/(c-a)+i&&(o=!o)}return o}function Bo(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,i=!1,s=null,a=null,l=performance.now();const c=e=>{let{x:n,y:c,placement:u,elements:d,onClose:f,nodeId:h,tree:p}=e;return function(e){function m(){clearTimeout(o),f()}if(clearTimeout(o),!d.domReference||!d.floating||null==u||null==n||null==c)return;const{clientX:g,clientY:v}=e,y=[g,v],b=Bt(e),x="mouseleave"===e.type,w=Ot(d.floating,b),_=Ot(d.domReference,b),S=d.domReference.getBoundingClientRect(),E=d.floating.getBoundingClientRect(),k=u.split("-")[0],C=n>E.right-E.width/2,T=c>E.bottom-E.height/2,P=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,S),R=E.width>S.width,O=E.height>S.height,A=(R?S:E).left,N=(R?S:E).right,M=(O?S:E).top,j=(O?S:E).bottom;if(w&&(i=!0,!x))return;if(_&&(i=!1),_&&!x)return void(i=!0);if(x&&pt(e.relatedTarget)&&Ot(d.floating,e.relatedTarget))return;if(p&&Br(p.nodesRef.current,h).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===k&&c>=S.bottom-1||"bottom"===k&&c<=S.top+1||"left"===k&&n>=S.right-1||"right"===k&&n<=S.left+1)return m();let I=[];switch(k){case"top":I=[[A,S.top+1],[A,E.bottom-1],[N,E.bottom-1],[N,S.top+1]];break;case"bottom":I=[[A,E.top+1],[A,S.bottom-1],[N,S.bottom-1],[N,E.top+1]];break;case"left":I=[[E.right-1,j],[E.right-1,M],[S.left+1,M],[S.left+1,j]];break;case"right":I=[[S.right-1,j],[S.right-1,M],[E.left+1,M],[E.left+1,j]]}if(!Vo([g,v],I)){if(i&&!P)return m();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===s||null===a||0===r)return s=e,a=t,l=n,null;const o=e-s,i=t-a,c=Math.sqrt(o*o+i*i);return s=e,a=t,l=n,c/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return m()}Vo([g,v],function(e){let[n,r]=e;switch(k){case"top":return[[R?n+t/2:C?n+4*t:n-4*t,r+t+1],[R?n-t/2:C?n+4*t:n-4*t,r+t+1],[E.left,C||R?E.bottom-t:E.top],[E.right,C?R?E.bottom-t:E.top:E.bottom-t]];case"bottom":return[[R?n+t/2:C?n+4*t:n-4*t,r-t],[R?n-t/2:C?n+4*t:n-4*t,r-t],[E.left,C||R?E.top+t:E.bottom],[E.right,C?R?E.top+t:E.bottom:E.top+t]];case"left":{const e=[n+t+1,O?r+t/2:T?r+4*t:r-4*t],o=[n+t+1,O?r-t/2:T?r+4*t:r-4*t];return[[T||O?E.right-t:E.left,E.top],[T?O?E.right-t:E.left:E.right-t,E.bottom],e,o]}case"right":return[[n-t,O?r+t/2:T?r+4*t:r-4*t],[n-t,O?r-t/2:T?r+4*t:r-4*t],[T||O?E.left+t:E.right,E.top],[T?O?E.left+t:E.right:E.left+t,E.bottom]]}}([n,c]))?!i&&r&&(o=window.setTimeout(m,40)):m()}}};return c.__options={blockPointerEvents:n},c}const Wo=ge("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Uo=ge("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var $o="light",Ko=function(e){var t=e.icon,n=void 0===t?null:t,r=e.theme,i=void 0===r?$o:r,s=e.variant,a=void 0===s?"neutral":s,l="[&>svg]:h-5 [&>svg]:w-5",c="light"===i?"text-icon-secondary":"text-icon-inverse";if(n&&(0,o.isValidElement)(n))return{updatedIcon:(0,o.cloneElement)(n,{className:te(l,c,n.props.className)})};switch(a){case"neutral":return React.createElement(Le,{className:te(l,c)});case"info":var u="light"===i?"text-support-info":"text-support-info-inverse";return React.createElement(Le,{className:te(l,u)});case"success":var d="light"===i?"text-support-success":"text-support-success-inverse";return React.createElement(ye,{className:te(l,d)});case"warning":var f="light"===i?"text-support-warning":"text-support-warning-inverse";return React.createElement(Wo,{className:te(l,f)});case"error":var h="light"===i?"text-support-error":"text-support-error-inverse";return React.createElement(Uo,{className:te(l,h)});default:return null}},Ho=function(e){var t=e.actionType,n=void 0===t?"button":t,r=e.onAction,o=void 0===r?function(){}:r,i=e.actionLabel,s=void 0===i?"":i,a=e.theme,l=void 0===a?$o:a,c="focus:ring-0 focus:ring-offset-0 ring-offset-0 focus:outline-none",u="text-button-primary border-button-primary hover:border-button-primary hover:text-button-primary-hover";switch("dark"===l&&(u="text-text-inverse border-text-inverse hover:border-text-inverse hover:text-text-inverse"),n){case"button":return React.createElement(oe,{variant:"outline",size:"xs",onClick:o,className:te("rounded",c,u,"dark"===l?"bg-transparent hover:bg-transparent":"bg-white hover:bg-white")},s);case"link":return React.createElement(oe,{variant:"link",size:"xs",onClick:o,className:te(c,u)},s);default:return null}},qo=function(e){var t=e.theme,n=void 0===t?$o:t,r=e.title,o=void 0===r?"":r;return!o&&isNaN(o)?null:React.createElement("span",{className:te("block",{light:"text-text-primary",dark:"text-text-inverse"}[n],"text-sm leading-5 font-semibold")},o)},Yo=function(e){var t=e.theme,n=void 0===t?$o:t,r=e.content,o=void 0===r?"":r;return!o&&isNaN(o)?null:React.createElement("span",{className:te({light:"text-text-primary",dark:"text-text-inverse"}[n],"block text-sm [&_*]:text-sm leading-5 [&_*]:leading-5 font-normal")},o)},Xo=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n{})),C=o.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);o.useEffect((()=>{if(l)return s.on("openchange",e),()=>{s.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(_.current),S.current=!0)}}),[l,s]),o.useEffect((()=>{if(!l)return;if(!g.current)return;if(!n)return;function e(e){C()&&r(!1,e,"hover")}const t=zt(a.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[a.floating,n,r,l,g,C]);const T=o.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Vr(v.current,"close",b.current);o&&!w.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>r(!1,e,n)),o)):t&&(clearTimeout(x.current),r(!1,e,n))}),[v,r]),P=dr((()=>{k.current(),w.current=void 0})),R=dr((()=>{if(E.current){const e=zt(a.floating).body;e.style.pointerEvents="",e.removeAttribute(zr),E.current=!1}}));o.useEffect((()=>{if(l&&pt(a.domReference)){var e;const t=a.domReference;return n&&t.addEventListener("mouseleave",c),null==(e=a.floating)||e.addEventListener("mouseleave",c),h&&t.addEventListener("mousemove",o,{once:!0}),t.addEventListener("mouseenter",o),t.addEventListener("mouseleave",s),()=>{var e;n&&t.removeEventListener("mouseleave",c),null==(e=a.floating)||e.removeEventListener("mouseleave",c),h&&t.removeEventListener("mousemove",o),t.removeEventListener("mouseenter",o),t.removeEventListener("mouseleave",s)}}function t(){return!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)}function o(e){if(clearTimeout(x.current),S.current=!1,d&&!Ft(b.current)||f>0&&!Vr(v.current,"open"))return;const t=Vr(v.current,"open",b.current);t?x.current=window.setTimeout((()=>{y.current||r(!0,e,"hover")}),t):r(!0,e,"hover")}function s(e){if(t())return;k.current();const r=zt(a.floating);if(clearTimeout(_.current),g.current&&i.current.floatingContext){n||clearTimeout(x.current),w.current=g.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){R(),P(),T(e,!0,"safe-polygon")}});const t=w.current;return r.addEventListener("mousemove",t),void(k.current=()=>{r.removeEventListener("mousemove",t)})}("touch"!==b.current||!Ot(a.floating,e.relatedTarget))&&T(e)}function c(e){t()||i.current.floatingContext&&(null==g.current||g.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){R(),P(),T(e)}})(e))}}),[a,l,e,d,f,h,T,P,R,r,n,y,p,v,g,i]),Cr((()=>{var e;if(l&&n&&null!=(e=g.current)&&e.__options.blockPointerEvents&&C()){E.current=!0;const e=a.floating;if(pt(a.domReference)&&e){var t;const n=zt(a.floating).body;n.setAttribute(zr,"");const r=a.domReference,o=null==p||null==(t=p.nodesRef.current.find((e=>e.id===m)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[l,n,m,a,p,g,C]),Cr((()=>{n||(b.current=void 0,P(),R())}),[n,P,R]),o.useEffect((()=>()=>{P(),clearTimeout(x.current),clearTimeout(_.current),R()}),[l,a.domReference,P,R]);const O=o.useMemo((()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){S.current||y.current||r(!0,t,"hover")}d&&!Ft(b.current)||n||0===f||(clearTimeout(_.current),"touch"===b.current?o():_.current=window.setTimeout(o,f))}}}),[d,r,n,y,f]),A=o.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){T(e.nativeEvent,!1)}})),[T]);return o.useMemo((()=>l?{reference:O,floating:A}:{}),[l,O,A])}(W,Qo({move:!1,enabled:!j&&A.includes("hover")},M&&{handleClose:Bo()})),K=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:i,dataRef:s,elements:a}=e,{enabled:l=!0,visibleOnly:c=!0}=t,u=o.useRef(!1),d=o.useRef(),f=o.useRef(!0);o.useEffect((()=>{if(!l)return;const e=dt(a.domReference);function t(){!n&&mt(a.domReference)&&a.domReference===Rt(zt(a.domReference))&&(u.current=!0)}function r(){f.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[a.domReference,n,l]),o.useEffect((()=>{if(l)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(u.current=!0)}}),[i,l]),o.useEffect((()=>()=>{clearTimeout(d.current)}),[]);const h=o.useMemo((()=>({onPointerDown(e){jt(e.nativeEvent)||(f.current=!1)},onMouseLeave(){u.current=!1},onFocus(e){if(u.current)return;const t=Bt(e.nativeEvent);if(c&&pt(t))try{if(It()&&Lt())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!f.current&&!Ut(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){u.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=pt(t)&&t.hasAttribute(Lr("focus-guard"))&&"outside"===t.getAttribute("data-type");d.current=window.setTimeout((()=>{var e;const i=Rt(a.domReference?a.domReference.ownerDocument:document);(t||i!==a.domReference)&&(Ot(null==(e=s.current.floatingContext)?void 0:e.refs.floating.current,i)||Ot(a.domReference,i)||o||r(!1,n,"focus"))}))}})),[s,a.domReference,r,c]);return o.useMemo((()=>l?{reference:h}:{}),[l,h])}(W,{enabled:!j&&A.includes("focus")}),H=Ro([U,$,K,Eo(W),Lo(W,{role:"tooltip"})]),q=H.getReferenceProps,Y=H.getFloatingProps,X=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:i,common:s,duration:a=250}=t,l=e.placement,c=l.split("-")[0],u=o.useMemo((()=>({side:c,placement:l})),[c,l]),d="number"==typeof a,f=(d?a:a.open)||0,h=(d?a:a.close)||0,[p,m]=o.useState((()=>({...zo(s,u),...zo(n,u)}))),{isMounted:g,status:v}=function(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:i=250}=t,s=("number"==typeof i?i:i.close)||0,[a,l]=o.useState("unmounted"),c=function(e,t){const[n,r]=o.useState(e);return e&&!n&&r(!0),o.useEffect((()=>{if(!e&&n){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,n,t]),n}(n,s);return c||"close"!==a||l("unmounted"),Cr((()=>{if(r){if(n){l("initial");const e=requestAnimationFrame((()=>{l("open")}));return()=>{cancelAnimationFrame(e)}}l("close")}}),[n,r]),{isMounted:c,status:a}}(e,{duration:a}),y=Fr(n),b=Fr(r),x=Fr(i),w=Fr(s);return Cr((()=>{const e=zo(y.current,u),t=zo(x.current,u),n=zo(w.current,u),r=zo(b.current,u)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===v&&m((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===v&&m({transitionProperty:Object.keys(r).map(Fo).join(","),transitionDuration:f+"ms",...n,...r}),"close"===v){const r=t||e;m({transitionProperty:Object.keys(r).map(Fo).join(","),transitionDuration:h+"ms",...n,...r})}}),[h,x,y,b,w,f,v,u]),{isMounted:g,styles:p}}(W,{duration:150,initial:{opacity:0},open:{opacity:1},close:{opacity:0}}),G=X.isMounted,J=X.styles,Z=null===(t={light:"bg-tooltip-background-light text-text-primary",dark:"bg-tooltip-background-dark text-text-on-color"})||void 0===t?void 0:t[l],Q="dark"===l?"text-tooltip-background-dark":"text-tooltip-background-light";return i().createElement(i().Fragment,null,(0,o.isValidElement)(y)&&(0,o.cloneElement)(y,Qo(Qo({},y.props),{},{ref:Xo(y.ref,V.setReference),className:te(y.props.className)},q())),i().createElement(ao,{id:S,root:w},G&&i().createElement("div",Jo({className:te("absolute z-20 py-2 px-3 rounded-md text-xs leading-4 shadow-soft-shadow-lg",Z,"max-w-80 w-fit",b),ref:V.setFloating,style:Qo(Qo({},B),J)},Y()),i().createElement("div",null,!!f&&i().createElement("span",{className:"font-semibold"},f),!!h&&i().createElement("div",{className:"font-normal"},h)),m&&i().createElement(Nr,{ref:F,context:W,placement:u,className:te("fill-current",Q)}))))},ri=["slug","text","icon","className","disabled","isFirstChild","isLastChild"];function oi(){return oi=Object.assign?Object.assign.bind():function(e){for(var t=1;tsvg]:h-4 [&>svg]:w-4",sm:"py-2 px-2 text-base gap-1 [&>svg]:h-4 [&>svg]:w-4",md:"py-2.5 px-2.5 text-base gap-1 [&>svg]:h-5 [&>svg]:w-5"}[g],"border-0 border-r border-border-subtle border-solid",p===r?"bg-button-disabled":"",d?"rounded-tl rounded-bl border-0 border-r border-border-subtle":"",f?"rounded-tr rounded-br border-0":"",l);return i().createElement("button",oi({ref:t,className:y,disabled:u,onClick:function(e){m(e,{slug:r,text:s})}},h),"left"===v&&a&&i().createElement("span",{className:"mr-1"},a),s,"right"===v&&a&&i().createElement("span",{className:"ml-1"},a))},ai=(0,o.forwardRef)(si);ai.displayName="Button";var li={Group:function(e){var t=e.children,n=e.activeItem,r=void 0===n?null:n,s=e.onChange,a=e.className,l=e.size,c=void 0===l?"md":l,u=e.iconPosition,d=void 0===u?"left":u,f=(0,o.useCallback)((function(e,t){s&&s({event:e,value:t})}),[s]),h=te("box-border flex border border-border-subtle border-solid rounded",a);return i().createElement("div",{className:h},i().createElement(ii.Provider,{value:{activeItem:r,onChange:f,size:c,iconPosition:d}},i().Children.map(t,(function(e,n){if(!(0,o.isValidElement)(e))return null;var r=0===n,s=n===i().Children.count(t)-1;return i().cloneElement(e,{index:n,isFirstChild:r,isLastChild:s})}))))},Button:ai},ci=li;function ui(e){if("undefined"==typeof Proxy)return e;const t=new Map;return new Proxy(e,{get:(n,r)=>(t.has(r)||t.set(r,e(r)),t.get(r))})}function di(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const fi=e=>Array.isArray(e);function hi(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function gi(e,t,n,r){if("function"==typeof t){const[o,i]=mi(r);t=t(void 0!==n?n:e.custom,o,i)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,i]=mi(r);t=t(void 0!==n?n:e.custom,o,i)}return t}function vi(e,t,n){const r=e.getProps();return gi(r,t,void 0!==n?n:r.custom,e)}const yi=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],bi=["initial",...yi],xi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],wi=new Set(xi),_i=e=>1e3*e,Si=e=>e/1e3,Ei={type:"spring",stiffness:500,damping:25,restSpeed:10},ki={type:"keyframes",duration:.8},Ci={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ti=(e,{keyframes:t})=>t.length>2?ki:wi.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Ei:Ci;function Pi(e,t){return e[t]||e.default||e}const Ri=e=>null!==e;function Oi(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(Ri),i=t&&"loop"!==n&&t%2==1?0:o.length-1;return i&&void 0!==r?r:o[i]}const Ai=e=>e,Ni=["read","resolveKeyframes","update","preRender","render","postRender"];function Mi(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=Ni.reduce(((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,o=!1;const i=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function a(t){i.has(t)&&(l.schedule(t),e()),t(s)}const l={schedule:(e,o=!1,s=!1)=>{const a=s&&r?t:n;return o&&i.add(e),a.has(e)||a.add(e),e},cancel:e=>{n.delete(e),i.delete(e)},process:e=>{s=e,r?o=!0:(r=!0,[t,n]=[n,t],n.clear(),t.forEach(a),r=!1,o&&(o=!1,l.process(e)))}};return l}(i),e)),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:f}=s,h=()=>{const i=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1),o.timestamp=i,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(h))};return{schedule:Ni.reduce(((t,i)=>{const a=s[i];return t[i]=(t,i=!1,s=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(h)),a.schedule(t,i,s)),t}),{}),cancel:e=>{for(let t=0;t/^0[^.\s]+$/u.test(e);let zi=Ai,Vi=Ai;const Bi=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Wi=e=>t=>"string"==typeof t&&t.startsWith(e),Ui=Wi("--"),$i=Wi("var(--"),Ki=e=>!!$i(e)&&Hi.test(e.split("/*")[0].trim()),Hi=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,qi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Yi(e,t,n=1){Vi(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=function(e){const t=qi.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${null!=n?n:r}`,o]}(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const e=i.trim();return Bi(e)?parseFloat(e):e}return Ki(o)?Yi(o,t,n+1):o}const Xi=(e,t,n)=>n>t?t:n"number"==typeof e,parse:parseFloat,transform:e=>e},Ji={...Gi,transform:e=>Xi(0,1,e)},Zi={...Gi,default:1},Qi=e=>Math.round(1e5*e)/1e5,es=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,ts=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,ns=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function rs(e){return"string"==typeof e}const os=e=>({test:t=>rs(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),is=os("deg"),ss=os("%"),as=os("px"),ls=os("vh"),cs=os("vw"),us={...ss,parse:e=>ss.parse(e)/100,transform:e=>ss.transform(100*e)},ds=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),fs=e=>e===Gi||e===as,hs=(e,t)=>parseFloat(e.split(", ")[t]),ps=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return hs(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?hs(t[1],e):0}},ms=new Set(["x","y","z"]),gs=xi.filter((e=>!ms.has(e))),vs={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-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:ps(4,13),y:ps(5,14)};vs.translateX=vs.x,vs.translateY=vs.y;const ys=e=>t=>t.test(e),bs=[Gi,as,ss,is,cs,ls,{test:e=>"auto"===e,parse:e=>e}],xs=e=>bs.find(ys(e)),ws=new Set;let _s=!1,Ss=!1;function Es(){if(Ss){const e=Array.from(ws).filter((e=>e.needsMeasurement)),t=new Set(e.map((e=>e.element))),n=new Map;t.forEach((e=>{const t=function(e){const t=[];return gs.forEach((n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),t}(e);t.length&&(n.set(e,t),e.render())})),e.forEach((e=>e.measureInitialState())),t.forEach((e=>{e.render();const t=n.get(e);t&&t.forEach((([t,n])=>{var r;null===(r=e.getValue(t))||void 0===r||r.set(n)}))})),e.forEach((e=>e.measureEndState())),e.forEach((e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)}))}Ss=!1,_s=!1,ws.forEach((e=>e.complete())),ws.clear()}function ks(){ws.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&(Ss=!0)}))}class Cs{constructor(e,t,n,r,o,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=o,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ws.add(this),_s||(_s=!0,ji.read(ks),ji.resolveKeyframes(Es))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let o=0;on=>Boolean(rs(n)&&ns.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ps=(e,t,n)=>r=>{if(!rs(r))return r;const[o,i,s,a]=r.match(es);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},Rs={...Gi,transform:e=>Math.round((e=>Xi(0,255,e))(e))},Os={test:Ts("rgb","red"),parse:Ps("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Rs.transform(e)+", "+Rs.transform(t)+", "+Rs.transform(n)+", "+Qi(Ji.transform(r))+")"},As={test:Ts("#"),parse:function(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:Os.transform},Ns={test:Ts("hsl","hue"),parse:Ps("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+ss.transform(Qi(t))+", "+ss.transform(Qi(n))+", "+Qi(Ji.transform(r))+")"},Ms={test:e=>Os.test(e)||As.test(e)||Ns.test(e),parse:e=>Os.test(e)?Os.parse(e):Ns.test(e)?Ns.parse(e):As.parse(e),transform:e=>rs(e)?e:e.hasOwnProperty("red")?Os.transform(e):Ns.transform(e)},js="number",Is="color",Ds="var",Ls="var(",Fs="${}",zs=/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;function Vs(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const s=t.replace(zs,(e=>(Ms.test(e)?(r.color.push(i),o.push(Is),n.push(Ms.parse(e))):e.startsWith(Ls)?(r.var.push(i),o.push(Ds),n.push(e)):(r.number.push(i),o.push(js),n.push(parseFloat(e))),++i,Fs))).split(Fs);return{values:n,split:s,indexes:r,types:o}}function Bs(e){return Vs(e).values}function Ws(e){const{split:t,types:n}=Vs(e),r=t.length;return e=>{let o="";for(let i=0;i"number"==typeof e?0:e,$s={test:function(e){var t,n;return isNaN(e)&&rs(e)&&((null===(t=e.match(es))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(ts))||void 0===n?void 0:n.length)||0)>0},parse:Bs,createTransformer:Ws,getAnimatableNone:function(e){const t=Bs(e);return Ws(e)(t.map(Us))}},Ks=new Set(["brightness","contrast","saturate","opacity"]);function Hs(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(es)||[];if(!r)return e;const o=n.replace(r,"");let i=Ks.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const qs=/\b([a-z-]*)\(.*?\)/gu,Ys={...$s,getAnimatableNone:e=>{const t=e.match(qs);return t?t.map(Hs).join(" "):e}},Xs={...Gi,transform:Math.round},Gs={borderWidth:as,borderTopWidth:as,borderRightWidth:as,borderBottomWidth:as,borderLeftWidth:as,borderRadius:as,radius:as,borderTopLeftRadius:as,borderTopRightRadius:as,borderBottomRightRadius:as,borderBottomLeftRadius:as,width:as,maxWidth:as,height:as,maxHeight:as,size:as,top:as,right:as,bottom:as,left:as,padding:as,paddingTop:as,paddingRight:as,paddingBottom:as,paddingLeft:as,margin:as,marginTop:as,marginRight:as,marginBottom:as,marginLeft:as,rotate:is,rotateX:is,rotateY:is,rotateZ:is,scale:Zi,scaleX:Zi,scaleY:Zi,scaleZ:Zi,skew:is,skewX:is,skewY:is,distance:as,translateX:as,translateY:as,translateZ:as,x:as,y:as,z:as,perspective:as,transformPerspective:as,opacity:Ji,originX:us,originY:us,originZ:as,zIndex:Xs,backgroundPositionX:as,backgroundPositionY:as,fillOpacity:Ji,strokeOpacity:Ji,numOctaves:Xs},Js={...Gs,color:Ms,backgroundColor:Ms,outlineColor:Ms,fill:Ms,stroke:Ms,borderColor:Ms,borderTopColor:Ms,borderRightColor:Ms,borderBottomColor:Ms,borderLeftColor:Ms,filter:Ys,WebkitFilter:Ys},Zs=e=>Js[e];function Qs(e,t){let n=Zs(e);return n!==Ys&&(n=$s),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const ea=new Set(["auto","none","0"]);class ta extends Cs{constructor(e,t,n,r,o){super(e,t,n,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}function na(e){let t;return()=>(void 0===t&&(t=e()),t)}let ra;function oa(){ra=void 0}const ia={now:()=>(void 0===ra&&ia.set(Di.isProcessing?Di.timestamp:performance.now()),ra),set:e=>{ra=e,queueMicrotask(oa)}},sa=(e,t)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!$s.test(e)&&"0"!==e||e.startsWith("url(")));class aa{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ia.now(),this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:o,repeatType:i,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(ks(),Es()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=ia.now(),this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:o,delay:i,onComplete:s,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const i=e[e.length-1],s=sa(o,t),a=sa(i,t);return zi(s===a,`You are trying to animate ${t} from "${o}" to "${i}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${i} via the \`style\` property.`),!(!s||!a)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n{this.resolveFinishedPromise=e}))}}function la(e,t){return t?e*(1e3/t):0}const ca=5;function ua(e,t,n){const r=Math.max(t-ca,0);return la(n-e(r),t-r)}const da=.001,fa=.01,ha=10,pa=.05,ma=1;const ga=12;function va(e,t){return e*Math.sqrt(1-t*t)}const ya=["duration","bounce"],ba=["stiffness","damping","mass"];function xa(e,t){return t.some((t=>void 0!==e[t]))}function wa({keyframes:e,restDelta:t,restSpeed:n,...r}){const o=e[0],i=e[e.length-1],s={done:!1,value:o},{stiffness:a,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:f}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!xa(e,ba)&&xa(e,ya)){const n=function({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i;zi(e<=_i(ha),"Spring duration must be 10 seconds or less");let s=1-t;s=Xi(pa,ma,s),e=Xi(fa,ha,Si(e)),s<1?(o=t=>{const r=t*s,o=r*e,i=r-n,a=va(t,s),l=Math.exp(-o);return da-i/a*l},i=t=>{const r=t*s*e,i=r*n+n,a=Math.pow(s,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=va(Math.pow(t,2),s);return(-o(t)+da>0?-1:1)*((i-a)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-da,i=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let n=1;n{const n=Math.exp(-p*g*t);return i-n*((h+p*g*m)/e*Math.sin(e*t)+m*Math.cos(e*t))}}else if(1===p)y=e=>i-Math.exp(-g*e)*(m+(h+g*m)*e);else{const e=g*Math.sqrt(p*p-1);y=t=>{const n=Math.exp(-p*g*t),r=Math.min(e*t,300);return i-n*((h+p*g*m)*Math.sinh(r)+e*m*Math.cosh(r))/e}}return{calculatedDuration:f&&u||null,next:e=>{const r=y(e);if(f)s.done=e>=u;else{let o=0;p<1&&(o=0===e?_i(h):ua(y,e,r));const a=Math.abs(o)<=n,l=Math.abs(i-r)<=t;s.done=a&&l}return s.value=s.done?i:r,s}}}function _a({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},h=e=>void 0===a?l:void 0===l||Math.abs(a-e)-p*Math.exp(-e/r),y=e=>g+v(e),b=e=>{const t=v(e),n=y(e);f.done=Math.abs(t)<=c,f.value=f.done?g:n};let x,w;const _=e=>{(e=>void 0!==a&&el)(f.value)&&(x=e,w=wa({keyframes:[f.value,h(f.value)],velocity:ua(y,e,f.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return _(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==x||(t=!0,b(e),_(e)),void 0!==x&&e>=x?w.next(e-x):(!t&&b(e),f)}}}const Sa=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Ea(e,t,n,r){if(e===t&&n===r)return Ai;return o=>0===o||1===o?o:Sa(function(e,t,n,r,o){let i,s,a=0;do{s=t+(n-t)/2,i=Sa(s,r,o)-e,i>0?n=s:t=s}while(Math.abs(i)>1e-7&&++a<12);return s}(o,0,1,e,n),t,r)}const ka=Ea(.42,0,1,1),Ca=Ea(0,0,.58,1),Ta=Ea(.42,0,.58,1),Pa=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ra=e=>t=>1-e(1-t),Oa=e=>1-Math.sin(Math.acos(e)),Aa=Ra(Oa),Na=Pa(Oa),Ma=Ea(.33,1.53,.69,.99),ja=Ra(Ma),Ia=Pa(ja),Da={linear:Ai,easeIn:ka,easeInOut:Ta,easeOut:Ca,circIn:Oa,circInOut:Na,circOut:Aa,backIn:ja,backInOut:Ia,backOut:Ma,anticipate:e=>(e*=2)<1?.5*ja(e):.5*(2-Math.pow(2,-10*(e-1)))},La=e=>{if(Array.isArray(e)){Vi(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return Ea(t,n,r,o)}return"string"==typeof e?(Vi(void 0!==Da[e],`Invalid easing type '${e}'`),Da[e]):e},Fa=(e,t)=>n=>t(e(n)),za=(...e)=>e.reduce(Fa),Va=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},Ba=(e,t,n)=>e+(t-e)*n;function Wa(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ua(e,t){return n=>n>0?t:e}const $a=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Ka=[As,Os,Ns];function Ha(e){const t=(e=>Ka.find((t=>t.test(e))))(e);if(zi(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let n=t.parse(e);return t===Ns&&(n=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,i=0,s=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;o=Wa(a,r,e+1/3),i=Wa(a,r,e),s=Wa(a,r,e-1/3)}else o=i=s=n;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*s),alpha:r}}(n)),n}const qa=(e,t)=>{const n=Ha(e),r=Ha(t);if(!n||!r)return Ua(e,t);const o={...n};return e=>(o.red=$a(n.red,r.red,e),o.green=$a(n.green,r.green,e),o.blue=$a(n.blue,r.blue,e),o.alpha=Ba(n.alpha,r.alpha,e),Os.transform(o))},Ya=new Set(["none","hidden"]);function Xa(e,t){return n=>Ba(e,t,n)}function Ga(e){return"number"==typeof e?Xa:"string"==typeof e?Ki(e)?Ua:Ms.test(e)?qa:Qa:Array.isArray(e)?Ja:"object"==typeof e?Ms.test(e)?qa:Za:Ua}function Ja(e,t){const n=[...e],r=n.length,o=e.map(((e,n)=>Ga(e)(e,t[n])));return e=>{for(let t=0;t{for(const t in r)n[t]=r[t](e);return n}}const Qa=(e,t)=>{const n=$s.createTransformer(t),r=Vs(e),o=Vs(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Ya.has(e)&&!o.values.length||Ya.has(t)&&!r.values.length?function(e,t){return Ya.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):za(Ja(function(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let i=0;iArray.isArray(e)&&"number"!=typeof e[0])(r)?r.map(La):La(r),i={done:!1,value:t[0]},s=function(e,t){return e.map((e=>e*t))}(n&&n.length===t.length?n:function(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Va(0,t,r);e.push(Ba(n,1,o))}}(t,e.length-1),t}(t),e),a=function(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(Vi(i===t.length,"Both input and output ranges must be the same length"),1===i)return()=>t[0];if(2===i&&e[0]===e[1])return()=>t[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const r=[],o=n||el,i=e.length-1;for(let n=0;n{let n=0;if(a>1)for(;nl(Xi(e[0],e[i-1],t)):l}(s,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map((()=>c||Ta)).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(i.value=a(t),i.done=t>=e,i)}}const nl=e=>{const t=({timestamp:t})=>e(t);return{start:()=>ji.update(t,!0),stop:()=>Ii(t),now:()=>Di.isProcessing?Di.timestamp:ia.now()}},rl={decay:_a,inertia:_a,tween:tl,keyframes:tl,spring:wa},ol=e=>e/100;class il extends aa{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:t,motionValue:n,element:r,keyframes:o}=this.options,i=(null==r?void 0:r.KeyframeResolver)||Cs;this.resolver=new i(o,((e,t)=>this.onKeyframesResolved(e,t)),t,n,r),this.resolver.scheduleResolve()}initPlayback(e){const{type:t="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:i=0}=this.options,s=rl[t]||tl;let a,l;s!==tl&&"number"!=typeof e[0]&&(a=za(ol,el(e[0],e[1])),e=[0,100]);const c=s({...this.options,keyframes:e});"mirror"===o&&(l=s({...this.options,keyframes:[...e].reverse(),velocity:-i})),null===c.calculatedDuration&&(c.calculatedDuration=function(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}(c));const{calculatedDuration:u}=c,d=u+r;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(n+1)-r}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:n}=this;if(!n){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:r,generator:o,mirroredGenerator:i,mapPercentToKeyframes:s,keyframes:a,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=n;if(null===this.startTime)return o.next(0);const{delay:d,repeat:f,repeatType:h,repeatDelay:p,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let y=this.currentTime,b=o;if(f){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,f+1),Boolean(t%2)&&("reverse"===h?(n=1-n,p&&(n-=p/u)):"mirror"===h&&(b=i)),y=Xi(0,1,n)*u}const x=v?{done:!1,value:a[0]}:b.next(y);s&&(x.value=s(x.value));let{done:w}=x;v||null===l||(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const _=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return _&&void 0!==r&&(x.value=Oi(a,this.options,r)),m&&m(x.value),_&&this.finish(),x}get duration(){const{resolved:e}=this;return e?Si(e.calculatedDuration):0}get time(){return Si(this.currentTime)}set time(e){e=_i(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Si(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=nl,onPlay:t,startTime:n}=this.options;this.driver||(this.driver=e((e=>this.tick(e)))),t&&t();const r=this.driver.now();null!==this.holdTime?this.startTime=r-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=r):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const sl=new Set(["opacity","clipPath","filter","transform"]),al=e=>Array.isArray(e)&&"number"==typeof e[0];function ll(e){return Boolean(!e||"string"==typeof e&&e in ul||al(e)||Array.isArray(e)&&e.every(ll))}const cl=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,ul={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cl([0,.65,.55,1]),circOut:cl([.55,0,1,.45]),backIn:cl([.31,.01,.66,-.59]),backOut:cl([.33,1.53,.69,.99])};function dl(e){return fl(e)||ul.easeOut}function fl(e){return e?al(e)?cl(e):Array.isArray(e)?e.map(dl):ul[e]:void 0}const hl=na((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));class pl extends aa{constructor(e){super(e);const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new ta(o,((e,t)=>this.onKeyframesResolved(e,t)),t,n,r),this.resolver.scheduleResolve()}initPlayback(e,t){var n;let{duration:r=300,times:o,ease:i,type:s,motionValue:a,name:l,startTime:c}=this.options;if(!(null===(n=a.owner)||void 0===n?void 0:n.current))return!1;if("spring"===(u=this.options).type||!ll(u.ease)){const{onComplete:t,onUpdate:n,motionValue:a,element:l,...c}=this.options,u=function(e,t){const n=new il({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let i=0;for(;!r.done&&i<2e4;)r=n.sample(i),o.push(r.value),i+=10;return{times:void 0,keyframes:o,duration:i-10,ease:"linear"}}(e,c);1===(e=u.keyframes).length&&(e[1]=e[0]),r=u.duration,o=u.times,i=u.ease,s="keyframes"}var u;const d=function(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=fl(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:"reverse"===s?"alternate":"normal"})}(a.owner.current,l,e,{...this.options,duration:r,times:o,ease:i});return d.startTime=null!=c?c:this.calcStartTime(),this.pendingTimeline?(d.timeline=this.pendingTimeline,this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:n}=this.options;a.set(Oi(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:o,type:s,ease:i,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return Si(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return Si(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=_i(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return Ai;const{animation:n}=t;n.timeline=e,n.onfinish=null}else this.pendingTimeline=e;return Ai}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:n,duration:r,type:o,ease:i,times:s}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:a,element:l,...c}=this.options,u=new il({...c,keyframes:n,duration:r,type:o,ease:i,times:s,isGenerator:!0}),d=_i(this.time);e.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;return hl()&&n&&sl.has(n)&&t&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate&&!r&&"mirror"!==o&&0!==i&&"inertia"!==s}}const ml=na((()=>void 0!==window.ScrollTimeline));class gl{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,t){return Promise.all(this.animations).then(e).catch(t)}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n{if(!ml()||!t.attachTimeline)return t.pause(),function(e,n){let r;const o=()=>{const{currentTime:e}=n,o=(null===e?0:e.value)/100;r!==o&&(e=>{t.time=t.duration*e})(o),r=o};return ji.update(o,!0),()=>Ii(o)}(0,e);t.attachTimeline(e)}));return()=>{t.forEach(((e,t)=>{e&&e(),this.animations[t].stop()}))}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;tt[e]()))}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const vl=(e,t,n,r={},o,i,s)=>a=>{const l=Pi(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u-=_i(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:e=>{t.set(e),l.onUpdate&&l.onUpdate(e)},onComplete:()=>{a(),l.onComplete&&l.onComplete(),s&&s()},onStop:s,name:e,motionValue:t,element:i?void 0:o};(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(l)||(d={...d,...Ti(e,d)}),d.duration&&(d.duration=_i(d.duration)),d.repeatDelay&&(d.repeatDelay=_i(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let f=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(d.duration=0,0===d.delay&&(f=!0)),f&&!i&&void 0!==t.get()){const e=Oi(d.keyframes,l);if(void 0!==e)return ji.update((()=>{d.onUpdate(e),d.onComplete()})),new gl([])}return!i&&pl.supports(d)?new pl(d):new il(d)},yl=e=>Boolean(e&&"object"==typeof e&&e.mix&&e.toValue),bl=e=>fi(e)?e[e.length-1]||0:e;function xl(e,t){-1===e.indexOf(t)&&e.push(t)}function wl(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class _l{constructor(){this.subscriptions=[]}add(e){return xl(this.subscriptions,e),()=>wl(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o{const n=ia.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=ia.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new _l);const n=this.events[e].add(t);return"change"===e?()=>{n(),ji.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Sl.current&&Sl.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=ia.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return la(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise((t=>{this.hasAnimated=!0,this.animation=e(t),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.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function kl(e,t){return new El(e,t)}function Cl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,kl(n))}const Tl=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Pl="data-"+Tl("framerAppearId");function Rl(e){return e.props[Pl]}function Ol(e){return wi.has(e)?"transform":sl.has(e)?Tl(e):void 0}class Al extends El{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){const t=Ol(e);if(!t)return;const n=this.counts.get(t)||0;this.counts.set(t,n+1),0===n&&(this.output.push(t),this.update());let r=!1;return()=>{if(r)return;r=!0;const e=this.counts.get(t)-1;this.counts.set(t,e),0===e&&(wl(this.output,t),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}const Nl=e=>Boolean(e&&e.getVelocity);function Ml(e,t){var n;if(!e.applyWillChange)return;let r=e.getValue("willChange");return r||(null===(n=e.props.style)||void 0===n?void 0:n.willChange)||(r=new Al("auto"),e.addValue("willChange",r)),o=r,Boolean(Nl(o)&&o.add)?r.add(t):void 0;var o}function jl({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function Il(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var i;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(s=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const t in l){const r=e.getValue(t,null!==(i=e.latestValues[t])&&void 0!==i?i:null),o=l[t];if(void 0===o||u&&jl(u,t))continue;const a={delay:n,...Pi(s||{},t)};let d=!1;if(window.MotionHandoffAnimation){const n=Rl(e);if(n){const e=window.MotionHandoffAnimation(n,t,ji);null!==e&&(a.startTime=e,d=!0)}}r.start(vl(t,r,o,e.shouldReduceMotion&&wi.has(t)?{type:!1}:a,e,d,Ml(e,t)));const f=r.animation;f&&c.push(f)}return a&&Promise.all(c).then((()=>{ji.update((()=>{a&&function(e,t){const n=vi(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const t in i)Cl(e,t,bl(i[t]))}(e,a)}))})),c}function Dl(e,t,n={}){var r;const o=vi(e,t,"exit"===n.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const s=o?()=>Promise.all(Il(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:s,staggerDirection:a}=i;return function(e,t,n=0,r=0,o=1,i){const s=[],a=(e.variantChildren.size-1)*r,l=1===o?(e=0)=>e*r:(e=0)=>a-e*r;return Array.from(e.variantChildren).sort(Ll).forEach(((e,r)=>{e.notify("AnimationStart",t),s.push(Dl(e,t,{...i,delay:n+l(r)}).then((()=>e.notify("AnimationComplete",t))))})),Promise.all(s)}(e,t,o+r,s,a,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[e,t]="beforeChildren"===l?[s,a]:[a,s];return e().then((()=>t()))}return Promise.all([s(),a(n.delay)])}function Ll(e,t){return e.sortNodePosition(t)}const Fl=[...yi].reverse(),zl=yi.length;function Vl(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Bl(){return{animate:Vl(!0),whileInView:Vl(),whileHover:Vl(),whileTap:Vl(),whileDrag:Vl(),whileFocus:Vl(),exit:Vl()}}class Wl{constructor(e){this.isMounted=!1,this.node=e}update(){}}let Ul=0;const $l={animation:{Feature:class extends Wl{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=function(e){return t=>Promise.all(t.map((({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map((t=>Dl(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=Dl(e,t,n);else{const o="function"==typeof t?vi(e,t,n.custom):t;r=Promise.all(Il(e,o,n))}return r.then((()=>{e.notify("AnimationComplete",t)}))}(e,t,n))))}(e),n=Bl(),r=!0;const o=t=>(n,r)=>{var o;const i=vi(e,r,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(i){const{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function i(i){const s=e.getProps(),a=e.getVariantContext(!0)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;td&&v),w=!1;const _=Array.isArray(g)?g:[g];let S=_.reduce(o(p),{});!1===y&&(S={});const{prevResolvedValues:E={}}=m,k={...E,...S},C=t=>{x=!0,c.has(t)&&(w=!0,c.delete(t)),m.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in k){const t=S[e],n=E[e];if(u.hasOwnProperty(e))continue;let r=!1;r=fi(t)&&fi(n)?!hi(t,n):t!==n,r?null!=t?C(e):c.add(e):void 0!==t&&c.has(e)?C(e):m.protectedKeys[e]=!0}m.prevProp=g,m.prevResolvedValues=S,m.isActive&&(u={...u,...S}),r&&e.blockInitialAnimation&&(x=!1),!x||b&&!w||l.push(..._.map((e=>({animation:e,options:{type:p}}))))}var f,h;if(c.size){const t={};c.forEach((n=>{const r=e.getBaseTarget(n),o=e.getValue(n);o&&(o.liveStyle=!0),t[n]=null!=r?r:null})),l.push({animation:t})}let p=Boolean(l.length);return!r||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(p=!1),r=!1,p?t(l):Promise.resolve()}return{animateChanges:i,setActive:function(t,r){var o;if(n[t].isActive===r)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach((e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)})),n[t].isActive=r;const s=i(t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=Bl(),r=!0}}}(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();di(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}},exit:{Feature:class extends Wl{constructor(){super(...arguments),this.id=Ul++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then((()=>t(this.id)))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},Kl=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function Hl(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}const ql=e=>t=>Kl(t)&&e(t,Hl(t));function Yl(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Xl(e,t,n,r){return Yl(e,t,ql(n),r)}const Gl=(e,t)=>Math.abs(e-t);class Jl{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=ec(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=Gl(e.x,t.x),r=Gl(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=Di;this.history.push({...r,timestamp:o});const{onStart:i,onMove:s}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=Zl(t,this.transformPagePoint),ji.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const i=ec("pointercancel"===e.type?this.lastMoveEventInfo:Zl(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},!Kl(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const i=Zl(Hl(e),this.transformPagePoint),{point:s}=i,{timestamp:a}=Di;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,ec(i,this.history)),this.removeListeners=za(Xl(this.contextWindow,"pointermove",this.handlePointerMove),Xl(this.contextWindow,"pointerup",this.handlePointerUp),Xl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Ii(this.updatePoint)}}function Zl(e,t){return t?{point:t(e.point)}:e}function Ql(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ec({point:e},t){return{point:e,delta:Ql(e,nc(t)),offset:Ql(e,tc(t)),velocity:rc(t,.1)}}function tc(e){return e[0]}function nc(e){return e[e.length-1]}function rc(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=nc(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>_i(t)));)n--;if(!r)return{x:0,y:0};const i=Si(o.timestamp-r.timestamp);if(0===i)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function oc(e){let t=null;return()=>null===t&&(t=e,()=>{t=null})}const ic=oc("dragHorizontal"),sc=oc("dragVertical");function ac(e){let t=!1;if("y"===e)t=sc();else if("x"===e)t=ic();else{const e=ic(),n=sc();e&&n?t=()=>{e(),n()}:(e&&e(),n&&n())}return t}function lc(){const e=ac(!0);return!e||(e(),!1)}function cc(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}const uc=.9999,dc=1.0001,fc=-.01,hc=.01;function pc(e){return e.max-e.min}function mc(e,t,n,r=.5){e.origin=r,e.originPoint=Ba(t.min,t.max,e.origin),e.scale=pc(n)/pc(t),e.translate=Ba(n.min,n.max,e.origin)-e.originPoint,(e.scale>=uc&&e.scale<=dc||isNaN(e.scale))&&(e.scale=1),(e.translate>=fc&&e.translate<=hc||isNaN(e.translate))&&(e.translate=0)}function gc(e,t,n,r){mc(e.x,t.x,n.x,r?r.originX:void 0),mc(e.y,t.y,n.y,r?r.originY:void 0)}function vc(e,t,n){e.min=n.min+t.min,e.max=e.min+pc(t)}function yc(e,t,n){e.min=t.min-n.min,e.max=e.min+pc(t)}function bc(e,t,n){yc(e.x,t.x,n.x),yc(e.y,t.y,n.y)}function xc(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function wc(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Cc=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Tc(e){return[e("x"),e("y")]}function Pc({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Rc(e){return void 0===e||1===e}function Oc({scale:e,scaleX:t,scaleY:n}){return!Rc(e)||!Rc(t)||!Rc(n)}function Ac(e){return Oc(e)||Nc(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Nc(e){return Mc(e.x)||Mc(e.y)}function Mc(e){return e&&"0%"!==e}function jc(e,t,n){return n+t*(e-n)}function Ic(e,t,n,r,o){return void 0!==o&&(e=jc(e,o,r)),jc(e,n,r)+t}function Dc(e,t=0,n=1,r,o){e.min=Ic(e.min,t,n,r,o),e.max=Ic(e.max,t,n,r,o)}function Lc(e,{x:t,y:n}){Dc(e.x,t.translate,t.scale,t.originPoint),Dc(e.y,n.translate,n.scale,n.originPoint)}const Fc=.999999999999,zc=1.0000000000001;function Vc(e,t){e.min=e.min+t,e.max=e.max+t}function Bc(e,t,n,r,o=.5){Dc(e,t,n,Ba(e.min,e.max,o),r)}function Wc(e,t){Bc(e.x,t.x,t.scaleX,t.scale,t.originX),Bc(e.y,t.y,t.scaleY,t.scale,t.originY)}function Uc(e,t){return Pc(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}const $c=({current:e})=>e?e.ownerDocument.defaultView:null,Kc=new WeakMap;class Hc{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Cc(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new Jl(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(Hl(e,"page").point)},onStart:(e,t)=>{var n;const{drag:r,dragPropagation:o,onDragStart:i}=this.getProps();if(r&&!o&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=ac(r),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Tc((e=>{let t=this.getAxisMotionValue(e).get()||0;if(ss.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];r&&(t=pc(r)*(parseFloat(t)/100))}}this.originPoint[e]=t})),i&&ji.postRender((()=>i(e,t))),null===(n=this.removeWillChange)||void 0===n||n.call(this),this.removeWillChange=Ml(this.visualElement,"transform");const{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:i}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}(s),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),i&&i(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>Tc((e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())}))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:$c(this.visualElement)})}stop(e,t){var n;null===(n=this.removeWillChange)||void 0===n||n.call(this);const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=t;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i&&ji.postRender((()=>i(e,t)))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!qc(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=function(e,{min:t,max:n},r){return void 0!==t&&en&&(e=r?Ba(n,e,r.max):Math.min(e,n)),e}(i,this.constraints[e],this.elastic[e])),o.set(i)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&cc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:xc(e.x,n,o),y:xc(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=_c){return!1===e?e=0:!0===e&&(e=_c),{x:Sc(e,"left","right"),y:Sc(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Tc((e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))}))}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!cc(e))return!1;const n=e.current;Vi(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(e,t,n){const r=Uc(e,n),{scroll:o}=t;return o&&(Vc(r.x,o.offset.x),Vc(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:wc(e.x,t.x),y:wc(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(i));this.hasMutatedConstraints=!!e,e&&(i=Pc(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=Tc((s=>{if(!qc(s,t,this.currentDirection))return;let l=a&&a[s]||{};i&&(l={min:0,max:0});const c=r?200:1e6,u=r?40:1e7,d={type:"inertia",velocity:n?e[s]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(s,d)}));return Promise.all(l).then(s)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return n.start(vl(e,n,0,t,this.visualElement,!1,Ml(this.visualElement,e)))}stopAnimation(){Tc((e=>this.getAxisMotionValue(e).stop()))}pauseAnimation(){Tc((e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()}))}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Tc((t=>{const{drag:n}=this.getProps();if(!qc(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:i}=r.layout.layoutBox[t];o.set(e[t]-Ba(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!cc(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Tc((e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=pc(e),o=pc(t);return o>r?n=Va(t.min,t.max-r,e.min):r>o&&(n=Va(e.min,e.max-o,t.min)),Xi(0,1,n)}({min:n,max:n},this.constraints[e])}}));const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Tc((t=>{if(!qc(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(Ba(o,i,r[t]))}))}addListeners(){if(!this.visualElement.current)return;Kc.set(this.visualElement,this);const e=Xl(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),t=()=>{const{dragConstraints:e}=this.getProps();cc(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),ji.read(t);const o=Yl(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Tc((t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))})),this.visualElement.render())}));return()=>{o(),e(),r(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=_c,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function qc(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const Yc=e=>(t,n)=>{e&&ji.postRender((()=>e(t,n)))};var Xc=n(848);const Gc=(0,o.createContext)(null),Jc=(0,o.createContext)({}),Zc=(0,o.createContext)({}),Qc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function eu(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const tu={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!as.test(e))return e;e=parseFloat(e)}return`${eu(e,t.target.x)}% ${eu(e,t.target.y)}%`}},nu={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=$s.parse(e);if(o.length>5)return r;const i=$s.createTransformer(e),s="number"!=typeof o[0]?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=Ba(a,l,.5);return"number"==typeof o[2+s]&&(o[2+s]/=c),"number"==typeof o[3+s]&&(o[3+s]/=c),i(o)}},ru={},{schedule:ou,cancel:iu}=Mi(queueMicrotask,!1);class su extends o.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;var i;i=lu,Object.assign(ru,i),o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",(()=>{this.safeToRemove()})),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Qc.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,i=n.projection;return i?(i.isPresent=o,r||e.layoutDependency!==t||void 0===t?i.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?i.promote():i.relegate()||ji.postRender((()=>{const e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),ou.postRender((()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function au(e){const[t,n]=function(){const e=(0,o.useContext)(Gc);if(null===e)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=(0,o.useId)();(0,o.useEffect)((()=>r(i)),[]);const s=(0,o.useCallback)((()=>n&&n(i)),[i,n]);return!t&&n?[!1,s]:[!0]}(),r=(0,o.useContext)(Jc);return(0,Xc.jsx)(su,{...e,layoutGroup:r,switchLayoutGroup:(0,o.useContext)(Zc),isPresent:t,safeToRemove:n})}const lu={borderRadius:{...tu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:tu,borderTopRightRadius:tu,borderBottomLeftRadius:tu,borderBottomRightRadius:tu,boxShadow:nu},cu=["TopLeft","TopRight","BottomLeft","BottomRight"],uu=cu.length,du=e=>"string"==typeof e?parseFloat(e):e,fu=e=>"number"==typeof e||as.test(e);function hu(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const pu=gu(0,.5,Aa),mu=gu(.5,.95,Ai);function gu(e,t,n){return r=>rt?1:n(Va(e,t,r))}function vu(e,t){e.min=t.min,e.max=t.max}function yu(e,t){vu(e.x,t.x),vu(e.y,t.y)}function bu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function xu(e,t,n,r,o){return e=jc(e-=t,1/n,r),void 0!==o&&(e=jc(e,1/o,r)),e}function wu(e,t,[n,r,o],i,s){!function(e,t=0,n=1,r=.5,o,i=e,s=e){if(ss.test(t)&&(t=parseFloat(t),t=Ba(s.min,s.max,t/100)-s.min),"number"!=typeof t)return;let a=Ba(i.min,i.max,r);e===i&&(a-=t),e.min=xu(e.min,t,n,a,o),e.max=xu(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,i,s)}const _u=["x","scaleX","originX"],Su=["y","scaleY","originY"];function Eu(e,t,n,r){wu(e.x,t,_u,n?n.x:void 0,r?r.x:void 0),wu(e.y,t,Su,n?n.y:void 0,r?r.y:void 0)}function ku(e){return 0===e.translate&&1===e.scale}function Cu(e){return ku(e.x)&&ku(e.y)}function Tu(e,t){return e.min===t.min&&e.max===t.max}function Pu(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Ru(e,t){return Pu(e.x,t.x)&&Pu(e.y,t.y)}function Ou(e){return pc(e.x)/pc(e.y)}function Au(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Nu{constructor(){this.members=[]}add(e){xl(this.members,e),e.scheduleRender()}remove(e){if(wl(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex((t=>e===t));if(0===t)return!1;let n;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach((e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()}))}scheduleRender(){this.members.forEach((e=>{e.instance&&e.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Mu=(e,t)=>e.depth-t.depth;class ju{constructor(){this.children=[],this.isDirty=!1}add(e){xl(this.children,e),this.isDirty=!0}remove(e){wl(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Mu),this.isDirty=!1,this.children.forEach(e)}}function Iu(e){const t=Nl(e)?e.get():e;return yl(t)?t.toValue():t}const Du={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Lu="undefined"!=typeof window&&void 0!==window.MotionDebug,Fu=["","X","Y","Z"],zu={visibility:"hidden"};let Vu=0;function Bu(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Wu(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Rl(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ji,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Wu(r)}function Uu({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=Vu++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Lu&&(Du.totalNodes=Du.resolvedTargetDeltas=Du.recalculatedProjection=0),this.nodes.forEach(Hu),this.nodes.forEach(Qu),this.nodes.forEach(ed),this.nodes.forEach(qu),Lu&&window.MotionDebug.record(Du)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;e(t,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e){const t=ia.now(),n=({timestamp:r})=>{const o=r-t;o>=250&&(Ii(n),e(o-250))};return ji.read(n,!0),()=>Ii(n)}(r),Qc.hasAnimatedSinceResize&&(Qc.hasAnimatedSinceResize=!1,this.nodes.forEach(Zu))}))}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&s&&(o||i)&&this.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||sd,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!Ru(this.targetLayout,r)||n,c=!t&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...Pi(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||Zu(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ii(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(td),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Wu(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;eFc&&(t.x=1),t.yFc&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms=Cc());const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(bu(this.prevProjectionDelta.x,this.projectionDelta.x),bu(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),gc(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===s&&this.treeScale.y===a&&Au(this.projectionDelta.x,this.prevProjectionDelta.x)&&Au(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Lu&&Du.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=kc(),this.projectionDelta=kc(),this.projectionDeltaWithTransform=kc()}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},o={...this.latestValues},i=kc();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const s=Cc(),a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(id));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,f,h,p,m,g;rd(i.x,e.x,n),rd(i.y,e.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(bc(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),h=this.relativeTarget,p=this.relativeTargetOrigin,m=s,g=n,od(h.x,p.x,m.x,g),od(h.y,p.y,m.y,g),d&&(l=this.relativeTarget,f=d,Tu(l.x,f.x)&&Tu(l.y,f.y))&&(this.isProjectionDirty=!1),d||(d=Cc()),yu(d,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,i){o?(e.opacity=Ba(0,void 0!==n.opacity?n.opacity:1,pu(r)),e.opacityExit=Ba(void 0!==t.opacity?t.opacity:1,0,mu(r))):i&&(e.opacity=Ba(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let o=0;o{Qc.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=Nl(0)?0:kl(0);return r.start(vl("",r,1e3,n)),r.animation}(0,0,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0}))}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&ud(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Cc();const t=pc(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=pc(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}yu(t,n),Wc(t,o),gc(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Nu),this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&Bu("z",e,r,this.animationValues);for(let t=0;t{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()})),this.root.nodes.forEach(Xu),this.root.sharedNodes.clear()}}}function $u(e){e.updateLayout()}function Ku(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:o}=e.options,i=n.source!==e.layout.source;"size"===o?Tc((e=>{const r=i?n.measuredBox[e]:n.layoutBox[e],o=pc(r);r.min=t[e].min,r.max=r.min+o})):ud(o,n.layoutBox,t)&&Tc((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=pc(t[r]);o.max=o.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+s)}));const s=kc();gc(s,t,n.layoutBox);const a=kc();i?gc(a,e.applyTransform(r,!0),n.measuredBox):gc(a,t,n.layoutBox);const l=!Cu(s);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:i}=r;if(o&&i){const s=Cc();bc(s,n.layoutBox,o.layoutBox);const a=Cc();bc(a,t,i.layoutBox),Ru(s,a)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Hu(e){Lu&&Du.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function qu(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Yu(e){e.clearSnapshot()}function Xu(e){e.clearMeasurements()}function Gu(e){e.isLayoutDirty=!1}function Ju(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Zu(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Qu(e){e.resolveTargetDelta()}function ed(e){e.calcProjection()}function td(e){e.resetSkewAndRotation()}function nd(e){e.removeLeadSnapshot()}function rd(e,t,n){e.translate=Ba(t.translate,0,n),e.scale=Ba(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function od(e,t,n,r){e.min=Ba(t.min,n.min,r),e.max=Ba(t.max,n.max,r)}function id(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const sd={duration:.45,ease:[.4,0,.1,1]},ad=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ld=ad("applewebkit/")&&!ad("chrome/")?Math.round:Ai;function cd(e){e.min=ld(e.min),e.max=ld(e.max)}function ud(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=Ou(t),o=Ou(n),!(Math.abs(r-o)<=.2));var r,o}function dd(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const fd=Uu({attachResizeListener:(e,t)=>Yl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),hd={current:void 0},pd=Uu({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!hd.current){const e=new fd({});e.mount(window),e.setOptions({layoutScroll:!0}),hd.current=e}return hd.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),md={pan:{Feature:class extends Wl{constructor(){super(...arguments),this.removePointerDownListener=Ai}onPointerDown(e){this.session=new Jl(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$c(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Yc(e),onStart:Yc(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&ji.postRender((()=>r(e,t)))}}}mount(){this.removePointerDownListener=Xl(this.node.current,"pointerdown",(e=>this.onPointerDown(e)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends Wl{constructor(e){super(e),this.removeGroupControls=Ai,this.removeListeners=Ai,this.controls=new Hc(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ai}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:pd,MeasureLayout:au}};function gd(e,t){const n=t?"pointerenter":"pointerleave",r=t?"onHoverStart":"onHoverEnd";return Xl(e.current,n,((n,o)=>{if("touch"===n.pointerType||lc())return;const i=e.getProps();e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",t);const s=i[r];s&&ji.postRender((()=>s(n,o)))}),{passive:!e.getProps()[r]})}const vd=(e,t)=>!!t&&(e===t||vd(e,t.parentElement));function yd(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Hl(n))}const bd=new WeakMap,xd=new WeakMap,wd=e=>{const t=bd.get(e.target);t&&t(e)},_d=e=>{e.forEach(wd)};const Sd={some:0,all:1},Ed={inView:{Feature:class extends Wl{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:o}=e,i={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Sd[r]};return function(e,t,n){const r=function({root:e,...t}){const n=e||document;xd.has(n)||xd.set(n,{});const r=xd.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(_d,{root:e,...t})),r[o]}(t);return bd.set(e,n),r.observe(e),()=>{bd.delete(e),r.unobserve(e)}}(this.node.current,i,(e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,o&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),i=t?n:r;i&&i(e)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Wl{constructor(){super(...arguments),this.removeStartListeners=Ai,this.removeEndListeners=Ai,this.removeAccessibleListeners=Ai,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=Xl(window,"pointerup",((e,t)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:o}=this.node.getProps(),i=o||vd(this.node.current,e.target)?n:r;i&&ji.update((()=>i(e,t)))}),{passive:!(n.onTap||n.onPointerUp)}),o=Xl(window,"pointercancel",((e,t)=>this.cancelPress(e,t)),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=za(r,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=Yl(this.node.current,"keydown",(e=>{"Enter"!==e.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=Yl(this.node.current,"keyup",(e=>{"Enter"===e.key&&this.checkPressEnd()&&yd("up",((e,t)=>{const{onTap:n}=this.node.getProps();n&&ji.postRender((()=>n(e,t)))}))})),yd("down",((e,t)=>{this.startPress(e,t)})))})),t=Yl(this.node.current,"blur",(()=>{this.isPressing&&yd("cancel",((e,t)=>this.cancelPress(e,t)))}));this.removeAccessibleListeners=za(e,t)}}startPress(e,t){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&ji.postRender((()=>n(e,t)))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!lc()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&ji.postRender((()=>n(e,t)))}mount(){const e=this.node.getProps(),t=Xl(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=Yl(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=za(t,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends Wl{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=za(Yl(this.node.current,"focus",(()=>this.onFocus())),Yl(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends Wl{mount(){this.unmount=za(gd(this.node,!0),gd(this.node,!1))}unmount(){}}}},kd={layout:{ProjectionNode:pd,MeasureLayout:au}},Cd=(0,o.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Td=(0,o.createContext)({}),Pd="undefined"!=typeof window,Rd=Pd?o.useLayoutEffect:o.useEffect,Od=(0,o.createContext)({strict:!1});let Ad=!1;function Nd(e,t,n,r,i){var s;const{visualElement:a}=(0,o.useContext)(Td),l=(0,o.useContext)(Od),c=(0,o.useContext)(Gc),u=(0,o.useContext)(Cd).reducedMotion,d=(0,o.useRef)();r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:u}));const f=d.current,h=(0,o.useContext)(Zc);!f||f.projection||!i||"html"!==f.type&&"svg"!==f.type||function(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:jd(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:Boolean(s)||a&&cc(a),visualElement:e,animationType:"string"==typeof i?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}(d.current,n,i,h),(0,o.useInsertionEffect)((()=>{f&&f.update(n,c)}));const p=n[Pl],m=(0,o.useRef)(Boolean(p)&&!window.MotionHandoffIsComplete&&(null===(s=window.MotionHasOptimisedAnimation)||void 0===s?void 0:s.call(window,p)));return Rd((()=>{f&&(f.updateFeatures(),ou.render(f.render),m.current&&f.animationState&&f.animationState.animateChanges())})),(0,o.useEffect)((()=>{f&&(!m.current&&f.animationState&&f.animationState.animateChanges(),m.current=!1,Ad||(Ad=!0,queueMicrotask(Md)))})),f}function Md(){window.MotionHandoffIsComplete=!0}function jd(e){if(e)return!1!==e.options.allowProjection?e.projection:jd(e.parent)}function Id(e,t,n){return(0,o.useCallback)((r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):cc(n)&&(n.current=r))}),[t])}function Dd(e){return di(e.animate)||bi.some((t=>pi(e[t])))}function Ld(e){return Boolean(Dd(e)||e.variants)}function Fd(e){return Array.isArray(e)?e.join(" "):e}const zd={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Vd={};for(const e in zd)Vd[e]={isEnabled:t=>zd[e].some((e=>!!t[e]))};const Bd=Symbol.for("motionComponentSymbol");function Wd({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&function(e){for(const t in e)Vd[t]={...Vd[t],...e[t]}}(e);const s=(0,o.forwardRef)((function(e,s){let a;const l={...(0,o.useContext)(Cd),...e,layoutId:Ud(e)},{isStatic:c}=l,u=function(e){const{initial:t,animate:n}=function(e,t){if(Dd(e)){const{initial:t,animate:n}=e;return{initial:!1===t||pi(t)?t:void 0,animate:pi(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,o.useContext)(Td));return(0,o.useMemo)((()=>({initial:t,animate:n})),[Fd(t),Fd(n)])}(e),d=r(e,c);if(!c&&Pd){(0,o.useContext)(Od).strict;const e=function(e){const{drag:t,layout:n}=Vd;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==n?void 0:n.isEnabled(e))?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(l);a=e.MeasureLayout,u.visualElement=Nd(i,d,l,t,e.ProjectionNode)}return(0,Xc.jsxs)(Td.Provider,{value:u,children:[a&&u.visualElement?(0,Xc.jsx)(a,{visualElement:u.visualElement,...l}):null,n(i,e,Id(d,u.visualElement,s),d,c,u.visualElement)]})}));return s[Bd]=i,s}function Ud({layoutId:e}){const t=(0,o.useContext)(Jc).id;return t&&void 0!==e?t+"-"+e:e}const $d=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Kd(e){return"string"==typeof e&&!e.includes("-")&&!!($d.indexOf(e)>-1||/[A-Z]/u.test(e))}function Hd(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const t in n)e.style.setProperty(t,n[t])}const qd=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"]);function Yd(e,t,n,r){Hd(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(qd.has(n)?n:Tl(n),t.attrs[n])}function Xd(e,{layout:t,layoutId:n}){return wi.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!ru[e]||"opacity"===e)}function Gd(e,t,n){var r;const{style:o}=e,i={};for(const s in o)(Nl(o[s])||t.style&&Nl(t.style[s])||Xd(s,e)||void 0!==(null===(r=null==n?void 0:n.getValue(s))||void 0===r?void 0:r.liveStyle))&&(i[s]=o[s]);return n&&o&&"string"==typeof o.willChange&&(n.applyWillChange=!1),i}function Jd(e,t,n){const r=Gd(e,t,n);for(const n in e)(Nl(e[n])||Nl(t[n]))&&(r[-1!==xi.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}function Zd(e){const t=(0,o.useRef)(null);return null===t.current&&(t.current=e()),t.current}const Qd=e=>(t,n)=>{const r=(0,o.useContext)(Td),i=(0,o.useContext)(Gc),s=()=>function({applyWillChange:e=!1,scrapeMotionValuesFromProps:t,createRenderState:n,onMount:r},o,i,s,a){const l={latestValues:nf(o,i,s,!a&&e,t),renderState:n()};return r&&(l.mount=e=>r(o,e,l)),l}(e,t,r,i,n);return n?s():Zd(s)};function ef(e,t){const n=Ol(t);n&&xl(e,n)}function tf(e,t,n){const r=Array.isArray(t)?t:[t];for(let t=0;t{for(const t in e){let n=e[t];Array.isArray(n)&&(n=n[p?n.length-1:0]),null!==n&&(s[t]=n)}for(const e in t)s[e]=t[e]})),l&&(d&&!1!==u&&!di(d)&&tf(e,d,(e=>{for(const t in e)ef(a,t)})),a.length&&(s.willChange=a.join(","))),s}const rf=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),of=()=>({...rf(),attrs:{}}),sf=(e,t)=>t&&"number"==typeof e?t.transform(e):e,af={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},lf=xi.length;function cf(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const e in t){const n=t[e];if(wi.has(e))s=!0;else if(Ui(e))o[e]=n;else{const t=sf(n,Gs[e]);e.startsWith("origin")?(a=!0,i[e]=t):r[e]=t}}if(t.transform||(s||n?r.transform=function(e,t,n){let r="",o=!0;for(let i=0;i"string"==typeof e&&"svg"===e.toLowerCase(),mf={useVisualState:Qd({scrapeMotionValuesFromProps:Jd,createRenderState:of,onMount:(e,t,{renderState:n,latestValues:r})=>{ji.read((()=>{try{n.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){n.dimensions={x:0,y:0,width:0,height:0}}})),ji.render((()=>{hf(n,r,pf(t.tagName),e.transformTemplate),Yd(t,n)}))}})},gf={useVisualState:Qd({applyWillChange:!0,scrapeMotionValuesFromProps:Gd,createRenderState:rf})};function vf(e,t,n){for(const r in t)Nl(t[r])||Xd(r,n)||(e[r]=t[r])}function yf(e,t){const n={},r=function(e,t){const n={};return vf(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,o.useMemo)((()=>{const n=rf();return cf(n,t,e),Object.assign({},n.vars,n.style)}),[t])}(e,t)),n}(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const bf=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function xf(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||bf.has(e)}let wf=e=>!xf(e);try{(_f=n(316).A)&&(wf=e=>e.startsWith("on")?!xf(e):_f(e))}catch(e){}var _f;function Sf(e,t,n,r){const i=(0,o.useMemo)((()=>{const n=of();return hf(n,t,pf(r),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};vf(t,e.style,e),i.style={...t,...i.style}}return i}function Ef(e=!1){return(t,n,r,{latestValues:i},s)=>{const a=(Kd(t)?Sf:yf)(n,i,s,t),l=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(wf(o)||!0===n&&xf(o)||!t&&!xf(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(n,"string"==typeof t,e),c=t!==o.Fragment?{...l,...a,ref:r}:{},{children:u}=n,d=(0,o.useMemo)((()=>Nl(u)?u.get():u),[u]);return(0,o.createElement)(t,{...c,children:d})}}function kf(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return Wd({...Kd(n)?mf:gf,preloadedFeatures:e,useRender:Ef(r),createVisualElement:t,Component:n})}}const Cf={current:null},Tf={current:!1},Pf=new WeakMap,Rf=[...bs,Ms,$s],Of=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Af=bi.length;class Nf{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:o,visualState:i},s={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Cs,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,ji.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=s,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=Dd(t),this.isVariantNode=Ld(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in u){const t=u[e];void 0!==a[e]&&Nl(t)&&t.set(a[e],!1)}}mount(e){this.current=e,Pf.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((e,t)=>this.bindToMotionValue(t,e))),Tf.current||function(){if(Tf.current=!0,Pd)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Cf.current=e.matches;e.addListener(t),t()}else Cf.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Cf.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Pf.delete(this.current),this.projection&&this.projection.unmount(),Ii(this.notifyUpdate),Ii(this.render),this.valueSubscriptions.forEach((e=>e())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=wi.has(e),r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&ji.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=t.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,(()=>{r(),o(),i&&i(),t.owner&&t.stop()}))}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in Vd){const t=Vd[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Cc()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;tt.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=kl(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let r=void 0===this.latestValues[e]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,e))&&void 0!==n?n:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=r&&("string"==typeof r&&(Bi(r)||Fi(r))?r=parseFloat(r):!(e=>Rf.find(ys(e)))(r)&&$s.test(t)&&(r=Qs(e,t)),this.setBaseTarget(e,Nl(r)?r.get():r)),Nl(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const o=gi(this.props,n,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(r=o[e])}if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||Nl(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new _l),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class Mf extends Nf{constructor(){super(...arguments),this.KeyframeResolver=ta}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}}class jf extends Mf{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=Hd}readValueFromInstance(e,t){if(wi.has(t)){const e=Zs(t);return e&&e.default||0}{const r=(n=e,window.getComputedStyle(n)),o=(Ui(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return Uc(e,t)}build(e,t,n){cf(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Gd(e,t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Nl(e)&&(this.childSubscription=e.on("change",(e=>{this.current&&(this.current.textContent=`${e}`)})))}}class If extends Mf{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Cc}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(wi.has(t)){const e=Zs(t);return e&&e.default||0}return t=qd.has(t)?t:Tl(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Jd(e,t,n)}build(e,t,n){hf(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){Yd(e,t,0,r)}mount(e){this.isSVGTag=pf(e.tagName),super.mount(e)}}const Df=ui(kf({...$l,...Ed,...md,...kd},((e,t)=>Kd(e)?new If(t):new jf(t,{allowProjection:e!==o.Fragment}))));var Lf=["slug","text","icon","className","disabled","badge"];function Ff(){return Ff=Object.assign?Object.assign.bind():function(e){for(var t=1;t*]:box-border flex items-center ".concat("full"===y?"w-full":""," ").concat(S),k=te(E,x,w,t,_,"underline"!==p?"bg-tab-background":"",l);return i().createElement("div",{className:k},i().createElement(zf.Provider,{value:{activeItem:s,onChange:b,size:u,variant:p,orientation:f,iconPosition:g,width:y}},i().Children.map(n,(function(e){return(0,o.isValidElement)(e)?i().cloneElement(e):null}))))},Tab:Bf};const Uf=ge("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),$f=ge("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Kf=ge("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var Hf={sm:{icon:"[&>svg]:size-4",searchIcon:"[&>svg]:size-4",selectButton:"px-2 py-2 rounded text-xs font-medium leading-4 min-h-[2.25rem]",multiSelect:"pl-2 pr-2 py-1.5",displaySelected:"text-xs font-normal",dropdown:"rounded-md",dropdownItemsWrapper:"p-1.5",searchbarWrapper:"p-3 flex items-center gap-0.5",searchbar:"font-medium text-xs",searchbarIcon:"[&>svg]:size-4",label:"text-xs font-medium"},md:{icon:"[&>svg]:size-5",searchIcon:"[&>svg]:size-5",selectButton:"px-2.5 py-2.5 rounded-md text-xs font-medium leading-4 min-h-[2.5rem]",multiSelect:"pl-2 pr-2.5 py-2",displaySelected:"text-sm font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"[&>svg]:size-5",label:"text-sm font-medium"},lg:{icon:"[&>svg]:size-6",searchIcon:"[&>svg]:size-5",selectButton:"px-3 py-3 rounded-lg text-sm font-medium leading-5 min-h-[3rem]",multiSelect:"pl-2.5 pr-3 py-2.5",displaySelected:"text-sm font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"[&>svg]:size-5",label:"text-base font-medium"}},qf="group-disabled:text-field-color-disabled",Yf=["value","selected","children"];function Xf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||Zf(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gf(){return Gf=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n{r&&(clearTimeout(m.current),y.current=null,g.current="")}),[r]),Cr((()=>{var e;r&&""===g.current&&(v.current=null!=(e=null!=p?p:a)?e:-1)}),[r,p,a]);const S=dr((e=>{e?i.current.typing||(i.current.typing=e,x(e)):i.current.typing&&(i.current.typing=e,x(e))})),E=dr((e=>{function t(e,t,n){const r=w.current?w.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}const n=s.current;if(g.current.length>0&&" "!==g.current[0]&&(-1===t(n,n,g.current)?S(!1):" "===e.key&&$t(e)),null==n||_.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&($t(e),S(!0)),n.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&g.current===e.key&&(g.current="",v.current=y.current),g.current+=e.key,clearTimeout(m.current),m.current=setTimeout((()=>{g.current="",v.current=y.current,S(!1)}),f);const o=v.current,i=t(n,[...n.slice((o||0)+1),...n.slice(0,(o||0)+1)],g.current);-1!==i?(b(i),y.current=i):" "!==e.key&&(g.current="",S(!1))})),k=o.useMemo((()=>({onKeyDown:E})),[E]),C=o.useMemo((()=>({onKeyDown:E,onKeyUp(e){" "===e.key&&S(!1)}})),[E,S]);return o.useMemo((()=>u?{reference:k,floating:C}:{}),[u,k,C])}(V,{listRef:W,activeIndex:A,selectedIndex:j,onMatch:P?N:I,onTypingChange:function(e){U.current=e}}),X=Ro([K,H,q,$].concat(Jf(m?[]:[Y]))),G=X.getReferenceProps,J=X.getFloatingProps,Z=X.getItemProps,Q=function(e,t){if(h)return function(e,t){var n,r=Jf(null!==(n=C())&&void 0!==n?n:[]);-1===r.findIndex((function(e){return"object"===eh(e)?e[u]===t[u]:e===t}))&&(r.push(t),b||_(r),I(e),F.reference.current.focus(),R(!1),k(""),"function"==typeof l&&l(r))}(e,t);I(e),b||_(t),F.reference.current.focus(),R(!1),k(""),"function"==typeof l&&l(t)},ee=(0,o.useCallback)((function(e,t){B.current[e]=t}),[]);return React.createElement(oh.Provider,{value:{selectedIndex:j,setSelectedIndex:I,activeIndex:A,setActiveIndex:N,selected:w,setSelected:_,handleSelect:Q,combobox:m,sizeValue:i,multiple:h,onChange:l,isTypingRef:U,getItemProps:Z,onClickItem:function(e,t){Q(e,t)},onKeyDownItem:function(e,t,n){"Enter"===e.key&&(e.preventDefault(),Q(t,n))," "!==e.key||U.current||(e.preventDefault(),Q(t,n))},getValues:C,selectId:y,getReferenceProps:G,isOpen:P,value:s,updateListRef:ee,refs:F,listContentRef:W,by:u,getFloatingProps:J,floatingStyles:z,context:V,searchKeyword:E,setSearchKeyword:k,disabled:v}},d)};sh.Button=function(e){var t,n,r,i=e.children,s=e.icon,a=void 0===s?null:s,l=e.placeholder,c=void 0===l?"Select an option":l,u=e.optionIcon,d=void 0===u?null:u,f=e.displayBy,h=void 0===f?"name":f,p=e.label,m=ih(),g=m.sizeValue,v=m.getReferenceProps,y=m.getValues,b=m.selectId,x=m.refs,w=m.isOpen,_=m.multiple,S=m.combobox,E=m.setSelected,k=m.onChange,C=m.isControlled,T=m.disabled,P=m.by,R=null===(t={sm:"xs",md:"sm",lg:"md"})||void 0===t?void 0:t[g],O=(0,o.useCallback)((function(){if(a)return a;var e="text-field-placeholder group-disabled:text-icon-disabled";return S?React.createElement(Uf,{className:e}):React.createElement($f,{className:e})}),[a]),A=(0,o.useCallback)((function(){var e=y();if(!e)return null;if("function"==typeof i){var t=nh({value:e},_?{onClose:N}:{});return i(t)}if(_)return e.map((function(e,t){return React.createElement(Be,{icon:d,type:"rounded",key:t,size:R,onMouseDown:N(e),label:"object"===eh(e)?e[h]:e,disabled:T})}));var n="object"===eh(e)?e[h]:e;return(0,o.isValidElement)(i)&&(n=i),React.createElement("span",{className:te(Hf[g].displaySelected,qf)},n)}),[y]),N=function(e){return function(t){var n;null==t||t.preventDefault(),null==t||t.stopPropagation();var r=Jf(null!==(n=y())&&void 0!==n?n:[]),o=r.findIndex((function(t){return"object"===eh(t)?t[P]===e[P]:t===e}));-1!==o&&(r.splice(o,1),C||E(r),"function"==typeof k&&k(r))}};return React.createElement("div",{className:"flex flex-col items-start gap-1.5 [&_*]:box-border box-border"},React.createElement("label",{className:te(null===(n=Hf[g])||void 0===n?void 0:n.label,"text-field-label"),htmlFor:b},p),React.createElement("button",Gf({id:b,ref:x.setReference,className:te("flex items-center justify-between border border-solid w-full box-border transition-colors duration-150 bg-white","border focus-visible:outline-none border-solid border-field-border",!w&&"focus:ring-2 focus:ring-offset-4 focus:border-focus-border focus:ring-focus [&:hover:not(:focus):not(:disabled)]:border-border-strong",Hf[g].selectButton,_&&Hf[g].multiSelect,"group disabled:border-field-border-disabled [&:hover:has(:disabled)]:border-field-border-disabled"),"aria-labelledby":"select-label",tabIndex:0,disabled:T},v()),React.createElement("div",{className:te("flex-1 grid items-center justify-start gap-1.5 ",y()&&"flex flex-wrap")},A(),(_?!(null!==(r=y())&&void 0!==r&&r.length):!y())&&React.createElement("div",{className:te("[grid-area:1/1/2/3] text-field-input",Hf[g].displaySelected,qf)},c)),React.createElement("div",{className:te("flex items-center [&>svg]:shrink-0",Hf[g].icon)},O())))},sh.Options=function(e){var t=e.children,n=e.searchBy,r=void 0===n?"id":n,i=e.searchPlaceholder,s=void 0===i?"Search...":i,a=e.dropdownPortalRoot,l=void 0===a?null:a,c=e.dropdownPortalId,u=void 0===c?"":c,d=ih(),f=d.isOpen,h=d.context,p=d.refs,m=d.combobox,g=d.floatingStyles,v=d.getFloatingProps,y=d.sizeValue,b=d.setSearchKeyword,x=d.setActiveIndex,w=d.setSelectedIndex,_=d.value,S=d.selected,E=d.getValues,k=d.searchKeyword,C=d.listContentRef,T=d.by,P=(0,o.useMemo)((function(){var e=E(),n=0;return e&&(n=o.Children.toArray(t).findIndex((function(t){return"object"===eh(t.props.value)?t.props.value[T]===e[T]:t.props.value===e}))),-1===n?0:n}),[_,S,t]);(0,o.useLayoutEffect)((function(){x(P),w(P)}),[]);var R=(0,o.useMemo)((function(){return o.Children.map(t,(function(e,t){if(!(0,o.isValidElement)(e))return null;if(k){var n=e.props.value;if("object"===eh(n)){if(-1===n[r].toLowerCase().indexOf(k.toLowerCase()))return null}else if(-1===n.toLowerCase().indexOf(k.toLowerCase()))return null}return(0,o.cloneElement)(e,nh(nh({},e.props),{},{index:t}))}))}),[k,_,S,t]),O=o.Children.count(R);return(0,o.useEffect)((function(){C.current=[],o.Children.forEach(t,(function(e){if((0,o.isValidElement)(e)&&e.props.value){if(k){var t=e.props.value;if("object"===eh(t)){if(-1===t[r].toLowerCase().indexOf(k.toLowerCase()))return}else if(-1===t.toLowerCase().indexOf(k.toLowerCase()))return}C.current.push(e.props.value)}}))}),[k]),React.createElement(React.Fragment,null,f&&React.createElement(ao,{id:u,root:l},React.createElement(vo,{context:h,modal:!1},React.createElement("div",Gf({ref:p.setFloating,className:te("box-border [&_*]:box-border w-full bg-white outline-none shadow-lg border border-solid border-border-subtle overflow-hidden",m&&"grid grid-cols-1 grid-rows-[auto_1fr] divide-y divide-x-0 divide-solid divide-border-subtle",Hf[y].dropdown,!m&&"h-full"),style:nh({},g)},v()),m&&React.createElement("div",{className:te(Hf[y].searchbarWrapper)},React.createElement(Kf,{className:te("text-icon-secondary shrink-0",Hf[y].searchbarIcon)}),React.createElement("input",{className:te("px-1 w-full placeholder:text-field-placeholder border-0 focus:outline-none focus:shadow-none",Hf[y].searchbar),type:"search",name:"keyword",placeholder:s,onChange:function(e){return b(e.target.value)},autoComplete:"off"})),React.createElement("div",{className:te("overflow-y-auto",!m&&"w-full h-full",Hf[y].dropdownItemsWrapper)},!!O&&R,!O&&React.createElement("div",{className:"p-2 text-center text-base font-medium text-field-placeholder"},"No items found"))))))},sh.Option=function(e){var t=e.value,n=e.selected,r=e.children,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(dh({message:e,type:"neutral"},t))}},{key:"success",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(dh({message:e,type:"success"},t))}},{key:"error",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(dh({message:e,type:"error"},t))}},{key:"warning",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(dh({message:e,type:"warning"},t))}},{key:"info",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(dh({message:e,type:"info"},t))}},{key:"custom",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(dh({jsx:e,type:"custom"},t))}}],t&&hh(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),Sh=new _h,Eh=Object.seal(Object.assign((function(e,t){return Sh.default(e,t)}),{success:Sh.success.bind(Sh),error:Sh.error.bind(Sh),warning:Sh.warning.bind(Sh),info:Sh.info.bind(Sh),custom:Sh.custom.bind(Sh),dismiss:Sh.dismiss.bind(Sh),update:Sh.update.bind(Sh)},{getHistory:Sh.history.bind(Sh)})),kh=!1,Ch={"top-left":"top-0 bottom-0 left-0 justify-start items-start","top-right":"top-0 bottom-0 right-0 justify-start items-end","bottom-left":"top-0 bottom-0 left-0 justify-end items-start","bottom-right":"top-0 bottom-0 right-0 justify-end items-end"},Th={neutral:"border-alert-border-neutral bg-alert-background-neutral",custom:"border-alert-border-neutral bg-alert-background-neutral",info:"border-alert-border-info bg-alert-background-info",success:"border-alert-border-green bg-alert-background-green",warning:"border-alert-border-warning bg-alert-background-warning",error:"border-alert-border-danger bg-alert-background-danger"},Ph="bg-background-inverse border-background-inverse",Rh={light:"text-icon-secondary",dark:"text-icon-inverse"};class Oh extends o.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Ah({children:e,isPresent:t}){const n=(0,o.useId)(),r=(0,o.useRef)(null),i=(0,o.useRef)({width:0,height:0,top:0,left:0}),{nonce:s}=(0,o.useContext)(Cd);return(0,o.useInsertionEffect)((()=>{const{width:e,height:o,top:a,left:l}=i.current;if(t||!r.current||!e||!o)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return s&&(c.nonce=s),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${n}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${o}px !important;\n top: ${a}px !important;\n left: ${l}px !important;\n }\n `),()=>{document.head.removeChild(c)}}),[t]),(0,Xc.jsx)(Oh,{isPresent:t,childRef:r,sizeRef:i,children:o.cloneElement(e,{ref:r})})}const Nh=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a})=>{const l=Zd(Mh),c=(0,o.useId)(),u=(0,o.useMemo)((()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:e=>{l.set(e,!0);for(const e of l.values())if(!e)return;r&&r()},register:e=>(l.set(e,!1),()=>l.delete(e))})),s?[Math.random()]:[n]);return(0,o.useMemo)((()=>{l.forEach(((e,t)=>l.set(t,!1)))}),[n]),o.useEffect((()=>{!n&&!l.size&&r&&r()}),[n]),"popLayout"===a&&(e=(0,Xc.jsx)(Ah,{isPresent:n,children:e})),(0,Xc.jsx)(Gc.Provider,{value:u,children:e})};function Mh(){return new Map}const jh=e=>e.key||"";function Ih(e){const t=[];return o.Children.forEach(e,(e=>{(0,o.isValidElement)(e)&&t.push(e)})),t}const Dh=({children:e,exitBeforeEnter:t,custom:n,initial:r=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:a="sync"})=>{Vi(!t,"Replace exitBeforeEnter with mode='wait'");const l=(0,o.useMemo)((()=>Ih(e)),[e]),c=l.map(jh),u=(0,o.useRef)(!0),d=(0,o.useRef)(l),f=Zd((()=>new Map)),[h,p]=(0,o.useState)(l),[m,g]=(0,o.useState)(l);Rd((()=>{u.current=!1,d.current=l;for(let e=0;e{const t=jh(e),o=l===m||c.includes(t);return(0,Xc.jsx)(Nh,{isPresent:o,initial:!(u.current&&!r)&&void 0,custom:o?void 0:n,presenceAffectsLayout:s,mode:a,onExitComplete:o?void 0:()=>{if(!f.has(t))return;f.set(t,!0);let e=!0;f.forEach((t=>{t||(e=!1)})),e&&(null==y||y(),g(d.current),i&&i())},children:e},t)}))})};function Lh(e){return Lh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lh(e)}function Fh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zh(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&void 0!==arguments[1]?arguments[1]:u;if(l&&!(u<0))return x.current=(new Date).getTime(),setTimeout((function(){b(e.id)}),t)};(0,o.useEffect)((function(){var e=u;return _.current=S(t,e),function(){clearTimeout(_.current)}}),[]),(0,o.useEffect)((function(){null!=t&&t.dismiss&&b(t.id)}),[t]);var E,k,C,T,P,R,O,A,N,M,j=function(){var e,n;null==t||null===(e=t.action)||void 0===e||null===(n=e.onClick)||void 0===n||n.call(e,(function(){return b(t.id)}))},I=null;return"stack"===p&&(I=React.createElement("div",{className:te("flex items-center justify-start p-4 gap-2 relative border border-solid rounded-md shadow-lg","dark"===f?Ph:null===(E=Th)||void 0===E?void 0:E[y],"w-[22.5rem]"),onMouseEnter:function(){clearTimeout(_.current),w.current=(new Date).getTime()},onMouseLeave:function(){_.current=S(t,u-(w.current-x.current))}},"custom"!==t.type?React.createElement(React.Fragment,null,React.createElement("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0"},Ko({variant:y,icon:g,theme:f})),React.createElement("div",{className:"flex flex-col items-start justify-start gap-0.5"},qo({title:r,theme:f}),Yo({content:s,theme:f}),(null==t||null===(k=t.action)||void 0===k?void 0:k.label)&&"function"==typeof(null==t||null===(C=t.action)||void 0===C?void 0:C.onClick)&&React.createElement("div",{className:"mt-2.5"},Ho({actionLabel:null==t||null===(T=t.action)||void 0===T?void 0:T.label,actionType:null!==(P=null==t||null===(R=t.action)||void 0===R?void 0:R.type)&&void 0!==P?P:"button",onAction:j,theme:f}))),React.createElement("div",{className:"absolute right-4 top-4 [&_svg]:size-5"},React.createElement("button",{className:te("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(O=Rh[f])&&void 0!==O?O:Rh.light),onClick:function(){return b(t.id)}},React.createElement(Fe,null)))):null==t||null===(A=t.jsx)||void 0===A?void 0:A.call(t,{close:function(){return b(t.id)},action:null!=t&&t.action?zh(zh({},null==t?void 0:t.action),{},{onClick:j}):null}))),"inline"===p&&(I=React.createElement("div",{className:te("flex items-center justify-start p-3 gap-2 relative border border-solid rounded-md shadow-lg","dark"===f?Ph:null===(N=Th)||void 0===N?void 0:N[y],"lg:w-[47.5rem] w-full")},React.createElement("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0"},Ko({variant:y,icon:g,theme:f})),React.createElement("div",{className:"flex items-start justify-start gap-1 mr-10 [&>span:first-child]:shrink-0"},qo({title:r,theme:f}),Yo({content:s,theme:f})),React.createElement("div",{className:"absolute right-3 top-3 [&_svg]:size-5"},React.createElement("button",{className:te("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(M=Rh[f])&&void 0!==M?M:Rh.light),onClick:function(){return b(t.id)}},React.createElement(Fe,null))))),I},Kh=(Uh=function(e){var t,n,r,i=e.position,s=void 0===i?"top-right":i,a=e.design,l=void 0===a?"stack":a,c=e.theme,u=void 0===c?"light":c,d=e.className,f=void 0===d?"":d,h=e.autoDismiss,p=void 0===h||h,m=e.dismissAfter,g=void 0===m?5e3:m,v=(n=(0,o.useState)([]),r=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(n,r)||Bh(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=v[0],b=v[1];(0,o.useEffect)((function(){Sh.subscribe((function(e){null!=e&&e.dismiss?b((function(t){return t.map((function(t){return t.id===e.id?zh(zh({},t),{},{dismiss:!0}):t}))})):setTimeout((function(){(0,On.flushSync)((function(){return b((function(t){return-1!==t.findIndex((function(t){return t.id===e.id}))?t.map((function(t){return t.id===e.id?zh(zh({},t),e):t})):[].concat(function(e){return function(e){if(Array.isArray(e))return Wh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Bh(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t),[e])}))}))}))}))}),[]);var x=function(e){b((function(t){return t.filter((function(t){return t.id!==e}))}))};return React.createElement("ul",{className:te("fixed flex flex-col list-none z-20 p-10 pointer-events-none [&>li]:pointer-events-auto gap-3",null!==(t=Ch[s])&&void 0!==t?t:Ch["top-right"],f)},React.createElement(Dh,{initial:!1},y.map((function(e){var t,n,r,o,i;return React.createElement(Df.li,{key:e.id,positionTransition:!0,initial:{opacity:0,y:50,scale:.7},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.6,transition:{duration:.15}},layoutId:"toast-".concat(e.id)},React.createElement($h,{toastItem:e,title:e.title,content:null==e?void 0:e.description,icon:null!==(t=null==e?void 0:e.icon)&&void 0!==t?t:null,design:null!==(n=null==e?void 0:e.design)&&void 0!==n?n:l,autoDismiss:null!==(r=null==e?void 0:e.autoDismiss)&&void 0!==r?r:p,dismissAfter:null!==(o=null==e?void 0:e.dismissAfter)&&void 0!==o?o:g,removeToast:x,variant:e.type,theme:null!==(i=null==e?void 0:e.theme)&&void 0!==i?i:u}))}))))},(0,o.memo)((function(e){return kh?null:(kh=!0,React.createElement(Uh,e))}))),Hh=["containerType","gap","direction","justify","align","wrap","cols","tabCols","mCols","className","children"],qh=["grow","shrink","order","alignSelf","className","children"];function Yh(){return Yh=Object.assign?Object.assign.bind():function(e){for(var t=1;tspan:first-child]:shrink-0"},qo({title:g,theme:u}),Yo({content:y,theme:u}))),React.createElement("div",{className:"flex items-center justify-start gap-4 [&_svg]:size-5"},(null==E?void 0:E.label)&&"function"==typeof(null==E?void 0:E.onClick)&&React.createElement("div",{className:"flex"},Ho({actionLabel:null==E?void 0:E.label,actionType:null!==(n=null==E?void 0:E.type)&&void 0!==n?n:"button",onAction:O,theme:u})),React.createElement("button",{className:te("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(r=R[u])&&void 0!==r?r:R.light),onClick:function(){return k()}},React.createElement(Fe,null))))},ep=(Jh=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e{t.focus((()=>{const e=document.activeElement,n=t.getRootElement();null===n||null!==e&&n.contains(e)||n.focus({preventScroll:!0})}),{defaultSelection:e})}),[e,t]),null}const op={},ip={},sp={},ap={},lp={},cp={},up={},dp={},fp={},hp={},pp={},mp={},gp={},vp={},yp={},bp={},xp={},wp={},_p={},Sp={},Ep={},kp={},Cp={},Tp={},Pp={},Rp={},Op={},Ap={},Np={},Mp={},jp={},Ip={},Dp={},Lp={},Fp={},zp={},Vp={},Bp={},Wp={},Up={},$p="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Kp=$p&&"documentMode"in document?document.documentMode:null,Hp=$p&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),qp=$p&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Yp=!(!$p||!("InputEvent"in window)||Kp)&&"getTargetRanges"in new window.InputEvent("input"),Xp=$p&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Gp=$p&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Jp=$p&&/Android/.test(navigator.userAgent),Zp=$p&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Qp=$p&&Jp&&Zp,em=$p&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Zp,tm=1,nm=3,rm=0,om=2,im=0,sm=1,am=2,lm=4,cm=8,um=3|lm|cm|240,dm=1,fm=2,hm=3,pm=4,mm=5,gm=6,vm=Xp||Gp||em?" ":"​",ym="\n\n",bm=qp?" ":vm,xm="֑-߿יִ-﷽ﹰ-ﻼ",wm="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",_m=new RegExp("^[^"+wm+"]*["+xm+"]"),Sm=new RegExp("^[^"+xm+"]*["+wm+"]"),Em={bold:1,code:16,highlight:128,italic:2,strikethrough:lm,subscript:32,superscript:64,underline:cm},km={directionless:1,unmergeable:2},Cm={center:fm,end:gm,justify:pm,left:dm,right:hm,start:mm},Tm={[fm]:"center",[gm]:"end",[pm]:"justify",[dm]:"left",[hm]:"right",[mm]:"start"},Pm={normal:0,segmented:2,token:1},Rm={[im]:"normal",[am]:"segmented",[sm]:"token"};var Om,Am=(Om=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;eMm;try{kb(e,(()=>{const o=Gy()||function(e){return e.getEditorState().read((()=>{const e=Gy();return null!==e?e.clone():null}))}(e),i=new Map,s=e.getRootElement(),a=e._editorState,l=e._blockCursorElement;let c=!1,u="";for(let n=0;n0){let t=0;for(let o=0;o0)for(const[t,n]of i)if(Tb(n)){const r=n.getChildrenKeys();let o=t.firstChild;for(let n=0;n0){for(let t=0;t{Vm(e,t,n)}))}function Um(e,t){const n=e.__mode,r=e.__format,o=e.__style,i=t.__mode,s=t.__format,a=t.__style;return!(null!==n&&n!==i||null!==r&&r!==s||null!==o&&o!==a)}function $m(e,t){const n=e.mergeWithSibling(t),r=pb()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function Km(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&Ty(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(Um(t,r)){r=$m(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&Ty(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(Um(r,n)){r=$m(r,n);break}break}n.remove()}}else r.remove()}function Hm(e){for(;"element"===e.type;){const t=e.getNode(),n=e.offset;let r,o;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),o=!0):(r=t.getChildAtIndex(n),o=!1),Ty(r)){e.set(r.__key,o?r.getTextContentSize():0,"text");break}if(!Tb(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element")}}let qm=1;const Ym="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function Xm(e){const t=document.activeElement;if(null===t)return!1;const n=t.nodeName;return Ob(ug(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==Qm(t))}function Gm(e,t,n){const r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!Xm(t)&&Zm(t)===e}catch(e){return!1}}function Jm(e){return e instanceof Ub}function Zm(e){let t=e;for(;null!=t;){const e=Qm(t);if(Jm(e))return e;t=zg(t)}return null}function Qm(e){return e?e.__lexicalEditor:null}function eg(e){return e.isToken()||e.isSegmented()}function tg(e){return e.nodeType===nm}function ng(e){let t=e;for(;null!=t;){if(tg(t))return t;t=t.firstChild}return null}function rg(e,t,n){const r=Em[t];if(null!==n&&(e&r)==(n&r))return e;let o=e^r;return"subscript"===t?o&=~Em.superscript:"superscript"===t&&(o&=~Em.subscript),o}function og(e){const t=e.getParent();if(null!==t){const n=e.getWritable(),r=t.getWritable(),o=e.getPreviousSibling(),i=e.getNextSibling();if(null===o)if(null!==i){const e=i.getWritable();r.__first=i.__key,e.__prev=null}else r.__first=null;else{const e=o.getWritable();if(null!==i){const t=i.getWritable();t.__prev=e.__key,e.__next=t.__key}else e.__next=null;n.__prev=null}if(null===i)if(null!==o){const e=o.getWritable();r.__last=o.__key,e.__next=null}else r.__last=null;else{const e=i.getWritable();if(null!==o){const t=o.getWritable();t.__next=e.__key,e.__prev=t.__key}else e.__prev=null;n.__next=null}r.__size--,n.__parent=null}}function ig(e){fb();const t=e.getLatest(),n=t.__parent,r=hb(),o=pb(),i=r._nodeMap,s=o._dirtyElements;null!==n&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;const e=t.get(r);if(void 0===e)break;n.set(r,!1),r=e.__parent}}(n,i,s);const a=t.__key;o._dirtyType=1,Tb(e)?s.set(a,!0):o._dirtyLeaves.add(a)}function sg(e){db();const t=pb(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=lg(n);null!==e&&e.getWritable()}if(null!==e){const t=lg(e);null!==t&&t.getWritable()}}}function ag(){return ub()?null:pb()._compositionKey}function lg(e,t){const n=(t||hb())._nodeMap.get(e);return void 0===n?null:n}function cg(e,t){const n=e[`__lexicalKey_${pb()._key}`];return void 0!==n?lg(n,t):null}function ug(e,t){let n=e;for(;null!=n;){const e=cg(n,t);if(null!==e)return e;n=zg(n)}return null}function dg(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function fg(e){return e.read((()=>hg().getTextContent()))}function hg(){return pg(hb())}function pg(e){return e._nodeMap.get("root")}function mg(e){db();const t=hb();null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function gg(e){const t=pb(),n=function(e,t){let n=e;for(;null!=n;){const e=n[`__lexicalKey_${t._key}`];if(void 0!==e)return e;n=zg(n)}return null}(e,t);return null===n?e===t.getRootElement()?lg("root"):null:lg(n)}function vg(e,t){return t?e.getTextContentSize():0}function yg(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function bg(e){const t=[];let n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function xg(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function wg(e){return e.nodeType===nm?e.nodeValue:null}function _g(e,t,n){const r=Hg(t._window);if(null===r)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(null!==o){let t=wg(o);const r=ug(o);if(null!==t&&Ty(r)){if(t===vm&&n){const e=n.length;t=n,i=e,s=e}null!==t&&Sg(r,t,i,s,e)}}}function Sg(e,t,n,r,o){let i=e;if(i.isAttached()&&(o||!i.isDirty())){const s=i.isComposing();let a=t;(s||o)&&t[t.length-1]===vm&&(a=t.slice(0,-1));const l=i.getTextContent();if(o||a!==l){if(""===a){if(sg(null),Xp||Gp||em)i.remove();else{const e=pb();setTimeout((()=>{e.update((()=>{i.isAttached()&&i.remove()}))}),20)}return}const t=i.getParent(),o=Jy(),l=i.getTextContentSize(),c=ag(),u=i.getKey();if(i.isToken()||null!==c&&u===c&&!s||Ly(o)&&(null!==t&&!t.canInsertTextBefore()&&0===o.anchor.offset||o.anchor.key===e.__key&&0===o.anchor.offset&&!i.canInsertTextBefore()&&!s||o.focus.key===e.__key&&o.focus.offset===l&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const d=Gy();if(!Ly(d)||null===n||null===r)return void i.setTextContent(a);if(d.setTextNodeRange(i,n,i,r),i.isSegmented()){const e=Cy(i.getTextContent());i.replace(e),i=e}i.setTextContent(a)}}}function Eg(e){return"ArrowLeft"===e}function kg(e){return"ArrowRight"===e}function Cg(e,t){return Hp?e:t}function Tg(e){return"Enter"===e}function Pg(e){return"Backspace"===e}function Rg(e){return"Delete"===e}function Og(e,t,n){return"a"===e.toLowerCase()&&Cg(t,n)}function Ag(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(void 0!==r)return r;const o=e[t];if("string"==typeof o){const e=Nm(o);return n[t]=e,e}return o}function Ng(e,t,n,r,o){if(0===n.size)return;const i=r.__type,s=r.__key,a=t.get(i);void 0===a&&Am(33,i);const l=a.klass;let c=e.get(l);void 0===c&&(c=new Map,e.set(l,c));const u=c.get(s),d="destroyed"===u&&"created"===o;(void 0===u||d)&&c.set(s,d?"updated":o)}function Mg(e,t,n){const r=e.getParent();let o=n,i=e;return null!==r&&(t&&0===n?(o=i.getIndexWithinParent(),i=r):t||n!==i.getChildrenSize()||(o=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(t?o-1:o)}function jg(e,t){const n=e.offset;if("element"===e.type)return Mg(e.getNode(),t,n);{const r=e.getNode();if(t&&0===n||!t&&n===r.getTextContentSize()){const e=t?r.getPreviousSibling():r.getNextSibling();return null===e?Mg(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function Ig(e){const t=Bg(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function Dg(e,t,n){return _b(e,t,n)}function Lg(e){return!Nb(e)&&!e.isLastChild()&&!e.isInline()}function Fg(e,t){const n=e._keyToDOMMap.get(t);return void 0===n&&Am(75,t),n}function zg(e){const t=e.assignedSlot||e.parentElement;return null!==t&&11===t.nodeType?t.host:t}function Vg(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function Bg(e){const t=e._window;return null===t&&Am(78),t}function Wg(e){return Nb(e)||Tb(e)&&e.isShadowRoot()}function Ug(e){const t=pb(),n=e.constructor.getType(),r=t._nodes.get(n);void 0===r&&Am(97);const o=r.replace;if(null!==o){const t=o(e);return t instanceof e.constructor||Am(98),t}return e}function $g(e,t){!Nb(e.getParent())||Tb(t)||Ob(t)||Am(99)}function Kg(e){return(Ob(e)||Tb(e)&&!e.canBeEmpty())&&!e.isInline()}function _n(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function Hg(e){return $p?(e||window).getSelection():null}function qg(e){return 1===e.nodeType}function Yg(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return null!==e.nodeName.match(t)}function Xg(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return null!==e.nodeName.match(t)}function Gg(e){if(Nb(e)||Ob(e)&&!e.isInline())return!0;if(!Tb(e)||Wg(e))return!1;const t=e.getFirstChild(),n=null===t||cy(t)||Ty(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Jg(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}const Zg=new WeakMap,Qg=new Map;function ev(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function tv(e,t,n,r,o,i){let s=e.getFirstChild();for(;null!==s;){const e=s.__key;s.__parent===t&&(Tb(s)&&tv(s,e,n,r,o,i),n.has(e)||i.delete(e),o.push(e)),s=s.getNextSibling()}}let nv,rv,ov,iv,sv,av,lv,cv,uv,dv,fv="",hv="",pv=null,mv="",gv="",vv=!1,yv=!1,bv=null;function xv(e,t){const n=lv.get(e);if(null!==t){const n=Iv(e);n.parentNode===t&&t.removeChild(n)}if(cv.has(e)||rv._keyToDOMMap.delete(e),Tb(n)){const e=Av(n,lv);wv(e,0,e.length-1,null)}void 0!==n&&Ng(dv,ov,iv,n,"destroyed")}function wv(e,t,n,r){let o=t;for(;o<=n;++o){const t=e[o];void 0!==t&&xv(t,r)}}function _v(e,t){e.setProperty("text-align",t)}const Sv="40px";function Ev(e,t){const n=nv.theme.indent;if("string"==typeof n){const r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||Sv;e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${r})`)}function kv(e,t){const n=e.style;0===t?_v(n,""):t===dm?_v(n,"left"):t===fm?_v(n,"center"):t===hm?_v(n,"right"):t===pm?_v(n,"justify"):t===mm?_v(n,"start"):t===gm&&_v(n,"end")}function Cv(e,t,n){const r=cv.get(e);void 0===r&&Am(60);const o=r.createDOM(nv,rv);if(function(e,t,n){const r=n._keyToDOMMap;t["__lexicalKey_"+n._key]=e,r.set(e,t)}(e,o,rv),Ty(r)?o.setAttribute("data-lexical-text","true"):Ob(r)&&o.setAttribute("data-lexical-decorator","true"),Tb(r)){const e=r.__indent,t=r.__size;if(0!==e&&Ev(o,e),0!==t){const e=t-1;!function(e,t,n,r){const o=hv;hv="",Tv(e,n,0,t,r,null),Ov(n,r),hv=o}(Av(r,cv),e,r,o)}const n=r.__format;0!==n&&kv(o,n),r.isInline()||Rv(null,r,o),Lg(r)&&(fv+=ym,gv+=ym)}else{const t=r.getTextContent();if(Ob(r)){const t=r.decorate(rv,nv);null!==t&&Mv(e,t),o.contentEditable="false"}else Ty(r)&&(r.isDirectionless()||(hv+=t));fv+=t,gv+=t}if(null!==t)if(null!=n)t.insertBefore(o,n);else{const e=t.__lexicalLineBreak;null!=e?t.insertBefore(o,e):t.appendChild(o)}return Ng(dv,ov,iv,r,"created"),o}function Tv(e,t,n,r,o,i){const s=fv;fv="";let a=n;for(;a<=r;++a){Cv(e[a],o,i);const t=cv.get(e[a]);null!==t&&Ty(t)&&(null===pv&&(pv=t.getFormat()),""===mv&&(mv=t.getStyle()))}Lg(t)&&(fv+=ym),o.__lexicalTextContent=fv,fv=s+fv}function Pv(e,t){const n=t.get(e);return cy(n)||Ob(n)&&n.isInline()}function Rv(e,t,n){const r=null!==e&&(0===e.__size||Pv(e.__last,lv)),o=0===t.__size||Pv(t.__last,cv);if(r){if(!o){const e=n.__lexicalLineBreak;if(null!=e)try{n.removeChild(e)}catch(t){if("object"==typeof t&&null!=t){const r=`${t.toString()} Parent: ${n.tagName}, child: ${e.tagName}.`;throw new Error(r)}throw t}n.__lexicalLineBreak=null}}else if(o){const e=document.createElement("br");n.__lexicalLineBreak=e,n.appendChild(e)}}function Ov(e,t){const n=t.__lexicalDirTextContent,r=t.__lexicalDir;if(n!==hv||r!==bv){const n=""===hv,i=n?bv:(o=hv,_m.test(o)?"rtl":Sm.test(o)?"ltr":null);if(i!==r){const o=t.classList,s=nv.theme;let a=null!==r?s[r]:void 0,l=null!==i?s[i]:void 0;if(void 0!==a){if("string"==typeof a){const e=Nm(a);a=s[r]=e}o.remove(...a)}if(null===i||n&&"ltr"===i)t.removeAttribute("dir");else{if(void 0!==l){if("string"==typeof l){const e=Nm(l);l=s[i]=e}void 0!==l&&o.add(...l)}t.dir=i}yv||(e.getWritable().__dir=i)}bv=i,t.__lexicalDirTextContent=hv,t.__lexicalDir=i}var o}function Av(e,t){const n=[];let r=e.__first;for(;null!==r;){const e=t.get(r);void 0===e&&Am(101),n.push(r),r=e.__next}return n}function Nv(e,t){const n=lv.get(e);let r=cv.get(e);void 0!==n&&void 0!==r||Am(61);const o=vv||av.has(e)||sv.has(e),i=Fg(rv,e);if(n===r&&!o){if(Tb(n)){const e=i.__lexicalTextContent;void 0!==e&&(fv+=e,gv+=e);const t=i.__lexicalDirTextContent;void 0!==t&&(hv+=t)}else{const e=n.getTextContent();Ty(n)&&!n.isDirectionless()&&(hv+=e),gv+=e,fv+=e}return i}if(n!==r&&o&&Ng(dv,ov,iv,r,"updated"),r.updateDOM(n,i,nv)){const n=Cv(e,null,null);return null===t&&Am(62),t.replaceChild(n,i),xv(e,null),n}if(Tb(n)&&Tb(r)){const e=r.__indent;e!==n.__indent&&Ev(i,e);const t=r.__format;t!==n.__format&&kv(i,t),o&&(function(e,t,n){const r=hv;var o;hv="",pv=null,mv="",function(e,t,n){const r=fv,o=e.__size,i=t.__size;if(fv="",1===o&&1===i){const r=e.__first,o=t.__first;if(r===o)Nv(r,n);else{const e=Iv(r),t=Cv(o,null,null);try{n.replaceChild(t,e)}catch(i){if("object"==typeof i&&null!=i){const s=`${i.toString()} Parent: ${n.tagName}, new child: {tag: ${t.tagName} key: ${o}}, old child: {tag: ${e.tagName}, key: ${r}}.`;throw new Error(s)}throw i}xv(r,null)}const s=cv.get(o);Ty(s)&&(null===pv&&(pv=s.getFormat()),""===mv&&(mv=s.getStyle()))}else{const r=Av(e,lv),s=Av(t,cv);if(0===o)0!==i&&Tv(s,t,0,i-1,n,null);else if(0===i){if(0!==o){const e=null==n.__lexicalLineBreak;wv(r,0,o-1,e?null:n),e&&(n.textContent="")}}else!function(e,t,n,r,o,i){const s=r-1,a=o-1;let l,c,u=i.firstChild,d=0,f=0;for(;d<=s&&f<=a;){const e=t[d],r=n[f];if(e===r)u=jv(Nv(r,i)),d++,f++;else{void 0===l&&(l=new Set(t)),void 0===c&&(c=new Set(n));const o=c.has(e),s=l.has(r);if(o)if(s){const e=Fg(rv,r);e===u?u=jv(Nv(r,i)):(null!=u?i.insertBefore(e,u):i.appendChild(e),Nv(r,i)),d++,f++}else Cv(r,i,u),f++;else u=jv(Iv(e)),xv(e,i),d++}const o=cv.get(r);null!==o&&Ty(o)&&(null===pv&&(pv=o.getFormat()),""===mv&&(mv=o.getStyle()))}const h=d>s,p=f>a;if(h&&!p){const t=n[a+1];Tv(n,e,f,a,i,void 0===t?null:rv.getElementByKey(t))}else p&&!h&&wv(t,d,s,i)}(t,r,s,o,i,n)}Lg(t)&&(fv+=ym),n.__lexicalTextContent=fv,fv=r+fv}(e,t,n),Ov(t,n),Vb(o=t)&&null!=pv&&pv!==o.__textFormat&&!yv&&(o.setTextFormat(pv),o.setTextStyle(mv)),function(e){Vb(e)&&""!==mv&&mv!==e.__textStyle&&!yv&&e.setTextStyle(mv)}(t),hv=r}(n,r,i),Nb(r)||r.isInline()||Rv(n,r,i)),Lg(r)&&(fv+=ym,gv+=ym)}else{const t=r.getTextContent();if(Ob(r)){const t=r.decorate(rv,nv);null!==t&&Mv(e,t)}else Ty(r)&&!r.isDirectionless()&&(hv+=t);fv+=t,gv+=t}if(!yv&&Nb(r)&&r.__cachedText!==gv){const e=r.getWritable();e.__cachedText=gv,r=e}return i}function Mv(e,t){let n=rv._pendingDecorators;const r=rv._decorators;if(null===n){if(r[e]===t)return;n=dg(rv)}n[e]=t}function jv(e){let t=e.nextSibling;return null!==t&&t===rv._blockCursorElement&&(t=t.nextSibling),t}function Iv(e){const t=uv.get(e);return void 0===t&&Am(75,e),t}const Dv=Object.freeze({}),Lv=[["keydown",function(e,t){if(Fv=e.timeStamp,zv=e.key,t.isComposing())return;const{key:n,shiftKey:r,ctrlKey:o,metaKey:i,altKey:s}=e;Dg(t,vp,e)||null!=n&&(function(e,t,n,r){return kg(e)&&!t&&!r&&!n}(n,o,s,i)?Dg(t,yp,e):function(e,t,n,r,o){return kg(e)&&!r&&!n&&(t||o)}(n,o,r,s,i)?Dg(t,bp,e):function(e,t,n,r){return Eg(e)&&!t&&!r&&!n}(n,o,s,i)?Dg(t,xp,e):function(e,t,n,r,o){return Eg(e)&&!r&&!n&&(t||o)}(n,o,r,s,i)?Dg(t,wp,e):function(e,t,n){return function(e){return"ArrowUp"===e}(e)&&!t&&!n}(n,o,i)?Dg(t,_p,e):function(e,t,n){return function(e){return"ArrowDown"===e}(e)&&!t&&!n}(n,o,i)?Dg(t,Sp,e):function(e,t){return Tg(e)&&t}(n,r)?(Kv=!0,Dg(t,Ep,e)):function(e){return" "===e}(n)?Dg(t,kp,e):function(e,t){return Hp&&t&&"o"===e.toLowerCase()}(n,o)?(e.preventDefault(),Kv=!0,Dg(t,ap,!0)):function(e,t){return Tg(e)&&!t}(n,r)?(Kv=!1,Dg(t,Ep,e)):function(e,t,n,r){return Hp?!t&&!n&&(Pg(e)||"h"===e.toLowerCase()&&r):!(r||t||n)&&Pg(e)}(n,s,i,o)?Pg(n)?Dg(t,Cp,e):(e.preventDefault(),Dg(t,sp,!0)):function(e){return"Escape"===e}(n)?Dg(t,Tp,e):function(e,t,n,r,o){return Hp?!(n||r||o)&&(Rg(e)||"d"===e.toLowerCase()&&t):!(t||r||o)&&Rg(e)}(n,o,r,s,i)?Rg(n)?Dg(t,Pp,e):(e.preventDefault(),Dg(t,sp,!1)):function(e,t,n){return Pg(e)&&(Hp?t:n)}(n,s,o)?(e.preventDefault(),Dg(t,fp,!0)):function(e,t,n){return Rg(e)&&(Hp?t:n)}(n,s,o)?(e.preventDefault(),Dg(t,fp,!1)):function(e,t){return Hp&&t&&Pg(e)}(n,i)?(e.preventDefault(),Dg(t,hp,!0)):function(e,t){return Hp&&t&&Rg(e)}(n,i)?(e.preventDefault(),Dg(t,hp,!1)):function(e,t,n,r){return"b"===e.toLowerCase()&&!t&&Cg(n,r)}(n,s,i,o)?(e.preventDefault(),Dg(t,pp,"bold")):function(e,t,n,r){return"u"===e.toLowerCase()&&!t&&Cg(n,r)}(n,s,i,o)?(e.preventDefault(),Dg(t,pp,"underline")):function(e,t,n,r){return"i"===e.toLowerCase()&&!t&&Cg(n,r)}(n,s,i,o)?(e.preventDefault(),Dg(t,pp,"italic")):function(e,t,n,r){return"Tab"===e&&!t&&!n&&!r}(n,s,o,i)?Dg(t,Rp,e):function(e,t,n,r){return"z"===e.toLowerCase()&&!t&&Cg(n,r)}(n,r,i,o)?(e.preventDefault(),Dg(t,mp,void 0)):function(e,t,n,r){return Hp?"z"===e.toLowerCase()&&n&&t:"y"===e.toLowerCase()&&r||"z"===e.toLowerCase()&&r&&t}(n,r,i,o)?(e.preventDefault(),Dg(t,gp,void 0)):zy(t._editorState._selection)?function(e,t,n,r){return!t&&"c"===e.toLowerCase()&&(Hp?n:r)}(n,r,i,o)?(e.preventDefault(),Dg(t,jp,e)):function(e,t,n,r){return!t&&"x"===e.toLowerCase()&&(Hp?n:r)}(n,r,i,o)?(e.preventDefault(),Dg(t,Ip,e)):Og(n,i,o)&&(e.preventDefault(),Dg(t,Dp,e)):!qp&&Og(n,i,o)&&(e.preventDefault(),Dg(t,Dp,e)),function(e,t,n,r){return e||t||n||r}(o,r,s,i)&&Dg(t,Up,e))}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;n instanceof Node&&"touch"!==r&&kb(t,(()=>{Ob(ug(n))||($v=!0)}))}],["compositionstart",function(e,t){kb(t,(()=>{const n=Gy();if(Ly(n)&&!t.isComposing()){const r=n.anchor,o=n.anchor.getNode();sg(r.key),(e.timeStamp{Zv(t,e.data)}))}],["input",function(e,t){e.stopPropagation(),kb(t,(()=>{const n=Gy(),r=e.data,o=Jv(e);if(null!=r&&Ly(n)&&Yv(n,o,r,e.timeStamp,!1)){Hv&&(Zv(t,r),Hv=!1);const o=n.anchor.getNode(),i=Hg(t._window);if(null===i)return;const s=n.isBackward(),a=s?n.anchor.offset:n.focus.offset,l=s?n.focus.offset:n.anchor.offset;Yp&&!n.isCollapsed()&&Ty(o)&&null!==i.anchorNode&&o.getTextContent().slice(0,a)+r+o.getTextContent().slice(a+l)===wg(i.anchorNode)||Dg(t,cp,r);const c=r.length;qp&&c>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=c),Xp||Gp||em||!t.isComposing()||(Fv=0,sg(null))}else _g(!1,t,null!==r?r:void 0),Hv&&(Zv(t,r||void 0),Hv=!1);db(),Bm(pb())})),Bv=null}],["click",function(e,t){kb(t,(()=>{const n=Gy(),r=Hg(t._window),o=Jy();if(r)if(Ly(n)){const t=n.anchor,i=t.getNode();"element"===t.type&&0===t.offset&&n.isCollapsed()&&!Nb(i)&&1===hg().getChildrenSize()&&i.getTopLevelElementOrThrow().isEmpty()&&null!==o&&n.is(o)?(r.removeAllRanges(),n.dirty=!0):3!==e.detail||n.isCollapsed()||i!==n.focus.getNode()&&(Tb(i)?i.select(0):i.getParentOrThrow().select(0))}else if("touch"===e.pointerType){const n=r.anchorNode;if(null!==n){const i=n.nodeType;i!==tm&&i!==nm||mg(Xy(o,r,t,e))}}Dg(t,ip,e)}))}],["cut",Dv],["copy",Dv],["dragstart",Dv],["dragover",Dv],["dragend",Dv],["paste",Dv],["focus",Dv],["blur",Dv],["drop",Dv]];Yp&&Lv.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType,r=Jv(e);"deleteCompositionText"===n||qp&&Ig(t)||"insertCompositionText"!==n&&kb(t,(()=>{const o=Gy();if("deleteContentBackward"===n){if(null===o){const e=Jy();if(!Ly(e))return;mg(e.clone())}if(Ly(o)){const n=o.anchor.key===o.focus.key;if(i=e.timeStamp,"MediaLast"===zv&&i{kb(t,(()=>{sg(null)}))}),30),Ly(o)){const e=o.anchor.getNode();e.markDirty(),o.format=e.getFormat(),Ty(e)||Am(142),o.style=e.getStyle()}}else{sg(null),e.preventDefault();const r=o.anchor.getNode().getTextContent(),i=0===o.anchor.offset&&o.focus.offset===r.length;Qp&&n&&!i||Dg(t,sp,!0)}return}}var i;if(!Ly(o))return;const s=e.data;null!==Bv&&_g(!1,t,Bv),o.dirty&&null===Bv||!o.isCollapsed()||Nb(o.anchor.getNode())||null===r||o.applyDOMRange(r),Bv=null;const a=o.anchor,l=o.focus,c=a.getNode(),u=l.getNode();if("insertText"!==n&&"insertTranspose"!==n)switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Dg(t,cp,e);break;case"insertFromComposition":sg(null),Dg(t,cp,e);break;case"insertLineBreak":sg(null),Dg(t,ap,!1);break;case"insertParagraph":sg(null),Kv&&!Gp?(Kv=!1,Dg(t,ap,!1)):Dg(t,lp,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Dg(t,up,e);break;case"deleteByComposition":(function(e,t){return e!==t||Tb(e)||Tb(t)||!e.isToken()||!t.isToken()})(c,u)&&Dg(t,dp,e);break;case"deleteByDrag":case"deleteByCut":Dg(t,dp,e);break;case"deleteContent":Dg(t,sp,!1);break;case"deleteWordBackward":Dg(t,fp,!0);break;case"deleteWordForward":Dg(t,fp,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Dg(t,hp,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Dg(t,hp,!1);break;case"formatStrikeThrough":Dg(t,pp,"strikethrough");break;case"formatBold":Dg(t,pp,"bold");break;case"formatItalic":Dg(t,pp,"italic");break;case"formatUnderline":Dg(t,pp,"underline");break;case"historyUndo":Dg(t,mp,void 0);break;case"historyRedo":Dg(t,gp,void 0)}else{if("\n"===s)e.preventDefault(),Dg(t,ap,!1);else if(s===ym)e.preventDefault(),Dg(t,lp,void 0);else if(null==s&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(t)}else null!=s&&Yv(o,r,s,e.timeStamp,!0)?(e.preventDefault(),Dg(t,cp,s)):Bv=s;Vv=e.timeStamp}}))}(e,t)]);let Fv=0,zv=null,Vv=0,Bv=null;const Wv=new WeakMap;let Uv=!1,$v=!1,Kv=!1,Hv=!1,qv=[0,"",0,"root",0];function Yv(e,t,n,r,o){const i=e.anchor,s=e.focus,a=i.getNode(),l=pb(),c=Hg(l._window),u=null!==c?c.anchorNode:null,d=i.key,f=l.getElementByKey(d),h=n.length;return d!==s.key||!Ty(a)||(!o&&(!Yp||Vv1||(o||!Yp)&&null!==f&&!a.isComposing()&&u!==ng(f)||null!==c&&null!==t&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;const n=e.anchor.offset,r=t.getParentOrThrow(),o=t.isToken();return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||o||function(e){const t=e.getPreviousSibling();return(Ty(t)||Tb(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||o)}(e,a)}function Xv(e,t){return null!==e&&null!==e.nodeValue&&e.nodeType===nm&&0!==t&&t!==e.nodeValue.length}function Gv(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=e;Uv&&(Uv=!1,Xv(r,o)&&Xv(i,s))||kb(t,(()=>{if(!n)return void mg(null);if(!Gm(t,r,i))return;const a=Gy();if(Ly(a)){const n=a.anchor,r=n.getNode();if(a.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(a.dirty=!0);const o=Bg(t).event,i=o?o.timeStamp:performance.now(),[s,l,c,u,d]=qv,f=hg(),h=!1===t.isComposing()&&""===f.getTextContent();if(i{const t=Jy(),o=n.anchorNode;if(null===o)return;const i=o.nodeType;i!==tm&&i!==nm||mg(Xy(t,n,r,e))})));const o=bg(r),i=o[o.length-1],s=i._key,a=ey.get(s),l=a||i;l!==r&&Gv(n,l,!1),Gv(n,r,!0),r!==i?ey.set(s,r):a&&ey.delete(s)}function ny(e){e._lexicalHandled=!0}function ry(e){return!0===e._lexicalHandled}function oy(e,t,n){db();const r=e.__key,o=e.getParent();if(null===o)return;const i=function(e){const t=Gy();if(!Ly(t)||!Tb(e))return t;const{anchor:n,focus:r}=t,o=n.getNode(),i=r.getNode();return Vg(o,e)&&n.set(e.__key,0,"element"),Vg(i,e)&&r.set(e.__key,0,"element"),t}(e);let s=!1;if(Ly(i)&&t){const t=i.anchor,n=i.focus;t.key===r&&(eb(t,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0),n.key===r&&(eb(n,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else zy(i)&&t&&e.isSelected()&&e.selectPrevious();if(Ly(i)&&t&&!s){const t=e.getIndexWithinParent();og(e),Zy(i,o,t,-1)}else og(e);n||Wg(o)||o.canBeEmpty()||!o.isEmpty()||oy(o,t),t&&Nb(o)&&o.isEmpty()&&o.selectEnd()}class iy{static getType(){Am(64,this.name)}static clone(e){Am(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,function(e,t){if(null!=t)return void(e.__key=t);db(),fb();const n=pb(),r=hb(),o=""+qm++;r._nodeMap.set(o,e),Tb(e)?n._dirtyElements.set(o,!0):n._dirtyLeaves.add(o),n._cloneNotNeeded.add(o),n._dirtyType=1,e.__key=o}(this,e)}getType(){return this.__type}isInline(){Am(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=lg(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){const t=e||Gy();if(null==t)return!1;const n=t.getNodes().some((e=>e.__key===this.__key));if(Ty(this))return n;if(Ly(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;const e=this.getParent();if(Ob(this)&&this.isInline()&&e){const n=t.isBackward()?t.focus:t.anchor,r=n.getNode();if(n.offset===r.getChildrenSize()&&r.is(e)&&r.getLastChildOrThrow().is(this))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(null===e)return-1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return null===e?null:lg(e)}getParentOrThrow(){const e=this.getParent();return null===e&&Am(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){const t=e.getParent();if(Wg(t))return Tb(e)||e===this&&Ob(e)||Am(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return null===e&&Am(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return null===e?null:lg(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return null===e?null:lg(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),n=e.getParents();Tb(this)&&t.unshift(this),Tb(e)&&n.unshift(e);const r=t.length,o=n.length;if(0===r||0===o||t[r-1]!==n[o-1])return null;const i=new Set(n);for(let e=0;e{s.append(e)}))),Ly(n)){mg(n);const e=n.anchor,t=n.focus;e.key===o&&jy(e,s),t.key===o&&jy(t,s)}return ag()===o&&sg(i),s}insertAfter(e,t=!0){db(),$g(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.getParent(),i=Gy();let s=!1,a=!1;if(null!==o){const t=e.getIndexWithinParent();if(og(r),Ly(i)){const e=o.__key,n=i.anchor,r=i.focus;s="element"===n.type&&n.key===e&&n.offset===t+1,a="element"===r.type&&r.key===e&&r.offset===t+1}}const l=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(null===l?c.__last=u:l.getWritable().__prev=u,c.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&Ly(i)){const e=this.getIndexWithinParent();Zy(i,c,e+1);const t=c.__key;s&&i.anchor.set(t,e+2,"element"),a&&i.focus.set(t,e+2,"element")}return e}insertBefore(e,t=!0){db(),$g(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.__key;og(r);const i=this.getPreviousSibling(),s=this.getParentOrThrow().getWritable(),a=n.__prev,l=this.getIndexWithinParent();null===i?s.__first=o:i.getWritable().__next=o,s.__size++,n.__prev=o,r.__prev=a,r.__next=n.__key,r.__parent=n.__parent;const c=Gy();return t&&Ly(c)&&Zy(c,this.getParentOrThrow(),l),e}isParentRequired(){return!1}createParentElementNode(){return zb()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){db();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(Tb(n))return n.select();if(!Ty(n)){const e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){db();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(Tb(n))return n.select(0,0);if(!Ty(n)){const e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}}class sy extends iy{static getType(){return"linebreak"}static clone(e){return new sy(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(e){const t=e.parentElement;if(null!==t&&Xg(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&uy(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&uy(n))return!0}}return!1}(e)||function(e){const t=e.parentElement;if(null!==t&&Xg(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&uy(n))return!1;const r=t.lastChild;if(r===e||r.previousSibling===e&&uy(r))return!0}return!1}(e)?null:{conversion:ay,priority:0}}}static importJSON(e){return ly()}exportJSON(){return{type:"linebreak",version:1}}}function ay(e){return{node:ly()}}function ly(){return Ug(new sy)}function cy(e){return e instanceof sy}function uy(e){return e.nodeType===nm&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function dy(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function fy(e,t){return 1&t?"strong":2&t?"em":"span"}function hy(e,t,n,r,o){const i=r.classList;let s=Ag(o,"base");void 0!==s&&i.add(...s),s=Ag(o,"underlineStrikethrough");let a=!1;const l=t&cm&&t&lm;void 0!==s&&(n&cm&&n&lm?(a=!0,l||i.add(...s)):l&&i.remove(...s));for(const e in Em){const r=Em[e];if(s=Ag(o,e),void 0!==s)if(n&r){if(a&&("underline"===e||"strikethrough"===e)){t&r&&i.remove(...s);continue}t&r&&(!l||"underline"!==e)&&"strikethrough"!==e||i.add(...s)}else t&r&&i.remove(...s)}}function py(e,t,n){const r=t.firstChild,o=n.isComposing(),i=e+(o?vm:"");if(null==r)t.textContent=i;else{const e=r.nodeValue;if(e!==i)if(o||qp){const[t,n,o]=function(e,t){const n=e.length,r=t.length;let o=0,i=0;for(;o({conversion:_y,priority:0}),b:()=>({conversion:by,priority:0}),code:()=>({conversion:ky,priority:0}),em:()=>({conversion:ky,priority:0}),i:()=>({conversion:ky,priority:0}),s:()=>({conversion:ky,priority:0}),span:()=>({conversion:yy,priority:0}),strong:()=>({conversion:ky,priority:0}),sub:()=>({conversion:ky,priority:0}),sup:()=>({conversion:ky,priority:0}),u:()=>({conversion:ky,priority:0})}}static importJSON(e){const t=Cy(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return null!==t&&qg(t)||Am(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=gy(t,"b")),this.hasFormat("italic")&&(t=gy(t,"i")),this.hasFormat("strikethrough")&&(t=gy(t,"s")),this.hasFormat("underline")&&(t=gy(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format="string"==typeof e?Em[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail="string"==typeof e?km[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=rg(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=Pm[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){db();let n=e,r=t;const o=Gy(),i=this.getTextContent(),s=this.__key;if("string"==typeof i){const e=i.length;void 0===n&&(n=e),void 0===r&&(r=e)}else n=0,r=0;if(!Ly(o))return qy(s,n,s,r,"text","text");{const e=ag();e!==o.anchor.key&&e!==o.focus.key||sg(s),o.setTextNodeRange(this,n,this,r)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){const o=this.getWritable(),i=o.__text,s=n.length;let a=e;a<0&&(a=s+a,a<0&&(a=0));const l=Gy();if(r&&Ly(l)){const t=e+s;l.setTextNodeRange(o,t,o,t)}const c=i.slice(0,a)+n+i.slice(a+t);return o.__text=c,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){db();const t=this.getLatest(),n=t.getTextContent(),r=t.__key,o=ag(),i=new Set(e),s=[],a=n.length;let l="";for(let e=0;eb&&e.offset<=l&&(e.key=a,e.offset-=b,v.dirty=!0),t.key===r&&"text"===t.type&&t.offset>b&&t.offset<=l&&(t.key=a,t.offset-=b,v.dirty=!0)}o===r&&sg(a),b=l,y.push(i)}if(null!==d){!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&ig(t),null!==n&&ig(n)}(this);const e=d.getWritable(),t=this.getIndexWithinParent();g?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),Ly(v)&&Zy(v,d,t,c-1)}return y}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||Am(50);const n=this.__key,r=e.__key,o=this.__text,i=o.length;ag()===r&&sg(n);const s=Gy();if(Ly(s)){const o=s.anchor,a=s.focus;null!==o&&o.key===r&&(tb(o,t,n,e,i),s.dirty=!0),null!==a&&a.key===r&&(tb(a,t,n,e,i),s.dirty=!0)}const a=e.__text,l=t?a+o:o+a;this.setTextContent(l);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function yy(e){return{forChild:Py(e.style),node:null}}function by(e){const t=e,n="normal"===t.style.fontWeight;return{forChild:Py(t.style,n?void 0:"bold"),node:null}}const xy=new WeakMap;function wy(e){return"PRE"===e.nodeName||e.nodeType===tm&&void 0!==e.style&&void 0!==e.style.whiteSpace&&e.style.whiteSpace.startsWith("pre")}function _y(e){const t=e;null===e.parentElement&&Am(129);let n=t.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=xy.get(n))&&!wy(n);)r.push(n),n=n.parentNode;const o=void 0===t?n:t;for(let e=0;e0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(" "===n[n.length-1]){let e=t,r=!0;for(;null!==e&&null!==(e=Sy(e,!0));)if((e.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:Cy(n)}}function Sy(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){const e=n.parentElement;if(null===e)return null;n=e}if(n=e,n.nodeType===tm){const e=n.style.display;if(""===e&&!Yg(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(n.nodeType===nm)return n;if("BR"===n.nodeName)return null}}const Ey={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function ky(e){const t=Ey[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:Py(e.style,t),node:null}}function Cy(e=""){return Ug(new vy(e))}function Ty(e){return e instanceof vy}function Py(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),o="700"===n||"bold"===n,i=r.includes("line-through"),s="italic"===e.fontStyle,a=r.includes("underline"),l=e.verticalAlign;return e=>Ty(e)?(o&&!e.hasFormat("bold")&&e.toggleFormat("bold"),i&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),s&&!e.hasFormat("italic")&&e.toggleFormat("italic"),a&&!e.hasFormat("underline")&&e.toggleFormat("underline"),"sub"!==l||e.hasFormat("subscript")||e.toggleFormat("subscript"),"super"!==l||e.hasFormat("superscript")||e.toggleFormat("superscript"),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}class Ry extends vy{static getType(){return"tab"}static clone(e){return new Ry(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=Oy();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){Am(126)}setDetail(e){Am(127)}setMode(e){Am(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Oy(){return Ug(new Ry)}class Ay{constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),n=e.getNode();const r=this.offset,o=e.offset;if(Tb(t)){const e=t.getDescendantByIndex(r);t=null!=e?e:t}if(Tb(n)){const e=n.getDescendantByIndex(o);n=null!=e?e:n}return t===n?re&&(r=e)}else if(!Tb(t)){const e=t.getNextSibling();if(Ty(e))n=e.__key,r=0,o="text";else{const e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,o)}function jy(e,t){if(Tb(t)){const n=t.getLastDescendant();Tb(n)||Ty(n)?My(e,n):My(e,t)}else My(e,t)}function Iy(e,t,n,r){e.key=t,e.offset=n,e.type=r}class Dy{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!zy(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((e=>n.has(e)))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new Dy(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),n=t.length,r=t[n-1];let o;if(Ty(r))o=r.select();else{const e=r.getIndexWithinParent()+1;o=r.getParentOrThrow().select(e,e)}o.insertNodes(e);for(let e=0;e0?[]:[s]:s.getNodesBetween(a),ub()||(this._cachedNodes=u),u}setTextNodeRange(e,t,n,r){Iy(this.anchor,e.__key,t,"text"),Iy(this.focus,n.__key,r,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(0===e.length)return"";const t=e[0],n=e[e.length-1],r=this.anchor,o=this.focus,i=r.isBefore(o),[s,a]=By(this);let l="",c=!0;for(let u=0;u=0;e--){const t=i[e];if(t.is(d)||Tb(t)&&t.isParentOf(d))break;t.isAttached()&&(!h.has(t)||t.is(o)?m||g.insertAfter(t,!1):t.remove())}if(!m){let e=r,n=null;for(;null!==e;){const r=e.getChildren(),o=r.length;(0===o||r[o-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(d.isToken())if(a===f)d.select();else{const t=Cy(e);t.select(),d.replace(t)}else d=d.spliceText(a,f-a,e,!0),""===d.getTextContent()?d.remove():d.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length);for(let e=1;e0&&(m===p.getTextContentSize()||eg(p)||([p]=p.splitText(m)),p.setFormat(g));for(let t=c+1;t(Tb(e)||Ob(e))&&!e.isInline()))){Tb(t)||Am(135);const r=nb(this);return t.splice(r,0,e),void n.selectEnd()}const r=function(e){const t=zb();let n=null;for(let r=0;rl?l:a,t=a>l?a:l,n=i.splitText(e,t),r=0===e?n[0]:n[1];return null!=r?[r]:[]}return[i]}const c=r.isBefore(o);if(Ty(i)){const t=c?a:l;t===i.getTextContentSize()?e.shift():0!==t&&([,i]=i.splitText(t),e[0]=i)}if(Ty(s)){const t=s.getTextContent().length,r=c?l:a;0===r?e.pop():r!==t&&([s]=s.splitText(r),e[n]=s)}return e}modify(e,t,n){const r=this.focus,o=this.anchor,i="move"===e,s=jg(r,t);if(Ob(s)&&!s.isIsolated()){if(i&&s.isKeyboardSelectable()){const e=Yy();return e.add(s.__key),void mg(e)}const e=t?s.getPreviousSibling():s.getNextSibling();if(Ty(e)){const n=e.__key,s=t?e.getTextContent().length:0;return r.set(n,s,"text"),void(i&&o.set(n,s,"text"))}{const n=s.getParentOrThrow();let a,l;return Tb(e)?(l=e.__key,a=t?e.getChildrenSize():0):(a=s.getIndexWithinParent(),l=n.__key,t||a++),r.set(l,a,"element"),void(i&&o.set(l,a,"element"))}}const a=pb(),l=Hg(a._window);if(!l)return;const c=a._blockCursorElement,u=a._rootElement;if(null===u||null===c||!Tb(s)||s.isInline()||s.canBeEmpty()||_n(c,a,u),function(e,t,n,r){e.modify(t,n,r)}(l,e,t?"backward":"forward",n),l.rangeCount>0){const e=l.getRangeAt(0),n=this.anchor.getNode(),r=Nb(n)?n:function(e){let t=e.getParentOrThrow();for(;null!==t;){if(Wg(t))return t;t=t.getParentOrThrow()}return t}(n);if(this.applyDOMRange(e),this.dirty=!0,!i){const n=this.getNodes(),o=[];let i=!1;for(let e=0;e0)if(t){const e=o[0];Tb(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{const e=o[o.length-1];Tb(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}l.anchorNode===e.startContainer&&l.anchorOffset===e.startOffset||function(e){const t=e.focus,n=e.anchor,r=n.key,o=n.offset,i=n.type;Iy(n,t.key,t.offset,t.type),Iy(t,r,o,i),e._cachedNodes=null}(this)}}}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&Tb(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){const e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(Tb(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const t=this.anchor;let n=t.getNode();if(this.forwardDeletion(t,n,e))return;const r=this.focus,o=jg(r,e);if(Ob(o)&&!o.isIsolated()){if(o.isKeyboardSelectable()&&Tb(n)&&0===n.getChildrenSize()){n.remove();const e=Yy();e.add(o.__key),mg(e)}else o.remove(),pb().dispatchCommand(op,void 0);return}if(!e&&Tb(o)&&Tb(n)&&n.isEmpty())return n.remove(),void o.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===t.offset&&("element"===t.type?t.getNode():t.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const o="text"===r.type?r.getNode():null;if(n="text"===t.type?t.getNode():null,null!==o&&o.isSegmented()){const t=r.offset,i=o.getTextContentSize();if(o.is(n)||e&&t!==i||!e&&0!==t)return void Wy(o,e,t)}else if(null!==n&&n.isSegmented()){const r=t.offset,i=n.getTextContentSize();if(n.is(o)||e&&0!==r||!e&&r!==i)return void Wy(n,e,r)}!function(e,t){const n=e.anchor,r=e.focus,o=n.getNode();if(o===r.getNode()&&"text"===n.type&&"text"===r.type){const e=n.offset,i=r.offset,s=en||r){o.splice(e,1),r&&(a=void 0);break}}const l=o.join("").trim();""===l?r.remove():(r.setTextContent(l),r.select(a,a))}function Uy(e,t,n,r){let o,i=t;if(e.nodeType===tm){let s=!1;const a=e.childNodes,l=a.length,c=r._blockCursorElement;i===l&&(s=!0,i=l-1);let u=a[i],d=!1;if(u===c)u=a[i+1],d=!0;else if(null!==c){const n=c.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,c)&&i--}if(o=gg(u),Ty(o))i=vg(o,s);else{let r=gg(e);if(null===r)return null;if(Tb(r)){i=Math.min(r.getChildrenSize(),i);let e=r.getChildAtIndex(i);if(Tb(e)&&function(e,t,n){const r=e.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(e,0,n)){const t=s?e.getLastDescendant():e.getFirstDescendant();null===t?r=e:(e=t,r=Tb(e)?e:e.getParentOrThrow()),i=0}Ty(e)?(o=e,r=null,i=vg(e,s)):e!==r&&s&&!d&&i++}else{const n=r.getIndexWithinParent();i=0===t&&Ob(r)&&gg(e)===r?n:n+1,r=r.getParentOrThrow()}if(Tb(r))return Ny(r.__key,i,"element")}}else o=gg(e);return Ty(o)?Ny(o.__key,i,"text"):null}function $y(e,t,n){const r=e.offset,o=e.getNode();if(0===r){const r=o.getPreviousSibling(),i=o.getParent();if(t){if((n||!t)&&null===r&&Tb(i)&&i.isInline()){const t=i.getPreviousSibling();Ty(t)&&(e.key=t.__key,e.offset=t.getTextContent().length)}}else Tb(r)&&!n&&r.isInline()?(e.key=r.__key,e.offset=r.getChildrenSize(),e.type="element"):Ty(r)&&(e.key=r.__key,e.offset=r.getTextContent().length)}else if(r===o.getTextContent().length){const r=o.getNextSibling(),i=o.getParent();if(t&&Tb(r)&&r.isInline())e.key=r.__key,e.offset=0,e.type="element";else if((n||t)&&null===r&&Tb(i)&&i.isInline()&&!i.canInsertTextAfter()){const t=i.getNextSibling();Ty(t)&&(e.key=t.__key,e.offset=0)}}}function Ky(e,t,n){if("text"===e.type&&"text"===t.type){const r=e.isBefore(t),o=e.is(t);$y(e,r,o),$y(t,!r,o),o&&(t.key=e.key,t.offset=e.offset,t.type=e.type);const i=pb();if(i.isComposing()&&i._compositionKey!==e.key&&Ly(n)){const r=n.anchor,o=n.focus;Iy(e,r.key,r.offset,r.type),Iy(t,o.key,o.offset,o.type)}}}function Hy(e,t,n,r,o,i){if(null===e||null===n||!Gm(o,e,n))return null;const s=Uy(e,t,Ly(i)?i.anchor:null,o);if(null===s)return null;const a=Uy(n,r,Ly(i)?i.focus:null,o);if(null===a)return null;if("element"===s.type&&"element"===a.type){const t=gg(e),r=gg(n);if(Ob(t)&&Ob(r))return null}return Ky(s,a,i),[s,a]}function qy(e,t,n,r,o,i){const s=hb(),a=new Fy(Ny(e,t,o),Ny(n,r,i),0,"");return a.dirty=!0,s._selection=a,a}function Yy(){return new Dy(new Set)}function Xy(e,t,n,r){const o=n._window;if(null===o)return null;const i=r||o.event,s=i?i.type:void 0,a="selectionchange"===s,l=!jm&&(a||"beforeinput"===s||"compositionstart"===s||"compositionend"===s||"click"===s&&i&&3===i.detail||"drop"===s||void 0===s);let c,u,d,f;if(Ly(e)&&!l)return e.clone();if(null===t)return null;if(c=t.anchorNode,u=t.focusNode,d=t.anchorOffset,f=t.focusOffset,a&&Ly(e)&&!Gm(n,c,u))return e.clone();const h=Hy(c,d,u,f,n,e);if(null===h)return null;const[p,m]=h;return new Fy(p,m,Ly(e)?e.format:0,Ly(e)?e.style:"")}function Gy(){return hb()._selection}function Jy(){return pb()._editorState._selection}function Zy(e,t,n,r=1){const o=e.anchor,i=e.focus,s=o.getNode(),a=i.getNode();if(!t.is(s)&&!t.is(a))return;const l=t.__key;if(e.isCollapsed()){const t=o.offset;if(n<=t&&r>0||n0||n0||n=e,s=o?i.getChildAtIndex(e-1):i.getChildAtIndex(n);if(Ty(s)){let e=0;o&&(e=s.getTextContentSize()),t.set(s.__key,e,"text"),r.set(s.__key,e,"text")}}else{if(Tb(i)){const e=i.getChildrenSize(),r=n>=e,o=r?i.getChildAtIndex(e-1):i.getChildAtIndex(n);if(Ty(o)){let e=0;r&&(e=o.getTextContentSize()),t.set(o.__key,e,"text")}}if(Tb(s)){const e=s.getChildrenSize(),t=o>=e,n=t?s.getChildAtIndex(e-1):s.getChildAtIndex(o);if(Ty(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}}function eb(e,t,n,r,o){let i=null,s=0,a=null;null!==r?(i=r.__key,Ty(r)?(s=r.getTextContentSize(),a="text"):Tb(r)&&(s=r.getChildrenSize(),a="element")):null!==o&&(i=o.__key,Ty(o)?a="text":Tb(o)&&(a="element")),null!==i&&null!==a?e.set(i,s,a):(s=t.getIndexWithinParent(),-1===s&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function tb(e,t,n,r,o){"text"===e.type?(e.key=n,t||(e.offset+=o)):e.offset>r.getIndexWithinParent()&&(e.offset-=1)}function nb(e){let t=e;e.isCollapsed()||t.removeText();const n=Gy();Ly(n)&&(t=n),Ly(t)||Am(161);const r=t.anchor;let o=r.getNode(),i=r.offset;for(;!Gg(o);)[o,i]=rb(o,i);return i}function rb(e,t){const n=e.getParent();if(!n){const e=zb();return hg().append(e),e.select(),[hg(),0]}if(Ty(e)){const r=e.splitText(t);if(0===r.length)return[n,e.getIndexWithinParent()];const o=0===t?0:1;return[n,r[0].getIndexWithinParent()+o]}if(!Tb(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new Fy(Ny(e.__key,t,"element"),Ny(e.__key,t,"element"),0,""),o=e.insertNewAfter(n);o&&o.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}let ob=null,ib=null,sb=!1,ab=!1,lb=0;const cb={characterData:!0,childList:!0,subtree:!0};function ub(){return sb||null!==ob&&ob._readOnly}function db(){sb&&Am(13)}function fb(){lb>99&&Am(14)}function hb(){return null===ob&&Am(195,mb()),ob}function pb(){return null===ib&&Am(196,mb()),ib}function mb(){let e=0;const t=new Set,n=Ub.version;if("undefined"!=typeof window)for(const r of document.querySelectorAll("[contenteditable]")){const o=Qm(r);if(Jm(o))e++;else if(o){let e=String(o.constructor.version||"<0.17.1");e===n&&(e+=" (separately built, likely a bundler configuration issue)"),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function gb(e,t,n){const r=t.__type,o=function(e,t){const n=e._nodes.get(t);return void 0===n&&Am(30,t),n}(e,r);let i=n.get(r);void 0===i&&(i=Array.from(o.transforms),n.set(r,i));const s=i.length;for(let e=0;e0?r.getRangeAt(0):null;if(null!==e){let t;if(e instanceof Text){const n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){const r=n.ownerDocument,o=r.defaultView;if(null===o)return;let{top:i,bottom:s}=t,a=0,l=0,c=n;for(;null!==c;){const t=c===r.body;if(t)a=0,l=Bg(e).innerHeight;else{const e=c.getBoundingClientRect();a=e.top,l=e.bottom}let n=0;if(il&&(n=s-l),0!==n)if(t)o.scrollBy(0,n);else{const e=c.scrollTop;c.scrollTop+=n;const t=c.scrollTop-e;i-=t,s-=t}if(t)break;c=zg(c)}}(n,t,i)}}Uv=!0}}(s,a,e,x,y,r)}(function(e,t,n){let r=e._blockCursorElement;if(Ly(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(document.activeElement)){const o=n.anchor,i=o.getNode(),s=o.offset;let a=!1,l=null;if(s===i.getChildrenSize())Kg(i.getChildAtIndex(s-1))&&(a=!0);else{const t=i.getChildAtIndex(s);if(Kg(t)){const n=t.getPreviousSibling();(null===n||Kg(n))&&(a=!0,l=e.getElementByKey(t.__key))}}if(a){const n=e.getElementByKey(i.__key);return null===r&&(e._blockCursorElement=r=function(e){const t=e.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=t.blockCursor;if(void 0!==r){if("string"==typeof r){const e=Nm(r);r=t.blockCursor=e}void 0!==r&&n.classList.add(...r)}return n}(e._config)),t.style.caretColor="transparent",void(null===l?n.appendChild(r):n.insertBefore(r,l))}}null!==r&&_n(r,e,t)})(e,r,a),null!==h&&h.observe(r,cb)}finally{ib=d,ob=c}}null!==p&&function(e,t,n,r,o){const i=Array.from(e._listeners.mutation),s=i.length;for(let e=0;e{r=_b(e,t,n)})),r}const r=bg(e);for(let o=4;o>=0;o--)for(let i=0;i0||u>0;){if(l>0){t._dirtyLeaves=new Set;for(const e of a){const r=o.get(e);Ty(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&Km(r),void 0!==r&&vb(r,i)&&gb(t,r,s),n.add(e)}if(a=t._dirtyLeaves,l=a.size,l>0){lb++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map;for(const e of c){const n=e[0],a=e[1];if("root"!==n&&!a)continue;const l=o.get(n);void 0!==l&&vb(l,i)&&gb(t,l,s),r.set(n,a)}a=t._dirtyLeaves,l=a.size,c=t._dirtyElements,u=c.size,lb++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),Sb(e),function(e,t,n,r){const o=e._nodeMap,i=t._nodeMap,s=[];for(const[e]of r){const t=i.get(e);void 0!==t&&(t.isAttached()||(Tb(t)&&tv(t,e,o,i,s,r),o.has(e)||r.delete(e),s.push(e)))}for(const e of s)i.delete(e);for(const e of n){const t=i.get(e);void 0===t||t.isAttached()||(o.has(e)||n.delete(e),i.delete(e))}}(l,c,e._dirtyLeaves,e._dirtyElements)),n!==e._compositionKey&&(c._flushSync=!0);const r=c._selection;if(Ly(r)){const e=c._nodeMap,t=r.anchor.key,n=r.focus.key;void 0!==e.get(t)&&void 0!==e.get(n)||Am(19)}else zy(r)&&0===r._nodes.size&&(c._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=l,e._dirtyType=om,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void xb(e)}finally{ob=d,sb=f,ib=h,e._updating=p,lb=0}const m=e._dirtyType!==rm||function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(c,e);m?c._flushSync?(c._flushSync=!1,xb(e)):u&&Ym((()=>{xb(e)})):(c._flushSync=!1,u&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function kb(e,t,n){e._updating?e._updates.push([t,n]):Eb(e,t,n)}class Cb extends iy{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Tm[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const e=pb()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;null!==t;){if(Ty(t)&&e.push(t),Tb(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;Tb(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;Tb(e);){const t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const e=t[n-1];return Tb(e)&&e.getLastDescendant()||e||null}const r=t[e];return Tb(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:lg(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&Am(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:lg(e)}getLastChildOrThrow(){const e=this.getLastChild();return null===e&&Am(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,r;if(e=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e="";const t=this.getChildren(),n=t.length;for(let r=0;re.remove())),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e?Cm[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){const r=n.length,o=this.getChildrenSize(),i=this.getWritable(),s=i.__key,a=[],l=[],c=this.getChildAtIndex(e+t);let u=null,d=o-t+r;if(0!==e)if(e===o)u=this.getLastChild();else{const t=this.getChildAtIndex(e);null!==t&&(u=t.getPreviousSibling())}if(t>0){let e=null===u?this.getFirstChild():u.getNextSibling();for(let n=0;n({root:jb(hg())})))}}class Db extends Cb{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class Lb extends Cb{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=Em[e];return!!(this.getTextFormat()&t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new Lb(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),n=Ag(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:Fb,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&qg(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n);const r=this.getIndent();r>0&&(t.style.textIndent=20*r+"px")}return{element:t}}static importJSON(e){const t=zb();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const n=zb();n.setTextFormat(e.format),n.setTextStyle(e.style);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getTextStyle()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(0===e.length||Ty(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function Fb(e){const t=zb();if(e.style){t.setFormat(e.style.textAlign);const n=parseInt(e.style.textIndent,10)/20;n>0&&t.setIndent(n)}return{node:t}}function zb(){return Ug(new Lb)}function Vb(e){return e instanceof Lb}const Bb=1;function Wb(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=Mb(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=rm,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const i=e._observer;null!==i&&(i.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",o.set("root",n))}class Ub{constructor(e,t,n,r,o,i,s){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=rm,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=xg(),this._onError=o,this._htmlConversions=i,this._editable=s,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){void 0===n&&Am(35);const r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=r.get(e);void 0===o&&Am(36,String(e));const i=o[n];return i.add(t),()=>{i.delete(t),o.every((e=>0===e.size))&&r.delete(e)}}registerMutationListener(e,t,n){const r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;o.set(t,r);const i=n&&n.skipInitialization;return void 0===i||i||this.initializeMutationListener(t,r),()=>{o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return void 0===t&&Am(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const n=this._editorState,r=function(e){if(!e._readOnly&&e.isEmpty())return Qg;e._readOnly||Am(192);let t=Zg.get(e);if(!t){t=new Map,Zg.set(e,t);for(const[n,r]of e._nodeMap){const e=r.__type;let o=t.get(e);o||(o=new Map,t.set(e,o)),o.set(n,r)}}return t}(n).get(t.getType());if(!r)return;const o=new Map;for(const e of r.keys())o.set(e,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),r=[n],o=n.replaceWithKlass;if(null!=o){const e=this.registerNodeTransformToKlass(o,t);r.push(e)}var i;return i=e.getType(),kb(this,(()=>{const e=hb();if(e.isEmpty())return;if("root"===i)return void hg().markDirty();const t=e._nodeMap;for(const[,e]of t)e.markDirty()}),null===this._pendingEditorState?{tag:"history-merge"}:void 0),()=>{r.forEach((e=>e.transforms.delete(t)))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return Dg(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=Ag(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,Wb(this,t,e,r),null!==t&&(this._config.disableEvents||function(e){const t=e.ownerDocument,n=Wv.get(t);void 0===n&&Am(162);const r=n-1;r>=0||Am(164),Wv.set(t,r),0===r&&t.removeEventListener("selectionchange",ty);const o=Qm(e);Jm(o)?(function(e){if(null!==e._parentEditor){const t=bg(e),n=t[t.length-1]._key;ey.get(n)===e&&ey.delete(n)}else ey.delete(e._key)}(o),e.__lexicalEditor=null):o&&Am(198);const i=Qv(e);for(let e=0;e{ry(e)||(ny(e),(t.isEditable()||"click"===r)&&i(e,t))}:e=>{if(ry(e))return;ny(e);const n=t.isEditable();switch(r){case"cut":return n&&Dg(t,Ip,e);case"copy":return Dg(t,jp,e);case"paste":return n&&Dg(t,up,e);case"dragstart":return n&&Dg(t,Ap,e);case"dragover":return n&&Dg(t,Np,e);case"dragend":return n&&Dg(t,Mp,e);case"focus":return n&&Dg(t,Bp,e);case"blur":return n&&Dg(t,Wp,e);case"drop":return n&&Dg(t,Op,e)}};e.addEventListener(r,s),o.push((()=>{e.removeEventListener(r,s)}))}}(e,this),null!=n&&e.classList.add(...n)}else this._editorState=r,this._pendingEditorState=null,this._window=null;wb("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&Am(38),Bm(this);const n=this._pendingEditorState,r=this._updateTags,o=void 0!==t?t.tag:null;null===n||n.isEmpty()||(null!=o&&r.add(o),xb(this)),this._pendingEditorState=e,this._dirtyType=om,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=o&&r.add(o),xb(this)}parseEditorState(e,t){return function(e,t,n){const r=Mb(),o=ob,i=sb,s=ib,a=t._dirtyElements,l=t._dirtyLeaves,c=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,ob=r,sb=!1,ib=t;try{const o=t._nodes;yb(e.root,o),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=a,t._dirtyLeaves=l,t._cloneNotNeeded=c,t._dirtyType=u,ob=o,sb=i,ib=s}return r}("string"==typeof e?JSON.parse(e):e,this,t)}read(e){return xb(this),this.getEditorState().read(e,{editor:this})}update(e,t){kb(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),kb(this,(()=>{const e=Gy(),n=hg();null!==e?e.dirty=!0:0!==n.getChildrenSize()&&("rootStart"===t.defaultSelection?n.selectStart():n.selectEnd())}),{onUpdate:()=>{n.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;null!==e&&e.blur();const t=Hg(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,wb("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Ub.version="0.17.1+prod.esm";const $b="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Kb=$b?o.useLayoutEffect:o.useEffect,Hb={tag:"history-merge"};function qb({initialConfig:e,children:t}){const n=(0,o.useMemo)((()=>{const{theme:t,namespace:n,nodes:r,onError:o,editorState:i,html:s}=e,a=function(e,t){let n=null;return{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}}(0,t),l=function(e){const t=e||{},n=ib,r=t.theme||{},o=void 0===e?n:t.parentEditor||null,i=t.disableEvents||!1,s=Mb(),a=t.namespace||(null!==o?o._config.namespace:xg()),l=t.editorState,c=[Ab,vy,sy,Ry,Lb,Db,...t.nodes||[]],{onError:u,html:d}=t,f=void 0===t.editable||t.editable;let h;if(void 0===e&&null!==n)h=n._nodes;else{h=new Map;for(let e=0;e{Object.keys(e).forEach((t=>{let r=n.get(t);void 0===r&&(r=[],n.set(t,r)),r.push(e[t])}))};return e.forEach((e=>{const t=e.klass.importDOM;if(null==t||r.has(t))return;r.add(t);const n=t.call(e.klass);null!==n&&o(n)})),t&&o(t),n}(h,d?d.import:void 0),f);return void 0!==l&&(p._pendingEditorState=l,p._dirtyType=om),p}({editable:e.editable,html:s,namespace:n,nodes:r,onError:e=>o(e,l),theme:t});return function(e,t){if(null!==t)if(void 0===t)e.update((()=>{const t=hg();if(t.isEmpty()){const n=zb();t.append(n);const r=$b?document.activeElement:null;(null!==Gy()||null!==r&&r===e.getRootElement())&&n.select()}}),Hb);else if(null!==t)switch(typeof t){case"string":{const n=e.parseEditorState(t);e.setEditorState(n,Hb);break}case"object":e.setEditorState(t,Hb);break;case"function":e.update((()=>{hg().isEmpty()&&t(e)}),Hb)}}(l,i),[l,a]}),[]);return Kb((()=>{const t=e.editable,[r]=n;r.setEditable(void 0===t||t)}),[]),(0,Xc.jsx)(tp.Provider,{value:n,children:t})}const Yb="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;function Xb(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function Gb(e){return()=>function(e){if(!function(e,t=!0){if(e)return!1;let n=hg().getTextContent();return t&&(n=n.trim()),""===n}(e,!1))return!1;const t=hg().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function ex(e,t){const n=jg(e.focus,t);return Ob(n)&&!n.isIsolated()||Tb(n)&&!n.isInline()&&!n.canBeEmpty()}function tx(e,t,n){const r=function(e){const t=e.anchor.getNode();return"rtl"===(Nb(t)?t:t.getParentOrThrow()).getDirection()}(e);!function(e,t,n){e.modify(t?"extend":"move",n,"character")}(e,t,n?!r:r)}function nx(e,t,n,r=null){let o=null===r||t.isSelected(r);const i=Tb(t)&&t.excludeFromCopy("html");let s=t;if(null!==r){let e=ev(t);e=Ty(e)&&null!==r?function(e,t){const n=e.getStartEndPoints();if(t.isSelected(e)&&!t.isSegmented()&&!t.isToken()&&null!==n){const[r,o]=n,i=e.isBackward(),s=r.getNode(),a=o.getNode(),l=t.is(s),c=t.is(a);if(l||c){const[n,r]=By(e),o=s.is(a),l=t.is(i?a:s),c=t.is(i?s:a);let u,d=0;return o?(d=n>r?r:n,u=n>r?n:r):l?(d=i?r:n,u=void 0):c&&(d=0,u=i?n:r),t.__text=t.__text.slice(d,u),t}}return t}(r,e):e,s=e}const a=Tb(s)?s.getChildren():[],l=e._nodes.get(s.getType());let c;c=l&&void 0!==l.exportDOM?l.exportDOM(e,s):s.exportDOM(e);const{element:u,after:d}=c;if(!u)return!1;const f=document.createDocumentFragment();for(let n=0;n{if(null!==e){const r=function(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}(e,KeyboardEvent)?null:e.clipboardData,o=Gy();if(null!==o&&null!=r){e.preventDefault();const i=function(e,t=Gy()){return null==t&&rx(166),Ly(t)&&t.isCollapsed()||0===t.getNodes().length?"":function(e,t){if("undefined"==typeof document||"undefined"==typeof window&&void 0===n.g.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const r=document.createElement("div"),o=hg().getChildren();for(let n=0;ne.getDecorators()));return hx((()=>e.registerDecoratorListener((e=>{(0,On.flushSync)((()=>{r(e)}))}))),[e]),(0,o.useEffect)((()=>{r(e.getDecorators())}),[e]),(0,o.useMemo)((()=>{const r=[],i=Object.keys(n);for(let s=0;se._onError(t),children:(0,Xc.jsx)(o.Suspense,{fallback:null,children:n[a]})}),c=e.getElementByKey(a);null!==c&&r.push((0,On.createPortal)(l,c,a))}return r}),[t,n,e])}(r,n);return function(e){hx((()=>Qb(function(e){return Qb(e.registerCommand(sp,(e=>{const t=Gy();return!!Ly(t)&&(t.deleteCharacter(e),!0)}),0),e.registerCommand(fp,(e=>{const t=Gy();return!!Ly(t)&&(t.deleteWord(e),!0)}),0),e.registerCommand(hp,(e=>{const t=Gy();return!!Ly(t)&&(t.deleteLine(e),!0)}),0),e.registerCommand(cp,(e=>{const t=Gy();if(!Ly(t))return!1;if("string"==typeof e)t.insertText(e);else{const n=e.dataTransfer;if(null!=n)ox(n,t);else{const n=e.data;n&&t.insertText(n)}}return!0}),0),e.registerCommand(dp,(()=>{const e=Gy();return!!Ly(e)&&(e.removeText(),!0)}),0),e.registerCommand(ap,(e=>{const t=Gy();return!!Ly(t)&&(t.insertLineBreak(e),!0)}),0),e.registerCommand(lp,(()=>{const e=Gy();return!!Ly(e)&&(e.insertLineBreak(),!0)}),0),e.registerCommand(xp,(e=>{const t=Gy();if(!Ly(t))return!1;const n=e,r=n.shiftKey;return!!ex(t,!0)&&(n.preventDefault(),tx(t,r,!0),!0)}),0),e.registerCommand(yp,(e=>{const t=Gy();if(!Ly(t))return!1;const n=e,r=n.shiftKey;return!!ex(t,!1)&&(n.preventDefault(),tx(t,r,!1),!0)}),0),e.registerCommand(Cp,(t=>!!Ly(Gy())&&(t.preventDefault(),e.dispatchCommand(sp,!0))),0),e.registerCommand(Pp,(t=>!!Ly(Gy())&&(t.preventDefault(),e.dispatchCommand(sp,!1))),0),e.registerCommand(Ep,(t=>{if(!Ly(Gy()))return!1;if(null!==t){if((cx||lx||dx)&&ax)return!1;t.preventDefault()}return e.dispatchCommand(ap,!1)}),0),e.registerCommand(Dp,(()=>(function(){const e=hg();mg(function(e){return Hm(e.anchor),Hm(e.focus),e}(e.select(0,e.getChildrenSize())))}(),!0)),0),e.registerCommand(jp,(t=>!!Ly(Gy())&&(fx(t,e),!0)),0),e.registerCommand(Ip,(t=>!!Ly(Gy())&&(function(e,t){fx(e,t),t.update((()=>{const e=Gy();Ly(e)&&e.removeText()}))}(t,e),!0)),0),e.registerCommand(up,(t=>!!Ly(Gy())&&(function(e,t){e.preventDefault(),t.update((()=>{const t=Gy(),{clipboardData:n}=e;null!=n&&Ly(t)&&ox(n,t)}),{tag:"paste"})}(t,e),!0)),0),e.registerCommand(Op,(e=>!!Ly(Gy())&&(e.preventDefault(),!0)),0),e.registerCommand(Ap,(e=>!!Ly(Gy())&&(e.preventDefault(),!0)),0))}(e),function(e){const t=window.location.origin,n=n=>{if(n.origin!==t)return;const r=e.getRootElement();if(document.activeElement!==r)return;const o=n.data;if("string"==typeof o){let t;try{t=JSON.parse(o)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){const r=t.payload;if(r&&"makeChanges"===r.functionId){const t=r.args;if(t){const[r,o,i,s,a,l]=t;e.update((()=>{const e=Gy();if(Ly(e)){const t=e.anchor;let l=t.getNode(),c=0,u=0;if(Ty(l)&&r>=0&&o>=0&&(c=r,u=r+o,e.setTextNodeRange(l,c,l,u)),c===u&&""===i||(e.insertRawText(i),l=t.getNode()),Ty(l)){c=s,u=s+a;const t=l.getTextContentSize();c=c>t?t:c,u=u>t?t:u,e.setTextNodeRange(l,c,l,u)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}(e))),[e])}(r),(0,Xc.jsxs)(Xc.Fragment,{children:[e,(0,Xc.jsx)(gx,{content:t}),i]})}function gx({content:e}){const[t]=np(),n=function(e){const[t,n]=(0,o.useState)((()=>px(e)));return hx((()=>{function t(){const t=px(e);n(t)}return t(),Qb(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),r=function(e){const[t]=np(),n=(0,o.useMemo)((()=>e(t)),[t,e]),r=(0,o.useRef)(n.initialValueFn()),[i,s]=(0,o.useState)(r.current);return Yb((()=>{const{initialValueFn:e,subscribe:t}=n,o=e();return r.current!==o&&(r.current=o,s(o)),t((e=>{r.current=e,s(e)}))}),[n,e]),i}(Xb);return n?"function"==typeof e?e(r):e:null}const vx="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect,yx=(0,o.forwardRef)((function({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:i,ariaExpanded:s,ariaLabel:a,ariaLabelledBy:l,ariaMultiline:c,ariaOwns:u,ariaRequired:d,autoCapitalize:f,className:h,id:p,role:m="textbox",spellCheck:g=!0,style:v,tabIndex:y,"data-testid":b,...x},w){const[_,S]=(0,o.useState)(e.isEditable()),E=(0,o.useCallback)((t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)}),[e]),k=(0,o.useMemo)((()=>function(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}(w,E)),[E,w]);return vx((()=>(S(e.isEditable()),e.registerEditableListener((e=>{S(e)})))),[e]),(0,Xc.jsx)("div",{...x,"aria-activedescendant":_?t:void 0,"aria-autocomplete":_?n:"none","aria-controls":_?r:void 0,"aria-describedby":i,"aria-expanded":_&&"combobox"===m?!!s:void 0,"aria-label":a,"aria-labelledby":l,"aria-multiline":c,"aria-owns":_?u:void 0,"aria-readonly":!_||void 0,"aria-required":d,autoCapitalize:f,className:h,contentEditable:_,"data-testid":b,id:p,ref:k,role:_?m:void 0,spellCheck:g,style:v,tabIndex:y})}));function bx(e){return e.getEditorState().read(Gb(e.isComposing()))}const xx=(0,o.forwardRef)((function(e,t){const{placeholder:n,...r}=e,[o]=np();return(0,Xc.jsxs)(Xc.Fragment,{children:[(0,Xc.jsx)(yx,{editor:o,...r,ref:t}),null!=n&&(0,Xc.jsx)(wx,{editor:o,content:n})]})}));function wx({content:e,editor:t}){const n=function(e){const[t,n]=(0,o.useState)((()=>bx(e)));return vx((()=>{function t(){const t=bx(e);n(t)}return t(),Qb(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),[r,i]=(0,o.useState)(t.isEditable());if((0,o.useLayoutEffect)((()=>(i(t.isEditable()),t.registerEditableListener((e=>{i(e)})))),[t]),!n)return null;let s=null;return"function"==typeof e?s=e(r):null!==e&&(s=e),null===s?null:(0,Xc.jsx)("div",{"aria-hidden":!0,children:s})}const Sx=0,Ex=1,kx=2,Cx=0,Tx=1,Px=2,Rx=3,Ox=4;function Ax(e){e.undoStack=[],e.redoStack=[],e.current=null}function Nx({delay:e,externalHistoryState:t}){const[n]=np();return function(e,t,n=1e3){const r=(0,o.useMemo)((()=>t||{current:null,redoStack:[],undoStack:[]}),[t]);(0,o.useEffect)((()=>function(e,t,n){const r=function(e,t){let n=Date.now(),r=Cx;return(o,i,s,a,l,c)=>{const u=Date.now();if(c.has("historic"))return r=Cx,n=u,kx;const d=function(e,t,n,r,o){if(null===e||0===n.size&&0===r.size&&!o)return Cx;const i=t._selection,s=e._selection;if(o)return Tx;if(!(Ly(i)&&Ly(s)&&s.isCollapsed()&&i.isCollapsed()))return Cx;const a=function(e,t,n){const r=e._nodeMap,o=[];for(const e of t){const t=r.get(e);void 0!==t&&o.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||Nb(n)||o.push(n)}return o}(t,n,r);if(0===a.length)return Cx;if(a.length>1){const n=t._nodeMap,r=n.get(i.anchor.key),o=n.get(s.anchor.key);return r&&o&&!e._nodeMap.has(r.__key)&&Ty(r)&&1===r.__text.length&&1===i.anchor.offset?Px:Cx}const l=a[0],c=e._nodeMap.get(l.__key);if(!Ty(c)||!Ty(l)||c.__mode!==l.__mode)return Cx;const u=c.__text,d=l.__text;if(u===d)return Cx;const f=i.anchor,h=s.anchor;if(f.key!==h.key||"text"!==f.type)return Cx;const p=f.offset,m=h.offset,g=d.length-u.length;return 1===g&&m===p-1?Px:-1===g&&m===p+1?Rx:-1===g&&m===p?Ox:Cx}(o,i,a,l,e.isComposing()),f=(()=>{const f=null===s||s.editor===e,h=c.has("history-push");if(!h&&f&&c.has("history-merge"))return Sx;if(null===o)return Ex;const p=i._selection;return a.size>0||l.size>0?!1===h&&d!==Cx&&d===r&&ur.exportJSON())))===JSON.stringify(n.read((()=>o.exportJSON())))}(Array.from(a)[0],o,i)?Sx:Ex:null!==p?Sx:kx})();return n=u,r=d,f}}(e,n),o=Qb(e.registerCommand(mp,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const o=t.current,i=r.pop();null!==o&&(n.push(o),e.dispatchCommand(zp,!0)),0===r.length&&e.dispatchCommand(Vp,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(e,t),!0)),0),e.registerCommand(gp,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const o=t.current;null!==o&&(r.push(o),e.dispatchCommand(Vp,!0));const i=n.pop();0===n.length&&e.dispatchCommand(zp,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(e,t),!0)),0),e.registerCommand(Lp,(()=>(Ax(t),!1)),0),e.registerCommand(Fp,(()=>(Ax(t),e.dispatchCommand(zp,!1),e.dispatchCommand(Vp,!1),!0)),0),e.registerUpdateListener((({editorState:n,prevEditorState:o,dirtyLeaves:i,dirtyElements:s,tags:a})=>{const l=t.current,c=t.redoStack,u=t.undoStack,d=null===l?null:l.editorState;if(null!==l&&n===d)return;const f=r(o,n,l,i,s,a);if(f===Ex)0!==c.length&&(t.redoStack=[],e.dispatchCommand(zp,!1)),null!==l&&(u.push({...l}),e.dispatchCommand(Vp,!0));else if(f===kx)return;t.current={editor:e,editorState:n}})));return o}(e,r,n)),[n,e,r])}(n,t,e),null}function Mx(e,t){return Mx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Mx(e,t)}var jx={error:null},Ix=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o{if(n)return r.registerUpdateListener((({editorState:o,dirtyElements:i,dirtyLeaves:s,prevEditorState:a,tags:l})=>{t&&0===i.size&&0===s.size||e&&l.has("history-merge")||a.isEmpty()||n(o,r,l)}))}),[r,e,t,n]),null}function zx({editorRef:e}){const[t]=np();return o.useEffect((()=>{"function"==typeof e?e(t):"object"==typeof e&&(e.current=t)}),[t]),null}var Vx={sm:"py-1.5 px-2 rounded [&_.editor-content>p]:text-sm [&_.editor-content>p]:font-medium [&_.editor-content>p]:leading-[1.625rem]",md:"py-2 px-2.5 rounded-md [&_.editor-content>p]:text-sm [&_.editor-content>p]:font-medium [&_.editor-content>p]:leading-[1.625rem]",lg:"py-2.5 px-3 rounded-md [&_.editor-content>p]:text-sm [&_.editor-content>p]:font-medium [&_.editor-content>p]:leading-[1.6875rem]"},Bx={sm:"p-1.5 rounded-md max-h-[10.75rem]",md:"p-2 rounded-lg max-h-[13.5rem]",lg:"p-2 rounded-lg max-h-[13.5rem]"},Wx={sm:"p-1.5 rounded text-sm leading-5 font-normal",md:"p-2 rounded-md text-base leading-6 font-normal",lg:"p-2 rounded-md text-base leading-6 font-normal"};const Ux="startTransition",$x="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect,Kx=e=>{const t=document.getElementById("typeahead-menu");if(!t)return;const n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function Hx(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top>r.top&&n.top{d(0)}),[f]);const h=(0,o.useCallback)((n=>{t.update((()=>{const t=null!=r.match&&l?function(e){const t=Gy();if(!Ly(t)||!t.isCollapsed())return null;const n=t.anchor;if("text"!==n.type)return null;const r=n.getNode();if(!r.isSimpleText())return null;const o=n.offset,i=r.getTextContent().slice(0,o),s=e.replaceableString.length,a=o-function(e,t,n){let r=n;for(let n=r;n<=t.length;n++)e.substr(-n)===t.substr(0,n)&&(r=n);return r}(i,e.matchingString,s);if(a<0)return null;let l;return 0===a?[l]=r.splitText(o):[,l]=r.splitText(a,o),l}(r.match):null;a(n,t,e,r.match?r.match.matchingString:"")}))}),[t,l,r.match,a,e]),p=(0,o.useCallback)((e=>{const n=t.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+e),d(e))}),[t]);return(0,o.useEffect)((()=>()=>{const e=t.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")}),[t]),$x((()=>{null===i?d(null):null===u&&p(0)}),[i,u,p]),(0,o.useEffect)((()=>Qb(t.registerCommand(qx,(({option:e})=>!(!e.ref||null==e.ref.current||(Kx(e.ref.current),0))),c))),[t,p,c]),(0,o.useEffect)((()=>Qb(t.registerCommand(Sp,(e=>{const n=e;if(null!==i&&i.length&&null!==u){const e=u!==i.length-1?u+1:0;p(e);const r=i[e];null!=r.ref&&r.ref.current&&t.dispatchCommand(qx,{index:e,option:r}),n.preventDefault(),n.stopImmediatePropagation()}return!0}),c),t.registerCommand(_p,(e=>{const t=e;if(null!==i&&i.length&&null!==u){const e=0!==u?u-1:i.length-1;p(e);const n=i[e];null!=n.ref&&n.ref.current&&Kx(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0}),c),t.registerCommand(Tp,(t=>{const n=t;return n.preventDefault(),n.stopImmediatePropagation(),e(),!0}),c),t.registerCommand(Rp,(e=>{const t=e;return null!==i&&null!==u&&null!=i[u]&&(t.preventDefault(),t.stopImmediatePropagation(),h(i[u]),!0)}),c),t.registerCommand(Ep,(e=>null!==i&&null!==u&&null!=i[u]&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),h(i[u]),!0)),c))),[h,e,t,i,u,p,c]),s(n,(0,o.useMemo)((()=>({options:i,selectOptionAndCleanUp:h,selectedIndex:u,setHighlightedIndex:d})),[h,u,i]),r.match?r.match.matchingString:"")}function Xx({options:e,onQueryChange:t,onSelectOption:n,onOpen:r,onClose:s,menuRenderFn:a,triggerFn:l,anchorClassName:c,commandPriority:u=Bb,parent:d}){const[f]=np(),[h,p]=(0,o.useState)(null),m=function(e,t,n,r=document.body){const[i]=np(),s=(0,o.useRef)(document.createElement("div")),a=(0,o.useCallback)((()=>{s.current.style.top=s.current.style.bottom;const t=i.getRootElement(),o=s.current,a=o.firstChild;if(null!==t&&null!==e){const{left:i,top:l,width:c,height:u}=e.getRect(),d=s.current.offsetHeight;if(o.style.top=`${l+window.pageYOffset+d+3}px`,o.style.left=`${i+window.pageXOffset}px`,o.style.height=`${u}px`,o.style.width=`${c}px`,null!==a){a.style.top=`${l}`;const e=a.getBoundingClientRect(),n=e.height,r=e.width,s=t.getBoundingClientRect();i+r>s.right&&(o.style.left=`${s.right-r+window.pageXOffset}px`),(l+n>window.innerHeight||l+n>s.bottom)&&l-s.top>n+u&&(o.style.top=l-n+window.pageYOffset-u+"px")}o.isConnected||(null!=n&&(o.className=n),o.setAttribute("aria-label","Typeahead menu"),o.setAttribute("id","typeahead-menu"),o.setAttribute("role","listbox"),o.style.display="block",o.style.position="absolute",r.append(o)),s.current=o,t.setAttribute("aria-controls","typeahead-menu")}}),[i,e,n,r]);(0,o.useEffect)((()=>{const t=i.getRootElement();if(null!==e)return a(),()=>{null!==t&&t.removeAttribute("aria-controls");const e=s.current;null!==e&&e.isConnected&&e.remove()}}),[i,a,e]);const l=(0,o.useCallback)((n=>{null!==e&&(n||t(null))}),[e,t]);return function(e,t,n,r){const[i]=np();(0,o.useEffect)((()=>{if(null!=t&&null!=e){const e=i.getRootElement(),o=null!=e?function(e){let t=getComputedStyle(e);const n="absolute"===t.position,r=/(auto|scroll)/;if("fixed"===t.position)return document.body;for(let o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.body}(e):document.body;let s=!1,a=Hx(t,o);const l=function(){s||(window.requestAnimationFrame((function(){n(),s=!1})),s=!0);const e=Hx(t,o);e!==a&&(a=e,null!=r&&r(e))},c=new ResizeObserver(n);return window.addEventListener("resize",n),document.addEventListener("scroll",l,{capture:!0,passive:!0}),c.observe(t),()=>{c.unobserve(t),window.removeEventListener("resize",n),document.removeEventListener("scroll",l,!0)}}}),[t,i,r,n,e])}(e,s.current,a,l),s}(h,p,c,d),g=(0,o.useCallback)((()=>{p(null),null!=s&&null!==h&&s()}),[s,h]),v=(0,o.useCallback)((e=>{p(e),null!=r&&null===h&&r(e)}),[r,h]);return(0,o.useEffect)((()=>{const e=f.registerUpdateListener((()=>{f.getEditorState().read((()=>{const e=f._window||window,n=e.document.createRange(),r=Gy(),o=function(e){let t=null;return e.getEditorState().read((()=>{const e=Gy();Ly(e)&&(t=function(e){const t=e.anchor;if("text"!==t.type)return null;const n=t.getNode();if(!n.isSimpleText())return null;const r=t.offset;return n.getTextContent().slice(0,r)}(e))})),t}(f);if(!Ly(r)||!r.isCollapsed()||null===o||null===n)return void g();const s=l(o,f);if(t(s?s.matchingString:null),null!==s&&!function(e,t){return 0===t&&e.getEditorState().read((()=>{const e=Gy();if(Ly(e)){const t=e.anchor.getNode().getPreviousSibling();return Ty(t)&&t.isTextEntity()}return!1}))}(f,s.leadOffset)){const t=function(e,t,n){const r=n.getSelection();if(null===r||!r.isCollapsed)return!1;const o=r.anchorNode,i=e,s=r.anchorOffset;if(null==o||null==s)return!1;try{t.setStart(o,i),t.setEnd(o,s)}catch(e){return!1}return!0}(s.leadOffset,n,e);if(null!==t)return a=()=>v({getRect:()=>n.getBoundingClientRect(),match:s}),void(Ux in i()?i()[Ux](a):a())}var a;g()}))}));return()=>{e()}}),[f,l,t,h,g,v]),null===h||null===f?null:(0,Xc.jsx)(Yx,{close:g,resolution:h,editor:f,anchorElementRef:m,options:e,menuRenderFn:a,shouldSplitNodeWithQuery:!0,onSelectOption:n,commandPriority:u})}function Gx(e){return Gx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gx(e)}function Jx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n2&&void 0!==arguments[2]?arguments[2]:"name",r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return vw(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vw(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,o.useState)([]),2),i=r[0],s=r[1];return(0,o.useEffect)((function(){if(null!==t){var r=yw.get(t);null!==r&&(void 0===r?(yw.set(t,null),bw(e,t,(function(e){yw.set(t,e),s(e)}),n)):s(r))}else s([])}),[t]),i},ww=["size","children","selected","className"];function _w(){return _w=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n_:;",p=[l].join(""),m="[^"+p+h+"\\s]",g="(?:\\.[ |$]| |["+h+"]|)",v=new RegExp("(^|\\s|\\()([".concat(p,"]((?:").concat(m).concat(g,"){0,").concat(75,"}))$")),y=new RegExp("(^|\\s|\\()([".concat(p,"]((?:").concat(m,"){0,").concat(50,"}))$")),b=kw(np(),1)[0],x=kw((0,o.useState)(null),2),w=x[0],_=x[1],S=xw(t,w,r),E=(0,o.useCallback)((function(e,t,n){b.update((function(){var o=cw(e.data,r,s);t&&t.replace(o),n()}))}),[b]),k=(0,o.useMemo)((function(){return S.map((function(e){return new gw(e)}))}),[b,S]);return React.createElement(Xx,{onQueryChange:_,onSelectOption:E,triggerFn:function(e){var t=v.exec(e);if(null===t&&(t=y.exec(e)),null!==t){var n=t[1],r=t[3];if(r.length>=0)return{leadOffset:t.index+n.length,matchingString:r,replaceableString:t[2]}}return null},options:k,menuRenderFn:function(e,t){var n=t.selectedIndex,o=t.selectOptionAndCleanUp,i=t.setHighlightedIndex;return e.current&&!(null==k||!k.length)&&React.createElement(u,{size:s},k.map((function(e,t){var a;return React.createElement(f,{key:t,ref:e.ref,size:s,selected:t===n,onMouseEnter:function(){i(t)},onClick:function(){return o(e)}},"string"==typeof e.data?e.data:null===(a=e.data)||void 0===a?void 0:a[r])})))}})},Pw={ltr:"ltr",rtl:"rtl",paragraph:"editor-paragraph",quote:"editor-quote",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5",h6:"editor-heading-h6"},list:{nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul",listitem:"editor-listItem",listitemChecked:"editor-listItemChecked",listitemUnchecked:"editor-listItemUnchecked"},hashtag:"editor-hashtag",image:"editor-image",link:"editor-link",text:{bold:"editor-textBold",code:"editor-textCode",italic:"editor-textItalic",strikethrough:"editor-textStrikethrough",subscript:"editor-textSubscript",superscript:"editor-textSuperscript",underline:"editor-textUnderline",underlineStrikethrough:"editor-textUnderlineStrikethrough"},code:"editor-code",codeHighlight:{atrule:"editor-tokenAttr",attr:"editor-tokenAttr",boolean:"editor-tokenProperty",builtin:"editor-tokenSelector",cdata:"editor-tokenComment",char:"editor-tokenSelector",class:"editor-tokenFunction","class-name":"editor-tokenFunction",comment:"editor-tokenComment",constant:"editor-tokenProperty",deleted:"editor-tokenProperty",doctype:"editor-tokenComment",entity:"editor-tokenOperator",function:"editor-tokenFunction",important:"editor-tokenVariable",inserted:"editor-tokenSelector",keyword:"editor-tokenAttr",namespace:"editor-tokenVariable",number:"editor-tokenProperty",operator:"editor-tokenOperator",prolog:"editor-tokenComment",property:"editor-tokenProperty",punctuation:"editor-tokenPunctuation",regex:"editor-tokenVariable",selector:"editor-tokenSelector",string:"editor-tokenSelector",symbol:"editor-tokenProperty",tag:"editor-tokenProperty",url:"editor-tokenOperator",variable:"editor-tokenVariable"}},Rw=function(e){var t=e.content;return React.createElement("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-start text-field-placeholder"},t)};function Ow(e){console.error(e)}var Aw=function(e,t){var n,r,i=e.defaultValue,s=void 0===i?"":i,a=e.placeholder,l=void 0===a?"Press @ to view variable suggestions":a,c=e.onChange,u=e.size,d=void 0===u?"md":u,f=e.autoFocus,h=void 0!==f&&f,p=e.options,m=void 0===p?[]:p,g=e.by,v=void 0===g?"name":g,y=e.trigger,b=void 0===y?"@":y,x=e.menuComponent,w=e.menuItemComponent,_=e.className,S=e.disabled,E=void 0!==S&&S,k={namespace:"Editor",editorTheme:Pw,onError:Ow,nodes:[uw],editorState:s||'{\n "root": {\n "children": [\n {\n "children": [],\n "direction": null,\n "format": "",\n "indent": 0,\n "type": "paragraph",\n "version": 1,\n "textFormat": 0,\n "textStyle": ""\n }\n ],\n "direction": null,\n "format": "",\n "indent": 0,\n "type": "root",\n "version": 1\n }\n}',editable:!E};return(0,o.isValidElement)(x)&&(n=x),(0,o.isValidElement)(w)&&(r=w),React.createElement("div",{className:te("relative w-full","border border-solid focus-within:ring-2 focus-within:ring-offset-2 border-field-border hover:border-border-strong focus-within:!border-focus-border focus-within:ring-focus transition duration-150 ease-in-out",Vx[d],E&&"bg-field-secondary-background border-field-border-disabled hover:border-field-border-disabled [&_p]:text-badge-color-disabled cursor-not-allowed")},React.createElement(qb,{initialConfig:k},React.createElement("div",{className:"relative w-full [&_p]:m-0"},React.createElement(mx,{contentEditable:React.createElement(xx,{className:te("editor-content focus-visible:outline-none outline-none","w-full min-h-[1.625rem] [&>p]:w-full [&>p]:m-0",_)}),placeholder:React.createElement(Rw,{content:l}),ErrorBoundary:Dx})),React.createElement(Nx,null),React.createElement(Tw,{menuComponent:n,menuItemComponent:r,size:d,by:v,optionsArray:m,trigger:b}),React.createElement(Fx,{onChange:function(e,t){"function"==typeof c&&c(e,t)},ignoreSelectionChange:!0}),t&&React.createElement(zx,{editorRef:t}),h&&React.createElement(rp,null)))},Nw=(0,o.forwardRef)(Aw);Nw.displayName="EditorInput";var Mw=Nw;const jw=ge("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var Iw=function(e,t){return te("rounded-full text-brand-primary-600 transition-colors duration-300",e[t].dot,e[t].ring)},Dw=["variant","size","type","currentStep","children","className"],Lw=["labelText","icon","stepClasses","isCurrent","isCompleted","className","type","variant","sizeClasses","size","isLast","index"];function Fw(){return Fw=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:size-4",md:"[&>svg]:size-5"})||void 0===n?void 0:n[g],b=function(){m(!p),u&&u(!p)};return i().createElement("div",{className:"p-2"},i().createElement("div",{role:"button",tabIndex:"0",onClick:b,onKeyPress:function(e){"Enter"!==e.key&&" "!==e.key||b()},className:te("text-text-primary bg-transparent cursor-pointer flex justify-between items-center p-1 gap-1",v,f),"aria-expanded":p},i().createElement("span",{className:"text-text-tertiary"},r),a&&i().createElement(Df.span,{variants:{open:{rotate:180},closed:{rotate:0}},animate:p?"open":"closed",transition:{duration:.15},className:te("flex items-center text-border-strong",y)},i().createElement($f,null))),i().createElement(Dh,{initial:!1},p&&i().createElement(Df.ul,{variants:{open:{height:"auto",opacity:1},closed:{height:0,opacity:0}},initial:"closed",animate:"open",exit:"closed",transition:{duration:.3,ease:"easeInOut"},className:"overflow-hidden flex gap-0.5 flex-col m-0 bg-white rounded-md"},d)))},Yw.Item=function(e){var t,n=e.disabled,r=void 0!==n&&n,o=e.active,s=e.onClick,a=e.children,l=e.className,c=qw().size,u=null===(t={sm:"[&>svg]:size-4 [&>svg]:m-1 [&>*:not(svg)]:mx-1 [&>*:not(svg)]:my-0.5 text-sm",md:"[&>svg]:size-5 [&>svg]:m-1.5 [&>*:not(svg)]:m-1 text-base"})||void 0===t?void 0:t[c],d=r?"text-text-disabled hover:text-text-disabled cursor-not-allowed hover:bg-transparent":"",f=o?"text-icon-primary [&>svg]:text-icon-interactive bg-background-secondary":"";return i().createElement("li",{role:"menuitem",tabIndex:"0",onClick:s,onKeyPress:function(e){"Enter"!==e.key&&" "!==e.key||s()},className:te("flex p-1 gap-1 items-center bg-transparent w-full border-none rounded text-text-secondary cursor-pointer m-0",u,"hover:bg-background-secondary hover:text-text-primary",d,f,"transition-colors duration-300 ease-in-out",l)},a)},Yw.Separator=function(e){var t,n=e.variant,r=void 0===n?"solid":n,o=e.className,s=null===(t={solid:"border-solid",dashed:"border-dashed",dotted:"border-dotted",double:"border-double",hidden:"border-hidden",none:"border-none"})||void 0===t?void 0:t[r];return i().createElement(i().Fragment,null,i().createElement("hr",{className:te("w-full border-0 border-t border-border-subtle",s,o)}))};var Xw=Yw;return r}()})); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["force-ui.[file].js"]=t():e["force-ui.[file].js"]=t()}("undefined"!=typeof self?self:this,(function(){return function(){"use strict";var e={316:function(e,t,n){function r(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}n.d(t,{A:function(){return i}});var o=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,i=r((function(e){return o.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}))},20:function(e,t,n){var r=n(609),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,r)&&!l.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:i,_owner:a.current}}t.Fragment=i,t.jsx=c,t.jsxs=c},848:function(e,t,n){e.exports=n(20)},609:function(e){e.exports=window.React}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{Alert:function(){return tp},Avatar:function(){return Xe},Badge:function(){return We},Button:function(){return ie},ButtonGroup:function(){return di},Checkbox:function(){return Ee},Container:function(){return ep},EditorInput:function(){return Iw},Input:function(){return rt},Label:function(){return at},Loader:function(){return ut},Menu:function(){return Jw},ProgressBar:function(){return dt},ProgressSteps:function(){return Uw},RadioButton:function(){return Le},Select:function(){return ch},Skeleton:function(){return Hw},Switch:function(){return he},Tabs:function(){return $f},TextArea:function(){return Ye},Title:function(){return lt},Toaster:function(){return qh},Tooltip:function(){return oi},toast:function(){return Ch}});var o=n(609),i=n.n(o);const s=e=>{const t=u(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),a(n,t)||c(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},a=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?a(e.slice(1),r):void 0;if(o)return o;if(0===t.validators.length)return;const i=e.join("-");return t.validators.find((({validator:e})=>e(i)))?.classGroupId},l=/^\[(.+)\]$/,c=e=>{if(l.test(e)){const t=l.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},u=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return p(Object.entries(e.classGroups),n).forEach((([e,n])=>{d(n,r,e,t)})),r},d=(e,t,n,r)=>{e.forEach((e=>{if("string"!=typeof e){if("function"==typeof e)return h(e)?void d(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach((([e,o])=>{d(o,f(t,e),n,r)}))}else(""===e?t:f(t,e)).classGroupId=n}))},f=(e,t)=>{let n=e;return t.split("-").forEach((e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)})),n},h=e=>e.isThemeGetter,p=(e,t)=>t?e.map((([e,n])=>[e,n.map((e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map((([e,n])=>[t+e,n]))):e))])):e,m=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(o(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):o(e,t)}}},g=e=>{const{separator:t,experimentalParseClassName:n}=e,r=1===t.length,o=t[0],i=t.length,s=e=>{const n=[];let s,a=0,l=0;for(let c=0;cl?s-l:void 0}};return n?e=>n({className:e,parseClassName:s}):s},v=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach((e=>{"["===e[0]?(t.push(...n.sort(),e),n=[]):n.push(e)})),t.push(...n.sort()),t},y=/\s+/;function b(){let e,t,n=0,r="";for(;n{if("string"==typeof e)return e;let t,n="";for(let r=0;rt(e)),e());return n=(e=>({cache:m(e.cacheSize),parseClassName:g(e),...s(e)}))(c),r=n.cache.get,o=n.cache.set,i=a,a(l)};function a(e){const t=r(e);if(t)return t;const i=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(y);let a="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{modifiers:l,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=n(t);let f=Boolean(d),h=r(f?u.substring(0,d):u);if(!h){if(!f){a=t+(a.length>0?" "+a:a);continue}if(h=r(u),!h){a=t+(a.length>0?" "+a:a);continue}f=!1}const p=v(l).join(":"),m=c?p+"!":p,g=m+h;if(i.includes(g))continue;i.push(g);const y=o(h,f);for(let e=0;e0?" "+a:a)}return a})(e,n);return o(e,i),i}return function(){return i(b.apply(null,arguments))}}const _=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},S=/^\[(?:([a-z-]+):)?(.+)\]$/i,k=/^\d+\/\d+$/,E=new Set(["px","full","screen"]),C=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,T=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,P=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,R=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,O=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,A=e=>M(e)||E.has(e)||k.test(e),N=e=>H(e,"length",q),M=e=>Boolean(e)&&!Number.isNaN(Number(e)),j=e=>H(e,"number",M),I=e=>Boolean(e)&&Number.isInteger(Number(e)),D=e=>e.endsWith("%")&&M(e.slice(0,-1)),L=e=>S.test(e),F=e=>C.test(e),z=new Set(["length","size","percentage"]),V=e=>H(e,z,Y),B=e=>H(e,"position",Y),W=new Set(["image","url"]),U=e=>H(e,W,G),$=e=>H(e,"",X),K=()=>!0,H=(e,t,n)=>{const r=S.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},q=e=>T.test(e)&&!P.test(e),Y=()=>!1,X=e=>R.test(e),G=e=>O.test(e),J=(Symbol.toStringTag,()=>{const e=_("colors"),t=_("spacing"),n=_("blur"),r=_("brightness"),o=_("borderColor"),i=_("borderRadius"),s=_("borderSpacing"),a=_("borderWidth"),l=_("contrast"),c=_("grayscale"),u=_("hueRotate"),d=_("invert"),f=_("gap"),h=_("gradientColorStops"),p=_("gradientColorStopPositions"),m=_("inset"),g=_("margin"),v=_("opacity"),y=_("padding"),b=_("saturate"),x=_("scale"),w=_("sepia"),S=_("skew"),k=_("space"),E=_("translate"),C=()=>["auto",L,t],T=()=>[L,t],P=()=>["",A,N],R=()=>["auto",M,L],O=()=>["","0",L],z=()=>[M,L];return{cacheSize:500,separator:":",theme:{colors:[K],spacing:[A,N],blur:["none","",F,L],brightness:z(),borderColor:[e],borderRadius:["none","","full",F,L],borderSpacing:T(),borderWidth:P(),contrast:z(),grayscale:O(),hueRotate:z(),invert:O(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[D,N],inset:C(),margin:C(),opacity:z(),padding:T(),saturate:z(),scale:z(),sepia:O(),skew:z(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",L]}],container:["container"],columns:[{columns:[F]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",L]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",I,L]}],basis:[{basis:C()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",L]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",I,L]}],"grid-cols":[{"grid-cols":[K]}],"col-start-end":[{col:["auto",{span:["full",I,L]},L]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[K]}],"row-start-end":[{row:["auto",{span:[I,L]},L]}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",L]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",L]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",L,t]}],"min-w":[{"min-w":[L,t,"min","max","fit"]}],"max-w":[{"max-w":[L,t,"none","full","min","max","fit","prose",{screen:[F]},F]}],h:[{h:[L,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[L,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[L,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[L,t,"auto","min","max","fit"]}],"font-size":[{text:["base",F,N]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",j]}],"font-family":[{font:[K]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",L]}],"line-clamp":[{"line-clamp":["none",M,j]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",A,L]}],"list-image":[{"list-image":["none",L]}],"list-style-type":[{list:["none","disc","decimal",L]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",A,N]}],"underline-offset":[{"underline-offset":["auto",A,L]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",L]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",L]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",B]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",V]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},U]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[A,L]}],"outline-w":[{outline:[A,N]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[A,N]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",F,$]}],"shadow-color":[{shadow:[K]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",F,L]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",L]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",L]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",L]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[I,L]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",L]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",L]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",L]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[A,N,j]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}),Z=w(J);function Q(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;tsvg]:h-4 [&>svg]:w-4",sm:"p-2 rounded-sm [&>svg]:h-4 [&>svg]:w-4",md:"p-2.5 rounded-md text-sm [&>svg]:h-5 [&>svg]:w-5",lg:"p-3 rounded-lg text-base [&>svg]:h-6 [&>svg]:w-6"})||void 0===o?void 0:o[u],N=null,M="";_&&(M="flex items-center justify-center gap-1","left"===k?s=_:N=_);var j=p;return i().createElement(j,re({ref:t,type:f,className:te(M,"border border-solid cursor-pointer transition-colors duration-300 ease-in-out text-xs font-semibold focus:ring-2 focus:ring-toggle-on focus:ring-offset-2 disabled:text-text-disabled",A,R,O,P,m),disabled:y},T),s,g,N)})),ie=oe;let se=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};var ae=["id","onChange","value","defaultValue","size","disabled","label","name","className"];function le(){return le=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ne.filter(((e,t,n)=>Boolean(e)&&n.indexOf(e)===t)).join(" ");var me={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ge=(0,o.forwardRef)((({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...l},c)=>(0,o.createElement)("svg",{ref:c,...me,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:pe("lucide",i),...l},[...a.map((([e,t])=>(0,o.createElement)(e,t))),...Array.isArray(s)?s:[s]]))),ve=(e,t)=>{const n=(0,o.forwardRef)((({className:n,...r},i)=>{return(0,o.createElement)(ge,{ref:i,iconNode:t,className:pe(`lucide-${s=e,s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var s}));return n.displayName=`${e}`,n},ye=ve("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),be=ve("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var xe=["id","label","defaultChecked","checked","onChange","value","indeterminate","disabled","size"];function we(){return we=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:h-4 [&>svg]:w-4",sm:"py-2 px-2 text-base gap-1 [&>svg]:h-4 [&>svg]:w-4",md:"py-2.5 px-2.5 text-base gap-1 [&>svg]:h-5 [&>svg]:w-5"}[l],"border-0 border-r border-border-subtle border-solid");return i().createElement(i().Fragment,null,i().createElement("button",Pe({type:"button",id:v,className:te(x,"first:rounded-tl first:rounded-bl first:border-0 first:border-r first:border-border-subtle last:rounded-tr last:rounded-br last:border-0",b&&"bg-button-disabled"),onClick:function(){p&&p(r)},disabled:y},c),i().createElement("input",{type:"hidden",value:r,name:d,checked:b,onChange:p}),n))},Le={Group:function(e){var t,n,r=e.children,s=e.name,a=e.value,l=e.defaultValue,c=e.by,u=void 0===c?"id":c,d=e.as,f=void 0===d?o.Fragment:d,h=e.onChange,p=e.className,m=e.style,g=void 0===m?"simple":m,v=e.disabled,y=void 0!==v&&v,b=(0,o.useMemo)((function(){return void 0!==a}),[a]),x=(0,o.useMemo)((function(){return s||"radio-button-group-".concat(se())}),[s]),w=(t=(0,o.useState)(b?a:l),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(t,n)||function(e,t){if(e){if("string"==typeof e)return Ae(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ae(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),_=w[0],S=w[1],k=(0,o.useCallback)((function(e){var t;t="tile"===g?e:e.target.value,b||S(t),"function"==typeof h&&h(t)}),[h]),E=te("tile"===g?"inline-flex border border-border-subtle border-solid rounded shadow-sm":"flex gap-6",p),C=function(){return i().createElement(Ne.Provider,{value:{name:x,value:b?a:_,by:u,onChange:k,isControlled:b,disableAll:y,style:g}},i().Children.map(r,(function(e){return(0,o.isValidElement)(e)?e:null})))};return i().createElement(i().Fragment,null,"tile"===g?i().createElement("div",{className:E},C()):i().createElement(f,f===o.Fragment?{}:{className:p},C()))},Button:Ie};const Fe=ve("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),ze=ve("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var Ve=function(e,t){var n=e.label,r=void 0===n?"":n,o=e.size,i=void 0===o?"sm":o,s=e.className,a=void 0===s?"":s,l=e.type,c=void 0===l?"pill":l,u=e.variant,d=void 0===u?"neutral":u,f=e.icon,h=void 0===f?React.createElement(Fe,null):f,p=e.disabled,m=void 0!==p&&p,g=e.onClose,v=void 0===g?function(){}:g,y=e.closable,b=void 0===y||y,x=e.onMouseDown,w=void 0===x?function(){}:x,_={neutral:"bg-badge-background-gray hover:bg-badge-hover-gray text-badge-color-gray border-badge-border-gray",red:"bg-badge-background-red hover:bg-badge-hover-red text-badge-color-red border-badge-border-red",yellow:"bg-badge-background-yellow hover:bg-badge-hover-yellow text-badge-color-yellow border-badge-border-yellow",green:"bg-badge-background-green hover:bg-badge-hover-green text-badge-color-green border-badge-border-green",blue:"bg-badge-background-sky hover:bg-badge-hover-sky text-badge-color-sky border-badge-border-sky",inverse:"bg-background-inverse hover:bg-badge-hover-inverse text-text-inverse border-background-inverse",disabled:"bg-badge-background-disabled hover:bg-badge-hover-disabled text-badge-color-disabled border-badge-border-disabled disabled cursor-not-allowed"},S="",k="group relative justify-center flex items-center [&>svg]:h-4 [&>svg]:w-4 cursor-pointer";return m?(S=_.disabled,k+=" cursor-not-allowed disabled"):S=_[d],r?React.createElement("span",{className:te("font-medium border-badge-border-gray flex gap-1 items-center justify-center border border-solid",{xs:"py-0.5 px-1 text-xs",sm:"py-1 px-1.5 text-xs",md:"py-1 px-1.5 text-sm",lg:"py-1 px-1.5 text-base"}[i],{pill:"rounded-full",rounded:"rounded"}[c],S,a),ref:t},h?React.createElement("span",{className:"justify-center flex items-center [&>svg]:h-4 [&>svg]:w-4"},h):null,r,b&&React.createElement("span",{className:k,onClick:m?null:v,onMouseDown:w,role:"button",tabIndex:0},React.createElement("span",{className:"sr-only"},"Remove ".concat(r)),React.createElement(ze,null),React.createElement("span",{className:"absolute -inset-1"}))):null},Be=(0,o.forwardRef)(Ve);Be.displayName="Badge";var We=Be,Ue=["id","defaultValue","value","size","className","disabled","onChange","error","onError"];function $e(){return $e=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:h-3 [&>svg]:w-3 text-xs",sm:"w-6 h-6 [&>svg]:h-4 [&>svg]:w-4 text-sm",md:"w-8 h-8 [&>svg]:h-5 [&>svg]:w-5 text-base",lg:"w-10 h-10 [&>svg]:h-6 [&>svg]:w-6 text-lg"})||void 0===n?void 0:n[l],v=null===(r={none:"",subtle:"border border-solid border-border-transparent-subtle",ring:"border-4 border-solid border-border-white"})||void 0===r?void 0:r[f&&"none"===u?"subtle":u],y=f?"bg-cover bg-center bg-no-repeat":"";return React.createElement("div",{className:te("rounded-full overflow-hidden flex items-center justify-center",!f&&m,g,v,y,p),style:f?{backgroundImage:"url(".concat(f,")")}:{}},h?"string"==typeof h?null==h||null===(o=h[0])||void 0===o?void 0:o.toUpperCase():h:null)};const Ge=ve("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);var Je=["id","type","defaultValue","value","size","className","disabled","onChange","error","onError","prefix","suffix"];function Ze(){return Ze=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0?M(t[0].name):M(null):t=e.target.value,T||"file"===i||O(t),"function"==typeof g&&g(t))},D="border border-solid border-border-subtle bg-field-secondary-background font-normal placeholder-text-tertiary text-text-primary w-full focus:outline-none",L={sm:"px-2 py-2 rounded",md:"px-2.5 py-2.5 rounded-md",lg:"px-3 py-3 rounded-lg"},F={sm:"text-xs",md:"text-base",lg:"text-base"},z={sm:_?"pl-8":"",md:_?"pl-9":"",lg:_?"pl-10":""},V={sm:k?"pr-8":"",md:k?"pr-9":"",lg:k?"pr-10":""},B=p?"hover:border-border-disabled":"hover:border-border-strong",W="focus:border-focus-border focus:ring-2 focus:ring-toggle-on focus:ring-offset-2",U=y?"focus:border-focus-error-border focus:ring-field-color-error bg-field-background-error":"",$=y?"focus:border-focus-error-border focus:ring-field-color-error":"",K=p?"border-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled":"",H=p?"border-border-disabled cursor-not-allowed text-text-disabled file:text-text-tertiary":"",q="font-normal placeholder-text-tertiary text-text-primary pointer-events-none absolute inset-y-0 flex flex-1 items-center [&>svg]:h-4 [&>svg]:w-4",Y=p?"font-normal placeholder-text-tertiary text-icon-disabled pointer-events-none absolute inset-y-0 flex flex-1 items-center":"font-normal placeholder-text-tertiary text-field-placeholder pointer-events-none absolute inset-y-0 flex flex-1 items-center",X=N?"file:border-0 file:bg-transparent":"text-text-tertiary file:border-0 file:bg-transparent";return"file"===i?React.createElement("div",{className:te("relative flex focus-within:z-10",f)},React.createElement("input",Ze({ref:t,id:C,type:"file",className:te(D,H,L[u],F[u],W,B,$,X),disabled:p,onChange:I,onInvalid:x},E)),React.createElement("div",{className:te(Y,"right-0 pr-3",{sm:"[&>svg]:h-4 [&>svg]:w-4",md:"[&>svg]:h-5 [&>svg]:w-5",lg:"[&>svg]:h-6 [&>svg]:w-6"}[u])},React.createElement(Ge,null))):React.createElement("div",{className:te("relative flex focus-within:z-10",f)},_?React.createElement("div",{className:te(q,"left-0 pl-3",F[u])},_):null,React.createElement("input",Ze({ref:t,id:C,type:i,className:te(D,K,L[u],F[u],z[u],V[u],W,B,U),disabled:p,onChange:I,onInvalid:x,value:j()},E)),k?React.createElement("div",{className:te(q,"right-0 pr-3",F[u])},k):null)},nt=(0,o.forwardRef)(tt);nt.displayName="Input";var rt=nt,ot=["children","tag","size","className","variant","required"];function it(){return it=Object.assign?Object.assign.bind():function(e){for(var t=1;t*]:text-xs [&>svg]:h-3 [&>svg]:w-3",sm:"text-sm [&>*]:text-sm [&>svg]:h-4 [&>svg]:w-4",md:"text-base [&>*]:text-base [&>svg]:h-5 [&>svg]:w-5"}[l],{neutral:"text-field-label [&>*]:text-field-label",help:"text-field-helper [&>*]:text-field-helper",error:"text-support-error [&>*]:text-support-error",disabled:"text-field-color-disabled disabled cursor-not-allowed [&>*]:text-field-color-disabled"}[f],g,u)},m),r)})),at=st,lt=function(e){var t=e.title,n=void 0===t?null:t,r=e.description,o=void 0===r?null:r,i=e.icon,s=void 0===i?null:i,a=e.iconPosition,l=void 0===a?"right":a,c=e.tag,u=void 0===c?"h2":c,d=e.size,f=void 0===d?"sm":d,h=e.className,p=void 0===h?"":h,m={xs:"gap-1 [&>svg]:size-3.5",sm:"gap-1 [&>svg]:size-4",md:"gap-1.5 [&>svg]:size-5",lg:"gap-1.5 [&>svg]:size-5"};if(!n)return null;var g=function(){var e=u;return React.createElement(e,{className:te("font-semibold p-0 m-0",{xs:"text-base [&>*]:text-base gap-1",sm:"text-lg [&>*]:text-lg gap-1",md:"text-xl [&>*]:text-xl gap-1.5",lg:"text-2xl [&>*]:text-2xl gap-1.5"}[f])},n)};return o?React.createElement("div",{className:p},React.createElement("div",null,s&&"left"===l&&React.createElement("div",{className:te("flex items-center",m[f])},s,g()),s&&"right"===l&&React.createElement("div",{className:te("flex items-center",m[f])},g(),s),!s&&g()),React.createElement("span",{className:te("text-text-secondary font-normal",{xs:"text-base",sm:"text-lg",md:"text-xl",lg:"text-2xl"}[f])},o)):React.createElement("div",{className:p},s&&"left"===l&&React.createElement("div",{className:te("flex items-center",m[f])},s,g()),s&&"right"===l&&React.createElement("div",{className:te("flex items-center",m[f])},g(),s),!s&&g())};const ct=ve("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);var ut=function(e){var t,n,r=e.variant,o=void 0===r?"primary":r,i=e.size,s=void 0===i?"md":i,a=e.icon,l=void 0===a?null:a,c=e.className,u=void 0===c?"":c,d=null===(t={primary:"text-brand-primary-600 bg-background-primary",secondary:"text-background-primary bg-brand-primary-600"})||void 0===t?void 0:t[o],f=null===(n={sm:"[&>svg]:h-4 [&>svg]:w-4",md:"[&>svg]:h-5 [&>svg]:w-5",lg:"[&>svg]:h-6 [&>svg]:w-6",xl:"[&>svg]:h-8 [&>svg]:w-8"})||void 0===n?void 0:n[s];return React.createElement("span",{className:te("flex",f,d,u)},l||React.createElement(ct,{className:"animate-spin"}))},dt=function(e){var t=e.progress,n=void 0===t?0:t,r=e.speed,o=void 0===r?200:r,i=e.className,s=void 0===i?"":i;if(!n)return null;var a=n;n<0&&(a=0),n>100&&(a=100);var l="translateX(-".concat(100-a,"%)"),c="h-2 rounded-full bg-background-brand absolute left-0 top-0 w-full bottom-0 origin-left transition-transform duration-".concat(o," ease-linear");return React.createElement("div",{className:te("h-2 rounded-full bg-misc-progress-background overflow-hidden relative",s),role:"progressbar","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},React.createElement("div",{className:c,style:{transform:l}}))};function ft(e){return mt(e)?(e.nodeName||"").toLowerCase():"#document"}function ht(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function pt(e){var t;return null==(t=(mt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function mt(e){return e instanceof Node||e instanceof ht(e).Node}function gt(e){return e instanceof Element||e instanceof ht(e).Element}function vt(e){return e instanceof HTMLElement||e instanceof ht(e).HTMLElement}function yt(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof ht(e).ShadowRoot)}function bt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Et(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function xt(e){return["table","td","th"].includes(ft(e))}function wt(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function _t(e){const t=St(),n=gt(e)?Et(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function St(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function kt(e){return["html","body","#document"].includes(ft(e))}function Et(e){return ht(e).getComputedStyle(e)}function Ct(e){return gt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Tt(e){if("html"===ft(e))return e;const t=e.assignedSlot||e.parentNode||yt(e)&&e.host||pt(e);return yt(t)?t.host:t}function Pt(e){const t=Tt(e);return kt(t)?e.ownerDocument?e.ownerDocument.body:e.body:vt(t)&&bt(t)?t:Pt(t)}function Rt(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Pt(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=ht(o);if(i){const e=Ot(s);return t.concat(s,s.visualViewport||[],bt(o)?o:[],e&&n?Rt(e):[])}return t.concat(o,Rt(o,[],n))}function Ot(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function At(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function Nt(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&yt(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Mt(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function jt(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function It(e){return!(0!==e.mozInputSource||!e.isTrusted)||(Ft()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function Dt(e){return!jt().includes("jsdom/")&&(!Ft()&&0===e.width&&0===e.height||Ft()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function Lt(){return/apple/i.test(navigator.vendor)}function Ft(){const e=/android/i;return e.test(Mt())||e.test(jt())}function zt(){return Mt().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Vt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Bt(e){return(null==e?void 0:e.ownerDocument)||document}function Wt(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function Ut(e){return"composedPath"in e?e.composedPath()[0]:e.target}const $t="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Kt(e){return vt(e)&&e.matches($t)}function Ht(e){e.preventDefault(),e.stopPropagation()}function qt(e){return!!e&&"combobox"===e.getAttribute("role")&&Kt(e)}const Yt=Math.min,Xt=Math.max,Gt=Math.round,Jt=Math.floor,Zt=e=>({x:e,y:e}),Qt={left:"right",right:"left",bottom:"top",top:"bottom"},en={start:"end",end:"start"};function tn(e,t,n){return Xt(e,Yt(t,n))}function nn(e,t){return"function"==typeof e?e(t):e}function rn(e){return e.split("-")[0]}function on(e){return e.split("-")[1]}function sn(e){return"x"===e?"y":"x"}function an(e){return"y"===e?"height":"width"}function ln(e){return["top","bottom"].includes(rn(e))?"y":"x"}function cn(e){return sn(ln(e))}function un(e){return e.replace(/start|end/g,(e=>en[e]))}function dn(e){return e.replace(/left|right|bottom|top/g,(e=>Qt[e]))}function fn(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function hn(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}var pn=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),mn="undefined"==typeof Element,gn=mn?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,vn=!mn&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},yn=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},bn=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!yn(s,!1))if("SLOT"===s.tagName){var a=s.assignedElements(),l=e(a.length?a:s.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:s,candidates:l})}else{gn.call(s,pn)&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var c=s.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(s),u=!yn(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(c&&u){var d=e(!0===c?s.children:c.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:s,candidates:d})}else i.unshift.apply(i,s.children)}}return o},xn=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},wn=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!xn(e)?0:e.tabIndex},Sn=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},kn=function(e){return"INPUT"===e.tagName},En=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Cn=function(e,t){return!(t.disabled||yn(t)||function(e){return kn(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=gn.call(e,"details>summary:first-of-type")?e.parentElement:e;if(gn.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return En(e)}else{if("function"==typeof r){for(var i=e;e;){var s=e.parentElement,a=vn(e);if(s&&!s.shadowRoot&&!0===r(s))return En(e);e=e.assignedSlot?e.assignedSlot:s||a===e.ownerDocument?s:a.host}e=i}if(function(e){var t,n,r,o,i=e&&vn(e),s=null===(t=i)||void 0===t?void 0:t.host,a=!1;if(i&&i!==e)for(a=!!(null!==(n=s)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(s)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!a&&s;){var l,c,u;a=!(null===(c=s=null===(l=i=vn(s))||void 0===l?void 0:l.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(s))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n=0)},Rn=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,s=i?t.scopeParent:t,a=function(e,t){var n=wn(e);return n<0&&t&&!xn(e)?0:n}(s,i),l=i?e(t.candidates):s;0===a?i?n.push.apply(n,l):n.push(s):r.push({documentOrder:o,tabIndex:a,item:t,isScope:i,content:l})})),r.sort(Sn).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},On=function(e,t){var n;return n=(t=t||{}).getShadowRoot?bn([e],t.includeContainer,{filter:Tn.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Pn}):function(e,t,n){if(yn(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(pn));return t&&gn.call(e,pn)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Tn.bind(null,t)),Rn(n)},An=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==gn.call(e,pn)&&Tn(t,e)},Nn=window.ReactDOM;function Mn(e,t,n){let{reference:r,floating:o}=e;const i=ln(t),s=cn(t),a=an(s),l=rn(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(on(t)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1)}return h}async function jn(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=nn(t,e),p=fn(h),m=a[f?"floating"===d?"reference":"floating":d],g=hn(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=hn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}function In(e){const t=Et(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=vt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Gt(n)!==i||Gt(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Dn(e){return gt(e)?e:e.contextElement}function Ln(e){const t=Dn(e);if(!vt(t))return Zt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=In(t);let s=(i?Gt(n.width):n.width)/r,a=(i?Gt(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Fn=Zt(0);function zn(e){const t=ht(e);return St()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Fn}function Vn(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Dn(e);let s=Zt(1);t&&(r?gt(r)&&(s=Ln(r)):s=Ln(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==ht(e))&&t}(i,n,r)?zn(i):Zt(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=ht(i),t=r&>(r)?ht(r):r;let n=e,o=Ot(n);for(;o&&r&&t!==n;){const e=Ln(o),t=o.getBoundingClientRect(),r=Et(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=ht(o),o=Ot(n)}}return hn({width:u,height:d,x:l,y:c})}function Bn(e){return Vn(pt(e)).left+Ct(e).scrollLeft}function Wn(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=ht(e),r=pt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=St();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=pt(e),n=Ct(e),r=e.ownerDocument.body,o=Xt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Xt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Bn(e);const a=-n.scrollTop;return"rtl"===Et(r).direction&&(s+=Xt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(pt(e));else if(gt(t))r=function(e,t){const n=Vn(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=vt(e)?Ln(e):Zt(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=zn(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return hn(r)}function Un(e,t){const n=Tt(e);return!(n===t||!gt(n)||kt(n))&&("fixed"===Et(n).position||Un(n,t))}function $n(e,t,n){const r=vt(t),o=pt(t),i="fixed"===n,s=Vn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Zt(0);if(r||!r&&!i)if(("body"!==ft(t)||bt(o))&&(a=Ct(t)),r){const e=Vn(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=Bn(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Kn(e){return"static"===Et(e).position}function Hn(e,t){return vt(e)&&"fixed"!==Et(e).position?t?t(e):e.offsetParent:null}function qn(e,t){const n=ht(e);if(wt(e))return n;if(!vt(e)){let t=Tt(e);for(;t&&!kt(t);){if(gt(t)&&!Kn(t))return t;t=Tt(t)}return n}let r=Hn(e,t);for(;r&&xt(r)&&Kn(r);)r=Hn(r,t);return r&&kt(r)&&Kn(r)&&!_t(r)?n:r||function(e){let t=Tt(e);for(;vt(t)&&!kt(t);){if(_t(t))return t;if(wt(t))return null;t=Tt(t)}return null}(e)||n}const Yn={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=pt(r),a=!!t&&wt(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Zt(1);const u=Zt(0),d=vt(r);if((d||!d&&!i)&&(("body"!==ft(r)||bt(s))&&(l=Ct(r)),vt(r))){const e=Vn(r);c=Ln(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:pt,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?wt(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Rt(e,[],!1).filter((e=>gt(e)&&"body"!==ft(e))),o=null;const i="fixed"===Et(e).position;let s=i?Tt(e):e;for(;gt(s)&&!kt(s);){const t=Et(s),n=_t(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||bt(s)&&!n&&Un(e,s))?r=r.filter((e=>e!==s)):o=t,s=Tt(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i[0],a=i.reduce(((e,n)=>{const r=Wn(t,n,o);return e.top=Xt(r.top,e.top),e.right=Yt(r.right,e.right),e.bottom=Yt(r.bottom,e.bottom),e.left=Xt(r.left,e.left),e}),Wn(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:qn,getElementRects:async function(e){const t=this.getOffsetParent||qn,n=this.getDimensions,r=await n(e.floating);return{reference:$n(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=In(e);return{width:t,height:n}},getScale:Ln,isElement:gt,isRTL:function(e){return"rtl"===Et(e).direction}};function Xn(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Dn(e),u=o||i?[...c?Rt(c):[],...Rt(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=pt(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h={rootMargin:-Jt(u)+"px "+-Jt(o.clientWidth-(c+d))+"px "+-Jt(o.clientHeight-(u+f))+"px "+-Jt(c)+"px",threshold:Xt(0,Yt(1,l))||1};let p=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}p=!1}try{r=new IntersectionObserver(m,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(m,h)}r.observe(e)}(!0),i}(c,n):null;let f,h=-1,p=null;s&&(p=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),n()})),c&&!l&&p.observe(c),p.observe(t));let m=l?Vn(e):null;return l&&function t(){const r=Vn(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n(),m=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(f)}}const Gn=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=rn(n),a=on(n),l="y"===ln(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=nn(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof p&&(h="end"===a?-1*p:p),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Jn=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=nn(e,t),c={x:n,y:r},u=await jn(t,l),d=ln(rn(o)),f=sn(d);let h=c[f],p=c[d];if(i){const e="y"===f?"bottom":"right";h=tn(h+u["y"===f?"top":"left"],h,h-u[e])}if(s){const e="y"===d?"bottom":"right";p=tn(p+u["y"===d?"top":"left"],p,p-u[e])}const m=a.fn({...t,[f]:h,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},Zn=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=nn(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=rn(o),y=ln(a),b=rn(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=f||(b||!m?[dn(a)]:function(e){const t=dn(e);return[un(e),t,un(t)]}(a)),_="none"!==p;!f&&_&&w.push(...function(e,t,n,r){const o=on(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}(rn(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(un)))),i}(a,m,p,x));const S=[a,...w],k=await jn(t,g),E=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(k[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=on(e),o=cn(e),i=an(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=dn(s)),[s,dn(s)]}(o,s,x);E.push(k[e[0]],k[e[1]])}if(C=[...C,{placement:o,overflows:E}],!E.every((e=>e<=0))){var T,P;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=S[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(P=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:P.placement;if(!n)switch(h){case"bestFit":{var R;const e=null==(R=C.filter((e=>{if(_){const t=ln(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:R[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},Qn=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=nn(e,t),l=await jn(t,a),c=rn(n),u=on(n),d="y"===ln(n),{width:f,height:h}=r.floating;let p,m;"top"===c||"bottom"===c?(p=c,m=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,p="end"===u?"top":"bottom");const g=h-l.top-l.bottom,v=f-l.left-l.right,y=Yt(h-l[p],g),b=Yt(f-l[m],v),x=!t.middlewareData.shift;let w=y,_=b;if(d?_=u||x?Yt(b,v):v:w=u||x?Yt(y,g):g,x&&!u){const e=Xt(l.left,0),t=Xt(l.right,0),n=Xt(l.top,0),r=Xt(l.bottom,0);d?_=f-2*(0!==e||0!==t?e+t:Xt(l.left,l.right)):w=h-2*(0!==n||0!==r?n+r:Xt(l.top,l.bottom))}await s({...t,availableWidth:_,availableHeight:w});const S=await o.getDimensions(i.floating);return f!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}},er=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=nn(e,t)||{};if(null==c)return{};const d=fn(u),f={x:n,y:r},h=cn(o),p=an(h),m=await s.getDimensions(c),g="y"===h,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[h]-f[h]-i.floating[p],w=f[h]-i.reference[h],_=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let S=_?_[b]:0;S&&await(null==s.isElement?void 0:s.isElement(_))||(S=a.floating[b]||i.floating[p]);const k=x/2-w/2,E=S/2-m[p]/2-1,C=Yt(d[v],E),T=Yt(d[y],E),P=C,R=S-m[p]-T,O=S/2-m[p]/2+k,A=tn(P,O,R),N=!l.arrow&&null!=on(o)&&O!==A&&i.reference[p]/2-(O{const r=new Map,o={platform:Yn,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Mn(c,r,l),f=r,h={},p=0;for(let n=0;n{t.current=e})),t}const ar=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?er({element:n.current,padding:r}).fn(t):{}:n?er({element:n,padding:r}).fn(t):{};var o}}),lr=(e,t)=>({...Gn(e),options:[e,t]}),cr=(e,t)=>({...Zn(e),options:[e,t]}),ur=(e,t)=>({...ar(e),options:[e,t]}),dr={...o},fr=dr.useInsertionEffect||(e=>e());function hr(e){const t=o.useRef((()=>{}));return fr((()=>{t.current=e})),o.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r=e.current.length}function xr(e,t){return _r(e,{disabledIndices:t})}function wr(e,t){return _r(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function _r(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:i=1}=void 0===t?{}:t;const s=e.current;let a=n;do{a+=r?-i:i}while(a>=0&&a<=s.length-1&&Er(s,a,o));return a}function Sr(e,t,n,r,o){if(-1===e)return-1;const i=n.indexOf(e),s=t[e];switch(o){case"tl":return i;case"tr":return s?i+s.width-1:i;case"bl":return s?i+(s.height-1)*r:i;case"br":return n.lastIndexOf(e)}}function kr(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function Er(e,t,n){if(n)return n.includes(t);const r=e[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}let Cr=0;function Tr(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Cr);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Cr=requestAnimationFrame(i)}var Pr="undefined"!=typeof document?o.useLayoutEffect:o.useEffect;function Rr(){return Rr=Object.assign?Object.assign.bind():function(e){for(var t=1;t"floating-ui-"+Math.random().toString(36).slice(2,6)+Ar++,Mr=dr.useId||function(){const[e,t]=o.useState((()=>Or?Nr():void 0));return Pr((()=>{null==e&&t(Nr())}),[]),o.useEffect((()=>{Or=!0}),[]),e},jr=o.forwardRef((function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:i,shift:s}},width:a=14,height:l=7,tipRadius:c=0,strokeWidth:u=0,staticOffset:d,stroke:f,d:h,style:{transform:p,...m}={},...g}=e,v=Mr(),[y,b]=o.useState(!1);if(Pr((()=>{r&&"rtl"===Et(r).direction&&b(!0)}),[r]),!r)return null;const[x,w]=n.split("-"),_="top"===x||"bottom"===x;let S=d;(_&&null!=s&&s.x||!_&&null!=s&&s.y)&&(S=null);const k=2*u,E=k/2,C=a/2*(c/-8+1),T=l/2*c/4,P=!!h,R=S&&"end"===w?"bottom":"top";let O=S&&"end"===w?"right":"left";S&&y&&(O="end"===w?"left":"right");const A=null!=(null==i?void 0:i.x)?S||i.x:"",N=null!=(null==i?void 0:i.y)?S||i.y:"",M=h||"M0,0 H"+a+" L"+(a-C)+","+(l-T)+" Q"+a/2+","+l+" "+C+","+(l-T)+" Z",j={top:P?"rotate(180deg)":"",left:P?"rotate(90deg)":"rotate(-90deg)",bottom:P?"":"rotate(180deg)",right:P?"rotate(-90deg)":"rotate(90deg)"}[x];return o.createElement("svg",Rr({},g,{"aria-hidden":!0,ref:t,width:P?a:a+k,height:a,viewBox:"0 0 "+a+" "+(l>a?l:a),style:{position:"absolute",pointerEvents:"none",[O]:A,[R]:N,[x]:_||P?"100%":"calc(100% - "+k/2+"px)",transform:""+j+(null!=p?p:""),...m}}),k>0&&o.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:f,strokeWidth:k+(h?0:1),d:M}),o.createElement("path",{stroke:k&&!h?g.fill:"none",d:M}),o.createElement("clipPath",{id:v},o.createElement("rect",{x:-E,y:E*(P?-1:1),width:a+k,height:a})))}));const Ir=o.createContext(null),Dr=o.createContext(null),Lr=()=>{var e;return(null==(e=o.useContext(Ir))?void 0:e.id)||null},Fr=()=>o.useContext(Dr);function zr(e){return"data-floating-ui-"+e}function Vr(e){const t=(0,o.useRef)(e);return Pr((()=>{t.current=e})),t}const Br=zr("safe-polygon");function Wr(e,t,n){return n&&!Vt(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function Ur(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let $r=new WeakMap,Kr=new WeakSet,Hr={},qr=0;const Yr=e=>e&&(e.host||Yr(e.parentNode)),Xr=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=Yr(t);return e.contains(n)?n:null})).filter((e=>null!=e));function Gr(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=Bt(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,s=Xr(t,e),a=new Set,l=new Set(s),c=[];Hr[o]||(Hr[o]=new WeakMap);const u=Hr[o];return s.forEach((function e(t){t&&!a.has(t)&&(a.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!l.has(t)&&[].forEach.call(t.children,(t=>{if("script"!==ft(t))if(a.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=($r.get(t)||0)+1,s=(u.get(t)||0)+1;$r.set(t,r),u.set(t,s),c.push(t),1===r&&n&&Kr.add(t),1===s&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),a.clear(),qr++,()=>{c.forEach((e=>{const t=($r.get(e)||0)-1,n=(u.get(e)||0)-1;$r.set(e,t),u.set(e,n),t||(!Kr.has(e)&&i&&e.removeAttribute(i),Kr.delete(e)),n||e.removeAttribute(o)})),qr--,qr||($r=new WeakMap,$r=new WeakMap,Kr=new WeakSet,Hr={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Jr=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Zr(e,t){const n=On(e,Jr());"prev"===t&&n.reverse();const r=n.indexOf(At(Bt(e)));return n.slice(r+1)[0]}function Qr(){return Zr(document.body,"next")}function eo(){return Zr(document.body,"prev")}function to(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Nt(n,r)}function no(e){On(e,Jr()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function ro(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const oo={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function io(e){"Tab"===e.key&&(e.target,clearTimeout(void 0))}const so=o.forwardRef((function(e,t){const[n,r]=o.useState();Pr((()=>(Lt()&&r("button"),document.addEventListener("keydown",io),()=>{document.removeEventListener("keydown",io)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[zr("focus-guard")]:"",style:oo};return o.createElement("span",Rr({},e,i))})),ao=o.createContext(null),lo=zr("portal");function co(e){const{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e,s=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=Mr(),i=uo(),[s,a]=o.useState(null),l=o.useRef(null);return Pr((()=>()=>{null==s||s.remove(),queueMicrotask((()=>{l.current=null}))}),[s]),Pr((()=>{if(!r)return;if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(lo,""),e.appendChild(n),l.current=n,a(n)}),[t,r]),Pr((()=>{if(!r)return;if(l.current)return;let e=n||(null==i?void 0:i.portalNode);e&&!gt(e)&&(e=e.current),e=e||document.body;let o=null;t&&(o=document.createElement("div"),o.id=t,e.appendChild(o));const s=document.createElement("div");s.id=r,s.setAttribute(lo,""),e=o||e,e.appendChild(s),l.current=s,a(s)}),[t,n,r,i]),s}({id:n,root:r}),[a,l]=o.useState(null),c=o.useRef(null),u=o.useRef(null),d=o.useRef(null),f=o.useRef(null),h=null==a?void 0:a.modal,p=null==a?void 0:a.open,m=!!a&&!a.modal&&a.open&&i&&!(!r&&!s);return o.useEffect((()=>{if(s&&i&&!h)return s.addEventListener("focusin",e,!0),s.addEventListener("focusout",e,!0),()=>{s.removeEventListener("focusin",e,!0),s.removeEventListener("focusout",e,!0)};function e(e){s&&to(e)&&("focusin"===e.type?ro:no)(s)}}),[s,i,h]),o.useEffect((()=>{s&&(p||ro(s))}),[p,s]),o.createElement(ao.Provider,{value:o.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:f,portalNode:s,setFocusManagerState:l})),[i,s])},m&&s&&o.createElement(so,{"data-type":"outside",ref:c,onFocus:e=>{if(to(e,s)){var t;null==(t=d.current)||t.focus()}else{const e=eo()||(null==a?void 0:a.refs.domReference.current);null==e||e.focus()}}}),m&&s&&o.createElement("span",{"aria-owns":s.id,style:oo}),s&&Nn.createPortal(t,s),m&&s&&o.createElement(so,{"data-type":"outside",ref:u,onFocus:e=>{if(to(e,s)){var t;null==(t=f.current)||t.focus()}else{const t=Qr()||(null==a?void 0:a.refs.domReference.current);null==t||t.focus(),(null==a?void 0:a.closeOnFocusOut)&&(null==a||a.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const uo=()=>o.useContext(ao),fo="data-floating-ui-focusable";function ho(e){return e?e.hasAttribute(fo)?e:e.querySelector("["+fo+"]")||e:null}const po=20;let mo=[];function go(e){mo=mo.filter((e=>e.isConnected));let t=e;if(t&&"body"!==ft(t)){if(!An(t,Jr())){const e=On(t,Jr())[0];e&&(t=e)}mo.push(t),mo.length>po&&(mo=mo.slice(-po))}}function vo(){return mo.slice().reverse().find((e=>e.isConnected))}const yo=o.forwardRef((function(e,t){return o.createElement("button",Rr({},e,{type:"button",ref:t,tabIndex:-1,style:oo}))}));function bo(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:s=!0,initialFocus:a=0,returnFocus:l=!0,restoreFocus:c=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0}=e,{open:h,refs:p,nodeId:m,onOpenChange:g,events:v,dataRef:y,floatingId:b,elements:{domReference:x,floating:w}}=t,_="number"==typeof a&&a<0,S=qt(x)&&_,k=!("undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype)||s,E=Vr(i),C=Vr(a),T=Vr(l),P=Fr(),R=uo(),O=o.useRef(null),A=o.useRef(null),N=o.useRef(!1),M=o.useRef(!1),j=o.useRef(-1),I=null!=R,D=ho(w),L=hr((function(e){return void 0===e&&(e=D),e?On(e,Jr()):[]})),F=hr((e=>{const t=L(e);return E.current.map((e=>x&&"reference"===e?x:D&&"floating"===e?D:t)).filter(Boolean).flat()}));function z(e){return!r&&d&&u?o.createElement(yo,{ref:"start"===e?O:A,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}o.useEffect((()=>{N.current=!1}),[r]),o.useEffect((()=>{if(r)return;if(!u)return;function e(e){if("Tab"===e.key){Nt(D,At(Bt(D)))&&0===L().length&&!S&&Ht(e);const t=F(),n=Ut(e);"reference"===E.current[0]&&n===x&&(Ht(e),e.shiftKey?Tr(t[t.length-1]):Tr(t[1])),"floating"===E.current[1]&&n===D&&e.shiftKey&&(Ht(e),Tr(t[0]))}}const t=Bt(D);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,x,D,u,E,S,L,F]),o.useEffect((()=>{if(!r&&w)return w.addEventListener("focusin",e),()=>{w.removeEventListener("focusin",e)};function e(e){const t=Ut(e),n=L().indexOf(t);-1!==n&&(j.current=n)}}),[r,w,L]),o.useEffect((()=>{if(!r&&f)return w&&vt(x)?(x.addEventListener("focusout",t),x.addEventListener("pointerdown",e),w.addEventListener("focusout",t),()=>{x.removeEventListener("focusout",t),x.removeEventListener("pointerdown",e),w.removeEventListener("focusout",t)}):void 0;function e(){M.current=!0,setTimeout((()=>{M.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(Nt(x,t)||Nt(w,t)||Nt(t,w)||Nt(null==R?void 0:R.portalNode,t)||null!=t&&t.hasAttribute(zr("focus-guard"))||P&&(Ur(P.nodesRef.current,m).find((e=>{var n,r;return Nt(null==(n=e.context)?void 0:n.elements.floating,t)||Nt(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(P.nodesRef.current,m).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));if(c&&n&&At(Bt(D))===Bt(D).body){vt(D)&&D.focus();const e=j.current,t=L(),n=t[e]||t[t.length-1]||D;vt(n)&&n.focus()}!S&&u||!t||!n||M.current||t===vo()||(N.current=!0,g(!1,e,"focus-out"))}))}}),[r,x,w,D,u,m,P,R,g,f,c,L,S]),o.useEffect((()=>{var e;if(r)return;const t=Array.from((null==R||null==(e=R.portalNode)?void 0:e.querySelectorAll("["+zr("portal")+"]"))||[]);if(w){const e=[w,...t,O.current,A.current,E.current.includes("reference")||S?x:null].filter((e=>null!=e)),n=u||S?Gr(e,k,!k):Gr(e);return()=>{n()}}}),[r,x,w,u,E,R,S,k]),Pr((()=>{if(r||!vt(D))return;const e=At(Bt(D));queueMicrotask((()=>{const t=F(D),n=C.current,r=("number"==typeof n?t[n]:n.current)||D,o=Nt(D,e);_||o||!h||Tr(r,{preventScroll:r===D})}))}),[r,h,D,_,F,C]),Pr((()=>{if(r||!D)return;let e=!1;const t=Bt(D),n=At(t);let o=y.current.openEvent;const i=p.domReference.current;function s(t){let{open:n,reason:r,event:i,nested:s}=t;n&&(o=i),"escape-key"===r&&p.domReference.current&&go(p.domReference.current),"hover"===r&&"mouseleave"===i.type&&(N.current=!0),"outside-press"===r&&(s?(N.current=!1,e=!0):N.current=!(It(i)||Dt(i)))}return go(n),v.on("openchange",s),()=>{v.off("openchange",s);const r=At(t),a=Nt(w,r)||P&&Ur(P.nodesRef.current,m).some((e=>{var t;return Nt(null==(t=e.context)?void 0:t.elements.floating,r)}));(a||o&&["click","mousedown"].includes(o.type))&&p.domReference.current&&go(p.domReference.current);const l=i||n,c=On(Bt(l).body,Jr());queueMicrotask((()=>{let n=vo();!n&&vt(l)&&w&&(n=function(e,t,n){const r=e.indexOf(t);function o(t){const o=zr("focus-guard");let i=r+(t?1:0),s=e[i];for(;s&&(!s.isConnected||s.hasAttribute(o)||Nt(n,s));)t?i++:i--,s=e[i];return s}return o(!0)||o(!1)}(c,l,w)),T.current&&!N.current&&vt(n)&&(n===r||r===t.body||a)&&n.focus({preventScroll:e})}))}}),[r,w,D,T,y,p,v,P,m]),Pr((()=>{if(!r&&R)return R.setFocusManagerState({modal:u,closeOnFocusOut:f,open:h,onOpenChange:g,refs:p}),()=>{R.setFocusManagerState(null)}}),[r,R,u,h,g,p,f]),Pr((()=>{if(r)return;if(!D)return;if("function"!=typeof MutationObserver)return;if(_)return;const e=()=>{const e=D.getAttribute("tabindex"),t=L(),n=At(Bt(w)),r=t.indexOf(n);-1!==r&&(j.current=r),E.current.includes("floating")||n!==p.domReference.current&&0===t.length?"0"!==e&&D.setAttribute("tabindex","0"):"-1"!==e&&D.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(D,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[r,w,D,p,E,L,_]);const V=!r&&k&&(!u||!S)&&(I||u);return o.createElement(o.Fragment,null,V&&o.createElement(so,{"data-type":"inside",ref:null==R?void 0:R.beforeInsideRef,onFocus:e=>{if(u){const e=F();Tr("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=R&&R.preserveTabOrder&&R.portalNode)if(N.current=!1,to(e,R.portalNode)){const e=Qr()||x;null==e||e.focus()}else{var t;null==(t=R.beforeOutsideRef.current)||t.focus()}}}),!S&&z("start"),n,z("end"),V&&o.createElement(so,{"data-type":"inside",ref:null==R?void 0:R.afterInsideRef,onFocus:e=>{if(u)Tr(F()[0]);else if(null!=R&&R.preserveTabOrder&&R.portalNode)if(f&&(N.current=!0),to(e,R.portalNode)){const e=eo()||x;null==e||e.focus()}else{var t;null==(t=R.afterOutsideRef.current)||t.focus()}}}))}function xo(e){return vt(e.target)&&"BUTTON"===e.target.tagName}function wo(e){return Kt(e)}function _o(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:s}}=e,{enabled:a=!0,event:l="click",toggle:c=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0}=t,f=o.useRef(),h=o.useRef(!1),p=o.useMemo((()=>({onPointerDown(e){f.current=e.pointerType},onMouseDown(e){const t=f.current;0===e.button&&"click"!==l&&(Vt(t,!0)&&u||(!n||!c||i.current.openEvent&&"mousedown"!==i.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=f.current;"mousedown"===l&&f.current?f.current=void 0:Vt(t,!0)&&u||(!n||!c||i.current.openEvent&&"click"!==i.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){f.current=void 0,e.defaultPrevented||!d||xo(e)||(" "!==e.key||wo(s)||(e.preventDefault(),h.current=!0),"Enter"===e.key&&r(!n||!c,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!d||xo(e)||wo(s)||" "===e.key&&h.current&&(h.current=!1,r(!n||!c,e.nativeEvent,"click"))}})),[i,s,l,u,d,r,n,c]);return o.useMemo((()=>a?{reference:p}:{}),[a,p])}const So={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ko={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Eo=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Co(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:s}=e,{enabled:a=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:p,capture:m}=t,g=Fr(),v=hr("function"==typeof c?c:()=>!1),y="function"==typeof c?v:c,b=o.useRef(!1),x=o.useRef(!1),{escapeKey:w,outsidePress:_}=Eo(p),{escapeKey:S,outsidePress:k}=Eo(m),E=hr((e=>{var t;if(!n||!a||!l||"Escape"!==e.key)return;const o=null==(t=s.current.floatingContext)?void 0:t.nodeId,i=g?Ur(g.nodesRef.current,o):[];if(!w&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),C=hr((e=>{var t;const n=()=>{var t;E(e),null==(t=Ut(e))||t.removeEventListener("keydown",n)};null==(t=Ut(e))||t.addEventListener("keydown",n)})),T=hr((e=>{var t;const n=b.current;b.current=!1;const o=x.current;if(x.current=!1,"click"===u&&o)return;if(n)return;if("function"==typeof y&&!y(e))return;const a=Ut(e),l="["+zr("inert")+"]",c=Bt(i.floating).querySelectorAll(l);let d=gt(a)?a:null;for(;d&&!kt(d);){const e=Tt(d);if(kt(e)||!gt(e))break;d=e}if(c.length&>(a)&&!a.matches("html,body")&&!Nt(a,i.floating)&&Array.from(c).every((e=>!Nt(d,e))))return;if(vt(a)&&O){const t=a.clientWidth>0&&a.scrollWidth>a.clientWidth,n=a.clientHeight>0&&a.scrollHeight>a.clientHeight;let r=n&&e.offsetX>a.clientWidth;if(n&&"rtl"===Et(a).direction&&(r=e.offsetX<=a.offsetWidth-a.clientWidth),r||t&&e.offsetY>a.clientHeight)return}const f=null==(t=s.current.floatingContext)?void 0:t.nodeId,h=g&&Ur(g.nodesRef.current,f).some((t=>{var n;return Wt(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Wt(e,i.floating)||Wt(e,i.domReference)||h)return;const p=g?Ur(g.nodesRef.current,f):[];if(p.length>0){let e=!0;if(p.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}r(!1,e,"outside-press")})),P=hr((e=>{var t;const n=()=>{var t;T(e),null==(t=Ut(e))||t.removeEventListener(u,n)};null==(t=Ut(e))||t.addEventListener(u,n)}));o.useEffect((()=>{if(!n||!a)return;function e(e){r(!1,e,"ancestor-scroll")}s.current.__escapeKeyBubbles=w,s.current.__outsidePressBubbles=_;const t=Bt(i.floating);l&&t.addEventListener("keydown",S?C:E,S),y&&t.addEventListener(u,k?P:T,k);let o=[];return h&&(gt(i.domReference)&&(o=Rt(i.domReference)),gt(i.floating)&&(o=o.concat(Rt(i.floating))),!gt(i.reference)&&i.reference&&i.reference.contextElement&&(o=o.concat(Rt(i.reference.contextElement)))),o=o.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),o.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{l&&t.removeEventListener("keydown",S?C:E,S),y&&t.removeEventListener(u,k?P:T,k),o.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[s,i,l,y,u,n,r,h,a,w,_,E,S,C,T,k,P]),o.useEffect((()=>{b.current=!1}),[y,u]);const R=o.useMemo((()=>({onKeyDown:E,[So[f]]:e=>{d&&r(!1,e.nativeEvent,"reference-press")}})),[E,r,d,f]),O=o.useMemo((()=>({onKeyDown:E,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[ko[u]]:()=>{b.current=!0}})),[E,u]);return o.useMemo((()=>a?{reference:R,floating:O}:{}),[a,R,O])}function To(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=Mr(),s=o.useRef({}),[a]=o.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),l=null!=Lr(),[c,u]=o.useState(r.reference),d=hr(((e,t,r)=>{s.current.openEvent=e?t:void 0,a.emit("openchange",{open:e,event:t,reason:r,nested:l}),null==n||n(e,t,r)})),f=o.useMemo((()=>({setPositionReference:u})),[]),h=o.useMemo((()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference})),[c,r.reference,r.floating]);return o.useMemo((()=>({dataRef:s,open:t,onOpenChange:d,elements:h,events:a,floatingId:i,refs:f})),[t,d,h,a,i,f])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[s,a]=o.useState(null),[l,c]=o.useState(null),u=(null==i?void 0:i.reference)||s,d=o.useRef(null),f=Fr();Pr((()=>{u&&(d.current=u)}),[u]);const h=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=o.useState(r);rr(h,r)||p(r);const[m,g]=o.useState(null),[v,y]=o.useState(null),b=o.useCallback((e=>{e!==S.current&&(S.current=e,g(e))}),[]),x=o.useCallback((e=>{e!==k.current&&(k.current=e,y(e))}),[]),w=s||m,_=a||v,S=o.useRef(null),k=o.useRef(null),E=o.useRef(d),C=null!=c,T=sr(c),P=sr(i),R=o.useCallback((()=>{if(!S.current||!k.current)return;const e={placement:t,strategy:n,middleware:h};P.current&&(e.platform=P.current),tr(S.current,k.current,e).then((e=>{const t={...e,isPositioned:!0};O.current&&!rr(E.current,t)&&(E.current=t,Nn.flushSync((()=>{f(t)})))}))}),[h,t,n,P]);nr((()=>{!1===u&&E.current.isPositioned&&(E.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[u]);const O=o.useRef(!1);nr((()=>(O.current=!0,()=>{O.current=!1})),[]),nr((()=>{if(w&&(S.current=w),_&&(k.current=_),w&&_){if(T.current)return T.current(w,_,R);R()}}),[w,_,R,T,C]);const A=o.useMemo((()=>({reference:S,floating:k,setReference:b,setFloating:x})),[b,x]),N=o.useMemo((()=>({reference:w,floating:_})),[w,_]),M=o.useMemo((()=>{const e={position:n,left:0,top:0};if(!N.floating)return e;const t=ir(N.floating,d.x),r=ir(N.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...or(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,l,N.floating,d.x,d.y]);return o.useMemo((()=>({...d,update:R,refs:A,elements:N,floatingStyles:M})),[d,R,A,N,M])}({...e,elements:{...i,...l&&{reference:l}}}),p=o.useCallback((e=>{const t=gt(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c(t),h.refs.setReference(t)}),[h.refs]),m=o.useCallback((e=>{(gt(e)||null===e)&&(d.current=e,a(e)),(gt(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!gt(e))&&h.refs.setReference(e)}),[h.refs]),g=o.useMemo((()=>({...h.refs,setReference:m,setPositionReference:p,domReference:d})),[h.refs,m,p]),v=o.useMemo((()=>({...h.elements,domReference:u})),[h.elements,u]),y=o.useMemo((()=>({...h,...r,refs:g,elements:v,nodeId:t})),[h,g,v,t,r]);return Pr((()=>{r.dataRef.current.floatingContext=y;const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===t));e&&(e.context=y)})),o.useMemo((()=>({...h,context:y,refs:g,elements:v})),[h,g,v,y])}const Po="active",Ro="selected";function Oo(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[Po]:t,[Ro]:__,...n}=e;i=n}return{..."floating"===n&&{tabIndex:-1,[fo]:""},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var s;o&&[Po,Ro].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(s=r.get(n))||s.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;ie(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}function Ao(e){void 0===e&&(e=[]);const t=e.map((e=>null==e?void 0:e.reference)),n=e.map((e=>null==e?void 0:e.floating)),r=e.map((e=>null==e?void 0:e.item)),i=o.useCallback((t=>Oo(t,e,"reference")),t),s=o.useCallback((t=>Oo(t,e,"floating")),n),a=o.useCallback((t=>Oo(t,e,"item")),r);return o.useMemo((()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:a})),[i,s,a])}let No=!1;function Mo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function jo(e,t){return Mo(t,e===pr||e===mr,e===gr||e===vr)}function Io(e,t,n){return Mo(t,e===mr,n?e===gr:e===vr)||"Enter"===e||" "===e||""===e}function Do(e,t,n){return Mo(t,n?e===vr:e===gr,e===pr)}function Lo(e,t){const{open:n,onOpenChange:r,elements:i}=e,{listRef:s,activeIndex:a,onNavigate:l=()=>{},enabled:c=!0,selectedIndex:u=null,allowEscape:d=!1,loop:f=!1,nested:h=!1,rtl:p=!1,virtual:m=!1,focusItemOnOpen:g="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:y=!0,disabledIndices:b,orientation:x="vertical",cols:w=1,scrollItemIntoView:_=!0,virtualItemRef:S,itemSizes:k,dense:E=!1}=t,C=Vr(ho(i.floating)),T=Lr(),P=Fr(),R=hr(l),O=o.useRef(g),A=o.useRef(null!=u?u:-1),N=o.useRef(null),M=o.useRef(!0),j=o.useRef(R),I=o.useRef(!!i.floating),D=o.useRef(n),L=o.useRef(!1),F=o.useRef(!1),z=Vr(b),V=Vr(n),B=Vr(_),W=Vr(u),[U,$]=o.useState(),[K,H]=o.useState(),q=hr((function(e,t,n){function r(e){m?($(e.id),null==P||P.events.emit("virtualfocus",e),S&&(S.current=e)):Tr(e,{preventScroll:!0,sync:!(!zt()||!Lt())&&(No||L.current)})}void 0===n&&(n=!1);const o=e.current[t.current];o&&r(o),requestAnimationFrame((()=>{const i=e.current[t.current]||o;if(!i)return;o||r(i);const s=B.current;s&&X&&(n||!M.current)&&(null==i.scrollIntoView||i.scrollIntoView("boolean"==typeof s?{block:"nearest",inline:"nearest"}:s))}))}));Pr((()=>{document.createElement("div").focus({get preventScroll(){return No=!0,!1}})}),[]),Pr((()=>{c&&(n&&i.floating?O.current&&null!=u&&(F.current=!0,A.current=u,R(u)):I.current&&(A.current=-1,j.current(null)))}),[c,n,i.floating,u,R]),Pr((()=>{if(c&&n&&i.floating)if(null==a){if(L.current=!1,null!=W.current)return;if(I.current&&(A.current=-1,q(s,A)),(!D.current||!I.current)&&O.current&&(null!=N.current||!0===O.current&&null==N.current)){let e=0;const t=()=>{null==s.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(A.current=null==N.current||Io(N.current,x,p)||h?xr(s,z.current):wr(s,z.current),N.current=null,R(A.current))};t()}}else br(s,a)||(A.current=a,q(s,A,F.current),F.current=!1)}),[c,n,i.floating,a,W,h,s,x,p,R,q,z]),Pr((()=>{var e;if(!c||i.floating||!P||m||!I.current)return;const t=P.nodesRef.current,n=null==(e=t.find((e=>e.id===T)))||null==(e=e.context)?void 0:e.elements.floating,r=At(Bt(i.floating)),o=t.some((e=>e.context&&Nt(e.context.elements.floating,r)));n&&!o&&M.current&&n.focus({preventScroll:!0})}),[c,i.floating,P,T,m]),Pr((()=>{if(c&&P&&m&&!T)return P.events.on("virtualfocus",e),()=>{P.events.off("virtualfocus",e)};function e(e){H(e.id),S&&(S.current=e)}}),[c,P,m,T,S]),Pr((()=>{j.current=R,I.current=!!i.floating})),Pr((()=>{n||(N.current=null)}),[n]),Pr((()=>{D.current=n}),[n]);const Y=null!=a,X=o.useMemo((()=>{function e(e){if(!n)return;const t=s.current.indexOf(e);-1!==t&&R(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...v&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;M.current&&"touch"!==t&&(A.current=-1,q(s,A),R(null),m||Tr(C.current,{preventScroll:!0}))}}}}),[n,C,q,v,s,R,m]),G=hr((e=>{if(M.current=!1,L.current=!0,!V.current&&e.currentTarget===C.current)return;if(h&&Do(e.key,x,p))return Ht(e),r(!1,e.nativeEvent,"list-navigation"),void(vt(i.domReference)&&!m&&i.domReference.focus());const t=A.current,o=xr(s,b),a=wr(s,b);if("Home"===e.key&&(Ht(e),A.current=o,R(A.current)),"End"===e.key&&(Ht(e),A.current=a,R(A.current)),w>1){const t=k||Array.from({length:s.current.length},(()=>({width:1,height:1}))),n=function(e,t,n){const r=[];let o=0;return e.forEach(((e,i)=>{let{width:s,height:a}=e,l=!1;for(n&&(o=0);!l;){const e=[];for(let n=0;nnull==r[e]))?(e.forEach((e=>{r[e]=i})),l=!0):o++}})),[...r]}(t,w,E),r=n.findIndex((e=>null!=e&&!Er(s.current,e,b))),i=n.reduce(((e,t,n)=>null==t||Er(s.current,t,b)?e:n),-1),l=n[function(e,t){let{event:n,orientation:r,loop:o,cols:i,disabledIndices:s,minIndex:a,maxIndex:l,prevIndex:c,stopEvent:u=!1}=t,d=c;if(n.key===pr){if(u&&Ht(n),-1===c)d=l;else if(d=_r(e,{startingIndex:d,amount:i,decrement:!0,disabledIndices:s}),o&&(c-ie?n:n-i}br(e,d)&&(d=c)}if(n.key===mr&&(u&&Ht(n),-1===c?d=a:(d=_r(e,{startingIndex:c,amount:i,disabledIndices:s}),o&&c+i>l&&(d=_r(e,{startingIndex:c%i-i,amount:i,disabledIndices:s}))),br(e,d)&&(d=c)),"both"===r){const t=Jt(c/i);n.key===vr&&(u&&Ht(n),c%i!=i-1?(d=_r(e,{startingIndex:c,disabledIndices:s}),o&&yr(d,i,t)&&(d=_r(e,{startingIndex:c-c%i-1,disabledIndices:s}))):o&&(d=_r(e,{startingIndex:c-c%i-1,disabledIndices:s})),yr(d,i,t)&&(d=c)),n.key===gr&&(u&&Ht(n),c%i!=0?(d=_r(e,{startingIndex:c,decrement:!0,disabledIndices:s}),o&&yr(d,i,t)&&(d=_r(e,{startingIndex:c+(i-c%i),decrement:!0,disabledIndices:s}))):o&&(d=_r(e,{startingIndex:c+(i-c%i),decrement:!0,disabledIndices:s})),yr(d,i,t)&&(d=c));const r=Jt(l/i)===t;br(e,d)&&(d=o&&r?n.key===gr?l:_r(e,{startingIndex:c-c%i-1,disabledIndices:s}):c)}return d}({current:n.map((e=>null!=e?s.current[e]:null))},{event:e,orientation:x,loop:f,cols:w,disabledIndices:kr([...b||s.current.map(((e,t)=>Er(s.current,t)?t:void 0)),void 0],n),minIndex:r,maxIndex:i,prevIndex:Sr(A.current>a?o:A.current,t,n,w,e.key===mr?"bl":e.key===vr?"tr":"tl"),stopEvent:!0})];if(null!=l&&(A.current=l,R(A.current)),"both"===x)return}if(jo(e.key,x)){if(Ht(e),n&&!m&&At(e.currentTarget.ownerDocument)===e.currentTarget)return A.current=Io(e.key,x,p)?o:a,void R(A.current);Io(e.key,x,p)?A.current=f?t>=a?d&&t!==s.current.length?-1:o:_r(s,{startingIndex:t,disabledIndices:b}):Math.min(a,_r(s,{startingIndex:t,disabledIndices:b})):A.current=f?t<=o?d&&-1!==t?s.current.length:a:_r(s,{startingIndex:t,decrement:!0,disabledIndices:b}):Math.max(o,_r(s,{startingIndex:t,decrement:!0,disabledIndices:b})),br(s,A.current)?R(null):R(A.current)}})),J=o.useMemo((()=>m&&n&&Y&&{"aria-activedescendant":K||U}),[m,n,Y,K,U]),Z=o.useMemo((()=>({"aria-orientation":"both"===x?void 0:x,...!qt(i.domReference)&&J,onKeyDown:G,onPointerMove(){M.current=!0}})),[J,G,i.domReference,x]),Q=o.useMemo((()=>{function e(e){"auto"===g&&It(e.nativeEvent)&&(O.current=!0)}return{...J,onKeyDown(e){M.current=!1;const t=0===e.key.indexOf("Arrow"),o=function(e,t,n){return Mo(t,n?e===gr:e===vr,e===mr)}(e.key,x,p),i=Do(e.key,x,p),a=jo(e.key,x),l=(h?o:a)||"Enter"===e.key||""===e.key.trim();if(m&&n){const n=null==P?void 0:P.nodesRef.current.find((e=>null==e.parentId)),r=P&&n?function(e,t){let n,r=-1;return function t(o,i){i>r&&(n=o,r=i),Ur(e,o).forEach((e=>{t(e.id,i+1)}))}(t,0),e.find((e=>e.id===n))}(P.nodesRef.current,n.id):null;if(t&&r&&S){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(o||i){var c,d;const n=(null==(c=r.context)?void 0:c.elements.domReference)===e.currentTarget,a=i&&!n?null==(d=r.context)?void 0:d.elements.domReference:o?s.current.find((e=>(null==e?void 0:e.id)===U)):null;a&&(Ht(e),a.dispatchEvent(t),H(void 0))}var f;if(a&&r.context&&r.context.open&&r.parentId&&e.currentTarget!==r.context.elements.domReference)return Ht(e),void(null==(f=r.context.elements.domReference)||f.dispatchEvent(t))}return G(e)}(n||y||!t)&&(l&&(N.current=h&&a?null:e.key),h?o&&(Ht(e),n?(A.current=xr(s,z.current),R(A.current)):r(!0,e.nativeEvent,"list-navigation")):a&&(null!=u&&(A.current=u),Ht(e),!n&&y?r(!0,e.nativeEvent,"list-navigation"):G(e),n&&R(A.current)))},onFocus(){n&&!m&&R(null)},onPointerDown:function(e){O.current=g,"auto"===g&&Dt(e.nativeEvent)&&(O.current=!0)},onMouseDown:e,onClick:e}}),[U,J,G,z,g,s,h,R,r,n,y,x,p,u,P,m,S]);return o.useMemo((()=>c?{reference:Q,floating:Z,item:X}:{}),[c,Q,Z,X])}const Fo=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function zo(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:i}=e,{enabled:s=!0,role:a="dialog"}=t,l=null!=(n=Fo.get(a))?n:a,c=Mr(),u=null!=Lr(),d=o.useMemo((()=>"tooltip"===l||"label"===a?{["aria-"+("label"===a?"labelledby":"describedby")]:r?i:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===l?"dialog":l,"aria-controls":r?i:void 0,..."listbox"===l&&{role:"combobox"},..."menu"===l&&{id:c},..."menu"===l&&u&&{role:"menuitem"},..."select"===a&&{"aria-autocomplete":"none"},..."combobox"===a&&{"aria-autocomplete":"list"}}),[l,i,u,r,c,a]),f=o.useMemo((()=>{const e={id:i,...l&&{role:l}};return"tooltip"===l||"label"===a?e:{...e,..."menu"===l&&{"aria-labelledby":c}}}),[l,i,c,a]),h=o.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(a){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,a]);return o.useMemo((()=>s?{reference:d,floating:f,item:h}:{}),[s,d,f,h])}const Vo=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function Bo(e,t){return"function"==typeof e?e(t):e}function Wo(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let e=0,s=i-1;e=r!=c>=r&&n<=(l-i)*(r-a)/(c-a)+i&&(o=!o)}return o}function Uo(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,i=!1,s=null,a=null,l=performance.now();const c=e=>{let{x:n,y:c,placement:u,elements:d,onClose:f,nodeId:h,tree:p}=e;return function(e){function m(){clearTimeout(o),f()}if(clearTimeout(o),!d.domReference||!d.floating||null==u||null==n||null==c)return;const{clientX:g,clientY:v}=e,y=[g,v],b=Ut(e),x="mouseleave"===e.type,w=Nt(d.floating,b),_=Nt(d.domReference,b),S=d.domReference.getBoundingClientRect(),k=d.floating.getBoundingClientRect(),E=u.split("-")[0],C=n>k.right-k.width/2,T=c>k.bottom-k.height/2,P=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,S),R=k.width>S.width,O=k.height>S.height,A=(R?S:k).left,N=(R?S:k).right,M=(O?S:k).top,j=(O?S:k).bottom;if(w&&(i=!0,!x))return;if(_&&(i=!1),_&&!x)return void(i=!0);if(x&>(e.relatedTarget)&&Nt(d.floating,e.relatedTarget))return;if(p&&Ur(p.nodesRef.current,h).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===E&&c>=S.bottom-1||"bottom"===E&&c<=S.top+1||"left"===E&&n>=S.right-1||"right"===E&&n<=S.left+1)return m();let I=[];switch(E){case"top":I=[[A,S.top+1],[A,k.bottom-1],[N,k.bottom-1],[N,S.top+1]];break;case"bottom":I=[[A,k.top+1],[A,S.bottom-1],[N,S.bottom-1],[N,k.top+1]];break;case"left":I=[[k.right-1,j],[k.right-1,M],[S.left+1,M],[S.left+1,j]];break;case"right":I=[[S.right-1,j],[S.right-1,M],[k.left+1,M],[k.left+1,j]]}if(!Wo([g,v],I)){if(i&&!P)return m();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===s||null===a||0===r)return s=e,a=t,l=n,null;const o=e-s,i=t-a,c=Math.sqrt(o*o+i*i);return s=e,a=t,l=n,c/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return m()}Wo([g,v],function(e){let[n,r]=e;switch(E){case"top":return[[R?n+t/2:C?n+4*t:n-4*t,r+t+1],[R?n-t/2:C?n+4*t:n-4*t,r+t+1],[k.left,C||R?k.bottom-t:k.top],[k.right,C?R?k.bottom-t:k.top:k.bottom-t]];case"bottom":return[[R?n+t/2:C?n+4*t:n-4*t,r-t],[R?n-t/2:C?n+4*t:n-4*t,r-t],[k.left,C||R?k.top+t:k.bottom],[k.right,C?R?k.top+t:k.bottom:k.top+t]];case"left":{const e=[n+t+1,O?r+t/2:T?r+4*t:r-4*t],o=[n+t+1,O?r-t/2:T?r+4*t:r-4*t];return[[T||O?k.right-t:k.left,k.top],[T?O?k.right-t:k.left:k.right-t,k.bottom],e,o]}case"right":return[[n-t,O?r+t/2:T?r+4*t:r-4*t],[n-t,O?r-t/2:T?r+4*t:r-4*t],[T||O?k.left+t:k.right,k.top],[T?O?k.left+t:k.right:k.left+t,k.bottom]]}}([n,c]))?!i&&r&&(o=window.setTimeout(m,40)):m()}}};return c.__options={blockPointerEvents:n},c}const $o=ve("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Ko=ve("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var Ho="light",qo=function(e){var t=e.icon,n=void 0===t?null:t,r=e.theme,i=void 0===r?Ho:r,s=e.variant,a=void 0===s?"neutral":s,l="[&>svg]:h-5 [&>svg]:w-5",c="light"===i?"text-icon-secondary":"text-icon-inverse";if(n&&(0,o.isValidElement)(n))return{updatedIcon:(0,o.cloneElement)(n,{className:te(l,c,n.props.className)})};switch(a){case"neutral":return React.createElement(Fe,{className:te(l,c)});case"info":var u="light"===i?"text-support-info":"text-support-info-inverse";return React.createElement(Fe,{className:te(l,u)});case"success":var d="light"===i?"text-support-success":"text-support-success-inverse";return React.createElement(be,{className:te(l,d)});case"warning":var f="light"===i?"text-support-warning":"text-support-warning-inverse";return React.createElement($o,{className:te(l,f)});case"error":var h="light"===i?"text-support-error":"text-support-error-inverse";return React.createElement(Ko,{className:te(l,h)});default:return null}},Yo=function(e){var t=e.actionType,n=void 0===t?"button":t,r=e.onAction,o=void 0===r?function(){}:r,i=e.actionLabel,s=void 0===i?"":i,a=e.theme,l=void 0===a?Ho:a,c="focus:ring-0 focus:ring-offset-0 ring-offset-0 focus:outline-none",u="text-button-primary border-button-primary hover:border-button-primary hover:text-button-primary-hover";switch("dark"===l&&(u="text-text-inverse border-text-inverse hover:border-text-inverse hover:text-text-inverse"),n){case"button":return React.createElement(ie,{variant:"outline",size:"xs",onClick:o,className:te("rounded",c,u,"dark"===l?"bg-transparent hover:bg-transparent":"bg-white hover:bg-white")},s);case"link":return React.createElement(ie,{variant:"link",size:"xs",onClick:o,className:te(c,u)},s);default:return null}},Xo=function(e){var t=e.theme,n=void 0===t?Ho:t,r=e.title,o=void 0===r?"":r;return!o&&isNaN(o)?null:React.createElement("span",{className:te("block",{light:"text-text-primary",dark:"text-text-inverse"}[n],"text-sm leading-5 font-semibold")},o)},Go=function(e){var t=e.theme,n=void 0===t?Ho:t,r=e.content,o=void 0===r?"":r;return!o&&isNaN(o)?null:React.createElement("span",{className:te({light:"text-text-primary",dark:"text-text-inverse"}[n],"block text-sm [&_*]:text-sm leading-5 [&_*]:leading-5 font-normal")},o)},Jo=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n{})),C=o.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);o.useEffect((()=>{if(l)return s.on("openchange",e),()=>{s.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(_.current),S.current=!0)}}),[l,s]),o.useEffect((()=>{if(!l)return;if(!g.current)return;if(!n)return;function e(e){C()&&r(!1,e,"hover")}const t=Bt(a.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[a.floating,n,r,l,g,C]);const T=o.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Wr(v.current,"close",b.current);o&&!w.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>r(!1,e,n)),o)):t&&(clearTimeout(x.current),r(!1,e,n))}),[v,r]),P=hr((()=>{E.current(),w.current=void 0})),R=hr((()=>{if(k.current){const e=Bt(a.floating).body;e.style.pointerEvents="",e.removeAttribute(Br),k.current=!1}}));o.useEffect((()=>{if(l&>(a.domReference)){var e;const t=a.domReference;return n&&t.addEventListener("mouseleave",c),null==(e=a.floating)||e.addEventListener("mouseleave",c),h&&t.addEventListener("mousemove",o,{once:!0}),t.addEventListener("mouseenter",o),t.addEventListener("mouseleave",s),()=>{var e;n&&t.removeEventListener("mouseleave",c),null==(e=a.floating)||e.removeEventListener("mouseleave",c),h&&t.removeEventListener("mousemove",o),t.removeEventListener("mouseenter",o),t.removeEventListener("mouseleave",s)}}function t(){return!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)}function o(e){if(clearTimeout(x.current),S.current=!1,d&&!Vt(b.current)||f>0&&!Wr(v.current,"open"))return;const t=Wr(v.current,"open",b.current);t?x.current=window.setTimeout((()=>{y.current||r(!0,e,"hover")}),t):r(!0,e,"hover")}function s(e){if(t())return;E.current();const r=Bt(a.floating);if(clearTimeout(_.current),g.current&&i.current.floatingContext){n||clearTimeout(x.current),w.current=g.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){R(),P(),T(e,!0,"safe-polygon")}});const t=w.current;return r.addEventListener("mousemove",t),void(E.current=()=>{r.removeEventListener("mousemove",t)})}("touch"!==b.current||!Nt(a.floating,e.relatedTarget))&&T(e)}function c(e){t()||i.current.floatingContext&&(null==g.current||g.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){R(),P(),T(e)}})(e))}}),[a,l,e,d,f,h,T,P,R,r,n,y,p,v,g,i]),Pr((()=>{var e;if(l&&n&&null!=(e=g.current)&&e.__options.blockPointerEvents&&C()){k.current=!0;const e=a.floating;if(gt(a.domReference)&&e){var t;const n=Bt(a.floating).body;n.setAttribute(Br,"");const r=a.domReference,o=null==p||null==(t=p.nodesRef.current.find((e=>e.id===m)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[l,n,m,a,p,g,C]),Pr((()=>{n||(b.current=void 0,P(),R())}),[n,P,R]),o.useEffect((()=>()=>{P(),clearTimeout(x.current),clearTimeout(_.current),R()}),[l,a.domReference,P,R]);const O=o.useMemo((()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){S.current||y.current||r(!0,t,"hover")}d&&!Vt(b.current)||n||0===f||(clearTimeout(_.current),"touch"===b.current?o():_.current=window.setTimeout(o,f))}}}),[d,r,n,y,f]),A=o.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){T(e.nativeEvent,!1)}})),[T]);return o.useMemo((()=>l?{reference:O,floating:A}:{}),[l,O,A])}(W,ti({move:!1,enabled:!j&&A.includes("hover")},M&&{handleClose:Uo()})),K=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:i,dataRef:s,elements:a}=e,{enabled:l=!0,visibleOnly:c=!0}=t,u=o.useRef(!1),d=o.useRef(),f=o.useRef(!0);o.useEffect((()=>{if(!l)return;const e=ht(a.domReference);function t(){!n&&vt(a.domReference)&&a.domReference===At(Bt(a.domReference))&&(u.current=!0)}function r(){f.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[a.domReference,n,l]),o.useEffect((()=>{if(l)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(u.current=!0)}}),[i,l]),o.useEffect((()=>()=>{clearTimeout(d.current)}),[]);const h=o.useMemo((()=>({onPointerDown(e){Dt(e.nativeEvent)||(f.current=!1)},onMouseLeave(){u.current=!1},onFocus(e){if(u.current)return;const t=Ut(e.nativeEvent);if(c&>(t))try{if(Lt()&&zt())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!f.current&&!Kt(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){u.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=gt(t)&&t.hasAttribute(zr("focus-guard"))&&"outside"===t.getAttribute("data-type");d.current=window.setTimeout((()=>{var e;const i=At(a.domReference?a.domReference.ownerDocument:document);(t||i!==a.domReference)&&(Nt(null==(e=s.current.floatingContext)?void 0:e.refs.floating.current,i)||Nt(a.domReference,i)||o||r(!1,n,"focus"))}))}})),[s,a.domReference,r,c]);return o.useMemo((()=>l?{reference:h}:{}),[l,h])}(W,{enabled:!j&&A.includes("focus")}),H=Ao([U,$,K,Co(W),zo(W,{role:"tooltip"})]),q=H.getReferenceProps,Y=H.getFloatingProps,X=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:i,common:s,duration:a=250}=t,l=e.placement,c=l.split("-")[0],u=o.useMemo((()=>({side:c,placement:l})),[c,l]),d="number"==typeof a,f=(d?a:a.open)||0,h=(d?a:a.close)||0,[p,m]=o.useState((()=>({...Bo(s,u),...Bo(n,u)}))),{isMounted:g,status:v}=function(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:i=250}=t,s=("number"==typeof i?i:i.close)||0,[a,l]=o.useState("unmounted"),c=function(e,t){const[n,r]=o.useState(e);return e&&!n&&r(!0),o.useEffect((()=>{if(!e&&n){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,n,t]),n}(n,s);return c||"close"!==a||l("unmounted"),Pr((()=>{if(r){if(n){l("initial");const e=requestAnimationFrame((()=>{l("open")}));return()=>{cancelAnimationFrame(e)}}l("close")}}),[n,r]),{isMounted:c,status:a}}(e,{duration:a}),y=Vr(n),b=Vr(r),x=Vr(i),w=Vr(s);return Pr((()=>{const e=Bo(y.current,u),t=Bo(x.current,u),n=Bo(w.current,u),r=Bo(b.current,u)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===v&&m((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===v&&m({transitionProperty:Object.keys(r).map(Vo).join(","),transitionDuration:f+"ms",...n,...r}),"close"===v){const r=t||e;m({transitionProperty:Object.keys(r).map(Vo).join(","),transitionDuration:h+"ms",...n,...r})}}),[h,x,y,b,w,f,v,u]),{isMounted:g,styles:p}}(W,{duration:150,initial:{opacity:0},open:{opacity:1},close:{opacity:0}}),G=X.isMounted,J=X.styles,Z=null===(t={light:"bg-tooltip-background-light text-text-primary",dark:"bg-tooltip-background-dark text-text-on-color"})||void 0===t?void 0:t[l],Q="dark"===l?"text-tooltip-background-dark":"text-tooltip-background-light";return i().createElement(i().Fragment,null,(0,o.isValidElement)(y)&&(0,o.cloneElement)(y,ti(ti({},y.props),{},{ref:Jo(y.ref,V.setReference),className:te(y.props.className)},q())),i().createElement(co,{id:S,root:w},G&&i().createElement("div",Qo({className:te("absolute z-20 py-2 px-3 rounded-md text-xs leading-4 shadow-soft-shadow-lg",Z,"max-w-80 w-fit",b),ref:V.setFloating,style:ti(ti({},B),J)},Y()),i().createElement("div",null,!!f&&i().createElement("span",{className:"font-semibold"},f),!!h&&i().createElement("div",{className:"font-normal"},h)),m&&i().createElement(jr,{ref:F,context:W,placement:u,className:te("fill-current",Q)}))))},ii=["slug","text","icon","className","disabled","isFirstChild","isLastChild"];function si(){return si=Object.assign?Object.assign.bind():function(e){for(var t=1;tsvg]:h-4 [&>svg]:w-4",sm:"py-2 px-2 text-base gap-1 [&>svg]:h-4 [&>svg]:w-4",md:"py-2.5 px-2.5 text-base gap-1 [&>svg]:h-5 [&>svg]:w-5"}[g],"border-0 border-r border-border-subtle border-solid",p===r?"bg-button-disabled":"",d?"rounded-tl rounded-bl border-0 border-r border-border-subtle":"",f?"rounded-tr rounded-br border-0":"",l);return i().createElement("button",si({ref:t,className:y,disabled:u,onClick:function(e){m(e,{slug:r,text:s})}},h),"left"===v&&a&&i().createElement("span",{className:"mr-1"},a),s,"right"===v&&a&&i().createElement("span",{className:"ml-1"},a))},ci=(0,o.forwardRef)(li);ci.displayName="Button";var ui={Group:function(e){var t=e.children,n=e.activeItem,r=void 0===n?null:n,s=e.onChange,a=e.className,l=e.size,c=void 0===l?"md":l,u=e.iconPosition,d=void 0===u?"left":u,f=(0,o.useCallback)((function(e,t){s&&s({event:e,value:t})}),[s]),h=te("box-border flex border border-border-subtle border-solid rounded",a);return i().createElement("div",{className:h},i().createElement(ai.Provider,{value:{activeItem:r,onChange:f,size:c,iconPosition:d}},i().Children.map(t,(function(e,n){if(!(0,o.isValidElement)(e))return null;var r=0===n,s=n===i().Children.count(t)-1;return i().cloneElement(e,{index:n,isFirstChild:r,isLastChild:s})}))))},Button:ci},di=ui;function fi(e){if("undefined"==typeof Proxy)return e;const t=new Map;return new Proxy(e,{get:(n,r)=>(t.has(r)||t.set(r,e(r)),t.get(r))})}function hi(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const pi=e=>Array.isArray(e);function mi(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function yi(e,t,n,r){if("function"==typeof t){const[o,i]=vi(r);t=t(void 0!==n?n:e.custom,o,i)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,i]=vi(r);t=t(void 0!==n?n:e.custom,o,i)}return t}function bi(e,t,n){const r=e.getProps();return yi(r,t,void 0!==n?n:r.custom,e)}const xi=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],wi=["initial",...xi],_i=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Si=new Set(_i),ki=e=>1e3*e,Ei=e=>e/1e3,Ci={type:"spring",stiffness:500,damping:25,restSpeed:10},Ti={type:"keyframes",duration:.8},Pi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ri=(e,{keyframes:t})=>t.length>2?Ti:Si.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Ci:Pi;function Oi(e,t){return e[t]||e.default||e}const Ai=e=>null!==e;function Ni(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(Ai),i=t&&"loop"!==n&&t%2==1?0:o.length-1;return i&&void 0!==r?r:o[i]}const Mi=e=>e,ji=["read","resolveKeyframes","update","preRender","render","postRender"];function Ii(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=ji.reduce(((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,o=!1;const i=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function a(t){i.has(t)&&(l.schedule(t),e()),t(s)}const l={schedule:(e,o=!1,s=!1)=>{const a=s&&r?t:n;return o&&i.add(e),a.has(e)||a.add(e),e},cancel:e=>{n.delete(e),i.delete(e)},process:e=>{s=e,r?o=!0:(r=!0,[t,n]=[n,t],n.clear(),t.forEach(a),r=!1,o&&(o=!1,l.process(e)))}};return l}(i),e)),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:f}=s,h=()=>{const i=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1),o.timestamp=i,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(h))};return{schedule:ji.reduce(((t,i)=>{const a=s[i];return t[i]=(t,i=!1,s=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(h)),a.schedule(t,i,s)),t}),{}),cancel:e=>{for(let t=0;t/^0[^.\s]+$/u.test(e);let Bi=Mi,Wi=Mi;const Ui=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),$i=e=>t=>"string"==typeof t&&t.startsWith(e),Ki=$i("--"),Hi=$i("var(--"),qi=e=>!!Hi(e)&&Yi.test(e.split("/*")[0].trim()),Yi=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Xi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Gi(e,t,n=1){Wi(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=function(e){const t=Xi.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${null!=n?n:r}`,o]}(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const e=i.trim();return Ui(e)?parseFloat(e):e}return qi(o)?Gi(o,t,n+1):o}const Ji=(e,t,n)=>n>t?t:n"number"==typeof e,parse:parseFloat,transform:e=>e},Qi={...Zi,transform:e=>Ji(0,1,e)},es={...Zi,default:1},ts=e=>Math.round(1e5*e)/1e5,ns=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,rs=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,os=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function is(e){return"string"==typeof e}const ss=e=>({test:t=>is(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),as=ss("deg"),ls=ss("%"),cs=ss("px"),us=ss("vh"),ds=ss("vw"),fs={...ls,parse:e=>ls.parse(e)/100,transform:e=>ls.transform(100*e)},hs=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),ps=e=>e===Zi||e===cs,ms=(e,t)=>parseFloat(e.split(", ")[t]),gs=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return ms(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?ms(t[1],e):0}},vs=new Set(["x","y","z"]),ys=_i.filter((e=>!vs.has(e))),bs={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-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:gs(4,13),y:gs(5,14)};bs.translateX=bs.x,bs.translateY=bs.y;const xs=e=>t=>t.test(e),ws=[Zi,cs,ls,as,ds,us,{test:e=>"auto"===e,parse:e=>e}],_s=e=>ws.find(xs(e)),Ss=new Set;let ks=!1,Es=!1;function Cs(){if(Es){const e=Array.from(Ss).filter((e=>e.needsMeasurement)),t=new Set(e.map((e=>e.element))),n=new Map;t.forEach((e=>{const t=function(e){const t=[];return ys.forEach((n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),t}(e);t.length&&(n.set(e,t),e.render())})),e.forEach((e=>e.measureInitialState())),t.forEach((e=>{e.render();const t=n.get(e);t&&t.forEach((([t,n])=>{var r;null===(r=e.getValue(t))||void 0===r||r.set(n)}))})),e.forEach((e=>e.measureEndState())),e.forEach((e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)}))}Es=!1,ks=!1,Ss.forEach((e=>e.complete())),Ss.clear()}function Ts(){Ss.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&(Es=!0)}))}class Ps{constructor(e,t,n,r,o,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=o,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ss.add(this),ks||(ks=!0,Di.read(Ts),Di.resolveKeyframes(Cs))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let o=0;on=>Boolean(is(n)&&os.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),Os=(e,t,n)=>r=>{if(!is(r))return r;const[o,i,s,a]=r.match(ns);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},As={...Zi,transform:e=>Math.round((e=>Ji(0,255,e))(e))},Ns={test:Rs("rgb","red"),parse:Os("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+As.transform(e)+", "+As.transform(t)+", "+As.transform(n)+", "+ts(Qi.transform(r))+")"},Ms={test:Rs("#"),parse:function(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:Ns.transform},js={test:Rs("hsl","hue"),parse:Os("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+ls.transform(ts(t))+", "+ls.transform(ts(n))+", "+ts(Qi.transform(r))+")"},Is={test:e=>Ns.test(e)||Ms.test(e)||js.test(e),parse:e=>Ns.test(e)?Ns.parse(e):js.test(e)?js.parse(e):Ms.parse(e),transform:e=>is(e)?e:e.hasOwnProperty("red")?Ns.transform(e):js.transform(e)},Ds="number",Ls="color",Fs="var",zs="var(",Vs="${}",Bs=/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;function Ws(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const s=t.replace(Bs,(e=>(Is.test(e)?(r.color.push(i),o.push(Ls),n.push(Is.parse(e))):e.startsWith(zs)?(r.var.push(i),o.push(Fs),n.push(e)):(r.number.push(i),o.push(Ds),n.push(parseFloat(e))),++i,Vs))).split(Vs);return{values:n,split:s,indexes:r,types:o}}function Us(e){return Ws(e).values}function $s(e){const{split:t,types:n}=Ws(e),r=t.length;return e=>{let o="";for(let i=0;i"number"==typeof e?0:e,Hs={test:function(e){var t,n;return isNaN(e)&&is(e)&&((null===(t=e.match(ns))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(rs))||void 0===n?void 0:n.length)||0)>0},parse:Us,createTransformer:$s,getAnimatableNone:function(e){const t=Us(e);return $s(e)(t.map(Ks))}},qs=new Set(["brightness","contrast","saturate","opacity"]);function Ys(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(ns)||[];if(!r)return e;const o=n.replace(r,"");let i=qs.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const Xs=/\b([a-z-]*)\(.*?\)/gu,Gs={...Hs,getAnimatableNone:e=>{const t=e.match(Xs);return t?t.map(Ys).join(" "):e}},Js={...Zi,transform:Math.round},Zs={borderWidth:cs,borderTopWidth:cs,borderRightWidth:cs,borderBottomWidth:cs,borderLeftWidth:cs,borderRadius:cs,radius:cs,borderTopLeftRadius:cs,borderTopRightRadius:cs,borderBottomRightRadius:cs,borderBottomLeftRadius:cs,width:cs,maxWidth:cs,height:cs,maxHeight:cs,size:cs,top:cs,right:cs,bottom:cs,left:cs,padding:cs,paddingTop:cs,paddingRight:cs,paddingBottom:cs,paddingLeft:cs,margin:cs,marginTop:cs,marginRight:cs,marginBottom:cs,marginLeft:cs,rotate:as,rotateX:as,rotateY:as,rotateZ:as,scale:es,scaleX:es,scaleY:es,scaleZ:es,skew:as,skewX:as,skewY:as,distance:cs,translateX:cs,translateY:cs,translateZ:cs,x:cs,y:cs,z:cs,perspective:cs,transformPerspective:cs,opacity:Qi,originX:fs,originY:fs,originZ:cs,zIndex:Js,backgroundPositionX:cs,backgroundPositionY:cs,fillOpacity:Qi,strokeOpacity:Qi,numOctaves:Js},Qs={...Zs,color:Is,backgroundColor:Is,outlineColor:Is,fill:Is,stroke:Is,borderColor:Is,borderTopColor:Is,borderRightColor:Is,borderBottomColor:Is,borderLeftColor:Is,filter:Gs,WebkitFilter:Gs},ea=e=>Qs[e];function ta(e,t){let n=ea(e);return n!==Gs&&(n=Hs),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const na=new Set(["auto","none","0"]);class ra extends Ps{constructor(e,t,n,r,o){super(e,t,n,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}function oa(e){let t;return()=>(void 0===t&&(t=e()),t)}let ia;function sa(){ia=void 0}const aa={now:()=>(void 0===ia&&aa.set(Fi.isProcessing?Fi.timestamp:performance.now()),ia),set:e=>{ia=e,queueMicrotask(sa)}},la=(e,t)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!Hs.test(e)&&"0"!==e||e.startsWith("url(")));class ca{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=aa.now(),this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:o,repeatType:i,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(Ts(),Cs()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=aa.now(),this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:o,delay:i,onComplete:s,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const i=e[e.length-1],s=la(o,t),a=la(i,t);return Bi(s===a,`You are trying to animate ${t} from "${o}" to "${i}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${i} via the \`style\` property.`),!(!s||!a)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n{this.resolveFinishedPromise=e}))}}function ua(e,t){return t?e*(1e3/t):0}const da=5;function fa(e,t,n){const r=Math.max(t-da,0);return ua(n-e(r),t-r)}const ha=.001,pa=.01,ma=10,ga=.05,va=1;const ya=12;function ba(e,t){return e*Math.sqrt(1-t*t)}const xa=["duration","bounce"],wa=["stiffness","damping","mass"];function _a(e,t){return t.some((t=>void 0!==e[t]))}function Sa({keyframes:e,restDelta:t,restSpeed:n,...r}){const o=e[0],i=e[e.length-1],s={done:!1,value:o},{stiffness:a,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:f}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!_a(e,wa)&&_a(e,xa)){const n=function({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i;Bi(e<=ki(ma),"Spring duration must be 10 seconds or less");let s=1-t;s=Ji(ga,va,s),e=Ji(pa,ma,Ei(e)),s<1?(o=t=>{const r=t*s,o=r*e,i=r-n,a=ba(t,s),l=Math.exp(-o);return ha-i/a*l},i=t=>{const r=t*s*e,i=r*n+n,a=Math.pow(s,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=ba(Math.pow(t,2),s);return(-o(t)+ha>0?-1:1)*((i-a)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-ha,i=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let n=1;n{const n=Math.exp(-p*g*t);return i-n*((h+p*g*m)/e*Math.sin(e*t)+m*Math.cos(e*t))}}else if(1===p)y=e=>i-Math.exp(-g*e)*(m+(h+g*m)*e);else{const e=g*Math.sqrt(p*p-1);y=t=>{const n=Math.exp(-p*g*t),r=Math.min(e*t,300);return i-n*((h+p*g*m)*Math.sinh(r)+e*m*Math.cosh(r))/e}}return{calculatedDuration:f&&u||null,next:e=>{const r=y(e);if(f)s.done=e>=u;else{let o=0;p<1&&(o=0===e?ki(h):fa(y,e,r));const a=Math.abs(o)<=n,l=Math.abs(i-r)<=t;s.done=a&&l}return s.value=s.done?i:r,s}}}function ka({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},h=e=>void 0===a?l:void 0===l||Math.abs(a-e)-p*Math.exp(-e/r),y=e=>g+v(e),b=e=>{const t=v(e),n=y(e);f.done=Math.abs(t)<=c,f.value=f.done?g:n};let x,w;const _=e=>{(e=>void 0!==a&&el)(f.value)&&(x=e,w=Sa({keyframes:[f.value,h(f.value)],velocity:fa(y,e,f.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return _(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==x||(t=!0,b(e),_(e)),void 0!==x&&e>=x?w.next(e-x):(!t&&b(e),f)}}}const Ea=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Ca(e,t,n,r){if(e===t&&n===r)return Mi;return o=>0===o||1===o?o:Ea(function(e,t,n,r,o){let i,s,a=0;do{s=t+(n-t)/2,i=Ea(s,r,o)-e,i>0?n=s:t=s}while(Math.abs(i)>1e-7&&++a<12);return s}(o,0,1,e,n),t,r)}const Ta=Ca(.42,0,1,1),Pa=Ca(0,0,.58,1),Ra=Ca(.42,0,.58,1),Oa=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Aa=e=>t=>1-e(1-t),Na=e=>1-Math.sin(Math.acos(e)),Ma=Aa(Na),ja=Oa(Na),Ia=Ca(.33,1.53,.69,.99),Da=Aa(Ia),La=Oa(Da),Fa={linear:Mi,easeIn:Ta,easeInOut:Ra,easeOut:Pa,circIn:Na,circInOut:ja,circOut:Ma,backIn:Da,backInOut:La,backOut:Ia,anticipate:e=>(e*=2)<1?.5*Da(e):.5*(2-Math.pow(2,-10*(e-1)))},za=e=>{if(Array.isArray(e)){Wi(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return Ca(t,n,r,o)}return"string"==typeof e?(Wi(void 0!==Fa[e],`Invalid easing type '${e}'`),Fa[e]):e},Va=(e,t)=>n=>t(e(n)),Ba=(...e)=>e.reduce(Va),Wa=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},Ua=(e,t,n)=>e+(t-e)*n;function $a(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ka(e,t){return n=>n>0?t:e}const Ha=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},qa=[Ms,Ns,js];function Ya(e){const t=(e=>qa.find((t=>t.test(e))))(e);if(Bi(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let n=t.parse(e);return t===js&&(n=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,i=0,s=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;o=$a(a,r,e+1/3),i=$a(a,r,e),s=$a(a,r,e-1/3)}else o=i=s=n;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*s),alpha:r}}(n)),n}const Xa=(e,t)=>{const n=Ya(e),r=Ya(t);if(!n||!r)return Ka(e,t);const o={...n};return e=>(o.red=Ha(n.red,r.red,e),o.green=Ha(n.green,r.green,e),o.blue=Ha(n.blue,r.blue,e),o.alpha=Ua(n.alpha,r.alpha,e),Ns.transform(o))},Ga=new Set(["none","hidden"]);function Ja(e,t){return n=>Ua(e,t,n)}function Za(e){return"number"==typeof e?Ja:"string"==typeof e?qi(e)?Ka:Is.test(e)?Xa:tl:Array.isArray(e)?Qa:"object"==typeof e?Is.test(e)?Xa:el:Ka}function Qa(e,t){const n=[...e],r=n.length,o=e.map(((e,n)=>Za(e)(e,t[n])));return e=>{for(let t=0;t{for(const t in r)n[t]=r[t](e);return n}}const tl=(e,t)=>{const n=Hs.createTransformer(t),r=Ws(e),o=Ws(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Ga.has(e)&&!o.values.length||Ga.has(t)&&!r.values.length?function(e,t){return Ga.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Ba(Qa(function(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let i=0;iArray.isArray(e)&&"number"!=typeof e[0])(r)?r.map(za):za(r),i={done:!1,value:t[0]},s=function(e,t){return e.map((e=>e*t))}(n&&n.length===t.length?n:function(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Wa(0,t,r);e.push(Ua(n,1,o))}}(t,e.length-1),t}(t),e),a=function(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(Wi(i===t.length,"Both input and output ranges must be the same length"),1===i)return()=>t[0];if(2===i&&e[0]===e[1])return()=>t[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const r=[],o=n||nl,i=e.length-1;for(let n=0;n{let n=0;if(a>1)for(;nl(Ji(e[0],e[i-1],t)):l}(s,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map((()=>c||Ra)).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(i.value=a(t),i.done=t>=e,i)}}const ol=e=>{const t=({timestamp:t})=>e(t);return{start:()=>Di.update(t,!0),stop:()=>Li(t),now:()=>Fi.isProcessing?Fi.timestamp:aa.now()}},il={decay:ka,inertia:ka,tween:rl,keyframes:rl,spring:Sa},sl=e=>e/100;class al extends ca{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:t,motionValue:n,element:r,keyframes:o}=this.options,i=(null==r?void 0:r.KeyframeResolver)||Ps;this.resolver=new i(o,((e,t)=>this.onKeyframesResolved(e,t)),t,n,r),this.resolver.scheduleResolve()}initPlayback(e){const{type:t="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:i=0}=this.options,s=il[t]||rl;let a,l;s!==rl&&"number"!=typeof e[0]&&(a=Ba(sl,nl(e[0],e[1])),e=[0,100]);const c=s({...this.options,keyframes:e});"mirror"===o&&(l=s({...this.options,keyframes:[...e].reverse(),velocity:-i})),null===c.calculatedDuration&&(c.calculatedDuration=function(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}(c));const{calculatedDuration:u}=c,d=u+r;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(n+1)-r}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:n}=this;if(!n){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:r,generator:o,mirroredGenerator:i,mapPercentToKeyframes:s,keyframes:a,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=n;if(null===this.startTime)return o.next(0);const{delay:d,repeat:f,repeatType:h,repeatDelay:p,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let y=this.currentTime,b=o;if(f){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,f+1),Boolean(t%2)&&("reverse"===h?(n=1-n,p&&(n-=p/u)):"mirror"===h&&(b=i)),y=Ji(0,1,n)*u}const x=v?{done:!1,value:a[0]}:b.next(y);s&&(x.value=s(x.value));let{done:w}=x;v||null===l||(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const _=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return _&&void 0!==r&&(x.value=Ni(a,this.options,r)),m&&m(x.value),_&&this.finish(),x}get duration(){const{resolved:e}=this;return e?Ei(e.calculatedDuration):0}get time(){return Ei(this.currentTime)}set time(e){e=ki(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Ei(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=ol,onPlay:t,startTime:n}=this.options;this.driver||(this.driver=e((e=>this.tick(e)))),t&&t();const r=this.driver.now();null!==this.holdTime?this.startTime=r-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=r):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const ll=new Set(["opacity","clipPath","filter","transform"]),cl=e=>Array.isArray(e)&&"number"==typeof e[0];function ul(e){return Boolean(!e||"string"==typeof e&&e in fl||cl(e)||Array.isArray(e)&&e.every(ul))}const dl=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,fl={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:dl([0,.65,.55,1]),circOut:dl([.55,0,1,.45]),backIn:dl([.31,.01,.66,-.59]),backOut:dl([.33,1.53,.69,.99])};function hl(e){return pl(e)||fl.easeOut}function pl(e){return e?cl(e)?dl(e):Array.isArray(e)?e.map(hl):fl[e]:void 0}const ml=oa((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));class gl extends ca{constructor(e){super(e);const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new ra(o,((e,t)=>this.onKeyframesResolved(e,t)),t,n,r),this.resolver.scheduleResolve()}initPlayback(e,t){var n;let{duration:r=300,times:o,ease:i,type:s,motionValue:a,name:l,startTime:c}=this.options;if(!(null===(n=a.owner)||void 0===n?void 0:n.current))return!1;if("spring"===(u=this.options).type||!ul(u.ease)){const{onComplete:t,onUpdate:n,motionValue:a,element:l,...c}=this.options,u=function(e,t){const n=new al({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let i=0;for(;!r.done&&i<2e4;)r=n.sample(i),o.push(r.value),i+=10;return{times:void 0,keyframes:o,duration:i-10,ease:"linear"}}(e,c);1===(e=u.keyframes).length&&(e[1]=e[0]),r=u.duration,o=u.times,i=u.ease,s="keyframes"}var u;const d=function(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=pl(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:"reverse"===s?"alternate":"normal"})}(a.owner.current,l,e,{...this.options,duration:r,times:o,ease:i});return d.startTime=null!=c?c:this.calcStartTime(),this.pendingTimeline?(d.timeline=this.pendingTimeline,this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:n}=this.options;a.set(Ni(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:o,type:s,ease:i,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return Ei(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return Ei(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=ki(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return Mi;const{animation:n}=t;n.timeline=e,n.onfinish=null}else this.pendingTimeline=e;return Mi}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:n,duration:r,type:o,ease:i,times:s}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:a,element:l,...c}=this.options,u=new al({...c,keyframes:n,duration:r,type:o,ease:i,times:s,isGenerator:!0}),d=ki(this.time);e.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;return ml()&&n&&ll.has(n)&&t&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate&&!r&&"mirror"!==o&&0!==i&&"inertia"!==s}}const vl=oa((()=>void 0!==window.ScrollTimeline));class yl{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,t){return Promise.all(this.animations).then(e).catch(t)}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n{if(!vl()||!t.attachTimeline)return t.pause(),function(e,n){let r;const o=()=>{const{currentTime:e}=n,o=(null===e?0:e.value)/100;r!==o&&(e=>{t.time=t.duration*e})(o),r=o};return Di.update(o,!0),()=>Li(o)}(0,e);t.attachTimeline(e)}));return()=>{t.forEach(((e,t)=>{e&&e(),this.animations[t].stop()}))}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;tt[e]()))}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const bl=(e,t,n,r={},o,i,s)=>a=>{const l=Oi(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u-=ki(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:e=>{t.set(e),l.onUpdate&&l.onUpdate(e)},onComplete:()=>{a(),l.onComplete&&l.onComplete(),s&&s()},onStop:s,name:e,motionValue:t,element:i?void 0:o};(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(l)||(d={...d,...Ri(e,d)}),d.duration&&(d.duration=ki(d.duration)),d.repeatDelay&&(d.repeatDelay=ki(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let f=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(d.duration=0,0===d.delay&&(f=!0)),f&&!i&&void 0!==t.get()){const e=Ni(d.keyframes,l);if(void 0!==e)return Di.update((()=>{d.onUpdate(e),d.onComplete()})),new yl([])}return!i&&gl.supports(d)?new gl(d):new al(d)},xl=e=>Boolean(e&&"object"==typeof e&&e.mix&&e.toValue),wl=e=>pi(e)?e[e.length-1]||0:e;function _l(e,t){-1===e.indexOf(t)&&e.push(t)}function Sl(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class kl{constructor(){this.subscriptions=[]}add(e){return _l(this.subscriptions,e),()=>Sl(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o{const n=aa.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=aa.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new kl);const n=this.events[e].add(t);return"change"===e?()=>{n(),Di.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return El.current&&El.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=aa.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return ua(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise((t=>{this.hasAnimated=!0,this.animation=e(t),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.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Tl(e,t){return new Cl(e,t)}function Pl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Tl(n))}const Rl=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ol="data-"+Rl("framerAppearId");function Al(e){return e.props[Ol]}function Nl(e){return Si.has(e)?"transform":ll.has(e)?Rl(e):void 0}class Ml extends Cl{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){const t=Nl(e);if(!t)return;const n=this.counts.get(t)||0;this.counts.set(t,n+1),0===n&&(this.output.push(t),this.update());let r=!1;return()=>{if(r)return;r=!0;const e=this.counts.get(t)-1;this.counts.set(t,e),0===e&&(Sl(this.output,t),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}const jl=e=>Boolean(e&&e.getVelocity);function Il(e,t){var n;if(!e.applyWillChange)return;let r=e.getValue("willChange");return r||(null===(n=e.props.style)||void 0===n?void 0:n.willChange)||(r=new Ml("auto"),e.addValue("willChange",r)),o=r,Boolean(jl(o)&&o.add)?r.add(t):void 0;var o}function Dl({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function Ll(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var i;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(s=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const t in l){const r=e.getValue(t,null!==(i=e.latestValues[t])&&void 0!==i?i:null),o=l[t];if(void 0===o||u&&Dl(u,t))continue;const a={delay:n,...Oi(s||{},t)};let d=!1;if(window.MotionHandoffAnimation){const n=Al(e);if(n){const e=window.MotionHandoffAnimation(n,t,Di);null!==e&&(a.startTime=e,d=!0)}}r.start(bl(t,r,o,e.shouldReduceMotion&&Si.has(t)?{type:!1}:a,e,d,Il(e,t)));const f=r.animation;f&&c.push(f)}return a&&Promise.all(c).then((()=>{Di.update((()=>{a&&function(e,t){const n=bi(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const t in i)Pl(e,t,wl(i[t]))}(e,a)}))})),c}function Fl(e,t,n={}){var r;const o=bi(e,t,"exit"===n.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const s=o?()=>Promise.all(Ll(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:s,staggerDirection:a}=i;return function(e,t,n=0,r=0,o=1,i){const s=[],a=(e.variantChildren.size-1)*r,l=1===o?(e=0)=>e*r:(e=0)=>a-e*r;return Array.from(e.variantChildren).sort(zl).forEach(((e,r)=>{e.notify("AnimationStart",t),s.push(Fl(e,t,{...i,delay:n+l(r)}).then((()=>e.notify("AnimationComplete",t))))})),Promise.all(s)}(e,t,o+r,s,a,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[e,t]="beforeChildren"===l?[s,a]:[a,s];return e().then((()=>t()))}return Promise.all([s(),a(n.delay)])}function zl(e,t){return e.sortNodePosition(t)}const Vl=[...xi].reverse(),Bl=xi.length;function Wl(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ul(){return{animate:Wl(!0),whileInView:Wl(),whileHover:Wl(),whileTap:Wl(),whileDrag:Wl(),whileFocus:Wl(),exit:Wl()}}class $l{constructor(e){this.isMounted=!1,this.node=e}update(){}}let Kl=0;const Hl={animation:{Feature:class extends $l{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=function(e){return t=>Promise.all(t.map((({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map((t=>Fl(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=Fl(e,t,n);else{const o="function"==typeof t?bi(e,t,n.custom):t;r=Promise.all(Ll(e,o,n))}return r.then((()=>{e.notify("AnimationComplete",t)}))}(e,t,n))))}(e),n=Ul(),r=!0;const o=t=>(n,r)=>{var o;const i=bi(e,r,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(i){const{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function i(i){const s=e.getProps(),a=e.getVariantContext(!0)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;td&&v),w=!1;const _=Array.isArray(g)?g:[g];let S=_.reduce(o(p),{});!1===y&&(S={});const{prevResolvedValues:k={}}=m,E={...k,...S},C=t=>{x=!0,c.has(t)&&(w=!0,c.delete(t)),m.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in E){const t=S[e],n=k[e];if(u.hasOwnProperty(e))continue;let r=!1;r=pi(t)&&pi(n)?!mi(t,n):t!==n,r?null!=t?C(e):c.add(e):void 0!==t&&c.has(e)?C(e):m.protectedKeys[e]=!0}m.prevProp=g,m.prevResolvedValues=S,m.isActive&&(u={...u,...S}),r&&e.blockInitialAnimation&&(x=!1),!x||b&&!w||l.push(..._.map((e=>({animation:e,options:{type:p}}))))}var f,h;if(c.size){const t={};c.forEach((n=>{const r=e.getBaseTarget(n),o=e.getValue(n);o&&(o.liveStyle=!0),t[n]=null!=r?r:null})),l.push({animation:t})}let p=Boolean(l.length);return!r||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(p=!1),r=!1,p?t(l):Promise.resolve()}return{animateChanges:i,setActive:function(t,r){var o;if(n[t].isActive===r)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach((e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)})),n[t].isActive=r;const s=i(t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=Ul(),r=!0}}}(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();hi(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}},exit:{Feature:class extends $l{constructor(){super(...arguments),this.id=Kl++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then((()=>t(this.id)))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},ql=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function Yl(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}const Xl=e=>t=>ql(t)&&e(t,Yl(t));function Gl(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Jl(e,t,n,r){return Gl(e,t,Xl(n),r)}const Zl=(e,t)=>Math.abs(e-t);class Ql{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=nc(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=Zl(e.x,t.x),r=Zl(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=Fi;this.history.push({...r,timestamp:o});const{onStart:i,onMove:s}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=ec(t,this.transformPagePoint),Di.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const i=nc("pointercancel"===e.type?this.lastMoveEventInfo:ec(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},!ql(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const i=ec(Yl(e),this.transformPagePoint),{point:s}=i,{timestamp:a}=Fi;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,nc(i,this.history)),this.removeListeners=Ba(Jl(this.contextWindow,"pointermove",this.handlePointerMove),Jl(this.contextWindow,"pointerup",this.handlePointerUp),Jl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Li(this.updatePoint)}}function ec(e,t){return t?{point:t(e.point)}:e}function tc(e,t){return{x:e.x-t.x,y:e.y-t.y}}function nc({point:e},t){return{point:e,delta:tc(e,oc(t)),offset:tc(e,rc(t)),velocity:ic(t,.1)}}function rc(e){return e[0]}function oc(e){return e[e.length-1]}function ic(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=oc(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>ki(t)));)n--;if(!r)return{x:0,y:0};const i=Ei(o.timestamp-r.timestamp);if(0===i)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function sc(e){let t=null;return()=>null===t&&(t=e,()=>{t=null})}const ac=sc("dragHorizontal"),lc=sc("dragVertical");function cc(e){let t=!1;if("y"===e)t=lc();else if("x"===e)t=ac();else{const e=ac(),n=lc();e&&n?t=()=>{e(),n()}:(e&&e(),n&&n())}return t}function uc(){const e=cc(!0);return!e||(e(),!1)}function dc(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}const fc=.9999,hc=1.0001,pc=-.01,mc=.01;function gc(e){return e.max-e.min}function vc(e,t,n,r=.5){e.origin=r,e.originPoint=Ua(t.min,t.max,e.origin),e.scale=gc(n)/gc(t),e.translate=Ua(n.min,n.max,e.origin)-e.originPoint,(e.scale>=fc&&e.scale<=hc||isNaN(e.scale))&&(e.scale=1),(e.translate>=pc&&e.translate<=mc||isNaN(e.translate))&&(e.translate=0)}function yc(e,t,n,r){vc(e.x,t.x,n.x,r?r.originX:void 0),vc(e.y,t.y,n.y,r?r.originY:void 0)}function bc(e,t,n){e.min=n.min+t.min,e.max=e.min+gc(t)}function xc(e,t,n){e.min=t.min-n.min,e.max=e.min+gc(t)}function wc(e,t,n){xc(e.x,t.x,n.x),xc(e.y,t.y,n.y)}function _c(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Sc(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Pc=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Rc(e){return[e("x"),e("y")]}function Oc({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ac(e){return void 0===e||1===e}function Nc({scale:e,scaleX:t,scaleY:n}){return!Ac(e)||!Ac(t)||!Ac(n)}function Mc(e){return Nc(e)||jc(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function jc(e){return Ic(e.x)||Ic(e.y)}function Ic(e){return e&&"0%"!==e}function Dc(e,t,n){return n+t*(e-n)}function Lc(e,t,n,r,o){return void 0!==o&&(e=Dc(e,o,r)),Dc(e,n,r)+t}function Fc(e,t=0,n=1,r,o){e.min=Lc(e.min,t,n,r,o),e.max=Lc(e.max,t,n,r,o)}function zc(e,{x:t,y:n}){Fc(e.x,t.translate,t.scale,t.originPoint),Fc(e.y,n.translate,n.scale,n.originPoint)}const Vc=.999999999999,Bc=1.0000000000001;function Wc(e,t){e.min=e.min+t,e.max=e.max+t}function Uc(e,t,n,r,o=.5){Fc(e,t,n,Ua(e.min,e.max,o),r)}function $c(e,t){Uc(e.x,t.x,t.scaleX,t.scale,t.originX),Uc(e.y,t.y,t.scaleY,t.scale,t.originY)}function Kc(e,t){return Oc(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}const Hc=({current:e})=>e?e.ownerDocument.defaultView:null,qc=new WeakMap;class Yc{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Pc(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new Ql(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(Yl(e,"page").point)},onStart:(e,t)=>{var n;const{drag:r,dragPropagation:o,onDragStart:i}=this.getProps();if(r&&!o&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=cc(r),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Rc((e=>{let t=this.getAxisMotionValue(e).get()||0;if(ls.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];r&&(t=gc(r)*(parseFloat(t)/100))}}this.originPoint[e]=t})),i&&Di.postRender((()=>i(e,t))),null===(n=this.removeWillChange)||void 0===n||n.call(this),this.removeWillChange=Il(this.visualElement,"transform");const{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:i}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}(s),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),i&&i(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>Rc((e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())}))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:Hc(this.visualElement)})}stop(e,t){var n;null===(n=this.removeWillChange)||void 0===n||n.call(this);const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=t;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i&&Di.postRender((()=>i(e,t)))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!Xc(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=function(e,{min:t,max:n},r){return void 0!==t&&en&&(e=r?Ua(n,e,r.max):Math.min(e,n)),e}(i,this.constraints[e],this.elastic[e])),o.set(i)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&dc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:_c(e.x,n,o),y:_c(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=kc){return!1===e?e=0:!0===e&&(e=kc),{x:Ec(e,"left","right"),y:Ec(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Rc((e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))}))}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!dc(e))return!1;const n=e.current;Wi(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(e,t,n){const r=Kc(e,n),{scroll:o}=t;return o&&(Wc(r.x,o.offset.x),Wc(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:Sc(e.x,t.x),y:Sc(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(i));this.hasMutatedConstraints=!!e,e&&(i=Oc(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=Rc((s=>{if(!Xc(s,t,this.currentDirection))return;let l=a&&a[s]||{};i&&(l={min:0,max:0});const c=r?200:1e6,u=r?40:1e7,d={type:"inertia",velocity:n?e[s]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(s,d)}));return Promise.all(l).then(s)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return n.start(bl(e,n,0,t,this.visualElement,!1,Il(this.visualElement,e)))}stopAnimation(){Rc((e=>this.getAxisMotionValue(e).stop()))}pauseAnimation(){Rc((e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()}))}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Rc((t=>{const{drag:n}=this.getProps();if(!Xc(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:i}=r.layout.layoutBox[t];o.set(e[t]-Ua(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!dc(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Rc((e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=gc(e),o=gc(t);return o>r?n=Wa(t.min,t.max-r,e.min):r>o&&(n=Wa(e.min,e.max-o,t.min)),Ji(0,1,n)}({min:n,max:n},this.constraints[e])}}));const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Rc((t=>{if(!Xc(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(Ua(o,i,r[t]))}))}addListeners(){if(!this.visualElement.current)return;qc.set(this.visualElement,this);const e=Jl(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),t=()=>{const{dragConstraints:e}=this.getProps();dc(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),Di.read(t);const o=Gl(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Rc((t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))})),this.visualElement.render())}));return()=>{o(),e(),r(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=kc,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function Xc(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const Gc=e=>(t,n)=>{e&&Di.postRender((()=>e(t,n)))};var Jc=n(848);const Zc=(0,o.createContext)(null),Qc=(0,o.createContext)({}),eu=(0,o.createContext)({}),tu={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function nu(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ru={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!cs.test(e))return e;e=parseFloat(e)}return`${nu(e,t.target.x)}% ${nu(e,t.target.y)}%`}},ou={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Hs.parse(e);if(o.length>5)return r;const i=Hs.createTransformer(e),s="number"!=typeof o[0]?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=Ua(a,l,.5);return"number"==typeof o[2+s]&&(o[2+s]/=c),"number"==typeof o[3+s]&&(o[3+s]/=c),i(o)}},iu={},{schedule:su,cancel:au}=Ii(queueMicrotask,!1);class lu extends o.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;var i;i=uu,Object.assign(iu,i),o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",(()=>{this.safeToRemove()})),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),tu.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,i=n.projection;return i?(i.isPresent=o,r||e.layoutDependency!==t||void 0===t?i.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?i.promote():i.relegate()||Di.postRender((()=>{const e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),su.postRender((()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function cu(e){const[t,n]=function(){const e=(0,o.useContext)(Zc);if(null===e)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=(0,o.useId)();(0,o.useEffect)((()=>r(i)),[]);const s=(0,o.useCallback)((()=>n&&n(i)),[i,n]);return!t&&n?[!1,s]:[!0]}(),r=(0,o.useContext)(Qc);return(0,Jc.jsx)(lu,{...e,layoutGroup:r,switchLayoutGroup:(0,o.useContext)(eu),isPresent:t,safeToRemove:n})}const uu={borderRadius:{...ru,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ru,borderTopRightRadius:ru,borderBottomLeftRadius:ru,borderBottomRightRadius:ru,boxShadow:ou},du=["TopLeft","TopRight","BottomLeft","BottomRight"],fu=du.length,hu=e=>"string"==typeof e?parseFloat(e):e,pu=e=>"number"==typeof e||cs.test(e);function mu(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const gu=yu(0,.5,Ma),vu=yu(.5,.95,Mi);function yu(e,t,n){return r=>rt?1:n(Wa(e,t,r))}function bu(e,t){e.min=t.min,e.max=t.max}function xu(e,t){bu(e.x,t.x),bu(e.y,t.y)}function wu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function _u(e,t,n,r,o){return e=Dc(e-=t,1/n,r),void 0!==o&&(e=Dc(e,1/o,r)),e}function Su(e,t,[n,r,o],i,s){!function(e,t=0,n=1,r=.5,o,i=e,s=e){if(ls.test(t)&&(t=parseFloat(t),t=Ua(s.min,s.max,t/100)-s.min),"number"!=typeof t)return;let a=Ua(i.min,i.max,r);e===i&&(a-=t),e.min=_u(e.min,t,n,a,o),e.max=_u(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,i,s)}const ku=["x","scaleX","originX"],Eu=["y","scaleY","originY"];function Cu(e,t,n,r){Su(e.x,t,ku,n?n.x:void 0,r?r.x:void 0),Su(e.y,t,Eu,n?n.y:void 0,r?r.y:void 0)}function Tu(e){return 0===e.translate&&1===e.scale}function Pu(e){return Tu(e.x)&&Tu(e.y)}function Ru(e,t){return e.min===t.min&&e.max===t.max}function Ou(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Au(e,t){return Ou(e.x,t.x)&&Ou(e.y,t.y)}function Nu(e){return gc(e.x)/gc(e.y)}function Mu(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class ju{constructor(){this.members=[]}add(e){_l(this.members,e),e.scheduleRender()}remove(e){if(Sl(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex((t=>e===t));if(0===t)return!1;let n;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach((e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()}))}scheduleRender(){this.members.forEach((e=>{e.instance&&e.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Iu=(e,t)=>e.depth-t.depth;class Du{constructor(){this.children=[],this.isDirty=!1}add(e){_l(this.children,e),this.isDirty=!0}remove(e){Sl(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Iu),this.isDirty=!1,this.children.forEach(e)}}function Lu(e){const t=jl(e)?e.get():e;return xl(t)?t.toValue():t}const Fu={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},zu="undefined"!=typeof window&&void 0!==window.MotionDebug,Vu=["","X","Y","Z"],Bu={visibility:"hidden"};let Wu=0;function Uu(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function $u(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Al(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Di,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&$u(r)}function Ku({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=Wu++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,zu&&(Fu.totalNodes=Fu.resolvedTargetDeltas=Fu.recalculatedProjection=0),this.nodes.forEach(Yu),this.nodes.forEach(td),this.nodes.forEach(nd),this.nodes.forEach(Xu),zu&&window.MotionDebug.record(Fu)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;e(t,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e){const t=aa.now(),n=({timestamp:r})=>{const o=r-t;o>=250&&(Li(n),e(o-250))};return Di.read(n,!0),()=>Li(n)}(r),tu.hasAnimatedSinceResize&&(tu.hasAnimatedSinceResize=!1,this.nodes.forEach(ed))}))}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&s&&(o||i)&&this.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||ld,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!Au(this.targetLayout,r)||n,c=!t&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...Oi(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||ed(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Li(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(rd),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&$u(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;eVc&&(t.x=1),t.yVc&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms=Pc());const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(wu(this.prevProjectionDelta.x,this.projectionDelta.x),wu(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),yc(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===s&&this.treeScale.y===a&&Mu(this.projectionDelta.x,this.prevProjectionDelta.x)&&Mu(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),zu&&Fu.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Tc(),this.projectionDelta=Tc(),this.projectionDeltaWithTransform=Tc()}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},o={...this.latestValues},i=Tc();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const s=Pc(),a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(ad));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,f,h,p,m,g;id(i.x,e.x,n),id(i.y,e.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(wc(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),h=this.relativeTarget,p=this.relativeTargetOrigin,m=s,g=n,sd(h.x,p.x,m.x,g),sd(h.y,p.y,m.y,g),d&&(l=this.relativeTarget,f=d,Ru(l.x,f.x)&&Ru(l.y,f.y))&&(this.isProjectionDirty=!1),d||(d=Pc()),xu(d,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,i){o?(e.opacity=Ua(0,void 0!==n.opacity?n.opacity:1,gu(r)),e.opacityExit=Ua(void 0!==t.opacity?t.opacity:1,0,vu(r))):i&&(e.opacity=Ua(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let o=0;o{tu.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=jl(0)?0:Tl(0);return r.start(bl("",r,1e3,n)),r.animation}(0,0,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0}))}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&fd(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Pc();const t=gc(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=gc(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}xu(t,n),$c(t,o),yc(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new ju),this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&Uu("z",e,r,this.animationValues);for(let t=0;t{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()})),this.root.nodes.forEach(Ju),this.root.sharedNodes.clear()}}}function Hu(e){e.updateLayout()}function qu(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:o}=e.options,i=n.source!==e.layout.source;"size"===o?Rc((e=>{const r=i?n.measuredBox[e]:n.layoutBox[e],o=gc(r);r.min=t[e].min,r.max=r.min+o})):fd(o,n.layoutBox,t)&&Rc((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=gc(t[r]);o.max=o.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+s)}));const s=Tc();yc(s,t,n.layoutBox);const a=Tc();i?yc(a,e.applyTransform(r,!0),n.measuredBox):yc(a,t,n.layoutBox);const l=!Pu(s);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:i}=r;if(o&&i){const s=Pc();wc(s,n.layoutBox,o.layoutBox);const a=Pc();wc(a,t,i.layoutBox),Au(s,a)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Yu(e){zu&&Fu.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Xu(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Gu(e){e.clearSnapshot()}function Ju(e){e.clearMeasurements()}function Zu(e){e.isLayoutDirty=!1}function Qu(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ed(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function td(e){e.resolveTargetDelta()}function nd(e){e.calcProjection()}function rd(e){e.resetSkewAndRotation()}function od(e){e.removeLeadSnapshot()}function id(e,t,n){e.translate=Ua(t.translate,0,n),e.scale=Ua(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function sd(e,t,n,r){e.min=Ua(t.min,n.min,r),e.max=Ua(t.max,n.max,r)}function ad(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const ld={duration:.45,ease:[.4,0,.1,1]},cd=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ud=cd("applewebkit/")&&!cd("chrome/")?Math.round:Mi;function dd(e){e.min=ud(e.min),e.max=ud(e.max)}function fd(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=Nu(t),o=Nu(n),!(Math.abs(r-o)<=.2));var r,o}function hd(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const pd=Ku({attachResizeListener:(e,t)=>Gl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),md={current:void 0},gd=Ku({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!md.current){const e=new pd({});e.mount(window),e.setOptions({layoutScroll:!0}),md.current=e}return md.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),vd={pan:{Feature:class extends $l{constructor(){super(...arguments),this.removePointerDownListener=Mi}onPointerDown(e){this.session=new Ql(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Hc(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Gc(e),onStart:Gc(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&Di.postRender((()=>r(e,t)))}}}mount(){this.removePointerDownListener=Jl(this.node.current,"pointerdown",(e=>this.onPointerDown(e)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends $l{constructor(e){super(e),this.removeGroupControls=Mi,this.removeListeners=Mi,this.controls=new Yc(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Mi}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:gd,MeasureLayout:cu}};function yd(e,t){const n=t?"pointerenter":"pointerleave",r=t?"onHoverStart":"onHoverEnd";return Jl(e.current,n,((n,o)=>{if("touch"===n.pointerType||uc())return;const i=e.getProps();e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",t);const s=i[r];s&&Di.postRender((()=>s(n,o)))}),{passive:!e.getProps()[r]})}const bd=(e,t)=>!!t&&(e===t||bd(e,t.parentElement));function xd(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Yl(n))}const wd=new WeakMap,_d=new WeakMap,Sd=e=>{const t=wd.get(e.target);t&&t(e)},kd=e=>{e.forEach(Sd)};const Ed={some:0,all:1},Cd={inView:{Feature:class extends $l{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:o}=e,i={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Ed[r]};return function(e,t,n){const r=function({root:e,...t}){const n=e||document;_d.has(n)||_d.set(n,{});const r=_d.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(kd,{root:e,...t})),r[o]}(t);return wd.set(e,n),r.observe(e),()=>{wd.delete(e),r.unobserve(e)}}(this.node.current,i,(e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,o&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),i=t?n:r;i&&i(e)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends $l{constructor(){super(...arguments),this.removeStartListeners=Mi,this.removeEndListeners=Mi,this.removeAccessibleListeners=Mi,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=Jl(window,"pointerup",((e,t)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:o}=this.node.getProps(),i=o||bd(this.node.current,e.target)?n:r;i&&Di.update((()=>i(e,t)))}),{passive:!(n.onTap||n.onPointerUp)}),o=Jl(window,"pointercancel",((e,t)=>this.cancelPress(e,t)),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Ba(r,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=Gl(this.node.current,"keydown",(e=>{"Enter"!==e.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=Gl(this.node.current,"keyup",(e=>{"Enter"===e.key&&this.checkPressEnd()&&xd("up",((e,t)=>{const{onTap:n}=this.node.getProps();n&&Di.postRender((()=>n(e,t)))}))})),xd("down",((e,t)=>{this.startPress(e,t)})))})),t=Gl(this.node.current,"blur",(()=>{this.isPressing&&xd("cancel",((e,t)=>this.cancelPress(e,t)))}));this.removeAccessibleListeners=Ba(e,t)}}startPress(e,t){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&Di.postRender((()=>n(e,t)))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!uc()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&Di.postRender((()=>n(e,t)))}mount(){const e=this.node.getProps(),t=Jl(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=Gl(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Ba(t,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends $l{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ba(Gl(this.node.current,"focus",(()=>this.onFocus())),Gl(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends $l{mount(){this.unmount=Ba(yd(this.node,!0),yd(this.node,!1))}unmount(){}}}},Td={layout:{ProjectionNode:gd,MeasureLayout:cu}},Pd=(0,o.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Rd=(0,o.createContext)({}),Od="undefined"!=typeof window,Ad=Od?o.useLayoutEffect:o.useEffect,Nd=(0,o.createContext)({strict:!1});let Md=!1;function jd(e,t,n,r,i){var s;const{visualElement:a}=(0,o.useContext)(Rd),l=(0,o.useContext)(Nd),c=(0,o.useContext)(Zc),u=(0,o.useContext)(Pd).reducedMotion,d=(0,o.useRef)();r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:u}));const f=d.current,h=(0,o.useContext)(eu);!f||f.projection||!i||"html"!==f.type&&"svg"!==f.type||function(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Dd(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:Boolean(s)||a&&dc(a),visualElement:e,animationType:"string"==typeof i?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}(d.current,n,i,h),(0,o.useInsertionEffect)((()=>{f&&f.update(n,c)}));const p=n[Ol],m=(0,o.useRef)(Boolean(p)&&!window.MotionHandoffIsComplete&&(null===(s=window.MotionHasOptimisedAnimation)||void 0===s?void 0:s.call(window,p)));return Ad((()=>{f&&(f.updateFeatures(),su.render(f.render),m.current&&f.animationState&&f.animationState.animateChanges())})),(0,o.useEffect)((()=>{f&&(!m.current&&f.animationState&&f.animationState.animateChanges(),m.current=!1,Md||(Md=!0,queueMicrotask(Id)))})),f}function Id(){window.MotionHandoffIsComplete=!0}function Dd(e){if(e)return!1!==e.options.allowProjection?e.projection:Dd(e.parent)}function Ld(e,t,n){return(0,o.useCallback)((r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):dc(n)&&(n.current=r))}),[t])}function Fd(e){return hi(e.animate)||wi.some((t=>gi(e[t])))}function zd(e){return Boolean(Fd(e)||e.variants)}function Vd(e){return Array.isArray(e)?e.join(" "):e}const Bd={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Wd={};for(const e in Bd)Wd[e]={isEnabled:t=>Bd[e].some((e=>!!t[e]))};const Ud=Symbol.for("motionComponentSymbol");function $d({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&function(e){for(const t in e)Wd[t]={...Wd[t],...e[t]}}(e);const s=(0,o.forwardRef)((function(e,s){let a;const l={...(0,o.useContext)(Pd),...e,layoutId:Kd(e)},{isStatic:c}=l,u=function(e){const{initial:t,animate:n}=function(e,t){if(Fd(e)){const{initial:t,animate:n}=e;return{initial:!1===t||gi(t)?t:void 0,animate:gi(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,o.useContext)(Rd));return(0,o.useMemo)((()=>({initial:t,animate:n})),[Vd(t),Vd(n)])}(e),d=r(e,c);if(!c&&Od){(0,o.useContext)(Nd).strict;const e=function(e){const{drag:t,layout:n}=Wd;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==n?void 0:n.isEnabled(e))?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(l);a=e.MeasureLayout,u.visualElement=jd(i,d,l,t,e.ProjectionNode)}return(0,Jc.jsxs)(Rd.Provider,{value:u,children:[a&&u.visualElement?(0,Jc.jsx)(a,{visualElement:u.visualElement,...l}):null,n(i,e,Ld(d,u.visualElement,s),d,c,u.visualElement)]})}));return s[Ud]=i,s}function Kd({layoutId:e}){const t=(0,o.useContext)(Qc).id;return t&&void 0!==e?t+"-"+e:e}const Hd=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function qd(e){return"string"==typeof e&&!e.includes("-")&&!!(Hd.indexOf(e)>-1||/[A-Z]/u.test(e))}function Yd(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const t in n)e.style.setProperty(t,n[t])}const Xd=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"]);function Gd(e,t,n,r){Yd(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(Xd.has(n)?n:Rl(n),t.attrs[n])}function Jd(e,{layout:t,layoutId:n}){return Si.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!iu[e]||"opacity"===e)}function Zd(e,t,n){var r;const{style:o}=e,i={};for(const s in o)(jl(o[s])||t.style&&jl(t.style[s])||Jd(s,e)||void 0!==(null===(r=null==n?void 0:n.getValue(s))||void 0===r?void 0:r.liveStyle))&&(i[s]=o[s]);return n&&o&&"string"==typeof o.willChange&&(n.applyWillChange=!1),i}function Qd(e,t,n){const r=Zd(e,t,n);for(const n in e)(jl(e[n])||jl(t[n]))&&(r[-1!==_i.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}function ef(e){const t=(0,o.useRef)(null);return null===t.current&&(t.current=e()),t.current}const tf=e=>(t,n)=>{const r=(0,o.useContext)(Rd),i=(0,o.useContext)(Zc),s=()=>function({applyWillChange:e=!1,scrapeMotionValuesFromProps:t,createRenderState:n,onMount:r},o,i,s,a){const l={latestValues:of(o,i,s,!a&&e,t),renderState:n()};return r&&(l.mount=e=>r(o,e,l)),l}(e,t,r,i,n);return n?s():ef(s)};function nf(e,t){const n=Nl(t);n&&_l(e,n)}function rf(e,t,n){const r=Array.isArray(t)?t:[t];for(let t=0;t{for(const t in e){let n=e[t];Array.isArray(n)&&(n=n[p?n.length-1:0]),null!==n&&(s[t]=n)}for(const e in t)s[e]=t[e]})),l&&(d&&!1!==u&&!hi(d)&&rf(e,d,(e=>{for(const t in e)nf(a,t)})),a.length&&(s.willChange=a.join(","))),s}const sf=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),af=()=>({...sf(),attrs:{}}),lf=(e,t)=>t&&"number"==typeof e?t.transform(e):e,cf={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},uf=_i.length;function df(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const e in t){const n=t[e];if(Si.has(e))s=!0;else if(Ki(e))o[e]=n;else{const t=lf(n,Zs[e]);e.startsWith("origin")?(a=!0,i[e]=t):r[e]=t}}if(t.transform||(s||n?r.transform=function(e,t,n){let r="",o=!0;for(let i=0;i"string"==typeof e&&"svg"===e.toLowerCase(),vf={useVisualState:tf({scrapeMotionValuesFromProps:Qd,createRenderState:af,onMount:(e,t,{renderState:n,latestValues:r})=>{Di.read((()=>{try{n.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){n.dimensions={x:0,y:0,width:0,height:0}}})),Di.render((()=>{mf(n,r,gf(t.tagName),e.transformTemplate),Gd(t,n)}))}})},yf={useVisualState:tf({applyWillChange:!0,scrapeMotionValuesFromProps:Zd,createRenderState:sf})};function bf(e,t,n){for(const r in t)jl(t[r])||Jd(r,n)||(e[r]=t[r])}function xf(e,t){const n={},r=function(e,t){const n={};return bf(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,o.useMemo)((()=>{const n=sf();return df(n,t,e),Object.assign({},n.vars,n.style)}),[t])}(e,t)),n}(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const wf=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function _f(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||wf.has(e)}let Sf=e=>!_f(e);try{(kf=n(316).A)&&(Sf=e=>e.startsWith("on")?!_f(e):kf(e))}catch(e){}var kf;function Ef(e,t,n,r){const i=(0,o.useMemo)((()=>{const n=af();return mf(n,t,gf(r),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};bf(t,e.style,e),i.style={...t,...i.style}}return i}function Cf(e=!1){return(t,n,r,{latestValues:i},s)=>{const a=(qd(t)?Ef:xf)(n,i,s,t),l=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(Sf(o)||!0===n&&_f(o)||!t&&!_f(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(n,"string"==typeof t,e),c=t!==o.Fragment?{...l,...a,ref:r}:{},{children:u}=n,d=(0,o.useMemo)((()=>jl(u)?u.get():u),[u]);return(0,o.createElement)(t,{...c,children:d})}}function Tf(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return $d({...qd(n)?vf:yf,preloadedFeatures:e,useRender:Cf(r),createVisualElement:t,Component:n})}}const Pf={current:null},Rf={current:!1},Of=new WeakMap,Af=[...ws,Is,Hs],Nf=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Mf=wi.length;class jf{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:o,visualState:i},s={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ps,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,Di.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=s,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=Fd(t),this.isVariantNode=zd(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in u){const t=u[e];void 0!==a[e]&&jl(t)&&t.set(a[e],!1)}}mount(e){this.current=e,Of.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((e,t)=>this.bindToMotionValue(t,e))),Rf.current||function(){if(Rf.current=!0,Od)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Pf.current=e.matches;e.addListener(t),t()}else Pf.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Pf.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Of.delete(this.current),this.projection&&this.projection.unmount(),Li(this.notifyUpdate),Li(this.render),this.valueSubscriptions.forEach((e=>e())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=Si.has(e),r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&Di.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=t.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,(()=>{r(),o(),i&&i(),t.owner&&t.stop()}))}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in Wd){const t=Wd[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Pc()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;tt.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=Tl(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let r=void 0===this.latestValues[e]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,e))&&void 0!==n?n:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=r&&("string"==typeof r&&(Ui(r)||Vi(r))?r=parseFloat(r):!(e=>Af.find(xs(e)))(r)&&Hs.test(t)&&(r=ta(e,t)),this.setBaseTarget(e,jl(r)?r.get():r)),jl(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const o=yi(this.props,n,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(r=o[e])}if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||jl(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new kl),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class If extends jf{constructor(){super(...arguments),this.KeyframeResolver=ra}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}}class Df extends If{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=Yd}readValueFromInstance(e,t){if(Si.has(t)){const e=ea(t);return e&&e.default||0}{const r=(n=e,window.getComputedStyle(n)),o=(Ki(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return Kc(e,t)}build(e,t,n){df(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Zd(e,t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;jl(e)&&(this.childSubscription=e.on("change",(e=>{this.current&&(this.current.textContent=`${e}`)})))}}class Lf extends If{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Pc}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Si.has(t)){const e=ea(t);return e&&e.default||0}return t=Xd.has(t)?t:Rl(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Qd(e,t,n)}build(e,t,n){mf(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){Gd(e,t,0,r)}mount(e){this.isSVGTag=gf(e.tagName),super.mount(e)}}const Ff=fi(Tf({...Hl,...Cd,...vd,...Td},((e,t)=>qd(e)?new Lf(t):new Df(t,{allowProjection:e!==o.Fragment}))));var zf=["slug","text","icon","className","disabled","badge"];function Vf(){return Vf=Object.assign?Object.assign.bind():function(e){for(var t=1;t*]:box-border flex items-center ".concat("full"===y?"w-full":""," ").concat(S),E=te(k,x,w,t,_,"underline"!==p?"bg-tab-background":"",l);return i().createElement("div",{className:E},i().createElement(Bf.Provider,{value:{activeItem:s,onChange:b,size:u,variant:p,orientation:f,iconPosition:g,width:y}},i().Children.map(n,(function(e){return(0,o.isValidElement)(e)?i().cloneElement(e):null}))))},Tab:Uf};const Kf=ve("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),Hf=ve("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),qf=ve("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var Yf={sm:{icon:"[&>svg]:size-4",searchIcon:"[&>svg]:size-4",selectButton:"px-2 py-2 rounded text-xs font-medium leading-4 min-h-[2.25rem]",multiSelect:"pl-2 pr-2 py-1.5",displaySelected:"text-xs font-normal",dropdown:"rounded-md",dropdownItemsWrapper:"p-1.5",searchbarWrapper:"p-3 flex items-center gap-0.5",searchbar:"font-medium text-xs",searchbarIcon:"[&>svg]:size-4",label:"text-xs font-medium"},md:{icon:"[&>svg]:size-5",searchIcon:"[&>svg]:size-5",selectButton:"px-2.5 py-2.5 rounded-md text-xs font-medium leading-4 min-h-[2.5rem]",multiSelect:"pl-2 pr-2.5 py-2",displaySelected:"text-sm font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"[&>svg]:size-5",label:"text-sm font-medium"},lg:{icon:"[&>svg]:size-6",searchIcon:"[&>svg]:size-5",selectButton:"px-3 py-3 rounded-lg text-sm font-medium leading-5 min-h-[3rem]",multiSelect:"pl-2.5 pr-3 py-2.5",displaySelected:"text-sm font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"[&>svg]:size-5",label:"text-base font-medium"}},Xf="group-disabled:text-field-color-disabled",Gf=["value","selected","children"];function Jf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||eh(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zf(){return Zf=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n{r&&(clearTimeout(m.current),y.current=null,g.current="")}),[r]),Pr((()=>{var e;r&&""===g.current&&(v.current=null!=(e=null!=p?p:a)?e:-1)}),[r,p,a]);const S=hr((e=>{e?i.current.typing||(i.current.typing=e,x(e)):i.current.typing&&(i.current.typing=e,x(e))})),k=hr((e=>{function t(e,t,n){const r=w.current?w.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}const n=s.current;if(g.current.length>0&&" "!==g.current[0]&&(-1===t(n,n,g.current)?S(!1):" "===e.key&&Ht(e)),null==n||_.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(Ht(e),S(!0)),n.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&g.current===e.key&&(g.current="",v.current=y.current),g.current+=e.key,clearTimeout(m.current),m.current=setTimeout((()=>{g.current="",v.current=y.current,S(!1)}),f);const o=v.current,i=t(n,[...n.slice((o||0)+1),...n.slice(0,(o||0)+1)],g.current);-1!==i?(b(i),y.current=i):" "!==e.key&&(g.current="",S(!1))})),E=o.useMemo((()=>({onKeyDown:k})),[k]),C=o.useMemo((()=>({onKeyDown:k,onKeyUp(e){" "===e.key&&S(!1)}})),[k,S]);return o.useMemo((()=>u?{reference:E,floating:C}:{}),[u,E,C])}(V,{listRef:W,activeIndex:A,selectedIndex:j,onMatch:P?N:I,onTypingChange:function(e){U.current=e}}),X=Ao([K,H,q,$].concat(Qf(m?[]:[Y]))),G=X.getReferenceProps,J=X.getFloatingProps,Z=X.getItemProps,Q=function(e,t){if(h)return function(e,t){var n,r=Qf(null!==(n=C())&&void 0!==n?n:[]);-1===r.findIndex((function(e){return"object"===nh(e)?e[u]===t[u]:e===t}))&&(r.push(t),b||_(r),I(e),F.reference.current.focus(),R(!1),E(""),"function"==typeof l&&l(r))}(e,t);I(e),b||_(t),F.reference.current.focus(),R(!1),E(""),"function"==typeof l&&l(t)},ee=(0,o.useCallback)((function(e,t){B.current[e]=t}),[]);return React.createElement(sh.Provider,{value:{selectedIndex:j,setSelectedIndex:I,activeIndex:A,setActiveIndex:N,selected:w,setSelected:_,handleSelect:Q,combobox:m,sizeValue:i,multiple:h,onChange:l,isTypingRef:U,getItemProps:Z,onClickItem:function(e,t){Q(e,t)},onKeyDownItem:function(e,t,n){"Enter"===e.key&&(e.preventDefault(),Q(t,n))," "!==e.key||U.current||(e.preventDefault(),Q(t,n))},getValues:C,selectId:y,getReferenceProps:G,isOpen:P,value:s,updateListRef:ee,refs:F,listContentRef:W,by:u,getFloatingProps:J,floatingStyles:z,context:V,searchKeyword:k,setSearchKeyword:E,disabled:v}},d)};lh.Button=function(e){var t,n,r,i=e.children,s=e.icon,a=void 0===s?null:s,l=e.placeholder,c=void 0===l?"Select an option":l,u=e.optionIcon,d=void 0===u?null:u,f=e.displayBy,h=void 0===f?"name":f,p=e.label,m=ah(),g=m.sizeValue,v=m.getReferenceProps,y=m.getValues,b=m.selectId,x=m.refs,w=m.isOpen,_=m.multiple,S=m.combobox,k=m.setSelected,E=m.onChange,C=m.isControlled,T=m.disabled,P=m.by,R=null===(t={sm:"xs",md:"sm",lg:"md"})||void 0===t?void 0:t[g],O=(0,o.useCallback)((function(){if(a)return a;var e="text-field-placeholder group-disabled:text-icon-disabled";return S?React.createElement(Kf,{className:e}):React.createElement(Hf,{className:e})}),[a]),A=(0,o.useCallback)((function(){var e=y();if(!e)return null;if("function"==typeof i){var t=oh({value:e},_?{onClose:N}:{});return i(t)}if(_)return e.map((function(e,t){return React.createElement(We,{icon:d,type:"rounded",key:t,size:R,onMouseDown:N(e),label:"object"===nh(e)?e[h]:e,disabled:T})}));var n="object"===nh(e)?e[h]:e;return(0,o.isValidElement)(i)&&(n=i),React.createElement("span",{className:te(Yf[g].displaySelected,Xf)},n)}),[y]),N=function(e){return function(t){var n;null==t||t.preventDefault(),null==t||t.stopPropagation();var r=Qf(null!==(n=y())&&void 0!==n?n:[]),o=r.findIndex((function(t){return"object"===nh(t)?t[P]===e[P]:t===e}));-1!==o&&(r.splice(o,1),C||k(r),"function"==typeof E&&E(r))}};return React.createElement("div",{className:"flex flex-col items-start gap-1.5 [&_*]:box-border box-border"},React.createElement("label",{className:te(null===(n=Yf[g])||void 0===n?void 0:n.label,"text-field-label"),htmlFor:b},p),React.createElement("button",Zf({id:b,ref:x.setReference,className:te("flex items-center justify-between border border-solid w-full box-border transition-colors duration-150 bg-white","border focus-visible:outline-none border-solid border-field-border",!w&&"focus:ring-2 focus:ring-offset-4 focus:border-focus-border focus:ring-focus [&:hover:not(:focus):not(:disabled)]:border-border-strong",Yf[g].selectButton,_&&Yf[g].multiSelect,"group disabled:border-field-border-disabled [&:hover:has(:disabled)]:border-field-border-disabled"),"aria-labelledby":"select-label",tabIndex:0,disabled:T},v()),React.createElement("div",{className:te("flex-1 grid items-center justify-start gap-1.5 ",y()&&"flex flex-wrap")},A(),(_?!(null!==(r=y())&&void 0!==r&&r.length):!y())&&React.createElement("div",{className:te("[grid-area:1/1/2/3] text-field-input",Yf[g].displaySelected,Xf)},c)),React.createElement("div",{className:te("flex items-center [&>svg]:shrink-0",Yf[g].icon)},O())))},lh.Options=function(e){var t=e.children,n=e.searchBy,r=void 0===n?"id":n,i=e.searchPlaceholder,s=void 0===i?"Search...":i,a=e.dropdownPortalRoot,l=void 0===a?null:a,c=e.dropdownPortalId,u=void 0===c?"":c,d=ah(),f=d.isOpen,h=d.context,p=d.refs,m=d.combobox,g=d.floatingStyles,v=d.getFloatingProps,y=d.sizeValue,b=d.setSearchKeyword,x=d.setActiveIndex,w=d.setSelectedIndex,_=d.value,S=d.selected,k=d.getValues,E=d.searchKeyword,C=d.listContentRef,T=d.by,P=(0,o.useMemo)((function(){var e=k(),n=0;return e&&(n=o.Children.toArray(t).findIndex((function(t){return"object"===nh(t.props.value)?t.props.value[T]===e[T]:t.props.value===e}))),-1===n?0:n}),[_,S,t]);(0,o.useLayoutEffect)((function(){x(P),w(P)}),[]);var R=(0,o.useMemo)((function(){return o.Children.map(t,(function(e,t){if(!(0,o.isValidElement)(e))return null;if(E){var n=e.props.value;if("object"===nh(n)){if(-1===n[r].toLowerCase().indexOf(E.toLowerCase()))return null}else if(-1===n.toLowerCase().indexOf(E.toLowerCase()))return null}return(0,o.cloneElement)(e,oh(oh({},e.props),{},{index:t}))}))}),[E,_,S,t]),O=o.Children.count(R);return(0,o.useEffect)((function(){C.current=[],o.Children.forEach(t,(function(e){if((0,o.isValidElement)(e)&&e.props.value){if(E){var t=e.props.value;if("object"===nh(t)){if(-1===t[r].toLowerCase().indexOf(E.toLowerCase()))return}else if(-1===t.toLowerCase().indexOf(E.toLowerCase()))return}C.current.push(e.props.value)}}))}),[E]),React.createElement(React.Fragment,null,f&&React.createElement(co,{id:u,root:l},React.createElement(bo,{context:h,modal:!1},React.createElement("div",Zf({ref:p.setFloating,className:te("box-border [&_*]:box-border w-full bg-white outline-none shadow-lg border border-solid border-border-subtle overflow-hidden",m&&"grid grid-cols-1 grid-rows-[auto_1fr] divide-y divide-x-0 divide-solid divide-border-subtle",Yf[y].dropdown,!m&&"h-full"),style:oh({},g)},v()),m&&React.createElement("div",{className:te(Yf[y].searchbarWrapper)},React.createElement(qf,{className:te("text-icon-secondary shrink-0",Yf[y].searchbarIcon)}),React.createElement("input",{className:te("px-1 w-full placeholder:text-field-placeholder border-0 focus:outline-none focus:shadow-none",Yf[y].searchbar),type:"search",name:"keyword",placeholder:s,onChange:function(e){return b(e.target.value)},autoComplete:"off"})),React.createElement("div",{className:te("overflow-y-auto",!m&&"w-full h-full",Yf[y].dropdownItemsWrapper)},!!O&&R,!O&&React.createElement("div",{className:"p-2 text-center text-base font-medium text-field-placeholder"},"No items found"))))))},lh.Option=function(e){var t=e.value,n=e.selected,r=e.children,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(hh({message:e,type:"neutral"},t))}},{key:"success",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(hh({message:e,type:"success"},t))}},{key:"error",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(hh({message:e,type:"error"},t))}},{key:"warning",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(hh({message:e,type:"warning"},t))}},{key:"info",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(hh({message:e,type:"info"},t))}},{key:"custom",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(hh({jsx:e,type:"custom"},t))}}],t&&mh(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),Eh=new kh,Ch=Object.seal(Object.assign((function(e,t){return Eh.default(e,t)}),{success:Eh.success.bind(Eh),error:Eh.error.bind(Eh),warning:Eh.warning.bind(Eh),info:Eh.info.bind(Eh),custom:Eh.custom.bind(Eh),dismiss:Eh.dismiss.bind(Eh),update:Eh.update.bind(Eh)},{getHistory:Eh.history.bind(Eh)})),Th=!1,Ph={"top-left":"top-0 bottom-0 left-0 justify-start items-start","top-right":"top-0 bottom-0 right-0 justify-start items-end","bottom-left":"top-0 bottom-0 left-0 justify-end items-start","bottom-right":"top-0 bottom-0 right-0 justify-end items-end"},Rh={neutral:"border-alert-border-neutral bg-alert-background-neutral",custom:"border-alert-border-neutral bg-alert-background-neutral",info:"border-alert-border-info bg-alert-background-info",success:"border-alert-border-green bg-alert-background-green",warning:"border-alert-border-warning bg-alert-background-warning",error:"border-alert-border-danger bg-alert-background-danger"},Oh="bg-background-inverse border-background-inverse",Ah={light:"text-icon-secondary",dark:"text-icon-inverse"};class Nh extends o.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Mh({children:e,isPresent:t}){const n=(0,o.useId)(),r=(0,o.useRef)(null),i=(0,o.useRef)({width:0,height:0,top:0,left:0}),{nonce:s}=(0,o.useContext)(Pd);return(0,o.useInsertionEffect)((()=>{const{width:e,height:o,top:a,left:l}=i.current;if(t||!r.current||!e||!o)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return s&&(c.nonce=s),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${n}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${o}px !important;\n top: ${a}px !important;\n left: ${l}px !important;\n }\n `),()=>{document.head.removeChild(c)}}),[t]),(0,Jc.jsx)(Nh,{isPresent:t,childRef:r,sizeRef:i,children:o.cloneElement(e,{ref:r})})}const jh=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a})=>{const l=ef(Ih),c=(0,o.useId)(),u=(0,o.useMemo)((()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:e=>{l.set(e,!0);for(const e of l.values())if(!e)return;r&&r()},register:e=>(l.set(e,!1),()=>l.delete(e))})),s?[Math.random()]:[n]);return(0,o.useMemo)((()=>{l.forEach(((e,t)=>l.set(t,!1)))}),[n]),o.useEffect((()=>{!n&&!l.size&&r&&r()}),[n]),"popLayout"===a&&(e=(0,Jc.jsx)(Mh,{isPresent:n,children:e})),(0,Jc.jsx)(Zc.Provider,{value:u,children:e})};function Ih(){return new Map}const Dh=e=>e.key||"";function Lh(e){const t=[];return o.Children.forEach(e,(e=>{(0,o.isValidElement)(e)&&t.push(e)})),t}const Fh=({children:e,exitBeforeEnter:t,custom:n,initial:r=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:a="sync"})=>{Wi(!t,"Replace exitBeforeEnter with mode='wait'");const l=(0,o.useMemo)((()=>Lh(e)),[e]),c=l.map(Dh),u=(0,o.useRef)(!0),d=(0,o.useRef)(l),f=ef((()=>new Map)),[h,p]=(0,o.useState)(l),[m,g]=(0,o.useState)(l);Ad((()=>{u.current=!1,d.current=l;for(let e=0;e{const t=Dh(e),o=l===m||c.includes(t);return(0,Jc.jsx)(jh,{isPresent:o,initial:!(u.current&&!r)&&void 0,custom:o?void 0:n,presenceAffectsLayout:s,mode:a,onExitComplete:o?void 0:()=>{if(!f.has(t))return;f.set(t,!0);let e=!0;f.forEach((t=>{t||(e=!1)})),e&&(null==y||y(),g(d.current),i&&i())},children:e},t)}))})};function zh(e){return zh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zh(e)}function Vh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bh(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&void 0!==arguments[1]?arguments[1]:u;if(l&&!(u<0))return x.current=(new Date).getTime(),setTimeout((function(){b(e.id)}),t)};(0,o.useEffect)((function(){var e=u;return _.current=S(t,e),function(){clearTimeout(_.current)}}),[]),(0,o.useEffect)((function(){null!=t&&t.dismiss&&b(t.id)}),[t]);var k,E,C,T,P,R,O,A,N,M,j=function(){var e,n;null==t||null===(e=t.action)||void 0===e||null===(n=e.onClick)||void 0===n||n.call(e,(function(){return b(t.id)}))},I=null;return"stack"===p&&(I=React.createElement("div",{className:te("flex items-center justify-start p-4 gap-2 relative border border-solid rounded-md shadow-lg","dark"===f?Oh:null===(k=Rh)||void 0===k?void 0:k[y],"w-[22.5rem]"),onMouseEnter:function(){clearTimeout(_.current),w.current=(new Date).getTime()},onMouseLeave:function(){_.current=S(t,u-(w.current-x.current))}},"custom"!==t.type?React.createElement(React.Fragment,null,React.createElement("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0"},qo({variant:y,icon:g,theme:f})),React.createElement("div",{className:"flex flex-col items-start justify-start gap-0.5"},Xo({title:r,theme:f}),Go({content:s,theme:f}),(null==t||null===(E=t.action)||void 0===E?void 0:E.label)&&"function"==typeof(null==t||null===(C=t.action)||void 0===C?void 0:C.onClick)&&React.createElement("div",{className:"mt-2.5"},Yo({actionLabel:null==t||null===(T=t.action)||void 0===T?void 0:T.label,actionType:null!==(P=null==t||null===(R=t.action)||void 0===R?void 0:R.type)&&void 0!==P?P:"button",onAction:j,theme:f}))),React.createElement("div",{className:"absolute right-4 top-4 [&_svg]:size-5"},React.createElement("button",{className:te("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(O=Ah[f])&&void 0!==O?O:Ah.light),onClick:function(){return b(t.id)}},React.createElement(ze,null)))):null==t||null===(A=t.jsx)||void 0===A?void 0:A.call(t,{close:function(){return b(t.id)},action:null!=t&&t.action?Bh(Bh({},null==t?void 0:t.action),{},{onClick:j}):null}))),"inline"===p&&(I=React.createElement("div",{className:te("flex items-center justify-start p-3 gap-2 relative border border-solid rounded-md shadow-lg","dark"===f?Oh:null===(N=Rh)||void 0===N?void 0:N[y],"lg:w-[47.5rem] w-full")},React.createElement("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0"},qo({variant:y,icon:g,theme:f})),React.createElement("div",{className:"flex items-start justify-start gap-1 mr-10 [&>span:first-child]:shrink-0"},Xo({title:r,theme:f}),Go({content:s,theme:f})),React.createElement("div",{className:"absolute right-3 top-3 [&_svg]:size-5"},React.createElement("button",{className:te("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(M=Ah[f])&&void 0!==M?M:Ah.light),onClick:function(){return b(t.id)}},React.createElement(ze,null))))),I},qh=(Kh=function(e){var t,n,r,i=e.position,s=void 0===i?"top-right":i,a=e.design,l=void 0===a?"stack":a,c=e.theme,u=void 0===c?"light":c,d=e.className,f=void 0===d?"":d,h=e.autoDismiss,p=void 0===h||h,m=e.dismissAfter,g=void 0===m?5e3:m,v=(n=(0,o.useState)([]),r=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(n,r)||Uh(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=v[0],b=v[1];(0,o.useEffect)((function(){Eh.subscribe((function(e){null!=e&&e.dismiss?b((function(t){return t.map((function(t){return t.id===e.id?Bh(Bh({},t),{},{dismiss:!0}):t}))})):setTimeout((function(){(0,Nn.flushSync)((function(){return b((function(t){return-1!==t.findIndex((function(t){return t.id===e.id}))?t.map((function(t){return t.id===e.id?Bh(Bh({},t),e):t})):[].concat(function(e){return function(e){if(Array.isArray(e))return $h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Uh(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t),[e])}))}))}))}))}),[]);var x=function(e){b((function(t){return t.filter((function(t){return t.id!==e}))}))};return React.createElement("ul",{className:te("fixed flex flex-col list-none z-20 p-10 pointer-events-none [&>li]:pointer-events-auto gap-3",null!==(t=Ph[s])&&void 0!==t?t:Ph["top-right"],f)},React.createElement(Fh,{initial:!1},y.map((function(e){var t,n,r,o,i;return React.createElement(Ff.li,{key:e.id,positionTransition:!0,initial:{opacity:0,y:50,scale:.7},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.6,transition:{duration:.15}},layoutId:"toast-".concat(e.id)},React.createElement(Hh,{toastItem:e,title:e.title,content:null==e?void 0:e.description,icon:null!==(t=null==e?void 0:e.icon)&&void 0!==t?t:null,design:null!==(n=null==e?void 0:e.design)&&void 0!==n?n:l,autoDismiss:null!==(r=null==e?void 0:e.autoDismiss)&&void 0!==r?r:p,dismissAfter:null!==(o=null==e?void 0:e.dismissAfter)&&void 0!==o?o:g,removeToast:x,variant:e.type,theme:null!==(i=null==e?void 0:e.theme)&&void 0!==i?i:u}))}))))},(0,o.memo)((function(e){return Th?null:(Th=!0,React.createElement(Kh,e))}))),Yh=["containerType","gap","direction","justify","align","wrap","cols","tabCols","mCols","className","children"],Xh=["grow","shrink","order","alignSelf","className","children"];function Gh(){return Gh=Object.assign?Object.assign.bind():function(e){for(var t=1;tspan:first-child]:shrink-0"},Xo({title:g,theme:u}),Go({content:y,theme:u}))),React.createElement("div",{className:"flex items-center justify-start gap-4 [&_svg]:size-5"},(null==k?void 0:k.label)&&"function"==typeof(null==k?void 0:k.onClick)&&React.createElement("div",{className:"flex"},Yo({actionLabel:null==k?void 0:k.label,actionType:null!==(n=null==k?void 0:k.type)&&void 0!==n?n:"button",onAction:O,theme:u})),React.createElement("button",{className:te("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(r=R[u])&&void 0!==r?r:R.light),onClick:function(){return E()}},React.createElement(ze,null))))},np=(Qh=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e{t.focus((()=>{const e=document.activeElement,n=t.getRootElement();null===n||null!==e&&n.contains(e)||n.focus({preventScroll:!0})}),{defaultSelection:e})}),[e,t]),null}const sp={},ap={},lp={},cp={},up={},dp={},fp={},hp={},pp={},mp={},gp={},vp={},yp={},bp={},xp={},wp={},_p={},Sp={},kp={},Ep={},Cp={},Tp={},Pp={},Rp={},Op={},Ap={},Np={},Mp={},jp={},Ip={},Dp={},Lp={},Fp={},zp={},Vp={},Bp={},Wp={},Up={},$p={},Kp={},Hp="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,qp=Hp&&"documentMode"in document?document.documentMode:null,Yp=Hp&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Xp=Hp&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Gp=!(!Hp||!("InputEvent"in window)||qp)&&"getTargetRanges"in new window.InputEvent("input"),Jp=Hp&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Zp=Hp&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Qp=Hp&&/Android/.test(navigator.userAgent),em=Hp&&/^(?=.*Chrome).*/i.test(navigator.userAgent),tm=Hp&&Qp&&em,nm=Hp&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!em,rm=1,om=3,im=0,sm=2,am=0,lm=1,cm=2,um=4,dm=8,fm=3|um|dm|240,hm=1,pm=2,mm=3,gm=4,vm=5,ym=6,bm=Jp||Zp||nm?" ":"​",xm="\n\n",wm=Xp?" ":bm,_m="֑-߿יִ-﷽ﹰ-ﻼ",Sm="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",km=new RegExp("^[^"+Sm+"]*["+_m+"]"),Em=new RegExp("^[^"+_m+"]*["+Sm+"]"),Cm={bold:1,code:16,highlight:128,italic:2,strikethrough:um,subscript:32,superscript:64,underline:dm},Tm={directionless:1,unmergeable:2},Pm={center:pm,end:ym,justify:gm,left:hm,right:mm,start:vm},Rm={[pm]:"center",[ym]:"end",[gm]:"justify",[hm]:"left",[mm]:"right",[vm]:"start"},Om={normal:0,segmented:2,token:1},Am={[am]:"normal",[cm]:"segmented",[lm]:"token"};var Nm,Mm=(Nm=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;eIm;try{Tb(e,(()=>{const o=Zy()||function(e){return e.getEditorState().read((()=>{const e=Zy();return null!==e?e.clone():null}))}(e),i=new Map,s=e.getRootElement(),a=e._editorState,l=e._blockCursorElement;let c=!1,u="";for(let n=0;n0){let t=0;for(let o=0;o0)for(const[t,n]of i)if(Rb(n)){const r=n.getChildrenKeys();let o=t.firstChild;for(let n=0;n0){for(let t=0;t{Wm(e,t,n)}))}function Km(e,t){const n=e.__mode,r=e.__format,o=e.__style,i=t.__mode,s=t.__format,a=t.__style;return!(null!==n&&n!==i||null!==r&&r!==s||null!==o&&o!==a)}function Hm(e,t){const n=e.mergeWithSibling(t),r=gb()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function qm(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&Ry(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(Km(t,r)){r=Hm(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&Ry(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(Km(r,n)){r=Hm(r,n);break}break}n.remove()}}else r.remove()}function Ym(e){for(;"element"===e.type;){const t=e.getNode(),n=e.offset;let r,o;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),o=!0):(r=t.getChildAtIndex(n),o=!1),Ry(r)){e.set(r.__key,o?r.getTextContentSize():0,"text");break}if(!Rb(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element")}}let Xm=1;const Gm="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function Jm(e){const t=document.activeElement;if(null===t)return!1;const n=t.nodeName;return Nb(fg(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==tg(t))}function Zm(e,t,n){const r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!Jm(t)&&eg(t)===e}catch(e){return!1}}function Qm(e){return e instanceof Kb}function eg(e){let t=e;for(;null!=t;){const e=tg(t);if(Qm(e))return e;t=Bg(t)}return null}function tg(e){return e?e.__lexicalEditor:null}function ng(e){return e.isToken()||e.isSegmented()}function rg(e){return e.nodeType===om}function og(e){let t=e;for(;null!=t;){if(rg(t))return t;t=t.firstChild}return null}function ig(e,t,n){const r=Cm[t];if(null!==n&&(e&r)==(n&r))return e;let o=e^r;return"subscript"===t?o&=~Cm.superscript:"superscript"===t&&(o&=~Cm.subscript),o}function sg(e){const t=e.getParent();if(null!==t){const n=e.getWritable(),r=t.getWritable(),o=e.getPreviousSibling(),i=e.getNextSibling();if(null===o)if(null!==i){const e=i.getWritable();r.__first=i.__key,e.__prev=null}else r.__first=null;else{const e=o.getWritable();if(null!==i){const t=i.getWritable();t.__prev=e.__key,e.__next=t.__key}else e.__next=null;n.__prev=null}if(null===i)if(null!==o){const e=o.getWritable();r.__last=o.__key,e.__next=null}else r.__last=null;else{const e=i.getWritable();if(null!==o){const t=o.getWritable();t.__next=e.__key,e.__prev=t.__key}else e.__prev=null;n.__next=null}r.__size--,n.__parent=null}}function ag(e){pb();const t=e.getLatest(),n=t.__parent,r=mb(),o=gb(),i=r._nodeMap,s=o._dirtyElements;null!==n&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;const e=t.get(r);if(void 0===e)break;n.set(r,!1),r=e.__parent}}(n,i,s);const a=t.__key;o._dirtyType=1,Rb(e)?s.set(a,!0):o._dirtyLeaves.add(a)}function lg(e){hb();const t=gb(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=ug(n);null!==e&&e.getWritable()}if(null!==e){const t=ug(e);null!==t&&t.getWritable()}}}function cg(){return fb()?null:gb()._compositionKey}function ug(e,t){const n=(t||mb())._nodeMap.get(e);return void 0===n?null:n}function dg(e,t){const n=e[`__lexicalKey_${gb()._key}`];return void 0!==n?ug(n,t):null}function fg(e,t){let n=e;for(;null!=n;){const e=dg(n,t);if(null!==e)return e;n=Bg(n)}return null}function hg(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function pg(e){return e.read((()=>mg().getTextContent()))}function mg(){return gg(mb())}function gg(e){return e._nodeMap.get("root")}function vg(e){hb();const t=mb();null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function yg(e){const t=gb(),n=function(e,t){let n=e;for(;null!=n;){const e=n[`__lexicalKey_${t._key}`];if(void 0!==e)return e;n=Bg(n)}return null}(e,t);return null===n?e===t.getRootElement()?ug("root"):null:ug(n)}function bg(e,t){return t?e.getTextContentSize():0}function xg(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function wg(e){const t=[];let n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function _g(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Sg(e){return e.nodeType===om?e.nodeValue:null}function kg(e,t,n){const r=Yg(t._window);if(null===r)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(null!==o){let t=Sg(o);const r=fg(o);if(null!==t&&Ry(r)){if(t===bm&&n){const e=n.length;t=n,i=e,s=e}null!==t&&Eg(r,t,i,s,e)}}}function Eg(e,t,n,r,o){let i=e;if(i.isAttached()&&(o||!i.isDirty())){const s=i.isComposing();let a=t;(s||o)&&t[t.length-1]===bm&&(a=t.slice(0,-1));const l=i.getTextContent();if(o||a!==l){if(""===a){if(lg(null),Jp||Zp||nm)i.remove();else{const e=gb();setTimeout((()=>{e.update((()=>{i.isAttached()&&i.remove()}))}),20)}return}const t=i.getParent(),o=Qy(),l=i.getTextContentSize(),c=cg(),u=i.getKey();if(i.isToken()||null!==c&&u===c&&!s||zy(o)&&(null!==t&&!t.canInsertTextBefore()&&0===o.anchor.offset||o.anchor.key===e.__key&&0===o.anchor.offset&&!i.canInsertTextBefore()&&!s||o.focus.key===e.__key&&o.focus.offset===l&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const d=Zy();if(!zy(d)||null===n||null===r)return void i.setTextContent(a);if(d.setTextNodeRange(i,n,i,r),i.isSegmented()){const e=Py(i.getTextContent());i.replace(e),i=e}i.setTextContent(a)}}}function Cg(e){return"ArrowLeft"===e}function Tg(e){return"ArrowRight"===e}function Pg(e,t){return Yp?e:t}function Rg(e){return"Enter"===e}function Og(e){return"Backspace"===e}function Ag(e){return"Delete"===e}function Ng(e,t,n){return"a"===e.toLowerCase()&&Pg(t,n)}function Mg(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(void 0!==r)return r;const o=e[t];if("string"==typeof o){const e=jm(o);return n[t]=e,e}return o}function jg(e,t,n,r,o){if(0===n.size)return;const i=r.__type,s=r.__key,a=t.get(i);void 0===a&&Mm(33,i);const l=a.klass;let c=e.get(l);void 0===c&&(c=new Map,e.set(l,c));const u=c.get(s),d="destroyed"===u&&"created"===o;(void 0===u||d)&&c.set(s,d?"updated":o)}function Ig(e,t,n){const r=e.getParent();let o=n,i=e;return null!==r&&(t&&0===n?(o=i.getIndexWithinParent(),i=r):t||n!==i.getChildrenSize()||(o=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(t?o-1:o)}function Dg(e,t){const n=e.offset;if("element"===e.type)return Ig(e.getNode(),t,n);{const r=e.getNode();if(t&&0===n||!t&&n===r.getTextContentSize()){const e=t?r.getPreviousSibling():r.getNextSibling();return null===e?Ig(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function Lg(e){const t=Ug(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function Fg(e,t,n){return kb(e,t,n)}function zg(e){return!jb(e)&&!e.isLastChild()&&!e.isInline()}function Vg(e,t){const n=e._keyToDOMMap.get(t);return void 0===n&&Mm(75,t),n}function Bg(e){const t=e.assignedSlot||e.parentElement;return null!==t&&11===t.nodeType?t.host:t}function Wg(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function Ug(e){const t=e._window;return null===t&&Mm(78),t}function $g(e){return jb(e)||Rb(e)&&e.isShadowRoot()}function Kg(e){const t=gb(),n=e.constructor.getType(),r=t._nodes.get(n);void 0===r&&Mm(97);const o=r.replace;if(null!==o){const t=o(e);return t instanceof e.constructor||Mm(98),t}return e}function Hg(e,t){!jb(e.getParent())||Rb(t)||Nb(t)||Mm(99)}function qg(e){return(Nb(e)||Rb(e)&&!e.canBeEmpty())&&!e.isInline()}function _n(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function Yg(e){return Hp?(e||window).getSelection():null}function Xg(e){return 1===e.nodeType}function Gg(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return null!==e.nodeName.match(t)}function Jg(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return null!==e.nodeName.match(t)}function Zg(e){if(jb(e)||Nb(e)&&!e.isInline())return!0;if(!Rb(e)||$g(e))return!1;const t=e.getFirstChild(),n=null===t||dy(t)||Ry(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Qg(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}const ev=new WeakMap,tv=new Map;function nv(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function rv(e,t,n,r,o,i){let s=e.getFirstChild();for(;null!==s;){const e=s.__key;s.__parent===t&&(Rb(s)&&rv(s,e,n,r,o,i),n.has(e)||i.delete(e),o.push(e)),s=s.getNextSibling()}}let ov,iv,sv,av,lv,cv,uv,dv,fv,hv,pv="",mv="",gv=null,vv="",yv="",bv=!1,xv=!1,wv=null;function _v(e,t){const n=uv.get(e);if(null!==t){const n=Lv(e);n.parentNode===t&&t.removeChild(n)}if(dv.has(e)||iv._keyToDOMMap.delete(e),Rb(n)){const e=Mv(n,uv);Sv(e,0,e.length-1,null)}void 0!==n&&jg(hv,sv,av,n,"destroyed")}function Sv(e,t,n,r){let o=t;for(;o<=n;++o){const t=e[o];void 0!==t&&_v(t,r)}}function kv(e,t){e.setProperty("text-align",t)}const Ev="40px";function Cv(e,t){const n=ov.theme.indent;if("string"==typeof n){const r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||Ev;e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${r})`)}function Tv(e,t){const n=e.style;0===t?kv(n,""):t===hm?kv(n,"left"):t===pm?kv(n,"center"):t===mm?kv(n,"right"):t===gm?kv(n,"justify"):t===vm?kv(n,"start"):t===ym&&kv(n,"end")}function Pv(e,t,n){const r=dv.get(e);void 0===r&&Mm(60);const o=r.createDOM(ov,iv);if(function(e,t,n){const r=n._keyToDOMMap;t["__lexicalKey_"+n._key]=e,r.set(e,t)}(e,o,iv),Ry(r)?o.setAttribute("data-lexical-text","true"):Nb(r)&&o.setAttribute("data-lexical-decorator","true"),Rb(r)){const e=r.__indent,t=r.__size;if(0!==e&&Cv(o,e),0!==t){const e=t-1;!function(e,t,n,r){const o=mv;mv="",Rv(e,n,0,t,r,null),Nv(n,r),mv=o}(Mv(r,dv),e,r,o)}const n=r.__format;0!==n&&Tv(o,n),r.isInline()||Av(null,r,o),zg(r)&&(pv+=xm,yv+=xm)}else{const t=r.getTextContent();if(Nb(r)){const t=r.decorate(iv,ov);null!==t&&Iv(e,t),o.contentEditable="false"}else Ry(r)&&(r.isDirectionless()||(mv+=t));pv+=t,yv+=t}if(null!==t)if(null!=n)t.insertBefore(o,n);else{const e=t.__lexicalLineBreak;null!=e?t.insertBefore(o,e):t.appendChild(o)}return jg(hv,sv,av,r,"created"),o}function Rv(e,t,n,r,o,i){const s=pv;pv="";let a=n;for(;a<=r;++a){Pv(e[a],o,i);const t=dv.get(e[a]);null!==t&&Ry(t)&&(null===gv&&(gv=t.getFormat()),""===vv&&(vv=t.getStyle()))}zg(t)&&(pv+=xm),o.__lexicalTextContent=pv,pv=s+pv}function Ov(e,t){const n=t.get(e);return dy(n)||Nb(n)&&n.isInline()}function Av(e,t,n){const r=null!==e&&(0===e.__size||Ov(e.__last,uv)),o=0===t.__size||Ov(t.__last,dv);if(r){if(!o){const e=n.__lexicalLineBreak;if(null!=e)try{n.removeChild(e)}catch(t){if("object"==typeof t&&null!=t){const r=`${t.toString()} Parent: ${n.tagName}, child: ${e.tagName}.`;throw new Error(r)}throw t}n.__lexicalLineBreak=null}}else if(o){const e=document.createElement("br");n.__lexicalLineBreak=e,n.appendChild(e)}}function Nv(e,t){const n=t.__lexicalDirTextContent,r=t.__lexicalDir;if(n!==mv||r!==wv){const n=""===mv,i=n?wv:(o=mv,km.test(o)?"rtl":Em.test(o)?"ltr":null);if(i!==r){const o=t.classList,s=ov.theme;let a=null!==r?s[r]:void 0,l=null!==i?s[i]:void 0;if(void 0!==a){if("string"==typeof a){const e=jm(a);a=s[r]=e}o.remove(...a)}if(null===i||n&&"ltr"===i)t.removeAttribute("dir");else{if(void 0!==l){if("string"==typeof l){const e=jm(l);l=s[i]=e}void 0!==l&&o.add(...l)}t.dir=i}xv||(e.getWritable().__dir=i)}wv=i,t.__lexicalDirTextContent=mv,t.__lexicalDir=i}var o}function Mv(e,t){const n=[];let r=e.__first;for(;null!==r;){const e=t.get(r);void 0===e&&Mm(101),n.push(r),r=e.__next}return n}function jv(e,t){const n=uv.get(e);let r=dv.get(e);void 0!==n&&void 0!==r||Mm(61);const o=bv||cv.has(e)||lv.has(e),i=Vg(iv,e);if(n===r&&!o){if(Rb(n)){const e=i.__lexicalTextContent;void 0!==e&&(pv+=e,yv+=e);const t=i.__lexicalDirTextContent;void 0!==t&&(mv+=t)}else{const e=n.getTextContent();Ry(n)&&!n.isDirectionless()&&(mv+=e),yv+=e,pv+=e}return i}if(n!==r&&o&&jg(hv,sv,av,r,"updated"),r.updateDOM(n,i,ov)){const n=Pv(e,null,null);return null===t&&Mm(62),t.replaceChild(n,i),_v(e,null),n}if(Rb(n)&&Rb(r)){const e=r.__indent;e!==n.__indent&&Cv(i,e);const t=r.__format;t!==n.__format&&Tv(i,t),o&&(function(e,t,n){const r=mv;var o;mv="",gv=null,vv="",function(e,t,n){const r=pv,o=e.__size,i=t.__size;if(pv="",1===o&&1===i){const r=e.__first,o=t.__first;if(r===o)jv(r,n);else{const e=Lv(r),t=Pv(o,null,null);try{n.replaceChild(t,e)}catch(i){if("object"==typeof i&&null!=i){const s=`${i.toString()} Parent: ${n.tagName}, new child: {tag: ${t.tagName} key: ${o}}, old child: {tag: ${e.tagName}, key: ${r}}.`;throw new Error(s)}throw i}_v(r,null)}const s=dv.get(o);Ry(s)&&(null===gv&&(gv=s.getFormat()),""===vv&&(vv=s.getStyle()))}else{const r=Mv(e,uv),s=Mv(t,dv);if(0===o)0!==i&&Rv(s,t,0,i-1,n,null);else if(0===i){if(0!==o){const e=null==n.__lexicalLineBreak;Sv(r,0,o-1,e?null:n),e&&(n.textContent="")}}else!function(e,t,n,r,o,i){const s=r-1,a=o-1;let l,c,u=i.firstChild,d=0,f=0;for(;d<=s&&f<=a;){const e=t[d],r=n[f];if(e===r)u=Dv(jv(r,i)),d++,f++;else{void 0===l&&(l=new Set(t)),void 0===c&&(c=new Set(n));const o=c.has(e),s=l.has(r);if(o)if(s){const e=Vg(iv,r);e===u?u=Dv(jv(r,i)):(null!=u?i.insertBefore(e,u):i.appendChild(e),jv(r,i)),d++,f++}else Pv(r,i,u),f++;else u=Dv(Lv(e)),_v(e,i),d++}const o=dv.get(r);null!==o&&Ry(o)&&(null===gv&&(gv=o.getFormat()),""===vv&&(vv=o.getStyle()))}const h=d>s,p=f>a;if(h&&!p){const t=n[a+1];Rv(n,e,f,a,i,void 0===t?null:iv.getElementByKey(t))}else p&&!h&&Sv(t,d,s,i)}(t,r,s,o,i,n)}zg(t)&&(pv+=xm),n.__lexicalTextContent=pv,pv=r+pv}(e,t,n),Nv(t,n),Wb(o=t)&&null!=gv&&gv!==o.__textFormat&&!xv&&(o.setTextFormat(gv),o.setTextStyle(vv)),function(e){Wb(e)&&""!==vv&&vv!==e.__textStyle&&!xv&&e.setTextStyle(vv)}(t),mv=r}(n,r,i),jb(r)||r.isInline()||Av(n,r,i)),zg(r)&&(pv+=xm,yv+=xm)}else{const t=r.getTextContent();if(Nb(r)){const t=r.decorate(iv,ov);null!==t&&Iv(e,t)}else Ry(r)&&!r.isDirectionless()&&(mv+=t);pv+=t,yv+=t}if(!xv&&jb(r)&&r.__cachedText!==yv){const e=r.getWritable();e.__cachedText=yv,r=e}return i}function Iv(e,t){let n=iv._pendingDecorators;const r=iv._decorators;if(null===n){if(r[e]===t)return;n=hg(iv)}n[e]=t}function Dv(e){let t=e.nextSibling;return null!==t&&t===iv._blockCursorElement&&(t=t.nextSibling),t}function Lv(e){const t=fv.get(e);return void 0===t&&Mm(75,e),t}const Fv=Object.freeze({}),zv=[["keydown",function(e,t){if(Vv=e.timeStamp,Bv=e.key,t.isComposing())return;const{key:n,shiftKey:r,ctrlKey:o,metaKey:i,altKey:s}=e;Fg(t,bp,e)||null!=n&&(function(e,t,n,r){return Tg(e)&&!t&&!r&&!n}(n,o,s,i)?Fg(t,xp,e):function(e,t,n,r,o){return Tg(e)&&!r&&!n&&(t||o)}(n,o,r,s,i)?Fg(t,wp,e):function(e,t,n,r){return Cg(e)&&!t&&!r&&!n}(n,o,s,i)?Fg(t,_p,e):function(e,t,n,r,o){return Cg(e)&&!r&&!n&&(t||o)}(n,o,r,s,i)?Fg(t,Sp,e):function(e,t,n){return function(e){return"ArrowUp"===e}(e)&&!t&&!n}(n,o,i)?Fg(t,kp,e):function(e,t,n){return function(e){return"ArrowDown"===e}(e)&&!t&&!n}(n,o,i)?Fg(t,Ep,e):function(e,t){return Rg(e)&&t}(n,r)?(qv=!0,Fg(t,Cp,e)):function(e){return" "===e}(n)?Fg(t,Tp,e):function(e,t){return Yp&&t&&"o"===e.toLowerCase()}(n,o)?(e.preventDefault(),qv=!0,Fg(t,cp,!0)):function(e,t){return Rg(e)&&!t}(n,r)?(qv=!1,Fg(t,Cp,e)):function(e,t,n,r){return Yp?!t&&!n&&(Og(e)||"h"===e.toLowerCase()&&r):!(r||t||n)&&Og(e)}(n,s,i,o)?Og(n)?Fg(t,Pp,e):(e.preventDefault(),Fg(t,lp,!0)):function(e){return"Escape"===e}(n)?Fg(t,Rp,e):function(e,t,n,r,o){return Yp?!(n||r||o)&&(Ag(e)||"d"===e.toLowerCase()&&t):!(t||r||o)&&Ag(e)}(n,o,r,s,i)?Ag(n)?Fg(t,Op,e):(e.preventDefault(),Fg(t,lp,!1)):function(e,t,n){return Og(e)&&(Yp?t:n)}(n,s,o)?(e.preventDefault(),Fg(t,pp,!0)):function(e,t,n){return Ag(e)&&(Yp?t:n)}(n,s,o)?(e.preventDefault(),Fg(t,pp,!1)):function(e,t){return Yp&&t&&Og(e)}(n,i)?(e.preventDefault(),Fg(t,mp,!0)):function(e,t){return Yp&&t&&Ag(e)}(n,i)?(e.preventDefault(),Fg(t,mp,!1)):function(e,t,n,r){return"b"===e.toLowerCase()&&!t&&Pg(n,r)}(n,s,i,o)?(e.preventDefault(),Fg(t,gp,"bold")):function(e,t,n,r){return"u"===e.toLowerCase()&&!t&&Pg(n,r)}(n,s,i,o)?(e.preventDefault(),Fg(t,gp,"underline")):function(e,t,n,r){return"i"===e.toLowerCase()&&!t&&Pg(n,r)}(n,s,i,o)?(e.preventDefault(),Fg(t,gp,"italic")):function(e,t,n,r){return"Tab"===e&&!t&&!n&&!r}(n,s,o,i)?Fg(t,Ap,e):function(e,t,n,r){return"z"===e.toLowerCase()&&!t&&Pg(n,r)}(n,r,i,o)?(e.preventDefault(),Fg(t,vp,void 0)):function(e,t,n,r){return Yp?"z"===e.toLowerCase()&&n&&t:"y"===e.toLowerCase()&&r||"z"===e.toLowerCase()&&r&&t}(n,r,i,o)?(e.preventDefault(),Fg(t,yp,void 0)):By(t._editorState._selection)?function(e,t,n,r){return!t&&"c"===e.toLowerCase()&&(Yp?n:r)}(n,r,i,o)?(e.preventDefault(),Fg(t,Dp,e)):function(e,t,n,r){return!t&&"x"===e.toLowerCase()&&(Yp?n:r)}(n,r,i,o)?(e.preventDefault(),Fg(t,Lp,e)):Ng(n,i,o)&&(e.preventDefault(),Fg(t,Fp,e)):!Xp&&Ng(n,i,o)&&(e.preventDefault(),Fg(t,Fp,e)),function(e,t,n,r){return e||t||n||r}(o,r,s,i)&&Fg(t,Kp,e))}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;n instanceof Node&&"touch"!==r&&Tb(t,(()=>{Nb(fg(n))||(Hv=!0)}))}],["compositionstart",function(e,t){Tb(t,(()=>{const n=Zy();if(zy(n)&&!t.isComposing()){const r=n.anchor,o=n.anchor.getNode();lg(r.key),(e.timeStamp{ey(t,e.data)}))}],["input",function(e,t){e.stopPropagation(),Tb(t,(()=>{const n=Zy(),r=e.data,o=Qv(e);if(null!=r&&zy(n)&&Gv(n,o,r,e.timeStamp,!1)){Yv&&(ey(t,r),Yv=!1);const o=n.anchor.getNode(),i=Yg(t._window);if(null===i)return;const s=n.isBackward(),a=s?n.anchor.offset:n.focus.offset,l=s?n.focus.offset:n.anchor.offset;Gp&&!n.isCollapsed()&&Ry(o)&&null!==i.anchorNode&&o.getTextContent().slice(0,a)+r+o.getTextContent().slice(a+l)===Sg(i.anchorNode)||Fg(t,dp,r);const c=r.length;Xp&&c>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=c),Jp||Zp||nm||!t.isComposing()||(Vv=0,lg(null))}else kg(!1,t,null!==r?r:void 0),Yv&&(ey(t,r||void 0),Yv=!1);hb(),Um(gb())})),Uv=null}],["click",function(e,t){Tb(t,(()=>{const n=Zy(),r=Yg(t._window),o=Qy();if(r)if(zy(n)){const t=n.anchor,i=t.getNode();"element"===t.type&&0===t.offset&&n.isCollapsed()&&!jb(i)&&1===mg().getChildrenSize()&&i.getTopLevelElementOrThrow().isEmpty()&&null!==o&&n.is(o)?(r.removeAllRanges(),n.dirty=!0):3!==e.detail||n.isCollapsed()||i!==n.focus.getNode()&&(Rb(i)?i.select(0):i.getParentOrThrow().select(0))}else if("touch"===e.pointerType){const n=r.anchorNode;if(null!==n){const i=n.nodeType;i!==rm&&i!==om||vg(Jy(o,r,t,e))}}Fg(t,ap,e)}))}],["cut",Fv],["copy",Fv],["dragstart",Fv],["dragover",Fv],["dragend",Fv],["paste",Fv],["focus",Fv],["blur",Fv],["drop",Fv]];Gp&&zv.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType,r=Qv(e);"deleteCompositionText"===n||Xp&&Lg(t)||"insertCompositionText"!==n&&Tb(t,(()=>{const o=Zy();if("deleteContentBackward"===n){if(null===o){const e=Qy();if(!zy(e))return;vg(e.clone())}if(zy(o)){const n=o.anchor.key===o.focus.key;if(i=e.timeStamp,"MediaLast"===Bv&&i{Tb(t,(()=>{lg(null)}))}),30),zy(o)){const e=o.anchor.getNode();e.markDirty(),o.format=e.getFormat(),Ry(e)||Mm(142),o.style=e.getStyle()}}else{lg(null),e.preventDefault();const r=o.anchor.getNode().getTextContent(),i=0===o.anchor.offset&&o.focus.offset===r.length;tm&&n&&!i||Fg(t,lp,!0)}return}}var i;if(!zy(o))return;const s=e.data;null!==Uv&&kg(!1,t,Uv),o.dirty&&null===Uv||!o.isCollapsed()||jb(o.anchor.getNode())||null===r||o.applyDOMRange(r),Uv=null;const a=o.anchor,l=o.focus,c=a.getNode(),u=l.getNode();if("insertText"!==n&&"insertTranspose"!==n)switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Fg(t,dp,e);break;case"insertFromComposition":lg(null),Fg(t,dp,e);break;case"insertLineBreak":lg(null),Fg(t,cp,!1);break;case"insertParagraph":lg(null),qv&&!Zp?(qv=!1,Fg(t,cp,!1)):Fg(t,up,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Fg(t,fp,e);break;case"deleteByComposition":(function(e,t){return e!==t||Rb(e)||Rb(t)||!e.isToken()||!t.isToken()})(c,u)&&Fg(t,hp,e);break;case"deleteByDrag":case"deleteByCut":Fg(t,hp,e);break;case"deleteContent":Fg(t,lp,!1);break;case"deleteWordBackward":Fg(t,pp,!0);break;case"deleteWordForward":Fg(t,pp,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Fg(t,mp,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Fg(t,mp,!1);break;case"formatStrikeThrough":Fg(t,gp,"strikethrough");break;case"formatBold":Fg(t,gp,"bold");break;case"formatItalic":Fg(t,gp,"italic");break;case"formatUnderline":Fg(t,gp,"underline");break;case"historyUndo":Fg(t,vp,void 0);break;case"historyRedo":Fg(t,yp,void 0)}else{if("\n"===s)e.preventDefault(),Fg(t,cp,!1);else if(s===xm)e.preventDefault(),Fg(t,up,void 0);else if(null==s&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(t)}else null!=s&&Gv(o,r,s,e.timeStamp,!0)?(e.preventDefault(),Fg(t,dp,s)):Uv=s;Wv=e.timeStamp}}))}(e,t)]);let Vv=0,Bv=null,Wv=0,Uv=null;const $v=new WeakMap;let Kv=!1,Hv=!1,qv=!1,Yv=!1,Xv=[0,"",0,"root",0];function Gv(e,t,n,r,o){const i=e.anchor,s=e.focus,a=i.getNode(),l=gb(),c=Yg(l._window),u=null!==c?c.anchorNode:null,d=i.key,f=l.getElementByKey(d),h=n.length;return d!==s.key||!Ry(a)||(!o&&(!Gp||Wv1||(o||!Gp)&&null!==f&&!a.isComposing()&&u!==og(f)||null!==c&&null!==t&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;const n=e.anchor.offset,r=t.getParentOrThrow(),o=t.isToken();return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||o||function(e){const t=e.getPreviousSibling();return(Ry(t)||Rb(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||o)}(e,a)}function Jv(e,t){return null!==e&&null!==e.nodeValue&&e.nodeType===om&&0!==t&&t!==e.nodeValue.length}function Zv(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=e;Kv&&(Kv=!1,Jv(r,o)&&Jv(i,s))||Tb(t,(()=>{if(!n)return void vg(null);if(!Zm(t,r,i))return;const a=Zy();if(zy(a)){const n=a.anchor,r=n.getNode();if(a.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(a.dirty=!0);const o=Ug(t).event,i=o?o.timeStamp:performance.now(),[s,l,c,u,d]=Xv,f=mg(),h=!1===t.isComposing()&&""===f.getTextContent();if(i{const t=Qy(),o=n.anchorNode;if(null===o)return;const i=o.nodeType;i!==rm&&i!==om||vg(Jy(t,n,r,e))})));const o=wg(r),i=o[o.length-1],s=i._key,a=ny.get(s),l=a||i;l!==r&&Zv(n,l,!1),Zv(n,r,!0),r!==i?ny.set(s,r):a&&ny.delete(s)}function oy(e){e._lexicalHandled=!0}function iy(e){return!0===e._lexicalHandled}function sy(e,t,n){hb();const r=e.__key,o=e.getParent();if(null===o)return;const i=function(e){const t=Zy();if(!zy(t)||!Rb(e))return t;const{anchor:n,focus:r}=t,o=n.getNode(),i=r.getNode();return Wg(o,e)&&n.set(e.__key,0,"element"),Wg(i,e)&&r.set(e.__key,0,"element"),t}(e);let s=!1;if(zy(i)&&t){const t=i.anchor,n=i.focus;t.key===r&&(nb(t,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0),n.key===r&&(nb(n,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else By(i)&&t&&e.isSelected()&&e.selectPrevious();if(zy(i)&&t&&!s){const t=e.getIndexWithinParent();sg(e),eb(i,o,t,-1)}else sg(e);n||$g(o)||o.canBeEmpty()||!o.isEmpty()||sy(o,t),t&&jb(o)&&o.isEmpty()&&o.selectEnd()}class ay{static getType(){Mm(64,this.name)}static clone(e){Mm(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,function(e,t){if(null!=t)return void(e.__key=t);hb(),pb();const n=gb(),r=mb(),o=""+Xm++;r._nodeMap.set(o,e),Rb(e)?n._dirtyElements.set(o,!0):n._dirtyLeaves.add(o),n._cloneNotNeeded.add(o),n._dirtyType=1,e.__key=o}(this,e)}getType(){return this.__type}isInline(){Mm(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=ug(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){const t=e||Zy();if(null==t)return!1;const n=t.getNodes().some((e=>e.__key===this.__key));if(Ry(this))return n;if(zy(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;const e=this.getParent();if(Nb(this)&&this.isInline()&&e){const n=t.isBackward()?t.focus:t.anchor,r=n.getNode();if(n.offset===r.getChildrenSize()&&r.is(e)&&r.getLastChildOrThrow().is(this))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(null===e)return-1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return null===e?null:ug(e)}getParentOrThrow(){const e=this.getParent();return null===e&&Mm(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){const t=e.getParent();if($g(t))return Rb(e)||e===this&&Nb(e)||Mm(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return null===e&&Mm(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return null===e?null:ug(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return null===e?null:ug(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),n=e.getParents();Rb(this)&&t.unshift(this),Rb(e)&&n.unshift(e);const r=t.length,o=n.length;if(0===r||0===o||t[r-1]!==n[o-1])return null;const i=new Set(n);for(let e=0;e{s.append(e)}))),zy(n)){vg(n);const e=n.anchor,t=n.focus;e.key===o&&Dy(e,s),t.key===o&&Dy(t,s)}return cg()===o&&lg(i),s}insertAfter(e,t=!0){hb(),Hg(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.getParent(),i=Zy();let s=!1,a=!1;if(null!==o){const t=e.getIndexWithinParent();if(sg(r),zy(i)){const e=o.__key,n=i.anchor,r=i.focus;s="element"===n.type&&n.key===e&&n.offset===t+1,a="element"===r.type&&r.key===e&&r.offset===t+1}}const l=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(null===l?c.__last=u:l.getWritable().__prev=u,c.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&zy(i)){const e=this.getIndexWithinParent();eb(i,c,e+1);const t=c.__key;s&&i.anchor.set(t,e+2,"element"),a&&i.focus.set(t,e+2,"element")}return e}insertBefore(e,t=!0){hb(),Hg(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.__key;sg(r);const i=this.getPreviousSibling(),s=this.getParentOrThrow().getWritable(),a=n.__prev,l=this.getIndexWithinParent();null===i?s.__first=o:i.getWritable().__next=o,s.__size++,n.__prev=o,r.__prev=a,r.__next=n.__key,r.__parent=n.__parent;const c=Zy();return t&&zy(c)&&eb(c,this.getParentOrThrow(),l),e}isParentRequired(){return!1}createParentElementNode(){return Bb()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){hb();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(Rb(n))return n.select();if(!Ry(n)){const e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){hb();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(Rb(n))return n.select(0,0);if(!Ry(n)){const e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}}class ly extends ay{static getType(){return"linebreak"}static clone(e){return new ly(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(e){const t=e.parentElement;if(null!==t&&Jg(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&fy(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&fy(n))return!0}}return!1}(e)||function(e){const t=e.parentElement;if(null!==t&&Jg(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&fy(n))return!1;const r=t.lastChild;if(r===e||r.previousSibling===e&&fy(r))return!0}return!1}(e)?null:{conversion:cy,priority:0}}}static importJSON(e){return uy()}exportJSON(){return{type:"linebreak",version:1}}}function cy(e){return{node:uy()}}function uy(){return Kg(new ly)}function dy(e){return e instanceof ly}function fy(e){return e.nodeType===om&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function hy(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function py(e,t){return 1&t?"strong":2&t?"em":"span"}function my(e,t,n,r,o){const i=r.classList;let s=Mg(o,"base");void 0!==s&&i.add(...s),s=Mg(o,"underlineStrikethrough");let a=!1;const l=t&dm&&t&um;void 0!==s&&(n&dm&&n&um?(a=!0,l||i.add(...s)):l&&i.remove(...s));for(const e in Cm){const r=Cm[e];if(s=Mg(o,e),void 0!==s)if(n&r){if(a&&("underline"===e||"strikethrough"===e)){t&r&&i.remove(...s);continue}t&r&&(!l||"underline"!==e)&&"strikethrough"!==e||i.add(...s)}else t&r&&i.remove(...s)}}function gy(e,t,n){const r=t.firstChild,o=n.isComposing(),i=e+(o?bm:"");if(null==r)t.textContent=i;else{const e=r.nodeValue;if(e!==i)if(o||Xp){const[t,n,o]=function(e,t){const n=e.length,r=t.length;let o=0,i=0;for(;o({conversion:ky,priority:0}),b:()=>({conversion:wy,priority:0}),code:()=>({conversion:Ty,priority:0}),em:()=>({conversion:Ty,priority:0}),i:()=>({conversion:Ty,priority:0}),s:()=>({conversion:Ty,priority:0}),span:()=>({conversion:xy,priority:0}),strong:()=>({conversion:Ty,priority:0}),sub:()=>({conversion:Ty,priority:0}),sup:()=>({conversion:Ty,priority:0}),u:()=>({conversion:Ty,priority:0})}}static importJSON(e){const t=Py(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return null!==t&&Xg(t)||Mm(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=yy(t,"b")),this.hasFormat("italic")&&(t=yy(t,"i")),this.hasFormat("strikethrough")&&(t=yy(t,"s")),this.hasFormat("underline")&&(t=yy(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format="string"==typeof e?Cm[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail="string"==typeof e?Tm[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=ig(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=Om[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){hb();let n=e,r=t;const o=Zy(),i=this.getTextContent(),s=this.__key;if("string"==typeof i){const e=i.length;void 0===n&&(n=e),void 0===r&&(r=e)}else n=0,r=0;if(!zy(o))return Xy(s,n,s,r,"text","text");{const e=cg();e!==o.anchor.key&&e!==o.focus.key||lg(s),o.setTextNodeRange(this,n,this,r)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){const o=this.getWritable(),i=o.__text,s=n.length;let a=e;a<0&&(a=s+a,a<0&&(a=0));const l=Zy();if(r&&zy(l)){const t=e+s;l.setTextNodeRange(o,t,o,t)}const c=i.slice(0,a)+n+i.slice(a+t);return o.__text=c,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){hb();const t=this.getLatest(),n=t.getTextContent(),r=t.__key,o=cg(),i=new Set(e),s=[],a=n.length;let l="";for(let e=0;eb&&e.offset<=l&&(e.key=a,e.offset-=b,v.dirty=!0),t.key===r&&"text"===t.type&&t.offset>b&&t.offset<=l&&(t.key=a,t.offset-=b,v.dirty=!0)}o===r&&lg(a),b=l,y.push(i)}if(null!==d){!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&ag(t),null!==n&&ag(n)}(this);const e=d.getWritable(),t=this.getIndexWithinParent();g?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),zy(v)&&eb(v,d,t,c-1)}return y}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||Mm(50);const n=this.__key,r=e.__key,o=this.__text,i=o.length;cg()===r&&lg(n);const s=Zy();if(zy(s)){const o=s.anchor,a=s.focus;null!==o&&o.key===r&&(rb(o,t,n,e,i),s.dirty=!0),null!==a&&a.key===r&&(rb(a,t,n,e,i),s.dirty=!0)}const a=e.__text,l=t?a+o:o+a;this.setTextContent(l);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function xy(e){return{forChild:Oy(e.style),node:null}}function wy(e){const t=e,n="normal"===t.style.fontWeight;return{forChild:Oy(t.style,n?void 0:"bold"),node:null}}const _y=new WeakMap;function Sy(e){return"PRE"===e.nodeName||e.nodeType===rm&&void 0!==e.style&&void 0!==e.style.whiteSpace&&e.style.whiteSpace.startsWith("pre")}function ky(e){const t=e;null===e.parentElement&&Mm(129);let n=t.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=_y.get(n))&&!Sy(n);)r.push(n),n=n.parentNode;const o=void 0===t?n:t;for(let e=0;e0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(" "===n[n.length-1]){let e=t,r=!0;for(;null!==e&&null!==(e=Ey(e,!0));)if((e.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:Py(n)}}function Ey(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){const e=n.parentElement;if(null===e)return null;n=e}if(n=e,n.nodeType===rm){const e=n.style.display;if(""===e&&!Gg(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(n.nodeType===om)return n;if("BR"===n.nodeName)return null}}const Cy={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Ty(e){const t=Cy[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:Oy(e.style,t),node:null}}function Py(e=""){return Kg(new by(e))}function Ry(e){return e instanceof by}function Oy(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),o="700"===n||"bold"===n,i=r.includes("line-through"),s="italic"===e.fontStyle,a=r.includes("underline"),l=e.verticalAlign;return e=>Ry(e)?(o&&!e.hasFormat("bold")&&e.toggleFormat("bold"),i&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),s&&!e.hasFormat("italic")&&e.toggleFormat("italic"),a&&!e.hasFormat("underline")&&e.toggleFormat("underline"),"sub"!==l||e.hasFormat("subscript")||e.toggleFormat("subscript"),"super"!==l||e.hasFormat("superscript")||e.toggleFormat("superscript"),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}class Ay extends by{static getType(){return"tab"}static clone(e){return new Ay(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=Ny();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){Mm(126)}setDetail(e){Mm(127)}setMode(e){Mm(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Ny(){return Kg(new Ay)}class My{constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),n=e.getNode();const r=this.offset,o=e.offset;if(Rb(t)){const e=t.getDescendantByIndex(r);t=null!=e?e:t}if(Rb(n)){const e=n.getDescendantByIndex(o);n=null!=e?e:n}return t===n?re&&(r=e)}else if(!Rb(t)){const e=t.getNextSibling();if(Ry(e))n=e.__key,r=0,o="text";else{const e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,o)}function Dy(e,t){if(Rb(t)){const n=t.getLastDescendant();Rb(n)||Ry(n)?Iy(e,n):Iy(e,t)}else Iy(e,t)}function Ly(e,t,n,r){e.key=t,e.offset=n,e.type=r}class Fy{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!By(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((e=>n.has(e)))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new Fy(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),n=t.length,r=t[n-1];let o;if(Ry(r))o=r.select();else{const e=r.getIndexWithinParent()+1;o=r.getParentOrThrow().select(e,e)}o.insertNodes(e);for(let e=0;e0?[]:[s]:s.getNodesBetween(a),fb()||(this._cachedNodes=u),u}setTextNodeRange(e,t,n,r){Ly(this.anchor,e.__key,t,"text"),Ly(this.focus,n.__key,r,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(0===e.length)return"";const t=e[0],n=e[e.length-1],r=this.anchor,o=this.focus,i=r.isBefore(o),[s,a]=Uy(this);let l="",c=!0;for(let u=0;u=0;e--){const t=i[e];if(t.is(d)||Rb(t)&&t.isParentOf(d))break;t.isAttached()&&(!h.has(t)||t.is(o)?m||g.insertAfter(t,!1):t.remove())}if(!m){let e=r,n=null;for(;null!==e;){const r=e.getChildren(),o=r.length;(0===o||r[o-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(d.isToken())if(a===f)d.select();else{const t=Py(e);t.select(),d.replace(t)}else d=d.spliceText(a,f-a,e,!0),""===d.getTextContent()?d.remove():d.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length);for(let e=1;e0&&(m===p.getTextContentSize()||ng(p)||([p]=p.splitText(m)),p.setFormat(g));for(let t=c+1;t(Rb(e)||Nb(e))&&!e.isInline()))){Rb(t)||Mm(135);const r=ob(this);return t.splice(r,0,e),void n.selectEnd()}const r=function(e){const t=Bb();let n=null;for(let r=0;rl?l:a,t=a>l?a:l,n=i.splitText(e,t),r=0===e?n[0]:n[1];return null!=r?[r]:[]}return[i]}const c=r.isBefore(o);if(Ry(i)){const t=c?a:l;t===i.getTextContentSize()?e.shift():0!==t&&([,i]=i.splitText(t),e[0]=i)}if(Ry(s)){const t=s.getTextContent().length,r=c?l:a;0===r?e.pop():r!==t&&([s]=s.splitText(r),e[n]=s)}return e}modify(e,t,n){const r=this.focus,o=this.anchor,i="move"===e,s=Dg(r,t);if(Nb(s)&&!s.isIsolated()){if(i&&s.isKeyboardSelectable()){const e=Gy();return e.add(s.__key),void vg(e)}const e=t?s.getPreviousSibling():s.getNextSibling();if(Ry(e)){const n=e.__key,s=t?e.getTextContent().length:0;return r.set(n,s,"text"),void(i&&o.set(n,s,"text"))}{const n=s.getParentOrThrow();let a,l;return Rb(e)?(l=e.__key,a=t?e.getChildrenSize():0):(a=s.getIndexWithinParent(),l=n.__key,t||a++),r.set(l,a,"element"),void(i&&o.set(l,a,"element"))}}const a=gb(),l=Yg(a._window);if(!l)return;const c=a._blockCursorElement,u=a._rootElement;if(null===u||null===c||!Rb(s)||s.isInline()||s.canBeEmpty()||_n(c,a,u),function(e,t,n,r){e.modify(t,n,r)}(l,e,t?"backward":"forward",n),l.rangeCount>0){const e=l.getRangeAt(0),n=this.anchor.getNode(),r=jb(n)?n:function(e){let t=e.getParentOrThrow();for(;null!==t;){if($g(t))return t;t=t.getParentOrThrow()}return t}(n);if(this.applyDOMRange(e),this.dirty=!0,!i){const n=this.getNodes(),o=[];let i=!1;for(let e=0;e0)if(t){const e=o[0];Rb(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{const e=o[o.length-1];Rb(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}l.anchorNode===e.startContainer&&l.anchorOffset===e.startOffset||function(e){const t=e.focus,n=e.anchor,r=n.key,o=n.offset,i=n.type;Ly(n,t.key,t.offset,t.type),Ly(t,r,o,i),e._cachedNodes=null}(this)}}}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&Rb(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){const e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(Rb(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const t=this.anchor;let n=t.getNode();if(this.forwardDeletion(t,n,e))return;const r=this.focus,o=Dg(r,e);if(Nb(o)&&!o.isIsolated()){if(o.isKeyboardSelectable()&&Rb(n)&&0===n.getChildrenSize()){n.remove();const e=Gy();e.add(o.__key),vg(e)}else o.remove(),gb().dispatchCommand(sp,void 0);return}if(!e&&Rb(o)&&Rb(n)&&n.isEmpty())return n.remove(),void o.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===t.offset&&("element"===t.type?t.getNode():t.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const o="text"===r.type?r.getNode():null;if(n="text"===t.type?t.getNode():null,null!==o&&o.isSegmented()){const t=r.offset,i=o.getTextContentSize();if(o.is(n)||e&&t!==i||!e&&0!==t)return void $y(o,e,t)}else if(null!==n&&n.isSegmented()){const r=t.offset,i=n.getTextContentSize();if(n.is(o)||e&&0!==r||!e&&r!==i)return void $y(n,e,r)}!function(e,t){const n=e.anchor,r=e.focus,o=n.getNode();if(o===r.getNode()&&"text"===n.type&&"text"===r.type){const e=n.offset,i=r.offset,s=en||r){o.splice(e,1),r&&(a=void 0);break}}const l=o.join("").trim();""===l?r.remove():(r.setTextContent(l),r.select(a,a))}function Ky(e,t,n,r){let o,i=t;if(e.nodeType===rm){let s=!1;const a=e.childNodes,l=a.length,c=r._blockCursorElement;i===l&&(s=!0,i=l-1);let u=a[i],d=!1;if(u===c)u=a[i+1],d=!0;else if(null!==c){const n=c.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,c)&&i--}if(o=yg(u),Ry(o))i=bg(o,s);else{let r=yg(e);if(null===r)return null;if(Rb(r)){i=Math.min(r.getChildrenSize(),i);let e=r.getChildAtIndex(i);if(Rb(e)&&function(e,t,n){const r=e.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(e,0,n)){const t=s?e.getLastDescendant():e.getFirstDescendant();null===t?r=e:(e=t,r=Rb(e)?e:e.getParentOrThrow()),i=0}Ry(e)?(o=e,r=null,i=bg(e,s)):e!==r&&s&&!d&&i++}else{const n=r.getIndexWithinParent();i=0===t&&Nb(r)&&yg(e)===r?n:n+1,r=r.getParentOrThrow()}if(Rb(r))return jy(r.__key,i,"element")}}else o=yg(e);return Ry(o)?jy(o.__key,i,"text"):null}function Hy(e,t,n){const r=e.offset,o=e.getNode();if(0===r){const r=o.getPreviousSibling(),i=o.getParent();if(t){if((n||!t)&&null===r&&Rb(i)&&i.isInline()){const t=i.getPreviousSibling();Ry(t)&&(e.key=t.__key,e.offset=t.getTextContent().length)}}else Rb(r)&&!n&&r.isInline()?(e.key=r.__key,e.offset=r.getChildrenSize(),e.type="element"):Ry(r)&&(e.key=r.__key,e.offset=r.getTextContent().length)}else if(r===o.getTextContent().length){const r=o.getNextSibling(),i=o.getParent();if(t&&Rb(r)&&r.isInline())e.key=r.__key,e.offset=0,e.type="element";else if((n||t)&&null===r&&Rb(i)&&i.isInline()&&!i.canInsertTextAfter()){const t=i.getNextSibling();Ry(t)&&(e.key=t.__key,e.offset=0)}}}function qy(e,t,n){if("text"===e.type&&"text"===t.type){const r=e.isBefore(t),o=e.is(t);Hy(e,r,o),Hy(t,!r,o),o&&(t.key=e.key,t.offset=e.offset,t.type=e.type);const i=gb();if(i.isComposing()&&i._compositionKey!==e.key&&zy(n)){const r=n.anchor,o=n.focus;Ly(e,r.key,r.offset,r.type),Ly(t,o.key,o.offset,o.type)}}}function Yy(e,t,n,r,o,i){if(null===e||null===n||!Zm(o,e,n))return null;const s=Ky(e,t,zy(i)?i.anchor:null,o);if(null===s)return null;const a=Ky(n,r,zy(i)?i.focus:null,o);if(null===a)return null;if("element"===s.type&&"element"===a.type){const t=yg(e),r=yg(n);if(Nb(t)&&Nb(r))return null}return qy(s,a,i),[s,a]}function Xy(e,t,n,r,o,i){const s=mb(),a=new Vy(jy(e,t,o),jy(n,r,i),0,"");return a.dirty=!0,s._selection=a,a}function Gy(){return new Fy(new Set)}function Jy(e,t,n,r){const o=n._window;if(null===o)return null;const i=r||o.event,s=i?i.type:void 0,a="selectionchange"===s,l=!Dm&&(a||"beforeinput"===s||"compositionstart"===s||"compositionend"===s||"click"===s&&i&&3===i.detail||"drop"===s||void 0===s);let c,u,d,f;if(zy(e)&&!l)return e.clone();if(null===t)return null;if(c=t.anchorNode,u=t.focusNode,d=t.anchorOffset,f=t.focusOffset,a&&zy(e)&&!Zm(n,c,u))return e.clone();const h=Yy(c,d,u,f,n,e);if(null===h)return null;const[p,m]=h;return new Vy(p,m,zy(e)?e.format:0,zy(e)?e.style:"")}function Zy(){return mb()._selection}function Qy(){return gb()._editorState._selection}function eb(e,t,n,r=1){const o=e.anchor,i=e.focus,s=o.getNode(),a=i.getNode();if(!t.is(s)&&!t.is(a))return;const l=t.__key;if(e.isCollapsed()){const t=o.offset;if(n<=t&&r>0||n0||n0||n=e,s=o?i.getChildAtIndex(e-1):i.getChildAtIndex(n);if(Ry(s)){let e=0;o&&(e=s.getTextContentSize()),t.set(s.__key,e,"text"),r.set(s.__key,e,"text")}}else{if(Rb(i)){const e=i.getChildrenSize(),r=n>=e,o=r?i.getChildAtIndex(e-1):i.getChildAtIndex(n);if(Ry(o)){let e=0;r&&(e=o.getTextContentSize()),t.set(o.__key,e,"text")}}if(Rb(s)){const e=s.getChildrenSize(),t=o>=e,n=t?s.getChildAtIndex(e-1):s.getChildAtIndex(o);if(Ry(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}}function nb(e,t,n,r,o){let i=null,s=0,a=null;null!==r?(i=r.__key,Ry(r)?(s=r.getTextContentSize(),a="text"):Rb(r)&&(s=r.getChildrenSize(),a="element")):null!==o&&(i=o.__key,Ry(o)?a="text":Rb(o)&&(a="element")),null!==i&&null!==a?e.set(i,s,a):(s=t.getIndexWithinParent(),-1===s&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function rb(e,t,n,r,o){"text"===e.type?(e.key=n,t||(e.offset+=o)):e.offset>r.getIndexWithinParent()&&(e.offset-=1)}function ob(e){let t=e;e.isCollapsed()||t.removeText();const n=Zy();zy(n)&&(t=n),zy(t)||Mm(161);const r=t.anchor;let o=r.getNode(),i=r.offset;for(;!Zg(o);)[o,i]=ib(o,i);return i}function ib(e,t){const n=e.getParent();if(!n){const e=Bb();return mg().append(e),e.select(),[mg(),0]}if(Ry(e)){const r=e.splitText(t);if(0===r.length)return[n,e.getIndexWithinParent()];const o=0===t?0:1;return[n,r[0].getIndexWithinParent()+o]}if(!Rb(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new Vy(jy(e.__key,t,"element"),jy(e.__key,t,"element"),0,""),o=e.insertNewAfter(n);o&&o.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}let sb=null,ab=null,lb=!1,cb=!1,ub=0;const db={characterData:!0,childList:!0,subtree:!0};function fb(){return lb||null!==sb&&sb._readOnly}function hb(){lb&&Mm(13)}function pb(){ub>99&&Mm(14)}function mb(){return null===sb&&Mm(195,vb()),sb}function gb(){return null===ab&&Mm(196,vb()),ab}function vb(){let e=0;const t=new Set,n=Kb.version;if("undefined"!=typeof window)for(const r of document.querySelectorAll("[contenteditable]")){const o=tg(r);if(Qm(o))e++;else if(o){let e=String(o.constructor.version||"<0.17.1");e===n&&(e+=" (separately built, likely a bundler configuration issue)"),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function yb(e,t,n){const r=t.__type,o=function(e,t){const n=e._nodes.get(t);return void 0===n&&Mm(30,t),n}(e,r);let i=n.get(r);void 0===i&&(i=Array.from(o.transforms),n.set(r,i));const s=i.length;for(let e=0;e0?r.getRangeAt(0):null;if(null!==e){let t;if(e instanceof Text){const n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){const r=n.ownerDocument,o=r.defaultView;if(null===o)return;let{top:i,bottom:s}=t,a=0,l=0,c=n;for(;null!==c;){const t=c===r.body;if(t)a=0,l=Ug(e).innerHeight;else{const e=c.getBoundingClientRect();a=e.top,l=e.bottom}let n=0;if(il&&(n=s-l),0!==n)if(t)o.scrollBy(0,n);else{const e=c.scrollTop;c.scrollTop+=n;const t=c.scrollTop-e;i-=t,s-=t}if(t)break;c=Bg(c)}}(n,t,i)}}Kv=!0}}(s,a,e,x,y,r)}(function(e,t,n){let r=e._blockCursorElement;if(zy(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(document.activeElement)){const o=n.anchor,i=o.getNode(),s=o.offset;let a=!1,l=null;if(s===i.getChildrenSize())qg(i.getChildAtIndex(s-1))&&(a=!0);else{const t=i.getChildAtIndex(s);if(qg(t)){const n=t.getPreviousSibling();(null===n||qg(n))&&(a=!0,l=e.getElementByKey(t.__key))}}if(a){const n=e.getElementByKey(i.__key);return null===r&&(e._blockCursorElement=r=function(e){const t=e.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=t.blockCursor;if(void 0!==r){if("string"==typeof r){const e=jm(r);r=t.blockCursor=e}void 0!==r&&n.classList.add(...r)}return n}(e._config)),t.style.caretColor="transparent",void(null===l?n.appendChild(r):n.insertBefore(r,l))}}null!==r&&_n(r,e,t)})(e,r,a),null!==h&&h.observe(r,db)}finally{ab=d,sb=c}}null!==p&&function(e,t,n,r,o){const i=Array.from(e._listeners.mutation),s=i.length;for(let e=0;e{r=kb(e,t,n)})),r}const r=wg(e);for(let o=4;o>=0;o--)for(let i=0;i0||u>0;){if(l>0){t._dirtyLeaves=new Set;for(const e of a){const r=o.get(e);Ry(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&qm(r),void 0!==r&&bb(r,i)&&yb(t,r,s),n.add(e)}if(a=t._dirtyLeaves,l=a.size,l>0){ub++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map;for(const e of c){const n=e[0],a=e[1];if("root"!==n&&!a)continue;const l=o.get(n);void 0!==l&&bb(l,i)&&yb(t,l,s),r.set(n,a)}a=t._dirtyLeaves,l=a.size,c=t._dirtyElements,u=c.size,ub++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),Eb(e),function(e,t,n,r){const o=e._nodeMap,i=t._nodeMap,s=[];for(const[e]of r){const t=i.get(e);void 0!==t&&(t.isAttached()||(Rb(t)&&rv(t,e,o,i,s,r),o.has(e)||r.delete(e),s.push(e)))}for(const e of s)i.delete(e);for(const e of n){const t=i.get(e);void 0===t||t.isAttached()||(o.has(e)||n.delete(e),i.delete(e))}}(l,c,e._dirtyLeaves,e._dirtyElements)),n!==e._compositionKey&&(c._flushSync=!0);const r=c._selection;if(zy(r)){const e=c._nodeMap,t=r.anchor.key,n=r.focus.key;void 0!==e.get(t)&&void 0!==e.get(n)||Mm(19)}else By(r)&&0===r._nodes.size&&(c._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=l,e._dirtyType=sm,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void _b(e)}finally{sb=d,lb=f,ab=h,e._updating=p,ub=0}const m=e._dirtyType!==im||function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(c,e);m?c._flushSync?(c._flushSync=!1,_b(e)):u&&Gm((()=>{_b(e)})):(c._flushSync=!1,u&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Tb(e,t,n){e._updating?e._updates.push([t,n]):Cb(e,t,n)}class Pb extends ay{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Rm[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const e=gb()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;null!==t;){if(Ry(t)&&e.push(t),Rb(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;Rb(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;Rb(e);){const t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const e=t[n-1];return Rb(e)&&e.getLastDescendant()||e||null}const r=t[e];return Rb(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:ug(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&Mm(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:ug(e)}getLastChildOrThrow(){const e=this.getLastChild();return null===e&&Mm(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,r;if(e=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e="";const t=this.getChildren(),n=t.length;for(let r=0;re.remove())),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e?Pm[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){const r=n.length,o=this.getChildrenSize(),i=this.getWritable(),s=i.__key,a=[],l=[],c=this.getChildAtIndex(e+t);let u=null,d=o-t+r;if(0!==e)if(e===o)u=this.getLastChild();else{const t=this.getChildAtIndex(e);null!==t&&(u=t.getPreviousSibling())}if(t>0){let e=null===u?this.getFirstChild():u.getNextSibling();for(let n=0;n({root:Db(mg())})))}}class Fb extends Pb{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class zb extends Pb{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=Cm[e];return!!(this.getTextFormat()&t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new zb(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),n=Mg(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:Vb,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Xg(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n);const r=this.getIndent();r>0&&(t.style.textIndent=20*r+"px")}return{element:t}}static importJSON(e){const t=Bb();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const n=Bb();n.setTextFormat(e.format),n.setTextStyle(e.style);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getTextStyle()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(0===e.length||Ry(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function Vb(e){const t=Bb();if(e.style){t.setFormat(e.style.textAlign);const n=parseInt(e.style.textIndent,10)/20;n>0&&t.setIndent(n)}return{node:t}}function Bb(){return Kg(new zb)}function Wb(e){return e instanceof zb}const Ub=1;function $b(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=Ib(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=im,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const i=e._observer;null!==i&&(i.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",o.set("root",n))}class Kb{constructor(e,t,n,r,o,i,s){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=im,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=_g(),this._onError=o,this._htmlConversions=i,this._editable=s,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){void 0===n&&Mm(35);const r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=r.get(e);void 0===o&&Mm(36,String(e));const i=o[n];return i.add(t),()=>{i.delete(t),o.every((e=>0===e.size))&&r.delete(e)}}registerMutationListener(e,t,n){const r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;o.set(t,r);const i=n&&n.skipInitialization;return void 0===i||i||this.initializeMutationListener(t,r),()=>{o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return void 0===t&&Mm(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const n=this._editorState,r=function(e){if(!e._readOnly&&e.isEmpty())return tv;e._readOnly||Mm(192);let t=ev.get(e);if(!t){t=new Map,ev.set(e,t);for(const[n,r]of e._nodeMap){const e=r.__type;let o=t.get(e);o||(o=new Map,t.set(e,o)),o.set(n,r)}}return t}(n).get(t.getType());if(!r)return;const o=new Map;for(const e of r.keys())o.set(e,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),r=[n],o=n.replaceWithKlass;if(null!=o){const e=this.registerNodeTransformToKlass(o,t);r.push(e)}var i;return i=e.getType(),Tb(this,(()=>{const e=mb();if(e.isEmpty())return;if("root"===i)return void mg().markDirty();const t=e._nodeMap;for(const[,e]of t)e.markDirty()}),null===this._pendingEditorState?{tag:"history-merge"}:void 0),()=>{r.forEach((e=>e.transforms.delete(t)))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return Fg(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=Mg(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,$b(this,t,e,r),null!==t&&(this._config.disableEvents||function(e){const t=e.ownerDocument,n=$v.get(t);void 0===n&&Mm(162);const r=n-1;r>=0||Mm(164),$v.set(t,r),0===r&&t.removeEventListener("selectionchange",ry);const o=tg(e);Qm(o)?(function(e){if(null!==e._parentEditor){const t=wg(e),n=t[t.length-1]._key;ny.get(n)===e&&ny.delete(n)}else ny.delete(e._key)}(o),e.__lexicalEditor=null):o&&Mm(198);const i=ty(e);for(let e=0;e{iy(e)||(oy(e),(t.isEditable()||"click"===r)&&i(e,t))}:e=>{if(iy(e))return;oy(e);const n=t.isEditable();switch(r){case"cut":return n&&Fg(t,Lp,e);case"copy":return Fg(t,Dp,e);case"paste":return n&&Fg(t,fp,e);case"dragstart":return n&&Fg(t,Mp,e);case"dragover":return n&&Fg(t,jp,e);case"dragend":return n&&Fg(t,Ip,e);case"focus":return n&&Fg(t,Up,e);case"blur":return n&&Fg(t,$p,e);case"drop":return n&&Fg(t,Np,e)}};e.addEventListener(r,s),o.push((()=>{e.removeEventListener(r,s)}))}}(e,this),null!=n&&e.classList.add(...n)}else this._editorState=r,this._pendingEditorState=null,this._window=null;Sb("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&Mm(38),Um(this);const n=this._pendingEditorState,r=this._updateTags,o=void 0!==t?t.tag:null;null===n||n.isEmpty()||(null!=o&&r.add(o),_b(this)),this._pendingEditorState=e,this._dirtyType=sm,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=o&&r.add(o),_b(this)}parseEditorState(e,t){return function(e,t,n){const r=Ib(),o=sb,i=lb,s=ab,a=t._dirtyElements,l=t._dirtyLeaves,c=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,sb=r,lb=!1,ab=t;try{const o=t._nodes;xb(e.root,o),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=a,t._dirtyLeaves=l,t._cloneNotNeeded=c,t._dirtyType=u,sb=o,lb=i,ab=s}return r}("string"==typeof e?JSON.parse(e):e,this,t)}read(e){return _b(this),this.getEditorState().read(e,{editor:this})}update(e,t){Tb(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),Tb(this,(()=>{const e=Zy(),n=mg();null!==e?e.dirty=!0:0!==n.getChildrenSize()&&("rootStart"===t.defaultSelection?n.selectStart():n.selectEnd())}),{onUpdate:()=>{n.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;null!==e&&e.blur();const t=Yg(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Sb("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Kb.version="0.17.1+prod.esm";const Hb="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,qb=Hb?o.useLayoutEffect:o.useEffect,Yb={tag:"history-merge"};function Xb({initialConfig:e,children:t}){const n=(0,o.useMemo)((()=>{const{theme:t,namespace:n,nodes:r,onError:o,editorState:i,html:s}=e,a=function(e,t){let n=null;return{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}}(0,t),l=function(e){const t=e||{},n=ab,r=t.theme||{},o=void 0===e?n:t.parentEditor||null,i=t.disableEvents||!1,s=Ib(),a=t.namespace||(null!==o?o._config.namespace:_g()),l=t.editorState,c=[Mb,by,ly,Ay,zb,Fb,...t.nodes||[]],{onError:u,html:d}=t,f=void 0===t.editable||t.editable;let h;if(void 0===e&&null!==n)h=n._nodes;else{h=new Map;for(let e=0;e{Object.keys(e).forEach((t=>{let r=n.get(t);void 0===r&&(r=[],n.set(t,r)),r.push(e[t])}))};return e.forEach((e=>{const t=e.klass.importDOM;if(null==t||r.has(t))return;r.add(t);const n=t.call(e.klass);null!==n&&o(n)})),t&&o(t),n}(h,d?d.import:void 0),f);return void 0!==l&&(p._pendingEditorState=l,p._dirtyType=sm),p}({editable:e.editable,html:s,namespace:n,nodes:r,onError:e=>o(e,l),theme:t});return function(e,t){if(null!==t)if(void 0===t)e.update((()=>{const t=mg();if(t.isEmpty()){const n=Bb();t.append(n);const r=Hb?document.activeElement:null;(null!==Zy()||null!==r&&r===e.getRootElement())&&n.select()}}),Yb);else if(null!==t)switch(typeof t){case"string":{const n=e.parseEditorState(t);e.setEditorState(n,Yb);break}case"object":e.setEditorState(t,Yb);break;case"function":e.update((()=>{mg().isEmpty()&&t(e)}),Yb)}}(l,i),[l,a]}),[]);return qb((()=>{const t=e.editable,[r]=n;r.setEditable(void 0===t||t)}),[]),(0,Jc.jsx)(rp.Provider,{value:n,children:t})}const Gb="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;function Jb(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function Zb(e){return()=>function(e){if(!function(e,t=!0){if(e)return!1;let n=mg().getTextContent();return t&&(n=n.trim()),""===n}(e,!1))return!1;const t=mg().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function nx(e,t){const n=Dg(e.focus,t);return Nb(n)&&!n.isIsolated()||Rb(n)&&!n.isInline()&&!n.canBeEmpty()}function rx(e,t,n){const r=function(e){const t=e.anchor.getNode();return"rtl"===(jb(t)?t:t.getParentOrThrow()).getDirection()}(e);!function(e,t,n){e.modify(t?"extend":"move",n,"character")}(e,t,n?!r:r)}function ox(e,t,n,r=null){let o=null===r||t.isSelected(r);const i=Rb(t)&&t.excludeFromCopy("html");let s=t;if(null!==r){let e=nv(t);e=Ry(e)&&null!==r?function(e,t){const n=e.getStartEndPoints();if(t.isSelected(e)&&!t.isSegmented()&&!t.isToken()&&null!==n){const[r,o]=n,i=e.isBackward(),s=r.getNode(),a=o.getNode(),l=t.is(s),c=t.is(a);if(l||c){const[n,r]=Uy(e),o=s.is(a),l=t.is(i?a:s),c=t.is(i?s:a);let u,d=0;return o?(d=n>r?r:n,u=n>r?n:r):l?(d=i?r:n,u=void 0):c&&(d=0,u=i?n:r),t.__text=t.__text.slice(d,u),t}}return t}(r,e):e,s=e}const a=Rb(s)?s.getChildren():[],l=e._nodes.get(s.getType());let c;c=l&&void 0!==l.exportDOM?l.exportDOM(e,s):s.exportDOM(e);const{element:u,after:d}=c;if(!u)return!1;const f=document.createDocumentFragment();for(let n=0;n{if(null!==e){const r=function(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}(e,KeyboardEvent)?null:e.clipboardData,o=Zy();if(null!==o&&null!=r){e.preventDefault();const i=function(e,t=Zy()){return null==t&&ix(166),zy(t)&&t.isCollapsed()||0===t.getNodes().length?"":function(e,t){if("undefined"==typeof document||"undefined"==typeof window&&void 0===n.g.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const r=document.createElement("div"),o=mg().getChildren();for(let n=0;ne.getDecorators()));return mx((()=>e.registerDecoratorListener((e=>{(0,Nn.flushSync)((()=>{r(e)}))}))),[e]),(0,o.useEffect)((()=>{r(e.getDecorators())}),[e]),(0,o.useMemo)((()=>{const r=[],i=Object.keys(n);for(let s=0;se._onError(t),children:(0,Jc.jsx)(o.Suspense,{fallback:null,children:n[a]})}),c=e.getElementByKey(a);null!==c&&r.push((0,Nn.createPortal)(l,c,a))}return r}),[t,n,e])}(r,n);return function(e){mx((()=>tx(function(e){return tx(e.registerCommand(lp,(e=>{const t=Zy();return!!zy(t)&&(t.deleteCharacter(e),!0)}),0),e.registerCommand(pp,(e=>{const t=Zy();return!!zy(t)&&(t.deleteWord(e),!0)}),0),e.registerCommand(mp,(e=>{const t=Zy();return!!zy(t)&&(t.deleteLine(e),!0)}),0),e.registerCommand(dp,(e=>{const t=Zy();if(!zy(t))return!1;if("string"==typeof e)t.insertText(e);else{const n=e.dataTransfer;if(null!=n)sx(n,t);else{const n=e.data;n&&t.insertText(n)}}return!0}),0),e.registerCommand(hp,(()=>{const e=Zy();return!!zy(e)&&(e.removeText(),!0)}),0),e.registerCommand(cp,(e=>{const t=Zy();return!!zy(t)&&(t.insertLineBreak(e),!0)}),0),e.registerCommand(up,(()=>{const e=Zy();return!!zy(e)&&(e.insertLineBreak(),!0)}),0),e.registerCommand(_p,(e=>{const t=Zy();if(!zy(t))return!1;const n=e,r=n.shiftKey;return!!nx(t,!0)&&(n.preventDefault(),rx(t,r,!0),!0)}),0),e.registerCommand(xp,(e=>{const t=Zy();if(!zy(t))return!1;const n=e,r=n.shiftKey;return!!nx(t,!1)&&(n.preventDefault(),rx(t,r,!1),!0)}),0),e.registerCommand(Pp,(t=>!!zy(Zy())&&(t.preventDefault(),e.dispatchCommand(lp,!0))),0),e.registerCommand(Op,(t=>!!zy(Zy())&&(t.preventDefault(),e.dispatchCommand(lp,!1))),0),e.registerCommand(Cp,(t=>{if(!zy(Zy()))return!1;if(null!==t){if((dx||ux||hx)&&cx)return!1;t.preventDefault()}return e.dispatchCommand(cp,!1)}),0),e.registerCommand(Fp,(()=>(function(){const e=mg();vg(function(e){return Ym(e.anchor),Ym(e.focus),e}(e.select(0,e.getChildrenSize())))}(),!0)),0),e.registerCommand(Dp,(t=>!!zy(Zy())&&(px(t,e),!0)),0),e.registerCommand(Lp,(t=>!!zy(Zy())&&(function(e,t){px(e,t),t.update((()=>{const e=Zy();zy(e)&&e.removeText()}))}(t,e),!0)),0),e.registerCommand(fp,(t=>!!zy(Zy())&&(function(e,t){e.preventDefault(),t.update((()=>{const t=Zy(),{clipboardData:n}=e;null!=n&&zy(t)&&sx(n,t)}),{tag:"paste"})}(t,e),!0)),0),e.registerCommand(Np,(e=>!!zy(Zy())&&(e.preventDefault(),!0)),0),e.registerCommand(Mp,(e=>!!zy(Zy())&&(e.preventDefault(),!0)),0))}(e),function(e){const t=window.location.origin,n=n=>{if(n.origin!==t)return;const r=e.getRootElement();if(document.activeElement!==r)return;const o=n.data;if("string"==typeof o){let t;try{t=JSON.parse(o)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){const r=t.payload;if(r&&"makeChanges"===r.functionId){const t=r.args;if(t){const[r,o,i,s,a,l]=t;e.update((()=>{const e=Zy();if(zy(e)){const t=e.anchor;let l=t.getNode(),c=0,u=0;if(Ry(l)&&r>=0&&o>=0&&(c=r,u=r+o,e.setTextNodeRange(l,c,l,u)),c===u&&""===i||(e.insertRawText(i),l=t.getNode()),Ry(l)){c=s,u=s+a;const t=l.getTextContentSize();c=c>t?t:c,u=u>t?t:u,e.setTextNodeRange(l,c,l,u)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}(e))),[e])}(r),(0,Jc.jsxs)(Jc.Fragment,{children:[e,(0,Jc.jsx)(yx,{content:t}),i]})}function yx({content:e}){const[t]=op(),n=function(e){const[t,n]=(0,o.useState)((()=>gx(e)));return mx((()=>{function t(){const t=gx(e);n(t)}return t(),tx(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),r=function(e){const[t]=op(),n=(0,o.useMemo)((()=>e(t)),[t,e]),r=(0,o.useRef)(n.initialValueFn()),[i,s]=(0,o.useState)(r.current);return Gb((()=>{const{initialValueFn:e,subscribe:t}=n,o=e();return r.current!==o&&(r.current=o,s(o)),t((e=>{r.current=e,s(e)}))}),[n,e]),i}(Jb);return n?"function"==typeof e?e(r):e:null}const bx="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect,xx=(0,o.forwardRef)((function({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:i,ariaExpanded:s,ariaLabel:a,ariaLabelledBy:l,ariaMultiline:c,ariaOwns:u,ariaRequired:d,autoCapitalize:f,className:h,id:p,role:m="textbox",spellCheck:g=!0,style:v,tabIndex:y,"data-testid":b,...x},w){const[_,S]=(0,o.useState)(e.isEditable()),k=(0,o.useCallback)((t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)}),[e]),E=(0,o.useMemo)((()=>function(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}(w,k)),[k,w]);return bx((()=>(S(e.isEditable()),e.registerEditableListener((e=>{S(e)})))),[e]),(0,Jc.jsx)("div",{...x,"aria-activedescendant":_?t:void 0,"aria-autocomplete":_?n:"none","aria-controls":_?r:void 0,"aria-describedby":i,"aria-expanded":_&&"combobox"===m?!!s:void 0,"aria-label":a,"aria-labelledby":l,"aria-multiline":c,"aria-owns":_?u:void 0,"aria-readonly":!_||void 0,"aria-required":d,autoCapitalize:f,className:h,contentEditable:_,"data-testid":b,id:p,ref:E,role:_?m:void 0,spellCheck:g,style:v,tabIndex:y})}));function wx(e){return e.getEditorState().read(Zb(e.isComposing()))}const Sx=(0,o.forwardRef)((function(e,t){const{placeholder:n,...r}=e,[o]=op();return(0,Jc.jsxs)(Jc.Fragment,{children:[(0,Jc.jsx)(xx,{editor:o,...r,ref:t}),null!=n&&(0,Jc.jsx)(kx,{editor:o,content:n})]})}));function kx({content:e,editor:t}){const n=function(e){const[t,n]=(0,o.useState)((()=>wx(e)));return bx((()=>{function t(){const t=wx(e);n(t)}return t(),tx(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),[r,i]=(0,o.useState)(t.isEditable());if((0,o.useLayoutEffect)((()=>(i(t.isEditable()),t.registerEditableListener((e=>{i(e)})))),[t]),!n)return null;let s=null;return"function"==typeof e?s=e(r):null!==e&&(s=e),null===s?null:(0,Jc.jsx)("div",{"aria-hidden":!0,children:s})}const Ex=0,Cx=1,Tx=2,Px=0,Rx=1,Ox=2,Ax=3,Nx=4;function Mx(e){e.undoStack=[],e.redoStack=[],e.current=null}function jx({delay:e,externalHistoryState:t}){const[n]=op();return function(e,t,n=1e3){const r=(0,o.useMemo)((()=>t||{current:null,redoStack:[],undoStack:[]}),[t]);(0,o.useEffect)((()=>function(e,t,n){const r=function(e,t){let n=Date.now(),r=Px;return(o,i,s,a,l,c)=>{const u=Date.now();if(c.has("historic"))return r=Px,n=u,Tx;const d=function(e,t,n,r,o){if(null===e||0===n.size&&0===r.size&&!o)return Px;const i=t._selection,s=e._selection;if(o)return Rx;if(!(zy(i)&&zy(s)&&s.isCollapsed()&&i.isCollapsed()))return Px;const a=function(e,t,n){const r=e._nodeMap,o=[];for(const e of t){const t=r.get(e);void 0!==t&&o.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||jb(n)||o.push(n)}return o}(t,n,r);if(0===a.length)return Px;if(a.length>1){const n=t._nodeMap,r=n.get(i.anchor.key),o=n.get(s.anchor.key);return r&&o&&!e._nodeMap.has(r.__key)&&Ry(r)&&1===r.__text.length&&1===i.anchor.offset?Ox:Px}const l=a[0],c=e._nodeMap.get(l.__key);if(!Ry(c)||!Ry(l)||c.__mode!==l.__mode)return Px;const u=c.__text,d=l.__text;if(u===d)return Px;const f=i.anchor,h=s.anchor;if(f.key!==h.key||"text"!==f.type)return Px;const p=f.offset,m=h.offset,g=d.length-u.length;return 1===g&&m===p-1?Ox:-1===g&&m===p+1?Ax:-1===g&&m===p?Nx:Px}(o,i,a,l,e.isComposing()),f=(()=>{const f=null===s||s.editor===e,h=c.has("history-push");if(!h&&f&&c.has("history-merge"))return Ex;if(null===o)return Cx;const p=i._selection;return a.size>0||l.size>0?!1===h&&d!==Px&&d===r&&ur.exportJSON())))===JSON.stringify(n.read((()=>o.exportJSON())))}(Array.from(a)[0],o,i)?Ex:Cx:null!==p?Ex:Tx})();return n=u,r=d,f}}(e,n),o=tx(e.registerCommand(vp,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const o=t.current,i=r.pop();null!==o&&(n.push(o),e.dispatchCommand(Bp,!0)),0===r.length&&e.dispatchCommand(Wp,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(e,t),!0)),0),e.registerCommand(yp,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const o=t.current;null!==o&&(r.push(o),e.dispatchCommand(Wp,!0));const i=n.pop();0===n.length&&e.dispatchCommand(Bp,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(e,t),!0)),0),e.registerCommand(zp,(()=>(Mx(t),!1)),0),e.registerCommand(Vp,(()=>(Mx(t),e.dispatchCommand(Bp,!1),e.dispatchCommand(Wp,!1),!0)),0),e.registerUpdateListener((({editorState:n,prevEditorState:o,dirtyLeaves:i,dirtyElements:s,tags:a})=>{const l=t.current,c=t.redoStack,u=t.undoStack,d=null===l?null:l.editorState;if(null!==l&&n===d)return;const f=r(o,n,l,i,s,a);if(f===Cx)0!==c.length&&(t.redoStack=[],e.dispatchCommand(Bp,!1)),null!==l&&(u.push({...l}),e.dispatchCommand(Wp,!0));else if(f===Tx)return;t.current={editor:e,editorState:n}})));return o}(e,r,n)),[n,e,r])}(n,t,e),null}function Ix(e,t){return Ix=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ix(e,t)}var Dx={error:null},Lx=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o{if(n)return r.registerUpdateListener((({editorState:o,dirtyElements:i,dirtyLeaves:s,prevEditorState:a,tags:l})=>{t&&0===i.size&&0===s.size||e&&l.has("history-merge")||a.isEmpty()||n(o,r,l)}))}),[r,e,t,n]),null}function Bx({editorRef:e}){const[t]=op();return o.useEffect((()=>{"function"==typeof e?e(t):"object"==typeof e&&(e.current=t)}),[t]),null}var Wx={sm:"py-1.5 px-2 rounded [&_.editor-content>p]:text-sm [&_.editor-content>p]:font-medium [&_.editor-content>p]:leading-[1.625rem]",md:"py-2 px-2.5 rounded-md [&_.editor-content>p]:text-sm [&_.editor-content>p]:font-medium [&_.editor-content>p]:leading-[1.625rem]",lg:"py-2.5 px-3 rounded-md [&_.editor-content>p]:text-sm [&_.editor-content>p]:font-medium [&_.editor-content>p]:leading-[1.6875rem]"},Ux={sm:"p-1.5 rounded-md max-h-[10.75rem]",md:"p-2 rounded-lg max-h-[13.5rem]",lg:"p-2 rounded-lg max-h-[13.5rem]"},$x={sm:"p-1.5 rounded text-sm leading-5 font-normal",md:"p-2 rounded-md text-base leading-6 font-normal",lg:"p-2 rounded-md text-base leading-6 font-normal"};const Kx="startTransition",Hx="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect,qx=e=>{const t=document.getElementById("typeahead-menu");if(!t)return;const n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function Yx(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top>r.top&&n.top{d(0)}),[f]);const h=(0,o.useCallback)((n=>{t.update((()=>{const t=null!=r.match&&l?function(e){const t=Zy();if(!zy(t)||!t.isCollapsed())return null;const n=t.anchor;if("text"!==n.type)return null;const r=n.getNode();if(!r.isSimpleText())return null;const o=n.offset,i=r.getTextContent().slice(0,o),s=e.replaceableString.length,a=o-function(e,t,n){let r=n;for(let n=r;n<=t.length;n++)e.substr(-n)===t.substr(0,n)&&(r=n);return r}(i,e.matchingString,s);if(a<0)return null;let l;return 0===a?[l]=r.splitText(o):[,l]=r.splitText(a,o),l}(r.match):null;a(n,t,e,r.match?r.match.matchingString:"")}))}),[t,l,r.match,a,e]),p=(0,o.useCallback)((e=>{const n=t.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+e),d(e))}),[t]);return(0,o.useEffect)((()=>()=>{const e=t.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")}),[t]),Hx((()=>{null===i?d(null):null===u&&p(0)}),[i,u,p]),(0,o.useEffect)((()=>tx(t.registerCommand(Xx,(({option:e})=>!(!e.ref||null==e.ref.current||(qx(e.ref.current),0))),c))),[t,p,c]),(0,o.useEffect)((()=>tx(t.registerCommand(Ep,(e=>{const n=e;if(null!==i&&i.length&&null!==u){const e=u!==i.length-1?u+1:0;p(e);const r=i[e];null!=r.ref&&r.ref.current&&t.dispatchCommand(Xx,{index:e,option:r}),n.preventDefault(),n.stopImmediatePropagation()}return!0}),c),t.registerCommand(kp,(e=>{const t=e;if(null!==i&&i.length&&null!==u){const e=0!==u?u-1:i.length-1;p(e);const n=i[e];null!=n.ref&&n.ref.current&&qx(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0}),c),t.registerCommand(Rp,(t=>{const n=t;return n.preventDefault(),n.stopImmediatePropagation(),e(),!0}),c),t.registerCommand(Ap,(e=>{const t=e;return null!==i&&null!==u&&null!=i[u]&&(t.preventDefault(),t.stopImmediatePropagation(),h(i[u]),!0)}),c),t.registerCommand(Cp,(e=>null!==i&&null!==u&&null!=i[u]&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),h(i[u]),!0)),c))),[h,e,t,i,u,p,c]),s(n,(0,o.useMemo)((()=>({options:i,selectOptionAndCleanUp:h,selectedIndex:u,setHighlightedIndex:d})),[h,u,i]),r.match?r.match.matchingString:"")}function Jx({options:e,onQueryChange:t,onSelectOption:n,onOpen:r,onClose:s,menuRenderFn:a,triggerFn:l,anchorClassName:c,commandPriority:u=Ub,parent:d}){const[f]=op(),[h,p]=(0,o.useState)(null),m=function(e,t,n,r=document.body){const[i]=op(),s=(0,o.useRef)(document.createElement("div")),a=(0,o.useCallback)((()=>{s.current.style.top=s.current.style.bottom;const t=i.getRootElement(),o=s.current,a=o.firstChild;if(null!==t&&null!==e){const{left:i,top:l,width:c,height:u}=e.getRect(),d=s.current.offsetHeight;if(o.style.top=`${l+window.pageYOffset+d+3}px`,o.style.left=`${i+window.pageXOffset}px`,o.style.height=`${u}px`,o.style.width=`${c}px`,null!==a){a.style.top=`${l}`;const e=a.getBoundingClientRect(),n=e.height,r=e.width,s=t.getBoundingClientRect();i+r>s.right&&(o.style.left=`${s.right-r+window.pageXOffset}px`),(l+n>window.innerHeight||l+n>s.bottom)&&l-s.top>n+u&&(o.style.top=l-n+window.pageYOffset-u+"px")}o.isConnected||(null!=n&&(o.className=n),o.setAttribute("aria-label","Typeahead menu"),o.setAttribute("id","typeahead-menu"),o.setAttribute("role","listbox"),o.style.display="block",o.style.position="absolute",r.append(o)),s.current=o,t.setAttribute("aria-controls","typeahead-menu")}}),[i,e,n,r]);(0,o.useEffect)((()=>{const t=i.getRootElement();if(null!==e)return a(),()=>{null!==t&&t.removeAttribute("aria-controls");const e=s.current;null!==e&&e.isConnected&&e.remove()}}),[i,a,e]);const l=(0,o.useCallback)((n=>{null!==e&&(n||t(null))}),[e,t]);return function(e,t,n,r){const[i]=op();(0,o.useEffect)((()=>{if(null!=t&&null!=e){const e=i.getRootElement(),o=null!=e?function(e){let t=getComputedStyle(e);const n="absolute"===t.position,r=/(auto|scroll)/;if("fixed"===t.position)return document.body;for(let o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.body}(e):document.body;let s=!1,a=Yx(t,o);const l=function(){s||(window.requestAnimationFrame((function(){n(),s=!1})),s=!0);const e=Yx(t,o);e!==a&&(a=e,null!=r&&r(e))},c=new ResizeObserver(n);return window.addEventListener("resize",n),document.addEventListener("scroll",l,{capture:!0,passive:!0}),c.observe(t),()=>{c.unobserve(t),window.removeEventListener("resize",n),document.removeEventListener("scroll",l,!0)}}}),[t,i,r,n,e])}(e,s.current,a,l),s}(h,p,c,d),g=(0,o.useCallback)((()=>{p(null),null!=s&&null!==h&&s()}),[s,h]),v=(0,o.useCallback)((e=>{p(e),null!=r&&null===h&&r(e)}),[r,h]);return(0,o.useEffect)((()=>{const e=f.registerUpdateListener((()=>{f.getEditorState().read((()=>{const e=f._window||window,n=e.document.createRange(),r=Zy(),o=function(e){let t=null;return e.getEditorState().read((()=>{const e=Zy();zy(e)&&(t=function(e){const t=e.anchor;if("text"!==t.type)return null;const n=t.getNode();if(!n.isSimpleText())return null;const r=t.offset;return n.getTextContent().slice(0,r)}(e))})),t}(f);if(!zy(r)||!r.isCollapsed()||null===o||null===n)return void g();const s=l(o,f);if(t(s?s.matchingString:null),null!==s&&!function(e,t){return 0===t&&e.getEditorState().read((()=>{const e=Zy();if(zy(e)){const t=e.anchor.getNode().getPreviousSibling();return Ry(t)&&t.isTextEntity()}return!1}))}(f,s.leadOffset)){const t=function(e,t,n){const r=n.getSelection();if(null===r||!r.isCollapsed)return!1;const o=r.anchorNode,i=e,s=r.anchorOffset;if(null==o||null==s)return!1;try{t.setStart(o,i),t.setEnd(o,s)}catch(e){return!1}return!0}(s.leadOffset,n,e);if(null!==t)return a=()=>v({getRect:()=>n.getBoundingClientRect(),match:s}),void(Kx in i()?i()[Kx](a):a())}var a;g()}))}));return()=>{e()}}),[f,l,t,h,g,v]),null===h||null===f?null:(0,Jc.jsx)(Gx,{close:g,resolution:h,editor:f,anchorElementRef:m,options:e,menuRenderFn:a,shouldSplitNodeWithQuery:!0,onSelectOption:n,commandPriority:u})}function Zx(e){return Zx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zx(e)}function Qx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n2&&void 0!==arguments[2]?arguments[2]:"name",r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return bw(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bw(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,o.useState)([]),2),i=r[0],s=r[1];return(0,o.useEffect)((function(){if(null!==t){var r=xw.get(t);null!==r&&(void 0===r?(xw.set(t,null),ww(e,t,(function(e){xw.set(t,e),s(e)}),n)):s(r))}else s([])}),[t]),i},Sw=["size","children","selected","className"];function kw(){return kw=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n_:;",p=[l].join(""),m="[^"+p+h+"\\s]",g="(?:\\.[ |$]| |["+h+"]|)",v=new RegExp("(^|\\s|\\()([".concat(p,"]((?:").concat(m).concat(g,"){0,").concat(75,"}))$")),y=new RegExp("(^|\\s|\\()([".concat(p,"]((?:").concat(m,"){0,").concat(50,"}))$")),b=Tw(op(),1)[0],x=Tw((0,o.useState)(null),2),w=x[0],_=x[1],S=_w(t,w,r),k=(0,o.useCallback)((function(e,t,n){b.update((function(){var o=dw(e.data,r,s);t&&t.replace(o),n()}))}),[b]),E=(0,o.useMemo)((function(){return S.map((function(e){return new yw(e)}))}),[b,S]);return React.createElement(Jx,{onQueryChange:_,onSelectOption:k,triggerFn:function(e){var t=v.exec(e);if(null===t&&(t=y.exec(e)),null!==t){var n=t[1],r=t[3];if(r.length>=0)return{leadOffset:t.index+n.length,matchingString:r,replaceableString:t[2]}}return null},options:E,menuRenderFn:function(e,t){var n=t.selectedIndex,o=t.selectOptionAndCleanUp,i=t.setHighlightedIndex;return e.current&&!(null==E||!E.length)&&React.createElement(u,{size:s},E.map((function(e,t){var a;return React.createElement(f,{key:t,ref:e.ref,size:s,selected:t===n,onMouseEnter:function(){i(t)},onClick:function(){return o(e)}},"string"==typeof e.data?e.data:null===(a=e.data)||void 0===a?void 0:a[r])})))}})},Ow={ltr:"ltr",rtl:"rtl",paragraph:"editor-paragraph",quote:"editor-quote",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5",h6:"editor-heading-h6"},list:{nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul",listitem:"editor-listItem",listitemChecked:"editor-listItemChecked",listitemUnchecked:"editor-listItemUnchecked"},hashtag:"editor-hashtag",image:"editor-image",link:"editor-link",text:{bold:"editor-textBold",code:"editor-textCode",italic:"editor-textItalic",strikethrough:"editor-textStrikethrough",subscript:"editor-textSubscript",superscript:"editor-textSuperscript",underline:"editor-textUnderline",underlineStrikethrough:"editor-textUnderlineStrikethrough"},code:"editor-code",codeHighlight:{atrule:"editor-tokenAttr",attr:"editor-tokenAttr",boolean:"editor-tokenProperty",builtin:"editor-tokenSelector",cdata:"editor-tokenComment",char:"editor-tokenSelector",class:"editor-tokenFunction","class-name":"editor-tokenFunction",comment:"editor-tokenComment",constant:"editor-tokenProperty",deleted:"editor-tokenProperty",doctype:"editor-tokenComment",entity:"editor-tokenOperator",function:"editor-tokenFunction",important:"editor-tokenVariable",inserted:"editor-tokenSelector",keyword:"editor-tokenAttr",namespace:"editor-tokenVariable",number:"editor-tokenProperty",operator:"editor-tokenOperator",prolog:"editor-tokenComment",property:"editor-tokenProperty",punctuation:"editor-tokenPunctuation",regex:"editor-tokenVariable",selector:"editor-tokenSelector",string:"editor-tokenSelector",symbol:"editor-tokenProperty",tag:"editor-tokenProperty",url:"editor-tokenOperator",variable:"editor-tokenVariable"}},Aw=function(e){var t=e.content;return React.createElement("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-start text-field-placeholder"},t)};function Nw(e){console.error(e)}var Mw=function(e,t){var n,r,i=e.defaultValue,s=void 0===i?"":i,a=e.placeholder,l=void 0===a?"Press @ to view variable suggestions":a,c=e.onChange,u=e.size,d=void 0===u?"md":u,f=e.autoFocus,h=void 0!==f&&f,p=e.options,m=void 0===p?[]:p,g=e.by,v=void 0===g?"name":g,y=e.trigger,b=void 0===y?"@":y,x=e.menuComponent,w=e.menuItemComponent,_=e.className,S=e.disabled,k=void 0!==S&&S,E={namespace:"Editor",editorTheme:Ow,onError:Nw,nodes:[fw],editorState:s||'{\n "root": {\n "children": [\n {\n "children": [],\n "direction": null,\n "format": "",\n "indent": 0,\n "type": "paragraph",\n "version": 1,\n "textFormat": 0,\n "textStyle": ""\n }\n ],\n "direction": null,\n "format": "",\n "indent": 0,\n "type": "root",\n "version": 1\n }\n}',editable:!k};return(0,o.isValidElement)(x)&&(n=x),(0,o.isValidElement)(w)&&(r=w),React.createElement("div",{className:te("relative w-full","border border-solid focus-within:ring-2 focus-within:ring-offset-2 border-field-border hover:border-border-strong focus-within:!border-focus-border focus-within:ring-focus transition duration-150 ease-in-out",Wx[d],k&&"bg-field-secondary-background border-field-border-disabled hover:border-field-border-disabled [&_p]:text-badge-color-disabled cursor-not-allowed")},React.createElement(Xb,{initialConfig:E},React.createElement("div",{className:"relative w-full [&_p]:m-0"},React.createElement(vx,{contentEditable:React.createElement(Sx,{className:te("editor-content focus-visible:outline-none outline-none","w-full min-h-[1.625rem] [&>p]:w-full [&>p]:m-0",_)}),placeholder:React.createElement(Aw,{content:l}),ErrorBoundary:Fx})),React.createElement(jx,null),React.createElement(Rw,{menuComponent:n,menuItemComponent:r,size:d,by:v,optionsArray:m,trigger:b}),React.createElement(Vx,{onChange:function(e,t){"function"==typeof c&&c(e,t)},ignoreSelectionChange:!0}),t&&React.createElement(Bx,{editorRef:t}),h&&React.createElement(ip,null)))},jw=(0,o.forwardRef)(Mw);jw.displayName="EditorInput";var Iw=jw;const Dw=ve("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var Lw=function(e,t){return te("rounded-full text-brand-primary-600 transition-colors duration-300",e[t].dot,e[t].ring)},Fw=["variant","size","type","currentStep","children","className"],zw=["labelText","icon","stepClasses","isCurrent","isCompleted","className","type","variant","sizeClasses","size","isLast","index"];function Vw(){return Vw=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:size-4",md:"[&>svg]:size-5"})||void 0===n?void 0:n[g],b=function(){m(!p),u&&u(!p)};return i().createElement("div",{className:"p-2"},i().createElement("div",{role:"button",tabIndex:"0",onClick:b,onKeyPress:function(e){"Enter"!==e.key&&" "!==e.key||b()},className:te("text-text-primary bg-transparent cursor-pointer flex justify-between items-center p-1 gap-1",v,f),"aria-expanded":p},i().createElement("span",{className:"text-text-tertiary"},r),a&&i().createElement(Ff.span,{variants:{open:{rotate:180},closed:{rotate:0}},animate:p?"open":"closed",transition:{duration:.15},className:te("flex items-center text-border-strong",y)},i().createElement(Hf,null))),i().createElement(Fh,{initial:!1},p&&i().createElement(Ff.ul,{variants:{open:{height:"auto",opacity:1},closed:{height:0,opacity:0}},initial:"closed",animate:"open",exit:"closed",transition:{duration:.3,ease:"easeInOut"},className:"overflow-hidden flex gap-0.5 flex-col m-0 bg-white rounded-md p-0"},d)))},Gw.Item=function(e){var t,n=e.disabled,r=void 0!==n&&n,o=e.active,s=e.onClick,a=e.children,l=e.className,c=Xw().size,u=null===(t={sm:"[&>svg]:size-4 [&>svg]:m-1 [&>*:not(svg)]:mx-1 [&>*:not(svg)]:my-0.5 text-sm",md:"[&>svg]:size-5 [&>svg]:m-1.5 [&>*:not(svg)]:m-1 text-base"})||void 0===t?void 0:t[c],d=r?"text-text-disabled hover:text-text-disabled cursor-not-allowed hover:bg-transparent":"",f=o?"text-icon-primary [&>svg]:text-icon-interactive bg-background-secondary":"";return i().createElement("li",{role:"menuitem",tabIndex:"0",onClick:s,onKeyPress:function(e){"Enter"!==e.key&&" "!==e.key||s()},className:te("flex p-1 gap-1 items-center bg-transparent w-full border-none rounded text-text-secondary cursor-pointer m-0",u,"hover:bg-background-secondary hover:text-text-primary",d,f,"transition-colors duration-300 ease-in-out",l)},a)},Gw.Separator=function(e){var t,n=e.variant,r=void 0===n?"solid":n,o=e.className,s=null===(t={solid:"border-solid",dashed:"border-dashed",dotted:"border-dotted",double:"border-double",hidden:"border-hidden",none:"border-none"})||void 0===t?void 0:t[r];return i().createElement(i().Fragment,null,i().createElement("hr",{className:te("w-full border-0 border-t border-border-subtle",s,o)}))};var Jw=Gw;return r}()})); \ No newline at end of file diff --git a/src/components/label/label.stories.js b/src/components/label/label.stories.js new file mode 100644 index 00000000..c3863802 --- /dev/null +++ b/src/components/label/label.stories.js @@ -0,0 +1,87 @@ +import Label from './label.jsx'; + +export default { + title: 'Atoms/Label', + component: Label, + parameters: { + layout: 'centered', + }, + tags: [ 'autodocs' ], + argTypes: { + size: { + name: 'Size', + description: 'Defines the size of the label.', + control: 'select', + options: [ 'xs', 'sm', 'md' ], + table: { + type: { summary: 'string' }, + defaultValue: { summary: 'sm' }, + }, + }, + variant: { + name: 'Variant', + description: 'Defines the style variant of the label.', + control: 'select', + options: [ 'neutral', 'help', 'error', 'disabled' ], + table: { + type: { summary: 'string' }, + defaultValue: { summary: 'neutral' }, + }, + }, + required: { + name: 'Required', + description: 'Defines if the label is required.', + control: 'boolean', + table: { + type: { summary: 'boolean' }, + defaultValue: { summary: 'false' }, + }, + }, + children: { + name: 'Text', + description: 'The label text or content.', + control: 'text', + defaultValue: 'Label Text', + }, + }, +}; + +// Basic Label +export const Basic = { + args: { + size: 'sm', + variant: 'neutral', + required: false, + children: 'Basic Label', + }, +}; + +// Required Label +export const Required = { + args: { + size: 'sm', + variant: 'neutral', + required: true, + children: 'Required Label', + }, +}; + +// Error Variant +export const Error = { + args: { + size: 'sm', + variant: 'error', + required: false, + children: 'Error Label', + }, +}; + +// Disabled Variant +export const Disabled = { + args: { + size: 'sm', + variant: 'disabled', + required: false, + children: 'Disabled Label', + }, +};