openc3-cosmos-tool-scriptrunner 5.20.0 → 6.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/plugin.txt +1 -1
- data/tools/scriptrunner/ArrayWidget-BTxChSds-b442fb0c83806f2a7155.js +2 -0
- data/tools/scriptrunner/BarColumn-Cdu3OoMa-5759d627d12ac570f7c2.js +1 -0
- data/tools/scriptrunner/BlockWidget-PmjzrkXF-66124d27fec936836764.js +2 -0
- data/tools/scriptrunner/ButtonWidget-nwDlOBJT-74b0307919435ba34bc0.js +2 -0
- data/tools/scriptrunner/CanvasWidget-BL8930eT-27842c7c22b339b98e51.js +1 -0
- data/tools/scriptrunner/CanvasdotWidget-VCf1fL-G-3222ffa0793edfcc58b9.js +1 -0
- data/tools/scriptrunner/CanvasimageWidget-BIw7Wbf2-da3e74a41067206c20c7.js +1 -0
- data/tools/scriptrunner/CanvasimagevalueWidget-CE3Dj5bH-402c7188c011ef3c6974.js +1 -0
- data/tools/scriptrunner/CanvaslabelWidget-DWmb356h-45266fb96c5c19e29535.js +1 -0
- data/tools/scriptrunner/CanvaslabelvalueWidget-CI3yYwFs-d47df2b589764613f819.js +1 -0
- data/tools/scriptrunner/CanvaslineWidget-COeapH3P-99c09c560599b697ce65.js +1 -0
- data/tools/scriptrunner/CanvaslinevalueWidget-CI-Bbzfi-1411f381997d7567aa3b.js +1 -0
- data/tools/scriptrunner/CheckbuttonWidget-BQhggcZ2-2c444bdd2fdec2093442.js +1 -0
- data/tools/scriptrunner/ComboboxWidget-BzsbOv54-625fab6cb3f3fac91459.js +1 -0
- data/tools/scriptrunner/CriticalCmdDialog-BjoqcWTu-baf2855f2bf6cdf762fb.js +1 -0
- data/tools/scriptrunner/DateWidget-B5R_9rA8-bf0e9b2c2d844495dd04.js +1 -0
- data/tools/scriptrunner/DetailsDialog-DLRMqetn-2b3771b90f4044ac6771.js +1 -0
- data/tools/scriptrunner/DynamicWidget-m9EliUR2-d64e51887657bfc4d03f.js +1 -0
- data/tools/scriptrunner/FormatvalueWidget-DZkRJce8-7421198bc6589347b0a4.js +1 -0
- data/tools/scriptrunner/GraphWidget-amwxyH1r-46f252ec6f59cf6dddd0.js +1 -0
- data/tools/scriptrunner/HorizontalWidget-CirtfuL8-dc699acf1b526f0a14c4.js +1 -0
- data/tools/scriptrunner/HorizontalboxWidget-CyTDt2nl-4e0a6393e5e21e54b369.js +1 -0
- data/tools/scriptrunner/HorizontallineWidget-BdlNB951-6bf4113b8d85559b4492.js +1 -0
- data/tools/scriptrunner/IframeWidget-DnJmCrCA-f3667cd357ba9a81dcc4.js +1 -0
- data/tools/scriptrunner/ImageLoader-CpcR6tPi-c4f247a819912f328147.js +1 -0
- data/tools/scriptrunner/ImageviewerWidget-DIkmb_C9-57e0b16d4cc3b0795a4e.js +1 -0
- data/tools/scriptrunner/LabelWidget-BDsypYho-82779e87dbb6e157d403.js +1 -0
- data/tools/scriptrunner/LabelledWidget-DjturGl5-ac54d7a82f0cf056bf05.js +1 -0
- data/tools/scriptrunner/LabelprogressbarWidget-RADJGLj3-ff7bcc6fbf5aed7ad6eb.js +1 -0
- data/tools/scriptrunner/LabelsparklineWidget-BlJoICxu-549dff62b17f07fa1a4d.js +1 -0
- data/tools/scriptrunner/LabelvalueWidget-DVWJqnlY-4b8678af8e6c3843f1af.js +1 -0
- data/tools/scriptrunner/LabelvaluedescWidget-CsUP7J4U-6425f7244247c5e8f75b.js +1 -0
- data/tools/scriptrunner/LabelvaluelimitsbarWidget-Blj1QXV8-8cf7ae38507f8066ee5d.js +1 -0
- data/tools/scriptrunner/LabelvaluelimitscolumnWidget-CvCo-uCe-9b7a1a45724b4dabdffb.js +1 -0
- data/tools/scriptrunner/LabelvaluerangebarWidget-DpcXhlfF-1b6fdabef37a98d952b9.js +1 -0
- data/tools/scriptrunner/Layout-C1HoM4Kl-d29c2656e1dc91cbadf0.js +1 -0
- data/tools/scriptrunner/LedWidget-B_K2e5tq-677c4976f93116291b06.js +1 -0
- data/tools/scriptrunner/LimitsbarWidget-DXbqsi4J-606f0852c745b1d75a71.js +1 -0
- data/tools/scriptrunner/LimitscolorWidget-Ckmuw0YX-2b83ce7b7afe3b4b87c2.js +1 -0
- data/tools/scriptrunner/LimitscolumnWidget-BfY4su5U-f683680d74b03d48214e.js +1 -0
- data/tools/scriptrunner/LinegraphWidget-y-Qy9P0R-c7ed03e2084fae4a0342.js +1 -0
- data/tools/scriptrunner/MatrixbycolumnsWidget-BTBColrs-a5637f85840ad0341e64.js +1 -0
- data/tools/scriptrunner/ProgressbarWidget-DpA_-vy9-5b5d66bee554250ddd13.js +1 -0
- data/tools/scriptrunner/RadiobuttonWidget-BO8zpgwW-5c50d2cff32ebf5ecae0.js +1 -0
- data/tools/scriptrunner/RadiogroupWidget-Oy7V4S-V-84b6b69f058ff364a77e.js +1 -0
- data/tools/scriptrunner/RangebarWidget-DHS7S3vI-831b1aa9bf7ada4c8982.js +1 -0
- data/tools/scriptrunner/RollupWidget-CTk9Kjwr-fee4b52c2d0ac0675fa1.js +1 -0
- data/tools/scriptrunner/ScriptRunner-b8a3addf4ef3e33ba3d1.js +96 -0
- data/tools/scriptrunner/ScrollwindowWidget-DD0TOW6s-d21f3e99b6007f66c57a.js +1 -0
- data/tools/scriptrunner/SignalWidget-CC33KMTW-25a228f34c6e80a7177b.js +1 -0
- data/tools/scriptrunner/SpacerWidget-BnJe_Hq6-37bfb1d7ec6d46304caa.js +1 -0
- data/tools/scriptrunner/SparklineWidget-DMvMQCPm-4332f55116114aa68aef.js +1 -0
- data/tools/scriptrunner/TabbookWidget-B3w0JtWe-a8d257e93d6ef21500c8.js +1 -0
- data/tools/scriptrunner/TextboxWidget-D2f0-eol-bb94d6677ee14cd32fcf.js +1 -0
- data/tools/scriptrunner/TextfieldWidget-DXSdgqVP-d6bcda166a9140bd23e6.js +1 -0
- data/tools/scriptrunner/TimeWidget-DvrRaEMz-a98384f80e069ba5d4bd.js +1 -0
- data/tools/scriptrunner/TitleWidget-DqViFQl--df54f3619e4f303b1373.js +1 -0
- data/tools/scriptrunner/VWidget-02CG-3Av-9579e154442a96ddbf76.js +1 -0
- data/tools/scriptrunner/ValueWidget-KLYY8L8U-96ee5f0706e36c6885e6.js +1 -0
- data/tools/scriptrunner/ValuelimitsbarWidget-SR8XNZFB-58ea8b55d6ece94d270a.js +1 -0
- data/tools/scriptrunner/ValuelimitscolumnWidget-xYZSp6YZ-906fdefa13c32c7e4d3c.js +1 -0
- data/tools/scriptrunner/ValuerangebarWidget-B6M02a9d-f4b7a4b9709d461258c0.js +1 -0
- data/tools/scriptrunner/VerticalWidget-z6xUM-ql-6daf5ea34d2f88e2414e.js +1 -0
- data/tools/scriptrunner/VerticalboxWidget-3a9cVsW--b38be144237c8662c1fd.js +1 -0
- data/tools/scriptrunner/Widget-C4QVI4IH-fe10a78e0f883ba2b0f8.js +1 -0
- data/tools/scriptrunner/addMonths-BdRI44Cs-495ddb75f786e4f5c19b.js +1 -0
- data/tools/scriptrunner/main-26581a6a2cf6f9faf01c.js +1425 -0
- data/tools/scriptrunner/main.js +1 -0
- metadata +70 -11
- data/tools/scriptrunner/index.html +0 -4
- data/tools/scriptrunner/js/272.js +0 -2
- data/tools/scriptrunner/js/272.js.map +0 -1
- data/tools/scriptrunner/js/705.js +0 -2
- data/tools/scriptrunner/js/705.js.map +0 -1
- data/tools/scriptrunner/js/729.js +0 -18
- data/tools/scriptrunner/js/729.js.map +0 -1
- data/tools/scriptrunner/js/app.js +0 -2
- data/tools/scriptrunner/js/app.js.map +0 -1
@@ -0,0 +1,96 @@
|
|
1
|
+
var Hd=Object.defineProperty;var Ri=q=>{throw TypeError(q)};var $d=(q,H,h)=>H in q?Hd(q,H,{enumerable:!0,configurable:!0,writable:!0,value:h}):q[H]=h;var En=(q,H,h)=>$d(q,typeof H!="symbol"?H+"":H,h),Di=(q,H,h)=>H.has(q)||Ri("Cannot "+h);var te=(q,H,h)=>(Di(q,H,"read from private field"),h?h.call(q):H.get(q)),ge=(q,H,h)=>H.has(q)?Ri("Cannot add the same private member more than once"):H instanceof WeakSet?H.add(q):H.set(q,h),Fe=(q,H,h,k)=>(Di(q,H,"write to private field"),k?k.call(q,h):H.set(q,h),h);System.register(["vue","./main-26581a6a2cf6f9faf01c.js","single-spa","./addMonths-BdRI44Cs-495ddb75f786e4f5c19b.js","./CriticalCmdDialog-BjoqcWTu-baf2855f2bf6cdf762fb.js","vue-router","vuex","vuetify"],function(q,H){"use strict";var h,k,P,c,a,v,F,G,J,x,A,ne,le,re,Cn,Ae,at,z,On,Tn,ve,Se,be,zt,Y,Rn,oe,pe,ze,Ie,Dn,An,Pn,Vn,ae,Mn,Un,Nn,Fn,zn,In;return{setters:[V=>{h=V.resolveComponent,k=V.openBlock,P=V.createBlock,c=V.withCtx,a=V.createVNode,v=V.createElementVNode,F=V.toDisplayString,G=V.normalizeProps,J=V.guardReactiveProps,x=V.createTextVNode,A=V.createElementBlock,ne=V.Fragment,le=V.renderList,re=V.mergeProps,Cn=V.Teleport,Ae=V.createSlots,at=V.normalizeStyle,z=V.createCommentVNode,On=V.h,Tn=V.renderSlot,ve=V.withDirectives,Se=V.vShow,be=V.withModifiers,zt=V.normalizeClass},V=>{Y=V.E,Rn=V.F,oe=V.s,pe=V.I,ze=V.P,Ie=V.p,Dn=V.c,An=V.l,Pn=V.z,Vn=V.y,ae=V._,Mn=V.q,Un=V.$,Nn=V.j,Fn=V.t},null,V=>{zn=V.M},V=>{In=V.N},null,null,null],execute:function(){var De,tt,nt,st,it,Nt,rt,ot,Ft;var V=document.createElement("style");V.textContent=`.splitpanes{display:flex;width:100%;height:100%}.splitpanes--vertical{flex-direction:row}.splitpanes--horizontal{flex-direction:column}.splitpanes--dragging *{-webkit-user-select:none;user-select:none}.splitpanes__pane{width:100%;height:100%;overflow:hidden}.splitpanes--vertical .splitpanes__pane{transition:width .2s ease-out}.splitpanes--horizontal .splitpanes__pane{transition:height .2s ease-out}.splitpanes--dragging .splitpanes__pane{transition:none}.splitpanes__splitter{touch-action:none}.splitpanes--vertical>.splitpanes__splitter{min-width:1px;cursor:col-resize}.splitpanes--horizontal>.splitpanes__splitter{min-height:1px;cursor:row-resize}.splitpanes.default-theme .splitpanes__pane{background-color:#f2f2f2}.splitpanes.default-theme .splitpanes__splitter{background-color:#fff;box-sizing:border-box;position:relative;flex-shrink:0}.splitpanes.default-theme .splitpanes__splitter:before,.splitpanes.default-theme .splitpanes__splitter:after{content:"";position:absolute;top:50%;left:50%;background-color:#00000026;transition:background-color .3s}.splitpanes.default-theme .splitpanes__splitter:hover:before,.splitpanes.default-theme .splitpanes__splitter:hover:after{background-color:#00000040}.splitpanes.default-theme .splitpanes__splitter:first-child{cursor:auto}.default-theme.splitpanes .splitpanes .splitpanes__splitter{z-index:1}.default-theme.splitpanes--vertical>.splitpanes__splitter,.default-theme .splitpanes--vertical>.splitpanes__splitter{width:7px;border-left:1px solid #eee;margin-left:-1px}.default-theme.splitpanes--vertical>.splitpanes__splitter:before,.default-theme.splitpanes--vertical>.splitpanes__splitter:after,.default-theme .splitpanes--vertical>.splitpanes__splitter:before,.default-theme .splitpanes--vertical>.splitpanes__splitter:after{transform:translateY(-50%);width:1px;height:30px}.default-theme.splitpanes--vertical>.splitpanes__splitter:before,.default-theme .splitpanes--vertical>.splitpanes__splitter:before{margin-left:-2px}.default-theme.splitpanes--vertical>.splitpanes__splitter:after,.default-theme .splitpanes--vertical>.splitpanes__splitter:after{margin-left:1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter,.default-theme .splitpanes--horizontal>.splitpanes__splitter{height:7px;border-top:1px solid #eee;margin-top:-1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:before,.default-theme.splitpanes--horizontal>.splitpanes__splitter:after,.default-theme .splitpanes--horizontal>.splitpanes__splitter:before,.default-theme .splitpanes--horizontal>.splitpanes__splitter:after{transform:translate(-50%);width:30px;height:1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:before,.default-theme .splitpanes--horizontal>.splitpanes__splitter:before{margin-top:-2px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:after,.default-theme .splitpanes--horizontal>.splitpanes__splitter:after{margin-top:1px}.question[data-v-b44e26bc]{font-size:1rem;white-space:pre-line}.title[data-v-f89fec34]{font-size:1.125rem;font-weight:700;padding-bottom:5px}.v-card__subtitle[data-v-b04397fe]{padding:0 0 10px}.text[data-v-b04397fe]{font-size:1rem;white-space:pre-line}.invisible[data-v-40a2938d]{visibility:hidden}#tr-container[data-v-40a2938d]{padding:0 0 15px}.v-sheet{background-color:var(--color-background-base-default)}#sr-controls[data-v-e274eaa8]{padding:0}.editor[data-v-e274eaa8]{height:100%;width:100%;position:relative;font-size:16px}.script-state[data-v-e274eaa8] .v-field{background-color:var(--color-background-base-default)}.script-state[data-v-e274eaa8] input{text-transform:capitalize}.splitpanes{height:100%}.splitpanes--horizontal>.splitpanes__splitter{min-height:4px;position:relative;top:4px;background-color:gray;width:5%;margin:auto;cursor:row-resize}.runningMarker{position:absolute;background:#00ff0080;z-index:20}.waitingMarker{position:absolute;background:#009b00;z-index:20}.breakpointMarker{position:absolute;border-style:solid;border-color:red;background:#00ff0080;z-index:20}.pausedMarker{position:absolute;background:#008cff80;z-index:20}.errorMarker{position:absolute;background:#ff007780;z-index:20}.fatalMarker{position:absolute;background:#ff000080;z-index:20}.saving{z-index:20;opacity:.35}.ace_gutter{z-index:2}.ace_gutter-cell.ace_breakpoint{border-radius:20px 0 0 20px;box-shadow:0 0 1px 1px red inset}.grid{position:relative}.item{position:absolute;display:block;margin:5px;z-index:1}.item-content{position:relative;cursor:pointer;border-radius:6px}
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(V);const Ln={data:{configKey:""},methods:{buildLanguageMode(t,e){let n=Y.require("ace/lib/oop"),i=Object.getOwnPropertyNames(Rn.prototype).filter(u=>u!=="constructor").filter(u=>u!=="exec").concat(["check","check_raw","check_formatted","check_with_units","check_exception","check_tolerance","check_expression","wait","wait_tolerance","wait_expression","wait_check","wait_check_tolerance","wait_check_expression","wait_packet","wait_check_packet","disable_instrumentation","set_line_delay","get_line_delay","set_max_output","get_max_output"]),s=new RegExp(`(\\b${i.join("\\b|\\b")}\\b)`),r=function(){t.call(this);for(let u in this.$rules)this.$rules[u].unshift({regex:s,token:"support.function"})};n.inherits(r,t);let o=Y.require("ace/mode/matching_brace_outdent").MatchingBraceOutdent,l=Y.require("ace/mode/behaviour/cstyle").CstyleBehaviour;return[n,function(){this.HighlightRules=r,this.$outdent=new o,this.$behaviour=new l,this.foldingRules=new e,this.indentKeywords=this.foldingRules.indentKeywords}]},buildRubyMode(){const[t,e]=this.buildLanguageMode(Y.require("ace/mode/ruby_highlight_rules").RubyHighlightRules,Y.require("ace/mode/folding/ruby").FoldMode);let n=Y.require("ace/mode/ruby").Mode;return t.inherits(e,n),(function(){this.$id="ace/mode/openc3"}).call(e.prototype),e},buildPythonMode(){const[t,e]=this.buildLanguageMode(Y.require("ace/mode/python_highlight_rules").PythonHighlightRules,Y.require("ace/mode/folding/pythonic").FoldMode);let n=Y.require("ace/mode/python").Mode;return t.inherits(e,n),(function(){this.$id="ace/mode/openc3"}).call(e.prototype),e},buildJsonMode(){const[t,e]=this.buildLanguageMode(Y.require("ace/mode/json_highlight_rules").JsonHighlightRules,Y.require("ace/mode/folding/ruby").FoldMode);let n=Y.require("ace/mode/json").Mode;return t.inherits(e,n),(function(){this.$id="ace/mode/openc3"}).call(e.prototype),e},buildMarkdownMode(){const[t,e]=this.buildLanguageMode(Y.require("ace/mode/markdown_highlight_rules").MarkdownHighlightRules,Y.require("ace/mode/folding/markdown").FoldMode);let n=Y.require("ace/mode/markdown").Mode;return t.inherits(e,n),(function(){this.$id="ace/mode/openc3"}).call(e.prototype),e}}},Ai={props:{content:{type:String,required:!0},type:String,name:String,modelValue:Boolean,filename:{type:String,required:!1}},mixins:[Ln],data(){return{editor:null,mode:null}},mounted(){this.editor=ace.edit(this.$refs.editor),this.editor.setTheme("ace/theme/twilight");let t=null;switch(this.filename?this.filename.split(".").pop():"txt"){case"json":const e=this.buildJsonMode();t=new e,this.editor.setOptions({useWorker:!1});case"py":case"pyi":const n=this.buildPythonMode();t=new n;break;case"md":const i=this.buildMarkdownMode();t=new i;break;default:const s=this.buildRubyMode();t=new s;break}this.editor.session.setMode(t),this.editor.session.setUseWrapMode(!0),this.editor.$blockScrolling=1/0,this.editor.setHighlightActiveLine(!1),this.editor.setValue(this.content),this.editor.clearSelection(),this.editor.focus(),this.editor.setReadOnly(!0)},beforeUnmount(){this.editor&&this.editor.destroy()},computed:{show:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}},title:function(){return`${this.type}: ${this.name}`}},methods:{close:function(){this.show=!this.show},download:function(){const t=new Blob([this.editor.getValue()],{type:"text/plain"});let e=`${this.type.toLowerCase()}_${this.name.toLowerCase()}.json`;this.filename&&(e=this.filename);const n=document.createElement("a");n.href=URL.createObjectURL(t),n.setAttribute("download",e),n.click()}}},Pi=["textContent"],Vi={class:"mx-2"},Mi={class:"editor",ref:"editor"};function Ui(t,e,n,i,s,r){const o=h("v-spacer"),l=h("v-icon"),u=h("v-tooltip"),d=h("v-toolbar"),p=h("v-card-text"),m=h("v-btn"),b=h("v-card-actions"),y=h("v-card"),g=h("v-dialog");return k(),P(g,{modelValue:r.show,"onUpdate:modelValue":e[1]||(e[1]=f=>r.show=f),width:"85vw"},{default:c(()=>[a(y,null,{default:c(()=>[a(d,{height:"24"},{default:c(()=>[a(o),v("span",{textContent:F(r.title)},null,8,Pi),a(o),v("div",Vi,[a(u,{location:"top"},{activator:c(({props:f})=>[v("div",G(J(f)),[a(l,{"data-test":"downloadIcon",onClick:r.download},{default:c(()=>e[2]||(e[2]=[x(" mdi-download ")])),_:1},8,["onClick"])],16)]),default:c(()=>[e[3]||(e[3]=v("span",null," Download ",-1))]),_:1})])]),_:1}),a(p,null,{default:c(()=>[v("pre",Mi,null,512)]),_:1}),a(b,{class:"pr-6 pb-4 pt-0"},{default:c(()=>[a(o),a(m,{variant:"flat",onClick:e[0]||(e[0]=f=>r.show=!r.show)},{default:c(()=>e[4]||(e[4]=[x(" Ok ")])),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])}const Ni=oe(Ai,[["render",Ui],["__scopeId","data-v-b0c9f05d"]]),Fi={props:{modelValue:{type:Array,required:!0}},computed:{selected:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}},methods:{addEnvVar:function(){this.selected.push({key:"",value:""})},delEnvVar:function(t){this.selected.splice(t,1)}}},zi={scope:"col",class:"text-right"};function Ii(t,e,n,i,s,r){const o=h("v-icon"),l=h("v-tooltip"),u=h("v-text-field"),d=h("v-table");return k(),A("div",null,[a(d,{dense:""},{default:c(()=>[e[6]||(e[6]=v("span",null," Add environment variables (optional)",-1)),v("tbody",null,[v("tr",null,[e[2]||(e[2]=v("th",{scope:"col",class:"text-left"},"Key",-1)),e[3]||(e[3]=v("th",{scope:"col",class:"text-left"},"Value",-1)),v("th",zi,[a(l,{location:"top"},{activator:c(({props:p})=>[v("div",G(J(p)),[a(o,{"data-test":"new-metadata-icon",onClick:r.addEnvVar},{default:c(()=>e[0]||(e[0]=[x(" mdi-plus ")])),_:1},8,["onClick"])],16)]),default:c(()=>[e[1]||(e[1]=v("span",null," Add Environment ",-1))]),_:1})])]),(k(!0),A(ne,null,le(r.selected,(p,m)=>(k(),A("tr",{key:`tr-${m}`},[v("td",null,[a(u,{modelValue:p.key,"onUpdate:modelValue":b=>p.key=b,density:"compact",type:"text",readonly:p.readonly,"data-test":`key-${m}`},null,8,["modelValue","onUpdate:modelValue","readonly","data-test"])]),v("td",null,[a(u,{modelValue:p.value,"onUpdate:modelValue":b=>p.value=b,density:"compact",type:"text",readonly:p.readonly,"data-test":`value-${m}`},null,8,["modelValue","onUpdate:modelValue","readonly","data-test"])]),v("td",null,[a(l,{location:"top"},{activator:c(({props:b})=>[v("div",re({ref_for:!0},b),[a(o,{"data-test":`remove-env-icon-${m}`,onClick:y=>r.delEnvVar(m)},{default:c(()=>e[4]||(e[4]=[x(" mdi-delete ")])),_:2},1032,["data-test","onClick"])],16)]),default:c(()=>[e[5]||(e[5]=v("span",null," Delete Environment ",-1))]),_:2},1024)])]))),128))])]),_:1})])}const Bn=oe(Fi,[["render",Ii]]),Li={props:{modelValue:String},data(){return{loading:!1,search:"",selected:this.modelValue,scripts:[],items:[]}},created(){this.loading=!0,pe.get("/script-api/scripts").then(t=>{this.scripts=t.data.filter(e=>e.includes(".rb")||e.includes(".py")),this.items=this.scripts}).catch(t=>{this.$emit("error",{type:"error",text:`Failed to connect to OpenC3. ${t}`,error:t})}),this.selected=this.modelValue?this.modelValue:null,this.loading=!1},watch:{selected(t,e){t!==e&&(t.slice(-1)==="*"?this.$emit("file",t.substring(0,t.length-1)):this.$emit("file",t))},search(t){t&&t!==this.selected&&this.querySelections(t)}},methods:{querySelections:function(t){this.loading=!0,setTimeout(()=>{this.items=this.scripts.filter(e=>(e||"").toLowerCase().indexOf((t||"").toLowerCase())>-1),this.loading=!1},500)}}};function Bi(t,e,n,i,s,r){const o=h("v-autocomplete"),l=h("v-row");return k(),A("div",null,[a(l,null,{default:c(()=>[a(o,{modelValue:s.selected,"onUpdate:modelValue":e[0]||(e[0]=u=>s.selected=u),density:"compact",variant:"outlined","hide-no-data":"","hide-details":"",class:"mb-5",label:"Select script",loading:s.loading,items:s.items,search:s.search,"onUpdate:search":e[1]||(e[1]=u=>s.search=u),"data-test":"select-script"},null,8,["modelValue","loading","items","search"])]),_:1})])}const qi=oe(Li,[["render",Bi]]),ji={props:{modelValue:Boolean,text:String,title:String,width:{type:Number,default:800}},computed:{show:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}},methods:{download:function(){const t=new Blob([this.text],{type:"text/plain"}),e=document.createElement("a");e.href=URL.createObjectURL(t),e.setAttribute("download",`${this.title}.txt`),e.click()}}},Hi={class:"mx-2"},$i={class:"pa-3"},Wi={class:"text"};function Gi(t,e,n,i,s,r){const o=h("v-spacer"),l=h("v-icon"),u=h("v-tooltip"),d=h("v-toolbar"),p=h("v-card-text"),m=h("v-btn"),b=h("v-card-actions"),y=h("v-card"),g=h("v-dialog");return k(),P(g,{modelValue:r.show,"onUpdate:modelValue":e[1]||(e[1]=f=>r.show=f),width:n.width,scrollable:""},{default:c(()=>[a(y,null,{default:c(()=>[a(d,{height:"24"},{default:c(()=>[a(o),v("span",null,F(n.title),1),a(o),v("div",Hi,[a(u,{location:"top"},{activator:c(({props:f})=>[v("div",G(J(f)),[a(l,{"data-test":"downloadIcon",onClick:r.download},{default:c(()=>e[2]||(e[2]=[x(" mdi-download ")])),_:1},8,["onClick"])],16)]),default:c(()=>[e[3]||(e[3]=v("span",null," Download ",-1))]),_:1})])]),_:1}),a(p,{style:{"max-height":"80vh"}},{default:c(()=>[v("div",$i,[v("span",Wi,F(n.text),1)])]),_:1}),a(b,{class:"px-2"},{default:c(()=>[a(o),a(m,{variant:"flat",onClick:e[0]||(e[0]=f=>r.show=!r.show)},{default:c(()=>e[4]||(e[4]=[x(" Ok ")])),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue","width"])}const Ji=oe(ji,[["render",Gi],["__scopeId","data-v-a60ace75"]]),Yi={props:{menus:{type:Array,default:function(){return[]}},title:{type:String,default:""}},methods:{formatDT:function(t){return t.replaceAll(" ","-").toLowerCase()},subMenuClick(t){t.command(t),this.$refs.topmenu[0].isActive=!1}},mounted(){document.title=this.title}},Ki={class:"app-title mr-2"};function Xi(t,e,n,i,s,r){const o=h("v-col"),l=h("v-row"),u=h("v-icon"),d=h("v-btn"),p=h("v-divider"),m=h("v-list-item-title"),b=h("v-list-item"),y=h("v-list"),g=h("v-menu"),f=h("v-radio"),S=h("v-list-item-action"),T=h("v-radio-group"),O=h("v-checkbox");return k(),P(Cn,{to:"#openc3-menu"},[a(l,{"no-gutters":""},{default:c(()=>[a(o,{"align-self":"end"},{default:c(()=>[v("span",Ki,F(n.title),1)]),_:1})]),_:1}),a(l,{dense:"",class:"flex-nowrap"},{default:c(()=>[(k(!0),A(ne,null,le(n.menus,(D,B)=>(k(),P(g,{ref_for:!0,ref:"topmenu",key:B},{activator:c(({props:E})=>[a(d,re({ref_for:!0},E,{variant:"outlined",class:"mx-1 menu-button",text:D.label,"data-test":r.formatDT(`${n.title} ${D.label}`)}),{append:c(()=>[a(u,{class:"menu-button-icon"},{default:c(()=>e[0]||(e[0]=[x(" mdi-menu-down ")])),_:1})]),_:2},1040,["text","data-test"])]),default:c(()=>[a(y,null,{default:c(()=>[(k(!0),A(ne,null,le(D.items,(E,R)=>(k(),A(ne,null,[E.divider?(k(),P(p,{key:R+"-divider"})):E.subMenu&&E.subMenu.length>0?(k(),A("div",{key:R+"-submenu"},[(k(),P(g,{"open-on-hover":"",location:"right",key:R},{activator:c(({props:L})=>[(k(),P(b,re({ref_for:!0},L,{disabled:E.disabled,key:R}),Ae({append:c(()=>[a(u,null,{default:c(()=>e[1]||(e[1]=[x(" mdi-chevron-right ")])),_:1})]),default:c(()=>[!E.radio&&!E.checkbox?(k(),P(m,{key:0,style:at("cursor: pointer;"+(E.disabled?"opacity: 0.2":""))},{default:c(()=>[x(F(E.label),1)]),_:2},1032,["style"])):z("",!0)]),_:2},[E.icon?{name:"prepend",fn:c(()=>[a(u,{disabled:E.disabled},{default:c(()=>[x(F(E.icon),1)]),_:2},1032,["disabled"])]),key:"0"}:void 0]),1040,["disabled"]))]),default:c(()=>[a(y,null,{default:c(()=>[(k(!0),A(ne,null,le(E.subMenu,(L,Z)=>(k(),P(b,{key:Z,"prepend-icon":L.icon,onClick:_e=>r.subMenuClick(L)},{default:c(()=>[a(m,null,{default:c(()=>[x(F(L.label),1)]),_:2},1024)]),_:2},1032,["prepend-icon","onClick"]))),128))]),_:2},1024)]),_:2},1024))])):E.radioGroup?(k(),P(T,{"model-value":E.value,"onUpdate:modelValue":E.command,key:R+"-radio-group","hide-details":"",density:"compact",class:"ma-0 pa-0"},{default:c(()=>[(k(!0),A(ne,null,le(E.choices,(L,Z)=>(k(),P(b,{key:Z+"-choice"},{default:c(()=>[a(S,{class:"list-action"},{default:c(()=>[a(f,{color:"secondary",label:L.label,value:L.value,density:"compact","hide-details":""},null,8,["label","value"])]),_:2},1024)]),_:2},1024))),128))]),_:2},1032,["model-value","onUpdate:modelValue"])):(k(),P(b,{onClick:L=>E.command(E),disabled:E.disabled,"data-test":r.formatDT(`${n.title} ${D.label} ${E.label}`),key:R+"-list"},Ae({default:c(()=>[E.checkbox?(k(),P(S,{key:0,class:"list-action"},{default:c(()=>[a(O,{modelValue:E.checked,"onUpdate:modelValue":L=>E.checked=L,label:E.label,color:"secondary",density:"compact","hide-details":""},null,8,["modelValue","onUpdate:modelValue","label"])]),_:2},1024)):z("",!0),!E.radio&&!E.checkbox?(k(),P(m,{key:1,style:at("cursor: pointer;"+(E.disabled?"opacity: 0.2":""))},{default:c(()=>[x(F(E.label),1)]),_:2},1032,["style"])):z("",!0)]),_:2},[E.icon?{name:"prepend",fn:c(()=>[a(u,{icon:E.icon,disabled:E.disabled},null,8,["icon","disabled"])]),key:"0"}:void 0]),1032,["onClick","disabled","data-test"]))],64))),256))]),_:2},1024)]),_:2},1024))),128))]),_:1})])}const Zi=oe(Yi,[["render",Xi],["__scopeId","data-v-4d454b93"]]);function qn(t,e){return function(){return t.apply(e,arguments)}}const{toString:Qi}=Object.prototype,{getPrototypeOf:It}=Object,lt=(t=>e=>{const n=Qi.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ce=t=>(t=t.toLowerCase(),e=>lt(e)===t),ct=t=>e=>typeof e===t,{isArray:Pe}=Array,Le=ct("undefined");function er(t){return t!==null&&!Le(t)&&t.constructor!==null&&!Le(t.constructor)&&se(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const jn=ce("ArrayBuffer");function tr(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&jn(t.buffer),e}const nr=ct("string"),se=ct("function"),Hn=ct("number"),ut=t=>t!==null&&typeof t=="object",sr=t=>t===!0||t===!1,dt=t=>{if(lt(t)!=="object")return!1;const e=It(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},ir=ce("Date"),rr=ce("File"),or=ce("Blob"),ar=ce("FileList"),lr=t=>ut(t)&&se(t.pipe),cr=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||se(t.append)&&((e=lt(t))==="formdata"||e==="object"&&se(t.toString)&&t.toString()==="[object FormData]"))},ur=ce("URLSearchParams"),[dr,pr,hr,mr]=["ReadableStream","Request","Response","Headers"].map(ce),fr=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Be(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let i,s;if(typeof t!="object"&&(t=[t]),Pe(t))for(i=0,s=t.length;i<s;i++)e.call(null,t[i],i,t);else{const r=n?Object.getOwnPropertyNames(t):Object.keys(t),o=r.length;let l;for(i=0;i<o;i++)l=r[i],e.call(null,t[l],l,t)}}function $n(t,e){e=e.toLowerCase();const n=Object.keys(t);let i=n.length,s;for(;i-- >0;)if(s=n[i],e===s.toLowerCase())return s;return null}const ke=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Wn=t=>!Le(t)&&t!==ke;function Lt(){const{caseless:t}=Wn(this)&&this||{},e={},n=(i,s)=>{const r=t&&$n(e,s)||s;dt(e[r])&&dt(i)?e[r]=Lt(e[r],i):dt(i)?e[r]=Lt({},i):Pe(i)?e[r]=i.slice():e[r]=i};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&Be(arguments[i],n);return e}const gr=(t,e,n,{allOwnKeys:i}={})=>(Be(e,(s,r)=>{n&&se(s)?t[r]=qn(s,n):t[r]=s},{allOwnKeys:i}),t),br=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),yr=(t,e,n,i)=>{t.prototype=Object.create(e.prototype,i),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},wr=(t,e,n,i)=>{let s,r,o;const l={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),r=s.length;r-- >0;)o=s[r],(!i||i(o,t,e))&&!l[o]&&(e[o]=t[o],l[o]=!0);t=n!==!1&&It(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},_r=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const i=t.indexOf(e,n);return i!==-1&&i===n},vr=t=>{if(!t)return null;if(Pe(t))return t;let e=t.length;if(!Hn(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},Sr=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&It(Uint8Array)),kr=(t,e)=>{const i=(t&&t[Symbol.iterator]).call(t);let s;for(;(s=i.next())&&!s.done;){const r=s.value;e.call(t,r[0],r[1])}},xr=(t,e)=>{let n;const i=[];for(;(n=t.exec(e))!==null;)i.push(n);return i},Er=ce("HTMLFormElement"),Cr=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,s){return i.toUpperCase()+s}),Gn=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Or=ce("RegExp"),Jn=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),i={};Be(n,(s,r)=>{let o;(o=e(s,r,t))!==!1&&(i[r]=o||s)}),Object.defineProperties(t,i)},Tr=t=>{Jn(t,(e,n)=>{if(se(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=t[n];if(se(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Rr=(t,e)=>{const n={},i=s=>{s.forEach(r=>{n[r]=!0})};return Pe(t)?i(t):i(String(t).split(e)),n},Dr=()=>{},Ar=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,Bt="abcdefghijklmnopqrstuvwxyz",Yn="0123456789",Kn={DIGIT:Yn,ALPHA:Bt,ALPHA_DIGIT:Bt+Bt.toUpperCase()+Yn},Pr=(t=16,e=Kn.ALPHA_DIGIT)=>{let n="";const{length:i}=e;for(;t--;)n+=e[Math.random()*i|0];return n};function Vr(t){return!!(t&&se(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const Mr=t=>{const e=new Array(10),n=(i,s)=>{if(ut(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[s]=i;const r=Pe(i)?[]:{};return Be(i,(o,l)=>{const u=n(o,s+1);!Le(u)&&(r[l]=u)}),e[s]=void 0,r}}return i};return n(t,0)},Ur=ce("AsyncFunction"),Nr=t=>t&&(ut(t)||se(t))&&se(t.then)&&se(t.catch),Xn=((t,e)=>t?setImmediate:e?((n,i)=>(ke.addEventListener("message",({source:s,data:r})=>{s===ke&&r===n&&i.length&&i.shift()()},!1),s=>{i.push(s),ke.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",se(ke.postMessage)),Fr=typeof queueMicrotask<"u"?queueMicrotask.bind(ke):typeof process<"u"&&process.nextTick||Xn,w={isArray:Pe,isArrayBuffer:jn,isBuffer:er,isFormData:cr,isArrayBufferView:tr,isString:nr,isNumber:Hn,isBoolean:sr,isObject:ut,isPlainObject:dt,isReadableStream:dr,isRequest:pr,isResponse:hr,isHeaders:mr,isUndefined:Le,isDate:ir,isFile:rr,isBlob:or,isRegExp:Or,isFunction:se,isStream:lr,isURLSearchParams:ur,isTypedArray:Sr,isFileList:ar,forEach:Be,merge:Lt,extend:gr,trim:fr,stripBOM:br,inherits:yr,toFlatObject:wr,kindOf:lt,kindOfTest:ce,endsWith:_r,toArray:vr,forEachEntry:kr,matchAll:xr,isHTMLForm:Er,hasOwnProperty:Gn,hasOwnProp:Gn,reduceDescriptors:Jn,freezeMethods:Tr,toObjectSet:Rr,toCamelCase:Cr,noop:Dr,toFiniteNumber:Ar,findKey:$n,global:ke,isContextDefined:Wn,ALPHABET:Kn,generateString:Pr,isSpecCompliantForm:Vr,toJSONObject:Mr,isAsyncFn:Ur,isThenable:Nr,setImmediate:Xn,asap:Fr};function M(t,e,n,i,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),i&&(this.request=i),s&&(this.response=s,this.status=s.status?s.status:null)}w.inherits(M,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:w.toJSONObject(this.config),code:this.code,status:this.status}}});const Zn=M.prototype,Qn={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Qn[t]={value:t}}),Object.defineProperties(M,Qn),Object.defineProperty(Zn,"isAxiosError",{value:!0}),M.from=(t,e,n,i,s,r)=>{const o=Object.create(Zn);return w.toFlatObject(t,o,function(u){return u!==Error.prototype},l=>l!=="isAxiosError"),M.call(o,t.message,e,n,i,s),o.cause=t,o.name=t.name,r&&Object.assign(o,r),o};const zr=null;function qt(t){return w.isPlainObject(t)||w.isArray(t)}function es(t){return w.endsWith(t,"[]")?t.slice(0,-2):t}function ts(t,e,n){return t?t.concat(e).map(function(s,r){return s=es(s),!n&&r?"["+s+"]":s}).join(n?".":""):e}function Ir(t){return w.isArray(t)&&!t.some(qt)}const Lr=w.toFlatObject(w,{},null,function(e){return/^is[A-Z]/.test(e)});function pt(t,e,n){if(!w.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=w.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,S){return!w.isUndefined(S[f])});const i=n.metaTokens,s=n.visitor||p,r=n.dots,o=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&w.isSpecCompliantForm(e);if(!w.isFunction(s))throw new TypeError("visitor must be a function");function d(g){if(g===null)return"";if(w.isDate(g))return g.toISOString();if(!u&&w.isBlob(g))throw new M("Blob is not supported. Use a Buffer instead.");return w.isArrayBuffer(g)||w.isTypedArray(g)?u&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function p(g,f,S){let T=g;if(g&&!S&&typeof g=="object"){if(w.endsWith(f,"{}"))f=i?f:f.slice(0,-2),g=JSON.stringify(g);else if(w.isArray(g)&&Ir(g)||(w.isFileList(g)||w.endsWith(f,"[]"))&&(T=w.toArray(g)))return f=es(f),T.forEach(function(D,B){!(w.isUndefined(D)||D===null)&&e.append(o===!0?ts([f],B,r):o===null?f:f+"[]",d(D))}),!1}return qt(g)?!0:(e.append(ts(S,f,r),d(g)),!1)}const m=[],b=Object.assign(Lr,{defaultVisitor:p,convertValue:d,isVisitable:qt});function y(g,f){if(!w.isUndefined(g)){if(m.indexOf(g)!==-1)throw Error("Circular reference detected in "+f.join("."));m.push(g),w.forEach(g,function(T,O){(!(w.isUndefined(T)||T===null)&&s.call(e,T,w.isString(O)?O.trim():O,f,b))===!0&&y(T,f?f.concat(O):[O])}),m.pop()}}if(!w.isObject(t))throw new TypeError("data must be an object");return y(t),e}function ns(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function jt(t,e){this._pairs=[],t&&pt(t,this,e)}const ss=jt.prototype;ss.append=function(e,n){this._pairs.push([e,n])},ss.toString=function(e){const n=e?function(i){return e.call(this,i,ns)}:ns;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Br(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function is(t,e,n){if(!e)return t;const i=n&&n.encode||Br;w.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let r;if(s?r=s(e,n):r=w.isURLSearchParams(e)?e.toString():new jt(e,n).toString(i),r){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+r}return t}class rs{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){w.forEach(this.handlers,function(i){i!==null&&e(i)})}}const os={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},qr={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:jt,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Ht=typeof window<"u"&&typeof document<"u",$t=typeof navigator=="object"&&navigator||void 0,jr=Ht&&(!$t||["ReactNative","NativeScript","NS"].indexOf($t.product)<0),Hr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",$r=Ht&&window.location.href||"http://localhost",K={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ht,hasStandardBrowserEnv:jr,hasStandardBrowserWebWorkerEnv:Hr,navigator:$t,origin:$r},Symbol.toStringTag,{value:"Module"})),...qr};function Wr(t,e){return pt(t,new K.classes.URLSearchParams,Object.assign({visitor:function(n,i,s,r){return K.isNode&&w.isBuffer(n)?(this.append(i,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}function Gr(t){return w.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Jr(t){const e={},n=Object.keys(t);let i;const s=n.length;let r;for(i=0;i<s;i++)r=n[i],e[r]=t[r];return e}function as(t){function e(n,i,s,r){let o=n[r++];if(o==="__proto__")return!0;const l=Number.isFinite(+o),u=r>=n.length;return o=!o&&w.isArray(s)?s.length:o,u?(w.hasOwnProp(s,o)?s[o]=[s[o],i]:s[o]=i,!l):((!s[o]||!w.isObject(s[o]))&&(s[o]=[]),e(n,i,s[o],r)&&w.isArray(s[o])&&(s[o]=Jr(s[o])),!l)}if(w.isFormData(t)&&w.isFunction(t.entries)){const n={};return w.forEachEntry(t,(i,s)=>{e(Gr(i),s,n,0)}),n}return null}function Yr(t,e,n){if(w.isString(t))try{return(e||JSON.parse)(t),w.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(0,JSON.stringify)(t)}const qe={transitional:os,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const i=n.getContentType()||"",s=i.indexOf("application/json")>-1,r=w.isObject(e);if(r&&w.isHTMLForm(e)&&(e=new FormData(e)),w.isFormData(e))return s?JSON.stringify(as(e)):e;if(w.isArrayBuffer(e)||w.isBuffer(e)||w.isStream(e)||w.isFile(e)||w.isBlob(e)||w.isReadableStream(e))return e;if(w.isArrayBufferView(e))return e.buffer;if(w.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(r){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Wr(e,this.formSerializer).toString();if((l=w.isFileList(e))||i.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return pt(l?{"files[]":e}:e,u&&new u,this.formSerializer)}}return r||s?(n.setContentType("application/json",!1),Yr(e)):e}],transformResponse:[function(e){const n=this.transitional||qe.transitional,i=n&&n.forcedJSONParsing,s=this.responseType==="json";if(w.isResponse(e)||w.isReadableStream(e))return e;if(e&&w.isString(e)&&(i&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(l){if(o)throw l.name==="SyntaxError"?M.from(l,M.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:K.classes.FormData,Blob:K.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};w.forEach(["delete","get","head","post","put","patch"],t=>{qe.headers[t]={}});const Kr=w.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Xr=t=>{const e={};let n,i,s;return t&&t.split(`
|
3
|
+
`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),i=o.substring(s+1).trim(),!(!n||e[n]&&Kr[n])&&(n==="set-cookie"?e[n]?e[n].push(i):e[n]=[i]:e[n]=e[n]?e[n]+", "+i:i)}),e},ls=Symbol("internals");function je(t){return t&&String(t).trim().toLowerCase()}function ht(t){return t===!1||t==null?t:w.isArray(t)?t.map(ht):String(t)}function Zr(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(t);)e[i[1]]=i[2];return e}const Qr=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Wt(t,e,n,i,s){if(w.isFunction(i))return i.call(this,e,n);if(s&&(e=n),!!w.isString(e)){if(w.isString(i))return e.indexOf(i)!==-1;if(w.isRegExp(i))return i.test(e)}}function eo(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,i)=>n.toUpperCase()+i)}function to(t,e){const n=w.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(t,i+n,{value:function(s,r,o){return this[i].call(this,e,s,r,o)},configurable:!0})})}class Q{constructor(e){e&&this.set(e)}set(e,n,i){const s=this;function r(l,u,d){const p=je(u);if(!p)throw new Error("header name must be a non-empty string");const m=w.findKey(s,p);(!m||s[m]===void 0||d===!0||d===void 0&&s[m]!==!1)&&(s[m||u]=ht(l))}const o=(l,u)=>w.forEach(l,(d,p)=>r(d,p,u));if(w.isPlainObject(e)||e instanceof this.constructor)o(e,n);else if(w.isString(e)&&(e=e.trim())&&!Qr(e))o(Xr(e),n);else if(w.isHeaders(e))for(const[l,u]of e.entries())r(u,l,i);else e!=null&&r(n,e,i);return this}get(e,n){if(e=je(e),e){const i=w.findKey(this,e);if(i){const s=this[i];if(!n)return s;if(n===!0)return Zr(s);if(w.isFunction(n))return n.call(this,s,i);if(w.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=je(e),e){const i=w.findKey(this,e);return!!(i&&this[i]!==void 0&&(!n||Wt(this,this[i],i,n)))}return!1}delete(e,n){const i=this;let s=!1;function r(o){if(o=je(o),o){const l=w.findKey(i,o);l&&(!n||Wt(i,i[l],l,n))&&(delete i[l],s=!0)}}return w.isArray(e)?e.forEach(r):r(e),s}clear(e){const n=Object.keys(this);let i=n.length,s=!1;for(;i--;){const r=n[i];(!e||Wt(this,this[r],r,e,!0))&&(delete this[r],s=!0)}return s}normalize(e){const n=this,i={};return w.forEach(this,(s,r)=>{const o=w.findKey(i,r);if(o){n[o]=ht(s),delete n[r];return}const l=e?eo(r):String(r).trim();l!==r&&delete n[r],n[l]=ht(s),i[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return w.forEach(this,(i,s)=>{i!=null&&i!==!1&&(n[s]=e&&w.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
4
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const i=new this(e);return n.forEach(s=>i.set(s)),i}static accessor(e){const i=(this[ls]=this[ls]={accessors:{}}).accessors,s=this.prototype;function r(o){const l=je(o);i[l]||(to(s,o),i[l]=!0)}return w.isArray(e)?e.forEach(r):r(e),this}}Q.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),w.reduceDescriptors(Q.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(i){this[n]=i}}}),w.freezeMethods(Q);function Gt(t,e){const n=this||qe,i=e||n,s=Q.from(i.headers);let r=i.data;return w.forEach(t,function(l){r=l.call(n,r,s.normalize(),e?e.status:void 0)}),s.normalize(),r}function cs(t){return!!(t&&t.__CANCEL__)}function Ve(t,e,n){M.call(this,t??"canceled",M.ERR_CANCELED,e,n),this.name="CanceledError"}w.inherits(Ve,M,{__CANCEL__:!0});function us(t,e,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?t(n):e(new M("Request failed with status code "+n.status,[M.ERR_BAD_REQUEST,M.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function no(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function so(t,e){t=t||10;const n=new Array(t),i=new Array(t);let s=0,r=0,o;return e=e!==void 0?e:1e3,function(u){const d=Date.now(),p=i[r];o||(o=d),n[s]=u,i[s]=d;let m=r,b=0;for(;m!==s;)b+=n[m++],m=m%t;if(s=(s+1)%t,s===r&&(r=(r+1)%t),d-o<e)return;const y=p&&d-p;return y?Math.round(b*1e3/y):void 0}}function io(t,e){let n=0,i=1e3/e,s,r;const o=(d,p=Date.now())=>{n=p,s=null,r&&(clearTimeout(r),r=null),t.apply(null,d)};return[(...d)=>{const p=Date.now(),m=p-n;m>=i?o(d,p):(s=d,r||(r=setTimeout(()=>{r=null,o(s)},i-m)))},()=>s&&o(s)]}const mt=(t,e,n=3)=>{let i=0;const s=so(50,250);return io(r=>{const o=r.loaded,l=r.lengthComputable?r.total:void 0,u=o-i,d=s(u),p=o<=l;i=o;const m={loaded:o,total:l,progress:l?o/l:void 0,bytes:u,rate:d||void 0,estimated:d&&l&&p?(l-o)/d:void 0,event:r,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(m)},n)},ds=(t,e)=>{const n=t!=null;return[i=>e[0]({lengthComputable:n,total:t,loaded:i}),e[1]]},ps=t=>(...e)=>w.asap(()=>t(...e)),ro=K.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,K.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(K.origin),K.navigator&&/(msie|trident)/i.test(K.navigator.userAgent)):()=>!0,oo=K.hasStandardBrowserEnv?{write(t,e,n,i,s,r){const o=[t+"="+encodeURIComponent(e)];w.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),w.isString(i)&&o.push("path="+i),w.isString(s)&&o.push("domain="+s),r===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function ao(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function lo(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function hs(t,e){return t&&!ao(e)?lo(t,e):e}const ms=t=>t instanceof Q?{...t}:t;function xe(t,e){e=e||{};const n={};function i(d,p,m,b){return w.isPlainObject(d)&&w.isPlainObject(p)?w.merge.call({caseless:b},d,p):w.isPlainObject(p)?w.merge({},p):w.isArray(p)?p.slice():p}function s(d,p,m,b){if(w.isUndefined(p)){if(!w.isUndefined(d))return i(void 0,d,m,b)}else return i(d,p,m,b)}function r(d,p){if(!w.isUndefined(p))return i(void 0,p)}function o(d,p){if(w.isUndefined(p)){if(!w.isUndefined(d))return i(void 0,d)}else return i(void 0,p)}function l(d,p,m){if(m in e)return i(d,p);if(m in t)return i(void 0,d)}const u={url:r,method:r,data:r,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(d,p,m)=>s(ms(d),ms(p),m,!0)};return w.forEach(Object.keys(Object.assign({},t,e)),function(p){const m=u[p]||s,b=m(t[p],e[p],p);w.isUndefined(b)&&m!==l||(n[p]=b)}),n}const fs=t=>{const e=xe({},t);let{data:n,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:r,headers:o,auth:l}=e;e.headers=o=Q.from(o),e.url=is(hs(e.baseURL,e.url),t.params,t.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let u;if(w.isFormData(n)){if(K.hasStandardBrowserEnv||K.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((u=o.getContentType())!==!1){const[d,...p]=u?u.split(";").map(m=>m.trim()).filter(Boolean):[];o.setContentType([d||"multipart/form-data",...p].join("; "))}}if(K.hasStandardBrowserEnv&&(i&&w.isFunction(i)&&(i=i(e)),i||i!==!1&&ro(e.url))){const d=s&&r&&oo.read(r);d&&o.set(s,d)}return e},co=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,i){const s=fs(t);let r=s.data;const o=Q.from(s.headers).normalize();let{responseType:l,onUploadProgress:u,onDownloadProgress:d}=s,p,m,b,y,g;function f(){y&&y(),g&&g(),s.cancelToken&&s.cancelToken.unsubscribe(p),s.signal&&s.signal.removeEventListener("abort",p)}let S=new XMLHttpRequest;S.open(s.method.toUpperCase(),s.url,!0),S.timeout=s.timeout;function T(){if(!S)return;const D=Q.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),E={data:!l||l==="text"||l==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:D,config:t,request:S};us(function(L){n(L),f()},function(L){i(L),f()},E),S=null}"onloadend"in S?S.onloadend=T:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(T)},S.onabort=function(){S&&(i(new M("Request aborted",M.ECONNABORTED,t,S)),S=null)},S.onerror=function(){i(new M("Network Error",M.ERR_NETWORK,t,S)),S=null},S.ontimeout=function(){let B=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const E=s.transitional||os;s.timeoutErrorMessage&&(B=s.timeoutErrorMessage),i(new M(B,E.clarifyTimeoutError?M.ETIMEDOUT:M.ECONNABORTED,t,S)),S=null},r===void 0&&o.setContentType(null),"setRequestHeader"in S&&w.forEach(o.toJSON(),function(B,E){S.setRequestHeader(E,B)}),w.isUndefined(s.withCredentials)||(S.withCredentials=!!s.withCredentials),l&&l!=="json"&&(S.responseType=s.responseType),d&&([b,g]=mt(d,!0),S.addEventListener("progress",b)),u&&S.upload&&([m,y]=mt(u),S.upload.addEventListener("progress",m),S.upload.addEventListener("loadend",y)),(s.cancelToken||s.signal)&&(p=D=>{S&&(i(!D||D.type?new Ve(null,t,S):D),S.abort(),S=null)},s.cancelToken&&s.cancelToken.subscribe(p),s.signal&&(s.signal.aborted?p():s.signal.addEventListener("abort",p)));const O=no(s.url);if(O&&K.protocols.indexOf(O)===-1){i(new M("Unsupported protocol "+O+":",M.ERR_BAD_REQUEST,t));return}S.send(r||null)})},uo=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let i=new AbortController,s;const r=function(d){if(!s){s=!0,l();const p=d instanceof Error?d:this.reason;i.abort(p instanceof M?p:new Ve(p instanceof Error?p.message:p))}};let o=e&&setTimeout(()=>{o=null,r(new M(`timeout ${e} of ms exceeded`,M.ETIMEDOUT))},e);const l=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(d=>{d.unsubscribe?d.unsubscribe(r):d.removeEventListener("abort",r)}),t=null)};t.forEach(d=>d.addEventListener("abort",r));const{signal:u}=i;return u.unsubscribe=()=>w.asap(l),u}},po=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let i=0,s;for(;i<n;)s=i+e,yield t.slice(i,s),i=s},ho=async function*(t,e){for await(const n of mo(t))yield*po(n,e)},mo=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:i}=await e.read();if(n)break;yield i}}finally{await e.cancel()}},gs=(t,e,n,i)=>{const s=ho(t,e);let r=0,o,l=u=>{o||(o=!0,i&&i(u))};return new ReadableStream({async pull(u){try{const{done:d,value:p}=await s.next();if(d){l(),u.close();return}let m=p.byteLength;if(n){let b=r+=m;n(b)}u.enqueue(new Uint8Array(p))}catch(d){throw l(d),d}},cancel(u){return l(u),s.return()}},{highWaterMark:2})},ft=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",bs=ft&&typeof ReadableStream=="function",fo=ft&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),ys=(t,...e)=>{try{return!!t(...e)}catch{return!1}},go=bs&&ys(()=>{let t=!1;const e=new Request(K.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),ws=64*1024,Jt=bs&&ys(()=>w.isReadableStream(new Response("").body)),gt={stream:Jt&&(t=>t.body)};ft&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!gt[e]&&(gt[e]=w.isFunction(t[e])?n=>n[e]():(n,i)=>{throw new M(`Response type '${e}' is not supported`,M.ERR_NOT_SUPPORT,i)})})})(new Response);const bo=async t=>{if(t==null)return 0;if(w.isBlob(t))return t.size;if(w.isSpecCompliantForm(t))return(await new Request(K.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(w.isArrayBufferView(t)||w.isArrayBuffer(t))return t.byteLength;if(w.isURLSearchParams(t)&&(t=t+""),w.isString(t))return(await fo(t)).byteLength},yo=async(t,e)=>{const n=w.toFiniteNumber(t.getContentLength());return n??bo(e)},Yt={http:zr,xhr:co,fetch:ft&&(async t=>{let{url:e,method:n,data:i,signal:s,cancelToken:r,timeout:o,onDownloadProgress:l,onUploadProgress:u,responseType:d,headers:p,withCredentials:m="same-origin",fetchOptions:b}=fs(t);d=d?(d+"").toLowerCase():"text";let y=uo([s,r&&r.toAbortSignal()],o),g;const f=y&&y.unsubscribe&&(()=>{y.unsubscribe()});let S;try{if(u&&go&&n!=="get"&&n!=="head"&&(S=await yo(p,i))!==0){let E=new Request(e,{method:"POST",body:i,duplex:"half"}),R;if(w.isFormData(i)&&(R=E.headers.get("content-type"))&&p.setContentType(R),E.body){const[L,Z]=ds(S,mt(ps(u)));i=gs(E.body,ws,L,Z)}}w.isString(m)||(m=m?"include":"omit");const T="credentials"in Request.prototype;g=new Request(e,{...b,signal:y,method:n.toUpperCase(),headers:p.normalize().toJSON(),body:i,duplex:"half",credentials:T?m:void 0});let O=await fetch(g);const D=Jt&&(d==="stream"||d==="response");if(Jt&&(l||D&&f)){const E={};["status","statusText","headers"].forEach(_e=>{E[_e]=O[_e]});const R=w.toFiniteNumber(O.headers.get("content-length")),[L,Z]=l&&ds(R,mt(ps(l),!0))||[];O=new Response(gs(O.body,ws,L,()=>{Z&&Z(),f&&f()}),E)}d=d||"text";let B=await gt[w.findKey(gt,d)||"text"](O,t);return!D&&f&&f(),await new Promise((E,R)=>{us(E,R,{data:B,headers:Q.from(O.headers),status:O.status,statusText:O.statusText,config:t,request:g})})}catch(T){throw f&&f(),T&&T.name==="TypeError"&&/fetch/i.test(T.message)?Object.assign(new M("Network Error",M.ERR_NETWORK,t,g),{cause:T.cause||T}):M.from(T,T&&T.code,t,g)}})};w.forEach(Yt,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const _s=t=>`- ${t}`,wo=t=>w.isFunction(t)||t===null||t===!1,vs={getAdapter:t=>{t=w.isArray(t)?t:[t];const{length:e}=t;let n,i;const s={};for(let r=0;r<e;r++){n=t[r];let o;if(i=n,!wo(n)&&(i=Yt[(o=String(n)).toLowerCase()],i===void 0))throw new M(`Unknown adapter '${o}'`);if(i)break;s[o||"#"+r]=i}if(!i){const r=Object.entries(s).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=e?r.length>1?`since :
|
5
|
+
`+r.map(_s).join(`
|
6
|
+
`):" "+_s(r[0]):"as no adapter specified";throw new M("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i},adapters:Yt};function Kt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ve(null,t)}function Ss(t){return Kt(t),t.headers=Q.from(t.headers),t.data=Gt.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),vs.getAdapter(t.adapter||qe.adapter)(t).then(function(i){return Kt(t),i.data=Gt.call(t,t.transformResponse,i),i.headers=Q.from(i.headers),i},function(i){return cs(i)||(Kt(t),i&&i.response&&(i.response.data=Gt.call(t,t.transformResponse,i.response),i.response.headers=Q.from(i.response.headers))),Promise.reject(i)})}const ks="1.7.9",bt={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{bt[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}});const xs={};bt.transitional=function(e,n,i){function s(r,o){return"[Axios v"+ks+"] Transitional option '"+r+"'"+o+(i?". "+i:"")}return(r,o,l)=>{if(e===!1)throw new M(s(o," has been removed"+(n?" in "+n:"")),M.ERR_DEPRECATED);return n&&!xs[o]&&(xs[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(r,o,l):!0}},bt.spelling=function(e){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${e}`),!0)};function _o(t,e,n){if(typeof t!="object")throw new M("options must be an object",M.ERR_BAD_OPTION_VALUE);const i=Object.keys(t);let s=i.length;for(;s-- >0;){const r=i[s],o=e[r];if(o){const l=t[r],u=l===void 0||o(l,r,t);if(u!==!0)throw new M("option "+r+" must be "+u,M.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new M("Unknown option "+r,M.ERR_BAD_OPTION)}}const yt={assertOptions:_o,validators:bt},he=yt.validators;class Ee{constructor(e){this.defaults=e,this.interceptors={request:new rs,response:new rs}}async request(e,n){try{return await this._request(e,n)}catch(i){if(i instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const r=s.stack?s.stack.replace(/^.+\n/,""):"";try{i.stack?r&&!String(i.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(i.stack+=`
|
7
|
+
`+r):i.stack=r}catch{}}throw i}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=xe(this.defaults,n);const{transitional:i,paramsSerializer:s,headers:r}=n;i!==void 0&&yt.assertOptions(i,{silentJSONParsing:he.transitional(he.boolean),forcedJSONParsing:he.transitional(he.boolean),clarifyTimeoutError:he.transitional(he.boolean)},!1),s!=null&&(w.isFunction(s)?n.paramsSerializer={serialize:s}:yt.assertOptions(s,{encode:he.function,serialize:he.function},!0)),yt.assertOptions(n,{baseUrl:he.spelling("baseURL"),withXsrfToken:he.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=r&&w.merge(r.common,r[n.method]);r&&w.forEach(["delete","get","head","post","put","patch","common"],g=>{delete r[g]}),n.headers=Q.concat(o,r);const l=[];let u=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(n)===!1||(u=u&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const d=[];this.interceptors.response.forEach(function(f){d.push(f.fulfilled,f.rejected)});let p,m=0,b;if(!u){const g=[Ss.bind(this),void 0];for(g.unshift.apply(g,l),g.push.apply(g,d),b=g.length,p=Promise.resolve(n);m<b;)p=p.then(g[m++],g[m++]);return p}b=l.length;let y=n;for(m=0;m<b;){const g=l[m++],f=l[m++];try{y=g(y)}catch(S){f.call(this,S);break}}try{p=Ss.call(this,y)}catch(g){return Promise.reject(g)}for(m=0,b=d.length;m<b;)p=p.then(d[m++],d[m++]);return p}getUri(e){e=xe(this.defaults,e);const n=hs(e.baseURL,e.url);return is(n,e.params,e.paramsSerializer)}}w.forEach(["delete","get","head","options"],function(e){Ee.prototype[e]=function(n,i){return this.request(xe(i||{},{method:e,url:n,data:(i||{}).data}))}}),w.forEach(["post","put","patch"],function(e){function n(i){return function(r,o,l){return this.request(xe(l||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}Ee.prototype[e]=n(),Ee.prototype[e+"Form"]=n(!0)});class Xt{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(r){n=r});const i=this;this.promise.then(s=>{if(!i._listeners)return;let r=i._listeners.length;for(;r-- >0;)i._listeners[r](s);i._listeners=null}),this.promise.then=s=>{let r;const o=new Promise(l=>{i.subscribe(l),r=l}).then(s);return o.cancel=function(){i.unsubscribe(r)},o},e(function(r,o,l){i.reason||(i.reason=new Ve(r,o,l),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=i=>{e.abort(i)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new Xt(function(s){e=s}),cancel:e}}}function vo(t){return function(n){return t.apply(null,n)}}function So(t){return w.isObject(t)&&t.isAxiosError===!0}const Zt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Zt).forEach(([t,e])=>{Zt[e]=t});function Es(t){const e=new Ee(t),n=qn(Ee.prototype.request,e);return w.extend(n,Ee.prototype,e,{allOwnKeys:!0}),w.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return Es(xe(t,s))},n}const $=Es(qe);$.Axios=Ee,$.CanceledError=Ve,$.CancelToken=Xt,$.isCancel=cs,$.VERSION=ks,$.toFormData=pt,$.AxiosError=M,$.Cancel=$.CanceledError,$.all=function(e){return Promise.all(e)},$.spread=vo,$.isAxiosError=So,$.mergeConfig=xe,$.AxiosHeaders=Q,$.formToJSON=t=>as(w.isHTMLForm(t)?new FormData(t):t),$.getAdapter=vs.getAdapter,$.HttpStatusCode=Zt,$.default=$;const Cs=6048e5,ko=864e5,Os=Symbol.for("constructDateFrom");function ye(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Os in t?t[Os](e):t instanceof Date?new t.constructor(e):new Date(e)}function ue(t,e){return ye(e||t,t)}let xo={};function wt(){return xo}function He(t,e){var l,u,d,p;const n=wt(),i=(e==null?void 0:e.weekStartsOn)??((u=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((p=(d=n.locale)==null?void 0:d.options)==null?void 0:p.weekStartsOn)??0,s=ue(t,e==null?void 0:e.in),r=s.getDay(),o=(r<i?7:0)+r-i;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function _t(t,e){return He(t,{...e,weekStartsOn:1})}function Ts(t,e){const n=ue(t,e==null?void 0:e.in),i=n.getFullYear(),s=ye(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=_t(s),o=ye(n,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const l=_t(o);return n.getTime()>=r.getTime()?i+1:n.getTime()>=l.getTime()?i:i-1}function Rs(t){const e=ue(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function Eo(t,...e){const n=ye.bind(null,e.find(i=>typeof i=="object"));return e.map(n)}function Ds(t,e){const n=ue(t,e==null?void 0:e.in);return n.setHours(0,0,0,0),n}function Co(t,e,n){const[i,s]=Eo(n==null?void 0:n.in,t,e),r=Ds(i),o=Ds(s),l=+r-Rs(r),u=+o-Rs(o);return Math.round((l-u)/ko)}function Oo(t,e){const n=Ts(t,e),i=ye(t,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),_t(i)}function To(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Ro(t){return!(!To(t)&&typeof t!="number"||isNaN(+ue(t)))}function Do(t,e){const n=ue(t,e==null?void 0:e.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Ao={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Po=(t,e,n)=>{let i;const s=Ao[t];return typeof s=="string"?i=s:e===1?i=s.one:i=s.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Qt(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const Vo={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Mo={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Uo={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},No={date:Qt({formats:Vo,defaultWidth:"full"}),time:Qt({formats:Mo,defaultWidth:"full"}),dateTime:Qt({formats:Uo,defaultWidth:"full"})},Fo={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},zo=(t,e,n,i)=>Fo[t];function $e(t){return(e,n)=>{const i=n!=null&&n.context?String(n.context):"standalone";let s;if(i==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):o;s=t.formattingValues[l]||t.formattingValues[o]}else{const o=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[l]||t.values[o]}const r=t.argumentCallback?t.argumentCallback(e):e;return s[r]}}const Io={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Lo={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Bo={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},qo={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},jo={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ho={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},$o={ordinalNumber:(t,e)=>{const n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:$e({values:Io,defaultWidth:"wide"}),quarter:$e({values:Lo,defaultWidth:"wide",argumentCallback:t=>t-1}),month:$e({values:Bo,defaultWidth:"wide"}),day:$e({values:qo,defaultWidth:"wide"}),dayPeriod:$e({values:jo,defaultWidth:"wide",formattingValues:Ho,defaultFormattingWidth:"wide"})};function We(t){return(e,n={})=>{const i=n.width,s=i&&t.matchPatterns[i]||t.matchPatterns[t.defaultMatchWidth],r=e.match(s);if(!r)return null;const o=r[0],l=i&&t.parsePatterns[i]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(l)?Go(l,m=>m.test(o)):Wo(l,m=>m.test(o));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const p=e.slice(o.length);return{value:d,rest:p}}}function Wo(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Go(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Jo(t){return(e,n={})=>{const i=e.match(t.matchPattern);if(!i)return null;const s=i[0],r=e.match(t.parsePattern);if(!r)return null;let o=t.valueCallback?t.valueCallback(r[0]):r[0];o=n.valueCallback?n.valueCallback(o):o;const l=e.slice(s.length);return{value:o,rest:l}}}const Yo=/^(\d+)(th|st|nd|rd)?/i,Ko=/\d+/i,Xo={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Zo={any:[/^b/i,/^(a|c)/i]},Qo={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ea={any:[/1/i,/2/i,/3/i,/4/i]},ta={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},na={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},sa={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ia={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},ra={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},oa={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},aa={ordinalNumber:Jo({matchPattern:Yo,parsePattern:Ko,valueCallback:t=>parseInt(t,10)}),era:We({matchPatterns:Xo,defaultMatchWidth:"wide",parsePatterns:Zo,defaultParseWidth:"any"}),quarter:We({matchPatterns:Qo,defaultMatchWidth:"wide",parsePatterns:ea,defaultParseWidth:"any",valueCallback:t=>t+1}),month:We({matchPatterns:ta,defaultMatchWidth:"wide",parsePatterns:na,defaultParseWidth:"any"}),day:We({matchPatterns:sa,defaultMatchWidth:"wide",parsePatterns:ia,defaultParseWidth:"any"}),dayPeriod:We({matchPatterns:ra,defaultMatchWidth:"any",parsePatterns:oa,defaultParseWidth:"any"})},la={code:"en-US",formatDistance:Po,formatLong:No,formatRelative:zo,localize:$o,match:aa,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ca(t,e){const n=ue(t,e==null?void 0:e.in);return Co(n,Do(n))+1}function ua(t,e){const n=ue(t,e==null?void 0:e.in),i=+_t(n)-+Oo(n);return Math.round(i/Cs)+1}function As(t,e){var p,m,b,y;const n=ue(t,e==null?void 0:e.in),i=n.getFullYear(),s=wt(),r=(e==null?void 0:e.firstWeekContainsDate)??((m=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??s.firstWeekContainsDate??((y=(b=s.locale)==null?void 0:b.options)==null?void 0:y.firstWeekContainsDate)??1,o=ye((e==null?void 0:e.in)||t,0);o.setFullYear(i+1,0,r),o.setHours(0,0,0,0);const l=He(o,e),u=ye((e==null?void 0:e.in)||t,0);u.setFullYear(i,0,r),u.setHours(0,0,0,0);const d=He(u,e);return+n>=+l?i+1:+n>=+d?i:i-1}function da(t,e){var l,u,d,p;const n=wt(),i=(e==null?void 0:e.firstWeekContainsDate)??((u=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(d=n.locale)==null?void 0:d.options)==null?void 0:p.firstWeekContainsDate)??1,s=As(t,e),r=ye((e==null?void 0:e.in)||t,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),He(r,e)}function pa(t,e){const n=ue(t,e==null?void 0:e.in),i=+He(n,e)-+da(n,e);return Math.round(i/Cs)+1}function I(t,e){const n=t<0?"-":"",i=Math.abs(t).toString().padStart(e,"0");return n+i}const we={y(t,e){const n=t.getFullYear(),i=n>0?n:1-n;return I(e==="yy"?i%100:i,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):I(n+1,2)},d(t,e){return I(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return I(t.getHours()%12||12,e.length)},H(t,e){return I(t.getHours(),e.length)},m(t,e){return I(t.getMinutes(),e.length)},s(t,e){return I(t.getSeconds(),e.length)},S(t,e){const n=e.length,i=t.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return I(s,e.length)}},Me={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ps={G:function(t,e,n){const i=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const i=t.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return we.y(t,e)},Y:function(t,e,n,i){const s=As(t,i),r=s>0?s:1-s;if(e==="YY"){const o=r%100;return I(o,2)}return e==="Yo"?n.ordinalNumber(r,{unit:"year"}):I(r,e.length)},R:function(t,e){const n=Ts(t);return I(n,e.length)},u:function(t,e){const n=t.getFullYear();return I(n,e.length)},Q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return I(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return I(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,e,n){const i=t.getMonth();switch(e){case"M":case"MM":return we.M(t,e);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,e,n){const i=t.getMonth();switch(e){case"L":return String(i+1);case"LL":return I(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,e,n,i){const s=pa(t,i);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):I(s,e.length)},I:function(t,e,n){const i=ua(t);return e==="Io"?n.ordinalNumber(i,{unit:"week"}):I(i,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):we.d(t,e)},D:function(t,e,n){const i=ca(t);return e==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):I(i,e.length)},E:function(t,e,n){const i=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,e,n,i){const s=t.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return I(r,2);case"eo":return n.ordinalNumber(r,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,i){const s=t.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return I(r,e.length);case"co":return n.ordinalNumber(r,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const i=t.getDay(),s=i===0?7:i;switch(e){case"i":return String(s);case"ii":return I(s,e.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const i=t.getHours();let s;switch(i===12?s=Me.noon:i===0?s=Me.midnight:s=i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,n){const i=t.getHours();let s;switch(i>=17?s=Me.evening:i>=12?s=Me.afternoon:i>=4?s=Me.morning:s=Me.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let i=t.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return we.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):we.H(t,e)},K:function(t,e,n){const i=t.getHours()%12;return e==="Ko"?n.ordinalNumber(i,{unit:"hour"}):I(i,e.length)},k:function(t,e,n){let i=t.getHours();return i===0&&(i=24),e==="ko"?n.ordinalNumber(i,{unit:"hour"}):I(i,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):we.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):we.s(t,e)},S:function(t,e){return we.S(t,e)},X:function(t,e,n){const i=t.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return Ms(i);case"XXXX":case"XX":return Ce(i);case"XXXXX":case"XXX":default:return Ce(i,":")}},x:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"x":return Ms(i);case"xxxx":case"xx":return Ce(i);case"xxxxx":case"xxx":default:return Ce(i,":")}},O:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Vs(i,":");case"OOOO":default:return"GMT"+Ce(i,":")}},z:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Vs(i,":");case"zzzz":default:return"GMT"+Ce(i,":")}},t:function(t,e,n){const i=Math.trunc(+t/1e3);return I(i,e.length)},T:function(t,e,n){return I(+t,e.length)}};function Vs(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),s=Math.trunc(i/60),r=i%60;return r===0?n+String(s):n+String(s)+e+I(r,2)}function Ms(t,e){return t%60===0?(t>0?"-":"+")+I(Math.abs(t)/60,2):Ce(t,e)}function Ce(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),s=I(Math.trunc(i/60),2),r=I(i%60,2);return n+s+e+r}const Us=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Ns=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},ha={p:Ns,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return Us(t,e);let r;switch(i){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"});break}return r.replace("{{date}}",Us(i,e)).replace("{{time}}",Ns(s,e))}},ma=/^D+$/,fa=/^Y+$/,ga=["D","DD","YY","YYYY"];function ba(t){return ma.test(t)}function ya(t){return fa.test(t)}function wa(t,e,n){const i=_a(t,e,n);if(console.warn(i),ga.includes(t))throw new RangeError(i)}function _a(t,e,n){const i=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const va=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Sa=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ka=/^'([^]*?)'?$/,xa=/''/g,Ea=/[a-zA-Z]/;function Ge(t,e,n){var p,m,b,y;const i=wt(),s=i.locale??la,r=i.firstWeekContainsDate??((m=(p=i.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??1,o=i.weekStartsOn??((y=(b=i.locale)==null?void 0:b.options)==null?void 0:y.weekStartsOn)??0,l=ue(t,n==null?void 0:n.in);if(!Ro(l))throw new RangeError("Invalid time value");let u=e.match(Sa).map(g=>{const f=g[0];if(f==="p"||f==="P"){const S=ha[f];return S(g,s.formatLong)}return g}).join("").match(va).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const f=g[0];if(f==="'")return{isToken:!1,value:Ca(g)};if(Ps[f])return{isToken:!0,value:g};if(f.match(Ea))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:g}});s.localize.preprocessor&&(u=s.localize.preprocessor(l,u));const d={firstWeekContainsDate:r,weekStartsOn:o,locale:s};return u.map(g=>{if(!g.isToken)return g.value;const f=g.value;(ya(f)||ba(f))&&wa(f,e,String(t));const S=Ps[f[0]];return S(l,f,s.localize,d)}).join("")}function Ca(t){const e=t.match(ka);return e?e[1].replace(xa,"'"):t}const Oa={name:"splitpanes",emits:["ready","resize","resized","pane-click","pane-maximize","pane-add","pane-remove","splitter-click"],props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((t,e)=>(t[e.id]=e)&&t,{})}},methods:{updatePaneComponents(){this.panes.forEach(t=>{t.update&&t.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[t.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(t,e){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=e},onMouseMove(t){this.touch.mouseDown&&(t.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(t)),this.$emit("resize",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(t,e){"ontouchstart"in window&&(t.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===e?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(t,e),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=e,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[e])},onSplitterDblClick(t,e){let n=0;this.panes=this.panes.map((i,s)=>(i.size=s===e?i.max:i.min,s!==e&&(n+=i.min),i)),this.panes[e].size-=n,this.$emit("pane-maximize",this.panes[e]),this.$emit("resized",this.panes.map(i=>({min:i.min,max:i.max,size:i.size})))},onPaneClick(t,e){this.$emit("pane-click",this.indexedPanes[e])},getCurrentMouseDrag(t){const e=this.container.getBoundingClientRect(),{clientX:n,clientY:i}="ontouchstart"in window&&t.touches?t.touches[0]:t;return{x:n-e.left,y:i-e.top}},getCurrentDragPercentage(t){t=t[this.horizontal?"y":"x"];const e=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(t=e-t),t*100/e},calculatePanesSize(t){const e=this.touch.activeSplitter;let n={prevPanesSize:this.sumPrevPanesSize(e),nextPanesSize:this.sumNextPanesSize(e),prevReachedMinPanes:0,nextReachedMinPanes:0};const i=0+(this.pushOtherPanes?0:n.prevPanesSize),s=100-(this.pushOtherPanes?0:n.nextPanesSize),r=Math.max(Math.min(this.getCurrentDragPercentage(t),s),i);let o=[e,e+1],l=this.panes[o[0]]||null,u=this.panes[o[1]]||null;const d=l.max<100&&r>=l.max+n.prevPanesSize,p=u.max<100&&r<=100-(u.max+this.sumNextPanesSize(e+1));if(d||p){d?(l.size=l.max,u.size=Math.max(100-l.max-n.prevPanesSize-n.nextPanesSize,0)):(l.size=Math.max(100-u.max-n.prevPanesSize-this.sumNextPanesSize(e+1),0),u.size=u.max);return}if(this.pushOtherPanes){const m=this.doPushOtherPanes(n,r);if(!m)return;({sums:n,panesToResize:o}=m),l=this.panes[o[0]]||null,u=this.panes[o[1]]||null}l!==null&&(l.size=Math.min(Math.max(r-n.prevPanesSize-n.prevReachedMinPanes,l.min),l.max)),u!==null&&(u.size=Math.min(Math.max(100-r-n.nextPanesSize-n.nextReachedMinPanes,u.min),u.max))},doPushOtherPanes(t,e){const n=this.touch.activeSplitter,i=[n,n+1];return e<t.prevPanesSize+this.panes[i[0]].min&&(i[0]=this.findPrevExpandedPane(n).index,t.prevReachedMinPanes=0,i[0]<n&&this.panes.forEach((s,r)=>{r>i[0]&&r<=n&&(s.size=s.min,t.prevReachedMinPanes+=s.min)}),t.prevPanesSize=this.sumPrevPanesSize(i[0]),i[0]===void 0)?(t.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((s,r)=>{r>0&&r<=n&&(s.size=s.min,t.prevReachedMinPanes+=s.min)}),this.panes[i[1]].size=100-t.prevReachedMinPanes-this.panes[0].min-t.prevPanesSize-t.nextPanesSize,null):e>100-t.nextPanesSize-this.panes[i[1]].min&&(i[1]=this.findNextExpandedPane(n).index,t.nextReachedMinPanes=0,i[1]>n+1&&this.panes.forEach((s,r)=>{r>n&&r<i[1]&&(s.size=s.min,t.nextReachedMinPanes+=s.min)}),t.nextPanesSize=this.sumNextPanesSize(i[1]-1),i[1]===void 0)?(t.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((s,r)=>{r<this.panesCount-1&&r>=n+1&&(s.size=s.min,t.nextReachedMinPanes+=s.min)}),this.panes[i[0]].size=100-t.prevPanesSize-t.nextReachedMinPanes-this.panes[this.panesCount-1].min-t.nextPanesSize,null):{sums:t,panesToResize:i}},sumPrevPanesSize(t){return this.panes.reduce((e,n,i)=>e+(i<t?n.size:0),0)},sumNextPanesSize(t){return this.panes.reduce((e,n,i)=>e+(i>t+1?n.size:0),0)},findPrevExpandedPane(t){return[...this.panes].reverse().find(e=>e.index<t&&e.size>e.min)||{}},findNextExpandedPane(t){return this.panes.find(e=>e.index>t+1&&e.size>e.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(t=>{const e=t.classList.contains("splitpanes__pane"),n=t.classList.contains("splitpanes__splitter");!e&&!n&&(t.parentNode.removeChild(t),console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed."))})},addSplitter(t,e,n=!1){const i=t-1,s=document.createElement("div");s.classList.add("splitpanes__splitter"),n||(s.onmousedown=r=>this.onMouseDown(r,i),typeof window<"u"&&"ontouchstart"in window&&(s.ontouchstart=r=>this.onMouseDown(r,i)),s.onclick=r=>this.onSplitterClick(r,i+1)),this.dblClickSplitter&&(s.ondblclick=r=>this.onSplitterDblClick(r,i+1)),e.parentNode.insertBefore(s,e)},removeSplitter(t){t.onmousedown=void 0,t.onclick=void 0,t.ondblclick=void 0,t.parentNode.removeChild(t)},redoSplitters(){const t=Array.from(this.container.children);t.forEach(n=>{n.className.includes("splitpanes__splitter")&&this.removeSplitter(n)});let e=0;t.forEach(n=>{n.className.includes("splitpanes__pane")&&(!e&&this.firstSplitter?this.addSplitter(e,n,!0):e&&this.addSplitter(e,n),e++)})},requestUpdate({target:t,...e}){const n=this.indexedPanes[t._.uid];Object.entries(e).forEach(([i,s])=>n[i]=s)},onPaneAdd(t){let e=-1;Array.from(t.$el.parentNode.children).some(s=>(s.className.includes("splitpanes__pane")&&e++,s===t.$el));const n=parseFloat(t.minSize),i=parseFloat(t.maxSize);this.panes.splice(e,0,{id:t._.uid,index:e,min:isNaN(n)?0:n,max:isNaN(i)?100:i,size:t.size===null?null:parseFloat(t.size),givenSize:t.size,update:t.update}),this.panes.forEach((s,r)=>s.index=r),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[e]}),this.$emit("pane-add",{index:e,panes:this.panes.map(s=>({min:s.min,max:s.max,size:s.size}))})})},onPaneRemove(t){const e=this.panes.findIndex(i=>i.id===t._.uid),n=this.panes.splice(e,1)[0];this.panes.forEach((i,s)=>i.index=s),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:e}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(i=>({min:i.min,max:i.max,size:i.size}))})})},resetPaneSizes(t={}){!t.addedPane&&!t.removedPane?this.initialPanesSizing():this.panes.some(e=>e.givenSize!==null||e.min||e.max<100)?this.equalizeAfterAddOrRemove(t):this.equalize(),this.ready&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size})))},equalize(){const t=100/this.panesCount;let e=0;const n=[],i=[];this.panes.forEach(s=>{s.size=Math.max(Math.min(t,s.max),s.min),e-=s.size,s.size>=s.max&&n.push(s.id),s.size<=s.min&&i.push(s.id)}),e>.1&&this.readjustSizes(e,n,i)},initialPanesSizing(){let t=100;const e=[],n=[];let i=0;this.panes.forEach(r=>{t-=r.size,r.size!==null&&i++,r.size>=r.max&&e.push(r.id),r.size<=r.min&&n.push(r.id)});let s=100;t>.1&&(this.panes.forEach(r=>{r.size===null&&(r.size=Math.max(Math.min(t/(this.panesCount-i),r.max),r.min)),s-=r.size}),s>.1&&this.readjustSizes(t,e,n))},equalizeAfterAddOrRemove({addedPane:t,removedPane:e}={}){let n=100/this.panesCount,i=0;const s=[],r=[];t&&t.givenSize!==null&&(n=(100-t.givenSize)/(this.panesCount-1)),this.panes.forEach(o=>{i-=o.size,o.size>=o.max&&s.push(o.id),o.size<=o.min&&r.push(o.id)}),!(Math.abs(i)<.1)&&(this.panes.forEach(o=>{t&&t.givenSize!==null&&t.id===o.id||(o.size=Math.max(Math.min(n,o.max),o.min)),i-=o.size,o.size>=o.max&&s.push(o.id),o.size<=o.min&&r.push(o.id)}),i>.1&&this.readjustSizes(i,s,r))},readjustSizes(t,e,n){let i;t>0?i=t/(this.panesCount-e.length):i=t/(this.panesCount-n.length),this.panes.forEach((s,r)=>{if(t>0&&!e.includes(s.id)){const o=Math.max(Math.min(s.size+i,s.max),s.min),l=o-s.size;t-=l,s.size=o}else if(!n.includes(s.id)){const o=Math.max(Math.min(s.size+i,s.max),s.min),l=o-s.size;t-=l,s.size=o}s.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[s.id].size}%`})}),Math.abs(t)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(t){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((e,n)=>{e.ondblclick=t?i=>this.onSplitterDblClick(i,n):void 0})}},beforeUnmount(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.$emit("ready"),this.ready=!0},render(){return On("div",{ref:"container",class:["splitpanes",`splitpanes--${this.horizontal?"horizontal":"vertical"}`,{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())}},Ta=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n},Ra={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:null},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeUnmount(){this.onPaneRemove(this)},methods:{update(t){this.style=t}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(t){this.requestUpdate({target:this,size:t})},minSizeNumber(t){this.requestUpdate({target:this,min:t})},maxSizeNumber(t){this.requestUpdate({target:this,max:t})}}};function Da(t,e,n,i,s,r){return k(),A("div",{class:"splitpanes__pane",onClick:e[0]||(e[0]=o=>r.onPaneClick(o,t._.uid)),style:at(t.style)},[Tn(t.$slots,"default")],4)}const Aa=Ta(Ra,[["render",Da]]);var Pa=Object.defineProperty,Va=(t,e,n)=>e in t?Pa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ma=(t,e,n)=>Va(t,e+"",n);function Fs(t,e){return function(){return t.apply(e,arguments)}}const{toString:Ua}=Object.prototype,{getPrototypeOf:en}=Object,vt=(t=>e=>{const n=Ua.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),de=t=>(t=t.toLowerCase(),e=>vt(e)===t),St=t=>e=>typeof e===t,{isArray:Ue}=Array,Je=St("undefined");function Na(t){return t!==null&&!Je(t)&&t.constructor!==null&&!Je(t.constructor)&&ie(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const zs=de("ArrayBuffer");function Fa(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&zs(t.buffer),e}const za=St("string"),ie=St("function"),Is=St("number"),kt=t=>t!==null&&typeof t=="object",Ia=t=>t===!0||t===!1,xt=t=>{if(vt(t)!=="object")return!1;const e=en(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},La=de("Date"),Ba=de("File"),qa=de("Blob"),ja=de("FileList"),Ha=t=>kt(t)&&ie(t.pipe),$a=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||ie(t.append)&&((e=vt(t))==="formdata"||e==="object"&&ie(t.toString)&&t.toString()==="[object FormData]"))},Wa=de("URLSearchParams"),[Ga,Ja,Ya,Ka]=["ReadableStream","Request","Response","Headers"].map(de),Xa=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ye(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let i,s;if(typeof t!="object"&&(t=[t]),Ue(t))for(i=0,s=t.length;i<s;i++)e.call(null,t[i],i,t);else{const r=n?Object.getOwnPropertyNames(t):Object.keys(t),o=r.length;let l;for(i=0;i<o;i++)l=r[i],e.call(null,t[l],l,t)}}function Ls(t,e){e=e.toLowerCase();const n=Object.keys(t);let i=n.length,s;for(;i-- >0;)if(s=n[i],e===s.toLowerCase())return s;return null}const Oe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Bs=t=>!Je(t)&&t!==Oe;function tn(){const{caseless:t}=Bs(this)&&this||{},e={},n=(i,s)=>{const r=t&&Ls(e,s)||s;xt(e[r])&&xt(i)?e[r]=tn(e[r],i):xt(i)?e[r]=tn({},i):Ue(i)?e[r]=i.slice():e[r]=i};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&Ye(arguments[i],n);return e}const Za=(t,e,n,{allOwnKeys:i}={})=>(Ye(e,(s,r)=>{n&&ie(s)?t[r]=Fs(s,n):t[r]=s},{allOwnKeys:i}),t),Qa=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),el=(t,e,n,i)=>{t.prototype=Object.create(e.prototype,i),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},tl=(t,e,n,i)=>{let s,r,o;const l={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),r=s.length;r-- >0;)o=s[r],(!i||i(o,t,e))&&!l[o]&&(e[o]=t[o],l[o]=!0);t=n!==!1&&en(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},nl=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const i=t.indexOf(e,n);return i!==-1&&i===n},sl=t=>{if(!t)return null;if(Ue(t))return t;let e=t.length;if(!Is(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},il=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&en(Uint8Array)),rl=(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=n.next())&&!i.done;){const s=i.value;e.call(t,s[0],s[1])}},ol=(t,e)=>{let n;const i=[];for(;(n=t.exec(e))!==null;)i.push(n);return i},al=de("HTMLFormElement"),ll=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,n,i){return n.toUpperCase()+i}),qs=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),cl=de("RegExp"),js=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),i={};Ye(n,(s,r)=>{let o;(o=e(s,r,t))!==!1&&(i[r]=o||s)}),Object.defineProperties(t,i)},ul=t=>{js(t,(e,n)=>{if(ie(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=t[n];if(ie(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},dl=(t,e)=>{const n={},i=s=>{s.forEach(r=>{n[r]=!0})};return Ue(t)?i(t):i(String(t).split(e)),n},pl=()=>{},hl=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,nn="abcdefghijklmnopqrstuvwxyz",Hs="0123456789",$s={DIGIT:Hs,ALPHA:nn,ALPHA_DIGIT:nn+nn.toUpperCase()+Hs},ml=(t=16,e=$s.ALPHA_DIGIT)=>{let n="";const{length:i}=e;for(;t--;)n+=e[Math.random()*i|0];return n};function fl(t){return!!(t&&ie(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const gl=t=>{const e=new Array(10),n=(i,s)=>{if(kt(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[s]=i;const r=Ue(i)?[]:{};return Ye(i,(o,l)=>{const u=n(o,s+1);!Je(u)&&(r[l]=u)}),e[s]=void 0,r}}return i};return n(t,0)},bl=de("AsyncFunction"),yl=t=>t&&(kt(t)||ie(t))&&ie(t.then)&&ie(t.catch),Ws=((t,e)=>t?setImmediate:e?((n,i)=>(Oe.addEventListener("message",({source:s,data:r})=>{s===Oe&&r===n&&i.length&&i.shift()()},!1),s=>{i.push(s),Oe.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ie(Oe.postMessage)),wl=typeof queueMicrotask<"u"?queueMicrotask.bind(Oe):typeof process<"u"&&process.nextTick||Ws,_={isArray:Ue,isArrayBuffer:zs,isBuffer:Na,isFormData:$a,isArrayBufferView:Fa,isString:za,isNumber:Is,isBoolean:Ia,isObject:kt,isPlainObject:xt,isReadableStream:Ga,isRequest:Ja,isResponse:Ya,isHeaders:Ka,isUndefined:Je,isDate:La,isFile:Ba,isBlob:qa,isRegExp:cl,isFunction:ie,isStream:Ha,isURLSearchParams:Wa,isTypedArray:il,isFileList:ja,forEach:Ye,merge:tn,extend:Za,trim:Xa,stripBOM:Qa,inherits:el,toFlatObject:tl,kindOf:vt,kindOfTest:de,endsWith:nl,toArray:sl,forEachEntry:rl,matchAll:ol,isHTMLForm:al,hasOwnProperty:qs,hasOwnProp:qs,reduceDescriptors:js,freezeMethods:ul,toObjectSet:dl,toCamelCase:ll,noop:pl,toFiniteNumber:hl,findKey:Ls,global:Oe,isContextDefined:Bs,ALPHABET:$s,generateString:ml,isSpecCompliantForm:fl,toJSONObject:gl,isAsyncFn:bl,isThenable:yl,setImmediate:Ws,asap:wl};function U(t,e,n,i,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),i&&(this.request=i),s&&(this.response=s,this.status=s.status?s.status:null)}_.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:_.toJSONObject(this.config),code:this.code,status:this.status}}});const Gs=U.prototype,Js={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Js[t]={value:t}}),Object.defineProperties(U,Js),Object.defineProperty(Gs,"isAxiosError",{value:!0}),U.from=(t,e,n,i,s,r)=>{const o=Object.create(Gs);return _.toFlatObject(t,o,function(l){return l!==Error.prototype},l=>l!=="isAxiosError"),U.call(o,t.message,e,n,i,s),o.cause=t,o.name=t.name,r&&Object.assign(o,r),o};const _l=null;function sn(t){return _.isPlainObject(t)||_.isArray(t)}function Ys(t){return _.endsWith(t,"[]")?t.slice(0,-2):t}function Ks(t,e,n){return t?t.concat(e).map(function(i,s){return i=Ys(i),!n&&s?"["+i+"]":i}).join(n?".":""):e}function vl(t){return _.isArray(t)&&!t.some(sn)}const Sl=_.toFlatObject(_,{},null,function(t){return/^is[A-Z]/.test(t)});function Et(t,e,n){if(!_.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=_.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,g){return!_.isUndefined(g[y])});const i=n.metaTokens,s=n.visitor||d,r=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&_.isSpecCompliantForm(e);if(!_.isFunction(s))throw new TypeError("visitor must be a function");function u(y){if(y===null)return"";if(_.isDate(y))return y.toISOString();if(!l&&_.isBlob(y))throw new U("Blob is not supported. Use a Buffer instead.");return _.isArrayBuffer(y)||_.isTypedArray(y)?l&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function d(y,g,f){let S=y;if(y&&!f&&typeof y=="object"){if(_.endsWith(g,"{}"))g=i?g:g.slice(0,-2),y=JSON.stringify(y);else if(_.isArray(y)&&vl(y)||(_.isFileList(y)||_.endsWith(g,"[]"))&&(S=_.toArray(y)))return g=Ys(g),S.forEach(function(T,O){!(_.isUndefined(T)||T===null)&&e.append(o===!0?Ks([g],O,r):o===null?g:g+"[]",u(T))}),!1}return sn(y)?!0:(e.append(Ks(f,g,r),u(y)),!1)}const p=[],m=Object.assign(Sl,{defaultVisitor:d,convertValue:u,isVisitable:sn});function b(y,g){if(!_.isUndefined(y)){if(p.indexOf(y)!==-1)throw Error("Circular reference detected in "+g.join("."));p.push(y),_.forEach(y,function(f,S){(!(_.isUndefined(f)||f===null)&&s.call(e,f,_.isString(S)?S.trim():S,g,m))===!0&&b(f,g?g.concat(S):[S])}),p.pop()}}if(!_.isObject(t))throw new TypeError("data must be an object");return b(t),e}function Xs(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function rn(t,e){this._pairs=[],t&&Et(t,this,e)}const Zs=rn.prototype;Zs.append=function(t,e){this._pairs.push([t,e])},Zs.toString=function(t){const e=t?function(n){return t.call(this,n,Xs)}:Xs;return this._pairs.map(function(n){return e(n[0])+"="+e(n[1])},"").join("&")};function kl(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Qs(t,e,n){if(!e)return t;const i=n&&n.encode||kl;_.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let r;if(s?r=s(e,n):r=_.isURLSearchParams(e)?e.toString():new rn(e,n).toString(i),r){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+r}return t}class ei{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){_.forEach(this.handlers,function(n){n!==null&&e(n)})}}const ti={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},xl=typeof URLSearchParams<"u"?URLSearchParams:rn,El=typeof FormData<"u"?FormData:null,Cl=typeof Blob<"u"?Blob:null,Ol={isBrowser:!0,classes:{URLSearchParams:xl,FormData:El,Blob:Cl},protocols:["http","https","file","blob","url","data"]},on=typeof window<"u"&&typeof document<"u",an=typeof navigator=="object"&&navigator||void 0,Tl=on&&(!an||["ReactNative","NativeScript","NS"].indexOf(an.product)<0),Rl=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Dl=on&&window.location.href||"http://localhost",Al=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:on,hasStandardBrowserEnv:Tl,hasStandardBrowserWebWorkerEnv:Rl,navigator:an,origin:Dl},Symbol.toStringTag,{value:"Module"})),X={...Al,...Ol};function Pl(t,e){return Et(t,new X.classes.URLSearchParams,Object.assign({visitor:function(n,i,s,r){return X.isNode&&_.isBuffer(n)?(this.append(i,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}function Vl(t){return _.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Ml(t){const e={},n=Object.keys(t);let i;const s=n.length;let r;for(i=0;i<s;i++)r=n[i],e[r]=t[r];return e}function ni(t){function e(n,i,s,r){let o=n[r++];if(o==="__proto__")return!0;const l=Number.isFinite(+o),u=r>=n.length;return o=!o&&_.isArray(s)?s.length:o,u?(_.hasOwnProp(s,o)?s[o]=[s[o],i]:s[o]=i,!l):((!s[o]||!_.isObject(s[o]))&&(s[o]=[]),e(n,i,s[o],r)&&_.isArray(s[o])&&(s[o]=Ml(s[o])),!l)}if(_.isFormData(t)&&_.isFunction(t.entries)){const n={};return _.forEachEntry(t,(i,s)=>{e(Vl(i),s,n,0)}),n}return null}function Ul(t,e,n){if(_.isString(t))try{return(e||JSON.parse)(t),_.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(0,JSON.stringify)(t)}const Ke={transitional:ti,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",i=n.indexOf("application/json")>-1,s=_.isObject(t);if(s&&_.isHTMLForm(t)&&(t=new FormData(t)),_.isFormData(t))return i?JSON.stringify(ni(t)):t;if(_.isArrayBuffer(t)||_.isBuffer(t)||_.isStream(t)||_.isFile(t)||_.isBlob(t)||_.isReadableStream(t))return t;if(_.isArrayBufferView(t))return t.buffer;if(_.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let r;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Pl(t,this.formSerializer).toString();if((r=_.isFileList(t))||n.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return Et(r?{"files[]":t}:t,o&&new o,this.formSerializer)}}return s||i?(e.setContentType("application/json",!1),Ul(t)):t}],transformResponse:[function(t){const e=this.transitional||Ke.transitional,n=e&&e.forcedJSONParsing,i=this.responseType==="json";if(_.isResponse(t)||_.isReadableStream(t))return t;if(t&&_.isString(t)&&(n&&!this.responseType||i)){const s=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(r){if(s)throw r.name==="SyntaxError"?U.from(r,U.ERR_BAD_RESPONSE,this,null,this.response):r}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:X.classes.FormData,Blob:X.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};_.forEach(["delete","get","head","post","put","patch"],t=>{Ke.headers[t]={}});const Nl=_.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Fl=t=>{const e={};let n,i,s;return t&&t.split(`
|
8
|
+
`).forEach(function(r){s=r.indexOf(":"),n=r.substring(0,s).trim().toLowerCase(),i=r.substring(s+1).trim(),!(!n||e[n]&&Nl[n])&&(n==="set-cookie"?e[n]?e[n].push(i):e[n]=[i]:e[n]=e[n]?e[n]+", "+i:i)}),e},si=Symbol("internals");function Xe(t){return t&&String(t).trim().toLowerCase()}function Ct(t){return t===!1||t==null?t:_.isArray(t)?t.map(Ct):String(t)}function zl(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(t);)e[i[1]]=i[2];return e}const Il=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ln(t,e,n,i,s){if(_.isFunction(i))return i.call(this,e,n);if(s&&(e=n),!!_.isString(e)){if(_.isString(i))return e.indexOf(i)!==-1;if(_.isRegExp(i))return i.test(e)}}function Ll(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,i)=>n.toUpperCase()+i)}function Bl(t,e){const n=_.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(t,i+n,{value:function(s,r,o){return this[i].call(this,e,s,r,o)},configurable:!0})})}class ee{constructor(e){e&&this.set(e)}set(e,n,i){const s=this;function r(l,u,d){const p=Xe(u);if(!p)throw new Error("header name must be a non-empty string");const m=_.findKey(s,p);(!m||s[m]===void 0||d===!0||d===void 0&&s[m]!==!1)&&(s[m||u]=Ct(l))}const o=(l,u)=>_.forEach(l,(d,p)=>r(d,p,u));if(_.isPlainObject(e)||e instanceof this.constructor)o(e,n);else if(_.isString(e)&&(e=e.trim())&&!Il(e))o(Fl(e),n);else if(_.isHeaders(e))for(const[l,u]of e.entries())r(u,l,i);else e!=null&&r(n,e,i);return this}get(e,n){if(e=Xe(e),e){const i=_.findKey(this,e);if(i){const s=this[i];if(!n)return s;if(n===!0)return zl(s);if(_.isFunction(n))return n.call(this,s,i);if(_.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Xe(e),e){const i=_.findKey(this,e);return!!(i&&this[i]!==void 0&&(!n||ln(this,this[i],i,n)))}return!1}delete(e,n){const i=this;let s=!1;function r(o){if(o=Xe(o),o){const l=_.findKey(i,o);l&&(!n||ln(i,i[l],l,n))&&(delete i[l],s=!0)}}return _.isArray(e)?e.forEach(r):r(e),s}clear(e){const n=Object.keys(this);let i=n.length,s=!1;for(;i--;){const r=n[i];(!e||ln(this,this[r],r,e,!0))&&(delete this[r],s=!0)}return s}normalize(e){const n=this,i={};return _.forEach(this,(s,r)=>{const o=_.findKey(i,r);if(o){n[o]=Ct(s),delete n[r];return}const l=e?Ll(r):String(r).trim();l!==r&&delete n[r],n[l]=Ct(s),i[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return _.forEach(this,(i,s)=>{i!=null&&i!==!1&&(n[s]=e&&_.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
9
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const i=new this(e);return n.forEach(s=>i.set(s)),i}static accessor(e){const n=(this[si]=this[si]={accessors:{}}).accessors,i=this.prototype;function s(r){const o=Xe(r);n[o]||(Bl(i,r),n[o]=!0)}return _.isArray(e)?e.forEach(s):s(e),this}}ee.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),_.reduceDescriptors(ee.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(i){this[n]=i}}}),_.freezeMethods(ee);function cn(t,e){const n=this||Ke,i=e||n,s=ee.from(i.headers);let r=i.data;return _.forEach(t,function(o){r=o.call(n,r,s.normalize(),e?e.status:void 0)}),s.normalize(),r}function ii(t){return!!(t&&t.__CANCEL__)}function Ne(t,e,n){U.call(this,t??"canceled",U.ERR_CANCELED,e,n),this.name="CanceledError"}_.inherits(Ne,U,{__CANCEL__:!0});function ri(t,e,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?t(n):e(new U("Request failed with status code "+n.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function ql(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function jl(t,e){t=t||10;const n=new Array(t),i=new Array(t);let s=0,r=0,o;return e=e!==void 0?e:1e3,function(l){const u=Date.now(),d=i[r];o||(o=u),n[s]=l,i[s]=u;let p=r,m=0;for(;p!==s;)m+=n[p++],p=p%t;if(s=(s+1)%t,s===r&&(r=(r+1)%t),u-o<e)return;const b=d&&u-d;return b?Math.round(m*1e3/b):void 0}}function Hl(t,e){let n=0,i=1e3/e,s,r;const o=(l,u=Date.now())=>{n=u,s=null,r&&(clearTimeout(r),r=null),t.apply(null,l)};return[(...l)=>{const u=Date.now(),d=u-n;d>=i?o(l,u):(s=l,r||(r=setTimeout(()=>{r=null,o(s)},i-d)))},()=>s&&o(s)]}const Ot=(t,e,n=3)=>{let i=0;const s=jl(50,250);return Hl(r=>{const o=r.loaded,l=r.lengthComputable?r.total:void 0,u=o-i,d=s(u),p=o<=l;i=o;const m={loaded:o,total:l,progress:l?o/l:void 0,bytes:u,rate:d||void 0,estimated:d&&l&&p?(l-o)/d:void 0,event:r,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(m)},n)},oi=(t,e)=>{const n=t!=null;return[i=>e[0]({lengthComputable:n,total:t,loaded:i}),e[1]]},ai=t=>(...e)=>_.asap(()=>t(...e)),$l=X.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,X.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(X.origin),X.navigator&&/(msie|trident)/i.test(X.navigator.userAgent)):()=>!0,Wl=X.hasStandardBrowserEnv?{write(t,e,n,i,s,r){const o=[t+"="+encodeURIComponent(e)];_.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),_.isString(i)&&o.push("path="+i),_.isString(s)&&o.push("domain="+s),r===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Gl(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Jl(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function li(t,e){return t&&!Gl(e)?Jl(t,e):e}const ci=t=>t instanceof ee?{...t}:t;function Te(t,e){e=e||{};const n={};function i(d,p,m,b){return _.isPlainObject(d)&&_.isPlainObject(p)?_.merge.call({caseless:b},d,p):_.isPlainObject(p)?_.merge({},p):_.isArray(p)?p.slice():p}function s(d,p,m,b){if(_.isUndefined(p)){if(!_.isUndefined(d))return i(void 0,d,m,b)}else return i(d,p,m,b)}function r(d,p){if(!_.isUndefined(p))return i(void 0,p)}function o(d,p){if(_.isUndefined(p)){if(!_.isUndefined(d))return i(void 0,d)}else return i(void 0,p)}function l(d,p,m){if(m in e)return i(d,p);if(m in t)return i(void 0,d)}const u={url:r,method:r,data:r,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(d,p,m)=>s(ci(d),ci(p),m,!0)};return _.forEach(Object.keys(Object.assign({},t,e)),function(d){const p=u[d]||s,m=p(t[d],e[d],d);_.isUndefined(m)&&p!==l||(n[d]=m)}),n}const ui=t=>{const e=Te({},t);let{data:n,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:r,headers:o,auth:l}=e;e.headers=o=ee.from(o),e.url=Qs(li(e.baseURL,e.url),t.params,t.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let u;if(_.isFormData(n)){if(X.hasStandardBrowserEnv||X.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((u=o.getContentType())!==!1){const[d,...p]=u?u.split(";").map(m=>m.trim()).filter(Boolean):[];o.setContentType([d||"multipart/form-data",...p].join("; "))}}if(X.hasStandardBrowserEnv&&(i&&_.isFunction(i)&&(i=i(e)),i||i!==!1&&$l(e.url))){const d=s&&r&&Wl.read(r);d&&o.set(s,d)}return e},Yl=typeof XMLHttpRequest<"u",Kl=Yl&&function(t){return new Promise(function(e,n){const i=ui(t);let s=i.data;const r=ee.from(i.headers).normalize();let{responseType:o,onUploadProgress:l,onDownloadProgress:u}=i,d,p,m,b,y;function g(){b&&b(),y&&y(),i.cancelToken&&i.cancelToken.unsubscribe(d),i.signal&&i.signal.removeEventListener("abort",d)}let f=new XMLHttpRequest;f.open(i.method.toUpperCase(),i.url,!0),f.timeout=i.timeout;function S(){if(!f)return;const O=ee.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),D={data:!o||o==="text"||o==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:O,config:t,request:f};ri(function(B){e(B),g()},function(B){n(B),g()},D),f=null}"onloadend"in f?f.onloadend=S:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(S)},f.onabort=function(){f&&(n(new U("Request aborted",U.ECONNABORTED,t,f)),f=null)},f.onerror=function(){n(new U("Network Error",U.ERR_NETWORK,t,f)),f=null},f.ontimeout=function(){let O=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const D=i.transitional||ti;i.timeoutErrorMessage&&(O=i.timeoutErrorMessage),n(new U(O,D.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,t,f)),f=null},s===void 0&&r.setContentType(null),"setRequestHeader"in f&&_.forEach(r.toJSON(),function(O,D){f.setRequestHeader(D,O)}),_.isUndefined(i.withCredentials)||(f.withCredentials=!!i.withCredentials),o&&o!=="json"&&(f.responseType=i.responseType),u&&([m,y]=Ot(u,!0),f.addEventListener("progress",m)),l&&f.upload&&([p,b]=Ot(l),f.upload.addEventListener("progress",p),f.upload.addEventListener("loadend",b)),(i.cancelToken||i.signal)&&(d=O=>{f&&(n(!O||O.type?new Ne(null,t,f):O),f.abort(),f=null)},i.cancelToken&&i.cancelToken.subscribe(d),i.signal&&(i.signal.aborted?d():i.signal.addEventListener("abort",d)));const T=ql(i.url);if(T&&X.protocols.indexOf(T)===-1){n(new U("Unsupported protocol "+T+":",U.ERR_BAD_REQUEST,t));return}f.send(s||null)})},Xl=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let i=new AbortController,s;const r=function(d){if(!s){s=!0,l();const p=d instanceof Error?d:this.reason;i.abort(p instanceof U?p:new Ne(p instanceof Error?p.message:p))}};let o=e&&setTimeout(()=>{o=null,r(new U(`timeout ${e} of ms exceeded`,U.ETIMEDOUT))},e);const l=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(d=>{d.unsubscribe?d.unsubscribe(r):d.removeEventListener("abort",r)}),t=null)};t.forEach(d=>d.addEventListener("abort",r));const{signal:u}=i;return u.unsubscribe=()=>_.asap(l),u}},Zl=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let i=0,s;for(;i<n;)s=i+e,yield t.slice(i,s),i=s},Ql=async function*(t,e){for await(const n of ec(t))yield*Zl(n,e)},ec=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:i}=await e.read();if(n)break;yield i}}finally{await e.cancel()}},di=(t,e,n,i)=>{const s=Ql(t,e);let r=0,o,l=u=>{o||(o=!0,i&&i(u))};return new ReadableStream({async pull(u){try{const{done:d,value:p}=await s.next();if(d){l(),u.close();return}let m=p.byteLength;if(n){let b=r+=m;n(b)}u.enqueue(new Uint8Array(p))}catch(d){throw l(d),d}},cancel(u){return l(u),s.return()}},{highWaterMark:2})},Tt=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",pi=Tt&&typeof ReadableStream=="function",tc=Tt&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),hi=(t,...e)=>{try{return!!t(...e)}catch{return!1}},nc=pi&&hi(()=>{let t=!1;const e=new Request(X.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),mi=64*1024,un=pi&&hi(()=>_.isReadableStream(new Response("").body)),Rt={stream:un&&(t=>t.body)};Tt&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Rt[e]&&(Rt[e]=_.isFunction(t[e])?n=>n[e]():(n,i)=>{throw new U(`Response type '${e}' is not supported`,U.ERR_NOT_SUPPORT,i)})})})(new Response);const sc=async t=>{if(t==null)return 0;if(_.isBlob(t))return t.size;if(_.isSpecCompliantForm(t))return(await new Request(X.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(_.isArrayBufferView(t)||_.isArrayBuffer(t))return t.byteLength;if(_.isURLSearchParams(t)&&(t=t+""),_.isString(t))return(await tc(t)).byteLength},ic=async(t,e)=>_.toFiniteNumber(t.getContentLength())??sc(e),rc=Tt&&(async t=>{let{url:e,method:n,data:i,signal:s,cancelToken:r,timeout:o,onDownloadProgress:l,onUploadProgress:u,responseType:d,headers:p,withCredentials:m="same-origin",fetchOptions:b}=ui(t);d=d?(d+"").toLowerCase():"text";let y=Xl([s,r&&r.toAbortSignal()],o),g;const f=y&&y.unsubscribe&&(()=>{y.unsubscribe()});let S;try{if(u&&nc&&n!=="get"&&n!=="head"&&(S=await ic(p,i))!==0){let E=new Request(e,{method:"POST",body:i,duplex:"half"}),R;if(_.isFormData(i)&&(R=E.headers.get("content-type"))&&p.setContentType(R),E.body){const[L,Z]=oi(S,Ot(ai(u)));i=di(E.body,mi,L,Z)}}_.isString(m)||(m=m?"include":"omit");const T="credentials"in Request.prototype;g=new Request(e,{...b,signal:y,method:n.toUpperCase(),headers:p.normalize().toJSON(),body:i,duplex:"half",credentials:T?m:void 0});let O=await fetch(g);const D=un&&(d==="stream"||d==="response");if(un&&(l||D&&f)){const E={};["status","statusText","headers"].forEach(_e=>{E[_e]=O[_e]});const R=_.toFiniteNumber(O.headers.get("content-length")),[L,Z]=l&&oi(R,Ot(ai(l),!0))||[];O=new Response(di(O.body,mi,L,()=>{Z&&Z(),f&&f()}),E)}d=d||"text";let B=await Rt[_.findKey(Rt,d)||"text"](O,t);return!D&&f&&f(),await new Promise((E,R)=>{ri(E,R,{data:B,headers:ee.from(O.headers),status:O.status,statusText:O.statusText,config:t,request:g})})}catch(T){throw f&&f(),T&&T.name==="TypeError"&&/fetch/i.test(T.message)?Object.assign(new U("Network Error",U.ERR_NETWORK,t,g),{cause:T.cause||T}):U.from(T,T&&T.code,t,g)}}),dn={http:_l,xhr:Kl,fetch:rc};_.forEach(dn,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const fi=t=>`- ${t}`,oc=t=>_.isFunction(t)||t===null||t===!1,gi={getAdapter:t=>{t=_.isArray(t)?t:[t];const{length:e}=t;let n,i;const s={};for(let r=0;r<e;r++){n=t[r];let o;if(i=n,!oc(n)&&(i=dn[(o=String(n)).toLowerCase()],i===void 0))throw new U(`Unknown adapter '${o}'`);if(i)break;s[o||"#"+r]=i}if(!i){const r=Object.entries(s).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=e?r.length>1?`since :
|
10
|
+
`+r.map(fi).join(`
|
11
|
+
`):" "+fi(r[0]):"as no adapter specified";throw new U("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i},adapters:dn};function pn(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ne(null,t)}function bi(t){return pn(t),t.headers=ee.from(t.headers),t.data=cn.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),gi.getAdapter(t.adapter||Ke.adapter)(t).then(function(e){return pn(t),e.data=cn.call(t,t.transformResponse,e),e.headers=ee.from(e.headers),e},function(e){return ii(e)||(pn(t),e&&e.response&&(e.response.data=cn.call(t,t.transformResponse,e.response),e.response.headers=ee.from(e.response.headers))),Promise.reject(e)})}const yi="1.7.9",Dt={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Dt[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const wi={};Dt.transitional=function(t,e,n){function i(s,r){return"[Axios v"+yi+"] Transitional option '"+s+"'"+r+(n?". "+n:"")}return(s,r,o)=>{if(t===!1)throw new U(i(r," has been removed"+(e?" in "+e:"")),U.ERR_DEPRECATED);return e&&!wi[r]&&(wi[r]=!0,console.warn(i(r," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(s,r,o):!0}},Dt.spelling=function(t){return(e,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function ac(t,e,n){if(typeof t!="object")throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);const i=Object.keys(t);let s=i.length;for(;s-- >0;){const r=i[s],o=e[r];if(o){const l=t[r],u=l===void 0||o(l,r,t);if(u!==!0)throw new U("option "+r+" must be "+u,U.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new U("Unknown option "+r,U.ERR_BAD_OPTION)}}const At={assertOptions:ac,validators:Dt},me=At.validators;class Re{constructor(e){this.defaults=e,this.interceptors={request:new ei,response:new ei}}async request(e,n){try{return await this._request(e,n)}catch(i){if(i instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const r=s.stack?s.stack.replace(/^.+\n/,""):"";try{i.stack?r&&!String(i.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(i.stack+=`
|
12
|
+
`+r):i.stack=r}catch{}}throw i}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Te(this.defaults,n);const{transitional:i,paramsSerializer:s,headers:r}=n;i!==void 0&&At.assertOptions(i,{silentJSONParsing:me.transitional(me.boolean),forcedJSONParsing:me.transitional(me.boolean),clarifyTimeoutError:me.transitional(me.boolean)},!1),s!=null&&(_.isFunction(s)?n.paramsSerializer={serialize:s}:At.assertOptions(s,{encode:me.function,serialize:me.function},!0)),At.assertOptions(n,{baseUrl:me.spelling("baseURL"),withXsrfToken:me.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=r&&_.merge(r.common,r[n.method]);r&&_.forEach(["delete","get","head","post","put","patch","common"],g=>{delete r[g]}),n.headers=ee.concat(o,r);const l=[];let u=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(u=u&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const d=[];this.interceptors.response.forEach(function(g){d.push(g.fulfilled,g.rejected)});let p,m=0,b;if(!u){const g=[bi.bind(this),void 0];for(g.unshift.apply(g,l),g.push.apply(g,d),b=g.length,p=Promise.resolve(n);m<b;)p=p.then(g[m++],g[m++]);return p}b=l.length;let y=n;for(m=0;m<b;){const g=l[m++],f=l[m++];try{y=g(y)}catch(S){f.call(this,S);break}}try{p=bi.call(this,y)}catch(g){return Promise.reject(g)}for(m=0,b=d.length;m<b;)p=p.then(d[m++],d[m++]);return p}getUri(e){e=Te(this.defaults,e);const n=li(e.baseURL,e.url);return Qs(n,e.params,e.paramsSerializer)}}_.forEach(["delete","get","head","options"],function(t){Re.prototype[t]=function(e,n){return this.request(Te(n||{},{method:t,url:e,data:(n||{}).data}))}}),_.forEach(["post","put","patch"],function(t){function e(n){return function(i,s,r){return this.request(Te(r||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}Re.prototype[t]=e(),Re.prototype[t+"Form"]=e(!0)});class hn{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const i=this;this.promise.then(s=>{if(!i._listeners)return;let r=i._listeners.length;for(;r-- >0;)i._listeners[r](s);i._listeners=null}),this.promise.then=s=>{let r;const o=new Promise(l=>{i.subscribe(l),r=l}).then(s);return o.cancel=function(){i.unsubscribe(r)},o},e(function(s,r,o){i.reason||(i.reason=new Ne(s,r,o),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=i=>{e.abort(i)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new hn(function(n){e=n}),cancel:e}}}function lc(t){return function(e){return t.apply(null,e)}}function cc(t){return _.isObject(t)&&t.isAxiosError===!0}const mn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(mn).forEach(([t,e])=>{mn[e]=t});function _i(t){const e=new Re(t),n=Fs(Re.prototype.request,e);return _.extend(n,Re.prototype,e,{allOwnKeys:!0}),_.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return _i(Te(t,i))},n}const W=_i(Ke);W.Axios=Re,W.CanceledError=Ne,W.CancelToken=hn,W.isCancel=ii,W.VERSION=yi,W.toFormData=Et,W.AxiosError=U,W.Cancel=W.CanceledError,W.all=function(t){return Promise.all(t)},W.spread=lc,W.isAxiosError=cc,W.mergeConfig=Te,W.AxiosHeaders=ee,W.formToJSON=t=>ni(_.isHTMLForm(t)?new FormData(t):t),W.getAdapter=gi.getAdapter,W.HttpStatusCode=mn,W.default=W;const fn=W.create({baseURL:location.origin,timeout:6e4,params:{}});fn.interceptors.response.use(t=>t,t=>{var e,n,i,s,r,o,l,u,d,p,m;if(t.response){if(t.response.status===401&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(g){g&&OpenC3Auth.setTokens()}),t.response.config.headers["Ignore-Errors"]&&t.response.config.headers["Ignore-Errors"].includes(t.response.status.toString()))return Promise.reject(t);let b=`HTTP ${t.response.status} - `;(e=t.response)!=null&&e.statusText&&(b+=`${t.response.statusText} `),(i=(n=t.response)==null?void 0:n.config)!=null&&i.data&&(b+=`${t.response.config.data} `),(r=(s=t.response)==null?void 0:s.data)!=null&&r.message?b+=`${t.response.data.message}`:(l=(o=t.response)==null?void 0:o.data)!=null&&l.exception?b+=`${t.response.data.exception}`:(p=(d=(u=t.response)==null?void 0:u.data)==null?void 0:d.error)!=null&&p.message?(t.response.data.error.class&&(b+=`${t.response.data.error.class} `),b+=`${t.response.data.error.message}`):b+=`${(m=t.response)==null?void 0:m.data}`;const{$cosmosNotify:y}=window;throw y&&y.serious({title:"Network error",body:b}),t}else throw t});const Pt=async function(t,e,{data:n,params:i={},headers:s,noAuth:r=!1,noScope:o=!1,onUploadProgress:l=!1}={}){if(!r){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch{OpenC3Auth.login()}s.Authorization=localStorage.openc3Token}return s.manual=!0,!o&&!i.scope&&(i.scope=window.openc3Scope),fn({method:t,url:e,data:n,params:i,headers:s,onUploadProgress:l})},gn={Accept:"application/json"},vi={...gn,"Content-Type":"application/json"},N={get:function(t,{params:e,headers:n=gn,noScope:i,noAuth:s,onUploadProgress:r}={}){return Pt("get",t,{params:e,headers:n,noScope:i,noAuth:s,onUploadProgress:r})},put:function(t,{data:e,params:n,headers:i=vi,noScope:s,noAuth:r,onUploadProgress:o}={}){return Pt("put",t,{data:e,params:n,headers:i,noScope:s,noAuth:r,onUploadProgress:o})},post:function(t,{data:e,params:n,headers:i=vi,noScope:s,noAuth:r,onUploadProgress:o}={}){return Pt("post",t,{data:e,params:n,headers:i,noScope:s,noAuth:r,onUploadProgress:o})},delete:function(t,{params:e,headers:n=gn,noScope:i,noAuth:s,onUploadProgress:r}={}){return Pt("delete",t,{params:e,headers:n,noScope:i,noAuth:s,onUploadProgress:r})}};var Vt={logger:typeof console<"u"?console:void 0,WebSocket:typeof WebSocket<"u"?WebSocket:void 0},j={log(...t){this.enabled&&(t.push(Date.now()),Vt.logger.log("[ActionCable]",...t))}};const Ze=()=>new Date().getTime(),Mt=t=>(Ze()-t)/1e3;class Ut{constructor(e){this.visibilityDidChange=this.visibilityDidChange.bind(this),this.connection=e,this.reconnectAttempts=0}start(){this.isRunning()||(this.startedAt=Ze(),delete this.stoppedAt,this.startPolling(),addEventListener("visibilitychange",this.visibilityDidChange),j.log(`ConnectionMonitor started. stale threshold = ${this.constructor.staleThreshold} s`))}stop(){this.isRunning()&&(this.stoppedAt=Ze(),this.stopPolling(),removeEventListener("visibilitychange",this.visibilityDidChange),j.log("ConnectionMonitor stopped"))}isRunning(){return this.startedAt&&!this.stoppedAt}recordPing(){this.pingedAt=Ze()}recordConnect(){this.reconnectAttempts=0,this.recordPing(),delete this.disconnectedAt,j.log("ConnectionMonitor recorded connect")}recordDisconnect(){this.disconnectedAt=Ze(),j.log("ConnectionMonitor recorded disconnect")}startPolling(){this.stopPolling(),this.poll()}stopPolling(){clearTimeout(this.pollTimeout)}poll(){this.pollTimeout=setTimeout(()=>{this.reconnectIfStale(),this.poll()},this.getPollInterval())}getPollInterval(){const{staleThreshold:e,reconnectionBackoffRate:n}=this.constructor,i=Math.pow(1+n,Math.min(this.reconnectAttempts,10)),s=(this.reconnectAttempts===0?1:n)*Math.random();return e*1e3*i*(1+s)}reconnectIfStale(){this.connectionIsStale()&&(j.log(`ConnectionMonitor detected stale connection. reconnectAttempts = ${this.reconnectAttempts}, time stale = ${Mt(this.refreshedAt)} s, stale threshold = ${this.constructor.staleThreshold} s`),this.reconnectAttempts++,this.disconnectedRecently()?j.log(`ConnectionMonitor skipping reopening recent disconnect. time disconnected = ${Mt(this.disconnectedAt)} s`):(j.log("ConnectionMonitor reopening"),this.connection.reopen()))}get refreshedAt(){return this.pingedAt?this.pingedAt:this.startedAt}connectionIsStale(){return Mt(this.refreshedAt)>this.constructor.staleThreshold}disconnectedRecently(){return this.disconnectedAt&&Mt(this.disconnectedAt)<this.constructor.staleThreshold}visibilityDidChange(){document.visibilityState==="visible"&&setTimeout(()=>{(this.connectionIsStale()||!this.connection.isOpen())&&(j.log(`ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = ${document.visibilityState}`),this.connection.reopen())},200)}}Ut.staleThreshold=6,Ut.reconnectionBackoffRate=.15;var Si={message_types:{welcome:"welcome",disconnect:"disconnect",ping:"ping",confirmation:"confirm_subscription",rejection:"reject_subscription"},disconnect_reasons:{unauthorized:"unauthorized",invalid_request:"invalid_request",server_restart:"server_restart",remote:"remote"},default_mount_path:"/cable",protocols:["actioncable-v1-json","actioncable-unsupported"]};const{message_types:Qe,protocols:bn}=Si,uc=bn.slice(0,bn.length-1),ki=[].indexOf;class yn{constructor(e){this.open=this.open.bind(this),this.consumer=e,this.subscriptions=this.consumer.subscriptions,this.monitor=new Ut(this),this.disconnected=!0}send(e){return this.isOpen()?(this.webSocket.send(JSON.stringify(e)),!0):!1}open(){if(this.isActive())return j.log(`Attempted to open WebSocket, but existing socket is ${this.getState()}`),!1;{const e=[...bn,...this.consumer.subprotocols||[]];return j.log(`Opening WebSocket, current state is ${this.getState()}, subprotocols: ${e}`),this.webSocket&&this.uninstallEventHandlers(),this.webSocket=new Vt.WebSocket(this.consumer.url,e),this.installEventHandlers(),this.monitor.start(),!0}}close({allowReconnect:e}={allowReconnect:!0}){if(e||this.monitor.stop(),this.isOpen())return this.webSocket.close()}reopen(){if(j.log(`Reopening WebSocket, current state is ${this.getState()}`),this.isActive())try{return this.close()}catch(e){j.log("Failed to reopen WebSocket",e)}finally{j.log(`Reopening WebSocket in ${this.constructor.reopenDelay}ms`),setTimeout(this.open,this.constructor.reopenDelay)}else return this.open()}getProtocol(){if(this.webSocket)return this.webSocket.protocol}isOpen(){return this.isState("open")}isActive(){return this.isState("open","connecting")}triedToReconnect(){return this.monitor.reconnectAttempts>0}isProtocolSupported(){return ki.call(uc,this.getProtocol())>=0}isState(...e){return ki.call(e,this.getState())>=0}getState(){if(this.webSocket){for(let e in Vt.WebSocket)if(Vt.WebSocket[e]===this.webSocket.readyState)return e.toLowerCase()}return null}installEventHandlers(){for(let e in this.events){const n=this.events[e].bind(this);this.webSocket[`on${e}`]=n}}uninstallEventHandlers(){for(let e in this.events)this.webSocket[`on${e}`]=function(){}}}yn.reopenDelay=500,yn.prototype.events={message(t){if(!this.isProtocolSupported())return;const{identifier:e,message:n,reason:i,reconnect:s,type:r}=JSON.parse(t.data);switch(r){case Qe.welcome:return this.triedToReconnect()&&(this.reconnectAttempted=!0),this.monitor.recordConnect(),this.subscriptions.reload();case Qe.disconnect:return j.log(`Disconnecting. Reason: ${i}`),this.close({allowReconnect:s});case Qe.ping:return this.monitor.recordPing();case Qe.confirmation:return this.subscriptions.confirmSubscription(e),this.reconnectAttempted?(this.reconnectAttempted=!1,this.subscriptions.notify(e,"connected",{reconnected:!0})):this.subscriptions.notify(e,"connected",{reconnected:!1});case Qe.rejection:return this.subscriptions.reject(e);default:return this.subscriptions.notify(e,"received",n)}},open(){if(j.log(`WebSocket onopen event, using '${this.getProtocol()}' subprotocol`),this.disconnected=!1,!this.isProtocolSupported())return j.log("Protocol is unsupported. Stopping monitor and disconnecting."),this.close({allowReconnect:!1})},close(t){if(j.log("WebSocket onclose event"),!this.disconnected)return this.disconnected=!0,this.monitor.recordDisconnect(),this.subscriptions.notifyAll("disconnected",{willAttemptReconnect:this.monitor.isRunning()})},error(){j.log("WebSocket onerror event")}};const dc=function(t,e){if(e!=null)for(let n in e){const i=e[n];t[n]=i}return t};class pc{constructor(e,n={},i){this.consumer=e,this.identifier=JSON.stringify(n),dc(this,i)}perform(e,n={}){return n.action=e,this.send(n)}send(e){return this.consumer.send({command:"message",identifier:this.identifier,data:JSON.stringify(e)})}unsubscribe(){return this.consumer.subscriptions.remove(this)}}class hc{constructor(e){this.subscriptions=e,this.pendingSubscriptions=[]}guarantee(e){this.pendingSubscriptions.indexOf(e)==-1?(j.log(`SubscriptionGuarantor guaranteeing ${e.identifier}`),this.pendingSubscriptions.push(e)):j.log(`SubscriptionGuarantor already guaranteeing ${e.identifier}`),this.startGuaranteeing()}forget(e){j.log(`SubscriptionGuarantor forgetting ${e.identifier}`),this.pendingSubscriptions=this.pendingSubscriptions.filter(n=>n!==e)}startGuaranteeing(){this.stopGuaranteeing(),this.retrySubscribing()}stopGuaranteeing(){clearTimeout(this.retryTimeout)}retrySubscribing(){this.retryTimeout=setTimeout(()=>{this.subscriptions&&typeof this.subscriptions.subscribe=="function"&&this.pendingSubscriptions.map(e=>{j.log(`SubscriptionGuarantor resubscribing ${e.identifier}`),this.subscriptions.subscribe(e)})},500)}}class mc{constructor(e){this.consumer=e,this.guarantor=new hc(this),this.subscriptions=[]}create(e,n){const i=e,s=typeof i=="object"?i:{channel:i},r=new pc(this.consumer,s,n);return this.add(r)}add(e){return this.subscriptions.push(e),this.consumer.ensureActiveConnection(),this.notify(e,"initialized"),this.subscribe(e),e}remove(e){return this.forget(e),this.findAll(e.identifier).length||this.sendCommand(e,"unsubscribe"),e}reject(e){return this.findAll(e).map(n=>(this.forget(n),this.notify(n,"rejected"),n))}forget(e){return this.guarantor.forget(e),this.subscriptions=this.subscriptions.filter(n=>n!==e),e}findAll(e){return this.subscriptions.filter(n=>n.identifier===e)}reload(){return this.subscriptions.map(e=>this.subscribe(e))}notifyAll(e,...n){return this.subscriptions.map(i=>this.notify(i,e,...n))}notify(e,n,...i){let s;return typeof e=="string"?s=this.findAll(e):s=[e],s.map(r=>typeof r[n]=="function"?r[n](...i):void 0)}subscribe(e){this.sendCommand(e,"subscribe")&&this.guarantor.guarantee(e)}confirmSubscription(e){j.log(`Subscription confirmed ${e}`),this.findAll(e).map(n=>this.guarantor.forget(n))}sendCommand(e,n){const{identifier:i}=e;return this.consumer.send({command:n,identifier:i})}}class fc{constructor(e){this._url=e,this.subscriptions=new mc(this),this.connection=new yn(this),this.subprotocols=[]}get url(){return gc(this._url)}send(e){return this.connection.send(e)}connect(){return this.connection.open()}disconnect(){return this.connection.close({allowReconnect:!1})}ensureActiveConnection(){if(!this.connection.isActive())return this.connection.open()}addSubProtocol(e){this.subprotocols=[...this.subprotocols,e]}}function gc(t){if(typeof t=="function"&&(t=t()),t&&!/^wss?:/i.test(t)){const e=document.createElement("a");return e.href=t,e.href=e.href,e.protocol=e.protocol.replace("http","ws"),e.href}else return t}function bc(t=yc("url")||Si.default_mount_path){return new fc(t)}function yc(t){const e=document.head.querySelector(`meta[name='action-cable-${t}']`);if(e)return e.getAttribute("content")}Ut.staleThreshold=10;class wc{constructor(e="/openc3-api/cable"){this._cable=null,this._url=e}disconnect(){this._cable&&this._cable.disconnect()}createSubscription(e,n,i={},s={}){return OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(r=>{if(r&&OpenC3Auth.setTokens(),this._cable==null){let o=this._url+"?scope="+encodeURIComponent(window.openc3Scope)+"&authorization="+encodeURIComponent(localStorage.openc3Token);this._cable=bc(o)}return this._cable.subscriptions.create({channel:e,...s},i)})}recordPing(){this._cable.connection.monitor.recordPing()}}class wn{constructor(){Ma(this,"id",1)}async exec(e,n,i={},s={},r=6e4){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch{OpenC3Auth.login()}this.id=this.id+1;try{return i.scope=window.openc3Scope,s.manual=!0,(await fn.post("/openc3-api/api",{jsonrpc:"2.0",method:e,params:n,id:this.id,keyword_params:i},{headers:{Authorization:localStorage.openc3Token,"Content-Type":"application/json-rpc",...s},timeout:r})).data.result}catch(o){let l=new Error;throw o.response?(l.name=o.response.data.error.data.class,l.message=o.response.data.error.data.message,l.object=o.response.data.error):o.request?(l.name="Request error",l.message="Request error, no response received"):l.name="Unknown error",l}}decode_openc3_type(e){if(e!==null&&typeof e=="object"&&e.json_class=="Float"&&e.raw){if(e.raw=="NaN")return NaN;if(e.raw=="Infinity")return 1/0;if(e.raw=="-Infinity")return-1/0}return null}encode_openc3_type(e){return Number.isNaN(e)?{json_class:"Float",raw:"NaN"}:e==Number.POSITIVE_INFINITY?{json_class:"Float",raw:"Infinity"}:e==Number.NEGATIVE_INFINITY?{json_class:"Float",raw:"-Infinity"}:null}ensure_offline_access(){this.offline_access_needed().then(e=>{e&&(localStorage.openc3OfflineToken?this.set_offline_access(localStorage.openc3OfflineToken).then(()=>{delete localStorage.openc3OfflineToken}):OpenC3Auth.getOfflineAccess())})}offline_access_needed(){return this.exec("offline_access_needed",[])}set_offline_access(e){return this.exec("set_offline_access",[e])}get_all_interface_info(){return this.exec("get_all_interface_info",[])}map_target_to_interface(e,n){return this.exec("map_target_to_interface",[e,n])}connect_interface(e,...n){return n.length>0?this.exec("connect_interface",[e,...n]):this.exec("connect_interface",[e])}disconnect_interface(e){return this.exec("disconnect_interface",[e])}interface_cmd(e,n,...i){return this.exec("interface_cmd",[e,n,...i])}get_all_router_info(){return this.exec("get_all_router_info",[])}connect_router(e){return this.exec("connect_router",[e])}disconnect_router(e){return this.exec("disconnect_router",[e])}get_target_interfaces(){return this.exec("get_target_interfaces",[])}get_tlm_cnts(e){return this.exec("get_tlm_cnts",[e])}get_item(e,n,i){return this.exec("get_item",[e,n,i])}get_param(e,n,i){return this.exec("get_param",[e,n,i])}get_parameter(e,n,i){return this.exec("get_param",[e,n,i])}get_limits_sets(){return this.exec("get_limits_sets",[])}get_limits_set(){return this.exec("get_limits_set",[])}set_limits_set(e){return this.exec("set_limits_set",[e])}get_target(e){return this.exec("get_target",[e])}get_target_names(){return this.exec("get_target_names",[])}get_target_list(){return this.exec("get_target_names",[])}get_tlm(e,n){return this.exec("get_tlm",[e,n])}get_telemetry(e,n){return this.exec("get_tlm",[e,n])}get_all_tlm(e){return this.exec("get_all_tlm",[e])}get_all_telemetry(e){return this.exec("get_all_tlm",[e])}get_all_tlm_names(e,n=!1){return this.exec("get_all_tlm_names",[e],{hidden:n})}get_all_telemetry_names(e){return this.exec("get_all_tlm_names",[e])}async get_tlm_packet(e,n,i,s=30){const r=await this.exec("get_tlm_packet",[e,n],{type:i,stale_time:s});if(r!=null){let o=r.length,l=null;for(let u=0;u<o;u++)l=this.decode_openc3_type(r[u][1]),l!==null&&(r[u][1]=l)}return r}get_packet_derived_items(e,n){return this.exec("get_packet_derived_items",[e,n])}get_tlm_buffer(e,n){return this.exec("get_tlm_buffer",[e,n])}async get_tlm_values(e,n=30,i=null){let s={stale_time:n};i!==null&&(s.cache_timeout=i);const r=await this.exec("get_tlm_values",[e],s,{},1e4);let o=r[0].length,l=null;for(let u=0;u<o;u++)l=this.decode_openc3_type(r[0][u]),l!==null&&(r[0][u]=l);return r}get_limits(e,n,i){return this.exec("get_limits",[e,n,i])}async tlm(e,n,i,s="CONVERTED"){let r=null;if(n===void 0)r=await this.exec("tlm",[e]);else if(i===void 0)if(["RAW","CONVERTED","FORMATTED","WITH_UNITS"].includes(n))r=await this.exec("tlm",[e],{type:n});else{let l=new Error;throw l.name="TypeError",l.message=`Invalid data type ${n}. Valid options are RAW, CONVERTED, FORMATTED, and WITH_UNITS.`,l}else r=await this.exec("tlm",[e,n,i],{type:s});let o=this.decode_openc3_type(r);return o!==null&&(r=o),r}async inject_tlm(e,n,i=null,s="CONVERTED"){data=await this.exec("inject_tlm",[e,n,i],{type:s})}set_tlm(e,n,i,s){return this.exec("set_tlm",[e,n,i],{type:s})}override_tlm(e,n,i,s){return this.exec("override_tlm",[e,n,i],{type:s})}get_overrides(){return this.exec("get_overrides")}normalize_tlm(e,n,i,s){return this.exec("normalize_tlm",[e,n,i],{type:s})}get_all_cmds(e){return this.exec("get_all_cmds",[e])}get_all_commands(e){return this.exec("get_all_cmds",[e])}get_all_cmd_names(e,n=!1){return this.exec("get_all_cmd_names",[e],{hidden:n})}get_all_command_names(e){return this.exec("get_all_cmd_names",[e])}get_cmd(e,n){return this.exec("get_cmd",[e,n])}get_command(e,n){return this.exec("get_cmd",[e,n])}get_cmd_cnts(e){return this.exec("get_cmd_cnts",[e])}get_cmd_value(e,n,i,s="CONVERTED"){return this.exec("get_cmd_value",[e,n,i,s])}get_cmd_buffer(e,n){return this.exec("get_cmd_buffer",[e,n])}_cmd(e,n,i,s,r){let o=null;for(let l in s)Object.prototype.hasOwnProperty.call(s,l)&&(o=this.encode_openc3_type(s[l]),o!==null&&(s[l]=o));return this.exec(e,[n,i,s],{},r)}get_cmd_hazardous(e,n,i,s={}){return n===void 0?this.exec("get_cmd_hazardous",e,{},s):this._cmd("get_cmd_hazardous",e,n,i,s)}cmd(e,n,i,s={}){return n===void 0?this.exec("cmd",e,{},s):this._cmd("cmd",e,n,i,s)}cmd_no_range_check(e,n,i,s={}){return n===void 0?this.exec("cmd_no_range_check",e,{},s):this._cmd("cmd_no_range_check",e,n,i,s)}cmd_raw(e,n,i,s={}){return n===void 0?this.exec("cmd_raw",e,{},s):this._cmd("cmd_raw",e,n,i,s)}cmd_raw_no_range_check(e,n,i,s={}){return n===void 0?this.exec("cmd_raw_no_range_check",e,{},s):this._cmd("cmd_raw_no_range_check",e,n,i,s)}cmd_no_hazardous_check(e,n,i,s={}){return n===void 0?this.exec("cmd_no_hazardous_check",e,{},s):this._cmd("cmd_no_hazardous_check",e,n,i,s)}cmd_no_checks(e,n,i,s={}){return n===void 0?this.exec("cmd_no_checks",e,{},s):this._cmd("cmd_no_checks",e,n,i,s)}cmd_raw_no_hazardous_check(e,n,i,s={}){return n===void 0?this.exec("cmd_raw_no_hazardous_check",e,{},s):this._cmd("cmd_raw_no_hazardous_check",e,n,i,s)}cmd_raw_no_checks(e,n,i,s={}){return n===void 0?this.exec("cmd_raw_no_checks",e,{},s):this._cmd("cmd_raw_no_checks",e,n,i,s)}build_cmd(e,n,i){return n===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,n,i)}build_command(e,n,i){return n===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,n,i)}get_interface_names(){return this.exec("get_interface_names",[])}send_raw(e,n){return this.exec("send_raw",[e,n])}list_configs(e){return this.exec("list_configs",[e])}load_config(e,n){return this.exec("load_config",[e,n])}save_config(e,n,i){return this.exec("save_config",[e,n,i])}delete_config(e,n){return this.exec("delete_config",[e,n])}enable_limits(e,n,i){return this.exec("enable_limits",[e,n,i])}disable_limits(e,n,i){return this.exec("disable_limits",[e,n,i])}get_out_of_limits(){return this.exec("get_out_of_limits",[])}get_overall_limits_state(e){return this.exec("get_overall_limits_state",[e])}list_settings(){return this.exec("list_settings",[])}get_all_settings(){return this.exec("get_all_settings",[])}get_setting(e){return this.exec("get_setting",[e])}get_settings(e){return this.exec("get_settings",e)}set_setting(e,n){return this.exec("set_setting",[e,n])}save_setting(e,n){return this.exec("set_setting",[e,n])}get_metrics(){return this.exec("get_metrics",[])}async hashString(e){if(window.isSecureContext){const n=new TextEncoder().encode(e),i=await crypto.subtle.digest("SHA-256",n),s=new Uint8Array(i);return Array.from(s).map(r=>r.toString(16).padStart(2,"0")).join("")}}}function _c(t,e,n){const{years:i=0,months:s=0,weeks:r=0,days:o=0,hours:l=0,minutes:u=0,seconds:d=0}=e,p=An(t,void 0),m=s||i?zn(p,s+i*12):p,b=o||r?Pn(m,o+r*7):m,y=u+l*60,g=(d+y*60)*1e3;return Vn(t,+b+g)}const _n={props:{date:{type:String},time:{type:String},timeZone:{type:String}},data(){return{startDate:"",startTime:"",endDate:"",endTime:""}},methods:{calcStartDateTime:function(){this.date?(this.startDate=this.date,this.endDate=this.date):(this.startDate=Ie(new Date,"yyyy-MM-dd"),this.endDate=Ie(new Date,"yyyy-MM-dd"));let t=1e3*60*30,e=null;this.time?(e=Dn(this.time,"HH:mm:ss",new Date),e=new Date(Math.floor(e.getTime()/t)*t)):e=new Date(Math.ceil(new Date().getTime()/t)*t),this.startTime=Ie(e,"HH:mm:ss"),this.endTime=Ie(_c(e,{minutes:30}),"HH:mm:ss")}}},vc={components:{EnvironmentChooser:Bn,ScriptChooser:qi},props:{modelValue:Boolean,timelines:{type:Array,required:!0},activity:{type:Object,default:null}},mixins:[_n,ze],data(){return{timeline:null,dialogStep:1,kind:"",types:["COMMAND","SCRIPT","RESERVE"],activityData:"",activityEnvironment:[],rules:{required:t=>!!t||"Required"},recurring:!1,recurringEndDate:null,recurringEndTime:null,frequency:90,timeSpan:"minutes",timeSpans:["minutes","hours","days"]}},mounted:function(){this.updateValues()},computed:{timeError:function(){const t=new Date,e=Date.parse(`${this.startDate}T${this.startTime}`),n=Date.parse(`${this.endDate}T${this.endTime}`);return e===n?"Invalid start, end time. Activity must have different start and end times.":t>e?"Invalid start time. Activity must be in the future.":e>n?"Invalid start time. Activity start before end.":null},typeError:function(){return this.timeline?this.kind!=="RESERVE"&&!this.activityData?"No data is selected or inputted":null:"Activity must have a timeline selected."},timelineNames:function(){return this.timelines.map(t=>t.name)},show:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}},methods:{changeKind:function(t){t!==this.kind&&(this.kind=t,this.activityData="")},fileHandler:function(t){this.activityData=t},updateValues:function(){var t;if(this.dialogStep=1,this.activity){this.timeline=this.activity.name;const e=new Date(this.activity.start*1e3),n=new Date(this.activity.stop*1e3);if(this.startDate=this.formatDate(e,this.timeZone),this.startTime=this.formatTimeHMS(e,this.timeZone),this.endDate=this.formatDate(n,this.timeZone),this.endTime=this.formatTimeHMS(n,this.timeZone),this.kind=this.activity.kind.toUpperCase(),this.activityData=this.activity.data[this.activity.kind],this.activityEnvironment=this.activity.data.environment,(t=this.activity.recurring)!=null&&t.uuid){this.recurring=!0;const i=new Date(this.activity.recurring.end*1e3);this.recurringEndDate=this.formatDate(i,this.timeZone),this.recurringEndTime=this.formatTimeHMS(i,this.timeZone),this.frequency=this.activity.recurring.frequency,this.timeSpan=this.activity.recurring.span}}else this.calcStartDateTime(),this.recurringEndDate=this.startDate,this.recurringEndTime=this.startTime,this.kind="",this.activityData="",this.activityEnvironment=[],this.timeline=this.timelineNames[0]},clearHandler:function(){this.show=!this.show},submitHandler(){let t=null,e=null,n=null;this.timeZone==="local"?(t=new Date(this.startDate+" "+this.startTime).toISOString(),e=new Date(this.endDate+" "+this.endTime).toISOString(),this.recurring&&(n=new Date(this.recurringEndDate+" "+this.recurringEndTime).toISOString())):(t=new Date(this.startDate+" "+this.startTime+"Z").toISOString(),e=new Date(this.endDate+" "+this.endTime+"Z").toISOString(),this.recurring&&(n=new Date(this.recurringEndDate+" "+this.recurringEndTime+"Z").toISOString()));const i=this.kind.toLowerCase();let s={environment:this.activityEnvironment};s[i]=this.activityData;let r={};this.recurring&&(r={frequency:this.frequency,span:this.timeSpan,end:n}),this.activity?pe.put(`/openc3-api/timeline/${this.activity.name}/activity/${this.activity.start}`,{data:{start:t,stop:e,kind:i,data:s,recurring:r}}).then(o=>{const l=this.formatSeconds(new Date(o.data.start*1e3));this.$notify.normal({title:"Updated Activity",body:`${l} (${o.data.start}) on timeline: ${o.data.name}`}),this.$emit("update",o.data),this.show=!this.show}).catch(o=>{this.show=!this.show}):pe.post(`/openc3-api/timeline/${this.timeline}/activities`,{data:{start:t,stop:e,kind:i,data:s,recurring:r}}).then(o=>{const l=this.formatSeconds(new Date(o.data.start*1e3));this.$notify.normal({title:"Created Activity",body:`${l} (${o.data.start}) on timeline: ${o.data.name}`}),this.$emit("update",o.data),this.show=!this.show}).catch(o=>{this.show=!this.show}),this.clearHandler()}}},Sc={key:0},kc={key:1},xc={class:"pr-2"},Ec=["textContent"],Cc={class:"pr-2"},Oc={key:0},Tc={key:1,class:"ma-3"},Rc={key:2},Dc=["textContent"];function Ac(t,e,n,i,s,r){const o=h("v-spacer"),l=h("v-icon"),u=h("v-tooltip"),d=h("v-toolbar"),p=h("v-btn"),m=h("v-row"),b=h("v-select"),y=h("v-text-field"),g=h("v-checkbox"),f=h("v-col"),S=h("v-card-text"),T=h("script-chooser"),O=h("environment-chooser"),D=h("v-stepper"),B=h("v-card"),E=h("v-dialog");return k(),A("div",null,[a(E,{persistent:"",modelValue:r.show,"onUpdate:modelValue":e[15]||(e[15]=R=>r.show=R),width:"600"},{default:c(()=>[a(B,null,{default:c(()=>[a(d,{height:"24"},{default:c(()=>[a(o),n.activity?(k(),A("span",Sc,"Edit Activity")):(k(),A("span",kc,"Create Activity")),a(o),a(u,{location:"top"},{activator:c(({props:R})=>[v("div",G(J(R)),[a(l,{"data-test":"close-note-icon",onClick:r.clearHandler},{default:c(()=>e[16]||(e[16]=[x(" mdi-close-box ")])),_:1},8,["onClick"])],16)]),default:c(()=>[e[17]||(e[17]=v("span",null," Close ",-1))]),_:1})]),_:1}),a(D,{modelValue:s.dialogStep,"onUpdate:modelValue":e[14]||(e[14]=R=>s.dialogStep=R),editable:"",items:["Activity Times","Activity Type"]},Ae({"item.1":c(()=>[a(S,null,{default:c(()=>[v("div",xc,[a(b,{density:"compact","hide-details":"",variant:"outlined",modelValue:s.timeline,"onUpdate:modelValue":e[1]||(e[1]=R=>s.timeline=R),items:r.timelineNames,label:"Timeline","data-test":"activity-select-timeline",class:"pb-2"},null,8,["modelValue","items"]),a(m,{dense:""},{default:c(()=>[a(y,{modelValue:t.startDate,"onUpdate:modelValue":e[2]||(e[2]=R=>t.startDate=R),type:"date",label:"Start Date",class:"mx-1",rules:[s.rules.required],"data-test":"activity-start-date"},null,8,["modelValue","rules"]),a(y,{modelValue:t.startTime,"onUpdate:modelValue":e[3]||(e[3]=R=>t.startTime=R),type:"time",step:"1",label:"Start Time",class:"mx-1",rules:[s.rules.required],"data-test":"activity-start-time"},null,8,["modelValue","rules"])]),_:1}),a(m,{dense:""},{default:c(()=>[a(y,{modelValue:t.endDate,"onUpdate:modelValue":e[4]||(e[4]=R=>t.endDate=R),type:"date",label:"End Date",class:"mx-1",rules:[s.rules.required],"data-test":"activity-end-date"},null,8,["modelValue","rules"]),a(y,{modelValue:t.endTime,"onUpdate:modelValue":e[5]||(e[5]=R=>t.endTime=R),type:"time",step:"1",label:"End Time",class:"mx-1",rules:[s.rules.required],"data-test":"activity-end-time"},null,8,["modelValue","rules"])]),_:1}),a(m,{class:"pl-3"},{default:c(()=>[a(g,{modelValue:s.recurring,"onUpdate:modelValue":e[6]||(e[6]=R=>s.recurring=R),disabled:!!n.activity,label:"Recurring","hide-details":"","data-test":"recurring"},null,8,["modelValue","disabled"])]),_:1}),s.recurring?(k(),P(m,{key:0},{default:c(()=>[a(f,null,{default:c(()=>e[21]||(e[21]=[v("div",{class:"repeat"},"Repeat every",-1)])),_:1}),a(f,null,{default:c(()=>[a(y,{modelValue:s.frequency,"onUpdate:modelValue":e[7]||(e[7]=R=>s.frequency=R),disabled:!!n.activity,density:"compact",variant:"outlined","single-line":"","hide-details":"","data-test":"recurring-frequency"},null,8,["modelValue","disabled"])]),_:1}),a(f,null,{default:c(()=>[a(b,{modelValue:s.timeSpan,"onUpdate:modelValue":e[8]||(e[8]=R=>s.timeSpan=R),disabled:!!n.activity,items:s.timeSpans,style:{},"hide-details":"",density:"compact",variant:"outlined","data-test":"recurring-span"},null,8,["modelValue","disabled","items"])]),_:1})]),_:1})):z("",!0),s.recurring?(k(),P(m,{key:1,style:{"padding-bottom":"10px"}},{default:c(()=>[a(f,null,{default:c(()=>e[22]||(e[22]=[v("div",{class:"repeat"},"Ending",-1)])),_:1}),a(f,null,{default:c(()=>[a(y,{modelValue:s.recurringEndDate,"onUpdate:modelValue":e[9]||(e[9]=R=>s.recurringEndDate=R),type:"date",label:"End Date",class:"mx-1",rules:[s.rules.required],disabled:!!n.activity,"data-test":"recurring-end-date"},null,8,["modelValue","rules","disabled"])]),_:1}),a(f,null,{default:c(()=>[a(y,{modelValue:s.recurringEndTime,"onUpdate:modelValue":e[10]||(e[10]=R=>s.recurringEndTime=R),type:"time",step:"1",label:"End Time",class:"mx-1",rules:[s.rules.required],disabled:!!n.activity,"data-test":"recurring-end-time"},null,8,["modelValue","rules","disabled"])]),_:1})]),_:1})):z("",!0),a(m,null,{default:c(()=>[ve(v("span",{class:"ma-2 text-red",textContent:F(r.timeError)},null,8,Ec),[[Se,r.timeError]])]),_:1})])]),_:1})]),"item.2":c(()=>[a(S,null,{default:c(()=>[v("div",Cc,[a(b,{density:"compact","hide-details":"",variant:"outlined",modelValue:s.kind,"onUpdate:modelValue":e[11]||(e[11]=R=>s.kind=R),items:s.types,label:"Activity Type","data-test":"activity-select-type",class:"pb-2"},null,8,["modelValue","items"]),s.kind==="COMMAND"?(k(),A("div",Oc,[a(y,{modelValue:s.activityData,"onUpdate:modelValue":e[12]||(e[12]=R=>s.activityData=R),type:"text",label:"Command Input",placeholder:"INST COLLECT with TYPE 0, DURATION 1, OPCODE 171, TEMP 0",prefix:"cmd('",suffix:"')",hint:"Timeline runs commands with cmd_no_hazardous_check","data-test":"activity-cmd"},null,8,["modelValue"])])):s.kind==="SCRIPT"?(k(),A("div",Tc,[a(T,{onFile:r.fileHandler},null,8,["onFile"]),a(O,{modelValue:s.activityEnvironment,"onUpdate:modelValue":e[13]||(e[13]=R=>s.activityEnvironment=R)},null,8,["modelValue"])])):(k(),A("div",Rc,e[23]||(e[23]=[v("span",{class:"ma-2"}," No required input ",-1)]))),ve(a(m,{class:"mt-2"},{default:c(()=>[v("span",{class:"ma-2 text-red",textContent:F(r.typeError)},null,8,Dc)]),_:1},512),[[Se,r.typeError]])])]),_:1})]),_:2},[s.dialogStep===2?{name:"actions",fn:c(()=>[a(m,{class:"ma-0 px-6 pb-4"},{default:c(()=>[a(p,{onClick:e[0]||(e[0]=()=>s.dialogStep-=1),variant:"text"},{default:c(()=>e[18]||(e[18]=[x(" Previous ")])),_:1}),a(o),a(p,{onClick:r.clearHandler,variant:"outlined",class:"mr-4"},{default:c(()=>e[19]||(e[19]=[x(" Cancel ")])),_:1},8,["onClick"]),a(p,{onClick:be(r.submitHandler,["prevent"]),type:"submit",color:"primary",disabled:!!t.error},{default:c(()=>e[20]||(e[20]=[x(" Ok ")])),_:1},8,["onClick","disabled"])]),_:1})]),key:"0"}:void 0]),1032,["modelValue"])]),_:1})]),_:1},8,["modelValue"])])}const Pc=oe(vc,[["render",Ac],["__scopeId","data-v-9ad41f9b"]]),Vc={components:{},props:{modelValue:{type:String,required:!0}},computed:{color:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}},swatches:function(){return["#005a8f","#003784","#8F3400","#df1368","#ff5252","#df323b","#9f0010","#2d9437","#004700","#db7200","#802700","#0f2941"]}},methods:{}};function Mc(t,e,n,i,s,r){const o=h("v-icon"),l=h("v-list-item"),u=h("v-select");return k(),A("div",null,[a(u,{label:"Color",items:r.swatches,modelValue:r.color,"onUpdate:modelValue":e[0]||(e[0]=d=>r.color=d)},{"prepend-inner":c(()=>[a(o,{color:r.color},{default:c(()=>e[1]||(e[1]=[x(" mdi-square ")])),_:1},8,["color"])]),item:c(({props:d,item:p})=>[a(l,re(d,{value:p.raw}),{prepend:c(()=>[a(o,{color:p.raw},{default:c(()=>e[2]||(e[2]=[x(" mdi-square ")])),_:2},1032,["color"])]),_:2},1040,["value"])]),_:1},8,["items","modelValue"])])}const xi=oe(Vc,[["render",Mc]]),Uc={methods:{deleteItem(t){let e=null,n="";switch(t.type.toLowerCase()){case"activity":n="activity",e=t.activity.start;break;case"metadata":n="metadata",e=t.metadata.start;break;case"note":n="notes",e=t.note.start;break}this.$dialog.confirm(`Are you sure you want to remove ${t.typeStr} at ${t.startStr}`,{okText:"Delete",cancelText:"Cancel"}).then(()=>pe.delete(`/openc3-api/${n}/${e}`)).then(()=>{this.$emit("delete",t),this.$notify.normal({title:`Deleted ${t.typeStr}`,body:`Deleted ${t.typeStr} at ${t.startStr}`})}).catch(()=>{})}}},Nc={components:{},props:{modelValue:{type:Array,required:!0}},data(){return{}},computed:{metadata:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}},methods:{newMetadata:function(){this.metadata.push({key:"",value:""})},rm:function(t){this.metadata.splice(t,1)}}},Fc={scope:"col",class:"text-right"};function zc(t,e,n,i,s,r){const o=h("v-icon"),l=h("v-tooltip"),u=h("v-text-field"),d=h("v-table");return k(),A("div",null,[a(d,{dense:""},{default:c(()=>[v("tbody",null,[v("tr",null,[e[2]||(e[2]=v("th",{scope:"col",class:"text-left"},"Key",-1)),e[3]||(e[3]=v("th",{scope:"col",class:"text-left"},"Value",-1)),v("th",Fc,[a(l,{location:"top"},{activator:c(({props:p})=>[v("div",G(J(p)),[a(o,{"data-test":"new-metadata-icon",onClick:r.newMetadata},{default:c(()=>e[0]||(e[0]=[x(" mdi-plus ")])),_:1},8,["onClick"])],16)]),default:c(()=>[e[1]||(e[1]=v("span",null," New Metadata ",-1))]),_:1})])]),(k(!0),A(ne,null,le(r.metadata,(p,m)=>(k(),A("tr",{key:`tr-${m}`},[v("td",null,[a(u,{modelValue:p.key,"onUpdate:modelValue":b=>p.key=b,type:"text",density:"compact","data-test":`key-${m}`},null,8,["modelValue","onUpdate:modelValue","data-test"])]),v("td",null,[a(u,{modelValue:p.value,"onUpdate:modelValue":b=>p.value=b,type:"text",density:"compact","data-test":`value-${m}`},null,8,["modelValue","onUpdate:modelValue","data-test"])]),v("td",null,[a(l,{location:"top"},{activator:c(({props:b})=>[v("div",re({ref_for:!0},b),[a(o,{"data-test":`delete-metadata-icon-${m}`,onClick:y=>r.rm(m)},{default:c(()=>e[4]||(e[4]=[x(" mdi-delete ")])),_:2},1032,["data-test","onClick"])],16)]),default:c(()=>[e[5]||(e[5]=v("span",null," Delete Metadata ",-1))]),_:2},1024)])]))),128))])]),_:1})])}const Ic=oe(Nc,[["render",zc]]),Lc={components:{ColorSelectForm:xi,MetadataInputForm:Ic},props:{modelValue:Boolean,metadata:{type:Object,default:null}},mixins:[_n,ze],data(){return{dialogStep:1,color:"#003784",metadataVals:[],rules:{required:t=>!!t||"Required"}}},mounted:function(){this.updateValues()},computed:{typeError:function(){return this.color?this.metadataVals.length<1?"Please enter a value in the metadata table.":this.metadataVals.find(t=>t.key===""||t.value==="")?"Missing or empty key, value in the metadata table.":null:"A color is required."},show:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}},methods:{updateValues:function(){if(this.dialogStep=1,this.metadata){const t=new Date(this.metadata.start*1e3);this.startDate=this.formatDate(t,this.timeZone),this.startTime=this.formatTimeHMS(t,this.timeZone),this.color=this.metadata.color,this.metadataVals=Object.keys(this.metadata.metadata).map(e=>({key:e,value:this.metadata.metadata[e]}))}else this.calcStartDateTime(),this.color="#003784",this.metadataVals=[]},clearHandler:function(){this.show=!this.show},submitHandler(){const t=this.color,e=this.metadataVals.reduce((i,s)=>(i[s.key]=s.value,i),{}),n={color:t,metadata:e};this.timeZone==="local"?n.start=new Date(this.startDate+" "+this.startTime).toISOString():n.start=new Date(this.startDate+" "+this.startTime+"Z").toISOString(),this.metadata?pe.put(`/openc3-api/metadata/${this.metadata.start}`,{data:n}).then(i=>{this.$notify.normal({title:"Updated Metadata",body:`Metadata updated: (${i.data.start})`}),this.$emit("update",i.data),this.show=!this.show}):pe.post("/openc3-api/metadata",{data:n}).then(i=>{this.$notify.normal({title:"Created new Metadata",body:`Metadata: (${i.data.start})`}),this.$emit("update",i.data),this.show=!this.show})}}},Bc={key:0},qc={key:1},jc={class:"pa-2"},Hc={class:"pa-2"},$c={style:{"min-height":"200px"}},Wc=["textContent"];function Gc(t,e,n,i,s,r){const o=h("v-spacer"),l=h("v-icon"),u=h("v-tooltip"),d=h("v-toolbar"),p=h("v-btn"),m=h("v-row"),b=h("color-select-form"),y=h("v-text-field"),g=h("v-card-text"),f=h("metadata-input-form"),S=h("v-stepper"),T=h("v-card"),O=h("v-dialog");return k(),A("div",null,[a(O,{persistent:"",modelValue:r.show,"onUpdate:modelValue":e[6]||(e[6]=D=>r.show=D),width:"600"},{default:c(()=>[a(T,null,{default:c(()=>[a(d,{height:"24"},{default:c(()=>[a(o),n.metadata?(k(),A("span",Bc,"Update Metadata")):(k(),A("span",qc,"Create Metadata")),a(o),a(u,{location:"top"},{activator:c(({props:D})=>[v("div",G(J(D)),[a(l,{"data-test":"close-metadata-icon",onClick:r.clearHandler},{default:c(()=>e[7]||(e[7]=[x(" mdi-close-box ")])),_:1},8,["onClick"])],16)]),default:c(()=>[e[8]||(e[8]=v("span",null,"Close",-1))]),_:1})]),_:1}),a(S,{modelValue:s.dialogStep,"onUpdate:modelValue":e[5]||(e[5]=D=>s.dialogStep=D),editable:"",items:["Metadata Times","Metadata Input"]},Ae({"item.1":c(()=>[a(g,null,{default:c(()=>[v("div",jc,[a(b,{modelValue:s.color,"onUpdate:modelValue":e[1]||(e[1]=D=>s.color=D)},null,8,["modelValue"]),a(m,{dense:""},{default:c(()=>[a(y,{modelValue:t.startDate,"onUpdate:modelValue":e[2]||(e[2]=D=>t.startDate=D),type:"date",label:"Start Date",class:"mx-1",rules:[s.rules.required],"data-test":"metadata-start-date"},null,8,["modelValue","rules"]),a(y,{modelValue:t.startTime,"onUpdate:modelValue":e[3]||(e[3]=D=>t.startTime=D),type:"time",step:"1",label:"Start Time",class:"mx-1",rules:[s.rules.required],"data-test":"metadata-start-time"},null,8,["modelValue","rules"])]),_:1})])]),_:1})]),"item.2":c(()=>[a(g,null,{default:c(()=>[v("div",Hc,[v("div",$c,[a(f,{modelValue:s.metadataVals,"onUpdate:modelValue":e[4]||(e[4]=D=>s.metadataVals=D)},null,8,["modelValue"])]),ve(a(m,null,{default:c(()=>[v("span",{class:"ma-2 text-red",textContent:F(r.typeError)},null,8,Wc)]),_:1},512),[[Se,r.typeError]])])]),_:1})]),_:2},[s.dialogStep===2?{name:"actions",fn:c(()=>[a(m,{class:"ma-0 px-6 pb-4"},{default:c(()=>[a(p,{onClick:e[0]||(e[0]=()=>s.dialogStep-=1),variant:"text"},{default:c(()=>e[9]||(e[9]=[x(" Previous ")])),_:1}),a(o),a(p,{onClick:r.clearHandler,variant:"outlined",class:"mr-4"},{default:c(()=>e[10]||(e[10]=[x(" Cancel ")])),_:1},8,["onClick"]),a(p,{onClick:be(r.submitHandler,["prevent"]),type:"submit",color:"primary",disabled:!!t.error},{default:c(()=>e[11]||(e[11]=[x(" Ok ")])),_:1},8,["onClick","disabled"])]),_:1})]),key:"0"}:void 0]),1032,["modelValue"])]),_:1})]),_:1},8,["modelValue"])])}const Jc=oe(Lc,[["render",Gc],["__scopeId","data-v-364c2ff6"]]),Yc={components:{ColorSelectForm:xi},props:{modelValue:Boolean,note:{type:Object}},mixins:[_n,ze],data(){return{dialogStep:1,description:"",color:"#8F3400",rules:{required:t=>!!t||"Required"}}},mounted:function(){this.updateValues()},computed:{timeError:function(){let t,e;return this.timeZone==="local"?(t=new Date(this.startDate+" "+this.startTime),e=new Date(this.endDate+" "+this.endTime)):(t=new Date(this.startDate+" "+this.startTime+"Z"),e=new Date(this.endDate+" "+this.endTime+"Z")),t===e?"Invalid start, end time. Notes must have different start and end times.":t>e?"Invalid start time. Notes start before end.":null},typeError:function(){return this.color?this.description?null:"A description is required for a valid note.":"A color is required."},show:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}},methods:{updateValues:function(){if(this.dialogStep=1,this.note){const t=new Date(this.note.start*1e3);this.startDate=this.formatDate(t,this.timeZone),this.startTime=this.formatTimeHMS(t,this.timeZone);const e=new Date(this.note.stop*1e3);this.endDate=this.formatDate(e,this.timeZone),this.endTime=this.formatTimeHMS(e,this.timeZone),this.color=this.note.color,this.description=this.note.description}else this.calcStartDateTime(),this.color="#8F3400",this.description=""},clearHandler:function(){this.show=!this.show},submitHandler(){let t,e;this.timeZone==="local"?(t=new Date(this.startDate+" "+this.startTime).toISOString(),e=new Date(this.endDate+" "+this.endTime).toISOString()):(t=new Date(this.startDate+" "+this.startTime+"Z").toISOString(),e=new Date(this.endDate+" "+this.endTime+"Z").toISOString());const n=this.color,i=this.description;this.note?pe.put(`/openc3-api/notes/${this.note.start}`,{data:{start:t,stop:e,color:n,description:i}}).then(s=>{const r=s.data.description.length>16?`${s.data.description.substring(0,16)}...`:s.data.description;this.$notify.normal({title:"Updated Note",body:`Note updated: (${s.data.start}): "${r}"`}),this.$emit("update",s.data),this.show=!this.show}):pe.post("/openc3-api/notes",{data:{start:t,stop:e,color:n,description:i}}).then(s=>{const r=s.data.description.length>16?`${s.data.description.substring(0,16)}...`:s.data.description;this.$notify.normal({title:"Created new Note",body:`Note: (${s.data.start}) created: "${r}"`}),this.$emit("update",s.data),this.show=!this.show})}}},Kc={key:0},Xc={key:1},Zc={class:"pa-2"},Qc=["textContent"],eu={class:"pa-2"},tu=["textContent"];function nu(t,e,n,i,s,r){const o=h("v-spacer"),l=h("v-icon"),u=h("v-tooltip"),d=h("v-toolbar"),p=h("v-btn"),m=h("v-row"),b=h("v-text-field"),y=h("v-card-text"),g=h("color-select-form"),f=h("v-stepper"),S=h("v-card"),T=h("v-dialog");return k(),A("div",null,[a(T,{persistent:"",modelValue:r.show,"onUpdate:modelValue":e[8]||(e[8]=O=>r.show=O),width:"600"},{default:c(()=>[a(S,null,{default:c(()=>[a(d,{height:"24"},{default:c(()=>[a(o),n.note?(k(),A("span",Kc,"Update Note")):(k(),A("span",Xc,"Create Note")),a(o),a(u,{location:"top"},{activator:c(({props:O})=>[v("div",G(J(O)),[a(l,{"data-test":"close-note-icon",onClick:r.clearHandler},{default:c(()=>e[9]||(e[9]=[x(" mdi-close-box ")])),_:1},8,["onClick"])],16)]),default:c(()=>[e[10]||(e[10]=v("span",null," Close ",-1))]),_:1})]),_:1}),a(f,{modelValue:s.dialogStep,"onUpdate:modelValue":e[7]||(e[7]=O=>s.dialogStep=O),editable:"",items:["Note Times","Note Input"]},Ae({"item.1":c(()=>[a(y,null,{default:c(()=>[v("div",Zc,[a(m,{dense:""},{default:c(()=>[a(b,{modelValue:t.startDate,"onUpdate:modelValue":e[1]||(e[1]=O=>t.startDate=O),type:"date",label:"Start Date",class:"mx-1",rules:[s.rules.required],"data-test":"note-start-date"},null,8,["modelValue","rules"]),a(b,{modelValue:t.startTime,"onUpdate:modelValue":e[2]||(e[2]=O=>t.startTime=O),type:"time",step:"1",label:"Start Time",class:"mx-1",rules:[s.rules.required],"data-test":"note-start-time"},null,8,["modelValue","rules"])]),_:1}),a(m,{dense:""},{default:c(()=>[a(b,{modelValue:t.endDate,"onUpdate:modelValue":e[3]||(e[3]=O=>t.endDate=O),type:"date",label:"End Date",class:"mx-1",rules:[s.rules.required],"data-test":"note-end-date"},null,8,["modelValue","rules"]),a(b,{modelValue:t.endTime,"onUpdate:modelValue":e[4]||(e[4]=O=>t.endTime=O),type:"time",step:"1",label:"End Time",class:"mx-1",rules:[s.rules.required],"data-test":"note-end-time"},null,8,["modelValue","rules"])]),_:1}),a(m,null,{default:c(()=>[ve(v("span",{class:"ma-2 text-red",textContent:F(r.timeError)},null,8,Qc),[[Se,r.timeError]])]),_:1})])]),_:1})]),"item.2":c(()=>[a(y,null,{default:c(()=>[v("div",eu,[v("div",null,[a(g,{modelValue:s.color,"onUpdate:modelValue":e[5]||(e[5]=O=>s.color=O)},null,8,["modelValue"])]),v("div",null,[a(b,{modelValue:s.description,"onUpdate:modelValue":e[6]||(e[6]=O=>s.description=O),type:"text",label:"Note Description","data-test":"note-description"},null,8,["modelValue"])]),ve(a(m,null,{default:c(()=>[v("span",{class:"ma-2 text-red",textContent:F(r.typeError)},null,8,tu)]),_:1},512),[[Se,r.typeError]])])]),_:1})]),_:2},[s.dialogStep===2?{name:"actions",fn:c(()=>[a(m,{class:"ma-0 px-6 pb-4"},{default:c(()=>[a(p,{onClick:e[0]||(e[0]=()=>s.dialogStep-=1),variant:"text"},{default:c(()=>e[11]||(e[11]=[x(" Previous ")])),_:1}),a(o),a(p,{onClick:r.clearHandler,variant:"outlined",class:"mr-4"},{default:c(()=>e[12]||(e[12]=[x(" Cancel ")])),_:1},8,["onClick"]),a(p,{onClick:be(r.submitHandler,["prevent"]),type:"submit",color:"primary",disabled:!!t.error},{default:c(()=>e[13]||(e[13]=[x(" Ok ")])),_:1},8,["onClick","disabled"])]),_:1})]),key:"0"}:void 0]),1032,["modelValue"])]),_:1})]),_:1},8,["modelValue"])])}const su=oe(Yc,[["render",nu],["__scopeId","data-v-87960c87"]]),iu={components:{ActivityCreateDialog:Pc,MetadataCreateDialog:Jc,NoteCreateDialog:su},mixins:[ze,Uc],props:{events:{type:Array,required:!0},modelValue:{type:Boolean,required:!0},timeZone:{type:String,required:!0},types:{type:Array},newMetadata:{type:Boolean,default:!1}},data(){return{search:"",localEvents:[...this.events],eventHeaders:[{title:"Start",key:"start",width:215},{title:"Stop",key:"end",width:215},{title:"Type",key:"type"},{title:"Data",key:"data"},{title:"Actions",key:"actions",sortable:!1}],editActivity:{start:new Date,end:new Date},editMetadata:{start:new Date,end:new Date},editNote:{start:new Date,end:new Date},editIndex:0,showActivityUpdate:!1,showMetadataUpdate:!1,showNoteUpdate:!1,showMetadataCreate:!1}},computed:{show:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}},created:function(){},methods:{close(){this.$emit("close"),this.show=!1},dataFormat(t){let e=t.name;switch(t.type){case"note":e=t.note.description;break;case"metadata":let n=[];Object.entries(t.metadata.metadata).forEach(([i,s])=>n.push(`${i}: ${s}`)),e=n.join(", ");break}return e},editAction(t){switch(this.editIndex=this.localEvents.findIndex(e=>e.type===t.type&&e.start===t.start),t.type){case"activity":this.editActivity=t.activity,this.showActivityUpdate=!0;break;case"metadata":this.editMetadata=t.metadata,this.showMetadataUpdate=!0;break;case"note":this.editNote=t.note,this.showNoteUpdate=!0;break}},deleteAction(t){let e=this.localEvents.findIndex(r=>r.type===t.type&&r.start===t.start),n=null,i=null,s=null;switch(t.type){case"activity":n=`timeline/${t.activity.name}/activity`,i=t.activity.start,s=t.activity.uuid;break;case"metadata":n="metadata",i=t.metadata.start;break;case"note":n="notes",i=t.note.start;break}this.$dialog.confirm(`Are you sure you want to remove ${t.type} at ${t.start}`,{okText:"Delete",cancelText:"Cancel"}).then(r=>{this.localEvents.splice(e,1);let o=`/openc3-api/${n}/${i}`;return s&&(o+=`/${s}`),pe.delete(o)}).then(r=>{this.$emit("update"),this.$notify.normal({title:`Deleted ${t.type}`,body:`Deleted ${t.type} at ${i}`})}).catch(r=>{})},updateActivity(t){this.$emit("update"),this.localEvents[this.editIndex].activity=t},updateMetadata(t){this.$emit("update"),this.localEvents[this.editIndex].metadata=t},updateNote(t){this.$emit("update"),this.localEvents[this.editIndex].note=t},addMetadata(t){let e={name:"Metadata",start:new Date(t.start*1e3),end:new Date(t.start*1e3),color:t.color,type:t.type,timed:!0,metadata:t};this.localEvents.push(e)}}},ru={key:0},ou={key:1},au={key:0},lu={key:1};function cu(t,e,n,i,s,r){const o=h("v-spacer"),l=h("v-icon"),u=h("v-tooltip"),d=h("v-toolbar"),p=h("v-text-field"),m=h("v-row"),b=h("v-card-title"),y=h("v-data-table"),g=h("v-btn"),f=h("v-card-actions"),S=h("v-card"),T=h("v-dialog"),O=h("activity-create-dialog"),D=h("metadata-create-dialog"),B=h("note-create-dialog");return k(),A("div",null,[a(T,{persistent:"",modelValue:r.show,"onUpdate:modelValue":e[2]||(e[2]=E=>r.show=E),width:"80vw"},{default:c(()=>[a(S,null,{default:c(()=>[a(d,{height:"24"},{default:c(()=>[a(o),n.newMetadata?(k(),A("span",ru,"Metadata")):(k(),A("span",ou,"Events")),a(o),a(u,{location:"top"},{activator:c(({props:E})=>[v("div",G(J(E)),[a(l,{"data-test":"close-metadata-icon",onClick:r.close},{default:c(()=>e[7]||(e[7]=[x(" mdi-close-box ")])),_:1},8,["onClick"])],16)]),default:c(()=>[e[8]||(e[8]=v("span",null,"Close",-1))]),_:1})]),_:1}),a(b,null,{default:c(()=>[a(m,{class:"pa-3"},{default:c(()=>[n.newMetadata?(k(),A("span",au,"Metadata")):(k(),A("span",lu,"Events")),a(o),a(p,{modelValue:s.search,"onUpdate:modelValue":e[0]||(e[0]=E=>s.search=E),label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":""},null,8,["modelValue"])]),_:1})]),_:1}),a(y,{headers:s.eventHeaders,items:s.localEvents,search:s.search},{"no-data":c(()=>e[9]||(e[9]=[v("span",null," No events ",-1)])),"item.start":c(({item:E})=>[x(F(t.formatDateTime(E.start,n.timeZone)),1)]),"item.end":c(({item:E})=>[x(F(t.formatDateTime(E.end,n.timeZone)),1)]),"item.type":c(({item:E})=>[x(F(E.type.charAt(0).toUpperCase()+E.type.slice(1)),1)]),"item.data":c(({item:E})=>[x(F(r.dataFormat(E)),1)]),"item.actions":c(({item:E})=>[a(l,{size:"small",class:"mr-2",onClick:R=>r.editAction(E),"data-test":"edit-event"},{default:c(()=>e[10]||(e[10]=[x(" mdi-pencil ")])),_:2},1032,["onClick"]),a(l,{size:"small",onClick:R=>r.deleteAction(E),"data-test":"delete-event"},{default:c(()=>e[11]||(e[11]=[x(" mdi-delete ")])),_:2},1032,["onClick"])]),_:1},8,["headers","items","search"]),a(f,{class:"px-2"},{default:c(()=>[a(o),a(g,{variant:"outlined","data-test":"close-event-list",onClick:r.close},{default:c(()=>e[12]||(e[12]=[x(" Close ")])),_:1},8,["onClick"]),n.newMetadata?(k(),P(g,{key:0,variant:"flat","data-test":"new-event",onClick:e[1]||(e[1]=E=>s.showMetadataCreate=!0)},{default:c(()=>e[13]||(e[13]=[x(" New Metadata ")])),_:1})):z("",!0)]),_:1})]),_:1})]),_:1},8,["modelValue"]),s.showActivityUpdate?(k(),P(O,{key:0,modelValue:s.showActivityUpdate,"onUpdate:modelValue":e[3]||(e[3]=E=>s.showActivityUpdate=E),activity:s.editActivity,"time-zone":n.timeZone,onUpdate:r.updateActivity},null,8,["modelValue","activity","time-zone","onUpdate"])):z("",!0),s.showMetadataUpdate?(k(),P(D,{key:1,modelValue:s.showMetadataUpdate,"onUpdate:modelValue":e[4]||(e[4]=E=>s.showMetadataUpdate=E),metadata:s.editMetadata,"time-zone":n.timeZone,onUpdate:r.updateMetadata},null,8,["modelValue","metadata","time-zone","onUpdate"])):z("",!0),s.showNoteUpdate?(k(),P(B,{key:2,modelValue:s.showNoteUpdate,"onUpdate:modelValue":e[5]||(e[5]=E=>s.showNoteUpdate=E),note:s.editNote,"time-zone":n.timeZone,onUpdate:r.updateNote},null,8,["modelValue","note","time-zone","onUpdate"])):z("",!0),s.showMetadataCreate?(k(),P(D,{key:3,modelValue:s.showMetadataCreate,"onUpdate:modelValue":e[6]||(e[6]=E=>s.showMetadataCreate=E),"time-zone":n.timeZone,onUpdate:r.addMetadata},null,8,["modelValue","time-zone","onUpdate"])):z("",!0)])}const uu=oe(iu,[["render",cu]]),du={props:{question:{type:String,required:!0},default:{type:String,default:null},password:{type:Boolean,default:!1},answerRequired:{type:Boolean,default:!0},modelValue:Boolean},data(){return{inputValue:"",valid:!1,rules:[t=>!!t||"Required"]}},created(){this.default&&(this.valid=!0,this.inputValue=this.default),this.answerRequired===!1&&(this.valid=!0,this.rules=[t=>!0])},computed:{show:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}},methods:{submitHandler:function(){this.$emit("response",this.inputValue)},cancelHandler:function(){this.$emit("response","Cancel")}}},pu={class:"pa-2"},hu={class:"question"};function mu(t,e,n,i,s,r){const o=h("v-spacer"),l=h("v-toolbar"),u=h("v-text-field"),d=h("v-card-text"),p=h("v-btn"),m=h("v-card-actions"),b=h("v-form"),y=h("v-card"),g=h("v-dialog");return k(),P(g,{persistent:"",modelValue:r.show,"onUpdate:modelValue":e[2]||(e[2]=f=>r.show=f),width:"600"},{default:c(()=>[a(y,null,{default:c(()=>[a(b,{modelValue:s.valid,"onUpdate:modelValue":e[1]||(e[1]=f=>s.valid=f),onSubmit:be(r.submitHandler,["prevent"])},{default:c(()=>[a(l,{height:"24"},{default:c(()=>[a(o),e[3]||(e[3]=v("span",null," User Input Required ",-1)),a(o)]),_:1}),v("div",pu,[a(d,null,{default:c(()=>[v("div",hu,F(n.question),1),a(u,{modelValue:s.inputValue,"onUpdate:modelValue":e[0]||(e[0]=f=>s.inputValue=f),autofocus:"","data-test":"ask-value-input",type:n.password?"password":"text",rules:s.rules},null,8,["modelValue","type","rules"])]),_:1})]),a(m,{class:"px-2"},{default:c(()=>[a(o),a(p,{onClick:r.cancelHandler,variant:"outlined","data-test":"ask-cancel"},{default:c(()=>e[4]||(e[4]=[x(" Cancel ")])),_:1},8,["onClick"]),a(p,{onClick:be(r.submitHandler,["prevent"]),variant:"flat",type:"submit","data-test":"ask-ok",disabled:!s.valid},{default:c(()=>e[5]||(e[5]=[x(" Ok ")])),_:1},8,["onClick","disabled"])]),_:1})]),_:1},8,["modelValue","onSubmit"])]),_:1})]),_:1},8,["modelValue"])}const fu=ae(du,[["render",mu],["__scopeId","data-v-b44e26bc"]]),gu={props:{title:{type:String,required:!0},message:{type:String,default:null},filter:{type:String,default:"*"},multiple:{type:Boolean,default:!1},modelValue:Boolean},data(){return{inputValue:null}},computed:{show:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}},methods:{submitHandler:function(){Array.isArray(this.inputValue)||(this.inputValue=[this.inputValue]),this.$emit("response",this.inputValue)},cancelHandler:function(){this.$emit("response","Cancel")}}},bu={class:"pa-2"},yu={class:"title"},wu=["textContent"];function _u(t,e,n,i,s,r){const o=h("v-spacer"),l=h("v-toolbar"),u=h("v-row"),d=h("v-file-input"),p=h("v-card-text"),m=h("v-btn"),b=h("v-card-actions"),y=h("v-form"),g=h("v-card"),f=h("v-dialog");return k(),P(f,{persistent:"",modelValue:r.show,"onUpdate:modelValue":e[2]||(e[2]=S=>r.show=S),width:"600"},{default:c(()=>[a(g,null,{default:c(()=>[a(y,{modelValue:t.valid,"onUpdate:modelValue":e[1]||(e[1]=S=>t.valid=S),onSubmit:be(r.submitHandler,["prevent"])},{default:c(()=>[a(l,{height:"24"},{default:c(()=>[a(o),e[3]||(e[3]=v("span",null," File Dialog ",-1)),a(o)]),_:1}),v("div",bu,[a(p,null,{default:c(()=>[a(u,null,{default:c(()=>[v("span",yu,F(n.title),1)]),_:1}),n.message?(k(),P(u,{key:0},{default:c(()=>[v("span",{class:"ma-3",style:{"white-space":"pre-line"},textContent:F(n.message)},null,8,wu)]),_:1})):z("",!0),a(u,{class:"my-1"},{default:c(()=>[a(d,{label:"Choose File",modelValue:s.inputValue,"onUpdate:modelValue":e[0]||(e[0]=S=>s.inputValue=S),autofocus:"","data-test":"file-input",accept:n.filter,"small-chips":"",multiple:n.multiple},null,8,["modelValue","accept","multiple"])]),_:1})]),_:1})]),a(b,{class:"px-2"},{default:c(()=>[a(o),a(m,{onClick:r.cancelHandler,variant:"outlined","data-test":"file-cancel"},{default:c(()=>e[4]||(e[4]=[x(" Cancel ")])),_:1},8,["onClick"]),a(m,{onClick:be(r.submitHandler,["prevent"]),variant:"flat",type:"submit","data-test":"file-ok",disabled:!t.valid},{default:c(()=>e[5]||(e[5]=[x(" Ok ")])),_:1},8,["onClick","disabled"])]),_:1})]),_:1},8,["modelValue","onSubmit"])]),_:1})]),_:1},8,["modelValue"])}const vu=ae(gu,[["render",_u],["__scopeId","data-v-f89fec34"]]),Su={props:{modelValue:{type:Boolean,required:!0},title:{type:String,required:!0},text:{type:String,required:!0},width:{type:String,required:!0}},computed:{show:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}},methods:{}},ku=["textContent"],xu={class:"pa-2"},Eu=["textContent"];function Cu(t,e,n,i,s,r){const o=h("v-spacer"),l=h("v-toolbar"),u=h("v-row"),d=h("v-card-text"),p=h("v-btn"),m=h("v-card-actions"),b=h("v-card"),y=h("v-dialog");return k(),P(y,{modelValue:r.show,"onUpdate:modelValue":e[1]||(e[1]=g=>r.show=g),width:n.width},{default:c(()=>[a(b,null,{default:c(()=>[a(l,{height:"24"},{default:c(()=>[a(o),v("span",{style:{"white-space":"pre-line"},textContent:F(n.title)},null,8,ku),a(o)]),_:1}),v("div",xu,[a(d,null,{default:c(()=>[(k(!0),A(ne,null,le(n.text,(g,f)=>(k(),P(u,{"no-gutters":"",key:f},{default:c(()=>[v("span",{style:{"white-space":"pre-line"},textContent:F(g)},null,8,Eu)]),_:2},1024))),128))]),_:1})]),a(m,{class:"px-2"},{default:c(()=>[a(o),a(p,{variant:"flat",onClick:e[0]||(e[0]=g=>r.show=!r.show)},{default:c(()=>e[2]||(e[2]=[x(" Ok ")])),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue","width"])}const Ou=ae(Su,[["render",Cu]]),Tu={components:{},props:{modelValue:{type:Boolean,required:!0}},data(){return{api:null,overrides:[],search:"",headers:[{text:"Target",value:"target_name"},{text:"Packet",value:"packet_name"},{text:"Item",value:"item_name"},{text:"Type",value:"value_type"},{text:"Value",value:"value"},{text:"Delete",value:"delete"}]}},created:function(){this.api=new wn,this.getOverrides()},computed:{show:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}},methods:{getOverrides:function(){this.api.get_overrides().then(t=>{this.overrides=t})},clearOverrides:function(){const t=[...new Map(this.overrides.map(e=>[`${e.target_name}__${e.packet_name}__${e.item_name}`,e])).values()];for(let e of t)this.api.normalize_tlm(e.target_name,e.packet_name,e.item_name,"ALL").then(n=>{this.overrides=[]})},deleteOverride:function(t){this.api.normalize_tlm(t.target_name,t.packet_name,t.item_name,t.value_type).then(e=>{let n=this.overrides.indexOf(t);this.overrides.splice(n,1)})}}},Ru={class:"pa-2"};function Du(t,e,n,i,s,r){const o=h("v-spacer"),l=h("v-toolbar"),u=h("v-btn"),d=h("v-text-field"),p=h("v-row"),m=h("v-icon"),b=h("v-tooltip"),y=h("v-data-table"),g=h("v-card-text"),f=h("v-card-actions"),S=h("v-card"),T=h("v-dialog");return k(),P(T,{modelValue:r.show,"onUpdate:modelValue":e[2]||(e[2]=O=>r.show=O),width:"1000"},{default:c(()=>[a(S,null,{default:c(()=>[a(l,{height:"24"},{default:c(()=>[a(o),e[3]||(e[3]=v("span",null,"Overrides",-1)),a(o)]),_:1}),v("div",Ru,[a(g,null,{default:c(()=>[a(p,{class:"ma-1"},{default:c(()=>[a(u,{onClick:r.clearOverrides,color:"primary","data-test":"overrides-dialog-clear-all"},{default:c(()=>e[4]||(e[4]=[x(" Clear All Overrides ")])),_:1},8,["onClick"]),a(o),a(d,{modelValue:s.search,"onUpdate:modelValue":e[0]||(e[0]=O=>s.search=O),label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":""},null,8,["modelValue"])]),_:1}),a(y,{headers:s.headers,items:s.overrides,search:s.search,"items-per-page-options":[100],"multi-sort":"",density:"compact"},{"item.delete":c(({item:O})=>[a(b,{location:"top"},{activator:c(({props:D})=>[a(m,re({onClick:B=>r.deleteOverride(O)},D),{default:c(()=>e[5]||(e[5]=[x(" mdi-delete ")])),_:2},1040,["onClick"])]),default:c(()=>[e[6]||(e[6]=v("span",null,"Delete Override",-1))]),_:2},1024)]),_:1},8,["headers","items","search"])]),_:1})]),a(f,{class:"px-2"},{default:c(()=>[a(o),a(u,{variant:"flat",onClick:e[1]||(e[1]=O=>r.show=!r.show),"data-test":"overrides-dialog-ok"},{default:c(()=>e[7]||(e[7]=[x(" Ok ")])),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])}const Au=ae(Tu,[["render",Du]]),Pu={props:{title:{type:String,default:"Prompt Dialog"},subtitle:{type:String,default:""},message:{type:String,required:!0},details:{type:String,default:""},buttons:{type:Array,default:()=>[]},layout:{type:String,default:"horizontal"},multiple:{type:Boolean,default:!1,required:!1},modelValue:Boolean},data(){return{selectOkDisabled:!0,selectedItem:null}},computed:{show:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}},layoutClass(){let t="px-2 d-flex align-start";return this.layout==="vertical"?`${t} flex-column`:`${t} flex-row`}},methods:{submitWrapper:function(t){this.selectedItem=t,this.submitHandler()},submitHandler:function(){this.$emit("response",this.selectedItem)},cancelHandler:function(){this.$emit("response","Cancel")}}},Vu=["textContent"],Mu={class:"pa-2"},Uu=["textContent"],Nu=["textContent"],Fu={key:0},zu={key:1};function Iu(t,e,n,i,s,r){const o=h("v-spacer"),l=h("v-toolbar"),u=h("v-card-subtitle"),d=h("v-row"),p=h("v-card-text"),m=h("v-select"),b=h("v-btn"),y=h("v-card-actions"),g=h("v-card"),f=h("v-dialog");return k(),P(f,{persistent:"",modelValue:r.show,"onUpdate:modelValue":e[2]||(e[2]=S=>r.show=S),width:"600"},{default:c(()=>[a(g,null,{default:c(()=>[a(l,{height:"24"},{default:c(()=>[a(o),v("span",{class:"text",textContent:F(n.title)},null,8,Vu),a(o)]),_:1}),v("div",Mu,[a(p,{class:"text"},{default:c(()=>[n.subtitle?(k(),P(d,{key:0},{default:c(()=>[a(u,null,{default:c(()=>[x(F(n.subtitle),1)]),_:1})]),_:1})):z("",!0),a(d,{class:"mt-1"},{default:c(()=>[v("span",{textContent:F(n.message)},null,8,Uu)]),_:1}),n.details?(k(),P(d,{key:1,class:"mt-1"},{default:c(()=>[v("span",{textContent:F(n.details)},null,8,Nu)]),_:1})):z("",!0)]),_:1})]),n.layout==="combo"?(k(),A("div",Fu,[a(d,{class:"ma-2"},{default:c(()=>[a(m,{"onUpdate:modelValue":[e[0]||(e[0]=S=>s.selectOkDisabled=!1),e[1]||(e[1]=S=>s.selectedItem=S)],modelValue:s.selectedItem,label:"Select",color:"secondary",class:"ma-1","data-test":"prompt-select",items:n.buttons,multiple:n.multiple===!0},null,8,["modelValue","items","multiple"])]),_:1}),a(y,{class:"px-2"},{default:c(()=>[a(o),a(b,{onClick:r.cancelHandler,variant:"outlined","data-test":"prompt-cancel"},{default:c(()=>e[3]||(e[3]=[x(" Cancel ")])),_:1},8,["onClick"]),a(b,{variant:"flat",onClick:r.submitHandler,"data-test":"prompt-ok",disabled:s.selectOkDisabled},{default:c(()=>e[4]||(e[4]=[x(" Ok ")])),_:1},8,["onClick","disabled"])]),_:1})])):(k(),A("div",zu,[a(y,{class:zt(r.layoutClass)},{default:c(()=>[a(o),a(b,{onClick:r.cancelHandler,variant:"outlined","data-test":"prompt-cancel"},{default:c(()=>e[5]||(e[5]=[x(" Cancel ")])),_:1},8,["onClick"]),(k(!0),A(ne,null,le(n.buttons,(S,T)=>(k(),A("div",{key:T},[a(b,{variant:"flat",onClick:O=>r.submitWrapper(S.value),"data-test":`prompt-${S.text}`},{default:c(()=>[x(F(S.text),1)]),_:2},1032,["onClick","data-test"])]))),128))]),_:1},8,["class"])]))]),_:1})]),_:1},8,["modelValue"])}const Lu=ae(Pu,[["render",Iu],["__scopeId","data-v-b04397fe"]]),Bu={components:{},props:{modelValue:{type:Boolean,required:!0},text:{type:String,required:!0}},computed:{show:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}},mounted(){setTimeout(()=>{this.$refs.okButton.$el.focus()})},methods:{downloadResults(){const t=new Blob([this.text],{type:"text/plain"}),e=document.createElement("a");e.href=URL.createObjectURL(t),e.setAttribute("download",Ge(Date.now(),"yyyy_MM_dd_HH_mm_ss")+"_suite_results.txt"),e.click()}}},qu={class:"pa-2"};function ju(t,e,n,i,s,r){const o=h("v-spacer"),l=h("v-toolbar"),u=h("v-textarea"),d=h("v-card-text"),p=h("v-btn"),m=h("v-card-actions"),b=h("v-card"),y=h("v-dialog");return k(),P(y,{modelValue:r.show,"onUpdate:modelValue":e[1]||(e[1]=g=>r.show=g),scrollable:"",width:"800"},{default:c(()=>[a(b,null,{default:c(()=>[a(l,{height:"24"},{default:c(()=>[a(o),e[2]||(e[2]=v("span",null," Script Results ",-1)),a(o)]),_:1}),v("div",qu,[a(d,{style:{width:"100%","max-height":"80vh",overflow:"auto"}},{default:c(()=>[a(u,{readonly:"","hide-details":"",density:"compact","auto-grow":"","model-value":n.text},null,8,["model-value"])]),_:1})]),a(m,{class:"px-2"},{default:c(()=>[a(o),a(p,{variant:"outlined",onClick:r.downloadResults},{default:c(()=>e[3]||(e[3]=[x(" Download ")])),_:1},8,["onClick"]),a(p,{variant:"flat",onClick:e[0]||(e[0]=g=>r.show=!r.show),ref:"okButton"},{default:c(()=>e[4]||(e[4]=[x(" Ok ")])),_:1},512)]),_:1})]),_:1})]),_:1},8,["modelValue"])}const Hu=ae(Bu,[["render",ju]]),$u={components:{EnvironmentChooser:Bn},props:{modelValue:{type:Boolean,required:!0},inputEnvironment:{type:Array,required:!0}},data(){return{selected:[]}},mounted:function(){this.loadEnvironment()},computed:{show:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}},methods:{loadEnvironment:function(){this.selected=[...this.inputEnvironment]},updateEnvironment:function(){this.$emit("environment",this.selected),this.show=!this.show},cancel:function(){this.show=!this.show}}},Wu={class:"pa-2"};function Gu(t,e,n,i,s,r){const o=h("v-spacer"),l=h("v-toolbar"),u=h("environment-chooser"),d=h("v-card-text"),p=h("v-btn"),m=h("v-card-actions"),b=h("v-card"),y=h("v-dialog");return k(),P(y,{modelValue:r.show,"onUpdate:modelValue":e[1]||(e[1]=g=>r.show=g),width:"600"},{default:c(()=>[a(b,null,{default:c(()=>[a(l,{height:"24"},{default:c(()=>[a(o),e[2]||(e[2]=v("span",null,"Script Environment Variables",-1)),a(o)]),_:1}),v("div",Wu,[a(d,null,{default:c(()=>[a(u,{modelValue:s.selected,"onUpdate:modelValue":e[0]||(e[0]=g=>s.selected=g)},null,8,["modelValue"])]),_:1})]),a(m,{class:"px-2"},{default:c(()=>[a(o),a(p,{onClick:r.cancel,variant:"outlined","data-test":"environment-dialog-cancel"},{default:c(()=>e[3]||(e[3]=[x(" Cancel ")])),_:1},8,["onClick"]),a(p,{onClick:r.updateEnvironment,variant:"flat","data-test":"environment-dialog-save",disabled:!!t.inputError},{default:c(()=>e[4]||(e[4]=[x(" Save ")])),_:1},8,["onClick","disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"])}const Ju=ae($u,[["render",Gu]]),Yu={props:{suiteMap:{type:Object,required:!0},disableButtons:{type:Boolean,required:!0},filename:{type:String,required:!0}},data(){return{suites:[],groups:[],scripts:[],suite:"",group:"",script:"",options:["pauseOnError","manual","continueAfterError"],userInfo:{}}},computed:{checkedManualTooltip(){return this.filename.endsWith(".py")?"Checked sets the RunningScript.manual variable to True":"Checked sets the $manual variable to true"},uncheckedManualTooltip(){return this.filename.endsWith(".py")?"Unchecked sets the RunningScript.manual variable to False":"Unchecked sets the $manual variable to false"},setupSuiteEnabled(){return!!(this.suite&&this.suiteMap[this.suite].setup)},teardownSuiteEnabled(){return!!(this.suite&&this.suiteMap[this.suite].teardown)},setupGroupEnabled(){return!!(this.suite&&this.group&&this.suiteMap[this.suite].groups[this.group].setup)},teardownGroupEnabled(){return!!(this.suite&&this.group&&this.suiteMap[this.suite].groups[this.group].teardown)},scriptNames(){return this.scripts.map(t=>({title:t.replace(/^(script_|test_)/,""),value:t}))}},created(){this.userInfo=JSON.parse(localStorage.script_runner__userinfo),this.initSuites(),this.$emit("loaded")},watch:{suiteMap:{handler:function(t,e){this.updateSuiteMap()},deep:!0}},methods:{updateSuiteMap(){this.suites=Object.keys(this.suiteMap),this.suiteMap[this.suite]==null||this.suiteMap[this.suite].groups[this.group]==null?this.initSuites():(this.groups=Object.keys(this.suiteMap[this.suite].groups),this.scripts=this.suiteMap[this.suite].groups[this.group].scripts)},initSuites(){this.suites=Object.keys(this.suiteMap),this.suiteChanged(this.suites[0])},suiteChanged(t){this.suite=t,this.group="",this.script="",this.groups=Object.keys(this.suiteMap[t].groups),this.groupChanged(this.groups[0])},groupChanged(t){this.group=t,this.script="",this.scripts=this.suiteMap[this.suite].groups[t].scripts,this.scriptChanged(this.scripts[0])},scriptChanged(t){this.script=t}}},Ku={id:"tr-container"};function Xu(t,e,n,i,s,r){const o=h("v-checkbox"),l=h("v-tooltip"),u=h("v-col"),d=h("v-row"),p=h("v-select"),m=h("v-btn");return k(),A("div",null,[v("div",Ku,[a(d,{"no-gutters":"",align:"center"},{default:c(()=>[a(u,{cols:"4"},{default:c(()=>[a(d,{"no-gutters":""},{default:c(()=>[a(u,{cols:"6"},{default:c(()=>[a(l,{location:"top"},{activator:c(({props:b})=>[v("div",G(J(b)),[a(o,{modelValue:s.options,"onUpdate:modelValue":e[0]||(e[0]=y=>s.options=y),label:"Pause on Error",value:"pauseOnError","hide-details":"","data-test":"pause-on-error"},null,8,["modelValue"])],16)]),default:c(()=>[e[16]||(e[16]=v("span",null,[x("Checked pauses the script when an error is encountered"),v("br"),x("Unchecked continues without user interaction")],-1))]),_:1})]),_:1}),a(u,{cols:"6"},{default:c(()=>[a(l,{location:"top"},{activator:c(({props:b})=>[v("div",G(J(b)),[a(o,{modelValue:s.options,"onUpdate:modelValue":e[1]||(e[1]=y=>s.options=y),label:"Manual",value:"manual","hide-details":"","data-test":"manual"},null,8,["modelValue"])],16)]),default:c(()=>[v("span",null,[x(F(r.checkedManualTooltip),1),e[17]||(e[17]=v("br",null,null,-1)),x(F(r.uncheckedManualTooltip),1)])]),_:1})]),_:1})]),_:1})]),_:1}),a(u,{cols:"8"},{default:c(()=>[a(d,{"no-gutters":"",justify:"end"},{default:c(()=>[a(u,{cols:"5"},{default:c(()=>[a(p,{label:"Suite:",class:"mb-2 mr-2","hide-details":"",density:"compact",variant:"outlined","onUpdate:modelValue":[r.suiteChanged,e[2]||(e[2]=b=>s.suite=b)],items:s.suites,modelValue:s.suite,"data-test":"select-suite"},null,8,["onUpdate:modelValue","items","modelValue"])]),_:1}),a(u,{cols:"auto"},{default:c(()=>[a(m,{color:"primary",class:"mr-2",disabled:n.disableButtons||!s.userInfo.execute,onClick:e[3]||(e[3]=b=>t.$emit("button",{method:"start",suite:s.suite,options:s.options})),"data-test":"start-suite"},{default:c(()=>e[18]||(e[18]=[x(" Start ")])),_:1},8,["disabled"]),a(m,{color:"primary",class:"mr-2",onClick:e[4]||(e[4]=b=>t.$emit("button",{method:"setup",suite:s.suite,options:s.options})),"data-test":"setup-suite",disabled:n.disableButtons||!r.setupSuiteEnabled||!s.userInfo.execute},{default:c(()=>e[19]||(e[19]=[x(" Setup ")])),_:1},8,["disabled"]),a(m,{color:"primary",onClick:e[5]||(e[5]=b=>t.$emit("button",{method:"teardown",suite:s.suite,options:s.options})),"data-test":"teardown-suite",disabled:n.disableButtons||!r.teardownSuiteEnabled||!s.userInfo.execute},{default:c(()=>e[20]||(e[20]=[x(" Teardown ")])),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1})]),_:1}),a(d,{"no-gutters":""},{default:c(()=>[a(u,{cols:"4"},{default:c(()=>[a(d,{"no-gutters":""},{default:c(()=>[a(u,{cols:"6"},{default:c(()=>[a(l,{location:"top"},{activator:c(({props:b})=>[v("div",G(J(b)),[a(o,{modelValue:s.options,"onUpdate:modelValue":e[6]||(e[6]=y=>s.options=y),label:"Continue after Error",value:"continueAfterError","hide-details":"","data-test":"continue-after-error"},null,8,["modelValue"])],16)]),default:c(()=>[e[21]||(e[21]=v("span",null,[x("Checked allows the script to continue when an error is encountered"),v("br"),x("Unchecked forces the current script to end")],-1))]),_:1})]),_:1}),a(u,{cols:"6"},{default:c(()=>[a(l,{location:"top"},{activator:c(({props:b})=>[v("div",G(J(b)),[a(o,{modelValue:s.options,"onUpdate:modelValue":e[7]||(e[7]=y=>s.options=y),label:"Loop",value:"loop","hide-details":"","data-test":"loop"},null,8,["modelValue"])],16)]),default:c(()=>[e[22]||(e[22]=v("span",null,[x("Checked continuously executes until explicitly stopped"),v("br"),x(" Unchecked executes only the started script(s)")],-1))]),_:1})]),_:1})]),_:1})]),_:1}),a(u,{cols:"8"},{default:c(()=>[a(d,{"no-gutters":"",justify:"end"},{default:c(()=>[a(u,{cols:"5"},{default:c(()=>[a(p,{label:"Group:",class:"mb-2 mr-2","hide-details":"",density:"compact",variant:"outlined","onUpdate:modelValue":[r.groupChanged,e[8]||(e[8]=b=>s.group=b)],items:s.groups,modelValue:s.group,"data-test":"select-group"},null,8,["onUpdate:modelValue","items","modelValue"])]),_:1}),a(u,{cols:"auto"},{default:c(()=>[a(m,{color:"primary",class:"mr-2",disabled:n.disableButtons||!s.userInfo.execute,onClick:e[9]||(e[9]=b=>t.$emit("button",{method:"start",suite:s.suite,group:s.group,options:s.options})),"data-test":"start-group"},{default:c(()=>e[23]||(e[23]=[x(" Start ")])),_:1},8,["disabled"]),a(m,{color:"primary",class:"mr-2",onClick:e[10]||(e[10]=b=>t.$emit("button",{method:"setup",suite:s.suite,group:s.group,options:s.options})),"data-test":"setup-group",disabled:n.disableButtons||!r.setupGroupEnabled||!s.userInfo.execute},{default:c(()=>e[24]||(e[24]=[x(" Setup ")])),_:1},8,["disabled"]),a(m,{color:"primary",onClick:e[11]||(e[11]=b=>t.$emit("button",{method:"teardown",suite:s.suite,group:s.group,options:s.options})),"data-test":"teardown-group",disabled:n.disableButtons||!r.teardownGroupEnabled||!s.userInfo.execute},{default:c(()=>e[25]||(e[25]=[x(" Teardown ")])),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1})]),_:1}),a(d,{"no-gutters":""},{default:c(()=>[a(u,{cols:"4"},{default:c(()=>[a(d,{"no-gutters":""},{default:c(()=>[a(u,{cols:"6"},{default:c(()=>[a(l,{location:"top"},{activator:c(({props:b})=>[v("div",G(J(b)),[a(o,{modelValue:s.options,"onUpdate:modelValue":e[12]||(e[12]=y=>s.options=y),label:"Abort after Error",value:"abortAfterError","hide-details":"","data-test":"abort-after-error"},null,8,["modelValue"])],16)]),default:c(()=>[e[26]||(e[26]=v("span",null,[x("Checked stops additional script execution when an error is encountered"),v("br"),x(" Unchecked allows additional scripts to execute")],-1))]),_:1})]),_:1}),a(u,{cols:"6"},{default:c(()=>[a(l,{location:"top"},{activator:c(({props:b})=>[v("div",G(J(b)),[a(o,{disabled:!s.options.includes("loop"),modelValue:s.options,"onUpdate:modelValue":e[13]||(e[13]=y=>s.options=y),label:"Break Loop on Error",value:"breakLoopOnError","hide-details":"","data-test":"break-loop-on-error"},null,8,["disabled","modelValue"])],16)]),default:c(()=>[e[27]||(e[27]=v("span",null,[x("Checked breaks the loop option when an error is encountered"),v("br"),x(" Unchecked allows the loop to run continuously"),v("br"),x(" Note: Abort after Error still breaks the loop")],-1))]),_:1})]),_:1})]),_:1})]),_:1}),a(u,{cols:"8"},{default:c(()=>[a(d,{"no-gutters":"",justify:"end"},{default:c(()=>[a(u,{cols:"5"},{default:c(()=>[a(p,{label:"Script:",class:"mb-2 mr-2","hide-details":"",density:"compact",variant:"outlined","onUpdate:modelValue":[r.scriptChanged,e[14]||(e[14]=b=>s.script=b)],items:r.scriptNames,"item-title":"title","item-value":"value",modelValue:s.script,"data-test":"select-script"},null,8,["onUpdate:modelValue","items","modelValue"])]),_:1}),a(u,{cols:"auto"},{default:c(()=>[a(m,{color:"primary",class:"mr-2",disabled:n.disableButtons||!s.userInfo.execute,onClick:e[15]||(e[15]=b=>t.$emit("button",{method:"start",suite:s.suite,group:s.group,script:s.script,options:s.options})),"data-test":"start-script"},{default:c(()=>e[28]||(e[28]=[x(" Start ")])),_:1},8,["disabled"]),a(m,{color:"primary",class:"mr-2 invisible"},{default:c(()=>e[29]||(e[29]=[x(" Setup ")])),_:1}),a(m,{color:"primary",class:"invisible"},{default:c(()=>e[30]||(e[30]=[x(" Teardown ")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1})])])}const Zu=ae(Yu,[["render",Xu],["__scopeId","data-v-40a2938d"]]),Qu={props:{modelValue:{type:Array,required:!0}},data(){return{search:"",headers:[{title:"Message",value:"message",sortable:!1}],messageOrderOptions:["Newest on Top","Newest on Bottom"],messageOrder:"Newest on Top"}},watch:{messageOrder:function(t,e){this.$emit("sort",t)}},computed:{messages:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}},methods:{messageClass(t){return t.match(/(CHECK|WAIT): .*(success|was within range.*) with value/)?"openc3-green":t.match(/(CHECK|WAIT): .*(failed|failed to be within range.*) with value/)?"openc3-red":""},downloadLog(){const t=this.messages.map(i=>i.message).join(`
|
13
|
+
`),e=new Blob([t],{type:"text/plain"}),n=document.createElement("a");n.href=URL.createObjectURL(e),n.setAttribute("download",Ge(Date.now(),"yyyy_MM_dd_HH_mm_ss")+"_sr_message_log.txt"),n.click()},clearLog:function(){this.$dialog.confirm("Are you sure you want to clear the log?",{okText:"Clear",cancelText:"Cancel"}).then(t=>{this.messages=[]}).catch(function(t){})}}};function ed(t,e,n,i,s,r){const o=h("v-btn"),l=h("v-tooltip"),u=h("v-spacer"),d=h("v-select"),p=h("v-text-field"),m=h("v-row"),b=h("v-card-title"),y=h("v-data-table"),g=h("v-card");return k(),A("div",null,[a(g,null,{default:c(()=>[a(b,null,{default:c(()=>[a(m,{class:"pt-2"},{default:c(()=>[a(l,{location:"top"},{activator:c(({props:f})=>[v("div",G(J(f)),[a(o,{icon:"mdi-download",variant:"text",class:"mx-2","data-test":"download-log",onClick:r.downloadLog},null,8,["onClick"])],16)]),default:c(()=>[e[2]||(e[2]=v("span",null," Download Log ",-1))]),_:1}),e[4]||(e[4]=x(" Script Messages ")),a(u),a(d,{density:"compact","hide-details":"",variant:"outlined",items:s.messageOrderOptions,modelValue:s.messageOrder,"onUpdate:modelValue":e[0]||(e[0]=f=>s.messageOrder=f),class:"mr-2",style:{"max-width":"200px"},"data-test":"message-order"},null,8,["items","modelValue"]),a(u),a(p,{modelValue:s.search,"onUpdate:modelValue":e[1]||(e[1]=f=>s.search=f),label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":"",class:"search","data-test":"search-messages"},null,8,["modelValue"]),a(l,{location:"top"},{activator:c(({props:f})=>[v("div",G(J(f)),[a(o,{icon:"mdi-delete",variant:"text",class:"mx-2","data-test":"clear-log",onClick:r.clearLog},null,8,["onClick"])],16)]),default:c(()=>[e[3]||(e[3]=v("span",null," Clear Log ",-1))]),_:1})]),_:1})]),_:1}),a(y,{id:"script-log-messages",style:{overflow:"auto"},headers:s.headers,items:r.messages,search:s.search,"items-per-page":-1,"hide-default-footer":"",density:"compact","data-test":"output-messages"},{"item.message":c(({item:f})=>[v("div",{class:zt(r.messageClass(f.message))},F(f.message),3)]),_:1},8,["headers","items","search"])]),_:1})])}const td=ae(Qu,[["render",ed]]),vn=t=>N.get(`/openc3-api/autocomplete/keywords/${t}`),nd=t=>N.get(`/openc3-api/autocomplete/data/${t}`),Ei=(t,e)=>t.reduce((n,i)=>{const s=e(i);return n[s]?n[s].push(i):n[s]=[i],n},{}),sd=t=>{const e="(^|[{\\(\\s])",n=`[\\s\\(]f?['"]`,i="(\\S+\\s?){0,3}";return new RegExp(`${e}${t}${n}${i}$`)};class Ci{constructor(e,n=()=>{},i=()=>{}){this.keywordExpressions=[],this.autocompleteData=[],vn(e).then(s=>{this.keywordExpressions=s.data.map(sd),i()}),nd(e).then(s=>{this.autocompleteData=s.data,n()})}getCompletions(e,n,i,s,r){let o=[];const l=n.doc.$lines[i.row].slice(0,i.column);this.keywordExpressions.some(u=>l.match(u))&&(o=this.autocompleteData),r(null,[...o])}}class id extends Ci{constructor(){super("cmd")}}class rd extends Ci{constructor(){super("tlm",()=>{this.groupedPacketData=this.autocompleteData.reduce((e,n)=>{const i=n.caption.match(/\S+\s\S+/)[0],s=n.snippet.replace(`${i} `,""),r={caption:s,snippet:s,meta:"item"};return e[i]?e[i].push(r):e[i]=[r],e},{}),this.packets=Object.keys(this.groupedPacketData).map(e=>({caption:e,snippet:e,meta:"packet"}))})}getCompletions(e,n,i,s,r){let o=[];const l=n.doc.$lines[i.row].slice(0,i.column);if(this.keywordExpressions.some(u=>l.match(u))){const u=Object.keys(this.groupedPacketData).find(d=>l.includes(d));u?o=this.groupedPacketData[u]:o=this.packets}r(null,o)}}const Oi=t=>{const e="(^|[{\\(\\s])",n="((\\s.+)|(\\(.+\\)))";return new RegExp(`${e}${t}${n}`)},od=/\{/,ad=/['"],\s?['"]/;class ld{constructor(){this.api=new wn,this.targets={},this.api.get_target_names().then(e=>{e.forEach(n=>{this.targets[n]={cmd:null,tlm:null}})}),this.cmdKeywordExpressions=[],vn("cmd").then(e=>{this.cmdKeywordExpressions=e.data.map(Oi)}),this.tlmKeywordExpressions=[],vn("tlm").then(e=>{this.tlmKeywordExpressions=e.data.map(Oi)})}async checkText(e){const{linesToCheck:n,linesToSkip:i}=e.split(`
|
14
|
+
`).reduce((r,o,l)=>{if(o=o.trim(),o.match(/^#/))return r;const u=this.cmdKeywordExpressions.reduce((S,T)=>S||o.match(T),null),d=this.tlmKeywordExpressions.reduce((S,T)=>S||o.match(T),null);if(!u&&!d)return r;let p=u||d,m=p.length;p=p[m-1];const b=p.substring(p.match(/[\(\s)]/).index+1).replace(/\)+.*$/,"");if(b.match(od))return r.linesToSkip.push(l+1),r;const y=!!b.match(ad),g=b.split(y?",":" ");if(g.length<2)return r;const f={target:g[0],packet:g[1]};if(d)f.item=g[2];else{const S=g.slice(2);y?f.params=S.map(T=>T.split("=>")[0]):f.params=S.filter((T,O)=>O%2)}for(const S in f)typeof f[S]=="string"?f[S]=f[S].replace(/['"]/g,"").trim():f[S]=f[S].map(T=>T.replace(/['"]/g,"").trim());return r.linesToCheck.push({line:o,mnemonic:f,lineNumber:l+1}),r},{linesToCheck:[],linesToSkip:[]}),s=await this._checkLines(n);return{skipped:i.sort(),problems:s.sort((r,o)=>r.lineNumber-o.lineNumber)}}async _checkLines(e){const n=[],i=Ei(e,s=>s.mnemonic.target);for(const s in i){if(!this.targets[s]){for(const o of i[s])n.push({...o,error:`Target "${s}" does not exist.`});continue}const r=Ei(i[s],o=>o.mnemonic.packet);for(const o in r)for(const l of r[o]){const u=l.mnemonic.item?"tlm":"cmd";if(!this.targets[s][u]){const p=l.mnemonic.item?"get_all_tlm":"get_all_cmds",m=await this.api[p](s);this.targets[s][u]=m.reduce((b,y)=>(b[y.packet_name]=y.items.map(g=>g.name),b),{})}const d=this.targets[s][u][o];if(!d){n.push({...l,error:`${u==="tlm"?"Packet":"Command"} "${s} ${o}" does not exist.`});continue}if(l.mnemonic.item){if(!d.some(p=>p===l.mnemonic.item)){n.push({...l,error:`Item "${s} ${o} ${l.mnemonic.item}" does not exist.`});continue}}else for(const p of l.mnemonic.params)if(!d.some(m=>m===p)){n.push({...l,error:`Command "${s} ${o}" param "${p}" does not exist.`});continue}}}return n}}class cd{constructor(e,{pattern:n,text:i,type:s}){ge(this,De);ge(this,tt);ge(this,nt);ge(this,st);ge(this,it);En(this,"refresh",()=>{const e=te(this,tt).session;te(this,Ft).call(this,e);const n={lines:e.doc.$lines,action:"insert",start:{row:0},end:{row:e.doc.$lines.length}};this.annotate(n,e)});En(this,"annotate",(e,n)=>{var i,s;if(e.lines.length>1)switch(e.action){case"insert":te(this,ot).call(this,n,e.start.row,e.lines.length-1);break;case"remove":te(this,ot).call(this,n,e.start.row+1,-e.lines.length+1);break}for(let r=e.start.row;r<=e.end.row;r++){let o=(s=(i=n.doc.$lines[r])==null?void 0:i.match(te(this,nt)))==null?void 0:s.index;o!==void 0?(o!==0&&(o+=1),te(this,Nt).call(this,n,{row:r,column:o,text:te(this,st),type:te(this,it),openc3Id:te(this,De)})):e.action==="remove"&&te(this,rt).call(this,n,r)}});ge(this,Nt,(e,n)=>{te(this,rt).call(this,e,n.row),e.setAnnotations([...e.getAnnotations(),n])});ge(this,rt,(e,n)=>{e.setAnnotations(e.getAnnotations().filter(i=>i.openc3Id!==te(this,De)||i.row!==n))});ge(this,ot,(e,n,i)=>{e.setAnnotations(e.getAnnotations().map(s=>(s.row>n&&(s.row+=i),s)))});ge(this,Ft,e=>{e.setAnnotations(e.getAnnotations().filter(n=>n.openc3Id!==te(this,De)))});Fe(this,De,`regexAnnotator-${Math.floor(Math.random()*1e7)}`),Fe(this,tt,e),Fe(this,nt,n),Fe(this,st,i),Fe(this,it,s)}}De=new WeakMap,tt=new WeakMap,nt=new WeakMap,st=new WeakMap,it=new WeakMap,Nt=new WeakMap,rt=new WeakMap,ot=new WeakMap,Ft=new WeakMap;class ud extends cd{constructor(e){const n="(^|[{\\s])",i="sleep",s="[\\(\\s]";super(e,{pattern:new RegExp(`${n}${i}${s}`),text:"Use `wait` instead of `sleep` in OpenC3 scripts",type:"warning"})}}const dd={props:{tabId:Number,curTab:Number,connectInNewTab:Boolean},components:{OutputDialog:Ni},data(){return{downloadScript:null,runningSearch:"",runningScripts:[],runningHeaders:[{title:"Connect",key:"connect",sortable:!1,filterable:!1},{title:"Id",key:"id"},{title:"User",key:"user"},{title:"Name",key:"name"},{title:"Start Time",key:"start_time"},{title:"Stop",key:"stop",sortable:!1,filterable:!1},{title:"Force Quit",key:"delete",sortable:!1,filterable:!1}],completedSearch:"",completedScripts:[],completedHeaders:[{title:"Id",value:"id"},{title:"User",value:"user"},{title:"Name",value:"name"},{title:"Start Time",value:"start"},{title:"View",value:"view",sortable:!1,filterable:!1},{title:"Download",key:"download",sortable:!1,filterable:!1}],showDialog:!1,dialogName:"",dialogContent:"",dialogFilename:""}},created(){this.getRunningScripts(),this.getCompletedScripts()},methods:{getRunningScripts:function(){N.get("/script-api/running-script").then(t=>{this.runningScripts=t.data})},getCompletedScripts:function(){N.get("/script-api/completed-scripts").then(t=>{this.completedScripts=t.data})},connectScript:function(t){this.$emit("disconnect");const e={name:"ScriptRunner",params:{id:t.id}};if(this.connectInNewTab){let{href:n}=this.$router.resolve(e);window.open(n,"_blank")}else this.$router.push(e),this.$emit("close")},stopScript:function(t){this.$dialog.confirm(`Are you sure you want to stop script: ${t.id} ${t.name}?`,{okText:"Stop",cancelText:"Cancel"}).then(e=>N.post(`/script-api/running-script/${t.id}/stop`)).then(e=>{this.$notify.normal({body:`Stopped script: ${t.id} ${t.name}`}),this.getRunningScripts()}).catch(e=>{e!==!0&&this.$notify.caution({body:`Failed to stop script: ${t.id} ${t.name}`})})},deleteScript:function(t){this.$dialog.confirm(`Are you sure you want to force quit script: ${t.id} ${t.name}?
|
15
|
+
Did you try to stop the script first to allow the script to stop gracefully?`,{okText:"Force Quit",cancelText:"Cancel"}).then(e=>N.post(`/script-api/running-script/${t.id}/delete`)).then(e=>{this.$notify.normal({body:`Stopped script: ${t.id} ${t.name}`}),this.getRunningScripts()}).catch(e=>{e!==!0&&this.$notify.caution({body:`Failed to stop script: ${t.id} ${t.name}`})})},viewScriptLog:function(t){t.name.includes("(")&&t.name.includes(")")?this.dialogName="Report":this.dialogName="Log",N.get(`/openc3-api/storage/download_file/${encodeURIComponent(t.log)}?bucket=OPENC3_LOGS_BUCKET`).then(e=>{const n=t.log.split("/");this.dialogFilename=n[n.length-1],this.dialogContent=window.atob(e.data.contents),this.showDialog=!0})},downloadScriptLog:function(t){this.downloadScript=t,N.get(`/openc3-api/storage/download/${encodeURIComponent(t.log)}?bucket=OPENC3_LOGS_BUCKET`).then(e=>{const n=t.log.split("/"),i=n[n.length-1],s=document.createElement("a");s.href=e.data.url,s.setAttribute("download",i),s.click(),this.downloadScript=null}).catch(()=>{this.$notify.caution({title:`Unable to download log for ${t.name}`,body:`You may be able to download this log manually from the 'logs' bucket at ${t.log}`})})}}},pd={key:0},hd={key:1},md={key:0},fd={key:1};function gd(t,e,n,i,s,r){const o=h("v-spacer"),l=h("v-btn"),u=h("v-text-field"),d=h("v-row"),p=h("v-card-title"),m=h("v-icon"),b=h("v-data-table"),y=h("v-card"),g=h("output-dialog");return k(),A("div",null,[a(y,{flat:""},{default:c(()=>[a(p,null,{default:c(()=>[a(d,{dense:""},{default:c(()=>[e[5]||(e[5]=v("span",{class:"mr-2"},"Running Scripts",-1)),a(o),a(l,{class:"mr-2",color:"primary",onClick:r.getRunningScripts},{default:c(()=>e[4]||(e[4]=[x("Refresh")])),_:1},8,["onClick"]),a(o),a(u,{modelValue:s.runningSearch,"onUpdate:modelValue":e[0]||(e[0]=f=>s.runningSearch=f),class:"pt-0 search",label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":"","data-test":"running-search"},null,8,["modelValue"])]),_:1})]),_:1}),a(b,{headers:s.runningHeaders,items:s.runningScripts,search:s.runningSearch,density:"compact","data-test":"running-scripts","items-per-page-options":[3],"max-height":"400"},{"item.connect":c(({item:f})=>[a(l,{color:"primary",onClick:S=>r.connectScript(f)},{default:c(()=>[e[7]||(e[7]=v("span",null,"Connect",-1)),ve(a(m,{end:""},{default:c(()=>e[6]||(e[6]=[x(" mdi-open-in-new ")])),_:1},512),[[Se,n.connectInNewTab]])]),_:2},1032,["onClick"])]),"item.stop":c(({item:f})=>[a(l,{color:"primary",onClick:S=>r.stopScript(f)},{default:c(()=>[e[9]||(e[9]=v("span",null,"Stop",-1)),a(m,{end:""},{default:c(()=>e[8]||(e[8]=[x(" mdi-close-circle-outline ")])),_:1})]),_:2},1032,["onClick"])]),"item.delete":c(({item:f})=>[a(l,{color:"primary",onClick:S=>r.deleteScript(f)},{default:c(()=>[e[11]||(e[11]=v("span",null,"Delete",-1)),a(m,{end:""},{default:c(()=>e[10]||(e[10]=[x(" mdi-alert-octagon-outline ")])),_:1})]),_:2},1032,["onClick"])]),_:1},8,["headers","items","search"])]),_:1}),a(y,{flat:""},{default:c(()=>[a(p,null,{default:c(()=>[a(d,{dense:""},{default:c(()=>[e[13]||(e[13]=v("span",{class:"mr-2"},"Completed Scripts",-1)),a(o),a(l,{color:"primary",onClick:r.getCompletedScripts},{default:c(()=>e[12]||(e[12]=[x("Refresh")])),_:1},8,["onClick"]),a(o),a(u,{modelValue:s.completedSearch,"onUpdate:modelValue":e[1]||(e[1]=f=>s.completedSearch=f),class:"pt-0 search",label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":""},null,8,["modelValue"])]),_:1})]),_:1}),a(b,{headers:s.completedHeaders,items:s.completedScripts,search:s.completedSearch,density:"compact","data-test":"completed-scripts","items-per-page-options":[5]},{"item.view":c(({item:f})=>[a(l,{color:"primary",onClick:S=>r.viewScriptLog(f)},{default:c(()=>[f.name.includes("(")&&f.name.includes(")")?(k(),A("span",pd," Script Report ")):(k(),A("span",hd," Script Log ")),a(m,{right:""},{default:c(()=>e[14]||(e[14]=[x(" mdi-eye ")])),_:1})]),_:2},1032,["onClick"])]),"item.download":c(({item:f})=>[a(l,{disabled:s.downloadScript,loading:s.downloadScript&&s.downloadScript.name===f.name,onClick:S=>r.downloadScriptLog(f)},{loader:c(()=>e[16]||(e[16]=[v("span",null," Loading... ",-1)])),default:c(()=>[f.name.includes("(")&&f.name.includes(")")?(k(),A("span",md," Script Report ")):(k(),A("span",fd," Script Log ")),a(m,{end:""},{default:c(()=>e[15]||(e[15]=[x(" mdi-file-download-outline ")])),_:1})]),_:2},1032,["disabled","loading","onClick"])]),_:1},8,["headers","items","search"])]),_:1}),s.showDialog?(k(),P(g,{key:0,content:s.dialogContent,type:"Script",name:s.dialogName,filename:s.dialogFilename,modelValue:s.showDialog,"onUpdate:modelValue":e[2]||(e[2]=f=>s.showDialog=f),onSubmit:e[3]||(e[3]=f=>s.showDialog=!1)},null,8,["content","name","filename","modelValue"])):z("",!0)])}const bd=ae(dd,[["render",gd]]),Sn="__TEMP__",fe="<Untitled>",kn="Start",yd="Go",et="Pause",wd="Retry",_d={components:{FileOpenSaveDialog:Mn,Openc3Screen:Un,EnvironmentDialog:Nn,Splitpanes:Oa,Pane:Aa,TopBar:Zi,AskDialog:fu,FileDialog:vu,InformationDialog:Ou,EventListDialog:uu,OverridesDialog:Au,PromptDialog:Lu,ResultsDialog:Hu,ScriptEnvironmentDialog:Ju,SimpleTextDialog:Ji,SuiteRunner:Zu,RunningScripts:bd,ScriptLogMessages:td,CriticalCmdDialog:In},mixins:[Ln],data(){return{title:"Script Runner",suiteRunner:!1,disableSuiteButtons:!1,suiteMap:{},filenameSelect:null,currentFilename:null,showSave:!1,showAlert:!1,alertType:null,alertText:"",state:null,scriptId:null,startOrGoButton:kn,startOrGoDisabled:!1,envDisabled:!1,pauseOrRetryButton:et,pauseOrRetryDisabled:!1,stopDisabled:!1,showEnvironment:!1,showDebug:!1,debug:"",debugHistory:[],debugHistoryIndex:0,showDisconnect:!1,files:{},breakpoints:{},enableStackTraces:!1,filename:fe,readOnlyUser:!1,executeUser:!0,saveAllowed:!0,tempFilename:null,fileModified:"",fileOpen:!1,lockedBy:null,showEditingToast:!1,showSaveAs:!1,areYouSure:!1,subscription:null,cable:null,fatal:!1,updateInterval:null,receivedEvents:[],messages:[],messagesNewestOnTop:!0,maxArrayLength:200,Range:ace.require("ace/range").Range,ask:{show:!1,question:"",default:null,password:!1,answerRequired:!0,callback:()=>{}},file:{show:!1,message:"",directory:null,filter:"*",multiple:!1,callback:()=>{}},prompt:{show:!1,title:"",subtitle:"",message:"",details:"",buttons:null,layout:"horizontal",callback:()=>{}},information:{show:!1,title:"",text:[],width:"600"},inputMetadata:{show:!1,events:[],callback:()=>{}},results:{show:!1,text:""},scriptEnvironment:{show:!1,env:[]},showSuiteError:!1,suiteError:"",executeSelectionMenu:!1,menuX:0,menuY:0,mnemonicChecker:new ld,showScripts:!1,showOverrides:!1,activePromptId:"",api:null,timeZone:"local",screens:[],screenKeywords:null,idCounter:0,updateCounter:0,recent:[],waitingInterval:null,waitingTime:0,waitingStart:0,criticalCmdUuid:null,criticalCmdString:null,criticalCmdUser:null,displayCriticalCmd:!1}},computed:{stateTimer:function(){return this.state==="waiting"||this.state==="paused"?`${this.state} ${this.waitingTime}s`:this.state},fileList:function(){const t=Object.keys(this.files);return t.push(this.fullFilename),[...new Set(t)]},environmentIcon:function(){return this.scriptEnvironment.env.length>0?"mdi-bookmark":"mdi-bookmark-outline"},environmentIconColor:function(){return this.scriptEnvironment.env.length>0?"primary":""},isLocked:function(){return!!this.lockedBy},fullFilename:function(){return this.currentFilename?this.currentFilename:this.filename===fe?fe:`${this.filename} ${this.fileModified}`.trim()},filenameOrBlank:function(){return this.filename===fe?"":this.filename},menus:function(){return[{label:"File",items:[{label:"New File",icon:"mdi-file-plus",disabled:this.scriptId||this.readOnlyUser,command:()=>{this.newFile()}},{label:"New Suite",icon:"mdi-file-document-plus",disabled:this.scriptId||this.readOnlyUser,subMenu:[{label:"Ruby",icon:"mdi-language-ruby",command:()=>{this.newRubyTestSuite()}},{label:"Python",icon:"mdi-language-python",command:()=>{this.newPythonTestSuite()}}]},{label:"Open File",icon:"mdi-folder-open",disabled:this.scriptId,command:()=>{this.openFile()}},{label:"Open Recent",icon:"mdi-folder-open",disabled:this.scriptId,subMenu:this.recent},{divider:!0},{label:"Save File",icon:"mdi-content-save",disabled:this.scriptId||this.readOnlyUser,command:()=>{this.saveFile()}},{label:"Save As...",icon:"mdi-content-save",disabled:this.scriptId||this.readOnlyUser,command:()=>{this.saveAs()}},{divider:!0},{label:"Download",icon:"mdi-cloud-download",disabled:this.scriptId,command:()=>{this.download()}},{divider:!0},{label:"Delete File",icon:"mdi-delete",disabled:this.scriptId||this.readOnlyUser,command:()=>{this.delete()}}]},{label:"Edit",items:[{label:"Find",icon:"mdi-magnify",command:()=>{this.editor.execCommand("find")}},{label:"Replace",icon:"mdi-find-replace",disabled:this.scriptId,command:()=>{this.editor.execCommand("replace")}},{label:"Set Line Delay",icon:"mdi-invoice-text-clock",disabled:this.scriptId,command:()=>{this.$dialog.open({title:"Info",text:"You can set the line delay in seconds using the api method set_line_delay().<br/><br/>The default line delay is 0.1 seconds between lines. Adding set_line_delay(0) to the top of your script will execute the script at maximum speed. However, this can make it difficult to see and pause the script. Executing set_line_delay(1) will cause a 1 second delay between lines.",okText:"OK",okClass:"primary",validateText:null,cancelText:null,html:!0})}}]},{label:"Script",items:[{label:"Execution Status",icon:"mdi-run",command:()=>{this.showScripts=!0}},{divider:!0},{label:"Global Environment",icon:"mdi-library",disabled:this.scriptId,command:()=>{this.showEnvironment=!this.showEnvironment}},{label:"Metadata",icon:"mdi-calendar",disabled:this.scriptId,command:()=>{this.inputMetadata.callback=()=>{},this.showMetadata()}},{label:"Overrides",icon:"mdi-swap-horizontal",command:()=>{this.showOverrides=!0}},{divider:!0},{label:"Syntax Check",icon:"mdi-file-check",disabled:this.scriptId,command:()=>{this.syntaxCheck()}},{label:"Mnemonic Check",icon:"mdi-spellcheck",disabled:this.scriptId,command:()=>{this.checkMnemonics()}},{label:"Instrumented Script",icon:"mdi-code-braces-box",disabled:this.scriptId,command:()=>{this.showInstrumented()}},{label:"Call Stack",icon:"mdi-format-list-numbered",disabled:!this.scriptId,command:()=>{this.showCallStack()}},{divider:!0},{label:"Toggle Debug",icon:"mdi-bug",command:()=>{this.toggleDebug()}},{label:"Toggle Disconnect",icon:"mdi-connection",disabled:this.scriptId,command:()=>{this.toggleDisconnect()}},{label:"Enable Stack Traces",checkbox:!0,checked:this.enableStackTraces,disabled:this.scriptId,command:()=>{this.enableStackTraces=!this.enableStackTraces}},{divider:!0},{label:"Delete All Breakpoints",icon:"mdi-delete-circle-outline",disabled:this.scriptId,command:()=>{this.deleteAllBreakpoints()}}]}]},executeSelectionMenuItems:function(){return[{label:"Execute selection",command:this.executeSelection},{label:"Run from here",command:this.runFromCursor},{label:"Clear local breakpoints",command:this.clearBreakpoints}]}},watch:{isLocked:function(t){this.showEditingToast=t,this.suiteRunner||(this.startOrGoDisabled=t),this.readOnlyUser==!1&&t==!1?this.editor.setReadOnly(t):this.editor.setReadOnly(!0)},fullFilename:function(t){this.filenameSelect=t,t===fe?localStorage.removeItem("script_runner__filename"):localStorage.script_runner__filename=t}},created:async function(){this.api=new wn,this.api.ensure_offline_access(),this.api.get_setting("time_zone").then(n=>{n&&(this.timeZone=n)}).catch(n=>{}),this.NEW_FILENAME=fe,window.onbeforeunload=this.unlockFile;let t=OpenC3Auth.user(),e=OpenC3Auth.userroles();this.readOnlyUser=!0,this.executeUser=!1;for(let n of e)n!="viewer"&&(n=="admin"||n=="operator"?(this.readOnlyUser=!1,this.executeUser=!0):n=="runner"?this.executeUser=!0:await N.get(`/openc3-api/roles/${n}`).then(i=>{i.data!==null&&i.data.permissions!==void 0&&(i.data.permissions.some(s=>s.permission=="script_edit")&&(this.readOnlyUser=!1),i.data.permissions.some(s=>s.permission=="script_run")&&(this.executeUser=!0))}));if(localStorage.script_runner__userinfo=JSON.stringify({name:t.preferred_username,readOnly:this.readOnlyUser,execute:this.executeUser}),this.readOnlyUser==!0){this.alertType="info";let n=`User ${t.preferred_username} is read only`;this.executeUser&&(n+=" but can execute scripts"),this.alertText=n,this.showAlert=!0}N.get("/openc3-api/autocomplete/keywords/screen").then(n=>{this.screenKeywords=n.data})},mounted:async function(){var i,s;this.editor=ace.edit(this.$refs.editor),this.editor.setTheme("ace/theme/twilight");const t=this.buildRubyMode(),e=this.buildPythonMode();this.rubyMode=new t,this.pythonMode=new e,this.editor.session.setMode(this.rubyMode),this.editor.session.setTabSize(2),this.editor.session.setUseWrapMode(!0),this.editor.$blockScrolling=1/0,this.editor.setOption("enableBasicAutocompletion",!0),this.editor.setOption("enableLiveAutocompletion",!0),this.editor.completers=[new id,new rd],this.editor.setHighlightActiveLine(!1),this.editor.focus(),this.editor.on("guttermousedown",this.toggleBreakpoint),this.editor.session.on("tokenizerUpdate",this.onChange),this.readOnlyUser&&(this.editor.setReadOnly(!0),this.editor.renderer.$cursorLayer.element.style.display="none");const n=new ud(this.editor);this.editor.session.on("change",(r,o)=>{n.annotate(r,o),this.updateBreakpoints(r,o)}),this.editor.container.addEventListener("resize",this.doResize),this.editor.container.addEventListener("keydown",this.keydown),window.addEventListener("resize",this.calcHeight),this.calcHeight(),this.cable=new wc("/script-api/cable"),localStorage.script_runner__recent&&(this.recent=JSON.parse(localStorage.script_runner__recent),this.recent=this.recent.map(r=>({...r,command:async o=>{this.filename=o.label,await this.reloadFile()}}))),(i=this.$route.query)!=null&&i.file?(this.filename=this.$route.query.file,await this.reloadFile()):(s=this.$route.params)!=null&&s.id?await this.tryLoadRunningScript(this.$route.params.id):localStorage.script_runner__filename&&(this.filename=localStorage.script_runner__filename,await this.reloadFile(!1)),this.updateInterval=setInterval(async()=>{this.processReceived()},100)},beforeUnmount(){this.editor.destroy(),this.editor.container.remove()},unmounted(){this.unlockFile(),this.updateInterval!=null&&clearInterval(this.updateInterval),this.subscription&&(this.subscription.unsubscribe(),this.subscription=null),this.cable.disconnect()},beforeRouteUpdate:function(t,e,n){t.params.id?this.tryLoadRunningScript(t.params.id).then(n):n()},methods:{doResize(){this.editor.resize(),this.$nextTick(()=>{this.calcHeight()})},calcHeight(){const t=document.getElementsByClassName("editorbox")[0],e=Math.max(document.documentElement.offsetHeight,window.innerHeight||0);let n=0;t&&(n=t.offsetHeight);let i=0;const s=document.getElementsByClassName("suite-runner")[0];s&&(i=s.offsetHeight);let r=document.getElementById("script-log-messages");r&&(r.style.height=`${e-n-i}px`)},scriptDisconnect(){this.subscription&&(this.subscription.unsubscribe(),this.subscription=null),this.receivedEvents.length=0},showMetadata(){N.get("/openc3-api/metadata").then(t=>{this.inputMetadata.events=t.data.map(e=>({name:"Metadata",start:new Date(e.start*1e3),end:new Date(e.start*1e3),color:e.color,type:e.type,timed:!0,metadata:e})),this.inputMetadata.show=!0})},messageSortOrder(t){t==="Newest on Top"&&this.messagesNewestOnTop===!1?(this.messagesNewestOnTop=!0,this.messages.reverse()):t==="Newest on Bottom"&&this.messagesNewestOnTop===!0&&(this.messagesNewestOnTop=!1,this.messages.reverse())},fileNameChanged(t){t=t.split("*")[0],this.editor.setValue(this.files[t].content),this.restoreBreakpoints(t),this.editor.clearSelection(),this.removeAllMarkers(),this.editor.session.addMarker(new this.Range(this.files[t].lineNo-1,0,this.files[t].lineNo-1,1),`${this.state}Marker`,"fullLine"),this.editor.gotoLine(this.files[t].lineNo)},tryLoadRunningScript:function(t){return N.get("/script-api/running-script").then(e=>{const n=e.data.find(i=>`${i.id}`==`${t}`);n?(this.filename=n.name,this.tryLoadSuites(),this.initScriptStart(),this.scriptStart(n.id)):(this.$notify.caution({title:`Running Script ${t} not found`,body:"Check the Completed Scripts below ..."}),this.showScripts=!0)})},tryLoadSuites:function(){N.get(`/script-api/scripts/${this.filename}`).then(t=>{t.data.suites&&(this.startOrGoDisabled=!0,this.suiteRunner=!0,this.suiteMap=JSON.parse(t.data.suites)),t.data.error&&(this.suiteError=t.data.error,this.showSuiteError=!0),this.disableSuiteButtons=t.data.success==!1,this.doResize()})},showExecuteSelectionMenu:function(t){this.menuX=t.pageX,this.menuY=t.pageY,this.executeSelectionMenu=!0},runFromCursor:function(){const t=this.editor.getCursorPosition().row,e=this.editor.session.doc.getLines(t,this.editor.session.doc.getLength()).join(`
|
16
|
+
`),n=this.getBreakpointRows().filter(i=>i>=t).map(i=>i-t);this.executeText(e,n)},executeSelection:function(){const t=this.editor.getSelectedText(),e=this.editor.getSelectionRange(),n=this.getBreakpointRows().filter(i=>i<=e.end.row&&i>=e.start.row).map(i=>i-e.start.row);this.executeText(t,n)},async executeText(t,e=[]){let n=this.fullFilename.split(".").pop();n.includes(" *")&&(n=n.split(" *")[0]),n!=="rb"&&n!=="py"&&(n="rb");const i=Sn+"/"+Ge(Date.now(),"yyyy_MM_dd_HH_mm_ss_SSS")+`_temp.${n}`;await N.post(`/script-api/scripts/${i}`,{data:{text:t,breakpoints:e}}).then(s=>{let r=this.scriptEnvironment.env;return this.enableStackTraces&&(r=r.concat({key:"OPENC3_FULL_BACKTRACE",value:"1"})),N.post(`/script-api/scripts/${i}/run`,{data:{environment:r}})}).then(s=>{window.open(`/tools/scriptrunner/${s.data}`)})},clearBreakpoints:function(){this.editor.session.clearBreakpoints()},toggleBreakpoint:function(t){if(!this.scriptId){const e=t.getDocumentPosition().row;t.editor.session.getBreakpoints(e,0)[e]?t.editor.session.clearBreakpoint(e):t.editor.session.setBreakpoint(e)}},updateBreakpoints:function(t,e){if(t.lines.length<=1)return;const n=this.getBreakpointRows(e).filter(r=>t.start.column===0&&r===t.start.row||r>t.start.row);let i=[],s=0;switch(t.action){case"insert":s=t.lines.length-1,n.reverse();break;case"remove":s=-t.lines.length+1,i=[...Array(t.lines.length).keys()].map(r=>r+t.start.row);break}n.forEach(r=>{e.clearBreakpoint(r),i.includes(r)||e.setBreakpoint(r+s)})},getBreakpointRows:function(t=this.editor.session){return t.getBreakpoints().map((e,n)=>e&&n).filter(Number.isInteger)},restoreBreakpoints:function(t){var e;this.clearBreakpoints(),(e=this.breakpoints[t])==null||e.forEach(n=>{this.editor.session.setBreakpoint(n)})},deleteAllBreakpoints:function(){this.$dialog.confirm("Permanently delete all breakpoints for ALL scripts?",{okText:"Delete",cancelText:"Cancel"}).then(t=>N.delete("/script-api/breakpoints/delete/all")).then(t=>{this.clearBreakpoints()})},suiteRunnerButton(t){this.startOrGoButton===kn?this.start(t,"suiteRunner"):this.go(t,"suiteRunner")},async keydown(t){this.scriptId||this.editor.getReadOnly()===!0||(t.metaKey||t.ctrlKey)&&t.keyCode===83&&(t.shiftKey?(t.preventDefault(),this.saveAs()):(t.preventDefault(),await this.saveFile()))},onChange(t){this.scriptId||this.editor.getReadOnly()===!0||(this.editor.session.getUndoManager().canUndo()?this.fileModified="*":this.fileModified="")},checkMnemonics:function(){this.mnemonicChecker.checkText(this.editor.getValue()).then(({skipped:t,problems:e})=>{let n="";if(e.length){const i=e.map(s=>`${s.lineNumber}: ${s.error}`).join("<br/>");n+=`<strong>The following lines have problems:</strong><br/>${i}<br/><br/>`}t.length&&(n+="<strong>Mnemonics with string interpolation were not checked.</strong>"),n===""&&(n="<strong>Everything looks good!</strong>"),this.$dialog.alert(n.trim(),{html:!0})})},initScriptStart(){this.disableSuiteButtons=!0,this.startOrGoDisabled=!0,this.envDisabled=!0,this.pauseOrRetryDisabled=!0,this.stopDisabled=!0,this.state="Connecting...",this.startOrGoButton=yd,this.editor.setReadOnly(!0)},scriptStart(t){this.scriptId=t,this.cable.createSubscription("RunningScriptChannel",window.openc3Scope,{received:e=>this.received(e)},{id:this.scriptId}).then(e=>{this.subscription=e})},async scriptComplete(){this.state="stopped",this.fatal=!1,this.scriptId=null,this.currentFilename=null,this.files={},this.subscription&&(await this.subscription.unsubscribe(),this.subscription=null),this.receivedEvents.length=0,await this.reloadFile(),this.editor.session.getUndoManager().reset(),this.readOnlyUser==!1&&this.editor.setReadOnly(!1),this.disableSuiteButtons=!1,this.startOrGoButton=kn,this.pauseOrRetryButton=et,this.startOrGoDisabled=this.suiteRunner,this.envDisabled=!1,this.pauseOrRetryDisabled=!0,this.stopDisabled=!0},environmentHandler:function(t){this.scriptEnvironment.env=t},startHandler:function(){this.start()},async start(t,e=null){this.initScriptStart(),await this.saveFile("start"),this.saveAllowed=!1;let n=this.filename;this.filename===fe&&(n=this.tempFilename);let i=`/script-api/scripts/${n}/run`;this.showDisconnect&&(i+="/disconnect");let s=this.scriptEnvironment.env;this.enableStackTraces&&(s=s.concat({key:"OPENC3_FULL_BACKTRACE",value:"1"}));let r={environment:s};e&&(r.suiteRunner=t),N.post(i,{data:r}).then(o=>{this.scriptStart(o.data)}).catch(o=>{this.scriptComplete()})},go(){this.filenameSelect=this.currentFilename,this.fileNameChanged(this.currentFilename),N.post(`/script-api/running-script/${this.scriptId}/go`)},pauseOrRetry(){this.pauseOrRetryButton===et?N.post(`/script-api/running-script/${this.scriptId}/pause`):(this.pauseOrRetryButton=et,N.post(`/script-api/running-script/${this.scriptId}/retry`))},stop(){this.fatal?(this.removeAllMarkers(),this.scriptComplete()):N.post(`/script-api/running-script/${this.scriptId}/stop`)},step(){N.post(`/script-api/running-script/${this.scriptId}/step`)},handleWaiting(){if(this.state!=="waiting"&&this.state!=="paused")this.clearWaiting();else if(this.waitingInterval!==null)return;this.waitingStart=Date.now(),this.waitingInterval=setInterval(()=>{this.waitingTime=Math.round((Date.now()-this.waitingStart)/1e3)},1e3)},clearWaiting(){this.waitingTime=0,clearInterval(this.waitingInterval),this.waitingInterval=null},processLine(t){t.filename&&t.filename!==this.currentFilename&&(this.files[t.filename]?(this.currentFilename=t.filename,this.editor.setValue(this.files[t.filename].content),this.restoreBreakpoints(t.filename),this.editor.clearSelection()):(this.files[t.filename]={content:"",lineNo:0},N.get(`/script-api/scripts/${t.filename}`).then(n=>{this.files[t.filename]={content:n.data.contents,lineNo:0},this.breakpoints[t.filename]=n.data.breakpoints,this.restoreBreakpoints(t.filename),this.currentFilename=null}).catch(n=>{this.files[t.filename]=null}))),this.state=t.state;const e=this.editor.session.getMarkers();switch(this.state){case"running":this.handleWaiting(),this.startOrGoDisabled=!1,this.pauseOrRetryDisabled=!1,this.stopDisabled=!1,this.pauseOrRetryButton=et,this.removeAllMarkers(),this.editor.session.addMarker(new this.Range(t.line_no-1,0,t.line_no-1,1),"runningMarker","fullLine"),this.editor.gotoLine(t.line_no),this.files[t.filename].lineNo=t.line_no;break;case"fatal":this.fatal=!0;case"error":this.pauseOrRetryButton=wd;case"breakpoint":case"waiting":case"paused":if(this.handleWaiting(),this.state=="fatal"?(this.startOrGoDisabled=!0,this.pauseOrRetryDisabled=!0):(this.startOrGoDisabled=!1,this.pauseOrRetryDisabled=!1),this.stopDisabled=!1,Object.keys(e).filter(i=>e[i].clazz===`${this.state}Marker`).length===0){this.removeAllMarkers();let i=t.line_no>0?t.line_no:1;this.editor.session.addMarker(new this.Range(i-1,0,i-1,1),`${this.state}Marker`,"fullLine"),this.editor.gotoLine(i),t.filename&&(this.files[t.filename].lineNo=i)}break}},processReceived(){let t=0;for(let e of this.receivedEvents){t+=1;let n=0;switch(e.type){case"file":this.files[e.filename]={content:e.text,lineNo:0},this.breakpoints[e.filename]=e.breakpoints,this.currentFilename===e.filename&&this.restoreBreakpoints(e.filename);break;case"line":this.processLine(e);break;case"output":for(const o of e.line.split(`
|
17
|
+
`))o&&(this.messagesNewestOnTop?this.messages.unshift({message:o}):this.messages.push({message:o}));for(;this.messages.length>this.maxArrayLength;)this.messages.pop();break;case"script":this.handleScript(e);break;case"report":this.results.text=e.report,this.results.show=!0;break;case"complete":this.fatal||(this.removeAllMarkers(),this.scriptComplete());break;case"step":this.showDebug=!0;break;case"screen":let i=!1,s={};for(screen of this.screens){if(screen.target==e.target_name&&screen.screen==e.screen_name){s=screen,i=!0;break}n+=1}s.target=e.target_name,s.screen=e.screen_name,s.definition=e.definition,e.x?s.left=e.x:s.left=0,e.y?s.top=e.y:s.top=0,s.count=this.updateCounter++,i?this.screens[n]=s:(s.id=this.idCounter++,this.screens[this.screens.length]=s);break;case"clearscreen":for(screen of this.screens){if(screen.target==e.target_name&&screen.screen==e.screen_name){this.screens.splice(n,1);break}n+=1}break;case"clearallscreens":this.screens=[];break;case"downloadfile":const r=document.createElement("a");r.href=window.location.origin+e.url,r.setAttribute("download",e.filename),r.click();break}}this.receivedEvents.splice(0,t)},received(t){this.cable.recordPing(),this.receivedEvents.push(t)},promptDialogCallback(t){this.prompt.show=!1,N.post(`/script-api/running-script/${this.scriptId}/prompt`,{data:{method:this.prompt.method,answer:t,prompt_id:this.activePromptId,multiple:this.prompt.multiple}})},handleScript(t){if(t.prompt_complete){this.activePromptId="",this.prompt.show=!1,this.ask.show=!1;return}switch(this.activePromptId=t.prompt_id,this.prompt.method=t.method,this.prompt.layout="horizontal",this.prompt.title="Prompt",this.prompt.subtitle="",this.prompt.details="",this.prompt.buttons=[],this.prompt.multiple=null,t.method){case"ask":case"ask_string":this.ask.default=null,this.ask.answerRequired=!0,this.ask.password=!1,this.ask.question=t.args[0],t.args[1]&&t.args[1]!==!0&&t.args[1]!==!1?this.ask.default=t.args[1].toString():t.args[1]===!0&&(this.ask.answerRequired=!1),t.args[2]===!0&&(this.ask.password=!0),this.ask.callback=e=>{this.ask.show=!1,this.ask.password?N.post(`/script-api/running-script/${this.scriptId}/prompt`,{data:{method:t.method,password:e,prompt_id:this.activePromptId}}):N.post(`/script-api/running-script/${this.scriptId}/prompt`,{data:{method:t.method,answer:e,prompt_id:this.activePromptId}})},this.ask.show=!0;break;case"prompt_for_hazardous":this.prompt.title="Hazardous Command",this.prompt.message=`Warning: Command ${t.args[0]} ${t.args[1]} is Hazardous. `,t.args[2]&&(this.prompt.message+=t.args[2]+" "),this.prompt.message+="Send?",this.prompt.buttons=[{text:"Send",value:"Send"}],this.prompt.callback=this.promptDialogCallback,this.prompt.show=!0;break;case"prompt_for_critical_cmd":this.criticalCmdUuid=t.args[0],this.criticalCmdString=t.args[5],this.criticalCmdUser=t.args[1],this.displayCriticalCmd=!0;break;case"prompt":t.kwargs&&t.kwargs.informative&&(this.prompt.subtitle=t.kwargs.informative),t.kwargs&&t.kwargs.details&&(this.prompt.details=t.kwargs.details),this.prompt.message=t.args[0],this.prompt.buttons=[{text:"Ok",value:"Ok"}],this.prompt.callback=this.promptDialogCallback,this.prompt.show=!0;break;case"combo_box":t.kwargs&&t.kwargs.informative&&(this.prompt.subtitle=t.kwargs.informative),t.kwargs&&t.kwargs.details&&(this.prompt.details=t.kwargs.details),t.kwargs&&t.kwargs.multiple&&(this.prompt.multiple=!0),this.prompt.message=t.args[0],t.args.slice(1).forEach(e=>{this.prompt.buttons.push({title:e,value:e})}),this.prompt.layout="combo",this.prompt.callback=this.promptDialogCallback,this.prompt.show=!0;break;case"message_box":case"vertical_message_box":t.kwargs&&t.kwargs.informative&&(this.prompt.subtitle=t.kwargs.informative),t.kwargs&&t.kwargs.details&&(this.prompt.details=t.kwargs.details),this.prompt.message=t.args[0],t.args.slice(1).forEach(e=>{this.prompt.buttons.push({text:e,value:e})}),t.method.includes("vertical")&&(this.prompt.layout="vertical"),this.prompt.callback=this.promptDialogCallback,this.prompt.show=!0;break;case"backtrace":this.information.title="Call Stack",this.information.text=t.args,this.information.show=!0,this.information.width="600";break;case"metadata_input":this.inputMetadata.callback=e=>{this.inputMetadata.show=!1,N.post(`/script-api/running-script/${this.scriptId}/prompt`,{data:{method:t.method,answer:e,prompt_id:this.activePromptId}})},this.showMetadata();break;case"open_file_dialog":case"open_files_dialog":this.file.title=t.args[0],this.file.message=t.args[1],t.kwargs&&t.kwargs.filter&&(this.file.filter=t.kwargs.filter),t.method=="open_files_dialog"&&(this.file.multiple=!0),this.file.show=!0;break}},async fileDialogCallback(t){let e="Cancel",n=[];t!="Cancel"&&(e=[],t.forEach(i=>{e.push(i.name),n.push(N.get(`/openc3-api/storage/upload/${encodeURIComponent(`${window.openc3Scope}/tmp/${i.name}`)}?bucket=OPENC3_CONFIG_BUCKET`).then(s=>{n.push($({...s.data,data:i}))}))})),Promise.all(n).then(i=>{N.post(`/script-api/running-script/${this.scriptId}/prompt`,{data:{method:this.file.multiple?"open_files_dialog":"open_file_dialog",answer:e,prompt_id:this.activePromptId}}).then(s=>{this.file.show=!1})})},setError(t){this.alertType="error",this.alertText=`Error: ${t}`,this.showAlert=!0},newFile(){this.unlockFile(),this.filename=fe,this.currentFilename=null,this.tempFilename=null,this.files={},this.editor.session.setValue(""),this.saveAllowed=!0,this.fileModified="",this.suiteRunner=!1,this.startOrGoDisabled=!1,this.envDisabled=!1,this.$router.replace({name:"ScriptRunner"}).catch(t=>{}),document.title="Script Runner",this.doResize()},async newRubyTestSuite(){this.newFile(),this.editor.session.setValue(`require 'openc3/script/suite.rb'
|
18
|
+
|
19
|
+
# Group class name should indicate what the scripts are testing
|
20
|
+
class Power < OpenC3::Group
|
21
|
+
# Methods beginning with script_ are added to Script dropdown
|
22
|
+
def script_power_on
|
23
|
+
# Using OpenC3::Group.puts adds the output to the Test Report
|
24
|
+
# This can be useful for requirements verification, QA notes, etc
|
25
|
+
OpenC3::Group.puts "Verifying requirement SR-1"
|
26
|
+
configure()
|
27
|
+
end
|
28
|
+
|
29
|
+
# Other methods are not added to Script dropdown
|
30
|
+
def configure
|
31
|
+
end
|
32
|
+
|
33
|
+
def setup
|
34
|
+
# Run when Group Setup button is pressed
|
35
|
+
# Run before all scripts when Group Start is pressed
|
36
|
+
end
|
37
|
+
|
38
|
+
def teardown
|
39
|
+
# Run when Group Teardown button is pressed
|
40
|
+
# Run after all scripts when Group Start is pressed
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
class TestSuite < OpenC3::Suite
|
45
|
+
def initialize
|
46
|
+
add_group('Power')
|
47
|
+
end
|
48
|
+
def setup
|
49
|
+
# Run when Suite Setup button is pressed
|
50
|
+
# Run before all groups when Suite Start is pressed
|
51
|
+
end
|
52
|
+
def teardown
|
53
|
+
# Run when Suite Teardown button is pressed
|
54
|
+
# Run after all groups when Suite Start is pressed
|
55
|
+
end
|
56
|
+
end
|
57
|
+
`),await this.saveFile("auto")},async newPythonTestSuite(){this.newFile(),this.editor.session.setValue(`from openc3.script.suite import Suite, Group
|
58
|
+
|
59
|
+
# Group class name should indicate what the scripts are testing
|
60
|
+
class Power(Group):
|
61
|
+
# Methods beginning with script_ are added to Script dropdown
|
62
|
+
def script_power_on(self):
|
63
|
+
# Using Group.print adds the output to the Test Report
|
64
|
+
# This can be useful for requirements verification, QA notes, etc
|
65
|
+
Group.print("Verifying requirement SR-1")
|
66
|
+
self.configure()
|
67
|
+
|
68
|
+
# Other methods are not added to Script dropdown
|
69
|
+
def configure(self):
|
70
|
+
pass
|
71
|
+
|
72
|
+
def setup(self):
|
73
|
+
# Run when Group Setup button is pressed
|
74
|
+
# Run before all scripts when Group Start is pressed
|
75
|
+
pass
|
76
|
+
|
77
|
+
def teardown(self):
|
78
|
+
# Run when Group Teardown button is pressed
|
79
|
+
# Run after all scripts when Group Start is pressed
|
80
|
+
pass
|
81
|
+
|
82
|
+
class TestSuite(Suite):
|
83
|
+
def __init__(self):
|
84
|
+
self.add_group(Power)
|
85
|
+
|
86
|
+
def setup(self):
|
87
|
+
# Run when Suite Setup button is pressed
|
88
|
+
# Run before all groups when Suite Start is pressed
|
89
|
+
pass
|
90
|
+
|
91
|
+
def teardown(self):
|
92
|
+
# Run when Suite Teardown button is pressed
|
93
|
+
# Run after all groups when Suite Start is pressed
|
94
|
+
pass
|
95
|
+
`),await this.saveFile("auto")},addToRecent(t){let e=this.recent.findIndex(n=>n.label===t);e!==-1&&this.recent.splice(e,1),this.recent.unshift({label:t,icon:Fn(t),command:async n=>{this.filename=n.label,await this.reloadFile()}}),this.recent.length>8&&this.recent.pop(),localStorage.script_runner__recent=JSON.stringify(this.recent)},removeFromRecent(t){this.recent=this.recent.filter(e=>e.label!==t),localStorage.script_runner__recent=JSON.stringify(this.recent),localStorage.script_runner__filename===t&&localStorage.removeItem("script_runner__filename")},openFile(){this.fileOpen=!0},async reloadFile(t=!0){this.saveAllowed=!1,this.startOrGoDisabled=!0,await N.get(`/script-api/scripts/${this.filename}`,{headers:{Accept:"application/json","Ignore-Errors":"404"}}).then(e=>{const n={name:this.filename,contents:e.data.contents};e.data.suites&&(n.suites=JSON.parse(e.data.suites)),e.data.error&&(n.error=e.data.error),e.data.success&&(n.success=e.data.success);const i=e.data.locked,s=e.data.breakpoints;this.setFile({file:n,locked:i,breakpoints:s},!0),this.saveAllowed=!0}).catch(e=>{t===!0&&this.$notify.caution({title:"File Open Error",body:`Failed to open ${this.filename} due to ${e}`}),this.removeFromRecent(this.filename),this.newFile()})},setFile({file:t,locked:e,breakpoints:n},i=!1){this.files={};let s=t.name.split("*")[0];i===!1&&this.filename!==s&&(this.unlockFile(),this.lockedBy=e),this.filename=s,this.$router.replace({name:"ScriptRunner",query:{file:this.filename}}).catch(o=>{});let r=this.filename.split("/");document.title=`${r.pop()} (${r.join("/")})`,this.filename.split(".").pop()==="py"?this.editor.session.setMode(this.pythonMode):this.editor.session.setMode(this.rubyMode),this.currentFilename=null,this.editor.session.setValue(t.contents),this.breakpoints[filename]=n,this.restoreBreakpoints(filename),this.fileModified="",this.envDisabled=!1,this.addToRecent(this.filename),t.suites?(this.suiteRunner=!0,this.suiteMap=t.suites,this.startOrGoDisabled=!0):(this.suiteRunner=!1,this.startOrGoDisabled=!1),t.error&&(this.suiteError=t.error,this.showSuiteError=!0),this.disableSuiteButtons=t.success==!1,this.doResize()},clearTemp(){this.recent=this.recent.filter(t=>!t.label.includes("__TEMP__")),localStorage.script_runner__recent=JSON.stringify(this.recent)},detectLanguage(){let t=new RegExp("^\\s*(require|load|puts) "),e=new RegExp("^\\s*(import|from) "),n=new RegExp("^\\s*end\\s*$"),i=new RegExp("^\\s*(if|def|while|else|elif|class).*:\\s*$"),s=new RegExp('\\(f"'),o=this.editor.getValue().split(`
|
96
|
+
`);for(let l of o){if(l.match(t))return"ruby";if(l.match(e))return"python";if(l.match(n))return"ruby";if(l.match(i)||l.match(s))return"python"}return"unknown"},async saveFile(t="menu"){if(!this.readOnlyUser)if(this.saveAllowed){const e=this.getBreakpointRows();if(this.filename===fe){if(t==="menu"){this.saveAs();return}else if(this.tempFilename===null){let n=this.detectLanguage();if(n==="ruby"||t!=="auto"&&n=="unknown")this.tempFilename=Sn+"/"+Ge(Date.now(),"yyyy_MM_dd_HH_mm_ss_SSS")+"_temp.rb";else if(n==="python")this.tempFilename=Sn+"/"+Ge(Date.now(),"yyyy_MM_dd_HH_mm_ss_SSS")+"_temp.py";else return;this.filename=this.tempFilename,this.addToRecent(this.filename)}}this.showSave=!0,await N.post(`/script-api/scripts/${this.filename}`,{data:{text:this.editor.getValue(),breakpoints:e}}).then(n=>{n.status==200?(n.data.suites?(this.startOrGoDisabled=!0,this.suiteRunner=!0,this.suiteMap=JSON.parse(n.data.suites)):(this.startOrGoDisabled=!1,this.suiteRunner=!1,this.suiteMap={}),n.data.error&&(this.suiteError=n.data.error,this.showSuiteError=!0),this.fileModified="",setTimeout(()=>{this.showSave=!1},2e3)):(this.showSave=!1,this.alertType="error",this.alertText=`Error saving file. Code: ${n.status} Text: ${n.statusText}`,this.showAlert=!0),this.lockFile(),this.doResize()}).catch(({response:n})=>{this.showSave=!1,n.status==422?(this.alertType="error",this.alertText=n.data.suites):(this.alertType="error",this.alertText=`Error saving file. Code: ${n.status} Text: ${n.statusText}`),this.showAlert=!0})}else this.setError("Attempt to save file when not allowed")},saveAs(){this.showSaveAs=!0},async saveAsFilename(t){this.filename=t.split("*")[0],this.currentFilename=null,this.tempFilename&&(N.post(`/script-api/scripts/${this.tempFilename}/delete`),this.tempFilename=null),await this.saveFile("menu")},delete(){let t=this.filename;this.tempFilename&&(t=this.tempFilename),this.$dialog.confirm(`Permanently delete file: ${t}`,{okText:"Delete",cancelText:"Cancel"}).then(e=>N.post(`/script-api/scripts/${t}/delete`,{data:{}})).then(e=>{this.removeFromRecent(t),this.newFile()}).catch(e=>{if(e!==!0){const n={text:`Failed Multi-Delete. ${e}`,type:"error"};this.$emit("alert",n)}})},download(){const t=new Blob([this.editor.getValue()],{type:"text/plain"}),e=document.createElement("a");e.href=URL.createObjectURL(t),e.setAttribute("download",this.filename),e.click()},syntaxCheck(){N.post(`/script-api/scripts/${this.filename}/syntax`,{data:this.editor.getValue(),headers:{Accept:"application/json","Content-Type":"plain/text"}}).then(t=>{this.information.title=t.data.title,this.information.text=JSON.parse(t.data.description),this.information.show=!0,this.information.width="600"})},showInstrumented(){N.post(`/script-api/scripts/${this.filename}/instrumented`,{data:this.editor.getValue(),headers:{Accept:"application/json","Content-Type":"plain/text"}}).then(t=>{this.information.title=t.data.title,this.information.text=JSON.parse(t.data.description),this.information.show=!0,this.information.width="90vw"})},showCallStack(){N.post(`/script-api/running-script/${this.scriptId}/backtrace`)},toggleDebug(){this.showDebug=!this.showDebug,this.showDebug&&this.$nextTick(()=>{this.$refs.debug.focus()})},toggleDisconnect(){this.showDisconnect=!this.showDisconnect},debugKeydown(t){t.key==="Escape"?(this.debug="",this.debugHistoryIndex=this.debugHistory.length):t.key==="Enter"?(this.debugHistory.push(this.debug),this.debugHistoryIndex=this.debugHistory.length,N.post(`/script-api/running-script/${this.scriptId}/debug`,{data:{args:this.debug}}),this.debug=""):t.key==="ArrowUp"?(this.debugHistoryIndex-=1,this.debugHistoryIndex<0&&(this.debugHistoryIndex=this.debugHistory.length-1),this.debug=this.debugHistory[this.debugHistoryIndex],t.preventDefault()):t.key==="ArrowDown"&&(this.debugHistoryIndex+=1,this.debugHistoryIndex>=this.debugHistory.length&&(this.debugHistoryIndex=0),this.debug=this.debugHistory[this.debugHistoryIndex])},removeAllMarkers:function(){const t=this.editor.session.getMarkers();Object.keys(t).filter(e=>t[e].type==="fullLine").forEach(e=>this.editor.session.removeMarker(e))},confirmLocalUnlock:function(){this.$dialog.confirm("Are you sure you want to unlock this script for editing? If another user is editing this script, your changes might conflict with each other.",{okText:"Force Unlock",cancelText:"Cancel"}).then(()=>(this.lockedBy=null,this.lockFile()))},lockFile:function(){if(!this.readOnlyUser)return N.post(`/script-api/scripts/${this.filename}/lock`)},unlockFile:function(){this.filename!==fe&&!this.readOnly&&!this.readOnlyUser&&N.post(`/script-api/scripts/${this.filename}/unlock`)},screenId(t){return"scriptRunnerScreen"+t},closeScreen(t){let e=0;for(screen of this.screens){if(screen.id==t){this.screens.splice(e,1);break}e+=1}}}},vd={class:"grid"},Sd=["id"],kd={class:"item-content"},xd={id:"sr-controls"},Ed={key:2,style:{width:"40px",height:"40px"},class:"ml-2 mr-2"},Cd={key:3},Od={key:4},Td={key:0,id:"debug",class:"pa-0"};function Rd(t,e,n,i,s,r){const o=h("top-bar"),l=h("v-icon"),u=h("v-btn"),d=h("v-snackbar"),p=h("openc3-screen"),m=h("suite-runner"),b=h("v-tooltip"),y=h("v-select"),g=h("v-text-field"),f=h("v-progress-circular"),S=h("v-spacer"),T=h("v-row"),O=h("v-card"),D=h("v-list-item-title"),B=h("v-list-item"),E=h("v-list"),R=h("v-menu"),L=h("pane"),Z=h("script-log-messages"),_e=h("splitpanes"),Ti=h("file-open-save-dialog"),Dd=h("environment-dialog"),Ad=h("ask-dialog"),Pd=h("file-dialog"),Vd=h("information-dialog"),Md=h("event-list-dialog"),Ud=h("overrides-dialog"),Nd=h("prompt-dialog"),Fd=h("results-dialog"),zd=h("script-environment-dialog"),Id=h("simple-text-dialog"),Ld=h("critical-cmd-dialog"),Bd=h("running-scripts"),qd=h("v-sheet"),jd=h("v-bottom-sheet");return k(),A(ne,null,[a(o,{menus:r.menus,title:s.title},null,8,["menus","title"]),a(d,{modelValue:s.showAlert,"onUpdate:modelValue":e[1]||(e[1]=C=>s.showAlert=C),location:"top",color:s.alertType,timeout:3e3},{actions:c(({attrs:C})=>[a(u,re({variant:"text"},C,{onClick:e[0]||(e[0]=xn=>s.showAlert=!1)}),{default:c(()=>e[34]||(e[34]=[x(" Close ")])),_:2},1040)]),default:c(()=>[a(l,null,{default:c(()=>[x(" mdi-"+F(s.alertType),1)]),_:1}),x(" "+F(s.alertText)+" ",1)]),_:1},8,["modelValue","color"]),a(d,{modelValue:s.showEditingToast,"onUpdate:modelValue":e[3]||(e[3]=C=>s.showEditingToast=C),location:"top",timeout:-1,color:"orange"},{actions:c(({attrs:C})=>[a(u,re({variant:"text"},C,{color:"danger",onClick:r.confirmLocalUnlock,"data-test":"unlock-button"}),{default:c(()=>e[36]||(e[36]=[x(" Unlock ")])),_:2},1040,["onClick"]),a(u,re({variant:"text"},C,{onClick:e[2]||(e[2]=()=>{s.showEditingToast=!1})}),{default:c(()=>e[37]||(e[37]=[x(" dismiss ")])),_:2},1040)]),default:c(()=>[a(l,null,{default:c(()=>e[35]||(e[35]=[x(" mdi-pencil-off ")])),_:1}),x(" "+F(s.lockedBy)+" is editing this script. Editor is in read-only mode ",1)]),_:1},8,["modelValue"]),v("div",vd,[(k(!0),A(ne,null,le(s.screens,C=>(k(),A("div",{class:"item",key:C.id,id:r.screenId(C.id),ref_for:!0,ref:"gridItem"},[v("div",kd,[a(p,{target:C.target,screen:C.screen,definition:C.definition,keywords:s.screenKeywords,initialFloated:!0,initialTop:C.top,initialLeft:C.left,initialZ:3,minZ:3,fixFloated:!0,count:C.count,onCloseScreen:xn=>r.closeScreen(C.id),onDeleteScreen:xn=>r.closeScreen(C.id)},null,8,["target","screen","definition","keywords","initialTop","initialLeft","count","onCloseScreen","onDeleteScreen"])])],8,Sd))),128))]),a(O,{style:{padding:"10px"}},{default:c(()=>[s.suiteRunner?(k(),P(m,{key:0,class:"suite-runner","suite-map":s.suiteMap,"disable-buttons":s.disableSuiteButtons,filename:r.fullFilename,onButton:r.suiteRunnerButton,onLoaded:r.doResize},null,8,["suite-map","disable-buttons","filename","onButton","onLoaded"])):z("",!0),v("div",xd,[a(T,{"no-gutters":"",justify:"space-between"},{default:c(()=>[s.showDisconnect?(k(),P(l,{key:0,class:"mt-2",color:"red"},{default:c(()=>e[38]||(e[38]=[x(" mdi-connection ")])),_:1})):z("",!0),a(b,{location:"top"},{activator:c(({props:C})=>[a(u,re(C,{icon:"mdi-cached",variant:"text",onClick:r.reloadFile,disabled:s.filename===t.NEW_FILENAME}),null,16,["onClick","disabled"])]),default:c(()=>[e[39]||(e[39]=v("span",null," Reload File ",-1))]),_:1}),a(y,{modelValue:s.filenameSelect,"onUpdate:modelValue":[e[4]||(e[4]=C=>s.filenameSelect=C),r.fileNameChanged],items:r.fileList,disabled:r.fileList.length<=1,label:"Filename",id:"filename","data-test":"filename",style:{width:"300px"},density:"compact",variant:"outlined","hide-details":""},null,8,["modelValue","onUpdate:modelValue","items","disabled"]),a(g,{modelValue:s.scriptId,"onUpdate:modelValue":e[5]||(e[5]=C=>s.scriptId=C),label:"Script ID","data-test":"id",class:"shrink ml-2 script-state",style:{"max-width":"100px"},density:"compact",variant:"outlined",readonly:"","hide-details":""},null,8,["modelValue"]),a(g,{modelValue:r.stateTimer,"onUpdate:modelValue":e[6]||(e[6]=C=>r.stateTimer=C),label:"Script State","data-test":"state",class:"shrink ml-2 script-state",style:{"max-width":"120px"},density:"compact",variant:"outlined",readonly:"","hide-details":""},null,8,["modelValue"]),s.state==="Connecting..."?(k(),P(f,{key:1,size:40,class:"ml-2 mr-2",indeterminate:"",color:"primary"})):(k(),A("div",Ed)),a(S),s.startOrGoButton==="Start"?(k(),A("div",Cd,[a(u,{onClick:r.startHandler,class:"mx-1",color:"primary","data-test":"start-button",disabled:s.startOrGoDisabled||!s.executeUser,hidden:s.suiteRunner},{default:c(()=>e[40]||(e[40]=[v("span",null," Start ",-1)])),_:1},8,["onClick","disabled","hidden"]),a(b,{location:"top"},{activator:c(({props:C})=>[a(u,re(C,{onClick:e[7]||(e[7]=xn=>s.scriptEnvironment.show=!s.scriptEnvironment.show),class:"mx-1","data-test":"env-button",color:r.environmentIconColor,disabled:s.envDisabled}),{default:c(()=>[a(l,null,{default:c(()=>[x(F(r.environmentIcon),1)]),_:1})]),_:2},1040,["color","disabled"])]),default:c(()=>[e[41]||(e[41]=v("span",null,"Script Environment",-1))]),_:1})])):(k(),A("div",Od,[a(u,{onClick:r.go,color:"primary",class:"mr-2",disabled:s.startOrGoDisabled,"data-test":"go-button"},{default:c(()=>e[42]||(e[42]=[x(" Go ")])),_:1},8,["onClick","disabled"]),a(u,{color:"primary",onClick:r.pauseOrRetry,class:"mr-2",disabled:s.pauseOrRetryDisabled,"data-test":"pause-retry-button"},{default:c(()=>[x(F(s.pauseOrRetryButton),1)]),_:1},8,["onClick","disabled"]),a(u,{color:"primary",onClick:r.stop,"data-test":"stop-button",disabled:s.stopDisabled},{default:c(()=>e[43]||(e[43]=[x(" Stop ")])),_:1},8,["onClick","disabled"])]))]),_:1})])]),_:1}),a(_e,{horizontal:"",onResize:r.calcHeight,style:{height:"100%"}},{default:c(()=>[a(L,{class:"editorbox",size:"50"},{default:c(()=>[a(d,{modelValue:s.showSave,"onUpdate:modelValue":e[8]||(e[8]=C=>s.showSave=C),absolute:"",location:"top right",timeout:-1,class:"saving"},{default:c(()=>e[44]||(e[44]=[x(" Saving... ")])),_:1},8,["modelValue"]),v("pre",{ref:"editor",class:"editor",onContextmenu:e[9]||(e[9]=be((...C)=>r.showExecuteSelectionMenu&&r.showExecuteSelectionMenu(...C),["prevent"]))},null,544),a(R,{modelValue:s.executeSelectionMenu,"onUpdate:modelValue":e[10]||(e[10]=C=>s.executeSelectionMenu=C),target:[s.menuX,s.menuY]},{default:c(()=>[a(E,null,{default:c(()=>[(k(!0),A(ne,null,le(r.executeSelectionMenuItems,C=>(k(),P(B,{link:"",key:C.label,disabled:s.scriptId},{default:c(()=>[a(D,{onClick:C.command},{default:c(()=>[x(F(C.label),1)]),_:2},1032,["onClick"])]),_:2},1032,["disabled"]))),128))]),_:1})]),_:1},8,["modelValue","target"])]),_:1}),a(L,{id:"messages",class:"mt-2",ref:"messagesDiv"},{default:c(()=>[s.showDebug?(k(),A("div",Td,[a(T,{"no-gutters":""},{default:c(()=>[a(u,{color:"primary",onClick:r.step,style:{width:"100px"},class:"mr-4",disabled:!s.scriptId,"data-test":"step-button"},{default:c(()=>[e[46]||(e[46]=x(" Step ")),a(l,{end:""},{default:c(()=>e[45]||(e[45]=[x(" mdi-step-forward ")])),_:1})]),_:1},8,["onClick","disabled"]),a(g,{ref:"debug",class:"mb-2",variant:"outlined",density:"compact","hide-details":"",label:"Debug",modelValue:s.debug,"onUpdate:modelValue":e[11]||(e[11]=C=>s.debug=C),onKeydown:r.debugKeydown,"data-test":"debug-text"},null,8,["modelValue","onKeydown"])]),_:1})])):z("",!0),a(Z,{id:"log-messages",modelValue:s.messages,"onUpdate:modelValue":e[12]||(e[12]=C=>s.messages=C),onSort:r.messageSortOrder},null,8,["modelValue","onSort"])]),_:1},512)]),_:1},8,["onResize"]),s.fileOpen?(k(),P(Ti,{key:0,modelValue:s.fileOpen,"onUpdate:modelValue":e[13]||(e[13]=C=>s.fileOpen=C),type:"open","api-url":"/script-api/scripts",onFile:e[14]||(e[14]=C=>r.setFile(C)),onError:e[15]||(e[15]=C=>r.setError(C)),onClearTemp:e[16]||(e[16]=C=>r.clearTemp(C))},null,8,["modelValue"])):z("",!0),s.showSaveAs?(k(),P(Ti,{key:1,modelValue:s.showSaveAs,"onUpdate:modelValue":e[17]||(e[17]=C=>s.showSaveAs=C),type:"save","api-url":"/script-api/scripts","require-target-parent-dir":"","input-filename":r.filenameOrBlank,onFilename:e[18]||(e[18]=C=>r.saveAsFilename(C)),onError:e[19]||(e[19]=C=>r.setError(C)),onClearTemp:e[20]||(e[20]=C=>r.clearTemp(C))},null,8,["modelValue","input-filename"])):z("",!0),s.showEnvironment?(k(),P(Dd,{key:2,modelValue:s.showEnvironment,"onUpdate:modelValue":e[21]||(e[21]=C=>s.showEnvironment=C)},null,8,["modelValue"])):z("",!0),s.ask.show?(k(),P(Ad,{key:3,modelValue:s.ask.show,"onUpdate:modelValue":e[22]||(e[22]=C=>s.ask.show=C),question:s.ask.question,default:s.ask.default,password:s.ask.password,"answer-required":s.ask.answerRequired,onResponse:s.ask.callback},null,8,["modelValue","question","default","password","answer-required","onResponse"])):z("",!0),s.file.show?(k(),P(Pd,{key:4,modelValue:s.file.show,"onUpdate:modelValue":e[23]||(e[23]=C=>s.file.show=C),title:s.file.title,message:s.file.message,multiple:s.file.multiple,filter:s.file.filter,onResponse:r.fileDialogCallback},null,8,["modelValue","title","message","multiple","filter","onResponse"])):z("",!0),s.information.show?(k(),P(Vd,{key:5,modelValue:s.information.show,"onUpdate:modelValue":e[24]||(e[24]=C=>s.information.show=C),title:s.information.title,text:s.information.text,width:s.information.width},null,8,["modelValue","title","text","width"])):z("",!0),s.inputMetadata.show?(k(),P(Md,{key:6,modelValue:s.inputMetadata.show,"onUpdate:modelValue":e[25]||(e[25]=C=>s.inputMetadata.show=C),events:s.inputMetadata.events,"time-zone":s.timeZone,"new-metadata":"",onClose:s.inputMetadata.callback},null,8,["modelValue","events","time-zone","onClose"])):z("",!0),s.showOverrides?(k(),P(Ud,{key:7,modelValue:s.showOverrides,"onUpdate:modelValue":e[26]||(e[26]=C=>s.showOverrides=C)},null,8,["modelValue"])):z("",!0),s.prompt.show?(k(),P(Nd,{key:8,modelValue:s.prompt.show,"onUpdate:modelValue":e[27]||(e[27]=C=>s.prompt.show=C),title:s.prompt.title,subtitle:s.prompt.subtitle,message:s.prompt.message,details:s.prompt.details,buttons:s.prompt.buttons,layout:s.prompt.layout,multiple:s.prompt.multiple,onResponse:s.prompt.callback},null,8,["modelValue","title","subtitle","message","details","buttons","layout","multiple","onResponse"])):z("",!0),s.results.show?(k(),P(Fd,{key:9,modelValue:s.results.show,"onUpdate:modelValue":e[28]||(e[28]=C=>s.results.show=C),text:s.results.text},null,8,["modelValue","text"])):z("",!0),s.scriptEnvironment.show?(k(),P(zd,{key:10,modelValue:s.scriptEnvironment.show,"onUpdate:modelValue":e[29]||(e[29]=C=>s.scriptEnvironment.show=C),"input-environment":s.scriptEnvironment.env,onEnvironment:r.environmentHandler},null,8,["modelValue","input-environment","onEnvironment"])):z("",!0),a(Id,{modelValue:s.showSuiteError,"onUpdate:modelValue":e[30]||(e[30]=C=>s.showSuiteError=C),title:"Suite Analysis Error",text:s.suiteError,width:1e3},null,8,["modelValue","text"]),a(Ld,{uuid:s.criticalCmdUuid,cmdString:s.criticalCmdString,cmdUser:s.criticalCmdUser,persistent:!0,modelValue:s.displayCriticalCmd,"onUpdate:modelValue":e[31]||(e[31]=C=>s.displayCriticalCmd=C),onStatus:r.promptDialogCallback},null,8,["uuid","cmdString","cmdUser","modelValue","onStatus"]),a(jd,{modelValue:s.showScripts,"onUpdate:modelValue":e[33]||(e[33]=C=>s.showScripts=C)},{default:c(()=>[a(qd,{class:"pb-11 pt-5 px-5"},{default:c(()=>[s.showScripts?(k(),P(Bd,{key:0,"connect-in-new-tab":!!s.fileModified,onDisconnect:r.scriptDisconnect,onClose:e[32]||(e[32]=()=>{s.showScripts=!1})},null,8,["connect-in-new-tab","onDisconnect"])):z("",!0)]),_:1})]),_:1},8,["modelValue"])],64)}const ep=q("default",ae(_d,[["render",Rd],["__scopeId","data-v-e274eaa8"]]))}}});
|