react-semaphor 0.0.37717 → 0.0.37719
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/index-B2UB5v7l.js +411 -0
- package/dist/chunks/{index-Cn4UOHHz.js → index-CaTx9ujK.js} +2 -2
- package/dist/chunks/{index-cCSW_k1F.js → index-DXddLbEP.js} +16954 -18409
- package/dist/chunks/{index-CyRUwrn3.js → index-DybOvW7V.js} +2 -2
- package/dist/chunks/{lucide-react-ntE5AF-n.js → lucide-react-BInWIJ_d.js} +3 -3
- package/dist/chunks/{lucide-react-AB7zXk4q.js → lucide-react-DCVg_bGB.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunks/index-Ca6xXV9t.js +0 -411
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
"use strict";var jY=Object.defineProperty;var JT=e=>{throw TypeError(e)};var $Y=(e,t,n)=>t in e?jY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Te=(e,t,n)=>$Y(e,typeof t!="symbol"?t+"":t,n),lx=(e,t,n)=>t.has(e)||JT("Cannot "+n);var ie=(e,t,n)=>(lx(e,t,"read from private field"),n?n.call(e):t.get(e)),Ke=(e,t,n)=>t.has(e)?JT("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),De=(e,t,n,r)=>(lx(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Tt=(e,t,n)=>(lx(e,t,"access private method"),n);var Ig=(e,t,n,r)=>({set _(o){De(e,t,o,n)},get _(){return ie(e,t,r)}});const T=require("react"),br=require("react-dom"),y=require("react/jsx-runtime");function rN(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const P=rN(T),lc=rN(br);function oN(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=oN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Yu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=oN(e))&&(r&&(r+=" "),r+=t);return r}const zY=Object.freeze(Object.defineProperty({__proto__:null,clsx:Yu,default:Yu},Symbol.toStringTag,{value:"Module"})),z_="-",BY=e=>{const t=VY(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(z_);return a[0]===""&&a.length!==1&&a.shift(),iN(a,t)||HY(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},iN=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?iN(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(z_);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},ek=/^\[(.+)\]$/,HY=e=>{if(ek.test(e)){const t=ek.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},VY=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return UY(Object.entries(e.classGroups),n).forEach(([i,s])=>{u1(s,r,i,t)}),r},u1=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:tk(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(WY(o)){u1(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{u1(s,tk(t,i),n,r)})})},tk=(e,t)=>{let n=e;return t.split(z_).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},WY=e=>e.isThemeGetter,UY=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e,GY=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},sN="!",qY=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let c=0,u=0,d;for(let v=0;v<a.length;v++){let x=a[v];if(c===0){if(x===o&&(r||a.slice(v,v+i)===t)){l.push(a.slice(u,v)),u=v+i;continue}if(x==="/"){d=v;continue}}x==="["?c++:x==="]"&&c--}const p=l.length===0?a:a.substring(u),h=p.startsWith(sN),m=h?p.substring(1):p,b=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:b}};return n?a=>n({className:a,parseClassName:s}):s},YY=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},KY=e=>({cache:GY(e.cacheSize),parseClassName:qY(e),...BY(e)}),XY=/\s+/,QY=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(XY);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:u,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:h}=n(c);let m=!!h,b=r(m?p.substring(0,h):p);if(!b){if(!m){a=c+(a.length>0?" "+a:a);continue}if(b=r(p),!b){a=c+(a.length>0?" "+a:a);continue}m=!1}const v=YY(u).join(":"),x=d?v+sN:v,w=x+b;if(i.includes(w))continue;i.push(w);const _=o(b,m);for(let R=0;R<_.length;++R){const C=_[R];i.push(x+C)}a=c+(a.length>0?" "+a:a)}return a};function ZY(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=aN(t))&&(r&&(r+=" "),r+=n);return r}const aN=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=aN(e[r]))&&(n&&(n+=" "),n+=t);return n};function JY(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=KY(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=QY(l,n);return o(l,u),u}return function(){return i(ZY.apply(null,arguments))}}const an=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},lN=/^\[(?:([a-z-]+):)?(.+)\]$/i,eK=/^\d+\/\d+$/,tK=new Set(["px","full","screen"]),nK=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rK=/\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$/,oK=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,iK=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sK=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Es=e=>xu(e)||tK.has(e)||eK.test(e),la=e=>vd(e,"length",pK),xu=e=>!!e&&!Number.isNaN(Number(e)),cx=e=>vd(e,"number",xu),of=e=>!!e&&Number.isInteger(Number(e)),aK=e=>e.endsWith("%")&&xu(e.slice(0,-1)),dt=e=>lN.test(e),ca=e=>nK.test(e),lK=new Set(["length","size","percentage"]),cK=e=>vd(e,lK,cN),uK=e=>vd(e,"position",cN),dK=new Set(["image","url"]),fK=e=>vd(e,dK,mK),hK=e=>vd(e,"",gK),sf=()=>!0,vd=(e,t,n)=>{const r=lN.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},pK=e=>rK.test(e)&&!oK.test(e),cN=()=>!1,gK=e=>iK.test(e),mK=e=>sK.test(e),bK=()=>{const e=an("colors"),t=an("spacing"),n=an("blur"),r=an("brightness"),o=an("borderColor"),i=an("borderRadius"),s=an("borderSpacing"),a=an("borderWidth"),l=an("contrast"),c=an("grayscale"),u=an("hueRotate"),d=an("invert"),p=an("gap"),h=an("gradientColorStops"),m=an("gradientColorStopPositions"),b=an("inset"),v=an("margin"),x=an("opacity"),w=an("padding"),_=an("saturate"),R=an("scale"),C=an("sepia"),E=an("skew"),A=an("space"),M=an("translate"),N=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",dt,t],z=()=>[dt,t],Z=()=>["",Es,la],G=()=>["auto",xu,dt],j=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>["start","end","center","between","around","evenly","stretch"],X=()=>["","0",dt],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[xu,dt];return{cacheSize:500,separator:":",theme:{colors:[sf],spacing:[Es,la],blur:["none","",ca,dt],brightness:q(),borderColor:[e],borderRadius:["none","","full",ca,dt],borderSpacing:z(),borderWidth:Z(),contrast:q(),grayscale:X(),hueRotate:q(),invert:X(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[aK,la],inset:F(),margin:F(),opacity:q(),padding:z(),saturate:q(),scale:q(),sepia:X(),skew:q(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",dt]}],container:["container"],columns:[{columns:[ca]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"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:[...j(),dt]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",of,dt]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",dt]}],grow:[{grow:X()}],shrink:[{shrink:X()}],order:[{order:["first","last","none",of,dt]}],"grid-cols":[{"grid-cols":[sf]}],"col-start-end":[{col:["auto",{span:["full",of,dt]},dt]}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":[sf]}],"row-start-end":[{row:["auto",{span:[of,dt]},dt]}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",dt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",dt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...V()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...V(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...V(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",dt,t]}],"min-w":[{"min-w":[dt,t,"min","max","fit"]}],"max-w":[{"max-w":[dt,t,"none","full","min","max","fit","prose",{screen:[ca]},ca]}],h:[{h:[dt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[dt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[dt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[dt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ca,la]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",cx]}],"font-family":[{font:[sf]}],"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-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",dt]}],"line-clamp":[{"line-clamp":["none",xu,cx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Es,dt]}],"list-image":[{"list-image":["none",dt]}],"list-style-type":[{list:["none","disc","decimal",dt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Es,la]}],"underline-offset":[{"underline-offset":["auto",Es,dt]}],"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:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",dt]}],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",dt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...j(),uK]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",cK]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},fK]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"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":[x]}],"border-style":[{border:[...H(),"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":[x]}],"divide-style":[{divide:H()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[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:["",...H()]}],"outline-offset":[{"outline-offset":[Es,dt]}],"outline-w":[{outline:[Es,la]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Es,la]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ca,hK]}],"shadow-color":[{shadow:[sf]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...$(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ca,dt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[_]}],sepia:[{sepia:[C]}],"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":[x]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"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",dt]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",dt]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",dt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[of,dt]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",dt]}],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",dt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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",dt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Es,la,cx]}],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-s","border-color-e","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"]}}},yK=JY(bK);class Tf extends Error{}Tf.prototype.name="InvalidTokenError";function vK(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function xK(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return vK(t)}catch{return atob(t)}}function B_(e,t){if(typeof e!="string")throw new Tf("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,r=e.split(".")[n];if(typeof r!="string")throw new Tf(`Invalid token specified: missing part #${n+1}`);let o;try{o=xK(r)}catch(i){throw new Tf(`Invalid token specified: invalid base64 for part #${n+1} (${i.message})`)}try{return JSON.parse(o)}catch(i){throw new Tf(`Invalid token specified: invalid json for part #${n+1} (${i.message})`)}}const wK={},nk=e=>{let t;const n=new Set,r=(u,d)=>{const p=typeof u=="function"?u(t):u;if(!Object.is(p,t)){const h=t;t=d??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(m=>m(t,h))}},o=()=>t,l={setState:r,getState:o,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(wK?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,o,l);return l},SK=e=>e?nk(e):nk;var Bi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ga(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function H_(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var d1={exports:{}},ux={},Dg={exports:{}},dx={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* use-sync-external-store-shim.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var rk;function _K(){if(rk)return dx;rk=1;var e=T;function t(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(d,p){var h=p(),m=r({inst:{value:h,getSnapshot:p}}),b=m[0].inst,v=m[1];return i(function(){b.value=h,b.getSnapshot=p,l(b)&&v({inst:b})},[d,h,p]),o(function(){return l(b)&&v({inst:b}),d(function(){l(b)&&v({inst:b})})},[d]),s(h),h}function l(d){var p=d.getSnapshot;d=d.value;try{var h=p();return!n(d,h)}catch{return!0}}function c(d,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return dx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,dx}var fx={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* use-sync-external-store-shim.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var ok;function CK(){return ok||(ok=1,process.env.NODE_ENV!=="production"&&function(){function e(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}function t(h,m){u||o.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var b=m();if(!d){var v=m();i(b,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}v=s({inst:{value:b,getSnapshot:m}});var x=v[0].inst,w=v[1];return l(function(){x.value=b,x.getSnapshot=m,n(x)&&w({inst:x})},[h,b,m]),a(function(){return n(x)&&w({inst:x}),h(function(){n(x)&&w({inst:x})})},[h]),c(b),b}function n(h){var m=h.getSnapshot;h=h.value;try{var b=m();return!i(h,b)}catch{return!0}}function r(h,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=T,i=typeof Object.is=="function"?Object.is:e,s=o.useState,a=o.useEffect,l=o.useLayoutEffect,c=o.useDebugValue,u=!1,d=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;fx.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),fx}var ik;function V_(){return ik||(ik=1,process.env.NODE_ENV==="production"?Dg.exports=_K():Dg.exports=CK()),Dg.exports}/**
|
|
18
|
+
* @license React
|
|
19
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var sk;function EK(){if(sk)return ux;sk=1;var e=T,t=V_();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return ux.useSyncExternalStoreWithSelector=function(c,u,d,p,h){var m=i(null);if(m.current===null){var b={hasValue:!1,value:null};m.current=b}else b=m.current;m=a(function(){function x(E){if(!w){if(w=!0,_=E,E=p(E),h!==void 0&&b.hasValue){var A=b.value;if(h(A,E))return R=A}return R=E}if(A=R,r(_,E))return A;var M=p(E);return h!==void 0&&h(A,M)?(_=E,A):(_=E,R=M)}var w=!1,_,R,C=d===void 0?null:d;return[function(){return x(u())},C===null?void 0:function(){return x(C())}]},[u,d,p,h]);var v=o(c,m[0],m[1]);return s(function(){b.hasValue=!0,b.value=v},[v]),l(v),v},ux}var hx={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var ak;function RK(){return ak||(ak=1,process.env.NODE_ENV!=="production"&&function(){function e(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=T,n=V_(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;hx.useSyncExternalStoreWithSelector=function(c,u,d,p,h){var m=i(null);if(m.current===null){var b={hasValue:!1,value:null};m.current=b}else b=m.current;m=a(function(){function x(E){if(!w){if(w=!0,_=E,E=p(E),h!==void 0&&b.hasValue){var A=b.value;if(h(A,E))return R=A}return R=E}if(A=R,r(_,E))return A;var M=p(E);return h!==void 0&&h(A,M)?(_=E,A):(_=E,R=M)}var w=!1,_,R,C=d===void 0?null:d;return[function(){return x(u())},C===null?void 0:function(){return x(C())}]},[u,d,p,h]);var v=o(c,m[0],m[1]);return s(function(){b.hasValue=!0,b.value=v},[v]),l(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),hx}process.env.NODE_ENV==="production"?d1.exports=EK():d1.exports=RK();var PK=d1.exports;const TK=Ga(PK),uN={},{useDebugValue:kK}=T,{useSyncExternalStoreWithSelector:AK}=TK;let lk=!1;const OK=e=>e;function MK(e,t=OK,n){(uN?"production":void 0)!=="production"&&n&&!lk&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),lk=!0);const r=AK(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return kK(r),r}const IK=e=>{(uN?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?SK(e):e,n=(r,o)=>MK(t,r,o);return Object.assign(n,t),n},dN=e=>IK;var fN=Symbol.for("immer-nothing"),ck=Symbol.for("immer-draftable"),Ao=Symbol.for("immer-state"),DK=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function ro(e,...t){if(process.env.NODE_ENV!=="production"){const n=DK[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ku=Object.getPrototypeOf;function Xu(e){return!!e&&!!e[Ao]}function cc(e){var t;return e?hN(e)||Array.isArray(e)||!!e[ck]||!!((t=e.constructor)!=null&&t[ck])||y0(e)||v0(e):!1}var NK=Object.prototype.constructor.toString();function hN(e){if(!e||typeof e!="object")return!1;const t=Ku(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===NK}function lb(e,t){b0(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function b0(e){const t=e[Ao];return t?t.type_:Array.isArray(e)?1:y0(e)?2:v0(e)?3:0}function f1(e,t){return b0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function pN(e,t,n){const r=b0(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function LK(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function y0(e){return e instanceof Map}function v0(e){return e instanceof Set}function wl(e){return e.copy_||e.base_}function h1(e,t){if(y0(e))return new Map(e);if(v0(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=hN(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Ao];let o=Reflect.ownKeys(r);for(let i=0;i<o.length;i++){const s=o[i],a=r[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(r[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(Ku(e),r)}else{const r=Ku(e);if(r!==null&&n)return{...e};const o=Object.create(r);return Object.assign(o,e)}}function W_(e,t=!1){return x0(e)||Xu(e)||!cc(e)||(b0(e)>1&&(e.set=e.add=e.clear=e.delete=FK),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>W_(r,!0))),e}function FK(){ro(2)}function x0(e){return Object.isFrozen(e)}var jK={};function uc(e){const t=jK[e];return t||ro(0,e),t}var gh;function gN(){return gh}function $K(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function uk(e,t){t&&(uc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function p1(e){g1(e),e.drafts_.forEach(zK),e.drafts_=null}function g1(e){e===gh&&(gh=e.parent_)}function dk(e){return gh=$K(gh,e)}function zK(e){const t=e[Ao];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function fk(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Ao].modified_&&(p1(t),ro(4)),cc(e)&&(e=cb(t,e),t.parent_||ub(t,e)),t.patches_&&uc("Patches").generateReplacementPatches_(n[Ao].base_,e,t.patches_,t.inversePatches_)):e=cb(t,n,[]),p1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==fN?e:void 0}function cb(e,t,n){if(x0(t))return t;const r=t[Ao];if(!r)return lb(t,(o,i)=>hk(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return ub(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let i=o,s=!1;r.type_===3&&(i=new Set(o),o.clear(),s=!0),lb(i,(a,l)=>hk(e,r,o,a,l,n,s)),ub(e,o,!1),n&&e.patches_&&uc("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function hk(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&ro(5),Xu(o)){const a=i&&t&&t.type_!==3&&!f1(t.assigned_,r)?i.concat(r):void 0,l=cb(e,o,a);if(pN(n,r,l),Xu(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(cc(o)&&!x0(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;cb(e,o),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&ub(e,o)}}function ub(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&W_(t,n)}function BK(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:gN(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=U_;n&&(o=[r],i=mh);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var U_={get(e,t){if(t===Ao)return e;const n=wl(e);if(!f1(n,t))return HK(e,n,t);const r=n[t];return e.finalized_||!cc(r)?r:r===px(e.base_,t)?(gx(e),e.copy_[t]=b1(r,e)):r},has(e,t){return t in wl(e)},ownKeys(e){return Reflect.ownKeys(wl(e))},set(e,t,n){const r=mN(wl(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=px(wl(e),t),i=o==null?void 0:o[Ao];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(LK(n,o)&&(n!==void 0||f1(e.base_,t)))return!0;gx(e),m1(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return px(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,gx(e),m1(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=wl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ro(11)},getPrototypeOf(e){return Ku(e.base_)},setPrototypeOf(){ro(12)}},mh={};lb(U_,(e,t)=>{mh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});mh.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&ro(13),mh.set.call(this,e,t,void 0)};mh.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&ro(14),U_.set.call(this,e[0],t,n,e[0])};function px(e,t){const n=e[Ao];return(n?wl(n):e)[t]}function HK(e,t,n){var o;const r=mN(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function mN(e,t){if(!(t in e))return;let n=Ku(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Ku(n)}}function m1(e){e.modified_||(e.modified_=!0,e.parent_&&m1(e.parent_))}function gx(e){e.copy_||(e.copy_=h1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var VK=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(l=i,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&ro(6),r!==void 0&&typeof r!="function"&&ro(7);let o;if(cc(t)){const i=dk(this),s=b1(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?p1(i):g1(i)}return uk(i,r),fk(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===fN&&(o=void 0),this.autoFreeze_&&W_(o,!0),r){const i=[],s=[];uc("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else ro(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,o;return[this.produce(t,n,(s,a)=>{r=s,o=a}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){cc(e)||ro(8),Xu(e)&&(e=WK(e));const t=dk(this),n=b1(e,void 0);return n[Ao].isManual_=!0,g1(t),n}finishDraft(e,t){const n=e&&e[Ao];(!n||!n.isManual_)&&ro(9);const{scope_:r}=n;return uk(r,t),fk(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=uc("Patches").applyPatches_;return Xu(e)?r(e,t):this.produce(e,o=>r(o,t))}};function b1(e,t){const n=y0(e)?uc("MapSet").proxyMap_(e,t):v0(e)?uc("MapSet").proxySet_(e,t):BK(e,t);return(t?t.scope_:gN()).drafts_.push(n),n}function WK(e){return Xu(e)||ro(10,e),bN(e)}function bN(e){if(!cc(e)||x0(e))return e;const t=e[Ao];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=h1(e,t.scope_.immer_.useStrictShallowCopy_)}else n=h1(e,!0);return lb(n,(r,o)=>{pN(n,r,bN(o))}),t&&(t.finalized_=!1),n}var Oo=new VK,UK=Oo.produce;Oo.produceWithPatches.bind(Oo);Oo.setAutoFreeze.bind(Oo);Oo.setUseStrictShallowCopy.bind(Oo);Oo.applyPatches.bind(Oo);Oo.createDraft.bind(Oo);Oo.finishDraft.bind(Oo);const GK=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?UK(o):o;return t(a,i,...s)},e(r.setState,n,r)),yN=GK;var y1,Ng=br;if(process.env.NODE_ENV==="production")y1=Ng.createRoot,Ng.hydrateRoot;else{var pk=Ng.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;y1=function(e,t){pk.usingClientEntryPoint=!0;try{return Ng.createRoot(e,t)}finally{pk.usingClientEntryPoint=!1}}}var vN={},xN={},G_={exports:{}},ft=String,wN=function(){return{isColorSupported:!1,reset:ft,bold:ft,dim:ft,italic:ft,underline:ft,inverse:ft,hidden:ft,strikethrough:ft,black:ft,red:ft,green:ft,yellow:ft,blue:ft,magenta:ft,cyan:ft,white:ft,gray:ft,bgBlack:ft,bgRed:ft,bgGreen:ft,bgYellow:ft,bgBlue:ft,bgMagenta:ft,bgCyan:ft,bgWhite:ft,blackBright:ft,redBright:ft,greenBright:ft,yellowBright:ft,blueBright:ft,magentaBright:ft,cyanBright:ft,whiteBright:ft,bgBlackBright:ft,bgRedBright:ft,bgGreenBright:ft,bgYellowBright:ft,bgBlueBright:ft,bgMagentaBright:ft,bgCyanBright:ft,bgWhiteBright:ft}};G_.exports=wN();G_.exports.createColors=wN;var qK=G_.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(qK);function r(l){return l&&l.__esModule?l:{default:l}}let o=new Set;function i(l,c,u){typeof process<"u"&&process.env.JEST_WORKER_ID||u&&o.has(u)||(u&&o.add(u),console.warn(""),c.forEach(d=>console.warn(l,"-",d)))}function s(l){return n.default.dim(l)}const a={info(l,c){i(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){i(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){i(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(xN);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(xN);function n(i){return i&&i.__esModule?i:{default:i}}function r({version:i,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${i}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const o={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(vN);let mx=vN;var YK=(mx.__esModule?mx:{default:mx}).default;const At=Ga(YK),q_=`import pandas as pd
|
|
34
|
+
df = pd.DataFrame(data) # 'data' contains the query result
|
|
35
|
+
result = df.to_dict('records') # must return 'result' as [dict] type
|
|
36
|
+
`,Y_="dm",v1=[{locale:"en-US",currency:"USD",currencyName:"US Dollar"},{locale:"en-GB",currency:"GBP",currencyName:"British Pound"},{locale:"en-CA",currency:"CAD",currencyName:"Canadian Dollar"},{locale:"en-AU",currency:"AUD",currencyName:"Australian Dollar"},{locale:"en-IN",currency:"INR",currencyName:"Indian Rupee"},{locale:"ja-JP",currency:"JPY",currencyName:"Japanese Yen"},{locale:"de-DE",currency:"EUR",currencyName:"Germany (Eurozone)"},{locale:"fr-FR",currency:"EUR",currencyName:"France (Eurozone)"},{locale:"es-ES",currency:"EUR",currencyName:"Spain (Eurozone)"},{locale:"it-IT",currency:"EUR",currencyName:"Italy (Eurozone)"},{locale:"fi-FI",currency:"EUR",currencyName:"Finland (Eurozone)"},{locale:"nl-NL",currency:"EUR",currencyName:"Netherlands (Eurozone)"},{locale:"zh-CN",currency:"CNY",currencyName:"Chinese Yuan"},{locale:"ru-RU",currency:"RUB",currencyName:"Russian Ruble"},{locale:"pt-BR",currency:"BRL",currencyName:"Brazilian Real"},{locale:"ko-KR",currency:"KRW",currencyName:"South Korean Won"},{locale:"ar-SA",currency:"SAR",currencyName:"Saudi Riyal"},{locale:"sv-SE",currency:"SEK",currencyName:"Swedish Krona"},{locale:"no-NO",currency:"NOK",currencyName:"Norwegian Krone"},{locale:"da-DK",currency:"DKK",currencyName:"Danish Krone"},{locale:"pl-PL",currency:"PLN",currencyName:"Polish Zloty"},{locale:"tr-TR",currency:"TRY",currencyName:"Turkish Lira"},{locale:"he-IL",currency:"ILS",currencyName:"Israeli Shekel"},{locale:"th-TH",currency:"THB",currencyName:"Thai Baht"},{locale:"vi-VN",currency:"VND",currencyName:"Vietnamese Dong"},{locale:"id-ID",currency:"IDR",currencyName:"Indonesian Rupiah"},{locale:"mx-MX",currency:"MXN",currencyName:"Mexican Peso"},{locale:"za-ZA",currency:"ZAR",currencyName:"South African Rand"},{locale:"sg-SG",currency:"SGD",currencyName:"Singapore Dollar"},{locale:"hk-HK",currency:"HKD",currencyName:"Hong Kong Dollar"},{locale:"ch-CH",currency:"CHF",currencyName:"Swiss Franc"},{locale:"my-MY",currency:"MYR",currencyName:"Malaysian Ringgit"},{locale:"ph-PH",currency:"PHP",currencyName:"Philippine Peso"},{locale:"eg-EG",currency:"EGP",currencyName:"Egyptian Pound"},{locale:"nz-NZ",currency:"NZD",currencyName:"New Zealand Dollar"}],KK=[{label:"English",locales:[{code:"en-US",name:"US English"},{code:"en-GB",name:"British English"},{code:"en-AU",name:"Australian English"},{code:"en-CA",name:"Canadian English"}]},{label:"French",locales:[{code:"fr-FR",name:"France French"},{code:"fr-CA",name:"Canadian French"}]},{label:"Spanish",locales:[{code:"es-ES",name:"Spain Spanish"},{code:"es-MX",name:"Mexican Spanish"},{code:"es-419",name:"Latin American Spanish"}]},{label:"German",locales:[{code:"de-DE",name:"Germany German"},{code:"de-CH",name:"Swiss German"}]},{label:"Chinese",locales:[{code:"zh-CN",name:"Simplified Chinese (China)"},{code:"zh-TW",name:"Traditional Chinese (Taiwan)"},{code:"zh-HK",name:"Hong Kong Chinese"}]},{label:"Japanese",locales:[{code:"ja-JP",name:"Japanese"}]},{label:"Arabic",locales:[{code:"ar-EG",name:"Egypt Arabic"},{code:"ar-SA",name:"Saudi Arabia Arabic"}]},{label:"Russian",locales:[{code:"ru-RU",name:"Russian"}]},{label:"Portuguese",locales:[{code:"pt-PT",name:"Portugal Portuguese"},{code:"pt-BR",name:"Brazil Portuguese"}]},{label:"Indian Languages",locales:[{code:"hi-IN",name:"Hindi (India)"},{code:"ta-IN",name:"Tamil (India)"}]},{label:"Korean",locales:[{code:"ko-KR",name:"Korean"}]},{label:"Italian",locales:[{code:"it-IT",name:"Italian (Italy)"}]},{label:"Dutch",locales:[{code:"nl-NL",name:"Dutch (Netherlands)"}]},{label:"Swedish",locales:[{code:"sv-SE",name:"Swedish (Sweden)"}]},{label:"Turkish",locales:[{code:"tr-TR",name:"Turkish (Turkey)"}]},{label:"Hebrew",locales:[{code:"he-IL",name:"Hebrew (Israel)"}]},{label:"Thai",locales:[{code:"th-TH",name:"Thai (Thailand)"}]},{label:"Polish",locales:[{code:"pl-PL",name:"Polish (Poland)"}]},{label:"Greek",locales:[{code:"el-GR",name:"Greek (Greece)"}]},{label:"Norwegian",locales:[{code:"no-NO",name:"Norwegian (Norway)"}]}],K_=["lg","md","sm","xs","xxs"],db={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[At.blue[500],At.teal[500],At.amber[500],At.red[500],At.indigo[500],At.green[500]],borderColor:[At.blue[500],At.teal[500],At.amber[500],At.red[500],At.indigo[500],At.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:x1},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:4,usePointStyle:!0,pointStyle:"rectRounded",boxPadding:4},legend:{position:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:2,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[At.blue[500],At.teal[500],At.amber[500],At.red[500],At.indigo[500],At.green[500]],borderColor:[At.blue[500],At.teal[500],At.amber[500],At.red[500],At.indigo[500],At.green[500]],datalables:{color:x1}},options:{plugins:{tooltip:{backgroundColor:"#000",bodyColor:"#fff",borderWidth:.25,titleColor:"#fff",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4}},datalabels:{display:!1},scales:{x:{grid:{display:!0,color:At.slate[800]}},y:{grid:{display:!0,color:At.slate[800]}}}}}}};function x1(e){var r,o,i,s,a,l;const t=(a=(s=(i=(o=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:o._config)==null?void 0:i.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=bh()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=bh()),Qu(n)}function bh(){return be.getState().theme==="dark"?"#000000":"#FFFFFF"}function Qu(e){let t=0,n=0,r=0,o=0;const i=u=>{if(!u)return At.gray[500];const d=u.replace("#",""),p=parseInt(d.substring(0,2),16),h=parseInt(d.substring(2,4),16),m=parseInt(d.substring(4,6),16);t+=p,n+=h,r+=m,o++};Array.isArray(e)?e.forEach(u=>{i(u)}):i(e);const s=t/o,a=n/o,l=r/o;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}const XK=["text","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],QK=["number","integer","int","int64","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8","float64"],ZK=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],JK=["boolean"];function X_(e){return e.match(/[A-Z]/)?`"${e}"`:e}function w0(e){return XK.includes(e.toLowerCase())||/varchar/i.test(e)}function tp(e){return QK.includes(e.toLowerCase())||/int|decimal|float|double/i.test(e)}function xd(e){return ZK.includes(e.toLowerCase())||/date|time|timestamp/i.test(e)}function Q_(e){return JK.includes(e.toLowerCase())||/boolean/i.test(e)}function eX(e,t,n,r,o){const{measures:i,dimensions:s}=e,a=i==null?void 0:i.map(d=>`${d.calc}(${d.name}) as ${d.calc}_${d.name.replace(/"/g,"")}`).join(", "),l=(s==null?void 0:s.join(", "))||"";let c="";const u=r?`${Y_}.${r}`:Z_(t,n,o);if(a&&l)return c=`SELECT ${l}, COUNT(*) as count, ${a} FROM ${u} GROUP BY ${l} ORDER BY ${l} DESC LIMIT 100`,c;if(!a&&l)return c=`SELECT ${l}, COUNT(*) as count FROM ${u} GROUP BY ${l} ORDER BY ${l} DESC LIMIT 100`,c;if(a&&!l)return c=`SELECT ${a} FROM ${u} LIMIT 100`,c}function tX(e,t,n="AVG"){var i,s,a,l;let r={};const o=X_(e.column_name);return w0(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(o))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(u=>u!==o)}:r={...t,dimensions:[...t.dimensions||[],o]}),tp(e.data_type)&&(((a=t.measures)==null?void 0:a.some(u=>u.name===o&&u.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(u=>!(u.name===o&&u.calc===n))}:r={...t,measures:[...t.measures||[],{name:o,calc:n||"SUM"}]}),r}function wu(e){return w0(e.dataType)?"string":tp(e.dataType)?"number":xd(e.dataType)?"date":Q_(e.dataType)?"boolean":"string"}function nX(e){let t;const n=e.data_type.toLowerCase();return w0(n)?t="T":tp(n)?t="#":xd(n)?t="D":Q_(n)?t="B":t="?",t}function rX(e,t){const{dimensions:n,measures:r}=t,o=n==null?void 0:n.includes(e.column_name),i=r==null?void 0:r.some(s=>s.name===e.column_name);return o||i}function SN({schemaName:e,tableName:t,modelName:n,connectionType:r}){let o=Z_(e,t,r);n&&(o=`${Y_}.${n}`);let i=o;return(a=>/[A-Z]/.test(a))(t)&&(i=i.split(".").map(l=>`"${l}"`).join(".")),i}function Z_(e,t,n){return t==="api"||e===X_("NA")||n==="S3"||n==="API"?t:e?`${e}.${t}`:`${t}`}const oX=e=>{const t=new Date(e);return!isNaN(t.getTime())},iX=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),S0=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?oX(e)?t="date":iX(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function sX({get:e,dataPoint:t,card:n}){var p;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValues:i,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:u}=t,d={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(p=n.preferences)==null?void 0:p.filterOnClickField,valueType:S0(u),operation:"=",values:[u]};if(l!=null&&l.find(h=>h.id===n.id)){const h=n.id;if(u==null){a(n),i(h);return}else s(d)}o(n),r(d)}var fb={exports:{}};/**
|
|
37
|
+
* @license
|
|
38
|
+
* Lodash <https://lodash.com/>
|
|
39
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
40
|
+
* Released under MIT license <https://lodash.com/license>
|
|
41
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
42
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
43
|
+
*/fb.exports;(function(e,t){(function(){var n,r="4.17.21",o=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",d=1,p=2,h=4,m=1,b=2,v=1,x=2,w=4,_=8,R=16,C=32,E=64,A=128,M=256,N=512,L=30,F="...",z=800,Z=16,G=1,j=2,H=3,$=1/0,V=9007199254740991,X=17976931348623157e292,I=NaN,q=4294967295,U=q-1,O=q>>>1,J=[["ary",A],["bind",v],["bindKey",x],["curry",_],["curryRight",R],["flip",N],["partial",C],["partialRight",E],["rearg",M]],K="[object Arguments]",ne="[object Array]",Y="[object AsyncFunction]",ee="[object Boolean]",re="[object Date]",ue="[object DOMException]",fe="[object Error]",se="[object Function]",pe="[object GeneratorFunction]",ce="[object Map]",_e="[object Number]",Pe="[object Null]",Me="[object Object]",ke="[object Promise]",Ne="[object Proxy]",tt="[object RegExp]",ot="[object Set]",gn="[object String]",xt="[object Symbol]",Wn="[object Undefined]",Rt="[object WeakMap]",de="[object WeakSet]",Se="[object ArrayBuffer]",je="[object DataView]",Be="[object Float32Array]",it="[object Float64Array]",On="[object Int8Array]",Fn="[object Int16Array]",vn="[object Int32Array]",en="[object Uint8Array]",jn="[object Uint8ClampedArray]",Kt="[object Uint16Array]",sr="[object Uint32Array]",_r=/\b__p \+= '';/g,ps=/\b(__p \+=) '' \+/g,gs=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Nc=/&(?:amp|lt|gt|quot|#39);/g,Lo=/[&<>"']/g,Fo=RegExp(Nc.source),jd=RegExp(Lo.source),Le=/<%-([\s\S]+?)%>/g,wt=/<%([\s\S]+?)%>/g,Wt=/<%=([\s\S]+?)%>/g,ar=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zn=/^\w*$/,ho=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Br=/[\\^$.*+?()[\]{}|]/g,Cr=RegExp(Br.source),mn=/^\s+/,Lc=/\s/,Bp=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Hp=/\{\n\/\* \[wrapped with (.+)\] \*/,$d=/,? & /,Vp=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,si=/[()=,{}\[\]\/\s]/,Wp=/\\(\\)?/g,Up=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,zd=/\w*$/,Gp=/^[-+]0x[0-9a-f]+$/i,Qy=/^0b[01]+$/i,ze=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,Ee=/^(?:0|[1-9]\d*)$/,Fe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ut=/($^)/,Un=/['\n\r\u2028\u2029\\]/g,xn="\\ud800-\\udfff",lr="\\u0300-\\u036f",jo="\\ufe20-\\ufe2f",nl="\\u20d0-\\u20ff",Gn=lr+jo+nl,Bd="\\u2700-\\u27bf",Hd="a-z\\xdf-\\xf6\\xf8-\\xff",DB="\\xac\\xb1\\xd7\\xf7",NB="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",LB="\\u2000-\\u206f",FB=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",O2="A-Z\\xc0-\\xd6\\xd8-\\xde",M2="\\ufe0e\\ufe0f",I2=DB+NB+LB+FB,Zy="['’]",jB="["+xn+"]",D2="["+I2+"]",qp="["+Gn+"]",N2="\\d+",$B="["+Bd+"]",L2="["+Hd+"]",F2="[^"+xn+I2+N2+Bd+Hd+O2+"]",Jy="\\ud83c[\\udffb-\\udfff]",zB="(?:"+qp+"|"+Jy+")",j2="[^"+xn+"]",ev="(?:\\ud83c[\\udde6-\\uddff]){2}",tv="[\\ud800-\\udbff][\\udc00-\\udfff]",Fc="["+O2+"]",$2="\\u200d",z2="(?:"+L2+"|"+F2+")",BB="(?:"+Fc+"|"+F2+")",B2="(?:"+Zy+"(?:d|ll|m|re|s|t|ve))?",H2="(?:"+Zy+"(?:D|LL|M|RE|S|T|VE))?",V2=zB+"?",W2="["+M2+"]?",HB="(?:"+$2+"(?:"+[j2,ev,tv].join("|")+")"+W2+V2+")*",VB="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",WB="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",U2=W2+V2+HB,UB="(?:"+[$B,ev,tv].join("|")+")"+U2,GB="(?:"+[j2+qp+"?",qp,ev,tv,jB].join("|")+")",qB=RegExp(Zy,"g"),YB=RegExp(qp,"g"),nv=RegExp(Jy+"(?="+Jy+")|"+GB+U2,"g"),KB=RegExp([Fc+"?"+L2+"+"+B2+"(?="+[D2,Fc,"$"].join("|")+")",BB+"+"+H2+"(?="+[D2,Fc+z2,"$"].join("|")+")",Fc+"?"+z2+"+"+B2,Fc+"+"+H2,WB,VB,N2,UB].join("|"),"g"),XB=RegExp("["+$2+xn+Gn+M2+"]"),QB=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ZB=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],JB=-1,sn={};sn[Be]=sn[it]=sn[On]=sn[Fn]=sn[vn]=sn[en]=sn[jn]=sn[Kt]=sn[sr]=!0,sn[K]=sn[ne]=sn[Se]=sn[ee]=sn[je]=sn[re]=sn[fe]=sn[se]=sn[ce]=sn[_e]=sn[Me]=sn[tt]=sn[ot]=sn[gn]=sn[Rt]=!1;var tn={};tn[K]=tn[ne]=tn[Se]=tn[je]=tn[ee]=tn[re]=tn[Be]=tn[it]=tn[On]=tn[Fn]=tn[vn]=tn[ce]=tn[_e]=tn[Me]=tn[tt]=tn[ot]=tn[gn]=tn[xt]=tn[en]=tn[jn]=tn[Kt]=tn[sr]=!0,tn[fe]=tn[se]=tn[Rt]=!1;var eH={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},tH={"&":"&","<":"<",">":">",'"':""","'":"'"},nH={"&":"&","<":"<",">":">",""":'"',"'":"'"},rH={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},oH=parseFloat,iH=parseInt,G2=typeof Bi=="object"&&Bi&&Bi.Object===Object&&Bi,sH=typeof self=="object"&&self&&self.Object===Object&&self,Jn=G2||sH||Function("return this")(),rv=t&&!t.nodeType&&t,rl=rv&&!0&&e&&!e.nodeType&&e,q2=rl&&rl.exports===rv,ov=q2&&G2.process,$o=function(){try{var ae=rl&&rl.require&&rl.require("util").types;return ae||ov&&ov.binding&&ov.binding("util")}catch{}}(),Y2=$o&&$o.isArrayBuffer,K2=$o&&$o.isDate,X2=$o&&$o.isMap,Q2=$o&&$o.isRegExp,Z2=$o&&$o.isSet,J2=$o&&$o.isTypedArray;function po(ae,me,he){switch(he.length){case 0:return ae.call(me);case 1:return ae.call(me,he[0]);case 2:return ae.call(me,he[0],he[1]);case 3:return ae.call(me,he[0],he[1],he[2])}return ae.apply(me,he)}function aH(ae,me,he,Ie){for(var rt=-1,Nt=ae==null?0:ae.length;++rt<Nt;){var $n=ae[rt];me(Ie,$n,he($n),ae)}return Ie}function zo(ae,me){for(var he=-1,Ie=ae==null?0:ae.length;++he<Ie&&me(ae[he],he,ae)!==!1;);return ae}function lH(ae,me){for(var he=ae==null?0:ae.length;he--&&me(ae[he],he,ae)!==!1;);return ae}function eP(ae,me){for(var he=-1,Ie=ae==null?0:ae.length;++he<Ie;)if(!me(ae[he],he,ae))return!1;return!0}function Js(ae,me){for(var he=-1,Ie=ae==null?0:ae.length,rt=0,Nt=[];++he<Ie;){var $n=ae[he];me($n,he,ae)&&(Nt[rt++]=$n)}return Nt}function Yp(ae,me){var he=ae==null?0:ae.length;return!!he&&jc(ae,me,0)>-1}function iv(ae,me,he){for(var Ie=-1,rt=ae==null?0:ae.length;++Ie<rt;)if(he(me,ae[Ie]))return!0;return!1}function pn(ae,me){for(var he=-1,Ie=ae==null?0:ae.length,rt=Array(Ie);++he<Ie;)rt[he]=me(ae[he],he,ae);return rt}function ea(ae,me){for(var he=-1,Ie=me.length,rt=ae.length;++he<Ie;)ae[rt+he]=me[he];return ae}function sv(ae,me,he,Ie){var rt=-1,Nt=ae==null?0:ae.length;for(Ie&&Nt&&(he=ae[++rt]);++rt<Nt;)he=me(he,ae[rt],rt,ae);return he}function cH(ae,me,he,Ie){var rt=ae==null?0:ae.length;for(Ie&&rt&&(he=ae[--rt]);rt--;)he=me(he,ae[rt],rt,ae);return he}function av(ae,me){for(var he=-1,Ie=ae==null?0:ae.length;++he<Ie;)if(me(ae[he],he,ae))return!0;return!1}var uH=lv("length");function dH(ae){return ae.split("")}function fH(ae){return ae.match(Vp)||[]}function tP(ae,me,he){var Ie;return he(ae,function(rt,Nt,$n){if(me(rt,Nt,$n))return Ie=Nt,!1}),Ie}function Kp(ae,me,he,Ie){for(var rt=ae.length,Nt=he+(Ie?1:-1);Ie?Nt--:++Nt<rt;)if(me(ae[Nt],Nt,ae))return Nt;return-1}function jc(ae,me,he){return me===me?CH(ae,me,he):Kp(ae,nP,he)}function hH(ae,me,he,Ie){for(var rt=he-1,Nt=ae.length;++rt<Nt;)if(Ie(ae[rt],me))return rt;return-1}function nP(ae){return ae!==ae}function rP(ae,me){var he=ae==null?0:ae.length;return he?uv(ae,me)/he:I}function lv(ae){return function(me){return me==null?n:me[ae]}}function cv(ae){return function(me){return ae==null?n:ae[me]}}function oP(ae,me,he,Ie,rt){return rt(ae,function(Nt,$n,Zt){he=Ie?(Ie=!1,Nt):me(he,Nt,$n,Zt)}),he}function pH(ae,me){var he=ae.length;for(ae.sort(me);he--;)ae[he]=ae[he].value;return ae}function uv(ae,me){for(var he,Ie=-1,rt=ae.length;++Ie<rt;){var Nt=me(ae[Ie]);Nt!==n&&(he=he===n?Nt:he+Nt)}return he}function dv(ae,me){for(var he=-1,Ie=Array(ae);++he<ae;)Ie[he]=me(he);return Ie}function gH(ae,me){return pn(me,function(he){return[he,ae[he]]})}function iP(ae){return ae&&ae.slice(0,cP(ae)+1).replace(mn,"")}function go(ae){return function(me){return ae(me)}}function fv(ae,me){return pn(me,function(he){return ae[he]})}function Vd(ae,me){return ae.has(me)}function sP(ae,me){for(var he=-1,Ie=ae.length;++he<Ie&&jc(me,ae[he],0)>-1;);return he}function aP(ae,me){for(var he=ae.length;he--&&jc(me,ae[he],0)>-1;);return he}function mH(ae,me){for(var he=ae.length,Ie=0;he--;)ae[he]===me&&++Ie;return Ie}var bH=cv(eH),yH=cv(tH);function vH(ae){return"\\"+rH[ae]}function xH(ae,me){return ae==null?n:ae[me]}function $c(ae){return XB.test(ae)}function wH(ae){return QB.test(ae)}function SH(ae){for(var me,he=[];!(me=ae.next()).done;)he.push(me.value);return he}function hv(ae){var me=-1,he=Array(ae.size);return ae.forEach(function(Ie,rt){he[++me]=[rt,Ie]}),he}function lP(ae,me){return function(he){return ae(me(he))}}function ta(ae,me){for(var he=-1,Ie=ae.length,rt=0,Nt=[];++he<Ie;){var $n=ae[he];($n===me||$n===u)&&(ae[he]=u,Nt[rt++]=he)}return Nt}function Xp(ae){var me=-1,he=Array(ae.size);return ae.forEach(function(Ie){he[++me]=Ie}),he}function _H(ae){var me=-1,he=Array(ae.size);return ae.forEach(function(Ie){he[++me]=[Ie,Ie]}),he}function CH(ae,me,he){for(var Ie=he-1,rt=ae.length;++Ie<rt;)if(ae[Ie]===me)return Ie;return-1}function EH(ae,me,he){for(var Ie=he+1;Ie--;)if(ae[Ie]===me)return Ie;return Ie}function zc(ae){return $c(ae)?PH(ae):uH(ae)}function ai(ae){return $c(ae)?TH(ae):dH(ae)}function cP(ae){for(var me=ae.length;me--&&Lc.test(ae.charAt(me)););return me}var RH=cv(nH);function PH(ae){for(var me=nv.lastIndex=0;nv.test(ae);)++me;return me}function TH(ae){return ae.match(nv)||[]}function kH(ae){return ae.match(KB)||[]}var AH=function ae(me){me=me==null?Jn:Bc.defaults(Jn.Object(),me,Bc.pick(Jn,ZB));var he=me.Array,Ie=me.Date,rt=me.Error,Nt=me.Function,$n=me.Math,Zt=me.Object,pv=me.RegExp,OH=me.String,Bo=me.TypeError,Qp=he.prototype,MH=Nt.prototype,Hc=Zt.prototype,Zp=me["__core-js_shared__"],Jp=MH.toString,Gt=Hc.hasOwnProperty,IH=0,uP=function(){var f=/[^.]+$/.exec(Zp&&Zp.keys&&Zp.keys.IE_PROTO||"");return f?"Symbol(src)_1."+f:""}(),eg=Hc.toString,DH=Jp.call(Zt),NH=Jn._,LH=pv("^"+Jp.call(Gt).replace(Br,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tg=q2?me.Buffer:n,na=me.Symbol,ng=me.Uint8Array,dP=tg?tg.allocUnsafe:n,rg=lP(Zt.getPrototypeOf,Zt),fP=Zt.create,hP=Hc.propertyIsEnumerable,og=Qp.splice,pP=na?na.isConcatSpreadable:n,Wd=na?na.iterator:n,ol=na?na.toStringTag:n,ig=function(){try{var f=cl(Zt,"defineProperty");return f({},"",{}),f}catch{}}(),FH=me.clearTimeout!==Jn.clearTimeout&&me.clearTimeout,jH=Ie&&Ie.now!==Jn.Date.now&&Ie.now,$H=me.setTimeout!==Jn.setTimeout&&me.setTimeout,sg=$n.ceil,ag=$n.floor,gv=Zt.getOwnPropertySymbols,zH=tg?tg.isBuffer:n,gP=me.isFinite,BH=Qp.join,HH=lP(Zt.keys,Zt),zn=$n.max,cr=$n.min,VH=Ie.now,WH=me.parseInt,mP=$n.random,UH=Qp.reverse,mv=cl(me,"DataView"),Ud=cl(me,"Map"),bv=cl(me,"Promise"),Vc=cl(me,"Set"),Gd=cl(me,"WeakMap"),qd=cl(Zt,"create"),lg=Gd&&new Gd,Wc={},GH=ul(mv),qH=ul(Ud),YH=ul(bv),KH=ul(Vc),XH=ul(Gd),cg=na?na.prototype:n,Yd=cg?cg.valueOf:n,bP=cg?cg.toString:n;function B(f){if(wn(f)&&!st(f)&&!(f instanceof Et)){if(f instanceof Ho)return f;if(Gt.call(f,"__wrapped__"))return yT(f)}return new Ho(f)}var Uc=function(){function f(){}return function(g){if(!bn(g))return{};if(fP)return fP(g);f.prototype=g;var S=new f;return f.prototype=n,S}}();function ug(){}function Ho(f,g){this.__wrapped__=f,this.__actions__=[],this.__chain__=!!g,this.__index__=0,this.__values__=n}B.templateSettings={escape:Le,evaluate:wt,interpolate:Wt,variable:"",imports:{_:B}},B.prototype=ug.prototype,B.prototype.constructor=B,Ho.prototype=Uc(ug.prototype),Ho.prototype.constructor=Ho;function Et(f){this.__wrapped__=f,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=q,this.__views__=[]}function QH(){var f=new Et(this.__wrapped__);return f.__actions__=Hr(this.__actions__),f.__dir__=this.__dir__,f.__filtered__=this.__filtered__,f.__iteratees__=Hr(this.__iteratees__),f.__takeCount__=this.__takeCount__,f.__views__=Hr(this.__views__),f}function ZH(){if(this.__filtered__){var f=new Et(this);f.__dir__=-1,f.__filtered__=!0}else f=this.clone(),f.__dir__*=-1;return f}function JH(){var f=this.__wrapped__.value(),g=this.__dir__,S=st(f),k=g<0,D=S?f.length:0,W=dW(0,D,this.__views__),Q=W.start,te=W.end,le=te-Q,ye=k?te:Q-1,xe=this.__iteratees__,we=xe.length,Ae=0,$e=cr(le,this.__takeCount__);if(!S||!k&&D==le&&$e==le)return BP(f,this.__actions__);var Ve=[];e:for(;le--&&Ae<$e;){ye+=g;for(var pt=-1,We=f[ye];++pt<we;){var St=xe[pt],Pt=St.iteratee,yo=St.type,Pr=Pt(We);if(yo==j)We=Pr;else if(!Pr){if(yo==G)continue e;break e}}Ve[Ae++]=We}return Ve}Et.prototype=Uc(ug.prototype),Et.prototype.constructor=Et;function il(f){var g=-1,S=f==null?0:f.length;for(this.clear();++g<S;){var k=f[g];this.set(k[0],k[1])}}function eV(){this.__data__=qd?qd(null):{},this.size=0}function tV(f){var g=this.has(f)&&delete this.__data__[f];return this.size-=g?1:0,g}function nV(f){var g=this.__data__;if(qd){var S=g[f];return S===l?n:S}return Gt.call(g,f)?g[f]:n}function rV(f){var g=this.__data__;return qd?g[f]!==n:Gt.call(g,f)}function oV(f,g){var S=this.__data__;return this.size+=this.has(f)?0:1,S[f]=qd&&g===n?l:g,this}il.prototype.clear=eV,il.prototype.delete=tV,il.prototype.get=nV,il.prototype.has=rV,il.prototype.set=oV;function ms(f){var g=-1,S=f==null?0:f.length;for(this.clear();++g<S;){var k=f[g];this.set(k[0],k[1])}}function iV(){this.__data__=[],this.size=0}function sV(f){var g=this.__data__,S=dg(g,f);if(S<0)return!1;var k=g.length-1;return S==k?g.pop():og.call(g,S,1),--this.size,!0}function aV(f){var g=this.__data__,S=dg(g,f);return S<0?n:g[S][1]}function lV(f){return dg(this.__data__,f)>-1}function cV(f,g){var S=this.__data__,k=dg(S,f);return k<0?(++this.size,S.push([f,g])):S[k][1]=g,this}ms.prototype.clear=iV,ms.prototype.delete=sV,ms.prototype.get=aV,ms.prototype.has=lV,ms.prototype.set=cV;function bs(f){var g=-1,S=f==null?0:f.length;for(this.clear();++g<S;){var k=f[g];this.set(k[0],k[1])}}function uV(){this.size=0,this.__data__={hash:new il,map:new(Ud||ms),string:new il}}function dV(f){var g=_g(this,f).delete(f);return this.size-=g?1:0,g}function fV(f){return _g(this,f).get(f)}function hV(f){return _g(this,f).has(f)}function pV(f,g){var S=_g(this,f),k=S.size;return S.set(f,g),this.size+=S.size==k?0:1,this}bs.prototype.clear=uV,bs.prototype.delete=dV,bs.prototype.get=fV,bs.prototype.has=hV,bs.prototype.set=pV;function sl(f){var g=-1,S=f==null?0:f.length;for(this.__data__=new bs;++g<S;)this.add(f[g])}function gV(f){return this.__data__.set(f,l),this}function mV(f){return this.__data__.has(f)}sl.prototype.add=sl.prototype.push=gV,sl.prototype.has=mV;function li(f){var g=this.__data__=new ms(f);this.size=g.size}function bV(){this.__data__=new ms,this.size=0}function yV(f){var g=this.__data__,S=g.delete(f);return this.size=g.size,S}function vV(f){return this.__data__.get(f)}function xV(f){return this.__data__.has(f)}function wV(f,g){var S=this.__data__;if(S instanceof ms){var k=S.__data__;if(!Ud||k.length<o-1)return k.push([f,g]),this.size=++S.size,this;S=this.__data__=new bs(k)}return S.set(f,g),this.size=S.size,this}li.prototype.clear=bV,li.prototype.delete=yV,li.prototype.get=vV,li.prototype.has=xV,li.prototype.set=wV;function yP(f,g){var S=st(f),k=!S&&dl(f),D=!S&&!k&&aa(f),W=!S&&!k&&!D&&Kc(f),Q=S||k||D||W,te=Q?dv(f.length,OH):[],le=te.length;for(var ye in f)(g||Gt.call(f,ye))&&!(Q&&(ye=="length"||D&&(ye=="offset"||ye=="parent")||W&&(ye=="buffer"||ye=="byteLength"||ye=="byteOffset")||ws(ye,le)))&&te.push(ye);return te}function vP(f){var g=f.length;return g?f[Tv(0,g-1)]:n}function SV(f,g){return Cg(Hr(f),al(g,0,f.length))}function _V(f){return Cg(Hr(f))}function yv(f,g,S){(S!==n&&!ci(f[g],S)||S===n&&!(g in f))&&ys(f,g,S)}function Kd(f,g,S){var k=f[g];(!(Gt.call(f,g)&&ci(k,S))||S===n&&!(g in f))&&ys(f,g,S)}function dg(f,g){for(var S=f.length;S--;)if(ci(f[S][0],g))return S;return-1}function CV(f,g,S,k){return ra(f,function(D,W,Q){g(k,D,S(D),Q)}),k}function xP(f,g){return f&&Ai(g,qn(g),f)}function EV(f,g){return f&&Ai(g,Wr(g),f)}function ys(f,g,S){g=="__proto__"&&ig?ig(f,g,{configurable:!0,enumerable:!0,value:S,writable:!0}):f[g]=S}function vv(f,g){for(var S=-1,k=g.length,D=he(k),W=f==null;++S<k;)D[S]=W?n:Jv(f,g[S]);return D}function al(f,g,S){return f===f&&(S!==n&&(f=f<=S?f:S),g!==n&&(f=f>=g?f:g)),f}function Vo(f,g,S,k,D,W){var Q,te=g&d,le=g&p,ye=g&h;if(S&&(Q=D?S(f,k,D,W):S(f)),Q!==n)return Q;if(!bn(f))return f;var xe=st(f);if(xe){if(Q=hW(f),!te)return Hr(f,Q)}else{var we=ur(f),Ae=we==se||we==pe;if(aa(f))return WP(f,te);if(we==Me||we==K||Ae&&!D){if(Q=le||Ae?{}:cT(f),!te)return le?nW(f,EV(Q,f)):tW(f,xP(Q,f))}else{if(!tn[we])return D?f:{};Q=pW(f,we,te)}}W||(W=new li);var $e=W.get(f);if($e)return $e;W.set(f,Q),jT(f)?f.forEach(function(We){Q.add(Vo(We,g,S,We,f,W))}):LT(f)&&f.forEach(function(We,St){Q.set(St,Vo(We,g,S,St,f,W))});var Ve=ye?le?$v:jv:le?Wr:qn,pt=xe?n:Ve(f);return zo(pt||f,function(We,St){pt&&(St=We,We=f[St]),Kd(Q,St,Vo(We,g,S,St,f,W))}),Q}function RV(f){var g=qn(f);return function(S){return wP(S,f,g)}}function wP(f,g,S){var k=S.length;if(f==null)return!k;for(f=Zt(f);k--;){var D=S[k],W=g[D],Q=f[D];if(Q===n&&!(D in f)||!W(Q))return!1}return!0}function SP(f,g,S){if(typeof f!="function")throw new Bo(s);return nf(function(){f.apply(n,S)},g)}function Xd(f,g,S,k){var D=-1,W=Yp,Q=!0,te=f.length,le=[],ye=g.length;if(!te)return le;S&&(g=pn(g,go(S))),k?(W=iv,Q=!1):g.length>=o&&(W=Vd,Q=!1,g=new sl(g));e:for(;++D<te;){var xe=f[D],we=S==null?xe:S(xe);if(xe=k||xe!==0?xe:0,Q&&we===we){for(var Ae=ye;Ae--;)if(g[Ae]===we)continue e;le.push(xe)}else W(g,we,k)||le.push(xe)}return le}var ra=KP(ki),_P=KP(wv,!0);function PV(f,g){var S=!0;return ra(f,function(k,D,W){return S=!!g(k,D,W),S}),S}function fg(f,g,S){for(var k=-1,D=f.length;++k<D;){var W=f[k],Q=g(W);if(Q!=null&&(te===n?Q===Q&&!bo(Q):S(Q,te)))var te=Q,le=W}return le}function TV(f,g,S,k){var D=f.length;for(S=ut(S),S<0&&(S=-S>D?0:D+S),k=k===n||k>D?D:ut(k),k<0&&(k+=D),k=S>k?0:zT(k);S<k;)f[S++]=g;return f}function CP(f,g){var S=[];return ra(f,function(k,D,W){g(k,D,W)&&S.push(k)}),S}function er(f,g,S,k,D){var W=-1,Q=f.length;for(S||(S=mW),D||(D=[]);++W<Q;){var te=f[W];g>0&&S(te)?g>1?er(te,g-1,S,k,D):ea(D,te):k||(D[D.length]=te)}return D}var xv=XP(),EP=XP(!0);function ki(f,g){return f&&xv(f,g,qn)}function wv(f,g){return f&&EP(f,g,qn)}function hg(f,g){return Js(g,function(S){return Ss(f[S])})}function ll(f,g){g=ia(g,f);for(var S=0,k=g.length;f!=null&&S<k;)f=f[Oi(g[S++])];return S&&S==k?f:n}function RP(f,g,S){var k=g(f);return st(f)?k:ea(k,S(f))}function Er(f){return f==null?f===n?Wn:Pe:ol&&ol in Zt(f)?uW(f):_W(f)}function Sv(f,g){return f>g}function kV(f,g){return f!=null&&Gt.call(f,g)}function AV(f,g){return f!=null&&g in Zt(f)}function OV(f,g,S){return f>=cr(g,S)&&f<zn(g,S)}function _v(f,g,S){for(var k=S?iv:Yp,D=f[0].length,W=f.length,Q=W,te=he(W),le=1/0,ye=[];Q--;){var xe=f[Q];Q&&g&&(xe=pn(xe,go(g))),le=cr(xe.length,le),te[Q]=!S&&(g||D>=120&&xe.length>=120)?new sl(Q&&xe):n}xe=f[0];var we=-1,Ae=te[0];e:for(;++we<D&&ye.length<le;){var $e=xe[we],Ve=g?g($e):$e;if($e=S||$e!==0?$e:0,!(Ae?Vd(Ae,Ve):k(ye,Ve,S))){for(Q=W;--Q;){var pt=te[Q];if(!(pt?Vd(pt,Ve):k(f[Q],Ve,S)))continue e}Ae&&Ae.push(Ve),ye.push($e)}}return ye}function MV(f,g,S,k){return ki(f,function(D,W,Q){g(k,S(D),W,Q)}),k}function Qd(f,g,S){g=ia(g,f),f=hT(f,g);var k=f==null?f:f[Oi(Uo(g))];return k==null?n:po(k,f,S)}function PP(f){return wn(f)&&Er(f)==K}function IV(f){return wn(f)&&Er(f)==Se}function DV(f){return wn(f)&&Er(f)==re}function Zd(f,g,S,k,D){return f===g?!0:f==null||g==null||!wn(f)&&!wn(g)?f!==f&&g!==g:NV(f,g,S,k,Zd,D)}function NV(f,g,S,k,D,W){var Q=st(f),te=st(g),le=Q?ne:ur(f),ye=te?ne:ur(g);le=le==K?Me:le,ye=ye==K?Me:ye;var xe=le==Me,we=ye==Me,Ae=le==ye;if(Ae&&aa(f)){if(!aa(g))return!1;Q=!0,xe=!1}if(Ae&&!xe)return W||(W=new li),Q||Kc(f)?sT(f,g,S,k,D,W):lW(f,g,le,S,k,D,W);if(!(S&m)){var $e=xe&&Gt.call(f,"__wrapped__"),Ve=we&&Gt.call(g,"__wrapped__");if($e||Ve){var pt=$e?f.value():f,We=Ve?g.value():g;return W||(W=new li),D(pt,We,S,k,W)}}return Ae?(W||(W=new li),cW(f,g,S,k,D,W)):!1}function LV(f){return wn(f)&&ur(f)==ce}function Cv(f,g,S,k){var D=S.length,W=D,Q=!k;if(f==null)return!W;for(f=Zt(f);D--;){var te=S[D];if(Q&&te[2]?te[1]!==f[te[0]]:!(te[0]in f))return!1}for(;++D<W;){te=S[D];var le=te[0],ye=f[le],xe=te[1];if(Q&&te[2]){if(ye===n&&!(le in f))return!1}else{var we=new li;if(k)var Ae=k(ye,xe,le,f,g,we);if(!(Ae===n?Zd(xe,ye,m|b,k,we):Ae))return!1}}return!0}function TP(f){if(!bn(f)||yW(f))return!1;var g=Ss(f)?LH:ze;return g.test(ul(f))}function FV(f){return wn(f)&&Er(f)==tt}function jV(f){return wn(f)&&ur(f)==ot}function $V(f){return wn(f)&&Ag(f.length)&&!!sn[Er(f)]}function kP(f){return typeof f=="function"?f:f==null?Ur:typeof f=="object"?st(f)?MP(f[0],f[1]):OP(f):QT(f)}function Ev(f){if(!tf(f))return HH(f);var g=[];for(var S in Zt(f))Gt.call(f,S)&&S!="constructor"&&g.push(S);return g}function zV(f){if(!bn(f))return SW(f);var g=tf(f),S=[];for(var k in f)k=="constructor"&&(g||!Gt.call(f,k))||S.push(k);return S}function Rv(f,g){return f<g}function AP(f,g){var S=-1,k=Vr(f)?he(f.length):[];return ra(f,function(D,W,Q){k[++S]=g(D,W,Q)}),k}function OP(f){var g=Bv(f);return g.length==1&&g[0][2]?dT(g[0][0],g[0][1]):function(S){return S===f||Cv(S,f,g)}}function MP(f,g){return Vv(f)&&uT(g)?dT(Oi(f),g):function(S){var k=Jv(S,f);return k===n&&k===g?ex(S,f):Zd(g,k,m|b)}}function pg(f,g,S,k,D){f!==g&&xv(g,function(W,Q){if(D||(D=new li),bn(W))BV(f,g,Q,S,pg,k,D);else{var te=k?k(Uv(f,Q),W,Q+"",f,g,D):n;te===n&&(te=W),yv(f,Q,te)}},Wr)}function BV(f,g,S,k,D,W,Q){var te=Uv(f,S),le=Uv(g,S),ye=Q.get(le);if(ye){yv(f,S,ye);return}var xe=W?W(te,le,S+"",f,g,Q):n,we=xe===n;if(we){var Ae=st(le),$e=!Ae&&aa(le),Ve=!Ae&&!$e&&Kc(le);xe=le,Ae||$e||Ve?st(te)?xe=te:Pn(te)?xe=Hr(te):$e?(we=!1,xe=WP(le,!0)):Ve?(we=!1,xe=UP(le,!0)):xe=[]:rf(le)||dl(le)?(xe=te,dl(te)?xe=BT(te):(!bn(te)||Ss(te))&&(xe=cT(le))):we=!1}we&&(Q.set(le,xe),D(xe,le,k,W,Q),Q.delete(le)),yv(f,S,xe)}function IP(f,g){var S=f.length;if(S)return g+=g<0?S:0,ws(g,S)?f[g]:n}function DP(f,g,S){g.length?g=pn(g,function(W){return st(W)?function(Q){return ll(Q,W.length===1?W[0]:W)}:W}):g=[Ur];var k=-1;g=pn(g,go(He()));var D=AP(f,function(W,Q,te){var le=pn(g,function(ye){return ye(W)});return{criteria:le,index:++k,value:W}});return pH(D,function(W,Q){return eW(W,Q,S)})}function HV(f,g){return NP(f,g,function(S,k){return ex(f,k)})}function NP(f,g,S){for(var k=-1,D=g.length,W={};++k<D;){var Q=g[k],te=ll(f,Q);S(te,Q)&&Jd(W,ia(Q,f),te)}return W}function VV(f){return function(g){return ll(g,f)}}function Pv(f,g,S,k){var D=k?hH:jc,W=-1,Q=g.length,te=f;for(f===g&&(g=Hr(g)),S&&(te=pn(f,go(S)));++W<Q;)for(var le=0,ye=g[W],xe=S?S(ye):ye;(le=D(te,xe,le,k))>-1;)te!==f&&og.call(te,le,1),og.call(f,le,1);return f}function LP(f,g){for(var S=f?g.length:0,k=S-1;S--;){var D=g[S];if(S==k||D!==W){var W=D;ws(D)?og.call(f,D,1):Ov(f,D)}}return f}function Tv(f,g){return f+ag(mP()*(g-f+1))}function WV(f,g,S,k){for(var D=-1,W=zn(sg((g-f)/(S||1)),0),Q=he(W);W--;)Q[k?W:++D]=f,f+=S;return Q}function kv(f,g){var S="";if(!f||g<1||g>V)return S;do g%2&&(S+=f),g=ag(g/2),g&&(f+=f);while(g);return S}function bt(f,g){return Gv(fT(f,g,Ur),f+"")}function UV(f){return vP(Xc(f))}function GV(f,g){var S=Xc(f);return Cg(S,al(g,0,S.length))}function Jd(f,g,S,k){if(!bn(f))return f;g=ia(g,f);for(var D=-1,W=g.length,Q=W-1,te=f;te!=null&&++D<W;){var le=Oi(g[D]),ye=S;if(le==="__proto__"||le==="constructor"||le==="prototype")return f;if(D!=Q){var xe=te[le];ye=k?k(xe,le,te):n,ye===n&&(ye=bn(xe)?xe:ws(g[D+1])?[]:{})}Kd(te,le,ye),te=te[le]}return f}var FP=lg?function(f,g){return lg.set(f,g),f}:Ur,qV=ig?function(f,g){return ig(f,"toString",{configurable:!0,enumerable:!1,value:nx(g),writable:!0})}:Ur;function YV(f){return Cg(Xc(f))}function Wo(f,g,S){var k=-1,D=f.length;g<0&&(g=-g>D?0:D+g),S=S>D?D:S,S<0&&(S+=D),D=g>S?0:S-g>>>0,g>>>=0;for(var W=he(D);++k<D;)W[k]=f[k+g];return W}function KV(f,g){var S;return ra(f,function(k,D,W){return S=g(k,D,W),!S}),!!S}function gg(f,g,S){var k=0,D=f==null?k:f.length;if(typeof g=="number"&&g===g&&D<=O){for(;k<D;){var W=k+D>>>1,Q=f[W];Q!==null&&!bo(Q)&&(S?Q<=g:Q<g)?k=W+1:D=W}return D}return Av(f,g,Ur,S)}function Av(f,g,S,k){var D=0,W=f==null?0:f.length;if(W===0)return 0;g=S(g);for(var Q=g!==g,te=g===null,le=bo(g),ye=g===n;D<W;){var xe=ag((D+W)/2),we=S(f[xe]),Ae=we!==n,$e=we===null,Ve=we===we,pt=bo(we);if(Q)var We=k||Ve;else ye?We=Ve&&(k||Ae):te?We=Ve&&Ae&&(k||!$e):le?We=Ve&&Ae&&!$e&&(k||!pt):$e||pt?We=!1:We=k?we<=g:we<g;We?D=xe+1:W=xe}return cr(W,U)}function jP(f,g){for(var S=-1,k=f.length,D=0,W=[];++S<k;){var Q=f[S],te=g?g(Q):Q;if(!S||!ci(te,le)){var le=te;W[D++]=Q===0?0:Q}}return W}function $P(f){return typeof f=="number"?f:bo(f)?I:+f}function mo(f){if(typeof f=="string")return f;if(st(f))return pn(f,mo)+"";if(bo(f))return bP?bP.call(f):"";var g=f+"";return g=="0"&&1/f==-1/0?"-0":g}function oa(f,g,S){var k=-1,D=Yp,W=f.length,Q=!0,te=[],le=te;if(S)Q=!1,D=iv;else if(W>=o){var ye=g?null:sW(f);if(ye)return Xp(ye);Q=!1,D=Vd,le=new sl}else le=g?[]:te;e:for(;++k<W;){var xe=f[k],we=g?g(xe):xe;if(xe=S||xe!==0?xe:0,Q&&we===we){for(var Ae=le.length;Ae--;)if(le[Ae]===we)continue e;g&&le.push(we),te.push(xe)}else D(le,we,S)||(le!==te&&le.push(we),te.push(xe))}return te}function Ov(f,g){return g=ia(g,f),f=hT(f,g),f==null||delete f[Oi(Uo(g))]}function zP(f,g,S,k){return Jd(f,g,S(ll(f,g)),k)}function mg(f,g,S,k){for(var D=f.length,W=k?D:-1;(k?W--:++W<D)&&g(f[W],W,f););return S?Wo(f,k?0:W,k?W+1:D):Wo(f,k?W+1:0,k?D:W)}function BP(f,g){var S=f;return S instanceof Et&&(S=S.value()),sv(g,function(k,D){return D.func.apply(D.thisArg,ea([k],D.args))},S)}function Mv(f,g,S){var k=f.length;if(k<2)return k?oa(f[0]):[];for(var D=-1,W=he(k);++D<k;)for(var Q=f[D],te=-1;++te<k;)te!=D&&(W[D]=Xd(W[D]||Q,f[te],g,S));return oa(er(W,1),g,S)}function HP(f,g,S){for(var k=-1,D=f.length,W=g.length,Q={};++k<D;){var te=k<W?g[k]:n;S(Q,f[k],te)}return Q}function Iv(f){return Pn(f)?f:[]}function Dv(f){return typeof f=="function"?f:Ur}function ia(f,g){return st(f)?f:Vv(f,g)?[f]:bT($t(f))}var XV=bt;function sa(f,g,S){var k=f.length;return S=S===n?k:S,!g&&S>=k?f:Wo(f,g,S)}var VP=FH||function(f){return Jn.clearTimeout(f)};function WP(f,g){if(g)return f.slice();var S=f.length,k=dP?dP(S):new f.constructor(S);return f.copy(k),k}function Nv(f){var g=new f.constructor(f.byteLength);return new ng(g).set(new ng(f)),g}function QV(f,g){var S=g?Nv(f.buffer):f.buffer;return new f.constructor(S,f.byteOffset,f.byteLength)}function ZV(f){var g=new f.constructor(f.source,zd.exec(f));return g.lastIndex=f.lastIndex,g}function JV(f){return Yd?Zt(Yd.call(f)):{}}function UP(f,g){var S=g?Nv(f.buffer):f.buffer;return new f.constructor(S,f.byteOffset,f.length)}function GP(f,g){if(f!==g){var S=f!==n,k=f===null,D=f===f,W=bo(f),Q=g!==n,te=g===null,le=g===g,ye=bo(g);if(!te&&!ye&&!W&&f>g||W&&Q&&le&&!te&&!ye||k&&Q&&le||!S&&le||!D)return 1;if(!k&&!W&&!ye&&f<g||ye&&S&&D&&!k&&!W||te&&S&&D||!Q&&D||!le)return-1}return 0}function eW(f,g,S){for(var k=-1,D=f.criteria,W=g.criteria,Q=D.length,te=S.length;++k<Q;){var le=GP(D[k],W[k]);if(le){if(k>=te)return le;var ye=S[k];return le*(ye=="desc"?-1:1)}}return f.index-g.index}function qP(f,g,S,k){for(var D=-1,W=f.length,Q=S.length,te=-1,le=g.length,ye=zn(W-Q,0),xe=he(le+ye),we=!k;++te<le;)xe[te]=g[te];for(;++D<Q;)(we||D<W)&&(xe[S[D]]=f[D]);for(;ye--;)xe[te++]=f[D++];return xe}function YP(f,g,S,k){for(var D=-1,W=f.length,Q=-1,te=S.length,le=-1,ye=g.length,xe=zn(W-te,0),we=he(xe+ye),Ae=!k;++D<xe;)we[D]=f[D];for(var $e=D;++le<ye;)we[$e+le]=g[le];for(;++Q<te;)(Ae||D<W)&&(we[$e+S[Q]]=f[D++]);return we}function Hr(f,g){var S=-1,k=f.length;for(g||(g=he(k));++S<k;)g[S]=f[S];return g}function Ai(f,g,S,k){var D=!S;S||(S={});for(var W=-1,Q=g.length;++W<Q;){var te=g[W],le=k?k(S[te],f[te],te,S,f):n;le===n&&(le=f[te]),D?ys(S,te,le):Kd(S,te,le)}return S}function tW(f,g){return Ai(f,Hv(f),g)}function nW(f,g){return Ai(f,aT(f),g)}function bg(f,g){return function(S,k){var D=st(S)?aH:CV,W=g?g():{};return D(S,f,He(k,2),W)}}function Gc(f){return bt(function(g,S){var k=-1,D=S.length,W=D>1?S[D-1]:n,Q=D>2?S[2]:n;for(W=f.length>3&&typeof W=="function"?(D--,W):n,Q&&Rr(S[0],S[1],Q)&&(W=D<3?n:W,D=1),g=Zt(g);++k<D;){var te=S[k];te&&f(g,te,k,W)}return g})}function KP(f,g){return function(S,k){if(S==null)return S;if(!Vr(S))return f(S,k);for(var D=S.length,W=g?D:-1,Q=Zt(S);(g?W--:++W<D)&&k(Q[W],W,Q)!==!1;);return S}}function XP(f){return function(g,S,k){for(var D=-1,W=Zt(g),Q=k(g),te=Q.length;te--;){var le=Q[f?te:++D];if(S(W[le],le,W)===!1)break}return g}}function rW(f,g,S){var k=g&v,D=ef(f);function W(){var Q=this&&this!==Jn&&this instanceof W?D:f;return Q.apply(k?S:this,arguments)}return W}function QP(f){return function(g){g=$t(g);var S=$c(g)?ai(g):n,k=S?S[0]:g.charAt(0),D=S?sa(S,1).join(""):g.slice(1);return k[f]()+D}}function qc(f){return function(g){return sv(KT(YT(g).replace(qB,"")),f,"")}}function ef(f){return function(){var g=arguments;switch(g.length){case 0:return new f;case 1:return new f(g[0]);case 2:return new f(g[0],g[1]);case 3:return new f(g[0],g[1],g[2]);case 4:return new f(g[0],g[1],g[2],g[3]);case 5:return new f(g[0],g[1],g[2],g[3],g[4]);case 6:return new f(g[0],g[1],g[2],g[3],g[4],g[5]);case 7:return new f(g[0],g[1],g[2],g[3],g[4],g[5],g[6])}var S=Uc(f.prototype),k=f.apply(S,g);return bn(k)?k:S}}function oW(f,g,S){var k=ef(f);function D(){for(var W=arguments.length,Q=he(W),te=W,le=Yc(D);te--;)Q[te]=arguments[te];var ye=W<3&&Q[0]!==le&&Q[W-1]!==le?[]:ta(Q,le);if(W-=ye.length,W<S)return nT(f,g,yg,D.placeholder,n,Q,ye,n,n,S-W);var xe=this&&this!==Jn&&this instanceof D?k:f;return po(xe,this,Q)}return D}function ZP(f){return function(g,S,k){var D=Zt(g);if(!Vr(g)){var W=He(S,3);g=qn(g),S=function(te){return W(D[te],te,D)}}var Q=f(g,S,k);return Q>-1?D[W?g[Q]:Q]:n}}function JP(f){return xs(function(g){var S=g.length,k=S,D=Ho.prototype.thru;for(f&&g.reverse();k--;){var W=g[k];if(typeof W!="function")throw new Bo(s);if(D&&!Q&&Sg(W)=="wrapper")var Q=new Ho([],!0)}for(k=Q?k:S;++k<S;){W=g[k];var te=Sg(W),le=te=="wrapper"?zv(W):n;le&&Wv(le[0])&&le[1]==(A|_|C|M)&&!le[4].length&&le[9]==1?Q=Q[Sg(le[0])].apply(Q,le[3]):Q=W.length==1&&Wv(W)?Q[te]():Q.thru(W)}return function(){var ye=arguments,xe=ye[0];if(Q&&ye.length==1&&st(xe))return Q.plant(xe).value();for(var we=0,Ae=S?g[we].apply(this,ye):xe;++we<S;)Ae=g[we].call(this,Ae);return Ae}})}function yg(f,g,S,k,D,W,Q,te,le,ye){var xe=g&A,we=g&v,Ae=g&x,$e=g&(_|R),Ve=g&N,pt=Ae?n:ef(f);function We(){for(var St=arguments.length,Pt=he(St),yo=St;yo--;)Pt[yo]=arguments[yo];if($e)var Pr=Yc(We),vo=mH(Pt,Pr);if(k&&(Pt=qP(Pt,k,D,$e)),W&&(Pt=YP(Pt,W,Q,$e)),St-=vo,$e&&St<ye){var Tn=ta(Pt,Pr);return nT(f,g,yg,We.placeholder,S,Pt,Tn,te,le,ye-St)}var ui=we?S:this,Cs=Ae?ui[f]:f;return St=Pt.length,te?Pt=CW(Pt,te):Ve&&St>1&&Pt.reverse(),xe&&le<St&&(Pt.length=le),this&&this!==Jn&&this instanceof We&&(Cs=pt||ef(Cs)),Cs.apply(ui,Pt)}return We}function eT(f,g){return function(S,k){return MV(S,f,g(k),{})}}function vg(f,g){return function(S,k){var D;if(S===n&&k===n)return g;if(S!==n&&(D=S),k!==n){if(D===n)return k;typeof S=="string"||typeof k=="string"?(S=mo(S),k=mo(k)):(S=$P(S),k=$P(k)),D=f(S,k)}return D}}function Lv(f){return xs(function(g){return g=pn(g,go(He())),bt(function(S){var k=this;return f(g,function(D){return po(D,k,S)})})})}function xg(f,g){g=g===n?" ":mo(g);var S=g.length;if(S<2)return S?kv(g,f):g;var k=kv(g,sg(f/zc(g)));return $c(g)?sa(ai(k),0,f).join(""):k.slice(0,f)}function iW(f,g,S,k){var D=g&v,W=ef(f);function Q(){for(var te=-1,le=arguments.length,ye=-1,xe=k.length,we=he(xe+le),Ae=this&&this!==Jn&&this instanceof Q?W:f;++ye<xe;)we[ye]=k[ye];for(;le--;)we[ye++]=arguments[++te];return po(Ae,D?S:this,we)}return Q}function tT(f){return function(g,S,k){return k&&typeof k!="number"&&Rr(g,S,k)&&(S=k=n),g=_s(g),S===n?(S=g,g=0):S=_s(S),k=k===n?g<S?1:-1:_s(k),WV(g,S,k,f)}}function wg(f){return function(g,S){return typeof g=="string"&&typeof S=="string"||(g=Go(g),S=Go(S)),f(g,S)}}function nT(f,g,S,k,D,W,Q,te,le,ye){var xe=g&_,we=xe?Q:n,Ae=xe?n:Q,$e=xe?W:n,Ve=xe?n:W;g|=xe?C:E,g&=~(xe?E:C),g&w||(g&=-4);var pt=[f,g,D,$e,we,Ve,Ae,te,le,ye],We=S.apply(n,pt);return Wv(f)&&pT(We,pt),We.placeholder=k,gT(We,f,g)}function Fv(f){var g=$n[f];return function(S,k){if(S=Go(S),k=k==null?0:cr(ut(k),292),k&&gP(S)){var D=($t(S)+"e").split("e"),W=g(D[0]+"e"+(+D[1]+k));return D=($t(W)+"e").split("e"),+(D[0]+"e"+(+D[1]-k))}return g(S)}}var sW=Vc&&1/Xp(new Vc([,-0]))[1]==$?function(f){return new Vc(f)}:ix;function rT(f){return function(g){var S=ur(g);return S==ce?hv(g):S==ot?_H(g):gH(g,f(g))}}function vs(f,g,S,k,D,W,Q,te){var le=g&x;if(!le&&typeof f!="function")throw new Bo(s);var ye=k?k.length:0;if(ye||(g&=-97,k=D=n),Q=Q===n?Q:zn(ut(Q),0),te=te===n?te:ut(te),ye-=D?D.length:0,g&E){var xe=k,we=D;k=D=n}var Ae=le?n:zv(f),$e=[f,g,S,k,D,xe,we,W,Q,te];if(Ae&&wW($e,Ae),f=$e[0],g=$e[1],S=$e[2],k=$e[3],D=$e[4],te=$e[9]=$e[9]===n?le?0:f.length:zn($e[9]-ye,0),!te&&g&(_|R)&&(g&=-25),!g||g==v)var Ve=rW(f,g,S);else g==_||g==R?Ve=oW(f,g,te):(g==C||g==(v|C))&&!D.length?Ve=iW(f,g,S,k):Ve=yg.apply(n,$e);var pt=Ae?FP:pT;return gT(pt(Ve,$e),f,g)}function oT(f,g,S,k){return f===n||ci(f,Hc[S])&&!Gt.call(k,S)?g:f}function iT(f,g,S,k,D,W){return bn(f)&&bn(g)&&(W.set(g,f),pg(f,g,n,iT,W),W.delete(g)),f}function aW(f){return rf(f)?n:f}function sT(f,g,S,k,D,W){var Q=S&m,te=f.length,le=g.length;if(te!=le&&!(Q&&le>te))return!1;var ye=W.get(f),xe=W.get(g);if(ye&&xe)return ye==g&&xe==f;var we=-1,Ae=!0,$e=S&b?new sl:n;for(W.set(f,g),W.set(g,f);++we<te;){var Ve=f[we],pt=g[we];if(k)var We=Q?k(pt,Ve,we,g,f,W):k(Ve,pt,we,f,g,W);if(We!==n){if(We)continue;Ae=!1;break}if($e){if(!av(g,function(St,Pt){if(!Vd($e,Pt)&&(Ve===St||D(Ve,St,S,k,W)))return $e.push(Pt)})){Ae=!1;break}}else if(!(Ve===pt||D(Ve,pt,S,k,W))){Ae=!1;break}}return W.delete(f),W.delete(g),Ae}function lW(f,g,S,k,D,W,Q){switch(S){case je:if(f.byteLength!=g.byteLength||f.byteOffset!=g.byteOffset)return!1;f=f.buffer,g=g.buffer;case Se:return!(f.byteLength!=g.byteLength||!W(new ng(f),new ng(g)));case ee:case re:case _e:return ci(+f,+g);case fe:return f.name==g.name&&f.message==g.message;case tt:case gn:return f==g+"";case ce:var te=hv;case ot:var le=k&m;if(te||(te=Xp),f.size!=g.size&&!le)return!1;var ye=Q.get(f);if(ye)return ye==g;k|=b,Q.set(f,g);var xe=sT(te(f),te(g),k,D,W,Q);return Q.delete(f),xe;case xt:if(Yd)return Yd.call(f)==Yd.call(g)}return!1}function cW(f,g,S,k,D,W){var Q=S&m,te=jv(f),le=te.length,ye=jv(g),xe=ye.length;if(le!=xe&&!Q)return!1;for(var we=le;we--;){var Ae=te[we];if(!(Q?Ae in g:Gt.call(g,Ae)))return!1}var $e=W.get(f),Ve=W.get(g);if($e&&Ve)return $e==g&&Ve==f;var pt=!0;W.set(f,g),W.set(g,f);for(var We=Q;++we<le;){Ae=te[we];var St=f[Ae],Pt=g[Ae];if(k)var yo=Q?k(Pt,St,Ae,g,f,W):k(St,Pt,Ae,f,g,W);if(!(yo===n?St===Pt||D(St,Pt,S,k,W):yo)){pt=!1;break}We||(We=Ae=="constructor")}if(pt&&!We){var Pr=f.constructor,vo=g.constructor;Pr!=vo&&"constructor"in f&&"constructor"in g&&!(typeof Pr=="function"&&Pr instanceof Pr&&typeof vo=="function"&&vo instanceof vo)&&(pt=!1)}return W.delete(f),W.delete(g),pt}function xs(f){return Gv(fT(f,n,wT),f+"")}function jv(f){return RP(f,qn,Hv)}function $v(f){return RP(f,Wr,aT)}var zv=lg?function(f){return lg.get(f)}:ix;function Sg(f){for(var g=f.name+"",S=Wc[g],k=Gt.call(Wc,g)?S.length:0;k--;){var D=S[k],W=D.func;if(W==null||W==f)return D.name}return g}function Yc(f){var g=Gt.call(B,"placeholder")?B:f;return g.placeholder}function He(){var f=B.iteratee||rx;return f=f===rx?kP:f,arguments.length?f(arguments[0],arguments[1]):f}function _g(f,g){var S=f.__data__;return bW(g)?S[typeof g=="string"?"string":"hash"]:S.map}function Bv(f){for(var g=qn(f),S=g.length;S--;){var k=g[S],D=f[k];g[S]=[k,D,uT(D)]}return g}function cl(f,g){var S=xH(f,g);return TP(S)?S:n}function uW(f){var g=Gt.call(f,ol),S=f[ol];try{f[ol]=n;var k=!0}catch{}var D=eg.call(f);return k&&(g?f[ol]=S:delete f[ol]),D}var Hv=gv?function(f){return f==null?[]:(f=Zt(f),Js(gv(f),function(g){return hP.call(f,g)}))}:sx,aT=gv?function(f){for(var g=[];f;)ea(g,Hv(f)),f=rg(f);return g}:sx,ur=Er;(mv&&ur(new mv(new ArrayBuffer(1)))!=je||Ud&&ur(new Ud)!=ce||bv&&ur(bv.resolve())!=ke||Vc&&ur(new Vc)!=ot||Gd&&ur(new Gd)!=Rt)&&(ur=function(f){var g=Er(f),S=g==Me?f.constructor:n,k=S?ul(S):"";if(k)switch(k){case GH:return je;case qH:return ce;case YH:return ke;case KH:return ot;case XH:return Rt}return g});function dW(f,g,S){for(var k=-1,D=S.length;++k<D;){var W=S[k],Q=W.size;switch(W.type){case"drop":f+=Q;break;case"dropRight":g-=Q;break;case"take":g=cr(g,f+Q);break;case"takeRight":f=zn(f,g-Q);break}}return{start:f,end:g}}function fW(f){var g=f.match(Hp);return g?g[1].split($d):[]}function lT(f,g,S){g=ia(g,f);for(var k=-1,D=g.length,W=!1;++k<D;){var Q=Oi(g[k]);if(!(W=f!=null&&S(f,Q)))break;f=f[Q]}return W||++k!=D?W:(D=f==null?0:f.length,!!D&&Ag(D)&&ws(Q,D)&&(st(f)||dl(f)))}function hW(f){var g=f.length,S=new f.constructor(g);return g&&typeof f[0]=="string"&&Gt.call(f,"index")&&(S.index=f.index,S.input=f.input),S}function cT(f){return typeof f.constructor=="function"&&!tf(f)?Uc(rg(f)):{}}function pW(f,g,S){var k=f.constructor;switch(g){case Se:return Nv(f);case ee:case re:return new k(+f);case je:return QV(f,S);case Be:case it:case On:case Fn:case vn:case en:case jn:case Kt:case sr:return UP(f,S);case ce:return new k;case _e:case gn:return new k(f);case tt:return ZV(f);case ot:return new k;case xt:return JV(f)}}function gW(f,g){var S=g.length;if(!S)return f;var k=S-1;return g[k]=(S>1?"& ":"")+g[k],g=g.join(S>2?", ":" "),f.replace(Bp,`{
|
|
44
|
+
/* [wrapped with `+g+`] */
|
|
45
|
+
`)}function mW(f){return st(f)||dl(f)||!!(pP&&f&&f[pP])}function ws(f,g){var S=typeof f;return g=g??V,!!g&&(S=="number"||S!="symbol"&&Ee.test(f))&&f>-1&&f%1==0&&f<g}function Rr(f,g,S){if(!bn(S))return!1;var k=typeof g;return(k=="number"?Vr(S)&&ws(g,S.length):k=="string"&&g in S)?ci(S[g],f):!1}function Vv(f,g){if(st(f))return!1;var S=typeof f;return S=="number"||S=="symbol"||S=="boolean"||f==null||bo(f)?!0:Zn.test(f)||!ar.test(f)||g!=null&&f in Zt(g)}function bW(f){var g=typeof f;return g=="string"||g=="number"||g=="symbol"||g=="boolean"?f!=="__proto__":f===null}function Wv(f){var g=Sg(f),S=B[g];if(typeof S!="function"||!(g in Et.prototype))return!1;if(f===S)return!0;var k=zv(S);return!!k&&f===k[0]}function yW(f){return!!uP&&uP in f}var vW=Zp?Ss:ax;function tf(f){var g=f&&f.constructor,S=typeof g=="function"&&g.prototype||Hc;return f===S}function uT(f){return f===f&&!bn(f)}function dT(f,g){return function(S){return S==null?!1:S[f]===g&&(g!==n||f in Zt(S))}}function xW(f){var g=Tg(f,function(k){return S.size===c&&S.clear(),k}),S=g.cache;return g}function wW(f,g){var S=f[1],k=g[1],D=S|k,W=D<(v|x|A),Q=k==A&&S==_||k==A&&S==M&&f[7].length<=g[8]||k==(A|M)&&g[7].length<=g[8]&&S==_;if(!(W||Q))return f;k&v&&(f[2]=g[2],D|=S&v?0:w);var te=g[3];if(te){var le=f[3];f[3]=le?qP(le,te,g[4]):te,f[4]=le?ta(f[3],u):g[4]}return te=g[5],te&&(le=f[5],f[5]=le?YP(le,te,g[6]):te,f[6]=le?ta(f[5],u):g[6]),te=g[7],te&&(f[7]=te),k&A&&(f[8]=f[8]==null?g[8]:cr(f[8],g[8])),f[9]==null&&(f[9]=g[9]),f[0]=g[0],f[1]=D,f}function SW(f){var g=[];if(f!=null)for(var S in Zt(f))g.push(S);return g}function _W(f){return eg.call(f)}function fT(f,g,S){return g=zn(g===n?f.length-1:g,0),function(){for(var k=arguments,D=-1,W=zn(k.length-g,0),Q=he(W);++D<W;)Q[D]=k[g+D];D=-1;for(var te=he(g+1);++D<g;)te[D]=k[D];return te[g]=S(Q),po(f,this,te)}}function hT(f,g){return g.length<2?f:ll(f,Wo(g,0,-1))}function CW(f,g){for(var S=f.length,k=cr(g.length,S),D=Hr(f);k--;){var W=g[k];f[k]=ws(W,S)?D[W]:n}return f}function Uv(f,g){if(!(g==="constructor"&&typeof f[g]=="function")&&g!="__proto__")return f[g]}var pT=mT(FP),nf=$H||function(f,g){return Jn.setTimeout(f,g)},Gv=mT(qV);function gT(f,g,S){var k=g+"";return Gv(f,gW(k,EW(fW(k),S)))}function mT(f){var g=0,S=0;return function(){var k=VH(),D=Z-(k-S);if(S=k,D>0){if(++g>=z)return arguments[0]}else g=0;return f.apply(n,arguments)}}function Cg(f,g){var S=-1,k=f.length,D=k-1;for(g=g===n?k:g;++S<g;){var W=Tv(S,D),Q=f[W];f[W]=f[S],f[S]=Q}return f.length=g,f}var bT=xW(function(f){var g=[];return f.charCodeAt(0)===46&&g.push(""),f.replace(ho,function(S,k,D,W){g.push(D?W.replace(Wp,"$1"):k||S)}),g});function Oi(f){if(typeof f=="string"||bo(f))return f;var g=f+"";return g=="0"&&1/f==-1/0?"-0":g}function ul(f){if(f!=null){try{return Jp.call(f)}catch{}try{return f+""}catch{}}return""}function EW(f,g){return zo(J,function(S){var k="_."+S[0];g&S[1]&&!Yp(f,k)&&f.push(k)}),f.sort()}function yT(f){if(f instanceof Et)return f.clone();var g=new Ho(f.__wrapped__,f.__chain__);return g.__actions__=Hr(f.__actions__),g.__index__=f.__index__,g.__values__=f.__values__,g}function RW(f,g,S){(S?Rr(f,g,S):g===n)?g=1:g=zn(ut(g),0);var k=f==null?0:f.length;if(!k||g<1)return[];for(var D=0,W=0,Q=he(sg(k/g));D<k;)Q[W++]=Wo(f,D,D+=g);return Q}function PW(f){for(var g=-1,S=f==null?0:f.length,k=0,D=[];++g<S;){var W=f[g];W&&(D[k++]=W)}return D}function TW(){var f=arguments.length;if(!f)return[];for(var g=he(f-1),S=arguments[0],k=f;k--;)g[k-1]=arguments[k];return ea(st(S)?Hr(S):[S],er(g,1))}var kW=bt(function(f,g){return Pn(f)?Xd(f,er(g,1,Pn,!0)):[]}),AW=bt(function(f,g){var S=Uo(g);return Pn(S)&&(S=n),Pn(f)?Xd(f,er(g,1,Pn,!0),He(S,2)):[]}),OW=bt(function(f,g){var S=Uo(g);return Pn(S)&&(S=n),Pn(f)?Xd(f,er(g,1,Pn,!0),n,S):[]});function MW(f,g,S){var k=f==null?0:f.length;return k?(g=S||g===n?1:ut(g),Wo(f,g<0?0:g,k)):[]}function IW(f,g,S){var k=f==null?0:f.length;return k?(g=S||g===n?1:ut(g),g=k-g,Wo(f,0,g<0?0:g)):[]}function DW(f,g){return f&&f.length?mg(f,He(g,3),!0,!0):[]}function NW(f,g){return f&&f.length?mg(f,He(g,3),!0):[]}function LW(f,g,S,k){var D=f==null?0:f.length;return D?(S&&typeof S!="number"&&Rr(f,g,S)&&(S=0,k=D),TV(f,g,S,k)):[]}function vT(f,g,S){var k=f==null?0:f.length;if(!k)return-1;var D=S==null?0:ut(S);return D<0&&(D=zn(k+D,0)),Kp(f,He(g,3),D)}function xT(f,g,S){var k=f==null?0:f.length;if(!k)return-1;var D=k-1;return S!==n&&(D=ut(S),D=S<0?zn(k+D,0):cr(D,k-1)),Kp(f,He(g,3),D,!0)}function wT(f){var g=f==null?0:f.length;return g?er(f,1):[]}function FW(f){var g=f==null?0:f.length;return g?er(f,$):[]}function jW(f,g){var S=f==null?0:f.length;return S?(g=g===n?1:ut(g),er(f,g)):[]}function $W(f){for(var g=-1,S=f==null?0:f.length,k={};++g<S;){var D=f[g];k[D[0]]=D[1]}return k}function ST(f){return f&&f.length?f[0]:n}function zW(f,g,S){var k=f==null?0:f.length;if(!k)return-1;var D=S==null?0:ut(S);return D<0&&(D=zn(k+D,0)),jc(f,g,D)}function BW(f){var g=f==null?0:f.length;return g?Wo(f,0,-1):[]}var HW=bt(function(f){var g=pn(f,Iv);return g.length&&g[0]===f[0]?_v(g):[]}),VW=bt(function(f){var g=Uo(f),S=pn(f,Iv);return g===Uo(S)?g=n:S.pop(),S.length&&S[0]===f[0]?_v(S,He(g,2)):[]}),WW=bt(function(f){var g=Uo(f),S=pn(f,Iv);return g=typeof g=="function"?g:n,g&&S.pop(),S.length&&S[0]===f[0]?_v(S,n,g):[]});function UW(f,g){return f==null?"":BH.call(f,g)}function Uo(f){var g=f==null?0:f.length;return g?f[g-1]:n}function GW(f,g,S){var k=f==null?0:f.length;if(!k)return-1;var D=k;return S!==n&&(D=ut(S),D=D<0?zn(k+D,0):cr(D,k-1)),g===g?EH(f,g,D):Kp(f,nP,D,!0)}function qW(f,g){return f&&f.length?IP(f,ut(g)):n}var YW=bt(_T);function _T(f,g){return f&&f.length&&g&&g.length?Pv(f,g):f}function KW(f,g,S){return f&&f.length&&g&&g.length?Pv(f,g,He(S,2)):f}function XW(f,g,S){return f&&f.length&&g&&g.length?Pv(f,g,n,S):f}var QW=xs(function(f,g){var S=f==null?0:f.length,k=vv(f,g);return LP(f,pn(g,function(D){return ws(D,S)?+D:D}).sort(GP)),k});function ZW(f,g){var S=[];if(!(f&&f.length))return S;var k=-1,D=[],W=f.length;for(g=He(g,3);++k<W;){var Q=f[k];g(Q,k,f)&&(S.push(Q),D.push(k))}return LP(f,D),S}function qv(f){return f==null?f:UH.call(f)}function JW(f,g,S){var k=f==null?0:f.length;return k?(S&&typeof S!="number"&&Rr(f,g,S)?(g=0,S=k):(g=g==null?0:ut(g),S=S===n?k:ut(S)),Wo(f,g,S)):[]}function eU(f,g){return gg(f,g)}function tU(f,g,S){return Av(f,g,He(S,2))}function nU(f,g){var S=f==null?0:f.length;if(S){var k=gg(f,g);if(k<S&&ci(f[k],g))return k}return-1}function rU(f,g){return gg(f,g,!0)}function oU(f,g,S){return Av(f,g,He(S,2),!0)}function iU(f,g){var S=f==null?0:f.length;if(S){var k=gg(f,g,!0)-1;if(ci(f[k],g))return k}return-1}function sU(f){return f&&f.length?jP(f):[]}function aU(f,g){return f&&f.length?jP(f,He(g,2)):[]}function lU(f){var g=f==null?0:f.length;return g?Wo(f,1,g):[]}function cU(f,g,S){return f&&f.length?(g=S||g===n?1:ut(g),Wo(f,0,g<0?0:g)):[]}function uU(f,g,S){var k=f==null?0:f.length;return k?(g=S||g===n?1:ut(g),g=k-g,Wo(f,g<0?0:g,k)):[]}function dU(f,g){return f&&f.length?mg(f,He(g,3),!1,!0):[]}function fU(f,g){return f&&f.length?mg(f,He(g,3)):[]}var hU=bt(function(f){return oa(er(f,1,Pn,!0))}),pU=bt(function(f){var g=Uo(f);return Pn(g)&&(g=n),oa(er(f,1,Pn,!0),He(g,2))}),gU=bt(function(f){var g=Uo(f);return g=typeof g=="function"?g:n,oa(er(f,1,Pn,!0),n,g)});function mU(f){return f&&f.length?oa(f):[]}function bU(f,g){return f&&f.length?oa(f,He(g,2)):[]}function yU(f,g){return g=typeof g=="function"?g:n,f&&f.length?oa(f,n,g):[]}function Yv(f){if(!(f&&f.length))return[];var g=0;return f=Js(f,function(S){if(Pn(S))return g=zn(S.length,g),!0}),dv(g,function(S){return pn(f,lv(S))})}function CT(f,g){if(!(f&&f.length))return[];var S=Yv(f);return g==null?S:pn(S,function(k){return po(g,n,k)})}var vU=bt(function(f,g){return Pn(f)?Xd(f,g):[]}),xU=bt(function(f){return Mv(Js(f,Pn))}),wU=bt(function(f){var g=Uo(f);return Pn(g)&&(g=n),Mv(Js(f,Pn),He(g,2))}),SU=bt(function(f){var g=Uo(f);return g=typeof g=="function"?g:n,Mv(Js(f,Pn),n,g)}),_U=bt(Yv);function CU(f,g){return HP(f||[],g||[],Kd)}function EU(f,g){return HP(f||[],g||[],Jd)}var RU=bt(function(f){var g=f.length,S=g>1?f[g-1]:n;return S=typeof S=="function"?(f.pop(),S):n,CT(f,S)});function ET(f){var g=B(f);return g.__chain__=!0,g}function PU(f,g){return g(f),f}function Eg(f,g){return g(f)}var TU=xs(function(f){var g=f.length,S=g?f[0]:0,k=this.__wrapped__,D=function(W){return vv(W,f)};return g>1||this.__actions__.length||!(k instanceof Et)||!ws(S)?this.thru(D):(k=k.slice(S,+S+(g?1:0)),k.__actions__.push({func:Eg,args:[D],thisArg:n}),new Ho(k,this.__chain__).thru(function(W){return g&&!W.length&&W.push(n),W}))});function kU(){return ET(this)}function AU(){return new Ho(this.value(),this.__chain__)}function OU(){this.__values__===n&&(this.__values__=$T(this.value()));var f=this.__index__>=this.__values__.length,g=f?n:this.__values__[this.__index__++];return{done:f,value:g}}function MU(){return this}function IU(f){for(var g,S=this;S instanceof ug;){var k=yT(S);k.__index__=0,k.__values__=n,g?D.__wrapped__=k:g=k;var D=k;S=S.__wrapped__}return D.__wrapped__=f,g}function DU(){var f=this.__wrapped__;if(f instanceof Et){var g=f;return this.__actions__.length&&(g=new Et(this)),g=g.reverse(),g.__actions__.push({func:Eg,args:[qv],thisArg:n}),new Ho(g,this.__chain__)}return this.thru(qv)}function NU(){return BP(this.__wrapped__,this.__actions__)}var LU=bg(function(f,g,S){Gt.call(f,S)?++f[S]:ys(f,S,1)});function FU(f,g,S){var k=st(f)?eP:PV;return S&&Rr(f,g,S)&&(g=n),k(f,He(g,3))}function jU(f,g){var S=st(f)?Js:CP;return S(f,He(g,3))}var $U=ZP(vT),zU=ZP(xT);function BU(f,g){return er(Rg(f,g),1)}function HU(f,g){return er(Rg(f,g),$)}function VU(f,g,S){return S=S===n?1:ut(S),er(Rg(f,g),S)}function RT(f,g){var S=st(f)?zo:ra;return S(f,He(g,3))}function PT(f,g){var S=st(f)?lH:_P;return S(f,He(g,3))}var WU=bg(function(f,g,S){Gt.call(f,S)?f[S].push(g):ys(f,S,[g])});function UU(f,g,S,k){f=Vr(f)?f:Xc(f),S=S&&!k?ut(S):0;var D=f.length;return S<0&&(S=zn(D+S,0)),Og(f)?S<=D&&f.indexOf(g,S)>-1:!!D&&jc(f,g,S)>-1}var GU=bt(function(f,g,S){var k=-1,D=typeof g=="function",W=Vr(f)?he(f.length):[];return ra(f,function(Q){W[++k]=D?po(g,Q,S):Qd(Q,g,S)}),W}),qU=bg(function(f,g,S){ys(f,S,g)});function Rg(f,g){var S=st(f)?pn:AP;return S(f,He(g,3))}function YU(f,g,S,k){return f==null?[]:(st(g)||(g=g==null?[]:[g]),S=k?n:S,st(S)||(S=S==null?[]:[S]),DP(f,g,S))}var KU=bg(function(f,g,S){f[S?0:1].push(g)},function(){return[[],[]]});function XU(f,g,S){var k=st(f)?sv:oP,D=arguments.length<3;return k(f,He(g,4),S,D,ra)}function QU(f,g,S){var k=st(f)?cH:oP,D=arguments.length<3;return k(f,He(g,4),S,D,_P)}function ZU(f,g){var S=st(f)?Js:CP;return S(f,kg(He(g,3)))}function JU(f){var g=st(f)?vP:UV;return g(f)}function eG(f,g,S){(S?Rr(f,g,S):g===n)?g=1:g=ut(g);var k=st(f)?SV:GV;return k(f,g)}function tG(f){var g=st(f)?_V:YV;return g(f)}function nG(f){if(f==null)return 0;if(Vr(f))return Og(f)?zc(f):f.length;var g=ur(f);return g==ce||g==ot?f.size:Ev(f).length}function rG(f,g,S){var k=st(f)?av:KV;return S&&Rr(f,g,S)&&(g=n),k(f,He(g,3))}var oG=bt(function(f,g){if(f==null)return[];var S=g.length;return S>1&&Rr(f,g[0],g[1])?g=[]:S>2&&Rr(g[0],g[1],g[2])&&(g=[g[0]]),DP(f,er(g,1),[])}),Pg=jH||function(){return Jn.Date.now()};function iG(f,g){if(typeof g!="function")throw new Bo(s);return f=ut(f),function(){if(--f<1)return g.apply(this,arguments)}}function TT(f,g,S){return g=S?n:g,g=f&&g==null?f.length:g,vs(f,A,n,n,n,n,g)}function kT(f,g){var S;if(typeof g!="function")throw new Bo(s);return f=ut(f),function(){return--f>0&&(S=g.apply(this,arguments)),f<=1&&(g=n),S}}var Kv=bt(function(f,g,S){var k=v;if(S.length){var D=ta(S,Yc(Kv));k|=C}return vs(f,k,g,S,D)}),AT=bt(function(f,g,S){var k=v|x;if(S.length){var D=ta(S,Yc(AT));k|=C}return vs(g,k,f,S,D)});function OT(f,g,S){g=S?n:g;var k=vs(f,_,n,n,n,n,n,g);return k.placeholder=OT.placeholder,k}function MT(f,g,S){g=S?n:g;var k=vs(f,R,n,n,n,n,n,g);return k.placeholder=MT.placeholder,k}function IT(f,g,S){var k,D,W,Q,te,le,ye=0,xe=!1,we=!1,Ae=!0;if(typeof f!="function")throw new Bo(s);g=Go(g)||0,bn(S)&&(xe=!!S.leading,we="maxWait"in S,W=we?zn(Go(S.maxWait)||0,g):W,Ae="trailing"in S?!!S.trailing:Ae);function $e(Tn){var ui=k,Cs=D;return k=D=n,ye=Tn,Q=f.apply(Cs,ui),Q}function Ve(Tn){return ye=Tn,te=nf(St,g),xe?$e(Tn):Q}function pt(Tn){var ui=Tn-le,Cs=Tn-ye,ZT=g-ui;return we?cr(ZT,W-Cs):ZT}function We(Tn){var ui=Tn-le,Cs=Tn-ye;return le===n||ui>=g||ui<0||we&&Cs>=W}function St(){var Tn=Pg();if(We(Tn))return Pt(Tn);te=nf(St,pt(Tn))}function Pt(Tn){return te=n,Ae&&k?$e(Tn):(k=D=n,Q)}function yo(){te!==n&&VP(te),ye=0,k=le=D=te=n}function Pr(){return te===n?Q:Pt(Pg())}function vo(){var Tn=Pg(),ui=We(Tn);if(k=arguments,D=this,le=Tn,ui){if(te===n)return Ve(le);if(we)return VP(te),te=nf(St,g),$e(le)}return te===n&&(te=nf(St,g)),Q}return vo.cancel=yo,vo.flush=Pr,vo}var sG=bt(function(f,g){return SP(f,1,g)}),aG=bt(function(f,g,S){return SP(f,Go(g)||0,S)});function lG(f){return vs(f,N)}function Tg(f,g){if(typeof f!="function"||g!=null&&typeof g!="function")throw new Bo(s);var S=function(){var k=arguments,D=g?g.apply(this,k):k[0],W=S.cache;if(W.has(D))return W.get(D);var Q=f.apply(this,k);return S.cache=W.set(D,Q)||W,Q};return S.cache=new(Tg.Cache||bs),S}Tg.Cache=bs;function kg(f){if(typeof f!="function")throw new Bo(s);return function(){var g=arguments;switch(g.length){case 0:return!f.call(this);case 1:return!f.call(this,g[0]);case 2:return!f.call(this,g[0],g[1]);case 3:return!f.call(this,g[0],g[1],g[2])}return!f.apply(this,g)}}function cG(f){return kT(2,f)}var uG=XV(function(f,g){g=g.length==1&&st(g[0])?pn(g[0],go(He())):pn(er(g,1),go(He()));var S=g.length;return bt(function(k){for(var D=-1,W=cr(k.length,S);++D<W;)k[D]=g[D].call(this,k[D]);return po(f,this,k)})}),Xv=bt(function(f,g){var S=ta(g,Yc(Xv));return vs(f,C,n,g,S)}),DT=bt(function(f,g){var S=ta(g,Yc(DT));return vs(f,E,n,g,S)}),dG=xs(function(f,g){return vs(f,M,n,n,n,g)});function fG(f,g){if(typeof f!="function")throw new Bo(s);return g=g===n?g:ut(g),bt(f,g)}function hG(f,g){if(typeof f!="function")throw new Bo(s);return g=g==null?0:zn(ut(g),0),bt(function(S){var k=S[g],D=sa(S,0,g);return k&&ea(D,k),po(f,this,D)})}function pG(f,g,S){var k=!0,D=!0;if(typeof f!="function")throw new Bo(s);return bn(S)&&(k="leading"in S?!!S.leading:k,D="trailing"in S?!!S.trailing:D),IT(f,g,{leading:k,maxWait:g,trailing:D})}function gG(f){return TT(f,1)}function mG(f,g){return Xv(Dv(g),f)}function bG(){if(!arguments.length)return[];var f=arguments[0];return st(f)?f:[f]}function yG(f){return Vo(f,h)}function vG(f,g){return g=typeof g=="function"?g:n,Vo(f,h,g)}function xG(f){return Vo(f,d|h)}function wG(f,g){return g=typeof g=="function"?g:n,Vo(f,d|h,g)}function SG(f,g){return g==null||wP(f,g,qn(g))}function ci(f,g){return f===g||f!==f&&g!==g}var _G=wg(Sv),CG=wg(function(f,g){return f>=g}),dl=PP(function(){return arguments}())?PP:function(f){return wn(f)&&Gt.call(f,"callee")&&!hP.call(f,"callee")},st=he.isArray,EG=Y2?go(Y2):IV;function Vr(f){return f!=null&&Ag(f.length)&&!Ss(f)}function Pn(f){return wn(f)&&Vr(f)}function RG(f){return f===!0||f===!1||wn(f)&&Er(f)==ee}var aa=zH||ax,PG=K2?go(K2):DV;function TG(f){return wn(f)&&f.nodeType===1&&!rf(f)}function kG(f){if(f==null)return!0;if(Vr(f)&&(st(f)||typeof f=="string"||typeof f.splice=="function"||aa(f)||Kc(f)||dl(f)))return!f.length;var g=ur(f);if(g==ce||g==ot)return!f.size;if(tf(f))return!Ev(f).length;for(var S in f)if(Gt.call(f,S))return!1;return!0}function AG(f,g){return Zd(f,g)}function OG(f,g,S){S=typeof S=="function"?S:n;var k=S?S(f,g):n;return k===n?Zd(f,g,n,S):!!k}function Qv(f){if(!wn(f))return!1;var g=Er(f);return g==fe||g==ue||typeof f.message=="string"&&typeof f.name=="string"&&!rf(f)}function MG(f){return typeof f=="number"&&gP(f)}function Ss(f){if(!bn(f))return!1;var g=Er(f);return g==se||g==pe||g==Y||g==Ne}function NT(f){return typeof f=="number"&&f==ut(f)}function Ag(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=V}function bn(f){var g=typeof f;return f!=null&&(g=="object"||g=="function")}function wn(f){return f!=null&&typeof f=="object"}var LT=X2?go(X2):LV;function IG(f,g){return f===g||Cv(f,g,Bv(g))}function DG(f,g,S){return S=typeof S=="function"?S:n,Cv(f,g,Bv(g),S)}function NG(f){return FT(f)&&f!=+f}function LG(f){if(vW(f))throw new rt(i);return TP(f)}function FG(f){return f===null}function jG(f){return f==null}function FT(f){return typeof f=="number"||wn(f)&&Er(f)==_e}function rf(f){if(!wn(f)||Er(f)!=Me)return!1;var g=rg(f);if(g===null)return!0;var S=Gt.call(g,"constructor")&&g.constructor;return typeof S=="function"&&S instanceof S&&Jp.call(S)==DH}var Zv=Q2?go(Q2):FV;function $G(f){return NT(f)&&f>=-9007199254740991&&f<=V}var jT=Z2?go(Z2):jV;function Og(f){return typeof f=="string"||!st(f)&&wn(f)&&Er(f)==gn}function bo(f){return typeof f=="symbol"||wn(f)&&Er(f)==xt}var Kc=J2?go(J2):$V;function zG(f){return f===n}function BG(f){return wn(f)&&ur(f)==Rt}function HG(f){return wn(f)&&Er(f)==de}var VG=wg(Rv),WG=wg(function(f,g){return f<=g});function $T(f){if(!f)return[];if(Vr(f))return Og(f)?ai(f):Hr(f);if(Wd&&f[Wd])return SH(f[Wd]());var g=ur(f),S=g==ce?hv:g==ot?Xp:Xc;return S(f)}function _s(f){if(!f)return f===0?f:0;if(f=Go(f),f===$||f===-1/0){var g=f<0?-1:1;return g*X}return f===f?f:0}function ut(f){var g=_s(f),S=g%1;return g===g?S?g-S:g:0}function zT(f){return f?al(ut(f),0,q):0}function Go(f){if(typeof f=="number")return f;if(bo(f))return I;if(bn(f)){var g=typeof f.valueOf=="function"?f.valueOf():f;f=bn(g)?g+"":g}if(typeof f!="string")return f===0?f:+f;f=iP(f);var S=Qy.test(f);return S||oe.test(f)?iH(f.slice(2),S?2:8):Gp.test(f)?I:+f}function BT(f){return Ai(f,Wr(f))}function UG(f){return f?al(ut(f),-9007199254740991,V):f===0?f:0}function $t(f){return f==null?"":mo(f)}var GG=Gc(function(f,g){if(tf(g)||Vr(g)){Ai(g,qn(g),f);return}for(var S in g)Gt.call(g,S)&&Kd(f,S,g[S])}),HT=Gc(function(f,g){Ai(g,Wr(g),f)}),Mg=Gc(function(f,g,S,k){Ai(g,Wr(g),f,k)}),qG=Gc(function(f,g,S,k){Ai(g,qn(g),f,k)}),YG=xs(vv);function KG(f,g){var S=Uc(f);return g==null?S:xP(S,g)}var XG=bt(function(f,g){f=Zt(f);var S=-1,k=g.length,D=k>2?g[2]:n;for(D&&Rr(g[0],g[1],D)&&(k=1);++S<k;)for(var W=g[S],Q=Wr(W),te=-1,le=Q.length;++te<le;){var ye=Q[te],xe=f[ye];(xe===n||ci(xe,Hc[ye])&&!Gt.call(f,ye))&&(f[ye]=W[ye])}return f}),QG=bt(function(f){return f.push(n,iT),po(VT,n,f)});function ZG(f,g){return tP(f,He(g,3),ki)}function JG(f,g){return tP(f,He(g,3),wv)}function eq(f,g){return f==null?f:xv(f,He(g,3),Wr)}function tq(f,g){return f==null?f:EP(f,He(g,3),Wr)}function nq(f,g){return f&&ki(f,He(g,3))}function rq(f,g){return f&&wv(f,He(g,3))}function oq(f){return f==null?[]:hg(f,qn(f))}function iq(f){return f==null?[]:hg(f,Wr(f))}function Jv(f,g,S){var k=f==null?n:ll(f,g);return k===n?S:k}function sq(f,g){return f!=null&&lT(f,g,kV)}function ex(f,g){return f!=null&&lT(f,g,AV)}var aq=eT(function(f,g,S){g!=null&&typeof g.toString!="function"&&(g=eg.call(g)),f[g]=S},nx(Ur)),lq=eT(function(f,g,S){g!=null&&typeof g.toString!="function"&&(g=eg.call(g)),Gt.call(f,g)?f[g].push(S):f[g]=[S]},He),cq=bt(Qd);function qn(f){return Vr(f)?yP(f):Ev(f)}function Wr(f){return Vr(f)?yP(f,!0):zV(f)}function uq(f,g){var S={};return g=He(g,3),ki(f,function(k,D,W){ys(S,g(k,D,W),k)}),S}function dq(f,g){var S={};return g=He(g,3),ki(f,function(k,D,W){ys(S,D,g(k,D,W))}),S}var fq=Gc(function(f,g,S){pg(f,g,S)}),VT=Gc(function(f,g,S,k){pg(f,g,S,k)}),hq=xs(function(f,g){var S={};if(f==null)return S;var k=!1;g=pn(g,function(W){return W=ia(W,f),k||(k=W.length>1),W}),Ai(f,$v(f),S),k&&(S=Vo(S,d|p|h,aW));for(var D=g.length;D--;)Ov(S,g[D]);return S});function pq(f,g){return WT(f,kg(He(g)))}var gq=xs(function(f,g){return f==null?{}:HV(f,g)});function WT(f,g){if(f==null)return{};var S=pn($v(f),function(k){return[k]});return g=He(g),NP(f,S,function(k,D){return g(k,D[0])})}function mq(f,g,S){g=ia(g,f);var k=-1,D=g.length;for(D||(D=1,f=n);++k<D;){var W=f==null?n:f[Oi(g[k])];W===n&&(k=D,W=S),f=Ss(W)?W.call(f):W}return f}function bq(f,g,S){return f==null?f:Jd(f,g,S)}function yq(f,g,S,k){return k=typeof k=="function"?k:n,f==null?f:Jd(f,g,S,k)}var UT=rT(qn),GT=rT(Wr);function vq(f,g,S){var k=st(f),D=k||aa(f)||Kc(f);if(g=He(g,4),S==null){var W=f&&f.constructor;D?S=k?new W:[]:bn(f)?S=Ss(W)?Uc(rg(f)):{}:S={}}return(D?zo:ki)(f,function(Q,te,le){return g(S,Q,te,le)}),S}function xq(f,g){return f==null?!0:Ov(f,g)}function wq(f,g,S){return f==null?f:zP(f,g,Dv(S))}function Sq(f,g,S,k){return k=typeof k=="function"?k:n,f==null?f:zP(f,g,Dv(S),k)}function Xc(f){return f==null?[]:fv(f,qn(f))}function _q(f){return f==null?[]:fv(f,Wr(f))}function Cq(f,g,S){return S===n&&(S=g,g=n),S!==n&&(S=Go(S),S=S===S?S:0),g!==n&&(g=Go(g),g=g===g?g:0),al(Go(f),g,S)}function Eq(f,g,S){return g=_s(g),S===n?(S=g,g=0):S=_s(S),f=Go(f),OV(f,g,S)}function Rq(f,g,S){if(S&&typeof S!="boolean"&&Rr(f,g,S)&&(g=S=n),S===n&&(typeof g=="boolean"?(S=g,g=n):typeof f=="boolean"&&(S=f,f=n)),f===n&&g===n?(f=0,g=1):(f=_s(f),g===n?(g=f,f=0):g=_s(g)),f>g){var k=f;f=g,g=k}if(S||f%1||g%1){var D=mP();return cr(f+D*(g-f+oH("1e-"+((D+"").length-1))),g)}return Tv(f,g)}var Pq=qc(function(f,g,S){return g=g.toLowerCase(),f+(S?qT(g):g)});function qT(f){return tx($t(f).toLowerCase())}function YT(f){return f=$t(f),f&&f.replace(Fe,bH).replace(YB,"")}function Tq(f,g,S){f=$t(f),g=mo(g);var k=f.length;S=S===n?k:al(ut(S),0,k);var D=S;return S-=g.length,S>=0&&f.slice(S,D)==g}function kq(f){return f=$t(f),f&&jd.test(f)?f.replace(Lo,yH):f}function Aq(f){return f=$t(f),f&&Cr.test(f)?f.replace(Br,"\\$&"):f}var Oq=qc(function(f,g,S){return f+(S?"-":"")+g.toLowerCase()}),Mq=qc(function(f,g,S){return f+(S?" ":"")+g.toLowerCase()}),Iq=QP("toLowerCase");function Dq(f,g,S){f=$t(f),g=ut(g);var k=g?zc(f):0;if(!g||k>=g)return f;var D=(g-k)/2;return xg(ag(D),S)+f+xg(sg(D),S)}function Nq(f,g,S){f=$t(f),g=ut(g);var k=g?zc(f):0;return g&&k<g?f+xg(g-k,S):f}function Lq(f,g,S){f=$t(f),g=ut(g);var k=g?zc(f):0;return g&&k<g?xg(g-k,S)+f:f}function Fq(f,g,S){return S||g==null?g=0:g&&(g=+g),WH($t(f).replace(mn,""),g||0)}function jq(f,g,S){return(S?Rr(f,g,S):g===n)?g=1:g=ut(g),kv($t(f),g)}function $q(){var f=arguments,g=$t(f[0]);return f.length<3?g:g.replace(f[1],f[2])}var zq=qc(function(f,g,S){return f+(S?"_":"")+g.toLowerCase()});function Bq(f,g,S){return S&&typeof S!="number"&&Rr(f,g,S)&&(g=S=n),S=S===n?q:S>>>0,S?(f=$t(f),f&&(typeof g=="string"||g!=null&&!Zv(g))&&(g=mo(g),!g&&$c(f))?sa(ai(f),0,S):f.split(g,S)):[]}var Hq=qc(function(f,g,S){return f+(S?" ":"")+tx(g)});function Vq(f,g,S){return f=$t(f),S=S==null?0:al(ut(S),0,f.length),g=mo(g),f.slice(S,S+g.length)==g}function Wq(f,g,S){var k=B.templateSettings;S&&Rr(f,g,S)&&(g=n),f=$t(f),g=Mg({},g,k,oT);var D=Mg({},g.imports,k.imports,oT),W=qn(D),Q=fv(D,W),te,le,ye=0,xe=g.interpolate||Ut,we="__p += '",Ae=pv((g.escape||Ut).source+"|"+xe.source+"|"+(xe===Wt?Up:Ut).source+"|"+(g.evaluate||Ut).source+"|$","g"),$e="//# sourceURL="+(Gt.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++JB+"]")+`
|
|
46
|
+
`;f.replace(Ae,function(We,St,Pt,yo,Pr,vo){return Pt||(Pt=yo),we+=f.slice(ye,vo).replace(Un,vH),St&&(te=!0,we+=`' +
|
|
47
|
+
__e(`+St+`) +
|
|
48
|
+
'`),Pr&&(le=!0,we+=`';
|
|
49
|
+
`+Pr+`;
|
|
50
|
+
__p += '`),Pt&&(we+=`' +
|
|
51
|
+
((__t = (`+Pt+`)) == null ? '' : __t) +
|
|
52
|
+
'`),ye=vo+We.length,We}),we+=`';
|
|
53
|
+
`;var Ve=Gt.call(g,"variable")&&g.variable;if(!Ve)we=`with (obj) {
|
|
54
|
+
`+we+`
|
|
55
|
+
}
|
|
56
|
+
`;else if(si.test(Ve))throw new rt(a);we=(le?we.replace(_r,""):we).replace(ps,"$1").replace(gs,"$1;"),we="function("+(Ve||"obj")+`) {
|
|
57
|
+
`+(Ve?"":`obj || (obj = {});
|
|
58
|
+
`)+"var __t, __p = ''"+(te?", __e = _.escape":"")+(le?`, __j = Array.prototype.join;
|
|
59
|
+
function print() { __p += __j.call(arguments, '') }
|
|
60
|
+
`:`;
|
|
61
|
+
`)+we+`return __p
|
|
62
|
+
}`;var pt=XT(function(){return Nt(W,$e+"return "+we).apply(n,Q)});if(pt.source=we,Qv(pt))throw pt;return pt}function Uq(f){return $t(f).toLowerCase()}function Gq(f){return $t(f).toUpperCase()}function qq(f,g,S){if(f=$t(f),f&&(S||g===n))return iP(f);if(!f||!(g=mo(g)))return f;var k=ai(f),D=ai(g),W=sP(k,D),Q=aP(k,D)+1;return sa(k,W,Q).join("")}function Yq(f,g,S){if(f=$t(f),f&&(S||g===n))return f.slice(0,cP(f)+1);if(!f||!(g=mo(g)))return f;var k=ai(f),D=aP(k,ai(g))+1;return sa(k,0,D).join("")}function Kq(f,g,S){if(f=$t(f),f&&(S||g===n))return f.replace(mn,"");if(!f||!(g=mo(g)))return f;var k=ai(f),D=sP(k,ai(g));return sa(k,D).join("")}function Xq(f,g){var S=L,k=F;if(bn(g)){var D="separator"in g?g.separator:D;S="length"in g?ut(g.length):S,k="omission"in g?mo(g.omission):k}f=$t(f);var W=f.length;if($c(f)){var Q=ai(f);W=Q.length}if(S>=W)return f;var te=S-zc(k);if(te<1)return k;var le=Q?sa(Q,0,te).join(""):f.slice(0,te);if(D===n)return le+k;if(Q&&(te+=le.length-te),Zv(D)){if(f.slice(te).search(D)){var ye,xe=le;for(D.global||(D=pv(D.source,$t(zd.exec(D))+"g")),D.lastIndex=0;ye=D.exec(xe);)var we=ye.index;le=le.slice(0,we===n?te:we)}}else if(f.indexOf(mo(D),te)!=te){var Ae=le.lastIndexOf(D);Ae>-1&&(le=le.slice(0,Ae))}return le+k}function Qq(f){return f=$t(f),f&&Fo.test(f)?f.replace(Nc,RH):f}var Zq=qc(function(f,g,S){return f+(S?" ":"")+g.toUpperCase()}),tx=QP("toUpperCase");function KT(f,g,S){return f=$t(f),g=S?n:g,g===n?wH(f)?kH(f):fH(f):f.match(g)||[]}var XT=bt(function(f,g){try{return po(f,n,g)}catch(S){return Qv(S)?S:new rt(S)}}),Jq=xs(function(f,g){return zo(g,function(S){S=Oi(S),ys(f,S,Kv(f[S],f))}),f});function eY(f){var g=f==null?0:f.length,S=He();return f=g?pn(f,function(k){if(typeof k[1]!="function")throw new Bo(s);return[S(k[0]),k[1]]}):[],bt(function(k){for(var D=-1;++D<g;){var W=f[D];if(po(W[0],this,k))return po(W[1],this,k)}})}function tY(f){return RV(Vo(f,d))}function nx(f){return function(){return f}}function nY(f,g){return f==null||f!==f?g:f}var rY=JP(),oY=JP(!0);function Ur(f){return f}function rx(f){return kP(typeof f=="function"?f:Vo(f,d))}function iY(f){return OP(Vo(f,d))}function sY(f,g){return MP(f,Vo(g,d))}var aY=bt(function(f,g){return function(S){return Qd(S,f,g)}}),lY=bt(function(f,g){return function(S){return Qd(f,S,g)}});function ox(f,g,S){var k=qn(g),D=hg(g,k);S==null&&!(bn(g)&&(D.length||!k.length))&&(S=g,g=f,f=this,D=hg(g,qn(g)));var W=!(bn(S)&&"chain"in S)||!!S.chain,Q=Ss(f);return zo(D,function(te){var le=g[te];f[te]=le,Q&&(f.prototype[te]=function(){var ye=this.__chain__;if(W||ye){var xe=f(this.__wrapped__),we=xe.__actions__=Hr(this.__actions__);return we.push({func:le,args:arguments,thisArg:f}),xe.__chain__=ye,xe}return le.apply(f,ea([this.value()],arguments))})}),f}function cY(){return Jn._===this&&(Jn._=NH),this}function ix(){}function uY(f){return f=ut(f),bt(function(g){return IP(g,f)})}var dY=Lv(pn),fY=Lv(eP),hY=Lv(av);function QT(f){return Vv(f)?lv(Oi(f)):VV(f)}function pY(f){return function(g){return f==null?n:ll(f,g)}}var gY=tT(),mY=tT(!0);function sx(){return[]}function ax(){return!1}function bY(){return{}}function yY(){return""}function vY(){return!0}function xY(f,g){if(f=ut(f),f<1||f>V)return[];var S=q,k=cr(f,q);g=He(g),f-=q;for(var D=dv(k,g);++S<f;)g(S);return D}function wY(f){return st(f)?pn(f,Oi):bo(f)?[f]:Hr(bT($t(f)))}function SY(f){var g=++IH;return $t(f)+g}var _Y=vg(function(f,g){return f+g},0),CY=Fv("ceil"),EY=vg(function(f,g){return f/g},1),RY=Fv("floor");function PY(f){return f&&f.length?fg(f,Ur,Sv):n}function TY(f,g){return f&&f.length?fg(f,He(g,2),Sv):n}function kY(f){return rP(f,Ur)}function AY(f,g){return rP(f,He(g,2))}function OY(f){return f&&f.length?fg(f,Ur,Rv):n}function MY(f,g){return f&&f.length?fg(f,He(g,2),Rv):n}var IY=vg(function(f,g){return f*g},1),DY=Fv("round"),NY=vg(function(f,g){return f-g},0);function LY(f){return f&&f.length?uv(f,Ur):0}function FY(f,g){return f&&f.length?uv(f,He(g,2)):0}return B.after=iG,B.ary=TT,B.assign=GG,B.assignIn=HT,B.assignInWith=Mg,B.assignWith=qG,B.at=YG,B.before=kT,B.bind=Kv,B.bindAll=Jq,B.bindKey=AT,B.castArray=bG,B.chain=ET,B.chunk=RW,B.compact=PW,B.concat=TW,B.cond=eY,B.conforms=tY,B.constant=nx,B.countBy=LU,B.create=KG,B.curry=OT,B.curryRight=MT,B.debounce=IT,B.defaults=XG,B.defaultsDeep=QG,B.defer=sG,B.delay=aG,B.difference=kW,B.differenceBy=AW,B.differenceWith=OW,B.drop=MW,B.dropRight=IW,B.dropRightWhile=DW,B.dropWhile=NW,B.fill=LW,B.filter=jU,B.flatMap=BU,B.flatMapDeep=HU,B.flatMapDepth=VU,B.flatten=wT,B.flattenDeep=FW,B.flattenDepth=jW,B.flip=lG,B.flow=rY,B.flowRight=oY,B.fromPairs=$W,B.functions=oq,B.functionsIn=iq,B.groupBy=WU,B.initial=BW,B.intersection=HW,B.intersectionBy=VW,B.intersectionWith=WW,B.invert=aq,B.invertBy=lq,B.invokeMap=GU,B.iteratee=rx,B.keyBy=qU,B.keys=qn,B.keysIn=Wr,B.map=Rg,B.mapKeys=uq,B.mapValues=dq,B.matches=iY,B.matchesProperty=sY,B.memoize=Tg,B.merge=fq,B.mergeWith=VT,B.method=aY,B.methodOf=lY,B.mixin=ox,B.negate=kg,B.nthArg=uY,B.omit=hq,B.omitBy=pq,B.once=cG,B.orderBy=YU,B.over=dY,B.overArgs=uG,B.overEvery=fY,B.overSome=hY,B.partial=Xv,B.partialRight=DT,B.partition=KU,B.pick=gq,B.pickBy=WT,B.property=QT,B.propertyOf=pY,B.pull=YW,B.pullAll=_T,B.pullAllBy=KW,B.pullAllWith=XW,B.pullAt=QW,B.range=gY,B.rangeRight=mY,B.rearg=dG,B.reject=ZU,B.remove=ZW,B.rest=fG,B.reverse=qv,B.sampleSize=eG,B.set=bq,B.setWith=yq,B.shuffle=tG,B.slice=JW,B.sortBy=oG,B.sortedUniq=sU,B.sortedUniqBy=aU,B.split=Bq,B.spread=hG,B.tail=lU,B.take=cU,B.takeRight=uU,B.takeRightWhile=dU,B.takeWhile=fU,B.tap=PU,B.throttle=pG,B.thru=Eg,B.toArray=$T,B.toPairs=UT,B.toPairsIn=GT,B.toPath=wY,B.toPlainObject=BT,B.transform=vq,B.unary=gG,B.union=hU,B.unionBy=pU,B.unionWith=gU,B.uniq=mU,B.uniqBy=bU,B.uniqWith=yU,B.unset=xq,B.unzip=Yv,B.unzipWith=CT,B.update=wq,B.updateWith=Sq,B.values=Xc,B.valuesIn=_q,B.without=vU,B.words=KT,B.wrap=mG,B.xor=xU,B.xorBy=wU,B.xorWith=SU,B.zip=_U,B.zipObject=CU,B.zipObjectDeep=EU,B.zipWith=RU,B.entries=UT,B.entriesIn=GT,B.extend=HT,B.extendWith=Mg,ox(B,B),B.add=_Y,B.attempt=XT,B.camelCase=Pq,B.capitalize=qT,B.ceil=CY,B.clamp=Cq,B.clone=yG,B.cloneDeep=xG,B.cloneDeepWith=wG,B.cloneWith=vG,B.conformsTo=SG,B.deburr=YT,B.defaultTo=nY,B.divide=EY,B.endsWith=Tq,B.eq=ci,B.escape=kq,B.escapeRegExp=Aq,B.every=FU,B.find=$U,B.findIndex=vT,B.findKey=ZG,B.findLast=zU,B.findLastIndex=xT,B.findLastKey=JG,B.floor=RY,B.forEach=RT,B.forEachRight=PT,B.forIn=eq,B.forInRight=tq,B.forOwn=nq,B.forOwnRight=rq,B.get=Jv,B.gt=_G,B.gte=CG,B.has=sq,B.hasIn=ex,B.head=ST,B.identity=Ur,B.includes=UU,B.indexOf=zW,B.inRange=Eq,B.invoke=cq,B.isArguments=dl,B.isArray=st,B.isArrayBuffer=EG,B.isArrayLike=Vr,B.isArrayLikeObject=Pn,B.isBoolean=RG,B.isBuffer=aa,B.isDate=PG,B.isElement=TG,B.isEmpty=kG,B.isEqual=AG,B.isEqualWith=OG,B.isError=Qv,B.isFinite=MG,B.isFunction=Ss,B.isInteger=NT,B.isLength=Ag,B.isMap=LT,B.isMatch=IG,B.isMatchWith=DG,B.isNaN=NG,B.isNative=LG,B.isNil=jG,B.isNull=FG,B.isNumber=FT,B.isObject=bn,B.isObjectLike=wn,B.isPlainObject=rf,B.isRegExp=Zv,B.isSafeInteger=$G,B.isSet=jT,B.isString=Og,B.isSymbol=bo,B.isTypedArray=Kc,B.isUndefined=zG,B.isWeakMap=BG,B.isWeakSet=HG,B.join=UW,B.kebabCase=Oq,B.last=Uo,B.lastIndexOf=GW,B.lowerCase=Mq,B.lowerFirst=Iq,B.lt=VG,B.lte=WG,B.max=PY,B.maxBy=TY,B.mean=kY,B.meanBy=AY,B.min=OY,B.minBy=MY,B.stubArray=sx,B.stubFalse=ax,B.stubObject=bY,B.stubString=yY,B.stubTrue=vY,B.multiply=IY,B.nth=qW,B.noConflict=cY,B.noop=ix,B.now=Pg,B.pad=Dq,B.padEnd=Nq,B.padStart=Lq,B.parseInt=Fq,B.random=Rq,B.reduce=XU,B.reduceRight=QU,B.repeat=jq,B.replace=$q,B.result=mq,B.round=DY,B.runInContext=ae,B.sample=JU,B.size=nG,B.snakeCase=zq,B.some=rG,B.sortedIndex=eU,B.sortedIndexBy=tU,B.sortedIndexOf=nU,B.sortedLastIndex=rU,B.sortedLastIndexBy=oU,B.sortedLastIndexOf=iU,B.startCase=Hq,B.startsWith=Vq,B.subtract=NY,B.sum=LY,B.sumBy=FY,B.template=Wq,B.times=xY,B.toFinite=_s,B.toInteger=ut,B.toLength=zT,B.toLower=Uq,B.toNumber=Go,B.toSafeInteger=UG,B.toString=$t,B.toUpper=Gq,B.trim=qq,B.trimEnd=Yq,B.trimStart=Kq,B.truncate=Xq,B.unescape=Qq,B.uniqueId=SY,B.upperCase=Zq,B.upperFirst=tx,B.each=RT,B.eachRight=PT,B.first=ST,ox(B,function(){var f={};return ki(B,function(g,S){Gt.call(B.prototype,S)||(f[S]=g)}),f}(),{chain:!1}),B.VERSION=r,zo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){B[f].placeholder=B}),zo(["drop","take"],function(f,g){Et.prototype[f]=function(S){S=S===n?1:zn(ut(S),0);var k=this.__filtered__&&!g?new Et(this):this.clone();return k.__filtered__?k.__takeCount__=cr(S,k.__takeCount__):k.__views__.push({size:cr(S,q),type:f+(k.__dir__<0?"Right":"")}),k},Et.prototype[f+"Right"]=function(S){return this.reverse()[f](S).reverse()}}),zo(["filter","map","takeWhile"],function(f,g){var S=g+1,k=S==G||S==H;Et.prototype[f]=function(D){var W=this.clone();return W.__iteratees__.push({iteratee:He(D,3),type:S}),W.__filtered__=W.__filtered__||k,W}}),zo(["head","last"],function(f,g){var S="take"+(g?"Right":"");Et.prototype[f]=function(){return this[S](1).value()[0]}}),zo(["initial","tail"],function(f,g){var S="drop"+(g?"":"Right");Et.prototype[f]=function(){return this.__filtered__?new Et(this):this[S](1)}}),Et.prototype.compact=function(){return this.filter(Ur)},Et.prototype.find=function(f){return this.filter(f).head()},Et.prototype.findLast=function(f){return this.reverse().find(f)},Et.prototype.invokeMap=bt(function(f,g){return typeof f=="function"?new Et(this):this.map(function(S){return Qd(S,f,g)})}),Et.prototype.reject=function(f){return this.filter(kg(He(f)))},Et.prototype.slice=function(f,g){f=ut(f);var S=this;return S.__filtered__&&(f>0||g<0)?new Et(S):(f<0?S=S.takeRight(-f):f&&(S=S.drop(f)),g!==n&&(g=ut(g),S=g<0?S.dropRight(-g):S.take(g-f)),S)},Et.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},Et.prototype.toArray=function(){return this.take(q)},ki(Et.prototype,function(f,g){var S=/^(?:filter|find|map|reject)|While$/.test(g),k=/^(?:head|last)$/.test(g),D=B[k?"take"+(g=="last"?"Right":""):g],W=k||/^find/.test(g);D&&(B.prototype[g]=function(){var Q=this.__wrapped__,te=k?[1]:arguments,le=Q instanceof Et,ye=te[0],xe=le||st(Q),we=function(St){var Pt=D.apply(B,ea([St],te));return k&&Ae?Pt[0]:Pt};xe&&S&&typeof ye=="function"&&ye.length!=1&&(le=xe=!1);var Ae=this.__chain__,$e=!!this.__actions__.length,Ve=W&&!Ae,pt=le&&!$e;if(!W&&xe){Q=pt?Q:new Et(this);var We=f.apply(Q,te);return We.__actions__.push({func:Eg,args:[we],thisArg:n}),new Ho(We,Ae)}return Ve&&pt?f.apply(this,te):(We=this.thru(we),Ve?k?We.value()[0]:We.value():We)})}),zo(["pop","push","shift","sort","splice","unshift"],function(f){var g=Qp[f],S=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",k=/^(?:pop|shift)$/.test(f);B.prototype[f]=function(){var D=arguments;if(k&&!this.__chain__){var W=this.value();return g.apply(st(W)?W:[],D)}return this[S](function(Q){return g.apply(st(Q)?Q:[],D)})}}),ki(Et.prototype,function(f,g){var S=B[g];if(S){var k=S.name+"";Gt.call(Wc,k)||(Wc[k]=[]),Wc[k].push({name:g,func:S})}}),Wc[yg(n,x).name]=[{name:"wrapper",func:n}],Et.prototype.clone=QH,Et.prototype.reverse=ZH,Et.prototype.value=JH,B.prototype.at=TU,B.prototype.chain=kU,B.prototype.commit=AU,B.prototype.next=OU,B.prototype.plant=IU,B.prototype.reverse=DU,B.prototype.toJSON=B.prototype.valueOf=B.prototype.value=NU,B.prototype.first=B.prototype.head,Wd&&(B.prototype[Wd]=MU),B},Bc=AH();rl?((rl.exports=Bc)._=Bc,rv._=Bc):Jn._=Bc}).call(Bi)})(fb,fb.exports);var kf=fb.exports;const ql=Ga(kf);function gk({id:e,layouts:t,initialHeight:n,y:r,x:o,w:i,minH:s}){const a={i:e,x:o??0,y:r??1/0,w:i||20,h:n||35,minW:6,minH:s||10},l=t?{...t}:{};return K_.forEach(c=>{l[c]||(l[c]=[]);const u=l[c].reduce((d,p)=>Math.max(d,p.y+p.h),0);a.y=a.y===1/0?u:a.y,l[c].push({...a})}),l}function mk(e,t){if(!t)return;const n={...t};return K_.forEach(r=>{n[r]&&(n[r]=n[r].filter(o=>o.i!==e))}),n}function J_(e){const t=be.getState().dashboard.globalCacheConfig,{card:n,filter:r}=e;return t}const be=dN()(yN((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:db},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setInitStore:()=>{e(n=>{n.isSessionExpired=!1,n.currentBreakpoint="lg",n.dashboard={id:"",style:db},n.showContext=!1,n.selectedSheetId=null,n.selectedCardId=null,n.selectedFrameId=null,n.selectedCard=null,n.showFilters=!1,n.isDashboardEditing=!1,n.isVisualEditing=!1,n.showDashboardJSON=!1,n.filteringCards=[],n.selectedLensId=void 0,n.filterValues=void 0})},setIsDownloadingPdf:n=>{e(r=>{r.isDownloadingPdf=n})},setGlobalCacheConfig:n=>{e(r=>{r.dashboard.globalCacheConfig=n})},setLenses:n=>{e(r=>{r.lenses=n})},setSelectedLensId:n=>{e(r=>{r.selectedLensId=n})},deleteSheet:n=>{e(r=>{var i,s,a,l,c,u,d,p;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(h=>h.id===n);if(o!==void 0&&o>-1){(s=r.dashboard.sheets)==null||s.splice(o,1);const h=(a=r.dashboard.filters)==null?void 0:a.filter(b=>b.sheetId===n),m=(l=r.filterValues)==null?void 0:l.filter(b=>h==null?void 0:h.some(v=>v.id===b.filterId));r.filterValues=(c=r.filterValues)==null?void 0:c.filter(b=>!(m!=null&&m.some(v=>v.filterId===b.filterId))),r.dashboard.filters=(u=r.dashboard.filters)==null?void 0:u.filter(b=>b.sheetId!==n),r.selectedSheetId=(p=(d=r.dashboard.sheets)==null?void 0:d[0])==null?void 0:p.id}})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{K_.forEach(l=>{i!=null&&i[l]||(i={...i,[l]:[]});const c={i:a.id,x:0,y:0,w:10,h:8};i[l].push(c)})});const s={...n,layouts:i};r.dashboard.sheets.push(s)})},setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},addToAIScope:n=>{e(r=>{const{connectionId:o,connectionType:i,databaseName:s,schemaName:a,tableName:l,datamodelName:c}=n,u={connectionId:o||"",connectionType:i||"",databaseName:s||"",schemaName:a||"",tableName:l||"",datamodelName:c||""};let p=[...r.dashboard.aiScopeTables||[],u];p=p.filter((h,m,b)=>b.findIndex(v=>v.tableName===h.tableName&&v.datamodelName===h.datamodelName)===m),r.dashboard.aiScopeTables=p})},removeFromAIScope:n=>{e(r=>{const{connectionId:o,tableName:i,datamodelName:s}=n,a=r.dashboard.aiScopeTables||[];if(s){const l=a.filter(c=>!(c.datamodelName===s&&c.connectionId===o));r.dashboard.aiScopeTables=l}else if(i){const l=a.filter(c=>!(c.tableName===i&&c.connectionId===o));r.dashboard.aiScopeTables=l}})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&kf.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.id===n);c&&(c.python=r)})})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},setFilteringCards:n=>{e(()=>({filteringCards:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setDashboardWithFilterValues:(n,r)=>{e(o=>{o.dashboard=n,o.filterValues=r})},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.title=r)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&kf.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(p=>p.id===r);u&&(u.title=o)})})},setCardInfo:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&kf.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&kf.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(p=>p.id===r);u&&(u.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){const d=(c=s.cards)==null?void 0:c.find(p=>p.id===r);d&&(d.sql=o,(u=i.onUpdateCard)==null||u.call(i,d,n))}})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===o.filterId);i!==void 0&&i>-1?(a=r.filterValues)==null||a.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValues:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n],(s=r.dashboard.sheets)==null||s.find(a=>a.id===r.selectedSheetId);const o=r.dashboard.sheets;o==null||o.forEach(a=>{gk({id:n.id,layouts:a.layouts,y:0,initialHeight:8,minH:7,w:10})})})},removeFilter:n=>{e(r=>{var o,i,s;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(a>-1){(i=r.dashboard.filters)==null||i.splice(a,1),(s=r.dashboard.sheets)==null||s.find(c=>c.id===r.selectedSheetId);const l=r.dashboard.sheets;l==null||l.forEach(c=>{const u=mk(n,c.layouts);c.layouts=u})}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,d,p;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(h=>h.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(h=>h.id===r);if(a){const h=(d=a.cards)==null?void 0:d.findIndex(m=>m.id===o.id);h>-1&&((p=a.cards)==null||p.splice(h,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},updateFilterId:(n,r)=>{e(o=>{var a,l;const i=(a=o.dashboard.filters)==null?void 0:a.find(c=>c.id===n),s=(l=o.dashboard.filters)==null?void 0:l.some(c=>c.id===r);i&&!s&&(i.id=r)})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let d=1/0;const p=0;o==="start"&&(d=0);const h=gk({id:r.id,layouts:s.layouts,minH:10,x:p,y:d});s.layouts=h,(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,c,u;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(d=>d.id===n);if(i){const d=(l=i.frames)==null?void 0:l.findIndex(p=>p.id===r);console.log(d),typeof d=="number"&&d>-1&&((c=i.frames)==null||c.splice(d,1),(u=i.layout)==null||u.splice(d,1),mk(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r)),(d=o.onAcceptChanges)==null||d.call(o,r,o.dashboard)})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(d=o.onUpdateCard)==null||d.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,d,p;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(d=i.layout)==null||d.splice(s,1),(p=o.onRemoveCard)==null||p.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnAcceptChanges:n=>{e(()=>({onAcceptChanges:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getCardFrame:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return a[l]}}},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(i=a[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},getCardSheet(n){var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{sX({card:n,dataPoint:r,get:t})}}}))),An=()=>be(e=>e.actions);async function aX(e,t){const n=t.slice(0,16),r=new TextEncoder,o=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),i=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},o,{name:"AES-GCM",length:256},!1,["encrypt"]),s=window.crypto.getRandomValues(new Uint8Array(12)),a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:s},i,r.encode(e)),l=new Uint8Array(s.length+a.byteLength);return l.set(s,0),l.set(new Uint8Array(a),s.length),{payload:btoa(String.fromCharCode(...l))}}async function _N(e,t){const n=t.slice(0,16),r=new TextEncoder,o=new TextDecoder,i=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),s=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},i,{name:"AES-GCM",length:256},!1,["decrypt"]),a=Uint8Array.from(atob(e),p=>p.charCodeAt(0)),l=a.slice(0,12),c=a.slice(a.length-16),u=a.slice(12,a.length-16),d=new Uint8Array(u.length+c.length);d.set(u),d.set(c,u.length);try{const p=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:l},s,d);return{decryptedData:o.decode(p)}}catch(p){throw new Error(`Decryption failed: ${p}`)}}function ge(...e){return yK(Yu(e))}const lX=e=>Object.keys(e).length===0;async function cX(e,t,n={}){try{const r=new URLSearchParams(n).toString(),o=`${e}?${r}`,i=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!i.ok){const a=await i.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)}return await i.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function _0(e,t,n={}){try{const r=JSON.stringify(n),o=await aX(r,t),i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(o)});if(!i.ok)return i.json().then(a=>{throw console.log(a.detail||"Unknown error occurred"),new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)});const s=await i.json();if(s.payload){const a=await _N(s.payload,t);return JSON.parse(a.decryptedData)}return s}catch(r){throw console.error("Error during fetch:",r),r}}function uX(e){if(!e)return{tenantId:"",endUserId:""};const t=B_(e);return{tenantId:t==null?void 0:t.tenantId,endUserId:t==null?void 0:t.endUserId}}function dX(e){if(!e)return;const t=B_(e);if(t.params&&t.params.currencyFormat)return t.params.currencyFormat}function CN(e){return e?B_(e).params:void 0}function fX(e){return e.charAt(0).toUpperCase()+e.slice(1)}const qf="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";async function hX(){var o,i;const e=(i=(o=be.getState())==null?void 0:o.authToken)==null?void 0:i.accessToken;if(!e)return;const n=await fetch("https://semaphor.cloud/api/v1/invalidate-token",{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error("Failed to invalidate token");const r=await n.json();return console.log("invalidateToken",r),r}async function pX(e,t={}){if(!e)return null;let n="https://semaphor.cloud/api/v1/dashboard";const r=Object.fromEntries(Object.entries(t).filter(([a,l])=>l!==void 0)),o=new URLSearchParams(r).toString();o&&(n+=`?${o}`);let s=await(await fetch(n,{headers:{Authorization:`Bearer ${e}`}})).json();if("payload"in s){const a=await _N(atob(s.payload),e);s=JSON.parse(a.decryptedData)}return s}async function gX(e){return e?await(await fetch("https://semaphor.cloud/api/v1/plugins",{headers:{Authorization:`Bearer ${e}`}})).json():null}const mX={theme:"system",setTheme:()=>null},EN=T.createContext(mX);function bX({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=T.useState(()=>localStorage.getItem(n)||t);T.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(o)},[o]);const s={theme:o,setTheme:a=>{localStorage.setItem(n,a),i(a)}};return y.jsx(EN.Provider,{...r,value:s,children:e})}const RN=()=>{const e=T.useContext(EN);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var np=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},dc=typeof window>"u"||"Deno"in globalThis;function Ko(){}function yX(e,t){return typeof e=="function"?e(t):e}function w1(e){return typeof e=="number"&&e>=0&&e!==1/0}function PN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Su(e,t){return typeof e=="function"?e(t):e}function bi(e,t){return typeof e=="function"?e(t):e}function bk(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==eC(s,t.options))return!1}else if(!vh(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function yk(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(yh(t.options.mutationKey)!==yh(i))return!1}else if(!vh(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function eC(e,t){return((t==null?void 0:t.queryKeyHashFn)||yh)(e)}function yh(e){return JSON.stringify(e,(t,n)=>C1(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function vh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!vh(e[n],t[n])):!1}function S1(e,t){if(e===t)return e;const n=vk(e)&&vk(t);if(n||C1(e)&&C1(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];(!n&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,l++):(a[u]=S1(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function _1(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function vk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function C1(e){if(!xk(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!xk(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function xk(e){return Object.prototype.toString.call(e)==="[object Object]"}function vX(e){return new Promise(t=>{setTimeout(t,e)})}function E1(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return S1(e,t)}catch(r){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`)}return S1(e,t)}return t}function xX(e){return e}function wX(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function SX(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var hb=Symbol();function TN(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===hb&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===hb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var $l,ya,Nu,YD,_X=(YD=class extends np{constructor(){super();Ke(this,$l);Ke(this,ya);Ke(this,Nu);De(this,Nu,t=>{if(!dc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ie(this,ya)||this.setEventListener(ie(this,Nu))}onUnsubscribe(){var t;this.hasListeners()||((t=ie(this,ya))==null||t.call(this),De(this,ya,void 0))}setEventListener(t){var n;De(this,Nu,t),(n=ie(this,ya))==null||n.call(this),De(this,ya,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){ie(this,$l)!==t&&(De(this,$l,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof ie(this,$l)=="boolean"?ie(this,$l):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},$l=new WeakMap,ya=new WeakMap,Nu=new WeakMap,YD),tC=new _X,Lu,va,Fu,KD,CX=(KD=class extends np{constructor(){super();Ke(this,Lu,!0);Ke(this,va);Ke(this,Fu);De(this,Fu,t=>{if(!dc&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){ie(this,va)||this.setEventListener(ie(this,Fu))}onUnsubscribe(){var t;this.hasListeners()||((t=ie(this,va))==null||t.call(this),De(this,va,void 0))}setEventListener(t){var n;De(this,Fu,t),(n=ie(this,va))==null||n.call(this),De(this,va,t(this.setOnline.bind(this)))}setOnline(t){ie(this,Lu)!==t&&(De(this,Lu,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return ie(this,Lu)}},Lu=new WeakMap,va=new WeakMap,Fu=new WeakMap,KD),pb=new CX;function R1(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function EX(e){return Math.min(1e3*2**e,3e4)}function kN(e){return(e??"online")==="online"?pb.isOnline():!0}var AN=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function bx(e){return e instanceof AN}function ON(e){let t=!1,n=0,r=!1,o;const i=R1(),s=b=>{var v;r||(p(new AN(b)),(v=e.abort)==null||v.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>tC.isFocused()&&(e.networkMode==="always"||pb.isOnline())&&e.canRun(),u=()=>kN(e.networkMode)&&e.canRun(),d=b=>{var v;r||(r=!0,(v=e.onSuccess)==null||v.call(e,b),o==null||o(),i.resolve(b))},p=b=>{var v;r||(r=!0,(v=e.onError)==null||v.call(e,b),o==null||o(),i.reject(b))},h=()=>new Promise(b=>{var v;o=x=>{(r||c())&&b(x)},(v=e.onPause)==null||v.call(e)}).then(()=>{var b;o=void 0,r||(b=e.onContinue)==null||b.call(e)}),m=()=>{if(r)return;let b;const v=n===0?e.initialPromise:void 0;try{b=v??e.fn()}catch(x){b=Promise.reject(x)}Promise.resolve(b).then(d).catch(x=>{var E;if(r)return;const w=e.retry??(dc?0:3),_=e.retryDelay??EX,R=typeof _=="function"?_(n,x):_,C=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,x);if(t||!C){p(x);return}n++,(E=e.onFail)==null||E.call(e,n,x),vX(R).then(()=>c()?void 0:h()).then(()=>{t?p(x):m()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?m():h().then(m),i)}}function RX(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var rr=RX(),zl,XD,MN=(XD=class{constructor(){Ke(this,zl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),w1(this.gcTime)&&De(this,zl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(dc?1/0:5*60*1e3))}clearGcTimeout(){ie(this,zl)&&(clearTimeout(ie(this,zl)),De(this,zl,void 0))}},zl=new WeakMap,XD),ju,$u,Yo,Bl,pr,Qh,Hl,gi,ks,QD,PX=(QD=class extends MN{constructor(t){super();Ke(this,gi);Ke(this,ju);Ke(this,$u);Ke(this,Yo);Ke(this,Bl);Ke(this,pr);Ke(this,Qh);Ke(this,Hl);De(this,Hl,!1),De(this,Qh,t.defaultOptions),this.setOptions(t.options),this.observers=[],De(this,Bl,t.client),De(this,Yo,ie(this,Bl).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,De(this,ju,TX(this.options)),this.state=t.state??ie(this,ju),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=ie(this,pr))==null?void 0:t.promise}setOptions(t){this.options={...ie(this,Qh),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ie(this,Yo).remove(this)}setData(t,n){const r=E1(this.state.data,t,this.options);return Tt(this,gi,ks).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Tt(this,gi,ks).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=ie(this,pr))==null?void 0:r.promise;return(o=ie(this,pr))==null||o.cancel(t),n?n.then(Ko).catch(Ko):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ie(this,ju))}isActive(){return this.observers.some(t=>bi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===hb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!PN(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ie(this,pr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ie(this,pr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),ie(this,Yo).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(ie(this,pr)&&(ie(this,Hl)?ie(this,pr).cancel({revert:!0}):ie(this,pr).cancelRetry()),this.scheduleGc()),ie(this,Yo).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Tt(this,gi,ks).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ie(this,pr))return ie(this,pr).continueRetry(),ie(this,pr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(p=>p.options.queryFn);d&&this.setOptions(d.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(De(this,Hl,!0),r.signal)})},i=()=>{const d=TN(this.options,n),p={client:ie(this,Bl),queryKey:this.queryKey,meta:this.meta};return o(p),De(this,Hl,!1),this.options.persister?this.options.persister(d,p,this):d(p)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:ie(this,Bl),state:this.state,fetchFn:i};o(s),(l=this.options.behavior)==null||l.onFetch(s,this),De(this,$u,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&Tt(this,gi,ks).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=d=>{var p,h,m,b;bx(d)&&d.silent||Tt(this,gi,ks).call(this,{type:"error",error:d}),bx(d)||((h=(p=ie(this,Yo).config).onError)==null||h.call(p,d,this),(b=(m=ie(this,Yo).config).onSettled)==null||b.call(m,this.state.data,d,this)),this.scheduleGc()};return De(this,pr,ON({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var p,h,m,b;if(d===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(v){a(v);return}(h=(p=ie(this,Yo).config).onSuccess)==null||h.call(p,d,this),(b=(m=ie(this,Yo).config).onSettled)==null||b.call(m,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,p)=>{Tt(this,gi,ks).call(this,{type:"failed",failureCount:d,error:p})},onPause:()=>{Tt(this,gi,ks).call(this,{type:"pause"})},onContinue:()=>{Tt(this,gi,ks).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),ie(this,pr).start()}},ju=new WeakMap,$u=new WeakMap,Yo=new WeakMap,Bl=new WeakMap,pr=new WeakMap,Qh=new WeakMap,Hl=new WeakMap,gi=new WeakSet,ks=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...IN(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return bx(o)&&o.revert&&ie(this,$u)?{...ie(this,$u),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),rr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),ie(this,Yo).notify({query:this,type:"updated",action:t})})},QD);function IN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:kN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function TX(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Fi,ZD,DN=(ZD=class extends np{constructor(t={}){super();Ke(this,Fi);this.config=t,De(this,Fi,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??eC(o,n);let s=this.get(i);return s||(s=new PX({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){ie(this,Fi).has(t.queryHash)||(ie(this,Fi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ie(this,Fi).get(t.queryHash);n&&(t.destroy(),n===t&&ie(this,Fi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){rr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ie(this,Fi).get(t)}getAll(){return[...ie(this,Fi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>bk(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>bk(t,r)):n}notify(t){rr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){rr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){rr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Fi=new WeakMap,ZD),ji,Ar,Vl,$i,pa,JD,kX=(JD=class extends MN{constructor(t){super();Ke(this,$i);Ke(this,ji);Ke(this,Ar);Ke(this,Vl);this.mutationId=t.mutationId,De(this,Ar,t.mutationCache),De(this,ji,[]),this.state=t.state||AX(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ie(this,ji).includes(t)||(ie(this,ji).push(t),this.clearGcTimeout(),ie(this,Ar).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){De(this,ji,ie(this,ji).filter(n=>n!==t)),this.scheduleGc(),ie(this,Ar).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ie(this,ji).length||(this.state.status==="pending"?this.scheduleGc():ie(this,Ar).remove(this))}continue(){var t;return((t=ie(this,Vl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,d,p,h,m,b,v,x,w,_,R,C,E,A;De(this,Vl,ON({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,N)=>{Tt(this,$i,pa).call(this,{type:"failed",failureCount:M,error:N})},onPause:()=>{Tt(this,$i,pa).call(this,{type:"pause"})},onContinue:()=>{Tt(this,$i,pa).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ie(this,Ar).canRun(this)}));const n=this.state.status==="pending",r=!ie(this,Vl).canStart();try{if(!n){Tt(this,$i,pa).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=ie(this,Ar).config).onMutate)==null?void 0:i.call(o,t,this));const N=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));N!==this.state.context&&Tt(this,$i,pa).call(this,{type:"pending",context:N,variables:t,isPaused:r})}const M=await ie(this,Vl).start();return await((c=(l=ie(this,Ar).config).onSuccess)==null?void 0:c.call(l,M,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,M,t,this.state.context)),await((h=(p=ie(this,Ar).config).onSettled)==null?void 0:h.call(p,M,null,this.state.variables,this.state.context,this)),await((b=(m=this.options).onSettled)==null?void 0:b.call(m,M,null,t,this.state.context)),Tt(this,$i,pa).call(this,{type:"success",data:M}),M}catch(M){try{throw await((x=(v=ie(this,Ar).config).onError)==null?void 0:x.call(v,M,t,this.state.context,this)),await((_=(w=this.options).onError)==null?void 0:_.call(w,M,t,this.state.context)),await((C=(R=ie(this,Ar).config).onSettled)==null?void 0:C.call(R,void 0,M,this.state.variables,this.state.context,this)),await((A=(E=this.options).onSettled)==null?void 0:A.call(E,void 0,M,t,this.state.context)),M}finally{Tt(this,$i,pa).call(this,{type:"error",error:M})}}finally{ie(this,Ar).runNext(this)}}},ji=new WeakMap,Ar=new WeakMap,Vl=new WeakMap,$i=new WeakSet,pa=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),rr.batch(()=>{ie(this,ji).forEach(r=>{r.onMutationUpdate(t)}),ie(this,Ar).notify({mutation:this,type:"updated",action:t})})},JD);function AX(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ls,mi,Zh,eN,OX=(eN=class extends np{constructor(t={}){super();Ke(this,Ls);Ke(this,mi);Ke(this,Zh);this.config=t,De(this,Ls,new Set),De(this,mi,new Map),De(this,Zh,0)}build(t,n,r){const o=new kX({mutationCache:this,mutationId:++Ig(this,Zh)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){ie(this,Ls).add(t);const n=Lg(t);if(typeof n=="string"){const r=ie(this,mi).get(n);r?r.push(t):ie(this,mi).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(ie(this,Ls).delete(t)){const n=Lg(t);if(typeof n=="string"){const r=ie(this,mi).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&ie(this,mi).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Lg(t);if(typeof n=="string"){const r=ie(this,mi).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Lg(t);if(typeof n=="string"){const o=(r=ie(this,mi).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){rr.batch(()=>{ie(this,Ls).forEach(t=>{this.notify({type:"removed",mutation:t})}),ie(this,Ls).clear(),ie(this,mi).clear()})}getAll(){return Array.from(ie(this,Ls))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>yk(n,r))}findAll(t={}){return this.getAll().filter(n=>yk(t,n))}notify(t){rr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return rr.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ko))))}},Ls=new WeakMap,mi=new WeakMap,Zh=new WeakMap,eN);function Lg(e){var t;return(t=e.options.scope)==null?void 0:t.id}function wk(e){return{onFetch:(t,n)=>{var u,d,p,h,m;const r=t.options,o=(p=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,i=((h=t.state.data)==null?void 0:h.pages)||[],s=((m=t.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let b=!1;const v=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(t.signal.aborted?b=!0:t.signal.addEventListener("abort",()=>{b=!0}),t.signal)})},x=TN(t.options,t.fetchOptions),w=async(_,R,C)=>{if(b)return Promise.reject();if(R==null&&_.pages.length)return Promise.resolve(_);const E={client:t.client,queryKey:t.queryKey,pageParam:R,direction:C?"backward":"forward",meta:t.options.meta};v(E);const A=await x(E),{maxPages:M}=t.options,N=C?SX:wX;return{pages:N(_.pages,A,M),pageParams:N(_.pageParams,R,M)}};if(o&&i.length){const _=o==="backward",R=_?MX:Sk,C={pages:i,pageParams:s},E=R(r,C);a=await w(C,E,_)}else{const _=e??i.length;do{const R=l===0?s[0]??r.initialPageParam:Sk(r,a);if(l>0&&R==null)break;a=await w(a,R),l++}while(l<_)}return a};t.options.persister?t.fetchFn=()=>{var b,v;return(v=(b=t.options).persister)==null?void 0:v.call(b,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Sk(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function MX(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Sn,xa,wa,zu,Bu,Sa,Hu,Vu,tN,IX=(tN=class{constructor(e={}){Ke(this,Sn);Ke(this,xa);Ke(this,wa);Ke(this,zu);Ke(this,Bu);Ke(this,Sa);Ke(this,Hu);Ke(this,Vu);De(this,Sn,e.queryCache||new DN),De(this,xa,e.mutationCache||new OX),De(this,wa,e.defaultOptions||{}),De(this,zu,new Map),De(this,Bu,new Map),De(this,Sa,0)}mount(){Ig(this,Sa)._++,ie(this,Sa)===1&&(De(this,Hu,tC.subscribe(async e=>{e&&(await this.resumePausedMutations(),ie(this,Sn).onFocus())})),De(this,Vu,pb.subscribe(async e=>{e&&(await this.resumePausedMutations(),ie(this,Sn).onOnline())})))}unmount(){var e,t;Ig(this,Sa)._--,ie(this,Sa)===0&&((e=ie(this,Hu))==null||e.call(this),De(this,Hu,void 0),(t=ie(this,Vu))==null||t.call(this),De(this,Vu,void 0))}isFetching(e){return ie(this,Sn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ie(this,xa).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ie(this,Sn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=ie(this,Sn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Su(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return ie(this,Sn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=ie(this,Sn).get(r.queryHash),i=o==null?void 0:o.state.data,s=yX(t,i);if(s!==void 0)return ie(this,Sn).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return rr.batch(()=>ie(this,Sn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ie(this,Sn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=ie(this,Sn);rr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ie(this,Sn);return rr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=rr.batch(()=>ie(this,Sn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Ko).catch(Ko)}invalidateQueries(e,t={}){return rr.batch(()=>(ie(this,Sn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=rr.batch(()=>ie(this,Sn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ko)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ko)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=ie(this,Sn).build(this,t);return n.isStaleByTime(Su(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ko).catch(Ko)}fetchInfiniteQuery(e){return e.behavior=wk(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ko).catch(Ko)}ensureInfiniteQueryData(e){return e.behavior=wk(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return pb.isOnline()?ie(this,xa).resumePausedMutations():Promise.resolve()}getQueryCache(){return ie(this,Sn)}getMutationCache(){return ie(this,xa)}getDefaultOptions(){return ie(this,wa)}setDefaultOptions(e){De(this,wa,e)}setQueryDefaults(e,t){ie(this,zu).set(yh(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ie(this,zu).values()],n={};return t.forEach(r=>{vh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){ie(this,Bu).set(yh(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ie(this,Bu).values()],n={};return t.forEach(r=>{vh(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ie(this,wa).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=eC(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===hb&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ie(this,wa).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ie(this,Sn).clear(),ie(this,xa).clear()}},Sn=new WeakMap,xa=new WeakMap,wa=new WeakMap,zu=new WeakMap,Bu=new WeakMap,Sa=new WeakMap,Hu=new WeakMap,Vu=new WeakMap,tN),Zr,kt,Jh,Or,Wl,Wu,_a,zi,ep,Uu,Gu,Ul,Gl,Ca,qu,Vt,Af,P1,T1,k1,A1,O1,M1,I1,NN,nN,DX=(nN=class extends np{constructor(t,n){super();Ke(this,Vt);Ke(this,Zr);Ke(this,kt);Ke(this,Jh);Ke(this,Or);Ke(this,Wl);Ke(this,Wu);Ke(this,_a);Ke(this,zi);Ke(this,ep);Ke(this,Uu);Ke(this,Gu);Ke(this,Ul);Ke(this,Gl);Ke(this,Ca);Ke(this,qu,new Set);this.options=n,De(this,Zr,t),De(this,zi,null),De(this,_a,R1()),this.options.experimental_prefetchInRender||ie(this,_a).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ie(this,kt).addObserver(this),_k(ie(this,kt),this.options)?Tt(this,Vt,Af).call(this):this.updateResult(),Tt(this,Vt,A1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return D1(ie(this,kt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return D1(ie(this,kt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Tt(this,Vt,O1).call(this),Tt(this,Vt,M1).call(this),ie(this,kt).removeObserver(this)}setOptions(t,n){const r=this.options,o=ie(this,kt);if(this.options=ie(this,Zr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof bi(this.options.enabled,ie(this,kt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Tt(this,Vt,I1).call(this),ie(this,kt).setOptions(this.options),r._defaulted&&!_1(this.options,r)&&ie(this,Zr).getQueryCache().notify({type:"observerOptionsUpdated",query:ie(this,kt),observer:this});const i=this.hasListeners();i&&Ck(ie(this,kt),o,this.options,r)&&Tt(this,Vt,Af).call(this),this.updateResult(n),i&&(ie(this,kt)!==o||bi(this.options.enabled,ie(this,kt))!==bi(r.enabled,ie(this,kt))||Su(this.options.staleTime,ie(this,kt))!==Su(r.staleTime,ie(this,kt)))&&Tt(this,Vt,P1).call(this);const s=Tt(this,Vt,T1).call(this);i&&(ie(this,kt)!==o||bi(this.options.enabled,ie(this,kt))!==bi(r.enabled,ie(this,kt))||s!==ie(this,Ca))&&Tt(this,Vt,k1).call(this,s)}getOptimisticResult(t){const n=ie(this,Zr).getQueryCache().build(ie(this,Zr),t),r=this.createResult(n,t);return LX(this,r)&&(De(this,Or,r),De(this,Wu,this.options),De(this,Wl,ie(this,kt).state)),r}getCurrentResult(){return ie(this,Or)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){ie(this,qu).add(t)}getCurrentQuery(){return ie(this,kt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ie(this,Zr).defaultQueryOptions(t),r=ie(this,Zr).getQueryCache().build(ie(this,Zr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Tt(this,Vt,Af).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ie(this,Or)))}createResult(t,n){var M;const r=ie(this,kt),o=this.options,i=ie(this,Or),s=ie(this,Wl),a=ie(this,Wu),c=t!==r?t.state:ie(this,Jh),{state:u}=t;let d={...u},p=!1,h;if(n._optimisticResults){const N=this.hasListeners(),L=!N&&_k(t,n),F=N&&Ck(t,r,n,o);(L||F)&&(d={...d,...IN(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:m,errorUpdatedAt:b,status:v}=d;if(n.select&&d.data!==void 0)if(i&&d.data===(s==null?void 0:s.data)&&n.select===ie(this,ep))h=ie(this,Uu);else try{De(this,ep,n.select),h=n.select(d.data),h=E1(i==null?void 0:i.data,h,n),De(this,Uu,h),De(this,zi,null)}catch(N){De(this,zi,N)}else h=d.data;if(n.placeholderData!==void 0&&h===void 0&&v==="pending"){let N;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))N=i.data;else if(N=typeof n.placeholderData=="function"?n.placeholderData((M=ie(this,Gu))==null?void 0:M.state.data,ie(this,Gu)):n.placeholderData,n.select&&N!==void 0)try{N=n.select(N),De(this,zi,null)}catch(L){De(this,zi,L)}N!==void 0&&(v="success",h=E1(i==null?void 0:i.data,N,n),p=!0)}ie(this,zi)&&(m=ie(this,zi),h=ie(this,Uu),b=Date.now(),v="error");const x=d.fetchStatus==="fetching",w=v==="pending",_=v==="error",R=w&&x,C=h!==void 0,A={status:v,fetchStatus:d.fetchStatus,isPending:w,isSuccess:v==="success",isError:_,isInitialLoading:R,isLoading:R,data:h,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:b,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!w,isLoadingError:_&&!C,isPaused:d.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:_&&C,isStale:nC(t,n),refetch:this.refetch,promise:ie(this,_a)};if(this.options.experimental_prefetchInRender){const N=z=>{A.status==="error"?z.reject(A.error):A.data!==void 0&&z.resolve(A.data)},L=()=>{const z=De(this,_a,A.promise=R1());N(z)},F=ie(this,_a);switch(F.status){case"pending":t.queryHash===r.queryHash&&N(F);break;case"fulfilled":(A.status==="error"||A.data!==F.value)&&L();break;case"rejected":(A.status!=="error"||A.error!==F.reason)&&L();break}}return A}updateResult(t){const n=ie(this,Or),r=this.createResult(ie(this,kt),this.options);if(De(this,Wl,ie(this,kt).state),De(this,Wu,this.options),ie(this,Wl).data!==void 0&&De(this,Gu,ie(this,kt)),_1(r,n))return;De(this,Or,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!ie(this,qu).size)return!0;const l=new Set(a??ie(this,qu));return this.options.throwOnError&&l.add("error"),Object.keys(ie(this,Or)).some(c=>{const u=c;return ie(this,Or)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Tt(this,Vt,NN).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Tt(this,Vt,A1).call(this)}},Zr=new WeakMap,kt=new WeakMap,Jh=new WeakMap,Or=new WeakMap,Wl=new WeakMap,Wu=new WeakMap,_a=new WeakMap,zi=new WeakMap,ep=new WeakMap,Uu=new WeakMap,Gu=new WeakMap,Ul=new WeakMap,Gl=new WeakMap,Ca=new WeakMap,qu=new WeakMap,Vt=new WeakSet,Af=function(t){Tt(this,Vt,I1).call(this);let n=ie(this,kt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ko)),n},P1=function(){Tt(this,Vt,O1).call(this);const t=Su(this.options.staleTime,ie(this,kt));if(dc||ie(this,Or).isStale||!w1(t))return;const r=PN(ie(this,Or).dataUpdatedAt,t)+1;De(this,Ul,setTimeout(()=>{ie(this,Or).isStale||this.updateResult()},r))},T1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ie(this,kt)):this.options.refetchInterval)??!1},k1=function(t){Tt(this,Vt,M1).call(this),De(this,Ca,t),!(dc||bi(this.options.enabled,ie(this,kt))===!1||!w1(ie(this,Ca))||ie(this,Ca)===0)&&De(this,Gl,setInterval(()=>{(this.options.refetchIntervalInBackground||tC.isFocused())&&Tt(this,Vt,Af).call(this)},ie(this,Ca)))},A1=function(){Tt(this,Vt,P1).call(this),Tt(this,Vt,k1).call(this,Tt(this,Vt,T1).call(this))},O1=function(){ie(this,Ul)&&(clearTimeout(ie(this,Ul)),De(this,Ul,void 0))},M1=function(){ie(this,Gl)&&(clearInterval(ie(this,Gl)),De(this,Gl,void 0))},I1=function(){const t=ie(this,Zr).getQueryCache().build(ie(this,Zr),this.options);if(t===ie(this,kt))return;const n=ie(this,kt);De(this,kt,t),De(this,Jh,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},NN=function(t){rr.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ie(this,Or))}),ie(this,Zr).getQueryCache().notify({query:ie(this,kt),type:"observerResultsUpdated"})})},nN);function NX(e,t){return bi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function _k(e,t){return NX(e,t)||e.state.data!==void 0&&D1(e,t,t.refetchOnMount)}function D1(e,t,n){if(bi(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&nC(e,t)}return!1}function Ck(e,t,n,r){return(e!==t||bi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&nC(e,n)}function nC(e,t){return bi(t.enabled,e)!==!1&&e.isStaleByTime(Su(t.staleTime,e))}function LX(e,t){return!_1(e.getCurrentResult(),t)}var rC=P.createContext(void 0),oC=e=>{const t=P.useContext(rC);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},FX=({client:e,children:t})=>(P.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(rC.Provider,{value:e,children:t})),LN=P.createContext(!1),jX=()=>P.useContext(LN);LN.Provider;function $X(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var zX=P.createContext($X()),BX=()=>P.useContext(zX);function HX(e,t){return typeof e=="function"?e(...t):!!e}function Ek(){}var VX=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},WX=e=>{P.useEffect(()=>{e.clearReset()},[e])},UX=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||HX(n,[e.error,r])),GX=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},qX=(e,t)=>e.isLoading&&e.isFetching&&!t,YX=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Rk=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function KX(e,t,n){var d,p,h,m,b;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=oC(),o=jX(),i=BX(),s=r.defaultQueryOptions(e);(p=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||p.call(d,s),process.env.NODE_ENV!=="production"&&(s.queryFn||console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),s._optimisticResults=o?"isRestoring":"optimistic",GX(s),VX(s,i),WX(i);const a=!r.getQueryCache().get(s.queryHash),[l]=P.useState(()=>new t(r,s)),c=l.getOptimisticResult(s),u=!o&&e.subscribed!==!1;if(P.useSyncExternalStore(P.useCallback(v=>{const x=u?l.subscribe(rr.batchCalls(v)):Ek;return l.updateResult(),x},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),P.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),YX(s,c))throw Rk(s,l,i);if(UX({result:c,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw c.error;if((m=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||m.call(h,s,c),s.experimental_prefetchInRender&&!dc&&qX(c,o)){const v=a?Rk(s,l,i):(b=r.getQueryCache().get(s.queryHash))==null?void 0:b.promise;v==null||v.catch(Ek).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function rp(e,t){return KX(e,DX)}function XX(){const e=T.useContext(rC);if(e&&e.isSemaphorClient)return e}function FN({children:e}){const{setIsSessionExpired:t}=An(),n=XX(),[r]=T.useState(()=>{const o=new IX({queryCache:new DN({onError:i=>{i instanceof Error?(console.error(`Something went wrong: ${i.message}`),i.message==="invalid token"&&t(!0)):console.error("Something went wrong:",i)}}),defaultOptions:{queries:{gcTime:36e5,staleTime:3e5,refetchOnWindowFocus:!1,retry:1}}});return o.isSemaphorClient=!0,o});return n?y.jsx(y.Fragment,{children:e}):y.jsx(FX,{client:r,children:e})}const Ec=T.forwardRef(({children:e,className:t,...n},r)=>y.jsx("div",{className:ge("semaphor-scope",t),ref:r,...n,children:e})),QX={id:"",authToken:void 0},jN=T.createContext(QX),$N=({children:e,dashboardProps:t})=>y.jsx(FN,{children:y.jsx(jN.Provider,{value:t,children:y.jsx(Ec,{style:{height:"100%"},children:e})})});function Do(){const e=T.useContext(jN);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function ZX(){const{authToken:e,version:t}=Do(),n=be(a=>a.selectedLensId),{data:r,isLoading:o,isFetching:i,isError:s}=rp({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>pX(e==null?void 0:e.accessToken,{lensId:n,version:t}),enabled:!!(e!=null&&e.accessToken)});return{data:r,isLoading:o,isFetching:i,isError:s}}function JX(){const{authToken:e}=Do(),t=be(r=>r.authToken),{setAuthToken:n}=An();return T.useEffect(()=>{e&&(e==null?void 0:e.toString())!==(t==null?void 0:t.toString())&&n(e)},[e,t,n]),e}function zN(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function Pk(e,t){const n=zN(e);return n==="dark"?ql.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function eQ({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:o,selectedSheetId:i,onFilterValuesChange:s}){const{authToken:a}=Do();JX();const l=be(H=>H.selectedLensId),{data:c,isLoading:u,isFetching:d,isError:p}=ZX(),[h,m]=T.useState(o||[]),{theme:b,setTheme:v}=RN(),x=be(H=>H.dashboard.globalStyle),{setDashboard:w,setDashboardWithFilterValues:_,setSelectedSheetId:R,setStyle:C,setOnSaveFunction:E,setLenses:A,setSelectedLensId:M,setInitStore:N}=An();be(H=>H.actions.setCustomCards);const L=be(H=>H.actions.setFilterValues),F=be(H=>H.filterValues),z=be(H=>H.actions.setThemeStyle),Z=be(H=>H.actions.setDashboardTheme),G=be(H=>H.actions.setOnEvent);T.useEffect(()=>{a&&N()},[a,N]),T.useEffect(()=>{if(b){const H=zN(b);Z(H)}},[b,Z]),T.useEffect(()=>{t&&v(t)},[t,v]);const j=T.useCallback(()=>{const H=ql.cloneDeep(db),$=ql.merge(H,x);if(e){const V=ql.merge($,e),X=Pk(b,V);z(X),C(V)}else{const V=Pk(b,$);z(V),C(db)}},[b,e,x,z,C]);return T.useEffect(()=>{c&&c.dashboard&&j()},[b,e,x,j,c]),T.useEffect(()=>{var U,O;function H(J,K){const ne=J.filters||[],Y=[];for(const ee of K){const re=ne.find(ue=>ue.id===ee.filterId);re&&Y.push({filterId:ee.filterId,connectionType:re.database==="NA"?"api":"database",name:re.column,operation:re.operation,valueType:wu(re),values:ee.values})}return Y}if(!c||!c.dashboard)return;const{dashboard:$,filterValues:V,defaultLensId:X,lenses:I}=c,q=H($,h||[]);_($,(!V||(V==null?void 0:V.length)===0?q:V)||[]),X&&M(X),I&&A(I),R(i||((O=(U=$==null?void 0:$.sheets)==null?void 0:U[0])==null?void 0:O.id)||null)},[c,w,R,L,l,A,_,M,h,i]),T.useEffect(()=>{s&&F&&s(F)},[F,s]),T.useEffect(()=>{n&&E(n),r&&G(r)},[n,E,r,G]),{isFetching:d,isLoading:u,isError:p}}function _u({className:e,...t}){return y.jsx("div",{className:ge("animate-pulse rounded-md bg-muted",e),...t})}const BN=P.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:ge("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));BN.displayName="Card";const C0=P.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:ge("flex flex-col space-y-1.5 p-6",e),...t}));C0.displayName="CardHeader";const wd=P.forwardRef(({className:e,...t},n)=>y.jsx("h3",{ref:n,className:ge("text-2xl font-semibold leading-none tracking-tight",e),...t}));wd.displayName="CardTitle";const iC=P.forwardRef(({className:e,...t},n)=>y.jsx("p",{ref:n,className:ge("text-sm text-muted-foreground",e),...t}));iC.displayName="CardDescription";const E0=P.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:ge("px-6 pt-0",e),...t}));E0.displayName="CardContent";const HN=P.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:ge("flex items-center p-6 pt-0",e),...t}));HN.displayName="CardFooter";function VN({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:d,showAssistant:p,defaultFilterValues:h,onFilterValuesChange:m,selectedSheetId:b,...v}){const{placeholders:x}=Do(),w=be(E=>E.themeStyle),_=be(E=>E.isSessionExpired),{isLoading:R,isError:C}=eQ({customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:h,onFilterValuesChange:m,selectedSheetId:b});return R||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?y.jsx(o,{message:"loading"}):y.jsx("div",{className:"flex items-center gap-3",children:y.jsx(_u,{className:"h-1 w-full dark:h-[2px]"})})):C?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),y.jsx(i,{})):y.jsx("div",{children:"Error"})):_?(r==null||r({type:"error",message:"Session Expired"}),x!=null&&x.SessionExpired?y.jsx("div",{className:"flex h-full items-center justify-center",children:y.jsx("div",{children:x.SessionExpired})}):y.jsx("div",{className:"flex h-full items-center justify-center",children:y.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[y.jsx(wd,{children:"Session Expired"}),y.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):y.jsx("div",{className:ge("flex h-full flex-col justify-between",w==null?void 0:w.dashboardPanel,e),style:{},role:"dashboard-panel",...v})}function Ce(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function tQ(e,t){const n=P.createContext(t),r=i=>{const{children:s,...a}=i,l=P.useMemo(()=>a,Object.values(a));return y.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=P.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Vn(e,t=[]){let n=[];function r(i,s){const a=P.createContext(s),l=n.length;n=[...n,s];const c=d=>{var x;const{scope:p,children:h,...m}=d,b=((x=p==null?void 0:p[e])==null?void 0:x[l])||a,v=P.useMemo(()=>m,Object.values(m));return y.jsx(b.Provider,{value:v,children:h})};c.displayName=i+"Provider";function u(d,p){var b;const h=((b=p==null?void 0:p[e])==null?void 0:b[l])||a,m=P.useContext(h);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>P.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return P.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,nQ(o,...t)]}function nQ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return P.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Tk(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function R0(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Tk(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():Tk(e[o],null)}}}}function et(...e){return P.useCallback(R0(...e),e)}var Gs=P.forwardRef((e,t)=>{const{children:n,...r}=e,o=P.Children.toArray(n),i=o.find(rQ);if(i){const s=i.props.children,a=o.map(l=>l===i?P.Children.count(s)>1?P.Children.only(null):P.isValidElement(s)?s.props.children:null:l);return y.jsx(N1,{...r,ref:t,children:P.isValidElement(s)?P.cloneElement(s,void 0,a):null})}return y.jsx(N1,{...r,ref:t,children:n})});Gs.displayName="Slot";var N1=P.forwardRef((e,t)=>{const{children:n,...r}=e;if(P.isValidElement(n)){const o=iQ(n),i=oQ(r,n.props);return n.type!==P.Fragment&&(i.ref=t?R0(t,o):o),P.cloneElement(n,i)}return P.Children.count(n)>1?P.Children.only(null):null});N1.displayName="SlotClone";var sC=({children:e})=>y.jsx(y.Fragment,{children:e});function rQ(e){return P.isValidElement(e)&&e.type===sC}function oQ(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function iQ(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function P0(e){const t=e+"CollectionProvider",[n,r]=Vn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:m,children:b}=h,v=T.useRef(null),x=T.useRef(new Map).current;return y.jsx(o,{scope:m,itemMap:x,collectionRef:v,children:b})};s.displayName=t;const a=e+"CollectionSlot",l=T.forwardRef((h,m)=>{const{scope:b,children:v}=h,x=i(a,b),w=et(m,x.collectionRef);return y.jsx(Gs,{ref:w,children:v})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=T.forwardRef((h,m)=>{const{scope:b,children:v,...x}=h,w=T.useRef(null),_=et(m,w),R=i(c,b);return T.useEffect(()=>(R.itemMap.set(w,{ref:w,...x}),()=>void R.itemMap.delete(w))),y.jsx(Gs,{[u]:"",ref:_,children:v})});d.displayName=c;function p(h){const m=i(e+"CollectionConsumer",h);return T.useCallback(()=>{const v=m.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((R,C)=>x.indexOf(R.ref.current)-x.indexOf(C.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},p,r]}var or=globalThis!=null&&globalThis.document?P.useLayoutEffect:()=>{},sQ=P.useId||(()=>{}),aQ=0;function Nn(e){const[t,n]=P.useState(sQ());return or(()=>{n(r=>r??String(aQ++))},[e]),t?`radix-${t}`:""}var lQ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Oe=lQ.reduce((e,t)=>{const n=P.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?Gs:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function WN(e,t){e&&lc.flushSync(()=>e.dispatchEvent(t))}function Bn(e){const t=P.useRef(e);return P.useEffect(()=>{t.current=e}),P.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function wr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=cQ({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Bn(n),l=P.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[i,e,o,a]);return[s,l]}function cQ({defaultProp:e,onChange:t}){const n=P.useState(e),[r]=n,o=P.useRef(r),i=Bn(t);return P.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var uQ=P.createContext(void 0);function Rc(e){const t=P.useContext(uQ);return e||t||"ltr"}var yx="rovingFocusGroup.onEntryFocus",dQ={bubbles:!1,cancelable:!0},T0="RovingFocusGroup",[L1,UN,fQ]=P0(T0),[hQ,Sd]=Vn(T0,[fQ]),[pQ,gQ]=hQ(T0),GN=P.forwardRef((e,t)=>y.jsx(L1.Provider,{scope:e.__scopeRovingFocusGroup,children:y.jsx(L1.Slot,{scope:e.__scopeRovingFocusGroup,children:y.jsx(mQ,{...e,ref:t})})}));GN.displayName=T0;var mQ=P.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,p=P.useRef(null),h=et(t,p),m=Rc(i),[b=null,v]=wr({prop:s,defaultProp:a,onChange:l}),[x,w]=P.useState(!1),_=Bn(c),R=UN(n),C=P.useRef(!1),[E,A]=P.useState(0);return P.useEffect(()=>{const M=p.current;if(M)return M.addEventListener(yx,_),()=>M.removeEventListener(yx,_)},[_]),y.jsx(pQ,{scope:n,orientation:r,dir:m,loop:o,currentTabStopId:b,onItemFocus:P.useCallback(M=>v(M),[v]),onItemShiftTab:P.useCallback(()=>w(!0),[]),onFocusableItemAdd:P.useCallback(()=>A(M=>M+1),[]),onFocusableItemRemove:P.useCallback(()=>A(M=>M-1),[]),children:y.jsx(Oe.div,{tabIndex:x||E===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:Ce(e.onMouseDown,()=>{C.current=!0}),onFocus:Ce(e.onFocus,M=>{const N=!C.current;if(M.target===M.currentTarget&&N&&!x){const L=new CustomEvent(yx,dQ);if(M.currentTarget.dispatchEvent(L),!L.defaultPrevented){const F=R().filter(H=>H.focusable),z=F.find(H=>H.active),Z=F.find(H=>H.id===b),j=[z,Z,...F].filter(Boolean).map(H=>H.ref.current);KN(j,u)}}C.current=!1}),onBlur:Ce(e.onBlur,()=>w(!1))})})}),qN="RovingFocusGroupItem",YN=P.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Nn(),l=i||a,c=gQ(qN,n),u=c.currentTabStopId===l,d=UN(n),{onFocusableItemAdd:p,onFocusableItemRemove:h}=c;return P.useEffect(()=>{if(r)return p(),()=>h()},[r,p,h]),y.jsx(L1.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:y.jsx(Oe.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:Ce(e.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:Ce(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Ce(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const b=vQ(m,c.orientation,c.dir);if(b!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let x=d().filter(w=>w.focusable).map(w=>w.ref.current);if(b==="last")x.reverse();else if(b==="prev"||b==="next"){b==="prev"&&x.reverse();const w=x.indexOf(m.currentTarget);x=c.loop?xQ(x,w+1):x.slice(w+1)}setTimeout(()=>KN(x))}})})})});YN.displayName=qN;var bQ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function yQ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function vQ(e,t,n){const r=yQ(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return bQ[r]}function KN(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function xQ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var aC=GN,lC=YN;function wQ(e,t){return P.useReducer((n,r)=>t[n][r]??n,e)}var Ln=e=>{const{present:t,children:n}=e,r=SQ(t),o=typeof n=="function"?n({present:r.isPresent}):P.Children.only(n),i=et(r.ref,_Q(o));return typeof n=="function"||r.isPresent?P.cloneElement(o,{ref:i}):null};Ln.displayName="Presence";function SQ(e){const[t,n]=P.useState(),r=P.useRef({}),o=P.useRef(e),i=P.useRef("none"),s=e?"mounted":"unmounted",[a,l]=wQ(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return P.useEffect(()=>{const c=Fg(r.current);i.current=a==="mounted"?c:"none"},[a]),or(()=>{const c=r.current,u=o.current;if(u!==e){const p=i.current,h=Fg(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),or(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=h=>{const b=Fg(r.current).includes(h.animationName);if(h.target===t&&b&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},p=h=>{h.target===t&&(i.current=Fg(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:P.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Fg(e){return(e==null?void 0:e.animationName)||"none"}function _Q(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var cC="Tabs",[CQ,QAe]=Vn(cC,[Sd]),XN=Sd(),[EQ,uC]=CQ(cC),QN=P.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Rc(a),[d,p]=wr({prop:r,onChange:o,defaultProp:i});return y.jsx(EQ,{scope:n,baseId:Nn(),value:d,onValueChange:p,orientation:s,dir:u,activationMode:l,children:y.jsx(Oe.div,{dir:u,"data-orientation":s,...c,ref:t})})});QN.displayName=cC;var ZN="TabsList",JN=P.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=uC(ZN,n),s=XN(n);return y.jsx(aC,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:y.jsx(Oe.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});JN.displayName=ZN;var e5="TabsTrigger",t5=P.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=uC(e5,n),a=XN(n),l=o5(s.baseId,r),c=i5(s.baseId,r),u=r===s.value;return y.jsx(lC,{asChild:!0,...a,focusable:!o,active:u,children:y.jsx(Oe.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:Ce(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:Ce(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:Ce(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!o&&d&&s.onValueChange(r)})})})});t5.displayName=e5;var n5="TabsContent",r5=P.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=uC(n5,n),l=o5(a.baseId,r),c=i5(a.baseId,r),u=r===a.value,d=P.useRef(u);return P.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),y.jsx(Ln,{present:o||u,children:({present:p})=>y.jsx(Oe.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:p&&i})})});r5.displayName=n5;function o5(e,t){return`${e}-trigger-${t}`}function i5(e,t){return`${e}-content-${t}`}var RQ=QN,s5=JN,a5=t5,l5=r5;const dC=RQ,k0=P.forwardRef(({className:e,...t},n)=>y.jsx(s5,{ref:n,className:ge("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));k0.displayName=s5.displayName;const A0=P.forwardRef(({className:e,...t},n)=>y.jsx(a5,{ref:n,className:ge("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));A0.displayName=a5.displayName;const fC=P.forwardRef(({className:e,...t},n)=>y.jsx(l5,{ref:n,className:ge("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));fC.displayName=l5.displayName;var c5={exports:{}},op={},F1={exports:{}};(function(e,t){(function(n,r){r(t)})(Bi,function(n){function r(ee){return function(ue,fe,se,pe,ce,_e,Pe){return ee(ue,fe,Pe)}}function o(ee){return function(ue,fe,se,pe){if(!ue||!fe||typeof ue!="object"||typeof fe!="object")return ee(ue,fe,se,pe);var ce=pe.get(ue),_e=pe.get(fe);if(ce&&_e)return ce===fe&&_e===ue;pe.set(ue,fe),pe.set(fe,ue);var Pe=ee(ue,fe,se,pe);return pe.delete(ue),pe.delete(fe),Pe}}function i(ee,re){var ue={};for(var fe in ee)ue[fe]=ee[fe];for(var fe in re)ue[fe]=re[fe];return ue}function s(ee){return ee.constructor===Object||ee.constructor==null}function a(ee){return typeof ee.then=="function"}function l(ee,re){return ee===re||ee!==ee&&re!==re}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",p="[object RegExp]",h="[object Map]",m="[object Number]",b="[object Object]",v="[object Set]",x="[object String]",w=Object.prototype.toString;function _(ee){var re=ee.areArraysEqual,ue=ee.areDatesEqual,fe=ee.areMapsEqual,se=ee.areObjectsEqual,pe=ee.areRegExpsEqual,ce=ee.areSetsEqual,_e=ee.createIsNestedEqual,Pe=_e(Me);function Me(ke,Ne,tt){if(ke===Ne)return!0;if(!ke||!Ne||typeof ke!="object"||typeof Ne!="object")return ke!==ke&&Ne!==Ne;if(s(ke)&&s(Ne))return se(ke,Ne,Pe,tt);var ot=Array.isArray(ke),gn=Array.isArray(Ne);if(ot||gn)return ot===gn&&re(ke,Ne,Pe,tt);var xt=w.call(ke);return xt!==w.call(Ne)?!1:xt===d?ue(ke,Ne,Pe,tt):xt===p?pe(ke,Ne,Pe,tt):xt===h?fe(ke,Ne,Pe,tt):xt===v?ce(ke,Ne,Pe,tt):xt===b||xt===c?a(ke)||a(Ne)?!1:se(ke,Ne,Pe,tt):xt===u||xt===m||xt===x?l(ke.valueOf(),Ne.valueOf()):!1}return Me}function R(ee,re,ue,fe){var se=ee.length;if(re.length!==se)return!1;for(;se-- >0;)if(!ue(ee[se],re[se],se,se,ee,re,fe))return!1;return!0}var C=o(R);function E(ee,re){return l(ee.valueOf(),re.valueOf())}function A(ee,re,ue,fe){var se=ee.size===re.size;if(!se)return!1;if(!ee.size)return!0;var pe={},ce=0;return ee.forEach(function(_e,Pe){if(se){var Me=!1,ke=0;re.forEach(function(Ne,tt){!Me&&!pe[ke]&&(Me=ue(Pe,tt,ce,ke,ee,re,fe)&&ue(_e,Ne,Pe,tt,ee,re,fe))&&(pe[ke]=!0),ke++}),ce++,se=Me}}),se}var M=o(A),N="_owner",L=Object.prototype.hasOwnProperty;function F(ee,re,ue,fe){var se=Object.keys(ee),pe=se.length;if(Object.keys(re).length!==pe)return!1;for(var ce;pe-- >0;){if(ce=se[pe],ce===N){var _e=!!ee.$$typeof,Pe=!!re.$$typeof;if((_e||Pe)&&_e!==Pe)return!1}if(!L.call(re,ce)||!ue(ee[ce],re[ce],ce,ce,ee,re,fe))return!1}return!0}var z=o(F);function Z(ee,re){return ee.source===re.source&&ee.flags===re.flags}function G(ee,re,ue,fe){var se=ee.size===re.size;if(!se)return!1;if(!ee.size)return!0;var pe={};return ee.forEach(function(ce,_e){if(se){var Pe=!1,Me=0;re.forEach(function(ke,Ne){!Pe&&!pe[Me]&&(Pe=ue(ce,ke,_e,Ne,ee,re,fe))&&(pe[Me]=!0),Me++}),se=Pe}}),se}var j=o(G),H=Object.freeze({areArraysEqual:R,areDatesEqual:E,areMapsEqual:A,areObjectsEqual:F,areRegExpsEqual:Z,areSetsEqual:G,createIsNestedEqual:r}),$=Object.freeze({areArraysEqual:C,areDatesEqual:E,areMapsEqual:M,areObjectsEqual:z,areRegExpsEqual:Z,areSetsEqual:j,createIsNestedEqual:r}),V=_(H);function X(ee,re){return V(ee,re,void 0)}var I=_(i(H,{createIsNestedEqual:function(){return l}}));function q(ee,re){return I(ee,re,void 0)}var U=_($);function O(ee,re){return U(ee,re,new WeakMap)}var J=_(i($,{createIsNestedEqual:function(){return l}}));function K(ee,re){return J(ee,re,new WeakMap)}function ne(ee){return _(i(H,ee(H)))}function Y(ee){var re=_(i($,ee($)));return function(ue,fe,se){return se===void 0&&(se=new WeakMap),re(ue,fe,se)}}n.circularDeepEqual=O,n.circularShallowEqual=K,n.createCustomCircularEqual=Y,n.createCustomEqual=ne,n.deepEqual=X,n.sameValueZeroEqual=l,n.shallowEqual=q,Object.defineProperty(n,"__esModule",{value:!0})})})(F1,F1.exports);var hC=F1.exports;const pC=H_(zY);var vt={},PQ=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(vt,"__esModule",{value:!0});vt.bottom=gC;vt.childrenEqual=OQ;vt.cloneLayout=u5;vt.cloneLayoutItem=Yl;vt.collides=O0;vt.compact=f5;vt.compactItem=h5;vt.compactType=WQ;vt.correctBounds=p5;vt.fastPositionEqual=MQ;vt.fastRGLPropsEqual=void 0;vt.getAllCollisions=g5;vt.getFirstCollision=Ol;vt.getLayoutItem=mC;vt.getStatics=bC;vt.modifyLayout=d5;vt.moveElement=Mf;vt.moveElementAwayFromCollision=$1;vt.noop=void 0;vt.perc=DQ;vt.resizeItemInDirection=zQ;vt.setTopLeft=HQ;vt.setTransform=BQ;vt.sortLayoutItems=_C;vt.sortLayoutItemsByColRow=x5;vt.sortLayoutItemsByRowCol=v5;vt.synchronizeLayoutWithChildren=VQ;vt.validateLayout=w5;vt.withLayoutItem=AQ;var kk=hC,Of=TQ(T);function TQ(e){return e&&e.__esModule?e:{default:e}}const kQ=process.env.NODE_ENV==="production";function gC(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function u5(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Yl(e[n]);return t}function d5(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function AQ(e,t,n){let r=mC(e,t);return r?(r=n(Yl(r)),e=d5(e,r),[e,r]):[e,null]}function Yl(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function OQ(e,t){return(0,kk.deepEqual)(Of.default.Children.map(e,n=>n==null?void 0:n.key),Of.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,kk.deepEqual)(Of.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Of.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}vt.fastRGLPropsEqual=PQ;function MQ(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function O0(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function f5(e,t,n,r){const o=bC(e),i=_C(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=Yl(i[a]);c.static||(c=h5(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const IQ={x:"w",y:"h"};function j1(e,t,n,r){const o=IQ[r];t[r]+=1;const i=e.map(s=>s.i).indexOf(t.i);for(let s=i+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;O0(t,a)&&j1(e,a,n+t[o],r)}}t[r]=n}function h5(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(gC(e),t.y);t.y>0&&!Ol(e,t);)t.y--;else if(a)for(;t.x>0&&!Ol(e,t);)t.x--;let l;for(;(l=Ol(e,t))&&!(n===null&&i);)if(a?j1(o,t,l.x+l.w,"x"):j1(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Ol(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function p5(e,t){const n=bC(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;Ol(n,i);)i.y++}return e}function mC(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Ol(e,t){for(let n=0,r=e.length;n<r;n++)if(O0(e[n],t))return e[n]}function g5(e,t){return e.filter(n=>O0(n,t))}function bC(e){return e.filter(t=>t.static)}function Mf(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let d=_C(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const h=g5(d,t),m=h.length>0;if(m&&l)return u5(e);if(m&&i)return`${t.i}`,t.x=c,t.y=u,t.moved=!1,e;for(let b=0,v=h.length;b<v;b++){const x=h[b];`${t.i}${t.x}${t.y}${x.i}${x.x}${x.y}`,!x.moved&&(x.static?e=$1(e,x,t,o,s):e=$1(e,t,x,o,s))}return e}function $1(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const d={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},p=Ol(e,d),h=p&&p.y+p.h>t.y,m=p&&t.x+t.w>p.x;if(p){if(h&&a)return Mf(e,n,void 0,t.y+1,r,l,o);if(h&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(m&&s)return Mf(e,t,n.x,void 0,r,l,o)}else return`${n.i}${d.x}${d.y}`,Mf(e,n,s?d.x:void 0,a?d.y:void 0,r,l,o)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:Mf(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function DQ(e){return e*100+"%"}const m5=(e,t,n,r)=>e+n>r?t:n,b5=(e,t,n)=>e<0?t:n,y5=e=>Math.max(0,e),yC=e=>Math.max(0,e),vC=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:b5(s,e.height,o),top:yC(s)}},xC=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:m5(e.left,e.width,s,n),left:y5(o)}},wC=(e,t,n)=>{let{top:r,height:o,width:i}=t;const s=e.left-(i-e.width);return{height:o,width:s<0?e.width:m5(e.left,e.width,i,n),top:yC(r),left:y5(s)}},SC=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:b5(r,e.height,i),top:yC(r)}},NQ=function(){return vC(arguments.length<=0?void 0:arguments[0],xC(...arguments))},LQ=function(){return vC(arguments.length<=0?void 0:arguments[0],wC(...arguments))},FQ=function(){return SC(arguments.length<=0?void 0:arguments[0],xC(...arguments))},jQ=function(){return SC(arguments.length<=0?void 0:arguments[0],wC(...arguments))},$Q={n:vC,ne:NQ,e:xC,se:FQ,s:SC,sw:jQ,w:wC,nw:LQ};function zQ(e,t,n,r){const o=$Q[e];return o?o(t,{...t,...n},r):n}function BQ(e){let{top:t,left:n,width:r,height:o}=e;const i=`translate(${n}px,${t}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${r}px`,height:`${o}px`,position:"absolute"}}function HQ(e){let{top:t,left:n,width:r,height:o}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${o}px`,position:"absolute"}}function _C(e,t){return t==="horizontal"?x5(e):t==="vertical"?v5(e):e}function v5(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function x5(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function VQ(e,t,n,r,o){e=e||[];const i=[];Of.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=mC(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(Yl(l)):c?(kQ||w5([c],"ReactGridLayout.children"),i.push(Yl({...c,i:a.key}))):i.push(Yl({w:1,h:1,x:0,y:gC(i),i:String(a.key)}))});const s=p5(i,{cols:n});return o?s:f5(s,r,n)}function w5(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++){const a=n[s],l=i[a];if(typeof l!="number"||Number.isNaN(l))throw new Error(`ReactGridLayout: ${t}[${r}].${a} must be a number! Received: ${l} (${typeof l})`)}if(typeof i.i<"u"&&typeof i.i!="string")throw new Error(`ReactGridLayout: ${t}[${r}].i must be a string! Received: ${i.i} (${typeof i.i})`)}}function WQ(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const UQ=()=>{};vt.noop=UQ;var as={};Object.defineProperty(as,"__esModule",{value:!0});as.calcGridColWidth=M0;as.calcGridItemPosition=GQ;as.calcGridItemWHPx=z1;as.calcWH=YQ;as.calcXY=qQ;as.clamp=Ml;function M0(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function z1(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function GQ(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=M0(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=z1(r,c,s[0]),u.height=z1(o,l,s[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function qQ(e,t,n,r,o){const{margin:i,containerPadding:s,cols:a,rowHeight:l,maxRows:c}=e,u=M0(e);let d=Math.round((n-s[0])/(u+i[0])),p=Math.round((t-s[1])/(l+i[1]));return d=Ml(d,0,a-r),p=Ml(p,0,c-o),{x:d,y:p}}function YQ(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=M0(e);let d=Math.round((t+s[0])/(u+s[0])),p=Math.round((n+s[1])/(c+s[1])),h=Ml(d,0,l-r),m=Ml(p,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(h=Ml(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(m=Ml(p,0,a)),{w:h,h:m}}function Ml(e,t,n){return Math.max(Math.min(e,n),t)}var I0={},B1={exports:{}},jg={exports:{}},zt={};/** @license React v16.13.1
|
|
63
|
+
* react-is.production.min.js
|
|
64
|
+
*
|
|
65
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the MIT license found in the
|
|
68
|
+
* LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/var Ak;function KQ(){if(Ak)return zt;Ak=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,x=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function _(C){if(typeof C=="object"&&C!==null){var E=C.$$typeof;switch(E){case t:switch(C=C.type,C){case l:case c:case r:case i:case o:case d:return C;default:switch(C=C&&C.$$typeof,C){case a:case u:case m:case h:case s:return C;default:return E}}case n:return E}}}function R(C){return _(C)===c}return zt.AsyncMode=l,zt.ConcurrentMode=c,zt.ContextConsumer=a,zt.ContextProvider=s,zt.Element=t,zt.ForwardRef=u,zt.Fragment=r,zt.Lazy=m,zt.Memo=h,zt.Portal=n,zt.Profiler=i,zt.StrictMode=o,zt.Suspense=d,zt.isAsyncMode=function(C){return R(C)||_(C)===l},zt.isConcurrentMode=R,zt.isContextConsumer=function(C){return _(C)===a},zt.isContextProvider=function(C){return _(C)===s},zt.isElement=function(C){return typeof C=="object"&&C!==null&&C.$$typeof===t},zt.isForwardRef=function(C){return _(C)===u},zt.isFragment=function(C){return _(C)===r},zt.isLazy=function(C){return _(C)===m},zt.isMemo=function(C){return _(C)===h},zt.isPortal=function(C){return _(C)===n},zt.isProfiler=function(C){return _(C)===i},zt.isStrictMode=function(C){return _(C)===o},zt.isSuspense=function(C){return _(C)===d},zt.isValidElementType=function(C){return typeof C=="string"||typeof C=="function"||C===r||C===c||C===i||C===o||C===d||C===p||typeof C=="object"&&C!==null&&(C.$$typeof===m||C.$$typeof===h||C.$$typeof===s||C.$$typeof===a||C.$$typeof===u||C.$$typeof===v||C.$$typeof===x||C.$$typeof===w||C.$$typeof===b)},zt.typeOf=_,zt}var Bt={};/** @license React v16.13.1
|
|
70
|
+
* react-is.development.js
|
|
71
|
+
*
|
|
72
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
73
|
+
*
|
|
74
|
+
* This source code is licensed under the MIT license found in the
|
|
75
|
+
* LICENSE file in the root directory of this source tree.
|
|
76
|
+
*/var Ok;function XQ(){return Ok||(Ok=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,x=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function _(se){return typeof se=="string"||typeof se=="function"||se===r||se===c||se===i||se===o||se===d||se===p||typeof se=="object"&&se!==null&&(se.$$typeof===m||se.$$typeof===h||se.$$typeof===s||se.$$typeof===a||se.$$typeof===u||se.$$typeof===v||se.$$typeof===x||se.$$typeof===w||se.$$typeof===b)}function R(se){if(typeof se=="object"&&se!==null){var pe=se.$$typeof;switch(pe){case t:var ce=se.type;switch(ce){case l:case c:case r:case i:case o:case d:return ce;default:var _e=ce&&ce.$$typeof;switch(_e){case a:case u:case m:case h:case s:return _e;default:return pe}}case n:return pe}}}var C=l,E=c,A=a,M=s,N=t,L=u,F=r,z=m,Z=h,G=n,j=i,H=o,$=d,V=!1;function X(se){return V||(V=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),I(se)||R(se)===l}function I(se){return R(se)===c}function q(se){return R(se)===a}function U(se){return R(se)===s}function O(se){return typeof se=="object"&&se!==null&&se.$$typeof===t}function J(se){return R(se)===u}function K(se){return R(se)===r}function ne(se){return R(se)===m}function Y(se){return R(se)===h}function ee(se){return R(se)===n}function re(se){return R(se)===i}function ue(se){return R(se)===o}function fe(se){return R(se)===d}Bt.AsyncMode=C,Bt.ConcurrentMode=E,Bt.ContextConsumer=A,Bt.ContextProvider=M,Bt.Element=N,Bt.ForwardRef=L,Bt.Fragment=F,Bt.Lazy=z,Bt.Memo=Z,Bt.Portal=G,Bt.Profiler=j,Bt.StrictMode=H,Bt.Suspense=$,Bt.isAsyncMode=X,Bt.isConcurrentMode=I,Bt.isContextConsumer=q,Bt.isContextProvider=U,Bt.isElement=O,Bt.isForwardRef=J,Bt.isFragment=K,Bt.isLazy=ne,Bt.isMemo=Y,Bt.isPortal=ee,Bt.isProfiler=re,Bt.isStrictMode=ue,Bt.isSuspense=fe,Bt.isValidElementType=_,Bt.typeOf=R}()),Bt}var Mk;function S5(){return Mk||(Mk=1,process.env.NODE_ENV==="production"?jg.exports=KQ():jg.exports=XQ()),jg.exports}/*
|
|
77
|
+
object-assign
|
|
78
|
+
(c) Sindre Sorhus
|
|
79
|
+
@license MIT
|
|
80
|
+
*/var vx,Ik;function QQ(){if(Ik)return vx;Ik=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return vx=o()?Object.assign:function(i,s){for(var a,l=r(i),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)t.call(a,d)&&(l[d]=a[d]);if(e){c=e(a);for(var p=0;p<c.length;p++)n.call(a,c[p])&&(l[c[p]]=a[c[p]])}}return l},vx}var xx,Dk;function CC(){if(Dk)return xx;Dk=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return xx=e,xx}var wx,Nk;function _5(){return Nk||(Nk=1,wx=Function.call.bind(Object.prototype.hasOwnProperty)),wx}var Sx,Lk;function ZQ(){if(Lk)return Sx;Lk=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=CC(),n={},r=_5();e=function(i){var s="Warning: "+i;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function o(i,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var d;try{if(typeof i[u]!="function"){var p=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}d=i[u](s,u,l,a,null,t)}catch(m){d=m}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var h=c?c():"";e("Failed "+a+" type: "+d.message+(h??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Sx=o,Sx}var _x,Fk;function JQ(){if(Fk)return _x;Fk=1;var e=S5(),t=QQ(),n=CC(),r=_5(),o=ZQ(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return _x=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(I){var q=I&&(c&&I[c]||I[u]);if(typeof q=="function")return q}var p="<<anonymous>>",h={array:x("array"),bigint:x("bigint"),bool:x("boolean"),func:x("function"),number:x("number"),object:x("object"),string:x("string"),symbol:x("symbol"),any:w(),arrayOf:_,element:R(),elementType:C(),instanceOf:E,node:L(),objectOf:M,oneOf:A,oneOfType:N,shape:z,exact:Z};function m(I,q){return I===q?I!==0||1/I===1/q:I!==I&&q!==q}function b(I,q){this.message=I,this.data=q&&typeof q=="object"?q:{},this.stack=""}b.prototype=Error.prototype;function v(I){if(process.env.NODE_ENV!=="production")var q={},U=0;function O(K,ne,Y,ee,re,ue,fe){if(ee=ee||p,ue=ue||Y,fe!==n){if(l){var se=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw se.name="Invariant Violation",se}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var pe=ee+":"+Y;!q[pe]&&U<3&&(i("You are manually calling a React.PropTypes validation function for the `"+ue+"` prop on `"+ee+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),q[pe]=!0,U++)}}return ne[Y]==null?K?ne[Y]===null?new b("The "+re+" `"+ue+"` is marked as required "+("in `"+ee+"`, but its value is `null`.")):new b("The "+re+" `"+ue+"` is marked as required in "+("`"+ee+"`, but its value is `undefined`.")):null:I(ne,Y,ee,re,ue)}var J=O.bind(null,!1);return J.isRequired=O.bind(null,!0),J}function x(I){function q(U,O,J,K,ne,Y){var ee=U[O],re=H(ee);if(re!==I){var ue=$(ee);return new b("Invalid "+K+" `"+ne+"` of type "+("`"+ue+"` supplied to `"+J+"`, expected ")+("`"+I+"`."),{expectedType:I})}return null}return v(q)}function w(){return v(s)}function _(I){function q(U,O,J,K,ne){if(typeof I!="function")return new b("Property `"+ne+"` of component `"+J+"` has invalid PropType notation inside arrayOf.");var Y=U[O];if(!Array.isArray(Y)){var ee=H(Y);return new b("Invalid "+K+" `"+ne+"` of type "+("`"+ee+"` supplied to `"+J+"`, expected an array."))}for(var re=0;re<Y.length;re++){var ue=I(Y,re,J,K,ne+"["+re+"]",n);if(ue instanceof Error)return ue}return null}return v(q)}function R(){function I(q,U,O,J,K){var ne=q[U];if(!a(ne)){var Y=H(ne);return new b("Invalid "+J+" `"+K+"` of type "+("`"+Y+"` supplied to `"+O+"`, expected a single ReactElement."))}return null}return v(I)}function C(){function I(q,U,O,J,K){var ne=q[U];if(!e.isValidElementType(ne)){var Y=H(ne);return new b("Invalid "+J+" `"+K+"` of type "+("`"+Y+"` supplied to `"+O+"`, expected a single ReactElement type."))}return null}return v(I)}function E(I){function q(U,O,J,K,ne){if(!(U[O]instanceof I)){var Y=I.name||p,ee=X(U[O]);return new b("Invalid "+K+" `"+ne+"` of type "+("`"+ee+"` supplied to `"+J+"`, expected ")+("instance of `"+Y+"`."))}return null}return v(q)}function A(I){if(!Array.isArray(I))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),s;function q(U,O,J,K,ne){for(var Y=U[O],ee=0;ee<I.length;ee++)if(m(Y,I[ee]))return null;var re=JSON.stringify(I,function(fe,se){var pe=$(se);return pe==="symbol"?String(se):se});return new b("Invalid "+K+" `"+ne+"` of value `"+String(Y)+"` "+("supplied to `"+J+"`, expected one of "+re+"."))}return v(q)}function M(I){function q(U,O,J,K,ne){if(typeof I!="function")return new b("Property `"+ne+"` of component `"+J+"` has invalid PropType notation inside objectOf.");var Y=U[O],ee=H(Y);if(ee!=="object")return new b("Invalid "+K+" `"+ne+"` of type "+("`"+ee+"` supplied to `"+J+"`, expected an object."));for(var re in Y)if(r(Y,re)){var ue=I(Y,re,J,K,ne+"."+re,n);if(ue instanceof Error)return ue}return null}return v(q)}function N(I){if(!Array.isArray(I))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var q=0;q<I.length;q++){var U=I[q];if(typeof U!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+V(U)+" at index "+q+"."),s}function O(J,K,ne,Y,ee){for(var re=[],ue=0;ue<I.length;ue++){var fe=I[ue],se=fe(J,K,ne,Y,ee,n);if(se==null)return null;se.data&&r(se.data,"expectedType")&&re.push(se.data.expectedType)}var pe=re.length>0?", expected one of type ["+re.join(", ")+"]":"";return new b("Invalid "+Y+" `"+ee+"` supplied to "+("`"+ne+"`"+pe+"."))}return v(O)}function L(){function I(q,U,O,J,K){return G(q[U])?null:new b("Invalid "+J+" `"+K+"` supplied to "+("`"+O+"`, expected a ReactNode."))}return v(I)}function F(I,q,U,O,J){return new b((I||"React class")+": "+q+" type `"+U+"."+O+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+J+"`.")}function z(I){function q(U,O,J,K,ne){var Y=U[O],ee=H(Y);if(ee!=="object")return new b("Invalid "+K+" `"+ne+"` of type `"+ee+"` "+("supplied to `"+J+"`, expected `object`."));for(var re in I){var ue=I[re];if(typeof ue!="function")return F(J,K,ne,re,$(ue));var fe=ue(Y,re,J,K,ne+"."+re,n);if(fe)return fe}return null}return v(q)}function Z(I){function q(U,O,J,K,ne){var Y=U[O],ee=H(Y);if(ee!=="object")return new b("Invalid "+K+" `"+ne+"` of type `"+ee+"` "+("supplied to `"+J+"`, expected `object`."));var re=t({},U[O],I);for(var ue in re){var fe=I[ue];if(r(I,ue)&&typeof fe!="function")return F(J,K,ne,ue,$(fe));if(!fe)return new b("Invalid "+K+" `"+ne+"` key `"+ue+"` supplied to `"+J+"`.\nBad object: "+JSON.stringify(U[O],null," ")+`
|
|
81
|
+
Valid keys: `+JSON.stringify(Object.keys(I),null," "));var se=fe(Y,ue,J,K,ne+"."+ue,n);if(se)return se}return null}return v(q)}function G(I){switch(typeof I){case"number":case"string":case"undefined":return!0;case"boolean":return!I;case"object":if(Array.isArray(I))return I.every(G);if(I===null||a(I))return!0;var q=d(I);if(q){var U=q.call(I),O;if(q!==I.entries){for(;!(O=U.next()).done;)if(!G(O.value))return!1}else for(;!(O=U.next()).done;){var J=O.value;if(J&&!G(J[1]))return!1}}else return!1;return!0;default:return!1}}function j(I,q){return I==="symbol"?!0:q?q["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&q instanceof Symbol:!1}function H(I){var q=typeof I;return Array.isArray(I)?"array":I instanceof RegExp?"object":j(q,I)?"symbol":q}function $(I){if(typeof I>"u"||I===null)return""+I;var q=H(I);if(q==="object"){if(I instanceof Date)return"date";if(I instanceof RegExp)return"regexp"}return q}function V(I){var q=$(I);switch(q){case"array":case"object":return"an "+q;case"boolean":case"date":case"regexp":return"a "+q;default:return q}}function X(I){return!I.constructor||!I.constructor.name?p:I.constructor.name}return h.checkPropTypes=o,h.resetWarningCache=o.resetWarningCache,h.PropTypes=h,h},_x}var Cx,jk;function eZ(){if(jk)return Cx;jk=1;var e=CC();function t(){}function n(){}return n.resetWarningCache=t,Cx=function(){function r(s,a,l,c,u,d){if(d!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Cx}if(process.env.NODE_ENV!=="production"){var tZ=S5(),nZ=!0;B1.exports=JQ()(tZ.isElement,nZ)}else B1.exports=eZ()();var qa=B1.exports,D0={exports:{}},C5={};function E5(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=E5(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function $k(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=E5(e))&&(r&&(r+=" "),r+=t);return r}const rZ=Object.freeze(Object.defineProperty({__proto__:null,clsx:$k,default:$k},Symbol.toStringTag,{value:"Module"})),oZ=H_(rZ);var Rn={},ls={};Object.defineProperty(ls,"__esModule",{value:!0});ls.dontSetMe=cZ;ls.findInArray=iZ;ls.int=lZ;ls.isFunction=sZ;ls.isNum=aZ;function iZ(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function sZ(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function aZ(e){return typeof e=="number"&&!isNaN(e)}function lZ(e){return parseInt(e,10)}function cZ(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var Pc={};Object.defineProperty(Pc,"__esModule",{value:!0});Pc.browserPrefixToKey=P5;Pc.browserPrefixToStyle=uZ;Pc.default=void 0;Pc.getPrefix=R5;const Ex=["Moz","Webkit","O","ms"];function R5(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<Ex.length;r++)if(P5(t,Ex[r])in n)return Ex[r];return""}function P5(e,t){return t?"".concat(t).concat(dZ(e)):e}function uZ(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function dZ(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}Pc.default=R5();Object.defineProperty(Rn,"__esModule",{value:!0});Rn.addClassName=A5;Rn.addEvent=pZ;Rn.addUserSelectStyles=EZ;Rn.createCSSTransform=wZ;Rn.createSVGTransform=SZ;Rn.getTouch=_Z;Rn.getTouchIdentifier=CZ;Rn.getTranslation=EC;Rn.innerHeight=yZ;Rn.innerWidth=vZ;Rn.matchesSelector=k5;Rn.matchesSelectorAndParentsTo=hZ;Rn.offsetXYFromParent=xZ;Rn.outerHeight=mZ;Rn.outerWidth=bZ;Rn.removeClassName=O5;Rn.removeEvent=gZ;Rn.removeUserSelectStyles=RZ;var To=ls,zk=fZ(Pc);function T5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(T5=function(r){return r?n:t})(e)}function fZ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=T5(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}let $g="";function k5(e,t){return $g||($g=(0,To.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,To.isFunction)(e[n])})),(0,To.isFunction)(e[$g])?e[$g](t):!1}function hZ(e,t,n){let r=e;do{if(k5(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function pZ(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function gZ(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function mZ(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,To.int)(n.borderTopWidth),t+=(0,To.int)(n.borderBottomWidth),t}function bZ(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,To.int)(n.borderLeftWidth),t+=(0,To.int)(n.borderRightWidth),t}function yZ(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,To.int)(n.paddingTop),t-=(0,To.int)(n.paddingBottom),t}function vZ(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,To.int)(n.paddingLeft),t-=(0,To.int)(n.paddingRight),t}function xZ(e,t,n){const o=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-o.left)/n,s=(e.clientY+t.scrollTop-o.top)/n;return{x:i,y:s}}function wZ(e,t){const n=EC(e,t,"px");return{[(0,zk.browserPrefixToKey)("transform",zk.default)]:n}}function SZ(e,t){return EC(e,t,"")}function EC(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const s="".concat(typeof t.x=="string"?t.x:t.x+n),a="".concat(typeof t.y=="string"?t.y:t.y+n);i="translate(".concat(s,", ").concat(a,")")+i}return i}function _Z(e,t){return e.targetTouches&&(0,To.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,To.findInArray)(e.changedTouches,n=>t===n.identifier)}function CZ(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function EZ(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
82
|
+
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
83
|
+
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&A5(e.body,"react-draggable-transparent-selection")}function RZ(e){if(e)try{if(e.body&&O5(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function A5(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function O5(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var cs={};Object.defineProperty(cs,"__esModule",{value:!0});cs.canDragX=kZ;cs.canDragY=AZ;cs.createCoreData=MZ;cs.createDraggableData=IZ;cs.getBoundPosition=PZ;cs.getControlPosition=OZ;cs.snapToGrid=TZ;var wo=ls,hu=Rn;function PZ(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:DZ(r);const o=RC(e);if(typeof r=="string"){const{ownerDocument:i}=o,s=i.defaultView;let a;if(r==="parent"?a=o.parentNode:a=i.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(o),u=s.getComputedStyle(l);r={left:-o.offsetLeft+(0,wo.int)(u.paddingLeft)+(0,wo.int)(c.marginLeft),top:-o.offsetTop+(0,wo.int)(u.paddingTop)+(0,wo.int)(c.marginTop),right:(0,hu.innerWidth)(l)-(0,hu.outerWidth)(o)-o.offsetLeft+(0,wo.int)(u.paddingRight)-(0,wo.int)(c.marginRight),bottom:(0,hu.innerHeight)(l)-(0,hu.outerHeight)(o)-o.offsetTop+(0,wo.int)(u.paddingBottom)-(0,wo.int)(c.marginBottom)}}return(0,wo.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,wo.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,wo.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,wo.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function TZ(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function kZ(e){return e.props.axis==="both"||e.props.axis==="x"}function AZ(e){return e.props.axis==="both"||e.props.axis==="y"}function OZ(e,t,n){const r=typeof t=="number"?(0,hu.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=RC(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,hu.offsetXYFromParent)(r||e,i,n.props.scale)}function MZ(e,t,n){const r=!(0,wo.isNum)(e.lastX),o=RC(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function IZ(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function DZ(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function RC(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var N0={},L0={};Object.defineProperty(L0,"__esModule",{value:!0});L0.default=NZ;function NZ(){}Object.defineProperty(N0,"__esModule",{value:!0});N0.default=void 0;var Rx=FZ(T),Gr=PC(qa),LZ=PC(br),dr=Rn,ua=cs,Px=ls,af=PC(L0);function PC(e){return e&&e.__esModule?e:{default:e}}function M5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(M5=function(r){return r?n:t})(e)}function FZ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=M5(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function kr(e,t,n){return t=jZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jZ(e){var t=$Z(e,"string");return typeof t=="symbol"?t:String(t)}function $Z(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const fi={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let da=fi.mouse,F0=class extends Rx.Component{constructor(){super(...arguments),kr(this,"dragging",!1),kr(this,"lastX",NaN),kr(this,"lastY",NaN),kr(this,"touchIdentifier",null),kr(this,"mounted",!1),kr(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,dr.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,dr.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,dr.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,ua.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,ua.createCoreData)(this,s,a);(0,af.default)("DraggableCore: handleDragStart: %j",l),(0,af.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,dr.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,dr.addEvent)(r,da.move,this.handleDrag),(0,dr.addEvent)(r,da.stop,this.handleDragStop))}),kr(this,"handleDrag",t=>{const n=(0,ua.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=o-this.lastY;if([a,l]=(0,ua.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,ua.createCoreData)(this,r,o);if((0,af.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),kr(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,ua.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,ua.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,ua.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,dr.removeUserSelectStyles)(a.ownerDocument),(0,af.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,af.default)("DraggableCore: Removing handlers"),(0,dr.removeEvent)(a.ownerDocument,da.move,this.handleDrag),(0,dr.removeEvent)(a.ownerDocument,da.stop,this.handleDragStop))}),kr(this,"onMouseDown",t=>(da=fi.mouse,this.handleDragStart(t))),kr(this,"onMouseUp",t=>(da=fi.mouse,this.handleDragStop(t))),kr(this,"onTouchStart",t=>(da=fi.touch,this.handleDragStart(t))),kr(this,"onTouchEnd",t=>(da=fi.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,dr.addEvent)(t,fi.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,dr.removeEvent)(n,fi.mouse.move,this.handleDrag),(0,dr.removeEvent)(n,fi.touch.move,this.handleDrag),(0,dr.removeEvent)(n,fi.mouse.stop,this.handleDragStop),(0,dr.removeEvent)(n,fi.touch.stop,this.handleDragStop),(0,dr.removeEvent)(t,fi.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,dr.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:LZ.default.findDOMNode(this)}render(){return Rx.cloneElement(Rx.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};N0.default=F0;kr(F0,"displayName","DraggableCore");kr(F0,"propTypes",{allowAnyClick:Gr.default.bool,children:Gr.default.node.isRequired,disabled:Gr.default.bool,enableUserSelectHack:Gr.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Gr.default.arrayOf(Gr.default.number),handle:Gr.default.string,cancel:Gr.default.string,nodeRef:Gr.default.object,onStart:Gr.default.func,onDrag:Gr.default.func,onStop:Gr.default.func,onMouseDown:Gr.default.func,scale:Gr.default.number,className:Px.dontSetMe,style:Px.dontSetMe,transform:Px.dontSetMe});kr(F0,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=p(T),n=u(qa),r=u(br),o=u(oZ),i=Rn,s=cs,a=ls,l=u(N0),c=u(L0);function u(w){return w&&w.__esModule?w:{default:w}}function d(w){if(typeof WeakMap!="function")return null;var _=new WeakMap,R=new WeakMap;return(d=function(C){return C?R:_})(w)}function p(w,_){if(w&&w.__esModule)return w;if(w===null||typeof w!="object"&&typeof w!="function")return{default:w};var R=d(_);if(R&&R.has(w))return R.get(w);var C={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var A in w)if(A!=="default"&&Object.prototype.hasOwnProperty.call(w,A)){var M=E?Object.getOwnPropertyDescriptor(w,A):null;M&&(M.get||M.set)?Object.defineProperty(C,A,M):C[A]=w[A]}return C.default=w,R&&R.set(w,C),C}function h(){return h=Object.assign?Object.assign.bind():function(w){for(var _=1;_<arguments.length;_++){var R=arguments[_];for(var C in R)Object.prototype.hasOwnProperty.call(R,C)&&(w[C]=R[C])}return w},h.apply(this,arguments)}function m(w,_,R){return _=b(_),_ in w?Object.defineProperty(w,_,{value:R,enumerable:!0,configurable:!0,writable:!0}):w[_]=R,w}function b(w){var _=v(w,"string");return typeof _=="symbol"?_:String(_)}function v(w,_){if(typeof w!="object"||w===null)return w;var R=w[Symbol.toPrimitive];if(R!==void 0){var C=R.call(w,_);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(w)}class x extends t.Component{static getDerivedStateFromProps(_,R){let{position:C}=_,{prevPropsPosition:E}=R;return C&&(!E||C.x!==E.x||C.y!==E.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:C,prevPropsPosition:E}),{x:C.x,y:C.y,prevPropsPosition:{...C}}):null}constructor(_){super(_),m(this,"onDragStart",(R,C)=>{if((0,c.default)("Draggable: onDragStart: %j",C),this.props.onStart(R,(0,s.createDraggableData)(this,C))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),m(this,"onDrag",(R,C)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",C);const E=(0,s.createDraggableData)(this,C),A={x:E.x,y:E.y,slackX:0,slackY:0};if(this.props.bounds){const{x:N,y:L}=A;A.x+=this.state.slackX,A.y+=this.state.slackY;const[F,z]=(0,s.getBoundPosition)(this,A.x,A.y);A.x=F,A.y=z,A.slackX=this.state.slackX+(N-A.x),A.slackY=this.state.slackY+(L-A.y),E.x=A.x,E.y=A.y,E.deltaX=A.x-this.state.x,E.deltaY=A.y-this.state.y}if(this.props.onDrag(R,E)===!1)return!1;this.setState(A)}),m(this,"onDragStop",(R,C)=>{if(!this.state.dragging||this.props.onStop(R,(0,s.createDraggableData)(this,C))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",C);const A={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:N,y:L}=this.props.position;A.x=N,A.y=L}this.setState(A)}),this.state={dragging:!1,dragged:!1,x:_.position?_.position.x:_.defaultPosition.x,y:_.position?_.position.y:_.defaultPosition.y,prevPropsPosition:{..._.position},slackX:0,slackY:0,isElementSVG:!1},_.position&&!(_.onDrag||_.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var _,R;return(_=(R=this.props)===null||R===void 0||(R=R.nodeRef)===null||R===void 0?void 0:R.current)!==null&&_!==void 0?_:r.default.findDOMNode(this)}render(){const{axis:_,bounds:R,children:C,defaultPosition:E,defaultClassName:A,defaultClassNameDragging:M,defaultClassNameDragged:N,position:L,positionOffset:F,scale:z,...Z}=this.props;let G={},j=null;const $=!!!L||this.state.dragging,V=L||E,X={x:(0,s.canDragX)(this)&&$?this.state.x:V.x,y:(0,s.canDragY)(this)&&$?this.state.y:V.y};this.state.isElementSVG?j=(0,i.createSVGTransform)(X,F):G=(0,i.createCSSTransform)(X,F);const I=(0,o.default)(C.props.className||"",A,{[M]:this.state.dragging,[N]:this.state.dragged});return t.createElement(l.default,h({},Z,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(C),{className:I,style:{...C.props.style,...G},transform:j}))}}e.default=x,m(x,"displayName","Draggable"),m(x,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),m(x,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(C5);const{default:I5,DraggableCore:zZ}=C5;D0.exports=I5;D0.exports.default=I5;D0.exports.DraggableCore=zZ;var D5=D0.exports,j0={exports:{}},ip={},TC={};TC.__esModule=!0;TC.cloneElement=GZ;var BZ=HZ(T);function HZ(e){return e&&e.__esModule?e:{default:e}}function Bk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Hk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bk(Object(n),!0).forEach(function(r){VZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VZ(e,t,n){return t=WZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WZ(e){var t=UZ(e,"string");return typeof t=="symbol"?t:String(t)}function UZ(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function GZ(e,t){return t.style&&e.props.style&&(t.style=Hk(Hk({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),BZ.default.cloneElement(e,t)}var sp={};sp.__esModule=!0;sp.resizableProps=void 0;var ht=qZ(qa);function qZ(e){return e&&e.__esModule?e:{default:e}}var YZ={axis:ht.default.oneOf(["both","x","y","none"]),className:ht.default.string,children:ht.default.element.isRequired,draggableOpts:ht.default.shape({allowAnyClick:ht.default.bool,cancel:ht.default.string,children:ht.default.node,disabled:ht.default.bool,enableUserSelectHack:ht.default.bool,offsetParent:ht.default.node,grid:ht.default.arrayOf(ht.default.number),handle:ht.default.string,nodeRef:ht.default.object,onStart:ht.default.func,onDrag:ht.default.func,onStop:ht.default.func,onMouseDown:ht.default.func,scale:ht.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=ht.default.number).isRequired.apply(i,n)}return ht.default.number.apply(ht.default,n)},handle:ht.default.oneOfType([ht.default.node,ht.default.func]),handleSize:ht.default.arrayOf(ht.default.number),lockAspectRatio:ht.default.bool,maxConstraints:ht.default.arrayOf(ht.default.number),minConstraints:ht.default.arrayOf(ht.default.number),onResizeStop:ht.default.func,onResizeStart:ht.default.func,onResize:ht.default.func,resizeHandles:ht.default.arrayOf(ht.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:ht.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=ht.default.number).isRequired.apply(i,n)}return ht.default.number.apply(ht.default,n)}};sp.resizableProps=YZ;ip.__esModule=!0;ip.default=void 0;var lf=JZ(T),KZ=D5,XZ=TC,QZ=sp,ZZ=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function N5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(N5=function(o){return o?n:t})(e)}function JZ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=N5(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function H1(){return H1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H1.apply(this,arguments)}function eJ(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function Vk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Tx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Vk(Object(n),!0).forEach(function(r){tJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tJ(e,t,n){return t=nJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nJ(e){var t=rJ(e,"string");return typeof t=="symbol"?t:String(t)}function rJ(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oJ(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,V1(e,t)}function V1(e,t){return V1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},V1(e,t)}var kC=function(e){oJ(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,d=o-this.props.width,p=i-this.props.height;Math.abs(d)>Math.abs(p*u)?i=o/u:o=i*u}var h=o,m=i,b=this.slack||[0,0],v=b[0],x=b[1];return o+=v,i+=x,a&&(o=Math.max(a[0],o),i=Math.max(a[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[v+(h-o),x+(m-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var c=l.node,u=l.deltaX,d=l.deltaY;o==="onResizeStart"&&s.resetData();var p=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",h=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!p&&!h)){var m=i[0],b=i[i.length-1],v=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(b==="w"){var x=v.left-s.lastHandleRect.left;u+=x}if(m==="n"){var w=v.top-s.lastHandleRect.top;d+=w}}s.lastHandleRect=v,b==="w"&&(u=-u),m==="n"&&(d=-d);var _=s.props.width+(p?u/s.props.transformScale:0),R=s.props.height+(h?d/s.props.transformScale:0),C=s.runConstraints(_,R);_=C[0],R=C[1];var E=_!==s.props.width||R!==s.props.height,A=typeof s.props[o]=="function"?s.props[o]:null,M=o==="onResize"&&!E;A&&!M&&(a.persist==null||a.persist(),A(a,{node:c,size:{width:_,height:R},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return lf.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof s=="function")return s(o,i);var a=typeof s.type=="string",l=Tx({ref:i},a?{}:{handleAxis:o});return lf.cloneElement(s,l)},n.render=function(){var o=this,i=this.props,s=i.children,a=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=eJ(i,ZZ);return(0,XZ.cloneElement)(s,Tx(Tx({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(d){var p,h=(p=o.handleRefs[d])!=null?p:o.handleRefs[d]=lf.createRef();return lf.createElement(KZ.DraggableCore,H1({},l,{nodeRef:h,key:"resizableHandle-"+d,onStop:o.resizeHandler("onResizeStop",d),onStart:o.resizeHandler("onResizeStart",d),onDrag:o.resizeHandler("onResize",d)}),o.renderResizeHandle(d,h))}))}))},t}(lf.Component);ip.default=kC;kC.propTypes=QZ.resizableProps;kC.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var $0={};$0.__esModule=!0;$0.default=void 0;var kx=cJ(T),iJ=L5(qa),sJ=L5(ip),aJ=sp,lJ=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function L5(e){return e&&e.__esModule?e:{default:e}}function F5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(F5=function(o){return o?n:t})(e)}function cJ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=F5(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function W1(){return W1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},W1.apply(this,arguments)}function Wk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function gb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wk(Object(n),!0).forEach(function(r){uJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uJ(e,t,n){return t=dJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dJ(e){var t=fJ(e,"string");return typeof t=="symbol"?t:String(t)}function fJ(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hJ(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function pJ(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,U1(e,t)}function U1(e,t){return U1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},U1(e,t)}var j5=function(e){pJ(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,s=o.handleSize;o.onResize;var a=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,d=o.maxConstraints,p=o.lockAspectRatio,h=o.axis;o.width,o.height;var m=o.resizeHandles,b=o.style,v=o.transformScale,x=hJ(o,lJ);return kx.createElement(sJ.default,{axis:h,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:p,maxConstraints:d,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:m,transformScale:v,width:this.state.width},kx.createElement("div",W1({},x,{style:gb(gb({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(kx.Component);$0.default=j5;j5.propTypes=gb(gb({},aJ.resizableProps),{},{children:iJ.default.element});j0.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};j0.exports.Resizable=ip.default;j0.exports.ResizableBox=$0.default;var gJ=j0.exports,Us={};Object.defineProperty(Us,"__esModule",{value:!0});Us.resizeHandleType=Us.resizeHandleAxesType=Us.default=void 0;var gt=$5(qa),mJ=$5(T);function $5(e){return e&&e.__esModule?e:{default:e}}const bJ=Us.resizeHandleAxesType=gt.default.arrayOf(gt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),yJ=Us.resizeHandleType=gt.default.oneOfType([gt.default.node,gt.default.func]);Us.default={className:gt.default.string,style:gt.default.object,width:gt.default.number,autoSize:gt.default.bool,cols:gt.default.number,draggableCancel:gt.default.string,draggableHandle:gt.default.string,verticalCompact:function(e){e.verticalCompact===!1&&process.env.NODE_ENV!=="production"&&console.warn('`verticalCompact` on <ReactGridLayout> is deprecated and will be removed soon. Use `compactType`: "horizontal" | "vertical" | null.')},compactType:gt.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&vt.validateLayout(t,"layout")},margin:gt.default.arrayOf(gt.default.number),containerPadding:gt.default.arrayOf(gt.default.number),rowHeight:gt.default.number,maxRows:gt.default.number,isBounded:gt.default.bool,isDraggable:gt.default.bool,isResizable:gt.default.bool,allowOverlap:gt.default.bool,preventCollision:gt.default.bool,useCSSTransforms:gt.default.bool,transformScale:gt.default.number,isDroppable:gt.default.bool,resizeHandles:bJ,resizeHandle:yJ,onLayoutChange:gt.default.func,onDragStart:gt.default.func,onDrag:gt.default.func,onDragStop:gt.default.func,onResizeStart:gt.default.func,onResize:gt.default.func,onResizeStop:gt.default.func,onDrop:gt.default.func,droppingItem:gt.default.shape({i:gt.default.string.isRequired,w:gt.default.number.isRequired,h:gt.default.number.isRequired}),children:function(e,t){const n=e[t],r={};mJ.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:gt.default.any};Object.defineProperty(I0,"__esModule",{value:!0});I0.default=void 0;var Qc=AC(T),Lt=AC(qa),vJ=D5,xJ=gJ,Zc=vt,tr=as,Uk=Us,wJ=AC(pC);function AC(e){return e&&e.__esModule?e:{default:e}}function Ii(e,t,n){return t=SJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SJ(e){var t=_J(e,"string");return typeof t=="symbol"?t:String(t)}function _J(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class OC extends Qc.default.Component{constructor(){super(...arguments),Ii(this,"state",{resizing:null,dragging:null,className:""}),Ii(this,"elementRef",Qc.default.createRef()),Ii(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),c=r.getBoundingClientRect(),u=c.left/i,d=l.left/i,p=c.top/i,h=l.top/i;s.left=u-d+a.scrollLeft,s.top=p-h+a.scrollTop,this.setState({dragging:s});const{x:m,y:b}=(0,tr.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return o.call(this,this.props.i,m,b,{e:t,node:r,newPosition:s})}),Ii(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=n;const{onDrag:s}=this.props;if(!s)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let a=this.state.dragging.top+i,l=this.state.dragging.left+o;const{isBounded:c,i:u,w:d,h:p,containerWidth:h}=this.props,m=this.getPositionParams();if(c){const{offsetParent:w}=r;if(w){const{margin:_,rowHeight:R,containerPadding:C}=this.props,E=w.clientHeight-(0,tr.calcGridItemWHPx)(p,R,_[1]);a=(0,tr.clamp)(a-C[1],0,E);const A=(0,tr.calcGridColWidth)(m),M=h-(0,tr.calcGridItemWHPx)(d,A,_[0]);l=(0,tr.clamp)(l-C[0],0,M)}}const b={top:a,left:l};this.setState({dragging:b});const{x:v,y:x}=(0,tr.calcXY)(m,a,l,d,p);return s.call(this,u,v,x,{e:t,node:r,newPosition:b})}),Ii(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:s,i:a}=this.props,{left:l,top:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:d,y:p}=(0,tr.calcXY)(this.getPositionParams(),c,l,i,s);return o.call(this,a,d,p,{e:t,node:r,newPosition:u})}),Ii(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Ii(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Ii(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,tr.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,tr.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,Zc.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=t.droppingPosition||{left:0,top:0},{dragging:i}=this.state,s=i&&n.left!==o.left||n.top!==o.top;if(!i)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(s){const a=n.left-i.left,l=n.top-i.top;this.onDrag(n.e,{node:r,deltaX:a,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:o}=this.props;let i;return o?i=(0,Zc.setTransform)(t):(i=(0,Zc.setTopLeft)(t),n&&(i.left=(0,Zc.perc)(t.left/r),i.width=(0,Zc.perc)(t.width/r))),i}mixinDraggable(t,n){return Qc.default.createElement(vJ.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:i,minH:s,maxW:a,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:d}=this.props,p=this.getPositionParams(),h=(0,tr.calcGridItemPosition)(p,0,0,o,0).width,m=(0,tr.calcGridItemPosition)(p,0,0,i,s),b=(0,tr.calcGridItemPosition)(p,0,0,a,l),v=[m.width,m.height],x=[Math.min(b.width,h),Math.min(b.height,1/0)];return Qc.default.createElement(xJ.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:v,maxConstraints:x,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:u,handle:d},t)}onResizeHandler(t,n,r,o){let{node:i,size:s,handle:a}=n;const l=this.props[o];if(!l)return;const{x:c,y:u,i:d,maxH:p,minH:h,containerWidth:m}=this.props,{minW:b,maxW:v}=this.props;let x=s;i&&(x=(0,Zc.resizeItemInDirection)(a,r,s,m),this.setState({resizing:o==="onResizeStop"?null:x}));let{w,h:_}=(0,tr.calcWH)(this.getPositionParams(),x.width,x.height,c,u,a);w=(0,tr.clamp)(w,Math.max(b,1),v),_=(0,tr.clamp)(_,h,p),l.call(this,d,w,_,{e:t,node:i,size:x,handle:a})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,tr.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=Qc.default.Children.only(this.props.children);let d=Qc.default.cloneElement(u,{ref:this.elementRef,className:(0,wJ.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"react-draggable-dragging":!!this.state.dragging,dropping:!!a,cssTransforms:l}),style:{...this.props.style,...u.props.style,...this.createStyle(c)}});return d=this.mixinResizable(d,c,s),d=this.mixinDraggable(d,i),d}}I0.default=OC;Ii(OC,"propTypes",{children:Lt.default.element,cols:Lt.default.number.isRequired,containerWidth:Lt.default.number.isRequired,rowHeight:Lt.default.number.isRequired,margin:Lt.default.array.isRequired,maxRows:Lt.default.number.isRequired,containerPadding:Lt.default.array.isRequired,x:Lt.default.number.isRequired,y:Lt.default.number.isRequired,w:Lt.default.number.isRequired,h:Lt.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:Lt.default.string.isRequired,resizeHandles:Uk.resizeHandleAxesType,resizeHandle:Uk.resizeHandleType,onDragStop:Lt.default.func,onDragStart:Lt.default.func,onDrag:Lt.default.func,onResizeStop:Lt.default.func,onResizeStart:Lt.default.func,onResize:Lt.default.func,isDraggable:Lt.default.bool.isRequired,isResizable:Lt.default.bool.isRequired,isBounded:Lt.default.bool.isRequired,static:Lt.default.bool,useCSSTransforms:Lt.default.bool.isRequired,transformScale:Lt.default.number,className:Lt.default.string,handle:Lt.default.string,cancel:Lt.default.string,droppingPosition:Lt.default.shape({e:Lt.default.object.isRequired,left:Lt.default.number.isRequired,top:Lt.default.number.isRequired})});Ii(OC,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(op,"__esModule",{value:!0});op.default=void 0;var fl=PJ(T),Ax=hC,CJ=MC(pC),Ze=vt,EJ=as,Gk=MC(I0),RJ=MC(Us);function MC(e){return e&&e.__esModule?e:{default:e}}function z5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(z5=function(r){return r?n:t})(e)}function PJ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=z5(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function hr(e,t,n){return t=TJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TJ(e){var t=kJ(e,"string");return typeof t=="symbol"?t:String(t)}function kJ(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const qk="react-grid-layout";let B5=!1;try{B5=/firefox/i.test(navigator.userAgent)}catch{}class z0 extends fl.Component{constructor(){super(...arguments),hr(this,"state",{activeDrag:null,layout:(0,Ze.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,Ze.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),hr(this,"dragEnterCounter",0),hr(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,Ze.getLayoutItem)(a,t);if(!l)return;const c={w:l.w,h:l.h,x:l.x,y:l.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,Ze.cloneLayoutItem)(l),oldLayout:a,activeDrag:c}),this.props.onDragStart(a,l,l,null,i,s)}),hr(this,"onDrag",(t,n,r,o)=>{let{e:i,node:s}=o;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:d}=this.props,p=(0,Ze.getLayoutItem)(l,t);if(!p)return;const h={w:p.w,h:p.h,x:p.x,y:p.y,placeholder:!0,i:t};l=(0,Ze.moveElement)(l,p,n,r,!0,d,(0,Ze.compactType)(this.props),c,u),this.props.onDrag(l,a,p,h,i,s),this.setState({layout:u?l:(0,Ze.compact)(l,(0,Ze.compactType)(this.props),c),activeDrag:h})}),hr(this,"onDragStop",(t,n,r,o)=>{let{e:i,node:s}=o;if(!this.state.activeDrag)return;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:d}=this.props,p=(0,Ze.getLayoutItem)(l,t);if(!p)return;l=(0,Ze.moveElement)(l,p,n,r,!0,u,(0,Ze.compactType)(this.props),c,d);const m=d?l:(0,Ze.compact)(l,(0,Ze.compactType)(this.props),c);this.props.onDragStop(m,a,p,null,i,s);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:m,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(m,b)}),hr(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,Ze.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,Ze.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,i,s))}),hr(this,"onResize",(t,n,r,o)=>{let{e:i,node:s,size:a,handle:l}=o;const{oldResizeItem:c}=this.state,{layout:u}=this.state,{cols:d,preventCollision:p,allowOverlap:h}=this.props;let m=!1,b,v,x;const[w,_]=(0,Ze.withLayoutItem)(u,t,C=>{let E;return v=C.x,x=C.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(v=C.x+(C.w-n),n=C.x!==v&&v<0?C.w:n,v=v<0?0:v),["ne","n","nw"].indexOf(l)!==-1&&(x=C.y+(C.h-r),r=C.y!==x&&x<0?C.h:r,x=x<0?0:x),m=!0),p&&!h&&(E=(0,Ze.getAllCollisions)(u,{...C,w:n,h:r,x:v,y:x}).filter(M=>M.i!==C.i).length>0,E&&(x=C.y,r=C.h,v=C.x,n=C.w,m=!1)),C.w=n,C.h=r,C});if(!_)return;b=w,m&&(b=(0,Ze.moveElement)(w,_,v,x,!0,this.props.preventCollision,(0,Ze.compactType)(this.props),d,h));const R={w:_.w,h:_.h,x:_.x,y:_.y,static:!0,i:t};this.props.onResize(b,c,_,R,i,s),this.setState({layout:h?b:(0,Ze.compact)(b,(0,Ze.compactType)(this.props),d),activeDrag:R})}),hr(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,d=(0,Ze.getLayoutItem)(a,t),p=u?a:(0,Ze.compact)(a,(0,Ze.compactType)(this.props),c);this.props.onResizeStop(p,l,d,null,i,s);const{oldLayout:h}=this.state;this.setState({activeDrag:null,layout:p,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(p,h)}),hr(this,"onDragOver",t=>{var w;if(t.preventDefault(),t.stopPropagation(),B5&&!((w=t.nativeEvent.target)!=null&&w.classList.contains(qk)))return!1;const{droppingItem:n,onDropDragOver:r,margin:o,cols:i,rowHeight:s,maxRows:a,width:l,containerPadding:c,transformScale:u}=this.props,d=r==null?void 0:r(t);if(d===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const p={...n,...d},{layout:h}=this.state,m=t.currentTarget.getBoundingClientRect(),b=t.clientX-m.left,v=t.clientY-m.top,x={left:b/u,top:v/u,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:R}=this.state.droppingPosition;(_!=b||R!=v)&&this.setState({droppingPosition:x})}}else{const _={cols:i,margin:o,maxRows:a,rowHeight:s,containerWidth:l,containerPadding:c||o},R=(0,EJ.calcXY)(_,v,b,p.w,p.h);this.setState({droppingDOMNode:fl.createElement("div",{key:p.i}),droppingPosition:x,layout:[...h,{...p,x:R.x,y:R.y,static:!1,isDraggable:!0}]})}}),hr(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,Ze.compact)(r.filter(i=>i.i!==t.i),(0,Ze.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),hr(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),hr(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),hr(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(i=>i.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,Ax.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,Ze.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,Ze.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,Ze.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,Ze.fastRGLPropsEqual)(this.props,t,Ax.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,Ze.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,Ax.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:i,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:c}=this.props;return fl.createElement(Gk.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},fl.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,Ze.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:u,isResizable:d,isBounded:p,useCSSTransforms:h,transformScale:m,draggableCancel:b,draggableHandle:v,resizeHandles:x,resizeHandle:w}=this.props,{mounted:_,droppingPosition:R}=this.state,C=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,E=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&d,A=r.resizeHandles||x,M=C&&p&&r.isBounded!==!1;return fl.createElement(Gk.default,{containerWidth:o,cols:i,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:b,handle:v,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:C,isResizable:E,isBounded:M,useCSSTransforms:h&&_,usePercentages:!_,transformScale:m,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?R:void 0,resizeHandles:A,resizeHandle:w},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,CJ.default)(qk,t),s={height:this.containerHeight(),...n};return fl.createElement("div",{ref:o,className:i,style:s,onDrop:r?this.onDrop:Ze.noop,onDragLeave:r?this.onDragLeave:Ze.noop,onDragEnter:r?this.onDragEnter:Ze.noop,onDragOver:r?this.onDragOver:Ze.noop},fl.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}op.default=z0;hr(z0,"displayName","ReactGridLayout");hr(z0,"propTypes",RJ.default);hr(z0,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:Ze.noop,onDragStart:Ze.noop,onDrag:Ze.noop,onDragStop:Ze.noop,onResizeStart:Ze.noop,onResize:Ze.noop,onResizeStop:Ze.noop,onDrop:Ze.noop,onDropDragOver:Ze.noop});var B0={},Tc={};Object.defineProperty(Tc,"__esModule",{value:!0});Tc.findOrGenerateResponsiveLayout=MJ;Tc.getBreakpointFromWidth=AJ;Tc.getColsFromBreakpoint=OJ;Tc.sortBreakpoints=IC;var zg=vt;function AJ(e,t){const n=IC(e);let r=n[0];for(let o=1,i=n.length;o<i;o++){const s=n[o];t>e[s]&&(r=s)}return r}function OJ(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function MJ(e,t,n,r,o,i){if(e[n])return(0,zg.cloneLayout)(e[n]);let s=e[r];const a=IC(t),l=a.slice(a.indexOf(n));for(let c=0,u=l.length;c<u;c++){const d=l[c];if(e[d]){s=e[d];break}}return s=(0,zg.cloneLayout)(s||[]),(0,zg.compact)((0,zg.correctBounds)(s,{cols:o}),i,o)}function IC(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(B0,"__esModule",{value:!0});B0.default=void 0;var Yk=DJ(T),qr=H5(qa),Ox=hC,Cu=vt,hl=Tc,IJ=H5(op);function H5(e){return e&&e.__esModule?e:{default:e}}function V5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(V5=function(r){return r?n:t})(e)}function DJ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=V5(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function G1(){return G1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},G1.apply(this,arguments)}function mb(e,t,n){return t=NJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NJ(e){var t=LJ(e,"string");return typeof t=="symbol"?t:String(t)}function LJ(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Kk=e=>Object.prototype.toString.call(e);function Bg(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class DC extends Yk.Component{constructor(){super(...arguments),mb(this,"state",this.generateInitialState()),mb(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,i=(0,hl.getBreakpointFromWidth)(n,t),s=(0,hl.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,hl.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,Ox.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,hl.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,o,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,Ox.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,Ox.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:o,compactType:i}=this.props,s=this.props.breakpoint||(0,hl.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,hl.getColsFromBreakpoint)(s,r),c={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,Cu.cloneLayout)(this.state.layout));let p=(0,hl.findOrGenerateResponsiveLayout)(c,n,s,a,l,i);p=(0,Cu.synchronizeLayoutWithChildren)(p,this.props.children,l,i,this.props.allowOverlap),c[s]=p,this.props.onBreakpointChange(s,l),this.props.onLayoutChange(p,c),this.setState({breakpoint:s,layout:p,cols:l})}const u=Bg(this.props.margin,s),d=Bg(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,u,l,d)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...u}=this.props;return Yk.createElement(IJ.default,G1({},u,{margin:Bg(i,this.state.breakpoint),containerPadding:Bg(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}B0.default=DC;mb(DC,"propTypes",{breakpoint:qr.default.string,breakpoints:qr.default.object,allowOverlap:qr.default.bool,cols:qr.default.object,margin:qr.default.oneOfType([qr.default.array,qr.default.object]),containerPadding:qr.default.oneOfType([qr.default.array,qr.default.object]),layouts(e,t){if(Kk(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+Kk(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,Cu.validateLayout)(e.layouts[n],"layouts."+n)})},width:qr.default.number.isRequired,onBreakpointChange:qr.default.func,onLayoutChange:qr.default.func,onWidthChange:qr.default.func});mb(DC,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:Cu.noop,onLayoutChange:Cu.noop,onWidthChange:Cu.noop});var NC={},W5=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o<i.length;o++){var s=i[o];n.call(r,s[1],s[0])}},t}()}(),q1=typeof window<"u"&&typeof document<"u"&&window.document===document,bb=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),FJ=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(bb):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),jJ=2;function $J(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){FJ(i)}function a(){var l=Date.now();if(n){if(l-o<jJ)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var zJ=20,BJ=["top","right","bottom","left","width","height","size","weight"],HJ=typeof MutationObserver<"u",VJ=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=$J(this.refresh.bind(this),zJ)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!q1||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),HJ?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!q1||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=BJ.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),U5=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},Zu=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||bb},G5=H0(0,0,0,0);function yb(e){return parseFloat(e)||0}function Xk(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+yb(i)},0)}function WJ(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],s=e["padding-"+i];n[i]=yb(s)}return n}function UJ(e){var t=e.getBBox();return H0(0,0,t.width,t.height)}function GJ(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return G5;var r=Zu(e).getComputedStyle(e),o=WJ(r),i=o.left+o.right,s=o.top+o.bottom,a=yb(r.width),l=yb(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=Xk(r,"left","right")+i),Math.round(l+s)!==n&&(l-=Xk(r,"top","bottom")+s)),!YJ(e)){var c=Math.round(a+i)-t,u=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return H0(o.left,o.top,a,l)}var qJ=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Zu(e).SVGGraphicsElement}:function(e){return e instanceof Zu(e).SVGElement&&typeof e.getBBox=="function"}}();function YJ(e){return e===Zu(e).document.documentElement}function KJ(e){return q1?qJ(e)?UJ(e):GJ(e):G5}function XJ(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(i.prototype);return U5(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function H0(e,t,n,r){return{x:e,y:t,width:n,height:r}}var QJ=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=H0(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=KJ(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),ZJ=function(){function e(t,n){var r=XJ(n);U5(this,{target:t,contentRect:r})}return e}(),JJ=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new W5,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Zu(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new QJ(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Zu(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new ZJ(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),q5=typeof WeakMap<"u"?new WeakMap:new W5,Y5=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=VJ.getInstance(),r=new JJ(t,n,this);q5.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Y5.prototype[e]=function(){var t;return(t=q5.get(this))[e].apply(t,arguments)}});var eee=function(){return typeof bb.ResizeObserver<"u"?bb.ResizeObserver:Y5}();const tee=Object.freeze(Object.defineProperty({__proto__:null,default:eee},Symbol.toStringTag,{value:"Module"})),nee=H_(tee);Object.defineProperty(NC,"__esModule",{value:!0});NC.default=uee;var Hg=see(T),ree=LC(qa),oee=LC(nee),iee=LC(pC);function LC(e){return e&&e.__esModule?e:{default:e}}function K5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(K5=function(r){return r?n:t})(e)}function see(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=K5(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Y1(){return Y1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y1.apply(this,arguments)}function Jc(e,t,n){return t=aee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aee(e){var t=lee(e,"string");return typeof t=="symbol"?t:String(t)}function lee(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const cee="react-grid-layout";function uee(e){var t;return t=class extends Hg.Component{constructor(){super(...arguments),Jc(this,"state",{width:1280}),Jc(this,"elementRef",Hg.createRef()),Jc(this,"mounted",!1),Jc(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new oee.default(o=>{if(this.elementRef.current instanceof HTMLElement){const s=o[0].contentRect.width;this.setState({width:s})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...o}=this.props;return r&&!this.mounted?Hg.createElement("div",{className:(0,iee.default)(this.props.className,cee),style:this.props.style,ref:this.elementRef}):Hg.createElement(e,Y1({innerRef:this.elementRef},o,this.state))}},Jc(t,"defaultProps",{measureBeforeMount:!1}),Jc(t,"propTypes",{measureBeforeMount:ree.default.bool}),t}(function(e){e.exports=op.default,e.exports.utils=vt,e.exports.calculateUtils=as,e.exports.Responsive=B0.default,e.exports.Responsive.utils=Tc,e.exports.WidthProvider=NC.default})(c5);var Qk=c5.exports;function Ya(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var dee=["color"],fee=T.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ya(e,dee);return T.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),T.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),hee=["color"],FC=T.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ya(e,hee);return T.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),T.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),pee=["color"],X5=T.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ya(e,pee);return T.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),T.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),gee=["color"],mee=T.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ya(e,gee);return T.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),T.createElement("path",{d:"M14.7649 6.07596C14.9991 6.22231 15.0703 6.53079 14.9239 6.76495C14.4849 7.46743 13.9632 8.10645 13.3702 8.66305L14.5712 9.86406C14.7664 10.0593 14.7664 10.3759 14.5712 10.5712C14.3759 10.7664 14.0593 10.7664 13.8641 10.5712L12.6011 9.30817C11.805 9.90283 10.9089 10.3621 9.93375 10.651L10.383 12.3277C10.4544 12.5944 10.2961 12.8685 10.0294 12.94C9.76267 13.0115 9.4885 12.8532 9.41704 12.5865L8.95917 10.8775C8.48743 10.958 8.00036 10.9999 7.50001 10.9999C6.99965 10.9999 6.51257 10.958 6.04082 10.8775L5.58299 12.5864C5.51153 12.8532 5.23737 13.0115 4.97064 12.94C4.7039 12.8686 4.5456 12.5944 4.61706 12.3277L5.06625 10.651C4.09111 10.3621 3.19503 9.90282 2.3989 9.30815L1.1359 10.5712C0.940638 10.7664 0.624058 10.7664 0.428798 10.5712C0.233537 10.3759 0.233537 10.0593 0.428798 9.86405L1.62982 8.66303C1.03682 8.10643 0.515113 7.46742 0.0760677 6.76495C-0.0702867 6.53079 0.000898544 6.22231 0.235065 6.07596C0.469231 5.9296 0.777703 6.00079 0.924058 6.23496C1.40354 7.00213 1.989 7.68057 2.66233 8.2427C2.67315 8.25096 2.6837 8.25972 2.69397 8.26898C4.00897 9.35527 5.65537 9.99991 7.50001 9.99991C10.3078 9.99991 12.6564 8.5063 14.076 6.23495C14.2223 6.00079 14.5308 5.9296 14.7649 6.07596Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),bee=["color"],yee=T.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ya(e,bee);return T.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),T.createElement("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),vee=["color"],xee=T.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ya(e,vee);return T.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),T.createElement("path",{d:"M10.3004 7.49991C10.3004 8.4943 9.49426 9.30041 8.49988 9.30041C7.50549 9.30041 6.69938 8.4943 6.69938 7.49991C6.69938 6.50553 7.50549 5.69942 8.49988 5.69942C9.49426 5.69942 10.3004 6.50553 10.3004 7.49991ZM11.205 8C10.9699 9.28029 9.84816 10.2504 8.49988 10.2504C7.1516 10.2504 6.0299 9.28029 5.79473 8H0.5C0.223858 8 0 7.77614 0 7.5C0 7.22386 0.223858 7 0.5 7H5.7947C6.0298 5.71962 7.15154 4.74942 8.49988 4.74942C9.84822 4.74942 10.97 5.71962 11.2051 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H11.205Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),wee=["color"],Q5=T.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ya(e,wee);return T.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),T.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),See=["color"],Z5=T.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ya(e,See);return T.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),T.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});let Vg;const _ee=new Uint8Array(16);function Cee(){if(!Vg&&(Vg=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Vg))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Vg(_ee)}const nr=[];for(let e=0;e<256;++e)nr.push((e+256).toString(16).slice(1));function Eee(e,t=0){return nr[e[t+0]]+nr[e[t+1]]+nr[e[t+2]]+nr[e[t+3]]+"-"+nr[e[t+4]]+nr[e[t+5]]+"-"+nr[e[t+6]]+nr[e[t+7]]+"-"+nr[e[t+8]]+nr[e[t+9]]+"-"+nr[e[t+10]]+nr[e[t+11]]+nr[e[t+12]]+nr[e[t+13]]+nr[e[t+14]]+nr[e[t+15]]}const Ree=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Zk={randomUUID:Ree};function Na(e,t,n){if(Zk.randomUUID&&!e)return Zk.randomUUID();e=e||{};const r=e.random||(e.rng||Cee)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Eee(r)}const to=dN()(yN((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,queryResultColumns:[],showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:Na(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:Na(),cards:[],activeCardId:""},actions:{updateCardTab:(n,r)=>{e(o=>{const i=o.frame,s={...i,cards:i.cards.map(l=>l.id===r.id?r:l),activeCardId:n};o.frame=s;const a=s.cards.find(l=>l.id===n);o.card=a})},setActiveTabCardId:n=>{e(r=>{r.activeTabCardId=n})},setCustomCardPreferences:n=>{e(r=>{r.card.customCardPreferences=n})},setChartOrientation:n=>{e(r=>{var s,a,l,c,u,d;const o=r.card.preferences;let i={};((s=o==null?void 0:o.chartOptions)==null?void 0:s.indexAxis)!==n&&(i={x:(l=(a=o==null?void 0:o.chartOptions)==null?void 0:a.scales)==null?void 0:l.y,y:(u=(c=o==null?void 0:o.chartOptions)==null?void 0:c.scales)==null?void 0:u.x}),r.card.preferences={...o,chartOptions:{...o==null?void 0:o.chartOptions,scales:{...(d=o==null?void 0:o.chartOptions)==null?void 0:d.scales,...i},indexAxis:n}}})},setSortChart:n=>{e(r=>{r.card.preferences={...r.card.preferences,sortChart:n}})},setCustomVisualCode:n=>{e(r=>{r.card.preferences={...r.card.preferences,customVisualCode:n}})},setNumberFormat:(n,r,o,i)=>{e(s=>{var a,l,c;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{...(c=(l=s.card)==null?void 0:l.preferences)==null?void 0:c.formatNumber,decimalPlaces:n,currency:r,locale:o,suffix:i,enabled:!0}}})},setColorRanges:n=>{e(r=>{var o,i;r.card.preferences={...r.card.preferences,formatNumber:{...(i=(o=r.card)==null?void 0:o.preferences)==null?void 0:i.formatNumber,colorRanges:n}}})},setQueryResultColumns:n=>{e(r=>{r.queryResultColumns=n})},setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickColumnIndex:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClickColumnIndex:n}})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},updateCardInFrame:n=>{e(r=>{r.frame.cards=r.frame.cards.map(o=>o.id===n.id?n:o)})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},switchCardType:n=>{e(r=>{r.card.type=n,r.card.sql="",r.card.python="",r.card.cfg={},r.card.customCfg={},r.card.preferences={}})},setCardType:n=>{e(r=>{var o;r.card.type=n,n==="range"&&(r.card.preferences={...r.card.preferences,chartOptions:{...(o=r.card.preferences)==null?void 0:o.chartOptions,indexAxis:"y"}})})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardPython:n=>{e(r=>{r.card.python=n})},setPythonStdOut:n=>{e(r=>{r.pythonStdOut=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setCardCfg:n=>{e(r=>{r.card.cfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(o=>{o.sqlGen.measures=[...o.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setSelectedDatamodelId:n=>{var r,o;e(i=>{i.selectedDatamodelId=n,i.card.datamodelId=n}),(o=(r=t()).onDatamodelChange)==null||o.call(r,n)},setSelectedConnectionId:n=>{var r,o;e(i=>{i.selectedConnectionId=n,i.card.connectionId=n}),(o=(r=t()).onConnectionChange)==null||o.call(r,n)},setSelectedDatabaseName:n=>{var r,o;e(i=>{i.selectedDatabaseName=n,i.card.lastSelectedDatabase=n}),(o=(r=t()).onDatabaseChange)==null||o.call(r,n)},setSelectedSchemaName:n=>{var r,o;e(i=>{i.selectedSchemaName=n,i.card.lastSelectedSchema=n}),(o=(r=t()).onSchemaChange)==null||o.call(r,n)},setSelectedTableName:n=>{var r,o;e(i=>{i.selectedTableName=n,i.card.lastSelectedTable=n}),(o=(r=t()).onTableChange)==null||o.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}}))),ap=()=>to(e=>e.actions);function Pee(e){return/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(e)}function Tee(e,t=1){if(!Pee(e)||t===1)return e;e=e.replace(/^#/,"");const n=parseInt(e.substring(0,2),16),r=parseInt(e.substring(2,4),16),o=parseInt(e.substring(4,6),16);return t=Math.min(Math.max(t,0),1),`rgba(${n}, ${r}, ${o}, ${t})`}function kee(e,t,n,r=1){var c,u,d,p;const o=n==null?void 0:n.datasetOptions,i=be.getState().themeStyle,s=(u=(c=i==null?void 0:i.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,a=(p=(d=i==null?void 0:i.chart)==null?void 0:d.dataset)==null?void 0:p.borderColor;return e.map((h,m)=>{var R;const b=o==null?void 0:o.find(C=>C.idx===m),v=Tee(s==null?void 0:s[m%s.length],r),x=a==null?void 0:a[m%a.length],w=a==null?void 0:a[m%a.length];return{label:h.charAt(0).toUpperCase()+h.slice(1),data:t.map(C=>C[h]),...b,datalabels:{...b==null?void 0:b.datalabels,color:Aee((R=b==null?void 0:b.datalabels)==null?void 0:R.align,v)},backgroundColor:v,pointBackgroundColor:x,borderColor:w}})}function Aee(e,t){return Qu(e==="end"||e==="start"?bh():t)}function Oee(e){var a,l,c,u;const{metricKeys:t,dimensionKeys:n}=Yn(e);let r=[];const o=be.getState().themeStyle,i=(l=(a=o==null?void 0:o.chart)==null?void 0:a.dataset)==null?void 0:l.backgroundColor,s=(u=(c=o==null?void 0:o.chart)==null?void 0:c.dataset)==null?void 0:u.borderColor;if((n==null?void 0:n.length)===1){const d=e.map(p=>({x:p[t[0]],y:p[t[1]],r:p[t[2]],label:p[n==null?void 0:n[0]]}));r=[{label:n==null?void 0:n[0],data:d}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(p=>p[n==null?void 0:n[1]]))].map((p,h)=>{const m=e.filter(b=>b[n==null?void 0:n[1]]===p);return{label:p,data:m.map(b=>({x:b[t[0]],y:b[t[1]],r:b[t[2]],label:b[n==null?void 0:n[0]]})),backgroundColor:i==null?void 0:i[h%i.length],borderColor:s==null?void 0:s[h%s.length]}})),r}function Mee(e){var c,u,d,p;const{dimensionKeys:t,metricKeys:n}=Yn(e),r=be.getState().themeStyle,o=(u=(c=r==null?void 0:r.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,i=(p=(d=r==null?void 0:r.chart)==null?void 0:d.dataset)==null?void 0:p.borderColor,s=t==null?void 0:t[1];return[...new Set(e.map(h=>h==null?void 0:h[s]))].map((h,m)=>({label:h,data:e.filter(b=>(b==null?void 0:b[s])===h).map(b=>[b==null?void 0:b[n[0]],b==null?void 0:b[n[1]],b==null?void 0:b[n[2]]]),backgroundColor:o==null?void 0:o[m%o.length],borderColor:i==null?void 0:i[m%i.length],borderSkipped:!1}))}function Iee(e,t){var s,a,l,c;const n=be.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,o=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map(u=>({label:u.charAt(0).toUpperCase()+u.slice(1),data:t.map(d=>d[u]),backgroundColor:t.map((d,p)=>(d==null?void 0:d._color)||(r==null?void 0:r[p%r.length])),borderColor:t.map((d,p)=>(d==null?void 0:d._color)||(o==null?void 0:o[p%o.length]))}))}function Dee(e){let t=-1,n=0;return e.forEach((r,o)=>{const i=Object.keys(r).length;i>n&&(t=o,n=i)}),t}function Yn(e){if(!e||e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=Dee(e),n=Object.keys(e[t]),r=n.filter(i=>{var s,a,l,c,u,d,p,h;return!!(typeof((s=e==null?void 0:e[t])==null?void 0:s[i])&&typeof((a=e==null?void 0:e[t])==null?void 0:a[i])=="string"||typeof((l=e==null?void 0:e[0])==null?void 0:l[i])&&typeof((c=e==null?void 0:e[0])==null?void 0:c[i])=="string"||typeof((u=e==null?void 0:e[1])==null?void 0:u[i])&&typeof((d=e==null?void 0:e[1])==null?void 0:d[i])=="string"||typeof((p=e==null?void 0:e[2])==null?void 0:p[i])&&typeof((h=e==null?void 0:e[2])==null?void 0:h[i])=="string")});r.length===0&&r.push(n[0]);const o=n.filter(i=>{var s,a;return((s=e==null?void 0:e[t])==null?void 0:s[i])===+((a=e==null?void 0:e[t])==null?void 0:a[i])});return{keys:n,dimensionKeys:r,metricKeys:o}}function If(e,t){var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.datasets;return n&&n.length>0?e.map((i,s)=>({...i,...n==null?void 0:n[s],data:i.data,label:i.label})):e}function Nee(e,t="asc"){function n(r){return Object.entries(r).slice(1).reduce((s,[a,l])=>{const c=typeof l=="number"?l:parseFloat(l);return s+(isNaN(c)?0:c)},0)}return e.sort((r,o)=>{const i=n(r),s=n(o);return t==="asc"?i-s:s-i})}function vb({dataArray:e,groupKey:t,pivotKey:n,valueKey:r,sortChart:o}){const i=e.reduce((l,c)=>{const u=c[t],d=c[n],p=c[r];return l[u]||(l[u]={[t]:u}),l[u][d]=p,l},{});let s=Object.values(i);return o!=="none"&&o!==void 0&&(s=Nee(s,o)),s.map(l=>Object.fromEntries(Object.entries(l).filter(([c,u])=>u!==0)))}function Jr(e,t){var s;const n=be.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,o=ql.cloneDeep(r);return ql.merge(o,e,t)}function K1(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}/**
|
|
84
|
+
* @license lucide-react v0.453.0 - ISC
|
|
85
|
+
*
|
|
86
|
+
* This source code is licensed under the ISC license.
|
|
87
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
+
*/const Lee=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),J5=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
|
|
89
|
+
* @license lucide-react v0.453.0 - ISC
|
|
90
|
+
*
|
|
91
|
+
* This source code is licensed under the ISC license.
|
|
92
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
+
*/var Fee={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"};/**
|
|
94
|
+
* @license lucide-react v0.453.0 - ISC
|
|
95
|
+
*
|
|
96
|
+
* This source code is licensed under the ISC license.
|
|
97
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
+
*/const eL=T.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>T.createElement("svg",{ref:l,...Fee,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:J5("lucide",o),...a},[...s.map(([c,u])=>T.createElement(c,u)),...Array.isArray(i)?i:[i]]));/**
|
|
99
|
+
* @license lucide-react v0.453.0 - ISC
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the ISC license.
|
|
102
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/const Mt=(e,t)=>{const n=T.forwardRef(({className:r,...o},i)=>T.createElement(eL,{ref:i,iconNode:t,className:J5(`lucide-${Lee(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
|
|
104
|
+
* @license lucide-react v0.453.0 - ISC
|
|
105
|
+
*
|
|
106
|
+
* This source code is licensed under the ISC license.
|
|
107
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
+
*/const tL=Mt("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
109
|
+
* @license lucide-react v0.453.0 - ISC
|
|
110
|
+
*
|
|
111
|
+
* This source code is licensed under the ISC license.
|
|
112
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
+
*/const _d=Mt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
114
|
+
* @license lucide-react v0.453.0 - ISC
|
|
115
|
+
*
|
|
116
|
+
* This source code is licensed under the ISC license.
|
|
117
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
+
*/const lp=Mt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
119
|
+
* @license lucide-react v0.453.0 - ISC
|
|
120
|
+
*
|
|
121
|
+
* This source code is licensed under the ISC license.
|
|
122
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
+
*/const jC=Mt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
124
|
+
* @license lucide-react v0.453.0 - ISC
|
|
125
|
+
*
|
|
126
|
+
* This source code is licensed under the ISC license.
|
|
127
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
+
*/const V0=Mt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
129
|
+
* @license lucide-react v0.453.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/const nL=Mt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
134
|
+
* @license lucide-react v0.453.0 - ISC
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the ISC license.
|
|
137
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/const $C=Mt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
139
|
+
* @license lucide-react v0.453.0 - ISC
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the ISC license.
|
|
142
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
+
*/const zC=Mt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
144
|
+
* @license lucide-react v0.453.0 - ISC
|
|
145
|
+
*
|
|
146
|
+
* This source code is licensed under the ISC license.
|
|
147
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
+
*/const rL=Mt("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
149
|
+
* @license lucide-react v0.453.0 - ISC
|
|
150
|
+
*
|
|
151
|
+
* This source code is licensed under the ISC license.
|
|
152
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
+
*/const oL=Mt("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
154
|
+
* @license lucide-react v0.453.0 - ISC
|
|
155
|
+
*
|
|
156
|
+
* This source code is licensed under the ISC license.
|
|
157
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
+
*/const iL=Mt("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
159
|
+
* @license lucide-react v0.453.0 - ISC
|
|
160
|
+
*
|
|
161
|
+
* This source code is licensed under the ISC license.
|
|
162
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
+
*/const BC=Mt("FilterX",[["path",{d:"M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055",key:"1fi1da"}],["path",{d:"m22 3-5 5",key:"12jva0"}],["path",{d:"m17 3 5 5",key:"k36vhe"}]]);/**
|
|
164
|
+
* @license lucide-react v0.453.0 - ISC
|
|
165
|
+
*
|
|
166
|
+
* This source code is licensed under the ISC license.
|
|
167
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
+
*/const sL=Mt("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
169
|
+
* @license lucide-react v0.453.0 - ISC
|
|
170
|
+
*
|
|
171
|
+
* This source code is licensed under the ISC license.
|
|
172
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
+
*/const aL=Mt("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
174
|
+
* @license lucide-react v0.453.0 - ISC
|
|
175
|
+
*
|
|
176
|
+
* This source code is licensed under the ISC license.
|
|
177
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
+
*/const lL=Mt("IdCard",[["path",{d:"M16 10h2",key:"8sgtl7"}],["path",{d:"M16 14h2",key:"epxaof"}],["path",{d:"M6.17 15a3 3 0 0 1 5.66 0",key:"n6f512"}],["circle",{cx:"9",cy:"11",r:"2",key:"yxgjnd"}],["rect",{x:"2",y:"5",width:"20",height:"14",rx:"2",key:"qneu4z"}]]);/**
|
|
179
|
+
* @license lucide-react v0.453.0 - ISC
|
|
180
|
+
*
|
|
181
|
+
* This source code is licensed under the ISC license.
|
|
182
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
+
*/const cL=Mt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
184
|
+
* @license lucide-react v0.453.0 - ISC
|
|
185
|
+
*
|
|
186
|
+
* This source code is licensed under the ISC license.
|
|
187
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
+
*/const uL=Mt("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
|
|
189
|
+
* @license lucide-react v0.453.0 - ISC
|
|
190
|
+
*
|
|
191
|
+
* This source code is licensed under the ISC license.
|
|
192
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
+
*/const dL=Mt("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
|
|
194
|
+
* @license lucide-react v0.453.0 - ISC
|
|
195
|
+
*
|
|
196
|
+
* This source code is licensed under the ISC license.
|
|
197
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
+
*/const fL=Mt("Octagon",[["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}]]);/**
|
|
199
|
+
* @license lucide-react v0.453.0 - ISC
|
|
200
|
+
*
|
|
201
|
+
* This source code is licensed under the ISC license.
|
|
202
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
+
*/const hL=Mt("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
204
|
+
* @license lucide-react v0.453.0 - ISC
|
|
205
|
+
*
|
|
206
|
+
* This source code is licensed under the ISC license.
|
|
207
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
+
*/const pL=Mt("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/**
|
|
209
|
+
* @license lucide-react v0.453.0 - ISC
|
|
210
|
+
*
|
|
211
|
+
* This source code is licensed under the ISC license.
|
|
212
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
+
*/const gL=Mt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
214
|
+
* @license lucide-react v0.453.0 - ISC
|
|
215
|
+
*
|
|
216
|
+
* This source code is licensed under the ISC license.
|
|
217
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
+
*/const W0=Mt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
219
|
+
* @license lucide-react v0.453.0 - ISC
|
|
220
|
+
*
|
|
221
|
+
* This source code is licensed under the ISC license.
|
|
222
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
+
*/const mL=Mt("SearchX",[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
224
|
+
* @license lucide-react v0.453.0 - ISC
|
|
225
|
+
*
|
|
226
|
+
* This source code is licensed under the ISC license.
|
|
227
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
+
*/const bL=Mt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
229
|
+
* @license lucide-react v0.453.0 - ISC
|
|
230
|
+
*
|
|
231
|
+
* This source code is licensed under the ISC license.
|
|
232
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
+
*/const yL=Mt("SendHorizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);/**
|
|
234
|
+
* @license lucide-react v0.453.0 - ISC
|
|
235
|
+
*
|
|
236
|
+
* This source code is licensed under the ISC license.
|
|
237
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
238
|
+
*/const vL=Mt("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
239
|
+
* @license lucide-react v0.453.0 - ISC
|
|
240
|
+
*
|
|
241
|
+
* This source code is licensed under the ISC license.
|
|
242
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
243
|
+
*/const xL=Mt("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
|
|
244
|
+
* @license lucide-react v0.453.0 - ISC
|
|
245
|
+
*
|
|
246
|
+
* This source code is licensed under the ISC license.
|
|
247
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
248
|
+
*/const wL=Mt("Table2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]);/**
|
|
249
|
+
* @license lucide-react v0.453.0 - ISC
|
|
250
|
+
*
|
|
251
|
+
* This source code is licensed under the ISC license.
|
|
252
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
253
|
+
*/const SL=Mt("TreePalm",[["path",{d:"M13 8c0-2.76-2.46-5-5.5-5S2 5.24 2 8h2l1-1 1 1h4",key:"foxbe7"}],["path",{d:"M13 7.14A5.82 5.82 0 0 1 16.5 6c3.04 0 5.5 2.24 5.5 5h-3l-1-1-1 1h-3",key:"18arnh"}],["path",{d:"M5.89 9.71c-2.15 2.15-2.3 5.47-.35 7.43l4.24-4.25.7-.7.71-.71 2.12-2.12c-1.95-1.96-5.27-1.8-7.42.35",key:"ywahnh"}],["path",{d:"M11 15.5c.5 2.5-.17 4.5-1 6.5h4c2-5.5-.5-12-1-14",key:"ft0feo"}]]);/**
|
|
254
|
+
* @license lucide-react v0.453.0 - ISC
|
|
255
|
+
*
|
|
256
|
+
* This source code is licensed under the ISC license.
|
|
257
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
258
|
+
*/const _L=Mt("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
|
|
259
|
+
* @license lucide-react v0.453.0 - ISC
|
|
260
|
+
*
|
|
261
|
+
* This source code is licensed under the ISC license.
|
|
262
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
263
|
+
*/const CL=Mt("UserSearch",[["circle",{cx:"10",cy:"7",r:"4",key:"e45bow"}],["path",{d:"M10.3 15H7a4 4 0 0 0-4 4v2",key:"3bnktk"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}]]);/**
|
|
264
|
+
* @license lucide-react v0.453.0 - ISC
|
|
265
|
+
*
|
|
266
|
+
* This source code is licensed under the ISC license.
|
|
267
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
268
|
+
*/const kc=Mt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),jee=({data:e,filename:t="output.csv"})=>{const n=()=>{if(e.length===0)return;const r=[],o=Object.keys(e[0]);r.push(o.join(","));for(const c of e){const u=o.map(d=>`"${(""+c[d]).replace(/"/g,'""')}"`);r.push(u.join(","))}const i=r.join(`
|
|
269
|
+
`),s=new Blob([i],{type:"text/csv"}),a=window.URL.createObjectURL(s),l=document.createElement("a");l.setAttribute("hidden",""),l.setAttribute("href",a),l.setAttribute("download",t),document.body.appendChild(l),l.click(),document.body.removeChild(l)};return y.jsx(rL,{onClick:n,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})};var Ju=1e3,ed=Ju*60,td=ed*60,fc=td*24,$ee=fc*7,zee=fc*365.25,Bee=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Hee(e);if(n==="number"&&isFinite(e))return t.long?Wee(e):Vee(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Hee(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*zee;case"weeks":case"week":case"w":return n*$ee;case"days":case"day":case"d":return n*fc;case"hours":case"hour":case"hrs":case"hr":case"h":return n*td;case"minutes":case"minute":case"mins":case"min":case"m":return n*ed;case"seconds":case"second":case"secs":case"sec":case"s":return n*Ju;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Vee(e){var t=Math.abs(e);return t>=fc?Math.round(e/fc)+"d":t>=td?Math.round(e/td)+"h":t>=ed?Math.round(e/ed)+"m":t>=Ju?Math.round(e/Ju)+"s":e+"ms"}function Wee(e){var t=Math.abs(e);return t>=fc?Wg(e,t,fc,"day"):t>=td?Wg(e,t,td,"hour"):t>=ed?Wg(e,t,ed,"minute"):t>=Ju?Wg(e,t,Ju,"second"):e+" ms"}function Wg(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const Uee=Ga(Bee);function Gee(e){const t=be(u=>u.selectedSheetId),n=be(u=>u.selectedLensId);be(u=>u.dashboard.baseQueries);const r=be(u=>u.dashboard.filters),o=be(u=>u.filterValues),i=r==null?void 0:r.filter(u=>u.sheetId===t||!u.sheetId),s=o==null?void 0:o.filter(u=>(i==null?void 0:i.some(d=>d.id===u.filterId))||u.filterId.endsWith(t)),a=(e==null?void 0:e.sql)||"",l=qee((e==null?void 0:e.python)||"");return{queryKey:["query",e==null?void 0:e.id,e==null?void 0:e.title,a,l,n||"",JSON.stringify(s)],sql:a,sheetFilterValues:s}}function qee(e){return e===q_?"":e}function La(e,t){const{authToken:n}=Do(),r=be(p=>p.isVisualEditing),o=be(p=>p.authToken),i=Uee((e==null?void 0:e.refreshInterval)||"0"),{queryKey:s,sql:a,sheetFilterValues:l}=Gee(e);let c={};return r||(c={refetchInterval:i}),{...rp({queryKey:s,queryFn:async()=>{var p;if(!(e!=null&&e.connectionId)||!((p=e==null?void 0:e.sql)!=null&&p.trim()))return null;try{return await _0("https://semaphor.cloud/api/v1/query",(n==null?void 0:n.accessToken)||(o==null?void 0:o.accessToken)||"",{connection_id:e.connectionId,sql:a,python:e.python===q_?"":e.python,active_filters:l,cache_config:J_({card:e})})}catch(h){if(r)return{records:[],error:h};throw h}},placeholderData:xX,...c,enabled:!!(e!=null&&e.connectionId)&&!!(e!=null&&e.sql)&&!0&&!r}),queryKey:s}}function EL({frame:e}){var C;const t=be(E=>E.isDashboardEditing),n=be(E=>E.filterValues),r=be(E=>E.isVisualEditing),o=be(E=>E.selectedSheetId);be(E=>E.currentBreakpoint);const{removeFrame:i}=be(E=>E.actions),s=be(E=>E.actions.setIsVisualEditing),a=to(E=>E.actions.setFilterValues),l=to(E=>E.actions.setApplyFilters),{setCard:c,setFrame:u,setQueryResultColumns:d,setActiveTabCardId:p}=ap(),h=to(E=>E.actions.setSelectedConnectionId),m=to(E=>E.actions.setSelectedDatamodelId),b=to(E=>E.actions.setSelectedDatabaseName),v=to(E=>E.actions.setSelectedSchemaName),x=to(E=>E.actions.setSelectedTableName),w=e.cards.find(E=>E.id===e.activeCardId),{data:_}=La(w);function R(){s(!r),c(w),p(e.activeCardId);const{dimensionKeys:E}=Yn((_==null?void 0:_.records)||[]);d(E),u(e),w!=null&&w.connectionId&&h(w==null?void 0:w.connectionId),w!=null&&w.datamodelId&&w.datamodelId!=="none"&&(m(w==null?void 0:w.datamodelId),b("")),w!=null&&w.lastSelectedDatabase&&w.lastSelectedDatabase!=="none"&&(b(w==null?void 0:w.lastSelectedDatabase),m("")),w!=null&&w.lastSelectedSchema&&v(w==null?void 0:w.lastSelectedSchema),w!=null&&w.lastSelectedTable&&x(w==null?void 0:w.lastSelectedTable),n&&(a(n),l(!0))}return y.jsx("section",{onMouseDown:E=>{E.stopPropagation()},className:"absolute right-2 top-2 z-50",children:y.jsxs("div",{className:"flex items-center gap-2",children:[t&&(r?y.jsx("button",{onClick:()=>{s(!r)},children:y.jsx(mee,{className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})}):y.jsx("button",{role:"edit-visual",onClick:R,children:y.jsx(yee,{className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})})),t&&y.jsx("button",{onClick:()=>i(o,e.id),children:y.jsx(X5,{className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})}),((C=w.preferences)==null?void 0:C.allowDownload)===!0&&y.jsx(jee,{data:(_==null?void 0:_.records)||[],filename:w.title})]})})}function Yee(e,t){be(c=>c.selectedSheetId);const n=be(c=>c.selectedFrameId),r=be(c=>c.isDashboardEditing),o=be(c=>c.isVisualEditing),{addFrame:i,getSelectedFrame:s,setSelectedFrameId:a}=be(c=>c.actions);T.useEffect(()=>{n===e.id&&r&&!o&&l()},[n,e.id,r,o]);function l(){const c=t==null?void 0:t.current;c==null||c.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}const Kee=T.createContext(null),Mx={didCatch:!1,error:null};class U0 extends T.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Mx}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:i,reason:"imperative-api"}),this.setState(Mx)}}componentDidCatch(t,n){var r,o;(r=(o=this.props).onError)===null||r===void 0||r.call(o,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;if(r&&n.error!==null&&Xee(t.resetKeys,o)){var i,s;(i=(s=this.props).onReset)===null||i===void 0||i.call(s,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(Mx)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:s}=this.state;let a=t;if(i){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(l);else if(r)a=T.createElement(r,l);else if(o!==void 0)a=o;else throw s}return T.createElement(Kee.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function Xee(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function HC({error:e}){return y.jsx("div",{className:"flex flex-col items-center justify-center",role:"alert",style:{height:"100%",width:"100%"},children:y.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md bg-muted p-10",children:[y.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),y.jsx("p",{className:"text-sm",children:"Something went wrong:"}),y.jsx("pre",{className:"text-xs",children:e.message})]})})}function Qee({error:e,frame:t}){return y.jsxs("div",{className:"flex h-full flex-col items-center justify-center border",role:"alert",children:[y.jsx(EL,{frame:t}),y.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),y.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[y.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),y.jsx("p",{className:"text-sm",children:"Something went wrong:"}),y.jsx("pre",{className:"text-xs",children:e.message})]})]})}function Zee({error:e}){return y.jsxs("div",{className:"flex h-full flex-col items-center justify-center",role:"alert",children:[y.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),y.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[y.jsx("p",{className:"text-lg font-semibold",children:"Oops! Something went wrong!"}),y.jsx("p",{className:"text-sm",children:"Something went wrong:"}),y.jsx("pre",{className:"text-xs",children:e.message})]})]})}function Jo({number:e,decimalPlaces:t=0,useSuffix:n=!1,customSuffix:r="",currency:o="",locale:i="en-US"}){let s=1,a=r,l=i;const c=t;n&&!r&&(e>=1e9?(s=1e9,a="B"):e>=1e7&&i==="en-IN"?(s=1e7,a="Cr"):e>=1e5&&i==="en-IN"?(s=1e5,a="L"):e>=1e6?(s=1e6,a="M"):e>=1e3&&(s=1e3,a="K"));const u=e/s,d={maximumFractionDigits:c,minimumFractionDigits:c};if(o){d.style="currency",d.currency=o;try{new Intl.NumberFormat(i,d).format(0)}catch{}}try{new Intl.NumberFormat(i,d).format(0)}catch{l="en-US"}let h=new Intl.NumberFormat(l,d).format(u);return n&&(h+=a),h}function VC(e,t){if(!t)return"";const n=t.find(r=>e>=r.start&&e<=r.end);return(n==null?void 0:n.color)||""}function X1(e){try{const n=new Function("getDatalabelColor",e)(x1);return{options:n==null?void 0:n.options,plugins:(n==null?void 0:n.plugins)||[]}}catch(t){return console.error("Error processing custom visual code",t),{options:{},plugins:[]}}}function Jee(e){const t=getComputedStyle(document.documentElement).getPropertyValue(e);return RL(t)}function RL(e){const[t,n,r]=e.split(" "),o=parseFloat(t),i=parseFloat(n),s=parseFloat(r),a=i/100,l=s/100,c=(1-Math.abs(2*l-1))*a,u=c*(1-Math.abs(o/60%2-1)),d=l-c/2;let p=0,h=0,m=0;0<=o&&o<60?(p=c,h=u,m=0):60<=o&&o<120?(p=u,h=c,m=0):120<=o&&o<180?(p=0,h=c,m=u):180<=o&&o<240?(p=0,h=u,m=c):240<=o&&o<300?(p=u,h=0,m=c):300<=o&&o<360&&(p=c,h=0,m=u),p=Math.round((p+d)*255),h=Math.round((h+d)*255),m=Math.round((m+d)*255);const b=v=>{const x=v.toString(16);return x.length==1?"0"+x:x};return`#${b(p)}${b(h)}${b(m)}`}function pl({data:e,cfg:t,customCfg:n,preferences:r,cardType:o}){be.getState().themeStyle;const i=o==="radar"?.2:1,{dimensionKeys:s,metricKeys:a}=Yn(e),l=kee(a,e,r,i),c=If(l,n),u=s[0],d=K1(e,u);WC(r,t),PL(r);const{options:p,plugins:h}=kL({cfg:t,preferences:r,customCfg:n});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:d,datasets:c},options:p,plugins:h}}function WC(e,t){var o,i,s;const n=((o=t==null?void 0:t.options)==null?void 0:o.indexAxis)==="y"?"x":"y";return(i=e==null?void 0:e.chartOptions)!=null&&i.indexAxis?((s=e==null?void 0:e.chartOptions)==null?void 0:s.indexAxis)==="x"?"y":"x":n}function PL(e){var n,r;return(n=e==null?void 0:e.chartOptions)!=null&&n.indexAxis?((r=e==null?void 0:e.chartOptions)==null?void 0:r.indexAxis)==="x"?"x":"y":"x"}function TL(e,t){var i,s,a,l,c,u,d,p,h,m,b,v;const n=WC(t,e),r=PL(t);return{...e==null?void 0:e.options,scales:{...(i=e==null?void 0:e.options)==null?void 0:i.scales,[n]:{...(a=(s=e==null?void 0:e.options)==null?void 0:s.scales)==null?void 0:a[n],ticks:{...(u=(c=(l=e==null?void 0:e.options)==null?void 0:l.scales)==null?void 0:c[n])==null?void 0:u.ticks,callback:x=>{var w,_,R,C;return Jo({number:Number(x),decimalPlaces:((w=t==null?void 0:t.numberAxisFormat)==null?void 0:w.decimalPlaces)||0,useSuffix:!!((_=t==null?void 0:t.numberAxisFormat)!=null&&_.suffix),customSuffix:"",locale:((R=t==null?void 0:t.numberAxisFormat)==null?void 0:R.locale)||"",currency:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.currency)||""})}}},[r]:{...(h=(p=(d=e==null?void 0:e.options)==null?void 0:d.scales)==null?void 0:p[r])==null?void 0:h.ticks,callback:null}},plugins:{...(m=e==null?void 0:e.options)==null?void 0:m.plugins,datalabels:{...(v=(b=e==null?void 0:e.options)==null?void 0:b.plugins)==null?void 0:v.datalabels,formatter:function(x){var w,_,R,C;return Jo({number:Number(x),decimalPlaces:((w=t==null?void 0:t.numberAxisFormat)==null?void 0:w.decimalPlaces)||0,useSuffix:!!((_=t==null?void 0:t.numberAxisFormat)!=null&&_.suffix),customSuffix:"",locale:((R=t==null?void 0:t.numberAxisFormat)==null?void 0:R.locale)||"",currency:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.currency)||""})}}}}}function kL({cfg:e,preferences:t,customCfg:n}){var p,h,m,b,v,x,w,_,R,C,E,A,M,N,L,F,z,Z,G,j,H,$,V,X,I,q,U,O,J,K,ne;const r=be.getState().themeStyle,o=TL(e,t),i=Jr((e==null?void 0:e.options)||{},t==null?void 0:t.chartOptions),s=Jr(o,i),a=Jr(s,(n==null?void 0:n.options)||{}),l={...a,scales:{...a==null?void 0:a.scales,x:{...(p=a==null?void 0:a.scales)==null?void 0:p.x,grid:{...(m=(h=a==null?void 0:a.scales)==null?void 0:h.x)==null?void 0:m.grid,color:(_=(w=(x=(v=(b=r==null?void 0:r.chart)==null?void 0:b.options)==null?void 0:v.scales)==null?void 0:x.x)==null?void 0:w.grid)==null?void 0:_.color}},y:{...(R=a==null?void 0:a.scales)==null?void 0:R.y,grid:{...(E=(C=a==null?void 0:a.scales)==null?void 0:C.y)==null?void 0:E.grid,color:(F=(L=(N=(M=(A=r==null?void 0:r.chart)==null?void 0:A.options)==null?void 0:M.scales)==null?void 0:N.y)==null?void 0:L.grid)==null?void 0:F.color}}},plugins:{...a==null?void 0:a.plugins,tooltip:{filter:function(Y){return Y.raw!==void 0&&Y.raw!==0},callbacks:{title:function(Y){var re,ue,fe,se,pe;const ee=((re=Y==null?void 0:Y[0])==null?void 0:re.label)||"";if(Y.length>1){const ce=Y.reduce((Pe,Me)=>{const ke=Me.raw;return ke!==void 0&&ke!==0?Pe+ke:Pe},0),_e=Jo({number:ce,decimalPlaces:((ue=t==null?void 0:t.numberAxisFormat)==null?void 0:ue.decimalPlaces)||0,useSuffix:!!((fe=t==null?void 0:t.numberAxisFormat)!=null&&fe.suffix),customSuffix:"",locale:((se=t==null?void 0:t.numberAxisFormat)==null?void 0:se.locale)||"",currency:((pe=t==null?void 0:t.numberAxisFormat)==null?void 0:pe.currency)||""});return`${ee} (${_e})`}return ee},label:function(Y){var fe,se,pe,ce,_e;const ee=((fe=Y==null?void 0:Y.dataset)==null?void 0:fe.label)||"",re=Y==null?void 0:Y.raw;if(re===void 0||re===0)return;const ue=Jo({number:Number(re),decimalPlaces:((se=t==null?void 0:t.numberAxisFormat)==null?void 0:se.decimalPlaces)||0,useSuffix:!!((pe=t==null?void 0:t.numberAxisFormat)!=null&&pe.suffix),customSuffix:"",locale:((ce=t==null?void 0:t.numberAxisFormat)==null?void 0:ce.locale)||"",currency:((_e=t==null?void 0:t.numberAxisFormat)==null?void 0:_e.currency)||""});return`${ee}: ${ue}`},...(Z=(z=a==null?void 0:a.plugins)==null?void 0:z.tooltip)==null?void 0:Z.callbacks},...(G=a==null?void 0:a.plugins)==null?void 0:G.tooltip,backgroundColor:(V=($=(H=(j=r==null?void 0:r.chart)==null?void 0:j.options)==null?void 0:H.plugins)==null?void 0:$.tooltip)==null?void 0:V.backgroundColor,bodyColor:(U=(q=(I=(X=r==null?void 0:r.chart)==null?void 0:X.options)==null?void 0:I.plugins)==null?void 0:q.tooltip)==null?void 0:U.bodyColor,titleColor:(ne=(K=(J=(O=r==null?void 0:r.chart)==null?void 0:O.options)==null?void 0:J.plugins)==null?void 0:K.tooltip)==null?void 0:ne.titleColor}}},{plugins:c,options:u}=X1((t==null?void 0:t.customVisualCode)||"");return{options:Jr(l,u),plugins:c}}/*!
|
|
270
|
+
* @kurkle/color v0.3.4
|
|
271
|
+
* https://github.com/kurkle/color#readme
|
|
272
|
+
* (c) 2024 Jukka Kurkela
|
|
273
|
+
* Released under the MIT License
|
|
274
|
+
*/function cp(e){return e+.5|0}const Ea=(e,t,n)=>Math.max(Math.min(e,n),t);function Df(e){return Ea(cp(e*2.55),0,255)}function Ma(e){return Ea(cp(e*255),0,255)}function Ns(e){return Ea(cp(e/2.55)/100,0,1)}function Jk(e){return Ea(cp(e*100),0,100)}const qo={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Q1=[..."0123456789ABCDEF"],ete=e=>Q1[e&15],tte=e=>Q1[(e&240)>>4]+Q1[e&15],Ug=e=>(e&240)>>4===(e&15),nte=e=>Ug(e.r)&&Ug(e.g)&&Ug(e.b)&&Ug(e.a);function rte(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&qo[e[1]]*17,g:255&qo[e[2]]*17,b:255&qo[e[3]]*17,a:t===5?qo[e[4]]*17:255}:(t===7||t===9)&&(n={r:qo[e[1]]<<4|qo[e[2]],g:qo[e[3]]<<4|qo[e[4]],b:qo[e[5]]<<4|qo[e[6]],a:t===9?qo[e[7]]<<4|qo[e[8]]:255})),n}const ote=(e,t)=>e<255?t(e):"";function ite(e){var t=nte(e)?ete:tte;return e?"#"+t(e.r)+t(e.g)+t(e.b)+ote(e.a,t):void 0}const ste=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function AL(e,t,n){const r=t*Math.min(n,1-n),o=(i,s=(i+e/30)%12)=>n-r*Math.max(Math.min(s-3,9-s,1),-1);return[o(0),o(8),o(4)]}function ate(e,t,n){const r=(o,i=(o+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function lte(e,t,n){const r=AL(e,1,.5);let o;for(t+n>1&&(o=1/(t+n),t*=o,n*=o),o=0;o<3;o++)r[o]*=1-t-n,r[o]+=t;return r}function cte(e,t,n,r,o){return e===o?(t-n)/r+(t<n?6:0):t===o?(n-e)/r+2:(e-t)/r+4}function UC(e){const n=e.r/255,r=e.g/255,o=e.b/255,i=Math.max(n,r,o),s=Math.min(n,r,o),a=(i+s)/2;let l,c,u;return i!==s&&(u=i-s,c=a>.5?u/(2-i-s):u/(i+s),l=cte(n,r,o,u,i),l=l*60+.5),[l|0,c||0,a]}function GC(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Ma)}function qC(e,t,n){return GC(AL,e,t,n)}function ute(e,t,n){return GC(lte,e,t,n)}function dte(e,t,n){return GC(ate,e,t,n)}function OL(e){return(e%360+360)%360}function fte(e){const t=ste.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Df(+t[5]):Ma(+t[5]));const o=OL(+t[2]),i=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=ute(o,i,s):t[1]==="hsv"?r=dte(o,i,s):r=qC(o,i,s),{r:r[0],g:r[1],b:r[2],a:n}}function hte(e,t){var n=UC(e);n[0]=OL(n[0]+t),n=qC(n),e.r=n[0],e.g=n[1],e.b=n[2]}function pte(e){if(!e)return;const t=UC(e),n=t[0],r=Jk(t[1]),o=Jk(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${o}%, ${Ns(e.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const eA={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},tA={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function gte(){const e={},t=Object.keys(tA),n=Object.keys(eA);let r,o,i,s,a;for(r=0;r<t.length;r++){for(s=a=t[r],o=0;o<n.length;o++)i=n[o],a=a.replace(i,eA[i]);i=parseInt(tA[s],16),e[a]=[i>>16&255,i>>8&255,i&255]}return e}let Gg;function mte(e){Gg||(Gg=gte(),Gg.transparent=[0,0,0,0]);const t=Gg[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const bte=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function yte(e){const t=bte.exec(e);let n=255,r,o,i;if(t){if(t[7]!==r){const s=+t[7];n=t[8]?Df(s):Ea(s*255,0,255)}return r=+t[1],o=+t[3],i=+t[5],r=255&(t[2]?Df(r):Ea(r,0,255)),o=255&(t[4]?Df(o):Ea(o,0,255)),i=255&(t[6]?Df(i):Ea(i,0,255)),{r,g:o,b:i,a:n}}}function vte(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Ns(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Ix=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,eu=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function xte(e,t,n){const r=eu(Ns(e.r)),o=eu(Ns(e.g)),i=eu(Ns(e.b));return{r:Ma(Ix(r+n*(eu(Ns(t.r))-r))),g:Ma(Ix(o+n*(eu(Ns(t.g))-o))),b:Ma(Ix(i+n*(eu(Ns(t.b))-i))),a:e.a+n*(t.a-e.a)}}function qg(e,t,n){if(e){let r=UC(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=qC(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function ML(e,t){return e&&Object.assign(t||{},e)}function nA(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Ma(e[3]))):(t=ML(e,{r:0,g:0,b:0,a:1}),t.a=Ma(t.a)),t}function wte(e){return e.charAt(0)==="r"?yte(e):fte(e)}let IL=class Z1{constructor(t){if(t instanceof Z1)return t;const n=typeof t;let r;n==="object"?r=nA(t):n==="string"&&(r=rte(t)||mte(t)||wte(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=ML(this._rgb);return t&&(t.a=Ns(t.a)),t}set rgb(t){this._rgb=nA(t)}rgbString(){return this._valid?vte(this._rgb):void 0}hexString(){return this._valid?ite(this._rgb):void 0}hslString(){return this._valid?pte(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,o=t.rgb;let i;const s=n===i?.5:n,a=2*s-1,l=r.a-o.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;i=1-c,r.r=255&c*r.r+i*o.r+.5,r.g=255&c*r.g+i*o.g+.5,r.b=255&c*r.b+i*o.b+.5,r.a=s*r.a+(1-s)*o.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=xte(this._rgb,t._rgb,n)),this}clone(){return new Z1(this.rgb)}alpha(t){return this._rgb.a=Ma(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=cp(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return qg(this._rgb,2,t),this}darken(t){return qg(this._rgb,2,-t),this}saturate(t){return qg(this._rgb,1,t),this}desaturate(t){return qg(this._rgb,1,-t),this}rotate(t){return hte(this._rgb,t),this}};/*!
|
|
275
|
+
* Chart.js v4.4.8
|
|
276
|
+
* https://www.chartjs.org
|
|
277
|
+
* (c) 2025 Chart.js Contributors
|
|
278
|
+
* Released under the MIT License
|
|
279
|
+
*/function Rs(){}const Ste=(()=>{let e=0;return()=>e++})();function ct(e){return e==null}function un(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Ct(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function En(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function _o(e,t){return En(e)?e:t}function Je(e,t){return typeof e>"u"?t:e}const _te=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,DL=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Xt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Ht(e,t,n,r){let o,i,s;if(un(e))for(i=e.length,o=0;o<i;o++)t.call(n,e[o],o);else if(Ct(e))for(s=Object.keys(e),i=s.length,o=0;o<i;o++)t.call(n,e[s[o]],s[o])}function xb(e,t){let n,r,o,i;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(o=e[n],i=t[n],o.datasetIndex!==i.datasetIndex||o.index!==i.index)return!1;return!0}function wb(e){if(un(e))return e.map(wb);if(Ct(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let o=0;for(;o<r;++o)t[n[o]]=wb(e[n[o]]);return t}return e}function NL(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Cte(e,t,n,r){if(!NL(e))return;const o=t[e],i=n[e];Ct(o)&&Ct(i)?Qn(o,i,r):t[e]=wb(i)}function Qn(e,t,n){const r=un(t)?t:[t],o=r.length;if(!Ct(e))return e;n=n||{};const i=n.merger||Cte;let s;for(let a=0;a<o;++a){if(s=r[a],!Ct(s))continue;const l=Object.keys(s);for(let c=0,u=l.length;c<u;++c)i(l[c],e,s,n)}return e}function Yf(e,t){return Qn(e,t,{merger:Ete})}function Ete(e,t,n){if(!NL(e))return;const r=t[e],o=n[e];Ct(r)&&Ct(o)?Yf(r,o):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=wb(o))}const rA={"":e=>e,x:e=>e.x,y:e=>e.y};function Rte(e){const t=e.split("."),n=[];let r="";for(const o of t)r+=o,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function Pte(e){const t=Rte(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Fa(e,t){return(rA[t]||(rA[t]=Pte(t)))(e)}function YC(e){return e.charAt(0).toUpperCase()+e.slice(1)}const xh=e=>typeof e<"u",ja=e=>typeof e=="function",oA=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function Tte(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const hn=Math.PI,dn=2*hn,kte=dn+hn,Sb=Number.POSITIVE_INFINITY,Ate=hn/180,kn=hn/2,gl=hn/4,iA=hn*2/3,Ra=Math.log10,Yi=Math.sign;function Kf(e,t,n){return Math.abs(e-t)<n}function sA(e){const t=Math.round(e);e=Kf(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Ra(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function Ote(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((o,i)=>o-i).pop(),t}function Mte(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function nd(e){return!Mte(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Ite(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function LL(e,t,n){let r,o,i;for(r=0,o=e.length;r<o;r++)i=e[r][n],isNaN(i)||(t.min=Math.min(t.min,i),t.max=Math.max(t.max,i))}function vi(e){return e*(hn/180)}function KC(e){return e*(180/hn)}function aA(e){if(!En(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function FL(e,t){const n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r);let i=Math.atan2(r,n);return i<-.5*hn&&(i+=dn),{angle:i,distance:o}}function J1(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Dte(e,t){return(e-t+kte)%dn-hn}function Eo(e){return(e%dn+dn)%dn}function wh(e,t,n,r){const o=Eo(e),i=Eo(t),s=Eo(n),a=Eo(i-o),l=Eo(s-o),c=Eo(o-i),u=Eo(o-s);return o===i||o===s||r&&i===s||a>l&&c<u}function Xn(e,t,n){return Math.max(t,Math.min(n,e))}function Nte(e){return Xn(e,-32768,32767)}function Bs(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function XC(e,t,n){n=n||(s=>e[s]<t);let r=e.length-1,o=0,i;for(;r-o>1;)i=o+r>>1,n(i)?o=i:r=i;return{lo:o,hi:r}}const Hs=(e,t,n,r)=>XC(e,n,r?o=>{const i=e[o][t];return i<n||i===n&&e[o+1][t]===n}:o=>e[o][t]<n),Lte=(e,t,n)=>XC(e,n,r=>e[r][t]>=n);function Fte(e,t,n){let r=0,o=e.length;for(;r<o&&e[r]<t;)r++;for(;o>r&&e[o-1]>n;)o--;return r>0||o<e.length?e.slice(r,o):e}const jL=["push","pop","shift","splice","unshift"];function jte(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),jL.forEach(n=>{const r="_onData"+YC(n),o=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...i){const s=o.apply(this,i);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...i)}),s}})})}function lA(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,o=r.indexOf(t);o!==-1&&r.splice(o,1),!(r.length>0)&&(jL.forEach(i=>{delete e[i]}),delete e._chartjs)}function $L(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const zL=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function BL(e,t){let n=[],r=!1;return function(...o){n=o,r||(r=!0,zL.call(window,()=>{r=!1,e.apply(t,n)}))}}function $te(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const QC=e=>e==="start"?"left":e==="end"?"right":"center",gr=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,zte=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function HL(e,t,n){const r=t.length;let o=0,i=r;if(e._sorted){const{iScale:s,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=s.axis,{min:d,max:p,minDefined:h,maxDefined:m}=s.getUserBounds();if(h){if(o=Math.min(Hs(l,u,d).lo,n?r:Hs(t,u,s.getPixelForValue(d)).lo),c){const b=l.slice(0,o+1).reverse().findIndex(v=>!ct(v[a.axis]));o-=Math.max(0,b)}o=Xn(o,0,r-1)}if(m){let b=Math.max(Hs(l,s.axis,p,!0).hi+1,n?0:Hs(t,u,s.getPixelForValue(p),!0).hi+1);if(c){const v=l.slice(b-1).findIndex(x=>!ct(x[a.axis]));b+=Math.max(0,v)}i=Xn(b,o,r)-o}else i=r-o}return{start:o,count:i}}function VL(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,o={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=o,!0;const i=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,o),i}const Yg=e=>e===0||e===1,cA=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*dn/n)),uA=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*dn/n)+1,Xf={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*kn)+1,easeOutSine:e=>Math.sin(e*kn),easeInOutSine:e=>-.5*(Math.cos(hn*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Yg(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Yg(e)?e:cA(e,.075,.3),easeOutElastic:e=>Yg(e)?e:uA(e,.075,.3),easeInOutElastic(e){return Yg(e)?e:e<.5?.5*cA(e*2,.1125,.45):.5+.5*uA(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Xf.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Xf.easeInBounce(e*2)*.5:Xf.easeOutBounce(e*2-1)*.5+.5};function ZC(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function dA(e){return ZC(e)?e:new IL(e)}function Dx(e){return ZC(e)?e:new IL(e).saturate(.5).darken(.1).hexString()}const Bte=["x","y","borderWidth","radius","tension"],Hte=["color","borderColor","backgroundColor"];function Vte(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:Hte},numbers:{type:"number",properties:Bte}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Wte(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const fA=new Map;function Ute(e,t){t=t||{};const n=e+JSON.stringify(t);let r=fA.get(n);return r||(r=new Intl.NumberFormat(e,t),fA.set(n,r)),r}function up(e,t,n){return Ute(t,n).format(e)}const WL={values(e){return un(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let o,i=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(o="scientific"),i=Gte(e,n)}const s=Ra(Math.abs(i)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:o,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),up(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(Ra(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?WL.numeric.call(this,e,t,n):""}};function Gte(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var G0={formatters:WL};function qte(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:G0.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const hc=Object.create(null),eS=Object.create(null);function Qf(e,t){if(!t)return e;const n=t.split(".");for(let r=0,o=n.length;r<o;++r){const i=n[r];e=e[i]||(e[i]=Object.create(null))}return e}function Nx(e,t,n){return typeof t=="string"?Qn(Qf(e,t),n):Qn(Qf(e,""),t)}class Yte{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,o)=>Dx(o.backgroundColor),this.hoverBorderColor=(r,o)=>Dx(o.borderColor),this.hoverColor=(r,o)=>Dx(o.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Nx(this,t,n)}get(t){return Qf(this,t)}describe(t,n){return Nx(eS,t,n)}override(t,n){return Nx(hc,t,n)}route(t,n,r,o){const i=Qf(this,t),s=Qf(this,r),a="_"+n;Object.defineProperties(i,{[a]:{value:i[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=s[o];return Ct(l)?Object.assign({},c,l):Je(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var fn=new Yte({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Vte,Wte,qte]);function Kte(e){return!e||ct(e.size)||ct(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function _b(e,t,n,r,o){let i=t[o];return i||(i=t[o]=e.measureText(o).width,n.push(o)),i>r&&(r=i),r}function Xte(e,t,n,r){r=r||{};let o=r.data=r.data||{},i=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(o=r.data={},i=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let s=0;const a=n.length;let l,c,u,d,p;for(l=0;l<a;l++)if(d=n[l],d!=null&&!un(d))s=_b(e,o,i,s,d);else if(un(d))for(c=0,u=d.length;c<u;c++)p=d[c],p!=null&&!un(p)&&(s=_b(e,o,i,s,p));e.restore();const h=i.length/2;if(h>n.length){for(l=0;l<h;l++)delete o[i[l]];i.splice(0,h)}return s}function ml(e,t,n){const r=e.currentDevicePixelRatio,o=n!==0?Math.max(n/2,.5):0;return Math.round((t-o)*r)/r+o}function hA(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Cb(e,t,n,r){UL(e,t,n,r,null)}function UL(e,t,n,r,o){let i,s,a,l,c,u,d,p;const h=t.pointStyle,m=t.rotation,b=t.radius;let v=(m||0)*Ate;if(h&&typeof h=="object"&&(i=h.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(v),e.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),e.restore();return}if(!(isNaN(b)||b<=0)){switch(e.beginPath(),h){default:o?e.ellipse(n,r,o/2,b,0,0,dn):e.arc(n,r,b,0,dn),e.closePath();break;case"triangle":u=o?o/2:b,e.moveTo(n+Math.sin(v)*u,r-Math.cos(v)*b),v+=iA,e.lineTo(n+Math.sin(v)*u,r-Math.cos(v)*b),v+=iA,e.lineTo(n+Math.sin(v)*u,r-Math.cos(v)*b),e.closePath();break;case"rectRounded":c=b*.516,l=b-c,s=Math.cos(v+gl)*l,d=Math.cos(v+gl)*(o?o/2-c:l),a=Math.sin(v+gl)*l,p=Math.sin(v+gl)*(o?o/2-c:l),e.arc(n-d,r-a,c,v-hn,v-kn),e.arc(n+p,r-s,c,v-kn,v),e.arc(n+d,r+a,c,v,v+kn),e.arc(n-p,r+s,c,v+kn,v+hn),e.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*b,u=o?o/2:l,e.rect(n-u,r-l,2*u,2*l);break}v+=gl;case"rectRot":d=Math.cos(v)*(o?o/2:b),s=Math.cos(v)*b,a=Math.sin(v)*b,p=Math.sin(v)*(o?o/2:b),e.moveTo(n-d,r-a),e.lineTo(n+p,r-s),e.lineTo(n+d,r+a),e.lineTo(n-p,r+s),e.closePath();break;case"crossRot":v+=gl;case"cross":d=Math.cos(v)*(o?o/2:b),s=Math.cos(v)*b,a=Math.sin(v)*b,p=Math.sin(v)*(o?o/2:b),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s);break;case"star":d=Math.cos(v)*(o?o/2:b),s=Math.cos(v)*b,a=Math.sin(v)*b,p=Math.sin(v)*(o?o/2:b),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s),v+=gl,d=Math.cos(v)*(o?o/2:b),s=Math.cos(v)*b,a=Math.sin(v)*b,p=Math.sin(v)*(o?o/2:b),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s);break;case"line":s=o?o/2:Math.cos(v)*b,a=Math.sin(v)*b,e.moveTo(n-s,r-a),e.lineTo(n+s,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(v)*(o?o/2:b),r+Math.sin(v)*b);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Vs(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Kl(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Xl(e){e.restore()}function Qte(e,t,n,r,o){if(!t)return e.lineTo(n.x,n.y);if(o==="middle"){const i=(t.x+n.x)/2;e.lineTo(i,t.y),e.lineTo(i,n.y)}else o==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function Zte(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function Jte(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),ct(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function ene(e,t,n,r,o){if(o.strikethrough||o.underline){const i=e.measureText(r),s=t-i.actualBoundingBoxLeft,a=t+i.actualBoundingBoxRight,l=n-i.actualBoundingBoxAscent,c=n+i.actualBoundingBoxDescent,u=o.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=o.decorationWidth||2,e.moveTo(s,u),e.lineTo(a,u),e.stroke()}}function tne(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function pc(e,t,n,r,o,i={}){const s=un(t)?t:[t],a=i.strokeWidth>0&&i.strokeColor!=="";let l,c;for(e.save(),e.font=o.string,Jte(e,i),l=0;l<s.length;++l)c=s[l],i.backdrop&&tne(e,i.backdrop),a&&(i.strokeColor&&(e.strokeStyle=i.strokeColor),ct(i.strokeWidth)||(e.lineWidth=i.strokeWidth),e.strokeText(c,n,r,i.maxWidth)),e.fillText(c,n,r,i.maxWidth),ene(e,n,r,c,i),r+=Number(o.lineHeight);e.restore()}function Sh(e,t){const{x:n,y:r,w:o,h:i,radius:s}=t;e.arc(n+s.topLeft,r+s.topLeft,s.topLeft,1.5*hn,hn,!0),e.lineTo(n,r+i-s.bottomLeft),e.arc(n+s.bottomLeft,r+i-s.bottomLeft,s.bottomLeft,hn,kn,!0),e.lineTo(n+o-s.bottomRight,r+i),e.arc(n+o-s.bottomRight,r+i-s.bottomRight,s.bottomRight,kn,0,!0),e.lineTo(n+o,r+s.topRight),e.arc(n+o-s.topRight,r+s.topRight,s.topRight,0,-kn,!0),e.lineTo(n+s.topLeft,r)}const nne=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,rne=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function one(e,t){const n=(""+e).match(nne);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const ine=e=>+e||0;function JC(e,t){const n={},r=Ct(t),o=r?Object.keys(t):t,i=Ct(e)?r?s=>Je(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of o)n[s]=ine(i(s));return n}function GL(e){return JC(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Ql(e){return JC(e,["topLeft","topRight","bottomLeft","bottomRight"])}function ir(e){const t=GL(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Dn(e,t){e=e||{},t=t||fn.font;let n=Je(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=Je(e.style,t.style);r&&!(""+r).match(rne)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const o={family:Je(e.family,t.family),lineHeight:one(Je(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Je(e.weight,t.weight),string:""};return o.string=Kte(o),o}function ln(e,t,n,r){let o,i,s;for(o=0,i=e.length;o<i;++o)if(s=e[o],s!==void 0&&(t!==void 0&&typeof s=="function"&&(s=s(t)),n!==void 0&&un(s)&&(s=s[n%s.length]),s!==void 0))return s}function sne(e,t,n){const{min:r,max:o}=e,i=DL(t,(o-r)/2),s=(a,l)=>n&&a===0?0:a+l;return{min:s(r,-Math.abs(i)),max:s(o,i)}}function Ka(e,t){return Object.assign(Object.create(e),t)}function eE(e,t=[""],n,r,o=()=>e[0]){const i=n||e;typeof r>"u"&&(r=XL("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:i,_fallback:r,_getTarget:o,override:a=>eE([a,...e],t,i,r)};return new Proxy(s,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return YL(a,l,()=>pne(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return gA(a).includes(l)},ownKeys(a){return gA(a)},set(a,l,c){const u=a._storage||(a._storage=o());return a[l]=u[l]=c,delete a._keys,!0}})}function rd(e,t,n,r){const o={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:qL(e,r),setContext:i=>rd(e,i,n,r),override:i=>rd(e.override(i),t,n,r)};return new Proxy(o,{deleteProperty(i,s){return delete i[s],delete e[s],!0},get(i,s,a){return YL(i,s,()=>lne(i,s,a))},getOwnPropertyDescriptor(i,s){return i._descriptors.allKeys?Reflect.has(e,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,s)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(i,s){return Reflect.has(e,s)},ownKeys(){return Reflect.ownKeys(e)},set(i,s,a){return e[s]=a,delete i[s],!0}})}function qL(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:o=t.allKeys}=e;return{allKeys:o,scriptable:n,indexable:r,isScriptable:ja(n)?n:()=>n,isIndexable:ja(r)?r:()=>r}}const ane=(e,t)=>e?e+YC(t):t,tE=(e,t)=>Ct(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function YL(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function lne(e,t,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:s}=e;let a=r[t];return ja(a)&&s.isScriptable(t)&&(a=cne(t,a,e,n)),un(a)&&a.length&&(a=une(t,a,e,s.isIndexable)),tE(t,a)&&(a=rd(a,o,i&&i[t],s)),a}function cne(e,t,n,r){const{_proxy:o,_context:i,_subProxy:s,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(i,s||r);return a.delete(e),tE(e,l)&&(l=nE(o._scopes,o,e,l)),l}function une(e,t,n,r){const{_proxy:o,_context:i,_subProxy:s,_descriptors:a}=n;if(typeof i.index<"u"&&r(e))return t[i.index%t.length];if(Ct(t[0])){const l=t,c=o._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=nE(c,o,e,u);t.push(rd(d,i,s&&s[e],a))}}return t}function KL(e,t,n){return ja(e)?e(t,n):e}const dne=(e,t)=>e===!0?t:typeof e=="string"?Fa(t,e):void 0;function fne(e,t,n,r,o){for(const i of t){const s=dne(n,i);if(s){e.add(s);const a=KL(s._fallback,n,o);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(s===!1&&typeof r<"u"&&n!==r)return null}return!1}function nE(e,t,n,r){const o=t._rootScopes,i=KL(t._fallback,n,r),s=[...e,...o],a=new Set;a.add(r);let l=pA(a,s,n,i||n,r);return l===null||typeof i<"u"&&i!==n&&(l=pA(a,s,i,l,r),l===null)?!1:eE(Array.from(a),[""],o,i,()=>hne(t,n,r))}function pA(e,t,n,r,o){for(;n;)n=fne(e,t,n,r,o);return n}function hne(e,t,n){const r=e._getTarget();t in r||(r[t]={});const o=r[t];return un(o)&&Ct(n)?n:o||{}}function pne(e,t,n,r){let o;for(const i of t)if(o=XL(ane(i,e),n),typeof o<"u")return tE(e,o)?nE(n,r,e,o):o}function XL(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function gA(e){let t=e._keys;return t||(t=e._keys=gne(e._scopes)),t}function gne(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(o=>!o.startsWith("_")))t.add(r);return Array.from(t)}function QL(e,t,n,r){const{iScale:o}=e,{key:i="r"}=this._parsing,s=new Array(r);let a,l,c,u;for(a=0,l=r;a<l;++a)c=a+n,u=t[c],s[a]={r:o.parse(Fa(u,i),c)};return s}const mne=Number.EPSILON||1e-14,od=(e,t)=>t<e.length&&!e[t].skip&&e[t],ZL=e=>e==="x"?"y":"x";function bne(e,t,n,r){const o=e.skip?t:e,i=t,s=n.skip?t:n,a=J1(i,o),l=J1(s,i);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=r*c,p=r*u;return{previous:{x:i.x-d*(s.x-o.x),y:i.y-d*(s.y-o.y)},next:{x:i.x+p*(s.x-o.x),y:i.y+p*(s.y-o.y)}}}function yne(e,t,n){const r=e.length;let o,i,s,a,l,c=od(e,0);for(let u=0;u<r-1;++u)if(l=c,c=od(e,u+1),!(!l||!c)){if(Kf(t[u],0,mne)){n[u]=n[u+1]=0;continue}o=n[u]/t[u],i=n[u+1]/t[u],a=Math.pow(o,2)+Math.pow(i,2),!(a<=9)&&(s=3/Math.sqrt(a),n[u]=o*s*t[u],n[u+1]=i*s*t[u])}}function vne(e,t,n="x"){const r=ZL(n),o=e.length;let i,s,a,l=od(e,0);for(let c=0;c<o;++c){if(s=a,a=l,l=od(e,c+1),!a)continue;const u=a[n],d=a[r];s&&(i=(u-s[n])/3,a[`cp1${n}`]=u-i,a[`cp1${r}`]=d-i*t[c]),l&&(i=(l[n]-u)/3,a[`cp2${n}`]=u+i,a[`cp2${r}`]=d+i*t[c])}}function xne(e,t="x"){const n=ZL(t),r=e.length,o=Array(r).fill(0),i=Array(r);let s,a,l,c=od(e,0);for(s=0;s<r;++s)if(a=l,l=c,c=od(e,s+1),!!l){if(c){const u=c[t]-l[t];o[s]=u!==0?(c[n]-l[n])/u:0}i[s]=a?c?Yi(o[s-1])!==Yi(o[s])?0:(o[s-1]+o[s])/2:o[s-1]:o[s]}yne(e,o,i),vne(e,i,t)}function Kg(e,t,n){return Math.max(Math.min(e,n),t)}function wne(e,t){let n,r,o,i,s,a=Vs(e[0],t);for(n=0,r=e.length;n<r;++n)s=i,i=a,a=n<r-1&&Vs(e[n+1],t),i&&(o=e[n],s&&(o.cp1x=Kg(o.cp1x,t.left,t.right),o.cp1y=Kg(o.cp1y,t.top,t.bottom)),a&&(o.cp2x=Kg(o.cp2x,t.left,t.right),o.cp2y=Kg(o.cp2y,t.top,t.bottom)))}function Sne(e,t,n,r,o){let i,s,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")xne(e,o);else{let c=r?e[e.length-1]:e[0];for(i=0,s=e.length;i<s;++i)a=e[i],l=bne(c,a,e[Math.min(i+1,s-(r?0:1))%s],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&wne(e,n)}function rE(){return typeof window<"u"&&typeof document<"u"}function oE(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Eb(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const q0=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function _ne(e,t){return q0(e).getPropertyValue(t)}const Cne=["top","right","bottom","left"];function Zl(e,t,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=Cne[o];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const Ene=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Rne(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:o,offsetY:i}=r;let s=!1,a,l;if(Ene(o,i,e.target))a=o,l=i;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,s=!0}return{x:a,y:l,box:s}}function Sl(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,o=q0(n),i=o.boxSizing==="border-box",s=Zl(o,"padding"),a=Zl(o,"border","width"),{x:l,y:c,box:u}=Rne(e,n),d=s.left+(u&&a.left),p=s.top+(u&&a.top);let{width:h,height:m}=t;return i&&(h-=s.width+a.width,m-=s.height+a.height),{x:Math.round((l-d)/h*n.width/r),y:Math.round((c-p)/m*n.height/r)}}function Pne(e,t,n){let r,o;if(t===void 0||n===void 0){const i=e&&oE(e);if(!i)t=e.clientWidth,n=e.clientHeight;else{const s=i.getBoundingClientRect(),a=q0(i),l=Zl(a,"border","width"),c=Zl(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=Eb(a.maxWidth,i,"clientWidth"),o=Eb(a.maxHeight,i,"clientHeight")}}return{width:t,height:n,maxWidth:r||Sb,maxHeight:o||Sb}}const Xg=e=>Math.round(e*10)/10;function Tne(e,t,n,r){const o=q0(e),i=Zl(o,"margin"),s=Eb(o.maxWidth,e,"clientWidth")||Sb,a=Eb(o.maxHeight,e,"clientHeight")||Sb,l=Pne(e,t,n);let{width:c,height:u}=l;if(o.boxSizing==="content-box"){const p=Zl(o,"border","width"),h=Zl(o,"padding");c-=h.width+p.width,u-=h.height+p.height}return c=Math.max(0,c-i.width),u=Math.max(0,r?c/r:u-i.height),c=Xg(Math.min(c,s,l.maxWidth)),u=Xg(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Xg(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=Xg(Math.floor(u*r))),{width:c,height:u}}function mA(e,t,n){const r=t||1,o=Math.floor(e.height*r),i=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const s=e.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${e.height}px`,s.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||s.height!==o||s.width!==i?(e.currentDevicePixelRatio=r,s.height=o,s.width=i,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const kne=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};rE()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function bA(e,t){const n=_ne(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function _l(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function Ane(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function One(e,t,n,r){const o={x:e.cp2x,y:e.cp2y},i={x:t.cp1x,y:t.cp1y},s=_l(e,o,n),a=_l(o,i,n),l=_l(i,t,n),c=_l(s,a,n),u=_l(a,l,n);return _l(c,u,n)}const Mne=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},Ine=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Eu(e,t,n){return e?Mne(t,n):Ine()}function JL(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function eF(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function tF(e){return e==="angle"?{between:wh,compare:Dte,normalize:Eo}:{between:Bs,compare:(t,n)=>t-n,normalize:t=>t}}function yA({start:e,end:t,count:n,loop:r,style:o}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:o}}function Dne(e,t,n){const{property:r,start:o,end:i}=n,{between:s,normalize:a}=tF(r),l=t.length;let{start:c,end:u,loop:d}=e,p,h;if(d){for(c+=l,u+=l,p=0,h=l;p<h&&s(a(t[c%l][r]),o,i);++p)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:e.style}}function nF(e,t,n){if(!n)return[e];const{property:r,start:o,end:i}=n,s=t.length,{compare:a,between:l,normalize:c}=tF(r),{start:u,end:d,loop:p,style:h}=Dne(e,t,n),m=[];let b=!1,v=null,x,w,_;const R=()=>l(o,_,x)&&a(o,_)!==0,C=()=>a(i,x)===0||l(i,_,x),E=()=>b||R(),A=()=>!b||C();for(let M=u,N=u;M<=d;++M)w=t[M%s],!w.skip&&(x=c(w[r]),x!==_&&(b=l(x,o,i),v===null&&E()&&(v=a(x,o)===0?M:N),v!==null&&A()&&(m.push(yA({start:v,end:M,loop:p,count:s,style:h})),v=null),N=M,_=x));return v!==null&&m.push(yA({start:v,end:d,loop:p,count:s,style:h})),m}function rF(e,t){const n=[],r=e.segments;for(let o=0;o<r.length;o++){const i=nF(r[o],e.points,t);i.length&&n.push(...i)}return n}function Nne(e,t,n,r){let o=0,i=t-1;if(n&&!r)for(;o<t&&!e[o].skip;)o++;for(;o<t&&e[o].skip;)o++;for(o%=t,n&&(i+=o);i>o&&e[i%t].skip;)i--;return i%=t,{start:o,end:i}}function Lne(e,t,n,r){const o=e.length,i=[];let s=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%o];c.skip||c.stop?a.skip||(r=!1,i.push({start:t%o,end:(l-1)%o,loop:r}),t=s=c.stop?l:null):(s=l,a.skip&&(t=l)),a=c}return s!==null&&i.push({start:t%o,end:s%o,loop:r}),i}function Fne(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return[];const i=!!e._loop,{start:s,end:a}=Nne(n,o,i,r);if(r===!0)return vA(e,[{start:s,end:a,loop:i}],n,t);const l=a<s?a+o:a,c=!!e._fullLoop&&s===0&&a===o-1;return vA(e,Lne(n,s,l,c),n,t)}function vA(e,t,n,r){return!r||!r.setContext||!n?t:jne(e,t,n,r)}function jne(e,t,n,r){const o=e._chart.getContext(),i=xA(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,c=[];let u=i,d=t[0].start,p=d;function h(m,b,v,x){const w=a?-1:1;if(m!==b){for(m+=l;n[m%l].skip;)m-=w;for(;n[b%l].skip;)b+=w;m%l!==b%l&&(c.push({start:m%l,end:b%l,loop:v,style:x}),u=x,d=b%l)}}for(const m of t){d=a?d:m.start;let b=n[d%l],v;for(p=d+1;p<=m.end;p++){const x=n[p%l];v=xA(r.setContext(Ka(o,{type:"segment",p0:b,p1:x,p0DataIndex:(p-1)%l,p1DataIndex:p%l,datasetIndex:s}))),$ne(v,u)&&h(d,p-1,m.loop,u),b=x,u=v}d<p-1&&h(d,p-1,m.loop,u)}return c}function xA(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function $ne(e,t){if(!t)return!1;const n=[],r=function(o,i){return ZC(i)?(n.includes(i)||n.push(i),n.indexOf(i)):i};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
|
|
280
|
+
* Chart.js v4.4.8
|
|
281
|
+
* https://www.chartjs.org
|
|
282
|
+
* (c) 2025 Chart.js Contributors
|
|
283
|
+
* Released under the MIT License
|
|
284
|
+
*/class zne{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,o){const i=n.listeners[o],s=n.duration;i.forEach(a=>a({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=zL.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,o)=>{if(!r.running||!r.items.length)return;const i=r.items;let s=i.length-1,a=!1,l;for(;s>=0;--s)l=i[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(i[s]=i[i.length-1],i.pop());a&&(o.draw(),this._notify(o,r,t,"progress")),i.length||(r.running=!1,this._notify(o,r,t,"complete"),r.initial=!1),n+=i.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,o)=>Math.max(r,o._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let o=r.length-1;for(;o>=0;--o)r[o].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var As=new zne;const wA="transparent",Bne={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=dA(e||wA),o=r.valid&&dA(t||wA);return o&&o.valid?o.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Hne{constructor(t,n,r,o){const i=n[r];o=ln([t.to,o,i,t.from]);const s=ln([t.from,i,o]);this._active=!0,this._fn=t.fn||Bne[t.type||typeof s],this._easing=Xf[t.easing]||Xf.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=s,this._to=o,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const o=this._target[this._prop],i=r-this._start,s=this._duration-i;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=i,this._loop=!!t.loop,this._to=ln([t.to,n,o,t.from]),this._from=ln([t.from,o,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,o=this._prop,i=this._from,s=this._loop,a=this._to;let l;if(this._active=i!==a&&(s||n<r),!this._active){this._target[o]=a,this._notify(!0);return}if(n<0){this._target[o]=i;return}l=n/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[o]=this._fn(i,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let o=0;o<r.length;o++)r[o][n]()}}class oF{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Ct(t))return;const n=Object.keys(fn.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(o=>{const i=t[o];if(!Ct(i))return;const s={};for(const a of n)s[a]=i[a];(un(i.properties)&&i.properties||[o]).forEach(a=>{(a===o||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,o=Wne(t,r);if(!o)return[];const i=this._createAnimations(o,r);return r.$shared&&Vne(t.options.$animations,r).then(()=>{t.options=r},()=>{}),i}_createAnimations(t,n){const r=this._properties,o=[],i=t.$animations||(t.$animations={}),s=Object.keys(n),a=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){o.push(...this._animateOptions(t,n));continue}const u=n[c];let d=i[c];const p=r.get(c);if(d)if(p&&d.active()){d.update(p,u,a);continue}else d.cancel();if(!p||!p.duration){t[c]=u;continue}i[c]=d=new Hne(p,t,c,u),o.push(d)}return o}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return As.add(this._chart,r),!0}}function Vne(e,t){const n=[],r=Object.keys(t);for(let o=0;o<r.length;o++){const i=e[r[o]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function Wne(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function SA(e,t){const n=e&&e.options||{},r=n.reverse,o=n.min===void 0?t:0,i=n.max===void 0?t:0;return{start:r?i:o,end:r?o:i}}function Une(e,t,n){if(n===!1)return!1;const r=SA(e,n),o=SA(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function Gne(e){let t,n,r,o;return Ct(e)?(t=e.top,n=e.right,r=e.bottom,o=e.left):t=n=r=o=e,{top:t,right:n,bottom:r,left:o,disabled:e===!1}}function iF(e,t){const n=[],r=e._getSortedDatasetMetas(t);let o,i;for(o=0,i=r.length;o<i;++o)n.push(r[o].index);return n}function _A(e,t,n,r={}){const o=e.keys,i=r.mode==="single";let s,a,l,c;if(t===null)return;let u=!1;for(s=0,a=o.length;s<a;++s){if(l=+o[s],l===n){if(u=!0,r.all)continue;break}c=e.values[l],En(c)&&(i||t===0||Yi(t)===Yi(c))&&(t+=c)}return!u&&!r.all?0:t}function qne(e,t){const{iScale:n,vScale:r}=t,o=n.axis==="x"?"x":"y",i=r.axis==="x"?"x":"y",s=Object.keys(e),a=new Array(s.length);let l,c,u;for(l=0,c=s.length;l<c;++l)u=s[l],a[l]={[o]:u,[i]:e[u]};return a}function Lx(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Yne(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Kne(e){const{min:t,max:n,minDefined:r,maxDefined:o}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:o?n:Number.POSITIVE_INFINITY}}function Xne(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function CA(e,t,n,r){for(const o of t.getMatchingVisibleMetas(r).reverse()){const i=e[o.index];if(n&&i>0||!n&&i<0)return o.index}return null}function EA(e,t){const{chart:n,_cachedMeta:r}=e,o=n._stacks||(n._stacks={}),{iScale:i,vScale:s,index:a}=r,l=i.axis,c=s.axis,u=Yne(i,s,r),d=t.length;let p;for(let h=0;h<d;++h){const m=t[h],{[l]:b,[c]:v}=m,x=m._stacks||(m._stacks={});p=x[c]=Xne(o,u,b),p[a]=v,p._top=CA(p,s,!0,r.type),p._bottom=CA(p,s,!1,r.type);const w=p._visualValues||(p._visualValues={});w[a]=v}}function Fx(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function Qne(e,t){return Ka(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Zne(e,t,n){return Ka(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function cf(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const o of t){const i=o._stacks;if(!i||i[r]===void 0||i[r][n]===void 0)return;delete i[r][n],i[r]._visualValues!==void 0&&i[r]._visualValues[n]!==void 0&&delete i[r]._visualValues[n]}}}const jx=e=>e==="reset"||e==="none",RA=(e,t)=>t?e:Object.assign({},e),Jne=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:iF(n,!0),values:null};class ti{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Lx(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&cf(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),o=(d,p,h,m)=>d==="x"?p:d==="r"?m:h,i=n.xAxisID=Je(r.xAxisID,Fx(t,"x")),s=n.yAxisID=Je(r.yAxisID,Fx(t,"y")),a=n.rAxisID=Je(r.rAxisID,Fx(t,"r")),l=n.indexAxis,c=n.iAxisID=o(l,i,s,a),u=n.vAxisID=o(l,s,i,a);n.xScale=this.getScaleForId(i),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&lA(this._data,this),t._stacked&&cf(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Ct(n)){const o=this._cachedMeta;this._data=qne(n,o)}else if(r!==n){if(r){lA(r,this);const o=this._cachedMeta;cf(o),o._parsed=[]}n&&Object.isExtensible(n)&&jte(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let o=!1;this._dataCheck();const i=n._stacked;n._stacked=Lx(n.vScale,n),n.stack!==r.stack&&(o=!0,cf(n),n.stack=r.stack),this._resyncElements(t),(o||i!==n._stacked)&&(EA(this,n._parsed),n._stacked=Lx(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:o}=this,{iScale:i,_stacked:s}=r,a=i.axis;let l=t===0&&n===o.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,p;if(this._parsing===!1)r._parsed=o,r._sorted=!0,p=o;else{un(o[t])?p=this.parseArrayData(r,o,t,n):Ct(o[t])?p=this.parseObjectData(r,o,t,n):p=this.parsePrimitiveData(r,o,t,n);const h=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=d=p[u],l&&(h()&&(l=!1),c=d);r._sorted=l}s&&EA(this,p)}parsePrimitiveData(t,n,r,o){const{iScale:i,vScale:s}=t,a=i.axis,l=s.axis,c=i.getLabels(),u=i===s,d=new Array(o);let p,h,m;for(p=0,h=o;p<h;++p)m=p+r,d[p]={[a]:u||i.parse(c[m],m),[l]:s.parse(n[m],m)};return d}parseArrayData(t,n,r,o){const{xScale:i,yScale:s}=t,a=new Array(o);let l,c,u,d;for(l=0,c=o;l<c;++l)u=l+r,d=n[u],a[l]={x:i.parse(d[0],u),y:s.parse(d[1],u)};return a}parseObjectData(t,n,r,o){const{xScale:i,yScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(o);let u,d,p,h;for(u=0,d=o;u<d;++u)p=u+r,h=n[p],c[u]={x:i.parse(Fa(h,a),p),y:s.parse(Fa(h,l),p)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const o=this.chart,i=this._cachedMeta,s=n[t.axis],a={keys:iF(o,!0),values:n._stacks[t.axis]._visualValues};return _A(a,s,i.index,{mode:r})}updateRangeFromParsed(t,n,r,o){const i=r[n.axis];let s=i===null?NaN:i;const a=o&&r._stacks[n.axis];o&&a&&(o.values=a,s=_A(o,i,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,n){const r=this._cachedMeta,o=r._parsed,i=r._sorted&&t===r.iScale,s=o.length,a=this._getOtherScale(t),l=Jne(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=Kne(a);let p,h;function m(){h=o[p];const b=h[a.axis];return!En(h[t.axis])||u>b||d<b}for(p=0;p<s&&!(!m()&&(this.updateRangeFromParsed(c,t,h,l),i));++p);if(i){for(p=s-1;p>=0;--p)if(!m()){this.updateRangeFromParsed(c,t,h,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let o,i,s;for(o=0,i=n.length;o<i;++o)s=n[o][t.axis],En(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,o=n.vScale,i=this.getParsed(t);return{label:r?""+r.getLabelForValue(i[r.axis]):"",value:o?""+o.getLabelForValue(i[o.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=Gne(Je(this.options.clip,Une(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,o=r.data||[],i=n.chartArea,s=[],a=this._drawStart||0,l=this._drawCount||o.length-a,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,i,a,l),u=a;u<a+l;++u){const d=o[u];d.hidden||(d.active&&c?s.push(d):d.draw(t,i))}for(u=0;u<s.length;++u)s[u].draw(t,i)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const o=this.getDataset();let i;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];i=s.$context||(s.$context=Zne(this.getContext(),t,s)),i.parsed=this.getParsed(t),i.raw=o.data[t],i.index=i.dataIndex=t}else i=this.$context||(this.$context=Qne(this.chart.getContext(),this.index)),i.dataset=o,i.index=i.datasetIndex=this.index;return i.active=!!n,i.mode=r,i}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const o=n==="active",i=this._cachedDataOpts,s=t+"-"+n,a=i[s],l=this.enableOptionSharing&&xh(r);if(a)return RA(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=o?[`${t}Hover`,"hover",t,""]:[t,""],p=c.getOptionScopes(this.getDataset(),u),h=Object.keys(fn.elements[t]),m=()=>this.getContext(r,o,n),b=c.resolveNamedOptions(p,h,m,d);return b.$shared&&(b.$shared=l,i[s]=Object.freeze(RA(b,l))),b}_resolveAnimations(t,n,r){const o=this.chart,i=this._cachedDataOpts,s=`animation-${n}`,a=i[s];if(a)return a;let l;if(o.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),p=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(p,this.getContext(t,r,n))}const c=new oF(o,l&&l.animations);return l&&l._cacheable&&(i[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||jx(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),o=this._sharedOptions,i=this.getSharedOptions(r),s=this.includeOptions(n,i)||i!==o;return this.updateSharedOptions(i,n,r),{sharedOptions:i,includeOptions:s}}updateElement(t,n,r,o){jx(o)?Object.assign(t,r):this._resolveAnimations(n,o).update(t,r)}updateSharedOptions(t,n,r){t&&!jx(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,o){t.active=o;const i=this.getStyle(n,o);this._resolveAnimations(n,r,o).update(t,{options:!o&&this.getSharedOptions(i)||i})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const o=r.length,i=n.length,s=Math.min(i,o);s&&this.parse(0,s),i>o?this._insertElements(o,i-o,t):i<o&&this._removeElements(i,o-i)}_insertElements(t,n,r=!0){const o=this._cachedMeta,i=o.data,s=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=s;a--)c[a]=c[a-n]};for(l(i),a=t;a<s;++a)i[a]=new this.dataElementType;this._parsing&&l(o._parsed),this.parse(t,n),r&&this.updateElements(i,t,n,"reset")}updateElements(t,n,r,o){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const o=r._parsed.splice(t,n);r._stacked&&cf(r,o)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,o]=t;this[n](r,o)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Te(ti,"defaults",{}),Te(ti,"datasetElementType",null),Te(ti,"dataElementType",null);function ere(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let o=0,i=n.length;o<i;o++)r=r.concat(n[o].controller.getAllParsedValues(e));e._cache.$bar=$L(r.sort((o,i)=>o-i))}return e._cache.$bar}function tre(e){const t=e.iScale,n=ere(t,e.type);let r=t._length,o,i,s,a;const l=()=>{s===32767||s===-32768||(xh(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(o=0,i=n.length;o<i;++o)s=t.getPixelForValue(n[o]),l();for(a=void 0,o=0,i=t.ticks.length;o<i;++o)s=t.getPixelForTick(o),l();return r}function nre(e,t,n,r){const o=n.barThickness;let i,s;return ct(o)?(i=t.min*n.categoryPercentage,s=n.barPercentage):(i=o*r,s=1),{chunk:i/r,ratio:s,start:t.pixels[e]-i/2}}function rre(e,t,n,r){const o=t.pixels,i=o[e];let s=e>0?o[e-1]:null,a=e<o.length-1?o[e+1]:null;const l=n.categoryPercentage;s===null&&(s=i-(a===null?t.end-t.start:a-i)),a===null&&(a=i+i-s);const c=i-(i-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/r,ratio:n.barPercentage,start:c}}function ore(e,t,n,r){const o=n.parse(e[0],r),i=n.parse(e[1],r),s=Math.min(o,i),a=Math.max(o,i);let l=s,c=a;Math.abs(s)>Math.abs(a)&&(l=a,c=s),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:o,end:i,min:s,max:a}}function sF(e,t,n,r){return un(e)?ore(e,t,n,r):t[n.axis]=n.parse(e,r),t}function PA(e,t,n,r){const o=e.iScale,i=e.vScale,s=o.getLabels(),a=o===i,l=[];let c,u,d,p;for(c=n,u=n+r;c<u;++c)p=t[c],d={},d[o.axis]=a||o.parse(s[c],c),l.push(sF(p,d,i,c));return l}function $x(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function ire(e,t,n){return e!==0?Yi(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function sre(e){let t,n,r,o,i;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(o="end",i="start"):(o="start",i="end"),{start:n,end:r,reverse:t,top:o,bottom:i}}function are(e,t,n,r){let o=t.borderSkipped;const i={};if(!o){e.borderSkipped=i;return}if(o===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:a,reverse:l,top:c,bottom:u}=sre(e);o==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=c:(n._bottom||0)===r?o=u:(i[TA(u,s,a,l)]=!0,o=c)),i[TA(o,s,a,l)]=!0,e.borderSkipped=i}function TA(e,t,n,r){return r?(e=lre(e,t,n),e=kA(e,n,t)):e=kA(e,t,n),e}function lre(e,t,n){return e===t?n:e===n?t:e}function kA(e,t,n){return e==="start"?t:e==="end"?n:e}function cre(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Um extends ti{parsePrimitiveData(t,n,r,o){return PA(t,n,r,o)}parseArrayData(t,n,r,o){return PA(t,n,r,o)}parseObjectData(t,n,r,o){const{iScale:i,vScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=i.axis==="x"?a:l,u=s.axis==="x"?a:l,d=[];let p,h,m,b;for(p=r,h=r+o;p<h;++p)b=n[p],m={},m[i.axis]=i.parse(Fa(b,c),p),d.push(sF(Fa(b,u),m,s,p));return d}updateRangeFromParsed(t,n,r,o){super.updateRangeFromParsed(t,n,r,o);const i=r._custom;i&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,i.min),t.max=Math.max(t.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:o}=n,i=this.getParsed(t),s=i._custom,a=$x(s)?"["+s.start+", "+s.end+"]":""+o.getLabelForValue(i[o.axis]);return{label:""+r.getLabelForValue(i[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,o){const i=o==="reset",{index:s,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:p}=this._getSharedOptions(n,o);for(let h=n;h<n+r;h++){const m=this.getParsed(h),b=i||ct(m[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),v=this._calculateBarIndexPixels(h,u),x=(m._stacks||{})[a.axis],w={horizontal:c,base:b.base,enableBorderRadius:!x||$x(m._custom)||s===x._top||s===x._bottom,x:c?b.head:v.center,y:c?v.center:b.head,height:c?v.size:Math.abs(b.size),width:c?Math.abs(b.size):v.size};p&&(w.options=d||this.resolveDataElementOptions(h,t[h].active?"active":o));const _=w.options||t[h].options;are(w,_,x,s),cre(w,_,u.ratio),this.updateElement(t[h],h,w,o)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,o=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),i=r.options.stacked,s=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[r.axis],c=u=>{const d=u._parsed.find(h=>h[r.axis]===l),p=d&&d[u.vScale.axis];if(ct(p)||isNaN(p))return!0};for(const u of o)if(!(n!==void 0&&c(u))&&((i===!1||s.indexOf(u.stack)===-1||i===void 0&&u.stack===void 0)&&s.push(u.stack),u.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const o=this._getStacks(t,r),i=n!==void 0?o.indexOf(n):-1;return i===-1?o.length-1:i}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,o=[];let i,s;for(i=0,s=n.data.length;i<s;++i)o.push(r.getPixelForValue(this.getParsed(i)[r.axis],i));const a=t.barThickness;return{min:a||tre(n),pixels:o,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:o},options:{base:i,minBarLength:s}}=this,a=i||0,l=this.getParsed(t),c=l._custom,u=$x(c);let d=l[n.axis],p=0,h=r?this.applyStack(n,l,r):d,m,b;h!==d&&(p=h-d,h=d),u&&(d=c.barStart,h=c.barEnd-c.barStart,d!==0&&Yi(d)!==Yi(c.barEnd)&&(p=0),p+=d);const v=!ct(i)&&!u?i:p;let x=n.getPixelForValue(v);if(this.chart.getDataVisibility(t)?m=n.getPixelForValue(p+h):m=x,b=m-x,Math.abs(b)<s){b=ire(b,n,a)*s,d===a&&(x-=b/2);const w=n.getPixelForDecimal(0),_=n.getPixelForDecimal(1),R=Math.min(w,_),C=Math.max(w,_);x=Math.max(Math.min(x,C),R),m=x+b,r&&!u&&(l._stacks[n.axis]._visualValues[o]=n.getValueForPixel(m)-n.getValueForPixel(x))}if(x===n.getPixelForValue(a)){const w=Yi(b)*n.getLineWidthForValue(a)/2;x+=w,b-=w}return{size:b,base:x,head:m,center:m+b/2}}_calculateBarIndexPixels(t,n){const r=n.scale,o=this.options,i=o.skipNull,s=Je(o.maxBarThickness,1/0);let a,l;if(n.grouped){const c=i?this._getStackCount(t):n.stackCount,u=o.barThickness==="flex"?rre(t,n,o,c):nre(t,n,o,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,i?t:void 0);a=u.start+u.chunk*d+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,o=r.length;let i=0;for(;i<o;++i)this.getParsed(i)[n.axis]!==null&&!r[i].hidden&&r[i].draw(this._ctx)}}Te(Um,"id","bar"),Te(Um,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Te(Um,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Gm extends ti{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,o){const i=super.parsePrimitiveData(t,n,r,o);for(let s=0;s<i.length;s++)i[s]._custom=this.resolveDataElementOptions(s+r).radius;return i}parseArrayData(t,n,r,o){const i=super.parseArrayData(t,n,r,o);for(let s=0;s<i.length;s++){const a=n[r+s];i[s]._custom=Je(a[2],this.resolveDataElementOptions(s+r).radius)}return i}parseObjectData(t,n,r,o){const i=super.parseObjectData(t,n,r,o);for(let s=0;s<i.length;s++){const a=n[r+s];i[s]._custom=Je(a&&a.r&&+a.r,this.resolveDataElementOptions(s+r).radius)}return i}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:o,yScale:i}=n,s=this.getParsed(t),a=o.getLabelForValue(s.x),l=i.getLabelForValue(s.y),c=s._custom;return{label:r[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,o),u=s.axis,d=a.axis;for(let p=n;p<n+r;p++){const h=t[p],m=!i&&this.getParsed(p),b={},v=b[u]=i?s.getPixelForDecimal(.5):s.getPixelForValue(m[u]),x=b[d]=i?a.getBasePixel():a.getPixelForValue(m[d]);b.skip=isNaN(v)||isNaN(x),c&&(b.options=l||this.resolveDataElementOptions(p,h.active?"active":o),i&&(b.options.radius=0)),this.updateElement(h,p,b,o)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let o=super.resolveDataElementOptions(t,n);o.$shared&&(o=Object.assign({},o,{$shared:!1}));const i=o.radius;return n!=="active"&&(o.radius=0),o.radius+=Je(r&&r._custom,i),o}}Te(Gm,"id","bubble"),Te(Gm,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Te(Gm,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function ure(e,t,n){let r=1,o=1,i=0,s=0;if(t<dn){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),p=Math.sin(l),h=(_,R,C)=>wh(_,a,l,!0)?1:Math.max(R,R*n,C,C*n),m=(_,R,C)=>wh(_,a,l,!0)?-1:Math.min(R,R*n,C,C*n),b=h(0,c,d),v=h(kn,u,p),x=m(hn,c,d),w=m(hn+kn,u,p);r=(b-x)/2,o=(v-w)/2,i=-(b+x)/2,s=-(v+w)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:s}}class Il extends ti{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,o=this._cachedMeta;if(this._parsing===!1)o._parsed=r;else{let i=l=>+r[l];if(Ct(r[t])){const{key:l="value"}=this._parsing;i=c=>+Fa(r[c],l)}let s,a;for(s=t,a=t+n;s<a;++s)o._parsed[s]=i(s)}}_getRotation(){return vi(this.options.rotation-90)}_getCircumference(){return vi(this.options.circumference)}_getRotationExtents(){let t=dn,n=-dn;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const o=this.chart.getDatasetMeta(r).controller,i=o._getRotation(),s=o._getCircumference();t=Math.min(t,i),n=Math.max(n,i+s)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,o=this._cachedMeta,i=o.data,s=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(_te(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:p,ratioY:h,offsetX:m,offsetY:b}=ure(d,u,l),v=(r.width-s)/p,x=(r.height-s)/h,w=Math.max(Math.min(v,x)/2,0),_=DL(this.options.radius,w),R=Math.max(_*l,0),C=(_-R)/this._getVisibleDatasetWeightTotal();this.offsetX=m*_,this.offsetY=b*_,o.total=this.calculateTotal(),this.outerRadius=_-C*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-C*c,0),this.updateElements(i,0,i.length,t)}_circumference(t,n){const r=this.options,o=this._cachedMeta,i=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||o._parsed[t]===null||o.data[t].hidden?0:this.calculateCircumference(o._parsed[t]*i/dn)}updateElements(t,n,r,o){const i=o==="reset",s=this.chart,a=s.chartArea,c=s.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,p=i&&c.animateScale,h=p?0:this.innerRadius,m=p?0:this.outerRadius,{sharedOptions:b,includeOptions:v}=this._getSharedOptions(n,o);let x=this._getRotation(),w;for(w=0;w<n;++w)x+=this._circumference(w,i);for(w=n;w<n+r;++w){const _=this._circumference(w,i),R=t[w],C={x:u+this.offsetX,y:d+this.offsetY,startAngle:x,endAngle:x+_,circumference:_,outerRadius:m,innerRadius:h};v&&(C.options=b||this.resolveDataElementOptions(w,R.active?"active":o)),x+=_,this.updateElement(R,w,C,o)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,o;for(o=0;o<n.length;o++){const i=t._parsed[o];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(o)&&!n[o].hidden&&(r+=Math.abs(i))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?dn*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=up(n._parsed[t],r.options.locale);return{label:o[t]||"",value:i}}getMaxBorderWidth(t){let n=0;const r=this.chart;let o,i,s,a,l;if(!t){for(o=0,i=r.data.datasets.length;o<i;++o)if(r.isDatasetVisible(o)){s=r.getDatasetMeta(o),t=s.data,a=s.controller;break}}if(!t)return 0;for(o=0,i=t.length;o<i;++o)l=a.resolveDataElementOptions(o),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,o=t.length;r<o;++r){const i=this.resolveDataElementOptions(r);n=Math.max(n,i.offset||0,i.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(Je(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Te(Il,"id","doughnut"),Te(Il,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),Te(Il,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Te(Il,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:o}}=t.legend.options;return n.labels.map((i,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:o,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class qm extends ti{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:o=[],_dataset:i}=n,s=this.chart._animationsDisabled;let{start:a,count:l}=HL(n,o,s);this._drawStart=a,this._drawCount=l,VL(n)&&(a=0,l=o.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!i._decimated,r.points=o;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t),this.updateElements(o,a,l,t)}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,o),p=s.axis,h=a.axis,{spanGaps:m,segment:b}=this.options,v=nd(m)?m:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||i||o==="none",w=n+r,_=t.length;let R=n>0&&this.getParsed(n-1);for(let C=0;C<_;++C){const E=t[C],A=x?E:{};if(C<n||C>=w){A.skip=!0;continue}const M=this.getParsed(C),N=ct(M[h]),L=A[p]=s.getPixelForValue(M[p],C),F=A[h]=i||N?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[h],C);A.skip=isNaN(L)||isNaN(F)||N,A.stop=C>0&&Math.abs(M[p]-R[p])>v,b&&(A.parsed=M,A.raw=c.data[C]),d&&(A.options=u||this.resolveDataElementOptions(C,E.active?"active":o)),x||this.updateElement(E,C,A,o),R=M}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,o=t.data||[];if(!o.length)return r;const i=o[0].size(this.resolveDataElementOptions(0)),s=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(r,i,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Te(qm,"id","line"),Te(qm,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Te(qm,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Zf extends ti{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=up(n._parsed[t].r,r.options.locale);return{label:o[t]||"",value:i}}parseObjectData(t,n,r,o){return QL.bind(this)(t,n,r,o)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,o)=>{const i=this.getParsed(o).r;!isNaN(i)&&this.chart.getDataVisibility(o)&&(i<n.min&&(n.min=i),i>n.max&&(n.max=i))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,o=Math.min(n.right-n.left,n.bottom-n.top),i=Math.max(o/2,0),s=Math.max(r.cutoutPercentage?i/100*r.cutoutPercentage:1,0),a=(i-s)/t.getVisibleDatasetCount();this.outerRadius=i-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,o){const i=o==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,p=c.getIndexAngle(0)-.5*hn;let h=p,m;const b=360/this.countVisibleElements();for(m=0;m<n;++m)h+=this._computeAngle(m,o,b);for(m=n;m<n+r;m++){const v=t[m];let x=h,w=h+this._computeAngle(m,o,b),_=s.getDataVisibility(m)?c.getDistanceFromCenterForValue(this.getParsed(m).r):0;h=w,i&&(l.animateScale&&(_=0),l.animateRotate&&(x=w=p));const R={x:u,y:d,innerRadius:0,outerRadius:_,startAngle:x,endAngle:w,options:this.resolveDataElementOptions(m,v.active?"active":o)};this.updateElement(v,m,R,o)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,o)=>{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?vi(this.resolveDataElementOptions(t,n).angle||r):0}}Te(Zf,"id","polarArea"),Te(Zf,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Te(Zf,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:o}}=t.legend.options;return n.labels.map((i,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:o,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class tS extends Il{}Te(tS,"id","pie"),Te(tS,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Ym extends ti{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,o){return QL.bind(this)(t,n,r,o)}update(t){const n=this._cachedMeta,r=n.dataset,o=n.data||[],i=n.iScale.getLabels();if(r.points=o,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const a={_loop:!0,_fullLoop:i.length===o.length,options:s};this.updateElement(r,void 0,a,t)}this.updateElements(o,0,o.length,t)}updateElements(t,n,r,o){const i=this._cachedMeta.rScale,s=o==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":o),u=i.getPointPositionForValue(a,this.getParsed(a).r),d=s?i.xCenter:u.x,p=s?i.yCenter:u.y,h={x:d,y:p,angle:u.angle,skip:isNaN(d)||isNaN(p),options:c};this.updateElement(l,a,h,o)}}}Te(Ym,"id","radar"),Te(Ym,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Te(Ym,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Km extends ti{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:o,yScale:i}=n,s=this.getParsed(t),a=o.getLabelForValue(s.x),l=i.getLabelForValue(s.y);return{label:r[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,o=this.chart._animationsDisabled;let{start:i,count:s}=HL(n,r,o);if(this._drawStart=i,this._drawCount=s,VL(n)&&(i=0,s=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!o,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,i,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,o),d=this.getSharedOptions(u),p=this.includeOptions(o,d),h=s.axis,m=a.axis,{spanGaps:b,segment:v}=this.options,x=nd(b)?b:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||i||o==="none";let _=n>0&&this.getParsed(n-1);for(let R=n;R<n+r;++R){const C=t[R],E=this.getParsed(R),A=w?C:{},M=ct(E[m]),N=A[h]=s.getPixelForValue(E[h],R),L=A[m]=i||M?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,E,l):E[m],R);A.skip=isNaN(N)||isNaN(L)||M,A.stop=R>0&&Math.abs(E[h]-_[h])>x,v&&(A.parsed=E,A.raw=c.data[R]),p&&(A.options=d||this.resolveDataElementOptions(R,C.active?"active":o)),w||this.updateElement(C,R,A,o),_=E}this.updateSharedOptions(d,o,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const r=t.dataset,o=r.options&&r.options.borderWidth||0;if(!n.length)return o;const i=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(o,i,s)/2}}Te(Km,"id","scatter"),Te(Km,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Te(Km,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var dre=Object.freeze({__proto__:null,BarController:Um,BubbleController:Gm,DoughnutController:Il,LineController:qm,PieController:tS,PolarAreaController:Zf,RadarController:Ym,ScatterController:Km});function bl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class iE{constructor(t){Te(this,"options");this.options=t||{}}static override(t){Object.assign(iE.prototype,t)}init(){}formats(){return bl()}parse(){return bl()}format(){return bl()}add(){return bl()}diff(){return bl()}startOf(){return bl()}endOf(){return bl()}}var fre={_date:iE};function hre(e,t,n,r){const{controller:o,data:i,_sorted:s}=e,a=o._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&s&&i.length){const c=a._reversePixels?Lte:Hs;if(r){if(o._sharedOptions){const u=i[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const p=c(i,t,n-d),h=c(i,t,n+d);return{lo:p.lo,hi:h.hi}}}}else{const u=c(i,t,n);if(l){const{vScale:d}=o._cachedMeta,{_parsed:p}=e,h=p.slice(0,u.lo+1).reverse().findIndex(b=>!ct(b[d.axis]));u.lo-=Math.max(0,h);const m=p.slice(u.hi).findIndex(b=>!ct(b[d.axis]));u.hi+=Math.max(0,m)}return u}}return{lo:0,hi:i.length-1}}function Y0(e,t,n,r,o){const i=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=i.length;a<l;++a){const{index:c,data:u}=i[a],{lo:d,hi:p}=hre(i[a],t,s,o);for(let h=d;h<=p;++h){const m=u[h];m.skip||r(m,c,h)}}}function pre(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,o){const i=t?Math.abs(r.x-o.x):0,s=n?Math.abs(r.y-o.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(s,2))}}function zx(e,t,n,r,o){const i=[];return!o&&!e.isPointInArea(t)||Y0(e,n,t,function(a,l,c){!o&&!Vs(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&i.push({element:a,datasetIndex:l,index:c})},!0),i}function gre(e,t,n,r){let o=[];function i(s,a,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:d}=FL(s,{x:t.x,y:t.y});wh(d,c,u)&&o.push({element:s,datasetIndex:a,index:l})}return Y0(e,n,t,i),o}function mre(e,t,n,r,o,i){let s=[];const a=pre(n);let l=Number.POSITIVE_INFINITY;function c(u,d,p){const h=u.inRange(t.x,t.y,o);if(r&&!h)return;const m=u.getCenterPoint(o);if(!(!!i||e.isPointInArea(m))&&!h)return;const v=a(t,m);v<l?(s=[{element:u,datasetIndex:d,index:p}],l=v):v===l&&s.push({element:u,datasetIndex:d,index:p})}return Y0(e,n,t,c),s}function Bx(e,t,n,r,o,i){return!i&&!e.isPointInArea(t)?[]:n==="r"&&!r?gre(e,t,n,o):mre(e,t,n,r,o,i)}function AA(e,t,n,r,o){const i=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return Y0(e,n,t,(l,c,u)=>{l[s]&&l[s](t[n],o)&&(i.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,o))}),r&&!a?[]:i}var bre={modes:{index(e,t,n,r){const o=Sl(t,e),i=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?zx(e,o,i,r,s):Bx(e,o,i,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const o=Sl(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?zx(e,o,i,r,s):Bx(e,o,i,!1,r,s);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,r){const o=Sl(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return zx(e,o,i,r,s)},nearest(e,t,n,r){const o=Sl(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return Bx(e,o,i,n.intersect,r,s)},x(e,t,n,r){const o=Sl(t,e);return AA(e,o,"x",n.intersect,r)},y(e,t,n,r){const o=Sl(t,e);return AA(e,o,"y",n.intersect,r)}}};const aF=["left","top","right","bottom"];function uf(e,t){return e.filter(n=>n.pos===t)}function OA(e,t){return e.filter(n=>aF.indexOf(n.pos)===-1&&n.box.axis===t)}function df(e,t){return e.sort((n,r)=>{const o=t?r:n,i=t?n:r;return o.weight===i.weight?o.index-i.index:o.weight-i.weight})}function yre(e){const t=[];let n,r,o,i,s,a;for(n=0,r=(e||[]).length;n<r;++n)o=e[n],{position:i,options:{stack:s,stackWeight:a=1}}=o,t.push({index:n,box:o,pos:i,horizontal:o.isHorizontal(),weight:o.weight,stack:s&&i+s,stackWeight:a});return t}function vre(e){const t={};for(const n of e){const{stack:r,pos:o,stackWeight:i}=n;if(!r||!aF.includes(o))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=i}return t}function xre(e,t){const n=vre(e),{vBoxMaxWidth:r,hBoxMaxHeight:o}=t;let i,s,a;for(i=0,s=e.length;i<s;++i){a=e[i];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*r:l&&t.availableWidth,a.height=o):(a.width=r,a.height=u?u*o:l&&t.availableHeight)}return n}function wre(e){const t=yre(e),n=df(t.filter(c=>c.box.fullSize),!0),r=df(uf(t,"left"),!0),o=df(uf(t,"right")),i=df(uf(t,"top"),!0),s=df(uf(t,"bottom")),a=OA(t,"x"),l=OA(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(s).concat(a),chartArea:uf(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(s).concat(a)}}function MA(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function lF(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Sre(e,t,n,r){const{pos:o,box:i}=n,s=e.maxPadding;if(!Ct(o)){n.size&&(e[o]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?i.height:i.width),n.size=d.size/d.count,e[o]+=n.size}i.getPadding&&lF(s,i.getPadding());const a=Math.max(0,t.outerWidth-MA(s,e,"left","right")),l=Math.max(0,t.outerHeight-MA(s,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function _re(e){const t=e.maxPadding;function n(r){const o=Math.max(t[r]-e[r],0);return e[r]+=o,o}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Cre(e,t){const n=t.maxPadding;function r(o){const i={left:0,top:0,right:0,bottom:0};return o.forEach(s=>{i[s]=Math.max(t[s],n[s])}),i}return r(e?["left","right"]:["top","bottom"])}function Nf(e,t,n,r){const o=[];let i,s,a,l,c,u;for(i=0,s=e.length,c=0;i<s;++i){a=e[i],l=a.box,l.update(a.width||t.w,a.height||t.h,Cre(a.horizontal,t));const{same:d,other:p}=Sre(t,n,a,r);c|=d&&o.length,u=u||p,l.fullSize||o.push(a)}return c&&Nf(o,t,n,r)||u}function Qg(e,t,n,r,o){e.top=n,e.left=t,e.right=t+r,e.bottom=n+o,e.width=r,e.height=o}function IA(e,t,n,r){const o=n.padding;let{x:i,y:s}=t;for(const a of e){const l=a.box,c=r[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,p=c.size||l.height;xh(c.start)&&(s=c.start),l.fullSize?Qg(l,o.left,s,n.outerWidth-o.right-o.left,p):Qg(l,t.left+c.placed,s,d,p),c.start=s,c.placed+=d,s=l.bottom}else{const d=t.h*u,p=c.size||l.width;xh(c.start)&&(i=c.start),l.fullSize?Qg(l,i,o.top,p,n.outerHeight-o.bottom-o.top):Qg(l,i,t.top+c.placed,p,d),c.start=i,c.placed+=d,i=l.right}}t.x=i,t.y=s}var yr={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const o=ir(e.options.layout.padding),i=Math.max(t-o.width,0),s=Math.max(n-o.height,0),a=wre(e.boxes),l=a.vertical,c=a.horizontal;Ht(e.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=l.reduce((b,v)=>v.box.options&&v.box.options.display===!1?b:b+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:i,availableHeight:s,vBoxMaxWidth:i/2/u,hBoxMaxHeight:s/2}),p=Object.assign({},o);lF(p,ir(r));const h=Object.assign({maxPadding:p,w:i,h:s,x:o.left,y:o.top},o),m=xre(l.concat(c),d);Nf(a.fullSize,h,d,m),Nf(l,h,d,m),Nf(c,h,d,m)&&Nf(l,h,d,m),_re(h),IA(a.leftAndTop,h,d,m),h.x+=h.w,h.y+=h.h,IA(a.rightAndBottom,h,d,m),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Ht(a.chartArea,b=>{const v=b.box;Object.assign(v,e.chartArea),v.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class cF{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,o){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,o?Math.floor(n/o):r)}}isAttached(t){return!0}updateConfig(t){}}class Ere extends cF{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Xm="$chartjs",Rre={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},DA=e=>e===null||e==="";function Pre(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[Xm]={initial:{height:r,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",DA(o)){const i=bA(e,"width");i!==void 0&&(e.width=i)}if(DA(r))if(e.style.height==="")e.height=e.width/(t||2);else{const i=bA(e,"height");i!==void 0&&(e.height=i)}return e}const uF=kne?{passive:!0}:!1;function Tre(e,t,n){e&&e.addEventListener(t,n,uF)}function kre(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,uF)}function Are(e,t){const n=Rre[e.type]||e.type,{x:r,y:o}=Sl(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:o!==void 0?o:null}}function Rb(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Ore(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||Rb(a.addedNodes,r),s=s&&!Rb(a.removedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function Mre(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||Rb(a.removedNodes,r),s=s&&!Rb(a.addedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const _h=new Map;let NA=0;function dF(){const e=window.devicePixelRatio;e!==NA&&(NA=e,_h.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Ire(e,t){_h.size||window.addEventListener("resize",dF),_h.set(e,t)}function Dre(e){_h.delete(e),_h.size||window.removeEventListener("resize",dF)}function Nre(e,t,n){const r=e.canvas,o=r&&oE(r);if(!o)return;const i=BL((a,l)=>{const c=o.clientWidth;n(a,l),c<o.clientWidth&&n()},window),s=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||i(c,u)});return s.observe(o),Ire(e,i),s}function Hx(e,t,n){n&&n.disconnect(),t==="resize"&&Dre(e)}function Lre(e,t,n){const r=e.canvas,o=BL(i=>{e.ctx!==null&&n(Are(i,e))},e);return Tre(r,t,o),o}class Fre extends cF{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(Pre(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Xm])return!1;const r=n[Xm].initial;["height","width"].forEach(i=>{const s=r[i];ct(s)?n.removeAttribute(i):n.setAttribute(i,s)});const o=r.style||{};return Object.keys(o).forEach(i=>{n.style[i]=o[i]}),n.width=n.width,delete n[Xm],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const o=t.$proxies||(t.$proxies={}),s={attach:Ore,detach:Mre,resize:Nre}[n]||Lre;o[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),o=r[n];if(!o)return;({attach:Hx,detach:Hx,resize:Hx}[n]||kre)(t,n,o),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,o){return Tne(t,n,r,o)}isAttached(t){const n=t&&oE(t);return!!(n&&n.isConnected)}}function jre(e){return!rE()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Ere:Fre}var Wm;let us=(Wm=class{constructor(){Te(this,"x");Te(this,"y");Te(this,"active",!1);Te(this,"options");Te(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return nd(this.x)&&nd(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const o={};return t.forEach(i=>{o[i]=r[i]&&r[i].active()?r[i]._to:this[i]}),o}},Te(Wm,"defaults",{}),Te(Wm,"defaultRoutes"),Wm);function $re(e,t){const n=e.options.ticks,r=zre(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?Hre(t):[],s=i.length,a=i[0],l=i[s-1],c=[];if(s>o)return Vre(t,c,i,s/o),c;const u=Bre(i,t,o);if(s>0){let d,p;const h=s>1?Math.round((l-a)/(s-1)):null;for(Zg(t,c,u,ct(h)?0:a-h,a),d=0,p=s-1;d<p;d++)Zg(t,c,u,i[d],i[d+1]);return Zg(t,c,u,l,ct(h)?t.length:l+h),c}return Zg(t,c,u),c}function zre(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),o=e._maxLength/n;return Math.floor(Math.min(r,o))}function Bre(e,t,n){const r=Wre(e),o=t.length/n;if(!r)return Math.max(o,1);const i=Ote(r);for(let s=0,a=i.length-1;s<a;s++){const l=i[s];if(l>o)return l}return Math.max(o,1)}function Hre(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function Vre(e,t,n,r){let o=0,i=n[0],s;for(r=Math.ceil(r),s=0;s<e.length;s++)s===i&&(t.push(e[s]),o++,i=n[o*r])}function Zg(e,t,n,r,o){const i=Je(r,0),s=Math.min(Je(o,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),o&&(l=o-r,n=l/Math.floor(l/n)),u=i;u<0;)a++,u=Math.round(i+a*n);for(c=Math.max(i,0);c<s;c++)c===u&&(t.push(e[c]),a++,u=Math.round(i+a*n))}function Wre(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const Ure=e=>e==="left"?"right":e==="right"?"left":e,LA=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,FA=(e,t)=>Math.min(t||e,e);function jA(e,t){const n=[],r=e.length/t,o=e.length;let i=0;for(;i<o;i+=r)n.push(e[Math.floor(i)]);return n}function Gre(e,t,n){const r=e.ticks.length,o=Math.min(t,r-1),i=e._startPixel,s=e._endPixel,a=1e-6;let l=e.getPixelForTick(o),c;if(!(n&&(r===1?c=Math.max(l-i,s-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(o-1))/2,l+=o<t?c:-c,l<i-a||l>s+a)))return l}function qre(e,t){Ht(e,n=>{const r=n.gc,o=r.length/2;let i;if(o>t){for(i=0;i<o;++i)delete n.data[r[i]];r.splice(0,o)}})}function ff(e){return e.drawTicks?e.tickLength:0}function $A(e,t){if(!e.display)return 0;const n=Dn(e.font,t),r=ir(e.padding);return(un(e.text)?e.text.length:1)*n.lineHeight+r.height}function Yre(e,t){return Ka(e,{scale:t,type:"scale"})}function Kre(e,t,n){return Ka(e,{tick:n,index:t,type:"tick"})}function Xre(e,t,n){let r=QC(e);return(n&&t!=="right"||!n&&t==="right")&&(r=Ure(r)),r}function Qre(e,t,n,r){const{top:o,left:i,bottom:s,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,p,h,m;const b=s-o,v=a-i;if(e.isHorizontal()){if(h=gr(r,i,a),Ct(n)){const x=Object.keys(n)[0],w=n[x];m=u[x].getPixelForValue(w)+b-t}else n==="center"?m=(c.bottom+c.top)/2+b-t:m=LA(e,n,t);p=a-i}else{if(Ct(n)){const x=Object.keys(n)[0],w=n[x];h=u[x].getPixelForValue(w)-v+t}else n==="center"?h=(c.left+c.right)/2-v+t:h=LA(e,n,t);m=gr(r,s,o),d=n==="left"?-kn:kn}return{titleX:h,titleY:m,maxWidth:p,rotation:d}}class Xa extends us{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:o}=this;return t=_o(t,Number.POSITIVE_INFINITY),n=_o(n,Number.NEGATIVE_INFINITY),r=_o(r,Number.POSITIVE_INFINITY),o=_o(o,Number.NEGATIVE_INFINITY),{min:_o(t,r),max:_o(n,o),minDefined:En(t),maxDefined:En(n)}}getMinMax(t){let{min:n,max:r,minDefined:o,maxDefined:i}=this.getUserBounds(),s;if(o&&i)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)s=a[l].controller.getMinMax(this,t),o||(n=Math.min(n,s.min)),i||(r=Math.max(r,s.max));return n=i&&n>r?r:n,r=o&&n>r?n:r,{min:_o(n,_o(r,n)),max:_o(r,_o(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Xt(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:o,grace:i,ticks:s}=this.options,a=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=sne(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?jA(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=$re(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Xt(this.options.afterUpdate,[this])}beforeSetDimensions(){Xt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Xt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Xt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Xt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,o,i;for(r=0,o=t.length;r<o;r++)i=t[r],i.label=Xt(n.callback,[i.value,r,t],this)}afterTickToLabelConversion(){Xt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Xt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=FA(this.ticks.length,t.ticks.maxTicksLimit),o=n.minRotation||0,i=n.maxRotation;let s=o,a,l,c;if(!this._isVisible()||!n.display||o>=i||r<=1||!this.isHorizontal()){this.labelRotation=o;return}const u=this._getLabelSizes(),d=u.widest.width,p=u.highest.height,h=Xn(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:h/(r-1),d+6>a&&(a=h/(r-(t.offset?.5:1)),l=this.maxHeight-ff(t.grid)-n.padding-$A(t.title,this.chart.options.font),c=Math.sqrt(d*d+p*p),s=KC(Math.min(Math.asin(Xn((u.highest.height+6)/a,-1,1)),Math.asin(Xn(l/c,-1,1))-Math.asin(Xn(p/c,-1,1)))),s=Math.max(o,Math.min(i,s))),this.labelRotation=s}afterCalculateLabelRotation(){Xt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Xt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:o,grid:i}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=$A(o,n.options.font);if(a?(t.width=this.maxWidth,t.height=ff(i)+l):(t.height=this.maxHeight,t.width=ff(i)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:p}=this._getLabelSizes(),h=r.padding*2,m=vi(this.labelRotation),b=Math.cos(m),v=Math.sin(m);if(a){const x=r.mirror?0:v*d.width+b*p.height;t.height=Math.min(this.maxHeight,t.height+x+h)}else{const x=r.mirror?0:b*d.width+v*p.height;t.width=Math.min(this.maxWidth,t.width+x+h)}this._calculatePadding(c,u,v,b)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,o){const{ticks:{align:i,padding:s},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let p=0,h=0;l?c?(p=o*t.width,h=r*n.height):(p=r*t.height,h=o*n.width):i==="start"?h=n.width:i==="end"?p=t.width:i!=="inner"&&(p=t.width/2,h=n.width/2),this.paddingLeft=Math.max((p-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-d+s)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;i==="start"?(u=0,d=t.height):i==="end"&&(u=n.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Xt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)ct(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=jA(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:o,_longestTextCache:i}=this,s=[],a=[],l=Math.floor(n/FA(n,r));let c=0,u=0,d,p,h,m,b,v,x,w,_,R,C;for(d=0;d<n;d+=l){if(m=t[d].label,b=this._resolveTickFontOptions(d),o.font=v=b.string,x=i[v]=i[v]||{data:{},gc:[]},w=b.lineHeight,_=R=0,!ct(m)&&!un(m))_=_b(o,x.data,x.gc,_,m),R=w;else if(un(m))for(p=0,h=m.length;p<h;++p)C=m[p],!ct(C)&&!un(C)&&(_=_b(o,x.data,x.gc,_,C),R+=w);s.push(_),a.push(R),c=Math.max(_,c),u=Math.max(R,u)}qre(i,n);const E=s.indexOf(c),A=a.indexOf(u),M=N=>({width:s[N]||0,height:a[N]||0});return{first:M(0),last:M(n-1),widest:M(E),highest:M(A),widths:s,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return Nte(this._alignToPixels?ml(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=Kre(this.getContext(),t,r))}return this.$context||(this.$context=Yre(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=vi(this.labelRotation),r=Math.abs(Math.cos(n)),o=Math.abs(Math.sin(n)),i=this._getLabelSizes(),s=t.autoSkipPadding||0,a=i?i.widest.width+s:0,l=i?i.highest.height+s:0;return this.isHorizontal()?l*r>a*o?a/r:l/o:l*o<a*r?l/r:a/o}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,o=this.options,{grid:i,position:s,border:a}=o,l=i.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),p=ff(i),h=[],m=a.setContext(this.getContext()),b=m.display?m.width:0,v=b/2,x=function(H){return ml(r,H,b)};let w,_,R,C,E,A,M,N,L,F,z,Z;if(s==="top")w=x(this.bottom),A=this.bottom-p,N=w-v,F=x(t.top)+v,Z=t.bottom;else if(s==="bottom")w=x(this.top),F=t.top,Z=x(t.bottom)-v,A=w+v,N=this.top+p;else if(s==="left")w=x(this.right),E=this.right-p,M=w-v,L=x(t.left)+v,z=t.right;else if(s==="right")w=x(this.left),L=t.left,z=x(t.right)-v,E=w+v,M=this.left+p;else if(n==="x"){if(s==="center")w=x((t.top+t.bottom)/2+.5);else if(Ct(s)){const H=Object.keys(s)[0],$=s[H];w=x(this.chart.scales[H].getPixelForValue($))}F=t.top,Z=t.bottom,A=w+v,N=A+p}else if(n==="y"){if(s==="center")w=x((t.left+t.right)/2);else if(Ct(s)){const H=Object.keys(s)[0],$=s[H];w=x(this.chart.scales[H].getPixelForValue($))}E=w-v,M=E-p,L=t.left,z=t.right}const G=Je(o.ticks.maxTicksLimit,d),j=Math.max(1,Math.ceil(d/G));for(_=0;_<d;_+=j){const H=this.getContext(_),$=i.setContext(H),V=a.setContext(H),X=$.lineWidth,I=$.color,q=V.dash||[],U=V.dashOffset,O=$.tickWidth,J=$.tickColor,K=$.tickBorderDash||[],ne=$.tickBorderDashOffset;R=Gre(this,_,l),R!==void 0&&(C=ml(r,R,X),c?E=M=L=z=C:A=N=F=Z=C,h.push({tx1:E,ty1:A,tx2:M,ty2:N,x1:L,y1:F,x2:z,y2:Z,width:X,color:I,borderDash:q,borderDashOffset:U,tickWidth:O,tickColor:J,tickBorderDash:K,tickBorderDashOffset:ne}))}return this._ticksLength=d,this._borderValue=w,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:o,ticks:i}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=i,p=ff(r.grid),h=p+u,m=d?-u:h,b=-vi(this.labelRotation),v=[];let x,w,_,R,C,E,A,M,N,L,F,z,Z="middle";if(o==="top")E=this.bottom-m,A=this._getXAxisLabelAlignment();else if(o==="bottom")E=this.top+m,A=this._getXAxisLabelAlignment();else if(o==="left"){const j=this._getYAxisLabelAlignment(p);A=j.textAlign,C=j.x}else if(o==="right"){const j=this._getYAxisLabelAlignment(p);A=j.textAlign,C=j.x}else if(n==="x"){if(o==="center")E=(t.top+t.bottom)/2+h;else if(Ct(o)){const j=Object.keys(o)[0],H=o[j];E=this.chart.scales[j].getPixelForValue(H)+h}A=this._getXAxisLabelAlignment()}else if(n==="y"){if(o==="center")C=(t.left+t.right)/2-h;else if(Ct(o)){const j=Object.keys(o)[0],H=o[j];C=this.chart.scales[j].getPixelForValue(H)}A=this._getYAxisLabelAlignment(p).textAlign}n==="y"&&(l==="start"?Z="top":l==="end"&&(Z="bottom"));const G=this._getLabelSizes();for(x=0,w=a.length;x<w;++x){_=a[x],R=_.label;const j=i.setContext(this.getContext(x));M=this.getPixelForTick(x)+i.labelOffset,N=this._resolveTickFontOptions(x),L=N.lineHeight,F=un(R)?R.length:1;const H=F/2,$=j.color,V=j.textStrokeColor,X=j.textStrokeWidth;let I=A;s?(C=M,A==="inner"&&(x===w-1?I=this.options.reverse?"left":"right":x===0?I=this.options.reverse?"right":"left":I="center"),o==="top"?c==="near"||b!==0?z=-F*L+L/2:c==="center"?z=-G.highest.height/2-H*L+L:z=-G.highest.height+L/2:c==="near"||b!==0?z=L/2:c==="center"?z=G.highest.height/2-H*L:z=G.highest.height-F*L,d&&(z*=-1),b!==0&&!j.showLabelBackdrop&&(C+=L/2*Math.sin(b))):(E=M,z=(1-F)*L/2);let q;if(j.showLabelBackdrop){const U=ir(j.backdropPadding),O=G.heights[x],J=G.widths[x];let K=z-U.top,ne=0-U.left;switch(Z){case"middle":K-=O/2;break;case"bottom":K-=O;break}switch(A){case"center":ne-=J/2;break;case"right":ne-=J;break;case"inner":x===w-1?ne-=J:x>0&&(ne-=J/2);break}q={left:ne,top:K,width:J+U.width,height:O+U.height,color:j.backdropColor}}v.push({label:R,font:N,textOffset:z,options:{rotation:b,color:$,strokeColor:V,strokeWidth:X,textAlign:I,textBaseline:Z,translation:[C,E],backdrop:q}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-vi(this.labelRotation))return t==="top"?"left":"right";let o="center";return n.align==="start"?o="left":n.align==="end"?o="right":n.align==="inner"&&(o="inner"),o}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:o,padding:i}}=this.options,s=this._getLabelSizes(),a=t+i,l=s.widest.width;let c,u;return n==="left"?o?(u=this.right+i,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?o?(u=this.left+i,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:o,width:i,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,o,i,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const o=this.ticks.findIndex(i=>i.value===t);return o>=0?n.setContext(this.getContext(o)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let i,s;const a=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(i=0,s=o.length;i<s;++i){const l=o[i];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:o}}=this,i=r.setContext(this.getContext()),s=r.display?i.width:0;if(!s)return;const a=o.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,p;this.isHorizontal()?(c=ml(t,this.left,s)-s/2,u=ml(t,this.right,a)+a/2,d=p=l):(d=ml(t,this.top,s)-s/2,p=ml(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,p),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,o=this._computeLabelArea();o&&Kl(r,o);const i=this.getLabelItems(t);for(const s of i){const a=s.options,l=s.font,c=s.label,u=s.textOffset;pc(r,c,0,u,l,a)}o&&Xl(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:o}}=this;if(!r.display)return;const i=Dn(r.font),s=ir(r.padding),a=r.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||Ct(n)?(l+=s.bottom,un(r.text)&&(l+=i.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:p}=Qre(this,l,n,a);pc(t,r.text,0,0,i,{color:r.color,maxWidth:d,rotation:p,textAlign:Xre(a,n,o),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=Je(t.grid&&t.grid.z,-1),o=Je(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Xa.prototype.draw?[{z:n,draw:i=>{this.draw(i)}}]:[{z:r,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:o,draw:()=>{this.drawBorder()}},{z:n,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",o=[];let i,s;for(i=0,s=n.length;i<s;++i){const a=n[i];a[r]===this.id&&(!t||a.type===t)&&o.push(a)}return o}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return Dn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Jg{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;eoe(n)&&(r=this.register(n));const o=this.items,i=t.id,s=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+t);return i in o||(o[i]=t,Zre(t,s,r),this.override&&fn.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,o=this.scope;r in n&&delete n[r],o&&r in fn[o]&&(delete fn[o][r],this.override&&delete hc[r])}}function Zre(e,t,n){const r=Qn(Object.create(null),[n?fn.get(n):{},fn.get(t),e.defaults]);fn.set(t,r),e.defaultRoutes&&Jre(t,e.defaultRoutes),e.descriptors&&fn.describe(t,e.descriptors)}function Jre(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),o=r.pop(),i=[e].concat(r).join("."),s=t[n].split("."),a=s.pop(),l=s.join(".");fn.route(i,o,l,a)})}function eoe(e){return"id"in e&&"defaults"in e}class toe{constructor(){this.controllers=new Jg(ti,"datasets",!0),this.elements=new Jg(us,"elements"),this.plugins=new Jg(Object,"plugins"),this.scales=new Jg(Xa,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(o=>{const i=r||this._getRegistryForType(o);r||i.isForType(o)||i===this.plugins&&o.id?this._exec(t,i,o):Ht(o,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const o=YC(t);Xt(r["before"+o],[],r),n[t](r),Xt(r["after"+o],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const o=n.get(t);if(o===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return o}}var Dr=new toe;class noe{constructor(){this._init=[]}notify(t,n,r,o){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const i=o?this._descriptors(t).filter(o):this._descriptors(t),s=this._notify(i,t,n,r);return n==="afterDestroy"&&(this._notify(i,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,n,r,o){o=o||{};for(const i of t){const s=i.plugin,a=s[r],l=[n,o,i.options];if(Xt(a,l,s)===!1&&o.cancelable)return!1}return!0}invalidate(){ct(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,o=Je(r.options&&r.options.plugins,{}),i=roe(r);return o===!1&&!n?[]:ioe(t,i,o,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,o=(i,s)=>i.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(o(n,r),t,"stop"),this._notify(o(r,n),t,"start")}}function roe(e){const t={},n=[],r=Object.keys(Dr.plugins.items);for(let i=0;i<r.length;i++)n.push(Dr.getPlugin(r[i]));const o=e.plugins||[];for(let i=0;i<o.length;i++){const s=o[i];n.indexOf(s)===-1&&(n.push(s),t[s.id]=!0)}return{plugins:n,localIds:t}}function ooe(e,t){return!t&&e===!1?null:e===!0?{}:e}function ioe(e,{plugins:t,localIds:n},r,o){const i=[],s=e.getContext();for(const a of t){const l=a.id,c=ooe(r[l],o);c!==null&&i.push({plugin:a,options:soe(e.config,{plugin:a,local:n[l]},c,s)})}return i}function soe(e,{plugin:t,local:n},r,o){const i=e.pluginScopeKeys(t),s=e.getOptionScopes(r,i);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,o,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function nS(e,t){const n=fn.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function aoe(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function loe(e,t){return e===t?"_index_":"_value_"}function zA(e){if(e==="x"||e==="y"||e==="r")return e}function coe(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function rS(e,...t){if(zA(e))return e;for(const n of t){const r=n.axis||coe(n.position)||e.length>1&&zA(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function BA(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function uoe(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return BA(e,"x",n[0])||BA(e,"y",n[0])}return{}}function doe(e,t){const n=hc[e.type]||{scales:{}},r=t.scales||{},o=nS(e.type,t),i=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!Ct(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=rS(s,a,uoe(s,e),fn.scales[a.type]),c=loe(l,o),u=n.scales||{};i[s]=Yf(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||nS(a,t),u=(hc[a]||{}).scales||{};Object.keys(u).forEach(d=>{const p=aoe(d,l),h=s[p+"AxisID"]||p;i[h]=i[h]||Object.create(null),Yf(i[h],[{axis:p},r[h],u[d]])})}),Object.keys(i).forEach(s=>{const a=i[s];Yf(a,[fn.scales[a.type],fn.scale])}),i}function fF(e){const t=e.options||(e.options={});t.plugins=Je(t.plugins,{}),t.scales=doe(e,t)}function hF(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function foe(e){return e=e||{},e.data=hF(e.data),fF(e),e}const HA=new Map,pF=new Set;function em(e,t){let n=HA.get(e);return n||(n=t(),HA.set(e,n),pF.add(n)),n}const hf=(e,t,n)=>{const r=Fa(t,n);r!==void 0&&e.add(r)};class hoe{constructor(t){this._config=foe(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=hF(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),fF(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return em(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return em(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return em(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return em(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let o=r.get(t);return(!o||n)&&(o=new Map,r.set(t,o)),o}getOptionScopes(t,n,r){const{options:o,type:i}=this,s=this._cachedScopes(t,r),a=s.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>hf(l,t,d))),u.forEach(d=>hf(l,o,d)),u.forEach(d=>hf(l,hc[i]||{},d)),u.forEach(d=>hf(l,fn,d)),u.forEach(d=>hf(l,eS,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),pF.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,hc[n]||{},fn.datasets[n]||{},{type:n},fn,eS]}resolveNamedOptions(t,n,r,o=[""]){const i={$shared:!0},{resolver:s,subPrefixes:a}=VA(this._resolverCache,t,o);let l=s;if(goe(s,n)){i.$shared=!1,r=ja(r)?r():r;const c=this.createResolver(t,r,a);l=rd(s,r,c)}for(const c of n)i[c]=l[c];return i}createResolver(t,n,r=[""],o){const{resolver:i}=VA(this._resolverCache,t,r);return Ct(n)?rd(i,n,void 0,o):i}}function VA(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const o=n.join();let i=r.get(o);return i||(i={resolver:eE(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(o,i)),i}const poe=e=>Ct(e)&&Object.getOwnPropertyNames(e).some(t=>ja(e[t]));function goe(e,t){const{isScriptable:n,isIndexable:r}=qL(e);for(const o of t){const i=n(o),s=r(o),a=(s||i)&&e[o];if(i&&(ja(a)||poe(a))||s&&un(a))return!0}return!1}var moe="4.4.8";const boe=["top","bottom","left","right","chartArea"];function WA(e,t){return e==="top"||e==="bottom"||boe.indexOf(e)===-1&&t==="x"}function UA(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function GA(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Xt(n&&n.onComplete,[e],t)}function yoe(e){const t=e.chart,n=t.options.animation;Xt(n&&n.onProgress,[e],t)}function gF(e){return rE()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Qm={},qA=e=>{const t=gF(e);return Object.values(Qm).filter(n=>n.canvas===t).pop()};function voe(e,t,n){const r=Object.keys(e);for(const o of r){const i=+o;if(i>=t){const s=e[o];delete e[o],(n>0||i>t)&&(e[i+n]=s)}}}function xoe(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function tm(e,t,n){return e.options.clip?e[n]:t[n]}function woe(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:tm(n,t,"left"),right:tm(n,t,"right"),top:tm(r,t,"top"),bottom:tm(r,t,"bottom")}:t}class yn{static register(...t){Dr.add(...t),YA()}static unregister(...t){Dr.remove(...t),YA()}constructor(t,n){const r=this.config=new hoe(n),o=gF(t),i=qA(o);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||jre(o)),this.platform.updateConfig(r);const a=this.platform.acquireContext(o,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Ste(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new noe,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=$te(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],Qm[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}As.listen(this,"complete",GA),As.listen(this,"progress",yoe),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:o,_aspectRatio:i}=this;return ct(t)?n&&i?i:o?r/o:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Dr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():mA(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return hA(this.canvas,this.ctx),this}stop(){return As.stop(this),this}resize(t,n){As.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,o=this.canvas,i=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(o,t,n,i),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,mA(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),Xt(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ht(n,(r,o)=>{r.id=o})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,o=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let i=[];n&&(i=i.concat(Object.keys(n).map(s=>{const a=n[s],l=rS(s,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Ht(i,s=>{const a=s.options,l=a.id,c=rS(l,a),u=Je(a.type,s.dtype);(a.position===void 0||WA(a.position,c)!==WA(s.dposition))&&(a.position=s.dposition),o[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const p=Dr.getScale(u);d=new p({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Ht(o,(s,a)=>{s||delete r[a]}),Ht(r,s=>{yr.configure(this,s,s.options),yr.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((o,i)=>o.index-i.index),r>n){for(let o=n;o<r;++o)this._destroyDatasetMeta(o);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(UA("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,o)=>{n.filter(i=>i===r._dataset).length===0&&this._destroyDatasetMeta(o)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,o;for(this._removeUnreferencedMetasets(),r=0,o=n.length;r<o;r++){const i=n[r];let s=this.getDatasetMeta(r);const a=i.type||this.config.type;if(s.type&&s.type!==a&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=a,s.indexAxis=i.indexAxis||nS(a,this.options),s.order=i.order||0,s.index=r,s.label=""+i.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=Dr.getController(a),{datasetElementType:c,dataElementType:u}=fn.datasets[a];Object.assign(l,{dataElementType:Dr.getElement(u),datasetElementType:c&&Dr.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){Ht(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),p=!o&&i.indexOf(d)===-1;d.buildOrUpdateElements(p),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),o||Ht(i,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(UA("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Ht(this.scales,t=>{yr.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!oA(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:o,count:i}of n){const s=r==="_removeElements"?-i:i;voe(t,o,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=i=>new Set(t.filter(s=>s[0]===i).map((s,a)=>a+","+s.splice(1).join(","))),o=r(0);for(let i=1;i<n;i++)if(!oA(o,r(i)))return;return Array.from(o).map(i=>i.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;yr.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ht(this.boxes,o=>{r&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,i)=>{o._idx=i}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,ja(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),o={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",o)!==!1&&(r.controller._update(n),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(As.has(this)?this.attached&&!As.running(this)&&As.start(this):(this.draw(),GA({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:o}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,o)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let o,i;for(o=0,i=n.length;o<i;++o){const s=n[o];(!t||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,o=!r.disabled,i=woe(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(o&&Kl(n,{left:r.left===!1?0:i.left-r.left,right:r.right===!1?this.width:i.right+r.right,top:r.top===!1?0:i.top-r.top,bottom:r.bottom===!1?this.height:i.bottom+r.bottom}),t.controller.draw(),o&&Xl(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Vs(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,o){const i=bre.modes[n];return typeof i=="function"?i(this,t,r,o):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let o=r.filter(i=>i&&i._dataset===n).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(o)),o}getContext(){return this.$context||(this.$context=Ka(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const o=r?"show":"hide",i=this.getDatasetMeta(t),s=i.controller._resolveAnimations(void 0,o);xh(n)?(i.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(i,{visible:r}),this.update(a=>a.datasetIndex===t?o:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),As.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),hA(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Qm[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(i,s)=>{n.addEventListener(this,i,s),t[i]=s},o=(i,s,a)=>{i.offsetX=s,i.offsetY=a,this._eventHandler(i)};Ht(this.options.events,i=>r(i,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},o=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},i=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{o("attach",a),this.attached=!0,this.resize(),r("resize",i),r("detach",s)};s=()=>{this.attached=!1,o("resize",i),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){Ht(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ht(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const o=r?"set":"remove";let i,s,a,l;for(n==="dataset"&&(i=this.getDatasetMeta(t[0].datasetIndex),i.controller["_"+o+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){s=t[a];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[o+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:i,index:s})=>{const a=this.getDatasetMeta(i);if(!a)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:a.data[s],index:s}});!xb(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const o=this.options.hover,i=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=i(n,t),a=r?t:i(t,n);s.length&&this.updateHoverStyle(s,o.mode,!1),a.length&&o.mode&&this.updateHoverStyle(a,o.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},o=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,o)===!1)return;const i=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,o),(i||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:o=[],options:i}=this,s=n,a=this._getActiveElements(t,o,r,s),l=Tte(t),c=xoe(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Xt(i.onHover,[t,a,this],this),l&&Xt(i.onClick,[t,a,this],this));const u=!xb(a,o);return(u||n)&&(this._active=a,this._updateHoverStyles(a,o,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,o){if(t.type==="mouseout")return[];if(!r)return n;const i=this.options.hover;return this.getElementsAtEventForMode(t,i.mode,i,o)}}Te(yn,"defaults",fn),Te(yn,"instances",Qm),Te(yn,"overrides",hc),Te(yn,"registry",Dr),Te(yn,"version",moe),Te(yn,"getChart",qA);function YA(){return Ht(yn.instances,e=>e._plugins.invalidate())}function Soe(e,t,n){const{startAngle:r,pixelMargin:o,x:i,y:s,outerRadius:a,innerRadius:l}=t;let c=o/a;e.beginPath(),e.arc(i,s,a,r-c,n+c),l>o?(c=o/l,e.arc(i,s,l,n+c,r-c,!0)):e.arc(i,s,o,n+kn,r-kn),e.closePath(),e.clip()}function _oe(e){return JC(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Coe(e,t,n,r){const o=_oe(e.options.borderRadius),i=(n-t)/2,s=Math.min(i,r*t/2),a=l=>{const c=(n-Math.min(i,l))*r/2;return Xn(l,0,Math.min(i,c))};return{outerStart:a(o.outerStart),outerEnd:a(o.outerEnd),innerStart:Xn(o.innerStart,0,s),innerEnd:Xn(o.innerEnd,0,s)}}function tu(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Pb(e,t,n,r,o,i){const{x:s,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),p=u>0?u+r+n+c:0;let h=0;const m=o-l;if(r){const j=u>0?u-r:0,H=d>0?d-r:0,$=(j+H)/2,V=$!==0?m*$/($+r):m;h=(m-V)/2}const b=Math.max(.001,m*d-n/hn)/d,v=(m-b)/2,x=l+v+h,w=o-v-h,{outerStart:_,outerEnd:R,innerStart:C,innerEnd:E}=Coe(t,p,d,w-x),A=d-_,M=d-R,N=x+_/A,L=w-R/M,F=p+C,z=p+E,Z=x+C/F,G=w-E/z;if(e.beginPath(),i){const j=(N+L)/2;if(e.arc(s,a,d,N,j),e.arc(s,a,d,j,L),R>0){const X=tu(M,L,s,a);e.arc(X.x,X.y,R,L,w+kn)}const H=tu(z,w,s,a);if(e.lineTo(H.x,H.y),E>0){const X=tu(z,G,s,a);e.arc(X.x,X.y,E,w+kn,G+Math.PI)}const $=(w-E/p+(x+C/p))/2;if(e.arc(s,a,p,w-E/p,$,!0),e.arc(s,a,p,$,x+C/p,!0),C>0){const X=tu(F,Z,s,a);e.arc(X.x,X.y,C,Z+Math.PI,x-kn)}const V=tu(A,x,s,a);if(e.lineTo(V.x,V.y),_>0){const X=tu(A,N,s,a);e.arc(X.x,X.y,_,x-kn,N)}}else{e.moveTo(s,a);const j=Math.cos(N)*d+s,H=Math.sin(N)*d+a;e.lineTo(j,H);const $=Math.cos(L)*d+s,V=Math.sin(L)*d+a;e.lineTo($,V)}e.closePath()}function Eoe(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a}=t;let l=t.endAngle;if(i){Pb(e,t,n,r,l,o);for(let c=0;c<i;++c)e.fill();isNaN(a)||(l=s+(a%dn||dn))}return Pb(e,t,n,r,l,o),e.fill(),l}function Roe(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:p}=l,h=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=p,h?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let m=t.endAngle;if(i){Pb(e,t,n,r,m,o);for(let b=0;b<i;++b)e.stroke();isNaN(a)||(m=s+(a%dn||dn))}h&&Soe(e,t,m),i||(Pb(e,t,n,r,m,o),e.stroke())}class pu extends us{constructor(n){super();Te(this,"circumference");Te(this,"endAngle");Te(this,"fullCircles");Te(this,"innerRadius");Te(this,"outerRadius");Te(this,"pixelMargin");Te(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,o){const i=this.getProps(["x","y"],o),{angle:s,distance:a}=FL(i,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:p}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],o),h=(this.options.spacing+this.options.borderWidth)/2,m=Je(p,c-l),b=wh(s,l,c)&&l!==c,v=m>=dn||b,x=Bs(a,u+h,d+h);return v&&x}getCenterPoint(n){const{x:r,y:o,startAngle:i,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(i+s)/2,p=(a+l+u+c)/2;return{x:r+Math.cos(d)*p,y:o+Math.sin(d)*p}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:o}=this,i=(r.offset||0)/4,s=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=o>dn?Math.floor(o/dn):0,o===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*i,Math.sin(l)*i);const c=1-Math.sin(Math.min(hn,o||0)),u=i*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,Eoe(n,this,u,s,a),Roe(n,this,u,s,a),n.restore()}}Te(pu,"id","arc"),Te(pu,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),Te(pu,"defaultRoutes",{backgroundColor:"backgroundColor"}),Te(pu,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function mF(e,t,n=t){e.lineCap=Je(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Je(n.borderDash,t.borderDash)),e.lineDashOffset=Je(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Je(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Je(n.borderWidth,t.borderWidth),e.strokeStyle=Je(n.borderColor,t.borderColor)}function Poe(e,t,n){e.lineTo(n.x,n.y)}function Toe(e){return e.stepped?Qte:e.tension||e.cubicInterpolationMode==="monotone"?Zte:Poe}function bF(e,t,n={}){const r=e.length,{start:o=0,end:i=r-1}=n,{start:s,end:a}=t,l=Math.max(o,s),c=Math.min(i,a),u=o<s&&i<s||o>a&&i>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function koe(e,t,n,r){const{points:o,options:i}=t,{count:s,start:a,loop:l,ilen:c}=bF(o,n,r),u=Toe(i);let{move:d=!0,reverse:p}=r||{},h,m,b;for(h=0;h<=c;++h)m=o[(a+(p?c-h:h))%s],!m.skip&&(d?(e.moveTo(m.x,m.y),d=!1):u(e,b,m,p,i.stepped),b=m);return l&&(m=o[(a+(p?c:0))%s],u(e,b,m,p,i.stepped)),!!l}function Aoe(e,t,n,r){const o=t.points,{count:i,start:s,ilen:a}=bF(o,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,p,h,m,b,v,x;const w=R=>(s+(c?a-R:R))%i,_=()=>{b!==v&&(e.lineTo(u,v),e.lineTo(u,b),e.lineTo(u,x))};for(l&&(h=o[w(0)],e.moveTo(h.x,h.y)),p=0;p<=a;++p){if(h=o[w(p)],h.skip)continue;const R=h.x,C=h.y,E=R|0;E===m?(C<b?b=C:C>v&&(v=C),u=(d*u+R)/++d):(_(),e.lineTo(R,C),m=E,d=0,b=v=C),x=C}_()}function oS(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Aoe:koe}function Ooe(e){return e.stepped?Ane:e.tension||e.cubicInterpolationMode==="monotone"?One:_l}function Moe(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),mF(e,t.options),e.stroke(o)}function Ioe(e,t,n,r){const{segments:o,options:i}=t,s=oS(t);for(const a of o)mF(e,i,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const Doe=typeof Path2D=="function";function Noe(e,t,n,r){Doe&&!t.options.segment?Moe(e,t,n,r):Ioe(e,t,n,r)}class Pa extends us{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const o=r.spanGaps?this._loop:this._fullLoop;Sne(this._points,r,t,o,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Fne(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,o=t[n],i=this.points,s=rF(this,{property:n,start:o,end:o});if(!s.length)return;const a=[],l=Ooe(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:p}=s[c],h=i[d],m=i[p];if(h===m){a.push(h);continue}const b=Math.abs((o-h[n])/(m[n]-h[n])),v=l(h,m,b,r.stepped);v[n]=t[n],a.push(v)}return a.length===1?a[0]:a}pathSegment(t,n,r){return oS(this)(t,this,n,r)}path(t,n,r){const o=this.segments,i=oS(this);let s=this._loop;n=n||0,r=r||this.points.length-n;for(const a of o)s&=i(t,this,a,{start:n,end:n+r-1});return!!s}draw(t,n,r,o){const i=this.options||{};(this.points||[]).length&&i.borderWidth&&(t.save(),Noe(t,this,r,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Te(Pa,"id","line"),Te(Pa,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Te(Pa,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Te(Pa,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function KA(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)<o.radius+o.hitRadius}class Jl extends us{constructor(n){super();Te(this,"parsed");Te(this,"skip");Te(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,o){const i=this.options,{x:s,y:a}=this.getProps(["x","y"],o);return Math.pow(n-s,2)+Math.pow(r-a,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(n,r){return KA(this,n,"x",r)}inYRange(n,r){return KA(this,n,"y",r)}getCenterPoint(n){const{x:r,y:o}=this.getProps(["x","y"],n);return{x:r,y:o}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const o=r&&n.borderWidth||0;return(r+o)*2}draw(n,r){const o=this.options;this.skip||o.radius<.1||!Vs(this,r,this.size(o)/2)||(n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.fillStyle=o.backgroundColor,Cb(n,o,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Te(Jl,"id","point"),Te(Jl,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Te(Jl,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function yF(e,t){const{x:n,y:r,base:o,width:i,height:s}=e.getProps(["x","y","base","width","height"],t);let a,l,c,u,d;return e.horizontal?(d=s/2,a=Math.min(n,o),l=Math.max(n,o),c=r-d,u=r+d):(d=i/2,a=n-d,l=n+d,c=Math.min(r,o),u=Math.max(r,o)),{left:a,top:c,right:l,bottom:u}}function Ta(e,t,n,r){return e?0:Xn(t,n,r)}function Loe(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=GL(r);return{t:Ta(o.top,i.top,0,n),r:Ta(o.right,i.right,0,t),b:Ta(o.bottom,i.bottom,0,n),l:Ta(o.left,i.left,0,t)}}function Foe(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,i=Ql(o),s=Math.min(t,n),a=e.borderSkipped,l=r||Ct(o);return{topLeft:Ta(!l||a.top||a.left,i.topLeft,0,s),topRight:Ta(!l||a.top||a.right,i.topRight,0,s),bottomLeft:Ta(!l||a.bottom||a.left,i.bottomLeft,0,s),bottomRight:Ta(!l||a.bottom||a.right,i.bottomRight,0,s)}}function joe(e){const t=yF(e),n=t.right-t.left,r=t.bottom-t.top,o=Loe(e,n/2,r/2),i=Foe(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:i},inner:{x:t.left+o.l,y:t.top+o.t,w:n-o.l-o.r,h:r-o.t-o.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,i.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(o.b,o.r))}}}}function Vx(e,t,n,r){const o=t===null,i=n===null,a=e&&!(o&&i)&&yF(e,r);return a&&(o||Bs(t,a.left,a.right))&&(i||Bs(n,a.top,a.bottom))}function $oe(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function zoe(e,t){e.rect(t.x,t.y,t.w,t.h)}function Wx(e,t,n={}){const r=e.x!==n.x?-t:0,o=e.y!==n.y?-t:0,i=(e.x+e.w!==n.x+n.w?t:0)-r,s=(e.y+e.h!==n.y+n.h?t:0)-o;return{x:e.x+r,y:e.y+o,w:e.w+i,h:e.h+s,radius:e.radius}}class ec extends us{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:o}}=this,{inner:i,outer:s}=joe(this),a=$oe(s.radius)?Sh:zoe;t.save(),(s.w!==i.w||s.h!==i.h)&&(t.beginPath(),a(t,Wx(s,n,i)),t.clip(),a(t,Wx(i,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Wx(i,n)),t.fillStyle=o,t.fill(),t.restore()}inRange(t,n,r){return Vx(this,t,n,r)}inXRange(t,n){return Vx(this,t,null,n)}inYRange(t,n){return Vx(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:o,horizontal:i}=this.getProps(["x","y","base","horizontal"],t);return{x:i?(n+o)/2:n,y:i?r:(r+o)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}Te(ec,"id","bar"),Te(ec,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Te(ec,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Boe=Object.freeze({__proto__:null,ArcElement:pu,BarElement:ec,LineElement:Pa,PointElement:Jl});const iS=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],XA=iS.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function vF(e){return iS[e%iS.length]}function xF(e){return XA[e%XA.length]}function Hoe(e,t){return e.borderColor=vF(t),e.backgroundColor=xF(t),++t}function Voe(e,t){return e.backgroundColor=e.data.map(()=>vF(t++)),t}function Woe(e,t){return e.backgroundColor=e.data.map(()=>xF(t++)),t}function Uoe(e){let t=0;return(n,r)=>{const o=e.getDatasetMeta(r).controller;o instanceof Il?t=Voe(n,t):o instanceof Zf?t=Woe(n,t):o&&(t=Hoe(n,t))}}function QA(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function Goe(e){return e&&(e.borderColor||e.backgroundColor)}function qoe(){return fn.borderColor!=="rgba(0,0,0,0.1)"||fn.backgroundColor!=="rgba(0,0,0,0.1)"}var Yoe={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:o}=e.config,{elements:i}=o,s=QA(r)||Goe(o)||i&&QA(i)||qoe();if(!n.forceOverride&&s)return;const a=Uoe(e);r.forEach(a)}};function Koe(e,t,n,r,o){const i=o.samples||r;if(i>=n)return e.slice(t,t+n);const s=[],a=(n-2)/(i-2);let l=0;const c=t+n-1;let u=t,d,p,h,m,b;for(s[l++]=e[u],d=0;d<i-2;d++){let v=0,x=0,w;const _=Math.floor((d+1)*a)+1+t,R=Math.min(Math.floor((d+2)*a)+1,n)+t,C=R-_;for(w=_;w<R;w++)v+=e[w].x,x+=e[w].y;v/=C,x/=C;const E=Math.floor(d*a)+1+t,A=Math.min(Math.floor((d+1)*a)+1,n)+t,{x:M,y:N}=e[u];for(h=m=-1,w=E;w<A;w++)m=.5*Math.abs((M-v)*(e[w].y-N)-(M-e[w].x)*(x-N)),m>h&&(h=m,p=e[w],b=w);s[l++]=p,u=b}return s[l++]=e[c],s}function Xoe(e,t,n,r){let o=0,i=0,s,a,l,c,u,d,p,h,m,b;const v=[],x=t+n-1,w=e[t].x,R=e[x].x-w;for(s=t;s<t+n;++s){a=e[s],l=(a.x-w)/R*r,c=a.y;const C=l|0;if(C===u)c<m?(m=c,d=s):c>b&&(b=c,p=s),o=(i*o+a.x)/++i;else{const E=s-1;if(!ct(d)&&!ct(p)){const A=Math.min(d,p),M=Math.max(d,p);A!==h&&A!==E&&v.push({...e[A],x:o}),M!==h&&M!==E&&v.push({...e[M],x:o})}s>0&&E!==h&&v.push(e[E]),v.push(a),u=C,i=0,m=b=c,d=p=h=s}}return v}function wF(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function ZA(e){e.data.datasets.forEach(t=>{wF(t)})}function Qoe(e,t){const n=t.length;let r=0,o;const{iScale:i}=e,{min:s,max:a,minDefined:l,maxDefined:c}=i.getUserBounds();return l&&(r=Xn(Hs(t,i.axis,s).lo,0,n-1)),c?o=Xn(Hs(t,i.axis,a).hi+1,r,n)-r:o=n-r,{start:r,count:o}}var Zoe={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){ZA(e);return}const r=e.width;e.data.datasets.forEach((o,i)=>{const{_data:s,indexAxis:a}=o,l=e.getDatasetMeta(i),c=s||o.data;if(ln([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:p}=Qoe(l,c);const h=n.threshold||4*r;if(p<=h){wF(o);return}ct(s)&&(o._data=c,delete o.data,Object.defineProperty(o,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(b){this._data=b}}));let m;switch(n.algorithm){case"lttb":m=Koe(c,d,p,r,n);break;case"min-max":m=Xoe(c,d,p,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}o._decimated=m})},destroy(e){ZA(e)}};function Joe(e,t,n){const r=e.segments,o=e.points,i=t.points,s=[];for(const a of r){let{start:l,end:c}=a;c=sE(l,c,o);const u=sS(n,o[l],o[c],a.loop);if(!t.segments){s.push({source:a,target:u,start:o[l],end:o[c]});continue}const d=rF(t,u);for(const p of d){const h=sS(n,i[p.start],i[p.end],p.loop),m=nF(a,o,h);for(const b of m)s.push({source:b,target:p,start:{[n]:JA(u,h,"start",Math.max)},end:{[n]:JA(u,h,"end",Math.min)}})}}return s}function sS(e,t,n,r){if(r)return;let o=t[e],i=n[e];return e==="angle"&&(o=Eo(o),i=Eo(i)),{property:e,start:o,end:i}}function eie(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,i=[];return t.segments.forEach(({start:s,end:a})=>{a=sE(s,a,o);const l=o[s],c=o[a];r!==null?(i.push({x:l.x,y:r}),i.push({x:c.x,y:r})):n!==null&&(i.push({x:n,y:l.y}),i.push({x:n,y:c.y}))}),i}function sE(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function JA(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function SF(e,t){let n=[],r=!1;return un(e)?(r=!0,n=e):n=eie(e,t),n.length?new Pa({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function eO(e){return e&&e.fill!==!1}function tie(e,t,n){let o=e[t].fill;const i=[t];let s;if(!n)return o;for(;o!==!1&&i.indexOf(o)===-1;){if(!En(o))return o;if(s=e[o],!s)return!1;if(s.visible)return o;i.push(o),o=s.fill}return!1}function nie(e,t,n){const r=sie(e);if(Ct(r))return isNaN(r.value)?!1:r;let o=parseFloat(r);return En(o)&&Math.floor(o)===o?rie(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function rie(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function oie(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Ct(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function iie(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:Ct(e)?r=e.value:r=t.getBaseValue(),r}function sie(e){const t=e.options,n=t.fill;let r=Je(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function aie(e){const{scale:t,index:n,line:r}=e,o=[],i=r.segments,s=r.points,a=lie(t,n);a.push(SF({x:null,y:t.bottom},r));for(let l=0;l<i.length;l++){const c=i[l];for(let u=c.start;u<=c.end;u++)cie(o,s[u],a)}return new Pa({points:o,options:{}})}function lie(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let o=0;o<r.length;o++){const i=r[o];if(i.index===t)break;i.hidden||n.unshift(i.dataset)}return n}function cie(e,t,n){const r=[];for(let o=0;o<n.length;o++){const i=n[o],{first:s,last:a,point:l}=uie(i,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function uie(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const o=r[n],i=e.segments,s=e.points;let a=!1,l=!1;for(let c=0;c<i.length;c++){const u=i[c],d=s[u.start][n],p=s[u.end][n];if(Bs(o,d,p)){a=o===d,l=o===p;break}}return{first:a,last:l,point:r}}class _F{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:o,y:i,radius:s}=this;return n=n||{start:0,end:dn},t.arc(o,i,s,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:o}=this,i=t.angle;return{x:n+Math.cos(i)*o,y:r+Math.sin(i)*o,angle:i}}}function die(e){const{chart:t,fill:n,line:r}=e;if(En(n))return fie(t,n);if(n==="stack")return aie(e);if(n==="shape")return!0;const o=hie(e);return o instanceof _F?o:SF(o,r)}function fie(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function hie(e){return(e.scale||{}).getPointPositionForValue?gie(e):pie(e)}function pie(e){const{scale:t={},fill:n}=e,r=oie(n,t);if(En(r)){const o=t.isHorizontal();return{x:o?r:null,y:o?null:r}}return null}function gie(e){const{scale:t,fill:n}=e,r=t.options,o=t.getLabels().length,i=r.reverse?t.max:t.min,s=iie(n,t,i),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,i);return new _F({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<o;++l)a.push(t.getPointPositionForValue(l,s));return a}function Ux(e,t,n){const r=die(t),{line:o,scale:i,axis:s}=t,a=o.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:d=c}=l||{};r&&o.points.length&&(Kl(e,n),mie(e,{line:o,target:r,above:u,below:d,area:n,scale:i,axis:s}),Xl(e))}function mie(e,t){const{line:n,target:r,above:o,below:i,area:s,scale:a}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&i!==o&&(tO(e,r,s.top),nO(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore(),e.save(),tO(e,r,s.bottom)),nO(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore()}function tO(e,t,n){const{segments:r,points:o}=t;let i=!0,s=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=o[l],d=o[sE(l,c,o)];i?(e.moveTo(u.x,u.y),i=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),s=!!t.pathSegment(e,a,{move:s}),s?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function nO(e,t){const{line:n,target:r,property:o,color:i,scale:s}=t,a=Joe(n,r,o);for(const{source:l,target:c,start:u,end:d}of a){const{style:{backgroundColor:p=i}={}}=l,h=r!==!0;e.save(),e.fillStyle=p,bie(e,s,h&&sS(o,u,d)),e.beginPath();const m=!!n.pathSegment(e,l);let b;if(h){m?e.closePath():rO(e,r,d,o);const v=!!r.pathSegment(e,c,{move:m,reverse:!0});b=m&&v,b||rO(e,r,u,o)}e.closePath(),e.fill(b?"evenodd":"nonzero"),e.restore()}}function bie(e,t,n){const{top:r,bottom:o}=t.chart.chartArea,{property:i,start:s,end:a}=n||{};i==="x"&&(e.beginPath(),e.rect(s,r,a-s,o-r),e.clip())}function rO(e,t,n,r){const o=t.interpolate(n,r);o&&e.lineTo(o.x,o.y)}var yie={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,o=[];let i,s,a,l;for(s=0;s<r;++s)i=e.getDatasetMeta(s),a=i.dataset,l=null,a&&a.options&&a instanceof Pa&&(l={visible:e.isDatasetVisible(s),index:s,fill:nie(a,s,r),chart:e,axis:i.controller.options.indexAxis,scale:i.vScale,line:a}),i.$filler=l,o.push(l);for(s=0;s<r;++s)l=o[s],!(!l||l.fill===!1)&&(l.fill=tie(o,s,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",o=e.getSortedVisibleDatasetMetas(),i=e.chartArea;for(let s=o.length-1;s>=0;--s){const a=o[s].$filler;a&&(a.line.updateControlPoints(i,a.axis),r&&a.fill&&Ux(e.ctx,a,i))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let o=r.length-1;o>=0;--o){const i=r[o].$filler;eO(i)&&Ux(e.ctx,i,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!eO(r)||n.drawTime!=="beforeDatasetDraw"||Ux(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const oO=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},vie=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class iO extends us{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=Xt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,o)=>t.sort(r,o,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,o=Dn(r.font),i=o.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=oO(r,i);let c,u;n.font=o.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,i,a,l)+10):(u=this.maxHeight,c=this._fitCols(s,o,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,o){const{ctx:i,maxWidth:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=o+a;let d=t;i.textAlign="left",i.textBaseline="middle";let p=-1,h=-u;return this.legendItems.forEach((m,b)=>{const v=r+n/2+i.measureText(m.text).width;(b===0||c[c.length-1]+v+2*a>s)&&(d+=u,c[c.length-(b>0?0:1)]=0,h+=u,p++),l[b]={left:0,top:h,row:p,width:v,height:o},c[c.length-1]+=v+a}),d}_fitCols(t,n,r,o){const{ctx:i,maxHeight:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let d=a,p=0,h=0,m=0,b=0;return this.legendItems.forEach((v,x)=>{const{itemWidth:w,itemHeight:_}=xie(r,n,i,v,o);x>0&&h+_+2*a>u&&(d+=p+a,c.push({width:p,height:h}),m+=p+a,b++,p=h=0),l[x]={left:m,top:h,col:b,width:w,height:_},p=Math.max(p,w),h+=_+a}),d+=p,c.push({width:p,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:o},rtl:i}}=this,s=Eu(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=gr(r,this.left+o,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=gr(r,this.left+o,this.right-this.lineWidths[a])),c.top+=this.top+t+o,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+o}else{let a=0,l=gr(r,this.top+t+o,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=gr(r,this.top+t+o,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+o,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+o}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Kl(t,this),this._draw(),Xl(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:o}=this,{align:i,labels:s}=t,a=fn.color,l=Eu(t.rtl,this.left,this.width),c=Dn(s.font),{padding:u}=s,d=c.size,p=d/2;let h;this.drawTitle(),o.textAlign=l.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=c.string;const{boxWidth:m,boxHeight:b,itemHeight:v}=oO(s,d),x=function(E,A,M){if(isNaN(m)||m<=0||isNaN(b)||b<0)return;o.save();const N=Je(M.lineWidth,1);if(o.fillStyle=Je(M.fillStyle,a),o.lineCap=Je(M.lineCap,"butt"),o.lineDashOffset=Je(M.lineDashOffset,0),o.lineJoin=Je(M.lineJoin,"miter"),o.lineWidth=N,o.strokeStyle=Je(M.strokeStyle,a),o.setLineDash(Je(M.lineDash,[])),s.usePointStyle){const L={radius:b*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:N},F=l.xPlus(E,m/2),z=A+p;UL(o,L,F,z,s.pointStyleWidth&&m)}else{const L=A+Math.max((d-b)/2,0),F=l.leftForLtr(E,m),z=Ql(M.borderRadius);o.beginPath(),Object.values(z).some(Z=>Z!==0)?Sh(o,{x:F,y:L,w:m,h:b,radius:z}):o.rect(F,L,m,b),o.fill(),N!==0&&o.stroke()}o.restore()},w=function(E,A,M){pc(o,M.text,E,A+v/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},_=this.isHorizontal(),R=this._computeTitleHeight();_?h={x:gr(i,this.left+u,this.right-r[0]),y:this.top+u+R,line:0}:h={x:this.left+u,y:gr(i,this.top+R+u,this.bottom-n[0].height),line:0},JL(this.ctx,t.textDirection);const C=v+u;this.legendItems.forEach((E,A)=>{o.strokeStyle=E.fontColor,o.fillStyle=E.fontColor;const M=o.measureText(E.text).width,N=l.textAlign(E.textAlign||(E.textAlign=s.textAlign)),L=m+p+M;let F=h.x,z=h.y;l.setWidth(this.width),_?A>0&&F+L+u>this.right&&(z=h.y+=C,h.line++,F=h.x=gr(i,this.left+u,this.right-r[h.line])):A>0&&z+C>this.bottom&&(F=h.x=F+n[h.line].width+u,h.line++,z=h.y=gr(i,this.top+R+u,this.bottom-n[h.line].height));const Z=l.x(F);if(x(Z,z,E),F=zte(N,F+m+p,_?F+L:this.right,t.rtl),w(l.x(F),z,E),_)h.x+=L+u;else if(typeof E.text!="string"){const G=c.lineHeight;h.y+=CF(E,G)+u}else h.y+=C}),eF(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Dn(n.font),o=ir(n.padding);if(!n.display)return;const i=Eu(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,c=o.top+l;let u,d=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),u=this.top+c,d=gr(t.align,d,this.right-p);else{const m=this.columnSizes.reduce((b,v)=>Math.max(b,v.height),0);u=c+gr(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const h=gr(a,d,d+p);s.textAlign=i.textAlign(QC(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,pc(s,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=Dn(t.font),r=ir(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,o,i;if(Bs(t,this.left,this.right)&&Bs(n,this.top,this.bottom)){for(i=this.legendHitBoxes,r=0;r<i.length;++r)if(o=i[r],Bs(t,o.left,o.left+o.width)&&Bs(n,o.top,o.top+o.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!_ie(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const o=this._hoveredItem,i=vie(o,r);o&&!i&&Xt(n.onLeave,[t,o,this],this),this._hoveredItem=r,r&&!i&&Xt(n.onHover,[t,r,this],this)}else r&&Xt(n.onClick,[t,r,this],this)}}function xie(e,t,n,r,o){const i=wie(r,e,t,n),s=Sie(o,r,t.lineHeight);return{itemWidth:i,itemHeight:s}}function wie(e,t,n,r){let o=e.text;return o&&typeof o!="string"&&(o=o.reduce((i,s)=>i.length>s.length?i:s)),t+n.size/2+r.measureText(o).width}function Sie(e,t,n){let r=e;return typeof t.text!="string"&&(r=CF(t,n)),r}function CF(e,t){const n=e.text?e.text.length:0;return t*n}function _ie(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Cie={id:"legend",_element:iO,start(e,t,n){const r=e.legend=new iO({ctx:e.ctx,options:n,chart:e});yr.configure(e,r,n),yr.addBox(e,r)},stop(e){yr.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;yr.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,o=n.chart;o.isDatasetVisible(r)?(o.hide(r),t.hidden=!0):(o.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:o,color:i,useBorderRadius:s,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=ir(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:i,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:o||c.textAlign,borderRadius:s&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};let aE=class extends us{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const o=un(r.text)?r.text.length:1;this._padding=ir(r.padding);const i=o*Dn(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:o,right:i,options:s}=this,a=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=gr(a,r,i),d=n+t,c=i-r):(s.position==="left"?(u=r+t,d=gr(a,o,n),l=hn*-.5):(u=i-t,d=gr(a,n,o),l=hn*.5),c=o-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=Dn(n.font),i=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(i);pc(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:QC(n.align),textBaseline:"middle",translation:[s,a]})}};function Eie(e,t){const n=new aE({ctx:e.ctx,options:t,chart:e});yr.configure(e,n,t),yr.addBox(e,n),e.titleBlock=n}var Rie={id:"title",_element:aE,start(e,t,n){Eie(e,n)},stop(e){const t=e.titleBlock;yr.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;yr.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const nm=new WeakMap;var Pie={id:"subtitle",start(e,t,n){const r=new aE({ctx:e.ctx,options:n,chart:e});yr.configure(e,r,n),yr.addBox(e,r),nm.set(e,r)},stop(e){yr.removeBox(e,nm.get(e)),nm.delete(e)},beforeUpdate(e,t,n){const r=nm.get(e);yr.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Lf={average(e){if(!e.length)return!1;let t,n,r=new Set,o=0,i=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),o+=l.y,++i}}return i===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:o/i}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,o=Number.POSITIVE_INFINITY,i,s,a;for(i=0,s=e.length;i<s;++i){const l=e[i].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=J1(t,c);u<o&&(o=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Mi(e,t){return t&&(un(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Os(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
285
|
+
`)>-1?e.split(`
|
|
286
|
+
`):e}function Tie(e,t){const{element:n,datasetIndex:r,index:o}=t,i=e.getDatasetMeta(r).controller,{label:s,value:a}=i.getLabelAndValue(o);return{chart:e,label:s,parsed:i.getParsed(o),raw:e.data.datasets[r].data[o],formattedValue:a,dataset:i.getDataset(),dataIndex:o,datasetIndex:r,element:n}}function sO(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:s,boxHeight:a}=t,l=Dn(t.bodyFont),c=Dn(t.titleFont),u=Dn(t.footerFont),d=i.length,p=o.length,h=r.length,m=ir(t.padding);let b=m.height,v=0,x=r.reduce((R,C)=>R+C.before.length+C.lines.length+C.after.length,0);if(x+=e.beforeBody.length+e.afterBody.length,d&&(b+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),x){const R=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=h*R+(x-h)*l.lineHeight+(x-1)*t.bodySpacing}p&&(b+=t.footerMarginTop+p*u.lineHeight+(p-1)*t.footerSpacing);let w=0;const _=function(R){v=Math.max(v,n.measureText(R).width+w)};return n.save(),n.font=c.string,Ht(e.title,_),n.font=l.string,Ht(e.beforeBody.concat(e.afterBody),_),w=t.displayColors?s+2+t.boxPadding:0,Ht(r,R=>{Ht(R.before,_),Ht(R.lines,_),Ht(R.after,_)}),w=0,n.font=u.string,Ht(e.footer,_),n.restore(),v+=m.width,{width:v,height:b}}function kie(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function Aie(e,t,n,r){const{x:o,width:i}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&o+i+s>t.width||e==="right"&&o-i-s<0)return!0}function Oie(e,t,n,r){const{x:o,width:i}=n,{width:s,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=o<=(a+l)/2?"left":"right":o<=i/2?c="left":o>=s-i/2&&(c="right"),Aie(c,e,t,n)&&(c="center"),c}function aO(e,t,n){const r=n.yAlign||t.yAlign||kie(e,n);return{xAlign:n.xAlign||t.xAlign||Oie(e,t,n,r),yAlign:r}}function Mie(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function Iie(e,t,n){let{y:r,height:o}=e;return t==="top"?r+=n:t==="bottom"?r-=o+n:r-=o/2,r}function lO(e,t,n,r){const{caretSize:o,caretPadding:i,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,c=o+i,{topLeft:u,topRight:d,bottomLeft:p,bottomRight:h}=Ql(s);let m=Mie(t,a);const b=Iie(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(u,p)+o:a==="right"&&(m+=Math.max(d,h)+o),{x:Xn(m,0,r.width-t.width),y:Xn(b,0,r.height-t.height)}}function rm(e,t,n){const r=ir(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function cO(e){return Mi([],Os(e))}function Die(e,t,n){return Ka(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function uO(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const EF={beforeTitle:Rs,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Rs,beforeBody:Rs,beforeLabel:Rs,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return ct(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Rs,afterBody:Rs,beforeFooter:Rs,footer:Rs,afterFooter:Rs};function Yr(e,t,n,r){const o=e[t].call(n,r);return typeof o>"u"?EF[t].call(n,r):o}var c1;let dO=(c1=class extends us{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),o=r.enabled&&n.options.animation&&r.animations,i=new oF(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=Die(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,o=Yr(r,"beforeTitle",this,t),i=Yr(r,"title",this,t),s=Yr(r,"afterTitle",this,t);let a=[];return a=Mi(a,Os(o)),a=Mi(a,Os(i)),a=Mi(a,Os(s)),a}getBeforeBody(t,n){return cO(Yr(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,o=[];return Ht(t,i=>{const s={before:[],lines:[],after:[]},a=uO(r,i);Mi(s.before,Os(Yr(a,"beforeLabel",this,i))),Mi(s.lines,Yr(a,"label",this,i)),Mi(s.after,Os(Yr(a,"afterLabel",this,i))),o.push(s)}),o}getAfterBody(t,n){return cO(Yr(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,o=Yr(r,"beforeFooter",this,t),i=Yr(r,"footer",this,t),s=Yr(r,"afterFooter",this,t);let a=[];return a=Mi(a,Os(o)),a=Mi(a,Os(i)),a=Mi(a,Os(s)),a}_createItems(t){const n=this._active,r=this.chart.data,o=[],i=[],s=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(Tie(this.chart,n[l]));return t.filter&&(a=a.filter((u,d,p)=>t.filter(u,d,p,r))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,r))),Ht(a,u=>{const d=uO(t.callbacks,u);o.push(Yr(d,"labelColor",this,u)),i.push(Yr(d,"labelPointStyle",this,u)),s.push(Yr(d,"labelTextColor",this,u))}),this.labelColors=o,this.labelPointStyles=i,this.labelTextColors=s,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),o=this._active;let i,s=[];if(!o.length)this.opacity!==0&&(i={opacity:0});else{const a=Lf[r.position].call(this,o,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=sO(this,r),c=Object.assign({},a,l),u=aO(this.chart,r,c),d=lO(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,o){const i=this.getCaretPosition(t,r,o);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(t,n,r){const{xAlign:o,yAlign:i}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Ql(a),{x:p,y:h}=t,{width:m,height:b}=n;let v,x,w,_,R,C;return i==="center"?(R=h+b/2,o==="left"?(v=p,x=v-s,_=R+s,C=R-s):(v=p+m,x=v+s,_=R-s,C=R+s),w=v):(o==="left"?x=p+Math.max(l,u)+s:o==="right"?x=p+m-Math.max(c,d)-s:x=this.caretX,i==="top"?(_=h,R=_-s,v=x-s,w=x+s):(_=h+b,R=_+s,v=x+s,w=x-s),C=_),{x1:v,x2:x,x3:w,y1:_,y2:R,y3:C}}drawTitle(t,n,r){const o=this.title,i=o.length;let s,a,l;if(i){const c=Eu(r.rtl,this.x,this.width);for(t.x=rm(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=Dn(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<i;++l)n.fillText(o[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+a,l+1===i&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,o,i){const s=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=i,u=Dn(i.bodyFont),d=rm(this,"left",i),p=o.x(d),h=l<u.lineHeight?(u.lineHeight-l)/2:0,m=n.y+h;if(i.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},v=o.leftForLtr(p,c)+c/2,x=m+l/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,Cb(t,b,v,x),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Cb(t,b,v,x)}else{t.lineWidth=Ct(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const b=o.leftForLtr(p,c),v=o.leftForLtr(o.xPlus(p,1),c-2),x=Ql(s.borderRadius);Object.values(x).some(w=>w!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,Sh(t,{x:b,y:m,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Sh(t,{x:v,y:m+1,w:c-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(b,m,c,l),t.strokeRect(b,m,c,l),t.fillStyle=s.backgroundColor,t.fillRect(v,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:o}=this,{bodySpacing:i,bodyAlign:s,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=Dn(r.bodyFont);let p=d.lineHeight,h=0;const m=Eu(r.rtl,this.x,this.width),b=function(M){n.fillText(M,m.x(t.x+h),t.y+p/2),t.y+=p+i},v=m.textAlign(s);let x,w,_,R,C,E,A;for(n.textAlign=s,n.textBaseline="middle",n.font=d.string,t.x=rm(this,v,r),n.fillStyle=r.bodyColor,Ht(this.beforeBody,b),h=a&&v!=="right"?s==="center"?c/2+u:c+2+u:0,R=0,E=o.length;R<E;++R){for(x=o[R],w=this.labelTextColors[R],n.fillStyle=w,Ht(x.before,b),_=x.lines,a&&_.length&&(this._drawColorBox(n,t,R,m,r),p=Math.max(d.lineHeight,l)),C=0,A=_.length;C<A;++C)b(_[C]),p=d.lineHeight;Ht(x.after,b)}h=0,p=d.lineHeight,Ht(this.afterBody,b),t.y-=i}drawFooter(t,n,r){const o=this.footer,i=o.length;let s,a;if(i){const l=Eu(r.rtl,this.x,this.width);for(t.x=rm(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=Dn(r.footerFont),n.fillStyle=r.footerColor,n.font=s.string,a=0;a<i;++a)n.fillText(o[a],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,n,r,o){const{xAlign:i,yAlign:s}=this,{x:a,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:p,bottomLeft:h,bottomRight:m}=Ql(o.cornerRadius);n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.beginPath(),n.moveTo(a+d,l),s==="top"&&this.drawCaret(t,n,r,o),n.lineTo(a+c-p,l),n.quadraticCurveTo(a+c,l,a+c,l+p),s==="center"&&i==="right"&&this.drawCaret(t,n,r,o),n.lineTo(a+c,l+u-m),n.quadraticCurveTo(a+c,l+u,a+c-m,l+u),s==="bottom"&&this.drawCaret(t,n,r,o),n.lineTo(a+h,l+u),n.quadraticCurveTo(a,l+u,a,l+u-h),s==="center"&&i==="left"&&this.drawCaret(t,n,r,o),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),o.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,o=r&&r.x,i=r&&r.y;if(o||i){const s=Lf[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=sO(this,t),l=Object.assign({},s,this._size),c=aO(n,t,l),u=lO(t,l,c,n);(o._to!==u.x||i._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const o={width:this.width,height:this.height},i={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=ir(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(i,t,o,n),JL(t,n.textDirection),i.y+=s.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),eF(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,o=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),i=!xb(r,o),s=this._positionChanged(o,n);(i||s)&&(this._active=o,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const o=this.options,i=this._active||[],s=this._getActiveElements(t,i,n,r),a=this._positionChanged(s,t),l=n||!xb(s,i)||a;return l&&(this._active=s,(o.enabled||o.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,o){const i=this.options;if(t.type==="mouseout")return[];if(!o)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,i.mode,i,r);return i.reverse&&s.reverse(),s}_positionChanged(t,n){const{caretX:r,caretY:o,options:i}=this,s=Lf[i.position].call(this,t,n);return s!==!1&&(r!==s.x||o!==s.y)}},Te(c1,"positioners",Lf),c1);var RF={id:"tooltip",_element:dO,positioners:Lf,afterInit(e,t,n){n&&(e.tooltip=new dO({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:EF},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Nie=Object.freeze({__proto__:null,Colors:Yoe,Decimation:Zoe,Filler:yie,Legend:Cie,SubTitle:Pie,Title:Rie,Tooltip:RF});const Lie=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Fie(e,t,n,r){const o=e.indexOf(t);if(o===-1)return Lie(e,t,n,r);const i=e.lastIndexOf(t);return o!==i?n:o}const jie=(e,t)=>e===null?null:Xn(Math.round(e),0,t);function fO(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Tb extends Xa{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:o,label:i}of n)r[o]===i&&r.splice(o,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(ct(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:Fie(r,t,Je(n,t),this._addedLabels),jie(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(o=this.getLabels().length-1)),this.min=r,this.max=o}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,o=[];let i=this.getLabels();i=t===0&&n===i.length-1?i:i.slice(t,n+1),this._valueRange=Math.max(i.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=n;s++)o.push({value:s});return o}getLabelForValue(t){return fO.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Te(Tb,"id","category"),Te(Tb,"defaults",{ticks:{callback:fO}});function $ie(e,t){const n=[],{bounds:o,step:i,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:p}=e,h=i||1,m=u-1,{min:b,max:v}=t,x=!ct(s),w=!ct(a),_=!ct(c),R=(v-b)/(d+1);let C=sA((v-b)/m/h)*h,E,A,M,N;if(C<1e-14&&!x&&!w)return[{value:b},{value:v}];N=Math.ceil(v/C)-Math.floor(b/C),N>m&&(C=sA(N*C/m/h)*h),ct(l)||(E=Math.pow(10,l),C=Math.ceil(C*E)/E),o==="ticks"?(A=Math.floor(b/C)*C,M=Math.ceil(v/C)*C):(A=b,M=v),x&&w&&i&&Ite((a-s)/i,C/1e3)?(N=Math.round(Math.min((a-s)/C,u)),C=(a-s)/N,A=s,M=a):_?(A=x?s:A,M=w?a:M,N=c-1,C=(M-A)/N):(N=(M-A)/C,Kf(N,Math.round(N),C/1e3)?N=Math.round(N):N=Math.ceil(N));const L=Math.max(aA(C),aA(A));E=Math.pow(10,ct(l)?L:l),A=Math.round(A*E)/E,M=Math.round(M*E)/E;let F=0;for(x&&(p&&A!==s?(n.push({value:s}),A<s&&F++,Kf(Math.round((A+F*C)*E)/E,s,hO(s,R,e))&&F++):A<s&&F++);F<N;++F){const z=Math.round((A+F*C)*E)/E;if(w&&z>a)break;n.push({value:z})}return w&&p&&M!==a?n.length&&Kf(n[n.length-1].value,a,hO(a,R,e))?n[n.length-1].value=a:n.push({value:a}):(!w||M===a)&&n.push({value:M}),n}function hO(e,t,{horizontal:n,minRotation:r}){const o=vi(r),i=(n?Math.sin(o):Math.cos(o))||.001,s=.75*t*(""+e).length;return Math.min(t/i,s)}class kb extends Xa{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return ct(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:o,max:i}=this;const s=l=>o=n?o:l,a=l=>i=r?i:l;if(t){const l=Yi(o),c=Yi(i);l<0&&c<0?a(0):l>0&&c>0&&s(0)}if(o===i){let l=i===0?1:Math.abs(i*.05);a(i+l),t||s(o-l)}this.min=o,this.max=i}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,o;return r?(o=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,o>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${o} ticks. Limiting to 1000.`),o=1e3)):(o=this.computeTickLimit(),n=n||11),n&&(o=Math.min(n,o)),o}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const o={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},i=this._range||this,s=$ie(o,i);return t.bounds==="ticks"&&LL(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const o=(r-n)/Math.max(t.length-1,1)/2;n-=o,r+=o}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return up(t,this.chart.options.locale,this.options.ticks.format)}}class id extends kb{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=En(t)?t:0,this.max=En(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=vi(this.options.ticks.minRotation),o=(t?Math.sin(r):Math.cos(r))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/o))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Te(id,"id","linear"),Te(id,"defaults",{ticks:{callback:G0.formatters.numeric}});const Ch=e=>Math.floor(Ra(e)),yl=(e,t)=>Math.pow(10,Ch(e)+t);function pO(e){return e/Math.pow(10,Ch(e))===1}function gO(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function zie(e,t){const n=t-e;let r=Ch(n);for(;gO(e,t,r)>10;)r++;for(;gO(e,t,r)<10;)r--;return Math.min(r,Ch(e))}function Bie(e,{min:t,max:n}){t=_o(e.min,t);const r=[],o=Ch(t);let i=zie(t,n),s=i<0?Math.pow(10,Math.abs(i)):1;const a=Math.pow(10,i),l=o>i?Math.pow(10,o):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,i)),p=_o(e.min,Math.round((l+u+d*Math.pow(10,i))*s)/s);for(;p<n;)r.push({value:p,major:pO(p),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(i++,d=2,s=i>=0?1:s),p=Math.round((l+u+d*Math.pow(10,i))*s)/s;const h=_o(e.max,p);return r.push({value:h,major:pO(h),significand:d}),r}class sd extends Xa{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=kb.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return En(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=En(t)?Math.max(0,t):null,this.max=En(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!En(this._userMin)&&(this.min=t===yl(this.min,0)?yl(this.min,-1):yl(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,o=this.max;const i=a=>r=t?r:a,s=a=>o=n?o:a;r===o&&(r<=0?(i(1),s(10)):(i(yl(r,-1)),s(yl(o,1)))),r<=0&&i(yl(o,-1)),o<=0&&s(yl(r,1)),this.min=r,this.max=o}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=Bie(n,this);return t.bounds==="ticks"&&LL(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":up(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ra(t),this._valueRange=Ra(this.max)-Ra(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ra(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Te(sd,"id","logarithmic"),Te(sd,"defaults",{ticks:{callback:G0.formatters.logarithmic,major:{enabled:!0}}});function aS(e){const t=e.ticks;if(t.display&&e.display){const n=ir(t.backdropPadding);return Je(t.font&&t.font.size,fn.font.size)+n.height}return 0}function Hie(e,t,n){return n=un(n)?n:[n],{w:Xte(e,t.string,n),h:n.length*t.lineHeight}}function mO(e,t,n,r,o){return e===r||e===o?{start:t-n/2,end:t+n/2}:e<r||e>o?{start:t-n,end:t}:{start:t,end:t+n}}function Vie(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],o=[],i=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?hn/i:0;for(let l=0;l<i;l++){const c=s.setContext(e.getPointLabelContext(l));o[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+o[l],a),d=Dn(c.font),p=Hie(e.ctx,d,e._pointLabels[l]);r[l]=p;const h=Eo(e.getIndexAngle(l)+a),m=Math.round(KC(h)),b=mO(m,u.x,p.w,0,180),v=mO(m,u.y,p.h,90,270);Wie(n,t,h,b,v)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=qie(e,r,o)}function Wie(e,t,n,r,o){const i=Math.abs(Math.sin(n)),s=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/i,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/i,e.r=Math.max(e.r,t.r+a)),o.start<t.t?(l=(t.t-o.start)/s,e.t=Math.min(e.t,t.t-l)):o.end>t.b&&(l=(o.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function Uie(e,t,n){const r=e.drawingArea,{extra:o,additionalAngle:i,padding:s,size:a}=n,l=e.getPointPosition(t,r+o+s,i),c=Math.round(KC(Eo(l.angle+kn))),u=Xie(l.y,a.h,c),d=Yie(c),p=Kie(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:p,top:u,right:p+a.w,bottom:u+a.h}}function Gie(e,t){if(!t)return!0;const{left:n,top:r,right:o,bottom:i}=e;return!(Vs({x:n,y:r},t)||Vs({x:n,y:i},t)||Vs({x:o,y:r},t)||Vs({x:o,y:i},t))}function qie(e,t,n){const r=[],o=e._pointLabels.length,i=e.options,{centerPointLabels:s,display:a}=i.pointLabels,l={extra:aS(i)/2,additionalAngle:s?hn/o:0};let c;for(let u=0;u<o;u++){l.padding=n[u],l.size=t[u];const d=Uie(e,u,l);r.push(d),a==="auto"&&(d.visible=Gie(d,c),d.visible&&(c=d))}return r}function Yie(e){return e===0||e===180?"center":e<180?"left":"right"}function Kie(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function Xie(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function Qie(e,t,n){const{left:r,top:o,right:i,bottom:s}=n,{backdropColor:a}=t;if(!ct(a)){const l=Ql(t.borderRadius),c=ir(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=o-c.top,p=i-r+c.width,h=s-o+c.height;Object.values(l).some(m=>m!==0)?(e.beginPath(),Sh(e,{x:u,y:d,w:p,h,radius:l}),e.fill()):e.fillRect(u,d,p,h)}}function Zie(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let o=t-1;o>=0;o--){const i=e._pointLabelItems[o];if(!i.visible)continue;const s=r.setContext(e.getPointLabelContext(o));Qie(n,s,i);const a=Dn(s.font),{x:l,y:c,textAlign:u}=i;pc(n,e._pointLabels[o],l,c+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function PF(e,t,n,r){const{ctx:o}=e;if(n)o.arc(e.xCenter,e.yCenter,t,0,dn);else{let i=e.getPointPosition(0,t);o.moveTo(i.x,i.y);for(let s=1;s<r;s++)i=e.getPointPosition(s,t),o.lineTo(i.x,i.y)}}function Jie(e,t,n,r,o){const i=e.ctx,s=t.circular,{color:a,lineWidth:l}=t;!s&&!r||!a||!l||n<0||(i.save(),i.strokeStyle=a,i.lineWidth=l,i.setLineDash(o.dash||[]),i.lineDashOffset=o.dashOffset,i.beginPath(),PF(e,n,s,r),i.closePath(),i.stroke(),i.restore())}function ese(e,t,n){return Ka(e,{label:n,index:t,type:"pointLabel"})}class Ff extends kb{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=ir(aS(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=En(t)&&!isNaN(t)?t:0,this.max=En(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/aS(this.options))}generateTickLabels(t){kb.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const o=Xt(this.options.pointLabels.callback,[n,r],this);return o||o===0?o:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?Vie(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,o){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-o)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,o))}getIndexAngle(t){const n=dn/(this._pointLabels.length||1),r=this.options.startAngle||0;return Eo(t*n+vi(r))}getDistanceFromCenterForValue(t){if(ct(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(ct(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return ese(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const o=this.getIndexAngle(t)-kn+r;return{x:Math.cos(o)*n+this.xCenter,y:Math.sin(o)*n+this.yCenter,angle:o}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:o,bottom:i}=this._pointLabelItems[t];return{left:n,top:r,right:o,bottom:i}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),PF(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:o,border:i}=n,s=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&Zie(this,s),o.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const p=this.getContext(d),h=o.setContext(p),m=i.setContext(p);Jie(this,h,l,s,m)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:p}=u;!p||!d||(t.lineWidth=p,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const o=this.getIndexAngle(0);let i,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(o),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=Dn(c.font);if(i=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=ir(c.backdropPadding);t.fillRect(-s/2-d.left,-i-u.size/2-d.top,s+d.width,u.size+d.height)}pc(t,a.label,0,-i,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Te(Ff,"id","radialLinear"),Te(Ff,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:G0.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Te(Ff,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Te(Ff,"descriptors",{angleLines:{_fallback:"grid"}});const K0={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},oo=Object.keys(K0);function bO(e,t){return e-t}function yO(e,t){if(ct(t))return null;const n=e._adapter,{parser:r,round:o,isoWeekday:i}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),En(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(o&&(s=o==="week"&&(nd(i)||i===!0)?n.startOf(s,"isoWeek",i):n.startOf(s,o)),+s)}function vO(e,t,n,r){const o=oo.length;for(let i=oo.indexOf(e);i<o-1;++i){const s=K0[oo[i]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return oo[i]}return oo[o-1]}function tse(e,t,n,r,o){for(let i=oo.length-1;i>=oo.indexOf(n);i--){const s=oo[i];if(K0[s].common&&e._adapter.diff(o,r,s)>=t-1)return s}return oo[n?oo.indexOf(n):0]}function nse(e){for(let t=oo.indexOf(e)+1,n=oo.length;t<n;++t)if(K0[oo[t]].common)return oo[t]}function xO(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:o}=XC(n,t),i=n[r]>=t?n[r]:n[o];e[i]=!0}}function rse(e,t,n,r){const o=e._adapter,i=+o.startOf(t[0].value,r),s=t[t.length-1].value;let a,l;for(a=i;a<=s;a=+o.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function wO(e,t,n){const r=[],o={},i=t.length;let s,a;for(s=0;s<i;++s)a=t[s],o[a]=s,r.push({value:a,major:!1});return i===0||!n?r:rse(e,r,o,n)}class Eh extends Xa{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),o=this._adapter=new fre._date(t.adapters.date);o.init(n),Yf(r.displayFormats,o.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:yO(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:o,max:i,minDefined:s,maxDefined:a}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(o=Math.min(o,c.min)),!a&&!isNaN(c.max)&&(i=Math.max(i,c.max))}(!s||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),o=En(o)&&!isNaN(o)?o:+n.startOf(Date.now(),r),i=En(i)&&!isNaN(i)?i:+n.endOf(Date.now(),r)+1,this.min=Math.min(o,i-1),this.max=Math.max(o+1,i)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,o=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);const i=this.min,s=this.max,a=Fte(o,i,s);return this._unit=n.unit||(r.autoSkip?vO(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):tse(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:nse(this._unit),this.initOffsets(o),t.reverse&&a.reverse(),wO(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,o,i;this.options.offset&&t.length&&(o=this.getDecimalForValue(t[0]),t.length===1?n=1-o:n=(this.getDecimalForValue(t[1])-o)/2,i=this.getDecimalForValue(t[t.length-1]),t.length===1?r=i:r=(i-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=Xn(n,0,s),r=Xn(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,o=this.options,i=o.time,s=i.unit||vO(i.minUnit,n,r,this._getLabelCapacity(n)),a=Je(o.ticks.stepSize,1),l=s==="week"?i.isoWeekday:!1,c=nd(l)||l===!0,u={};let d=n,p,h;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(r,n,s)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+s);const m=o.ticks.source==="data"&&this.getDataTimestamps();for(p=d,h=0;p<r;p=+t.add(p,a,s),h++)xO(u,p,m);return(p===r||o.bounds==="ticks"||h===1)&&xO(u,p,m),Object.keys(u).sort(bO).map(b=>+b)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const o=this.options.time.displayFormats,i=this._unit,s=n||o[i];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,o){const i=this.options,s=i.ticks.callback;if(s)return Xt(s,[t,n,r],this);const a=i.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],p=r[n],h=c&&d&&p&&p.major;return this._adapter.format(t,o||(h?d:u))}generateTickLabels(t){let n,r,o;for(n=0,r=t.length;n<r;++n)o=t[n],o.label=this._tickFormatFunction(o.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,o=vi(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(o),s=Math.sin(o),a=this._resolveTickFontOptions(0).size;return{w:r*i+a*s,h:r*s+a*i}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,o=r[n.unit]||r.millisecond,i=this._tickFormatFunction(t,0,wO(this,[t],this._majorUnit),o),s=this._getLabelSize(i),a=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(n=0,r=o.length;n<r;++n)t=t.concat(o[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const o=this.getLabels();for(n=0,r=o.length;n<r;++n)t.push(yO(this,o[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return $L(t.sort(bO))}}Te(Eh,"id","time"),Te(Eh,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function om(e,t,n){let r=0,o=e.length-1,i,s,a,l;n?(t>=e[r].pos&&t<=e[o].pos&&({lo:r,hi:o}=Hs(e,"pos",t)),{pos:i,time:a}=e[r],{pos:s,time:l}=e[o]):(t>=e[r].time&&t<=e[o].time&&({lo:r,hi:o}=Hs(e,"time",t)),{time:i,pos:a}=e[r],{time:s,pos:l}=e[o]);const c=s-i;return c?a+(l-a)*(t-i)/c:a}class lS extends Eh{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=om(n,this.min),this._tableRange=om(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,o=[],i=[];let s,a,l,c,u;for(s=0,a=t.length;s<a;++s)c=t[s],c>=n&&c<=r&&o.push(c);if(o.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=o.length;s<a;++s)u=o[s+1],l=o[s-1],c=o[s],Math.round((u+l)/2)!==c&&i.push({time:c,pos:s/(a-1)});return i}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((o,i)=>o-i)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(om(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return om(this._table,r*this._tableRange+this._minPos,!0)}}Te(lS,"id","timeseries"),Te(lS,"defaults",Eh.defaults);var ose=Object.freeze({__proto__:null,CategoryScale:Tb,LinearScale:id,LogarithmicScale:sd,RadialLinearScale:Ff,TimeScale:Eh,TimeSeriesScale:lS});const ise=[dre,Boe,Nie,ose];class $a{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let o=0;o<this._n&&o<32;o++){const i=n[o],s=t+i,a=Math.abs(t)<Math.abs(i)?t-(s-i):i-(s-t);a&&(n[r++]=a),t=s}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,o,i,s=0;if(n>0){for(s=t[--n];n>0&&(r=s,o=t[--n],s=r+o,i=o-(s-r),!i););n>0&&(i<0&&t[n-1]<0||i>0&&t[n-1]>0)&&(o=i*2,r=s+o,o==r-s&&(s=r))}return s}}function*sse(e){for(const t of e)yield*t}function TF(e){return Array.from(sse(e))}function gu(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(o);++r<o;)i[r]=e+r*n;return i}var Ye=1e-6,kF=1e-12,yt=Math.PI,Cn=yt/2,SO=yt/4,Mo=yt*2,Mr=180/yt,Qt=yt/180,Dt=Math.abs,Cd=Math.atan,es=Math.atan2,lt=Math.cos,im=Math.ceil,AF=Math.exp,Ab=Math.log,Gx=Math.pow,nt=Math.sin,ei=Math.sign||function(e){return e>0?1:e<0?-1:0},Fr=Math.sqrt,lE=Math.tan;function OF(e){return e>1?0:e<-1?yt:Math.acos(e)}function ri(e){return e>1?Cn:e<-1?-Cn:Math.asin(e)}function Kn(){}function Ob(e,t){e&&CO.hasOwnProperty(e.type)&&CO[e.type](e,t)}var _O={Feature:function(e,t){Ob(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)Ob(n[r].geometry,t)}},CO={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){cS(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)cS(n[r],t,0)},Polygon:function(e,t){EO(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)EO(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)Ob(n[r],t)}};function cS(e,t,n){var r=-1,o=e.length-n,i;for(t.lineStart();++r<o;)i=e[r],t.point(i[0],i[1],i[2]);t.lineEnd()}function EO(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)cS(e[n],t,1);t.polygonEnd()}function Rl(e,t){e&&_O.hasOwnProperty(e.type)?_O[e.type](e,t):Ob(e,t)}function uS(e){return[es(e[1],e[0]),ri(e[2])]}function ad(e){var t=e[0],n=e[1],r=lt(n);return[r*lt(t),r*nt(t),nt(n)]}function sm(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Mb(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function qx(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function am(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function dS(e){var t=Fr(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function fS(e,t){function n(r,o){return r=e(r,o),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,o){return r=t.invert(r,o),r&&e.invert(r[0],r[1])}),n}function hS(e,t){return Dt(e)>yt&&(e-=Math.round(e/Mo)*Mo),[e,t]}hS.invert=hS;function MF(e,t,n){return(e%=Mo)?t||n?fS(PO(e),TO(t,n)):PO(e):t||n?TO(t,n):hS}function RO(e){return function(t,n){return t+=e,Dt(t)>yt&&(t-=Math.round(t/Mo)*Mo),[t,n]}}function PO(e){var t=RO(e);return t.invert=RO(-e),t}function TO(e,t){var n=lt(e),r=nt(e),o=lt(t),i=nt(t);function s(a,l){var c=lt(l),u=lt(a)*c,d=nt(a)*c,p=nt(l),h=p*n+u*r;return[es(d*o-h*i,u*n-p*r),ri(h*o+d*i)]}return s.invert=function(a,l){var c=lt(l),u=lt(a)*c,d=nt(a)*c,p=nt(l),h=p*o-d*i;return[es(d*o+p*i,u*n+h*r),ri(h*n-u*r)]},s}function ase(e){e=MF(e[0]*Qt,e[1]*Qt,e.length>2?e[2]*Qt:0);function t(n){return n=e(n[0]*Qt,n[1]*Qt),n[0]*=Mr,n[1]*=Mr,n}return t.invert=function(n){return n=e.invert(n[0]*Qt,n[1]*Qt),n[0]*=Mr,n[1]*=Mr,n},t}function lse(e,t,n,r,o,i){if(n){var s=lt(t),a=nt(t),l=r*n;o==null?(o=t+r*Mo,i=t-l/2):(o=kO(s,o),i=kO(s,i),(r>0?o<i:o>i)&&(o+=r*Mo));for(var c,u=o;r>0?u>i:u<i;u-=l)c=uS([s,-a*lt(u),-a*nt(u)]),e.point(c[0],c[1])}}function kO(e,t){t=ad(t),t[0]-=e,dS(t);var n=OF(-t[1]);return((-t[2]<0?-n:n)+Mo-Ye)%Mo}function IF(){var e=[],t;return{point:function(n,r,o){t.push([n,r,o])},lineStart:function(){e.push(t=[])},lineEnd:Kn,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Zm(e,t){return Dt(e[0]-t[0])<Ye&&Dt(e[1]-t[1])<Ye}function lm(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function DF(e,t,n,r,o){var i=[],s=[],a,l;if(e.forEach(function(m){if(!((b=m.length-1)<=0)){var b,v=m[0],x=m[b],w;if(Zm(v,x)){if(!v[2]&&!x[2]){for(o.lineStart(),a=0;a<b;++a)o.point((v=m[a])[0],v[1]);o.lineEnd();return}x[0]+=2*Ye}i.push(w=new lm(v,m,null,!0)),s.push(w.o=new lm(v,null,w,!1)),i.push(w=new lm(x,m,null,!1)),s.push(w.o=new lm(x,null,w,!0))}}),!!i.length){for(s.sort(t),AO(i),AO(s),a=0,l=s.length;a<l;++a)s[a].e=n=!n;for(var c=i[0],u,d;;){for(var p=c,h=!0;p.v;)if((p=p.n)===c)return;u=p.z,o.lineStart();do{if(p.v=p.o.v=!0,p.e){if(h)for(a=0,l=u.length;a<l;++a)o.point((d=u[a])[0],d[1]);else r(p.x,p.n.x,1,o);p=p.n}else{if(h)for(u=p.p.z,a=u.length-1;a>=0;--a)o.point((d=u[a])[0],d[1]);else r(p.x,p.p.x,-1,o);p=p.p}p=p.o,u=p.z,h=!h}while(!p.v);o.lineEnd()}}}function AO(e){if(t=e.length){for(var t,n=0,r=e[0],o;++n<t;)r.n=o=e[n],o.p=r,r=o;r.n=o=e[0],o.p=r}}function Yx(e){return Dt(e[0])<=yt?e[0]:ei(e[0])*((Dt(e[0])+yt)%Mo-yt)}function NF(e,t){var n=Yx(t),r=t[1],o=nt(r),i=[nt(n),-lt(n),0],s=0,a=0,l=new $a;o===1?r=Cn+Ye:o===-1&&(r=-Cn-Ye);for(var c=0,u=e.length;c<u;++c)if(p=(d=e[c]).length)for(var d,p,h=d[p-1],m=Yx(h),b=h[1]/2+SO,v=nt(b),x=lt(b),w=0;w<p;++w,m=R,v=E,x=A,h=_){var _=d[w],R=Yx(_),C=_[1]/2+SO,E=nt(C),A=lt(C),M=R-m,N=M>=0?1:-1,L=N*M,F=L>yt,z=v*E;if(l.add(es(z*N*nt(L),x*A+z*lt(L))),s+=F?M+N*Mo:M,F^m>=n^R>=n){var Z=Mb(ad(h),ad(_));dS(Z);var G=Mb(i,Z);dS(G);var j=(F^M>=0?-1:1)*ri(G[2]);(r>j||r===j&&(Z[0]||Z[1]))&&(a+=F^M>=0?1:-1)}}return(s<-1e-6||s<Ye&&l<-1e-12)^a&1}function LF(e,t,n,r){return function(o){var i=t(o),s=IF(),a=t(s),l=!1,c,u,d,p={point:h,lineStart:b,lineEnd:v,polygonStart:function(){p.point=x,p.lineStart=w,p.lineEnd=_,u=[],c=[]},polygonEnd:function(){p.point=h,p.lineStart=b,p.lineEnd=v,u=TF(u);var R=NF(c,r);u.length?(l||(o.polygonStart(),l=!0),DF(u,use,R,n,o)):R&&(l||(o.polygonStart(),l=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),l&&(o.polygonEnd(),l=!1),u=c=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function h(R,C){e(R,C)&&o.point(R,C)}function m(R,C){i.point(R,C)}function b(){p.point=m,i.lineStart()}function v(){p.point=h,i.lineEnd()}function x(R,C){d.push([R,C]),a.point(R,C)}function w(){a.lineStart(),d=[]}function _(){x(d[0][0],d[0][1]),a.lineEnd();var R=a.clean(),C=s.result(),E,A=C.length,M,N,L;if(d.pop(),c.push(d),d=null,!!A){if(R&1){if(N=C[0],(M=N.length-1)>0){for(l||(o.polygonStart(),l=!0),o.lineStart(),E=0;E<M;++E)o.point((L=N[E])[0],L[1]);o.lineEnd()}return}A>1&&R&2&&C.push(C.pop().concat(C.shift())),u.push(C.filter(cse))}}return p}}function cse(e){return e.length>1}function use(e,t){return((e=e.x)[0]<0?e[1]-Cn-Ye:Cn-e[1])-((t=t.x)[0]<0?t[1]-Cn-Ye:Cn-t[1])}const OO=LF(function(){return!0},dse,hse,[-yt,-Cn]);function dse(e){var t=NaN,n=NaN,r=NaN,o;return{lineStart:function(){e.lineStart(),o=1},point:function(i,s){var a=i>0?yt:-yt,l=Dt(i-t);Dt(l-yt)<Ye?(e.point(t,n=(n+s)/2>0?Cn:-Cn),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(i,n),o=0):r!==a&&l>=yt&&(Dt(t-r)<Ye&&(t-=r*Ye),Dt(i-a)<Ye&&(i-=a*Ye),n=fse(t,n,i,s),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),o=0),e.point(t=i,n=s),r=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-o}}}function fse(e,t,n,r){var o,i,s=nt(e-n);return Dt(s)>Ye?Cd((nt(t)*(i=lt(r))*nt(n)-nt(r)*(o=lt(t))*nt(e))/(o*i*s)):(t+r)/2}function hse(e,t,n,r){var o;if(e==null)o=n*Cn,r.point(-yt,o),r.point(0,o),r.point(yt,o),r.point(yt,0),r.point(yt,-o),r.point(0,-o),r.point(-yt,-o),r.point(-yt,0),r.point(-yt,o);else if(Dt(e[0]-t[0])>Ye){var i=e[0]<t[0]?yt:-yt;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(t[0],t[1])}function pse(e){var t=lt(e),n=2*Qt,r=t>0,o=Dt(t)>Ye;function i(u,d,p,h){lse(h,e,n,p,u,d)}function s(u,d){return lt(u)*lt(d)>t}function a(u){var d,p,h,m,b;return{lineStart:function(){m=h=!1,b=1},point:function(v,x){var w=[v,x],_,R=s(v,x),C=r?R?0:c(v,x):R?c(v+(v<0?yt:-yt),x):0;if(!d&&(m=h=R)&&u.lineStart(),R!==h&&(_=l(d,w),(!_||Zm(d,_)||Zm(w,_))&&(w[2]=1)),R!==h)b=0,R?(u.lineStart(),_=l(w,d),u.point(_[0],_[1])):(_=l(d,w),u.point(_[0],_[1],2),u.lineEnd()),d=_;else if(o&&d&&r^R){var E;!(C&p)&&(E=l(w,d,!0))&&(b=0,r?(u.lineStart(),u.point(E[0][0],E[0][1]),u.point(E[1][0],E[1][1]),u.lineEnd()):(u.point(E[1][0],E[1][1]),u.lineEnd(),u.lineStart(),u.point(E[0][0],E[0][1],3)))}R&&(!d||!Zm(d,w))&&u.point(w[0],w[1]),d=w,h=R,p=C},lineEnd:function(){h&&u.lineEnd(),d=null},clean:function(){return b|(m&&h)<<1}}}function l(u,d,p){var h=ad(u),m=ad(d),b=[1,0,0],v=Mb(h,m),x=sm(v,v),w=v[0],_=x-w*w;if(!_)return!p&&u;var R=t*x/_,C=-t*w/_,E=Mb(b,v),A=am(b,R),M=am(v,C);qx(A,M);var N=E,L=sm(A,N),F=sm(N,N),z=L*L-F*(sm(A,A)-1);if(!(z<0)){var Z=Fr(z),G=am(N,(-L-Z)/F);if(qx(G,A),G=uS(G),!p)return G;var j=u[0],H=d[0],$=u[1],V=d[1],X;H<j&&(X=j,j=H,H=X);var I=H-j,q=Dt(I-yt)<Ye,U=q||I<Ye;if(!q&&V<$&&(X=$,$=V,V=X),U?q?$+V>0^G[1]<(Dt(G[0]-j)<Ye?$:V):$<=G[1]&&G[1]<=V:I>yt^(j<=G[0]&&G[0]<=H)){var O=am(N,(-L+Z)/F);return qx(O,A),[G,uS(O)]}}}function c(u,d){var p=r?e:yt-e,h=0;return u<-p?h|=1:u>p&&(h|=2),d<-p?h|=4:d>p&&(h|=8),h}return LF(s,a,i,r?[0,-e]:[-yt,e-yt])}function gse(e,t,n,r,o,i){var s=e[0],a=e[1],l=t[0],c=t[1],u=0,d=1,p=l-s,h=c-a,m;if(m=n-s,!(!p&&m>0)){if(m/=p,p<0){if(m<u)return;m<d&&(d=m)}else if(p>0){if(m>d)return;m>u&&(u=m)}if(m=o-s,!(!p&&m<0)){if(m/=p,p<0){if(m>d)return;m>u&&(u=m)}else if(p>0){if(m<u)return;m<d&&(d=m)}if(m=r-a,!(!h&&m>0)){if(m/=h,h<0){if(m<u)return;m<d&&(d=m)}else if(h>0){if(m>d)return;m>u&&(u=m)}if(m=i-a,!(!h&&m<0)){if(m/=h,h<0){if(m>d)return;m>u&&(u=m)}else if(h>0){if(m<u)return;m<d&&(d=m)}return u>0&&(e[0]=s+u*p,e[1]=a+u*h),d<1&&(t[0]=s+d*p,t[1]=a+d*h),!0}}}}}var cm=1e9,um=-1e9;function mse(e,t,n,r){function o(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function i(c,u,d,p){var h=0,m=0;if(c==null||(h=s(c,d))!==(m=s(u,d))||l(c,u)<0^d>0)do p.point(h===0||h===3?e:n,h>1?r:t);while((h=(h+d+4)%4)!==m);else p.point(u[0],u[1])}function s(c,u){return Dt(c[0]-e)<Ye?u>0?0:3:Dt(c[0]-n)<Ye?u>0?2:1:Dt(c[1]-t)<Ye?u>0?1:0:u>0?3:2}function a(c,u){return l(c.x,u.x)}function l(c,u){var d=s(c,1),p=s(u,1);return d!==p?d-p:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=IF(),p,h,m,b,v,x,w,_,R,C,E,A={point:M,lineStart:z,lineEnd:Z,polygonStart:L,polygonEnd:F};function M(j,H){o(j,H)&&u.point(j,H)}function N(){for(var j=0,H=0,$=h.length;H<$;++H)for(var V=h[H],X=1,I=V.length,q=V[0],U,O,J=q[0],K=q[1];X<I;++X)U=J,O=K,q=V[X],J=q[0],K=q[1],O<=r?K>r&&(J-U)*(r-O)>(K-O)*(e-U)&&++j:K<=r&&(J-U)*(r-O)<(K-O)*(e-U)&&--j;return j}function L(){u=d,p=[],h=[],E=!0}function F(){var j=N(),H=E&&j,$=(p=TF(p)).length;(H||$)&&(c.polygonStart(),H&&(c.lineStart(),i(null,null,1,c),c.lineEnd()),$&&DF(p,a,j,i,c),c.polygonEnd()),u=c,p=h=m=null}function z(){A.point=G,h&&h.push(m=[]),C=!0,R=!1,w=_=NaN}function Z(){p&&(G(b,v),x&&R&&d.rejoin(),p.push(d.result())),A.point=M,R&&u.lineEnd()}function G(j,H){var $=o(j,H);if(h&&m.push([j,H]),C)b=j,v=H,x=$,C=!1,$&&(u.lineStart(),u.point(j,H));else if($&&R)u.point(j,H);else{var V=[w=Math.max(um,Math.min(cm,w)),_=Math.max(um,Math.min(cm,_))],X=[j=Math.max(um,Math.min(cm,j)),H=Math.max(um,Math.min(cm,H))];gse(V,X,e,t,n,r)?(R||(u.lineStart(),u.point(V[0],V[1])),u.point(X[0],X[1]),$||u.lineEnd(),E=!1):$&&(u.lineStart(),u.point(j,H),E=!1)}w=j,_=H,R=$}return A}}var pS,gS,Jm,eb,ld={sphere:Kn,point:Kn,lineStart:bse,lineEnd:Kn,polygonStart:Kn,polygonEnd:Kn};function bse(){ld.point=vse,ld.lineEnd=yse}function yse(){ld.point=ld.lineEnd=Kn}function vse(e,t){e*=Qt,t*=Qt,gS=e,Jm=nt(t),eb=lt(t),ld.point=xse}function xse(e,t){e*=Qt,t*=Qt;var n=nt(t),r=lt(t),o=Dt(e-gS),i=lt(o),s=nt(o),a=r*s,l=eb*n-Jm*r*i,c=Jm*n+eb*r*i;pS.add(es(Fr(a*a+l*l),c)),gS=e,Jm=n,eb=r}function wse(e){return pS=new $a,Rl(e,ld),+pS}var mS=[null,null],Sse={type:"LineString",coordinates:mS};function bS(e,t){return mS[0]=e,mS[1]=t,wse(Sse)}var MO={Feature:function(e,t){return Ib(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)if(Ib(n[r].geometry,t))return!0;return!1}},IO={Sphere:function(){return!0},Point:function(e,t){return DO(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(DO(n[r],t))return!0;return!1},LineString:function(e,t){return NO(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(NO(n[r],t))return!0;return!1},Polygon:function(e,t){return LO(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(LO(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)if(Ib(n[r],t))return!0;return!1}};function Ib(e,t){return e&&IO.hasOwnProperty(e.type)?IO[e.type](e,t):!1}function DO(e,t){return bS(e,t)===0}function NO(e,t){for(var n,r,o,i=0,s=e.length;i<s;i++){if(r=bS(e[i],t),r===0||i>0&&(o=bS(e[i],e[i-1]),o>0&&n<=o&&r<=o&&(n+r-o)*(1-Math.pow((n-r)/o,2))<kF*o))return!0;n=r}return!1}function LO(e,t){return!!NF(e.map(_se),FF(t))}function _se(e){return e=e.map(FF),e.pop(),e}function FF(e){return[e[0]*Qt,e[1]*Qt]}function Cse(e,t){return(e&&MO.hasOwnProperty(e.type)?MO[e.type]:Ib)(e,t)}function FO(e,t,n){var r=gu(e,t-Ye,n).concat(t);return function(o){return r.map(function(i){return[o,i]})}}function jO(e,t,n){var r=gu(e,t-Ye,n).concat(t);return function(o){return r.map(function(i){return[i,o]})}}function jF(){var e,t,n,r,o,i,s,a,l=10,c=l,u=90,d=360,p,h,m,b,v=2.5;function x(){return{type:"MultiLineString",coordinates:w()}}function w(){return gu(im(r/u)*u,n,u).map(m).concat(gu(im(a/d)*d,s,d).map(b)).concat(gu(im(t/l)*l,e,l).filter(function(_){return Dt(_%u)>Ye}).map(p)).concat(gu(im(i/c)*c,o,c).filter(function(_){return Dt(_%d)>Ye}).map(h))}return x.lines=function(){return w().map(function(_){return{type:"LineString",coordinates:_}})},x.outline=function(){return{type:"Polygon",coordinates:[m(r).concat(b(s).slice(1),m(n).reverse().slice(1),b(a).reverse().slice(1))]}},x.extent=function(_){return arguments.length?x.extentMajor(_).extentMinor(_):x.extentMinor()},x.extentMajor=function(_){return arguments.length?(r=+_[0][0],n=+_[1][0],a=+_[0][1],s=+_[1][1],r>n&&(_=r,r=n,n=_),a>s&&(_=a,a=s,s=_),x.precision(v)):[[r,a],[n,s]]},x.extentMinor=function(_){return arguments.length?(t=+_[0][0],e=+_[1][0],i=+_[0][1],o=+_[1][1],t>e&&(_=t,t=e,e=_),i>o&&(_=i,i=o,o=_),x.precision(v)):[[t,i],[e,o]]},x.step=function(_){return arguments.length?x.stepMajor(_).stepMinor(_):x.stepMinor()},x.stepMajor=function(_){return arguments.length?(u=+_[0],d=+_[1],x):[u,d]},x.stepMinor=function(_){return arguments.length?(l=+_[0],c=+_[1],x):[l,c]},x.precision=function(_){return arguments.length?(v=+_,p=FO(i,o,90),h=jO(t,e,v),m=FO(a,s,90),b=jO(r,n,v),x):v},x.extentMajor([[-180,-90+Ye],[180,90-Ye]]).extentMinor([[-180,-80-Ye],[180,80+Ye]])}function Ese(){return jF()()}const yS=e=>e;var Kx=new $a,vS=new $a,$F,zF,xS,wS,Fs={point:Kn,lineStart:Kn,lineEnd:Kn,polygonStart:function(){Fs.lineStart=Rse,Fs.lineEnd=Tse},polygonEnd:function(){Fs.lineStart=Fs.lineEnd=Fs.point=Kn,Kx.add(Dt(vS)),vS=new $a},result:function(){var e=Kx/2;return Kx=new $a,e}};function Rse(){Fs.point=Pse}function Pse(e,t){Fs.point=BF,$F=xS=e,zF=wS=t}function BF(e,t){vS.add(wS*e-xS*t),xS=e,wS=t}function Tse(){BF($F,zF)}var cd=1/0,Db=cd,Rh=-cd,Nb=Rh,Lb={point:kse,lineStart:Kn,lineEnd:Kn,polygonStart:Kn,polygonEnd:Kn,result:function(){var e=[[cd,Db],[Rh,Nb]];return Rh=Nb=-(Db=cd=1/0),e}};function kse(e,t){e<cd&&(cd=e),e>Rh&&(Rh=e),t<Db&&(Db=t),t>Nb&&(Nb=t)}var SS=0,_S=0,jf=0,Fb=0,jb=0,mu=0,CS=0,ES=0,$f=0,HF,VF,Hi,Vi,Zo={point:gc,lineStart:$O,lineEnd:zO,polygonStart:function(){Zo.lineStart=Mse,Zo.lineEnd=Ise},polygonEnd:function(){Zo.point=gc,Zo.lineStart=$O,Zo.lineEnd=zO},result:function(){var e=$f?[CS/$f,ES/$f]:mu?[Fb/mu,jb/mu]:jf?[SS/jf,_S/jf]:[NaN,NaN];return SS=_S=jf=Fb=jb=mu=CS=ES=$f=0,e}};function gc(e,t){SS+=e,_S+=t,++jf}function $O(){Zo.point=Ase}function Ase(e,t){Zo.point=Ose,gc(Hi=e,Vi=t)}function Ose(e,t){var n=e-Hi,r=t-Vi,o=Fr(n*n+r*r);Fb+=o*(Hi+e)/2,jb+=o*(Vi+t)/2,mu+=o,gc(Hi=e,Vi=t)}function zO(){Zo.point=gc}function Mse(){Zo.point=Dse}function Ise(){WF(HF,VF)}function Dse(e,t){Zo.point=WF,gc(HF=Hi=e,VF=Vi=t)}function WF(e,t){var n=e-Hi,r=t-Vi,o=Fr(n*n+r*r);Fb+=o*(Hi+e)/2,jb+=o*(Vi+t)/2,mu+=o,o=Vi*e-Hi*t,CS+=o*(Hi+e),ES+=o*(Vi+t),$f+=o*3,gc(Hi=e,Vi=t)}function UF(e){this._context=e}UF.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Mo);break}}},result:Kn};var RS=new $a,Xx,GF,qF,zf,Bf,Ph={point:Kn,lineStart:function(){Ph.point=Nse},lineEnd:function(){Xx&&YF(GF,qF),Ph.point=Kn},polygonStart:function(){Xx=!0},polygonEnd:function(){Xx=null},result:function(){var e=+RS;return RS=new $a,e}};function Nse(e,t){Ph.point=YF,GF=zf=e,qF=Bf=t}function YF(e,t){zf-=e,Bf-=t,RS.add(Fr(zf*zf+Bf*Bf)),zf=e,Bf=t}let BO,$b,HO,VO;class WO{constructor(t){this._append=t==null?KF:Lse(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==HO||this._append!==$b){const r=this._radius,o=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,HO=r,$b=this._append,VO=this._,this._=o}this._+=VO;break}}}result(){const t=this._;return this._="",t.length?t:null}}function KF(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Lse(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return KF;if(t!==BO){const n=10**t;BO=t,$b=function(o){let i=1;this._+=o[0];for(const s=o.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+o[i]}}return $b}function UO(e,t){let n=3,r=4.5,o,i;function s(a){return a&&(typeof r=="function"&&i.pointRadius(+r.apply(this,arguments)),Rl(a,o(i))),i.result()}return s.area=function(a){return Rl(a,o(Fs)),Fs.result()},s.measure=function(a){return Rl(a,o(Ph)),Ph.result()},s.bounds=function(a){return Rl(a,o(Lb)),Lb.result()},s.centroid=function(a){return Rl(a,o(Zo)),Zo.result()},s.projection=function(a){return arguments.length?(o=a==null?(e=null,yS):(e=a).stream,s):e},s.context=function(a){return arguments.length?(i=a==null?(t=null,new WO(n)):new UF(t=a),typeof r!="function"&&i.pointRadius(r),s):t},s.pointRadius=function(a){return arguments.length?(r=typeof a=="function"?a:(i.pointRadius(+a),+a),s):r},s.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{const l=Math.floor(a);if(!(l>=0))throw new RangeError(`invalid digits: ${a}`);n=l}return t===null&&(i=new WO(n)),s},s.projection(e).digits(n).context(t)}function cE(e){return function(t){var n=new PS;for(var r in e)n[r]=e[r];return n.stream=t,n}}function PS(){}PS.prototype={constructor:PS,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function uE(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Rl(n,e.stream(Lb)),t(Lb.result()),r!=null&&e.clipExtent(r),e}function dE(e,t,n){return uE(e,function(r){var o=t[1][0]-t[0][0],i=t[1][1]-t[0][1],s=Math.min(o/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),a=+t[0][0]+(o-s*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(i-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,l])},n)}function XF(e,t,n){return dE(e,[[0,0],t],n)}function QF(e,t,n){return uE(e,function(r){var o=+t,i=o/(r[1][0]-r[0][0]),s=(o-i*(r[1][0]+r[0][0]))/2,a=-i*r[0][1];e.scale(150*i).translate([s,a])},n)}function ZF(e,t,n){return uE(e,function(r){var o=+t,i=o/(r[1][1]-r[0][1]),s=-i*r[0][0],a=(o-i*(r[1][1]+r[0][1]))/2;e.scale(150*i).translate([s,a])},n)}var GO=16,Fse=lt(30*Qt);function qO(e,t){return+t?$se(e,t):jse(e)}function jse(e){return cE({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function $se(e,t){function n(r,o,i,s,a,l,c,u,d,p,h,m,b,v){var x=c-r,w=u-o,_=x*x+w*w;if(_>4*t&&b--){var R=s+p,C=a+h,E=l+m,A=Fr(R*R+C*C+E*E),M=ri(E/=A),N=Dt(Dt(E)-1)<Ye||Dt(i-d)<Ye?(i+d)/2:es(C,R),L=e(N,M),F=L[0],z=L[1],Z=F-r,G=z-o,j=w*Z-x*G;(j*j/_>t||Dt((x*Z+w*G)/_-.5)>.3||s*p+a*h+l*m<Fse)&&(n(r,o,i,s,a,l,F,z,N,R/=A,C/=A,E,b,v),v.point(F,z),n(F,z,N,R,C,E,c,u,d,p,h,m,b,v))}}return function(r){var o,i,s,a,l,c,u,d,p,h,m,b,v={point:x,lineStart:w,lineEnd:R,polygonStart:function(){r.polygonStart(),v.lineStart=C},polygonEnd:function(){r.polygonEnd(),v.lineStart=w}};function x(M,N){M=e(M,N),r.point(M[0],M[1])}function w(){d=NaN,v.point=_,r.lineStart()}function _(M,N){var L=ad([M,N]),F=e(M,N);n(d,p,u,h,m,b,d=F[0],p=F[1],u=M,h=L[0],m=L[1],b=L[2],GO,r),r.point(d,p)}function R(){v.point=x,r.lineEnd()}function C(){w(),v.point=E,v.lineEnd=A}function E(M,N){_(o=M,N),i=d,s=p,a=h,l=m,c=b,v.point=_}function A(){n(d,p,u,h,m,b,i,s,o,a,l,c,GO,r),v.lineEnd=R,R()}return v}}var zse=cE({point:function(e,t){this.stream.point(e*Qt,t*Qt)}});function Bse(e){return cE({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function Hse(e,t,n,r,o){function i(s,a){return s*=r,a*=o,[t+e*s,n-e*a]}return i.invert=function(s,a){return[(s-t)/e*r,(n-a)/e*o]},i}function YO(e,t,n,r,o,i){if(!i)return Hse(e,t,n,r,o);var s=lt(i),a=nt(i),l=s*e,c=a*e,u=s/e,d=a/e,p=(a*n-s*t)/e,h=(a*t+s*n)/e;function m(b,v){return b*=r,v*=o,[l*b-c*v+t,n-c*b-l*v]}return m.invert=function(b,v){return[r*(u*b-d*v+p),o*(h-d*b-u*v)]},m}function Xs(e){return JF(function(){return e})()}function JF(e){var t,n=150,r=480,o=250,i=0,s=0,a=0,l=0,c=0,u,d=0,p=1,h=1,m=null,b=OO,v=null,x,w,_,R=yS,C=.5,E,A,M,N,L;function F(j){return M(j[0]*Qt,j[1]*Qt)}function z(j){return j=M.invert(j[0],j[1]),j&&[j[0]*Mr,j[1]*Mr]}F.stream=function(j){return N&&L===j?N:N=zse(Bse(u)(b(E(R(L=j)))))},F.preclip=function(j){return arguments.length?(b=j,m=void 0,G()):b},F.postclip=function(j){return arguments.length?(R=j,v=x=w=_=null,G()):R},F.clipAngle=function(j){return arguments.length?(b=+j?pse(m=j*Qt):(m=null,OO),G()):m*Mr},F.clipExtent=function(j){return arguments.length?(R=j==null?(v=x=w=_=null,yS):mse(v=+j[0][0],x=+j[0][1],w=+j[1][0],_=+j[1][1]),G()):v==null?null:[[v,x],[w,_]]},F.scale=function(j){return arguments.length?(n=+j,Z()):n},F.translate=function(j){return arguments.length?(r=+j[0],o=+j[1],Z()):[r,o]},F.center=function(j){return arguments.length?(i=j[0]%360*Qt,s=j[1]%360*Qt,Z()):[i*Mr,s*Mr]},F.rotate=function(j){return arguments.length?(a=j[0]%360*Qt,l=j[1]%360*Qt,c=j.length>2?j[2]%360*Qt:0,Z()):[a*Mr,l*Mr,c*Mr]},F.angle=function(j){return arguments.length?(d=j%360*Qt,Z()):d*Mr},F.reflectX=function(j){return arguments.length?(p=j?-1:1,Z()):p<0},F.reflectY=function(j){return arguments.length?(h=j?-1:1,Z()):h<0},F.precision=function(j){return arguments.length?(E=qO(A,C=j*j),G()):Fr(C)},F.fitExtent=function(j,H){return dE(F,j,H)},F.fitSize=function(j,H){return XF(F,j,H)},F.fitWidth=function(j,H){return QF(F,j,H)},F.fitHeight=function(j,H){return ZF(F,j,H)};function Z(){var j=YO(n,0,0,p,h,d).apply(null,t(i,s)),H=YO(n,r-j[0],o-j[1],p,h,d);return u=MF(a,l,c),A=fS(t,H),M=fS(u,A),E=qO(A,C),G()}function G(){return N=L=null,F}return function(){return t=e.apply(this,arguments),F.invert=t.invert&&z,Z()}}function fE(e){var t=0,n=yt/3,r=JF(e),o=r(t,n);return o.parallels=function(i){return arguments.length?r(t=i[0]*Qt,n=i[1]*Qt):[t*Mr,n*Mr]},o}function Vse(e){var t=lt(e);function n(r,o){return[r*t,nt(o)/t]}return n.invert=function(r,o){return[r/t,ri(o*t)]},n}function Wse(e,t){var n=nt(e),r=(n+nt(t))/2;if(Dt(r)<Ye)return Vse(e);var o=1+n*(2*r-n),i=Fr(o)/r;function s(a,l){var c=Fr(o-2*r*nt(l))/r;return[c*nt(a*=r),i-c*lt(a)]}return s.invert=function(a,l){var c=i-l,u=es(a,Dt(c))*ei(c);return c*r<0&&(u-=yt*ei(a)*ei(c)),[u/r,ri((o-(a*a+c*c)*r*r)/(2*r))]},s}function zb(){return fE(Wse).scale(155.424).center([0,33.6442])}function e4(){return zb().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Use(e){var t=e.length;return{point:function(n,r){for(var o=-1;++o<t;)e[o].point(n,r)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function Gse(){var e,t,n=e4(),r,o=zb().rotate([154,0]).center([-2,58.5]).parallels([55,65]),i,s=zb().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,l,c={point:function(p,h){l=[p,h]}};function u(p){var h=p[0],m=p[1];return l=null,r.point(h,m),l||(i.point(h,m),l)||(a.point(h,m),l)}u.invert=function(p){var h=n.scale(),m=n.translate(),b=(p[0]-m[0])/h,v=(p[1]-m[1])/h;return(v>=.12&&v<.234&&b>=-.425&&b<-.214?o:v>=.166&&v<.234&&b>=-.214&&b<-.115?s:n).invert(p)},u.stream=function(p){return e&&t===p?e:e=Use([n.stream(t=p),o.stream(p),s.stream(p)])},u.precision=function(p){return arguments.length?(n.precision(p),o.precision(p),s.precision(p),d()):n.precision()},u.scale=function(p){return arguments.length?(n.scale(p),o.scale(p*.35),s.scale(p),u.translate(n.translate())):n.scale()},u.translate=function(p){if(!arguments.length)return n.translate();var h=n.scale(),m=+p[0],b=+p[1];return r=n.translate(p).clipExtent([[m-.455*h,b-.238*h],[m+.455*h,b+.238*h]]).stream(c),i=o.translate([m-.307*h,b+.201*h]).clipExtent([[m-.425*h+Ye,b+.12*h+Ye],[m-.214*h-Ye,b+.234*h-Ye]]).stream(c),a=s.translate([m-.205*h,b+.212*h]).clipExtent([[m-.214*h+Ye,b+.166*h+Ye],[m-.115*h-Ye,b+.234*h-Ye]]).stream(c),d()},u.fitExtent=function(p,h){return dE(u,p,h)},u.fitSize=function(p,h){return XF(u,p,h)},u.fitWidth=function(p,h){return QF(u,p,h)},u.fitHeight=function(p,h){return ZF(u,p,h)};function d(){return e=t=null,u}return u.scale(1070)}function t4(e){return function(t,n){var r=lt(t),o=lt(n),i=e(r*o);return i===1/0?[2,0]:[i*o*nt(t),i*nt(n)]}}function dp(e){return function(t,n){var r=Fr(t*t+n*n),o=e(r),i=nt(o),s=lt(o);return[es(t*i,r*s),ri(r&&n*i/r)]}}var n4=t4(function(e){return Fr(2/(1+e))});n4.invert=dp(function(e){return 2*ri(e/2)});function qse(){return Xs(n4).scale(124.75).clipAngle(180-.001)}var r4=t4(function(e){return(e=OF(e))&&e/nt(e)});r4.invert=dp(function(e){return e});function Yse(){return Xs(r4).scale(79.4188).clipAngle(180-.001)}function X0(e,t){return[e,Ab(lE((Cn+t)/2))]}X0.invert=function(e,t){return[e,2*Cd(AF(t))-Cn]};function Kse(){return o4(X0).scale(961/Mo)}function o4(e){var t=Xs(e),n=t.center,r=t.scale,o=t.translate,i=t.clipExtent,s=null,a,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(o(d),u()):o()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?s=a=l=c=null:(s=+d[0][0],a=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):s==null?null:[[s,a],[l,c]]};function u(){var d=yt*r(),p=t(ase(t.rotate()).invert([0,0]));return i(s==null?[[p[0]-d,p[1]-d],[p[0]+d,p[1]+d]]:e===X0?[[Math.max(p[0]-d,s),a],[Math.min(p[0]+d,l),c]]:[[s,Math.max(p[1]-d,a)],[l,Math.min(p[1]+d,c)]])}return u()}function dm(e){return lE((Cn+e)/2)}function Xse(e,t){var n=lt(e),r=e===t?nt(e):Ab(n/lt(t))/Ab(dm(t)/dm(e)),o=n*Gx(dm(e),r)/r;if(!r)return X0;function i(s,a){o>0?a<-Cn+Ye&&(a=-Cn+Ye):a>Cn-Ye&&(a=Cn-Ye);var l=o/Gx(dm(a),r);return[l*nt(r*s),o-l*lt(r*s)]}return i.invert=function(s,a){var l=o-a,c=ei(r)*Fr(s*s+l*l),u=es(s,Dt(l))*ei(l);return l*r<0&&(u-=yt*ei(s)*ei(l)),[u/r,2*Cd(Gx(o/c,1/r))-Cn]},i}function Qse(){return fE(Xse).scale(109.5).parallels([30,30])}function Bb(e,t){return[e,t]}Bb.invert=Bb;function Zse(){return Xs(Bb).scale(152.63)}function Jse(e,t){var n=lt(e),r=e===t?nt(e):(n-lt(t))/(t-e),o=n/r+e;if(Dt(r)<Ye)return Bb;function i(s,a){var l=o-a,c=r*s;return[l*nt(c),o-l*lt(c)]}return i.invert=function(s,a){var l=o-a,c=es(s,Dt(l))*ei(l);return l*r<0&&(c-=yt*ei(s)*ei(l)),[c/r,o-ei(r)*Fr(s*s+l*l)]},i}function eae(){return fE(Jse).scale(131.154).center([0,13.9389])}var Jf=1.340264,eh=-.081106,th=893e-6,nh=.003796,Hb=Fr(3)/2,tae=12;function i4(e,t){var n=ri(Hb*nt(t)),r=n*n,o=r*r*r;return[e*lt(n)/(Hb*(Jf+3*eh*r+o*(7*th+9*nh*r))),n*(Jf+eh*r+o*(th+nh*r))]}i4.invert=function(e,t){for(var n=t,r=n*n,o=r*r*r,i=0,s,a,l;i<tae&&(a=n*(Jf+eh*r+o*(th+nh*r))-t,l=Jf+3*eh*r+o*(7*th+9*nh*r),n-=s=a/l,r=n*n,o=r*r*r,!(Dt(s)<kF));++i);return[Hb*e*(Jf+3*eh*r+o*(7*th+9*nh*r))/lt(n),ri(nt(n)/Hb)]};function nae(){return Xs(i4).scale(177.158)}function s4(e,t){var n=lt(t),r=lt(e)*n;return[n*nt(e)/r,nt(t)/r]}s4.invert=dp(Cd);function rae(){return Xs(s4).scale(144.049).clipAngle(60)}function a4(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}a4.invert=function(e,t){var n=t,r=25,o;do{var i=n*n,s=i*i;n-=o=(n*(1.007226+i*(.015085+s*(-.044475+.028874*i-.005916*s)))-t)/(1.007226+i*(.015085*3+s*(-.044475*7+.028874*9*i-.005916*11*s)))}while(Dt(o)>Ye&&--r>0);return[e/(.8707+(i=n*n)*(-.131979+i*(-.013791+i*i*i*(.003971-.001529*i)))),n]};function oae(){return Xs(a4).scale(175.295)}function l4(e,t){return[lt(t)*nt(e),nt(t)]}l4.invert=dp(ri);function iae(){return Xs(l4).scale(249.5).clipAngle(90+Ye)}function c4(e,t){var n=lt(t),r=1+lt(e)*n;return[n*nt(e)/r,nt(t)/r]}c4.invert=dp(function(e){return 2*Cd(e)});function sae(){return Xs(c4).scale(250).clipAngle(142)}function u4(e,t){return[Ab(lE((Cn+t)/2)),-e]}u4.invert=function(e,t){return[-t,2*Cd(AF(e))-Cn]};function aae(){var e=o4(u4),t=e.center,n=e.rotate;return e.center=function(r){return arguments.length?t([-r[1],r[0]]):(r=t(),[r[1],-r[0]])},e.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}function jt(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(r*6,++r*6);return n}function Q0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function hE(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ed(){}var mc=.7,ud=1/mc,Ru="\\s*([+-]?\\d+)\\s*",Th="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ki="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",lae=/^#([0-9a-f]{3,8})$/,cae=new RegExp(`^rgb\\(${Ru},${Ru},${Ru}\\)$`),uae=new RegExp(`^rgb\\(${Ki},${Ki},${Ki}\\)$`),dae=new RegExp(`^rgba\\(${Ru},${Ru},${Ru},${Th}\\)$`),fae=new RegExp(`^rgba\\(${Ki},${Ki},${Ki},${Th}\\)$`),hae=new RegExp(`^hsl\\(${Th},${Ki},${Ki}\\)$`),pae=new RegExp(`^hsla\\(${Th},${Ki},${Ki},${Th}\\)$`),KO={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Q0(Ed,pE,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:XO,formatHex:XO,formatHex8:gae,formatHsl:mae,formatRgb:QO,toString:QO});function XO(){return this.rgb().formatHex()}function gae(){return this.rgb().formatHex8()}function mae(){return f4(this).formatHsl()}function QO(){return this.rgb().formatRgb()}function pE(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=lae.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ZO(t):n===3?new vr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?fm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?fm(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=cae.exec(e))?new vr(t[1],t[2],t[3],1):(t=uae.exec(e))?new vr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=dae.exec(e))?fm(t[1],t[2],t[3],t[4]):(t=fae.exec(e))?fm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=hae.exec(e))?tM(t[1],t[2]/100,t[3]/100,1):(t=pae.exec(e))?tM(t[1],t[2]/100,t[3]/100,t[4]):KO.hasOwnProperty(e)?ZO(KO[e]):e==="transparent"?new vr(NaN,NaN,NaN,0):null}function ZO(e){return new vr(e>>16&255,e>>8&255,e&255,1)}function fm(e,t,n,r){return r<=0&&(e=t=n=NaN),new vr(e,t,n,r)}function d4(e){return e instanceof Ed||(e=pE(e)),e?(e=e.rgb(),new vr(e.r,e.g,e.b,e.opacity)):new vr}function kh(e,t,n,r){return arguments.length===1?d4(e):new vr(e,t,n,r??1)}function vr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Q0(vr,kh,hE(Ed,{brighter(e){return e=e==null?ud:Math.pow(ud,e),new vr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?mc:Math.pow(mc,e),new vr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new vr(tc(this.r),tc(this.g),tc(this.b),Vb(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:JO,formatHex:JO,formatHex8:bae,formatRgb:eM,toString:eM}));function JO(){return`#${Dl(this.r)}${Dl(this.g)}${Dl(this.b)}`}function bae(){return`#${Dl(this.r)}${Dl(this.g)}${Dl(this.b)}${Dl((isNaN(this.opacity)?1:this.opacity)*255)}`}function eM(){const e=Vb(this.opacity);return`${e===1?"rgb(":"rgba("}${tc(this.r)}, ${tc(this.g)}, ${tc(this.b)}${e===1?")":`, ${e})`}`}function Vb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function tc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Dl(e){return e=tc(e),(e<16?"0":"")+e.toString(16)}function tM(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new yi(e,t,n,r)}function f4(e){if(e instanceof yi)return new yi(e.h,e.s,e.l,e.opacity);if(e instanceof Ed||(e=pE(e)),!e)return new yi;if(e instanceof yi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,a=i-o,l=(i+o)/2;return a?(t===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+o:2-i-o,s*=60):a=l>0&&l<1?0:s,new yi(s,a,l,e.opacity)}function yae(e,t,n,r){return arguments.length===1?f4(e):new yi(e,t,n,r??1)}function yi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Q0(yi,yae,hE(Ed,{brighter(e){return e=e==null?ud:Math.pow(ud,e),new yi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?mc:Math.pow(mc,e),new yi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new vr(Qx(e>=240?e-240:e+120,o,r),Qx(e,o,r),Qx(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new yi(nM(this.h),hm(this.s),hm(this.l),Vb(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Vb(this.opacity);return`${e===1?"hsl(":"hsla("}${nM(this.h)}, ${hm(this.s)*100}%, ${hm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function nM(e){return e=(e||0)%360,e<0?e+360:e}function hm(e){return Math.max(0,Math.min(1,e||0))}function Qx(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const vae=Math.PI/180,xae=180/Math.PI;var h4=-.14861,gE=1.78277,mE=-.29227,Z0=-.90649,Ah=1.97294,rM=Ah*Z0,oM=Ah*gE,iM=gE*mE-Z0*h4;function wae(e){if(e instanceof nc)return new nc(e.h,e.s,e.l,e.opacity);e instanceof vr||(e=d4(e));var t=e.r/255,n=e.g/255,r=e.b/255,o=(iM*r+rM*t-oM*n)/(iM+rM-oM),i=r-o,s=(Ah*(n-o)-mE*i)/Z0,a=Math.sqrt(s*s+i*i)/(Ah*o*(1-o)),l=a?Math.atan2(s,i)*xae-120:NaN;return new nc(l<0?l+360:l,a,o,e.opacity)}function ts(e,t,n,r){return arguments.length===1?wae(e):new nc(e,t,n,r??1)}function nc(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Q0(nc,ts,hE(Ed,{brighter(e){return e=e==null?ud:Math.pow(ud,e),new nc(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?mc:Math.pow(mc,e),new nc(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*vae,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),o=Math.sin(e);return new vr(255*(t+n*(h4*r+gE*o)),255*(t+n*(mE*r+Z0*o)),255*(t+n*(Ah*r)),this.opacity)}}));function Sae(e,t,n,r,o){var i=e*e,s=i*e;return((1-3*e+3*i-s)*t+(4-6*i+3*s)*n+(1+3*e+3*i-3*s)*r+s*o)/6}function _ae(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],i=e[r+1],s=r>0?e[r-1]:2*o-i,a=r<t-1?e[r+2]:2*i-o;return Sae((n-r/t)*t,s,o,i,a)}}const bE=e=>()=>e;function p4(e,t){return function(n){return e+n*t}}function Cae(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Eae(e,t){var n=t-e;return n?p4(e,n>180||n<-180?n-360*Math.round(n/360):n):bE(isNaN(e)?t:e)}function Rae(e){return(e=+e)==1?Pu:function(t,n){return n-t?Cae(t,n,e):bE(isNaN(t)?n:t)}}function Pu(e,t){var n=t-e;return n?p4(e,n):bE(isNaN(e)?t:e)}(function e(t){var n=Rae(t);function r(o,i){var s=n((o=kh(o)).r,(i=kh(i)).r),a=n(o.g,i.g),l=n(o.b,i.b),c=Pu(o.opacity,i.opacity);return function(u){return o.r=s(u),o.g=a(u),o.b=l(u),o.opacity=c(u),o+""}}return r.gamma=e,r})(1);function Pae(e){return function(t){var n=t.length,r=new Array(n),o=new Array(n),i=new Array(n),s,a;for(s=0;s<n;++s)a=kh(t[s]),r[s]=a.r||0,o[s]=a.g||0,i[s]=a.b||0;return r=e(r),o=e(o),i=e(i),a.opacity=1,function(l){return a.r=r(l),a.g=o(l),a.b=i(l),a+""}}}var Tae=Pae(_ae);function g4(e){return function t(n){n=+n;function r(o,i){var s=e((o=ts(o)).h,(i=ts(i)).h),a=Pu(o.s,i.s),l=Pu(o.l,i.l),c=Pu(o.opacity,i.opacity);return function(u){return o.h=s(u),o.s=a(u),o.l=l(Math.pow(u,n)),o.opacity=c(u),o+""}}return r.gamma=t,r}(1)}g4(Eae);var yE=g4(Pu);const Jt=e=>Tae(e[e.length-1]);var kae=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(jt);const Aae=Jt(kae);var Oae=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(jt);const Mae=Jt(Oae);var Iae=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(jt);const Dae=Jt(Iae);var Nae=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(jt);const Lae=Jt(Nae);var Fae=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(jt);const jae=Jt(Fae);var $ae=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(jt);const zae=Jt($ae);var Bae=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(jt);const Hae=Jt(Bae);var Vae=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(jt);const Wae=Jt(Vae);var Uae=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(jt);const Gae=Jt(Uae);var qae=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(jt);const Yae=Jt(qae);var Kae=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(jt);const Xae=Jt(Kae);var Qae=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(jt);const Zae=Jt(Qae);var Jae=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(jt);const ele=Jt(Jae);var tle=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(jt);const nle=Jt(tle);var rle=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(jt);const ole=Jt(rle);var ile=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(jt);const sle=Jt(ile);var ale=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(jt);const lle=Jt(ale);var cle=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(jt);const ule=Jt(cle);var dle=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(jt);const fle=Jt(dle);var hle=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(jt);const ple=Jt(hle);var gle=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(jt);const mle=Jt(gle);var ble=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(jt);const yle=Jt(ble);var vle=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(jt);const xle=Jt(vle);var wle=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(jt);const Sle=Jt(wle);var _le=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(jt);const Cle=Jt(_le);var Ele=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(jt);const Rle=Jt(Ele);var Ple=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(jt);const Tle=Jt(Ple);function kle(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-e*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-e*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-e*2475.67)))))))+")"}const Ale=yE(ts(300,.5,0),ts(-240,.5,1));var Ole=yE(ts(-100,.75,.35),ts(80,1.5,.8)),Mle=yE(ts(260,.75,.35),ts(80,1.5,.8)),pm=ts();function Ile(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return pm.h=360*e-100,pm.s=1.5-1.5*t,pm.l=.8-.9*t,pm+""}var gm=kh(),Dle=Math.PI/3,Nle=Math.PI*2/3;function Lle(e){var t;return e=(.5-e)*Math.PI,gm.r=255*(t=Math.sin(e))*t,gm.g=255*(t=Math.sin(e+Dle))*t,gm.b=255*(t=Math.sin(e+Nle))*t,gm+""}function Fle(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-e*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+e*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-e*6838.66)))))))+")"}function J0(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const jle=J0(jt("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var $le=J0(jt("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),zle=J0(jt("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Ble=J0(jt("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Hle(e){return e}function Vle(e){if(e==null)return Hle;var t,n,r=e.scale[0],o=e.scale[1],i=e.translate[0],s=e.translate[1];return function(a,l){l||(t=n=0);var c=2,u=a.length,d=new Array(u);for(d[0]=(t+=a[0])*r+i,d[1]=(n+=a[1])*o+s;c<u;)d[c]=a[c],++c;return d}}function Wle(e,t){for(var n,r=e.length,o=r-t;o<--r;)n=e[o],e[o++]=e[r],e[r]=n}function Ule(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return sM(e,n)})}:sM(e,t)}function sM(e,t){var n=t.id,r=t.bbox,o=t.properties==null?{}:t.properties,i=Gle(e,t);return n==null&&r==null?{type:"Feature",properties:o,geometry:i}:r==null?{type:"Feature",id:n,properties:o,geometry:i}:{type:"Feature",id:n,bbox:r,properties:o,geometry:i}}function Gle(e,t){var n=Vle(e.transform),r=e.arcs;function o(u,d){d.length&&d.pop();for(var p=r[u<0?~u:u],h=0,m=p.length;h<m;++h)d.push(n(p[h],h));u<0&&Wle(d,m)}function i(u){return n(u)}function s(u){for(var d=[],p=0,h=u.length;p<h;++p)o(u[p],d);return d.length<2&&d.push(d[0]),d}function a(u){for(var d=s(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(a)}function c(u){var d=u.type,p;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":p=i(u.coordinates);break;case"MultiPoint":p=u.coordinates.map(i);break;case"LineString":p=s(u.arcs);break;case"MultiLineString":p=u.arcs.map(s);break;case"Polygon":p=l(u.arcs);break;case"MultiPolygon":p=u.arcs.map(l);break;default:return null}return{type:d,coordinates:p}}return c(t)}const rh={geoAzimuthalEqualArea:qse,geoAzimuthalEquidistant:Yse,geoGnomonic:rae,geoOrthographic:iae,geoStereographic:sae,geoEqualEarth:nae,geoAlbers:e4,geoAlbersUsa:Gse,geoConicConformal:Qse,geoConicEqualArea:zb,geoConicEquidistant:eae,geoEquirectangular:Zse,geoMercator:Kse,geoTransverseMercator:aae,geoNaturalEarth1:oae};Object.keys(rh).forEach(e=>{rh[`${e.charAt(3).toLowerCase()}${e.slice(4)}`]=rh[e]});class Ac extends Xa{constructor(t){super(t),this.outlineBounds=null,this.oldChartBounds=null,this.geoPath=UO()}init(t){t.position="chartArea",super.init(t),typeof t.projection=="function"?this.projection=t.projection:this.projection=(rh[t.projection]||rh.albersUsa)(),this.geoPath.projection(this.projection),this.outlineBounds=null,this.oldChartBounds=null}computeBounds(t){const n=UO(this.projection.fitWidth(1e3,t)).bounds(t),r=Math.ceil(n[1][1]-n[0][1]),o=Math.ceil(n[1][0]-n[0][0]),i=this.projection.translate();this.outlineBounds={width:o,height:r,aspectRatio:o/r,refScale:this.projection.scale(),refX:i[0],refY:i[1]}}updateBounds(){const t=this.chart.chartArea,n=this.outlineBounds;if(!n)return!1;const r=this.options.padding,o=typeof r=="number"?r:r.top,i=typeof r=="number"?r:r.left,s=typeof r=="number"?r:r.bottom,a=typeof r=="number"?r:r.right,l=t.right-t.left-i-a,c=t.bottom-t.top-o-s,u=this.oldChartBounds;this.oldChartBounds={chartWidth:l,chartHeight:c};const d=Math.min(l/n.width,c/n.height),p=n.width*d,h=n.height*d,m=(l-p)*.5+t.left+i,b=(c-h)*.5+t.top+o,v=this.options;return this.projection.scale(n.refScale*d*v.projectionScale).translate([d*n.refX+m+v.projectionOffset[0],d*n.refY+b+v.projectionOffset[1]]),!u||u.chartWidth!==this.oldChartBounds.chartWidth||u.chartHeight!==this.oldChartBounds.chartHeight}}Ac.id="projection";Ac.defaults={projection:"albersUsa",projectionScale:1,projectionOffset:[0,0],padding:0};Ac.descriptors={_scriptable:e=>e!=="projection",_indexable:e=>e!=="projectionOffset"};const ey={position:"chartArea",property:"value",grid:{z:1,drawOnChartArea:!1},ticks:{z:1},legend:{align:"right",position:"bottom-right",length:100,width:50,margin:8,indicatorWidth:10}};function qle(e){const{indicatorWidth:t,align:n,margin:r}=e,o=(typeof r=="number"?r:r.left)+(n==="right"?t:0),i=(typeof r=="number"?r:r.top)+(n==="bottom"?t:0),s=(typeof r=="number"?r:r.right)+(n==="left"?t:0),a=(typeof r=="number"?r:r.bottom)+(n==="top"?t:0);return{left:o,top:i,right:s,bottom:a}}function Yle(e,t,n,r,o){const{indicatorWidth:i,align:s,position:a}=t,l=s==="top"||s==="bottom",c=(s==="left"?o.w:n)+(l?i:0),u=(s==="top"?o.h:r)+(l?0:i),d=qle(t);if(typeof a=="string")switch(a){case"top-left":return[d.left,d.top];case"top":return[(e.right-c)/2,d.top];case"left":return[d.left,(e.bottom-u)/2];case"top-right":return[e.right-c-d.right,d.top];case"bottom-right":return[e.right-c-d.right,e.bottom-u-d.bottom];case"bottom":return[(e.right-c)/2,e.bottom-u-d.bottom];case"bottom-left":return[d.left,e.bottom-u-d.bottom];default:return[e.right-c-d.right,(e.bottom-u)/2]}return[a.x,a.y]}class bu extends id{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){t.position="chartArea",super.init(t),this.axis="r"}parse(t,n){return t&&typeof t[this.options.property]=="number"?t[this.options.property]:super.parse(t,n)}isHorizontal(){return this.options.legend.align==="top"||this.options.legend.align==="bottom"}_getNormalizedValue(t){return t==null||Number.isNaN(t)?null:(t-this._startValue)/this._valueRange}update(t,n,r){const o=Math.min(n,this.bottom==null?Number.POSITIVE_INFINITY:this.bottom),i=Math.min(t,this.right==null?Number.POSITIVE_INFINITY:this.right),s=this.options.legend,a=this.isHorizontal(),l=(h,m)=>h<1?m*h:h,c=Math.min(i,l(a?s.length:s.width,i))-(a?0:s.indicatorWidth),u=Math.min(o,l(a?s.width:s.length,o))-(a?s.indicatorWidth:0);this.legendSize={w:c,h:u},this.bottom=u,this.height=u,this.right=c,this.width=c;const d=this.options.position;this.options.position=this.options.legend.align;const p=super.update(c,u,r);return this.options.position=d,this.height=Math.min(u,this.height),this.width=Math.min(c,this.width),p}_computeLabelArea(){}draw(t){if(!this._isVisible())return;const n=Yle(t,this.options.legend,this.width,this.height,this.legendSize),{ctx:r}=this;r.save(),r.translate(n[0],n[1]);const o=this.options.position;this.options.position=this.options.legend.align,super.draw({...t,bottom:this.height+10,right:this.width}),this.options.position=o;const{indicatorWidth:i}=this.options.legend;switch(this.options.legend.align){case"left":r.translate(this.legendSize.w,0);break;case"top":r.translate(0,this.legendSize.h);break;case"bottom":r.translate(0,-i);break;default:r.translate(-i,0);break}this._drawIndicator(),r.restore()}_drawIndicator(){}}class m4 extends sd{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){bu.prototype.init.call(this,t)}parse(t,n){return bu.prototype.parse.call(this,t,n)}isHorizontal(){return this.options.legend.align==="top"||this.options.legend.align==="bottom"}_getNormalizedValue(t){return t==null||Number.isNaN(t)?null:(Math.log10(t)-this._startValue)/this._valueRange}update(t,n,r){return bu.prototype.update.call(this,t,n,r)}_computeLabelArea(){}draw(t){return bu.prototype.draw.call(this,t)}_drawIndicator(){}}const js={interpolateBlues:yle,interpolateBrBG:Aae,interpolateBuGn:Yae,interpolateBuPu:Xae,interpolateCividis:kle,interpolateCool:Mle,interpolateCubehelixDefault:Ale,interpolateGnBu:Zae,interpolateGreens:xle,interpolateGreys:Sle,interpolateInferno:zle,interpolateMagma:$le,interpolateOrRd:ele,interpolateOranges:Tle,interpolatePRGn:Mae,interpolatePiYG:Dae,interpolatePlasma:Ble,interpolatePuBu:ole,interpolatePuBuGn:nle,interpolatePuOr:Lae,interpolatePuRd:sle,interpolatePurples:Cle,interpolateRainbow:Ile,interpolateRdBu:jae,interpolateRdGy:zae,interpolateRdPu:lle,interpolateRdYlBu:Hae,interpolateRdYlGn:Wae,interpolateReds:Rle,interpolateSinebow:Lle,interpolateSpectral:Gae,interpolateTurbo:Fle,interpolateViridis:jle,interpolateWarm:Ole,interpolateYlGn:fle,interpolateYlGnBu:ule,interpolateYlOrBr:ple,interpolateYlOrRd:mle};Object.keys(js).forEach(e=>{js[`${e.charAt(11).toLowerCase()}${e.slice(12)}`]=js[e],js[e.slice(11)]=js[e]});function b4(e,t){const n=1/t;if(e<=n)return 0;if(e>=1-n)return 1;for(let r=0;r<1;r+=n)if(e<r)return r-n/2;return e}const y4={interpolate:"blues",missing:"transparent",quantize:0};class za extends bu{get interpolate(){const t=this.options;return t?typeof t.interpolate=="function"?t.interpolate:js[t.interpolate]||js.blues:n=>`rgb(${n},${n},${n})`}getColorForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getColor(n)}getColor(t){let n=t;return this.options.quantize>0&&(n=b4(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){const{indicatorWidth:t}=this.options.legend,n=this._reversePixels;if(this.isHorizontal()){const r=this.width;if(this.options.quantize>0){const o=r/this.options.quantize,i=n?s=>r-o-s:s=>s;for(let s=0;s<r;s+=o){const a=(s+o/2)/r;this.ctx.fillStyle=this.getColor(a),this.ctx.fillRect(i(s),0,o,t)}}else{const o=n?i=>r-1-i:i=>i;for(let i=0;i<r;i+=1)this.ctx.fillStyle=this.getColor((i+.5)/r),this.ctx.fillRect(o(i),0,1,t)}}else{const r=this.height;if(this.options.quantize>0){const o=r/this.options.quantize,i=n?s=>r-o-s:s=>s;for(let s=0;s<r;s+=o){const a=(s+o/2)/r;this.ctx.fillStyle=this.getColor(a),this.ctx.fillRect(0,i(s),t,o)}}else{const o=n?i=>r-1-i:i=>i;for(let i=0;i<r;i+=1)this.ctx.fillStyle=this.getColor((i+.5)/r),this.ctx.fillRect(0,o(i),t,1)}}}}za.id="color";za.defaults=Qn({},[id.defaults,ey,y4]);za.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};class vE extends m4{constructor(){super(...arguments),this.interpolate=t=>`rgb(${t},${t},${t})`}init(t){super.init(t),typeof t.interpolate=="function"?this.interpolate=t.interpolate:this.interpolate=js[t.interpolate]||js.blues}getColorForValue(t){return za.prototype.getColorForValue.call(this,t)}getColor(t){let n=t;return this.options.quantize>0&&(n=b4(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){return za.prototype._drawIndicator.call(this)}}vE.id="colorLogarithmic";vE.defaults=Qn({},[sd.defaults,ey,y4]);vE.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};const v4={missing:1,mode:"area",range:[2,20],legend:{align:"bottom",length:90,width:70,indicatorWidth:42}};class Ba extends bu{constructor(){super(...arguments),this._model=null}getSizeForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getSizeImpl(n)}getSizeImpl(t){const[n,r]=this.options.range;if(this.options.mode==="area"){const i=r*r*Math.PI,s=n*n*Math.PI,a=i-s,l=t*a+s;return Math.sqrt(l/Math.PI)}const o=r-n;return t*o+n}_drawIndicator(){const{ctx:t}=this,n=this.options.legend.indicatorWidth/2,r=this.isHorizontal(),o=this.ticks,i=this.getLabelItems(),s=i?i.map(a=>({[r?"x":"y"]:a.options.translation[r?0:1]})):o.map((a,l)=>({[r?"x":"y"]:this.getPixelForTick(l)}));if((this._gridLineItems||[]).forEach(a=>{if(t.save(),t.strokeStyle=a.color,t.lineWidth=a.width,t.setLineDash&&(t.setLineDash(a.borderDash),t.lineDashOffset=a.borderDashOffset),t.beginPath(),this.options.grid.drawTicks)switch(this.options.legend.align){case"left":t.moveTo(0,a.ty1),t.lineTo(n,a.ty2);break;case"top":t.moveTo(a.tx1,0),t.lineTo(a.tx2,n);break;case"bottom":t.moveTo(a.tx1,n),t.lineTo(a.tx2,n*2);break;default:t.moveTo(n,a.ty1),t.lineTo(n*2,a.ty2);break}t.stroke(),t.restore()}),this._model){const a=this._model;t.strokeStyle=a.borderColor,t.lineWidth=a.borderWidth||0,t.fillStyle=a.backgroundColor}else t.fillStyle="blue";o.forEach((a,l)=>{const c=s[l],u=this.getSizeForValue(a.value),d=r?c.x:n,p=r?n:c.y,h={pointStyle:"circle",borderWidth:0,...this._model||{},radius:u};Cb(t,h,d,p)})}}Ba.id="size";Ba.defaults=Qn({},[id.defaults,ey,v4]);Ba.descriptors={_scriptable:!0,_indexable:e=>e!=="range"};class x4 extends m4{constructor(){super(...arguments),this._model=null}getSizeForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getSizeImpl(n)}getSizeImpl(t){return Ba.prototype.getSizeImpl.call(this,t)}_drawIndicator(){Ba.prototype._drawIndicator.call(this)}}x4.id="sizeLogarithmic";x4.defaults=Qn({},[sd.defaults,ey,v4]);function Kle(e,t){return[[e[0][0]-t,e[0][1]-t],[e[1][0]+t,e[1][1]+t]]}class qs extends us{constructor(){super(...arguments),this.cache=void 0}inRange(t,n){const r=this.getBounds(),o=(Number.isNaN(t)||t>=r.x&&t<=r.x2)&&(Number.isNaN(n)||n>=r.y&&n<=r.y2),i=this.projectionScale.geoPath.projection();if(o&&!Number.isNaN(t)&&!Number.isNaN(n)&&typeof i.invert=="function"){const s=i.invert([t,n]);return s!=null&&Cse(this.feature,s)}return o}inXRange(t){return this.inRange(t,Number.NaN)}inYRange(t){return this.inRange(Number.NaN,t)}getCenterPoint(){if(this.cache&&this.cache.center)return this.cache.center;let t;if(this.center){const n=this.projectionScale.projection([this.center.longitude,this.center.latitude]);t={x:n[0],y:n[1]}}else{const n=this.projectionScale.geoPath.centroid(this.feature);t={x:n[0],y:n[1]}}return this.cache={...this.cache||{},center:t},t}getBounds(){if(this.cache&&this.cache.bounds)return this.cache.bounds;const t=Kle(this.projectionScale.geoPath.bounds(this.feature),this.options.borderWidth/2),n={x:t[0][0],x2:t[1][0],y:t[0][1],y2:t[1][1],width:t[1][0]-t[0][0],height:t[1][1]-t[0][1]};return this.cache={...this.cache||{},bounds:n},n}_drawInCache(t){const n=this.getBounds();if(!Number.isFinite(n.x))return;const r=this.cache&&this.cache.canvas?this.cache.canvas:t.createElement("canvas"),o=Math.floor(n.x),i=Math.floor(n.y),s=Math.ceil(n.x+n.width),a=Math.ceil(n.y+n.height),l=this.pixelRatio||1,c=Math.ceil(Math.max(s-o,1)*l),u=Math.ceil(Math.max(a-i,1)*l);if(c<=0||u<=0)return;r.width=c,r.height=u;const d=r.getContext("2d");d&&(d.clearRect(0,0,r.width,r.height),d.save(),d.scale(l,l),d.translate(-o,-i),this._drawImpl(d),d.restore(),this.cache={...this.cache||{},canvas:r,canvasKey:this._optionsToKey()})}_optionsToKey(){const{options:t}=this;return`${t.backgroundColor};${t.borderColor};${t.borderWidth};${this.pixelRatio}`}_drawImpl(t){const{feature:n}=this,{options:r}=this;t.beginPath(),this.projectionScale.geoPath.context(t)(n),r.backgroundColor&&(t.fillStyle=r.backgroundColor,t.fill()),r.borderColor&&(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.stroke())}draw(t){const{feature:n}=this;if(!n)return;(!this.cache||this.cache.canvasKey!==this._optionsToKey())&&t.canvas.ownerDocument!=null&&this._drawInCache(t.canvas.ownerDocument);const r=this.getBounds();if(this.cache&&this.cache.canvas&&this.cache.canvas.width>0&&this.cache.canvas.height>0){const o=Math.floor(r.x),i=Math.floor(r.y),s=Math.ceil(r.x+r.width),a=Math.ceil(r.y+r.height),l=s-o,c=a-i;l>0&&c>0&&t.drawImage(this.cache.canvas,o,i,s-o,a-i)}else Number.isFinite(r.x)&&(t.save(),this._drawImpl(t),t.restore())}}qs.id="geoFeature";qs.defaults={...ec.defaults,outlineBackgroundColor:null,outlineBorderWidth:0,graticuleBorderColor:"#CCCCCC",graticuleBorderWidth:0};qs.defaultRoutes={outlineBorderColor:"borderColor",...ec.defaultRoutes||{}};const w4={showOutline:!1,showGraticule:!1,clipMap:!0},S4={scales:{projection:{axis:"x",type:Ac.id,position:"chartArea",display:!1}}};function aM(e){const t={...e};return Object.keys(e).forEach(n=>{let r=n;if(n.startsWith("outline")){const o=n.slice(7);r=o[0].toLowerCase()+o.slice(1)}else if(n.startsWith("hoverOutline"))r=`hover${n.slice(12)}`;else return;delete t[n],t[r]=e[n]}),t}class _4 extends ti{getGeoDataset(){return super.getDataset()}getGeoOptions(){return this.chart.options}getProjectionScale(){return this.getScaleForId("projection")}linkScales(){const t=this.getGeoDataset(),n=this.getMeta();n.xAxisID="projection",t.xAxisID="projection",n.yAxisID="projection",t.yAxisID="projection",n.xScale=this.getScaleForId("projection"),n.yScale=this.getScaleForId("projection"),this.getProjectionScale().computeBounds(this.resolveOutline())}showOutline(){return Je(this.getGeoDataset().showOutline,this.getGeoOptions().showOutline)}clipMap(){return Je(this.getGeoDataset().clipMap,this.getGeoOptions().clipMap)}getGraticule(){return Je(this.getGeoDataset().showGraticule,this.getGeoOptions().showGraticule)}update(t){super.update(t);const n=this.getMeta(),r=this.getProjectionScale(),o=r.updateBounds();if(this.showOutline()){const i=n.dataset;if(o&&delete i.cache,i.projectionScale=r,i.pixelRatio=this.chart.currentDevicePixelRatio,t!=="resize"){const s=aM(this.resolveDatasetElementOptions(t)),a={feature:this.resolveOutline(),options:s};this.updateElement(i,void 0,a,t),this.getGraticule()&&(n.graticule=s)}}else this.getGraticule()&&t!=="resize"&&(n.graticule=aM(this.resolveDatasetElementOptions(t)));this.updateElements(n.data,0,n.data.length,t),o&&n.data.forEach(i=>delete i.cache)}resolveOutline(){const n=this.getGeoDataset().outline||{type:"Sphere"};return Array.isArray(n)?{type:"FeatureCollection",features:n}:n}showGraticule(){const t=this.getGraticule(),n=this.getMeta().graticule;if(!t||!n)return;const{ctx:r}=this.chart,i=this.getProjectionScale().geoPath.context(r);if(r.save(),r.beginPath(),typeof t=="boolean")t&&i(Ese());else{const s=jF();t.stepMajor&&s.stepMajor(t.stepMajor),t.stepMinor&&s.stepMinor(t.stepMinor),i(s())}r.strokeStyle=n.graticuleBorderColor,r.lineWidth=n.graticuleBorderWidth,r.stroke(),r.restore()}draw(){const{chart:t}=this,n=this.clipMap();let r=!1;(n===!0||n==="outline"||n==="outline+graticule")&&(r=!0,Kl(t.ctx,t.chartArea)),this.showOutline()&&this.getMeta().dataset&&this.getMeta().dataset.draw.call(this.getMeta().dataset,t.ctx,t.chartArea),n===!0||n==="graticule"||n==="outline+graticule"?r||Kl(t.ctx,t.chartArea):r&&(r=!1,Xl(t.ctx)),this.showGraticule(),n===!0||n==="items"?r||Kl(t.ctx,t.chartArea):r&&(r=!1,Xl(t.ctx)),this.getMeta().data.forEach(o=>o.draw.call(o,t.ctx,t.chartArea)),r&&(r=!1,Xl(t.ctx))}}function C4(e,t,n,r=[],o=[]){Dr.addControllers(n),Array.isArray(r)?Dr.addElements(...r):Dr.addElements(r),Array.isArray(o)?Dr.addScales(...o):Dr.addScales(o);const i=t;return i.type=e,i}class Rd extends _4{initialize(){super.initialize(),this.enableOptionSharing=!0}linkScales(){super.linkScales();const t=this.getGeoDataset(),n=this.getMeta();n.vAxisID="color",n.rAxisID="color",t.vAxisID="color",t.rAxisID="color",n.rScale=this.getScaleForId("color"),n.vScale=n.rScale,n.iScale=n.xScale,n.iAxisID=n.xAxisID,t.iAxisID=n.xAxisID}_getOtherScale(t){return t}parse(t,n){const r=this.getMeta().rScale,{data:o}=this.getDataset(),i=this._cachedMeta;for(let s=t;s<t+n;s+=1)i._parsed[s]={[r.axis]:r.parse(o[s],s)}}updateElements(t,n,r,o){const i=this.resolveDataElementOptions(n,o),s=this.getSharedOptions(i),a=this.includeOptions(o,s),l=this.getProjectionScale();this.updateSharedOptions(s,o,i);for(let c=n;c<n+r;c+=1){const u=t[c];u.projectionScale=l,u.feature=this._data[c].feature,u.center=this._data[c].center,u.pixelRatio=this.chart.currentDevicePixelRatio;const d=u.getCenterPoint(),p={x:d.x,y:d.y};a&&(p.options=s||this.resolveDataElementOptions(c,o)),this.updateElement(u,c,p,o)}}indexToColor(t){const n=this.getMeta().rScale;return n.getColorForValue(this.getParsed(t)[n.axis])}}Rd.id="choropleth";Rd.defaults=Qn({},[w4,{datasetElementType:qs.id,dataElementType:qs.id}]);Rd.overrides=Qn({},[S4,{plugins:{tooltip:{callbacks:{title(){return""},label(e){var t,n,r,o;return e.formattedValue==null?(n=(t=e.chart.data)===null||t===void 0?void 0:t.labels)===null||n===void 0?void 0:n[e.dataIndex]:`${(o=(r=e.chart.data)===null||r===void 0?void 0:r.labels)===null||o===void 0?void 0:o[e.dataIndex]}: ${e.formattedValue}`}}},colors:{enabled:!1}},scales:{color:{type:za.id,axis:"x"}},elements:{geoFeature:{backgroundColor(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToColor(e.dataIndex)}}}}]);class Xle extends yn{constructor(t,n){super(t,C4("choropleth",n,Rd,qs,[za,Ac]))}}Xle.id=Rd.id;class Pd extends _4{initialize(){super.initialize(),this.enableOptionSharing=!0}linkScales(){super.linkScales();const t=this.getGeoDataset(),n=this.getMeta();n.vAxisID="size",n.rAxisID="size",t.vAxisID="size",t.rAxisID="size",n.rScale=this.getScaleForId("size"),n.vScale=n.rScale,n.iScale=n.xScale,n.iAxisID=n.xAxisID,t.iAxisID=n.xAxisID}_getOtherScale(t){return t}parse(t,n){const r=this.getMeta().rScale,o=this.getDataset().data,i=this._cachedMeta;for(let s=t;s<t+n;s+=1){const a=o[s];i._parsed[s]={x:a.longitude==null?a.x:a.longitude,y:a.latitude==null?a.y:a.latitude,[r.axis]:r.parse(a,s)}}}updateElements(t,n,r,o){const i=o==="reset",s=this.resolveDataElementOptions(n,o),a=this.getSharedOptions(s),l=this.includeOptions(o,a),c=this.getProjectionScale();this.getMeta().rScale._model=s,this.updateSharedOptions(a,o,s);for(let u=n;u<n+r;u+=1){const d=t[u],p=this.getParsed(u),h=c.projection([p.x,p.y]),m={x:h?h[0]:0,y:h?h[1]:0,skip:Number.isNaN(p.x)||Number.isNaN(p.y)};l&&(m.options=a||this.resolveDataElementOptions(u,o),i&&(m.options.radius=0)),this.updateElement(d,u,m,o)}}indexToRadius(t){const n=this.getMeta().rScale;return n.getSizeForValue(this.getParsed(t)[n.axis])}}Pd.id="bubbleMap";Pd.defaults=Qn({},[w4,{dataElementType:Jl.id,datasetElementType:qs.id,showOutline:!0,clipMap:"outline+graticule"}]);Pd.overrides=Qn({},[S4,{plugins:{tooltip:{callbacks:{title(){return""},label(e){var t,n,r,o;return e.formattedValue==null?(n=(t=e.chart.data)===null||t===void 0?void 0:t.labels)===null||n===void 0?void 0:n[e.dataIndex]:`${(o=(r=e.chart.data)===null||r===void 0?void 0:r.labels)===null||o===void 0?void 0:o[e.dataIndex]}: ${e.formattedValue}`}}}},scales:{size:{axis:"x",type:Ba.id}},elements:{point:{radius(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToRadius(e.dataIndex)},hoverRadius(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToRadius(e.dataIndex)+1}}}}]);class Qle extends yn{constructor(t,n){super(t,C4("bubbleMap",n,Pd,qs,[Ba,Ac]))}}Qle.id=Pd.id;function Zle(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function Jle(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{beginAtZero:!0,stack:1,reverse:!0},y:{stacked:!0,beginAtZero:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function ece(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function tce(e,t=!1){var r;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0,beginAtZero:!1},y:{display:!0,stacked:t}},plugins:{...(r=e==null?void 0:e.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center"}}}}}function nce(e,t){var r,o,i,s,a;return{...e,type:t==="stackedBar"?"bar":"line",options:{...e==null?void 0:e.options,scales:{x:{...(o=(r=e==null?void 0:e.options)==null?void 0:r.scales)==null?void 0:o.x,display:!0,stacked:!0},y:{...(s=(i=e==null?void 0:e.options)==null?void 0:i.scales)==null?void 0:s.y,display:!0,stacked:t==="stackedBar"}},plugins:{...(a=e==null?void 0:e.options)==null?void 0:a.plugins,legend:{position:"bottom",align:"center"}}}}}function rce(e){var n;return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function oce(e,t){var r;return{...t,type:e,options:{...t==null?void 0:t.options,scales:{x:{display:!1},y:{display:!1}},plugins:{...(r=t==null?void 0:t.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},borderRadius:0}}}function ice(e){var r,o;const t=be.getState().theme;let n={...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1},r:{grid:{display:!0},angleLines:{},ticks:{}}},plugins:{...(r=e==null?void 0:e.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center"}}}};return t==="dark"&&(n={...n,options:{...n.options,scales:{...(o=n==null?void 0:n.options)==null?void 0:o.scales,r:{grid:{color:At.slate[800]},angleLines:{color:At.slate[800]},ticks:{color:At.slate[800],showLabelBackdrop:!1}}}}}),n}function xE({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:o="chartjs",userSettings:i,preferences:s,topoJson:a}){var l,c,u,d,p,h,m,b,v,x;if(t==="map"){if(!a)return null;const w=(l=s==null?void 0:s.mapVisualOptions)==null?void 0:l.objectKey;if(!w)return null;const _=Ule(a,(c=a==null?void 0:a.objects)==null?void 0:c[w]).features;if(!_)return null;const R={plugins:{datalabels:{display:!1}},scales:{x:{display:!1,grid:{display:!1}},y:{display:!1,grid:{display:!1}},projection:{axis:"x",projection:((u=s==null?void 0:s.mapVisualOptions)==null?void 0:u.projection)||"mercator",projectionScale:((d=s==null?void 0:s.mapVisualOptions)==null?void 0:d.projectionScale)||1,projectionOffset:((p=s==null?void 0:s.mapVisualOptions)==null?void 0:p.projectionOffset)||[0,0]},color:{axis:"x",interpolate:((h=s==null?void 0:s.mapVisualOptions)==null?void 0:h.colorScale)||"blues",quantize:5,legend:{position:"bottom-right",align:"right"}}}},{keys:C}=Yn(e),E=_.map(z=>{var H;const Z=C==null?void 0:C[0],G=C==null?void 0:C[1],j=(H=e.find($=>($==null?void 0:$[Z])===z.properties.NAME||($==null?void 0:$[Z])===z.properties.name))==null?void 0:H[G];return{feature:z,value:j}}),M=If([{label:w,data:E,borderColor:"lightgray"}],r),N={type:"choropleth",data:{labels:_.map(z=>z.properties.NAME||z.properties.name),datasets:M},options:R},{options:L}=kL({cfg:N,preferences:s,customCfg:r});return{...N,options:L}}if(t==="bar"){const w=ece(n);return pl({data:e,cfg:w,customCfg:r,cardType:t,preferences:s})}if(t==="horizontalBar"){const w=Zle(n);return pl({data:e,cfg:w,customCfg:r,cardType:t,preferences:s})}if(t==="pyramid"){const w=Jle(n),{dimensionKeys:_,metricKeys:R}=Yn(e),C=vb({dataArray:e,groupKey:_[0],pivotKey:_[1],valueKey:R[0]}),E=pl({data:C,cfg:w,customCfg:r,cardType:t,preferences:s}),A="x2";return{...E,data:{...E.data,datasets:E.data.datasets.map((N,L)=>L===1?{...N,xAxisID:A}:N)},options:{...E.options,scales:{...(m=E==null?void 0:E.options)==null?void 0:m.scales,[A]:{beginAtZero:!0,stack:1}}}}}if(t==="stackedBar"||t==="stackedLine"){const w=nce(n,t),{dimensionKeys:_,metricKeys:R}=Yn(e),C=vb({dataArray:e,groupKey:_[0],pivotKey:_[1],valueKey:R[0],sortChart:s==null?void 0:s.sortChart});return pl({data:C,cfg:w,customCfg:r,cardType:t,preferences:s})}if(t==="line"){const w=rce(n);return pl({data:e,cfg:w,customCfg:r,cardType:t,preferences:s})}if(t==="range"){const w=tce(n),_=Mee(e),R=If(_,r),{plugins:C,options:E}=X1((s==null?void 0:s.customVisualCode)||""),A=Jr((w==null?void 0:w.options)||{},(n==null?void 0:n.options)||{}),M=Jr(A,(s==null?void 0:s.chartOptions)||{}),N=Jr(M,(r==null?void 0:r.options)||{}),L=Jr(N,E),F=TL(n,s),z=Jr(L,F),Z={...z,plugins:{...z==null?void 0:z.plugins,datalabels:{...(b=z==null?void 0:z.plugins)==null?void 0:b.datalabels,formatter:(V,X)=>V.map(q=>{var U,O,J,K;return Jo({number:Number(q),decimalPlaces:((U=s==null?void 0:s.numberAxisFormat)==null?void 0:U.decimalPlaces)||0,useSuffix:!!((O=s==null?void 0:s.numberAxisFormat)!=null&&O.suffix),customSuffix:"",locale:((J=s==null?void 0:s.numberAxisFormat)==null?void 0:J.locale)||"",currency:((K=s==null?void 0:s.numberAxisFormat)==null?void 0:K.currency)||""})}).slice(0,2).join(" - ")}}},{dimensionKeys:G}=Yn(e),j=G[0];return{type:"bar",data:{labels:[...new Set(K1(e,j))],datasets:R},options:Z,plugins:[...C]}}if(t==="pie"||t==="doughnut"||t==="polarArea"){const w=oce(t,n),{dimensionKeys:_,metricKeys:R}=Yn(e),C=Iee(R,e),E=If(C,r),{plugins:A,options:M}=X1((s==null?void 0:s.customVisualCode)||""),N=_[0],L=K1(e,N),F=Jr((w==null?void 0:w.options)||{},(r==null?void 0:r.options)||{}),z=Jr(F,(s==null?void 0:s.chartOptions)||{}),Z={...z,plugins:{...z.plugins,datalabels:{...(v=z.plugins)==null?void 0:v.datalabels,formatter:(V,X)=>{var I,q,U,O;return Jo({number:Number(V),decimalPlaces:((I=s==null?void 0:s.numberAxisFormat)==null?void 0:I.decimalPlaces)||0,useSuffix:!!((q=s==null?void 0:s.numberAxisFormat)!=null&&q.suffix),customSuffix:"",locale:((U=s==null?void 0:s.numberAxisFormat)==null?void 0:U.locale)||"",currency:((O=s==null?void 0:s.numberAxisFormat)==null?void 0:O.currency)||""})}},tooltip:{...(x=z.plugins)==null?void 0:x.tooltip,callbacks:{label:function(V){var J,K,ne,Y;V.dataset.label;const I=V.dataset.data.reduce((ee,re)=>ee+re,0),q=V.parsed,U=Jo({number:Number(q),decimalPlaces:((J=s==null?void 0:s.numberAxisFormat)==null?void 0:J.decimalPlaces)||0,useSuffix:!!((K=s==null?void 0:s.numberAxisFormat)!=null&&K.suffix),customSuffix:"",locale:((ne=s==null?void 0:s.numberAxisFormat)==null?void 0:ne.locale)||"",currency:((Y=s==null?void 0:s.numberAxisFormat)==null?void 0:Y.currency)||""}),O=(q/I*100).toFixed(2);return U+` (${O}%)`}}}}},G=Jr(z,Z),j=Jr(G,M);return{type:t,data:{labels:L,datasets:E},options:j,plugins:[t==="doughnut"?{id:"doughnutLabel",beforeDatasetsDraw:function(V,X,I){var re,ue,fe,se;const{ctx:q,data:U}=V;q.save();const O=V.getDatasetMeta(0).data[0].x,J=V.getDatasetMeta(0).data[0].y,K=Qu(bh()),ne=window.getComputedStyle(q.canvas).fontFamily;q.font=`1em ${ne}`,q.fontWeight="bolder",q.fillStyle=K,q.textAlign="center",q.textBaseline="middle";const Y=U.datasets[0].data.reduce((pe,ce)=>pe+ce,0),ee=Jo({number:Number(Y),decimalPlaces:((re=s==null?void 0:s.numberAxisFormat)==null?void 0:re.decimalPlaces)||0,useSuffix:!!((ue=s==null?void 0:s.numberAxisFormat)!=null&&ue.suffix),customSuffix:"",locale:((fe=s==null?void 0:s.numberAxisFormat)==null?void 0:fe.locale)||"",currency:((se=s==null?void 0:s.numberAxisFormat)==null?void 0:se.currency)||""});q.fillText(ee,O,J)}}:"",...A]}}if(t==="radar"){const w=ice(n);return pl({data:e,cfg:w,customCfg:r,cardType:t,preferences:s})}if(t==="bubble"||t==="scatter"){const{metricKeys:w}=Yn(e);if(w.length<3){console.log("Bubble charts require 3 numeric columns");return}const _=Oee(e),R=If(_,r),C={plugins:{datalabels:{display:!0}},scales:{x:{title:{display:!0,text:w[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:w[1]},beginAtZero:!0,ticks:{precision:0}}}},E=Jr(C,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:R},options:E}}return pl({data:e,cfg:n,customCfg:r,cardType:t,preferences:s})}function sce({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:o,apply:i}){const s=be.getState().theme;if(!o)return;const a=s==="dark"?"rgb(238,238,238,0.2)":"rgb(238,238,238,0.8)";["bar","line","horizontalBar","bubble","scatter"].includes(r)&&lce(e,t,o,i,a),["pie","doughnut","polarArea"].includes(r)&&cce(e,t,o,i,a),["stackedBar","pyramid"].includes(r)&&ace({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:a})}function ace(e){var a,l,c,u;const{chart:t,elementIndex:n,datasetIndex:r,cfg:o,apply:i,blurColor:s}=e;i?(l=(a=t==null?void 0:t.data)==null?void 0:a.datasets)==null||l.forEach((d,p)=>{var h,m;typeof d.backgroundColor=="string"&&(d.backgroundColor=new Array(d.data.length).fill(d.backgroundColor),d.borderColor=new Array(d.data.length).fill(d.borderColor)),d.backgroundColor=(h=d==null?void 0:d.backgroundColor)==null?void 0:h.map((b,v)=>v===n&&p===r?b:s),d.borderColor=(m=d==null?void 0:d.borderColor)==null?void 0:m.map((b,v)=>v===n&&p===r?b:s)}):(u=(c=t==null?void 0:t.data)==null?void 0:c.datasets)==null||u.forEach((d,p)=>{var h,m,b,v,x,w;d.backgroundColor=new Array(d.data.length).fill((b=(m=(h=o==null?void 0:o.data)==null?void 0:h.datasets)==null?void 0:m[p])==null?void 0:b.backgroundColor),d.borderColor=new Array(d.data.length).fill((w=(x=(v=o==null?void 0:o.data)==null?void 0:v.datasets)==null?void 0:x[p])==null?void 0:w.borderColor)}),t==null||t.update()}function lce(e,t,n,r,o){var i,s,a,l;r?(s=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||s.forEach(c=>{var u,d;typeof c.backgroundColor=="string"&&(c.backgroundColor=new Array(c.data.length).fill(c.backgroundColor),c.borderColor=new Array(c.data.length).fill(c.borderColor)),c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((p,h)=>h===t?p:o),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((p,h)=>h===t?p:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var d,p,h,m,b,v;c.backgroundColor=new Array(c.data.length).fill((h=(p=(d=n==null?void 0:n.data)==null?void 0:d.datasets)==null?void 0:p[u])==null?void 0:h.backgroundColor),c.borderColor=new Array(c.data.length).fill((v=(b=(m=n==null?void 0:n.data)==null?void 0:m.datasets)==null?void 0:b[u])==null?void 0:v.borderColor)}),e==null||e.update()}function cce(e,t,n,r,o){var i,s,a,l;r?(s=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||s.forEach(c=>{var u,d;c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((p,h)=>h===t?p:o),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((p,h)=>h===t?p:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var d,p,h,m,b,v,x,w;typeof c.backgroundColor=="string"&&(c.backgroundColor=(h=(p=(d=n==null?void 0:n.data)==null?void 0:d.datasets)==null?void 0:p[u])==null?void 0:h.backgroundColor,c.borderColor=(v=(b=(m=n==null?void 0:n.data)==null?void 0:m.datasets)==null?void 0:b[u])==null?void 0:v.borderColor),c.backgroundColor=(x=c==null?void 0:c.backgroundColor)==null?void 0:x.map((_,R)=>{var C;return(C=n.data.datasets[u].backgroundColor)==null?void 0:C[R]}),c.borderColor=(w=c==null?void 0:c.borderColor)==null?void 0:w.map((_,R)=>{var C;return(C=n.data.datasets[u].borderColor)==null?void 0:C[R]})}),e==null||e.update()}function uce({card:e,data:t,datasetIndex:n,clickIndex:r,value:o}){var i,s,a,l,c,u;try{if(!t)return;const{keys:d,dimensionKeys:p,metricKeys:h}=Yn(t);if(e.type==="map"){const m=d[0],b=((s=(i=o==null?void 0:o.feature)==null?void 0:i.properties)==null?void 0:s.name)||((l=(a=o==null?void 0:o.feature)==null?void 0:a.properties)==null?void 0:l.NAME);return[{columnName:m,columnValue:b}]}if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const m=p[0],b=(c=t[r])==null?void 0:c[m];return[{columnName:m,columnValue:b,metric:h[n],value:o}]}if(["stackedBar","pyramid"].includes(e.type)){const m=vb({dataArray:t,groupKey:p[0],pivotKey:p[1],valueKey:h[0]}),b=p[0],v=(u=m[r])==null?void 0:u[b],x=p[1],{metricKeys:w}=Yn(m),_=w[n];return[{columnName:b,columnValue:v,metric:h[0],value:o},{columnName:x,columnValue:_,metric:h[0],value:o}]}if(e.type==="bubble"||e.type==="scatter"){const m=p[0],b=o.label;return[{columnName:m,columnValue:b,metric1:h[0],value1:o.x,metric2:h[1],value2:o.y,metric3:h==null?void 0:h[2],value3:o==null?void 0:o.r}]}}catch(d){console.error("Error in getAdhocFilter",d)}}function dce(e,t){var r,o;if((((r=e.data.datasets)==null?void 0:r.filter(i=>!!i.fill))||[]).length>0){const i=(o=e==null?void 0:e.data.datasets)==null?void 0:o.map(a=>({...a,backgroundColor:[a.backgroundColor].map(l=>{const c=t.createLinearGradient(0,0,0,400);return c.addColorStop(0,l),c.addColorStop(.7,Jee("--semaphor-background")),c})}));return{...e,data:{...e.data,datasets:i}}}return e}function E4(e){var a,l,c,u,d,p;const t=(((l=(a=e.preferences)==null?void 0:a.mapVisualOptions)==null?void 0:l.topoJsonUrl)==="custom"?(u=(c=e.preferences)==null?void 0:c.mapVisualOptions)==null?void 0:u.customTopoJsonUrl:(p=(d=e.preferences)==null?void 0:d.mapVisualOptions)==null?void 0:p.topoJsonUrl)||"",n=!!t&&e.type==="map",{data:r,isLoading:o,isFetching:i,isError:s}=rp({queryKey:["topojson",t],queryFn:()=>fetch(t).then(h=>h.json()),enabled:n,staleTime:1/0});return{data:r,isLoading:o,isFetching:i,isError:s}}function fce(e){var s,a;const[t]=T.useState({id:"",title:"",type:"bar"}),{getCard:n}=An(),r=n(e),o=R4(r||t),i={...r,data:((s=o==null?void 0:o.data)==null?void 0:s.records)||[]};return{...o,data:((a=o==null?void 0:o.data)==null?void 0:a.records)||[],card:i}}function R4(e){var Z,G,j,H;const{onChartElementClicked:t}=Do(),[n,r]=T.useState(0);((Z=e==null?void 0:e.preferences)==null?void 0:Z.filterOnClickColumnIndex)===void 0||(G=e.preferences)==null||G.filterOnClickColumnIndex;const o=be($=>$.isVisualEditing),i=be($=>$.filteringCards),s=be($=>$.selectedSheetId),a=be($=>$.selectedLensId);be($=>$.selectedCardId),be($=>$.dashboard),be($=>$.isDashboardEditing),be($=>$.themeStyle);const l=be($=>$.filterValues),c=T.useRef(l),u=(j=e==null?void 0:e.preferences)==null?void 0:j.onClickFilter,{addFilteringCard:d,getCardFrame:p,addOrUpdateFilterValues:h,removeFilterValues:m,removeFilteringCard:b}=An(),{data:v,isLoading:x,isFetching:w,isError:_,queryKey:R}=La(e),{data:C}=E4(e),E=i==null?void 0:i.find($=>$.id===e.id),A=p(e.id),M=(A==null?void 0:A.cards)||[],N=(M==null?void 0:M.length)==1;let L;v&&v.records&&((H=v.records)==null?void 0:H.length)>0&&e.type!=="custom"&&(L=xE({data:v==null?void 0:v.records,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg,preferences:e.preferences,topoJson:C}));const F=T.useRef({filteringCards:i});T.useEffect(()=>{!(v!=null&&v.records)||x||w||E&&N||o||r($=>$+1)},[v==null?void 0:v.records,x,w,E,N,o]),T.useEffect(()=>{e.connectionId&&!E&&(c.current=l)},[l,a,e.connectionId,E]),T.useEffect(()=>{var V;E&&(F.current.filteringCards=[...i||[]]),!E&&((V=F.current.filteringCards)==null?void 0:V.find(X=>X.id===e.id))&&N&&r(X=>X+1)},[E,N,e.id,i]);function z($,V,X,I){var O;let q=!1;if(!(v!=null&&v.records))return;const U=uce({card:e,data:v==null?void 0:v.records,datasetIndex:V,clickIndex:X,value:I});if(console.log("fieldValues",U),t==null||t(e,U),!!(((O=e==null?void 0:e.preferences)==null?void 0:O.onClickFilter)??[]).length){if(E){const J=e.id;m(J),b(e)}else{if(q=!0,!U)return;const J=[];U.forEach((K,ne)=>{const Y=u==null?void 0:u.find(re=>re.columnIndex===ne);if(!Y)return;const ee={filterId:e.id+"-"+K.columnName+"-"+s,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:K.columnName,expression:Y.expression,valueType:S0(U[Y.columnIndex].columnValue),operation:"=",values:[U[Y.columnIndex].columnValue]};J.push(ee)}),h(J),d(e)}sce({chart:$,elementIndex:X,datasetIndex:V,cardType:e.type,cfg:L,apply:q})}}return{isError:_,isLoading:x,isFetching:w,data:v,visualKey:n,handleDatapointClick:z,cfg:L,queryKey:R}}function Xi({children:e,containerClassName:t,className:n,text:r,onSave:o,type:i="input"}){const[s,a]=T.useState(!1),[l,c]=T.useState(r),u=be(h=>h.isDashboardEditing),d=h=>{h.stopPropagation(),u&&a(!0)};function p(){return i==="textarea"?y.jsx("textarea",{className:ge("grow rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",n),onChange:h=>c(h.target.value),value:l,autoFocus:!0,onBlur:()=>a(!1),onKeyDown:h=>{h.stopPropagation(),!(h.key==="Enter"&&h.shiftKey)&&(h.key==="Enter"||h.key==="Tab")&&(a(!1),o(l))}}):y.jsx("input",{onMouseDown:h=>h.stopPropagation(),type:"text",className:ge("rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",n),onChange:h=>c(h.target.value),value:l,autoFocus:!0,onBlur:()=>a(!1),onKeyDown:h=>{h.stopPropagation(),(h.key==="Enter"||h.key==="Tab")&&(a(!1),o(l))}})}return y.jsx("div",{className:ge("flex",t),role:"editable",onDoubleClick:d,children:s?p():e})}function P4(e){const{authToken:t}=Do(),n=dX(t==null?void 0:t.accessToken);function r(){var i,s,a,l,c,u;if((s=(i=e.preferences)==null?void 0:i.formatNumber)!=null&&s.currency&&((l=(a=e.preferences)==null?void 0:a.formatNumber)==null?void 0:l.currency)!=="none")return n!=null&&n.currency?n==null?void 0:n.currency:(u=(c=e.preferences)==null?void 0:c.formatNumber)==null?void 0:u.currency}function o(){var i,s,a,l,c,u;if((s=(i=e.preferences)==null?void 0:i.formatNumber)!=null&&s.locale&&((l=(a=e.preferences)==null?void 0:a.formatNumber)==null?void 0:l.locale)!=="none")return n!=null&&n.locale?n==null?void 0:n.locale:(u=(c=e.preferences)==null?void 0:c.formatNumber)==null?void 0:u.locale}return{getCurrency:r,getLocale:o}}function Wb({card:e,data:t}){var w,_,R,C,E,A,M,N,L,F,z,Z,G,j,H,$;const n=be(V=>V.actions.setCardTitle),r=be(V=>V.actions.setCardDescription),o=be(V=>V.isVisualEditing),i=to(V=>V.card),s=to(V=>V.actions.setCard);to(V=>V.actions.setNumberFormat);const{getCurrency:a,getLocale:l}=P4(e),c=be(V=>V.selectedSheetId),u=(_=(w=e.preferences)==null?void 0:w.formatNumber)==null?void 0:_.colorRanges,{metricKeys:d}=Yn(t),p=(R=t==null?void 0:t[0])==null?void 0:R[d==null?void 0:d[0]],h=(C=t==null?void 0:t[0])==null?void 0:C[d==null?void 0:d[1]],m=t&&t.length>0;function b(V){o?s({...i,title:V}):n(c,e.id,V)}function v(V){o?s({...i,description:V}):r(c,e.id,V)}const x=h&&h-p!==0?(p-h)/h:null;return y.jsxs("div",{className:"kpi-card flex grow flex-col overflow-auto",children:[y.jsxs(C0,{className:"grow pb-3",children:[y.jsx(Xi,{text:o?i.title:e.title,onSave:b,children:y.jsx("div",{className:"flex items-center gap-2",children:y.jsx(wd,{className:"text-base font-medium text-muted-foreground",children:e.title})})}),m&&y.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[y.jsx("p",{style:{color:VC(p,u)},className:"text-3xl font-semibold",children:Jo({number:p,decimalPlaces:((A=(E=e.preferences)==null?void 0:E.formatNumber)==null?void 0:A.decimalPlaces)||0,useSuffix:!!((N=(M=e.preferences)==null?void 0:M.formatNumber)!=null&&N.suffix),customSuffix:((F=(L=e.preferences)==null?void 0:L.formatNumber)==null?void 0:F.suffix)||"",locale:l()||"",currency:a()||""})}),h&&y.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from ",Jo({number:h,decimalPlaces:((Z=(z=e.preferences)==null?void 0:z.formatNumber)==null?void 0:Z.decimalPlaces)||0,useSuffix:!!((j=(G=e.preferences)==null?void 0:G.formatNumber)!=null&&j.suffix),customSuffix:(($=(H=e.preferences)==null?void 0:H.formatNumber)==null?void 0:$.suffix)||"",locale:l()||"",currency:a()||""})]})]})]}),x&&y.jsxs(E0,{className:"grow items-start gap-1 pb-4 text-sm",children:[y.jsx(T4,{children:x}),y.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[x>0?"up ":"down ",y.jsx(Xi,{text:e.description||"",onSave:v,children:e.description})]})]})]})}function T4({children:e,className:t}){var i,s;const n=be(a=>a.themeStyle),r=e>0?y.jsx("span",{children:"+"}):y.jsx("span",{children:"-"}),o=`${Math.abs(e*100).toFixed(0)}%`;return y.jsxs("div",{style:{borderRadius:(s=(i=n==null?void 0:n.chart)==null?void 0:i.options)==null?void 0:s.borderRadius},className:ge("flex items-center px-1 text-sm font-semibold",{"bg-green-600/10 text-green-600":e>0,"bg-destructive/10 text-destructive":e<0},t),children:[r,y.jsx("span",{className:"ml-[1px]",children:o})]})}const hce=["top","right","bottom","left"],Ys=Math.min,mr=Math.max,Oh=Math.round,mm=Math.floor,Qi=e=>({x:e,y:e}),pce={left:"right",right:"left",bottom:"top",top:"bottom"},gce={start:"end",end:"start"};function TS(e,t,n){return mr(e,Ys(t,n))}function ns(e,t){return typeof e=="function"?e(t):e}function Ks(e){return e.split("-")[0]}function Td(e){return e.split("-")[1]}function wE(e){return e==="x"?"y":"x"}function SE(e){return e==="y"?"height":"width"}function Ha(e){return["top","bottom"].includes(Ks(e))?"y":"x"}function _E(e){return wE(Ha(e))}function mce(e,t,n){n===void 0&&(n=!1);const r=Td(e),o=_E(e),i=SE(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ub(s)),[s,Ub(s)]}function bce(e){const t=Ub(e);return[kS(e),t,kS(t)]}function kS(e){return e.replace(/start|end/g,t=>gce[t])}function yce(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[]}}function vce(e,t,n,r){const o=Td(e);let i=yce(Ks(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(kS)))),i}function Ub(e){return e.replace(/left|right|bottom|top/g,t=>pce[t])}function xce(e){return{top:0,right:0,bottom:0,left:0,...e}}function k4(e){return typeof e!="number"?xce(e):{top:e,right:e,bottom:e,left:e}}function Gb(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}}function lM(e,t,n){let{reference:r,floating:o}=e;const i=Ha(t),s=_E(t),a=SE(s),l=Ks(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=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(Td(t)){case"start":h[s]-=p*(n&&c?-1:1);break;case"end":h[s]+=p*(n&&c?-1:1);break}return h}const wce=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=lM(c,r,l),p=r,h={},m=0;for(let b=0;b<a.length;b++){const{name:v,fn:x}=a[b],{x:w,y:_,data:R,reset:C}=await x({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=w??u,d=_??d,h={...h,[v]:{...h[v],...R}},C&&m<=50&&(m++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(c=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:d}=lM(c,p,l)),b=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:h}};async function dd(e,t){var n;t===void 0&&(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:p=!1,padding:h=0}=ns(t,e),m=k4(h),v=a[p?d==="floating"?"reference":"floating":d],x=Gb(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),w=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),R=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},C=Gb(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:_,strategy:l}):w);return{top:(x.top-C.top+m.top)/R.y,bottom:(C.bottom-x.bottom+m.bottom)/R.y,left:(x.left-C.left+m.left)/R.x,right:(C.right-x.right+m.right)/R.x}}const Sce=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}=ns(e,t)||{};if(c==null)return{};const d=k4(u),p={x:n,y:r},h=_E(o),m=SE(h),b=await s.getDimensions(c),v=h==="y",x=v?"top":"left",w=v?"bottom":"right",_=v?"clientHeight":"clientWidth",R=i.reference[m]+i.reference[h]-p[h]-i.floating[m],C=p[h]-i.reference[h],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=E?E[_]:0;(!A||!await(s.isElement==null?void 0:s.isElement(E)))&&(A=a.floating[_]||i.floating[m]);const M=R/2-C/2,N=A/2-b[m]/2-1,L=Ys(d[x],N),F=Ys(d[w],N),z=L,Z=A-b[m]-F,G=A/2-b[m]/2+M,j=TS(z,G,Z),H=!l.arrow&&Td(o)!=null&&G!==j&&i.reference[m]/2-(G<z?L:F)-b[m]/2<0,$=H?G<z?G-z:G-Z:0;return{[h]:p[h]+$,data:{[h]:j,centerOffset:G-j-$,...H&&{alignmentOffset:$}},reset:H}}}),_ce=function(e){return e===void 0&&(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:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:b=!0,...v}=ns(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Ks(o),w=Ha(a),_=Ks(a)===a,R=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=p||(_||!b?[Ub(a)]:bce(a)),E=m!=="none";!p&&E&&C.push(...vce(a,b,m,R));const A=[a,...C],M=await dd(t,v),N=[];let L=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&N.push(M[x]),d){const G=mce(o,s,R);N.push(M[G[0]],M[G[1]])}if(L=[...L,{placement:o,overflows:N}],!N.every(G=>G<=0)){var F,z;const G=(((F=i.flip)==null?void 0:F.index)||0)+1,j=A[G];if(j)return{data:{index:G,overflows:L},reset:{placement:j}};let H=(z=L.filter($=>$.overflows[0]<=0).sort(($,V)=>$.overflows[1]-V.overflows[1])[0])==null?void 0:z.placement;if(!H)switch(h){case"bestFit":{var Z;const $=(Z=L.filter(V=>{if(E){const X=Ha(V.placement);return X===w||X==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(X=>X>0).reduce((X,I)=>X+I,0)]).sort((V,X)=>V[1]-X[1])[0])==null?void 0:Z[0];$&&(H=$);break}case"initialPlacement":H=a;break}if(o!==H)return{reset:{placement:H}}}return{}}}};function cM(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function uM(e){return hce.some(t=>e[t]>=0)}const Cce=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ns(e,t);switch(r){case"referenceHidden":{const i=await dd(t,{...o,elementContext:"reference"}),s=cM(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:uM(s)}}}case"escaped":{const i=await dd(t,{...o,altBoundary:!0}),s=cM(i,n.floating);return{data:{escapedOffsets:s,escaped:uM(s)}}}default:return{}}}}};async function Ece(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Ks(n),a=Td(n),l=Ha(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=ns(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}const Rce=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await Ece(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Pce=function(e){return e===void 0&&(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:v=>{let{x,y:w}=v;return{x,y:w}}},...l}=ns(e,t),c={x:n,y:r},u=await dd(t,l),d=Ha(Ks(o)),p=wE(d);let h=c[p],m=c[d];if(i){const v=p==="y"?"top":"left",x=p==="y"?"bottom":"right",w=h+u[v],_=h-u[x];h=TS(w,h,_)}if(s){const v=d==="y"?"top":"left",x=d==="y"?"bottom":"right",w=m+u[v],_=m-u[x];m=TS(w,m,_)}const b=a.fn({...t,[p]:h,[d]:m});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[p]:i,[d]:s}}}}}},Tce=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=ns(e,t),u={x:n,y:r},d=Ha(o),p=wE(d);let h=u[p],m=u[d];const b=ns(a,t),v=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const _=p==="y"?"height":"width",R=i.reference[p]-i.floating[_]+v.mainAxis,C=i.reference[p]+i.reference[_]-v.mainAxis;h<R?h=R:h>C&&(h=C)}if(c){var x,w;const _=p==="y"?"width":"height",R=["top","left"].includes(Ks(o)),C=i.reference[d]-i.floating[_]+(R&&((x=s.offset)==null?void 0:x[d])||0)+(R?0:v.crossAxis),E=i.reference[d]+i.reference[_]+(R?0:((w=s.offset)==null?void 0:w[d])||0)-(R?v.crossAxis:0);m<C?m=C:m>E&&(m=E)}return{[p]:h,[d]:m}}}},kce=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=ns(e,t),u=await dd(t,c),d=Ks(o),p=Td(o),h=Ha(o)==="y",{width:m,height:b}=i.floating;let v,x;d==="top"||d==="bottom"?(v=d,x=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(x=d,v=p==="end"?"top":"bottom");const w=b-u.top-u.bottom,_=m-u.left-u.right,R=Ys(b-u[v],w),C=Ys(m-u[x],_),E=!t.middlewareData.shift;let A=R,M=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=w),E&&!p){const L=mr(u.left,0),F=mr(u.right,0),z=mr(u.top,0),Z=mr(u.bottom,0);h?M=m-2*(L!==0||F!==0?L+F:mr(u.left,u.right)):A=b-2*(z!==0||Z!==0?z+Z:mr(u.top,u.bottom))}await l({...t,availableWidth:M,availableHeight:A});const N=await s.getDimensions(a.floating);return m!==N.width||b!==N.height?{reset:{rects:!0}}:{}}}};function ty(){return typeof window<"u"}function kd(e){return A4(e)?(e.nodeName||"").toLowerCase():"#document"}function ko(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ds(e){var t;return(t=(A4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function A4(e){return ty()?e instanceof Node||e instanceof ko(e).Node:!1}function xr(e){return ty()?e instanceof Element||e instanceof ko(e).Element:!1}function rs(e){return ty()?e instanceof HTMLElement||e instanceof ko(e).HTMLElement:!1}function dM(e){return!ty()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ko(e).ShadowRoot}function fp(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ci(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Ace(e){return["table","td","th"].includes(kd(e))}function ny(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function CE(e){const t=EE(),n=xr(e)?Ci(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Oce(e){let t=Va(e);for(;rs(t)&&!fd(t);){if(CE(t))return t;if(ny(t))return null;t=Va(t)}return null}function EE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function fd(e){return["html","body","#document"].includes(kd(e))}function Ci(e){return ko(e).getComputedStyle(e)}function ry(e){return xr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Va(e){if(kd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||dM(e)&&e.host||ds(e);return dM(t)?t.host:t}function O4(e){const t=Va(e);return fd(t)?e.ownerDocument?e.ownerDocument.body:e.body:rs(t)&&fp(t)?t:O4(t)}function Mh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=O4(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ko(o);if(i){const a=AS(s);return t.concat(s,s.visualViewport||[],fp(o)?o:[],a&&n?Mh(a):[])}return t.concat(o,Mh(o,[],n))}function AS(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function M4(e){const t=Ci(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=rs(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Oh(n)!==i||Oh(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function RE(e){return xr(e)?e:e.contextElement}function Tu(e){const t=RE(e);if(!rs(t))return Qi(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=M4(t);let s=(i?Oh(n.width):n.width)/r,a=(i?Oh(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Mce=Qi(0);function I4(e){const t=ko(e);return!EE()||!t.visualViewport?Mce:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ice(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ko(e)?!1:t}function bc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=RE(e);let s=Qi(1);t&&(r?xr(r)&&(s=Tu(r)):s=Tu(e));const a=Ice(i,n,r)?I4(i):Qi(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 p=ko(i),h=r&&xr(r)?ko(r):r;let m=p,b=AS(m);for(;b&&r&&h!==m;){const v=Tu(b),x=b.getBoundingClientRect(),w=Ci(b),_=x.left+(b.clientLeft+parseFloat(w.paddingLeft))*v.x,R=x.top+(b.clientTop+parseFloat(w.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=_,c+=R,m=ko(b),b=AS(m)}}return Gb({width:u,height:d,x:l,y:c})}function PE(e,t){const n=ry(e).scrollLeft;return t?t.left+n:bc(ds(e)).left+n}function D4(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:PE(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Dce(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=ds(r),a=t?ny(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Qi(1);const u=Qi(0),d=rs(r);if((d||!d&&!i)&&((kd(r)!=="body"||fp(s))&&(l=ry(r)),rs(r))){const h=bc(r);c=Tu(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const p=s&&!d&&!i?D4(s,l,!0):Qi(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}}function Nce(e){return Array.from(e.getClientRects())}function Lce(e){const t=ds(e),n=ry(e),r=e.ownerDocument.body,o=mr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=mr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+PE(e);const a=-n.scrollTop;return Ci(r).direction==="rtl"&&(s+=mr(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Fce(e,t){const n=ko(e),r=ds(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=EE();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function jce(e,t){const n=bc(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=rs(e)?Tu(e):Qi(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function fM(e,t,n){let r;if(t==="viewport")r=Fce(e,n);else if(t==="document")r=Lce(ds(e));else if(xr(t))r=jce(t,n);else{const o=I4(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Gb(r)}function N4(e,t){const n=Va(e);return n===t||!xr(n)||fd(n)?!1:Ci(n).position==="fixed"||N4(n,t)}function $ce(e,t){const n=t.get(e);if(n)return n;let r=Mh(e,[],!1).filter(a=>xr(a)&&kd(a)!=="body"),o=null;const i=Ci(e).position==="fixed";let s=i?Va(e):e;for(;xr(s)&&!fd(s);){const a=Ci(s),l=CE(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||fp(s)&&!l&&N4(e,s))?r=r.filter(u=>u!==s):o=a,s=Va(s)}return t.set(e,r),r}function zce(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?ny(t)?[]:$ce(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=fM(t,u,o);return c.top=mr(d.top,c.top),c.right=Ys(d.right,c.right),c.bottom=Ys(d.bottom,c.bottom),c.left=mr(d.left,c.left),c},fM(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Bce(e){const{width:t,height:n}=M4(e);return{width:t,height:n}}function Hce(e,t,n){const r=rs(t),o=ds(t),i=n==="fixed",s=bc(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Qi(0);if(r||!r&&!i)if((kd(t)!=="body"||fp(o))&&(a=ry(t)),r){const p=bc(t,!0,i,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&(l.x=PE(o));const c=o&&!r&&!i?D4(o,a):Qi(0),u=s.left+a.scrollLeft-l.x-c.x,d=s.top+a.scrollTop-l.y-c.y;return{x:u,y:d,width:s.width,height:s.height}}function Zx(e){return Ci(e).position==="static"}function hM(e,t){if(!rs(e)||Ci(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ds(e)===n&&(n=n.ownerDocument.body),n}function L4(e,t){const n=ko(e);if(ny(e))return n;if(!rs(e)){let o=Va(e);for(;o&&!fd(o);){if(xr(o)&&!Zx(o))return o;o=Va(o)}return n}let r=hM(e,t);for(;r&&Ace(r)&&Zx(r);)r=hM(r,t);return r&&fd(r)&&Zx(r)&&!CE(r)?n:r||Oce(e)||n}const Vce=async function(e){const t=this.getOffsetParent||L4,n=this.getDimensions,r=await n(e.floating);return{reference:Hce(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Wce(e){return Ci(e).direction==="rtl"}const Uce={convertOffsetParentRelativeRectToViewportRelativeRect:Dce,getDocumentElement:ds,getClippingRect:zce,getOffsetParent:L4,getElementRects:Vce,getClientRects:Nce,getDimensions:Bce,getScale:Tu,isElement:xr,isRTL:Wce};function F4(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Gce(e,t){let n=null,r;const o=ds(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:h}=c;if(a||t(),!p||!h)return;const m=mm(d),b=mm(o.clientWidth-(u+p)),v=mm(o.clientHeight-(d+h)),x=mm(u),_={rootMargin:-m+"px "+-b+"px "+-v+"px "+-x+"px",threshold:mr(0,Ys(1,l))||1};let R=!0;function C(E){const A=E[0].intersectionRatio;if(A!==l){if(!R)return s();A?s(!1,A):r=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!F4(c,e.getBoundingClientRect())&&s(),R=!1}try{n=new IntersectionObserver(C,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,_)}n.observe(e)}return s(!0),i}function j4(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=RE(e),u=o||i?[...c?Mh(c):[],...Mh(t)]:[];u.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const d=c&&a?Gce(c,n):null;let p=-1,h=null;s&&(h=new ResizeObserver(x=>{let[w]=x;w&&w.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var _;(_=h)==null||_.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m,b=l?bc(e):null;l&&v();function v(){const x=bc(e);b&&!F4(b,x)&&n(),b=x,m=requestAnimationFrame(v)}return n(),()=>{var x;u.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d==null||d(),(x=h)==null||x.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const Jx=dd,qce=Rce,Yce=Pce,Kce=_ce,Xce=kce,Qce=Cce,pM=Sce,Zce=Tce,Jce=(e,t,n)=>{const r=new Map,o={platform:Uce,...n},i={...o.platform,_c:r};return wce(e,t,{...o,platform:i})};var tb=typeof document<"u"?T.useLayoutEffect:T.useEffect;function qb(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!qb(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!qb(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function $4(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gM(e,t){const n=$4(e);return Math.round(t*n)/n}function ew(e){const t=P.useRef(e);return tb(()=>{t.current=e}),t}function z4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=P.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=P.useState(r);qb(p,r)||h(r);const[m,b]=P.useState(null),[v,x]=P.useState(null),w=P.useCallback(V=>{V!==E.current&&(E.current=V,b(V))},[]),_=P.useCallback(V=>{V!==A.current&&(A.current=V,x(V))},[]),R=i||m,C=s||v,E=P.useRef(null),A=P.useRef(null),M=P.useRef(u),N=l!=null,L=ew(l),F=ew(o),z=ew(c),Z=P.useCallback(()=>{if(!E.current||!A.current)return;const V={placement:t,strategy:n,middleware:p};F.current&&(V.platform=F.current),Jce(E.current,A.current,V).then(X=>{const I={...X,isPositioned:z.current!==!1};G.current&&!qb(M.current,I)&&(M.current=I,lc.flushSync(()=>{d(I)}))})},[p,t,n,F,z]);tb(()=>{c===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,d(V=>({...V,isPositioned:!1})))},[c]);const G=P.useRef(!1);tb(()=>(G.current=!0,()=>{G.current=!1}),[]),tb(()=>{if(R&&(E.current=R),C&&(A.current=C),R&&C){if(L.current)return L.current(R,C,Z);Z()}},[R,C,Z,L,N]);const j=P.useMemo(()=>({reference:E,floating:A,setReference:w,setFloating:_}),[w,_]),H=P.useMemo(()=>({reference:R,floating:C}),[R,C]),$=P.useMemo(()=>{const V={position:n,left:0,top:0};if(!H.floating)return V;const X=gM(H.floating,u.x),I=gM(H.floating,u.y);return a?{...V,transform:"translate("+X+"px, "+I+"px)",...$4(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:I}},[n,a,H.floating,u.x,u.y]);return P.useMemo(()=>({...u,update:Z,refs:j,elements:H,floatingStyles:$}),[u,Z,j,H,$])}const eue=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?pM({element:r.current,padding:o}).fn(n):{}:r?pM({element:r,padding:o}).fn(n):{}}}},TE=(e,t)=>({...qce(e),options:[e,t]}),B4=(e,t)=>({...Yce(e),options:[e,t]}),tue=(e,t)=>({...Zce(e),options:[e,t]}),H4=(e,t)=>({...Kce(e),options:[e,t]}),V4=(e,t)=>({...Xce(e),options:[e,t]}),nue=(e,t)=>({...Qce(e),options:[e,t]}),rue=(e,t)=>({...eue(e),options:[e,t]});var oue="Arrow",W4=P.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return y.jsx(Oe.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:y.jsx("polygon",{points:"0,0 30,0 15,10"})})});W4.displayName=oue;var iue=W4;function oy(e){const[t,n]=P.useState(void 0);return or(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var kE="Popper",[U4,fs]=Vn(kE),[sue,G4]=U4(kE),q4=e=>{const{__scopePopper:t,children:n}=e,[r,o]=P.useState(null);return y.jsx(sue,{scope:t,anchor:r,onAnchorChange:o,children:n})};q4.displayName=kE;var Y4="PopperAnchor",K4=P.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=G4(Y4,n),s=P.useRef(null),a=et(t,s);return P.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:y.jsx(Oe.div,{...o,ref:a})});K4.displayName=Y4;var AE="PopperContent",[aue,lue]=U4(AE),X4=P.forwardRef((e,t)=>{var Y,ee,re,ue,fe,se;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:m,...b}=e,v=G4(AE,n),[x,w]=P.useState(null),_=et(t,pe=>w(pe)),[R,C]=P.useState(null),E=oy(R),A=(E==null?void 0:E.width)??0,M=(E==null?void 0:E.height)??0,N=r+(i!=="center"?"-"+i:""),L=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},F=Array.isArray(c)?c:[c],z=F.length>0,Z={padding:L,boundary:F.filter(uue),altBoundary:z},{refs:G,floatingStyles:j,placement:H,isPositioned:$,middlewareData:V}=z4({strategy:"fixed",placement:N,whileElementsMounted:(...pe)=>j4(...pe,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[TE({mainAxis:o+M,alignmentAxis:s}),l&&B4({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?tue():void 0,...Z}),l&&H4({...Z}),V4({...Z,apply:({elements:pe,rects:ce,availableWidth:_e,availableHeight:Pe})=>{const{width:Me,height:ke}=ce.reference,Ne=pe.floating.style;Ne.setProperty("--radix-popper-available-width",`${_e}px`),Ne.setProperty("--radix-popper-available-height",`${Pe}px`),Ne.setProperty("--radix-popper-anchor-width",`${Me}px`),Ne.setProperty("--radix-popper-anchor-height",`${ke}px`)}}),R&&rue({element:R,padding:a}),due({arrowWidth:A,arrowHeight:M}),p&&nue({strategy:"referenceHidden",...Z})]}),[X,I]=J4(H),q=Bn(m);or(()=>{$&&(q==null||q())},[$,q]);const U=(Y=V.arrow)==null?void 0:Y.x,O=(ee=V.arrow)==null?void 0:ee.y,J=((re=V.arrow)==null?void 0:re.centerOffset)!==0,[K,ne]=P.useState();return or(()=>{x&&ne(window.getComputedStyle(x).zIndex)},[x]),y.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:$?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[(ue=V.transformOrigin)==null?void 0:ue.x,(fe=V.transformOrigin)==null?void 0:fe.y].join(" "),...((se=V.hide)==null?void 0:se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:y.jsx(aue,{scope:n,placedSide:X,onArrowChange:C,arrowX:U,arrowY:O,shouldHideArrow:J,children:y.jsx(Oe.div,{"data-side":X,"data-align":I,...b,ref:_,style:{...b.style,animation:$?void 0:"none"}})})})});X4.displayName=AE;var Q4="PopperArrow",cue={top:"bottom",right:"left",bottom:"top",left:"right"},Z4=P.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=lue(Q4,r),s=cue[i.placedSide];return y.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:y.jsx(iue,{...o,ref:n,style:{...o.style,display:"block"}})})});Z4.displayName=Q4;function uue(e){return e!==null}var due=e=>({name:"transformOrigin",options:e,fn(t){var v,x,w;const{placement:n,rects:r,middlewareData:o}=t,s=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,u]=J4(n),d={start:"0%",center:"50%",end:"100%"}[u],p=(((x=o.arrow)==null?void 0:x.x)??0)+a/2,h=(((w=o.arrow)==null?void 0:w.y)??0)+l/2;let m="",b="";return c==="bottom"?(m=s?d:`${p}px`,b=`${-l}px`):c==="top"?(m=s?d:`${p}px`,b=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,b=s?d:`${h}px`):c==="left"&&(m=`${r.floating.width+l}px`,b=s?d:`${h}px`),{data:{x:m,y:b}}}});function J4(e){const[t,n="center"]=e.split("-");return[t,n]}var hp=q4,Ad=K4,pp=X4,gp=Z4,fue="Portal",mp=P.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=P.useState(!1);or(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?br.createPortal(y.jsx(Oe.div,{...r,ref:t}),s):null});mp.displayName=fue;function hue(e,t=globalThis==null?void 0:globalThis.document){const n=Bn(e);P.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var pue="DismissableLayer",OS="dismissableLayer.update",gue="dismissableLayer.pointerDownOutside",mue="dismissableLayer.focusOutside",mM,e3=P.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Oc=P.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=P.useContext(e3),[u,d]=P.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=P.useState({}),m=et(t,A=>d(A)),b=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=b.indexOf(v),w=u?b.indexOf(u):-1,_=c.layersWithOutsidePointerEventsDisabled.size>0,R=w>=x,C=vue(A=>{const M=A.target,N=[...c.branches].some(L=>L.contains(M));!R||N||(o==null||o(A),s==null||s(A),A.defaultPrevented||a==null||a())},p),E=xue(A=>{const M=A.target;[...c.branches].some(L=>L.contains(M))||(i==null||i(A),s==null||s(A),A.defaultPrevented||a==null||a())},p);return hue(A=>{w===c.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},p),P.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(mM=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),bM(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=mM)}},[u,p,n,c]),P.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),bM())},[u,c]),P.useEffect(()=>{const A=()=>h({});return document.addEventListener(OS,A),()=>document.removeEventListener(OS,A)},[]),y.jsx(Oe.div,{...l,ref:m,style:{pointerEvents:_?R?"auto":"none":void 0,...e.style},onFocusCapture:Ce(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Ce(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Ce(e.onPointerDownCapture,C.onPointerDownCapture)})});Oc.displayName=pue;var bue="DismissableLayerBranch",yue=P.forwardRef((e,t)=>{const n=P.useContext(e3),r=P.useRef(null),o=et(t,r);return P.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),y.jsx(Oe.div,{...e,ref:o})});yue.displayName=bue;function vue(e,t=globalThis==null?void 0:globalThis.document){const n=Bn(e),r=P.useRef(!1),o=P.useRef(()=>{});return P.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){t3(gue,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function xue(e,t=globalThis==null?void 0:globalThis.document){const n=Bn(e),r=P.useRef(!1);return P.useEffect(()=>{const o=i=>{i.target&&!r.current&&t3(mue,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function bM(){const e=new CustomEvent(OS);document.dispatchEvent(e)}function t3(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?WN(o,i):o.dispatchEvent(i)}var tw,OE="HoverCard",[n3,rOe]=Vn(OE,[fs]),iy=fs(),[wue,ME]=n3(OE),r3=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:s=700,closeDelay:a=300}=e,l=iy(t),c=P.useRef(0),u=P.useRef(0),d=P.useRef(!1),p=P.useRef(!1),[h=!1,m]=wr({prop:r,defaultProp:o,onChange:i}),b=P.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>m(!0),s)},[s,m]),v=P.useCallback(()=>{clearTimeout(c.current),!d.current&&!p.current&&(u.current=window.setTimeout(()=>m(!1),a))},[a,m]),x=P.useCallback(()=>m(!1),[m]);return P.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),y.jsx(wue,{scope:t,open:h,onOpenChange:m,onOpen:b,onClose:v,onDismiss:x,hasSelectionRef:d,isPointerDownOnContentRef:p,children:y.jsx(hp,{...l,children:n})})};r3.displayName=OE;var o3="HoverCardTrigger",i3=P.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=ME(o3,n),i=iy(n);return y.jsx(Ad,{asChild:!0,...i,children:y.jsx(Oe.a,{"data-state":o.open?"open":"closed",...r,ref:t,onPointerEnter:Ce(e.onPointerEnter,Kb(o.onOpen)),onPointerLeave:Ce(e.onPointerLeave,Kb(o.onClose)),onFocus:Ce(e.onFocus,o.onOpen),onBlur:Ce(e.onBlur,o.onClose),onTouchStart:Ce(e.onTouchStart,s=>s.preventDefault())})})});i3.displayName=o3;var Sue="HoverCardPortal",[oOe,_ue]=n3(Sue,{forceMount:void 0}),Yb="HoverCardContent",s3=P.forwardRef((e,t)=>{const n=_ue(Yb,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=ME(Yb,e.__scopeHoverCard);return y.jsx(Ln,{present:r||i.open,children:y.jsx(Cue,{"data-state":i.open?"open":"closed",...o,onPointerEnter:Ce(e.onPointerEnter,Kb(i.onOpen)),onPointerLeave:Ce(e.onPointerLeave,Kb(i.onClose)),ref:t})})});s3.displayName=Yb;var Cue=P.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,...a}=e,l=ME(Yb,n),c=iy(n),u=P.useRef(null),d=et(t,u),[p,h]=P.useState(!1);return P.useEffect(()=>{if(p){const m=document.body;return tw=m.style.userSelect||m.style.webkitUserSelect,m.style.userSelect="none",m.style.webkitUserSelect="none",()=>{m.style.userSelect=tw,m.style.webkitUserSelect=tw}}},[p]),P.useEffect(()=>{if(u.current){const m=()=>{h(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var v;((v=document.getSelection())==null?void 0:v.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",m),()=>{document.removeEventListener("pointerup",m),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),P.useEffect(()=>{u.current&&Pue(u.current).forEach(b=>b.setAttribute("tabindex","-1"))}),y.jsx(Oc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:Ce(i,m=>{m.preventDefault()}),onDismiss:l.onDismiss,children:y.jsx(pp,{...c,...a,onPointerDown:Ce(a.onPointerDown,m=>{m.currentTarget.contains(m.target)&&h(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:d,style:{...a.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Eue="HoverCardArrow",Rue=P.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=iy(n);return y.jsx(gp,{...o,...r,ref:t})});Rue.displayName=Eue;function Kb(e){return t=>t.pointerType==="touch"?void 0:e()}function Pue(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var Tue=r3,kue=i3,a3=s3;const bp=Tue,yp=kue,Od=P.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>y.jsx(a3,{ref:o,align:t,sideOffset:n,className:ge("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));Od.displayName=a3.displayName;function l3({card:e}){const{setCardInfo:t}=An();return y.jsxs(bp,{openDelay:0,children:[y.jsx(yp,{children:y.jsx(cL,{className:"size-4 text-muted-foreground/40"})}),y.jsx(Od,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:y.jsx(Xi,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:y.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Double-click to add info"})})})]})}function Aue({card:e,renderFilterInfo:t}){var m,b,v,x,w,_,R,C,E,A,M,N,L,F,z,Z;be(G=>G.themeStyle);const{data:n,isLoading:r}=La(e),o=(n==null?void 0:n.records)||[],i=be(G=>G.isDashboardEditing),{getCurrency:s,getLocale:a}=P4(e),l=(b=(m=e.preferences)==null?void 0:m.formatNumber)==null?void 0:b.colorRanges,{metricKeys:c}=Yn(o||[]),u=(v=o==null?void 0:o[0])==null?void 0:v[c==null?void 0:c[0]],d=(x=o==null?void 0:o[0])==null?void 0:x[c==null?void 0:c[1]],p=(o==null?void 0:o.length)>0,h=d&&d-u!==0?(u-d)/d:null;return y.jsx("div",{className:"flex min-w-fit grow flex-col overflow-auto",children:y.jsxs("div",{className:"grow",children:[p?y.jsx("div",{className:"",children:y.jsxs("div",{className:ge("flex items-end gap-1.5",{"animate-pulse":r}),children:[y.jsx("p",{style:{color:VC(u,l)},className:"text-3xl font-semibold",children:Jo({number:u,decimalPlaces:((_=(w=e.preferences)==null?void 0:w.formatNumber)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((C=(R=e.preferences)==null?void 0:R.formatNumber)!=null&&C.suffix),customSuffix:((A=(E=e.preferences)==null?void 0:E.formatNumber)==null?void 0:A.suffix)||"",locale:a()||"",currency:s()||""})}),h&&y.jsxs("div",{className:"flex items-end gap-1",children:[y.jsx(T4,{className:"",children:h}),d&&y.jsx("div",{className:"ml-0.5 mr-1 min-w-fit text-sm font-normal text-muted-foreground",children:`from ${Jo({number:d,decimalPlaces:((N=(M=e.preferences)==null?void 0:M.formatNumber)==null?void 0:N.decimalPlaces)||0,useSuffix:!!((F=(L=e.preferences)==null?void 0:L.formatNumber)!=null&&F.suffix),customSuffix:((Z=(z=e.preferences)==null?void 0:z.formatNumber)==null?void 0:Z.suffix)||"",locale:a()||"",currency:s()||""})}`})]})]})}):y.jsx("div",{className:"flex h-9 items-center justify-center"}),y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsxs(wd,{className:"flex items-center gap-2 text-base font-medium text-muted-foreground",children:[e.title,(i||e.info)&&y.jsx(l3,{card:e})]}),t==null?void 0:t()]})]})})}var Oue="VisuallyHidden",IE=P.forwardRef((e,t)=>y.jsx(Oe.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));IE.displayName=Oue;var Mue=IE,[sy,iOe]=Vn("Tooltip",[fs]),ay=fs(),c3="TooltipProvider",Iue=700,MS="tooltip.open",[Due,DE]=sy(c3),u3=e=>{const{__scopeTooltip:t,delayDuration:n=Iue,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=P.useState(!0),l=P.useRef(!1),c=P.useRef(0);return P.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),y.jsx(Due,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:P.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:P.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:P.useCallback(u=>{l.current=u},[]),disableHoverableContent:o,children:i})};u3.displayName=c3;var ly="Tooltip",[Nue,cy]=sy(ly),d3=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=DE(ly,e.__scopeTooltip),c=ay(t),[u,d]=P.useState(null),p=Nn(),h=P.useRef(0),m=s??l.disableHoverableContent,b=a??l.delayDuration,v=P.useRef(!1),[x=!1,w]=wr({prop:r,defaultProp:o,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(MS))):l.onClose(),i==null||i(A)}}),_=P.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),R=P.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,w(!0)},[w]),C=P.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w(!1)},[w]),E=P.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,w(!0),h.current=0},b)},[b,w]);return P.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),y.jsx(hp,{...c,children:y.jsx(Nue,{scope:t,contentId:p,open:x,stateAttribute:_,trigger:u,onTriggerChange:d,onTriggerEnter:P.useCallback(()=>{l.isOpenDelayed?E():R()},[l.isOpenDelayed,E,R]),onTriggerLeave:P.useCallback(()=>{m?C():(window.clearTimeout(h.current),h.current=0)},[C,m]),onOpen:R,onClose:C,disableHoverableContent:m,children:n})})};d3.displayName=ly;var IS="TooltipTrigger",NE=P.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=cy(IS,n),i=DE(IS,n),s=ay(n),a=P.useRef(null),l=et(t,a,o.onTriggerChange),c=P.useRef(!1),u=P.useRef(!1),d=P.useCallback(()=>c.current=!1,[]);return P.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),y.jsx(Ad,{asChild:!0,...s,children:y.jsx(Oe.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:Ce(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:Ce(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:Ce(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Ce(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:Ce(e.onBlur,o.onClose),onClick:Ce(e.onClick,o.onClose)})})});NE.displayName=IS;var Lue="TooltipPortal",[sOe,Fue]=sy(Lue,{forceMount:void 0}),hd="TooltipContent",f3=P.forwardRef((e,t)=>{const n=Fue(hd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=cy(hd,e.__scopeTooltip);return y.jsx(Ln,{present:r||s.open,children:s.disableHoverableContent?y.jsx(h3,{side:o,...i,ref:t}):y.jsx(jue,{side:o,...i,ref:t})})}),jue=P.forwardRef((e,t)=>{const n=cy(hd,e.__scopeTooltip),r=DE(hd,e.__scopeTooltip),o=P.useRef(null),i=et(t,o),[s,a]=P.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,p=P.useCallback(()=>{a(null),d(!1)},[d]),h=P.useCallback((m,b)=>{const v=m.currentTarget,x={x:m.clientX,y:m.clientY},w=Hue(x,v.getBoundingClientRect()),_=Vue(x,w),R=Wue(b.getBoundingClientRect()),C=Gue([..._,...R]);a(C),d(!0)},[d]);return P.useEffect(()=>()=>p(),[p]),P.useEffect(()=>{if(l&&u){const m=v=>h(v,u),b=v=>h(v,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",b),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",b)}}},[l,u,h,p]),P.useEffect(()=>{if(s){const m=b=>{const v=b.target,x={x:b.clientX,y:b.clientY},w=(l==null?void 0:l.contains(v))||(u==null?void 0:u.contains(v)),_=!Uue(x,s);w?p():_&&(p(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,s,c,p]),y.jsx(h3,{...e,ref:i})}),[$ue,zue]=sy(ly,{isInside:!1}),h3=P.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=cy(hd,n),c=ay(n),{onClose:u}=l;return P.useEffect(()=>(document.addEventListener(MS,u),()=>document.removeEventListener(MS,u)),[u]),P.useEffect(()=>{if(l.trigger){const d=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),y.jsx(Oc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:y.jsxs(pp,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[y.jsx(sC,{children:r}),y.jsx($ue,{scope:n,isInside:!0,children:y.jsx(Mue,{id:l.contentId,role:"tooltip",children:o||r})})]})})});f3.displayName=hd;var p3="TooltipArrow",Bue=P.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=ay(n);return zue(p3,n).isInside?null:y.jsx(gp,{...o,...r,ref:t})});Bue.displayName=p3;function Hue(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Vue(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Wue(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Uue(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function Gue(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),que(t)}function que(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Yue=u3,Kue=d3,Xue=NE,g3=f3;const Que=Yue,m3=Kue,b3=Xue,LE=P.forwardRef(({className:e,sideOffset:t=4,...n},r)=>y.jsx(g3,{ref:r,sideOffset:t,className:ge("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));LE.displayName=g3.displayName;/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */const{entries:y3,setPrototypeOf:yM,isFrozen:Zue,getPrototypeOf:Jue,getOwnPropertyDescriptor:ede}=Object;let{freeze:jr,seal:oi,create:v3}=Object,{apply:DS,construct:NS}=typeof Reflect<"u"&&Reflect;jr||(jr=function(t){return t});oi||(oi=function(t){return t});DS||(DS=function(t,n,r){return t.apply(n,r)});NS||(NS=function(t,n){return new t(...n)});const bm=$r(Array.prototype.forEach),tde=$r(Array.prototype.lastIndexOf),vM=$r(Array.prototype.pop),pf=$r(Array.prototype.push),nde=$r(Array.prototype.splice),nb=$r(String.prototype.toLowerCase),nw=$r(String.prototype.toString),xM=$r(String.prototype.match),gf=$r(String.prototype.replace),rde=$r(String.prototype.indexOf),ode=$r(String.prototype.trim),hi=$r(Object.prototype.hasOwnProperty),Tr=$r(RegExp.prototype.test),mf=ide(TypeError);function $r(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return DS(e,t,r)}}function ide(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return NS(e,n)}}function _t(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nb;yM&&yM(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const i=n(o);i!==o&&(Zue(t)||(t[r]=i),o=i)}e[o]=!0}return e}function sde(e){for(let t=0;t<e.length;t++)hi(e,t)||(e[t]=null);return e}function Cl(e){const t=v3(null);for(const[n,r]of y3(e))hi(e,n)&&(Array.isArray(r)?t[n]=sde(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Cl(r):t[n]=r);return t}function bf(e,t){for(;e!==null;){const r=ede(e,t);if(r){if(r.get)return $r(r.get);if(typeof r.value=="function")return $r(r.value)}e=Jue(e)}function n(){return null}return n}const wM=jr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),rw=jr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ow=jr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),ade=jr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),iw=jr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),lde=jr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),SM=jr(["#text"]),_M=jr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),sw=jr(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),CM=jr(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ym=jr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),cde=oi(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ude=oi(/<%[\w\W]*|[\w\W]*%>/gm),dde=oi(/\$\{[\w\W]*/gm),fde=oi(/^data-[\-\w.\u00B7-\uFFFF]+$/),hde=oi(/^aria-[\-\w]+$/),x3=oi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),pde=oi(/^(?:\w+script|data):/i),gde=oi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),w3=oi(/^html$/i),mde=oi(/^[a-z][.\w]*(-[.\w]+)+$/i);var EM=Object.freeze({__proto__:null,ARIA_ATTR:hde,ATTR_WHITESPACE:gde,CUSTOM_ELEMENT:mde,DATA_ATTR:fde,DOCTYPE_NAME:w3,ERB_EXPR:ude,IS_ALLOWED_URI:x3,IS_SCRIPT_OR_DATA:pde,MUSTACHE_EXPR:cde,TMPLIT_EXPR:dde});const yf={element:1,text:3,progressingInstruction:7,comment:8,document:9},bde=function(){return typeof window>"u"?null:window},yde=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));const i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},RM=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function S3(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:bde();const t=ze=>S3(ze);if(t.version="3.2.4",t.removed=[],!e||!e.document||e.document.nodeType!==yf.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,o=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:h}=e,m=l.prototype,b=bf(m,"cloneNode"),v=bf(m,"remove"),x=bf(m,"nextSibling"),w=bf(m,"childNodes"),_=bf(m,"parentNode");if(typeof s=="function"){const ze=n.createElement("template");ze.content&&ze.content.ownerDocument&&(n=ze.content.ownerDocument)}let R,C="";const{implementation:E,createNodeIterator:A,createDocumentFragment:M,getElementsByTagName:N}=n,{importNode:L}=r;let F=RM();t.isSupported=typeof y3=="function"&&typeof _=="function"&&E&&E.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:Z,TMPLIT_EXPR:G,DATA_ATTR:j,ARIA_ATTR:H,IS_SCRIPT_OR_DATA:$,ATTR_WHITESPACE:V,CUSTOM_ELEMENT:X}=EM;let{IS_ALLOWED_URI:I}=EM,q=null;const U=_t({},[...wM,...rw,...ow,...iw,...SM]);let O=null;const J=_t({},[..._M,...sw,...CM,...ym]);let K=Object.seal(v3(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ne=null,Y=null,ee=!0,re=!0,ue=!1,fe=!0,se=!1,pe=!0,ce=!1,_e=!1,Pe=!1,Me=!1,ke=!1,Ne=!1,tt=!0,ot=!1;const gn="user-content-";let xt=!0,Wn=!1,Rt={},de=null;const Se=_t({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let je=null;const Be=_t({},["audio","video","img","source","image","track"]);let it=null;const On=_t({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Fn="http://www.w3.org/1998/Math/MathML",vn="http://www.w3.org/2000/svg",en="http://www.w3.org/1999/xhtml";let jn=en,Kt=!1,sr=null;const _r=_t({},[Fn,vn,en],nw);let ps=_t({},["mi","mo","mn","ms","mtext"]),gs=_t({},["annotation-xml"]);const Nc=_t({},["title","style","font","a","script"]);let Lo=null;const Fo=["application/xhtml+xml","text/html"],jd="text/html";let Le=null,wt=null;const Wt=n.createElement("form"),ar=function(oe){return oe instanceof RegExp||oe instanceof Function},Zn=function(){let oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(wt&&wt===oe)){if((!oe||typeof oe!="object")&&(oe={}),oe=Cl(oe),Lo=Fo.indexOf(oe.PARSER_MEDIA_TYPE)===-1?jd:oe.PARSER_MEDIA_TYPE,Le=Lo==="application/xhtml+xml"?nw:nb,q=hi(oe,"ALLOWED_TAGS")?_t({},oe.ALLOWED_TAGS,Le):U,O=hi(oe,"ALLOWED_ATTR")?_t({},oe.ALLOWED_ATTR,Le):J,sr=hi(oe,"ALLOWED_NAMESPACES")?_t({},oe.ALLOWED_NAMESPACES,nw):_r,it=hi(oe,"ADD_URI_SAFE_ATTR")?_t(Cl(On),oe.ADD_URI_SAFE_ATTR,Le):On,je=hi(oe,"ADD_DATA_URI_TAGS")?_t(Cl(Be),oe.ADD_DATA_URI_TAGS,Le):Be,de=hi(oe,"FORBID_CONTENTS")?_t({},oe.FORBID_CONTENTS,Le):Se,ne=hi(oe,"FORBID_TAGS")?_t({},oe.FORBID_TAGS,Le):{},Y=hi(oe,"FORBID_ATTR")?_t({},oe.FORBID_ATTR,Le):{},Rt=hi(oe,"USE_PROFILES")?oe.USE_PROFILES:!1,ee=oe.ALLOW_ARIA_ATTR!==!1,re=oe.ALLOW_DATA_ATTR!==!1,ue=oe.ALLOW_UNKNOWN_PROTOCOLS||!1,fe=oe.ALLOW_SELF_CLOSE_IN_ATTR!==!1,se=oe.SAFE_FOR_TEMPLATES||!1,pe=oe.SAFE_FOR_XML!==!1,ce=oe.WHOLE_DOCUMENT||!1,Me=oe.RETURN_DOM||!1,ke=oe.RETURN_DOM_FRAGMENT||!1,Ne=oe.RETURN_TRUSTED_TYPE||!1,Pe=oe.FORCE_BODY||!1,tt=oe.SANITIZE_DOM!==!1,ot=oe.SANITIZE_NAMED_PROPS||!1,xt=oe.KEEP_CONTENT!==!1,Wn=oe.IN_PLACE||!1,I=oe.ALLOWED_URI_REGEXP||x3,jn=oe.NAMESPACE||en,ps=oe.MATHML_TEXT_INTEGRATION_POINTS||ps,gs=oe.HTML_INTEGRATION_POINTS||gs,K=oe.CUSTOM_ELEMENT_HANDLING||{},oe.CUSTOM_ELEMENT_HANDLING&&ar(oe.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(K.tagNameCheck=oe.CUSTOM_ELEMENT_HANDLING.tagNameCheck),oe.CUSTOM_ELEMENT_HANDLING&&ar(oe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(K.attributeNameCheck=oe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),oe.CUSTOM_ELEMENT_HANDLING&&typeof oe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(K.allowCustomizedBuiltInElements=oe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),se&&(re=!1),ke&&(Me=!0),Rt&&(q=_t({},SM),O=[],Rt.html===!0&&(_t(q,wM),_t(O,_M)),Rt.svg===!0&&(_t(q,rw),_t(O,sw),_t(O,ym)),Rt.svgFilters===!0&&(_t(q,ow),_t(O,sw),_t(O,ym)),Rt.mathMl===!0&&(_t(q,iw),_t(O,CM),_t(O,ym))),oe.ADD_TAGS&&(q===U&&(q=Cl(q)),_t(q,oe.ADD_TAGS,Le)),oe.ADD_ATTR&&(O===J&&(O=Cl(O)),_t(O,oe.ADD_ATTR,Le)),oe.ADD_URI_SAFE_ATTR&&_t(it,oe.ADD_URI_SAFE_ATTR,Le),oe.FORBID_CONTENTS&&(de===Se&&(de=Cl(de)),_t(de,oe.FORBID_CONTENTS,Le)),xt&&(q["#text"]=!0),ce&&_t(q,["html","head","body"]),q.table&&(_t(q,["tbody"]),delete ne.tbody),oe.TRUSTED_TYPES_POLICY){if(typeof oe.TRUSTED_TYPES_POLICY.createHTML!="function")throw mf('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof oe.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw mf('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');R=oe.TRUSTED_TYPES_POLICY,C=R.createHTML("")}else R===void 0&&(R=yde(h,o)),R!==null&&typeof C=="string"&&(C=R.createHTML(""));jr&&jr(oe),wt=oe}},ho=_t({},[...rw,...ow,...ade]),Br=_t({},[...iw,...lde]),Cr=function(oe){let Ee=_(oe);(!Ee||!Ee.tagName)&&(Ee={namespaceURI:jn,tagName:"template"});const Fe=nb(oe.tagName),Ut=nb(Ee.tagName);return sr[oe.namespaceURI]?oe.namespaceURI===vn?Ee.namespaceURI===en?Fe==="svg":Ee.namespaceURI===Fn?Fe==="svg"&&(Ut==="annotation-xml"||ps[Ut]):!!ho[Fe]:oe.namespaceURI===Fn?Ee.namespaceURI===en?Fe==="math":Ee.namespaceURI===vn?Fe==="math"&&gs[Ut]:!!Br[Fe]:oe.namespaceURI===en?Ee.namespaceURI===vn&&!gs[Ut]||Ee.namespaceURI===Fn&&!ps[Ut]?!1:!Br[Fe]&&(Nc[Fe]||!ho[Fe]):!!(Lo==="application/xhtml+xml"&&sr[oe.namespaceURI]):!1},mn=function(oe){pf(t.removed,{element:oe});try{_(oe).removeChild(oe)}catch{v(oe)}},Lc=function(oe,Ee){try{pf(t.removed,{attribute:Ee.getAttributeNode(oe),from:Ee})}catch{pf(t.removed,{attribute:null,from:Ee})}if(Ee.removeAttribute(oe),oe==="is")if(Me||ke)try{mn(Ee)}catch{}else try{Ee.setAttribute(oe,"")}catch{}},Bp=function(oe){let Ee=null,Fe=null;if(Pe)oe="<remove></remove>"+oe;else{const xn=xM(oe,/^[\r\n\t ]+/);Fe=xn&&xn[0]}Lo==="application/xhtml+xml"&&jn===en&&(oe='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+oe+"</body></html>");const Ut=R?R.createHTML(oe):oe;if(jn===en)try{Ee=new p().parseFromString(Ut,Lo)}catch{}if(!Ee||!Ee.documentElement){Ee=E.createDocument(jn,"template",null);try{Ee.documentElement.innerHTML=Kt?C:Ut}catch{}}const Un=Ee.body||Ee.documentElement;return oe&&Fe&&Un.insertBefore(n.createTextNode(Fe),Un.childNodes[0]||null),jn===en?N.call(Ee,ce?"html":"body")[0]:ce?Ee.documentElement:Un},Hp=function(oe){return A.call(oe.ownerDocument||oe,oe,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},$d=function(oe){return oe instanceof d&&(typeof oe.nodeName!="string"||typeof oe.textContent!="string"||typeof oe.removeChild!="function"||!(oe.attributes instanceof u)||typeof oe.removeAttribute!="function"||typeof oe.setAttribute!="function"||typeof oe.namespaceURI!="string"||typeof oe.insertBefore!="function"||typeof oe.hasChildNodes!="function")},Vp=function(oe){return typeof a=="function"&&oe instanceof a};function si(ze,oe,Ee){bm(ze,Fe=>{Fe.call(t,oe,Ee,wt)})}const Wp=function(oe){let Ee=null;if(si(F.beforeSanitizeElements,oe,null),$d(oe))return mn(oe),!0;const Fe=Le(oe.nodeName);if(si(F.uponSanitizeElement,oe,{tagName:Fe,allowedTags:q}),oe.hasChildNodes()&&!Vp(oe.firstElementChild)&&Tr(/<[/\w]/g,oe.innerHTML)&&Tr(/<[/\w]/g,oe.textContent)||oe.nodeType===yf.progressingInstruction||pe&&oe.nodeType===yf.comment&&Tr(/<[/\w]/g,oe.data))return mn(oe),!0;if(!q[Fe]||ne[Fe]){if(!ne[Fe]&&zd(Fe)&&(K.tagNameCheck instanceof RegExp&&Tr(K.tagNameCheck,Fe)||K.tagNameCheck instanceof Function&&K.tagNameCheck(Fe)))return!1;if(xt&&!de[Fe]){const Ut=_(oe)||oe.parentNode,Un=w(oe)||oe.childNodes;if(Un&&Ut){const xn=Un.length;for(let lr=xn-1;lr>=0;--lr){const jo=b(Un[lr],!0);jo.__removalCount=(oe.__removalCount||0)+1,Ut.insertBefore(jo,x(oe))}}}return mn(oe),!0}return oe instanceof l&&!Cr(oe)||(Fe==="noscript"||Fe==="noembed"||Fe==="noframes")&&Tr(/<\/no(script|embed|frames)/i,oe.innerHTML)?(mn(oe),!0):(se&&oe.nodeType===yf.text&&(Ee=oe.textContent,bm([z,Z,G],Ut=>{Ee=gf(Ee,Ut," ")}),oe.textContent!==Ee&&(pf(t.removed,{element:oe.cloneNode()}),oe.textContent=Ee)),si(F.afterSanitizeElements,oe,null),!1)},Up=function(oe,Ee,Fe){if(tt&&(Ee==="id"||Ee==="name")&&(Fe in n||Fe in Wt))return!1;if(!(re&&!Y[Ee]&&Tr(j,Ee))){if(!(ee&&Tr(H,Ee))){if(!O[Ee]||Y[Ee]){if(!(zd(oe)&&(K.tagNameCheck instanceof RegExp&&Tr(K.tagNameCheck,oe)||K.tagNameCheck instanceof Function&&K.tagNameCheck(oe))&&(K.attributeNameCheck instanceof RegExp&&Tr(K.attributeNameCheck,Ee)||K.attributeNameCheck instanceof Function&&K.attributeNameCheck(Ee))||Ee==="is"&&K.allowCustomizedBuiltInElements&&(K.tagNameCheck instanceof RegExp&&Tr(K.tagNameCheck,Fe)||K.tagNameCheck instanceof Function&&K.tagNameCheck(Fe))))return!1}else if(!it[Ee]){if(!Tr(I,gf(Fe,V,""))){if(!((Ee==="src"||Ee==="xlink:href"||Ee==="href")&&oe!=="script"&&rde(Fe,"data:")===0&&je[oe])){if(!(ue&&!Tr($,gf(Fe,V,"")))){if(Fe)return!1}}}}}}return!0},zd=function(oe){return oe!=="annotation-xml"&&xM(oe,X)},Gp=function(oe){si(F.beforeSanitizeAttributes,oe,null);const{attributes:Ee}=oe;if(!Ee||$d(oe))return;const Fe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:O,forceKeepAttr:void 0};let Ut=Ee.length;for(;Ut--;){const Un=Ee[Ut],{name:xn,namespaceURI:lr,value:jo}=Un,nl=Le(xn);let Gn=xn==="value"?jo:ode(jo);if(Fe.attrName=nl,Fe.attrValue=Gn,Fe.keepAttr=!0,Fe.forceKeepAttr=void 0,si(F.uponSanitizeAttribute,oe,Fe),Gn=Fe.attrValue,ot&&(nl==="id"||nl==="name")&&(Lc(xn,oe),Gn=gn+Gn),pe&&Tr(/((--!?|])>)|<\/(style|title)/i,Gn)){Lc(xn,oe);continue}if(Fe.forceKeepAttr||(Lc(xn,oe),!Fe.keepAttr))continue;if(!fe&&Tr(/\/>/i,Gn)){Lc(xn,oe);continue}se&&bm([z,Z,G],Hd=>{Gn=gf(Gn,Hd," ")});const Bd=Le(oe.nodeName);if(Up(Bd,nl,Gn)){if(R&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!lr)switch(h.getAttributeType(Bd,nl)){case"TrustedHTML":{Gn=R.createHTML(Gn);break}case"TrustedScriptURL":{Gn=R.createScriptURL(Gn);break}}try{lr?oe.setAttributeNS(lr,xn,Gn):oe.setAttribute(xn,Gn),$d(oe)?mn(oe):vM(t.removed)}catch{}}}si(F.afterSanitizeAttributes,oe,null)},Qy=function ze(oe){let Ee=null;const Fe=Hp(oe);for(si(F.beforeSanitizeShadowDOM,oe,null);Ee=Fe.nextNode();)si(F.uponSanitizeShadowNode,Ee,null),Wp(Ee),Gp(Ee),Ee.content instanceof i&&ze(Ee.content);si(F.afterSanitizeShadowDOM,oe,null)};return t.sanitize=function(ze){let oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ee=null,Fe=null,Ut=null,Un=null;if(Kt=!ze,Kt&&(ze="<!-->"),typeof ze!="string"&&!Vp(ze))if(typeof ze.toString=="function"){if(ze=ze.toString(),typeof ze!="string")throw mf("dirty is not a string, aborting")}else throw mf("toString is not a function");if(!t.isSupported)return ze;if(_e||Zn(oe),t.removed=[],typeof ze=="string"&&(Wn=!1),Wn){if(ze.nodeName){const jo=Le(ze.nodeName);if(!q[jo]||ne[jo])throw mf("root node is forbidden and cannot be sanitized in-place")}}else if(ze instanceof a)Ee=Bp("<!---->"),Fe=Ee.ownerDocument.importNode(ze,!0),Fe.nodeType===yf.element&&Fe.nodeName==="BODY"||Fe.nodeName==="HTML"?Ee=Fe:Ee.appendChild(Fe);else{if(!Me&&!se&&!ce&&ze.indexOf("<")===-1)return R&&Ne?R.createHTML(ze):ze;if(Ee=Bp(ze),!Ee)return Me?null:Ne?C:""}Ee&&Pe&&mn(Ee.firstChild);const xn=Hp(Wn?ze:Ee);for(;Ut=xn.nextNode();)Wp(Ut),Gp(Ut),Ut.content instanceof i&&Qy(Ut.content);if(Wn)return ze;if(Me){if(ke)for(Un=M.call(Ee.ownerDocument);Ee.firstChild;)Un.appendChild(Ee.firstChild);else Un=Ee;return(O.shadowroot||O.shadowrootmode)&&(Un=L.call(r,Un,!0)),Un}let lr=ce?Ee.outerHTML:Ee.innerHTML;return ce&&q["!doctype"]&&Ee.ownerDocument&&Ee.ownerDocument.doctype&&Ee.ownerDocument.doctype.name&&Tr(w3,Ee.ownerDocument.doctype.name)&&(lr="<!DOCTYPE "+Ee.ownerDocument.doctype.name+`>
|
|
287
|
+
`+lr),se&&bm([z,Z,G],jo=>{lr=gf(lr,jo," ")}),R&&Ne?R.createHTML(lr):lr},t.setConfig=function(){let ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zn(ze),_e=!0},t.clearConfig=function(){wt=null,_e=!1},t.isValidAttribute=function(ze,oe,Ee){wt||Zn({});const Fe=Le(ze),Ut=Le(oe);return Up(Fe,Ut,Ee)},t.addHook=function(ze,oe){typeof oe=="function"&&pf(F[ze],oe)},t.removeHook=function(ze,oe){if(oe!==void 0){const Ee=tde(F[ze],oe);return Ee===-1?void 0:nde(F[ze],Ee,1)[0]}return vM(F[ze])},t.removeHooks=function(ze){F[ze]=[]},t.removeAllHooks=function(){F=RM()},t}var LS=S3();function Xb({card:e,isLoading:t,data:n}){var p,h;const r=n||[],{keys:o}=Yn(r),i=be(m=>m.selectedSheetId),s=be(m=>m.isVisualEditing),a=(h=(p=e==null?void 0:e.preferences)==null?void 0:p.textVisualOptions)==null?void 0:h.isDynamicText,{setCardDescription:l}=An(),{setCard:c}=ap();function u(){var x;if(t)return y.jsxs("div",{className:"space-y-2",children:[y.jsx(_u,{className:"h-3 w-full animate-pulse bg-muted"}),y.jsx(_u,{className:"h-3 w-3/4 animate-pulse bg-muted"}),y.jsx(_u,{className:"h-3 w-1/2 animate-pulse bg-muted"})]});const m=(x=r==null?void 0:r[0])==null?void 0:x[o[0]],b=LS.sanitize(m),v=y.jsx("div",{dangerouslySetInnerHTML:{__html:b}});return y.jsx("div",{className:"text-sm text-foreground/80 hover:cursor-text",onMouseDown:w=>w.stopPropagation(),children:v})}function d(){return y.jsx("div",{onMouseDown:m=>m.stopPropagation(),children:y.jsx(Xi,{type:"textarea",className:"w-full rounded-md bg-muted",text:(e==null?void 0:e.description)||"Double click to add description",onSave:m=>{s===!1&&l(i,e.id,m),s===!0&&c({...e,description:m})},children:y.jsx("div",{className:"text-sm text-foreground/70 hover:cursor-text",dangerouslySetInnerHTML:{__html:LS.sanitize((e==null?void 0:e.description)||(s?"Edit Description":"")||"")}})})})}return y.jsxs(y.Fragment,{children:[!a&&d(),a===!0&&u()]})}const PM=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,TM=Yu,FE=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return TM(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],d=i==null?void 0:i[c];if(u===null)return null;const p=PM(u)||PM(d);return o[c][p]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,p]=u;return p===void 0||(c[d]=p),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:p,...h}=u;return Object.entries(h).every(m=>{let[b,v]=m;return Array.isArray(v)?v.includes({...i,...a}[b]):{...i,...a}[b]===v})?[...c,d,p]:c},[]);return TM(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},Ih=FE("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Hn=P.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?Gs:"button";return y.jsx(s,{className:ge(Ih({variant:t,size:n,className:e})),ref:i,...o})});Hn.displayName="Button";var vde="Separator",kM="horizontal",xde=["horizontal","vertical"],_3=P.forwardRef((e,t)=>{const{decorative:n,orientation:r=kM,...o}=e,i=wde(r)?r:kM,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return y.jsx(Oe.div,{"data-orientation":i,...a,...o,ref:t})});_3.displayName=vde;function wde(e){return xde.includes(e)}var C3=_3;const uy=P.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>y.jsx(C3,{ref:o,decorative:n,orientation:t,className:ge("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));uy.displayName=C3.displayName;function Sde(){var b,v;const e=be(x=>x.themeStyle),t=be(x=>x.filterValues),n=be(x=>x.dashboard.filters),r=be(x=>x.filteringCards),o=be(x=>x.selectedSheetId),{removeFilterValues:i,removeFilteringCard:s,setFilterValues:a,setFilteringCards:l}=An(),c=n==null?void 0:n.filter(x=>x.sheetId===o||!x.sheetId),u=t==null?void 0:t.filter(x=>(c==null?void 0:c.some(w=>w.id===x.filterId))||x.filterId.endsWith(o));if(!u||u.length===0)return null;const d=u.map(x=>{const w=n==null?void 0:n.find(_=>_.id===x.filterId);return{filterId:x.filterId,name:(w==null?void 0:w.title)||x.name,values:x.values}});function p(x){return x instanceof Date?x.toLocaleDateString():x}function h(x){const w=r==null?void 0:r.find(_=>x.filterId.startsWith(_.id));w&&s(w),i(x.filterId)}function m(x){var w,_;return y.jsxs("div",{className:"space-y-2",children:[y.jsxs("div",{style:{borderRadius:(_=(w=e==null?void 0:e.chart)==null?void 0:w.options)==null?void 0:_.borderRadius},className:"flex w-fit items-center gap-2 bg-muted-foreground px-2 py-1 font-semibold text-muted",children:[y.jsx("span",{className:"break-words",children:x.name}),y.jsx(kc,{onClick:()=>h(x),className:"size-3 text-muted hover:cursor-pointer hover:text-background"})]}),y.jsx("div",{className:"flex flex-wrap gap-1",children:x.values.map(R=>{var C,E;return y.jsx("span",{style:{borderRadius:(E=(C=e==null?void 0:e.chart)==null?void 0:C.options)==null?void 0:E.borderRadius},className:"inline-block",children:p(R)},R==null?void 0:R.toString())})})]})}return y.jsxs(bp,{openDelay:100,children:[y.jsx(yp,{children:y.jsx(sL,{className:"z-100 size-3.5 text-muted-foreground/40"})}),y.jsxs(Od,{style:{borderRadius:(v=(b=e==null?void 0:e.chart)==null?void 0:b.options)==null?void 0:v.borderRadius},className:"relative flex min-h-fit w-[300px] flex-col px-0 text-xs",align:"start",children:[y.jsx(BC,{onClick:()=>{l([]),a([])},className:"absolute right-4 size-3.5 text-muted-foreground/40 hover:cursor-pointer"}),y.jsx("div",{className:"h-fit max-h-[150px] min-h-0 grow overflow-auto",children:d==null?void 0:d.map(x=>y.jsxs("div",{className:"px-5",children:[m(x),y.jsx(uy,{className:"my-2"})]},x.name))})]})]})}const _de=P.forwardRef(({className:e,containerClassName:t,containerStyle:n,...r},o)=>y.jsx("div",{style:n,className:ge("relative w-full overflow-auto",t),children:y.jsx("table",{ref:o,className:ge("w-full caption-bottom text-sm",e),...r})}));_de.displayName="Table";const jE=P.forwardRef(({className:e,...t},n)=>y.jsx("thead",{ref:n,className:ge("[&_tr]:border-b",e),...t}));jE.displayName="TableHeader";const $E=P.forwardRef(({className:e,...t},n)=>y.jsx("tbody",{ref:n,className:ge("[&_tr:last-child]:border-0",e),...t}));$E.displayName="TableBody";const Cde=P.forwardRef(({className:e,...t},n)=>y.jsx("tfoot",{ref:n,className:ge("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Cde.displayName="TableFooter";const oh=P.forwardRef(({className:e,...t},n)=>y.jsx("tr",{ref:n,className:ge("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));oh.displayName="TableRow";const zE=P.forwardRef(({className:e,...t},n)=>y.jsx("th",{ref:n,className:ge("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));zE.displayName="TableHead";const BE=P.forwardRef(({className:e,...t},n)=>y.jsx("td",{ref:n,className:ge("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));BE.displayName="TableCell";const Ede=P.forwardRef(({className:e,...t},n)=>y.jsx("caption",{ref:n,className:ge("mt-4 text-sm text-muted-foreground",e),...t}));Ede.displayName="TableCaption";/**
|
|
288
|
+
* table-core
|
|
289
|
+
*
|
|
290
|
+
* Copyright (c) TanStack
|
|
291
|
+
*
|
|
292
|
+
* This source code is licensed under the MIT license found in the
|
|
293
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
294
|
+
*
|
|
295
|
+
* @license MIT
|
|
296
|
+
*/function ka(e,t){return typeof e=="function"?e(t):e}function Io(e,t){return n=>{t.setState(r=>({...r,[e]:ka(n,r[e])}))}}function dy(e){return e instanceof Function}function Rde(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Pde(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function Ge(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((u,d)=>r[d]!==u)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-s)*100)/100,d=Math.round((Date.now()-c)*100)/100,p=d/16,h=(m,b)=>{for(m=String(m);m.length<b;)m=" "+m;return m};console.info(`%c⏱ ${h(d,5)} /${h(u,5)} ms`,`
|
|
297
|
+
font-size: .6rem;
|
|
298
|
+
font-weight: bold;
|
|
299
|
+
color: hsl(${Math.max(0,Math.min(120-120*p,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function qe(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function Tde(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:Ge(()=>[e,n,t,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),qe(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function kde(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=p=>{let h=p;for(const b of l.split(".")){var m;h=(m=h)==null?void 0:m[b],process.env.NODE_ENV!=="production"&&h===void 0&&console.warn(`"${b}" in deeply nested key "${l}" returned undefined.`)}return h}:u=p=>p[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let d={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:Ge(()=>[!0],()=>{var p;return[d,...(p=d.columns)==null?void 0:p.flatMap(h=>h.getFlatColumns())]},qe(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:Ge(()=>[e._getOrderColumnsFn()],p=>{var h;if((h=d.columns)!=null&&h.length){let m=d.columns.flatMap(b=>b.getLeafColumns());return p(m)}return[d]},qe(e.options,"debugColumns","column.getLeafColumns"))};for(const p of e._features)p.createColumn==null||p.createColumn(d,e);return d}const fr="debugHeaders";function AM(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const Ade={createTable:e=>{e.getHeaderGroups=Ge(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r==null?void 0:r.map(d=>n.find(p=>p.id===d)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(d=>n.find(p=>p.id===d)).filter(Boolean))!=null?s:[],c=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(o!=null&&o.includes(d.id)));return vm(t,[...a,...c,...l],e)},qe(e.options,fr,"getHeaderGroups")),e.getCenterHeaderGroups=Ge(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),vm(t,n,e,"center")),qe(e.options,fr,"getCenterHeaderGroups")),e.getLeftHeaderGroups=Ge(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return vm(t,i,e,"left")},qe(e.options,fr,"getLeftHeaderGroups")),e.getRightHeaderGroups=Ge(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return vm(t,i,e,"right")},qe(e.options,fr,"getRightHeaderGroups")),e.getFooterGroups=Ge(()=>[e.getHeaderGroups()],t=>[...t].reverse(),qe(e.options,fr,"getFooterGroups")),e.getLeftFooterGroups=Ge(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),qe(e.options,fr,"getLeftFooterGroups")),e.getCenterFooterGroups=Ge(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),qe(e.options,fr,"getCenterFooterGroups")),e.getRightFooterGroups=Ge(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),qe(e.options,fr,"getRightFooterGroups")),e.getFlatHeaders=Ge(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),qe(e.options,fr,"getFlatHeaders")),e.getLeftFlatHeaders=Ge(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),qe(e.options,fr,"getLeftFlatHeaders")),e.getCenterFlatHeaders=Ge(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),qe(e.options,fr,"getCenterFlatHeaders")),e.getRightFlatHeaders=Ge(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),qe(e.options,fr,"getRightFlatHeaders")),e.getCenterLeafHeaders=Ge(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),qe(e.options,fr,"getCenterLeafHeaders")),e.getLeftLeafHeaders=Ge(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),qe(e.options,fr,"getLeftLeafHeaders")),e.getRightLeafHeaders=Ge(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),qe(e.options,fr,"getRightLeafHeaders")),e.getLeafHeaders=Ge(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},qe(e.options,fr,"getLeafHeaders"))}};function vm(e,t,n,r){var o,i;let s=0;const a=function(p,h){h===void 0&&(h=1),s=Math.max(s,h),p.filter(m=>m.getIsVisible()).forEach(m=>{var b;(b=m.columns)!=null&&b.length&&a(m.columns,h+1)},0)};a(e);let l=[];const c=(p,h)=>{const m={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},b=[];p.forEach(v=>{const x=[...b].reverse()[0],w=v.column.depth===m.depth;let _,R=!1;if(w&&v.column.parent?_=v.column.parent:(_=v.column,R=!0),x&&(x==null?void 0:x.column)===_)x.subHeaders.push(v);else{const C=AM(n,_,{id:[r,h,_.id,v==null?void 0:v.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${b.filter(E=>E.column===_).length}`:void 0,depth:h,index:b.length});C.subHeaders.push(v),b.push(C)}m.headers.push(v),v.headerGroup=m}),l.push(m),h>0&&c(b,h-1)},u=t.map((p,h)=>AM(n,p,{depth:s,index:h}));c(u,s-1),l.reverse();const d=p=>p.filter(m=>m.column.getIsVisible()).map(m=>{let b=0,v=0,x=[0];m.subHeaders&&m.subHeaders.length?(x=[],d(m.subHeaders).forEach(_=>{let{colSpan:R,rowSpan:C}=_;b+=R,x.push(C)})):b=1;const w=Math.min(...x);return v=v+w,m.colSpan=b,m.rowSpan=v,{colSpan:b,rowSpan:v}});return d((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const Ode=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Pde(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:Ge(()=>[e.getAllLeafColumns()],l=>l.map(c=>Tde(e,a,c,c.id)),qe(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:Ge(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),qe(e.options,"debugRows","getAllCellsByColumnId"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a},Mde={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},E3=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};E3.autoRemove=e=>wi(e);const R3=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};R3.autoRemove=e=>wi(e);const P3=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};P3.autoRemove=e=>wi(e);const T3=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};T3.autoRemove=e=>wi(e);const k3=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});k3.autoRemove=e=>wi(e)||!(e!=null&&e.length);const A3=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});A3.autoRemove=e=>wi(e)||!(e!=null&&e.length);const O3=(e,t,n)=>e.getValue(t)===n;O3.autoRemove=e=>wi(e);const M3=(e,t,n)=>e.getValue(t)==n;M3.autoRemove=e=>wi(e);const HE=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};HE.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};HE.autoRemove=e=>wi(e)||wi(e[0])&&wi(e[1]);const Ms={includesString:E3,includesStringSensitive:R3,equalsString:P3,arrIncludes:T3,arrIncludesAll:k3,arrIncludesSome:A3,equals:O3,weakEquals:M3,inNumberRange:HE};function wi(e){return e==null||e===""}const Ide={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Io("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?Ms.includesString:typeof r=="number"?Ms.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Ms.equals:Array.isArray(r)?Ms.arrIncludes:Ms.weakEquals},e.getFilterFn=()=>{var n,r;return dy(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Ms[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r==null?void 0:r.find(u=>u.id===e.id),s=ka(n,i?i.value:void 0);if(OM(o,s,e)){var a;return(a=r==null?void 0:r.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var c;return(c=r==null?void 0:r.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=ka(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(OM(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function OM(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Dde=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),Nde=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},Lde=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},Fde=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},jde=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},$de=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!Rde(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},zde=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),Bde=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,Hde=(e,t)=>t.length,aw={sum:Dde,min:Nde,max:Lde,extent:Fde,mean:jde,median:$de,unique:zde,uniqueCount:Bde,count:Hde},Vde={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Io("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return aw.sum;if(Object.prototype.toString.call(r)==="[object Date]")return aw.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return dy(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:aw[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function Wde(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const Ude={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Io("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Ge(n=>[ih(t,n)],n=>n.findIndex(r=>r.id===e.id),qe(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=ih(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=ih(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Ge(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return Wde(i,n,r)},qe(e.options,"debugTable","_getOrderColumnsFn"))}},lw=()=>({left:[],right:[]}),Gde={getInitialState:e=>({columnPinning:lw(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Io("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(d=>!(r!=null&&r.includes(d))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((u=o==null?void 0:o.right)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(d=>!(r!=null&&r.includes(d))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Ge(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},qe(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=Ge(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),qe(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=Ge(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),qe(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?lw():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:lw())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Ge(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),qe(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=Ge(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),qe(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=Ge(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},qe(e.options,"debugColumns","getCenterLeafColumns"))}},xm={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},cw=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),qde={getDefaultColumnDef:()=>xm,getInitialState:e=>({columnSizing:{},columnSizingInfo:cw(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Io("columnSizing",e),onColumnSizingInfoChange:Io("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:xm.minSize,(r=i??e.columnDef.size)!=null?r:xm.size),(o=e.columnDef.maxSize)!=null?o:xm.maxSize)},e.getStart=Ge(n=>[n,ih(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),qe(t.options,"debugColumns","getStart")),e.getAfter=Ge(n=>[n,ih(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),qe(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),uw(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(x=>[x.column.id,x.column.getSize()]):[[r.id,r.getSize()]],l=uw(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(x,w)=>{typeof w=="number"&&(t.setColumnSizingInfo(_=>{var R,C;const E=t.options.columnResizeDirection==="rtl"?-1:1,A=(w-((R=_==null?void 0:_.startOffset)!=null?R:0))*E,M=Math.max(A/((C=_==null?void 0:_.startSize)!=null?C:0),-.999999);return _.columnSizingStart.forEach(N=>{let[L,F]=N;c[L]=Math.round(Math.max(F+F*M,0)*100)/100}),{..._,deltaOffset:A,deltaPercentage:M}}),(t.options.columnResizeMode==="onChange"||x==="end")&&t.setColumnSizing(_=>({..._,...c})))},d=x=>u("move",x),p=x=>{u("end",x),t.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||typeof document<"u"?document:null,m={moveHandler:x=>d(x.clientX),upHandler:x=>{h==null||h.removeEventListener("mousemove",m.moveHandler),h==null||h.removeEventListener("mouseup",m.upHandler),p(x.clientX)}},b={moveHandler:x=>(x.cancelable&&(x.preventDefault(),x.stopPropagation()),d(x.touches[0].clientX),!1),upHandler:x=>{var w;h==null||h.removeEventListener("touchmove",b.moveHandler),h==null||h.removeEventListener("touchend",b.upHandler),x.cancelable&&(x.preventDefault(),x.stopPropagation()),p((w=x.touches[0])==null?void 0:w.clientX)}},v=Yde()?{passive:!1}:!1;uw(i)?(h==null||h.addEventListener("touchmove",b.moveHandler,v),h==null||h.addEventListener("touchend",b.upHandler,v)):(h==null||h.addEventListener("mousemove",m.moveHandler,v),h==null||h.addEventListener("mouseup",m.upHandler,v)),t.setColumnSizingInfo(x=>({...x,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?cw():(n=e.initialState.columnSizingInfo)!=null?n:cw())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let wm=null;function Yde(){if(typeof wm=="boolean")return wm;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return wm=e,wm}function uw(e){return e.type==="touchstart"}const Kde={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Io("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Ge(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),qe(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=Ge(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],qe(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>Ge(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),qe(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function ih(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Xde={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Qde={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Io("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Ms.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return dy(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Ms[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Zde={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Io("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},FS=0,jS=10,dw=()=>({pageIndex:FS,pageSize:jS}),Jde={getInitialState:e=>({...e,pagination:{...dw(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Io("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>ka(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?dw():(o=e.initialState.pagination)!=null?o:dw())},e.setPageIndex=r=>{e.setPagination(o=>{let i=ka(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?FS:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:FS)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?jS:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:jS)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,ka(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=ka(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=Ge(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},qe(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},fw=()=>({top:[],bottom:[]}),efe={getInitialState:e=>({rowPinning:fw(),...e}),getDefaultOptions:e=>({onRowPinningChange:Io("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var d,p;return{top:((d=l==null?void 0:l.top)!=null?d:[]).filter(b=>!(a!=null&&a.has(b))),bottom:[...((p=l==null?void 0:l.bottom)!=null?p:[]).filter(b=>!(a!=null&&a.has(b))),...Array.from(a)]}}if(n==="top"){var h,m;return{top:[...((h=l==null?void 0:l.top)!=null?h:[]).filter(b=>!(a!=null&&a.has(b))),...Array.from(a)],bottom:((m=l==null?void 0:l.bottom)!=null?m:[]).filter(b=>!(a!=null&&a.has(b)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(b=>!(a!=null&&a.has(b))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(b=>!(a!=null&&a.has(b)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i==null?void 0:i.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?fw():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:fw())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=Ge(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),qe(e.options,"debugRows","getTopRows")),e.getBottomRows=Ge(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),qe(e.options,"debugRows","getBottomRows")),e.getCenterRows=Ge(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},qe(e.options,"debugRows","getCenterRows"))}},tfe={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Io("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{$S(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Ge(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?hw(e,n):{rows:[],flatRows:[],rowsById:{}},qe(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=Ge(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?hw(e,n):{rows:[],flatRows:[],rowsById:{}},qe(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=Ge(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?hw(e,n):{rows:[],flatRows:[],rowsById:{}},qe(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return $S(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return VE(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return zS(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return zS(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},$S=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>$S(e,a.id,n,r,o))};function hw(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=VE(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function VE(e,t){var n;return(n=t[e.id])!=null?n:!1}function zS(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(VE(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=zS(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const BS=/([0-9]+)/gm,nfe=(e,t,n)=>I3(Wa(e.getValue(n)).toLowerCase(),Wa(t.getValue(n)).toLowerCase()),rfe=(e,t,n)=>I3(Wa(e.getValue(n)),Wa(t.getValue(n))),ofe=(e,t,n)=>WE(Wa(e.getValue(n)).toLowerCase(),Wa(t.getValue(n)).toLowerCase()),ife=(e,t,n)=>WE(Wa(e.getValue(n)),Wa(t.getValue(n))),sfe=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},afe=(e,t,n)=>WE(e.getValue(n),t.getValue(n));function WE(e,t){return e===t?0:e>t?1:-1}function Wa(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function I3(e,t){const n=e.split(BS).filter(Boolean),r=t.split(BS).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const vf={alphanumeric:nfe,alphanumericCaseSensitive:rfe,text:ofe,textCaseSensitive:ife,datetime:sfe,basic:afe},lfe={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Io("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return vf.datetime;if(typeof i=="string"&&(r=!0,i.split(BS).length>1))return vf.alphanumeric}return r?vf.text:vf.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return dy(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:vf[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s==null?void 0:s.find(h=>h.id===e.id),l=s==null?void 0:s.findIndex(h=>h.id===e.id);let c=[],u,d=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(i||o||(u="remove")),u==="add"){var p;c=[...s,{id:e.id,desc:d}],c.splice(0,c.length-((p=t.options.maxMultiSortColCount)!=null?p:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(h=>h.id===e.id?{...h,desc:d}:h):u==="remove"?c=s.filter(h=>h.id!==e.id):c=[{id:e.id,desc:d}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},cfe=[Ade,Kde,Ude,Gde,Mde,Ide,Xde,Qde,lfe,Vde,Zde,Jde,efe,tfe,qde];function ufe(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...cfe,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((p,h)=>Object.assign(p,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),s=p=>o.options.mergeOptions?o.options.mergeOptions(i,p):{...i,...p};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(p=>{var h;l=(h=p.getInitialState==null?void 0:p.getInitialState(l))!=null?h:l});const c=[];let u=!1;const d={_features:r,options:{...i,...e},initialState:l,_queue:p=>{c.push(p),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:p=>{const h=ka(p,o.options);o.options=s(h)},getState:()=>o.options.state,setState:p=>{o.options.onStateChange==null||o.options.onStateChange(p)},_getRowId:(p,h,m)=>{var b;return(b=o.options.getRowId==null?void 0:o.options.getRowId(p,h,m))!=null?b:`${m?[m.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(p,h)=>{let m=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[p];if(!m&&(m=o.getCoreRowModel().rowsById[p],!m))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${p}`):new Error;return m},_getDefaultColumnDef:Ge(()=>[o.options.defaultColumn],p=>{var h;return p=(h=p)!=null?h:{},{header:m=>{const b=m.header.column.columnDef;return b.accessorKey?b.accessorKey:b.accessorFn?b.id:null},cell:m=>{var b,v;return(b=(v=m.renderValue())==null||v.toString==null?void 0:v.toString())!=null?b:null},...o._features.reduce((m,b)=>Object.assign(m,b.getDefaultColumnDef==null?void 0:b.getDefaultColumnDef()),{}),...p}},qe(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:Ge(()=>[o._getColumnDefs()],p=>{const h=function(m,b,v){return v===void 0&&(v=0),m.map(x=>{const w=kde(o,x,v,b),_=x;return w.columns=_.columns?h(_.columns,w,v+1):[],w})};return h(p)},qe(e,"debugColumns","getAllColumns")),getAllFlatColumns:Ge(()=>[o.getAllColumns()],p=>p.flatMap(h=>h.getFlatColumns()),qe(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Ge(()=>[o.getAllFlatColumns()],p=>p.reduce((h,m)=>(h[m.id]=m,h),{}),qe(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Ge(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(p,h)=>{let m=p.flatMap(b=>b.getLeafColumns());return h(m)},qe(e,"debugColumns","getAllLeafColumns")),getColumn:p=>{const h=o._getAllFlatColumnsById()[p];return process.env.NODE_ENV!=="production"&&!h&&console.error(`[Table] Column with id '${p}' does not exist.`),h}};Object.assign(o,d);for(let p=0;p<o._features.length;p++){const h=o._features[p];h==null||h.createTable==null||h.createTable(o)}return o}function D3(){return e=>Ge(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let c=0;c<o.length;c++){const u=Ode(e,e._getRowId(o[c],c,s),o[c],c,i,void 0,s==null?void 0:s.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return a};return n.rows=r(t),n},qe(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function dfe(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function N3(e){return t=>Ge(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:s,flatRows:a,rowsById:l}=r;const c=o*i,u=c+o;s=s.slice(c,u);let d;t.options.paginateExpandedRows?d={rows:s,flatRows:a,rowsById:l}:d=dfe({rows:s,flatRows:a,rowsById:l}),d.flatRows=[];const p=h=>{d.flatRows.push(h),h.subRows.length&&h.subRows.forEach(p)};return d.rows.forEach(p),d},qe(t.options,"debugTable","getPaginationRowModel"))}function L3(){return e=>Ge(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),s={};i.forEach(l=>{const c=e.getColumn(l.id);c&&(s[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(u=>({...u}));return c.sort((u,d)=>{for(let h=0;h<i.length;h+=1){var p;const m=i[h],b=s[m.id],v=b.sortUndefined,x=(p=m==null?void 0:m.desc)!=null?p:!1;let w=0;if(v){const _=u.getValue(m.id),R=d.getValue(m.id),C=_===void 0,E=R===void 0;if(C||E){if(v==="first")return C?-1:1;if(v==="last")return C?1:-1;w=C&&E?0:C?v:-v}}if(w===0&&(w=b.sortingFn(u,d,m.id)),w!==0)return x&&(w*=-1),b.invertSorting&&(w*=-1),w}return u.index-d.index}),c.forEach(u=>{var d;o.push(u),(d=u.subRows)!=null&&d.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},qe(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
300
|
+
* react-table
|
|
301
|
+
*
|
|
302
|
+
* Copyright (c) TanStack
|
|
303
|
+
*
|
|
304
|
+
* This source code is licensed under the MIT license found in the
|
|
305
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
306
|
+
*
|
|
307
|
+
* @license MIT
|
|
308
|
+
*/function HS(e,t){return e?ffe(e)?P.createElement(e,t):e:null}function ffe(e){return hfe(e)||typeof e=="function"||pfe(e)}function hfe(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function pfe(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function F3(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=P.useState(()=>({current:ufe(t)})),[r,o]=P.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}function VS(e,[t,n]){return Math.min(n,Math.max(t,e))}var pw=0;function fy(){P.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??MM()),document.body.insertAdjacentElement("beforeend",e[1]??MM()),pw++,()=>{pw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),pw--}},[])}function MM(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var gw="focusScope.autoFocusOnMount",mw="focusScope.autoFocusOnUnmount",IM={bubbles:!1,cancelable:!0},gfe="FocusScope",vp=P.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=P.useState(null),c=Bn(o),u=Bn(i),d=P.useRef(null),p=et(t,b=>l(b)),h=P.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;P.useEffect(()=>{if(r){let b=function(_){if(h.paused||!a)return;const R=_.target;a.contains(R)?d.current=R:ga(d.current,{select:!0})},v=function(_){if(h.paused||!a)return;const R=_.relatedTarget;R!==null&&(a.contains(R)||ga(d.current,{select:!0}))},x=function(_){if(document.activeElement===document.body)for(const C of _)C.removedNodes.length>0&&ga(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",v);const w=new MutationObserver(x);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",v),w.disconnect()}}},[r,a,h.paused]),P.useEffect(()=>{if(a){NM.add(h);const b=document.activeElement;if(!a.contains(b)){const x=new CustomEvent(gw,IM);a.addEventListener(gw,c),a.dispatchEvent(x),x.defaultPrevented||(mfe(wfe(j3(a)),{select:!0}),document.activeElement===b&&ga(a))}return()=>{a.removeEventListener(gw,c),setTimeout(()=>{const x=new CustomEvent(mw,IM);a.addEventListener(mw,u),a.dispatchEvent(x),x.defaultPrevented||ga(b??document.body,{select:!0}),a.removeEventListener(mw,u),NM.remove(h)},0)}}},[a,c,u,h]);const m=P.useCallback(b=>{if(!n&&!r||h.paused)return;const v=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,x=document.activeElement;if(v&&x){const w=b.currentTarget,[_,R]=bfe(w);_&&R?!b.shiftKey&&x===R?(b.preventDefault(),n&&ga(_,{select:!0})):b.shiftKey&&x===_&&(b.preventDefault(),n&&ga(R,{select:!0})):x===w&&b.preventDefault()}},[n,r,h.paused]);return y.jsx(Oe.div,{tabIndex:-1,...s,ref:p,onKeyDown:m})});vp.displayName=gfe;function mfe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ga(r,{select:t}),document.activeElement!==n)return}function bfe(e){const t=j3(e),n=DM(t,e),r=DM(t.reverse(),e);return[n,r]}function j3(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function DM(e,t){for(const n of e)if(!yfe(n,{upTo:t}))return n}function yfe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function vfe(e){return e instanceof HTMLInputElement&&"select"in e}function ga(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&vfe(e)&&t&&e.select()}}var NM=xfe();function xfe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=LM(e,t),e.unshift(t)},remove(t){var n;e=LM(e,t),(n=e[0])==null||n.resume()}}}function LM(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function wfe(e){return e.filter(t=>t.tagName!=="A")}function hy(e){const t=P.useRef({value:e,previous:e});return P.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Sfe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},nu=new WeakMap,Sm=new WeakMap,_m={},bw=0,$3=function(e){return e&&(e.host||$3(e.parentNode))},_fe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=$3(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Cfe=function(e,t,n,r){var o=_fe(t,Array.isArray(e)?e:[e]);_m[n]||(_m[n]=new WeakMap);var i=_m[n],s=[],a=new Set,l=new Set(o),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};o.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(p){if(a.has(p))u(p);else try{var h=p.getAttribute(r),m=h!==null&&h!=="false",b=(nu.get(p)||0)+1,v=(i.get(p)||0)+1;nu.set(p,b),i.set(p,v),s.push(p),b===1&&m&&Sm.set(p,!0),v===1&&p.setAttribute(n,"true"),m||p.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",p,x)}})};return u(t),a.clear(),bw++,function(){s.forEach(function(d){var p=nu.get(d)-1,h=i.get(d)-1;nu.set(d,p),i.set(d,h),p||(Sm.has(d)||d.removeAttribute(r),Sm.delete(d)),h||d.removeAttribute(n)}),bw--,bw||(nu=new WeakMap,nu=new WeakMap,Sm=new WeakMap,_m={})}},py=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Sfe(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Cfe(r,o,n,"aria-hidden")):function(){return null}},Wi=function(){return Wi=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Wi.apply(this,arguments)};function z3(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Efe(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var rb="right-scroll-bar-position",ob="width-before-scroll-bar",Rfe="with-scroll-bars-hidden",Pfe="--removed-body-scroll-bar-size";function yw(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Tfe(e,t){var n=T.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var kfe=typeof window<"u"?P.useLayoutEffect:P.useEffect,FM=new WeakMap;function Afe(e,t){var n=Tfe(null,function(r){return e.forEach(function(o){return yw(o,r)})});return kfe(function(){var r=FM.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||yw(a,null)}),i.forEach(function(a){o.has(a)||yw(a,s)})}FM.set(n,e)},[e]),n}function Ofe(e){return e}function Mfe(e,t){t===void 0&&(t=Ofe);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var u=s;s=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return o}function Ife(e){e===void 0&&(e={});var t=Mfe(null);return t.options=Wi({async:!0,ssr:!1},e),t}var B3=function(e){var t=e.sideCar,n=z3(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return P.createElement(r,Wi({},n))};B3.isSideCarExport=!0;function Dfe(e,t){return e.useMedium(t),B3}var H3=Ife(),vw=function(){},gy=P.forwardRef(function(e,t){var n=P.useRef(null),r=P.useState({onScrollCapture:vw,onWheelCapture:vw,onTouchMoveCapture:vw}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,p=e.sideCar,h=e.noIsolation,m=e.inert,b=e.allowPinchZoom,v=e.as,x=v===void 0?"div":v,w=e.gapMode,_=z3(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=p,C=Afe([n,t]),E=Wi(Wi({},_),o);return P.createElement(P.Fragment,null,u&&P.createElement(R,{sideCar:H3,removeScrollBar:c,shards:d,noIsolation:h,inert:m,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:w}),s?P.cloneElement(P.Children.only(a),Wi(Wi({},E),{ref:C})):P.createElement(x,Wi({},E,{className:l,ref:C}),a))});gy.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};gy.classNames={fullWidth:ob,zeroRight:rb};var Nfe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Lfe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Nfe();return t&&e.setAttribute("nonce",t),e}function Ffe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function jfe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var $fe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Lfe())&&(Ffe(t,n),jfe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},zfe=function(){var e=$fe();return function(t,n){P.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},V3=function(){var e=zfe(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Bfe={left:0,top:0,right:0,gap:0},xw=function(e){return parseInt(e||"",10)||0},Hfe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[xw(n),xw(r),xw(o)]},Vfe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Bfe;var t=Hfe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Wfe=V3(),ku="data-scroll-locked",Ufe=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
309
|
+
.`.concat(Rfe,` {
|
|
310
|
+
overflow: hidden `).concat(r,`;
|
|
311
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
|
312
|
+
}
|
|
313
|
+
body[`).concat(ku,`] {
|
|
314
|
+
overflow: hidden `).concat(r,`;
|
|
315
|
+
overscroll-behavior: contain;
|
|
316
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
317
|
+
padding-left: `.concat(o,`px;
|
|
318
|
+
padding-top: `).concat(i,`px;
|
|
319
|
+
padding-right: `).concat(s,`px;
|
|
320
|
+
margin-left:0;
|
|
321
|
+
margin-top:0;
|
|
322
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
323
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.`).concat(rb,` {
|
|
327
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.`).concat(ob,` {
|
|
331
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.`).concat(rb," .").concat(rb,` {
|
|
335
|
+
right: 0 `).concat(r,`;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.`).concat(ob," .").concat(ob,` {
|
|
339
|
+
margin-right: 0 `).concat(r,`;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
body[`).concat(ku,`] {
|
|
343
|
+
`).concat(Pfe,": ").concat(a,`px;
|
|
344
|
+
}
|
|
345
|
+
`)},jM=function(){var e=parseInt(document.body.getAttribute(ku)||"0",10);return isFinite(e)?e:0},Gfe=function(){P.useEffect(function(){return document.body.setAttribute(ku,(jM()+1).toString()),function(){var e=jM()-1;e<=0?document.body.removeAttribute(ku):document.body.setAttribute(ku,e.toString())}},[])},qfe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Gfe();var i=P.useMemo(function(){return Vfe(o)},[o]);return P.createElement(Wfe,{styles:Ufe(i,!t,o,n?"":"!important")})},WS=!1;if(typeof window<"u")try{var Cm=Object.defineProperty({},"passive",{get:function(){return WS=!0,!0}});window.addEventListener("test",Cm,Cm),window.removeEventListener("test",Cm,Cm)}catch{WS=!1}var ru=WS?{passive:!1}:!1,Yfe=function(e){return e.tagName==="TEXTAREA"},W3=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Yfe(e)&&n[t]==="visible")},Kfe=function(e){return W3(e,"overflowY")},Xfe=function(e){return W3(e,"overflowX")},$M=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=U3(e,r);if(o){var i=G3(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Qfe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Zfe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},U3=function(e,t){return e==="v"?Kfe(t):Xfe(t)},G3=function(e,t){return e==="v"?Qfe(t):Zfe(t)},Jfe=function(e,t){return e==="h"&&t==="rtl"?-1:1},ehe=function(e,t,n,r,o){var i=Jfe(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,p=0;do{var h=G3(e,a),m=h[0],b=h[1],v=h[2],x=b-v-i*m;(m||x)&&U3(e,a)&&(d+=x,p+=m),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(p)<1)&&(c=!0),c},Em=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},zM=function(e){return[e.deltaX,e.deltaY]},BM=function(e){return e&&"current"in e?e.current:e},the=function(e,t){return e[0]===t[0]&&e[1]===t[1]},nhe=function(e){return`
|
|
346
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
347
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
348
|
+
`)},rhe=0,ou=[];function ohe(e){var t=P.useRef([]),n=P.useRef([0,0]),r=P.useRef(),o=P.useState(rhe++)[0],i=P.useState(V3)[0],s=P.useRef(e);P.useEffect(function(){s.current=e},[e]),P.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=Efe([e.lockRef.current],(e.shards||[]).map(BM),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=P.useCallback(function(b,v){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!s.current.allowPinchZoom;var x=Em(b),w=n.current,_="deltaX"in b?b.deltaX:w[0]-x[0],R="deltaY"in b?b.deltaY:w[1]-x[1],C,E=b.target,A=Math.abs(_)>Math.abs(R)?"h":"v";if("touches"in b&&A==="h"&&E.type==="range")return!1;var M=$M(A,E);if(!M)return!0;if(M?C=A:(C=A==="v"?"h":"v",M=$M(A,E)),!M)return!1;if(!r.current&&"changedTouches"in b&&(_||R)&&(r.current=C),!C)return!0;var N=r.current||C;return ehe(N,v,b,N==="h"?_:R)},[]),l=P.useCallback(function(b){var v=b;if(!(!ou.length||ou[ou.length-1]!==i)){var x="deltaY"in v?zM(v):Em(v),w=t.current.filter(function(C){return C.name===v.type&&(C.target===v.target||v.target===C.shadowParent)&&the(C.delta,x)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var _=(s.current.shards||[]).map(BM).filter(Boolean).filter(function(C){return C.contains(v.target)}),R=_.length>0?a(v,_[0]):!s.current.noIsolation;R&&v.cancelable&&v.preventDefault()}}},[]),c=P.useCallback(function(b,v,x,w){var _={name:b,delta:v,target:x,should:w,shadowParent:ihe(x)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(R){return R!==_})},1)},[]),u=P.useCallback(function(b){n.current=Em(b),r.current=void 0},[]),d=P.useCallback(function(b){c(b.type,zM(b),b.target,a(b,e.lockRef.current))},[]),p=P.useCallback(function(b){c(b.type,Em(b),b.target,a(b,e.lockRef.current))},[]);P.useEffect(function(){return ou.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,ru),document.addEventListener("touchmove",l,ru),document.addEventListener("touchstart",u,ru),function(){ou=ou.filter(function(b){return b!==i}),document.removeEventListener("wheel",l,ru),document.removeEventListener("touchmove",l,ru),document.removeEventListener("touchstart",u,ru)}},[]);var h=e.removeScrollBar,m=e.inert;return P.createElement(P.Fragment,null,m?P.createElement(i,{styles:nhe(o)}):null,h?P.createElement(qfe,{gapMode:e.gapMode}):null)}function ihe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const she=Dfe(H3,ohe);var xp=P.forwardRef(function(e,t){return P.createElement(gy,Wi({},e,{ref:t,sideCar:she}))});xp.classNames=gy.classNames;var ahe=[" ","Enter","ArrowUp","ArrowDown"],lhe=[" ","Enter"],wp="Select",[my,by,che]=P0(wp),[Md,aOe]=Vn(wp,[che,fs]),yy=fs(),[uhe,Qa]=Md(wp),[dhe,fhe]=Md(wp),q3=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:p,required:h,form:m}=e,b=yy(t),[v,x]=P.useState(null),[w,_]=P.useState(null),[R,C]=P.useState(!1),E=Rc(c),[A=!1,M]=wr({prop:r,defaultProp:o,onChange:i}),[N,L]=wr({prop:s,defaultProp:a,onChange:l}),F=P.useRef(null),z=v?m||!!v.closest("form"):!0,[Z,G]=P.useState(new Set),j=Array.from(Z).map(H=>H.props.value).join(";");return y.jsx(hp,{...b,children:y.jsxs(uhe,{required:h,scope:t,trigger:v,onTriggerChange:x,valueNode:w,onValueNodeChange:_,valueNodeHasChildren:R,onValueNodeHasChildrenChange:C,contentId:Nn(),value:N,onValueChange:L,open:A,onOpenChange:M,dir:E,triggerPointerDownPosRef:F,disabled:p,children:[y.jsx(my.Provider,{scope:t,children:y.jsx(dhe,{scope:e.__scopeSelect,onNativeOptionAdd:P.useCallback(H=>{G($=>new Set($).add(H))},[]),onNativeOptionRemove:P.useCallback(H=>{G($=>{const V=new Set($);return V.delete(H),V})},[]),children:n})}),z?y.jsxs(v6,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:N,onChange:H=>L(H.target.value),disabled:p,form:m,children:[N===void 0?y.jsx("option",{value:""}):null,Array.from(Z)]},j):null]})})};q3.displayName=wp;var Y3="SelectTrigger",K3=P.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=yy(n),s=Qa(Y3,n),a=s.disabled||r,l=et(t,s.onTriggerChange),c=by(n),u=P.useRef("touch"),[d,p,h]=x6(b=>{const v=c().filter(_=>!_.disabled),x=v.find(_=>_.value===s.value),w=w6(v,b,x);w!==void 0&&s.onValueChange(w.value)}),m=b=>{a||(s.onOpenChange(!0),h()),b&&(s.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return y.jsx(Ad,{asChild:!0,...i,children:y.jsx(Oe.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":y6(s.value)?"":void 0,...o,ref:l,onClick:Ce(o.onClick,b=>{b.currentTarget.focus(),u.current!=="mouse"&&m(b)}),onPointerDown:Ce(o.onPointerDown,b=>{u.current=b.pointerType;const v=b.target;v.hasPointerCapture(b.pointerId)&&v.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(m(b),b.preventDefault())}),onKeyDown:Ce(o.onKeyDown,b=>{const v=d.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&p(b.key),!(v&&b.key===" ")&&ahe.includes(b.key)&&(m(),b.preventDefault())})})})});K3.displayName=Y3;var X3="SelectValue",Q3=P.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Qa(X3,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=et(t,l.onValueNodeChange);return or(()=>{c(u)},[c,u]),y.jsx(Oe.span,{...a,ref:d,style:{pointerEvents:"none"},children:y6(l.value)?y.jsx(y.Fragment,{children:s}):i})});Q3.displayName=X3;var hhe="SelectIcon",Z3=P.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return y.jsx(Oe.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Z3.displayName=hhe;var phe="SelectPortal",J3=e=>y.jsx(mp,{asChild:!0,...e});J3.displayName=phe;var yc="SelectContent",e6=P.forwardRef((e,t)=>{const n=Qa(yc,e.__scopeSelect),[r,o]=P.useState();if(or(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?lc.createPortal(y.jsx(t6,{scope:e.__scopeSelect,children:y.jsx(my.Slot,{scope:e.__scopeSelect,children:y.jsx("div",{children:e.children})})}),i):null}return y.jsx(n6,{...e,ref:t})});e6.displayName=yc;var pi=10,[t6,Za]=Md(yc),ghe="SelectContentImpl",n6=P.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:b,avoidCollisions:v,...x}=e,w=Qa(yc,n),[_,R]=P.useState(null),[C,E]=P.useState(null),A=et(t,Y=>R(Y)),[M,N]=P.useState(null),[L,F]=P.useState(null),z=by(n),[Z,G]=P.useState(!1),j=P.useRef(!1);P.useEffect(()=>{if(_)return py(_)},[_]),fy();const H=P.useCallback(Y=>{const[ee,...re]=z().map(se=>se.ref.current),[ue]=re.slice(-1),fe=document.activeElement;for(const se of Y)if(se===fe||(se==null||se.scrollIntoView({block:"nearest"}),se===ee&&C&&(C.scrollTop=0),se===ue&&C&&(C.scrollTop=C.scrollHeight),se==null||se.focus(),document.activeElement!==fe))return},[z,C]),$=P.useCallback(()=>H([M,_]),[H,M,_]);P.useEffect(()=>{Z&&$()},[Z,$]);const{onOpenChange:V,triggerPointerDownPosRef:X}=w;P.useEffect(()=>{if(_){let Y={x:0,y:0};const ee=ue=>{var fe,se;Y={x:Math.abs(Math.round(ue.pageX)-(((fe=X.current)==null?void 0:fe.x)??0)),y:Math.abs(Math.round(ue.pageY)-(((se=X.current)==null?void 0:se.y)??0))}},re=ue=>{Y.x<=10&&Y.y<=10?ue.preventDefault():_.contains(ue.target)||V(!1),document.removeEventListener("pointermove",ee),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",re,{capture:!0})}}},[_,V,X]),P.useEffect(()=>{const Y=()=>V(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[V]);const[I,q]=x6(Y=>{const ee=z().filter(fe=>!fe.disabled),re=ee.find(fe=>fe.ref.current===document.activeElement),ue=w6(ee,Y,re);ue&&setTimeout(()=>ue.ref.current.focus())}),U=P.useCallback((Y,ee,re)=>{const ue=!j.current&&!re;(w.value!==void 0&&w.value===ee||ue)&&(N(Y),ue&&(j.current=!0))},[w.value]),O=P.useCallback(()=>_==null?void 0:_.focus(),[_]),J=P.useCallback((Y,ee,re)=>{const ue=!j.current&&!re;(w.value!==void 0&&w.value===ee||ue)&&F(Y)},[w.value]),K=r==="popper"?US:r6,ne=K===US?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:b,avoidCollisions:v}:{};return y.jsx(t6,{scope:n,content:_,viewport:C,onViewportChange:E,itemRefCallback:U,selectedItem:M,onItemLeave:O,itemTextRefCallback:J,focusSelectedItem:$,selectedItemText:L,position:r,isPositioned:Z,searchRef:I,children:y.jsx(xp,{as:Gs,allowPinchZoom:!0,children:y.jsx(vp,{asChild:!0,trapped:w.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:Ce(o,Y=>{var ee;(ee=w.trigger)==null||ee.focus({preventScroll:!0}),Y.preventDefault()}),children:y.jsx(Oc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:y.jsx(K,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:Y=>Y.preventDefault(),...x,...ne,onPlaced:()=>G(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Ce(x.onKeyDown,Y=>{const ee=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!ee&&Y.key.length===1&&q(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let ue=z().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(ue=ue.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const fe=Y.target,se=ue.indexOf(fe);ue=ue.slice(se+1)}setTimeout(()=>H(ue)),Y.preventDefault()}})})})})})})});n6.displayName=ghe;var mhe="SelectItemAlignedPosition",r6=P.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Qa(yc,n),s=Za(yc,n),[a,l]=P.useState(null),[c,u]=P.useState(null),d=et(t,A=>u(A)),p=by(n),h=P.useRef(!1),m=P.useRef(!0),{viewport:b,selectedItem:v,selectedItemText:x,focusSelectedItem:w}=s,_=P.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&b&&v&&x){const A=i.trigger.getBoundingClientRect(),M=c.getBoundingClientRect(),N=i.valueNode.getBoundingClientRect(),L=x.getBoundingClientRect();if(i.dir!=="rtl"){const fe=L.left-M.left,se=N.left-fe,pe=A.left-se,ce=A.width+pe,_e=Math.max(ce,M.width),Pe=window.innerWidth-pi,Me=VS(se,[pi,Math.max(pi,Pe-_e)]);a.style.minWidth=ce+"px",a.style.left=Me+"px"}else{const fe=M.right-L.right,se=window.innerWidth-N.right-fe,pe=window.innerWidth-A.right-se,ce=A.width+pe,_e=Math.max(ce,M.width),Pe=window.innerWidth-pi,Me=VS(se,[pi,Math.max(pi,Pe-_e)]);a.style.minWidth=ce+"px",a.style.right=Me+"px"}const F=p(),z=window.innerHeight-pi*2,Z=b.scrollHeight,G=window.getComputedStyle(c),j=parseInt(G.borderTopWidth,10),H=parseInt(G.paddingTop,10),$=parseInt(G.borderBottomWidth,10),V=parseInt(G.paddingBottom,10),X=j+H+Z+V+$,I=Math.min(v.offsetHeight*5,X),q=window.getComputedStyle(b),U=parseInt(q.paddingTop,10),O=parseInt(q.paddingBottom,10),J=A.top+A.height/2-pi,K=z-J,ne=v.offsetHeight/2,Y=v.offsetTop+ne,ee=j+H+Y,re=X-ee;if(ee<=J){const fe=F.length>0&&v===F[F.length-1].ref.current;a.style.bottom="0px";const se=c.clientHeight-b.offsetTop-b.offsetHeight,pe=Math.max(K,ne+(fe?O:0)+se+$),ce=ee+pe;a.style.height=ce+"px"}else{const fe=F.length>0&&v===F[0].ref.current;a.style.top="0px";const pe=Math.max(J,j+b.offsetTop+(fe?U:0)+ne)+re;a.style.height=pe+"px",b.scrollTop=ee-J+b.offsetTop}a.style.margin=`${pi}px 0`,a.style.minHeight=I+"px",a.style.maxHeight=z+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,a,c,b,v,x,i.dir,r]);or(()=>_(),[_]);const[R,C]=P.useState();or(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const E=P.useCallback(A=>{A&&m.current===!0&&(_(),w==null||w(),m.current=!1)},[_,w]);return y.jsx(yhe,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:E,children:y.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:y.jsx(Oe.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});r6.displayName=mhe;var bhe="SelectPopperPosition",US=P.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=pi,...i}=e,s=yy(n);return y.jsx(pp,{...s,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});US.displayName=bhe;var[yhe,UE]=Md(yc,{}),GS="SelectViewport",o6=P.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=Za(GS,n),s=UE(GS,n),a=et(t,i.onViewportChange),l=P.useRef(0);return y.jsxs(y.Fragment,{children:[y.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),y.jsx(my.Slot,{scope:n,children:y.jsx(Oe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Ce(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=s;if(p!=null&&p.current&&d){const h=Math.abs(l.current-u.scrollTop);if(h>0){const m=window.innerHeight-pi*2,b=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),x=Math.max(b,v);if(x<m){const w=x+h,_=Math.min(m,w),R=w-_;d.style.height=_+"px",d.style.bottom==="0px"&&(u.scrollTop=R>0?R:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});o6.displayName=GS;var i6="SelectGroup",[vhe,xhe]=Md(i6),s6=P.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Nn();return y.jsx(vhe,{scope:n,id:o,children:y.jsx(Oe.div,{role:"group","aria-labelledby":o,...r,ref:t})})});s6.displayName=i6;var a6="SelectLabel",l6=P.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=xhe(a6,n);return y.jsx(Oe.div,{id:o.id,...r,ref:t})});l6.displayName=a6;var Qb="SelectItem",[whe,c6]=Md(Qb),u6=P.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Qa(Qb,n),l=Za(Qb,n),c=a.value===r,[u,d]=P.useState(i??""),[p,h]=P.useState(!1),m=et(t,w=>{var _;return(_=l.itemRefCallback)==null?void 0:_.call(l,w,r,o)}),b=Nn(),v=P.useRef("touch"),x=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return y.jsx(whe,{scope:n,value:r,disabled:o,textId:b,isSelected:c,onItemTextChange:P.useCallback(w=>{d(_=>_||((w==null?void 0:w.textContent)??"").trim())},[]),children:y.jsx(my.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:y.jsx(Oe.div,{role:"option","aria-labelledby":b,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:m,onFocus:Ce(s.onFocus,()=>h(!0)),onBlur:Ce(s.onBlur,()=>h(!1)),onClick:Ce(s.onClick,()=>{v.current!=="mouse"&&x()}),onPointerUp:Ce(s.onPointerUp,()=>{v.current==="mouse"&&x()}),onPointerDown:Ce(s.onPointerDown,w=>{v.current=w.pointerType}),onPointerMove:Ce(s.onPointerMove,w=>{var _;v.current=w.pointerType,o?(_=l.onItemLeave)==null||_.call(l):v.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(s.onPointerLeave,w=>{var _;w.currentTarget===document.activeElement&&((_=l.onItemLeave)==null||_.call(l))}),onKeyDown:Ce(s.onKeyDown,w=>{var R;((R=l.searchRef)==null?void 0:R.current)!==""&&w.key===" "||(lhe.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})})})})});u6.displayName=Qb;var Hf="SelectItemText",d6=P.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Qa(Hf,n),a=Za(Hf,n),l=c6(Hf,n),c=fhe(Hf,n),[u,d]=P.useState(null),p=et(t,x=>d(x),l.onItemTextChange,x=>{var w;return(w=a.itemTextRefCallback)==null?void 0:w.call(a,x,l.value,l.disabled)}),h=u==null?void 0:u.textContent,m=P.useMemo(()=>y.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:b,onNativeOptionRemove:v}=c;return or(()=>(b(m),()=>v(m)),[b,v,m]),y.jsxs(y.Fragment,{children:[y.jsx(Oe.span,{id:l.textId,...i,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?lc.createPortal(i.children,s.valueNode):null]})});d6.displayName=Hf;var f6="SelectItemIndicator",h6=P.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c6(f6,n).isSelected?y.jsx(Oe.span,{"aria-hidden":!0,...r,ref:t}):null});h6.displayName=f6;var qS="SelectScrollUpButton",p6=P.forwardRef((e,t)=>{const n=Za(qS,e.__scopeSelect),r=UE(qS,e.__scopeSelect),[o,i]=P.useState(!1),s=et(t,r.onScrollButtonChange);return or(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?y.jsx(m6,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});p6.displayName=qS;var YS="SelectScrollDownButton",g6=P.forwardRef((e,t)=>{const n=Za(YS,e.__scopeSelect),r=UE(YS,e.__scopeSelect),[o,i]=P.useState(!1),s=et(t,r.onScrollButtonChange);return or(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?y.jsx(m6,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});g6.displayName=YS;var m6=P.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Za("SelectScrollButton",n),s=P.useRef(null),a=by(n),l=P.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return P.useEffect(()=>()=>l(),[l]),or(()=>{var u;const c=a().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),y.jsx(Oe.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Ce(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Ce(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Ce(o.onPointerLeave,()=>{l()})})}),She="SelectSeparator",b6=P.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return y.jsx(Oe.div,{"aria-hidden":!0,...r,ref:t})});b6.displayName=She;var KS="SelectArrow",_he=P.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=yy(n),i=Qa(KS,n),s=Za(KS,n);return i.open&&s.position==="popper"?y.jsx(gp,{...o,...r,ref:t}):null});_he.displayName=KS;function y6(e){return e===""||e===void 0}var v6=P.forwardRef((e,t)=>{const{value:n,...r}=e,o=P.useRef(null),i=et(t,o),s=hy(n);return P.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const d=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(d)}},[s,n]),y.jsx(IE,{asChild:!0,children:y.jsx("select",{...r,ref:i,defaultValue:n})})});v6.displayName="BubbleSelect";function x6(e){const t=Bn(e),n=P.useRef(""),r=P.useRef(0),o=P.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=P.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return P.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function w6(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=Che(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Che(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ehe=q3,S6=K3,Rhe=Q3,Phe=Z3,The=J3,_6=e6,khe=o6,Ahe=s6,C6=l6,E6=u6,Ohe=d6,Mhe=h6,R6=p6,P6=g6,T6=b6;const Is=Ehe,uu=Ahe,Ds=Rhe,Ni=P.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(S6,{ref:r,className:ge("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,y.jsx(Phe,{asChild:!0,children:y.jsx(lp,{className:"h-4 w-4 opacity-50"})})]}));Ni.displayName=S6.displayName;const k6=P.forwardRef(({className:e,...t},n)=>y.jsx(R6,{ref:n,className:ge("flex cursor-default items-center justify-center py-1",e),...t,children:y.jsx(nL,{className:"h-4 w-4"})}));k6.displayName=R6.displayName;const A6=P.forwardRef(({className:e,...t},n)=>y.jsx(P6,{ref:n,className:ge("flex cursor-default items-center justify-center py-1",e),...t,children:y.jsx(lp,{className:"h-4 w-4"})}));A6.displayName=P6.displayName;const Li=P.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>y.jsx(The,{children:y.jsx(Ec,{children:y.jsxs(_6,{ref:o,className:ge("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[y.jsx(k6,{}),y.jsx(khe,{className:ge("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),y.jsx(A6,{})]})})}));Li.displayName=_6.displayName;const Pl=P.forwardRef(({className:e,...t},n)=>y.jsx(C6,{ref:n,className:ge("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Pl.displayName=C6.displayName;const _n=P.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(E6,{ref:r,className:ge("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[y.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:y.jsx(Mhe,{children:y.jsx(_d,{className:"h-4 w-4"})})}),y.jsx(Ohe,{children:t})]}));_n.displayName=E6.displayName;const sh=P.forwardRef(({className:e,...t},n)=>y.jsx(T6,{ref:n,className:ge("-mx-1 my-1 h-px bg-muted",e),...t}));sh.displayName=T6.displayName;const rc=P.forwardRef(({className:e,type:t,...n},r)=>y.jsx("input",{type:t,className:ge("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));rc.displayName="Input";var Ihe="Label",O6=P.forwardRef((e,t)=>y.jsx(Oe.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));O6.displayName=Ihe;var M6=O6;const Dhe=FE("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),cn=P.forwardRef(({className:e,...t},n)=>y.jsx(M6,{ref:n,className:ge(Dhe(),e),...t}));cn.displayName=M6.displayName;var GE="Popover",[I6,lOe]=Vn(GE,[fs]),Sp=fs(),[Nhe,Ja]=I6(GE),D6=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=Sp(t),l=P.useRef(null),[c,u]=P.useState(!1),[d=!1,p]=wr({prop:r,defaultProp:o,onChange:i});return y.jsx(hp,{...a,children:y.jsx(Nhe,{scope:t,contentId:Nn(),triggerRef:l,open:d,onOpenChange:p,onOpenToggle:P.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:c,onCustomAnchorAdd:P.useCallback(()=>u(!0),[]),onCustomAnchorRemove:P.useCallback(()=>u(!1),[]),modal:s,children:n})})};D6.displayName=GE;var N6="PopoverAnchor",Lhe=P.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ja(N6,n),i=Sp(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return P.useEffect(()=>(s(),()=>a()),[s,a]),y.jsx(Ad,{...i,...r,ref:t})});Lhe.displayName=N6;var L6="PopoverTrigger",F6=P.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ja(L6,n),i=Sp(n),s=et(t,o.triggerRef),a=y.jsx(Oe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":H6(o.open),...r,ref:s,onClick:Ce(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:y.jsx(Ad,{asChild:!0,...i,children:a})});F6.displayName=L6;var qE="PopoverPortal",[Fhe,jhe]=I6(qE,{forceMount:void 0}),j6=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=Ja(qE,t);return y.jsx(Fhe,{scope:t,forceMount:n,children:y.jsx(Ln,{present:n||i.open,children:y.jsx(mp,{asChild:!0,container:o,children:r})})})};j6.displayName=qE;var pd="PopoverContent",$6=P.forwardRef((e,t)=>{const n=jhe(pd,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=Ja(pd,e.__scopePopover);return y.jsx(Ln,{present:r||i.open,children:i.modal?y.jsx($he,{...o,ref:t}):y.jsx(zhe,{...o,ref:t})})});$6.displayName=pd;var $he=P.forwardRef((e,t)=>{const n=Ja(pd,e.__scopePopover),r=P.useRef(null),o=et(t,r),i=P.useRef(!1);return P.useEffect(()=>{const s=r.current;if(s)return py(s)},[]),y.jsx(xp,{as:Gs,allowPinchZoom:!0,children:y.jsx(z6,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Ce(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),zhe=P.forwardRef((e,t)=>{const n=Ja(pd,e.__scopePopover),r=P.useRef(!1),o=P.useRef(!1);return y.jsx(z6,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),z6=P.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,p=Ja(pd,n),h=Sp(n);return fy(),y.jsx(vp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:y.jsx(Oc,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:y.jsx(pp,{"data-state":H6(p.open),role:"dialog",id:p.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),B6="PopoverClose",Bhe=P.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ja(B6,n);return y.jsx(Oe.button,{type:"button",...r,ref:t,onClick:Ce(e.onClick,()=>o.onOpenChange(!1))})});Bhe.displayName=B6;var Hhe="PopoverArrow",Vhe=P.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Sp(n);return y.jsx(gp,{...o,...r,ref:t})});Vhe.displayName=Hhe;function H6(e){return e?"open":"closed"}var Whe=D6,Uhe=F6,Ghe=j6,V6=$6;const vy=Whe,xy=Uhe,_p=P.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>y.jsx(Ghe,{children:y.jsx(Ec,{children:y.jsx(V6,{ref:o,align:t,sideOffset:n,className:ge("z-49 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})})}));_p.displayName=V6.displayName;function qhe(e,t){switch(t){case"full-date-time":return{locale:e,format:"full-date-time",options:{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}};case"short-date-time":return{locale:e,format:"short-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0}};case"hours-date-time":return{locale:e,format:"hours-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}};case"short-date":return{format:"short-date",locale:e,options:{}};case"long-date":return{format:"long-date",locale:e,options:{year:"numeric",month:"long",day:"numeric"}};default:return{format:"short-date-time",locale:e,options:{}}}}function W6({colorRanges:e,setColorRanges:t}){const n={start:-1/0,end:100,color:""};function r(s,a,l){const c=[...e];c[s]={...c[s],[a]:l},t(c)}function o(s){const a=[...e];a.splice(s,1),t(a)}function i(){t([...e,n])}return y.jsxs("div",{className:"space-y-3",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(cn,{children:"Color Range"}),y.jsx(Hn,{onClick:i,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:y.jsx(W0,{className:"size-3"})})]}),e.map((s,a)=>y.jsxs("div",{className:"flex items-center gap-2 px-2",children:[y.jsx(rc,{onChange:l=>r(a,"start",l.target.value),value:s.start,className:ge(`h-7 ${qf}`)}),y.jsx("span",{children:"-"}),y.jsx(rc,{value:s.end,onChange:l=>r(a,"end",l.target.value),className:ge(`h-7 ${qf}`)}),y.jsx(rc,{onChange:l=>r(a,"color",l.target.value),value:s.color,className:ge(`h-7 min-w-14 p-0 ${qf}`),type:"color",list:"presetColors"}),y.jsxs("datalist",{id:"presetColors",children:[y.jsx("option",{children:At.green[600]}),y.jsx("option",{children:At.red[500]}),y.jsx("option",{children:At.yellow[400]}),y.jsx("option",{children:At.orange[500]})]}),y.jsx(Hn,{onClick:()=>o(a),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:y.jsx(kc,{className:"size-3"})})]},a))]})}var Yhe="Toggle",U6=P.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[s=!1,a]=wr({prop:n,onChange:o,defaultProp:r});return y.jsx(Oe.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:Ce(e.onClick,()=>{e.disabled||a(!s)})})});U6.displayName=Yhe;var G6=U6;const Khe=FE("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),wy=P.forwardRef(({className:e,variant:t,size:n,...r},o)=>y.jsx(G6,{ref:o,className:ge(Khe({variant:t,size:n,className:e})),...r}));wy.displayName=G6.displayName;function Xhe(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.type}function Qhe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.locale)||"en-US"}function Zhe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t&&i.type==="date");return((o=n==null?void 0:n.options)==null?void 0:o.format)||"short-date-time"}function Jhe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return(o=n==null?void 0:n.options)==null?void 0:o.currency}function epe(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.minimumFractionDigits)||0}function tpe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.colorRanges)||[]}function npe(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.style)==="percent"}function rpe(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.textAlign}function ope(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.width}function ipe({columnIndex:e,columnName:t}){const[n,r]=T.useState(!1),o=to(H=>{var $;return($=H.card)==null?void 0:$.preferences}),[i,s]=T.useState(Xhe(o,e)),[a,l]=T.useState(rpe(o,e)),[c,u]=T.useState(ope(o,e)),[d,p]=T.useState(tpe(o,e)),[h,m]=T.useState(Qhe(o,e)),[b,v]=T.useState(Zhe(o,e)),[x,w]=T.useState(Jhe(o,e)),[_,R]=T.useState(epe(o,e).toString()),[C,E]=T.useState(npe(o,e)),[A,M]=T.useState(""),N=to(H=>H.actions.setCardPreferences);function L(){return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[y.jsx(cn,{className:"col-span-3",htmlFor:"format",children:"Text Align"}),y.jsxs(Is,{value:a||"left",onValueChange:H=>l(H),children:[y.jsx(Ni,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Ds,{})}),y.jsxs(Li,{children:[y.jsx(_n,{value:"left",children:"Left"}),y.jsx(_n,{value:"center",children:"Center"}),y.jsx(_n,{value:"right",children:"Right"})]})]})]}),y.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[y.jsx(cn,{className:"col-span-3",htmlFor:"format",children:"Width (px)"}),y.jsx(rc,{placeholder:"Auto",value:c?c.toString():"",className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",onChange:H=>{H.target.value===""?u(void 0):u(Number(H.target.value))}})]})]})}function F(){const H=[...new Set(v1.map($=>$.currency))];return y.jsx(y.Fragment,{children:y.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[y.jsx(cn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),y.jsxs(Is,{value:h,onValueChange:$=>m($),children:[y.jsx(Ni,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Ds,{})}),y.jsx(Li,{children:y.jsxs(uu,{children:[y.jsx(Pl,{children:"Locale"}),v1.map($=>y.jsx(_n,{value:$.locale,children:$.locale},$.locale))]})})]}),y.jsx(cn,{className:"col-span-3",htmlFor:"format",children:"Currency"}),y.jsxs(Is,{value:x||"none",onValueChange:$=>w($==="none"?void 0:$),children:[y.jsx(Ni,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Ds,{})}),y.jsx(Li,{children:y.jsxs(uu,{children:[y.jsx(Pl,{children:"Currency"}),y.jsx(_n,{value:"none",children:"None"}),H.map($=>y.jsx(_n,{value:$,children:$},$))]})})]}),y.jsx(cn,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),y.jsxs(Is,{value:_,onValueChange:$=>R($),children:[y.jsx(Ni,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Ds,{})}),y.jsx(Li,{children:["0","1","2","3","4"].map($=>y.jsx(_n,{value:$,children:$},$))})]}),!x&&y.jsx(wy,{onPressedChange:$=>E($),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:y.jsx(pL,{className:"size-3"})})]})})}function z(){return y.jsx(y.Fragment,{children:y.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[y.jsx(cn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),y.jsxs(Is,{defaultValue:"en-US",value:h,onValueChange:H=>m(H),children:[y.jsx(Ni,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Ds,{})}),y.jsx(Li,{children:KK.map(H=>y.jsxs(uu,{children:[y.jsx(Pl,{children:H.label}),H.locales.map($=>y.jsx(_n,{value:$.code,children:$.name},$.code))]},H.label))})]}),y.jsx(cn,{className:"col-span-3",htmlFor:"format",children:"Format"}),y.jsxs(Is,{defaultValue:"short-date-time",value:b,onValueChange:H=>{console.log("format",H),v(H)},children:[y.jsx(Ni,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Ds,{})}),y.jsx(Li,{className:"",id:"type",children:y.jsxs(uu,{children:[y.jsx(Pl,{children:"Option"}),y.jsx(_n,{value:"full-date-time",children:"Full Date-Time"}),y.jsx(_n,{value:"short-date-time",children:"Short Date-Time"}),y.jsx(_n,{value:"hours-date-time",children:"24-Hour Date-Time"}),y.jsx(_n,{value:"short-date",children:"Short Date"}),y.jsx(_n,{value:"long-date",children:"Long Date"})]})})]})]})})}function Z(){N({...o,columnSettings:[]})}function G(){var H;N({...o,columnSettings:[...((H=o==null?void 0:o.columnSettings)==null?void 0:H.filter($=>$.columnIdx!==e))||[]]})}function j(){var H,$,V,X;if(i==="date"){const I=qhe(h,b),q={columnIdx:e,type:i,options:I};N({...o,columnSettings:[...((H=o==null?void 0:o.columnSettings)==null?void 0:H.filter(U=>U.columnIdx!==e))||[],q]})}else if(i==="number"){let I;x?I={locale:h,currency:x,options:{style:"currency",currency:x,minimumFractionDigits:Number(_)},colorRanges:d.length>0?d:void 0}:I={locale:h,currency:void 0,options:{style:C?"percent":"decimal",minimumFractionDigits:Number(_)},colorRanges:d.length>0?d:void 0};const q={columnIdx:e,type:i,textAlign:a,width:c,options:I};N({...o,columnSettings:[...(($=o==null?void 0:o.columnSettings)==null?void 0:$.filter(U=>U.columnIdx!==e))||[],q]})}else if(i==="html"){const I={columnIdx:e,type:i,options:{html:""}};N({...o,columnSettings:[...((V=o==null?void 0:o.columnSettings)==null?void 0:V.filter(q=>q.columnIdx!==e))||[],I]})}else{const I={columnIdx:e,type:"none",textAlign:a,width:c,options:{}};N({...o,columnSettings:[...((X=o==null?void 0:o.columnSettings)==null?void 0:X.filter(q=>q.columnIdx!==e))||[],I]})}}return y.jsxs(vy,{onOpenChange:H=>r(H),children:[y.jsx(xy,{asChild:!0,children:y.jsx(hL,{className:"size-3 cursor-pointer text-muted"})}),y.jsx(_p,{align:"center",className:"max-w-70 z-20",children:y.jsxs("div",{className:"grid gap-4",children:[y.jsxs("div",{className:"space-y-2",children:[y.jsx("h4",{className:"font-medium leading-none",children:"Display Settings"}),y.jsx("p",{className:"text-sm text-muted-foreground",children:`Display setting for '${t}'`})]}),y.jsxs("div",{className:"grid gap-2",children:[y.jsxs("div",{className:"grid grid-cols-3 items-center gap-2",children:[y.jsx(cn,{htmlFor:"scale",children:"Type"}),y.jsxs(Is,{value:i||"none",onValueChange:H=>s(H),children:[y.jsx(Ni,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Ds,{})}),y.jsx(Li,{id:"type",children:y.jsxs(uu,{children:[y.jsx(Pl,{children:"Option"}),y.jsx(_n,{value:"number",children:"Number"}),y.jsx(_n,{value:"date",children:"Date"}),y.jsx(_n,{value:"html",children:"HTML"}),y.jsx(_n,{value:"none",children:"None"})]})})]})]}),L(),y.jsx(sh,{}),i==="number"&&F(),i==="date"&&z(),i==="number"&&y.jsxs(y.Fragment,{children:[y.jsx(sh,{}),y.jsx(W6,{colorRanges:d,setColorRanges:p})]}),y.jsx(sh,{}),y.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[y.jsx(Hn,{onClick:Z,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),y.jsx(Hn,{onClick:G,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),y.jsx(Hn,{onClick:j,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function spe(e){const t=new Date(e);return!isNaN(t.getTime())}function q6({data:e,card:t}){var R,C,E,A;const[n,r]=T.useState([]),{keys:o}=Yn(e),i=be(M=>M.filteringCards),s=be(M=>M.themeStyle),a=be(M=>M.isVisualEditing),l=i==null?void 0:i.find(M=>M.id===t.id),c=(R=t==null?void 0:t.preferences)==null?void 0:R.onClickFilter,{addOrUpdateFilterValues:u,addFilteringCard:d,removeFilterValues:p,removeFilteringCard:h}=An(),m=t==null?void 0:t.preferences;function b(M,N){if((N==null?void 0:N.type)==="date"&&spe(M)){const{locale:L,options:F}=N.options,z=new Date(M);return new Date(z.getTime()).toLocaleDateString(L,F)}if((N==null?void 0:N.type)==="number"){const{locale:L,currency:F,options:z}=N.options;return F?new Intl.NumberFormat(L,{style:"currency",currency:F,...z}).format(M):new Intl.NumberFormat(L,z).format(M)}if((N==null?void 0:N.type)==="html"){const L=LS.sanitize(M);return y.jsx("div",{className:"hover:underline",dangerouslySetInnerHTML:{__html:L}})}return M}const v=o.map((M,N)=>({accessorKey:M,header:({column:L})=>{var $;const F=L.getIsSorted(),z=N,Z=($=m==null?void 0:m.columnSettings)==null?void 0:$.find(V=>V.columnIdx===z),G=Z==null?void 0:Z.textAlign,j=Z==null?void 0:Z.width,H=j?{width:j}:{};return y.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[y.jsxs("div",{className:ge("flex grow cursor-pointer items-center",{"justify-center":G==="center","justify-end":G==="right","justify-start":G==="left"}),style:H,onClick:()=>L.toggleSorting(L.getIsSorted()==="asc"),children:[M,F==="asc"?y.jsx(Z5,{className:"ml-2 h-5 w-5"}):F==="desc"?y.jsx(Q5,{className:"ml-2 h-5 w-5"}):null]}),y.jsx("div",{className:"opacity-0 group-hover:opacity-100",children:a&&y.jsx(ipe,{columnName:L.id,columnIndex:N})})]})},cell:({cell:L})=>{var H,$;const F=L.getValue(),z=(H=m==null?void 0:m.columnSettings)==null?void 0:H.find(V=>V.columnIdx===N),Z=b(F,z),G=VC(F,($=z==null?void 0:z.options)==null?void 0:$.colorRanges),j=z==null?void 0:z.textAlign;return z!=null&&z.width&&z.width,y.jsx("p",{title:Z,className:ge("overflow-auto px-2 py-1",{"text-center":j==="center","text-right":j==="right","text-left":j==="left"}),style:{backgroundColor:G},children:Z})}})),x=F3({data:e,columns:v,getCoreRowModel:D3(),getPaginationRowModel:N3(),onSortingChange:r,getSortedRowModel:L3(),manualPagination:!0,state:{sorting:n}}),w=x.getSelectedRowModel().rows;T.useEffect(()=>{if(w.length===0){if(l){const M=t.id;p(M),h(t)}return}if(c){const{dimensionKeys:M}=Yn(e),N=c.map(L=>{const F=M==null?void 0:M[L.columnIndex],z=w.map(G=>G.getValue(F));return{filterId:t.id+"-"+F,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:F,expression:L.expression,valueType:S0(z[0]===void 0?"":z[0]),operation:"in",values:z}});u(N),d(t)}},[d,u,t,e,l,c,p,h,w]);function _(M){M.toggleSelected()}return y.jsx("div",{className:"rounded-md text-sm text-foreground/80",style:{borderTopRightRadius:(C=s==null?void 0:s.chart)==null?void 0:C.options.borderRadius,borderTopLeftRadius:(E=s==null?void 0:s.chart)==null?void 0:E.options.borderRadius},children:y.jsxs("table",{className:"w-full",onMouseDown:M=>M.stopPropagation(),children:[y.jsx(jE,{className:"group",children:x.getHeaderGroups().map(M=>y.jsx(oh,{children:M.headers.map((N,L)=>{var F,z,Z,G,j,H,$;return y.jsx(zE,{style:{backgroundColor:(Z=(z=(F=s==null?void 0:s.chart)==null?void 0:F.dataset)==null?void 0:z.backgroundColor)==null?void 0:Z[0],color:Qu((H=(j=(G=s==null?void 0:s.chart)==null?void 0:G.dataset)==null?void 0:j.backgroundColor)==null?void 0:H[0])},className:ge("sticky -top-[1px] h-9 bg-muted-foreground px-2 text-background",{"border-x":L>0&&L<M.headers.length-1,"border-l":L===1&&M.headers.length==2},($=s==null?void 0:s.table)==null?void 0:$.tableHeaderColor),children:N.isPlaceholder?null:HS(N.column.columnDef.header,N.getContext())},N.id)})},M.id))}),y.jsx($E,{children:(A=x.getRowModel().rows)!=null&&A.length?x.getRowModel().rows.map((M,N)=>y.jsx(oh,{onClick:()=>_(M),className:ge("whitespace-nowrap p-1",{"cursor-pointer data-[state=selected]:border-2 data-[state=selected]:border-dashed":c&&(c==null?void 0:c.length)>0}),"data-state":M.getIsSelected()&&"selected",children:M.getVisibleCells().map((L,F)=>{var j,H;const z=(j=m==null?void 0:m.columnSettings)==null?void 0:j.find($=>$.columnIdx===F),Z=z==null?void 0:z.width,G=Z?{width:Z,maxWidth:Z}:{};return y.jsx("td",{style:G,onClick:$=>{var X;const V=((X=window==null?void 0:window.getSelection())==null?void 0:X.toString())||"";(V==null?void 0:V.length)>0&&$.stopPropagation()},className:ge("",{"border-x":F>0&&F<v.length-1||F===1&&v.length==2,"border-l":F==0,"border-r":F===v.length-1,"border-b":N===((H=x.getRowModel().rows)==null?void 0:H.length)-1}),children:HS(L.column.columnDef.cell,L.getContext())},L.id)})},M.id)):y.jsx(oh,{children:y.jsx(BE,{colSpan:v.length,className:"p-1 text-center",children:"No results."})})})]})})}async function ape(e,t){const n=`${e}/index.js`,r=`${e}/style.css`;return document.querySelector(`link[href="${r}"]`)||await new Promise((i,s)=>{const a=document.createElement("link");a.rel="stylesheet",a.href=r,a.onload=()=>i(void 0),a.onerror=()=>s(new Error("Failed to load CSS")),document.head.appendChild(a)}),{default:(await import(n))[t]}}async function lpe(e){try{const t=await import(e),n=Object.keys(t),r=[];return n.forEach(o=>{typeof t[o]=="function"&&(o==null?void 0:o[0])===(o==null?void 0:o[0].toUpperCase())&&r.push({name:o,component:o})}),r}catch(t){return console.error("Error loading the library:",t),[]}}async function Y6(e){try{const t=await fetch(`${e}/manifest.json`);if(!t.ok)throw new Error(`Failed to fetch manifest: ${t.statusText}`);return await t.json()}catch(t){throw console.error("Error loading manifest:",t),t}}const K6=e=>{const[t,n]=T.useState([]),[r,o]=T.useState(!1),[i,s]=T.useState(null);T.useEffect(()=>{window.React=T,window.ReactDOM=br,o(!0)},[]),T.useEffect(()=>{e&&r&&Y6(e).then(c=>{n(c.visuals),s(c)}).catch(()=>{lpe(e).then(c=>{console.log("componentNames",c),n(c)}).catch(c=>{console.error("Error loading manifest:",c)})})},[e,r]);const a=T.useMemo(()=>(t==null?void 0:t.map(c=>{const{name:u,component:d,dataInputs:p}=c;return{name:u,componentName:d,Component:T.lazy(()=>ape(e,d)),type:p&&p.length>1?"multiple":"single"}}))||[],[t,e]);function l(c){const u=a==null?void 0:a.find(d=>d.name===c);return u?u.Component:null}return{getCard:l,components:a,manifest:i}};function X6({onLoadingStatus:e,onDataChange:t,card:n}){const{isFetching:r,isLoading:o,data:i,queryKey:s}=La(n),a=JSON.stringify(s);return T.useEffect(()=>{e==null||e(o)},[r,o,e]),T.useEffect(()=>{t(n.id,(i==null?void 0:i.records)||[])},[i==null?void 0:i.records,n.id,a,t]),y.jsx(y.Fragment,{})}function cpe({card:e,frame:t}){var w,_,R,C,E,A,M,N;const[n,r]=T.useState([]),{authToken:o}=Do(),i=CN(o==null?void 0:o.accessToken),s=be(L=>L.themeStyle),a={colors:((_=(w=s==null?void 0:s.chart)==null?void 0:w.dataset)==null?void 0:_.backgroundColor)||[]},[l,c]=T.useState(!1),{getCard:u}=K6(((R=e.customCardPreferences)==null?void 0:R.url)||""),d=((C=e.customCardPreferences)==null?void 0:C.visualType)||"single",p=(E=e.customCardPreferences)==null?void 0:E.componentName,{data:h}=La(e),m=T.useCallback((L,F)=>{r(z=>({...z,[L]:F}))},[]);if(!p)return null;const b=u(p),v=Object.keys(((A=e.customCardPreferences)==null?void 0:A.dataInputCardIds)||{}).map(L=>{var Z,G,j;const F=(G=(Z=e.customCardPreferences)==null?void 0:Z.dataInputCardIds)==null?void 0:G[L].cardId,z=(j=t==null?void 0:t.cards)==null?void 0:j.find(H=>H.id===F);return z||null});function x(L){c(L)}return y.jsx("div",{className:"semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto",children:y.jsxs(T.Suspense,{fallback:y.jsx(y.Fragment,{}),children:[b&&d==="single"&&y.jsx(b,{params:i,theme:a,settings:(M=e.customCardPreferences)==null?void 0:M.settings,onDataChange:m,data:(h==null?void 0:h.records)||[]}),b&&d==="multiple"&&y.jsxs("div",{children:[Object.keys(((N=e.customCardPreferences)==null?void 0:N.dataInputCardIds)||{}).map(L=>{var Z,G,j;const F=(G=(Z=e.customCardPreferences)==null?void 0:Z.dataInputCardIds)==null?void 0:G[L].cardId,z=(j=t==null?void 0:t.cards)==null?void 0:j.find(H=>H.id===F);if(z)return y.jsx(X6,{onLoadingStatus:x,onDataChange:m,dataInputIndex:L,card:z},z.id+L)}),d==="multiple"&&y.jsx("div",{className:ge("flex flex-col gap-2",{"opacity-50":l}),children:y.jsx(b,{params:i,theme:a,onDataChange:m,settings:v.map(L=>{var F;return(F=L==null?void 0:L.customCardPreferences)==null?void 0:F.settings}),data:v.map(L=>L!=null&&L.id?n==null?void 0:n[L.id]:[])})})]})]},e.id)})}/*!
|
|
349
|
+
* chartjs-plugin-datalabels v2.2.0
|
|
350
|
+
* https://chartjs-plugin-datalabels.netlify.app
|
|
351
|
+
* (c) 2017-2022 chartjs-plugin-datalabels contributors
|
|
352
|
+
* Released under the MIT license
|
|
353
|
+
*/var HM=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return(e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1}(),ah={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
|
|
354
|
+
`)):Array.isArray(n)?e.push.apply(e,n):ct(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var r=[].concat(t),o=r.length,i=e.font,s=0,a;for(e.font=n.string,a=0;a<o;++a)s=Math.max(e.measureText(r[a]).width,s);return e.font=i,{height:o*n.lineHeight,width:s}},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n=e.slice(),r=[],o,i,s,a;for(o=0,s=t.length;o<s;++o)a=t[o],i=n.indexOf(a),i===-1?r.push([a,1]):n.splice(i,1);for(o=0,s=n.length;o<s;++o)r.push([n[o],-1]);return r},rasterize:function(e){return Math.round(e*HM)/HM}};function ww(e,t){var n=t.x,r=t.y;if(n===null)return{x:0,y:-1};if(r===null)return{x:1,y:0};var o=e.x-n,i=e.y-r,s=Math.sqrt(o*o+i*i);return{x:s?o/s:0,y:s?i/s:-1}}function upe(e,t,n,r,o){switch(o){case"center":n=r=0;break;case"bottom":n=0,r=1;break;case"right":n=1,r=0;break;case"left":n=-1,r=0;break;case"top":n=0,r=-1;break;case"start":n=-n,r=-r;break;case"end":break;default:o*=Math.PI/180,n=Math.cos(o),r=Math.sin(o);break}return{x:e,y:t,vx:n,vy:r}}var dpe=0,Q6=1,Z6=2,J6=4,e8=8;function Rm(e,t,n){var r=dpe;return e<n.left?r|=Q6:e>n.right&&(r|=Z6),t<n.top?r|=e8:t>n.bottom&&(r|=J6),r}function fpe(e,t){for(var n=e.x0,r=e.y0,o=e.x1,i=e.y1,s=Rm(n,r,t),a=Rm(o,i,t),l,c,u;!(!(s|a)||s&a);)l=s||a,l&e8?(c=n+(o-n)*(t.top-r)/(i-r),u=t.top):l&J6?(c=n+(o-n)*(t.bottom-r)/(i-r),u=t.bottom):l&Z6?(u=r+(i-r)*(t.right-n)/(o-n),c=t.right):l&Q6&&(u=r+(i-r)*(t.left-n)/(o-n),c=t.left),l===s?(n=c,r=u,s=Rm(n,r,t)):(o=c,i=u,a=Rm(o,i,t));return{x0:n,x1:o,y0:r,y1:i}}function Pm(e,t){var n=t.anchor,r=e,o,i;return t.clamp&&(r=fpe(r,t.area)),n==="start"?(o=r.x0,i=r.y0):n==="end"?(o=r.x1,i=r.y1):(o=(r.x0+r.x1)/2,i=(r.y0+r.y1)/2),upe(o,i,e.vx,e.vy,t.align)}var Tm={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,r=Math.cos(n),o=Math.sin(n),i=e.innerRadius,s=e.outerRadius;return Pm({x0:e.x+r*i,y0:e.y+o*i,x1:e.x+r*s,y1:e.y+o*s,vx:r,vy:o},t)},point:function(e,t){var n=ww(e,t.origin),r=n.x*e.options.radius,o=n.y*e.options.radius;return Pm({x0:e.x-r,y0:e.y-o,x1:e.x+r,y1:e.y+o,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=ww(e,t.origin),r=e.x,o=e.y,i=0,s=0;return e.horizontal?(r=Math.min(e.x,e.base),i=Math.abs(e.base-e.x)):(o=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),Pm({x0:r,y0:o+s,x1:r+i,y1:o,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=ww(e,t.origin);return Pm({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)}},Ws=ah.rasterize;function hpe(e){var t=e.borderWidth||0,n=e.padding,r=e.size.height,o=e.size.width,i=-o/2,s=-r/2;return{frame:{x:i-n.left-t,y:s-n.top-t,w:o+n.width+t*2,h:r+n.height+t*2},text:{x:i,y:s,w:o,h:r}}}function ppe(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(n.xCenter!==void 0&&n.yCenter!==void 0)return{x:n.xCenter,y:n.yCenter};var r=n.getBasePixel();return e.horizontal?{x:r,y:null}:{x:null,y:r}}function gpe(e){return e instanceof pu?Tm.arc:e instanceof Jl?Tm.point:e instanceof ec?Tm.bar:Tm.fallback}function mpe(e,t,n,r,o,i){var s=Math.PI/2;if(i){var a=Math.min(i,o/2,r/2),l=t+a,c=n+a,u=t+r-a,d=n+o-a;e.moveTo(t,c),l<u&&c<d?(e.arc(l,c,a,-Math.PI,-s),e.arc(u,c,a,-s,0),e.arc(u,d,a,0,s),e.arc(l,d,a,s,Math.PI)):l<u?(e.moveTo(l,n),e.arc(u,c,a,-s,s),e.arc(l,c,a,s,Math.PI+s)):c<d?(e.arc(l,c,a,-Math.PI,0),e.arc(l,d,a,0,Math.PI)):e.arc(l,c,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,o)}function bpe(e,t,n){var r=n.backgroundColor,o=n.borderColor,i=n.borderWidth;!r&&(!o||!i)||(e.beginPath(),mpe(e,Ws(t.x)+i/2,Ws(t.y)+i/2,Ws(t.w)-i,Ws(t.h)-i,n.borderRadius),e.closePath(),r&&(e.fillStyle=r,e.fill()),o&&i&&(e.strokeStyle=o,e.lineWidth=i,e.lineJoin="miter",e.stroke()))}function ype(e,t,n){var r=n.lineHeight,o=e.w,i=e.x,s=e.y+r/2;return t==="center"?i+=o/2:(t==="end"||t==="right")&&(i+=o),{h:r,w:o,x:i,y:s}}function vpe(e,t,n){var r=e.shadowBlur,o=n.stroked,i=Ws(n.x),s=Ws(n.y),a=Ws(n.w);o&&e.strokeText(t,i,s,a),n.filled&&(r&&o&&(e.shadowBlur=0),e.fillText(t,i,s,a),r&&o&&(e.shadowBlur=r))}function xpe(e,t,n,r){var o=r.textAlign,i=r.color,s=!!i,a=r.font,l=t.length,c=r.textStrokeColor,u=r.textStrokeWidth,d=c&&u,p;if(!(!l||!s&&!d))for(n=ype(n,o,a),e.font=a.string,e.textAlign=o,e.textBaseline="middle",e.shadowBlur=r.textShadowBlur,e.shadowColor=r.textShadowColor,s&&(e.fillStyle=i),d&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=c),p=0,l=t.length;p<l;++p)vpe(e,t[p],{stroked:d,filled:s,w:n.w,x:n.x,y:n.y+n.h*p})}var t8=function(e,t,n,r){var o=this;o._config=e,o._index=r,o._model=null,o._rects=null,o._ctx=t,o._el=n};Qn(t8.prototype,{_modelize:function(e,t,n,r){var o=this,i=o._index,s=Dn(ln([n.font,{}],r,i)),a=ln([n.color,fn.color],r,i);return{align:ln([n.align,"center"],r,i),anchor:ln([n.anchor,"center"],r,i),area:r.chart.chartArea,backgroundColor:ln([n.backgroundColor,null],r,i),borderColor:ln([n.borderColor,null],r,i),borderRadius:ln([n.borderRadius,0],r,i),borderWidth:ln([n.borderWidth,0],r,i),clamp:ln([n.clamp,!1],r,i),clip:ln([n.clip,!1],r,i),color:a,display:e,font:s,lines:t,offset:ln([n.offset,4],r,i),opacity:ln([n.opacity,1],r,i),origin:ppe(o._el,r),padding:ir(ln([n.padding,4],r,i)),positioner:gpe(o._el),rotation:ln([n.rotation,0],r,i)*(Math.PI/180),size:ah.textSize(o._ctx,t,s),textAlign:ln([n.textAlign,"start"],r,i),textShadowBlur:ln([n.textShadowBlur,0],r,i),textShadowColor:ln([n.textShadowColor,a],r,i),textStrokeColor:ln([n.textStrokeColor,a],r,i),textStrokeWidth:ln([n.textStrokeWidth,0],r,i)}},update:function(e){var t=this,n=null,r=null,o=t._index,i=t._config,s,a,l,c=ln([i.display,!0],e,o);c&&(s=e.dataset.data[o],a=Je(Xt(i.formatter,[s,e]),s),l=ct(a)?[]:ah.toTextLines(a),l.length&&(n=t._modelize(c,l,i,e),r=hpe(n))),t._model=n,t._rects=r},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n=this,r=e.ctx,o=n._model,i=n._rects,s;this.visible()&&(r.save(),o.clip&&(s=o.area,r.beginPath(),r.rect(s.left,s.top,s.right-s.left,s.bottom-s.top),r.clip()),r.globalAlpha=ah.bound(0,o.opacity,1),r.translate(Ws(t.x),Ws(t.y)),r.rotate(o.rotation),bpe(r,i.frame,o),xpe(r,o.lines,i.text,o),r.restore())}});var wpe=Number.MIN_SAFE_INTEGER||-9007199254740991,Spe=Number.MAX_SAFE_INTEGER||9007199254740991;function xf(e,t,n){var r=Math.cos(n),o=Math.sin(n),i=t.x,s=t.y;return{x:i+r*(e.x-i)-o*(e.y-s),y:s+o*(e.x-i)+r*(e.y-s)}}function VM(e,t){var n=Spe,r=wpe,o=t.origin,i,s,a,l,c;for(i=0;i<e.length;++i)s=e[i],a=s.x-o.x,l=s.y-o.y,c=t.vx*a+t.vy*l,n=Math.min(n,c),r=Math.max(r,c);return{min:n,max:r}}function km(e,t){var n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r);return{vx:(t.x-e.x)/o,vy:(t.y-e.y)/o,origin:e,ln:o}}var n8=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};Qn(n8.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,n=1,r=t._rect;return e=xf(e,t.center(),-t._rotation),!(e.x<r.x-n||e.y<r.y-n||e.x>r.x+r.w+n*2||e.y>r.y+r.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),r=[km(t[0],t[1]),km(t[0],t[3])],o,i,s;for(this._rotation!==e._rotation&&r.push(km(n[0],n[1]),km(n[0],n[3])),o=0;o<r.length;++o)if(i=VM(t,r[o]),s=VM(n,r[o]),i.max<s.min||s.max<i.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,r=e.center();return[xf({x:t.x,y:t.y},r,n),xf({x:t.x+t.w,y:t.y},r,n),xf({x:t.x+t.w,y:t.y+t.h},r,n),xf({x:t.x,y:t.y+t.h},r,n)]}});function r8(e,t,n){var r=t.positioner(e,t),o=r.vx,i=r.vy;if(!o&&!i)return{x:r.x,y:r.y};var s=n.w,a=n.h,l=t.rotation,c=Math.abs(s/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),u=Math.abs(s/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),d=1/Math.max(Math.abs(o),Math.abs(i));return c*=o*d,u*=i*d,c+=t.offset*o,u+=t.offset*i,{x:r.x+c,y:r.y+u}}function _pe(e,t){var n,r,o,i;for(n=e.length-1;n>=0;--n)for(o=e[n].$layout,r=n-1;r>=0&&o._visible;--r)i=e[r].$layout,i._visible&&o._box.intersects(i._box)&&t(o,i);return e}function Cpe(e){var t,n,r,o,i,s,a;for(t=0,n=e.length;t<n;++t)r=e[t],o=r.$layout,o._visible&&(a=new Proxy(r._el,{get:(l,c)=>l.getProps([c],!0)[c]}),i=r.geometry(),s=r8(a,r.model(),i),o._box.update(s,i,r.rotation()));return _pe(e,function(l,c){var u=l._hidable,d=c._hidable;u&&d||d?c._visible=!1:u&&(l._visible=!1)})}var lh={prepare:function(e){var t=[],n,r,o,i,s;for(n=0,o=e.length;n<o;++n)for(r=0,i=e[n].length;r<i;++r)s=e[n][r],t.push(s),s.$layout={_box:new n8,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,l){var c=a.$layout,u=l.$layout;return c._idx===u._idx?u._set-c._set:u._idx-c._idx}),this.update(t),t},update:function(e){var t=!1,n,r,o,i,s;for(n=0,r=e.length;n<r;++n)o=e[n],i=o.model(),s=o.$layout,s._hidable=i&&i.display==="auto",s._visible=o.visible(),t|=s._hidable;t&&Cpe(e)},lookup:function(e,t){var n,r;for(n=e.length-1;n>=0;--n)if(r=e[n].$layout,r&&r._visible&&r._box.contains(t))return e[n];return null},draw:function(e,t){var n,r,o,i,s,a;for(n=0,r=t.length;n<r;++n)o=t[n],i=o.$layout,i._visible&&(s=o.geometry(),a=r8(o._el,o.model(),s),i._box.update(a,s,o.rotation()),o.draw(e,a))}},Epe=function(e){if(ct(e))return null;var t=e,n,r,o;if(Ct(e))if(!ct(e.label))t=e.label;else if(!ct(e.r))t=e.r;else for(t="",n=Object.keys(e),o=0,r=n.length;o<r;++o)t+=(o!==0?", ":"")+n[o]+": "+e[n[o]];return""+t},Rpe={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:Epe,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},Qr="$datalabels",o8="$default";function Ppe(e,t){var n=e.datalabels,r={},o=[],i,s;return n===!1?null:(n===!0&&(n={}),t=Qn({},[t,n]),i=t.labels||{},s=Object.keys(i),delete t.labels,s.length?s.forEach(function(a){i[a]&&o.push(Qn({},[t,i[a],{_key:a}]))}):o.push(t),r=o.reduce(function(a,l){return Ht(l.listeners||{},function(c,u){a[u]=a[u]||{},a[u][l._key||o8]=c}),delete l.listeners,a},{}),{labels:o,listeners:r})}function XS(e,t,n,r){if(t){var o=n.$context,i=n.$groups,s;t[i._set]&&(s=t[i._set][i._key],s&&Xt(s,[o,r])===!0&&(e[Qr]._dirty=!0,n.update(o)))}}function Tpe(e,t,n,r,o){var i,s;!n&&!r||(n?r?n!==r&&(s=i=!0):s=!0:i=!0,s&&XS(e,t.leave,n,o),i&&XS(e,t.enter,r,o))}function kpe(e,t){var n=e[Qr],r=n._listeners,o,i;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")i=lh.lookup(n._labels,t);else if(t.type!=="mouseout")return;o=n._hovered,n._hovered=i,Tpe(e,r,o,i,t)}}function Ape(e,t){var n=e[Qr],r=n._listeners.click,o=r&&lh.lookup(n._labels,t);o&&XS(e,r,o,t)}var Ope={id:"datalabels",defaults:Rpe,beforeInit:function(e){e[Qr]={_actives:[]}},beforeUpdate:function(e){var t=e[Qr];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,o=e[Qr],i=o._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=Ppe(a,n),c=t.meta.data||[],u=e.ctx,d,p,h,m,b,v,x,w;for(u.save(),d=0,h=c.length;d<h;++d)if(x=c[d],x[Qr]=[],s&&x&&e.getDataVisibility(d)&&!x.skip)for(p=0,m=l.labels.length;p<m;++p)b=l.labels[p],v=b._key,w=new t8(b,u,x,d),w.$groups={_set:r,_key:v||o8},w.$context={active:!1,chart:e,dataIndex:d,dataset:a,datasetIndex:r},w.update(w.$context),x[Qr].push(w),i.push(w);u.restore(),Qn(o._listeners,l.listeners,{merger:function(_,R,C){R[_]=R[_]||{},R[_][t.index]=C[_],o._listened=!0}})},afterUpdate:function(e){e[Qr]._labels=lh.prepare(e[Qr]._datasets)},afterDatasetsDraw:function(e){lh.draw(e,e[Qr]._labels)},beforeEvent:function(e,t){if(e[Qr]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":kpe(e,n);break;case"click":Ape(e,n);break}}},afterEvent:function(e){var t=e[Qr],n=t._actives,r=t._actives=e.getActiveElements(),o=ah.arrayDiff(n,r),i,s,a,l,c,u,d;for(i=0,s=o.length;i<s;++i)if(c=o[i],c[1])for(d=c[0].element[Qr]||[],a=0,l=d.length;a<l;++a)u=d[a],u.$context.active=c[1]===1,u.update(u.$context);(t._dirty||o.length)&&(lh.update(t._labels),e.render()),delete t._dirty}};yn.register(...ise);yn.register(Ope);yn.register(Jl);yn.register(Rd);yn.register(Pd);yn.register(qs);yn.register(Ac);yn.register(za);yn.register(Ba);yn.register(Tb);yn.register(RF);function YE({cfg:e,onDatapointClick:t}){var d;const[n,r]=T.useState(""),o=be(p=>p.selectedLensId),i=T.useRef(null),[s,a]=T.useState(),l=be(p=>p.themeStyle);T.useEffect(()=>{if(i.current){const p=window.getComputedStyle(i.current);r(p.fontFamily)}},[]),T.useEffect(()=>{var b,v,x,w;if(!n)return;(v=(b=l==null?void 0:l.chart)==null?void 0:b.font)!=null&&v.family&&(yn.defaults.font={...yn.defaults.font,...(x=l==null?void 0:l.chart)==null?void 0:x.font,family:n});const p={...e,options:{...e.options,responsive:!0,maintainAspectRatio:!1}},h=(w=i==null?void 0:i.current)==null?void 0:w.getContext("2d");if(!h)return;let m;try{const _=dce(p,h);m=new yn(h,_),a(m)}catch(_){console.log("error creating chart",_)}return()=>{m&&m.destroy()}},[(d=l==null?void 0:l.chart)==null?void 0:d.font,o,n]);function c(p){var m,b;if(!s)return;const h=s==null?void 0:s.getElementsAtEventForMode(p,"nearest",{intersect:!0},!0);if(h&&h.length>0){const v=h[0].datasetIndex,x=h[0].index,w=(b=(m=h[0].element)==null?void 0:m.$context)==null?void 0:b.raw;t==null||t(s,v,x,w)}}const u=e.type==="doughnut"||e.type==="pie";return y.jsx("div",{onClick:c,className:ge("relative h-[99%]",{"mx-14":u}),children:y.jsx("canvas",{ref:i})})}function Mpe(e,t){return P.useReducer((n,r)=>t[n][r]??n,e)}var KE="ScrollArea",[i8,cOe]=Vn(KE),[Ipe,ii]=i8(KE),s8=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=P.useState(null),[c,u]=P.useState(null),[d,p]=P.useState(null),[h,m]=P.useState(null),[b,v]=P.useState(null),[x,w]=P.useState(0),[_,R]=P.useState(0),[C,E]=P.useState(!1),[A,M]=P.useState(!1),N=et(t,F=>l(F)),L=Rc(o);return y.jsx(Ipe,{scope:n,type:r,dir:L,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:d,onContentChange:p,scrollbarX:h,onScrollbarXChange:m,scrollbarXEnabled:C,onScrollbarXEnabledChange:E,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:A,onScrollbarYEnabledChange:M,onCornerWidthChange:w,onCornerHeightChange:R,children:y.jsx(Oe.div,{dir:L,...s,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});s8.displayName=KE;var a8="ScrollAreaViewport",l8=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,s=ii(a8,n),a=P.useRef(null),l=et(t,a,s.onViewportChange);return y.jsxs(y.Fragment,{children:[y.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),y.jsx(Oe.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:y.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});l8.displayName=a8;var hs="ScrollAreaScrollbar",XE=P.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ii(hs,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return P.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?y.jsx(Dpe,{...r,ref:t,forceMount:n}):o.type==="scroll"?y.jsx(Npe,{...r,ref:t,forceMount:n}):o.type==="auto"?y.jsx(c8,{...r,ref:t,forceMount:n}):o.type==="always"?y.jsx(QE,{...r,ref:t}):null});XE.displayName=hs;var Dpe=P.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ii(hs,e.__scopeScrollArea),[i,s]=P.useState(!1);return P.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),y.jsx(Ln,{present:n||i,children:y.jsx(c8,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Npe=P.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ii(hs,e.__scopeScrollArea),i=e.orientation==="horizontal",s=_y(()=>l("SCROLL_END"),100),[a,l]=Mpe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return P.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),P.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let d=c[u];const p=()=>{const h=c[u];d!==h&&(l("SCROLL"),s()),d=h};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[o.viewport,i,l,s]),y.jsx(Ln,{present:n||a!=="hidden",children:y.jsx(QE,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ce(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Ce(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),c8=P.forwardRef((e,t)=>{const n=ii(hs,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=P.useState(!1),a=e.orientation==="horizontal",l=_y(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return gd(n.viewport,l),gd(n.content,l),y.jsx(Ln,{present:r||i,children:y.jsx(QE,{"data-state":i?"visible":"hidden",...o,ref:t})})}),QE=P.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=ii(hs,e.__scopeScrollArea),i=P.useRef(null),s=P.useRef(0),[a,l]=P.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=p8(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function d(p,h){return Bpe(p,s.current,a,h)}return n==="horizontal"?y.jsx(Lpe,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,h=WM(p,a,o.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=d(p,o.dir))}}):n==="vertical"?y.jsx(Fpe,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,h=WM(p,a);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=d(p))}}):null}),Lpe=P.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ii(hs,e.__scopeScrollArea),[s,a]=P.useState(),l=P.useRef(null),c=et(t,l,i.onScrollbarXChange);return P.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),y.jsx(d8,{"data-orientation":"horizontal",...o,ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Sy(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const p=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),m8(p,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Jb(s.paddingLeft),paddingEnd:Jb(s.paddingRight)}})}})}),Fpe=P.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ii(hs,e.__scopeScrollArea),[s,a]=P.useState(),l=P.useRef(null),c=et(t,l,i.onScrollbarYChange);return P.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),y.jsx(d8,{"data-orientation":"vertical",...o,ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Sy(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const p=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),m8(p,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Jb(s.paddingTop),paddingEnd:Jb(s.paddingBottom)}})}})}),[jpe,u8]=i8(hs),d8=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...p}=e,h=ii(hs,n),[m,b]=P.useState(null),v=et(t,N=>b(N)),x=P.useRef(null),w=P.useRef(""),_=h.viewport,R=r.content-r.viewport,C=Bn(u),E=Bn(l),A=_y(d,10);function M(N){if(x.current){const L=N.clientX-x.current.left,F=N.clientY-x.current.top;c({x:L,y:F})}}return P.useEffect(()=>{const N=L=>{const F=L.target;(m==null?void 0:m.contains(F))&&C(L,R)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[_,m,R,C]),P.useEffect(E,[r,E]),gd(m,A),gd(h.content,A),y.jsx(jpe,{scope:n,scrollbar:m,hasThumb:o,onThumbChange:Bn(i),onThumbPointerUp:Bn(s),onThumbPositionChange:E,onThumbPointerDown:Bn(a),children:y.jsx(Oe.div,{...p,ref:v,style:{position:"absolute",...p.style},onPointerDown:Ce(e.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),x.current=m.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),M(N))}),onPointerMove:Ce(e.onPointerMove,M),onPointerUp:Ce(e.onPointerUp,N=>{const L=N.target;L.hasPointerCapture(N.pointerId)&&L.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=w.current,h.viewport&&(h.viewport.style.scrollBehavior=""),x.current=null})})})}),Zb="ScrollAreaThumb",f8=P.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=u8(Zb,e.__scopeScrollArea);return y.jsx(Ln,{present:n||o.hasThumb,children:y.jsx($pe,{ref:t,...r})})}),$pe=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=ii(Zb,n),s=u8(Zb,n),{onThumbPositionChange:a}=s,l=et(t,d=>s.onThumbChange(d)),c=P.useRef(void 0),u=_y(()=>{c.current&&(c.current(),c.current=void 0)},100);return P.useEffect(()=>{const d=i.viewport;if(d){const p=()=>{if(u(),!c.current){const h=Hpe(d,a);c.current=h,a()}};return a(),d.addEventListener("scroll",p),()=>d.removeEventListener("scroll",p)}},[i.viewport,u,a]),y.jsx(Oe.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ce(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),m=d.clientX-h.left,b=d.clientY-h.top;s.onThumbPointerDown({x:m,y:b})}),onPointerUp:Ce(e.onPointerUp,s.onThumbPointerUp)})});f8.displayName=Zb;var ZE="ScrollAreaCorner",h8=P.forwardRef((e,t)=>{const n=ii(ZE,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?y.jsx(zpe,{...e,ref:t}):null});h8.displayName=ZE;var zpe=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=ii(ZE,n),[i,s]=P.useState(0),[a,l]=P.useState(0),c=!!(i&&a);return gd(o.scrollbarX,()=>{var d;const u=((d=o.scrollbarX)==null?void 0:d.offsetHeight)||0;o.onCornerHeightChange(u),l(u)}),gd(o.scrollbarY,()=>{var d;const u=((d=o.scrollbarY)==null?void 0:d.offsetWidth)||0;o.onCornerWidthChange(u),s(u)}),c?y.jsx(Oe.div,{...r,ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Jb(e){return e?parseInt(e,10):0}function p8(e,t){const n=e/t;return isNaN(n)?0:n}function Sy(e){const t=p8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Bpe(e,t,n,r="ltr"){const o=Sy(n),i=o/2,s=t||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return g8([l,c],d)(e)}function WM(e,t,n="ltr"){const r=Sy(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=VS(e,l);return g8([0,s],[0,a])(c)}function g8(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function m8(e,t){return e>0&&e<t}var Hpe=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function _y(e,t){const n=Bn(e),r=P.useRef(0);return P.useEffect(()=>()=>window.clearTimeout(r.current),[]),P.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function gd(e,t){const n=Bn(t);or(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var b8=s8,Vpe=l8,Wpe=h8;const oc=P.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(b8,{ref:r,className:ge("relative overflow-hidden",e),...n,children:[y.jsx(Vpe,{className:"h-full w-full rounded-[inherit]",children:t}),y.jsx(Cp,{}),y.jsx(Wpe,{})]}));oc.displayName=b8.displayName;const Cp=P.forwardRef(({className:e,orientation:t="vertical",...n},r)=>y.jsx(XE,{ref:r,orientation:t,className:ge("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:y.jsx(f8,{className:"relative flex-1 rounded-full bg-border"})}));Cp.displayName=XE.displayName;function Ot(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function lo(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Nr(e,t){const n=Ot(e);return isNaN(t)?lo(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Ei(e,t){const n=Ot(e);if(isNaN(t))return lo(e,NaN);if(!t)return n;const r=n.getDate(),o=lo(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const i=o.getDate();return r>=i?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}function Upe(e,t){const n=+Ot(e);return lo(e,n+t)}const JE=6048e5,Gpe=864e5,qpe=36e5;function UM(e,t){return Upe(e,t*qpe)}let Ype={};function Ep(){return Ype}function os(e,t){var a,l,c,u;const n=Ep(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=Ot(e),i=o.getDay(),s=(i<r?7:0)+i-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function vc(e){return os(e,{weekStartsOn:1})}function y8(e){const t=Ot(e),n=t.getFullYear(),r=lo(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=vc(r),i=lo(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=vc(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function md(e){const t=Ot(e);return t.setHours(0,0,0,0),t}function e0(e){const t=Ot(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function qi(e,t){const n=md(e),r=md(t),o=+n-e0(n),i=+r-e0(r);return Math.round((o-i)/Gpe)}function Kpe(e){const t=y8(e),n=lo(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),vc(n)}function QS(e,t){const n=t*7;return Nr(e,n)}function Xpe(e,t){return Ei(e,t*12)}function Qpe(e){let t;return e.forEach(function(n){const r=Ot(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function Zpe(e){let t;return e.forEach(n=>{const r=Ot(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function io(e,t){const n=md(e),r=md(t);return+n==+r}function eR(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Jpe(e){if(!eR(e)&&typeof e!="number")return!1;const t=Ot(e);return!isNaN(Number(t))}function Dh(e,t){const n=Ot(e),r=Ot(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function ege(e,t,n){const r=os(e,n),o=os(t,n),i=+r-e0(r),s=+o-e0(o);return Math.round((i-s)/JE)}function tR(e){const t=Ot(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function so(e){const t=Ot(e);return t.setDate(1),t.setHours(0,0,0,0),t}function v8(e){const t=Ot(e),n=lo(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function nR(e,t){var a,l,c,u;const n=Ep(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=Ot(e),i=o.getDay(),s=(i<r?-7:0)+6-(i-r);return o.setDate(o.getDate()+s),o.setHours(23,59,59,999),o}function x8(e){return nR(e,{weekStartsOn:1})}const tge={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},nge=(e,t,n)=>{let r;const o=tge[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Sw(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const rge={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},oge={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ige={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},sge={date:Sw({formats:rge,defaultWidth:"full"}),time:Sw({formats:oge,defaultWidth:"full"}),dateTime:Sw({formats:ige,defaultWidth:"full"})},age={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},lge=(e,t,n,r)=>age[e];function wf(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;o=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[s]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const cge={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},uge={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},dge={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},fge={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},hge={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},pge={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},gge=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},mge={ordinalNumber:gge,era:wf({values:cge,defaultWidth:"wide"}),quarter:wf({values:uge,defaultWidth:"wide",argumentCallback:e=>e-1}),month:wf({values:dge,defaultWidth:"wide"}),day:wf({values:fge,defaultWidth:"wide"}),dayPeriod:wf({values:hge,defaultWidth:"wide",formattingValues:pge,defaultFormattingWidth:"wide"})};function Sf(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?yge(a,d=>d.test(s)):bge(a,d=>d.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(s.length);return{value:c,rest:u}}}function bge(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function yge(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function vge(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;const a=t.slice(o.length);return{value:s,rest:a}}}const xge=/^(\d+)(th|st|nd|rd)?/i,wge=/\d+/i,Sge={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},_ge={any:[/^b/i,/^(a|c)/i]},Cge={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ege={any:[/1/i,/2/i,/3/i,/4/i]},Rge={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Pge={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Tge={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},kge={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Age={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Oge={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Mge={ordinalNumber:vge({matchPattern:xge,parsePattern:wge,valueCallback:e=>parseInt(e,10)}),era:Sf({matchPatterns:Sge,defaultMatchWidth:"wide",parsePatterns:_ge,defaultParseWidth:"any"}),quarter:Sf({matchPatterns:Cge,defaultMatchWidth:"wide",parsePatterns:Ege,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Sf({matchPatterns:Rge,defaultMatchWidth:"wide",parsePatterns:Pge,defaultParseWidth:"any"}),day:Sf({matchPatterns:Tge,defaultMatchWidth:"wide",parsePatterns:kge,defaultParseWidth:"any"}),dayPeriod:Sf({matchPatterns:Age,defaultMatchWidth:"any",parsePatterns:Oge,defaultParseWidth:"any"})},w8={code:"en-US",formatDistance:nge,formatLong:sge,formatRelative:lge,localize:mge,match:Mge,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ige(e){const t=Ot(e);return qi(t,v8(t))+1}function S8(e){const t=Ot(e),n=+vc(t)-+Kpe(t);return Math.round(n/JE)+1}function _8(e,t){var u,d,p,h;const n=Ot(e),r=n.getFullYear(),o=Ep(),i=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(p=o.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,s=lo(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=os(s,t),l=lo(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=os(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function Dge(e,t){var a,l,c,u;const n=Ep(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,o=_8(e,t),i=lo(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),os(i,t)}function C8(e,t){const n=Ot(e),r=+os(n,t)-+Dge(n,t);return Math.round(r/JE)+1}function qt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const fa={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return qt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):qt(n+1,2)},d(e,t){return qt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return qt(e.getHours()%12||12,t.length)},H(e,t){return qt(e.getHours(),t.length)},m(e,t){return qt(e.getMinutes(),t.length)},s(e,t){return qt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return qt(o,t.length)}},iu={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},GM={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return fa.y(e,t)},Y:function(e,t,n,r){const o=_8(e,r),i=o>0?o:1-o;if(t==="YY"){const s=i%100;return qt(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):qt(i,t.length)},R:function(e,t){const n=y8(e);return qt(n,t.length)},u:function(e,t){const n=e.getFullYear();return qt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return qt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return qt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return fa.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return qt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=C8(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):qt(o,t.length)},I:function(e,t,n){const r=S8(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):qt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):fa.d(e,t)},D:function(e,t,n){const r=Ige(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):qt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return qt(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return qt(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return qt(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=iu.noon:r===0?o=iu.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=iu.evening:r>=12?o=iu.afternoon:r>=4?o=iu.morning:o=iu.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return fa.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):fa.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):qt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):qt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):fa.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):fa.s(e,t)},S:function(e,t){return fa.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return YM(r);case"XXXX":case"XX":return El(r);case"XXXXX":case"XXX":default:return El(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return YM(r);case"xxxx":case"xx":return El(r);case"xxxxx":case"xxx":default:return El(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+qM(r,":");case"OOOO":default:return"GMT"+El(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+qM(r,":");case"zzzz":default:return"GMT"+El(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return qt(r,t.length)},T:function(e,t,n){const r=e.getTime();return qt(r,t.length)}};function qM(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+qt(i,2)}function YM(e,t){return e%60===0?(e>0?"-":"+")+qt(Math.abs(e)/60,2):El(e,t)}function El(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=qt(Math.trunc(r/60),2),i=qt(r%60,2);return n+o+t+i}const KM=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},E8=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Nge=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return KM(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",KM(r,t)).replace("{{time}}",E8(o,t))},Lge={p:E8,P:Nge},Fge=/^D+$/,jge=/^Y+$/,$ge=["D","DD","YY","YYYY"];function zge(e){return Fge.test(e)}function Bge(e){return jge.test(e)}function Hge(e,t,n){const r=Vge(e,t,n);if(console.warn(r),$ge.includes(e))throw new RangeError(r)}function Vge(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Wge=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Uge=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Gge=/^'([^]*?)'?$/,qge=/''/g,Yge=/[a-zA-Z]/;function Zi(e,t,n){var u,d,p,h,m,b,v,x;const r=Ep(),o=(n==null?void 0:n.locale)??r.locale??w8,i=(n==null?void 0:n.firstWeekContainsDate)??((d=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(p=r.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((b=(m=n==null?void 0:n.locale)==null?void 0:m.options)==null?void 0:b.weekStartsOn)??r.weekStartsOn??((x=(v=r.locale)==null?void 0:v.options)==null?void 0:x.weekStartsOn)??0,a=Ot(e);if(!Jpe(a))throw new RangeError("Invalid time value");let l=t.match(Uge).map(w=>{const _=w[0];if(_==="p"||_==="P"){const R=Lge[_];return R(w,o.formatLong)}return w}).join("").match(Wge).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const _=w[0];if(_==="'")return{isToken:!1,value:Kge(w)};if(GM[_])return{isToken:!0,value:w};if(_.match(Yge))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:w}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map(w=>{if(!w.isToken)return w.value;const _=w.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Bge(_)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&zge(_))&&Hge(_,t,String(e));const R=GM[_[0]];return R(a,_,o.localize,c)}).join("")}function Kge(e){const t=e.match(Gge);return t?t[1].replace(qge,"'"):e}function Xge(e){const t=Ot(e),n=t.getFullYear(),r=t.getMonth(),o=lo(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function Qge(e){return Math.trunc(+Ot(e)/1e3)}function Zge(e){const t=Ot(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function Jge(e,t){return ege(Zge(e),so(e),t)+1}function ZS(e,t){const n=Ot(e),r=Ot(t);return n.getTime()>r.getTime()}function R8(e,t){const n=Ot(e),r=Ot(t);return+n<+r}function rR(e,t){const n=Ot(e),r=Ot(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function eme(e,t){const n=Ot(e),r=Ot(t);return n.getFullYear()===r.getFullYear()}function _w(e,t){return Nr(e,-t)}function Cw(e,t){const n=Ot(e),r=n.getFullYear(),o=n.getDate(),i=lo(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=Xge(i);return n.setMonth(t,Math.min(o,s)),n}function XM(e,t){const n=Ot(e);return isNaN(+n)?lo(e,NaN):(n.setFullYear(t),n)}var Xe=function(){return Xe=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Xe.apply(this,arguments)};function tme(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function P8(e,t,n){for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function Rp(e){return e.mode==="multiple"}function Pp(e){return e.mode==="range"}function Cy(e){return e.mode==="single"}var nme={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function rme(e,t){return Zi(e,"LLLL y",t)}function ome(e,t){return Zi(e,"d",t)}function ime(e,t){return Zi(e,"LLLL",t)}function sme(e){return"".concat(e)}function ame(e,t){return Zi(e,"cccccc",t)}function lme(e,t){return Zi(e,"yyyy",t)}var cme=Object.freeze({__proto__:null,formatCaption:rme,formatDay:ome,formatMonthCaption:ime,formatWeekNumber:sme,formatWeekdayName:ame,formatYearCaption:lme}),ume=function(e,t,n){return Zi(e,"do MMMM (EEEE)",n)},dme=function(){return"Month: "},fme=function(){return"Go to next month"},hme=function(){return"Go to previous month"},pme=function(e,t){return Zi(e,"cccc",t)},gme=function(e){return"Week n. ".concat(e)},mme=function(){return"Year: "},bme=Object.freeze({__proto__:null,labelDay:ume,labelMonthDropdown:dme,labelNext:fme,labelPrevious:hme,labelWeekNumber:gme,labelWeekday:pme,labelYearDropdown:mme});function yme(){var e="buttons",t=nme,n=w8,r={},o={},i=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:cme,labels:bme,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:s,today:a,mode:"default"}}function vme(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=so(r):t&&(i=new Date(t,0,1)),o?s=tR(o):n&&(s=new Date(n,11,31)),{fromDate:i?md(i):void 0,toDate:s?md(s):void 0}}var T8=T.createContext(void 0);function xme(e){var t,n=e.initialProps,r=yme(),o=vme(n),i=o.fromDate,s=o.toDate,a=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;a!=="buttons"&&(!i||!s)&&(a="buttons");var l;(Cy(n)||Rp(n)||Pp(n))&&(l=n.onSelect);var c=Xe(Xe(Xe({},r),n),{captionLayout:a,classNames:Xe(Xe({},r.classNames),n.classNames),components:Xe({},n.components),formatters:Xe(Xe({},r.formatters),n.formatters),fromDate:i,labels:Xe(Xe({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Xe(Xe({},r.modifiers),n.modifiers),modifiersClassNames:Xe(Xe({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:Xe(Xe({},r.styles),n.styles),toDate:s});return y.jsx(T8.Provider,{value:c,children:e.children})}function on(){var e=T.useContext(T8);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function k8(e){var t=on(),n=t.locale,r=t.classNames,o=t.styles,i=t.formatters.formatCaption;return y.jsx("div",{className:r.caption_label,style:o.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function wme(e){return y.jsx("svg",Xe({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:y.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function A8(e){var t,n,r=e.onChange,o=e.value,i=e.children,s=e.caption,a=e.className,l=e.style,c=on(),u=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:wme;return y.jsxs("div",{className:a,style:l,children:[y.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),y.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:r,children:i}),y.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[s,y.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function Sme(e){var t,n=on(),r=n.fromDate,o=n.toDate,i=n.styles,s=n.locale,a=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r)return y.jsx(y.Fragment,{});if(!o)return y.jsx(y.Fragment,{});var d=[];if(eme(r,o))for(var p=so(r),h=r.getMonth();h<=o.getMonth();h++)d.push(Cw(p,h));else for(var p=so(new Date),h=0;h<=11;h++)d.push(Cw(p,h));var m=function(v){var x=Number(v.target.value),w=Cw(so(e.displayMonth),x);e.onChange(w)},b=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:A8;return y.jsx(b,{name:"months","aria-label":u(),className:l.dropdown_month,style:i.dropdown_month,onChange:m,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:d.map(function(v){return y.jsx("option",{value:v.getMonth(),children:a(v,{locale:s})},v.getMonth())})})}function _me(e){var t,n=e.displayMonth,r=on(),o=r.fromDate,i=r.toDate,s=r.locale,a=r.styles,l=r.classNames,c=r.components,u=r.formatters.formatYearCaption,d=r.labels.labelYearDropdown,p=[];if(!o)return y.jsx(y.Fragment,{});if(!i)return y.jsx(y.Fragment,{});for(var h=o.getFullYear(),m=i.getFullYear(),b=h;b<=m;b++)p.push(XM(v8(new Date),b));var v=function(w){var _=XM(so(n),Number(w.target.value));e.onChange(_)},x=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:A8;return y.jsx(x,{name:"years","aria-label":d(),className:l.dropdown_year,style:a.dropdown_year,onChange:v,value:n.getFullYear(),caption:u(n,{locale:s}),children:p.map(function(w){return y.jsx("option",{value:w.getFullYear(),children:u(w,{locale:s})},w.getFullYear())})})}function Cme(e,t){var n=T.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function Eme(e){var t=e.month,n=e.defaultMonth,r=e.today,o=t||n||r||new Date,i=e.toDate,s=e.fromDate,a=e.numberOfMonths,l=a===void 0?1:a;if(i&&Dh(i,o)<0){var c=-1*(l-1);o=Ei(i,c)}return s&&Dh(o,s)<0&&(o=s),so(o)}function Rme(){var e=on(),t=Eme(e),n=Cme(t,e.month),r=n[0],o=n[1],i=function(s){var a;if(!e.disableNavigation){var l=so(s);o(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,i]}function Pme(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=so(e),i=so(Ei(o,r)),s=Dh(i,o),a=[],l=0;l<s;l++){var c=Ei(o,l);a.push(c)}return n&&(a=a.reverse()),a}function Tme(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,s=r?i:1,a=so(e);if(!n)return Ei(a,s);var l=Dh(n,e);if(!(l<i))return Ei(a,s)}}function kme(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,s=r?i:1,a=so(e);if(!n)return Ei(a,-s);var l=Dh(a,n);if(!(l<=0))return Ei(a,-s)}}var O8=T.createContext(void 0);function Ame(e){var t=on(),n=Rme(),r=n[0],o=n[1],i=Pme(r,t),s=Tme(r,t),a=kme(r,t),l=function(d){return i.some(function(p){return rR(d,p)})},c=function(d,p){l(d)||(p&&R8(d,p)?o(Ei(d,1+t.numberOfMonths*-1)):o(d))},u={currentMonth:r,displayMonths:i,goToMonth:o,goToDate:c,previousMonth:a,nextMonth:s,isDateDisplayed:l};return y.jsx(O8.Provider,{value:u,children:e.children})}function Tp(){var e=T.useContext(O8);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function QM(e){var t,n=on(),r=n.classNames,o=n.styles,i=n.components,s=Tp().goToMonth,a=function(u){s(Ei(u,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:k8,c=y.jsx(l,{id:e.id,displayMonth:e.displayMonth});return y.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[y.jsx("div",{className:r.vhidden,children:c}),y.jsx(Sme,{onChange:a,displayMonth:e.displayMonth}),y.jsx(_me,{onChange:a,displayMonth:e.displayMonth})]})}function Ome(e){return y.jsx("svg",Xe({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:y.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function Mme(e){return y.jsx("svg",Xe({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:y.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var t0=T.forwardRef(function(e,t){var n=on(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var s=i.join(" "),a=Xe(Xe({},o.button_reset),o.button);return e.style&&Object.assign(a,e.style),y.jsx("button",Xe({},e,{ref:t,type:"button",className:s,style:a}))});function Ime(e){var t,n,r=on(),o=r.dir,i=r.locale,s=r.classNames,a=r.styles,l=r.labels,c=l.labelPrevious,u=l.labelNext,d=r.components;if(!e.nextMonth&&!e.previousMonth)return y.jsx(y.Fragment,{});var p=c(e.previousMonth,{locale:i}),h=[s.nav_button,s.nav_button_previous].join(" "),m=u(e.nextMonth,{locale:i}),b=[s.nav_button,s.nav_button_next].join(" "),v=(t=d==null?void 0:d.IconRight)!==null&&t!==void 0?t:Mme,x=(n=d==null?void 0:d.IconLeft)!==null&&n!==void 0?n:Ome;return y.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&y.jsx(t0,{name:"previous-month","aria-label":p,className:h,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:o==="rtl"?y.jsx(v,{className:s.nav_icon,style:a.nav_icon}):y.jsx(x,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&y.jsx(t0,{name:"next-month","aria-label":m,className:b,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?y.jsx(x,{className:s.nav_icon,style:a.nav_icon}):y.jsx(v,{className:s.nav_icon,style:a.nav_icon})})]})}function ZM(e){var t=on().numberOfMonths,n=Tp(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(m){return rR(e.displayMonth,m)}),l=a===0,c=a===s.length-1,u=t>1&&(l||!c),d=t>1&&(c||!l),p=function(){r&&i(r)},h=function(){o&&i(o)};return y.jsx(Ime,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:d,nextMonth:o,previousMonth:r,onPreviousClick:p,onNextClick:h})}function Dme(e){var t,n=on(),r=n.classNames,o=n.disableNavigation,i=n.styles,s=n.captionLayout,a=n.components,l=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:k8,c;return o?c=y.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=y.jsx(QM,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=y.jsxs(y.Fragment,{children:[y.jsx(QM,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),y.jsx(ZM,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=y.jsxs(y.Fragment,{children:[y.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),y.jsx(ZM,{displayMonth:e.displayMonth,id:e.id})]}),y.jsx("div",{className:r.caption,style:i.caption,children:c})}function Nme(e){var t=on(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?y.jsx("tfoot",{className:o,style:r.tfoot,children:y.jsx("tr",{children:y.jsx("td",{colSpan:8,children:n})})}):y.jsx(y.Fragment,{})}function Lme(e,t,n){for(var r=n?vc(new Date):os(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=Nr(r,i);o.push(s)}return o}function Fme(){var e=on(),t=e.classNames,n=e.styles,r=e.showWeekNumber,o=e.locale,i=e.weekStartsOn,s=e.ISOWeek,a=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=Lme(o,i,s);return y.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&y.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(u,d){return y.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(u,{locale:o}),children:a(u,{locale:o})},d)})]})}function jme(){var e,t=on(),n=t.classNames,r=t.styles,o=t.components,i=(e=o==null?void 0:o.HeadRow)!==null&&e!==void 0?e:Fme;return y.jsx("thead",{style:r.head,className:n.head,children:y.jsx(i,{})})}function $me(e){var t=on(),n=t.locale,r=t.formatters.formatDay;return y.jsx(y.Fragment,{children:r(e.date,{locale:n})})}var oR=T.createContext(void 0);function zme(e){if(!Rp(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return y.jsx(oR.Provider,{value:t,children:e.children})}return y.jsx(Bme,{initialProps:e.initialProps,children:e.children})}function Bme(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,i=t.max,s=function(c,u,d){var p,h;(p=t.onDayClick)===null||p===void 0||p.call(t,c,u,d);var m=!!(u.selected&&o&&(r==null?void 0:r.length)===o);if(!m){var b=!!(!u.selected&&i&&(r==null?void 0:r.length)===i);if(!b){var v=r?P8([],r):[];if(u.selected){var x=v.findIndex(function(w){return io(c,w)});v.splice(x,1)}else v.push(c);(h=t.onSelect)===null||h===void 0||h.call(t,v,c,u,d)}}},a={disabled:[]};r&&a.disabled.push(function(c){var u=i&&r.length>i-1,d=r.some(function(p){return io(p,c)});return!!(u&&!d)});var l={selected:r,onDayClick:s,modifiers:a};return y.jsx(oR.Provider,{value:l,children:n})}function iR(){var e=T.useContext(oR);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function Hme(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?io(o,e)&&io(r,e)?void 0:io(o,e)?{from:o,to:void 0}:io(r,e)?void 0:ZS(r,e)?{from:e,to:o}:{from:r,to:e}:o?ZS(e,o)?{from:o,to:e}:{from:e,to:o}:r?R8(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var sR=T.createContext(void 0);function Vme(e){if(!Pp(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return y.jsx(sR.Provider,{value:t,children:e.children})}return y.jsx(Wme,{initialProps:e.initialProps,children:e.children})}function Wme(e){var t=e.initialProps,n=e.children,r=t.selected,o=r||{},i=o.from,s=o.to,a=t.min,l=t.max,c=function(h,m,b){var v,x;(v=t.onDayClick)===null||v===void 0||v.call(t,h,m,b);var w=Hme(h,r);(x=t.onSelect)===null||x===void 0||x.call(t,w,h,m,b)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],s?(u.range_end=[s],io(i,s)||(u.range_middle=[{after:i,before:s}])):u.range_end=[i]):s&&(u.range_start=[s],u.range_end=[s]),a&&(i&&!s&&u.disabled.push({after:_w(i,a-1),before:Nr(i,a-1)}),i&&s&&u.disabled.push({after:i,before:Nr(i,a-1)}),!i&&s&&u.disabled.push({after:_w(s,a-1),before:Nr(s,a-1)})),l){if(i&&!s&&(u.disabled.push({before:Nr(i,-l+1)}),u.disabled.push({after:Nr(i,l-1)})),i&&s){var d=qi(s,i)+1,p=l-d;u.disabled.push({before:_w(i,p)}),u.disabled.push({after:Nr(s,p)})}!i&&s&&(u.disabled.push({before:Nr(s,-l+1)}),u.disabled.push({after:Nr(s,l-1)}))}return y.jsx(sR.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function aR(){var e=T.useContext(sR);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function ib(e){return Array.isArray(e)?P8([],e):e!==void 0?[e]:[]}function Ume(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=ib(o)}),t}var Ri;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Ri||(Ri={}));var Gme=Ri.Selected,Ps=Ri.Disabled,qme=Ri.Hidden,Yme=Ri.Today,Ew=Ri.RangeEnd,Rw=Ri.RangeMiddle,Pw=Ri.RangeStart,Kme=Ri.Outside;function Xme(e,t,n){var r,o=(r={},r[Gme]=ib(e.selected),r[Ps]=ib(e.disabled),r[qme]=ib(e.hidden),r[Yme]=[e.today],r[Ew]=[],r[Rw]=[],r[Pw]=[],r[Kme]=[],r);return e.fromDate&&o[Ps].push({before:e.fromDate}),e.toDate&&o[Ps].push({after:e.toDate}),Rp(e)?o[Ps]=o[Ps].concat(t.modifiers[Ps]):Pp(e)&&(o[Ps]=o[Ps].concat(n.modifiers[Ps]),o[Pw]=n.modifiers[Pw],o[Rw]=n.modifiers[Rw],o[Ew]=n.modifiers[Ew]),o}var M8=T.createContext(void 0);function Qme(e){var t=on(),n=iR(),r=aR(),o=Xme(t,n,r),i=Ume(t.modifiers),s=Xe(Xe({},o),i);return y.jsx(M8.Provider,{value:s,children:e.children})}function I8(){var e=T.useContext(M8);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Zme(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Jme(e){return!!(e&&typeof e=="object"&&"from"in e)}function ebe(e){return!!(e&&typeof e=="object"&&"after"in e)}function tbe(e){return!!(e&&typeof e=="object"&&"before"in e)}function nbe(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function rbe(e,t){var n,r=t.from,o=t.to;if(r&&o){var i=qi(o,r)<0;i&&(n=[o,r],r=n[0],o=n[1]);var s=qi(e,r)>=0&&qi(o,e)>=0;return s}return o?io(o,e):r?io(r,e):!1}function obe(e){return eR(e)}function ibe(e){return Array.isArray(e)&&e.every(eR)}function sbe(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(obe(n))return io(e,n);if(ibe(n))return n.includes(e);if(Jme(n))return rbe(e,n);if(nbe(n))return n.dayOfWeek.includes(e.getDay());if(Zme(n)){var r=qi(n.before,e),o=qi(n.after,e),i=r>0,s=o<0,a=ZS(n.before,n.after);return a?s&&i:i||s}return ebe(n)?qi(e,n.after)>0:tbe(n)?qi(n.before,e)>0:typeof n=="function"?n(e):!1})}function lR(e,t,n){var r=Object.keys(t).reduce(function(i,s){var a=t[s];return sbe(e,a)&&i.push(s),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!rR(e,n)&&(o.outside=!0),o}function abe(e,t){for(var n=so(e[0]),r=tR(e[e.length-1]),o,i,s=n;s<=r;){var a=lR(s,t),l=!a.disabled&&!a.hidden;if(!l){s=Nr(s,1);continue}if(a.selected)return s;a.today&&!i&&(i=s),o||(o=s),s=Nr(s,1)}return i||o}var lbe=365;function D8(e,t){var n=t.moveBy,r=t.direction,o=t.context,i=t.modifiers,s=t.retry,a=s===void 0?{count:0,lastFocused:e}:s,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,d=o.locale,p={day:Nr,week:QS,month:Ei,year:Xpe,startOfWeek:function(v){return o.ISOWeek?vc(v):os(v,{locale:d,weekStartsOn:l})},endOfWeek:function(v){return o.ISOWeek?x8(v):nR(v,{locale:d,weekStartsOn:l})}},h=p[n](e,r==="after"?1:-1);r==="before"&&c?h=Qpe([c,h]):r==="after"&&u&&(h=Zpe([u,h]));var m=!0;if(i){var b=lR(h,i);m=!b.disabled&&!b.hidden}return m?h:a.count>lbe?a.lastFocused:D8(h,{moveBy:n,direction:r,context:o,modifiers:i,retry:Xe(Xe({},a),{count:a.count+1})})}var N8=T.createContext(void 0);function cbe(e){var t=Tp(),n=I8(),r=T.useState(),o=r[0],i=r[1],s=T.useState(),a=s[0],l=s[1],c=abe(t.displayMonths,n),u=o??(a&&t.isDateDisplayed(a))?a:c,d=function(){l(o),i(void 0)},p=function(v){i(v)},h=on(),m=function(v,x){if(o){var w=D8(o,{moveBy:v,direction:x,context:h,modifiers:n});io(o,w)||(t.goToDate(w,o),p(w))}},b={focusedDay:o,focusTarget:u,blur:d,focus:p,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return y.jsx(N8.Provider,{value:b,children:e.children})}function cR(){var e=T.useContext(N8);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function ube(e,t){var n=I8(),r=lR(e,n,t);return r}var uR=T.createContext(void 0);function dbe(e){if(!Cy(e.initialProps)){var t={selected:void 0};return y.jsx(uR.Provider,{value:t,children:e.children})}return y.jsx(fbe,{initialProps:e.initialProps,children:e.children})}function fbe(e){var t=e.initialProps,n=e.children,r=function(i,s,a){var l,c,u;if((l=t.onDayClick)===null||l===void 0||l.call(t,i,s,a),s.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,i,s,a);return}(u=t.onSelect)===null||u===void 0||u.call(t,i,i,s,a)},o={selected:t.selected,onDayClick:r};return y.jsx(uR.Provider,{value:o,children:n})}function L8(){var e=T.useContext(uR);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function hbe(e,t){var n=on(),r=L8(),o=iR(),i=aR(),s=cR(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,d=s.blur,p=s.focus,h=s.focusMonthBefore,m=s.focusMonthAfter,b=s.focusYearBefore,v=s.focusYearAfter,x=s.focusStartOfWeek,w=s.focusEndOfWeek,_=function($){var V,X,I,q;Cy(n)?(V=r.onDayClick)===null||V===void 0||V.call(r,e,t,$):Rp(n)?(X=o.onDayClick)===null||X===void 0||X.call(o,e,t,$):Pp(n)?(I=i.onDayClick)===null||I===void 0||I.call(i,e,t,$):(q=n.onDayClick)===null||q===void 0||q.call(n,e,t,$)},R=function($){var V;p(e),(V=n.onDayFocus)===null||V===void 0||V.call(n,e,t,$)},C=function($){var V;d(),(V=n.onDayBlur)===null||V===void 0||V.call(n,e,t,$)},E=function($){var V;(V=n.onDayMouseEnter)===null||V===void 0||V.call(n,e,t,$)},A=function($){var V;(V=n.onDayMouseLeave)===null||V===void 0||V.call(n,e,t,$)},M=function($){var V;(V=n.onDayPointerEnter)===null||V===void 0||V.call(n,e,t,$)},N=function($){var V;(V=n.onDayPointerLeave)===null||V===void 0||V.call(n,e,t,$)},L=function($){var V;(V=n.onDayTouchCancel)===null||V===void 0||V.call(n,e,t,$)},F=function($){var V;(V=n.onDayTouchEnd)===null||V===void 0||V.call(n,e,t,$)},z=function($){var V;(V=n.onDayTouchMove)===null||V===void 0||V.call(n,e,t,$)},Z=function($){var V;(V=n.onDayTouchStart)===null||V===void 0||V.call(n,e,t,$)},G=function($){var V;(V=n.onDayKeyUp)===null||V===void 0||V.call(n,e,t,$)},j=function($){var V;switch($.key){case"ArrowLeft":$.preventDefault(),$.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":$.preventDefault(),$.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":$.preventDefault(),$.stopPropagation(),c();break;case"ArrowUp":$.preventDefault(),$.stopPropagation(),u();break;case"PageUp":$.preventDefault(),$.stopPropagation(),$.shiftKey?b():h();break;case"PageDown":$.preventDefault(),$.stopPropagation(),$.shiftKey?v():m();break;case"Home":$.preventDefault(),$.stopPropagation(),x();break;case"End":$.preventDefault(),$.stopPropagation(),w();break}(V=n.onDayKeyDown)===null||V===void 0||V.call(n,e,t,$)},H={onClick:_,onFocus:R,onBlur:C,onKeyDown:j,onKeyUp:G,onMouseEnter:E,onMouseLeave:A,onPointerEnter:M,onPointerLeave:N,onTouchCancel:L,onTouchEnd:F,onTouchMove:z,onTouchStart:Z};return H}function pbe(){var e=on(),t=L8(),n=iR(),r=aR(),o=Cy(e)?t.selected:Rp(e)?n.selected:Pp(e)?r.selected:void 0;return o}function gbe(e){return Object.values(Ri).includes(e)}function mbe(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var o=e.modifiersClassNames[r];if(o)n.push(o);else if(gbe(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function bbe(e,t){var n=Xe({},e.styles.day);return Object.keys(t).forEach(function(r){var o;n=Xe(Xe({},n),(o=e.modifiersStyles)===null||o===void 0?void 0:o[r])}),n}function ybe(e,t,n){var r,o,i,s=on(),a=cR(),l=ube(e,t),c=hbe(e,l),u=pbe(),d=!!(s.onDayClick||s.mode!=="default");T.useEffect(function(){var E;l.outside||a.focusedDay&&d&&io(a.focusedDay,e)&&((E=n.current)===null||E===void 0||E.focus())},[a.focusedDay,e,n,d,l.outside]);var p=mbe(s,l).join(" "),h=bbe(s,l),m=!!(l.outside&&!s.showOutsideDays||l.hidden),b=(i=(o=s.components)===null||o===void 0?void 0:o.DayContent)!==null&&i!==void 0?i:$me,v=y.jsx(b,{date:e,displayMonth:t,activeModifiers:l}),x={style:h,className:p,children:v,role:"gridcell"},w=a.focusTarget&&io(a.focusTarget,e)&&!l.outside,_=a.focusedDay&&io(a.focusedDay,e),R=Xe(Xe(Xe({},x),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=_||w?0:-1,r)),c),C={isButton:d,isHidden:m,activeModifiers:l,selectedDays:u,buttonProps:R,divProps:x};return C}function vbe(e){var t=T.useRef(null),n=ybe(e.date,e.displayMonth,t);return n.isHidden?y.jsx("div",{role:"gridcell"}):n.isButton?y.jsx(t0,Xe({name:"day",ref:t},n.buttonProps)):y.jsx("div",Xe({},n.divProps))}function xbe(e){var t=e.number,n=e.dates,r=on(),o=r.onWeekNumberClick,i=r.styles,s=r.classNames,a=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,u=c(Number(t),{locale:a});if(!o)return y.jsx("span",{className:s.weeknumber,style:i.weeknumber,children:u});var d=l(Number(t),{locale:a}),p=function(h){o(t,n,h)};return y.jsx(t0,{name:"week-number","aria-label":d,className:s.weeknumber,style:i.weeknumber,onClick:p,children:u})}function wbe(e){var t,n,r=on(),o=r.styles,i=r.classNames,s=r.showWeekNumber,a=r.components,l=(t=a==null?void 0:a.Day)!==null&&t!==void 0?t:vbe,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:xbe,u;return s&&(u=y.jsx("td",{className:i.cell,style:o.cell,children:y.jsx(c,{number:e.weekNumber,dates:e.dates})})),y.jsxs("tr",{className:i.row,style:o.row,children:[u,e.dates.map(function(d){return y.jsx("td",{className:i.cell,style:o.cell,role:"presentation",children:y.jsx(l,{displayMonth:e.displayMonth,date:d})},Qge(d))})]})}function JM(e,t,n){for(var r=n!=null&&n.ISOWeek?x8(t):nR(t,n),o=n!=null&&n.ISOWeek?vc(e):os(e,n),i=qi(r,o),s=[],a=0;a<=i;a++)s.push(Nr(o,a));var l=s.reduce(function(c,u){var d=n!=null&&n.ISOWeek?S8(u):C8(u,n),p=c.find(function(h){return h.weekNumber===d});return p?(p.dates.push(u),c):(c.push({weekNumber:d,dates:[u]}),c)},[]);return l}function Sbe(e,t){var n=JM(so(e),tR(e),t);if(t!=null&&t.useFixedWeeks){var r=Jge(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=QS(i,6-r),a=JM(QS(i,1),s,t);n.push.apply(n,a)}}return n}function _be(e){var t,n,r,o=on(),i=o.locale,s=o.classNames,a=o.styles,l=o.hideHead,c=o.fixedWeeks,u=o.components,d=o.weekStartsOn,p=o.firstWeekContainsDate,h=o.ISOWeek,m=Sbe(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:h,locale:i,weekStartsOn:d,firstWeekContainsDate:p}),b=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:jme,v=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:wbe,x=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:Nme;return y.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&y.jsx(b,{}),y.jsx("tbody",{className:s.tbody,style:a.tbody,children:m.map(function(w){return y.jsx(v,{displayMonth:e.displayMonth,dates:w.dates,weekNumber:w.weekNumber},w.weekNumber)})}),y.jsx(x,{displayMonth:e.displayMonth})]})}function Cbe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Ebe=Cbe()?T.useLayoutEffect:T.useEffect,Tw=!1,Rbe=0;function eI(){return"react-day-picker-".concat(++Rbe)}function Pbe(e){var t,n=e??(Tw?eI():null),r=T.useState(n),o=r[0],i=r[1];return Ebe(function(){o===null&&i(eI())},[]),T.useEffect(function(){Tw===!1&&(Tw=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function Tbe(e){var t,n,r=on(),o=r.dir,i=r.classNames,s=r.styles,a=r.components,l=Tp().displayMonths,c=Pbe(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),u=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,d=[i.month],p=s.month,h=e.displayIndex===0,m=e.displayIndex===l.length-1,b=!h&&!m;o==="rtl"&&(t=[h,m],m=t[0],h=t[1]),h&&(d.push(i.caption_start),p=Xe(Xe({},p),s.caption_start)),m&&(d.push(i.caption_end),p=Xe(Xe({},p),s.caption_end)),b&&(d.push(i.caption_between),p=Xe(Xe({},p),s.caption_between));var v=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:Dme;return y.jsxs("div",{className:d.join(" "),style:p,children:[y.jsx(v,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),y.jsx(_be,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function kbe(e){var t=on(),n=t.classNames,r=t.styles;return y.jsx("div",{className:n.months,style:r.months,children:e.children})}function Abe(e){var t,n,r=e.initialProps,o=on(),i=cR(),s=Tp(),a=T.useState(!1),l=a[0],c=a[1];T.useEffect(function(){o.initialFocus&&i.focusTarget&&(l||(i.focus(i.focusTarget),c(!0)))},[o.initialFocus,l,i.focus,i.focusTarget,i]);var u=[o.classNames.root,o.className];o.numberOfMonths>1&&u.push(o.classNames.multiple_months),o.showWeekNumber&&u.push(o.classNames.with_weeknumber);var d=Xe(Xe({},o.styles.root),o.style),p=Object.keys(r).filter(function(m){return m.startsWith("data-")}).reduce(function(m,b){var v;return Xe(Xe({},m),(v={},v[b]=r[b],v))},{}),h=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:kbe;return y.jsx("div",Xe({className:u.join(" "),style:d,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},p,{children:y.jsx(h,{children:s.displayMonths.map(function(m,b){return y.jsx(Tbe,{displayIndex:b,displayMonth:m},b)})})}))}function Obe(e){var t=e.children,n=tme(e,["children"]);return y.jsx(xme,{initialProps:n,children:y.jsx(Ame,{children:y.jsx(dbe,{initialProps:n,children:y.jsx(zme,{initialProps:n,children:y.jsx(Vme,{initialProps:n,children:y.jsx(Qme,{children:y.jsx(cbe,{children:t})})})})})})})}function Mbe(e){return y.jsx(Obe,Xe({},e,{children:y.jsx(Abe,{initialProps:e})}))}function F8({className:e,classNames:t,showOutsideDays:n=!0,...r}){return y.jsx(Mbe,{showOutsideDays:n,className:ge("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:ge(Ih({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:ge(Ih({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...o})=>y.jsx(jC,{...o,className:"h-4 w-4"}),IconRight:({...o})=>y.jsx(V0,{...o,className:"h-4 w-4"})},...r})}F8.displayName="Calendar";function j8(e){const{authToken:t}=Do(),n=be(R=>R.authToken),r=t||n,o=be(R=>R.dashboard.filters),i=be(R=>R.selectedSheetId),s=be(R=>R.filterValues),[a,l]=T.useState(!0),c=o==null?void 0:o.filter(R=>R.sheetId===i||!R.sheetId),u=s==null?void 0:s.filter(R=>(c==null?void 0:c.some(C=>C.id===R.filterId))||R.filterId.endsWith(i));function d(R){return a?{allowQuery:!0,filterValues:R.filter(A=>A.filterId!==e.id)}:(R==null?void 0:R.find(E=>E.filterId===e.id))?{allowQuery:!1,filterValues:R}:{allowQuery:!0,filterValues:R}}const{allowQuery:p,filterValues:h}=d(u||[]),{data:m,isLoading:b,isFetching:v,isError:x,refetch:w,isSuccess:_}=rp({queryKey:["filter",e.id,e.sql,JSON.stringify(h)],queryFn:()=>_0("https://semaphor.cloud/api/v1/query",(r==null?void 0:r.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:h,cache_config:J_({filter:e})}),enabled:!!e.sql&&!!e.connectionId&&p&&!!(r!=null&&r.accessToken),placeholderData:R=>R});return T.useEffect(()=>{_&&a&&l(!1)},[_,a]),{data:m,isLoading:b,isFetching:v,isError:x,refetch:w}}function Ibe(e){const t=be(o=>{var i,s;return(s=(i=o.dashboard)==null?void 0:i.filters)==null?void 0:s.find(a=>a.id===e)}),{setDateRange:n,...r}=$8(t||{});return r}function $8(e){const[t,n]=T.useState(),[r,o]=T.useState(),i=be(m=>m.filterValues),s=be(m=>m.actions.addOrUpdateFilterValue),{removeFilterValues:a}=An(),{data:l,isLoading:c,isFetching:u,isError:d}=j8(e);T.useEffect(()=>{var m;if(((m=l==null?void 0:l.records)==null?void 0:m.length)>0){const b=l.records[0];if(!b.min||!b.max)return;n({from:new Date(b.min),to:new Date(b.max)}),o({from:new Date(b.min),to:new Date(b.max)})}},[l]),T.useEffect(()=>{var m;if(i){const b=i.find(v=>v.filterId===e.id);if(!b)n(r);else if(((m=b.values)==null?void 0:m.length)===2){const[v,x]=b.values;n({from:v?new Date(v):void 0,to:x?new Date(x):void 0})}}},[i,e.id,r]);function p(){a(e.id),n(r)}function h(m){if(!m)return;let b=[m==null?void 0:m.from,m==null?void 0:m.to];m.from&&m.to===void 0?b=[m.from,UM(m.from,24)]:m.from&&m.to&&m.from.getTime()===m.to.getTime()?b=[m.from,UM(m.to,24)]:b=[m.from,m.to],n({from:b[0],to:b[1]});const v={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:wu(e),name:e.column,operation:"between",values:b};s(v)}return{records:l==null?void 0:l.records,isLoading:c,isFetching:u,isError:d,initialDateRange:r,dateRange:t,setDateRange:n,handleClear:p,handleChange:h}}function Dbe({filter:e,className:t}){var h,m,b,v,x,w,_,R;const n=be(C=>C.themeStyle),[r,o]=T.useState(!1),{records:i,dateRange:s,isLoading:a,isFetching:l,isError:c,setDateRange:u,handleClear:d,handleChange:p}=$8(e);return a||l?y.jsx("div",{children:y.jsx(_u,{className:"h-8 w-full bg-foreground/10"})}):c?y.jsx("div",{className:"h-8 w-full bg-muted px-2",children:"Error"}):i?y.jsx("div",{className:ge("grid gap-2",t),children:y.jsxs(vy,{open:r,onOpenChange:o,children:[y.jsx(xy,{style:{borderRadius:(m=(h=n==null?void 0:n.chart)==null?void 0:h.options)==null?void 0:m.borderRadius},asChild:!0,children:y.jsxs(Hn,{size:"sm",id:"date",variant:"outline",className:ge("h-[34px] w-full justify-start rounded-sm text-left font-normal",!s&&"text-muted-foreground"),children:[y.jsx(tL,{className:"mr-2 h-4 w-4"}),s!=null&&s.from?s.to?y.jsxs(y.Fragment,{children:[Zi(s.from,"LLL dd, y")," -"," ",Zi(s.to,"LLL dd, y")]}):Zi(s.from,"LLL dd, y"):y.jsx("span",{children:"Pick a date"})]})}),y.jsxs(_p,{style:{borderRadius:(v=(b=n==null?void 0:n.chart)==null?void 0:b.options)==null?void 0:v.borderRadius},className:"w-auto p-0",align:"start",children:[y.jsx("div",{className:"px-4 pt-3",children:y.jsx(cn,{children:e.title})}),y.jsx(F8,{initialFocus:!0,mode:"range",defaultMonth:s==null?void 0:s.from,selected:s,onSelect:u,numberOfMonths:2}),y.jsxs("div",{className:"flex justify-end gap-2 px-4 py-3",children:[y.jsx(Hn,{style:{borderRadius:(w=(x=n==null?void 0:n.chart)==null?void 0:x.options)==null?void 0:w.borderRadius},size:"sm",variant:"outline",onClick:()=>{p(s),o(!1)},children:"Apply"}),y.jsx(Hn,{style:{borderRadius:(R=(_=n==null?void 0:n.chart)==null?void 0:_.options)==null?void 0:R.borderRadius},size:"sm",variant:"outline",onClick:d,children:"Clear"})]})]})]})}):y.jsxs(cn,{className:"w-fulll flex h-8 items-center bg-muted px-2",children:[" ","No Data"]})}const z8=typeof document<"u"?T.useLayoutEffect:()=>{};function Nbe(e){const t=T.useRef(null);return z8(()=>{t.current=e},[e]),T.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const kp=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Nl=e=>e&&"window"in e&&e.window===e?e:kp(e).defaultView||window;function Lbe(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function Fbe(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function B8(e){let t=null;return()=>(t==null&&(t=e()),t)}const jbe=B8(function(){return Fbe(/^Mac/i)}),$be=B8(function(){return Lbe(/Android/i)});function zbe(e){return e.mozInputSource===0&&e.isTrusted?!0:$be()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class Bbe{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function H8(e){let t=T.useRef({isFocused:!1,observer:null});z8(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Nbe(r=>{e==null||e(r)});return T.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,i=s=>{t.current.isFocused=!1,o.disabled&&n(new Bbe("blur",s)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",i,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var s;(s=t.current.observer)===null||s===void 0||s.disconnect();let a=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function Hbe(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=T.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),o&&o(!1),!0},[r,o]),s=H8(i),a=T.useCallback(l=>{const c=kp(l.target);l.target===l.currentTarget&&c.activeElement===l.target&&(n&&n(l),o&&o(!0),s(l))},[o,n,s]);return{focusProps:{onFocus:!t&&(n||o||r)?a:void 0,onBlur:!t&&(r||o)?i:void 0}}}let Ap=null,JS=new Set,ch=new Map,xc=!1,e_=!1;const Vbe={Tab:!0,Escape:!0};function dR(e,t){for(let n of JS)n(e,t)}function Wbe(e){return!(e.metaKey||!jbe()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function n0(e){xc=!0,Wbe(e)&&(Ap="keyboard",dR("keyboard",e))}function Xo(e){Ap="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(xc=!0,dR("pointer",e))}function V8(e){zbe(e)&&(xc=!0,Ap="virtual")}function W8(e){e.target===window||e.target===document||(!xc&&!e_&&(Ap="virtual",dR("virtual",e)),xc=!1,e_=!1)}function U8(){xc=!1,e_=!0}function t_(e){if(typeof window>"u"||ch.get(Nl(e)))return;const t=Nl(e),n=kp(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){xc=!0,r.apply(this,arguments)},n.addEventListener("keydown",n0,!0),n.addEventListener("keyup",n0,!0),n.addEventListener("click",V8,!0),t.addEventListener("focus",W8,!0),t.addEventListener("blur",U8,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Xo,!0),n.addEventListener("pointermove",Xo,!0),n.addEventListener("pointerup",Xo,!0)):(n.addEventListener("mousedown",Xo,!0),n.addEventListener("mousemove",Xo,!0),n.addEventListener("mouseup",Xo,!0)),t.addEventListener("beforeunload",()=>{G8(e)},{once:!0}),ch.set(t,{focus:r})}const G8=(e,t)=>{const n=Nl(e),r=kp(e);t&&r.removeEventListener("DOMContentLoaded",t),ch.has(n)&&(n.HTMLElement.prototype.focus=ch.get(n).focus,r.removeEventListener("keydown",n0,!0),r.removeEventListener("keyup",n0,!0),r.removeEventListener("click",V8,!0),n.removeEventListener("focus",W8,!0),n.removeEventListener("blur",U8,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Xo,!0),r.removeEventListener("pointermove",Xo,!0),r.removeEventListener("pointerup",Xo,!0)):(r.removeEventListener("mousedown",Xo,!0),r.removeEventListener("mousemove",Xo,!0),r.removeEventListener("mouseup",Xo,!0)),ch.delete(n))};function Ube(e){const t=kp(e);let n;return t.readyState!=="loading"?t_(e):(n=()=>{t_(e)},t.addEventListener("DOMContentLoaded",n)),()=>G8(e,n)}typeof document<"u"&&Ube();function q8(){return Ap!=="pointer"}const Gbe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function qbe(e,t,n){var r;const o=typeof window<"u"?Nl(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?Nl(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<"u"?Nl(n==null?void 0:n.target).HTMLElement:HTMLElement,a=typeof window<"u"?Nl(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof o&&!Gbe.has(n==null||(r=n.target)===null||r===void 0?void 0:r.type)||(n==null?void 0:n.target)instanceof i||(n==null?void 0:n.target)instanceof s&&(n==null?void 0:n.target.isContentEditable),!(e&&t==="keyboard"&&n instanceof a&&!Vbe[n.key])}function Ybe(e,t,n){t_(),T.useEffect(()=>{let r=(o,i)=>{qbe(!!(n!=null&&n.isTextInput),o,i)&&e(q8())};return JS.add(r),()=>{JS.delete(r)}},t)}function Kbe(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=T.useRef({isFocusWithin:!1}),s=T.useCallback(c=>{i.current.isFocusWithin&&!c.currentTarget.contains(c.relatedTarget)&&(i.current.isFocusWithin=!1,n&&n(c),o&&o(!1))},[n,o,i]),a=H8(s),l=T.useCallback(c=>{!i.current.isFocusWithin&&document.activeElement===c.target&&(r&&r(c),o&&o(!0),i.current.isFocusWithin=!0,a(c))},[r,o,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:l,onBlur:s}}}let r0=!1,kw=0;function n_(){r0=!0,setTimeout(()=>{r0=!1},50)}function tI(e){e.pointerType==="touch"&&n_()}function Xbe(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",tI):document.addEventListener("touchend",n_),kw++,()=>{kw--,!(kw>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",tI):document.removeEventListener("touchend",n_))}}function Y8(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,s]=T.useState(!1),a=T.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;T.useEffect(Xbe,[]);let{hoverProps:l,triggerHoverEnd:c}=T.useMemo(()=>{let u=(h,m)=>{if(a.pointerType=m,o||m==="touch"||a.isHovered||!h.currentTarget.contains(h.target))return;a.isHovered=!0;let b=h.currentTarget;a.target=b,t&&t({type:"hoverstart",target:b,pointerType:m}),n&&n(!0),s(!0)},d=(h,m)=>{if(a.pointerType="",a.target=null,m==="touch"||!a.isHovered)return;a.isHovered=!1;let b=h.currentTarget;r&&r({type:"hoverend",target:b,pointerType:m}),n&&n(!1),s(!1)},p={};return typeof PointerEvent<"u"?(p.onPointerEnter=h=>{r0&&h.pointerType==="mouse"||u(h,h.pointerType)},p.onPointerLeave=h=>{!o&&h.currentTarget.contains(h.target)&&d(h,h.pointerType)}):(p.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},p.onMouseEnter=h=>{!a.ignoreEmulatedMouseEvents&&!r0&&u(h,"mouse"),a.ignoreEmulatedMouseEvents=!1},p.onMouseLeave=h=>{!o&&h.currentTarget.contains(h.target)&&d(h,"mouse")}),{hoverProps:p,triggerHoverEnd:d}},[t,n,r,o,a]);return T.useEffect(()=>{o&&c({currentTarget:a.target},a.pointerType)},[o]),{hoverProps:l,isHovered:i}}function K8(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=T.useRef({isFocused:!1,isFocusVisible:t||q8()}),[i,s]=T.useState(!1),[a,l]=T.useState(()=>o.current.isFocused&&o.current.isFocusVisible),c=T.useCallback(()=>l(o.current.isFocused&&o.current.isFocusVisible),[]),u=T.useCallback(h=>{o.current.isFocused=h,s(h),c()},[c]);Ybe(h=>{o.current.isFocusVisible=h,c()},[],{isTextInput:n});let{focusProps:d}=Hbe({isDisabled:r,onFocusChange:u}),{focusWithinProps:p}=Kbe({isDisabled:!r,onFocusWithinChange:u});return{isFocused:i,isFocusVisible:a,focusProps:r?p:d}}var Qbe=Object.defineProperty,Zbe=(e,t,n)=>t in e?Qbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Aw=(e,t,n)=>(Zbe(e,typeof t!="symbol"?t+"":t,n),n);let Jbe=class{constructor(){Aw(this,"current",this.detect()),Aw(this,"handoffState","pending"),Aw(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},ic=new Jbe;function Op(e){return ic.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function X8(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function is(){let e=[],t={addEventListener(n,r,o,i){return n.addEventListener(r,o,i),t.add(()=>n.removeEventListener(r,o,i))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return X8(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let i=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:i})})},group(n){let r=is();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function Id(){let[e]=T.useState(is);return T.useEffect(()=>()=>e.dispose(),[e]),e}let Yt=(e,t)=>{ic.isServer?T.useEffect(e,t):T.useLayoutEffect(e,t)};function el(e){let t=T.useRef(e);return Yt(()=>{t.current=e},[e]),t}let Ue=function(e){let t=el(e);return T.useCallback((...n)=>t.current(...n),[t])};function e0e(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function t0e(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function n0e({disabled:e=!1}={}){let t=T.useRef(null),[n,r]=T.useState(!1),o=Id(),i=Ue(()=>{t.current=null,r(!1),o.dispose()}),s=Ue(a=>{if(o.dispose(),t.current===null){t.current=a.currentTarget,r(!0);{let l=Op(a.currentTarget);o.addEventListener(l,"pointerup",i,!1),o.addEventListener(l,"pointermove",c=>{if(t.current){let u=e0e(c);r(t0e(u,t.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:s,onPointerUp:i,onClick:i}}}let r0e=T.createContext(void 0);function fR(){return T.useContext(r0e)}function r_(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Si(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Si),r}var o0=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(o0||{}),Aa=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Aa||{});function No(){let e=i0e();return T.useCallback(t=>o0e({mergeRefs:e,...t}),[e])}function o0e({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:a}){a=a??s0e;let l=Q8(t,e);if(i)return Am(l,n,r,s,a);let c=o??0;if(c&2){let{static:u=!1,...d}=l;if(u)return Am(d,n,r,s,a)}if(c&1){let{unmount:u=!0,...d}=l;return Si(u?0:1,{0(){return null},1(){return Am({...d,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Am(l,n,r,s,a)}function Am(e,t={},n,r,o){let{as:i=n,children:s,refName:a="ref",...l}=Ow(e,["unmount","static"]),c=e.ref!==void 0?{[a]:e.ref}:{},u=typeof s=="function"?s(t):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let d={};if(t){let p=!1,h=[];for(let[m,b]of Object.entries(t))typeof b=="boolean"&&(p=!0),b===!0&&h.push(m.replace(/([A-Z])/g,v=>`-${v.toLowerCase()}`));if(p){d["data-headlessui-state"]=h.join(" ");for(let m of h)d[`data-${m}`]=""}}if(i===T.Fragment&&(Object.keys(ma(l)).length>0||Object.keys(ma(d)).length>0))if(!T.isValidElement(u)||Array.isArray(u)&&u.length>1){if(Object.keys(ma(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(ma(l)).concat(Object.keys(ma(d))).map(p=>` - ${p}`).join(`
|
|
355
|
+
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(p=>` - ${p}`).join(`
|
|
356
|
+
`)].join(`
|
|
357
|
+
`))}else{let p=u.props,h=p==null?void 0:p.className,m=typeof h=="function"?(...x)=>r_(h(...x),l.className):r_(h,l.className),b=m?{className:m}:{},v=Q8(u.props,ma(Ow(l,["ref"])));for(let x in d)x in v&&delete d[x];return T.cloneElement(u,Object.assign({},v,d,c,{ref:o(a0e(u),c.ref)},b))}return T.createElement(i,Object.assign({},Ow(l,["ref"]),i!==T.Fragment&&c,i!==T.Fragment&&d),u)}function i0e(){let e=T.useRef([]),t=T.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function s0e(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function Q8(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var i;return(i=o==null?void 0:o.preventDefault)==null?void 0:i.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...i){let s=n[r];for(let a of s){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;a(o,...i)}}});return t}function hR(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let i=n[r];for(let s of i)s==null||s(...o)}});return t}function co(e){var t;return Object.assign(T.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function ma(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Ow(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function a0e(e){return T.version.split(".")[0]>="19"?e.props.ref:e.ref}function l0e(e,t,n){let[r,o]=T.useState(n),i=e!==void 0,s=T.useRef(i),a=T.useRef(!1),l=T.useRef(!1);return i&&!s.current&&!a.current?(a.current=!0,s.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!i&&s.current&&!l.current&&(l.current=!0,s.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[i?e:r,Ue(c=>(i||o(c),t==null?void 0:t(c)))]}function c0e(e){let[t]=T.useState(e);return t}function Z8(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))ej(n,J8(t,r),o);return n}function J8(e,t){return e?e+"["+t+"]":t}function ej(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())ej(e,J8(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):Z8(n,t,e)}let u0e="span";var pR=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(pR||{});function d0e(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return No()({ourProps:i,theirProps:o,slot:{},defaultTag:u0e,name:"Hidden"})}let tj=co(d0e),f0e=T.createContext(null);function h0e({children:e}){let t=T.useContext(f0e);if(!t)return T.createElement(T.Fragment,null,e);let{target:n}=t;return n?br.createPortal(T.createElement(T.Fragment,null,e),n):null}function p0e({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,s]=T.useState(null),a=Id();return T.useEffect(()=>{if(r&&i)return a.addEventListener(i,"reset",r)},[i,t,r]),T.createElement(h0e,null,T.createElement(g0e,{setForm:s,formId:t}),Z8(e).map(([l,c])=>T.createElement(tj,{features:pR.Hidden,...ma({key:l,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:l,value:c,...o})})))}function g0e({setForm:e,formId:t}){return T.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:T.createElement(tj,{features:pR.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let m0e=T.createContext(void 0);function nj(){return T.useContext(m0e)}function b0e(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&y0e(n)?!1:r}function y0e(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let rj=Symbol();function v0e(e,t=!0){return Object.assign(e,{[rj]:t})}function Pi(...e){let t=T.useRef(e);T.useEffect(()=>{t.current=e},[e]);let n=Ue(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[rj]))?void 0:n}let gR=T.createContext(null);gR.displayName="DescriptionContext";function oj(){let e=T.useContext(gR);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,oj),t}return e}function x0e(){var e,t;return(t=(e=T.useContext(gR))==null?void 0:e.value)!=null?t:void 0}let w0e="p";function S0e(e,t){let n=T.useId(),r=fR(),{id:o=`headlessui-description-${n}`,...i}=e,s=oj(),a=Pi(t);Yt(()=>s.register(o),[o,s.register]);let l=r||!1,c=T.useMemo(()=>({...s.slot,disabled:l}),[s.slot,l]),u={ref:a,...s.props,id:o};return No()({ourProps:u,theirProps:i,slot:c,defaultTag:w0e,name:s.name||"Description"})}let _0e=co(S0e);Object.assign(_0e,{});var Ir=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Ir||{});let Ey=T.createContext(null);Ey.displayName="LabelContext";function ij(){let e=T.useContext(Ey);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,ij),t}return e}function Ry(e){var t,n,r;let o=(n=(t=T.useContext(Ey))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function C0e({inherit:e=!1}={}){let t=Ry(),[n,r]=T.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,T.useMemo(()=>function(i){let s=Ue(l=>(r(c=>[...c,l]),()=>r(c=>{let u=c.slice(),d=u.indexOf(l);return d!==-1&&u.splice(d,1),u}))),a=T.useMemo(()=>({register:s,slot:i.slot,name:i.name,props:i.props,value:i.value}),[s,i.slot,i.name,i.props,i.value]);return T.createElement(Ey.Provider,{value:a},i.children)},[r])]}let E0e="label";function R0e(e,t){var n;let r=T.useId(),o=ij(),i=nj(),s=fR(),{id:a=`headlessui-label-${r}`,htmlFor:l=i??((n=o.props)==null?void 0:n.htmlFor),passive:c=!1,...u}=e,d=Pi(t);Yt(()=>o.register(a),[a,o.register]);let p=Ue(v=>{let x=v.currentTarget;if(x instanceof HTMLLabelElement&&v.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(v),x instanceof HTMLLabelElement){let w=document.getElementById(x.htmlFor);if(w){let _=w.getAttribute("disabled");if(_==="true"||_==="")return;let R=w.getAttribute("aria-disabled");if(R==="true"||R==="")return;(w instanceof HTMLInputElement&&(w.type==="radio"||w.type==="checkbox")||w.role==="radio"||w.role==="checkbox"||w.role==="switch")&&w.click(),w.focus({preventScroll:!0})}}}),h=s||!1,m=T.useMemo(()=>({...o.slot,disabled:h}),[o.slot,h]),b={ref:d,...o.props,id:a,htmlFor:l,onClick:p};return c&&("onClick"in b&&(delete b.htmlFor,delete b.onClick),"onClick"in u&&delete u.onClick),No()({ourProps:b,theirProps:u,slot:m,defaultTag:l?E0e:"div",name:o.name||"Label"})}let P0e=co(R0e),T0e=Object.assign(P0e,{});function su(e,t,n){let r=n.initialDeps??[],o;return()=>{var i,s,a,l;let c;n.key&&((i=n.debug)!=null&&i.call(n))&&(c=Date.now());const u=e();if(!(u.length!==r.length||u.some((h,m)=>r[m]!==h)))return o;r=u;let p;if(n.key&&((s=n.debug)!=null&&s.call(n))&&(p=Date.now()),o=t(...u),n.key&&((a=n.debug)!=null&&a.call(n))){const h=Math.round((Date.now()-c)*100)/100,m=Math.round((Date.now()-p)*100)/100,b=m/16,v=(x,w)=>{for(x=String(x);x.length<w;)x=" "+x;return x};console.info(`%c⏱ ${v(m,5)} /${v(h,5)} ms`,`
|
|
358
|
+
font-size: .6rem;
|
|
359
|
+
font-weight: bold;
|
|
360
|
+
color: hsl(${Math.max(0,Math.min(120-120*b,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(l=n==null?void 0:n.onChange)==null||l.call(n,o),o}}function Mw(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const k0e=(e,t)=>Math.abs(e-t)<1,A0e=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},O0e=e=>e,M0e=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},I0e=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(o(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=()=>{const l=s[0];if(l!=null&&l.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(n.getBoundingClientRect())};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},nI={passive:!0},rI=typeof window>"u"?!0:"onscrollend"in window,D0e=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&rI?()=>{}:A0e(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),s=u=>()=>{const{horizontal:d,isRtl:p}=e.options;o=d?n.scrollLeft*(p&&-1||1):n.scrollTop,i(),t(o,u)},a=s(!0),l=s(!1);l(),n.addEventListener("scroll",a,nI);const c=e.options.useScrollendEvent&&rI;return c&&n.addEventListener("scrollend",l,nI),()=>{n.removeEventListener("scroll",a),c&&n.removeEventListener("scrollend",l)}},N0e=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},L0e=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const s=e+t;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class F0e{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:O0e,rangeExtractor:M0e,onChange:()=>{},measureElement:N0e,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=su(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=su(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,o,i,s)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s}),{key:!1}),this.getMeasurements=su(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s},a)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(u=>{this.itemSizeCache.set(u.key,u.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,l);for(let u=l;u<n;u++){const d=i(u),p=this.options.lanes===1?c[u-1]:this.getFurthestMeasurement(c,u),h=p?p.end+this.options.gap:r+o,m=a.get(d),b=typeof m=="number"?m:this.options.estimateSize(u),v=h+b,x=p?p.lane:u%this.options.lanes;c[u]={index:u,start:h,size:b,end:v,key:d,lane:x}}return this.measurementsCache=c,c},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=su(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?j0e({measurements:n,outerSize:r,scrollOffset:o,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=su(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),i=this.measurementsCache[o];if(!i)return;const s=i.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,s=r-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=su(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return Mw(r[sj(0,r.length-1,o=>Mw(r[o]).start,n)])},this.getOffsetForAlignment=(n,r,o=0)=>{const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&(r=n>=s+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const a=this.options.horizontal?"scrollWidth":"scrollHeight",c=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[a]:this.scrollElement[a]:0)-i;return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const i=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(o.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,o.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const i=this.getOffsetForIndex(n,r);if(!i)return;const[s,a]=i;this._scrollToOffset(s,{adjustments:void 0,behavior:o}),o!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[c]=Mw(this.getOffsetForIndex(n,a));k0e(c,this.getScrollOffset())||this.scrollToIndex(n,{align:a,behavior:o})}else this.scrollToIndex(n,{align:a,behavior:o})}))},this.scrollBy=(n,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;return r.length===0?o=this.options.paddingStart:o=this.options.lanes===1?((n=r[r.length-1])==null?void 0:n.end)??0:Math.max(...r.slice(-this.options.lanes).map(i=>i.end)),Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const sj=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function j0e({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1;let s=sj(0,o,l=>e[l].start,n),a=s;for(;a<o&&e[a].end<n+t;)a++;return r>1&&(s=Math.max(0,s-s%r),a=Math.min(o,a+(r-1-a%r))),{startIndex:s,endIndex:a}}const oI=typeof document<"u"?P.useLayoutEffect:P.useEffect;function $0e(e){const t=P.useReducer(()=>({}),{})[1],n={...e,onChange:(o,i)=>{var s;i?br.flushSync(t):t(),(s=e.onChange)==null||s.call(e,o,i)}},[r]=P.useState(()=>new F0e(n));return r.setOptions(n),oI(()=>r._didMount(),[]),oI(()=>r._willUpdate()),r}function z0e(e){return $0e({observeElementRect:I0e,observeElementOffset:D0e,scrollToFn:L0e,...e})}function B0e(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function H0e(e=B0e){return T.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function V0e(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function iI(e,t=!1){let[n,r]=T.useReducer(()=>({}),{}),o=T.useMemo(()=>V0e(e),[e,n]);return Yt(()=>{if(!e)return;let i=new ResizeObserver(r);return i.observe(e),()=>{i.disconnect()}},[e]),t?{width:`${o.width}px`,height:`${o.height}px`}:o}let W0e=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};function aj(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...i){let s=t[o].call(n,...i);s&&(n=s,r.forEach(a=>a()))}}}function lj(e){return T.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let U0e=new W0e(()=>aj(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let n=this.slice();return n.splice(t,1),n}}));function mR(e,t){let n=U0e.get(t),r=T.useId(),o=lj(n);if(Yt(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let i=o.indexOf(r),s=o.length;return i===-1&&(i=s,s+=1),i===s-1}let o_=new Map,uh=new Map;function sI(e){var t;let n=(t=uh.get(e))!=null?t:0;return uh.set(e,n+1),n!==0?()=>aI(e):(o_.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>aI(e))}function aI(e){var t;let n=(t=uh.get(e))!=null?t:1;if(n===1?uh.delete(e):uh.set(e,n-1),n!==1)return;let r=o_.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,o_.delete(e))}function G0e(e,{allowed:t,disallowed:n}={}){let r=mR(e,"inert-others");Yt(()=>{var o,i;if(!r)return;let s=is();for(let l of(o=n==null?void 0:n())!=null?o:[])l&&s.add(sI(l));let a=(i=t==null?void 0:t())!=null?i:[];for(let l of a){if(!l)continue;let c=Op(l);if(!c)continue;let u=l.parentElement;for(;u&&u!==c.body;){for(let d of u.children)a.some(p=>d.contains(p))||s.add(sI(d));u=u.parentElement}}return s.dispose},[r,t,n])}function q0e(e,t,n){let r=el(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});T.useEffect(()=>{if(!e)return;let o=t===null?null:t instanceof HTMLElement?t:t.current;if(!o)return;let i=is();if(typeof ResizeObserver<"u"){let s=new ResizeObserver(()=>r.current(o));s.observe(o),i.add(()=>s.disconnect())}if(typeof IntersectionObserver<"u"){let s=new IntersectionObserver(()=>r.current(o));s.observe(o),i.add(()=>s.disconnect())}return()=>i.dispose()},[t,r,e])}let i_=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Y0e=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(Y0e||{}),K0e=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(K0e||{}),X0e=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(X0e||{}),cj=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(cj||{});function Q0e(e,t=0){var n;return e===((n=Op(e))==null?void 0:n.body)?!1:Si(t,{0(){return e.matches(i_)},1(){let r=e;for(;r!==null;){if(r.matches(i_))return!0;r=r.parentElement}return!1}})}var Z0e=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Z0e||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function J0e(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),i=t(r);if(o===null||i===null)return 0;let s=o.compareDocumentPosition(i);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function uj(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function eye(){return/Android/gi.test(window.navigator.userAgent)}function dj(){return uj()||eye()}function _f(e,t,n,r){let o=el(n);T.useEffect(()=>{if(!e)return;function i(s){o.current(s)}return document.addEventListener(t,i,r),()=>document.removeEventListener(t,i,r)},[e,t,r])}function tye(e,t,n,r){let o=el(n);T.useEffect(()=>{if(!e)return;function i(s){o.current(s)}return window.addEventListener(t,i,r),()=>window.removeEventListener(t,i,r)},[e,t,r])}const lI=30;function nye(e,t,n){let r=mR(e,"outside-click"),o=el(n),i=T.useCallback(function(l,c){if(l.defaultPrevented)return;let u=c(l);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let d=function p(h){return typeof h=="function"?p(h()):Array.isArray(h)||h instanceof Set?h:[h]}(t);for(let p of d)if(p!==null&&(p.contains(u)||l.composed&&l.composedPath().includes(p)))return;return!Q0e(u,cj.Loose)&&u.tabIndex!==-1&&l.preventDefault(),o.current(l,u)},[o,t]),s=T.useRef(null);_f(r,"pointerdown",l=>{var c,u;s.current=((u=(c=l.composedPath)==null?void 0:c.call(l))==null?void 0:u[0])||l.target},!0),_f(r,"mousedown",l=>{var c,u;s.current=((u=(c=l.composedPath)==null?void 0:c.call(l))==null?void 0:u[0])||l.target},!0),_f(r,"click",l=>{dj()||s.current&&(i(l,()=>s.current),s.current=null)},!0);let a=T.useRef({x:0,y:0});_f(r,"touchstart",l=>{a.current.x=l.touches[0].clientX,a.current.y=l.touches[0].clientY},!0),_f(r,"touchend",l=>{let c={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(c.x-a.current.x)>=lI||Math.abs(c.y-a.current.y)>=lI))return i(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),tye(r,"blur",l=>i(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Py(...e){return T.useMemo(()=>Op(...e),[...e])}function rye(e,t,n,r){let o=el(n);T.useEffect(()=>{e=e??window;function i(s){o.current(s)}return e.addEventListener(t,i,r),()=>e.removeEventListener(t,i,r)},[e,t,r])}function fj(e){let t=T.useRef({value:"",selectionStart:null,selectionEnd:null});return rye(e,"blur",n=>{let r=n.target;r instanceof HTMLInputElement&&(t.current={value:r.value,selectionStart:r.selectionStart,selectionEnd:r.selectionEnd})}),Ue(()=>{if(document.activeElement!==e&&e instanceof HTMLInputElement&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==t.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:n,selectionEnd:r}=t.current;n!==null&&r!==null&&e.setSelectionRange(n,r)}t.current={value:"",selectionStart:null,selectionEnd:null}}})}function oye(e,t){return T.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function iye(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),i=Math.max(0,e-o);n.style(r,"paddingRight",`${i}px`)}}}function sye(){return uj()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(i=>i()).some(i=>i.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let a=is();a.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>a.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,s=null;t.addEventListener(e,"click",a=>{if(a.target instanceof HTMLElement)try{let l=a.target.closest("a");if(!l)return;let{hash:c}=new URL(l.href),u=e.querySelector(c);u&&!r(u)&&(s=u)}catch{}},!0),t.addEventListener(e,"touchstart",a=>{if(a.target instanceof HTMLElement)if(r(a.target)){let l=a.target;for(;l.parentElement&&r(l.parentElement);)l=l.parentElement;t.style(l,"overscrollBehavior","contain")}else t.style(a.target,"touchAction","none")}),t.addEventListener(e,"touchmove",a=>{if(a.target instanceof HTMLElement){if(a.target.tagName==="INPUT")return;if(r(a.target)){let l=a.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()}},{passive:!1}),t.add(()=>{var a;let l=(a=window.scrollY)!=null?a:window.pageYOffset;i!==l&&window.scrollTo(0,i),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{}}function aye(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function lye(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Ll=aj(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:is(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:lye(n)},o=[sye(),iye(),aye()];o.forEach(({before:i})=>i==null?void 0:i(r)),o.forEach(({after:i})=>i==null?void 0:i(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Ll.subscribe(()=>{let e=Ll.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&Ll.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Ll.dispatch("TEARDOWN",n)}});function cye(e,t,n=()=>({containers:[]})){let r=lj(Ll),o=t?r.get(t):void 0,i=o?o.count>0:!1;return Yt(()=>{if(!(!t||!e))return Ll.dispatch("PUSH",t,n),()=>Ll.dispatch("POP",t,n)},[e,t]),i}function uye(e,t,n=()=>[document.body]){let r=mR(e,"scroll-lock");cye(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function cI(e){return[e.screenX,e.screenY]}function dye(){let e=T.useRef([-1,-1]);return{wasMoved(t){let n=cI(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=cI(t)}}}function fye(e=0){let[t,n]=T.useState(e),r=T.useCallback(l=>n(l),[t]),o=T.useCallback(l=>n(c=>c|l),[t]),i=T.useCallback(l=>(t&l)===l,[t]),s=T.useCallback(l=>n(c=>c&~l),[n]),a=T.useCallback(l=>n(c=>c^l),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:s,toggleFlag:a}}var uI,dI;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((uI=process==null?void 0:process.env)==null?void 0:uI.NODE_ENV)==="test"&&typeof((dI=Element==null?void 0:Element.prototype)==null?void 0:dI.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
|
|
361
|
+
`)),[]});var hye=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(hye||{});function hj(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function pj(e,t,n,r){let[o,i]=T.useState(n),{hasFlag:s,addFlag:a,removeFlag:l}=fye(e&&o?3:0),c=T.useRef(!1),u=T.useRef(!1),d=Id();return Yt(()=>{var p;if(e){if(n&&i(!0),!t){n&&a(3);return}return(p=r==null?void 0:r.start)==null||p.call(r,n),pye(t,{inFlight:c,prepare(){u.current?u.current=!1:u.current=c.current,c.current=!0,!u.current&&(n?(a(3),l(4)):(a(4),l(2)))},run(){u.current?n?(l(3),a(4)):(l(4),a(3)):n?l(1):a(1)},done(){var h;u.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(c.current=!1,l(7),n||i(!1),(h=r==null?void 0:r.end)==null||h.call(r,n))}})}},[e,n,t,d]),e?[o,{closed:s(1),enter:s(2),leave:s(4),transition:s(2)||s(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function pye(e,{prepare:t,run:n,done:r,inFlight:o}){let i=is();return mye(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{n(),i.requestAnimationFrame(()=>{i.add(gye(e,r))})}),i.dispose}function gye(e,t){var n,r;let o=is();if(!e)return o.dispose;let i=!1;o.add(()=>{i=!0});let s=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(a=>a instanceof CSSTransition))!=null?r:[];return s.length===0?(t(),o.dispose):(Promise.allSettled(s.map(a=>a.finished)).then(()=>{i||t()}),o.dispose)}function mye(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function bye(e,{container:t,accept:n,walk:r}){let o=T.useRef(n),i=T.useRef(r);T.useEffect(()=>{o.current=n,i.current=r},[n,r]),Yt(()=>{if(!t||!e)return;let s=Op(t);if(!s)return;let a=o.current,l=i.current,c=Object.assign(d=>a(d),{acceptNode:a}),u=s.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,c,!1);for(;u.nextNode();)l(u.currentNode)},[t,e,o,i])}function fI(e,t){let n=T.useRef([]),r=Ue(e);T.useEffect(()=>{let o=[...n.current];for(let[i,s]of t.entries())if(n.current[i]!==s){let a=r(t,o);return n.current=t,a}},[r,...t])}function yye(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const gj={...P},vye=gj.useInsertionEffect,xye=vye||(e=>e());function mj(e){const t=P.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return xye(()=>{t.current=e}),P.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var s_=typeof document<"u"?T.useLayoutEffect:T.useEffect;let hI=!1,wye=0;const pI=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+wye++;function Sye(){const[e,t]=P.useState(()=>hI?pI():void 0);return s_(()=>{e==null&&t(pI())},[]),P.useEffect(()=>{hI=!0},[]),e}const _ye=gj.useId,Cye=_ye||Sye;let Nh;process.env.NODE_ENV!=="production"&&(Nh=new Set);function Eye(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Nh)!=null&&e.has(o))){var i;(i=Nh)==null||i.add(o),console.warn(o)}}function Rye(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Nh)!=null&&e.has(o))){var i;(i=Nh)==null||i.add(o),console.error(o)}}function Pye(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const Tye=P.createContext(null),kye=P.createContext(null),Aye=()=>{var e;return((e=P.useContext(Tye))==null?void 0:e.id)||null},Oye=()=>P.useContext(kye),Mye="data-floating-ui-focusable";function Iye(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Cye(),i=P.useRef({}),[s]=P.useState(()=>Pye()),a=Aye()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!xr(h)&&Rye("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=P.useState(r.reference),u=mj((h,m,b)=>{i.current.openEvent=h?m:void 0,s.emit("openchange",{open:h,event:m,reason:b,nested:a}),n==null||n(h,m,b)}),d=P.useMemo(()=>({setPositionReference:c}),[]),p=P.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return P.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:p,events:s,floatingId:o,refs:d}),[t,u,p,s,o,d])}function Dye(e){e===void 0&&(e={});const{nodeId:t}=e,n=Iye({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=P.useState(null),[a,l]=P.useState(null),u=(o==null?void 0:o.domReference)||i,d=P.useRef(null),p=Oye();s_(()=>{u&&(d.current=u)},[u]);const h=z4({...e,elements:{...o,...a&&{reference:a}}}),m=P.useCallback(_=>{const R=xr(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),contextElement:_}:_;l(R),h.refs.setReference(R)},[h.refs]),b=P.useCallback(_=>{(xr(_)||_===null)&&(d.current=_,s(_)),(xr(h.refs.reference.current)||h.refs.reference.current===null||_!==null&&!xr(_))&&h.refs.setReference(_)},[h.refs]),v=P.useMemo(()=>({...h.refs,setReference:b,setPositionReference:m,domReference:d}),[h.refs,b,m]),x=P.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),w=P.useMemo(()=>({...h,...r,refs:v,elements:x,nodeId:t}),[h,v,x,t,r]);return s_(()=>{r.dataRef.current.floatingContext=w;const _=p==null?void 0:p.nodesRef.current.find(R=>R.id===t);_&&(_.context=w)}),P.useMemo(()=>({...h,context:w,refs:v,elements:x}),[h,v,x,w])}const gI="active",mI="selected";function Iw(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[gI]:s,[mI]:a,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[Mye]:""},...i,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(o&&[gI,mI].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var d;(d=r.get(c))==null||d.push(u),s[c]=function(){for(var p,h=arguments.length,m=new Array(h),b=0;b<h;b++)m[b]=arguments[b];return(p=r.get(c))==null?void 0:p.map(v=>v(...m)).find(v=>v!==void 0)}}}else s[c]=u}),s),{})}}function Nye(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=P.useCallback(a=>Iw(a,e,"reference"),t),i=P.useCallback(a=>Iw(a,e,"floating"),n),s=P.useCallback(a=>Iw(a,e,"item"),r);return P.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}function bI(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const Lye=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:i=0,index:s=0,minItemsVisible:a=4,referenceOverflowThreshold:l=0,scrollRef:c,...u}=ns(e,t),{rects:d,elements:{floating:p}}=t,h=n.current[s],m=(c==null?void 0:c.current)||p,b=p.clientTop||m.clientTop,v=p.clientTop!==0,x=m.clientTop!==0,w=p===m;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||Eye('`placement` side must be "bottom" when using the `inner`',"middleware.")),!h)return{};const _={...t,...await TE(-h.offsetTop-p.clientTop-d.reference.height/2-h.offsetHeight/2-i).fn(t)},R=await Jx(bI(_,m.scrollHeight+b+p.clientTop),u),C=await Jx(_,{...u,elementContext:"reference"}),E=mr(0,R.top),A=_.y+E,L=(m.scrollHeight>m.clientHeight?F=>F:Oh)(mr(0,m.scrollHeight+(v&&w||x?b*2:0)-E-mr(0,R.bottom)));if(m.style.maxHeight=L+"px",m.scrollTop=E,o){const F=m.offsetHeight<h.offsetHeight*Ys(a,n.current.length)-1||C.top>=-l||C.bottom>=-l;lc.flushSync(()=>o(F))}return r&&(r.current=await Jx(bI({..._,y:A},m.offsetHeight+b+p.clientTop),u)),{y:A}}});function Fye(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:s,onChange:a}=t,l=mj(a),c=P.useRef(!1),u=P.useRef(null),d=P.useRef(null);P.useEffect(()=>{if(!o)return;function h(b){if(b.ctrlKey||!m||i.current==null)return;const v=b.deltaY,x=i.current.top>=-.5,w=i.current.bottom>=-.5,_=m.scrollHeight-m.clientHeight,R=v<0?-1:1,C=v<0?"max":"min";m.scrollHeight<=m.clientHeight||(!x&&v>0||!w&&v<0?(b.preventDefault(),lc.flushSync(()=>{l(E=>E+Math[C](v,_*R))})):/firefox/i.test(yye())&&(m.scrollTop+=v))}const m=(s==null?void 0:s.current)||r.floating;if(n&&m)return m.addEventListener("wheel",h),requestAnimationFrame(()=>{u.current=m.scrollTop,i.current!=null&&(d.current={...i.current})}),()=>{u.current=null,d.current=null,m.removeEventListener("wheel",h)}},[o,n,r.floating,i,s,l]);const p=P.useMemo(()=>({onKeyDown(){c.current=!0},onWheel(){c.current=!1},onPointerMove(){c.current=!1},onScroll(){const h=(s==null?void 0:s.current)||r.floating;if(!(!i.current||!h||!c.current)){if(u.current!==null){const m=h.scrollTop-u.current;(i.current.bottom<-.5&&m<-1||i.current.top<-.5&&m>1)&&lc.flushSync(()=>l(b=>b+m))}requestAnimationFrame(()=>{u.current=h.scrollTop})}}}),[r.floating,l,i,s]);return P.useMemo(()=>o?{floating:p}:{},[o,p])}let Mp=T.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Mp.displayName="FloatingContext";let bR=T.createContext(null);bR.displayName="PlacementContext";function jye(e){return T.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function $ye(){return T.useContext(Mp).setReference}function zye(){let{getFloatingProps:e,slot:t}=T.useContext(Mp);return T.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function Bye(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=T.useContext(bR),n=T.useMemo(()=>e,[JSON.stringify(e,(o,i)=>{var s;return(s=i==null?void 0:i.outerHTML)!=null?s:i})]);Yt(()=>{t==null||t(n??null)},[t,n]);let r=T.useContext(Mp);return T.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let yI=4;function Hye({children:e,enabled:t=!0}){let[n,r]=T.useState(null),[o,i]=T.useState(0),s=T.useRef(null),[a,l]=T.useState(null);Vye(a);let c=t&&n!==null&&a!==null,{to:u="bottom",gap:d=0,offset:p=0,padding:h=0,inner:m}=Wye(n,a),[b,v="center"]=u.split(" ");Yt(()=>{c&&i(0)},[c]);let{refs:x,floatingStyles:w,context:_}=Dye({open:c,placement:b==="selection"?v==="center"?"bottom":`bottom-${v}`:v==="center"?`${b}`:`${b}-${v}`,strategy:"absolute",transform:!1,middleware:[TE({mainAxis:b==="selection"?0:d,crossAxis:p}),B4({padding:h}),b!=="selection"&&H4({padding:h}),b==="selection"&&m?Lye({...m,padding:h,overflowRef:s,offset:o,minItemsVisible:yI,referenceOverflowThreshold:h,onFallbackChange(F){var z,Z;if(!F)return;let G=_.elements.floating;if(!G)return;let j=parseFloat(getComputedStyle(G).scrollPaddingBottom)||0,H=Math.min(yI,G.childElementCount),$=0,V=0;for(let X of(Z=(z=_.elements.floating)==null?void 0:z.childNodes)!=null?Z:[])if(X instanceof HTMLElement){let I=X.offsetTop,q=I+X.clientHeight+j,U=G.scrollTop,O=U+G.clientHeight;if(I>=U&&q<=O)H--;else{V=Math.max(0,Math.min(q,O)-Math.max(I,U)),$=X.clientHeight;break}}H>=1&&i(X=>{let I=$*H-V+j;return X>=I?X:I})}}):null,V4({padding:h,apply({availableWidth:F,availableHeight:z,elements:Z}){Object.assign(Z.floating.style,{overflow:"auto",maxWidth:`${F}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${z}px)`})}})].filter(Boolean),whileElementsMounted:j4}),[R=b,C=v]=_.placement.split("-");b==="selection"&&(R="selection");let E=T.useMemo(()=>({anchor:[R,C].filter(Boolean).join(" ")}),[R,C]),A=Fye(_,{overflowRef:s,onChange:i}),{getReferenceProps:M,getFloatingProps:N}=Nye([A]),L=Ue(F=>{l(F),x.setFloating(F)});return P.createElement(bR.Provider,{value:r},P.createElement(Mp.Provider,{value:{setFloating:L,setReference:x.setReference,styles:w,getReferenceProps:M,getFloatingProps:N,slot:E}},e))}function Vye(e){Yt(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function Wye(e,t){var n,r,o;let i=Dw((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),s=Dw((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),a=Dw((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:s,padding:a}}function Dw(e,t,n=void 0){let r=Id(),o=Ue((l,c)=>{if(l==null)return[n,null];if(typeof l=="number")return[l,null];if(typeof l=="string"){if(!c)return[n,null];let u=vI(l,c);return[u,d=>{let p=bj(l);{let h=p.map(m=>window.getComputedStyle(c).getPropertyValue(m));r.requestAnimationFrame(function m(){r.nextFrame(m);let b=!1;for(let[x,w]of p.entries()){let _=window.getComputedStyle(c).getPropertyValue(w);if(h[x]!==_){h[x]=_,b=!0;break}}if(!b)return;let v=vI(l,c);u!==v&&(d(v),u=v)})}return r.dispose}]}return[n,null]}),i=T.useMemo(()=>o(e,t)[0],[e,t]),[s=i,a]=T.useState();return Yt(()=>{let[l,c]=o(e,t);if(a(l),!!c)return c(a)},[e,t]),s}function bj(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),o=t[1].slice(n+1).trim();return o?[r,...bj(o)]:[r]}return[]}function vI(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function Uye({children:e,freeze:t}){let n=a_(t,e);return T.createElement(T.Fragment,null,n)}function a_(e,t){let[n,r]=T.useState(t);return!e&&n!==t&&r(t),e?n:t}let yR=T.createContext(null);yR.displayName="OpenClosedContext";var xi=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(xi||{});function vR(){return T.useContext(yR)}function yj({value:e,children:t}){return T.createElement(yR.Provider,{value:e},t)}function Gye(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Tl=[];Gye(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||Tl[0]===t.target)return;let n=t.target;n=n.closest(i_),Tl.unshift(n??t.target),Tl=Tl.filter(r=>r!=null&&r.isConnected),Tl.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function qye(e){throw new Error("Unexpected object: "+e)}var In=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(In||{});function xI(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let i=0;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 1:{o===-1&&(o=n.length);for(let i=o-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 2:{for(let i=o+1;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 3:{for(let i=n.length-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 4:{for(let i=0;i<n.length;++i)if(t.resolveId(n[i],i,n)===e.id)return i;return r}case 5:return null;default:qye(e)}}var xR=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(xR||{});function Yye(e){let t=Ue(e),n=T.useRef(!1);T.useEffect(()=>(n.current=!1,()=>{n.current=!0,X8(()=>{n.current&&t()})}),[t])}function Kye(){let e=typeof document>"u";return"useSyncExternalStore"in P?(t=>t.useSyncExternalStore)(P)(()=>()=>{},()=>!1,()=>!e):!1}function wR(){let e=Kye(),[t,n]=P.useState(ic.isHandoffComplete);return t&&ic.isHandoffComplete===!1&&n(!1),P.useEffect(()=>{t!==!0&&n(!0)},[t]),P.useEffect(()=>ic.handoff(),[]),e?!1:t}let Xye=T.createContext(!1);function Qye(){return T.useContext(Xye)}function Zye(e){let t=Qye(),n=T.useContext(xj),r=Py(e),[o,i]=T.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(ic.isServer)return null;let a=r==null?void 0:r.getElementById("headlessui-portal-root");if(a)return a;if(r===null)return null;let l=r.createElement("div");return l.setAttribute("id","headlessui-portal-root"),r.body.appendChild(l)});return T.useEffect(()=>{o!==null&&(r!=null&&r.body.contains(o)||r==null||r.body.appendChild(o))},[o,r]),T.useEffect(()=>{t||n!==null&&i(n.current)},[n,i,t]),o}let vj=T.Fragment,Jye=co(function(e,t){let n=e,r=T.useRef(null),o=Pi(v0e(d=>{r.current=d}),t),i=Py(r),s=Zye(r),[a]=T.useState(()=>{var d;return ic.isServer?null:(d=i==null?void 0:i.createElement("div"))!=null?d:null}),l=T.useContext(rve),c=wR();Yt(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),Yt(()=>{if(a&&l)return l.register(a)},[l,a]),Yye(()=>{var d;!s||!a||(a instanceof Node&&s.contains(a)&&s.removeChild(a),s.childNodes.length<=0&&((d=s.parentElement)==null||d.removeChild(s)))});let u=No();return c?!s||!a?null:br.createPortal(u({ourProps:{ref:o},theirProps:n,slot:{},defaultTag:vj,name:"Portal"}),a):null});function eve(e,t){let n=Pi(t),{enabled:r=!0,...o}=e,i=No();return r?T.createElement(Jye,{...o,ref:n}):i({ourProps:{ref:n},theirProps:o,slot:{},defaultTag:vj,name:"Portal"})}let tve=T.Fragment,xj=T.createContext(null);function nve(e,t){let{target:n,...r}=e,o={ref:Pi(t)},i=No();return T.createElement(xj.Provider,{value:n},i({ourProps:o,theirProps:r,defaultTag:tve,name:"Popover.Group"}))}let rve=T.createContext(null),ove=co(eve),ive=co(nve),sve=Object.assign(ove,{Group:ive});var ave=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ave||{}),lve=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(lve||{}),cve=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(cve||{}),uve=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.SetTyping=3]="SetTyping",e[e.RegisterOption=4]="RegisterOption",e[e.UnregisterOption=5]="UnregisterOption",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualConfiguration=7]="UpdateVirtualConfiguration",e[e.SetInputElement=8]="SetInputElement",e[e.SetButtonElement=9]="SetButtonElement",e[e.SetOptionsElement=10]="SetOptionsElement",e))(uve||{});function Nw(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=t(e.options.slice()),o=r.length>0&&r[0].dataRef.current.order!==null?r.sort((s,a)=>s.dataRef.current.order-a.dataRef.current.order):J0e(r,s=>s.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let dve={1(e){var t;return(t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,__demoMode:!1}},0(e){var t,n;if((t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===0)return e;if((n=e.dataRef.current)!=null&&n.value){let r=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(r!==-1)return{...e,activeOptionIndex:r,comboboxState:0,__demoMode:!1}}return{...e,comboboxState:0,__demoMode:!1}},3(e,t){return e.isTyping===t.isTyping?e:{...e,isTyping:t.isTyping}},2(e,t){var n,r,o,i;if((n=e.dataRef.current)!=null&&n.disabled||e.optionsElement&&!((r=e.dataRef.current)!=null&&r.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let{options:c,disabled:u}=e.virtual,d=t.focus===In.Specific?t.idx:xI(t,{resolveItems:()=>c,resolveActiveIndex:()=>{var h,m;return(m=(h=e.activeOptionIndex)!=null?h:c.findIndex(b=>!u(b)))!=null?m:null},resolveDisabled:u,resolveId(){throw new Error("Function not implemented.")}}),p=(o=t.trigger)!=null?o:2;return e.activeOptionIndex===d&&e.activationTrigger===p?e:{...e,activeOptionIndex:d,activationTrigger:p,isTyping:!1,__demoMode:!1}}let s=Nw(e);if(s.activeOptionIndex===null){let c=s.options.findIndex(u=>!u.dataRef.current.disabled);c!==-1&&(s.activeOptionIndex=c)}let a=t.focus===In.Specific?t.idx:xI(t,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled}),l=(i=t.trigger)!=null?i:2;return e.activeOptionIndex===a&&e.activationTrigger===l?e:{...e,...s,isTyping:!1,activeOptionIndex:a,activationTrigger:l,__demoMode:!1}},4:(e,t)=>{var n,r,o;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let i=t.payload,s=Nw(e,l=>(l.push(i),l));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(t.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(i));let a={...e,...s,activationTrigger:2};return(o=e.dataRef.current)!=null&&o.__demoMode&&e.dataRef.current.value===void 0&&(a.activeOptionIndex=0),a},5:(e,t)=>{var n;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:e.options.filter(o=>o.id!==t.id)};let r=Nw(e,o=>{let i=o.findIndex(s=>s.id===t.id);return i!==-1&&o.splice(i,1),o});return{...e,...r,activationTrigger:2}},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n,r;if(e.virtual===null)return{...e,virtual:{options:t.options,disabled:(n=t.disabled)!=null?n:()=>!1}};if(e.virtual.options===t.options&&e.virtual.disabled===t.disabled)return e;let o=e.activeOptionIndex;if(e.activeOptionIndex!==null){let i=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);i!==-1?o=i:o=null}return{...e,activeOptionIndex:o,virtual:{options:t.options,disabled:(r=t.disabled)!=null?r:()=>!1}}},8:(e,t)=>e.inputElement===t.element?e:{...e,inputElement:t.element},9:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},10:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element}},SR=T.createContext(null);SR.displayName="ComboboxActionsContext";function Ip(e){let t=T.useContext(SR);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ip),n}return t}let wj=T.createContext(null);function fve(e){let t=Dd("VirtualProvider"),{options:n}=t.virtual,[r,o]=T.useMemo(()=>{let c=t.optionsElement;if(!c)return[0,0];let u=window.getComputedStyle(c);return[parseFloat(u.paddingBlockStart||u.paddingTop),parseFloat(u.paddingBlockEnd||u.paddingBottom)]},[t.optionsElement]),i=z0e({enabled:n.length!==0,scrollPaddingStart:r,scrollPaddingEnd:o,count:n.length,estimateSize(){return 40},getScrollElement(){return t.optionsElement},overscan:12}),[s,a]=T.useState(0);Yt(()=>{a(c=>c+1)},[n]);let l=i.getVirtualItems();return l.length===0?null:T.createElement(wj.Provider,{value:i},T.createElement("div",{style:{position:"relative",width:"100%",height:`${i.getTotalSize()}px`},ref:c=>{c&&t.activationTrigger!==0&&t.activeOptionIndex!==null&&n.length>t.activeOptionIndex&&i.scrollToIndex(t.activeOptionIndex)}},l.map(c=>{var u;return T.createElement(T.Fragment,{key:c.key},T.cloneElement((u=e.children)==null?void 0:u.call(e,{...e.slot,option:n[c.index]}),{key:`${s}-${c.key}`,"data-index":c.index,"aria-setsize":n.length,"aria-posinset":c.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${c.start}px)`,overflowAnchor:"none"}}))})))}let Lh=T.createContext(null);Lh.displayName="ComboboxDataContext";function Dd(e){let t=T.useContext(Lh);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Dd),n}return t}function hve(e,t){return Si(t.type,dve,e,t)}let pve=T.Fragment;function gve(e,t){var n,r;let o=fR(),{value:i,defaultValue:s,onChange:a,form:l,name:c,by:u,disabled:d=o||!1,onClose:p,__demoMode:h=!1,multiple:m=!1,immediate:b=!1,virtual:v=null,nullable:x,...w}=e,_=c0e(s),[R=m?[]:void 0,C]=l0e(i,a,_),[E,A]=T.useReducer(hve,{dataRef:T.createRef(),comboboxState:h?0:1,isTyping:!1,options:[],virtual:v?{options:v.options,disabled:(n=v.disabled)!=null?n:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:h}),M=T.useRef(!1),N=T.useRef({static:!1,hold:!1}),L=H0e(u),F=Ue(ce=>v?u===null?v.options.indexOf(ce):v.options.findIndex(_e=>L(_e,ce)):E.options.findIndex(_e=>L(_e.dataRef.current.value,ce))),z=T.useCallback(ce=>Si(G.mode,{1:()=>R.some(_e=>L(_e,ce)),0:()=>L(R,ce)}),[R]),Z=Ue(ce=>E.activeOptionIndex===F(ce)),G=T.useMemo(()=>({...E,immediate:b,optionsPropsRef:N,value:R,defaultValue:_,disabled:d,mode:m?1:0,virtual:v?E.virtual:null,get activeOptionIndex(){if(M.current&&E.activeOptionIndex===null&&(v?v.options.length>0:E.options.length>0)){if(v){let _e=v.options.findIndex(Pe=>{var Me,ke;return!((ke=(Me=v.disabled)==null?void 0:Me.call(v,Pe))!=null&&ke)});if(_e!==-1)return _e}let ce=E.options.findIndex(_e=>!_e.dataRef.current.disabled);if(ce!==-1)return ce}return E.activeOptionIndex},calculateIndex:F,compare:L,isSelected:z,isActive:Z}),[R,_,d,m,h,E,v]);Yt(()=>{var ce;v&&A({type:7,options:v.options,disabled:(ce=v.disabled)!=null?ce:null})},[v,v==null?void 0:v.options,v==null?void 0:v.disabled]),Yt(()=>{E.dataRef.current=G},[G]);let j=G.comboboxState===0;nye(j,[G.buttonElement,G.inputElement,G.optionsElement],()=>ee.closeCombobox());let H=T.useMemo(()=>{var ce,_e,Pe;return{open:G.comboboxState===0,disabled:d,activeIndex:G.activeOptionIndex,activeOption:G.activeOptionIndex===null?null:G.virtual?G.virtual.options[(ce=G.activeOptionIndex)!=null?ce:0]:(Pe=(_e=G.options[G.activeOptionIndex])==null?void 0:_e.dataRef.current.value)!=null?Pe:null,value:R}},[G,d,R]),$=Ue(()=>{if(G.activeOptionIndex!==null){if(ee.setIsTyping(!1),G.virtual)O(G.virtual.options[G.activeOptionIndex]);else{let{dataRef:ce}=G.options[G.activeOptionIndex];O(ce.current.value)}ee.goToOption(In.Specific,G.activeOptionIndex)}}),V=Ue(()=>{A({type:0}),M.current=!0}),X=Ue(()=>{A({type:1}),M.current=!1,p==null||p()}),I=Ue(ce=>{A({type:3,isTyping:ce})}),q=Ue((ce,_e,Pe)=>(M.current=!1,ce===In.Specific?A({type:2,focus:In.Specific,idx:_e,trigger:Pe}):A({type:2,focus:ce,trigger:Pe}))),U=Ue((ce,_e)=>(A({type:4,payload:{id:ce,dataRef:_e}}),()=>{G.isActive(_e.current.value)&&(M.current=!0),A({type:5,id:ce})})),O=Ue(ce=>Si(G.mode,{0(){return C==null?void 0:C(ce)},1(){let _e=G.value.slice(),Pe=_e.findIndex(Me=>L(Me,ce));return Pe===-1?_e.push(ce):_e.splice(Pe,1),C==null?void 0:C(_e)}})),J=Ue(ce=>{A({type:6,trigger:ce})}),K=Ue(ce=>{A({type:8,element:ce})}),ne=Ue(ce=>{A({type:9,element:ce})}),Y=Ue(ce=>{A({type:10,element:ce})}),ee=T.useMemo(()=>({onChange:O,registerOption:U,goToOption:q,setIsTyping:I,closeCombobox:X,openCombobox:V,setActivationTrigger:J,selectActiveOption:$,setInputElement:K,setButtonElement:ne,setOptionsElement:Y}),[]),[re,ue]=C0e(),fe=t===null?{}:{ref:t},se=T.useCallback(()=>{if(_!==void 0)return C==null?void 0:C(_)},[C,_]),pe=No();return T.createElement(ue,{value:re,props:{htmlFor:(r=G.inputElement)==null?void 0:r.id},slot:{open:G.comboboxState===0,disabled:d}},T.createElement(Hye,null,T.createElement(SR.Provider,{value:ee},T.createElement(Lh.Provider,{value:G},T.createElement(yj,{value:Si(G.comboboxState,{0:xi.Open,1:xi.Closed})},c!=null&&T.createElement(p0e,{disabled:d,data:R!=null?{[c]:R}:{},form:l,onReset:se}),pe({ourProps:fe,theirProps:w,slot:H,defaultTag:pve,name:"Combobox"}))))))}let mve="input";function bve(e,t){var n,r,o,i,s;let a=Dd("Combobox.Input"),l=Ip("Combobox.Input"),c=T.useId(),u=nj(),{id:d=u||`headlessui-combobox-input-${c}`,onChange:p,displayValue:h,disabled:m=a.disabled||!1,autoFocus:b=!1,type:v="text",...x}=e,w=T.useRef(null),_=Pi(w,t,$ye(),l.setInputElement),R=Py(a.inputElement),C=Id(),E=Ue(()=>{l.onChange(null),a.optionsElement&&(a.optionsElement.scrollTop=0),l.goToOption(In.Nothing)}),A=T.useMemo(()=>{var O;return typeof h=="function"&&a.value!==void 0?(O=h(a.value))!=null?O:"":typeof a.value=="string"?a.value:""},[a.value,h]);fI(([O,J],[K,ne])=>{if(a.isTyping)return;let Y=w.current;Y&&((ne===0&&J===1||O!==K)&&(Y.value=O),requestAnimationFrame(()=>{if(a.isTyping||!Y||(R==null?void 0:R.activeElement)!==Y)return;let{selectionStart:ee,selectionEnd:re}=Y;Math.abs((re??0)-(ee??0))===0&&ee===0&&Y.setSelectionRange(Y.value.length,Y.value.length)}))},[A,a.comboboxState,R,a.isTyping]),fI(([O],[J])=>{if(O===0&&J===1){if(a.isTyping)return;let K=w.current;if(!K)return;let ne=K.value,{selectionStart:Y,selectionEnd:ee,selectionDirection:re}=K;K.value="",K.value=ne,re!==null?K.setSelectionRange(Y,ee,re):K.setSelectionRange(Y,ee)}},[a.comboboxState]);let M=T.useRef(!1),N=Ue(()=>{M.current=!0}),L=Ue(()=>{C.nextFrame(()=>{M.current=!1})}),F=Ue(O=>{switch(l.setIsTyping(!0),O.key){case Ir.Enter:if(a.comboboxState!==0||M.current)return;if(O.preventDefault(),O.stopPropagation(),a.activeOptionIndex===null){l.closeCombobox();return}l.selectActiveOption(),a.mode===0&&l.closeCombobox();break;case Ir.ArrowDown:return O.preventDefault(),O.stopPropagation(),Si(a.comboboxState,{0:()=>l.goToOption(In.Next),1:()=>l.openCombobox()});case Ir.ArrowUp:return O.preventDefault(),O.stopPropagation(),Si(a.comboboxState,{0:()=>l.goToOption(In.Previous),1:()=>{br.flushSync(()=>l.openCombobox()),a.value||l.goToOption(In.Last)}});case Ir.Home:if(O.shiftKey)break;return O.preventDefault(),O.stopPropagation(),l.goToOption(In.First);case Ir.PageUp:return O.preventDefault(),O.stopPropagation(),l.goToOption(In.First);case Ir.End:if(O.shiftKey)break;return O.preventDefault(),O.stopPropagation(),l.goToOption(In.Last);case Ir.PageDown:return O.preventDefault(),O.stopPropagation(),l.goToOption(In.Last);case Ir.Escape:return a.comboboxState!==0?void 0:(O.preventDefault(),a.optionsElement&&!a.optionsPropsRef.current.static&&O.stopPropagation(),a.mode===0&&a.value===null&&E(),l.closeCombobox());case Ir.Tab:if(a.comboboxState!==0)return;a.mode===0&&a.activationTrigger!==1&&l.selectActiveOption(),l.closeCombobox();break}}),z=Ue(O=>{p==null||p(O),a.mode===0&&O.target.value===""&&E(),l.openCombobox()}),Z=Ue(O=>{var J,K,ne;let Y=(J=O.relatedTarget)!=null?J:Tl.find(ee=>ee!==O.currentTarget);if(!((K=a.optionsElement)!=null&&K.contains(Y))&&!((ne=a.buttonElement)!=null&&ne.contains(Y))&&a.comboboxState===0)return O.preventDefault(),a.mode===0&&a.value===null&&E(),l.closeCombobox()}),G=Ue(O=>{var J,K,ne;let Y=(J=O.relatedTarget)!=null?J:Tl.find(ee=>ee!==O.currentTarget);(K=a.buttonElement)!=null&&K.contains(Y)||(ne=a.optionsElement)!=null&&ne.contains(Y)||a.disabled||a.immediate&&a.comboboxState!==0&&C.microTask(()=>{br.flushSync(()=>l.openCombobox()),l.setActivationTrigger(1)})}),j=Ry(),H=x0e(),{isFocused:$,focusProps:V}=K8({autoFocus:b}),{isHovered:X,hoverProps:I}=Y8({isDisabled:m}),q=T.useMemo(()=>({open:a.comboboxState===0,disabled:m,hover:X,focus:$,autofocus:b}),[a,X,$,b,m]),U=hR({ref:_,id:d,role:"combobox",type:v,"aria-controls":(n=a.optionsElement)==null?void 0:n.id,"aria-expanded":a.comboboxState===0,"aria-activedescendant":a.activeOptionIndex===null?void 0:a.virtual?(r=a.options.find(O=>!O.dataRef.current.disabled&&a.compare(O.dataRef.current.value,a.virtual.options[a.activeOptionIndex])))==null?void 0:r.id:(o=a.options[a.activeOptionIndex])==null?void 0:o.id,"aria-labelledby":j,"aria-describedby":H,"aria-autocomplete":"list",defaultValue:(s=(i=e.defaultValue)!=null?i:a.defaultValue!==void 0?h==null?void 0:h(a.defaultValue):null)!=null?s:a.defaultValue,disabled:m||void 0,autoFocus:b,onCompositionStart:N,onCompositionEnd:L,onKeyDown:F,onChange:z,onFocus:G,onBlur:Z},V,I);return No()({ourProps:U,theirProps:x,slot:q,defaultTag:mve,name:"Combobox.Input"})}let yve="button";function vve(e,t){var n;let r=Dd("Combobox.Button"),o=Ip("Combobox.Button"),i=Pi(t,o.setButtonElement),s=T.useId(),{id:a=`headlessui-combobox-button-${s}`,disabled:l=r.disabled||!1,autoFocus:c=!1,...u}=e,d=fj(r.inputElement),p=Ue(A=>{switch(A.key){case Ir.Space:case Ir.Enter:A.preventDefault(),A.stopPropagation(),r.comboboxState===1&&br.flushSync(()=>o.openCombobox()),d();return;case Ir.ArrowDown:A.preventDefault(),A.stopPropagation(),r.comboboxState===1&&(br.flushSync(()=>o.openCombobox()),r.value||o.goToOption(In.First)),d();return;case Ir.ArrowUp:A.preventDefault(),A.stopPropagation(),r.comboboxState===1&&(br.flushSync(()=>o.openCombobox()),r.value||o.goToOption(In.Last)),d();return;case Ir.Escape:if(r.comboboxState!==0)return;A.preventDefault(),r.optionsElement&&!r.optionsPropsRef.current.static&&A.stopPropagation(),br.flushSync(()=>o.closeCombobox()),d();return;default:return}}),h=Ue(A=>{A.preventDefault(),!b0e(A.currentTarget)&&(A.button===xR.Left&&(r.comboboxState===0?o.closeCombobox():o.openCombobox()),d())}),m=Ry([a]),{isFocusVisible:b,focusProps:v}=K8({autoFocus:c}),{isHovered:x,hoverProps:w}=Y8({isDisabled:l}),{pressed:_,pressProps:R}=n0e({disabled:l}),C=T.useMemo(()=>({open:r.comboboxState===0,active:_||r.comboboxState===0,disabled:l,value:r.value,hover:x,focus:b}),[r,x,b,_,l]),E=hR({ref:i,id:a,type:oye(e,r.buttonElement),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(n=r.optionsElement)==null?void 0:n.id,"aria-expanded":r.comboboxState===0,"aria-labelledby":m,disabled:l||void 0,autoFocus:c,onMouseDown:h,onKeyDown:p},v,w,R);return No()({ourProps:E,theirProps:u,slot:C,defaultTag:yve,name:"Combobox.Button"})}let xve="div",wve=o0.RenderStrategy|o0.Static;function Sve(e,t){var n,r,o;let i=T.useId(),{id:s=`headlessui-combobox-options-${i}`,hold:a=!1,anchor:l,portal:c=!1,modal:u=!0,transition:d=!1,...p}=e,h=Dd("Combobox.Options"),m=Ip("Combobox.Options"),b=jye(l);b&&(c=!0);let[v,x]=Bye(b),[w,_]=T.useState(null),R=zye(),C=Pi(t,b?v:null,m.setOptionsElement,_),E=Py(h.optionsElement),A=vR(),[M,N]=pj(d,w,A!==null?(A&xi.Open)===xi.Open:h.comboboxState===0);q0e(M,h.inputElement,m.closeCombobox);let L=h.__demoMode?!1:u&&h.comboboxState===0;uye(L,E);let F=h.__demoMode?!1:u&&h.comboboxState===0;G0e(F,{allowed:T.useCallback(()=>[h.inputElement,h.buttonElement,h.optionsElement],[h.inputElement,h.buttonElement,h.optionsElement])}),Yt(()=>{var U;h.optionsPropsRef.current.static=(U=e.static)!=null?U:!1},[h.optionsPropsRef,e.static]),Yt(()=>{h.optionsPropsRef.current.hold=a},[h.optionsPropsRef,a]),bye(h.comboboxState===0,{container:h.optionsElement,accept(U){return U.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:U.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(U){U.setAttribute("role","none")}});let z=Ry([(n=h.buttonElement)==null?void 0:n.id]),Z=T.useMemo(()=>({open:h.comboboxState===0,option:void 0}),[h.comboboxState]),G=Ue(()=>{m.setActivationTrigger(0)}),j=Ue(U=>{U.preventDefault(),m.setActivationTrigger(0)}),H=hR(b?R():{},{"aria-labelledby":z,role:"listbox","aria-multiselectable":h.mode===1?!0:void 0,id:s,ref:C,style:{...p.style,...x,"--input-width":iI(h.inputElement,!0).width,"--button-width":iI(h.buttonElement,!0).width},onWheel:h.activationTrigger===0?void 0:G,onMouseDown:j,...hj(N)}),$=M&&h.comboboxState===1,V=a_($,(r=h.virtual)==null?void 0:r.options),X=a_($,h.value),I=Ue(U=>h.compare(X,U));if(h.virtual){if(V===void 0)throw new Error("Missing `options` in virtual mode");Object.assign(p,{children:T.createElement(Lh.Provider,{value:V!==h.virtual.options?{...h,virtual:{...h.virtual,options:V}}:h},T.createElement(fve,{slot:Z},p.children))})}let q=No();return T.createElement(sve,{enabled:c?e.static||M:!1},T.createElement(Lh.Provider,{value:h.mode===1?h:{...h,isSelected:I}},q({ourProps:H,theirProps:{...p,children:T.createElement(Uye,{freeze:$},typeof p.children=="function"?(o=p.children)==null?void 0:o.call(p,Z):p.children)},slot:Z,defaultTag:xve,features:wve,visible:M,name:"Combobox.Options"})))}let _ve="div";function Cve(e,t){var n,r,o,i;let s=Dd("Combobox.Option"),a=Ip("Combobox.Option"),l=T.useId(),{id:c=`headlessui-combobox-option-${l}`,value:u,disabled:d=(o=(r=(n=s.virtual)==null?void 0:n.disabled)==null?void 0:r.call(n,u))!=null?o:!1,order:p=null,...h}=e,m=fj(s.inputElement),b=s.virtual?s.activeOptionIndex===s.calculateIndex(u):s.activeOptionIndex===null?!1:((i=s.options[s.activeOptionIndex])==null?void 0:i.id)===c,v=s.isSelected(u),x=T.useRef(null),w=el({disabled:d,value:u,domRef:x,order:p}),_=T.useContext(wj),R=Pi(t,x,_?_.measureElement:null),C=Ue(()=>{a.setIsTyping(!1),a.onChange(u)});Yt(()=>a.registerOption(c,w),[w,c]);let E=T.useRef(!(s.virtual||s.__demoMode));Yt(()=>{if(!s.virtual&&!s.__demoMode)return is().requestAnimationFrame(()=>{E.current=!0})},[s.virtual,s.__demoMode]),Yt(()=>{if(E.current&&s.comboboxState===0&&b&&s.activationTrigger!==0)return is().requestAnimationFrame(()=>{var j,H;(H=(j=x.current)==null?void 0:j.scrollIntoView)==null||H.call(j,{block:"nearest"})})},[x,b,s.comboboxState,s.activationTrigger,s.activeOptionIndex]);let A=Ue(j=>{j.preventDefault(),j.button===xR.Left&&(d||(C(),dj()||requestAnimationFrame(()=>m()),s.mode===0&&a.closeCombobox()))}),M=Ue(()=>{if(d)return a.goToOption(In.Nothing);let j=s.calculateIndex(u);a.goToOption(In.Specific,j)}),N=dye(),L=Ue(j=>N.update(j)),F=Ue(j=>{if(!N.wasMoved(j)||d||b)return;let H=s.calculateIndex(u);a.goToOption(In.Specific,H,0)}),z=Ue(j=>{N.wasMoved(j)&&(d||b&&(s.optionsPropsRef.current.hold||a.goToOption(In.Nothing)))}),Z=T.useMemo(()=>({active:b,focus:b,selected:v,disabled:d}),[b,v,d]),G={id:c,ref:R,role:"option",tabIndex:d===!0?void 0:-1,"aria-disabled":d===!0?!0:void 0,"aria-selected":v,disabled:void 0,onMouseDown:A,onFocus:M,onPointerEnter:L,onMouseEnter:L,onPointerMove:F,onMouseMove:F,onPointerLeave:z,onMouseLeave:z};return No()({ourProps:G,theirProps:h,slot:Z,defaultTag:_ve,name:"Combobox.Option"})}let Eve=co(gve),Sj=co(vve),_j=co(bve),Rve=T0e,Cj=co(Sve),Ej=co(Cve),Pve=Object.assign(Eve,{Input:_j,Button:Sj,Label:Rve,Options:Cj,Option:Ej});function Tve(){let e=T.useRef(!1);return Yt(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Rj(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:Tj)!==T.Fragment||T.Children.count(e.children)===1}let Ty=T.createContext(null);Ty.displayName="TransitionContext";var kve=(e=>(e.Visible="visible",e.Hidden="hidden",e))(kve||{});function Ave(){let e=T.useContext(Ty);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Ove(){let e=T.useContext(ky);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let ky=T.createContext(null);ky.displayName="NestingContext";function Ay(e){return"children"in e?Ay(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Pj(e,t){let n=el(e),r=T.useRef([]),o=Tve(),i=Id(),s=Ue((h,m=Aa.Hidden)=>{let b=r.current.findIndex(({el:v})=>v===h);b!==-1&&(Si(m,{[Aa.Unmount](){r.current.splice(b,1)},[Aa.Hidden](){r.current[b].state="hidden"}}),i.microTask(()=>{var v;!Ay(r)&&o.current&&((v=n.current)==null||v.call(n))}))}),a=Ue(h=>{let m=r.current.find(({el:b})=>b===h);return m?m.state!=="visible"&&(m.state="visible"):r.current.push({el:h,state:"visible"}),()=>s(h,Aa.Unmount)}),l=T.useRef([]),c=T.useRef(Promise.resolve()),u=T.useRef({enter:[],leave:[]}),d=Ue((h,m,b)=>{l.current.splice(0),t&&(t.chains.current[m]=t.chains.current[m].filter(([v])=>v!==h)),t==null||t.chains.current[m].push([h,new Promise(v=>{l.current.push(v)})]),t==null||t.chains.current[m].push([h,new Promise(v=>{Promise.all(u.current[m].map(([x,w])=>w)).then(()=>v())})]),m==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>b(m)):b(m)}),p=Ue((h,m,b)=>{Promise.all(u.current[m].splice(0).map(([v,x])=>x)).then(()=>{var v;(v=l.current.shift())==null||v()}).then(()=>b(m))});return T.useMemo(()=>({children:r,register:a,unregister:s,onStart:d,onStop:p,wait:c,chains:u}),[a,s,r,d,p,u,c])}let Tj=T.Fragment,kj=o0.RenderStrategy;function Mve(e,t){var n,r;let{transition:o=!0,beforeEnter:i,afterEnter:s,beforeLeave:a,afterLeave:l,enter:c,enterFrom:u,enterTo:d,entered:p,leave:h,leaveFrom:m,leaveTo:b,...v}=e,[x,w]=T.useState(null),_=T.useRef(null),R=Rj(e),C=Pi(...R?[_,t,w]:t===null?[]:[t]),E=(n=v.unmount)==null||n?Aa.Unmount:Aa.Hidden,{show:A,appear:M,initial:N}=Ave(),[L,F]=T.useState(A?"visible":"hidden"),z=Ove(),{register:Z,unregister:G}=z;Yt(()=>Z(_),[Z,_]),Yt(()=>{if(E===Aa.Hidden&&_.current){if(A&&L!=="visible"){F("visible");return}return Si(L,{hidden:()=>G(_),visible:()=>Z(_)})}},[L,_,Z,G,A,E]);let j=wR();Yt(()=>{if(R&&j&&L==="visible"&&_.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[_,L,j,R]);let H=N&&!M,$=M&&A&&N,V=T.useRef(!1),X=Pj(()=>{V.current||(F("hidden"),G(_))},z),I=Ue(Y=>{V.current=!0;let ee=Y?"enter":"leave";X.onStart(_,ee,re=>{re==="enter"?i==null||i():re==="leave"&&(a==null||a())})}),q=Ue(Y=>{let ee=Y?"enter":"leave";V.current=!1,X.onStop(_,ee,re=>{re==="enter"?s==null||s():re==="leave"&&(l==null||l())}),ee==="leave"&&!Ay(X)&&(F("hidden"),G(_))});T.useEffect(()=>{R&&o||(I(A),q(A))},[A,R,o]);let U=!(!o||!R||!j||H),[,O]=pj(U,x,A,{start:I,end:q}),J=ma({ref:C,className:((r=r_(v.className,$&&c,$&&u,O.enter&&c,O.enter&&O.closed&&u,O.enter&&!O.closed&&d,O.leave&&h,O.leave&&!O.closed&&m,O.leave&&O.closed&&b,!O.transition&&A&&p))==null?void 0:r.trim())||void 0,...hj(O)}),K=0;L==="visible"&&(K|=xi.Open),L==="hidden"&&(K|=xi.Closed),O.enter&&(K|=xi.Opening),O.leave&&(K|=xi.Closing);let ne=No();return T.createElement(ky.Provider,{value:X},T.createElement(yj,{value:K},ne({ourProps:J,theirProps:v,defaultTag:Tj,features:kj,visible:L==="visible",name:"Transition.Child"})))}function Ive(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=T.useRef(null),a=Rj(e),l=Pi(...a?[s,t]:t===null?[]:[t]);wR();let c=vR();if(n===void 0&&c!==null&&(n=(c&xi.Open)===xi.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=T.useState(n?"visible":"hidden"),p=Pj(()=>{n||d("hidden")}),[h,m]=T.useState(!0),b=T.useRef([n]);Yt(()=>{h!==!1&&b.current[b.current.length-1]!==n&&(b.current.push(n),m(!1))},[b,n]);let v=T.useMemo(()=>({show:n,appear:r,initial:h}),[n,r,h]);Yt(()=>{n?d("visible"):!Ay(p)&&s.current!==null&&d("hidden")},[n,p]);let x={unmount:o},w=Ue(()=>{var C;h&&m(!1),(C=e.beforeEnter)==null||C.call(e)}),_=Ue(()=>{var C;h&&m(!1),(C=e.beforeLeave)==null||C.call(e)}),R=No();return T.createElement(ky.Provider,{value:p},T.createElement(Ty.Provider,{value:v},R({ourProps:{...x,as:T.Fragment,children:T.createElement(Aj,{ref:l,...x,...i,beforeEnter:w,beforeLeave:_})},theirProps:{},defaultTag:T.Fragment,features:kj,visible:u==="visible",name:"Transition"})))}function Dve(e,t){let n=T.useContext(Ty)!==null,r=vR()!==null;return T.createElement(T.Fragment,null,!n&&r?T.createElement(l_,{ref:t,...e}):T.createElement(Aj,{ref:t,...e}))}let l_=co(Ive),Aj=co(Mve),Nve=co(Dve),Lve=Object.assign(l_,{Child:Nve,Root:l_});var _R="Checkbox",[Fve,fOe]=Vn(_R),[jve,$ve]=Fve(_R),Oj=P.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,form:u,...d}=e,[p,h]=P.useState(null),m=et(t,R=>h(R)),b=P.useRef(!1),v=p?u||!!p.closest("form"):!0,[x=!1,w]=wr({prop:o,defaultProp:i,onChange:c}),_=P.useRef(x);return P.useEffect(()=>{const R=p==null?void 0:p.form;if(R){const C=()=>w(_.current);return R.addEventListener("reset",C),()=>R.removeEventListener("reset",C)}},[p,w]),y.jsxs(jve,{scope:n,state:x,disabled:a,children:[y.jsx(Oe.button,{type:"button",role:"checkbox","aria-checked":Ia(x)?"mixed":x,"aria-required":s,"data-state":Dj(x),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:m,onKeyDown:Ce(e.onKeyDown,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:Ce(e.onClick,R=>{w(C=>Ia(C)?!0:!C),v&&(b.current=R.isPropagationStopped(),b.current||R.stopPropagation())})}),v&&y.jsx(zve,{control:p,bubbles:!b.current,name:r,value:l,checked:x,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"},defaultChecked:Ia(i)?!1:i})]})});Oj.displayName=_R;var Mj="CheckboxIndicator",Ij=P.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=$ve(Mj,n);return y.jsx(Ln,{present:r||Ia(i.state)||i.state===!0,children:y.jsx(Oe.span,{"data-state":Dj(i.state),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Ij.displayName=Mj;var zve=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...i}=e,s=P.useRef(null),a=hy(n),l=oy(t);P.useEffect(()=>{const u=s.current,d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(a!==n&&h){const m=new Event("click",{bubbles:r});u.indeterminate=Ia(n),h.call(u,Ia(n)?!1:n),u.dispatchEvent(m)}},[a,n,r]);const c=P.useRef(Ia(n)?!1:n);return y.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??c.current,...i,tabIndex:-1,ref:s,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Ia(e){return e==="indeterminate"}function Dj(e){return Ia(e)?"indeterminate":e?"checked":"unchecked"}var Nj=Oj,Bve=Ij;const Oy=P.forwardRef(({className:e,...t},n)=>y.jsx(Nj,{ref:n,className:ge("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:y.jsx(Bve,{className:ge("flex items-center justify-center text-current"),children:y.jsx(_d,{className:"h-4 w-4"})})}));Oy.displayName=Nj.displayName;function Hve(e){const t=/(>=|<=|>|<|=)/,n=e.match(t);if(n){const r=n[0],[o,i]=e.split(r);return{operation:r,value:i.trim()}}else return null}function Vve(e,t,n){const r=`SELECT ${n}, COUNT(*) FROM ${t} {{ filters | where }} GROUP BY ${n} ORDER BY ${n} ASC LIMIT 50`,o=`SELECT min(${n}) as min, max(${n}) as max FROM ${t} {{ filters | where }}`;return xd(e)?o:r}function Wve(e){const t=be(i=>{var s,a;return(a=(s=i==null?void 0:i.dashboard)==null?void 0:s.filters)==null?void 0:a.find(l=>l.id===e)}),{query:n,setQuery:r,...o}=CR(t||{});return o}function CR(e){const[t,n]=T.useState([]),[r,o]=T.useState(""),i=be(E=>E.filterValues),s=be(E=>E.selectedSheetId),{addOrUpdateFilterValue:a,removeFilterValues:l}=An(),{data:c,isLoading:u,isFetching:d,isError:p}=j8(e),h=T.useMemo(()=>{var A;return e.column?(A=c==null?void 0:c.records)==null?void 0:A.map(M=>{let N=e.column.split(".").slice(-1)[0].replace(/"/g,"");return M[N]===void 0&&(N=N.toLowerCase()),{id:M[N],value:M[N]}}):[]},[c,e.column]);T.useEffect(()=>{if(i){const E=i.find(A=>A.filterId===e.id);if(!E){n([]);return}if(E.operation==="in"){const A=h==null?void 0:h.filter(M=>E.values.includes(M.value));A&&n(A)}}},[c,s,i,e.id,h]),T.useEffect(()=>{if(i&&!i.find(A=>A.filterId===e.id)){n([]);return}},[i,e.id]);function m(E){const A=Hve(E[0].toString());if(!(A!=null&&A.value)||!(A!=null&&A.operation))return;const M={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:wu(e),name:e.column,operation:A.operation,values:[Number(A.value)]};a(M)}function b(E){if(Array.isArray(E)||(E=[E]),E.length===1&&h.find(M=>M.value===E[0].value)===void 0){m(E);return}if(n(E),E.length===0){l(e.id);return}const A={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:wu(e),operation:e.operation,values:E.map(M=>M.value)};a(A)}function v(){n([]),l(e.id)}function x(E){if(E){n(h);const A={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:wu(e),operation:e.operation,values:h.map(M=>M.value)};a(A)}else v()}function w(){if(tp(e.dataType))return h;const E=r.toLowerCase().replace(/\s+/g,"");return r===""?h:h.filter(A=>A.value.toLowerCase().replace(/\s+/g,"").includes(E))}const _=w(),R=e.type==="single",C=t.length===(h==null?void 0:h.length);return{isLoading:u,isFetching:d,isError:p,records:h,selectedRecords:t,handleChange:b,handleClear:v,handleSelectAll:x,query:r,setQuery:o,filteredRecords:_,isSingleSelect:R,allSelected:C}}function Uve({filter:e}){var h,m,b,v,x,w;const t=be(_=>_.themeStyle),{filteredRecords:n,isSingleSelect:r,allSelected:o,handleChange:i,handleSelectAll:s,query:a,setQuery:l,isLoading:c,isFetching:u,isError:d,selectedRecords:p}=CR(e);return c||u?y.jsx(_u,{style:{borderRadius:(m=(h=t==null?void 0:t.chart)==null?void 0:h.options)==null?void 0:m.borderRadius},className:"h-8 w-full bg-foreground/10"}):d?y.jsx("div",{className:"flex h-8 w-full items-center bg-muted px-2 text-sm",children:"Error"}):y.jsx("div",{className:"w-full",children:y.jsx(Pve,{value:p,multiple:!r,onChange:i,children:y.jsxs("div",{className:"relative",children:[y.jsxs("div",{style:{borderRadius:(v=(b=t==null?void 0:t.chart)==null?void 0:b.options)==null?void 0:v.borderRadius},className:"relative w-full cursor-default overflow-hidden rounded-sm border bg-background text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-background/75 focus-visible:ring-offset-2 sm:text-sm",children:[y.jsx(_j,{className:"flex h-8 w-full rounded border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",displayValue:_=>_.map(C=>C.value).join(", "),onChange:_=>{l(_.target.value)}}),y.jsx(Sj,{className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:y.jsx(lp,{className:"size-4 text-gray-400","aria-hidden":"true"})})]}),y.jsx(Lve,{as:T.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>l(""),children:y.jsxs(Cj,{style:{borderRadius:(w=(x=t==null?void 0:t.chart)==null?void 0:x.options)==null?void 0:w.borderRadius},className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-sm border bg-background py-1 text-base text-foreground/80 shadow-lg focus:outline-none sm:text-sm",children:[e.type==="multiple"||e.type===void 0&&y.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-b-muted px-4 py-2",children:[y.jsx("span",{children:"Select All"}),y.jsx(Oy,{className:"border-muted-foreground/50",checked:o,onCheckedChange:s})]}),(n==null?void 0:n.length)===0&&a!==""?y.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):n==null?void 0:n.map(_=>{var R,C;return y.jsx(Ej,{style:{borderRadius:(C=(R=t==null?void 0:t.chart)==null?void 0:R.options)==null?void 0:C.borderRadius},className:({active:E})=>`relative m-1 cursor-default select-none py-2 pl-10 pr-4 ${E?"bg-muted":"text-foreground-900"}`,value:_,children:({selected:E,active:A})=>y.jsxs("div",{className:"",children:[y.jsx("span",{className:`block ${E?"font-medium":"font-normal"}`,children:typeof _.value=="boolean"?_.value?"True":"False":_.value}),E?y.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:y.jsx(FC,{className:"size-4","aria-hidden":"true"})}):null]})},_.value)})]})})]})})})}var ER="Radio",[Gve,Lj]=Vn(ER),[qve,Yve]=Gve(ER),Fj=P.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,form:c,...u}=e,[d,p]=P.useState(null),h=et(t,v=>p(v)),m=P.useRef(!1),b=d?c||!!d.closest("form"):!0;return y.jsxs(qve,{scope:n,checked:o,disabled:s,children:[y.jsx(Oe.button,{type:"button",role:"radio","aria-checked":o,"data-state":zj(o),"data-disabled":s?"":void 0,disabled:s,value:a,...u,ref:h,onClick:Ce(e.onClick,v=>{o||l==null||l(),b&&(m.current=v.isPropagationStopped(),m.current||v.stopPropagation())})}),b&&y.jsx(Kve,{control:d,bubbles:!m.current,name:r,value:a,checked:o,required:i,disabled:s,form:c,style:{transform:"translateX(-100%)"}})]})});Fj.displayName=ER;var jj="RadioIndicator",$j=P.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=Yve(jj,n);return y.jsx(Ln,{present:r||i.checked,children:y.jsx(Oe.span,{"data-state":zj(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t})})});$j.displayName=jj;var Kve=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=P.useRef(null),s=hy(n),a=oy(t);return P.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const p=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(p)}},[s,n,r]),y.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function zj(e){return e?"checked":"unchecked"}var Xve=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],RR="RadioGroup",[Qve,hOe]=Vn(RR,[Sd,Lj]),Bj=Sd(),Hj=Lj(),[Zve,Jve]=Qve(RR),Vj=P.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:u=!0,onValueChange:d,...p}=e,h=Bj(n),m=Rc(c),[b,v]=wr({prop:i,defaultProp:o,onChange:d});return y.jsx(Zve,{scope:n,name:r,required:s,disabled:a,value:b,onValueChange:v,children:y.jsx(aC,{asChild:!0,...h,orientation:l,dir:m,loop:u,children:y.jsx(Oe.div,{role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:m,...p,ref:t})})})});Vj.displayName=RR;var Wj="RadioGroupItem",Uj=P.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=Jve(Wj,n),s=i.disabled||r,a=Bj(n),l=Hj(n),c=P.useRef(null),u=et(t,c),d=i.value===o.value,p=P.useRef(!1);return P.useEffect(()=>{const h=b=>{Xve.includes(b.key)&&(p.current=!0)},m=()=>p.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),y.jsx(lC,{asChild:!0,...a,focusable:!s,active:d,children:y.jsx(Fj,{disabled:s,required:i.required,checked:d,...l,...o,name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:Ce(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:Ce(o.onFocus,()=>{var h;p.current&&((h=c.current)==null||h.click())})})})});Uj.displayName=Wj;var exe="RadioGroupIndicator",Gj=P.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=Hj(n);return y.jsx($j,{...o,...r,ref:t})});Gj.displayName=exe;var qj=Vj,Yj=Uj,txe=Gj;const Fh=P.forwardRef(({className:e,...t},n)=>y.jsx(qj,{className:ge("grid gap-2",e),...t,ref:n}));Fh.displayName=qj.displayName;const Fl=P.forwardRef(({className:e,...t},n)=>y.jsx(Yj,{ref:n,className:ge("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:y.jsx(txe,{className:"flex items-center justify-center",children:y.jsx($C,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Fl.displayName=Yj.displayName;function nxe({filter:e}){var i;const{filteredRecords:t,handleChange:n,selectedRecords:r}=CR(e);function o(s){n([{value:s,id:s}])}return y.jsx(Fh,{onValueChange:o,value:((i=r==null?void 0:r[0])==null?void 0:i.value)||"",className:"mt-2 flex gap-3 overflow-x-auto",children:t==null?void 0:t.map(s=>y.jsxs("div",{className:"flex gap-2",children:[y.jsx(Fl,{value:s.value,id:"r1"}),y.jsx(cn,{className:"text-muted-foreground",htmlFor:"r1",children:s.value})]},s.value))})}function PR({filter:e}){return xd(e.dataType)?y.jsx(Dbe,{filter:e}):e.uiType==="radio"&&e.type==="single"?y.jsx(nxe,{filter:e}):y.jsx(Uve,{filter:e})}function rxe({frame:e}){const[t,n]=T.useState(!1),r=e==null?void 0:e.cards[0],{data:o}=La(r),i=e==null?void 0:e.cards[1],{data:s,isLoading:a,isFetching:l}=La(i);return(i==null?void 0:i.type)!=="text"?y.jsx(Wb,{card:r,data:(o==null?void 0:o.records)||[]}):y.jsxs(oc,{className:ge("group relative overflow-y-auto",t?"m-4":"mx-0"),children:[t?y.jsx("div",{className:"overflow-y-auto break-words p-1",children:y.jsx(Xb,{card:i,data:(s==null?void 0:s.records)||[],isLoading:!1})}):y.jsx(Wb,{card:r,data:(o==null?void 0:o.records)||[]}),y.jsx("div",{className:ge("fixed z-10",{"invisible bottom-4 right-4 group-hover:visible":t,"right-6 top-6":!t}),children:y.jsx(wy,{disabled:a||l,className:ge("h-7 p-1"),pressed:t,onPressedChange:n,"aria-label":"Toggle bold",children:t?y.jsx(uL,{className:"size-4 text-muted-foreground/70"}):y.jsx(dL,{className:"size-4 text-muted-foreground/70"})})})]})}function oxe({card:e,frame:t}){var G,j,H;const{customCards:n,placeholders:r}=Do(),o=be($=>$.themeStyle),i=be($=>$.selectedSheetId),s=be($=>$.isDashboardEditing),a=be($=>$.selectedLensId),l=be($=>$.dashboard.filters),c=l==null?void 0:l.find($=>$.id===t.filterId&&!$.hide),{setCardTitle:u,setCardDescription:d,setSelectedFrameId:p,updateFilter:h}=An(),{updateFrame:m}=An(),b=((G=e.customCardPreferences)==null?void 0:G.showCardHeader)??!0,{isError:v,isLoading:x,isFetching:w,cfg:_,visualKey:R,data:C,handleDatapointClick:E}=R4(e);function A(){var $,V,X;if(n&&n.length>0){const I=n.find(q=>q.cardId===e.id);if(I&&I.replaceDefault){const q=I.content;if(q)return y.jsx(q,{card:e})}}if(e.type==="kpi"){if((($=t==null?void 0:t.cards)==null?void 0:$.length)===1)return y.jsx(Wb,{card:e,data:(C==null?void 0:C.records)||[]});if(((V=t==null?void 0:t.cards)==null?void 0:V.length)>1)return y.jsx(rxe,{frame:t})}return e.type==="text"&&((X=t==null?void 0:t.cards)==null?void 0:X.length)===1?y.jsx(oc,{className:"mx-3 my-6 overflow-y-auto break-words px-3",children:y.jsx(Xb,{isLoading:x||w,card:e,data:(C==null?void 0:C.records)||[]})}):Z}function M(){return["{{ filters | where }}","{{ filters | and }}"].some(V=>{var X;return(X=e.sql)==null?void 0:X.includes(V)})?y.jsx(Sde,{}):null}function N(){if(v)return y.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[y.jsx(mL,{className:"size-8 text-destructive"}),y.jsx("p",{className:"text-sm text-muted-foreground",children:"Error fetching data. Check your card settings."})]});if(C!=null&&C.records&&(C==null?void 0:C.records.length)===0)return r!=null&&r.NoRecords?y.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:r.NoRecords}):y.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[y.jsx(SL,{className:"size-8 text-muted-foreground"}),y.jsx("p",{className:"text-sm text-muted-foreground",children:"No records to display"})]});if(e.type==="table"&&(C!=null&&C.records)&&(C==null?void 0:C.records.length)>0)return y.jsxs(oc,{className:"relative flex h-full min-h-0 w-full flex-1 grow basis-0",children:[y.jsx(q6,{card:e,data:(C==null?void 0:C.records)||[]}),y.jsx(Cp,{orientation:"horizontal"})]});if(e.type==="text")return y.jsx(oc,{className:"overflow-y-auto break-words pr-2",children:y.jsx(Xb,{isLoading:x||w,card:e,data:(C==null?void 0:C.records)||[]})});if(e.type==="custom")return y.jsx(cpe,{frame:t,card:e});if(n&&n.length>0){const $=n.find(V=>V.cardId===e.id);if($&&$.content){const V=$.content;return y.jsx(V,{card:e})}}if(_)return y.jsx(YE,{cfg:_,onDatapointClick:E},`${R}-${a}`)}function L(){if(n&&n.length>0){const $=n.find(V=>V.cardId===e.id);if($&&$.footer){const V=$.footer;if(V)return y.jsx(V,{card:e})}}return null}function F(){var $,V,X;return y.jsx(dC,{value:t.activeCardId,className:"flex items-center justify-end gap-3",onValueChange:I=>{const q={...t,activeCardId:I};m(i,q)},children:y.jsx(k0,{style:{borderRadius:(V=($=o==null?void 0:o.chart)==null?void 0:$.options)==null?void 0:V.borderRadius},className:"flex-end flex-wrap items-center",children:(X=t.cards.filter(I=>{var q;return!((q=I.tabTitle)!=null&&q.endsWith("__Header"))&&(I.displayTab===!0||I.displayTab===void 0)}))==null?void 0:X.map(I=>{var q,U;return y.jsx(A0,{style:{borderRadius:(U=(q=o==null?void 0:o.chart)==null?void 0:q.options)==null?void 0:U.borderRadius},value:I.id,children:I.tabTitle||I.title},I.id)})})})}function z(){let $=t.cards.find(V=>V.type==="kpi"&&V.tabTitle===`${e.tabTitle}__Header`);return $||($=t.cards.find(V=>V.type==="kpi"&&V.tabTitle==="All__Header")),$?y.jsx("div",{className:"flex items-end gap-2",children:y.jsx(Aue,{renderFilterInfo:M,card:$})}):y.jsxs(y.Fragment,{children:[y.jsxs("div",{role:"card-title-container",className:"flex items-center gap-2",children:[y.jsx(Xi,{text:e.title,onSave:V=>u(i,e.id,V),children:y.jsx(wd,{className:ge("text-base",{}),children:e.title})}),(s||e.info)&&y.jsx(l3,{card:e}),e.refreshInterval&&y.jsxs(m3,{children:[y.jsx(b3,{className:"pr-1",children:y.jsx("div",{className:ge("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":x||w})})}),y.jsx(LE,{side:"right",align:"center",children:y.jsx("p",{className:"text-xs",children:`Realtime (${e==null?void 0:e.refreshInterval})`})})]}),M()]}),y.jsx("div",{role:"card-description-container",children:y.jsx(Xi,{text:(e==null?void 0:e.description)||"",onSave:V=>d(i,e.id,V),children:y.jsxs(iC,{className:ge("",{}),children:[" ",e.description]})})})]})}if(!e.id)return null;const Z=y.jsxs(y.Fragment,{children:[b?y.jsx(C0,{children:y.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[y.jsx("div",{className:"grow",role:"header-container",children:z()}),y.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.cards.length>1&&F(),y.jsx("div",{children:c&&y.jsxs("div",{style:{borderRadius:(H=(j=o==null?void 0:o.chart)==null?void 0:j.options)==null?void 0:H.borderRadius},role:"frame-filter-container",className:"flex h-10 shrink-0 items-center bg-muted p-1",children:[!xd(c.dataType)&&y.jsx(Xi,{className:"my-1",containerClassName:"shrink-0",text:c.title||c.column,onSave:$=>h({...c,title:$}),children:y.jsx(cn,{className:"px-3",children:c.title})}),y.jsx(PR,{filter:c})]})})]})]})}):y.jsx("div",{className:"h-8"}),y.jsx(E0,{className:"relative flex min-h-0 grow flex-col",children:N()}),y.jsx(HN,{children:L()})]});return y.jsx("div",{className:ge("flex h-full flex-col",{"animate-pulse":x||w}),children:A()})}function ixe({frame:e,footer:t,className:n,...r}){var b,v;const o=T.useRef(null),i=be(x=>x.themeStyle),s=be(x=>x.selectedFrameId),a=be(x=>x.isDashboardEditing),{setSelectedFrameId:l}=An(),{setSelectedConnectionId:c,setSelectedDatabaseName:u,setSelectedSchemaName:d,setSelectedTableName:p}=ap(),h=e.cards.find(x=>x.id===e.activeCardId);Yee(e,o);function m(x){x.stopPropagation(),l(e.id),h!=null&&h.connectionId&&c(h==null?void 0:h.connectionId),h!=null&&h.lastSelectedDatabase&&u(h==null?void 0:h.lastSelectedDatabase),h!=null&&h.lastSelectedSchema&&d(h==null?void 0:h.lastSelectedSchema),h!=null&&h.lastSelectedTable&&p(h==null?void 0:h.lastSelectedTable)}return y.jsx(U0,{FallbackComponent:HC,children:y.jsxs("div",{tabIndex:-1,ref:o,role:"card-frame",onClick:m,style:{borderRadius:(v=(b=i==null?void 0:i.chart)==null?void 0:b.options)==null?void 0:v.borderRadius},className:ge("relative flex h-full flex-col rounded-sm border bg-background shadow-sm",{"border-dashed border-foreground/50":s===e.id&&a},i==null?void 0:i.dashboardCard,n,"semaphor-card-frame"),...r,children:[y.jsx(EL,{frame:e}),y.jsx(oxe,{card:h,frame:e},h.id)]})})}const TR=P.forwardRef(({className:e,...t},n)=>y.jsx("textarea",{className:ge("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));TR.displayName="Textarea";function sxe({label:e,onCheckedChange:t,checked:n}){return y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(Oy,{onCheckedChange:t,id:"terms",checked:n}),y.jsx("label",{htmlFor:"terms",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e})]})}function Kj({text:e,className:t}){const[n,r]=T.useState(!1);return y.jsx(Hn,{className:ge("h-7 w-fit px-1 font-mono text-xs text-muted-foreground/70",t),variant:"ghost",size:"icon",onClick:()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>{r(!1)},1e3)},children:n?y.jsx(FC,{className:"size-3.5"}):y.jsx(zC,{className:"size-3.5"})})}function axe({filter:e}){const[t,n]=T.useState(e.sql),[r,o]=T.useState(!1),i=be(h=>h.selectedSheetId),{updateFilter:s,updateFilterId:a}=An();function l(){const h={...e,sql:t};s(h),o(!1)}function c(h){console.log("operation",h);const m={...e,operation:h};s(m)}function u(h){const m={...e,type:h};s(m)}function d(h){const m={...e,uiType:h};s(m)}function p(h){if(!i)return;const m={...e,sheetId:h?i:void 0};s(m)}return y.jsxs(vy,{open:r,onOpenChange:o,children:[y.jsx(xy,{children:y.jsx(vL,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),y.jsxs(_p,{onMouseDown:h=>h.stopPropagation(),onDoubleClick:h=>h.stopPropagation(),className:"z-50 m-2 w-full min-w-[350px] space-y-4",children:[y.jsxs("div",{className:"space-y-2",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("p",{className:"font-semibold text-foreground",children:e.column}),y.jsx("div",{className:"flex items-center gap-2",children:y.jsxs(bp,{children:[y.jsx(yp,{children:y.jsx(lL,{className:"size-5 cursor-pointer text-muted-foreground hover:text-foreground/80"})}),y.jsxs(Od,{align:"start",className:"flex w-auto items-center gap-2 px-3 py-2",children:[y.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:e.id}),y.jsx(Kj,{text:e.id})]})]})})]}),y.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize filter operation and SQL"})]}),y.jsx(uy,{}),y.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[y.jsxs("div",{className:"space-y-2",children:[y.jsx(cn,{children:"Type"}),y.jsxs(Fh,{onValueChange:u,value:e.type||"multiple",className:"flex gap-3",defaultValue:"x",children:[y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(Fl,{value:"multiple",id:"r1"}),y.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Multiple"})]}),y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(Fl,{value:"single",id:"r2"}),y.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Single"})]})]})]}),e.type==="single"&&y.jsxs("div",{className:"space-y-2",children:[y.jsx(cn,{children:"Filter Element"}),y.jsxs(Fh,{onValueChange:d,value:e.uiType||"dropdown",className:"flex gap-3",defaultValue:"x",children:[y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(Fl,{value:"dropdown",id:"r2"}),y.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Dropdown"})]}),y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(Fl,{value:"radio",id:"r1"}),y.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Radio"})]})]})]})]}),y.jsxs("div",{className:"grid grid-cols-6 gap-4 text-sm",children:[y.jsxs("div",{className:"col-span-2 space-y-1",children:[y.jsx(cn,{children:"Table Column"}),y.jsx(cn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.column})]}),y.jsxs("div",{className:"col-span-2 space-y-1",children:[y.jsx(cn,{children:"Data Type"}),y.jsx(cn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.dataType})]}),y.jsxs("div",{className:"col-span-2 space-y-1",children:[y.jsx(cn,{className:"text-sm",children:"Filter Operation"}),y.jsx(lxe,{updateFilterOperation:c,value:e.operation})]})]}),y.jsxs("div",{className:"flex grow flex-col space-y-1",role:"container",children:[y.jsx(cn,{className:"text-sm",children:"Values SQL"}),y.jsx(TR,{onKeyDown:h=>{h.stopPropagation()},value:t,onChange:h=>n(h.target.value),className:`min-w-full grow resize font-mono text-xs ${qf}`})]}),y.jsx("div",{children:y.jsx(sxe,{label:"Local to sheet",onCheckedChange:p,checked:!!e.sheetId})}),y.jsx("div",{className:"flex justify-end gap-2",children:y.jsxs(Hn,{onClick:l,size:"sm",variant:"outline",children:[y.jsx(_d,{className:"mr-2 size-4"}),"Accept"]})})]})]})}function lxe({value:e,updateFilterOperation:t}){return y.jsxs(Is,{defaultValue:"in",value:e,onValueChange:n=>t(n),children:[y.jsx(Ni,{className:"h-8 w-[180px] focus:ring-0 focus:ring-offset-0",children:y.jsx(Ds,{placeholder:"Operation"})}),y.jsxs(Li,{children:[y.jsx(_n,{value:"=",children:"Equals"}),y.jsx(_n,{value:"in",children:"Contains"}),y.jsx(_n,{value:"like",children:"Like"})]})]})}function Xj({filter:e}){const t=be(a=>a.isDashboardEditing),n=be(a=>a.filterValues),r=n==null?void 0:n.some(a=>a.filterId===e.id),{removeFilterValues:o,removeFilter:i,updateFilter:s}=An();return y.jsx(Xi,{className:"my-1",text:e.title||e.column,onSave:a=>s({...e,title:a}),children:y.jsxs("div",{className:"group mb-1 flex grow items-center justify-between",children:[y.jsxs("div",{className:"flex grow items-center gap-2",children:[y.jsx(cn,{className:"inline-block text-sm",children:e.title}),r&&y.jsx("button",{onClick:()=>o(e.id),className:"text-foreground/30 hover:text-foreground/50",children:y.jsx(BC,{className:"size-3.5"})}),t&&y.jsx("button",{className:"invisible group-hover:visible",onClick:()=>{s({...e,hide:!e.hide})},children:e.hide?y.jsx(iL,{className:"size-3.5 text-foreground/50 hover:text-foreground/70"}):y.jsx(oL,{className:"size-3.5 text-foreground/50 hover:text-foreground/70"})}),t&&y.jsx(axe,{filter:e})]}),y.jsx("div",{className:"flex items-center gap-2",children:t&&y.jsx(kc,{onClick:()=>{o(e.id),i(e.id)},className:"size-3.5 cursor-pointer text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})})]})})}var cxe=e=>{switch(e){case"success":return fxe;case"info":return pxe;case"warning":return hxe;case"error":return gxe;default:return null}},uxe=Array(12).fill(0),dxe=({visible:e,className:t})=>T.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},T.createElement("div",{className:"sonner-spinner"},uxe.map((n,r)=>T.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),fxe=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),hxe=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},T.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),pxe=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),gxe=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),mxe=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},T.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),bxe=()=>{let[e,t]=T.useState(document.hidden);return T.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},c_=1,yxe=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:c_++,i=this.toasts.find(a=>a.id===o),s=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0,i,s=r.then(async l=>{if(i=["resolve",l],T.isValidElement(l))o=!1,this.create({id:n,type:"default",message:l});else if(xxe(l)&&!l.ok){o=!1;let c=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:c,description:u})}else if(t.success!==void 0){o=!1;let c=typeof t.success=="function"?await t.success(l):t.success,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:c,description:u})}}).catch(async l=>{if(i=["reject",l],t.error!==void 0){o=!1;let c=typeof t.error=="function"?await t.error(l):t.error,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:c,description:u})}}).finally(()=>{var l;o&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),a=()=>new Promise((l,c)=>s.then(()=>i[0]==="reject"?c(i[1]):l(i[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||c_++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},eo=new yxe,vxe=(e,t)=>{let n=(t==null?void 0:t.id)||c_++;return eo.addToast({title:e,...t,id:n}),n},xxe=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",wxe=vxe,Sxe=()=>eo.toasts,_xe=()=>eo.getActiveToasts(),Qj=Object.assign(wxe,{success:eo.success,info:eo.info,warning:eo.warning,error:eo.error,custom:eo.custom,message:eo.message,promise:eo.promise,dismiss:eo.dismiss,loading:eo.loading},{getHistory:Sxe,getToasts:_xe});function Cxe(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Cxe(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
362
|
+
`);function Om(e){return e.label!==void 0}var Exe=3,Rxe="32px",Pxe="16px",wI=4e3,Txe=356,kxe=14,Axe=20,Oxe=200;function di(...e){return e.filter(Boolean).join(" ")}function Mxe(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var Ixe=e=>{var t,n,r,o,i,s,a,l,c,u,d;let{invert:p,toast:h,unstyled:m,interacting:b,setHeights:v,visibleToasts:x,heights:w,index:_,toasts:R,expanded:C,removeToast:E,defaultRichColors:A,closeButton:M,style:N,cancelButtonStyle:L,actionButtonStyle:F,className:z="",descriptionClassName:Z="",duration:G,position:j,gap:H,loadingIcon:$,expandByDefault:V,classNames:X,icons:I,closeButtonAriaLabel:q="Close toast",pauseWhenPageIsHidden:U}=e,[O,J]=T.useState(null),[K,ne]=T.useState(null),[Y,ee]=T.useState(!1),[re,ue]=T.useState(!1),[fe,se]=T.useState(!1),[pe,ce]=T.useState(!1),[_e,Pe]=T.useState(!1),[Me,ke]=T.useState(0),[Ne,tt]=T.useState(0),ot=T.useRef(h.duration||G||wI),gn=T.useRef(null),xt=T.useRef(null),Wn=_===0,Rt=_+1<=x,de=h.type,Se=h.dismissible!==!1,je=h.className||"",Be=h.descriptionClassName||"",it=T.useMemo(()=>w.findIndex(Le=>Le.toastId===h.id)||0,[w,h.id]),On=T.useMemo(()=>{var Le;return(Le=h.closeButton)!=null?Le:M},[h.closeButton,M]),Fn=T.useMemo(()=>h.duration||G||wI,[h.duration,G]),vn=T.useRef(0),en=T.useRef(0),jn=T.useRef(0),Kt=T.useRef(null),[sr,_r]=j.split("-"),ps=T.useMemo(()=>w.reduce((Le,wt,Wt)=>Wt>=it?Le:Le+wt.height,0),[w,it]),gs=bxe(),Nc=h.invert||p,Lo=de==="loading";en.current=T.useMemo(()=>it*H+ps,[it,ps]),T.useEffect(()=>{ot.current=Fn},[Fn]),T.useEffect(()=>{ee(!0)},[]),T.useEffect(()=>{let Le=xt.current;if(Le){let wt=Le.getBoundingClientRect().height;return tt(wt),v(Wt=>[{toastId:h.id,height:wt,position:h.position},...Wt]),()=>v(Wt=>Wt.filter(ar=>ar.toastId!==h.id))}},[v,h.id]),T.useLayoutEffect(()=>{if(!Y)return;let Le=xt.current,wt=Le.style.height;Le.style.height="auto";let Wt=Le.getBoundingClientRect().height;Le.style.height=wt,tt(Wt),v(ar=>ar.find(Zn=>Zn.toastId===h.id)?ar.map(Zn=>Zn.toastId===h.id?{...Zn,height:Wt}:Zn):[{toastId:h.id,height:Wt,position:h.position},...ar])},[Y,h.title,h.description,v,h.id]);let Fo=T.useCallback(()=>{ue(!0),ke(en.current),v(Le=>Le.filter(wt=>wt.toastId!==h.id)),setTimeout(()=>{E(h)},Oxe)},[h,E,v,en]);T.useEffect(()=>{if(h.promise&&de==="loading"||h.duration===1/0||h.type==="loading")return;let Le;return C||b||U&&gs?(()=>{if(jn.current<vn.current){let wt=new Date().getTime()-vn.current;ot.current=ot.current-wt}jn.current=new Date().getTime()})():ot.current!==1/0&&(vn.current=new Date().getTime(),Le=setTimeout(()=>{var wt;(wt=h.onAutoClose)==null||wt.call(h,h),Fo()},ot.current)),()=>clearTimeout(Le)},[C,b,h,de,U,gs,Fo]),T.useEffect(()=>{h.delete&&Fo()},[Fo,h.delete]);function jd(){var Le,wt,Wt;return I!=null&&I.loading?T.createElement("div",{className:di(X==null?void 0:X.loader,(Le=h==null?void 0:h.classNames)==null?void 0:Le.loader,"sonner-loader"),"data-visible":de==="loading"},I.loading):$?T.createElement("div",{className:di(X==null?void 0:X.loader,(wt=h==null?void 0:h.classNames)==null?void 0:wt.loader,"sonner-loader"),"data-visible":de==="loading"},$):T.createElement(dxe,{className:di(X==null?void 0:X.loader,(Wt=h==null?void 0:h.classNames)==null?void 0:Wt.loader),visible:de==="loading"})}return T.createElement("li",{tabIndex:0,ref:xt,className:di(z,je,X==null?void 0:X.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,X==null?void 0:X.default,X==null?void 0:X[de],(n=h==null?void 0:h.classNames)==null?void 0:n[de]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:A,"data-styled":!(h.jsx||h.unstyled||m),"data-mounted":Y,"data-promise":!!h.promise,"data-swiped":_e,"data-removed":re,"data-visible":Rt,"data-y-position":sr,"data-x-position":_r,"data-index":_,"data-front":Wn,"data-swiping":fe,"data-dismissible":Se,"data-type":de,"data-invert":Nc,"data-swipe-out":pe,"data-swipe-direction":K,"data-expanded":!!(C||V&&Y),style:{"--index":_,"--toasts-before":_,"--z-index":R.length-_,"--offset":`${re?Me:en.current}px`,"--initial-height":V?"auto":`${Ne}px`,...N,...h.style},onDragEnd:()=>{se(!1),J(null),Kt.current=null},onPointerDown:Le=>{Lo||!Se||(gn.current=new Date,ke(en.current),Le.target.setPointerCapture(Le.pointerId),Le.target.tagName!=="BUTTON"&&(se(!0),Kt.current={x:Le.clientX,y:Le.clientY}))},onPointerUp:()=>{var Le,wt,Wt,ar;if(pe||!Se)return;Kt.current=null;let Zn=Number(((Le=xt.current)==null?void 0:Le.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ho=Number(((wt=xt.current)==null?void 0:wt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Br=new Date().getTime()-((Wt=gn.current)==null?void 0:Wt.getTime()),Cr=O==="x"?Zn:ho,mn=Math.abs(Cr)/Br;if(Math.abs(Cr)>=Axe||mn>.11){ke(en.current),(ar=h.onDismiss)==null||ar.call(h,h),ne(O==="x"?Zn>0?"right":"left":ho>0?"down":"up"),Fo(),ce(!0),Pe(!1);return}se(!1),J(null)},onPointerMove:Le=>{var wt,Wt,ar,Zn;if(!Kt.current||!Se||((wt=window.getSelection())==null?void 0:wt.toString().length)>0)return;let ho=Le.clientY-Kt.current.y,Br=Le.clientX-Kt.current.x,Cr=(Wt=e.swipeDirections)!=null?Wt:Mxe(j);!O&&(Math.abs(Br)>1||Math.abs(ho)>1)&&J(Math.abs(Br)>Math.abs(ho)?"x":"y");let mn={x:0,y:0};O==="y"?(Cr.includes("top")||Cr.includes("bottom"))&&(Cr.includes("top")&&ho<0||Cr.includes("bottom")&&ho>0)&&(mn.y=ho):O==="x"&&(Cr.includes("left")||Cr.includes("right"))&&(Cr.includes("left")&&Br<0||Cr.includes("right")&&Br>0)&&(mn.x=Br),(Math.abs(mn.x)>0||Math.abs(mn.y)>0)&&Pe(!0),(ar=xt.current)==null||ar.style.setProperty("--swipe-amount-x",`${mn.x}px`),(Zn=xt.current)==null||Zn.style.setProperty("--swipe-amount-y",`${mn.y}px`)}},On&&!h.jsx?T.createElement("button",{"aria-label":q,"data-disabled":Lo,"data-close-button":!0,onClick:Lo||!Se?()=>{}:()=>{var Le;Fo(),(Le=h.onDismiss)==null||Le.call(h,h)},className:di(X==null?void 0:X.closeButton,(o=h==null?void 0:h.classNames)==null?void 0:o.closeButton)},(i=I==null?void 0:I.close)!=null?i:mxe):null,h.jsx||T.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:T.createElement(T.Fragment,null,de||h.icon||h.promise?T.createElement("div",{"data-icon":"",className:di(X==null?void 0:X.icon,(s=h==null?void 0:h.classNames)==null?void 0:s.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||jd():null,h.type!=="loading"?h.icon||(I==null?void 0:I[de])||cxe(de):null):null,T.createElement("div",{"data-content":"",className:di(X==null?void 0:X.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},T.createElement("div",{"data-title":"",className:di(X==null?void 0:X.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?T.createElement("div",{"data-description":"",className:di(Z,Be,X==null?void 0:X.description,(c=h==null?void 0:h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),T.isValidElement(h.cancel)?h.cancel:h.cancel&&Om(h.cancel)?T.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||L,onClick:Le=>{var wt,Wt;Om(h.cancel)&&Se&&((Wt=(wt=h.cancel).onClick)==null||Wt.call(wt,Le),Fo())},className:di(X==null?void 0:X.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,T.isValidElement(h.action)?h.action:h.action&&Om(h.action)?T.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||F,onClick:Le=>{var wt,Wt;Om(h.action)&&((Wt=(wt=h.action).onClick)==null||Wt.call(wt,Le),!Le.defaultPrevented&&Fo())},className:di(X==null?void 0:X.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function SI(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Dxe(e,t){let n={};return[e,t].forEach((r,o)=>{let i=o===1,s=i?"--mobile-offset":"--offset",a=i?Pxe:Rxe;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${s}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${s}-${c}`]=a:n[`${s}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(a)}),n}var Nxe=T.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:s,className:a,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:p,style:h,visibleToasts:m=Exe,toastOptions:b,dir:v=SI(),gap:x=kxe,loadingIcon:w,icons:_,containerAriaLabel:R="Notifications",pauseWhenPageIsHidden:C}=e,[E,A]=T.useState([]),M=T.useMemo(()=>Array.from(new Set([r].concat(E.filter(U=>U.position).map(U=>U.position)))),[E,r]),[N,L]=T.useState([]),[F,z]=T.useState(!1),[Z,G]=T.useState(!1),[j,H]=T.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=T.useRef(null),V=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),X=T.useRef(null),I=T.useRef(!1),q=T.useCallback(U=>{A(O=>{var J;return(J=O.find(K=>K.id===U.id))!=null&&J.delete||eo.dismiss(U.id),O.filter(({id:K})=>K!==U.id)})},[]);return T.useEffect(()=>eo.subscribe(U=>{if(U.dismiss){A(O=>O.map(J=>J.id===U.id?{...J,delete:!0}:J));return}setTimeout(()=>{br.flushSync(()=>{A(O=>{let J=O.findIndex(K=>K.id===U.id);return J!==-1?[...O.slice(0,J),{...O[J],...U},...O.slice(J+1)]:[U,...O]})})})}),[]),T.useEffect(()=>{if(u!=="system"){H(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;let U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:O})=>{H(O?"dark":"light")})}catch{U.addListener(({matches:J})=>{try{H(J?"dark":"light")}catch(K){console.error(K)}})}},[u]),T.useEffect(()=>{E.length<=1&&z(!1)},[E]),T.useEffect(()=>{let U=O=>{var J,K;o.every(ne=>O[ne]||O.code===ne)&&(z(!0),(J=$.current)==null||J.focus()),O.code==="Escape"&&(document.activeElement===$.current||(K=$.current)!=null&&K.contains(document.activeElement))&&z(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[o]),T.useEffect(()=>{if($.current)return()=>{X.current&&(X.current.focus({preventScroll:!0}),X.current=null,I.current=!1)}},[$.current]),T.createElement("section",{ref:t,"aria-label":`${R} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},M.map((U,O)=>{var J;let[K,ne]=U.split("-");return E.length?T.createElement("ol",{key:U,dir:v==="auto"?SI():v,tabIndex:-1,ref:$,className:a,"data-sonner-toaster":!0,"data-theme":j,"data-y-position":K,"data-lifted":F&&E.length>1&&!i,"data-x-position":ne,style:{"--front-toast-height":`${((J=N[0])==null?void 0:J.height)||0}px`,"--width":`${Txe}px`,"--gap":`${x}px`,...h,...Dxe(l,c)},onBlur:Y=>{I.current&&!Y.currentTarget.contains(Y.relatedTarget)&&(I.current=!1,X.current&&(X.current.focus({preventScroll:!0}),X.current=null))},onFocus:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||I.current||(I.current=!0,X.current=Y.relatedTarget)},onMouseEnter:()=>z(!0),onMouseMove:()=>z(!0),onMouseLeave:()=>{Z||z(!1)},onDragEnd:()=>z(!1),onPointerDown:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},E.filter(Y=>!Y.position&&O===0||Y.position===U).map((Y,ee)=>{var re,ue;return T.createElement(Ixe,{key:Y.id,icons:_,index:ee,toast:Y,defaultRichColors:d,duration:(re=b==null?void 0:b.duration)!=null?re:p,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:n,visibleToasts:m,closeButton:(ue=b==null?void 0:b.closeButton)!=null?ue:s,interacting:Z,position:U,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,removeToast:q,toasts:E.filter(fe=>fe.position==Y.position),heights:N.filter(fe=>fe.position==Y.position),setHeights:L,expandByDefault:i,gap:x,loadingIcon:w,expanded:F,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))});function Lxe(){const{getSelectedFrame:e,addFrame:t,setSelectedFrameId:n}=An(),r=be(l=>l.dashboard.sheets),i=be(l=>l.selectedSheetId)??(r==null?void 0:r[0].id),s=be(l=>l.isDashboardEditing),a=be(l=>l.isVisualEditing);T.useEffect(()=>{if(!s||a)return;async function l(d){const p=d.ctrlKey||d.metaKey;p&&d.key==="c"?(await c(),Qj.success("Card copied to clipboard"),d.preventDefault()):p&&d.key==="v"&&(await u(),d.preventDefault())}async function c(){try{const d=e();d&&await navigator.clipboard.writeText(JSON.stringify(d))}catch(d){console.error("Failed to copy text:",d)}}async function u(){if(!i)return null;try{const d=await navigator.clipboard.readText();try{const p=JSON.parse(d);if(p&&p.id){p.id=Na();const h=p.activeCardId;p.cards.forEach(m=>{const b=m.id;m.id=Na(),b===h&&(p.activeCardId=m.id,m.title=`${m.title} (Copy)`)}),t(i,p),n(p.id)}}catch(p){console.error("Failed to parse clipboard contents: ",p)}return d}catch(d){return console.error("Failed to paste text:",d),null}}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,e,n,i,s,a])}const Fxe=Qk.WidthProvider(Qk.Responsive);function jxe({sheet:e}){var w,_,R;const t=be(C=>C.isDashboardEditing),n=be(C=>C.currentBreakpoint),r=be(C=>C.themeStyle),[o,i]=T.useState([]),s=be(C=>C.selectedSheetId);be(C=>C.selectedLensId);const a=e.layouts,l=be(C=>C.dashboard.filters),c=e.frames,{setSheetLayouts:u,setCurrentBreakpoint:d}=be(C=>C.actions);T.useEffect(()=>{var C,E;document.documentElement.style.setProperty("--placeholder-border-radius",`${(E=(C=r==null?void 0:r.chart)==null?void 0:C.options)==null?void 0:E.borderRadius}px`)},[(_=(w=r==null?void 0:r.chart)==null?void 0:w.options)==null?void 0:_.borderRadius]),Lxe();function p(C){d(C)}function h(C,E){s===e.id&&u(s,E)}if(!s)return null;const m=(C,E)=>y.jsx(Zj,{className:"after:content-none",ref:E,handleAxis:C}),b=C=>C&&(C==null?void 0:C.h)===1&&(C==null?void 0:C.w)===1?{...C,h:8,minH:7,w:7}:null;function v(){const C=l==null?void 0:l.filter(E=>(E.sheetId===s||!E.sheetId)&&!E.hide);return C==null?void 0:C.map(E=>{var N,L,F;const A=(N=a==null?void 0:a[n])==null?void 0:N.find(z=>z.i===E.id);if(E.location==="frame")return null;const M=b(A);return y.jsxs("div",{style:{borderRadius:(F=(L=r==null?void 0:r.chart)==null?void 0:L.options)==null?void 0:F.borderRadius},className:ge("z-50 flex flex-col rounded-md border bg-background px-3 py-2"),...M?{"data-grid":M}:{},children:[y.jsx(Xj,{filter:E}),y.jsx(PR,{filter:E})]},E.id)})}function x(){return c==null?void 0:c.map(C=>y.jsx("div",{role:"dashboard-frame-container",className:ge("group isolate overflow-hidden",r==null?void 0:r.dashboardCardContainer),children:y.jsx(U0,{FallbackComponent:({error:E,resetErrorBoundary:A})=>y.jsx(Qee,{error:E,resetErrorBoundary:A,frame:C}),children:y.jsx(ixe,{frame:C})})},C.id))}return y.jsx(y.Fragment,{children:y.jsxs(Fxe,{margin:[10,10],isDraggable:t,resizeHandles:t?["sw","nw","ne","se","e","w"]:[],className:ge((R=r==null?void 0:r.gridLayout)==null?void 0:R.className),layouts:a,cols:{lg:48,md:36,sm:24,xs:12,xxs:6},rowHeight:1,onBreakpointChange:p,onLayoutChange:h,resizeHandle:m,children:[v(),x()]})})}const Zj=T.forwardRef(({className:e,handleAxis:t,...n},r)=>{var s,a;const o=be(l=>l.themeStyle),i=(a=(s=o==null?void 0:o.chart)==null?void 0:s.options)==null?void 0:a.borderRadius;return y.jsx("div",{ref:r,className:ge(`react-resizable-handle z-10 react-resizable-handle-${t} absolute border-foreground/40`,{"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0":t==="nw"&&i<11,"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0":t==="ne"&&i<11,"border-foreground/40 group-hover:border-2 group-hover:border-r-0 group-hover:border-t-0":t==="sw"&&i<11,"border-foreground/40 group-hover:border-2 group-hover:border-l-0 group-hover:border-t-0":t==="se"&&i<11,"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0 group-hover:border-t-0":t==="e","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0 group-hover:border-t-0":t==="w"},e),...n})});Zj.displayName="ResizeHandle";var Jj="vercel.ai.error",$xe=Symbol.for(Jj),e9,zxe=class t9 extends Error{constructor({name:t,message:n,cause:r}){super(n),this[e9]=!0,this.name=t,this.cause=r}static isInstance(t){return t9.hasMarker(t,Jj)}static hasMarker(t,n){const r=Symbol.for(n);return t!=null&&typeof t=="object"&&r in t&&typeof t[r]=="boolean"&&t[r]===!0}};e9=$xe;var bd=zxe;function n9(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var r9="AI_InvalidArgumentError",o9=`vercel.ai.error.${r9}`,Bxe=Symbol.for(o9),i9,Hxe=class extends bd{constructor({message:e,cause:t,argument:n}){super({name:r9,message:e,cause:t}),this[i9]=!0,this.argument=n}static isInstance(e){return bd.hasMarker(e,o9)}};i9=Bxe;var s9="AI_JSONParseError",a9=`vercel.ai.error.${s9}`,Vxe=Symbol.for(a9),l9,_I=class extends bd{constructor({text:e,cause:t}){super({name:s9,message:`JSON parsing failed: Text: ${e}.
|
|
363
|
+
Error message: ${n9(t)}`,cause:t}),this[l9]=!0,this.text=e}static isInstance(e){return bd.hasMarker(e,a9)}};l9=Vxe;var c9="AI_TypeValidationError",u9=`vercel.ai.error.${c9}`,Wxe=Symbol.for(u9),d9,Uxe=class u_ extends bd{constructor({value:t,cause:n}){super({name:c9,message:`Type validation failed: Value: ${JSON.stringify(t)}.
|
|
364
|
+
Error message: ${n9(n)}`,cause:n}),this[d9]=!0,this.value=t}static isInstance(t){return bd.hasMarker(t,u9)}static wrap({value:t,cause:n}){return u_.isInstance(n)&&n.value===t?n:new u_({value:t,cause:n})}};d9=Wxe;var CI=Uxe;let Gxe=(e,t=21)=>(n=t)=>{let r="",o=n|0;for(;o--;)r+=e[Math.random()*e.length|0];return r};var Nd={exports:{}};const qxe=typeof Buffer<"u",EI=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,RI=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function f9(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),qxe&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));const r=JSON.parse(e,t);if(r===null||typeof r!="object")return r;const o=n&&n.protoAction||"error",i=n&&n.constructorAction||"error";if(o==="ignore"&&i==="ignore")return r;if(o!=="ignore"&&i!=="ignore"){if(EI.test(e)===!1&&RI.test(e)===!1)return r}else if(o!=="ignore"&&i==="ignore"){if(EI.test(e)===!1)return r}else if(RI.test(e)===!1)return r;return h9(r,{protoAction:o,constructorAction:i,safe:n&&n.safe})}function h9(e,{protoAction:t="error",constructorAction:n="error",safe:r}={}){let o=[e];for(;o.length;){const i=o;o=[];for(const s of i){if(t!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"__proto__")){if(r===!0)return null;if(t==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.__proto__}if(n!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"constructor")&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype")){if(r===!0)return null;if(n==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.constructor}for(const a in s){const l=s[a];l&&typeof l=="object"&&o.push(l)}}}return e}function kR(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return f9(e,t,n)}finally{Error.stackTraceLimit=r}}function Yxe(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return f9(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=n}}Nd.exports=kR;Nd.exports.default=kR;Nd.exports.parse=kR;Nd.exports.safeParse=Yxe;Nd.exports.scan=h9;var Kxe=Nd.exports;const Xxe=Ga(Kxe);var Qxe=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const o=Gxe(n,t);if(e==null)return o;if(n.includes(r))throw new Hxe({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return i=>`${e}${r}${o(i)}`},AR=Qxe(),d_=Symbol.for("vercel.ai.validator");function Zxe(e){return{[d_]:!0,validate:e}}function Jxe(e){return typeof e=="object"&&e!==null&&d_ in e&&e[d_]===!0&&"validate"in e}function ewe(e){return Jxe(e)?e:twe(e)}function twe(e){return Zxe(t=>{const n=e.safeParse(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}})}function nwe({value:e,schema:t}){const n=ewe(t);try{if(n.validate==null)return{success:!0,value:e};const r=n.validate(e);return r.success?r:{success:!1,error:CI.wrap({value:e,cause:r.error})}}catch(r){return{success:!1,error:CI.wrap({value:e,cause:r})}}}function PI({text:e,schema:t}){try{const n=Xxe.parse(e);if(t==null)return{success:!0,value:n,rawValue:n};const r=nwe({value:n,schema:t});return r.success?{...r,rawValue:n}:r}catch(n){return{success:!1,error:_I.isInstance(n)?n:new _I({text:e,cause:n})}}}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var jh={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},$h={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},zh={code:"4",name:"assistant_message",parse:e=>{if(e==null||typeof e!="object"||!("id"in e)||!("role"in e)||!("content"in e)||typeof e.id!="string"||typeof e.role!="string"||e.role!=="assistant"||!Array.isArray(e.content)||!e.content.every(t=>t!=null&&typeof t=="object"&&"type"in t&&t.type==="text"&&"text"in t&&t.text!=null&&typeof t.text=="object"&&"value"in t.text&&typeof t.text.value=="string"))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},Bh={code:"5",name:"assistant_control_data",parse:e=>{if(e==null||typeof e!="object"||!("threadId"in e)||!("messageId"in e)||typeof e.threadId!="string"||typeof e.messageId!="string")throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},Hh={code:"6",name:"data_message",parse:e=>{if(e==null||typeof e!="object"||!("role"in e)||!("data"in e)||typeof e.role!="string"||e.role!=="data")throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}},rwe=[jh,$h,zh,Bh,Hh];jh.code+"",$h.code+"",zh.code+"",Bh.code+"",Hh.code+"";jh.name+"",jh.code,$h.name+"",$h.code,zh.name+"",zh.code,Bh.name+"",Bh.code,Hh.name+"",Hh.code;rwe.map(e=>e.code);function owe({promptTokens:e,completionTokens:t}){return{promptTokens:e,completionTokens:t,totalTokens:e+t}}function iwe(e){const t=["ROOT"];let n=-1,r=null;function o(l,c,u){switch(l){case'"':{n=c,t.pop(),t.push(u),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=c,r=c,t.pop(),t.push(u),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c,t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"{":{n=c,t.pop(),t.push(u),t.push("INSIDE_OBJECT_START");break}case"[":{n=c,t.pop(),t.push(u),t.push("INSIDE_ARRAY_START");break}}}function i(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=c,t.pop();break}}}function s(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}}}for(let l=0;l<e.length;l++){const c=e[l];switch(t[t.length-1]){case"ROOT":o(c,l,"FINISH");break;case"INSIDE_OBJECT_START":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=l,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(c){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{o(c,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{i(c,l);break}case"INSIDE_STRING":{switch(c){case'"':{t.pop(),n=l;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=l}break}case"INSIDE_ARRAY_START":{switch(c){case"]":{n=l,t.pop();break}default:{n=l,o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,t.pop();break}default:{n=l;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=l;break}case"INSIDE_NUMBER":{switch(c){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const d=e.substring(r,l+1);!"false".startsWith(d)&&!"true".startsWith(d)&&!"null".startsWith(d)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?i(c,l):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l)):n=l;break}}}let a=e.slice(0,n+1);for(let l=t.length-1;l>=0;l--)switch(t[l]){case"INSIDE_STRING":{a+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{a+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{a+="]";break}case"INSIDE_LITERAL":{const u=e.substring(r,e.length);"true".startsWith(u)?a+="true".slice(u.length):"false".startsWith(u)?a+="false".slice(u.length):"null".startsWith(u)&&(a+="null".slice(u.length))}}return a}function swe(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=PI({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=PI({text:iwe(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var awe={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},lwe={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},cwe={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},uwe={code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw new Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},dwe={code:"9",name:"tool_call",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string"||!("args"in e)||typeof e.args!="object")throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},fwe={code:"a",name:"tool_result",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("result"in e))throw new Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:e}}},hwe={code:"b",name:"tool_call_streaming_start",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string")throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:e}}},pwe={code:"c",name:"tool_call_delta",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("argsTextDelta"in e)||typeof e.argsTextDelta!="string")throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:e}}},gwe={code:"d",name:"finish_message",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_message" parts expect an object with a "finishReason" property.');const t={finishReason:e.finishReason};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),{type:"finish_message",value:t}}},mwe={code:"e",name:"finish_step",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_step" parts expect an object with a "finishReason" property.');const t={finishReason:e.finishReason,isContinued:!1};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),"isContinued"in e&&typeof e.isContinued=="boolean"&&(t.isContinued=e.isContinued),{type:"finish_step",value:t}}},bwe={code:"f",name:"start_step",parse:e=>{if(e==null||typeof e!="object"||!("messageId"in e)||typeof e.messageId!="string")throw new Error('"start_step" parts expect an object with an "id" property.');return{type:"start_step",value:{messageId:e.messageId}}}},ywe={code:"g",name:"reasoning",parse:e=>{if(typeof e!="string")throw new Error('"reasoning" parts expect a string value.');return{type:"reasoning",value:e}}},vwe={code:"h",name:"source",parse:e=>{if(e==null||typeof e!="object")throw new Error('"source" parts expect a Source object.');return{type:"source",value:e}}},xwe={code:"i",name:"redacted_reasoning",parse:e=>{if(e==null||typeof e!="object"||!("data"in e)||typeof e.data!="string")throw new Error('"redacted_reasoning" parts expect an object with a "data" property.');return{type:"redacted_reasoning",value:{data:e.data}}}},wwe={code:"j",name:"reasoning_signature",parse:e=>{if(e==null||typeof e!="object"||!("signature"in e)||typeof e.signature!="string")throw new Error('"reasoning_signature" parts expect an object with a "signature" property.');return{type:"reasoning_signature",value:{signature:e.signature}}}},OR=[awe,lwe,cwe,uwe,dwe,fwe,hwe,pwe,gwe,mwe,bwe,ywe,vwe,xwe,wwe],Swe=Object.fromEntries(OR.map(e=>[e.code,e]));Object.fromEntries(OR.map(e=>[e.name,e.code]));var _we=OR.map(e=>e.code),Cwe=e=>{const t=e.indexOf(":");if(t===-1)throw new Error("Failed to parse stream string. No separator found.");const n=e.slice(0,t);if(!_we.includes(n))throw new Error(`Failed to parse stream string. Invalid code ${n}.`);const r=n,o=e.slice(t+1),i=JSON.parse(o);return Swe[r].parse(i)},Ewe=10;function Rwe(e,t){const n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return e.length=0,n}async function Pwe({stream:e,onTextPart:t,onReasoningPart:n,onReasoningSignaturePart:r,onRedactedReasoningPart:o,onSourcePart:i,onDataPart:s,onErrorPart:a,onToolCallStreamingStartPart:l,onToolCallDeltaPart:c,onToolCallPart:u,onToolResultPart:d,onMessageAnnotationsPart:p,onFinishMessagePart:h,onFinishStepPart:m,onStartStepPart:b}){const v=e.getReader(),x=new TextDecoder,w=[];let _=0;for(;;){const{value:R}=await v.read();if(R&&(w.push(R),_+=R.length,R[R.length-1]!==Ewe))continue;if(w.length===0)break;const C=Rwe(w,_);_=0;const E=x.decode(C,{stream:!0}).split(`
|
|
365
|
+
`).filter(A=>A!=="").map(Cwe);for(const{type:A,value:M}of E)switch(A){case"text":await(t==null?void 0:t(M));break;case"reasoning":await(n==null?void 0:n(M));break;case"reasoning_signature":await(r==null?void 0:r(M));break;case"redacted_reasoning":await(o==null?void 0:o(M));break;case"source":await(i==null?void 0:i(M));break;case"data":await(s==null?void 0:s(M));break;case"error":await(a==null?void 0:a(M));break;case"message_annotations":await(p==null?void 0:p(M));break;case"tool_call_streaming_start":await(l==null?void 0:l(M));break;case"tool_call_delta":await(c==null?void 0:c(M));break;case"tool_call":await(u==null?void 0:u(M));break;case"tool_result":await(d==null?void 0:d(M));break;case"finish_message":await(h==null?void 0:h(M));break;case"finish_step":await(m==null?void 0:m(M));break;case"start_step":await(b==null?void 0:b(M));break;default:{const N=A;throw new Error(`Unknown stream part type: ${N}`)}}}}async function Twe({stream:e,update:t,onToolCall:n,onFinish:r,generateId:o=AR,getCurrentDate:i=()=>new Date,lastMessage:s}){var a,l;const c=(s==null?void 0:s.role)==="assistant";let u=c?1+((l=(a=s.toolInvocations)==null?void 0:a.reduce((E,A)=>{var M;return Math.max(E,(M=A.step)!=null?M:0)},0))!=null?l:0):0;const d=c?structuredClone(s):{id:o(),createdAt:i(),role:"assistant",content:"",parts:[]};let p,h,m;function b(E,A){const M=d.parts.find(N=>N.type==="tool-invocation"&&N.toolInvocation.toolCallId===E);M!=null?M.toolInvocation=A:d.parts.push({type:"tool-invocation",toolInvocation:A})}const v=[];let x=c?s==null?void 0:s.annotations:void 0;const w={};let _={completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},R="unknown";function C(){const E=[...v];x!=null&&x.length&&(d.annotations=x);const A={...structuredClone(d),revisionId:o()};t({message:A,data:E,replaceLastMessage:c})}await Pwe({stream:e,onTextPart(E){p==null?(p={type:"text",text:E},d.parts.push(p)):p.text+=E,d.content+=E,C()},onReasoningPart(E){var A;m==null?(m={type:"text",text:E},h!=null&&h.details.push(m)):m.text+=E,h==null?(h={type:"reasoning",reasoning:E,details:[m]},d.parts.push(h)):h.reasoning+=E,d.reasoning=((A=d.reasoning)!=null?A:"")+E,C()},onReasoningSignaturePart(E){m!=null&&(m.signature=E.signature)},onRedactedReasoningPart(E){h==null&&(h={type:"reasoning",reasoning:"",details:[]},d.parts.push(h)),h.details.push({type:"redacted",data:E.data}),m=void 0,C()},onSourcePart(E){d.parts.push({type:"source",source:E}),C()},onToolCallStreamingStartPart(E){d.toolInvocations==null&&(d.toolInvocations=[]),w[E.toolCallId]={text:"",step:u,toolName:E.toolName,index:d.toolInvocations.length};const A={state:"partial-call",step:u,toolCallId:E.toolCallId,toolName:E.toolName,args:void 0};d.toolInvocations.push(A),b(E.toolCallId,A),C()},onToolCallDeltaPart(E){const A=w[E.toolCallId];A.text+=E.argsTextDelta;const{value:M}=swe(A.text),N={state:"partial-call",step:A.step,toolCallId:E.toolCallId,toolName:A.toolName,args:M};d.toolInvocations[A.index]=N,b(E.toolCallId,N),C()},async onToolCallPart(E){const A={state:"call",step:u,...E};if(w[E.toolCallId]!=null?d.toolInvocations[w[E.toolCallId].index]=A:(d.toolInvocations==null&&(d.toolInvocations=[]),d.toolInvocations.push(A)),b(E.toolCallId,A),C(),n){const M=await n({toolCall:E});if(M!=null){const N={state:"result",step:u,...E,result:M};d.toolInvocations[d.toolInvocations.length-1]=N,b(E.toolCallId,N),C()}}},onToolResultPart(E){const A=d.toolInvocations;if(A==null)throw new Error("tool_result must be preceded by a tool_call");const M=A.findIndex(L=>L.toolCallId===E.toolCallId);if(M===-1)throw new Error("tool_result must be preceded by a tool_call with the same toolCallId");const N={...A[M],state:"result",...E};A[M]=N,b(E.toolCallId,N),C()},onDataPart(E){v.push(...E),C()},onMessageAnnotationsPart(E){x==null?x=[...E]:x.push(...E),C()},onFinishStepPart(E){u+=1,p=E.isContinued?p:void 0,h=void 0,m=void 0},onStartStepPart(E){c||(d.id=E.messageId)},onFinishMessagePart(E){R=E.finishReason,E.usage!=null&&(_=owe(E.usage))},onErrorPart(E){throw new Error(E)}}),r==null||r({message:d,finishReason:R,usage:_})}async function kwe({stream:e,onTextPart:t}){const n=e.pipeThrough(new TextDecoderStream).getReader();for(;;){const{done:r,value:o}=await n.read();if(r)break;await t(o)}}async function Awe({stream:e,update:t,onFinish:n,getCurrentDate:r=()=>new Date,generateId:o=AR}){const i={type:"text",text:""},s={id:o(),createdAt:r(),role:"assistant",content:"",parts:[i]};await kwe({stream:e,onTextPart:a=>{s.content+=a,i.text+=a,t({message:{...s},data:[],replaceLastMessage:!1})}}),n==null||n(s,{usage:{completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},finishReason:"unknown"})}var Owe=()=>fetch;async function Mwe({api:e,body:t,streamProtocol:n="data",credentials:r,headers:o,abortController:i,restoreMessagesOnFailure:s,onResponse:a,onUpdate:l,onFinish:c,onToolCall:u,generateId:d,fetch:p=Owe(),lastMessage:h}){var m,b;const v=await p(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",...o},signal:(m=i==null?void 0:i())==null?void 0:m.signal,credentials:r}).catch(x=>{throw s(),x});if(a)try{await a(v)}catch(x){throw x}if(!v.ok)throw s(),new Error((b=await v.text())!=null?b:"Failed to fetch the chat response.");if(!v.body)throw new Error("The response body is empty.");switch(n){case"text":{await Awe({stream:v.body,update:l,onFinish:c,generateId:d});return}case"data":{await Twe({stream:v.body,update:l,lastMessage:h,onToolCall:u,onFinish({message:x,finishReason:w,usage:_}){c&&x!=null&&c(x,{usage:_,finishReason:w})},generateId:d});return}default:{const x=n;throw new Error(`Unknown stream protocol: ${x}`)}}}function f_(e){return e==null?void 0:e.reduce((t,n)=>{var r;return Math.max(t,(r=n.step)!=null?r:0)},0)}function p9(e){var t;return(t=e.parts)!=null?t:[...e.toolInvocations?e.toolInvocations.map(n=>({type:"tool-invocation",toolInvocation:n})):[],...e.reasoning?[{type:"reasoning",reasoning:e.reasoning,details:[{type:"text",text:e.reasoning}]}]:[],...e.content?[{type:"text",text:e.content}]:[]]}function Lw(e){return e.map(t=>({...t,parts:p9(t)}))}function h_(e,t){if(e===t)return!0;if(e==null||t==null)return!1;if(typeof e!="object"&&typeof t!="object")return e===t;if(e.constructor!==t.constructor)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(Array.isArray(e)){if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(!h_(e[o],t[o]))return!1;return!0}const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!r.includes(o)||!h_(e[o],t[o]))return!1;return!0}async function TI(e){if(!e)return[];if(e instanceof FileList)return Promise.all(Array.from(e).map(async t=>{const{name:n,type:r}=t,o=await new Promise((i,s)=>{const a=new FileReader;a.onload=l=>{var c;i((c=l.target)==null?void 0:c.result)},a.onerror=l=>s(l),a.readAsDataURL(t)});return{name:n,contentType:r,url:o}}));if(Array.isArray(e))return e;throw new Error("Invalid attachments type")}function Iwe({originalMaxToolInvocationStep:e,originalMessageCount:t,maxSteps:n,messages:r}){var o;const i=r[r.length-1];return n>1&&i!=null&&(r.length>t||f_(i.toolInvocations)!==e)&&g9(i)&&!Dwe(i)&&((o=f_(i.toolInvocations))!=null?o:0)<n}function Dwe(e){let t=!1;return e.parts.forEach(n=>{n.type==="text"&&(t=!0),n.type==="tool-invocation"&&(t=!1)}),t}function g9(e){return e.role==="assistant"&&e.parts.filter(t=>t.type==="tool-invocation").every(t=>"result"in t.toolInvocation)}function Nwe({messages:e,toolCallId:t,toolResult:n}){var r;const o=e[e.length-1],i=o.parts.find(a=>a.type==="tool-invocation"&&a.toolInvocation.toolCallId===t);if(i==null)return;const s={...i.toolInvocation,state:"result",result:n};i.toolInvocation=s,o.toolInvocations=(r=o.toolInvocations)==null?void 0:r.map(a=>a.toolCallId===t?s:a)}var m9=V_();const b9=0,y9=1,v9=2,kI=3;var AI=Object.prototype.hasOwnProperty;function p_(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&p_(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(AI.call(e,n)&&++r&&!AI.call(t,n)||!(n in t)||!p_(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const $s=new WeakMap,Oa=()=>{},Lr=Oa(),g_=Object,It=e=>e===Lr,Ui=e=>typeof e=="function",Ua=(e,t)=>({...e,...t}),x9=e=>Ui(e.then),Fw={},Mm={},MR="undefined",Dp=typeof window!=MR,m_=typeof document!=MR,Lwe=Dp&&"Deno"in window,Fwe=()=>Dp&&typeof window.requestAnimationFrame!=MR,w9=(e,t)=>{const n=$s.get(e);return[()=>!It(t)&&e.get(t)||Fw,r=>{if(!It(t)){const o=e.get(t);t in Mm||(Mm[t]=o),n[5](t,Ua(o,r),o||Fw)}},n[6],()=>!It(t)&&t in Mm?Mm[t]:!It(t)&&e.get(t)||Fw]};let b_=!0;const jwe=()=>b_,[y_,v_]=Dp&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Oa,Oa],$we=()=>{const e=m_&&document.visibilityState;return It(e)||e!=="hidden"},zwe=e=>(m_&&document.addEventListener("visibilitychange",e),y_("focus",e),()=>{m_&&document.removeEventListener("visibilitychange",e),v_("focus",e)}),Bwe=e=>{const t=()=>{b_=!0,e()},n=()=>{b_=!1};return y_("online",t),y_("offline",n),()=>{v_("online",t),v_("offline",n)}},Hwe={isOnline:jwe,isVisible:$we},Vwe={initFocus:zwe,initReconnect:Bwe},OI=!T.useId,Vh=!Dp||Lwe,Wwe=e=>Fwe()?window.requestAnimationFrame(e):setTimeout(e,1),jw=Vh?T.useEffect:T.useLayoutEffect,$w=typeof navigator<"u"&&navigator.connection,MI=!Vh&&$w&&(["slow-2g","2g"].includes($w.effectiveType)||$w.saveData),Im=new WeakMap,zw=(e,t)=>g_.prototype.toString.call(e)===`[object ${t}]`;let Uwe=0;const x_=e=>{const t=typeof e,n=zw(e,"Date"),r=zw(e,"RegExp"),o=zw(e,"Object");let i,s;if(g_(e)===e&&!n&&!r){if(i=Im.get(e),i)return i;if(i=++Uwe+"~",Im.set(e,i),Array.isArray(e)){for(i="@",s=0;s<e.length;s++)i+=x_(e[s])+",";Im.set(e,i)}if(o){i="#";const a=g_.keys(e).sort();for(;!It(s=a.pop());)It(e[s])||(i+=s+":"+x_(e[s])+",");Im.set(e,i)}}else i=n?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},IR=e=>{if(Ui(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?x_(e):"",[e,t]};let Gwe=0;const w_=()=>++Gwe;async function S9(...e){const[t,n,r,o]=e,i=Ua({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let s=i.populateCache;const a=i.rollbackOnError;let l=i.optimisticData;const c=p=>typeof a=="function"?a(p):a!==!1,u=i.throwOnError;if(Ui(n)){const p=n,h=[],m=t.keys();for(const b of m)!/^\$(inf|sub)\$/.test(b)&&p(t.get(b)._k)&&h.push(b);return Promise.all(h.map(d))}return d(n);async function d(p){const[h]=IR(p);if(!h)return;const[m,b]=w9(t,h),[v,x,w,_]=$s.get(t),R=()=>{const Z=v[h];return(Ui(i.revalidate)?i.revalidate(m().data,p):i.revalidate!==!1)&&(delete w[h],delete _[h],Z&&Z[0])?Z[0](v9).then(()=>m().data):m().data};if(e.length<3)return R();let C=r,E;const A=w_();x[h]=[A,0];const M=!It(l),N=m(),L=N.data,F=N._c,z=It(F)?L:F;if(M&&(l=Ui(l)?l(z,L):l,b({data:l,_c:z})),Ui(C))try{C=C(z)}catch(Z){E=Z}if(C&&x9(C))if(C=await C.catch(Z=>{E=Z}),A!==x[h][0]){if(E)throw E;return C}else E&&M&&c(E)&&(s=!0,b({data:z,_c:Lr}));if(s&&!E)if(Ui(s)){const Z=s(C,z);b({data:Z,error:Lr,_c:Lr})}else b({data:C,error:Lr,_c:Lr});if(x[h][1]=w_(),Promise.resolve(R()).then(()=>{b({_c:Lr})}),E){if(u)throw E;return}return C}}const II=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},qwe=(e,t)=>{if(!$s.has(e)){const n=Ua(Vwe,t),r={},o=S9.bind(Lr,e);let i=Oa;const s={},a=(u,d)=>{const p=s[u]||[];return s[u]=p,p.push(d),()=>p.splice(p.indexOf(d),1)},l=(u,d,p)=>{e.set(u,d);const h=s[u];if(h)for(const m of h)m(d,p)},c=()=>{if(!$s.has(e)&&($s.set(e,[r,{},{},{},o,l,a]),!Vh)){const u=n.initFocus(setTimeout.bind(Lr,II.bind(Lr,r,b9))),d=n.initReconnect(setTimeout.bind(Lr,II.bind(Lr,r,y9)));i=()=>{u&&u(),d&&d(),$s.delete(e)}}};return c(),[e,o,c,i]}return[e,$s.get(e)[4]]},Ywe=(e,t,n,r,o)=>{const i=n.errorRetryCount,s=o.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!It(i)&&s>i||setTimeout(r,a,o)},Kwe=p_,[_9,Xwe]=qwe(new Map),Qwe=Ua({onLoadingSlow:Oa,onSuccess:Oa,onError:Oa,onErrorRetry:Ywe,onDiscarded:Oa,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:MI?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:MI?5e3:3e3,compare:Kwe,isPaused:()=>!1,cache:_9,mutate:Xwe,fallback:{}},Hwe),Zwe=(e,t)=>{const n=Ua(e,t);if(t){const{use:r,fallback:o}=e,{use:i,fallback:s}=t;r&&i&&(n.use=r.concat(i)),o&&s&&(n.fallback=Ua(o,s))}return n},Jwe=T.createContext({}),e1e="$inf$",C9=Dp&&window.__SWR_DEVTOOLS_USE__,t1e=C9?window.__SWR_DEVTOOLS_USE__:[],n1e=()=>{C9&&(window.__SWR_DEVTOOLS_REACT__=T)},r1e=e=>Ui(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],o1e=()=>Ua(Qwe,T.useContext(Jwe)),i1e=e=>(t,n,r)=>e(t,n&&((...i)=>{const[s]=IR(t),[,,,a]=$s.get(_9);if(s.startsWith(e1e))return n(...i);const l=a[s];return It(l)?n(...i):(delete a[s],l)}),r),s1e=t1e.concat(i1e),a1e=e=>function(...n){const r=o1e(),[o,i,s]=r1e(n),a=Zwe(r,s);let l=e;const{use:c}=a,u=(c||[]).concat(s1e);for(let d=u.length;d--;)l=u[d](l);return l(o,i||a.fetcher||null,a)},l1e=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o>=0&&(r[o]=r[r.length-1],r.pop())}};n1e();const Bw=T.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Hw={dedupe:!0},c1e=(e,t,n)=>{const{cache:r,compare:o,suspense:i,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:d,keepPreviousData:p}=n,[h,m,b,v]=$s.get(r),[x,w]=IR(e),_=T.useRef(!1),R=T.useRef(!1),C=T.useRef(x),E=T.useRef(t),A=T.useRef(n),M=()=>A.current,N=()=>M().isVisible()&&M().isOnline(),[L,F,z,Z]=w9(r,x),G=T.useRef({}).current,j=It(s)?It(n.fallback)?Lr:n.fallback[x]:s,H=(pe,ce)=>{for(const _e in G){const Pe=_e;if(Pe==="data"){if(!o(pe[Pe],ce[Pe])&&(!It(pe[Pe])||!o(K,ce[Pe])))return!1}else if(ce[Pe]!==pe[Pe])return!1}return!0},$=T.useMemo(()=>{const pe=!x||!t?!1:It(a)?M().isPaused()||i?!1:l!==!1:a,ce=tt=>{const ot=Ua(tt);return delete ot._k,pe?{isValidating:!0,isLoading:!0,...ot}:ot},_e=L(),Pe=Z(),Me=ce(_e),ke=_e===Pe?Me:ce(Pe);let Ne=Me;return[()=>{const tt=ce(L());return H(tt,Ne)?(Ne.data=tt.data,Ne.isLoading=tt.isLoading,Ne.isValidating=tt.isValidating,Ne.error=tt.error,Ne):(Ne=tt,tt)},()=>ke]},[r,x]),V=m9.useSyncExternalStore(T.useCallback(pe=>z(x,(ce,_e)=>{H(_e,ce)||pe()}),[r,x]),$[0],$[1]),X=!_.current,I=h[x]&&h[x].length>0,q=V.data,U=It(q)?j&&x9(j)?Bw(j):j:q,O=V.error,J=T.useRef(U),K=p?It(q)?It(J.current)?U:J.current:q:U,ne=I&&!It(O)?!1:X&&!It(a)?a:M().isPaused()?!1:i?It(U)?!1:l:It(U)||l,Y=!!(x&&t&&X&&ne),ee=It(V.isValidating)?Y:V.isValidating,re=It(V.isLoading)?Y:V.isLoading,ue=T.useCallback(async pe=>{const ce=E.current;if(!x||!ce||R.current||M().isPaused())return!1;let _e,Pe,Me=!0;const ke=pe||{},Ne=!b[x]||!ke.dedupe,tt=()=>OI?!R.current&&x===C.current&&_.current:x===C.current,ot={isValidating:!1,isLoading:!1},gn=()=>{F(ot)},xt=()=>{const Rt=b[x];Rt&&Rt[1]===Pe&&delete b[x]},Wn={isValidating:!0};It(L().data)&&(Wn.isLoading=!0);try{if(Ne&&(F(Wn),n.loadingTimeout&&It(L().data)&&setTimeout(()=>{Me&&tt()&&M().onLoadingSlow(x,n)},n.loadingTimeout),b[x]=[ce(w),w_()]),[_e,Pe]=b[x],_e=await _e,Ne&&setTimeout(xt,n.dedupingInterval),!b[x]||b[x][1]!==Pe)return Ne&&tt()&&M().onDiscarded(x),!1;ot.error=Lr;const Rt=m[x];if(!It(Rt)&&(Pe<=Rt[0]||Pe<=Rt[1]||Rt[1]===0))return gn(),Ne&&tt()&&M().onDiscarded(x),!1;const de=L().data;ot.data=o(de,_e)?de:_e,Ne&&tt()&&M().onSuccess(_e,x,n)}catch(Rt){xt();const de=M(),{shouldRetryOnError:Se}=de;de.isPaused()||(ot.error=Rt,Ne&&tt()&&(de.onError(Rt,x,de),(Se===!0||Ui(Se)&&Se(Rt))&&(!M().revalidateOnFocus||!M().revalidateOnReconnect||N())&&de.onErrorRetry(Rt,x,de,je=>{const Be=h[x];Be&&Be[0]&&Be[0](kI,je)},{retryCount:(ke.retryCount||0)+1,dedupe:!0})))}return Me=!1,gn(),!0},[x,r]),fe=T.useCallback((...pe)=>S9(r,C.current,...pe),[]);if(jw(()=>{E.current=t,A.current=n,It(q)||(J.current=q)}),jw(()=>{if(!x)return;const pe=ue.bind(Lr,Hw);let ce=0;const Pe=l1e(x,h,(Me,ke={})=>{if(Me==b9){const Ne=Date.now();M().revalidateOnFocus&&Ne>ce&&N()&&(ce=Ne+M().focusThrottleInterval,pe())}else if(Me==y9)M().revalidateOnReconnect&&N()&&pe();else{if(Me==v9)return ue();if(Me==kI)return ue(ke)}});return R.current=!1,C.current=x,_.current=!0,F({_k:w}),ne&&(It(U)||Vh?pe():Wwe(pe)),()=>{R.current=!0,Pe()}},[x]),jw(()=>{let pe;function ce(){const Pe=Ui(c)?c(L().data):c;Pe&&pe!==-1&&(pe=setTimeout(_e,Pe))}function _e(){!L().error&&(u||M().isVisible())&&(d||M().isOnline())?ue(Hw).then(ce):ce()}return ce(),()=>{pe&&(clearTimeout(pe),pe=-1)}},[c,u,d,x]),T.useDebugValue(K),i&&It(U)&&x){if(!OI&&Vh)throw new Error("Fallback data is required when using Suspense in SSR.");E.current=t,A.current=n,R.current=!1;const pe=v[x];if(!It(pe)){const ce=fe(pe);Bw(ce)}if(It(O)){const ce=ue(Hw);It(K)||(ce.status="fulfilled",ce.value=!0),Bw(ce)}else throw O}return{mutate:fe,get data(){return G.data=!0,K},get error(){return G.error=!0,O},get isValidating(){return G.isValidating=!0,ee},get isLoading(){return G.isLoading=!0,re}}},Dm=a1e(c1e);function u1e(e,t){if(typeof e!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let n,r=0;return function(...i){clearTimeout(n);const s=Date.now(),a=s-r,l=t-a;l<=0?(r=s,e.apply(this,i)):n=setTimeout(()=>{r=Date.now(),e.apply(this,i)},l)}}var d1e=u1e;const f1e=Ga(d1e);function DI(e,t){return t!=null?f1e(e,t):e}function h1e(e){const[t,n]=T.useState(e);return T.useEffect(()=>{h_(e,t)||n(e)},[e,t]),t}function E9({api:e="/api/chat",id:t,initialMessages:n,initialInput:r="",sendExtraMessageFields:o,onToolCall:i,experimental_prepareRequestBody:s,maxSteps:a=1,streamProtocol:l="data",onResponse:c,onFinish:u,onError:d,credentials:p,headers:h,body:m,generateId:b=AR,fetch:v,keepLastMessageOnError:x=!0,experimental_throttle:w}={}){const[_]=T.useState(b),R=t??_,C=typeof e=="string"?[e,R]:R,E=h1e(n??[]),A=T.useMemo(()=>Lw(E),[E]),{data:M,mutate:N}=Dm([C,"messages"],null,{fallbackData:A}),L=T.useRef(M||[]);T.useEffect(()=>{L.current=M||[]},[M]);const{data:F,mutate:z}=Dm([C,"streamData"],null),Z=T.useRef(F);T.useEffect(()=>{Z.current=F},[F]);const{data:G="ready",mutate:j}=Dm([C,"status"],null),{data:H=void 0,mutate:$}=Dm([C,"error"],null),V=T.useRef(null),X=T.useRef({credentials:p,headers:h,body:m});T.useEffect(()=>{X.current={credentials:p,headers:h,body:m}},[p,h,m]);const I=T.useCallback(async fe=>{var se,pe;j("submitted"),$(void 0);const ce=Lw(fe.messages),_e=ce.length,Pe=f_((se=ce[ce.length-1])==null?void 0:se.toolInvocations);try{const ke=new AbortController;V.current=ke;const Ne=DI(N,w),tt=DI(z,w),ot=L.current;Ne(ce,!1);const gn=o?ce:ce.map(({role:Wn,content:Rt,experimental_attachments:de,data:Se,annotations:je,toolInvocations:Be,parts:it})=>({role:Wn,content:Rt,...de!==void 0&&{experimental_attachments:de},...Se!==void 0&&{data:Se},...je!==void 0&&{annotations:je},...Be!==void 0&&{toolInvocations:Be},...it!==void 0&&{parts:it}})),xt=Z.current;await Mwe({api:e,body:(pe=s==null?void 0:s({id:R,messages:ce,requestData:fe.data,requestBody:fe.body}))!=null?pe:{id:R,messages:gn,data:fe.data,...X.current.body,...fe.body},streamProtocol:l,credentials:X.current.credentials,headers:{...X.current.headers,...fe.headers},abortController:()=>V.current,restoreMessagesOnFailure(){x||Ne(ot,!1)},onResponse:c,onUpdate({message:Wn,data:Rt,replaceLastMessage:de}){j("streaming"),Ne([...de?ce.slice(0,ce.length-1):ce,Wn],!1),Rt!=null&&Rt.length&&tt([...xt??[],...Rt],!1)},onToolCall:i,onFinish:u,generateId:b,fetch:v,lastMessage:ce[ce.length-1]}),V.current=null,j("ready")}catch(ke){if(ke.name==="AbortError")return V.current=null,j("ready"),null;d&&ke instanceof Error&&d(ke),$(ke),j("error")}const Me=L.current;Iwe({originalMaxToolInvocationStep:Pe,originalMessageCount:_e,maxSteps:a,messages:Me})&&await I({messages:Me})},[N,j,e,X,c,u,d,$,z,Z,l,o,s,i,a,L,V,b,v,x,w,R]),q=T.useCallback(async(fe,{data:se,headers:pe,body:ce,experimental_attachments:_e}={})=>{var Pe,Me;const ke=await TI(_e),Ne=L.current.concat({...fe,id:(Pe=fe.id)!=null?Pe:b(),createdAt:(Me=fe.createdAt)!=null?Me:new Date,experimental_attachments:ke.length>0?ke:void 0,parts:p9(fe)});return I({messages:Ne,headers:pe,body:ce,data:se})},[I,b]),U=T.useCallback(async({data:fe,headers:se,body:pe}={})=>{const ce=L.current;if(ce.length===0)return null;const _e=ce[ce.length-1];return I({messages:_e.role==="assistant"?ce.slice(0,-1):ce,headers:se,body:pe,data:fe})},[I]),O=T.useCallback(()=>{V.current&&(V.current.abort(),V.current=null)},[]),J=T.useCallback(fe=>{typeof fe=="function"&&(fe=fe(L.current));const se=Lw(fe);N(se,!1),L.current=se},[N]),K=T.useCallback(fe=>{typeof fe=="function"&&(fe=fe(Z.current)),z(fe,!1),Z.current=fe},[z]),[ne,Y]=T.useState(r),ee=T.useCallback(async(fe,se={},pe)=>{var ce;if((ce=fe==null?void 0:fe.preventDefault)==null||ce.call(fe),!ne&&!se.allowEmptySubmit)return;pe&&(X.current={...X.current,...pe});const _e=await TI(se.experimental_attachments),Me={messages:L.current.concat({id:b(),createdAt:new Date,role:"user",content:ne,experimental_attachments:_e.length>0?_e:void 0,parts:[{type:"text",text:ne}]}),headers:se.headers,body:se.body,data:se.data};I(Me),Y("")},[ne,b,I]),re=fe=>{Y(fe.target.value)},ue=T.useCallback(({toolCallId:fe,result:se})=>{const pe=L.current;Nwe({messages:pe,toolCallId:fe,toolResult:se}),N(pe,!1);const ce=pe[pe.length-1];g9(ce)&&I({messages:pe})},[N,I]);return{messages:M??[],id:R,setMessages:J,data:F,setData:K,error:H,append:q,reload:U,stop:O,input:ne,setInput:Y,handleInputChange:re,handleSubmit:ee,isLoading:G==="submitted"||G==="streaming",status:G,addToolResult:ue}}var DR="Collapsible",[p1e,R9]=Vn(DR),[g1e,NR]=p1e(DR),P9=P.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,c]=wr({prop:r,defaultProp:o,onChange:s});return y.jsx(g1e,{scope:n,disabled:i,contentId:Nn(),open:l,onOpenToggle:P.useCallback(()=>c(u=>!u),[c]),children:y.jsx(Oe.div,{"data-state":$R(l),"data-disabled":i?"":void 0,...a,ref:t})})});P9.displayName=DR;var T9="CollapsibleTrigger",LR=P.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=NR(T9,n);return y.jsx(Oe.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":$R(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:Ce(e.onClick,o.onOpenToggle)})});LR.displayName=T9;var FR="CollapsibleContent",jR=P.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=NR(FR,e.__scopeCollapsible);return y.jsx(Ln,{present:n||o.open,children:({present:i})=>y.jsx(m1e,{...r,ref:t,present:i})})});jR.displayName=FR;var m1e=P.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=NR(FR,n),[a,l]=P.useState(r),c=P.useRef(null),u=et(t,c),d=P.useRef(0),p=d.current,h=P.useRef(0),m=h.current,b=s.open||a,v=P.useRef(b),x=P.useRef(void 0);return P.useEffect(()=>{const w=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(w)},[]),or(()=>{const w=c.current;if(w){x.current=x.current||{transitionDuration:w.style.transitionDuration,animationName:w.style.animationName},w.style.transitionDuration="0s",w.style.animationName="none";const _=w.getBoundingClientRect();d.current=_.height,h.current=_.width,v.current||(w.style.transitionDuration=x.current.transitionDuration,w.style.animationName=x.current.animationName),l(r)}},[s.open,r]),y.jsx(Oe.div,{"data-state":$R(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!b,...i,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:b&&o})});function $R(e){return e?"open":"closed"}var k9=P9,b1e=LR,y1e=jR;const v1e=k9,x1e=LR,w1e=jR;function S1e(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const _1e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,C1e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,E1e={};function NI(e,t){return(E1e.jsx?C1e:_1e).test(e)}const R1e=/[ \t\n\f\r]/g;function P1e(e){return typeof e=="object"?e.type==="text"?LI(e.value):!1:LI(e)}function LI(e){return e.replace(R1e,"")===""}class Np{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Np.prototype.normal={};Np.prototype.property={};Np.prototype.space=void 0;function A9(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new Np(n,r,t)}function S_(e){return e.toLowerCase()}class uo{constructor(t,n){this.attribute=n,this.property=t}}uo.prototype.attribute="";uo.prototype.booleanish=!1;uo.prototype.boolean=!1;uo.prototype.commaOrSpaceSeparated=!1;uo.prototype.commaSeparated=!1;uo.prototype.defined=!1;uo.prototype.mustUseProperty=!1;uo.prototype.number=!1;uo.prototype.overloadedBoolean=!1;uo.prototype.property="";uo.prototype.spaceSeparated=!1;uo.prototype.space=void 0;let T1e=0;const at=Mc(),Mn=Mc(),O9=Mc(),Re=Mc(),nn=Mc(),Au=Mc(),So=Mc();function Mc(){return 2**++T1e}const __=Object.freeze(Object.defineProperty({__proto__:null,boolean:at,booleanish:Mn,commaOrSpaceSeparated:So,commaSeparated:Au,number:Re,overloadedBoolean:O9,spaceSeparated:nn},Symbol.toStringTag,{value:"Module"})),Vw=Object.keys(__);class zR extends uo{constructor(t,n,r,o){let i=-1;if(super(t,n),FI(this,"space",o),typeof r=="number")for(;++i<Vw.length;){const s=Vw[i];FI(this,Vw[i],(r&__[s])===__[s])}}}zR.prototype.defined=!0;function FI(e,t,n){n&&(e[t]=n)}function Ld(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new zR(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[S_(r)]=r,n[S_(i.attribute)]=r}return new Np(t,n,e.space)}const M9=Ld({properties:{ariaActiveDescendant:null,ariaAtomic:Mn,ariaAutoComplete:null,ariaBusy:Mn,ariaChecked:Mn,ariaColCount:Re,ariaColIndex:Re,ariaColSpan:Re,ariaControls:nn,ariaCurrent:null,ariaDescribedBy:nn,ariaDetails:null,ariaDisabled:Mn,ariaDropEffect:nn,ariaErrorMessage:null,ariaExpanded:Mn,ariaFlowTo:nn,ariaGrabbed:Mn,ariaHasPopup:null,ariaHidden:Mn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nn,ariaLevel:Re,ariaLive:null,ariaModal:Mn,ariaMultiLine:Mn,ariaMultiSelectable:Mn,ariaOrientation:null,ariaOwns:nn,ariaPlaceholder:null,ariaPosInSet:Re,ariaPressed:Mn,ariaReadOnly:Mn,ariaRelevant:null,ariaRequired:Mn,ariaRoleDescription:nn,ariaRowCount:Re,ariaRowIndex:Re,ariaRowSpan:Re,ariaSelected:Mn,ariaSetSize:Re,ariaSort:null,ariaValueMax:Re,ariaValueMin:Re,ariaValueNow:Re,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function I9(e,t){return t in e?e[t]:t}function D9(e,t){return I9(e,t.toLowerCase())}const k1e=Ld({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Au,acceptCharset:nn,accessKey:nn,action:null,allow:null,allowFullScreen:at,allowPaymentRequest:at,allowUserMedia:at,alt:null,as:null,async:at,autoCapitalize:null,autoComplete:nn,autoFocus:at,autoPlay:at,blocking:nn,capture:null,charSet:null,checked:at,cite:null,className:nn,cols:Re,colSpan:null,content:null,contentEditable:Mn,controls:at,controlsList:nn,coords:Re|Au,crossOrigin:null,data:null,dateTime:null,decoding:null,default:at,defer:at,dir:null,dirName:null,disabled:at,download:O9,draggable:Mn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:at,formTarget:null,headers:nn,height:Re,hidden:at,high:Re,href:null,hrefLang:null,htmlFor:nn,httpEquiv:nn,id:null,imageSizes:null,imageSrcSet:null,inert:at,inputMode:null,integrity:null,is:null,isMap:at,itemId:null,itemProp:nn,itemRef:nn,itemScope:at,itemType:nn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:at,low:Re,manifest:null,max:null,maxLength:Re,media:null,method:null,min:null,minLength:Re,multiple:at,muted:at,name:null,nonce:null,noModule:at,noValidate:at,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:at,optimum:Re,pattern:null,ping:nn,placeholder:null,playsInline:at,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:at,referrerPolicy:null,rel:nn,required:at,reversed:at,rows:Re,rowSpan:Re,sandbox:nn,scope:null,scoped:at,seamless:at,selected:at,shadowRootClonable:at,shadowRootDelegatesFocus:at,shadowRootMode:null,shape:null,size:Re,sizes:null,slot:null,span:Re,spellCheck:Mn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Re,step:null,style:null,tabIndex:Re,target:null,title:null,translate:null,type:null,typeMustMatch:at,useMap:null,value:Mn,width:Re,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nn,axis:null,background:null,bgColor:null,border:Re,borderColor:null,bottomMargin:Re,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:at,declare:at,event:null,face:null,frame:null,frameBorder:null,hSpace:Re,leftMargin:Re,link:null,longDesc:null,lowSrc:null,marginHeight:Re,marginWidth:Re,noResize:at,noHref:at,noShade:at,noWrap:at,object:null,profile:null,prompt:null,rev:null,rightMargin:Re,rules:null,scheme:null,scrolling:Mn,standby:null,summary:null,text:null,topMargin:Re,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Re,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:at,disableRemotePlayback:at,prefix:null,property:null,results:Re,security:null,unselectable:null},space:"html",transform:D9}),A1e=Ld({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:So,accentHeight:Re,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Re,amplitude:Re,arabicForm:null,ascent:Re,attributeName:null,attributeType:null,azimuth:Re,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Re,by:null,calcMode:null,capHeight:Re,className:nn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Re,diffuseConstant:Re,direction:null,display:null,dur:null,divisor:Re,dominantBaseline:null,download:at,dx:null,dy:null,edgeMode:null,editable:null,elevation:Re,enableBackground:null,end:null,event:null,exponent:Re,externalResourcesRequired:null,fill:null,fillOpacity:Re,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Au,g2:Au,glyphName:Au,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Re,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Re,horizOriginX:Re,horizOriginY:Re,id:null,ideographic:Re,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Re,k:Re,k1:Re,k2:Re,k3:Re,k4:Re,kernelMatrix:So,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Re,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Re,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Re,overlineThickness:Re,paintOrder:null,panose1:null,path:null,pathLength:Re,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Re,pointsAtY:Re,pointsAtZ:Re,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:So,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:So,rev:So,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:So,requiredFeatures:So,requiredFonts:So,requiredFormats:So,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Re,specularExponent:Re,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Re,strikethroughThickness:Re,string:null,stroke:null,strokeDashArray:So,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Re,strokeOpacity:Re,strokeWidth:null,style:null,surfaceScale:Re,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:So,tabIndex:Re,tableValues:null,target:null,targetX:Re,targetY:Re,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:So,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Re,underlineThickness:Re,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Re,values:null,vAlphabetic:Re,vMathematical:Re,vectorEffect:null,vHanging:Re,vIdeographic:Re,version:null,vertAdvY:Re,vertOriginX:Re,vertOriginY:Re,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Re,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:I9}),N9=Ld({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),L9=Ld({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:D9}),F9=Ld({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),O1e={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},M1e=/[A-Z]/g,jI=/-[a-z]/g,I1e=/^data[-\w.:]+$/i;function D1e(e,t){const n=S_(t);let r=t,o=uo;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&I1e.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(jI,L1e);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!jI.test(i)){let s=i.replace(M1e,N1e);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=zR}return new o(r,t)}function N1e(e){return"-"+e.toLowerCase()}function L1e(e){return e.charAt(1).toUpperCase()}const F1e=A9([M9,k1e,N9,L9,F9],"html"),BR=A9([M9,A1e,N9,L9,F9],"svg");function j1e(e){return e.join(" ").trim()}var HR={},$I=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,$1e=/\n/g,z1e=/^\s*/,B1e=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,H1e=/^:\s*/,V1e=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,W1e=/^[;\s]*/,U1e=/^\s+|\s+$/g,G1e=`
|
|
366
|
+
`,zI="/",BI="*",kl="",q1e="comment",Y1e="declaration",K1e=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(m){var b=m.match($1e);b&&(n+=b.length);var v=m.lastIndexOf(G1e);r=~v?m.length-v:r+m.length}function i(){var m={line:n,column:r};return function(b){return b.position=new s(m),c(),b}}function s(m){this.start=m,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(m){var b=new Error(t.source+":"+n+":"+r+": "+m);if(b.reason=m,b.filename=t.source,b.line=n,b.column=r,b.source=e,!t.silent)throw b}function l(m){var b=m.exec(e);if(b){var v=b[0];return o(v),e=e.slice(v.length),b}}function c(){l(z1e)}function u(m){var b;for(m=m||[];b=d();)b!==!1&&m.push(b);return m}function d(){var m=i();if(!(zI!=e.charAt(0)||BI!=e.charAt(1))){for(var b=2;kl!=e.charAt(b)&&(BI!=e.charAt(b)||zI!=e.charAt(b+1));)++b;if(b+=2,kl===e.charAt(b-1))return a("End of comment missing");var v=e.slice(2,b-2);return r+=2,o(v),e=e.slice(b),r+=2,m({type:q1e,comment:v})}}function p(){var m=i(),b=l(B1e);if(b){if(d(),!l(H1e))return a("property missing ':'");var v=l(V1e),x=m({type:Y1e,property:HI(b[0].replace($I,kl)),value:v?HI(v[0].replace($I,kl)):kl});return l(W1e),x}}function h(){var m=[];u(m);for(var b;b=p();)b!==!1&&(m.push(b),u(m));return m}return c(),h()};function HI(e){return e?e.replace(U1e,kl):kl}var X1e=Bi&&Bi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(HR,"__esModule",{value:!0});HR.default=Z1e;var Q1e=X1e(K1e);function Z1e(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,Q1e.default)(e),o=typeof t=="function";return r.forEach(function(i){if(i.type==="declaration"){var s=i.property,a=i.value;o?t(s,a,i):a&&(n=n||{},n[s]=a)}}),n}var My={};Object.defineProperty(My,"__esModule",{value:!0});My.camelCase=void 0;var J1e=/^--[a-zA-Z0-9_-]+$/,eSe=/-([a-z])/g,tSe=/^[^-]+$/,nSe=/^-(webkit|moz|ms|o|khtml)-/,rSe=/^-(ms)-/,oSe=function(e){return!e||tSe.test(e)||J1e.test(e)},iSe=function(e,t){return t.toUpperCase()},VI=function(e,t){return"".concat(t,"-")},sSe=function(e,t){return t===void 0&&(t={}),oSe(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(rSe,VI):e=e.replace(nSe,VI),e.replace(eSe,iSe))};My.camelCase=sSe;var aSe=Bi&&Bi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},lSe=aSe(HR),cSe=My;function C_(e,t){var n={};return!e||typeof e!="string"||(0,lSe.default)(e,function(r,o){r&&o&&(n[(0,cSe.camelCase)(r,t)]=o)}),n}C_.default=C_;var uSe=C_;const dSe=Ga(uSe),j9=$9("end"),VR=$9("start");function $9(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function fSe(e){const t=VR(e),n=j9(e);if(t&&n)return{start:t,end:n}}function dh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?WI(e.position):"start"in e||"end"in e?WI(e):"line"in e||"column"in e?E_(e):""}function E_(e){return UI(e&&e.line)+":"+UI(e&&e.column)}function WI(e){return E_(e&&e.start)+"-"+E_(e&&e.end)}function UI(e){return e&&typeof e=="number"?e:1}class Sr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(s=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=o,this.line=a?a.line:void 0,this.name=dh(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}Sr.prototype.file="";Sr.prototype.name="";Sr.prototype.reason="";Sr.prototype.message="";Sr.prototype.stack="";Sr.prototype.column=void 0;Sr.prototype.line=void 0;Sr.prototype.ancestors=void 0;Sr.prototype.cause=void 0;Sr.prototype.fatal=void 0;Sr.prototype.place=void 0;Sr.prototype.ruleId=void 0;Sr.prototype.source=void 0;const WR={}.hasOwnProperty,hSe=new Map,pSe=/[A-Z]/g,gSe=new Set(["table","tbody","thead","tfoot","tr"]),mSe=new Set(["td","th"]),z9="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function bSe(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=ESe(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=CSe(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?BR:F1e,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=B9(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function B9(e,t,n){if(t.type==="element")return ySe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return vSe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return wSe(e,t,n);if(t.type==="mdxjsEsm")return xSe(e,t);if(t.type==="root")return SSe(e,t,n);if(t.type==="text")return _Se(e,t)}function ySe(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=BR,e.schema=o),e.ancestors.push(t);const i=V9(e,t.tagName,!1),s=RSe(e,t);let a=GR(e,t);return gSe.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!P1e(l):!0})),H9(e,s,i,t),UR(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function vSe(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Wh(e,t.position)}function xSe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Wh(e,t.position)}function wSe(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=BR,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:V9(e,t.name,!0),s=PSe(e,t),a=GR(e,t);return H9(e,s,i,t),UR(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function SSe(e,t,n){const r={};return UR(r,GR(e,t)),e.create(t,e.Fragment,r,n)}function _Se(e,t){return t.value}function H9(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function UR(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function CSe(e,t,n){return r;function r(o,i,s,a){const c=Array.isArray(s.children)?n:t;return a?c(i,s,a):c(i,s)}}function ESe(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=VR(r);return t(o,i,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function RSe(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&WR.call(t.properties,o)){const i=TSe(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&mSe.has(t.tagName)?r=a:n[s]=a}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function PSe(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const s=i.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Wh(e,t.position);else{const o=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else Wh(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function GR(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:hSe;for(;++r<t.children.length;){const i=t.children[r];let s;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=o.get(l)||0;s=l+"-"+c,o.set(l,c+1)}}const a=B9(e,i,s);a!==void 0&&n.push(a)}return n}function TSe(e,t,n){const r=D1e(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?S1e(n):j1e(n)),r.property==="style"){let o=typeof n=="object"?n:kSe(e,String(n));return e.stylePropertyNameCase==="css"&&(o=ASe(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?O1e[r.property]||r.property:r.attribute,n]}}function kSe(e,t){try{return dSe(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new Sr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=z9+"#cannot-parse-style-attribute",o}}function V9(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let i=-1,s;for(;++i<o.length;){const a=NI(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}r=s}else r=NI(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return WR.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Wh(e)}function Wh(e,t){const n=new Sr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=z9+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ASe(e){const t={};let n;for(n in e)WR.call(e,n)&&(t[OSe(n)]=e[n]);return t}function OSe(e){let t=e.replace(pSe,MSe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function MSe(e){return"-"+e.toLowerCase()}const Ww={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},ISe={};function DSe(e,t){const n=ISe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return W9(e,r,o)}function W9(e,t,n){if(NSe(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return GI(e.children,t,n)}return Array.isArray(e)?GI(e,t,n):""}function GI(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=W9(e[o],t,n);return r.join("")}function NSe(e){return!!(e&&typeof e=="object")}const qI=document.createElement("i");function qR(e){const t="&"+e+";";qI.innerHTML=t;const n=qI.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ss(e,t,n,r){const o=e.length;let i=0,s;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function Qo(e,t){return e.length>0?(ss(e,e.length,0,t),e):t}const YI={}.hasOwnProperty;function LSe(e){const t={};let n=-1;for(;++n<e.length;)FSe(t,e[n]);return t}function FSe(e,t){let n;for(n in t){const o=(YI.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){YI.call(o,s)||(o[s]=[]);const a=i[s];jSe(o[s],Array.isArray(a)?a:a?[a]:[])}}}function jSe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ss(e,0,0,r)}function U9(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ou(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Gi=tl(/[A-Za-z]/),Po=tl(/[\dA-Za-z]/),$Se=tl(/[#-'*+\--9=?A-Z^-~]/);function R_(e){return e!==null&&(e<32||e===127)}const P_=tl(/\d/),zSe=tl(/[\dA-Fa-f]/),BSe=tl(/[!-/:-@[-`{-~]/);function Qe(e){return e!==null&&e<-2}function ao(e){return e!==null&&(e<0||e===32)}function Ft(e){return e===-2||e===-1||e===32}const HSe=tl(new RegExp("\\p{P}|\\p{S}","u")),VSe=tl(/\s/);function tl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Fd(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&Po(e.charCodeAt(n+1))&&Po(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(s=String.fromCharCode(i,a),o=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+o+1,s=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function rn(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return Ft(l)?(e.enter(n),a(l)):t(l)}function a(l){return Ft(l)&&i++<o?(e.consume(l),a):(e.exit(n),t(l))}}const WSe={tokenize:USe};function USe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),rn(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),i(a)}function i(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Qe(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),s)}}const GSe={tokenize:qSe},KI={tokenize:YSe};function qSe(e){const t=this,n=[];let r=0,o,i,s;return a;function a(_){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,l,c)(_)}return c(_)}function l(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&w();const R=t.events.length;let C=R,E;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){E=t.events[C][1].end;break}x(r);let A=R;for(;A<t.events.length;)t.events[A][1].end={...E},A++;return ss(t.events,C+1,0,t.events.slice(R)),t.events.length=A,c(_)}return a(_)}function c(_){if(r===n.length){if(!o)return p(_);if(o.currentConstruct&&o.currentConstruct.concrete)return m(_);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(KI,u,d)(_)}function u(_){return o&&w(),x(r),p(_)}function d(_){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(_)}function p(_){return t.containerState={},e.attempt(KI,h,m)(_)}function h(_){return r++,n.push([t.currentConstruct,t.containerState]),p(_)}function m(_){if(_===null){o&&w(),x(0),e.consume(_);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),b(_)}function b(_){if(_===null){v(e.exit("chunkFlow"),!0),x(0),e.consume(_);return}return Qe(_)?(e.consume(_),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(_),b)}function v(_,R){const C=t.sliceStream(_);if(R&&C.push(null),_.previous=i,i&&(i.next=_),i=_,o.defineSkip(_.start),o.write(C),t.parser.lazy[_.start.line]){let E=o.events.length;for(;E--;)if(o.events[E][1].start.offset<s&&(!o.events[E][1].end||o.events[E][1].end.offset>s))return;const A=t.events.length;let M=A,N,L;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(N){L=t.events[M][1].end;break}N=!0}for(x(r),E=A;E<t.events.length;)t.events[E][1].end={...L},E++;ss(t.events,M+1,0,t.events.slice(A)),t.events.length=E}}function x(_){let R=n.length;for(;R-- >_;){const C=n[R];t.containerState=C[1],C[0].exit.call(t,e)}n.length=_}function w(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function YSe(e,t,n){return rn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function XI(e){if(e===null||ao(e)||VSe(e))return 1;if(HSe(e))return 2}function YR(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const T_={name:"attention",resolveAll:KSe,tokenize:XSe};function KSe(e,t){let n=-1,r,o,i,s,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[n][1].start};QI(d,-l),QI(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Qo(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Qo(c,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=Qo(c,YR(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Qo(c,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Qo(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,ss(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function XSe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=XI(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;const c=e.exit("attentionSequence"),u=XI(l),d=!u||u===2&&o||n.includes(l),p=!o||o===2&&u||n.includes(r);return c._open=!!(i===42?d:d&&(o||!p)),c._close=!!(i===42?p:p&&(u||!d)),t(l)}}function QI(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const QSe={name:"autolink",tokenize:ZSe};function ZSe(e,t,n){let r=0;return o;function o(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(h){return Gi(h)?(e.consume(h),s):h===64?n(h):c(h)}function s(h){return h===43||h===45||h===46||Po(h)?(r=1,a(h)):c(h)}function a(h){return h===58?(e.consume(h),r=0,l):(h===43||h===45||h===46||Po(h))&&r++<32?(e.consume(h),a):(r=0,c(h))}function l(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||R_(h)?n(h):(e.consume(h),l)}function c(h){return h===64?(e.consume(h),u):$Se(h)?(e.consume(h),c):n(h)}function u(h){return Po(h)?d(h):n(h)}function d(h){return h===46?(e.consume(h),r=0,u):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||Po(h))&&r++<63){const m=h===45?p:d;return e.consume(h),m}return n(h)}}const Iy={partial:!0,tokenize:JSe};function JSe(e,t,n){return r;function r(i){return Ft(i)?rn(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||Qe(i)?t(i):n(i)}}const G9={continuation:{tokenize:t_e},exit:n_e,name:"blockQuote",tokenize:e_e};function e_e(e,t,n){const r=this;return o;function o(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return n(s)}function i(s){return Ft(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function t_e(e,t,n){const r=this;return o;function o(s){return Ft(s)?rn(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(G9,t,n)(s)}}function n_e(e){e.exit("blockQuote")}const q9={name:"characterEscape",tokenize:r_e};function r_e(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return BSe(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Y9={name:"characterReference",tokenize:o_e};function o_e(e,t,n){const r=this;let o=0,i,s;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,s=Po,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=zSe,u):(e.enter("characterReferenceValue"),i=7,s=P_,u(d))}function u(d){if(d===59&&o){const p=e.exit("characterReferenceValue");return s===Po&&!qR(r.sliceSerialize(p))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&o++<i?(e.consume(d),u):n(d)}}const ZI={partial:!0,tokenize:s_e},JI={concrete:!0,name:"codeFenced",tokenize:i_e};function i_e(e,t,n){const r=this,o={partial:!0,tokenize:C};let i=0,s=0,a;return l;function l(E){return c(E)}function c(E){const A=r.events[r.events.length-1];return i=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,a=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(E)}function u(E){return E===a?(s++,e.consume(E),u):s<3?n(E):(e.exit("codeFencedFenceSequence"),Ft(E)?rn(e,d,"whitespace")(E):d(E))}function d(E){return E===null||Qe(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(ZI,b,R)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(E))}function p(E){return E===null||Qe(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(E)):Ft(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),rn(e,h,"whitespace")(E)):E===96&&E===a?n(E):(e.consume(E),p)}function h(E){return E===null||Qe(E)?d(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(E))}function m(E){return E===null||Qe(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(E)):E===96&&E===a?n(E):(e.consume(E),m)}function b(E){return e.attempt(o,R,v)(E)}function v(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),x}function x(E){return i>0&&Ft(E)?rn(e,w,"linePrefix",i+1)(E):w(E)}function w(E){return E===null||Qe(E)?e.check(ZI,b,R)(E):(e.enter("codeFlowValue"),_(E))}function _(E){return E===null||Qe(E)?(e.exit("codeFlowValue"),w(E)):(e.consume(E),_)}function R(E){return e.exit("codeFenced"),t(E)}function C(E,A,M){let N=0;return L;function L(j){return E.enter("lineEnding"),E.consume(j),E.exit("lineEnding"),F}function F(j){return E.enter("codeFencedFence"),Ft(j)?rn(E,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):z(j)}function z(j){return j===a?(E.enter("codeFencedFenceSequence"),Z(j)):M(j)}function Z(j){return j===a?(N++,E.consume(j),Z):N>=s?(E.exit("codeFencedFenceSequence"),Ft(j)?rn(E,G,"whitespace")(j):G(j)):M(j)}function G(j){return j===null||Qe(j)?(E.exit("codeFencedFence"),A(j)):M(j)}}}function s_e(e,t,n){const r=this;return o;function o(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Uw={name:"codeIndented",tokenize:l_e},a_e={partial:!0,tokenize:c_e};function l_e(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),rn(e,i,"linePrefix",5)(c)}function i(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):Qe(c)?e.attempt(a_e,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||Qe(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function c_e(e,t,n){const r=this;return o;function o(s){return r.parser.lazy[r.now().line]?n(s):Qe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):rn(e,i,"linePrefix",5)(s)}function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):Qe(s)?o(s):n(s)}}const u_e={name:"codeText",previous:f_e,resolve:d_e,tokenize:h_e};function d_e(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function f_e(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function h_e(e,t,n){let r=0,o,i;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(i=e.enter("codeTextSequence"),o=0,u(d)):Qe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||Qe(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),o++,u):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(i.type="codeTextData",c(d))}}class p_e{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const o=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&Cf(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Cf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Cf(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Cf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Cf(this.left,n.reverse())}}}function Cf(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function K9(e){const t={};let n=-1,r,o,i,s,a,l,c;const u=new p_e(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,g_e(u,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,o=void 0;i--;)if(s=u.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(o&&(u.get(o)[1].type="lineEndingBlank"),s[1].type="lineEnding",o=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;o&&(r[1].end={...u.get(o)[1].start},a=u.slice(o,n),a.unshift(r),u.splice(o,n-o+1,a))}}return ss(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function g_e(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],c={};let u,d,p=-1,h=n,m=0,b=0;const v=[b];for(;h;){for(;e.get(++o)[1]!==h;);i.push(o),h._tokenizer||(u=r.sliceStream(h),h.next||u.push(null),d&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=h,h=h.next}for(h=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(b=p+1,v.push(b),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):v.pop(),p=v.length;p--;){const x=a.slice(v[p],v[p+1]),w=i.pop();l.push([w,w+x.length-1]),e.splice(w,2,x)}for(l.reverse(),p=-1;++p<l.length;)c[m+l[p][0]]=m+l[p][1],m+=l[p][1]-l[p][0]-1;return c}const m_e={resolve:y_e,tokenize:v_e},b_e={partial:!0,tokenize:x_e};function y_e(e){return K9(e),e}function v_e(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(a)}function o(a){return a===null?i(a):Qe(a)?e.check(b_e,s,i)(a):(e.consume(a),o)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function x_e(e,t,n){const r=this;return o;function o(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),rn(e,i,"linePrefix")}function i(s){if(s===null||Qe(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function X9(e,t,n,r,o,i,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(x){return x===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(x),e.exit(i),p):x===null||x===32||x===41||R_(x)?n(x):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(x))}function p(x){return x===62?(e.enter(i),e.consume(x),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===62?(e.exit("chunkString"),e.exit(a),p(x)):x===null||x===60||Qe(x)?n(x):(e.consume(x),x===92?m:h)}function m(x){return x===60||x===62||x===92?(e.consume(x),h):h(x)}function b(x){return!u&&(x===null||x===41||ao(x))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(x)):u<c&&x===40?(e.consume(x),u++,b):x===41?(e.consume(x),u--,b):x===null||x===32||x===40||R_(x)?n(x):(e.consume(x),x===92?v:b)}function v(x){return x===40||x===41||x===92?(e.consume(x),b):b(x)}}function Q9(e,t,n,r,o,i){const s=this;let a=0,l;return c;function c(h){return e.enter(r),e.enter(o),e.consume(h),e.exit(o),e.enter(i),u}function u(h){return a>999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):h===93?(e.exit(i),e.enter(o),e.consume(h),e.exit(o),e.exit(r),t):Qe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||Qe(h)||a++>999?(e.exit("chunkString"),u(h)):(e.consume(h),l||(l=!Ft(h)),h===92?p:d)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,d):d(h)}}function Z9(e,t,n,r,o,i){let s;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(o),e.consume(p),e.exit(o),s=p===40?41:p,l):n(p)}function l(p){return p===s?(e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):(e.enter(i),c(p))}function c(p){return p===s?(e.exit(i),l(s)):p===null?n(p):Qe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),rn(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===s||p===null||Qe(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?d:u)}function d(p){return p===s||p===92?(e.consume(p),u):u(p)}}function fh(e,t){let n;return r;function r(o){return Qe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Ft(o)?rn(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const w_e={name:"definition",tokenize:__e},S_e={partial:!0,tokenize:C_e};function __e(e,t,n){const r=this;let o;return i;function i(h){return e.enter("definition"),s(h)}function s(h){return Q9.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return o=Ou(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return ao(h)?fh(e,c)(h):c(h)}function c(h){return X9(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return e.attempt(S_e,d,d)(h)}function d(h){return Ft(h)?rn(e,p,"whitespace")(h):p(h)}function p(h){return h===null||Qe(h)?(e.exit("definition"),r.parser.defined.push(o),t(h)):n(h)}}function C_e(e,t,n){return r;function r(a){return ao(a)?fh(e,o)(a):n(a)}function o(a){return Z9(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return Ft(a)?rn(e,s,"whitespace")(a):s(a)}function s(a){return a===null||Qe(a)?t(a):n(a)}}const E_e={name:"hardBreakEscape",tokenize:R_e};function R_e(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return Qe(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const P_e={name:"headingAtx",resolve:T_e,tokenize:k_e};function T_e(e,t){let n=e.length-2,r=3,o,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ss(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function k_e(e,t,n){let r=0;return o;function o(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||ao(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||Qe(u)?(e.exit("atxHeading"),t(u)):Ft(u)?rn(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||ao(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const A_e=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],eD=["pre","script","style","textarea"],O_e={concrete:!0,name:"htmlFlow",resolveTo:D_e,tokenize:N_e},M_e={partial:!0,tokenize:F_e},I_e={partial:!0,tokenize:L_e};function D_e(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function N_e(e,t,n){const r=this;let o,i,s,a,l;return c;function c(O){return u(O)}function u(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),d}function d(O){return O===33?(e.consume(O),p):O===47?(e.consume(O),i=!0,b):O===63?(e.consume(O),o=3,r.interrupt?t:I):Gi(O)?(e.consume(O),s=String.fromCharCode(O),v):n(O)}function p(O){return O===45?(e.consume(O),o=2,h):O===91?(e.consume(O),o=5,a=0,m):Gi(O)?(e.consume(O),o=4,r.interrupt?t:I):n(O)}function h(O){return O===45?(e.consume(O),r.interrupt?t:I):n(O)}function m(O){const J="CDATA[";return O===J.charCodeAt(a++)?(e.consume(O),a===J.length?r.interrupt?t:z:m):n(O)}function b(O){return Gi(O)?(e.consume(O),s=String.fromCharCode(O),v):n(O)}function v(O){if(O===null||O===47||O===62||ao(O)){const J=O===47,K=s.toLowerCase();return!J&&!i&&eD.includes(K)?(o=1,r.interrupt?t(O):z(O)):A_e.includes(s.toLowerCase())?(o=6,J?(e.consume(O),x):r.interrupt?t(O):z(O)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):i?w(O):_(O))}return O===45||Po(O)?(e.consume(O),s+=String.fromCharCode(O),v):n(O)}function x(O){return O===62?(e.consume(O),r.interrupt?t:z):n(O)}function w(O){return Ft(O)?(e.consume(O),w):L(O)}function _(O){return O===47?(e.consume(O),L):O===58||O===95||Gi(O)?(e.consume(O),R):Ft(O)?(e.consume(O),_):L(O)}function R(O){return O===45||O===46||O===58||O===95||Po(O)?(e.consume(O),R):C(O)}function C(O){return O===61?(e.consume(O),E):Ft(O)?(e.consume(O),C):_(O)}function E(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),l=O,A):Ft(O)?(e.consume(O),E):M(O)}function A(O){return O===l?(e.consume(O),l=null,N):O===null||Qe(O)?n(O):(e.consume(O),A)}function M(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||ao(O)?C(O):(e.consume(O),M)}function N(O){return O===47||O===62||Ft(O)?_(O):n(O)}function L(O){return O===62?(e.consume(O),F):n(O)}function F(O){return O===null||Qe(O)?z(O):Ft(O)?(e.consume(O),F):n(O)}function z(O){return O===45&&o===2?(e.consume(O),H):O===60&&o===1?(e.consume(O),$):O===62&&o===4?(e.consume(O),q):O===63&&o===3?(e.consume(O),I):O===93&&o===5?(e.consume(O),X):Qe(O)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(M_e,U,Z)(O)):O===null||Qe(O)?(e.exit("htmlFlowData"),Z(O)):(e.consume(O),z)}function Z(O){return e.check(I_e,G,U)(O)}function G(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),j}function j(O){return O===null||Qe(O)?Z(O):(e.enter("htmlFlowData"),z(O))}function H(O){return O===45?(e.consume(O),I):z(O)}function $(O){return O===47?(e.consume(O),s="",V):z(O)}function V(O){if(O===62){const J=s.toLowerCase();return eD.includes(J)?(e.consume(O),q):z(O)}return Gi(O)&&s.length<8?(e.consume(O),s+=String.fromCharCode(O),V):z(O)}function X(O){return O===93?(e.consume(O),I):z(O)}function I(O){return O===62?(e.consume(O),q):O===45&&o===2?(e.consume(O),I):z(O)}function q(O){return O===null||Qe(O)?(e.exit("htmlFlowData"),U(O)):(e.consume(O),q)}function U(O){return e.exit("htmlFlow"),t(O)}}function L_e(e,t,n){const r=this;return o;function o(s){return Qe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function F_e(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Iy,t,n)}}const j_e={name:"htmlText",tokenize:$_e};function $_e(e,t,n){const r=this;let o,i,s;return a;function a(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),l}function l(I){return I===33?(e.consume(I),c):I===47?(e.consume(I),C):I===63?(e.consume(I),_):Gi(I)?(e.consume(I),M):n(I)}function c(I){return I===45?(e.consume(I),u):I===91?(e.consume(I),i=0,m):Gi(I)?(e.consume(I),w):n(I)}function u(I){return I===45?(e.consume(I),h):n(I)}function d(I){return I===null?n(I):I===45?(e.consume(I),p):Qe(I)?(s=d,$(I)):(e.consume(I),d)}function p(I){return I===45?(e.consume(I),h):d(I)}function h(I){return I===62?H(I):I===45?p(I):d(I)}function m(I){const q="CDATA[";return I===q.charCodeAt(i++)?(e.consume(I),i===q.length?b:m):n(I)}function b(I){return I===null?n(I):I===93?(e.consume(I),v):Qe(I)?(s=b,$(I)):(e.consume(I),b)}function v(I){return I===93?(e.consume(I),x):b(I)}function x(I){return I===62?H(I):I===93?(e.consume(I),x):b(I)}function w(I){return I===null||I===62?H(I):Qe(I)?(s=w,$(I)):(e.consume(I),w)}function _(I){return I===null?n(I):I===63?(e.consume(I),R):Qe(I)?(s=_,$(I)):(e.consume(I),_)}function R(I){return I===62?H(I):_(I)}function C(I){return Gi(I)?(e.consume(I),E):n(I)}function E(I){return I===45||Po(I)?(e.consume(I),E):A(I)}function A(I){return Qe(I)?(s=A,$(I)):Ft(I)?(e.consume(I),A):H(I)}function M(I){return I===45||Po(I)?(e.consume(I),M):I===47||I===62||ao(I)?N(I):n(I)}function N(I){return I===47?(e.consume(I),H):I===58||I===95||Gi(I)?(e.consume(I),L):Qe(I)?(s=N,$(I)):Ft(I)?(e.consume(I),N):H(I)}function L(I){return I===45||I===46||I===58||I===95||Po(I)?(e.consume(I),L):F(I)}function F(I){return I===61?(e.consume(I),z):Qe(I)?(s=F,$(I)):Ft(I)?(e.consume(I),F):N(I)}function z(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),o=I,Z):Qe(I)?(s=z,$(I)):Ft(I)?(e.consume(I),z):(e.consume(I),G)}function Z(I){return I===o?(e.consume(I),o=void 0,j):I===null?n(I):Qe(I)?(s=Z,$(I)):(e.consume(I),Z)}function G(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||ao(I)?N(I):(e.consume(I),G)}function j(I){return I===47||I===62||ao(I)?N(I):n(I)}function H(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function $(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),V}function V(I){return Ft(I)?rn(e,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):X(I)}function X(I){return e.enter("htmlTextData"),s(I)}}const KR={name:"labelEnd",resolveAll:V_e,resolveTo:W_e,tokenize:U_e},z_e={tokenize:G_e},B_e={tokenize:q_e},H_e={tokenize:Y_e};function V_e(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&ss(e,0,e.length,n),e}function W_e(e,t){let n=e.length,r=0,o,i,s,a;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=Qo(a,e.slice(i+1,i+r+3)),a=Qo(a,[["enter",u,t]]),a=Qo(a,YR(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=Qo(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=Qo(a,e.slice(s+1)),a=Qo(a,[["exit",l,t]]),ss(e,i,e.length,a),e}function U_e(e,t,n){const r=this;let o=r.events.length,i,s;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return a;function a(p){return i?i._inactive?d(p):(s=r.parser.defined.includes(Ou(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(z_e,u,s?u:d)(p):p===91?e.attempt(B_e,u,s?c:d)(p):s?u(p):d(p)}function c(p){return e.attempt(H_e,u,d)(p)}function u(p){return t(p)}function d(p){return i._balanced=!0,n(p)}}function G_e(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),o}function o(d){return ao(d)?fh(e,i)(d):i(d)}function i(d){return d===41?u(d):X9(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return ao(d)?fh(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?Z9(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return ao(d)?fh(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function q_e(e,t,n){const r=this;return o;function o(a){return Q9.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(Ou(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function Y_e(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const K_e={name:"labelStartImage",resolveAll:KR.resolveAll,tokenize:X_e};function X_e(e,t,n){const r=this;return o;function o(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Q_e={name:"labelStartLink",resolveAll:KR.resolveAll,tokenize:Z_e};function Z_e(e,t,n){const r=this;return o;function o(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Gw={name:"lineEnding",tokenize:J_e};function J_e(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),rn(e,t,"linePrefix")}}const sb={name:"thematicBreak",tokenize:eCe};function eCe(e,t,n){let r=0,o;return i;function i(c){return e.enter("thematicBreak"),s(c)}function s(c){return o=c,a(c)}function a(c){return c===o?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Qe(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===o?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Ft(c)?rn(e,a,"whitespace")(c):a(c))}}const Kr={continuation:{tokenize:oCe},exit:sCe,name:"list",tokenize:rCe},tCe={partial:!0,tokenize:aCe},nCe={partial:!0,tokenize:iCe};function rCe(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,s=0;return a;function a(h){const m=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:P_(h)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(sb,n,c)(h):c(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return P_(h)&&++s<10?(e.consume(h),l):(!r.interrupt||s<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),c(h)):n(h)}function c(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Iy,r.interrupt?n:u,e.attempt(tCe,p,d))}function u(h){return r.containerState.initialBlankLine=!0,i++,p(h)}function d(h){return Ft(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function oCe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Iy,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,rn(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!Ft(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(nCe,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,rn(e,e.attempt(Kr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function iCe(e,t,n){const r=this;return rn(e,o,"listItemIndent",r.containerState.size+1);function o(i){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(i):n(i)}}function sCe(e){e.exit(this.containerState.type)}function aCe(e,t,n){const r=this;return rn(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const s=r.events[r.events.length-1];return!Ft(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const tD={name:"setextUnderline",resolveTo:lCe,tokenize:cCe};function lCe(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function cCe(e,t,n){const r=this;let o;return i;function i(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),o=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===o?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Ft(c)?rn(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Qe(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const uCe={tokenize:dCe};function dCe(e){const t=this,n=e.attempt(Iy,r,e.attempt(this.parser.constructs.flowInitial,o,rn(e,e.attempt(this.parser.constructs.flow,o,e.attempt(m_e,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const fCe={resolveAll:e7()},hCe=J9("string"),pCe=J9("text");function J9(e){return{resolveAll:e7(e==="text"?gCe:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,s,a);return s;function s(u){return c(u)?i(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=o[u];let p=-1;if(d)for(;++p<d.length;){const h=d[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function e7(e){return t;function t(n,r){let o=-1,i;for(;++o<=n.length;)i===void 0?n[o]&&n[o][1].type==="data"&&(i=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==i+2&&(n[i][1].end=n[o-1][1].end,n.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(n,r):n}}function gCe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let i=o.length,s=-1,a=0,l;for(;i--;){const c=o[i];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:r.start._bufferIndex+s,_index:r.start._index+i,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const mCe={42:Kr,43:Kr,45:Kr,48:Kr,49:Kr,50:Kr,51:Kr,52:Kr,53:Kr,54:Kr,55:Kr,56:Kr,57:Kr,62:G9},bCe={91:w_e},yCe={[-2]:Uw,[-1]:Uw,32:Uw},vCe={35:P_e,42:sb,45:[tD,sb],60:O_e,61:tD,95:sb,96:JI,126:JI},xCe={38:Y9,92:q9},wCe={[-5]:Gw,[-4]:Gw,[-3]:Gw,33:K_e,38:Y9,42:T_,60:[QSe,j_e],91:Q_e,92:[E_e,q9],93:KR,95:T_,96:u_e},SCe={null:[T_,fCe]},_Ce={null:[42,95]},CCe={null:[]},ECe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:_Ce,contentInitial:bCe,disable:CCe,document:mCe,flow:vCe,flowInitial:yCe,insideSpan:SCe,string:xCe,text:wCe},Symbol.toStringTag,{value:"Module"}));function RCe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let s=[],a=[];const l={attempt:A(C),check:A(E),consume:w,enter:_,exit:R,interrupt:A(E,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:m,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function d(F){return s=Qo(s,F),v(),s[s.length-1]!==null?[]:(M(t,0),c.events=YR(i,c.events,c),c.events)}function p(F,z){return TCe(h(F),z)}function h(F){return PCe(s,F)}function m(){const{_bufferIndex:F,_index:z,line:Z,column:G,offset:j}=r;return{_bufferIndex:F,_index:z,line:Z,column:G,offset:j}}function b(F){o[F.line]=F.column,L()}function v(){let F;for(;r._index<s.length;){const z=s[r._index];if(typeof z=="string")for(F=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===F&&r._bufferIndex<z.length;)x(z.charCodeAt(r._bufferIndex));else x(z)}}function x(F){u=u(F)}function w(F){Qe(F)?(r.line++,r.column=1,r.offset+=F===-3?2:1,L()):F!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=F}function _(F,z){const Z=z||{};return Z.type=F,Z.start=m(),c.events.push(["enter",Z,c]),a.push(Z),Z}function R(F){const z=a.pop();return z.end=m(),c.events.push(["exit",z,c]),z}function C(F,z){M(F,z.from)}function E(F,z){z.restore()}function A(F,z){return Z;function Z(G,j,H){let $,V,X,I;return Array.isArray(G)?U(G):"tokenize"in G?U([G]):q(G);function q(ne){return Y;function Y(ee){const re=ee!==null&&ne[ee],ue=ee!==null&&ne.null,fe=[...Array.isArray(re)?re:re?[re]:[],...Array.isArray(ue)?ue:ue?[ue]:[]];return U(fe)(ee)}}function U(ne){return $=ne,V=0,ne.length===0?H:O(ne[V])}function O(ne){return Y;function Y(ee){return I=N(),X=ne,ne.partial||(c.currentConstruct=ne),ne.name&&c.parser.constructs.disable.null.includes(ne.name)?K():ne.tokenize.call(z?Object.assign(Object.create(c),z):c,l,J,K)(ee)}}function J(ne){return F(X,I),j}function K(ne){return I.restore(),++V<$.length?O($[V]):H}}}function M(F,z){F.resolveAll&&!i.includes(F)&&i.push(F),F.resolve&&ss(c.events,z,c.events.length-z,F.resolve(c.events.slice(z),c)),F.resolveTo&&(c.events=F.resolveTo(c.events,c))}function N(){const F=m(),z=c.previous,Z=c.currentConstruct,G=c.events.length,j=Array.from(a);return{from:G,restore:H};function H(){r=F,c.previous=z,c.currentConstruct=Z,c.events.length=G,a=j,L()}}function L(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function PCe(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let s;if(n===o)s=[e[n].slice(r,i)];else{if(s=e.slice(n,o),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}i>0&&s.push(e[o].slice(0,i))}return s}function TCe(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
|
|
367
|
+
`;break}case-3:{s=`\r
|
|
368
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&o)continue;s=" ";break}default:s=String.fromCharCode(i)}o=i===-2,r.push(s)}return r.join("")}function kCe(e){const r={constructs:LSe([ECe,...(e||{}).extensions||[]]),content:o(WSe),defined:[],document:o(GSe),flow:o(uCe),lazy:{},string:o(hCe),text:o(pCe)};return r;function o(i){return s;function s(a){return RCe(r,i,a)}}}function ACe(e){for(;!K9(e););return e}const nD=/[\0\t\n\r]/g;function OCe(){let e=1,t="",n=!0,r;return o;function o(i,s,a){const l=[];let c,u,d,p,h;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),d=0,t="",n&&(i.charCodeAt(0)===65279&&d++,n=void 0);d<i.length;){if(nD.lastIndex=d,c=nD.exec(i),p=c&&c.index!==void 0?c.index:i.length,h=i.charCodeAt(p),!c){t=i.slice(d);break}if(h===10&&d===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<p&&(l.push(i.slice(d,p)),e+=p-d),h){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=p+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const MCe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ICe(e){return e.replace(MCe,DCe)}function DCe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return U9(n.slice(i?2:1),i?16:10)}return qR(n)||e}const t7={}.hasOwnProperty;function NCe(e,t,n){return typeof t!="string"&&(n=t,t=void 0),LCe(n)(ACe(kCe(n).document().write(OCe()(e,t,!0))))}function LCe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ne),autolinkProtocol:N,autolinkEmail:N,atxHeading:i(_e),blockQuote:i(ue),characterEscape:N,characterReference:N,codeFenced:i(fe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(fe,s),codeText:i(se,s),codeTextData:N,data:N,codeFlowValue:N,definition:i(pe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(ce),hardBreakEscape:i(Pe),hardBreakTrailing:i(Pe),htmlFlow:i(Me,s),htmlFlowData:N,htmlText:i(Me,s),htmlTextData:N,image:i(ke),label:s,link:i(Ne),listItem:i(ot),listItemValue:p,listOrdered:i(tt,d),listUnordered:i(tt),paragraph:i(gn),reference:O,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(_e),strong:i(xt),thematicBreak:i(Rt)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:re,autolinkProtocol:ee,blockQuote:l(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:K,characterReferenceMarkerNumeric:K,characterReferenceValue:ne,characterReference:Y,codeFenced:l(v),codeFencedFence:b,codeFencedFenceInfo:h,codeFencedFenceMeta:m,codeFlowValue:L,codeIndented:l(x),codeText:l(j),codeTextData:L,data:L,definition:l(),definitionDestinationString:R,definitionLabelString:w,definitionTitleString:_,emphasis:l(),hardBreakEscape:l(z),hardBreakTrailing:l(z),htmlFlow:l(Z),htmlFlowData:L,htmlText:l(G),htmlTextData:L,image:l($),label:X,labelText:V,lineEnding:F,link:l(H),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:J,resourceDestinationString:I,resourceTitleString:q,resource:U,setextHeading:l(M),setextHeadingLineSequence:A,setextHeadingText:E,strong:l(),thematicBreak:l()}};n7(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(de){let Se={type:"root",children:[]};const je={stack:[Se],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},Be=[];let it=-1;for(;++it<de.length;)if(de[it][1].type==="listOrdered"||de[it][1].type==="listUnordered")if(de[it][0]==="enter")Be.push(it);else{const On=Be.pop();it=o(de,On,it)}for(it=-1;++it<de.length;){const On=t[de[it][0]];t7.call(On,de[it][1].type)&&On[de[it][1].type].call(Object.assign({sliceSerialize:de[it][2].sliceSerialize},je),de[it][1])}if(je.tokenStack.length>0){const On=je.tokenStack[je.tokenStack.length-1];(On[1]||rD).call(je,void 0,On[0])}for(Se.position={start:ha(de.length>0?de[0][1].start:{line:1,column:1,offset:0}),end:ha(de.length>0?de[de.length-2][1].end:{line:1,column:1,offset:0})},it=-1;++it<t.transforms.length;)Se=t.transforms[it](Se)||Se;return Se}function o(de,Se,je){let Be=Se-1,it=-1,On=!1,Fn,vn,en,jn;for(;++Be<=je;){const Kt=de[Be];switch(Kt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Kt[0]==="enter"?it++:it--,jn=void 0;break}case"lineEndingBlank":{Kt[0]==="enter"&&(Fn&&!jn&&!it&&!en&&(en=Be),jn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:jn=void 0}if(!it&&Kt[0]==="enter"&&Kt[1].type==="listItemPrefix"||it===-1&&Kt[0]==="exit"&&(Kt[1].type==="listUnordered"||Kt[1].type==="listOrdered")){if(Fn){let sr=Be;for(vn=void 0;sr--;){const _r=de[sr];if(_r[1].type==="lineEnding"||_r[1].type==="lineEndingBlank"){if(_r[0]==="exit")continue;vn&&(de[vn][1].type="lineEndingBlank",On=!0),_r[1].type="lineEnding",vn=sr}else if(!(_r[1].type==="linePrefix"||_r[1].type==="blockQuotePrefix"||_r[1].type==="blockQuotePrefixWhitespace"||_r[1].type==="blockQuoteMarker"||_r[1].type==="listItemIndent"))break}en&&(!vn||en<vn)&&(Fn._spread=!0),Fn.end=Object.assign({},vn?de[vn][1].start:Kt[1].end),de.splice(vn||Be,0,["exit",Fn,Kt[2]]),Be++,je++}if(Kt[1].type==="listItemPrefix"){const sr={type:"listItem",_spread:!1,start:Object.assign({},Kt[1].start),end:void 0};Fn=sr,de.splice(Be,0,["enter",sr,Kt[2]]),Be++,je++,en=void 0,jn=!0}}}return de[Se][1]._spread=On,je}function i(de,Se){return je;function je(Be){a.call(this,de(Be),Be),Se&&Se.call(this,Be)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(de,Se,je){this.stack[this.stack.length-1].children.push(de),this.stack.push(de),this.tokenStack.push([Se,je||void 0]),de.position={start:ha(Se.start),end:void 0}}function l(de){return Se;function Se(je){de&&de.call(this,je),c.call(this,je)}}function c(de,Se){const je=this.stack.pop(),Be=this.tokenStack.pop();if(Be)Be[0].type!==de.type&&(Se?Se.call(this,de,Be[0]):(Be[1]||rD).call(this,de,Be[0]));else throw new Error("Cannot close `"+de.type+"` ("+dh({start:de.start,end:de.end})+"): it’s not open");je.position.end=ha(de.end)}function u(){return DSe(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(de){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(de),10),this.data.expectingFirstListItemValue=void 0}}function h(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=de}function m(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=de}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.value=de.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.value=de.replace(/(\r?\n|\r)$/g,"")}function w(de){const Se=this.resume(),je=this.stack[this.stack.length-1];je.label=Se,je.identifier=Ou(this.sliceSerialize(de)).toLowerCase()}function _(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.title=de}function R(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.url=de}function C(de){const Se=this.stack[this.stack.length-1];if(!Se.depth){const je=this.sliceSerialize(de).length;Se.depth=je}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function A(de){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(de).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function N(de){const je=this.stack[this.stack.length-1].children;let Be=je[je.length-1];(!Be||Be.type!=="text")&&(Be=Wn(),Be.position={start:ha(de.start),end:void 0},je.push(Be)),this.stack.push(Be)}function L(de){const Se=this.stack.pop();Se.value+=this.sliceSerialize(de),Se.position.end=ha(de.end)}function F(de){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const je=Se.children[Se.children.length-1];je.position.end=ha(de.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Se.type)&&(N.call(this,de),L.call(this,de))}function z(){this.data.atHardBreak=!0}function Z(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.value=de}function G(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.value=de}function j(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.value=de}function H(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=Se,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function $(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=Se,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function V(de){const Se=this.sliceSerialize(de),je=this.stack[this.stack.length-2];je.label=ICe(Se),je.identifier=Ou(Se).toLowerCase()}function X(){const de=this.stack[this.stack.length-1],Se=this.resume(),je=this.stack[this.stack.length-1];if(this.data.inReference=!0,je.type==="link"){const Be=de.children;je.children=Be}else je.alt=Se}function I(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.url=de}function q(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.title=de}function U(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function J(de){const Se=this.resume(),je=this.stack[this.stack.length-1];je.label=Se,je.identifier=Ou(this.sliceSerialize(de)).toLowerCase(),this.data.referenceType="full"}function K(de){this.data.characterReferenceType=de.type}function ne(de){const Se=this.sliceSerialize(de),je=this.data.characterReferenceType;let Be;je?(Be=U9(Se,je==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Be=qR(Se);const it=this.stack[this.stack.length-1];it.value+=Be}function Y(de){const Se=this.stack.pop();Se.position.end=ha(de.end)}function ee(de){L.call(this,de);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(de)}function re(de){L.call(this,de);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(de)}function ue(){return{type:"blockquote",children:[]}}function fe(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function pe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ce(){return{type:"emphasis",children:[]}}function _e(){return{type:"heading",depth:0,children:[]}}function Pe(){return{type:"break"}}function Me(){return{type:"html",value:""}}function ke(){return{type:"image",title:null,url:"",alt:null}}function Ne(){return{type:"link",title:null,url:"",children:[]}}function tt(de){return{type:"list",ordered:de.type==="listOrdered",start:null,spread:de._spread,children:[]}}function ot(de){return{type:"listItem",spread:de._spread,checked:null,children:[]}}function gn(){return{type:"paragraph",children:[]}}function xt(){return{type:"strong",children:[]}}function Wn(){return{type:"text",value:""}}function Rt(){return{type:"thematicBreak"}}}function ha(e){return{line:e.line,column:e.column,offset:e.offset}}function n7(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?n7(e,r):FCe(e,r)}}function FCe(e,t){let n;for(n in t)if(t7.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function rD(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+dh({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+dh({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+dh({start:t.start,end:t.end})+") is still open")}function jCe(e){const t=this;t.parser=n;function n(r){return NCe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function $Ce(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function zCe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
369
|
+
`}]}function BCe(e,t){const n=t.value?t.value+`
|
|
370
|
+
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function HCe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function VCe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function WCe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Fd(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=i+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function UCe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GCe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function r7(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const s=o[o.length-1];return s&&s.type==="text"?s.value+=r:o.push({type:"text",value:r}),o}function qCe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return r7(e,t);const o={src:Fd(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function YCe(e,t){const n={src:Fd(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function KCe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function XCe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return r7(e,t);const o={href:Fd(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function QCe(e,t){const n={href:Fd(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ZCe(e,t,n){const r=e.all(t),o=n?JCe(n):o7(t),i={},s=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(o||a!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
|
|
371
|
+
`}),u.type==="element"&&u.tagName==="p"&&!o?s.push(...u.children):s.push(u)}const l=r[r.length-1];l&&(o||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
|
|
372
|
+
`});const c={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,c),e.applyData(t,c)}function JCe(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=o7(n[r])}return t}function o7(e){const t=e.spread;return t??e.children.length>1}function eEe(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const s=r[o];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function tEe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nEe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function rEe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oEe(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),o.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=VR(t.children[1]),l=j9(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),o.push(s)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function iEe(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const d=t.children[l],p={},h=s?s[l]:void 0;h&&(p.align=h);let m={type:"element",tagName:i,properties:p,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),c.push(m)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function sEe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const oD=9,iD=32;function aEe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(sD(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(sD(t.slice(o),o>0,!1)),i.join("")}function sD(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===oD||i===iD;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===oD||i===iD;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function lEe(e,t){const n={type:"text",value:aEe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function cEe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const uEe={blockquote:$Ce,break:zCe,code:BCe,delete:HCe,emphasis:VCe,footnoteReference:WCe,heading:UCe,html:GCe,imageReference:qCe,image:YCe,inlineCode:KCe,linkReference:XCe,link:QCe,listItem:ZCe,list:eEe,paragraph:tEe,root:nEe,strong:rEe,table:oEe,tableCell:sEe,tableRow:iEe,text:lEe,thematicBreak:cEe,toml:Nm,yaml:Nm,definition:Nm,footnoteDefinition:Nm};function Nm(){}const i7=-1,Dy=0,hh=1,i0=2,XR=3,QR=4,ZR=5,JR=6,s7=7,a7=8,aD=typeof self=="object"?self:globalThis,dEe=(e,t)=>{const n=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);const[i,s]=t[o];switch(i){case Dy:case i7:return n(s,o);case hh:{const a=n([],o);for(const l of s)a.push(r(l));return a}case i0:{const a=n({},o);for(const[l,c]of s)a[r(l)]=r(c);return a}case XR:return n(new Date(s),o);case QR:{const{source:a,flags:l}=s;return n(new RegExp(a,l),o)}case ZR:{const a=n(new Map,o);for(const[l,c]of s)a.set(r(l),r(c));return a}case JR:{const a=n(new Set,o);for(const l of s)a.add(r(l));return a}case s7:{const{name:a,message:l}=s;return n(new aD[a](l),o)}case a7:return n(BigInt(s),o);case"BigInt":return n(Object(BigInt(s)),o);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new aD[i](s),o)};return r},lD=e=>dEe(new Map,e)(0),au="",{toString:fEe}={},{keys:hEe}=Object,Ef=e=>{const t=typeof e;if(t!=="object"||!e)return[Dy,t];const n=fEe.call(e).slice(8,-1);switch(n){case"Array":return[hh,au];case"Object":return[i0,au];case"Date":return[XR,au];case"RegExp":return[QR,au];case"Map":return[ZR,au];case"Set":return[JR,au];case"DataView":return[hh,n]}return n.includes("Array")?[hh,n]:n.includes("Error")?[s7,n]:[i0,n]},Lm=([e,t])=>e===Dy&&(t==="function"||t==="symbol"),pEe=(e,t,n,r)=>{const o=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},i=s=>{if(n.has(s))return n.get(s);let[a,l]=Ef(s);switch(a){case Dy:{let u=s;switch(l){case"bigint":a=a7,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return o([i7],s)}return o([a,u],s)}case hh:{if(l){let p=s;return l==="DataView"?p=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(s)),o([l,[...p]],s)}const u=[],d=o([a,u],s);for(const p of s)u.push(i(p));return d}case i0:{if(l)switch(l){case"BigInt":return o([l,s.toString()],s);case"Boolean":case"Number":case"String":return o([l,s.valueOf()],s)}if(t&&"toJSON"in s)return i(s.toJSON());const u=[],d=o([a,u],s);for(const p of hEe(s))(e||!Lm(Ef(s[p])))&&u.push([i(p),i(s[p])]);return d}case XR:return o([a,s.toISOString()],s);case QR:{const{source:u,flags:d}=s;return o([a,{source:u,flags:d}],s)}case ZR:{const u=[],d=o([a,u],s);for(const[p,h]of s)(e||!(Lm(Ef(p))||Lm(Ef(h))))&&u.push([i(p),i(h)]);return d}case JR:{const u=[],d=o([a,u],s);for(const p of s)(e||!Lm(Ef(p)))&&u.push(i(p));return d}}const{message:c}=s;return o([a,{name:l,message:c}],s)};return i},cD=(e,{json:t,lossy:n}={})=>{const r=[];return pEe(!(t||n),!!t,new Map,r)(e),r},s0=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?lD(cD(e,t)):structuredClone(e):(e,t)=>lD(cD(e,t));function gEe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function mEe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function bEe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||gEe,r=e.options.footnoteBackLabel||mEe,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),d=String(c.identifier).toUpperCase(),p=Fd(d.toLowerCase());let h=0;const m=[],b=e.footnoteCounts.get(d);for(;b!==void 0&&++h<=b;){m.length>0&&m.push({type:"text",value:" "});let w=typeof n=="string"?n:n(l,h);typeof w=="string"&&(w={type:"text",value:w}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,h),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=u[u.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...m)}else u.push(...m);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(u,!0)};e.patch(c,x),a.push(x)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...s0(s),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
373
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
374
|
+
`}]}}const l7=function(e){if(e==null)return wEe;if(typeof e=="function")return Ny(e);if(typeof e=="object")return Array.isArray(e)?yEe(e):vEe(e);if(typeof e=="string")return xEe(e);throw new Error("Expected function, string, or object as test")};function yEe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=l7(e[n]);return Ny(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function vEe(e){const t=e;return Ny(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function xEe(e){return Ny(t);function t(n){return n&&n.type===e}}function Ny(e){return t;function t(n,r,o){return!!(SEe(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function wEe(){return!0}function SEe(e){return e!==null&&typeof e=="object"&&"type"in e}const c7=[],_Ee=!0,uD=!1,CEe="skip";function EEe(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=l7(o),s=r?-1:1;a(e,void 0,[])();function a(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const h=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=c7,m,b,v;if((!t||i(l,c,u[u.length-1]||void 0))&&(h=REe(n(l,u)),h[0]===uD))return h;if("children"in l&&l.children){const x=l;if(x.children&&h[0]!==CEe)for(b=(r?x.children.length:-1)+s,v=u.concat(x);b>-1&&b<x.children.length;){const w=x.children[b];if(m=a(w,b,v)(),m[0]===uD)return m;b=typeof m[1]=="number"?m[1]:b+s}}return h}}}function REe(e){return Array.isArray(e)?e:typeof e=="number"?[_Ee,e]:e==null?c7:[e]}function u7(e,t,n,r){let o,i,s;typeof t=="function"?(i=void 0,s=t,o=n):(i=t,s=n,o=r),EEe(e,i,a,o);function a(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return s(l,d,u)}}const k_={}.hasOwnProperty,PEe={};function TEe(e,t){const n=t||PEe,r=new Map,o=new Map,i=new Map,s={...uEe,...n.handlers},a={all:c,applyData:AEe,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:kEe,wrap:MEe};return u7(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:o,p=String(u.identifier).toUpperCase();d.has(p)||d.set(p,u)}}),a;function l(u,d){const p=u.type,h=a.handlers[p];if(k_.call(a.handlers,p)&&h)return h(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in u){const{children:b,...v}=u,x=s0(v);return x.children=a.all(u),x}return s0(u)}return(a.options.unknownHandler||OEe)(a,u,d)}function c(u){const d=[];if("children"in u){const p=u.children;let h=-1;for(;++h<p.length;){const m=a.one(p[h],u);if(m){if(h&&p[h-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=dD(m.value)),!Array.isArray(m)&&m.type==="element")){const b=m.children[0];b&&b.type==="text"&&(b.value=dD(b.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function kEe(e,t){e.position&&(t.position=fSe(e))}function AEe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&i&&Object.assign(n.properties,s0(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function OEe(e,t){const n=t.data||{},r="value"in t&&!(k_.call(n,"hProperties")||k_.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function MEe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
375
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
376
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
377
|
+
`}),n}function dD(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function fD(e,t){const n=TEe(e,t),r=n.one(e,void 0),o=bEe(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
|
|
378
|
+
`},o),i}function IEe(e,t){return e&&"run"in e?async function(n,r){const o=fD(n,{file:r,...t});await e.run(o,r)}:function(n,r){return fD(n,{file:r,...e||t})}}function hD(e){if(e)throw e}var ab=Object.prototype.hasOwnProperty,d7=Object.prototype.toString,pD=Object.defineProperty,gD=Object.getOwnPropertyDescriptor,mD=function(t){return typeof Array.isArray=="function"?Array.isArray(t):d7.call(t)==="[object Array]"},bD=function(t){if(!t||d7.call(t)!=="[object Object]")return!1;var n=ab.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&ab.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||ab.call(t,o)},yD=function(t,n){pD&&n.name==="__proto__"?pD(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},vD=function(t,n){if(n==="__proto__")if(ab.call(t,n)){if(gD)return gD(t,n).value}else return;return t[n]},DEe=function e(){var t,n,r,o,i,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=vD(a,n),o=vD(t,n),a!==o&&(u&&o&&(bD(o)||(i=mD(o)))?(i?(i=!1,s=r&&mD(r)?r:[]):s=r&&bD(r)?r:{},yD(a,{name:n,newValue:e(u,s,o)})):typeof o<"u"&&yD(a,{name:n,newValue:o}));return a};const qw=Ga(DEe);function A_(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function NEe(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const s=o.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...o);function a(l,...c){const u=e[++i];let d=-1;if(l){s(l);return}for(;++d<o.length;)(c[d]===null||c[d]===void 0)&&(c[d]=o[d]);o=c,u?LEe(u,a)(...c):s(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function LEe(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(o);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return o(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(i,o):l instanceof Error?o(l):i(l))}function o(s,...a){n||(n=!0,t(s,...a))}function i(s){o(null,s)}}const Di={basename:FEe,dirname:jEe,extname:$Ee,join:zEe,sep:"/"};function FEe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Lp(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else s<0&&(i=!0,s=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function jEe(e){if(Lp(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function $Ee(e){Lp(e);let t=e.length,n=-1,r=0,o=-1,i=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function zEe(...e){let t=-1,n;for(;++t<e.length;)Lp(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":BEe(n)}function BEe(e){Lp(e);const t=e.codePointAt(0)===47;let n=HEe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function HEe(e,t){let n="",r=0,o=-1,i=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(o===s-1||i===1))if(o!==s-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=s,i=0;continue}}else if(n.length>0){n="",r=0,o=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),r=s-o-1;o=s,i=0}else a===46&&i>-1?i++:i=-1}return n}function Lp(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const VEe={cwd:WEe};function WEe(){return"/"}function O_(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function UEe(e){if(typeof e=="string")e=new URL(e);else if(!O_(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return GEe(e)}function GEe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const Yw=["history","path","basename","stem","extname","dirname"];class f7{constructor(t){let n;t?O_(t)?n={path:t}:typeof t=="string"||qEe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":VEe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Yw.length;){const i=Yw[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)Yw.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?Di.basename(this.path):void 0}set basename(t){Xw(t,"basename"),Kw(t,"basename"),this.path=Di.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Di.dirname(this.path):void 0}set dirname(t){xD(this.basename,"dirname"),this.path=Di.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Di.extname(this.path):void 0}set extname(t){if(Kw(t,"extname"),xD(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Di.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){O_(t)&&(t=UEe(t)),Xw(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Di.basename(this.path,this.extname):void 0}set stem(t){Xw(t,"stem"),Kw(t,"stem"),this.path=Di.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new Sr(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Kw(e,t){if(e&&e.includes(Di.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Di.sep+"`")}function Xw(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function xD(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function qEe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const YEe=function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},KEe={}.hasOwnProperty;class e2 extends YEe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=NEe()}copy(){const t=new e2;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(qw(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Jw("data",this.frozen),this.namespace[t]=n,this):KEe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Jw("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Fm(t),r=this.parser||this.Parser;return Qw("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Qw("process",this.parser||this.Parser),Zw("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=Fm(t),l=r.parse(a);r.run(l,a,function(u,d,p){if(u||!d||!p)return c(u);const h=d,m=r.stringify(h,p);ZEe(m)?p.value=m:p.result=m,c(u,p)});function c(u,d){u||!d?s(u):i?i(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Qw("processSync",this.parser||this.Parser),Zw("processSync",this.compiler||this.Compiler),this.process(t,o),SD("processSync","process",n),r;function o(i,s){n=!0,hD(i),r=s}}run(t,n,r){wD(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,a){const l=Fm(n);o.run(t,l,c);function c(u,d,p){const h=d||t;u?a(u):s?s(h):r(void 0,h,p)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),SD("runSync","run",r),o;function i(s,a){hD(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=Fm(n),o=this.compiler||this.Compiler;return Zw("stringify",o),wD(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(Jw("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(o.settings=qw(!0,o.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];i(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,p=-1;for(;++d<r.length;)if(r[d][0]===c){p=d;break}if(p===-1)r.push([c,...u]);else if(u.length>0){let[h,...m]=u;const b=r[p][1];A_(b)&&A_(h)&&(h=qw(!0,b,h)),r[p]=[c,h,...m]}}}}const XEe=new e2().freeze();function Qw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Zw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Jw(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function wD(e){if(!A_(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function SD(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Fm(e){return QEe(e)?e:new f7(e)}function QEe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ZEe(e){return typeof e=="string"||JEe(e)}function JEe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const eRe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",_D=[],CD={allowDangerousHtml:!0},tRe=/^(https?|ircs?|mailto|xmpp)$/i,nRe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function rRe(e){const t=oRe(e),n=iRe(e);return sRe(t.runSync(t.parse(n),n),e)}function oRe(e){const t=e.rehypePlugins||_D,n=e.remarkPlugins||_D,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...CD}:CD;return XEe().use(jCe).use(n).use(IEe,r).use(t)}function iRe(e){const t=e.children||"",n=new f7;return typeof t=="string"&&(n.value=t),n}function sRe(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||aRe;for(const u of nRe)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+eRe+u.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),u7(e,c),bSe(e,{Fragment:y.Fragment,components:o,ignoreInvalidStyle:!0,jsx:y.jsx,jsxs:y.jsxs,passKeys:!0,passNode:!0});function c(u,d,p){if(u.type==="raw"&&p&&typeof d=="number")return s?p.children.splice(d,1):p.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let h;for(h in Ww)if(Object.hasOwn(Ww,h)&&Object.hasOwn(u.properties,h)){const m=u.properties[h],b=Ww[h];(b===null||b.includes(u.tagName))&&(u.properties[h]=l(String(m||""),h,u))}}if(u.type==="element"){let h=n?!n.includes(u.tagName):i?i.includes(u.tagName):!1;if(!h&&r&&typeof d=="number"&&(h=!r(u,d,p)),h&&p&&typeof d=="number")return a&&u.children?p.children.splice(d,1,...u.children):p.children.splice(d,1),d}}}function aRe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||tRe.test(e.slice(0,t))?e:""}var lRe=Object.create,Ly=Object.defineProperty,cRe=Object.defineProperties,uRe=Object.getOwnPropertyDescriptor,dRe=Object.getOwnPropertyDescriptors,h7=Object.getOwnPropertyNames,a0=Object.getOwnPropertySymbols,fRe=Object.getPrototypeOf,t2=Object.prototype.hasOwnProperty,p7=Object.prototype.propertyIsEnumerable,ED=(e,t,n)=>t in e?Ly(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ji=(e,t)=>{for(var n in t||(t={}))t2.call(t,n)&&ED(e,n,t[n]);if(a0)for(var n of a0(t))p7.call(t,n)&&ED(e,n,t[n]);return e},Fy=(e,t)=>cRe(e,dRe(t)),g7=(e,t)=>{var n={};for(var r in e)t2.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&a0)for(var r of a0(e))t.indexOf(r)<0&&p7.call(e,r)&&(n[r]=e[r]);return n},hRe=(e,t)=>function(){return t||(0,e[h7(e)[0]])((t={exports:{}}).exports,t),t.exports},pRe=(e,t)=>{for(var n in t)Ly(e,n,{get:t[n],enumerable:!0})},gRe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of h7(t))!t2.call(e,o)&&o!==n&&Ly(e,o,{get:()=>t[o],enumerable:!(r=uRe(t,o))||r.enumerable});return e},mRe=(e,t,n)=>(n=e!=null?lRe(fRe(e)):{},gRe(!e||!e.__esModule?Ly(n,"default",{value:e,enumerable:!0}):n,e)),bRe=hRe({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,o=0,i={},s={util:{encode:function m(b){return b instanceof a?new a(b.type,m(b.content),b.alias):Array.isArray(b)?b.map(m):b.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(m){return Object.prototype.toString.call(m).slice(8,-1)},objId:function(m){return m.__id||Object.defineProperty(m,"__id",{value:++o}),m.__id},clone:function m(b,v){v=v||{};var x,w;switch(s.util.type(b)){case"Object":if(w=s.util.objId(b),v[w])return v[w];x={},v[w]=x;for(var _ in b)b.hasOwnProperty(_)&&(x[_]=m(b[_],v));return x;case"Array":return w=s.util.objId(b),v[w]?v[w]:(x=[],v[w]=x,b.forEach(function(R,C){x[C]=m(R,v)}),x);default:return b}},getLanguage:function(m){for(;m;){var b=r.exec(m.className);if(b)return b[1].toLowerCase();m=m.parentElement}return"none"},setLanguage:function(m,b){m.className=m.className.replace(RegExp(r,"gi"),""),m.classList.add("language-"+b)},isActive:function(m,b,v){for(var x="no-"+b;m;){var w=m.classList;if(w.contains(b))return!0;if(w.contains(x))return!1;m=m.parentElement}return!!v}},languages:{plain:i,plaintext:i,text:i,txt:i,extend:function(m,b){var v=s.util.clone(s.languages[m]);for(var x in b)v[x]=b[x];return v},insertBefore:function(m,b,v,x){x=x||s.languages;var w=x[m],_={};for(var R in w)if(w.hasOwnProperty(R)){if(R==b)for(var C in v)v.hasOwnProperty(C)&&(_[C]=v[C]);v.hasOwnProperty(R)||(_[R]=w[R])}var E=x[m];return x[m]=_,s.languages.DFS(s.languages,function(A,M){M===E&&A!=m&&(this[A]=_)}),_},DFS:function m(b,v,x,w){w=w||{};var _=s.util.objId;for(var R in b)if(b.hasOwnProperty(R)){v.call(b,R,b[R],x||R);var C=b[R],E=s.util.type(C);E==="Object"&&!w[_(C)]?(w[_(C)]=!0,m(C,v,null,w)):E==="Array"&&!w[_(C)]&&(w[_(C)]=!0,m(C,v,R,w))}}},plugins:{},highlight:function(m,b,v){var x={code:m,grammar:b,language:v};if(s.hooks.run("before-tokenize",x),!x.grammar)throw new Error('The language "'+x.language+'" has no grammar.');return x.tokens=s.tokenize(x.code,x.grammar),s.hooks.run("after-tokenize",x),a.stringify(s.util.encode(x.tokens),x.language)},tokenize:function(m,b){var v=b.rest;if(v){for(var x in v)b[x]=v[x];delete b.rest}var w=new u;return d(w,w.head,m),c(m,w,b,w.head,0),h(w)},hooks:{all:{},add:function(m,b){var v=s.hooks.all;v[m]=v[m]||[],v[m].push(b)},run:function(m,b){var v=s.hooks.all[m];if(!(!v||!v.length))for(var x=0,w;w=v[x++];)w(b)}},Token:a};function a(m,b,v,x){this.type=m,this.content=b,this.alias=v,this.length=(x||"").length|0}a.stringify=function m(b,v){if(typeof b=="string")return b;if(Array.isArray(b)){var x="";return b.forEach(function(E){x+=m(E,v)}),x}var w={type:b.type,content:m(b.content,v),tag:"span",classes:["token",b.type],attributes:{},language:v},_=b.alias;_&&(Array.isArray(_)?Array.prototype.push.apply(w.classes,_):w.classes.push(_)),s.hooks.run("wrap",w);var R="";for(var C in w.attributes)R+=" "+C+'="'+(w.attributes[C]||"").replace(/"/g,""")+'"';return"<"+w.tag+' class="'+w.classes.join(" ")+'"'+R+">"+w.content+"</"+w.tag+">"};function l(m,b,v,x){m.lastIndex=b;var w=m.exec(v);if(w&&x&&w[1]){var _=w[1].length;w.index+=_,w[0]=w[0].slice(_)}return w}function c(m,b,v,x,w,_){for(var R in v)if(!(!v.hasOwnProperty(R)||!v[R])){var C=v[R];C=Array.isArray(C)?C:[C];for(var E=0;E<C.length;++E){if(_&&_.cause==R+","+E)return;var A=C[E],M=A.inside,N=!!A.lookbehind,L=!!A.greedy,F=A.alias;if(L&&!A.pattern.global){var z=A.pattern.toString().match(/[imsuy]*$/)[0];A.pattern=RegExp(A.pattern.source,z+"g")}for(var Z=A.pattern||A,G=x.next,j=w;G!==b.tail&&!(_&&j>=_.reach);j+=G.value.length,G=G.next){var H=G.value;if(b.length>m.length)return;if(!(H instanceof a)){var $=1,V;if(L){if(V=l(Z,j,m,N),!V||V.index>=m.length)break;var U=V.index,X=V.index+V[0].length,I=j;for(I+=G.value.length;U>=I;)G=G.next,I+=G.value.length;if(I-=G.value.length,j=I,G.value instanceof a)continue;for(var q=G;q!==b.tail&&(I<X||typeof q.value=="string");q=q.next)$++,I+=q.value.length;$--,H=m.slice(j,I),V.index-=j}else if(V=l(Z,0,H,N),!V)continue;var U=V.index,O=V[0],J=H.slice(0,U),K=H.slice(U+O.length),ne=j+H.length;_&&ne>_.reach&&(_.reach=ne);var Y=G.prev;J&&(Y=d(b,Y,J),j+=J.length),p(b,Y,$);var ee=new a(R,M?s.tokenize(O,M):O,F,O);if(G=d(b,Y,ee),K&&d(b,G,K),$>1){var re={cause:R+","+E,reach:ne};c(m,b,v,G.prev,j,re),_&&re.reach>_.reach&&(_.reach=re.reach)}}}}}}function u(){var m={value:null,prev:null,next:null},b={value:null,prev:m,next:null};m.next=b,this.head=m,this.tail=b,this.length=0}function d(m,b,v){var x=b.next,w={value:v,prev:b,next:x};return b.next=w,x.prev=w,m.length++,w}function p(m,b,v){for(var x=b.next,w=0;w<v&&x!==m.tail;w++)x=x.next;b.next=x,x.prev=b,m.length-=w}function h(m){for(var b=[],v=m.head.next;v!==m.tail;)b.push(v.value),v=v.next;return b}return s}();t.exports=n,n.default=n}}),ve=mRe(bRe());ve.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},ve.languages.markup.tag.inside["attr-value"].inside.entity=ve.languages.markup.entity,ve.languages.markup.doctype.inside["internal-subset"].inside=ve.languages.markup,ve.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(ve.languages.markup.tag,"addInlined",{value:function(e,r){var n={},n=(n["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:ve.languages[r]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),r=(n["language-"+r]={pattern:/[\s\S]+/,inside:ve.languages[r]},{});r[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:n},ve.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(ve.languages.markup.tag,"addAttribute",{value:function(e,t){ve.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:ve.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),ve.languages.html=ve.languages.markup,ve.languages.mathml=ve.languages.markup,ve.languages.svg=ve.languages.markup,ve.languages.xml=ve.languages.extend("markup",{}),ve.languages.ssml=ve.languages.xml,ve.languages.atom=ve.languages.xml,ve.languages.rss=ve.languages.xml,function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+n.source+")",r=RegExp(r+"-"+r),o={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":o}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":o}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}(ve),ve.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},ve.languages.javascript=ve.languages.extend("clike",{"class-name":[ve.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),ve.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,ve.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:ve.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:ve.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:ve.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:ve.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:ve.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),ve.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:ve.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),ve.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),ve.languages.markup&&(ve.languages.markup.tag.addInlined("script","javascript"),ve.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),ve.languages.js=ve.languages.javascript,ve.languages.actionscript=ve.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),ve.languages.actionscript["class-name"].alias="function",delete ve.languages.actionscript.parameter,delete ve.languages.actionscript["literal-property"],ve.languages.markup&&ve.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:ve.languages.markup}}),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(ve),function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,"addSupport",{value:function(n,r){(n=typeof n=="string"?[n]:n).forEach(function(o){var i=function(d){d.inside||(d.inside={}),d.inside.rest=r},s="doc-comment";if(a=e.languages[o]){var a,l=a[s];if((l=l||(a=e.languages.insertBefore(o,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[s])instanceof RegExp&&(l=a[s]={pattern:l}),Array.isArray(l))for(var c=0,u=l.length;c<u;c++)l[c]instanceof RegExp&&(l[c]={pattern:l[c]}),i(l[c]);else i(l)}})}}),t.addSupport(["java","javascript","php"],t)}(ve),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,t=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(ve),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,t=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+t.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[t,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})}(ve),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+n.source+")?)",o=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),i=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function s(a,l){l=(l||"").replace(/m/g,"")+"m";var c=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return a});return RegExp(c,l)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+o+"|"+i+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:s(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:s(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:s(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:s(i),lookbehind:!0,greedy:!0},number:{pattern:s(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(ve),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(c){return c=c.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+c+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,s=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+i+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+i+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(c){["url","bold","italic","strike","code-snippet"].forEach(function(u){c!==u&&(e.languages.markdown[c].inside.content.inside[u]=e.languages.markdown[u])})}),e.hooks.add("after-tokenize",function(c){c.language!=="markdown"&&c.language!=="md"||function u(d){if(d&&typeof d!="string")for(var p=0,h=d.length;p<h;p++){var m,b=d[p];b.type!=="code"?u(b.content):(m=b.content[1],b=b.content[3],m&&b&&m.type==="code-language"&&b.type==="code-block"&&typeof m.content=="string"&&(m=m.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),m="language-"+(m=(/[a-z][\w-]*/i.exec(m)||[""])[0].toLowerCase()),b.alias?typeof b.alias=="string"?b.alias=[b.alias,m]:b.alias.push(m):b.alias=[m]))}}(c.tokens)}),e.hooks.add("wrap",function(c){if(c.type==="code-block"){for(var u="",d=0,p=c.classes.length;d<p;d++){var h=c.classes[d],h=/language-(.+)/.exec(h);if(h){u=h[1];break}}var m,b=e.languages[u];b?c.content=e.highlight(function(v){return v=v.replace(s,""),v=v.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(x,w){var _;return(w=w.toLowerCase())[0]==="#"?(_=w[1]==="x"?parseInt(w.slice(2),16):Number(w.slice(1)),l(_)):a[w]||x})}(c.content),b,u):u&&u!=="none"&&e.plugins.autoloader&&(m="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),c.attributes.id=m,e.plugins.autoloader.loadLanguages(u,function(){var v=document.getElementById(m);v&&(v.innerHTML=e.highlight(v.textContent,e.languages[u],u))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(ve),ve.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:ve.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},ve.hooks.add("after-tokenize",function(e){if(e.language==="graphql")for(var t=e.tokens.filter(function(m){return typeof m!="string"&&m.type!=="comment"&&m.type!=="scalar"}),n=0;n<t.length;){var r=t[n++];if(r.type==="keyword"&&r.content==="mutation"){var o=[];if(d(["definition-mutation","punctuation"])&&u(1).content==="("){n+=2;var i=p(/^\($/,/^\)$/);if(i===-1)continue;for(;n<i;n++){var s=u(0);s.type==="variable"&&(h(s,"variable-input"),o.push(s.content))}n=i+1}if(d(["punctuation","property-query"])&&u(0).content==="{"&&(n++,h(u(0),"property-mutation"),0<o.length)){var a=p(/^\{$/,/^\}$/);if(a!==-1)for(var l=n;l<a;l++){var c=t[l];c.type==="variable"&&0<=o.indexOf(c.content)&&h(c,"variable-input")}}}}function u(m){return t[n+m]}function d(m,b){b=b||0;for(var v=0;v<m.length;v++){var x=u(v+b);if(!x||x.type!==m[v])return}return 1}function p(m,b){for(var v=1,x=n;x<t.length;x++){var w=t[x],_=w.content;if(w.type==="punctuation"&&typeof _=="string"){if(m.test(_))v++;else if(b.test(_)&&--v===0)return x}}return-1}function h(m,b){var v=m.alias;v?Array.isArray(v)||(m.alias=v=[v]):m.alias=v=[],v.push(b)}}),ve.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,o=r.inside["interpolation-punctuation"],i=r.pattern.source;function s(d,p){if(e.languages[d])return{pattern:RegExp("((?:"+p+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:d}}}}function a(d,p,h){return d={code:d,grammar:p,language:h},e.hooks.run("before-tokenize",d),d.tokens=e.tokenize(d.code,d.grammar),e.hooks.run("after-tokenize",d),d.tokens}function l(d,p,h){var v=e.tokenize(d,{interpolation:{pattern:RegExp(i),lookbehind:!0}}),m=0,b={},v=a(v.map(function(w){if(typeof w=="string")return w;for(var _,R,w=w.content;d.indexOf((R=m++,_="___"+h.toUpperCase()+"_"+R+"___"))!==-1;);return b[_]=w,_}).join(""),p,h),x=Object.keys(b);return m=0,function w(_){for(var R=0;R<_.length;R++){if(m>=x.length)return;var C,E,A,M,N,L,F,z=_[R];typeof z=="string"||typeof z.content=="string"?(C=x[m],(F=(L=typeof z=="string"?z:z.content).indexOf(C))!==-1&&(++m,E=L.substring(0,F),N=b[C],A=void 0,(M={})["interpolation-punctuation"]=o,(M=e.tokenize(N,M)).length===3&&((A=[1,1]).push.apply(A,a(M[1],e.languages.javascript,"javascript")),M.splice.apply(M,A)),A=new e.Token("interpolation",M,r.alias,N),M=L.substring(F+C.length),N=[],E&&N.push(E),N.push(A),M&&(w(L=[M]),N.push.apply(N,L)),typeof z=="string"?(_.splice.apply(_,[R,1].concat(N)),R+=N.length-1):z.content=N)):(F=z.content,Array.isArray(F)?w(F):w([F]))}}(v),new e.Token(h,v,"language-"+h,d)}e.languages.javascript["template-string"]=[s("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),s("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),s("svg",/\bsvg/.source),s("markdown",/\b(?:markdown|md)/.source),s("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),s("sql",/\bsql/.source),t].filter(Boolean);var c={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function u(d){return typeof d=="string"?d:Array.isArray(d)?d.map(u).join(""):u(d.content)}e.hooks.add("after-tokenize",function(d){d.language in c&&function p(h){for(var m=0,b=h.length;m<b;m++){var v,x,w,_=h[m];typeof _!="string"&&(v=_.content,Array.isArray(v)?_.type==="template-string"?(_=v[1],v.length===3&&typeof _!="string"&&_.type==="embedded-code"&&(x=u(_),_=_.alias,_=Array.isArray(_)?_[0]:_,w=e.languages[_])&&(v[1]=l(x,w,_))):p(v):typeof v!="string"&&p([v]))}}(d.tokens)})}(ve),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(ve),function(e){var t=e.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:t,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)}(ve),function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(ve),ve.languages.n4js=ve.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),ve.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),ve.languages.n4jsd=ve.languages.n4js,function(e){function t(s,a){return RegExp(s.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),a)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var i=n[r],o=e.languages.javascript[i],i=(o=e.util.type(o)==="RegExp"?e.languages.javascript[i]={pattern:o}:o).inside||{};(o.inside=i)["maybe-class-name"]=/^[A-Z][\s\S]*/}}(ve),function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,o=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function i(l,c){return l=l.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return o}),RegExp(l,c)}o=i(o).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=i(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:i(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:i(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);function s(l){for(var c=[],u=0;u<l.length;u++){var d=l[u],p=!1;typeof d!="string"&&(d.type==="tag"&&d.content[0]&&d.content[0].type==="tag"?d.content[0].content[0].content==="</"?0<c.length&&c[c.length-1].tagName===a(d.content[0].content[1])&&c.pop():d.content[d.content.length-1].content!=="/>"&&c.push({tagName:a(d.content[0].content[1]),openedBraces:0}):0<c.length&&d.type==="punctuation"&&d.content==="{"?c[c.length-1].openedBraces++:0<c.length&&0<c[c.length-1].openedBraces&&d.type==="punctuation"&&d.content==="}"?c[c.length-1].openedBraces--:p=!0),(p||typeof d=="string")&&0<c.length&&c[c.length-1].openedBraces===0&&(p=a(d),u<l.length-1&&(typeof l[u+1]=="string"||l[u+1].type==="plain-text")&&(p+=a(l[u+1]),l.splice(u+1,1)),0<u&&(typeof l[u-1]=="string"||l[u-1].type==="plain-text")&&(p=a(l[u-1])+p,l.splice(u-1,1),u--),l[u]=new e.Token("plain-text",p,null,p)),d.content&&typeof d.content!="string"&&s(d.content)}}var a=function(l){return l?typeof l=="string"?l:typeof l.content=="string"?l.content:l.content.map(a).join(""):""};e.hooks.add("after-tokenize",function(l){l.language!=="jsx"&&l.language!=="tsx"||s(l.tokens)})}(ve),function(e){var t=e.util.clone(e.languages.typescript),t=(e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag);t.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+t.pattern.source+")",t.pattern.flags),t.lookbehind=!0}(ve),ve.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},ve.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=ve.languages.swift}),function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(ve),ve.languages.c=ve.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),ve.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),ve.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},ve.languages.c.string],char:ve.languages.c.char,comment:ve.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:ve.languages.c}}}}),ve.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete ve.languages.c.boolean,ve.languages.objectivec=ve.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete ve.languages.objectivec["class-name"],ve.languages.objc=ve.languages.objectivec,ve.languages.reason=ve.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),ve.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete ve.languages.reason.function,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(ve),ve.languages.go=ve.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),ve.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete ve.languages.go["class-name"],function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(ve),ve.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},ve.languages.python["string-interpolation"].inside.interpolation.inside.rest=ve.languages.python,ve.languages.py=ve.languages.python,ve.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},ve.languages.webmanifest=ve.languages.json;var M_={};pRe(M_,{dracula:()=>vRe,duotoneDark:()=>wRe,duotoneLight:()=>_Re,github:()=>ERe,gruvboxMaterialDark:()=>e2e,gruvboxMaterialLight:()=>n2e,jettwaveDark:()=>GRe,jettwaveLight:()=>YRe,nightOwl:()=>PRe,nightOwlLight:()=>kRe,oceanicNext:()=>ORe,okaidia:()=>IRe,oneDark:()=>XRe,oneLight:()=>ZRe,palenight:()=>NRe,shadesOfPurple:()=>FRe,synthwave84:()=>$Re,ultramin:()=>BRe,vsDark:()=>m7,vsLight:()=>WRe});var yRe={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},vRe=yRe,xRe={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},wRe=xRe,SRe={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},_Re=SRe,CRe={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},ERe=CRe,RRe={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},PRe=RRe,TRe={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},kRe=TRe,xo={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},ARe={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:xo.keyword}},{types:["attr-value"],style:{color:xo.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:xo.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:xo.primitive}},{types:["boolean"],style:{color:xo.boolean}},{types:["tag"],style:{color:xo.tag}},{types:["string"],style:{color:xo.string}},{types:["punctuation"],style:{color:xo.string}},{types:["selector","char","builtin","inserted"],style:{color:xo.char}},{types:["function"],style:{color:xo.function}},{types:["operator","entity","url","variable"],style:{color:xo.variable}},{types:["keyword"],style:{color:xo.keyword}},{types:["atrule","class-name"],style:{color:xo.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},ORe=ARe,MRe={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},IRe=MRe,DRe={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},NRe=DRe,LRe={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},FRe=LRe,jRe={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},$Re=jRe,zRe={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},BRe=zRe,HRe={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},m7=HRe,VRe={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},WRe=VRe,URe={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},GRe=URe,qRe={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},YRe=qRe,KRe={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},XRe=KRe,QRe={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},ZRe=QRe,JRe={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},e2e=JRe,t2e={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},n2e=t2e,r2e=e=>T.useCallback(t=>{var n=t,{className:r,style:o,line:i}=n,s=g7(n,["className","style","line"]);const a=Fy(Ji({},s),{className:Yu("token-line",r)});return typeof e=="object"&&"plain"in e&&(a.style=e.plain),typeof o=="object"&&(a.style=Ji(Ji({},a.style||{}),o)),a},[e]),o2e=e=>{const t=T.useCallback(({types:n,empty:r})=>{if(e!=null){{if(n.length===1&&n[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(n.length===1&&r!=null)return e[n[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...n.map(o=>e[o]))}},[e]);return T.useCallback(n=>{var r=n,{token:o,className:i,style:s}=r,a=g7(r,["token","className","style"]);const l=Fy(Ji({},a),{className:Yu("token",...o.types,i),children:o.content,style:t(o)});return s!=null&&(l.style=Ji(Ji({},l.style||{}),s)),l},[t])},i2e=/\r\n|\r|\n/,RD=e=>{e.length===0?e.push({types:["plain"],content:`
|
|
379
|
+
`,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
|
|
380
|
+
`,e[0].empty=!0)},PD=(e,t)=>{const n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},s2e=e=>{const t=[[]],n=[e],r=[0],o=[e.length];let i=0,s=0,a=[];const l=[a];for(;s>-1;){for(;(i=r[s]++)<o[s];){let c,u=t[s];const p=n[s][i];if(typeof p=="string"?(u=s>0?u:["plain"],c=p):(u=PD(u,p.type),p.alias&&(u=PD(u,p.alias)),c=p.content),typeof c!="string"){s++,t.push(u),n.push(c),r.push(0),o.push(c.length);continue}const h=c.split(i2e),m=h.length;a.push({types:u,content:h[0]});for(let b=1;b<m;b++)RD(a),l.push(a=[]),a.push({types:u,content:h[b]})}s--,t.pop(),n.pop(),r.pop(),o.pop()}return RD(a),l},TD=s2e,a2e=({prism:e,code:t,grammar:n,language:r})=>T.useMemo(()=>{if(n==null)return TD([t]);const o={code:t,grammar:n,language:r,tokens:[]};return e.hooks.run("before-tokenize",o),o.tokens=e.tokenize(t,n),e.hooks.run("after-tokenize",o),TD(o.tokens)},[t,n,r,e]),l2e=(e,t)=>{const{plain:n}=e,r=e.styles.reduce((o,i)=>{const{languages:s,style:a}=i;return s&&!s.includes(t)||i.types.forEach(l=>{const c=Ji(Ji({},o[l]),a);o[l]=c}),o},{});return r.root=n,r.plain=Fy(Ji({},n),{backgroundColor:void 0}),r},c2e=l2e,u2e=({children:e,language:t,code:n,theme:r,prism:o})=>{const i=t.toLowerCase(),s=c2e(r,i),a=r2e(s),l=o2e(s),c=o.languages[i],u=a2e({prism:o,language:i,code:n,grammar:c});return e({tokens:u,className:`prism-code language-${i}`,style:s!=null?s.root:{},getLineProps:a,getTokenProps:l})},d2e=e=>T.createElement(u2e,Fy(Ji({},e),{prism:e.prism||ve,theme:e.theme||m7,code:e.code,language:e.language}));/*! Bundled license information:
|
|
381
|
+
|
|
382
|
+
prismjs/prism.js:
|
|
383
|
+
(**
|
|
384
|
+
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
385
|
+
*
|
|
386
|
+
* @license MIT <https://opensource.org/licenses/MIT>
|
|
387
|
+
* @author Lea Verou <https://lea.verou.me>
|
|
388
|
+
* @namespace
|
|
389
|
+
* @public
|
|
390
|
+
*)
|
|
391
|
+
*/function f2e({message:e,onAddToDashboard:t}){var i;const n=(i=e==null?void 0:e.parts)==null?void 0:i.filter(s=>s.type==="tool-invocation"&&s.toolInvocation.toolName==="getData"&&s.toolInvocation.state==="result");if(!n)return null;const o=n.map(s=>s.toolInvocation).map(s=>{const a=s.result;if(a.status==="error")return null;const l=a.data.records;return{chartCfg:xE({cardType:s.args.chartType,data:l}),chartTitle:s.args.chartTitle,chartType:s.args.chartType,sql:s.args.sql,data:l,connectionId:s.args.connectionId}}).filter(s=>s!==null);return!o||o.length===0?null:y.jsx("div",{className:"",children:o.map((s,a)=>y.jsxs("div",{className:"group relative isolate flex h-[350px] w-[99%] grow flex-col",children:[y.jsxs(Hn,{className:"invisible absolute right-0 top-0 z-10 h-8 p-2 group-hover:visible",onClick:()=>{t==null||t({sql:s.sql,data:s.data,cardCfg:s.chartCfg,cardTitle:s.chartTitle,connectionId:s.connectionId,cardType:s.chartType})},size:"sm",variant:"outline",children:[y.jsx(W0,{className:"mr-1 size-4"}),"Add"]}),y.jsx(YE,{cfg:s.chartCfg})]},a))})}function h2e({message:e,showTools:t}){var r;if(!t)return null;const n=(r=e==null?void 0:e.parts)==null?void 0:r.filter(o=>o.type==="tool-invocation");return y.jsx("div",{className:"space-y-3",children:n==null?void 0:n.map((o,i)=>{const s=o.toolInvocation;return y.jsxs(v1e,{children:[y.jsxs(x1e,{className:"rounded-md bg-green-200 p-1 px-2 font-mono text-xs text-black",children:[y.jsx("span",{className:"font-bold",children:"Tool:"})," ",s.toolName]}),y.jsx(w1e,{className:"mt-2 font-mono text-xs",children:y.jsxs("div",{className:"space-y-2 px-2",children:[y.jsxs("div",{className:"space-y-1",children:[y.jsx("span",{children:"Args:"}),y.jsx(l0,{language:"json",code:JSON.stringify(s.args,null,2)})]}),y.jsxs("div",{className:"space-y-1",children:[y.jsx("span",{children:"Result:"}),y.jsx(l0,{language:"json",code:JSON.stringify(s.result,null,2)})]})]})})]},i)})})}function p2e({message:e}){return e.role!=="user"?null:y.jsxs("div",{className:"rounded-md bg-muted/50 p-3 text-sm",children:[y.jsx(_L,{className:"float-left mr-2 size-4"}),y.jsx("div",{children:e.content})]})}function g2e({message:e}){if(e.role!=="system")return null;const t=e.content.split("|"),n=t[0],r=t[1]||"{}",o=JSON.parse(r);return y.jsxs("div",{className:"space-y-1",children:[y.jsxs("div",{children:[y.jsx("span",{className:"font-bold",children:"System Message:"})," ",n]}),y.jsxs("div",{className:"space-y-1",children:[y.jsx("span",{className:"font-mono text-xs",children:"Scope:"}),y.jsx(l0,{language:"json",code:JSON.stringify(o,null,2)})]})]})}function m2e({message:e,handleRun:t}){if(e.role!=="assistant")return null;const n={p:({node:r,...o})=>y.jsx("p",{className:"text-sm",...o}),code:({node:r,...o})=>{var s,a;const i=(a=(s=r==null?void 0:r.children)==null?void 0:s[0])==null?void 0:a.value;return i&&/^#([0-9a-fA-F]{6})$/.test(i)?y.jsx("code",{className:"rounded-md bg-muted px-2 py-1 text-xs",style:{backgroundColor:i},...o}):y.jsx("code",{className:"rounded-md bg-muted px-2 py-1 text-xs",...o})},pre:r=>y.jsx(b2e,{...r,handleRun:t}),li:({node:r,...o})=>y.jsx("li",{className:"my-2 list-outside pl-4 text-sm",...o})};return y.jsx(rRe,{components:n,children:e.content.replace(/DuckDB/gi,"Semaphor")})}function b7({status:e,isLoading:t}){return t?y.jsx("div",{className:"flex items-center text-xs text-muted-foreground",children:e}):null}function y7({messages:e,showTools:t=!1,showSystemMessage:n=!1,handleRun:r,onAddToDashboard:o}){return e==null?void 0:e.map(i=>y.jsxs("div",{className:ge("relative my-4 space-y-4 text-sm text-foreground/80"),children:[y.jsx(p2e,{message:i}),n&&y.jsx(g2e,{message:i}),y.jsx(h2e,{message:i,showTools:t}),y.jsx(f2e,{onAddToDashboard:o,message:i}),y.jsx(m2e,{message:i,handleRun:r})]},i.id))}function b2e({children:e,handleRun:t}){const n=be(a=>a.isVisualEditing),[r,o]=T.useState(!1);T.useRef(null);const i=()=>{navigator.clipboard.writeText(s).then(()=>{o(!0),setTimeout(()=>o(!1),2e3)})},s=I_(e);return y.jsxs("pre",{className:"relative my-2 space-y-2 rounded-md bg-muted/50",children:[y.jsxs("div",{className:"float-right m-1.5",children:[y.jsx(Hn,{className:"h-8 p-2 text-xs text-muted-foreground hover:text-foreground",onClick:i,size:"sm",variant:"ghost",children:r?y.jsx(_d,{className:"size-3"}):y.jsx(zC,{className:"size-3"})}),n&&y.jsx(Hn,{className:"h-8 p-2 text-muted-foreground hover:text-foreground",onClick:()=>t==null?void 0:t(s),size:"sm",variant:"ghost",children:y.jsx(gL,{className:"size-3"})})]}),y.jsx(l0,{code:s})]})}function I_(e){return typeof e=="string"?e:Array.isArray(e)?e.map(I_).join(""):T.isValidElement(e)?I_(e.props.children):""}const l0=({code:e,language:t="sql"})=>{const n=be(r=>r.theme);return y.jsx(d2e,{code:e,language:t,theme:n==="dark"?M_.vsDark:M_.oneLight,children:({className:r,style:o,tokens:i,getLineProps:s,getTokenProps:a})=>y.jsx("pre",{className:`${r} border-1 whitespace-pre-wrap rounded-md border border-muted p-2 text-xs`,style:{...o},children:i.map((l,c)=>y.jsx("div",{...s({line:l}),children:l.map((u,d)=>y.jsx("span",{...a({token:u})},d))},c))})})};function v7(e,t){return t||(e==="ready"?"":e==="error"?"Error":e==="streaming"?"":"Thinking...")}function y2e(e,t){return e.some(n=>n.tableName&&n.tableName===t.tableName||n.datamodelName&&n.datamodelName===t.datamodelName)}function v2e(e){return e.filter((n,r,o)=>r===o.findIndex(i=>i.tableName===n.tableName&&i.datamodelName===n.datamodelName))}function x2e(e,t){return e.filter(n=>!(n.connectionId===t.connectionId&&n.tableName===t.tableName&&n.datamodelName===t.datamodelName))}const x7=T.forwardRef(({input:e,handleInputChange:t,handleSubmit:n,isLoading:r,stop:o},i)=>y.jsxs("form",{onSubmit:n,className:"flex w-full items-center rounded-md border",children:[y.jsx(rc,{autoFocus:!0,ref:i,placeholder:"Type your question...",className:ge("max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"),disabled:r,value:e,onChange:t}),y.jsxs("div",{className:"mr-2 flex items-center gap-2",children:[r===!0&&y.jsx(Hn,{size:"sm",className:"h-7 rounded-full p-[9px]",onClick:()=>o(),children:y.jsx(fL,{className:"size-2.5 bg-background"})}),r===!1&&e&&y.jsx("button",{disabled:!e,className:"mr-3",children:y.jsx(yL,{className:"size-4 text-muted-foreground hover:text-foreground"})})]})]}));function w2e({handleChatBox:e}){const t=T.useRef(null),[n,r]=T.useState(""),[o,i]=T.useState(!1),s=be(N=>N.dashboard.aiScopeTables),{setSelectedConnectionId:a}=ap(),l=be(N=>N.selectedSheetId),{addFrame:c,setSelectedFrameId:u,setIsDashboardEditing:d}=An(),{authToken:p}=Do(),h=oC(),{messages:m,setMessages:b,reload:v,input:x,status:w,handleInputChange:_,handleSubmit:R,stop:C}=E9({api:"https://semaphor.cloud/api/v1/chat",headers:{Authorization:`Bearer ${p==null?void 0:p.accessToken}`},maxSteps:10,async onToolCall({toolCall:N}){if(N.toolName==="getTables")return r("Initializing..."),{tables:s||[]};if(N.toolName==="getSchemas"&&r("Analyzing..."),N.toolName==="getData"){r("Fetching...");const L=N.args;if(!(L!=null&&L.sql)||!(L!=null&&L.connectionId))return"Please provide sql, connectionId and table";try{return{status:"success",data:await h.fetchQuery({queryKey:["chat",L.connectionId,L.sql],queryFn:()=>_0("https://semaphor.cloud/api/v1/query",(p==null?void 0:p.accessToken)||(p==null?void 0:p.accessToken)||"",{connection_id:L.connectionId,sql:L.sql,cache_config:J_({})})})}}catch(F){return console.log("error",F.message),r("Error fetching data"),{status:"error",message:F.message}}}},onFinish(N,L){r(N.content),L.finishReason==="stop"&&r("")}}),E=()=>{var N;(N=t.current)==null||N.scrollIntoView({behavior:"smooth"})};T.useEffect(()=>{E()},[m]);function A({sql:N,data:L,cardCfg:F,cardTitle:z,connectionId:Z,cardType:G}){if(!l)return;const j={id:Na(),title:z||"Title",description:"Description",preferences:{onClickFilter:[{columnIndex:0,expression:""}],chartOptions:{indexAxis:G==="horizontalBar"?"y":"x"}},type:F.type,cfg:F,sql:N,data:L,connectionId:Z},H={id:Na(),cards:[j],activeCardId:j.id};d(!0),c(l,H,"start"),u(H.id)}const M=!["ready","error"].includes(w);return y.jsxs("div",{role:"chat-box",className:"flex h-full grow flex-col justify-between break-words rounded-md",children:[y.jsxs("div",{className:"flex items-center justify-between gap-2 px-6 pb-3 pt-6",children:[y.jsxs("div",{className:"flex items-center gap-4",children:[y.jsx(cn,{className:"flex items-center gap-2 text-xl",children:"Assistant"}),y.jsxs(bp,{openDelay:0,children:[y.jsx(yp,{children:y.jsx(CL,{className:"size-4 text-muted-foreground"})}),y.jsx(Od,{className:"w-70 p-2",children:y.jsx("div",{className:"flex justify-between space-x-2 text-muted-foreground",children:y.jsxs("div",{children:[(s==null?void 0:s.length)===0&&y.jsx("p",{className:"text-sm",children:"No tables in scope"}),y.jsx("div",{className:"space-y-2",children:s==null?void 0:s.map((N,L)=>y.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[y.jsx(wL,{className:"size-3 text-muted-foreground/70"}),y.jsx("span",{children:SN({schemaName:N.schemaName||"",tableName:N.tableName||"",modelName:N.datamodelName||"",connectionType:N.connectionType||""})})]},L))})]})})})]})]}),y.jsxs("div",{className:"flex items-center gap-1",children:[y.jsx(Hn,{className:"h-7 p-2",size:"sm",variant:"ghost",onClick:()=>{b([]),v()},children:y.jsx(xL,{className:"size-4 text-muted-foreground"})}),y.jsx(Hn,{className:"h-7 p-2",size:"sm",variant:"ghost",onClick:()=>e(!1),children:y.jsx(kc,{className:"size-4 text-muted-foreground"})})]})]}),y.jsxs(oc,{className:"flex flex-1 basis-0 flex-col flex-wrap justify-end px-6 py-3",children:[y.jsxs("div",{className:"pb-4",children:[y.jsx(y7,{messages:m,onAddToDashboard:A}),y.jsx(b7,{status:v7(w,n),isLoading:M}),y.jsx("div",{ref:t})]}),y.jsx(Cp,{orientation:"vertical"})]}),y.jsx("div",{className:"px-6 pb-6",children:y.jsx(x7,{stop:C,input:x,handleInputChange:_,handleSubmit:R,isLoading:M})})]})}const{createElement:yd,createContext:S2e,forwardRef:w7,useCallback:Xr,useContext:S7,useEffect:sc,useImperativeHandle:_7,useLayoutEffect:_2e,useMemo:C2e,useRef:no,useState:Mu}=P,kD=P[`useId${Math.random()}`.slice(0,5)],E2e=_2e,jy=S2e(null);jy.displayName="PanelGroupContext";const ac=E2e,R2e=typeof kD=="function"?kD:()=>null;let P2e=0;function n2(e=null){const t=R2e(),n=no(e||t||null);return n.current===null&&(n.current=""+P2e++),e??n.current}function C7({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:d,order:p,style:h,tagName:m="div",...b}){const v=S7(jy);if(v===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:w,getPanelSize:_,getPanelStyle:R,groupId:C,isPanelCollapsed:E,reevaluatePanelConstraints:A,registerPanel:M,resizePanel:N,unregisterPanel:L}=v,F=n2(s),z=no({callbacks:{onCollapse:c,onExpand:u,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:a,minSize:l},id:F,idIsFromProps:s!==void 0,order:p});no({didLogMissingDefaultSizeWarning:!1}),ac(()=>{const{callbacks:G,constraints:j}=z.current,H={...j};z.current.id=F,z.current.idIsFromProps=s!==void 0,z.current.order=p,G.onCollapse=c,G.onExpand=u,G.onResize=d,j.collapsedSize=n,j.collapsible=r,j.defaultSize=o,j.maxSize=a,j.minSize=l,(H.collapsedSize!==j.collapsedSize||H.collapsible!==j.collapsible||H.maxSize!==j.maxSize||H.minSize!==j.minSize)&&A(z.current,H)}),ac(()=>{const G=z.current;return M(G),()=>{L(G)}},[p,F,M,L]),_7(i,()=>({collapse:()=>{x(z.current)},expand:G=>{w(z.current,G)},getId(){return F},getSize(){return _(z.current)},isCollapsed(){return E(z.current)},isExpanded(){return!E(z.current)},resize:G=>{N(z.current,G)}}),[x,w,_,E,F,N]);const Z=R(z.current,o);return yd(m,{...b,children:e,className:t,id:s,style:{...Z,...h},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":C,"data-panel-id":F,"data-panel-size":parseFloat(""+Z.flexGrow).toFixed(1)})}const E7=w7((e,t)=>yd(C7,{...e,forwardedRef:t}));C7.displayName="Panel";E7.displayName="forwardRef(Panel)";let D_=null,jl=null;function T2e(e,t){if(t){const n=(t&A7)!==0,r=(t&O7)!==0,o=(t&M7)!==0,i=(t&I7)!==0;if(n)return o?"se-resize":i?"ne-resize":"e-resize";if(r)return o?"sw-resize":i?"nw-resize":"w-resize";if(o)return"s-resize";if(i)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function k2e(){jl!==null&&(document.head.removeChild(jl),D_=null,jl=null)}function e1(e,t){const n=T2e(e,t);D_!==n&&(D_=n,jl===null&&(jl=document.createElement("style"),document.head.appendChild(jl)),jl.innerHTML=`*{cursor: ${n}!important;}`)}function R7(e){return e.type==="keydown"}function P7(e){return e.type.startsWith("pointer")}function T7(e){return e.type.startsWith("mouse")}function $y(e){if(P7(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(T7(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function A2e(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function O2e(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function M2e(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:MD(e),b:MD(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;mt(r,"Stacking order can only be calculated for elements with a common ancestor");const o={a:OD(AD(n.a)),b:OD(AD(n.b))};if(o.a===o.b){const i=r.childNodes,s={a:n.a.at(-1),b:n.b.at(-1)};let a=i.length;for(;a--;){const l=i[a];if(l===s.a)return 1;if(l===s.b)return-1}}return Math.sign(o.a-o.b)}const I2e=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function D2e(e){var t;const n=getComputedStyle((t=k7(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function N2e(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||D2e(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||I2e.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function AD(e){let t=e.length;for(;t--;){const n=e[t];if(mt(n,"Missing node"),N2e(n))return n}return null}function OD(e){return e&&Number(getComputedStyle(e).zIndex)||0}function MD(e){const t=[];for(;e;)t.push(e),e=k7(e);return t}function k7(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const A7=1,O7=2,M7=4,I7=8,L2e=A2e()==="coarse";let _i=[],Iu=!1,ba=new Map,zy=new Map;const Uh=new Set;function F2e(e,t,n,r,o){var i;const{ownerDocument:s}=t,a={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:o},l=(i=ba.get(s))!==null&&i!==void 0?i:0;return ba.set(s,l+1),Uh.add(a),c0(),function(){var u;zy.delete(e),Uh.delete(a);const d=(u=ba.get(s))!==null&&u!==void 0?u:1;if(ba.set(s,d-1),c0(),d===1&&ba.delete(s),_i.includes(a)){const p=_i.indexOf(a);p>=0&&_i.splice(p,1),o2(),o("up",!0,null)}}}function ID(e){const{target:t}=e,{x:n,y:r}=$y(e);Iu=!0,r2({target:t,x:n,y:r}),c0(),_i.length>0&&(u0("down",e),e.preventDefault(),e.stopPropagation())}function Rf(e){const{x:t,y:n}=$y(e);if(Iu&&e.buttons===0&&(Iu=!1,u0("up",e)),!Iu){const{target:r}=e;r2({target:r,x:t,y:n})}u0("move",e),o2(),_i.length>0&&e.preventDefault()}function lu(e){const{target:t}=e,{x:n,y:r}=$y(e);zy.clear(),Iu=!1,_i.length>0&&e.preventDefault(),u0("up",e),r2({target:t,x:n,y:r}),o2(),c0()}function r2({target:e,x:t,y:n}){_i.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),Uh.forEach(o=>{const{element:i,hitAreaMargins:s}=o,a=i.getBoundingClientRect(),{bottom:l,left:c,right:u,top:d}=a,p=L2e?s.coarse:s.fine;if(t>=c-p&&t<=u+p&&n>=d-p&&n<=l+p){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&M2e(r,i)>0){let m=r,b=!1;for(;m&&!m.contains(i);){if(O2e(m.getBoundingClientRect(),a)){b=!0;break}m=m.parentElement}if(b)return}_i.push(o)}})}function t1(e,t){zy.set(e,t)}function o2(){let e=!1,t=!1;_i.forEach(r=>{const{direction:o}=r;o==="horizontal"?e=!0:t=!0});let n=0;zy.forEach(r=>{n|=r}),e&&t?e1("intersection",n):e?e1("horizontal",n):t?e1("vertical",n):k2e()}function c0(){ba.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",lu),n.removeEventListener("pointerdown",ID),n.removeEventListener("pointerleave",Rf),n.removeEventListener("pointermove",Rf)}),window.removeEventListener("pointerup",lu),window.removeEventListener("pointercancel",lu),Uh.size>0&&(Iu?(_i.length>0&&ba.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",lu),n.addEventListener("pointerleave",Rf),n.addEventListener("pointermove",Rf))}),window.addEventListener("pointerup",lu),window.addEventListener("pointercancel",lu)):ba.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",ID,{capture:!0}),n.addEventListener("pointermove",Rf))}))}function u0(e,t){Uh.forEach(n=>{const{setResizeHandlerState:r}=n,o=_i.includes(n);r(e,o,t)})}function j2e(){const[e,t]=Mu(0);return Xr(()=>t(n=>n+1),[])}function mt(e,t){if(!e)throw console.error(t),Error(t)}const i2=10;function wc(e,t,n=i2){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function zs(e,t,n=i2){return wc(e,t,n)===0}function Co(e,t,n){return wc(e,t,n)===0}function $2e(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const o=e[r],i=t[r];if(!Co(o,i,n))return!1}return!0}function yu({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];mt(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:o=0,collapsible:i,maxSize:s=100,minSize:a=0}=r;if(wc(n,a)<0)if(i){const l=(o+a)/2;wc(n,l)<0?n=o:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(i2)),n}function Vf({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:o,trigger:i}){if(Co(e,0))return t;const s=[...t],[a,l]=r;mt(a!=null,"Invalid first pivot index"),mt(l!=null,"Invalid second pivot index");let c=0;if(i==="keyboard"){{const d=e<0?l:a,p=n[d];mt(p,`Panel constraints not found for index ${d}`);const{collapsedSize:h=0,collapsible:m,minSize:b=0}=p;if(m){const v=t[d];if(mt(v!=null,`Previous layout not found for panel index ${d}`),Co(v,h)){const x=b-v;wc(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const d=e<0?a:l,p=n[d];mt(p,`No panel constraints found for index ${d}`);const{collapsedSize:h=0,collapsible:m,minSize:b=0}=p;if(m){const v=t[d];if(mt(v!=null,`Previous layout not found for panel index ${d}`),Co(v,b)){const x=v-h;wc(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}}{const d=e<0?1:-1;let p=e<0?l:a,h=0;for(;;){const b=t[p];mt(b!=null,`Previous layout not found for panel index ${p}`);const x=yu({panelConstraints:n,panelIndex:p,size:100})-b;if(h+=x,p+=d,p<0||p>=n.length)break}const m=Math.min(Math.abs(e),Math.abs(h));e=e<0?0-m:m}{let p=e<0?a:l;for(;p>=0&&p<n.length;){const h=Math.abs(e)-Math.abs(c),m=t[p];mt(m!=null,`Previous layout not found for panel index ${p}`);const b=m-h,v=yu({panelConstraints:n,panelIndex:p,size:b});if(!Co(m,v)&&(c+=m-v,s[p]=v,c.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?p--:p++}}if($2e(o,s))return o;{const d=e<0?l:a,p=t[d];mt(p!=null,`Previous layout not found for panel index ${d}`);const h=p+c,m=yu({panelConstraints:n,panelIndex:d,size:h});if(s[d]=m,!Co(m,h)){let b=h-m,x=e<0?l:a;for(;x>=0&&x<n.length;){const w=s[x];mt(w!=null,`Previous layout not found for panel index ${x}`);const _=w+b,R=yu({panelConstraints:n,panelIndex:x,size:_});if(Co(w,R)||(b-=R-w,s[x]=R),Co(b,0))break;e>0?x--:x++}}}const u=s.reduce((d,p)=>p+d,0);return Co(u,100)?s:o}function z2e({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,s=0;const a=n[0];mt(a!=null,"No pivot index found"),t.forEach((d,p)=>{const{constraints:h}=d,{maxSize:m=100,minSize:b=0}=h;p===a?(r=b,o=m):(i+=b,s+=m)});const l=Math.min(o,100-i),c=Math.max(r,100-s),u=e[a];return{valueMax:l,valueMin:c,valueNow:u}}function Gh(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function D7(e,t,n=document){const o=Gh(e,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return o??null}function N7(e,t,n){const r=D7(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function L7(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function By(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function B2e(e,t,n,r=document){var o,i,s,a;const l=By(t,r),c=Gh(e,r),u=l?c.indexOf(l):-1,d=(o=(i=n[u])===null||i===void 0?void 0:i.id)!==null&&o!==void 0?o:null,p=(s=(a=n[u+1])===null||a===void 0?void 0:a.id)!==null&&s!==void 0?s:null;return[d,p]}function H2e({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,panelGroupElement:i,setLayout:s}){no({didWarnAboutMissingResizeHandle:!1}),ac(()=>{if(!i)return;const a=Gh(n,i);for(let l=0;l<o.length-1;l++){const{valueMax:c,valueMin:u,valueNow:d}=z2e({layout:r,panelsArray:o,pivotIndices:[l,l+1]}),p=a[l];if(p!=null){const h=o[l];mt(h,`No panel data found for index "${l}"`),p.setAttribute("aria-controls",h.id),p.setAttribute("aria-valuemax",""+Math.round(c)),p.setAttribute("aria-valuemin",""+Math.round(u)),p.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{a.forEach((l,c)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[n,r,o,i]),sc(()=>{if(!i)return;const a=t.current;mt(a,"Eager values not found");const{panelDataArray:l}=a,c=L7(n,i);mt(c!=null,`No group found for id "${n}"`);const u=Gh(n,i);mt(u,`No resize handles found for group id "${n}"`);const d=u.map(p=>{const h=p.getAttribute("data-panel-resize-handle-id");mt(h,"Resize handle element has no handle id attribute");const[m,b]=B2e(n,h,l,i);if(m==null||b==null)return()=>{};const v=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const w=l.findIndex(_=>_.id===m);if(w>=0){const _=l[w];mt(_,`No panel data found for index ${w}`);const R=r[w],{collapsedSize:C=0,collapsible:E,minSize:A=0}=_.constraints;if(R!=null&&E){const M=Vf({delta:Co(R,C)?A-C:C-R,initialLayout:r,panelConstraints:l.map(N=>N.constraints),pivotIndices:N7(n,h,i),prevLayout:r,trigger:"keyboard"});r!==M&&s(M)}}break}}};return p.addEventListener("keydown",v),()=>{p.removeEventListener("keydown",v)}});return()=>{d.forEach(p=>p())}},[i,e,t,n,r,o,s])}function DD(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function F7(e,t){const n=e==="horizontal",{x:r,y:o}=$y(t);return n?r:o}function V2e(e,t,n,r,o){const i=n==="horizontal",s=By(t,o);mt(s,`No resize handle element found for id "${t}"`);const a=s.getAttribute("data-panel-group-id");mt(a,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const c=F7(n,e),u=L7(a,o);mt(u,`No group element found for id "${a}"`);const d=u.getBoundingClientRect(),p=i?d.width:d.height;return(c-l)/p*100}function W2e(e,t,n,r,o,i){if(R7(e)){const s=n==="horizontal";let a=0;e.shiftKey?a=100:o!=null?a=o:a=10;let l=0;switch(e.key){case"ArrowDown":l=s?0:a;break;case"ArrowLeft":l=s?-a:0;break;case"ArrowRight":l=s?a:0;break;case"ArrowUp":l=s?0:-a;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:V2e(e,t,n,r,i)}function U2e({panelDataArray:e}){const t=Array(e.length),n=e.map(i=>i.constraints);let r=0,o=100;for(let i=0;i<e.length;i++){const s=n[i];mt(s,`Panel constraints not found for index ${i}`);const{defaultSize:a}=s;a!=null&&(r++,t[i]=a,o-=a)}for(let i=0;i<e.length;i++){const s=n[i];mt(s,`Panel constraints not found for index ${i}`);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=o/l;r++,t[i]=c,o-=c}return t}function cu(e,t,n){t.forEach((r,o)=>{const i=e[o];mt(i,`Panel data not found for index ${o}`);const{callbacks:s,constraints:a,id:l}=i,{collapsedSize:c=0,collapsible:u}=a,d=n[l];if(d==null||r!==d){n[l]=r;const{onCollapse:p,onExpand:h,onResize:m}=s;m&&m(r,d),u&&(p||h)&&(h&&(d==null||zs(d,c))&&!zs(r,c)&&h(),p&&(d==null||!zs(d,c))&&zs(r,c)&&p())}})}function jm(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function G2e({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:i=3}){const s=n[o];let a;return s==null?a=e!=null?e.toPrecision(i):"1":r.length===1?a="1":a=s.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function q2e(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function ND(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function j7(e){return`react-resizable-panels:${e}`}function $7(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:o,order:i}=t;return o?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function z7(e,t){try{const n=j7(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function Y2e(e,t,n){var r,o;const i=(r=z7(e,n))!==null&&r!==void 0?r:{},s=$7(t);return(o=i[s])!==null&&o!==void 0?o:null}function K2e(e,t,n,r,o){var i;const s=j7(e),a=$7(t),l=(i=z7(e,o))!==null&&i!==void 0?i:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function LD({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((i,s)=>i+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!Co(r,100)&&n.length>0)for(let i=0;i<t.length;i++){const s=n[i];mt(s!=null,`No layout data found for index ${i}`);const a=100/r*s;n[i]=a}let o=0;for(let i=0;i<t.length;i++){const s=n[i];mt(s!=null,`No layout data found for index ${i}`);const a=yu({panelConstraints:t,panelIndex:i,size:s});s!=a&&(o+=s-a,n[i]=a)}if(!Co(o,0))for(let i=0;i<t.length;i++){const s=n[i];mt(s!=null,`No layout data found for index ${i}`);const a=s+o,l=yu({panelConstraints:t,panelIndex:i,size:a});if(s!==l&&(o-=l-s,n[i]=l,Co(o,0)))break}return n}const X2e=100,Wf={getItem:e=>(ND(Wf),Wf.getItem(e)),setItem:(e,t)=>{ND(Wf),Wf.setItem(e,t)}},FD={};function B7({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=Wf,style:c,tagName:u="div",...d}){const p=n2(i),h=no(null),[m,b]=Mu(null),[v,x]=Mu([]),w=j2e(),_=no({}),R=no(new Map),C=no(0),E=no({autoSaveId:e,direction:r,dragState:m,id:p,keyboardResizeBy:a,onLayout:s,storage:l}),A=no({layout:v,panelDataArray:[],panelDataArrayChanged:!1});no({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),_7(o,()=>({getId:()=>E.current.id,getLayout:()=>{const{layout:O}=A.current;return O},setLayout:O=>{const{onLayout:J}=E.current,{layout:K,panelDataArray:ne}=A.current,Y=LD({layout:O,panelConstraints:ne.map(ee=>ee.constraints)});DD(K,Y)||(x(Y),A.current.layout=Y,J&&J(Y),cu(ne,Y,_.current))}}),[]),ac(()=>{E.current.autoSaveId=e,E.current.direction=r,E.current.dragState=m,E.current.id=p,E.current.onLayout=s,E.current.storage=l}),H2e({committedValuesRef:E,eagerValuesRef:A,groupId:p,layout:v,panelDataArray:A.current.panelDataArray,setLayout:x,panelGroupElement:h.current}),sc(()=>{const{panelDataArray:O}=A.current;if(e){if(v.length===0||v.length!==O.length)return;let J=FD[e];J==null&&(J=q2e(K2e,X2e),FD[e]=J);const K=[...O],ne=new Map(R.current);J(e,K,ne,v,l)}},[e,v,l]),sc(()=>{});const M=Xr(O=>{const{onLayout:J}=E.current,{layout:K,panelDataArray:ne}=A.current;if(O.constraints.collapsible){const Y=ne.map(fe=>fe.constraints),{collapsedSize:ee=0,panelSize:re,pivotIndices:ue}=vl(ne,O,K);if(mt(re!=null,`Panel size not found for panel "${O.id}"`),!zs(re,ee)){R.current.set(O.id,re);const se=du(ne,O)===ne.length-1?re-ee:ee-re,pe=Vf({delta:se,initialLayout:K,panelConstraints:Y,pivotIndices:ue,prevLayout:K,trigger:"imperative-api"});jm(K,pe)||(x(pe),A.current.layout=pe,J&&J(pe),cu(ne,pe,_.current))}}},[]),N=Xr((O,J)=>{const{onLayout:K}=E.current,{layout:ne,panelDataArray:Y}=A.current;if(O.constraints.collapsible){const ee=Y.map(ce=>ce.constraints),{collapsedSize:re=0,panelSize:ue=0,minSize:fe=0,pivotIndices:se}=vl(Y,O,ne),pe=J??fe;if(zs(ue,re)){const ce=R.current.get(O.id),_e=ce!=null&&ce>=pe?ce:pe,Me=du(Y,O)===Y.length-1?ue-_e:_e-ue,ke=Vf({delta:Me,initialLayout:ne,panelConstraints:ee,pivotIndices:se,prevLayout:ne,trigger:"imperative-api"});jm(ne,ke)||(x(ke),A.current.layout=ke,K&&K(ke),cu(Y,ke,_.current))}}},[]),L=Xr(O=>{const{layout:J,panelDataArray:K}=A.current,{panelSize:ne}=vl(K,O,J);return mt(ne!=null,`Panel size not found for panel "${O.id}"`),ne},[]),F=Xr((O,J)=>{const{panelDataArray:K}=A.current,ne=du(K,O);return G2e({defaultSize:J,dragState:m,layout:v,panelData:K,panelIndex:ne})},[m,v]),z=Xr(O=>{const{layout:J,panelDataArray:K}=A.current,{collapsedSize:ne=0,collapsible:Y,panelSize:ee}=vl(K,O,J);return mt(ee!=null,`Panel size not found for panel "${O.id}"`),Y===!0&&zs(ee,ne)},[]),Z=Xr(O=>{const{layout:J,panelDataArray:K}=A.current,{collapsedSize:ne=0,collapsible:Y,panelSize:ee}=vl(K,O,J);return mt(ee!=null,`Panel size not found for panel "${O.id}"`),!Y||wc(ee,ne)>0},[]),G=Xr(O=>{const{panelDataArray:J}=A.current;J.push(O),J.sort((K,ne)=>{const Y=K.order,ee=ne.order;return Y==null&&ee==null?0:Y==null?-1:ee==null?1:Y-ee}),A.current.panelDataArrayChanged=!0,w()},[w]);ac(()=>{if(A.current.panelDataArrayChanged){A.current.panelDataArrayChanged=!1;const{autoSaveId:O,onLayout:J,storage:K}=E.current,{layout:ne,panelDataArray:Y}=A.current;let ee=null;if(O){const ue=Y2e(O,Y,K);ue&&(R.current=new Map(Object.entries(ue.expandToSizes)),ee=ue.layout)}ee==null&&(ee=U2e({panelDataArray:Y}));const re=LD({layout:ee,panelConstraints:Y.map(ue=>ue.constraints)});DD(ne,re)||(x(re),A.current.layout=re,J&&J(re),cu(Y,re,_.current))}}),ac(()=>{const O=A.current;return()=>{O.layout=[]}},[]);const j=Xr(O=>{let J=!1;const K=h.current;return K&&window.getComputedStyle(K,null).getPropertyValue("direction")==="rtl"&&(J=!0),function(Y){Y.preventDefault();const ee=h.current;if(!ee)return()=>null;const{direction:re,dragState:ue,id:fe,keyboardResizeBy:se,onLayout:pe}=E.current,{layout:ce,panelDataArray:_e}=A.current,{initialLayout:Pe}=ue??{},Me=N7(fe,O,ee);let ke=W2e(Y,O,re,ue,se,ee);const Ne=re==="horizontal";Ne&&J&&(ke=-ke);const tt=_e.map(xt=>xt.constraints),ot=Vf({delta:ke,initialLayout:Pe??ce,panelConstraints:tt,pivotIndices:Me,prevLayout:ce,trigger:R7(Y)?"keyboard":"mouse-or-touch"}),gn=!jm(ce,ot);(P7(Y)||T7(Y))&&C.current!=ke&&(C.current=ke,!gn&&ke!==0?Ne?t1(O,ke<0?A7:O7):t1(O,ke<0?M7:I7):t1(O,0)),gn&&(x(ot),A.current.layout=ot,pe&&pe(ot),cu(_e,ot,_.current))}},[]),H=Xr((O,J)=>{const{onLayout:K}=E.current,{layout:ne,panelDataArray:Y}=A.current,ee=Y.map(ce=>ce.constraints),{panelSize:re,pivotIndices:ue}=vl(Y,O,ne);mt(re!=null,`Panel size not found for panel "${O.id}"`);const se=du(Y,O)===Y.length-1?re-J:J-re,pe=Vf({delta:se,initialLayout:ne,panelConstraints:ee,pivotIndices:ue,prevLayout:ne,trigger:"imperative-api"});jm(ne,pe)||(x(pe),A.current.layout=pe,K&&K(pe),cu(Y,pe,_.current))},[]),$=Xr((O,J)=>{const{layout:K,panelDataArray:ne}=A.current,{collapsedSize:Y=0,collapsible:ee}=J,{collapsedSize:re=0,collapsible:ue,maxSize:fe=100,minSize:se=0}=O.constraints,{panelSize:pe}=vl(ne,O,K);pe!=null&&(ee&&ue&&zs(pe,Y)?zs(Y,re)||H(O,re):pe<se?H(O,se):pe>fe&&H(O,fe))},[H]),V=Xr((O,J)=>{const{direction:K}=E.current,{layout:ne}=A.current;if(!h.current)return;const Y=By(O,h.current);mt(Y,`Drag handle element not found for id "${O}"`);const ee=F7(K,J);b({dragHandleId:O,dragHandleRect:Y.getBoundingClientRect(),initialCursorPosition:ee,initialLayout:ne})},[]),X=Xr(()=>{b(null)},[]),I=Xr(O=>{const{panelDataArray:J}=A.current,K=du(J,O);K>=0&&(J.splice(K,1),delete _.current[O.id],A.current.panelDataArrayChanged=!0,w())},[w]),q=C2e(()=>({collapsePanel:M,direction:r,dragState:m,expandPanel:N,getPanelSize:L,getPanelStyle:F,groupId:p,isPanelCollapsed:z,isPanelExpanded:Z,reevaluatePanelConstraints:$,registerPanel:G,registerResizeHandle:j,resizePanel:H,startDragging:V,stopDragging:X,unregisterPanel:I,panelGroupElement:h.current}),[M,m,r,N,L,F,p,z,Z,$,G,j,H,V,X,I]),U={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return yd(jy.Provider,{value:q},yd(u,{...d,children:t,className:n,id:i,ref:h,style:{...U,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":p}))}const H7=w7((e,t)=>yd(B7,{...e,forwardedRef:t}));B7.displayName="PanelGroup";H7.displayName="forwardRef(PanelGroup)";function du(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function vl(e,t,n){const r=du(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],s=n[r];return{...t.constraints,panelSize:s,pivotIndices:i}}function Q2e({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){sc(()=>{if(e||n==null||r==null)return;const o=By(t,r);if(o==null)return;const i=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const a=o.getAttribute("data-panel-group-id");mt(a,`No group element found for id "${a}"`);const l=Gh(a,r),c=D7(a,t,r);mt(c!==null,`No resize element found for id "${t}"`);const u=s.shiftKey?c>0?c-1:l.length-1:c+1<l.length?c+1:0;l[u].focus();break}}};return o.addEventListener("keydown",i),()=>{o.removeEventListener("keydown",i)}},[r,e,t,n])}function s2({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:o,onBlur:i,onDragging:s,onFocus:a,style:l={},tabIndex:c=0,tagName:u="div",...d}){var p,h;const m=no(null),b=no({onDragging:s});sc(()=>{b.current.onDragging=s});const v=S7(jy);if(v===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:x,groupId:w,registerResizeHandle:_,startDragging:R,stopDragging:C,panelGroupElement:E}=v,A=n2(o),[M,N]=Mu("inactive"),[L,F]=Mu(!1),[z,Z]=Mu(null),G=no({state:M});ac(()=>{G.current.state=M}),sc(()=>{if(n)Z(null);else{const V=_(A);Z(()=>V)}},[n,A,_]);const j=(p=r==null?void 0:r.coarse)!==null&&p!==void 0?p:15,H=(h=r==null?void 0:r.fine)!==null&&h!==void 0?h:5;return sc(()=>{if(n||z==null)return;const V=m.current;return mt(V,"Element ref not attached"),F2e(A,V,x,{coarse:j,fine:H},(I,q,U)=>{if(q)switch(I){case"down":{N("drag"),mt(U,'Expected event to be defined for "down" action'),R(A,U);const{onDragging:O}=b.current;O&&O(!0);break}case"move":{const{state:O}=G.current;O!=="drag"&&N("hover"),mt(U,'Expected event to be defined for "move" action'),z(U);break}case"up":{N("hover"),C();const{onDragging:O}=b.current;O&&O(!1);break}}else N("inactive")})},[j,x,n,H,_,A,z,R,C]),Q2e({disabled:n,handleId:A,resizeHandler:z,panelGroupElement:E}),yd(u,{...d,children:e,className:t,id:o,onBlur:()=>{F(!1),i==null||i()},onFocus:()=>{F(!0),a==null||a()},ref:m,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...l},tabIndex:c,"data-panel-group-direction":x,"data-panel-group-id":w,"data-resize-handle":"","data-resize-handle-active":M==="drag"?"pointer":L?"keyboard":void 0,"data-resize-handle-state":M,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":A})}s2.displayName="PanelResizeHandle";const V7=({className:e,...t})=>y.jsx(H7,{className:ge("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),N_=E7,Z2e=({withHandle:e,className:t,...n})=>y.jsx(s2,{className:ge("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&y.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:y.jsx(aL,{className:"h-2.5 w-2.5"})})}),J2e=({withHandle:e,className:t,onTabClick:n,open:r,...o})=>y.jsx(s2,{className:ge("relative flex w-px items-start justify-end bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",{"justify-start":r},t),...o,children:e&&!r&&y.jsx("div",{className:ge("z-50 flex items-center justify-start",{"border-l":r}),children:y.jsx(Hn,{variant:"secondary",className:ge("h-7 p-0.5",{"rounded-bl-none rounded-br-md rounded-tl-none rounded-tr-md":r,"mt-0 rounded-bl-md rounded-br-none rounded-tl-md rounded-tr-none":!r}),onClick:()=>n(!r),children:r?y.jsx(V0,{className:"size-4"}):y.jsx(jC,{className:"size-4"})})})});var a2="Dialog",[W7,U7]=Vn(a2),[ePe,Ti]=W7(a2),G7=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=P.useRef(null),l=P.useRef(null),[c=!1,u]=wr({prop:r,defaultProp:o,onChange:i});return y.jsx(ePe,{scope:t,triggerRef:a,contentRef:l,contentId:Nn(),titleId:Nn(),descriptionId:Nn(),open:c,onOpenChange:u,onOpenToggle:P.useCallback(()=>u(d=>!d),[u]),modal:s,children:n})};G7.displayName=a2;var q7="DialogTrigger",Y7=P.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ti(q7,n),i=et(t,o.triggerRef);return y.jsx(Oe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":u2(o.open),...r,ref:i,onClick:Ce(e.onClick,o.onOpenToggle)})});Y7.displayName=q7;var l2="DialogPortal",[tPe,K7]=W7(l2,{forceMount:void 0}),X7=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Ti(l2,t);return y.jsx(tPe,{scope:t,forceMount:n,children:P.Children.map(r,s=>y.jsx(Ln,{present:n||i.open,children:y.jsx(mp,{asChild:!0,container:o,children:s})}))})};X7.displayName=l2;var d0="DialogOverlay",Q7=P.forwardRef((e,t)=>{const n=K7(d0,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Ti(d0,e.__scopeDialog);return i.modal?y.jsx(Ln,{present:r||i.open,children:y.jsx(nPe,{...o,ref:t})}):null});Q7.displayName=d0;var nPe=P.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ti(d0,n);return y.jsx(xp,{as:Gs,allowPinchZoom:!0,shards:[o.contentRef],children:y.jsx(Oe.div,{"data-state":u2(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Sc="DialogContent",Z7=P.forwardRef((e,t)=>{const n=K7(Sc,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Ti(Sc,e.__scopeDialog);return y.jsx(Ln,{present:r||i.open,children:i.modal?y.jsx(rPe,{...o,ref:t}):y.jsx(oPe,{...o,ref:t})})});Z7.displayName=Sc;var rPe=P.forwardRef((e,t)=>{const n=Ti(Sc,e.__scopeDialog),r=P.useRef(null),o=et(t,n.contentRef,r);return P.useEffect(()=>{const i=r.current;if(i)return py(i)},[]),y.jsx(J7,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:Ce(e.onFocusOutside,i=>i.preventDefault())})}),oPe=P.forwardRef((e,t)=>{const n=Ti(Sc,e.__scopeDialog),r=P.useRef(!1),o=P.useRef(!1);return y.jsx(J7,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),J7=P.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=Ti(Sc,n),l=P.useRef(null),c=et(t,l);return fy(),y.jsxs(y.Fragment,{children:[y.jsx(vp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:y.jsx(Oc,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":u2(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),y.jsxs(y.Fragment,{children:[y.jsx(sPe,{titleId:a.titleId}),y.jsx(lPe,{contentRef:l,descriptionId:a.descriptionId})]})]})}),c2="DialogTitle",e$=P.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ti(c2,n);return y.jsx(Oe.h2,{id:o.titleId,...r,ref:t})});e$.displayName=c2;var t$="DialogDescription",n$=P.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ti(t$,n);return y.jsx(Oe.p,{id:o.descriptionId,...r,ref:t})});n$.displayName=t$;var r$="DialogClose",o$=P.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ti(r$,n);return y.jsx(Oe.button,{type:"button",...r,ref:t,onClick:Ce(e.onClick,()=>o.onOpenChange(!1))})});o$.displayName=r$;function u2(e){return e?"open":"closed"}var i$="DialogTitleWarning",[iPe,s$]=tQ(i$,{contentName:Sc,titleName:c2,docsSlug:"dialog"}),sPe=({titleId:e})=>{const t=s$(i$),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
392
|
+
|
|
393
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
394
|
+
|
|
395
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return P.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},aPe="DialogDescriptionWarning",lPe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${s$(aPe).contentName}}.`;return P.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},d2=G7,a$=Y7,f2=X7,Hy=Q7,Vy=Z7,h2=e$,p2=n$,g2=o$,l$="AlertDialog",[cPe,pOe]=Vn(l$,[U7]),Qs=U7(),c$=e=>{const{__scopeAlertDialog:t,...n}=e,r=Qs(t);return y.jsx(d2,{...r,...n,modal:!0})};c$.displayName=l$;var uPe="AlertDialogTrigger",dPe=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Qs(n);return y.jsx(a$,{...o,...r,ref:t})});dPe.displayName=uPe;var fPe="AlertDialogPortal",u$=e=>{const{__scopeAlertDialog:t,...n}=e,r=Qs(t);return y.jsx(f2,{...r,...n})};u$.displayName=fPe;var hPe="AlertDialogOverlay",d$=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Qs(n);return y.jsx(Hy,{...o,...r,ref:t})});d$.displayName=hPe;var Du="AlertDialogContent",[pPe,gPe]=cPe(Du),f$=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=Qs(n),s=P.useRef(null),a=et(t,s),l=P.useRef(null);return y.jsx(iPe,{contentName:Du,titleName:h$,docsSlug:"alert-dialog",children:y.jsx(pPe,{scope:n,cancelRef:l,children:y.jsxs(Vy,{role:"alertdialog",...i,...o,ref:a,onOpenAutoFocus:Ce(o.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[y.jsx(sC,{children:r}),y.jsx(bPe,{contentRef:s})]})})})});f$.displayName=Du;var h$="AlertDialogTitle",p$=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Qs(n);return y.jsx(h2,{...o,...r,ref:t})});p$.displayName=h$;var g$="AlertDialogDescription",m$=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Qs(n);return y.jsx(p2,{...o,...r,ref:t})});m$.displayName=g$;var mPe="AlertDialogAction",b$=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Qs(n);return y.jsx(g2,{...o,...r,ref:t})});b$.displayName=mPe;var y$="AlertDialogCancel",v$=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=gPe(y$,n),i=Qs(n),s=et(t,o);return y.jsx(g2,{...i,...r,ref:s})});v$.displayName=y$;var bPe=({contentRef:e})=>{const t=`\`${Du}\` requires a description for the component to be accessible for screen reader users.
|
|
396
|
+
|
|
397
|
+
You can add a description to the \`${Du}\` by passing a \`${g$}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
398
|
+
|
|
399
|
+
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Du}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
400
|
+
|
|
401
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return P.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},yPe=c$,vPe=u$,x$=d$,w$=f$,S$=b$,_$=v$,C$=p$,E$=m$;const xPe=yPe,wPe=vPe,R$=P.forwardRef(({className:e,...t},n)=>y.jsx(x$,{className:ge("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));R$.displayName=x$.displayName;const P$=P.forwardRef(({className:e,...t},n)=>y.jsx(wPe,{children:y.jsxs(Ec,{children:[y.jsx(R$,{}),y.jsx(w$,{ref:n,className:ge("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]})}));P$.displayName=w$.displayName;const T$=({className:e,...t})=>y.jsx("div",{className:ge("flex flex-col space-y-2 text-center sm:text-left",e),...t});T$.displayName="AlertDialogHeader";const k$=({className:e,...t})=>y.jsx("div",{className:ge("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});k$.displayName="AlertDialogFooter";const A$=P.forwardRef(({className:e,...t},n)=>y.jsx(C$,{ref:n,className:ge("text-lg font-semibold",e),...t}));A$.displayName=C$.displayName;const O$=P.forwardRef(({className:e,...t},n)=>y.jsx(E$,{ref:n,className:ge("text-sm text-muted-foreground",e),...t}));O$.displayName=E$.displayName;const M$=P.forwardRef(({className:e,...t},n)=>y.jsx(S$,{ref:n,className:ge(Ih(),e),...t}));M$.displayName=S$.displayName;const I$=P.forwardRef(({className:e,...t},n)=>y.jsx(_$,{ref:n,className:ge(Ih({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));I$.displayName=_$.displayName;function SPe({open:e,setOpen:t}){const n=be(i=>i.selectedSheetId),{deleteSheet:r}=An();function o(){n&&(r(n),t(!1))}return y.jsx(xPe,{open:e,onOpenChange:t,children:y.jsxs(P$,{children:[y.jsxs(T$,{children:[y.jsx(A$,{children:"Delete Sheet"}),y.jsx(O$,{children:"Are you sure you want to delete this sheet along with all its cards? This action cannot be undone."})]}),y.jsxs(k$,{children:[y.jsx(I$,{children:"Cancel"}),y.jsx(M$,{onClick:o,children:"Delete"})]})]})})}function D$(){var v,x;const[e,t]=T.useState(!1),n=be(w=>{var _;return(_=w.dashboard)==null?void 0:_.sheets}),{showAssistant:r}=Do(),o=T.useRef(null),[i,s]=T.useState(!1),a=be(w=>w.isDashboardEditing),l=be(w=>w.themeStyle),c=be(w=>w.selectedSheetId),{setSelectedSheetId:u,setSheetTitle:d,addSheet:p}=An();if(!n)return null;function h(w){var _,R;w?((_=o.current)==null||_.resize(35),s(!0)):(s(!1),(R=o.current)==null||R.resize(0))}function m(){const w={id:Na(),title:"New Sheet"};p(w)}function b(){return(l==null?void 0:l.canvasTheme)==="muted"||!(l!=null&&l.canvasTheme)?"hsl(var(--semaphor-muted))":(l==null?void 0:l.canvasTheme)==="clear"?"":l==null?void 0:l.canvasTheme}return y.jsxs(dC,{role:"dashboard-tabs-container",className:ge("relative flex h-full flex-col",l==null?void 0:l.dashboardTabsContainer),onValueChange:w=>{u(w)},value:c||n[0].id,children:[y.jsx("div",{children:(n.length>1||a)&&y.jsxs(k0,{role:"tab-list",className:"flex h-11 items-center justify-start gap-2 rounded-none border-b border-b-muted bg-transparent px-2.5 py-3",children:[n==null?void 0:n.map(w=>{var _,R;return y.jsx(Xi,{text:w.title,onSave:C=>d(w.id,C),children:y.jsxs(A0,{style:{borderRadius:(R=(_=l==null?void 0:l.chart)==null?void 0:_.options)==null?void 0:R.borderRadius},onClick:()=>u(w.id),className:"flex items-center gap-1 rounded-none border px-2 py-1",value:w.id,children:[w.title,a&&c===w.id&&n.length>1&&y.jsx(kc,{className:"ml-1 size-3",onClick:()=>t(!0)})]})},w.id)}),a&&y.jsx("div",{style:{borderRadius:(x=(v=l==null?void 0:l.chart)==null?void 0:v.options)==null?void 0:x.borderRadius},className:"flex h-7 items-center justify-center border-none bg-muted p-2 hover:cursor-pointer dark:border-l-background",onClick:m,children:y.jsx(W0,{className:"size-3"})})]})}),y.jsxs(V7,{className:"grow",direction:"horizontal",children:[y.jsx(N_,{children:y.jsx("div",{style:{},className:"h-full overflow-y-auto",children:n==null?void 0:n.map(w=>y.jsx(fC,{style:{backgroundColor:b()},className:ge("mt-0",{}),value:w.id,children:y.jsx(jxe,{sheet:w})},w.id))})}),r===!0&&y.jsxs(y.Fragment,{children:[y.jsx(J2e,{open:i,onTabClick:h,withHandle:!0}),y.jsx(N_,{onResize:w=>{w<1?s(!1):i||s(!0)},defaultSize:0,ref:o,children:y.jsx(w2e,{handleChatBox:h})})]})]}),y.jsx(SPe,{open:e,setOpen:t})]})}function N$({children:e}){return y.jsx(bX,{defaultTheme:"system",storageKey:"vite-ui-theme",children:y.jsx(Que,{delayDuration:0,children:e})})}function L$(e){return y.jsx(U0,{FallbackComponent:HC,children:y.jsx($N,{dashboardProps:e,children:y.jsx(N$,{children:y.jsx(VN,{...e,children:y.jsx(D$,{})})})})})}var L_=["Enter"," "],_Pe=["ArrowDown","PageUp","Home"],F$=["ArrowUp","PageDown","End"],CPe=[..._Pe,...F$],EPe={ltr:[...L_,"ArrowRight"],rtl:[...L_,"ArrowLeft"]},RPe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Fp="Menu",[qh,PPe,TPe]=P0(Fp),[Ic,j$]=Vn(Fp,[TPe,fs,Sd]),Wy=fs(),$$=Sd(),[kPe,Dc]=Ic(Fp),[APe,jp]=Ic(Fp),z$=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=Wy(t),[l,c]=P.useState(null),u=P.useRef(!1),d=Bn(i),p=Rc(o);return P.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),y.jsx(hp,{...a,children:y.jsx(kPe,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:y.jsx(APe,{scope:t,onClose:P.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:p,modal:s,children:r})})})};z$.displayName=Fp;var OPe="MenuAnchor",m2=P.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Wy(n);return y.jsx(Ad,{...o,...r,ref:t})});m2.displayName=OPe;var b2="MenuPortal",[MPe,B$]=Ic(b2,{forceMount:void 0}),H$=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Dc(b2,t);return y.jsx(MPe,{scope:t,forceMount:n,children:y.jsx(Ln,{present:n||i.open,children:y.jsx(mp,{asChild:!0,container:o,children:r})})})};H$.displayName=b2;var ni="MenuContent",[IPe,y2]=Ic(ni),V$=P.forwardRef((e,t)=>{const n=B$(ni,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Dc(ni,e.__scopeMenu),s=jp(ni,e.__scopeMenu);return y.jsx(qh.Provider,{scope:e.__scopeMenu,children:y.jsx(Ln,{present:r||i.open,children:y.jsx(qh.Slot,{scope:e.__scopeMenu,children:s.modal?y.jsx(DPe,{...o,ref:t}):y.jsx(NPe,{...o,ref:t})})})})}),DPe=P.forwardRef((e,t)=>{const n=Dc(ni,e.__scopeMenu),r=P.useRef(null),o=et(t,r);return P.useEffect(()=>{const i=r.current;if(i)return py(i)},[]),y.jsx(v2,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ce(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),NPe=P.forwardRef((e,t)=>{const n=Dc(ni,e.__scopeMenu);return y.jsx(v2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),v2=P.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:h,disableOutsideScroll:m,...b}=e,v=Dc(ni,n),x=jp(ni,n),w=Wy(n),_=$$(n),R=PPe(n),[C,E]=P.useState(null),A=P.useRef(null),M=et(t,A,v.onContentChange),N=P.useRef(0),L=P.useRef(""),F=P.useRef(0),z=P.useRef(null),Z=P.useRef("right"),G=P.useRef(0),j=m?xp:P.Fragment,H=m?{as:Gs,allowPinchZoom:!0}:void 0,$=X=>{var Y,ee;const I=L.current+X,q=R().filter(re=>!re.disabled),U=document.activeElement,O=(Y=q.find(re=>re.ref.current===U))==null?void 0:Y.textValue,J=q.map(re=>re.textValue),K=qPe(J,I,O),ne=(ee=q.find(re=>re.textValue===K))==null?void 0:ee.ref.current;(function re(ue){L.current=ue,window.clearTimeout(N.current),ue!==""&&(N.current=window.setTimeout(()=>re(""),1e3))})(I),ne&&setTimeout(()=>ne.focus())};P.useEffect(()=>()=>window.clearTimeout(N.current),[]),fy();const V=P.useCallback(X=>{var q,U;return Z.current===((q=z.current)==null?void 0:q.side)&&KPe(X,(U=z.current)==null?void 0:U.area)},[]);return y.jsx(IPe,{scope:n,searchRef:L,onItemEnter:P.useCallback(X=>{V(X)&&X.preventDefault()},[V]),onItemLeave:P.useCallback(X=>{var I;V(X)||((I=A.current)==null||I.focus(),E(null))},[V]),onTriggerLeave:P.useCallback(X=>{V(X)&&X.preventDefault()},[V]),pointerGraceTimerRef:F,onPointerGraceIntentChange:P.useCallback(X=>{z.current=X},[]),children:y.jsx(j,{...H,children:y.jsx(vp,{asChild:!0,trapped:o,onMountAutoFocus:Ce(i,X=>{var I;X.preventDefault(),(I=A.current)==null||I.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:y.jsx(Oc,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:h,children:y.jsx(aC,{asChild:!0,..._,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:E,onEntryFocus:Ce(l,X=>{x.isUsingKeyboardRef.current||X.preventDefault()}),preventScrollOnEntryFocus:!0,children:y.jsx(pp,{role:"menu","aria-orientation":"vertical","data-state":iz(v.open),"data-radix-menu-content":"",dir:x.dir,...w,...b,ref:M,style:{outline:"none",...b.style},onKeyDown:Ce(b.onKeyDown,X=>{const q=X.target.closest("[data-radix-menu-content]")===X.currentTarget,U=X.ctrlKey||X.altKey||X.metaKey,O=X.key.length===1;q&&(X.key==="Tab"&&X.preventDefault(),!U&&O&&$(X.key));const J=A.current;if(X.target!==J||!CPe.includes(X.key))return;X.preventDefault();const ne=R().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);F$.includes(X.key)&&ne.reverse(),UPe(ne)}),onBlur:Ce(e.onBlur,X=>{X.currentTarget.contains(X.target)||(window.clearTimeout(N.current),L.current="")}),onPointerMove:Ce(e.onPointerMove,Yh(X=>{const I=X.target,q=G.current!==X.clientX;if(X.currentTarget.contains(I)&&q){const U=X.clientX>G.current?"right":"left";Z.current=U,G.current=X.clientX}}))})})})})})})});V$.displayName=ni;var LPe="MenuGroup",x2=P.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return y.jsx(Oe.div,{role:"group",...r,ref:t})});x2.displayName=LPe;var FPe="MenuLabel",W$=P.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return y.jsx(Oe.div,{...r,ref:t})});W$.displayName=FPe;var f0="MenuItem",jD="menu.itemSelect",Uy=P.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=P.useRef(null),s=jp(f0,e.__scopeMenu),a=y2(f0,e.__scopeMenu),l=et(t,i),c=P.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const p=new CustomEvent(jD,{bubbles:!0,cancelable:!0});d.addEventListener(jD,h=>r==null?void 0:r(h),{once:!0}),WN(d,p),p.defaultPrevented?c.current=!1:s.onClose()}};return y.jsx(U$,{...o,ref:l,disabled:n,onClick:Ce(e.onClick,u),onPointerDown:d=>{var p;(p=e.onPointerDown)==null||p.call(e,d),c.current=!0},onPointerUp:Ce(e.onPointerUp,d=>{var p;c.current||(p=d.currentTarget)==null||p.click()}),onKeyDown:Ce(e.onKeyDown,d=>{const p=a.searchRef.current!=="";n||p&&d.key===" "||L_.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Uy.displayName=f0;var U$=P.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=y2(f0,n),a=$$(n),l=P.useRef(null),c=et(t,l),[u,d]=P.useState(!1),[p,h]=P.useState("");return P.useEffect(()=>{const m=l.current;m&&h((m.textContent??"").trim())},[i.children]),y.jsx(qh.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:y.jsx(lC,{asChild:!0,...a,focusable:!r,children:y.jsx(Oe.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:Ce(e.onPointerMove,Yh(m=>{r?s.onItemLeave(m):(s.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ce(e.onPointerLeave,Yh(m=>s.onItemLeave(m))),onFocus:Ce(e.onFocus,()=>d(!0)),onBlur:Ce(e.onBlur,()=>d(!1))})})})}),jPe="MenuCheckboxItem",G$=P.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return y.jsx(Q$,{scope:e.__scopeMenu,checked:n,children:y.jsx(Uy,{role:"menuitemcheckbox","aria-checked":h0(n)?"mixed":n,...o,ref:t,"data-state":S2(n),onSelect:Ce(o.onSelect,()=>r==null?void 0:r(h0(n)?!0:!n),{checkForDefaultPrevented:!1})})})});G$.displayName=jPe;var q$="MenuRadioGroup",[$Pe,zPe]=Ic(q$,{value:void 0,onValueChange:()=>{}}),Y$=P.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Bn(r);return y.jsx($Pe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:y.jsx(x2,{...o,ref:t})})});Y$.displayName=q$;var K$="MenuRadioItem",X$=P.forwardRef((e,t)=>{const{value:n,...r}=e,o=zPe(K$,e.__scopeMenu),i=n===o.value;return y.jsx(Q$,{scope:e.__scopeMenu,checked:i,children:y.jsx(Uy,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":S2(i),onSelect:Ce(r.onSelect,()=>{var s;return(s=o.onValueChange)==null?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})})});X$.displayName=K$;var w2="MenuItemIndicator",[Q$,BPe]=Ic(w2,{checked:!1}),Z$=P.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=BPe(w2,n);return y.jsx(Ln,{present:r||h0(i.checked)||i.checked===!0,children:y.jsx(Oe.span,{...o,ref:t,"data-state":S2(i.checked)})})});Z$.displayName=w2;var HPe="MenuSeparator",J$=P.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return y.jsx(Oe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});J$.displayName=HPe;var VPe="MenuArrow",ez=P.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Wy(n);return y.jsx(gp,{...o,...r,ref:t})});ez.displayName=VPe;var WPe="MenuSub",[gOe,tz]=Ic(WPe),Uf="MenuSubTrigger",nz=P.forwardRef((e,t)=>{const n=Dc(Uf,e.__scopeMenu),r=jp(Uf,e.__scopeMenu),o=tz(Uf,e.__scopeMenu),i=y2(Uf,e.__scopeMenu),s=P.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=P.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return P.useEffect(()=>u,[u]),P.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),y.jsx(m2,{asChild:!0,...c,children:y.jsx(U$,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":iz(n.open),...e,ref:R0(t,o.onTriggerChange),onClick:d=>{var p;(p=e.onClick)==null||p.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ce(e.onPointerMove,Yh(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Ce(e.onPointerLeave,Yh(d=>{var h,m;u();const p=(h=n.content)==null?void 0:h.getBoundingClientRect();if(p){const b=(m=n.content)==null?void 0:m.dataset.side,v=b==="right",x=v?-5:5,w=p[v?"left":"right"],_=p[v?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+x,y:d.clientY},{x:w,y:p.top},{x:_,y:p.top},{x:_,y:p.bottom},{x:w,y:p.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Ce(e.onKeyDown,d=>{var h;const p=i.searchRef.current!=="";e.disabled||p&&d.key===" "||EPe[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});nz.displayName=Uf;var rz="MenuSubContent",oz=P.forwardRef((e,t)=>{const n=B$(ni,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Dc(ni,e.__scopeMenu),s=jp(ni,e.__scopeMenu),a=tz(rz,e.__scopeMenu),l=P.useRef(null),c=et(t,l);return y.jsx(qh.Provider,{scope:e.__scopeMenu,children:y.jsx(Ln,{present:r||i.open,children:y.jsx(qh.Slot,{scope:e.__scopeMenu,children:y.jsx(v2,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;s.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Ce(e.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Ce(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:Ce(e.onKeyDown,u=>{var h;const d=u.currentTarget.contains(u.target),p=RPe[s.dir].includes(u.key);d&&p&&(i.onOpenChange(!1),(h=a.trigger)==null||h.focus(),u.preventDefault())})})})})})});oz.displayName=rz;function iz(e){return e?"open":"closed"}function h0(e){return e==="indeterminate"}function S2(e){return h0(e)?"indeterminate":e?"checked":"unchecked"}function UPe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function GPe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function qPe(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=GPe(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function YPe(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function KPe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return YPe(n,t)}function Yh(e){return t=>t.pointerType==="mouse"?e(t):void 0}var XPe=z$,QPe=m2,ZPe=H$,JPe=V$,eTe=x2,tTe=W$,nTe=Uy,rTe=G$,oTe=Y$,iTe=X$,sTe=Z$,aTe=J$,lTe=ez,cTe=nz,uTe=oz,_2="DropdownMenu",[dTe,mOe]=Vn(_2,[j$]),zr=j$(),[fTe,sz]=dTe(_2),az=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=zr(t),c=P.useRef(null),[u=!1,d]=wr({prop:o,defaultProp:i,onChange:s});return y.jsx(fTe,{scope:t,triggerId:Nn(),triggerRef:c,contentId:Nn(),open:u,onOpenChange:d,onOpenToggle:P.useCallback(()=>d(p=>!p),[d]),modal:a,children:y.jsx(XPe,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};az.displayName=_2;var lz="DropdownMenuTrigger",cz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=sz(lz,n),s=zr(n);return y.jsx(QPe,{asChild:!0,...s,children:y.jsx(Oe.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:R0(t,i.triggerRef),onPointerDown:Ce(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:Ce(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});cz.displayName=lz;var hTe="DropdownMenuPortal",uz=e=>{const{__scopeDropdownMenu:t,...n}=e,r=zr(t);return y.jsx(ZPe,{...r,...n})};uz.displayName=hTe;var dz="DropdownMenuContent",fz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=sz(dz,n),i=zr(n),s=P.useRef(!1);return y.jsx(JPe,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:Ce(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)==null||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Ce(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});fz.displayName=dz;var pTe="DropdownMenuGroup",gTe=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return y.jsx(eTe,{...o,...r,ref:t})});gTe.displayName=pTe;var mTe="DropdownMenuLabel",hz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return y.jsx(tTe,{...o,...r,ref:t})});hz.displayName=mTe;var bTe="DropdownMenuItem",pz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return y.jsx(nTe,{...o,...r,ref:t})});pz.displayName=bTe;var yTe="DropdownMenuCheckboxItem",gz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return y.jsx(rTe,{...o,...r,ref:t})});gz.displayName=yTe;var vTe="DropdownMenuRadioGroup",mz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return y.jsx(oTe,{...o,...r,ref:t})});mz.displayName=vTe;var xTe="DropdownMenuRadioItem",bz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return y.jsx(iTe,{...o,...r,ref:t})});bz.displayName=xTe;var wTe="DropdownMenuItemIndicator",yz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return y.jsx(sTe,{...o,...r,ref:t})});yz.displayName=wTe;var STe="DropdownMenuSeparator",vz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return y.jsx(aTe,{...o,...r,ref:t})});vz.displayName=STe;var _Te="DropdownMenuArrow",CTe=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return y.jsx(lTe,{...o,...r,ref:t})});CTe.displayName=_Te;var ETe="DropdownMenuSubTrigger",xz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return y.jsx(cTe,{...o,...r,ref:t})});xz.displayName=ETe;var RTe="DropdownMenuSubContent",wz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return y.jsx(uTe,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});wz.displayName=RTe;var PTe=az,TTe=cz,kTe=uz,Sz=fz,_z=hz,Cz=pz,Ez=gz,ATe=mz,Rz=bz,Pz=yz,Tz=vz,kz=xz,Az=wz;const OTe=PTe,MTe=TTe,ITe=ATe,DTe=P.forwardRef(({className:e,inset:t,children:n,...r},o)=>y.jsxs(kz,{ref:o,className:ge("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,y.jsx(V0,{className:"ml-auto h-4 w-4"})]}));DTe.displayName=kz.displayName;const NTe=P.forwardRef(({className:e,...t},n)=>y.jsx(Ec,{children:y.jsx(Az,{ref:n,className:ge("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));NTe.displayName=Az.displayName;const Oz=P.forwardRef(({className:e,sideOffset:t=4,...n},r)=>y.jsx(kTe,{children:y.jsx(Ec,{children:y.jsx(Sz,{ref:r,sideOffset:t,className:ge("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})})}));Oz.displayName=Sz.displayName;const Mz=P.forwardRef(({className:e,inset:t,...n},r)=>y.jsx(Cz,{ref:r,className:ge("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Mz.displayName=Cz.displayName;const Iz=P.forwardRef(({className:e,children:t,checked:n,...r},o)=>y.jsxs(Ez,{ref:o,className:ge("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[y.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:y.jsx(Pz,{children:y.jsx(_d,{className:"h-4 w-4"})})}),t]}));Iz.displayName=Ez.displayName;const Dz=P.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(Rz,{ref:r,className:ge("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[y.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:y.jsx(Pz,{children:y.jsx($C,{className:"h-2 w-2 fill-current"})})}),t]}));Dz.displayName=Rz.displayName;const Nz=P.forwardRef(({className:e,inset:t,...n},r)=>y.jsx(_z,{ref:r,className:ge("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Nz.displayName=_z.displayName;const Lz=P.forwardRef(({className:e,...t},n)=>y.jsx(Tz,{ref:n,className:ge("-mx-1 my-1 h-px bg-muted",e),...t}));Lz.displayName=Tz.displayName;const LTe=d2,FTe=a$,jTe=f2,Fz=P.forwardRef(({className:e,...t},n)=>y.jsx(Hy,{ref:n,className:ge("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Fz.displayName=Hy.displayName;const jz=P.forwardRef(({className:e,children:t,...n},r)=>y.jsx(jTe,{children:y.jsxs(Ec,{children:[y.jsx(Fz,{}),y.jsxs(Vy,{ref:r,className:ge("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,y.jsxs(g2,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[y.jsx(kc,{className:"h-4 w-4"}),y.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}));jz.displayName=Vy.displayName;const $z=({className:e,...t})=>y.jsx("div",{className:ge("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});$z.displayName="DialogHeader";const zz=({className:e,...t})=>y.jsx("div",{className:ge("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});zz.displayName="DialogFooter";const Bz=P.forwardRef(({className:e,...t},n)=>y.jsx(h2,{ref:n,className:ge("text-lg font-semibold leading-none tracking-tight",e),...t}));Bz.displayName=h2.displayName;const Hz=P.forwardRef(({className:e,...t},n)=>y.jsx(p2,{ref:n,className:ge("text-sm text-muted-foreground",e),...t}));Hz.displayName=p2.displayName;const Vz=T.forwardRef(({className:e,...t},n)=>y.jsx("div",{role:"editor-panel",ref:n,className:ge("flex h-full grow",e),...t}));Vz.displayName="EditorPanel";const Wz=T.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:ge("flex w-[300px] flex-col space-y-2",e),...t}));Wz.displayName="EditorAside";const Uz=T.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:ge("grow",e),...t}));Uz.displayName="EditorMain";function $Te(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function zD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$D(Object(n),!0).forEach(function(r){$Te(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$D(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zTe(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function BTe(e,t){if(e==null)return{};var n=zTe(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function HTe(e,t){return VTe(e)||WTe(e,t)||UTe(e,t)||GTe()}function VTe(e){if(Array.isArray(e))return e}function WTe(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,o=!1,i=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){o=!0,i=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(o)throw i}}return n}}function UTe(e,t){if(e){if(typeof e=="string")return BD(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return BD(e,t)}}function BD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function GTe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
402
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qTe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function VD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HD(Object(n),!0).forEach(function(r){qTe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YTe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(o,i){return i(o)},r)}}function Gf(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(o,a))}}}function p0(e){return{}.toString.call(e).includes("Object")}function KTe(e){return!Object.keys(e).length}function Kh(e){return typeof e=="function"}function XTe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function QTe(e,t){return p0(t)||Da("changeType"),Object.keys(t).some(function(n){return!XTe(e,n)})&&Da("changeField"),t}function ZTe(e){Kh(e)||Da("selectorType")}function JTe(e){Kh(e)||p0(e)||Da("handlerType"),p0(e)&&Object.values(e).some(function(t){return!Kh(t)})&&Da("handlersType")}function eke(e){e||Da("initialIsRequired"),p0(e)||Da("initialType"),KTe(e)&&Da("initialContent")}function tke(e,t){throw new Error(e[t]||e.default)}var nke={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Da=Gf(tke)(nke),$m={changes:QTe,selector:ZTe,handler:JTe,initial:eke};function rke(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};$m.initial(e),$m.handler(t);var n={current:e},r=Gf(ske)(n,t),o=Gf(ike)(n),i=Gf($m.changes)(e),s=Gf(oke)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return $m.selector(c),c(n.current)}function l(c){YTe(r,o,i,s)(c)}return[a,l]}function oke(e,t){return Kh(t)?t(e.current):t}function ike(e,t){return e.current=VD(VD({},e.current),t),t}function ske(e,t,n){return Kh(t)?t(e.current):Object.keys(n).forEach(function(r){var o;return(o=t[r])===null||o===void 0?void 0:o.call(t,e.current[r])}),n}var ake={create:rke},lke={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}};function cke(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(o,a))}}}function uke(e){return{}.toString.call(e).includes("Object")}function dke(e){return e||WD("configIsRequired"),uke(e)||WD("configType"),e.urls?(fke(),{paths:{vs:e.urls.monacoBase}}):e}function fke(){console.warn(Gz.deprecation)}function hke(e,t){throw new Error(e[t]||e.default)}var Gz={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
403
|
+
You are using deprecated way of configuration.
|
|
404
|
+
|
|
405
|
+
Instead of using
|
|
406
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
407
|
+
use
|
|
408
|
+
monaco.config({ paths: { vs: '...' } })
|
|
409
|
+
|
|
410
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
411
|
+
`},WD=cke(hke)(Gz),pke={config:dke},gke=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){return n.reduceRight(function(i,s){return s(i)},o)}};function qz(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],qz(e[n],t[n]))}),zD(zD({},e),t)}var mke={type:"cancelation",msg:"operation is manually canceled"};function n1(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(mke):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var bke=ake.create({config:lke,isInitialized:!1,resolve:null,reject:null,monaco:null}),Yz=HTe(bke,2),$p=Yz[0],Gy=Yz[1];function yke(e){var t=pke.config(e),n=t.monaco,r=BTe(t,["monaco"]);Gy(function(o){return{config:qz(o.config,r),monaco:n}})}function vke(){var e=$p(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(Gy({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),n1(r1);if(window.monaco&&window.monaco.editor)return Kz(window.monaco),e.resolve(window.monaco),n1(r1);gke(xke,Ske)(_ke)}return n1(r1)}function xke(e){return document.body.appendChild(e)}function wke(e){var t=document.createElement("script");return e&&(t.src=e),t}function Ske(e){var t=$p(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=wke("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function _ke(){var e=$p(function(n){var r=n.config,o=n.resolve,i=n.reject;return{config:r,resolve:o,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){Kz(n),e.resolve(n)},function(n){e.reject(n)})}function Kz(e){$p().monaco||Gy({monaco:e})}function Cke(){return $p(function(e){var t=e.monaco;return t})}var r1=new Promise(function(e,t){return Gy({resolve:e,reject:t})}),g0={config:yke,init:vke,__getMonacoInstance:Cke},Eke={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},o1=Eke,Rke={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Pke=Rke;function Tke({children:e}){return T.createElement("div",{style:Pke.container},e)}var kke=Tke,Ake=kke;function Oke({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:s}){return T.createElement("section",{style:{...o1.wrapper,width:e,height:t},...s},!n&&T.createElement(Ake,null,r),T.createElement("div",{ref:o,style:{...o1.fullWidth,...!n&&o1.hide},className:i}))}var Mke=Oke,Xz=T.memo(Mke);function Ike(e){T.useEffect(e,[])}var C2=Ike;function Dke(e,t,n=!0){let r=T.useRef(!0);T.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Ro=Dke;function ph(){}function vu(e,t,n,r){return Nke(e,r)||Lke(e,t,n,r)}function Nke(e,t){return e.editor.getModel(Qz(e,t))}function Lke(e,t,n,r){return e.editor.createModel(t,n,r?Qz(e,r):void 0)}function Qz(e,t){return e.Uri.parse(t)}function Fke({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:d={},height:p="100%",width:h="100%",className:m,wrapperProps:b={},beforeMount:v=ph,onMount:x=ph}){let[w,_]=T.useState(!1),[R,C]=T.useState(!0),E=T.useRef(null),A=T.useRef(null),M=T.useRef(null),N=T.useRef(x),L=T.useRef(v),F=T.useRef(!1);C2(()=>{let j=g0.init();return j.then(H=>(A.current=H)&&C(!1)).catch(H=>(H==null?void 0:H.type)!=="cancelation"&&console.error("Monaco initialization: error:",H)),()=>E.current?G():j.cancel()}),Ro(()=>{if(E.current&&A.current){let j=E.current.getOriginalEditor(),H=vu(A.current,e||"",r||n||"text",i||"");H!==j.getModel()&&j.setModel(H)}},[i],w),Ro(()=>{if(E.current&&A.current){let j=E.current.getModifiedEditor(),H=vu(A.current,t||"",o||n||"text",s||"");H!==j.getModel()&&j.setModel(H)}},[s],w),Ro(()=>{let j=E.current.getModifiedEditor();j.getOption(A.current.editor.EditorOption.readOnly)?j.setValue(t||""):t!==j.getValue()&&(j.executeEdits("",[{range:j.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),j.pushUndoStop())},[t],w),Ro(()=>{var j,H;(H=(j=E.current)==null?void 0:j.getModel())==null||H.original.setValue(e||"")},[e],w),Ro(()=>{let{original:j,modified:H}=E.current.getModel();A.current.editor.setModelLanguage(j,r||n||"text"),A.current.editor.setModelLanguage(H,o||n||"text")},[n,r,o],w),Ro(()=>{var j;(j=A.current)==null||j.editor.setTheme(c)},[c],w),Ro(()=>{var j;(j=E.current)==null||j.updateOptions(d)},[d],w);let z=T.useCallback(()=>{var $;if(!A.current)return;L.current(A.current);let j=vu(A.current,e||"",r||n||"text",i||""),H=vu(A.current,t||"",o||n||"text",s||"");($=E.current)==null||$.setModel({original:j,modified:H})},[n,t,o,e,r,i,s]),Z=T.useCallback(()=>{var j;!F.current&&M.current&&(E.current=A.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...d}),z(),(j=A.current)==null||j.editor.setTheme(c),_(!0),F.current=!0)},[d,c,z]);T.useEffect(()=>{w&&N.current(E.current,A.current)},[w]),T.useEffect(()=>{!R&&!w&&Z()},[R,w,Z]);function G(){var H,$,V,X;let j=(H=E.current)==null?void 0:H.getModel();a||(($=j==null?void 0:j.original)==null||$.dispose()),l||((V=j==null?void 0:j.modified)==null||V.dispose()),(X=E.current)==null||X.dispose()}return T.createElement(Xz,{width:h,height:p,isEditorReady:w,loading:u,_ref:M,className:m,wrapperProps:b})}var jke=Fke;T.memo(jke);function $ke(){let[e,t]=T.useState(g0.__getMonacoInstance());return C2(()=>{let n;return e||(n=g0.init(),n.then(r=>{t(r)})),()=>n==null?void 0:n.cancel()}),e}var zke=$ke;function Bke(e){let t=T.useRef();return T.useEffect(()=>{t.current=e},[e]),t.current}var Hke=Bke,zm=new Map;function Vke({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:i,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:p=!1,width:h="100%",height:m="100%",className:b,wrapperProps:v={},beforeMount:x=ph,onMount:w=ph,onChange:_,onValidate:R=ph}){let[C,E]=T.useState(!1),[A,M]=T.useState(!0),N=T.useRef(null),L=T.useRef(null),F=T.useRef(null),z=T.useRef(w),Z=T.useRef(x),G=T.useRef(),j=T.useRef(r),H=Hke(i),$=T.useRef(!1),V=T.useRef(!1);C2(()=>{let q=g0.init();return q.then(U=>(N.current=U)&&M(!1)).catch(U=>(U==null?void 0:U.type)!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>L.current?I():q.cancel()}),Ro(()=>{var U,O,J,K;let q=vu(N.current,e||r||"",t||o||"",i||n||"");q!==((U=L.current)==null?void 0:U.getModel())&&(d&&zm.set(H,(O=L.current)==null?void 0:O.saveViewState()),(J=L.current)==null||J.setModel(q),d&&((K=L.current)==null||K.restoreViewState(zm.get(i))))},[i],C),Ro(()=>{var q;(q=L.current)==null||q.updateOptions(c)},[c],C),Ro(()=>{!L.current||r===void 0||(L.current.getOption(N.current.editor.EditorOption.readOnly)?L.current.setValue(r):r!==L.current.getValue()&&(V.current=!0,L.current.executeEdits("",[{range:L.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),L.current.pushUndoStop(),V.current=!1))},[r],C),Ro(()=>{var U,O;let q=(U=L.current)==null?void 0:U.getModel();q&&o&&((O=N.current)==null||O.editor.setModelLanguage(q,o))},[o],C),Ro(()=>{var q;a!==void 0&&((q=L.current)==null||q.revealLine(a))},[a],C),Ro(()=>{var q;(q=N.current)==null||q.editor.setTheme(s)},[s],C);let X=T.useCallback(()=>{var q;if(!(!F.current||!N.current)&&!$.current){Z.current(N.current);let U=i||n,O=vu(N.current,r||e||"",t||o||"",U||"");L.current=(q=N.current)==null?void 0:q.editor.create(F.current,{model:O,automaticLayout:!0,...c},u),d&&L.current.restoreViewState(zm.get(U)),N.current.editor.setTheme(s),a!==void 0&&L.current.revealLine(a),E(!0),$.current=!0}},[e,t,n,r,o,i,c,u,d,s,a]);T.useEffect(()=>{C&&z.current(L.current,N.current)},[C]),T.useEffect(()=>{!A&&!C&&X()},[A,C,X]),j.current=r,T.useEffect(()=>{var q,U;C&&_&&((q=G.current)==null||q.dispose(),G.current=(U=L.current)==null?void 0:U.onDidChangeModelContent(O=>{V.current||_(L.current.getValue(),O)}))},[C,_]),T.useEffect(()=>{if(C){let q=N.current.editor.onDidChangeMarkers(U=>{var J;let O=(J=L.current.getModel())==null?void 0:J.uri;if(O&&U.find(K=>K.path===O.path)){let K=N.current.editor.getModelMarkers({resource:O});R==null||R(K)}});return()=>{q==null||q.dispose()}}return()=>{}},[C,R]);function I(){var q,U;(q=G.current)==null||q.dispose(),p?d&&zm.set(i,L.current.saveViewState()):(U=L.current.getModel())==null||U.dispose(),L.current.dispose()}return T.createElement(Xz,{width:h,height:m,isEditorReady:C,loading:l,_ref:F,className:b,wrapperProps:v})}var Wke=Vke,Zz=T.memo(Wke),Uke=Zz,E2="Switch",[Gke,bOe]=Vn(E2),[qke,Yke]=Gke(E2),Jz=P.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,form:u,...d}=e,[p,h]=P.useState(null),m=et(t,_=>h(_)),b=P.useRef(!1),v=p?u||!!p.closest("form"):!0,[x=!1,w]=wr({prop:o,defaultProp:i,onChange:c});return y.jsxs(qke,{scope:n,checked:x,disabled:a,children:[y.jsx(Oe.button,{type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":nB(x),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:m,onClick:Ce(e.onClick,_=>{w(R=>!R),v&&(b.current=_.isPropagationStopped(),b.current||_.stopPropagation())})}),v&&y.jsx(Kke,{control:p,bubbles:!b.current,name:r,value:l,checked:x,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});Jz.displayName=E2;var eB="SwitchThumb",tB=P.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=Yke(eB,n);return y.jsx(Oe.span,{"data-state":nB(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});tB.displayName=eB;var Kke=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=P.useRef(null),s=hy(n),a=oy(t);return P.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const p=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(p)}},[s,n,r]),y.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function nB(e){return e?"checked":"unchecked"}var qy=Jz,rB=tB;const oB=P.forwardRef(({className:e,...t},n)=>y.jsx(qy,{className:ge("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:y.jsx(rB,{className:ge("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));oB.displayName=qy.displayName;const Xke=P.forwardRef(({className:e,...t},n)=>y.jsx(qy,{className:ge("peer inline-flex h-4 w-8 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:y.jsx(rB,{className:ge("pointer-events-none block h-3 w-3 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Xke.displayName=qy.displayName;var Zs="Accordion",Qke=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[R2,Zke,Jke]=P0(Zs),[Yy,yOe]=Vn(Zs,[Jke,R9]),P2=R9(),iB=T.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return y.jsx(R2.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?y.jsx(rAe,{...i,ref:t}):y.jsx(nAe,{...o,ref:t})})});iB.displayName=Zs;var[sB,eAe]=Yy(Zs),[aB,tAe]=Yy(Zs,{collapsible:!1}),nAe=T.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=wr({prop:n,defaultProp:r,onChange:o});return y.jsx(sB,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:T.useCallback(()=>i&&l(""),[i,l]),children:y.jsx(aB,{scope:e.__scopeAccordion,collapsible:i,children:y.jsx(lB,{...s,ref:t})})})}),rAe=T.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=wr({prop:n,defaultProp:r,onChange:o}),l=T.useCallback(u=>a((d=[])=>[...d,u]),[a]),c=T.useCallback(u=>a((d=[])=>d.filter(p=>p!==u)),[a]);return y.jsx(sB,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c,children:y.jsx(aB,{scope:e.__scopeAccordion,collapsible:!0,children:y.jsx(lB,{...i,ref:t})})})}),[oAe,Ky]=Yy(Zs),lB=T.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=e,a=T.useRef(null),l=et(a,t),c=Zke(n),d=Rc(o)==="ltr",p=Ce(e.onKeyDown,h=>{var M;if(!Qke.includes(h.key))return;const m=h.target,b=c().filter(N=>{var L;return!((L=N.ref.current)!=null&&L.disabled)}),v=b.findIndex(N=>N.ref.current===m),x=b.length;if(v===-1)return;h.preventDefault();let w=v;const _=0,R=x-1,C=()=>{w=v+1,w>R&&(w=_)},E=()=>{w=v-1,w<_&&(w=R)};switch(h.key){case"Home":w=_;break;case"End":w=R;break;case"ArrowRight":i==="horizontal"&&(d?C():E());break;case"ArrowDown":i==="vertical"&&C();break;case"ArrowLeft":i==="horizontal"&&(d?E():C());break;case"ArrowUp":i==="vertical"&&E();break}const A=w%x;(M=b[A].ref.current)==null||M.focus()});return y.jsx(oAe,{scope:n,disabled:r,direction:o,orientation:i,children:y.jsx(R2.Slot,{scope:n,children:y.jsx(Oe.div,{...s,"data-orientation":i,ref:l,onKeyDown:r?void 0:p})})})}),m0="AccordionItem",[iAe,T2]=Yy(m0),cB=T.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=Ky(m0,n),s=eAe(m0,n),a=P2(n),l=Nn(),c=r&&s.value.includes(r)||!1,u=i.disabled||e.disabled;return y.jsx(iAe,{scope:n,open:c,disabled:u,triggerId:l,children:y.jsx(k9,{"data-orientation":i.orientation,"data-state":gB(c),...a,...o,ref:t,disabled:u,open:c,onOpenChange:d=>{d?s.onItemOpen(r):s.onItemClose(r)}})})});cB.displayName=m0;var uB="AccordionHeader",dB=T.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Ky(Zs,n),i=T2(uB,n);return y.jsx(Oe.h3,{"data-orientation":o.orientation,"data-state":gB(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});dB.displayName=uB;var F_="AccordionTrigger",fB=T.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Ky(Zs,n),i=T2(F_,n),s=tAe(F_,n),a=P2(n);return y.jsx(R2.ItemSlot,{scope:n,children:y.jsx(b1e,{"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId,...a,...r,ref:t})})});fB.displayName=F_;var hB="AccordionContent",pB=T.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Ky(Zs,n),i=T2(hB,n),s=P2(n);return y.jsx(y1e,{role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation,...s,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});pB.displayName=hB;function gB(e){return e?"open":"closed"}var sAe=iB,aAe=cB,lAe=dB,mB=fB,bB=pB;const cAe=sAe,yB=P.forwardRef(({className:e,...t},n)=>y.jsx(aAe,{ref:n,className:ge("border-b",e),...t}));yB.displayName="AccordionItem";const vB=P.forwardRef(({className:e,children:t,...n},r)=>y.jsx(lAe,{className:"flex",children:y.jsxs(mB,{ref:r,className:ge("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,y.jsx(lp,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));vB.displayName=mB.displayName;const xB=P.forwardRef(({className:e,children:t,...n},r)=>y.jsx(bB,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:y.jsx("div",{className:ge("pb-4 pt-0",e),children:t})}));xB.displayName=bB.displayName;var UD=1,uAe=.9,dAe=.8,fAe=.17,i1=.1,s1=.999,hAe=.9999,pAe=.99,gAe=/[\\\/_+.#"@\[\(\{&]/,mAe=/[\\\/_+.#"@\[\(\{&]/g,bAe=/[\s-]/,wB=/[\s-]/g;function j_(e,t,n,r,o,i,s){if(i===t.length)return o===e.length?UD:pAe;var a=`${o},${i}`;if(s[a]!==void 0)return s[a];for(var l=r.charAt(i),c=n.indexOf(l,o),u=0,d,p,h,m;c>=0;)d=j_(e,t,n,r,c+1,i+1,s),d>u&&(c===o?d*=UD:gAe.test(e.charAt(c-1))?(d*=dAe,h=e.slice(o,c-1).match(mAe),h&&o>0&&(d*=Math.pow(s1,h.length))):bAe.test(e.charAt(c-1))?(d*=uAe,m=e.slice(o,c-1).match(wB),m&&o>0&&(d*=Math.pow(s1,m.length))):(d*=fAe,o>0&&(d*=Math.pow(s1,c-o))),e.charAt(c)!==t.charAt(i)&&(d*=hAe)),(d<i1&&n.charAt(c-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(c-1)!==r.charAt(i))&&(p=j_(e,t,n,r,c+1,i+2,s),p*i1>d&&(d=p*i1)),d>u&&(u=d),c=n.indexOf(l,c+1);return s[a]=u,u}function GD(e){return e.toLowerCase().replace(wB," ")}function yAe(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,j_(e,t,GD(e),GD(t),0,0,{})}var Pf='[cmdk-group=""]',a1='[cmdk-group-items=""]',vAe='[cmdk-group-heading=""]',k2='[cmdk-item=""]',qD=`${k2}:not([aria-disabled="true"])`,$_="cmdk-item-select",Al="data-value",xAe=(e,t,n)=>yAe(e,t,n),SB=P.createContext(void 0),zp=()=>P.useContext(SB),_B=P.createContext(void 0),A2=()=>P.useContext(_B),CB=P.createContext(void 0),EB=P.forwardRef((e,t)=>{let n=fu(()=>{var U,O;return{search:"",value:(O=(U=e.value)!=null?U:e.defaultValue)!=null?O:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=fu(()=>new Set),o=fu(()=>new Map),i=fu(()=>new Map),s=fu(()=>new Set),a=RB(e),{label:l,children:c,value:u,onValueChange:d,filter:p,shouldFilter:h,loop:m,disablePointerSelection:b=!1,vimBindings:v=!0,...x}=e,w=Nn(),_=Nn(),R=Nn(),C=P.useRef(null),E=OAe();_c(()=>{if(u!==void 0){let U=u.trim();n.current.value=U,A.emit()}},[u]),_c(()=>{E(6,Z)},[]);let A=P.useMemo(()=>({subscribe:U=>(s.current.add(U),()=>s.current.delete(U)),snapshot:()=>n.current,setState:(U,O,J)=>{var K,ne,Y;if(!Object.is(n.current[U],O)){if(n.current[U]=O,U==="search")z(),L(),E(1,F);else if(U==="value"&&(J||E(5,Z),((K=a.current)==null?void 0:K.value)!==void 0)){let ee=O??"";(Y=(ne=a.current).onValueChange)==null||Y.call(ne,ee);return}A.emit()}},emit:()=>{s.current.forEach(U=>U())}}),[]),M=P.useMemo(()=>({value:(U,O,J)=>{var K;O!==((K=i.current.get(U))==null?void 0:K.value)&&(i.current.set(U,{value:O,keywords:J}),n.current.filtered.items.set(U,N(O,J)),E(2,()=>{L(),A.emit()}))},item:(U,O)=>(r.current.add(U),O&&(o.current.has(O)?o.current.get(O).add(U):o.current.set(O,new Set([U]))),E(3,()=>{z(),L(),n.current.value||F(),A.emit()}),()=>{i.current.delete(U),r.current.delete(U),n.current.filtered.items.delete(U);let J=G();E(4,()=>{z(),(J==null?void 0:J.getAttribute("id"))===U&&F(),A.emit()})}),group:U=>(o.current.has(U)||o.current.set(U,new Set),()=>{i.current.delete(U),o.current.delete(U)}),filter:()=>a.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:w,inputId:R,labelId:_,listInnerRef:C}),[]);function N(U,O){var J,K;let ne=(K=(J=a.current)==null?void 0:J.filter)!=null?K:xAe;return U?ne(U,n.current.search,O):0}function L(){if(!n.current.search||a.current.shouldFilter===!1)return;let U=n.current.filtered.items,O=[];n.current.filtered.groups.forEach(K=>{let ne=o.current.get(K),Y=0;ne.forEach(ee=>{let re=U.get(ee);Y=Math.max(re,Y)}),O.push([K,Y])});let J=C.current;j().sort((K,ne)=>{var Y,ee;let re=K.getAttribute("id"),ue=ne.getAttribute("id");return((Y=U.get(ue))!=null?Y:0)-((ee=U.get(re))!=null?ee:0)}).forEach(K=>{let ne=K.closest(a1);ne?ne.appendChild(K.parentElement===ne?K:K.closest(`${a1} > *`)):J.appendChild(K.parentElement===J?K:K.closest(`${a1} > *`))}),O.sort((K,ne)=>ne[1]-K[1]).forEach(K=>{var ne;let Y=(ne=C.current)==null?void 0:ne.querySelector(`${Pf}[${Al}="${encodeURIComponent(K[0])}"]`);Y==null||Y.parentElement.appendChild(Y)})}function F(){let U=j().find(J=>J.getAttribute("aria-disabled")!=="true"),O=U==null?void 0:U.getAttribute(Al);A.setState("value",O||void 0)}function z(){var U,O,J,K;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ne=0;for(let Y of r.current){let ee=(O=(U=i.current.get(Y))==null?void 0:U.value)!=null?O:"",re=(K=(J=i.current.get(Y))==null?void 0:J.keywords)!=null?K:[],ue=N(ee,re);n.current.filtered.items.set(Y,ue),ue>0&&ne++}for(let[Y,ee]of o.current)for(let re of ee)if(n.current.filtered.items.get(re)>0){n.current.filtered.groups.add(Y);break}n.current.filtered.count=ne}function Z(){var U,O,J;let K=G();K&&(((U=K.parentElement)==null?void 0:U.firstChild)===K&&((J=(O=K.closest(Pf))==null?void 0:O.querySelector(vAe))==null||J.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function G(){var U;return(U=C.current)==null?void 0:U.querySelector(`${k2}[aria-selected="true"]`)}function j(){var U;return Array.from(((U=C.current)==null?void 0:U.querySelectorAll(qD))||[])}function H(U){let O=j()[U];O&&A.setState("value",O.getAttribute(Al))}function $(U){var O;let J=G(),K=j(),ne=K.findIndex(ee=>ee===J),Y=K[ne+U];(O=a.current)!=null&&O.loop&&(Y=ne+U<0?K[K.length-1]:ne+U===K.length?K[0]:K[ne+U]),Y&&A.setState("value",Y.getAttribute(Al))}function V(U){let O=G(),J=O==null?void 0:O.closest(Pf),K;for(;J&&!K;)J=U>0?kAe(J,Pf):AAe(J,Pf),K=J==null?void 0:J.querySelector(qD);K?A.setState("value",K.getAttribute(Al)):$(U)}let X=()=>H(j().length-1),I=U=>{U.preventDefault(),U.metaKey?X():U.altKey?V(1):$(1)},q=U=>{U.preventDefault(),U.metaKey?H(0):U.altKey?V(-1):$(-1)};return P.createElement(Oe.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:U=>{var O;if((O=x.onKeyDown)==null||O.call(x,U),!U.defaultPrevented)switch(U.key){case"n":case"j":{v&&U.ctrlKey&&I(U);break}case"ArrowDown":{I(U);break}case"p":case"k":{v&&U.ctrlKey&&q(U);break}case"ArrowUp":{q(U);break}case"Home":{U.preventDefault(),H(0);break}case"End":{U.preventDefault(),X();break}case"Enter":if(!U.nativeEvent.isComposing&&U.keyCode!==229){U.preventDefault();let J=G();if(J){let K=new Event($_);J.dispatchEvent(K)}}}}},P.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:IAe},l),Xy(e,U=>P.createElement(_B.Provider,{value:A},P.createElement(SB.Provider,{value:M},U))))}),wAe=P.forwardRef((e,t)=>{var n,r;let o=Nn(),i=P.useRef(null),s=P.useContext(CB),a=zp(),l=RB(e),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;_c(()=>{if(!c)return a.item(o,s==null?void 0:s.id)},[c]);let u=PB(o,i,[e.value,e.children,i],e.keywords),d=A2(),p=Cc(E=>E.value&&E.value===u.current),h=Cc(E=>c||a.filter()===!1?!0:E.search?E.filtered.items.get(o)>0:!0);P.useEffect(()=>{let E=i.current;if(!(!E||e.disabled))return E.addEventListener($_,m),()=>E.removeEventListener($_,m)},[h,e.onSelect,e.disabled]);function m(){var E,A;b(),(A=(E=l.current).onSelect)==null||A.call(E,u.current)}function b(){d.setState("value",u.current,!0)}if(!h)return null;let{disabled:v,value:x,onSelect:w,forceMount:_,keywords:R,...C}=e;return P.createElement(Oe.div,{ref:Xh([i,t]),...C,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!p,"data-disabled":!!v,"data-selected":!!p,onPointerMove:v||a.getDisablePointerSelection()?void 0:b,onClick:v?void 0:m},e.children)}),SAe=P.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,s=Nn(),a=P.useRef(null),l=P.useRef(null),c=Nn(),u=zp(),d=Cc(h=>o||u.filter()===!1?!0:h.search?h.filtered.groups.has(s):!0);_c(()=>u.group(s),[]),PB(s,a,[e.value,e.heading,l]);let p=P.useMemo(()=>({id:s,forceMount:o}),[o]);return P.createElement(Oe.div,{ref:Xh([a,t]),...i,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&P.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),Xy(e,h=>P.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},P.createElement(CB.Provider,{value:p},h))))}),_Ae=P.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=P.useRef(null),i=Cc(s=>!s.search);return!n&&!i?null:P.createElement(Oe.div,{ref:Xh([o,t]),...r,"cmdk-separator":"",role:"separator"})}),CAe=P.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=A2(),s=Cc(u=>u.search),a=Cc(u=>u.value),l=zp(),c=P.useMemo(()=>{var u;let d=(u=l.listInnerRef.current)==null?void 0:u.querySelector(`${k2}[${Al}="${encodeURIComponent(a)}"]`);return d==null?void 0:d.getAttribute("id")},[]);return P.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),P.createElement(Oe.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:o?e.value:s,onChange:u=>{o||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),EAe=P.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,i=P.useRef(null),s=P.useRef(null),a=zp();return P.useEffect(()=>{if(s.current&&i.current){let l=s.current,c=i.current,u,d=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let p=l.offsetHeight;c.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return d.observe(l),()=>{cancelAnimationFrame(u),d.unobserve(l)}}},[]),P.createElement(Oe.div,{ref:Xh([i,t]),...o,"cmdk-list":"",role:"listbox","aria-label":r,id:a.listId},Xy(e,l=>P.createElement("div",{ref:Xh([s,a.listInnerRef]),"cmdk-list-sizer":""},l)))}),RAe=P.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:s,...a}=e;return P.createElement(d2,{open:n,onOpenChange:r},P.createElement(f2,{container:s},P.createElement(Hy,{"cmdk-overlay":"",className:o}),P.createElement(Vy,{"aria-label":e.label,"cmdk-dialog":"",className:i},P.createElement(EB,{ref:t,...a}))))}),PAe=P.forwardRef((e,t)=>Cc(n=>n.filtered.count===0)?P.createElement(Oe.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),TAe=P.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...i}=e;return P.createElement(Oe.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Xy(e,s=>P.createElement("div",{"aria-hidden":!0},s)))}),fo=Object.assign(EB,{List:EAe,Item:wAe,Input:CAe,Group:SAe,Separator:_Ae,Dialog:RAe,Empty:PAe,Loading:TAe});function kAe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function AAe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function RB(e){let t=P.useRef(e);return _c(()=>{t.current=e}),t}var _c=typeof window>"u"?P.useEffect:P.useLayoutEffect;function fu(e){let t=P.useRef();return t.current===void 0&&(t.current=e()),t}function Xh(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Cc(e){let t=A2(),n=()=>e(t.snapshot());return m9.useSyncExternalStore(t.subscribe,n,n)}function PB(e,t,n,r=[]){let o=P.useRef(),i=zp();return _c(()=>{var s;let a=(()=>{var c;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(c=u.current.textContent)==null?void 0:c.trim():o.current}})(),l=r.map(c=>c.trim());i.value(e,a,l),(s=t.current)==null||s.setAttribute(Al,a),o.current=a}),o}var OAe=()=>{let[e,t]=P.useState(),n=fu(()=>new Map);return _c(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function MAe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Xy({asChild:e,children:t},n){return e&&P.isValidElement(t)?P.cloneElement(MAe(t),{ref:t.ref},n(t.props.children)):n(t)}var IAe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const TB=P.forwardRef(({className:e,...t},n)=>y.jsx(fo,{ref:n,className:ge("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));TB.displayName=fo.displayName;const kB=P.forwardRef(({className:e,...t},n)=>y.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[y.jsx(bL,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),y.jsx(fo.Input,{ref:n,className:ge("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));kB.displayName=fo.Input.displayName;const AB=P.forwardRef(({className:e,...t},n)=>y.jsx(fo.List,{ref:n,className:ge("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));AB.displayName=fo.List.displayName;const OB=P.forwardRef((e,t)=>y.jsx(fo.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));OB.displayName=fo.Empty.displayName;const MB=P.forwardRef(({className:e,...t},n)=>y.jsx(fo.Group,{ref:n,className:ge("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));MB.displayName=fo.Group.displayName;const DAe=P.forwardRef(({className:e,...t},n)=>y.jsx(fo.Separator,{ref:n,className:ge("-mx-1 h-px bg-border",e),...t}));DAe.displayName=fo.Separator.displayName;const IB=P.forwardRef(({className:e,...t},n)=>y.jsx(fo.Item,{ref:n,className:ge("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));IB.displayName=fo.Item.displayName;var NAe=Object.defineProperty,LAe=(e,t,n)=>t in e?NAe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bm=(e,t,n)=>LAe(e,typeof t!="symbol"?t+"":t,n);const FAe={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},jAe={stringify:e=>e.name,parse:(e,t,n)=>{const r=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof r=="function"?r.bind(n):void 0}},$Ae={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},zAe={stringify:e=>`${e}`,parse:e=>parseFloat(e)},BAe={stringify:e=>e,parse:e=>e},l1={string:BAe,number:zAe,boolean:FAe,function:jAe,json:$Ae};function HAe(e){return e.replace(/([a-z0-9])([A-Z])/g,(t,n,r)=>`${n}-${r.toLowerCase()}`)}const Hm=Symbol.for("r2wc.render"),Vm=Symbol.for("r2wc.connected"),xl=Symbol.for("r2wc.context"),Ts=Symbol.for("r2wc.props");function VAe(e,t,n){var r,o,i;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]),t.events||(t.events=[]);const s=Array.isArray(t.props)?t.props.slice():Object.keys(t.props),a=Array.isArray(t.events)?t.events.slice():Object.keys(t.events),l={},c={},u={},d={};for(const h of s){l[h]=Array.isArray(t.props)?"string":t.props[h];const m=HAe(h);u[h]=m,d[m]=h}for(const h of a)c[h]=Array.isArray(t.events)?{}:t.events[h];class p extends HTMLElement{constructor(){super(),Bm(this,i,!0),Bm(this,o),Bm(this,r,{}),Bm(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[Ts].container=this.container;for(const m of s){const b=u[m],v=this.getAttribute(b),x=l[m],w=x?l1[x]:null;w!=null&&w.parse&&v&&(this[Ts][m]=w.parse(v,b,this))}for(const m of a)this[Ts][m]=b=>{const v=m.replace(/^on/,"").toLowerCase();this.dispatchEvent(new CustomEvent(v,{detail:b,...c[m]}))}}static get observedAttributes(){return Object.keys(d)}connectedCallback(){this[Vm]=!0,this[Hm]()}disconnectedCallback(){this[Vm]=!1,this[xl]&&n.unmount(this[xl]),delete this[xl]}attributeChangedCallback(m,b,v){const x=d[m],w=l[x],_=w?l1[w]:null;x in l&&_!=null&&_.parse&&v&&(this[Ts][x]=_.parse(v,m,this),this[Hm]())}[(i=Vm,o=xl,r=Ts,Hm)](){this[Vm]&&(this[xl]?n.update(this[xl],this[Ts]):this[xl]=n.mount(this.container,e,this[Ts]))}}for(const h of s){const m=u[h],b=l[h];Object.defineProperty(p.prototype,h,{enumerable:!0,configurable:!0,get(){return this[Ts][h]},set(v){this[Ts][h]=v;const x=b?l1[b]:null;if(x!=null&&x.stringify){const w=x.stringify(v,m,this);this.getAttribute(m)!==w&&this.setAttribute(m,w)}else this[Hm]()}})}return p}function WAe(e,t,n){const r=y1(e),o=T.createElement(t,n);return r.render(o),{root:r,ReactComponent:t}}function UAe({root:e,ReactComponent:t},n){const r=T.createElement(t,n);e.render(r)}function GAe({root:e}){e.unmount()}function qAe(e,t={}){return VAe(e,t,{mount:WAe,update:UAe,unmount:GAe})}const YAe={id:"string",version:"string",authToken:"json",placeholders:"json",defaultFilterValues:"json",currentTheme:"string",customCards:"json",customStyle:"json",onChartElementClicked:"function",onFilterValuesChange:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function",showAssistant:"boolean",selectedSheetId:"string"},KAe=qAe(L$,{props:YAe});exports.$e=Nxe;exports.Accordion=cAe;exports.AccordionContent=xB;exports.AccordionItem=yB;exports.AccordionTrigger=vB;exports.Button=Hn;exports.Calendar=tL;exports.Card=BN;exports.CardContent=E0;exports.CardDescription=iC;exports.CardHeader=C0;exports.CardTitle=wd;exports.CaretSortIcon=fee;exports.ChartJsVisual=YE;exports.ChatInput=x7;exports.ChatStatus=b7;exports.Check=_d;exports.CheckIcon=FC;exports.Checkbox=Oy;exports.ChevronDown=lp;exports.ChevronLeft=jC;exports.ChevronRight=V0;exports.ChevronUp=nL;exports.Circle=$C;exports.ColorFormat=W6;exports.Command=TB;exports.CommandEmpty=OB;exports.CommandGroup=MB;exports.CommandInput=kB;exports.CommandItem=IB;exports.CommandList=AB;exports.Copy=zC;exports.CopyButton=Kj;exports.Cross2Icon=X5;exports.DATAMODEL_NAMESPCACE=Y_;exports.Dashboard=L$;exports.DashboardPanel=VN;exports.DashboardTabs=D$;exports.DashboardWC=KAe;exports.Dialog=LTe;exports.DialogContent=jz;exports.DialogDescription=Hz;exports.DialogFooter=zz;exports.DialogHeader=$z;exports.DialogTitle=Bz;exports.DialogTrigger=FTe;exports.Download=rL;exports.DropdownMenu=OTe;exports.DropdownMenuCheckboxItem=Iz;exports.DropdownMenuContent=Oz;exports.DropdownMenuItem=Mz;exports.DropdownMenuLabel=Nz;exports.DropdownMenuRadioGroup=ITe;exports.DropdownMenuRadioItem=Dz;exports.DropdownMenuSeparator=Lz;exports.DropdownMenuTrigger=MTe;exports.Editable=Xi;exports.EditorAside=Wz;exports.EditorMain=Uz;exports.EditorPanel=Vz;exports.ErrorBoundary=U0;exports.Eye=iL;exports.EyeOff=oL;exports.Fallback=HC;exports.FallbackEditorCard=Zee;exports.Filter=sL;exports.FilterComponent=PR;exports.FilterHeader=Xj;exports.FilterX=BC;exports.Ft=Uke;exports.GripVertical=aL;exports.HoverCard=bp;exports.HoverCardContent=Od;exports.HoverCardTrigger=yp;exports.Icon=eL;exports.IdCard=lL;exports.Info=cL;exports.Input=rc;exports.KPICard=Wb;exports.LOCALE_CURRENCY_PAIRS=v1;exports.Label=cn;exports.Le=zke;exports.Lightbulb=dL;exports.LightbulbOff=uL;exports.MultiInputEmptyRenderer=X6;exports.Octagon=fL;exports.PYTHON_DEFAULT_CODE=q_;exports.Pencil=hL;exports.Percent=pL;exports.Play=gL;exports.Plus=W0;exports.Popover=vy;exports.PopoverContent=_p;exports.PopoverTrigger=xy;exports.PrintMessages=y7;exports.RadioGroup=Fh;exports.RadioGroupItem=Fl;exports.ResizableHandle=Z2e;exports.ResizablePanel=N_;exports.ResizablePanelGroup=V7;exports.ScrollArea=oc;exports.ScrollBar=Cp;exports.Search=bL;exports.SearchX=mL;exports.Select=Is;exports.SelectContent=Li;exports.SelectGroup=uu;exports.SelectItem=_n;exports.SelectLabel=Pl;exports.SelectSeparator=sh;exports.SelectTrigger=Ni;exports.SelectValue=Ds;exports.SemaphorContextProvider=$N;exports.SemaphorQueryClient=FN;exports.SendHorizontal=yL;exports.Separator=uy;exports.Settings=vL;exports.SliderIcon=xee;exports.SquarePen=xL;exports.Switch=oB;exports.Table2=wL;exports.TableBody=$E;exports.TableCell=BE;exports.TableHead=zE;exports.TableHeader=jE;exports.TableRow=oh;exports.TableVisual=q6;exports.Tabs=dC;exports.TabsContent=fC;exports.TabsList=k0;exports.TabsTrigger=A0;exports.TextCard=Xb;exports.Textarea=TR;exports.Toggle=wy;exports.Tooltip=m3;exports.TooltipContent=LE;exports.TooltipTrigger=b3;exports.TooltipTrigger$1=NE;exports.TreePalm=SL;exports.TriangleDownIcon=Q5;exports.TriangleUpIcon=Z5;exports.UXProvider=N$;exports.UserRound=_L;exports.UserSearch=CL;exports.X=kc;exports._=ql;exports.cn=ge;exports.createChartConfig=xE;exports.createLucideIcon=Mt;exports.createSqlGenConfig=tX;exports.de=Zz;exports.dedup=v2e;exports.flexRender=HS;exports.fmt=X_;exports.getCanvasBackgroundColor=bh;exports.getColumnDataType=nX;exports.getContrastColor=Qu;exports.getCoreRowModel=D3;exports.getDefaultFilterSql=Vve;exports.getFilterValueType=wu;exports.getFormattedTableNameForQuery=SN;exports.getKeys=Yn;exports.getNumberAxis=WC;exports.getPaginationRowModel=N3;exports.getPlugins=gX;exports.getQualifiedTableName=Z_;exports.getRequest=cX;exports.getSortedRowModel=L3;exports.getSql=eX;exports.getStatus=v7;exports.getTenantAndEndUserId=uX;exports.getTokenParams=CN;exports.hslStringToHex=RL;exports.invalidateToken=hX;exports.isBooleanDataType=Q_;exports.isColumnInSqlGen=rX;exports.isDateDataType=xd;exports.isInAiScopeArray=y2e;exports.isNumberDataType=tp;exports.isObjectEmpty=lX;exports.isTextDataType=w0;exports.loadManifest=Y6;exports.pivotData=vb;exports.postRequest=_0;exports.removeFromScopeArray=x2e;exports.removeRing=qf;exports.resolveDataType=S0;exports.titleCase=fX;exports.ue=Qj;exports.useCard=fce;exports.useChat=E9;exports.useCustomVisual=K6;exports.useDashboardActions=An;exports.useDashboardCardQuery=La;exports.useDashboardStore=be;exports.useDateFilterHook=Ibe;exports.useEditorActions=ap;exports.useEditorStore=to;exports.useQuery=rp;exports.useQueryClient=oC;exports.useReactTable=F3;exports.useSemaphorContext=Do;exports.useTextFilterHook=Wve;exports.useTheme=RN;exports.useTopoJson=E4;exports.v4=Na;
|