Files
HX_KI_com-Com1/grafana/plugins/grafana-pyroscope-app/194.js
2026-03-06 14:37:04 +00:00

3 lines
1.0 MiB
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*! For license information please see 194.js.LICENSE.txt */
(self.webpackChunkgrafana_pyroscope_app=self.webpackChunkgrafana_pyroscope_app||[]).push([[194],{219:(e,t,n)=>{(()=>{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};function i(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n);return(t>>>0).toString(16)}t.r(r),t.d(r,{AITextArea:()=>jt,AITextInput:()=>Pt,ASSISTANT_PLUGIN_ID:()=>U,ASSISTANT_PLUGIN_TITLE:()=>q,CALLBACK_EXTENSION_POINT:()=>V,ComponentNodeData:()=>E,DashboardNodeData:()=>k,DatasourceNodeData:()=>C,EntityNodeData:()=>I,FolderNodeData:()=>T,LabelNameNodeData:()=>R,LabelValueNodeData:()=>A,OpenAssistantButton:()=>bt,OpenAssistantSplitButton:()=>xt,StructuredNodeData:()=>o,closeAssistant:()=>X,createAssistantContextItem:()=>L,ensureInlineAssistantInitialized:()=>Rt,getExposeAssistantFunctionsConfig:()=>B,getInlineAssistantFactory:()=>At,isAssistantAvailable:()=>H,newFunctionNamespace:()=>$,openAssistant:()=>Y,provideComponents:()=>O,providePageContext:()=>y,provideQuestions:()=>P,setInlineAssistantFactory:()=>Ct,setInlineAssistantInitializer:()=>It,toggleAssistant:()=>J,useAssistant:()=>Z,useInlineAssistant:()=>Nt,usePageComponents:()=>_,usePageContext:()=>w,useProvidePageContext:()=>b,useProvideQuestions:()=>M,useQuestions:()=>j});class a{constructor(e){this.params=e,this.text="",this.id=i(e.id),this.type=e.type}formatForLLM(e){var t,n;return{type:this.type,codeElementIds:e,data:{name:null!==(t=this.params.text)&&void 0!==t?t:"",text:null!==(n=this.params.text)&&void 0!==n?n:""}}}equals(e){return e instanceof a&&this.id===e.id&&this.type===e.type}}class o extends a{constructor(e){super({...e,id:i(JSON.stringify(e.data)),type:"structured"}),this.data=e.data}formatForLLM(e){return{type:this.type,codeElementIds:e,data:this.data}}}const s=n(8531),l=n(5959);var u=t.n(l);const c="__grafanaAssistantPageContextRegistry__",d="grafana-assistant:page-context-registry-changed",h="grafana-assistant:page-context-update",f="grafana-assistant:page-context-remove",p="grafana-assistant:page-context-sync";function m(){return window[c]}function g(e,t=!1){window[c]=e,window.dispatchEvent(new CustomEvent(d)),t||window.dispatchEvent(new CustomEvent(p,{detail:{registry:e}}))}window[c]||(window[c]=[]);let v=!1;function y(e,t){const n={id:S(),urlPattern:e,context:[...t]};g([...m(),n]),window.dispatchEvent(new CustomEvent(h,{detail:n}));const r=e=>{const t=m(),r=t.findIndex((e=>e.id===n.id));if(-1!==r){const n=[...t];n[r]={...n[r],context:[...e]},g(n),window.dispatchEvent(new CustomEvent(h,{detail:n[r]}))}};return r.unregister=()=>{const e=m(),t=e.findIndex((e=>e.id===n.id));-1!==t&&(g(e.filter(((e,n)=>n!==t))),window.dispatchEvent(new CustomEvent(f,{detail:{id:n.id}})))},r}function b(e,t=[]){const n=(0,l.useRef)(void 0),r=(0,l.useRef)(t);return r.current=t,(0,l.useEffect)((()=>(n.current=y(e,r.current),()=>{var e;null===(e=n.current)||void 0===e||e.unregister()})),[e]),(0,l.useEffect)((()=>{n.current&&n.current(t)}),[t]),(0,l.useCallback)((e=>{var t;null===(t=n.current)||void 0===t||t.call(n,e)}),[])}function w(e={allowQuestions:!1,allowComponents:!1}){const[t,n]=(0,l.useState)([]),r=(0,s.useLocationService)(),i=(0,l.useRef)("");(0,l.useEffect)((()=>{const e=()=>{const e=function(e){if(!e)return[];const t=[],n=m();for(const r of n)x(e,r.urlPattern)&&t.push(...r.context);return t}(r.getLocation().pathname);n(e)},t=()=>{e()},a=r.getLocationObservable().subscribe((t=>{const n=t.pathname;n!==i.current&&(i.current=n,e())}));return window.addEventListener(d,t),window.addEventListener(h,t),window.addEventListener(f,t),window.addEventListener(p,t),e(),()=>{a.unsubscribe(),window.removeEventListener(d,t),window.removeEventListener(h,t),window.removeEventListener(f,t),window.removeEventListener(p,t)}}),[r]);let a=t;return e.allowQuestions||(a=a.filter((e=>{var t;return"question"!==(null===(t=e.node.data)||void 0===t?void 0:t.type)}))),e.allowComponents||(a=a.filter((e=>{var t;return"component"!==(null===(t=e.node.data)||void 0===t?void 0:t.type)}))),a}function S(e="page-context"){return`${e}-${Date.now()}-${Math.random().toString(36).slice(2,11)}`}function x(e,t){if(t instanceof RegExp)return t.test(e);if("string"==typeof t){const n=t.replace(/\*\*/g,"\0DOUBLE_STAR\0").replace(/\*/g,"[^/]*").replace(/\u0000DOUBLE_STAR\u0000/g,".*").replace(/\?/g,".");return new RegExp(`^${n}$`).test(e)}return!1}v||(v=!0,window.addEventListener(h,(e=>{const t=e.detail;if(!t||!t.id)return;const n=m(),r=n.findIndex((e=>e.id===t.id));if(-1!==r){const e=[...n];e[r]=t,g(e,!0)}else g([...n,t],!0)})),window.addEventListener(f,(e=>{var t;const n=null===(t=e.detail)||void 0===t?void 0:t.id;if(!n)return;const r=m(),i=r.findIndex((e=>e.id===n));-1!==i&&g(r.filter(((e,t)=>t!==i)),!0)})),window.addEventListener(p,(e=>{var t;const n=null===(t=e.detail)||void 0===t?void 0:t.registry;if(!Array.isArray(n))return;const r=m(),i=new Set(r.map((e=>e.id))),a=n.filter((e=>!i.has(e.id)));a.length>0&&g([...r,...a],!0)})));class E extends a{constructor(e){const t=e.namespace||"components";super({...e,id:`${t}-${Object.keys(e.components).join("-")}`,type:"component"}),this.components=e.components,this.prompt=e.prompt,this.namespace=t}formatForLLM(e){return{type:this.type,codeElementIds:e,data:{name:`${this.namespace} components`,prompt:this.prompt,namespace:this.namespace}}}}function _(){const e=w({allowComponents:!0,allowQuestions:!1});return(0,l.useMemo)((()=>{const t={};return e.filter((e=>{var t;return null===(t=e.node.data)||void 0===t?void 0:t.components})).forEach((e=>{const n=e.node.data;if((null==n?void 0:n.components)&&Object.keys(n.components).length>0){const e=n.namespace||n.name||"components";Object.entries(n.components).forEach((([n,r])=>{t[`${e}_${n}`]=r}))}})),t}),[e])}function O(e,t,n,r=/.*/){if((i=r)instanceof RegExp?".*"===i.source&&""===i.flags:".*"===i||"/.*/"===i){const r=y(/.*/,[L("component",{components:n,prompt:e,namespace:t})]),i=(e,n)=>{r([L("component",{components:e,prompt:n,namespace:t})])};return i.unregister=r.unregister,i}var i;const a=y(/.*/,[L("component",{components:n,prompt:"",namespace:t})]),o=y(r,[L("component",{components:{},prompt:e,namespace:t})]),s=(e,n)=>{a([L("component",{components:e,prompt:"",namespace:t})]),o([L("component",{components:{},prompt:n,namespace:t})])};return s.unregister=()=>{a.unregister(),o.unregister()},s}class k extends a{constructor(e){super({...e,id:e.dashboardUid,type:"dashboard"}),this.dashboardUid=e.dashboardUid,this.dashboardTitle=e.dashboardTitle,this.folderUid=e.folderUid,this.folderTitle=e.folderTitle,this.text=e.dashboardTitle}formatForLLM(e){return{type:this.type,codeElementIds:e,data:{name:this.dashboardTitle,dashboardUid:this.dashboardUid,dashboardTitle:this.dashboardTitle,folderUid:this.folderUid,folderTitle:this.folderTitle,text:this.text}}}}class T extends a{constructor(e){super({...e,id:e.folderUid,type:"dashboard_folder"}),this.text="",this.folderUid=e.folderUid,this.folderTitle=e.folderTitle,this.text=e.folderTitle}formatForLLM(e){return{type:this.type,codeElementIds:e,data:{name:this.folderTitle,folderUid:this.folderUid,folderTitle:this.folderTitle,text:this.text}}}}class C extends a{constructor(e){super({...e,id:e.datasourceUid,type:"datasource"}),this.datasourceUid=e.datasourceUid,this.datasourceType=e.datasourceType,this.datasourceName=e.datasourceName,this.img=e.img,this.text=e.datasourceName}formatForLLM(e){return{type:this.type,codeElementIds:e,data:{name:this.datasourceName,uid:this.datasourceUid,type:this.datasourceType,text:this.text,img:this.img}}}}class I extends a{constructor(e){var t,n,r;super({id:`${e.type}-${e.name}-${[null===(t=e.scope)||void 0===t?void 0:t.env,null===(n=e.scope)||void 0===n?void 0:n.site,null===(r=e.scope)||void 0===r?void 0:r.namespace].filter(Boolean).join("-")}`,type:"entity",title:e.title,hidden:e.hidden,img:e.img,icon:e.icon,text:e.name}),this.entityType=e.type,this.name=e.name,this.scope=e.scope,this.properties=e.properties,this.text=e.name}formatForLLM(e){return{type:"entity",codeElementIds:e,data:{name:this.name,text:this.text,type:this.entityType,scope:this.scope,properties:this.properties}}}}class R extends a{constructor(e){super({...e,id:`${e.datasourceUid}-${e.labelName}`,type:"label_name"}),this.datasourceUid=e.datasourceUid,this.datasourceType=e.datasourceType,this.datasourceName=e.datasourceName,this.labelName=e.labelName,this.text=e.labelName,this.img=e.img}formatForLLM(e){return{type:this.type,codeElementIds:e,data:{name:this.labelName,datasourceUid:this.datasourceUid,datasourceType:this.datasourceType,datasourceName:this.datasourceName,labelName:this.labelName,img:this.img,text:this.text}}}}class A extends a{constructor(e){super({...e,id:`${e.datasourceUid}-${e.labelName}-${e.labelValue}`,type:"label_value"}),this.datasourceUid=e.datasourceUid,this.datasourceType=e.datasourceType,this.datasourceName=e.datasourceName,this.labelName=e.labelName,this.labelValue=e.labelValue,this.text=e.labelValue,this.img=e.img}formatForLLM(e){return{type:this.type,codeElementIds:e,data:{name:this.labelValue,datasourceUid:this.datasourceUid,datasourceType:this.datasourceType,datasourceName:this.datasourceName,labelName:this.labelName,labelValue:this.labelValue,text:this.text,img:this.img}}}}function N(e){var t,n,r,i,a;const o=(0,s.getDataSourceSrv)().getInstanceSettings(e);return{datasourceType:null!==(t=null==o?void 0:o.type)&&void 0!==t?t:"unknown",datasourceName:null!==(n=null==o?void 0:o.name)&&void 0!==n?n:e,img:null===(a=null===(i=null===(r=null==o?void 0:o.meta)||void 0===r?void 0:r.info)||void 0===i?void 0:i.logos)||void 0===a?void 0:a.small}}const D={datasource:"database",label_name:"database",label_value:"database",dashboard:"dashboard",dashboard_folder:"folder",unknown:"circle-mono",structured:"gf-grid",component:"gf-grid",entity:"asserts"};function L(e,t){var n,r,i;const s=function(e,t){switch(e){case"datasource":return new C({...t,...N(t.datasourceUid)});case"label_name":return new R({...t,...N(t.datasourceUid)});case"label_value":return new A({...t,...N(t.datasourceUid)});case"dashboard":return new k(t);case"dashboard_folder":return new T(t);case"structured":return new o(t);case"component":return new E({...t,hidden:!0});case"entity":return new I(t);case"unknown":return new a(t);default:return console.error(`Unknown context type: ${e}`),new a(t)}}(e,t),l=null!==(n=t.title)&&void 0!==n?n:function(e){var t;return e instanceof o?e.formatForLLM().data.name:null!==(t=e.text)&&void 0!==t?t:"Given Context"}(s),u=null!==(r=t.img)&&void 0!==r?r:function(e){if("img"in e)return e.img}(s);return{node:{id:s.id,name:l,img:u,icon:null!==(i=t.icon)&&void 0!==i?i:D[e],navigable:!1,selectable:!0,data:s},occurrences:[]}}function P(e,t){const n=S("question"),r=e=>e.map(((e,t)=>({node:{id:`question-${n}-${t}`,name:e.prompt,navigable:!1,selectable:!0,icon:"question-circle",data:{type:"question",prompt:e.prompt,context:e.context||[]}},occurrences:[]}))),i=y(e,r(t)),a=e=>{i(r(e))};return a.unregister=i.unregister,a}function M(e,t=[]){const n=(0,l.useMemo)((()=>S("question")),[]),r=e=>e.map(((e,t)=>({node:{id:`question-${n}-${t}`,name:e.prompt,navigable:!1,selectable:!0,icon:"question-circle",data:{type:"question",prompt:e.prompt,context:e.context||[]}},occurrences:[]}))),i=b(e,r(t));return e=>{i(r(e))}}function j(){const e=w({allowQuestions:!0,allowComponents:!1});return F(e)}const F=e=>e.filter((e=>{var t;return"question"===(null===(t=e.node.data)||void 0===t?void 0:t.type)})).map((e=>{var t,n;return{prompt:(null===(t=e.node.data)||void 0===t?void 0:t.prompt)||e.node.name,context:(null===(n=e.node.data)||void 0===n?void 0:n.context)||[]}})),V="grafana-assistant-app/callback/v0-alpha";function $(e,t){return{namespace:e,functions:t}}function B(e){return{title:"callback",targets:[V],fn:()=>e.map((e=>({namespace:e.namespace,functions:e.functions})))}}const z=n(1269),U="grafana-assistant-app",q="Grafana Assistant";function H(){return s.getObservablePluginLinks?(0,s.getObservablePluginLinks)({extensionPointId:"grafana/extension-sidebar/v0-alpha"}).pipe((0,z.map)((e=>e.some((e=>e.pluginId===U&&e.title===q))))):(0,z.of)(!1)}const W=n(7781);class G extends W.BusEventWithPayload{}G.type="open-extension-sidebar";class K extends W.BusEventBase{}K.type="close-extension-sidebar";class Q extends W.BusEventWithPayload{}function Y(e){var t,n;(0,s.reportInteraction)("grafana_assistant_app_opened_sidebar",{from:e.origin,prompt:null!==(t=e.prompt)&&void 0!==t?t:""}),function(e,t,n){const r=new G({pluginId:e,componentTitle:t,props:n});(0,s.getAppEvents)().publish(r)}(U,q,{initialPrompt:e.prompt,initialContext:e.context,initialAutoSend:null===(n=e.autoSend)||void 0===n||n,origin:e.origin,initialMode:e.mode})}function X(){!function(){const e=new K;(0,s.getAppEvents)().publish(e)}()}function J(e){var t,n;(0,s.reportInteraction)("grafana_assistant_app_toggled_sidebar",{from:e.origin,prompt:null!==(t=e.prompt)&&void 0!==t?t:""}),function(e,t,n){const r=new Q({pluginId:e,componentTitle:t,props:n});(0,s.getAppEvents)().publish(r)}(U,q,{initialPrompt:e.prompt,initialContext:e.context,initialAutoSend:null===(n=e.autoSend)||void 0===n||n,origin:e.origin,initialMode:e.mode})}function Z(){const[e,t]=(0,l.useState)(!1);return(0,l.useEffect)((()=>{const e=H().subscribe((e=>t(e)));return()=>{e.unsubscribe()}}),[]),{isAvailable:e,openAssistant:e?Y:void 0,closeAssistant:e?X:void 0,toggleAssistant:e?J:void 0}}Q.type="toggle-extension-sidebar";const ee=n(2007);var te=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)})),this.tags=[],this.ctr=0},e}(),ne=Math.abs,re=String.fromCharCode,ie=Object.assign;function ae(e){return e.trim()}function oe(e,t,n){return e.replace(t,n)}function se(e,t){return e.indexOf(t)}function le(e,t){return 0|e.charCodeAt(t)}function ue(e,t,n){return e.slice(t,n)}function ce(e){return e.length}function de(e){return e.length}function he(e,t){return t.push(e),e}var fe=1,pe=1,me=0,ge=0,ve=0,ye="";function be(e,t,n,r,i,a,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:fe,column:pe,length:o,return:""}}function we(e,t){return ie(be("",null,null,"",null,null,0),e,{length:-e.length},t)}function Se(){return ve=ge<me?le(ye,ge++):0,pe++,10===ve&&(pe=1,fe++),ve}function xe(){return le(ye,ge)}function Ee(){return ge}function _e(e,t){return ue(ye,e,t)}function Oe(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function ke(e){return fe=pe=1,me=ce(ye=e),ge=0,[]}function Te(e){return ye="",e}function Ce(e){return ae(_e(ge-1,Ae(91===e?e+2:40===e?e+1:e)))}function Ie(e){for(;(ve=xe())&&ve<33;)Se();return Oe(e)>2||Oe(ve)>3?"":" "}function Re(e,t){for(;--t&&Se()&&!(ve<48||ve>102||ve>57&&ve<65||ve>70&&ve<97););return _e(e,Ee()+(t<6&&32==xe()&&32==Se()))}function Ae(e){for(;Se();)switch(ve){case e:return ge;case 34:case 39:34!==e&&39!==e&&Ae(ve);break;case 40:41===e&&Ae(e);break;case 92:Se()}return ge}function Ne(e,t){for(;Se()&&e+ve!==57&&(e+ve!==84||47!==xe()););return"/*"+_e(t,ge-1)+"*"+re(47===e?e:Se())}function De(e){for(;!Oe(xe());)Se();return _e(e,ge)}var Le="-ms-",Pe="-moz-",Me="-webkit-",je="comm",Fe="rule",Ve="decl",$e="@keyframes";function Be(e,t){for(var n="",r=de(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function ze(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Ve:return e.return=e.return||e.value;case je:return"";case $e:return e.return=e.value+"{"+Be(e.children,r)+"}";case Fe:e.value=e.props.join(",")}return ce(n=Be(e.children,r))?e.return=e.value+"{"+n+"}":""}function Ue(e){return Te(qe("",null,null,null,[""],e=ke(e),0,[0],e))}function qe(e,t,n,r,i,a,o,s,l){for(var u=0,c=0,d=o,h=0,f=0,p=0,m=1,g=1,v=1,y=0,b="",w=i,S=a,x=r,E=b;g;)switch(p=y,y=Se()){case 40:if(108!=p&&58==le(E,d-1)){-1!=se(E+=oe(Ce(y),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:E+=Ce(y);break;case 9:case 10:case 13:case 32:E+=Ie(p);break;case 92:E+=Re(Ee()-1,7);continue;case 47:switch(xe()){case 42:case 47:he(We(Ne(Se(),Ee()),t,n),l);break;default:E+="/"}break;case 123*m:s[u++]=ce(E)*v;case 125*m:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+c:-1==v&&(E=oe(E,/\f/g,"")),f>0&&ce(E)-d&&he(f>32?Ge(E+";",r,n,d-1):Ge(oe(E," ","")+";",r,n,d-2),l);break;case 59:E+=";";default:if(he(x=He(E,t,n,u,c,i,s,b,w=[],S=[],d),a),123===y)if(0===c)qe(E,t,x,x,w,a,d,s,S);else switch(99===h&&110===le(E,3)?100:h){case 100:case 108:case 109:case 115:qe(e,x,x,r&&he(He(e,x,x,0,0,i,s,b,i,w=[],d),S),i,S,d,s,r?w:S);break;default:qe(E,x,x,x,[""],S,0,s,S)}}u=c=f=0,m=v=1,b=E="",d=o;break;case 58:d=1+ce(E),f=p;default:if(m<1)if(123==y)--m;else if(125==y&&0==m++&&125==(ve=ge>0?le(ye,--ge):0,pe--,10===ve&&(pe=1,fe--),ve))continue;switch(E+=re(y),y*m){case 38:v=c>0?1:(E+="\f",-1);break;case 44:s[u++]=(ce(E)-1)*v,v=1;break;case 64:45===xe()&&(E+=Ce(Se())),h=xe(),c=d=ce(b=E+=De(Ee())),y++;break;case 45:45===p&&2==ce(E)&&(m=0)}}return a}function He(e,t,n,r,i,a,o,s,l,u,c){for(var d=i-1,h=0===i?a:[""],f=de(h),p=0,m=0,g=0;p<r;++p)for(var v=0,y=ue(e,d+1,d=ne(m=o[p])),b=e;v<f;++v)(b=ae(m>0?h[v]+" "+y:oe(y,/&\f/g,h[v])))&&(l[g++]=b);return be(e,t,n,0===i?Fe:s,l,u,c)}function We(e,t,n){return be(e,t,n,je,re(ve),ue(e,2,-2),0)}function Ge(e,t,n,r){return be(e,t,n,Ve,ue(e,0,r),ue(e,r+1,-1),r)}var Ke=function(e,t,n){for(var r=0,i=0;r=i,i=xe(),38===r&&12===i&&(t[n]=1),!Oe(i);)Se();return _e(e,ge)},Qe=new WeakMap,Ye=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Qe.get(n))&&!r){Qe.set(e,!0);for(var i=[],a=function(e,t){return Te(function(e,t){var n=-1,r=44;do{switch(Oe(r)){case 0:38===r&&12===xe()&&(t[n]=1),e[n]+=Ke(ge-1,t,n);break;case 2:e[n]+=Ce(r);break;case 4:if(44===r){e[++n]=58===xe()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=re(r)}}while(r=Se());return e}(ke(e),t))}(t,i),o=n.props,s=0,l=0;s<a.length;s++)for(var u=0;u<o.length;u++,l++)e.props[l]=i[s]?a[s].replace(/&\f/g,o[u]):o[u]+" "+a[s]}}},Xe=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Je(e,t){switch(function(e,t){return 45^le(e,0)?(((t<<2^le(e,0))<<2^le(e,1))<<2^le(e,2))<<2^le(e,3):0}(e,t)){case 5103:return Me+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Me+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Me+e+Pe+e+Le+e+e;case 6828:case 4268:return Me+e+Le+e+e;case 6165:return Me+e+Le+"flex-"+e+e;case 5187:return Me+e+oe(e,/(\w+).+(:[^]+)/,Me+"box-$1$2"+Le+"flex-$1$2")+e;case 5443:return Me+e+Le+"flex-item-"+oe(e,/flex-|-self/,"")+e;case 4675:return Me+e+Le+"flex-line-pack"+oe(e,/align-content|flex-|-self/,"")+e;case 5548:return Me+e+Le+oe(e,"shrink","negative")+e;case 5292:return Me+e+Le+oe(e,"basis","preferred-size")+e;case 6060:return Me+"box-"+oe(e,"-grow","")+Me+e+Le+oe(e,"grow","positive")+e;case 4554:return Me+oe(e,/([^-])(transform)/g,"$1"+Me+"$2")+e;case 6187:return oe(oe(oe(e,/(zoom-|grab)/,Me+"$1"),/(image-set)/,Me+"$1"),e,"")+e;case 5495:case 3959:return oe(e,/(image-set\([^]*)/,Me+"$1$`$1");case 4968:return oe(oe(e,/(.+:)(flex-)?(.*)/,Me+"box-pack:$3"+Le+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Me+e+e;case 4095:case 3583:case 4068:case 2532:return oe(e,/(.+)-inline(.+)/,Me+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ce(e)-1-t>6)switch(le(e,t+1)){case 109:if(45!==le(e,t+4))break;case 102:return oe(e,/(.+:)(.+)-([^]+)/,"$1"+Me+"$2-$3$1"+Pe+(108==le(e,t+3)?"$3":"$2-$3"))+e;case 115:return~se(e,"stretch")?Je(oe(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==le(e,t+1))break;case 6444:switch(le(e,ce(e)-3-(~se(e,"!important")&&10))){case 107:return oe(e,":",":"+Me)+e;case 101:return oe(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Me+(45===le(e,14)?"inline-":"")+"box$3$1"+Me+"$2$3$1"+Le+"$2box$3")+e}break;case 5936:switch(le(e,t+11)){case 114:return Me+e+Le+oe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Me+e+Le+oe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Me+e+Le+oe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Me+e+Le+e+e}return e}var Ze=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Ve:e.return=Je(e.value,e.length);break;case $e:return Be([we(e,{value:oe(e.value,"@","@"+Me)})],r);case Fe:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return Be([we(e,{props:[oe(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Be([we(e,{props:[oe(t,/:(plac\w+)/,":"+Me+"input-$1")]}),we(e,{props:[oe(t,/:(plac\w+)/,":-moz-$1")]}),we(e,{props:[oe(t,/:(plac\w+)/,Le+"input-$1")]})],r)}return""}))}}],et={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var tt=/[A-Z]|^ms/g,nt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,rt=function(e){return 45===e.charCodeAt(1)},it=function(e){return null!=e&&"boolean"!=typeof e},at=function(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){return rt(e)?e:e.replace(tt,"-$&").toLowerCase()})),ot=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(nt,(function(e,t,n){return lt={name:t,styles:n,next:lt},t}))}return 1===et[e]||rt(e)||"number"!=typeof t||0===t?t:t+"px"};function st(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var i=n;if(1===i.anim)return lt={name:i.name,styles:i.styles,next:lt},i.name;var a=n;if(void 0!==a.styles){var o=a.next;if(void 0!==o)for(;void 0!==o;)lt={name:o.name,styles:o.styles,next:lt},o=o.next;return a.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=st(e,t,n[i])+";";else for(var a in n){var o=n[a];if("object"!=typeof o){var s=o;null!=t&&void 0!==t[s]?r+=a+"{"+t[s]+"}":it(s)&&(r+=at(a)+":"+ot(a,s)+";")}else if(!Array.isArray(o)||"string"!=typeof o[0]||null!=t&&void 0!==t[o[0]]){var l=st(e,t,o);switch(a){case"animation":case"animationName":r+=at(a)+":"+l+";";break;default:r+=a+"{"+l+"}"}}else for(var u=0;u<o.length;u++)it(o[u])&&(r+=at(a)+":"+ot(a,o[u])+";")}return r}(e,t,n);case"function":if(void 0!==e){var s=lt,l=n(e);return lt=s,st(e,t,l)}}var u=n;if(null==t)return u;var c=t[u];return void 0!==c?c:u}var lt,ut=/label:\s*([^\s;{]+)\s*(;|$)/g;function ct(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,i="";lt=void 0;var a=e[0];null==a||void 0===a.raw?(r=!1,i+=st(n,t,a)):i+=a[0];for(var o=1;o<e.length;o++)i+=st(n,t,e[o]),r&&(i+=a[o]);ut.lastIndex=0;for(var s,l="";null!==(s=ut.exec(i));)l+="-"+s[1];var u=function(e){for(var t,n=0,r=0,i=e.length;i>=4;++r,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(i)+l;return{name:u,styles:i,next:lt}}function dt(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")})),r}function ht(e,t){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0)}function ft(e,t,n){var r=[],i=dt(e,r,n);return r.length<2?n:i+t(r)}var pt=function e(t){for(var n="",r=0;r<t.length;r++){var i=t[r];if(null!=i){var a=void 0;switch(typeof i){case"boolean":break;case"object":if(Array.isArray(i))a=e(i);else for(var o in a="",i)i[o]&&o&&(a&&(a+=" "),a+=o);break;default:a=i}a&&(n&&(n+=" "),n+=a)}}return n},mt=function(e){var t=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r,i,a=e.stylisPlugins||Ze,o={},s=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)o[t[n]]=!0;s.push(e)}));var l,u,c,d,h=[ze,(d=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],f=(u=[Ye,Xe].concat(a,h),c=de(u),function(e,t,n,r){for(var i="",a=0;a<c;a++)i+=u[a](e,t,n,r)||"";return i});i=function(e,t,n,r){l=n,Be(Ue(e?e+"{"+t.styles+"}":t.styles),f),r&&(p.inserted[t.name]=!0)};var p={key:t,sheet:new te({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:i};return p.sheet.hydrate(s),p}({key:"css"});t.sheet.speedy=function(e){this.isSpeedy=e},t.compat=!0;var n=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=ct(n,t.registered,void 0);return function(e,t){!function(e,t){var n=e.key+"-"+t.name;void 0===e.registered[n]&&(e.registered[n]=t.styles)}(e,t);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+n:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,i),t.key+"-"+i.name};return{css:n,cx:function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return ft(t.registered,n,pt(r))},injectGlobal:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=ct(n,t.registered);ht(t,i)},keyframes:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=ct(n,t.registered),a="animation-"+i.name;return ht(t,{name:i.name,styles:"@keyframes "+a+"{"+i.styles+"}"}),a},hydrate:function(e){e.forEach((function(e){t.inserted[e]=!0}))},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:dt.bind(null,t.registered),merge:ft.bind(null,t.registered,n)}}(),gt=(mt.flush,mt.hydrate,mt.cx),vt=(mt.merge,mt.getRegisteredStyles,mt.injectGlobal,mt.keyframes),yt=mt.css;function bt(e){const{isAvailable:t,openAssistant:n}=Z();return t&&n?u().createElement(wt,{...e,openAssistant:n}):null}function wt({prompt:e,origin:t,context:n,autoSend:r=!0,title:i="Analyze with Assistant",size:a="sm",iconOnlyButton:o=!1,openAssistant:c,onClick:d}){const h=(0,ee.useStyles2)(St);return(0,l.useEffect)((()=>{(0,s.reportInteraction)("grafana_assistant_app_open_sidebar_button_displayed",{from:t})}),[t]),u().createElement(u().Fragment,null,o?u().createElement(ee.IconButton,{name:"ai-sparkle",onClick:()=>{null==d||d(),c({prompt:e,context:n,autoSend:r,origin:t})},variant:"secondary",size:a,"aria-label":i,className:h.icon,tooltip:i,"data-testid":"assistant-icon-button"}):u().createElement(ee.Button,{icon:"ai-sparkle",onClick:()=>{null==d||d(),c({prompt:e,context:n,autoSend:r,origin:t})},variant:"secondary",fill:"solid",size:a,title:i,"aria-label":i,className:h.button,"data-testid":"assistant-button"},i))}mt.sheet,mt.cache;const St=e=>{const t=e.colors.secondary.main,n=e.colors.emphasize(t,.05),r=e.colors.background.canvas,i=e.shape.radius.default,a=`max(calc(${i} - 1px), 1px)`,o={content:'""',position:"absolute",inset:0,borderRadius:i,background:"linear-gradient(90deg, rgb(168, 85, 247), rgb(249, 115, 22))",zIndex:-2,pointerEvents:"none"},s=e=>({content:'""',position:"absolute",inset:"1px",borderRadius:a,background:`linear-gradient(${e}, ${e}), ${r}`,zIndex:-1,transition:"none",pointerEvents:"none"});return{button:yt({label:"assistant-button",position:"relative",isolation:"isolate",border:"none",transition:"none !important","&::before":o,"&::after":{...s(t),transition:"none"},"&:hover":{transition:"none !important"},"&:hover::after":{background:`linear-gradient(${n}, ${n}), ${r}`}}),icon:yt({label:"assistant-icon",position:"relative",isolation:"isolate",border:"none",background:"none",padding:e.spacing(.5),"&::before":{...o,transition:"background 0.1s ease"},"&:hover::after":{...s(t),background:`linear-gradient(${n}, ${n}), ${r}`}})}};function xt(e){const{isAvailable:t,openAssistant:n}=Z();return t&&n?u().createElement(Et,{...e,openAssistant:n}):null}function Et({prompt:e,origin:t,context:n,autoSend:r=!0,title:i="Chat with Assistant",size:a="sm",onClick:o,menuItems:c,tooltip:d,openAssistant:h}){const f=(0,ee.useStyles2)(_t);(0,l.useEffect)((()=>{(0,s.reportInteraction)("grafana_assistant_app_open_sidebar_split_button_displayed",{from:t})}),[t]);const p=u().createElement("div",{className:f.wrapper},u().createElement(ee.ButtonGroup,{className:f.buttonGroup},u().createElement(ee.Button,{icon:"ai-sparkle",onClick:()=>{null==o||o(),h({prompt:e,context:n,autoSend:r,origin:t})},variant:"secondary",fill:"solid",size:a,"aria-label":i,"data-testid":"assistant-split-button-main"},i),c&&u().createElement(ee.Dropdown,{overlay:c},u().createElement(ee.Button,{variant:"secondary",icon:"angle-down",size:a,"aria-label":"More AI actions",className:f.dropdownButton,"data-testid":"assistant-split-button-dropdown"}))));return d?u().createElement(ee.Tooltip,{content:d},p):p}const _t=e=>{const t=e.colors.secondary.main,n=e.colors.emphasize(t,.05),r=e.colors.background.canvas,i=e.shape.radius.default;return{wrapper:yt({label:"assistant-split-button-wrapper",position:"relative",isolation:"isolate",display:"inline-block","&::before":{content:'""',position:"absolute",inset:0,borderRadius:i,background:"linear-gradient(90deg, rgb(168, 85, 247), rgb(249, 115, 22))",zIndex:-1,pointerEvents:"none"},"&::after":{content:'""',position:"absolute",inset:"1px",borderRadius:`max(calc(${i} - 1px), 1px)`,background:`linear-gradient(${t}, ${t}), ${r}`,zIndex:-1,pointerEvents:"none"},"&:hover::after":{background:`linear-gradient(${n}, ${n}), ${r}`}}),buttonGroup:yt({label:"assistant-split-button-group",gap:0,position:"relative",zIndex:1,"& button":{border:"none",background:"transparent !important","&:hover":{background:"transparent !important"}}}),dropdownButton:yt({padding:"0 6px"})}},Ot="__grafanaAssistantInlineFactory__",kt="__grafanaAssistantInlineInitializer__",Tt="__grafanaAssistantInlineInitPromise__";function Ct(e){const t=window[Ot];t&&t!==e?console.warn("InlineAssistant factory already set; ignoring subsequent setInlineAssistantFactory call"):t||(window[Ot]=e)}function It(e){const t=window[kt];t&&t!==e?console.warn("InlineAssistant initializer already set; ignoring subsequent setInlineAssistantInitializer call"):t||(window[kt]=e)}async function Rt(){if(window[Ot])return;const e=window[kt];if(!e)throw new Error("InlineAssistant not initialized. Make sure the Grafana Assistant plugin is loaded and initialized.");const t=window[Tt];if(t)return t;const n=(async()=>{try{await e()}catch(e){throw window[Tt]=null,e}})();return window[Tt]=n,n}function At(){const e=window[Ot];if(!e)throw new Error("InlineAssistant factory not initialized. Make sure the Grafana Assistant plugin is loaded.");return e}function Nt(){const[e,t]=(0,l.useState)(!1),[n,r]=(0,l.useState)(""),[i,a]=(0,l.useState)(null),o=(0,l.useRef)(null),s=(0,l.useCallback)((()=>{a(null),r("")}),[]),u=(0,l.useCallback)((()=>{o.current&&o.current.cancel(),t(!1)}),[]),c=(0,l.useCallback)((async e=>{var n;a(null),r(""),t(!0);try{await Rt();const n=At();o.current||(o.current=await n(e.origin)),await o.current.sendPrompt({prompt:e.prompt,systemPrompt:e.systemPrompt,onStart:()=>{t(!0)},onDelta:t=>{var n;r((e=>e+t)),null===(n=e.onDelta)||void 0===n||n.call(e,t)},onComplete:n=>{var i;r(n),t(!1),null===(i=e.onComplete)||void 0===i||i.call(e,n)},onError:n=>{var r;a(n),t(!1),null===(r=e.onError)||void 0===r||r.call(e,n)}})}catch(r){const i=r instanceof Error?r:new Error(String(r));a(i),t(!1),null===(n=e.onError)||void 0===n||n.call(e,i)}}),[]);return(0,l.useEffect)((()=>()=>{o.current&&(o.current.cancel(),o.current.dispose(),o.current=null)}),[]),{generate:c,isGenerating:e,content:n,error:i,cancel:u,reset:s}}const Dt=e=>{const t=["rgb(168, 85, 247)","rgb(249, 115, 22)"];if("dark"===e.name.toLowerCase()||"light"===e.name.toLowerCase())return t;const n=e.colors.gradients.brandHorizontal.match(/#[0-9A-Fa-f]{6}/g);return!n||n.length<2?t:[n[0],n[1]]},Lt=(e,t,n,r)=>{const i=Array.from({length:101},((e,t)=>t)),a={},[o,s]=Dt(e),l=null!=n?n:o,u=null!=r?r:s;return i.forEach((e=>{a[`${e}%`]={backgroundImage:`\n linear-gradient(${t}, ${t}),\n conic-gradient(from ${3.6*e}deg, transparent 60%, ${l} 80%, ${u} 100%, transparent 15%)\n `}})),a};function Pt({value:e,onChange:t,placeholder:n,origin:r,systemPrompt:i,onComplete:a,onError:o,onDelta:s,disabled:l=!1,className:c,"data-testid":d}){const{generate:h,isGenerating:f,error:p,reset:m}=Nt(),g=!e.trim()||l||f,v=(0,ee.useStyles2)(Mt),y=async()=>{if(g)return;const t=e.trim();m(),await h({prompt:t,origin:r,systemPrompt:i,onComplete:e=>{null==a||a(e)},onError:e=>{null==o||o(e)},onDelta:e=>{null==s||s(e)}})},b=u().createElement(ee.IconButton,{name:"ai-sparkle",onClick:y,disabled:g,tooltip:g?"Enter text to generate":"Generate with AI","data-testid":d?`${d}-send`:void 0});return u().createElement("div",{className:gt(v.wrapper,{[v.animatedWrapper]:f},c),"data-testid":d},u().createElement(ee.Input,{value:e,onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),y())},onChange:e=>t(e.currentTarget.value),placeholder:null!=n?n:"Ask AI to generate...",disabled:l||f,suffix:b,invalid:!!p,"data-testid":d?`${d}-input`:void 0}))}const Mt=e=>{const t=e.colors.background.primary,n=vt({label:"ai-input-border-animation",...Lt(e,t)}),[r,i]=Dt(e);return{wrapper:yt({label:"ai-text-input-wrapper",position:"relative",borderRadius:e.shape.radius.default}),animatedWrapper:yt({label:"ai-text-input-animated",border:"1px solid transparent",backgroundImage:`\n linear-gradient(${t}, ${t}),\n conic-gradient(from 0deg, transparent 60%, ${r} 80%, ${i} 100%, transparent 15%)\n `,backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",animation:`${n} 2s linear infinite`,"& input":{border:"none !important"}})}};function jt({value:e,onChange:t,placeholder:n,origin:r,systemPrompt:i,onComplete:a,onError:o,onDelta:s,disabled:l=!1,rows:c=4,className:d,"data-testid":h}){const{generate:f,isGenerating:p,error:m,reset:g}=Nt(),v=!e.trim()||l||p,y=(0,ee.useStyles2)(Ft),b=async()=>{if(v)return;const t=e.trim();g(),await f({prompt:t,origin:r,systemPrompt:i,onComplete:e=>{null==a||a(e)},onError:e=>{null==o||o(e)},onDelta:e=>{null==s||s(e)}})};return u().createElement("div",{className:gt(y.textareaWrapper,{[y.animatedWrapper]:p},d),"data-testid":h},u().createElement(ee.TextArea,{value:e,onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),b())},onChange:e=>t(e.currentTarget.value),placeholder:null!=n?n:"Ask AI to generate... (Cmd/Ctrl+Enter to send)",disabled:l||p,rows:c,className:y.textarea,invalid:!!m,"data-testid":h?`${h}-textarea`:void 0}),u().createElement(ee.IconButton,{name:"ai-sparkle",onClick:b,disabled:v,className:y.sendButton,"aria-label":"Generate with AI",tooltip:v?"Enter text to generate":"Generate with AI (Cmd/Ctrl+Enter)","data-testid":h?`${h}-send`:void 0}))}const Ft=e=>{const t=e.colors.background.primary,n=vt({label:"ai-textarea-border-animation",...Lt(e,t)}),[r,i]=Dt(e);return{textareaWrapper:yt({label:"ai-textarea-wrapper",position:"relative",borderRadius:e.shape.radius.default}),animatedWrapper:yt({label:"ai-textarea-animated",border:"1px solid transparent",backgroundImage:`\n linear-gradient(${t}, ${t}),\n conic-gradient(from 0deg, transparent 60%, ${r} 80%, ${i} 100%, transparent 15%)\n `,backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",animation:`${n} 2s linear infinite`,"& textarea":{border:"none !important"}}),textarea:yt({label:"ai-textarea",paddingRight:e.spacing(4),scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),sendButton:yt({label:"ai-textarea-send",position:"absolute",right:e.spacing(1),top:e.spacing(1)})}};e.exports=r})()},7945:(e,t,n)=>{"use strict";n.d(t,{Tp:()=>i});const r={RadioButton:{container:"data-testid radio-button"},Breadcrumbs:{breadcrumb:e=>`data-testid ${e} breadcrumb`},TimePicker:{openButton:"data-testid TimePicker Open Button",overlayContent:"data-testid TimePicker Overlay Content",fromField:"data-testid Time Range from field",toField:"data-testid Time Range to field",applyTimeRange:"data-testid TimePicker submit button",copyTimeRange:"data-testid TimePicker copy button",pasteTimeRange:"data-testid TimePicker paste button",calendar:{label:"data-testid Time Range calendar",openButton:"data-testid Open time range calendar",closeButton:"data-testid Close time range Calendar"},absoluteTimeRangeTitle:"data-testid-absolute-time-range-narrow"},DataSourcePermissions:{form:()=>'form[name="addPermission"]',roleType:"Role to add new permission to",rolePicker:"Built-in role picker",permissionLevel:"Permission Level"},DateTimePicker:{input:"data-testid date-time-input"},DataSource:{TestData:{QueryTab:{scenarioSelectContainer:"Test Data Query scenario select container",scenarioSelect:"Test Data Query scenario select",max:"TestData max",min:"TestData min",noise:"TestData noise",seriesCount:"TestData series count",spread:"TestData spread",startValue:"TestData start value",drop:"TestData drop values"}},DataSourceHttpSettings:{urlInput:"data-testid Datasource HTTP settings url"},Jaeger:{traceIDInput:"Trace ID"},Prometheus:{configPage:{connectionSettings:"Data source connection URL",manageAlerts:"prometheus-alerts-manager",scrapeInterval:"data-testid scrape interval",queryTimeout:"data-testid query timeout",defaultEditor:"data-testid default editor",disableMetricLookup:"disable-metric-lookup",prometheusType:"data-testid prometheus type",prometheusVersion:"data-testid prometheus version",cacheLevel:"data-testid cache level",incrementalQuerying:"prometheus-incremental-querying",queryOverlapWindow:"data-testid query overlap window",disableRecordingRules:"disable-recording-rules",customQueryParameters:"data-testid custom query parameters",httpMethod:"data-testid http method",exemplarsAddButton:"data-testid Add exemplar config button",internalLinkSwitch:"data-testid Internal link switch"},queryEditor:{explain:"data-testid prometheus explain switch wrapper",editorToggle:"data-testid QueryEditorModeToggle",options:"data-testid prometheus options",legend:"data-testid prometheus legend wrapper",format:"data-testid prometheus format",step:"prometheus-step",type:"data-testid prometheus type",exemplars:"prometheus-exemplars",builder:{metricSelect:"data-testid metric select",hints:"data-testid prometheus hints",metricsExplorer:"data-testid metrics explorer",queryAdvisor:"data-testid query advisor"},code:{queryField:"data-testid prometheus query field",metricsBrowser:{openButton:"data-testid open metrics browser",selectMetric:"data-testid select a metric",metricList:"data-testid metric list",labelNamesFilter:"data-testid label names filter",labelValuesFilter:"data-testid label values filter",useQuery:"data-testid use query",useAsRateQuery:"data-testid use as rate query",validateSelector:"data-testid validate selector",clear:"data-testid clear"}}},exemplarMarker:"data-testid Exemplar marker",variableQueryEditor:{queryType:"data-testid query type",labelnames:{metricRegex:"data-testid label names metric regex"},labelValues:{labelSelect:"data-testid label values label select"},metricNames:{metricRegex:"data-testid metric names metric regex"},varQueryResult:"data-testid variable query result",seriesQuery:"data-testid prometheus series query",classicQuery:"data-testid prometheus classic query"},annotations:{minStep:"prometheus-annotation-min-step",title:"data-testid prometheus annotation title",tags:"data-testid prometheus annotation tags",text:"data-testid prometheus annotation text",seriesValueAsTimestamp:"data-testid prometheus annotation series value as timestamp"}}},Menu:{MenuComponent:e=>`${e} menu`,MenuGroup:e=>`${e} menu group`,MenuItem:e=>`${e} menu item`,SubMenu:{container:"data-testid SubMenu container",icon:"data-testid SubMenu icon"}},Panels:{Panel:{title:e=>`data-testid Panel header ${e}`,headerItems:e=>`data-testid Panel header item ${e}`,menuItems:e=>`data-testid Panel menu item ${e}`,menu:e=>`data-testid Panel menu ${e}`,containerByTitle:e=>`${e} panel`,headerCornerInfo:e=>`Panel header ${e}`,status:e=>`data-testid Panel status ${e}`,loadingBar:()=>"Panel loading bar",HoverWidget:{container:"data-testid hover-header-container",dragIcon:"data-testid drag-icon"},PanelDataErrorMessage:"data-testid Panel data error message"},Visualization:{Graph:{container:"Graph container",VisualizationTab:{legendSection:"Legend section"},Legend:{legendItemAlias:e=>`gpl alias ${e}`,showLegendSwitch:"gpl show legend"},xAxis:{labels:()=>"div.flot-x-axis > div.flot-tick-label"}},BarGauge:{value:"Bar gauge value",valueV2:"data-testid Bar gauge value"},PieChart:{svgSlice:"data testid Pie Chart Slice"},Text:{container:()=>".markdown-html"},Table:{header:"table header",footer:"table-footer",body:"data-testid table body"}}},VizLegend:{seriesName:e=>`data-testid VizLegend series ${e}`},Drawer:{General:{title:e=>`Drawer title ${e}`,expand:"Drawer expand",contract:"Drawer contract",close:"data-testid Drawer close",rcContentWrapper:()=>".rc-drawer-content-wrapper",subtitle:"data-testid drawer subtitle"}},PanelEditor:{General:{content:"Panel editor content"},OptionsPane:{content:"Panel editor option pane content",select:"Panel editor option pane select",fieldLabel:e=>`${e} field property editor`},DataPane:{content:"Panel editor data pane content"},applyButton:"data-testid Apply changes and go back to dashboard",toggleVizPicker:"data-testid toggle-viz-picker",toggleVizOptions:"data-testid toggle-viz-options",toggleTableView:"toggle-table-view",showZoomField:"Map controls Show zoom control field property editor",showAttributionField:"Map controls Show attribution field property editor",showScaleField:"Map controls Show scale field property editor",showMeasureField:"Map controls Show measure tools field property editor",showDebugField:"Map controls Show debug field property editor",measureButton:"show measure tools"},PanelInspector:{Data:{content:"Panel inspector Data content"},Stats:{content:"Panel inspector Stats content"},Json:{content:"Panel inspector Json content"},Query:{content:"Panel inspector Query content",refreshButton:"Panel inspector Query refresh button",jsonObjectKeys:()=>".json-formatter-key"}},Tab:{title:e=>`Tab ${e}`,active:()=>'[class*="-activeTabStyle"]'},RefreshPicker:{runButton:"RefreshPicker run button",intervalButton:"RefreshPicker interval button",runButtonV2:"data-testid RefreshPicker run button",intervalButtonV2:"data-testid RefreshPicker interval button"},QueryTab:{content:"Query editor tab content",queryInspectorButton:"Query inspector button",queryHistoryButton:"data-testid query-history-button",addQuery:"data-testid query-tab-add-query"},QueryHistory:{queryText:"Query text"},QueryEditorRows:{rows:"Query editor row"},QueryEditorRow:{actionButton:e=>`data-testid ${e}`,title:e=>`Query editor row title ${e}`,container:e=>`Query editor row ${e}`},AlertTab:{content:"data-testid Alert editor tab content"},Alert:{alert:e=>`Alert ${e}`,alertV2:e=>`data-testid Alert ${e}`},TransformTab:{content:"data-testid Transform editor tab content",newTransform:e=>`data-testid New transform ${e}`,transformationEditor:e=>`data-testid Transformation editor ${e}`,transformationEditorDebugger:e=>`data-testid Transformation editor debugger ${e}`},Transforms:{card:e=>`data-testid New transform ${e}`,disableTransformationButton:"data-testid Disable transformation button",Reduce:{modeLabel:"data-testid Transform mode label",calculationsLabel:"data-testid Transform calculations label"},SpatialOperations:{actionLabel:"root Action field property editor",locationLabel:"root Location Mode field property editor",location:{autoOption:"Auto location option",coords:{option:"Coords location option",latitudeFieldLabel:"root Latitude field field property editor",longitudeFieldLabel:"root Longitude field field property editor"},geohash:{option:"Geohash location option",geohashFieldLabel:"root Geohash field field property editor"},lookup:{option:"Lookup location option",lookupFieldLabel:"root Lookup field field property editor",gazetteerFieldLabel:"root Gazetteer field property editor"}}},searchInput:"data-testid search transformations",noTransformationsMessage:"data-testid no transformations message",addTransformationButton:"data-testid add transformation button",removeAllTransformationsButton:"data-testid remove all transformations button"},NavBar:{Configuration:{button:"Configuration"},Toggle:{button:"data-testid Toggle menu"},Reporting:{button:"Reporting"}},NavMenu:{Menu:"data-testid navigation mega-menu",item:"data-testid Nav menu item"},NavToolbar:{container:"data-testid Nav toolbar"},PageToolbar:{container:()=>".page-toolbar",item:e=>`${e}`,itemButton:e=>`data-testid ${e}`},QueryEditorToolbarItem:{button:e=>`QueryEditor toolbar item button ${e}`},BackButton:{backArrow:"data-testid Go Back"},OptionsGroup:{group:e=>e?`Options group ${e}`:"Options group",toggle:e=>e?`Options group ${e} toggle`:"Options group toggle"},PluginVisualization:{item:e=>`Plugin visualization item ${e}`,current:()=>'[class*="-currentVisualizationItem"]'},Select:{option:"Select option",input:()=>'input[id*="time-options-input"]',singleValue:()=>'div[class*="-singleValue"]'},FieldConfigEditor:{content:"Field config editor content"},OverridesConfigEditor:{content:"Field overrides editor content"},FolderPicker:{container:"Folder picker select container",containerV2:"data-testid Folder picker select container",input:"data-testid folder-picker-input"},ReadonlyFolderPicker:{container:"data-testid Readonly folder picker select container"},DataSourcePicker:{container:"data-testid Data source picker select container",input:()=>'input[id="data-source-picker"]',inputV2:"data-testid Select a data source",dataSourceList:"data-testid Data source list dropdown",advancedModal:{dataSourceList:"data-testid Data source list",builtInDataSourceList:"data-testid Built in data source list"}},TimeZonePicker:{container:"Time zone picker select container",containerV2:"data-testid Time zone picker select container"},WeekStartPicker:{container:"Choose starting day of the week",containerV2:"data-testid Choose starting day of the week",placeholder:"Choose starting day of the week"},TraceViewer:{spanBar:"data-testid SpanBar--wrapper"},QueryField:{container:"data-testid Query field"},QueryBuilder:{queryPatterns:"data-testid Query patterns",labelSelect:"data-testid Select label",valueSelect:"data-testid Select value",matchOperatorSelect:"data-testid Select match operator"},ValuePicker:{button:e=>`data-testid Value picker button ${e}`,select:e=>`data-testid Value picker select ${e}`},Search:{section:"Search section",sectionV2:"data-testid Search section",items:"Search items",itemsV2:"data-testid Search items",cards:"data-testid Search cards",collapseFolder:e=>`data-testid Collapse folder ${e}`,expandFolder:e=>`data-testid Expand folder ${e}`,dashboardItem:e=>`${r.Search.dashboardItems} ${e}`,dashboardCard:e=>`data-testid Search card ${e}`,folderHeader:e=>`data-testid Folder header ${e}`,folderContent:e=>`data-testid Folder content ${e}`,dashboardItems:"data-testid Dashboard search item"},DashboardLinks:{container:"data-testid Dashboard link container",dropDown:"data-testid Dashboard link dropdown",link:"data-testid Dashboard link"},LoadingIndicator:{icon:"data-testid Loading indicator"},CallToActionCard:{button:e=>`Call to action button ${e}`,buttonV2:e=>`data-testid Call to action button ${e}`},DataLinksContextMenu:{singleLink:"data-testid Data link"},CodeEditor:{container:"data-testid Code editor container"},DashboardImportPage:{textarea:"data-testid-import-dashboard-textarea",submit:"data-testid-load-dashboard"},ImportDashboardForm:{name:"data-testid-import-dashboard-title",submit:"data-testid-import-dashboard-submit"},PanelAlertTabContent:{content:"data-testid Unified alert editor tab content"},VisualizationPreview:{card:e=>`data-testid suggestion-${e}`},ColorSwatch:{name:"data-testid-colorswatch"},DashboardRow:{title:e=>`data-testid dashboard-row-title-${e}`},UserProfile:{profileSaveButton:"data-testid-user-profile-save",preferencesSaveButton:"data-testid-shared-prefs-save",orgsTable:"data-testid-user-orgs-table",sessionsTable:"data-testid-user-sessions-table",extensionPointTabs:"data-testid-extension-point-tabs",extensionPointTab:e=>`data-testid-extension-point-tab-${e}`},FileUpload:{inputField:"data-testid-file-upload-input-field",fileNameSpan:"data-testid-file-upload-file-name"},DebugOverlay:{wrapper:"debug-overlay"},OrgRolePicker:{input:"Role"},AnalyticsToolbarButton:{button:"Dashboard insights"},Variables:{variableOption:"data-testid variable-option"},Annotations:{annotationsTypeInput:"annotations-type-input",annotationsChoosePanelInput:"choose-panels-input"},Tooltip:{container:"data-testid tooltip"}},i={pages:{Login:{url:"/login",username:"data-testid Username input field",password:"data-testid Password input field",submit:"data-testid Login button",skip:"data-testid Skip change password button"},Home:{url:"/"},DataSource:{name:"data-testid Data source settings page name input field",delete:"Data source settings page Delete button",readOnly:"data-testid Data source settings page read only message",saveAndTest:"data-testid Data source settings page Save and Test button",alert:"data-testid Data source settings page Alert"},DataSources:{url:"/datasources",dataSources:e=>`Data source list item ${e}`},EditDataSource:{url:e=>`/datasources/edit/${e}`,settings:"Datasource settings page basic settings"},AddDataSource:{url:"/datasources/new",dataSourcePlugins:e=>`Data source plugin item ${e}`,dataSourcePluginsV2:e=>`Add new data source ${e}`},ConfirmModal:{delete:"data-testid Confirm Modal Danger Button"},AddDashboard:{url:"/dashboard/new",itemButton:e=>`data-testid ${e}`,addNewPanel:"Add new panel",addNewRow:"Add new row",addNewPanelLibrary:"Add new panel from panel library"},Dashboard:{url:e=>`/d/${e}`,DashNav:{nav:"Dashboard navigation",navV2:"data-testid Dashboard navigation",publicDashboardTag:"data-testid public dashboard tag",shareButton:"data-testid share-button"},SubMenu:{submenu:"Dashboard submenu",submenuItem:"data-testid template variable",submenuItemLabels:e=>`data-testid Dashboard template variables submenu Label ${e}`,submenuItemValueDropDownValueLinkTexts:e=>`data-testid Dashboard template variables Variable Value DropDown value link text ${e}`,submenuItemValueDropDownDropDown:"Variable options",submenuItemValueDropDownOptionTexts:e=>`data-testid Dashboard template variables Variable Value DropDown option text ${e}`,Annotations:{annotationsWrapper:"data-testid annotation-wrapper",annotationLabel:e=>`data-testid Dashboard annotations submenu Label ${e}`,annotationToggle:e=>`data-testid Dashboard annotations submenu Toggle ${e}`}},Settings:{Actions:{close:"data-testid dashboard-settings-close"},General:{deleteDashBoard:"Dashboard settings page delete dashboard button",sectionItems:e=>`Dashboard settings section item ${e}`,saveDashBoard:"Dashboard settings aside actions Save button",saveAsDashBoard:"Dashboard settings aside actions Save As button",timezone:"Time zone picker select container",title:"Tab General"},Annotations:{List:{addAnnotationCTA:r.CallToActionCard.button("Add annotation query"),addAnnotationCTAV2:r.CallToActionCard.buttonV2("Add annotation query"),annotations:"data-testid list-annotations"},Settings:{name:"Annotations settings name input"},NewAnnotation:{panelFilterSelect:"data-testid annotations-panel-filter",showInLabel:"show-in-label",previewInDashboard:"data-testid annotations-preview",delete:"data-testid annotations-delete",apply:"data-testid annotations-apply",enable:"data-testid annotation-enable",hide:"data-testid annotation-hide"}},Variables:{List:{addVariableCTA:r.CallToActionCard.button("Add variable"),addVariableCTAV2:r.CallToActionCard.buttonV2("Add variable"),newButton:"Variable editor New variable button",table:"Variable editor Table",tableRowNameFields:e=>`Variable editor Table Name field ${e}`,tableRowDefinitionFields:e=>`Variable editor Table Definition field ${e}`,tableRowArrowUpButtons:e=>`Variable editor Table ArrowUp button ${e}`,tableRowArrowDownButtons:e=>`Variable editor Table ArrowDown button ${e}`,tableRowDuplicateButtons:e=>`Variable editor Table Duplicate button ${e}`,tableRowRemoveButtons:e=>`Variable editor Table Remove button ${e}`},Edit:{General:{headerLink:"Variable editor Header link",modeLabelNew:"Variable editor Header mode New",modeLabelEdit:"Variable editor Header mode Edit",generalNameInput:"Variable editor Form Name field",generalNameInputV2:"data-testid Variable editor Form Name field",generalTypeSelect:"Variable editor Form Type select",generalTypeSelectV2:"data-testid Variable editor Form Type select",generalLabelInput:"Variable editor Form Label field",generalLabelInputV2:"data-testid Variable editor Form Label field",generalHideSelect:"Variable editor Form Hide select",generalHideSelectV2:"data-testid Variable editor Form Hide select",selectionOptionsMultiSwitch:"data-testid Variable editor Form Multi switch",selectionOptionsIncludeAllSwitch:"data-testid Variable editor Form IncludeAll switch",selectionOptionsCustomAllInput:"data-testid Variable editor Form IncludeAll field",previewOfValuesOption:"data-testid Variable editor Preview of Values option",submitButton:"data-testid Variable editor Run Query button",applyButton:"data-testid Variable editor Apply button"},QueryVariable:{queryOptionsDataSourceSelect:r.DataSourcePicker.inputV2,queryOptionsRefreshSelect:"Variable editor Form Query Refresh select",queryOptionsRefreshSelectV2:"data-testid Variable editor Form Query Refresh select",queryOptionsRegExInput:"Variable editor Form Query RegEx field",queryOptionsRegExInputV2:"data-testid Variable editor Form Query RegEx field",queryOptionsSortSelect:"Variable editor Form Query Sort select",queryOptionsSortSelectV2:"data-testid Variable editor Form Query Sort select",queryOptionsQueryInput:"data-testid Variable editor Form Default Variable Query Editor textarea",valueGroupsTagsEnabledSwitch:"Variable editor Form Query UseTags switch",valueGroupsTagsTagsQueryInput:"Variable editor Form Query TagsQuery field",valueGroupsTagsTagsValuesQueryInput:"Variable editor Form Query TagsValuesQuery field"},ConstantVariable:{constantOptionsQueryInput:"Variable editor Form Constant Query field",constantOptionsQueryInputV2:"data-testid Variable editor Form Constant Query field"},DatasourceVariable:{datasourceSelect:"data-testid datasource variable datasource type"},TextBoxVariable:{textBoxOptionsQueryInput:"Variable editor Form TextBox Query field",textBoxOptionsQueryInputV2:"data-testid Variable editor Form TextBox Query field"},CustomVariable:{customValueInput:"data-testid custom-variable-input"},IntervalVariable:{intervalsValueInput:"data-testid interval variable intervals input",autoEnabledCheckbox:"data-testid interval variable auto value checkbox",stepCountIntervalSelect:"data-testid interval variable step count input",minIntervalInput:"data-testid interval variable mininum interval input"},GroupByVariable:{dataSourceSelect:r.DataSourcePicker.inputV2,infoText:"data-testid group by variable info text",modeToggle:"data-testid group by variable mode toggle"},AdHocFiltersVariable:{datasourceSelect:r.DataSourcePicker.inputV2,infoText:"data-testid ad-hoc filters variable info text"}}}},Annotations:{marker:"data-testid annotation-marker"},Rows:{Repeated:{ConfigSection:{warningMessage:"data-testid Repeated rows warning message"}}}},Dashboards:{url:"/dashboards",dashboards:e=>`Dashboard search item ${e}`},SaveDashboardAsModal:{newName:"Save dashboard title field",save:"Save dashboard button"},SaveDashboardModal:{save:"Dashboard settings Save Dashboard Modal Save button",saveVariables:"Dashboard settings Save Dashboard Modal Save variables checkbox",saveTimerange:"Dashboard settings Save Dashboard Modal Save timerange checkbox"},SharePanelModal:{linkToRenderedImage:"Link to rendered image"},ShareDashboardModal:{PublicDashboard:{Tab:"Tab Public dashboard",WillBePublicCheckbox:"data-testid public dashboard will be public checkbox",LimitedDSCheckbox:"data-testid public dashboard limited datasources checkbox",CostIncreaseCheckbox:"data-testid public dashboard cost may increase checkbox",PauseSwitch:"data-testid public dashboard pause switch",EnableAnnotationsSwitch:"data-testid public dashboard on off switch for annotations",CreateButton:"data-testid public dashboard create button",DeleteButton:"data-testid public dashboard delete button",CopyUrlInput:"data-testid public dashboard copy url input",CopyUrlButton:"data-testid public dashboard copy url button",SettingsDropdown:"data-testid public dashboard settings dropdown",TemplateVariablesWarningAlert:"data-testid public dashboard disabled template variables alert",UnsupportedDataSourcesWarningAlert:"data-testid public dashboard unsupported data sources alert",NoUpsertPermissionsWarningAlert:"data-testid public dashboard no upsert permissions alert",EnableTimeRangeSwitch:"data-testid public dashboard on off switch for time range",EmailSharingConfiguration:{Container:"data-testid email sharing config container",ShareType:"data-testid public dashboard share type",EmailSharingInput:"data-testid public dashboard email sharing input",EmailSharingInviteButton:"data-testid public dashboard email sharing invite button",EmailSharingList:"data-testid public dashboard email sharing list",DeleteEmail:"data-testid public dashboard delete email button",ReshareLink:"data-testid public dashboard reshare link button"}}},PublicDashboard:{page:"public-dashboard-page",NotAvailable:{container:"public-dashboard-not-available",title:"public-dashboard-title",pausedDescription:"public-dashboard-paused-description"}},RequestViewAccess:{form:"request-view-access-form",recipientInput:"request-view-access-recipient-input",submitButton:"request-view-access-submit-button"},PublicDashboardConfirmAccess:{submitButton:"data-testid confirm-access-submit-button"},Explore:{url:"/explore",General:{container:"data-testid Explore",graph:"Explore Graph",table:"Explore Table",scrollView:"data-testid explorer scroll view"}},SoloPanel:{url:e=>`/d-solo/${e}`},PluginsList:{page:"Plugins list page",list:"Plugins list",listItem:"Plugins list item",signatureErrorNotice:"data-testid Unsigned plugins notice"},PluginPage:{page:"Plugin page",signatureInfo:"data-testid Plugin signature info",disabledInfo:"data-testid Plugin disabled info"},PlaylistForm:{name:"Playlist name",interval:"Playlist interval",itemDelete:"data-testid playlist-form-delete-item"},BrowseDashboards:{table:{body:"data-testid browse-dashboards-table",row:e=>`data-testid browse dashboards row ${e}`,checkbox:e=>`data-testid ${e} checkbox`},NewFolderForm:{form:"data-testid new folder form",nameInput:"data-testid new-folder-name-input",createButton:"data-testid new-folder-create-button"}},Search:{url:"/?search=openn",FolderView:{url:"/?search=open&layout=folders"}},PublicDashboards:{ListItem:{linkButton:"public-dashboard-link-button",configButton:"public-dashboard-configuration-button",trashcanButton:"public-dashboard-remove-button",pauseSwitch:"data-testid public dashboard pause switch"}},UserListPage:{tabs:{allUsers:"data-testid all-users-tab",orgUsers:"data-testid org-users-tab",anonUserDevices:"data-testid anon-user-devices-tab",publicDashboardsUsers:"data-testid public-dashboards-users-tab",users:"data-testid users-tab"},org:{url:"/org/users"},admin:{url:"/admin/users"},publicDashboards:{container:"data-testid public-dashboards-users-list"},UserListAdminPage:{container:"data-testid user-list-admin-page"},UsersListPage:{container:"data-testid users-list-page"},UserAnonListPage:{container:"data-testid user-anon-list-page"},UsersListPublicDashboardsPage:{container:"data-testid users-list-public-dashboards-page",DashboardsListModal:{listItem:e=>`data-testid dashboards-list-item-${e}`}}},ProfilePage:{url:"/profile"}},components:r}},4557:(e,t,n)=>{"use strict";n.d(t,{$g:()=>i,OV:()=>r,_G:()=>a,vX:()=>o});const r="user-action-start",i="user-action-end",a="user-action-cancel",o="user-action-halt"},3890:(e,t,n)=>{"use strict";n.d(t,{n:()=>o,x:()=>a});var r=n(2019),i=n(129);const a="Error",o=e=>e.map((e=>(0,r.Gv)(e)?(0,i.xD)(e):String(e))).join(" ")},8981:(e,t,n)=>{"use strict";n.d(t,{Q:()=>v,X:()=>y});var r=n(3116),i=n(4915),a=n(129),o=n(2019),s=n(9607),l=n(7697),u=n(4557);var c=n(3890);let d;function h({internalLogger:e,config:t,metas:n,transports:r,tracesApi:h,actionBuffer:f,getMessage:p}){var m;e.debug("Initializing exceptions API");let g=null;d=null!==(m=t.parseStacktrace)&&void 0!==m?m:d;const v=t=>{e.debug("Changing stacktrace parser"),d=null!=t?t:d},{ignoreErrors:y=[],preserveOriginalError:b}=t;return v(t.parseStacktrace),{changeStacktraceParser:v,getStacktraceParser:()=>d,pushError:(m,{skipDedupe:v,stackFrames:w,type:S,context:x,spanContext:E,timestampOverwriteMs:_,originalError:O}={})=>{if(!function(e,t){const{message:n,name:r,stack:i}=t;return a=e,s=n+" "+r+" "+i,a.some((e=>(0,o.Kg)(e)?s.includes(e):!!s.match(e)));var a,s}(y,null!=O?O:m))try{const y=(0,a.Ti)(Object.assign(Object.assign({},function(e){let t=e.cause;(0,o.bJ)(t)?t=e.cause.toString():null!==t&&((0,o.Gv)(e.cause)||(0,o.cy)(e.cause))?t=(0,a.xD)(e.cause):null!=t&&(t=e.cause.toString());return null==t?{}:{cause:t}}(null!=O?O:m)),null!=x?x:{})),k={meta:n.value,payload:Object.assign(Object.assign({type:S||m.name||c.x,value:m.message,timestamp:_?(0,s.q5)(_):(0,s.mI)(),trace:E?{trace_id:E.traceId,span_id:E.spanId}:h.getTraceContext()},(0,o.Im)(y)?{}:{context:y}),b?{originalError:O}:{}),type:i.f.EXCEPTION};(null==(w=null!=w?w:m.stack?null==d?void 0:d(m).frames:void 0)?void 0:w.length)&&(k.payload.stacktrace={frames:w});const T={type:k.payload.type,value:k.payload.value,stackTrace:k.payload.stacktrace,context:k.payload.context};if(!v&&t.dedupe&&!(0,o.kZ)(g)&&(0,l.b)(T,g))return void e.debug("Skipping error push because it is the same as the last one\n",k.payload);g=T,e.debug("Pushing exception\n",k);const C=p();C&&C.type===u.OV?f.addItem(k):r.execute(k)}catch(t){e.error("Error pushing event",t)}}}}var f=n(5438),p=n(3191);class m{constructor(){this.buffer=[]}addItem(e){this.buffer.push(e)}flushBuffer(e){if((0,o.Tn)(e))for(const t of this.buffer)e(t);this.buffer.length=0}size(){return this.buffer.length}}function g({apiMessageBus:e,transports:t,config:n}){const r=new m,a=n.trackUserActionsExcludeItem;let o;e.subscribe((e=>{if(u.OV!==e.type&&u.vX!==e.type){if(e.type===u.$g){const{id:n,name:s}=e;return r.flushBuffer((e=>{if(function(e,t){return(null==t?void 0:t(e))||e.type===i.f.MEASUREMENT&&"web-vitals"===e.payload.type}(e,a))return void t.execute(e);const r=Object.assign(Object.assign({},e),{payload:Object.assign(Object.assign({},e.payload),{action:{parentId:n,name:s}})});t.execute(r)})),void(o=void 0)}e.type===u._G&&(o=void 0,r.flushBuffer((e=>{t.execute(e)})))}else o=e}));return{actionBuffer:r,getMessage:()=>o}}const v=new r.c;function y(e,t,n,r,c){t.debug("Initializing API");const{actionBuffer:d,getMessage:m}=g({apiMessageBus:v,transports:c,config:n}),y=function(e,t,n,r,a){let o;return t.debug("Initializing traces API"),{getOTEL:()=>o,getTraceContext:()=>{const e=null==o?void 0:o.trace.getSpanContext(o.context.active());return e?{trace_id:e.traceId,span_id:e.spanId}:void 0},initOTEL:(e,n)=>{t.debug("Initializing OpenTelemetry"),o={trace:e,context:n}},isOTELInitialized:()=>!!o,pushTraces:e=>{try{const n={type:i.f.TRACE,payload:e,meta:r.value};t.debug("Pushing trace\n",n),a.execute(n)}catch(e){t.error("Error pushing trace\n",e)}}}}(0,t,0,r,c),b={unpatchedConsole:e,internalLogger:t,config:n,metas:r,transports:c,tracesApi:y,actionBuffer:d,getMessage:m};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},y),h(b)),function({internalLogger:e,metas:t}){let n,r,i,a;e.debug("Initializing meta API");const s=e=>{r&&t.remove(r),r={user:e},t.add(r)},l=(e,r)=>{var i;const a=null==r?void 0:r.overrides,s=a?{overrides:Object.assign(Object.assign({},null===(i=null==n?void 0:n.session)||void 0===i?void 0:i.overrides),a)}:{};n&&t.remove(n),n={session:Object.assign(Object.assign({},(0,o.Im)(e)?void 0:e),s)},t.add(n)},u=()=>t.value.session,c=()=>t.value.page;return{setUser:s,resetUser:s,setSession:l,resetSession:l,getSession:u,setView:(e,n)=>{var r;if((null==n?void 0:n.overrides)&&l(u(),{overrides:n.overrides}),(null===(r=null==i?void 0:i.view)||void 0===r?void 0:r.name)===(null==e?void 0:e.name))return;const a=i;i={view:e},t.add(i),a&&t.remove(a)},getView:()=>t.value.view,setPage:e=>{var n;const r=(0,o.Kg)(e)?Object.assign(Object.assign({},null!==(n=null==a?void 0:a.page)&&void 0!==n?n:c()),{id:e}):e;a&&t.remove(a),a={page:r},t.add(a)},getPage:c}}(b)),function({internalLogger:e,config:t,metas:n,transports:r,tracesApi:c,actionBuffer:d,getMessage:h}){var m;e.debug("Initializing logs API");let g=null;const v=null!==(m=t.logArgsSerializer)&&void 0!==m?m:p.Z;return{pushLog:(p,{context:m,level:y,skipDedupe:b,spanContext:w,timestampOverwriteMs:S}={})=>{try{const x=(0,a.Ti)(m),E={type:i.f.LOG,payload:{message:v(p),level:null!=y?y:f.Ic,context:(0,o.Im)(x)?void 0:x,timestamp:S?(0,s.q5)(S):(0,s.mI)(),trace:w?{trace_id:w.traceId,span_id:w.spanId}:c.getTraceContext()},meta:n.value},_={message:E.payload.message,level:E.payload.level,context:E.payload.context};if(!b&&t.dedupe&&!(0,o.kZ)(g)&&(0,l.b)(_,g))return void e.debug("Skipping log push because it is the same as the last one\n",E.payload);g=_,e.debug("Pushing log\n",E);const O=h();O&&O.type===u.OV?d.addItem(E):r.execute(E)}catch(t){e.error("Error pushing log\n",t)}}}}(b)),function({internalLogger:e,config:t,metas:n,transports:r,tracesApi:c,actionBuffer:d,getMessage:h}){e.debug("Initializing measurements API");let f=null;return{pushMeasurement:(p,{skipDedupe:m,context:g,spanContext:v,timestampOverwriteMs:y}={})=>{try{const b=(0,a.Ti)(g),w={type:i.f.MEASUREMENT,payload:Object.assign(Object.assign({},p),{trace:v?{trace_id:v.traceId,span_id:v.spanId}:c.getTraceContext(),timestamp:y?(0,s.q5)(y):(0,s.mI)(),context:(0,o.Im)(b)?void 0:b}),meta:n.value},S={type:w.payload.type,values:w.payload.values,context:w.payload.context};if(!m&&t.dedupe&&!(0,o.kZ)(f)&&(0,l.b)(S,f))return void e.debug("Skipping measurement push because it is the same as the last one\n",w.payload);f=S,e.debug("Pushing measurement\n",w);const x=h();x&&x.type===u.OV?d.addItem(w):r.execute(w)}catch(t){e.error("Error pushing measurement\n",t)}}}}(b)),function({internalLogger:e,config:t,metas:n,transports:r,tracesApi:c,actionBuffer:d,getMessage:h}){let f=null;return{pushEvent:(p,m,g,{skipDedupe:v,spanContext:y,timestampOverwriteMs:b,customPayloadTransformer:w=e=>e}={})=>{try{const S=(0,a.Ti)(m),x={meta:n.value,payload:w({name:p,domain:null!=g?g:t.eventDomain,attributes:(0,o.Im)(S)?void 0:S,timestamp:b?(0,s.q5)(b):(0,s.mI)(),trace:y?{trace_id:y.traceId,span_id:y.spanId}:c.getTraceContext()}),type:i.f.EVENT},E={name:x.payload.name,attributes:x.payload.attributes,domain:x.payload.domain};if(!v&&t.dedupe&&!(0,o.kZ)(f)&&(0,l.b)(E,f))return void e.debug("Skipping event push because it is the same as the last one\n",x.payload);f=E,e.debug("Pushing event\n",x);const _=h();_&&_.type===u.OV?d.addItem(x):r.execute(x)}catch(t){e.error("Error pushing event",t)}}}}(b))}},3191:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=e=>e.map((e=>{try{return String(e)}catch(e){return""}})).join(" ")},1717:(e,t,n)=>{"use strict";n.d(t,{y:()=>r});const r="unknown"},9402:(e,t,n)=>{"use strict";n.d(t,{H:()=>a});var r=n(8964),i=n(8578);class a{constructor(){this.unpatchedConsole=i.Z,this.internalLogger=r.vc,this.config={},this.metas={}}logDebug(...e){this.internalLogger.debug(`${this.name}\n`,...e)}logInfo(...e){this.internalLogger.info(`${this.name}\n`,...e)}logWarn(...e){this.internalLogger.warn(`${this.name}\n`,...e)}logError(...e){this.internalLogger.error(`${this.name}\n`,...e)}}},5004:(e,t,n)=>{"use strict";n.d(t,{J:()=>r});const r="undefined"!=typeof globalThis?globalThis:void 0!==n.g?n.g:"undefined"!=typeof self?self:void 0},8964:(e,t,n)=>{"use strict";n.d(t,{vI:()=>o,vc:()=>a,wK:()=>r});var r,i=n(8203);!function(e){e[e.OFF=0]="OFF",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.VERBOSE=4]="VERBOSE"}(r||(r={}));const a={debug:i.l,error:i.l,info:i.l,prefix:"Faro",warn:i.l},o=r.ERROR},9552:(e,t,n)=>{"use strict";n.d(t,{rI:()=>o,N2:()=>a});var r=n(5004);const i="_faroInternal";function a(e){e.config.isolate?e.internalLogger.debug("Skipping registering internal Faro instance on global object"):(e.internalLogger.debug("Registering internal Faro instance on global object"),Object.defineProperty(r.J,i,{configurable:!1,enumerable:!1,writable:!1,value:e}))}function o(){return i in r.J}},259:(e,t,n)=>{"use strict";n.d(t,{P:()=>a,A:()=>o});var r=n(5004);var i=n(9552);let a={};function o(e,t,n,o,s,l,u){return t.debug("Initializing Faro"),a={api:l,config:n,instrumentations:u,internalLogger:t,metas:o,pause:s.pause,transports:s,unpatchedConsole:e,unpause:s.unpause},(0,i.N2)(a),function(e){if(e.config.preventGlobalExposure)e.internalLogger.debug("Skipping registering public Faro instance in the global scope");else{if(e.internalLogger.debug(`Registering public faro reference in the global scope using "${e.config.globalObjectKey}" key`),e.config.globalObjectKey in r.J)return void e.internalLogger.warn(`Skipping global registration due to key "${e.config.globalObjectKey}" being used already. Please set "globalObjectKey" to something else or set "preventGlobalExposure" to "true"`);Object.defineProperty(r.J,e.config.globalObjectKey,{configurable:!1,writable:!1,value:e})}}(a),a}},4481:(e,t,n)=>{"use strict";n.d(t,{Td:()=>o,Vl:()=>i,ki:()=>a,nT:()=>s,wM:()=>r});const r="view_changed",i="session_start",a="session_resume",o="session_extend",s="service_name_override"},4915:(e,t,n)=>{"use strict";var r;n.d(t,{J:()=>i,f:()=>r}),function(e){e.EXCEPTION="exception",e.LOG="log",e.MEASUREMENT="measurement",e.TRACE="trace",e.EVENT="event"}(r||(r={}));const i={[r.EXCEPTION]:"exceptions",[r.LOG]:"logs",[r.MEASUREMENT]:"measurements",[r.TRACE]:"traces",[r.EVENT]:"events"}},8578:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=Object.assign({},console)},9607:(e,t,n)=>{"use strict";function r(){return Date.now()}function i(){return(new Date).toISOString()}function a(e){return new Date(e).toISOString()}n.d(t,{mI:()=>i,q5:()=>a,x3:()=>r})},7697:(e,t,n)=>{"use strict";n.d(t,{b:()=>i});var r=n(2019);function i(e,t){if(e===t)return!0;if((0,r.Ed)(e,"number")&&isNaN(e))return(0,r.Ed)(t,"number")&&isNaN(t);const n=(0,r.cy)(e),a=(0,r.cy)(t);if(n!==a)return!1;if(n&&a){const n=e.length;if(n!==t.length)return!1;for(let r=n;0!=r--;)if(!i(e[r],t[r]))return!1;return!0}const o=(0,r.Gv)(e),s=(0,r.Gv)(t);if(o!==s)return!1;if(e&&t&&o&&s){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;for(let r of n)if(!i(e[r],t[r]))return!1;return!0}return!1}},2019:(e,t,n)=>{"use strict";function r(e,t){return typeof e===t}function i(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function a(e,t){try{return e instanceof t}catch(e){return!1}}n.d(t,{Ed:()=>r,Et:()=>l,Gv:()=>c,Im:()=>S,Kg:()=>s,Lm:()=>u,T2:()=>y,Tn:()=>d,bJ:()=>v,cy:()=>h,kZ:()=>o,pp:()=>b,sO:()=>f,wX:()=>w,xH:()=>m});const o=e=>r(e,"null"),s=e=>r(e,"string"),l=e=>r(e,"number")&&!isNaN(e)||r(e,"bigint"),u=e=>r(e,"boolean"),c=e=>!o(e)&&r(e,"object"),d=e=>r(e,"function"),h=e=>i(e,"Array"),f=e=>!c(e)&&!d(e),p="undefined"!=typeof Event,m=e=>p&&a(e,Event),g="undefined"!=typeof Error,v=e=>g&&a(e,Error),y=e=>i(e,"ErrorEvent"),b=e=>i(e,"DOMError"),w=e=>i(e,"DOMException");function S(e){return null==e||(h(e)||s(e)?0===e.length:!!c(e)&&0===Object.keys(e).length)}},129:(e,t,n)=>{"use strict";n.d(t,{Ti:()=>a,xD:()=>i});var r=n(2019);function i(e={}){return JSON.stringify(null!=e?e:{},function(){const e=new WeakSet;return function(t,n){if((0,r.Gv)(n)&&null!==n){if(e.has(n))return null;e.add(n)}return n}}())}function a(e={}){const t={};for(const[n,a]of Object.entries(e))t[n]=(0,r.Gv)(a)&&null!==a?i(a):String(a);return t}},5438:(e,t,n)=>{"use strict";var r;n.d(t,{$b:()=>r,HT:()=>a,Ic:()=>i}),function(e){e.TRACE="trace",e.DEBUG="debug",e.INFO="info",e.LOG="log",e.WARN="warn",e.ERROR="error"}(r||(r={}));const i=r.LOG,a=[r.TRACE,r.DEBUG,r.INFO,r.LOG,r.WARN,r.ERROR]},8203:(e,t,n)=>{"use strict";function r(){}n.d(t,{l:()=>r})},3116:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});class r{constructor(){this.subscribers=[]}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>this.unsubscribe(e)}}unsubscribe(e){this.subscribers=this.subscribers.filter((t=>t!==e))}notify(e){this.subscribers.forEach((t=>t(e)))}first(){const e=new r,t=t=>{e.notify(t),n.unsubscribe()},n=this.subscribe(t),i=e.unsubscribe.bind(e);return this.withUnsubscribeOverride(e,i,t)}takeWhile(e){const t=new r,n=r=>{e(r)?t.notify(r):t.unsubscribe(n)};this.subscribe(n);const i=t.unsubscribe.bind(t);return this.withUnsubscribeOverride(t,i,n)}filter(e){const t=new r,n=n=>{e(n)&&t.notify(n)};this.subscribe(n);const i=t.unsubscribe.bind(t);return this.withUnsubscribeOverride(t,i,n)}merge(...e){const t=new r,n=[];e.forEach((e=>{const r=e.subscribe((e=>{t.notify(e)}));n.push(r)}));const i=t.unsubscribeAll.bind(t);return t.unsubscribe=()=>{n.forEach((e=>e.unsubscribe())),i()},t}withUnsubscribeOverride(e,t,n){return e.unsubscribe=e=>{t(e),this.unsubscribe(n)},e}unsubscribeAll(){this.subscribers=[]}}},152:(e,t,n)=>{"use strict";n.d(t,{S:()=>i});const r="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789";function i(e=10){return Array.from(Array(e)).map((()=>r[Math.floor(Math.random()*r.length)])).join("")}},1685:(e,t,n)=>{"use strict";n.d(t,{x:()=>r});const r="1.19.0"},7276:(e,t,n)=>{"use strict";n.d(t,{w:()=>Sn});var r=n(9402);class i extends r.H{constructor(){super(...arguments),this.api={},this.transports={}}}var a=n(1685),o=n(259),s=n(9607),l=n(152),u=n(8981),c=n(4557),d=n(3116),h=n(129),f=n(2081);var p=n(2019);function m(e=""){return o.P.transports.transports.flatMap((e=>e.getIgnoreUrls())).some((t=>e&&null!=e.match(t)))}const g="fetch",v="xhr";function y(){const e=new d.c;function t(t){e.notify({type:f.HU,request:t})}function n(t){e.notify({type:f.IU,request:t})}return function({onRequestEnd:e,onRequestStart:t}){const n=window.fetch;window.fetch=function(){var r,i;const a=null!==(o=arguments[0],r=(0,p.Kg)(o)?o:o instanceof URL?o.href:!(0,p.Im)(o)&&(0,p.Tn)(null==o?void 0:o.toString)?o.toString():void 0)&&void 0!==r?r:"";var o;const s=m(a),u=(null!==(i=arguments[1])&&void 0!==i?i:{}).method,c=(0,l.S)();return s||t({url:a,method:u,requestId:c,apiType:g}),n.apply(this,arguments).then((t=>(s||e({url:a,method:u,requestId:c,apiType:g}),t))).catch((t=>{throw s||e({url:a,method:u,requestId:c,apiType:g}),t}))}}({onRequestStart:t,onRequestEnd:n}),function({onRequestStart:e,onRequestEnd:t}){const n=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(){const r=arguments[1],i=m(r),a=arguments[0],o=(0,l.S)();this.addEventListener("loadstart",(function(){i||e({url:r,method:a,requestId:o,apiType:v})})),this.addEventListener("load",(function(){i||t({url:r,method:a,requestId:o,apiType:v})})),this.addEventListener("error",(function(){i||t({url:r,method:a,requestId:o,apiType:v})})),this.addEventListener("abort",(function(){i||t({url:r,method:a,requestId:o,apiType:v})})),n.apply(this,arguments)}}({onRequestStart:t,onRequestEnd:n}),e}var b=n(1717),w=n(550);const S="com.grafana.faro.lastNavigationId",x="resource",E=/^00-[a-f0-9]{32}-[a-f0-9]{16}-[0-9]{1,2}$/;function _(e=[]){for(const t of e)if("traceparent"===t.name){if(!E.test(t.description))continue;const[,e,n]=t.description.split("-");if(null!=e&&null!=n)return{traceId:e,spanId:n};break}}function O(e,t={}){for(const[n,r]of Object.entries(t)){const t=e[n];return null!=t&&((0,p.cy)(r)?r.includes(t):t===r)}return!0}function k(e){const{connectEnd:t,connectStart:n,decodedBodySize:r,domainLookupEnd:i,domainLookupStart:a,duration:o,encodedBodySize:s,fetchStart:l,initiatorType:u,name:c,nextHopProtocol:d,redirectEnd:h,redirectStart:f,renderBlockingStatus:p,requestStart:m,responseEnd:g,responseStart:v,responseStatus:y,secureConnectionStart:b,transferSize:w,workerStart:S}=e;return{name:c,duration:C(o),tcpHandshakeTime:C(t-n),dnsLookupTime:C(i-a),tlsNegotiationTime:C(t-b),responseStatus:C(y),redirectTime:C(h-f),requestTime:C(v-m),responseTime:C(g-v),fetchTime:C(g-l),serviceWorkerTime:C(l-S),decodedBodySize:C(r),encodedBodySize:C(s),cacheHitStatus:function(){let e="fullLoad";0===w?r>0&&(e="cache"):null!=y?304===y&&(e="conditionalFetch"):s>0&&w<s&&(e="conditionalFetch");return e}(),renderBlockingStatus:C(p),protocol:d,initiatorType:u,visibilityState:document.visibilityState,ttfb:C(v-m),transferSize:C(w)}}function T(e){const{activationStart:t,domComplete:n,domContentLoadedEventEnd:r,domContentLoadedEventStart:i,domInteractive:a,fetchStart:o,loadEventEnd:s,loadEventStart:l,responseStart:u,type:c}=e,d=function(){var e;if(null!=(null===(e=performance.timing)||void 0===e?void 0:e.domLoading))return performance.timing.domLoading-performance.timeOrigin;return null}();return Object.assign(Object.assign({},k(e)),{pageLoadTime:C(n-o),documentParsingTime:C(d?a-d:null),domProcessingTime:C(n-a),domContentLoadHandlerTime:C(r-i),onLoadTime:C(s-l),ttfb:C(Math.max(u-(null!=t?t:0),0)),type:c})}function C(e){return null==e?b.y:"number"==typeof e?Math.round(e>0?e:0).toString():e.toString()}const I={initiatorType:["xmlhttprequest","fetch"]};var R=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))};const A=new d.c;class N extends i{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-performance",this.version=a.x}initialize(){"PerformanceObserver"in window?function(e){if("complete"===document.readyState)e();else{const t=()=>{"complete"===document.readyState&&(e(),document.removeEventListener("readystatechange",t))};document.addEventListener("readystatechange",t)}}((()=>R(this,void 0,void 0,(function*(){const e=this.api.pushEvent,{faroNavigationId:t}=yield function(e){let t;const n=new Promise((e=>{t=e}));return new PerformanceObserver((n=>{var r;const[i]=n.getEntries();if(null==i||m(i.name))return;const a=i.toJSON();let o=_(null==a?void 0:a.serverTiming);const s=null!==(r=(0,w.Gq)(S,w.Uy.session))&&void 0!==r?r:b.y,u=Object.assign(Object.assign({},T(a)),{faroNavigationId:(0,l.S)(),faroPreviousNavigationId:s});(0,w.SO)(S,u.faroNavigationId,w.Uy.session),e("faro.performance.navigation",u,void 0,{spanContext:o,timestampOverwriteMs:performance.timeOrigin+a.startTime}),t(u)})).observe({type:"navigation",buffered:!0}),n}(e);null!=t&&function(e,t,n){const r=o.P.config.trackResources;new PerformanceObserver((i=>{const a=i.getEntries();for(const i of a){if(m(i.name))return;const a=i.toJSON();let s=_(null==a?void 0:a.serverTiming);if(null==r&&O(a,I)||r){const r=Object.assign(Object.assign({},k(a)),{faroNavigationId:e,faroResourceId:(0,l.S)()});o.P.config.trackUserActionsPreview&&(null==n||n.notify({type:x})),t("faro.performance.resource",r,void 0,{spanContext:s,timestampOverwriteMs:performance.timeOrigin+a.startTime})}}})).observe({type:x,buffered:!0})}(t,e,A)})))):this.logDebug("performance observer not supported. Disable performance instrumentation.")}}function D(e){const{api:t,config:n}=e,r=y(),i=function(){const e=new d.c;return new MutationObserver(((t,n)=>{e.notify({type:f.I1})})).observe(document,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),e}(),a=function(){const e=new d.c;return A.subscribe((t=>{t.type===x&&e.notify({type:f.vb})})),e}();let o,h=!1;return function(e){var p;let m;const g=(v=e).type===f.sk&&"string"==typeof v.name;var v;if(m=g?e.name:function(e,t){const n=function(e){const t=e.split("data-")[1],n=null==t?void 0:t.replace(/-(.)/g,((e,t)=>t.toUpperCase()));return null==n?void 0:n.replace(/-/g,"")}(t),r=e.dataset;for(const e in r)if(e===n)return r[e];return}(e.target,null!==(p=n.trackUserActionsDataAttributeName)&&void 0!==p?p:f.jJ),h||null==m)return;h=!0;const y=(0,s.x3)();let b;const w=(0,l.S)();u.Q.notify({type:c.OV,name:m,startTime:y,parentId:w}),o=P(o,(()=>{b=(0,s.x3)(),h=!1,function(e,t){u.Q.notify({type:c._G,name:e,parentId:t})}(m,w)}),100);const S=new Map;let x,E=!1;const _=(new d.c).merge(r,i,a).takeWhile((()=>h)).filter((e=>!!(!E||j(e)&&S.has(e.request.requestId)))).subscribe((n=>{(function(e){return e.type===f.HU})(n)&&S.set(n.request.requestId,n.request),j(n)&&S.delete(n.request.requestId),o=P(o,(()=>{b=(0,s.x3)();const n=Object.assign({api:t,userActionName:m,startTime:y,endTime:b,actionId:w,event:e},g?{attributes:e.attributes}:{}),r=S.size>0;E&&!r&&(clearTimeout(x),E=!1),r?(E=!0,u.Q.notify({type:c.vX,name:m,parentId:w,reason:"pending-requests",haltTime:(0,s.x3)()}),x=P(void 0,(()=>{M(_),L(n),h=!1,E=!1}),1e4)):(M(_),L(n),h=!1,E=!1)}),100)}))}}function L(e){const{api:t,userActionName:n,startTime:r,endTime:i,actionId:a,event:o,attributes:s}=e,l=i-r,d=o.type;u.Q.notify({type:c.$g,name:n,id:a,startTime:r,endTime:i,duration:l,eventType:d}),t.pushEvent(n,Object.assign({userActionStartTime:r.toString(),userActionEndTime:i.toString(),userActionDuration:l.toString(),userActionTrigger:d},(0,h.Ti)(s)),void 0,{timestampOverwriteMs:r,customPayloadTransformer:e=>(e.action={id:a,name:n},e)})}function P(e,t,n){return e&&clearTimeout(e),e=setTimeout((()=>{t()}),n)}function M(e){null==e||e.unsubscribe(),e=void 0}function j(e){return e.type===f.IU}let F;class V extends i{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-user-action",this.version=a.x}initialize(){F=D(o.P),window.addEventListener("pointerdown",F),window.addEventListener("keydown",F)}}const $="DOMError",B="DOMException",z="Non-Error exception captured with keys:",U="?",q=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var H=n(3890);var W=n(4151),G=n(3867);function K(e){let t,n,r,i,a=[];if((0,p.T2)(e)&&e.error)t=e.error.message,n=e.error.name,a=(0,W.D)(e.error);else if((r=(0,p.pp)(e))||(0,p.wX)(e)){const{name:i,message:a}=e;n=null!=i?i:r?$:B,t=a?`${n}: ${a}`:n}else(0,p.bJ)(e)?(t=e.message,a=(0,W.D)(e)):((0,p.Gv)(e)||(i=(0,p.xH)(e)))&&(n=i?e.constructor.name:void 0,t=`${z} ${Object.keys(e)}`);return[t,n,a]}function Q(e){const[t,n,r,i,a]=e;let o,s,l=[];const u=(0,p.Kg)(t),c=(0,G.S)(n,U,r,i);return a||!u?([o,s,l]=K(null!=a?a:t),0===l.length&&(l=[c])):u&&([o,s]=function(e){var t,n;const r=e.match(q),i=null!==(t=null==r?void 0:r[1])&&void 0!==t?t:H.x;return[null!==(n=null==r?void 0:r[2])&&void 0!==n?n:e,i]}(t),l=[c]),{value:o,type:s,stackFrames:l}}function Y(e,t){return(0,p.bJ)(e[0])?Q(e):{value:t(e)}}class X extends i{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-errors",this.version=a.x}initialize(){var e;this.logDebug("Initializing"),function(e){const t=window.onerror;window.onerror=(...n)=>{try{const{value:t,type:r,stackFrames:i}=Q(n),a=n[4];if(t){const n={type:r,stackFrames:i};null!=a&&(n.originalError=a),e.pushError(new Error(t),n)}}finally{null==t||t.apply(window,n)}}}(this.api),e=this.api,window.addEventListener("unhandledrejection",(t=>{var n,r;let i,a,o=t;o.reason?o=t.reason:(null===(n=t.detail)||void 0===n?void 0:n.reason)&&(o=null===(r=t.detail)||void 0===r?void 0:r.reason);let s=[];(0,p.sO)(o)?(i=`Non-Error promise rejection captured with value: ${String(o)}`,a="UnhandledRejection"):[i,a,s]=K(o),i&&e.pushError(new Error(i),{type:a,stackFrames:s})}))}}var J,Z,ee,te,ne,re=-1,ie=function(e){addEventListener("pageshow",(function(t){t.persisted&&(re=t.timeStamp,e(t))}),!0)},ae=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},oe=function(){var e=ae();return e&&e.activationStart||0},se=function(e,t){var n=ae(),r="navigate";return re>=0?r="back-forward-cache":n&&(document.prerendering||oe()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},le=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},ue=function(e,t,n,r){var i,a;return function(o){t.value>=0&&(o||r)&&((a=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=a,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},ce=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},de=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},he=function(e){var t=!1;return function(){t||(e(),t=!0)}},fe=-1,pe=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},me=function(e){"hidden"===document.visibilityState&&fe>-1&&(fe="visibilitychange"===e.type?e.timeStamp:0,ve())},ge=function(){addEventListener("visibilitychange",me,!0),addEventListener("prerenderingchange",me,!0)},ve=function(){removeEventListener("visibilitychange",me,!0),removeEventListener("prerenderingchange",me,!0)},ye=function(){return fe<0&&(fe=pe(),ge(),ie((function(){setTimeout((function(){fe=pe(),ge()}),0)}))),{get firstHiddenTime(){return fe}}},be=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},we=[1800,3e3],Se=function(e,t){t=t||{},be((function(){var n,r=ye(),i=se("FCP"),a=le("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(a.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-oe(),0),i.entries.push(e),n(!0)))}))}));a&&(n=ue(e,i,we,t.reportAllChanges),ie((function(r){i=se("FCP"),n=ue(e,i,we,t.reportAllChanges),ce((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},xe=[.1,.25],Ee=0,_e=1/0,Oe=0,ke=function(e){e.forEach((function(e){e.interactionId&&(_e=Math.min(_e,e.interactionId),Oe=Math.max(Oe,e.interactionId),Ee=Oe?(Oe-_e)/7+1:0)}))},Te=function(){"interactionCount"in performance||J||(J=le("event",ke,{type:"event",buffered:!0,durationThreshold:0}))},Ce=[],Ie=new Map,Re=0,Ae=function(){return(J?Ee:performance.interactionCount||0)-Re},Ne=[],De=function(e){if(Ne.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Ce[Ce.length-1],n=Ie.get(e.interactionId);if(n||Ce.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};Ie.set(r.id,r),Ce.push(r)}Ce.sort((function(e,t){return t.latency-e.latency})),Ce.length>10&&Ce.splice(10).forEach((function(e){return Ie.delete(e.id)}))}}},Le=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=he(e),"hidden"===document.visibilityState?e():(n=t(e),de(e)),n},Pe=[200,500],Me=[2500,4e3],je={},Fe=[800,1800],Ve=function e(t){document.prerendering?be((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},$e={passive:!0,capture:!0},Be=new Date,ze=function(e,t){Z||(Z=t,ee=e,te=new Date,He(removeEventListener),Ue())},Ue=function(){if(ee>=0&&ee<te-Be){var e={entryType:"first-input",name:Z.type,target:Z.target,cancelable:Z.cancelable,startTime:Z.timeStamp,processingStart:Z.timeStamp+ee};ne.forEach((function(t){t(e)})),ne=[]}},qe=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){ze(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,$e),removeEventListener("pointercancel",r,$e)};addEventListener("pointerup",n,$e),addEventListener("pointercancel",r,$e)}(t,e):ze(t,e)}},He=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,qe,$e)}))},We=[100,300];class Ge{constructor(e,t){this.pushMeasurement=e,this.webVitalConfig=t}initialize(){Object.entries(Ge.mapping).forEach((([e,t])=>{var n;t((t=>{this.pushMeasurement({type:"web-vitals",values:{[e]:t.value}})}),{reportAllChanges:null===(n=this.webVitalConfig)||void 0===n?void 0:n.reportAllChanges})}))}}Ge.mapping={cls:function(e,t){t=t||{},Se(he((function(){var n,r=se("CLS",0),i=0,a=[],o=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=a[0],n=a[a.length-1];i&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,a.push(e)):(i=e.value,a=[e])}})),i>r.value&&(r.value=i,r.entries=a,n())},s=le("layout-shift",o);s&&(n=ue(e,r,xe,t.reportAllChanges),de((function(){o(s.takeRecords()),n(!0)})),ie((function(){i=0,r=se("CLS",0),n=ue(e,r,xe,t.reportAllChanges),ce((function(){return n()}))})),setTimeout(n,0))})))},fcp:Se,fid:function(e,t){t=t||{},be((function(){var n,r=ye(),i=se("FID"),a=function(e){e.startTime<r.firstHiddenTime&&(i.value=e.processingStart-e.startTime,i.entries.push(e),n(!0))},o=function(e){e.forEach(a)},s=le("first-input",o);n=ue(e,i,We,t.reportAllChanges),s&&(de(he((function(){o(s.takeRecords()),s.disconnect()}))),ie((function(){var r;i=se("FID"),n=ue(e,i,We,t.reportAllChanges),ne=[],ee=-1,Z=null,He(addEventListener),r=a,ne.push(r),Ue()})))}))},inp:function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},be((function(){var n;Te();var r,i=se("INP"),a=function(e){Le((function(){e.forEach(De);var t,n=(t=Math.min(Ce.length-1,Math.floor(Ae()/50)),Ce[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())}))},o=le("event",a,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=ue(e,i,Pe,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),de((function(){a(o.takeRecords()),r(!0)})),ie((function(){Re=0,Ce.length=0,Ie.clear(),i=se("INP"),r=ue(e,i,Pe,t.reportAllChanges)})))})))},lcp:function(e,t){t=t||{},be((function(){var n,r=ye(),i=se("LCP"),a=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-oe(),0),i.entries=[e],n())}))},o=le("largest-contentful-paint",a);if(o){n=ue(e,i,Me,t.reportAllChanges);var s=he((function(){je[i.id]||(a(o.takeRecords()),o.disconnect(),je[i.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Le(s)}),!0)})),de(s),ie((function(r){i=se("LCP"),n=ue(e,i,Me,t.reportAllChanges),ce((function(){i.value=performance.now()-r.timeStamp,je[i.id]=!0,n(!0)}))}))}}))},ttfb:function(e,t){t=t||{};var n=se("TTFB"),r=ue(e,n,Fe,t.reportAllChanges);Ve((function(){var i=ae();i&&(n.value=Math.max(i.responseStart-oe(),0),n.entries=[i],r(!0),ie((function(){n=se("TTFB",0),(r=ue(e,n,Fe,t.reportAllChanges))(!0)})))}))}};var Ke,Qe,Ye,Xe=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Je=function(e){if("loading"===document.readyState)return"loading";var t=Xe();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},Ze=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},et=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?"#"+r.id:Ze(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+i.length>(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},tt=-1,nt=function(){return tt},rt=function(e){addEventListener("pageshow",(function(t){t.persisted&&(tt=t.timeStamp,e(t))}),!0)},it=function(){var e=Xe();return e&&e.activationStart||0},at=function(e,t){var n=Xe(),r="navigate";return nt()>=0?r="back-forward-cache":n&&(document.prerendering||it()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},ot=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},st=function(e,t,n,r){var i,a;return function(o){t.value>=0&&(o||r)&&((a=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=a,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},lt=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},ut=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},ct=function(e){var t=!1;return function(){t||(e(),t=!0)}},dt=-1,ht=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},ft=function(e){"hidden"===document.visibilityState&&dt>-1&&(dt="visibilitychange"===e.type?e.timeStamp:0,mt())},pt=function(){addEventListener("visibilitychange",ft,!0),addEventListener("prerenderingchange",ft,!0)},mt=function(){removeEventListener("visibilitychange",ft,!0),removeEventListener("prerenderingchange",ft,!0)},gt=function(){return dt<0&&(dt=ht(),pt(),rt((function(){setTimeout((function(){dt=ht(),pt()}),0)}))),{get firstHiddenTime(){return dt}}},vt=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},yt=[1800,3e3],bt=function(e,t){t=t||{},vt((function(){var n,r=gt(),i=at("FCP"),a=ot("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(a.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-it(),0),i.entries.push(e),n(!0)))}))}));a&&(n=st(e,i,yt,t.reportAllChanges),rt((function(r){i=at("FCP"),n=st(e,i,yt,t.reportAllChanges),lt((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},wt=[.1,.25],St=0,xt=1/0,Et=0,_t=function(e){e.forEach((function(e){e.interactionId&&(xt=Math.min(xt,e.interactionId),Et=Math.max(Et,e.interactionId),St=Et?(Et-xt)/7+1:0)}))},Ot=[],kt=new Map,Tt=0,Ct=[],It=function(e){if(Ct.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Ot[Ot.length-1],n=kt.get(e.interactionId);if(n||Ot.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};kt.set(r.id,r),Ot.push(r)}Ot.sort((function(e,t){return t.latency-e.latency})),Ot.length>10&&Ot.splice(10).forEach((function(e){return kt.delete(e.id)}))}}},Rt=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=ct(e),"hidden"===document.visibilityState?e():(n=t(e),ut(e)),n},At=[200,500],Nt=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},vt((function(){var n;"interactionCount"in performance||Ke||(Ke=ot("event",_t,{type:"event",buffered:!0,durationThreshold:0}));var r,i=at("INP"),a=function(e){Rt((function(){e.forEach(It);var t,n=(t=Math.min(Ot.length-1,Math.floor(((Ke?St:performance.interactionCount||0)-Tt)/50)),Ot[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())}))},o=ot("event",a,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=st(e,i,At,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),ut((function(){a(o.takeRecords()),r(!0)})),rt((function(){Tt=0,Ot.length=0,kt.clear(),i=at("INP"),r=st(e,i,At,t.reportAllChanges)})))})))},Dt=[],Lt=[],Pt=new WeakMap,Mt=new Map,jt=-1,Ft=function(e){Dt=Dt.concat(e),Vt()},Vt=function(){jt<0&&(jt=Rt($t))},$t=function(){Mt.size>10&&Mt.forEach((function(e,t){kt.has(t)||Mt.delete(t)}));var e=Ot.map((function(e){return Pt.get(e.entries[0])})),t=Lt.length-50;Lt=Lt.filter((function(n,r){return r>=t||e.includes(n)}));for(var n=new Set,r=0;r<Lt.length;r++){var i=Lt[r];Ht(i.startTime,i.processingEnd).forEach((function(e){n.add(e)}))}for(var a=0;a<50;a++){var o=Dt[Dt.length-1-a];if(!o||o.startTime<Ye)break;n.add(o)}Dt=Array.from(n),jt=-1};Ct.push((function(e){e.interactionId&&e.target&&!Mt.has(e.interactionId)&&Mt.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;Ye=Math.max(Ye,e.processingEnd);for(var r=Lt.length-1;r>=0;r--){var i=Lt[r];if(Math.abs(n-i.renderTime)<=8){(t=i).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:[e]},Lt.push(t)),(e.interactionId||"first-input"===e.entryType)&&Pt.set(e,t),Vt()}));var Bt,zt,Ut,qt,Ht=function(e,t){for(var n,r=[],i=0;n=Dt[i];i++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;r.push(n)}return r},Wt=[2500,4e3],Gt={},Kt=[800,1800],Qt=function e(t){document.prerendering?vt((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},Yt=function(e,t){t=t||{};var n=at("TTFB"),r=st(e,n,Kt,t.reportAllChanges);Qt((function(){var i=Xe();i&&(n.value=Math.max(i.responseStart-it(),0),n.entries=[i],r(!0),rt((function(){n=at("TTFB",0),(r=st(e,n,Kt,t.reportAllChanges))(!0)})))}))},Xt={passive:!0,capture:!0},Jt=new Date,Zt=function(e,t){Bt||(Bt=t,zt=e,Ut=new Date,nn(removeEventListener),en())},en=function(){if(zt>=0&&zt<Ut-Jt){var e={entryType:"first-input",name:Bt.type,target:Bt.target,cancelable:Bt.cancelable,startTime:Bt.timeStamp,processingStart:Bt.timeStamp+zt};qt.forEach((function(t){t(e)})),qt=[]}},tn=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){Zt(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,Xt),removeEventListener("pointercancel",r,Xt)};addEventListener("pointerup",n,Xt),addEventListener("pointercancel",r,Xt)}(t,e):Zt(t,e)}},nn=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,tn,Xt)}))},rn=[100,300],an=function(e,t){!function(e,t){t=t||{},vt((function(){var n,r=gt(),i=at("FID"),a=function(e){e.startTime<r.firstHiddenTime&&(i.value=e.processingStart-e.startTime,i.entries.push(e),n(!0))},o=function(e){e.forEach(a)},s=ot("first-input",o);n=st(e,i,rn,t.reportAllChanges),s&&(ut(ct((function(){o(s.takeRecords()),s.disconnect()}))),rt((function(){var r;i=at("FID"),n=st(e,i,rn,t.reportAllChanges),qt=[],zt=-1,Bt=null,nn(addEventListener),r=a,qt.push(r),en()})))}))}((function(t){var n=function(e){var t=e.entries[0],n={eventTarget:et(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:Je(t.startTime)};return Object.assign(e,{attribution:n})}(t);e(n)}),t)};const on="load_state",sn="time_to_first_byte";class ln{constructor(e,t){this.corePushMeasurement=e,this.webVitalConfig=t}initialize(){this.measureCLS(),this.measureFCP(),this.measureFID(),this.measureINP(),this.measureLCP(),this.measureTTFB()}measureCLS(){var e;!function(e,t){!function(e,t){t=t||{},bt(ct((function(){var n,r=at("CLS",0),i=0,a=[],o=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=a[0],n=a[a.length-1];i&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,a.push(e)):(i=e.value,a=[e])}})),i>r.value&&(r.value=i,r.entries=a,n())},s=ot("layout-shift",o);s&&(n=st(e,r,wt,t.reportAllChanges),ut((function(){o(s.takeRecords()),n(!0)})),rt((function(){i=0,r=at("CLS",0),n=st(e,r,wt,t.reportAllChanges),lt((function(){return n()}))})),setTimeout(n,0))})))}((function(t){var n=function(e){var t,n={};if(e.entries.length){var r=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(r&&r.sources&&r.sources.length){var i=(t=r.sources).find((function(e){return e.node&&1===e.node.nodeType}))||t[0];i&&(n={largestShiftTarget:et(i.node),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:i,largestShiftEntry:r,loadState:Je(r.startTime)})}}return Object.assign(e,{attribution:n})}(t);e(n)}),t)}((e=>{const{loadState:t,largestShiftValue:n,largestShiftTime:r,largestShiftTarget:i}=e.attribution,a=this.buildInitialValues(e);this.addIfPresent(a,"largest_shift_value",n),this.addIfPresent(a,"largest_shift_time",r);const o=this.buildInitialContext(e);this.addIfPresent(o,on,t),this.addIfPresent(o,"largest_shift_target",i),this.pushMeasurement(a,o)}),{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureFCP(){var e;!function(e,t){bt((function(t){var n=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:Je(nt())};if(e.entries.length){var n=Xe(),r=e.entries[e.entries.length-1];if(n){var i=n.activationStart||0,a=Math.max(0,n.responseStart-i);t={timeToFirstByte:a,firstByteToFCP:e.value-a,loadState:Je(e.entries[0].startTime),navigationEntry:n,fcpEntry:r}}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)}((e=>{const{firstByteToFCP:t,timeToFirstByte:n,loadState:r}=e.attribution,i=this.buildInitialValues(e);this.addIfPresent(i,"first_byte_to_fcp",t),this.addIfPresent(i,sn,n);const a=this.buildInitialContext(e);this.addIfPresent(a,on,r),this.pushMeasurement(i,a)}),{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureFID(){var e;an((e=>{const{eventTime:t,eventTarget:n,eventType:r,loadState:i}=e.attribution,a=this.buildInitialValues(e);this.addIfPresent(a,"event_time",t);const o=this.buildInitialContext(e);this.addIfPresent(o,"event_target",n),this.addIfPresent(o,"event_type",r),this.addIfPresent(o,on,i),this.pushMeasurement(a,o)}),{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureINP(){var e;!function(e,t){Qe||(Qe=ot("long-animation-frame",Ft)),Nt((function(t){var n=function(e){var t=e.entries[0],n=Pt.get(t),r=t.processingStart,i=n.processingEnd,a=n.entries.sort((function(e,t){return e.processingStart-t.processingStart})),o=Ht(t.startTime,i),s=e.entries.find((function(e){return e.target})),l=s&&s.target||Mt.get(t.interactionId),u=[t.startTime+t.duration,i].concat(o.map((function(e){return e.startTime+e.duration}))),c=Math.max.apply(Math,u),d={interactionTarget:et(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:c,processedEventEntries:a,longAnimationFrameEntries:o,inputDelay:r-t.startTime,processingDuration:i-r,presentationDelay:Math.max(c-i,0),loadState:Je(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(n)}),t)}((e=>{const{interactionTime:t,presentationDelay:n,inputDelay:r,processingDuration:i,nextPaintTime:a,loadState:o,interactionTarget:s,interactionType:l}=e.attribution,u=this.buildInitialValues(e);this.addIfPresent(u,"interaction_time",t),this.addIfPresent(u,"presentation_delay",n),this.addIfPresent(u,"input_delay",r),this.addIfPresent(u,"processing_duration",i),this.addIfPresent(u,"next_paint_time",a);const c=this.buildInitialContext(e);this.addIfPresent(c,on,o),this.addIfPresent(c,"interaction_target",s),this.addIfPresent(c,"interaction_type",l),this.pushMeasurement(u,c)}),{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureLCP(){var e;!function(e,t){!function(e,t){t=t||{},vt((function(){var n,r=gt(),i=at("LCP"),a=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-it(),0),i.entries=[e],n())}))},o=ot("largest-contentful-paint",a);if(o){n=st(e,i,Wt,t.reportAllChanges);var s=ct((function(){Gt[i.id]||(a(o.takeRecords()),o.disconnect(),Gt[i.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Rt(s)}),!0)})),ut(s),rt((function(r){i=at("LCP"),n=st(e,i,Wt,t.reportAllChanges),lt((function(){i.value=performance.now()-r.timeStamp,Gt[i.id]=!0,n(!0)}))}))}}))}((function(t){var n=function(e){var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var n=Xe();if(n){var r=n.activationStart||0,i=e.entries[e.entries.length-1],a=i.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===i.url}))[0],o=Math.max(0,n.responseStart-r),s=Math.max(o,a?(a.requestStart||a.startTime)-r:0),l=Math.max(s,a?a.responseEnd-r:0),u=Math.max(l,i.startTime-r);t={element:et(i.element),timeToFirstByte:o,resourceLoadDelay:s-o,resourceLoadDuration:l-s,elementRenderDelay:u-l,navigationEntry:n,lcpEntry:i},i.url&&(t.url=i.url),a&&(t.lcpResourceEntry=a)}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)}((e=>{const{elementRenderDelay:t,resourceLoadDelay:n,resourceLoadDuration:r,timeToFirstByte:i,element:a}=e.attribution,o=this.buildInitialValues(e);this.addIfPresent(o,"element_render_delay",t),this.addIfPresent(o,"resource_load_delay",n),this.addIfPresent(o,"resource_load_duration",r),this.addIfPresent(o,sn,i);const s=this.buildInitialContext(e);this.addIfPresent(s,"element",a),this.pushMeasurement(o,s)}),{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureTTFB(){var e;!function(e,t){Yt((function(t){var n=function(e){var t={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){var n=e.entries[0],r=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-r,0),a=Math.max(n.domainLookupStart-r,0),o=Math.max(n.connectStart-r,0),s=Math.max(n.connectEnd-r,0);t={waitingDuration:i,cacheDuration:a-i,dnsDuration:o-a,connectionDuration:s-o,requestDuration:e.value-s,navigationEntry:n}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)}((e=>{const{dnsDuration:t,connectionDuration:n,requestDuration:r,waitingDuration:i,cacheDuration:a}=e.attribution,o=this.buildInitialValues(e);this.addIfPresent(o,"dns_duration",t),this.addIfPresent(o,"connection_duration",n),this.addIfPresent(o,"request_duration",r),this.addIfPresent(o,"waiting_duration",i),this.addIfPresent(o,"cache_duration",a);const s=this.buildInitialContext(e);this.pushMeasurement(o,s)}),{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}buildInitialValues(e){const t=e.name.toLowerCase();return{[t]:e.value,delta:e.delta}}buildInitialContext(e){var t;const n=null!==(t=(0,w.Gq)(S,w.Uy.session))&&void 0!==t?t:b.y;return{id:e.id,rating:e.rating,navigation_type:e.navigationType,navigation_entry_id:n}}pushMeasurement(e,t){this.corePushMeasurement({type:"web-vitals",values:e},{context:t})}addIfPresent(e,t,n){n&&(e[t]=n)}}class un extends i{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-web-vitals",this.version=a.x}initialize(){this.logDebug("Initializing");this.intializeWebVitalsInstrumentation().initialize()}intializeWebVitalsInstrumentation(){var e,t,n;return!1===(null===(e=this.config)||void 0===e?void 0:e.trackWebVitalsAttribution)||!1===(null===(n=null===(t=this.config)||void 0===t?void 0:t.webVitalsInstrumentation)||void 0===n?void 0:n.trackAttribution)?new Ge(this.api.pushMeasurement,this.config.webVitalsInstrumentation):new ln(this.api.pushMeasurement,this.config.webVitalsInstrumentation)}}var cn=n(4481);var dn=n(3881),hn=n(6493),fn=n(4273),pn=n(6854);class mn extends i{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-session",this.version=a.x}sendSessionStartEvent(e){var t,n;const r=e.session;if(r&&r.id!==(null===(t=this.notifiedSession)||void 0===t?void 0:t.id)){if(this.notifiedSession&&this.notifiedSession.id===(null===(n=r.attributes)||void 0===n?void 0:n.previousSession))return this.api.pushEvent(cn.Td,{},void 0,{skipDedupe:!0}),void(this.notifiedSession=r);this.notifiedSession=r,this.api.pushEvent(cn.Vl,{},void 0,{skipDedupe:!0})}}createInitialSession(e,t){var n,r,i,a,u,c;let d,h,f=e.fetchUserSession();if(t.persistent&&t.maxSessionPersistenceTime&&f){const e=(0,s.x3)();f.lastActivity<e-t.maxSessionPersistenceTime&&(fn.G.removeUserSession(),f=null)}if((0,pn.OW)(f)){const e=null==f?void 0:f.sessionId;h=(0,pn.Bc)({sessionId:e,isSampled:f.isSampled||!1,started:null==f?void 0:f.started});const i=null==f?void 0:f.sessionMeta,a=Object.assign(Object.assign({},null===(n=t.session)||void 0===n?void 0:n.overrides),null==i?void 0:i.overrides);h.sessionMeta=Object.assign(Object.assign({},t.session),{id:e,attributes:Object.assign(Object.assign(Object.assign({},null===(r=t.session)||void 0===r?void 0:r.attributes),null==i?void 0:i.attributes),{isSampled:h.isSampled.toString()}),overrides:a}),d=cn.ki}else{const e=null!==(a=null===(i=t.session)||void 0===i?void 0:i.id)&&void 0!==a?a:function(e){var t,n,r,i;return{id:null!==(i=null===(r=null===(n=null===(t=o.P.config)||void 0===t?void 0:t.sessionTracking)||void 0===n?void 0:n.generateSessionId)||void 0===r?void 0:r.call(n))&&void 0!==i?i:(0,l.S)(),attributes:e}}().id;h=(0,pn.Bc)({sessionId:e,isSampled:(0,dn.$)()});const n=null===(u=t.session)||void 0===u?void 0:u.overrides;h.sessionMeta=Object.assign({id:e,attributes:Object.assign({isSampled:h.isSampled.toString()},null===(c=t.session)||void 0===c?void 0:c.attributes)},n?{overrides:n}:{}),d=cn.Vl}return{initialSession:h,lifecycleType:d}}registerBeforeSendHook(e){var t;const{updateSession:n}=new e;null===(t=this.transports)||void 0===t||t.addBeforeSendHooks((e=>{var t,r,i;n();const a=null===(t=e.meta.session)||void 0===t?void 0:t.attributes;if(a&&"true"===(null==a?void 0:a.isSampled)){let t=JSON.parse(JSON.stringify(e));const n=null===(r=t.meta.session)||void 0===r?void 0:r.attributes;return null==n||delete n.isSampled,0===Object.keys(null!=n?n:{}).length&&(null===(i=t.meta.session)||void 0===i||delete i.attributes),t}return null}))}initialize(){this.logDebug("init session instrumentation");const e=this.config.sessionTracking;if(null==e?void 0:e.enabled){const t=(0,hn.R)(e);this.registerBeforeSendHook(t);const{initialSession:n,lifecycleType:r}=this.createInitialSession(t,e);t.storeUserSession(n);const i=n.sessionMeta;this.notifiedSession=i,this.api.setSession(i),r===cn.Vl&&this.api.pushEvent(cn.Vl,{},void 0,{skipDedupe:!0}),r===cn.ki&&this.api.pushEvent(cn.ki,{},void 0,{skipDedupe:!0})}this.metas.addListener(this.sendSessionStartEvent.bind(this))}}class gn extends i{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-view",this.version=a.x}sendViewChangedEvent(e){var t,n,r,i;const a=e.view;a&&a.name!==(null===(t=this.notifiedView)||void 0===t?void 0:t.name)&&(this.api.pushEvent(cn.wM,{fromView:null!==(r=null===(n=this.notifiedView)||void 0===n?void 0:n.name)&&void 0!==r?r:b.y,toView:null!==(i=a.name)&&void 0!==i?i:b.y},void 0,{skipDedupe:!0}),this.notifiedView=a)}initialize(){this.metas.addListener(this.sendViewChangedEvent.bind(this))}}class vn extends i{constructor(){super(),this.name="@grafana/faro-web-sdk:instrumentation-csp",this.version=a.x}initialize(){document.addEventListener("securitypolicyviolation",this.securitypolicyviolationHandler.bind(this))}destroy(){document.removeEventListener("securitypolicyviolation",this.securitypolicyviolationHandler)}securitypolicyviolationHandler(e){this.api.pushEvent("securitypolicyviolation",(0,h.Ti)(e))}}var yn=n(3191),bn=n(5438);class wn extends i{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:instrumentation-console",this.version=a.x,this.errorSerializer=yn.Z}initialize(){var e,t,n,r;this.options=Object.assign(Object.assign({},this.options),this.config.consoleInstrumentation);const i=(null===(e=this.options)||void 0===e?void 0:e.serializeErrors)||!!(null===(t=this.options)||void 0===t?void 0:t.errorSerializer);this.errorSerializer=i?null!==(r=null===(n=this.options)||void 0===n?void 0:n.errorSerializer)&&void 0!==r?r:H.n:yn.Z,bn.HT.filter((e=>{var t,n;return!(null!==(n=null===(t=this.options)||void 0===t?void 0:t.disabledLevels)&&void 0!==n?n:wn.defaultDisabledLevels).includes(e)})).forEach((e=>{console[e]=(...t)=>{var n,r;try{if(e!==bn.$b.ERROR||(null===(n=this.options)||void 0===n?void 0:n.consoleErrorAsLog))if(e===bn.$b.ERROR&&(null===(r=this.options)||void 0===r?void 0:r.consoleErrorAsLog)){const{value:n,type:r,stackFrames:i}=Y(t,this.errorSerializer);this.api.pushLog(n?[wn.consoleErrorPrefix+n]:t,{level:e,context:{value:null!=n?n:"",type:null!=r?r:"",stackFrames:(null==i?void 0:i.length)?(0,H.n)(i):""}})}else this.api.pushLog(t,{level:e});else{const{value:e,type:n,stackFrames:r}=Y(t,this.errorSerializer);if(e&&!n&&!r)return void this.api.pushError(new Error(wn.consoleErrorPrefix+e));this.api.pushError(new Error(wn.consoleErrorPrefix+e),{type:n,stackFrames:r})}}catch(e){this.logError(e)}finally{this.unpatchedConsole[e](...t)}}}))}}function Sn(e={}){const t=[new V,new X,new un,new mn,new gn];return!1!==e.enablePerformanceInstrumentation&&t.unshift(new N),!1!==e.enableContentSecurityPolicyInstrumentation&&t.push(new vn),!1!==e.captureConsole&&t.push(new wn({disabledLevels:e.captureConsoleDisabledLevels})),t}wn.defaultDisabledLevels=[bn.$b.DEBUG,bn.$b.TRACE,bn.$b.LOG],wn.consoleErrorPrefix="console.error: "},9128:(e,t,n)=>{"use strict";n.d(t,{p:()=>Y});var r=n(8981);var i=n(8964),a=n(8578),o=n(8203);function s(e=a.Z,t=i.vI){const n=i.vc;return t>i.wK.OFF&&(n.error=t>=i.wK.ERROR?function(...t){e.error(`${n.prefix}\n`,...t)}:o.l,n.warn=t>=i.wK.WARN?function(...t){e.warn(`${n.prefix}\n`,...t)}:o.l,n.info=t>=i.wK.INFO?function(...t){e.info(`${n.prefix}\n`,...t)}:o.l,n.debug=t>=i.wK.VERBOSE?function(...t){e.debug(`${n.prefix}\n`,...t)}:o.l),n}let l=i.vc;function u(e,t){return l=s(e,t.internalLoggerLevel),l}var c=n(2019);var d=n(5004);var h=n(1685);var f=n(9552),p=n(259);class m{constructor(e,t){var n,r;this.signalBuffer=[],this.itemLimit=null!==(n=null==t?void 0:t.itemLimit)&&void 0!==n?n:50,this.sendTimeout=null!==(r=null==t?void 0:t.sendTimeout)&&void 0!==r?r:250,this.paused=(null==t?void 0:t.paused)||!1,this.sendFn=e,this.flushInterval=-1,this.paused||this.start(),document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&this.flush()}))}addItem(e){this.paused||(this.signalBuffer.push(e),this.signalBuffer.length>=this.itemLimit&&this.flush())}start(){this.paused=!1,this.sendTimeout>0&&(this.flushInterval=window.setInterval((()=>this.flush()),this.sendTimeout))}pause(){this.paused=!0,clearInterval(this.flushInterval)}groupItems(e){const t=new Map;return e.forEach((e=>{const n=JSON.stringify(e.meta);let r=t.get(n);r=void 0===r?[e]:[...r,e],t.set(n,r)})),Array.from(t.values())}flush(){if(this.paused||0===this.signalBuffer.length)return;this.groupItems(this.signalBuffer).forEach(this.sendFn),this.signalBuffer=[]}}var g=n(4915);function v(e,t,n,r){var i;t.debug("Initializing transports");const a=[];let o=n.paused,s=[];const l=e=>{let t=e;for(const e of s){const r=t.map(e).filter(Boolean);if(0===r.length)return[];t=y(r,n)}return t},u=e=>{const n=l(e);if(0!==n.length)for(const e of a)t.debug(`Transporting item using ${e.name}\n`,n),e.isBatched()&&e.send(n)};let c;(null===(i=n.batching)||void 0===i?void 0:i.enabled)&&(c=new m(u,{sendTimeout:n.batching.sendTimeout,itemLimit:n.batching.itemLimit,paused:o}));return{add:(...i)=>{t.debug("Adding transports"),i.forEach((i=>{t.debug(`Adding "${i.name}" transport`);a.some((e=>e===i))?t.warn(`Transport ${i.name} is already added`):(i.unpatchedConsole=e,i.internalLogger=t,i.config=n,i.metas=r,a.push(i))}))},addBeforeSendHooks:(...e)=>{t.debug("Adding beforeSendHooks\n",s),e.forEach((e=>{e&&s.push(e)}))},getBeforeSendHooks:()=>[...s],execute:e=>{var r;o||((null===(r=n.batching)||void 0===r?void 0:r.enabled)&&(null==c||c.addItem(e)),(e=>{var r,i;if((null===(r=n.batching)||void 0===r?void 0:r.enabled)&&a.every((e=>e.isBatched())))return;const[o]=l([e]);if(void 0!==o)for(const e of a)t.debug(`Transporting item using ${e.name}\n`,o),e.isBatched()?(null===(i=n.batching)||void 0===i?void 0:i.enabled)||e.send([o]):e.send(o)})(e))},isPaused:()=>o,pause:()=>{t.debug("Pausing transports"),null==c||c.pause(),o=!0},remove:(...e)=>{t.debug("Removing transports"),e.forEach((e=>{t.debug(`Removing "${e.name}" transport`);const n=a.indexOf(e);-1!==n?a.splice(n,1):t.warn(`Transport "${e.name}" is not added`)}))},removeBeforeSendHooks:(...e)=>{s.filter((t=>!e.includes(t)))},get transports(){return[...a]},unpause:()=>{t.debug("Unpausing transports"),null==c||c.start(),o=!1}}}function y(e,t){if(t.preserveOriginalError)for(const t of e)t.type===g.f.EXCEPTION&&delete t.payload.originalError;return e}let b=a.Z;function w(e){var t;return b=null!==(t=e.unpatchedConsole)&&void 0!==t?t:b,b}function S(e){const t=w(e),n=u(t,e);if((0,f.rI)()&&!e.isolate)return void n.error('Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the "isolate" property');n.debug("Initializing");const i=function(e,t,n){let r=[],i=[];const a=()=>r.reduce(((e,t)=>Object.assign(e,(0,c.Tn)(t)?t():t)),{}),o=()=>{if(i.length){const e=a();i.forEach((t=>t(e)))}};return{add:(...e)=>{t.debug("Adding metas\n",e),r.push(...e),o()},remove:(...e)=>{t.debug("Removing metas\n",e),r=r.filter((t=>!e.includes(t))),o()},addListener:e=>{t.debug("Adding metas listener\n",e),i.push(e)},removeListener:e=>{t.debug("Removing metas listener\n",e),i=i.filter((t=>t!==e))},get value(){return a()}}}(0,n),a=v(t,n,e,i),o=(0,r.X)(t,n,e,i,a),s=function(e,t,n,r,i,a){t.debug("Initializing instrumentations");const o=[];return{add:(...s)=>{t.debug("Adding instrumentations"),s.forEach((s=>{t.debug(`Adding "${s.name}" instrumentation`),o.some((e=>e.name===s.name))?t.warn(`Instrumentation ${s.name} is already added`):(s.unpatchedConsole=e,s.internalLogger=t,s.config=n,s.metas=r,s.transports=i,s.api=a,o.push(s),s.initialize())}))},get instrumentations(){return[...o]},remove:(...e)=>{t.debug("Removing instrumentations"),e.forEach((e=>{var n,r;t.debug(`Removing "${e.name}" instrumentation`);const i=o.reduce(((t,n,r)=>null===t&&n.name===e.name?r:null),null);null!==i?(null===(r=(n=o[i]).destroy)||void 0===r||r.call(n),o.splice(i,1)):t.warn(`Instrumentation "${e.name}" is not added`)}))}}}(t,n,e,i,a,o),l=(0,p.A)(t,n,e,i,a,o,s);return function(e){var t,n;const r={sdk:{version:h.x},app:{bundleId:e.config.app.name&&(i=e.config.app.name,null===d.J||void 0===d.J?void 0:d.J[`__faroBundleId_${i}`])}};var i;const a=null===(t=e.config.sessionTracking)||void 0===t?void 0:t.session;a&&e.api.setSession(a),e.config.app&&(r.app=Object.assign(Object.assign({},e.config.app),r.app)),e.config.user&&(r.user=e.config.user),e.config.view&&(r.view=e.config.view),e.metas.add(r,...null!==(n=e.config.metas)&&void 0!==n?n:[])}(l),function(e){e.transports.add(...e.config.transports),e.transports.addBeforeSendHooks(e.config.beforeSend)}(l),function(e){e.instrumentations.add(...e.config.instrumentations)}(l),l}const x="faro",E={enabled:!0,sendTimeout:250,itemLimit:50};var _=n(3191);const O="browser";var k=n(4151);function T(e){return{frames:(0,k.D)(e)}}var C=n(409),I=n(2081),R=n(6660),A=n(1717);const N=()=>{const e=new R.UAParser,{name:t,version:n}=e.getBrowser(),{name:r,version:i}=e.getOS(),a=e.getUA(),o=navigator.language,s=navigator.userAgent.includes("Mobi"),l=function(){if(!t||!n)return;if("userAgentData"in navigator&&navigator.userAgentData)return navigator.userAgentData.brands;return}();return{browser:{name:null!=t?t:A.y,version:null!=n?n:A.y,os:`${null!=r?r:A.y} ${null!=i?i:A.y}`,userAgent:null!=a?a:A.y,language:null!=o?o:A.y,mobile:s,brands:null!=l?l:A.y,viewportWidth:`${window.innerWidth}`,viewportHeight:`${window.innerHeight}`}}},D=()=>{const e=window.k6;return{k6:Object.assign({isK6Browser:!0},(null==e?void 0:e.testRunId)&&{testRunId:null==e?void 0:e.testRunId})}};let L,P;function M({generatePageId:e,initialPageMeta:t}={}){return()=>{const n=location.href;return(0,c.Tn)(e)&&L!==n&&(L=n,P=e(location)),{page:Object.assign(Object.assign({url:n},P?{id:P}:{}),t)}}}var j=n(9402);class F extends j.H{isBatched(){return!1}getIgnoreUrls(){return[]}}function V(e,t){var n,r;if(void 0===t)return e;if(void 0===e)return{resourceSpans:t};const i=null===(n=e.resourceSpans)||void 0===n?void 0:n[0];if(void 0===i)return e;const a=(null==i?void 0:i.scopeSpans)||[],o=(null===(r=null==t?void 0:t[0])||void 0===r?void 0:r.scopeSpans)||[];return Object.assign(Object.assign({},e),{resourceSpans:[Object.assign(Object.assign({},i),{scopeSpans:[...a,...o]})]})}var $=n(6493),B=n(6854),z=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))},U=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class q extends F{constructor(e){var t,n,r,i;super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-fetch",this.version=h.x,this.disabledUntil=new Date,this.rateLimitBackoffMs=null!==(t=e.defaultRateLimitBackoffMs)&&void 0!==t?t:5e3,this.getNow=null!==(n=e.getNow)&&void 0!==n?n:()=>Date.now(),this.promiseBuffer=function(e){const{size:t,concurrency:n}=e,r=[];let i=0;const a=()=>{if(i<n&&r.length){const{producer:e,resolve:t,reject:n}=r.shift();i++,e().then((e=>{i--,a(),t(e)}),(e=>{i--,a(),n(e)}))}};return{add:e=>{if(r.length+i>=t)throw new Error("Task buffer full");return new Promise(((t,n)=>{r.push({producer:e,resolve:t,reject:n}),a()}))}}}({size:null!==(r=e.bufferSize)&&void 0!==r?r:30,concurrency:null!==(i=e.concurrency)&&void 0!==i?i:5})}send(e){return z(this,void 0,void 0,(function*(){try{if(this.disabledUntil>new Date(this.getNow()))return this.logWarn(`Dropping transport item due to too many requests. Backoff until ${this.disabledUntil}`),Promise.resolve();yield this.promiseBuffer.add((()=>{const t=JSON.stringify(function(e){let t={meta:{}};return void 0!==e[0]&&(t.meta=e[0].meta),e.forEach((e=>{switch(e.type){case g.f.LOG:case g.f.EVENT:case g.f.EXCEPTION:case g.f.MEASUREMENT:const n=g.J[e.type],r=t[n];t=Object.assign(Object.assign({},t),{[n]:void 0===r?[e.payload]:[...r,e.payload]});break;case g.f.TRACE:t=Object.assign(Object.assign({},t),{traces:V(t.traces,e.payload.resourceSpans)})}})),t}(e)),{url:n,requestOptions:r,apiKey:i}=this.options,a=null!=r?r:{},{headers:s}=a,l=U(a,["headers"]);let u;const c=this.metas.value.session;return null!=c&&(u=c.id),fetch(n,Object.assign({method:"POST",headers:Object.assign(Object.assign(Object.assign({"Content-Type":"application/json"},null!=s?s:{}),i?{"x-api-key":i}:{}),u?{"x-faro-session-id":u}:{}),body:t,keepalive:t.length<=6e4},null!=l?l:{})).then((e=>z(this,void 0,void 0,(function*(){if(202===e.status){"invalid"===e.headers.get("X-Faro-Session-Status")&&this.extendFaroSession(this.config,this.logDebug)}return 429===e.status&&(this.disabledUntil=this.getRetryAfterDate(e),this.logWarn(`Too many requests, backing off until ${this.disabledUntil}`)),e.text().catch(o.l),e})))).catch((e=>{this.logError("Failed sending payload to the receiver\n",JSON.parse(t),e)}))}))}catch(e){this.logError(e)}}))}getIgnoreUrls(){var e;return[this.options.url].concat(null!==(e=this.config.ignoreUrls)&&void 0!==e?e:[])}isBatched(){return!0}getRetryAfterDate(e){const t=this.getNow(),n=e.headers.get("Retry-After");if(n){const e=Number(n);if(!isNaN(e))return new Date(1e3*e+t);const r=Date.parse(n);if(!isNaN(r))return new Date(r)}return new Date(t+this.rateLimitBackoffMs)}extendFaroSession(e,t){const n="Session expired",r=e.sessionTracking;if(null==r?void 0:r.enabled){const{fetchUserSession:e,storeUserSession:i}=(0,$.R)(r);(0,B.vP)({fetchUserSession:e,storeUserSession:i})({forceSessionExtend:!0}),t(`${n} created new session.`)}else t(`${n}.`)}}var H=n(7276),W=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function G(e,{trackUserActionsPreview:t}){return e.filter((e=>!("@grafana/faro-web-sdk:instrumentation-user-action"===e.name&&!t)))}function K(e){var t,n;const{page:r,generatePageId:i}=null!==(t=null==e?void 0:e.pageTracking)&&void 0!==t?t:{},a=[N,M({generatePageId:i,initialPageMeta:r}),...null!==(n=e.metas)&&void 0!==n?n:[]];return(0,c.Gv)(window.k6)?[...a,D]:a}function Q({trackGeolocation:e,sessionTracking:t}){var n;const r={};return(0,c.Lm)(e)&&(r.geoLocationTrackingEnabled=e),(0,c.Im)(r)?{}:{session:Object.assign(Object.assign({},null!==(n=null==t?void 0:t.session)&&void 0!==n?n:{}),{overrides:r})}}function Y(e){const t=function(e){var t;const n=[],r=s(e.unpatchedConsole,e.internalLoggerLevel);e.transports?((e.url||e.apiKey)&&r.error('if "transports" is defined, "url" and "apiKey" should not be defined'),n.push(...e.transports)):e.url?n.push(new q({url:e.url,apiKey:e.apiKey})):r.error('either "url" or "transports" must be defined');const{dedupe:o=!0,eventDomain:l=O,globalObjectKey:u=x,instrumentations:c=(0,H.w)(),internalLoggerLevel:d=i.vI,isolate:h=!1,logArgsSerializer:f=_.Z,metas:p=K(e),paused:m=!1,preventGlobalExposure:g=!1,unpatchedConsole:v=a.Z,trackUserActionsPreview:y=!1,trackUserActionsDataAttributeName:b=I.Ij,url:w}=e,S=W(e,["dedupe","eventDomain","globalObjectKey","instrumentations","internalLoggerLevel","isolate","logArgsSerializer","metas","paused","preventGlobalExposure","unpatchedConsole","trackUserActionsPreview","trackUserActionsDataAttributeName","url"]);return Object.assign(Object.assign({},S),{batching:Object.assign(Object.assign({},E),e.batching),dedupe:o,globalObjectKey:u,instrumentations:G(c,e),internalLoggerLevel:d,isolate:h,logArgsSerializer:f,metas:p,parseStacktrace:T,paused:m,preventGlobalExposure:g,transports:n,unpatchedConsole:v,eventDomain:l,ignoreUrls:[...null!==(t=e.ignoreUrls)&&void 0!==t?t:[],...w?[w]:[],/\/collect(?:\/[\w]*)?$/],sessionTracking:Object.assign(Object.assign(Object.assign({},C.Fm),e.sessionTracking),Q({trackGeolocation:e.trackGeolocation,sessionTracking:e.sessionTracking})),trackUserActionsPreview:y,trackUserActionsDataAttributeName:b})}(e);if(t)return S(t)}},3867:(e,t,n)=>{"use strict";n.d(t,{S:()=>i});var r=n(8189);function i(e,t,n,i){const a={filename:e||document.location.href,function:t||r.iC};return void 0!==n&&(a.lineno=n),void 0!==i&&(a.colno=i),a}},8189:(e,t,n)=>{"use strict";n.d(t,{HS:()=>g,Lo:()=>f,N9:()=>h,Sy:()=>l,Wf:()=>i,Wo:()=>u,bz:()=>d,cB:()=>s,iC:()=>a,k4:()=>r,ld:()=>m,mZ:()=>v,rD:()=>p,tE:()=>c,xQ:()=>o});const r="\n",i="eval",a="?",o="@",s=/^\s*at (?:(.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,l=/\((\S*)(?::(\d+))(?::(\d+))\)/,u="eval",c="address at ",d=c.length,h=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\/.*?|\[native code]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,f=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,p=" > eval",m="safari-extension",g="safari-web-extension",v=/Minified React error #\d+;/i},4151:(e,t,n)=>{"use strict";n.d(t,{D:()=>s});var r=n(2019),i=n(3867),a=n(8189);function o(e,t){const n=null==e?void 0:e.includes(a.ld),r=!n&&(null==e?void 0:e.includes(a.HS));return n||r?[(null==e?void 0:e.includes(a.xQ))?e.split(a.xQ)[0]:e,n?`${a.ld}:${t}`:`${a.HS}:${t}`]:[e,t]}function s(e){let t=[];e.stacktrace?t=e.stacktrace.split(a.k4).filter(((e,t)=>t%2==0)):e.stack&&(t=e.stack.split(a.k4));const n=t.reduce(((t,n,s)=>{let l,u,c,d,h;if(l=a.cB.exec(n)){if(u=l[1],c=l[2],d=l[3],h=l[4],null==c?void 0:c.startsWith(a.Wo)){const e=a.Sy.exec(c);e&&(c=e[1],d=e[2],h=e[3])}c=(null==c?void 0:c.startsWith(a.tE))?c.substring(a.bz):c,[u,c]=o(u,c)}else if(l=a.N9.exec(n)){if(u=l[1],c=l[3],d=l[4],h=l[5],c&&c.includes(a.rD)){const e=a.Lo.exec(c);e&&(u=u||a.Wf,c=e[1],d=e[2])}else 0===s&&!h&&(0,r.Et)(e.columnNumber)&&(h=String(e.columnNumber+1));[u,c]=o(u,c)}return(c||u)&&t.push((0,i.S)(c,u,d?Number(d):void 0,h?Number(h):void 0)),t}),[]);return a.mZ.test(e.message)?n.slice(1):n}},4273:(e,t,n)=>{"use strict";n.d(t,{G:()=>u});var r=n(129),i=n(259),a=n(6633),o=n(550),s=n(409),l=n(6854);class u{constructor(){this.updateSession=(0,a.n)((()=>this.updateUserSession()),s.MM),this.updateUserSession=(0,l.vP)({fetchUserSession:u.fetchUserSession,storeUserSession:u.storeUserSession}),this.init()}static removeUserSession(){(0,o.Ai)(s.AQ,u.storageTypeLocal)}static storeUserSession(e){(0,o.SO)(s.AQ,(0,r.xD)(e),u.storageTypeLocal)}static fetchUserSession(){const e=(0,o.Gq)(s.AQ,u.storageTypeLocal);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),i.P.metas.addListener((0,l.h$)({fetchUserSession:u.fetchUserSession,storeUserSession:u.storeUserSession}))}}u.storageTypeLocal=o.Uy.local},6493:(e,t,n)=>{"use strict";n.d(t,{R:()=>d});var r=n(4273),i=n(129),a=n(259),o=n(6633),s=n(550),l=n(409),u=n(6854);class c{constructor(){this.updateSession=(0,o.n)((()=>this.updateUserSession()),l.MM),this.updateUserSession=(0,u.vP)({fetchUserSession:c.fetchUserSession,storeUserSession:c.storeUserSession}),this.init()}static removeUserSession(){(0,s.Ai)(l.AQ,c.storageTypeSession)}static storeUserSession(e){(0,s.SO)(l.AQ,(0,i.xD)(e),c.storageTypeSession)}static fetchUserSession(){const e=(0,s.Gq)(l.AQ,c.storageTypeSession);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),a.P.metas.addListener((0,u.h$)({fetchUserSession:c.fetchUserSession,storeUserSession:c.storeUserSession}))}}function d(e){return(null==e?void 0:e.persistent)?r.G:c}c.storageTypeSession=s.Uy.session},3881:(e,t,n)=>{"use strict";n.d(t,{$:()=>i});var r=n(259);function i(){var e,t,n;const i=r.P.config.sessionTracking;let a=null!==(n=null!==(t=null===(e=null==i?void 0:i.sampler)||void 0===e?void 0:e.call(i,{metas:r.P.metas.value}))&&void 0!==t?t:null==i?void 0:i.samplingRate)&&void 0!==n?n:1;if("number"!=typeof a){a=0}return Math.random()<a}},409:(e,t,n)=>{"use strict";n.d(t,{AQ:()=>r,Fm:()=>s,MM:()=>o,Zl:()=>i,gG:()=>a});const r="com.grafana.faro.session",i=144e5,a=9e5,o=1e3,s={enabled:!0,persistent:!1,maxSessionPersistenceTime:a}},6854:(e,t,n)=>{"use strict";n.d(t,{Bc:()=>h,OW:()=>f,h$:()=>g,vP:()=>p});var r=n(9607),i=n(259),a=n(152),o=n(2019),s=n(7697),l=n(4481),u=n(550),c=n(3881),d=n(409);function h({sessionId:e,started:t,lastActivity:n,isSampled:o=!0}={}){var s,l;const u=(0,r.x3)(),c=null===(l=null===(s=i.P.config)||void 0===s?void 0:s.sessionTracking)||void 0===l?void 0:l.generateSessionId;return null==e&&(e="function"==typeof c?c():(0,a.S)()),{sessionId:e,lastActivity:null!=n?n:u,started:null!=t?t:u,isSampled:o}}function f(e){if(null==e)return!1;const t=(0,r.x3)();if(!(t-e.started<d.Zl))return!1;return t-e.lastActivity<d.gG}function p({fetchUserSession:e,storeUserSession:t}){return function({forceSessionExtend:n}={forceSessionExtend:!1}){var a,o,s;if(!e||!t)return;const l=i.P.config.sessionTracking,d=null==l?void 0:l.persistent;if(d&&!u.OE||!d&&!u.Vv)return;const p=e();if(!1===n&&f(p))t(Object.assign(Object.assign({},p),{lastActivity:(0,r.x3)()}));else{let e=m(h({isSampled:(0,c.$)()}),p);t(e),null===(a=i.P.api)||void 0===a||a.setSession(e.sessionMeta),null===(o=null==l?void 0:l.onSessionChange)||void 0===o||o.call(l,null!==(s=null==p?void 0:p.sessionMeta)&&void 0!==s?s:null,e.sessionMeta)}}}function m(e,t){var n,r,a,s,l,u,c;const d=Object.assign(Object.assign({},e),{sessionMeta:{id:e.sessionId,attributes:Object.assign(Object.assign(Object.assign({},null===(r=null===(n=i.P.config.sessionTracking)||void 0===n?void 0:n.session)||void 0===r?void 0:r.attributes),null!==(s=null===(a=i.P.metas.value.session)||void 0===a?void 0:a.attributes)&&void 0!==s?s:{}),{isSampled:e.isSampled.toString()})}}),h=null!==(u=null===(l=i.P.metas.value.session)||void 0===l?void 0:l.overrides)&&void 0!==u?u:null===(c=null==t?void 0:t.sessionMeta)||void 0===c?void 0:c.overrides;(0,o.Im)(h)||(d.sessionMeta.overrides=h);const f=null==t?void 0:t.sessionId;return null!=f&&(d.sessionMeta.attributes.previousSession=f),d}function g({fetchUserSession:e,storeUserSession:t}){return function(n){const r=n.session,a=e();let o=null==r?void 0:r.id;const u=null==r?void 0:r.attributes,d=null==r?void 0:r.overrides,f=null==a?void 0:a.sessionMeta,p=null==f?void 0:f.overrides,g=!!d&&!(0,s.b)(d,p),v=!!u&&!(0,s.b)(u,null==f?void 0:f.attributes);if(!!r&&o!==(null==a?void 0:a.sessionId)||v||g){const e=m(h({sessionId:o,isSampled:(0,c.$)()}),a);t(e),function(e,t={},n={}){var r,a,o;if(!e)return;const s=t.serviceName,u=null!==(o=null!==(r=n.serviceName)&&void 0!==r?r:null===(a=i.P.metas.value.app)||void 0===a?void 0:a.name)&&void 0!==o?o:"";s&&s!==u&&i.P.api.pushEvent(l.nT,{serviceName:s,previousServiceName:u})}(g,d,p),i.P.api.setSession(e.sessionMeta)}}}},2081:(e,t,n)=>{"use strict";n.d(t,{HU:()=>i,I1:()=>o,IU:()=>a,Ij:()=>l,jJ:()=>s,sk:()=>u,vb:()=>r});const r="resource-entry",i="http-request-start",a="http-request-end",o="dom-mutation",s="faroUserActionName",l="data-faro-user-action-name",u="faroApiCall"},6633:(e,t,n)=>{"use strict";function r(e,t){let n,r=!1;const i=()=>{null!=n?(e(...n),n=null,setTimeout(i,t)):r=!1};return(...a)=>{r?n=a:(e(...a),r=!0,setTimeout(i,t))}}n.d(t,{n:()=>r})},550:(e,t,n)=>{"use strict";n.d(t,{Ai:()=>l,Gq:()=>o,OE:()=>u,SO:()=>s,Uy:()=>i,Vv:()=>c});var r=n(259);const i={session:"sessionStorage",local:"localStorage"};function a(e){var t;try{let t;t=window[e];const n="__faro_storage_test__";return t.setItem(n,n),t.removeItem(n),!0}catch(n){return null===(t=r.P.internalLogger)||void 0===t||t.info(`Web storage of type ${e} is not available. Reason: ${n}`),!1}}function o(e,t){return d(t)?window[t].getItem(e):null}function s(e,t,n){if(d(n))try{window[n].setItem(e,t)}catch(e){}}function l(e,t){d(t)&&window[t].removeItem(e)}const u=a(i.local),c=a(i.session);function d(e){return e===i.local?u:e===i.session&&c}},9869:(e,t,n)=>{"use strict";n.d(t,{H9:()=>au,yP:()=>Xc,mI:()=>Zc,d0:()=>pf,fS:()=>Zu,UU:()=>L,xK:()=>oh,gF:()=>ah,Es:()=>fi,vA:()=>rh,G1:()=>nh,Bs:()=>I,So:()=>Y,dt:()=>gu,dM:()=>gh,WM:()=>Gd,KE:()=>Bd,JZ:()=>le,Pj:()=>Kc,n1:()=>ph,$L:()=>vd,Sh:()=>Mu,Eb:()=>pi,Lw:()=>wd,Gg:()=>r,jh:()=>lc,Go:()=>mf});var r={};n.r(r),n.d(r,{K2:()=>ii});var i=n(1159),a=n(7781),o=n(8531);function s(e,t,n){const r={...t};if(n)for(const e of Object.keys(r))n.includes(e)||delete r[e];return a.urlUtil.renderUrl(a.locationUtil.assureBaseUrl(e),r)}function l(e){const t=(0,i.useParams)(),n=(0,i.useLocation)();return{params:t,isExact:null!==(0,i.matchPath)({path:e,caseSensitive:!1,end:!0},n.pathname),path:n.pathname,url:n.pathname}}const u=new Map;var c=n(5959),d=n.t(c,2),h=n.n(c),f=n(1269);const p={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let m;const g=new Uint8Array(16);function v(){if(!m&&(m="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!m))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return m(g)}const y=[];for(let e=0;e<256;++e)y.push((e+256).toString(16).slice(1));function b(e,t=0){return y[e[t+0]]+y[e[t+1]]+y[e[t+2]]+y[e[t+3]]+"-"+y[e[t+4]]+y[e[t+5]]+"-"+y[e[t+6]]+y[e[t+7]]+"-"+y[e[t+8]]+y[e[t+9]]+"-"+y[e[t+10]]+y[e[t+11]]+y[e[t+12]]+y[e[t+13]]+y[e[t+14]]+y[e[t+15]]}const w=function(e,t,n){if(p.randomUUID&&!t&&!e)return p.randomUUID();const r=(e=e||{}).random||(e.rng||v)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return b(r)};const S=h().memo((function({model:e,...t}){var n;const r=null!=(n=e.constructor.Component)?n:x,[i,a]=(0,c.useState)(0);return(0,c.useEffect)((()=>{const t=e.activate();return a((e=>e+1)),t}),[e]),e.isActive||e.renderBeforeActivation?h().createElement(r,{...t,model:e}):null}));function x(e){return null}class E extends a.BusEventWithPayload{}E.type="scene-object-state-change";class _ extends a.BusEventWithPayload{}_.type="scene-object-user-action";var O,k=e=>{throw TypeError(e)},T=(e,t,n)=>t.has(e)||k("Cannot "+n);class C{constructor(e){var t,n,r;t=this,(n=O).has(t)?k("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,r),((e,t,n,r)=>{T(e,t,"write to private field"),t.set(e,n)})(this,O,e)}resolve(){return T(e=this,t=O,"read from private field"),n?n.call(e):t.get(e);var e,t,n}}O=new WeakMap;class I{constructor(e){this._isActive=!1,this._activationHandlers=[],this._deactivationHandlers=new Map,this._subs=new f.Subscription,this._refCount=0,this._renderBeforeActivation=!1,e.key||(e.key=w()),this._events=new a.EventBusSrv,this._state=Object.freeze(e),this._setParent(this._state)}get state(){return this._state}get isActive(){return this._isActive}get renderBeforeActivation(){return this._renderBeforeActivation}get parent(){return this._parent}get variableDependency(){return this._variableDependency}get urlSync(){return this._urlSync}get Component(){return S}_setParent(e){A(e,(e=>{e._parent&&e._parent!==this&&console.warn("SceneObject already has a parent set that is different from the new parent. You cannot share the same SceneObject instance in multiple scenes or in multiple different places of the same scene graph. Use SceneObject.clone() to duplicate a SceneObject or store a state key reference and use sceneGraph.findObject to locate it.",e,this),e._parent=this}))}clearParent(){this._parent=void 0}subscribeToState(e){return this._events.subscribe(E,(t=>{t.payload.changedObject===this&&e(t.payload.newState,t.payload.prevState)}))}subscribeToEvent(e,t){return this._events.subscribe(e,t)}setState(e){const t=this._state,n={...this._state,...e};this._state=Object.freeze(n),this._setParent(e),this._handleActivationOfChangedStateProps(t,n),this.publishEvent(new E({prevState:t,newState:n,partialUpdate:e,changedObject:this}),!0)}_handleActivationOfChangedStateProps(e,t){this.isActive&&(e.$behaviors!==t.$behaviors&&this._handleChangedBehaviors(e.$behaviors,t.$behaviors),e.$data!==t.$data&&this._handleChangedStateActivation(e.$data,t.$data),e.$variables!==t.$variables&&this._handleChangedStateActivation(e.$variables,t.$variables),e.$timeRange!==t.$timeRange&&this._handleChangedStateActivation(e.$timeRange,t.$timeRange))}_handleChangedStateActivation(e,t){if(e){const t=this._deactivationHandlers.get(e);t&&(t(),this._deactivationHandlers.delete(e))}t&&this._deactivationHandlers.set(t,t.activate())}_handleChangedBehaviors(e,t){if(e)for(const n of e)if(!t||!t.includes(n)){const e=this._deactivationHandlers.get(n);e&&(e(),this._deactivationHandlers.delete(n))}if(t)for(const n of t)e&&e.includes(n)||this._activateBehavior(n)}publishEvent(e,t){this._events.publish(e),t&&this.parent&&this.parent.publishEvent(e,t)}getRoot(){return this._parent?this._parent.getRoot():this}_internalActivate(){this._isActive=!0;const{$data:e,$variables:t,$timeRange:n,$behaviors:r}=this.state;if(this._activationHandlers.forEach((e=>{const t=e();t&&this._deactivationHandlers.set(t,t)})),n&&!n.isActive&&this._deactivationHandlers.set(n,n.activate()),t&&!t.isActive&&this._deactivationHandlers.set(t,t.activate()),e&&!e.isActive&&this._deactivationHandlers.set(e,e.activate()),r)for(const e of r)this._activateBehavior(e)}_activateBehavior(e){if(e instanceof I)this._deactivationHandlers.set(e,e.activate());else if("function"==typeof e){const t=e(this);t&&this._deactivationHandlers.set(e,t)}}activate(){this.isActive||this._internalActivate(),this._refCount++;let e=!1;return()=>{if(this._refCount--,e){throw new Error("SceneObject cancelation handler returned by activate() called a second time")}e=!0,0===this._refCount&&this._internalDeactivate()}}_internalDeactivate(){this._isActive=!1;for(let e of this._deactivationHandlers.values())e();this._deactivationHandlers.clear(),this._events.removeAllListeners(),this._subs.unsubscribe(),this._subs=new f.Subscription}useState(){return R(this)}forceRender(){this.setState({})}clone(e){return function(e,t){const n=D(e.state,t);return new e.constructor(n)}(this,e)}addActivationHandler(e){this._activationHandlers.push(e)}forEachChild(e){A(this.state,e)}getRef(){return this._ref||(this._ref=new C(this)),this._ref}toJSON(){return{type:Object.getPrototypeOf(this).constructor.name,isActive:this.isActive,state:this.state}}}function R(e,t){var n;const[r,i]=(0,c.useState)(e.state),a=e.state,o=null!=(n=null==t?void 0:t.shouldActivateOrKeepAlive)&&n;return(0,c.useEffect)((()=>{let t;o&&(t=e.activate());const n=e.subscribeToState((e=>{i(e)}));return e.state!==a&&i(e.state),()=>{n.unsubscribe(),t&&t()}}),[e,o]),e.state}function A(e,t){for(const n of Object.values(e)){if(n instanceof I){if(!1===t(n))break}if(Array.isArray(n)){let e=!1;for(const r of n)if(r instanceof I){if(!1===t(r)){e=!0;break}}if(e)break}}}var N=n(3241);function D(e,t){const n={...e};Object.assign(n,t);for(const e in n){if(t&&void 0!==t[e])continue;const r=n[e];if(r instanceof C)console.warn("Cloning object with SceneObjectRef");else if(r instanceof I)n[e]=r.clone();else if(Array.isArray(r)){const t=[];for(const e of r)e instanceof I?t.push(e.clone()):"object"==typeof e?t.push((0,N.cloneDeep)(e)):t.push(e);n[e]=t}else n[e]="object"==typeof r?(0,N.cloneDeep)(r):r}return n}class L extends a.DataSourceApi{constructor(e,t){super({name:"RuntimeDataSource-"+e,uid:t,type:e,id:1,readOnly:!0,jsonData:{},access:"direct",meta:{id:e,name:"RuntimeDataSource-"+e,type:a.PluginType.datasource,info:{author:{name:""},description:"",links:[],logos:{large:"",small:""},screenshots:[],updated:"",version:""},module:"",baseUrl:""}})}testDatasource(){return Promise.resolve({})}}const P=new Map;const M=["from","to","timezone"];class j{constructor(e){this.index=new Map,this.options={namespace:(null==e?void 0:e.namespace)||"",excludeFromNamespace:(null==e?void 0:e.excludeFromNamespace)||M}}getOptions(){return this.options}getNamespacedKey(e){return this.options.namespace&&!this.options.excludeFromNamespace.includes(e)?`${this.options.namespace}-${e}`:e}getUniqueKey(e,t){const n=this.getNamespacedKey(e),r=this.index.get(n);if(!r)return this.index.set(n,[t]),n;let i=r.findIndex((e=>e===t));return-1===i&&(!function(e,t){for(let t=0;t<e.length;t++){F(e[t])&&(e.splice(t,1),t--)}}(r,t.getRoot()),r.push(t),i=r.length-1),i>0?`${n}-${i+1}`:n}clear(){this.index.clear()}}function F(e,t){if(!e.parent)return!1;let n=!1;return e.parent.forEachChild((t=>{if(t===e)return n=!0,!1})),!n||F(e.parent)}function V(e,t){const n=new j(t),r={},i=e=>{if(e.urlSync){const t=e.urlSync.getUrlState();for(const[i,a]of Object.entries(t))if(null!=a){const t=n.getUniqueKey(i,e);r[t]=a}}e.forEachChild(i)};return i(e),r}function $(e,t,n,r){r||B(e,t,n),e.forEachChild((e=>{B(e,t,n)})),e.forEachChild((e=>$(e,t,n,!0)))}function B(e,t,n){if(e.urlSync){const r={},i=e.urlSync.getUrlState();for(const a of e.urlSync.getKeys()){const o=n.getUniqueKey(a,e),s=t.getAll(o),l=i[a];z(s,l)||(s.length>0?Array.isArray(l)?r[a]=s:r[a]=s[0]:r[a]=null)}Object.keys(r).length>0&&e.urlSync.updateFromUrl(r)}}function z(e,t){return 0===e.length&&null==t||(Array.isArray(t)||1!==(null==e?void 0:e.length)?0===(null==t?void 0:t.length)&&null===e||(0,N.isEqual)(e,t):t===e[0])}function U(e,t){const n=t.state.$variables;if(!n)return t.parent?U(e,t.parent):null;const r=n.getByName(e);return r||(t.parent?U(e,t.parent):null)}function q(e,t,...n){let r=!1;"undefined"!=typeof window&&(r="true"===localStorage.getItem("grafana.debug.scenes"))}function H(e){return"isQueryController"in e}function W(e){let t=e;for(;t;){if(t.state.$behaviors)for(const e of t.state.$behaviors)if(H(e))return e;t=t.parent}}new WeakMap,new WeakMap;var G=n(1625);G.ob.Auto;var K=(e=>(e.NotStarted="NotStarted",e.Loading="Loading",e.Streaming="Streaming",e.Done="Done",e.Error="Error",e))(K||{});const Q={state:K.Done,series:[],timeRange:(0,a.getDefaultTimeRange)()};class Y{constructor(e,t){this._sceneObject=e,this._nextChangeShouldAddHistoryStep=!1,this._keys=t.keys}getKeys(){return"function"==typeof this._keys?this._keys():this._keys}getUrlState(){return this._sceneObject.getUrlState()}updateFromUrl(e){this._sceneObject.updateFromUrl(e)}shouldCreateHistoryStep(e){return this._nextChangeShouldAddHistoryStep}performBrowserHistoryAction(e){this._nextChangeShouldAddHistoryStep=!0,e(),this._nextChangeShouldAddHistoryStep=!1}}function X(e,t){let n,r=e;for(;r&&!n;)n=t(r),r=r.parent;return n}const J=/^\d+[yYmMsSwWhHdD]$/;function Z(e){if("string"!=typeof e)return null;if(-1!==e.indexOf("now"))return e;if(J.test(e))return e;if(8===e.length){const t=(0,a.toUtc)(e,"YYYYMMDD");if(t.isValid())return t.toISOString()}else if(15===e.length){const t=(0,a.toUtc)(e,"YYYYMMDDTHHmmss");if(t.isValid())return t.toISOString()}else if(19===e.length){const t=(0,a.toUtc)(e,"YYYY-MM-DD HH:mm:ss");if(t.isValid())return t.toISOString()}else if(24===e.length){return(0,a.toUtc)(e).toISOString()}const t=parseInt(e,10);return isNaN(t)?null:(0,a.toUtc)(t).toISOString()}function ee(e,t,n,r,i,o){const s=i&&"now"===t,l=Date.now();o&&function(e){e!==te&&(te=e,(0,a.setWeekStart)(e))}(o);const u=(e,t)=>a.dateMath.toDateTime?a.dateMath.toDateTime(e,t):a.dateMath.parse(e,t.roundUp,t.timezone,t.fiscalYearStartMonth);return{to:u(s?"now-"+i:t,{roundUp:!0,timezone:n,fiscalYearStartMonth:r,now:l}),from:u(e,{roundUp:!1,timezone:n,fiscalYearStartMonth:r,now:l}),raw:{from:e,to:t}}}let te;function ne(e,t,n){if((0,a.isDateTime)(e))return e.isValid();if(a.dateMath.isMathString(e))return a.dateMath.isValid(e);return(0,a.dateTimeParse)(e,{roundUp:t,timeZone:n}).isValid()}const re="refresh",ie="filter_removed",ae="filter_changed",oe="variable_value_changed",se="groupby_dimensions";class le extends I{constructor(e={}){var t;const n=e.from&&ne(e.from)?e.from:"now-6h",r=e.to&&ne(e.to)?e.to:"now",i=ue(e.timeZone);super({from:n,to:r,timeZone:i,value:ee(n,r,i||(0,a.getTimeZone)(),e.fiscalYearStartMonth,e.UNSAFE_nowDelay,e.weekStart),refreshOnActivate:null!=(t=e.refreshOnActivate)?t:{percent:10},...e}),this._urlSync=new Y(this,{keys:["from","to","timezone","time","time.window"]}),this.onTimeRangeChange=e=>{const t={};if("string"==typeof e.raw.from?t.from=e.raw.from:t.from=e.raw.from.toISOString(),"string"==typeof e.raw.to?t.to=e.raw.to:t.to=e.raw.to.toISOString(),t.value=ee(t.from,t.to,this.getTimeZone(),this.state.fiscalYearStartMonth,this.state.UNSAFE_nowDelay,this.state.weekStart),t.from!==this.state.from||t.to!==this.state.to){const e=W(this);null==e||e.startProfile("time_range_change"),this._urlSync.performBrowserHistoryAction((()=>{this.setState(t)}))}},this.onTimeZoneChange=e=>{this._urlSync.performBrowserHistoryAction((()=>{var t;const n=null!=(t=ue(e))?t:G.vp,r=ee(this.state.from,this.state.to,n,this.state.fiscalYearStartMonth,this.state.UNSAFE_nowDelay,this.state.weekStart);this.setState({timeZone:n,value:r})}))},this.onRefresh=()=>{this.refreshRange(0),this.publishEvent(new o.RefreshEvent,!0)},this.addActivationHandler(this._onActivate.bind(this))}_onActivate(){if(!this.state.timeZone){const e=this.getTimeZoneSource();e!==this&&this._subs.add(e.subscribeToState(((e,t)=>{void 0!==e.timeZone&&e.timeZone!==t.timeZone&&this.refreshRange(0)})))}return a.rangeUtil.isRelativeTimeRange(this.state.value.raw)&&this.refreshIfStale(),()=>{this.state.weekStart&&(0,a.setWeekStart)(o.config.bootData.user.weekStart)}}refreshIfStale(){var e,t,n,r;let i;void 0!==(null==(t=null==(e=this.state)?void 0:e.refreshOnActivate)?void 0:t.percent)&&(i=this.calculatePercentOfInterval(this.state.refreshOnActivate.percent)),void 0!==(null==(r=null==(n=this.state)?void 0:n.refreshOnActivate)?void 0:r.afterMs)&&(i=Math.min(this.state.refreshOnActivate.afterMs,null!=i?i:1/0)),void 0!==i&&this.refreshRange(i)}getTimeZoneSource(){if(!this.parent||!this.parent.parent)return this;const e=X(this.parent.parent,(e=>{if(e.state.$timeRange&&e.state.$timeRange.state.timeZone)return e.state.$timeRange}));return e||this}refreshRange(e){var t;const n=ee(this.state.from,this.state.to,null!=(t=this.state.timeZone)?t:(0,a.getTimeZone)(),this.state.fiscalYearStartMonth,this.state.UNSAFE_nowDelay,this.state.weekStart);n.to.diff(this.state.value.to,"milliseconds")>=e&&this.setState({value:n})}calculatePercentOfInterval(e){const t=this.state.value.to.diff(this.state.value.from,"milliseconds");return Math.ceil(t/100*e)}getTimeZone(){if(this.state.timeZone&&ue(this.state.timeZone))return this.state.timeZone;const e=this.getTimeZoneSource();return e!==this&&ue(e.state.timeZone)?e.state.timeZone:(0,a.getTimeZone)()}getUrlState(){const e=o.locationService.getSearchObject(),t={from:this.state.from,to:this.state.to,timezone:this.getTimeZone()};return e.time&&e["time.window"]&&(t.time=null,t["time.window"]=null),t}updateFromUrl(e){var t,n,r;const i={};let o=Z(e.from),s=Z(e.to);if(e.time&&e["time.window"]){const t=function(e,t){const n=isNaN(Date.parse(e))?parseInt(e,10):Date.parse(e);let r;r=t.match(/^\d+$/)&&parseInt(t,10)?parseInt(t,10):a.rangeUtil.intervalToMs(t);return{from:(0,a.toUtc)(n-r/2).toISOString(),to:(0,a.toUtc)(n+r/2).toISOString()}}(Array.isArray(e.time)?e.time[0]:e.time,Array.isArray(e["time.window"])?e["time.window"][0]:e["time.window"]);t.from&&ne(t.from)&&(o=t.from),t.to&&ne(t.to)&&(s=t.to)}if(o&&ne(o)&&(i.from=o),s&&ne(s)&&(i.to=s),"string"==typeof e.timezone&&(i.timeZone=""!==e.timezone?e.timezone:void 0),0!==Object.keys(i).length)return i.value=ee(null!=(t=i.from)?t:this.state.from,null!=(n=i.to)?n:this.state.to,null!=(r=i.timeZone)?r:this.getTimeZone(),this.state.fiscalYearStartMonth,this.state.UNSAFE_nowDelay,this.state.weekStart),this.setState(i)}}function ue(e){if(void 0!==e)return(0,N.isEmpty)(e)?o.config.bootData.user.timezone:e===G.vp||(0,a.getZone)(e)?e:void q()}const ce=new class extends I{constructor(e){super({data:Q,...e})}getResultsStream(){const e={origin:this,data:this.state.data};return(0,f.of)(e)}},de=new le;const he=new class extends I{constructor(){super({variables:[]})}getByName(e){}isVariableLoadingOrWaitingToUpdate(e){return!1}};function fe(e){var t;return null!=(t=X(e,(e=>e.state.$timeRange)))?t:de}class pe extends a.BusEventWithPayload{}function me(e){return"object"==typeof e&&"formatter"in e}pe.type="scene-variable-changed-value";let ge,ve={};function ye(e){const t=ve[e];return t||(ve[e]=(0,N.property)(e))}class be{constructor(e,t){this.state={name:e,value:t,type:"scopedvar"}}getValue(e){let{value:t}=this.state,n=t.value;return n=e?ye(e)(t.value):t.value,"string"===n||"number"===n||"boolean"===n?n:String(n)}getValueText(){const{value:e}=this.state;return null!=e.text?String(e.text):String(e)}}var we=n(2540);const Se=e=>"string"==typeof e,xe=()=>{let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return n.resolve=e,n.reject=t,n},Ee=e=>null==e?"":""+e,_e=/###/g,Oe=e=>e&&e.indexOf("###")>-1?e.replace(_e,"."):e,ke=e=>!e||Se(e),Te=(e,t,n)=>{const r=Se(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(ke(e))return{};const t=Oe(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return ke(e)?{}:{obj:e,k:Oe(r[i])}},Ce=(e,t,n)=>{const{obj:r,k:i}=Te(e,t,Object);if(void 0!==r||1===t.length)return void(r[i]=n);let a=t[t.length-1],o=t.slice(0,t.length-1),s=Te(e,o,Object);for(;void 0===s.obj&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=Te(e,o,Object),s?.obj&&void 0!==s.obj[`${s.k}.${a}`]&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},Ie=(e,t)=>{const{obj:n,k:r}=Te(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Re=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?Se(e[r])||e[r]instanceof String||Se(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Re(e[r],t[r],n):e[r]=t[r]);return e},Ae=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Ne={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const De=e=>Se(e)?e.replace(/[&<>"'\/]/g,(e=>Ne[e])):e;const Le=[" ",",","?","!",";"],Pe=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),Me=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const r=t.split(n);let i=e;for(let e=0;e<r.length;){if(!i||"object"!=typeof i)return;let t,a="";for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},je=e=>e?.replace("_","-"),Fe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class Ve{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Fe,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(Se(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Ve(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Ve(this.logger,e)}}var $e=new Ve;class Be{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)})),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach((([e,n])=>{for(let r=0;r<n;r++)e(...t)}))}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach((([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[e,...t])}))}}}class ze extends Be{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){const i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,a=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):Se(n)&&i?o.push(...n.split(i)):o.push(n)));const s=Ie(this.data,o);return!s&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),!s&&a&&Se(n)?Me(this.data?.[e]?.[t],n,i):s}addResource(e,t,n,r,i={silent:!1}){const a=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(".")>-1&&(o=e.split("."),r=t,t=o[1]),this.addNamespaces(t),Ce(this.data,o,r),i.silent||this.emit("added",e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(const r in n)(Se(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=Ie(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Re(s,n,i):s={...s,...n},Ce(this.data,o,s),a.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var Ue={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach((e=>{t=this.processors[e]?.process(t,n,r,i)??t})),t}};const qe={},He=e=>!Se(e)&&"boolean"!=typeof e&&"number"!=typeof e;class We extends Be{constructor(e,t={}){super(),((e,t,n)=>{e.forEach((e=>{t[e]&&(n[e]=t[e])}))})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=$e.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const r=this.resolve(e,n);return void 0!==r?.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const a=n&&e.indexOf(n)>-1,o=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const r=Le.filter((e=>t.indexOf(e)<0&&n.indexOf(e)<0));if(0===r.length)return!0;const i=Pe.getRegExp(`(${r.map((e=>"?"===e?"\\?":e)).join("|")})`);let a=!i.test(e);if(!a){const t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a})(e,n,r));if(a&&!o){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Se(i)?[i]:i};const a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:Se(i)?[i]:i}}translate(e,t,n){let r="object"==typeof t?{...t}:t;if("object"!=typeof r&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof options&&(r={...r}),r||(r={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const i=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,a=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,{key:o,namespaces:s}=this.extractFromKey(e[e.length-1],r),l=s[s.length-1];let u=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===u&&(u=":");const c=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===c?.toLowerCase())return d?i?{res:`${l}${u}${o}`,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${u}${o}`:i?{res:o,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:o;const h=this.resolve(e,r);let f=h?.res;const p=h?.usedKey||o,m=h?.exactUsedKey||o,g=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,y=void 0!==r.count&&!Se(r.count),b=We.hasDefaultValue(r),w=y?this.pluralResolver.getSuffix(c,r.count,r):"",S=r.ordinal&&y?this.pluralResolver.getSuffix(c,r.count,{ordinal:!1}):"",x=y&&!r.ordinal&&0===r.count,E=x&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${w}`]||r[`defaultValue${S}`]||r.defaultValue;let _=f;v&&!f&&b&&(_=E);const O=He(_),k=Object.prototype.toString.apply(_);if(!(v&&_&&O&&["[object Number]","[object Function]","[object RegExp]"].indexOf(k)<0)||Se(g)&&Array.isArray(_))if(v&&Se(g)&&Array.isArray(f))f=f.join(g),f&&(f=this.extendTranslation(f,e,r,n));else{let t=!1,i=!1;!this.isValidLookup(f)&&b&&(t=!0,f=E),this.isValidLookup(f)||(i=!0,f=o);const s=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:f,d=b&&E!==f&&this.options.updateMissing;if(i||t||d){if(this.logger.log(d?"updateKey":"missingKey",c,l,o,d?E:f),a){const e=this.resolve(o,{...r,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(r.lng||this.language):e.push(r.lng||this.language);const n=(e,t,n)=>{const i=b&&n!==f?n:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,i,d,r):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,i,d,r),this.emit("missingKey",e,l,t,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&y?e.forEach((e=>{const t=this.pluralResolver.getSuffixes(e,r);x&&r[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach((t=>{n([e],o+t,r[`defaultValue${t}`]||E)}))})):n(e,o,E))}f=this.extendTranslation(f,e,r,h,n),i&&f===o&&this.options.appendNamespaceToMissingKey&&(f=`${l}${u}${o}`),(i||t)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${o}`:o,t?f:void 0,r))}else{if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,_,{...r,ns:s}):`key '${o} (${this.language})' returned an object instead of string.`;return i?(h.res=e,h.usedParams=this.getUsedParamsDetails(r),h):e}if(a){const e=Array.isArray(_),t=e?[]:{},n=e?m:p;for(const e in _)if(Object.prototype.hasOwnProperty.call(_,e)){const i=`${n}${a}${e}`;t[e]=b&&!f?this.translate(i,{...r,defaultValue:He(E)?E[e]:void 0,joinArrays:!1,ns:s}):this.translate(i,{...r,joinArrays:!1,ns:s}),t[e]===i&&(t[e]=_[e])}f=t}}return i?(h.res=f,h.usedParams=this.getUsedParamsDetails(r),h):f}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const a=Se(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let o;if(a){const t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!Se(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){const t=e.match(this.interpolator.nestingRegexp);o<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,((...e)=>i?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null)),n)),n.interpolation&&this.interpolator.reset()}const a=n.postProcess||this.options.postProcess,o=Se(a)?[a]:a;return null!=e&&o?.length&&!1!==n.applyPostProcessor&&(e=Ue.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return Se(e)&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(n))return;const s=this.extractFromKey(e,t),l=s.key;r=l;let u=s.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const c=void 0!==t.count&&!Se(t.count),d=c&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(Se(t.context)||"number"==typeof t.context)&&""!==t.context,f=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach((e=>{this.isValidLookup(n)||(o=e,qe[`${f[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(o)||(qe[`${f[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${f.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach((r=>{if(this.isValidLookup(n))return;a=r;const o=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,l,r,e,t);else{let e;c&&(e=this.pluralResolver.getSuffix(r,t.count,t));const n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(o.push(l+e),t.ordinal&&0===e.indexOf(i)&&o.push(l+e.replace(i,this.options.pluralSeparator)),d&&o.push(l+n)),h){const r=`${l}${this.options.contextSeparator}${t.context}`;o.push(r),c&&(o.push(r+e),t.ordinal&&0===e.indexOf(i)&&o.push(r+e.replace(i,this.options.pluralSeparator)),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))})))}))})),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Se(e.replace);let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}class Ge{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=$e.create("languageUtils")}getScriptPartFromCode(e){if(!(e=je(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=je(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Se(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;const r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find((e=>e===r?e:e.indexOf("-")<0&&r.indexOf("-")<0?void 0:e.indexOf("-")>0&&r.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===r||0===e.indexOf(r)&&r.length>1?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),Se(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Se(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):Se(e)&&i(this.formatLanguageCode(e)),n.forEach((e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))})),r}}const Ke={zero:0,one:1,two:2,few:3,many:4,other:5},Qe={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Ye{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=$e.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=je("dev"===e?"en":e),r=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Qe;if(!e.match(/-|_/))return Qe;const r=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(r,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map((e=>`${t}${e}`))}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort(((e,t)=>Ke[e]-Ke[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):[]}getSuffix(e,t,n={}){const r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const Xe=(e,t,n,r=".",i=!0)=>{let a=((e,t,n)=>{const r=Ie(e,n);return void 0!==r?r:Ie(t,n)})(e,t,n);return!a&&i&&Se(n)&&(a=Me(e,n,r),void 0===a&&(a=Me(t,n,r))),a},Je=e=>e.replace(/\$/g,"$$$$");class Ze{constructor(e={}){this.logger=$e.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:l,unescapeSuffix:u,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:f,nestingSuffixEscaped:p,nestingOptionsSeparator:m,maxReplaces:g,alwaysFormat:v}=e.interpolation;this.escape=void 0!==t?t:De,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=i?Ae(i):a||"{{",this.suffix=o?Ae(o):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?Ae(d):h||Ae("$t("),this.nestingSuffix=f?Ae(f):p||Ae(")"),this.nestingOptionsSeparator=m||",",this.maxReplaces=g||1e3,this.alwaysFormat=void 0!==v&&v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const i=Xe(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}const i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(Xe(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();const u=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=void 0!==r?.interpolation?.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Je(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Je(this.escape(e)):Je(e)}].forEach((t=>{for(o=0;i=t.regex.exec(e);){const n=i[1].trim();if(a=l(n),void 0===a)if("function"==typeof u){const t=u(e,i,r);a=Se(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a="";else{if(c){a=i[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=""}else Se(a)||this.useRawValueToEscape||(a=Ee(a));const s=t.safeValue(a);if(e=e.replace(i[0],s),c?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}})),e}nest(e,t,n={}){let r,i,a;const o=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);const o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!Se(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const l=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(-1!==l&&(s=r[1].slice(l).split(this.formatSeparator).map((e=>e.trim())).filter(Boolean),r[1]=r[1].slice(0,l)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!Se(i))return i;Se(i)||(i=Ee(i)),i||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),i=""),s.length&&(i=s.reduce(((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()})),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}}const et=e=>{const t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});const o=r+JSON.stringify(a);let s=t[o];return s||(s=e(je(r),i),t[o]=s),s(n)}},tt=e=>(t,n,r)=>e(je(n),r)(t);class nt{constructor(e={}){this.logger=$e.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?et:tt;this.formats={number:n(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:n(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:n(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:n(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:n(((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)}))}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=et(t)}format(e,t,n,r={}){const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find((e=>e.indexOf(")")>-1))){const e=i.findIndex((e=>e.indexOf(")")>-1));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}const a=i.reduce(((e,t)=>{const{formatName:i,formatOptions:a}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach((e=>{if(e){const[t,...r]=e.split(":"),i=r.join(":").trim().replace(/^'+|'+$/g,""),a=t.trim();n[a]||(n[a]=i),"false"===i&&(n[a]=!1),"true"===i&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}}))}return{formatName:t,formatOptions:n}})(t);if(this.formats[i]){let t=e;try{const o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e}),e);return a}}class rt extends Be{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=$e.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){const i={},a={},o={},s={};return e.forEach((e=>{let r=!0;t.forEach((t=>{const o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(1===this.state[o]?void 0===a[o]&&(a[o]=!0):(this.state[o]=1,r=!1,void 0===a[o]&&(a[o]=!0),void 0===i[o]&&(i[o]=!0),void 0===s[t]&&(s[t]=!0)))})),r||(o[e]=!0)})),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){const r=e.split("|"),i=r[0],a=r[1];t&&this.emit("failedLoading",i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const o={};this.queue.forEach((n=>{((e,t,n,r)=>{const{obj:i,k:a}=Te(e,t,Object);i[a]=i[a]||[],i[a].push(n)})(n.loaded,[i],a),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((e=>{o[e]||(o[e]={});const t=n.loaded[e];t.length&&t.forEach((t=>{void 0===o[e][t]&&(o[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",o),this.queue=this.queue.filter((e=>!e.done))}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});this.readingCalls++;const o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}o&&s&&r<this.maxRetries?setTimeout((()=>{this.read.call(this,e,t,n,r+1,2*i,a)}),i):a(o,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(e,t,o);try{const n=s(e,t);n&&"function"==typeof n.then?n.then((e=>o(null,e))).catch(o):o(null,n)}catch(e){o(e)}}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Se(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Se(t)&&(t=[t]);const i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),r=n[0],i=n[1];this.read(r,i,"read",void 0,void 0,((n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)}))}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=n&&""!==n){if(this.backend?.create){const s={...a,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;i=5===l.length?l(e,t,n,r,s):l(e,t,n,r),i&&"function"==typeof i.then?i.then((e=>o(null,e))).catch(o):o(null,i)}catch(e){o(e)}else l(e,t,n,r,o,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const it=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),Se(e[1])&&(t.defaultValue=e[1]),Se(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach((e=>{t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),at=e=>(Se(e.ns)&&(e.ns=[e.ns]),Se(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Se(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),ot=()=>{};class st extends Be{constructor(e={},t){var n;if(super(),this.options=at(e),this.services={},this.logger=$e,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))})),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(Se(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=it();this.options={...n,...this.options,...at(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);const r=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?$e.init(r(this.modules.logger),this.options):$e.init(null,this.options),e=this.modules.formatter?this.modules.formatter:nt;const t=new Ge(this.options);this.store=new ze(this.options.resources,this.options);const i=this.services;i.logger=$e,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new Ye(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix});this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.warn("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!e||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new Ze(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new rt(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",((e,...t)=>{this.emit(e,...t)})),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new We(this.services,this.options),this.translator.on("*",((e,...t)=>{this.emit(e,...t)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,t||(t=ot),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((e=>{this[e]=(...t)=>this.store[e](...t)}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((e=>{this[e]=(...t)=>(this.store[e](...t),this)}));const i=xe(),a=()=>{const e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=ot){let n=t;const r=Se(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===r?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};if(r)t(r);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>t(e)))}this.options.preload?.forEach?.((e=>t(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)}))}else n(null)}reloadResources(e,t,n){const r=xe();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=ot),this.services.backendConnector.reload(e,t,(e=>{r.resolve(),n(e)})),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Ue.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=xe();this.emit("languageChanging",e);const r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit("languageChanged",a),this.logger.log("languageChanged",a)):this.isLanguageChangingTo=void 0,n.resolve(((...e)=>this.t(...e))),t&&t(i,((...e)=>this.t(...e)))},a=t=>{e||t||!this.services.languageDetector||(t=[]);const n=Se(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Se(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,(e=>{i(e,a)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),n}getFixedT(e,t,n){const r=(e,t,...i)=>{let a;a="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(i)):{...t},a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,""!==a.keyPrefix&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);const o=this.options.keySeparator||".";let s;return s=a.keyPrefix&&Array.isArray(e)?e.map((e=>`${a.keyPrefix}${o}${e}`)):a.keyPrefix?`${a.keyPrefix}${o}${e}`:e,this.t(s,a)};return Se(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const a=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,a);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(n,e)||r&&!a(i,e)))}loadNamespaces(e,t){const n=xe();return this.options.ns?(Se(e)&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=xe();Se(e)&&(e=[e]);const r=this.options.preload||[],i=e.filter((e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e)));return i.length?(this.options.preload=r.concat(i),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=this.services?.languageUtils||new Ge(it());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new st(e,t)}cloneInstance(e={},t=ot){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},i=new st(r);void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e));if(["store","services","language"].forEach((e=>{i[e]=this[e]})),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},n){const e=Object.keys(this.store.data).reduce(((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce(((n,r)=>(n[r]={...e[t][r]},n)),e[t]),e)),{});i.store=new ze(e,r),i.services.resourceStore=i.store}return i.translator=new We(i.services,r),i.translator.on("*",((e,...t)=>{i.emit(e,...t)})),i.init(r,t),i.translator.options=r,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const lt=st.createInstance();lt.createInstance=st.createInstance;lt.createInstance,lt.dir,lt.init,lt.loadResources,lt.reloadResources,lt.use,lt.changeLanguage,lt.getFixedT,lt.t,lt.exists,lt.setDefaultNamespace,lt.hasLoadedNamespace,lt.loadNamespaces,lt.loadLanguages;const{slice:ut,forEach:ct}=[];let dt=!1;try{document.cookie,dt=!0}catch(e){}const ht=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];dt||ht.splice(1,1);var ft=n(7151),pt=n.n(ft),mt=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function gt(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(pt()[n[1]]||"/"===e.charAt(e.length-2))&&(t.voidElement=!0),t.name.startsWith("!--"))){var r=e.indexOf("--\x3e");return{type:"comment",comment:-1!==r?e.slice(4,r):""}}for(var i=new RegExp(mt),a=null;null!==(a=i.exec(e));)if(a[0].trim())if(a[1]){var o=a[1].trim(),s=[o,""];o.indexOf("=")>-1&&(s=o.split("=")),t.attrs[s[0]]=s[1],i.lastIndex--}else a[2]&&(t.attrs[a[2]]=a[3].trim().substring(1,a[3].length-1));return t}var vt=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,yt=/^\s*$/,bt=Object.create(null);function wt(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+'="'+e[n]+'"');return t.length?" "+t.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(wt,"")+"</"+t.name+">";case"comment":return e+"\x3c!--"+t.comment+"--\x3e"}}var St={parse:function(e,t){t||(t={}),t.components||(t.components=bt);var n,r=[],i=[],a=-1,o=!1;if(0!==e.indexOf("<")){var s=e.indexOf("<");r.push({type:"text",content:-1===s?e:e.substring(0,s)})}return e.replace(vt,(function(s,l){if(o){if(s!=="</"+n.name+">")return;o=!1}var u,c="/"!==s.charAt(1),d=s.startsWith("\x3c!--"),h=l+s.length,f=e.charAt(h);if(d){var p=gt(s);return a<0?(r.push(p),r):((u=i[a]).children.push(p),r)}if(c&&(a++,"tag"===(n=gt(s)).type&&t.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!f||"<"===f||n.children.push({type:"text",content:e.slice(h,e.indexOf("<",h))}),0===a&&r.push(n),(u=i[a-1])&&u.children.push(n),i[a]=n),(!c||n.voidElement)&&(a>-1&&(n.voidElement||n.name===s.slice(2,-1))&&(a--,n=-1===a?r:i[a]),!o&&"<"!==f&&f)){u=-1===a?r:i[a].children;var m=e.indexOf("<",h),g=e.slice(h,-1===m?void 0:m);yt.test(g)&&(g=" "),(m>-1&&a+u.length>=0||" "!==g)&&u.push({type:"text",content:g})}})),r},stringify:function(e){return e.reduce((function(e,t){return e+wt("",t)}),"")}};const xt=St,Et=(e,t,n,r)=>{const i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);kt(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},_t={},Ot=(e,t,n,r)=>{kt(n)&&_t[n]||(kt(n)&&(_t[n]=new Date),Et(e,t,n,r))},kt=e=>"string"==typeof e,Tt=e=>"object"==typeof e&&null!==e,Ct=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,It={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Rt=e=>It[e];let At={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(Ct,Rt)};const Nt=()=>At;let Dt;const Lt=()=>Dt,Pt=(e,t)=>{if(!e)return!1;const n=e.props?.children??e.children;return t?n.length>0:!!n},Mt=e=>{if(!e)return[];const t=e.props?.children??e.children;return e.props?.i18nIsDynamicList?jt(t):t},jt=e=>Array.isArray(e)?e:[e],Ft=(e,t,n,r)=>{if(!e)return"";let i="";const a=jt(e),o=t?.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return a.forEach(((e,a)=>{if(kt(e))i+=`${e}`;else if((0,c.isValidElement)(e)){const{props:s,type:l}=e,u=Object.keys(s).length,c=o.indexOf(l)>-1,d=s.children;if(!d&&c&&!u)return void(i+=`<${l}/>`);if(!d&&(!c||u)||s.i18nIsDynamicList)return void(i+=`<${a}></${a}>`);if(c&&1===u&&kt(d))return void(i+=`<${l}>${d}</${l}>`);const h=Ft(d,t,n,r);i+=`<${a}>${h}</${a}>`}else if(null!==e)if(Tt(e)){const{format:t,...a}=e,o=Object.keys(a);if(1===o.length){const e=t?`${o[0]}, ${t}`:o[0];return void(i+=`{{${e}}}`)}Et(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:r,child:e})}else Et(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:r,child:e});else Et(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:r})})),i},Vt=(e,t,n,r,i,a)=>{if(""===t)return[];const o=r.transKeepBasicHtmlNodesFor||[],s=t&&new RegExp(o.map((e=>`<${e}`)).join("|")).test(t);if(!e&&!s&&!a)return[t];const l={},u=e=>{jt(e).forEach((e=>{kt(e)||(Pt(e)?u(Mt(e)):Tt(e)&&!(0,c.isValidElement)(e)&&Object.assign(l,e))}))};u(e);const d=xt.parse(`<0>${t}</0>`),h={...l,...i},f=(e,t,n)=>{const r=Mt(e),i=m(r,t.children,n);return(e=>Array.isArray(e)&&e.every(c.isValidElement))(r)&&0===i.length||e.props?.i18nIsDynamicList?r:i},p=(e,t,n,r,i)=>{e.dummy?(e.children=t,n.push((0,c.cloneElement)(e,{key:r},i?void 0:t))):n.push(...c.Children.map([e],(e=>{const n={...e.props};return delete n.i18nIsDynamicList,(0,c.createElement)(e.type,{...n,key:r,ref:e.ref},i?null:t)})))},m=(t,i,l)=>{const u=jt(t);return jt(i).reduce(((t,i,d)=>{const g=i.children?.[0]?.content&&n.services.interpolator.interpolate(i.children[0].content,h,n.language);if("tag"===i.type){let a=u[parseInt(i.name,10)];1!==l.length||a||(a=l[0][i.name]),a||(a={});const v=0!==Object.keys(i.attrs).length?((e,t)=>{const n={...t};return n.props=Object.assign(e.props,t.props),n})({props:i.attrs},a):a,y=(0,c.isValidElement)(v),b=y&&Pt(i,!0)&&!i.voidElement,w=s&&Tt(v)&&v.dummy&&!y,S=Tt(e)&&Object.hasOwnProperty.call(e,i.name);if(kt(v)){const e=n.services.interpolator.interpolate(v,h,n.language);t.push(e)}else if(Pt(v)||b){const e=f(v,i,l);p(v,e,t,d)}else if(w){const e=m(u,i.children,l);p(v,e,t,d)}else if(Number.isNaN(parseFloat(i.name)))if(S){const e=f(v,i,l);p(v,e,t,d,i.voidElement)}else if(r.transSupportBasicHtmlNodes&&o.indexOf(i.name)>-1)if(i.voidElement)t.push((0,c.createElement)(i.name,{key:`${i.name}-${d}`}));else{const e=m(u,i.children,l);t.push((0,c.createElement)(i.name,{key:`${i.name}-${d}`},e))}else if(i.voidElement)t.push(`<${i.name} />`);else{const e=m(u,i.children,l);t.push(`<${i.name}>${e}</${i.name}>`)}else if(Tt(v)&&!y){const e=i.children[0]?g:null;e&&t.push(e)}else p(v,g,t,d,1!==i.children.length||!g)}else if("text"===i.type){const e=r.transWrapTextNodes,o=a?r.unescape(n.services.interpolator.interpolate(i.content,h,n.language)):n.services.interpolator.interpolate(i.content,h,n.language);e?t.push((0,c.createElement)(e,{key:`${i.name}-${d}`},o)):t.push(o)}return t}),[])},g=m([{dummy:!0,children:e||[]}],d,jt(e||[]));return Mt(g[0])},$t=(e,t,n)=>{const r=e.key||t,i=(0,c.cloneElement)(e,{key:r});if(!i.props||!i.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return i;return(0,c.createElement)((function(){return(0,c.createElement)(c.Fragment,null,i)}))},Bt=(e,t,n,r)=>e?Array.isArray(e)?((e,t)=>e.map(((e,n)=>$t(e,n,t))))(e,t):Tt(e)?((e,t)=>{const n={};return Object.keys(e).forEach((r=>{Object.assign(n,{[r]:$t(e[r],r,t)})})),n})(e,t):(Ot(n,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:r}),null):null;const zt={type:"3rdParty",init(e){((e={})=>{At={...At,...e}})(e.options.react),(e=>{Dt=e})(e)}},Ut=(0,c.createContext)();function qt({children:e,count:t,parent:n,i18nKey:r,context:i,tOptions:a={},values:o,defaults:s,components:l,ns:u,i18n:d,t:h,shouldUnescape:f,...p}){const{i18n:m,defaultNS:g}=(0,c.useContext)(Ut)||{},v=d||m||Lt(),y=h||v?.t.bind(v);return function({children:e,count:t,parent:n,i18nKey:r,context:i,tOptions:a={},values:o,defaults:s,components:l,ns:u,i18n:d,t:h,shouldUnescape:f,...p}){const m=d||Lt();if(!m)return Ot(m,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:r}),e;const g=h||m.t.bind(m)||(e=>e),v={...Nt(),...m.options?.react};let y=u||g.ns||m.options?.defaultNS;y=kt(y)?[y]:y||["translation"];const b=Ft(e,v,m,r),w=s||b||v.transEmptyNodeValue||r,{hashTransKey:S}=v,x=r||(S?S(b||w):b||w);m.options?.interpolation?.defaultVariables&&(o=o&&Object.keys(o).length>0?{...o,...m.options.interpolation.defaultVariables}:{...m.options.interpolation.defaultVariables});const E=o||void 0!==t&&!m.options?.interpolation?.alwaysFormat||!e?a.interpolation:{interpolation:{...a.interpolation,prefix:"#$?",suffix:"?$#"}},_={...a,context:i||a.context,count:t,...o,...E,defaultValue:w,ns:y},O=x?g(x,_):w,k=Bt(l,O,m,r),T=Vt(k||e,O,m,v,_,f),C=n??v.defaultTransParent;return C?(0,c.createElement)(C,p,T):T}({children:e,count:t,parent:n,i18nKey:r,context:i,tOptions:a,values:o,defaults:s,components:l,ns:u||y?.ns||g||v?.options?.defaultNS,i18n:v,t:h,shouldUnescape:f,...p})}const Ht="en-US",Wt=Ht,Gt=[{code:Ht,name:"English"},{code:"fr-FR",name:"Français"},{code:"es-ES",name:"Español"},{code:"de-DE",name:"Deutsch"},{code:"zh-Hans",name:"中文(简体)"},{code:"pt-BR",name:"Português Brasileiro"},{code:"zh-Hant",name:"中文(繁體)"},{code:"it-IT",name:"Italiano"},{code:"ja-JP",name:"日本語"},{code:"id-ID",name:"Bahasa Indonesia"},{code:"ko-KR",name:"한국어"},{code:"ru-RU",name:"Русский"},{code:"cs-CZ",name:"Čeština"},{code:"nl-NL",name:"Nederlands"},{code:"hu-HU",name:"Magyar"},{code:"pt-PT",name:"Português"},{code:"pl-PL",name:"Polski"},{code:"sv-SE",name:"Svenska"},{code:"tr-TR",name:"Türkçe"}];let Kt,Qt;function Yt({id:e,ns:t}={}){if(e)return Kt=Jt().getFixedT(null,e),void(Qt=t=>(0,we.jsx)(qt,{shouldUnescape:!0,ns:e,...t}));Kt=Jt().t,Qt=e=>(0,we.jsx)(qt,{shouldUnescape:!0,ns:t,...e})}function Xt(){var e;if((null==(e=Jt().options)?void 0:e.resources)&&"object"==typeof Jt().options.resources)return;const t=Jt().use(zt).init({resources:{},returnEmptyString:!1,lng:Wt});return Yt(),t}function Jt(){const e=lt;return e&&e.default?e.default:e}const Zt=(e,t,n)=>(Xt(),Kt||(console.warn("t() was called before i18n was initialized. This is probably caused by calling t() in the root module scope, instead of lazily on render"),Kt=Jt().t),Kt(e,t,n));function en(e){Xt();const t=null!=Qt?Qt:qt;return(0,we.jsx)(t,{shouldUnescape:!0,...e})}const tn=new a.Registry((()=>{const e=[{id:G.$m.Lucene,name:"Lucene",description:"Values are lucene escaped and multi-valued variables generate an OR expression",formatter:e=>{if("string"==typeof e)return nn(e);if(Array.isArray(e)){if(0===e.length)return"__empty__";return"("+(0,N.map)(e,(e=>'"'+nn(e)+'"')).join(" OR ")+")"}return nn(`${e}`)}},{id:G.$m.Raw,name:"raw",description:Zt("grafana-scenes.variables.format-registry.formats.description.keep-value-as-is","Keep value as is"),formatter:e=>String(e)},{id:G.$m.Regex,name:"Regex",description:"Values are regex escaped and multi-valued variables generate a (<value>|<value>) expression",formatter:e=>{if("string"==typeof e)return(0,a.escapeRegex)(e);if(Array.isArray(e)){const t=e.map((e=>"string"==typeof e?(0,a.escapeRegex)(e):(0,a.escapeRegex)(String(e))));return 1===t.length?t[0]:"("+t.join("|")+")"}return(0,a.escapeRegex)(`${e}`)}},{id:G.$m.Pipe,name:"Pipe",description:Zt("grafana-scenes.variables.format-registry.formats.description.values-are-separated-by-character","Values are separated by | character"),formatter:e=>"string"==typeof e?e:Array.isArray(e)?e.join("|"):`${e}`},{id:G.$m.Distributed,name:"Distributed",description:Zt("grafana-scenes.variables.format-registry.formats.description.multiple-values-are-formatted-like-variablevalue","Multiple values are formatted like variable=value"),formatter:(e,t,n)=>"string"==typeof e?e:Array.isArray(e)?(e=(0,N.map)(e,((e,t)=>0!==t?n.state.name+"="+e:e)),e.join(",")):`${e}`},{id:G.$m.CSV,name:"Csv",description:Zt("grafana-scenes.variables.format-registry.formats.description.commaseparated-values","Comma-separated values"),formatter:e=>"string"==typeof e?e:(0,N.isArray)(e)?e.join(","):String(e)},{id:G.$m.HTML,name:"HTML",description:Zt("grafana-scenes.variables.format-registry.formats.description.html-escaping-of-values","HTML escaping of values"),formatter:e=>"string"==typeof e?a.textUtil.escapeHtml(e):(0,N.isArray)(e)?a.textUtil.escapeHtml(e.join(", ")):a.textUtil.escapeHtml(String(e))},{id:G.$m.JSON,name:"JSON",description:Zt("grafana-scenes.variables.format-registry.formats.description.json-stringify-value","JSON stringify value"),formatter:e=>"string"==typeof e?e:JSON.stringify(e)},{id:G.$m.PercentEncode,name:"Percent encode",description:Zt("grafana-scenes.variables.format-registry.formats.description.useful-for-url-escaping-values","Useful for URL escaping values"),formatter:e=>(0,N.isArray)(e)?rn("{"+e.join(",")+"}"):rn(e)},{id:G.$m.SingleQuote,name:"Single quote",description:Zt("grafana-scenes.variables.format-registry.formats.description.single-quoted-values","Single quoted values"),formatter:e=>{const t=new RegExp("'","g");if((0,N.isArray)(e))return(0,N.map)(e,(e=>`'${(0,N.replace)(e,t,"\\'")}'`)).join(",");let n="string"==typeof e?e:String(e);return`'${(0,N.replace)(n,t,"\\'")}'`}},{id:G.$m.DoubleQuote,name:"Double quote",description:Zt("grafana-scenes.variables.format-registry.formats.description.double-quoted-values","Double quoted values"),formatter:e=>{const t=new RegExp('"',"g");if((0,N.isArray)(e))return(0,N.map)(e,(e=>`"${(0,N.replace)(e,t,'\\"')}"`)).join(",");let n="string"==typeof e?e:String(e);return`"${(0,N.replace)(n,t,'\\"')}"`}},{id:G.$m.SQLString,name:"SQL string",description:"SQL string quoting and commas for use in IN statements and other scenarios",formatter:cn},{id:"join",name:"Join",description:"Join values with a comma",formatter:(e,t)=>{var n;if((0,N.isArray)(e)){const r=null!=(n=t[0])?n:",";return e.join(r)}return String(e)}},{id:G.$m.Date,name:"Date",description:Zt("grafana-scenes.variables.format-registry.formats.description.format-date-in-different-ways","Format date in different ways"),formatter:(e,t)=>{var n;let r=NaN;if("number"==typeof e?r=e:"string"==typeof e&&(r=parseInt(e,10)),isNaN(r))return"NaN";const i=null!=(n=t[0])?n:"iso";switch(i){case"ms":return String(e);case"seconds":return`${Math.round(r/1e3)}`;case"iso":return(0,a.dateTime)(r).toISOString();default:return(t||[]).length>1?(0,a.dateTime)(r).format(t.join(":")):(0,a.dateTime)(r).format(i)}}},{id:G.$m.Glob,name:"Glob",description:Zt("grafana-scenes.variables.format-registry.formats.description.format-multivalued-variables-using-syntax-example","Format multi-valued variables using glob syntax, example {value1,value2}"),formatter:e=>(0,N.isArray)(e)&&e.length>1?"{"+e.join(",")+"}":String(e)},{id:G.$m.Text,name:"Text",description:"Format variables in their text representation. Example in multi-variable scenario A + B + C.",formatter:(e,t,n)=>n.getValueText?n.getValueText():String(e)},{id:G.$m.QueryParam,name:"Query parameter",description:"Format variables as URL parameters. Example in multi-variable scenario A + B + C => var-foo=A&var-foo=B&var-foo=C.",formatter:(e,t,n)=>{if(n.urlSync){const e=n.urlSync.getUrlState();return a.urlUtil.toUrlParams(e)}return Array.isArray(e)?e.map((e=>sn(n.state.name,e))).join("&"):sn(n.state.name,e)}},{id:"customqueryparam",name:"Custom query parameter",description:"Format variables as URL parameters with custom name and value prefix. Example in multi-variable scenario A + B + C => p-foo=x-A&p-foo=x-B&p-foo=x-C.",formatter:(e,t,n)=>{const r=rn(t[0]||n.state.name),i=rn(t[1]||"");return Array.isArray(e)?e.map((e=>ln(r,e,i))).join("&"):ln(r,e,i)}},{id:G.$m.UriEncode,name:"Percent encode as URI",description:Zt("grafana-scenes.variables.format-registry.formats.description.useful-escaping-values-taking-syntax-characters","Useful for URL escaping values, taking into URI syntax characters"),formatter:e=>(0,N.isArray)(e)?an("{"+e.join(",")+"}"):an(e)}];return e}));function nn(e){return!1===isNaN(+e)?e:e.replace(/([\!\*\+\-\=<>\s\&\|\(\)\[\]\{\}\^\~\?\:\\/"])/g,"\\$1")}function rn(e){return"object"==typeof e&&(e=String(e)),on(encodeURIComponent(e))}const an=e=>on(encodeURI(String(e))),on=e=>e.replace(/[!'()*]/g,(e=>"%"+e.charCodeAt(0).toString(16).toUpperCase()));function sn(e,t){return`var-${e}=${rn(t)}`}function ln(e,t,n=""){return`${e}=${n}${rn(t)}`}const un={"'":"''",'"':'\\"'};function cn(e){const t=new RegExp("'|\"","g");if((0,N.isArray)(e))return(0,N.map)(e,(e=>`'${(0,N.replace)(e,t,(e=>{var t;return null!=(t=un[e])?t:""}))}'`)).join(",");let n="string"==typeof e?e:String(e);return`'${(0,N.replace)(n,t,(e=>{var t;return null!=(t=un[e])?t:""}))}'`}const dn="All",hn="$__all",fn="$__auto",pn=/\$(\w+)|\[\[(\w+?)(?::(\w+))?\]\]|\${(\w+)(?:\.([^:^\}]+))?(?::([^\}]+))?}/g,mn="__searchFilter",gn="__scopes";class vn{constructor(e){this._value=e}formatter(){return this._value}}class yn{constructor(e,t){this.state={name:e,type:"time_macro"},this._sceneObject=t}getValue(){const e=fe(this._sceneObject);return"__from"===this.state.name?e.state.value.from.valueOf():e.state.value.to.valueOf()}getValueText(){const e=fe(this._sceneObject);return"__from"===this.state.name?(0,a.dateTimeFormat)(e.state.value.from,{timeZone:e.getTimeZone()}):(0,a.dateTimeFormat)(e.state.value.to,{timeZone:e.getTimeZone()})}}class bn{constructor(e,t,n){this.state={name:e,type:"time_macro",match:n},this._sceneObject=t}getValue(){var e;const t=rc(this._sceneObject);if(t){const n=null==(e=t.state.data)?void 0:e.request;return n?"__interval_ms"===this.state.name?n.intervalMs:n.interval:this.state.match}return this.state.match}}function wn(e,t){e.setState(t)}function Sn(){return o.useLocationService?(0,o.useLocationService)():o.locationService}function xn(e){let t=e;do{if("repeatSourceKey"in t.state&&t.state.repeatSourceKey)return!0;t=t.parent}while(t);return!1}class En extends I{constructor(){super(...arguments),this._urlSync=new _n(this)}validateAndUpdate(){return this.getValueOptions({}).pipe((0,f.map)((e=>(this.updateValueGivenNewOptions(e),{}))))}onCancel(){this.setStateHelper({loading:!1});const e=this.parent;null==e||e.cancel(this)}updateValueGivenNewOptions(e){const{value:t,text:n,options:r}=this.state,i=this.getStateUpdateGivenNewOptions(e,t,n);this.interceptStateUpdateAfterValidation(i),this.setStateHelper(i),(i.value!==t||i.text!==n||this.hasAllValue()&&!(0,N.isEqual)(e,r))&&this.publishEvent(new pe(this),!0)}getStateUpdateGivenNewOptions(e,t,n){const r={options:e,loading:!1,value:t,text:n};if(0===e.length)return this.state.defaultToAll||this.state.includeAll?(r.value=hn,r.text=dn):this.state.isMulti?(r.value=[],r.text=[]):(r.value="",r.text=""),r;if(this.hasAllValue())return this.state.includeAll?r.text=dn:(r.value=e[0].value,r.text=e[0].label,this.state.isMulti&&(r.value=[r.value],r.text=[r.text])),r;if(this.state.isMulti){const i=(Array.isArray(t)?t:[t]).filter((t=>e.find((e=>e.value===t)))),a=i.map((t=>e.find((e=>e.value===t)).label));if(0===i.length){const t=this.getDefaultMultiState(e);r.value=t.value,r.text=t.text}else(0,N.isEqual)(i,t)||(r.value=i),(0,N.isEqual)(a,n)||(r.text=a);return r}let i=function(e,t,n){let r;for(const i of n){if(i.value===e)return i;i.label===t&&(r=i)}return r}(t,n,e);if(i)r.text=i.label,r.value=i.value;else{const t=this.getDefaultSingleState(e);r.value=t.value,r.text=t.text}return r}interceptStateUpdateAfterValidation(e){const t=e.value===hn&&this.state.text===dn;this.skipNextValidation&&e.value!==this.state.value&&e.text!==this.state.text&&!t&&(e.value=this.state.value,e.text=this.state.text),this.skipNextValidation=!1}getValue(e){let t=this.state.value;if(this.hasAllValue()){if(this.state.allValue)return new On(this.state.allValue,this);t=this.state.options.map((e=>e.value))}if(null!=e&&Array.isArray(t)){const n=parseInt(e,10);if(!isNaN(n)&&n>=0&&n<t.length)return t[n]}return t}getValueText(){return this.hasAllValue()?dn:Array.isArray(this.state.text)?this.state.text.join(" + "):String(this.state.text)}hasAllValue(){const e=this.state.value;return e===hn||Array.isArray(e)&&e[0]===hn}getDefaultMultiState(e){return this.state.defaultToAll?{value:[hn],text:[dn]}:e.length>0?{value:[e[0].value],text:[e[0].label]}:{value:[],text:[]}}getDefaultSingleState(e){return this.state.defaultToAll?{value:hn,text:dn}:e.length>0?{value:e[0].value,text:e[0].label}:{value:"",text:""}}changeValueTo(e,t,n=!1){var r,i;if(e===this.state.value&&t===this.state.text)return;if(t||(t=Array.isArray(e)?e.map((e=>this.findLabelTextForValue(e))):this.findLabelTextForValue(e)),Array.isArray(e)){if(0===e.length){const n=this.getDefaultMultiState(this.state.options);e=n.value,t=n.text}e[e.length-1]===hn?(e=[hn],t=[dn]):e[0]===hn&&e.length>1&&(e.shift(),Array.isArray(t)&&t.shift())}if((0,N.isEqual)(e,this.state.value)&&(0,N.isEqual)(t,this.state.text))return;const a=()=>this.setStateHelper({value:e,text:t,loading:!1});if(n){const e=W(this);null==e||e.startProfile(oe),null==(i=(r=this._urlSync).performBrowserHistoryAction)||i.call(r,a)}else a();this.publishEvent(new pe(this),!0)}findLabelTextForValue(e){if(e===hn)return dn;const t=this.state.options.find((t=>t.value===e));if(t)return t.label;const n=this.state.options.find((t=>t.label===e));return n?n.label:e}setStateHelper(e){wn(this,e)}getOptionsForSelect(e=!0){let t=this.state.options;if(this.state.includeAll&&(t=[{value:hn,label:dn},...t]),e&&!Array.isArray(this.state.value)){t.find((e=>e.value===this.state.value))||(t=[{value:this.state.value,label:String(this.state.text)},...t])}return t}refreshOptions(){this.getValueOptions({}).subscribe((e=>{this.updateValueGivenNewOptions(e)}))}}class _n{constructor(e){this._sceneObject=e,this._nextChangeShouldAddHistoryStep=!1}getKey(){return`var-${this._sceneObject.state.name}`}getKeys(){return this._sceneObject.state.skipUrlSync?[]:[this.getKey()]}getUrlState(){if(this._sceneObject.state.skipUrlSync)return{};let e=null,t=this._sceneObject.state.value;return e=Array.isArray(t)?t.map(String):this._sceneObject.state.isMulti?[String(t)]:String(t),{[this.getKey()]:e}}updateFromUrl(e){let t=e[this.getKey()];null!=t&&(this._sceneObject.state.includeAll&&(t=function(e){if((0,N.isArray)(e)&&e[0]===dn)return[hn];if(e===dn)return hn;return e}(t)),this._sceneObject.state.allValue&&this._sceneObject.state.allValue===t&&(t=hn),this._sceneObject.isActive||(this._sceneObject.skipNextValidation=!0),this._sceneObject.changeValueTo(t))}performBrowserHistoryAction(e){this._nextChangeShouldAddHistoryStep=!0,e(),this._nextChangeShouldAddHistoryStep=!1}shouldCreateHistoryStep(e){return this._nextChangeShouldAddHistoryStep}}class On{constructor(e,t){this._value=e,this._variable=t}formatter(e){return e===G.$m.Text?dn:e===G.$m.PercentEncode?tn.get(G.$m.PercentEncode).formatter(this._value,[],this._variable):e===G.$m.QueryParam?tn.get(G.$m.QueryParam).formatter(dn,[],this._variable):this._value}}function kn(e,t={}){if(e.state.$variables)for(const n of e.state.$variables.state.variables)n.state.skipUrlSync||t[n.state.name]||(t[n.state.name]=n);return e.parent&&kn(e.parent,t),t}const Tn=(0,a.getDisplayProcessor)();class Cn{constructor(e){this._urlQueryParams=e}formatter(e){if(!e)return this._urlQueryParams;const t=e.split(":");if("exclude"===t[0]&&t.length>1){const e=new URLSearchParams(this._urlQueryParams);for(const n of t[1].split(","))e.delete(n);return`?${e}`}if("include"===t[0]&&t.length>1){const e=new URLSearchParams(this._urlQueryParams),n=t[1].split(",");for(const t of e.keys())n.includes(t)||e.delete(t);return`?${e}`}return this._urlQueryParams}}const In=new Map([[a.DataLinkBuiltInVars.includeVars,class{constructor(e,t){this.state={name:e,type:"url_variable"},this._sceneObject=t}getValue(){const e=kn(this._sceneObject),t=tn.get(G.$m.QueryParam),n=[];for(const r of Object.keys(e)){const i=e[r];if(i instanceof En&&i.hasAllValue()&&!i.state.allValue){n.push(t.formatter(hn,[],i));continue}const a=i.getValue();a&&(me(a)?n.push(a.formatter(G.$m.QueryParam)):n.push(t.formatter(a,[],i)))}return new vn(n.join("&"))}getValueText(){return""}}],[a.DataLinkBuiltInVars.keepTime,class{constructor(e,t){this.state={name:e,type:"url_variable"},this._sceneObject=t}getValue(){var e;const t=null==(e=fe(this._sceneObject).urlSync)?void 0:e.getUrlState();return new vn(a.urlUtil.toUrlParams(t))}getValueText(){return""}}],["__value",class{constructor(e,t,n,r){this._match=n,this._scopedVars=r,this.state={name:e,type:"__value"}}getValue(e){var t,n;const r=null==(t=this._scopedVars)?void 0:t.__dataContext;if(!r)return this._match;const{frame:i,rowIndex:o,field:s,calculatedValue:l}=r.value;if(l)switch(e){case"numeric":case"raw":return l.numeric;case"time":return"";default:return(0,a.formattedValueToString)(l)}if(null==o)return this._match;if("time"===e){const e=i.fields.find((e=>e.type===a.FieldType.time));return e?e.values.get(o):void 0}if(!s)return this._match;const u=s.values.get(o);if("raw"===e)return u;const c=(null!=(n=s.display)?n:Tn)(u);return"numeric"===e?c.numeric:(0,a.formattedValueToString)(c)}getValueText(){return""}}],["__data",class{constructor(e,t,n,r){this._match=n,this._scopedVars=r,this.state={name:e,type:"__data"}}getValue(e){var t,n;const r=null==(t=this._scopedVars)?void 0:t.__dataContext;if(!r||!e)return this._match;const{frame:i,rowIndex:o}=r.value;if(void 0===o||void 0===e)return this._match;const s={name:i.name,refId:i.refId,fields:(0,a.getFieldDisplayValuesProxy)({frame:i,rowIndex:o})};return null!=(n=ye(e)(s))?n:""}getValueText(){return""}}],["__series",class{constructor(e,t,n,r){this._match=n,this._scopedVars=r,this.state={name:e,type:"__series"}}getValue(e){var t;const n=null==(t=this._scopedVars)?void 0:t.__dataContext;if(!n||!e)return this._match;if("name"!==e)return this._match;const{frame:r,frameIndex:i}=n.value;return(0,a.getFrameDisplayName)(r,i)}getValueText(){return""}}],["__field",class{constructor(e,t,n,r){this._match=n,this._scopedVars=r,this.state={name:e,type:"__field"}}getValue(e){var t,n;const r=null==(t=this._scopedVars)?void 0:t.__dataContext;if(!r||!e)return this._match;if(void 0===e||""===e)return this._match;const{frame:i,field:o,data:s}=r.value,l=function(e,t,n){return new Proxy({},{get:(r,i)=>"name"===i?e.name:"displayName"===i?(0,a.getFieldDisplayName)(e,t,n):"labels"===i||"formattedLabels"===i?e.labels?{...e.labels,__values:Object.values(e.labels).sort().join(", "),toString:()=>(0,a.formatLabels)(e.labels,"",!0)}:"":void 0})}(o,i,s);return null!=(n=ye(e)(l))?n:""}getValueText(){return""}}],["__url",class{constructor(e,t){this.state={name:e,type:"url_macro"}}getValue(e){var t;const n=o.locationService.getLocation(),r=null!=(t=o.config.appSubUrl)?t:"";switch(null!=e?e:""){case"params":return new Cn(n.search);case"path":return r+n.pathname;default:return r+n.pathname+n.search}}getValueText(){return""}}],["__from",yn],["__to",yn],["__timezone",class{constructor(e,t){this.state={name:e,type:"time_macro"},this._sceneObject=t}getValue(){const e=fe(this._sceneObject).getTimeZone();return"browser"===e?Intl.DateTimeFormat().resolvedOptions().timeZone:e}getValueText(){return this.getValue()}}],["__user",class{constructor(e,t){this.state={name:e,type:"user_macro"}}getValue(e){const t=o.config.bootData.user;switch(e){case"login":return t.login;case"email":return t.email;default:return String(t.id)}}getValueText(){return""}}],["__org",class{constructor(e,t){this.state={name:e,type:"org_macro"}}getValue(e){const t=o.config.bootData.user;return"name"===e?t.orgName:String(t.orgId)}getValueText(){return""}}],["__interval",bn],["__interval_ms",bn]]);function Rn(e,t,n,r,i){return t&&"string"==typeof t?(pn.lastIndex=0,t.replace(pn,((t,a,o,s,l,u,c)=>{const d=a||o||l,h=s||c||r,f=function(e,t,n,r){if(n&&n.hasOwnProperty(e)){const t=n[e];if(t)return function(e,t){return ge?(ge.state.name=e,ge.state.value=t):ge=new be(e,t),ge}(e,t)}const i=U(e,r);if(i)return i;const a=In.get(e);if(a)return new a(e,r,t,n);return null}(d,t,n,e);if(!f)return i&&i.push({match:t,variableName:d,fieldPath:u,format:h,value:t,found:!1}),t;const p=function(e,t,n,r){if(null==n)return"";if(me(n))return Rn(e,n.formatter(r));Array.isArray(n)||"object"!=typeof n||(n=`${n}`);if("function"==typeof r)return r(n,{name:t.state.name,type:t.state.type,multi:t.state.isMulti,includeAll:t.state.includeAll});let i=[];r?(i=r.split(":"),i.length>1?(r=i[0],i=i.slice(1)):i=[]):r=G.$m.Glob;let a=tn.getIfExists(r);a||(console.error(`Variable format ${r} not found. Using glob format as fallback.`),a=tn.get(G.$m.Glob));return a.formatter(n,i,t)}(e,f,f.getValue(u),h);return i&&i.push({match:t,variableName:d,fieldPath:u,format:h,value:p,found:p!==t}),p}))):null!=t?t:""}function An(e){return void 0!==e.useState}function Nn(e){return"enrichDataRequest"in e}function Dn(e){return"isDataLayer"in e}function Ln(e="op"){if("undefined"!=typeof crypto&&crypto.randomUUID){return`${e}-${crypto.randomUUID()}`}return`${e}-${Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}`}const Pn=class e{constructor(){this.observers=[]}static getInstance(){return e.instance||(e.instance=new e),e.instance}addObserver(e){return this.observers.push(e),()=>{const t=this.observers.indexOf(e);t>-1&&this.observers.splice(t,1)}}clearObservers(){this.observers=[]}getObserverCount(){return this.observers.length}notifyObservers(e,t,n){this.observers.forEach((r=>{try{const n=r[e];null==n||n(t)}catch(e){console.warn(`Error in ${n} observer:`,e)}}))}notifyDashboardInteractionStart(e){this.notifyObservers("onDashboardInteractionStart",e,"dashboard interaction start")}notifyDashboardInteractionMilestone(e){this.notifyObservers("onDashboardInteractionMilestone",e,"dashboard interaction milestone")}notifyDashboardInteractionComplete(e){this.notifyObservers("onDashboardInteractionComplete",e,"dashboard interaction complete")}notifyPanelOperationStart(e){this.notifyObservers("onPanelOperationStart",e,"panel operation start")}notifyPanelOperationComplete(e){this.notifyObservers("onPanelOperationComplete",e,"panel operation complete")}notifyQueryStart(e){this.notifyObservers("onQueryStart",e,"query start")}notifyQueryComplete(e){this.notifyObservers("onQueryComplete",e,"query complete")}};Pn.instance=null;let Mn=Pn;function jn(){return Mn.getInstance()}function Fn(e,t){return n=>{const r=lc.getQueryController(e.origin);return r?new f.Observable((i=>{var a;e.cancel||(e.cancel=()=>i.complete());const o=(null==(a=e.request)?void 0:a.requestId)||`${e.type}-${Math.floor(performance.now()).toString(36)}`,s=performance.now();let l=null;if(t)l=t.onQueryStarted(s,e,o);else{const t=Ln("query");jn().notifyQueryStart({operationId:t,queryId:o,queryType:e.type,origin:e.origin.constructor.name,timestamp:s}),l=(n,r)=>{jn().notifyQueryComplete({operationId:t,queryId:o,queryType:e.type,origin:e.origin.constructor.name,timestamp:n,duration:n-s,error:r?(null==r?void 0:r.message)||String(r)||"Unknown error":void 0})}}r.queryStarted(e);let u=!1;const c=n.subscribe({next:t=>{u||t.state===K.Loading||(u=!0,r.queryCompleted(e),null==l||l(performance.now())),i.next(t)},error:t=>{u||(u=!0,r.queryCompleted(e),null==l||l(performance.now(),t)),i.error(t)},complete:()=>{i.complete()}});return()=>{c.unsubscribe(),u||(r.queryCompleted(e),null==l||l(performance.now()))}})):n}}function Vn(e){return new f.Observable((t=>{t.next({state:K.Loading});(0,f.from)(e).pipe((0,f.map)((()=>({state:K.Done}))),(0,f.catchError)((()=>(t.next({state:K.Error}),[])))).subscribe({next:e=>t.next(e),complete:()=>t.complete()})}))}async function $n(e,t){var n;if(null==e?void 0:e.uid){const t=P.get(e.uid);if(t)return t}if(e&&e.query)return e;const r=(0,o.getDataSourceSrv)().get(e,t);if(t.__sceneObject&&t.__sceneObject.value.valueOf()){const i=lc.getQueryController(t.__sceneObject.value.valueOf());i&&i.state.enableProfiling&&Vn(r).pipe(Fn({type:`getDataSource/${null!=(n=null==e?void 0:e.type)?n:"unknown"}`,origin:t.__sceneObject.value.valueOf()})).subscribe((()=>{}))}return await r}class Bn{constructor(){this._values=new Map}recordCurrentDependencyValuesForSceneObject(e){if(this.clearValues(),e.variableDependency)for(const t of e.variableDependency.getNames()){const n=lc.lookupVariable(t,e);n&&this._values.set(n.state.name,n.getValue())}}cloneAndRecordCurrentValuesForSceneObject(e){const t=new Bn;return t.recordCurrentDependencyValuesForSceneObject(e),t}clearValues(){this._values.clear()}hasValues(){return!!this._values}recordCurrentValue(e){this._values.set(e.state.name,e.getValue())}hasRecordedValue(e){return this._values.has(e.state.name)}hasValueChanged(e){if(this._values.has(e.state.name)){if(!bu(this._values.get(e.state.name),e.getValue()))return!0}return!1}hasDependenciesChanged(e){if(!this._values)return!1;if(!e.variableDependency)return!1;for(const t of e.variableDependency.getNames()){const n=lc.lookupVariable(t,e);if(!n)continue;const r=n.state.name;if(n&&this._values.has(r)){if(!bu(this._values.get(r),n.getValue()))return!0}}return!1}}function zn(e){return"object"==typeof e&&"getExtraQueries"in e}const Un=(e,t)=>(0,f.of)(t),qn=0;function Hn(e){const t=e.getRoot();return Nn(t)?t.enrichDataRequest(e):null}const Wn=new Set;var Gn=n(2007),Kn=n(7945),Qn=n(6089),Yn=n(7993);const Xn=/[^ -~]/m,Jn=/^[\x21-\x2F\x3A-\x40\x5B-\x60\x7B-\x7E]+$/m,Zn=5,er=25,tr=5,nr=1e4,rr=new Yn.A({intraMode:1});function ir(e,t,n){let r=[];if(""===n)r=e;else if(Xn.test(n)||Jn.test(n)||n.length>er||rr.split(n).length>tr)for(let i=0;i<t.length;i++){t[i].includes(n)&&r.push(e[i])}else{const[i,a,o]=rr.search(t,n,Zn,nr);(null==i?void 0:i.length)&&(r=a&&o?o.map((t=>e[a.idx[t]])):i.map((t=>e[t])))}return r}function ar(e,t=!1){let n=e;t&&(n=[{value:hn,label:dn},...n]);const r=n.map((e=>e.label));return e=>ir(n,r,e)}const or=()=>!0,sr=e=>"$__all"!==e.value,lr=(e,t)=>e.length===t.filter(sr).length?Gn.ToggleAllState.allSelected:0===e.length||1===e.length&&e[0]&&"$__all"===e[0].value?Gn.ToggleAllState.noneSelected:Gn.ToggleAllState.indeterminate;function ur({model:e,state:t}){const{value:n,text:r,key:i,options:a,includeAll:o,isReadOnly:s,allowCustomValue:l=!0}=t,[u,d]=(0,c.useState)(""),[f,p]=(0,c.useState)(!1),m=function(e,t){return{value:e,label:null!=t?t:String(e)}}(n,String(r)),g=lc.getQueryController(e),v=(0,c.useMemo)((()=>ar(a,o)),[a,o])(u);return h().createElement(Gn.Select,{id:i,isValidNewOption:e=>e.trim().length>0,placeholder:Zt("grafana-scenes.variables.variable-value-select.placeholder-select-value","Select value"),width:"auto",disabled:s,value:m,inputValue:u,allowCustomValue:l,virtualized:!0,filterOption:or,tabSelectsValue:!1,onInputChange:(t,{action:n})=>"input-change"===n?(d(t),e.onSearchChange&&e.onSearchChange(t),t):t,onOpenMenu:()=>{f&&d(String(r))},onCloseMenu:()=>{d("")},options:v,"data-testid":Kn.Tp.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(`${n}`),onChange:t=>{e.changeValueTo(t.value,t.label,!0),null==g||g.startProfile(oe),f!==t.__isNew__&&p(t.__isNew__)}})}function cr({model:e,state:t}){const{value:n,options:r,key:i,maxVisibleValues:a,noValueOnClear:o,includeAll:s,isReadOnly:l,allowCustomValue:u=!0}=t,d=(0,c.useMemo)((()=>(0,N.isArray)(n)?n:[n]),[n]),[f,p]=(0,c.useState)(d),[m,g]=(0,c.useState)(""),v=(0,c.useMemo)((()=>ar(r,s)),[r,s]);(0,c.useEffect)((()=>{p(d)}),[d]);const y=r.length>0?"Select value":"",b=v(m);return h().createElement(Gn.MultiSelect,{id:i,placeholder:y,width:"auto",inputValue:m,disabled:l,value:f,noMultiValueWrap:!0,maxVisibleValues:null!=a?a:5,tabSelectsValue:!1,virtualized:!0,allowCustomValue:u,toggleAllOptions:{enabled:!0,optionsFilter:sr,determineToggleAllState:lr},options:b,closeMenuOnSelect:!1,components:{Option:dr},isClearable:!0,hideSelectedOptions:!1,onInputChange:(t,{action:n})=>"input-change"===n?(g(t),e.onSearchChange&&e.onSearchChange(t),t):"input-blur"===n?(g(""),""):m,onBlur:()=>{e.changeValueTo(f,void 0,!0)},filterOption:or,"data-testid":Kn.Tp.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(`${f}`),onChange:(t,n)=>{"clear"===n.action&&o&&e.changeValueTo([],void 0,!0),p(t.map((e=>e.value)))}})}const dr=({children:e,data:t,innerProps:n,innerRef:r,isFocused:i,isSelected:a,indeterminate:o,renderOptionLabel:s})=>{var l;const{onMouseMove:u,onMouseOver:c,...d}=n,f=(0,Gn.useTheme2)(),p=(0,Gn.getSelectStyles)(f),m=(0,Gn.useStyles2)(hr);return h().createElement("div",{ref:r,className:(0,Qn.cx)(p.option,i&&p.optionFocused),...d,"data-testid":"data-testid Select option",title:t.title},h().createElement("div",{className:m.checkbox},h().createElement(Gn.Checkbox,{indeterminate:o,value:a})),h().createElement("div",{className:p.optionBody,"data-testid":Kn.Tp.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts(null!=(l=t.label)?l:String(t.value))},h().createElement("span",null,e)))};dr.displayName="SelectMenuOptions";const hr=e=>({checkbox:(0,Qn.css)({marginRight:e.spacing(2)})});function fr({model:e}){const t=e.useState();return t.isMulti?h().createElement(cr,{model:e,state:t}):h().createElement(ur,{model:e,state:t})}class pr{constructor(e){this._sceneObject=e,this._nextChangeShouldAddHistoryStep=!1}getRestorableKey(){return`restorable-var-${this._sceneObject.state.name}`}getKey(){return`var-${this._sceneObject.state.name}`}getKeys(){return this._sceneObject.state.skipUrlSync?[]:[this.getKey(),this.getRestorableKey()]}getUrlState(){return this._sceneObject.state.skipUrlSync?{}:{[this.getKey()]:this._sceneObject.state.defaultValue&&!this._sceneObject.state.restorable?[""]:mr(this._sceneObject.state.value,this._sceneObject.state.text),[this.getRestorableKey()]:this._sceneObject.state.defaultValue?this._sceneObject.state.restorable?"true":"false":null}}updateFromUrl(e){let t=e[this.getKey()],n=e[this.getRestorableKey()];if(null!=t){this._sceneObject.isActive||(this._sceneObject.skipNextValidation=!0);const{values:e,texts:i}=(r=t,(r=Array.isArray(r)?r:[r]).reduce(((e,t)=>{const[n,r]=(null!=t?t:"").split(",");return e.values.push(Iu(n)),e.texts.push(Iu(null!=r?r:n)),e}),{values:[],texts:[]}));if(this._sceneObject.state.defaultValue&&("false"===n||void 0===n))return;if("false"===n)return void this._sceneObject.changeValueTo([],[],!1);this._sceneObject.changeValueTo(e,i)}var r}performBrowserHistoryAction(e){this._nextChangeShouldAddHistoryStep=!0,e(),this._nextChangeShouldAddHistoryStep=!1}shouldCreateHistoryStep(e){return this._nextChangeShouldAddHistoryStep}}function mr(e,t){return e=Array.isArray(e)?e:[e],t=Array.isArray(t)?t:[t],e.map(((e,n)=>{if(null==e)return"";e=String(e);let r=t[n];return r=null==r?e:String(r),Ru(e,r)}))}function gr(e){const t=e.getRoot();return"enrichFiltersRequest"in t?t.enrichFiltersRequest(e):null}var vr,yr=e=>{throw TypeError(e)},br=(e,t,n)=>t.has(e)||yr("Cannot "+n);class wr{constructor(e){((e,t,n)=>{t.has(e)?yr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n)})(this,vr),this.text="__sceneObject",this.valueOf=()=>{return br(e=this,t=vr,"read from private field"),n?n.call(e):t.get(e);var e,t,n},((e,t,n,r)=>{br(e,t,"write to private field"),t.set(e,n)})(this,vr,e)}toString(){}get value(){return this}}function Sr(e){return function(e){const t=e.match(/^(\d+)\.(\d+)\.(\d+)/);if(!t)return!1;const n=parseInt(t[1],10),r=parseInt(t[2],10),i=parseInt(t[3],10);return 11===n?0===r&&i>=4||1===r&&i>=2||r>1:10===n?4===r&&i>=8||r>=5:n>11}(o.config.buildInfo.version)?new wr(e):{value:e,text:"__sceneObject"}}function xr(e){const{model:t}=e,n=(0,Gn.useTheme2)(),r=Er(n),i=(0,Gn.getInputStyles)({theme:n,invalid:!1}),a=(0,N.isArray)(t.state.value)?t.state.value:t.state.value?[t.state.value]:[];let o=[];return a&&a.length&&o.push(h().createElement(Gn.IconButton,{"aria-label":Zt("grafana-scenes.variables.default-group-by-custom-indicator-container.aria-label-clear","clear"),key:"clear",name:"times",size:"md",className:r.clearIcon,onClick:e=>{t.changeValueTo([],void 0,!0),t.checkIfRestorable([])&&t.setState({restorable:!0})}})),t.state.restorable&&o.push(h().createElement(Gn.IconButton,{onClick:t=>{e.model.restoreDefaultValues()},onKeyDownCapture:t=>{"Enter"===t.key&&e.model.restoreDefaultValues()},key:"restore",name:"history",size:"md",className:r.clearIcon,tooltip:Zt("grafana-scenes.variables.default-group-by-custom-indicator-container.tooltip-restore-groupby-set-by-this-dashboard","Restore groupby set by this dashboard.")})),t.state.restorable||o.push(h().createElement(Gn.Tooltip,{key:"tooltip",content:Zt("grafana-scenes.variables.default-group-by-custom-indicator-container.tooltip","Applied by default in this dashboard. If edited, it carries over to other dashboards."),placement:"bottom"},h().createElement(Gn.Icon,{name:"info-circle",size:"md"}))),h().createElement("div",{onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},className:(0,Qn.cx)(i.suffix,(0,Qn.css)({position:"relative"}))},o)}vr=new WeakMap;const Er=e=>({clearIcon:(0,Qn.css)({color:e.colors.action.disabledText,cursor:"pointer","&:hover:before":{backgroundColor:"transparent"},"&:hover":{color:e.colors.text.primary}})}),_r=({keysApplicability:e,children:t})=>{var n,r;const i=(0,Gn.useTheme2)(),a=(0,Gn.getSelectStyles)(i),{disabledPill:o,strikethrough:s}=Lu(i),l=h().Children.toArray(t)[0];let u=!0;if(h().isValidElement(l)&&(null==(r=null==(n=l.props)?void 0:n.data)?void 0:r.value)){const t=l.props.data.value,n=null==e?void 0:e.find((e=>e.key===t));n&&!n.applicable&&(u=!1)}return h().createElement("div",{className:(0,Qn.cx)(a.multiValueContainer,!u&&(0,Qn.cx)(o,s))},t)};function Or(e){return"isInteractionTracker"in e}function kr(e){let t=e;for(;t;){if(t.state.$behaviors)for(const e of t.state.$behaviors)if(Or(e))return e;t=t.parent}}class Tr extends En{constructor(e){super({isMulti:!0,name:"",value:[],text:[],options:[],datasource:null,baseFilters:[],applyMode:"auto",layout:"horizontal",type:"groupby",...e,noValueOnClear:!0}),this.isLazy=!0,this._urlSync=new pr(this),this._activationHandler=()=>(this._verifyApplicability(),this.state.defaultValue&&this.checkIfRestorable(this.state.value)&&this.setState({restorable:!0}),()=>{this.state.defaultValue&&this.restoreDefaultValues()}),this._getKeys=async e=>{var t,n,r;const i=await(null==(n=(t=this.state).getTagKeysProvider)?void 0:n.call(t,this,null));if(i&&i.replace)return i.values;if(this.state.defaultOptions)return this.state.defaultOptions.concat(Au(null!=(r=null==i?void 0:i.values)?r:[]));if(!e.getTagKeys)return[];const a=Ou(this),o=this.state.baseFilters||[],s=lc.getTimeRange(this).state.value,l=await e.getTagKeys({filters:o,queries:a,timeRange:s,scopes:lc.getScopes(this),...gr(this)});Nu(l)&&this.setState({error:l.error.message});let u=Au(l);i&&(u=u.concat(Au(i.values)));const c=this.state.tagKeyRegexFilter;return c&&(u=u.filter((e=>e.text.match(c)))),u},this.state.defaultValue&&this.changeValueTo(this.state.defaultValue.value,this.state.defaultValue.text,!1),"auto"===this.state.applyMode&&this.addActivationHandler((()=>(Wn.add(this),()=>Wn.delete(this)))),this.addActivationHandler(this._activationHandler)}validateAndUpdate(){return this.getValueOptions({}).pipe((0,f.map)((e=>(this._updateValueGivenNewOptions(e),{}))))}_updateValueGivenNewOptions(e){const{value:t,text:n}=this.state,r={options:e,loading:!1,value:null!=t?t:[],text:null!=n?n:[]};this.setState(r)}getValueOptions(e){return this.state.defaultOptions?(0,f.of)(this.state.defaultOptions.map((e=>({label:e.text,value:String(e.value),group:e.group})))):(this.setState({loading:!0,error:null}),(0,f.from)($n(this.state.datasource,{__sceneObject:Sr(this)})).pipe((0,f.mergeMap)((e=>(0,f.from)(this._getKeys(e)).pipe((0,f.tap)((e=>{Nu(e)&&this.setState({error:e.error.message})})),(0,f.map)((e=>Au(e))),(0,f.take)(1),(0,f.mergeMap)((e=>{const t=e.map((e=>({label:e.text,value:e.value?String(e.value):e.text,group:e.group})));return(0,f.of)(t)})))))))}getApplicableKeys(){const{value:e,keysApplicability:t}=this.state,n=(0,N.isArray)(e)?e:e?[e]:[];if(!t||0===t.length)return n;return n.filter((e=>{const n=t.find((t=>t.key===e));return!n||!1!==n.applicable}))}async _verifyApplicability(){const e=await $n(this.state.datasource,{__sceneObject:Sr(this)});if(!e.getDrilldownsApplicability)return;const t=Ou(this),n=lc.getTimeRange(this).state.value,r=this.state.value,i=await e.getDrilldownsApplicability({groupByKeys:Array.isArray(r)?r.map((e=>String(e))):r?[String(r)]:[],queries:t,timeRange:n,scopes:lc.getScopes(this),...gr(this)});(0,N.isEqual)(i,this.state.keysApplicability)||(this.setState({keysApplicability:null!=i?i:void 0}),this.publishEvent(new pe(this),!0))}checkIfRestorable(e){var t,n,r,i;const a=(0,N.isArray)(null==(t=this.state.defaultValue)?void 0:t.value)?null==(n=this.state.defaultValue)?void 0:n.value:(null==(r=this.state.defaultValue)?void 0:r.value)?[null==(i=this.state.defaultValue)?void 0:i.value]:[],o=(0,N.isArray)(e)?e:[e];return o.length!==a.length||!(0,N.isEqual)(o,a)}restoreDefaultValues(){this.setState({restorable:!1}),this.state.defaultValue&&this.changeValueTo(this.state.defaultValue.value,this.state.defaultValue.text,!0)}getDefaultMultiState(e){return{value:[],text:[]}}}Tr.Component=function({model:e}){const{value:t,text:n,key:r,isMulti:i=!0,maxVisibleValues:a,noValueOnClear:o,options:s,includeAll:l,allowCustomValue:u=!0,defaultValue:d,keysApplicability:p}=e.useState(),m=(0,c.useMemo)((()=>{const e=(0,N.isArray)(t)?t:[t],r=(0,N.isArray)(n)?n:[n];return e.map(((e,t)=>{var n;return{value:e,label:String(null!=(n=r[t])?n:e)}}))}),[t,n]),[g,v]=(0,c.useState)(!1),[y,b]=(0,c.useState)(!1),[w,S]=(0,c.useState)(""),[x,E]=(0,c.useState)(m),_=(0,c.useMemo)((()=>ar(s,l)),[s,l]),O=void 0!==d;(0,c.useEffect)((()=>{E(m)}),[m]);const k=(t,{action:n})=>"input-change"===n?(S(t),e.onSearchChange&&e.onSearchChange(t),t):"input-blur"===n?(S(""),""):w,T=(0,c.useMemo)((()=>Du(_(w).map(Ir))),[_,w]);return i?h().createElement(Gn.MultiSelect,{"aria-label":Zt("grafana-scenes.variables.group-by-variable-renderer.aria-label-group-by-selector","Group by selector"),"data-testid":`GroupBySelect-${r}`,id:r,placeholder:Zt("grafana-scenes.variables.group-by-variable-renderer.placeholder-group-by-label","Group by label"),width:"auto",allowCustomValue:u,inputValue:w,value:x,noMultiValueWrap:!0,maxVisibleValues:null!=a?a:5,tabSelectsValue:!1,virtualized:!0,options:T,filterOption:Cr,closeMenuOnSelect:!1,isOpen:y,isClearable:!0,hideSelectedOptions:!1,isLoading:g,components:{Option:dr,...O?{IndicatorsContainer:()=>h().createElement(xr,{model:e})}:{},MultiValueContainer:({innerProps:e,children:t})=>h().createElement(_r,{innerProps:e,keysApplicability:p},t)},onInputChange:k,onBlur:()=>{e.changeValueTo(x.map((e=>e.value)),x.map((e=>e.label)),!0);const t=e.checkIfRestorable(x.map((e=>e.value)));t!==e.state.restorable&&e.setState({restorable:t}),e._verifyApplicability()},onChange:(t,n)=>{"clear"===n.action&&o&&e.changeValueTo([],void 0,!0),E(t)},onOpenMenu:async()=>{const t=kr(e);null==t||t.startInteraction(se),v(!0),await(0,f.lastValueFrom)(e.validateAndUpdate()),v(!1),b(!0),null==t||t.stopInteraction()},onCloseMenu:()=>{b(!1)}}):h().createElement(Gn.Select,{"aria-label":Zt("grafana-scenes.variables.group-by-variable-renderer.aria-label-group-by-selector","Group by selector"),"data-testid":`GroupBySelect-${r}`,id:r,placeholder:Zt("grafana-scenes.variables.group-by-variable-renderer.placeholder-group-by-label","Group by label"),width:"auto",inputValue:w,value:x&&x.length>0?x:null,allowCustomValue:u,noMultiValueWrap:!0,maxVisibleValues:null!=a?a:5,tabSelectsValue:!1,virtualized:!0,options:T,filterOption:Cr,closeMenuOnSelect:!0,isOpen:y,isClearable:!0,hideSelectedOptions:!1,noValueOnClear:!0,isLoading:g,onInputChange:k,onChange:(t,n)=>{if("clear"===n.action)return E([]),void(o&&e.changeValueTo([]));(null==t?void 0:t.value)&&(E([t]),e.changeValueTo([t.value],t.label?[t.label]:void 0))},onOpenMenu:async()=>{const t=kr(e);null==t||t.startInteraction(se),v(!0),await(0,f.lastValueFrom)(e.validateAndUpdate()),v(!1),b(!0),null==t||t.stopInteraction()},onCloseMenu:()=>{b(!1)}})};const Cr=()=>!0;function Ir(e){const{label:t,value:n,group:r}=e,i={label:t,value:n};return r&&(i.group=r),i}var Rr=function(){};var Ar="undefined"!=typeof window;const Nr=Ar?c.useLayoutEffect:c.useEffect;var Dr={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Lr=Ar&&void 0!==window.ResizeObserver?function(){var e=(0,c.useState)(null),t=e[0],n=e[1],r=(0,c.useState)(Dr),i=r[0],a=r[1],o=(0,c.useMemo)((function(){return new window.ResizeObserver((function(e){if(e[0]){var t=e[0].contentRect,n=t.x,r=t.y,i=t.width,o=t.height,s=t.top,l=t.left,u=t.bottom,c=t.right;a({x:n,y:r,width:i,height:o,top:s,left:l,bottom:u,right:c})}}))}),[]);return Nr((function(){if(t)return o.observe(t),function(){o.disconnect()}}),[t]),[n,i]}:function(){return[Rr,Dr]};function Pr({data:e,showAll:t,seriesLimit:n,onShowAllSeries:r}){const i=(0,Gn.useStyles2)(Mr),a=null==e?void 0:e.series.length;if(void 0===a||a<n)return null;const o=t?"Restore limit":`Show all ${a}`;return h().createElement("div",{className:i.timeSeriesDisclaimer},!t&&h().createElement("span",{className:i.warningMessage},h().createElement(Gn.Icon,{title:Zt("grafana-scenes.components.viz-panel-series-limit.warning-message","Showing only {{seriesLimit}} series",{seriesLimit:n}),name:"exclamation-triangle","aria-hidden":"true"})),h().createElement(Gn.Tooltip,{content:Zt("grafana-scenes.components.viz-panel-series-limit.content-rendering-series-single-panel-impact-performance","Rendering too many series in a single panel may impact performance and make data harder to read.")},h().createElement(Gn.Button,{variant:"secondary",size:"sm",onClick:r},o)))}const Mr=e=>({timeSeriesDisclaimer:(0,Qn.css)({label:"time-series-disclaimer",display:"flex",alignItems:"center",gap:e.spacing(1)}),warningMessage:(0,Qn.css)({display:"flex",alignItems:"center",gap:e.spacing(.5),color:e.colors.warning.main,fontSize:e.typography.bodySmall.fontSize})});const jr=function(e){(0,c.useEffect)(e,[])};function Fr(){const e=(0,c.useRef)(void 0);return null!=e.current||(e.current=(0,N.uniqueId)()),e.current}const Vr=h().forwardRef((({children:e,onLoad:t,onChange:n,className:r,...i},a)=>{const o=Fr(),{hideEmpty:s}=(0,Gn.useStyles2)($r),[l,u]=(0,c.useState)(!1),[d,f]=(0,c.useState)(!1),p=(0,c.useRef)(null);return(0,c.useImperativeHandle)(a,(()=>p.current)),jr((()=>{Vr.addCallback(o,(e=>{!l&&e.isIntersecting&&(u(!0),null==t||t()),f(e.isIntersecting),null==n||n(e.isIntersecting)}));const e=p.current;return e&&Vr.observer.observe(e),()=>{e&&Vr.observer.unobserve(e),delete Vr.callbacks[o],0===Object.keys(Vr.callbacks).length&&Vr.observer.disconnect()}})),h().createElement("div",{id:o,ref:p,className:`${s} ${r}`,...i},l?h().createElement(Br.Provider,{value:d},e):Zt("grafana-scenes.components.lazy-loader.placeholder"," "))}));function $r(){return{hideEmpty:(0,Qn.css)({"&:empty":{display:"none"}})}}Vr.displayName="LazyLoader",Vr.callbacks={},Vr.addCallback=(e,t)=>Vr.callbacks[e]=t,Vr.observer=new IntersectionObserver((e=>{for(const t of e)"function"==typeof Vr.callbacks[t.target.id]&&Vr.callbacks[t.target.id](t)}),{rootMargin:"100px"});const Br=h().createContext(!0);function zr(e,t){if(t)return t;let n=e.error?e.error.message:void 0;return e.errors&&(n=e.errors.map((e=>e.message)).join(", ")),n}const Ur=(0,Qn.css)({position:"relative",width:"100%",height:"100%"}),qr=(0,Qn.css)({position:"absolute",width:"100%",height:"100%"}),Hr=e=>({ok:(0,Qn.css)({color:e.colors.success.text}),pending:(0,Qn.css)({color:e.colors.warning.text}),alerting:(0,Qn.css)({color:e.colors.error.text})}),Wr="hideSeriesFrom",Gr=(0,a.isSystemOverrideWithRef)(Wr);function Kr(e,t=a.ByNamesMatcherMode.exclude,n){return n=null!=n?n:{id:"custom.hideFrom",value:{viz:!0,legend:!1,tooltip:!0}},{__systemRef:Wr,matcher:{id:a.FieldMatcherID.byNames,options:{mode:t,names:e,prefix:t===a.ByNamesMatcherMode.exclude?"All except:":void 0,readOnly:!0}},properties:[{...n,value:{viz:!0,legend:!1,tooltip:!0}}]}}const Qr=(e,t,n=a.ByNamesMatcherMode.exclude)=>{const r=e.properties.find((e=>"custom.hideFrom"===e.id)),i=Yr(e),o=i.findIndex((e=>e===t));return o<0?i.push(t):i.splice(o,1),Kr(i,n,r)},Yr=e=>{var t;const n=null==(t=e.matcher.options)?void 0:t.names;return Array.isArray(n)?[...n]:[]},Xr=(e,t)=>Yr(e).length===Jr(t).length,Jr=(e,t)=>{const n=new Set;for(const r of e)for(const i of r.fields){if(i.type!==a.FieldType.number)continue;const o=(0,a.getFieldDisplayName)(i,r,e);o!==t&&n.add(o)}return Array.from(n)},Zr=(e,t)=>{var n;let r=[];for(const i of e){const e=i.properties.find((e=>"custom.hideFrom"===e.id));if(void 0!==e&&!0===(null==(n=e.value)?void 0:n.legend)){const e=a.fieldMatchers.get(i.matcher.id).get(i.matcher.options);for(const n of t)for(const i of n.fields){if(i.type!==a.FieldType.number)continue;const o=(0,a.getFieldDisplayName)(i,n,t);e(i,n,t)&&r.push(o)}}}return r},ei=(e,t)=>({matcher:{id:a.FieldMatcherID.byName,options:e},properties:[ti(t)]}),ti=e=>({id:"color",value:{mode:a.FieldColorModeId.Fixed,fixedColor:e}});var ni=(e=>(e[e.never=0]="never",e[e.onDashboardLoad=1]="onDashboardLoad",e[e.onTimeRangeChanged=2]="onTimeRangeChanged",e))(ni||{});var ri=(e=>(e[e.Crosshair=1]="Crosshair",e[e.Off=0]="Off",e[e.Tooltip=2]="Tooltip",e))(ri||{});class ii extends I{constructor(e){super({...e,sync:e.sync||ri.Off}),this.getEventsBus=e=>{if(!this.parent)throw new Error("EnableCursorSync cannot be used as a standalone scene object");return new ai(this.parent,e)}}getEventsScope(){if(!this.parent)throw new Error("EnableCursorSync cannot be used as a standalone scene object");return this.state.key}}class ai{constructor(e,t){this._source=e,this._eventsOrigin=t}publish(e){e.origin=this,this._eventsOrigin.publishEvent(e,!0)}getStream(e){return new f.Observable((t=>{const n=this._source.subscribeToEvent(e,(e=>{t.next(e)}));return()=>n.unsubscribe()}))}subscribe(e,t){return this.getStream(e).pipe().subscribe(t)}removeAllListeners(){}newScopedBus(e,t){throw new Error("For internal use only")}}const oi=class e extends I{constructor({enabled:e=!1}){super({enabled:e}),this.timerId=void 0,this._activationHandler=()=>(this.state.enabled&&this.enable(),()=>{window.clearInterval(this.timerId),this.timerId=void 0}),this.addActivationHandler(this._activationHandler)}enable(){window.clearInterval(this.timerId),this.timerId=void 0,this.timerId=window.setInterval((()=>{const e=lc.findAllObjects(this.getRoot(),(e=>e instanceof pi));for(const t of e)t.forceRender()}),e.REFRESH_RATE),this.setState({enabled:!0})}disable(){window.clearInterval(this.timerId),this.timerId=void 0,this.setState({enabled:!1})}get isEnabled(){return this.state.enabled}};oi.REFRESH_RATE=100;let si,li=oi;class ui extends I{constructor(e={}){super({...e}),this._isTracking=!1,this._activeQueries=new Map,this.addActivationHandler((()=>this._onActivate()))}_onActivate(){var e,t;let n;try{n=lc.getAncestor(this,pi)}catch(e){return void q(0,0)}if(!n)return void q();if(!n.state.key)return void q();this._panelKey=n.state.key,this._panelId=String(n.getLegacyPanelId()),this._pluginId=n.state.pluginId;const r=n.getPlugin();return this._pluginVersion=null==(t=null==(e=null==r?void 0:r.meta)?void 0:e.info)?void 0:t.version,this._subs.add(n.subscribeToState(((e,t)=>{this._handlePanelStateChange(n,e,t)}))),()=>{this._cleanup()}}_handlePanelStateChange(e,t,n){t.pluginId!==n.pluginId&&this._onPluginChange(e,t.pluginId)}onQueryStarted(e,t,n){if(!this._panelKey)return null;this._activeQueries.set(n,{entry:t,startTime:e});const r=Ln("query");return jn().notifyPanelOperationStart({operationId:r,panelId:this._panelId,panelKey:this._panelKey,pluginId:this._pluginId,pluginVersion:this._pluginVersion,operation:"query",timestamp:e,metadata:{queryId:n,queryType:t.type}}),(e,i)=>{if(!this._panelKey)return;const a=this._activeQueries.get(n);if(!a)return;const o=e-a.startTime;this._activeQueries.delete(n),jn().notifyPanelOperationComplete({operationId:r,panelId:this._panelId,panelKey:this._panelKey,pluginId:this._pluginId,pluginVersion:this._pluginVersion,operation:"query",timestamp:e,duration:o,metadata:{queryId:n,queryType:t.type},error:i?(null==i?void 0:i.message)||String(i)||"Unknown error":void 0})}}onPluginLoadStart(e){if(!this._panelKey){let t;try{t=lc.getAncestor(this,pi)}catch(e){return null}t&&!this._panelKey&&t.state.key&&(this._panelKey=t.state.key,this._panelId=String(t.getLegacyPanelId()),this._pluginId=e)}if(!this._panelKey)return null;this._isTracking||this._startTracking(),this._loadPluginStartTime=performance.now();const t=Ln("pluginLoad");return jn().notifyPanelOperationStart({operationId:t,panelId:this._panelId,panelKey:this._panelKey,pluginId:this._pluginId,operation:"plugin-load",timestamp:this._loadPluginStartTime,metadata:{pluginId:e}}),(e,n=!1)=>{if(!this._panelKey||!this._loadPluginStartTime)return;const r=performance.now()-this._loadPluginStartTime;jn().notifyPanelOperationComplete({operationId:t,panelId:this._panelId,panelKey:this._panelKey,pluginId:this._pluginId,operation:"plugin-load",timestamp:performance.now(),duration:r,metadata:{pluginId:this._pluginId,fromCache:n,pluginLoadTime:r}}),this._loadPluginStartTime=void 0}}onFieldConfigStart(e){if(!this._panelKey)return null;this._applyFieldConfigStartTime=e;const t=Ln("fieldConfig");return jn().notifyPanelOperationStart({operationId:t,panelId:this._panelId,panelKey:this._panelKey,pluginId:this._pluginId,operation:"fieldConfig",timestamp:this._applyFieldConfigStartTime,metadata:{}}),(e,n,r)=>{if(!this._panelKey||!this._applyFieldConfigStartTime)return;const i=e-this._applyFieldConfigStartTime;jn().notifyPanelOperationComplete({operationId:t,panelId:this._panelId,panelKey:this._panelKey,pluginId:this._pluginId,operation:"fieldConfig",timestamp:e,duration:i,metadata:{}}),this._applyFieldConfigStartTime=void 0}}_getPanelInfo(){let e;try{e=lc.getAncestor(this,pi)}catch(e){}let t=(null==e?void 0:e.state.title)||this._panelKey||"No-key panel";return t.length>30&&(t=t.substring(0,27)+"..."),`VizPanelRenderProfiler [${t}]`}onSimpleRenderStart(e){if(!this._panelKey)return;const t=Ln("render");return jn().notifyPanelOperationStart({operationId:t,panelId:this._panelId||"unknown",panelKey:this._panelKey,pluginId:this._pluginId||"unknown",pluginVersion:this._pluginVersion,operation:"render",timestamp:e,metadata:{}}),(e,n)=>{this._panelKey&&jn().notifyPanelOperationComplete({operationId:t,panelId:this._panelId||"unknown",panelKey:this._panelKey,pluginId:this._pluginId||"unknown",pluginVersion:this._pluginVersion,operation:"render",duration:n,timestamp:e,metadata:{}})}}_onPluginChange(e,t){var n,r;this._pluginId=t;const i=e.getPlugin();this._pluginVersion=null==(r=null==(n=null==i?void 0:i.meta)?void 0:n.info)?void 0:r.version,q(this._getPanelInfo())}_startTracking(){this._panelKey&&this._pluginId&&!this._isTracking&&(this._isTracking=!0)}_cleanup(){this._activeQueries.clear(),this._isTracking=!1,q(this._getPanelInfo())}onDataTransformStart(e,t,n){if(!this._panelKey)return null;const r=Ln("transform");return jn().notifyPanelOperationStart({operationId:r,panelId:this._panelId,panelKey:this._panelKey,pluginId:this._pluginId,operation:"transform",timestamp:e,metadata:{transformationId:t,transformationCount:n.transformationCount,seriesTransformationCount:n.seriesTransformationCount,annotationTransformationCount:n.annotationTransformationCount}}),(e,i,a,o)=>{this._panelKey&&jn().notifyPanelOperationComplete({operationId:r,panelId:this._panelId,panelKey:this._panelKey,pluginId:this._pluginId,operation:"transform",timestamp:e,duration:i,metadata:{transformationId:t,transformationCount:n.transformationCount,seriesTransformationCount:n.seriesTransformationCount,annotationTransformationCount:n.annotationTransformationCount,success:a,error:(null==o?void 0:o.error)||(a?void 0:"Transform operation failed")}})}}}class ci{constructor(){this._resultsMap=new Map,this._prevLayers=[]}getMergedStream(e){(function(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1})(e,this._prevLayers)&&(this._resultsMap=new Map,this._prevLayers=e);const t=e.map((e=>e.getResultsStream())),n=[];for(const t of e)n.push(t.activate());return(0,f.merge)(t).pipe((0,f.mergeAll)(),(0,f.filter)((e=>this._resultsMap.get(e.origin.state.key)!==e)),(0,f.map)((e=>(this._resultsMap.set(e.origin.state.key,e),this._resultsMap.values()))),(0,f.finalize)((()=>{n.forEach((e=>e()))})))}}class di extends I{constructor(){super(...arguments),this.isDataLayer=!0,this._results=new f.ReplaySubject(1),this._dataLayersMerger=new ci}subscribeToAllLayers(e){e.length>0?this.querySub=this._dataLayersMerger.getMergedStream(e).subscribe(this._onLayerUpdateReceived.bind(this)):(this._results.next({origin:this,data:Q}),this.setStateHelper({data:Q}))}_onLayerUpdateReceived(e){var t;let n=[];for(const r of e)(null==(t=r.data)?void 0:t.series)&&(n=n.concat(r.data.series));const r={...Q,series:n};this._results.next({origin:this,data:r}),this.setStateHelper({data:r})}getResultsStream(){return this._results}cancelQuery(){var e;null==(e=this.querySub)||e.unsubscribe()}setStateHelper(e){wn(this,e)}}class hi extends di{constructor(e){var t,n;super({name:null!=(t=e.name)?t:"Data layers",layers:null!=(n=e.layers)?n:[]}),this.addActivationHandler((()=>this._onActivate()))}_onActivate(){return this._subs.add(this.subscribeToState(((e,t)=>{var n;e.layers!==t.layers&&(null==(n=this.querySub)||n.unsubscribe(),this.subscribeToAllLayers(e.layers))}))),this.subscribeToAllLayers(this.state.layers),()=>{var e;null==(e=this.querySub)||e.unsubscribe()}}}hi.Component=({model:e})=>{const{layers:t}=e.useState();return h().createElement(h().Fragment,null,t.map((e=>h().createElement(e.Component,{model:e,key:e.state.key}))))};class fi extends I{constructor(e){super(e),this._results=new f.ReplaySubject(1),this._variableDependency=new Mu(this,{statePaths:["transformations"],onReferencedVariableValueChanged:()=>this.reprocessTransformations()}),this.addActivationHandler((()=>this.activationHandler()))}activationHandler(){const e=this.getSourceData();return this._subs.add(e.subscribeToState((e=>this.transform(e.data)))),e.state.data&&this.transform(e.state.data),()=>{this._transformSub&&this._transformSub.unsubscribe()}}getSourceData(){if(this.state.$data){if(this.state.$data instanceof hi)throw new Error("SceneDataLayerSet can not be used as data provider for SceneDataTransformer.");return this.state.$data}if(!this.parent||!this.parent.parent)throw new Error("SceneDataTransformer must either have $data set on it or have a parent.parent with $data");return lc.getData(this.parent.parent)}setContainerWidth(e){this.state.$data&&this.state.$data.setContainerWidth&&this.state.$data.setContainerWidth(e)}isDataReadyToDisplay(){const e=this.getSourceData();return!e.isDataReadyToDisplay||e.isDataReadyToDisplay()}reprocessTransformations(){this.transform(this.getSourceData().state.data,!0)}_calculateTransformationMetrics(e,t){return{transformationCount:t.length,seriesTransformationCount:t.filter((e=>!("options"in e)&&!("topic"in e)||(null==e.topic||e.topic===a.DataTopic.Series))).length,annotationTransformationCount:t.filter((e=>("options"in e||"topic"in e)&&e.topic===a.DataTopic.Annotations)).length}}cancelQuery(){var e,t;null==(t=(e=this.getSourceData()).cancelQuery)||t.call(e)}getResultsStream(){return this._results}clone(e){const t=super.clone(e);return this._prevDataFromSource&&(t._prevDataFromSource=this._prevDataFromSource),t}isInViewChanged(e){var t,n;null==(n=null==(t=this.state.$data)?void 0:t.isInViewChanged)||n.call(t,e)}bypassIsInViewChanged(e){var t,n;null==(n=null==(t=this.state.$data)?void 0:t.bypassIsInViewChanged)||n.call(t,e)}haveAlreadyTransformedData(e){if(!this._prevDataFromSource)return!1;if(e===this._prevDataFromSource)return!0;const{series:t,annotations:n}=this._prevDataFromSource;return e.series===t&&e.annotations===n&&(this.state.data&&e.state!==this.state.data.state&&this.setState({data:{...this.state.data,state:e.state}}),!0)}transform(e,t=!1){var n;const r=performance.now(),i=mi(this),s=performance.now();let l,u=null;if(0===this.state.transformations.length||!e)return this._prevDataFromSource=e,this.setState({data:e}),void(e&&this._results.next({origin:this,data:e}));if(!t&&this.haveAlreadyTransformedData(e))return;if(i){const t=this.state.transformations.map((e=>"id"in e?e.id:"customTransformation")).join("+");l=t||"no-transforms";const n=this._calculateTransformationMetrics(e,this.state.transformations);u=i.onDataTransformStart(r,l,n)}const c=this._interpolateVariablesInTransformationConfigs(e),d=this._filterAndPrepareTransformationsByTopic(c,(e=>!("options"in e)&&!("topic"in e)||(null==e.topic||e.topic===a.DataTopic.Series))),h=this._filterAndPrepareTransformationsByTopic(c,(e=>("options"in e||"topic"in e)&&e.topic===a.DataTopic.Annotations));this._transformSub&&this._transformSub.unsubscribe();const p={interpolate:(t,n)=>{var r;return lc.interpolate(this,t,{...null==(r=e.request)?void 0:r.scopedVars,...n})}},m=(0,a.transformDataFrame)(d,e.series,p),g=(0,a.transformDataFrame)(h,null!=(n=e.annotations)?n:[]);let v=[],y=[];this._transformSub=(0,f.forkJoin)([m,g]).pipe((0,f.map)((t=>(t.forEach((e=>{var t;for(const n of e)(null==(t=n.meta)?void 0:t.dataTopic)===a.DataTopic.Annotations?y.push(n):v.push(n)})),{...e,series:v,annotations:y}))),(0,f.catchError)((t=>{var n;const r=performance.now();u&&u(r,r-s,!1,{error:t.message||t}),console.error("Error transforming data: ",t);const i=(null==(n=this.getSourceData().state.data)?void 0:n.errors)||[],l=(0,o.toDataQueryError)(t);l.message=`Error transforming data: ${l.message}`;const c={...e,state:a.LoadingState.Error,errors:[...i,l]};return(0,f.of)(c)}))).subscribe((t=>{var n;const r=performance.now();u&&u(r,r-s,!0,{outputSeriesCount:t.series.length,outputAnnotationsCount:(null==(n=t.annotations)?void 0:n.length)||0}),this.setState({data:t}),this._results.next({origin:this,data:t}),this._prevDataFromSource=e}))}_interpolateVariablesInTransformationConfigs(e){var t;const n=this.state.transformations;if(0===this._variableDependency.getNames().size)return n;const r=n.every((e=>"object"==typeof e));return r?JSON.parse(lc.interpolate(this,JSON.stringify(n),null==(t=e.request)?void 0:t.scopedVars)):n.map((t=>{var n;return"object"==typeof t?JSON.parse(lc.interpolate(this,JSON.stringify(t),null==(n=e.request)?void 0:n.scopedVars)):t}))}_filterAndPrepareTransformationsByTopic(e,t){return e.filter(t).map((e=>"operator"in e?e.operator:e))}}class pi extends I{constructor(e){var t;super({options:{},fieldConfig:{defaults:{},overrides:[]},title:Zt("grafana-scenes.components.viz-panel.title.title","Title"),pluginId:"timeseries",_renderCounter:0,...e}),this._variableDependency=new Mu(this,{statePaths:["title","options","fieldConfig"]}),this._structureRev=0,this.onTimeRangeChange=e=>{lc.getTimeRange(this).onTimeRangeChange({raw:{from:(0,a.toUtc)(e.from),to:(0,a.toUtc)(e.to)},from:(0,a.toUtc)(e.from),to:(0,a.toUtc)(e.to)})},this.getTimeRange=e=>{const t=lc.findObject(this,(e=>e instanceof li)),n=lc.getTimeRange(this);if(t instanceof li&&t.isEnabled)return ee(n.state.from,n.state.to,n.getTimeZone(),n.state.fiscalYearStartMonth,n.state.UNSAFE_nowDelay,n.state.weekStart);const r=this.getPlugin();return r&&!r.meta.skipDataQuery&&e&&e.timeRange?e.timeRange:n.state.value},this.onTitleChange=e=>{this.setState({title:e})},this.onDescriptionChange=e=>{this.setState({description:e})},this.onDisplayModeChange=e=>{this.setState({displayMode:e})},this.onToggleCollapse=e=>{this.setState({collapsed:e})},this.onOptionsChange=(e,t=!1,n=!1)=>{var r;const{fieldConfig:i,options:o}=this.state,s=t?e:(0,N.mergeWith)((0,N.cloneDeep)(o),e,((e,t,n,r)=>{if((0,N.isArray)(t))return t;e===t||void 0!==t||(r[n]=t)})),l=(0,a.getPanelOptionsWithDefaults)({plugin:this._plugin,currentOptions:s,currentFieldConfig:i,isAfterPluginChange:n});this.setState({options:l.options,_renderCounter:(null!=(r=this.state._renderCounter)?r:0)+1})},this.onFieldConfigChange=(e,t)=>{const{fieldConfig:n,options:r}=this.state,i=t?e:(0,N.merge)((0,N.cloneDeep)(n),e),o=(0,a.getPanelOptionsWithDefaults)({plugin:this._plugin,currentOptions:r,currentFieldConfig:i,isAfterPluginChange:!1});this._dataWithFieldConfig=void 0,this.setState({fieldConfig:o.fieldConfig})},this.interpolate=(e,t,n)=>lc.interpolate(this,e,t,n),this.getDescription=()=>{this.publishEvent(new _({origin:this,interaction:"panel-description-shown"}),!0);const{description:e}=this.state;if(e){const t=this.interpolate(e);return(0,a.renderMarkdown)(t)}return""},this.onCancelQuery=()=>{var e;this.publishEvent(new _({origin:this,interaction:"panel-cancel-query-clicked"}),!0);const t=lc.getData(this);null==(e=t.cancelQuery)||e.call(t)},this.onStatusMessageClick=()=>{this.publishEvent(new _({origin:this,interaction:"panel-status-message-clicked"}),!0)},this._onSeriesColorChange=(e,t)=>{this.onFieldConfigChange(((e,t,n)=>{const{overrides:r}=n,i=n.overrides.findIndex((t=>t.matcher.id===a.FieldMatcherID.byName&&t.matcher.options===e));if(i<0)return{...n,overrides:[...n.overrides,ei(e,t)]};const o=Array.from(r),s=o[i],l=s.properties.findIndex((e=>"color"===e.id));if(l<0)return o[i]={...s,properties:[...s.properties,ti(t)]},{...n,overrides:o};const u=Array.from(s.properties);return u[l]=ti(t),o[i]={...s,properties:u},{...n,overrides:o}})(e,t,this.state.fieldConfig))},this._onSeriesVisibilityChange=(e,t)=>{this._dataWithFieldConfig&&this.onFieldConfigChange(function(e,t,n,r){const{overrides:i}=n,a=e,o=i.findIndex(Gr);if(o<0){if(t===Gn.SeriesVisibilityChangeMode.ToggleSelection){const e=Kr([a,...Zr(i,r)]);return{...n,overrides:[...n.overrides,e]}}const e=Kr(Jr(r,a));return{...n,overrides:[...n.overrides,e]}}const s=Array.from(i),[l]=s.splice(o,1);if(t===Gn.SeriesVisibilityChangeMode.ToggleSelection){let e=Yr(l);const t=Zr(s,r);if(t.length>0&&(e=e.filter((e=>t.indexOf(e)<0))),e[0]===a&&1===e.length)return{...n,overrides:s};const i=Kr([a,...t]);return{...n,overrides:[...s,i]}}const u=Qr(l,a);return Xr(u,r)?{...n,overrides:s}:{...n,overrides:[...s,u]}}(e,t,this.state.fieldConfig,this._dataWithFieldConfig.series),!0)},this._onInstanceStateChange=e=>{this._panelContext&&(this._panelContext={...this._panelContext,instanceState:e}),this.setState({_pluginInstanceState:e})},this._onToggleLegendSort=e=>{const t=this.state.options.legend;if(!t)return;let n=t.sortDesc,r=t.sortBy;e!==r&&(n=void 0),!1===n?(r=void 0,n=void 0):(n=!n,r=e),this.onOptionsChange({...this.state.options,legend:{...t,sortBy:r,sortDesc:n}},!0)},this.addActivationHandler((()=>{this._onActivate()})),null==(t=e.menu)||t.addActivationHandler((()=>{this.publishEvent(new _({origin:this,interaction:"panel-menu-shown"}),!0)}))}getProfiler(){if(this.state.$behaviors)for(const e of this.state.$behaviors)if(e instanceof ui)return e}_onActivate(){this._plugin||this._loadPlugin(this.state.pluginId)}forceRender(){var e;this.setState({_renderCounter:(null!=(e=this.state._renderCounter)?e:0)+1})}async _loadPlugin(e,t,n,r){const i=this.getProfiler(),s=function(e){var t;const{getPanelPluginFromCache:n}=(0,o.getPluginImportUtils)();return null!=(t=n(e))?t:u.get(e)}(e);if(s){const a=null==i?void 0:i.onPluginLoadStart(e);null==a||a(s,!0),this._pluginLoaded(s,t,n,r)}else{const{importPanelPlugin:s}=(0,o.getPluginImportUtils)();try{const a=null==i?void 0:i.onPluginLoadStart(e),o=s(e),l=lc.getQueryController(this);l&&l.state.enableProfiling&&Vn(o).pipe(Fn({type:`VizPanel/loadPlugin/${e}`,origin:this})).subscribe((()=>{}));const u=await o;null==a||a(u,!1),this._pluginLoaded(u,t,n,r)}catch(t){this._pluginLoaded(function(e){const t=new a.PanelPlugin((()=>null));return t.meta={id:e,name:e,sort:100,type:a.PluginType.panel,module:"",baseUrl:"",info:{author:{name:""},description:"",links:[],logos:{large:"",small:"public/img/grafana_icon.svg"},screenshots:[],updated:"",version:""}},t}(e)),t instanceof Error&&this.setState({_pluginLoadError:t.message})}}}getLegacyPanelId(){var e,t;const n=null!=(t=null==(e=this.state.key)?void 0:e.split("/"))?t:[];if(0===n.length)return 0;const r=n[n.length-1],i=parseInt(r.replace("panel-",""),10);return isNaN(i)?0:i}getPathId(){return dc(this)}async _pluginLoaded(e,t,n,r){var i;const{options:o,fieldConfig:s,title:l,pluginVersion:u,_UNSAFE_customMigrationHandler:c}=this.state,d={title:l,options:o,fieldConfig:s,id:this.getLegacyPanelId(),type:e.meta.id,pluginVersion:u};t&&(d.options=t),n&&(d.fieldConfig=n);const h=this._getPluginVersion(e);null==c||c(d,e);const f=h!==u||(null==(i=e.shouldMigrate)?void 0:i.call(e,d));e.onPanelMigration&&f&&!r&&(d.options=await e.onPanelMigration(d));let p=this.state.$data;d.transformations&&p&&(p instanceof fi?p.setState({transformations:d.transformations}):p instanceof gu&&(p.clearParent(),p=new fi({transformations:d.transformations,$data:p})));const m=(0,a.getPanelOptionsWithDefaults)({plugin:e,currentOptions:d.options,currentFieldConfig:d.fieldConfig,isAfterPluginChange:null!=r&&r});if(this._plugin=e,this.setState({$data:p,options:m.options,fieldConfig:m.fieldConfig,pluginVersion:h,pluginId:e.meta.id}),e.meta.skipDataQuery){const e=lc.getTimeRange(this);this._subs.add(e.subscribeToState((()=>this.forceRender())))}}_getPluginVersion(e){return e&&e.meta.info.version?e.meta.info.version:o.config.buildInfo.version}getPlugin(){return this._plugin}getPanelContext(){return null!=this._panelContext||(this._panelContext=this.buildPanelContext()),this._panelContext}async changePluginType(e,t,n){var r,i;const{options:a,fieldConfig:o,pluginId:s}=this.state;this._dataWithFieldConfig=void 0;const l=this.state.pluginId!==e;await this._loadPlugin(e,null!=t?t:{},n,l);const u={title:this.state.title,options:this.state.options,fieldConfig:this.state.fieldConfig,id:1,type:e},c=null==(i=null==(r=this._plugin)?void 0:r.onPanelTypeChanged)?void 0:i.call(r,u,s,a,o);c&&!(0,N.isEmpty)(c)&&this.onOptionsChange(c,!0,!0)}clearFieldConfigCache(){this._dataWithFieldConfig=void 0}applyFieldConfig(e){var t,n,r,i;const s=performance.now(),l=this._plugin,u=this.getProfiler();if(!l||l.meta.skipDataQuery||!e)return Q;if(this._prevData===e&&this._dataWithFieldConfig)return this._dataWithFieldConfig;const c=null==u?void 0:u.onFieldConfigStart(s),d=l.dataSupport||{alertStates:!1,annotations:!1},h=l.fieldConfigRegistry,f=null!=(n=null==(t=this._dataWithFieldConfig)?void 0:t.series)?n:[],p=(0,a.applyFieldOverrides)({data:e.series,fieldConfig:this.state.fieldConfig,fieldConfigRegistry:h,replaceVariables:this.interpolate,theme:o.config.theme2,timeZone:null==(r=e.request)?void 0:r.timezone});return(0,a.compareArrayValues)(p,f,a.compareDataFrameStructures)||this._structureRev++,this._dataWithFieldConfig={...e,structureRev:this._structureRev,series:p},this._dataWithFieldConfig.annotations&&(this._dataWithFieldConfig.annotations=(0,a.applyFieldOverrides)({data:this._dataWithFieldConfig.annotations,fieldConfig:{defaults:{},overrides:[]},fieldConfigRegistry:h,replaceVariables:this.interpolate,theme:o.config.theme2,timeZone:null==(i=e.request)?void 0:i.timezone})),d.alertStates||(this._dataWithFieldConfig.alertState=void 0),d.annotations||(this._dataWithFieldConfig.annotations=void 0),this._prevData=e,u&&(null==c||c(performance.now())),this._dataWithFieldConfig}clone(e){return super.clone({_pluginInstanceState:void 0,_pluginLoadError:void 0,...e})}buildPanelContext(){const e=(t=this,lc.findObject(t,(e=>e instanceof ii)));var t;const n={eventsScope:e?e.getEventsScope():"__global_",eventBus:e?e.getEventsBus(this):(0,o.getAppEvents)(),app:a.CoreApp.Unknown,sync:()=>e?e.state.sync:a.DashboardCursorSync.Off,onSeriesColorChange:this._onSeriesColorChange,onToggleSeriesVisibility:this._onSeriesVisibilityChange,onToggleLegendSort:this._onToggleLegendSort,onInstanceStateChange:this._onInstanceStateChange};return this.state.extendPanelContext&&this.state.extendPanelContext(this,n),n}}function mi(e){try{const t=lc.getAncestor(e,pi);if(t){return(t.state.$behaviors||[]).find((e=>e instanceof ui))}}catch(e){}}pi.Component=function({model:e}){var t;const{title:n,options:r,fieldConfig:i,_pluginLoadError:s,displayMode:l,hoverHeader:u,showMenuAlways:d,hoverHeaderOffset:f,menu:p,headerActions:m,titleItems:g,seriesLimit:v,seriesLimitShowAll:y,description:b,collapsible:w,collapsed:S,_renderCounter:x=0}=e.useState(),[E,{width:_,height:O}]=Lr(),k=(0,c.useMemo)((()=>(0,o.getAppEvents)()),[]),T=(0,c.useCallback)((()=>{e.state.key&&k.publish(new a.SetPanelAttentionEvent({panelId:e.getPathId()}))}),[e,k]),C=(0,c.useMemo)((()=>(0,N.debounce)(T,100,{leading:!0,trailing:!1})),[T]),I=(0,c.useMemo)((()=>e.getProfiler()),[e]),R=performance.now(),A=h().useRef(null);(0,c.useLayoutEffect)((()=>{if(I){const e=I.onSimpleRenderStart(R);A.current=e||null}})),(0,c.useEffect)((()=>{if(A.current){const e=performance.now(),t=e-R;A.current(e,t),A.current=null}}));const D=e.getPlugin(),{dragClass:L,dragClassCancel:P}=function(e){var t,n;const r=lc.getLayout(e),i=null==r?void 0:r.isDraggable();if(!r||!i||function(e,t){let n=e;for(;n&&n!==t;){if("isDraggable"in n.state&&!1===n.state.isDraggable)return!0;if("repeatSourceKey"in n.state&&n.state.repeatSourceKey)return!0;n=n.parent}return!1}(e,r))return{dragClass:"",dragClassCancel:""};return{dragClass:null==(t=r.getDragClass)?void 0:t.call(r),dragClassCancel:null==(n=null==r?void 0:r.getDragClassCancel)?void 0:n.call(r)}}(e),M=function(e){var t,n;const r=lc.getLayout(e);return null!=(n=null==(t=null==r?void 0:r.getDragHooks)?void 0:t.call(r))?n:{}}(e),j=lc.getData(e),F=j.useState(),V=function(e,t,n){return(0,c.useMemo)((()=>(null==e?void 0:e.series)&&t&&!n?{...e,series:e.series.slice(0,t)}:e),[e,t,n])}(F.data,v,y),$=e.applyFieldConfig(V),B=lc.getTimeRange(e).getTimeZone(),z=e.getTimeRange($),U=h().useContext(Br);(0,c.useEffect)((()=>{j.isInViewChanged&&j.isInViewChanged(U)}),[U,j]);const q=e.interpolate(n,void 0,"text"),H=(0,Gn.useStyles2)(Hr);if(!D)return h().createElement("div",null,h().createElement(en,{i18nKey:"grafana-scenes.components.viz-panel-renderer.loading-plugin-panel"},"Loading plugin panel..."));if(!D.panel)return h().createElement("div",null,h().createElement(en,{i18nKey:"grafana-scenes.components.viz-panel-renderer.panel-plugin-has-no-panel-component"},"Panel plugin has no panel component"));const W=D.panel;j&&j.setContainerWidth&&j.setContainerWidth(Math.round(_));let G,K,Q=[];g&&(Array.isArray(g)?Q=Q.concat(g.map((e=>h().createElement(e.Component,{model:e,key:`${e.state.key}`})))):An(g)?Q.push(h().createElement(g.Component,{model:g})):Q.push(g)),v&&Q.push(h().createElement(Pr,{key:"series-limit",data:F.data,seriesLimit:v,showAll:y,onShowAllSeries:()=>e.setState({seriesLimitShowAll:!y})})),e.state.$timeRange&&Q.push(h().createElement(e.state.$timeRange.Component,{model:e.state.$timeRange,key:e.state.key})),$.alertState&&Q.push(h().createElement(Gn.Tooltip,{content:null!=(t=$.alertState.state)?t:"unknown",key:`alert-states-icon-${e.state.key}`},h().createElement(Gn.PanelChrome.TitleItem,{className:(0,Qn.cx)({[H.ok]:$.alertState.state===a.AlertState.OK,[H.pending]:$.alertState.state===a.AlertState.Pending,[H.alerting]:$.alertState.state===a.AlertState.Alerting})},h().createElement(Gn.Icon,{name:"alerting"===$.alertState.state?"heart-break":"heart",className:"panel-alert-icon",size:"md"})))),p&&(G=h().createElement(p.Component,{model:p})),m&&(K=Array.isArray(m)?h().createElement(h().Fragment,null,m.map((e=>h().createElement(e.Component,{model:e,key:`${e.state.key}`})))):An(m)?h().createElement(m.Component,{model:m}):m);const Y=$,X=!j.isDataReadyToDisplay||j.isDataReadyToDisplay(),J=e.getPanelContext(),Z=e.getLegacyPanelId();return h().createElement("div",{className:Ur},h().createElement("div",{ref:E,className:qr,"data-viz-panel-key":e.state.key},_>0&&O>0&&h().createElement(Gn.PanelChrome,{title:q,description:(null==b?void 0:b.trim())?e.getDescription:void 0,loadingState:Y.state,statusMessage:zr(Y,s),statusMessageOnClick:e.onStatusMessageClick,width:_,height:O,selectionId:e.state.key,displayMode:l,titleItems:Q,dragClass:L,actions:K,dragClassCancel:P,padding:D.noPadding?"none":"md",menu:G,onCancelQuery:e.onCancelQuery,onFocus:T,onMouseEnter:T,onMouseMove:C,onDragStart:t=>{var n;null==(n=M.onDragStart)||n.call(M,t,e)},showMenuAlways:d,...w?{collapsible:Boolean(w),collapsed:S,onToggleCollapse:e.onToggleCollapse}:{hoverHeader:u,hoverHeaderOffset:f}},((t,o)=>h().createElement(h().Fragment,null,h().createElement(Gn.ErrorBoundaryAlert,{dependencies:[D,Y]},h().createElement(a.PluginContextProvider,{meta:D.meta},h().createElement(Gn.PanelContextProvider,{value:J},X&&h().createElement(W,{id:Z,data:Y,title:n,timeRange:z,timeZone:B,options:r,fieldConfig:i,transparent:"transparent"===l,width:t,height:o,renderCounter:x,replaceVariables:e.interpolate,onOptionsChange:e.onOptionsChange,onFieldConfigChange:e.onFieldConfigChange,onChangeTimeRange:e.onTimeRangeChange,eventBus:J.eventBus})))))))))};const gi=new Set;function vi(e){return h().createElement(Gn.Tooltip,{content:Zt("grafana-scenes.utils.loading-indicator.content-cancel-query","Cancel query")},h().createElement(Gn.Icon,{className:"spin-clockwise",name:"sync",size:"xs",role:"button",onMouseDown:t=>{e.onCancel(t)}}))}function yi(e){const t=(0,Gn.useStyles2)(bi),n=(0,Gn.useTheme2)(),r="vertical"===e.layout,i=Boolean(e.isLoading)?h().createElement("div",{style:{marginLeft:n.spacing(1),marginTop:"-1px"},"aria-label":Kn.Tp.components.LoadingIndicator.icon},h().createElement(vi,{onCancel:t=>{var n;t.preventDefault(),t.stopPropagation(),null==(n=e.onCancel)||n.call(e)}})):null;let a=null;e.error&&(a=h().createElement(Gn.Tooltip,{content:e.error,placement:"bottom"},h().createElement(Gn.Icon,{className:t.errorIcon,name:"exclamation-triangle"})));let o=null;e.description&&(o=h().createElement(Gn.Tooltip,{content:e.description,placement:r?"top":"bottom"},h().createElement(Gn.Icon,{className:t.normalIcon,name:"info-circle"})));const s="string"==typeof e.label?Kn.Tp.pages.Dashboard.SubMenu.submenuItemLabels(e.label):"";let l;return l=r?h().createElement("label",{className:(0,Qn.cx)(t.verticalLabel,e.className),"data-testid":s,htmlFor:e.htmlFor},e.prefix,e.label,o,a,e.icon&&h().createElement(Gn.Icon,{name:e.icon,className:t.normalIcon}),i,e.onRemove&&h().createElement(Gn.IconButton,{variant:"secondary",size:"xs",name:"times",onClick:e.onRemove,tooltip:Zt("grafana-scenes.utils.controls-label.tooltip-remove","Remove")}),e.suffix):h().createElement("label",{className:(0,Qn.cx)(t.horizontalLabel,e.className),"data-testid":s,htmlFor:e.htmlFor},e.prefix,a,e.icon&&h().createElement(Gn.Icon,{name:e.icon,className:t.normalIcon}),e.label,o,i,e.suffix),l}const bi=e=>({horizontalLabel:(0,Qn.css)({background:e.isDark?e.colors.background.primary:e.colors.background.secondary,display:"flex",alignItems:"center",padding:e.spacing(0,1),fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.bodySmall.fontSize,height:e.spacing(e.components.height.md),lineHeight:e.spacing(e.components.height.md),borderRadius:`${e.shape.radius.default} 0 0 ${e.shape.radius.default}`,border:`1px solid ${e.components.input.borderColor}`,position:"relative",right:-1,whiteSpace:"nowrap",gap:e.spacing(.5)}),verticalLabel:(0,Qn.css)({display:"flex",alignItems:"center",fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.bodySmall.fontSize,lineHeight:e.typography.bodySmall.lineHeight,whiteSpace:"nowrap",marginBottom:e.spacing(.5),gap:e.spacing(1)}),errorIcon:(0,Qn.css)({color:e.colors.error.text}),normalIcon:(0,Qn.css)({color:e.colors.text.secondary})});function wi(e){const t=e.map((e=>{var t;return null!=(t=e.label)?t:String(e.value)}));return n=>ir(e,t,n)}function Si(e,t){return""!==e?{value:e,label:t||e}:null}const xi=()=>!0;function Ei({filter:e,model:t}){var n,r,i,a,o;const s=(0,Gn.useStyles2)(_i),[l,u]=(0,c.useState)([]),[d,f]=(0,c.useState)([]),[p,m]=(0,c.useState)(!1),[g,v]=(0,c.useState)(!1),[y,b]=(0,c.useState)(!1),[w,S]=(0,c.useState)(!1),[x,E]=(0,c.useState)(!1),[_,O]=(0,c.useState)(""),[k,T]=(0,c.useState)(!1),[C,I]=(0,c.useState)(e.values?e.values.map(((t,n)=>{var r;return Si(t,null==(r=e.valueLabels)?void 0:r[n])})):[]),R=hu(e.operator),A=Si(e.key,e.keyLabel),N=Si(e.value,null==(n=e.valueLabels)?void 0:n[0]),D=(0,c.useMemo)((()=>wi(d)),[d]),L=t.state.onAddCustomValue,P=(0,c.useMemo)((()=>Du(D(_))),[D,_]),M={isMulti:!0,value:C,components:{Option:dr},hideSelectedOptions:!1,closeMenuOnSelect:!1,openMenuOnFocus:!1,onChange:e=>{I(e),e.some((e=>e.__isNew__))&&O("")},onBlur:()=>{var n,r;t._updateFilter(e,{value:null!=(r=null==(n=C[0])?void 0:n.value)?r:"",values:C.map((e=>e.value)),valueLabels:C.map((e=>e.label))})}},j=iu.find((t=>e.operator===t.value)),F=h().createElement(Gn.Select,{virtualized:!0,allowCustomValue:null==(r=t.state.allowCustomValue)||r,createOptionPosition:(null==j?void 0:j.isRegex)?"first":"last",isValidNewOption:e=>e.trim().length>0,allowCreateWhileLoading:!0,formatCreateLabel:e=>`Use custom value: ${e}`,disabled:t.state.readOnly,className:(0,Qn.cx)(s.value,w?s.widthWhenOpen:void 0),width:"auto",value:N,filterOption:xi,placeholder:Zt("grafana-scenes.variables.ad-hoc-filter-renderer.value-select.placeholder-select-value","Select value"),options:P,inputValue:_,onInputChange:(e,{action:t})=>("input-change"===t&&O(e),e),onChange:n=>{L&&n.__isNew__?t._updateFilter(e,L(n,e)):t._updateFilter(e,{value:n.value,valueLabels:n.label?[n.label]:[n.value]}),k!==n.__isNew__&&T(n.__isNew__)},isOpen:w&&!g,isLoading:g,openMenuOnFocus:!0,onOpenMenu:async()=>{var n;v(!0),S(!0);const r=await t._getValuesFor(e);v(!1),f(r),k&&O(null!=(n=null==N?void 0:N.label)?n:"")},onCloseMenu:()=>{S(!1),O("")},...R&&M}),V=h().createElement(Gn.Select,{key:""+(g?"loading":"loaded"),disabled:t.state.readOnly,className:(0,Qn.cx)(s.key,y?s.widthWhenOpen:void 0),width:"auto",allowCustomValue:null==(i=t.state.allowCustomValue)||i,createOptionPosition:(null==j?void 0:j.isRegex)?"first":"last",value:A,placeholder:Zt("grafana-scenes.variables.ad-hoc-filter-renderer.key-select.placeholder-select-label","Select label"),options:Du(l),onChange:n=>{t._updateFilter(e,{key:n.value,keyLabel:n.label,value:"",valueLabels:[""],values:void 0}),I([])},autoFocus:""===e.key,isOpen:y&&!p,isLoading:p,onOpenMenu:async()=>{b(!0),m(!0);const n=await t._getKeys(e.key);m(!1),u(n)},onCloseMenu:()=>{b(!1)},onBlur:()=>{""===e.key&&t._removeFilter(e)},openMenuOnFocus:!0}),$=h().createElement(Gn.Select,{className:(0,Qn.cx)(s.operator,{[s.widthWhenOpen]:x}),value:e.operator,disabled:t.state.readOnly,options:t._getOperators(),onChange:n=>{var r,i;const a=e.operator,o=n.value,s={operator:o};hu(a)&&!hu(o)?(s.value="",s.valueLabels=[""],s.values=void 0,I([])):!hu(a)&&hu(o)&&e.value&&(s.values=[e.value],I([{value:e.value,label:null!=(i=null==(r=e.valueLabels)?void 0:r[0])?i:e.value}])),t._updateFilter(e,s)},onOpenMenu:()=>{E(!0)},onCloseMenu:()=>{E(!1)}});if("vertical"===t.state.layout){if(e.key){const n=h().createElement(yi,{layout:"vertical",label:null!=(a=e.key)?a:"",onRemove:()=>t._removeFilter(e)});return h().createElement(Gn.Field,{label:n,"data-testid":`AdHocFilter-${e.key}`,className:s.field},h().createElement("div",{className:s.wrapper},$,F))}return h().createElement(Gn.Field,{label:Zt("grafana-scenes.variables.ad-hoc-filter-renderer.label-select-label","Select label"),"data-testid":`AdHocFilter-${e.key}`,className:s.field},V)}return h().createElement("div",{className:s.wrapper,"data-testid":`AdHocFilter-${e.key}`},V,$,F,h().createElement(Gn.Button,{variant:"secondary","aria-label":Zt("grafana-scenes.variables.ad-hoc-filter-renderer.aria-label-remove-filter","Remove filter"),title:Zt("grafana-scenes.variables.ad-hoc-filter-renderer.title-remove-filter","Remove filter"),className:s.removeButton,icon:"times","data-testid":`AdHocFilter-remove-${null!=(o=e.key)?o:""}`,onClick:()=>t._removeFilter(e)}))}const _i=e=>({field:(0,Qn.css)({marginBottom:0}),wrapper:(0,Qn.css)({display:"flex","&:first-child":{"> :first-child":{borderBottomLeftRadius:0,borderTopLeftRadius:0}},"> *":{"&:not(:first-child)":{marginLeft:-1},"&:first-child":{borderTopRightRadius:0,borderBottomRightRadius:0},"&:last-child":{borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:first-child):not(:last-child)":{borderRadius:0},position:"relative",zIndex:0,"&:hover":{zIndex:1},"&:focus-within":{zIndex:2}}}),widthWhenOpen:(0,Qn.css)({minWidth:e.spacing(16)}),value:(0,Qn.css)({flexBasis:"content",flexShrink:1,minWidth:"90px"}),key:(0,Qn.css)({flexBasis:"content",minWidth:"90px",flexShrink:1}),operator:(0,Qn.css)({flexShrink:0,flexBasis:"content"}),removeButton:(0,Qn.css)({paddingLeft:e.spacing(1.5),paddingRight:e.spacing(1.5),borderLeft:"none",width:e.spacing(3),marginRight:e.spacing(1),boxSizing:"border-box",position:"relative",left:"1px"})});function Oi({model:e,addFilterButtonText:t}){const{_wip:n}=e.useState(),r=(0,Gn.useStyles2)(ki);return n?h().createElement(Ei,{filter:n,model:e}):h().createElement(Gn.Button,{variant:"secondary",icon:"plus",title:Zt("grafana-scenes.variables.ad-hoc-filter-builder.title-add-filter","Add filter"),"aria-label":Zt("grafana-scenes.variables.ad-hoc-filter-builder.aria-label-add-filter","Add filter"),"data-testid":"AdHocFilter-add",onClick:()=>e._addWip(),className:r.addButton},t)}const ki=e=>({addButton:(0,Qn.css)({"&:first-child":{borderBottomLeftRadius:0,borderTopLeftRadius:0}})});class Ti{constructor(e){this._variable=e}getKey(){return`var-${this._variable.state.name}`}getKeys(){return[this.getKey()]}getUrlState(){const e=this._variable.state.filters,t=this._variable.state.originFilters;let n=[];return 0===e.length&&0===(null==t?void 0:t.length)?{[this.getKey()]:[""]}:(e.length&&n.push(...e.filter(cu).filter((e=>!e.hidden)).map((e=>Ci(e).map(Cu).join("|")))),(null==t?void 0:t.length)&&n.push(...null==t?void 0:t.filter(cu).filter((e=>!e.hidden&&e.origin&&e.restorable)).map((e=>Ci(e).map(Cu).join("|").concat(`#${e.origin}#restorable`)))),{[this.getKey()]:n.length?n:[""]})}updateFromUrl(e){const t=e[this.getKey()];if(null==t)return;const n=function(e){if(Array.isArray(e)){return e.map(Ii).filter(Ri)}const t=Ii(e);return null===t?[]:[t]}(t),r=function(e,t){const n=[...e];for(let r=0;r<t.length;r++){const i=e.findIndex((e=>e.key===t[r].key));i>-1&&t[r].origin===e[i].origin?(uu(t[r])&&(t[r].matchAllFilter=!0),n[i]=t[r]):"dashboard"===t[r].origin?(delete t[r].origin,delete t[r].restorable):-1===i&&"scope"===t[r].origin&&t[r].restorable&&n.push(t[r])}return n}([...this._variable.state.originFilters||[]],n);this._variable.setState({filters:n.filter((e=>!e.origin)),originFilters:r})}}function Ci(e){var t;const n=[Ru(e.key,e.keyLabel),e.operator];return hu(e.operator)?e.values.forEach(((t,r)=>{var i;n.push(Ru(t,null==(i=e.valueLabels)?void 0:i[r]))})):n.push(Ru(e.value,null==(t=e.valueLabels)?void 0:t[0])),n}function Ii(e){if("string"!=typeof e||0===e.length)return null;const[t,n,r]=e.split("#"),[i,a,o,s,...l]=t.split("|").reduce(((e,t)=>{const[n,r]=t.split(",");return e.push(n,null!=r?r:n),e}),[]).map(Iu);return{key:i,keyLabel:a,operator:o,value:l[0],values:hu(o)?l.filter(((e,t)=>t%2==0)):void 0,valueLabels:l.filter(((e,t)=>t%2==1)),condition:"",...(u=n,("scope"===u||"dashboard"===u)&&{origin:n}),...!!r&&{restorable:!0}};var u}function Ri(e){return null!==e&&"string"==typeof e.key&&"string"==typeof e.value}function Ai(){return"undefined"!=typeof window}function Ni(e){return Pi(e)?(e.nodeName||"").toLowerCase():"#document"}function Di(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Li(e){var t;return null==(t=(Pi(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Pi(e){return!!Ai()&&(e instanceof Node||e instanceof Di(e).Node)}function Mi(e){return!!Ai()&&(e instanceof Element||e instanceof Di(e).Element)}function ji(e){return!!Ai()&&(e instanceof HTMLElement||e instanceof Di(e).HTMLElement)}function Fi(e){return!(!Ai()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Di(e).ShadowRoot)}const Vi=new Set(["inline","contents"]);function $i(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ji(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Vi.has(i)}const Bi=new Set(["table","td","th"]);function zi(e){return Bi.has(Ni(e))}const Ui=[":popover-open",":modal"];function qi(e){return Ui.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}const Hi=["transform","translate","scale","rotate","perspective"],Wi=["transform","translate","scale","rotate","perspective","filter"],Gi=["paint","layout","strict","content"];function Ki(e){const t=Qi(),n=Mi(e)?Ji(e):e;return Hi.some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Wi.some((e=>(n.willChange||"").includes(e)))||Gi.some((e=>(n.contain||"").includes(e)))}function Qi(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Yi=new Set(["html","body","#document"]);function Xi(e){return Yi.has(Ni(e))}function Ji(e){return Di(e).getComputedStyle(e)}function Zi(e){return Mi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ea(e){if("html"===Ni(e))return e;const t=e.assignedSlot||e.parentNode||Fi(e)&&e.host||Li(e);return Fi(t)?t.host:t}function ta(e){const t=ea(e);return Xi(t)?e.ownerDocument?e.ownerDocument.body:e.body:ji(t)&&$i(t)?t:ta(t)}function na(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const i=ta(e),a=i===(null==(r=e.ownerDocument)?void 0:r.body),o=Di(i);if(a){const e=ra(o);return t.concat(o,o.visualViewport||[],$i(i)?i:[],e&&n?na(e):[])}return t.concat(i,na(i,[],n))}function ra(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ia(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function aa(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Fi(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function oa(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function sa(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function la(e){return!(0!==e.mozInputSource||!e.isTrusted)||(da()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function ua(e){return!sa().includes("jsdom/")&&(!da()&&0===e.width&&0===e.height||da()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function ca(){return/apple/i.test(navigator.vendor)}function da(){const e=/android/i;return e.test(oa())||e.test(sa())}function ha(e){return(null==e?void 0:e.ownerDocument)||document}function fa(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function pa(e){return"composedPath"in e?e.composedPath()[0]:e.target}const ma="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ga(e){e.preventDefault(),e.stopPropagation()}function va(e){return!!e&&("combobox"===e.getAttribute("role")&&function(e){return ji(e)&&e.matches(ma)}(e))}const ya=Math.min,ba=Math.max,wa=Math.round,Sa=Math.floor,xa=e=>({x:e,y:e}),Ea={left:"right",right:"left",bottom:"top",top:"bottom"},_a={start:"end",end:"start"};function Oa(e,t){return"function"==typeof e?e(t):e}function ka(e){return e.split("-")[0]}function Ta(e){return e.split("-")[1]}function Ca(e){return"y"===e?"height":"width"}const Ia=new Set(["top","bottom"]);function Ra(e){return Ia.has(ka(e))?"y":"x"}function Aa(e){return"x"===Ra(e)?"y":"x"}function Na(e){return e.replace(/start|end/g,(e=>_a[e]))}const Da=["left","right"],La=["right","left"],Pa=["top","bottom"],Ma=["bottom","top"];function ja(e,t,n,r){const i=Ta(e);let a=function(e,t,n){switch(e){case"top":case"bottom":return n?t?La:Da:t?Da:La;case"left":case"right":return t?Pa:Ma;default:return[]}}(ka(e),"start"===n,r);return i&&(a=a.map((e=>e+"-"+i)),t&&(a=a.concat(a.map(Na)))),a}function Fa(e){return e.replace(/left|right|bottom|top/g,(e=>Ea[e]))}function Va(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var $a=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Ba=$a.join(","),za="undefined"==typeof Element,Ua=za?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,qa=!za&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Ha=function e(t,n){var r;void 0===n&&(n=!0);var i=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===i||"true"===i||n&&t&&e(t.parentNode)},Wa=function(e,t,n){if(Ha(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Ba));return t&&Ua.call(e,Ba)&&r.unshift(e),r=r.filter(n)},Ga=function e(t,n,r){for(var i=[],a=Array.from(t);a.length;){var o=a.shift();if(!Ha(o,!1))if("SLOT"===o.tagName){var s=o.assignedElements(),l=e(s.length?s:o.children,!0,r);r.flatten?i.push.apply(i,l):i.push({scopeParent:o,candidates:l})}else{Ua.call(o,Ba)&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var u=o.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(o),c=!Ha(u,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(u&&c){var d=e(!0===u?o.children:u.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:o,candidates:d})}else a.unshift.apply(a,o.children)}}return i},Ka=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Qa=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Ka(e)?0:e.tabIndex},Ya=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Xa=function(e){return"INPUT"===e.tagName},Ja=function(e){return function(e){return Xa(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||qa(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var i=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!i||i===e}(e)},Za=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},eo=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var i=Ua.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Ua.call(i,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Za(e)}else{if("function"==typeof r){for(var a=e;e;){var o=e.parentElement,s=qa(e);if(o&&!o.shadowRoot&&!0===r(o))return Za(e);e=e.assignedSlot?e.assignedSlot:o||s===e.ownerDocument?o:s.host}e=a}if(function(e){var t,n,r,i,a=e&&qa(e),o=null===(t=a)||void 0===t?void 0:t.host,s=!1;if(a&&a!==e)for(s=!!(null!==(n=o)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(o)||null!=e&&null!==(i=e.ownerDocument)&&void 0!==i&&i.contains(e));!s&&o;){var l,u,c;s=!(null===(u=o=null===(l=a=qa(o))||void 0===l?void 0:l.host)||void 0===u||null===(c=u.ownerDocument)||void 0===c||!c.contains(o))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},to=function(e,t){return!(t.disabled||Ha(t)||function(e){return Xa(e)&&"hidden"===e.type}(t)||eo(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Ua.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},no=function(e,t){return!(Ja(t)||Qa(t)<0||!to(e,t))},ro=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},io=function e(t){var n=[],r=[];return t.forEach((function(t,i){var a=!!t.scopeParent,o=a?t.scopeParent:t,s=function(e,t){var n=Qa(e);return n<0&&t&&!Ka(e)?0:n}(o,a),l=a?e(t.candidates):o;0===s?a?n.push.apply(n,l):n.push(o):r.push({documentOrder:i,tabIndex:s,item:t,isScope:a,content:l})})),r.sort(Ya).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},ao=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Ga([e],t.includeContainer,{filter:no.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ro}):Wa(e,t.includeContainer,no.bind(null,t)),io(n)},oo=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Ua.call(e,Ba)&&no(t,e)},so=n(8398);function lo(e,t,n){let{reference:r,floating:i}=e;const a=Ra(t),o=Aa(t),s=Ca(o),l=ka(t),u="y"===a,c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[s]/2-i[s]/2;let f;switch(l){case"top":f={x:c,y:r.y-i.height};break;case"bottom":f={x:c,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-i.width,y:d};break;default:f={x:r.x,y:r.y}}switch(Ta(t)){case"start":f[o]-=h*(n&&u?-1:1);break;case"end":f[o]+=h*(n&&u?-1:1)}return f}async function uo(e,t){var n;void 0===t&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=Oa(t,e),p=function(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}(f),m=s[h?"floating"===d?"reference":"floating":d],g=Va(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(m)))||n?m:m.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),v="floating"===d?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,y=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),b=await(null==a.isElement?void 0:a.isElement(y))&&await(null==a.getScale?void 0:a.getScale(y))||{x:1,y:1},w=Va(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-w.top+p.top)/b.y,bottom:(w.bottom-g.bottom+p.bottom)/b.y,left:(g.left-w.left+p.left)/b.x,right:(w.right-g.right+p.right)/b.x}}const co=new Set(["left","top"]);function ho(e){const t=Ji(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ji(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=wa(n)!==a||wa(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function fo(e){return Mi(e)?e:e.contextElement}function po(e){const t=fo(e);if(!ji(t))return xa(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ho(t);let o=(a?wa(n.width):n.width)/r,s=(a?wa(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}const mo=xa(0);function go(e){const t=Di(e);return Qi()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:mo}function vo(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=e.getBoundingClientRect(),a=fo(e);let o=xa(1);t&&(r?Mi(r)&&(o=po(r)):o=po(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Di(e))&&t}(a,n,r)?go(a):xa(0);let l=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(a){const e=Di(a),t=r&&Mi(r)?Di(r):r;let n=e,i=ra(n);for(;i&&r&&t!==n;){const e=po(i),t=i.getBoundingClientRect(),r=Ji(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,u*=e.y,c*=e.x,d*=e.y,l+=a,u+=o,n=Di(i),i=ra(n)}}return Va({width:c,height:d,x:l,y:u})}function yo(e,t){const n=Zi(e).scrollLeft;return t?t.left+n:vo(Li(e)).left+n}function bo(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-yo(e,n),y:n.top+t.scrollTop}}const wo=25;const So=new Set(["absolute","fixed"]);function xo(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Di(e),r=Li(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const e=Qi();(!e||e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}const u=yo(r);if(u<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=wo&&(a-=o)}else u<=wo&&(a+=u);return{width:a,height:o,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=Li(e),n=Zi(e),r=e.ownerDocument.body,i=ba(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ba(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+yo(e);const s=-n.scrollTop;return"rtl"===Ji(r).direction&&(o+=ba(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}(Li(e));else if(Mi(t))r=function(e,t){const n=vo(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ji(e)?po(e):xa(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}(t,n);else{const n=go(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Va(r)}function Eo(e,t){const n=ea(e);return!(n===t||!Mi(n)||Xi(n))&&("fixed"===Ji(n).position||Eo(n,t))}function _o(e,t,n){const r=ji(t),i=Li(t),a="fixed"===n,o=vo(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=xa(0);function u(){l.x=yo(i)}if(r||!r&&!a)if(("body"!==Ni(t)||$i(i))&&(s=Zi(t)),r){const e=vo(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&u();a&&!r&&i&&u();const c=!i||r||a?xa(0):bo(i,s);return{x:o.left+s.scrollLeft-l.x-c.x,y:o.top+s.scrollTop-l.y-c.y,width:o.width,height:o.height}}function Oo(e){return"static"===Ji(e).position}function ko(e,t){if(!ji(e)||"fixed"===Ji(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Li(e)===n&&(n=n.ownerDocument.body),n}function To(e,t){const n=Di(e);if(qi(e))return n;if(!ji(e)){let t=ea(e);for(;t&&!Xi(t);){if(Mi(t)&&!Oo(t))return t;t=ea(t)}return n}let r=ko(e,t);for(;r&&zi(r)&&Oo(r);)r=ko(r,t);return r&&Xi(r)&&Oo(r)&&!Ki(r)?n:r||function(e){let t=ea(e);for(;ji(t)&&!Xi(t);){if(Ki(t))return t;if(qi(t))return null;t=ea(t)}return null}(e)||n}const Co={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a="fixed"===i,o=Li(r),s=!!t&&qi(t.floating);if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},u=xa(1);const c=xa(0),d=ji(r);if((d||!d&&!a)&&(("body"!==Ni(r)||$i(o))&&(l=Zi(r)),ji(r))){const e=vo(r);u=po(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}const h=!o||d||a?xa(0):bo(o,l);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:n.y*u.y-l.scrollTop*u.y+c.y+h.y}},getDocumentElement:Li,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[..."clippingAncestors"===n?qi(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=na(e,[],!1).filter((e=>Mi(e)&&"body"!==Ni(e))),i=null;const a="fixed"===Ji(e).position;let o=a?ea(e):e;for(;Mi(o)&&!Xi(o);){const t=Ji(o),n=Ki(o);n||"fixed"!==t.position||(i=null),(a?!n&&!i:!n&&"static"===t.position&&i&&So.has(i.position)||$i(o)&&!n&&Eo(e,o))?r=r.filter((e=>e!==o)):i=t,o=ea(o)}return t.set(e,r),r}(t,this._c):[].concat(n),r],o=a[0],s=a.reduce(((e,n)=>{const r=xo(t,n,i);return e.top=ba(r.top,e.top),e.right=ya(r.right,e.right),e.bottom=ya(r.bottom,e.bottom),e.left=ba(r.left,e.left),e}),xo(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:To,getElementRects:async function(e){const t=this.getOffsetParent||To,n=this.getDimensions,r=await n(e.floating);return{reference:_o(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=ho(e);return{width:t,height:n}},getScale:po,isElement:Mi,isRTL:function(e){return"rtl"===Ji(e).direction}};function Io(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ro(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,u=fo(e),c=i||a?[...u?na(u):[],...na(t)]:[];c.forEach((e=>{i&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)}));const d=u&&s?function(e,t){let n,r=null;const i=Li(e);function a(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function o(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const u=e.getBoundingClientRect(),{left:c,top:d,width:h,height:f}=u;if(s||t(),!h||!f)return;const p={rootMargin:-Sa(d)+"px "+-Sa(i.clientWidth-(c+h))+"px "+-Sa(i.clientHeight-(d+f))+"px "+-Sa(c)+"px",threshold:ba(0,ya(1,l))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!m)return o();r?o(!1,r):n=setTimeout((()=>{o(!1,1e-7)}),1e3)}1!==r||Io(u,e.getBoundingClientRect())||o(),m=!1}try{r=new IntersectionObserver(g,{...p,root:i.ownerDocument})}catch(e){r=new IntersectionObserver(g,p)}r.observe(e)}(!0),a}(u,n):null;let h,f=-1,p=null;o&&(p=new ResizeObserver((e=>{let[r]=e;r&&r.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),n()})),u&&!l&&p.observe(u),p.observe(t));let m=l?vo(e):null;return l&&function t(){const r=vo(e);m&&!Io(m,r)&&n();m=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{i&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(h)}}const Ao=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:i}=e,a=await(null==r.isRTL?void 0:r.isRTL(i.floating)),o=ka(n),s=Ta(n),l="y"===Ra(n),u=co.has(o)?-1:1,c=a&&l?-1:1,d=Oa(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof p&&(f="end"===s?-1*p:p),l?{x:f*c,y:h*u}:{x:h*u,y:f*c}}(t,e);return o===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},No=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=Oa(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const v=ka(i),y=Ra(s),b=ka(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(u.floating)),S=h||(b||!m?[Fa(s)]:function(e){const t=Fa(e);return[Na(e),t,Na(t)]}(s)),x="none"!==p;!h&&x&&S.push(...ja(s,m,p,w));const E=[s,...S],_=await uo(t,g),O=[];let k=(null==(r=a.flip)?void 0:r.overflows)||[];if(c&&O.push(_[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Ta(e),i=Aa(e),a=Ca(i);let o="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Fa(o)),[o,Fa(o)]}(i,o,w);O.push(_[e[0]],_[e[1]])}if(k=[...k,{placement:i,overflows:O}],!O.every((e=>e<=0))){var T,C;const e=((null==(T=a.flip)?void 0:T.index)||0)+1,t=E[e];if(t){if(!("alignment"===d&&y!==Ra(t))||k.every((e=>Ra(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:k},reset:{placement:t}}}let n=null==(C=k.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:C.placement;if(!n)switch(f){case"bestFit":{var I;const e=null==(I=k.filter((e=>{if(x){const t=Ra(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:I[0];e&&(n=e);break}case"initialPlacement":n=s}if(i!==n)return{reset:{placement:n}}}return{}}}},Do=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:o,elements:s}=t,{apply:l=()=>{},...u}=Oa(e,t),c=await uo(t,u),d=ka(i),h=Ta(i),f="y"===Ra(i),{width:p,height:m}=a.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=h===(await(null==o.isRTL?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,g="end"===h?"top":"bottom");const y=m-c.top-c.bottom,b=p-c.left-c.right,w=ya(m-c[g],y),S=ya(p-c[v],b),x=!t.middlewareData.shift;let E=w,_=S;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(_=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(E=y),x&&!h){const e=ba(c.left,0),t=ba(c.right,0),n=ba(c.top,0),r=ba(c.bottom,0);f?_=p-2*(0!==e||0!==t?e+t:ba(c.left,c.right)):E=m-2*(0!==n||0!==r?n+r:ba(c.top,c.bottom))}await l({...t,availableWidth:_,availableHeight:E});const O=await o.getDimensions(s.floating);return p!==O.width||m!==O.height?{reset:{rects:!0}}:{}}}},Lo=(e,t,n)=>{const r=new Map,i={platform:Co,...n},a={...i.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=a.filter(Boolean),l=await(null==o.isRTL?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=lo(u,r,l),h=r,f={},p=0;for(let n=0;n<s.length;n++){const{name:a,fn:m}=s[n],{x:g,y:v,data:y,reset:b}=await m({x:c,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:f,rects:u,platform:o,elements:{reference:e,floating:t}});c=null!=g?g:c,d=null!=v?v:d,f={...f,[a]:{...f[a],...y}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(u=!0===b.rects?await o.getElementRects({reference:e,floating:t,strategy:i}):b.rects),({x:c,y:d}=lo(u,h,l))),n=-1)}return{x:c,y:d,placement:h,strategy:i,middlewareData:f}})(e,t,{...i,platform:a})};var Po="undefined"!=typeof document?c.useLayoutEffect:function(){};function Mo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!Mo(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){const n=i[r];if(("_owner"!==n||!e.$$typeof)&&!Mo(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function jo(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Fo(e,t){const n=jo(e);return Math.round(t*n)/n}function Vo(e){const t=c.useRef(e);return Po((()=>{t.current=e})),t}const $o=(e,t)=>({...Ao(e),options:[e,t]}),Bo=(e,t)=>({...No(e),options:[e,t]}),zo=(e,t)=>({...Do(e),options:[e,t]});const Uo={...d},qo=Uo.useInsertionEffect||(e=>e());function Ho(e){const t=c.useRef((()=>{0}));return qo((()=>{t.current=e})),c.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}const Wo="ArrowUp",Go="ArrowDown",Ko="ArrowLeft",Qo="ArrowRight";function Yo(e,t,n){return Math.floor(e/t)!==n}function Xo(e,t){return t<0||t>=e.current.length}function Jo(e,t){return es(e,{disabledIndices:t})}function Zo(e,t){return es(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function es(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:a=1}=void 0===t?{}:t;const o=e.current;let s=n;do{s+=r?-a:a}while(s>=0&&s<=o.length-1&&as(o,s,i));return s}function ts(e,t){let{event:n,orientation:r,loop:i,rtl:a,cols:o,disabledIndices:s,minIndex:l,maxIndex:u,prevIndex:c,stopEvent:d=!1}=t,h=c;if(n.key===Wo){if(d&&ga(n),-1===c)h=u;else if(h=es(e,{startingIndex:h,amount:o,decrement:!0,disabledIndices:s}),i&&(c-o<l||h<0)){const e=c%o,t=u%o,n=u-(t-e);h=t===e?u:t>e?n:n-o}Xo(e,h)&&(h=c)}if(n.key===Go&&(d&&ga(n),-1===c?h=l:(h=es(e,{startingIndex:c,amount:o,disabledIndices:s}),i&&c+o>u&&(h=es(e,{startingIndex:c%o-o,amount:o,disabledIndices:s}))),Xo(e,h)&&(h=c)),"both"===r){const t=Sa(c/o);n.key===(a?Ko:Qo)&&(d&&ga(n),c%o!=o-1?(h=es(e,{startingIndex:c,disabledIndices:s}),i&&Yo(h,o,t)&&(h=es(e,{startingIndex:c-c%o-1,disabledIndices:s}))):i&&(h=es(e,{startingIndex:c-c%o-1,disabledIndices:s})),Yo(h,o,t)&&(h=c)),n.key===(a?Qo:Ko)&&(d&&ga(n),c%o!=0?(h=es(e,{startingIndex:c,decrement:!0,disabledIndices:s}),i&&Yo(h,o,t)&&(h=es(e,{startingIndex:c+(o-c%o),decrement:!0,disabledIndices:s}))):i&&(h=es(e,{startingIndex:c+(o-c%o),decrement:!0,disabledIndices:s})),Yo(h,o,t)&&(h=c));const r=Sa(u/o)===t;Xo(e,h)&&(h=i&&r?n.key===(a?Qo:Ko)?u:es(e,{startingIndex:c-c%o-1,disabledIndices:s}):c)}return h}function ns(e,t,n){const r=[];let i=0;return e.forEach(((e,a)=>{let{width:o,height:s}=e,l=!1;for(n&&(i=0);!l;){const e=[];for(let n=0;n<o;n++)for(let r=0;r<s;r++)e.push(i+n+r*t);i%t+o<=t&&e.every((e=>null==r[e]))?(e.forEach((e=>{r[e]=a})),l=!0):i++}})),[...r]}function rs(e,t,n,r,i){if(-1===e)return-1;const a=n.indexOf(e),o=t[e];switch(i){case"tl":return a;case"tr":return o?a+o.width-1:a;case"bl":return o?a+(o.height-1)*r:a;case"br":return n.lastIndexOf(e)}}function is(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function as(e,t,n){if(n)return n.includes(t);const r=e[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}var os="undefined"!=typeof document?c.useLayoutEffect:c.useEffect;const ss=[Ko,Qo],ls=[Wo,Go];function us(){return us=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},us.apply(this,arguments)}let cs=!1,ds=0;const hs=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ds++;const fs=Uo.useId||function(){const[e,t]=c.useState((()=>cs?hs():void 0));return os((()=>{null==e&&t(hs())}),[]),c.useEffect((()=>{cs=!0}),[]),e};function ps(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}const ms=c.createContext(null),gs=c.createContext(null),vs=()=>{var e;return(null==(e=c.useContext(ms))?void 0:e.id)||null},ys=()=>c.useContext(gs);function bs(e){return"data-floating-ui-"+e}function ws(e){const t=(0,c.useRef)(e);return os((()=>{t.current=e})),t}let Ss=0;function xs(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Ss);const a=()=>null==e?void 0:e.focus({preventScroll:n});i?a():Ss=requestAnimationFrame(a)}function Es(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let _s=new WeakMap,Os=new WeakSet,ks={},Ts=0;const Cs=e=>e&&(e.host||Cs(e.parentNode)),Is=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=Cs(t);return e.contains(n)?n:null})).filter((e=>null!=e));function Rs(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=ha(e[0]).body;return function(e,t,n,r){const i="data-floating-ui-inert",a=r?"inert":n?"aria-hidden":null,o=Is(t,e),s=new Set,l=new Set(o),u=[];ks[i]||(ks[i]=new WeakMap);const c=ks[i];return o.forEach((function e(t){t&&!s.has(t)&&(s.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!l.has(t)&&[].forEach.call(t.children,(t=>{if("script"!==Ni(t))if(s.has(t))e(t);else{const e=a?t.getAttribute(a):null,n=null!==e&&"false"!==e,r=(_s.get(t)||0)+1,o=(c.get(t)||0)+1;_s.set(t,r),c.set(t,o),u.push(t),1===r&&n&&Os.add(t),1===o&&t.setAttribute(i,""),!n&&a&&t.setAttribute(a,"true")}}))}(t),s.clear(),Ts++,()=>{u.forEach((e=>{const t=(_s.get(e)||0)-1,n=(c.get(e)||0)-1;_s.set(e,t),c.set(e,n),t||(!Os.has(e)&&a&&e.removeAttribute(a),Os.delete(e)),n||e.removeAttribute(i)})),Ts--,Ts||(_s=new WeakMap,_s=new WeakMap,Os=new WeakSet,ks={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const As=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Ns(e,t){const n=ao(e,As());"prev"===t&&n.reverse();const r=n.indexOf(ia(ha(e)));return n.slice(r+1)[0]}function Ds(){return Ns(document.body,"next")}function Ls(){return Ns(document.body,"prev")}function Ps(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!aa(n,r)}function Ms(e){ao(e,As()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function js(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const Fs={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Vs(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const $s=c.forwardRef((function(e,t){const[n,r]=c.useState();os((()=>(ca()&&r("button"),document.addEventListener("keydown",Vs),()=>{document.removeEventListener("keydown",Vs)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[bs("focus-guard")]:"",style:Fs};return c.createElement("span",us({},e,i))})),Bs=c.createContext(null),zs=bs("portal");function Us(e){const{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,a=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=fs(),i=qs(),[a,o]=c.useState(null),s=c.useRef(null);return os((()=>()=>{null==a||a.remove(),queueMicrotask((()=>{s.current=null}))}),[a]),os((()=>{if(!r)return;if(s.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(zs,""),e.appendChild(n),s.current=n,o(n)}),[t,r]),os((()=>{if(null===n)return;if(!r)return;if(s.current)return;let e=n||(null==i?void 0:i.portalNode);e&&!Mi(e)&&(e=e.current),e=e||document.body;let a=null;t&&(a=document.createElement("div"),a.id=t,e.appendChild(a));const l=document.createElement("div");l.id=r,l.setAttribute(zs,""),e=a||e,e.appendChild(l),s.current=l,o(l)}),[t,n,r,i]),a}({id:n,root:r}),[o,s]=c.useState(null),l=c.useRef(null),u=c.useRef(null),d=c.useRef(null),h=c.useRef(null),f=null==o?void 0:o.modal,p=null==o?void 0:o.open,m=!!o&&!o.modal&&o.open&&i&&!(!r&&!a);return c.useEffect((()=>{if(a&&i&&!f)return a.addEventListener("focusin",e,!0),a.addEventListener("focusout",e,!0),()=>{a.removeEventListener("focusin",e,!0),a.removeEventListener("focusout",e,!0)};function e(e){if(a&&Ps(e)){("focusin"===e.type?js:Ms)(a)}}}),[a,i,f]),c.useEffect((()=>{a&&(p||js(a))}),[p,a]),c.createElement(Bs.Provider,{value:c.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:h,portalNode:a,setFocusManagerState:s})),[i,a])},m&&a&&c.createElement($s,{"data-type":"outside",ref:l,onFocus:e=>{if(Ps(e,a)){var t;null==(t=d.current)||t.focus()}else{const e=Ls()||(null==o?void 0:o.refs.domReference.current);null==e||e.focus()}}}),m&&a&&c.createElement("span",{"aria-owns":a.id,style:Fs}),a&&so.createPortal(t,a),m&&a&&c.createElement($s,{"data-type":"outside",ref:u,onFocus:e=>{if(Ps(e,a)){var t;null==(t=h.current)||t.focus()}else{const t=Ds()||(null==o?void 0:o.refs.domReference.current);null==t||t.focus(),(null==o?void 0:o.closeOnFocusOut)&&(null==o||o.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const qs=()=>c.useContext(Bs),Hs="data-floating-ui-focusable";function Ws(e){return e?e.hasAttribute(Hs)?e:e.querySelector("["+Hs+"]")||e:null}const Gs=20;let Ks=[];function Qs(e){Ks=Ks.filter((e=>e.isConnected));let t=e;if(t&&"body"!==Ni(t)){if(!oo(t,As())){const e=ao(t,As())[0];e&&(t=e)}Ks.push(t),Ks.length>Gs&&(Ks=Ks.slice(-Gs))}}function Ys(){return Ks.slice().reverse().find((e=>e.isConnected))}const Xs=c.forwardRef((function(e,t){return c.createElement("button",us({},e,{type:"button",ref:t,tabIndex:-1,style:Fs}))}));function Js(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:a=!0,initialFocus:o=0,returnFocus:s=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:h=!0}=e,{open:f,refs:p,nodeId:m,onOpenChange:g,events:v,dataRef:y,floatingId:b,elements:{domReference:w,floating:S}}=t,x="number"==typeof o&&o<0,E=va(w)&&x,_="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||a,O=ws(i),k=ws(o),T=ws(s),C=ys(),I=qs(),R=c.useRef(null),A=c.useRef(null),N=c.useRef(!1),D=c.useRef(!1),L=c.useRef(-1),P=null!=I,M=Ws(S),j=Ho((function(e){return void 0===e&&(e=M),e?ao(e,As()):[]})),F=Ho((e=>{const t=j(e);return O.current.map((e=>w&&"reference"===e?w:M&&"floating"===e?M:t)).filter(Boolean).flat()}));function V(e){return!r&&d&&u?c.createElement(Xs,{ref:"start"===e?R:A,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}c.useEffect((()=>{if(r)return;if(!u)return;function e(e){if("Tab"===e.key){aa(M,ia(ha(M)))&&0===j().length&&!E&&ga(e);const t=F(),n=pa(e);"reference"===O.current[0]&&n===w&&(ga(e),e.shiftKey?xs(t[t.length-1]):xs(t[1])),"floating"===O.current[1]&&n===M&&e.shiftKey&&(ga(e),xs(t[0]))}}const t=ha(M);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,w,M,u,O,E,j,F]),c.useEffect((()=>{if(!r&&S)return S.addEventListener("focusin",e),()=>{S.removeEventListener("focusin",e)};function e(e){const t=pa(e),n=j().indexOf(t);-1!==n&&(L.current=n)}}),[r,S,j]),c.useEffect((()=>{if(!r&&h)return S&&ji(w)?(w.addEventListener("focusout",t),w.addEventListener("pointerdown",e),S.addEventListener("focusout",t),()=>{w.removeEventListener("focusout",t),w.removeEventListener("pointerdown",e),S.removeEventListener("focusout",t)}):void 0;function e(){D.current=!0,setTimeout((()=>{D.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(aa(w,t)||aa(S,t)||aa(t,S)||aa(null==I?void 0:I.portalNode,t)||null!=t&&t.hasAttribute(bs("focus-guard"))||C&&(Es(C.nodesRef.current,m).find((e=>{var n,r;return aa(null==(n=e.context)?void 0:n.elements.floating,t)||aa(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],i=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;i;){const t=e.find((e=>e.id===i));i=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(C.nodesRef.current,m).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));if(l&&n&&ia(ha(M))===ha(M).body){ji(M)&&M.focus();const e=L.current,t=j(),n=t[e]||t[t.length-1]||M;ji(n)&&n.focus()}!E&&u||!t||!n||D.current||t===Ys()||(N.current=!0,g(!1,e,"focus-out"))}))}}),[r,w,S,M,u,m,C,I,g,h,l,j,E]),c.useEffect((()=>{var e;if(r)return;const t=Array.from((null==I||null==(e=I.portalNode)?void 0:e.querySelectorAll("["+bs("portal")+"]"))||[]);if(S){const e=[S,...t,R.current,A.current,O.current.includes("reference")||E?w:null].filter((e=>null!=e)),n=u||E?Rs(e,_,!_):Rs(e);return()=>{n()}}}),[r,w,S,u,O,I,E,_]),os((()=>{if(r||!ji(M))return;const e=ia(ha(M));queueMicrotask((()=>{const t=F(M),n=k.current,r=("number"==typeof n?t[n]:n.current)||M,i=aa(M,e);x||i||!f||xs(r,{preventScroll:r===M})}))}),[r,f,M,x,F,k]),os((()=>{if(r||!M)return;let e=!1;const t=ha(M),n=ia(t);let i=y.current.openEvent;function a(t){let{open:n,reason:r,event:a,nested:o}=t;n&&(i=a),"escape-key"===r&&p.domReference.current&&Qs(p.domReference.current),"hover"===r&&"mouseleave"===a.type&&(N.current=!0),"outside-press"===r&&(o?(N.current=!1,e=!0):N.current=!(la(a)||ua(a)))}Qs(n),v.on("openchange",a);const o=t.createElement("span");return o.setAttribute("tabindex","-1"),o.setAttribute("aria-hidden","true"),Object.assign(o.style,Fs),P&&w&&w.insertAdjacentElement("afterend",o),()=>{v.off("openchange",a);const n=ia(t),r=aa(S,n)||C&&Es(C.nodesRef.current,m).some((e=>{var t;return aa(null==(t=e.context)?void 0:t.elements.floating,n)}));(r||i&&["click","mousedown"].includes(i.type))&&p.domReference.current&&Qs(p.domReference.current);const s="boolean"==typeof T.current?Ys()||o:T.current.current||o;queueMicrotask((()=>{T.current&&!N.current&&ji(s)&&(s===n||n===t.body||r)&&s.focus({preventScroll:e}),o.remove()}))}}),[r,S,M,T,y,p,v,C,m,P,w]),c.useEffect((()=>{queueMicrotask((()=>{N.current=!1}))}),[r]),os((()=>{if(!r&&I)return I.setFocusManagerState({modal:u,closeOnFocusOut:h,open:f,onOpenChange:g,refs:p}),()=>{I.setFocusManagerState(null)}}),[r,I,u,f,g,p,h]),os((()=>{if(r)return;if(!M)return;if("function"!=typeof MutationObserver)return;if(x)return;const e=()=>{const e=M.getAttribute("tabindex"),t=j(),n=ia(ha(S)),r=t.indexOf(n);-1!==r&&(L.current=r),O.current.includes("floating")||n!==p.domReference.current&&0===t.length?"0"!==e&&M.setAttribute("tabindex","0"):"-1"!==e&&M.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(M,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[r,S,M,p,O,j,x]);const $=!r&&_&&(!u||!E)&&(P||u);return c.createElement(c.Fragment,null,$&&c.createElement($s,{"data-type":"inside",ref:null==I?void 0:I.beforeInsideRef,onFocus:e=>{if(u){const e=F();xs("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=I&&I.preserveTabOrder&&I.portalNode)if(N.current=!1,Ps(e,I.portalNode)){const e=Ds()||w;null==e||e.focus()}else{var t;null==(t=I.beforeOutsideRef.current)||t.focus()}}}),!E&&V("start"),n,V("end"),$&&c.createElement($s,{"data-type":"inside",ref:null==I?void 0:I.afterInsideRef,onFocus:e=>{if(u)xs(F()[0]);else if(null!=I&&I.preserveTabOrder&&I.portalNode)if(h&&(N.current=!0),Ps(e,I.portalNode)){const e=Ls()||w;null==e||e.focus()}else{var t;null==(t=I.afterOutsideRef.current)||t.focus()}}}))}const Zs={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},el={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},tl=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function nl(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=fs(),a=c.useRef({}),[o]=c.useState((()=>ps())),s=null!=vs(),[l,u]=c.useState(r.reference),d=Ho(((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit("openchange",{open:e,event:t,reason:r,nested:s}),null==n||n(e,t,r)})),h=c.useMemo((()=>({setPositionReference:u})),[]),f=c.useMemo((()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference})),[l,r.reference,r.floating]);return c.useMemo((()=>({dataRef:a,open:t,onOpenChange:d,elements:f,events:o,floatingId:i,refs:h})),[t,d,f,o,i,h])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=c.useState(null),[s,l]=c.useState(null),u=(null==i?void 0:i.domReference)||a,d=c.useRef(null),h=ys();os((()=>{u&&(d.current=u)}),[u]);const f=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[d,h]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=c.useState(r);Mo(f,r)||p(r);const[m,g]=c.useState(null),[v,y]=c.useState(null),b=c.useCallback((e=>{e!==E.current&&(E.current=e,g(e))}),[]),w=c.useCallback((e=>{e!==_.current&&(_.current=e,y(e))}),[]),S=a||m,x=o||v,E=c.useRef(null),_=c.useRef(null),O=c.useRef(d),k=null!=l,T=Vo(l),C=Vo(i),I=Vo(u),R=c.useCallback((()=>{if(!E.current||!_.current)return;const e={placement:t,strategy:n,middleware:f};C.current&&(e.platform=C.current),Lo(E.current,_.current,e).then((e=>{const t={...e,isPositioned:!1!==I.current};A.current&&!Mo(O.current,t)&&(O.current=t,so.flushSync((()=>{h(t)})))}))}),[f,t,n,C,I]);Po((()=>{!1===u&&O.current.isPositioned&&(O.current.isPositioned=!1,h((e=>({...e,isPositioned:!1}))))}),[u]);const A=c.useRef(!1);Po((()=>(A.current=!0,()=>{A.current=!1})),[]),Po((()=>{if(S&&(E.current=S),x&&(_.current=x),S&&x){if(T.current)return T.current(S,x,R);R()}}),[S,x,R,T,k]);const N=c.useMemo((()=>({reference:E,floating:_,setReference:b,setFloating:w})),[b,w]),D=c.useMemo((()=>({reference:S,floating:x})),[S,x]),L=c.useMemo((()=>{const e={position:n,left:0,top:0};if(!D.floating)return e;const t=Fo(D.floating,d.x),r=Fo(D.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...jo(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,s,D.floating,d.x,d.y]);return c.useMemo((()=>({...d,update:R,refs:N,elements:D,floatingStyles:L})),[d,R,N,D,L])}({...e,elements:{...i,...s&&{reference:s}}}),p=c.useCallback((e=>{const t=Mi(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l(t),f.refs.setReference(t)}),[f.refs]),m=c.useCallback((e=>{(Mi(e)||null===e)&&(d.current=e,o(e)),(Mi(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!Mi(e))&&f.refs.setReference(e)}),[f.refs]),g=c.useMemo((()=>({...f.refs,setReference:m,setPositionReference:p,domReference:d})),[f.refs,m,p]),v=c.useMemo((()=>({...f.elements,domReference:u})),[f.elements,u]),y=c.useMemo((()=>({...f,...r,refs:g,elements:v,nodeId:t})),[f,g,v,t,r]);return os((()=>{r.dataRef.current.floatingContext=y;const e=null==h?void 0:h.nodesRef.current.find((e=>e.id===t));e&&(e.context=y)})),c.useMemo((()=>({...f,context:y,refs:g,elements:v})),[f,g,v,y])}const rl="active",il="selected";function al(e,t,n){const r=new Map,i="item"===n;let a=e;if(i&&e){const{[rl]:t,[il]:n,...r}=e;a=r}return{..."floating"===n&&{tabIndex:-1,[Hs]:""},...a,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,a]=t;var o;i&&[rl,il].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof a&&(null==(o=r.get(n))||o.push(a),e[n]=function(){for(var e,t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];return null==(e=r.get(n))?void 0:e.map((e=>e(...i))).find((e=>void 0!==e))})):e[n]=a)})),e):e),{})}}let ol=!1;function sl(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function ll(e,t){return sl(t,e===Wo||e===Go,e===Ko||e===Qo)}function ul(e,t,n){return sl(t,e===Go,n?e===Ko:e===Qo)||"Enter"===e||" "===e||""===e}function cl(e,t,n){return sl(t,n?e===Qo:e===Ko,e===Wo)}function dl(e,t){const{open:n,onOpenChange:r,elements:i}=e,{listRef:a,activeIndex:o,onNavigate:s=()=>{},enabled:l=!0,selectedIndex:u=null,allowEscape:d=!1,loop:h=!1,nested:f=!1,rtl:p=!1,virtual:m=!1,focusItemOnOpen:g="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:y=!0,disabledIndices:b,orientation:w="vertical",cols:S=1,scrollItemIntoView:x=!0,virtualItemRef:E,itemSizes:_,dense:O=!1}=t;const k=ws(Ws(i.floating)),T=vs(),C=ys(),I=Ho(s),R=va(i.domReference),A=c.useRef(g),N=c.useRef(null!=u?u:-1),D=c.useRef(null),L=c.useRef(!0),P=c.useRef(I),M=c.useRef(!!i.floating),j=c.useRef(n),F=c.useRef(!1),V=c.useRef(!1),$=ws(b),B=ws(n),z=ws(x),U=ws(u),[q,H]=c.useState(),[W,G]=c.useState(),K=Ho((function(e,t,n){function r(e){m?(H(e.id),null==C||C.events.emit("virtualfocus",e),E&&(E.current=e)):xs(e,{preventScroll:!0,sync:!(!oa().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!ca())&&(ol||F.current)})}void 0===n&&(n=!1);const i=e.current[t.current];i&&r(i),requestAnimationFrame((()=>{const a=e.current[t.current]||i;if(!a)return;i||r(a);const o=z.current;o&&Y&&(n||!L.current)&&(null==a.scrollIntoView||a.scrollIntoView("boolean"==typeof o?{block:"nearest",inline:"nearest"}:o))}))}));os((()=>{document.createElement("div").focus({get preventScroll(){return ol=!0,!1}})}),[]),os((()=>{l&&(n&&i.floating?A.current&&null!=u&&(V.current=!0,N.current=u,I(u)):M.current&&(N.current=-1,P.current(null)))}),[l,n,i.floating,u,I]),os((()=>{if(l&&n&&i.floating)if(null==o){if(F.current=!1,null!=U.current)return;if(M.current&&(N.current=-1,K(a,N)),(!j.current||!M.current)&&A.current&&(null!=D.current||!0===A.current&&null==D.current)){let e=0;const t=()=>{if(null==a.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else N.current=null==D.current||ul(D.current,w,p)||f?Jo(a,$.current):Zo(a,$.current),D.current=null,I(N.current)};t()}}else Xo(a,o)||(N.current=o,K(a,N,V.current),V.current=!1)}),[l,n,i.floating,o,U,f,a,w,p,I,K,$]),os((()=>{var e;if(!l||i.floating||!C||m||!M.current)return;const t=C.nodesRef.current,n=null==(e=t.find((e=>e.id===T)))||null==(e=e.context)?void 0:e.elements.floating,r=ia(ha(i.floating)),a=t.some((e=>e.context&&aa(e.context.elements.floating,r)));n&&!a&&L.current&&n.focus({preventScroll:!0})}),[l,i.floating,C,T,m]),os((()=>{if(l&&C&&m&&!T)return C.events.on("virtualfocus",e),()=>{C.events.off("virtualfocus",e)};function e(e){G(e.id),E&&(E.current=e)}}),[l,C,m,T,E]),os((()=>{P.current=I,M.current=!!i.floating})),os((()=>{n||(D.current=null)}),[n]),os((()=>{j.current=n}),[n]);const Q=null!=o,Y=c.useMemo((()=>{function e(e){if(!n)return;const t=a.current.indexOf(e);-1!==t&&I(t)}const t={onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...v&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;L.current&&"touch"!==t&&(N.current=-1,K(a,N),I(null),m||xs(k.current,{preventScroll:!0}))}}};return t}),[n,k,K,v,a,I,m]),X=Ho((e=>{if(L.current=!1,F.current=!0,229===e.which)return;if(!B.current&&e.currentTarget===k.current)return;if(f&&cl(e.key,w,p))return ga(e),r(!1,e.nativeEvent,"list-navigation"),void(ji(i.domReference)&&(m?null==C||C.events.emit("virtualfocus",i.domReference):i.domReference.focus()));const t=N.current,o=Jo(a,b),s=Zo(a,b);if(R||("Home"===e.key&&(ga(e),N.current=o,I(N.current)),"End"===e.key&&(ga(e),N.current=s,I(N.current))),S>1){const t=_||Array.from({length:a.current.length},(()=>({width:1,height:1}))),n=ns(t,S,O),r=n.findIndex((e=>null!=e&&!as(a.current,e,b))),i=n.reduce(((e,t,n)=>null==t||as(a.current,t,b)?e:n),-1),l=n[ts({current:n.map((e=>null!=e?a.current[e]:null))},{event:e,orientation:w,loop:h,rtl:p,cols:S,disabledIndices:is([...b||a.current.map(((e,t)=>as(a.current,t)?t:void 0)),void 0],n),minIndex:r,maxIndex:i,prevIndex:rs(N.current>s?o:N.current,t,n,S,e.key===Go?"bl":e.key===(p?Ko:Qo)?"tr":"tl"),stopEvent:!0})];if(null!=l&&(N.current=l,I(N.current)),"both"===w)return}if(ll(e.key,w)){if(ga(e),n&&!m&&ia(e.currentTarget.ownerDocument)===e.currentTarget)return N.current=ul(e.key,w,p)?o:s,void I(N.current);ul(e.key,w,p)?N.current=h?t>=s?d&&t!==a.current.length?-1:o:es(a,{startingIndex:t,disabledIndices:b}):Math.min(s,es(a,{startingIndex:t,disabledIndices:b})):N.current=h?t<=o?d&&-1!==t?a.current.length:s:es(a,{startingIndex:t,decrement:!0,disabledIndices:b}):Math.max(o,es(a,{startingIndex:t,decrement:!0,disabledIndices:b})),Xo(a,N.current)?I(null):I(N.current)}})),J=c.useMemo((()=>m&&n&&Q&&{"aria-activedescendant":W||q}),[m,n,Q,W,q]),Z=c.useMemo((()=>({"aria-orientation":"both"===w?void 0:w,...!va(i.domReference)&&J,onKeyDown:X,onPointerMove(){L.current=!0}})),[J,X,i.domReference,w]),ee=c.useMemo((()=>{function e(e){"auto"===g&&la(e.nativeEvent)&&(A.current=!0)}return{...J,onKeyDown(e){L.current=!1;const t=e.key.startsWith("Arrow"),i=["Home","End"].includes(e.key),o=t||i,s=function(e,t,n){return sl(t,n?e===Ko:e===Qo,e===Go)}(e.key,w,p),l=cl(e.key,w,p),c=ll(e.key,w),d=(f?s:c)||"Enter"===e.key||""===e.key.trim();if(m&&n){const t=null==C?void 0:C.nodesRef.current.find((e=>null==e.parentId)),n=C&&t?function(e,t){let n,r=-1;return function t(i,a){a>r&&(n=i,r=a),Es(e,i).forEach((e=>{t(e.id,a+1)}))}(t,0),e.find((e=>e.id===n))}(C.nodesRef.current,t.id):null;if(o&&n&&E){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(s||l){var h,g;const r=(null==(h=n.context)?void 0:h.elements.domReference)===e.currentTarget,i=l&&!r?null==(g=n.context)?void 0:g.elements.domReference:s?a.current.find((e=>(null==e?void 0:e.id)===q)):null;i&&(ga(e),i.dispatchEvent(t),G(void 0))}var v;if((c||i)&&n.context)if(n.context.open&&n.parentId&&e.currentTarget!==n.context.elements.domReference)return ga(e),void(null==(v=n.context.elements.domReference)||v.dispatchEvent(t))}return X(e)}(n||y||!t)&&(d&&(D.current=f&&c?null:e.key),f?s&&(ga(e),n?(N.current=Jo(a,$.current),I(N.current)):r(!0,e.nativeEvent,"list-navigation")):c&&(null!=u&&(N.current=u),ga(e),!n&&y?r(!0,e.nativeEvent,"list-navigation"):X(e),n&&I(N.current)))},onFocus(){n&&!m&&I(null)},onPointerDown:function(e){A.current=g,"auto"===g&&ua(e.nativeEvent)&&(A.current=!0)},onMouseDown:e,onClick:e}}),[q,J,X,$,g,a,f,I,r,n,y,w,p,u,C,m,E]);return c.useMemo((()=>l?{reference:ee,floating:Z,item:Y}:{}),[l,ee,Z,Y])}const hl=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function fl(e,t,n){let r,i=n.initialDeps??[];function a(){var a,o,s,l;let u;n.key&&(null==(a=n.debug)?void 0:a.call(n))&&(u=Date.now());const c=e(),d=c.length!==i.length||c.some(((e,t)=>i[t]!==e));if(!d)return r;let h;if(i=c,n.key&&(null==(o=n.debug)?void 0:o.call(n))&&(h=Date.now()),r=t(...c),n.key&&(null==(s=n.debug)?void 0:s.call(n))){Math.round(100*(Date.now()-u)),Math.round(100*(Date.now()-h))}return null==(l=null==n?void 0:n.onChange)||l.call(n,r),r}return a.updateDeps=e=>{i=e},a}function pl(e,t){if(void 0===e)throw new Error("Unexpected undefined"+(t?`: ${t}`:""));return e}const ml=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout((()=>t.apply(this,i)),n)}},gl=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},vl=e=>e,yl=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},bl=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=e=>{const{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(gl(n)),!r.ResizeObserver)return()=>{};const a=new r.ResizeObserver((t=>{const r=()=>{const e=t[0];if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0];if(t)return void i({width:t.inlineSize,height:t.blockSize})}i(gl(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()}));return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},wl={passive:!0},Sl="undefined"==typeof window||"onscrollend"in window,xl=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const a=e.options.useScrollendEvent&&Sl?()=>{}:ml(r,(()=>{t(i,!1)}),e.options.isScrollingResetDelay),o=r=>()=>{const{horizontal:o,isRtl:s}=e.options;i=o?n.scrollLeft*(s?-1:1):n.scrollTop,a(),t(i,r)},s=o(!0),l=o(!1);l(),n.addEventListener("scroll",s,wl);const u=e.options.useScrollendEvent&&Sl;return u&&n.addEventListener("scrollend",l,wl),()=>{n.removeEventListener("scroll",s),u&&n.removeEventListener("scrollend",l)}},El=(e,t,n)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e){return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},_l=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;const o=e+t;null==(a=null==(i=r.scrollElement)?void 0:i.scrollTo)||a.call(i,{[r.options.horizontal?"left":"top"]:o,behavior:n})};class Ol{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,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 e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver((e=>{e.forEach((e=>{const t=()=>{this._measureElement(e.target,e)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()}))})):null);return{disconnect:()=>{var n;null==(n=t())||n.disconnect(),e=null},observe:e=>{var n;return null==(n=t())?void 0:n.observe(e,{box:"border-box"})},unobserve:e=>{var n;return null==(n=t())?void 0:n.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach((([t,n])=>{void 0===n&&delete e[t]})),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:vl,rangeExtractor:yl,onChange:()=>{},measureElement:El,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,n;null==(n=(t=this.options).onChange)||n.call(t,this,e)},this.maybeNotify=fl((()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null])),(e=>{this.notify(e)}),{key:!1,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((e=>e())),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach((e=>{this.observer.observe(e)})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,(e=>{this.scrollRect=e,this.maybeNotify()}))),this.unsubs.push(this.options.observeElementOffset(this,((e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,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??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{const n=new Map,r=new Map;for(let i=t-1;i>=0;i--){const t=e[i];if(n.has(t.lane))continue;const a=r.get(t.lane);if(null==a||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort(((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end))[0]:void 0},this.getMeasurementOptions=fl((()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled]),((e,t,n,r,i)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i})),{key:!1}),this.getMeasurements=fl((()=>[this.getMeasurementOptions(),this.itemSizeCache]),(({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i},a)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];0===this.measurementsCache.length&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach((e=>{this.itemSizeCache.set(e.key,e.size)})));const o=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const s=this.measurementsCache.slice(0,o);for(let i=o;i<e;i++){const e=r(i),o=1===this.options.lanes?s[i-1]:this.getFurthestMeasurement(s,i),l=o?o.end+this.options.gap:t+n,u=a.get(e),c="number"==typeof u?u:this.options.estimateSize(i),d=l+c,h=o?o.lane:i%this.options.lanes;s[i]={index:i,start:l,size:c,end:d,key:e,lane:h}}return this.measurementsCache=s,s}),{key:!1,debug:()=>this.options.debug}),this.calculateRange=fl((()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes]),((e,t,n,r)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const i=e.length-1,a=t=>e[t].start;if(e.length<=r)return{startIndex:0,endIndex:i};let o=kl(0,i,a,n),s=o;if(1===r)for(;s<i&&e[s].end<n+t;)s++;else if(r>1){const a=Array(r).fill(0);for(;s<i&&a.some((e=>e<n+t));){const t=e[s];a[t.lane]=t.end,s++}const l=Array(r).fill(n+t);for(;o>=0&&l.some((e=>e>=n));){const t=e[o];l[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(i,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}({measurements:e,outerSize:t,scrollOffset:n,lanes:r}):null),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=fl((()=>{let e=null,t=null;const n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]}),((e,t,n,r,i)=>null===r||null===i?[]:e({startIndex:r,endIndex:i,overscan:t,count:n})),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{const n=this.indexFromElement(e),r=this.measurementsCache[n];if(!r)return;const i=r.key,a=this.elementsCache.get(i);a!==e&&(a&&this.observer.unobserve(a),this.observer.observe(e),this.elementsCache.set(i,e)),e.isConnected&&this.resizeItem(n,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{const n=this.measurementsCache[e];if(!n)return;const r=t-(this.itemSizeCache.get(n.key)??n.size);0!==r&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(n,r,this):n.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.measureElement=e=>{e?this._measureElement(e,void 0):this.elementsCache.forEach(((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))}))},this.getVirtualItems=fl((()=>[this.getVirtualIndexes(),this.getMeasurements()]),((e,t)=>{const n=[];for(let r=0,i=e.length;r<i;r++){const i=t[e[r]];n.push(i)}return n}),{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return pl(t[kl(0,t.length-1,(e=>pl(t[e]).start),e)])},this.getOffsetForAlignment=(e,t,n=0)=>{const r=this.getSize(),i=this.getScrollOffset();"auto"===t&&(t=e>=i+r?"end":"start"),"center"===t?e+=(n-r)/2:"end"===t&&(e-=r);const a=this.getTotalSize()+this.options.scrollMargin-r;return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.measurementsCache[e];if(!n)return;const r=this.getSize(),i=this.getScrollOffset();if("auto"===t)if(n.end>=i+r-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=i+this.options.scrollPaddingStart))return[i,t];t="start"}const a="end"===t?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,n.size),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:t="start",behavior:n}={})=>{"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:n})},this.scrollToIndex=(e,{align:t="auto",behavior:n}={})=>{"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1));let r=0;const i=t=>{if(!this.targetWindow)return;const r=this.getOffsetForIndex(e,t);if(!r)return void console.warn("Failed to get offset for index:",e);const[i,o]=r;this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.targetWindow.requestAnimationFrame((()=>{const t=this.getScrollOffset(),n=this.getOffsetForIndex(e,o);n?((e,t)=>Math.abs(e-t)<1.01)(n[0],t)||a(o):console.warn("Failed to get offset for index:",e)}))},a=t=>{this.targetWindow&&(r++,r<10?this.targetWindow.requestAnimationFrame((()=>i(t))):console.warn(`Failed to scroll to index ${e} after 10 attempts.`))};i(t)},this.scrollBy=(e,{behavior:t}={})=>{"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let n;if(0===t.length)n=this.options.paddingStart;else if(1===this.options.lanes)n=(null==(e=t[t.length-1])?void 0:e.end)??0;else{const e=Array(this.options.lanes).fill(null);let r=t.length-1;for(;r>=0&&e.some((e=>null===e));){const n=t[r];null===e[n.lane]&&(e[n.lane]=n.end),r--}n=Math.max(...e.filter((e=>null!==e)))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const kl=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else{if(!(a>r))return i;t=i-1}}return e>0?e-1:0};const Tl="undefined"!=typeof document?c.useLayoutEffect:c.useEffect;function Cl(e){const t=c.useReducer((()=>({})),{})[1],n={...e,onChange:(n,r)=>{var i;r?(0,so.flushSync)(t):t(),null==(i=e.onChange)||i.call(e,n,r)}},[r]=c.useState((()=>new Ol(n)));return r.setOptions(n),Tl((()=>r._didMount()),[]),Tl((()=>r._willUpdate())),r}const Il=(0,c.forwardRef)((function({children:e,active:t,addGroupBottomBorder:n,isMultiValueEdit:r,checked:i,...a},o){const s=(0,Gn.useStyles2)(Rl),l=(0,c.useId)();return h().createElement("div",{ref:o,role:"option",id:l,"aria-selected":t,className:(0,Qn.cx)(s.option,t&&s.optionFocused,n&&s.groupBottomBorder),...a},h().createElement("div",{className:s.optionBody,"data-testid":`data-testid ad hoc filter option value ${e}`},h().createElement("span",null,r?h().createElement(Gn.Checkbox,{tabIndex:-1,checked:i,className:s.checkbox}):null,e)))})),Rl=e=>({option:(0,Qn.css)({label:"grafana-select-option",top:0,left:0,width:"100%",position:"absolute",padding:e.spacing(1),display:"flex",alignItems:"center",flexDirection:"row",flexShrink:0,whiteSpace:"nowrap",cursor:"pointer","&:hover":{background:e.colors.action.hover,"@media (forced-colors: active), (prefers-contrast: more)":{border:`1px solid ${e.colors.primary.border}`}}}),optionFocused:(0,Qn.css)({label:"grafana-select-option-focused",background:e.colors.action.focus,"@media (forced-colors: active), (prefers-contrast: more)":{border:`1px solid ${e.colors.primary.border}`}}),optionBody:(0,Qn.css)({label:"grafana-select-option-body",display:"flex",fontWeight:e.typography.fontWeightMedium,flexDirection:"column",flexGrow:1}),groupBottomBorder:(0,Qn.css)({borderBottom:`1px solid ${e.colors.border.weak}`}),checkbox:(0,Qn.css)({paddingRight:e.spacing(.5)}),multiValueApplyWrapper:(0,Qn.css)({position:"fixed",top:0,left:0,display:"flex",backgroundColor:e.colors.background.primary,color:e.colors.text.primary,boxShadow:e.shadows.z2,overflowY:"auto",zIndex:e.zIndex.dropdown,gap:e.spacing(1.5),padding:`${e.spacing(1.5)} ${e.spacing(1)}`})}),Al=()=>h().createElement(Il,{onClick:e=>e.stopPropagation()},h().createElement(en,{i18nKey:"grafana-scenes.variables.loading-options-placeholder.loading-options"},"Loading options...")),Nl=()=>h().createElement(Il,{onClick:e=>e.stopPropagation()},h().createElement(en,{i18nKey:"grafana-scenes.variables.no-options-placeholder.no-options-found"},"No options found")),Dl=({handleFetchOptions:e})=>h().createElement(Il,{onClick:e},h().createElement(en,{i18nKey:"grafana-scenes.variables.options-error-placeholder.error-occurred-fetching-labels-click-retry"},"An error has occurred fetching labels. Click to retry")),Ll=({onApply:e,floatingElement:t,maxOptionWidth:n,menuHeight:r})=>{const i=(0,Gn.useStyles2)(Rl),a=null==t?void 0:t.getBoundingClientRect();return h().createElement("div",{className:i.multiValueApplyWrapper,style:{width:`${n}px`,transform:`translate(${null==a?void 0:a.left}px,${a?a.top+r:0}px)`}},h().createElement(Gn.Button,{onClick:e,size:"sm",tabIndex:-1},h().createElement(en,{i18nKey:"grafana-scenes.variables.multi-value-apply-button.apply"},"Apply")))},Pl={key:"operator",operator:"value",value:"key"},Ml=(e,t,n,r,i)=>jl(Pl[e],t,"value"===e?n:void 0,r,i),jl=(e,t,n,r,i)=>{t(e),null==n||n(void 0,i),setTimeout((()=>null==r?void 0:r.focus()))},Fl=({filterInputType:e,item:t,filter:n,setFilterMultiValues:r,onAddCustomValue:i})=>{var a,o,s,l,u;if("key"===e)return{key:t.value,keyLabel:t.label?t.label:t.value,meta:null==t?void 0:t.meta};if("value"===e)return t.isCustom&&i?i(t,n):{value:t.value,valueLabels:[t.label?t.label:t.value]};if("operator"===e){if(hu(n.operator)&&!hu(t.value))return r([]),{operator:t.value,valueLabels:[(null==(a=n.valueLabels)?void 0:a[0])||(null==(o=n.values)?void 0:o[0])||n.value],values:void 0};if(hu(t.value)&&!hu(n.operator)){const e=[(null==(s=n.valueLabels)?void 0:s[0])||(null==(l=n.values)?void 0:l[0])||n.value],i=[n.value];return i[0]&&r([{value:i[0],label:null!=(u=null==e?void 0:e[0])?u:i[0]}]),{operator:t.value,valueLabels:e,values:i}}}return{[e]:t.value}},Vl="Filter by label values",$l=(e,t,n,r,i)=>{var a;return"key"===t?i||Vl:"value"===t?n?"Edit values":(null==(a=e.valueLabels)?void 0:a[0])||"":e[t]&&!r?`${e[t]}`:i||Vl},Bl=({populateInputOnEdit:e,item:t,filterInputType:n,setInputValue:r,filter:i})=>{var a,o,s;e&&!hu(t.value||"")&&"value"===Pl[n]?r(null!=(s=null!=(o=null==(a=null==i?void 0:i.valueLabels)?void 0:a[0])?o:null==i?void 0:i.value)?s:""):r("")},zl=({open:e,onOpenChange:t,activeIndex:n,setActiveIndex:r,outsidePressIdsToIgnore:i,listRef:a,disabledIndicesRef:o})=>{const{refs:s,floatingStyles:l,context:u}=nl({whileElementsMounted:Ro,open:e,onOpenChange:t,placement:"bottom-start",middleware:[$o(10),Bo({padding:10}),zo({apply({availableHeight:e,availableWidth:t,elements:n}){n.floating.style.maxHeight=`${Math.min(300,e)}px`,n.floating.style.maxWidth=`${t}px`},padding:10})],strategy:"fixed"}),d=function(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:i}=e,{enabled:a=!0,role:o="dialog"}=t,s=null!=(n=hl.get(o))?n:o,l=fs(),u=null!=vs(),d=c.useMemo((()=>"tooltip"===s||"label"===o?{["aria-"+("label"===o?"labelledby":"describedby")]:r?i:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===s?"dialog":s,"aria-controls":r?i:void 0,..."listbox"===s&&{role:"combobox"},..."menu"===s&&{id:l},..."menu"===s&&u&&{role:"menuitem"},..."select"===o&&{"aria-autocomplete":"none"},..."combobox"===o&&{"aria-autocomplete":"list"}}),[s,i,u,r,l,o]),h=c.useMemo((()=>{const e={id:i,...s&&{role:s}};return"tooltip"===s||"label"===o?e:{...e,..."menu"===s&&{"aria-labelledby":l}}}),[s,i,l,o]),f=c.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(o){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,o]);return c.useMemo((()=>a?{reference:d,floating:h,item:f}:{}),[a,d,h,f])}(u,{role:"listbox"}),h=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:l=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:h="pointerdown",ancestorScroll:f=!1,bubbles:p,capture:m}=t,g=ys(),v=Ho("function"==typeof l?l:()=>!1),y="function"==typeof l?v:l,b=c.useRef(!1),w=c.useRef(!1),{escapeKey:S,outsidePress:x}=tl(p),{escapeKey:E,outsidePress:_}=tl(m),O=c.useRef(!1),k=Ho((e=>{var t;if(!n||!o||!s||"Escape"!==e.key)return;if(O.current)return;const i=null==(t=a.current.floatingContext)?void 0:t.nodeId,l=g?Es(g.nodesRef.current,i):[];if(!S&&(e.stopPropagation(),l.length>0)){let e=!0;if(l.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),T=Ho((e=>{var t;const n=()=>{var t;k(e),null==(t=pa(e))||t.removeEventListener("keydown",n)};null==(t=pa(e))||t.addEventListener("keydown",n)})),C=Ho((e=>{var t;const n=b.current;b.current=!1;const o=w.current;if(w.current=!1,"click"===u&&o)return;if(n)return;if("function"==typeof y&&!y(e))return;const s=pa(e),l="["+bs("inert")+"]",c=ha(i.floating).querySelectorAll(l);let d=Mi(s)?s:null;for(;d&&!Xi(d);){const e=ea(d);if(Xi(e)||!Mi(e))break;d=e}if(c.length&&Mi(s)&&!s.matches("html,body")&&!aa(s,i.floating)&&Array.from(c).every((e=>!aa(d,e))))return;if(ji(s)&&A){const t=s.clientWidth>0&&s.scrollWidth>s.clientWidth,n=s.clientHeight>0&&s.scrollHeight>s.clientHeight;let r=n&&e.offsetX>s.clientWidth;if(n&&"rtl"===Ji(s).direction&&(r=e.offsetX<=s.offsetWidth-s.clientWidth),r||t&&e.offsetY>s.clientHeight)return}const h=null==(t=a.current.floatingContext)?void 0:t.nodeId,f=g&&Es(g.nodesRef.current,h).some((t=>{var n;return fa(e,null==(n=t.context)?void 0:n.elements.floating)}));if(fa(e,i.floating)||fa(e,i.domReference)||f)return;const p=g?Es(g.nodesRef.current,h):[];if(p.length>0){let e=!0;if(p.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}r(!1,e,"outside-press")})),I=Ho((e=>{var t;const n=()=>{var t;C(e),null==(t=pa(e))||t.removeEventListener(u,n)};null==(t=pa(e))||t.addEventListener(u,n)}));c.useEffect((()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=S,a.current.__outsidePressBubbles=x;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function l(){window.clearTimeout(e),O.current=!0}function c(){e=window.setTimeout((()=>{O.current=!1}),Qi()?5:0)}const d=ha(i.floating);s&&(d.addEventListener("keydown",E?T:k,E),d.addEventListener("compositionstart",l),d.addEventListener("compositionend",c)),y&&d.addEventListener(u,_?I:C,_);let h=[];return f&&(Mi(i.domReference)&&(h=na(i.domReference)),Mi(i.floating)&&(h=h.concat(na(i.floating))),!Mi(i.reference)&&i.reference&&i.reference.contextElement&&(h=h.concat(na(i.reference.contextElement)))),h=h.filter((e=>{var t;return e!==(null==(t=d.defaultView)?void 0:t.visualViewport)})),h.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{s&&(d.removeEventListener("keydown",E?T:k,E),d.removeEventListener("compositionstart",l),d.removeEventListener("compositionend",c)),y&&d.removeEventListener(u,_?I:C,_),h.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[a,i,s,y,u,n,r,f,o,S,x,k,E,T,C,_,I]),c.useEffect((()=>{b.current=!1}),[y,u]);const R=c.useMemo((()=>({onKeyDown:k,[Zs[h]]:e=>{d&&r(!1,e.nativeEvent,"reference-press")}})),[k,r,d,h]),A=c.useMemo((()=>({onKeyDown:k,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[el[u]]:()=>{b.current=!0}})),[k,u]);return c.useMemo((()=>o?{reference:R,floating:A}:{}),[o,R,A])}(u,{outsidePress:e=>{var t;if(e.currentTarget instanceof Element){const n=e.currentTarget;let r=n.id;if("path"===n.nodeName&&(r=(null==(t=n.parentElement)?void 0:t.id)||""),i.includes(r))return!1}return!0}}),f=dl(u,{listRef:a,activeIndex:n,onNavigate:r,virtual:!0,loop:!0,disabledIndices:o.current}),{getReferenceProps:p,getFloatingProps:m,getItemProps:g}=function(e){void 0===e&&(e=[]);const t=e.map((e=>null==e?void 0:e.reference)),n=e.map((e=>null==e?void 0:e.floating)),r=e.map((e=>null==e?void 0:e.item)),i=c.useCallback((t=>al(t,e,"reference")),t),a=c.useCallback((t=>al(t,e,"floating")),n),o=c.useCallback((t=>al(t,e,"item")),r);return c.useMemo((()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o})),[i,a,o])}([d,h,f]);return{refs:s,floatingStyles:l,context:u,getReferenceProps:p,getFloatingProps:m,getItemProps:g}},Ul=({item:e,handleRemoveMultiValue:t,index:n,handleEditMultiValuePill:r})=>{var i,a;const o=(0,Gn.useStyles2)(ql),s=(0,c.useCallback)((t=>{t.stopPropagation(),t.preventDefault(),r(e)}),[r,e]),l=(0,c.useCallback)((e=>{"Enter"===e.key&&s(e)}),[s]),u=(0,c.useCallback)((n=>{n.stopPropagation(),n.preventDefault(),t(e)}),[t,e]),d=(0,c.useCallback)((e=>{"Enter"===e.key&&u(e)}),[u]);return h().createElement("div",{className:(0,Qn.cx)(o.basePill,o.valuePill),onClick:s,onKeyDown:l,tabIndex:0,id:`${e.value}-${n}`},null!=(i=e.label)?i:e.value,h().createElement(Gn.Button,{onClick:u,onKeyDownCapture:d,fill:"text",size:"sm",variant:"secondary",className:o.removeButton,tooltip:Zt("grafana-scenes.components.adhoc-filters-combobox.remove-filter-value","Remove filter value - {{itemLabel}}",{itemLabel:null!=(a=e.label)?a:e.value})},h().createElement(Gn.Icon,{name:"times",size:"md",id:`${e.value}-${n}-close-icon`})))},ql=e=>({basePill:(0,Qn.css)({display:"flex",alignItems:"center",background:e.colors.action.disabledBackground,border:`1px solid ${e.colors.border.weak}`,padding:e.spacing(.125,1,.125,1),color:e.colors.text.primary,overflow:"hidden",whiteSpace:"nowrap",minHeight:e.spacing(2.75),...e.typography.bodySmall,cursor:"pointer"}),valuePill:(0,Qn.css)({background:e.colors.action.selected,padding:e.spacing(.125,0,.125,1)}),removeButton:(0,Qn.css)({marginInline:e.spacing(.5),height:"100%",padding:0,cursor:"pointer","&:hover":{color:e.colors.text.primary}})}),Hl=(0,c.forwardRef)((function({filter:e,controller:t,isAlwaysWip:n,handleChangeViewMode:r,focusOnWipInputRef:i,populateInputOnEdit:a},o){var s,l,u;const[d,f]=(0,c.useState)(!1),[p,m]=(0,c.useState)([]),[g,v]=(0,c.useState)(!1),[y,b]=(0,c.useState)(!1),[w,S]=(0,c.useState)(""),[x,E]=(0,c.useState)(null),[_,O]=(0,c.useState)(n?"key":"value"),[k,T]=(0,c.useState)(!n&&"value"===_),C=(0,Gn.useStyles2)(Wl),[I,R]=(0,c.useState)([]),[A,N]=(0,c.useState)({}),{allowCustomValue:D=!0,onAddCustomValue:L,filters:P,inputPlaceholder:M}=t.useState(),j=(0,c.useRef)(null),F=hu((null==e?void 0:e.operator)||""),V=F&&"value"===_,$=(0,c.useId)(),B=(0,c.useRef)([]),z=(0,c.useRef)([]),U=(0,c.useRef)(n?"key":"value"),q=(0,c.useMemo)((()=>wi(p)),[p]),H=(0,c.useMemo)((()=>!n&&P.at(-1)===e),[e,n,P]),W=(0,c.useCallback)((()=>{n&&(t.addWip(),O("key"),S(""))}),[t,n]),G=(0,c.useCallback)(((e,t,n,r)=>{var i;if(!n.length&&t.origin&&e.updateToMatchAll(t),n.length){const r=[],a=[];n.forEach((e=>{var t;r.push(null!=(t=e.label)?t:e.value),a.push(e.value)}));let o=!0;Array.isArray(t.values)&&t.values.length===a.length&&(o=!t.values.every(((e,t)=>e===a[t]))),o&&(null==(i=e.startProfile)||i.call(e,ae)),e.updateFilter(t,{valueLabels:r,values:a,value:a[0]}),R([])}r||setTimeout((()=>{var e;return null==(e=X.domReference.current)?void 0:e.focus()}))}),[]),K=(0,c.useCallback)((e=>{R((t=>t.some((t=>t.value===e.value))?t.filter((t=>t.value!==e.value)):[...t,e]))}),[]),Q=(0,c.useCallback)(((n,i,a)=>{f(n),a&&["outside-press","escape-key"].includes(a)&&(V?G(t,e,I):e&&e.origin&&""===w&&t.updateToMatchAll(e),W(),null==r||r())}),[e,I,r,G,W,w,V,t]),Y=(0,c.useMemo)((()=>[$,...I.reduce(((e,t,n)=>[...e,`${t.value}-${n}`,`${t.value}-${n}-close-icon`]),[])]),[$,I]),{refs:X,floatingStyles:J,context:Z,getReferenceProps:ee,getFloatingProps:te,getItemProps:ne}=zl({open:d,onOpenChange:Q,activeIndex:x,setActiveIndex:E,outsidePressIdsToIgnore:Y,listRef:B,disabledIndicesRef:z});(0,c.useImperativeHandle)(o,(()=>()=>{var e;return null==(e=X.domReference.current)?void 0:e.focus()}),[X.domReference]);const re=(0,c.useCallback)((e=>{R((t=>t.filter((t=>t.value!==e.value)))),setTimeout((()=>{var e;return null==(e=X.domReference.current)?void 0:e.focus()}))}),[X.domReference]),oe=(e=>e.flatMap((e=>e.options?[e,...e.options]:[e])))(Du(q(k?"":w)));if(D&&"operator"!==_&&w){const t=iu.find((t=>(null==e?void 0:e.operator)===t.value)),n={value:w.trim(),label:w.trim(),isCustom:!0};(null==t?void 0:t.isRegex)?oe.unshift(n):oe.push(n)}const se=((e,t,n)=>{var r,i,a,o;let s=182;const l=[],u=[];for(let t=0;t<e.length;t++){l.push(null),(null==(r=e[t])?void 0:r.options)&&u.push(t);let n=null!=(a=null!=(i=e[t].label)?i:e[t].value)?a:"",c=8;8*n.length<6*((null==(o=e[t].description)?void 0:o.length)||0)&&(n=e[t].description,c=6);const d=(e[t].isCustom?n.length+18:n.length)*c+16;d>s&&(s=d)}return t.current=[...l],n.current=[...u],s})(oe,B,z),le=(0,c.useCallback)((async n=>{var r,i,a,o;const s="key"===n?"adhoc_keys_dropdown":"adhoc_values_dropdown";"operator"!==n&&(null==(r=t.startInteraction)||r.call(t,s)),b(!1),v(!0),m([]);let l=[];try{if("key"===n?l=await t.getKeys(null):"operator"===n?l=t.getOperators():"value"===n&&(l=await t.getValuesFor(e)),U.current!==n)return void(null==(i=t.stopInteraction)||i.call(t));m(l),(null==(a=l[0])?void 0:a.group)?E(1):E(0)}catch(e){b(!0)}v(!1),null==(o=t.stopInteraction)||o.call(t)}),[e,t]),ue=function(e){return Cl({observeElementRect:bl,observeElementOffset:xl,scrollToFn:_l,...e})}({count:oe.length,getScrollElement:()=>X.floating.current,estimateSize:e=>oe[e].description?60:38,overscan:5}),ce=(0,c.useCallback)(((r,a)=>{var o;if("Backspace"===r.key&&!w){if("value"===_){if(a&&I.length)return void R((e=>{const t=[...e];return t.splice(-1,1),t}));if(null==e?void 0:e.origin)return;return void O("operator")}null==i||i(),cu(e)&&(null==(o=t.startProfile)||o.call(t,ie)),t.handleComboboxBackspace(e),n&&W()}}),[w,_,t,e,n,I.length,W,i]),de=(0,c.useCallback)(((n,i)=>{var a;"Tab"!==n.key||n.shiftKey||(i&&(n.preventDefault(),G(t,e,I),null==(a=X.domReference.current)||a.focus()),null==r||r(),W())}),[e,I,r,G,W,t,X.domReference]),he=(0,c.useCallback)(((n,i)=>{"Tab"===n.key&&n.shiftKey&&(i&&(n.preventDefault(),G(t,e,I,!0)),null==r||r(),W())}),[e,I,r,G,W,t]),fe=(0,c.useCallback)(((n,o)=>{var s;if("Enter"===n.key&&null!=x){if(!oe[x])return;const n=oe[x];if(o)K(n),S("");else{const o=Fl({filterInputType:_,item:n,filter:e,setFilterMultiValues:R,onAddCustomValue:L});"value"===_&&o.value!==(null==e?void 0:e.value)&&(null==(s=t.startProfile)||s.call(t,ae)),t.updateFilter(e,o),Bl({populateInputOnEdit:a,item:n,filterInputType:_,setInputValue:S,filter:e}),Ml(_,O,r,X.domReference.current,!H&&void 0),E(null),H&&(null==i||i())}}}),[x,oe,K,t,e,_,a,r,X.domReference,H,i,L]),pe=(0,c.useCallback)((e=>{var t;const n=e.label||e.value;R((t=>t.filter((t=>t.value!==e.value)))),T(!0),S(n),null==(t=X.domReference.current)||t.focus(),setTimeout((()=>{var e;null==(e=X.domReference.current)||e.select()}))}),[X.domReference]);(0,c.useEffect)((()=>{d&&le(_)}),[d,_]),(0,c.useEffect)((()=>{var t,r,i,o;if(!n){if(F&&(null==(t=null==e?void 0:e.values)?void 0:t.length)){const t=e.values.reduce(((t,n,r)=>{var i;return[...t,{label:(null==(i=e.valueLabels)?void 0:i[r])||n,value:n}]}),[]);R(t)}!F&&a&&(S(null!=(i=null==(r=null==e?void 0:e.valueLabels)?void 0:r[0])?i:(null==e?void 0:e.value)||""),setTimeout((()=>{var e;null==(e=X.domReference.current)||e.select()}))),null==(o=X.domReference.current)||o.focus()}}),[]),(0,c.useEffect)((()=>{V&&I&&setTimeout((()=>N({})))}),[I,V]),(0,c.useLayoutEffect)((()=>{U.current&&(U.current=_)}),[_]),(0,c.useLayoutEffect)((()=>{var e,t;null!==x&&ue.range&&(x>(null==(e=ue.range)?void 0:e.endIndex)||x<(null==(t=ue.range)?void 0:t.startIndex))&&ue.scrollToIndex(x)}),[x,ue]);const me=null!=(s=null==e?void 0:e.keyLabel)?s:null==e?void 0:e.key;return h().createElement("div",{className:C.comboboxWrapper},e?h().createElement("div",{className:C.pillWrapper},(null==e?void 0:e.key)?h().createElement("div",{className:(0,Qn.cx)(C.basePill,C.keyPill)},me):null,(null==e?void 0:e.key)&&(null==e?void 0:e.operator)&&"operator"!==_?h().createElement("div",{id:$,className:(0,Qn.cx)(C.basePill,!e.origin&&C.operatorPill,e.origin&&C.keyPill,$),"aria-label":Zt("grafana-scenes.variables.ad-hoc-combobox.aria-label-edit-filter-operator","Edit filter operator"),tabIndex:e.origin?-1:0,onClick:t=>{e.origin?null==r||r():(t.stopPropagation(),S(""),jl("operator",O,void 0,X.domReference.current))},onKeyDown:t=>{e.origin||(he(t,F),"Enter"===t.key&&(S(""),jl("operator",O,void 0,X.domReference.current)))},...!e.origin&&{role:"button"}},e.operator):null,h().createElement("div",{ref:j}),V?I.map(((e,t)=>h().createElement(Ul,{key:`${e.value}-${t}`,item:e,index:t,handleRemoveMultiValue:re,handleEditMultiValuePill:pe}))):null):null,h().createElement("input",{...ee({ref:X.setReference,onChange:function(e){const t=e.target.value;S(t),E(0),k&&T(!1)},value:w,placeholder:$l(e,_,V,n,M),"aria-autocomplete":"list",onKeyDown(e){d?("operator"===_&&he(e),ce(e,V),de(e,V),fe(e,V)):f(!0)}}),className:(0,Qn.cx)(C.inputStyle,{[C.loadingInputPadding]:!g}),onClick:e=>{e.stopPropagation(),f(!0)},onFocus:()=>{f(!0)}}),g?h().createElement(Gn.Spinner,{className:C.loadingIndicator,inline:!0}):null,h().createElement(Us,null,d&&h().createElement(Js,{context:Z,initialFocus:-1,visuallyHiddenDismiss:!0,modal:!0},h().createElement(h().Fragment,null,h().createElement("div",{style:{...J,width:`${y?366:se}px`,transform:V?`translate(${(null==(l=j.current)?void 0:l.getBoundingClientRect().left)||0}px, ${((null==(u=X.domReference.current)?void 0:u.getBoundingClientRect().bottom)||0)+10}px )`:J.transform},ref:X.setFloating,className:C.dropdownWrapper,tabIndex:-1},h().createElement("div",{style:{height:`${ue.getTotalSize()||38}px`},...te(),tabIndex:-1},g?h().createElement(Al,null):y?h().createElement(Dl,{handleFetchOptions:()=>le(_)}):oe.length||D&&"operator"!==_&&w?ue.getVirtualItems().map((n=>{var i;const o=oe[n.index],s=n.index;if(o.options)return h().createElement("div",{key:`${o.label}+${s}`,className:(0,Qn.cx)(C.optionGroupLabel,C.groupTopBorder),style:{height:`${n.size}px`,transform:`translateY(${n.start}px)`}},h().createElement(Gn.Text,{weight:"bold",variant:"bodySmall",color:"secondary"},o.label));const l=oe[n.index+1],u=l&&!l.group&&!l.options&&o.group,c=null!=(i=o.label)?i:o.value;return h().createElement(Il,{...ne({key:`${o.value}-${s}`,ref(e){B.current[s]=e},onClick(n){var i,s;if("value"!==_&&n.stopPropagation(),V)n.preventDefault(),n.stopPropagation(),K(o),S(""),null==(i=X.domReference.current)||i.focus();else{const n=Fl({filterInputType:_,item:o,filter:e,setFilterMultiValues:R,onAddCustomValue:L});"value"===_&&n.value!==(null==e?void 0:e.value)&&(null==(s=t.startProfile)||s.call(t,ae)),t.updateFilter(e,n),Bl({populateInputOnEdit:a,item:o,filterInputType:_,setInputValue:S,filter:e}),Ml(_,O,r,X.domReference.current,!1)}}}),active:x===s,addGroupBottomBorder:u,style:{height:`${n.size}px`,transform:`translateY(${n.start}px)`},"aria-setsize":oe.length,"aria-posinset":n.index+1,isMultiValueEdit:V,checked:I.some((e=>e.value===o.value))},h().createElement("span",null,o.isCustom?Zt("grafana-scenes.components.adhoc-filters-combobox.use-custom-value","Use custom value: {{itemLabel}}",{itemLabel:c}):c),o.description?h().createElement("div",{className:C.descriptionText},o.description):null)})):h().createElement(Nl,null))),V&&!g&&!y&&oe.length?h().createElement(Ll,{onApply:()=>{G(t,e,I)},floatingElement:X.floating.current,maxOptionWidth:se,menuHeight:Math.min(ue.getTotalSize(),300)}):null))))})),Wl=e=>({comboboxWrapper:(0,Qn.css)({display:"flex",flexWrap:"wrap"}),pillWrapper:(0,Qn.css)({display:"flex",alignItems:"center",flexWrap:"wrap"}),basePill:(0,Qn.css)({display:"flex",alignItems:"center",background:e.colors.action.disabledBackground,border:`1px solid ${e.colors.border.weak}`,padding:e.spacing(.125,1,.125,1),color:e.colors.text.primary,overflow:"hidden",whiteSpace:"nowrap",minHeight:e.spacing(2.75),...e.typography.bodySmall,cursor:"pointer"}),keyPill:(0,Qn.css)({fontWeight:e.typography.fontWeightBold,cursor:"default"}),operatorPill:(0,Qn.css)({"&:hover":{background:e.colors.action.hover}}),dropdownWrapper:(0,Qn.css)({backgroundColor:e.colors.background.primary,color:e.colors.text.primary,boxShadow:e.shadows.z2,overflowY:"auto",zIndex:e.zIndex.portal}),inputStyle:(0,Qn.css)({paddingBlock:0,"&:focus":{outline:"none"}}),loadingIndicator:(0,Qn.css)({color:e.colors.text.secondary,marginLeft:e.spacing(.5)}),loadingInputPadding:(0,Qn.css)({paddingRight:e.spacing(2.5)}),optionGroupLabel:(0,Qn.css)({padding:e.spacing(1),position:"absolute",top:0,left:0,width:"100%"}),groupTopBorder:(0,Qn.css)({"&:not(:first-child)":{borderTop:`1px solid ${e.colors.border.weak}`}}),descriptionText:(0,Qn.css)({...e.typography.bodySmall,color:e.colors.text.secondary,paddingTop:e.spacing(.5)})});function Gl({filter:e,controller:t,readOnly:n,focusOnWipInputRef:r}){var i,a,o,s;const l=(0,Gn.useStyles2)(Kl),[u,d]=(0,c.useState)(!0),[f,p]=(0,c.useState)(!1),m=(0,c.useRef)(null),[g,v]=(0,c.useState)(!1),y=null!=(i=e.keyLabel)?i:e.key,b=(null==(a=e.valueLabels)?void 0:a.join(", "))||(null==(o=e.values)?void 0:o.join(", "))||e.value,w=(0,c.useCallback)(((e,t)=>{null==e||e.stopPropagation(),n||(p(null!=t?t:!u),d(!u))}),[n,u]);(0,c.useEffect)((()=>{var e;f&&(null==(e=m.current)||e.focus(),p(!1))}),[f]),(0,c.useEffect)((()=>{e.forceEdit&&u&&(d(!1),t.updateFilter(e,{forceEdit:void 0}))}),[e,t,u]),(0,c.useEffect)((()=>{u&&v((e=>!e&&e))}),[u]);const S=e=>"dashboard"===e?{info:"Applied by default in this dashboard. If edited, it carries over to other dashboards.",restore:"Restore the value set by this dashboard."}:"scope"===e?{info:"Applied automatically from your selected scope.",restore:"Restore the value set by your selected scope."}:{info:`This is a ${e} injected filter.`,restore:"Restore filter to its original value."},x=!e.restorable&&!e.readOnly&&!e.nonApplicable;if(u){const i=`${y} ${e.operator} ${b}`,a=h().createElement("span",{className:(0,Qn.cx)(l.pillText,e.nonApplicable&&l.strikethrough)},i);return h().createElement("div",{className:(0,Qn.cx)(l.combinedFilterPill,n&&l.readOnlyCombinedFilter,(uu(e)||e.nonApplicable)&&l.disabledPill,e.readOnly&&l.filterReadOnly),onClick:e=>{e.stopPropagation(),v(!0),w()},onKeyDown:e=>{"Enter"===e.key&&(v(!0),w())},role:n?void 0:"button","aria-label":Zt("grafana-scenes.components.adhoc-filter-pill.edit-filter-with-key","Edit filter with key {{keyLabel}}",{keyLabel:y}),tabIndex:0,ref:m},i.length<20?a:h().createElement(Gn.Tooltip,{content:h().createElement("div",{className:l.tooltipText},i),placement:"top"},a),n||e.matchAllFilter||e.origin&&"dashboard"!==e.origin?null:h().createElement(Gn.IconButton,{onClick:n=>{n.stopPropagation(),e.origin&&"dashboard"===e.origin?t.updateToMatchAll(e):t.removeFilter(e),setTimeout((()=>null==r?void 0:r()))},onKeyDownCapture:n=>{"Enter"===n.key&&(n.preventDefault(),n.stopPropagation(),e.origin&&"dashboard"===e.origin?t.updateToMatchAll(e):t.removeFilter(e),setTimeout((()=>null==r?void 0:r())))},name:"times",size:"md",className:(0,Qn.cx)(l.pillIcon,e.nonApplicable&&l.disabledPillIcon),tooltip:Zt("grafana-scenes.components.adhoc-filter-pill.remove-filter-with-key","Remove filter with key {{keyLabel}}",{keyLabel:y})}),e.origin&&e.readOnly&&h().createElement(Gn.Tooltip,{content:Zt("grafana-scenes.components.adhoc-filter-pill.managed-filter","{{origin}} managed filter",{origin:e.origin}),placement:"bottom"},h().createElement(Gn.Icon,{name:"lock",size:"md",className:l.readOnlyPillIcon})),e.origin&&x&&h().createElement(Gn.Tooltip,{content:S(e.origin).info,placement:"bottom"},h().createElement(Gn.Icon,{name:"info-circle",size:"md",className:l.infoPillIcon})),e.origin&&e.restorable&&!e.readOnly&&h().createElement(Gn.IconButton,{onClick:n=>{n.stopPropagation(),t.restoreOriginalFilter(e)},onKeyDownCapture:n=>{"Enter"===n.key&&(n.preventDefault(),n.stopPropagation(),t.restoreOriginalFilter(e))},name:"history",size:"md",className:uu(e)?l.matchAllPillIcon:l.pillIcon,tooltip:S(e.origin).restore}),e.nonApplicable&&h().createElement(Gn.Tooltip,{content:null!=(s=e.nonApplicableReason)?s:Zt("grafana-scenes.components.adhoc-filter-pill.non-applicable","Filter is not applicable"),placement:"bottom"},h().createElement(Gn.Icon,{name:"info-circle",size:"md",className:l.infoPillIcon})))}return h().createElement(Hl,{filter:e,controller:t,handleChangeViewMode:w,focusOnWipInputRef:r,populateInputOnEdit:g})}const Kl=e=>({combinedFilterPill:(0,Qn.css)({display:"flex",alignItems:"center",background:e.colors.action.selected,borderRadius:e.shape.radius.default,border:`1px solid ${e.colors.border.weak}`,padding:e.spacing(.125,0,.125,1),color:e.colors.text.primary,overflow:"hidden",whiteSpace:"nowrap",minHeight:e.spacing(2.75),...e.typography.bodySmall,fontWeight:e.typography.fontWeightBold,cursor:"pointer","&:hover":{background:e.colors.action.hover}}),readOnlyCombinedFilter:(0,Qn.css)({paddingRight:e.spacing(1),cursor:"text","&:hover":{background:e.colors.action.selected}}),filterReadOnly:(0,Qn.css)({background:e.colors.background.canvas,cursor:"text","&:hover":{background:e.colors.background.canvas}}),pillIcon:(0,Qn.css)({marginInline:e.spacing(.5),cursor:"pointer","&:hover":{color:e.colors.text.primary}}),pillText:(0,Qn.css)({maxWidth:"200px",width:"100%",textOverflow:"ellipsis",overflow:"hidden"}),tooltipText:(0,Qn.css)({textAlign:"center"}),infoPillIcon:(0,Qn.css)({marginInline:e.spacing(.5),cursor:"pointer"}),readOnlyPillIcon:(0,Qn.css)({marginInline:e.spacing(.5)}),matchAllPillIcon:(0,Qn.css)({marginInline:e.spacing(.5),cursor:"pointer",color:e.colors.text.disabled}),disabledPillIcon:(0,Qn.css)({marginInline:e.spacing(.5),cursor:"pointer",color:e.colors.text.disabled,"&:hover":{color:e.colors.text.disabled}}),...Lu(e)}),Ql=(0,c.forwardRef)((function({controller:e},t){const{wip:n}=e.useState();return(0,c.useLayoutEffect)((()=>{n||e.addWip()}),[n]),h().createElement(Hl,{controller:e,filter:n,isAlwaysWip:!0,ref:t})})),Yl=(0,c.memo)((function({controller:e}){const{originFilters:t,filters:n,readOnly:r}=e.useState(),i=(0,Gn.useStyles2)(Xl),a=(0,c.useRef)();return h().createElement("div",{className:(0,Qn.cx)(i.comboboxWrapper,{[i.comboboxFocusOutline]:!r}),onClick:()=>{var e;null==(e=a.current)||e.call(a)}},h().createElement(Gn.Icon,{name:"filter",className:i.filterIcon,size:"lg"}),null==t?void 0:t.map(((t,n)=>t.origin?h().createElement(Gl,{key:`${n}-${t.key}`,filter:t,controller:e,focusOnWipInputRef:a.current}):null)),n.filter((e=>!e.hidden)).map(((t,n)=>h().createElement(Gl,{key:`${n}-${t.key}`,filter:t,controller:e,readOnly:r||t.readOnly,focusOnWipInputRef:a.current}))),r?null:h().createElement(Ql,{controller:e,ref:a}))})),Xl=e=>({comboboxWrapper:(0,Qn.css)({display:"flex",flexWrap:"wrap",alignItems:"center",columnGap:e.spacing(1),rowGap:e.spacing(.5),minHeight:e.spacing(4),backgroundColor:e.components.input.background,border:`1px solid ${e.colors.border.strong}`,borderRadius:e.shape.radius.default,paddingInline:e.spacing(1),paddingBlock:e.spacing(.5),flexGrow:1}),comboboxFocusOutline:(0,Qn.css)({"&:focus-within":{outline:"2px dotted transparent",outlineOffset:"2px",boxShadow:`0 0 0 2px ${e.colors.background.canvas}, 0 0 0px 4px ${e.colors.primary.main}`,transitionTimingFunction:"cubic-bezier(0.19, 1, 0.22, 1)",transitionDuration:"0.2s",transitionProperty:"outline, outline-offset, box-shadow",zIndex:2}}),filterIcon:(0,Qn.css)({color:e.colors.text.secondary,alignSelf:"center"})}),Jl=Object.fromEntries(Object.entries(a.scopeFilterOperatorMap).map((([e,t])=>[t,e])));function Zl(e){return new Set(["equals","not-equals","one-of","not-one-of"]).has(e)}function eu(e){return new Set(["regex-match","regex-not-match"]).has(e)}function tu(e,t,n){var r,i;if(!n)return;const o=e.get(n.key);o&&function(e,t){const n=a.scopeFilterOperatorMap[e];if(!Zl(n)||!Zl(t))return!1;return nu(n,t)}(o.operator,n.operator)?function(e,t){var n,r,i,a;const o=null!=(n=t.values)?n:[t.value];for(const t of o)(null==(r=e.values)?void 0:r.includes(t))||null==(i=e.values)||i.push(t);if(1===(null==(a=e.values)?void 0:a.length))return;"equals"===t.operator&&e.operator===Jl.equals?e.operator=Jl["one-of"]:"not-equals"===t.operator&&e.operator===Jl["not-equals"]&&(e.operator=Jl["not-one-of"])}(o,n):o&&function(e,t){const n=a.scopeFilterOperatorMap[e];if(!eu(n)||!eu(t))return!1;return nu(n,t)}(o.operator,n.operator)?(o.value+=`|${n.value}`,o.values=[o.value]):o?t.push({key:n.key,operator:Jl[n.operator],value:n.value,values:null!=(i=n.values)?i:[n.value],origin:"scope"}):e.set(n.key,{key:n.key,operator:Jl[n.operator],value:n.value,values:null!=(r=n.values)?r:[n.value],origin:"scope"})}function nu(e,t){return!(e.includes("not")&&!t.includes("not")||!e.includes("not")&&t.includes("not"))}class ru{constructor(e){this.model=e}useState(){const e=this.model.useState();return{filters:e.filters,originFilters:e.originFilters,readOnly:e.readOnly,allowCustomValue:e.allowCustomValue,supportsMultiValueOperators:e.supportsMultiValueOperators,onAddCustomValue:e.onAddCustomValue,wip:e._wip}}async getKeys(e){return this.model._getKeys(e)}async getValuesFor(e){return this.model._getValuesFor(e)}getOperators(){return this.model._getOperators()}updateFilter(e,t){this.model._updateFilter(e,t)}updateToMatchAll(e){this.model.updateToMatchAll(e)}removeFilter(e){this.model._removeFilter(e)}removeLastFilter(){this.model._removeLastFilter()}handleComboboxBackspace(e){this.model._handleComboboxBackspace(e)}addWip(){this.model._addWip()}restoreOriginalFilter(e){this.model.restoreOriginalFilter(e)}startProfile(e){const t=W(this.model);null==t||t.startProfile(e)}startInteraction(e){const t=kr(this.model);null==t||t.startInteraction(e)}stopInteraction(){const e=kr(this.model);null==e||e.stopInteraction()}}const iu=[{value:"=",description:"Equals"},{value:"!=",description:"Not equal"},{value:"=|",description:"One of. Use to filter on multiple values.",isMulti:!0},{value:"!=|",description:"Not one of. Use to exclude multiple values.",isMulti:!0},{value:"=~",description:"Matches regex",isRegex:!0},{value:"!~",description:"Does not match regex",isRegex:!0},{value:"<",description:"Less than"},{value:"<=",description:"Less than or equal to"},{value:">",description:"Greater than"},{value:">=",description:"Greater than or equal to"}];class au extends I{constructor(e){var t,n,r,i,a;super({type:"adhoc",name:null!=(t=e.name)?t:"Filters",filters:[],datasource:null,applyMode:"auto",filterExpression:null!=(i=e.filterExpression)?i:ou(e.expressionBuilder,[...null!=(n=e.originFilters)?n:[],...null!=(r=e.filters)?r:[]]),...e}),this._scopedVars={__sceneObject:Sr(this)},this._dataSourceSrv=(0,o.getDataSourceSrv)(),this._originalValues=new Map,this._prevScopes=[],this._variableDependency=new Mu(this,{dependsOnScopes:!0,onReferencedVariableValueChanged:()=>this._updateScopesFilters()}),this._urlSync=new Ti(this),this._debouncedVerifyApplicability=(0,N.debounce)(this._verifyApplicability,100),this._activationHandler=()=>(this._debouncedVerifyApplicability(),()=>{var e;null==(e=this.state.originFilters)||e.forEach((e=>{e.restorable&&this.restoreOriginalFilter(e)}))}),"auto"===this.state.applyMode&&function(e){if(e.addActivationHandler((()=>(gi.add(e),()=>gi.delete(e)))),si)return;const t=(0,o.getTemplateSrv)();(null==t?void 0:t.getAdhocFilters)&&(si=t.getAdhocFilters,t.getAdhocFilters=function(e){var n;if(0===gi.size)return si.call(t,e);const r=(0,o.getDataSourceSrv)().getInstanceSettings(e);if(!r)return[];for(const e of gi.values())if((null==(n=e.state.datasource)?void 0:n.uid)===r.uid)return e.state.filters;return[]}.bind(t))}(this),null==(a=this.state.originFilters)||a.forEach((e=>{var t;this._originalValues.set(`${e.key}-${e.origin}`,{operator:e.operator,value:null!=(t=e.values)?t:[e.value]})})),this.addActivationHandler(this._activationHandler)}_updateScopesFilters(){var e,t;const n=lc.getScopes(this);if(!n||!n.length)return void this.setState({originFilters:null==(e=this.state.originFilters)?void 0:e.filter((e=>"scope"!==e.origin))});const r=function(e){const t=new Map,n=[],r=e.flatMap((e=>e.spec.filters));for(const e of r)tu(t,n,e);return[...t.values(),...n]}(n);if(!r.length)return;let i=r;const a=[],o=[];if(i.forEach((e=>{var t;this._originalValues.set(`${e.key}-${e.origin}`,{value:null!=(t=e.values)?t:[e.value],operator:e.operator})})),null==(t=this.state.originFilters)||t.forEach((e=>{"scope"===e.origin?a.push(e):o.push(e)})),this._prevScopes.length)return this.setState({originFilters:[...i,...o]}),this._prevScopes=n,void this._debouncedVerifyApplicability();const s=a.filter((e=>e.restorable)),l=s.map((e=>e.key)),u=r.map((e=>e.key));i=[...s.filter((e=>u.includes(e.key))),...r.filter((e=>!l.includes(e.key)))],this.setState({originFilters:[...i,...o]}),this._prevScopes=n,this._debouncedVerifyApplicability()}setState(e){var t,n;let r=!1;if((e.filters&&e.filters!==this.state.filters||e.originFilters&&e.originFilters!==this.state.originFilters)&&!e.filterExpression){const i=null!=(t=e.filters)?t:this.state.filters,a=null!=(n=e.originFilters)?n:this.state.originFilters;e.filterExpression=ou(this.state.expressionBuilder,[...null!=a?a:[],...i]),r=e.filterExpression!==this.state.filterExpression}super.setState(e),r&&this.publishEvent(new pe(this),!0)}updateFilters(e,t){var n;let r,i=!1;e&&e!==this.state.filters&&(r=ou(this.state.expressionBuilder,[...null!=(n=this.state.originFilters)?n:[],...e]),i=r!==this.state.filterExpression),super.setState({filters:e,filterExpression:r}),(i&&!0!==(null==t?void 0:t.skipPublish)||(null==t?void 0:t.forcePublish))&&this.publishEvent(new pe(this),!0)}restoreOriginalFilter(e){const t={matchAllFilter:!1,restorable:!1};if(e.restorable){const n=this._originalValues.get(`${e.key}-${e.origin}`);if(!n)return;t.value=null==n?void 0:n.value[0],t.values=null==n?void 0:n.value,t.valueLabels=null==n?void 0:n.value,t.operator=null==n?void 0:n.operator,t.nonApplicable=null==n?void 0:n.nonApplicable;const r=W(this);null==r||r.startProfile("filter_restored"),this._updateFilter(e,t)}}getValue(){return this.state.filterExpression}_updateFilter(e,t){var n;const{originFilters:r,filters:i,_wip:a}=this.state;if(e.origin){const i=this._originalValues.get(`${e.key}-${e.origin}`),a=t.values||(t.value?[t.value]:void 0);a&&!(0,N.isEqual)(a,null==i?void 0:i.value)||t.operator&&t.operator!==(null==i?void 0:i.operator)?t.restorable=!0:a&&(0,N.isEqual)(a,null==i?void 0:i.value)&&(t.restorable=!1);const o=null!=(n=null==r?void 0:r.map((n=>n===e?{...n,...t}:n)))?n:[];return void this.setState({originFilters:o})}if(e===a)return void("value"in t&&""!==t.value?(this.setState({filters:[...i,{...a,...t}],_wip:void 0}),this._debouncedVerifyApplicability()):this.setState({_wip:{...e,...t}}));const o=this.state.filters.map((n=>n===e?{...n,...t}:n));this.setState({filters:o})}updateToMatchAll(e){this._updateFilter(e,{operator:"=~",value:".*",values:[".*"],valueLabels:["All"],matchAllFilter:!0,nonApplicable:!1,restorable:!0})}_removeFilter(e){if(e===this.state._wip)return void this.setState({_wip:void 0});const t=W(this);null==t||t.startProfile(ie),this.setState({filters:this.state.filters.filter((t=>t!==e))}),this._debouncedVerifyApplicability()}_removeLastFilter(){const e=this.state.filters.at(-1);e&&this._removeFilter(e)}_handleComboboxBackspace(e){var t;if(this.state.filters.length){let t=this.state.filters.length-1;e!==this.state._wip&&(t=-1),this.setState({filters:this.state.filters.reduce(((n,r,i)=>i!==t||r.readOnly?r===e?n:[...n,r]:[...n,{...r,forceEdit:!0}]),[])})}else if(null==(t=this.state.originFilters)?void 0:t.length){let t=this.state.originFilters.length-1;e!==this.state._wip&&(t=-1),this.setState({originFilters:this.state.originFilters.reduce(((n,r,i)=>i!==t||r.readOnly?r===e?n:[...n,r]:[...n,{...r,forceEdit:!0}]),[])})}}async _verifyApplicability(){var e,t,n;const r=[...this.state.filters,...null!=(e=this.state.originFilters)?e:[]],i=await this._dataSourceSrv.get(this.state.datasource,this._scopedVars);if(!i||!i.getDrilldownsApplicability)return;if(!r)return;const a=lc.getTimeRange(this).state.value,o=this.state.useQueriesAsFilterForOptions?Ou(this):void 0,s=await i.getDrilldownsApplicability({filters:r,queries:o,timeRange:a,scopes:lc.getScopes(this),...gr(this)}),l=new Map;s.forEach((e=>{l.set(`${e.key}${e.origin?`-${e.origin}`:""}`,e)}));const u={filters:[...this.state.filters],originFilters:[...null!=(t=this.state.originFilters)?t:[]]};u.filters.forEach((e=>{const t=l.get(e.key);t&&(e.nonApplicable=!t.applicable,e.nonApplicableReason=t.reason)})),null==(n=u.originFilters)||n.forEach((e=>{const t=l.get(`${e.key}-${e.origin}`);if(t){e.matchAllFilter||(e.nonApplicable=!t.applicable,e.nonApplicableReason=t.reason);const n=this._originalValues.get(`${e.key}-${e.origin}`);n&&(n.nonApplicable=!t.applicable,n.nonApplicableReason=null==t?void 0:t.reason)}})),this.setState(u)}async _getKeys(e){var t,n,r,i,a;const o=await(null==(n=(t=this.state).getTagKeysProvider)?void 0:n.call(t,this,e));if(o&&o.replace)return Au(o.values).map(lu);if(this.state.defaultKeys)return this.state.defaultKeys.map(lu);const s=await this._dataSourceSrv.get(this.state.datasource,this._scopedVars);if(!s||!s.getTagKeys)return[];const l=null!=(i=null==(r=this.state.originFilters)?void 0:r.filter((e=>!e.nonApplicable)))?i:[],u=this.state.filters.filter((t=>t.key!==e&&!t.nonApplicable)).concat(null!=(a=this.state.baseFilters)?a:[]).concat(l),c=lc.getTimeRange(this).state.value,d=this.state.useQueriesAsFilterForOptions?Ou(this):void 0,h=await s.getTagKeys({filters:u,queries:d,timeRange:c,scopes:lc.getScopes(this),...gr(this)});Nu(h)&&this.setState({error:h.error.message});let f=Au(h);o&&(f=f.concat(Au(o.values)));const p=this.state.tagKeyRegexFilter;return p&&(f=f.filter((e=>e.text.match(p)))),f.map(lu)}async _getValuesFor(e){var t,n,r,i;const a=await(null==(n=(t=this.state).getTagValuesProvider)?void 0:n.call(t,this,e));if(a&&a.replace)return Au(a.values).map(lu);const o=await this._dataSourceSrv.get(this.state.datasource,this._scopedVars);if(!o||!o.getTagValues)return[];const s=null!=(i=null==(r=this.state.originFilters)?void 0:r.filter((t=>t.key!==e.key)))?i:[],l=this.state.filters.filter((t=>t.key!==e.key)).concat(s),u=lc.getTimeRange(this).state.value,c=this.state.useQueriesAsFilterForOptions?Ou(this):void 0;let d=lc.getScopes(this);"scope"===e.origin&&(d=null==d?void 0:d.map((t=>({...t,spec:{...t.spec,filters:t.spec.filters.filter((t=>t.key!==e.key))}}))));const h=await o.getTagValues({key:e.key,filters:l,timeRange:u,queries:c,scopes:d,...gr(this)});Nu(h)&&this.setState({error:h.error.message});let f=Au(h);return a&&(f=f.concat(Au(a.values))),f.map(lu)}_addWip(){this.setState({_wip:{key:"",value:"",operator:"=",condition:""}})}_getOperators(){const{supportsMultiValueOperators:e,allowCustomValue:t=!0}=this.state;return iu.filter((({isMulti:n,isRegex:r})=>!(!e&&n)&&!(!t&&r))).map((({value:e,description:t})=>({label:e,value:e,description:t})))}}function ou(e,t){var n;return(null!=e?e:Su)(null!=(n=null==t?void 0:t.filter((e=>du(e))))?n:[])}au.Component=function({model:e}){const{filters:t,readOnly:n,addFilterButtonText:r}=e.useState(),i=(0,Gn.useStyles2)(su),a=(0,c.useMemo)((()=>"combobox"===e.state.layout?new ru(e):void 0),[e]);if(a)return h().createElement(Yl,{controller:a});return h().createElement("div",{className:i.wrapper},t.filter((e=>!e.hidden)).map(((t,n)=>h().createElement(h().Fragment,{key:n},h().createElement(Ei,{filter:t,model:e})))),!n&&h().createElement(Oi,{model:e,key:"'builder",addFilterButtonText:r}))};const su=e=>({wrapper:(0,Qn.css)({display:"flex",flexWrap:"wrap",alignItems:"flex-end",columnGap:e.spacing(2),rowGap:e.spacing(1)})});function lu(e){const{text:t,value:n}=e,r={label:String(t),value:String(null!=n?n:t)};return"group"in e&&(r.group=e.group),"meta"in e&&(r.meta=e.meta),r}function uu(e){return"=~"===e.operator&&".*"===e.value}function cu(e){return""!==e.key&&""!==e.operator&&""!==e.value}function du(e){return!e.nonApplicable}function hu(e){const t=iu.find((t=>t.value===e));return!!t&&Boolean(t.isMulti)}class fu{constructor(e){this._variableDependency=e}findAndSubscribeToDrilldowns(e){const t=function(e){var t;for(const n of gi.values())if(ic(n,null==(t=n.state.datasource)?void 0:t.uid)===e)return n}(e),n=function(e){var t;for(const n of Wn.values())if(ic(n,null==(t=n.state.datasource)?void 0:t.uid)===e)return n}(e);let r=!1;this._adhocFiltersVar!==t&&(this._adhocFiltersVar=t,r=!0),this._groupByVar!==n&&(this._groupByVar=n,r=!0),r&&this._updateExplicitDrilldownVariableDependencies()}_updateExplicitDrilldownVariableDependencies(){const e=[];this._adhocFiltersVar&&e.push(this._adhocFiltersVar.state.name),this._groupByVar&&e.push(this._groupByVar.state.name),this._variableDependency.setVariableNames(e)}get adHocFiltersVar(){return this._adhocFiltersVar}get groupByVar(){return this._groupByVar}getFilters(){var e;return this._adhocFiltersVar?[...null!=(e=this._adhocFiltersVar.state.originFilters)?e:[],...this._adhocFiltersVar.state.filters].filter((e=>cu(e)&&du(e))):void 0}getGroupByKeys(){return this._groupByVar?this._groupByVar.getApplicableKeys():void 0}cleanup(){this._adhocFiltersVar=void 0,this._groupByVar=void 0}}let pu=100;function mu(){return"SQR"+pu++}class gu extends I{constructor(e){super(e),this._dataLayersMerger=new ci,this._variableValueRecorder=new Bn,this._results=new f.ReplaySubject(1),this._scopedVars={__sceneObject:Sr(this)},this._isInView=!0,this._bypassIsInView=!1,this._queryNotExecutedWhenOutOfView=!1,this._variableDependency=new Mu(this,{statePaths:["queries","datasource","minInterval"],onVariableUpdateCompleted:this.onVariableUpdatesCompleted.bind(this),onAnyVariableChanged:this.onAnyVariableChanged.bind(this),dependsOnScopes:!0}),this._drilldownDependenciesManager=new fu(this._variableDependency),this.onDataReceived=e=>{const t=(0,a.preProcessPanelData)(e,this.state.data);this._resultAnnotations=e.annotations;const n=this._combineDataLayers(t);let r=this.state._hasFetchedData;r||t.state===K.Loading||(r=!0),this.setState({data:n,_hasFetchedData:r}),this._results.next({origin:this,data:n})},this.addActivationHandler((()=>this._onActivate()))}getResultsStream(){return this._results}_onActivate(){if(this.isQueryModeAuto()){const e=lc.getTimeRange(this),t=this.getClosestExtraQueryProviders();for(const e of t)this._subs.add(e.subscribeToState(((t,n)=>{e.shouldRerun(n,t,this.state.queries)&&this.runQueries()})));this.subscribeToTimeRangeChanges(e),this.shouldRunQueriesOnActivate()&&this.runQueries()}return this._dataLayersSub||this._handleDataLayers(),()=>this._onDeactivate()}_handleDataLayers(){const e=lc.getDataLayers(this);0!==e.length&&(this._dataLayersSub=this._dataLayersMerger.getMergedStream(e).subscribe(this._onLayersReceived.bind(this)))}_onLayersReceived(e){var t,n,r,i,o;const s=lc.getTimeRange(this),{dataLayerFilter:l}=this.state;let u,c=[],d=[];for(const r of e)for(let e of r.data.series)(null==(t=e.meta)?void 0:t.dataTopic)===a.DataTopic.Annotations&&(c=c.concat(e)),(null==(n=e.meta)?void 0:n.dataTopic)===a.DataTopic.AlertStates&&(d=d.concat(e));if((null==l?void 0:l.panelId)&&(c.length>0&&(c=function(e,t){var n;if(!Array.isArray(e)||0===e.length)return e;const r=Array.from({length:e.length},(()=>new Set));let i=0;for(const a of e){for(let e=0;e<a.length;e++){if(r[i].has(e))continue;let o=!0;const s=a.fields.find((e=>"panelId"===e.name)),l=a.fields.find((e=>"source"===e.name));if(l){s&&"dashboard"===l.values[e].type&&(o=[t.panelId,qn].includes(s.values[e]));const r=l.values[e].filter;if(r){const e=[...null!=(n=r.ids)?n:[],qn].includes(t.panelId);r.exclude?e&&(o=!1):e||(o=!1)}}o&&r[i].add(e)}i++}const a=[];i=0;for(const t of e){const e=r[i].size,n=[];for(const e of t.fields){const a=[];for(let n=0;n<t.length;n++)r[i].has(n)&&a.push(e.values[n]);n.push({...e,values:a})}a.push({...t,fields:n,length:e}),i++}return a}(c,l)),d.length>0))for(const e of d){const t=new a.DataFrameView(e);for(const e of t)if(e.panelId===l.panelId){u=e;break}}if(yu(c)&&yu(this._layerAnnotations)&&(0,N.isEqual)(u,null==(r=this.state.data)?void 0:r.alertState))return;this._layerAnnotations=c;const h=this.state.data?this.state.data:{...Q,timeRange:s.state.value};this.setState({data:{...h,annotations:[...null!=(i=this._resultAnnotations)?i:[],...c],alertState:null!=u?u:null==(o=this.state.data)?void 0:o.alertState}})}onVariableUpdatesCompleted(){this.isQueryModeAuto()&&this.runQueries()}onAnyVariableChanged(e){this._drilldownDependenciesManager.adHocFiltersVar!==e&&this._drilldownDependenciesManager.groupByVar!==e&&this.isQueryModeAuto()&&(e instanceof au&&this._isRelevantAutoVariable(e)&&this.runQueries(),e instanceof Tr&&this._isRelevantAutoVariable(e)&&this.runQueries())}_isRelevantAutoVariable(e){var t,n;const r=null!=(t=this.state.datasource)?t:vu(this.state.queries);return"auto"===e.state.applyMode&&(null==r?void 0:r.uid)===(null==(n=e.state.datasource)?void 0:n.uid)}shouldRunQueriesOnActivate(){return this._variableValueRecorder.hasDependenciesChanged(this)?(q(),!0):!this.state.data||!!this._isDataTimeRangeStale(this.state.data)}_isDataTimeRangeStale(e){const t=lc.getTimeRange(this).state.value,n=e.timeRange;return(t.from.unix()!==n.from.unix()||t.to.unix()!==n.to.unix())&&(q(),!0)}_onDeactivate(){var e;this._querySub&&(this._querySub.unsubscribe(),this._querySub=void 0),this._dataLayersSub&&(this._dataLayersSub.unsubscribe(),this._dataLayersSub=void 0),null==(e=this._timeSub)||e.unsubscribe(),this._timeSub=void 0,this._timeSubRange=void 0,this._drilldownDependenciesManager.cleanup()}setContainerWidth(e){!this._containerWidth&&e>0?(this._containerWidth=e,this.state.maxDataPointsFromWidth&&!this.state.maxDataPoints&&setTimeout((()=>{this.isActive&&!this.state._hasFetchedData&&this.runQueries()}),0)):e>0&&(this._containerWidth=e)}isDataReadyToDisplay(){return Boolean(this.state._hasFetchedData)}subscribeToTimeRangeChanges(e){this._timeSubRange!==e&&(this._timeSub&&this._timeSub.unsubscribe(),this._timeSubRange=e,this._timeSub=e.subscribeToState((()=>{this.runWithTimeRange(e)})))}runQueries(){const e=lc.getTimeRange(this);this.isQueryModeAuto()&&this.subscribeToTimeRangeChanges(e),this.runWithTimeRange(e)}getMaxDataPoints(){var e;return this.state.maxDataPoints?this.state.maxDataPoints:this.state.maxDataPointsFromWidth&&null!=(e=this._containerWidth)?e:500}cancelQuery(){var e;null==(e=this._querySub)||e.unsubscribe(),this._dataLayersSub&&(this._dataLayersSub.unsubscribe(),this._dataLayersSub=void 0),this.setState({data:{...this.state.data,state:K.Done}})}async runWithTimeRange(e){var t,n,r;if(!this.state.maxDataPoints&&this.state.maxDataPointsFromWidth&&!this._containerWidth)return;if(this.isQueryModeAuto()&&!this._isInView&&!this._bypassIsInView)return void(this._queryNotExecutedWhenOutOfView=!0);if(this._queryNotExecutedWhenOutOfView=!1,this._dataLayersSub||this._handleDataLayers(),null==(t=this._querySub)||t.unsubscribe(),this._variableDependency.hasDependencyInLoadingState())return q(),void this.setState({data:{...null!=(n=this.state.data)?n:Q,state:K.Loading}});this._variableValueRecorder.recordCurrentDependencyValuesForSceneObject(this);const{queries:i}=this.state;if(null==i?void 0:i.length)try{const t=null!=(r=this.state.datasource)?r:vu(i),n=await $n(t,this._scopedVars);this._drilldownDependenciesManager.findAndSubscribeToDrilldowns(n.uid);const a=(0,o.getRunRequest)(),{primary:s,secondaries:l,processors:u}=this.prepareRequests(e,n);q(0,0,this.state.key);let c=a(n,s);if(l.length>0){const e=l.map((e=>a(n,e))),t=(e=>t=>t.pipe((0,f.mergeMap)((([t,...n])=>{const r=n.flatMap((n=>{var r,i;return null!=(i=null==(r=e.get(n.request.requestId))?void 0:r(t,n))?i:(0,f.of)(n)}));return(0,f.forkJoin)([(0,f.of)(t),...r])})),(0,f.map)((([e,...t])=>{var n;return{...e,series:[...e.series,...t.flatMap((e=>e.series))],annotations:[...null!=(n=e.annotations)?n:[],...t.flatMap((e=>{var t;return null!=(t=e.annotations)?t:[]}))]}}))))(u);c=(0,f.forkJoin)([c,...e]).pipe(t)}const d=mi(this);c=c.pipe(Fn({type:"SceneQueryRunner/runQueries",request:s,origin:this,cancel:()=>this.cancelQuery()},d)),this._querySub=c.subscribe(this.onDataReceived)}catch(e){console.error("PanelQueryRunner Error",e),this.onDataReceived({...Q,...this.state.data,state:K.Error,errors:[(0,o.toDataQueryError)(e)]})}else this._setNoDataState()}clone(e){var t;const n=super.clone(e);return this._resultAnnotations&&(n._resultAnnotations=this._resultAnnotations.map((e=>({...e})))),this._layerAnnotations&&(n._layerAnnotations=this._layerAnnotations.map((e=>({...e})))),n._variableValueRecorder=this._variableValueRecorder.cloneAndRecordCurrentValuesForSceneObject(this),n._containerWidth=this._containerWidth,n._results.next({origin:this,data:null!=(t=this.state.data)?t:Q}),n}prepareRequests(e,t){var n;const{minInterval:r,queries:i}=this.state;let s={app:"scenes",requestId:mu(),timezone:e.getTimeZone(),range:e.state.value,interval:"1s",intervalMs:1e3,targets:(0,N.cloneDeep)(i),maxDataPoints:this.getMaxDataPoints(),scopedVars:this._scopedVars,startTime:Date.now(),liveStreaming:this.state.liveStreaming,rangeRaw:{from:e.state.from,to:e.state.to},cacheTimeout:this.state.cacheTimeout,queryCachingTTL:this.state.queryCachingTTL,scopes:lc.getScopes(this),...Hn(this)};const l=this._drilldownDependenciesManager.getFilters(),u=this._drilldownDependenciesManager.getGroupByKeys();l&&(s.filters=l),u&&(s.groupByKeys=u),s.targets=s.targets.map((e=>{var n;return e.datasource&&(e.datasource.uid===t.uid||(null==(n=t.meta)?void 0:n.mixed)||!o.isExpressionReference||(0,o.isExpressionReference)(e.datasource))||(e.datasource=t.getRef()),e}));const c=r?ic(this,r):t.interval,d=a.rangeUtil.calculateInterval(e.state.value,s.maxDataPoints,c);s.scopedVars=Object.assign({},s.scopedVars,{__interval:{text:d.interval,value:d.interval},__interval_ms:{text:d.intervalMs.toString(),value:d.intervalMs}}),s.interval=d.interval,s.intervalMs=d.intervalMs;const h=e.state.value;let f=[],p=new Map;for(const e of null!=(n=this.getClosestExtraQueryProviders())?n:[])for(const{req:t,processor:n}of e.getExtraQueries(s)){const e=mu();f.push({...t,requestId:e}),p.set(e,null!=n?n:Un)}return s.range=h,{primary:s,secondaries:f,processors:p}}_combineDataLayers(e){return this._layerAnnotations&&this._layerAnnotations.length>0&&(e.annotations=(e.annotations||[]).concat(this._layerAnnotations)),this.state.data&&this.state.data.alertState&&(e.alertState=this.state.data.alertState),e}_setNoDataState(){this.state.data!==Q&&this.setState({data:Q})}getClosestExtraQueryProviders(){const e=new Map;return this.parent?(X(this.parent,(t=>(zn(t)&&!e.has(t.constructor)&&e.set(t.constructor,t),t.forEachChild((t=>{zn(t)&&!e.has(t.constructor)&&e.set(t.constructor,t)})),null))),Array.from(e.values())):[]}isQueryModeAuto(){var e;return"auto"===(null!=(e=this.state.runQueriesMode)?e:"auto")}isInViewChanged(e){q(0,0,this.state.key),this._isInView=e,e&&this._queryNotExecutedWhenOutOfView&&this.runQueries()}bypassIsInViewChanged(e){q(0,0,this.state.key),this._bypassIsInView=e,e&&this._queryNotExecutedWhenOutOfView&&this.runQueries()}}function vu(e){var t,n;return null!=(n=null==(t=e.find((e=>null!==e.datasource)))?void 0:t.datasource)?n:void 0}function yu(e){if(!e)return!0;for(let t=0;t<e.length;t++)if(e[t].length>0)return!1;return!0}function bu(e,t){return e===t||(0,N.isEqual)(e,t)}function wu(e){try{return JSON.stringify(e,(()=>{const e=new WeakSet;return(t,n)=>{if("object"==typeof n&&null!==n){if(e.has(n))return;e.add(n)}return n}})())}catch(e){console.error(e)}return""}function Su(e){return e.map((e=>function(e){var t,n;let r="",i=e.operator;"=|"===i?(i="=~",r=null==(t=e.values)?void 0:t.map(Eu).join("|")):"!=|"===i?(i="!~",r=null==(n=e.values)?void 0:n.map(Eu).join("|")):r="=~"===i||"!~"===i?Eu(e.value):xu(e.value);return`${e.key}${i}"${r}"`}(e))).join(",")}function xu(e){return e.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/"/g,'\\"')}function Eu(e){return xu(e.replace(_u,"\\$&"))}const _u=/[*+?()|\\.\[\]{}^$]/g;function Ou(e){var t;const n=lc.findAllObjects(e.getRoot(),(e=>e instanceof gu)),r=lc.interpolate(e,null==(t=e.state.datasource)?void 0:t.uid),i=function(e){const t={};for(const n of e)n.state.key&&(n.state.key in t||(t[n.state.key]=[]),t[n.state.key].push(n));return Object.values(t).flatMap((e=>{const t=e.filter((e=>e.isActive));return 0===t.length&&1===e.length?e:t}))}(n).filter((t=>{var n;return lc.interpolate(e,null==(n=t.state.datasource)?void 0:n.uid)===r}));if(0===i.length)return[];const a=[];return i.forEach((t=>{a.push(...t.state.queries.filter((t=>{if(!t.datasource||!t.datasource.uid)return!0;return lc.interpolate(e,t.datasource.uid)===r})))})),a}function ku(e){return null==e?"":/\|/g[Symbol.replace](e,"__gfp__")}function Tu(e){return null==e?"":/,/g[Symbol.replace](e,"__gfc__")}function Cu(e){return function(e){return null==e?"":/#/g[Symbol.replace](e,"__gfh__")}(ku(e))}function Iu(e){return null==e?"":(e=/__gfp__/g[Symbol.replace](e,"|"),e=/__gfc__/g[Symbol.replace](e,","),e=/__gfh__/g[Symbol.replace](e,"#"))}function Ru(e,t){return t&&e!==t?[e,t].map(Tu).join(","):Tu(e)}function Au(e){return Array.isArray(e)?e:e.data}function Nu(e){return!Array.isArray(e)&&Boolean(e.error)}function Du(e){const t=[],n=new Map;for(const r of e){const e=r.group;if(e){let i=n.get(e);i||(i=[],n.set(e,i),t.push({label:e,options:i})),i.push(r)}else t.push(r)}return t}function Lu(e){return{disabledPill:(0,Qn.css)({background:e.colors.action.selected,color:e.colors.text.disabled,border:0,"&:hover":{background:e.colors.action.selected}}),strikethrough:(0,Qn.css)({textDecoration:"line-through"})}}class Pu extends I{constructor(e){super({type:"constant",value:"",name:"",...e,skipUrlSync:!0}),this._variableDependency=new Mu(this,{statePaths:["value"]}),this._prevValue=""}validateAndUpdate(){const e=this.getValue();return this._prevValue!==e&&(this._prevValue=e,this.publishEvent(new pe(this),!0)),(0,f.of)({})}getValue(){return"string"==typeof this.state.value?lc.interpolate(this,this.state.value):this.state.value}}class Mu{constructor(e,t){this._sceneObject=e,this._options=t,this._dependencies=new Set,this._isWaitingForVariables=!1,this.scanCount=0,this._statePaths=t.statePaths,this._options.handleTimeMacros&&this.handleTimeMacros()}hasDependencyOn(e){return this.getNames().has(e)}variableUpdateCompleted(e,t){var n,r,i,o;const s=this.getNames(),l=(s.has(e.state.name)||s.has(a.DataLinkBuiltInVars.includeVars))&&t;q(0,0,e.state.name,this._isWaitingForVariables),null==(r=(n=this._options).onAnyVariableChanged)||r.call(n,e),this._options.onVariableUpdateCompleted&&(this._isWaitingForVariables||l)&&this._options.onVariableUpdateCompleted(),l&&(null==(o=(i=this._options).onReferencedVariableValueChanged)||o.call(i,e),this._options.onReferencedVariableValueChanged||this._options.onVariableUpdateCompleted||this._sceneObject.forceRender())}hasDependencyInLoadingState(){return this._isWaitingForVariables=lc.hasVariableDependencyInLoadingState(this._sceneObject),this._isWaitingForVariables}getNames(){const e=this._state,t=this._state=this._sceneObject.state,n=!e||t!==e&&(!this._statePaths||this._statePaths.some((n=>"*"===n||t[n]!==e[n])));return n&&this.scanStateForDependencies(t),this._dependencies}setVariableNames(e){this._options.variableNames=e,this.scanStateForDependencies(this._state)}setPaths(e){this._statePaths=e}scanStateForDependencies(e){if(this._dependencies.clear(),this.scanCount++,this._options.variableNames)for(const e of this._options.variableNames)this._dependencies.add(e);if(this._options.dependsOnScopes&&this._dependencies.add(gn),this._statePaths)for(const t of this._statePaths){if("*"===t){this.extractVariablesFrom(e);break}{const n=e[t];n&&this.extractVariablesFrom(n)}}}extractVariablesFrom(e){pn.lastIndex=0;const t=("string"!=typeof e?wu(e):e).matchAll(pn);if(t)for(const e of t){const[,t,n,,r]=e,i=t||n||r;this._dependencies.add(i)}}handleTimeMacros(){this._sceneObject.addActivationHandler((()=>{const e=lc.getTimeRange(this._sceneObject).subscribeToState(((e,t)=>{const n=this.getNames(),r=n.has("__from"),i=n.has("__to"),a=n.has("__timezone");if(e.value!==t.value)if(r){const t=new Pu({name:"__from",value:e.from});this.variableUpdateCompleted(t,!0)}else if(i){const t=new Pu({name:"__to",value:e.to});this.variableUpdateCompleted(t,!0)}if(e.timeZone!==t.timeZone&&a){const t=new Pu({name:"__timezone",value:e.timeZone});this.variableUpdateCompleted(t,!0)}}));return()=>e.unsubscribe()}))}}const ju=e=>Boolean(e.metricFindQuery)&&!Boolean(e.variables),Fu=e=>{if(!e.variables)return!1;if(e.variables.getType()!==a.VariableSupportType.Standard)return!1;const t=e.variables;return"toDataQuery"in t&&Boolean(t.toDataQuery)},Vu=e=>{if(!e.variables)return!1;if(e.variables.getType()!==a.VariableSupportType.Custom)return!1;const t=e.variables;return"query"in t&&"editor"in t&&Boolean(t.query)&&Boolean(t.editor)},$u=e=>!!e.variables&&e.variables.getType()===a.VariableSupportType.Datasource;class Bu{constructor(e,t=(0,o.getRunRequest)()){this.datasource=e,this._runRequest=t}getTarget(e){if(Fu(this.datasource))return this.datasource.variables.toDataQuery(function(e){var t;const n=null!=(t=e.state.query)?t:"";if("string"==typeof n)return{query:n,refId:`variable-${e.state.name}`};if(null==n.refId)return{...n,refId:`variable-${e.state.name}`};return e.state.query}(e));throw new Error("Couldn't create a target with supplied arguments.")}runRequest(e,t){return Fu(this.datasource)?this.datasource.variables.query?this._runRequest(this.datasource,t,this.datasource.variables.query.bind(this.datasource.variables)):this._runRequest(this.datasource,t):Hu()}}class zu{constructor(e){this.datasource=e}getTarget(e){if(ju(this.datasource))return e.state.query;throw new Error("Couldn't create a target with supplied arguments.")}runRequest({variable:e,searchFilter:t},n){return ju(this.datasource)?(0,f.from)(this.datasource.metricFindQuery(e.state.query,{...n,variable:{name:e.state.name,type:e.state.type},searchFilter:t})).pipe((0,f.mergeMap)((e=>{if(!e||!e.length)return Hu();const t=e;return(0,f.of)({series:t,state:a.LoadingState.Done,timeRange:n.range})}))):Hu()}}class Uu{constructor(e,t=(0,o.getRunRequest)()){this.datasource=e,this._runRequest=t}getTarget(e){if(Vu(this.datasource))return e.state.query;throw new Error("Couldn't create a target with supplied arguments.")}runRequest(e,t){return Vu(this.datasource)?this.datasource.variables.query?this._runRequest(this.datasource,t,this.datasource.variables.query.bind(this.datasource.variables)):this._runRequest(this.datasource,t):Hu()}}class qu{constructor(e,t=(0,o.getRunRequest)()){this.datasource=e,this._runRequest=t}getTarget(e){var t;if($u(this.datasource))return"string"==typeof e.state.query?e.state.query:{...e.state.query,refId:null!=(t=e.state.query.refId)?t:"variable-query"};throw new Error("Couldn't create a target with supplied arguments.")}runRequest(e,t){return $u(this.datasource)?this._runRequest(this.datasource,t):Hu()}}function Hu(){return(0,f.of)({state:a.LoadingState.Done,series:[],timeRange:(0,a.getDefaultTimeRange)()})}let Wu=function(e){if(Fu(e))return new Bu(e,(0,o.getRunRequest)());if(ju(e))return new zu(e);if(Vu(e))return new Uu(e);if($u(e))return new qu(e);throw new Error(`Couldn't create a query runner for datasource ${e.type}`)};const Gu=(e,t)=>{const n=[];let r=null;t.lastIndex=0;do{r=t.exec(e),r&&n.push(r)}while(t.global&&r&&""!==r[0]&&void 0!==r[0]);return n},Ku=(e,t)=>{if(t===a.VariableSort.disabled)return e;switch(t){case a.VariableSort.alphabeticalAsc:e=(0,N.sortBy)(e,"label");break;case a.VariableSort.alphabeticalDesc:e=(0,N.sortBy)(e,"label").reverse();break;case a.VariableSort.numericalAsc:e=(0,N.sortBy)(e,Qu);break;case a.VariableSort.numericalDesc:e=(e=(0,N.sortBy)(e,Qu)).reverse();break;case a.VariableSort.alphabeticalCaseInsensitiveAsc:e=(0,N.sortBy)(e,(e=>(0,N.toLower)(e.label)));break;case a.VariableSort.alphabeticalCaseInsensitiveDesc:e=(e=(0,N.sortBy)(e,(e=>(0,N.toLower)(e.label)))).reverse();break;case a.VariableSort.naturalAsc||7:e=Xu(e);break;case a.VariableSort.naturalDesc||8:e=(e=Xu(e)).reverse()}return e};function Qu(e){if(!e.label)return-1;const t=e.label.match(/.*?(\d+).*/);return!t||t.length<2?-1:parseInt(t[1],10)}const Yu=new Intl.Collator(void 0,{sensitivity:"accent",numeric:!0});function Xu(e){return e.slice().sort(((e,t)=>Yu.compare(e.label,t.label)))}function Ju(){return e=>e.pipe((0,f.map)((e=>{const t=e.series;if(!t||!t.length)return[];if(function(e){if(!e)return!1;if(!e.length)return!0;const t=e[0];if((0,a.isDataFrame)(t))return!1;for(const e in t){if(!t.hasOwnProperty(e))continue;if(null!==t[e]&&"string"!=typeof t[e]&&"number"!=typeof t[e])continue;const n=e.toLowerCase();if("text"===n||"value"===n)return!0}return!1}(t))return t;if(0===t[0].fields.length)return[];const n=(0,a.getProcessedDataFrames)(t),r=[];let i=-1,o=-1,s=-1,l=-1;for(const e of n)for(let n=0;n<e.fields.length;n++){const r=e.fields[n],u=(0,a.getFieldDisplayName)(r,e,t).toLowerCase();r.type===a.FieldType.string&&-1===s&&(s=n),"text"===u&&r.type===a.FieldType.string&&-1===o&&(o=n),"value"===u&&r.type===a.FieldType.string&&-1===i&&(i=n),"expandable"!==u||r.type!==a.FieldType.boolean&&r.type!==a.FieldType.number||-1!==l||(l=n)}if(-1===s)throw new Error("Couldn't find any field of type string in the results.");for(const e of t)for(let t=0;t<e.length;t++){const n=-1!==l?e.fields[l].values.get(t):void 0,a=e.fields[s].values.get(t),u=-1!==o?e.fields[o].values.get(t):"",c=-1!==i?e.fields[i].values.get(t):"";-1!==i||-1!==o?-1!==i||-1===o?-1===i||-1!==o?r.push({text:u,value:c,expandable:n}):r.push({text:c,value:c,expandable:n}):r.push({text:u,value:u,expandable:n}):r.push({text:a,value:a,expandable:n})}return r})))}class Zu extends En{constructor(e){super({type:"query",name:"",value:"",text:"",options:[],datasource:null,regex:"",query:"",refresh:a.VariableRefresh.onDashboardLoad,sort:a.VariableSort.disabled,...e}),this._variableDependency=new Mu(this,{statePaths:["regex","query","datasource"]}),this.onSearchChange=e=>{wu(this.state.query).indexOf(mn)>-1&&this._updateOptionsBasedOnSearchFilter(e)},this._updateOptionsBasedOnSearchFilter=(0,N.debounce)((async e=>{const t=await(0,f.lastValueFrom)(this.getValueOptions({searchFilter:e}));this.setState({options:t,loading:!1})}),400)}getValueOptions(e){return this.state.query?(this.setState({loading:!0,error:null}),(0,f.from)($n(this.state.datasource,{__sceneObject:Sr(this)})).pipe((0,f.mergeMap)((t=>{const n=Wu(t),r=n.getTarget(this),i=this.getRequest(r,e.searchFilter);return n.runRequest({variable:this,searchFilter:e.searchFilter},i).pipe(Fn({type:"QueryVariable/getValueOptions",request:i,origin:this}),(0,f.filter)((e=>e.state===a.LoadingState.Done||e.state===a.LoadingState.Error)),(0,f.take)(1),(0,f.mergeMap)((e=>e.state===a.LoadingState.Error?(0,f.throwError)((()=>e.error)):(0,f.of)(e))),Ju(),(0,f.mergeMap)((e=>{let t="";this.state.regex&&(t=lc.interpolate(this,this.state.regex,void 0,"regex"));let n=function(e,t,n){var r,i,o,s,l,u,c,d,h,f;let p,m=[];e&&(p=(0,a.stringToJsRegex)(e));for(let e=0;e<n.length;e++){const t=n[e];let a=null!=(i=null!=(r=t.text)?r:t.value)?i:"",g=null!=(s=null!=(o=t.value)?o:t.text)?s:"";if((0,N.isNumber)(g)&&(g=g.toString()),(0,N.isNumber)(a)&&(a=a.toString()),p){const e=Gu(g,p);if(!e.length)continue;const t=e.find((e=>e.groups&&e.groups.value)),n=e.find((e=>e.groups&&e.groups.text)),r=e.find((e=>e.length>1)),i=e.length>1&&r;if(t||n)g=null!=(c=null==(l=null==t?void 0:t.groups)?void 0:l.value)?c:null==(u=null==n?void 0:n.groups)?void 0:u.text,a=null!=(f=null==(d=null==n?void 0:n.groups)?void 0:d.text)?f:null==(h=null==t?void 0:t.groups)?void 0:h.value;else{if(i){for(let t=0;t<e.length;t++){const n=e[t];m.push({label:n[1],value:n[1]})}continue}r&&(a=r[1],g=r[1])}}m.push({label:a,value:g})}return m=(0,N.uniqBy)(m,"value"),Ku(m,t)}(t,this.state.sort,e);if(this.state.staticOptions){const e=this.state.staticOptions;n=n.filter((t=>!e.find((e=>e.value===t.value)))),"after"===this.state.staticOptionsOrder?n.push(...e):"sorted"===this.state.staticOptionsOrder?n=Ku(n.concat(e),this.state.sort):n.unshift(...e)}return(0,f.of)(n)})),(0,f.catchError)((e=>e.cancelled?(0,f.of)([]):(0,f.throwError)((()=>e)))))})))):(0,f.of)([])}getRequest(e,t){const n={__sceneObject:Sr(this)};t&&(n.__searchFilter={value:t,text:t});const r=lc.getTimeRange(this).state.value;return{app:a.CoreApp.Dashboard,requestId:w(),timezone:"",range:r,interval:"",intervalMs:0,targets:[e],scopedVars:n,startTime:Date.now()}}}Zu.Component=({model:e})=>h().createElement(fr,{model:e});var ec=(e=>(e[e.dontHide=0]="dontHide",e[e.hideLabel=1]="hideLabel",e[e.hideVariable=2]="hideVariable",e))(ec||{});class tc extends I{constructor(e){super({skipUrlSync:!0,loading:!0,scopes:[],...e,type:"system",name:gn,hide:ec.hideVariable}),this._renderBeforeActivation=!0,this.UNSAFE_renderAsHidden=!0}getValue(){var e;const t=null!=(e=this.state.scopes)?e:[];return new nc(t.map((e=>e.metadata.name)))}getScopes(){return this.state.scopes}setContext(e){if(!e)return;this._context=e;const t=e.state;null!=this.state.enable&&e.setEnabled(this.state.enable);const n=e.stateObservable.subscribe((e=>{this.updateStateFromContext(e)}));return()=>{n.unsubscribe(),null!=this.state.enable&&e.setEnabled(t.enabled)}}updateStateFromContext(e){const t=0!==e.value.length&&e.loading,n=this.state.scopes.map((e=>e.metadata.name)),r=e.value.map((e=>e.metadata.name)),i=!(0,N.isEqual)(n,r);if(t||!i&&0!==r.length)this.setState({loading:t});else{const n=W(this);null==n||n.startProfile("scopes_changed"),this.setState({scopes:e.value,loading:t}),this.publishEvent(new pe(this),!0)}}}tc.Component=function({model:e}){const t=(0,c.useContext)(o.ScopesContext);return(0,c.useEffect)((()=>e.setContext(t)),[t,e]),null};class nc{constructor(e){this._value=e}formatter(e){return e===G.$m.QueryParam?this._value.map((e=>`scope=${encodeURIComponent(e)}`)).join("&"):this._value.join(", ")}}function rc(e){var t;return null!=(t=X(e,(e=>e.state.$data)))?t:ce}function ic(e,t,n,r,i){return""===t||null==t?"":Rn(e,t,n,r,i)}function ac(e,t,n,r){if(t(e))return e;let i=null;return e.forEachChild((e=>{if(e===n)return;let r=ac(e,t);return r?(i=r,!1):void 0})),i||(r&&e.parent?ac(e.parent,t,e,!0):null)}function oc(e,t){return ac(e,t,void 0,!0)}function sc(e,t){const n=[];return e.forEachChild((e=>{t(e)&&n.push(e),n.push(...sc(e,t))})),n}const lc={getVariables:function(e){var t;return null!=(t=X(e,(e=>e.state.$variables)))?t:he},getData:rc,getTimeRange:fe,getLayout:function(e){const t=X(e,(e=>function(e){return"isDraggable"in e}(e)?e:void 0));return t||null},getDataLayers:function(e,t=!1){let n=e,r=[];for(;n;){const e=n.state.$data;if(e){if(Dn(e)?r=r.concat(e):e.state.$data&&Dn(e.state.$data)&&(r=r.concat(e.state.$data)),t&&r.length>0)break;n=n.parent}else n=n.parent}return r},interpolate:ic,lookupVariable:U,hasVariableDependencyInLoadingState:function(e){if(!e.variableDependency)return!1;for(const t of e.variableDependency.getNames()){if(e instanceof Zu&&e.state.name===t){console.warn("Query variable is referencing itself");continue}const n=U(t,e);if(!n)continue;if(n.parent.isVariableLoadingOrWaitingToUpdate(n))return!0}return!1},findByKey:function(e,t){const n=oc(e,(e=>e.state.key===t));if(!n)throw new Error("Unable to find scene with key "+t);return n},findByKeyAndType:function(e,t,n){const r=oc(e,(e=>e.state.key===t));if(!r)throw new Error("Unable to find scene with key "+t);if(!(r instanceof n))throw new Error(`Found scene object with key ${t} does not match type ${n.name}`);return r},findObject:oc,findAllObjects:sc,getAncestor:function(e,t){let n=e;for(;n;){if(n instanceof t)return n;n=n.parent}if(!n)throw new Error("Unable to find parent of type "+t.name);return n},getQueryController:W,findDescendents:function(e,t){function n(e){return e instanceof t}return sc(e,n).filter(n)},getScopes:function(e){const t=U(gn,e);if(t instanceof tc)return t.state.scopes}};class uc extends I{constructor(e){super({type:"system",value:"",text:"",name:"",...e,skipUrlSync:!0})}getValue(){return this.state.value}getValueText(){return this.state.text.toString()}isAncestorLoading(){var e,t;const n=null==(t=null==(e=this.parent)?void 0:e.parent)?void 0:t.parent;if(!n)throw new Error("LocalValueVariable requires a parent SceneVariableSet that has an ancestor SceneVariableSet");const r=lc.getVariables(n),i=lc.lookupVariable(this.state.name,n);return!(!r||!i)&&r.isVariableLoadingOrWaitingToUpdate(i)}}const cc="$";function dc(e){let t,n=`panel-${e.getLegacyPanelId()}`,r=e;for(;r;){const e=r.state.$variables;e&&e.state.variables.forEach((e=>{e.state.name!==t&&e instanceof uc&&(n=`${e.state.value}${cc}${n}`,t=e.state.name)})),r=r.parent}return n}new WeakMap,new WeakMap,new WeakMap,new WeakMap,new WeakMap;function hc(e){if("string"==typeof e)return e;if(e){if(e instanceof Error)return e.message;if((0,o.isFetchError)(e)){if(e.data&&e.data.message)return e.data.message;if(e.statusText)return e.statusText}else if(e.hasOwnProperty("message"))return e.message}return JSON.stringify(e)}new WeakMap,new WeakMap,new WeakMap,new WeakMap,new WeakMap,new WeakMap,new WeakMap,new WeakMap,new WeakMap,new WeakMap,new WeakMap;class fc extends I{constructor(e,t=[]){super({isEnabled:!0,...e}),this._results=new f.ReplaySubject(1),this.isDataLayer=!0,this._variableValueRecorder=new Bn,this._variableDependency=new Mu(this,{onVariableUpdateCompleted:this.onVariableUpdateCompleted.bind(this),dependsOnScopes:!0}),this._variableDependency.setPaths(t),this.addActivationHandler((()=>this.onActivate()))}onActivate(){return this.state.isEnabled&&this.onEnable(),this.shouldRunLayerOnActivate()&&this.runLayer(),this.subscribeToState(((e,t)=>{!e.isEnabled&&this.querySub&&(this.querySub.unsubscribe(),this.querySub=void 0,this.onDisable(),this._results.next({origin:this,data:Q}),this.setStateHelper({data:Q})),e.isEnabled&&!t.isEnabled&&(this.onEnable(),this.runLayer())})),()=>{this.onDeactivate()}}onDeactivate(){this.querySub&&(this.querySub.unsubscribe(),this.querySub=void 0),this.onDisable(),this._variableValueRecorder.recordCurrentDependencyValuesForSceneObject(this)}onVariableUpdateCompleted(){this.runLayer()}cancelQuery(){this.querySub&&(this.querySub.unsubscribe(),this.querySub=void 0,this.publishResults(Q))}publishResults(e){this.state.isEnabled&&(this._results.next({origin:this,data:e}),this.setStateHelper({data:e}))}getResultsStream(){return this._results}shouldRunLayerOnActivate(){return!!this.state.isEnabled&&(this._variableValueRecorder.hasDependenciesChanged(this)?(q(),!0):!this.state.data)}setStateHelper(e){wn(this,e)}}var pc=n(7708),mc=n(4120),gc=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e},vc=n(1693);var yc=n(8353),bc=n(3449),wc="function"==typeof Symbol&&Symbol.observable||"@@observable",Sc=n(3887);function xc(e){return 0===e.length?Sc.D:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var Ec=n(2236),_c=n(3004),Oc=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r,i=this,a=(r=e)&&r instanceof yc.vU||function(e){return e&&(0,vc.T)(e.next)&&(0,vc.T)(e.error)&&(0,vc.T)(e.complete)}(r)&&(0,bc.Uv)(r)?e:new yc.Ms(e,t,n);return(0,_c.Y)((function(){var e=i,t=e.operator,n=e.source;a.add(t?t.call(a,n):n?i._subscribe(a):i._trySubscribe(a))})),a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=kc(t))((function(t,r){var i=new yc.Ms({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[wc]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return xc(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=kc(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function kc(e){var t;return null!==(t=null!=e?e:Ec.$.Promise)&&void 0!==t?t:Promise}var Tc="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";var Cc=n(6712);function Ic(e){if(e instanceof Oc)return e;if(null!=e){if(function(e){return(0,vc.T)(e[wc])}(e))return a=e,new Oc((function(e){var t=a[wc]();if((0,vc.T)(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(gc(e))return i=e,new Oc((function(e){for(var t=0;t<i.length&&!e.closed;t++)e.next(i[t]);e.complete()}));if(r=e,(0,vc.T)(null==r?void 0:r.then))return n=e,new Oc((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,Cc.m)}));if(function(e){return Symbol.asyncIterator&&(0,vc.T)(null==e?void 0:e[Symbol.asyncIterator])}(e))return Rc(e);if(function(e){return(0,vc.T)(null==e?void 0:e[Tc])}(e))return t=e,new Oc((function(e){var n,r;try{for(var i=(0,mc.Ju)(t),a=i.next();!a.done;a=i.next()){var o=a.value;if(e.next(o),e.closed)return}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()}));if(function(e){return(0,vc.T)(null==e?void 0:e.getReader)}(e))return Rc(function(e){return(0,mc.AQ)(this,arguments,(function(){var t,n,r;return(0,mc.YH)(this,(function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,(0,mc.N3)(t.read())];case 3:return n=i.sent(),r=n.value,n.done?[4,(0,mc.N3)(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,(0,mc.N3)(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}(e))}var t,n,r,i,a;throw function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}(e)}function Rc(e){return new Oc((function(t){(function(e,t){var n,r,i,a;return(0,mc.sH)(this,void 0,void 0,(function(){var o,s;return(0,mc.YH)(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=(0,mc.xN)(e),l.label=1;case 1:return[4,n.next()];case 2:if((r=l.sent()).done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=l.sent(),i={error:s},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}var Ac=n(5096);var Nc=n(4370);function Dc(e,t,n){return void 0===n&&(n=1/0),(0,vc.T)(t)?Dc((function(n,r){return(0,pc.T)((function(e,i){return t(n,e,r,i)}))(Ic(e(n,r)))}),n):("number"==typeof t&&(n=t),(0,Ac.N)((function(t,r){return function(e,t,n,r,i,a,o,s){var l=[],u=0,c=0,d=!1,h=function(){!d||l.length||u||t.complete()},f=function(e){return u<r?p(e):l.push(e)},p=function(e){a&&t.next(e),u++;var s=!1;Ic(n(e,c++)).subscribe((0,Nc._)(t,(function(e){null==i||i(e),a?f(e):t.next(e)}),(function(){s=!0}),void 0,(function(){if(s)try{u--;for(var e=function(){var e=l.shift();o?function(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var a=t.schedule((function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()}),r);e.add(a)}(t,o,(function(){return p(e)})):p(e)};l.length&&u<r;)e();h()}catch(e){t.error(e)}})))};return e.subscribe((0,Nc._)(t,f,(function(){d=!0,h()}))),function(){null==s||s()}}(t,r,e,n)})))}const Lc={prepareAnnotation:e=>{if((0,N.isString)(null==e?void 0:e.query)){const{query:t,...n}=e;return{...n,target:{refId:"annotation_query",query:t},mappings:{}}}return e},prepareQuery:e=>e.target,processEvents:(e,t)=>function(e,t){return(0,f.of)(e).pipe((e=>e.pipe(Dc((e=>{if(!(null==e?void 0:e.length))return(0,f.of)(void 0);if(1===e.length)return(0,f.of)(e[0]);const t={interpolate:e=>e};return(0,f.of)(e).pipe(a.standardTransformers.mergeTransformer.operator({},t),(0,pc.T)((e=>e[0])))})))),(0,pc.T)((e=>{if(!(null==e?void 0:e.length))return[];let n=!1,r=!1;const i={};for(const t of e.fields){i[(0,a.getFieldDisplayName)(t,e).toLowerCase()]=t}t||(t={});const o=[];for(const s of Mc){const l=t[s.key]||{};if(l.source===a.AnnotationEventFieldSource.Skip)continue;const u={key:s.key,split:s.split};if(l.source===a.AnnotationEventFieldSource.Text)u.text=l.value;else{const t=(l.value||s.key).toLowerCase();u.field=i[t],!u.field&&s.field&&(u.field=s.field(e))}(u.field||u.text)&&(o.push(u),"time"===u.key?n=!0:"text"===u.key&&(r=!0))}if(!n||!r)return console.error("Cannot process annotation fields. No time or text present."),[];const s=[];for(let t=0;t<e.length;t++){const e={type:"default",color:"red"};for(const n of o){let r;if(n.text)r=n.text;else if(n.field&&(r=n.field.values.get(t),void 0!==r&&n.regex)){const e=n.regex.exec(r);e&&(r=e[1]?e[1]:e[0])}null!=r&&(n.split&&"string"==typeof r&&(r=r.split(",")),e[n.key]=r)}s.push(e)}return s})))}(t,e.mappings)};const Pc=[{key:"time",field:e=>e.fields.find((e=>e.type===a.FieldType.time)),placeholder:"time, or the first time field"},{key:"timeEnd",help:"When this field is defined, the annotation will be treated as a range"},{key:"title"},{key:"text",field:e=>e.fields.find((e=>e.type===a.FieldType.string)),placeholder:"text, or the first text field"},{key:"tags",split:",",help:"The results will be split on comma (,)"},{key:"id"}],Mc=[...o.config.publicDashboardAccessToken?[{key:"color"},{key:"isRegion"},{key:"source"}]:[],...Pc,{key:"userId"},{key:"login"},{key:"email"},{key:"prevState"},{key:"newState"},{key:"data"},{key:"panelId"},{key:"alertId"},{key:"dashboardId"},{key:"dashboardUID"}];const jc=["prometheus","loki","elasticsearch","grafana-opensearch-datasource"];let Fc=100;function Vc(e,t,n,r,i,s){var l;if(e.annotationQuery&&function(e){const{type:t}=e;return!e.annotations||jc.includes(t)}(e))return console.warn("Using deprecated annotationQuery method, please upgrade your datasource"),(0,f.from)(e.annotationQuery({range:t.state.value,rangeRaw:t.state.value.raw,annotation:n,dashboard:{getVariables:(0,o.getTemplateSrv)().getVariables}})).pipe((0,pc.T)((e=>({state:K.Done,events:e}))));const u={...Lc,...e.annotations},c={...null==(l=u.getDefaultQuery)?void 0:l.call(u),...n},d=u.prepareAnnotation(c);if(!d)return(0,f.of)({state:K.Done,events:[]});const h=u.prepareQuery(d);if(!h)return(0,f.of)({state:K.Done,events:[]});const p=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,m=a.rangeUtil.calculateInterval(t.state.value,p,e.interval),g={__interval:{text:m.interval,value:m.interval},__interval_ms:{text:m.intervalMs.toString(),value:m.intervalMs},__annotation:{text:d.name,value:d},__sceneObject:Sr(r)},v={startTime:Date.now(),requestId:"AQ"+Fc++,range:t.state.value,maxDataPoints:p,scopedVars:g,...m,app:a.CoreApp.Dashboard,timezone:t.getTimeZone(),targets:[{...h,refId:"Anno"}],scopes:lc.getScopes(r),filters:i,groupByKeys:s,...Hn(r)};return(0,o.getRunRequest)()(e,v).pipe(Dc((e=>{const t=(null==e?void 0:e.series.length)?e.series:e.annotations;return(null==t?void 0:t.length)?(t.forEach((e=>{var t;(null==(t=e.meta)?void 0:t.dataTopic)||(e.meta={...e.meta||{},dataTopic:a.DataTopic.Annotations})})),u.processEvents(d,t).pipe((0,pc.T)((t=>({state:e.state,events:t||[]}))))):(0,f.of)({state:e.state,events:[]})})))}function $c(e){return"panel-alert"===e.eventType}(class extends fc{constructor(e){super({isEnabled:!0,...e},["query"]),this._scopedVars={__sceneObject:Sr(this)},this._drilldownDependenciesManager=new fu(this._variableDependency)}onEnable(){this.publishEvent(new o.RefreshEvent,!0);const e=lc.getTimeRange(this);this.setState({query:{...this.state.query,enable:!0}}),this._timeRangeSub=e.subscribeToState((()=>{this.runWithTimeRange(e)}))}onDisable(){var e;this.publishEvent(new o.RefreshEvent,!0),this.setState({query:{...this.state.query,enable:!1}}),null==(e=this._timeRangeSub)||e.unsubscribe()}runLayer(){q();const e=lc.getTimeRange(this);this.runWithTimeRange(e)}async runWithTimeRange(e){var t;const{query:n}=this.state;if(n.enable)if(this._drilldownDependenciesManager.findAndSubscribeToDrilldowns(null==(t=n.datasource)?void 0:t.uid),this.querySub&&this.querySub.unsubscribe(),this._variableDependency.hasDependencyInLoadingState())q();else try{let t=Vc(await this.resolveDataSource(n),e,n,this,this._drilldownDependenciesManager.getFilters(),this._drilldownDependenciesManager.getGroupByKeys()).pipe(Fn({type:"AnnotationsDataLayer/annotationsLoading",origin:this,cancel:()=>this.cancelQuery()}),(0,f.map)((e=>this.processEvents(n,e))));this.querySub=t.subscribe((e=>{this.publishResults(e)}))}catch(e){this.publishResults({...Q,state:K.Error,errors:[{message:hc(e)}]}),console.error("AnnotationsDataLayer error",e)}}async resolveDataSource(e){return await $n(e.datasource||void 0,this._scopedVars)}processEvents(e,t){let n=(r=e,i=t.events||[],r.snapshotData&&delete(r=(0,N.cloneDeep)(r)).snapshotData,i.map((e=>{var t;const n={...e};switch(n.source=r,n.color=o.config.theme2.visualization.getColorByName(r.iconColor),n.type=r.name,n.isRegion=Boolean(n.timeEnd&&n.time!==n.timeEnd),null==(t=n.newState)?void 0:t.toLowerCase()){case"pending":n.color="yellow";break;case"alerting":n.color="red";break;case"ok":case"normal":n.color="green";break;case"no_data":case"nodata":n.color="gray"}return n})));var r,i;n=function(e){let t=[];const n=(0,N.partition)(e,"id"),r=(0,N.groupBy)(n[0],"id");return t=(0,N.map)(r,(e=>e.length>1&&!(0,N.every)(e,$c)?(0,N.find)(e,(e=>"panel-alert"!==e.eventType)):(0,N.head)(e))),t=(0,N.concat)(t,n[1]),t}(n);const s={...Q,state:t.state},l=(0,a.arrayToDataFrame)(n);return l.meta={...l.meta,dataTopic:a.DataTopic.Annotations},s.series=[l],s}}).Component=function({model:e}){const{isEnabled:t,isHidden:n}=e.useState(),r=`data-layer-${e.state.key}`;if(n)return null;return h().createElement(Gn.InlineSwitch,{className:Bc,id:r,value:t,onChange:()=>e.setState({isEnabled:!t})})};const Bc=(0,Qn.css)({borderBottomLeftRadius:0,borderTopLeftRadius:0});function zc({layer:e}){var t,n;const r=`data-layer-${e.state.key}`,{data:i,isHidden:a}=e.useState(),o=Boolean(i&&i.state===K.Loading);return a?null:h().createElement("div",{className:Uc},h().createElement(yi,{htmlFor:r,isLoading:o,onCancel:()=>{var t;return null==(t=e.cancelQuery)?void 0:t.call(e)},label:e.state.name,description:e.state.description,error:null==(n=null==(t=e.state.data)?void 0:t.errors)?void 0:n[0].message}),h().createElement(e.Component,{model:e}))}(class extends I{constructor(){super({})}}).Component=function({model:e}){const t=lc.getDataLayers(e,!0);if(0===t.length)return null;return h().createElement(h().Fragment,null,t.map((e=>h().createElement(zc,{layer:e,key:e.state.key}))))};const Uc=(0,Qn.css)({display:"flex"});function qc({variable:e,layout:t,showAlways:n,hideLabel:r}){return R(e,{shouldActivateOrKeepAlive:!0}).hide!==a.VariableHide.hideVariable||n?"vertical"===t?h().createElement("div",{className:Gc,"data-testid":Kn.Tp.pages.Dashboard.SubMenu.submenuItem},h().createElement(Hc,{variable:e,layout:t,hideLabel:r}),h().createElement(e.Component,{model:e})):h().createElement("div",{className:Wc,"data-testid":Kn.Tp.pages.Dashboard.SubMenu.submenuItem},h().createElement(Hc,{variable:e,hideLabel:r}),h().createElement(e.Component,{model:e})):e.UNSAFE_renderAsHidden?h().createElement(e.Component,{model:e}):null}function Hc({variable:e,layout:t,hideLabel:n}){var r;const{state:i}=e;if(e.state.hide===a.VariableHide.hideLabel||n)return null;const o=`var-${i.key}`,s=i.label||i.name;return h().createElement(yi,{htmlFor:o,isLoading:i.loading,onCancel:()=>{var t;return null==(t=e.onCancel)?void 0:t.call(e)},label:s,error:i.error,layout:t,description:null!=(r=i.description)?r:void 0})}(class extends I{}).Component=function({model:e}){const t=lc.getVariables(e).useState();return h().createElement(h().Fragment,null,t.variables.map((t=>h().createElement(qc,{key:t.state.key,variable:t,layout:e.state.layout}))))};const Wc=(0,Qn.css)({display:"flex","> :nth-child(2)":(0,Qn.css)({borderTopLeftRadius:0,borderBottomLeftRadius:0})}),Gc=(0,Qn.css)({display:"flex",flexDirection:"column"});(class extends I{}).Component=function({model:e}){const t=lc.lookupVariable(e.state.variableName,e);if(!t)return null;return h().createElement(qc,{key:t.state.key,variable:t,layout:e.state.layout,showAlways:!0})};class Kc extends I{constructor(e){super(e),this._variablesToUpdate=new Set,this._updating=new Map,this._variableValueRecorder=new Bn,this._variableDependency=new Yc(this._handleParentVariableUpdatesCompleted.bind(this)),this._onActivate=()=>{const e=lc.getTimeRange(this);this._subs.add(this.subscribeToEvent(pe,(e=>this._handleVariableValueChanged(e.payload)))),this._subs.add(e.subscribeToState((()=>{this._refreshTimeRangeBasedVariables()}))),this._subs.add(this.subscribeToState(this._onStateChanged)),this._checkForVariablesThatChangedWhileInactive();for(const e of this.state.variables)this._variableNeedsUpdate(e)&&this._variablesToUpdate.add(e);return this._updateNextBatch(),this._onDeactivate},this._onDeactivate=()=>{var e;for(const t of this._updating.values())null==(e=t.subscription)||e.unsubscribe();for(const e of this.state.variables)this._variablesToUpdate.has(e)||this._updating.has(e)||this._variableValueRecorder.recordCurrentValue(e);this._variablesToUpdate.clear(),this._updating.clear()},this._onStateChanged=(e,t)=>{const n=this._variablesToUpdate.size;for(const n of t.variables)if(!e.variables.includes(n)){const e=this._updating.get(n);(null==e?void 0:e.subscription)&&e.subscription.unsubscribe(),this._updating.delete(n),this._variablesToUpdate.delete(n)}for(const n of e.variables)t.variables.includes(n)||this._variableNeedsUpdate(n)&&this._variablesToUpdate.add(n);0===n&&this._variablesToUpdate.size>0&&this._updateNextBatch()},this.addActivationHandler(this._onActivate)}getByName(e){return this.state.variables.find((t=>t.state.name===e))}_refreshTimeRangeBasedVariables(){for(const e of this.state.variables)"refresh"in e.state&&e.state.refresh===a.VariableRefresh.onTimeRangeChanged&&this._variablesToUpdate.add(e);this._updateNextBatch()}_checkForVariablesThatChangedWhileInactive(){if(this._variableValueRecorder.hasValues())for(const e of this.state.variables)this._variableValueRecorder.hasValueChanged(e)&&(Qc(e,"Changed while in-active"),this._addDependentVariablesToUpdateQueue(e))}_variableNeedsUpdate(e){return!e.isLazy&&(!!e.validateAndUpdate&&(!this._variableValueRecorder.hasRecordedValue(e)||(Qc(e,"Skipping updateAndValidate current value valid"),!1)))}_updateNextBatch(){for(const e of this._variablesToUpdate){if(!e.validateAndUpdate){console.error("Variable added to variablesToUpdate but does not have validateAndUpdate");continue}if(this._updating.has(e))continue;if(lc.hasVariableDependencyInLoadingState(e))continue;const t={variable:e};this._updating.set(e,t),Qc(e,"updateAndValidate started"),t.subscription=e.validateAndUpdate().subscribe({next:()=>this._validateAndUpdateCompleted(e),complete:()=>this._validateAndUpdateCompleted(e),error:t=>this._handleVariableError(e,t)})}}_validateAndUpdateCompleted(e){var t;if(!this._updating.has(e))return;const n=this._updating.get(e);null==(t=null==n?void 0:n.subscription)||t.unsubscribe(),this._updating.delete(e),this._variablesToUpdate.delete(e),Qc(e,"updateAndValidate completed"),this._notifyDependentSceneObjects(e),this._updateNextBatch()}cancel(e){var t;const n=this._updating.get(e);null==(t=null==n?void 0:n.subscription)||t.unsubscribe(),this._updating.delete(e),this._variablesToUpdate.delete(e)}_handleVariableError(e,t){var n;const r=this._updating.get(e);null==(n=null==r?void 0:r.subscription)||n.unsubscribe(),this._updating.delete(e),this._variablesToUpdate.delete(e),e.setState({loading:!1,error:t.message}),console.error("SceneVariableSet updateAndValidate error",t),Qc(e,"updateAndValidate error",t),this._notifyDependentSceneObjects(e),this._updateNextBatch()}_handleVariableValueChanged(e){this._addDependentVariablesToUpdateQueue(e),this._updating.has(e)||(this._updateNextBatch(),this._notifyDependentSceneObjects(e))}_handleParentVariableUpdatesCompleted(e,t){t&&this._addDependentVariablesToUpdateQueue(e),this._variablesToUpdate.size>0&&0===this._updating.size&&this._updateNextBatch()}_addDependentVariablesToUpdateQueue(e){for(const t of this.state.variables)t.variableDependency&&t.variableDependency.hasDependencyOn(e.state.name)&&(Qc(t,"Added to update queue, dependant variable value changed"),this._updating.has(t)&&t.onCancel&&t.onCancel(),t.validateAndUpdate&&this._variablesToUpdate.add(t),t.variableDependency.variableUpdateCompleted(e,!0))}_notifyDependentSceneObjects(e){this.parent&&this._traverseSceneAndNotify(this.parent,e,!0)}_traverseSceneAndNotify(e,t,n){if(this!==e&&e.isActive){if(e.state.$variables&&e.state.$variables!==this){const n=e.state.$variables.getByName(t.state.name);if(null==n?void 0:n.isAncestorLoading)t=n;else if(n)return}e.variableDependency&&e.variableDependency.variableUpdateCompleted(t,n),e.forEachChild((e=>this._traverseSceneAndNotify(e,t,n)))}}isVariableLoadingOrWaitingToUpdate(e){return!!e.state.loading||(!(!e.isAncestorLoading||!e.isAncestorLoading())||(!(!this._variablesToUpdate.has(e)&&!this._updating.has(e))||lc.hasVariableDependencyInLoadingState(e)))}}function Qc(e,t,n){q(0,e.state.name)}class Yc{constructor(e){this._variableUpdatesCompleted=e,this._emptySet=new Set}getNames(){return this._emptySet}hasDependencyOn(e){return!1}variableUpdateCompleted(e,t){this._variableUpdatesCompleted(e,t)}}class Xc extends En{constructor(e){super({type:"custom",query:"",value:"",text:"",options:[],name:"",...e}),this._variableDependency=new Mu(this,{statePaths:["query"]})}transformCsvStringToOptions(e,t=!0){var n;return(null!=(n=(e=t?lc.interpolate(this,e):e).match(/(?:\\,|[^,])+/g))?n:[]).map((e=>{var t;e=e.replace(/\\,/g,",");const n=null!=(t=/^\s*(.+)\s:\s(.+)$/g.exec(e))?t:[];if(3===n.length){const[,e,t]=n;return{label:e.trim(),value:t.trim()}}return{label:e.trim(),value:e.trim()}}))}getValueOptions(e){const t=this.transformCsvStringToOptions(this.state.query);return t.length||(this.skipNextValidation=!0),(0,f.of)(t)}}Xc.Component=({model:e})=>h().createElement(fr,{model:e});function Jc(e){return{container:(0,Qn.css)({display:"flex",alignItems:"center",padding:e.spacing(0,1),height:e.spacing(e.components.height.md),borderRadius:e.shape.radius.default,border:`1px solid ${e.components.input.borderColor}`,background:e.colors.background.primary})}}(class extends I{constructor(e){super({type:"switch",value:"false",enabledValue:"true",disabledValue:"false",name:"",...e}),this._prevValue="",this._urlSync=new Y(this,{keys:()=>this.getKeys()})}validateAndUpdate(){const e=this.getValue();return this._prevValue!==e&&(this._prevValue=e,this.publishEvent(new pe(this),!0)),(0,f.of)({})}setValue(e){this.getValue()!==e&&([this.state.enabledValue,this.state.disabledValue].includes(e)?(this.setState({value:e}),this.publishEvent(new pe(this),!0)):console.error(`Invalid value for switch variable: "${e}". Valid values are: "${this.state.enabledValue}" and "${this.state.disabledValue}".`))}getValue(){return this.state.value}isEnabled(){return this.state.value===this.state.enabledValue}isDisabled(){return this.state.value===this.state.disabledValue}getKey(){return`var-${this.state.name}`}getKeys(){return this.state.skipUrlSync?[]:[this.getKey()]}getUrlState(){return this.state.skipUrlSync?{}:{[this.getKey()]:this.state.value}}updateFromUrl(e){const t=e[this.getKey()];"string"==typeof t&&this.setValue(t)}}).Component=function({model:e}){const t=e.useState(),n=(0,Gn.useStyles2)(Jc);return h().createElement("div",{className:n.container},h().createElement(Gn.Switch,{id:`var-${t.key}`,value:t.value===t.enabledValue,onChange:n=>{e.setValue(n.currentTarget.checked?t.enabledValue:t.disabledValue)}}))};class Zc extends En{constructor(e){super({type:"datasource",value:"",text:"",options:[],name:"",regex:"",pluginId:"",...e}),this._variableDependency=new Mu(this,{statePaths:["regex"]})}getValueOptions(e){if(!this.state.pluginId)return(0,f.of)([]);const t=(0,o.getDataSourceSrv)().getList({metrics:!0,variables:!1,pluginId:this.state.pluginId});let n;if(this.state.regex){const e=lc.interpolate(this,this.state.regex,void 0,"regex");n=(0,a.stringToJsRegex)(e)}const r=[];for(let e=0;e<t.length;e++){const i=t[e];ed(i,n)&&r.push({label:i.name,value:i.uid}),this.state.defaultOptionEnabled&&td(i,n)&&r.push({label:Zt("grafana-scenes.variables.data-source-variable.label.default","default"),value:"default"})}return 0===r.length?this.setState({error:"No data sources found"}):this.state.error&&this.setState({error:null}),(0,f.of)(r)}}function ed(e,t){return!t||t.exec(e.name)}function td(e,t){return!!e.isDefault&&(!t||t.exec("default"))}function nd(e,t){const n=["A","B","C","D","E","F","G","H"],r=[];if(t>5)return[];for(const i of n){const n=`${e}${i}`;r.push({name:n,children:nd(n,t+1)})}return r}function rd(e,t,n){if(n>=t.length)return e;if("*"===t[n])return e;const r=t[n];let i=[],a=[r];r.startsWith("{")&&(a=r.replace(/\{|\}/g,"").split(","));for(const r of e)for(const e of a)if(-1!==e.indexOf("*")){const a=e.replace("*","");new RegExp(`^${a}.*`,"gi").test(r.name)&&(i=i.concat(rd([r],t,n+1)))}else r.name===e&&(i=i.concat(rd(r.children,t,n+1)));return i}function id(e){if(0===e.indexOf("value"))return[{name:e,children:[]}];return rd(nd("",0),e.split("."),0)}Zc.Component=({model:e})=>h().createElement(fr,{model:e});function ad({model:e}){const{value:t,key:n,loading:r}=e.useState(),i=(0,c.useCallback)((t=>{e.setValue(t.currentTarget.value)}),[e]),a=(0,c.useCallback)((t=>{"Enter"===t.key&&e.setValue(t.currentTarget.value)}),[e]);return h().createElement(Gn.AutoSizeInput,{id:n,placeholder:Zt("grafana-scenes.variables.variable-value-input.placeholder-enter-value","Enter value"),minWidth:15,maxWidth:30,value:t,loading:r,onBlur:i,onKeyDown:a})}(class extends En{constructor(e,t=!1){super({type:"custom",name:"Test",value:"Value",text:Zt("grafana-scenes.variables.test-variable.text.text","Text"),query:"Query",options:[],refresh:a.VariableRefresh.onDashboardLoad,updateOptions:!0,...e}),this.completeUpdate=new f.Subject,this.isGettingValues=!0,this.getValueOptionsCount=0,this.isLazy=!1,this._variableDependency=new Mu(this,{statePaths:["query"]}),this.isLazy=t}getValueOptions(e){const{delayMs:t}=this.state;this.getValueOptionsCount+=1;const n=lc.getQueryController(this);return new f.Observable((e=>{const r={type:"variable",origin:this,cancel:()=>e.complete()};if(n&&n.queryStarted(r),this.setState({loading:!0}),this.state.throwError)throw new Error(this.state.throwError);const i=lc.interpolate(this,this.state.query),a=this.getOptions(i),o=this.completeUpdate.subscribe({next:()=>{const t={issuedQuery:i,loading:!1};this.state.updateOptions&&(t.options=a),this.setState(t),e.next(a),e.complete()}});let s;return t?s=window.setTimeout((()=>this.signalUpdateCompleted()),t):0===t&&this.signalUpdateCompleted(),this.isGettingValues=!0,()=>{o.unsubscribe(),window.clearTimeout(s),this.isGettingValues=!1,this.state.loading&&this.setState({loading:!1}),n&&n.queryCompleted(r)}}))}cancel(){const e=X(this,(e=>e instanceof Kc?e:void 0));null==e||e.cancel(this)}getOptions(e){return this.state.optionsToReturn?this.state.optionsToReturn:id(e).map((e=>({label:e.name,value:e.name})))}signalUpdateCompleted(){this.completeUpdate.next(1)}}).Component=({model:e})=>h().createElement(fr,{model:e});(class extends I{constructor(e){super({type:"textbox",value:"",name:"",...e}),this._urlSync=new Y(this,{keys:()=>this.getKeys()})}getValue(){return this.state.value}setValue(e){e!==this.state.value&&(this.setState({value:e}),this.publishEvent(new pe(this),!0))}getKey(){return`var-${this.state.name}`}getKeys(){return this.state.skipUrlSync?[]:[this.getKey()]}getUrlState(){return this.state.skipUrlSync?{}:{[this.getKey()]:this.state.value}}updateFromUrl(e){const t=e[this.getKey()];"string"==typeof t&&this.setValue(t)}}).Component=({model:e})=>h().createElement(ad,{model:e});(class extends I{constructor(e){super({type:"interval",value:"",intervals:["1m","10m","30m","1h","6h","12h","1d","7d","14d","30d"],name:"",autoStepCount:30,autoMinInterval:"10s",autoEnabled:!1,refresh:ni.onTimeRangeChanged,...e}),this._onChange=e=>{this.setState({value:e.value}),this.publishEvent(new pe(this),!0)},this._urlSync=new Y(this,{keys:()=>[this.getKey()]})}getKey(){return`var-${this.state.name}`}getUrlState(){return{[this.getKey()]:this.state.value}}updateFromUrl(e){const t={},n=e[this.getKey()];"string"==typeof n&&(n.startsWith("$__auto_interval_")?t.value=fn:t.value=n),this.setState(t)}getOptionsForSelect(){const{value:e,intervals:t,autoEnabled:n}=this.state;let r=t.map((e=>({value:e,label:e})));return n&&(r=[{value:fn,label:"Auto"},...r]),e&&!r.some((t=>t.value===e))&&r.push({value:e,label:e}),r}getValue(){const{value:e,autoStepCount:t,autoMinInterval:n}=this.state;return e===fn?this.getAutoRefreshInteval(t,n):e}getAutoRefreshInteval(e,t){const n=lc.getTimeRange(this).state.value;return a.rangeUtil.calculateInterval(n,e,t).interval}validateAndUpdate(){const{value:e,intervals:t}=this.state;let n=!1;if(e===fn)n=!0;else if(!e&&t.length>0){const e=t[0];this.setState({value:e}),n=!0}return n&&this.publishEvent(new pe(this),!0),(0,f.of)({})}}).Component=({model:e})=>{const{key:t,value:n}=e.useState();return h().createElement(Gn.Select,{id:t,placeholder:Zt("grafana-scenes.variables.interval-variable.placeholder-select-value","Select value"),width:"auto",value:n,tabSelectsValue:!1,options:e.getOptionsForSelect(),onChange:e._onChange})};var od,sd,ld=e=>{throw TypeError(e)},ud=(e,t,n)=>t.has(e)||ld("Cannot "+n),cd=(e,t,n)=>(ud(e,t,"read from private field"),n?n.call(e):t.get(e)),dd=(e,t,n)=>t.has(e)?ld("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),hd=(e,t,n,r)=>(ud(e,t,"write to private field"),t.set(e,n),n);class fd extends a.BusEventWithPayload{}fd.type="new-scene-object-added";class pd{constructor(e={},t=o.locationService){this._options=e,this._locationService=t,this._paramsCache=new md(t),this._urlKeyMapper=new j({namespace:e.namespace,excludeFromNamespace:e.excludeFromNamespace})}initSync(e){var t;if(this._subs&&(q(0,0,null==(t=this._sceneRoot)||t.state.key),this._subs.unsubscribe()),q(0,0,e.state.key),this._sceneRoot=e,this._subs=new f.Subscription,this._subs.add(e.subscribeToEvent(E,(e=>{this.handleSceneObjectStateChanged(e.payload.changedObject)}))),this._subs.add(e.subscribeToEvent(fd,(e=>{this.handleNewObject(e.payload)}))),this._urlKeyMapper.clear(),this._lastLocation=this._locationService.getLocation(),this.handleNewObject(this._sceneRoot),this._options.updateUrlOnInit){const t=V(e,this._urlKeyMapper.getOptions());(function(e,t){for(let n in e)if(!z(t.getAll(n),e[n]))return!0;return!1})(t,this._paramsCache.getParams())&&this._locationService.partial(t,!0)}}cleanUp(e){this._sceneRoot===e&&(q(),this._subs&&(this._subs.unsubscribe(),this._subs=void 0,q(0,0,(this._sceneRoot.state.key,e.state.key))),this._sceneRoot=void 0,this._lastLocation=void 0)}handleNewLocation(e){this._sceneRoot&&this._lastLocation!==e&&(q(),this._lastLocation=e,$(this._sceneRoot,this._paramsCache.getParams(),this._urlKeyMapper))}handleNewObject(e){this._sceneRoot&&$(e,this._paramsCache.getParams(),this._urlKeyMapper)}handleSceneObjectStateChanged(e){var t,n;if(!e.urlSync)return;const r=e.urlSync.getUrlState(),i=this._locationService.getSearch(),a={};for(const[t,n]of Object.entries(r)){const r=this._urlKeyMapper.getUniqueKey(t,e);z(i.getAll(r),n)||(a[r]=n)}if(Object.keys(a).length>0){const i=!0!==(null==(n=(t=e.urlSync).shouldCreateHistoryStep)?void 0:n.call(t,r));q(),this._locationService.partial(a,i),this._lastLocation=this._locationService.getLocation()}}getUrlState(e){return V(e,this._urlKeyMapper.getOptions())}}class md{constructor(e){this.locationService=e,dd(this,od),dd(this,sd)}getParams(){const e=this.locationService.getLocation();return cd(this,sd)===e||(hd(this,sd,e),hd(this,od,new URLSearchParams(e.search))),cd(this,od)}}function gd(e,t={}){const n=(0,i.useLocation)(),r=Sn(),[a,o]=(0,c.useState)(!1),s=function(e,t){return(0,c.useMemo)((()=>new pd({updateUrlOnInit:e.updateUrlOnInit,createBrowserHistorySteps:e.createBrowserHistorySteps,namespace:e.namespace,excludeFromNamespace:e.excludeFromNamespace},t)),[e.updateUrlOnInit,e.createBrowserHistorySteps,e.namespace,e.excludeFromNamespace,t])}(t,r);return(0,c.useEffect)((()=>(s.initSync(e),o(!0),()=>s.cleanUp(e))),[e,s]),(0,c.useEffect)((()=>{const e=r.getLocation(),t=e!==n?e:n;e!==n&&q(),s.handleNewLocation(t)}),[e,s,n,r]),a}function vd({children:e,scene:t,updateUrlOnInit:n,createBrowserHistorySteps:r,namespace:i,excludeFromNamespace:a}){return gd(t,{updateUrlOnInit:n,createBrowserHistorySteps:r,namespace:i,excludeFromNamespace:a})?e:null}od=new WeakMap,sd=new WeakMap;class yd extends I{constructor(e){super(e),this.addActivationHandler((()=>{const e=function(e){const t=window.__grafanaSceneContext;return q(),window.__grafanaSceneContext=e,()=>{window.__grafanaSceneContext===e&&(q(),window.__grafanaSceneContext=t)}}(this);return()=>{e()}}))}}yd.Component=function({model:e}){const{body:t,controls:n}=e.useState(),r=(0,Gn.useStyles2)(bd);return h().createElement("div",{className:r.container},n&&h().createElement("div",{className:r.controls},n.map((e=>h().createElement(e.Component,{key:e.state.key,model:e})))),h().createElement("div",{className:r.body},h().createElement(t.Component,{model:t})))};const bd=e=>({container:(0,Qn.css)({flexGrow:1,display:"flex",gap:e.spacing(2),minHeight:"100%",flexDirection:"column"}),body:(0,Qn.css)({flexGrow:1,display:"flex",gap:e.spacing(1)}),controls:(0,Qn.css)({display:"flex",gap:e.spacing(2),alignItems:"flex-end",flexWrap:"wrap"})});class wd extends I{addItem(e){this.setState({items:this.state.items?[...this.state.items,e]:[e]})}setItems(e){this.setState({items:e})}}wd.Component=function({model:e}){const{items:t=[]}=e.useState(),n=h().useRef(null);(0,c.useEffect)((()=>{n.current&&n.current.focus()}),[]);const r=e=>e.map((e=>{switch(e.type){case"divider":return h().createElement(Gn.Menu.Divider,{key:e.text});case"group":return h().createElement(Gn.Menu.Group,{key:e.text,label:e.text},e.subMenu?r(e.subMenu):void 0);default:return h().createElement(Gn.Menu.Item,{key:e.text,role:"menuitem",label:e.text,icon:e.iconClassName,childItems:e.subMenu?r(e.subMenu):void 0,url:e.href,onClick:e.onClick,shortcut:e.shortcut,testId:Kn.Tp.components.Panels.Panel.menuItems(e.text)})}}));return h().createElement(Gn.Menu,{ref:n},r(t))};var Sd=function(){return Sd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Sd.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function xd(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={loading:!1});var r=(0,c.useRef)(0),i=function(){var e=(0,c.useRef)(!1),t=(0,c.useCallback)((function(){return e.current}),[]);return(0,c.useEffect)((function(){return e.current=!0,function(){e.current=!1}}),[]),t}(),a=(0,c.useState)(n),o=a[0],s=a[1],l=(0,c.useCallback)((function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var a=++r.current;return o.loading||s((function(e){return Sd(Sd({},e),{loading:!0})})),e.apply(void 0,t).then((function(e){return i()&&a===r.current&&s({value:e,loading:!1}),e}),(function(e){return i()&&a===r.current&&s({error:e,loading:!1}),e}))}),t);return[o,l]}(class extends I{constructor(e={}){super({options:e})}}).Component=function({model:e}){const{options:t}=e.useState(),{data:n}=lc.getData(e).useState(),{from:r,to:i}=lc.getTimeRange(e).useState(),{value:a}=function(e,t){void 0===t&&(t=[]);var n=xd(e,t,{loading:!0}),r=n[0],i=n[1];return(0,c.useEffect)((function(){i()}),[i]),r}((async()=>n?async function(e,t,n,r){var i,a,s,l;const u=null==(i=e.request)?void 0:i.targets;if(!u)return"";const{from:c,to:d}=n,h=null==(a=e.request)?void 0:a.filters,f={__sceneObject:Sr(t)},p=(await Promise.allSettled(u.map((async e=>{var t;const n=await(0,o.getDataSourceSrv)().get(e.datasource);return(null==(t=n.interpolateVariablesInQueries)?void 0:t.call(n,[e],null!=f?f:{},h)[0])||e})))).filter((e=>"fulfilled"===e.status)).map((e=>e.value)).map((e=>{var t;return null!=(t=null==r?void 0:r(e))?t:e})),m=null!=p?p:[];let g=new Set(m.map((e=>{var t;return null==(t=e.datasource)?void 0:t.uid}))).size>1?"-- Mixed --":null==(l=null==(s=m.find((e=>{var t;return!!(null==(t=e.datasource)?void 0:t.uid)})))?void 0:s.datasource)?void 0:l.uid;if((null==m?void 0:m.length)&&g&&c&&d)return`/explore?left=${encodeURIComponent(JSON.stringify({datasource:g,queries:m,range:{from:c,to:d}}))}`;return""}(n,e,{from:r,to:i},t.transform):""),[n,e,r,i]),s=(0,o.useReturnToPrevious)();if(a)return h().createElement(Gn.LinkButton,{key:"explore",icon:"compass",size:"sm",variant:"secondary",href:a,onClick:()=>{var e;t.returnToPrevious&&s(t.returnToPrevious.title,t.returnToPrevious.href),null==(e=t.onClick)||e.call(t)}},h().createElement(en,{i18nKey:"grafana-scenes.components.viz-panel-explore-button.explore"},"Explore"));return null};function Ed(e){return e instanceof jd}(class extends I{}).Component=function({model:e}){const{body:t}=e.useState(),n=e.parent;if(n&&(r=n,!(r instanceof Dd))&&!Ed(n))throw new Error("SceneGridItem must be a child of SceneGridLayout or SceneGridRow");var r;if(!t)return null;return h().createElement(t.Component,{model:t})};var _d=n(2548),Od=n.n(_d);const kd=(0,Qn.css)({flex:"1 1 auto",position:"relative",zIndex:1,width:"100%"}),Td=h().forwardRef(((e,t)=>{var n;const{grid:r,layoutItem:i,index:a,totalCount:o,isLazy:s,style:l,onLoad:u,onChange:c,children:d,...f}=e,p=r.getSceneLayoutChild(i.i),m=null==(n=p.getClassName)?void 0:n.call(p),g=h().createElement(p.Component,{model:p,key:p.state.key});return s?h().createElement(Vr,{...f,key:p.state.key,"data-griditem-key":p.state.key,className:(0,Qn.cx)(m,e.className),style:l,ref:t},g,d):h().createElement("div",{...f,ref:t,key:p.state.key,"data-griditem-key":p.state.key,className:(0,Qn.cx)(m,e.className),style:l},g,d)}));function Cd(e,t,n){e.current?t?e.current.classList.add("react-grid-layout--enable-move-animations"):e.current.classList.remove("react-grid-layout--enable-move-animations"):n||setTimeout((()=>Cd(e,t,!0)),50)}Td.displayName="GridItemWrapper";const Id=h().forwardRef((({handleAxis:e,...t},n)=>{const r=(0,Gn.useStyles2)(Rd);return h().createElement("div",{ref:n,...t,className:`${r} scene-resize-handle`},h().createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h().createElement("path",{d:"M21 15L15 21M21 8L8 21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})))}));function Rd(e){return(0,Qn.css)({position:"absolute",bottom:0,right:0,zIndex:999,padding:e.spacing(1.5,0,0,1.5),color:e.colors.border.strong,cursor:"se-resize","&:hover":{color:e.colors.text.link},svg:{display:"block"},".react-resizable-hide &":{display:"none"}})}Id.displayName="ResizeHandle";class Ad extends a.BusEventWithPayload{}Ad.type="scene-grid-layout-drag-start";const Nd=class e extends I{constructor(e){super({...e,children:Pd(e.children)}),this._skipOnLayoutChange=!1,this._oldLayout=[],this._loadOldLayout=!1,this.onLayoutChange=e=>{if(this._skipOnLayoutChange)this._skipOnLayoutChange=!1;else{this._loadOldLayout&&(e=[...this._oldLayout],this._loadOldLayout=!1);for(const t of e){const e=this.getSceneLayoutChild(t.i),n={x:t.x,y:t.y,width:t.w,height:t.h};Ld(e.state,n)||e.setState({...n})}this.setState({children:Pd(this.state.children)})}},this.onResizeStop=(e,t,n)=>{this.getSceneLayoutChild(n.i).setState({width:n.w,height:n.h})},this.onDragStart=e=>{this._oldLayout=[...e]},this.onDragStop=(e,t,n)=>{const r=this.getSceneLayoutChild(n.i),i=(e=Md(e)).findIndex((e=>e.i===n.i));let a=this.findGridItemSceneParent(e,i-1),o=this.state.children;for(let t=0;t<e.length;t++){const n=e[t],r=this.getSceneLayoutChild(n.i),i=r.state;(null==i?void 0:i.x)===n.x&&(null==i?void 0:i.y)===n.y||r.setState({x:n.x,y:n.y})}a instanceof jd&&xn(a)&&(this._loadOldLayout=!0),r instanceof jd&&a instanceof jd&&(this.isRowDropValid(e,n,i)||(this._loadOldLayout=!0),a=this),a===r.parent||this._loadOldLayout||(o=this.moveChildTo(r,a)),this.setState({children:Pd(o)}),this._skipOnLayoutChange=!0}}isDraggable(){var e;return null!=(e=this.state.isDraggable)&&e}getDragClass(){return`grid-drag-handle-${this.state.key}`}getDragClassCancel(){return"grid-drag-cancel"}getDragHooks(){return{onDragStart:(e,t)=>{this.publishEvent(new Ad({evt:e,panel:t}),!0)}}}adjustYPositions(e,t){for(const n of this.state.children)if(n.state.y>e&&n.setState({y:n.state.y+t}),n instanceof jd)for(const r of n.state.children)r.state.y>e&&r.setState({y:r.state.y+t})}toggleRow(e){var t,n;if(!e.state.isCollapsed)return e.setState({isCollapsed:!0}),void this.setState({});const r=e.state.children;if(0===r.length)return e.setState({isCollapsed:!1}),void this.setState({});const i=e.state.y,a=(null!=(t=r[0].state.y)?t:i)-(i+1);let o=i;for(const e of r){const t={...e.state};t.y=null!=(n=t.y)?n:i,t.y-=a,t.y!==e.state.y&&e.setState(t),o=Math.max(o,Number(t.y)+Number(t.height))}const s=o-i-1;for(const t of this.state.children)if(t.state.y>i&&this.pushChildDown(t,s),Ed(t)&&t!==e)for(const e of t.state.children)e.state.y>i&&this.pushChildDown(e,s);e.setState({isCollapsed:!1}),this.setState({})}ignoreLayoutChange(e){this._skipOnLayoutChange=e}getSceneLayoutChild(e){for(const t of this.state.children){if(t.state.key===e)return t;if(t instanceof jd)for(const n of t.state.children)if(n.state.key===e)return n}throw new Error("Scene layout child not found for GridItem")}pushChildDown(e,t){e.setState({y:e.state.y+t})}findGridItemSceneParent(e,t){for(let n=t;n>=0;n--){const t=e[n],r=this.getSceneLayoutChild(t.i);if(r instanceof jd)return r.state.isCollapsed?this:r}return this}isRowDropValid(t,n,r){if(t[t.length-1].i===n.i)return!0;const i=this.getSceneLayoutChild(t[r+1].i);return i instanceof jd||i.parent instanceof e}moveChildTo(t,n){const r=t.parent;let i=this.state.children;const a=t.clone({key:t.state.key});if(r instanceof jd){const e=r.clone();if(e.setState({children:e.state.children.filter((e=>e.state.key!==t.state.key))}),i=i.map((t=>t===r?e:t)),n instanceof jd){const e=n.clone();e.setState({children:[...e.state.children,a]}),i=i.map((t=>t===n?e:t))}else i=[...i,a]}else if(!(n instanceof e)){i=i.filter((e=>e.state.key!==t.state.key));const e=n.clone();e.setState({children:[...e.state.children,a]}),i=i.map((t=>t===n?e:t))}return i}toGridCell(e){const t=e.state;let n=Number.isFinite(Number(t.x))?Number(t.x):0,r=Number.isFinite(Number(t.y))?Number(t.y):0;const i=Number.isFinite(Number(t.width))?Number(t.width):4,a=Number.isFinite(Number(t.height))?Number(t.height):4;let o=e.state.isDraggable,s=e.state.isResizable;return e instanceof jd&&(o=!!e.state.isCollapsed,s=!1),xn(e)&&(o=!1,s=!1),{i:e.state.key,x:n,y:r,h:a,w:i,isResizable:s,isDraggable:o}}buildGridLayout(e,t){let n=[];for(const e of this.state.children)if(n.push(this.toGridCell(e)),e instanceof jd&&!e.state.isCollapsed)for(const t of e.state.children)n.push(this.toGridCell(t));return n=Md(n),this.state.UNSAFE_fitPanels&&(n=function(e,t){const n=t-32,r=Math.max(...e.map((e=>e.h+e.y)))/Math.floor(n/38);return e.map((e=>({...e,y:Math.round(e.y/r)||0,h:Math.round(e.h/r)||1})))}(n,t)),e<768?(this._skipOnLayoutChange=!0,n.map((e=>({...e,w:24})))):(this._skipOnLayoutChange=!1,n)}};Nd.Component=function({model:e}){const{children:t,isLazy:n,isDraggable:r,isResizable:i}=e.useState(),[a,{width:o,height:s}]=Lr(),l=(0,c.useRef)(null);return(0,c.useEffect)((()=>{Cd(l,!!r)}),[r]),function(e){if(e.some((e=>void 0===e.state.height||void 0===e.state.width||void 0===e.state.x||void 0===e.state.y)))throw new Error("All children must have a size specified")}(t),h().createElement("div",{ref:a,className:kd},((t,a)=>{if(!t||!a)return null;const o=e.buildGridLayout(t,a);return h().createElement("div",{ref:l,style:{width:`${t}px`,height:"100%"},className:"react-grid-layout"},h().createElement(Od(),{width:t,isDraggable:r&&t>768,isResizable:null!=i&&i,containerPadding:[0,0],useCSSTransforms:!0,margin:[8,8],cols:24,rowHeight:30,draggableHandle:`.grid-drag-handle-${e.state.key}`,draggableCancel:".grid-drag-cancel",layout:o,onDragStart:e.onDragStart,onDragStop:e.onDragStop,onResizeStop:e.onResizeStop,onLayoutChange:e.onLayoutChange,isBounded:!1,resizeHandle:h().createElement(Id,null)},o.map(((t,r)=>h().createElement(Td,{key:t.i,grid:e,layoutItem:t,index:r,isLazy:n,totalCount:o.length})))))})(o,s))};let Dd=Nd;function Ld(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Pd(e){return e.forEach((e=>{e instanceof jd&&e.setState({children:Pd(e.state.children)})})),[...e].sort(((e,t)=>e.state.y-t.state.y||e.state.x-t.state.x))}function Md(e){return[...e].sort(((e,t)=>e.y-t.y||e.x-t.x))}class jd extends I{constructor(e){super({children:e.children||[],isCollapsible:e.isCollapsible||!0,title:e.title||"",...e,x:0,height:1,width:24}),this._variableDependency=new Mu(this,{statePaths:["title"],handleTimeMacros:!0}),this.onCollapseToggle=()=>{this.state.isCollapsible&&this.getGridLayout().toggleRow(this)}}getGridLayout(){const e=this.parent;if(!(e&&e instanceof Dd))throw new Error("SceneGridRow must be a child of SceneGridLayout");return e}getUrlState(){return{rowc:this.state.isCollapsed?"1":"0"}}updateFromUrl(e){null!=e.rowc&&e.rowc!==this.getUrlState().rowc&&this.onCollapseToggle()}getPanelCount(e){var t;let n=0;for(const r of e)n+=(null==(t=r.getChildCount)?void 0:t.call(r))||1;return n}}jd.Component=function({model:e}){const t=(0,Gn.useStyles2)(Fd),{isCollapsible:n,isCollapsed:r,title:i,actions:a,children:o}=e.useState(),s=e.getGridLayout(),l=s.getDragClass(),u=s.isDraggable()&&!xn(e),c=e.getPanelCount(o),d=1===c?"panel":"panels";return h().createElement("div",{className:(0,Qn.cx)(t.row,r&&t.rowCollapsed)},h().createElement("div",{className:t.rowTitleAndActionsGroup},h().createElement("button",{onClick:e.onCollapseToggle,className:t.rowTitleButton,"aria-label":r?Zt("grafana-scenes.components.scene-grid-row.expand-row","Expand row"):Zt("grafana-scenes.components.scene-grid-row.collapse-row","Collapse row"),"data-testid":Kn.Tp.components.DashboardRow.title(lc.interpolate(e,i,void 0,"text"))},n&&h().createElement(Gn.Icon,{name:r?"angle-right":"angle-down"}),h().createElement("span",{className:t.rowTitle,role:"heading"},lc.interpolate(e,i,void 0,"text"))),h().createElement("span",{className:(0,Qn.cx)(t.panelCount,r&&t.panelCountCollapsed)},"(",c," ",d,")"),a&&h().createElement("div",{className:t.rowActions},h().createElement(a.Component,{model:a}))),u&&r&&h().createElement("div",{className:(0,Qn.cx)(t.dragHandle,l)},h().createElement(Gn.Icon,{name:"draggabledots"})))};const Fd=e=>({row:(0,Qn.css)({width:"100%",height:"30px",display:"flex",justifyContent:"space-between",gap:e.spacing(1)}),rowTitleButton:(0,Qn.css)({display:"flex",alignItems:"center",cursor:"pointer",background:"transparent",border:"none",minWidth:0,gap:e.spacing(1)}),rowCollapsed:(0,Qn.css)({borderBottom:`1px solid ${e.colors.border.weak}`}),rowTitle:(0,Qn.css)({fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",flexGrow:1,minWidth:0}),collapsedInfo:(0,Qn.css)({fontSize:e.typography.bodySmall.fontSize,color:e.colors.text.secondary,display:"flex",alignItems:"center",flexGrow:1}),rowTitleAndActionsGroup:(0,Qn.css)({display:"flex",minWidth:0,"&:hover, &:focus-within":{"& > div":{opacity:1}}}),rowActions:(0,Qn.css)({display:"flex",whiteSpace:"nowrap",opacity:0,transition:"200ms opacity ease-in 200ms","&:hover, &:focus-within":{opacity:1}}),dragHandle:(0,Qn.css)({display:"flex",padding:e.spacing(0,1),alignItems:"center",justifyContent:"flex-end",cursor:"move",color:e.colors.text.secondary,"&:hover":{color:e.colors.text.primary}}),panelCount:(0,Qn.css)({whiteSpace:"nowrap",paddingLeft:e.spacing(2),color:e.colors.text.secondary,fontStyle:"italic",fontSize:e.typography.size.sm,fontWeight:"normal",display:"none",lineHeight:"30px"}),panelCountCollapsed:(0,Qn.css)({display:"inline-block"})});(class extends I{constructor(){super(...arguments),this.onToggle=()=>{this.setState({isCollapsed:!this.state.isCollapsed})},this.onRemove=()=>{const e=this.parent;"body"in e.state&&e.setState({body:void 0})}}}).Component=function({model:e}){const{title:t,isCollapsed:n,canCollapse:r,canRemove:i,body:a,controls:o}=e.useState(),s=(0,Gn.useStyles2)(Fd),l=(0,Gn.useStyles2)(Vd),u=(null!=o?o:[]).map((e=>h().createElement(e.Component,{key:e.state.key,model:e})));i&&u.push(h().createElement(Gn.ToolbarButton,{icon:"times",variant:"default",onClick:e.onRemove,key:"remove-button","aria-label":Zt("grafana-scenes.components.nested-scene-renderer.remove-button-label","Remove scene")}));return h().createElement("div",{className:l.wrapper},h().createElement("div",{className:(0,Qn.cx)(l.row,n&&l.rowCollapsed)},h().createElement("button",{onClick:e.onToggle,className:s.rowTitleButton,"aria-label":n?Zt("grafana-scenes.components.nested-scene-renderer.expand-button-label","Expand scene"):Zt("grafana-scenes.components.nested-scene-renderer.collapse-button-label","Collapse scene")},r&&h().createElement(Gn.Icon,{name:n?"angle-right":"angle-down"}),h().createElement("span",{className:s.rowTitle,role:"heading"},lc.interpolate(e,t,void 0,"text"))),h().createElement("div",{className:l.actions},u)),!n&&h().createElement(a.Component,{model:a}))};const Vd=e=>({wrapper:(0,Qn.css)({display:"flex",flexDirection:"column",flexGrow:1,gap:e.spacing(1)}),row:(0,Qn.css)({width:"100%",display:"flex",justifyContent:"space-between",gap:e.spacing(1)}),rowCollapsed:(0,Qn.css)({borderBottom:`1px solid ${e.colors.border.weak}`,paddingBottom:e.spacing(1)}),actions:(0,Qn.css)({display:"flex",alignItems:"center",gap:e.spacing(1),justifyContent:"flex-end",flexGrow:1})});(class extends I{constructor(){super(...arguments),this._variableDependency=new Mu(this,{statePaths:["text"]})}}).Component=function({model:e}){const{text:t,fontSize:n=20,align:r="left",key:i,spacing:a}=e.useState(),o=(0,Gn.useTheme2)(),s=(0,Qn.css)({fontSize:n,display:"flex",flexGrow:1,alignItems:"center",padding:a?o.spacing(a,0):void 0,justifyContent:r});return h().createElement("div",{className:s,"data-testid":i},lc.interpolate(e,t))};(class extends I{}).Component=({model:e})=>{const t=e.useState();return h().createElement(Gn.ToolbarButton,{onClick:t.onClick,icon:t.icon})};(class extends I{}).Component=({model:e})=>{const t=e.useState();return h().createElement("div",{style:{display:"flex"}},t.label&&h().createElement(yi,{label:t.label}),h().createElement(Gn.Input,{defaultValue:t.value,width:8,onBlur:t=>{e.state.onChange(parseInt(t.currentTarget.value,10))}}))};const $d=function(e,t,n){if(!Ar)return[t,Rr,Rr];if(!e)throw new Error("useLocalStorage key may not be falsy");var r=n?n.raw?function(e){return e}:n.deserializer:JSON.parse,i=(0,c.useRef)((function(e){try{var i=n?n.raw?String:n.serializer:JSON.stringify,a=localStorage.getItem(e);return null!==a?r(a):(t&&localStorage.setItem(e,i(t)),t)}catch(e){return t}})),a=(0,c.useState)((function(){return i.current(e)})),o=a[0],s=a[1];(0,c.useLayoutEffect)((function(){return s(i.current(e))}),[e]);var l=(0,c.useCallback)((function(t){try{var i="function"==typeof t?t(o):t;if(void 0===i)return;var a=void 0;a=n?n.raw?"string"==typeof i?i:JSON.stringify(i):n.serializer?n.serializer(i):JSON.stringify(i):JSON.stringify(i),localStorage.setItem(e,a),s(r(a))}catch(e){}}),[e,s]),u=(0,c.useCallback)((function(){try{localStorage.removeItem(e),s(void 0)}catch(e){}}),[e,s]);return[o,l,u]};class Bd extends I{constructor(){super(...arguments),this.onZoom=()=>{const e=lc.getTimeRange(this),t=function(e,t){const n=e.to.valueOf()-e.from.valueOf(),r=e.to.valueOf()-n/2,i=0===n?3e4:n*t,o=r+i/2,s=r-i/2;return{from:(0,a.toUtc)(s),to:(0,a.toUtc)(o),raw:{from:(0,a.toUtc)(s),to:(0,a.toUtc)(o)}}}(e.state.value,2);e.onTimeRangeChange(t)},this.onChangeFiscalYearStartMonth=e=>{lc.getTimeRange(this).setState({fiscalYearStartMonth:e})},this.toAbsolute=()=>{const e=lc.getTimeRange(this),t=e.state.value,n=(0,a.toUtc)(t.from),r=(0,a.toUtc)(t.to);e.onTimeRangeChange({from:n,to:r,raw:{from:n,to:r}})},this.onMoveBackward=()=>{const e=lc.getTimeRange(this),{state:{value:t}}=e;e.onTimeRangeChange(zd(0,t))},this.onMoveForward=()=>{const e=lc.getTimeRange(this),{state:{value:t}}=e;e.onTimeRangeChange(zd(1,t,Date.now()))}}}function zd(e,t,n){const r=t.to.valueOf(),i=t.from.valueOf(),o=(r-i)/2;let s,l;0===e?(s=i-o,l=r-o):(s=i+o,l=r+o,void 0!==n&&l>n&&r<n&&(l=n,s=i));const u=(0,a.toUtc)(s),c=(0,a.toUtc)(l);return{from:u,to:c,raw:{from:u,to:c}}}Bd.Component=function({model:e}){const{hidePicker:t,isOnCanvas:n,quickRanges:r,defaultQuickRanges:i}=e.useState(),o=lc.getTimeRange(e),s=o.getTimeZone(),l=o.useState(),[u,c]=$d(Ud,[],{raw:!1,serializer:Hd,deserializer:qd});if(t)return null;const d=r||i,f=(l.value.to.valueOf()-l.value.from.valueOf())/2,p=(0,a.intervalToAbbreviatedDurationString)({start:new Date(l.value.from.valueOf()),end:new Date(l.value.from.valueOf()+f)}),m=l.value.to.valueOf()+f<=Date.now()?p:void 0;return h().createElement(Gn.TimeRangePicker,{isOnCanvas:null==n||n,value:l.value,onChange:e=>{var t;t=e,((0,a.isDateTime)(t.raw.from)||(0,a.isDateTime)(t.raw.to))&&c([e,...null!=u?u:[]]),o.onTimeRangeChange(e)},timeZone:s,fiscalYearStartMonth:l.fiscalYearStartMonth,onMoveBackward:e.onMoveBackward,onMoveForward:e.onMoveForward,moveForwardTooltip:m?Zt("grafana-scenes.components.time-picker.move-forward-tooltip","Move {{moveForwardDuration}} forward",{moveForwardDuration:m}):void 0,moveBackwardTooltip:Zt("grafana-scenes.components.time-picker.move-backward-tooltip","Move {{moveBackwardDuration}} backward",{moveBackwardDuration:p}),onZoom:e.onZoom,onChangeTimeZone:o.onTimeZoneChange,onChangeFiscalYearStartMonth:e.onChangeFiscalYearStartMonth,weekStart:l.weekStart,history:u,quickRanges:d})};const Ud="grafana.dashboard.timepicker.history";function qd(e){return JSON.parse(e).map((e=>a.rangeUtil.convertRawToRange(e,"utc",void 0,"YYYY-MM-DD HH:mm:ss")))}function Hd(e){return JSON.stringify((t=e.map((e=>({from:"string"==typeof e.raw.from?e.raw.from:e.raw.from.toISOString(),to:"string"==typeof e.raw.to?e.raw.to:e.raw.to.toISOString()}))),(0,N.uniqBy)(t,(e=>e.from+e.to)).slice(0,4)));var t}const Wd=["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"];class Gd extends I{constructor(e){var t,n,r;super({refresh:"",...e,autoValue:void 0,autoEnabled:null==(t=e.autoEnabled)||t,autoMinInterval:null!=(n=e.autoMinInterval)?n:o.config.minRefreshInterval,intervals:(null!=(r=e.intervals)?r:Wd).filter((t=>{var n;const r=null!=(n=e.minRefreshInterval)?n:o.config.minRefreshInterval;try{return!r||a.rangeUtil.intervalToMs(t)>=a.rangeUtil.intervalToMs(r)}catch(e){return!1}}))}),this._urlSync=new Y(this,{keys:["refresh"]}),this._autoRefreshBlocked=!1,this.onRefresh=()=>{const e=lc.getQueryController(this);if(null==e?void 0:e.state.isRunning)return e.cancelAll(),void e.cancelProfile();null==e||e.startProfile(re);const t=lc.getTimeRange(this);this._intervalTimer&&clearInterval(this._intervalTimer),t.onRefresh(),this.setupIntervalTimer()},this.onIntervalChanged=e=>{this.setState({refresh:e}),this.setupIntervalTimer()},this.setupAutoTimeRangeListener=()=>lc.getTimeRange(this).subscribeToState(((e,t)=>{e.from===t.from&&e.to===t.to||this.setupIntervalTimer()})),this.calculateAutoRefreshInterval=()=>{var e;const t=lc.getTimeRange(this),n=null!=(e=null==window?void 0:window.innerWidth)?e:2e3;return a.rangeUtil.calculateInterval(t.state.value,n,this.state.autoMinInterval)},this.setupIntervalTimer=()=>{var e;const t=lc.getTimeRange(this),{refresh:n,intervals:r}=this.state;if((this._intervalTimer||""===n)&&clearInterval(this._intervalTimer),""===n)return;if(n!==Gn.RefreshPicker.autoOption.value&&r&&!r.includes(n))return;let i;if(null==(e=this._autoTimeRangeListener)||e.unsubscribe(),n===Gn.RefreshPicker.autoOption.value){const e=this.calculateAutoRefreshInterval();i=e.intervalMs,this._autoTimeRangeListener=this.setupAutoTimeRangeListener(),e.interval!==this.state.autoValue&&this.setState({autoValue:e.interval})}else i=a.rangeUtil.intervalToMs(n);this._intervalTimer=setInterval((()=>{if(this.isTabVisible()){const e=lc.getQueryController(this);(null==e?void 0:e.state.isRunning)&&e.cancelProfile(),null==e||e.startProfile(re),t.onRefresh()}else this._autoRefreshBlocked=!0}),i)},this.addActivationHandler((()=>{this.setupIntervalTimer();const e=()=>{this._autoRefreshBlocked&&"visible"===document.visibilityState&&(this._autoRefreshBlocked=!1,this.onRefresh())};return document.addEventListener("visibilitychange",e),()=>{var t;this._intervalTimer&&clearInterval(this._intervalTimer),document.removeEventListener("visibilitychange",e),null==(t=this._autoTimeRangeListener)||t.unsubscribe()}}))}getUrlState(){let e=this.state.refresh;return"string"==typeof e&&0!==e.length||(e=void 0),{refresh:e}}updateFromUrl(e){const{intervals:t}=this.state;let n=e.refresh;"string"==typeof n&&function(e){try{return a.rangeUtil.describeInterval(e).count>0}catch(e){return!1}}(n)&&((null==t?void 0:t.includes(n))?this.setState({refresh:n}):this.setState({refresh:t?t[0]:void 0}))}isTabVisible(){return void 0===document.visibilityState||"visible"===document.visibilityState}}Gd.Component=function({model:e}){var t;const{refresh:n,intervals:r,autoEnabled:i,autoValue:a,isOnCanvas:o,primary:s,withText:l}=e.useState(),u=function(e){const t=lc.getQueryController(e);if(!t)return!1;return t.useState().isRunning}(e);let c,d,f=n===(null==(t=Gn.RefreshPicker.autoOption)?void 0:t.value)?a:l?Zt("grafana-scenes.components.scene-refresh-picker.text-refresh","Refresh"):void 0;u&&(c=Zt("grafana-scenes.components.scene-refresh-picker.tooltip-cancel","Cancel all queries"),l&&(f=Zt("grafana-scenes.components.scene-refresh-picker.text-cancel","Cancel")));l&&(d="96px");return h().createElement(Gn.RefreshPicker,{showAutoInterval:i,value:n,intervals:r,tooltip:c,width:d,text:f,onRefresh:()=>{e.onRefresh()},primary:s,onIntervalChanged:e.onIntervalChanged,isLoading:u,isOnCanvas:null==o||o})};const Kd=e=>`${e}-compare`,Qd="__previousPeriod",Yd="__noPeriod",Xd={label:"Previous period",value:Qd},Jd={label:"None",value:Yd},Zd=[{label:"Day before",value:"24h"},{label:"Week before",value:"1w"},{label:"Month before",value:"1M"}];(class extends I{constructor(e){super({compareOptions:Zd,...e}),this._urlSync=new Y(this,{keys:["compareWith"]}),this._onActivate=()=>{const e=lc.getTimeRange(this);this.setState({compareOptions:this.getCompareOptions(e.state.value)}),this._subs.add(e.subscribeToState((e=>{const t=this.getCompareOptions(e.value),n={compareOptions:t};Boolean(this.state.compareWith)&&!t.find((({value:e})=>e===this.state.compareWith))&&(n.compareWith=Qd),this.setState(n)})))},this.getCompareOptions=e=>{const t=Math.ceil(e.to.diff(e.from)),n=Zd.findIndex((({value:e})=>a.rangeUtil.intervalToMs(e)>=t));return[Jd,Xd,...Zd.slice(n).map((({label:e,value:t})=>({label:e,value:t})))]},this.onCompareWithChanged=e=>{e===Yd?this.onClearCompare():this.setState({compareWith:e})},this.onClearCompare=()=>{this.setState({compareWith:void 0})},this.addActivationHandler(this._onActivate)}getExtraQueries(e){const t=[],n=this.getCompareTimeRange(e.range);if(!n)return t;const r=e.targets.filter((e=>!1!==e.timeRangeCompare));return r.length&&t.push({req:{...e,targets:r,range:n},processor:eh}),t}shouldRerun(e,t,n){return e.compareWith!==t.compareWith&&void 0!==n.find((e=>!1!==e.timeRangeCompare))}getCompareTimeRange(e){let t,n;if(this.state.compareWith){if(this.state.compareWith===Qd){const r=e.to.diff(e.from);t=(0,a.dateTime)(e.from).subtract(r),n=(0,a.dateTime)(e.to).subtract(r)}else t=(0,a.dateTime)(e.from).subtract(a.rangeUtil.intervalToMs(this.state.compareWith)),n=(0,a.dateTime)(e.to).subtract(a.rangeUtil.intervalToMs(this.state.compareWith));return{from:t,to:n,raw:{from:t,to:n}}}}getUrlState(){return{compareWith:this.state.compareWith}}updateFromUrl(e){if(!e.compareWith)return;const t=Z(e.compareWith);if(t){this.getCompareOptions(lc.getTimeRange(this).state.value).find((({value:e})=>e===t))?this.setState({compareWith:t}):this.setState({compareWith:"__previousPeriod"})}}}).Component=function({model:e}){var t;const n=(0,Gn.useStyles2)(th),{compareWith:r,compareOptions:i,hideCheckbox:a}=e.useState(),[o,s]=h().useState(r),l=null!=(t=i.find((({value:e})=>e===o)))?t:Xd,u=i.find((({value:e})=>e===r)),c=Boolean(u),d=()=>{c?(s(r),e.onClearCompare()):c||e.onCompareWithChanged(l.value)},f=a&&!r?Jd:u,p=a||c,m=a&&f?{...f,label:`Comparison: ${f.label}`}:f;return h().createElement(Gn.ButtonGroup,null,!a&&h().createElement(Gn.ToolbarButton,{variant:"canvas",tooltip:Zt("grafana-scenes.components.scene-time-range-compare-renderer.button-tooltip","Enable time frame comparison"),onClick:e=>{e.stopPropagation(),e.preventDefault(),d()}},h().createElement(Gn.Checkbox,{label:" ",value:c,onClick:d}),h().createElement(en,{i18nKey:"grafana-scenes.components.scene-time-range-compare-renderer.button-label"},"Comparison")),p?h().createElement(Gn.ButtonSelect,{variant:"canvas",value:m,options:i,onChange:t=>{e.onCompareWithChanged(t.value)}}):h().createElement(Gn.ToolbarButton,{className:n.previewButton,disabled:!0,variant:"canvas",isOpen:!1},l.label))};const eh=(e,t)=>{const n=t.timeRange.from.diff(e.timeRange.from);return t.series.forEach((e=>{e.refId=Kd(e.refId||""),e.meta={...e.meta,timeCompare:{diffMs:n,isTimeShiftQuery:!0}}})),(0,f.of)(t)};function th(e){return{previewButton:(0,Qn.css)({"&:disabled":{border:`1px solid ${e.colors.secondary.border}`,color:e.colors.text.disabled,opacity:1}})}}(class extends I{constructor(e){super(e),this.addActivationHandler((()=>{const e=lc.getData(this);this._subs.add(e.subscribeToState((e=>{var t;(null==(t=e.data)?void 0:t.state)===a.LoadingState.Done&&this.performRepeat(e.data)}))),e.state.data&&this.performRepeat(e.state.data)}))}performRepeat(e){const t=[];for(let n=0;n<e.series.length;n++){const r=this.state.getLayoutChild(e,e.series[n],n);t.push(r)}this.state.body.setState({children:t})}}).Component=({model:e})=>{const{body:t}=e.useState();return h().createElement(t.Component,{model:t})};(class extends I{constructor(e){super(e),this._variableDependency=new Mu(this,{variableNames:[this.state.variableName],onVariableUpdateCompleted:()=>this.performRepeat()}),this.addActivationHandler((()=>this.performRepeat()))}performRepeat(){if(this._variableDependency.hasDependencyInLoadingState())return;const e=lc.lookupVariable(this.state.variableName,this);if(!(e instanceof En))return void console.error("SceneByVariableRepeater: variable is not a MultiValueVariable");const t=function(e){const{value:t,text:n,options:r}=e.state;if(e.hasAllValue())return r;if(Array.isArray(t)&&Array.isArray(n))return t.map(((e,t)=>({value:e,label:n[t]})));return[{value:t,label:n}]}(e),n=[];for(const e of t){const t=this.state.getLayoutChild(e);n.push(t)}this.state.body.setState({children:n})}}).Component=({model:e})=>{const{body:t}=e.useState();return h().createElement(t.Component,{model:t})};(class extends I{constructor(){super({}),this._renderBeforeActivation=!0}}).Component=e=>h().createElement("div",{style:{flexGrow:1}});class nh extends I{toggleDirection(){this.setState({direction:"row"===this.state.direction?"column":"row"})}isDraggable(){return!1}}nh.Component=function({model:e,parentState:t}){const{children:n,isHidden:r}=e.useState(),i=function(e,t){return(0,c.useMemo)((()=>{var n,r,i,a,s,l,u,c,d,h;const{direction:f="row",wrap:p}=e,m=o.config.theme2,g={};return t?ih(g,e,t):(g.display="flex",g.flexGrow=1,g.minWidth=e.minWidth,g.minHeight=e.minHeight),g.flexDirection=f,g.gap="8px",g.flexWrap=p||"nowrap",g.alignContent="baseline",g.minWidth=g.minWidth||0,g.minHeight=g.minHeight||0,g[m.breakpoints.down("md")]={flexDirection:null!=(r=null==(n=e.md)?void 0:n.direction)?r:"column",maxWidth:null!=(a=null==(i=e.md)?void 0:i.maxWidth)?a:"unset",maxHeight:null!=(l=null==(s=e.md)?void 0:s.maxHeight)?l:"unset",height:null!=(c=null==(u=e.md)?void 0:u.height)?c:"unset",width:null!=(h=null==(d=e.md)?void 0:d.width)?h:"unset"},(0,Qn.css)(g)}),[t,e])}(e.state,t);if(r)return null;return h().createElement("div",{className:i},n.map((t=>{const n=t.Component;return h().createElement(n,{key:t.state.key,model:t,parentState:e.state})})))};class rh extends I{}function ih(e,t,n){var r,i,a;const o=null!=(r=n.direction)?r:"row",{xSizing:s="fill",ySizing:l="fill"}=t;return e.display="flex",e.position="relative",e.flexDirection=o,"column"===o?(t.height?e.height=t.height:e.flexGrow="fill"===l?1:0,t.width?e.width=t.width:e.alignSelf="fill"===s?"stretch":"flex-start"):(t.height?e.height=t.height:e.alignSelf="fill"===l?"stretch":"flex-start",t.width?e.width=t.width:e.flexGrow="fill"===s?1:0,t.wrap&&(e.flexWrap=t.wrap,"nowrap"!==t.wrap&&("row"===o?e.rowGap="8px":e.columnGap="8px"))),e.minWidth=t.minWidth,e.maxWidth=t.maxWidth,e.maxHeight=t.maxHeight,e.minHeight=null!=(i=t.minHeight)?i:n.minHeight,e.height=null!=(a=t.height)?a:n.height,e}rh.Component=function({model:e,parentState:t}){if(!t)throw new Error("SceneFlexItem must be a child of SceneFlexLayout");const{body:n,isHidden:r}=e.useState(),i=function(e,t){return(0,c.useMemo)((()=>{var n,r,i,a,s,l,u,c,d,h;const f=o.config.theme2,p=ih({},e,t);return p[f.breakpoints.down("md")]={maxWidth:null!=(r=null==(n=e.md)?void 0:n.maxWidth)?r:"unset",maxHeight:null!=(a=null==(i=e.md)?void 0:i.maxHeight)?a:"unset",height:null!=(u=null==(s=e.md)?void 0:s.height)?u:null==(l=t.md)?void 0:l.height,width:null!=(h=null==(c=e.md)?void 0:c.width)?h:null==(d=t.md)?void 0:d.width},(0,Qn.css)(p)}),[e,t])}(e.state,t);if(!n||r)return null;return h().createElement("div",{className:i},h().createElement(n.Component,{model:n}))};class ah extends I{constructor(e){var t,n;super({rowGap:1,columnGap:1,templateColumns:"repeat(auto-fit, minmax(400px, 1fr))",autoRows:null!=(t=e.autoRows)?t:"320px",children:null!=(n=e.children)?n:[],...e})}isDraggable(){return!1}}ah.Component=function({model:e}){const{children:t,isHidden:n,isLazy:r}=e.useState(),i=(a=e.state,(0,c.useMemo)((()=>{var e,t,n,r,i,s,l,u,c,d,h;const f={},p=o.config.theme2;return f.display="grid",f.gridTemplateColumns=a.templateColumns,f.gridTemplateRows=a.templateRows||"unset",f.gridAutoRows=a.autoRows||"unset",f.rowGap=p.spacing(null!=(e=a.rowGap)?e:1),f.columnGap=p.spacing(null!=(t=a.columnGap)?t:1),f.justifyItems=a.justifyItems||"unset",f.alignItems=a.alignItems||"unset",f.justifyContent=a.justifyContent||"unset",f.flexGrow=1,a.md&&(f[p.breakpoints.down("md")]={gridTemplateRows:null==(n=a.md)?void 0:n.templateRows,gridTemplateColumns:null==(r=a.md)?void 0:r.templateColumns,rowGap:a.md.rowGap?p.spacing(null!=(s=null==(i=a.md)?void 0:i.rowGap)?s:1):void 0,columnGap:a.md.columnGap?p.spacing(null!=(u=null==(l=a.md)?void 0:l.rowGap)?u:1):void 0,justifyItems:null==(c=a.md)?void 0:c.justifyItems,alignItems:null==(d=a.md)?void 0:d.alignItems,justifyContent:null==(h=a.md)?void 0:h.justifyContent}),(0,Qn.css)(f)}),[a]));var a;if(n)return null;return h().createElement("div",{className:i},t.map((t=>{const n=t.Component;return r?h().createElement(Vr,{key:t.state.key,className:i},h().createElement(n,{key:t.state.key,model:t,parentState:e.state})):h().createElement(n,{key:t.state.key,model:t,parentState:e.state})})))};class oh extends I{}oh.Component=function({model:e,parentState:t}){if(!t)throw new Error("SceneCSSGridItem must be a child of SceneCSSGridLayout");const{body:n,isHidden:r}=e.useState(),i=(a=e.state,(0,c.useMemo)((()=>{const e={};return e.gridColumn=a.gridColumn||"unset",e.gridRow=a.gridRow||"unset",e.position="relative",(0,Qn.css)(e)}),[a]));var a;if(!n||r)return null;return h().createElement("div",{className:i},h().createElement(n.Component,{model:n}))};const sh=.3,lh=new Set(["ArrowUp","ArrowDown"]),uh=new Set(["ArrowLeft","ArrowRight"]),ch={row:{dim:"width",axis:"clientX",min:"minWidth",max:"maxWidth"},column:{dim:"height",axis:"clientY",min:"minHeight",max:"maxHeight"}};function dh({direction:e="row",handleSize:t=32,initialSize:n="auto",primaryPaneStyles:r,secondaryPaneStyles:i,onDragFinished:a,children:o}){const s=h().Children.toArray(o),l=(0,c.useRef)(null),u=(0,c.useRef)(null),d=(0,c.useRef)(null),f=(0,c.useRef)(null),p=(0,c.useRef)(null),m=(0,c.useRef)("1fr"),g=(0,c.useRef)(void 0),v=(0,c.useRef)(void 0),y=ch[e].dim,b=ch[e].axis,w=ch[e].min,S=ch[e].max;!function(e,t,n=0,r){const i=(0,N.throttle)(t,n);(0,c.useLayoutEffect)((()=>{if(!e)return;const t=new ResizeObserver(i);return t.observe(e,{box:"device-pixel-content-box"}),()=>t.disconnect()}),r)}(f.current,(e=>{for(const t of e){if(!t.target.isSameNode(f.current))return;const e=u.current.getBoundingClientRect()[y],n=fh(u.current);l.current.ariaValueNow=`${(0,N.clamp)((e-n[w])/(n[S]-n[w])*100,0,100)}`}}),500,[S,w,e,y]);const x=(0,c.useRef)(null),E=(0,c.useCallback)((e=>{m.current=u.current.getBoundingClientRect()[y],p.current=f.current.getBoundingClientRect()[y],x.current=e[b],l.current.setPointerCapture(e.pointerId),g.current=fh(u.current),v.current=void 0}),[y,b]),_=(0,c.useCallback)((e=>{if(null!==x.current&&"1fr"!==m.current){const n=e[b]-x.current,r=g.current,i=(0,N.clamp)(m.current+n,r[w],r[S]),a=i/(p.current-t);u.current.style.flexGrow=`${a}`,d.current.style.flexGrow=""+(1-a);const o=(0,N.clamp)((i-r[w])/(r[S]-r[w])*100,0,100);l.current.ariaValueNow=`${o}`}}),[t,b,w,S]),O=(0,c.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),l.current.releasePointerCapture(e.pointerId),x.current=null,null==a||a(parseFloat(u.current.style.flexGrow))}),[a]),k=(0,c.useRef)(new Set),T=(0,c.useRef)(null),C=(0,c.useCallback)((n=>{var r;if(0===k.current.size)return void(T.current=null);if("1fr"===m.current)return;const i=(n-(null!=(r=T.current)?r:n))*sh;let a=0;"row"===e?(k.current.has("ArrowLeft")&&(a-=i),k.current.has("ArrowRight")&&(a+=i)):(k.current.has("ArrowUp")&&(a-=i),k.current.has("ArrowDown")&&(a+=i));const o=g.current,s=u.current.getBoundingClientRect()[y],c=(0,N.clamp)(s+a,o[w],o[S]),h=c/(p.current-t);u.current.style.flexGrow=`${h}`,d.current.style.flexGrow=""+(1-h);const f=(c-o[w])/(o[S]-o[w])*100;l.current.ariaValueNow=`${(0,N.clamp)(f,0,100)}`,T.current=n,window.requestAnimationFrame(C)}),[e,t,w,S,y]),I=(0,c.useCallback)((n=>{if("Enter"===n.key)return void(void 0===v.current?(v.current=u.current.style.flexGrow,u.current.style.flexGrow="0",d.current.style.flexGrow="1"):(u.current.style.flexGrow=v.current,d.current.style.flexGrow=""+(1-parseFloat(v.current)),v.current=void 0));if("Home"===n.key){g.current=fh(u.current),p.current=f.current.getBoundingClientRect()[y];const e=g.current[w]/(p.current-t);return u.current.style.flexGrow=`${e}`,d.current.style.flexGrow=""+(1-e),void(l.current.ariaValueNow="0")}if("End"===n.key){g.current=fh(u.current),p.current=f.current.getBoundingClientRect()[y];const e=g.current[S]/(p.current-t);return u.current.style.flexGrow=`${e}`,d.current.style.flexGrow=""+(1-e),void(l.current.ariaValueNow="100")}if(!("column"===e&&lh.has(n.key)||"row"===e&&uh.has(n.key))||k.current.has(n.key))return;v.current=void 0,n.preventDefault(),n.stopPropagation(),m.current=u.current.getBoundingClientRect()[y],p.current=f.current.getBoundingClientRect()[y],g.current=fh(u.current);if(!k.current.has(n.key)){const e=0===k.current.size;k.current.add(n.key),e&&window.requestAnimationFrame(C)}}),[e,C,t,S,y,w]),R=(0,c.useCallback)((t=>{"row"===e&&!uh.has(t.key)||"column"===e&&!lh.has(t.key)||(k.current.delete(t.key),null==a||a(parseFloat(u.current.style.flexGrow)))}),[e,a]),A=(0,c.useCallback)((()=>{u.current.style.flexGrow="0.5",d.current.style.flexGrow="0.5";const e=fh(u.current);g.current=e,m.current=u.current.getBoundingClientRect()[y],l.current.ariaValueNow=""+(m.current-e[w])/(e[S]-e[w])*100}),[S,y,w]),D=(0,c.useCallback)((()=>{k.current.size>0&&(k.current.clear(),x.current=null,null==a||a(parseFloat(u.current.style.flexGrow)))}),[a]),L=(0,Gn.useStyles2)(hh),P=Fr(),M=2===s.length?"visible":"hidden";return h().createElement("div",{ref:f,className:L.container,style:{flexDirection:e}},h().createElement("div",{ref:u,className:L.panel,style:{flexGrow:"auto"===n?.5:(0,N.clamp)(n,0,1),[w]:"min-content",...r},id:`start-panel-${P}`},s[0]),s[1]&&h().createElement(h().Fragment,null,h().createElement("div",{ref:l,style:{[y]:`${t}px`},className:(0,Qn.cx)(L.handle,{[L.handleHorizontal]:"column"===e}),onPointerUp:O,onPointerDown:E,onPointerMove:_,onKeyDown:I,onKeyUp:R,onDoubleClick:A,onBlur:D,role:"separator","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":50,"aria-controls":`start-panel-${P}`,"aria-label":Zt("grafana-scenes.components.splitter.aria-label-pane-resize-widget","Pane resize widget"),tabIndex:0}),h().createElement("div",{ref:d,className:L.panel,style:{flexGrow:"auto"===n?.5:(0,N.clamp)(1-n,0,1),[w]:"min-content",visibility:`${M}`,...i},id:`end-panel-${P}`},s[1])))}function hh(e){return{handle:(0,Qn.css)({cursor:"col-resize",position:"relative",flexShrink:0,userSelect:"none","&::before":{content:'""',position:"absolute",backgroundColor:e.colors.primary.main,left:"50%",transform:"translate(-50%)",top:0,height:"100%",width:"1px",opacity:0,transition:"opacity ease-in-out 0.2s"},"&::after":{content:'""',width:"4px",borderRadius:"4px",backgroundColor:e.colors.border.weak,transition:"background-color ease-in-out 0.2s",height:"50%",top:"calc(50% - (50%) / 2)",transform:"translateX(-50%)",position:"absolute",left:"50%"},"&:hover, &:focus-visible":{outline:"none","&::before":{opacity:1},"&::after":{backgroundColor:e.colors.primary.main}}}),handleHorizontal:(0,Qn.css)({cursor:"row-resize","&::before":{left:"inherit",transform:"translateY(-50%)",top:"50%",height:"1px",width:"100%"},"&::after":{width:"50%",height:"4px",top:"50%",transform:"translateY(-50%)",left:"calc(50% - (50%) / 2)"}}),container:(0,Qn.css)({display:"flex",width:"100%",flexGrow:1,overflow:"hidden"}),panel:(0,Qn.css)({display:"flex",position:"relative",flexBasis:0})}}function fh(e){if(null===e)return;const t=document.body.style.overflow,n=e.style.width,r=e.style.height,i=e.style.flexGrow;document.body.style.overflow="hidden",e.style.flexGrow="0";const{width:a,height:o}=e.getBoundingClientRect();e.style.flexGrow="100";const{width:s,height:l}=e.getBoundingClientRect();return document.body.style.overflow=t,e.style.width=n,e.style.height=r,e.style.flexGrow=i,{minWidth:a,maxWidth:s,minHeight:o,maxHeight:l}}class ph extends I{toggleDirection(){this.setState({direction:"row"===this.state.direction?"column":"row"})}isDraggable(){return!1}}ph.Component=function({model:e}){const{primary:t,secondary:n,direction:r,isHidden:i,initialSize:a,primaryPaneStyles:o,secondaryPaneStyles:s}=e.useState();if(i)return null;const l=t.Component,u=null==n?void 0:n.Component;let c=n?a:1;return h().createElement(dh,{direction:r,initialSize:null!=c?c:.5,primaryPaneStyles:o,secondaryPaneStyles:s},h().createElement(l,{key:t.state.key,model:t,parentState:e.state}),u&&n&&h().createElement(u,{key:n.state.key,model:n,parentState:e.state}))};(class extends I{constructor(){super(...arguments),this._renderBeforeActivation=!0}enrichDataRequest(){return{app:this.state.name||"app"}}}).Component=({model:e})=>{const{pages:t}=e.useState();return h().createElement(h().Fragment,null,h().createElement(mh.Provider,{value:e},h().createElement(i.Routes,null,t.map((e=>h().createElement(i.Route,{key:e.state.url,path:e.state.routePath,element:h().createElement(e.Component,{model:e})}))))))};const mh=(0,c.createContext)(null);class gh extends I{}function vh({node:e}){const t=e.useState(),n=(0,Gn.useStyles2)(yh);return h().createElement("div",{className:n.container},Object.keys(t).map((r=>h().createElement("div",{className:n.row,key:r},h().createElement("div",{className:n.keyName},r),h().createElement("div",{className:n.value},function(e,t,n){if(null===t)return"null";switch(typeof t){case"number":return h().createElement(Gn.Input,{type:"number",defaultValue:t,onBlur:t=>n.setState({[e]:t.currentTarget.valueAsNumber})});case"string":return h().createElement(Gn.Input,{type:"text",defaultValue:t,onBlur:t=>n.setState({[e]:t.currentTarget.value})});case"object":return An(t)?t.constructor.name:(0,N.isPlainObject)(t)||(0,N.isArray)(t)?h().createElement(Gn.JSONFormatter,{json:t,open:0}):String(t);default:return typeof t}}(r,t[r],e))))))}function yh(e){return{container:(0,Qn.css)({flexGrow:1,display:"flex",gap:e.spacing(.5),flexDirection:"column"}),row:(0,Qn.css)({display:"flex",gap:e.spacing(2)}),keyName:(0,Qn.css)({display:"flex",flexGrow:"0",width:120,alignItems:"center",height:e.spacing(e.components.height.md)}),value:(0,Qn.css)({flexGrow:1,minHeight:e.spacing(e.components.height.md),display:"flex",alignItems:"center"})}}function bh({node:e,selectedObject:t,onSelect:n}){const r=(0,Gn.useStyles2)(wh),i=[],a=e===t;return e.forEachChild((e=>{i.push(h().createElement(bh,{node:e,key:e.state.key,selectedObject:t,onSelect:n}))})),h().createElement("div",{className:r.container},h().createElement("div",{className:(0,Qn.cx)(r.name,a&&r.selected),onClick:()=>n(e)},e.constructor.name),h().createElement("div",{className:r.children},i))}function wh(e){return{container:(0,Qn.css)({flexGrow:1,display:"flex",gap:e.spacing(.5),flexDirection:"column"}),name:(0,Qn.css)({flexGrow:1,display:"flex",gap:e.spacing(1),fontSize:e.typography.bodySmall.fontSize,cursor:"pointer",padding:e.spacing(0,1),borderRadius:e.shape.borderRadius(2),position:"relative","&:hover":{background:e.colors.background.secondary}}),selected:(0,Qn.css)({"&::before":{display:"block",content:"' '",position:"absolute",left:0,width:4,bottom:2,top:2,borderRadius:e.shape.radius.default,backgroundImage:e.colors.gradients.brandVertical}}),children:(0,Qn.css)({flexGrow:1,display:"flex",flexDirection:"column",paddingLeft:e.spacing(1)})}}function Sh({scene:e}){const t=(0,Gn.useStyles2)(xh),[n,r]=(0,c.useState)(!1),[i,a]=(0,c.useState)();return h().createElement(h().Fragment,null,h().createElement(Gn.ToolbarButton,{variant:"canvas",icon:"bug",onClick:()=>r(!0)}),n&&h().createElement(Gn.Drawer,{title:Zt("grafana-scenes.components.scene-debugger.title-scene-debugger","Scene debugger"),onClose:()=>r(!1),size:"lg"},h().createElement("div",{className:t.panes},h().createElement("div",{className:t.pane1},h().createElement("div",{className:t.paneHeading},h().createElement(en,{i18nKey:"grafana-scenes.components.scene-debugger.scene-graph"},"Scene graph")),h().createElement(Gn.CustomScrollbar,{autoHeightMin:"100%"},h().createElement("div",{className:t.treeWrapper},h().createElement(bh,{node:e,selectedObject:i,onSelect:a})))),h().createElement("div",{className:t.pane2},h().createElement("div",{className:t.paneHeading},h().createElement(en,{i18nKey:"grafana-scenes.components.scene-debugger.object-details"},"Object details")),i&&h().createElement(vh,{node:i})))))}function xh(e){return{panes:(0,Qn.css)({flexGrow:1,display:"flex",height:"100%",flexDirection:"row",marginTop:e.spacing(-2)}),pane1:(0,Qn.css)({flexGrow:0,display:"flex",height:"100%",flexDirection:"column",borderRight:`1px solid ${e.colors.border.weak}`}),pane2:(0,Qn.css)({flexGrow:1,display:"flex",minHeight:"100%",flexDirection:"column",paddingLeft:e.spacing(2)}),treeWrapper:(0,Qn.css)({paddingRight:e.spacing(2),height:"100%",marginLeft:e.spacing(-1)}),paneHeading:(0,Qn.css)({padding:e.spacing(1,0),fontWeight:e.typography.fontWeightMedium})}}function Eh({page:e}){const t=l(e.state.url),n=function(e){if(e.parent instanceof kh)return e.parent;return e}(e),r=n.useState(),a=function(){const e=(0,i.useLocation)();return(0,o.locationSearchToObject)(e.search||"")}(),u=e.getScene(t),d=(0,c.useContext)(mh),f=r.initializedScene===u,{layout:p}=e.state,m=Sn();(0,c.useLayoutEffect)((()=>{f||n.initializeScene(u)}),[u,n,f]),(0,c.useEffect)((()=>()=>n.setState({initializedScene:void 0})),[n]);const g=gd(n,null==d?void 0:d.state.urlSyncOptions);if(!f&&!g)return null;const v={text:r.title,img:r.titleImg,icon:r.titleIcon,url:s(r.url,m.getSearchObject(),r.preserveUrlKeys),hideFromBreadcrumbs:r.hideFromBreadcrumbs,parentItem:_h(r.getParentPage?r.getParentPage():n.parent,a,m.getSearchObject())};r.tabs&&(v.children=r.tabs.map((t=>({text:t.state.title,icon:t.state.titleIcon,tabSuffix:t.state.tabSuffix,active:e===t,url:s(t.state.url,m.getSearchObject(),t.state.preserveUrlKeys),parentItem:v}))));let y=[];return r.controls&&(y=r.controls.map((e=>h().createElement(e.Component,{model:e,key:e.state.key})))),a["scene-debugger"]&&y.push(h().createElement(Sh,{scene:n,key:"scene-debugger"})),h().createElement(o.PluginPage,{layout:p,pageNav:v,actions:y,renderTitle:r.renderTitle,subTitle:r.subTitle},h().createElement(u.Component,{model:u}))}function _h(e,t,n){if(e instanceof kh)return{text:e.state.title,url:s(e.state.url,n,e.state.preserveUrlKeys),hideFromBreadcrumbs:e.state.hideFromBreadcrumbs,parentItem:_h(e.state.getParentPage?e.state.getParentPage():e.parent,t,n)}}function Oh({drilldown:e,parent:t}){const n=l(e.routePath),r=t.getDrilldownPage(e,n);return h().createElement(r.Component,{model:r})}gh.Component=({model:e})=>{const{component:t,props:n,reactNode:r}=e.useState();return t?h().createElement(t,{...n}):r||null};class kh extends I{constructor(){super(...arguments),this._sceneCache=new Map,this._drilldownCache=new Map}initializeScene(e){this.setState({initializedScene:e})}getScene(e){let t=this._sceneCache.get(e.url);if(t)return t;if(!this.state.getScene)throw new Error("Missing getScene on SceneAppPage "+this.state.title);return t=this.state.getScene(e),this._sceneCache.set(e.url,t),t}getDrilldownPage(e,t){let n=this._drilldownCache.get(t.url);return n||(n=e.getPage(t,this),this._drilldownCache.set(t.url,n),n)}enrichDataRequest(e){if(this.state.getParentPage)return this.state.getParentPage().enrichDataRequest(e);if(!this.parent)return null;const t=this.getRoot();return Nn(t)?t.enrichDataRequest(e):null}}kh.Component=function({model:e}){const{tabs:t,drilldowns:n}=e.useState(),r=[];if(r.push(function(e){var t,n,r;return h().createElement(i.Route,{key:"fallback route",path:"*",element:h().createElement(Eh,{page:null!=(r=null==(n=(t=e.state).getFallbackPage)?void 0:n.call(t))?r:new kh({url:"",title:Zt("grafana-scenes.components.fallback-page.title","Not found"),subTitle:Zt("grafana-scenes.components.fallback-page.subTitle","The url did not match any page"),routePath:"*",getScene:()=>new yd({body:new nh({direction:"column",children:[new rh({body:new gh({component:()=>h().createElement("div",{"data-testid":"default-fallback-content"},h().createElement(en,{i18nKey:"grafana-scenes.components.fallback-page.content"},"If you found your way here using a link then there might be a bug in this application."))})})]})})})})})}(e)),t&&t.length>0)for(let n=0;n<t.length;n++){const a=t[n];if(0===n&&r.push(h().createElement(i.Route,{key:e.state.routePath,path:"",element:h().createElement(a.Component,{model:a})})),r.push(h().createElement(i.Route,{key:a.state.url,path:a.state.routePath,element:h().createElement(a.Component,{model:a})})),a.state.drilldowns)for(const e of a.state.drilldowns)r.push(h().createElement(i.Route,{key:e.routePath,path:e.routePath,element:h().createElement(Oh,{drilldown:e,parent:a})}))}if(n)for(const t of n)r.push(h().createElement(i.Route,{key:t.routePath,path:t.routePath,Component:()=>h().createElement(Oh,{drilldown:t,parent:e})}));t||r.push(h().createElement(i.Route,{key:"home route",path:"/",element:h().createElement(Eh,{page:e})}));return h().createElement(i.Routes,null,r)};var Th=(e=>(e.Always="always",e.Auto="auto",e.Never="never",e))(Th||{}),Ch=(e=>(e.Hue="hue",e.None="none",e.Opacity="opacity",e.Scheme="scheme",e))(Ch||{}),Ih=(e=>(e.None="none",e.Normal="normal",e.Percent="percent",e))(Ih||{}),Rh=(e=>(e.Auto="auto",e.Horizontal="horizontal",e.Vertical="vertical",e))(Rh||{}),Ah=(e=>(e.Background="background",e.BackgroundSolid="background_solid",e.None="none",e.Value="value",e))(Ah||{}),Nh=(e=>(e.Area="area",e.Line="line",e.None="none",e))(Nh||{}),Dh=(e=>(e.Auto="auto",e.Center="center",e))(Dh||{}),Lh=(e=>(e.Auto="auto",e.Name="name",e.None="none",e.Value="value",e.ValueAndName="value_and_name",e))(Lh||{}),Ph=(e=>(e.Inverted="inverted",e.SameAsValue="same_as_value",e.Standard="standard",e))(Ph||{}),Mh=(e=>(e.Multi="multi",e.None="none",e.Single="single",e))(Mh||{}),jh=(e=>(e.Basic="basic",e.Gradient="gradient",e.Lcd="lcd",e))(jh||{}),Fh=(e=>(e.Color="color",e.Hidden="hidden",e.Text="text",e))(Fh||{}),Vh=(e=>(e.Auto="auto",e.Hidden="hidden",e.Left="left",e.Top="top",e))(Vh||{}),$h=(e=>(e.Auto="auto",e.Manual="manual",e))($h||{}),Bh=(e=>(e.Auto="auto",e.Lg="lg",e.Md="md",e.Sm="sm",e))(Bh||{});const zh={barRadius:0,barWidth:.97,fullHighlight:!1,groupWidth:.7,orientation:Rh.Auto,showValue:Th.Auto,stacking:Ih.None,xTickLabelRotation:0,xTickLabelSpacing:0},Uh={fillOpacity:80,gradientMode:Ch.None,lineWidth:1},qh={displayMode:jh.Gradient,maxVizHeight:300,minVizHeight:16,minVizWidth:8,namePlacement:Vh.Auto,showUnfilled:!0,sizing:$h.Auto,valueMode:Fh.Color},Hh={selectedSeries:0},Wh={minVizHeight:75,minVizWidth:75,showThresholdLabels:!1,showThresholdMarkers:!0,sizing:$h.Auto},Gh={layers:[]};const Kh={calculate:!1,cellGap:1,cellValues:{},color:{scheme:"Oranges",fill:"dark-orange",reverse:!1,exponent:.5,steps:64},exemplars:{color:"rgba(255,0,255,0.7)"},filterValues:{le:1e-9},legend:{show:!0},selectionMode:"x",showValue:Th.Auto,tooltip:{mode:Mh.Single,yHistogram:!1,showColorScale:!1}},Qh={bucketCount:30,bucketOffset:0},Yh={fillOpacity:80,gradientMode:Ch.None,lineWidth:1},Xh={showImage:!0};const Jh={displayLabels:[]},Zh={colorMode:Ah.Value,graphMode:Nh.Area,justifyMode:Dh.Auto,percentChangeColorMode:Ph.Standard,showPercentChange:!1,textMode:Lh.Auto,wideLayout:!0},ef={alignValue:"left",mergeValues:!0,perPage:20,rowHeight:.9,showValue:Th.Auto},tf={fillOpacity:70,lineWidth:0},nf={colWidth:.9,perPage:20,rowHeight:.9,showValue:Th.Auto},rf={fillOpacity:70,lineWidth:1},af={cellHeight:Bh.Sm,footer:{show:!1,countRows:!1,reducer:[]},frameIndex:0,showHeader:!0,showTypeIcons:!1,sortBy:[]};const of={content:"# Title\n\nFor markdown syntax help: [commonmark.org/help](https://commonmark.org/help/)",mode:"markdown"};const sf={fillOpacity:50,show:"points"},lf={series:[]};class uf{constructor(){this._overrides=[]}overrideColor(e){return this._overrides[this._overrides.length-1].properties.push({id:"color",value:e}),this}overrideDecimals(e){return this._overrides[this._overrides.length-1].properties.push({id:"decimals",value:e}),this}overrideDisplayName(e){return this._overrides[this._overrides.length-1].properties.push({id:"displayName",value:e}),this}overrideFilterable(e){return this._overrides[this._overrides.length-1].properties.push({id:"filterable",value:e}),this}overrideLinks(e){return this._overrides[this._overrides.length-1].properties.push({id:"links",value:e}),this}overrideMappings(e){return this._overrides[this._overrides.length-1].properties.push({id:"mappings",value:e}),this}overrideMax(e){return this._overrides[this._overrides.length-1].properties.push({id:"max",value:e}),this}overrideMin(e){return this._overrides[this._overrides.length-1].properties.push({id:"min",value:e}),this}overrideNoValue(e){return this._overrides[this._overrides.length-1].properties.push({id:"noValue",value:e}),this}overrideThresholds(e){return this._overrides[this._overrides.length-1].properties.push({id:"thresholds",value:e}),this}overrideUnit(e){return this._overrides[this._overrides.length-1].properties.push({id:"unit",value:e}),this}}class cf extends uf{match(e){return this._overrides.push({matcher:e,properties:[]}),this}matchFieldsWithName(e){return this._overrides.push({matcher:{id:a.FieldMatcherID.byName,options:e},properties:[]}),this}matchFieldsWithNameByRegex(e){return this._overrides.push({matcher:{id:a.FieldMatcherID.byRegexp,options:e},properties:[]}),this}matchFieldsByType(e){return this._overrides.push({matcher:{id:a.FieldMatcherID.byType,options:e},properties:[]}),this}matchFieldsByQuery(e){return this._overrides.push({matcher:{id:a.FieldMatcherID.byFrameRefID,options:e},properties:[]}),this}matchFieldsByValue(e){return this._overrides.push({matcher:{id:a.FieldMatcherID.byValue,options:e},properties:[]}),this}matchComparisonQuery(e){return this.matchFieldsByQuery(Kd(e))}overrideCustomFieldConfig(e,t){const n=`custom.${String(e)}`;return this._overrides[this._overrides.length-1].properties.push({id:n,value:t}),this}build(){return this._overrides}}class df{constructor(e){this.defaultFieldConfig=e,this._fieldConfig={defaults:{},overrides:[]},this._overridesBuilder=new cf,this.setDefaults()}setDefaults(){const e={defaults:{custom:this.defaultFieldConfig?(0,N.cloneDeep)(this.defaultFieldConfig()):{}},overrides:[]};this._fieldConfig=e}setColor(e){return this.setFieldConfigDefaults("color",e)}setDecimals(e){return this.setFieldConfigDefaults("decimals",e)}setDisplayName(e){return this.setFieldConfigDefaults("displayName",e)}setFilterable(e){return this.setFieldConfigDefaults("filterable",e)}setLinks(e){return this.setFieldConfigDefaults("links",e)}setMappings(e){return this.setFieldConfigDefaults("mappings",e)}setMax(e){return this.setFieldConfigDefaults("max",e)}setMin(e){return this.setFieldConfigDefaults("min",e)}setNoValue(e){return this.setFieldConfigDefaults("noValue",e)}setThresholds(e){return this.setFieldConfigDefaults("thresholds",e)}setUnit(e){return this.setFieldConfigDefaults("unit",e)}setCustomFieldConfig(e,t){return this._fieldConfig.defaults={...this._fieldConfig.defaults,custom:(0,N.merge)(this._fieldConfig.defaults.custom,{[e]:t})},this}setOverrides(e){return e(this._overridesBuilder),this}setFieldConfigDefaults(e,t){return this._fieldConfig.defaults={...this._fieldConfig.defaults,[e]:t},this}build(){return{defaults:this._fieldConfig.defaults,overrides:this._overridesBuilder.build()}}}class hf{constructor(e){this.defaultOptions=e,this._options={},this.setDefaults()}setDefaults(){this._options=this.defaultOptions?(0,N.cloneDeep)(this.defaultOptions()):{}}setOption(e,t){return this._options=(0,N.merge)(this._options,{[e]:t}),this}build(){return this._options}}class ff{constructor(e,t,n,r){this._state={},this._state.title="",this._state.description="",this._state.displayMode="default",this._state.hoverHeader=!1,this._state.pluginId=e,this._state.pluginVersion=t,this._fieldConfigBuilder=new df(r),this._panelOptionsBuilder=new hf(n)}setTitle(e){return this._state.title=e,this}setDescription(e){return this._state.description=e,this}setDisplayMode(e){return this._state.displayMode=e,this}setHoverHeader(e){return this._state.hoverHeader=e,this}setShowMenuAlways(e){return this._state.showMenuAlways=e,this}setMenu(e){return this._state.menu=e,this}setHeaderActions(e){return this._state.headerActions=e,this}setCollapsible(e){return this._state.collapsible=e,this}setCollapsed(e){return this._state.collapsed=e,this}setColor(e){return this._fieldConfigBuilder.setColor(e),this}setDecimals(e){return this._fieldConfigBuilder.setDecimals(e),this}setDisplayName(e){return this._fieldConfigBuilder.setDisplayName(e),this}setFilterable(e){return this._fieldConfigBuilder.setFilterable(e),this}setLinks(e){return this._fieldConfigBuilder.setLinks(e),this}setMappings(e){return this._fieldConfigBuilder.setMappings(e),this}setMax(e){return this._fieldConfigBuilder.setMax(e),this}setMin(e){return this._fieldConfigBuilder.setMin(e),this}setNoValue(e){return this._fieldConfigBuilder.setNoValue(e),this}setThresholds(e){return this._fieldConfigBuilder.setThresholds(e),this}setUnit(e){return this._fieldConfigBuilder.setUnit(e),this}setCustomFieldConfig(e,t){return this._fieldConfigBuilder.setCustomFieldConfig(e,t),this}setOverrides(e){return this._fieldConfigBuilder.setOverrides(e),this}setOption(e,t){return this._panelOptionsBuilder.setOption(e,t),this}setData(e){return this._state.$data=e,this}setTimeRange(e){return this._state.$timeRange=e,this}setVariables(e){return this._state.$variables=e,this}setBehaviors(e){return this._state.$behaviors=e,this}setSeriesLimit(e){return this._state.seriesLimit=e,this}applyMixin(e){return e(this),this}build(){return new pi({...this._state,options:this._panelOptionsBuilder.build(),fieldConfig:this._fieldConfigBuilder.build()})}}const pf={barchart:()=>new ff("barchart","10.0.0",(()=>zh),(()=>Uh)),bargauge:()=>new ff("bargauge","10.0.0",(()=>qh)),datagrid:()=>new ff("datagrid","10.0.0",(()=>Hh)),flamegraph:()=>new ff("flamegraph","10.0.0"),gauge:()=>new ff("gauge","10.0.0",(()=>Wh)),geomap:()=>new ff("geomap","10.0.0",(()=>Gh)),heatmap:()=>new ff("heatmap","10.0.0",(()=>Kh)),histogram:()=>new ff("histogram","10.0.0",(()=>Qh),(()=>Yh)),logs:()=>new ff("logs","10.0.0"),news:()=>new ff("news","10.0.0",(()=>Xh)),nodegraph:()=>new ff("nodeGraph","10.0.0"),piechart:()=>new ff("piechart","10.0.0",(()=>Jh)),stat:()=>new ff("stat","10.0.0",(()=>Zh)),statetimeline:()=>new ff("state-timeline","10.0.0",(()=>ef),(()=>tf)),statushistory:()=>new ff("status-history","10.0.0",(()=>nf),(()=>rf)),table:()=>new ff("table","10.0.0",(()=>af)),text:()=>new ff("text","10.0.0",(()=>of)),timeseries:()=>new ff("timeseries","10.0.0"),trend:()=>new ff("trend","10.0.0"),traces:()=>new ff("traces","10.0.0"),xychart:()=>new ff("xychart","10.0.0",(()=>lf),(()=>sf))};Gt.reduce(((e,t)=>(e[t.code]=async()=>await function(e){switch(e){case"../locales/cs-CZ/grafana-scenes.json":return n.e(549).then(n.bind(n,4549));case"../locales/de-DE/grafana-scenes.json":return n.e(876).then(n.bind(n,876));case"../locales/en-US/grafana-scenes.json":return n.e(767).then(n.bind(n,4767));case"../locales/es-ES/grafana-scenes.json":return n.e(190).then(n.bind(n,2190));case"../locales/fr-FR/grafana-scenes.json":return n.e(2).then(n.bind(n,6002));case"../locales/hu-HU/grafana-scenes.json":return n.e(220).then(n.bind(n,8220));case"../locales/id-ID/grafana-scenes.json":return n.e(980).then(n.bind(n,7980));case"../locales/it-IT/grafana-scenes.json":return n.e(644).then(n.bind(n,5644));case"../locales/ja-JP/grafana-scenes.json":return n.e(327).then(n.bind(n,6708));case"../locales/ko-KR/grafana-scenes.json":return n.e(353).then(n.bind(n,7353));case"../locales/nl-NL/grafana-scenes.json":return n.e(74).then(n.bind(n,6074));case"../locales/pl-PL/grafana-scenes.json":return n.e(582).then(n.bind(n,3582));case"../locales/pt-BR/grafana-scenes.json":return n.e(150).then(n.bind(n,5150));case"../locales/pt-PT/grafana-scenes.json":return n.e(206).then(n.bind(n,6206));case"../locales/ru-RU/grafana-scenes.json":return n.e(64).then(n.bind(n,6064));case"../locales/sv-SE/grafana-scenes.json":return n.e(697).then(n.bind(n,5697));case"../locales/tr-TR/grafana-scenes.json":return n.e(70).then(n.bind(n,5070));case"../locales/zh-Hans/grafana-scenes.json":return n.e(660).then(n.bind(n,4279));case"../locales/zh-Hant/grafana-scenes.json":return n.e(341).then(n.bind(n,9341));default:return new Promise((function(t,n){("function"==typeof queueMicrotask?queueMicrotask:setTimeout)(n.bind(null,new Error("Unknown variable dynamic import: "+e)))}))}}(`../locales/${t.code}/grafana-scenes.json`),e)),{});const mf={getUrlWithAppState:s,registerRuntimePanelPlugin:function({pluginId:e,plugin:t}){if(u.has(e))throw new Error(`A runtime panel plugin with id ${e} has already been registered`);t.meta={...t.meta,id:e,name:e,module:"runtime plugin",baseUrl:"runtime plugin",info:{author:{name:"Runtime plugin "+e},description:"",links:[],logos:{large:"",small:""},screenshots:[],updated:"",version:""}},u.set(e,t)},registerRuntimeDataSource:function({dataSource:e}){if(P.has(e.uid))throw new Error(`A runtime data source with uid ${e.uid} has already been registered`);P.set(e.uid,e)},registerVariableMacro:function(e,t,n=!1){if(!n&&In.get(e))throw new Error(`Macro already registered ${e}`);return In.set(e,t),()=>{if(n)throw new Error("Replaced macros can not be unregistered. They need to be restored manually.");In.delete(e)}},cloneSceneObjectState:D,syncStateFromSearchParams:function(e,t,n){$(e,t,new j(n))},getUrlState:V,renderPrometheusLabelFilters:Su,escapeLabelValueInRegexSelector:Eu,escapeLabelValueInExactSelector:xu,escapeURLDelimiters:function(e){return Tu(ku(e))},isAdHocVariable:function(e){return"adhoc"===e.state.type},isConstantVariable:function(e){return"constant"===e.state.type},isCustomVariable:function(e){return"custom"===e.state.type},isDataSourceVariable:function(e){return"datasource"===e.state.type},isIntervalVariable:function(e){return"interval"===e.state.type},isQueryVariable:function(e){return"query"===e.state.type},isTextBoxVariable:function(e){return"textbox"===e.state.type},isGroupByVariable:function(e){return"groupby"===e.state.type},isSwitchVariable:function(e){return"switch"===e.state.type},isRepeatCloneOrChildOf:xn,buildPathIdFor:dc}},6233:e=>{"use strict";e.exports=function(e,t){var n=new Array(arguments.length-1),r=0,i=2,a=!0;for(;i<arguments.length;)n[r++]=arguments[i++];return new Promise((function(i,o){n[r]=function(e){if(a)if(a=!1,e)o(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];i.apply(null,t)}};try{e.apply(t||null,n)}catch(e){a&&(a=!1,o(e))}}))}},1979:(e,t)=>{"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),i=new Array(123),a=0;a<64;)i[r[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;n.encode=function(e,t,n){for(var i,a=null,o=[],s=0,l=0;t<n;){var u=e[t++];switch(l){case 0:o[s++]=r[u>>2],i=(3&u)<<4,l=1;break;case 1:o[s++]=r[i|u>>4],i=(15&u)<<2,l=2;break;case 2:o[s++]=r[i|u>>6],o[s++]=r[63&u],l=0}s>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,o)),s=0)}return l&&(o[s++]=r[i],o[s++]=61,1===l&&(o[s++]=61)),a?(s&&a.push(String.fromCharCode.apply(String,o.slice(0,s))),a.join("")):String.fromCharCode.apply(String,o.slice(0,s))};var o="invalid encoding";n.decode=function(e,t,n){for(var r,a=n,s=0,l=0;l<e.length;){var u=e.charCodeAt(l++);if(61===u&&s>1)break;if(void 0===(u=i[u]))throw Error(o);switch(s){case 0:r=u,s=1;break;case 1:t[n++]=r<<2|(48&u)>>4,r=u,s=2;break;case 2:t[n++]=(15&r)<<4|(60&u)>>2,r=u,s=3;break;case 3:t[n++]=(3&r)<<6|u,s=0}}if(1===s)throw Error(o);return n-a},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},7669:e=>{"use strict";function t(e,n){"string"==typeof e&&(n=e,e=void 0);var r=[];function i(e){if("string"!=typeof e){var n=a();if(t.verbose,n="return "+n,e){for(var o=Object.keys(e),s=new Array(o.length+1),l=new Array(o.length),u=0;u<o.length;)s[u]=o[u],l[u]=e[o[u++]];return s[u]=n,Function.apply(null,s).apply(null,l)}return Function(n)()}for(var c=new Array(arguments.length-1),d=0;d<c.length;)c[d]=arguments[++d];if(d=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var n=c[d++];switch(t){case"d":case"f":return String(Number(n));case"i":return String(Math.floor(n));case"j":return JSON.stringify(n);case"s":return String(n)}return"%"})),d!==c.length)throw Error("parameter count mismatch");return r.push(e),i}function a(t){return"function "+(t||n||"")+"("+(e&&e.join(",")||"")+"){\n "+r.join("\n ")+"\n}"}return i.toString=a,i}e.exports=t,t.verbose=!1},3474:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}},9240:(e,t,n)=>{"use strict";e.exports=a;var r=n(6233),i=n(1925)("fs");function a(e,t,n){return"function"==typeof t?(n=t,t={}):t||(t={}),n?!t.xhr&&i&&i.readFile?i.readFile(e,(function(r,i){return r&&"undefined"!=typeof XMLHttpRequest?a.xhr(e,t,n):r?n(r):n(null,t.binary?i:i.toString("utf8"))})):a.xhr(e,t,n):r(a,this,e,t)}a.xhr=function(e,t,n){var r=new XMLHttpRequest;r.onreadystatechange=function(){if(4===r.readyState){if(0!==r.status&&200!==r.status)return n(Error("status "+r.status));if(t.binary){var e=r.response;if(!e){e=[];for(var i=0;i<r.responseText.length;++i)e.push(255&r.responseText.charCodeAt(i))}return n(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return n(null,r.responseText)}},t.binary&&("overrideMimeType"in r&&r.overrideMimeType("text/plain; charset=x-user-defined"),r.responseType="arraybuffer"),r.open("GET",e),r.send()}},5750:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function a(e,r,i){t[0]=e,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function s(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?i:a,e.writeFloatBE=r?a:i,e.readFloatLE=r?o:s,e.readFloatBE=r?s:o}():function(){function t(e,t,n,r){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var a=Math.floor(Math.log(t)/Math.LN2);e((i<<31|a+127<<23|8388607&Math.round(t*Math.pow(2,-a)*8388608))>>>0,n,r)}}function o(e,t,n){var r=e(t,n),i=2*(r>>31)+1,a=r>>>23&255,o=8388607&r;return 255===a?o?NaN:i*(1/0):0===a?1401298464324817e-60*i*o:i*Math.pow(2,a-150)*(o+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,r),e.readFloatLE=o.bind(null,i),e.readFloatBE=o.bind(null,a)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function a(e,r,i){t[0]=e,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?i:a,e.writeDoubleBE=r?a:i,e.readDoubleLE=r?o:s,e.readDoubleBE=r?s:o}():function(){function t(e,t,n,r,i,a){var o=r<0?1:0;if(o&&(r=-r),0===r)e(0,i,a+t),e(1/r>0?0:2147483648,i,a+n);else if(isNaN(r))e(0,i,a+t),e(2146959360,i,a+n);else if(r>17976931348623157e292)e(0,i,a+t),e((o<<31|2146435072)>>>0,i,a+n);else{var s;if(r<22250738585072014e-324)e((s=r/5e-324)>>>0,i,a+t),e((o<<31|s/4294967296)>>>0,i,a+n);else{var l=Math.floor(Math.log(r)/Math.LN2);1024===l&&(l=1023),e(4503599627370496*(s=r*Math.pow(2,-l))>>>0,i,a+t),e((o<<31|l+1023<<20|1048576*s&1048575)>>>0,i,a+n)}}}function o(e,t,n,r,i){var a=e(r,i+t),o=e(r,i+n),s=2*(o>>31)+1,l=o>>>20&2047,u=4294967296*(1048575&o)+a;return 2047===l?u?NaN:s*(1/0):0===l?5e-324*s*u:s*Math.pow(2,l-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=o.bind(null,i,0,4),e.readDoubleBE=o.bind(null,a,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function r(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function a(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},1925:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},2459:(e,t)=>{"use strict";var n=t,r=n.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},i=n.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),n=r(e),i="";n&&(i=t.shift()+"/");for(var a=0;a<t.length;)".."===t[a]?a>0&&".."!==t[a-1]?t.splice(--a,2):n?t.splice(a,1):++a:"."===t[a]?t.splice(a,1):++a;return i+t.join("/")};n.resolve=function(e,t,n){return n||(t=i(t)),r(t)?t:(n||(e=i(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?i(e+"/"+t):t)}},4226:e=>{"use strict";e.exports=function(e,t,n){var r=n||8192,i=r>>>1,a=null,o=r;return function(n){if(n<1||n>i)return e(n);o+n>r&&(a=e(r),o=0);var s=t.call(a,o,o+=n);return 7&o&&(o=1+(7|o)),s}}},2971:(e,t)=>{"use strict";var n=t;n.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return"";for(var r,i=null,a=[],o=0;t<n;)(r=e[t++])<128?a[o++]=r:r>191&&r<224?a[o++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,a[o++]=55296+(r>>10),a[o++]=56320+(1023&r)):a[o++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),o=0);return i?(o&&i.push(String.fromCharCode.apply(String,a.slice(0,o))),i.join("")):String.fromCharCode.apply(String,a.slice(0,o))},n.write=function(e,t,n){for(var r,i,a=n,o=0;o<e.length;++o)(r=e.charCodeAt(o))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(i=e.charCodeAt(o+1)))?(r=65536+((1023&r)<<10)+(1023&i),++o,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-a}},7951:(e,t,n)=>{const r=n(2880),i={};for(const e of Object.keys(r))i[r[e]]=e;const a={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};e.exports=a;for(const e of Object.keys(a)){if(!("channels"in a[e]))throw new Error("missing channels property: "+e);if(!("labels"in a[e]))throw new Error("missing channel labels property: "+e);if(a[e].labels.length!==a[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=a[e];delete a[e].channels,delete a[e].labels,Object.defineProperty(a[e],"channels",{value:t}),Object.defineProperty(a[e],"labels",{value:n})}a.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i;let s,l;a===i?s=0:t===a?s=(n-r)/o:n===a?s=2+(r-t)/o:r===a&&(s=4+(t-n)/o),s=Math.min(60*s,360),s<0&&(s+=360);const u=(i+a)/2;return l=a===i?0:u<=.5?o/(a+i):o/(2-a-i),[s,100*l,100*u]},a.rgb.hsv=function(e){let t,n,r,i,a;const o=e[0]/255,s=e[1]/255,l=e[2]/255,u=Math.max(o,s,l),c=u-Math.min(o,s,l),d=function(e){return(u-e)/6/c+.5};return 0===c?(i=0,a=0):(a=c/u,t=d(o),n=d(s),r=d(l),o===u?i=r-n:s===u?i=1/3+t-r:l===u&&(i=2/3+n-t),i<0?i+=1:i>1&&(i-=1)),[360*i,100*a,100*u]},a.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const i=a.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,100*o,100*r]},a.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r);return[100*((1-t-i)/(1-i)||0),100*((1-n-i)/(1-i)||0),100*((1-r-i)/(1-i)||0),100*i]},a.rgb.keyword=function(e){const t=i[e];if(t)return t;let n,a=1/0;for(const t of Object.keys(r)){const i=r[t],l=(s=i,((o=e)[0]-s[0])**2+(o[1]-s[1])**2+(o[2]-s[2])**2);l<a&&(a=l,n=t)}var o,s;return n},a.keyword.rgb=function(e){return r[e]},a.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;return[100*(.4124*t+.3576*n+.1805*r),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},a.rgb.lab=function(e){const t=a.rgb.xyz(e);let n=t[0],r=t[1],i=t[2];n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;return[116*r-16,500*(n-r),200*(r-i)]},a.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let i,a,o;if(0===n)return o=255*r,[o,o,o];i=r<.5?r*(1+n):r+n-r*n;const s=2*r-i,l=[0,0,0];for(let e=0;e<3;e++)a=t+1/3*-(e-1),a<0&&a++,a>1&&a--,o=6*a<1?s+6*(i-s)*a:2*a<1?i:3*a<2?s+(i-s)*(2/3-a)*6:s,l[e]=255*o;return l},a.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,i=n;const a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a;return[t,100*(0===r?2*i/(a+i):2*n/(r+n)),100*((r+n)/2)]},a.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const i=Math.floor(t)%6,a=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*a),l=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,l,o];case 1:return[s,r,o];case 2:return[o,r,l];case 3:return[o,s,r];case 4:return[l,o,r];case 5:return[r,o,s]}},a.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01);let a,o;o=(2-n)*r;const s=(2-n)*i;return a=n*i,a/=s<=1?s:2-s,a=a||0,o/=2,[t,100*a,100*o]},a.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const i=n+r;let a;i>1&&(n/=i,r/=i);const o=Math.floor(6*t),s=1-r;a=6*t-o,1&o&&(a=1-a);const l=n+a*(s-n);let u,c,d;switch(o){default:case 6:case 0:u=s,c=l,d=n;break;case 1:u=l,c=s,d=n;break;case 2:u=n,c=s,d=l;break;case 3:u=n,c=l,d=s;break;case 4:u=l,c=n,d=s;break;case 5:u=s,c=n,d=l}return[255*u,255*c,255*d]},a.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},a.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let i,a,o;return i=3.2406*t+-1.5372*n+-.4986*r,a=-.9689*t+1.8758*n+.0415*r,o=.0557*t+-.204*n+1.057*r,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,a=a>.0031308?1.055*a**(1/2.4)-.055:12.92*a,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[255*i,255*a,255*o]},a.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;return[116*n-16,500*(t-n),200*(n-r)]},a.lab.xyz=function(e){let t,n,r;n=(e[0]+16)/116,t=e[1]/500+n,r=n-e[2]/200;const i=n**3,a=t**3,o=r**3;return n=i>.008856?i:(n-16/116)/7.787,t=a>.008856?a:(t-16/116)/7.787,r=o>.008856?o:(r-16/116)/7.787,t*=95.047,n*=100,r*=108.883,[t,n,r]},a.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let i;i=360*Math.atan2(r,n)/2/Math.PI,i<0&&(i+=360);return[t,Math.sqrt(n*n+r*r),i]},a.lch.lab=function(e){const t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},a.rgb.ansi16=function(e,t=null){const[n,r,i]=e;let o=null===t?a.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),0===o)return 30;let s=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return 2===o&&(s+=60),s},a.hsv.ansi16=function(e){return a.rgb.ansi16(a.hsv.rgb(e),e[2])},a.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];if(t===n&&n===r)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},a.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},a.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},a.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},a.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=n.split("").map((e=>e+e)).join(""));const r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},a.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),o=i-a;let s,l;return s=o<1?a/(1-o):0,l=o<=0?0:i===t?(n-r)/o%6:i===n?2+(r-t)/o:4+(t-n)/o,l/=6,l%=1,[360*l,100*o,100*s]},a.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],100*r,100*i]},a.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},a.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];const i=[0,0,0],a=t%1*6,o=a%1,s=1-o;let l=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return l=(1-n)*r,[255*(n*i[0]+l),255*(n*i[1]+l),255*(n*i[2]+l)]},a.hcg.hsv=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);let r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},a.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},a.hcg.hwb=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},a.hwb.hcg=function(e){const t=e[1]/100,n=1-e[2]/100,r=n-t;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},a.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},a.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},a.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},a.gray.hsl=function(e){return[0,0,e[0]]},a.gray.hsv=a.gray.hsl,a.gray.hwb=function(e){return[0,100,e[0]]},a.gray.cmyk=function(e){return[0,0,0,e[0]]},a.gray.lab=function(e){return[e[0],0,0]},a.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},8666:(e,t,n)=>{const r=n(7951),i=n(1247),a={};Object.keys(r).forEach((e=>{a[e]={},Object.defineProperty(a[e],"channels",{value:r[e].channels}),Object.defineProperty(a[e],"labels",{value:r[e].labels});const t=i(e);Object.keys(t).forEach((n=>{const r=t[n];a[e][n]=function(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const r=e(t);if("object"==typeof r)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(r),a[e][n].raw=function(e){const t=function(...t){const n=t[0];return null==n?n:(n.length>1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(r)}))})),e.exports=a},1247:(e,t,n)=>{const r=n(7951);function i(e){const t=function(){const e={},t=Object.keys(r);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}(),n=[e];for(t[e].distance=0;n.length;){const e=n.pop(),i=Object.keys(r[e]);for(let r=i.length,a=0;a<r;a++){const r=i[a],o=t[r];-1===o.distance&&(o.distance=t[e].distance+1,o.parent=e,n.unshift(r))}}return t}function a(e,t){return function(n){return t(e(n))}}function o(e,t){const n=[t[e].parent,e];let i=r[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)n.unshift(t[o].parent),i=a(r[t[o].parent][o],i),o=t[o].parent;return i.conversion=n,i}e.exports=function(e){const t=i(e),n={},r=Object.keys(t);for(let e=r.length,i=0;i<e;i++){const e=r[i];null!==t[e].parent&&(n[e]=o(e,t))}return n}},2880:e=>{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},6250:(e,t,n)=>{var r=n(2880),i=n(6852),a=Object.hasOwnProperty,o=Object.create(null);for(var s in r)a.call(r,s)&&(o[r[s]]=s);var l=e.exports={to:{},get:{}};function u(e,t,n){return Math.min(Math.max(t,e),n)}function c(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}l.get=function(e){var t,n;switch(e.substring(0,3).toLowerCase()){case"hsl":t=l.get.hsl(e),n="hsl";break;case"hwb":t=l.get.hwb(e),n="hwb";break;default:t=l.get.rgb(e),n="rgb"}return t?{model:n,value:t}:null},l.get.rgb=function(e){if(!e)return null;var t,n,i,o=[0,0,0,1];if(t=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=t[2],t=t[1],n=0;n<3;n++){var s=2*n;o[n]=parseInt(t.slice(s,s+2),16)}i&&(o[3]=parseInt(i,16)/255)}else if(t=e.match(/^#([a-f0-9]{3,4})$/i)){for(i=(t=t[1])[3],n=0;n<3;n++)o[n]=parseInt(t[n]+t[n],16);i&&(o[3]=parseInt(i+i,16)/255)}else if(t=e.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)o[n]=parseInt(t[n+1],0);t[4]&&(t[5]?o[3]=.01*parseFloat(t[4]):o[3]=parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(t=e.match(/^(\w+)$/))?"transparent"===t[1]?[0,0,0,0]:a.call(r,t[1])?((o=r[t[1]])[3]=1,o):null:null;for(n=0;n<3;n++)o[n]=Math.round(2.55*parseFloat(t[n+1]));t[4]&&(t[5]?o[3]=.01*parseFloat(t[4]):o[3]=parseFloat(t[4]))}for(n=0;n<3;n++)o[n]=u(o[n],0,255);return o[3]=u(o[3],0,1),o},l.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,u(parseFloat(t[2]),0,100),u(parseFloat(t[3]),0,100),u(isNaN(n)?1:n,0,1)]}return null},l.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,u(parseFloat(t[2]),0,100),u(parseFloat(t[3]),0,100),u(isNaN(n)?1:n,0,1)]}return null},l.to.hex=function(){var e=i(arguments);return"#"+c(e[0])+c(e[1])+c(e[2])+(e[3]<1?c(Math.round(255*e[3])):"")},l.to.rgb=function(){var e=i(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},l.to.rgb.percent=function(){var e=i(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+n+"%, "+r+"%)":"rgba("+t+"%, "+n+"%, "+r+"%, "+e[3]+")"},l.to.hsl=function(){var e=i(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},l.to.hwb=function(){var e=i(arguments),t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},l.to.keyword=function(e){return o[e.slice(0,3)]}},4308:(e,t,n)=>{const r=n(6250),i=n(8666),a=["keyword","gray","hex"],o={};for(const e of Object.keys(i))o[[...i[e].labels].sort().join("")]=e;const s={};function l(e,t){if(!(this instanceof l))return new l(e,t);if(t&&t in a&&(t=null),t&&!(t in i))throw new Error("Unknown model: "+t);let n,u;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof l)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if("string"==typeof e){const t=r.get(e);if(null===t)throw new Error("Unable to parse color from string: "+e);this.model=t.model,u=i[this.model].channels,this.color=t.value.slice(0,u),this.valpha="number"==typeof t.value[u]?t.value[u]:1}else if(e.length>0){this.model=t||"rgb",u=i[this.model].channels;const n=Array.prototype.slice.call(e,0,u);this.color=h(n,u),this.valpha="number"==typeof e[u]?e[u]:1}else if("number"==typeof e)this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;const t=Object.keys(e);"alpha"in e&&(t.splice(t.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);const r=t.sort().join("");if(!(r in o))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=o[r];const{labels:a}=i[this.model],s=[];for(n=0;n<a.length;n++)s.push(e[a[n]]);this.color=h(s)}if(s[this.model])for(u=i[this.model].channels,n=0;n<u;n++){const e=s[this.model][n];e&&(this.color[n]=e(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}l.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in r.to?this:this.rgb();t=t.round("number"==typeof e?e:1);const n=1===t.valpha?t.color:[...t.color,this.valpha];return r.to[t.model](n)},percentString(e){const t=this.rgb().round("number"==typeof e?e:1),n=1===t.valpha?t.color:[...t.color,this.valpha];return r.to.rgb.percent(n)},array(){return 1===this.valpha?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:t}=i[this.model],{labels:n}=i[this.model];for(let r=0;r<t;r++)e[n[r]]=this.color[r];return 1!==this.valpha&&(e.alpha=this.valpha),e},unitArray(){const e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,1!==this.valpha&&e.push(this.valpha),e},unitObject(){const e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,1!==this.valpha&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new l([...this.color.map(u(e)),this.valpha],this.model)},alpha(e){return void 0!==e?new l([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:c("rgb",0,d(255)),green:c("rgb",1,d(255)),blue:c("rgb",2,d(255)),hue:c(["hsl","hsv","hsl","hwb","hcg"],0,(e=>(e%360+360)%360)),saturationl:c("hsl",1,d(100)),lightness:c("hsl",2,d(100)),saturationv:c("hsv",1,d(100)),value:c("hsv",2,d(100)),chroma:c("hcg",1,d(100)),gray:c("hcg",2,d(100)),white:c("hwb",1,d(100)),wblack:c("hwb",2,d(100)),cyan:c("cmyk",0,d(100)),magenta:c("cmyk",1,d(100)),yellow:c("cmyk",2,d(100)),black:c("cmyk",3,d(100)),x:c("xyz",0,d(95.047)),y:c("xyz",1,d(100)),z:c("xyz",2,d(108.833)),l:c("lab",0,d(100)),a:c("lab",1),b:c("lab",2),keyword(e){return void 0!==e?new l(e):i[this.model].keyword(this.color)},hex(e){return void 0!==e?new l(e):r.to.hex(this.rgb().round().color)},hexa(e){if(void 0!==e)return new l(e);const t=this.rgb().round().color;let n=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===n.length&&(n="0"+n),r.to.hex(t)+n},rgbNumber(){const e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity(){const e=this.rgb().color,t=[];for(const[n,r]of e.entries()){const e=r/255;t[n]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(2126*e[0]+7152*e[1]+722*e[2])/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return l.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const n=e.rgb(),r=this.rgb(),i=void 0===t?.5:t,a=2*i-1,o=n.alpha()-r.alpha(),s=((a*o==-1?a:(a+o)/(1+a*o))+1)/2,u=1-s;return l.rgb(s*n.red()+u*r.red(),s*n.green()+u*r.green(),s*n.blue()+u*r.blue(),n.alpha()*i+r.alpha()*(1-i))}};for(const e of Object.keys(i)){if(a.includes(e))continue;const{channels:t}=i[e];l.prototype[e]=function(...t){return this.model===e?new l(this):t.length>0?new l(t,e):new l([...(n=i[this.model][e].raw(this.color),Array.isArray(n)?n:[n]),this.valpha],e);var n},l[e]=function(...n){let r=n[0];return"number"==typeof r&&(r=h(n,t)),new l(r,e)}}function u(e){return function(t){return function(e,t){return Number(e.toFixed(t))}(t,e)}}function c(e,t,n){e=Array.isArray(e)?e:[e];for(const r of e)(s[r]||(s[r]=[]))[t]=n;return e=e[0],function(r){let i;return void 0!==r?(n&&(r=n(r)),i=this[e](),i.color[t]=r,i):(i=this[e]().color[t],n&&(i=n(i)),i)}}function d(e){return function(t){return Math.max(0,Math.min(e,t))}}function h(e,t){for(let n=0;n<t;n++)"number"!=typeof e[n]&&(e[n]=0);return e}e.exports=l},2249:function(e,t,n){var r,i,a;i=[],void 0===(a="function"==typeof(r=function(){"use strict";function t(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}function r(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){l(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function i(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function a(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var o="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,s=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||("object"!=typeof window||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(e,t,n){var s=o.URL||o.webkitURL,l=document.createElement("a");t=t||e.name||"download",l.download=t,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?a(l):i(l.href)?r(e,t,n):a(l,l.target="_blank")):(l.href=s.createObjectURL(e),setTimeout((function(){s.revokeObjectURL(l.href)}),4e4),setTimeout((function(){a(l)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,n,o){if(n=n||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(t(e,o),n);else if(i(e))r(e,n,o);else{var s=document.createElement("a");s.href=e,s.target="_blank",setTimeout((function(){a(s)}))}}:function(e,t,n,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof e)return r(e,t,n);var a="application/octet-stream"===e.type,l=/constructor/i.test(o.HTMLElement)||o.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||a&&l||s)&&"undefined"!=typeof FileReader){var c=new FileReader;c.onloadend=function(){var e=c.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=e:location=e,i=null},c.readAsDataURL(e)}else{var d=o.URL||o.webkitURL,h=d.createObjectURL(e);i?i.location=h:location.href=h,i=null,setTimeout((function(){d.revokeObjectURL(h)}),4e4)}});o.saveAs=l.saveAs=l,e.exports=l})?r.apply(t,i):r)||(e.exports=a)},7842:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",i=1,a=2,o=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",d="[object Date]",h="[object Error]",f="[object Function]",p="[object GeneratorFunction]",m="[object Map]",g="[object Number]",v="[object Null]",y="[object Object]",b="[object Promise]",w="[object Proxy]",S="[object RegExp]",x="[object Set]",E="[object String]",_="[object Symbol]",O="[object Undefined]",k="[object WeakMap]",T="[object ArrayBuffer]",C="[object DataView]",I=/^\[object .+?Constructor\]$/,R=/^(?:0|[1-9]\d*)$/,A={};A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A[s]=A[l]=A[T]=A[c]=A[C]=A[d]=A[h]=A[f]=A[m]=A[g]=A[y]=A[S]=A[x]=A[E]=A[k]=!1;var N="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,D="object"==typeof self&&self&&self.Object===Object&&self,L=N||D||Function("return this")(),P=t&&!t.nodeType&&t,M=P&&e&&!e.nodeType&&e,j=M&&M.exports===P,F=j&&N.process,V=function(){try{return F&&F.binding&&F.binding("util")}catch(e){}}(),$=V&&V.isTypedArray;function B(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function z(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function U(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var q,H,W,G=Array.prototype,K=Function.prototype,Q=Object.prototype,Y=L["__core-js_shared__"],X=K.toString,J=Q.hasOwnProperty,Z=(q=/[^.]+$/.exec(Y&&Y.keys&&Y.keys.IE_PROTO||""))?"Symbol(src)_1."+q:"",ee=Q.toString,te=RegExp("^"+X.call(J).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=j?L.Buffer:void 0,re=L.Symbol,ie=L.Uint8Array,ae=Q.propertyIsEnumerable,oe=G.splice,se=re?re.toStringTag:void 0,le=Object.getOwnPropertySymbols,ue=ne?ne.isBuffer:void 0,ce=(H=Object.keys,W=Object,function(e){return H(W(e))}),de=Ve(L,"DataView"),he=Ve(L,"Map"),fe=Ve(L,"Promise"),pe=Ve(L,"Set"),me=Ve(L,"WeakMap"),ge=Ve(Object,"create"),ve=Ue(de),ye=Ue(he),be=Ue(fe),we=Ue(pe),Se=Ue(me),xe=re?re.prototype:void 0,Ee=xe?xe.valueOf:void 0;function _e(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Oe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ke(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Te(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ke;++t<n;)this.add(e[t])}function Ce(e){var t=this.__data__=new Oe(e);this.size=t.size}function Ie(e,t){var n=We(e),r=!n&&He(e),i=!n&&!r&&Ge(e),a=!n&&!r&&!i&&Je(e),o=n||r||i||a,s=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=s.length;for(var u in e)!t&&!J.call(e,u)||o&&("length"==u||i&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ze(u,l))||s.push(u);return s}function Re(e,t){for(var n=e.length;n--;)if(qe(e[n][0],t))return n;return-1}function Ae(e){return null==e?void 0===e?O:v:se&&se in Object(e)?function(e){var t=J.call(e,se),n=e[se];try{e[se]=void 0;var r=!0}catch(e){}var i=ee.call(e);r&&(t?e[se]=n:delete e[se]);return i}(e):function(e){return ee.call(e)}(e)}function Ne(e){return Xe(e)&&Ae(e)==s}function De(e,t,n,r,o){return e===t||(null==e||null==t||!Xe(e)&&!Xe(t)?e!=e&&t!=t:function(e,t,n,r,o,u){var f=We(e),p=We(t),v=f?l:Be(e),b=p?l:Be(t),w=(v=v==s?y:v)==y,O=(b=b==s?y:b)==y,k=v==b;if(k&&Ge(e)){if(!Ge(t))return!1;f=!0,w=!1}if(k&&!w)return u||(u=new Ce),f||Je(e)?Me(e,t,n,r,o,u):function(e,t,n,r,o,s,l){switch(n){case C:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case T:return!(e.byteLength!=t.byteLength||!s(new ie(e),new ie(t)));case c:case d:case g:return qe(+e,+t);case h:return e.name==t.name&&e.message==t.message;case S:case E:return e==t+"";case m:var u=z;case x:var f=r&i;if(u||(u=U),e.size!=t.size&&!f)return!1;var p=l.get(e);if(p)return p==t;r|=a,l.set(e,t);var v=Me(u(e),u(t),r,o,s,l);return l.delete(e),v;case _:if(Ee)return Ee.call(e)==Ee.call(t)}return!1}(e,t,v,n,r,o,u);if(!(n&i)){var I=w&&J.call(e,"__wrapped__"),R=O&&J.call(t,"__wrapped__");if(I||R){var A=I?e.value():e,N=R?t.value():t;return u||(u=new Ce),o(A,N,n,r,u)}}if(!k)return!1;return u||(u=new Ce),function(e,t,n,r,a,o){var s=n&i,l=je(e),u=l.length,c=je(t),d=c.length;if(u!=d&&!s)return!1;var h=u;for(;h--;){var f=l[h];if(!(s?f in t:J.call(t,f)))return!1}var p=o.get(e);if(p&&o.get(t))return p==t;var m=!0;o.set(e,t),o.set(t,e);var g=s;for(;++h<u;){var v=e[f=l[h]],y=t[f];if(r)var b=s?r(y,v,f,t,e,o):r(v,y,f,e,t,o);if(!(void 0===b?v===y||a(v,y,n,r,o):b)){m=!1;break}g||(g="constructor"==f)}if(m&&!g){var w=e.constructor,S=t.constructor;w==S||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof S&&S instanceof S||(m=!1)}return o.delete(e),o.delete(t),m}(e,t,n,r,o,u)}(e,t,n,r,De,o))}function Le(e){return!(!Ye(e)||function(e){return!!Z&&Z in e}(e))&&(Ke(e)?te:I).test(Ue(e))}function Pe(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||Q,t!==r)return ce(e);var t,n,r,i=[];for(var a in Object(e))J.call(e,a)&&"constructor"!=a&&i.push(a);return i}function Me(e,t,n,r,o,s){var l=n&i,u=e.length,c=t.length;if(u!=c&&!(l&&c>u))return!1;var d=s.get(e);if(d&&s.get(t))return d==t;var h=-1,f=!0,p=n&a?new Te:void 0;for(s.set(e,t),s.set(t,e);++h<u;){var m=e[h],g=t[h];if(r)var v=l?r(g,m,h,t,e,s):r(m,g,h,e,t,s);if(void 0!==v){if(v)continue;f=!1;break}if(p){if(!B(t,(function(e,t){if(i=t,!p.has(i)&&(m===e||o(m,e,n,r,s)))return p.push(t);var i}))){f=!1;break}}else if(m!==g&&!o(m,g,n,r,s)){f=!1;break}}return s.delete(e),s.delete(t),f}function je(e){return function(e,t,n){var r=t(e);return We(e)?r:function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}(r,n(e))}(e,Ze,$e)}function Fe(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function Ve(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Le(n)?n:void 0}_e.prototype.clear=function(){this.__data__=ge?ge(null):{},this.size=0},_e.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},_e.prototype.get=function(e){var t=this.__data__;if(ge){var n=t[e];return n===r?void 0:n}return J.call(t,e)?t[e]:void 0},_e.prototype.has=function(e){var t=this.__data__;return ge?void 0!==t[e]:J.call(t,e)},_e.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ge&&void 0===t?r:t,this},Oe.prototype.clear=function(){this.__data__=[],this.size=0},Oe.prototype.delete=function(e){var t=this.__data__,n=Re(t,e);return!(n<0)&&(n==t.length-1?t.pop():oe.call(t,n,1),--this.size,!0)},Oe.prototype.get=function(e){var t=this.__data__,n=Re(t,e);return n<0?void 0:t[n][1]},Oe.prototype.has=function(e){return Re(this.__data__,e)>-1},Oe.prototype.set=function(e,t){var n=this.__data__,r=Re(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},ke.prototype.clear=function(){this.size=0,this.__data__={hash:new _e,map:new(he||Oe),string:new _e}},ke.prototype.delete=function(e){var t=Fe(this,e).delete(e);return this.size-=t?1:0,t},ke.prototype.get=function(e){return Fe(this,e).get(e)},ke.prototype.has=function(e){return Fe(this,e).has(e)},ke.prototype.set=function(e,t){var n=Fe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Te.prototype.add=Te.prototype.push=function(e){return this.__data__.set(e,r),this},Te.prototype.has=function(e){return this.__data__.has(e)},Ce.prototype.clear=function(){this.__data__=new Oe,this.size=0},Ce.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ce.prototype.get=function(e){return this.__data__.get(e)},Ce.prototype.has=function(e){return this.__data__.has(e)},Ce.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Oe){var r=n.__data__;if(!he||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ke(r)}return n.set(e,t),this.size=n.size,this};var $e=le?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}(le(e),(function(t){return ae.call(e,t)})))}:function(){return[]},Be=Ae;function ze(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||R.test(e))&&e>-1&&e%1==0&&e<t}function Ue(e){if(null!=e){try{return X.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function qe(e,t){return e===t||e!=e&&t!=t}(de&&Be(new de(new ArrayBuffer(1)))!=C||he&&Be(new he)!=m||fe&&Be(fe.resolve())!=b||pe&&Be(new pe)!=x||me&&Be(new me)!=k)&&(Be=function(e){var t=Ae(e),n=t==y?e.constructor:void 0,r=n?Ue(n):"";if(r)switch(r){case ve:return C;case ye:return m;case be:return b;case we:return x;case Se:return k}return t});var He=Ne(function(){return arguments}())?Ne:function(e){return Xe(e)&&J.call(e,"callee")&&!ae.call(e,"callee")},We=Array.isArray;var Ge=ue||function(){return!1};function Ke(e){if(!Ye(e))return!1;var t=Ae(e);return t==f||t==p||t==u||t==w}function Qe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function Ye(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Xe(e){return null!=e&&"object"==typeof e}var Je=$?function(e){return function(t){return e(t)}}($):function(e){return Xe(e)&&Qe(e.length)&&!!A[Ae(e)]};function Ze(e){return null!=(t=e)&&Qe(t.length)&&!Ke(t)?Ie(e):Pe(e);var t}e.exports=function(e,t){return De(e,t)}},362:(e,t,n)=>{"use strict";var r=n(6441);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,a,o){if(o!==r){var s=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 s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return n.PropTypes=n,n}},2688:(e,t,n)=>{e.exports=n(362)()},6441:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},585:(e,t,n)=>{"use strict";e.exports=n(5481)},3804:(e,t,n)=>{"use strict";var r=t,i=n(2775),a=n(6866);function o(e,t,n,r){var a=!1;if(t.resolvedType)if(t.resolvedType instanceof i){e("switch(d%s){",r);for(var o=t.resolvedType.values,s=Object.keys(o),l=0;l<s.length;++l)o[s[l]]!==t.typeDefault||a||(e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',r,r,r),t.repeated||e("break"),a=!0),e("case%j:",s[l])("case %i:",o[s[l]])("m%s=%j",r,o[s[l]])("break");e("}")}else e('if(typeof d%s!=="object")',r)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",r,n,r);else{var u=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",r,r);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",r,r);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",r,r);break;case"uint64":u=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",r,r,u)('else if(typeof d%s==="string")',r)("m%s=parseInt(d%s,10)",r,r)('else if(typeof d%s==="number")',r)("m%s=d%s",r,r)('else if(typeof d%s==="object")',r)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",r,r,r,u?"true":"");break;case"bytes":e('if(typeof d%s==="string")',r)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",r,r,r)("else if(d%s.length >= 0)",r)("m%s=d%s",r,r);break;case"string":e("m%s=String(d%s)",r,r);break;case"bool":e("m%s=Boolean(d%s)",r,r)}}return e}function s(e,t,n,r){if(t.resolvedType)t.resolvedType instanceof i?e("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",r,n,r,r,n,r,r):e("d%s=types[%i].toObject(m%s,o)",r,n,r);else{var a=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",r,r,r,r);break;case"uint64":a=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',r)("d%s=o.longs===String?String(m%s):m%s",r,r,r)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",r,r,r,r,a?"true":"",r);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",r,r,r,r,r);break;default:e("d%s=m%s",r,r)}}return e}r.fromObject=function(e){var t=e.fieldsArray,n=a.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return n("return new this.ctor");n("var m=new this.ctor");for(var r=0;r<t.length;++r){var s=t[r].resolve(),l=a.safeProp(s.name);s.map?(n("if(d%s){",l)('if(typeof d%s!=="object")',l)("throw TypeError(%j)",s.fullName+": object expected")("m%s={}",l)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",l),o(n,s,r,l+"[ks[i]]")("}")("}")):s.repeated?(n("if(d%s){",l)("if(!Array.isArray(d%s))",l)("throw TypeError(%j)",s.fullName+": array expected")("m%s=[]",l)("for(var i=0;i<d%s.length;++i){",l),o(n,s,r,l+"[i]")("}")("}")):(s.resolvedType instanceof i||n("if(d%s!=null){",l),o(n,s,r,l),s.resolvedType instanceof i||n("}"))}return n("return m")},r.toObject=function(e){var t=e.fieldsArray.slice().sort(a.compareFieldsById);if(!t.length)return a.codegen()("return {}");for(var n=a.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),r=[],o=[],l=[],u=0;u<t.length;++u)t[u].partOf||(t[u].resolve().repeated?r:t[u].map?o:l).push(t[u]);if(r.length){for(n("if(o.arrays||o.defaults){"),u=0;u<r.length;++u)n("d%s=[]",a.safeProp(r[u].name));n("}")}if(o.length){for(n("if(o.objects||o.defaults){"),u=0;u<o.length;++u)n("d%s={}",a.safeProp(o[u].name));n("}")}if(l.length){for(n("if(o.defaults){"),u=0;u<l.length;++u){var c=l[u],d=a.safeProp(c.name);if(c.resolvedType instanceof i)n("d%s=o.enums===String?%j:%j",d,c.resolvedType.valuesById[c.typeDefault],c.typeDefault);else if(c.long)n("if(util.Long){")("var n=new util.Long(%i,%i,%j)",c.typeDefault.low,c.typeDefault.high,c.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",d)("}else")("d%s=o.longs===String?%j:%i",d,c.typeDefault.toString(),c.typeDefault.toNumber());else if(c.bytes){var h="["+Array.prototype.slice.call(c.typeDefault).join(",")+"]";n("if(o.bytes===String)d%s=%j",d,String.fromCharCode.apply(String,c.typeDefault))("else{")("d%s=%s",d,h)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",d,d)("}")}else n("d%s=%j",d,c.typeDefault)}n("}")}var f=!1;for(u=0;u<t.length;++u){c=t[u];var p=e._fieldsArray.indexOf(c);d=a.safeProp(c.name);c.map?(f||(f=!0,n("var ks2")),n("if(m%s&&(ks2=Object.keys(m%s)).length){",d,d)("d%s={}",d)("for(var j=0;j<ks2.length;++j){"),s(n,c,p,d+"[ks2[j]]")("}")):c.repeated?(n("if(m%s&&m%s.length){",d,d)("d%s=[]",d)("for(var j=0;j<m%s.length;++j){",d),s(n,c,p,d+"[j]")("}")):(n("if(m%s!=null&&m.hasOwnProperty(%j)){",d,c.name),s(n,c,p,d),c.partOf&&n("if(o.oneofs)")("d%s=%j",a.safeProp(c.partOf.name),c.name)),n("}")}return n("return d")}},9980:(e,t,n)=>{"use strict";e.exports=function(e){var t=a.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break");t("switch(t>>>3){");for(var n=0;n<e.fieldsArray.length;++n){var s=e._fieldsArray[n].resolve(),l=s.resolvedType instanceof r?"int32":s.type,u="m"+a.safeProp(s.name);t("case %i: {",s.id),s.map?(t("if(%s===util.emptyObject)",u)("%s={}",u)("var c2 = r.uint32()+r.pos"),void 0!==i.defaults[s.keyType]?t("k=%j",i.defaults[s.keyType]):t("k=null"),void 0!==i.defaults[l]?t("value=%j",i.defaults[l]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",s.keyType)("case 2:"),void 0===i.basic[l]?t("value=types[%i].decode(r,r.uint32())",n):t("value=r.%s()",l),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==i.long[s.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',u):t("%s[k]=value",u)):s.repeated?(t("if(!(%s&&%s.length))",u,u)("%s=[]",u),void 0!==i.packed[l]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",u,l)("}else"),void 0===i.basic[l]?t(s.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",u,n):t("%s.push(r.%s())",u,l)):void 0===i.basic[l]?t(s.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",u,n):t("%s=r.%s()",u,l),t("break")("}")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),n=0;n<e._fieldsArray.length;++n){var c=e._fieldsArray[n];c.required&&t("if(!m.hasOwnProperty(%j))",c.name)("throw util.ProtocolError(%j,{instance:m})",o(c))}return t("return m")};var r=n(2775),i=n(1517),a=n(6866);function o(e){return"missing required '"+e.name+"'"}},8852:(e,t,n)=>{"use strict";e.exports=function(e){for(var t,n=a.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),s=e.fieldsArray.slice().sort(a.compareFieldsById),l=0;l<s.length;++l){var u=s[l].resolve(),c=e._fieldsArray.indexOf(u),d=u.resolvedType instanceof r?"int32":u.type,h=i.basic[d];t="m"+a.safeProp(u.name),u.map?(n("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,u.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(u.id<<3|2)>>>0,8|i.mapKey[u.keyType],u.keyType),void 0===h?n("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",c,t):n(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|h,d,t),n("}")("}")):u.repeated?(n("if(%s!=null&&%s.length){",t,t),u.packed&&void 0!==i.packed[d]?n("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",d,t)("w.ldelim()"):(n("for(var i=0;i<%s.length;++i)",t),void 0===h?o(n,u,c,t+"[i]"):n("w.uint32(%i).%s(%s[i])",(u.id<<3|h)>>>0,d,t)),n("}")):(u.optional&&n("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,u.name),void 0===h?o(n,u,c,t):n("w.uint32(%i).%s(%s)",(u.id<<3|h)>>>0,d,t))}return n("return w")};var r=n(2775),i=n(1517),a=n(6866);function o(e,t,n,r){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",n,r,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",n,r,(t.id<<3|2)>>>0)}},2775:(e,t,n)=>{"use strict";e.exports=o;var r=n(4349);((o.prototype=Object.create(r.prototype)).constructor=o).className="Enum";var i=n(2815),a=n(6866);function o(e,t,n,i,a,o){if(r.call(this,e,n),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=a||{},this.valuesOptions=o,this.reserved=void 0,t)for(var s=Object.keys(t),l=0;l<s.length;++l)"number"==typeof t[s[l]]&&(this.valuesById[this.values[s[l]]=t[s[l]]]=s[l])}o.fromJSON=function(e,t){var n=new o(e,t.values,t.options,t.comment,t.comments);return n.reserved=t.reserved,n},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return a.toObject(["options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},o.prototype.add=function(e,t,n,r){if(!a.isString(e))throw TypeError("name must be a string");if(!a.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return r&&(void 0===this.valuesOptions&&(this.valuesOptions={}),this.valuesOptions[e]=r||null),this.comments[e]=n||null,this},o.prototype.remove=function(e){if(!a.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this},o.prototype.isReservedId=function(e){return i.isReservedId(this.reserved,e)},o.prototype.isReservedName=function(e){return i.isReservedName(this.reserved,e)}},3796:(e,t,n)=>{"use strict";e.exports=u;var r=n(4349);((u.prototype=Object.create(r.prototype)).constructor=u).className="Field";var i,a=n(2775),o=n(1517),s=n(6866),l=/^required|optional|repeated$/;function u(e,t,n,i,a,u,c){if(s.isObject(i)?(c=a,u=i,i=a=void 0):s.isObject(a)&&(c=u,u=a,a=void 0),r.call(this,e,u),!s.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!s.isString(n))throw TypeError("type must be a string");if(void 0!==i&&!l.test(i=i.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==a&&!s.isString(a))throw TypeError("extend must be a string");"proto3_optional"===i&&(i="optional"),this.rule=i&&"optional"!==i?i:void 0,this.type=n,this.id=t,this.extend=a||void 0,this.required="required"===i,this.optional=!this.required,this.repeated="repeated"===i,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!s.Long&&void 0!==o.long[n],this.bytes="bytes"===n,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=c}u.fromJSON=function(e,t){return new u(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(u.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),u.prototype.setOption=function(e,t,n){return"packed"===e&&(this._packed=null),r.prototype.setOption.call(this,e,t,n)},u.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},u.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=o.defaults[this.type])?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof i?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof a&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof a)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=s.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;s.base64.test(this.typeDefault)?s.base64.decode(this.typeDefault,e=s.newBuffer(s.base64.length(this.typeDefault)),0):s.utf8.write(this.typeDefault,e=s.newBuffer(s.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=s.emptyObject:this.repeated?this.defaultValue=s.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof i&&(this.parent.ctor.prototype[this.name]=this.defaultValue),r.prototype.resolve.call(this)},u.d=function(e,t,n,r){return"function"==typeof t?t=s.decorateType(t).name:t&&"object"==typeof t&&(t=s.decorateEnum(t).name),function(i,a){s.decorateType(i.constructor).add(new u(a,e,t,n,{default:r}))}},u._configure=function(e){i=e}},5481:(e,t,n)=>{"use strict";var r=e.exports=n(7134);r.build="light",r.load=function(e,t,n){return"function"==typeof t?(n=t,t=new r.Root):t||(t=new r.Root),t.load(e,n)},r.loadSync=function(e,t){return t||(t=new r.Root),t.loadSync(e)},r.encoder=n(8852),r.decoder=n(9980),r.verifier=n(3040),r.converter=n(3804),r.ReflectionObject=n(4349),r.Namespace=n(2815),r.Root=n(8038),r.Enum=n(2775),r.Type=n(6),r.Field=n(3796),r.OneOf=n(8957),r.MapField=n(9504),r.Service=n(6467),r.Method=n(3055),r.Message=n(6619),r.wrappers=n(6942),r.types=n(1517),r.util=n(6866),r.ReflectionObject._configure(r.Root),r.Namespace._configure(r.Type,r.Service,r.Enum),r.Root._configure(r.Type),r.Field._configure(r.Type)},7134:(e,t,n)=>{"use strict";var r=t;function i(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(4301),r.BufferWriter=n(8422),r.Reader=n(1137),r.BufferReader=n(4010),r.util=n(5382),r.rpc=n(9691),r.roots=n(381),r.configure=i,i()},9504:(e,t,n)=>{"use strict";e.exports=o;var r=n(3796);((o.prototype=Object.create(r.prototype)).constructor=o).className="MapField";var i=n(1517),a=n(6866);function o(e,t,n,i,o,s){if(r.call(this,e,t,i,void 0,void 0,o,s),!a.isString(n))throw TypeError("keyType must be a string");this.keyType=n,this.resolvedKeyType=null,this.map=!0}o.fromJSON=function(e,t){return new o(e,t.id,t.keyType,t.type,t.options,t.comment)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return a.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},o.prototype.resolve=function(){if(this.resolved)return this;if(void 0===i.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return r.prototype.resolve.call(this)},o.d=function(e,t,n){return"function"==typeof n?n=a.decorateType(n).name:n&&"object"==typeof n&&(n=a.decorateEnum(n).name),function(r,i){a.decorateType(r.constructor).add(new o(i,e,t,n))}}},6619:(e,t,n)=>{"use strict";e.exports=i;var r=n(5382);function i(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)this[t[n]]=e[t[n]]}i.create=function(e){return this.$type.create(e)},i.encode=function(e,t){return this.$type.encode(e,t)},i.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},i.decode=function(e){return this.$type.decode(e)},i.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},i.verify=function(e){return this.$type.verify(e)},i.fromObject=function(e){return this.$type.fromObject(e)},i.toObject=function(e,t){return this.$type.toObject(e,t)},i.prototype.toJSON=function(){return this.$type.toObject(this,r.toJSONOptions)}},3055:(e,t,n)=>{"use strict";e.exports=a;var r=n(4349);((a.prototype=Object.create(r.prototype)).constructor=a).className="Method";var i=n(6866);function a(e,t,n,a,o,s,l,u,c){if(i.isObject(o)?(l=o,o=s=void 0):i.isObject(s)&&(l=s,s=void 0),void 0!==t&&!i.isString(t))throw TypeError("type must be a string");if(!i.isString(n))throw TypeError("requestType must be a string");if(!i.isString(a))throw TypeError("responseType must be a string");r.call(this,e,l),this.type=t||"rpc",this.requestType=n,this.requestStream=!!o||void 0,this.responseType=a,this.responseStream=!!s||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=u,this.parsedOptions=c}a.fromJSON=function(e,t){return new a(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},a.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),r.prototype.resolve.call(this))}},2815:(e,t,n)=>{"use strict";e.exports=d;var r=n(4349);((d.prototype=Object.create(r.prototype)).constructor=d).className="Namespace";var i,a,o,s=n(3796),l=n(6866),u=n(8957);function c(e,t){if(e&&e.length){for(var n={},r=0;r<e.length;++r)n[e[r].name]=e[r].toJSON(t);return n}}function d(e,t){r.call(this,e,t),this.nested=void 0,this._nestedArray=null}function h(e){return e._nestedArray=null,e}d.fromJSON=function(e,t){return new d(e,t.options).addJSON(t.nested)},d.arrayToJSON=c,d.isReservedId=function(e,t){if(e)for(var n=0;n<e.length;++n)if("string"!=typeof e[n]&&e[n][0]<=t&&e[n][1]>t)return!0;return!1},d.isReservedName=function(e,t){if(e)for(var n=0;n<e.length;++n)if(e[n]===t)return!0;return!1},Object.defineProperty(d.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=l.toArray(this.nested))}}),d.prototype.toJSON=function(e){return l.toObject(["options",this.options,"nested",c(this.nestedArray,e)])},d.prototype.addJSON=function(e){if(e)for(var t,n=Object.keys(e),r=0;r<n.length;++r)t=e[n[r]],this.add((void 0!==t.fields?i.fromJSON:void 0!==t.values?o.fromJSON:void 0!==t.methods?a.fromJSON:void 0!==t.id?s.fromJSON:d.fromJSON)(n[r],t));return this},d.prototype.get=function(e){return this.nested&&this.nested[e]||null},d.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof o)return this.nested[e].values;throw Error("no such enum: "+e)},d.prototype.add=function(e){if(!(e instanceof s&&void 0!==e.extend||e instanceof i||e instanceof u||e instanceof o||e instanceof a||e instanceof d))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof d&&e instanceof d)||t instanceof i||t instanceof a)throw Error("duplicate name '"+e.name+"' in "+this);for(var n=t.nestedArray,r=0;r<n.length;++r)e.add(n[r]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),h(this)},d.prototype.remove=function(e){if(!(e instanceof r))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),h(this)},d.prototype.define=function(e,t){if(l.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var n=this;e.length>0;){var r=e.shift();if(n.nested&&n.nested[r]){if(!((n=n.nested[r])instanceof d))throw Error("path conflicts with non-namespace objects")}else n.add(n=new d(r))}return t&&n.addJSON(t),n},d.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof d?e[t++].resolveAll():e[t++].resolve();return this.resolve()},d.prototype.lookup=function(e,t,n){if("boolean"==typeof t?(n=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),l.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var r=this.get(e[0]);if(r){if(1===e.length){if(!t||t.indexOf(r.constructor)>-1)return r}else if(r instanceof d&&(r=r.lookup(e.slice(1),t,!0)))return r}else for(var i=0;i<this.nestedArray.length;++i)if(this._nestedArray[i]instanceof d&&(r=this._nestedArray[i].lookup(e,t,!0)))return r;return null===this.parent||n?null:this.parent.lookup(e,t)},d.prototype.lookupType=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such type: "+e);return t},d.prototype.lookupEnum=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},d.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[i,o]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},d.prototype.lookupService=function(e){var t=this.lookup(e,[a]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},d._configure=function(e,t,n){i=e,a=t,o=n}},4349:(e,t,n)=>{"use strict";e.exports=a,a.className="ReflectionObject";var r,i=n(6866);function a(e,t){if(!i.isString(e))throw TypeError("name must be a string");if(t&&!i.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(a.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),a.prototype.toJSON=function(){throw Error()},a.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof r&&t._handleAdd(this)},a.prototype.onRemove=function(e){var t=e.root;t instanceof r&&t._handleRemove(this),this.parent=null,this.resolved=!1},a.prototype.resolve=function(){return this.resolved||this.root instanceof r&&(this.resolved=!0),this},a.prototype.getOption=function(e){if(this.options)return this.options[e]},a.prototype.setOption=function(e,t,n){return n&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},a.prototype.setParsedOption=function(e,t,n){this.parsedOptions||(this.parsedOptions=[]);var r=this.parsedOptions;if(n){var a=r.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(a){var o=a[e];i.setProperty(o,n,t)}else(a={})[e]=i.setProperty({},n,t),r.push(a)}else{var s={};s[e]=t,r.push(s)}return this},a.prototype.setOptions=function(e,t){if(e)for(var n=Object.keys(e),r=0;r<n.length;++r)this.setOption(n[r],e[n[r]],t);return this},a.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},a._configure=function(e){r=e}},8957:(e,t,n)=>{"use strict";e.exports=o;var r=n(4349);((o.prototype=Object.create(r.prototype)).constructor=o).className="OneOf";var i=n(3796),a=n(6866);function o(e,t,n,i){if(Array.isArray(t)||(n=t,t=void 0),r.call(this,e,n),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=i}function s(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}o.fromJSON=function(e,t){return new o(e,t.oneof,t.options,t.comment)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return a.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},o.prototype.add=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,s(this),this},o.prototype.remove=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},o.prototype.onAdd=function(e){r.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var n=e.get(this.oneof[t]);n&&!n.partOf&&(n.partOf=this,this.fieldsArray.push(n))}s(this)},o.prototype.onRemove=function(e){for(var t,n=0;n<this.fieldsArray.length;++n)(t=this.fieldsArray[n]).parent&&t.parent.remove(t);r.prototype.onRemove.call(this,e)},o.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,n){a.decorateType(t.constructor).add(new o(n,e)),Object.defineProperty(t,n,{get:a.oneOfGetter(e),set:a.oneOfSetter(e)})}}},1137:(e,t,n)=>{"use strict";e.exports=l;var r,i=n(5382),a=i.LongBits,o=i.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function l(e){this.buf=e,this.pos=0,this.len=e.length}var u,c="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new l(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new l(e);throw Error("illegal buffer")},d=function(){return i.Buffer?function(e){return(l.create=function(e){return i.Buffer.isBuffer(e)?new r(e):c(e)})(e)}:c};function h(){var e=new a(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function f(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw s(this,8);return new a(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}l.create=d(),l.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,l.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return u}),l.prototype.int32=function(){return 0|this.uint32()},l.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},l.prototype.bool=function(){return 0!==this.uint32()},l.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return f(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|f(this.buf,this.pos+=4)},l.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},l.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},l.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw s(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,n);if(t===n){var r=i.Buffer;return r?r.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,n)},l.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},l.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},l.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},l._configure=function(e){r=e,l.create=d(),r._configure();var t=i.Long?"toLong":"toNumber";i.merge(l.prototype,{int64:function(){return h.call(this)[t](!1)},uint64:function(){return h.call(this)[t](!0)},sint64:function(){return h.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},4010:(e,t,n)=>{"use strict";e.exports=a;var r=n(1137);(a.prototype=Object.create(r.prototype)).constructor=a;var i=n(5382);function a(e){r.call(this,e)}a._configure=function(){i.Buffer&&(a.prototype._slice=i.Buffer.prototype.slice)},a.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},a._configure()},8038:(e,t,n)=>{"use strict";e.exports=d;var r=n(2815);((d.prototype=Object.create(r.prototype)).constructor=d).className="Root";var i,a,o,s=n(3796),l=n(2775),u=n(8957),c=n(6866);function d(e){r.call(this,"",e),this.deferred=[],this.files=[]}function h(){}d.fromJSON=function(e,t){return t||(t=new d),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},d.prototype.resolvePath=c.path.resolve,d.prototype.fetch=c.fetch,d.prototype.load=function e(t,n,r){"function"==typeof n&&(r=n,n=void 0);var i=this;if(!r)return c.asPromise(e,i,t,n);var s=r===h;function l(e,t){if(r){if(s)throw e;var n=r;r=null,n(e,t)}}function u(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var n=e.substring(t);if(n in o)return n}return null}function d(e,t){try{if(c.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),c.isString(t)){a.filename=e;var r,o=a(t,i,n),d=0;if(o.imports)for(;d<o.imports.length;++d)(r=u(o.imports[d])||i.resolvePath(e,o.imports[d]))&&f(r);if(o.weakImports)for(d=0;d<o.weakImports.length;++d)(r=u(o.weakImports[d])||i.resolvePath(e,o.weakImports[d]))&&f(r,!0)}else i.setOptions(t.options).addJSON(t.nested)}catch(e){l(e)}s||p||l(null,i)}function f(e,t){if(e=u(e)||e,!(i.files.indexOf(e)>-1))if(i.files.push(e),e in o)s?d(e,o[e]):(++p,setTimeout((function(){--p,d(e,o[e])})));else if(s){var n;try{n=c.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||l(e))}d(e,n)}else++p,i.fetch(e,(function(n,a){--p,r&&(n?t?p||l(null,i):l(n):d(e,a))}))}var p=0;c.isString(t)&&(t=[t]);for(var m,g=0;g<t.length;++g)(m=i.resolvePath("",t[g]))&&f(m);if(s)return i;p||l(null,i)},d.prototype.loadSync=function(e,t){if(!c.isNode)throw Error("not supported");return this.load(e,t,h)},d.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return r.prototype.resolveAll.call(this)};var f=/^[A-Z]/;function p(e,t){var n=t.parent.lookup(t.extend);if(n){var r=new s(t.fullName,t.id,t.type,t.rule,void 0,t.options);return n.get(r.name)||(r.declaringField=t,t.extensionField=r,n.add(r)),!0}return!1}d.prototype._handleAdd=function(e){if(e instanceof s)void 0===e.extend||e.extensionField||p(0,e)||this.deferred.push(e);else if(e instanceof l)f.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof u)){if(e instanceof i)for(var t=0;t<this.deferred.length;)p(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var n=0;n<e.nestedArray.length;++n)this._handleAdd(e._nestedArray[n]);f.test(e.name)&&(e.parent[e.name]=e)}},d.prototype._handleRemove=function(e){if(e instanceof s){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof l)f.test(e.name)&&delete e.parent[e.name];else if(e instanceof r){for(var n=0;n<e.nestedArray.length;++n)this._handleRemove(e._nestedArray[n]);f.test(e.name)&&delete e.parent[e.name]}},d._configure=function(e,t,n){i=e,a=t,o=n}},381:e=>{"use strict";e.exports={}},9691:(e,t,n)=>{"use strict";t.Service=n(4447)},4447:(e,t,n)=>{"use strict";e.exports=i;var r=n(5382);function i(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(i.prototype=Object.create(r.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,n,i,a,o){if(!a)throw TypeError("request must be specified");var s=this;if(!o)return r.asPromise(e,s,t,n,i,a);if(s.rpcImpl)try{return s.rpcImpl(t,n[s.requestDelimited?"encodeDelimited":"encode"](a).finish(),(function(e,n){if(e)return s.emit("error",e,t),o(e);if(null!==n){if(!(n instanceof i))try{n=i[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return s.emit("error",e,t),o(e)}return s.emit("data",n,t),o(null,n)}s.end(!0)}))}catch(e){return s.emit("error",e,t),void setTimeout((function(){o(e)}),0)}else setTimeout((function(){o(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},6467:(e,t,n)=>{"use strict";e.exports=s;var r=n(2815);((s.prototype=Object.create(r.prototype)).constructor=s).className="Service";var i=n(3055),a=n(6866),o=n(9691);function s(e,t){r.call(this,e,t),this.methods={},this._methodsArray=null}function l(e){return e._methodsArray=null,e}s.fromJSON=function(e,t){var n=new s(e,t.options);if(t.methods)for(var r=Object.keys(t.methods),a=0;a<r.length;++a)n.add(i.fromJSON(r[a],t.methods[r[a]]));return t.nested&&n.addJSON(t.nested),n.comment=t.comment,n},s.prototype.toJSON=function(e){var t=r.prototype.toJSON.call(this,e),n=!!e&&Boolean(e.keepComments);return a.toObject(["options",t&&t.options||void 0,"methods",r.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",n?this.comment:void 0])},Object.defineProperty(s.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=a.toArray(this.methods))}}),s.prototype.get=function(e){return this.methods[e]||r.prototype.get.call(this,e)},s.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return r.prototype.resolve.call(this)},s.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof i?(this.methods[e.name]=e,e.parent=this,l(this)):r.prototype.add.call(this,e)},s.prototype.remove=function(e){if(e instanceof i){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,l(this)}return r.prototype.remove.call(this,e)},s.prototype.create=function(e,t,n){for(var r,i=new o.Service(e,t,n),s=0;s<this.methodsArray.length;++s){var l=a.lcFirst((r=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,"");i[l]=a.codegen(["r","c"],a.isReserved(l)?l+"_":l)("return this.rpcCall(m,q,s,r,c)")({m:r,q:r.resolvedRequestType.ctor,s:r.resolvedResponseType.ctor})}return i}},6:(e,t,n)=>{"use strict";e.exports=y;var r=n(2815);((y.prototype=Object.create(r.prototype)).constructor=y).className="Type";var i=n(2775),a=n(8957),o=n(3796),s=n(9504),l=n(6467),u=n(6619),c=n(1137),d=n(4301),h=n(6866),f=n(8852),p=n(9980),m=n(3040),g=n(3804),v=n(6942);function y(e,t){r.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function b(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(y.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var n=this.fields[e[t]],r=n.id;if(this._fieldsById[r])throw Error("duplicate id "+r+" in "+this);this._fieldsById[r]=n}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=h.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=h.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=y.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof u||((e.prototype=new u).constructor=e,h.merge(e.prototype,t)),e.$type=e.prototype.$type=this,h.merge(e,u,!0),this._ctor=e;for(var n=0;n<this.fieldsArray.length;++n)this._fieldsArray[n].resolve();var r={};for(n=0;n<this.oneofsArray.length;++n)r[this._oneofsArray[n].resolve().name]={get:h.oneOfGetter(this._oneofsArray[n].oneof),set:h.oneOfSetter(this._oneofsArray[n].oneof)};n&&Object.defineProperties(e.prototype,r)}}}),y.generateConstructor=function(e){for(var t,n=h.codegen(["p"],e.name),r=0;r<e.fieldsArray.length;++r)(t=e._fieldsArray[r]).map?n("this%s={}",h.safeProp(t.name)):t.repeated&&n("this%s=[]",h.safeProp(t.name));return n("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},y.fromJSON=function(e,t){var n=new y(e,t.options);n.extensions=t.extensions,n.reserved=t.reserved;for(var u=Object.keys(t.fields),c=0;c<u.length;++c)n.add((void 0!==t.fields[u[c]].keyType?s.fromJSON:o.fromJSON)(u[c],t.fields[u[c]]));if(t.oneofs)for(u=Object.keys(t.oneofs),c=0;c<u.length;++c)n.add(a.fromJSON(u[c],t.oneofs[u[c]]));if(t.nested)for(u=Object.keys(t.nested),c=0;c<u.length;++c){var d=t.nested[u[c]];n.add((void 0!==d.id?o.fromJSON:void 0!==d.fields?y.fromJSON:void 0!==d.values?i.fromJSON:void 0!==d.methods?l.fromJSON:r.fromJSON)(u[c],d))}return t.extensions&&t.extensions.length&&(n.extensions=t.extensions),t.reserved&&t.reserved.length&&(n.reserved=t.reserved),t.group&&(n.group=!0),t.comment&&(n.comment=t.comment),n},y.prototype.toJSON=function(e){var t=r.prototype.toJSON.call(this,e),n=!!e&&Boolean(e.keepComments);return h.toObject(["options",t&&t.options||void 0,"oneofs",r.arrayToJSON(this.oneofsArray,e),"fields",r.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",n?this.comment:void 0])},y.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var n=this.oneofsArray;for(t=0;t<n.length;)n[t++].resolve();return r.prototype.resolveAll.call(this)},y.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},y.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof o&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),b(this)}return e instanceof a?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),b(this)):r.prototype.add.call(this,e)},y.prototype.remove=function(e){if(e instanceof o&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),b(this)}if(e instanceof a){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),b(this)}return r.prototype.remove.call(this,e)},y.prototype.isReservedId=function(e){return r.isReservedId(this.reserved,e)},y.prototype.isReservedName=function(e){return r.isReservedName(this.reserved,e)},y.prototype.create=function(e){return new this.ctor(e)},y.prototype.setup=function(){for(var e=this.fullName,t=[],n=0;n<this.fieldsArray.length;++n)t.push(this._fieldsArray[n].resolve().resolvedType);this.encode=f(this)({Writer:d,types:t,util:h}),this.decode=p(this)({Reader:c,types:t,util:h}),this.verify=m(this)({types:t,util:h}),this.fromObject=g.fromObject(this)({types:t,util:h}),this.toObject=g.toObject(this)({types:t,util:h});var r=v[e];if(r){var i=Object.create(this);i.fromObject=this.fromObject,this.fromObject=r.fromObject.bind(i),i.toObject=this.toObject,this.toObject=r.toObject.bind(i)}return this},y.prototype.encode=function(e,t){return this.setup().encode(e,t)},y.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},y.prototype.decode=function(e,t){return this.setup().decode(e,t)},y.prototype.decodeDelimited=function(e){return e instanceof c||(e=c.create(e)),this.decode(e,e.uint32())},y.prototype.verify=function(e){return this.setup().verify(e)},y.prototype.fromObject=function(e){return this.setup().fromObject(e)},y.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},y.d=function(e){return function(t){h.decorateType(t,e)}}},1517:(e,t,n)=>{"use strict";var r=t,i=n(6866),a=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function o(e,t){var n=0,r={};for(t|=0;n<e.length;)r[a[n+t]]=e[n++];return r}r.basic=o([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),r.defaults=o([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",i.emptyArray,null]),r.long=o([0,0,0,1,1],7),r.mapKey=o([0,0,0,5,5,0,0,0,1,1,0,2],2),r.packed=o([1,5,0,0,0,5,5,0,0,0,1,1,0])},6866:(e,t,n)=>{"use strict";var r,i,a=e.exports=n(5382),o=n(381);a.codegen=n(7669),a.fetch=n(9240),a.path=n(2459),a.fs=a.inquire("fs"),a.toArray=function(e){if(e){for(var t=Object.keys(e),n=new Array(t.length),r=0;r<t.length;)n[r]=e[t[r++]];return n}return[]},a.toObject=function(e){for(var t={},n=0;n<e.length;){var r=e[n++],i=e[n++];void 0!==i&&(t[r]=i)}return t};var s=/\\/g,l=/"/g;a.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},a.safeProp=function(e){return!/^[$\w_]+$/.test(e)||a.isReserved(e)?'["'+e.replace(s,"\\\\").replace(l,'\\"')+'"]':"."+e},a.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var u=/_([a-z])/g;a.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(u,(function(e,t){return t.toUpperCase()}))},a.compareFieldsById=function(e,t){return e.id-t.id},a.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(a.decorateRoot.remove(e.$type),e.$type.name=t,a.decorateRoot.add(e.$type)),e.$type;r||(r=n(6));var i=new r(t||e.name);return a.decorateRoot.add(i),i.ctor=e,Object.defineProperty(e,"$type",{value:i,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:i,enumerable:!1}),i};var c=0;a.decorateEnum=function(e){if(e.$type)return e.$type;i||(i=n(2775));var t=new i("Enum"+c++,e);return a.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},a.setProperty=function(e,t,n){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,n,r){var i=n.shift();if("__proto__"===i||"prototype"===i)return t;if(n.length>0)t[i]=e(t[i]||{},n,r);else{var a=t[i];a&&(r=[].concat(a).concat(r)),t[i]=r}return t}(e,t=t.split("."),n)},Object.defineProperty(a,"decorateRoot",{get:function(){return o.decorated||(o.decorated=new(n(8038)))}})},5003:(e,t,n)=>{"use strict";e.exports=i;var r=n(5382);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var a=i.zero=new i(0,0);a.toNumber=function(){return 0},a.zzEncode=a.zzDecode=function(){return this},a.length=function(){return 1};var o=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return a;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new i(n,r)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(r.isString(e)){if(!r.Long)return i.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):a},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;i.fromHash=function(e){return e===o?a:new i((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},5382:function(e,t,n){"use strict";var r=t;function i(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;++i)void 0!==e[r[i]]&&n||(e[r[i]]=t[r[i]]);return e}function a(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&i(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}r.asPromise=n(6233),r.base64=n(1979),r.EventEmitter=n(3474),r.float=n(5750),r.inquire=n(1925),r.utf8=n(2971),r.pool=n(4226),r.LongBits=n(5003),r.isNode=Boolean(void 0!==n.g&&n.g&&n.g.process&&n.g.process.versions&&n.g.process.versions.node),r.global=r.isNode&&n.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=i,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=a,r.ProtocolError=a("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},3040:(e,t,n)=>{"use strict";e.exports=function(e){var t=i.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),n=e.oneofsArray,r={};n.length&&t("var p={}");for(var l=0;l<e.fieldsArray.length;++l){var u=e._fieldsArray[l].resolve(),c="m"+i.safeProp(u.name);if(u.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",c,u.name),u.map)t("if(!util.isObject(%s))",c)("return%j",a(u,"object"))("var k=Object.keys(%s)",c)("for(var i=0;i<k.length;++i){"),s(t,u,"k[i]"),o(t,u,l,c+"[k[i]]")("}");else if(u.repeated)t("if(!Array.isArray(%s))",c)("return%j",a(u,"array"))("for(var i=0;i<%s.length;++i){",c),o(t,u,l,c+"[i]")("}");else{if(u.partOf){var d=i.safeProp(u.partOf.name);1===r[u.partOf.name]&&t("if(p%s===1)",d)("return%j",u.partOf.name+": multiple values"),r[u.partOf.name]=1,t("p%s=1",d)}o(t,u,l,c)}u.optional&&t("}")}return t("return null")};var r=n(2775),i=n(6866);function a(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function o(e,t,n,i){if(t.resolvedType)if(t.resolvedType instanceof r){e("switch(%s){",i)("default:")("return%j",a(t,"enum value"));for(var o=Object.keys(t.resolvedType.values),s=0;s<o.length;++s)e("case %i:",t.resolvedType.values[o[s]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",n,i)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",i)("return%j",a(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",i,i,i,i)("return%j",a(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',i)("return%j",a(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',i)("return%j",a(t,"boolean"));break;case"string":e("if(!util.isString(%s))",i)("return%j",a(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",a(t,"buffer"))}return e}function s(e,t,n){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",n)("return%j",a(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",n)("return%j",a(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",n)("return%j",a(t,"boolean key"))}return e}},6942:(e,t,n)=>{"use strict";var r=t,i=n(6619);r[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),n=this.lookup(t);if(n){var r="."===e["@type"].charAt(0)?e["@type"].slice(1):e["@type"];return-1===r.indexOf("/")&&(r="/"+r),this.create({type_url:r,value:n.encode(n.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var n="",r="";if(t&&t.json&&e.type_url&&e.value){r=e.type_url.substring(e.type_url.lastIndexOf("/")+1),n=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var a=this.lookup(r);a&&(e=a.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof i){var o=e.$type.toObject(e,t);return""===n&&(n="type.googleapis.com/"),r=n+("."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName),o["@type"]=r,o}return this.toObject(e,t)}}},4301:(e,t,n)=>{"use strict";e.exports=d;var r,i=n(5382),a=i.LongBits,o=i.base64,s=i.utf8;function l(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function u(){}function c(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new l(u,0,0),this.tail=this.head,this.states=null}var h=function(){return i.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d}};function f(e,t,n){t[n]=255&e}function p(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function g(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}d.create=h(),d.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(d.alloc=i.pool(d.alloc,i.Array.prototype.subarray)),d.prototype._push=function(e,t,n){return this.tail=this.tail.next=new l(e,t,n),this.len+=t,this},p.prototype=Object.create(l.prototype),p.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(m,10,a.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.uint64=function(e){var t=a.from(e);return this._push(m,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=a.from(e).zzEncode();return this._push(m,t.length(),t)},d.prototype.bool=function(e){return this._push(f,1,e?1:0)},d.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=a.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var v=i.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};d.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(i.isString(e)){var n=d.alloc(t=o.length(e));o.decode(e,n,0),e=n}return this.uint32(t)._push(v,t,e)},d.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(f,1,0)},d.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new l(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new l(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},d._configure=function(e){r=e,d.create=h(),r._configure()}},8422:(e,t,n)=>{"use strict";e.exports=a;var r=n(4301);(a.prototype=Object.create(r.prototype)).constructor=a;var i=n(5382);function a(){r.call(this)}function o(e,t,n){e.length<40?i.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}a._configure=function(){a.alloc=i._Buffer_allocUnsafe,a.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},a.prototype.bytes=function(e){i.isString(e)&&(e=i._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(a.writeBytesBuffer,t,e),this},a.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(o,t,e),this},a._configure()},9111:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(5959)),i=h(n(2688)),a=h(n(8398)),o=h(n(8262)),s=n(2837),l=n(402),u=n(6732),c=h(n(1060)),d=h(n(7988));function h(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function p(){return p=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},p.apply(this,arguments)}function m(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class g extends r.Component{static getDerivedStateFromProps(e,t){let{position:n}=e,{prevPropsPosition:r}=t;return!n||r&&n.x===r.x&&n.y===r.y?null:((0,d.default)("Draggable: getDerivedStateFromProps %j",{position:n,prevPropsPosition:r}),{x:n.x,y:n.y,prevPropsPosition:{...n}})}constructor(e){super(e),m(this,"onDragStart",((e,t)=>{(0,d.default)("Draggable: onDragStart: %j",t);if(!1===this.props.onStart(e,(0,l.createDraggableData)(this,t)))return!1;this.setState({dragging:!0,dragged:!0})})),m(this,"onDrag",((e,t)=>{if(!this.state.dragging)return!1;(0,d.default)("Draggable: onDrag: %j",t);const n=(0,l.createDraggableData)(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){const{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;const[i,a]=(0,l.getBoundPosition)(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(!1===this.props.onDrag(e,n))return!1;this.setState(r)})),m(this,"onDragStop",((e,t)=>{if(!this.state.dragging)return!1;if(!1===this.props.onStop(e,(0,l.createDraggableData)(this,t)))return!1;(0,d.default)("Draggable: onDragStop: %j",t);const n={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){const{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)})),this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},!e.position||e.onDrag||e.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(){void 0!==window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var e,t;return null!==(e=null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current)&&void 0!==e?e:a.default.findDOMNode(this)}render(){const{axis:e,bounds:t,children:n,defaultPosition:i,defaultClassName:a,defaultClassNameDragging:u,defaultClassNameDragged:d,position:h,positionOffset:f,scale:m,...g}=this.props;let v={},y=null;const b=!Boolean(h)||this.state.dragging,w=h||i,S={x:(0,l.canDragX)(this)&&b?this.state.x:w.x,y:(0,l.canDragY)(this)&&b?this.state.y:w.y};this.state.isElementSVG?y=(0,s.createSVGTransform)(S,f):v=(0,s.createCSSTransform)(S,f);const x=(0,o.default)(n.props.className||"",a,{[u]:this.state.dragging,[d]:this.state.dragged});return r.createElement(c.default,p({},g,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),r.cloneElement(r.Children.only(n),{className:x,style:{...n.props.style,...v},transform:y}))}}t.default=g,m(g,"displayName","Draggable"),m(g,"propTypes",{...c.default.propTypes,axis:i.default.oneOf(["both","x","y","none"]),bounds:i.default.oneOfType([i.default.shape({left:i.default.number,right:i.default.number,top:i.default.number,bottom:i.default.number}),i.default.string,i.default.oneOf([!1])]),defaultClassName:i.default.string,defaultClassNameDragging:i.default.string,defaultClassNameDragged:i.default.string,defaultPosition:i.default.shape({x:i.default.number,y:i.default.number}),positionOffset:i.default.shape({x:i.default.oneOfType([i.default.number,i.default.string]),y:i.default.oneOfType([i.default.number,i.default.string])}),position:i.default.shape({x:i.default.number,y:i.default.number}),className:u.dontSetMe,style:u.dontSetMe,transform:u.dontSetMe}),m(g,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})},1060:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(5959)),i=c(n(2688)),a=c(n(8398)),o=n(2837),s=n(402),l=n(6732),u=c(n(7988));function c(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function h(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const f={start:"touchstart",move:"touchmove",stop:"touchend"},p={start:"mousedown",move:"mousemove",stop:"mouseup"};let m=p;class g extends r.Component{constructor(){super(...arguments),h(this,"dragging",!1),h(this,"lastX",NaN),h(this,"lastY",NaN),h(this,"touchIdentifier",null),h(this,"mounted",!1),h(this,"handleDragStart",(e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&"number"==typeof e.button&&0!==e.button)return!1;const t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!(0,o.matchesSelectorAndParentsTo)(e.target,this.props.handle,t)||this.props.cancel&&(0,o.matchesSelectorAndParentsTo)(e.target,this.props.cancel,t))return;"touchstart"===e.type&&e.preventDefault();const r=(0,o.getTouchIdentifier)(e);this.touchIdentifier=r;const i=(0,s.getControlPosition)(e,r,this);if(null==i)return;const{x:a,y:l}=i,c=(0,s.createCoreData)(this,a,l);(0,u.default)("DraggableCore: handleDragStart: %j",c),(0,u.default)("calling",this.props.onStart);!1!==this.props.onStart(e,c)&&!1!==this.mounted&&(this.props.enableUserSelectHack&&(0,o.addUserSelectStyles)(n),this.dragging=!0,this.lastX=a,this.lastY=l,(0,o.addEvent)(n,m.move,this.handleDrag),(0,o.addEvent)(n,m.stop,this.handleDragStop))})),h(this,"handleDrag",(e=>{const t=(0,s.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=(0,s.snapToGrid)(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}const i=(0,s.createCoreData)(this,n,r);(0,u.default)("DraggableCore: handleDrag: %j",i);if(!1!==this.props.onDrag(e,i)&&!1!==this.mounted)this.lastX=n,this.lastY=r;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch(e){const t=document.createEvent("MouseEvents");t.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(t)}})),h(this,"handleDragStop",(e=>{if(!this.dragging)return;const t=(0,s.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=(0,s.snapToGrid)(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}const i=(0,s.createCoreData)(this,n,r);if(!1===this.props.onStop(e,i)||!1===this.mounted)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,o.removeUserSelectStyles)(a.ownerDocument),(0,u.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,u.default)("DraggableCore: Removing handlers"),(0,o.removeEvent)(a.ownerDocument,m.move,this.handleDrag),(0,o.removeEvent)(a.ownerDocument,m.stop,this.handleDragStop))})),h(this,"onMouseDown",(e=>(m=p,this.handleDragStart(e)))),h(this,"onMouseUp",(e=>(m=p,this.handleDragStop(e)))),h(this,"onTouchStart",(e=>(m=f,this.handleDragStart(e)))),h(this,"onTouchEnd",(e=>(m=f,this.handleDragStop(e))))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,o.addEvent)(e,f.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:t}=e;(0,o.removeEvent)(t,p.move,this.handleDrag),(0,o.removeEvent)(t,f.move,this.handleDrag),(0,o.removeEvent)(t,p.stop,this.handleDragStop),(0,o.removeEvent)(t,f.stop,this.handleDragStop),(0,o.removeEvent)(e,f.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,o.removeUserSelectStyles)(t)}}findDOMNode(){var e,t;return null!==(e=this.props)&&void 0!==e&&e.nodeRef?null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current:a.default.findDOMNode(this)}render(){return r.cloneElement(r.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}t.default=g,h(g,"displayName","DraggableCore"),h(g,"propTypes",{allowAnyClick:i.default.bool,children:i.default.node.isRequired,disabled:i.default.bool,enableUserSelectHack:i.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:i.default.arrayOf(i.default.number),handle:i.default.string,cancel:i.default.string,nodeRef:i.default.object,onStart:i.default.func,onDrag:i.default.func,onStop:i.default.func,onMouseDown:i.default.func,scale:i.default.number,className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe}),h(g,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})},8230:(e,t,n)=>{"use strict";const{default:r,DraggableCore:i}=n(9111);e.exports=r,e.exports.default=r,e.exports.DraggableCore=i},2837:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addClassName=u,t.addEvent=function(e,t,n,r){if(!e)return;const i={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,i):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},t.addUserSelectStyles=function(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;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t));e.body&&u(e.body,"react-draggable-transparent-selection")},t.createCSSTransform=function(e,t){const n=l(e,t,"px");return{[(0,i.browserPrefixToKey)("transform",i.default)]:n}},t.createSVGTransform=function(e,t){return l(e,t,"")},t.getTouch=function(e,t){return e.targetTouches&&(0,r.findInArray)(e.targetTouches,(e=>t===e.identifier))||e.changedTouches&&(0,r.findInArray)(e.changedTouches,(e=>t===e.identifier))},t.getTouchIdentifier=function(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier},t.getTranslation=l,t.innerHeight=function(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,r.int)(n.paddingTop),t-=(0,r.int)(n.paddingBottom),t},t.innerWidth=function(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,r.int)(n.paddingLeft),t-=(0,r.int)(n.paddingRight),t},t.matchesSelector=s,t.matchesSelectorAndParentsTo=function(e,t,n){let r=e;do{if(s(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1},t.offsetXYFromParent=function(e,t,n){const r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-r.left)/n,a=(e.clientY+t.scrollTop-r.top)/n;return{x:i,y:a}},t.outerHeight=function(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,r.int)(n.borderTopWidth),t+=(0,r.int)(n.borderBottomWidth),t},t.outerWidth=function(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,r.int)(n.borderLeftWidth),t+=(0,r.int)(n.borderRightWidth),t},t.removeClassName=c,t.removeEvent=function(e,t,n,r){if(!e)return;const i={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,i):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},t.removeUserSelectStyles=function(e){if(!e)return;try{if(e.body&&c(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(e){}};var r=n(6732),i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(7350));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}let o="";function s(e,t){return o||(o=(0,r.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],(function(t){return(0,r.isFunction)(e[t])}))),!!(0,r.isFunction)(e[o])&&e[o](t)}function l(e,t,n){let{x:r,y:i}=e,a="translate(".concat(r).concat(n,",").concat(i).concat(n,")");if(t){const e="".concat("string"==typeof t.x?t.x:t.x+n),r="".concat("string"==typeof t.y?t.y:t.y+n);a="translate(".concat(e,", ").concat(r,")")+a}return a}function u(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function c(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}},7350:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.browserPrefixToKey=i,t.browserPrefixToStyle=function(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e},t.default=void 0,t.getPrefix=r;const n=["Moz","Webkit","O","ms"];function r(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window)return"";const r=null===(e=window.document)||void 0===e||null===(e=e.documentElement)||void 0===e?void 0:e.style;if(!r)return"";if(t in r)return"";for(let e=0;e<n.length;e++)if(i(t,n[e])in r)return n[e];return""}function i(e,t){return t?"".concat(t).concat(function(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}(e)):e}t.default=r()},7988:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){0}},402:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canDragX=function(e){return"both"===e.props.axis||"x"===e.props.axis},t.canDragY=function(e){return"both"===e.props.axis||"y"===e.props.axis},t.createCoreData=function(e,t,n){const i=!(0,r.isNum)(e.lastX),o=a(e);return i?{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}},t.createDraggableData=function(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}},t.getBoundPosition=function(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:o}=e.props;o="string"==typeof o?o:function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(o);const s=a(e);if("string"==typeof o){const{ownerDocument:e}=s,t=e.defaultView;let n;if(n="parent"===o?s.parentNode:e.querySelector(o),!(n instanceof t.HTMLElement))throw new Error('Bounds selector "'+o+'" could not find an element.');const a=n,l=t.getComputedStyle(s),u=t.getComputedStyle(a);o={left:-s.offsetLeft+(0,r.int)(u.paddingLeft)+(0,r.int)(l.marginLeft),top:-s.offsetTop+(0,r.int)(u.paddingTop)+(0,r.int)(l.marginTop),right:(0,i.innerWidth)(a)-(0,i.outerWidth)(s)-s.offsetLeft+(0,r.int)(u.paddingRight)-(0,r.int)(l.marginRight),bottom:(0,i.innerHeight)(a)-(0,i.outerHeight)(s)-s.offsetTop+(0,r.int)(u.paddingBottom)-(0,r.int)(l.marginBottom)}}(0,r.isNum)(o.right)&&(t=Math.min(t,o.right));(0,r.isNum)(o.bottom)&&(n=Math.min(n,o.bottom));(0,r.isNum)(o.left)&&(t=Math.max(t,o.left));(0,r.isNum)(o.top)&&(n=Math.max(n,o.top));return[t,n]},t.getControlPosition=function(e,t,n){const r="number"==typeof t?(0,i.getTouch)(e,t):null;if("number"==typeof t&&!r)return null;const o=a(n),s=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,i.offsetXYFromParent)(r||e,s,n.props.scale)},t.snapToGrid=function(e,t,n){const r=Math.round(t/e[0])*e[0],i=Math.round(n/e[1])*e[1];return[r,i]};var r=n(6732),i=n(2837);function a(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}},6732:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dontSetMe=function(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."))},t.findInArray=function(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]},t.int=function(e){return parseInt(e,10)},t.isFunction=function(e){return"function"==typeof e||"[object Function]"===Object.prototype.toString.call(e)},t.isNum=function(e){return"number"==typeof e&&!isNaN(e)}},8262:(e,t,n)=>{"use strict";function r(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(i&&(i+=" "),i+=n);else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}function i(){for(var e,t,n=0,i="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(i&&(i+=" "),i+=t);return i}n.r(t),n.d(t,{clsx:()=>i,default:()=>a});const a=i},8100:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=h(n(5959)),a=h(n(2688)),o=n(8230),s=n(936),l=n(414),u=n(906),c=n(7222),d=h(n(7256));function h(e){return e&&e.__esModule?e:{default:e}}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function g(e,t){return g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},g(e,t)}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=b(e);if(t){var a=b(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}(this,n)}}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var S=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}(c,e);var t,n,r,a=v(c);function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return w(y(e=a.call.apply(a,[this].concat(n))),"state",{resizing:null,dragging:null,className:""}),w(y(e),"elementRef",i.default.createRef()),w(y(e),"onDragStart",(function(t,n){var r=n.node,i=e.props,a=i.onDragStart,o=i.transformScale;if(a){var s={top:0,left:0},l=r.offsetParent;if(l){var c=l.getBoundingClientRect(),d=r.getBoundingClientRect(),h=d.left/o,f=c.left/o,p=d.top/o,m=c.top/o;s.left=h-f+l.scrollLeft,s.top=p-m+l.scrollTop,e.setState({dragging:s});var g=(0,u.calcXY)(e.getPositionParams(),s.top,s.left,e.props.w,e.props.h),v=g.x,b=g.y;return a.call(y(e),e.props.i,v,b,{e:t,node:r,newPosition:s})}}})),w(y(e),"onDrag",(function(t,n){var r=n.node,i=n.deltaX,a=n.deltaY,o=e.props.onDrag;if(o){if(!e.state.dragging)throw new Error("onDrag called before onDragStart.");var s=e.state.dragging.top+a,l=e.state.dragging.left+i,c=e.props,d=c.isBounded,h=c.i,f=c.w,p=c.h,m=c.containerWidth,g=e.getPositionParams();if(d){var v=r.offsetParent;if(v){var b=e.props,w=b.margin,S=b.rowHeight,x=v.clientHeight-(0,u.calcGridItemWHPx)(p,S,w[1]);s=(0,u.clamp)(s,0,x);var E=(0,u.calcGridColWidth)(g),_=m-(0,u.calcGridItemWHPx)(f,E,w[0]);l=(0,u.clamp)(l,0,_)}}var O={top:s,left:l};e.setState({dragging:O});var k=(0,u.calcXY)(g,s,l,f,p),T=k.x,C=k.y;return o.call(y(e),h,T,C,{e:t,node:r,newPosition:O})}})),w(y(e),"onDragStop",(function(t,n){var r=n.node,i=e.props.onDragStop;if(i){if(!e.state.dragging)throw new Error("onDragEnd called before onDragStart.");var a=e.props,o=a.w,s=a.h,l=a.i,c=e.state.dragging,d=c.left,h=c.top,f={top:h,left:d};e.setState({dragging:null});var p=(0,u.calcXY)(e.getPositionParams(),h,d,o,s),m=p.x,g=p.y;return i.call(y(e),l,m,g,{e:t,node:r,newPosition:f})}})),w(y(e),"onResizeStop",(function(t,n){e.onResizeHandler(t,n,"onResizeStop")})),w(y(e),"onResizeStart",(function(t,n){e.onResizeHandler(t,n,"onResizeStart")})),w(y(e),"onResize",(function(t,n){e.onResizeHandler(t,n,"onResize")})),e}return t=c,n=[{key:"shouldComponentUpdate",value:function(e,t){if(this.props.children!==e.children)return!0;if(this.props.droppingPosition!==e.droppingPosition)return!0;var n=(0,u.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),r=(0,u.calcGridItemPosition)(this.getPositionParams(e),e.x,e.y,e.w,e.h,t);return!(0,l.fastPositionEqual)(n,r)||this.props.useCSSTransforms!==e.useCSSTransforms}},{key:"componentDidMount",value:function(){this.moveDroppingItem({})}},{key:"componentDidUpdate",value:function(e){this.moveDroppingItem(e)}},{key:"moveDroppingItem",value:function(e){var t=this.props.droppingPosition;if(t){var n=this.elementRef.current;if(n){var r=e.droppingPosition||{left:0,top:0},i=this.state.dragging,a=i&&t.left!==r.left||t.top!==r.top;if(i){if(a){var o=t.left-i.left,s=t.top-i.top;this.onDrag(t.e,{node:n,deltaX:o,deltaY:s})}}else this.onDragStart(t.e,{node:n,deltaX:t.left,deltaY:t.top})}}}},{key:"getPositionParams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props;return{cols:e.cols,containerPadding:e.containerPadding,containerWidth:e.containerWidth,margin:e.margin,maxRows:e.maxRows,rowHeight:e.rowHeight}}},{key:"createStyle",value:function(e){var t,n=this.props,r=n.usePercentages,i=n.containerWidth;return n.useCSSTransforms?t=(0,l.setTransform)(e):(t=(0,l.setTopLeft)(e),r&&(t.left=(0,l.perc)(e.left/i),t.width=(0,l.perc)(e.width/i))),t}},{key:"mixinDraggable",value:function(e,t){return i.default.createElement(o.DraggableCore,{disabled:!t,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},e)}},{key:"mixinResizable",value:function(e,t,n){var r=this.props,a=r.cols,o=r.x,l=r.minW,c=r.minH,d=r.maxW,h=r.maxH,f=r.transformScale,p=r.resizeHandles,m=r.resizeHandle,g=this.getPositionParams(),v=(0,u.calcGridItemPosition)(g,0,0,a-o,0).width,y=(0,u.calcGridItemPosition)(g,0,0,l,c),b=(0,u.calcGridItemPosition)(g,0,0,d,h),w=[y.width,y.height],S=[Math.min(b.width,v),Math.min(b.height,1/0)];return i.default.createElement(s.Resizable,{draggableOpts:{disabled:!n},className:n?void 0:"react-resizable-hide",width:t.width,height:t.height,minConstraints:w,maxConstraints:S,onResizeStop:this.onResizeStop,onResizeStart:this.onResizeStart,onResize:this.onResize,transformScale:f,resizeHandles:p,handle:m},e)}},{key:"onResizeHandler",value:function(e,t,n){var r=t.node,i=t.size,a=this.props[n];if(a){var o=this.props,s=o.cols,l=o.x,c=o.y,d=o.i,h=o.maxH,f=o.minH,p=this.props,m=p.minW,g=p.maxW,v=(0,u.calcWH)(this.getPositionParams(),i.width,i.height,l,c),y=v.w,b=v.h;m=Math.max(m,1),g=Math.min(g,s-l),y=(0,u.clamp)(y,m,g),b=(0,u.clamp)(b,f,h),this.setState({resizing:"onResizeStop"===n?null:i}),a.call(this,d,y,b,{e,node:r,size:i})}}},{key:"render",value:function(){var e=this.props,t=e.x,n=e.y,r=e.w,a=e.h,o=e.isDraggable,s=e.isResizable,l=e.droppingPosition,c=e.useCSSTransforms,h=(0,u.calcGridItemPosition)(this.getPositionParams(),t,n,r,a,this.state),f=i.default.Children.only(this.props.children),m=i.default.cloneElement(f,{ref:this.elementRef,className:(0,d.default)("react-grid-item",f.props.className,this.props.className,{static:this.props.static,resizing:Boolean(this.state.resizing),"react-draggable":o,"react-draggable-dragging":Boolean(this.state.dragging),dropping:Boolean(l),cssTransforms:c}),style:p(p(p({},this.props.style),f.props.style),this.createStyle(h))});return m=this.mixinResizable(m,h,s),m=this.mixinDraggable(m,o)}}],n&&m(t.prototype,n),r&&m(t,r),Object.defineProperty(t,"prototype",{writable:!1}),c}(i.default.Component);t.default=S,w(S,"propTypes",{children:a.default.element,cols:a.default.number.isRequired,containerWidth:a.default.number.isRequired,rowHeight:a.default.number.isRequired,margin:a.default.array.isRequired,maxRows:a.default.number.isRequired,containerPadding:a.default.array.isRequired,x:a.default.number.isRequired,y:a.default.number.isRequired,w:a.default.number.isRequired,h:a.default.number.isRequired,minW:function(e,t){var n=e[t];return"number"!=typeof n?new Error("minWidth not Number"):n>e.w||n>e.maxW?new Error("minWidth larger than item width/maxWidth"):void 0},maxW:function(e,t){var n=e[t];return"number"!=typeof n?new Error("maxWidth not Number"):n<e.w||n<e.minW?new Error("maxWidth smaller than item width/minWidth"):void 0},minH:function(e,t){var n=e[t];return"number"!=typeof n?new Error("minHeight not Number"):n>e.h||n>e.maxH?new Error("minHeight larger than item height/maxHeight"):void 0},maxH:function(e,t){var n=e[t];return"number"!=typeof n?new Error("maxHeight not Number"):n<e.h||n<e.minH?new Error("maxHeight smaller than item height/minHeight"):void 0},i:a.default.string.isRequired,resizeHandles:c.resizeHandleAxesType,resizeHandle:c.resizeHandleType,onDragStop:a.default.func,onDragStart:a.default.func,onDrag:a.default.func,onResizeStop:a.default.func,onResizeStart:a.default.func,onResize:a.default.func,isDraggable:a.default.bool.isRequired,isResizable:a.default.bool.isRequired,isBounded:a.default.bool.isRequired,static:a.default.bool,useCSSTransforms:a.default.bool.isRequired,transformScale:a.default.number,className:a.default.string,handle:a.default.string,cancel:a.default.string,droppingPosition:a.default.shape({e:a.default.object.isRequired,left:a.default.number.isRequired,top:a.default.number.isRequired})}),w(S,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1})},9482:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var i={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=a?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}i.default=e,n&&n.set(e,i);return i}(n(5959)),a=d(n(7842)),o=d(n(7256)),s=n(414),l=n(906),u=d(n(8100)),c=d(n(7222));function d(e){return e&&e.__esModule?e:{default:e}}function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}function f(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(s)throw i}}return a}(e,t)||v(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function w(e,t){return w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},w(e,t)}function S(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=E(e);if(t){var a=E(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return x(e)}(this,n)}}function x(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var O="react-grid-layout",k=!1;try{k=/firefox/i.test(navigator.userAgent)}catch(e){}var T=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&w(e,t)}(d,e);var t,n,r,c=S(d);function d(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return _(x(e=c.call.apply(c,[this].concat(n))),"state",{activeDrag:null,layout:(0,s.synchronizeLayoutWithChildren)(e.props.layout,e.props.children,e.props.cols,(0,s.compactType)(e.props),e.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,droppingDOMNode:null,children:[]}),_(x(e),"dragEnterCounter",0),_(x(e),"onDragStart",(function(t,n,r,i){var a=i.e,o=i.node,l=e.state.layout,u=(0,s.getLayoutItem)(l,t);if(u)return e.setState({oldDragItem:(0,s.cloneLayoutItem)(u),oldLayout:l}),e.props.onDragStart(l,u,u,null,a,o)})),_(x(e),"onDrag",(function(t,n,r,i){var a=i.e,o=i.node,l=e.state.oldDragItem,u=e.state.layout,c=e.props,d=c.cols,h=c.allowOverlap,f=c.preventCollision,p=(0,s.getLayoutItem)(u,t);if(p){var m={w:p.w,h:p.h,x:p.x,y:p.y,placeholder:!0,i:t};u=(0,s.moveElement)(u,p,n,r,!0,f,(0,s.compactType)(e.props),d,h),e.props.onDrag(u,l,p,m,a,o),e.setState({layout:h?u:(0,s.compact)(u,(0,s.compactType)(e.props),d),activeDrag:m})}})),_(x(e),"onDragStop",(function(t,n,r,i){var a=i.e,o=i.node;if(e.state.activeDrag){var l=e.state.oldDragItem,u=e.state.layout,c=e.props,d=c.cols,h=c.preventCollision,f=c.allowOverlap,p=(0,s.getLayoutItem)(u,t);if(p){u=(0,s.moveElement)(u,p,n,r,!0,h,(0,s.compactType)(e.props),d,f),e.props.onDragStop(u,l,p,null,a,o);var m=f?u:(0,s.compact)(u,(0,s.compactType)(e.props),d),g=e.state.oldLayout;e.setState({activeDrag:null,layout:m,oldDragItem:null,oldLayout:null}),e.onLayoutMaybeChanged(m,g)}}})),_(x(e),"onResizeStart",(function(t,n,r,i){var a=i.e,o=i.node,l=e.state.layout,u=(0,s.getLayoutItem)(l,t);u&&(e.setState({oldResizeItem:(0,s.cloneLayoutItem)(u),oldLayout:e.state.layout}),e.props.onResizeStart(l,u,u,null,a,o))})),_(x(e),"onResize",(function(t,n,r,i){var a=i.e,o=i.node,l=e.state,u=l.layout,c=l.oldResizeItem,d=e.props,h=d.cols,f=d.preventCollision,p=d.allowOverlap,v=(0,s.withLayoutItem)(u,t,(function(e){var t;if(f&&!p){var i=(0,s.getAllCollisions)(u,m(m({},e),{},{w:n,h:r})).filter((function(t){return t.i!==e.i}));if(t=i.length>0){var a=1/0,o=1/0;i.forEach((function(t){t.x>e.x&&(a=Math.min(a,t.x)),t.y>e.y&&(o=Math.min(o,t.y))})),Number.isFinite(a)&&(e.w=a-e.x),Number.isFinite(o)&&(e.h=o-e.y)}}return t||(e.w=n,e.h=r),e})),y=g(v,2),b=y[0],w=y[1];if(w){var S={w:w.w,h:w.h,x:w.x,y:w.y,static:!0,i:t};e.props.onResize(b,c,w,S,a,o),e.setState({layout:p?b:(0,s.compact)(b,(0,s.compactType)(e.props),h),activeDrag:S})}})),_(x(e),"onResizeStop",(function(t,n,r,i){var a=i.e,o=i.node,l=e.state,u=l.layout,c=l.oldResizeItem,d=e.props,h=d.cols,f=d.allowOverlap,p=(0,s.getLayoutItem)(u,t);e.props.onResizeStop(u,c,p,null,a,o);var m=f?u:(0,s.compact)(u,(0,s.compactType)(e.props),h),g=e.state.oldLayout;e.setState({activeDrag:null,layout:m,oldResizeItem:null,oldLayout:null}),e.onLayoutMaybeChanged(m,g)})),_(x(e),"onDragOver",(function(t){var n;if(t.preventDefault(),t.stopPropagation(),k&&(null===(n=t.nativeEvent.target)||void 0===n||!n.classList.contains(O)))return!1;var r=e.props,a=r.droppingItem,o=r.onDropDragOver,s=r.margin,u=r.cols,c=r.rowHeight,d=r.maxRows,h=r.width,p=r.containerPadding,g=r.transformScale,v=null==o?void 0:o(t);if(!1===v)return e.state.droppingDOMNode&&e.removeDroppingPlaceholder(),!1;var y=m(m({},a),v),b=e.state.layout,w=t.nativeEvent,S=w.layerX,x=w.layerY,E={left:S/g,top:x/g,e:t};if(e.state.droppingDOMNode){if(e.state.droppingPosition){var _=e.state.droppingPosition,T=_.left,C=_.top;(T!=S||C!=x)&&e.setState({droppingPosition:E})}}else{var I={cols:u,margin:s,maxRows:d,rowHeight:c,containerWidth:h,containerPadding:p||s},R=(0,l.calcXY)(I,x,S,y.w,y.h);e.setState({droppingDOMNode:i.createElement("div",{key:y.i}),droppingPosition:E,layout:[].concat(f(b),[m(m({},y),{},{x:R.x,y:R.y,static:!1,isDraggable:!0})])})}})),_(x(e),"removeDroppingPlaceholder",(function(){var t=e.props,n=t.droppingItem,r=t.cols,i=e.state.layout,a=(0,s.compact)(i.filter((function(e){return e.i!==n.i})),(0,s.compactType)(e.props),r);e.setState({layout:a,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})})),_(x(e),"onDragLeave",(function(t){t.preventDefault(),t.stopPropagation(),e.dragEnterCounter--,0===e.dragEnterCounter&&e.removeDroppingPlaceholder()})),_(x(e),"onDragEnter",(function(t){t.preventDefault(),t.stopPropagation(),e.dragEnterCounter++})),_(x(e),"onDrop",(function(t){t.preventDefault(),t.stopPropagation();var n=e.props.droppingItem,r=e.state.layout,i=r.find((function(e){return e.i===n.i}));e.dragEnterCounter=0,e.removeDroppingPlaceholder(),e.props.onDrop(r,i,t)})),e}return t=d,r=[{key:"getDerivedStateFromProps",value:function(e,t){var n;return t.activeDrag?null:((0,a.default)(e.layout,t.propsLayout)&&e.compactType===t.compactType?(0,s.childrenEqual)(e.children,t.children)||(n=t.layout):n=e.layout,n?{layout:(0,s.synchronizeLayoutWithChildren)(n,e.children,e.cols,(0,s.compactType)(e),e.allowOverlap),compactType:e.compactType,children:e.children,propsLayout:e.layout}:null)}}],(n=[{key:"componentDidMount",value:function(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}},{key:"shouldComponentUpdate",value:function(e,t){return this.props.children!==e.children||!(0,s.fastRGLPropsEqual)(this.props,e,a.default)||this.state.activeDrag!==t.activeDrag||this.state.mounted!==t.mounted||this.state.droppingPosition!==t.droppingPosition}},{key:"componentDidUpdate",value:function(e,t){if(!this.state.activeDrag){var n=this.state.layout,r=t.layout;this.onLayoutMaybeChanged(n,r)}}},{key:"containerHeight",value:function(){if(this.props.autoSize){var e=(0,s.bottom)(this.state.layout),t=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return e*this.props.rowHeight+(e-1)*this.props.margin[1]+2*t+"px"}}},{key:"onLayoutMaybeChanged",value:function(e,t){t||(t=this.state.layout),(0,a.default)(t,e)||this.props.onLayoutChange(e)}},{key:"placeholder",value:function(){var e=this.state.activeDrag;if(!e)return null;var t=this.props,n=t.width,r=t.cols,a=t.margin,o=t.containerPadding,s=t.rowHeight,l=t.maxRows,c=t.useCSSTransforms,d=t.transformScale;return i.createElement(u.default,{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,className:"react-grid-placeholder",containerWidth:n,cols:r,margin:a,containerPadding:o||a,maxRows:l,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:c,transformScale:d},i.createElement("div",null))}},{key:"processGridItem",value:function(e,t){if(e&&e.key){var n=(0,s.getLayoutItem)(this.state.layout,String(e.key));if(!n)return null;var r=this.props,a=r.width,o=r.cols,l=r.margin,c=r.containerPadding,d=r.rowHeight,h=r.maxRows,f=r.isDraggable,p=r.isResizable,m=r.isBounded,g=r.useCSSTransforms,v=r.transformScale,y=r.draggableCancel,b=r.draggableHandle,w=r.resizeHandles,S=r.resizeHandle,x=this.state,E=x.mounted,_=x.droppingPosition,O="boolean"==typeof n.isDraggable?n.isDraggable:!n.static&&f,k="boolean"==typeof n.isResizable?n.isResizable:!n.static&&p,T=n.resizeHandles||w,C=O&&m&&!1!==n.isBounded;return i.createElement(u.default,{containerWidth:a,cols:o,margin:l,containerPadding:c||l,maxRows:h,rowHeight:d,cancel:y,handle:b,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:O,isResizable:k,isBounded:C,useCSSTransforms:g&&E,usePercentages:!E,transformScale:v,w:n.w,h:n.h,x:n.x,y:n.y,i:n.i,minH:n.minH,minW:n.minW,maxH:n.maxH,maxW:n.maxW,static:n.static,droppingPosition:t?_:void 0,resizeHandles:T,resizeHandle:S},e)}}},{key:"render",value:function(){var e=this,t=this.props,n=t.className,r=t.style,a=t.isDroppable,l=t.innerRef,u=(0,o.default)(O,n),c=m({height:this.containerHeight()},r);return i.createElement("div",{ref:l,className:u,style:c,onDrop:a?this.onDrop:s.noop,onDragLeave:a?this.onDragLeave:s.noop,onDragEnter:a?this.onDragEnter:s.noop,onDragOver:a?this.onDragOver:s.noop},i.Children.map(this.props.children,(function(t){return e.processGridItem(t)})),a&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}])&&b(t.prototype,n),r&&b(t,r),Object.defineProperty(t,"prototype",{writable:!1}),d}(i.Component);t.default=T,_(T,"displayName","ReactGridLayout"),_(T,"propTypes",c.default),_(T,"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:s.noop,onDragStart:s.noop,onDrag:s.noop,onDragStop:s.noop,onResizeStart:s.noop,onResize:s.noop,onResizeStop:s.noop,onDrop:s.noop,onDropDragOver:s.noop})},7222:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resizeHandleType=t.resizeHandleAxesType=t.default=void 0;var r=a(n(2688)),i=a(n(5959));function a(e){return e&&e.__esModule?e:{default:e}}var o=r.default.arrayOf(r.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));t.resizeHandleAxesType=o;var s=r.default.oneOfType([r.default.node,r.default.func]);t.resizeHandleType=s;var l={className:r.default.string,style:r.default.object,width:r.default.number,autoSize:r.default.bool,cols:r.default.number,draggableCancel:r.default.string,draggableHandle:r.default.string,verticalCompact:function(e){e.verticalCompact,0},compactType:r.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;void 0!==t&&n(414).validateLayout(t,"layout")},margin:r.default.arrayOf(r.default.number),containerPadding:r.default.arrayOf(r.default.number),rowHeight:r.default.number,maxRows:r.default.number,isBounded:r.default.bool,isDraggable:r.default.bool,isResizable:r.default.bool,allowOverlap:r.default.bool,preventCollision:r.default.bool,useCSSTransforms:r.default.bool,transformScale:r.default.number,isDroppable:r.default.bool,resizeHandles:o,resizeHandle:s,onLayoutChange:r.default.func,onDragStart:r.default.func,onDrag:r.default.func,onDragStop:r.default.func,onResizeStart:r.default.func,onResize:r.default.func,onResizeStop:r.default.func,onDrop:r.default.func,droppingItem:r.default.shape({i:r.default.string.isRequired,w:r.default.number.isRequired,h:r.default.number.isRequired}),children:function(e,t){var n=e[t],r={};i.default.Children.forEach(n,(function(e){if(null!=(null==e?void 0:e.key)){if(r[e.key])throw new Error('Duplicate child key "'+e.key+'" found! This will cause problems in ReactGridLayout.');r[e.key]=!0}}))},innerRef:r.default.any};t.default=l},4636:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}t.default=void 0;var i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var i={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=a?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}i.default=e,n&&n.set(e,i);return i}(n(5959)),a=d(n(2688)),o=d(n(7842)),s=n(414),l=n(544),u=d(n(9482)),c=["breakpoint","breakpoints","cols","layouts","margin","containerPadding","onBreakpointChange","onLayoutChange","onWidthChange"];function d(e){return e&&e.__esModule?e:{default:e}}function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}function f(){return f=Object.assign||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},f.apply(this,arguments)}function p(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){x(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t){return y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},y(e,t)}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=S(e);if(t){var a=S(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return w(e)}(this,n)}}function w(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},S(e)}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var E=function(e){return Object.prototype.toString.call(e)};function _(e,t){return null==e?null:Array.isArray(e)?e:e[t]}var O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y(e,t)}(d,e);var t,n,r,a=b(d);function d(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return x(w(e=a.call.apply(a,[this].concat(n))),"state",e.generateInitialState()),x(w(e),"onLayoutChange",(function(t){e.props.onLayoutChange(t,g(g({},e.props.layouts),{},x({},e.state.breakpoint,t)))})),e}return t=d,r=[{key:"getDerivedStateFromProps",value:function(e,t){if(!(0,o.default)(e.layouts,t.layouts)){var n=t.breakpoint,r=t.cols;return{layout:(0,l.findOrGenerateResponsiveLayout)(e.layouts,e.breakpoints,n,n,r,e.compactType),layouts:e.layouts}}return null}}],(n=[{key:"generateInitialState",value:function(){var e=this.props,t=e.width,n=e.breakpoints,r=e.layouts,i=e.cols,a=(0,l.getBreakpointFromWidth)(n,t),o=(0,l.getColsFromBreakpoint)(a,i),s=!1===this.props.verticalCompact?null:this.props.compactType;return{layout:(0,l.findOrGenerateResponsiveLayout)(r,n,a,a,o,s),breakpoint:a,cols:o}}},{key:"componentDidUpdate",value:function(e){this.props.width==e.width&&this.props.breakpoint===e.breakpoint&&(0,o.default)(this.props.breakpoints,e.breakpoints)&&(0,o.default)(this.props.cols,e.cols)||this.onWidthChange(e)}},{key:"onWidthChange",value:function(e){var t=this.props,n=t.breakpoints,r=t.cols,i=t.layouts,a=t.compactType,o=this.props.breakpoint||(0,l.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),u=this.state.breakpoint,c=(0,l.getColsFromBreakpoint)(o,r),d=g({},i);if(u!==o||e.breakpoints!==n||e.cols!==r){u in d||(d[u]=(0,s.cloneLayout)(this.state.layout));var h=(0,l.findOrGenerateResponsiveLayout)(d,n,o,u,c,a);h=(0,s.synchronizeLayoutWithChildren)(h,this.props.children,c,a,this.props.allowOverlap),d[o]=h,this.props.onLayoutChange(h,d),this.props.onBreakpointChange(o,c),this.setState({breakpoint:o,layout:h,cols:c})}var f=_(this.props.margin,o),p=_(this.props.containerPadding,o);this.props.onWidthChange(this.props.width,f,c,p)}},{key:"render",value:function(){var e=this.props,t=(e.breakpoint,e.breakpoints,e.cols,e.layouts,e.margin),n=e.containerPadding,r=(e.onBreakpointChange,e.onLayoutChange,e.onWidthChange,p(e,c));return i.createElement(u.default,f({},r,{margin:_(t,this.state.breakpoint),containerPadding:_(n,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}])&&v(t.prototype,n),r&&v(t,r),Object.defineProperty(t,"prototype",{writable:!1}),d}(i.Component);t.default=O,x(O,"propTypes",{breakpoint:a.default.string,breakpoints:a.default.object,allowOverlap:a.default.bool,cols:a.default.object,margin:a.default.oneOfType([a.default.array,a.default.object]),containerPadding:a.default.oneOfType([a.default.array,a.default.object]),layouts:function(e,t){if("[object Object]"!==E(e[t]))throw new Error("Layout property must be an object. Received: "+E(e[t]));Object.keys(e[t]).forEach((function(t){if(!(t in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,s.validateLayout)(e.layouts[t],"layouts."+t)}))},width:a.default.number.isRequired,onBreakpointChange:a.default.func,onLayoutChange:a.default.func,onWidthChange:a.default.func}),x(O,"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:s.noop,onLayoutChange:s.noop,onWidthChange:s.noop})},906:(e,t)=>{"use strict";function n(e){var t=e.margin,n=e.containerPadding,r=e.containerWidth,i=e.cols;return(r-t[0]*(i-1)-2*n[0])/i}function r(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function i(e,t,n){return Math.max(Math.min(e,n),t)}Object.defineProperty(t,"__esModule",{value:!0}),t.calcGridColWidth=n,t.calcGridItemPosition=function(e,t,i,a,o,s){var l=e.margin,u=e.containerPadding,c=e.rowHeight,d=n(e),h={};s&&s.resizing?(h.width=Math.round(s.resizing.width),h.height=Math.round(s.resizing.height)):(h.width=r(a,d,l[0]),h.height=r(o,c,l[1]));s&&s.dragging?(h.top=Math.round(s.dragging.top),h.left=Math.round(s.dragging.left)):(h.top=Math.round((c+l[1])*i+u[1]),h.left=Math.round((d+l[0])*t+u[0]));return h},t.calcGridItemWHPx=r,t.calcWH=function(e,t,r,a,o){var s=e.margin,l=e.maxRows,u=e.cols,c=e.rowHeight,d=n(e),h=Math.round((t+s[0])/(d+s[0])),f=Math.round((r+s[1])/(c+s[1]));return h=i(h,0,u-a),f=i(f,0,l-o),{w:h,h:f}},t.calcXY=function(e,t,r,a,o){var s=e.margin,l=e.cols,u=e.rowHeight,c=e.maxRows,d=n(e),h=Math.round((r-s[0])/(d+s[0])),f=Math.round((t-s[1])/(u+s[1]));return h=i(h,0,l-a),f=i(f,0,c-o),{x:h,y:f}},t.clamp=i},6805:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}t.default=function(e){var t;return t=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(u,t);var n,a,l=(n=u,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=p(n);if(a){var i=p(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}(this,e)});function u(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return m(f(e=l.call.apply(l,[this].concat(n))),"state",{width:1280}),m(f(e),"elementRef",i.createRef()),m(f(e),"mounted",!1),m(f(e),"onWindowResize",(function(){if(e.mounted){var t=e.elementRef.current;t instanceof HTMLElement&&t.offsetWidth&&e.setState({width:t.offsetWidth})}})),e}return function(e,t,n){t&&d(e.prototype,t);n&&d(e,n);Object.defineProperty(e,"prototype",{writable:!1})}(u,[{key:"componentDidMount",value:function(){this.mounted=!0,window.addEventListener("resize",this.onWindowResize),this.onWindowResize()}},{key:"componentWillUnmount",value:function(){this.mounted=!1,window.removeEventListener("resize",this.onWindowResize)}},{key:"render",value:function(){var t=this.props,n=t.measureBeforeMount,r=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,s);return n&&!this.mounted?i.createElement("div",{className:(0,o.default)(this.props.className,g),style:this.props.style,ref:this.elementRef}):i.createElement(e,c({innerRef:this.elementRef},r,this.state))}}]),u}(i.Component),m(t,"defaultProps",{measureBeforeMount:!1}),m(t,"propTypes",{measureBeforeMount:a.default.bool}),t};var i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var i={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=a?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}i.default=e,n&&n.set(e,i);return i}(n(5959)),a=l(n(2688)),o=l(n(7256)),s=["measureBeforeMount"];function l(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function c(){return c=Object.assign||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},c.apply(this,arguments)}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var g="react-grid-layout"},7434:e=>{e.exports=function(e,t,n){return e===t||e.className===t.className&&n(e.style,t.style)&&e.width===t.width&&e.autoSize===t.autoSize&&e.cols===t.cols&&e.draggableCancel===t.draggableCancel&&e.draggableHandle===t.draggableHandle&&n(e.verticalCompact,t.verticalCompact)&&n(e.compactType,t.compactType)&&n(e.layout,t.layout)&&n(e.margin,t.margin)&&n(e.containerPadding,t.containerPadding)&&e.rowHeight===t.rowHeight&&e.maxRows===t.maxRows&&e.isBounded===t.isBounded&&e.isDraggable===t.isDraggable&&e.isResizable===t.isResizable&&e.allowOverlap===t.allowOverlap&&e.preventCollision===t.preventCollision&&e.useCSSTransforms===t.useCSSTransforms&&e.transformScale===t.transformScale&&e.isDroppable===t.isDroppable&&n(e.resizeHandles,t.resizeHandles)&&n(e.resizeHandle,t.resizeHandle)&&e.onLayoutChange===t.onLayoutChange&&e.onDragStart===t.onDragStart&&e.onDrag===t.onDrag&&e.onDragStop===t.onDragStop&&e.onResizeStart===t.onResizeStart&&e.onResize===t.onResize&&e.onResizeStop===t.onResizeStop&&e.onDrop===t.onDrop&&n(e.droppingItem,t.droppingItem)&&n(e.innerRef,t.innerRef)}},544:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findOrGenerateResponsiveLayout=function(e,t,n,a,o,s){if(e[n])return(0,r.cloneLayout)(e[n]);for(var l=e[a],u=i(t),c=u.slice(u.indexOf(n)),d=0,h=c.length;d<h;d++){var f=c[d];if(e[f]){l=e[f];break}}return l=(0,r.cloneLayout)(l||[]),(0,r.compact)((0,r.correctBounds)(l,{cols:o}),s,o)},t.getBreakpointFromWidth=function(e,t){for(var n=i(e),r=n[0],a=1,o=n.length;a<o;a++){var s=n[a];t>e[s]&&(r=s)}return r},t.getColsFromBreakpoint=function(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]},t.sortBreakpoints=i;var r=n(414);function i(e){return Object.keys(e).sort((function(t,n){return e[t]-e[n]}))}},414:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bottom=d,t.childrenEqual=function(e,t){return(0,r.default)(i.default.Children.map(e,(function(e){return null==e?void 0:e.key})),i.default.Children.map(t,(function(e){return null==e?void 0:e.key})))},t.cloneLayout=h,t.cloneLayoutItem=p,t.collides=g,t.compact=v,t.compactItem=w,t.compactType=function(e){var t=e||{},n=t.verticalCompact,r=t.compactType;return!1===n?null:r},t.correctBounds=S,t.fastPositionEqual=function(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height},t.fastRGLPropsEqual=void 0,t.getAllCollisions=_,t.getFirstCollision=E,t.getLayoutItem=x,t.getStatics=O,t.modifyLayout=f,t.moveElement=k,t.moveElementAwayFromCollision=T,t.noop=void 0,t.perc=function(e){return 100*e+"%"},t.setTopLeft=function(e){var t=e.top,n=e.left,r=e.width,i=e.height;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}},t.setTransform=function(e){var t=e.top,n=e.left,r=e.width,i=e.height,a="translate(".concat(n,"px,").concat(t,"px)");return{transform:a,WebkitTransform:a,MozTransform:a,msTransform:a,OTransform:a,width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}},t.sortLayoutItems=C,t.sortLayoutItemsByColRow=R,t.sortLayoutItemsByRowCol=I,t.synchronizeLayoutWithChildren=function(e,t,n,r,a){e=e||[];var o=[];i.default.Children.forEach(t,(function(t){if(null!=(null==t?void 0:t.key)){var n=x(e,String(t.key));if(n)o.push(p(n));else{!u&&t.props._grid&&console.warn("`_grid` properties on children have been deprecated as of React 15.2. Please use `data-grid` or add your properties directly to the `layout`.");var r=t.props["data-grid"]||t.props._grid;r?(u||A([r],"ReactGridLayout.children"),o.push(p(s(s({},r),{},{i:t.key})))):o.push(p({w:1,h:1,x:0,y:d(o),i:String(t.key)}))}}}));var l=S(o,{cols:n});return a?l:v(l,r,n)},t.validateLayout=A,t.withLayoutItem=function(e,t,n){var r=x(e,t);return r?(r=n(p(r)),[e=f(e,r),r]):[e,null]};var r=a(n(7842)),i=a(n(5959));function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u=!0,c=!1;function d(e){for(var t,n=0,r=0,i=e.length;r<i;r++)(t=e[r].y+e[r].h)>n&&(n=t);return n}function h(e){for(var t=Array(e.length),n=0,r=e.length;n<r;n++)t[n]=p(e[n]);return t}function f(e,t){for(var n=Array(e.length),r=0,i=e.length;r<i;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function p(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:Boolean(e.moved),static:Boolean(e.static),isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}var m=n(7434);function g(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 v(e,t,n){for(var r=O(e),i=C(e,t),a=Array(e.length),o=0,s=i.length;o<s;o++){var l=p(i[o]);l.static||(l=w(r,l,t,n,i),r.push(l)),a[e.indexOf(i[o])]=l,l.moved=!1}return a}t.fastRGLPropsEqual=m;var y={x:"w",y:"h"};function b(e,t,n,r){var i=y[r];t[r]+=1;for(var a=e.map((function(e){return e.i})).indexOf(t.i)+1;a<e.length;a++){var o=e[a];if(!o.static){if(o.y>t.y+t.h)break;g(t,o)&&b(e,o,n+t[i],r)}}t[r]=n}function w(e,t,n,r,i){var a,o="horizontal"===n;if("vertical"===n)for(t.y=Math.min(d(e),t.y);t.y>0&&!E(e,t);)t.y--;else if(o)for(;t.x>0&&!E(e,t);)t.x--;for(;a=E(e,t);)o?b(i,t,a.x+a.w,"x"):b(i,t,a.y+a.h,"y"),o&&t.x+t.w>r&&(t.x=r-t.w,t.y++);return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function S(e,t){for(var n=O(e),r=0,i=e.length;r<i;r++){var a=e[r];if(a.x+a.w>t.cols&&(a.x=t.cols-a.w),a.x<0&&(a.x=0,a.w=t.cols),a.static)for(;E(n,a);)a.y++;else n.push(a)}return e}function x(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function E(e,t){for(var n=0,r=e.length;n<r;n++)if(g(e[n],t))return e[n]}function _(e,t){return e.filter((function(e){return g(e,t)}))}function O(e){return e.filter((function(e){return e.static}))}function k(e,t,n,r,i,a,o,s,l){if(t.static&&!0!==t.isDraggable)return e;if(t.y===r&&t.x===n)return e;N("Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]"));var u=t.x,c=t.y;"number"==typeof n&&(t.x=n),"number"==typeof r&&(t.y=r),t.moved=!0;var d=C(e,o);("vertical"===o&&"number"==typeof r?c>=r:"horizontal"===o&&"number"==typeof n&&u>=n)&&(d=d.reverse());var f=_(d,t),p=f.length>0;if(p&&l)return h(e);if(p&&a)return N("Collision prevented on ".concat(t.i,", reverting.")),t.x=u,t.y=c,t.moved=!1,e;for(var m=0,g=f.length;m<g;m++){var v=f[m];N("Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(v.i," at [").concat(v.x,",").concat(v.y,"]")),v.moved||(e=v.static?T(e,v,t,i,o,s):T(e,t,v,i,o,s))}return e}function T(e,t,n,r,i,a){var o="horizontal"===i,s="horizontal"!==i,l=t.static;if(r){r=!1;var u={x:o?Math.max(t.x-n.w,0):n.x,y:s?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"};if(!E(e,u))return N("Doing reverse collision on ".concat(n.i," up to [").concat(u.x,",").concat(u.y,"].")),k(e,n,o?u.x:void 0,s?u.y:void 0,r,l,i,a)}return k(e,n,o?n.x+1:void 0,s?n.y+1:void 0,r,l,i,a)}function C(e,t){return"horizontal"===t?R(e):"vertical"===t?I(e):e}function I(e){return e.slice(0).sort((function(e,t){return e.y>t.y||e.y===t.y&&e.x>t.x?1:e.y===t.y&&e.x===t.x?0:-1}))}function R(e){return e.slice(0).sort((function(e,t){return e.x>t.x||e.x===t.x&&e.y>t.y?1:-1}))}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Layout",n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(var r=0,i=e.length;r<i;r++)for(var a=e[r],o=0;o<n.length;o++)if("number"!=typeof a[n[o]])throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[o]+" must be a number!")}function N(){var e;c&&(e=console).log.apply(e,arguments)}t.noop=function(){}},2548:(e,t,n)=>{e.exports=n(9482).default,e.exports.utils=n(414),e.exports.Responsive=n(4636).default,e.exports.Responsive.utils=n(544),e.exports.WidthProvider=n(6805).default},7256:(e,t,n)=>{"use strict";function r(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(i&&(i+=" "),i+=n);else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}function i(){for(var e,t,n=0,i="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(i&&(i+=" "),i+=t);return i}n.r(t),n.d(t,{clsx:()=>i,default:()=>a});const a=i},1794:(e,t,n)=>{"use strict";t.__esModule=!0,t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(5959)),i=n(8230),a=n(9954),o=n(6333),s=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}function u(){return u=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},u.apply(this,arguments)}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function h(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}var p=function(e){var t,n;function o(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).handleRefs={},t.lastHandleRect=null,t.slack=null,t}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,f(t,n);var l=o.prototype;return l.componentWillUnmount=function(){this.resetData()},l.resetData=function(){this.lastHandleRect=this.slack=null},l.runConstraints=function(e,t){var n=this.props,r=n.minConstraints,i=n.maxConstraints,a=n.lockAspectRatio;if(!r&&!i&&!a)return[e,t];if(a){var o=this.props.width/this.props.height,s=e-this.props.width,l=t-this.props.height;Math.abs(s)>Math.abs(l*o)?t=e/o:e=t*o}var u=e,c=t,d=this.slack||[0,0],h=d[0],f=d[1];return e+=h,t+=f,r&&(e=Math.max(r[0],e),t=Math.max(r[1],t)),i&&(e=Math.min(i[0],e),t=Math.min(i[1],t)),this.slack=[h+(u-e),f+(c-t)],[e,t]},l.resizeHandler=function(e,t){var n=this;return function(r,i){var a=i.node,o=i.deltaX,s=i.deltaY;"onResizeStart"===e&&n.resetData();var l=("both"===n.props.axis||"x"===n.props.axis)&&"n"!==t&&"s"!==t,u=("both"===n.props.axis||"y"===n.props.axis)&&"e"!==t&&"w"!==t;if(l||u){var c=t[0],d=t[t.length-1],h=a.getBoundingClientRect();if(null!=n.lastHandleRect){if("w"===d)o+=h.left-n.lastHandleRect.left;if("n"===c)s+=h.top-n.lastHandleRect.top}n.lastHandleRect=h,"w"===d&&(o=-o),"n"===c&&(s=-s);var f=n.props.width+(l?o/n.props.transformScale:0),p=n.props.height+(u?s/n.props.transformScale:0),m=n.runConstraints(f,p);f=m[0],p=m[1];var g=f!==n.props.width||p!==n.props.height,v="function"==typeof n.props[e]?n.props[e]:null;v&&!("onResize"===e&&!g)&&(null==r.persist||r.persist(),v(r,{node:a,size:{width:f,height:p},handle:t})),"onResizeStop"===e&&n.resetData()}}},l.renderResizeHandle=function(e,t){var n=this.props.handle;if(!n)return r.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+e,ref:t});if("function"==typeof n)return n(e,t);var i=d({ref:t},"string"==typeof n.type?{}:{handleAxis:e});return r.cloneElement(n,i)},l.render=function(){var e=this,t=this.props,n=t.children,o=t.className,l=t.draggableOpts,c=(t.width,t.height,t.handle,t.handleSize,t.lockAspectRatio,t.axis,t.minConstraints,t.maxConstraints,t.onResize,t.onResizeStop,t.onResizeStart,t.resizeHandles),h=(t.transformScale,function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(t,s));return(0,a.cloneElement)(n,d(d({},h),{},{className:(o?o+" ":"")+"react-resizable",children:[].concat(n.props.children,c.map((function(t){var n,a=null!=(n=e.handleRefs[t])?n:e.handleRefs[t]=r.createRef();return r.createElement(i.DraggableCore,u({},l,{nodeRef:a,key:"resizableHandle-"+t,onStop:e.resizeHandler("onResizeStop",t),onStart:e.resizeHandler("onResizeStart",t),onDrag:e.resizeHandler("onResize",t)}),e.renderResizeHandle(t,a))})))}))},o}(r.Component);t.default=p,p.propTypes=o.resizableProps,p.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1}},6609:(e,t,n)=>{"use strict";t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(5959)),i=l(n(2688)),a=l(n(1794)),o=n(6333),s=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function l(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function c(){return c=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},c.apply(this,arguments)}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function f(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}var m=function(e){var t,n;function i(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).state={width:t.props.width,height:t.props.height,propsWidth:t.props.width,propsHeight:t.props.height},t.onResize=function(e,n){var r=n.size;t.props.onResize?(null==e.persist||e.persist(),t.setState(r,(function(){return t.props.onResize&&t.props.onResize(e,n)}))):t.setState(r)},t}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,p(t,n),i.getDerivedStateFromProps=function(e,t){return t.propsWidth!==e.width||t.propsHeight!==e.height?{width:e.width,height:e.height,propsWidth:e.width,propsHeight:e.height}:null},i.prototype.render=function(){var e=this.props,t=e.handle,n=e.handleSize,i=(e.onResize,e.onResizeStart),o=e.onResizeStop,l=e.draggableOpts,u=e.minConstraints,d=e.maxConstraints,f=e.lockAspectRatio,p=e.axis,m=(e.width,e.height,e.resizeHandles),g=e.style,v=e.transformScale,y=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,s);return r.createElement(a.default,{axis:p,draggableOpts:l,handle:t,handleSize:n,height:this.state.height,lockAspectRatio:f,maxConstraints:d,minConstraints:u,onResizeStart:i,onResize:this.onResize,onResizeStop:o,resizeHandles:m,transformScale:v,width:this.state.width},r.createElement("div",c({},y,{style:h(h({},g),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},i}(r.Component);t.default=m,m.propTypes=h(h({},o.resizableProps),{},{children:i.default.element})},6333:(e,t,n)=>{"use strict";t.__esModule=!0,t.resizableProps=void 0;var r,i=(r=n(2688))&&r.__esModule?r:{default:r};n(8230);var a={axis:i.default.oneOf(["both","x","y","none"]),className:i.default.string,children:i.default.element.isRequired,draggableOpts:i.default.shape({allowAnyClick:i.default.bool,cancel:i.default.string,children:i.default.node,disabled:i.default.bool,enableUserSelectHack:i.default.bool,offsetParent:i.default.node,grid:i.default.arrayOf(i.default.number),handle:i.default.string,nodeRef:i.default.object,onStart:i.default.func,onDrag:i.default.func,onStop:i.default.func,onMouseDown:i.default.func,scale:i.default.number}),height:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,a=t[0];return"both"===a.axis||"y"===a.axis?(r=i.default.number).isRequired.apply(r,t):i.default.number.apply(i.default,t)},handle:i.default.oneOfType([i.default.node,i.default.func]),handleSize:i.default.arrayOf(i.default.number),lockAspectRatio:i.default.bool,maxConstraints:i.default.arrayOf(i.default.number),minConstraints:i.default.arrayOf(i.default.number),onResizeStop:i.default.func,onResizeStart:i.default.func,onResize:i.default.func,resizeHandles:i.default.arrayOf(i.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:i.default.number,width:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,a=t[0];return"both"===a.axis||"x"===a.axis?(r=i.default.number).isRequired.apply(r,t):i.default.number.apply(i.default,t)}};t.resizableProps=a},9954:(e,t,n)=>{"use strict";t.__esModule=!0,t.cloneElement=function(e,t){t.style&&e.props.style&&(t.style=o(o({},e.props.style),t.style));t.className&&e.props.className&&(t.className=e.props.className+" "+t.className);return i.default.cloneElement(e,t)};var r,i=(r=n(5959))&&r.__esModule?r:{default:r};function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},936:(e,t,n)=>{"use strict";e.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},e.exports.Resizable=n(1794).default,e.exports.ResizableBox=n(6609).default},2871:(e,t,n)=>{"use strict";n.d(t,{Bd:()=>i,lQ:()=>r});var r=function(){};var i="undefined"!=typeof window},9105:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(5959),i=n(2871);const a=function(e,t,n){if(!i.Bd)return[t,i.lQ,i.lQ];if(!e)throw new Error("useLocalStorage key may not be falsy");var a=n?n.raw?function(e){return e}:n.deserializer:JSON.parse,o=(0,r.useRef)((function(e){try{var r=n?n.raw?String:n.serializer:JSON.stringify,i=localStorage.getItem(e);return null!==i?a(i):(t&&localStorage.setItem(e,r(t)),t)}catch(e){return t}})),s=(0,r.useState)((function(){return o.current(e)})),l=s[0],u=s[1];(0,r.useLayoutEffect)((function(){return u(o.current(e))}),[e]);var c=(0,r.useCallback)((function(t){try{var r="function"==typeof t?t(l):t;if(void 0===r)return;var i=void 0;i=n?n.raw?"string"==typeof r?r:JSON.stringify(r):n.serializer?n.serializer(r):JSON.stringify(r):JSON.stringify(r),localStorage.setItem(e,i),u(a(i))}catch(e){}}),[e,u]),d=(0,r.useCallback)((function(){try{localStorage.removeItem(e),u(void 0)}catch(e){}}),[e,u]);return[l,c,d]}},3518:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(5959);const i=function(e){(0,r.useEffect)(e,[])};const a=function(e){i((function(){e()}))}},2192:(e,t,n)=>{"use strict";var r=n(5959),i=Symbol.for("react.element"),a=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,n){var r,a={},u=null,c=null;for(r in void 0!==n&&(u=""+n),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(c=t.ref),t)o.call(t,r)&&!l.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:i,type:e,key:u,ref:c,props:a,_owner:s.current}}t.Fragment=a,t.jsx=u,t.jsxs=u},2540:(e,t,n)=>{"use strict";e.exports=n(2192)},8353:(e,t,n)=>{"use strict";n.d(t,{Ms:()=>v,vU:()=>f});var r=n(4120),i=n(1693),a=n(3449),o=n(2236),s=n(6712);function l(){}var u=c("C",void 0,void 0);function c(e,t,n){return{kind:e,value:t,error:n}}var d=n(2332),h=n(3004),f=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,(0,a.Uv)(t)&&t.add(n)):n.destination=w,n}return(0,r.C6)(t,e),t.create=function(e,t,n){return new v(e,t,n)},t.prototype.next=function(e){this.isStopped?b(function(e){return c("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?b(function(e){return c("E",void 0,e)}(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?b(u,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(a.yU),p=Function.prototype.bind;function m(e,t){return p.call(e,t)}var g=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){y(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){y(e)}else y(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){y(e)}},e}(),v=function(e){function t(t,n,r){var a,s,l=e.call(this)||this;(0,i.T)(t)||!t?a={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:l&&o.$.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return l.unsubscribe()},a={next:t.next&&m(t.next,s),error:t.error&&m(t.error,s),complete:t.complete&&m(t.complete,s)}):a=t;return l.destination=new g(a),l}return(0,r.C6)(t,e),t}(f);function y(e){o.$.useDeprecatedSynchronousErrorHandling?(0,h.l)(e):(0,s.m)(e)}function b(e,t){var n=o.$.onStoppedNotification;n&&d.f.setTimeout((function(){return n(e,t)}))}var w={closed:!0,next:l,error:function(e){throw e},complete:l}},3449:(e,t,n)=>{"use strict";n.d(t,{yU:()=>l,Uv:()=>u});var r=n(4120),i=n(1693);var a,o=((a=function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}((function(e){Error.call(e),e.stack=(new Error).stack}))).prototype=Object.create(Error.prototype),a.prototype.constructor=a,a);function s(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var l=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,a,s;if(!this.closed){this.closed=!0;var l=this._parentage;if(l)if(this._parentage=null,Array.isArray(l))try{for(var u=(0,r.Ju)(l),d=u.next();!d.done;d=u.next()){d.value.remove(this)}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}else l.remove(this);var h=this.initialTeardown;if((0,i.T)(h))try{h()}catch(e){s=e instanceof o?e.errors:[e]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var p=(0,r.Ju)(f),m=p.next();!m.done;m=p.next()){var g=m.value;try{c(g)}catch(e){s=null!=s?s:[],e instanceof o?s=(0,r.fX)((0,r.fX)([],(0,r.zs)(s)),(0,r.zs)(e.errors)):s.push(e)}}}catch(e){n={error:e}}finally{try{m&&!m.done&&(a=p.return)&&a.call(p)}finally{if(n)throw n.error}}}if(s)throw new o(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)c(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&s(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&s(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}();l.EMPTY;function u(e){return e instanceof l||e&&"closed"in e&&(0,i.T)(e.remove)&&(0,i.T)(e.add)&&(0,i.T)(e.unsubscribe)}function c(e){(0,i.T)(e)?e():e.unsubscribe()}},2236:(e,t,n)=>{"use strict";n.d(t,{$:()=>r});var r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},4370:(e,t,n)=>{"use strict";n.d(t,{_:()=>i});var r=n(4120);function i(e,t,n,r,i){return new a(e,t,n,r,i)}var a=function(e){function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return(0,r.C6)(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(n(8353).vU)},7708:(e,t,n)=>{"use strict";n.d(t,{T:()=>a});var r=n(5096),i=n(4370);function a(e,t){return(0,r.N)((function(n,r){var a=0;n.subscribe((0,i._)(r,(function(n){r.next(e.call(t,n,a++))})))}))}},2332:(e,t,n)=>{"use strict";n.d(t,{f:()=>i});var r=n(4120),i={setTimeout:function(e,t){for(var n=[],a=2;a<arguments.length;a++)n[a-2]=arguments[a];var o=i.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,(0,r.fX)([e,t],(0,r.zs)(n))):setTimeout.apply(void 0,(0,r.fX)([e,t],(0,r.zs)(n)))},clearTimeout:function(e){var t=i.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0}},3004:(e,t,n)=>{"use strict";n.d(t,{Y:()=>a,l:()=>o});var r=n(2236),i=null;function a(e){if(r.$.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var n=i,a=n.errorThrown,o=n.error;if(i=null,a)throw o}}else e()}function o(e){r.$.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},3887:(e,t,n)=>{"use strict";function r(e){return e}n.d(t,{D:()=>r})},1693:(e,t,n)=>{"use strict";function r(e){return"function"==typeof e}n.d(t,{T:()=>r})},5096:(e,t,n)=>{"use strict";n.d(t,{N:()=>i});var r=n(1693);function i(e){return function(t){if(function(e){return(0,r.T)(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},6712:(e,t,n)=>{"use strict";n.d(t,{m:()=>a});var r=n(2236),i=n(2332);function a(e){i.f.setTimeout((function(){var t=r.$.onUnhandledError;if(!t)throw e;t(e)}))}},9524:(e,t,n)=>{const r=Symbol("SemVer ANY");class i{static get ANY(){return r}constructor(e,t){if(t=a(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===r?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?o[s.COMPARATORLOOSE]:o[s.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new c(n[2],this.options.loose):this.semver=r}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===r||e===r)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):(!(t=a(t)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}e.exports=i;const a=n(7095),{safeRe:o,t:s}=n(6850),l=n(3811),u=n(9796),c=n(7944),d=n(8395)},8395:(e,t,n)=>{const r=/\s+/g;class i{constructor(e,t){if(t=o(t),e instanceof i)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new i(e.raw,t);if(e instanceof s)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(r," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!v(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&m)|(this.options.loose&&g))+":"+e,n=a.get(t);if(n)return n;const r=this.options.loose,i=r?c[d.HYPHENRANGELOOSE]:c[d.HYPHENRANGE];e=e.replace(i,R(this.options.includePrerelease)),l("hyphen replace",e),e=e.replace(c[d.COMPARATORTRIM],h),l("comparator trim",e),e=e.replace(c[d.TILDETRIM],f),l("tilde trim",e),e=e.replace(c[d.CARETTRIM],p),l("caret trim",e);let o=e.split(" ").map((e=>w(e,this.options))).join(" ").split(/\s+/).map((e=>I(e,this.options)));r&&(o=o.filter((e=>(l("loose invalid filter",e,this.options),!!e.match(c[d.COMPARATORLOOSE]))))),l("range list",o);const u=new Map,y=o.map((e=>new s(e,this.options)));for(const e of y){if(v(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");const b=[...u.values()];return a.set(t,b),b}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Range is required");return this.set.some((n=>b(n,t)&&e.set.some((e=>b(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(A(this.set[t],e,this.options))return!0;return!1}}e.exports=i;const a=new(n(1158)),o=n(7095),s=n(9524),l=n(9796),u=n(7944),{safeRe:c,t:d,comparatorTrimReplace:h,tildeTrimReplace:f,caretTrimReplace:p}=n(6850),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:g}=n(9630),v=e=>"<0.0.0-0"===e.value,y=e=>""===e.value,b=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},w=(e,t)=>(l("comp",e,t),e=_(e,t),l("caret",e),e=x(e,t),l("tildes",e),e=k(e,t),l("xrange",e),e=C(e,t),l("stars",e),e),S=e=>!e||"x"===e.toLowerCase()||"*"===e,x=(e,t)=>e.trim().split(/\s+/).map((e=>E(e,t))).join(" "),E=(e,t)=>{const n=t.loose?c[d.TILDELOOSE]:c[d.TILDE];return e.replace(n,((t,n,r,i,a)=>{let o;return l("tilde",e,t,n,r,i,a),S(n)?o="":S(r)?o=`>=${n}.0.0 <${+n+1}.0.0-0`:S(i)?o=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(l("replaceTilde pr",a),o=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):o=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,l("tilde return",o),o}))},_=(e,t)=>e.trim().split(/\s+/).map((e=>O(e,t))).join(" "),O=(e,t)=>{l("caret",e,t);const n=t.loose?c[d.CARETLOOSE]:c[d.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,a,o)=>{let s;return l("caret",e,t,n,i,a,o),S(n)?s="":S(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:S(a)?s="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:o?(l("replaceCaret pr",o),s="0"===n?"0"===i?`>=${n}.${i}.${a}-${o} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${o} <${+n+1}.0.0-0`):(l("no pr"),s="0"===n?"0"===i?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),l("caret return",s),s}))},k=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map((e=>T(e,t))).join(" ")),T=(e,t)=>{e=e.trim();const n=t.loose?c[d.XRANGELOOSE]:c[d.XRANGE];return e.replace(n,((n,r,i,a,o,s)=>{l("xRange",e,n,r,i,a,o,s);const u=S(i),c=u||S(a),d=c||S(o),h=d;return"="===r&&h&&(r=""),s=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&h?(c&&(a=0),o=0,">"===r?(r=">=",c?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):"<="===r&&(r="<",c?i=+i+1:a=+a+1),"<"===r&&(s="-0"),n=`${r+i}.${a}.${o}${s}`):c?n=`>=${i}.0.0${s} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),l("xRange return",n),n}))},C=(e,t)=>(l("replaceStars",e,t),e.trim().replace(c[d.STAR],"")),I=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),R=e=>(t,n,r,i,a,o,s,l,u,c,d,h)=>`${n=S(r)?"":S(i)?`>=${r}.0.0${e?"-0":""}`:S(a)?`>=${r}.${i}.0${e?"-0":""}`:o?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=S(u)?"":S(c)?`<${+u+1}.0.0-0`:S(d)?`<${u}.${+c+1}.0-0`:h?`<=${u}.${c}.${d}-${h}`:e?`<${u}.${c}.${+d+1}-0`:`<=${l}`}`.trim(),A=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(l(e[n].semver),e[n].semver!==s.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}},7944:(e,t,n)=>{const r=n(9796),{MAX_LENGTH:i,MAX_SAFE_INTEGER:a}=n(9630),{safeRe:o,safeSrc:s,t:l}=n(6850),u=n(7095),{compareIdentifiers:c}=n(4031);class d{constructor(e,t){if(t=u(t),e instanceof d){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);r("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?o[l.LOOSE]:o[l.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>a||this.major<0)throw new TypeError("Invalid major version");if(this.minor>a||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>a||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<a)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(r("SemVer.compare",this.version,this.options,e),!(e instanceof d)){if("string"==typeof e&&e===this.version)return 0;e=new d(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof d||(e=new d(e,this.options)),c(this.major,e.major)||c(this.minor,e.minor)||c(this.patch,e.patch)}comparePre(e){if(e instanceof d||(e=new d(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],i=e.prerelease[t];if(r("prerelease compare",t,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return c(n,i)}while(++t)}compareBuild(e){e instanceof d||(e=new d(e,this.options));let t=0;do{const n=this.build[t],i=e.build[t];if(r("build compare",t,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return c(n,i)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=new RegExp(`^${this.options.loose?s[l.PRERELEASELOOSE]:s[l.PRERELEASE]}$`),n=`-${t}`.match(e);if(!n||n[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=d},7994:(e,t,n)=>{const r=n(5860);e.exports=(e,t)=>{const n=r(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},3811:(e,t,n)=>{const r=n(6909),i=n(7659),a=n(144),o=n(2077),s=n(599),l=n(7092);e.exports=(e,t,n,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return r(e,n,u);case"!=":return i(e,n,u);case">":return a(e,n,u);case">=":return o(e,n,u);case"<":return s(e,n,u);case"<=":return l(e,n,u);default:throw new TypeError(`Invalid operator: ${t}`)}}},5334:(e,t,n)=>{const r=n(7944),i=n(5860),{safeRe:a,t:o}=n(6850);e.exports=(e,t)=>{if(e instanceof r)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){const r=t.includePrerelease?a[o.COERCERTLFULL]:a[o.COERCERTL];let i;for(;(i=r.exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&i.index+i[0].length===n.index+n[0].length||(n=i),r.lastIndex=i.index+i[1].length+i[2].length;r.lastIndex=-1}else n=e.match(t.includePrerelease?a[o.COERCEFULL]:a[o.COERCE]);if(null===n)return null;const s=n[2],l=n[3]||"0",u=n[4]||"0",c=t.includePrerelease&&n[5]?`-${n[5]}`:"",d=t.includePrerelease&&n[6]?`+${n[6]}`:"";return i(`${s}.${l}.${u}${c}${d}`,t)}},2801:(e,t,n)=>{const r=n(7944);e.exports=(e,t,n)=>{const i=new r(e,n),a=new r(t,n);return i.compare(a)||i.compareBuild(a)}},7023:(e,t,n)=>{const r=n(5380);e.exports=(e,t)=>r(e,t,!0)},5380:(e,t,n)=>{const r=n(7944);e.exports=(e,t,n)=>new r(e,n).compare(new r(t,n))},660:(e,t,n)=>{const r=n(5860);e.exports=(e,t)=>{const n=r(e,null,!0),i=r(t,null,!0),a=n.compare(i);if(0===a)return null;const o=a>0,s=o?n:i,l=o?i:n,u=!!s.prerelease.length;if(!!l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(s))return l.minor&&!l.patch?"minor":"patch"}const c=u?"pre":"";return n.major!==i.major?c+"major":n.minor!==i.minor?c+"minor":n.patch!==i.patch?c+"patch":"prerelease"}},6909:(e,t,n)=>{const r=n(5380);e.exports=(e,t,n)=>0===r(e,t,n)},144:(e,t,n)=>{const r=n(5380);e.exports=(e,t,n)=>r(e,t,n)>0},2077:(e,t,n)=>{const r=n(5380);e.exports=(e,t,n)=>r(e,t,n)>=0},5955:(e,t,n)=>{const r=n(7944);e.exports=(e,t,n,i,a)=>{"string"==typeof n&&(a=i,i=n,n=void 0);try{return new r(e instanceof r?e.version:e,n).inc(t,i,a).version}catch(e){return null}}},599:(e,t,n)=>{const r=n(5380);e.exports=(e,t,n)=>r(e,t,n)<0},7092:(e,t,n)=>{const r=n(5380);e.exports=(e,t,n)=>r(e,t,n)<=0},2966:(e,t,n)=>{const r=n(7944);e.exports=(e,t)=>new r(e,t).major},5986:(e,t,n)=>{const r=n(7944);e.exports=(e,t)=>new r(e,t).minor},7659:(e,t,n)=>{const r=n(5380);e.exports=(e,t,n)=>0!==r(e,t,n)},5860:(e,t,n)=>{const r=n(7944);e.exports=(e,t,n=!1)=>{if(e instanceof r)return e;try{return new r(e,t)}catch(e){if(!n)return null;throw e}}},1617:(e,t,n)=>{const r=n(7944);e.exports=(e,t)=>new r(e,t).patch},9613:(e,t,n)=>{const r=n(5860);e.exports=(e,t)=>{const n=r(e,t);return n&&n.prerelease.length?n.prerelease:null}},2862:(e,t,n)=>{const r=n(5380);e.exports=(e,t,n)=>r(t,e,n)},6033:(e,t,n)=>{const r=n(2801);e.exports=(e,t)=>e.sort(((e,n)=>r(n,e,t)))},1722:(e,t,n)=>{const r=n(8395);e.exports=(e,t,n)=>{try{t=new r(t,n)}catch(e){return!1}return t.test(e)}},603:(e,t,n)=>{const r=n(2801);e.exports=(e,t)=>e.sort(((e,n)=>r(e,n,t)))},7645:(e,t,n)=>{const r=n(5860);e.exports=(e,t)=>{const n=r(e,t);return n?n.version:null}},8449:(e,t,n)=>{const r=n(6850),i=n(9630),a=n(7944),o=n(4031),s=n(5860),l=n(7645),u=n(7994),c=n(5955),d=n(660),h=n(2966),f=n(5986),p=n(1617),m=n(9613),g=n(5380),v=n(2862),y=n(7023),b=n(2801),w=n(603),S=n(6033),x=n(144),E=n(599),_=n(6909),O=n(7659),k=n(2077),T=n(7092),C=n(3811),I=n(5334),R=n(9524),A=n(8395),N=n(1722),D=n(651),L=n(7840),P=n(7930),M=n(3489),j=n(7494),F=n(5463),V=n(7871),$=n(4266),B=n(1112),z=n(1465),U=n(9252);e.exports={parse:s,valid:l,clean:u,inc:c,diff:d,major:h,minor:f,patch:p,prerelease:m,compare:g,rcompare:v,compareLoose:y,compareBuild:b,sort:w,rsort:S,gt:x,lt:E,eq:_,neq:O,gte:k,lte:T,cmp:C,coerce:I,Comparator:R,Range:A,satisfies:N,toComparators:D,maxSatisfying:L,minSatisfying:P,minVersion:M,validRange:j,outside:F,gtr:V,ltr:$,intersects:B,simplifyRange:z,subset:U,SemVer:a,re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:o.compareIdentifiers,rcompareIdentifiers:o.rcompareIdentifiers}},9630:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},9796:e=>{const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},4031:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const r=t.test(e),i=t.test(n);return r&&i&&(e=+e,n=+n),e===n?0:r&&!i?-1:i&&!r?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},1158:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},7095:e=>{const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},6850:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:a}=n(9630),o=n(9796),s=(t=e.exports={}).re=[],l=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],d=t.t={};let h=0;const f="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",a],[f,i]],m=(e,t,n)=>{const r=(e=>{for(const[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),i=h++;o(e,i,t),d[e]=i,u[i]=t,c[i]=r,s[i]=new RegExp(t,n?"g":void 0),l[i]=new RegExp(r,n?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),m("MAINVERSION",`(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${u[d.NUMERICIDENTIFIER]}|${u[d.NONNUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${u[d.NUMERICIDENTIFIERLOOSE]}|${u[d.NONNUMERICIDENTIFIER]})`),m("PRERELEASE",`(?:-(${u[d.PRERELEASEIDENTIFIER]}(?:\\.${u[d.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${u[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[d.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${f}+`),m("BUILD",`(?:\\+(${u[d.BUILDIDENTIFIER]}(?:\\.${u[d.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${u[d.MAINVERSION]}${u[d.PRERELEASE]}?${u[d.BUILD]}?`),m("FULL",`^${u[d.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${u[d.MAINVERSIONLOOSE]}${u[d.PRERELEASELOOSE]}?${u[d.BUILD]}?`),m("LOOSE",`^${u[d.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${u[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${u[d.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:${u[d.PRERELEASE]})?${u[d.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:${u[d.PRERELEASELOOSE]})?${u[d.BUILD]}?)?)?`),m("XRANGE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),m("COERCE",`${u[d.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",u[d.COERCEPLAIN]+`(?:${u[d.PRERELEASE]})?`+`(?:${u[d.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",u[d.COERCE],!0),m("COERCERTLFULL",u[d.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${u[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${u[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${u[d.LONECARET]}${u[d.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${u[d.LONECARET]}${u[d.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${u[d.GTLT]}\\s*(${u[d.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]}|${u[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${u[d.XRANGEPLAIN]})\\s+-\\s+(${u[d.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${u[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[d.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},7871:(e,t,n)=>{const r=n(5463);e.exports=(e,t,n)=>r(e,t,">",n)},1112:(e,t,n)=>{const r=n(8395);e.exports=(e,t,n)=>(e=new r(e,n),t=new r(t,n),e.intersects(t,n))},4266:(e,t,n)=>{const r=n(5463);e.exports=(e,t,n)=>r(e,t,"<",n)},7840:(e,t,n)=>{const r=n(7944),i=n(8395);e.exports=(e,t,n)=>{let a=null,o=null,s=null;try{s=new i(t,n)}catch(e){return null}return e.forEach((e=>{s.test(e)&&(a&&-1!==o.compare(e)||(a=e,o=new r(a,n)))})),a}},7930:(e,t,n)=>{const r=n(7944),i=n(8395);e.exports=(e,t,n)=>{let a=null,o=null,s=null;try{s=new i(t,n)}catch(e){return null}return e.forEach((e=>{s.test(e)&&(a&&1!==o.compare(e)||(a=e,o=new r(a,n)))})),a}},3489:(e,t,n)=>{const r=n(7944),i=n(8395),a=n(144);e.exports=(e,t)=>{e=new i(e,t);let n=new r("0.0.0");if(e.test(n))return n;if(n=new r("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const i=e.set[t];let o=null;i.forEach((e=>{const t=new r(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":o&&!a(t,o)||(o=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!o||n&&!a(n,o)||(n=o)}return n&&e.test(n)?n:null}},5463:(e,t,n)=>{const r=n(7944),i=n(9524),{ANY:a}=i,o=n(8395),s=n(1722),l=n(144),u=n(599),c=n(7092),d=n(2077);e.exports=(e,t,n,h)=>{let f,p,m,g,v;switch(e=new r(e,h),t=new o(t,h),n){case">":f=l,p=c,m=u,g=">",v=">=";break;case"<":f=u,p=d,m=l,g="<",v="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(e,t,h))return!1;for(let n=0;n<t.set.length;++n){const r=t.set[n];let o=null,s=null;if(r.forEach((e=>{e.semver===a&&(e=new i(">=0.0.0")),o=o||e,s=s||e,f(e.semver,o.semver,h)?o=e:m(e.semver,s.semver,h)&&(s=e)})),o.operator===g||o.operator===v)return!1;if((!s.operator||s.operator===g)&&p(e,s.semver))return!1;if(s.operator===v&&m(e,s.semver))return!1}return!0}},1465:(e,t,n)=>{const r=n(1722),i=n(5380);e.exports=(e,t,n)=>{const a=[];let o=null,s=null;const l=e.sort(((e,t)=>i(e,t,n)));for(const e of l){r(e,t,n)?(s=e,o||(o=e)):(s&&a.push([o,s]),s=null,o=null)}o&&a.push([o,null]);const u=[];for(const[e,t]of a)e===t?u.push(e):t||e!==l[0]?t?e===l[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const c=u.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return c.length<d.length?c:t}},9252:(e,t,n)=>{const r=n(8395),i=n(9524),{ANY:a}=i,o=n(1722),s=n(5380),l=[new i(">=0.0.0-0")],u=[new i(">=0.0.0")],c=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===a){if(1===t.length&&t[0].semver===a)return!0;e=n.includePrerelease?l:u}if(1===t.length&&t[0].semver===a){if(n.includePrerelease)return!0;t=u}const r=new Set;let i,c,f,p,m,g,v;for(const t of e)">"===t.operator||">="===t.operator?i=d(i,t,n):"<"===t.operator||"<="===t.operator?c=h(c,t,n):r.add(t.semver);if(r.size>1)return null;if(i&&c){if(f=s(i.semver,c.semver,n),f>0)return null;if(0===f&&(">="!==i.operator||"<="!==c.operator))return null}for(const e of r){if(i&&!o(e,String(i),n))return null;if(c&&!o(e,String(c),n))return null;for(const r of t)if(!o(e,String(r),n))return!1;return!0}let y=!(!c||n.includePrerelease||!c.semver.prerelease.length)&&c.semver,b=!(!i||n.includePrerelease||!i.semver.prerelease.length)&&i.semver;y&&1===y.prerelease.length&&"<"===c.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(v=v||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,i)if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),">"===e.operator||">="===e.operator){if(p=d(i,e,n),p===e&&p!==i)return!1}else if(">="===i.operator&&!o(i.semver,String(e),n))return!1;if(c)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(m=h(c,e,n),m===e&&m!==c)return!1}else if("<="===c.operator&&!o(c.semver,String(e),n))return!1;if(!e.operator&&(c||i)&&0!==f)return!1}return!(i&&g&&!c&&0!==f)&&(!(c&&v&&!i&&0!==f)&&(!b&&!y))},d=(e,t,n)=>{if(!e)return t;const r=s(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},h=(e,t,n)=>{if(!e)return t;const r=s(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n={})=>{if(e===t)return!0;e=new r(e,n),t=new r(t,n);let i=!1;e:for(const r of e.set){for(const e of t.set){const t=c(r,e,n);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},651:(e,t,n)=>{const r=n(8395);e.exports=(e,t)=>new r(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},7494:(e,t,n)=>{const r=n(8395);e.exports=(e,t)=>{try{return new r(e,t).range||"*"}catch(e){return null}}},6852:(e,t,n)=>{"use strict";var r=n(8036),i=Array.prototype.concat,a=Array.prototype.slice,o=e.exports=function(e){for(var t=[],n=0,o=e.length;n<o;n++){var s=e[n];r(s)?t=i.call(t,a.call(s)):t.push(s)}return t};o.wrap=function(e){return function(){return e(o(arguments))}}},8036:e=>{e.exports=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))}},6660:function(e,t,n){var r;!function(i,a){"use strict";var o="function",s="undefined",l="object",u="string",c="major",d="model",h="name",f="type",p="vendor",m="version",g="architecture",v="console",y="mobile",b="tablet",w="smarttv",S="wearable",x="embedded",E="Amazon",_="Apple",O="ASUS",k="BlackBerry",T="Browser",C="Chrome",I="Firefox",R="Google",A="Huawei",N="LG",D="Microsoft",L="Motorola",P="Opera",M="Samsung",j="Sharp",F="Sony",V="Xiaomi",$="Zebra",B="Facebook",z="Chromium OS",U="Mac OS",q=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},H=function(e,t){return typeof e===u&&-1!==W(t).indexOf(W(e))},W=function(e){return e.toLowerCase()},G=function(e,t){if(typeof e===u)return e=e.replace(/^\s\s*/,""),typeof t===s?e:e.substring(0,500)},K=function(e,t){for(var n,r,i,s,u,c,d=0;d<t.length&&!u;){var h=t[d],f=t[d+1];for(n=r=0;n<h.length&&!u&&h[n];)if(u=h[n++].exec(e))for(i=0;i<f.length;i++)c=u[++r],typeof(s=f[i])===l&&s.length>0?2===s.length?typeof s[1]==o?this[s[0]]=s[1].call(this,c):this[s[0]]=s[1]:3===s.length?typeof s[1]!==o||s[1].exec&&s[1].test?this[s[0]]=c?c.replace(s[1],s[2]):a:this[s[0]]=c?s[1].call(this,c,s[2]):a:4===s.length&&(this[s[0]]=c?s[3].call(this,c.replace(s[1],s[2])):a):this[s]=c||a;d+=2}},Q=function(e,t){for(var n in t)if(typeof t[n]===l&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(H(t[n][r],e))return"?"===n?a:n}else if(H(t[n],e))return"?"===n?a:n;return e},Y={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},X={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[m,[h,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[m,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,m],[/opios[\/ ]+([\w\.]+)/i],[m,[h,P+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[m,[h,P+" GX"]],[/\bopr\/([\w\.]+)/i],[m,[h,P]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[m,[h,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[h,m],[/\bddg\/([\w\.]+)/i],[m,[h,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[m,[h,"UC"+T]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[m,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[m,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[m,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[m,[h,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[m,[h,"Smart Lenovo "+T]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure "+T],m],[/\bfocus\/([\w\.]+)/i],[m,[h,I+" Focus"]],[/\bopt\/([\w\.]+)/i],[m,[h,P+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[m,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[m,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[m,[h,P+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[m,[h,"MIUI "+T]],[/fxios\/([-\w\.]+)/i],[m,[h,I]],[/\bqihu|(qi?ho?o?|360)browser/i],[[h,"360 "+T]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1 "+T],m],[/samsungbrowser\/([\w\.]+)/i],[m,[h,M+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[h,/_/g," "],m],[/metasr[\/ ]?([\d\.]+)/i],[m,[h,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[h,"Sogou Mobile"],m],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[h,m],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,B],m],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[h,m],[/\bgsa\/([\w\.]+) .*safari\//i],[m,[h,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[m,[h,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[m,[h,C+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,C+" WebView"],m],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[m,[h,"Android "+T]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,m],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[m,[h,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[m,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[m,Q,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[h,m],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],m],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[m,[h,I+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[h,m],[/(cobalt)\/([\w\.]+)/i],[h,[m,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,W]],[/((?:i[346]|x)86)[;\)]/i],[[g,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/windows (ce|mobile); ppc;/i],[[g,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[g,/ower/,"",W]],[/(sun4\w)[;\)]/i],[[g,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[g,W]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[d,[p,M],[f,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[d,[p,M],[f,y]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[p,_],[f,y]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[p,_],[f,b]],[/(macintosh);/i],[d,[p,_]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[p,j],[f,y]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[d,[p,A],[f,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[p,A],[f,y]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[d,/_/g," "],[p,V],[f,y]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[d,/_/g," "],[p,V],[f,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[d,[p,"OPPO"],[f,y]],[/\b(opd2\d{3}a?) bui/i],[d,[p,"OPPO"],[f,b]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[d,[p,"Vivo"],[f,y]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[d,[p,"Realme"],[f,y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[d,[p,L],[f,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[p,L],[f,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[p,N],[f,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[d,[p,N],[f,y]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[d,[p,"Lenovo"],[f,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[d,/_/g," "],[p,"Nokia"],[f,y]],[/(pixel c)\b/i],[d,[p,R],[f,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[d,[p,R],[f,y]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[d,[p,F],[f,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,"Xperia Tablet"],[p,F],[f,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[d,[p,"OnePlus"],[f,y]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[d,[p,E],[f,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,"Fire Phone $1"],[p,E],[f,y]],[/(playbook);[-\w\),; ]+(rim)/i],[d,p,[f,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[p,k],[f,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[p,O],[f,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[p,O],[f,y]],[/(nexus 9)/i],[d,[p,"HTC"],[f,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[d,/_/g," "],[f,y]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[d,[p,"Acer"],[f,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[d,[p,"Meizu"],[f,y]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[d,[p,"Ulefone"],[f,y]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[p,d,[f,y]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[p,d,[f,b]],[/(surface duo)/i],[d,[p,D],[f,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[p,"Fairphone"],[f,y]],[/(u304aa)/i],[d,[p,"AT&T"],[f,y]],[/\bsie-(\w*)/i],[d,[p,"Siemens"],[f,y]],[/\b(rct\w+) b/i],[d,[p,"RCA"],[f,b]],[/\b(venue[\d ]{2,7}) b/i],[d,[p,"Dell"],[f,b]],[/\b(q(?:mv|ta)\w+) b/i],[d,[p,"Verizon"],[f,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[d,[p,"Barnes & Noble"],[f,b]],[/\b(tm\d{3}\w+) b/i],[d,[p,"NuVision"],[f,b]],[/\b(k88) b/i],[d,[p,"ZTE"],[f,b]],[/\b(nx\d{3}j) b/i],[d,[p,"ZTE"],[f,y]],[/\b(gen\d{3}) b.+49h/i],[d,[p,"Swiss"],[f,y]],[/\b(zur\d{3}) b/i],[d,[p,"Swiss"],[f,b]],[/\b((zeki)?tb.*\b) b/i],[d,[p,"Zeki"],[f,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],d,[f,b]],[/\b(ns-?\w{0,9}) b/i],[d,[p,"Insignia"],[f,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[d,[p,"NextBook"],[f,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],d,[f,y]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],d,[f,y]],[/\b(ph-1) /i],[d,[p,"Essential"],[f,y]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[d,[p,"Envizen"],[f,b]],[/\b(trio[-\w\. ]+) b/i],[d,[p,"MachSpeed"],[f,b]],[/\btu_(1491) b/i],[d,[p,"Rotor"],[f,b]],[/(shield[\w ]+) b/i],[d,[p,"Nvidia"],[f,b]],[/(sprint) (\w+)/i],[p,d,[f,y]],[/(kin\.[onetw]{3})/i],[[d,/\./g," "],[p,D],[f,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[p,$],[f,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[p,$],[f,y]],[/smart-tv.+(samsung)/i],[p,[f,w]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,"SmartTV"],[p,M],[f,w]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,N],[f,w]],[/(apple) ?tv/i],[p,[d,_+" TV"],[f,w]],[/crkey/i],[[d,C+"cast"],[p,R],[f,w]],[/droid.+aft(\w+)( bui|\))/i],[d,[p,E],[f,w]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[p,j],[f,w]],[/(bravia[\w ]+)( bui|\))/i],[d,[p,F],[f,w]],[/(mitv-\w{5}) bui/i],[d,[p,V],[f,w]],[/Hbbtv.*(technisat) (.*);/i],[p,d,[f,w]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[p,G],[d,G],[f,w]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[f,w]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,d,[f,v]],[/droid.+; (shield) bui/i],[d,[p,"Nvidia"],[f,v]],[/(playstation [345portablevi]+)/i],[d,[p,F],[f,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[p,D],[f,v]],[/((pebble))app/i],[p,d,[f,S]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[p,_],[f,S]],[/droid.+; (glass) \d/i],[d,[p,R],[f,S]],[/droid.+; (wt63?0{2,3})\)/i],[d,[p,$],[f,S]],[/(quest( \d| pro)?)/i],[d,[p,B],[f,S]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[f,x]],[/(aeobc)\b/i],[d,[p,E],[f,x]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[d,[f,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[d,[f,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[f,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[f,y]],[/(android[-\w\. ]{0,9});.+buil/i],[d,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[m,[h,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[m,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[h,m],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[m,h]],os:[[/microsoft (windows) (vista|xp)/i],[h,m],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[h,[m,Q,Y]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[m,Q,Y],[h,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[m,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[h,U],[m,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[m,h],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[h,m],[/\(bb(10);/i],[m,[h,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[m,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[m,[h,I+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[m,[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[m,[h,"watchOS"]],[/crkey\/([\d\.]+)/i],[m,[h,C+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,z],m],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[h,m],[/(sunos) ?([\w\.\d]*)/i],[[h,"Solaris"],m],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,m]]},J=function(e,t){if(typeof e===l&&(t=e,e=a),!(this instanceof J))return new J(e,t).getResult();var n=typeof i!==s&&i.navigator?i.navigator:a,r=e||(n&&n.userAgent?n.userAgent:""),v=n&&n.userAgentData?n.userAgentData:a,w=t?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}(X,t):X,S=n&&n.userAgent==r;return this.getBrowser=function(){var e,t={};return t[h]=a,t[m]=a,K.call(t,r,w.browser),t[c]=typeof(e=t[m])===u?e.replace(/[^\d\.]/g,"").split(".")[0]:a,S&&n&&n.brave&&typeof n.brave.isBrave==o&&(t[h]="Brave"),t},this.getCPU=function(){var e={};return e[g]=a,K.call(e,r,w.cpu),e},this.getDevice=function(){var e={};return e[p]=a,e[d]=a,e[f]=a,K.call(e,r,w.device),S&&!e[f]&&v&&v.mobile&&(e[f]=y),S&&"Macintosh"==e[d]&&n&&typeof n.standalone!==s&&n.maxTouchPoints&&n.maxTouchPoints>2&&(e[d]="iPad",e[f]=b),e},this.getEngine=function(){var e={};return e[h]=a,e[m]=a,K.call(e,r,w.engine),e},this.getOS=function(){var e={};return e[h]=a,e[m]=a,K.call(e,r,w.os),S&&!e[h]&&v&&v.platform&&"Unknown"!=v.platform&&(e[h]=v.platform.replace(/chrome os/i,z).replace(/macos/i,U)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=typeof e===u&&e.length>500?G(e,500):e,this},this.setUA(r),this};J.VERSION="1.0.38",J.BROWSER=q([h,m,c]),J.CPU=q([g]),J.DEVICE=q([d,p,f,v,y,w,b,S,x]),J.ENGINE=J.OS=q([h,m]),typeof t!==s?(e.exports&&(t=e.exports=J),t.UAParser=J):n.amdO?(r=function(){return J}.call(t,n,t,e))===a||(e.exports=r):typeof i!==s&&(i.UAParser=J);var Z=typeof i!==s&&(i.jQuery||i.Zepto);if(Z&&!Z.ua){var ee=new J;Z.ua=ee.getResult(),Z.ua.get=function(){return ee.getUA()},Z.ua.set=function(e){ee.setUA(e);var t=ee.getResult();for(var n in t)Z.ua[n]=t[n]}}}("object"==typeof window?window:this)},7151:e=>{e.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}},5244:(e,t,n)=>{"use strict";n.d(t,{Py:()=>l,gY:()=>u,pz:()=>s,sk:()=>c});var r=n(2551),i=n(5968),a=n(4648);function o(e){var t;return(t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}})[i.s7]=function(){return this},t}function s(e,t,n,r){var a,s=(0,i.Xd)(e.src),u=null===(a=null==t?void 0:t.options.services)||void 0===a?void 0:a[s.type],c=e.data?(0,i.A9)(e.data,n,r):void 0,d=u?l(u,e.id,c):o(e.id);return d.meta=e,d}function l(e,t,n){var r=o(t);if(r.deferred=!0,(0,i.Ai)(e)){var s=r.state=(0,a.G)(void 0,(function(){return(n?e.withContext(n):e).initialState}));r.getSnapshot=function(){return s}}return r}function u(e){return function(e){try{return"function"==typeof e.send}catch(e){return!1}}(e)&&"id"in e}function c(e){var t;return(0,r.Cl)(((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[i.s7]=function(){return this},t),e)}},1015:(e,t,n)=>{"use strict";n.d(t,{O:()=>w});var r=n(2551),i=n(5968),a=n(7768),o=n(6590),s=n(5846),l=n(5184),u=n(8204),c=n(6099),d=n(5244);function h(e){if("string"==typeof e){var t={type:e,toString:function(){return e}};return t}return e}function f(e){return(0,r.Cl)((0,r.Cl)({type:o.lA},e),{toJSON:function(){e.onDone,e.onError;var t=(0,r.Tt)(e,["onDone","onError"]);return(0,r.Cl)((0,r.Cl)({},t),{type:o.lA,src:h(e.src)})}})}var p="",m="*",g={},v=function(e){return"#"===e[0]},y=function(){function e(t,n,a,o){void 0===a&&(a="context"in t?t.context:void 0);var d,h=this;this.config=t,this._context=a,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign({actions:{},guards:{},services:{},activities:{},delays:{}},n),this.parent=null==o?void 0:o.parent,this.key=this.config.key||(null==o?void 0:o.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:u.AD),this.id=this.config.id||(0,r.fX)([this.machine.key],(0,r.zs)(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(d=this.config.schema)&&void 0!==d?d:{},this.description=this.config.description,l.p||(0,i.R8)(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?(0,i.LG)(this.config.states,(function(t,n){var i,a=new e(t,{},void 0,{parent:h,key:n});return Object.assign(h.idMap,(0,r.Cl)(((i={})[a.id]=a,i),a.idMap)),a})):g;var m=0;!function e(t){var n,i;t.order=m++;try{for(var a=(0,r.Ju)((0,c.rz)(t)),o=a.next();!o.done;o=a.next()){e(o.value)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}}(this),this.history=!0===this.config.history?"shallow":this.config.history||!1,this._transient=!!this.config.always||!!this.config.on&&(Array.isArray(this.config.on)?this.config.on.some((function(e){return e.event===p})):p in this.config.on),this.strict=!!this.config.strict,this.onEntry=(0,i.$r)(this.config.entry||this.config.onEntry).map((function(e){return(0,s.Hf)(e)})),this.onExit=(0,i.$r)(this.config.exit||this.config.onExit).map((function(e){return(0,s.Hf)(e)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=(0,i.$r)(this.config.invoke).map((function(e,t){var n,a;if((0,i.Ai)(e)){var o=(0,i.cv)(h.id,t);return h.machine.options.services=(0,r.Cl)(((n={})[o]=e,n),h.machine.options.services),f({src:o,id:o})}if((0,i.Kg)(e.src)){o=e.id||(0,i.cv)(h.id,t);return f((0,r.Cl)((0,r.Cl)({},e),{id:o,src:e.src}))}if((0,i.Ai)(e.src)||(0,i.Tn)(e.src)){o=e.id||(0,i.cv)(h.id,t);return h.machine.options.services=(0,r.Cl)(((a={})[o]=e.src,a),h.machine.options.services),f((0,r.Cl)((0,r.Cl)({id:o},e),{src:o}))}var s=e.src;return f((0,r.Cl)((0,r.Cl)({id:(0,i.cv)(h.id,t)},e),{src:s}))})),this.activities=(0,i.$r)(this.config.activities).concat(this.invoke).map((function(e){return(0,s._4)(e)})),this.transition=this.transition.bind(this),this.tags=(0,i.$r)(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||(0,c.Ki)(this).forEach((function(e){return e.on}))},e.prototype.withConfig=function(t,n){var i=this.options,a=i.actions,o=i.activities,s=i.guards,l=i.services,u=i.delays;return new e(this.config,{actions:(0,r.Cl)((0,r.Cl)({},a),t.actions),activities:(0,r.Cl)((0,r.Cl)({},o),t.activities),guards:(0,r.Cl)((0,r.Cl)({},s),t.guards),services:(0,r.Cl)((0,r.Cl)({},l),t.services),delays:(0,r.Cl)((0,r.Cl)({},u),t.delays)},null!=n?n:this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return(0,i.Tn)(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:(0,i.LG)(this.states,(function(e){return e.definition})),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce((function(e,t){return e[t.eventType]=e[t.eventType]||[],e[t.eventType].push(t),e}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var t=e===p,n=this.transitions.filter((function(n){var r=n.eventType===e;return t?r:r||n.eventType===m}));return this.__cache.candidates[e]=n,n},e.prototype.getDelayedTransitions=function(){var e=this,t=this.config.after;if(!t)return[];var n=function(t,n){var r=(0,i.Tn)(t)?"".concat(e.id,":delay[").concat(n,"]"):t,a=(0,s.Pl)(r,e.id);return e.onEntry.push((0,s.tN)(a,{delay:t})),e.onExit.push((0,s.ZT)(a)),a};return((0,i.cy)(t)?t.map((function(e,t){var i=n(e.delay,t);return(0,r.Cl)((0,r.Cl)({},e),{event:i})})):(0,i.Bq)(Object.keys(t).map((function(e,a){var o=t[e],s=(0,i.Kg)(o)?{target:o}:o,l=isNaN(+e)?e:+e,u=n(l,a);return(0,i.$r)(s).map((function(e){return(0,r.Cl)((0,r.Cl)({},e),{event:u,delay:l})}))})))).map((function(t){var n=t.delay;return(0,r.Cl)((0,r.Cl)({},e.formatTransition(t)),{delay:n})}))},e.prototype.getStateNodes=function(e){var t,n=this;if(!e)return[];var o=e instanceof a.Uw?e.value:(0,i.at)(e,this.delimiter);if((0,i.Kg)(o)){var s=this.getStateNode(o).initial;return void 0!==s?this.getStateNodes(((t={})[o]=s,t)):[this,this.states[o]]}var l=Object.keys(o),u=[this];return u.push.apply(u,(0,r.fX)([],(0,r.zs)((0,i.Bq)(l.map((function(e){return n.getStateNode(e).getStateNodes(o[e])})))),!1)),u},e.prototype.handles=function(e){var t=(0,i.vd)(e);return this.events.includes(t)},e.prototype.resolveState=function(e){var t=e instanceof a.Uw?e:a.Uw.create(e),n=Array.from((0,c.D0)([],this.getStateNodes(t.value)));return new a.Uw((0,r.Cl)((0,r.Cl)({},t),{value:this.resolve(t.value),configuration:n,done:(0,c.BJ)(n,this),tags:(0,c.iU)(n),machine:this.machine}))},e.prototype.transitionLeafNode=function(e,t,n){var r=this.getStateNode(e).next(t,n);return r&&r.transitions.length?r:this.next(t,n)},e.prototype.transitionCompoundNode=function(e,t,n){var r=Object.keys(e),i=this.getStateNode(r[0])._transition(e[r[0]],t,n);return i&&i.transitions.length?i:this.next(t,n)},e.prototype.transitionParallelNode=function(e,t,n){var a,o,s={};try{for(var l=(0,r.Ju)(Object.keys(e)),u=l.next();!u.done;u=l.next()){var c=u.value,d=e[c];if(d){var h=this.getStateNode(c)._transition(d,t,n);h&&(s[c]=h)}}}catch(e){a={error:e}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(a)throw a.error}}var f=Object.keys(s).map((function(e){return s[e]})),p=(0,i.Bq)(f.map((function(e){return e.transitions})));if(!f.some((function(e){return e.transitions.length>0})))return this.next(t,n);var m=(0,i.Bq)(Object.keys(s).map((function(e){return s[e].configuration})));return{transitions:p,exitSet:(0,i.Bq)(f.map((function(e){return e.exitSet}))),configuration:m,source:t,actions:(0,i.Bq)(Object.keys(s).map((function(e){return s[e].actions})))}},e.prototype._transition=function(e,t,n){return(0,i.Kg)(e)?this.transitionLeafNode(e,t,n):1===Object.keys(e).length?this.transitionCompoundNode(e,t,n):this.transitionParallelNode(e,t,n)},e.prototype.getTransitionData=function(e,t){return this._transition(e.value,e,(0,i.ft)(t))},e.prototype.next=function(e,t){var n,a,o,s=this,l=t.name,u=[],c=[];try{for(var d=(0,r.Ju)(this.getCandidates(l)),h=d.next();!h.done;h=d.next()){var f=h.value,p=f.cond,m=f.in,g=e.context,y=!m||((0,i.Kg)(m)&&v(m)?e.matches((0,i.at)(this.getStateNodeById(m).path,this.delimiter)):(0,i.HK)((0,i.at)(m,this.delimiter),(0,i.Ae)(this.path.slice(0,-2))(e.value))),b=!1;try{b=!p||(0,i.re)(this.machine,p,g,t,e)}catch(e){throw new Error("Unable to evaluate guard '".concat(p.name||p.type,"' in transition for event '").concat(l,"' in state node '").concat(this.id,"':\n").concat(e.message))}if(b&&y){void 0!==f.target&&(c=f.target),u.push.apply(u,(0,r.fX)([],(0,r.zs)(f.actions),!1)),o=f;break}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(a=d.return)&&a.call(d)}finally{if(n)throw n.error}}if(o){if(!c.length)return{transitions:[o],exitSet:[],configuration:e.value?[this]:[],source:e,actions:u};var w=(0,i.Bq)(c.map((function(t){return s.getRelativeStateNodes(t,e.historyValue)})));return{transitions:[o],exitSet:!!o.internal?[]:(0,i.Bq)(c.map((function(e){return s.getPotentiallyReenteringNodes(e)}))),configuration:w,source:e,actions:u}}},e.prototype.getPotentiallyReenteringNodes=function(e){if(this.order<e.order)return[this];for(var t=[],n=this,r=e;n&&n!==r;)t.push(n),n=n.parent;return n!==r?[]:(t.push(r),t)},e.prototype.getActions=function(e,t,n,a,o,l,u){var d,h,f,p,m=this,g=l?(0,c.D0)([],this.getStateNodes(l.value)):[],v=new Set;try{for(var y=(0,r.Ju)(Array.from(e).sort((function(e,t){return e.order-t.order}))),b=y.next();!b.done;b=y.next()){var w=b.value;(!(0,c.zy)(g,w)||(0,c.zy)(n.exitSet,w)||w.parent&&v.has(w.parent))&&v.add(w)}}catch(e){d={error:e}}finally{try{b&&!b.done&&(h=y.return)&&h.call(y)}finally{if(d)throw d.error}}try{for(var S=(0,r.Ju)(g),x=S.next();!x.done;x=S.next()){w=x.value;(0,c.zy)(e,w)&&!(0,c.zy)(n.exitSet,w.parent)||n.exitSet.push(w)}}catch(e){f={error:e}}finally{try{x&&!x.done&&(p=S.return)&&p.call(S)}finally{if(f)throw f.error}}n.exitSet.sort((function(e,t){return t.order-e.order}));var E=Array.from(v).sort((function(e,t){return e.order-t.order})),_=new Set(n.exitSet),O=(0,i.Bq)(E.map((function(e){var t=[];if("final"!==e.type)return t;var r=e.parent;if(!r.parent)return t;t.push((0,s.Vw)(e.id,e.doneData),(0,s.Vw)(r.id,e.doneData?(0,i.A9)(e.doneData,a,o):void 0));var l=r.parent;return"parallel"===l.type&&(0,c.i0)(l).every((function(e){return(0,c.BJ)(n.configuration,e)}))&&t.push((0,s.Vw)(l.id)),t}))),k=E.map((function(e){var t=e.onEntry,n=e.activities.map((function(e){return(0,s.ni)(e)}));return{type:"entry",actions:(0,s.Um)(u?(0,r.fX)((0,r.fX)([],(0,r.zs)(t),!1),(0,r.zs)(n),!1):(0,r.fX)((0,r.fX)([],(0,r.zs)(n),!1),(0,r.zs)(t),!1),m.machine.options.actions)}})).concat({type:"state_done",actions:O.map((function(e){return(0,s.xl)(e)}))}),T=Array.from(_).map((function(e){return{type:"exit",actions:(0,s.Um)((0,r.fX)((0,r.fX)([],(0,r.zs)(e.onExit),!1),(0,r.zs)(e.activities.map((function(e){return(0,s.ds)(e)}))),!1),m.machine.options.actions)}})).concat({type:"transition",actions:(0,s.Um)(n.actions,this.machine.options.actions)}).concat(k);if(t){var C=(0,s.Um)((0,i.Bq)((0,r.fX)([],(0,r.zs)(e),!1).sort((function(e,t){return t.order-e.order})).map((function(e){return e.onExit}))),this.machine.options.actions).filter((function(e){return!(0,i.Gx)(e)}));return T.concat({type:"stop",actions:C})}return T},e.prototype.transition=function(e,t,n,o){void 0===e&&(e=this.initialState);var s,u=(0,i.ft)(t);if(e instanceof a.Uw)s=void 0===n?e:this.resolveState(a.Uw.from(e,n));else{var d=(0,i.Kg)(e)?this.resolve((0,i.zr)(this.getResolvedPath(e))):this.resolve(e),h=null!=n?n:this.machine.context;s=this.resolveState(a.Uw.from(d,h))}if(!l.p&&u.name===m)throw new Error("An event cannot have the wildcard type ('".concat(m,"')"));if(this.strict&&!this.events.includes(u.name)&&!(0,i.M7)(u.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(u.name,"'"));var f=this._transition(s.value,s,u)||{transitions:[],configuration:[],exitSet:[],source:s,actions:[]},p=(0,c.D0)([],this.getStateNodes(s.value)),g=f.configuration.length?(0,c.D0)(p,f.configuration):p;return f.configuration=(0,r.fX)([],(0,r.zs)(g),!1),this.resolveTransition(f,s,s.context,o,u)},e.prototype.resolveRaisedTransition=function(e,t,n,i){var a,o=e.actions;return(e=this.transition(e,t,void 0,i))._event=n,e.event=n.data,(a=e.actions).unshift.apply(a,(0,r.fX)([],(0,r.zs)(o),!1)),e},e.prototype.resolveTransition=function(e,t,n,l,u){var h,f,m,g,v=this;void 0===u&&(u=s.zp);var y=e.configuration,b=!t||e.transitions.length>0,w=b?e.configuration:t?t.configuration:[],S=(0,c.BJ)(w,this),x=b?(0,c._W)(this.machine,y):void 0,E=t?t.historyValue?t.historyValue:e.source?this.machine.historyValue(t.value):void 0:void 0,_=this.getActions(new Set(w),S,e,n,u,t,l),O=t?(0,r.Cl)({},t.activities):{};try{for(var k=(0,r.Ju)(_),T=k.next();!T.done;T=k.next()){var C=T.value;try{for(var I=(m=void 0,(0,r.Ju)(C.actions)),R=I.next();!R.done;R=I.next()){var A=R.value;A.type===o.ni?O[A.activity.id||A.activity.type]=A:A.type===o.ds&&(O[A.activity.id||A.activity.type]=!1)}}catch(e){m={error:e}}finally{try{R&&!R.done&&(g=I.return)&&g.call(I)}finally{if(m)throw m.error}}}}catch(e){h={error:e}}finally{try{T&&!T.done&&(f=k.return)&&f.call(k)}finally{if(h)throw h.error}}var N=(0,r.zs)((0,s.AS)(this,t,n,u,_,l,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),D=N[0],L=N[1],P=(0,r.zs)((0,i.jB)(D,i.Gx),2),M=P[0],j=P[1],F=D.filter((function(e){var t;return e.type===o.ni&&(null===(t=e.activity)||void 0===t?void 0:t.type)===o.lA})),V=F.reduce((function(e,t){return e[t.activity.id]=(0,d.pz)(t.activity,v.machine,L,u),e}),t?(0,r.Cl)({},t.children):{}),$=new a.Uw({value:x||t.value,context:L,_event:u,_sessionid:t?t._sessionid:null,historyValue:x?E?(0,i.BY)(E,x):void 0:t?t.historyValue:void 0,history:!x||e.source?t:void 0,actions:x?j:[],activities:x?O:t?t.activities:{},events:[],configuration:w,transitions:e.transitions,children:V,done:S,tags:(0,c.iU)(w),machine:this}),B=n!==L;$.changed=u.name===o.yo||B;var z=$.history;z&&delete z.history;var U=!S&&(this._transient||y.some((function(e){return e._transient})));if(!(b||U&&u.name!==p))return $;var q=$;if(!S)for(U&&(q=this.resolveRaisedTransition(q,{type:o.kx},u,l));M.length;){var H=M.shift();q=this.resolveRaisedTransition(q,H._event,u,l)}var W=q.changed||(z?!!q.actions.length||B||typeof z.value!=typeof q.value||!(0,a.iE)(q.value,z.value):void 0);return q.changed=W,q.history=z,q},e.prototype.getStateNode=function(e){if(v(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '".concat(e,"' from '").concat(this.id,"'; no child states exist."));var t=this.states[e];if(!t)throw new Error("Child state '".concat(e,"' does not exist on '").concat(this.id,"'"));return t},e.prototype.getStateNodeById=function(e){var t=v(e)?e.slice(1):e;if(t===this.id)return this;var n=this.machine.idMap[t];if(!n)throw new Error("Child state node '#".concat(t,"' does not exist on machine '").concat(this.id,"'"));return n},e.prototype.getStateNodeByPath=function(e){if("string"==typeof e&&v(e))try{return this.getStateNodeById(e.slice(1))}catch(e){}for(var t=(0,i._J)(e,this.delimiter).slice(),n=this;t.length;){var r=t.shift();if(!r.length)break;n=n.getStateNode(r)}return n},e.prototype.resolve=function(e){var t,n=this;if(!e)return this.initialStateValue||g;switch(this.type){case"parallel":return(0,i.LG)(this.initialStateValue,(function(t,r){return t?n.getStateNode(r).resolve(e[r]||t):g}));case"compound":if((0,i.Kg)(e)){var r=this.getStateNode(e);return"parallel"===r.type||"compound"===r.type?((t={})[e]=r.initialStateValue,t):e}return Object.keys(e).length?(0,i.LG)(e,(function(e,t){return e?n.getStateNode(t).resolve(e):g})):this.initialStateValue||{};default:return e||g}},e.prototype.getResolvedPath=function(e){if(v(e)){var t=this.machine.idMap[e.slice(1)];if(!t)throw new Error("Unable to find state node '".concat(e,"'"));return t.path}return(0,i._J)(e,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var e,t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;if("parallel"===this.type)t=(0,i.rp)(this.states,(function(e){return e.initialStateValue||g}),(function(e){return!("history"===e.type)}));else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));t=(0,c.d2)(this.states[this.initial])?this.initial:((e={})[this.initial]=this.states[this.initial].initialStateValue,e)}else t={};return this.__cache.initialStateValue=t,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(e,t){this._init();var n=this.getStateNodes(e);return this.resolveTransition({configuration:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,null!=t?t:this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var e;if("history"===this.type){var t=this.config;e=(0,i.Kg)(t.target)&&v(t.target)?(0,i.zr)(this.machine.getStateNodeById(t.target).path.slice(this.path.length-1)):t.target}return e},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(e,t,n){return void 0===n&&(n=!0),n?"history"===e.type?e.resolveHistory(t):e.initialStateNodes:[e]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var e=this;if((0,c.d2)(this))return[this];if("compound"===this.type&&!this.initial)return l.p||(0,i.R8)(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var t=(0,i.bm)(this.initialStateValue);return(0,i.Bq)(t.map((function(t){return e.getFromRelativePath(t)})))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var t=(0,r.zs)(e),n=t[0],i=t.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(n,"' from node with no states"));var a=this.getStateNode(n);if("history"===a.type)return a.resolveHistory();if(!this.states[n])throw new Error("Child state '".concat(n,"' does not exist on '").concat(this.id,"'"));return this.states[n].getFromRelativePath(i)},e.prototype.historyValue=function(e){if(Object.keys(this.states).length)return{current:e||this.initialStateValue,states:(0,i.rp)(this.states,(function(t,n){if(!e)return t.historyValue();var r=(0,i.Kg)(e)?void 0:e[n];return t.historyValue(r||t.initialStateValue)}),(function(e){return!e.history}))}},e.prototype.resolveHistory=function(e){var t=this;if("history"!==this.type)return[this];var n=this.parent;if(!e){var r=this.target;return r?(0,i.Bq)((0,i.bm)(r).map((function(e){return n.getFromRelativePath(e)}))):n.initialStateNodes}var a=(0,i.VQ)(n.path,"states")(e).current;return(0,i.Kg)(a)?[n.getStateNode(a)]:(0,i.Bq)((0,i.bm)(a).map((function(e){return"deep"===t.history?n.getFromRelativePath(e):[n.states[e[0]]]})))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var e=this,t=(0,i.Bq)(Object.keys(this.states).map((function(t){return e.states[t].stateIds})));return[this.id].concat(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var e,t,n,i;if(this.__cache.events)return this.__cache.events;var a=this.states,o=new Set(this.ownEvents);if(a)try{for(var s=(0,r.Ju)(Object.keys(a)),l=s.next();!l.done;l=s.next()){var u=a[l.value];if(u.states)try{for(var c=(n=void 0,(0,r.Ju)(u.events)),d=c.next();!d.done;d=c.next()){var h=d.value;o.add("".concat(h))}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(o)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter((function(e){return!(!e.target&&!e.actions.length&&e.internal)})).map((function(e){return e.eventType})));return Array.from(e)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(e){var t=this;if(void 0!==e)return e.map((function(e){if(!(0,i.Kg)(e))return e;var n=e[0]===t.delimiter;if(n&&!t.parent)return t.getStateNodeByPath(e.slice(1));var r=n?t.key+e:e;if(!t.parent)return t.getStateNodeByPath(r);try{return t.parent.getStateNodeByPath(r)}catch(e){throw new Error("Invalid transition definition for state node '".concat(t.id,"':\n").concat(e.message))}}))},e.prototype.formatTransition=function(e){var t=this,n=(0,i.R_)(e.target),a="internal"in e?e.internal:!n||n.some((function(e){return(0,i.Kg)(e)&&e[0]===t.delimiter})),o=this.machine.options.guards,l=this.resolveTarget(n),u=(0,r.Cl)((0,r.Cl)({},e),{actions:(0,s.Um)((0,i.$r)(e.actions)),cond:(0,i.Z8)(e.cond,o),target:l,source:this,internal:a,eventType:e.event,toJSON:function(){return(0,r.Cl)((0,r.Cl)({},u),{target:u.target?u.target.map((function(e){return"#".concat(e.id)})):void 0,source:"#".concat(t.id)})}});return u},e.prototype.formatTransitions=function(){var e,t,n,a=this;if(this.config.on)if(Array.isArray(this.config.on))n=this.config.on;else{var o=this.config.on,u=m,c=o[u],d=void 0===c?[]:c,h=(0,r.Tt)(o,["*"]);n=(0,i.Bq)(Object.keys(h).map((function(e){l.p||e!==p||(0,i.R8)(!1,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(a.id,'".'));var t=(0,i.oc)(e,h[e]);return l.p||function(e,t,n){var r=n.slice(0,-1).some((function(e){return!("cond"in e)&&!("in"in e)&&((0,i.Kg)(e.target)||(0,i.Ai)(e.target))})),a=t===p?"the transient event":"event '".concat(t,"'");(0,i.R8)(!r,"One or more transitions for ".concat(a," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")}(a,e,t),t})).concat((0,i.oc)(m,d)))}else n=[];var f=this.config.always?(0,i.oc)("",this.config.always):[],g=this.config.onDone?(0,i.oc)(String((0,s.Vw)(this.id)),this.config.onDone):[];l.p||(0,i.R8)(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var v=(0,i.Bq)(this.invoke.map((function(e){var t=[];return e.onDone&&t.push.apply(t,(0,r.fX)([],(0,r.zs)((0,i.oc)(String((0,s.tS)(e.id)),e.onDone)),!1)),e.onError&&t.push.apply(t,(0,r.fX)([],(0,r.zs)((0,i.oc)(String((0,s.z3)(e.id)),e.onError)),!1)),t}))),y=this.after,b=(0,i.Bq)((0,r.fX)((0,r.fX)((0,r.fX)((0,r.fX)([],(0,r.zs)(g),!1),(0,r.zs)(v),!1),(0,r.zs)(n),!1),(0,r.zs)(f),!1).map((function(e){return(0,i.$r)(e).map((function(e){return a.formatTransition(e)}))})));try{for(var w=(0,r.Ju)(y),S=w.next();!S.done;S=w.next()){var x=S.value;b.push(x)}}catch(t){e={error:t}}finally{try{S&&!S.done&&(t=w.return)&&t.call(w)}finally{if(e)throw e.error}}return b},e}(),b=!1;function w(e,t){return l.p||"predictableActionArguments"in e||b||(b=!0,console.warn("It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html")),new y(e,t)}},7768:(e,t,n)=>{"use strict";n.d(t,{OS:()=>c,Sv:()=>d,Uw:()=>h,iE:()=>u});var r=n(2551),i=n(8204),a=n(5968),o=n(6099),s=n(5846),l=n(5184);function u(e,t){if(e===t)return!0;if(void 0===e||void 0===t)return!1;if((0,a.Kg)(e)||(0,a.Kg)(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((function(n){return u(e[n],t[n])}))}function c(e){return"object"==typeof e&&null!==e&&("value"in e&&"_event"in e)}function d(e,t){var n=e.exec;return(0,r.Cl)((0,r.Cl)({},e),{exec:void 0!==n?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0})}var h=function(){function e(e){var t,n=this;this.actions=[],this.activities=i.xP,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||i.xP,this.meta=(0,o.IQ)(e.configuration),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configuration,this.transitions=e.transitions,this.children=e.children,this.done=!!e.done,this.tags=null!==(t=Array.isArray(e.tags)?new Set(e.tags):e.tags)&&void 0!==t?t:new Set,this.machine=e.machine,Object.defineProperty(this,"nextEvents",{get:function(){return(0,o.Xh)(n.configuration)}})}return e.from=function(t,n){return t instanceof e?t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):t:new e({value:t,context:n,_event:s.zp,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=s.zp;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(e,t){var n=this;if(void 0===e&&(e=this.value),void 0===t&&(t="."),(0,a.Kg)(e))return[e];var i=Object.keys(e);return i.concat.apply(i,(0,r.fX)([],(0,r.zs)(i.map((function(r){return n.toStrings(e[r],t).map((function(e){return r+t+e}))}))),!1))},e.prototype.toJSON=function(){var e=this;e.configuration,e.transitions;var t=e.tags;e.machine;var n=(0,r.Tt)(e,["configuration","transitions","tags","machine"]);return(0,r.Cl)((0,r.Cl)({},n),{tags:Array.from(t)})},e.prototype.matches=function(e){return(0,a.HK)(e,this.value)},e.prototype.hasTag=function(e){return this.tags.has(e)},e.prototype.can=function(e){var t;l.p&&(0,a.R8)(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var n=null===(t=this.machine)||void 0===t?void 0:t.getTransitionData(this,e);return!!(null==n?void 0:n.transitions.length)&&n.transitions.some((function(e){return void 0!==e.target||e.actions.length}))},e}()},2551:(e,t,n)=>{"use strict";n.d(t,{Cl:()=>r,Ju:()=>a,Tt:()=>i,fX:()=>s,zs:()=>o});var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};function i(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function a(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function s(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}},6590:(e,t,n)=>{"use strict";n.d(t,{LM:()=>y,O$:()=>p,Rm:()=>d,Sw:()=>v,Ts:()=>h,ZT:()=>l,ds:()=>a,kp:()=>c,kx:()=>u,lA:()=>f,ni:()=>i,tN:()=>s,xl:()=>o,yo:()=>g,z3:()=>m});var r=n(5468),i=r.Q.Start,a=r.Q.Stop,o=r.Q.Raise,s=r.Q.Send,l=r.Q.Cancel,u=r.Q.NullEvent,c=r.Q.Assign,d=(r.Q.After,r.Q.DoneState,r.Q.Log),h=r.Q.Init,f=r.Q.Invoke,p=(r.Q.ErrorExecution,r.Q.ErrorPlatform),m=r.Q.ErrorCustom,g=r.Q.Update,v=r.Q.Choose,y=r.Q.Pure},5846:(e,t,n)=>{"use strict";n.d(t,{AS:()=>O,H7:()=>u,Hf:()=>c,Pl:()=>w,Um:()=>d,Vw:()=>S,ZT:()=>g,_4:()=>h,ds:()=>y,kp:()=>b,ni:()=>v,tN:()=>p,tS:()=>x,xl:()=>f,z3:()=>E,zp:()=>l});var r=n(2551),i=n(5468),a=n(6590),o=n(5968),s=n(5184),l=(0,o.ft)({type:a.Ts});function u(e,t){return t&&t[e]||void 0}function c(e,t){var n;if((0,o.Kg)(e)||"number"==typeof e){var i=u(e,t);n=(0,o.Tn)(i)?{type:e,exec:i}:i||{type:e,exec:void 0}}else if((0,o.Tn)(e))n={type:e.name||e.toString(),exec:e};else{i=u(e.type,t);if((0,o.Tn)(i))n=(0,r.Cl)((0,r.Cl)({},e),{exec:i});else if(i){var a=i.type||e.type;n=(0,r.Cl)((0,r.Cl)((0,r.Cl)({},i),e),{type:a})}else n=e}return n}var d=function(e,t){return e?((0,o.cy)(e)?e:[e]).map((function(e){return c(e,t)})):[]};function h(e){var t=c(e);return(0,r.Cl)((0,r.Cl)({id:(0,o.Kg)(e)?e:t.id},t),{type:t.type})}function f(e,t){return{type:a.xl,event:"function"==typeof e?e:(0,o.jK)(e),delay:t?t.delay:void 0,id:null==t?void 0:t.id}}function p(e,t){return{to:t?t.to:void 0,type:a.tN,event:(0,o.Tn)(e)?e:(0,o.jK)(e),delay:t?t.delay:void 0,id:t&&void 0!==t.id?t.id:(0,o.Tn)(e)?e.name:(0,o.vd)(e)}}var m=function(e,t,n){return(0,r.Cl)((0,r.Cl)({},e),{value:(0,o.Kg)(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},g=function(e){return{type:a.ZT,sendId:e}};function v(e){var t=h(e);return{type:i.Q.Start,activity:t,exec:void 0}}function y(e){var t=(0,o.Tn)(e)?e:h(e);return{type:i.Q.Stop,activity:t,exec:void 0}}var b=function(e){return{type:a.kp,assignment:e}};function w(e,t){var n=t?"#".concat(t):"";return"".concat(i.Q.After,"(").concat(e,")").concat(n)}function S(e,t){var n="".concat(i.Q.DoneState,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function x(e,t){var n="".concat(i.Q.DoneInvoke,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function E(e,t){var n="".concat(i.Q.ErrorPlatform,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}var _=function(e){var t,n,i=[];try{for(var o=(0,r.Ju)(e),s=o.next();!s.done;s=o.next())for(var l=s.value,u=0;u<l.actions.length;)l.actions[u].type!==a.kp?u++:(i.push(l.actions[u]),l.actions.splice(u,1))}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return i};function O(e,t,n,l,u,h,f){void 0===f&&(f=!1);var p=f?[]:_(u),g=p.length?(0,o.r_)(n,l,p,t):n,v=f?[n]:void 0,y=[];function b(u,p){var b;switch(p.type){case a.xl:var w=function(e,t,n,i){var s,l={_event:n},u=(0,o.ft)((0,o.Tn)(e.event)?e.event(t,n.data,l):e.event);if((0,o.Kg)(e.delay)){var c=i&&i[e.delay];s=(0,o.Tn)(c)?c(t,n.data,l):c}else s=(0,o.Tn)(e.delay)?e.delay(t,n.data,l):e.delay;return(0,r.Cl)((0,r.Cl)({},e),{type:a.xl,_event:u,delay:s})}(p,g,l,e.options.delays);return h&&"number"==typeof w.delay&&h(w,g,l),w;case a.tN:var S=function(e,t,n,i){var a,s={_event:n},l=(0,o.ft)((0,o.Tn)(e.event)?e.event(t,n.data,s):e.event);if((0,o.Kg)(e.delay)){var u=i&&i[e.delay];a=(0,o.Tn)(u)?u(t,n.data,s):u}else a=(0,o.Tn)(e.delay)?e.delay(t,n.data,s):e.delay;var c=(0,o.Tn)(e.to)?e.to(t,n.data,s):e.to;return(0,r.Cl)((0,r.Cl)({},e),{to:c,_event:l,event:l.data,delay:a})}(p,g,l,e.options.delays);if(!s.p){var x=p.delay;(0,o.R8)(!(0,o.Kg)(x)||"number"==typeof S.delay,"No delay reference for delay expression '".concat(x,"' was found on machine '").concat(e.id,"'"))}return h&&S.to!==i.i.Internal&&("entry"===u?y.push(S):h(S,g,l)),S;case a.Rm:var E=m(p,g,l);return null==h||h(E,g,l),E;case a.Sw:if(!(C=null===(b=p.conds.find((function(n){var r=(0,o.Z8)(n.cond,e.options.guards);return!r||(0,o.re)(e,r,g,l,h?void 0:t)})))||void 0===b?void 0:b.actions))return[];var _=(0,r.zs)(O(e,t,g,l,[{type:u,actions:d((0,o.$r)(C),e.options.actions)}],h,f),2),k=_[0],T=_[1];return g=T,null==v||v.push(g),k;case a.LM:var C;if(!(C=p.get(g,l.data)))return[];var I=(0,r.zs)(O(e,t,g,l,[{type:u,actions:d((0,o.$r)(C),e.options.actions)}],h,f),2),R=I[0],A=I[1];return g=A,null==v||v.push(g),R;case a.ds:E=function(e,t,n){var r=(0,o.Tn)(e.activity)?e.activity(t,n.data):e.activity,a="string"==typeof r?{id:r}:r;return{type:i.Q.Stop,activity:a}}(p,g,l);return null==h||h(E,n,l),E;case a.kp:g=(0,o.r_)(g,l,[p],h?void 0:t),null==v||v.push(g);break;default:var N=c(p,e.options.actions),D=N.exec;if(h)h(N,g,l);else if(D&&v){var L=v.length-1,P=(0,r.Cl)((0,r.Cl)({},N),{exec:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];D.apply(void 0,(0,r.fX)([v[L]],(0,r.zs)(t),!1))}});N=P}return N}}return[(0,o.Bq)(u.map((function(e){var t,n,i=[];try{for(var a=(0,r.Ju)(e.actions),o=a.next();!o.done;o=a.next()){var s=o.value,u=b(e.type,s);u&&(i=i.concat(u))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return y.forEach((function(e){h(e,g,l)})),y.length=0,i}))),g]}},8204:(e,t,n)=>{"use strict";n.d(t,{$D:()=>o,AD:()=>r,hS:()=>a,xP:()=>i});var r=".",i={},a="xstate.guard",o=""},5184:(e,t,n)=>{"use strict";n.d(t,{p:()=>r});var r=!0},9221:(e,t,n)=>{"use strict";n.d(t,{kp:()=>r});var r=n(5846).kp},7268:(e,t,n)=>{"use strict";n.d(t,{U4:()=>k});var r=n(2551),i=n(5468),a=n(7768),o=n(6590),s=n(5846),l=n(5184),u=n(5968),c={deferEvents:!1},d=function(){function e(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=(0,r.Cl)((0,r.Cl)({},c),e)}return e.prototype.initialize=function(e){if(this.initialized=!0,e){if(!this.options.deferEvents)return void this.schedule(e);this.process(e)}this.flushEvents()},e.prototype.schedule=function(e){if(this.initialized&&!this.processingEvent){if(0!==this.queue.length)throw new Error("Event queue should be empty when it is not processing events");this.process(e),this.flushEvents()}else this.queue.push(e)},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var e=this.queue.shift();e;)this.process(e),e=this.queue.shift()},e.prototype.process=function(e){this.processingEvent=!0;try{e()}catch(e){throw this.clear(),e}finally{this.processingEvent=!1}},e}(),h=n(5244),f=new Map,p=0,m=function(){return"x:".concat(p++)},g=function(e,t){return f.set(e,t),e},v=function(e){return f.get(e)},y=function(e){f.delete(e)};function b(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:void(l.p||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues"))}function w(e){if(b()){var t=function(){var e=b();if(e&&"__xstate__"in e)return e.__xstate__}();t&&t.register(e)}}var S=n(4648);function x(e,t){void 0===t&&(t={});var n=e.initialState,r=new Set,i=[],a=!1,o=(0,h.sk)({id:t.id,send:function(t){i.push(t),function(){if(!a){for(a=!0;i.length>0;){var t=i.shift();n=e.transition(n,t,s),r.forEach((function(e){return e.next(n)}))}a=!1}}()},getSnapshot:function(){return n},subscribe:function(e,t,i){var a=(0,u.WV)(e,t,i);return r.add(a),a.next(n),{unsubscribe:function(){r.delete(a)}}}}),s={parent:t.parent,self:o,id:t.id||"anonymous",observers:r};return n=e.start?e.start(s):n,o}var E,_={sync:!1,autoForward:!1};!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(E||(E={}));var O=function(){function e(t,n){void 0===n&&(n=e.defaultOptions);var a=this;this.machine=t,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=E.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(e,t){if((0,u.cy)(e))return a.batch(e),a.state;var n=(0,u.ft)((0,u.jK)(e,t));if(a.status===E.Stopped)return l.p||(0,u.R8)(!1,'Event "'.concat(n.name,'" was sent to stopped service "').concat(a.machine.id,'". This service has already reached its final state, and will not transition.\nEvent: ').concat(JSON.stringify(n.data))),a.state;if(a.status!==E.Running&&!a.options.deferEvents)throw new Error('Event "'.concat(n.name,'" was sent to uninitialized service "').concat(a.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(n.data)));return a.scheduler.schedule((function(){a.forward(n);var e=a._nextState(n);a.update(e,n)})),a._state},this.sendTo=function(e,t,n){var c=a.parent&&(t===i.i.Parent||a.parent.id===t),d=c?a.parent:(0,u.Kg)(t)?t===i.i.Internal?a:a.children.get(t)||v(t):(0,u._3)(t)?t:void 0;if(d)if("machine"in d){if(a.status!==E.Stopped||a.parent!==d||a.state.done){var h=(0,r.Cl)((0,r.Cl)({},e),{name:e.name===o.z3?"".concat((0,s.z3)(a.id)):e.name,origin:a.sessionId});!n&&a.machine.config.predictableActionArguments?a._outgoingQueue.push([d,h]):d.send(h)}}else!n&&a.machine.config.predictableActionArguments?a._outgoingQueue.push([d,e.data]):d.send(e.data);else{if(!c)throw new Error("Unable to send event to child '".concat(t,"' from service '").concat(a.id,"'."));l.p||(0,u.R8)(!1,"Service '".concat(a.id,"' has no parent: unable to send event ").concat(e.type))}},this._exec=function(e,t,n,r){void 0===r&&(r=a.machine.options.actions);var c=e.exec||(0,s.H7)(e.type,r),d=(0,u.Tn)(c)?c:c?c.exec:e.exec;if(d)try{return d(t,n.data,a.machine.config.predictableActionArguments?{action:e,_event:n}:{action:e,state:a.state,_event:n})}catch(e){throw a.parent&&a.parent.send({type:"xstate.error",data:e}),e}switch(e.type){case o.xl:var h=e;a.defer(h);break;case o.tN:var f=e;if("number"==typeof f.delay)return void a.defer(f);f.to?a.sendTo(f._event,f.to,n===s.zp):a.send(f._event);break;case o.ZT:a.cancel(e.sendId);break;case o.ni:if(a.status!==E.Running)return;var p=e.activity;if(!a.machine.config.predictableActionArguments&&!a.state.activities[p.id||p.type])break;if(p.type===i.Q.Invoke){var m=(0,u.Xd)(p.src),g=a.machine.options.services?a.machine.options.services[m.type]:void 0,v=p.id,y=p.data;l.p||(0,u.R8)(!("forward"in p),"`forward` property is deprecated (found in invocation of '".concat(p.src,"' in in machine '").concat(a.machine.id,"'). ")+"Please use `autoForward` instead.");var b="autoForward"in p?p.autoForward:!!p.forward;if(!g)return void(l.p||(0,u.R8)(!1,"No service found for invocation '".concat(p.src,"' in machine '").concat(a.machine.id,"'.")));var w=y?(0,u.A9)(y,t,n):void 0;if("string"==typeof g)return;var S=(0,u.Tn)(g)?g(t,n.data,{data:w,src:m,meta:p.meta}):g;if(!S)return;var x=void 0;(0,u.Ai)(S)&&(S=w?S.withContext(w):S,x={autoForward:b}),a.spawn(S,v,x)}else a.spawnActivity(p);break;case o.ds:a.stopChild(e.activity.id);break;case o.Rm:var _=e,O=_.label,k=_.value;O?a.logger(O,k):a.logger(k);break;default:l.p||(0,u.R8)(!1,"No implementation found for action type '".concat(e.type,"'"))}};var c=(0,r.Cl)((0,r.Cl)({},e.defaultOptions),n),h=c.clock,f=c.logger,p=c.parent,g=c.id,y=void 0!==g?g:t.id;this.id=y,this.logger=f,this.clock=h,this.parent=p,this.options=c,this.scheduler=new d({deferEvents:this.options.deferEvents}),this.sessionId=m()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:(0,S.G)(this,(function(){return e._initialState=e.machine.initialState,e._initialState}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return l.p||(0,u.R8)(this.status!==E.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(e,t){var n,i;try{for(var a=(0,r.Ju)(e.actions),o=a.next();!o.done;o=a.next()){var s=o.value;this.exec(s,e,t)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}},e.prototype.update=function(e,t){var n,i,a,o,l,c,d,h,f=this;if(e._sessionid=this.sessionId,this._state=e,this.machine.config.predictableActionArguments&&t!==s.zp||!this.options.execute)for(var p=void 0;p=this._outgoingQueue.shift();)p[0].send(p[1]);else this.execute(this.state);if(this.children.forEach((function(e){f.state.children[e.id]=e})),this.devTools&&this.devTools.send(t.data,e),e.event)try{for(var m=(0,r.Ju)(this.eventListeners),g=m.next();!g.done;g=m.next()){(0,g.value)(e.event)}}catch(e){n={error:e}}finally{try{g&&!g.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}try{for(var v=(0,r.Ju)(this.listeners),b=v.next();!b.done;b=v.next()){(0,b.value)(e,e.event)}}catch(e){a={error:e}}finally{try{b&&!b.done&&(o=v.return)&&o.call(v)}finally{if(a)throw a.error}}try{for(var w=(0,r.Ju)(this.contextListeners),S=w.next();!S.done;S=w.next()){(0,S.value)(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(e){l={error:e}}finally{try{S&&!S.done&&(c=w.return)&&c.call(w)}finally{if(l)throw l.error}}if(this.state.done){var x=e.configuration.find((function(e){return"final"===e.type&&e.parent===f.machine})),E=x&&x.doneData?(0,u.A9)(x.doneData,e.context,t):void 0;this._doneEvent=(0,s.tS)(this.id,E);try{for(var _=(0,r.Ju)(this.doneListeners),O=_.next();!O.done;O=_.next()){(0,O.value)(this._doneEvent)}}catch(e){d={error:e}}finally{try{O&&!O.done&&(h=_.return)&&h.call(_)}finally{if(d)throw d.error}}this._stop(),this._stopChildren(),y(this.sessionId)}},e.prototype.onTransition=function(e){return this.listeners.add(e),this.status===E.Running&&e(this.state,this.state.event),this},e.prototype.subscribe=function(e,t,n){var r=this,i=(0,u.WV)(e,t,n);this.listeners.add(i.next),this.status!==E.NotStarted&&i.next(this.state);var a=function(){r.doneListeners.delete(a),r.stopListeners.delete(a),i.complete()};return this.status===E.Stopped?i.complete():(this.onDone(a),this.onStop(a)),{unsubscribe:function(){r.listeners.delete(i.next),r.doneListeners.delete(a),r.stopListeners.delete(a)}}},e.prototype.onEvent=function(e){return this.eventListeners.add(e),this},e.prototype.onSend=function(e){return this.sendListeners.add(e),this},e.prototype.onChange=function(e){return this.contextListeners.add(e),this},e.prototype.onStop=function(e){return this.stopListeners.add(e),this},e.prototype.onDone=function(e){return this.status===E.Stopped&&this._doneEvent?e(this._doneEvent):this.doneListeners.add(e),this},e.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},e.prototype.start=function(e){var t=this;if(this.status===E.Running)return this;this.machine._init(),g(this.sessionId,this),this.initialized=!0,this.status=E.Running;var n=void 0===e?this.initialState:(0,S.G)(this,(function(){return(0,a.OS)(e)?t.machine.resolveState(e):t.machine.resolveState(a.Uw.from(e,t.machine.context))}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){t.update(n,s.zp)})),this},e.prototype._stopChildren=function(){this.children.forEach((function(e){(0,u.Tn)(e.stop)&&e.stop()})),this.children.clear()},e.prototype._stop=function(){var e,t,n,i,a,o,s,l,u,c;try{for(var h=(0,r.Ju)(this.listeners),f=h.next();!f.done;f=h.next()){var p=f.value;this.listeners.delete(p)}}catch(t){e={error:t}}finally{try{f&&!f.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}try{for(var m=(0,r.Ju)(this.stopListeners),g=m.next();!g.done;g=m.next()){(p=g.value)(),this.stopListeners.delete(p)}}catch(e){n={error:e}}finally{try{g&&!g.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}try{for(var v=(0,r.Ju)(this.contextListeners),y=v.next();!y.done;y=v.next()){p=y.value;this.contextListeners.delete(p)}}catch(e){a={error:e}}finally{try{y&&!y.done&&(o=v.return)&&o.call(v)}finally{if(a)throw a.error}}try{for(var b=(0,r.Ju)(this.doneListeners),w=b.next();!w.done;w=b.next()){p=w.value;this.doneListeners.delete(p)}}catch(e){s={error:e}}finally{try{w&&!w.done&&(l=b.return)&&l.call(b)}finally{if(s)throw s.error}}if(!this.initialized)return this;this.initialized=!1,this.status=E.Stopped,this._initialState=void 0;try{for(var S=(0,r.Ju)(Object.keys(this.delayedEventsMap)),x=S.next();!x.done;x=S.next()){var _=x.value;this.clock.clearTimeout(this.delayedEventsMap[_])}}catch(e){u={error:e}}finally{try{x&&!x.done&&(c=S.return)&&c.call(S)}finally{if(u)throw u.error}}this.scheduler.clear(),this.scheduler=new d({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var e=this,t=this.scheduler;return this._stop(),t.schedule((function(){var t;if(!(null===(t=e._state)||void 0===t?void 0:t.done)){var n=(0,u.ft)({type:"xstate.stop"}),i=(0,S.G)(e,(function(){var t=(0,u.Bq)((0,r.fX)([],(0,r.zs)(e.state.configuration),!1).sort((function(e,t){return t.order-e.order})).map((function(t){return(0,s.Um)(t.onExit,e.machine.options.actions)}))),i=(0,r.zs)((0,s.AS)(e.machine,e.state,e.state.context,n,[{type:"exit",actions:t}],e.machine.config.predictableActionArguments?e._exec:void 0,e.machine.config.predictableActionArguments||e.machine.config.preserveActionOrder),2),o=i[0],l=i[1],c=new a.Uw({value:e.state.value,context:l,_event:n,_sessionid:e.sessionId,historyValue:void 0,history:e.state,actions:o.filter((function(e){return!(0,u.Gx)(e)})),activities:{},events:[],configuration:[],transitions:[],children:{},done:e.state.done,tags:e.state.tags,machine:e.machine});return c.changed=!0,c}));e.update(i,n),e._stopChildren(),y(e.sessionId)}})),this},e.prototype.batch=function(e){var t=this;if(this.status===E.NotStarted&&this.options.deferEvents)l.p||(0,u.R8)(!1,"".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'" and are deferred. Make sure .start() is called for this service.\nEvent: ').concat(JSON.stringify(event)));else if(this.status!==E.Running)throw new Error("".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(e.length){var n=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule((function(){var i,o,s=t.state,l=!1,c=[],d=function(e){var i=(0,u.ft)(e);t.forward(i),s=(0,S.G)(t,(function(){return t.machine.transition(s,i,void 0,n||void 0)})),c.push.apply(c,(0,r.fX)([],(0,r.zs)(t.machine.config.predictableActionArguments?s.actions:s.actions.map((function(e){return(0,a.Sv)(e,s)}))),!1)),l=l||!!s.changed};try{for(var h=(0,r.Ju)(e),f=h.next();!f.done;f=h.next()){d(f.value)}}catch(e){i={error:e}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}s.changed=l,s.actions=c,t.update(s,(0,u.ft)(e[e.length-1]))}))}},e.prototype.sender=function(e){return this.send.bind(this,e)},e.prototype._nextState=function(e,t){var n=this;void 0===t&&(t=!!this.machine.config.predictableActionArguments&&this._exec);var r=(0,u.ft)(e);if(0===r.name.indexOf(o.O$)&&!this.state.nextEvents.some((function(e){return 0===e.indexOf(o.O$)})))throw r.data.data;return(0,S.G)(this,(function(){return n.machine.transition(n.state,r,void 0,t||void 0)}))},e.prototype.nextState=function(e){return this._nextState(e,!1)},e.prototype.forward=function(e){var t,n;try{for(var i=(0,r.Ju)(this.forwardTo),a=i.next();!a.done;a=i.next()){var o=a.value,s=this.children.get(o);if(!s)throw new Error("Unable to forward event '".concat(e,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(o,"'."));s.send(e)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.prototype.defer=function(e){var t=this,n=this.clock.setTimeout((function(){"to"in e&&e.to?t.sendTo(e._event,e.to,!0):t.send(e._event)}),e.delay);e.id&&(this.delayedEventsMap[e.id]=n)},e.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},e.prototype.exec=function(e,t,n){void 0===n&&(n=this.machine.options.actions),this._exec(e,t.context,t._event,n)},e.prototype.removeChild=function(e){var t;this.children.delete(e),this.forwardTo.delete(e),null===(t=this.state)||void 0===t||delete t.children[e]},e.prototype.stopChild=function(e){var t=this.children.get(e);t&&(this.removeChild(e),(0,u.Tn)(t.stop)&&t.stop())},e.prototype.spawn=function(e,t,n){if(this.status!==E.Running)return(0,h.Py)(e,t);if((0,u.$X)(e))return this.spawnPromise(Promise.resolve(e),t);if((0,u.Tn)(e))return this.spawnCallback(e,t);if((0,h.gY)(e))return this.spawnActor(e,t);if((0,u.AT)(e))return this.spawnObservable(e,t);if((0,u.Ai)(e))return this.spawnMachine(e,(0,r.Cl)((0,r.Cl)({},n),{id:t}));if((0,u.lx)(e))return this.spawnBehavior(e,t);throw new Error('Unable to spawn entity "'.concat(t,'" of type "').concat(typeof e,'".'))},e.prototype.spawnMachine=function(t,n){var i=this;void 0===n&&(n={});var a=new e(t,(0,r.Cl)((0,r.Cl)({},this.options),{parent:this,id:n.id||t.id})),s=(0,r.Cl)((0,r.Cl)({},_),n);s.sync&&a.onTransition((function(e){i.send(o.yo,{state:e,id:a.id})}));var l=a;return this.children.set(a.id,l),s.autoForward&&this.forwardTo.add(a.id),a.onDone((function(e){i.removeChild(a.id),i.send((0,u.ft)(e,{origin:a.id}))})).start(),l},e.prototype.spawnBehavior=function(e,t){var n=x(e,{id:t,parent:this});return this.children.set(t,n),n},e.prototype.spawnPromise=function(e,t){var n,r,i=this,a=!1;e.then((function(e){a||(r=e,i.removeChild(t),i.send((0,u.ft)((0,s.tS)(t,e),{origin:t})))}),(function(e){if(!a){i.removeChild(t);var n=(0,s.z3)(t,e);try{i.send((0,u.ft)(n,{origin:t}))}catch(r){(0,u.En)(e,r,t),i.devTools&&i.devTools.send(n,i.state),i.machine.strict&&i.stop()}}}));var o=((n={id:t,send:function(){},subscribe:function(t,n,r){var i=(0,u.WV)(t,n,r),a=!1;return e.then((function(e){a||(i.next(e),a||i.complete())}),(function(e){a||i.error(e)})),{unsubscribe:function(){return a=!0}}},stop:function(){a=!0},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[u.s7]=function(){return this},n);return this.children.set(t,o),o},e.prototype.spawnCallback=function(e,t){var n,r,i,a=this,o=!1,l=new Set,c=new Set;try{i=e((function(e){r=e,c.forEach((function(t){return t(e)})),o||a.send((0,u.ft)(e,{origin:t}))}),(function(e){l.add(e)}))}catch(e){this.send((0,s.z3)(t,e))}if((0,u.$X)(i))return this.spawnPromise(i,t);var d=((n={id:t,send:function(e){return l.forEach((function(t){return t(e)}))},subscribe:function(e){var t=(0,u.WV)(e);return c.add(t.next),{unsubscribe:function(){c.delete(t.next)}}},stop:function(){o=!0,(0,u.Tn)(i)&&i()},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[u.s7]=function(){return this},n);return this.children.set(t,d),d},e.prototype.spawnObservable=function(e,t){var n,r,i=this,a=e.subscribe((function(e){r=e,i.send((0,u.ft)(e,{origin:t}))}),(function(e){i.removeChild(t),i.send((0,u.ft)((0,s.z3)(t,e),{origin:t}))}),(function(){i.removeChild(t),i.send((0,u.ft)((0,s.tS)(t),{origin:t}))})),o=((n={id:t,send:function(){},subscribe:function(t,n,r){return e.subscribe(t,n,r)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return r},toJSON:function(){return{id:t}}})[u.s7]=function(){return this},n);return this.children.set(t,o),o},e.prototype.spawnActor=function(e,t){return this.children.set(t,e),e},e.prototype.spawnActivity=function(e){var t=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(t){var n=t(this.state.context,e);this.spawnEffect(e.id,n)}else l.p||(0,u.R8)(!1,"No implementation found for activity '".concat(e.type,"'"))},e.prototype.spawnEffect=function(e,t){var n;this.children.set(e,((n={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:t||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}})[u.s7]=function(){return this},n))},e.prototype.attachDev=function(){var e=b();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var t="object"==typeof this.options.devTools?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect((0,r.Cl)((0,r.Cl)({name:this.id,autoPause:!0,stateSanitizer:function(e){return{value:e.value,context:e.context,actions:e.actions}}},t),{features:(0,r.Cl)({jump:!1,skip:!1},t?t.features:void 0)}),this.machine),this.devTools.init(this.state)}w(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[u.s7]=function(){return this},e.prototype.getSnapshot=function(){return this.status===E.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(e,t){return setTimeout(e,t)},clearTimeout:function(e){return clearTimeout(e)}},logger:console.log.bind(console),devTools:!1},e.interpret=k,e}();function k(e,t){return new O(e,t)}},4648:(e,t,n)=>{"use strict";n.d(t,{G:()=>i});var r=[],i=function(e,t){r.push(e);var n=t(e);return r.pop(),n}},6099:(e,t,n)=>{"use strict";n.d(t,{BJ:()=>m,D0:()=>u,IQ:()=>g,Ki:()=>l,Xh:()=>p,_W:()=>h,d2:()=>a,i0:()=>s,iU:()=>v,rz:()=>o,zy:()=>f});var r=n(2551),i=n(5968),a=function(e){return"atomic"===e.type||"final"===e.type};function o(e){return Object.keys(e.states).map((function(t){return e.states[t]}))}function s(e){return o(e).filter((function(e){return"history"!==e.type}))}function l(e){var t=[e];return a(e)?t:t.concat((0,i.Bq)(s(e).map(l)))}function u(e,t){var n,i,a,o,l,u,c,h,f=d(new Set(e)),p=new Set(t);try{for(var m=(0,r.Ju)(p),g=m.next();!g.done;g=m.next())for(var v=(k=g.value).parent;v&&!p.has(v);)p.add(v),v=v.parent}catch(e){n={error:e}}finally{try{g&&!g.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}var y=d(p);try{for(var b=(0,r.Ju)(p),w=b.next();!w.done;w=b.next()){if("compound"!==(k=w.value).type||y.get(k)&&y.get(k).length){if("parallel"===k.type)try{for(var S=(l=void 0,(0,r.Ju)(s(k))),x=S.next();!x.done;x=S.next()){var E=x.value;p.has(E)||(p.add(E),f.get(E)?f.get(E).forEach((function(e){return p.add(e)})):E.initialStateNodes.forEach((function(e){return p.add(e)})))}}catch(e){l={error:e}}finally{try{x&&!x.done&&(u=S.return)&&u.call(S)}finally{if(l)throw l.error}}}else f.get(k)?f.get(k).forEach((function(e){return p.add(e)})):k.initialStateNodes.forEach((function(e){return p.add(e)}))}}catch(e){a={error:e}}finally{try{w&&!w.done&&(o=b.return)&&o.call(b)}finally{if(a)throw a.error}}try{for(var _=(0,r.Ju)(p),O=_.next();!O.done;O=_.next()){var k;for(v=(k=O.value).parent;v&&!p.has(v);)p.add(v),v=v.parent}}catch(e){c={error:e}}finally{try{O&&!O.done&&(h=_.return)&&h.call(_)}finally{if(c)throw c.error}}return p}function c(e,t){var n=t.get(e);if(!n)return{};if("compound"===e.type){var r=n[0];if(!r)return{};if(a(r))return r.key}var i={};return n.forEach((function(e){i[e.key]=c(e,t)})),i}function d(e){var t,n,i=new Map;try{for(var a=(0,r.Ju)(e),o=a.next();!o.done;o=a.next()){var s=o.value;i.has(s)||i.set(s,[]),s.parent&&(i.has(s.parent)||i.set(s.parent,[]),i.get(s.parent).push(s))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return i}function h(e,t){return c(e,d(u([e],t)))}function f(e,t){return Array.isArray(e)?e.some((function(e){return e===t})):e instanceof Set&&e.has(t)}function p(e){return(0,r.fX)([],(0,r.zs)(new Set((0,i.Bq)((0,r.fX)([],(0,r.zs)(e.map((function(e){return e.ownEvents}))),!1)))),!1)}function m(e,t){return"compound"===t.type?s(t).some((function(t){return"final"===t.type&&f(e,t)})):"parallel"===t.type&&s(t).every((function(t){return m(e,t)}))}function g(e){return void 0===e&&(e=[]),e.reduce((function(e,t){return void 0!==t.meta&&(e[t.id]=t.meta),e}),{})}function v(e){return new Set((0,i.Bq)(e.map((function(e){return e.tags}))))}},5468:(e,t,n)=>{"use strict";var r,i;n.d(t,{Q:()=>r,i:()=>i}),function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"}(r||(r={})),function(e){e.Parent="#_parent",e.Internal="#_internal"}(i||(i={}))},5968:(e,t,n)=>{"use strict";n.d(t,{$X:()=>_,$r:()=>S,A9:()=>x,AT:()=>P,Ae:()=>g,Ai:()=>j,BY:()=>C,Bq:()=>b,En:()=>U,Gx:()=>K,HK:()=>u,Kg:()=>D,LG:()=>p,M7:()=>E,R8:()=>R,R_:()=>z,Tn:()=>N,VQ:()=>v,WV:()=>W,Xd:()=>H,Z8:()=>L,_3:()=>F,_J:()=>d,at:()=>h,bm:()=>y,cv:()=>G,cy:()=>A,ft:()=>$,jB:()=>k,jK:()=>V,lx:()=>O,oc:()=>B,r_:()=>I,re:()=>q,rp:()=>m,s7:()=>M,vd:()=>c,zr:()=>f});var r,i=n(2551),a=n(5468),o=n(6590),s=n(8204),l=n(5184);function u(e,t,n){void 0===n&&(n=s.AD);var r=h(e,n),i=h(t,n);return D(i)?!!D(r)&&i===r:D(r)?r in i:Object.keys(r).every((function(e){return e in i&&u(r[e],i[e])}))}function c(e){try{return D(e)||"number"==typeof e?"".concat(e):e.type}catch(e){throw new Error("Events must be strings or objects with a string event.type property.")}}function d(e,t){try{return A(e)?e:e.toString().split(t)}catch(t){throw new Error("'".concat(e,"' is not a valid state path."))}}function h(e,t){return"object"==typeof(n=e)&&"value"in n&&"context"in n&&"event"in n&&"_event"in n?e.value:A(e)?f(e):"string"!=typeof e?e:f(d(e,t));var n}function f(e){if(1===e.length)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function p(e,t){for(var n={},r=Object.keys(e),i=0;i<r.length;i++){var a=r[i];n[a]=t(e[a],a,e,i)}return n}function m(e,t,n){var r,a,o={};try{for(var s=(0,i.Ju)(Object.keys(e)),l=s.next();!l.done;l=s.next()){var u=l.value,c=e[u];n(c)&&(o[u]=t(c,u,e))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(a=s.return)&&a.call(s)}finally{if(r)throw r.error}}return o}var g=function(e){return function(t){var n,r,a=t;try{for(var o=(0,i.Ju)(e),s=o.next();!s.done;s=o.next()){a=a[s.value]}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a}};function v(e,t){return function(n){var r,a,o=n;try{for(var s=(0,i.Ju)(e),l=s.next();!l.done;l=s.next()){var u=l.value;o=o[t][u]}}catch(e){r={error:e}}finally{try{l&&!l.done&&(a=s.return)&&a.call(s)}finally{if(r)throw r.error}}return o}}function y(e){return e?D(e)?[[e]]:b(Object.keys(e).map((function(t){var n=e[t];return"string"==typeof n||n&&Object.keys(n).length?y(e[t]).map((function(e){return[t].concat(e)})):[[t]]}))):[[]]}function b(e){var t;return(t=[]).concat.apply(t,(0,i.fX)([],(0,i.zs)(e),!1))}function w(e){return A(e)?e:[e]}function S(e){return void 0===e?[]:w(e)}function x(e,t,n){var r,a;if(N(e))return e(t,n.data);var o={};try{for(var s=(0,i.Ju)(Object.keys(e)),l=s.next();!l.done;l=s.next()){var u=l.value,c=e[u];N(c)?o[u]=c(t,n.data):o[u]=c}}catch(e){r={error:e}}finally{try{l&&!l.done&&(a=s.return)&&a.call(s)}finally{if(r)throw r.error}}return o}function E(e){return/^(done|error)\./.test(e)}function _(e){return e instanceof Promise||!(null===e||!N(e)&&"object"!=typeof e||!N(e.then))}function O(e){return null!==e&&"object"==typeof e&&"transition"in e&&"function"==typeof e.transition}function k(e,t){var n,r,a=(0,i.zs)([[],[]],2),o=a[0],s=a[1];try{for(var l=(0,i.Ju)(e),u=l.next();!u.done;u=l.next()){var c=u.value;t(c)?o.push(c):s.push(c)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return[o,s]}function T(e,t){return p(e.states,(function(e,n){if(e){var r=(D(t)?void 0:t[n])||(e?e.current:void 0);if(r)return{current:r,states:T(e,r)}}}))}function C(e,t){return{current:t,states:T(e,t)}}function I(e,t,n,r){l.p||R(!!e,"Attempting to update undefined context");var a=e?n.reduce((function(e,n){var a,o,s=n.assignment,l={state:r,action:n,_event:t},u={};if(N(s))u=s(e,t.data,l);else try{for(var c=(0,i.Ju)(Object.keys(s)),d=c.next();!d.done;d=c.next()){var h=d.value,f=s[h];u[h]=N(f)?f(e,t.data,l):f}}catch(e){a={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(a)throw a.error}}return Object.assign({},e,u)}),e):e;return a}var R=function(){};function A(e){return Array.isArray(e)}function N(e){return"function"==typeof e}function D(e){return"string"==typeof e}function L(e,t){if(e)return D(e)?{type:s.hS,name:e,predicate:t?t[e]:void 0}:N(e)?{type:s.hS,name:e.name,predicate:e}:e}function P(e){try{return"subscribe"in e&&N(e.subscribe)}catch(e){return!1}}l.p||(R=function(e,t){var n=e instanceof Error?e:void 0;if((n||!e)&&void 0!==console){var r=["Warning: ".concat(t)];n&&r.push(n),console.warn.apply(console,r)}});var M=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();(r={})[M]=function(){return this},r[Symbol.observable]=function(){return this};function j(e){return!!e&&"__xstatenode"in e}function F(e){return!!e&&"function"==typeof e.send}function V(e,t){return D(e)||"number"==typeof e?(0,i.Cl)({type:e},t):e}function $(e,t){if(!D(e)&&"$$type"in e&&"scxml"===e.$$type)return e;var n=V(e);return(0,i.Cl)({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function B(e,t){return w(t).map((function(t){return void 0===t||"string"==typeof t||j(t)?{target:t,event:e}:(0,i.Cl)((0,i.Cl)({},t),{event:e})}))}function z(e){if(void 0!==e&&e!==s.$D)return S(e)}function U(e,t,n){if(!l.p){var r=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";if(e===t)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(e,"'.").concat(r));else{var i=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(e,"'. ").concat(r," Current error is '").concat(t,"'.").concat(i))}}}function q(e,t,n,r,i){var a=e.options.guards,o={state:i,cond:t,_event:r};if(t.type===s.hS)return((null==a?void 0:a[t.name])||t.predicate)(n,r.data,o);var l=null==a?void 0:a[t.type];if(!l)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return l(n,r.data,o)}function H(e){return"string"==typeof e?{type:e}:e}function W(e,t,n){var r=function(){},i="object"==typeof e,a=i?e:null;return{next:((i?e.next:e)||r).bind(a),error:((i?e.error:t)||r).bind(a),complete:((i?e.complete:n)||r).bind(a)}}function G(e,t){return"".concat(e,":invocation[").concat(t,"]")}function K(e){return(e.type===o.xl||e.type===o.tN&&e.to===a.i.Internal)&&"number"!=typeof e.delay}},1298:(e,t,n)=>{"use strict";function r(e,t,...n){return n.reduce(((e,t)=>e.nestedMessages[t]),e.messages[t])}n.d(t,{Z:()=>r})},2951:(e,t,n)=>{"use strict";function r(e){const t=function(){if(!o){o=[];const e=s("std");for(let t=0;t<e.length;t++)o[e[t].charCodeAt(0)]=t;o["-".charCodeAt(0)]=e.indexOf("+"),o["_".charCodeAt(0)]=e.indexOf("/")}return o}();let n=3*e.length/4;"="==e[e.length-2]?n-=2:"="==e[e.length-1]&&(n-=1);let r,i=new Uint8Array(n),a=0,l=0,u=0;for(let n=0;n<e.length;n++){if(r=t[e.charCodeAt(n)],void 0===r)switch(e[n]){case"=":l=0;case"\n":case"\r":case"\t":case" ":continue;default:throw Error("invalid base64 string")}switch(l){case 0:u=r,l=1;break;case 1:i[a++]=u<<2|(48&r)>>4,u=r,l=2;break;case 2:i[a++]=(15&u)<<4|(60&r)>>2,u=r,l=3;break;case 3:i[a++]=(3&u)<<6|r,l=0}}if(1==l)throw Error("invalid base64 string");return i.subarray(0,a)}let i,a,o;function s(e){return i||(i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),a=i.slice(0,-2).concat("-","_")),"url"==e?a:i}function l(e){let t=!1;const n=[];for(let r=0;r<e.length;r++){let i=e.charAt(r);switch(i){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n.push(i),t=!1;break;default:t&&(t=!1,i=i.toUpperCase()),n.push(i)}}return n.join("")}n.d(t,{w:()=>Et});const u=new Set(["constructor","toString","toJSON","valueOf"]);function c(e){return u.has(e)?e+"$":e}var d=n(9228);function h(e){for(const t of e.field)(0,d.b1)(t,"jsonName")||(t.jsonName=l(t.name));e.nestedType.forEach(h)}var f=n(6592),p=n(8302);function m(e,t){switch(e){case f.L.STRING:return t;case f.L.BYTES:{const n=function(e){const t=[],n={tail:e,c:"",next(){return 0!=this.tail.length&&(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(e){if(this.tail.length>=e){const t=this.tail.substring(0,e);return this.tail=this.tail.substring(e),t}return!1}};for(;n.next();)if("\\"===n.c){if(n.next())switch(n.c){case"\\":t.push(n.c.charCodeAt(0));break;case"b":t.push(8);break;case"f":t.push(12);break;case"n":t.push(10);break;case"r":t.push(13);break;case"t":t.push(9);break;case"v":t.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{const e=n.c,r=n.take(2);if(!1===r)return!1;const i=parseInt(e+r,8);if(Number.isNaN(i))return!1;t.push(i);break}case"x":{const e=n.c,r=n.take(2);if(!1===r)return!1;const i=parseInt(e+r,16);if(Number.isNaN(i))return!1;t.push(i);break}case"u":{const e=n.c,r=n.take(4);if(!1===r)return!1;const i=parseInt(e+r,16);if(Number.isNaN(i))return!1;const a=new Uint8Array(4);new DataView(a.buffer).setInt32(0,i,!0),t.push(a[0],a[1],a[2],a[3]);break}case"U":{const e=n.c,r=n.take(8);if(!1===r)return!1;const i=p.M.uEnc(e+r),a=new Uint8Array(8),o=new DataView(a.buffer);o.setInt32(0,i.lo,!0),o.setInt32(4,i.hi,!0),t.push(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]);break}}}else t.push(n.c.charCodeAt(0));return new Uint8Array(t)}(t);if(!1===n)throw new Error(`cannot parse ${f.L[e]} default value: ${t}`);return n}case f.L.INT64:case f.L.SFIXED64:case f.L.SINT64:return p.M.parse(t);case f.L.UINT64:case f.L.FIXED64:return p.M.uParse(t);case f.L.DOUBLE:case f.L.FLOAT:switch(t){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:return parseFloat(t)}case f.L.BOOL:return"true"===t;case f.L.INT32:case f.L.UINT32:case f.L.SINT32:case f.L.FIXED32:case f.L.SFIXED32:return parseInt(t,10)}}function*g(e){switch(e.kind){case"file":for(const t of e.messages)yield t,yield*g(t);yield*e.enums,yield*e.services,yield*e.extensions;break;case"message":for(const t of e.nestedMessages)yield t,yield*g(t);yield*e.nestedEnums,yield*e.nestedExtensions}}function v(...e){const t=y();if(!e.length)return t;if("$typeName"in e[0]&&"google.protobuf.FileDescriptorSet"==e[0].$typeName){for(const n of e[0].file)j(n,t);return t}if("$typeName"in e[0]){const r=e[0],i=e[1],a=new Set;function o(e){const n=[];for(const r of e.dependency){if(null!=t.getFile(r))continue;if(a.has(r))continue;const o=i(r);if(!o)throw new Error(`Unable to resolve ${r}, imported by ${e.name}`);"kind"in o?t.addFile(o,!1,!0):(a.add(o.name),n.push(o))}return n.concat(...n.map(o))}for(const s of[r,...o(r)].reverse())j(s,t)}else for(const l of e)for(const u of l.files)t.addFile(u);return t}function y(){const e=new Map,t=new Map,n=new Map;return{kind:"registry",types:e,extendees:t,[Symbol.iterator]:()=>e.values(),get files(){return n.values()},addFile(e,t,r){if(n.set(e.proto.name,e),!t)for(const t of g(e))this.add(t);if(r)for(const n of e.dependencies)this.addFile(n,t,r)},add(n){if("extension"==n.kind){let e=t.get(n.extendee.typeName);e||t.set(n.extendee.typeName,e=new Map),e.set(n.number,n)}e.set(n.typeName,n)},get:t=>e.get(t),getFile:e=>n.get(e),getMessage(t){const n=e.get(t);return"message"==(null==n?void 0:n.kind)?n:void 0},getEnum(t){const n=e.get(t);return"enum"==(null==n?void 0:n.kind)?n:void 0},getExtension(t){const n=e.get(t);return"extension"==(null==n?void 0:n.kind)?n:void 0},getExtensionFor(e,n){var r;return null===(r=t.get(e.typeName))||void 0===r?void 0:r.get(n)},getService(t){const n=e.get(t);return"service"==(null==n?void 0:n.kind)?n:void 0}}}const b=998,w=999,S=9,x=10,E=11,_=12,O=14,k=3,T=2,C=1,I=0,R=1,A=2,N=3,D=1,L=2,P=1,M={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2,defaultSymbolVisibility:1},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1001:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:1,defaultSymbolVisibility:2}};function j(e,t){var n,r;const i={kind:"file",proto:e,deprecated:null!==(r=null===(n=e.options)||void 0===n?void 0:n.deprecated)&&void 0!==r&&r,edition:H(e),name:e.name.replace(/\.proto$/,""),dependencies:W(e,t),enums:[],messages:[],extensions:[],services:[],toString:()=>`file ${e.name}`},a=new Map,o={get:e=>a.get(e),add(e){var t;Z(!0===(null===(t=e.proto.options)||void 0===t?void 0:t.mapEntry)),a.set(e.typeName,e)}};for(const n of e.enumType)$(n,i,void 0,t);for(const n of e.messageType)B(n,i,void 0,t,o);for(const n of e.service)z(n,i,t);F(i,t);for(const e of a.values())V(e,t,o);for(const e of i.messages)V(e,t,o),F(e,t);t.addFile(i,!0)}function F(e,t){switch(e.kind){case"file":for(const n of e.proto.extension){const r=q(n,e,t);e.extensions.push(r),t.add(r)}break;case"message":for(const n of e.proto.extension){const r=q(n,e,t);e.nestedExtensions.push(r),t.add(r)}for(const n of e.nestedMessages)F(n,t)}}function V(e,t,n){const r=e.proto.oneofDecl.map((t=>function(e,t){return{kind:"oneof",proto:e,deprecated:!1,parent:t,fields:[],name:e.name,localName:c(l(e.name)),toString(){return`oneof ${t.typeName}.${this.name}`}}}(t,e))),i=new Set;for(const a of e.proto.field){const o=Q(a,r),s=q(a,e,t,o,n);e.fields.push(s),e.field[s.localName]=s,void 0===o?e.members.push(s):(o.fields.push(s),i.has(o)||(i.add(o),e.members.push(o)))}for(const t of r.filter((e=>i.has(e))))e.oneofs.push(t);for(const r of e.nestedMessages)V(r,t,n)}function $(e,t,n,r){var i,a,o,s,l;const u=function(e,t){const n=(r=e,(r.substring(0,1)+r.substring(1).replace(/[A-Z]/g,(e=>"_"+e))).toLowerCase()+"_");var r;for(const e of t){if(!e.name.toLowerCase().startsWith(n))return;const t=e.name.substring(n.length);if(0==t.length)return;if(/^\d/.test(t))return}return n}(e.name,e.value),d={kind:"enum",proto:e,deprecated:null!==(a=null===(i=e.options)||void 0===i?void 0:i.deprecated)&&void 0!==a&&a,file:t,parent:n,open:!0,name:e.name,typeName:G(e,n,t),value:{},values:[],sharedPrefix:u,toString(){return`enum ${this.typeName}`}};d.open=function(e){var t;return P==J("enumType",{proto:e.proto,parent:null!==(t=e.parent)&&void 0!==t?t:e.file})}(d),r.add(d);for(const t of e.value){const e=t.name;d.values.push(d.value[t.number]={kind:"enum_value",proto:t,deprecated:null!==(s=null===(o=t.options)||void 0===o?void 0:o.deprecated)&&void 0!==s&&s,parent:d,name:e,localName:c(null==u?e:e.substring(u.length)),number:t.number,toString:()=>`enum value ${d.typeName}.${e}`})}(null!==(l=null==n?void 0:n.nestedEnums)&&void 0!==l?l:t.enums).push(d)}function B(e,t,n,r,i){var a,o,s,l;const u={kind:"message",proto:e,deprecated:null!==(o=null===(a=e.options)||void 0===a?void 0:a.deprecated)&&void 0!==o&&o,file:t,parent:n,name:e.name,typeName:G(e,n,t),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};!0===(null===(s=e.options)||void 0===s?void 0:s.mapEntry)?i.add(u):((null!==(l=null==n?void 0:n.nestedMessages)&&void 0!==l?l:t.messages).push(u),r.add(u));for(const n of e.enumType)$(n,t,u,r);for(const n of e.nestedType)B(n,t,u,r,i)}function z(e,t,n){var r,i;const a={kind:"service",proto:e,deprecated:null!==(i=null===(r=e.options)||void 0===r?void 0:r.deprecated)&&void 0!==i&&i,file:t,name:e.name,typeName:G(e,void 0,t),methods:[],method:{},toString(){return`service ${this.typeName}`}};t.services.push(a),n.add(a);for(const t of e.method){const e=U(t,a,n);a.methods.push(e),a.method[e.localName]=e}}function U(e,t,n){var r,i,a,o;let s;s=e.clientStreaming&&e.serverStreaming?"bidi_streaming":e.clientStreaming?"client_streaming":e.serverStreaming?"server_streaming":"unary";const l=n.getMessage(K(e.inputType)),u=n.getMessage(K(e.outputType));Z(l,`invalid MethodDescriptorProto: input_type ${e.inputType} not found`),Z(u,`invalid MethodDescriptorProto: output_type ${e.inputType} not found`);const d=e.name;return{kind:"rpc",proto:e,deprecated:null!==(i=null===(r=e.options)||void 0===r?void 0:r.deprecated)&&void 0!==i&&i,parent:t,name:d,localName:c(d.length?c(d[0].toLowerCase()+d.substring(1)):d),methodKind:s,input:l,output:u,idempotency:null!==(o=null===(a=e.options)||void 0===a?void 0:a.idempotencyLevel)&&void 0!==o?o:I,toString:()=>`rpc ${t.typeName}.${d}`}}function q(e,t,n,r,i){var a,o,s;const u=void 0===i,h={kind:"field",proto:e,deprecated:null!==(o=null===(a=e.options)||void 0===a?void 0:a.deprecated)&&void 0!==o&&o,name:e.name,number:e.number,scalar:void 0,message:void 0,enum:void 0,presence:Y(e,r,u,t),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(u){const r="file"==t.kind?t:t.file,i="file"==t.kind?void 0:t,a=G(e,i,r);h.kind="extension",h.file=r,h.parent=i,h.oneof=void 0,h.typeName=a,h.jsonName=`[${a}]`,h.toString=()=>`extension ${a}`;const o=n.getMessage(K(e.extendee));Z(o,`invalid FieldDescriptorProto: extendee ${e.extendee} not found`),h.extendee=o}else{const n=t;Z("message"==n.kind),h.parent=n,h.oneof=r,h.localName=r?l(e.name):c(l(e.name)),h.jsonName=e.jsonName,h.toString=()=>`field ${n.typeName}.${e.name}`}const p=e.label,g=e.type,v=null===(s=e.options)||void 0===s?void 0:s.jstype;if(p===k){const r=g==E?null==i?void 0:i.get(K(e.typeName)):void 0;if(r){h.fieldKind="map";const{key:e,value:t}=function(e){const t=e.fields.find((e=>1===e.number)),n=e.fields.find((e=>2===e.number));return Z(t&&"scalar"==t.fieldKind&&t.scalar!=f.L.BYTES&&t.scalar!=f.L.FLOAT&&t.scalar!=f.L.DOUBLE&&n&&"list"!=n.fieldKind&&"map"!=n.fieldKind),{key:t,value:n}}(r);return h.mapKey=e.scalar,h.mapKind=t.fieldKind,h.message=t.message,h.delimitedEncoding=!1,h.enum=t.enum,h.scalar=t.scalar,h}switch(h.fieldKind="list",g){case E:case x:h.listKind="message",h.message=n.getMessage(K(e.typeName)),Z(h.message),h.delimitedEncoding=X(e,t);break;case O:h.listKind="enum",h.enum=n.getEnum(K(e.typeName)),Z(h.enum);break;default:h.listKind="scalar",h.scalar=g,h.longAsString=v==C}return h.packed=function(e,t){if(e.label!=k)return!1;switch(e.type){case S:case _:case x:case E:return!1}const n=e.options;if(n&&(0,d.b1)(n,"packed"))return n.packed;return D==J("repeatedFieldEncoding",{proto:e,parent:t})}(e,t),h}switch(g){case E:case x:h.fieldKind="message",h.message=n.getMessage(K(e.typeName)),Z(h.message,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),h.delimitedEncoding=X(e,t),h.getDefaultValue=()=>{};break;case O:{const t=n.getEnum(K(e.typeName));Z(void 0!==t,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),h.fieldKind="enum",h.enum=n.getEnum(K(e.typeName)),h.getDefaultValue=()=>(0,d.b1)(e,"defaultValue")?function(e,t){const n=e.values.find((e=>e.name===t));if(!n)throw new Error(`cannot parse ${e} default value: ${t}`);return n.number}(t,e.defaultValue):void 0;break}default:h.fieldKind="scalar",h.scalar=g,h.longAsString=v==C,h.getDefaultValue=()=>(0,d.b1)(e,"defaultValue")?m(g,e.defaultValue):void 0}return h}function H(e){switch(e.syntax){case"":case"proto2":return b;case"proto3":return w;case"editions":if(e.edition in M)return e.edition;throw new Error(`${e.name}: unsupported edition`);default:throw new Error(`${e.name}: unsupported syntax "${e.syntax}"`)}}function W(e,t){return e.dependency.map((n=>{const r=t.getFile(n);if(!r)throw new Error(`Cannot find ${n}, imported by ${e.name}`);return r}))}function G(e,t,n){let r;return r=t?`${t.typeName}.${e.name}`:n.proto.package.length>0?`${n.proto.package}.${e.name}`:`${e.name}`,r}function K(e){return e.startsWith(".")?e.substring(1):e}function Q(e,t){if(!(0,d.b1)(e,"oneofIndex"))return;if(e.proto3Optional)return;const n=t[e.oneofIndex];return Z(n,`invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`),n}function Y(e,t,n,r){if(e.label==T)return N;if(e.label==k)return A;if(t||e.proto3Optional)return R;if(n)return R;const i=J("fieldPresence",{proto:e,parent:r});return i!=A||e.type!=E&&e.type!=x?i:R}function X(e,t){return e.type==x||L==J("messageEncoding",{proto:e,parent:t})}function J(e,t){var n,r;const i=null===(n=t.proto.options)||void 0===n?void 0:n.features;if(i){const t=i[e];if(0!=t)return t}if("kind"in t){if("message"==t.kind)return J(e,null!==(r=t.parent)&&void 0!==r?r:t.file);const n=M[t.edition];if(!n)throw new Error(`feature default for edition ${t.edition} not found`);return n[e]}return J(e,t.parent)}function Z(e,t){if(!e)throw new Error(t)}function ee(e){const t=function(e){const t=Object.create({syntax:"",edition:0});return Object.assign(t,Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},e),{messageType:e.messageType.map(te),enumType:e.enumType.map(ie)}))}(e);t.messageType.forEach(h);return v(t,(()=>{})).getFile(t.name)}function te(e){var t,n,r,i,a,o,s,l;const u=Object.create({visibility:0});return Object.assign(u,{$typeName:"google.protobuf.DescriptorProto",name:e.name,field:null!==(n=null===(t=e.field)||void 0===t?void 0:t.map(ne))&&void 0!==n?n:[],extension:[],nestedType:null!==(i=null===(r=e.nestedType)||void 0===r?void 0:r.map(te))&&void 0!==i?i:[],enumType:null!==(o=null===(a=e.enumType)||void 0===a?void 0:a.map(ie))&&void 0!==o?o:[],extensionRange:null!==(l=null===(s=e.extensionRange)||void 0===s?void 0:s.map((e=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},e))))&&void 0!==l?l:[],oneofDecl:[],reservedRange:[],reservedName:[]})}function ne(e){const t=Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1});return Object.assign(t,Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},e),{options:e.options?re(e.options):void 0}))}function re(e){var t,n,r;const i=Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0});return Object.assign(i,Object.assign(Object.assign({$typeName:"google.protobuf.FieldOptions"},e),{targets:null!==(t=e.targets)&&void 0!==t?t:[],editionDefaults:null!==(r=null===(n=e.editionDefaults)||void 0===n?void 0:n.map((e=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},e))))&&void 0!==r?r:[],uninterpretedOption:[]}))}function ie(e){const t=Object.create({visibility:0});return Object.assign(t,{$typeName:"google.protobuf.EnumDescriptorProto",name:e.name,reservedName:[],reservedRange:[],value:e.value.map((e=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},e)))})}function ae(e,t,...n){return n.reduce(((e,t)=>e.nestedMessages[t]),e.messages[t])}const oe=ee({name:"google/protobuf/descriptor.proto",package:"google.protobuf",messageType:[{name:"FileDescriptorSet",field:[{name:"file",number:1,type:11,label:3,typeName:".google.protobuf.FileDescriptorProto"}],extensionRange:[{start:536e6,end:536000001}]},{name:"FileDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"package",number:2,type:9,label:1},{name:"dependency",number:3,type:9,label:3},{name:"public_dependency",number:10,type:5,label:3},{name:"weak_dependency",number:11,type:5,label:3},{name:"option_dependency",number:15,type:9,label:3},{name:"message_type",number:4,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:5,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"service",number:6,type:11,label:3,typeName:".google.protobuf.ServiceDescriptorProto"},{name:"extension",number:7,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FileOptions"},{name:"source_code_info",number:9,type:11,label:1,typeName:".google.protobuf.SourceCodeInfo"},{name:"syntax",number:12,type:9,label:1},{name:"edition",number:14,type:14,label:1,typeName:".google.protobuf.Edition"}]},{name:"DescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"field",number:2,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"extension",number:6,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"nested_type",number:3,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"extension_range",number:5,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ExtensionRange"},{name:"oneof_decl",number:8,type:11,label:3,typeName:".google.protobuf.OneofDescriptorProto"},{name:"options",number:7,type:11,label:1,typeName:".google.protobuf.MessageOptions"},{name:"reserved_range",number:9,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ReservedRange"},{name:"reserved_name",number:10,type:9,label:3},{name:"visibility",number:11,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"ExtensionRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ExtensionRangeOptions"}]},{name:"ReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"ExtensionRangeOptions",field:[{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"},{name:"declaration",number:2,type:11,label:3,typeName:".google.protobuf.ExtensionRangeOptions.Declaration",options:{retention:2}},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"verification",number:3,type:14,label:1,typeName:".google.protobuf.ExtensionRangeOptions.VerificationState",defaultValue:"UNVERIFIED",options:{retention:2}}],nestedType:[{name:"Declaration",field:[{name:"number",number:1,type:5,label:1},{name:"full_name",number:2,type:9,label:1},{name:"type",number:3,type:9,label:1},{name:"reserved",number:5,type:8,label:1},{name:"repeated",number:6,type:8,label:1}]}],enumType:[{name:"VerificationState",value:[{name:"DECLARATION",number:0},{name:"UNVERIFIED",number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:3,type:5,label:1},{name:"label",number:4,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Label"},{name:"type",number:5,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Type"},{name:"type_name",number:6,type:9,label:1},{name:"extendee",number:2,type:9,label:1},{name:"default_value",number:7,type:9,label:1},{name:"oneof_index",number:9,type:5,label:1},{name:"json_name",number:10,type:9,label:1},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FieldOptions"},{name:"proto3_optional",number:17,type:8,label:1}],enumType:[{name:"Type",value:[{name:"TYPE_DOUBLE",number:1},{name:"TYPE_FLOAT",number:2},{name:"TYPE_INT64",number:3},{name:"TYPE_UINT64",number:4},{name:"TYPE_INT32",number:5},{name:"TYPE_FIXED64",number:6},{name:"TYPE_FIXED32",number:7},{name:"TYPE_BOOL",number:8},{name:"TYPE_STRING",number:9},{name:"TYPE_GROUP",number:10},{name:"TYPE_MESSAGE",number:11},{name:"TYPE_BYTES",number:12},{name:"TYPE_UINT32",number:13},{name:"TYPE_ENUM",number:14},{name:"TYPE_SFIXED32",number:15},{name:"TYPE_SFIXED64",number:16},{name:"TYPE_SINT32",number:17},{name:"TYPE_SINT64",number:18}]},{name:"Label",value:[{name:"LABEL_OPTIONAL",number:1},{name:"LABEL_REPEATED",number:3},{name:"LABEL_REQUIRED",number:2}]}]},{name:"OneofDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"options",number:2,type:11,label:1,typeName:".google.protobuf.OneofOptions"}]},{name:"EnumDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"value",number:2,type:11,label:3,typeName:".google.protobuf.EnumValueDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumOptions"},{name:"reserved_range",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto.EnumReservedRange"},{name:"reserved_name",number:5,type:9,label:3},{name:"visibility",number:6,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"EnumReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"EnumValueDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumValueOptions"}]},{name:"ServiceDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"method",number:2,type:11,label:3,typeName:".google.protobuf.MethodDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ServiceOptions"}]},{name:"MethodDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"input_type",number:2,type:9,label:1},{name:"output_type",number:3,type:9,label:1},{name:"options",number:4,type:11,label:1,typeName:".google.protobuf.MethodOptions"},{name:"client_streaming",number:5,type:8,label:1,defaultValue:"false"},{name:"server_streaming",number:6,type:8,label:1,defaultValue:"false"}]},{name:"FileOptions",field:[{name:"java_package",number:1,type:9,label:1},{name:"java_outer_classname",number:8,type:9,label:1},{name:"java_multiple_files",number:10,type:8,label:1,defaultValue:"false"},{name:"java_generate_equals_and_hash",number:20,type:8,label:1,options:{deprecated:!0}},{name:"java_string_check_utf8",number:27,type:8,label:1,defaultValue:"false"},{name:"optimize_for",number:9,type:14,label:1,typeName:".google.protobuf.FileOptions.OptimizeMode",defaultValue:"SPEED"},{name:"go_package",number:11,type:9,label:1},{name:"cc_generic_services",number:16,type:8,label:1,defaultValue:"false"},{name:"java_generic_services",number:17,type:8,label:1,defaultValue:"false"},{name:"py_generic_services",number:18,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:23,type:8,label:1,defaultValue:"false"},{name:"cc_enable_arenas",number:31,type:8,label:1,defaultValue:"true"},{name:"objc_class_prefix",number:36,type:9,label:1},{name:"csharp_namespace",number:37,type:9,label:1},{name:"swift_prefix",number:39,type:9,label:1},{name:"php_class_prefix",number:40,type:9,label:1},{name:"php_namespace",number:41,type:9,label:1},{name:"php_metadata_namespace",number:44,type:9,label:1},{name:"ruby_package",number:45,type:9,label:1},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"OptimizeMode",value:[{name:"SPEED",number:1},{name:"CODE_SIZE",number:2},{name:"LITE_RUNTIME",number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"MessageOptions",field:[{name:"message_set_wire_format",number:1,type:8,label:1,defaultValue:"false"},{name:"no_standard_descriptor_accessor",number:2,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"map_entry",number:7,type:8,label:1},{name:"deprecated_legacy_json_field_conflicts",number:11,type:8,label:1,options:{deprecated:!0}},{name:"features",number:12,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldOptions",field:[{name:"ctype",number:1,type:14,label:1,typeName:".google.protobuf.FieldOptions.CType",defaultValue:"STRING"},{name:"packed",number:2,type:8,label:1},{name:"jstype",number:6,type:14,label:1,typeName:".google.protobuf.FieldOptions.JSType",defaultValue:"JS_NORMAL"},{name:"lazy",number:5,type:8,label:1,defaultValue:"false"},{name:"unverified_lazy",number:15,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"weak",number:10,type:8,label:1,defaultValue:"false",options:{deprecated:!0}},{name:"debug_redact",number:16,type:8,label:1,defaultValue:"false"},{name:"retention",number:17,type:14,label:1,typeName:".google.protobuf.FieldOptions.OptionRetention"},{name:"targets",number:19,type:14,label:3,typeName:".google.protobuf.FieldOptions.OptionTargetType"},{name:"edition_defaults",number:20,type:11,label:3,typeName:".google.protobuf.FieldOptions.EditionDefault"},{name:"features",number:21,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"feature_support",number:22,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],nestedType:[{name:"EditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"value",number:2,type:9,label:1}]},{name:"FeatureSupport",field:[{name:"edition_introduced",number:1,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"edition_deprecated",number:2,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"deprecation_warning",number:3,type:9,label:1},{name:"edition_removed",number:4,type:14,label:1,typeName:".google.protobuf.Edition"}]}],enumType:[{name:"CType",value:[{name:"STRING",number:0},{name:"CORD",number:1},{name:"STRING_PIECE",number:2}]},{name:"JSType",value:[{name:"JS_NORMAL",number:0},{name:"JS_STRING",number:1},{name:"JS_NUMBER",number:2}]},{name:"OptionRetention",value:[{name:"RETENTION_UNKNOWN",number:0},{name:"RETENTION_RUNTIME",number:1},{name:"RETENTION_SOURCE",number:2}]},{name:"OptionTargetType",value:[{name:"TARGET_TYPE_UNKNOWN",number:0},{name:"TARGET_TYPE_FILE",number:1},{name:"TARGET_TYPE_EXTENSION_RANGE",number:2},{name:"TARGET_TYPE_MESSAGE",number:3},{name:"TARGET_TYPE_FIELD",number:4},{name:"TARGET_TYPE_ONEOF",number:5},{name:"TARGET_TYPE_ENUM",number:6},{name:"TARGET_TYPE_ENUM_ENTRY",number:7},{name:"TARGET_TYPE_SERVICE",number:8},{name:"TARGET_TYPE_METHOD",number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"OneofOptions",field:[{name:"features",number:1,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumOptions",field:[{name:"allow_alias",number:2,type:8,label:1},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"deprecated_legacy_json_field_conflicts",number:6,type:8,label:1,options:{deprecated:!0}},{name:"features",number:7,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumValueOptions",field:[{name:"deprecated",number:1,type:8,label:1,defaultValue:"false"},{name:"features",number:2,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"debug_redact",number:3,type:8,label:1,defaultValue:"false"},{name:"feature_support",number:4,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"ServiceOptions",field:[{name:"features",number:34,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"MethodOptions",field:[{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"idempotency_level",number:34,type:14,label:1,typeName:".google.protobuf.MethodOptions.IdempotencyLevel",defaultValue:"IDEMPOTENCY_UNKNOWN"},{name:"features",number:35,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"IdempotencyLevel",value:[{name:"IDEMPOTENCY_UNKNOWN",number:0},{name:"NO_SIDE_EFFECTS",number:1},{name:"IDEMPOTENT",number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"UninterpretedOption",field:[{name:"name",number:2,type:11,label:3,typeName:".google.protobuf.UninterpretedOption.NamePart"},{name:"identifier_value",number:3,type:9,label:1},{name:"positive_int_value",number:4,type:4,label:1},{name:"negative_int_value",number:5,type:3,label:1},{name:"double_value",number:6,type:1,label:1},{name:"string_value",number:7,type:12,label:1},{name:"aggregate_value",number:8,type:9,label:1}],nestedType:[{name:"NamePart",field:[{name:"name_part",number:1,type:9,label:2},{name:"is_extension",number:2,type:8,label:2}]}]},{name:"FeatureSet",field:[{name:"field_presence",number:1,type:14,label:1,typeName:".google.protobuf.FeatureSet.FieldPresence",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPLICIT",edition:900},{value:"IMPLICIT",edition:999},{value:"EXPLICIT",edition:1e3}]}},{name:"enum_type",number:2,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnumType",options:{retention:1,targets:[6,1],editionDefaults:[{value:"CLOSED",edition:900},{value:"OPEN",edition:999}]}},{name:"repeated_field_encoding",number:3,type:14,label:1,typeName:".google.protobuf.FeatureSet.RepeatedFieldEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPANDED",edition:900},{value:"PACKED",edition:999}]}},{name:"utf8_validation",number:4,type:14,label:1,typeName:".google.protobuf.FeatureSet.Utf8Validation",options:{retention:1,targets:[4,1],editionDefaults:[{value:"NONE",edition:900},{value:"VERIFY",edition:999}]}},{name:"message_encoding",number:5,type:14,label:1,typeName:".google.protobuf.FeatureSet.MessageEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"LENGTH_PREFIXED",edition:900}]}},{name:"json_format",number:6,type:14,label:1,typeName:".google.protobuf.FeatureSet.JsonFormat",options:{retention:1,targets:[3,6,1],editionDefaults:[{value:"LEGACY_BEST_EFFORT",edition:900},{value:"ALLOW",edition:999}]}},{name:"enforce_naming_style",number:7,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnforceNamingStyle",options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:"STYLE_LEGACY",edition:900},{value:"STYLE2024",edition:1001}]}},{name:"default_symbol_visibility",number:8,type:14,label:1,typeName:".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility",options:{retention:2,targets:[1],editionDefaults:[{value:"EXPORT_ALL",edition:900},{value:"EXPORT_TOP_LEVEL",edition:1001}]}}],nestedType:[{name:"VisibilityFeature",enumType:[{name:"DefaultSymbolVisibility",value:[{name:"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",number:0},{name:"EXPORT_ALL",number:1},{name:"EXPORT_TOP_LEVEL",number:2},{name:"LOCAL_ALL",number:3},{name:"STRICT",number:4}]}]}],enumType:[{name:"FieldPresence",value:[{name:"FIELD_PRESENCE_UNKNOWN",number:0},{name:"EXPLICIT",number:1},{name:"IMPLICIT",number:2},{name:"LEGACY_REQUIRED",number:3}]},{name:"EnumType",value:[{name:"ENUM_TYPE_UNKNOWN",number:0},{name:"OPEN",number:1},{name:"CLOSED",number:2}]},{name:"RepeatedFieldEncoding",value:[{name:"REPEATED_FIELD_ENCODING_UNKNOWN",number:0},{name:"PACKED",number:1},{name:"EXPANDED",number:2}]},{name:"Utf8Validation",value:[{name:"UTF8_VALIDATION_UNKNOWN",number:0},{name:"VERIFY",number:2},{name:"NONE",number:3}]},{name:"MessageEncoding",value:[{name:"MESSAGE_ENCODING_UNKNOWN",number:0},{name:"LENGTH_PREFIXED",number:1},{name:"DELIMITED",number:2}]},{name:"JsonFormat",value:[{name:"JSON_FORMAT_UNKNOWN",number:0},{name:"ALLOW",number:1},{name:"LEGACY_BEST_EFFORT",number:2}]},{name:"EnforceNamingStyle",value:[{name:"ENFORCE_NAMING_STYLE_UNKNOWN",number:0},{name:"STYLE2024",number:1},{name:"STYLE_LEGACY",number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:"FeatureSetDefaults",field:[{name:"defaults",number:1,type:11,label:3,typeName:".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"},{name:"minimum_edition",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"maximum_edition",number:5,type:14,label:1,typeName:".google.protobuf.Edition"}],nestedType:[{name:"FeatureSetEditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"overridable_features",number:4,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"fixed_features",number:5,type:11,label:1,typeName:".google.protobuf.FeatureSet"}]}]},{name:"SourceCodeInfo",field:[{name:"location",number:1,type:11,label:3,typeName:".google.protobuf.SourceCodeInfo.Location"}],nestedType:[{name:"Location",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"span",number:2,type:5,label:3,options:{packed:!0}},{name:"leading_comments",number:3,type:9,label:1},{name:"trailing_comments",number:4,type:9,label:1},{name:"leading_detached_comments",number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:"GeneratedCodeInfo",field:[{name:"annotation",number:1,type:11,label:3,typeName:".google.protobuf.GeneratedCodeInfo.Annotation"}],nestedType:[{name:"Annotation",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"source_file",number:2,type:9,label:1},{name:"begin",number:3,type:5,label:1},{name:"end",number:4,type:5,label:1},{name:"semantic",number:5,type:14,label:1,typeName:".google.protobuf.GeneratedCodeInfo.Annotation.Semantic"}],enumType:[{name:"Semantic",value:[{name:"NONE",number:0},{name:"SET",number:1},{name:"ALIAS",number:2}]}]}]}],enumType:[{name:"Edition",value:[{name:"EDITION_UNKNOWN",number:0},{name:"EDITION_LEGACY",number:900},{name:"EDITION_PROTO2",number:998},{name:"EDITION_PROTO3",number:999},{name:"EDITION_2023",number:1e3},{name:"EDITION_2024",number:1001},{name:"EDITION_1_TEST_ONLY",number:1},{name:"EDITION_2_TEST_ONLY",number:2},{name:"EDITION_99997_TEST_ONLY",number:99997},{name:"EDITION_99998_TEST_ONLY",number:99998},{name:"EDITION_99999_TEST_ONLY",number:99999},{name:"EDITION_MAX",number:2147483647}]},{name:"SymbolVisibility",value:[{name:"VISIBILITY_UNSET",number:0},{name:"VISIBILITY_LOCAL",number:1},{name:"VISIBILITY_EXPORT",number:2}]}]}),se=ae(oe,1);var le;!function(e){e[e.DECLARATION=0]="DECLARATION",e[e.UNVERIFIED=1]="UNVERIFIED"}(le||(le={}));var ue;!function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.GROUP=10]="GROUP",e[e.MESSAGE=11]="MESSAGE",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.ENUM=14]="ENUM",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"}(ue||(ue={}));var ce;!function(e){e[e.OPTIONAL=1]="OPTIONAL",e[e.REPEATED=3]="REPEATED",e[e.REQUIRED=2]="REQUIRED"}(ce||(ce={}));var de;!function(e){e[e.SPEED=1]="SPEED",e[e.CODE_SIZE=2]="CODE_SIZE",e[e.LITE_RUNTIME=3]="LITE_RUNTIME"}(de||(de={}));var he;!function(e){e[e.STRING=0]="STRING",e[e.CORD=1]="CORD",e[e.STRING_PIECE=2]="STRING_PIECE"}(he||(he={}));var fe;!function(e){e[e.JS_NORMAL=0]="JS_NORMAL",e[e.JS_STRING=1]="JS_STRING",e[e.JS_NUMBER=2]="JS_NUMBER"}(fe||(fe={}));var pe;!function(e){e[e.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",e[e.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",e[e.RETENTION_SOURCE=2]="RETENTION_SOURCE"}(pe||(pe={}));var me;!function(e){e[e.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",e[e.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",e[e.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",e[e.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",e[e.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",e[e.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",e[e.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",e[e.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",e[e.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",e[e.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"}(me||(me={}));var ge;!function(e){e[e.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",e[e.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",e[e.IDEMPOTENT=2]="IDEMPOTENT"}(ge||(ge={}));var ve;!function(e){e[e.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0]="DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",e[e.EXPORT_ALL=1]="EXPORT_ALL",e[e.EXPORT_TOP_LEVEL=2]="EXPORT_TOP_LEVEL",e[e.LOCAL_ALL=3]="LOCAL_ALL",e[e.STRICT=4]="STRICT"}(ve||(ve={}));var ye;!function(e){e[e.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",e[e.EXPLICIT=1]="EXPLICIT",e[e.IMPLICIT=2]="IMPLICIT",e[e.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"}(ye||(ye={}));var be;!function(e){e[e.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",e[e.OPEN=1]="OPEN",e[e.CLOSED=2]="CLOSED"}(be||(be={}));var we;!function(e){e[e.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",e[e.PACKED=1]="PACKED",e[e.EXPANDED=2]="EXPANDED"}(we||(we={}));var Se;!function(e){e[e.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",e[e.VERIFY=2]="VERIFY",e[e.NONE=3]="NONE"}(Se||(Se={}));var xe;!function(e){e[e.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",e[e.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",e[e.DELIMITED=2]="DELIMITED"}(xe||(xe={}));var Ee;!function(e){e[e.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",e[e.ALLOW=1]="ALLOW",e[e.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"}(Ee||(Ee={}));var _e;!function(e){e[e.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",e[e.STYLE2024=1]="STYLE2024",e[e.STYLE_LEGACY=2]="STYLE_LEGACY"}(_e||(_e={}));var Oe;!function(e){e[e.NONE=0]="NONE",e[e.SET=1]="SET",e[e.ALIAS=2]="ALIAS"}(Oe||(Oe={}));var ke;!function(e){e[e.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",e[e.EDITION_LEGACY=900]="EDITION_LEGACY",e[e.EDITION_PROTO2=998]="EDITION_PROTO2",e[e.EDITION_PROTO3=999]="EDITION_PROTO3",e[e.EDITION_2023=1e3]="EDITION_2023",e[e.EDITION_2024=1001]="EDITION_2024",e[e.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",e[e.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",e[e.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",e[e.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",e[e.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",e[e.EDITION_MAX=2147483647]="EDITION_MAX"}(ke||(ke={}));var Te;!function(e){e[e.VISIBILITY_UNSET=0]="VISIBILITY_UNSET",e[e.VISIBILITY_LOCAL=1]="VISIBILITY_LOCAL",e[e.VISIBILITY_EXPORT=2]="VISIBILITY_EXPORT"}(Te||(Te={}));var Ce=n(8190),Ie=n(4230);class Re extends Error{constructor(e,t,n="FieldValueInvalidError"){super(t),this.name=n,this.field=()=>e}}var Ae=n(6417),Ne=n(6834);const De=Symbol.for("@bufbuild/protobuf/text-encoding");function Le(){if(null==globalThis[De]){const e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[De]={encodeUtf8:t=>e.encode(t),decodeUtf8:e=>t.decode(e),checkUtf8(e){try{return encodeURIComponent(e),!0}catch(e){return!1}}}}return globalThis[De]}var Pe;!function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"}(Pe||(Pe={}));const Me=34028234663852886e22,je=-34028234663852886e22,Fe=4294967295,Ve=2147483647,$e=-2147483648;class Be{constructor(e,t=Le().decodeUtf8){this.decodeUtf8=t,this.varint64=Ne.ls,this.uint32=Ne.Gn,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),t=e>>>3,n=7&e;if(t<=0||n<0||n>5)throw new Error("illegal tag: field no "+t+" wire type "+n);return[t,n]}skip(e,t){let n=this.pos;switch(e){case Pe.Varint:for(;128&this.buf[this.pos++];);break;case Pe.Bit64:this.pos+=4;case Pe.Bit32:this.pos+=4;break;case Pe.LengthDelimited:let n=this.uint32();this.pos+=n;break;case Pe.StartGroup:for(;;){const[e,n]=this.tag();if(n===Pe.EndGroup){if(void 0!==t&&e!==t)throw new Error("invalid end group tag");break}this.skip(n,e)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return 0|this.uint32()}sint32(){let e=this.uint32();return e>>>1^-(1&e)}int64(){return p.M.dec(...this.varint64())}uint64(){return p.M.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),n=-(1&e);return e=(e>>>1|(1&t)<<31)^n,t=t>>>1^n,p.M.dec(e,t)}bool(){let[e,t]=this.varint64();return 0!==e||0!==t}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return p.M.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return p.M.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.decodeUtf8(this.bytes())}}function ze(e,t,n){const r=Ue(e,n);if(!0!==r)return new Re(e,`list item #${t+1}: ${He(e,n,r)}`)}function Ue(e,t){return void 0!==e.scalar?qe(t,e.scalar):void 0!==e.enum?e.enum.open?Number.isInteger(t):e.enum.values.some((e=>e.number===t)):(0,Ae.LT)(t,e.message)}function qe(e,t){switch(t){case f.L.DOUBLE:return"number"==typeof e;case f.L.FLOAT:return"number"==typeof e&&(!(!Number.isNaN(e)&&Number.isFinite(e))||(!(e>Me||e<je)||`${e.toFixed()} out of range`));case f.L.INT32:case f.L.SFIXED32:case f.L.SINT32:return!("number"!=typeof e||!Number.isInteger(e))&&(!(e>Ve||e<$e)||`${e.toFixed()} out of range`);case f.L.FIXED32:case f.L.UINT32:return!("number"!=typeof e||!Number.isInteger(e))&&(!(e>Fe||e<0)||`${e.toFixed()} out of range`);case f.L.BOOL:return"boolean"==typeof e;case f.L.STRING:return"string"==typeof e&&(Le().checkUtf8(e)||"invalid UTF8");case f.L.BYTES:return e instanceof Uint8Array;case f.L.INT64:case f.L.SFIXED64:case f.L.SINT64:if("bigint"==typeof e||"number"==typeof e||"string"==typeof e&&e.length>0)try{return p.M.parse(e),!0}catch(t){return`${e} out of range`}return!1;case f.L.FIXED64:case f.L.UINT64:if("bigint"==typeof e||"number"==typeof e||"string"==typeof e&&e.length>0)try{return p.M.uParse(e),!0}catch(t){return`${e} out of range`}return!1}}function He(e,t,n){return n="string"==typeof n?`: ${n}`:`, got ${We(t)}`,void 0!==e.scalar?`expected ${function(e){switch(e){case f.L.STRING:return"string";case f.L.BOOL:return"boolean";case f.L.INT64:case f.L.SINT64:case f.L.SFIXED64:return"bigint (int64)";case f.L.UINT64:case f.L.FIXED64:return"bigint (uint64)";case f.L.BYTES:return"Uint8Array";case f.L.DOUBLE:return"number (float64)";case f.L.FLOAT:return"number (float32)";case f.L.FIXED32:case f.L.UINT32:return"number (uint32)";case f.L.INT32:case f.L.SFIXED32:case f.L.SINT32:return"number (int32)"}}(e.scalar)}`+n:void 0!==e.enum?`expected ${e.enum.toString()}`+n:`expected ${Ge(e.message)}`+n}function We(e){switch(typeof e){case"object":return null===e?"null":e instanceof Uint8Array?`Uint8Array(${e.length})`:Array.isArray(e)?`Array(${e.length})`:(0,Ae.sG)(e)?Ke(e.field()):(0,Ae.G6)(e)?Qe(e.field()):(0,Ae.LT)(e)?Ge(e.desc):(0,Ie.K)(e)?`message ${e.$typeName}`:"object";case"string":return e.length>30?"string":`"${e.split('"').join('\\"')}"`;case"boolean":case"number":return String(e);case"bigint":return String(e)+"n";default:return typeof e}}function Ge(e){return`ReflectMessage (${e.typeName})`}function Ke(e){switch(e.listKind){case"message":return`ReflectList (${e.message.toString()})`;case"enum":return`ReflectList (${e.enum.toString()})`;case"scalar":return`ReflectList (${f.L[e.scalar]})`}}function Qe(e){switch(e.mapKind){case"message":return`ReflectMap (${f.L[e.mapKey]}, ${e.message.toString()})`;case"enum":return`ReflectMap (${f.L[e.mapKey]}, ${e.enum.toString()})`;case"scalar":return`ReflectMap (${f.L[e.mapKey]}, ${f.L[e.scalar]})`}}var Ye=n(3632),Xe=n(987);function Je(e,t,n=!0){return new et(e,t,n)}const Ze=new WeakMap;class et{get sortedFields(){const e=Ze.get(this.desc);if(e)return e;const t=this.desc.fields.concat().sort(((e,t)=>e.number-t.number));return Ze.set(this.desc,t),t}constructor(e,t,n=!0){this.lists=new Map,this.maps=new Map,this.check=n,this.desc=e,this.message=this[d.I4]=null!=t?t:(0,Ye.v)(e),this.fields=e.fields,this.oneofs=e.oneofs,this.members=e.members}findNumber(e){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map((e=>[e.number,e])))),this._fieldsByNumber.get(e)}oneofCase(e){return tt(this.message,e),(0,d.mO)(this.message,e)}isSet(e){return tt(this.message,e),(0,d.zB)(this.message,e)}clear(e){tt(this.message,e),(0,d.yO)(this.message,e)}get(e){tt(this.message,e);const t=(0,d.$v)(this.message,e);switch(e.fieldKind){case"list":let n=this.lists.get(e);return n&&n[d.I4]===t||this.lists.set(e,n=new nt(e,t,this.check)),n;case"map":let r=this.maps.get(e);return r&&r[d.I4]===t||this.maps.set(e,r=new rt(e,t,this.check)),r;case"message":return at(e,t,this.check);case"scalar":return void 0===t?(0,Ce.M7)(e.scalar,!1):dt(e,t);case"enum":return null!=t?t:e.enum.values[0].number}}set(e,t){if(tt(this.message,e),this.check){const n=function(e,t){const n="list"==e.fieldKind?(0,Ae.sG)(t,e):"map"==e.fieldKind?(0,Ae.G6)(t,e):Ue(e,t);if(!0===n)return;let r;switch(e.fieldKind){case"list":r=`expected ${Ke(e)}, got ${We(t)}`;break;case"map":r=`expected ${Qe(e)}, got ${We(t)}`;break;default:r=He(e,t,n)}return new Re(e,r)}(e,t);if(n)throw n}let n;n="message"==e.fieldKind?it(e,t):(0,Ae.G6)(t)||(0,Ae.sG)(t)?t[d.I4]:ht(e,t),(0,d.lA)(this.message,e,n)}getUnknown(){return this.message.$unknown}setUnknown(e){this.message.$unknown=e}}function tt(e,t){if(t.parent.typeName!==e.$typeName)throw new Re(t,`cannot use ${t.toString()} with message ${e.$typeName}`,"ForeignFieldError")}class nt{field(){return this._field}get size(){return this._arr.length}constructor(e,t,n){this._field=e,this._arr=this[d.I4]=t,this.check=n}get(e){const t=this._arr[e];return void 0===t?void 0:st(this._field,t,this.check)}set(e,t){if(e<0||e>=this._arr.length)throw new Re(this._field,`list item #${e+1}: out of range`);if(this.check){const n=ze(this._field,e,t);if(n)throw n}this._arr[e]=ot(this._field,t)}add(e){if(this.check){const t=ze(this._field,this._arr.length,e);if(t)throw t}this._arr.push(ot(this._field,e))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const e of this._arr)yield st(this._field,e,this.check)}*entries(){for(let e=0;e<this._arr.length;e++)yield[e,st(this._field,this._arr[e],this.check)]}}class rt{constructor(e,t,n=!0){this.obj=this[d.I4]=null!=t?t:{},this.check=n,this._field=e}field(){return this._field}set(e,t){if(this.check){const n=function(e,t,n){const r=qe(t,e.mapKey);if(!0!==r)return new Re(e,`invalid map key: ${He({scalar:e.mapKey},t,r)}`);const i=Ue(e,n);return!0!==i?new Re(e,`map entry ${We(t)}: ${He(e,n,i)}`):void 0}(this._field,e,t);if(n)throw n}return this.obj[ut(e)]=function(e,t){if("message"==e.mapKind)return it(e,t);return ht(e,t)}(this._field,t),this}delete(e){const t=ut(e),n=Object.prototype.hasOwnProperty.call(this.obj,t);return n&&delete this.obj[t],n}clear(){for(const e of Object.keys(this.obj))delete this.obj[e]}get(e){let t=this.obj[ut(e)];return void 0!==t&&(t=lt(this._field,t,this.check)),t}has(e){return Object.prototype.hasOwnProperty.call(this.obj,ut(e))}*keys(){for(const e of Object.keys(this.obj))yield ct(e,this._field.mapKey)}*entries(){for(const e of Object.entries(this.obj))yield[ct(e[0],this._field.mapKey),lt(this._field,e[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(const e of Object.values(this.obj))yield lt(this._field,e,this.check)}forEach(e,t){for(const n of this.entries())e.call(t,n[1],n[0],this)}}function it(e,t){return(0,Ae.LT)(t)?(0,Xe.Y)(t.message)&&!e.oneof&&"message"==e.fieldKind?t.message.value:"google.protobuf.Struct"==t.desc.typeName&&"google.protobuf.Value"!=e.parent.typeName?pt(t.message):t.message:t}function at(e,t,n){return void 0!==t&&((0,Xe.l)(e.message)&&!e.oneof&&"message"==e.fieldKind?t={$typeName:e.message.typeName,value:dt(e.message.fields[0],t)}:"google.protobuf.Struct"==e.message.typeName&&"google.protobuf.Value"!=e.parent.typeName&&(0,Ae.Gv)(t)&&(t=ft(t))),new et(e.message,t,n)}function ot(e,t){return"message"==e.listKind?it(e,t):ht(e,t)}function st(e,t,n){return"message"==e.listKind?at(e,t,n):dt(e,t)}function lt(e,t,n){return"message"==e.mapKind?at(e,t,n):t}function ut(e){return"string"==typeof e||"number"==typeof e?e:String(e)}function ct(e,t){switch(t){case f.L.STRING:return e;case f.L.INT32:case f.L.FIXED32:case f.L.UINT32:case f.L.SFIXED32:case f.L.SINT32:{const t=Number.parseInt(e);if(Number.isFinite(t))return t;break}case f.L.BOOL:switch(e){case"true":return!0;case"false":return!1}break;case f.L.UINT64:case f.L.FIXED64:try{return p.M.uParse(e)}catch(e){}break;default:try{return p.M.parse(e)}catch(e){}}return e}function dt(e,t){switch(e.scalar){case f.L.INT64:case f.L.SFIXED64:case f.L.SINT64:"longAsString"in e&&e.longAsString&&"string"==typeof t&&(t=p.M.parse(t));break;case f.L.FIXED64:case f.L.UINT64:"longAsString"in e&&e.longAsString&&"string"==typeof t&&(t=p.M.uParse(t))}return t}function ht(e,t){switch(e.scalar){case f.L.INT64:case f.L.SFIXED64:case f.L.SINT64:"longAsString"in e&&e.longAsString?t=String(t):"string"!=typeof t&&"number"!=typeof t||(t=p.M.parse(t));break;case f.L.FIXED64:case f.L.UINT64:"longAsString"in e&&e.longAsString?t=String(t):"string"!=typeof t&&"number"!=typeof t||(t=p.M.uParse(t))}return t}function ft(e){const t={$typeName:"google.protobuf.Struct",fields:{}};if((0,Ae.Gv)(e))for(const[n,r]of Object.entries(e))t.fields[n]=gt(r);return t}function pt(e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=mt(r);return t}function mt(e){switch(e.kind.case){case"structValue":return pt(e.kind.value);case"listValue":return e.kind.value.values.map(mt);case"nullValue":case void 0:return null;default:return e.kind.value}}function gt(e){const t={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof e){case"number":t.kind={case:"numberValue",value:e};break;case"string":t.kind={case:"stringValue",value:e};break;case"boolean":t.kind={case:"boolValue",value:e};break;case"object":if(null===e){const e=0;t.kind={case:"nullValue",value:e}}else if(Array.isArray(e)){const n={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(e))for(const t of e)n.values.push(gt(t));t.kind={case:"listValue",value:n}}else t.kind={case:"structValue",value:ft(e)}}return t}const vt={readUnknownFields:!0};function yt(e){return e?Object.assign(Object.assign({},vt),e):vt}function bt(e,t,n,r,i){var a;const o=r?t.len:t.pos+i;let s,l;const u=null!==(a=e.getUnknown())&&void 0!==a?a:[];for(;t.pos<o&&([s,l]=t.tag(),!r||l!=Pe.EndGroup);){const r=e.findNumber(s);if(r)wt(e,t,r,l,n);else{const e=t.skip(l,s);n.readUnknownFields&&u.push({no:s,wireType:l,data:e})}}if(r&&(l!=Pe.EndGroup||s!==i))throw new Error("invalid end group tag");u.length>0&&e.setUnknown(u)}function wt(e,t,n,r,i){var a;switch(n.fieldKind){case"scalar":e.set(n,xt(t,n.scalar));break;case"enum":const o=xt(t,f.L.INT32);if(n.enum.open)e.set(n,o);else{if(n.enum.values.some((e=>e.number===o)))e.set(n,o);else if(i.readUnknownFields){const t=[];(0,Ne.f7)(o,t);const i=null!==(a=e.getUnknown())&&void 0!==a?a:[];i.push({no:n.number,wireType:r,data:new Uint8Array(t)}),e.setUnknown(i)}}break;case"message":e.set(n,St(t,i,n,e.get(n)));break;case"list":!function(e,t,n,r){var i;const a=n.field();if("message"===a.listKind)return void n.add(St(e,r,a));const o=null!==(i=a.scalar)&&void 0!==i?i:f.L.INT32,s=t==Pe.LengthDelimited&&o!=f.L.STRING&&o!=f.L.BYTES;if(!s)return void n.add(xt(e,o));const l=e.uint32()+e.pos;for(;e.pos<l;)n.add(xt(e,o))}(t,r,e.get(n),i);break;case"map":!function(e,t,n){const r=t.field();let i,a;const o=e.uint32(),s=e.pos+o;for(;e.pos<s;){const[t]=e.tag();switch(t){case 1:i=xt(e,r.mapKey);break;case 2:switch(r.mapKind){case"scalar":a=xt(e,r.scalar);break;case"enum":a=e.int32();break;case"message":a=St(e,n,r)}}}void 0===i&&(i=(0,Ce.M7)(r.mapKey,!1));if(void 0===a)switch(r.mapKind){case"scalar":a=(0,Ce.M7)(r.scalar,!1);break;case"enum":a=r.enum.values[0].number;break;case"message":a=Je(r.message,void 0,!1)}t.set(i,a)}(t,e.get(n),i)}}function St(e,t,n,r){const i=n.delimitedEncoding,a=null!=r?r:Je(n.message,void 0,!1);return bt(a,e,t,i,i?n.number:e.uint32()),a}function xt(e,t){switch(t){case f.L.STRING:return e.string();case f.L.BOOL:return e.bool();case f.L.DOUBLE:return e.double();case f.L.FLOAT:return e.float();case f.L.INT32:return e.int32();case f.L.INT64:return e.int64();case f.L.UINT64:return e.uint64();case f.L.FIXED64:return e.fixed64();case f.L.BYTES:return e.bytes();case f.L.FIXED32:return e.fixed32();case f.L.SFIXED32:return e.sfixed32();case f.L.SFIXED64:return e.sfixed64();case f.L.SINT64:return e.sint64();case f.L.UINT32:return e.uint32();case f.L.SINT32:return e.sint32()}}function Et(e,t){var n;const i=function(e,t,n){const r=Je(e,void 0,!1);return bt(r,new Be(t),yt(n),!1,t.byteLength),r.message}(se,r(e));i.messageType.forEach(h),i.dependency=null!==(n=null==t?void 0:t.map((e=>e.proto.name)))&&void 0!==n?n:[];return v(i,(e=>null==t?void 0:t.find((t=>t.proto.name===e)))).getFile(i.name)}},3632:(e,t,n)=>{"use strict";n.d(t,{v:()=>h});var r=n(4230),i=n(6592),a=n(8190),o=n(6417),s=n(9228),l=n(987);const u=999,c=998,d=2;function h(e,t){if((0,r.K)(t,e))return t;const n=function(e){let t;if(function(e){switch(e.file.edition){case u:return!1;case c:return!0;default:return e.fields.some((e=>e.presence!=d&&"message"!=e.fieldKind&&!e.oneof))}}(e)){const n=w.get(e);let r,i;if(n)({prototype:r,members:i}=n);else{r={},i=new Set;for(const t of e.members)"oneof"!=t.kind&&("scalar"!=t.fieldKind&&"enum"!=t.fieldKind||t.presence!=d&&(i.add(t),r[t.localName]=S(t)));w.set(e,{prototype:r,members:i})}t=Object.create(r),t.$typeName=e.typeName;for(const n of e.members)if(!i.has(n)){if("field"==n.kind){if("message"==n.fieldKind)continue;if(("scalar"==n.fieldKind||"enum"==n.fieldKind)&&n.presence!=d)continue}t[n.localName]=S(n)}}else{t={$typeName:e.typeName};for(const n of e.members)"oneof"!=n.kind&&n.presence!=d||(t[n.localName]=S(n))}return t}(e);return void 0!==t&&function(e,t,n){for(const r of e.members){let e,i=n[r.localName];if(null!=i){if("oneof"==r.kind){const t=(0,s.mO)(n,r);if(!t)continue;e=t,i=(0,s.$v)(n,t)}else e=r;switch(e.fieldKind){case"message":i=g(e,i);break;case"scalar":i=f(e,i);break;case"list":i=m(e,i);break;case"map":i=p(e,i)}(0,s.lA)(t,e,i)}}}(e,n,t),n}function f(e,t){return e.scalar==i.L.BYTES?v(t):t}function p(e,t){if((0,o.Gv)(t)){if(e.scalar==i.L.BYTES)return y(t,v);if("message"==e.mapKind)return y(t,(t=>g(e,t)))}return t}function m(e,t){if(Array.isArray(t)){if(e.scalar==i.L.BYTES)return t.map(v);if("message"==e.listKind)return t.map((t=>g(e,t)))}return t}function g(e,t){if("message"==e.fieldKind&&!e.oneof&&(0,l.l)(e.message))return f(e.message.fields[0],t);if((0,o.Gv)(t)){if("google.protobuf.Struct"==e.message.typeName&&"google.protobuf.Value"!==e.parent.typeName)return t;if(!(0,r.K)(t,e.message))return h(e.message,t)}return t}function v(e){return Array.isArray(e)?new Uint8Array(e):e}function y(e,t){const n={};for(const r of Object.entries(e))n[r[0]]=t(r[1]);return n}const b=Symbol(),w=new WeakMap;function S(e){if("oneof"==e.kind)return{case:void 0};if("list"==e.fieldKind)return[];if("map"==e.fieldKind)return{};if("message"==e.fieldKind)return b;const t=e.getDefaultValue();return void 0!==t?"scalar"==e.fieldKind&&e.longAsString?t.toString():t:"scalar"==e.fieldKind?(0,a.M7)(e.scalar,e.longAsString):e.enum.values[0].number}},6592:(e,t,n)=>{"use strict";var r;n.d(t,{L:()=>r}),function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"}(r||(r={}))},4230:(e,t,n)=>{"use strict";function r(e,t){return!(null===e||"object"!=typeof e||!("$typeName"in e)||"string"!=typeof e.$typeName)&&(void 0===t||t.typeName===e.$typeName)}n.d(t,{K:()=>r})},8302:(e,t,n)=>{"use strict";n.d(t,{M:()=>i});var r=n(6834);const i=a();function a(){const e=new DataView(new ArrayBuffer(8));if("function"==typeof BigInt&&"function"==typeof e.getBigInt64&&"function"==typeof e.getBigUint64&&"function"==typeof e.setBigInt64&&"function"==typeof e.setBigUint64&&(!!globalThis.Deno||"object"!=typeof process||"object"!=typeof process.env||"1"!==process.env.BUF_BIGINT_DISABLE)){const t=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),r=BigInt("0"),i=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(e){const r="bigint"==typeof e?e:BigInt(e);if(r>n||r<t)throw new Error(`invalid int64: ${e}`);return r},uParse(e){const t="bigint"==typeof e?e:BigInt(e);if(t>i||t<r)throw new Error(`invalid uint64: ${e}`);return t},enc(t){return e.setBigInt64(0,this.parse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(t){return e.setBigInt64(0,this.uParse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec:(t,n)=>(e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigInt64(0,!0)),uDec:(t,n)=>(e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigUint64(0,!0))}}return{zero:"0",supported:!1,parse:e=>("string"!=typeof e&&(e=e.toString()),o(e),e),uParse:e=>("string"!=typeof e&&(e=e.toString()),s(e),e),enc:e=>("string"!=typeof e&&(e=e.toString()),o(e),(0,r.LJ)(e)),uEnc:e=>("string"!=typeof e&&(e=e.toString()),s(e),(0,r.LJ)(e)),dec:(e,t)=>(0,r._Q)(e,t),uDec:(e,t)=>(0,r.Hc)(e,t)}}function o(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function s(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}},6417:(e,t,n)=>{"use strict";n.d(t,{G6:()=>o,Gv:()=>i,LT:()=>s,sG:()=>a});var r=n(9228);function i(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function a(e,t){var n,a,o,s;if(i(e)&&r.I4 in e&&"add"in e&&"field"in e&&"function"==typeof e.field){if(void 0!==t){const r=t,i=e.field();return r.listKind==i.listKind&&r.scalar===i.scalar&&(null===(n=r.message)||void 0===n?void 0:n.typeName)===(null===(a=i.message)||void 0===a?void 0:a.typeName)&&(null===(o=r.enum)||void 0===o?void 0:o.typeName)===(null===(s=i.enum)||void 0===s?void 0:s.typeName)}return!0}return!1}function o(e,t){var n,a,o,s;if(i(e)&&r.I4 in e&&"has"in e&&"field"in e&&"function"==typeof e.field){if(void 0!==t){const r=t,i=e.field();return r.mapKey===i.mapKey&&r.mapKind==i.mapKind&&r.scalar===i.scalar&&(null===(n=r.message)||void 0===n?void 0:n.typeName)===(null===(a=i.message)||void 0===a?void 0:a.typeName)&&(null===(o=r.enum)||void 0===o?void 0:o.typeName)===(null===(s=i.enum)||void 0===s?void 0:s.typeName)}return!0}return!1}function s(e,t){return i(e)&&r.I4 in e&&"desc"in e&&i(e.desc)&&"message"===e.desc.kind&&(void 0===t||e.desc.typeName==t.typeName)}},8190:(e,t,n)=>{"use strict";n.d(t,{M7:()=>a,MZ:()=>o});var r=n(8302),i=n(6592);function a(e,t){switch(e){case i.L.STRING:return"";case i.L.BOOL:return!1;case i.L.DOUBLE:case i.L.FLOAT:return 0;case i.L.INT64:case i.L.UINT64:case i.L.SFIXED64:case i.L.FIXED64:case i.L.SINT64:return t?"0":r.M.zero;case i.L.BYTES:return new Uint8Array(0);default:return 0}}function o(e,t){switch(e){case i.L.BOOL:return!1===t;case i.L.STRING:return""===t;case i.L.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return 0==t}}},9228:(e,t,n)=>{"use strict";n.d(t,{$v:()=>u,I4:()=>a,b1:()=>l,lA:()=>c,mO:()=>o,yO:()=>d,zB:()=>s});var r=n(8190);const i=2,a=Symbol.for("reflect unsafe local");function o(e,t){const n=e[t.localName].case;return void 0===n?n:t.fields.find((e=>e.localName===n))}function s(e,t){const n=t.localName;if(t.oneof)return e[t.oneof.localName].case===n;if(t.presence!=i)return void 0!==e[n]&&Object.prototype.hasOwnProperty.call(e,n);switch(t.fieldKind){case"list":return e[n].length>0;case"map":return Object.keys(e[n]).length>0;case"scalar":return!(0,r.MZ)(t.scalar,e[n]);case"enum":return e[n]!==t.enum.values[0].number}throw new Error("message field with implicit presence")}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&void 0!==e[t]}function u(e,t){if(t.oneof){const n=e[t.oneof.localName];return n.case===t.localName?n.value:void 0}return e[t.localName]}function c(e,t,n){t.oneof?e[t.oneof.localName]={case:t.localName,value:n}:e[t.localName]=n}function d(e,t){const n=t.localName;if(t.oneof){const r=t.oneof.localName;e[r].case===n&&(e[r]={case:void 0})}else if(t.presence!=i)delete e[n];else switch(t.fieldKind){case"map":e[n]={};break;case"list":e[n]=[];break;case"enum":e[n]=t.enum.values[0].number;break;case"scalar":e[n]=(0,r.M7)(t.scalar,t.longAsString)}}},6834:(e,t,n)=>{"use strict";function r(){let e=0,t=0;for(let n=0;n<28;n+=7){let r=this.buf[this.pos++];if(e|=(127&r)<<n,!(128&r))return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(15&n)<<28,t=(112&n)>>4,!(128&n))return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let r=this.buf[this.pos++];if(t|=(127&r)<<n,!(128&r))return this.assertBounds(),[e,t]}throw new Error("invalid varint")}n.d(t,{Gn:()=>h,Hc:()=>s,LJ:()=>a,_Q:()=>o,f7:()=>d,ls:()=>r});const i=4294967296;function a(e){const t="-"===e[0];t&&(e=e.slice(1));const n=1e6;let r=0,a=0;function o(t,o){const s=Number(e.slice(t,o));a*=n,r=r*n+s,r>=i&&(a+=r/i|0,r%=i)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),t?u(r,a):l(r,a)}function o(e,t){let n=l(e,t);const r=2147483648&n.hi;r&&(n=u(n.lo,n.hi));const i=s(n.lo,n.hi);return r?"-"+i:i}function s(e,t){if(({lo:e,hi:t}=function(e,t){return{lo:e>>>0,hi:t>>>0}}(e,t)),t<=2097151)return String(i*t+e);const n=16777215&(e>>>24|t<<8),r=t>>16&65535;let a=(16777215&e)+6777216*n+6710656*r,o=n+8147497*r,s=2*r;const l=1e7;return a>=l&&(o+=Math.floor(a/l),a%=l),o>=l&&(s+=Math.floor(o/l),o%=l),s.toString()+c(o)+c(a)}function l(e,t){return{lo:0|e,hi:0|t}}function u(e,t){return t=~t,e?e=1+~e:t+=1,l(e,t)}const c=e=>{const t=String(e);return"0000000".slice(t.length)+t};function d(e,t){if(e>=0){for(;e>127;)t.push(127&e|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(127&e|128),e>>=7;t.push(1)}}function h(){let e=this.buf[this.pos++],t=127&e;if(!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<7,!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<14,!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<21,!(128&e))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(15&e)<<28;for(let t=5;128&e&&t<10;t++)e=this.buf[this.pos++];if(128&e)throw new Error("invalid varint");return this.assertBounds(),t>>>0}},987:(e,t,n)=>{"use strict";function r(e){return a(e.$typeName)}function i(e){const t=e.fields[0];return a(e.typeName)&&void 0!==t&&"scalar"==t.fieldKind&&"value"==t.name&&1==t.number}function a(e){return e.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(e.substring(16))}n.d(t,{Y:()=>r,l:()=>i})},9318:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>ft});var r=n(2540),i=n(6089),a=n(7993),o=n(5959),s=n(2871);const l=s.Bd?o.useLayoutEffect:o.useEffect;var u={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const c=s.Bd&&void 0!==window.ResizeObserver?function(){var e=(0,o.useState)(null),t=e[0],n=e[1],r=(0,o.useState)(u),i=r[0],a=r[1],s=(0,o.useMemo)((function(){return new window.ResizeObserver((function(e){if(e[0]){var t=e[0].contentRect,n=t.x,r=t.y,i=t.width,o=t.height,s=t.top,l=t.left,u=t.bottom,c=t.right;a({x:n,y:r,width:i,height:o,top:s,left:l,bottom:u,right:c})}}))}),[]);return l((function(){if(t)return s.observe(t),function(){s.disconnect()}}),[t]),[n,i]}:function(){return[s.lQ,u]};var d=n(2007);const h=22*window.devicePixelRatio,f=10*window.devicePixelRatio,p=.5*window.devicePixelRatio,m=20*window.devicePixelRatio,g=.5*window.devicePixelRatio,v=4*window.devicePixelRatio,y=3*window.devicePixelRatio,b=3*window.devicePixelRatio,w=4*window.devicePixelRatio,S=2*window.devicePixelRatio,x=120,E=({data:e,itemData:t,onMenuItemClick:n,onItemFocus:i,onSandwich:a,collapseConfig:o,onExpandGroup:s,onCollapseGroup:l,onExpandAllGroups:u,onCollapseAllGroups:c,getExtraContextMenuButtons:h,collapsing:f,allGroupsExpanded:p,allGroupsCollapsed:m,selectedView:g,search:v})=>(0,r.jsx)("div",{"data-testid":"contextMenu",children:(0,r.jsx)(d.ContextMenu,{renderMenuItems:function(){const y=(null==h?void 0:h(t,e.data,{selectedView:g,isDiff:e.isDiffFlamegraph(),search:v,collapseConfig:o}))||[];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.MenuItem,{label:"Focus block",icon:"eye",onClick:()=>{i(),n()}}),(0,r.jsx)(d.MenuItem,{label:"Copy function name",icon:"copy",onClick:()=>{navigator.clipboard.writeText(t.label).then((()=>{n()}))}}),(0,r.jsx)(d.MenuItem,{label:"Sandwich view",icon:"gf-show-context",onClick:()=>{a(),n()}}),y.map((({label:e,icon:t,onClick:n})=>(0,r.jsx)(d.MenuItem,{label:e,icon:t,onClick:()=>n()},e))),f&&(0,r.jsxs)(d.MenuGroup,{label:"Grouping",children:[o?o.collapsed?(0,r.jsx)(d.MenuItem,{label:"Expand group",icon:"angle-double-down",onClick:()=>{s(),n()}}):(0,r.jsx)(d.MenuItem,{label:"Collapse group",icon:"angle-double-up",onClick:()=>{l(),n()}}):null,!p&&(0,r.jsx)(d.MenuItem,{label:"Expand all groups",icon:"angle-double-down",onClick:()=>{u(),n()}}),!m&&(0,r.jsx)(d.MenuItem,{label:"Collapse all groups",icon:"angle-double-up",onClick:()=>{c(),n()}})]})]})},x:t.posX+10,y:t.posY,focusOnOpen:!1})});var _=n(7781);const O=({data:e,item:t,totalTicks:n,position:i,collapseConfig:a})=>{const o=(0,d.useStyles2)(R);if(!t||!i)return null;let s;if(e.isDiffFlamegraph()){const i=C(e,t,n);s=(0,r.jsx)(d.InteractiveTable,{className:o.tooltipTable,columns:[{id:"label",header:""},{id:"baseline",header:"Baseline"},{id:"comparison",header:"Comparison"},{id:"diff",header:"Diff"}],data:i,getRowId:e=>e.rowId})}else{const i=k(e,t,n);s=(0,r.jsxs)("p",{className:o.lastParagraph,children:[i.unitTitle,(0,r.jsx)("br",{}),"Total: ",(0,r.jsx)("b",{children:i.unitValue})," (",i.percentValue,"%)",(0,r.jsx)("br",{}),"Self: ",(0,r.jsx)("b",{children:i.unitSelf})," (",i.percentSelf,"%)",(0,r.jsx)("br",{}),"Samples: ",(0,r.jsx)("b",{children:i.samples})]})}return(0,r.jsx)(d.Portal,{children:(0,r.jsx)(d.VizTooltipContainer,{className:o.tooltipContainer,position:i,offset:{x:15,y:0},children:(0,r.jsxs)("div",{className:o.tooltipContent,children:[(0,r.jsxs)("p",{className:o.tooltipName,children:[e.getLabel(t.itemIndexes[0]),a&&a.collapsed?(0,r.jsxs)("span",{children:[(0,r.jsx)("br",{}),"and ",a.items.length," similar items"]}):""]}),s]})})})},k=(e,t,n)=>{const r=e.valueDisplayProcessor(t.value),i=e.getSelfDisplay(t.itemIndexes),a=Math.round(r.numeric/n*1e4)/100,o=Math.round(i.numeric/n*1e4)/100;let s=r.text+r.suffix,l=i.text+i.suffix;const u=e.getUnitTitle();return"Count"===u&&(r.suffix||(s=r.text),i.suffix||(l=i.text)),{percentValue:a,percentSelf:o,unitTitle:u,unitValue:s,unitSelf:l,samples:r.numeric.toLocaleString()}},T=(e,t)=>{const n=t(e);return n.text+n.suffix},C=(e,t,n)=>{const r=e.getLevels()[0][0].valueRight,i=n-r,a=t.value-t.valueRight,o=Math.round(1e4*a/i)/100,s=Math.round(1e4*t.valueRight/r)/100,l=(s-o)/o*100,u=I(e,e.valueDisplayProcessor(a)),c=I(e,e.valueDisplayProcessor(t.valueRight)),d=(0,_.getValueFormat)("short");return[{rowId:"1",label:"% of total",baseline:o+"%",comparison:s+"%",diff:T(l,d)+"%"},{rowId:"2",label:"Value",baseline:u,comparison:c,diff:I(e,e.valueDisplayProcessor(t.valueRight-a))},{rowId:"3",label:"Samples",baseline:T(a,d),comparison:T(t.valueRight,d),diff:T(t.valueRight-a,d)}]};function I(e,t){let n=t.text+t.suffix;return"Count"===e.getUnitTitle()&&(t.suffix||(n=t.text)),n}const R=e=>({tooltipContainer:(0,i.css)({title:"tooltipContainer",overflow:"hidden"}),tooltipContent:(0,i.css)({title:"tooltipContent",fontSize:e.typography.bodySmall.fontSize,width:"100%"}),tooltipName:(0,i.css)({title:"tooltipName",marginTop:0,wordBreak:"break-all"}),lastParagraph:(0,i.css)({title:"lastParagraph",marginBottom:0}),name:(0,i.css)({title:"name",marginBottom:"10px"}),tooltipTable:(0,i.css)({title:"tooltipTable",maxWidth:"400px"})});function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(e)}var N=/^\s+/,D=/\s+$/;function L(e,t){if(t=t||{},(e=e||"")instanceof L)return e;if(!(this instanceof L))return new L(e,t);var n=function(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,a=null,o=!1,s=!1;"string"==typeof e&&(e=function(e){e=e.replace(N,"").replace(D,"").toLowerCase();var t,n=!1;if(X[e])e=X[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=ce.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=ce.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=ce.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=ce.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=ce.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=ce.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=ce.hex8.exec(e))return{r:ne(t[1]),g:ne(t[2]),b:ne(t[3]),a:oe(t[4]),format:n?"name":"hex8"};if(t=ce.hex6.exec(e))return{r:ne(t[1]),g:ne(t[2]),b:ne(t[3]),format:n?"name":"hex"};if(t=ce.hex4.exec(e))return{r:ne(t[1]+""+t[1]),g:ne(t[2]+""+t[2]),b:ne(t[3]+""+t[3]),a:oe(t[4]+""+t[4]),format:n?"name":"hex8"};if(t=ce.hex3.exec(e))return{r:ne(t[1]+""+t[1]),g:ne(t[2]+""+t[2]),b:ne(t[3]+""+t[3]),format:n?"name":"hex"};return!1}(e));"object"==A(e)&&(de(e.r)&&de(e.g)&&de(e.b)?(l=e.r,u=e.g,c=e.b,t={r:255*ee(l,255),g:255*ee(u,255),b:255*ee(c,255)},o=!0,s="%"===String(e.r).substr(-1)?"prgb":"rgb"):de(e.h)&&de(e.s)&&de(e.v)?(r=ie(e.s),i=ie(e.v),t=function(e,t,n){e=6*ee(e,360),t=ee(t,100),n=ee(n,100);var r=Math.floor(e),i=e-r,a=n*(1-t),o=n*(1-i*t),s=n*(1-(1-i)*t),l=r%6,u=[n,o,a,a,s,n][l],c=[s,n,n,o,a,a][l],d=[a,a,s,n,n,o][l];return{r:255*u,g:255*c,b:255*d}}(e.h,r,i),o=!0,s="hsv"):de(e.h)&&de(e.s)&&de(e.l)&&(r=ie(e.s),a=ie(e.l),t=function(e,t,n){var r,i,a;function o(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=ee(e,360),t=ee(t,100),n=ee(n,100),0===t)r=i=a=n;else{var s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;r=o(l,s,e+1/3),i=o(l,s,e),a=o(l,s,e-1/3)}return{r:255*r,g:255*i,b:255*a}}(e.h,r,a),o=!0,s="hsl"),e.hasOwnProperty("a")&&(n=e.a));var l,u,c;return n=Z(n),{ok:o,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function P(e,t,n){e=ee(e,255),t=ee(t,255),n=ee(n,255);var r,i,a=Math.max(e,t,n),o=Math.min(e,t,n),s=(a+o)/2;if(a==o)r=i=0;else{var l=a-o;switch(i=s>.5?l/(2-a-o):l/(a+o),a){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{h:r,s:i,l:s}}function M(e,t,n){e=ee(e,255),t=ee(t,255),n=ee(n,255);var r,i,a=Math.max(e,t,n),o=Math.min(e,t,n),s=a,l=a-o;if(i=0===a?0:l/a,a==o)r=0;else{switch(a){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{h:r,s:i,v:s}}function j(e,t,n,r){var i=[re(Math.round(e).toString(16)),re(Math.round(t).toString(16)),re(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function F(e,t,n,r){return[re(ae(r)),re(Math.round(e).toString(16)),re(Math.round(t).toString(16)),re(Math.round(n).toString(16))].join("")}function V(e,t){t=0===t?0:t||10;var n=L(e).toHsl();return n.s-=t/100,n.s=te(n.s),L(n)}function $(e,t){t=0===t?0:t||10;var n=L(e).toHsl();return n.s+=t/100,n.s=te(n.s),L(n)}function B(e){return L(e).desaturate(100)}function z(e,t){t=0===t?0:t||10;var n=L(e).toHsl();return n.l+=t/100,n.l=te(n.l),L(n)}function U(e,t){t=0===t?0:t||10;var n=L(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),L(n)}function q(e,t){t=0===t?0:t||10;var n=L(e).toHsl();return n.l-=t/100,n.l=te(n.l),L(n)}function H(e,t){var n=L(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,L(n)}function W(e){var t=L(e).toHsl();return t.h=(t.h+180)%360,L(t)}function G(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=L(e).toHsl(),r=[L(e)],i=360/t,a=1;a<t;a++)r.push(L({h:(n.h+a*i)%360,s:n.s,l:n.l}));return r}function K(e){var t=L(e).toHsl(),n=t.h;return[L(e),L({h:(n+72)%360,s:t.s,l:t.l}),L({h:(n+216)%360,s:t.s,l:t.l})]}function Q(e,t,n){t=t||6,n=n||30;var r=L(e).toHsl(),i=360/n,a=[L(e)];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,a.push(L(r));return a}function Y(e,t){t=t||6;for(var n=L(e).toHsv(),r=n.h,i=n.s,a=n.v,o=[],s=1/t;t--;)o.push(L({h:r,s:i,v:a})),a=(a+s)%1;return o}L.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,t=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=Z(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=M(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=M(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=P(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=P(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return j(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,i){var a=[re(Math.round(e).toString(16)),re(Math.round(t).toString(16)),re(Math.round(n).toString(16)),re(ae(r))];if(i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1))return a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0);return a.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*ee(this._r,255))+"%",g:Math.round(100*ee(this._g,255))+"%",b:Math.round(100*ee(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*ee(this._r,255))+"%, "+Math.round(100*ee(this._g,255))+"%, "+Math.round(100*ee(this._b,255))+"%)":"rgba("+Math.round(100*ee(this._r,255))+"%, "+Math.round(100*ee(this._g,255))+"%, "+Math.round(100*ee(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(J[j(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+F(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var i=L(e);n="#"+F(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return L(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(z,arguments)},brighten:function(){return this._applyModification(U,arguments)},darken:function(){return this._applyModification(q,arguments)},desaturate:function(){return this._applyModification(V,arguments)},saturate:function(){return this._applyModification($,arguments)},greyscale:function(){return this._applyModification(B,arguments)},spin:function(){return this._applyModification(H,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(Q,arguments)},complement:function(){return this._applyCombination(W,arguments)},monochromatic:function(){return this._applyCombination(Y,arguments)},splitcomplement:function(){return this._applyCombination(K,arguments)},triad:function(){return this._applyCombination(G,[3])},tetrad:function(){return this._applyCombination(G,[4])}},L.fromRatio=function(e,t){if("object"==A(e)){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]="a"===r?e[r]:ie(e[r]));e=n}return L(e,t)},L.equals=function(e,t){return!(!e||!t)&&L(e).toRgbString()==L(t).toRgbString()},L.random=function(){return L.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},L.mix=function(e,t,n){n=0===n?0:n||50;var r=L(e).toRgb(),i=L(t).toRgb(),a=n/100;return L({r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a})},L.readability=function(e,t){var n=L(e),r=L(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},L.isReadable=function(e,t,n){var r,i,a=L.readability(e,t);switch(i=!1,(r=function(e){var t,n;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==n&&"large"!==n&&(n="small");return{level:t,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},L.mostReadable=function(e,t,n){var r,i,a,o,s=null,l=0;i=(n=n||{}).includeFallbackColors,a=n.level,o=n.size;for(var u=0;u<t.length;u++)(r=L.readability(e,t[u]))>l&&(l=r,s=L(t[u]));return L.isReadable(e,s,{level:a,size:o})||!i?s:(n.includeFallbackColors=!1,L.mostReadable(e,["#fff","#000"],n))};var X=L.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},J=L.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(X);function Z(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ee(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function te(e){return Math.min(1,Math.max(0,e))}function ne(e){return parseInt(e,16)}function re(e){return 1==e.length?"0"+e:""+e}function ie(e){return e<=1&&(e=100*e+"%"),e}function ae(e){return Math.round(255*parseFloat(e)).toString(16)}function oe(e){return ne(e)/255}var se,le,ue,ce=(le="[\\s|\\(]+("+(se="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+se+")[,|\\s]+("+se+")\\s*\\)?",ue="[\\s|\\(]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")\\s*\\)?",{CSS_UNIT:new RegExp(se),rgb:new RegExp("rgb"+le),rgba:new RegExp("rgba"+ue),hsl:new RegExp("hsl"+le),hsla:new RegExp("hsla"+ue),hsv:new RegExp("hsv"+le),hsva:new RegExp("hsva"+ue),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function de(e){return!!ce.CSS_UNIT.exec(e)}var he=(e=>(e.Bytes="bytes",e.Short="short",e.Nanoseconds="ns",e))(he||{}),fe=(e=>(e.TopTable="topTable",e.FlameGraph="flameGraph",e.Both="both",e))(fe||{}),pe=(e=>(e.ValueBased="valueBased",e.PackageBased="packageBased",e))(pe||{}),me=(e=>(e.Default="default",e.DiffColorBlind="diffColorBlind",e))(me||{}),ge=n(4201);const ve=[L({h:24,s:69,l:60}),L({h:34,s:65,l:65}),L({h:194,s:52,l:61}),L({h:163,s:45,l:55}),L({h:211,s:48,l:60}),L({h:246,s:40,l:65}),L({h:305,s:63,l:79}),L({h:47,s:100,l:73}),L({r:183,g:219,b:171}),L({r:244,g:213,b:152}),L({r:78,g:146,b:249}),L({r:249,g:186,b:143}),L({r:242,g:145,b:145}),L({r:130,g:181,b:216}),L({r:229,g:168,b:226}),L({r:174,g:162,b:224}),L({r:154,g:196,b:138}),L({r:242,g:201,b:109}),L({r:101,g:197,b:219}),L({r:249,g:147,b:78}),L({r:234,g:100,b:96}),L({r:81,g:149,b:206}),L({r:214,g:131,b:206}),L({r:128,g:110,b:183})],ye=`linear-gradient(90deg, ${we(1,100,0,1)} 0%, ${we(100,100,0,1)} 100%)`,be=`linear-gradient(90deg, ${ve[0]} 0%, ${ve[2]} 30%, ${ve[6]} 50%, ${ve[7]} 70%, ${ve[8]} 100%)`;function we(e,t,n,r){const i=Math.min(1,e/t/(r-n));return L({h:50-50*i,s:100,l:65+7*i})}function Se(e,t){const n=function(e,t=0){let n,r,i,a,o,s,l,u;for(n=3&e.length,r=e.length-n,i=t,o=3432918353,s=461845907,u=0;u<r;)l=255&e.charCodeAt(u)|(255&e.charCodeAt(++u))<<8|(255&e.charCodeAt(++u))<<16|(255&e.charCodeAt(++u))<<24,++u,l=(65535&l)*o+(((l>>>16)*o&65535)<<16)&4294967295,l=l<<15|l>>>17,l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295,i^=l,i=i<<13|i>>>19,a=5*(65535&i)+((5*(i>>>16)&65535)<<16)&4294967295,i=27492+(65535&a)+((58964+(a>>>16)&65535)<<16);switch(l=0,n){case 3:l^=(255&e.charCodeAt(u+2))<<16;case 2:l^=(255&e.charCodeAt(u+1))<<8;case 1:l^=255&e.charCodeAt(u);default:l=(65535&l)*o+(((l>>>16)*o&65535)<<16)&4294967295,l=l<<15|l>>>17,l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295,i^=l}return i^=e.length,i^=i>>>16,i=2246822507*(65535&i)+((2246822507*(i>>>16)&65535)<<16)&4294967295,i^=i>>>13,i=3266489909*(65535&i)+((3266489909*(i>>>16)&65535)<<16)&4294967295,i^=i>>>16,i>>>0}(function(e){var t;for(const[n,r]of ke){const n=e.match(r);if(n)return(null==(t=n.groups)?void 0:t.packageName)||""}return}(e)||"",0)%ve.length;let r=ve[n].clone();return t.isLight&&(r=r.brighten(15)),r}const xe=["rgb(0, 170, 0)","rgb(148, 142, 142)","rgb(200, 0, 0)"],Ee=`linear-gradient(90deg, ${xe[0]} 0%, ${xe[1]} 50%, ${xe[2]} 100%)`,_e=["rgb(26, 133, 255)","rgb(148, 142, 142)","rgb(220, 50, 32)"],Oe=`linear-gradient(90deg, ${_e[0]} 0%, ${_e[1]} 50%, ${_e[2]} 100%)`;const ke=[["phpspy",/^(?<packageName>([^\/]*\/)*)(?<filename>.*\.php+)(?<line_info>.*)$/],["pyspy",/^(?<packageName>([^\/]*\/)*)(?<filename>.*\.py+)(?<line_info>.*)$/],["rbspy",/^(?<packageName>([^\/]*\/)*)(?<filename>.*\.rb+)(?<line_info>.*)$/],["nodespy",/^(\.\/node_modules\/)?(?<packageName>[^/]*)(?<filename>.*\.?(jsx?|tsx?)?):(?<functionName>.*):(?<line_info>.*)$/],["gospy",/^(?<packageName>.*?\/.*?\.|.*?\.|.+)(?<functionName>.*)$/],["javaspy",/^(?<packageName>.+\/)(?<filename>.+\.)(?<functionName>.+)$/],["dotnetspy",/^(?<packageName>.+)\.(.+)\.(.+)\(.*\)$/],["tracing",/^(?<packageName>.+?):.*$/],["pyroscope-rs",/^(?<packageName>[^::]+)/],["ebpfspy",/^(?<packageName>.+)$/],["unknown",/^(?<packageName>.+)$/]];function Te(e){const{canvasRef:t,data:n,root:r,depth:i,direction:a,wrapperWidth:s,rangeMin:l,rangeMax:u,matchedLabels:c,textAlign:v,totalViewTicks:x,totalColorTicks:E,totalTicksRight:_,colorScheme:O,focusedItemData:k,collapsedMap:T}=e,C=function(e,t,n){const[r,i]=(0,o.useState)();return(0,o.useEffect)((()=>{if(!n||!e.current)return;const r=e.current.getContext("2d"),a=h*n;e.current.width=Math.round(t*window.devicePixelRatio),e.current.height=Math.round(a),e.current.style.width=`${t}px`,e.current.style.height=a/window.devicePixelRatio+"px",r.textBaseline="middle",r.font=12*window.devicePixelRatio+"px monospace",r.strokeStyle="white",i(r)}),[e,i,t,n]),r}(t,s,i),I=(0,d.useTheme2)(),R=(0,o.useMemo)((()=>{const e=L(I.colors.background.secondary);return I.isLight?e.darken(10).toHexString():e.lighten(10).toHexString()}),[I]),A=function(e,t,n,r,i,a,s,l,u){return(0,o.useCallback)((function(o,c,d){if(d&&!l)return i;const h=void 0===o.valueRight||n!==me.Default&&n!==me.DiffColorBlind?n===pe.ValueBased?we(o.value,e,a,s):Se(c,r):function(e,t,n,r,i){const a=i===me.Default?xe:_e,o=(0,ge.scaleLinear)().domain([-100,0,100]).range(a),s=e-t,l=n-r;if(0===r||0===l)return L(o(0));const u=Math.round(1e4*s/l)/100;return L(o((Math.round(1e4*t/r)/100-u)/u*100))}(o.value,o.valueRight,e,t,n);return l?l.has(c)?h.toHslString():i:o.level>u-1?h.toHslString():h.lighten(15).toHslString()}),[e,t,n,r,a,s,l,u,i])}(E,_,O,I,R,l,u,c,k?k.item.level:0),N=function(e,t,n,r,i){return(0,o.useMemo)((()=>{if(!e)return()=>{};return(a,o,s,l,u,c)=>{e.beginPath(),e.rect(o+g,s,l,u),e.fillStyle=n(a,c,!1),e.stroke(),e.fill();const d=i.get(a);let h=c;if(d&&d.collapsed){h=`(${d.items.length}) `+c}l>=m&&(d?(Ce(e,t,h,a,l,"left"===r?o+w+S:o,s,r),function(e,t,n,r,i,a){const o=t+w;e.beginPath(),e.rect(t,n,o-t+y+b,r),e.fill(),e.beginPath(),a.collapsed?e.rect(o,n+r/4,y,r/2):a.items[0]===i?e.rect(o,n+r/2,y,r/2):a.items[a.items.length-1]===i?e.rect(o,n,y,r/2):e.rect(o,n,y,r);e.fillStyle="#666",e.fill()}(e,o,s,u,a,d)):Ce(e,t,h,a,l,o,s,r))}}),[e,n,r,t,i])}(C,n,A,v,T);(0,o.useEffect)((()=>{if(!C)return;C.clearRect(0,0,C.canvas.width,C.canvas.height);const e=new Path2D;!function(e,t,n,r,i,a,o,s,l){const u=[];u.push({item:e,levelOffset:0});const c=o*window.devicePixelRatio/r/(a-i);let d;for(;u.length>0;){const{item:e,levelOffset:a}=u.shift();let o=e.value;const m=o*c<=f,v=o*c-(m?0:2*g),y=h;if(v<p)continue;let b=0,w=!1;const S=s.get(e),x=S&&S.collapsed;if(x&&d===S.items[0]?(b="children"===t?-1:1,w=!0):d=void 0,!w){x&&(d=e),l(e,Ie(e.start,r,i,c),(e.level+a)*h,v,y,n.getLabel(e.itemIndexes[0]),m)}const E="children"===t?e.children:e.parents;E&&u.unshift(...E.map((e=>({item:e,levelOffset:a+b}))))}}(r,a,n,x,l,u,s,T,((t,n,r,i,a,o,s)=>{s?e.rect(n,r,i,a):N(t,n,r,i,a,o)})),C.fillStyle=R,C.fill(e)}),[C,n,r,s,l,u,x,a,N,T,R])}function Ce(e,t,n,r,i,a,o,s){e.save(),e.clip(),e.fillStyle="#222";const l=t.valueDisplayProcessor(r.value),u=l.suffix?l.text+l.suffix:l.text,c=e.measureText(n),d=i-v;let f=`${n} (${u})`,p=Math.max(a,0)+v;c.width>d&&(e.textAlign=s,"right"===s&&(f=n,p=a+i-v)),e.fillText(f,p,o+h/2+2),e.restore()}function Ie(e,t,n,r){return(e-t*n)*r}const Re=({data:e,rangeMin:t,rangeMax:n,matchedLabels:i,setRangeMin:a,setRangeMax:s,onItemFocused:l,focusedItemData:u,textAlign:d,onSandwich:h,colorScheme:f,totalProfileTicks:p,totalProfileTicksRight:m,totalViewTicks:g,root:v,direction:y,depth:b,showFlameGraphOnly:w,collapsedMap:S,setCollapsedMap:x,collapsing:_,getExtraContextMenuButtons:k,selectedView:T,search:C})=>{const I=Ae(),[R,{width:A}]=c(),N=(0,o.useRef)(null),[D,L]=(0,o.useState)(),[P,M]=(0,o.useState)();Te({canvasRef:N,colorScheme:f,data:e,focusedItemData:u,root:v,direction:y,depth:b,rangeMax:n,rangeMin:t,matchedLabels:i,textAlign:d,totalViewTicks:g,totalColorTicks:e.isDiffFlamegraph()?p:g,totalTicksRight:m,wrapperWidth:A,collapsedMap:S});const j=(0,o.useCallback)((r=>{L(void 0);const i=N.current.clientWidth/g/(n-t),a=Ne({x:r.nativeEvent.offsetX,y:r.nativeEvent.offsetY},v,y,b,i,g,t,S);M(a?{posY:r.clientY,posX:r.clientX,item:a,label:e.getLabel(a.itemIndexes[0])}:void 0)}),[e,t,n,g,v,y,b,S]),[F,V]=(0,o.useState)(),$=(0,o.useCallback)((e=>{if(void 0===P){L(void 0),V(void 0);const r=N.current.clientWidth/g/(n-t),i=Ne({x:e.nativeEvent.offsetX,y:e.nativeEvent.offsetY},v,y,b,r,g,t,S);i&&(V({x:e.clientX,y:e.clientY}),L(i))}}),[t,n,g,P,V,v,y,b,S]),B=(0,o.useCallback)((()=>{L(void 0)}),[]);return(0,o.useEffect)((()=>{const e=e=>{var t;e.target instanceof HTMLElement&&"flameGraphCanvasContainer_clickOutsideCheck"!==(null==(t=e.target.parentElement)?void 0:t.id)&&M(void 0)};return window.addEventListener("click",e),()=>window.removeEventListener("click",e)}),[M]),(0,r.jsxs)("div",{className:I.graph,children:[(0,r.jsx)("div",{className:I.canvasWrapper,id:"flameGraphCanvasContainer_clickOutsideCheck",ref:R,children:(0,r.jsx)("canvas",{ref:N,"data-testid":"flameGraph",onClick:j,onMouseMove:$,onMouseLeave:B})}),(0,r.jsx)(O,{position:F,item:D,data:e,totalTicks:g,collapseConfig:D?S.get(D):void 0}),!w&&P&&(0,r.jsx)(E,{data:e,itemData:P,collapsing:_,collapseConfig:S.get(P.item),onMenuItemClick:()=>{M(void 0)},onItemFocus:()=>{a(P.item.start/g),s((P.item.start+P.item.value)/g),l(P)},onSandwich:()=>{h(e.getLabel(P.item.itemIndexes[0]))},onExpandGroup:()=>{x(S.setCollapsedStatus(P.item,!1))},onCollapseGroup:()=>{x(S.setCollapsedStatus(P.item,!0))},onExpandAllGroups:()=>{x(S.setAllCollapsedStatus(!1))},onCollapseAllGroups:()=>{x(S.setAllCollapsedStatus(!0))},allGroupsCollapsed:Array.from(S.values()).every((e=>e.collapsed)),allGroupsExpanded:Array.from(S.values()).every((e=>!e.collapsed)),getExtraContextMenuButtons:k,selectedView:T,search:C})]})},Ae=()=>({graph:(0,i.css)({label:"graph",overflow:"auto",flexGrow:1,flexBasis:"50%"}),canvasContainer:(0,i.css)({label:"canvasContainer",display:"flex"}),canvasWrapper:(0,i.css)({label:"canvasWrapper",cursor:"pointer",flex:1,overflow:"hidden"}),sandwichMarker:(0,i.css)({label:"sandwichMarker",writingMode:"vertical-lr",transform:"rotate(180deg)",overflow:"hidden",whiteSpace:"nowrap"}),sandwichMarkerIcon:(0,i.css)({label:"sandwichMarkerIcon",verticalAlign:"baseline"})}),Ne=(e,t,n,r,i,a,o,s)=>{let l=t,u="children"===n?0:r-1;const c=Math.floor(e.y/(h/window.devicePixelRatio));let d;for(;l;){const t=l;if(l=void 0,u===c){d=t;break}const r="children"===n?t.children:t.parents||[];for(const t of r){const r=Ie(t.start,a,o,i),c=Ie(t.start+t.value,a,o,i);if(r<=e.x&&e.x<c){l=t;const e=s.get(t);e&&e.collapsed&&e.items[0]!==t||(u+="children"===n?1:-1);break}}}return d},De=(0,o.memo)((({data:e,focusedItem:t,totalTicks:n,sandwichedLabel:i,onFocusPillClick:a,onSandwichPillClick:o})=>{const s=(0,d.useStyles2)(Le),l=[],u=(0,_.getValueFormat)("short")(n),c=e.valueDisplayProcessor(n);let h=c.text+c.suffix;const f=e.getUnitTitle();if("Count"===f&&(c.suffix||(h=c.text)),l.push((0,r.jsxs)("div",{className:s.metadataPill,children:[h," | ",u.text,u.suffix," samples (",f,")"]},"default")),i&&l.push((0,r.jsx)(d.Tooltip,{content:i,placement:"top",children:(0,r.jsxs)("div",{children:[(0,r.jsx)(d.Icon,{size:"sm",name:"angle-right"}),(0,r.jsxs)("div",{className:s.metadataPill,children:[(0,r.jsx)(d.Icon,{size:"sm",name:"gf-show-context"})," ",(0,r.jsx)("span",{className:s.metadataPillName,children:i.substring(i.lastIndexOf("/")+1)}),(0,r.jsx)(d.IconButton,{className:s.pillCloseButton,name:"times",size:"sm",onClick:o,tooltip:"Remove sandwich view","aria-label":"Remove sandwich view"})]})]})},"sandwich")),t){const e=n>0?Math.round(t.item.value/n*1e4)/100:0,i=e>0?"eye":"exclamation-circle";l.push((0,r.jsx)(d.Tooltip,{content:t.label,placement:"top",children:(0,r.jsxs)("div",{children:[(0,r.jsx)(d.Icon,{size:"sm",name:"angle-right"}),(0,r.jsxs)("div",{className:s.metadataPill,children:[(0,r.jsx)(d.Icon,{size:"sm",name:i})," ",e,"% of total",(0,r.jsx)(d.IconButton,{className:s.pillCloseButton,name:"times",size:"sm",onClick:a,tooltip:"Remove focus","aria-label":"Remove focus"})]})]})},"focus"))}return(0,r.jsx)("div",{className:s.metadata,children:l})}));De.displayName="FlameGraphMetadata";const Le=e=>({metadataPill:(0,i.css)({label:"metadataPill",display:"inline-flex",alignItems:"center",background:e.colors.background.secondary,borderRadius:e.shape.borderRadius(8),padding:e.spacing(.5,1),fontSize:e.typography.bodySmall.fontSize,fontWeight:e.typography.fontWeightMedium,lineHeight:e.typography.bodySmall.lineHeight,color:e.colors.text.secondary}),pillCloseButton:(0,i.css)({label:"pillCloseButton",verticalAlign:"text-bottom",margin:e.spacing(0,.5)}),metadata:(0,i.css)({display:"flex",alignItems:"center",justifyContent:"center",margin:"8px 0"}),metadataPillName:(0,i.css)({label:"metadataPillName",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginLeft:e.spacing(.5)})}),Pe=({data:e,rangeMin:t,rangeMax:n,matchedLabels:a,setRangeMin:s,setRangeMax:l,onItemFocused:u,focusedItemData:c,textAlign:h,onSandwich:f,sandwichItem:p,onFocusPillClick:m,onSandwichPillClick:g,colorScheme:v,showFlameGraphOnly:y,getExtraContextMenuButtons:b,collapsing:w,selectedView:S,search:x,collapsedMap:E,setCollapsedMap:_})=>{const O=Me(),[k,T]=(0,o.useState)(),[C,I]=(0,o.useState)(),[R,A]=(0,o.useState)(0),[N,D]=(0,o.useState)(),[L,P]=(0,o.useState)(0);if((0,o.useEffect)((()=>{var t,n,r;if(e){let i,a=e.getLevels(),o=a.length?a[0][0].value:0,s=a.length?a[0][0].valueRight:void 0,l=o;if(p){const[o,s]=e.getSandwichLevels(p);a=s,i=o,l=null!=(r=null==(n=null==(t=s[0])?void 0:t[0])?void 0:n.value)?r:0}T(a),I(i),A(o),D(s),P(l)}}),[e,p]),!k)return null;const M={data:e,rangeMin:t,rangeMax:n,matchedLabels:a,setRangeMin:s,setRangeMax:l,onItemFocused:u,focusedItemData:c,textAlign:h,onSandwich:f,colorScheme:v,totalProfileTicks:R,totalProfileTicksRight:N,totalViewTicks:L,showFlameGraphOnly:y,collapsedMap:E,setCollapsedMap:_,getExtraContextMenuButtons:b,collapsing:w,search:x,selectedView:S};let j=null;return(null==C?void 0:C.length)?j=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:O.sandwichCanvasWrapper,children:[(0,r.jsxs)("div",{className:O.sandwichMarker,children:["Callers",(0,r.jsx)(d.Icon,{className:O.sandwichMarkerIcon,name:"arrow-down"})]}),(0,r.jsx)(Re,{...M,root:C[C.length-1][0],depth:C.length,direction:"parents",collapsing:!1})]}),(0,r.jsxs)("div",{className:O.sandwichCanvasWrapper,children:[(0,r.jsxs)("div",{className:(0,i.cx)(O.sandwichMarker,O.sandwichMarkerCalees),children:[(0,r.jsx)(d.Icon,{className:O.sandwichMarkerIcon,name:"arrow-up"}),"Callees"]}),(0,r.jsx)(Re,{...M,root:k[0][0],depth:k.length,direction:"children",collapsing:!1})]})]}):(null==k?void 0:k.length)&&(j=(0,r.jsx)(Re,{...M,root:k[0][0],depth:k.length,direction:"children"})),(0,r.jsxs)("div",{className:O.graph,children:[(0,r.jsx)(De,{data:e,focusedItem:c,sandwichedLabel:p,totalTicks:L,onFocusPillClick:m,onSandwichPillClick:g}),j]})},Me=()=>({graph:(0,i.css)({label:"graph",overflow:"auto",flexGrow:1,flexBasis:"50%"}),sandwichCanvasWrapper:(0,i.css)({label:"sandwichCanvasWrapper",display:"flex",marginBottom:h/window.devicePixelRatio+"px"}),sandwichMarker:(0,i.css)({label:"sandwichMarker",writingMode:"vertical-lr",transform:"rotate(180deg)",overflow:"hidden",whiteSpace:"nowrap"}),sandwichMarkerCalees:(0,i.css)({label:"sandwichMarkerCalees",textAlign:"right"}),sandwichMarkerIcon:(0,i.css)({label:"sandwichMarkerIcon",verticalAlign:"baseline"})});var je=n(3241);function Fe(e,t,n="children"){var r;const i="parents"===n?"children":"parents",a=[],o=[{previous:void 0,items:e,level:0}];for(;o.length;){const e=o.shift(),s=e.items.flatMap((e=>e.itemIndexes)),l={value:e.items.reduce(((e,t)=>e+t.value),0),itemIndexes:s,children:[],parents:[],start:0,level:e.level};if(a[e.level]=a[e.level]||[],a[e.level].push(l),e.previous){l[i]=[e.previous];const t=(null==(r=e.previous[n])?void 0:r.reduce(((e,t)=>e+t.value),0))||0;l.start=e.previous.start+t,e.previous[n].push(l)}const u=e.items.flatMap((e=>e[n]||[])),c=(0,je.groupBy)(u,(e=>t.getLabel(e.itemIndexes[0])));for(const t of Object.values(c))o.push({previous:l,items:t,level:e.level+1})}return"parents"===n&&(a.reverse(),a.forEach(((e,t)=>{e.forEach((e=>{e.level=t}))}))),a}class Ve{constructor(e){this.map=new Map,this.map=e||new Map}get(e){return this.map.get(e)}keys(){return this.map.keys()}values(){return this.map.values()}size(){return this.map.size}setCollapsedStatus(e,t){const n=new Map(this.map),r=this.map.get(e),i={...r,collapsed:t};for(const e of r.items)n.set(e,i);return new Ve(n)}setAllCollapsedStatus(e){const t=new Map(this.map);for(const n of this.map.keys()){const r={...this.map.get(n),collapsed:e};t.set(n,r)}return new Ve(t)}}class $e{constructor(e){this.map=new Map,this.threshold=.99,void 0!==e&&(this.threshold=e)}addTree(e){var t;const n=[e];for(;n.length;){const e=n.shift();(null==(t=e.parents)?void 0:t.length)&&this.addItem(e,e.parents[0]),e.children.length&&n.unshift(...e.children)}}addItem(e,t){if(t&&e.value>t.value*this.threshold&&1===t.children.length)if(this.map.has(t)){const n=this.map.get(t);this.map.set(e,n),n.items.push(e)}else{const n={items:[t,e],collapsed:!0};this.map.set(t,n),this.map.set(e,n)}}getCollapsedMap(){return new Ve(this.map)}}class Be{constructor(e,t,n=(0,_.createTheme)()){var r,i,a;this.data=e,this.options=t;const o=function(e){const t=[["label",[_.FieldType.string,_.FieldType.enum]],["level",[_.FieldType.number]],["value",[_.FieldType.number]],["self",[_.FieldType.number]]],n=[],r=[];for(const i of t){const[t,a]=i,o=null==e?void 0:e.fields.find((e=>e.name===t));o?a.includes(o.type)||r.push({name:t,expectedTypes:a,type:o.type}):n.push(t)}if(n.length>0||r.length>0)return{wrongTypeFields:r,missingFields:n}}(e);if(o)throw new Error(function(e){return e.missingFields.length?`Data is missing fields: ${e.missingFields.join(", ")}`:e.wrongTypeFields.length?`Data has fields of wrong type: ${e.wrongTypeFields.map((e=>`${e.name} has type ${e.type} but should be ${e.expectedTypes.join(" or ")}`)).join(", ")}`:""}(o));if(this.labelField=e.fields.find((e=>"label"===e.name)),this.levelField=e.fields.find((e=>"level"===e.name)),this.valueField=e.fields.find((e=>"value"===e.name)),this.selfField=e.fields.find((e=>"self"===e.name)),this.valueRightField=e.fields.find((e=>"valueRight"===e.name)),this.selfRightField=e.fields.find((e=>"selfRight"===e.name)),(this.valueField||this.selfField)&&(!this.valueField||!this.selfField))throw new Error("Malformed dataFrame: both valueRight and selfRight has to be present if one of them is present.");const s=null==(a=null==(i=null==(r=this.labelField)?void 0:r.config)?void 0:i.type)?void 0:a.enum;s?(this.labelDisplayProcessor=(0,_.getDisplayProcessor)({field:this.labelField,theme:n}),this.uniqueLabels=s.text||[]):(this.labelDisplayProcessor=e=>({text:e+"",numeric:0}),this.uniqueLabels=[...new Set(this.labelField.values)]),this.valueDisplayProcessor=(0,_.getDisplayProcessor)({field:this.valueField,theme:n})}isDiffFlamegraph(){return Boolean(this.valueRightField&&this.selfRightField)}getLabel(e){return this.labelDisplayProcessor(this.labelField.values[e]).text}getLevel(e){return this.levelField.values[e]}getValue(e){return ze(this.valueField,e)}getValueRight(e){return ze(this.valueRightField,e)}getSelf(e){return ze(this.selfField,e)}getSelfRight(e){return ze(this.selfRightField,e)}getSelfDisplay(e){return this.valueDisplayProcessor(this.getSelf(e))}getUniqueLabels(){return this.uniqueLabels}getUnitTitle(){switch(this.valueField.config.unit){case he.Bytes:return"RAM";case he.Nanoseconds:return"Time"}return"Count"}getLevels(){return this.initLevels(),this.levels}getSandwichLevels(e){const t=this.getNodesWithLabel(e);if(!(null==t?void 0:t.length))return[[],[]];var n;return[(n=this,Fe(function(e){return e.map((e=>{var t,n;if(!(null==(t=e.parents)?void 0:t.length))return e;const r={...e,children:[]},i=[{child:r,parent:e.parents[0]}];for(;i.length;){const e=i.shift(),t={...e.parent,children:e.child?[e.child]:[],parents:[]};e.child&&(t.value=e.child.value,e.child.parents=[t]),(null==(n=e.parent.parents)?void 0:n.length)&&i.push({child:t,parent:e.parent.parents[0]})}return r}))}(t),n,"parents")),Fe(t,this)]}getNodesWithLabel(e){return this.initLevels(),this.uniqueLabelsMap[e]}getCollapsedMap(){return this.initLevels(),this.collapsedMap}initLevels(){if(!this.levels){const[e,t,n]=function(e,t){const n=[];let r,i=0;const a=Object.create(null);for(let t=0;t<e.data.length;t++){const o=e.getLevel(t),s=t>0?e.getLevel(t-1):void 0;if(n[o]=n[o]||[],s&&s>=o){const t=n[o][n[o].length-1];i=t.start+e.getValue(t.itemIndexes[0])+e.getValueRight(t.itemIndexes[0]),r=t.parents[0]}const l={itemIndexes:[t],value:e.getValue(t)+e.getValueRight(t),valueRight:e.isDiffFlamegraph()?e.getValueRight(t):void 0,start:i,parents:r&&[r],children:[],level:o};a[e.getLabel(t)]?a[e.getLabel(t)].push(l):a[e.getLabel(t)]=[l],r&&r.children.push(l),r=l,n[o].push(l)}const o=new $e(null==t?void 0:t.collapsingThreshold);return(null==t?void 0:t.collapsing)&&o.addTree(n[0][0]),[n,a,o.getCollapsedMap()]}(this,this.options);this.levels=e,this.uniqueLabelsMap=t,this.collapsedMap=n}}}function ze(e,t){if(!e)return 0;return("number"==typeof t?[t]:t).reduce(((t,n)=>t+e.values[n]),0)}function Ue(e,t,n){void 0===t&&(t=0),void 0===n&&(n=[]);var r=function(e,t){void 0===t&&(t=0);var n=(0,o.useRef)(!1),r=(0,o.useRef)(),i=(0,o.useRef)(e),a=(0,o.useCallback)((function(){return n.current}),[]),s=(0,o.useCallback)((function(){n.current=!1,r.current&&clearTimeout(r.current),r.current=setTimeout((function(){n.current=!0,i.current()}),t)}),[t]),l=(0,o.useCallback)((function(){n.current=null,r.current&&clearTimeout(r.current)}),[]);return(0,o.useEffect)((function(){i.current=e}),[e]),(0,o.useEffect)((function(){return s(),l}),[t]),[a,l,s]}(e,t),i=r[0],a=r[1],s=r[2];return(0,o.useEffect)(s,n),[i,a]}var qe=n(219);const He=({search:e,setSearch:t,selectedView:n,setSelectedView:a,containerWidth:s,onReset:l,textAlign:u,onTextAlignChange:c,showResetButton:h,colorScheme:f,onColorSchemeChange:p,stickyHeader:m,extraHeaderElements:g,vertical:v,isDiffMode:y,setCollapsedMap:b,collapsedMap:w,assistantContext:S})=>{const x=(0,d.useStyles2)(Qe),[E,_]=function(e,t){const[n,r]=(0,o.useState)(e),i=(a=e,s=(0,o.useRef)(),(0,o.useEffect)((function(){s.current=a})),s.current);var a,s;return Ue((()=>{t(n)}),250,[n]),(0,o.useEffect)((()=>{i!==e&&e!==n&&r(e)}),[e,i,n]),[n,r]}(e,t),O=""!==E?(0,r.jsx)(d.Button,{icon:"times",fill:"text",size:"sm",onClick:()=>{t(""),_("")},children:"Clear"}):null;return(0,r.jsxs)("div",{className:(0,i.cx)(x.header,{[x.stickyHeader]:m}),children:[(0,r.jsx)("div",{className:x.inputContainer,children:(0,r.jsx)(d.Input,{value:E||"",onChange:e=>{_(e.currentTarget.value)},placeholder:"Search...",suffix:O})}),(0,r.jsxs)("div",{className:x.rightContainer,children:[!!(null==S?void 0:S.length)&&(0,r.jsx)("div",{className:x.buttonSpacing,children:(0,r.jsx)(qe.OpenAssistantButton,{origin:"grafana/flame-graph",prompt:"Analyze Flame Graph",context:S})}),h&&(0,r.jsx)(d.Button,{variant:"secondary",fill:"outline",size:"sm",icon:"history-alt",tooltip:"Reset focus and sandwich state",onClick:()=>{l()},className:x.buttonSpacing,"aria-label":"Reset focus and sandwich state"}),(0,r.jsx)(We,{value:f,onChange:p,isDiffMode:y}),(0,r.jsxs)(d.ButtonGroup,{className:x.buttonSpacing,children:[(0,r.jsx)(d.Button,{variant:"secondary",fill:"outline",size:"sm",tooltip:"Expand all groups",onClick:()=>{b(w.setAllCollapsedStatus(!1))},"aria-label":"Expand all groups",icon:"angle-double-down",disabled:n===fe.TopTable}),(0,r.jsx)(d.Button,{variant:"secondary",fill:"outline",size:"sm",tooltip:"Collapse all groups",onClick:()=>{b(w.setAllCollapsedStatus(!0))},"aria-label":"Collapse all groups",icon:"angle-double-up",disabled:n===fe.TopTable})]}),(0,r.jsx)(d.RadioButtonGroup,{size:"sm",disabled:n===fe.TopTable,options:Ge,value:u,onChange:c,className:x.buttonSpacing}),(0,r.jsx)(d.RadioButtonGroup,{size:"sm",options:Ke(s,v),value:n,onChange:a}),g&&(0,r.jsx)("div",{className:x.extraElements,children:g})]})]})};function We(e){const t=(0,d.useStyles2)(Qe);let n=(0,r.jsxs)(d.Menu,{children:[(0,r.jsx)(d.Menu.Item,{label:"By package name",onClick:()=>e.onChange(pe.PackageBased)}),(0,r.jsx)(d.Menu.Item,{label:"By value",onClick:()=>e.onChange(pe.ValueBased)})]});const a={[pe.ValueBased]:t.colorDotByValue,[pe.PackageBased]:t.colorDotByPackage,[me.DiffColorBlind]:t.colorDotDiffColorBlind,[me.Default]:t.colorDotDiffDefault}[e.value]||t.colorDotByValue;let o=(0,r.jsx)("span",{className:(0,i.cx)(t.colorDot,a)});return e.isDiffMode&&(n=(0,r.jsxs)(d.Menu,{children:[(0,r.jsx)(d.Menu.Item,{label:"Default (green to red)",onClick:()=>e.onChange(me.Default)}),(0,r.jsx)(d.Menu.Item,{label:"Color blind (blue to red)",onClick:()=>e.onChange(me.DiffColorBlind)})]}),o=(0,r.jsxs)("div",{className:(0,i.cx)(t.colorDotDiff,a),children:[(0,r.jsx)("div",{children:"-100% (removed)"}),(0,r.jsx)("div",{children:"0%"}),(0,r.jsx)("div",{children:"+100% (added)"})]})),(0,r.jsx)(d.Dropdown,{overlay:n,children:(0,r.jsx)(d.Button,{variant:"secondary",fill:"outline",size:"sm",tooltip:"Change color scheme",onClick:()=>{},className:t.buttonSpacing,"aria-label":"Change color scheme",children:o})})}const Ge=[{value:"left",description:"Align text left",icon:"align-left"},{value:"right",description:"Align text right",icon:"align-right"}];function Ke(e,t){let n=[{value:fe.TopTable,label:"Top Table",description:"Only show top table"},{value:fe.FlameGraph,label:"Flame Graph",description:"Only show flame graph"}];return(e>=800||t)&&n.push({value:fe.Both,label:"Both",description:"Show both the top table and flame graph"}),n}const Qe=e=>({header:(0,i.css)({label:"header",display:"flex",flexWrap:"wrap",justifyContent:"space-between",width:"100%",top:0,gap:e.spacing(1),marginTop:e.spacing(1)}),stickyHeader:(0,i.css)({zIndex:e.zIndex.navbarFixed,position:"sticky",background:e.colors.background.primary}),inputContainer:(0,i.css)({label:"inputContainer",flexGrow:1,minWidth:"150px",maxWidth:"350px"}),rightContainer:(0,i.css)({label:"rightContainer",display:"flex",alignItems:"flex-start",flexWrap:"wrap"}),buttonSpacing:(0,i.css)({label:"buttonSpacing",marginRight:e.spacing(1)}),resetButton:(0,i.css)({label:"resetButton",display:"flex",marginRight:e.spacing(2)}),resetButtonIconWrapper:(0,i.css)({label:"resetButtonIcon",padding:"0 5px",color:e.colors.text.disabled}),colorDot:(0,i.css)({label:"colorDot",display:"inline-block",width:"10px",height:"10px",borderRadius:e.shape.radius.circle}),colorDotDiff:(0,i.css)({label:"colorDotDiff",display:"flex",width:"200px",height:"12px",color:"white",fontSize:9,lineHeight:1.3,fontWeight:300,justifyContent:"space-between",padding:"0 2px",borderRadius:"2px"}),colorDotByValue:(0,i.css)({label:"colorDotByValue",background:ye}),colorDotByPackage:(0,i.css)({label:"colorDotByPackage",background:be}),colorDotDiffDefault:(0,i.css)({label:"colorDotDiffDefault",background:Ee}),colorDotDiffColorBlind:(0,i.css)({label:"colorDotDiffColorBlind",background:Oe}),extraElements:(0,i.css)({label:"extraElements",marginLeft:e.spacing(1)})});let Ye;Ye="undefined"!=typeof window?window:"undefined"!=typeof self?self:n.g;let Xe=null,Je=null;const Ze=Ye.clearTimeout,et=Ye.setTimeout,tt=Ye.cancelAnimationFrame||Ye.mozCancelAnimationFrame||Ye.webkitCancelAnimationFrame,nt=Ye.requestAnimationFrame||Ye.mozRequestAnimationFrame||Ye.webkitRequestAnimationFrame;function rt(e){let t,n,r,i,a,o,s;const l="undefined"!=typeof document&&document.attachEvent;if(!l){o=function(e){const t=e.__resizeTriggers__,n=t.firstElementChild,r=t.lastElementChild,i=n.firstElementChild;r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight,i.style.width=n.offsetWidth+1+"px",i.style.height=n.offsetHeight+1+"px",n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight},a=function(e){return e.offsetWidth!==e.__resizeLast__.width||e.offsetHeight!==e.__resizeLast__.height},s=function(e){if(e.target.className&&"function"==typeof e.target.className.indexOf&&e.target.className.indexOf("contract-trigger")<0&&e.target.className.indexOf("expand-trigger")<0)return;const t=this;o(this),this.__resizeRAF__&&Xe(this.__resizeRAF__),this.__resizeRAF__=Je((function(){a(t)&&(t.__resizeLast__.width=t.offsetWidth,t.__resizeLast__.height=t.offsetHeight,t.__resizeListeners__.forEach((function(n){n.call(t,e)})))}))};let e=!1,l="";r="animationstart";const u="Webkit Moz O ms".split(" ");let c="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),d="";{const t=document.createElement("fakeelement");if(void 0!==t.style.animationName&&(e=!0),!1===e)for(let n=0;n<u.length;n++)if(void 0!==t.style[u[n]+"AnimationName"]){d=u[n],l="-"+d.toLowerCase()+"-",r=c[n],e=!0;break}}n="resizeanim",t="@"+l+"keyframes "+n+" { from { opacity: 0; } to { opacity: 0; } } ",i=l+"animation: 1ms "+n+"; "}return{addResizeListener:function(a,u){if(l)a.attachEvent("onresize",u);else{if(!a.__resizeTriggers__){const l=a.ownerDocument,u=Ye.getComputedStyle(a);u&&"static"===u.position&&(a.style.position="relative"),function(n){if(!n.getElementById("detectElementResize")){const r=(t||"")+".resize-triggers { "+(i||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',a=n.head||n.getElementsByTagName("head")[0],o=n.createElement("style");o.id="detectElementResize",o.type="text/css",null!=e&&o.setAttribute("nonce",e),o.styleSheet?o.styleSheet.cssText=r:o.appendChild(n.createTextNode(r)),a.appendChild(o)}}(l),a.__resizeLast__={},a.__resizeListeners__=[],(a.__resizeTriggers__=l.createElement("div")).className="resize-triggers";const c=l.createElement("div");c.className="expand-trigger",c.appendChild(l.createElement("div"));const d=l.createElement("div");d.className="contract-trigger",a.__resizeTriggers__.appendChild(c),a.__resizeTriggers__.appendChild(d),a.appendChild(a.__resizeTriggers__),o(a),a.addEventListener("scroll",s,!0),r&&(a.__resizeTriggers__.__animationListener__=function(e){e.animationName===n&&o(a)},a.__resizeTriggers__.addEventListener(r,a.__resizeTriggers__.__animationListener__))}a.__resizeListeners__.push(u)}},removeResizeListener:function(e,t){if(l)e.detachEvent("onresize",t);else if(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),!e.__resizeListeners__.length){e.removeEventListener("scroll",s,!0),e.__resizeTriggers__.__animationListener__&&(e.__resizeTriggers__.removeEventListener(r,e.__resizeTriggers__.__animationListener__),e.__resizeTriggers__.__animationListener__=null);try{e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)}catch(e){}}}}}null==tt||null==nt?(Xe=Ze,Je=function(e){return et(e,20)}):(Xe=function([e,t]){tt(e),Ze(t)},Je=function(e){const t=nt((function(){Ze(n),e()})),n=et((function(){tt(t),e()}),20);return[t,n]});class it extends o.Component{constructor(...e){super(...e),this.state={height:this.props.defaultHeight||0,width:this.props.defaultWidth||0},this._autoSizer=null,this._detectElementResize=null,this._didLogDeprecationWarning=!1,this._parentNode=null,this._resizeObserver=null,this._timeoutId=null,this._onResize=()=>{this._timeoutId=null;const{disableHeight:e,disableWidth:t,onResize:n}=this.props;if(this._parentNode){const r=window.getComputedStyle(this._parentNode)||{},i=parseFloat(r.paddingLeft||"0"),a=parseFloat(r.paddingRight||"0"),o=parseFloat(r.paddingTop||"0"),s=parseFloat(r.paddingBottom||"0"),l=this._parentNode.getBoundingClientRect(),u=l.height-o-s,c=l.width-i-a;if(!e&&this.state.height!==u||!t&&this.state.width!==c){this.setState({height:u,width:c});const e=()=>{this._didLogDeprecationWarning||(this._didLogDeprecationWarning=!0,console.warn("scaledWidth and scaledHeight parameters have been deprecated; use width and height instead"))};"function"==typeof n&&n({height:u,width:c,get scaledHeight(){return e(),u},get scaledWidth(){return e(),c}})}}},this._setRef=e=>{this._autoSizer=e}}componentDidMount(){const{nonce:e}=this.props,t=this._autoSizer?this._autoSizer.parentNode:null;if(null!=t&&t.ownerDocument&&t.ownerDocument.defaultView&&t instanceof t.ownerDocument.defaultView.HTMLElement){this._parentNode=t;const n=t.ownerDocument.defaultView.ResizeObserver;null!=n?(this._resizeObserver=new n((()=>{this._timeoutId=setTimeout(this._onResize,0)})),this._resizeObserver.observe(t)):(this._detectElementResize=rt(e),this._detectElementResize.addResizeListener(t,this._onResize)),this._onResize()}}componentWillUnmount(){this._parentNode&&(this._detectElementResize&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize),null!==this._timeoutId&&clearTimeout(this._timeoutId),this._resizeObserver&&this._resizeObserver.disconnect())}render(){const{children:e,defaultHeight:t,defaultWidth:n,disableHeight:r=!1,disableWidth:i=!1,doNotBailOutOnEmptyChildren:a=!1,nonce:s,onResize:l,style:u={},tagName:c="div",...d}=this.props,{height:h,width:f}=this.state,p={overflow:"visible"},m={};let g=!1;return r||(0===h&&(g=!0),p.height=0,m.height=h,m.scaledHeight=h),i||(0===f&&(g=!0),p.width=0,m.width=f,m.scaledWidth=f),a&&(g=!1),(0,o.createElement)(c,{ref:this._setRef,style:{...p,...u},...d},!g&&e(m))}}const at=(0,o.memo)((({data:e,onSymbolClick:t,search:n,matchedLabels:i,onSearch:a,sandwichItem:s,onSandwich:l,onTableSort:u,colorScheme:c})=>{const h=(0,o.useMemo)((()=>function(e,t){let n=Object.create(null);const r=[];for(let i=0;i<e.data.length;i++){const a=e.getValue(i),o=e.getValueRight(i),s=e.getSelf(i),l=e.getLabel(i),u=e.getLevel(i);for(;r.length>u;)r.pop();const c=r.some((e=>e===l));t&&!t.has(l)||(n[l]=n[l]||{},n[l].self=n[l].self?n[l].self+s:s,c||(n[l].total=n[l].total?n[l].total+a:a,n[l].totalRight=n[l].totalRight?n[l].totalRight+o:o)),r.push(l)}return n}(e,i)),[e,i]),f=(0,d.useStyles2)(ut),p=(0,d.useTheme2)(),[m,g]=(0,o.useState)([{displayName:"Self",desc:!0}]);return(0,r.jsx)("div",{className:f.topTableContainer,"data-testid":"topTable",children:(0,r.jsx)(it,{style:{width:"100%"},children:({width:i,height:o})=>{if(i<3||o<3)return null;const f=function(e,t,n,i,a,o,s,l,u,c){const h=function(e,t,n,i){const a={type:d.TableCellDisplayMode.Custom,cellComponent:a=>(0,r.jsx)(lt,{frame:a.frame,onSandwich:e,onSearch:t,search:n,sandwichItem:i,rowIndex:a.rowIndex})},o={filterable:!1,width:st,hideHeader:!0,inspect:!1,align:"auto",cellOptions:a};return{type:_.FieldType.number,name:"actions",values:[],config:{custom:o}}}(o,a,u,c),f={type:_.FieldType.string,name:"Symbol",values:[],config:{custom:{width:n-st-2*x},links:[{title:"Highlight symbol",url:"",onClick:e=>{const t=e.origin.field.values[e.origin.rowIndex];i(t)}}]}};let p;if(e.isDiffFlamegraph()){f.config.custom.width=n-st-3*x;const r=ot("Baseline","percent"),i=ot("Comparison","percent"),a=ot("Diff","percent");a.config.custom.cellOptions.type=d.TableCellDisplayMode.ColorText;const[o,s]=l===me.DiffColorBlind?[_e[0],_e[2]]:[xe[0],xe[2]];a.config.mappings=[{type:_.MappingType.ValueToText,options:{[1/0]:{text:"new",color:s}}},{type:_.MappingType.ValueToText,options:{[-100]:{text:"removed",color:o}}},{type:_.MappingType.RangeToText,options:{from:0,to:1/0,result:{color:s}}},{type:_.MappingType.RangeToText,options:{from:-1/0,to:0,result:{color:o}}}];const u=e.getLevels(),c=u.length?u[0][0].value:0,m=u.length?u[0][0].valueRight:void 0;for(let e in t){h.values.push(null),f.values.push(e);const n=t[e].total,o=t[e].totalRight,s=c-m,l=Math.round(1e4*n/s)/100,u=Math.round(1e4*o/m)/100,d=(u-l)/l*100;a.values.push(d),r.values.push(l),i.values.push(u)}p={fields:[h,f,r,i,a],length:f.values.length}}else{const n=ot("Self",e.selfField.config.unit),r=ot("Total",e.valueField.config.unit);for(let e in t)h.values.push(null),f.values.push(e),n.values.push(t[e].self),r.values.push(t[e].total);p={fields:[h,f,n,r],length:f.values.length}}const m=(0,_.applyFieldOverrides)({data:[p],fieldConfig:{defaults:{},overrides:[]},replaceVariables:e=>e,theme:s});return m[0]}(e,h,i,t,a,l,p,c,n,s);return(0,r.jsx)(d.Table,{initialSortBy:m,onSortByChange:e=>{e&&e.length&&(null==u||u(e[0].displayName+"_"+(e[0].desc?"desc":"asc"))),g(e)},data:f,width:i,height:o})}})})}));function ot(e,t){const n={width:x,align:"auto",inspect:!1,cellOptions:{type:d.TableCellDisplayMode.Auto}};return{type:_.FieldType.number,name:e,values:[],config:{unit:t,custom:n}}}at.displayName="FlameGraphTopTableContainer";const st=61;function lt(e){var t;const n=ct(),i=null==(t=e.frame.fields.find((e=>"Symbol"===e.name)))?void 0:t.values[e.rowIndex],a=e.search===i,o=e.sandwichItem===i;return(0,r.jsxs)("div",{className:n.actionCellWrapper,children:[(0,r.jsx)(d.IconButton,{className:n.actionCellButton,name:"search",variant:a?"primary":"secondary",tooltip:a?"Clear from search":"Search for symbol","aria-label":a?"Clear from search":"Search for symbol",onClick:()=>{e.onSearch(a?"":i)}}),(0,r.jsx)(d.IconButton,{className:n.actionCellButton,name:"gf-show-context",tooltip:o?"Remove from sandwich view":"Show in sandwich view",variant:o?"primary":"secondary","aria-label":o?"Remove from sandwich view":"Show in sandwich view",onClick:()=>{e.onSandwich(o?void 0:i)}})]})}const ut=e=>({topTableContainer:(0,i.css)({label:"topTableContainer",padding:e.spacing(1),backgroundColor:e.colors.background.secondary,height:"100%"})}),ct=()=>({actionCellWrapper:(0,i.css)({label:"actionCellWrapper",display:"flex",height:"24px"}),actionCellButton:(0,i.css)({label:"actionCellButton",marginRight:0,width:"24px"})});function dt(e){var t,n;return(null==(n=null==(t=e.meta)?void 0:t.custom)?void 0:n.assistantContext)||[]}const ht=new a.A,ft=({data:e,onTableSymbolClick:t,onViewSelected:n,onTextAlignSelected:a,onTableSort:s,getTheme:l,stickyHeader:u,extraHeaderElements:h,vertical:f,showFlameGraphOnly:p,disableCollapsing:m,keepFocusOnDataChange:g,getExtraContextMenuButtons:v,showAnalyzeWithAssistant:y=!0})=>{const[b,w]=(0,o.useState)(),[S,x]=(0,o.useState)(0),[E,_]=(0,o.useState)(1),[O,k]=(0,o.useState)(""),[T,C]=(0,o.useState)(fe.Both),[I,{width:R}]=c(),[A,N]=(0,o.useState)("left"),[D,L]=(0,o.useState)(),[P,M]=(0,o.useState)(new Ve),j=(0,o.useMemo)((()=>l()),[l]),F=(0,o.useMemo)((()=>{if(!e)return;const t=new Be(e,{collapsing:!m},j);return M(t.getCollapsedMap()),t}),[e,j,m]),[V,$]=function(e){const t=(null==e?void 0:e.isDiffFlamegraph())?me.Default:pe.PackageBased,[n,r]=(0,o.useState)(t);return(0,o.useEffect)((()=>{r(t)}),[t]),[n,r]}(F),B=function(e){return{container:(0,i.css)({label:"container",overflow:"auto",height:"100%",display:"flex",flex:"1 1 0",flexDirection:"column",minHeight:0,gap:e.spacing(1)}),body:(0,i.css)({label:"body",flexGrow:1}),tableContainer:(0,i.css)({height:800}),horizontalContainer:(0,i.css)({label:"horizontalContainer",display:"flex",minHeight:0,flexDirection:"row",columnGap:e.spacing(1),width:"100%"}),horizontalGraphContainer:(0,i.css)({flexBasis:"50%"}),horizontalTableContainer:(0,i.css)({flexBasis:"50%",maxHeight:800}),verticalGraphContainer:(0,i.css)({marginBottom:e.spacing(1)}),verticalTableContainer:(0,i.css)({height:800})}}(j),z=function(e,t){return(0,o.useMemo)((()=>{if(e&&t)return function(e,t){const n=new Set,r=e.split(","),i=(e,t)=>{let r;try{r=new RegExp(t)}catch(e){return!1}let i=!1;for(let t of e)r.test(t)&&(n.add(t),i=!0);return i},a=(e,t)=>{let r=ht.filter(e,t);if(!r)return!1;let i=!1;for(let t of r)n.add(e[t]),i=!0;return i};for(let e of r){if(!e)continue;i(t.getUniqueLabels(),e)||a(t.getUniqueLabels(),e)}return n}(e,t)}),[e,t])}(O,F);(0,o.useEffect)((()=>{R>0&&R<800&&T===fe.Both&&!f&&C(fe.FlameGraph)}),[T,C,R,f]);const U=(0,o.useCallback)((()=>{w(void 0),x(0),_(1)}),[w,_,x]),q=(0,o.useCallback)((()=>{L(void 0)}),[L]);(0,o.useEffect)((()=>{var e;if(!g)return U(),void q();if(F&&b){const t=null==(e=F.getNodesWithLabel(b.label))?void 0:e[0];if(t){w({...b,item:t});const e=F.getLevels(),n=e.length?e[0][0].value:0;x(t.start/n),_((t.start+t.value)/n)}else w({...b,item:{start:0,value:0,itemIndexes:[],children:[],level:0}}),x(0),_(1)}}),[F,g]);const H=(0,o.useCallback)((e=>{O===e?k(""):(null==t||t(e),k(e),U())}),[k,U,t,O]);if(!F)return null;const W=(0,r.jsx)(Pe,{data:F,rangeMin:S,rangeMax:E,matchedLabels:z,setRangeMin:x,setRangeMax:_,onItemFocused:e=>w(e),focusedItemData:b,textAlign:A,sandwichItem:D,onSandwich:e=>{U(),L(e)},onFocusPillClick:U,onSandwichPillClick:q,colorScheme:V,showFlameGraphOnly:p,collapsing:!m,getExtraContextMenuButtons:v,selectedView:T,search:O,collapsedMap:P,setCollapsedMap:M}),G=(0,r.jsx)(at,{data:F,onSymbolClick:H,search:O,matchedLabels:z,sandwichItem:D,onSandwich:L,onSearch:k,onTableSort:s,colorScheme:V});let K;return p||T===fe.FlameGraph?K=W:T===fe.TopTable?K=(0,r.jsx)("div",{className:B.tableContainer,children:G}):T===fe.Both&&(K=f?(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:B.verticalGraphContainer,children:W}),(0,r.jsx)("div",{className:B.verticalTableContainer,children:G})]}):(0,r.jsxs)("div",{className:B.horizontalContainer,children:[(0,r.jsx)("div",{className:B.horizontalTableContainer,children:G}),(0,r.jsx)("div",{className:B.horizontalGraphContainer,children:W})]})),(0,r.jsx)(d.ThemeContext.Provider,{value:j,children:(0,r.jsxs)("div",{ref:I,className:B.container,children:[!p&&(0,r.jsx)(He,{search:O,setSearch:k,selectedView:T,setSelectedView:e=>{C(e),null==n||n(e)},containerWidth:R,onReset:()=>{U(),q()},textAlign:A,onTextAlignChange:e=>{N(e),null==a||a(e)},showResetButton:Boolean(b||D),colorScheme:V,onColorSchemeChange:$,stickyHeader:Boolean(u),extraHeaderElements:h,vertical:f,isDiffMode:F.isDiffFlamegraph(),setCollapsedMap:M,collapsedMap:P,assistantContext:e&&y?dt(e):void 0}),(0,r.jsx)("div",{className:B.body,children:K})]})})}},1305:(e,t,n)=>{"use strict";n.d(t,{mN:()=>i,oL:()=>a});n(8531);var r=n(8449);const i="grafana-llm-app",a=`/api/plugins/${i}`;new r.SemVer("0.2.0")},9239:(e,t,n)=>{"use strict";n.d(t,{qA:()=>x,qH:()=>E});var r=n(7781),i=n(8531),a=(n(5959),n(1269)),o=n(5096),s=n(4370);function l(e,t){return(0,o.N)((function(n,r){var i=0;n.subscribe((0,s._)(r,(function(n){return e.call(t,n,i++)&&r.next(n)})))}))}var u=n(7708);function c(e,t){return(0,o.N)(function(e,t,n,r,i){return function(a,o){var l=n,u=t,c=0;a.subscribe((0,s._)(o,(function(t){var n=c++;u=l?e(u,t,n):(l=!0,t),r&&o.next(u)}),i&&function(){l&&o.next(u),o.complete()}))}}(e,t,arguments.length>=2,!0))}var d=n(1693),h=n(3887);const f={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let p;const m=new Uint8Array(16);const g=[];for(let e=0;e<256;++e)g.push((e+256).toString(16).slice(1));function v(e,t=0){return(g[e[t+0]]+g[e[t+1]]+g[e[t+2]]+g[e[t+3]]+"-"+g[e[t+4]]+g[e[t+5]]+"-"+g[e[t+6]]+g[e[t+7]]+"-"+g[e[t+8]]+g[e[t+9]]+"-"+g[e[t+10]]+g[e[t+11]]+g[e[t+12]]+g[e[t+13]]+g[e[t+14]]+g[e[t+15]]).toLowerCase()}const y=function(e,t,n){if(f.randomUUID&&!t&&!e)return f.randomUUID();const r=(e=e||{}).random??e.rng?.()??function(){if(!p){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");p=crypto.getRandomValues.bind(crypto)}return p(m)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){if((n=n||0)<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return v(r)};var b=n(1305);const w="llm/v1/chat/completions";function S(e){return"error"in e}function x(){return(0,a.pipe)((0,a.pipe)(l((e=>e.choices.length>0&&"content"in e.choices[0].delta)),(0,u.T)((e=>e.choices[0].delta.content))),c(((e,t)=>e+t),""))}function E(e){const t={scope:r.LiveChannelScope.Plugin,namespace:b.mN,path:w+"/"+y(),data:e};return(0,i.getGrafanaLiveSrv)().getStream(t).pipe(l((e=>(0,r.isLiveChannelMessageEvent)(e)))).pipe(l((e=>!!e.message.choices)),function(e,t,n){var r=(0,d.T)(e)||t||n?{next:e,error:t,complete:n}:e;return r?(0,o.N)((function(e,t){var n;null===(n=r.subscribe)||void 0===n||n.call(r);var i=!0;e.subscribe((0,s._)(t,(function(e){var n;null===(n=r.next)||void 0===n||n.call(r,e),t.next(e)}),(function(){var e;i=!1,null===(e=r.complete)||void 0===e||e.call(r),t.complete()}),(function(e){var n;i=!1,null===(n=r.error)||void 0===n||n.call(r,e),t.error(e)}),(function(){var e,t;i&&(null===(e=r.unsubscribe)||void 0===e||e.call(r)),null===(t=r.finalize)||void 0===t||t.call(r)})))})):h.D}((e=>{if(S(e.message))throw new Error(e.message.error)})),(n=e=>!(!S(e.message)&&(e.message.choices&&e.message.choices[0].delta&&"done"in e.message.choices[0].delta&&!0===e.message.choices[0].delta.done||e.message.choices&&"finish_reason"in e.message.choices[0]&&"stop"===e.message.choices[0].finish_reason)),void 0===a&&(a=!1),(0,o.N)((function(e,t){var r=0;e.subscribe((0,s._)(t,(function(e){var i=n(e,r++);(i||a)&&t.next(e),!i&&t.complete()})))}))),(0,u.T)((e=>e.message)));var n,a}},3604:(e,t,n)=>{"use strict";n.d(t,{Sn:()=>a});var r=n(8531),i=n(1305);const a=async()=>{try{if(!(await(0,r.getBackendSrv)().get(`${i.oL}/settings`)).enabled)return!1;const e=(await(0,r.getBackendSrv)().get(`${i.oL}/health`)).details;return e.llmProvider?e.llmProvider.configured&&e.llmProvider.ok:!!e.openAI&&(e.openAI.configured&&e.openAI.ok)}catch(e){return!1}}},1625:(e,t,n)=>{"use strict";n.d(t,{$l:()=>s,$m:()=>d,L4:()=>r,T6:()=>u,TZ:()=>l,eX:()=>o,ob:()=>c,on:()=>i,vp:()=>h,xB:()=>a});var r=(e=>(e.Linear="linear",e.Log="log",e.Ordinal="ordinal",e.Symlog="symlog",e))(r||{}),i=(e=>(e.Hue="hue",e.None="none",e.Opacity="opacity",e.Scheme="scheme",e))(i||{});var a=(e=>(e.Ascending="asc",e.Descending="desc",e.None="none",e))(a||{});var o=(e=>(e.Basic="basic",e.Gradient="gradient",e.Lcd="lcd",e))(o||{}),s=(e=>(e.Color="color",e.Hidden="hidden",e.Text="text",e))(s||{}),l=(e=>(e.Auto="auto",e.Hidden="hidden",e.Left="left",e.Top="top",e))(l||{}),u=(e=>(e.Auto="auto",e.Manual="manual",e))(u||{}),c=(e=>(e.Actions="actions",e.Auto="auto",e.BasicGauge="basic",e.ColorBackground="color-background",e.ColorBackgroundSolid="color-background-solid",e.ColorText="color-text",e.Custom="custom",e.DataLinks="data-links",e.Gauge="gauge",e.GradientGauge="gradient-gauge",e.Image="image",e.JSONView="json-view",e.LcdGauge="lcd-gauge",e.Pill="pill",e.Sparkline="sparkline",e))(c||{});var d=(e=>(e.CSV="csv",e.Date="date",e.Distributed="distributed",e.DoubleQuote="doublequote",e.Glob="glob",e.HTML="html",e.JSON="json",e.Join="join",e.Lucene="lucene",e.PercentEncode="percentencode",e.Pipe="pipe",e.QueryParam="queryparam",e.Raw="raw",e.Regex="regex",e.SQLString="sqlstring",e.SingleQuote="singlequote",e.Text="text",e.UriEncode="uriencode",e))(d||{});const h="browser"},7993:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});const r=(e,t)=>e>t?1:e<t?-1:0,i=1/0,a=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o="eexxaacctt",s=/\p{P}/gu,l=["en",{numeric:!0,sensitivity:"base"}],u=(e,t,n)=>e.replace("A-Z",t).replace("a-z",n),c={unicode:!1,alpha:null,interSplit:"[^A-Za-z\\d']+",intraSplit:"[a-z][A-Z]",interBound:"[^A-Za-z\\d]",intraBound:"[A-Za-z]\\d|\\d[A-Za-z]|[a-z][A-Z]",interLft:0,interRgt:0,interChars:".",interIns:i,intraChars:"[a-z\\d']",intraIns:null,intraContr:"'[a-z]{1,2}\\b",intraMode:0,intraSlice:[1,i],intraSub:null,intraTrn:null,intraDel:null,intraFilt:(e,t,n)=>!0,toUpper:e=>e.toLocaleUpperCase(),toLower:e=>e.toLocaleLowerCase(),compare:null,sort:(e,t,n,i=r)=>{let{idx:a,chars:o,terms:s,interLft2:l,interLft1:u,start:c,intraIns:d,interIns:h,cases:f}=e;return a.map(((e,t)=>t)).sort(((e,n)=>o[n]-o[e]||d[e]-d[n]||s[n]+l[n]+.5*u[n]-(s[e]+l[e]+.5*u[e])||h[e]-h[n]||c[e]-c[n]||f[n]-f[e]||i(t[a[e]],t[a[n]])))}},d=(e,t)=>0==t?"":1==t?e+"??":t==i?e+"*?":e+`{0,${t}}?`,h="(?:\\b|_)";function f(e){e=Object.assign({},c,e);let{unicode:t,interLft:n,interRgt:i,intraMode:f,intraSlice:p,intraIns:g,intraSub:v,intraTrn:y,intraDel:b,intraContr:w,intraSplit:S,interSplit:x,intraBound:E,interBound:_,intraChars:O,toUpper:k,toLower:T,compare:C}=e;g??=f,v??=f,y??=f,b??=f,C??="undefined"==typeof Intl?r:new Intl.Collator(...l).compare;let I=e.letters??e.alpha;if(null!=I){let e=k(I),t=T(I);x=u(x,e,t),S=u(S,e,t),_=u(_,e,t),E=u(E,e,t),O=u(O,e,t),w=u(w,e,t)}let R=t?"u":"";const A='".+?"',N=new RegExp(A,"gi"+R),D=new RegExp(`(?:\\s+|^)-(?:${O}+|${A})`,"gi"+R);let{intraRules:L}=e;null==L&&(L=e=>{let t=c.intraSlice,n=0,r=0,i=0,a=0;if(/[^\d]/.test(e)){let o=e.length;o<=4?o>=3&&(i=Math.min(y,1),4==o&&(n=Math.min(g,1))):(t=p,n=g,r=v,i=y,a=b)}return{intraSlice:t,intraIns:n,intraSub:r,intraTrn:i,intraDel:a}});let P=!!S,M=new RegExp(S,"g"+R),j=new RegExp(x,"g"+R),F=new RegExp("^"+x+"|"+x+"$","g"+R),V=new RegExp(w,"gi"+R);const $=(e,t=!1)=>{let n=[];e=(e=e.replace(N,(e=>(n.push(e),o)))).replace(F,""),t||(e=T(e)),P&&(e=e.replace(M,(e=>e[0]+" "+e[1])));let r=0;return e.split(j).filter((e=>""!=e)).map((e=>e===o?n[r++]:e))},B=/[^\d]+|\d+/g,z=(t,r=0,o=!1)=>{let s=$(t);if(0==s.length)return[];let l,u=Array(s.length).fill("");if(s=s.map(((e,t)=>e.replace(V,(e=>(u[t]=e,""))))),1==f)l=s.map(((e,t)=>{if('"'===e[0])return a(e.slice(1,-1));let n="";for(let r of e.matchAll(B)){let e=r[0],{intraSlice:i,intraIns:a,intraSub:o,intraTrn:s,intraDel:l}=L(e);if(a+o+s+l==0)n+=e+u[t];else{let[r,c]=i,h=e.slice(0,r),f=e.slice(c),p=e.slice(r,c);1==a&&1==h.length&&h!=p[0]&&(h+="(?!"+h+")");let m=p.length,g=[e];if(o)for(let e=0;e<m;e++)g.push(h+p.slice(0,e)+O+p.slice(e+1)+f);if(s)for(let e=0;e<m-1;e++)p[e]!=p[e+1]&&g.push(h+p.slice(0,e)+p[e+1]+p[e]+p.slice(e+2)+f);if(l)for(let e=0;e<m;e++)g.push(h+p.slice(0,e+1)+"?"+p.slice(e+1)+f);if(a){let e=d(O,1);for(let t=0;t<m;t++)g.push(h+p.slice(0,t)+e+p.slice(t)+f)}n+="(?:"+g.join("|")+")"+u[t]}}return n}));else{let e=d(O,g);2==r&&g>0&&(e=")("+e+")("),l=s.map(((t,n)=>'"'===t[0]?a(t.slice(1,-1)):t.split("").map(((e,t,n)=>(1==g&&0==t&&n.length>1&&e!=n[t+1]&&(e+="(?!"+e+")"),e))).join(e)+u[n]))}let c=2==n?h:"",p=2==i?h:"",m=p+d(e.interChars,e.interIns)+c;return r>0?o?l=c+"("+l.join(")"+p+"|"+c+"(")+")"+p:(l="("+l.join(")("+m+")(")+")",l="(.??"+c+")"+l+"("+p+".*)"):(l=l.join(m),l=c+l+p),[new RegExp(l,"i"+R),s,u]},U=(e,t,n)=>{let[r]=z(t);if(null==r)return null;let i=[];if(null!=n)for(let t=0;t<n.length;t++){let a=n[t];r.test(e[a])&&i.push(a)}else for(let t=0;t<e.length;t++)r.test(e[t])&&i.push(t);return i};let q=!!E,H=new RegExp(_,R),W=new RegExp(E,R);const G=(t,r,a)=>{let[o,s,l]=z(a,1),u=$(a,!0),[c]=z(a,2),d=s.length,h=Array(d),f=Array(d);for(let e=0;e<d;e++){let t=s[e],n=u[e],r='"'==t[0]?t.slice(1,-1):t+l[e],i='"'==n[0]?n.slice(1,-1):n+l[e];h[e]=r,f[e]=i}let p=t.length,m=Array(p).fill(0),g={idx:Array(p),start:m.slice(),chars:m.slice(),cases:m.slice(),terms:m.slice(),interIns:m.slice(),intraIns:m.slice(),interLft2:m.slice(),interRgt2:m.slice(),interLft1:m.slice(),interRgt1:m.slice(),ranges:Array(p)},v=1==n||1==i,y=0;for(let a=0;a<t.length;a++){let s=r[t[a]],l=s.match(o),u=l.index+l[1].length,p=u,m=!1,b=0,w=0,S=0,x=0,E=0,_=0,O=0,k=0,C=0,I=[];for(let t=0,r=2;t<d;t++,r+=2){let a=T(l[r]),o=h[t],c=f[t],g=o.length,y=a.length,A=a==o;if(l[r]==c&&O++,!A&&l[r+1].length>=g){let e=T(l[r+1]).indexOf(o);e>-1&&(I.push(p,y,e,g),p+=K(l,r,e,g),a=o,y=g,A=!0,0==t&&(u=p))}if(v||A){let e=p-1,c=p+y,d=!1,h=!1;if(-1==e||H.test(s[e]))A&&b++,d=!0;else{if(2==n){m=!0;break}if(q&&W.test(s[e]+s[e+1]))A&&w++,d=!0;else if(1==n){let e=l[r+1],n=p+y;if(e.length>=g){let i,c=0,h=!1,f=new RegExp(o,"ig"+R);for(;i=f.exec(e);){c=i.index;let e=n+c,t=e-1;if(-1==t||H.test(s[t])){b++,h=!0;break}if(W.test(s[t]+s[e])){w++,h=!0;break}}h&&(d=!0,I.push(p,y,c,g),p+=K(l,r,c,g),a=o,y=g,A=!0,0==t&&(u=p))}if(!d){m=!0;break}}}if(c==s.length||H.test(s[c]))A&&S++,h=!0;else{if(2==i){m=!0;break}if(q&&W.test(s[c-1]+s[c]))A&&x++,h=!0;else if(1==i){m=!0;break}}A&&(E+=g,d&&h&&_++)}if(y>g&&(C+=y-g),t>0&&(k+=l[r-1].length),!e.intraFilt(o,a,p)){m=!0;break}t<d-1&&(p+=y+l[r+1].length)}if(!m){g.idx[y]=t[a],g.interLft2[y]=b,g.interLft1[y]=w,g.interRgt2[y]=S,g.interRgt1[y]=x,g.chars[y]=E,g.terms[y]=_,g.cases[y]=O,g.interIns[y]=k,g.intraIns[y]=C,g.start[y]=u;let e=s.match(c),n=e.index+e[1].length,r=I.length,i=r>0?0:1/0,o=r-4;for(let t=2;t<e.length;){let r=e[t].length;if(i<=o&&I[i]==n){let r=I[i+1],a=I[i+2],o=I[i+3],s=t,l="";for(let t=0;t<r;s++)l+=e[s],t+=e[s].length;e.splice(t,s-t,l),n+=K(e,t,a,o),i+=4}else n+=r,t++}n=e.index+e[1].length;let l=g.ranges[y]=[],d=n,h=n;for(let t=2;t<e.length;t++){let r=e[t].length;n+=r,t%2==0?h=n:r>0&&(l.push(d,h),d=h=n)}h>d&&l.push(d,h),y++}}if(y<t.length)for(let e in g)g[e]=g[e].slice(0,y);return g},K=(e,t,n,r)=>{let i=e[t]+e[t+1].slice(0,n);return e[t-1]+=i,e[t]=e[t+1].slice(n,n+r),e[t+1]=e[t+1].slice(n+r),i.length};return{search:(...t)=>((t,n,r,i=1e3,o)=>{r=r?!0===r?5:r:0;let l=null,u=null,c=[];n=n.replace(D,(e=>{let t=e.trim().slice(1);return t='"'===t[0]?a(t.slice(1,-1)):t.replace(s,""),""!=t&&c.push(t),""}));let d,h=$(n);if(c.length>0){if(d=new RegExp(c.join("|"),"i"+R),0==h.length){let e=[];for(let n=0;n<t.length;n++)d.test(t[n])||e.push(n);return[e,null,null]}}else if(0==h.length)return[null,null,null];if(r>0){let e=$(n);if(e.length>1){let n=e.slice().sort(((e,t)=>t.length-e.length));for(let e=0;e<n.length;e++){if(0==o?.length)return[[],null,null];o=U(t,n[e],o)}if(e.length>r)return[o,null,null];l=m(e).map((e=>e.join(" "))),u=[];let i=new Set;for(let e=0;e<l.length;e++)if(i.size<o.length){let n=o.filter((e=>!i.has(e))),r=U(t,l[e],n);for(let e=0;e<r.length;e++)i.add(r[e]);u.push(r)}else u.push([])}}null==l&&(l=[n],u=[o?.length>0?o:U(t,n)]);let f=null,p=null;if(c.length>0&&(u=u.map((e=>e.filter((e=>!d.test(t[e])))))),u.reduce(((e,t)=>e+t.length),0)<=i){f={},p=[];for(let n=0;n<u.length;n++){let r=u[n];if(null==r||0==r.length)continue;let i=l[n],a=G(r,t,i),o=e.sort(a,t,i,C);if(n>0)for(let e=0;e<o.length;e++)o[e]+=p.length;for(let e in a)f[e]=(f[e]??[]).concat(a[e]);p=p.concat(o)}}return[[].concat(...u),f,p]})(...t),split:$,filter:U,info:G,sort:e.sort}}const p=(()=>{let e={A:"ÁÀÃÂÄĄĂÅ",a:"áàãâäąăå",E:"ÉÈÊËĖĚ",e:"éèêëęě",I:"ÍÌÎÏĮİ",i:"íìîïįı",O:"ÓÒÔÕÖ",o:"óòôõö",U:"ÚÙÛÜŪŲŮŰ",u:"úùûüūųůű",C:"ÇČĆ",c:"çčć",D:"Ď",d:"ď",G:"Ğ",g:"ğ",L:"Ł",l:"ł",N:"ÑŃŇ",n:"ñńň",S:"ŠŚȘŞ",s:"šśșş",T:"ŢȚŤ",t:"ţțť",Y:"Ý",y:"ý",Z:"ŻŹŽ",z:"żźž"},t={},n="";for(let r in e)e[r].split("").forEach((e=>{n+=e,t[e]=r}));let r=new RegExp(`[${n}]`,"g"),i=e=>t[e];return e=>{if("string"==typeof e)return e.replace(r,i);let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=e[n].replace(r,i);return t}})();function m(e){let t,n,r=(e=e.slice()).length,i=[e.slice()],a=new Array(r).fill(0),o=1;for(;o<r;)a[o]<o?(t=o%2&&a[o],n=e[o],e[o]=e[t],e[t]=n,++a[o],o=1,i.push(e.slice())):(a[o]=0,++o);return i}const g=(e,t)=>t?`<mark>${e}</mark>`:e,v=(e,t)=>e+t;f.latinize=p,f.permute=e=>m([...Array(e.length).keys()]).sort(((e,t)=>{for(let n=0;n<e.length;n++)if(e[n]!=t[n])return e[n]-t[n];return 0})).map((t=>t.map((t=>e[t])))),f.highlight=function(e,t,n=g,r="",i=v){r=i(r,n(e.substring(0,t[0]),!1))??r;for(let a=0;a<t.length;a+=2){let o=t[a],s=t[a+1];r=i(r,n(e.substring(o,s),!0))??r,a<t.length-3&&(r=i(r,n(e.substring(t[a+1],t[a+2]),!1))??r)}return r=i(r,n(e.substring(t[t.length-1]),!1))??r}},5540:(e,t,n)=>{"use strict";n.d(t,{w:()=>i});var r=n(5959);function i(e){const{ref:t,box:n,onResize:i}=e;(0,r.useEffect)((()=>{let e=null==t?void 0:t.current;if(e){if(void 0===window.ResizeObserver)return window.addEventListener("resize",i,!1),()=>{window.removeEventListener("resize",i,!1)};{const t=new window.ResizeObserver((e=>{e.length&&i()}));return t.observe(e,{box:n}),()=>{e&&t.unobserve(e)}}}}),[i,t,n])}},7528:(e,t,n)=>{"use strict";n.d(t,{m:()=>a});var r=n(7794),i=n(9106),a=new class extends r.Q{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!i.S$&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e((e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()}))}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach((t=>{t(e)}))}isFocused(){return"boolean"==typeof this.#e?this.#e:"hidden"!==globalThis.document?.visibilityState}}},9304:(e,t,n)=>{"use strict";n.d(t,{$:()=>s,s:()=>o});var r=n(3403),i=n(8546),a=n(5610),o=class extends i.k{#r;#i;#a;constructor(e){super(),this.mutationId=e.mutationId,this.#i=e.mutationCache,this.#r=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#r.includes(e)||(this.#r.push(e),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#r=this.#r.filter((t=>t!==e)),this.scheduleGc(),this.#i.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#r.length||("pending"===this.state.status?this.scheduleGc():this.#i.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(e){this.#a=(0,a.II)({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{this.#o({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#i.canRun(this)});const t="pending"===this.state.status,n=!this.#a.canStart();try{if(!t){this.#o({type:"pending",variables:e,isPaused:n}),await(this.#i.config.onMutate?.(e,this));const t=await(this.options.onMutate?.(e));t!==this.state.context&&this.#o({type:"pending",context:t,variables:e,isPaused:n})}const r=await this.#a.start();return await(this.#i.config.onSuccess?.(r,e,this.state.context,this)),await(this.options.onSuccess?.(r,e,this.state.context)),await(this.#i.config.onSettled?.(r,null,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(r,null,e,this.state.context)),this.#o({type:"success",data:r}),r}catch(t){try{throw await(this.#i.config.onError?.(t,e,this.state.context,this)),await(this.options.onError?.(t,e,this.state.context)),await(this.#i.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(void 0,t,e,this.state.context)),t}finally{this.#o({type:"error",error:t})}}finally{this.#i.runNext(this)}}#o(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),r.j.batch((()=>{this.#r.forEach((t=>{t.onMutationUpdate(e)})),this.#i.notify({mutation:this,type:"updated",action:e})}))}};function s(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},3403:(e,t,n)=>{"use strict";n.d(t,{j:()=>r});var r=function(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=e=>setTimeout(e,0);const a=r=>{t?e.push(r):i((()=>{n(r)}))},o=()=>{const t=e;e=[],t.length&&i((()=>{r((()=>{t.forEach((e=>{n(e)}))}))}))};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a((()=>{e(...t)}))},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}()},4841:(e,t,n)=>{"use strict";n.d(t,{t:()=>a});var r=n(7794),i=n(9106),a=new class extends r.Q{#s=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!i.S$&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#s!==e&&(this.#s=e,this.listeners.forEach((t=>{t(e)})))}isOnline(){return this.#s}}},2015:(e,t,n)=>{"use strict";n.d(t,{X:()=>s,k:()=>l});var r=n(9106),i=n(3403),a=n(5610),o=n(8546),s=class extends o.k{#l;#u;#c;#a;#d;#h;constructor(e){super(),this.#h=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#l=e.state||function(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,r=n?"function"==typeof e.initialDataUpdatedAt?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"}}(this.options),this.state=this.#l,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(e){this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#c.remove(this)}setData(e,t){const n=(0,r.pl)(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(r.lQ).catch(r.lQ):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#l)}isActive(){return this.observers.some((e=>!1!==(0,r.Eh)(e.options.enabled,this)))}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some((e=>e.getCurrentResult().isStale)):void 0===this.state.data)}isStaleByTime(e=0){return this.state.isInvalidated||void 0===this.state.data||!(0,r.j3)(this.state.dataUpdatedAt,e)}onFocus(){const e=this.observers.find((e=>e.shouldFetchOnWindowFocus()));e?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){const e=this.observers.find((e=>e.shouldFetchOnReconnect()));e?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#c.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter((t=>t!==e)),this.observers.length||(this.#a&&(this.#h?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#c.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}fetch(e,t){if("idle"!==this.state.fetchStatus)if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find((e=>e.options.queryFn));e&&this.setOptions(e.options)}const n=new AbortController,i=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#h=!0,n.signal)})},o={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>{const e=(0,r.ZM)(this.options,t),n={queryKey:this.queryKey,meta:this.meta};return i(n),this.#h=!1,this.options.persister?this.options.persister(e,n,this):e(n)}};i(o),this.options.behavior?.onFetch(o,this),this.#u=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===o.fetchOptions?.meta||this.#o({type:"fetch",meta:o.fetchOptions?.meta});const s=e=>{(0,a.wm)(e)&&e.silent||this.#o({type:"error",error:e}),(0,a.wm)(e)||(this.#c.config.onError?.(e,this),this.#c.config.onSettled?.(this.state.data,e,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.#a=(0,a.II)({initialPromise:t?.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:e=>{void 0!==e?(this.setData(e),this.#c.config.onSuccess?.(e,this),this.#c.config.onSettled?.(e,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1):s(new Error(`${this.queryHash} data is undefined`))},onError:s,onFail:(e,t)=>{this.#o({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}),this.#a.start()}#o(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...l(t.data,this.options),fetchMeta:e.meta??null};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const n=e.error;return(0,a.wm)(n)&&n.revert&&this.#u?{...this.#u,fetchStatus:"idle"}:{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),i.j.batch((()=>{this.observers.forEach((e=>{e.onQueryUpdate()})),this.#c.notify({query:this,type:"updated",action:e})}))}};function l(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,a.v_)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}},9398:(e,t,n)=>{"use strict";n.d(t,{E:()=>g});var r=n(9106),i=n(2015),a=n(3403),o=n(7794),s=class extends o.Q{constructor(e={}){super(),this.config=e,this.#f=new Map}#f;build(e,t,n){const a=t.queryKey,o=t.queryHash??(0,r.F$)(a,t);let s=this.get(o);return s||(s=new i.X({cache:this,queryKey:a,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(a)}),this.add(s)),s}add(e){this.#f.has(e.queryHash)||(this.#f.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#f.get(e.queryHash);t&&(e.destroy(),t===e&&this.#f.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){a.j.batch((()=>{this.getAll().forEach((e=>{this.remove(e)}))}))}get(e){return this.#f.get(e)}getAll(){return[...this.#f.values()]}find(e){const t={exact:!0,...e};return this.getAll().find((e=>(0,r.MK)(t,e)))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter((t=>(0,r.MK)(e,t))):t}notify(e){a.j.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}onFocus(){a.j.batch((()=>{this.getAll().forEach((e=>{e.onFocus()}))}))}onOnline(){a.j.batch((()=>{this.getAll().forEach((e=>{e.onOnline()}))}))}},l=n(9304),u=class extends o.Q{constructor(e={}){super(),this.config=e,this.#p=new Map,this.#m=Date.now()}#p;#m;build(e,t,n){const r=new l.s({mutationCache:this,mutationId:++this.#m,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){const t=c(e),n=this.#p.get(t)??[];n.push(e),this.#p.set(t,n),this.notify({type:"added",mutation:e})}remove(e){const t=c(e);if(this.#p.has(t)){const n=this.#p.get(t)?.filter((t=>t!==e));n&&(0===n.length?this.#p.delete(t):this.#p.set(t,n))}this.notify({type:"removed",mutation:e})}canRun(e){const t=this.#p.get(c(e))?.find((e=>"pending"===e.state.status));return!t||t===e}runNext(e){const t=this.#p.get(c(e))?.find((t=>t!==e&&t.state.isPaused));return t?.continue()??Promise.resolve()}clear(){a.j.batch((()=>{this.getAll().forEach((e=>{this.remove(e)}))}))}getAll(){return[...this.#p.values()].flat()}find(e){const t={exact:!0,...e};return this.getAll().find((e=>(0,r.nJ)(t,e)))}findAll(e={}){return this.getAll().filter((t=>(0,r.nJ)(e,t)))}notify(e){a.j.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}resumePausedMutations(){const e=this.getAll().filter((e=>e.state.isPaused));return a.j.batch((()=>Promise.all(e.map((e=>e.continue().catch(r.lQ))))))}};function c(e){return e.options.scope?.id??String(e.mutationId)}var d=n(7528),h=n(4841);function f(e){return{onFetch:(t,n)=>{const i=async()=>{const n=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]};let l=!1;const u=(0,r.ZM)(t.options,t.fetchOptions),c=async(e,n,i)=>{if(l)return Promise.reject();if(null==n&&e.pages.length)return Promise.resolve(e);const a={queryKey:t.queryKey,pageParam:n,direction:i?"backward":"forward",meta:t.options.meta};var o;o=a,Object.defineProperty(o,"signal",{enumerable:!0,get:()=>(t.signal.aborted?l=!0:t.signal.addEventListener("abort",(()=>{l=!0})),t.signal)});const s=await u(a),{maxPages:c}=t.options,d=i?r.ZZ:r.y9;return{pages:d(e.pages,s,c),pageParams:d(e.pageParams,n,c)}};let d;if(i&&a.length){const e="backward"===i,t={pages:a,pageParams:o},r=(e?m:p)(n,t);d=await c(t,r,e)}else{d=await c(s,o[0]??n.initialPageParam);const t=e??a.length;for(let e=1;e<t;e++){const e=p(n,d);d=await c(d,e)}}return d};t.options.persister?t.fetchFn=()=>t.options.persister?.(i,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=i}}}function p(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function m(e,{pages:t,pageParams:n}){return e.getPreviousPageParam?.(t[0],t,n[0],n)}var g=class{#g;#i;#d;#v;#y;#b;#w;#S;constructor(e={}){this.#g=e.queryCache||new s,this.#i=e.mutationCache||new u,this.#d=e.defaultOptions||{},this.#v=new Map,this.#y=new Map,this.#b=0}mount(){this.#b++,1===this.#b&&(this.#w=d.m.subscribe((async e=>{e&&(await this.resumePausedMutations(),this.#g.onFocus())})),this.#S=h.t.subscribe((async e=>{e&&(await this.resumePausedMutations(),this.#g.onOnline())})))}unmount(){this.#b--,0===this.#b&&(this.#w?.(),this.#w=void 0,this.#S?.(),this.#S=void 0)}isFetching(e){return this.#g.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#i.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#g.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(void 0===t)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),i=this.#g.build(this,n);return e.revalidateIfStale&&i.isStaleByTime((0,r.d2)(n.staleTime,i))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return this.#g.findAll(e).map((({queryKey:e,state:t})=>[e,t.data]))}setQueryData(e,t,n){const i=this.defaultQueryOptions({queryKey:e}),a=this.#g.get(i.queryHash),o=a?.state.data,s=(0,r.Zw)(t,o);if(void 0!==s)return this.#g.build(this,i).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return a.j.batch((()=>this.#g.findAll(e).map((({queryKey:e})=>[e,this.setQueryData(e,t,n)]))))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#g.get(t.queryHash)?.state}removeQueries(e){const t=this.#g;a.j.batch((()=>{t.findAll(e).forEach((e=>{t.remove(e)}))}))}resetQueries(e,t){const n=this.#g,r={type:"active",...e};return a.j.batch((()=>(n.findAll(e).forEach((e=>{e.reset()})),this.refetchQueries(r,t))))}cancelQueries(e={},t={}){const n={revert:!0,...t},i=a.j.batch((()=>this.#g.findAll(e).map((e=>e.cancel(n)))));return Promise.all(i).then(r.lQ).catch(r.lQ)}invalidateQueries(e={},t={}){return a.j.batch((()=>{if(this.#g.findAll(e).forEach((e=>{e.invalidate()})),"none"===e.refetchType)return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)}))}refetchQueries(e={},t){const n={...t,cancelRefetch:t?.cancelRefetch??!0},i=a.j.batch((()=>this.#g.findAll(e).filter((e=>!e.isDisabled())).map((e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(r.lQ)),"paused"===e.state.fetchStatus?Promise.resolve():t}))));return Promise.all(i).then(r.lQ)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const n=this.#g.build(this,t);return n.isStaleByTime((0,r.d2)(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(r.lQ).catch(r.lQ)}fetchInfiniteQuery(e){return e.behavior=f(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(r.lQ).catch(r.lQ)}resumePausedMutations(){return h.t.isOnline()?this.#i.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#g}getMutationCache(){return this.#i}getDefaultOptions(){return this.#d}setDefaultOptions(e){this.#d=e}setQueryDefaults(e,t){this.#v.set((0,r.EN)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#v.values()];let n={};return t.forEach((t=>{(0,r.Cp)(e,t.queryKey)&&(n={...n,...t.defaultOptions})})),n}setMutationDefaults(e,t){this.#y.set((0,r.EN)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#y.values()];let n={};return t.forEach((t=>{(0,r.Cp)(e,t.mutationKey)&&(n={...n,...t.defaultOptions})})),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#d.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,r.F$)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),!0!==t.enabled&&t.queryFn===r.hT&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#d.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#g.clear(),this.#i.clear()}}},8546:(e,t,n)=>{"use strict";n.d(t,{k:()=>i});var r=n(9106),i=class{#x;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,r.gn)(this.gcTime)&&(this.#x=setTimeout((()=>{this.optionalRemove()}),this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(r.S$?1/0:3e5))}clearGcTimeout(){this.#x&&(clearTimeout(this.#x),this.#x=void 0)}}},5610:(e,t,n)=>{"use strict";n.d(t,{II:()=>c,v_:()=>s,wm:()=>u});var r=n(7528),i=n(4841),a=n(9106);function o(e){return Math.min(1e3*2**e,3e4)}function s(e){return"online"!==(e??"online")||i.t.isOnline()}var l=class{constructor(e){this.revert=e?.revert,this.silent=e?.silent}};function u(e){return e instanceof l}function c(e){let t,n,u,c=!1,d=0,h=!1;const f=new Promise(((e,t)=>{n=e,u=t})),p=()=>r.m.isFocused()&&("always"===e.networkMode||i.t.isOnline())&&e.canRun(),m=()=>s(e.networkMode)&&e.canRun(),g=r=>{h||(h=!0,e.onSuccess?.(r),t?.(),n(r))},v=n=>{h||(h=!0,e.onError?.(n),t?.(),u(n))},y=()=>new Promise((n=>{t=e=>{(h||p())&&n(e)},e.onPause?.()})).then((()=>{t=void 0,h||e.onContinue?.()})),b=()=>{if(h)return;let t;const n=0===d?e.initialPromise:void 0;try{t=n??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(g).catch((t=>{if(h)return;const n=e.retry??(a.S$?0:3),r=e.retryDelay??o,i="function"==typeof r?r(d,t):r,s=!0===n||"number"==typeof n&&d<n||"function"==typeof n&&n(d,t);!c&&s?(d++,e.onFail?.(d,t),(0,a.yy)(i).then((()=>p()?void 0:y())).then((()=>{c?v(t):b()}))):v(t)}))};return{promise:f,cancel:t=>{h||(v(new l(t)),e.abort?.())},continue:()=>(t?.(),f),cancelRetry:()=>{c=!0},continueRetry:()=>{c=!1},canStart:m,start:()=>(m()?b():y().then(b),f)}}},7794:(e,t,n)=>{"use strict";n.d(t,{Q:()=>r});var r=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(){}}},9106:(e,t,n)=>{"use strict";n.d(t,{Cp:()=>p,EN:()=>f,Eh:()=>u,F$:()=>h,MK:()=>c,S$:()=>r,ZM:()=>O,ZZ:()=>E,Zw:()=>a,d2:()=>l,f8:()=>g,gn:()=>o,hT:()=>_,j3:()=>s,lQ:()=>i,nJ:()=>d,pl:()=>S,y9:()=>x,yy:()=>w});var r="undefined"==typeof window||"Deno"in globalThis;function i(){}function a(e,t){return"function"==typeof e?e(t):e}function o(e){return"number"==typeof e&&e>=0&&e!==1/0}function s(e,t){return Math.max(e+(t||0)-Date.now(),0)}function l(e,t){return"function"==typeof e?e(t):e}function u(e,t){return"function"==typeof e?e(t):e}function c(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o)if(r){if(t.queryHash!==h(o,t.options))return!1}else if(!p(t.queryKey,o))return!1;if("all"!==n){const e=t.isActive();if("active"===n&&!e)return!1;if("inactive"===n&&e)return!1}return("boolean"!=typeof s||t.isStale()===s)&&((!i||i===t.state.fetchStatus)&&!(a&&!a(t)))}function d(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(f(t.options.mutationKey)!==f(a))return!1}else if(!p(t.options.mutationKey,a))return!1}return(!r||t.state.status===r)&&!(i&&!i(t))}function h(e,t){return(t?.queryKeyHashFn||f)(e)}function f(e){return JSON.stringify(e,((e,t)=>y(t)?Object.keys(t).sort().reduce(((e,n)=>(e[n]=t[n],e)),{}):t))}function p(e,t){return e===t||typeof e==typeof t&&(!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&!Object.keys(t).some((n=>!p(e[n],t[n]))))}function m(e,t){if(e===t)return e;const n=v(e)&&v(t);if(n||y(e)&&y(t)){const r=n?e:Object.keys(e),i=r.length,a=n?t:Object.keys(t),o=a.length,s=n?[]:{};let l=0;for(let i=0;i<o;i++){const o=n?i:a[i];(!n&&r.includes(o)||n)&&void 0===e[o]&&void 0===t[o]?(s[o]=void 0,l++):(s[o]=m(e[o],t[o]),s[o]===e[o]&&void 0!==e[o]&&l++)}return i===o&&l===i?e:s}return t}function g(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 v(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function y(e){if(!b(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!b(n)&&(!!n.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype)}function b(e){return"[object Object]"===Object.prototype.toString.call(e)}function w(e){return new Promise((t=>{setTimeout(t,e)}))}function S(e,t,n){return"function"==typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?m(e,t):t}function x(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function E(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var _=Symbol(),O=(e,t)=>!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==_?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))},3715:(e,t,n)=>{"use strict";n.d(t,{Ht:()=>s,jE:()=>o});var r=n(5959),i=n(2540),a=r.createContext(void 0),o=e=>{const t=r.useContext(a);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},s=({client:e,children:t})=>(r.useEffect((()=>(e.mount(),()=>{e.unmount()})),[e]),(0,i.jsx)(a.Provider,{value:e,children:t}))},6667:(e,t,n)=>{"use strict";n.d(t,{n:()=>d});var r=n(5959),i=n(9304),a=n(3403),o=n(7794),s=n(9106),l=class extends o.Q{#E;#_=void 0;#O;#k;constructor(e,t){super(),this.#E=e,this.setOptions(t),this.bindMethods(),this.#T()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#E.defaultMutationOptions(e),(0,s.f8)(this.options,t)||this.#E.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#O,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,s.EN)(t.mutationKey)!==(0,s.EN)(this.options.mutationKey)?this.reset():"pending"===this.#O?.state.status&&this.#O.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#O?.removeObserver(this)}onMutationUpdate(e){this.#T(),this.#C(e)}getCurrentResult(){return this.#_}reset(){this.#O?.removeObserver(this),this.#O=void 0,this.#T(),this.#C()}mutate(e,t){return this.#k=t,this.#O?.removeObserver(this),this.#O=this.#E.getMutationCache().build(this.#E,this.options),this.#O.addObserver(this),this.#O.execute(e)}#T(){const e=this.#O?.state??(0,i.$)();this.#_={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#C(e){a.j.batch((()=>{if(this.#k&&this.hasListeners()){const t=this.#_.variables,n=this.#_.context;"success"===e?.type?(this.#k.onSuccess?.(e.data,t,n),this.#k.onSettled?.(e.data,null,t,n)):"error"===e?.type&&(this.#k.onError?.(e.error,t,n),this.#k.onSettled?.(void 0,e.error,t,n))}this.listeners.forEach((e=>{e(this.#_)}))}))}},u=n(3715),c=n(908);function d(e,t){const n=(0,u.jE)(t),[i]=r.useState((()=>new l(n,e)));r.useEffect((()=>{i.setOptions(e)}),[i,e]);const o=r.useSyncExternalStore(r.useCallback((e=>i.subscribe(a.j.batchCalls(e))),[i]),(()=>i.getCurrentResult()),(()=>i.getCurrentResult())),s=r.useCallback(((e,t)=>{i.mutate(e,t).catch(c.l)}),[i]);if(o.error&&(0,c.G)(i.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}},7616:(e,t,n)=>{"use strict";n.d(t,{I:()=>T});var r=n(9106),i=n(3403),a=n(7528),o=n(7794),s=n(2015),l=class extends o.Q{constructor(e,t){super(),this.options=t,this.#E=e,this.#I=null,this.bindMethods(),this.setOptions(t)}#E;#R=void 0;#A=void 0;#_=void 0;#N;#D;#I;#L;#P;#M;#j;#F;#V;#$=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#R.addObserver(this),u(this.#R,this.options)?this.#B():this.updateResult(),this.#z())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return c(this.#R,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return c(this.#R,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#U(),this.#q(),this.#R.removeObserver(this)}setOptions(e,t){const n=this.options,i=this.#R;if(this.options=this.#E.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,r.Eh)(this.options.enabled,this.#R))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#H(),this.#R.setOptions(this.options),n._defaulted&&!(0,r.f8)(this.options,n)&&this.#E.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#R,observer:this});const a=this.hasListeners();a&&d(this.#R,i,this.options,n)&&this.#B(),this.updateResult(t),!a||this.#R===i&&(0,r.Eh)(this.options.enabled,this.#R)===(0,r.Eh)(n.enabled,this.#R)&&(0,r.d2)(this.options.staleTime,this.#R)===(0,r.d2)(n.staleTime,this.#R)||this.#W();const o=this.#G();!a||this.#R===i&&(0,r.Eh)(this.options.enabled,this.#R)===(0,r.Eh)(n.enabled,this.#R)&&o===this.#V||this.#K(o)}getOptimisticResult(e){const t=this.#E.getQueryCache().build(this.#E,e),n=this.createResult(t,e);return function(e,t){if(!(0,r.f8)(e.getCurrentResult(),t))return!0;return!1}(this,n)&&(this.#_=n,this.#D=this.options,this.#N=this.#R.state),n}getCurrentResult(){return this.#_}trackResult(e,t){const n={};return Object.keys(e).forEach((r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(r),t?.(r),e[r])})})),n}trackProp(e){this.#$.add(e)}getCurrentQuery(){return this.#R}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#E.defaultQueryOptions(e),n=this.#E.getQueryCache().build(this.#E,t);return n.isFetchingOptimistic=!0,n.fetch().then((()=>this.createResult(n,t)))}fetch(e){return this.#B({...e,cancelRefetch:e.cancelRefetch??!0}).then((()=>(this.updateResult(),this.#_)))}#B(e){this.#H();let t=this.#R.fetch(this.options,e);return e?.throwOnError||(t=t.catch(r.lQ)),t}#W(){this.#U();const e=(0,r.d2)(this.options.staleTime,this.#R);if(r.S$||this.#_.isStale||!(0,r.gn)(e))return;const t=(0,r.j3)(this.#_.dataUpdatedAt,e)+1;this.#j=setTimeout((()=>{this.#_.isStale||this.updateResult()}),t)}#G(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#R):this.options.refetchInterval)??!1}#K(e){this.#q(),this.#V=e,!r.S$&&!1!==(0,r.Eh)(this.options.enabled,this.#R)&&(0,r.gn)(this.#V)&&0!==this.#V&&(this.#F=setInterval((()=>{(this.options.refetchIntervalInBackground||a.m.isFocused())&&this.#B()}),this.#V))}#z(){this.#W(),this.#K(this.#G())}#U(){this.#j&&(clearTimeout(this.#j),this.#j=void 0)}#q(){this.#F&&(clearInterval(this.#F),this.#F=void 0)}createResult(e,t){const n=this.#R,i=this.options,a=this.#_,o=this.#N,l=this.#D,c=e!==n?e.state:this.#A,{state:f}=e;let p,m={...f},g=!1;if(t._optimisticResults){const r=this.hasListeners(),a=!r&&u(e,t),o=r&&d(e,n,t,i);(a||o)&&(m={...m,...(0,s.k)(f.data,e.options)}),"isRestoring"===t._optimisticResults&&(m.fetchStatus="idle")}let{error:v,errorUpdatedAt:y,status:b}=m;if(t.select&&void 0!==m.data)if(a&&m.data===o?.data&&t.select===this.#L)p=this.#P;else try{this.#L=t.select,p=t.select(m.data),p=(0,r.pl)(a?.data,p,t),this.#P=p,this.#I=null}catch(e){this.#I=e}else p=m.data;if(void 0!==t.placeholderData&&void 0===p&&"pending"===b){let e;if(a?.isPlaceholderData&&t.placeholderData===l?.placeholderData)e=a.data;else if(e="function"==typeof t.placeholderData?t.placeholderData(this.#M?.state.data,this.#M):t.placeholderData,t.select&&void 0!==e)try{e=t.select(e),this.#I=null}catch(e){this.#I=e}void 0!==e&&(b="success",p=(0,r.pl)(a?.data,e,t),g=!0)}this.#I&&(v=this.#I,p=this.#P,y=Date.now(),b="error");const w="fetching"===m.fetchStatus,S="pending"===b,x="error"===b,E=S&&w,_=void 0!==p;return{status:b,fetchStatus:m.fetchStatus,isPending:S,isSuccess:"success"===b,isError:x,isInitialLoading:E,isLoading:E,data:p,dataUpdatedAt:m.dataUpdatedAt,error:v,errorUpdatedAt:y,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>c.dataUpdateCount||m.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!S,isLoadingError:x&&!_,isPaused:"paused"===m.fetchStatus,isPlaceholderData:g,isRefetchError:x&&_,isStale:h(e,t),refetch:this.refetch}}updateResult(e){const t=this.#_,n=this.createResult(this.#R,this.options);if(this.#N=this.#R.state,this.#D=this.options,void 0!==this.#N.data&&(this.#M=this.#R),(0,r.f8)(n,t))return;this.#_=n;const i={};!1!==e?.listeners&&(()=>{if(!t)return!0;const{notifyOnChangeProps:e}=this.options,n="function"==typeof e?e():e;if("all"===n||!n&&!this.#$.size)return!0;const r=new Set(n??this.#$);return this.options.throwOnError&&r.add("error"),Object.keys(this.#_).some((e=>{const n=e;return this.#_[n]!==t[n]&&r.has(n)}))})()&&(i.listeners=!0),this.#C({...i,...e})}#H(){const e=this.#E.getQueryCache().build(this.#E,this.options);if(e===this.#R)return;const t=this.#R;this.#R=e,this.#A=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#z()}#C(e){i.j.batch((()=>{e.listeners&&this.listeners.forEach((e=>{e(this.#_)})),this.#E.getQueryCache().notify({query:this.#R,type:"observerResultsUpdated"})}))}};function u(e,t){return function(e,t){return!1!==(0,r.Eh)(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&c(e,t,t.refetchOnMount)}function c(e,t,n){if(!1!==(0,r.Eh)(t.enabled,e)){const r="function"==typeof n?n(e):n;return"always"===r||!1!==r&&h(e,t)}return!1}function d(e,t,n,i){return(e!==t||!1===(0,r.Eh)(i.enabled,e))&&(!n.suspense||"error"!==e.state.status)&&h(e,n)}function h(e,t){return!1!==(0,r.Eh)(t.enabled,e)&&e.isStaleByTime((0,r.d2)(t.staleTime,e))}var f=n(5959);n(2540);function p(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var m=f.createContext(p()),g=()=>f.useContext(m),v=n(3715),y=f.createContext(!1),b=()=>f.useContext(y),w=(y.Provider,n(908)),S=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},x=e=>{f.useEffect((()=>{e.clearReset()}),[e])},E=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(0,w.G)(n,[e.error,r]),_=e=>{e.suspense&&"number"!=typeof e.staleTime&&(e.staleTime=1e3)},O=(e,t)=>e?.suspense&&t.isPending,k=(e,t,n)=>t.fetchOptimistic(e).catch((()=>{n.clearReset()}));function T(e,t){return function(e,t,n){const r=(0,v.jE)(n),a=b(),o=g(),s=r.defaultQueryOptions(e);r.getDefaultOptions().queries?._experimental_beforeQuery?.(s),s._optimisticResults=a?"isRestoring":"optimistic",_(s),S(s,o),x(o);const[l]=f.useState((()=>new t(r,s))),u=l.getOptimisticResult(s);if(f.useSyncExternalStore(f.useCallback((e=>{const t=a?()=>{}:l.subscribe(i.j.batchCalls(e));return l.updateResult(),t}),[l,a]),(()=>l.getCurrentResult()),(()=>l.getCurrentResult())),f.useEffect((()=>{l.setOptions(s,{listeners:!1})}),[s,l]),O(s,u))throw k(s,l,o);if(E({result:u,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw u.error;return r.getDefaultOptions().queries?._experimental_afterQuery?.(s,u),s.notifyOnChangeProps?u:l.trackResult(u)}(e,l,t)}},908:(e,t,n)=>{"use strict";function r(e,t){return"function"==typeof e?e(...t):!!e}function i(){}n.d(t,{G:()=>r,l:()=>i})},8727:()=>{"use strict";var e={},t=Uint8Array,n=Uint16Array,r=Int32Array,i=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(e,t){for(var i=new n(31),a=0;a<31;++a)i[a]=t+=1<<e[a-1];var o=new r(i[30]);for(a=1;a<30;++a)for(var s=i[a];s<i[a+1];++s)o[s]=s-i[a]<<5|a;return{b:i,r:o}},l=s(i,2),u=l.b,c=l.r;u[28]=258,c[258]=28;for(var d=s(a,0),h=d.b,f=d.r,p=new n(32768),m=0;m<32768;++m){var g=(43690&m)>>1|(21845&m)<<1;g=(61680&(g=(52428&g)>>2|(13107&g)<<2))>>4|(3855&g)<<4,p[m]=((65280&g)>>8|(255&g)<<8)>>1}var v=function(e,t,r){for(var i=e.length,a=0,o=new n(t);a<i;++a)e[a]&&++o[e[a]-1];var s,l=new n(t);for(a=1;a<t;++a)l[a]=l[a-1]+o[a-1]<<1;if(r){s=new n(1<<t);var u=15-t;for(a=0;a<i;++a)if(e[a])for(var c=a<<4|e[a],d=t-e[a],h=l[e[a]-1]++<<d,f=h|(1<<d)-1;h<=f;++h)s[p[h]>>u]=c}else for(s=new n(i),a=0;a<i;++a)e[a]&&(s[a]=p[l[e[a]-1]++]>>15-e[a]);return s},y=new t(288);for(m=0;m<144;++m)y[m]=8;for(m=144;m<256;++m)y[m]=9;for(m=256;m<280;++m)y[m]=7;for(m=280;m<288;++m)y[m]=8;var b=new t(32);for(m=0;m<32;++m)b[m]=5;var w=v(y,9,0),S=v(y,9,1),x=v(b,5,0),E=v(b,5,1),_=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},O=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},k=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},T=function(e){return(e+7)/8|0},C=function(e,n,r){return(null==n||n<0)&&(n=0),(null==r||r>e.length)&&(r=e.length),new t(e.subarray(n,r))},I=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],R=function(e,t,n){var r=new Error(t||I[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,R),!n)throw r;return r},A=function(e,n,r,s){var l=e.length,c=s?s.length:0;if(!l||n.f&&!n.l)return r||new t(0);var d=!r,f=d||2!=n.i,p=n.i;d&&(r=new t(3*l));var m=function(e){var n=r.length;if(e>n){var i=new t(Math.max(2*n,e));i.set(r),r=i}},g=n.f||0,y=n.p||0,b=n.b||0,w=n.l,x=n.d,I=n.m,A=n.n,N=8*l;do{if(!w){g=O(e,y,1);var D=O(e,y+1,3);if(y+=3,!D){var L=e[(H=T(y)+4)-4]|e[H-3]<<8,P=H+L;if(P>l){p&&R(0);break}f&&m(b+L),r.set(e.subarray(H,P),b),n.b=b+=L,n.p=y=8*P,n.f=g;continue}if(1==D)w=S,x=E,I=9,A=5;else if(2==D){var M=O(e,y,31)+257,j=O(e,y+10,15)+4,F=M+O(e,y+5,31)+1;y+=14;for(var V=new t(F),$=new t(19),B=0;B<j;++B)$[o[B]]=O(e,y+3*B,7);y+=3*j;var z=_($),U=(1<<z)-1,q=v($,z,1);for(B=0;B<F;){var H,W=q[O(e,y,U)];if(y+=15&W,(H=W>>4)<16)V[B++]=H;else{var G=0,K=0;for(16==H?(K=3+O(e,y,3),y+=2,G=V[B-1]):17==H?(K=3+O(e,y,7),y+=3):18==H&&(K=11+O(e,y,127),y+=7);K--;)V[B++]=G}}var Q=V.subarray(0,M),Y=V.subarray(M);I=_(Q),A=_(Y),w=v(Q,I,1),x=v(Y,A,1)}else R(1);if(y>N){p&&R(0);break}}f&&m(b+131072);for(var X=(1<<I)-1,J=(1<<A)-1,Z=y;;Z=y){var ee=(G=w[k(e,y)&X])>>4;if((y+=15&G)>N){p&&R(0);break}if(G||R(2),ee<256)r[b++]=ee;else{if(256==ee){Z=y,w=null;break}var te=ee-254;if(ee>264){var ne=i[B=ee-257];te=O(e,y,(1<<ne)-1)+u[B],y+=ne}var re=x[k(e,y)&J],ie=re>>4;re||R(3),y+=15&re;Y=h[ie];if(ie>3){ne=a[ie];Y+=k(e,y)&(1<<ne)-1,y+=ne}if(y>N){p&&R(0);break}f&&m(b+131072);var ae=b+te;if(b<Y){var oe=c-Y,se=Math.min(Y,ae);for(oe+b<0&&R(3);b<se;++b)r[b]=s[oe+b]}for(;b<ae;++b)r[b]=r[b-Y]}}n.l=w,n.p=Z,n.b=b,n.f=g,w&&(g=1,n.m=I,n.d=x,n.n=A)}while(!g);return b!=r.length&&d?C(r,0,b):r.subarray(0,b)},N=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},D=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},L=function(e,r){for(var i=[],a=0;a<e.length;++a)e[a]&&i.push({s:a,f:e[a]});var o=i.length,s=i.slice();if(!o)return{t:B,l:0};if(1==o){var l=new t(i[0].s+1);return l[i[0].s]=1,{t:l,l:1}}i.sort((function(e,t){return e.f-t.f})),i.push({s:-1,f:25001});var u=i[0],c=i[1],d=0,h=1,f=2;for(i[0]={s:-1,f:u.f+c.f,l:u,r:c};h!=o-1;)u=i[i[d].f<i[f].f?d++:f++],c=i[d!=h&&i[d].f<i[f].f?d++:f++],i[h++]={s:-1,f:u.f+c.f,l:u,r:c};var p=s[0].s;for(a=1;a<o;++a)s[a].s>p&&(p=s[a].s);var m=new n(p+1),g=P(i[h-1],m,0);if(g>r){a=0;var v=0,y=g-r,b=1<<y;for(s.sort((function(e,t){return m[t.s]-m[e.s]||e.f-t.f}));a<o;++a){var w=s[a].s;if(!(m[w]>r))break;v+=b-(1<<g-m[w]),m[w]=r}for(v>>=y;v>0;){var S=s[a].s;m[S]<r?v-=1<<r-m[S]++-1:++a}for(;a>=0&&v;--a){var x=s[a].s;m[x]==r&&(--m[x],++v)}g=r}return{t:new t(m),l:g}},P=function(e,t,n){return-1==e.s?Math.max(P(e.l,t,n+1),P(e.r,t,n+1)):t[e.s]=n},M=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new n(++t),i=0,a=e[0],o=1,s=function(e){r[i++]=e},l=1;l<=t;++l)if(e[l]==a&&l!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(a),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(a);o=1,a=e[l]}return{c:r.subarray(0,i),n:t}},j=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},F=function(e,t,n){var r=n.length,i=T(t+2);e[i]=255&r,e[i+1]=r>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var a=0;a<r;++a)e[i+a+4]=n[a];return 8*(i+4+r)},V=function(e,t,r,s,l,u,c,d,h,f,p){N(t,p++,r),++l[256];for(var m=L(l,15),g=m.t,S=m.l,E=L(u,15),_=E.t,O=E.l,k=M(g),T=k.c,C=k.n,I=M(_),R=I.c,A=I.n,P=new n(19),V=0;V<T.length;++V)++P[31&T[V]];for(V=0;V<R.length;++V)++P[31&R[V]];for(var $=L(P,7),B=$.t,z=$.l,U=19;U>4&&!B[o[U-1]];--U);var q,H,W,G,K=f+5<<3,Q=j(l,y)+j(u,b)+c,Y=j(l,g)+j(u,_)+c+14+3*U+j(P,B)+2*P[16]+3*P[17]+7*P[18];if(h>=0&&K<=Q&&K<=Y)return F(t,p,e.subarray(h,h+f));if(N(t,p,1+(Y<Q)),p+=2,Y<Q){q=v(g,S,0),H=g,W=v(_,O,0),G=_;var X=v(B,z,0);N(t,p,C-257),N(t,p+5,A-1),N(t,p+10,U-4),p+=14;for(V=0;V<U;++V)N(t,p+3*V,B[o[V]]);p+=3*U;for(var J=[T,R],Z=0;Z<2;++Z){var ee=J[Z];for(V=0;V<ee.length;++V){var te=31&ee[V];N(t,p,X[te]),p+=B[te],te>15&&(N(t,p,ee[V]>>5&127),p+=ee[V]>>12)}}}else q=w,H=y,W=x,G=b;for(V=0;V<d;++V){var ne=s[V];if(ne>255){D(t,p,q[(te=ne>>18&31)+257]),p+=H[te+257],te>7&&(N(t,p,ne>>23&31),p+=i[te]);var re=31&ne;D(t,p,W[re]),p+=G[re],re>3&&(D(t,p,ne>>5&8191),p+=a[re])}else D(t,p,q[ne]),p+=H[ne]}return D(t,p,q[256]),p+H[256]},$=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),B=new t(0),z=function(e,o,s,l,u,d){var h=d.z||e.length,p=new t(l+h+5*(1+Math.ceil(h/7e3))+u),m=p.subarray(l,p.length-u),g=d.l,v=7&(d.r||0);if(o){v&&(m[0]=d.r>>3);for(var y=$[o-1],b=y>>13,w=8191&y,S=(1<<s)-1,x=d.p||new n(32768),E=d.h||new n(S+1),_=Math.ceil(s/3),O=2*_,k=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<O)&S},I=new r(25e3),R=new n(288),A=new n(32),N=0,D=0,L=d.i||0,P=0,M=d.w||0,j=0;L+2<h;++L){var B=k(L),z=32767&L,U=E[B];if(x[z]=U,E[B]=z,M<=L){var q=h-L;if((N>7e3||P>24576)&&(q>423||!g)){v=V(e,m,0,I,R,A,D,P,j,L-j,v),P=N=D=0,j=L;for(var H=0;H<286;++H)R[H]=0;for(H=0;H<30;++H)A[H]=0}var W=2,G=0,K=w,Q=z-U&32767;if(q>2&&B==k(L-Q))for(var Y=Math.min(b,q)-1,X=Math.min(32767,L),J=Math.min(258,q);Q<=X&&--K&&z!=U;){if(e[L+W]==e[L+W-Q]){for(var Z=0;Z<J&&e[L+Z]==e[L+Z-Q];++Z);if(Z>W){if(W=Z,G=Q,Z>Y)break;var ee=Math.min(Q,Z-2),te=0;for(H=0;H<ee;++H){var ne=L-Q+H&32767,re=ne-x[ne]&32767;re>te&&(te=re,U=ne)}}}Q+=(z=U)-(U=x[z])&32767}if(G){I[P++]=268435456|c[W]<<18|f[G];var ie=31&c[W],ae=31&f[G];D+=i[ie]+a[ae],++R[257+ie],++A[ae],M=L+W,++N}else I[P++]=e[L],++R[e[L]]}}for(L=Math.max(L,M);L<h;++L)I[P++]=e[L],++R[e[L]];v=V(e,m,g,I,R,A,D,P,j,L-j,v),g||(d.r=7&v|m[v/8|0]<<3,v-=7,d.h=E,d.p=x,d.i=L,d.w=M)}else{for(L=d.w||0;L<h+g;L+=65535){var oe=L+65535;oe>=h&&(m[v/8|0]=g,oe=h),v=F(m,v+1,e.subarray(L,oe))}d.i=h}return C(p,0,l+T(v)+u)},U=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&-306674912)^n>>>1;e[t]=n}return e}(),q=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=U[255&n^t[r]]^n>>>8;e=n},d:function(){return~e}}},H=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,a=0|n.length,o=0;o!=a;){for(var s=Math.min(o+2655,a);o<s;++o)i+=r+=n[o];r=(65535&r)+15*(r>>16),i=(65535&i)+15*(i>>16)}e=r,t=i},d:function(){return(255&(e%=65521))<<24|(65280&e)<<8|(255&(t%=65521))<<8|t>>8}}},W=function(e,n,r,i,a){if(!a&&(a={l:1},n.dictionary)){var o=n.dictionary.subarray(-32768),s=new t(o.length+e.length);s.set(o),s.set(e,o.length),e=s,a.w=o.length}return z(e,null==n.level?6:n.level,null==n.mem?a.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+n.mem,r,i,a)},G=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},K=function(e,t,n){for(var r=e(),i=e.toString(),a=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<r.length;++o){var s=r[o],l=a[o];if("function"==typeof s){t+=";"+l+"=";var u=s.toString();if(s.prototype)if(-1!=u.indexOf("[native code]")){var c=u.indexOf(" ",8)+1;t+=u.slice(c,u.indexOf("(",c))}else for(var d in t+=u,s.prototype)t+=";"+l+".prototype."+d+"="+s.prototype[d].toString();else t+=u}else n[l]=s}return t},Q=[],Y=function(t,n,r,i){if(!Q[r]){for(var a="",o={},s=t.length-1,l=0;l<s;++l)a=K(t[l],a,o);Q[r]={c:K(t[s],a,o),e:o}}var u=G({},Q[r].e);return function(t,n,r,i,a){var o=new Worker(e[n]||(e[n]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return o.onmessage=function(e){var t=e.data,n=t.$e$;if(n){var r=new Error(n[0]);r.code=n[1],r.stack=n[2],a(r,null)}else a(null,t)},o.postMessage(r,i),o}(Q[r].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+n.toString()+"}",r,u,function(e){var t=[];for(var n in e)e[n].buffer&&t.push((e[n]=new e[n].constructor(e[n])).buffer);return t}(u),i)},X=function(){return[t,n,r,i,a,o,u,h,S,E,p,I,v,_,O,k,T,C,R,A,we,re,ie]},J=function(){return[t,n,r,i,a,o,c,f,w,y,x,b,p,$,B,v,N,D,L,P,M,j,F,V,T,C,z,W,ve,re]},Z=function(){return[le,de,se,q,U]},ee=function(){return[ue,ce]},te=function(){return[he,se,H]},ne=function(){return[fe]},re=function(e){return postMessage(e,[e.buffer])},ie=function(e){return e&&{out:e.size&&new t(e.size),dictionary:e.dictionary}},ae=function(e){return e.ondata=function(e,t){return postMessage([e,t],[e.buffer])},function(t){t.data.length?(e.push(t.data[0],t.data[1]),postMessage([t.data[0].length])):e.flush()}},oe=function(e,t,n,r,i,a,o){var s,l=Y(e,r,i,(function(e,n){e?(l.terminate(),t.ondata.call(t,e)):Array.isArray(n)?1==n.length?(t.queuedSize-=n[0],t.ondrain&&t.ondrain(n[0])):(n[1]&&l.terminate(),t.ondata.call(t,e,n[0],n[1])):o(n)}));l.postMessage(n),t.queuedSize=0,t.push=function(e,n){t.ondata||R(5),s&&t.ondata(R(4,0,1),null,!!n),t.queuedSize+=e.length,l.postMessage([e,s=n],[e.buffer])},t.terminate=function(){l.terminate()},a&&(t.flush=function(){l.postMessage([])})},se=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},le=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&se(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},ue=function(e){31==e[0]&&139==e[1]&&8==e[2]||R(6,"invalid gzip data");var t=e[3],n=10;4&t&&(n+=2+(e[10]|e[11]<<8));for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(2&t)},ce=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},de=function(e){return 10+(e.filename?e.filename.length+1:0)},he=function(e,t){var n=t.level,r=0==n?0:n<6?1:9==n?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=H();i.p(t.dictionary),se(e,2,i.d())}},fe=function(e,t){return(8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31)&&R(6,"invalid zlib data"),(e[1]>>5&1)==+!t&&R(6,"invalid zlib data: "+(32&e[1]?"need":"unexpected")+" dictionary"),2+(e[1]>>3&4)};function pe(e,t){return"function"==typeof e&&(t=e,e={}),this.ondata=t,e}var me=function(){function e(e,n){if("function"==typeof e&&(n=e,e={}),this.ondata=n,this.o=e||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var r=this.o.dictionary.subarray(-32768);this.b.set(r,32768-r.length),this.s.i=32768-r.length}}return e.prototype.p=function(e,t){this.ondata(W(e,this.o,0,0,this.s),t)},e.prototype.push=function(e,n){this.ondata||R(5),this.s.l&&R(4);var r=e.length+this.s.z;if(r>this.b.length){if(r>2*this.b.length-32768){var i=new t(-32768&r);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;this.b.set(e.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(e.subarray(a),32768),this.s.z=e.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(e,this.s.z),this.s.z+=e.length;this.s.l=1&n,(this.s.z>this.s.w+8191||n)&&(this.p(this.b,n||!1),this.s.w=this.s.i,this.s.i-=2)},e.prototype.flush=function(){this.ondata||R(5),this.s.l&&R(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},e}(),ge=function(){return function(e,t){oe([J,function(){return[ae,me]}],this,pe.call(this,e,t),(function(e){var t=new me(e.data);onmessage=ae(t)}),6,1)}}();function ve(e,t){return W(e,t||{},0,0)}var ye=function(){function e(e,n){"function"==typeof e&&(n=e,e={}),this.ondata=n;var r=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:r?r.length:0},this.o=new t(32768),this.p=new t(0),r&&this.o.set(r)}return e.prototype.e=function(e){if(this.ondata||R(5),this.d&&R(4),this.p.length){if(e.length){var n=new t(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length),this.p=n}}else this.p=e},e.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,n=A(this.p,this.s,this.o);this.ondata(C(n,t,this.s.b),this.d),this.o=C(n,this.s.b-32768),this.s.b=this.o.length,this.p=C(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),be=function(){return function(e,t){oe([X,function(){return[ae,ye]}],this,pe.call(this,e,t),(function(e){var t=new ye(e.data);onmessage=ae(t)}),7,0)}}();function we(e,t){return A(e,{i:2},t&&t.out,t&&t.dictionary)}var Se=function(){function e(e,t){this.c=q(),this.l=0,this.v=1,me.call(this,e,t)}return e.prototype.push=function(e,t){this.c.p(e),this.l+=e.length,me.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){var n=W(e,this.o,this.v&&de(this.o),t&&8,this.s);this.v&&(le(n,this.o),this.v=0),t&&(se(n,n.length-8,this.c.d()),se(n,n.length-4,this.l)),this.ondata(n,t)},e.prototype.flush=function(){me.prototype.flush.call(this)},e}(),xe=function(){return function(e,t){oe([J,Z,function(){return[ae,me,Se]}],this,pe.call(this,e,t),(function(e){var t=new Se(e.data);onmessage=ae(t)}),8,1)}}();var Ee=function(){function e(e,t){this.v=1,this.r=0,ye.call(this,e,t)}return e.prototype.push=function(e,n){if(ye.prototype.e.call(this,e),this.r+=e.length,this.v){var r=this.p.subarray(this.v-1),i=r.length>3?ue(r):4;if(i>r.length){if(!n)return}else this.v>1&&this.onmember&&this.onmember(this.r-r.length);this.p=r.subarray(i),this.v=0}ye.prototype.c.call(this,n),!this.s.f||this.s.l||n||(this.v=T(this.s.p)+9,this.s={i:0},this.o=new t(0),this.push(new t(0),n))},e}(),_e=function(){return function(e,t){var n=this;oe([X,ee,function(){return[ae,ye,Ee]}],this,pe.call(this,e,t),(function(e){var t=new Ee(e.data);t.onmember=function(e){return postMessage(e)},onmessage=ae(t)}),9,0,(function(e){return n.onmember&&n.onmember(e)}))}}();var Oe=function(){function e(e,t){this.c=H(),this.v=1,me.call(this,e,t)}return e.prototype.push=function(e,t){this.c.p(e),me.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){var n=W(e,this.o,this.v&&(this.o.dictionary?6:2),t&&4,this.s);this.v&&(he(n,this.o),this.v=0),t&&se(n,n.length-4,this.c.d()),this.ondata(n,t)},e.prototype.flush=function(){me.prototype.flush.call(this)},e}(),ke=function(){return function(e,t){oe([J,te,function(){return[ae,me,Oe]}],this,pe.call(this,e,t),(function(e){var t=new Oe(e.data);onmessage=ae(t)}),10,1)}}();var Te=function(){function e(e,t){ye.call(this,e,t),this.v=e&&e.dictionary?2:1}return e.prototype.push=function(e,t){if(ye.prototype.e.call(this,e),this.v){if(this.p.length<6&&!t)return;this.p=this.p.subarray(fe(this.p,this.v-1)),this.v=0}t&&(this.p.length<4&&R(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),ye.prototype.c.call(this,t)},e}(),Ce=function(){return function(e,t){oe([X,ne,function(){return[ae,ye,Te]}],this,pe.call(this,e,t),(function(e){var t=new Te(e.data);onmessage=ae(t)}),11,0)}}();var Ie="undefined"!=typeof TextDecoder&&new TextDecoder;try{Ie.decode(B,{stream:!0}),1}catch(e){}"function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout&&setTimeout;const Re=e=>class{constructor(){this.i=new e,this.i.ondata=(e,t)=>{this.ondata(null,e,t)}}push(e,t){try{this.queuedSize+=e.length,this.i.push(e,t),this.queuedSize-=e.length,this.ondrain&&this.ondrain(e.length)}catch(e){this.ondata(e,null,t||!1)}}};let Ae=1;try{(new ge).terminate()}catch(R){Ae=0}const Ne=Ae?{gzip:xe,deflate:ke,"deflate-raw":ge}:{gzip:Re(Se),deflate:Re(Oe),"deflate-raw":Re(me)},De=Ae?{gzip:_e,deflate:Ce,"deflate-raw":be}:{gzip:Re(Ee),deflate:Re(Te),"deflate-raw":Re(ye)},Le=(e,t,n)=>class extends e{constructor(e){if(!arguments.length)throw new TypeError(`Failed to construct '${n}': 1 argument required, but only 0 present.`);const r=t[e];if(!r)throw new TypeError(`Failed to construct '${n}': Unsupported compression format: '${e}'`);let i,a=new r;super({start:e=>{a.ondata=(t,n,r)=>{t?e.error(t):n&&(e.enqueue(n),r&&(i?i():e.terminate()))}},transform:e=>{if(e instanceof ArrayBuffer)e=new Uint8Array(e);else{if(!ArrayBuffer.isView(e))throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}if(a.push(e),a.queuedSize>=32768)return new Promise((e=>{a.ondrain=()=>{a.queuedSize<32768&&e()}}))},flush:()=>new Promise((e=>{i=e,a.push(new Uint8Array(0),!0)}))},{size:e=>0|e.byteLength,highWaterMark:65536},{size:e=>0|e.byteLength,highWaterMark:65536})}};const Pe="undefined"==typeof globalThis?"undefined"==typeof self?"undefined"==typeof global?{}:global:self:globalThis;var Me;void 0===Pe.CompressionStream&&(Pe.CompressionStream=(Me=TransformStream,Le(Me,Ne,"CompressionStream"))),void 0===Pe.DecompressionStream&&(Pe.DecompressionStream=function(e){return Le(e,De,"DecompressionStream")}(TransformStream))},7879:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>Xe});var r=n(5959);function i(){return i=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},i.apply(this,arguments)}const a=["children","options"];var o,s,l;(l=o||(o={})).blockQuote="0",l.breakLine="1",l.breakThematic="2",l.codeBlock="3",l.codeFenced="4",l.codeInline="5",l.footnote="6",l.footnoteReference="7",l.gfmTask="8",l.heading="9",l.headingSetext="10",l.htmlBlock="11",l.htmlComment="12",l.htmlSelfClosing="13",l.image="14",l.link="15",l.linkAngleBraceStyleDetector="16",l.linkBareUrlDetector="17",l.linkMailtoDetector="18",l.newlineCoalescer="19",l.orderedList="20",l.paragraph="21",l.ref="22",l.refImage="23",l.refLink="24",l.table="25",l.tableSeparator="26",l.text="27",l.textBolded="28",l.textEmphasized="29",l.textEscaped="30",l.textMarked="31",l.textStrikethroughed="32",l.unorderedList="33",function(e){e[e.MAX=0]="MAX",e[e.HIGH=1]="HIGH",e[e.MED=2]="MED",e[e.LOW=3]="LOW",e[e.MIN=4]="MIN"}(s||(s={}));const u=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","className","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce(((e,t)=>(e[t.toLowerCase()]=t,e)),{for:"htmlFor"}),c={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},d=["style","script"],h=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,f=/mailto:/i,p=/\n{2,}$/,m=/^(\s*>[\s\S]*?)(?=\n{2,})/,g=/^ *> ?/gm,v=/^ {2,}\n/,y=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,b=/^\s*(`{3,}|~{3,}) *(\S+)?([^\n]*?)?\n([\s\S]+?)\s*\1 *(?:\n *)*\n?/,w=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,S=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,x=/^(?:\n *)*\n/,E=/\r\n?/g,_=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,O=/^\[\^([^\]]+)]/,k=/\f/g,T=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,C=/^\s*?\[(x|\s)\]/,I=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,R=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,A=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,N=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,D=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,L=/^<!--[\s\S]*?(?:-->)/,P=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,M=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,j=/^\{.*\}$/,F=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,V=/^<([^ >]+@[^ >]+)>/,$=/^<([^ >]+:\/[^ >]+)>/,B=/-([a-z])?/gi,z=/^(.*\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,U=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,q=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,H=/^\[([^\]]*)\] ?\[([^\]]*)\]/,W=/(\[|\])/g,G=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,K=/\t/g,Q=/(^ *\||\| *$)/g,Y=/^ *:-+: *$/,X=/^ *:-+ *$/,J=/^ *-+: *$/,Z="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~~.*?~~|==.*?==|.|\\n)*?)",ee=new RegExp(`^([*_])\\1${Z}\\1\\1(?!\\1)`),te=new RegExp(`^([*_])${Z}\\1(?!\\1|\\w)`),ne=new RegExp(`^==${Z}==`),re=new RegExp(`^~~${Z}~~`),ie=/^\\([^0-9A-Za-z\s])/,ae=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&#;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,oe=/^\n+/,se=/^([ \t]*)/,le=/\\([^\\])/g,ue=/ *\n+$/,ce=/(?:^|\n)( *)$/,de="(?:\\d+\\.)",he="(?:[*+-])";function fe(e){return"( *)("+(1===e?de:he)+") +"}const pe=fe(1),me=fe(2);function ge(e){return new RegExp("^"+(1===e?pe:me))}const ve=ge(1),ye=ge(2);function be(e){return new RegExp("^"+(1===e?pe:me)+"[^\\n]*(?:\\n(?!\\1"+(1===e?de:he)+" )[^\\n]*)*(\\n|$)","gm")}const we=be(1),Se=be(2);function xe(e){const t=1===e?de:he;return new RegExp("^( *)("+t+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+t+" (?!"+t+" ))\\n*|\\s*\\n*$)")}const Ee=xe(1),_e=xe(2);function Oe(e,t){const n=1===t,r=n?Ee:_e,i=n?we:Se,a=n?ve:ye;return{match(e,t,n){const i=ce.exec(n);return i&&(t.list||!t.inline&&!t.simple)?r.exec(e=i[1]+e):null},order:1,parse(e,t,r){const o=n?+e[2]:void 0,s=e[0].replace(p,"\n").match(i);let l=!1;return{items:s.map((function(e,n){const i=a.exec(e)[0].length,o=new RegExp("^ {1,"+i+"}","gm"),u=e.replace(o,"").replace(a,""),c=n===s.length-1,d=-1!==u.indexOf("\n\n")||c&&l;l=d;const h=r.inline,f=r.list;let p;r.list=!0,d?(r.inline=!1,p=u.replace(ue,"\n\n")):(r.inline=!0,p=u.replace(ue,""));const m=t(p,r);return r.inline=h,r.list=f,m})),ordered:n,start:o}},render:(t,n,r)=>e(t.ordered?"ol":"ul",{key:r.key,start:"20"===t.type?t.start:void 0},t.items.map((function(t,i){return e("li",{key:i},n(t,r))})))}}const ke=new RegExp("^\\[((?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*)\\]\\(\\s*<?((?:\\([^)]*\\)|[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*\\)"),Te=/^!\[(.*?)\]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,Ce=[m,b,w,I,A,R,L,z,we,Ee,Se,_e],Ie=[...Ce,/^[^\n]+(?: \n|\n{2,})/,N,M];function Re(e){return e.replace(/[ÀÁÂÃÄÅàáâãä忯]/g,"a").replace(/[çÇ]/g,"c").replace(/[ðÐ]/g,"d").replace(/[ÈÉÊËéèêë]/g,"e").replace(/[ÏïÎîÍíÌì]/g,"i").replace(/[Ññ]/g,"n").replace(/[øØœŒÕõÔôÓóÒò]/g,"o").replace(/[ÜüÛûÚúÙù]/g,"u").replace(/[ŸÿÝý]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase()}function Ae(e){return J.test(e)?"right":Y.test(e)?"center":X.test(e)?"left":null}function Ne(e,t,n,r){const i=n.inTable;n.inTable=!0;let a=e.trim().split(/( *(?:`[^`]*`|<.*?>.*?<\/.*?>(?!<\/.*?>)|\\\||\|) *)/).reduce(((e,i)=>("|"===i.trim()?e.push(r?{type:"26"}:{type:"27",text:i}):""!==i&&e.push.apply(e,t(i,n)),e)),[]);n.inTable=i;let o=[[]];return a.forEach((function(e,t){"26"===e.type?0!==t&&t!==a.length-1&&o.push([]):("27"!==e.type||null!=a[t+1]&&"26"!==a[t+1].type||(e.text=e.text.trimEnd()),o[o.length-1].push(e))})),o}function De(e,t,n){n.inline=!0;const r=e[2]?e[2].replace(Q,"").split("|").map(Ae):[],i=e[3]?function(e,t,n){return e.trim().split("\n").map((function(e){return Ne(e,t,n,!0)}))}(e[3],t,n):[],a=Ne(e[1],t,n,!!i.length);return n.inline=!1,i.length?{align:r,cells:i,header:a,type:"25"}:{children:a,type:"21"}}function Le(e,t){return null==e.align[t]?{}:{textAlign:e.align[t]}}function Pe(e){return function(t,n){return n.inline?e.exec(t):null}}function Me(e){return function(t,n){return n.inline||n.simple?e.exec(t):null}}function je(e){return function(t,n){return n.inline||n.simple?null:e.exec(t)}}function Fe(e){return function(t){return e.exec(t)}}function Ve(e,t,n){if(t.inline||t.simple)return null;if(n&&!n.endsWith("\n"))return null;let r="";e.split("\n").every((e=>!Ce.some((t=>t.test(e)))&&(r+=e+"\n",e.trim())));const i=r.trimEnd();return""==i?null:[r,i]}function $e(e){try{if(decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g,"").match(/^\s*(javascript|vbscript|data(?!:image)):/i))return}catch(e){return null}return e}function Be(e){return e.replace(le,"$1")}function ze(e,t,n){const r=n.inline||!1,i=n.simple||!1;n.inline=!0,n.simple=!0;const a=e(t,n);return n.inline=r,n.simple=i,a}function Ue(e,t,n){const r=n.inline||!1,i=n.simple||!1;n.inline=!1,n.simple=!0;const a=e(t,n);return n.inline=r,n.simple=i,a}function qe(e,t,n){const r=n.inline||!1;n.inline=!1;const i=e(t,n);return n.inline=r,i}const He=(e,t,n)=>({children:ze(t,e[1],n)});function We(){return{}}function Ge(){return null}function Ke(...e){return e.filter(Boolean).join(" ")}function Qe(e,t,n){let r=e;const i=t.split(".");for(;i.length&&(r=r[i[0]],void 0!==r);)i.shift();return r||n}function Ye(e="",t={}){t.overrides=t.overrides||{},t.slugify=t.slugify||Re,t.namedCodesToUnicode=t.namedCodesToUnicode?i({},c,t.namedCodesToUnicode):c;const n=t.createElement||r.createElement;function a(e,r,...a){const o=Qe(t.overrides,`${e}.props`,{});return n(function(e,t){const n=Qe(t,e);return n?"function"==typeof n||"object"==typeof n&&"render"in n?n:Qe(t,`${e}.component`,e):e}(e,t.overrides),i({},r,o,{className:Ke(null==r?void 0:r.className,o.className)||void 0}),...a)}function o(e){e=e.replace(T,"");let n=!1;t.forceInline?n=!0:t.forceBlock||(n=!1===G.test(e));const i=X(Y(n?e:`${e.trimEnd().replace(oe,"")}\n\n`,{inline:n}));for(;"string"==typeof i[i.length-1]&&!i[i.length-1].trim();)i.pop();if(null===t.wrapper)return i;const o=t.wrapper||(n?"span":"div");let s;if(i.length>1||t.forceWrapper)s=i;else{if(1===i.length)return s=i[0],"string"==typeof s?a("span",{key:"outer"},s):s;s=null}return r.createElement(o,{key:"outer"},s)}function s(e){const t=e.match(h);return t?t.reduce((function(e,t,n){const i=t.indexOf("=");if(-1!==i){const a=function(e){return-1!==e.indexOf("-")&&null===e.match(P)&&(e=e.replace(B,(function(e,t){return t.toUpperCase()}))),e}(t.slice(0,i)).trim(),s=function(e){const t=e[0];return('"'===t||"'"===t)&&e.length>=2&&e[e.length-1]===t?e.slice(1,-1):e}(t.slice(i+1).trim()),l=u[a]||a,c=e[l]=function(e,t){return"style"===e?t.split(/;\s?/).reduce((function(e,t){const n=t.slice(0,t.indexOf(":"));return e[n.trim().replace(/(-[a-z])/g,(e=>e[1].toUpperCase()))]=t.slice(n.length+1).trim(),e}),{}):"href"===e||"src"===e?$e(t):(t.match(j)&&(t=t.slice(1,t.length-1)),"true"===t||"false"!==t&&t)}(a,s);"string"==typeof c&&(N.test(c)||M.test(c))&&(e[l]=r.cloneElement(o(c.trim()),{key:n}))}else"style"!==t&&(e[u[t]||t]=!0);return e}),{}):null}const l=[],p={},Q={0:{match:je(m),order:1,parse:(e,t,n)=>({children:t(e[0].replace(g,""),n)}),render:(e,t,n)=>a("blockquote",{key:n.key},t(e.children,n))},1:{match:Fe(v),order:1,parse:We,render:(e,t,n)=>a("br",{key:n.key})},2:{match:je(y),order:1,parse:We,render:(e,t,n)=>a("hr",{key:n.key})},3:{match:je(w),order:0,parse:e=>({lang:void 0,text:e[0].replace(/^ {4}/gm,"").replace(/\n+$/,"")}),render:(e,t,n)=>a("pre",{key:n.key},a("code",i({},e.attrs,{className:e.lang?`lang-${e.lang}`:""}),e.text))},4:{match:je(b),order:0,parse:e=>({attrs:s(e[3]||""),lang:e[2]||void 0,text:e[4],type:"3"})},5:{match:Me(S),order:3,parse:e=>({text:e[2]}),render:(e,t,n)=>a("code",{key:n.key},e.text)},6:{match:je(_),order:0,parse:e=>(l.push({footnote:e[2],identifier:e[1]}),{}),render:Ge},7:{match:Pe(O),order:1,parse:e=>({target:`#${t.slugify(e[1])}`,text:e[1]}),render:(e,t,n)=>a("a",{key:n.key,href:$e(e.target)},a("sup",{key:n.key},e.text))},8:{match:Pe(C),order:1,parse:e=>({completed:"x"===e[1].toLowerCase()}),render:(e,t,n)=>a("input",{checked:e.completed,key:n.key,readOnly:!0,type:"checkbox"})},9:{match:je(t.enforceAtxHeadings?R:I),order:1,parse:(e,n,r)=>({children:ze(n,e[2],r),id:t.slugify(e[2]),level:e[1].length}),render:(e,t,n)=>a(`h${e.level}`,{id:e.id,key:n.key},t(e.children,n))},10:{match:je(A),order:0,parse:(e,t,n)=>({children:ze(t,e[1],n),level:"="===e[2]?1:2,type:"9"})},11:{match:Fe(N),order:1,parse(e,t,n){const[,r]=e[3].match(se),i=new RegExp(`^${r}`,"gm"),a=e[3].replace(i,""),o=(l=a,Ie.some((e=>e.test(l)))?qe:ze);var l;const u=e[1].toLowerCase(),c=-1!==d.indexOf(u),h={attrs:s(e[2]),noInnerParse:c,tag:(c?u:e[1]).trim()};return n.inAnchor=n.inAnchor||"a"===u,c?h.text=e[3]:h.children=o(t,a,n),n.inAnchor=!1,h},render:(e,t,n)=>a(e.tag,i({key:n.key},e.attrs),e.text||t(e.children,n))},13:{match:Fe(M),order:1,parse:e=>({attrs:s(e[2]||""),tag:e[1].trim()}),render:(e,t,n)=>a(e.tag,i({},e.attrs,{key:n.key}))},12:{match:Fe(L),order:1,parse:()=>({}),render:Ge},14:{match:Me(Te),order:1,parse:e=>({alt:e[1],target:Be(e[2]),title:e[3]}),render:(e,t,n)=>a("img",{key:n.key,alt:e.alt||void 0,title:e.title||void 0,src:$e(e.target)})},15:{match:Pe(ke),order:3,parse:(e,t,n)=>({children:Ue(t,e[1],n),target:Be(e[2]),title:e[3]}),render:(e,t,n)=>a("a",{key:n.key,href:$e(e.target),title:e.title},t(e.children,n))},16:{match:Pe($),order:0,parse:e=>({children:[{text:e[1],type:"27"}],target:e[1],type:"15"})},17:{match:(e,t)=>t.inAnchor?null:Pe(F)(e,t),order:0,parse:e=>({children:[{text:e[1],type:"27"}],target:e[1],title:void 0,type:"15"})},18:{match:Pe(V),order:0,parse(e){let t=e[1],n=e[1];return f.test(n)||(n="mailto:"+n),{children:[{text:t.replace("mailto:",""),type:"27"}],target:n,type:"15"}}},20:Oe(a,1),33:Oe(a,2),19:{match:je(x),order:3,parse:We,render:()=>"\n"},21:{match:Ve,order:3,parse:He,render:(e,t,n)=>a("p",{key:n.key},t(e.children,n))},22:{match:Pe(U),order:0,parse:e=>(p[e[1]]={target:e[2],title:e[4]},{}),render:Ge},23:{match:Me(q),order:0,parse:e=>({alt:e[1]||void 0,ref:e[2]}),render:(e,t,n)=>p[e.ref]?a("img",{key:n.key,alt:e.alt,src:$e(p[e.ref].target),title:p[e.ref].title}):null},24:{match:Pe(H),order:0,parse:(e,t,n)=>({children:t(e[1],n),fallbackChildren:t(e[0].replace(W,"\\$1"),n),ref:e[2]}),render:(e,t,n)=>p[e.ref]?a("a",{key:n.key,href:$e(p[e.ref].target),title:p[e.ref].title},t(e.children,n)):a("span",{key:n.key},t(e.fallbackChildren,n))},25:{match:je(z),order:1,parse:De,render(e,t,n){const r=e;return a("table",{key:n.key},a("thead",null,a("tr",null,r.header.map((function(e,i){return a("th",{key:i,style:Le(r,i)},t(e,n))})))),a("tbody",null,r.cells.map((function(e,i){return a("tr",{key:i},e.map((function(e,i){return a("td",{key:i,style:Le(r,i)},t(e,n))})))}))))}},27:{match:Fe(ae),order:4,parse:e=>({text:e[0].replace(D,((e,n)=>t.namedCodesToUnicode[n]?t.namedCodesToUnicode[n]:e))}),render:e=>e.text},28:{match:Me(ee),order:2,parse:(e,t,n)=>({children:t(e[2],n)}),render:(e,t,n)=>a("strong",{key:n.key},t(e.children,n))},29:{match:Me(te),order:3,parse:(e,t,n)=>({children:t(e[2],n)}),render:(e,t,n)=>a("em",{key:n.key},t(e.children,n))},30:{match:Me(ie),order:1,parse:e=>({text:e[1],type:"27"})},31:{match:Me(ne),order:3,parse:He,render:(e,t,n)=>a("mark",{key:n.key},t(e.children,n))},32:{match:Me(re),order:3,parse:He,render:(e,t,n)=>a("del",{key:n.key},t(e.children,n))}};!0===t.disableParsingRawHTML&&(delete Q[11],delete Q[13]);const Y=function(e){let t=Object.keys(e);function n(r,i){let a=[],o="";for(;r;){let s=0;for(;s<t.length;){const l=t[s],u=e[l],c=u.match(r,i,o);if(c){const e=c[0];r=r.substring(e.length);const t=u.parse(c,n,i);null==t.type&&(t.type=l),a.push(t),o=e;break}s++}}return a}return t.sort((function(t,n){let r=e[t].order,i=e[n].order;return r!==i?r-i:t<n?-1:1})),function(e,t){return n(function(e){return e.replace(E,"\n").replace(k,"").replace(K," ")}(e),t)}}(Q),X=(J=function(e,t){return function(n,r,i){const a=e[n.type].render;return t?t((()=>a(n,r,i)),n,r,i):a(n,r,i)}}(Q,t.renderRule),function e(t,n={}){if(Array.isArray(t)){const r=n.key,i=[];let a=!1;for(let r=0;r<t.length;r++){n.key=r;const o=e(t[r],n),s="string"==typeof o;s&&a?i[i.length-1]+=o:null!==o&&i.push(o),a=s}return n.key=r,i}return J(t,e,n)});var J;const Z=o(e);return l.length?a("div",null,Z,a("footer",{key:"footer"},l.map((function(e){return a("div",{id:t.slugify(e.identifier),key:e.identifier},e.identifier,X(Y(e.footnote,{inline:!0})))})))):Z}const Xe=e=>{let{children:t="",options:n}=e,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}(e,a);return r.cloneElement(Ye(t,n),i)}},8987:(e,t,n)=>{"use strict";n.d(t,{Ak:()=>r});let r=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t}},8537:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});class r{value;next;constructor(e){this.value=e}}class i{#Q;#Y;#X;constructor(){this.clear()}enqueue(e){const t=new r(e);this.#Q?(this.#Y.next=t,this.#Y=t):(this.#Q=t,this.#Y=t),this.#X++}dequeue(){const e=this.#Q;if(e)return this.#Q=this.#Q.next,this.#X--,e.value}peek(){if(this.#Q)return this.#Q.value}clear(){this.#Q=void 0,this.#Y=void 0,this.#X=0}get size(){return this.#X}*[Symbol.iterator](){let e=this.#Q;for(;e;)yield e.value,e=e.next}}function a(e){o(e);const t=new i;let n=0;const r=()=>{n<e&&t.size>0&&(t.dequeue()(),n++)},a=async(e,t,i)=>{const a=(async()=>e(...i))();t(a);try{await a}catch{}n--,r()},s=(i,...o)=>new Promise((s=>{((i,o,s)=>{new Promise((e=>{t.enqueue(e)})).then(a.bind(void 0,i,o,s)),(async()=>{await Promise.resolve(),n<e&&r()})()})(i,s,o)}));return Object.defineProperties(s,{activeCount:{get:()=>n},pendingCount:{get:()=>t.size},clearQueue:{value(){t.clear()}},concurrency:{get:()=>e,set(i){o(i),e=i,queueMicrotask((()=>{for(;n<e&&t.size>0;)r()}))}}}),s}function o(e){if(!Number.isInteger(e)&&e!==Number.POSITIVE_INFINITY||!(e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}},9215:(e,t,n)=>{"use strict";n.d(t,{mN:()=>Re,xI:()=>B});var r=n(5959),i=e=>"checkbox"===e.type,a=e=>e instanceof Date,o=e=>null==e;const s=e=>"object"==typeof e;var l=e=>!o(e)&&!Array.isArray(e)&&s(e)&&!a(e),u=e=>l(e)&&e.target?i(e.target)?e.target.checked:e.target.value:e,c=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),d=e=>{const t=e.constructor&&e.constructor.prototype;return l(t)&&t.hasOwnProperty("isPrototypeOf")},h="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function f(e){let t;const n=Array.isArray(e),r="undefined"!=typeof FileList&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(h&&(e instanceof Blob||r)||!n&&!l(e))return e;if(t=n?[]:{},n||d(e))for(const n in e)e.hasOwnProperty(n)&&(t[n]=f(e[n]));else t=e}return t}var p=e=>Array.isArray(e)?e.filter(Boolean):[],m=e=>void 0===e,g=(e,t,n)=>{if(!t||!l(e))return n;const r=p(t.split(/[,[\].]+?/)).reduce(((e,t)=>o(e)?e:e[t]),e);return m(r)||r===e?m(e[t])?n:e[t]:r},v=e=>"boolean"==typeof e,y=e=>/^\w*$/.test(e),b=e=>p(e.replace(/["|']|\]/g,"").split(/\.|\[/)),w=(e,t,n)=>{let r=-1;const i=y(t)?[t]:b(t),a=i.length,o=a-1;for(;++r<a;){const t=i[r];let a=n;if(r!==o){const n=e[t];a=l(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=a,e=e[t]}return e};const S={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},x={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},E="max",_="min",O="maxLength",k="minLength",T="pattern",C="required",I="validate",R=r.createContext(null),A=()=>r.useContext(R);var N=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(i,a,{get:()=>{const i=a;return t._proxyFormState[i]!==x.all&&(t._proxyFormState[i]=!r||x.all),n&&(n[i]=!0),e[i]}});return i},D=e=>l(e)&&!Object.keys(e).length,L=(e,t,n,r)=>{n(e);const{name:i,...a}=e;return D(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find((e=>t[e]===(!r||x.all)))},P=e=>Array.isArray(e)?e:[e],M=(e,t,n)=>!e||!t||e===t||P(e).some((e=>e&&(n?e===t:e.startsWith(t)||t.startsWith(e))));function j(e){const t=r.useRef(e);t.current=e,r.useEffect((()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}}),[e.disabled])}var F=e=>"string"==typeof e,V=(e,t,n,r,i)=>F(e)?(r&&t.watch.add(e),g(n,e,i)):Array.isArray(e)?e.map((e=>(r&&t.watch.add(e),g(n,e)))):(r&&(t.watchAll=!0),n);function $(e){const t=A(),{name:n,disabled:i,control:a=t.control,shouldUnregister:o}=e,s=c(a._names.array,n),l=function(e){const t=A(),{control:n=t.control,name:i,defaultValue:a,disabled:o,exact:s}=e||{},l=r.useRef(i);l.current=i,j({disabled:o,subject:n._subjects.values,next:e=>{M(l.current,e.name,s)&&c(f(V(l.current,n._names,e.values||n._formValues,!1,a)))}});const[u,c]=r.useState(n._getWatch(i,a));return r.useEffect((()=>n._removeUnmounted())),u}({control:a,name:n,defaultValue:g(a._formValues,n,g(a._defaultValues,n,e.defaultValue)),exact:!0}),d=function(e){const t=A(),{control:n=t.control,disabled:i,name:a,exact:o}=e||{},[s,l]=r.useState(n._formState),u=r.useRef(!0),c=r.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=r.useRef(a);return d.current=a,j({disabled:i,next:e=>u.current&&M(d.current,e.name,o)&&L(e,c.current,n._updateFormState)&&l({...n._formState,...e}),subject:n._subjects.state}),r.useEffect((()=>(u.current=!0,c.current.isValid&&n._updateValid(!0),()=>{u.current=!1})),[n]),r.useMemo((()=>N(s,n,c.current,!1)),[s,n])}({control:a,name:n,exact:!0}),h=r.useRef(a.register(n,{...e.rules,value:l,...v(e.disabled)?{disabled:e.disabled}:{}})),p=r.useMemo((()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!g(d.errors,n)},isDirty:{enumerable:!0,get:()=>!!g(d.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!g(d.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!g(d.validatingFields,n)},error:{enumerable:!0,get:()=>g(d.errors,n)}})),[d,n]),y=r.useMemo((()=>({name:n,value:l,...v(i)||d.disabled?{disabled:d.disabled||i}:{},onChange:e=>h.current.onChange({target:{value:u(e),name:n},type:S.CHANGE}),onBlur:()=>h.current.onBlur({target:{value:g(a._formValues,n),name:n},type:S.BLUR}),ref:e=>{const t=g(a._fields,n);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})}})),[n,a._formValues,i,d.disabled,l,a._fields]);return r.useEffect((()=>{const e=a._options.shouldUnregister||o,t=(e,t)=>{const n=g(a._fields,e);n&&n._f&&(n._f.mount=t)};if(t(n,!0),e){const e=f(g(a._options.defaultValues,n));w(a._defaultValues,n,e),m(g(a._formValues,n))&&w(a._formValues,n,e)}return!s&&a.register(n),()=>{(s?e&&!a._state.action:e)?a.unregister(n):t(n,!1)}}),[n,a,s,o]),r.useEffect((()=>{a._updateDisabledField({disabled:i,fields:a._fields,name:n})}),[i,n,a]),r.useMemo((()=>({field:y,formState:d,fieldState:p})),[y,d,p])}const B=e=>e.render($(e));var z=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},U=e=>({isOnSubmit:!e||e===x.onSubmit,isOnBlur:e===x.onBlur,isOnChange:e===x.onChange,isOnAll:e===x.all,isOnTouch:e===x.onTouched}),q=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length)))));const H=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const n=g(e,i);if(n){const{_f:e,...a}=n;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!r)return!0;if(e.ref&&t(e.ref,e.name)&&!r)return!0;if(H(a,t))break}else if(l(a)&&H(a,t))break}}};var W=(e,t,n)=>{const r=P(g(e,n));return w(r,"root",t[n]),w(e,n,r),e},G=e=>"file"===e.type,K=e=>"function"==typeof e,Q=e=>{if(!h)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Y=e=>F(e),X=e=>"radio"===e.type,J=e=>e instanceof RegExp;const Z={value:!1,isValid:!1},ee={value:!0,isValid:!0};var te=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!m(e[0].attributes.value)?m(e[0].value)||""===e[0].value?ee:{value:e[0].value,isValid:!0}:ee:Z}return Z};const ne={isValid:!1,value:null};var re=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),ne):ne;function ie(e,t,n="validate"){if(Y(e)||Array.isArray(e)&&e.every(Y)||v(e)&&!e)return{type:n,message:Y(e)?e:"",ref:t}}var ae=e=>l(e)&&!J(e)?e:{value:e,message:""},oe=async(e,t,n,r,a,s)=>{const{ref:u,refs:c,required:d,maxLength:h,minLength:f,min:p,max:y,pattern:b,validate:w,name:S,valueAsNumber:x,mount:R}=e._f,A=g(n,S);if(!R||t.has(S))return{};const N=c?c[0]:u,L=e=>{a&&N.reportValidity&&(N.setCustomValidity(v(e)?"":e||""),N.reportValidity())},P={},M=X(u),j=i(u),V=M||j,$=(x||G(u))&&m(u.value)&&m(A)||Q(u)&&""===u.value||""===A||Array.isArray(A)&&!A.length,B=z.bind(null,S,r,P),U=(e,t,n,r=O,i=k)=>{const a=e?t:n;P[S]={type:e?r:i,message:a,ref:u,...B(e?r:i,a)}};if(s?!Array.isArray(A)||!A.length:d&&(!V&&($||o(A))||v(A)&&!A||j&&!te(c).isValid||M&&!re(c).isValid)){const{value:e,message:t}=Y(d)?{value:!!d,message:d}:ae(d);if(e&&(P[S]={type:C,message:t,ref:N,...B(C,t)},!r))return L(t),P}if(!($||o(p)&&o(y))){let e,t;const n=ae(y),i=ae(p);if(o(A)||isNaN(A)){const r=u.valueAsDate||new Date(A),a=e=>new Date((new Date).toDateString()+" "+e),o="time"==u.type,s="week"==u.type;F(n.value)&&A&&(e=o?a(A)>a(n.value):s?A>n.value:r>new Date(n.value)),F(i.value)&&A&&(t=o?a(A)<a(i.value):s?A<i.value:r<new Date(i.value))}else{const r=u.valueAsNumber||(A?+A:A);o(n.value)||(e=r>n.value),o(i.value)||(t=r<i.value)}if((e||t)&&(U(!!e,n.message,i.message,E,_),!r))return L(P[S].message),P}if((h||f)&&!$&&(F(A)||s&&Array.isArray(A))){const e=ae(h),t=ae(f),n=!o(e.value)&&A.length>+e.value,i=!o(t.value)&&A.length<+t.value;if((n||i)&&(U(n,e.message,t.message),!r))return L(P[S].message),P}if(b&&!$&&F(A)){const{value:e,message:t}=ae(b);if(J(e)&&!A.match(e)&&(P[S]={type:T,message:t,ref:u,...B(T,t)},!r))return L(t),P}if(w)if(K(w)){const e=ie(await w(A,n),N);if(e&&(P[S]={...e,...B(I,e.message)},!r))return L(e.message),P}else if(l(w)){let e={};for(const t in w){if(!D(e)&&!r)break;const i=ie(await w[t](A,n),N,t);i&&(e={...i,...B(t,i.message)},L(i.message),r&&(P[S]=e))}if(!D(e)&&(P[S]={ref:N,...e},!r))return P}return L(!0),P};function se(e,t){const n=Array.isArray(t)?t:y(t)?[t]:b(t),r=1===n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=m(e)?r++:e[t[r++]];return e}(e,n),i=n.length-1,a=n[i];return r&&delete r[a],0!==i&&(l(r)&&D(r)||Array.isArray(r)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!m(e[t]))return!1;return!0}(r))&&se(e,n.slice(0,-1)),e}var le=()=>{let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}},ue=e=>o(e)||!s(e);function ce(e,t){if(ue(e)||ue(t))return e===t;if(a(e)&&a(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const n=e[i];if(!r.includes(i))return!1;if("ref"!==i){const e=t[i];if(a(n)&&a(e)||l(n)&&l(e)||Array.isArray(n)&&Array.isArray(e)?!ce(n,e):n!==e)return!1}}return!0}var de=e=>"select-multiple"===e.type,he=e=>X(e)||i(e),fe=e=>Q(e)&&e.isConnected,pe=e=>{for(const t in e)if(K(e[t]))return!0;return!1};function me(e,t={}){const n=Array.isArray(e);if(l(e)||n)for(const n in e)Array.isArray(e[n])||l(e[n])&&!pe(e[n])?(t[n]=Array.isArray(e[n])?[]:{},me(e[n],t[n])):o(e[n])||(t[n]=!0);return t}function ge(e,t,n){const r=Array.isArray(e);if(l(e)||r)for(const r in e)Array.isArray(e[r])||l(e[r])&&!pe(e[r])?m(t)||ue(n[r])?n[r]=Array.isArray(e[r])?me(e[r],[]):{...me(e[r])}:ge(e[r],o(t)?{}:t[r],n[r]):n[r]=!ce(e[r],t[r]);return n}var ve=(e,t)=>ge(e,t,me(t)),ye=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>m(e)?e:t?""===e?NaN:e?+e:e:n&&F(e)?new Date(e):r?r(e):e;function be(e){const t=e.ref;return G(t)?t.files:X(t)?re(e.refs).value:de(t)?[...t.selectedOptions].map((({value:e})=>e)):i(t)?te(e.refs).value:ye(m(t.value)?e.ref.value:t.value,e)}var we=(e,t,n,r)=>{const i={};for(const n of e){const e=g(t,n);e&&w(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},Se=e=>m(e)?e:J(e)?e.source:l(e)?J(e.value)?e.value.source:e.value:e;const xe="AsyncFunction";var Ee=e=>!!e&&!!e.validate&&!!(K(e.validate)&&e.validate.constructor.name===xe||l(e.validate)&&Object.values(e.validate).find((e=>e.constructor.name===xe))),_e=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Oe(e,t,n){const r=g(e,n);if(r||y(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const r=i.join("."),a=g(t,r),o=g(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(o&&o.type)return{name:r,error:o};i.pop()}return{name:n}}var ke=(e,t,n,r,i)=>!i.isOnAll&&(!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:!(n?r.isOnChange:i.isOnChange)||e),Te=(e,t)=>!p(g(e,t)).length&&se(e,t);const Ce={mode:x.onSubmit,reValidateMode:x.onChange,shouldFocusError:!0};function Ie(e={}){let t,n={...Ce,...e},r={submitCount:0,isDirty:!1,isLoading:K(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1},s={},d=(l(n.defaultValues)||l(n.values))&&f(n.defaultValues||n.values)||{},y=n.shouldUnregister?{}:f(d),b={action:!1,mount:!1,watch:!1},E={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},_=0;const O={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},k={values:le(),array:le(),state:le()},T=U(n.mode),C=U(n.reValidateMode),I=n.criteriaMode===x.all,R=async e=>{if(!n.disabled&&(O.isValid||e)){const e=n.resolver?D((await j()).errors):await $(s,!0);e!==r.isValid&&k.state.next({isValid:e})}},A=(e,t)=>{n.disabled||!O.isValidating&&!O.validatingFields||((e||Array.from(E.mount)).forEach((e=>{e&&(t?w(r.validatingFields,e,t):se(r.validatingFields,e))})),k.state.next({validatingFields:r.validatingFields,isValidating:!D(r.validatingFields)}))},N=(e,t,n,r)=>{const i=g(s,e);if(i){const a=g(y,e,m(n)?g(d,e):n);m(a)||r&&r.defaultChecked||t?w(y,e,t?a:be(i._f)):Y(e,a),b.mount&&R()}},L=(e,t,i,a,o)=>{let l=!1,u=!1;const c={name:e};if(!n.disabled){const n=!!(g(s,e)&&g(s,e)._f&&g(s,e)._f.disabled);if(!i||a){O.isDirty&&(u=r.isDirty,r.isDirty=c.isDirty=B(),l=u!==c.isDirty);const i=n||ce(g(d,e),t);u=!(n||!g(r.dirtyFields,e)),i||n?se(r.dirtyFields,e):w(r.dirtyFields,e,!0),c.dirtyFields=r.dirtyFields,l=l||O.dirtyFields&&u!==!i}if(i){const t=g(r.touchedFields,e);t||(w(r.touchedFields,e,i),c.touchedFields=r.touchedFields,l=l||O.touchedFields&&t!==i)}l&&o&&k.state.next(c)}return l?c:{}},M=(e,i,a,o)=>{const s=g(r.errors,e),l=O.isValid&&v(i)&&r.isValid!==i;var u;if(n.delayError&&a?(u=()=>((e,t)=>{w(r.errors,e,t),k.state.next({errors:r.errors})})(e,a),t=e=>{clearTimeout(_),_=setTimeout(u,e)},t(n.delayError)):(clearTimeout(_),t=null,a?w(r.errors,e,a):se(r.errors,e)),(a?!ce(s,a):s)||!D(o)||l){const t={...o,...l&&v(i)?{isValid:i}:{},errors:r.errors,name:e};r={...r,...t},k.state.next(t)}},j=async e=>{A(e,!0);const t=await n.resolver(y,n.context,we(e||E.mount,s,n.criteriaMode,n.shouldUseNativeValidation));return A(e),t},$=async(e,t,i={valid:!0})=>{for(const a in e){const o=e[a];if(o){const{_f:e,...s}=o;if(e){const s=E.array.has(e.name),l=o._f&&Ee(o._f);l&&O.validatingFields&&A([a],!0);const u=await oe(o,E.disabled,y,I,n.shouldUseNativeValidation&&!t,s);if(l&&O.validatingFields&&A([a]),u[e.name]&&(i.valid=!1,t))break;!t&&(g(u,e.name)?s?W(r.errors,u,e.name):w(r.errors,e.name,u[e.name]):se(r.errors,e.name))}!D(s)&&await $(s,t,i)}}return i.valid},B=(e,t)=>!n.disabled&&(e&&t&&w(y,e,t),!ce(ne(),d)),z=(e,t,n)=>V(e,E,{...b.mount?y:m(t)?d:F(e)?{[e]:t}:t},n,t),Y=(e,t,n={})=>{const r=g(s,e);let a=t;if(r){const n=r._f;n&&(!n.disabled&&w(y,e,ye(t,n)),a=Q(n.ref)&&o(t)?"":t,de(n.ref)?[...n.ref.options].forEach((e=>e.selected=a.includes(e.value))):n.refs?i(n.ref)?n.refs.length>1?n.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(a)?!!a.find((t=>t===e.value)):a===e.value))):n.refs[0]&&(n.refs[0].checked=!!a):n.refs.forEach((e=>e.checked=e.value===a)):G(n.ref)?n.ref.value="":(n.ref.value=a,n.ref.type||k.values.next({name:e,values:{...y}})))}(n.shouldDirty||n.shouldTouch)&&L(e,a,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&te(e)},X=(e,t,n)=>{for(const r in t){const i=t[r],o=`${e}.${r}`,u=g(s,o);(E.array.has(e)||l(i)||u&&!u._f)&&!a(i)?X(o,i,n):Y(o,i,n)}},J=(e,t,n={})=>{const i=g(s,e),a=E.array.has(e),l=f(t);w(y,e,l),a?(k.array.next({name:e,values:{...y}}),(O.isDirty||O.dirtyFields)&&n.shouldDirty&&k.state.next({name:e,dirtyFields:ve(d,y),isDirty:B(e,l)})):!i||i._f||o(l)?Y(e,l,n):X(e,l,n),q(e,E)&&k.state.next({...r}),k.values.next({name:b.mount?e:void 0,values:{...y}})},Z=async e=>{b.mount=!0;const i=e.target;let o=i.name,l=!0;const c=g(s,o),d=e=>{l=Number.isNaN(e)||a(e)&&isNaN(e.getTime())||ce(e,g(y,o,e))};if(c){let a,h;const f=i.type?be(c._f):u(e),p=e.type===S.BLUR||e.type===S.FOCUS_OUT,m=!_e(c._f)&&!n.resolver&&!g(r.errors,o)&&!c._f.deps||ke(p,g(r.touchedFields,o),r.isSubmitted,C,T),v=q(o,E,p);w(y,o,f),p?(c._f.onBlur&&c._f.onBlur(e),t&&t(0)):c._f.onChange&&c._f.onChange(e);const b=L(o,f,p,!1),x=!D(b)||v;if(!p&&k.values.next({name:o,type:e.type,values:{...y}}),m)return O.isValid&&("onBlur"===n.mode&&p?R():p||R()),x&&k.state.next({name:o,...v?{}:b});if(!p&&v&&k.state.next({...r}),n.resolver){const{errors:e}=await j([o]);if(d(f),l){const t=Oe(r.errors,s,o),n=Oe(e,s,t.name||o);a=n.error,o=n.name,h=D(e)}}else A([o],!0),a=(await oe(c,E.disabled,y,I,n.shouldUseNativeValidation))[o],A([o]),d(f),l&&(a?h=!1:O.isValid&&(h=await $(s,!0)));l&&(c._f.deps&&te(c._f.deps),M(o,h,a,b))}},ee=(e,t)=>{if(g(r.errors,t)&&e.focus)return e.focus(),1},te=async(e,t={})=>{let i,a;const o=P(e);if(n.resolver){const t=await(async e=>{const{errors:t}=await j(e);if(e)for(const n of e){const e=g(t,n);e?w(r.errors,n,e):se(r.errors,n)}else r.errors=t;return t})(m(e)?e:o);i=D(t),a=e?!o.some((e=>g(t,e))):i}else e?(a=(await Promise.all(o.map((async e=>{const t=g(s,e);return await $(t&&t._f?{[e]:t}:t)})))).every(Boolean),(a||r.isValid)&&R()):a=i=await $(s);return k.state.next({...!F(e)||O.isValid&&i!==r.isValid?{}:{name:e},...n.resolver||!e?{isValid:i}:{},errors:r.errors}),t.shouldFocus&&!a&&H(s,ee,e?o:E.mount),a},ne=e=>{const t={...b.mount?y:d};return m(e)?t:F(e)?g(t,e):e.map((e=>g(t,e)))},re=(e,t)=>({invalid:!!g((t||r).errors,e),isDirty:!!g((t||r).dirtyFields,e),error:g((t||r).errors,e),isValidating:!!g(r.validatingFields,e),isTouched:!!g((t||r).touchedFields,e)}),ie=(e,t,n)=>{const i=(g(s,e,{_f:{}})._f||{}).ref,a=g(r.errors,e)||{},{ref:o,message:l,type:u,...c}=a;w(r.errors,e,{...c,...t,ref:i}),k.state.next({name:e,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&i&&i.focus&&i.focus()},ae=(e,t={})=>{for(const i of e?P(e):E.mount)E.mount.delete(i),E.array.delete(i),t.keepValue||(se(s,i),se(y,i)),!t.keepError&&se(r.errors,i),!t.keepDirty&&se(r.dirtyFields,i),!t.keepTouched&&se(r.touchedFields,i),!t.keepIsValidating&&se(r.validatingFields,i),!n.shouldUnregister&&!t.keepDefaultValue&&se(d,i);k.values.next({values:{...y}}),k.state.next({...r,...t.keepDirty?{isDirty:B()}:{}}),!t.keepIsValid&&R()},ue=({disabled:e,name:t,field:n,fields:r})=>{(v(e)&&b.mount||e||E.disabled.has(t))&&(e?E.disabled.add(t):E.disabled.delete(t),L(t,be(n?n._f:g(r,t)._f),!1,!1,!0))},pe=(e,t={})=>{let r=g(s,e);const i=v(t.disabled)||v(n.disabled);return w(s,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),E.mount.add(e),r?ue({field:r,disabled:v(t.disabled)?t.disabled:n.disabled,name:e}):N(e,!0,t.value),{...i?{disabled:t.disabled||n.disabled}:{},...n.progressive?{required:!!t.required,min:Se(t.min),max:Se(t.max),minLength:Se(t.minLength),maxLength:Se(t.maxLength),pattern:Se(t.pattern)}:{},name:e,onChange:Z,onBlur:Z,ref:i=>{if(i){pe(e,t),r=g(s,e);const n=m(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,a=he(n),o=r._f.refs||[];if(a?o.find((e=>e===n)):n===r._f.ref)return;w(s,e,{_f:{...r._f,...a?{refs:[...o.filter(fe),n,...Array.isArray(g(d,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),N(e,!1,void 0,n)}else r=g(s,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!c(E.array,e)||!b.action)&&E.unMount.add(e)}}},me=()=>n.shouldFocusError&&H(s,ee,E.mount),ge=(e,t)=>async i=>{let a;i&&(i.preventDefault&&i.preventDefault(),i.persist&&i.persist());let o=f(y);if(E.disabled.size)for(const e of E.disabled)w(o,e,void 0);if(k.state.next({isSubmitting:!0}),n.resolver){const{errors:e,values:t}=await j();r.errors=e,o=t}else await $(s);if(se(r.errors,"root"),D(r.errors)){k.state.next({errors:{}});try{await e(o,i)}catch(e){a=e}}else t&&await t({...r.errors},i),me(),setTimeout(me);if(k.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:D(r.errors)&&!a,submitCount:r.submitCount+1,errors:r.errors}),a)throw a},xe=(e,t={})=>{const i=e?f(e):d,a=f(i),o=D(e),l=o?d:a;if(t.keepDefaultValues||(d=i),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...E.mount,...Object.keys(ve(d,y))]);for(const t of Array.from(e))g(r.dirtyFields,t)?w(l,t,g(y,t)):J(t,g(l,t))}else{if(h&&m(e))for(const e of E.mount){const t=g(s,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Q(e)){const t=e.closest("form");if(t){t.reset();break}}}}s={}}y=n.shouldUnregister?t.keepDefaultValues?f(d):{}:f(l),k.array.next({values:{...l}}),k.values.next({values:{...l}})}E={mount:t.keepDirtyValues?E.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},b.mount=!O.isValid||!!t.keepIsValid||!!t.keepDirtyValues,b.watch=!!n.shouldUnregister,k.state.next({submitCount:t.keepSubmitCount?r.submitCount:0,isDirty:!o&&(t.keepDirty?r.isDirty:!(!t.keepDefaultValues||ce(e,d))),isSubmitted:!!t.keepIsSubmitted&&r.isSubmitted,dirtyFields:o?{}:t.keepDirtyValues?t.keepDefaultValues&&y?ve(d,y):r.dirtyFields:t.keepDefaultValues&&e?ve(d,e):t.keepDirty?r.dirtyFields:{},touchedFields:t.keepTouched?r.touchedFields:{},errors:t.keepErrors?r.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&r.isSubmitSuccessful,isSubmitting:!1})},Ie=(e,t)=>xe(K(e)?e(y):e,t);return{control:{register:pe,unregister:ae,getFieldState:re,handleSubmit:ge,setError:ie,_executeSchema:j,_getWatch:z,_getDirty:B,_updateValid:R,_removeUnmounted:()=>{for(const e of E.unMount){const t=g(s,e);t&&(t._f.refs?t._f.refs.every((e=>!fe(e))):!fe(t._f.ref))&&ae(e)}E.unMount=new Set},_updateFieldArray:(e,t=[],i,a,o=!0,l=!0)=>{if(a&&i&&!n.disabled){if(b.action=!0,l&&Array.isArray(g(s,e))){const t=i(g(s,e),a.argA,a.argB);o&&w(s,e,t)}if(l&&Array.isArray(g(r.errors,e))){const t=i(g(r.errors,e),a.argA,a.argB);o&&w(r.errors,e,t),Te(r.errors,e)}if(O.touchedFields&&l&&Array.isArray(g(r.touchedFields,e))){const t=i(g(r.touchedFields,e),a.argA,a.argB);o&&w(r.touchedFields,e,t)}O.dirtyFields&&(r.dirtyFields=ve(d,y)),k.state.next({name:e,isDirty:B(e,t),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else w(y,e,t)},_updateDisabledField:ue,_getFieldArray:e=>p(g(b.mount?y:d,e,n.shouldUnregister?g(d,e,[]):[])),_reset:xe,_resetDefaultValues:()=>K(n.defaultValues)&&n.defaultValues().then((e=>{Ie(e,n.resetOptions),k.state.next({isLoading:!1})})),_updateFormState:e=>{r={...r,...e}},_disableForm:e=>{v(e)&&(k.state.next({disabled:e}),H(s,((t,n)=>{const r=g(s,n);r&&(t.disabled=r._f.disabled||e,Array.isArray(r._f.refs)&&r._f.refs.forEach((t=>{t.disabled=r._f.disabled||e})))}),0,!1))},_subjects:k,_proxyFormState:O,_setErrors:e=>{r.errors=e,k.state.next({errors:r.errors,isValid:!1})},get _fields(){return s},get _formValues(){return y},get _state(){return b},set _state(e){b=e},get _defaultValues(){return d},get _names(){return E},set _names(e){E=e},get _formState(){return r},set _formState(e){r=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:te,register:pe,handleSubmit:ge,watch:(e,t)=>K(e)?k.values.subscribe({next:n=>e(z(void 0,t),n)}):z(e,t,!0),setValue:J,getValues:ne,reset:Ie,resetField:(e,t={})=>{g(s,e)&&(m(t.defaultValue)?J(e,f(g(d,e))):(J(e,t.defaultValue),w(d,e,f(t.defaultValue))),t.keepTouched||se(r.touchedFields,e),t.keepDirty||(se(r.dirtyFields,e),r.isDirty=t.defaultValue?B(e,f(g(d,e))):B()),t.keepError||(se(r.errors,e),O.isValid&&R()),k.state.next({...r}))},clearErrors:e=>{e&&P(e).forEach((e=>se(r.errors,e))),k.state.next({errors:e?r.errors:{}})},unregister:ae,setError:ie,setFocus:(e,t={})=>{const n=g(s,e),r=n&&n._f;if(r){const e=r.refs?r.refs[0]:r.ref;e.focus&&(e.focus(),t.shouldSelect&&K(e.select)&&e.select())}},getFieldState:re}}function Re(e={}){const t=r.useRef(void 0),n=r.useRef(void 0),[i,a]=r.useState({isDirty:!1,isValidating:!1,isLoading:K(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:K(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Ie(e),formState:i});const o=t.current.control;return o._options=e,j({subject:o._subjects.state,next:e=>{L(e,o._proxyFormState,o._updateFormState,!0)&&a({...o._formState})}}),r.useEffect((()=>o._disableForm(e.disabled)),[o,e.disabled]),r.useEffect((()=>{if(o._proxyFormState.isDirty){const e=o._getDirty();e!==i.isDirty&&o._subjects.state.next({isDirty:e})}}),[o,i.isDirty]),r.useEffect((()=>{e.values&&!ce(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,a((e=>({...e})))):o._resetDefaultValues()}),[e.values,o]),r.useEffect((()=>{e.errors&&o._setErrors(e.errors)}),[e.errors,o]),r.useEffect((()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()})),r.useEffect((()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})}),[e.shouldUnregister,o]),t.current.formState=N(i,o),t.current}},1792:(e,t,n)=>{"use strict";n.d(t,{A:()=>O});var r=n(5959),i=e=>"string"!=typeof e?{}:e.split(/ ?; ?/).reduce(((e,t)=>{const[n,r]=t.split(/ ?: ?/).map(((e,t)=>0===t?e.replace(/\s+/g,""):e.trim()));if(n&&r){const t=n.replace(/(\w)-(\w)/g,((e,t,n)=>`${t}${n.toUpperCase()}`));let i=r.trim();Number.isNaN(Number(r))||(i=Number(r)),e[n.startsWith("-")?n:t]=i}return e}),{});var a=["br","col","colgroup","dl","hr","iframe","img","input","link","menuitem","meta","ol","param","select","table","tbody","tfoot","thead","tr","ul","wbr"],o={"accept-charset":"acceptCharset",acceptcharset:"acceptCharset",accesskey:"accessKey",allowfullscreen:"allowFullScreen",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autocorrect:"autoCorrect",autofocus:"autoFocus",autoplay:"autoPlay",autosave:"autoSave",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",class:"className",classid:"classID",classname:"className",colspan:"colSpan",contenteditable:"contentEditable",contextmenu:"contextMenu",controlslist:"controlsList",crossorigin:"crossOrigin",dangerouslysetinnerhtml:"dangerouslySetInnerHTML",datetime:"dateTime",defaultchecked:"defaultChecked",defaultvalue:"defaultValue",enctype:"encType",for:"htmlFor",formmethod:"formMethod",formaction:"formAction",formenctype:"formEncType",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",hreflang:"hrefLang",htmlfor:"htmlFor",httpequiv:"httpEquiv","http-equiv":"httpEquiv",icon:"icon",innerhtml:"innerHTML",inputmode:"inputMode",itemid:"itemID",itemprop:"itemProp",itemref:"itemRef",itemscope:"itemScope",itemtype:"itemType",keyparams:"keyParams",keytype:"keyType",marginwidth:"marginWidth",marginheight:"marginHeight",maxlength:"maxLength",mediagroup:"mediaGroup",minlength:"minLength",nomodule:"noModule",novalidate:"noValidate",playsinline:"playsInline",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rowspan:"rowSpan",spellcheck:"spellCheck",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex",typemustmatch:"typeMustMatch",usemap:"useMap",accentheight:"accentHeight","accent-height":"accentHeight",alignmentbaseline:"alignmentBaseline","alignment-baseline":"alignmentBaseline",allowreorder:"allowReorder",arabicform:"arabicForm","arabic-form":"arabicForm",attributename:"attributeName",attributetype:"attributeType",autoreverse:"autoReverse",basefrequency:"baseFrequency",baselineshift:"baselineShift","baseline-shift":"baselineShift",baseprofile:"baseProfile",calcmode:"calcMode",capheight:"capHeight","cap-height":"capHeight",clippath:"clipPath","clip-path":"clipPath",clippathunits:"clipPathUnits",cliprule:"clipRule","clip-rule":"clipRule",colorinterpolation:"colorInterpolation","color-interpolation":"colorInterpolation",colorinterpolationfilters:"colorInterpolationFilters","color-interpolation-filters":"colorInterpolationFilters",colorprofile:"colorProfile","color-profile":"colorProfile",colorrendering:"colorRendering","color-rendering":"colorRendering",contentscripttype:"contentScriptType",contentstyletype:"contentStyleType",diffuseconstant:"diffuseConstant",dominantbaseline:"dominantBaseline","dominant-baseline":"dominantBaseline",edgemode:"edgeMode",enablebackground:"enableBackground","enable-background":"enableBackground",externalresourcesrequired:"externalResourcesRequired",fillopacity:"fillOpacity","fill-opacity":"fillOpacity",fillrule:"fillRule","fill-rule":"fillRule",filterres:"filterRes",filterunits:"filterUnits",floodopacity:"floodOpacity","flood-opacity":"floodOpacity",floodcolor:"floodColor","flood-color":"floodColor",fontfamily:"fontFamily","font-family":"fontFamily",fontsize:"fontSize","font-size":"fontSize",fontsizeadjust:"fontSizeAdjust","font-size-adjust":"fontSizeAdjust",fontstretch:"fontStretch","font-stretch":"fontStretch",fontstyle:"fontStyle","font-style":"fontStyle",fontvariant:"fontVariant","font-variant":"fontVariant",fontweight:"fontWeight","font-weight":"fontWeight",glyphname:"glyphName","glyph-name":"glyphName",glyphorientationhorizontal:"glyphOrientationHorizontal","glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphorientationvertical:"glyphOrientationVertical","glyph-orientation-vertical":"glyphOrientationVertical",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",horizadvx:"horizAdvX","horiz-adv-x":"horizAdvX",horizoriginx:"horizOriginX","horiz-origin-x":"horizOriginX",imagerendering:"imageRendering","image-rendering":"imageRendering",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",letterspacing:"letterSpacing","letter-spacing":"letterSpacing",lightingcolor:"lightingColor","lighting-color":"lightingColor",limitingconeangle:"limitingConeAngle",markerend:"markerEnd","marker-end":"markerEnd",markerheight:"markerHeight",markermid:"markerMid","marker-mid":"markerMid",markerstart:"markerStart","marker-start":"markerStart",markerunits:"markerUnits",markerwidth:"markerWidth",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",numoctaves:"numOctaves",overlineposition:"overlinePosition","overline-position":"overlinePosition",overlinethickness:"overlineThickness","overline-thickness":"overlineThickness",paintorder:"paintOrder","paint-order":"paintOrder","panose-1":"panose1",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointerevents:"pointerEvents","pointer-events":"pointerEvents",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",refx:"refX",refy:"refY",renderingintent:"renderingIntent","rendering-intent":"renderingIntent",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",shaperendering:"shapeRendering","shape-rendering":"shapeRendering",specularconstant:"specularConstant",specularexponent:"specularExponent",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stitchtiles:"stitchTiles",stopcolor:"stopColor","stop-color":"stopColor",stopopacity:"stopOpacity","stop-opacity":"stopOpacity",strikethroughposition:"strikethroughPosition","strikethrough-position":"strikethroughPosition",strikethroughthickness:"strikethroughThickness","strikethrough-thickness":"strikethroughThickness",strokedasharray:"strokeDasharray","stroke-dasharray":"strokeDasharray",strokedashoffset:"strokeDashoffset","stroke-dashoffset":"strokeDashoffset",strokelinecap:"strokeLinecap","stroke-linecap":"strokeLinecap",strokelinejoin:"strokeLinejoin","stroke-linejoin":"strokeLinejoin",strokemiterlimit:"strokeMiterlimit","stroke-miterlimit":"strokeMiterlimit",strokewidth:"strokeWidth","stroke-width":"strokeWidth",strokeopacity:"strokeOpacity","stroke-opacity":"strokeOpacity",suppresscontenteditablewarning:"suppressContentEditableWarning",suppresshydrationwarning:"suppressHydrationWarning",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textanchor:"textAnchor","text-anchor":"textAnchor",textdecoration:"textDecoration","text-decoration":"textDecoration",textlength:"textLength",textrendering:"textRendering","text-rendering":"textRendering",underlineposition:"underlinePosition","underline-position":"underlinePosition",underlinethickness:"underlineThickness","underline-thickness":"underlineThickness",unicodebidi:"unicodeBidi","unicode-bidi":"unicodeBidi",unicoderange:"unicodeRange","unicode-range":"unicodeRange",unitsperem:"unitsPerEm","units-per-em":"unitsPerEm",unselectable:"unselectable",valphabetic:"vAlphabetic","v-alphabetic":"vAlphabetic",vectoreffect:"vectorEffect","vector-effect":"vectorEffect",vertadvy:"vertAdvY","vert-adv-y":"vertAdvY",vertoriginx:"vertOriginX","vert-origin-x":"vertOriginX",vertoriginy:"vertOriginY","vert-origin-y":"vertOriginY",vhanging:"vHanging","v-hanging":"vHanging",videographic:"vIdeographic","v-ideographic":"vIdeographic",viewbox:"viewBox",viewtarget:"viewTarget",vmathematical:"vMathematical","v-mathematical":"vMathematical",wordspacing:"wordSpacing","word-spacing":"wordSpacing",writingmode:"writingMode","writing-mode":"writingMode",xchannelselector:"xChannelSelector",xheight:"xHeight","x-height":"xHeight",xlinkactuate:"xlinkActuate","xlink:actuate":"xlinkActuate",xlinkarcrole:"xlinkArcrole","xlink:arcrole":"xlinkArcrole",xlinkhref:"xlinkHref","xlink:href":"xlinkHref",xlinkrole:"xlinkRole","xlink:role":"xlinkRole",xlinkshow:"xlinkShow","xlink:show":"xlinkShow",xlinktitle:"xlinkTitle","xlink:title":"xlinkTitle",xlinktype:"xlinkType","xlink:type":"xlinkType",xmlbase:"xmlBase","xml:base":"xmlBase",xmllang:"xmlLang","xml:lang":"xmlLang","xml:space":"xmlSpace",xmlnsxlink:"xmlnsXlink","xmlns:xlink":"xmlnsXlink",xmlspace:"xmlSpace",ychannelselector:"yChannelSelector",zoomandpan:"zoomAndPan",onblur:"onBlur",onchange:"onChange",onclick:"onClick",oncontextmenu:"onContextMenu",ondoubleclick:"onDoubleClick",ondrag:"onDrag",ondragend:"onDragEnd",ondragenter:"onDragEnter",ondragexit:"onDragExit",ondragleave:"onDragLeave",ondragover:"onDragOver",ondragstart:"onDragStart",ondrop:"onDrop",onerror:"onError",onfocus:"onFocus",oninput:"onInput",oninvalid:"onInvalid",onkeydown:"onKeyDown",onkeypress:"onKeyPress",onkeyup:"onKeyUp",onload:"onLoad",onmousedown:"onMouseDown",onmouseenter:"onMouseEnter",onmouseleave:"onMouseLeave",onmousemove:"onMouseMove",onmouseout:"onMouseOut",onmouseover:"onMouseOver",onmouseup:"onMouseUp",onscroll:"onScroll",onsubmit:"onSubmit",ontouchcancel:"onTouchCancel",ontouchend:"onTouchEnd",ontouchmove:"onTouchMove",ontouchstart:"onTouchStart",onwheel:"onWheel"};function s(e,t){const{key:n,level:s,...u}=t;switch(e.nodeType){case 1:return r.createElement(function(e){if(/[a-z]+[A-Z]+[a-z]+/.test(e))return e;return e.toLowerCase()}(e.nodeName),function(e,t){const n={key:t};if(e instanceof Element){const t=e.getAttribute("class");t&&(n.className=t),[...e.attributes].forEach((e=>{switch(e.name){case"class":break;case"style":n[e.name]=i(e.value);break;case"allowfullscreen":case"allowpaymentrequest":case"async":case"autofocus":case"autoplay":case"checked":case"controls":case"default":case"defer":case"disabled":case"formnovalidate":case"hidden":case"ismap":case"itemscope":case"loop":case"multiple":case"muted":case"nomodule":case"novalidate":case"open":case"readonly":case"required":case"reversed":case"selected":case"typemustmatch":n[o[e.name]||e.name]=!0;break;default:n[o[e.name]||e.name]=e.value}}))}return n}(e,n),l(e.childNodes,s,u));case 3:{const t=e.nodeValue?.toString()??"";if(!u.allowWhiteSpaces&&/^\s+$/.test(t)&&!/[\u00A0\u202F]/.test(t))return null;if(!e.parentNode)return t;const n=e.parentNode.nodeName.toLowerCase();return a.includes(n)?(/\S/.test(t)&&console.warn(`A textNode is not allowed inside '${n}'. Your text "${t}" will be ignored`),null):t}case 8:default:return null;case 11:return l(e.childNodes,s,t)}}function l(e,t,n){const r=[...e].map(((e,r)=>c(e,{...n,index:r,level:t+1}))).filter(Boolean);return r.length?r:null}function u(e,t={}){return"string"==typeof e?function(e,t={}){if(!e||"string"!=typeof e)return null;const{includeAllNodes:n=!1,nodeOnly:r=!1,selector:i="body > *",type:a="text/html"}=t;try{const o=(new DOMParser).parseFromString(e,a);if(n){const{childNodes:e}=o.body;return r?e:[...e].map((e=>c(e,t)))}const s=o.querySelector(i)||o.body.childNodes[0];if(!(s instanceof Node))throw new TypeError("Error parsing input");return r?s:c(s,t)}catch(e){0}return null}(e,t):e instanceof Node?c(e,t):null}function c(e,t={}){if(!(e&&e instanceof Node))return null;const{actions:n=[],index:r=0,level:i=0,randomKey:a}=t;let o=e,l=`${i}-${r}`;const u=[];return a&&0===i&&(l=`${function(e=6){const t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";let n="";for(let r=e;r>0;--r)n+=t[Math.round(61*Math.random())];return n}()}-${l}`),Array.isArray(n)&&n.forEach((t=>{t.condition(o,l,i)&&("function"==typeof t.pre&&(o=t.pre(o,l,i),o instanceof Node||(o=e)),"function"==typeof t.post&&u.push(t.post(o,l,i)))})),u.length?u:s(o,{key:l,level:i,...t})}var d=Object.defineProperty,h=(e,t,n)=>((e,t,n)=>t in e?d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),f="react-inlinesvg",p={IDLE:"idle",LOADING:"loading",LOADED:"loaded",FAILED:"failed",READY:"ready",UNSUPPORTED:"unsupported"};function m(){return!("undefined"==typeof window||!window.document?.createElement)}function g(){return function(){if(!document)return!1;const e=document.createElement("div");e.innerHTML="<svg />";const t=e.firstChild;return!!t&&"http://www.w3.org/2000/svg"===t.namespaceURI}()&&"undefined"!=typeof window&&null!==window}async function v(e,t){const n=await fetch(e,t),r=n.headers.get("content-type"),[i]=(r??"").split(/ ?; ?/);if(n.status>299)throw new Error("Not found");if(!["image/svg+xml","text/plain"].some((e=>i.includes(e))))throw new Error(`Content type isn't valid: ${i}`);return n.text()}function y(e=1){return new Promise((t=>{setTimeout(t,1e3*e)}))}var b,w=class{constructor(){h(this,"cacheApi"),h(this,"cacheStore"),h(this,"subscribers",[]),h(this,"isReady",!1),this.cacheStore=new Map;let e=f,t=!1;m()&&(e=window.REACT_INLINESVG_CACHE_NAME??f,t=!!window.REACT_INLINESVG_PERSISTENT_CACHE&&"caches"in window),t?caches.open(e).then((e=>{this.cacheApi=e})).catch((e=>{console.error(`Failed to open cache: ${e.message}`),this.cacheApi=void 0})).finally((()=>{this.isReady=!0;const e=[...this.subscribers];this.subscribers.length=0,e.forEach((e=>{try{e()}catch(e){console.error(`Error in CacheStore subscriber callback: ${e.message}`)}}))})):this.isReady=!0}onReady(e){this.isReady?e():this.subscribers.push(e)}async get(e,t){return await(this.cacheApi?this.fetchAndAddToPersistentCache(e,t):this.fetchAndAddToInternalCache(e,t)),this.cacheStore.get(e)?.content??""}set(e,t){this.cacheStore.set(e,t)}isCached(e){return this.cacheStore.get(e)?.status===p.LOADED}async fetchAndAddToInternalCache(e,t){const n=this.cacheStore.get(e);if(n?.status!==p.LOADING){if(!n?.content){this.cacheStore.set(e,{content:"",status:p.LOADING});try{const n=await v(e,t);this.cacheStore.set(e,{content:n,status:p.LOADED})}catch(t){throw this.cacheStore.set(e,{content:"",status:p.FAILED}),t}}}else await this.handleLoading(e,(async()=>{this.cacheStore.set(e,{content:"",status:p.IDLE}),await this.fetchAndAddToInternalCache(e,t)}))}async fetchAndAddToPersistentCache(e,t){const n=this.cacheStore.get(e);if(n?.status===p.LOADED)return;if(n?.status===p.LOADING)return void await this.handleLoading(e,(async()=>{this.cacheStore.set(e,{content:"",status:p.IDLE}),await this.fetchAndAddToPersistentCache(e,t)}));this.cacheStore.set(e,{content:"",status:p.LOADING});const r=await(this.cacheApi?.match(e));if(r){const t=await r.text();this.cacheStore.set(e,{content:t,status:p.LOADED})}else try{await(this.cacheApi?.add(new Request(e,t)));const n=await(this.cacheApi?.match(e)),r=await(n?.text())??"";this.cacheStore.set(e,{content:r,status:p.LOADED})}catch(t){throw this.cacheStore.set(e,{content:"",status:p.FAILED}),t}}async handleLoading(e,t){for(let t=0;t<10;t++){if(this.cacheStore.get(e)?.status!==p.LOADING)return;await y(.1)}await t()}keys(){return[...this.cacheStore.keys()]}data(){return[...this.cacheStore.entries()].map((([e,t])=>({[e]:t})))}async delete(e){this.cacheApi&&await this.cacheApi.delete(e),this.cacheStore.delete(e)}async clear(){if(this.cacheApi){const e=await this.cacheApi.keys();await Promise.allSettled(e.map((e=>this.cacheApi.delete(e))))}this.cacheStore.clear()}};function S(e){const t=(0,r.useRef)(void 0);return(0,r.useEffect)((()=>{t.current=e})),t.current}function x(e){const{baseURL:t,content:n,description:r,handleError:i,hash:a,preProcessor:o,title:s,uniquifyIDs:l=!1}=e;try{const e=function(e,t){if(t)return t(e);return e}(n,o),i=u(e,{nodeOnly:!0});if(!(i&&i instanceof SVGSVGElement))throw new Error("Could not convert the src to a DOM Node");const c=E(i,{baseURL:t,hash:a,uniquifyIDs:l});if(r){const e=c.querySelector("desc");e?.parentNode&&e.parentNode.removeChild(e);const t=document.createElementNS("http://www.w3.org/2000/svg","desc");t.innerHTML=r,c.prepend(t)}if(void 0!==s){const e=c.querySelector("title");if(e?.parentNode&&e.parentNode.removeChild(e),s){const e=document.createElementNS("http://www.w3.org/2000/svg","title");e.innerHTML=s,c.prepend(e)}}return c}catch(e){return i(e)}}function E(e,t){const{baseURL:n="",hash:r,uniquifyIDs:i}=t,a=["id","href","xlink:href","xlink:role","xlink:arcrole"],o=["href","xlink:href"];return i?([...e.children].forEach((e=>{if(e.attributes?.length){const t=Object.values(e.attributes).map((e=>{const t=e,i=/url\((.*?)\)/.exec(e.value);return i?.[1]&&(t.value=e.value.replace(i[0],`url(${n}${i[1]}__${r})`)),t}));a.forEach((e=>{const n=t.find((t=>t.name===e));var i,a;n&&(i=e,a=n.value,!o.includes(i)||!a||a.includes("#"))&&(n.value=`${n.value}__${r}`)}))}return e.children.length?E(e,t):e})),e):e}function _(e){const{cacheRequests:t=!0,children:n=null,description:i,fetchOptions:a,innerRef:o,loader:s=null,onError:l,onLoad:c,src:d,title:h,uniqueHash:f}=e,[y,w]=(0,r.useReducer)(((e,t)=>({...e,...t})),{content:"",element:null,isCached:t&&b.isCached(e.src),status:p.IDLE}),{content:E,element:_,isCached:O,status:k}=y,T=S(e),C=S(y),I=(0,r.useRef)(f??function(e){const t="abcdefghijklmnopqrstuvwxyz",n=`${t}${t.toUpperCase()}1234567890`;let r="";for(let t=0;t<e;t++)r+=(i=n)[Math.floor(Math.random()*i.length)];var i;return r}(8)),R=(0,r.useRef)(!1),A=(0,r.useRef)(!1),N=(0,r.useCallback)((e=>{R.current&&(w({status:"Browser does not support SVG"===e.message?p.UNSUPPORTED:p.FAILED}),l?.(e))}),[l]),D=(0,r.useCallback)(((e,t=!1)=>{R.current&&w({content:e,isCached:t,status:p.LOADED})}),[]),L=(0,r.useCallback)((async()=>{const e=await v(d,a);D(e)}),[a,D,d]),P=(0,r.useCallback)((()=>{try{const t=u(x({...e,handleError:N,hash:I.current,content:E}));if(!t||!(0,r.isValidElement)(t))throw new Error("Could not convert the src to a React element");w({element:t,status:p.READY})}catch(e){N(e)}}),[E,N,e]),M=(0,r.useCallback)((async()=>{const e=/^data:image\/svg[^,]*?(;base64)?,(.*)/u.exec(d);let n;if(e?n=e[1]?window.atob(e[2]):decodeURIComponent(e[2]):d.includes("<svg")&&(n=d),n)D(n);else try{if(t){const e=await b.get(d,a);D(e,!0)}else await L()}catch(e){N(e)}}),[t,L,a,N,D,d]),j=(0,r.useCallback)((async()=>{R.current&&w({content:"",element:null,isCached:!1,status:p.LOADING})}),[]);(0,r.useEffect)((()=>{if(R.current=!0,m()&&!A.current){try{if(k===p.IDLE){if(!g())throw new Error("Browser does not support SVG");if(!d)throw new Error("Missing src");j()}}catch(e){N(e)}return A.current=!0,()=>{R.current=!1}}}),[]),(0,r.useEffect)((()=>{if(m()&&T&&T.src!==d){if(!d)return void N(new Error("Missing src"));j()}}),[N,j,T,d]),(0,r.useEffect)((()=>{k===p.LOADED&&P()}),[k,P]),(0,r.useEffect)((()=>{m()&&T&&T.src===d&&(T.title===h&&T.description===i||P())}),[i,P,T,d,h]),(0,r.useEffect)((()=>{if(C)switch(k){case p.LOADING:C.status!==p.LOADING&&M();break;case p.LOADED:C.status!==p.LOADED&&P();break;case p.READY:C.status!==p.READY&&c?.(d,O)}}),[M,P,O,c,C,d,k]);const F=function(e,...t){const n={};for(const r in e)({}).hasOwnProperty.call(e,r)&&(t.includes(r)||(n[r]=e[r]));return n}(e,"baseURL","cacheRequests","children","description","fetchOptions","innerRef","loader","onError","onLoad","preProcessor","src","title","uniqueHash","uniquifyIDs");return m()?_?(0,r.cloneElement)(_,{ref:o,...F}):[p.UNSUPPORTED,p.FAILED].includes(k)?n:s:s}function O(e){b||(b=new w);const{loader:t}=e,[n,i]=(0,r.useState)(b.isReady);return(0,r.useEffect)((()=>{n||b.onReady((()=>{i(!0)}))}),[n]),n?r.createElement(_,{...e}):t}},4120:(e,t,n)=>{"use strict";n.d(t,{AQ:()=>d,C6:()=>i,Ju:()=>s,N3:()=>c,YH:()=>o,fX:()=>u,sH:()=>a,xN:()=>h,zs:()=>l});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function a(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))}function o(e,t){var n,r,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}Object.create;function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function l(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function u(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function c(e){return this instanceof c?(this.v=e,this):new c(e)}function d(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",(function(e){return function(t){return Promise.resolve(t).then(e,u)}})),r[Symbol.asyncIterator]=function(){return this},r;function o(e,t){i[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||s(e,t)}))},t&&(r[e]=t(r[e])))}function s(e,t){try{(n=i[e](t)).value instanceof c?Promise.resolve(n.value.v).then(l,u):d(a[0][2],n)}catch(e){d(a[0][3],e)}var n}function l(e){s("next",e)}function u(e){s("throw",e)}function d(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function h(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=s(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}Object.create;"function"==typeof SuppressedError&&SuppressedError}}]);
//# sourceMappingURL=194.js.map?_cache=fba34588b1136cd1c1c6