openc3-cosmos-tool-scriptrunner 6.0.2 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/tools/scriptrunner/{ArrayWidget-DBpEoQ1y-49d96d0b09f2d53606b4.js → ArrayWidget-BxEO5hEG-ead7c1c7c94d72a01f25.js} +2 -2
- data/tools/scriptrunner/ArrayplotWidget-B_VPoV4v-806e26259e495e4a7e7f.js +1 -0
- data/tools/scriptrunner/{BarColumn-B6tCmNJm-39e71e42939f3d10e073.js → BarColumn-C9dkpg2O-fbb489c5b003447ddee2.js} +1 -1
- data/tools/scriptrunner/BlockWidget-CuefOin6-2e7dfeafb154b642df3c.js +2 -0
- data/tools/scriptrunner/{ButtonWidget-CHrHS_Bw-316bf50d6d1c0f4a9823.js → ButtonWidget-B6HM0Doo-d005273b23873ae26eda.js} +2 -2
- data/tools/scriptrunner/CanvasWidget-DZQGG-yQ-894924fb59718fc23d06.js +1 -0
- data/tools/scriptrunner/CanvasdotWidget-6wuCSnw_-a6ca7bc18f60fce7719f.js +1 -0
- data/tools/scriptrunner/{CanvasimageWidget-BrYlPQCf-179b1ea5195189c07639.js → CanvasimageWidget-mhcPpAuN-1a1f851a9a41fcf6c733.js} +1 -1
- data/tools/scriptrunner/{CanvasimagevalueWidget-HnEOXmZy-8868016071abb108b0d9.js → CanvasimagevalueWidget-Cx-dH8Gc-12a4c60baf07c5b8e6ee.js} +1 -1
- data/tools/scriptrunner/CanvaslabelWidget-CQZCeohU-e980c378d26286583638.js +1 -0
- data/tools/scriptrunner/{CanvaslabelvalueWidget-0zRDJav3-71faeab0c96508b78376.js → CanvaslabelvalueWidget-CwmYDCjr-ae8bba1e091b4f2f5511.js} +1 -1
- data/tools/scriptrunner/CanvaslineWidget-nTP3fJB4-971cf3abdbc73dd73ed3.js +1 -0
- data/tools/scriptrunner/CanvaslinevalueWidget-C3sJnjLQ-bbb3d3bebbb53d2f37f1.js +1 -0
- data/tools/scriptrunner/CheckbuttonWidget-5-8YDsQL-c48610df9e187296d930.js +1 -0
- data/tools/scriptrunner/{ComboboxWidget-BykAAoxH-d4ed06756123e801a5b6.js → ComboboxWidget-DzBL8h9f-c587623a19945e52745d.js} +1 -1
- data/tools/scriptrunner/{CriticalCmdDialog-CAcGOWok-f35747471c4e19033e2c.js → CriticalCmdDialog-DLEasFsx-62fa5db3da14e27de0d4.js} +1 -1
- data/tools/scriptrunner/{DateWidget-FtYD86xW-5054c8acf61b84970ba8.js → DateWidget-CW7Od7lB-4108a1baf9b43aa4dfbe.js} +1 -1
- data/tools/scriptrunner/{DetailsDialog-DiVcC3Fg-c70d632fbf418bfd55bd.js → DetailsDialog-BvbziA7Y-9b378ec53ddb57f355da.js} +1 -1
- data/tools/scriptrunner/{DynamicWidget-m9EliUR2-176097c7edd7f31107c7.js → DynamicWidget-gFSYxzvT-33d561dfbdea13148312.js} +1 -1
- data/tools/scriptrunner/{FormatvalueWidget-OykwwCrw-64f7e0ed3ca32f1d7176.js → FormatvalueWidget-CGpnTqVH-9c3e7456e9d1c37af3f7.js} +1 -1
- data/tools/scriptrunner/Graph-3rkhFP3G-88ae99f4cc3dce50617c.js +1 -0
- data/tools/scriptrunner/GraphWidget-Dycey-mj-8059a183566b157bade7.js +1 -0
- data/tools/scriptrunner/{HorizontalWidget-B7YdcFVN-2325176db30708d31e14.js → HorizontalWidget-D31NRWy5-e888b42c390818542848.js} +1 -1
- data/tools/scriptrunner/{HorizontalboxWidget-D-kCNwI3-4b6c41283de618d833a1.js → HorizontalboxWidget-Br8dSVHD-4cfbf1eb02b3f84138dc.js} +1 -1
- data/tools/scriptrunner/HorizontallineWidget-CbxREBYI-75dec7e530974c61a1e5.js +1 -0
- data/tools/scriptrunner/IframeWidget-Ctj8OIcG-3d019032b58dfdefd7d0.js +1 -0
- data/tools/scriptrunner/ImageLoader-BrNrCBvi-6ab161d34aed75d5586e.js +1 -0
- data/tools/scriptrunner/{ImageviewerWidget-B4HbUIfR-e1f10671abe8105a62c4.js → ImageviewerWidget-XrsqxmLo-f64a89cc33d47fd955bd.js} +1 -1
- data/tools/scriptrunner/{LabelWidget-D1JhQAzR-4524acbda5f1de768413.js → LabelWidget-t7I87dp7-1315eaa811930b2233e6.js} +1 -1
- data/tools/scriptrunner/{LabelledWidget-C2VGJ5OJ-3a9fec9e282b149881c0.js → LabelledWidget-C7TDf92M-724ad7815bc212f67e35.js} +1 -1
- data/tools/scriptrunner/{LabelprogressbarWidget-DN0cAeLK-3585c4ce60eb5b2d1095.js → LabelprogressbarWidget-wwLURt1u-a432c9a5b474cf5b6e7c.js} +1 -1
- data/tools/scriptrunner/LabelsparklineWidget-B3awLUyP-e4a0816a04321e38df49.js +1 -0
- data/tools/scriptrunner/LabelvalueWidget-Zx_yHCtl-4c0c4e0ac8ae39bed5d8.js +1 -0
- data/tools/scriptrunner/{LabelvaluedescWidget-DtJwggDu-3380078f5847cfdc450a.js → LabelvaluedescWidget-BBSBh4vI-f984876107c06543c3fb.js} +1 -1
- data/tools/scriptrunner/LabelvaluelimitsbarWidget-CZueHYWG-f6cf6c917f8c67a6eba5.js +1 -0
- data/tools/scriptrunner/LabelvaluelimitscolumnWidget-BTvzyQMq-2cdc4af80e2a87e9dd3c.js +1 -0
- data/tools/scriptrunner/{LabelvaluerangebarWidget-DCJ42bmf-883644ba0a4816f4c01e.js → LabelvaluerangebarWidget-BhYTBgDq-6c2e0fda9184e2208746.js} +1 -1
- data/tools/scriptrunner/{Layout-D4YBjuWs-b2c07658d90efa6c9a67.js → Layout-Bh7VzCZd-20c6f8db2d075e169f19.js} +1 -1
- data/tools/scriptrunner/LedWidget-CxJjJBBS-e3af37bbf00cede52525.js +1 -0
- data/tools/scriptrunner/{LimitsbarWidget-D-wfz_St-1776d291455aa7caa6a3.js → LimitsbarWidget-Djui0IpK-f2c539db7a9ad3b89fb8.js} +1 -1
- data/tools/scriptrunner/LimitscolorWidget-DdmvKzmx-40498c140bc11d03e41d.js +1 -0
- data/tools/scriptrunner/{LimitscolumnWidget-Dt5ce4hN-218db7cc69303b16ed96.js → LimitscolumnWidget-Cc19IEjq-ad17693f30efe09b8fa1.js} +1 -1
- data/tools/scriptrunner/LinegraphWidget-BtieJxeL-42b1ce28200be8efef14.js +1 -0
- data/tools/scriptrunner/{MatrixbycolumnsWidget-wLx4NvXV-6fba40d9f4f218beccfa.js → MatrixbycolumnsWidget-DnExVRF8-14726b7f439cc0f5a4e8.js} +1 -1
- data/tools/scriptrunner/{ProgressbarWidget-B7l0BBiX-6b9205abce83d0f44786.js → ProgressbarWidget-DIfqhHRE-7b0c17e686f27b32e7a2.js} +1 -1
- data/tools/scriptrunner/RadiobuttonWidget-QzIkNP7m-67844f83fea794baf396.js +1 -0
- data/tools/scriptrunner/{RadiogroupWidget-Busjqikr-9969e19cc3971c45ea7a.js → RadiogroupWidget-Ci9sCX39-adf16959ef5dea69675d.js} +1 -1
- data/tools/scriptrunner/{RangebarWidget-DbYrwEfC-a92312aa245b03dc1b13.js → RangebarWidget-CN0YuHqy-e42497ee9496c3b154c6.js} +1 -1
- data/tools/scriptrunner/{RollupWidget-rKxLXuCv-4b6cf1cabac7f65c6b00.js → RollupWidget-y4jBtJB2-b365d016bbec0e14bf6f.js} +1 -1
- data/tools/scriptrunner/ScriptRunner-9cfa2fbbc410498eeb86.js +97 -0
- data/tools/scriptrunner/{ScrollwindowWidget-D4NKIzQO-7ddaef53be1a328cc6c4.js → ScrollwindowWidget-CBzYk4Y3-8ba1e2df0c774f559d80.js} +1 -1
- data/tools/scriptrunner/{SignalWidget-h-oivReC-9728dd31a8309f9a6bb1.js → SignalWidget-DQ5Uc2uV-bec676f52a80f693ffb0.js} +1 -1
- data/tools/scriptrunner/SpacerWidget-6rsc_dSM-35b1c7d8fde745bcec57.js +1 -0
- data/tools/scriptrunner/SparklineWidget-CZtvu2ss-5f6d3fbeb1363f8c025e.js +1 -0
- data/tools/scriptrunner/TabbookWidget-DNALU0jl-fa9b45c7d1d46bd0da6d.js +1 -0
- data/tools/scriptrunner/TextboxWidget-5hqPj74D-c06475767d41689a2ed0.js +1 -0
- data/tools/scriptrunner/{TextfieldWidget-aVRdXRsT-a941d09442846446a348.js → TextfieldWidget-Df0ANSiU-17e3086885e55a815dd5.js} +1 -1
- data/tools/scriptrunner/TimeWidget-C6XQMUG2-12aaccac719f15c27589.js +1 -0
- data/tools/scriptrunner/TitleWidget-B9SPUlbW-de561684727a4e247b6f.js +1 -0
- data/tools/scriptrunner/VWidget-C4spAawK-481dafde19f6dd3512b9.js +1 -0
- data/tools/scriptrunner/ValueWidget-D4RrYVEK-4dee1ed5cb87c7c544af.js +1 -0
- data/tools/scriptrunner/ValuelimitsbarWidget-Bc9_Vj_f-6acbb385894e7b8a4799.js +1 -0
- data/tools/scriptrunner/ValuelimitscolumnWidget-DHKIL7sf-837bdd9ac2eecfd6b717.js +1 -0
- data/tools/scriptrunner/ValuerangebarWidget-CecQRIok-9315e926a735f48db354.js +1 -0
- data/tools/scriptrunner/{VerticalWidget-DziyURNu-bc30c452165476a9094e.js → VerticalWidget-D8jUFxjS-af081d2ee73b78acdc7d.js} +1 -1
- data/tools/scriptrunner/VerticalboxWidget-B4eGUSYH-442cfd2d4b32e7b4536b.js +1 -0
- data/tools/scriptrunner/{Widget-C7ms_xDE-be420af1516fb17191cb.js → Widget-fRCERxGf-5c8646a273d07a19dca9.js} +1 -1
- data/tools/scriptrunner/addMonths-BtG7uZLJ-cf31e98fce9cd8911736.js +1 -0
- data/tools/scriptrunner/main-34ed890e1d26d8bce225.js +1426 -0
- data/tools/scriptrunner/main.js +1 -1
- metadata +71 -69
- data/tools/scriptrunner/BlockWidget-Bmi0UcUW-9aede31c9381490863a5.js +0 -2
- data/tools/scriptrunner/CanvasWidget-BqdyLbQz-67c02d2047f8f9b18018.js +0 -1
- data/tools/scriptrunner/CanvasdotWidget-YYwca104-bb7953ea0bf5e6cc6500.js +0 -1
- data/tools/scriptrunner/CanvaslabelWidget-BfMHNei--b5680b46a874802c7b08.js +0 -1
- data/tools/scriptrunner/CanvaslineWidget-BmOwJP_G-5c9d174da10c00dac8b8.js +0 -1
- data/tools/scriptrunner/CanvaslinevalueWidget-H3L1aUKM-8bd67ad86f5d8d622308.js +0 -1
- data/tools/scriptrunner/CheckbuttonWidget-BnT9X7wE-835a1c528c0aa8cc0a5f.js +0 -1
- data/tools/scriptrunner/GraphWidget-BohHW-97-6c30518edb10899a3409.js +0 -1
- data/tools/scriptrunner/HorizontallineWidget-BdlNB951-4463e518dcd3f253f0f9.js +0 -1
- data/tools/scriptrunner/IframeWidget-0C7GYEVc-2db13bb5a197eead9b2f.js +0 -1
- data/tools/scriptrunner/ImageLoader-y6fAZe9P-3b44a478d722d3b1433a.js +0 -1
- data/tools/scriptrunner/LabelsparklineWidget--sxBENxs-4b6ffc3d8c0935e3d962.js +0 -1
- data/tools/scriptrunner/LabelvalueWidget-BWpP5KX6-6158c8705590b5d0db83.js +0 -1
- data/tools/scriptrunner/LabelvaluelimitsbarWidget-Bj6UVK-5-d78b2f0f044fa7763e04.js +0 -1
- data/tools/scriptrunner/LabelvaluelimitscolumnWidget-BVcEEcUx-30adf8dd0eb5e380ecbc.js +0 -1
- data/tools/scriptrunner/LedWidget-hN9JHxjr-3a82ce913a769303459f.js +0 -1
- data/tools/scriptrunner/LimitscolorWidget-B0AVGdkz-e7b5b0c15d63211f2578.js +0 -1
- data/tools/scriptrunner/LinegraphWidget-CTjtvtPd-448bbb6dbbd6c2d3c4a9.js +0 -1
- data/tools/scriptrunner/RadiobuttonWidget-B032jKIw-7652159c15bfe178dcdc.js +0 -1
- data/tools/scriptrunner/ScriptRunner-814081093096ba287249.js +0 -96
- data/tools/scriptrunner/SpacerWidget-BSy9eOlB-4659cad2b465a988f93e.js +0 -1
- data/tools/scriptrunner/SparklineWidget-C9vdxar--2344ac77af139beda7a2.js +0 -1
- data/tools/scriptrunner/TabbookWidget-DTFTKURm-8eb93528ffe9023b2c14.js +0 -1
- data/tools/scriptrunner/TextboxWidget-BZyYHmBq-f559932ee0b9f9ca332a.js +0 -1
- data/tools/scriptrunner/TimeWidget-BE2rtMxg-7c12959bb6f693906fc5.js +0 -1
- data/tools/scriptrunner/TitleWidget-BB29MZb2-b23a04535efc19f1beaa.js +0 -1
- data/tools/scriptrunner/VWidget-CGdM4sTw-bf3b388e737f5fe1fca2.js +0 -1
- data/tools/scriptrunner/ValueWidget-h3905woQ-d9e293e578f0400d835d.js +0 -1
- data/tools/scriptrunner/ValuelimitsbarWidget-LMXYjWtS-34847311d98ca0e0a500.js +0 -1
- data/tools/scriptrunner/ValuelimitscolumnWidget-gA3ZcfAT-e0bcb4c083ddf76a5959.js +0 -1
- data/tools/scriptrunner/ValuerangebarWidget-DwZ9KQ0O-ea17af9b7ee0faf5a82f.js +0 -1
- data/tools/scriptrunner/VerticalboxWidget-OcoZBsFU-72021996d9be3517bd60.js +0 -1
- data/tools/scriptrunner/addMonths-BdRI44Cs-4ce6b03736dc97c1c56a.js +0 -1
- data/tools/scriptrunner/main-fb05c0535d7089754e6f.js +0 -1425
@@ -0,0 +1,97 @@
|
|
1
|
+
var Cp=Object.defineProperty;var ur=j=>{throw TypeError(j)};var Op=(j,$,p)=>$ in j?Cp(j,$,{enumerable:!0,configurable:!0,writable:!0,value:p}):j[$]=p;var Hn=(j,$,p)=>Op(j,typeof $!="symbol"?$+"":$,p),dr=(j,$,p)=>$.has(j)||ur("Cannot "+p);var ie=(j,$,p)=>(dr(j,$,"read from private field"),p?p.call(j):$.get(j)),ve=(j,$,p)=>$.has(j)?ur("Cannot add the same private member more than once"):$ instanceof WeakSet?$.add(j):$.set(j,p),Ge=(j,$,p,P)=>(dr(j,$,"write to private field"),P?P.call(j,p):$.set(j,p),p);System.register(["vue","./main-34ed890e1d26d8bce225.js","single-spa","./addMonths-BtG7uZLJ-cf31e98fce9cd8911736.js","./CriticalCmdDialog-DLEasFsx-62fa5db3da14e27de0d4.js","vue-router","vuex","vuetify"],function(j,$){"use strict";var p,P,k,c,l,S,F,Y,K,x,D,re,he,ce,Wn,ze,L,_t,Jn,Gn,Oe,Te,Se,Qt,ue,X,Yn,be,Ye,Ke,Kn,Xn,Zn,Qn,de,es,ts,ns,ss,is,rs;return{setters:[M=>{p=M.resolveComponent,P=M.createBlock,k=M.openBlock,c=M.withCtx,l=M.createVNode,S=M.createElementVNode,F=M.toDisplayString,Y=M.normalizeProps,K=M.guardReactiveProps,x=M.createTextVNode,D=M.createElementBlock,re=M.Fragment,he=M.renderList,ce=M.mergeProps,Wn=M.Teleport,ze=M.createSlots,L=M.createCommentVNode,_t=M.normalizeStyle,Jn=M.h,Gn=M.renderSlot,Oe=M.withDirectives,Te=M.vShow,Se=M.withModifiers,Qt=M.normalizeClass},M=>{ue=M.s,X=M.p,Yn=M.O,be=M.E,Ye=M.P,Ke=M.a,Kn=M.c,Xn=M.l,Zn=M.z,Qn=M.y,de=M._,es=M.q,ts=M.e,ns=M.J,ss=M.t},null,M=>{is=M.M},M=>{rs=M.N},null,null,null],execute:function(){var Fe,pt,mt,ft,gt,Xt,bt,yt,Zt;var M=document.createElement("style");M.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-55f70e4e]{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-415f09d1]{padding:0}.editor[data-v-415f09d1]{height:100%;width:100%;position:relative;font-size:16px}.script-state[data-v-415f09d1] .v-field{background-color:var(--color-background-base-default)}.script-state[data-v-415f09d1] 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(M);const os={data:{configKey:""},methods:{buildLanguageMode(t,e){let n=X.require("ace/lib/oop"),s=Object.getOwnPropertyNames(Yn.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"]),i=new RegExp(`(\\b${s.join("\\b|\\b")}\\b)`),r=function(){t.call(this);for(let u in this.$rules)this.$rules[u].unshift({regex:i,token:"support.function"})};n.inherits(r,t);let o=X.require("ace/mode/matching_brace_outdent").MatchingBraceOutdent,a=X.require("ace/mode/behaviour/cstyle").CstyleBehaviour;return[n,function(){this.HighlightRules=r,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new e,this.indentKeywords=this.foldingRules.indentKeywords}]},buildRubyMode(){const[t,e]=this.buildLanguageMode(X.require("ace/mode/ruby_highlight_rules").RubyHighlightRules,X.require("ace/mode/folding/ruby").FoldMode);let n=X.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(X.require("ace/mode/python_highlight_rules").PythonHighlightRules,X.require("ace/mode/folding/pythonic").FoldMode);let n=X.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(X.require("ace/mode/json_highlight_rules").JsonHighlightRules,X.require("ace/mode/folding/ruby").FoldMode);let n=X.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(X.require("ace/mode/markdown_highlight_rules").MarkdownHighlightRules,X.require("ace/mode/folding/markdown").FoldMode);let n=X.require("ace/mode/markdown").Mode;return t.inherits(e,n),(function(){this.$id="ace/mode/openc3"}).call(e.prototype),e}}},mr={props:{content:{type:String,required:!0},type:String,name:String,modelValue:Boolean,filename:{type:String,required:!1}},mixins:[os],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});break;case"py":case"pyi":const n=this.buildPythonMode();t=new n;break;case"md":const s=this.buildMarkdownMode();t=new s;break;default:const i=this.buildRubyMode();t=new i;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()}}},fr=["textContent"],gr={class:"mx-2"},br={class:"editor",ref:"editor"};function yr(t,e,n,s,i,r){const o=p("v-spacer"),a=p("v-icon"),u=p("v-tooltip"),d=p("v-toolbar"),h=p("v-card-text"),m=p("v-btn"),g=p("v-card-actions"),b=p("v-card"),y=p("v-dialog");return k(),P(y,{modelValue:r.show,"onUpdate:modelValue":e[1]||(e[1]=f=>r.show=f),width:"85vw"},{default:c(()=>[l(b,null,{default:c(()=>[l(d,{height:"24"},{default:c(()=>[l(o),S("span",{textContent:F(r.title)},null,8,fr),l(o),S("div",gr,[l(u,{location:"top"},{activator:c(({props:f})=>[S("div",Y(K(f)),[l(a,{"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]=S("span",null," Download ",-1))]),_:1})])]),_:1}),l(h,null,{default:c(()=>[S("pre",br,null,512)]),_:1}),l(g,{class:"pr-6 pb-4 pt-0"},{default:c(()=>[l(o),l(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 wr=ue(mr,[["render",yr],["__scopeId","data-v-35a62559"]]),_r={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)}}},vr={scope:"col",class:"text-right"};function Sr(t,e,n,s,i,r){const o=p("v-icon"),a=p("v-tooltip"),u=p("v-text-field"),d=p("v-table");return k(),D("div",null,[l(d,{dense:""},{default:c(()=>[e[6]||(e[6]=S("span",null," Add environment variables (optional)",-1)),S("tbody",null,[S("tr",null,[e[2]||(e[2]=S("th",{scope:"col",class:"text-left"},"Key",-1)),e[3]||(e[3]=S("th",{scope:"col",class:"text-left"},"Value",-1)),S("th",vr,[l(a,{location:"top"},{activator:c(({props:h})=>[S("div",Y(K(h)),[l(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]=S("span",null," Add Environment ",-1))]),_:1})])]),(k(!0),D(re,null,he(r.selected,(h,m)=>(k(),D("tr",{key:`tr-${m}`},[S("td",null,[l(u,{modelValue:h.key,"onUpdate:modelValue":g=>h.key=g,density:"compact",type:"text",readonly:h.readonly,"data-test":`key-${m}`},null,8,["modelValue","onUpdate:modelValue","readonly","data-test"])]),S("td",null,[l(u,{modelValue:h.value,"onUpdate:modelValue":g=>h.value=g,density:"compact",type:"text",readonly:h.readonly,"data-test":`value-${m}`},null,8,["modelValue","onUpdate:modelValue","readonly","data-test"])]),S("td",null,[l(a,{location:"top"},{activator:c(({props:g})=>[S("div",ce({ref_for:!0},g),[l(o,{"data-test":`remove-env-icon-${m}`,onClick:b=>r.delEnvVar(m)},{default:c(()=>e[4]||(e[4]=[x(" mdi-delete ")])),_:2},1032,["data-test","onClick"])],16)]),default:c(()=>[e[5]||(e[5]=S("span",null," Delete Environment ",-1))]),_:2},1024)])]))),128))])]),_:1})])}const as=ue(_r,[["render",Sr]]),kr={props:{modelValue:String},data(){return{loading:!1,search:"",selected:this.modelValue,scripts:[],items:[]}},created(){this.loading=!0,be.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 xr(t,e,n,s,i,r){const o=p("v-autocomplete"),a=p("v-row");return k(),D("div",null,[l(a,null,{default:c(()=>[l(o,{modelValue:i.selected,"onUpdate:modelValue":e[0]||(e[0]=u=>i.selected=u),density:"compact",variant:"outlined","hide-no-data":"","hide-details":"",class:"mb-5",label:"Select script",loading:i.loading,items:i.items,search:i.search,"onUpdate:search":e[1]||(e[1]=u=>i.search=u),"data-test":"select-script"},null,8,["modelValue","loading","items","search"])]),_:1})])}const Er=ue(kr,[["render",xr]]),Cr={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()}}},Or={class:"mx-2"},Tr={class:"pa-3"},Rr={class:"text"};function Ar(t,e,n,s,i,r){const o=p("v-spacer"),a=p("v-icon"),u=p("v-tooltip"),d=p("v-toolbar"),h=p("v-card-text"),m=p("v-btn"),g=p("v-card-actions"),b=p("v-card"),y=p("v-dialog");return k(),P(y,{modelValue:r.show,"onUpdate:modelValue":e[1]||(e[1]=f=>r.show=f),width:n.width,scrollable:""},{default:c(()=>[l(b,null,{default:c(()=>[l(d,{height:"24"},{default:c(()=>[l(o),S("span",null,F(n.title),1),l(o),S("div",Or,[l(u,{location:"top"},{activator:c(({props:f})=>[S("div",Y(K(f)),[l(a,{"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]=S("span",null," Download ",-1))]),_:1})])]),_:1}),l(h,{style:{"max-height":"80vh"}},{default:c(()=>[S("div",Tr,[S("span",Rr,F(n.text),1)])]),_:1}),l(g,{class:"px-2"},{default:c(()=>[l(o),l(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 Pr=ue(Cr,[["render",Ar],["__scopeId","data-v-a60ace75"]]),Dr={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}},Mr={class:"app-title mr-2"};function Vr(t,e,n,s,i,r){const o=p("v-col"),a=p("v-row"),u=p("v-icon"),d=p("v-btn"),h=p("v-divider"),m=p("v-list-item-title"),g=p("v-list-item"),b=p("v-list"),y=p("v-menu"),f=p("v-radio"),v=p("v-list-item-action"),T=p("v-radio-group"),C=p("v-checkbox");return k(),P(Wn,{to:"#openc3-menu"},[l(a,{"no-gutters":""},{default:c(()=>[l(o,{"align-self":"end"},{default:c(()=>[S("span",Mr,F(n.title),1)]),_:1})]),_:1}),l(a,{dense:"",class:"flex-nowrap"},{default:c(()=>[(k(!0),D(re,null,he(n.menus,(A,B)=>(k(),P(y,{ref_for:!0,ref:"topmenu",key:B},{activator:c(({props:E})=>[l(d,ce({ref_for:!0},E,{variant:"outlined",class:"mx-1 menu-button",text:A.label,"data-test":r.formatDT(`${n.title} ${A.label}`)}),{append:c(()=>[l(u,{class:"menu-button-icon"},{default:c(()=>e[0]||(e[0]=[x(" mdi-menu-down ")])),_:1})]),_:2},1040,["text","data-test"])]),default:c(()=>[l(b,null,{default:c(()=>[(k(!0),D(re,null,he(A.items,(E,R)=>(k(),D(re,null,[E.divider?(k(),P(h,{key:R+"-divider"})):E.subMenu&&E.subMenu.length>0?(k(),D("div",{key:R+"-submenu"},[(k(),P(y,{"open-on-hover":"",location:"right",key:R},{activator:c(({props:z})=>[(k(),P(g,ce({ref_for:!0},z,{disabled:E.disabled,key:R}),ze({append:c(()=>[l(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:_t("cursor: pointer;"+(E.disabled?"opacity: 0.2":""))},{default:c(()=>[x(F(E.label),1)]),_:2},1032,["style"])):L("",!0)]),_:2},[E.icon?{name:"prepend",fn:c(()=>[l(u,{disabled:E.disabled},{default:c(()=>[x(F(E.icon),1)]),_:2},1032,["disabled"])]),key:"0"}:void 0]),1040,["disabled"]))]),default:c(()=>[l(b,null,{default:c(()=>[(k(!0),D(re,null,he(E.subMenu,(z,G)=>(k(),P(g,{key:G,"prepend-icon":z.icon,onClick:te=>r.subMenuClick(z)},{default:c(()=>[l(m,null,{default:c(()=>[x(F(z.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),D(re,null,he(E.choices,(z,G)=>(k(),P(g,{key:G+"-choice"},{default:c(()=>[l(v,{class:"list-action"},{default:c(()=>[l(f,{color:"secondary",label:z.label,value:z.value,density:"compact","hide-details":""},null,8,["label","value"])]),_:2},1024)]),_:2},1024))),128))]),_:2},1032,["model-value","onUpdate:modelValue"])):(k(),P(g,{onClick:z=>E.command(E),disabled:E.disabled,"data-test":r.formatDT(`${n.title} ${A.label} ${E.label}`),key:R+"-list"},ze({default:c(()=>[E.checkbox?(k(),P(v,{key:0,class:"list-action"},{default:c(()=>[l(C,{modelValue:E.checked,"onUpdate:modelValue":z=>E.checked=z,label:E.label,color:"secondary",density:"compact","hide-details":""},null,8,["modelValue","onUpdate:modelValue","label"])]),_:2},1024)):L("",!0),!E.radio&&!E.checkbox?(k(),P(m,{key:1,style:_t("cursor: pointer;"+(E.disabled?"opacity: 0.2":""))},{default:c(()=>[x(F(E.label),1)]),_:2},1032,["style"])):L("",!0)]),_:2},[E.icon?{name:"prepend",fn:c(()=>[l(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 Nr=ue(Dr,[["render",Vr],["__scopeId","data-v-4d454b93"]]);function ls(t,e){return function(){return t.apply(e,arguments)}}const{toString:Ur}=Object.prototype,{getPrototypeOf:en}=Object,vt=(t=>e=>{const n=Ur.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),pe=t=>(t=t.toLowerCase(),e=>vt(e)===t),St=t=>e=>typeof e===t,{isArray:qe}=Array,Xe=St("undefined");function Ir(t){return t!==null&&!Xe(t)&&t.constructor!==null&&!Xe(t.constructor)&&oe(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const cs=pe("ArrayBuffer");function Fr(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&cs(t.buffer),e}const Lr=St("string"),oe=St("function"),us=St("number"),kt=t=>t!==null&&typeof t=="object",zr=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)},qr=pe("Date"),Br=pe("File"),jr=pe("Blob"),$r=pe("FileList"),Hr=t=>kt(t)&&oe(t.pipe),Wr=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||oe(t.append)&&((e=vt(t))==="formdata"||e==="object"&&oe(t.toString)&&t.toString()==="[object FormData]"))},Jr=pe("URLSearchParams"),[Gr,Yr,Kr,Xr]=["ReadableStream","Request","Response","Headers"].map(pe),Zr=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ze(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let s,i;if(typeof t!="object"&&(t=[t]),qe(t))for(s=0,i=t.length;s<i;s++)e.call(null,t[s],s,t);else{const r=n?Object.getOwnPropertyNames(t):Object.keys(t),o=r.length;let a;for(s=0;s<o;s++)a=r[s],e.call(null,t[a],a,t)}}function ds(t,e){e=e.toLowerCase();const n=Object.keys(t);let s=n.length,i;for(;s-- >0;)if(i=n[s],e===i.toLowerCase())return i;return null}const Re=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,hs=t=>!Xe(t)&&t!==Re;function tn(){const{caseless:t}=hs(this)&&this||{},e={},n=(s,i)=>{const r=t&&ds(e,i)||i;xt(e[r])&&xt(s)?e[r]=tn(e[r],s):xt(s)?e[r]=tn({},s):qe(s)?e[r]=s.slice():e[r]=s};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Ze(arguments[s],n);return e}const Qr=(t,e,n,{allOwnKeys:s}={})=>(Ze(e,(i,r)=>{n&&oe(i)?t[r]=ls(i,n):t[r]=i},{allOwnKeys:s}),t),eo=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),to=(t,e,n,s)=>{t.prototype=Object.create(e.prototype,s),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},no=(t,e,n,s)=>{let i,r,o;const a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),r=i.length;r-- >0;)o=i[r],(!s||s(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=n!==!1&&en(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},so=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const s=t.indexOf(e,n);return s!==-1&&s===n},io=t=>{if(!t)return null;if(qe(t))return t;let e=t.length;if(!us(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},ro=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&en(Uint8Array)),oo=(t,e)=>{const s=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=s.next())&&!i.done;){const r=i.value;e.call(t,r[0],r[1])}},ao=(t,e)=>{let n;const s=[];for(;(n=t.exec(e))!==null;)s.push(n);return s},lo=pe("HTMLFormElement"),co=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,i){return s.toUpperCase()+i}),ps=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),uo=pe("RegExp"),ms=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),s={};Ze(n,(i,r)=>{let o;(o=e(i,r,t))!==!1&&(s[r]=o||i)}),Object.defineProperties(t,s)},ho=t=>{ms(t,(e,n)=>{if(oe(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=t[n];if(oe(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},po=(t,e)=>{const n={},s=i=>{i.forEach(r=>{n[r]=!0})};return qe(t)?s(t):s(String(t).split(e)),n},mo=()=>{},fo=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,nn="abcdefghijklmnopqrstuvwxyz",fs="0123456789",gs={DIGIT:fs,ALPHA:nn,ALPHA_DIGIT:nn+nn.toUpperCase()+fs},go=(t=16,e=gs.ALPHA_DIGIT)=>{let n="";const{length:s}=e;for(;t--;)n+=e[Math.random()*s|0];return n};function bo(t){return!!(t&&oe(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const yo=t=>{const e=new Array(10),n=(s,i)=>{if(kt(s)){if(e.indexOf(s)>=0)return;if(!("toJSON"in s)){e[i]=s;const r=qe(s)?[]:{};return Ze(s,(o,a)=>{const u=n(o,i+1);!Xe(u)&&(r[a]=u)}),e[i]=void 0,r}}return s};return n(t,0)},wo=pe("AsyncFunction"),_o=t=>t&&(kt(t)||oe(t))&&oe(t.then)&&oe(t.catch),bs=((t,e)=>t?setImmediate:e?((n,s)=>(Re.addEventListener("message",({source:i,data:r})=>{i===Re&&r===n&&s.length&&s.shift()()},!1),i=>{s.push(i),Re.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",oe(Re.postMessage)),vo=typeof queueMicrotask<"u"?queueMicrotask.bind(Re):typeof process<"u"&&process.nextTick||bs,w={isArray:qe,isArrayBuffer:cs,isBuffer:Ir,isFormData:Wr,isArrayBufferView:Fr,isString:Lr,isNumber:us,isBoolean:zr,isObject:kt,isPlainObject:xt,isReadableStream:Gr,isRequest:Yr,isResponse:Kr,isHeaders:Xr,isUndefined:Xe,isDate:qr,isFile:Br,isBlob:jr,isRegExp:uo,isFunction:oe,isStream:Hr,isURLSearchParams:Jr,isTypedArray:ro,isFileList:$r,forEach:Ze,merge:tn,extend:Qr,trim:Zr,stripBOM:eo,inherits:to,toFlatObject:no,kindOf:vt,kindOfTest:pe,endsWith:so,toArray:io,forEachEntry:oo,matchAll:ao,isHTMLForm:lo,hasOwnProperty:ps,hasOwnProp:ps,reduceDescriptors:ms,freezeMethods:ho,toObjectSet:po,toCamelCase:co,noop:mo,toFiniteNumber:fo,findKey:ds,global:Re,isContextDefined:hs,ALPHABET:gs,generateString:go,isSpecCompliantForm:bo,toJSONObject:yo,isAsyncFn:wo,isThenable:_o,setImmediate:bs,asap:vo};function V(t,e,n,s,i){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),s&&(this.request=s),i&&(this.response=i,this.status=i.status?i.status:null)}w.inherits(V,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 ys=V.prototype,ws={};["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=>{ws[t]={value:t}}),Object.defineProperties(V,ws),Object.defineProperty(ys,"isAxiosError",{value:!0}),V.from=(t,e,n,s,i,r)=>{const o=Object.create(ys);return w.toFlatObject(t,o,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),V.call(o,t.message,e,n,s,i),o.cause=t,o.name=t.name,r&&Object.assign(o,r),o};const So=null;function sn(t){return w.isPlainObject(t)||w.isArray(t)}function _s(t){return w.endsWith(t,"[]")?t.slice(0,-2):t}function vs(t,e,n){return t?t.concat(e).map(function(i,r){return i=_s(i),!n&&r?"["+i+"]":i}).join(n?".":""):e}function ko(t){return w.isArray(t)&&!t.some(sn)}const xo=w.toFlatObject(w,{},null,function(e){return/^is[A-Z]/.test(e)});function Et(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,v){return!w.isUndefined(v[f])});const s=n.metaTokens,i=n.visitor||h,r=n.dots,o=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&w.isSpecCompliantForm(e);if(!w.isFunction(i))throw new TypeError("visitor must be a function");function d(y){if(y===null)return"";if(w.isDate(y))return y.toISOString();if(!u&&w.isBlob(y))throw new V("Blob is not supported. Use a Buffer instead.");return w.isArrayBuffer(y)||w.isTypedArray(y)?u&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function h(y,f,v){let T=y;if(y&&!v&&typeof y=="object"){if(w.endsWith(f,"{}"))f=s?f:f.slice(0,-2),y=JSON.stringify(y);else if(w.isArray(y)&&ko(y)||(w.isFileList(y)||w.endsWith(f,"[]"))&&(T=w.toArray(y)))return f=_s(f),T.forEach(function(A,B){!(w.isUndefined(A)||A===null)&&e.append(o===!0?vs([f],B,r):o===null?f:f+"[]",d(A))}),!1}return sn(y)?!0:(e.append(vs(v,f,r),d(y)),!1)}const m=[],g=Object.assign(xo,{defaultVisitor:h,convertValue:d,isVisitable:sn});function b(y,f){if(!w.isUndefined(y)){if(m.indexOf(y)!==-1)throw Error("Circular reference detected in "+f.join("."));m.push(y),w.forEach(y,function(T,C){(!(w.isUndefined(T)||T===null)&&i.call(e,T,w.isString(C)?C.trim():C,f,g))===!0&&b(T,f?f.concat(C):[C])}),m.pop()}}if(!w.isObject(t))throw new TypeError("data must be an object");return b(t),e}function Ss(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function rn(t,e){this._pairs=[],t&&Et(t,this,e)}const ks=rn.prototype;ks.append=function(e,n){this._pairs.push([e,n])},ks.toString=function(e){const n=e?function(s){return e.call(this,s,Ss)}:Ss;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function Eo(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function xs(t,e,n){if(!e)return t;const s=n&&n.encode||Eo;w.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let r;if(i?r=i(e,n):r=w.isURLSearchParams(e)?e.toString():new rn(e,n).toString(s),r){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+r}return t}class Es{constructor(){this.handlers=[]}use(e,n,s){return this.handlers.push({fulfilled:e,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.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(s){s!==null&&e(s)})}}const Cs={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Co={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:rn,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},on=typeof window<"u"&&typeof document<"u",an=typeof navigator=="object"&&navigator||void 0,Oo=on&&(!an||["ReactNative","NativeScript","NS"].indexOf(an.product)<0),To=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ro=on&&window.location.href||"http://localhost",Z={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:on,hasStandardBrowserEnv:Oo,hasStandardBrowserWebWorkerEnv:To,navigator:an,origin:Ro},Symbol.toStringTag,{value:"Module"})),...Co};function Ao(t,e){return Et(t,new Z.classes.URLSearchParams,Object.assign({visitor:function(n,s,i,r){return Z.isNode&&w.isBuffer(n)?(this.append(s,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}function Po(t){return w.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Do(t){const e={},n=Object.keys(t);let s;const i=n.length;let r;for(s=0;s<i;s++)r=n[s],e[r]=t[r];return e}function Os(t){function e(n,s,i,r){let o=n[r++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),u=r>=n.length;return o=!o&&w.isArray(i)?i.length:o,u?(w.hasOwnProp(i,o)?i[o]=[i[o],s]:i[o]=s,!a):((!i[o]||!w.isObject(i[o]))&&(i[o]=[]),e(n,s,i[o],r)&&w.isArray(i[o])&&(i[o]=Do(i[o])),!a)}if(w.isFormData(t)&&w.isFunction(t.entries)){const n={};return w.forEachEntry(t,(s,i)=>{e(Po(s),i,n,0)}),n}return null}function Mo(t,e,n){if(w.isString(t))try{return(e||JSON.parse)(t),w.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(t)}const Qe={transitional:Cs,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const s=n.getContentType()||"",i=s.indexOf("application/json")>-1,r=w.isObject(e);if(r&&w.isHTMLForm(e)&&(e=new FormData(e)),w.isFormData(e))return i?JSON.stringify(Os(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 a;if(r){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Ao(e,this.formSerializer).toString();if((a=w.isFileList(e))||s.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Et(a?{"files[]":e}:e,u&&new u,this.formSerializer)}}return r||i?(n.setContentType("application/json",!1),Mo(e)):e}],transformResponse:[function(e){const n=this.transitional||Qe.transitional,s=n&&n.forcedJSONParsing,i=this.responseType==="json";if(w.isResponse(e)||w.isReadableStream(e))return e;if(e&&w.isString(e)&&(s&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?V.from(a,V.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Z.classes.FormData,Blob:Z.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 Vo=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"]),No=t=>{const e={};let n,s,i;return t&&t.split(`
|
3
|
+
`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),s=o.substring(i+1).trim(),!(!n||e[n]&&Vo[n])&&(n==="set-cookie"?e[n]?e[n].push(s):e[n]=[s]:e[n]=e[n]?e[n]+", "+s:s)}),e},Ts=Symbol("internals");function et(t){return t&&String(t).trim().toLowerCase()}function Ct(t){return t===!1||t==null?t:w.isArray(t)?t.map(Ct):String(t)}function Uo(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(t);)e[s[1]]=s[2];return e}const Io=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ln(t,e,n,s,i){if(w.isFunction(s))return s.call(this,e,n);if(i&&(e=n),!!w.isString(e)){if(w.isString(s))return e.indexOf(s)!==-1;if(w.isRegExp(s))return s.test(e)}}function Fo(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,s)=>n.toUpperCase()+s)}function Lo(t,e){const n=w.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+n,{value:function(i,r,o){return this[s].call(this,e,i,r,o)},configurable:!0})})}let ne=class{constructor(e){e&&this.set(e)}set(e,n,s){const i=this;function r(a,u,d){const h=et(u);if(!h)throw new Error("header name must be a non-empty string");const m=w.findKey(i,h);(!m||i[m]===void 0||d===!0||d===void 0&&i[m]!==!1)&&(i[m||u]=Ct(a))}const o=(a,u)=>w.forEach(a,(d,h)=>r(d,h,u));if(w.isPlainObject(e)||e instanceof this.constructor)o(e,n);else if(w.isString(e)&&(e=e.trim())&&!Io(e))o(No(e),n);else if(w.isHeaders(e))for(const[a,u]of e.entries())r(u,a,s);else e!=null&&r(n,e,s);return this}get(e,n){if(e=et(e),e){const s=w.findKey(this,e);if(s){const i=this[s];if(!n)return i;if(n===!0)return Uo(i);if(w.isFunction(n))return n.call(this,i,s);if(w.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=et(e),e){const s=w.findKey(this,e);return!!(s&&this[s]!==void 0&&(!n||ln(this,this[s],s,n)))}return!1}delete(e,n){const s=this;let i=!1;function r(o){if(o=et(o),o){const a=w.findKey(s,o);a&&(!n||ln(s,s[a],a,n))&&(delete s[a],i=!0)}}return w.isArray(e)?e.forEach(r):r(e),i}clear(e){const n=Object.keys(this);let s=n.length,i=!1;for(;s--;){const r=n[s];(!e||ln(this,this[r],r,e,!0))&&(delete this[r],i=!0)}return i}normalize(e){const n=this,s={};return w.forEach(this,(i,r)=>{const o=w.findKey(s,r);if(o){n[o]=Ct(i),delete n[r];return}const a=e?Fo(r):String(r).trim();a!==r&&delete n[r],n[a]=Ct(i),s[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return w.forEach(this,(s,i)=>{s!=null&&s!==!1&&(n[i]=e&&w.isArray(s)?s.join(", "):s)}),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 s=new this(e);return n.forEach(i=>s.set(i)),s}static accessor(e){const s=(this[Ts]=this[Ts]={accessors:{}}).accessors,i=this.prototype;function r(o){const a=et(o);s[a]||(Lo(i,o),s[a]=!0)}return w.isArray(e)?e.forEach(r):r(e),this}};ne.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),w.reduceDescriptors(ne.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[n]=s}}}),w.freezeMethods(ne);function cn(t,e){const n=this||Qe,s=e||n,i=ne.from(s.headers);let r=s.data;return w.forEach(t,function(a){r=a.call(n,r,i.normalize(),e?e.status:void 0)}),i.normalize(),r}function Rs(t){return!!(t&&t.__CANCEL__)}function Be(t,e,n){V.call(this,t??"canceled",V.ERR_CANCELED,e,n),this.name="CanceledError"}w.inherits(Be,V,{__CANCEL__:!0});function As(t,e,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?t(n):e(new V("Request failed with status code "+n.status,[V.ERR_BAD_REQUEST,V.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function zo(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function qo(t,e){t=t||10;const n=new Array(t),s=new Array(t);let i=0,r=0,o;return e=e!==void 0?e:1e3,function(u){const d=Date.now(),h=s[r];o||(o=d),n[i]=u,s[i]=d;let m=r,g=0;for(;m!==i;)g+=n[m++],m=m%t;if(i=(i+1)%t,i===r&&(r=(r+1)%t),d-o<e)return;const b=h&&d-h;return b?Math.round(g*1e3/b):void 0}}function Bo(t,e){let n=0,s=1e3/e,i,r;const o=(d,h=Date.now())=>{n=h,i=null,r&&(clearTimeout(r),r=null),t.apply(null,d)};return[(...d)=>{const h=Date.now(),m=h-n;m>=s?o(d,h):(i=d,r||(r=setTimeout(()=>{r=null,o(i)},s-m)))},()=>i&&o(i)]}const Ot=(t,e,n=3)=>{let s=0;const i=qo(50,250);return Bo(r=>{const o=r.loaded,a=r.lengthComputable?r.total:void 0,u=o-s,d=i(u),h=o<=a;s=o;const m={loaded:o,total:a,progress:a?o/a:void 0,bytes:u,rate:d||void 0,estimated:d&&a&&h?(a-o)/d:void 0,event:r,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(m)},n)},Ps=(t,e)=>{const n=t!=null;return[s=>e[0]({lengthComputable:n,total:t,loaded:s}),e[1]]},Ds=t=>(...e)=>w.asap(()=>t(...e)),jo=Z.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Z.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Z.origin),Z.navigator&&/(msie|trident)/i.test(Z.navigator.userAgent)):()=>!0,$o=Z.hasStandardBrowserEnv?{write(t,e,n,s,i,r){const o=[t+"="+encodeURIComponent(e)];w.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),w.isString(s)&&o.push("path="+s),w.isString(i)&&o.push("domain="+i),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 Ho(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Wo(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Ms(t,e){return t&&!Ho(e)?Wo(t,e):e}const Vs=t=>t instanceof ne?{...t}:t;function Ae(t,e){e=e||{};const n={};function s(d,h,m,g){return w.isPlainObject(d)&&w.isPlainObject(h)?w.merge.call({caseless:g},d,h):w.isPlainObject(h)?w.merge({},h):w.isArray(h)?h.slice():h}function i(d,h,m,g){if(w.isUndefined(h)){if(!w.isUndefined(d))return s(void 0,d,m,g)}else return s(d,h,m,g)}function r(d,h){if(!w.isUndefined(h))return s(void 0,h)}function o(d,h){if(w.isUndefined(h)){if(!w.isUndefined(d))return s(void 0,d)}else return s(void 0,h)}function a(d,h,m){if(m in e)return s(d,h);if(m in t)return s(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:a,headers:(d,h,m)=>i(Vs(d),Vs(h),m,!0)};return w.forEach(Object.keys(Object.assign({},t,e)),function(h){const m=u[h]||i,g=m(t[h],e[h],h);w.isUndefined(g)&&m!==a||(n[h]=g)}),n}const Ns=t=>{const e=Ae({},t);let{data:n,withXSRFToken:s,xsrfHeaderName:i,xsrfCookieName:r,headers:o,auth:a}=e;e.headers=o=ne.from(o),e.url=xs(Ms(e.baseURL,e.url),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let u;if(w.isFormData(n)){if(Z.hasStandardBrowserEnv||Z.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((u=o.getContentType())!==!1){const[d,...h]=u?u.split(";").map(m=>m.trim()).filter(Boolean):[];o.setContentType([d||"multipart/form-data",...h].join("; "))}}if(Z.hasStandardBrowserEnv&&(s&&w.isFunction(s)&&(s=s(e)),s||s!==!1&&jo(e.url))){const d=i&&r&&$o.read(r);d&&o.set(i,d)}return e},Jo=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,s){const i=Ns(t);let r=i.data;const o=ne.from(i.headers).normalize();let{responseType:a,onUploadProgress:u,onDownloadProgress:d}=i,h,m,g,b,y;function f(){b&&b(),y&&y(),i.cancelToken&&i.cancelToken.unsubscribe(h),i.signal&&i.signal.removeEventListener("abort",h)}let v=new XMLHttpRequest;v.open(i.method.toUpperCase(),i.url,!0),v.timeout=i.timeout;function T(){if(!v)return;const A=ne.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),E={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:A,config:t,request:v};As(function(z){n(z),f()},function(z){s(z),f()},E),v=null}"onloadend"in v?v.onloadend=T:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(T)},v.onabort=function(){v&&(s(new V("Request aborted",V.ECONNABORTED,t,v)),v=null)},v.onerror=function(){s(new V("Network Error",V.ERR_NETWORK,t,v)),v=null},v.ontimeout=function(){let B=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const E=i.transitional||Cs;i.timeoutErrorMessage&&(B=i.timeoutErrorMessage),s(new V(B,E.clarifyTimeoutError?V.ETIMEDOUT:V.ECONNABORTED,t,v)),v=null},r===void 0&&o.setContentType(null),"setRequestHeader"in v&&w.forEach(o.toJSON(),function(B,E){v.setRequestHeader(E,B)}),w.isUndefined(i.withCredentials)||(v.withCredentials=!!i.withCredentials),a&&a!=="json"&&(v.responseType=i.responseType),d&&([g,y]=Ot(d,!0),v.addEventListener("progress",g)),u&&v.upload&&([m,b]=Ot(u),v.upload.addEventListener("progress",m),v.upload.addEventListener("loadend",b)),(i.cancelToken||i.signal)&&(h=A=>{v&&(s(!A||A.type?new Be(null,t,v):A),v.abort(),v=null)},i.cancelToken&&i.cancelToken.subscribe(h),i.signal&&(i.signal.aborted?h():i.signal.addEventListener("abort",h)));const C=zo(i.url);if(C&&Z.protocols.indexOf(C)===-1){s(new V("Unsupported protocol "+C+":",V.ERR_BAD_REQUEST,t));return}v.send(r||null)})},Go=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let s=new AbortController,i;const r=function(d){if(!i){i=!0,a();const h=d instanceof Error?d:this.reason;s.abort(h instanceof V?h:new Be(h instanceof Error?h.message:h))}};let o=e&&setTimeout(()=>{o=null,r(new V(`timeout ${e} of ms exceeded`,V.ETIMEDOUT))},e);const a=()=>{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}=s;return u.unsubscribe=()=>w.asap(a),u}},Yo=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let s=0,i;for(;s<n;)i=s+e,yield t.slice(s,i),s=i},Ko=async function*(t,e){for await(const n of Xo(t))yield*Yo(n,e)},Xo=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:s}=await e.read();if(n)break;yield s}}finally{await e.cancel()}},Us=(t,e,n,s)=>{const i=Ko(t,e);let r=0,o,a=u=>{o||(o=!0,s&&s(u))};return new ReadableStream({async pull(u){try{const{done:d,value:h}=await i.next();if(d){a(),u.close();return}let m=h.byteLength;if(n){let g=r+=m;n(g)}u.enqueue(new Uint8Array(h))}catch(d){throw a(d),d}},cancel(u){return a(u),i.return()}},{highWaterMark:2})},Tt=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Is=Tt&&typeof ReadableStream=="function",Zo=Tt&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Fs=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Qo=Is&&Fs(()=>{let t=!1;const e=new Request(Z.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Ls=64*1024,un=Is&&Fs(()=>w.isReadableStream(new Response("").body)),Rt={stream:un&&(t=>t.body)};Tt&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Rt[e]&&(Rt[e]=w.isFunction(t[e])?n=>n[e]():(n,s)=>{throw new V(`Response type '${e}' is not supported`,V.ERR_NOT_SUPPORT,s)})})})(new Response);const ea=async t=>{if(t==null)return 0;if(w.isBlob(t))return t.size;if(w.isSpecCompliantForm(t))return(await new Request(Z.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 Zo(t)).byteLength},ta=async(t,e)=>{const n=w.toFiniteNumber(t.getContentLength());return n??ea(e)},dn={http:So,xhr:Jo,fetch:Tt&&(async t=>{let{url:e,method:n,data:s,signal:i,cancelToken:r,timeout:o,onDownloadProgress:a,onUploadProgress:u,responseType:d,headers:h,withCredentials:m="same-origin",fetchOptions:g}=Ns(t);d=d?(d+"").toLowerCase():"text";let b=Go([i,r&&r.toAbortSignal()],o),y;const f=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let v;try{if(u&&Qo&&n!=="get"&&n!=="head"&&(v=await ta(h,s))!==0){let E=new Request(e,{method:"POST",body:s,duplex:"half"}),R;if(w.isFormData(s)&&(R=E.headers.get("content-type"))&&h.setContentType(R),E.body){const[z,G]=Ps(v,Ot(Ds(u)));s=Us(E.body,Ls,z,G)}}w.isString(m)||(m=m?"include":"omit");const T="credentials"in Request.prototype;y=new Request(e,{...g,signal:b,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:s,duplex:"half",credentials:T?m:void 0});let C=await fetch(y);const A=un&&(d==="stream"||d==="response");if(un&&(a||A&&f)){const E={};["status","statusText","headers"].forEach(te=>{E[te]=C[te]});const R=w.toFiniteNumber(C.headers.get("content-length")),[z,G]=a&&Ps(R,Ot(Ds(a),!0))||[];C=new Response(Us(C.body,Ls,z,()=>{G&&G(),f&&f()}),E)}d=d||"text";let B=await Rt[w.findKey(Rt,d)||"text"](C,t);return!A&&f&&f(),await new Promise((E,R)=>{As(E,R,{data:B,headers:ne.from(C.headers),status:C.status,statusText:C.statusText,config:t,request:y})})}catch(T){throw f&&f(),T&&T.name==="TypeError"&&/fetch/i.test(T.message)?Object.assign(new V("Network Error",V.ERR_NETWORK,t,y),{cause:T.cause||T}):V.from(T,T&&T.code,t,y)}})};w.forEach(dn,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const zs=t=>`- ${t}`,na=t=>w.isFunction(t)||t===null||t===!1,qs={getAdapter:t=>{t=w.isArray(t)?t:[t];const{length:e}=t;let n,s;const i={};for(let r=0;r<e;r++){n=t[r];let o;if(s=n,!na(n)&&(s=dn[(o=String(n)).toLowerCase()],s===void 0))throw new V(`Unknown adapter '${o}'`);if(s)break;i[o||"#"+r]=s}if(!s){const r=Object.entries(i).map(([a,u])=>`adapter ${a} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=e?r.length>1?`since :
|
5
|
+
`+r.map(zs).join(`
|
6
|
+
`):" "+zs(r[0]):"as no adapter specified";throw new V("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return s},adapters:dn};function hn(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Be(null,t)}function Bs(t){return hn(t),t.headers=ne.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),qs.getAdapter(t.adapter||Qe.adapter)(t).then(function(s){return hn(t),s.data=cn.call(t,t.transformResponse,s),s.headers=ne.from(s.headers),s},function(s){return Rs(s)||(hn(t),s&&s.response&&(s.response.data=cn.call(t,t.transformResponse,s.response),s.response.headers=ne.from(s.response.headers))),Promise.reject(s)})}const js="1.7.9",At={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{At[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const $s={};At.transitional=function(e,n,s){function i(r,o){return"[Axios v"+js+"] Transitional option '"+r+"'"+o+(s?". "+s:"")}return(r,o,a)=>{if(e===!1)throw new V(i(o," has been removed"+(n?" in "+n:"")),V.ERR_DEPRECATED);return n&&!$s[o]&&($s[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(r,o,a):!0}},At.spelling=function(e){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${e}`),!0)};function sa(t,e,n){if(typeof t!="object")throw new V("options must be an object",V.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let i=s.length;for(;i-- >0;){const r=s[i],o=e[r];if(o){const a=t[r],u=a===void 0||o(a,r,t);if(u!==!0)throw new V("option "+r+" must be "+u,V.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new V("Unknown option "+r,V.ERR_BAD_OPTION)}}const Pt={assertOptions:sa,validators:At},ye=Pt.validators;let Pe=class{constructor(e){this.defaults=e,this.interceptors={request:new Es,response:new Es}}async request(e,n){try{return await this._request(e,n)}catch(s){if(s instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const r=i.stack?i.stack.replace(/^.+\n/,""):"";try{s.stack?r&&!String(s.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
7
|
+
`+r):s.stack=r}catch{}}throw s}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Ae(this.defaults,n);const{transitional:s,paramsSerializer:i,headers:r}=n;s!==void 0&&Pt.assertOptions(s,{silentJSONParsing:ye.transitional(ye.boolean),forcedJSONParsing:ye.transitional(ye.boolean),clarifyTimeoutError:ye.transitional(ye.boolean)},!1),i!=null&&(w.isFunction(i)?n.paramsSerializer={serialize:i}:Pt.assertOptions(i,{encode:ye.function,serialize:ye.function},!0)),Pt.assertOptions(n,{baseUrl:ye.spelling("baseURL"),withXsrfToken:ye.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"],y=>{delete r[y]}),n.headers=ne.concat(o,r);const a=[];let u=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(n)===!1||(u=u&&f.synchronous,a.unshift(f.fulfilled,f.rejected))});const d=[];this.interceptors.response.forEach(function(f){d.push(f.fulfilled,f.rejected)});let h,m=0,g;if(!u){const y=[Bs.bind(this),void 0];for(y.unshift.apply(y,a),y.push.apply(y,d),g=y.length,h=Promise.resolve(n);m<g;)h=h.then(y[m++],y[m++]);return h}g=a.length;let b=n;for(m=0;m<g;){const y=a[m++],f=a[m++];try{b=y(b)}catch(v){f.call(this,v);break}}try{h=Bs.call(this,b)}catch(y){return Promise.reject(y)}for(m=0,g=d.length;m<g;)h=h.then(d[m++],d[m++]);return h}getUri(e){e=Ae(this.defaults,e);const n=Ms(e.baseURL,e.url);return xs(n,e.params,e.paramsSerializer)}};w.forEach(["delete","get","head","options"],function(e){Pe.prototype[e]=function(n,s){return this.request(Ae(s||{},{method:e,url:n,data:(s||{}).data}))}}),w.forEach(["post","put","patch"],function(e){function n(s){return function(r,o,a){return this.request(Ae(a||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}Pe.prototype[e]=n(),Pe.prototype[e+"Form"]=n(!0)});let ia=class hr{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 s=this;this.promise.then(i=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](i);s._listeners=null}),this.promise.then=i=>{let r;const o=new Promise(a=>{s.subscribe(a),r=a}).then(i);return o.cancel=function(){s.unsubscribe(r)},o},e(function(r,o,a){s.reason||(s.reason=new Be(r,o,a),n(s.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=s=>{e.abort(s)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new hr(function(i){e=i}),cancel:e}}};function ra(t){return function(n){return t.apply(null,n)}}function oa(t){return w.isObject(t)&&t.isAxiosError===!0}const pn={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(pn).forEach(([t,e])=>{pn[e]=t});function Hs(t){const e=new Pe(t),n=ls(Pe.prototype.request,e);return w.extend(n,Pe.prototype,e,{allOwnKeys:!0}),w.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Hs(Ae(t,i))},n}const H=Hs(Qe);H.Axios=Pe,H.CanceledError=Be,H.CancelToken=ia,H.isCancel=Rs,H.VERSION=js,H.toFormData=Et,H.AxiosError=V,H.Cancel=H.CanceledError,H.all=function(e){return Promise.all(e)},H.spread=ra,H.isAxiosError=oa,H.mergeConfig=Ae,H.AxiosHeaders=ne,H.formToJSON=t=>Os(w.isHTMLForm(t)?new FormData(t):t),H.getAdapter=qs.getAdapter,H.HttpStatusCode=pn,H.default=H;const{Axios:Vp,AxiosError:Np,CanceledError:Up,isCancel:Ip,CancelToken:Fp,VERSION:Lp,all:zp,Cancel:qp,isAxiosError:Bp,spread:jp,toFormData:$p,AxiosHeaders:Hp,HttpStatusCode:Wp,formToJSON:Jp,getAdapter:Gp,mergeConfig:Yp}=H,Ws=6048e5,aa=864e5,Js=Symbol.for("constructDateFrom");function xe(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Js in t?t[Js](e):t instanceof Date?new t.constructor(e):new Date(e)}function me(t,e){return xe(e||t,t)}let la={};function Dt(){return la}function tt(t,e){var a,u,d,h;const n=Dt(),s=(e==null?void 0:e.weekStartsOn)??((u=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((h=(d=n.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??0,i=me(t,e==null?void 0:e.in),r=i.getDay(),o=(r<s?7:0)+r-s;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Mt(t,e){return tt(t,{...e,weekStartsOn:1})}function Gs(t,e){const n=me(t,e==null?void 0:e.in),s=n.getFullYear(),i=xe(n,0);i.setFullYear(s+1,0,4),i.setHours(0,0,0,0);const r=Mt(i),o=xe(n,0);o.setFullYear(s,0,4),o.setHours(0,0,0,0);const a=Mt(o);return n.getTime()>=r.getTime()?s+1:n.getTime()>=a.getTime()?s:s-1}function Ys(t){const e=me(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 ca(t,...e){const n=xe.bind(null,e.find(s=>typeof s=="object"));return e.map(n)}function Ks(t,e){const n=me(t,e==null?void 0:e.in);return n.setHours(0,0,0,0),n}function ua(t,e,n){const[s,i]=ca(n==null?void 0:n.in,t,e),r=Ks(s),o=Ks(i),a=+r-Ys(r),u=+o-Ys(o);return Math.round((a-u)/aa)}function da(t,e){const n=Gs(t,e),s=xe(t,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),Mt(s)}function ha(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function pa(t){return!(!ha(t)&&typeof t!="number"||isNaN(+me(t)))}function ma(t,e){const n=me(t,e==null?void 0:e.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const fa={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"}},ga=(t,e,n)=>{let s;const i=fa[t];return typeof i=="string"?s=i:e===1?s=i.one:s=i.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+s:s+" ago":s};function mn(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const ba={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ya={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},wa={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},_a={date:mn({formats:ba,defaultWidth:"full"}),time:mn({formats:ya,defaultWidth:"full"}),dateTime:mn({formats:wa,defaultWidth:"full"})},va={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Sa=(t,e,n,s)=>va[t];function nt(t){return(e,n)=>{const s=n!=null&&n.context?String(n.context):"standalone";let i;if(s==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=n!=null&&n.width?String(n.width):o;i=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=n!=null&&n.width?String(n.width):t.defaultWidth;i=t.values[a]||t.values[o]}const r=t.argumentCallback?t.argumentCallback(e):e;return i[r]}}const ka={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},xa={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ea={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"]},Ca={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"]},Oa={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"}},Ta={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"}},Ra={ordinalNumber:(t,e)=>{const n=Number(t),s=n%100;if(s>20||s<10)switch(s%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:nt({values:ka,defaultWidth:"wide"}),quarter:nt({values:xa,defaultWidth:"wide",argumentCallback:t=>t-1}),month:nt({values:Ea,defaultWidth:"wide"}),day:nt({values:Ca,defaultWidth:"wide"}),dayPeriod:nt({values:Oa,defaultWidth:"wide",formattingValues:Ta,defaultFormattingWidth:"wide"})};function st(t){return(e,n={})=>{const s=n.width,i=s&&t.matchPatterns[s]||t.matchPatterns[t.defaultMatchWidth],r=e.match(i);if(!r)return null;const o=r[0],a=s&&t.parsePatterns[s]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(a)?Pa(a,m=>m.test(o)):Aa(a,m=>m.test(o));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const h=e.slice(o.length);return{value:d,rest:h}}}function Aa(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Pa(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Da(t){return(e,n={})=>{const s=e.match(t.matchPattern);if(!s)return null;const i=s[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 a=e.slice(i.length);return{value:o,rest:a}}}const Ma=/^(\d+)(th|st|nd|rd)?/i,Va=/\d+/i,Na={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},Ua={any:[/^b/i,/^(a|c)/i]},Ia={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Fa={any:[/1/i,/2/i,/3/i,/4/i]},La={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},za={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]},qa={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},Ba={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]},ja={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},$a={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}},Ha={ordinalNumber:Da({matchPattern:Ma,parsePattern:Va,valueCallback:t=>parseInt(t,10)}),era:st({matchPatterns:Na,defaultMatchWidth:"wide",parsePatterns:Ua,defaultParseWidth:"any"}),quarter:st({matchPatterns:Ia,defaultMatchWidth:"wide",parsePatterns:Fa,defaultParseWidth:"any",valueCallback:t=>t+1}),month:st({matchPatterns:La,defaultMatchWidth:"wide",parsePatterns:za,defaultParseWidth:"any"}),day:st({matchPatterns:qa,defaultMatchWidth:"wide",parsePatterns:Ba,defaultParseWidth:"any"}),dayPeriod:st({matchPatterns:ja,defaultMatchWidth:"any",parsePatterns:$a,defaultParseWidth:"any"})},Wa={code:"en-US",formatDistance:ga,formatLong:_a,formatRelative:Sa,localize:Ra,match:Ha,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ja(t,e){const n=me(t,e==null?void 0:e.in);return ua(n,ma(n))+1}function Ga(t,e){const n=me(t,e==null?void 0:e.in),s=+Mt(n)-+da(n);return Math.round(s/Ws)+1}function Xs(t,e){var h,m,g,b;const n=me(t,e==null?void 0:e.in),s=n.getFullYear(),i=Dt(),r=(e==null?void 0:e.firstWeekContainsDate)??((m=(h=e==null?void 0:e.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??i.firstWeekContainsDate??((b=(g=i.locale)==null?void 0:g.options)==null?void 0:b.firstWeekContainsDate)??1,o=xe((e==null?void 0:e.in)||t,0);o.setFullYear(s+1,0,r),o.setHours(0,0,0,0);const a=tt(o,e),u=xe((e==null?void 0:e.in)||t,0);u.setFullYear(s,0,r),u.setHours(0,0,0,0);const d=tt(u,e);return+n>=+a?s+1:+n>=+d?s:s-1}function Ya(t,e){var a,u,d,h;const n=Dt(),s=(e==null?void 0:e.firstWeekContainsDate)??((u=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((h=(d=n.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,i=Xs(t,e),r=xe((e==null?void 0:e.in)||t,0);return r.setFullYear(i,0,s),r.setHours(0,0,0,0),tt(r,e)}function Ka(t,e){const n=me(t,e==null?void 0:e.in),s=+tt(n,e)-+Ya(n,e);return Math.round(s/Ws)+1}function q(t,e){const n=t<0?"-":"",s=Math.abs(t).toString().padStart(e,"0");return n+s}const Ee={y(t,e){const n=t.getFullYear(),s=n>0?n:1-n;return q(e==="yy"?s%100:s,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):q(n+1,2)},d(t,e){return q(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 q(t.getHours()%12||12,e.length)},H(t,e){return q(t.getHours(),e.length)},m(t,e){return q(t.getMinutes(),e.length)},s(t,e){return q(t.getSeconds(),e.length)},S(t,e){const n=e.length,s=t.getMilliseconds(),i=Math.trunc(s*Math.pow(10,n-3));return q(i,e.length)}},je={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Zs={G:function(t,e,n){const s=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});case"GGGG":default:return n.era(s,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const s=t.getFullYear(),i=s>0?s:1-s;return n.ordinalNumber(i,{unit:"year"})}return Ee.y(t,e)},Y:function(t,e,n,s){const i=Xs(t,s),r=i>0?i:1-i;if(e==="YY"){const o=r%100;return q(o,2)}return e==="Yo"?n.ordinalNumber(r,{unit:"year"}):q(r,e.length)},R:function(t,e){const n=Gs(t);return q(n,e.length)},u:function(t,e){const n=t.getFullYear();return q(n,e.length)},Q:function(t,e,n){const s=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(s);case"QQ":return q(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(t,e,n){const s=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(s);case"qq":return q(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(t,e,n){const s=t.getMonth();switch(e){case"M":case"MM":return Ee.M(t,e);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(t,e,n){const s=t.getMonth();switch(e){case"L":return String(s+1);case"LL":return q(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(t,e,n,s){const i=Ka(t,s);return e==="wo"?n.ordinalNumber(i,{unit:"week"}):q(i,e.length)},I:function(t,e,n){const s=Ga(t);return e==="Io"?n.ordinalNumber(s,{unit:"week"}):q(s,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Ee.d(t,e)},D:function(t,e,n){const s=Ja(t);return e==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):q(s,e.length)},E:function(t,e,n){const s=t.getDay();switch(e){case"E":case"EE":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"})}},e:function(t,e,n,s){const i=t.getDay(),r=(i-s.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return q(r,2);case"eo":return n.ordinalNumber(r,{unit:"day"});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"})}},c:function(t,e,n,s){const i=t.getDay(),r=(i-s.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return q(r,e.length);case"co":return n.ordinalNumber(r,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){const s=t.getDay(),i=s===0?7:s;switch(e){case"i":return String(i);case"ii":return q(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});case"iiii":default:return n.day(s,{width:"wide",context:"formatting"})}},a:function(t,e,n){const i=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,n){const s=t.getHours();let i;switch(s===12?i=je.noon:s===0?i=je.midnight:i=s/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,n){const s=t.getHours();let i;switch(s>=17?i=je.evening:s>=12?i=je.afternoon:s>=4?i=je.morning:i=je.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let s=t.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return Ee.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Ee.H(t,e)},K:function(t,e,n){const s=t.getHours()%12;return e==="Ko"?n.ordinalNumber(s,{unit:"hour"}):q(s,e.length)},k:function(t,e,n){let s=t.getHours();return s===0&&(s=24),e==="ko"?n.ordinalNumber(s,{unit:"hour"}):q(s,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Ee.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Ee.s(t,e)},S:function(t,e){return Ee.S(t,e)},X:function(t,e,n){const s=t.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return ei(s);case"XXXX":case"XX":return De(s);case"XXXXX":case"XXX":default:return De(s,":")}},x:function(t,e,n){const s=t.getTimezoneOffset();switch(e){case"x":return ei(s);case"xxxx":case"xx":return De(s);case"xxxxx":case"xxx":default:return De(s,":")}},O:function(t,e,n){const s=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Qs(s,":");case"OOOO":default:return"GMT"+De(s,":")}},z:function(t,e,n){const s=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Qs(s,":");case"zzzz":default:return"GMT"+De(s,":")}},t:function(t,e,n){const s=Math.trunc(+t/1e3);return q(s,e.length)},T:function(t,e,n){return q(+t,e.length)}};function Qs(t,e=""){const n=t>0?"-":"+",s=Math.abs(t),i=Math.trunc(s/60),r=s%60;return r===0?n+String(i):n+String(i)+e+q(r,2)}function ei(t,e){return t%60===0?(t>0?"-":"+")+q(Math.abs(t)/60,2):De(t,e)}function De(t,e=""){const n=t>0?"-":"+",s=Math.abs(t),i=q(Math.trunc(s/60),2),r=q(s%60,2);return n+i+e+r}const ti=(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"})}},ni=(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"})}},Xa={p:ni,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],s=n[1],i=n[2];if(!i)return ti(t,e);let r;switch(s){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}}",ti(s,e)).replace("{{time}}",ni(i,e))}},Za=/^D+$/,Qa=/^Y+$/,el=["D","DD","YY","YYYY"];function tl(t){return Za.test(t)}function nl(t){return Qa.test(t)}function sl(t,e,n){const s=il(t,e,n);if(console.warn(s),el.includes(t))throw new RangeError(s)}function il(t,e,n){const s=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const rl=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ol=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,al=/^'([^]*?)'?$/,ll=/''/g,cl=/[a-zA-Z]/;function it(t,e,n){var h,m,g,b;const s=Dt(),i=s.locale??Wa,r=s.firstWeekContainsDate??((m=(h=s.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,o=s.weekStartsOn??((b=(g=s.locale)==null?void 0:g.options)==null?void 0:b.weekStartsOn)??0,a=me(t,n==null?void 0:n.in);if(!pa(a))throw new RangeError("Invalid time value");let u=e.match(ol).map(y=>{const f=y[0];if(f==="p"||f==="P"){const v=Xa[f];return v(y,i.formatLong)}return y}).join("").match(rl).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const f=y[0];if(f==="'")return{isToken:!1,value:ul(y)};if(Zs[f])return{isToken:!0,value:y};if(f.match(cl))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:y}});i.localize.preprocessor&&(u=i.localize.preprocessor(a,u));const d={firstWeekContainsDate:r,weekStartsOn:o,locale:i};return u.map(y=>{if(!y.isToken)return y.value;const f=y.value;(nl(f)||tl(f))&&sl(f,e,String(t));const v=Zs[f[0]];return v(a,f,i.localize,d)}).join("")}function ul(t){const e=t.match(al);return e?e[1].replace(ll,"'"):t}const dl={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((s,i)=>(s.size=i===e?s.max:s.min,i!==e&&(n+=s.min),s)),this.panes[e].size-=n,this.$emit("pane-maximize",this.panes[e]),this.$emit("resized",this.panes.map(s=>({min:s.min,max:s.max,size:s.size})))},onPaneClick(t,e){this.$emit("pane-click",this.indexedPanes[e])},getCurrentMouseDrag(t){const e=this.container.getBoundingClientRect(),{clientX:n,clientY:s}="ontouchstart"in window&&t.touches?t.touches[0]:t;return{x:n-e.left,y:s-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 s=0+(this.pushOtherPanes?0:n.prevPanesSize),i=100-(this.pushOtherPanes?0:n.nextPanesSize),r=Math.max(Math.min(this.getCurrentDragPercentage(t),i),s);let o=[e,e+1],a=this.panes[o[0]]||null,u=this.panes[o[1]]||null;const d=a.max<100&&r>=a.max+n.prevPanesSize,h=u.max<100&&r<=100-(u.max+this.sumNextPanesSize(e+1));if(d||h){d?(a.size=a.max,u.size=Math.max(100-a.max-n.prevPanesSize-n.nextPanesSize,0)):(a.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),a=this.panes[o[0]]||null,u=this.panes[o[1]]||null}a!==null&&(a.size=Math.min(Math.max(r-n.prevPanesSize-n.prevReachedMinPanes,a.min),a.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,s=[n,n+1];return e<t.prevPanesSize+this.panes[s[0]].min&&(s[0]=this.findPrevExpandedPane(n).index,t.prevReachedMinPanes=0,s[0]<n&&this.panes.forEach((i,r)=>{r>s[0]&&r<=n&&(i.size=i.min,t.prevReachedMinPanes+=i.min)}),t.prevPanesSize=this.sumPrevPanesSize(s[0]),s[0]===void 0)?(t.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((i,r)=>{r>0&&r<=n&&(i.size=i.min,t.prevReachedMinPanes+=i.min)}),this.panes[s[1]].size=100-t.prevReachedMinPanes-this.panes[0].min-t.prevPanesSize-t.nextPanesSize,null):e>100-t.nextPanesSize-this.panes[s[1]].min&&(s[1]=this.findNextExpandedPane(n).index,t.nextReachedMinPanes=0,s[1]>n+1&&this.panes.forEach((i,r)=>{r>n&&r<s[1]&&(i.size=i.min,t.nextReachedMinPanes+=i.min)}),t.nextPanesSize=this.sumNextPanesSize(s[1]-1),s[1]===void 0)?(t.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((i,r)=>{r<this.panesCount-1&&r>=n+1&&(i.size=i.min,t.nextReachedMinPanes+=i.min)}),this.panes[s[0]].size=100-t.prevPanesSize-t.nextReachedMinPanes-this.panes[this.panesCount-1].min-t.nextPanesSize,null):{sums:t,panesToResize:s}},sumPrevPanesSize(t){return this.panes.reduce((e,n,s)=>e+(s<t?n.size:0),0)},sumNextPanesSize(t){return this.panes.reduce((e,n,s)=>e+(s>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 s=t-1,i=document.createElement("div");i.classList.add("splitpanes__splitter"),n||(i.onmousedown=r=>this.onMouseDown(r,s),typeof window<"u"&&"ontouchstart"in window&&(i.ontouchstart=r=>this.onMouseDown(r,s)),i.onclick=r=>this.onSplitterClick(r,s+1)),this.dblClickSplitter&&(i.ondblclick=r=>this.onSplitterDblClick(r,s+1)),e.parentNode.insertBefore(i,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(([s,i])=>n[s]=i)},onPaneAdd(t){let e=-1;Array.from(t.$el.parentNode.children).some(i=>(i.className.includes("splitpanes__pane")&&e++,i===t.$el));const n=parseFloat(t.minSize),s=parseFloat(t.maxSize);this.panes.splice(e,0,{id:t._.uid,index:e,min:isNaN(n)?0:n,max:isNaN(s)?100:s,size:t.size===null?null:parseFloat(t.size),givenSize:t.size,update:t.update}),this.panes.forEach((i,r)=>i.index=r),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[e]}),this.$emit("pane-add",{index:e,panes:this.panes.map(i=>({min:i.min,max:i.max,size:i.size}))})})},onPaneRemove(t){const e=this.panes.findIndex(s=>s.id===t._.uid),n=this.panes.splice(e,1)[0];this.panes.forEach((s,i)=>s.index=i),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:e}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(s=>({min:s.min,max:s.max,size:s.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=[],s=[];this.panes.forEach(i=>{i.size=Math.max(Math.min(t,i.max),i.min),e-=i.size,i.size>=i.max&&n.push(i.id),i.size<=i.min&&s.push(i.id)}),e>.1&&this.readjustSizes(e,n,s)},initialPanesSizing(){let t=100;const e=[],n=[];let s=0;this.panes.forEach(r=>{t-=r.size,r.size!==null&&s++,r.size>=r.max&&e.push(r.id),r.size<=r.min&&n.push(r.id)});let i=100;t>.1&&(this.panes.forEach(r=>{r.size===null&&(r.size=Math.max(Math.min(t/(this.panesCount-s),r.max),r.min)),i-=r.size}),i>.1&&this.readjustSizes(t,e,n))},equalizeAfterAddOrRemove({addedPane:t,removedPane:e}={}){let n=100/this.panesCount,s=0;const i=[],r=[];t&&t.givenSize!==null&&(n=(100-t.givenSize)/(this.panesCount-1)),this.panes.forEach(o=>{s-=o.size,o.size>=o.max&&i.push(o.id),o.size<=o.min&&r.push(o.id)}),!(Math.abs(s)<.1)&&(this.panes.forEach(o=>{t&&t.givenSize!==null&&t.id===o.id||(o.size=Math.max(Math.min(n,o.max),o.min)),s-=o.size,o.size>=o.max&&i.push(o.id),o.size<=o.min&&r.push(o.id)}),s>.1&&this.readjustSizes(s,i,r))},readjustSizes(t,e,n){let s;t>0?s=t/(this.panesCount-e.length):s=t/(this.panesCount-n.length),this.panes.forEach((i,r)=>{if(t>0&&!e.includes(i.id)){const o=Math.max(Math.min(i.size+s,i.max),i.min),a=o-i.size;t-=a,i.size=o}else if(!n.includes(i.id)){const o=Math.max(Math.min(i.size+s,i.max),i.min),a=o-i.size;t-=a,i.size=o}i.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[i.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?s=>this.onSplitterDblClick(s,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 Jn("div",{ref:"container",class:["splitpanes",`splitpanes--${this.horizontal?"horizontal":"vertical"}`,{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())}},hl=(t,e)=>{const n=t.__vccOpts||t;for(const[s,i]of e)n[s]=i;return n},pl={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 ml(t,e,n,s,i,r){return k(),D("div",{class:"splitpanes__pane",onClick:e[0]||(e[0]=o=>r.onPaneClick(o,t._.uid)),style:_t(t.style)},[Gn(t.$slots,"default")],4)}const fl=hl(pl,[["render",ml]]);var gl=Object.defineProperty,bl=(t,e,n)=>e in t?gl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Vt=(t,e,n)=>bl(t,typeof e!="symbol"?e+"":e,n);function si(t,e){return function(){return t.apply(e,arguments)}}const{toString:yl}=Object.prototype,{getPrototypeOf:fn}=Object,Nt=(t=>e=>{const n=yl.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),fe=t=>(t=t.toLowerCase(),e=>Nt(e)===t),Ut=t=>e=>typeof e===t,{isArray:$e}=Array,rt=Ut("undefined");function wl(t){return t!==null&&!rt(t)&&t.constructor!==null&&!rt(t.constructor)&&ae(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const ii=fe("ArrayBuffer");function _l(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&ii(t.buffer),e}const vl=Ut("string"),ae=Ut("function"),ri=Ut("number"),It=t=>t!==null&&typeof t=="object",Sl=t=>t===!0||t===!1,Ft=t=>{if(Nt(t)!=="object")return!1;const e=fn(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},kl=fe("Date"),xl=fe("File"),El=fe("Blob"),Cl=fe("FileList"),Ol=t=>It(t)&&ae(t.pipe),Tl=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||ae(t.append)&&((e=Nt(t))==="formdata"||e==="object"&&ae(t.toString)&&t.toString()==="[object FormData]"))},Rl=fe("URLSearchParams"),[Al,Pl,Dl,Ml]=["ReadableStream","Request","Response","Headers"].map(fe),Vl=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ot(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let s,i;if(typeof t!="object"&&(t=[t]),$e(t))for(s=0,i=t.length;s<i;s++)e.call(null,t[s],s,t);else{const r=n?Object.getOwnPropertyNames(t):Object.keys(t),o=r.length;let a;for(s=0;s<o;s++)a=r[s],e.call(null,t[a],a,t)}}function oi(t,e){e=e.toLowerCase();const n=Object.keys(t);let s=n.length,i;for(;s-- >0;)if(i=n[s],e===i.toLowerCase())return i;return null}const Me=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ai=t=>!rt(t)&&t!==Me;function gn(){const{caseless:t}=ai(this)&&this||{},e={},n=(s,i)=>{const r=t&&oi(e,i)||i;Ft(e[r])&&Ft(s)?e[r]=gn(e[r],s):Ft(s)?e[r]=gn({},s):$e(s)?e[r]=s.slice():e[r]=s};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&ot(arguments[s],n);return e}const Nl=(t,e,n,{allOwnKeys:s}={})=>(ot(e,(i,r)=>{n&&ae(i)?t[r]=si(i,n):t[r]=i},{allOwnKeys:s}),t),Ul=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Il=(t,e,n,s)=>{t.prototype=Object.create(e.prototype,s),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},Fl=(t,e,n,s)=>{let i,r,o;const a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),r=i.length;r-- >0;)o=i[r],(!s||s(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=n!==!1&&fn(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Ll=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const s=t.indexOf(e,n);return s!==-1&&s===n},zl=t=>{if(!t)return null;if($e(t))return t;let e=t.length;if(!ri(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},ql=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&fn(Uint8Array)),Bl=(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let s;for(;(s=n.next())&&!s.done;){const i=s.value;e.call(t,i[0],i[1])}},jl=(t,e)=>{let n;const s=[];for(;(n=t.exec(e))!==null;)s.push(n);return s},$l=fe("HTMLFormElement"),Hl=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,n,s){return n.toUpperCase()+s}),li=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Wl=fe("RegExp"),ci=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),s={};ot(n,(i,r)=>{let o;(o=e(i,r,t))!==!1&&(s[r]=o||i)}),Object.defineProperties(t,s)},Jl=t=>{ci(t,(e,n)=>{if(ae(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=t[n];if(ae(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Gl=(t,e)=>{const n={},s=i=>{i.forEach(r=>{n[r]=!0})};return $e(t)?s(t):s(String(t).split(e)),n},Yl=()=>{},Kl=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,bn="abcdefghijklmnopqrstuvwxyz",ui="0123456789",di={DIGIT:ui,ALPHA:bn,ALPHA_DIGIT:bn+bn.toUpperCase()+ui},Xl=(t=16,e=di.ALPHA_DIGIT)=>{let n="";const{length:s}=e;for(;t--;)n+=e[Math.random()*s|0];return n};function Zl(t){return!!(t&&ae(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const Ql=t=>{const e=new Array(10),n=(s,i)=>{if(It(s)){if(e.indexOf(s)>=0)return;if(!("toJSON"in s)){e[i]=s;const r=$e(s)?[]:{};return ot(s,(o,a)=>{const u=n(o,i+1);!rt(u)&&(r[a]=u)}),e[i]=void 0,r}}return s};return n(t,0)},ec=fe("AsyncFunction"),tc=t=>t&&(It(t)||ae(t))&&ae(t.then)&&ae(t.catch),hi=((t,e)=>t?setImmediate:e?((n,s)=>(Me.addEventListener("message",({source:i,data:r})=>{i===Me&&r===n&&s.length&&s.shift()()},!1),i=>{s.push(i),Me.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ae(Me.postMessage)),nc=typeof queueMicrotask<"u"?queueMicrotask.bind(Me):typeof process<"u"&&process.nextTick||hi,_={isArray:$e,isArrayBuffer:ii,isBuffer:wl,isFormData:Tl,isArrayBufferView:_l,isString:vl,isNumber:ri,isBoolean:Sl,isObject:It,isPlainObject:Ft,isReadableStream:Al,isRequest:Pl,isResponse:Dl,isHeaders:Ml,isUndefined:rt,isDate:kl,isFile:xl,isBlob:El,isRegExp:Wl,isFunction:ae,isStream:Ol,isURLSearchParams:Rl,isTypedArray:ql,isFileList:Cl,forEach:ot,merge:gn,extend:Nl,trim:Vl,stripBOM:Ul,inherits:Il,toFlatObject:Fl,kindOf:Nt,kindOfTest:fe,endsWith:Ll,toArray:zl,forEachEntry:Bl,matchAll:jl,isHTMLForm:$l,hasOwnProperty:li,hasOwnProp:li,reduceDescriptors:ci,freezeMethods:Jl,toObjectSet:Gl,toCamelCase:Hl,noop:Yl,toFiniteNumber:Kl,findKey:oi,global:Me,isContextDefined:ai,ALPHABET:di,generateString:Xl,isSpecCompliantForm:Zl,toJSONObject:Ql,isAsyncFn:ec,isThenable:tc,setImmediate:hi,asap:nc};function N(t,e,n,s,i){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),s&&(this.request=s),i&&(this.response=i,this.status=i.status?i.status:null)}_.inherits(N,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 pi=N.prototype,mi={};["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=>{mi[t]={value:t}}),Object.defineProperties(N,mi),Object.defineProperty(pi,"isAxiosError",{value:!0}),N.from=(t,e,n,s,i,r)=>{const o=Object.create(pi);return _.toFlatObject(t,o,function(a){return a!==Error.prototype},a=>a!=="isAxiosError"),N.call(o,t.message,e,n,s,i),o.cause=t,o.name=t.name,r&&Object.assign(o,r),o};const sc=null;function yn(t){return _.isPlainObject(t)||_.isArray(t)}function fi(t){return _.endsWith(t,"[]")?t.slice(0,-2):t}function gi(t,e,n){return t?t.concat(e).map(function(s,i){return s=fi(s),!n&&i?"["+s+"]":s}).join(n?".":""):e}function ic(t){return _.isArray(t)&&!t.some(yn)}const rc=_.toFlatObject(_,{},null,function(t){return/^is[A-Z]/.test(t)});function Lt(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(b,y){return!_.isUndefined(y[b])});const s=n.metaTokens,i=n.visitor||d,r=n.dots,o=n.indexes,a=(n.Blob||typeof Blob<"u"&&Blob)&&_.isSpecCompliantForm(e);if(!_.isFunction(i))throw new TypeError("visitor must be a function");function u(b){if(b===null)return"";if(_.isDate(b))return b.toISOString();if(!a&&_.isBlob(b))throw new N("Blob is not supported. Use a Buffer instead.");return _.isArrayBuffer(b)||_.isTypedArray(b)?a&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function d(b,y,f){let v=b;if(b&&!f&&typeof b=="object"){if(_.endsWith(y,"{}"))y=s?y:y.slice(0,-2),b=JSON.stringify(b);else if(_.isArray(b)&&ic(b)||(_.isFileList(b)||_.endsWith(y,"[]"))&&(v=_.toArray(b)))return y=fi(y),v.forEach(function(T,C){!(_.isUndefined(T)||T===null)&&e.append(o===!0?gi([y],C,r):o===null?y:y+"[]",u(T))}),!1}return yn(b)?!0:(e.append(gi(f,y,r),u(b)),!1)}const h=[],m=Object.assign(rc,{defaultVisitor:d,convertValue:u,isVisitable:yn});function g(b,y){if(!_.isUndefined(b)){if(h.indexOf(b)!==-1)throw Error("Circular reference detected in "+y.join("."));h.push(b),_.forEach(b,function(f,v){(!(_.isUndefined(f)||f===null)&&i.call(e,f,_.isString(v)?v.trim():v,y,m))===!0&&g(f,y?y.concat(v):[v])}),h.pop()}}if(!_.isObject(t))throw new TypeError("data must be an object");return g(t),e}function bi(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function wn(t,e){this._pairs=[],t&&Lt(t,this,e)}const yi=wn.prototype;yi.append=function(t,e){this._pairs.push([t,e])},yi.toString=function(t){const e=t?function(n){return t.call(this,n,bi)}:bi;return this._pairs.map(function(n){return e(n[0])+"="+e(n[1])},"").join("&")};function oc(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function wi(t,e,n){if(!e)return t;const s=n&&n.encode||oc;_.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let r;if(i?r=i(e,n):r=_.isURLSearchParams(e)?e.toString():new wn(e,n).toString(s),r){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+r}return t}class _i{constructor(){this.handlers=[]}use(e,n,s){return this.handlers.push({fulfilled:e,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.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 vi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ac=typeof URLSearchParams<"u"?URLSearchParams:wn,lc=typeof FormData<"u"?FormData:null,cc=typeof Blob<"u"?Blob:null,uc={isBrowser:!0,classes:{URLSearchParams:ac,FormData:lc,Blob:cc},protocols:["http","https","file","blob","url","data"]},_n=typeof window<"u"&&typeof document<"u",vn=typeof navigator=="object"&&navigator||void 0,dc=_n&&(!vn||["ReactNative","NativeScript","NS"].indexOf(vn.product)<0),hc=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",pc=_n&&window.location.href||"http://localhost",mc=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:_n,hasStandardBrowserEnv:dc,hasStandardBrowserWebWorkerEnv:hc,navigator:vn,origin:pc},Symbol.toStringTag,{value:"Module"})),Q={...mc,...uc};function fc(t,e){return Lt(t,new Q.classes.URLSearchParams,Object.assign({visitor:function(n,s,i,r){return Q.isNode&&_.isBuffer(n)?(this.append(s,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}function gc(t){return _.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function bc(t){const e={},n=Object.keys(t);let s;const i=n.length;let r;for(s=0;s<i;s++)r=n[s],e[r]=t[r];return e}function Si(t){function e(n,s,i,r){let o=n[r++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),u=r>=n.length;return o=!o&&_.isArray(i)?i.length:o,u?(_.hasOwnProp(i,o)?i[o]=[i[o],s]:i[o]=s,!a):((!i[o]||!_.isObject(i[o]))&&(i[o]=[]),e(n,s,i[o],r)&&_.isArray(i[o])&&(i[o]=bc(i[o])),!a)}if(_.isFormData(t)&&_.isFunction(t.entries)){const n={};return _.forEachEntry(t,(s,i)=>{e(gc(s),i,n,0)}),n}return null}function yc(t,e,n){if(_.isString(t))try{return(e||JSON.parse)(t),_.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(t)}const at={transitional:vi,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",s=n.indexOf("application/json")>-1,i=_.isObject(t);if(i&&_.isHTMLForm(t)&&(t=new FormData(t)),_.isFormData(t))return s?JSON.stringify(Si(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(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return fc(t,this.formSerializer).toString();if((r=_.isFileList(t))||n.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return Lt(r?{"files[]":t}:t,o&&new o,this.formSerializer)}}return i||s?(e.setContentType("application/json",!1),yc(t)):t}],transformResponse:[function(t){const e=this.transitional||at.transitional,n=e&&e.forcedJSONParsing,s=this.responseType==="json";if(_.isResponse(t)||_.isReadableStream(t))return t;if(t&&_.isString(t)&&(n&&!this.responseType||s)){const i=!(e&&e.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(r){if(i)throw r.name==="SyntaxError"?N.from(r,N.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:Q.classes.FormData,Blob:Q.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=>{at.headers[t]={}});const wc=_.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"]),_c=t=>{const e={};let n,s,i;return t&&t.split(`
|
8
|
+
`).forEach(function(r){i=r.indexOf(":"),n=r.substring(0,i).trim().toLowerCase(),s=r.substring(i+1).trim(),!(!n||e[n]&&wc[n])&&(n==="set-cookie"?e[n]?e[n].push(s):e[n]=[s]:e[n]=e[n]?e[n]+", "+s:s)}),e},ki=Symbol("internals");function lt(t){return t&&String(t).trim().toLowerCase()}function zt(t){return t===!1||t==null?t:_.isArray(t)?t.map(zt):String(t)}function vc(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(t);)e[s[1]]=s[2];return e}const Sc=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Sn(t,e,n,s,i){if(_.isFunction(s))return s.call(this,e,n);if(i&&(e=n),!!_.isString(e)){if(_.isString(s))return e.indexOf(s)!==-1;if(_.isRegExp(s))return s.test(e)}}function kc(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,s)=>n.toUpperCase()+s)}function xc(t,e){const n=_.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+n,{value:function(i,r,o){return this[s].call(this,e,i,r,o)},configurable:!0})})}let se=class{constructor(t){t&&this.set(t)}set(t,e,n){const s=this;function i(o,a,u){const d=lt(a);if(!d)throw new Error("header name must be a non-empty string");const h=_.findKey(s,d);(!h||s[h]===void 0||u===!0||u===void 0&&s[h]!==!1)&&(s[h||a]=zt(o))}const r=(o,a)=>_.forEach(o,(u,d)=>i(u,d,a));if(_.isPlainObject(t)||t instanceof this.constructor)r(t,e);else if(_.isString(t)&&(t=t.trim())&&!Sc(t))r(_c(t),e);else if(_.isHeaders(t))for(const[o,a]of t.entries())i(a,o,n);else t!=null&&i(e,t,n);return this}get(t,e){if(t=lt(t),t){const n=_.findKey(this,t);if(n){const s=this[n];if(!e)return s;if(e===!0)return vc(s);if(_.isFunction(e))return e.call(this,s,n);if(_.isRegExp(e))return e.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=lt(t),t){const n=_.findKey(this,t);return!!(n&&this[n]!==void 0&&(!e||Sn(this,this[n],n,e)))}return!1}delete(t,e){const n=this;let s=!1;function i(r){if(r=lt(r),r){const o=_.findKey(n,r);o&&(!e||Sn(n,n[o],o,e))&&(delete n[o],s=!0)}}return _.isArray(t)?t.forEach(i):i(t),s}clear(t){const e=Object.keys(this);let n=e.length,s=!1;for(;n--;){const i=e[n];(!t||Sn(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const e=this,n={};return _.forEach(this,(s,i)=>{const r=_.findKey(n,i);if(r){e[r]=zt(s),delete e[i];return}const o=t?kc(i):String(i).trim();o!==i&&delete e[i],e[o]=zt(s),n[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return _.forEach(this,(n,s)=>{n!=null&&n!==!1&&(e[s]=t&&_.isArray(n)?n.join(", "):n)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
|
9
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach(s=>n.set(s)),n}static accessor(t){const e=(this[ki]=this[ki]={accessors:{}}).accessors,n=this.prototype;function s(i){const r=lt(i);e[r]||(xc(n,i),e[r]=!0)}return _.isArray(t)?t.forEach(s):s(t),this}};se.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),_.reduceDescriptors(se.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[n]=s}}}),_.freezeMethods(se);function kn(t,e){const n=this||at,s=e||n,i=se.from(s.headers);let r=s.data;return _.forEach(t,function(o){r=o.call(n,r,i.normalize(),e?e.status:void 0)}),i.normalize(),r}function xi(t){return!!(t&&t.__CANCEL__)}function He(t,e,n){N.call(this,t??"canceled",N.ERR_CANCELED,e,n),this.name="CanceledError"}_.inherits(He,N,{__CANCEL__:!0});function Ei(t,e,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?t(n):e(new N("Request failed with status code "+n.status,[N.ERR_BAD_REQUEST,N.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Ec(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Cc(t,e){t=t||10;const n=new Array(t),s=new Array(t);let i=0,r=0,o;return e=e!==void 0?e:1e3,function(a){const u=Date.now(),d=s[r];o||(o=u),n[i]=a,s[i]=u;let h=r,m=0;for(;h!==i;)m+=n[h++],h=h%t;if(i=(i+1)%t,i===r&&(r=(r+1)%t),u-o<e)return;const g=d&&u-d;return g?Math.round(m*1e3/g):void 0}}function Oc(t,e){let n=0,s=1e3/e,i,r;const o=(a,u=Date.now())=>{n=u,i=null,r&&(clearTimeout(r),r=null),t.apply(null,a)};return[(...a)=>{const u=Date.now(),d=u-n;d>=s?o(a,u):(i=a,r||(r=setTimeout(()=>{r=null,o(i)},s-d)))},()=>i&&o(i)]}const qt=(t,e,n=3)=>{let s=0;const i=Cc(50,250);return Oc(r=>{const o=r.loaded,a=r.lengthComputable?r.total:void 0,u=o-s,d=i(u),h=o<=a;s=o;const m={loaded:o,total:a,progress:a?o/a:void 0,bytes:u,rate:d||void 0,estimated:d&&a&&h?(a-o)/d:void 0,event:r,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(m)},n)},Ci=(t,e)=>{const n=t!=null;return[s=>e[0]({lengthComputable:n,total:t,loaded:s}),e[1]]},Oi=t=>(...e)=>_.asap(()=>t(...e)),Tc=Q.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Q.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Q.origin),Q.navigator&&/(msie|trident)/i.test(Q.navigator.userAgent)):()=>!0,Rc=Q.hasStandardBrowserEnv?{write(t,e,n,s,i,r){const o=[t+"="+encodeURIComponent(e)];_.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),_.isString(s)&&o.push("path="+s),_.isString(i)&&o.push("domain="+i),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 Ac(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Pc(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Ti(t,e){return t&&!Ac(e)?Pc(t,e):e}const Ri=t=>t instanceof se?{...t}:t;function Ve(t,e){e=e||{};const n={};function s(d,h,m,g){return _.isPlainObject(d)&&_.isPlainObject(h)?_.merge.call({caseless:g},d,h):_.isPlainObject(h)?_.merge({},h):_.isArray(h)?h.slice():h}function i(d,h,m,g){if(_.isUndefined(h)){if(!_.isUndefined(d))return s(void 0,d,m,g)}else return s(d,h,m,g)}function r(d,h){if(!_.isUndefined(h))return s(void 0,h)}function o(d,h){if(_.isUndefined(h)){if(!_.isUndefined(d))return s(void 0,d)}else return s(void 0,h)}function a(d,h,m){if(m in e)return s(d,h);if(m in t)return s(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:a,headers:(d,h,m)=>i(Ri(d),Ri(h),m,!0)};return _.forEach(Object.keys(Object.assign({},t,e)),function(d){const h=u[d]||i,m=h(t[d],e[d],d);_.isUndefined(m)&&h!==a||(n[d]=m)}),n}const Ai=t=>{const e=Ve({},t);let{data:n,withXSRFToken:s,xsrfHeaderName:i,xsrfCookieName:r,headers:o,auth:a}=e;e.headers=o=se.from(o),e.url=wi(Ti(e.baseURL,e.url),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let u;if(_.isFormData(n)){if(Q.hasStandardBrowserEnv||Q.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((u=o.getContentType())!==!1){const[d,...h]=u?u.split(";").map(m=>m.trim()).filter(Boolean):[];o.setContentType([d||"multipart/form-data",...h].join("; "))}}if(Q.hasStandardBrowserEnv&&(s&&_.isFunction(s)&&(s=s(e)),s||s!==!1&&Tc(e.url))){const d=i&&r&&Rc.read(r);d&&o.set(i,d)}return e},Dc=typeof XMLHttpRequest<"u",Mc=Dc&&function(t){return new Promise(function(e,n){const s=Ai(t);let i=s.data;const r=se.from(s.headers).normalize();let{responseType:o,onUploadProgress:a,onDownloadProgress:u}=s,d,h,m,g,b;function y(){g&&g(),b&&b(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let f=new XMLHttpRequest;f.open(s.method.toUpperCase(),s.url,!0),f.timeout=s.timeout;function v(){if(!f)return;const C=se.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),A={data:!o||o==="text"||o==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:C,config:t,request:f};Ei(function(B){e(B),y()},function(B){n(B),y()},A),f=null}"onloadend"in f?f.onloadend=v:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(v)},f.onabort=function(){f&&(n(new N("Request aborted",N.ECONNABORTED,t,f)),f=null)},f.onerror=function(){n(new N("Network Error",N.ERR_NETWORK,t,f)),f=null},f.ontimeout=function(){let C=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const A=s.transitional||vi;s.timeoutErrorMessage&&(C=s.timeoutErrorMessage),n(new N(C,A.clarifyTimeoutError?N.ETIMEDOUT:N.ECONNABORTED,t,f)),f=null},i===void 0&&r.setContentType(null),"setRequestHeader"in f&&_.forEach(r.toJSON(),function(C,A){f.setRequestHeader(A,C)}),_.isUndefined(s.withCredentials)||(f.withCredentials=!!s.withCredentials),o&&o!=="json"&&(f.responseType=s.responseType),u&&([m,b]=qt(u,!0),f.addEventListener("progress",m)),a&&f.upload&&([h,g]=qt(a),f.upload.addEventListener("progress",h),f.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(d=C=>{f&&(n(!C||C.type?new He(null,t,f):C),f.abort(),f=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const T=Ec(s.url);if(T&&Q.protocols.indexOf(T)===-1){n(new N("Unsupported protocol "+T+":",N.ERR_BAD_REQUEST,t));return}f.send(i||null)})},Vc=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let s=new AbortController,i;const r=function(d){if(!i){i=!0,a();const h=d instanceof Error?d:this.reason;s.abort(h instanceof N?h:new He(h instanceof Error?h.message:h))}};let o=e&&setTimeout(()=>{o=null,r(new N(`timeout ${e} of ms exceeded`,N.ETIMEDOUT))},e);const a=()=>{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}=s;return u.unsubscribe=()=>_.asap(a),u}},Nc=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let s=0,i;for(;s<n;)i=s+e,yield t.slice(s,i),s=i},Uc=async function*(t,e){for await(const n of Ic(t))yield*Nc(n,e)},Ic=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:s}=await e.read();if(n)break;yield s}}finally{await e.cancel()}},Pi=(t,e,n,s)=>{const i=Uc(t,e);let r=0,o,a=u=>{o||(o=!0,s&&s(u))};return new ReadableStream({async pull(u){try{const{done:d,value:h}=await i.next();if(d){a(),u.close();return}let m=h.byteLength;if(n){let g=r+=m;n(g)}u.enqueue(new Uint8Array(h))}catch(d){throw a(d),d}},cancel(u){return a(u),i.return()}},{highWaterMark:2})},Bt=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Di=Bt&&typeof ReadableStream=="function",Fc=Bt&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Mi=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Lc=Di&&Mi(()=>{let t=!1;const e=new Request(Q.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Vi=64*1024,xn=Di&&Mi(()=>_.isReadableStream(new Response("").body)),jt={stream:xn&&(t=>t.body)};Bt&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!jt[e]&&(jt[e]=_.isFunction(t[e])?n=>n[e]():(n,s)=>{throw new N(`Response type '${e}' is not supported`,N.ERR_NOT_SUPPORT,s)})})})(new Response);const zc=async t=>{if(t==null)return 0;if(_.isBlob(t))return t.size;if(_.isSpecCompliantForm(t))return(await new Request(Q.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(_.isArrayBufferView(t)||_.isArrayBuffer(t))return t.byteLength;if(_.isURLSearchParams(t)&&(t=t+""),_.isString(t))return(await Fc(t)).byteLength},qc=async(t,e)=>_.toFiniteNumber(t.getContentLength())??zc(e),Bc=Bt&&(async t=>{let{url:e,method:n,data:s,signal:i,cancelToken:r,timeout:o,onDownloadProgress:a,onUploadProgress:u,responseType:d,headers:h,withCredentials:m="same-origin",fetchOptions:g}=Ai(t);d=d?(d+"").toLowerCase():"text";let b=Vc([i,r&&r.toAbortSignal()],o),y;const f=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let v;try{if(u&&Lc&&n!=="get"&&n!=="head"&&(v=await qc(h,s))!==0){let E=new Request(e,{method:"POST",body:s,duplex:"half"}),R;if(_.isFormData(s)&&(R=E.headers.get("content-type"))&&h.setContentType(R),E.body){const[z,G]=Ci(v,qt(Oi(u)));s=Pi(E.body,Vi,z,G)}}_.isString(m)||(m=m?"include":"omit");const T="credentials"in Request.prototype;y=new Request(e,{...g,signal:b,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:s,duplex:"half",credentials:T?m:void 0});let C=await fetch(y);const A=xn&&(d==="stream"||d==="response");if(xn&&(a||A&&f)){const E={};["status","statusText","headers"].forEach(te=>{E[te]=C[te]});const R=_.toFiniteNumber(C.headers.get("content-length")),[z,G]=a&&Ci(R,qt(Oi(a),!0))||[];C=new Response(Pi(C.body,Vi,z,()=>{G&&G(),f&&f()}),E)}d=d||"text";let B=await jt[_.findKey(jt,d)||"text"](C,t);return!A&&f&&f(),await new Promise((E,R)=>{Ei(E,R,{data:B,headers:se.from(C.headers),status:C.status,statusText:C.statusText,config:t,request:y})})}catch(T){throw f&&f(),T&&T.name==="TypeError"&&/fetch/i.test(T.message)?Object.assign(new N("Network Error",N.ERR_NETWORK,t,y),{cause:T.cause||T}):N.from(T,T&&T.code,t,y)}}),En={http:sc,xhr:Mc,fetch:Bc};_.forEach(En,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Ni=t=>`- ${t}`,jc=t=>_.isFunction(t)||t===null||t===!1,Ui={getAdapter:t=>{t=_.isArray(t)?t:[t];const{length:e}=t;let n,s;const i={};for(let r=0;r<e;r++){n=t[r];let o;if(s=n,!jc(n)&&(s=En[(o=String(n)).toLowerCase()],s===void 0))throw new N(`Unknown adapter '${o}'`);if(s)break;i[o||"#"+r]=s}if(!s){const r=Object.entries(i).map(([a,u])=>`adapter ${a} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=e?r.length>1?`since :
|
10
|
+
`+r.map(Ni).join(`
|
11
|
+
`):" "+Ni(r[0]):"as no adapter specified";throw new N("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return s},adapters:En};function Cn(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new He(null,t)}function Ii(t){return Cn(t),t.headers=se.from(t.headers),t.data=kn.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Ui.getAdapter(t.adapter||at.adapter)(t).then(function(e){return Cn(t),e.data=kn.call(t,t.transformResponse,e),e.headers=se.from(e.headers),e},function(e){return xi(e)||(Cn(t),e&&e.response&&(e.response.data=kn.call(t,t.transformResponse,e.response),e.response.headers=se.from(e.response.headers))),Promise.reject(e)})}const Fi="1.7.9",$t={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{$t[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const Li={};$t.transitional=function(t,e,n){function s(i,r){return"[Axios v"+Fi+"] Transitional option '"+i+"'"+r+(n?". "+n:"")}return(i,r,o)=>{if(t===!1)throw new N(s(r," has been removed"+(e?" in "+e:"")),N.ERR_DEPRECATED);return e&&!Li[r]&&(Li[r]=!0,console.warn(s(r," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(i,r,o):!0}},$t.spelling=function(t){return(e,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function $c(t,e,n){if(typeof t!="object")throw new N("options must be an object",N.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let i=s.length;for(;i-- >0;){const r=s[i],o=e[r];if(o){const a=t[r],u=a===void 0||o(a,r,t);if(u!==!0)throw new N("option "+r+" must be "+u,N.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new N("Unknown option "+r,N.ERR_BAD_OPTION)}}const Ht={assertOptions:$c,validators:$t},we=Ht.validators;let Ne=class{constructor(t){this.defaults=t,this.interceptors={request:new _i,response:new _i}}async request(t,e){try{return await this._request(t,e)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
12
|
+
`+i):n.stack=i}catch{}}throw n}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=Ve(this.defaults,e);const{transitional:n,paramsSerializer:s,headers:i}=e;n!==void 0&&Ht.assertOptions(n,{silentJSONParsing:we.transitional(we.boolean),forcedJSONParsing:we.transitional(we.boolean),clarifyTimeoutError:we.transitional(we.boolean)},!1),s!=null&&(_.isFunction(s)?e.paramsSerializer={serialize:s}:Ht.assertOptions(s,{encode:we.function,serialize:we.function},!0)),Ht.assertOptions(e,{baseUrl:we.spelling("baseURL"),withXsrfToken:we.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let r=i&&_.merge(i.common,i[e.method]);i&&_.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),e.headers=se.concat(r,i);const o=[];let a=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(e)===!1||(a=a&&b.synchronous,o.unshift(b.fulfilled,b.rejected))});const u=[];this.interceptors.response.forEach(function(b){u.push(b.fulfilled,b.rejected)});let d,h=0,m;if(!a){const b=[Ii.bind(this),void 0];for(b.unshift.apply(b,o),b.push.apply(b,u),m=b.length,d=Promise.resolve(e);h<m;)d=d.then(b[h++],b[h++]);return d}m=o.length;let g=e;for(h=0;h<m;){const b=o[h++],y=o[h++];try{g=b(g)}catch(f){y.call(this,f);break}}try{d=Ii.call(this,g)}catch(b){return Promise.reject(b)}for(h=0,m=u.length;h<m;)d=d.then(u[h++],u[h++]);return d}getUri(t){t=Ve(this.defaults,t);const e=Ti(t.baseURL,t.url);return wi(e,t.params,t.paramsSerializer)}};_.forEach(["delete","get","head","options"],function(t){Ne.prototype[t]=function(e,n){return this.request(Ve(n||{},{method:t,url:e,data:(n||{}).data}))}}),_.forEach(["post","put","patch"],function(t){function e(n){return function(s,i,r){return this.request(Ve(r||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}Ne.prototype[t]=e(),Ne.prototype[t+"Form"]=e(!0)});let Hc=class pr{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const s=this;this.promise.then(i=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](i);s._listeners=null}),this.promise.then=i=>{let r;const o=new Promise(a=>{s.subscribe(a),r=a}).then(i);return o.cancel=function(){s.unsubscribe(r)},o},e(function(i,r,o){s.reason||(s.reason=new He(i,r,o),n(s.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=s=>{e.abort(s)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new pr(function(n){e=n}),cancel:e}}};function Wc(t){return function(e){return t.apply(null,e)}}function Jc(t){return _.isObject(t)&&t.isAxiosError===!0}const On={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(On).forEach(([t,e])=>{On[e]=t});function zi(t){const e=new Ne(t),n=si(Ne.prototype.request,e);return _.extend(n,Ne.prototype,e,{allOwnKeys:!0}),_.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return zi(Ve(t,s))},n}const W=zi(at);W.Axios=Ne,W.CanceledError=He,W.CancelToken=Hc,W.isCancel=xi,W.VERSION=Fi,W.toFormData=Lt,W.AxiosError=N,W.Cancel=W.CanceledError,W.all=function(t){return Promise.all(t)},W.spread=Wc,W.isAxiosError=Jc,W.mergeConfig=Ve,W.AxiosHeaders=se,W.formToJSON=t=>Si(_.isHTMLForm(t)?new FormData(t):t),W.getAdapter=Ui.getAdapter,W.HttpStatusCode=On,W.default=W;const{Axios:Zp,AxiosError:Qp,CanceledError:em,isCancel:tm,CancelToken:nm,VERSION:sm,all:im,Cancel:rm,isAxiosError:om,spread:am,toFormData:lm,AxiosHeaders:cm,HttpStatusCode:um,formToJSON:dm,getAdapter:hm,mergeConfig:pm}=W,Tn=W.create({baseURL:location.origin,timeout:6e4,params:{}});Tn.interceptors.response.use(t=>t,t=>{var e,n,s,i,r,o,a,u,d,h,m;if(t.response){if(t.response.status===401&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(y){y&&OpenC3Auth.setTokens()}),t.response.config.headers["Ignore-Errors"]&&t.response.config.headers["Ignore-Errors"].includes(t.response.status.toString()))return Promise.reject(t);let g=`HTTP ${t.response.status} - `;(e=t.response)!=null&&e.statusText&&(g+=`${t.response.statusText} `),(s=(n=t.response)==null?void 0:n.config)!=null&&s.data&&(g+=`${t.response.config.data} `),(r=(i=t.response)==null?void 0:i.data)!=null&&r.message?g+=`${t.response.data.message}`:(a=(o=t.response)==null?void 0:o.data)!=null&&a.exception?g+=`${t.response.data.exception}`:(h=(d=(u=t.response)==null?void 0:u.data)==null?void 0:d.error)!=null&&h.message?(t.response.data.error.class&&(g+=`${t.response.data.error.class} `),g+=`${t.response.data.error.message}`):g+=`${(m=t.response)==null?void 0:m.data}`;const{$cosmosNotify:b}=window;throw b&&b.serious({title:"Network error",body:g}),t}else throw t});const Wt=async function(t,e,{data:n,params:s={},headers:i,noAuth:r=!1,noScope:o=!1,onUploadProgress:a=!1}={}){if(!r){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch{OpenC3Auth.login()}i.Authorization=localStorage.openc3Token}return i.manual=!0,!o&&!s.scope&&(s.scope=window.openc3Scope),Tn({method:t,url:e,data:n,params:s,headers:i,onUploadProgress:a})},Rn={Accept:"application/json"},qi={...Rn,"Content-Type":"application/json"},I={get:function(t,{params:e,headers:n=Rn,noScope:s,noAuth:i,onUploadProgress:r}={}){return Wt("get",t,{params:e,headers:n,noScope:s,noAuth:i,onUploadProgress:r})},put:function(t,{data:e,params:n,headers:s=qi,noScope:i,noAuth:r,onUploadProgress:o}={}){return Wt("put",t,{data:e,params:n,headers:s,noScope:i,noAuth:r,onUploadProgress:o})},post:function(t,{data:e,params:n,headers:s=qi,noScope:i,noAuth:r,onUploadProgress:o}={}){return Wt("post",t,{data:e,params:n,headers:s,noScope:i,noAuth:r,onUploadProgress:o})},delete:function(t,{params:e,headers:n=Rn,noScope:s,noAuth:i,onUploadProgress:r}={}){return Wt("delete",t,{params:e,headers:n,noScope:s,noAuth:i,onUploadProgress:r})}};let Jt=()=>({emit(t,...e){for(let n=this.events[t]||[],s=0,i=n.length;s<i;s++)n[s](...e)},events:{},on(t,e){var n;return((n=this.events)[t]||(n[t]=[])).push(e),()=>{var s;this.events[t]=(s=this.events[t])==null?void 0:s.filter(i=>e!==i)}}});class ct extends Error{constructor(e,n){e instanceof Error?(super(e.message),this.cause=e):super(e),this.reason=n,this.name="ReasonError"}}class An extends ct{constructor(e){super("Rejected",e),this.name="SubscriptionRejectedError"}}class Gc extends ct{constructor(e){super(e||"Timed out to receive subscription ack"),this.name="SubscriptionTimeoutError"}}class ge extends ct{constructor(e,n){n?super(e,n):super("Disconnected",e),this.name="DisconnectedError"}}class Yc extends ge{constructor(e){super(e,"stale_connection"),this.name="StaleConnectionError"}}function Bi(t){return t?`{${Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>{let n=JSON.stringify(t[e]);return`${JSON.stringify(e)}:${n}`}).join(",")}}`:""}class Kc{constructor(e){this.channel=e,this.listeners=[]}watch(){this.listeners.push(this.channel.on("presence",e=>{if(e.type==="info"){this._state||(this._state=this.stateFromInfo(e));return}this._state&&(e.type==="join"?this._state[e.id]=e.info:e.type==="leave"&&delete this._state[e.id])}))}reset(){delete this._state}dispose(){delete this._info,delete this._state,this.listeners.forEach(e=>e()),this.listeners.length=0}async join(e,n){if(!this._info)return this._info={id:e,info:n},this.channel.perform("$presence:join",this._info)}async leave(){if(!this._info)return;let e=await this.channel.perform("$presence:leave");return delete this._info,e}async info(){return this._state?this._state:(this._promise||(this._promise=this._sync()),await this._promise,this._state)}async _sync(){this.watch();try{let e=await this.channel.perform("$presence:info",{});return this._state=this.stateFromInfo(e),this._state}finally{delete this._promise}}stateFromInfo(e){return e.records.reduce((n,{id:s,info:i})=>(n[s]=i,n),{})}}const Ue=Symbol("state");let ji=class{constructor(e={}){this.emitter=Jt(),this.params=Object.freeze(e),this.presence=new Kc(this),this.initialConnect=!0,this[Ue]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=Bi({channel:this.channelId,...this.params}),this._identifier)}get channelId(){return this.constructor.identifier}get state(){return this[Ue]}attached(e){if(this.receiver){if(this.receiver!==e)throw Error("Already connected to a different receiver");return!1}return this.receiver=e,!0}connecting(){this[Ue]="connecting"}connected(){if(this.state==="connected"||this.state==="closed")return;this[Ue]="connected";let e=!1;this.initialConnect?(this.initialConnect=!1,this.emit("connect",{reconnect:!1,restored:e})):this.emit("connect",{reconnect:!0,restored:e})}restored(){if(this.state==="connected")throw Error("Already connected");this[Ue]="connected";let e=!0,n=!0;this.initialConnect=!1,this.emit("connect",{reconnect:n,restored:e})}disconnected(e){this.state==="disconnected"||this.state==="closed"||(this[Ue]="disconnected",this.presence.reset(),this.emit("disconnect",e))}closed(e){this.state!=="closed"&&(this[Ue]="closed",delete this.receiver,this.initialConnect=!0,this.presence.dispose(),this.emit("close",e))}disconnect(){this.state==="idle"||this.state==="closed"||this.receiver.unsubscribe(this)}async perform(e,n){if(this.state==="idle"||this.state==="closed")throw Error("Channel is not subscribed");return this.receiver.perform(this.identifier,e,n)}async send(e){return this.perform(void 0,e)}async whisper(e){try{await this.perform("$whisper",e)}catch(n){let s=this.receiver?this.receiver.logger:null;s&&s.warn("whisper failed: ",n)}}receive(e,n){this.emit("message",e,n)}on(e,n){return this.emitter.on(e,n)}once(e,n){let s=this.emitter.on(e,(...i)=>{s(),n(...i)});return s}emit(e,...n){return this.emitter.emit(e,...n)}ensureSubscribed(){return this.state==="connected"?Promise.resolve():this.state==="closed"?Promise.reject(Error("Channel is unsubscribed")):this.pendingSubscribe()}pendingSubscribe(){return this._pendingSubscribe?this._pendingSubscribe:(this._pendingSubscribe=new Promise((e,n)=>{let s=[()=>delete this._pendingSubscribe];s.push(this.on("connect",()=>{s.forEach(i=>i()),e()})),s.push(this.on("close",i=>{s.forEach(r=>r()),n(i||new ct("Channel was disconnected before subscribing","canceled"))}))}),this._pendingSubscribe)}};class Xc{constructor(e){this.id=e,this.intent="unsubscribed",this.state="idle",this.channels=[],this.disposed=!1,this._pendings=[]}add(e){this.channels.includes(e)||this.channels.push(e)}remove(e){let n=this.channels.indexOf(e);n>-1&&this.channels.splice(n,1)}notify(e,...n){this.state=e==="restored"?"connected":e,n.length===1?this.channels.forEach(s=>s[e](n[0])):this.channels.forEach(s=>s[e]())}pending(e){this._checkIntent(e);let n=this._pendings[0];return!n||n.intent!==e?Promise.resolve():n.promise}ensureResubscribed(){this.disposed||(this.intent=void 0,this.ensureSubscribed())}ensureSubscribed(){if(this.intent!=="subscribed"){if(this.disposed)throw Error("Subscription is disposed");this.intent="subscribed",!this._mergeWithPending("unsubscribed")&&this.subscriber(this)}}maybeUnsubscribe(){this.disposed||this.intent==="unsubscribed"||this.channels.length>0||(this.intent="unsubscribed",this._mergeWithPending("subscribed"))||this.unsubscriber(this)}async acquire(e){this._checkIntent(e);let n,s={promise:new Promise(r=>{n=r}),intent:e,release:()=>{this._pendings.splice(this._pendings.indexOf(s),1),n(s)},canceled:!1,acquired:!1},i=this._pendingTop;return this._pendings.push(s),i&&await i.promise,this.gvl&&await this.gvl.acquire(s,e),s.acquired=!0,s}close(e){this.disposed=!0,this.intent=void 0,this.notify("closed",e)}_checkIntent(e){if(!(e==="unsubscribed"||e==="subscribed"))throw Error(`Unknown subscription intent: ${e}`)}get _pendingTop(){return this._pendings.length?this._pendings[this._pendings.length-1]:void 0}_mergeWithPending(e){let n=this._pendingTop;return!n||n.acquired||n.intent!==e?!1:(this._pendings.pop(),n.canceled=!0,!0)}}class Zc{constructor(){this.queue=[]}async acquire(e,n){n==="subscribed"&&(this.queue.push(e.promise.then(()=>{this.queue.splice(this.queue.indexOf(e),1)})),this.queue.length>1&&await this.queue[this.queue.length-2])}}class Qc{constructor(e){e.concurrentSubscribes===!1&&(this.glv=new Zc),this._subscriptions={},this._localToRemote={}}all(){return Object.values(this._subscriptions)}get(e){return this._subscriptions[e]}create(e,{subscribe:n,unsubscribe:s}){let i=this._subscriptions[e]=new Xc(e);return i.remoteId=this._localToRemote[e],i.subscriber=n,i.unsubscriber=s,i.gvl=this.glv,i}remove(e){delete this._subscriptions[e],delete this._localToRemote[e]}storeRemoteId(e,n){this._localToRemote[e]=n;let s=this.get(e);s&&(s.remoteId=n)}}class eu{constructor(e={}){this.subscriptions=new Qc(e),this._pendingMessages=[],this._remoteToLocal={}}subscribe(e,n){this._remoteToLocal[n]=e,this.subscriptions.storeRemoteId(e,n),this.flush(n)}unsubscribe(e){let n=this.subscriptions.get(e);if(!n)return;let s=n.remoteId;s&&delete this._remoteToLocal[s],this.subscriptions.remove(e)}transmit(e,n,s){let i=this._remoteToLocal[e];if(!i){this._pendingMessages.push([e,n,s]);return}let r=this.subscriptions.get(i);r&&r.channels.forEach(o=>{o.receive(n,s)})}notify(e,n,s){let i=this._remoteToLocal[e];if(!i)return;let r=this.subscriptions.get(i);r&&r.channels.forEach(o=>o.emit(n,s))}close(){this._pendingMessages.length=0}get size(){return this.channels.length}get channels(){return this.subscriptions.all().flatMap(e=>e.channels)}flush(e){let n=[];for(let s of this._pendingMessages)s[0]===e?this.transmit(s[0],s[1],s[2]):n.push(s);this._pendingMessages=n}}const $i={debug:0,info:1,warn:2,error:3};let Hi=class{constructor(e){this.level=e||"warn"}log(e,n,s){$i[e]<$i[this.level]||this.writeLogEntry(e,n,s)}writeLogEntry(){throw Error("Not implemented")}debug(e,n){this.log("debug",e,n)}info(e,n){this.log("info",e,n)}warn(e,n){this.log("warn",e,n)}error(e,n){this.log("error",e,n)}};class ut extends Hi{writeLogEntry(){}}class tu{encode(e){return JSON.stringify(e)}decode(e){try{return JSON.parse(e)}catch{}}}let nu=0,Wi=class{constructor(e={}){let{logger:n}=e;this.logger=n||new ut,this.pendingSubscriptions={},this.pendingUnsubscriptions={},this.subscribeCooldownInterval=e.subscribeCooldownInterval||250,this.subscribeRetryInterval=e.subscribeRetryInterval||5e3}attached(e){this.cable=e}subscribe(e,n){let s={channel:e};n&&Object.assign(s,n);let i=Bi(s);if(this.pendingUnsubscriptions[i]){let o=this.subscribeCooldownInterval*1.5;return this.logger.debug(`unsubscribed recently, cooldown for ${o}`,i),new Promise(a=>{setTimeout(()=>{a(this.subscribe(e,n))},o)})}if(this.pendingSubscriptions[i])return this.logger.warn("subscription is already pending, skipping",i),Promise.reject(Error("Already subscribing"));let r=this.subscribeRetryInterval;return new Promise((o,a)=>{let u=++nu;this.pendingSubscriptions[i]={resolve:o,reject:a,id:u},this.cable.send(this.buildSubscribeRequest(i)),this.maybeRetrySubscribe(u,i,r)})}buildSubscribeRequest(e){return{command:"subscribe",identifier:e}}maybeRetrySubscribe(e,n,s){setTimeout(()=>{let i=this.pendingSubscriptions[n];i&&i.id===e&&(this.logger.warn(`no subscription ack received in ${s}ms, retrying subscribe`,n),this.cable.send(this.buildSubscribeRequest(n)),this.maybeExpireSubscribe(e,n,s))},s)}maybeExpireSubscribe(e,n,s){setTimeout(()=>{let i=this.pendingSubscriptions[n];i&&i.id===e&&(delete this.pendingSubscriptions[n],i.reject(new Gc(`Haven't received subscription ack in ${s*2}ms for ${n}`)))},s)}unsubscribe(e){return this.cable.send({command:"unsubscribe",identifier:e}),this.pendingUnsubscriptions[e]=!0,setTimeout(()=>{delete this.pendingUnsubscriptions[e]},this.subscribeCooldownInterval),Promise.resolve()}perform(e,n,s){return n==="$whisper"?this.whisper(e,s):(s||(s={}),s.action=n,this.cable.send({command:"message",identifier:e,data:JSON.stringify(s)}),Promise.resolve())}whisper(e,n){return this.cable.send({command:"whisper",identifier:e,data:n}),Promise.resolve()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:n,identifier:s,message:i,reason:r,reconnect:o}=e;if(n==="ping")return this.cable.keepalive(e.message);if(this.cable.keepalive(),n==="welcome"){let a=e.sid;return a&&this.cable.setSessionId(a),this.cable.connected()}if(n==="disconnect"){let a=new ge(r);this.reset(a),o===!1?this.cable.closed(a):this.cable.disconnected(a);return}if(n==="confirm_subscription"){let a=this.pendingSubscriptions[s];if(!a){this.logger.error("subscription not found, unsubscribing",{type:n,identifier:s}),this.unsubscribe(s);return}return delete this.pendingSubscriptions[s],a.resolve(s)}if(n==="reject_subscription"){let a=this.pendingSubscriptions[s];return a?(delete this.pendingSubscriptions[s],a.reject(new An)):this.logger.error("subscription not found",{type:n,identifier:s})}if(i)return{identifier:s,message:i};this.logger.warn(`unknown message type: ${n}`,{message:e})}reset(e){for(let n in this.pendingSubscriptions)this.pendingSubscriptions[n].reject(e);this.pendingSubscriptions={}}recoverableClosure(){return!1}};const Ji=()=>Date.now()/1e3|0;class su extends Wi{constructor(e={}){super(e),this.streamsPositions={},this.subscriptionStreams={},this.pendingHistory={},this.pendingPresence={},this.presenceInfo={},this.restoreSince=e.historyTimestamp,this.restoreSince===void 0&&(this.restoreSince=Ji()),this.sessionId=void 0,this.sendPongs=e.pongs}reset(e){for(let n in this.pendingPresence)this.pendingPresence[n].reject(e);return this.pendingPresence={},super.reset()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:n,identifier:s,message:i}=e;if(n==="disconnect"||n==="reject_subscription")return super.receive(e);if(n==="confirm_subscription")return this.subscriptionStreams[s]||(this.subscriptionStreams[s]=new Set),super.receive(e);if(n==="ping")return this.restoreSince&&(this.restoreSince=Ji()),this.sendPongs&&this.sendPong(),this.cable.keepalive(e.message);if(this.cable.keepalive(),n==="confirm_history"){this.logger.debug("history result received",e),this.cable.notify("history_received",s);return}if(n==="reject_history"){this.logger.warn("failed to retrieve history",e),this.cable.notify("history_not_found",s);return}if(n==="welcome"){if(this.sessionId=e.sid,this.sessionId&&this.cable.setSessionId(this.sessionId),e.restored){let r=e.restored_ids||Object.keys(this.subscriptionStreams);for(let o of r)this.cable.send({identifier:o,command:"history",history:this.historyRequestFor(o)}),this.presenceInfo[o]&&this.cable.send({identifier:o,command:"join",presence:this.presenceInfo[o]});return this.cable.restored(r)}return this.cable.connected(this.sessionId)}if(n==="presence"){let r=i.type;if(r==="info"){let o=this.pendingPresence[s];o&&(delete this.pendingPresence[s],o.resolve(i))}else if(r==="error"){let o=this.pendingPresence[s];o&&(delete this.pendingPresence[s],o.reject(new Error("failed to retrieve presence")))}return{type:n,identifier:s,message:i}}if(i){let r=this.trackStreamPosition(s,e.stream_id,e.epoch,e.offset);return{identifier:s,message:i,meta:r}}this.logger.warn(`unknown message type: ${n}`,{message:e})}perform(e,n,s){switch(n){case"$presence:join":return this.join(e,s);case"$presence:leave":return this.leave(e,s);case"$presence:info":return this.presence(e,s)}return super.perform(e,n,s)}unsubscribe(e){return delete this.presenceInfo[e],super.unsubscribe(e)}buildSubscribeRequest(e){let n=super.buildSubscribeRequest(e),s=this.historyRequestFor(e);s&&(n.history=s,this.pendingHistory[e]=!0);let i=this.presenceInfo[e];return i&&(n.presence=i),n}recoverableClosure(){return!!this.sessionId}historyRequestFor(e){let n={},s=!1;if(this.subscriptionStreams[e])for(let i of this.subscriptionStreams[e]){let r=this.streamsPositions[i];r&&(s=!0,n[i]=r)}if(!(!s&&!this.restoreSince))return{since:this.restoreSince,streams:n}}trackStreamPosition(e,n,s,i){if(!(!n||!s))return this.subscriptionStreams[e]||(this.subscriptionStreams[e]=new Set),this.subscriptionStreams[e].add(n),this.streamsPositions[n]={epoch:s,offset:i},{stream:n,epoch:s,offset:i}}async sendPong(){await new Promise(e=>setTimeout(e,0)),this.cable.state==="connected"&&this.cable.send({command:"pong"})}async join(e,n){return this.presenceInfo[e]=n,this.cable.send({command:"join",identifier:e,presence:n}),Promise.resolve()}async leave(e,n){return delete this.presenceInfo[e],this.cable.send({command:"leave",identifier:e,presence:n}),Promise.resolve()}presence(e,n){return this.pendingPresence[e]?(this.logger.warn("presence is already pending, skipping",e),Promise.reject(Error("presence request is already pending"))):new Promise((s,i)=>{this.pendingPresence[e]={resolve:s,reject:i},this.cable.send({command:"presence",identifier:e,data:n})})}}class iu extends ct{constructor(){super("No connection","closed"),this.name="NoConnectionError"}}class Pn extends ji{constructor(e,n){super(n),this.channelId=e}set channelId(e){this._channelId=e}get channelId(){return this._channelId}}Vt(Pn,"identifier","__ghost__");const ru="$pubsub";class Dn extends ji{async perform(e,n){if(e.startsWith("$"))return super.perform(e,n);throw Error("not implemented")}}Vt(Dn,"identifier",ru);const Ie=Symbol("state");let ou=class{constructor({transport:t,protocol:e,encoder:n,logger:s,lazy:i,hubOptions:r,performFailures:o,transportConfigurator:a}){this.emitter=Jt(),this.transport=t,this.encoder=n,this.logger=s||new ut,this.protocol=e,this.performFailures=o||"throw",this.protocol.attached(this),this.hub=new eu(r||{}),this[Ie]="idle",this.handleClose=this.handleClose.bind(this),this.handleIncoming=this.handleIncoming.bind(this),this.transportConfigurator=a,this.transport.on("close",this.handleClose),this.transport.on("data",this.handleIncoming),this.initialConnect=!0,this.recovering=!1,i===!1&&this.connect().catch(()=>{})}get state(){return this[Ie]}async connect(){if(this.state==="connected")return Promise.resolve();if(this.state==="connecting")return this.pendingConnect();let t=this.state==="idle";this[Ie]="connecting";let e=this.pendingConnect();this.logger.debug("connecting");try{this.transportConfigurator&&await this.transportConfigurator(this.transport,{initial:t}),await this.transport.open()}catch(n){this.handleClose(n)}return e}setSessionId(t){this.sessionId=t,this.transport.setParam("sid",t)}connected(){if(this.state==="connected")return;this.logger.info("connected"),this[Ie]="connected",this.recovering&&this.hub.subscriptions.all().forEach(e=>e.notify("disconnected",new ge("recovery_failed"))),this.hub.subscriptions.all().forEach(e=>this._resubscribe(e));let t=!1;this.recovering=!1,this.initialConnect?(this.initialConnect=!1,this.emit("connect",{reconnect:!1,restored:t})):this.emit("connect",{reconnect:!0,restored:t})}restored(t){this.logger.info("connection recovered",{remoteIds:t}),this[Ie]="connected",this.hub.subscriptions.all().forEach(s=>{t&&s.remoteId&&t.includes(s.remoteId)?s.notify("restored"):(s.notify("disconnected",new ge("recovery_failed")),this._resubscribe(s))});let e=!this.initialConnect,n=!0;this.recovering=!1,this.initialConnect=!1,this.emit("connect",{reconnect:e,restored:n})}notify(t,e,n){e&&typeof e!="string"&&(n=e,e=void 0),e?this.hub.notify(e,"info",{type:t,data:n}):this.emit("info",{type:t,data:n})}handleClose(t){this.logger.debug("transport closed",{error:t}),this.disconnected(new ge(t,"transport_closed"))}disconnected(t){(this.state==="connected"||this.state==="connecting")&&(this.logger.info("disconnected",{reason:t}),this[Ie]="disconnected",this.recovering=this.protocol.recoverableClosure(t),this.recovering?this.hub.subscriptions.all().forEach(e=>e.notify("connecting")):this.hub.subscriptions.all().forEach(e=>{e.notify("disconnected",t)}),this.protocol.reset(t),this.hub.close(),this.transport.close(),this.emit("disconnect",t))}closed(t){if(this.state==="closed"||this.state==="idle")return;let e;t&&(e=t instanceof ge?t:new ge(t,void 0)),this.logger.info("closed",{reason:t||"user"}),this[Ie]="closed";let n=e||new ge("cable_closed");this.hub.subscriptions.all().forEach(s=>s.notify("disconnected",n)),this.hub.close(),this.protocol.reset(),this.transport.close(),this.initialConnect=!0,this.emit("close",e)}disconnect(){this.closed()}handleIncoming(t){if(this.state==="closed"||this.state==="idle")return;let e=this.encoder.decode(t);if(e===void 0){this.logger.error("failed to decode message",{message:t});return}this.logger.debug("incoming data",e);let n=this.protocol.receive(e);if(n){this.logger.debug("processed incoming message",n);let{type:s,identifier:i,message:r,meta:o}=n;s?this.hub.notify(i,s,r):this.hub.transmit(i,r,o)}}send(t){if(this.state==="closed")throw Error("Cable is closed");let e=this.encoder.encode(t);if(e===void 0){this.logger.error("failed to encode message",{message:t});return}this.logger.debug("outgoing message",t),this.transport.send(e)}keepalive(t){this.emit("keepalive",t)}streamFrom(t){let e=new Dn({stream_name:t});return this.subscribe(e)}streamFromSigned(t){let e=new Dn({signed_stream_name:t});return this.subscribe(e)}subscribeTo(t,e){let n,s;return typeof t=="string"&&(s=t,t=Pn),n=s?new t(s,e):new t(e),this.subscribe(n)}subscribe(t){if(!t.attached(this))return t;let e=t.identifier;t.connecting();let n=this.hub.subscriptions.get(e)||this.hub.subscriptions.create(e,{subscribe:s=>this._subscribe(s,t.channelId,t.params),unsubscribe:s=>this._unsubscribe(s)});return n.add(t),n.intent==="subscribed"&&n.state==="connected"&&t.connected(),n.ensureSubscribed(),t}async _resubscribe(t){t.intent!=="subscribed"||!t.channels[0]||(t.notify("connecting"),t.ensureResubscribed())}async _subscribe(t,e,n){let s=t.id;if(this.state==="idle"&&this.connect().catch(()=>{}),this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:s});return}this.logger.debug("acquiring subscribe lock",{identifier:s});let i=await t.acquire("subscribed");if(i.canceled){this.logger.debug("subscribe lock has been canceled",{identifier:s}),i.release();return}if(this.logger.debug("subscribe lock has been acquired",{identifier:s}),t.intent!=="subscribed"){this.logger.debug("cancel subscribe request, already unsubscribed"),i.release();return}if(this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:s}),i.release();return}if(t.state==="connected"){this.logger.debug("already connected, skip subscribe command",{identifier:s}),t.notify("connected"),i.release();return}let r={identifier:e,params:n};this.logger.debug("subscribing",r);try{let o=await this.protocol.subscribe(e,n);this.hub.subscribe(s,o),this.logger.debug("subscribed",{...r,remoteId:o}),t.notify("connected")}catch(o){if(o){if(o instanceof An&&this.logger.warn("rejected",r),o instanceof ge){this.logger.debug("disconnected during subscription; will retry on connect",r),i.release();return}this.logger.error("failed to subscribe",{error:o,...r})}t.close(o),this.hub.unsubscribe(s)}i.release()}unsubscribe(t){let e=t.identifier,n=this.hub.subscriptions.get(e);if(!n)throw Error(`Subscription not found: ${e}`);n.remove(t),t.closed(),n.maybeUnsubscribe()}async _unsubscribe(t){let e=t.id;this.logger.debug("acquiring unsubscribe lock",{identifier:e});let n=await t.acquire("unsubscribed");if(n.canceled){this.logger.debug("unsubscribe lock has been canceled",{identifier:e}),n.release();return}if(this.logger.debug("unsubscribe lock has been acquired",{identifier:e}),t.intent!=="unsubscribed"){this.logger.debug("cancel unsubscribe, no longer needed",{identifier:e,intent:t.intent}),n.release();return}if(t.state==="disconnected"||t.state==="closed"){this.logger.debug(`already ${t.state} connected, skip unsubscribe command`,{identifier:e}),n.release();return}let s=t.remoteId;if(this.logger.debug("unsubscribing...",{remoteId:s}),this.state!=="connected"){this.logger.debug("unsubscribe skipped (cable is not connected)",{id:e}),t.close(),this.hub.unsubscribe(e),n.release();return}try{await this.protocol.unsubscribe(s),this.logger.debug("unsubscribed remotely",{id:e})}catch(i){i&&(i instanceof ge?this.logger.debug("cable disconnected during the unsubscribe command execution",{id:e,error:i}):this.logger.error("unsubscribe failed",{id:e,error:i}))}t.intent==="unsubscribed"?(t.close(),this.hub.unsubscribe(e)):t.state="closed",n.release()}async perform(t,e,n){if(this.performFailures==="throw")return this._perform(t,e,n);try{return await this._perform(t,e,n)}catch(s){this.performFailures==="warn"&&this.logger.warn("perform failed",{error:s});return}}async _perform(t,e,n){if(this.state==="connecting"&&await this.pendingConnect(),this.state==="closed"||this.state==="disconnected")throw new iu;let s=this.hub.subscriptions.get(t);if(!s)throw Error(`Subscription not found: ${t}`);if(await s.pending("subscribed"),s.intent!=="subscribed")throw Error(`Subscription is closed: ${t}`);let i=s.remoteId,r={id:i,action:e,payload:n};this.logger.debug("perform",r);try{let o=await this.protocol.perform(i,e,n);return o&&this.logger.debug("perform result",{message:o,request:r}),o}catch(o){throw this.logger.error("perform failed",{error:o,request:r}),o}}on(t,e){return this.emitter.on(t,e)}once(t,e){let n=this.emitter.on(t,(...s)=>{n(),e(...s)});return n}emit(t,...e){return this.emitter.emit(t,...e)}pendingConnect(){return this._pendingConnect?this._pendingConnect:(this._pendingConnect=new Promise((t,e)=>{let n=[()=>delete this._pendingConnect];n.push(this.on("connect",()=>{n.forEach(s=>s()),t()})),n.push(this.on("close",s=>{n.forEach(i=>i()),e(s)})),n.push(this.on("disconnect",s=>{n.forEach(i=>i()),e(s)}))}),this._pendingConnect)}};const au={maxMissingPings:2,maxReconnectAttempts:1/0},We=()=>Date.now(),Gi=(t,e)=>{e=e||{};let{backoffRate:n,jitterRatio:s,maxInterval:i}=e;return n=n||2,s===void 0&&(s=.5),r=>{let o=t*n**r,a=o*n,u=o+(a-o)*Math.random(),d=2*(Math.random()-.5)*s;return u=u*(1+d),i&&i<u&&(u=i),u}};let Yi=class{constructor({pingInterval:t,...e}){if(this.pingInterval=t,!this.pingInterval)throw Error(`Incorrect pingInterval is provided: ${t}`);if(e=Object.assign({},au,e),this.strategy=e.reconnectStrategy,!this.strategy)throw Error("Reconnect strategy must be provided");this.maxMissingPings=e.maxMissingPings,this.maxReconnectAttempts=e.maxReconnectAttempts,this.logger=e.logger||new ut,this.state="pending_connect",this.attempts=0,this.disconnectedAt=We()}watch(t){this.target=t,this.initListeners()}reconnectNow(){return this.state==="connected"||this.state==="pending_connect"||this.state==="closed"?!1:(this.cancelReconnect(),this.state="pending_connect",this.target.connect().catch(t=>{this.logger.info("Failed at reconnecting: "+t)}),!0)}initListeners(){this.unbind=[],this.unbind.push(this.target.on("connect",()=>{this.attempts=0,this.pingedAt=We(),this.state="connected",this.cancelReconnect(),this.startPolling()})),this.unbind.push(this.target.on("disconnect",()=>{this.disconnectedAt=We(),this.state="disconnected",this.stopPolling(),this.scheduleReconnect()})),this.unbind.push(this.target.on("close",()=>{this.disconnectedAt=We(),this.state="closed",this.cancelReconnect(),this.stopPolling()})),this.unbind.push(this.target.on("keepalive",()=>{this.pingedAt=We()})),this.unbind.push(()=>{this.cancelReconnect(),this.stopPolling()})}dispose(){delete this.target,this.unbind&&this.unbind.forEach(t=>t()),delete this.unbind}startPolling(){this.pollId&&clearTimeout(this.pollId);let t=this.pingInterval+(Math.random()-.5)*this.pingInterval*.5;this.pollId=setTimeout(()=>{this.checkStale(),this.state==="connected"&&this.startPolling()},t)}stopPolling(){this.pollId&&clearTimeout(this.pollId)}checkStale(){let t=We()-this.pingedAt;t>this.maxMissingPings*this.pingInterval&&(this.logger.warn(`Stale connection: ${t}ms without pings`),this.state="pending_disconnect",this.target.disconnected(new Yc))}scheduleReconnect(){if(this.attempts>=this.maxReconnectAttempts){this.target.close();return}let t=this.strategy(this.attempts);this.attempts++,this.logger.info(`Reconnecting in ${t}ms (${this.attempts} attempt)`),this.state="pending_reconnect",this.reconnnectId=setTimeout(()=>this.reconnectNow(),t)}cancelReconnect(){this.reconnnectId&&(clearTimeout(this.reconnnectId),delete this.reconnnectId)}};class lu{constructor(e,n={}){this.transports=e,this.transport=null,this.emitter=Jt(),this.unbind=[],this.logger=n.logger||new ut}displayName(){return"fallbacked transport"}async open(){for(let e=0;e<this.transports.length;e++){let n=this.transports[e];try{this.transport=n,this.resetListeners(),this.logger.debug(`Trying to connect via ${n.displayName()}`),await n.open(),this.logger.debug(`Connected via ${n.displayName()}`);return}catch(s){this.logger.debug(`Failed to connect via ${n.displayName()}: ${s.message}`)}}throw this.transport=null,this.resetListeners(),new Error("Couldn't connect via any available transport")}send(e){if(!this.transport)throw new Error("No transport is open");this.transport.send(e)}async close(){if(!this.transport)throw new Error("No transport is open");await this.transport.close(),this.transport=null}setURL(){throw new Error("Not implemented. Set URL for each transport separately")}setParam(e,n){this.transports.forEach(s=>{s.setParam(e,n)})}setToken(e,n){this.transports.forEach(s=>{s.setToken(e,n)})}on(e,n){return this.emitter.on(e,n)}once(e,n){let s=this.emitter.on(e,(...i)=>{s(),n(...i)});return s}get url(){return this.transport?this.transport.url:""}resetListeners(){this.unbind.forEach(e=>e()),this.unbind.length=0,this.transport&&this.unbind.push(this.transport.on("open",()=>{this.emitter.emit("open")}),this.transport.on("data",e=>{this.emitter.emit("data",e)}),this.transport.on("close",e=>{this.emitter.emit("close",e)}),this.transport.on("error",e=>{this.emitter.emit("error",e)}))}}class cu{constructor(e,n={}){this.url=e;let s=n.websocketImplementation;if(s)this.Impl=s;else if(typeof WebSocket<"u")this.Impl=WebSocket;else throw new Error("No WebSocket support");this.connected=!1,this.emitter=Jt();let{format:i,subprotocol:r,authStrategy:o}=n;this.format=i||"text",this.connectionOptions=n.websocketOptions,this.authStrategy=o||"param",this.authProtocol="",this.subprotocol=r}displayName(){return"WebSocket("+this.url+")"}open(){let e=this.subprotocol;return this.authStrategy==="sub-protocol"&&(e=[this.subprotocol,this.authProtocol]),this.connectionOptions?this.ws=new this.Impl(this.url,e,this.connectionOptions):this.ws=new this.Impl(this.url,e),this.ws.binaryType="arraybuffer",this.initListeners(),new Promise((n,s)=>{let i=[];i.push(this.once("open",()=>{i.forEach(r=>r()),n()})),i.push(this.once("close",()=>{i.forEach(r=>r()),s(Error("WS connection closed"))}))})}setURL(e){this.url=e}setParam(e,n){let s=new URL(this.url);s.searchParams.set(e,n);let i=`${s.protocol}//${s.host}${s.pathname}?${s.searchParams}`;this.setURL(i)}setToken(e,n="jid"){if(this.authStrategy==="param")this.setParam(n,e);else if(this.authStrategy==="header"){this.connectionOptions=this.connectionOptions||{},this.connectionOptions.headers=this.connectionOptions.headers||{};let s=`x-${n}`.toLowerCase();s=Object.keys(this.connectionOptions.headers).find(i=>i.toLowerCase()===s)||s,this.connectionOptions.headers[s]=e}else if(this.authStrategy==="sub-protocol")this.authProtocol=`anycable-token.${e}`;else throw new Error("Unknown auth strategy: "+this.authStrategy)}send(e){if(!this.ws||!this.connected)throw Error("WebSocket is not connected");this.ws.send(e)}close(){this.ws?this.onclose():this.connected=!1}on(e,n){return this.emitter.on(e,n)}once(e,n){let s=this.emitter.on(e,(...i)=>{s(),n(...i)});return s}initListeners(){this.ws.onerror=e=>{this.connected&&this.emitter.emit("error",e.error||new Error("WS Error"))},this.ws.onclose=()=>{this.onclose()},this.ws.onmessage=e=>{let n=e.data;this.format==="binary"&&(n=new Uint8Array(n)),this.emitter.emit("data",n)},this.ws.onopen=()=>{this.connected=!0,this.emitter.emit("open")}}onclose(){this.ws.onclose=void 0,this.ws.onmessage=void 0,this.ws.onopen=void 0,this.ws.close(),delete this.ws,this.connected=!1,this.emitter.emit("close")}}const Ki={protocol:"actioncable-v1-json",pingInterval:3e3,maxReconnectAttempts:1/0,maxMissingPings:2,logLevel:"warn",lazy:!0};function uu(t,e){if(typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),e=e||{},!t&&!e.transport)throw Error("URL or transport must be specified");e=Object.assign({},Ki,e);let{protocol:n,websocketImplementation:s,websocketFormat:i,websocketOptions:r,websocketAuthStrategy:o,fallbacks:a,logLevel:u,logger:d,transport:h,encoder:m,lazy:g,monitor:b,pingInterval:y,reconnectStrategy:f,maxMissingPings:v,maxReconnectAttempts:T,subprotocol:C,tokenRefresher:A,historyTimestamp:B,protocolOptions:E,concurrentSubscribes:R,performFailures:z,transportConfigurator:G,auth:te}=e;if(d=d||new ut(u),typeof n=="string"){C=C||n;let Ce=n.substring(0,n.lastIndexOf("-")),ee=n.substring(n.lastIndexOf("-")+1);if(E=E||{},Ce==="actioncable-v1")n=new Wi({logger:d,...E});else if(Ce==="actioncable-v1-ext")n=new su({logger:d,historyTimestamp:B,...E});else throw Error(`Protocol is not supported yet: ${n}`);if(ee==="json")m=m||new tu,i=i||"text";else if(ee==="msgpack"){if(i="binary",!m)throw Error("Msgpack encoder must be specified explicitly. Use `@anycable/msgpack-encoder` package or build your own")}else if(ee==="protobuf"){if(i=i||"binary",!m)throw Error("Protobuf encoder must be specified explicitly. Use `@anycable/protobuf-encoder` package or build your own")}else throw Error(`Protocol is not supported yet: ${n}`)}if(!n)throw Error("Protocol must be specified");h=h||new cu(t,{websocketImplementation:s,websocketOptions:r,subprotocol:C,authStrategy:o,format:i}),a&&(h=new lu([h,...a],{logger:d})),te&&te.token&&h.setToken(te.token,te.param||"jid"),f=f||Gi(y),b!==!1&&(b=b||new Yi({pingInterval:y,reconnectStrategy:f,maxMissingPings:v,maxReconnectAttempts:T,logger:d}));let Je={concurrentSubscribes:R},le=new ou({protocol:n,transport:h,encoder:m,logger:d,lazy:g,hubOptions:Je,performFailures:z,transportConfigurator:G});return b&&(b.watch(le),le.monitor=b),A&&du(le,async()=>{try{await A(h)}catch(Ce){return d.error("Failed to refresh authentication token: "+Ce),!1}return le.connect().catch(()=>{}),!0}),le}function du(t,e){let n=!1;t.on("connect",()=>n=!1),t.on("close",async s=>{if(s){if(n){t.logger.warn("Token auto-refresh is disabled",s);return}s.reason==="token_expired"&&(n=!0,await e())}})}class hu{constructor(e){this.channel=e}notify(e,...n){typeof this[e]=="function"&&this[e](...n)}perform(e,n={}){this.channel.perform(e,n)}send(e){this.channel.send(e)}get identifier(){return this.channel.identifier}unsubscribe(){return this.channel.disconnect()}}class pu extends Pn{constructor(e,n,s){super(e,n),this.subscription=new hu(this),Object.assign(this.subscription,s),this.on("connect",()=>this.subscription.notify("connected")),this.on("disconnect",()=>this.subscription.notify("disconnected",{allowReconnect:!0})),this.on("message",i=>this.subscription.notify("received",i)),this.on("close",i=>{i&&i instanceof An?this.subscription.notify("rejected"):this.subscription.notify("disconnected",{allowReconnect:!1})})}}class mu{constructor(e){this.cable=e}create(e,n){let s,i;typeof e=="object"?(s=e.channel,delete e.channel,i=e):(s=e,i={});let r=new pu(s,i,n);return r.subscription.notify("initialized"),this.cable.subscribe(r),r.subscription}findAll(e){return this.cable.hub.channels.filter(n=>n.identifier===e).map(n=>n.subscription)}}class fu{constructor(e){this.cable=e,this.subscriptions=new mu(e)}}class gu extends Hi{writeLogEntry(e,n,s){s?console[e](n,s):console[e](n)}}class bu extends Yi{watch(e){super.watch(e),this.initActivityListeners()}initActivityListeners(){if(typeof document<"u"&&typeof window<"u"&&document.addEventListener&&window.addEventListener){let e=()=>{document.hidden||this.reconnectNow()&&this.logger.debug("Trigger reconnect due to visibility change")},n=i=>{this.reconnectNow()&&this.logger.debug("Trigger reconnect",{event:i})},s=()=>this.disconnect(new ge("page_frozen"));document.addEventListener("visibilitychange",e,!1),window.addEventListener("focus",n,!1),window.addEventListener("online",n,!1),window.addEventListener("resume",n,!1),window.addEventListener("freeze",s,!1),this.unbind.push(()=>{document.removeEventListener("visibilitychange",e,!1),window.removeEventListener("focus",n,!1),window.removeEventListener("online",n,!1),window.removeEventListener("resume",n,!1),window.removeEventListener("freeze",s,!1)})}}disconnect(e){this.state==="disconnected"||this.state==="closed"||(this.logger.info("Disconnecting",{reason:e.message}),this.cancelReconnect(),this.stopPolling(),this.state="pending_disconnect",this.target.disconnected(e))}}const yu=["cable","action-cable"],wu="/cable",Gt=(t,e)=>{for(let n of yu){let s=t.head.querySelector(`meta[name='${n}-${e}']`);if(s)return s.getAttribute("content")}},Xi=t=>t.match(/wss?:\/\//)?t:typeof window<"u"?`${window.location.protocol.replace("http","ws")}//${window.location.host}${t}`:t,_u=()=>{if(typeof document<"u"&&document.head){let t=Gt(document,"url");if(t)return Xi(t)}return Xi(wu)},vu=()=>{if(typeof document<"u"&&document.head){let t=Gt(document,"history-timestamp");if(t)return t|0}},Su=()=>{if(typeof document<"u"&&document.head)return Gt(document,"token")},ku=()=>{if(typeof document<"u"&&document.head)return Gt(document,"token-param")};function xu(t,e){typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),t=t||_u(),e=e||{},e.historyTimestamp||(e.historyTimestamp=vu());let n=Su();if(n){let d=ku();e.auth=Object.assign({token:n,param:d},e.auth||{})}e=Object.assign({},Ki,e);let{logLevel:s,logger:i,pingInterval:r,reconnectStrategy:o,maxMissingPings:a,maxReconnectAttempts:u}=e;return i=e.logger=e.logger||new gu(s),o=e.reconnectStrategy=e.reconnectStrategy||Gi(r),e.monitor!==!1&&(e.monitor=e.monitor||new bu({pingInterval:r,reconnectStrategy:o,maxMissingPings:a,maxReconnectAttempts:u,logger:i})),uu(t,e)}function Eu(t,e){let n=xu(t,e);return new fu(n)}class Cu{constructor(e="/openc3-api/cable"){this._cable=null,this._url=e}disconnect(){this._cable&&(this._cable.cable.disconnect(),this._cable=null)}createSubscription(e,n,s={},i={}){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);o=new URL(o,document.baseURI).href,this._cable=Eu(o)}return this._cable.subscriptions.create({channel:e,...i},s)})}recordPing(){}}function Mn(t){return Ou.test(t)}const Ou=/^-?[0-9]+$/;function Zi(t){return Tu.test(t)}const Tu=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Qi(t,e){const n=Number.parseFloat(t),s=String(n),i=er(t),r=er(s);return!!(i===r||(e==null?void 0:e.approx)===!0&&!Mn(t)&&r.length>=14&&i.startsWith(r.substring(0,14)))}let dt=function(t){return t.underflow="underflow",t.overflow="overflow",t.truncate_integer="truncate_integer",t.truncate_float="truncate_float",t}({});function Ru(t){if(Qi(t,{approx:!1}))return;if(Mn(t))return dt.truncate_integer;const e=Number.parseFloat(t);return Number.isFinite(e)?e===0?dt.underflow:dt.truncate_float:dt.overflow}function er(t){return t.replace(Au,"").replace(Du,"").replace(Mu,"").replace(Pu,"")}const Au=/[eE][+-]?\d+$/,Pu=/^-?(0*)?/,Du=/\./,Mu=/0+$/;class Vu{constructor(e){if(Vt(this,"isLosslessNumber",!0),!Zi(e))throw new Error(`Invalid number (value: "${e}")`);this.value=e}valueOf(){const e=Ru(this.value);if(e===void 0||e===dt.truncate_float)return Number.parseFloat(this.value);if(Mn(this.value))return BigInt(this.value);throw new Error(`Cannot safely convert to number: the value '${this.value}' would ${e} and become ${Number.parseFloat(this.value)}`)}toString(){return this.value}}function Nu(t){return t&&typeof t=="object"&&t.isLosslessNumber===!0||!1}function Uu(t){return new Vu(t)}function Iu(t,e){return Vn({"":t},"",t,e)}function Vn(t,e,n,s){return Array.isArray(n)?s.call(t,e,Lu(n,s)):n&&typeof n=="object"&&!Nu(n)?s.call(t,e,Fu(n,s)):s.call(t,e,n)}function Fu(t,e){for(const n of Object.keys(t)){const s=Vn(t,n,t[n],e);s!==void 0?t[n]=s:delete t[n]}return t}function Lu(t,e){for(let n=0;n<t.length;n++)t[n]=Vn(t,String(n),t[n],e);return t}function zu(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Uu,s=0;const i=a();return y(i),v(),e?Iu(i,e):i;function r(){if(t.charCodeAt(s)===Wu){s++,d();const U={};let J=!0;for(;s<t.length&&t.charCodeAt(s)!==nr;){J?J=!1:(g(),d());const ke=s,Le=h();if(Le===void 0){A();return}d(),b();const wt=a();if(wt===void 0){te();return}Object.prototype.hasOwnProperty.call(U,Le)&&!Nn(wt,U[Le])&&B(Le,ke+1),U[Le]=wt}return t.charCodeAt(s)!==nr&&E(),s++,U}}function o(){if(t.charCodeAt(s)===Ju){s++,d();const U=[];let J=!0;for(;s<t.length&&t.charCodeAt(s)!==sr;){J?J=!1:g();const ke=a();f(ke),U.push(ke)}return t.charCodeAt(s)!==sr&&R(),s++,U}}function a(){d();const U=h()??m()??r()??o()??u("true",!0)??u("false",!1)??u("null",null);return d(),U}function u(U,J){if(t.slice(s,s+U.length)===U)return s+=U.length,J}function d(){for(;qu(t.charCodeAt(s));)s++}function h(){if(t.charCodeAt(s)===Un){s++;let U="";for(;s<t.length&&t.charCodeAt(s)!==Un;){if(t.charCodeAt(s)===Hu){const J=t[s+1],ke=$u[J];ke!==void 0?(U+=ke,s++):J==="u"?Yt(t.charCodeAt(s+2))&&Yt(t.charCodeAt(s+3))&&Yt(t.charCodeAt(s+4))&&Yt(t.charCodeAt(s+5))?(U+=String.fromCharCode(Number.parseInt(t.slice(s+2,s+6),16)),s+=5):Je(s):G(s)}else ju(t.charCodeAt(s))?U+=t[s]:z(t[s]);s++}return C(),s++,U}}function m(){const U=s;if(t.charCodeAt(s)===ir&&(s++,T(U)),t.charCodeAt(s)===In)s++;else if(Bu(t.charCodeAt(s)))for(s++;Kt(t.charCodeAt(s));)s++;if(t.charCodeAt(s)===td)for(s++,T(U);Kt(t.charCodeAt(s));)s++;if(t.charCodeAt(s)===od||t.charCodeAt(s)===rd)for(s++,(t.charCodeAt(s)===ir||t.charCodeAt(s)===Zu)&&s++,T(U);Kt(t.charCodeAt(s));)s++;if(s>U)return n(t.slice(U,s))}function g(){if(t.charCodeAt(s)!==ed)throw new SyntaxError(`Comma ',' expected after value ${ee()}`);s++}function b(){if(t.charCodeAt(s)!==nd)throw new SyntaxError(`Colon ':' expected after property name ${ee()}`);s++}function y(U){if(U===void 0)throw new SyntaxError(`JSON value expected ${ee()}`)}function f(U){if(U===void 0)throw new SyntaxError(`Array item expected ${ee()}`)}function v(){if(s<t.length)throw new SyntaxError(`Expected end of input ${ee()}`)}function T(U){if(!Kt(t.charCodeAt(s))){const J=t.slice(U,s);throw new SyntaxError(`Invalid number '${J}', expecting a digit ${ee()}`)}}function C(){if(t.charCodeAt(s)!==Un)throw new SyntaxError(`End of string '"' expected ${ee()}`)}function A(){throw new SyntaxError(`Quoted object key expected ${ee()}`)}function B(U,J){throw new SyntaxError(`Duplicate key '${U}' encountered at position ${J}`)}function E(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${ee()}`)}function R(){throw new SyntaxError(`Array item or end of array ']' expected ${ee()}`)}function z(U){throw new SyntaxError(`Invalid character '${U}' ${le()}`)}function G(U){const J=t.slice(U,U+2);throw new SyntaxError(`Invalid escape character '${J}' ${le()}`)}function te(){throw new SyntaxError(`Object value expected after ':' ${le()}`)}function Je(U){const J=t.slice(U,U+6);throw new SyntaxError(`Invalid unicode character '${J}' ${le()}`)}function le(){return`at position ${s}`}function Ce(){return s<t.length?`but got '${t[s]}'`:"but reached end of input"}function ee(){return`${Ce()} ${le()}`}}function qu(t){return t===Gu||t===Yu||t===Ku||t===Xu}function Yt(t){return t>=In&&t<=Fn||t>=sd&&t<=ad||t>=id&&t<=ld}function Kt(t){return t>=In&&t<=Fn}function Bu(t){return t>=Qu&&t<=Fn}function ju(t){return t>=32&&t<=1114111}function Nn(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((n,s)=>Nn(n,e[s])):tr(t)&&tr(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(n=>Nn(t[n],e[n])):!1}function tr(t){return typeof t=="object"&&t!==null}const $u={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
13
|
+
`,r:"\r",t:" "},Hu=92,Wu=123,nr=125,Ju=91,sr=93,Gu=32,Yu=10,Ku=9,Xu=13,Un=34,Zu=43,ir=45,In=48,Qu=49,Fn=57,ed=44,td=46,nd=58,sd=65,id=97,rd=69,od=101,ad=70,ld=102;function rr(t,e,n,s){return i(t);function i(u,d){if(Array.isArray(s)){const h=s.find(m=>m.test(u));if(h){const m=h.stringify(u);if(typeof m!="string"||!Zi(m))throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${m})`);return m}}if(typeof u=="boolean"||typeof u=="number"||typeof u=="string"||u===null||u instanceof Date||u instanceof Boolean||u instanceof Number||u instanceof String)return JSON.stringify(u);if(u!=null&&u.isLosslessNumber||typeof u=="bigint")return u.toString();if(Array.isArray(u))return r(u);if(u&&typeof u=="object")return o(u)}function r(u,d){if(u.length===0)return"[]";let h="[";for(let m=0;m<u.length;m++){const g=u[m];typeof g<"u"&&typeof g!="function"?h+=i(g):h+="null",m<u.length-1&&(h+=",")}return h+="]",h}function o(u,d){if(typeof u.toJSON=="function")return rr(u.toJSON(),e,n,void 0);const h=Array.isArray(e)?e.map(String):Object.keys(u);if(h.length===0)return"{}";let m=!0,g="{";for(const b of h){const y=u[b];if(a(b,y)){m?m=!1:g+=",";const f=JSON.stringify(b);g+=`${f}:`,g+=i(y)}}return g+="}",g}function a(u,d){return typeof d<"u"&&typeof d!="function"&&typeof d!="symbol"}}function cd(t){return Qi(t)?parseFloat(t):BigInt(t)}class Ln{constructor(){Vt(this,"id",1)}async exec(e,n,s={},i={},r=6e4){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch{OpenC3Auth.login()}this.id=this.id+1;try{return s.scope=window.openc3Scope,i.manual=!0,(await Tn.post("/openc3-api/api",{jsonrpc:"2.0",method:e,params:n,id:this.id,keyword_params:s},{headers:{Authorization:localStorage.openc3Token,"Content-Type":"application/json-rpc",...i},timeout:r,transformRequest:[(o,a)=>rr(o)],transformResponse:[o=>zu(o,void 0,cd)]})).data.result}catch(o){let a=new Error;throw o.response?(a.name=o.response.data.error.data.class,a.message=o.response.data.error.data.message,a.object=o.response.data.error):o.request?(a.name="Request error",a.message="Request error, no response received"):a.name="Unknown error",a}}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,...s){return this.exec("interface_cmd",[e,n,...s])}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,s){return this.exec("get_item",[e,n,s])}get_param(e,n,s){return this.exec("get_param",[e,n,s])}get_parameter(e,n,s){return this.exec("get_param",[e,n,s])}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,s,i=30){const r=await this.exec("get_tlm_packet",[e,n],{type:s,stale_time:i});if(r!=null){let o=r.length,a=null;for(let u=0;u<o;u++)a=this.decode_openc3_type(r[u][1]),a!==null&&(r[u][1]=a)}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,s=null){let i={stale_time:n};s!==null&&(i.cache_timeout=s);const r=await this.exec("get_tlm_values",[e],i,{},1e4);let o=r[0].length,a=null;for(let u=0;u<o;u++)a=this.decode_openc3_type(r[0][u]),a!==null&&(r[0][u]=a);return r}get_limits(e,n,s){return this.exec("get_limits",[e,n,s])}async tlm(e,n,s,i="CONVERTED"){let r=null;if(n===void 0)r=await this.exec("tlm",[e]);else if(s===void 0)if(["RAW","CONVERTED","FORMATTED","WITH_UNITS"].includes(n))r=await this.exec("tlm",[e],{type:n});else{let a=new Error;throw a.name="TypeError",a.message=`Invalid data type ${n}. Valid options are RAW, CONVERTED, FORMATTED, and WITH_UNITS.`,a}else r=await this.exec("tlm",[e,n,s],{type:i});let o=this.decode_openc3_type(r);return o!==null&&(r=o),r}async inject_tlm(e,n,s=null,i="CONVERTED"){await this.exec("inject_tlm",[e,n,s],{type:i})}set_tlm(e,n,s,i){return this.exec("set_tlm",[e,n,s],{type:i})}override_tlm(e,n,s,i){return this.exec("override_tlm",[e,n,s],{type:i})}get_overrides(){return this.exec("get_overrides")}normalize_tlm(e,n,s,i){return this.exec("normalize_tlm",[e,n,s],{type:i})}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,s,i="CONVERTED"){return this.exec("get_cmd_value",[e,n,s,i])}get_cmd_buffer(e,n){return this.exec("get_cmd_buffer",[e,n])}_cmd(e,n,s,i,r){let o=null;for(let a in i)Object.prototype.hasOwnProperty.call(i,a)&&(o=this.encode_openc3_type(i[a]),o!==null&&(i[a]=o));return this.exec(e,[n,s,i],{},r)}get_cmd_hazardous(e,n,s,i={}){return n===void 0?this.exec("get_cmd_hazardous",e,{},i):this._cmd("get_cmd_hazardous",e,n,s,i)}cmd(e,n,s,i={}){return n===void 0?this.exec("cmd",e,{},i):this._cmd("cmd",e,n,s,i)}cmd_no_range_check(e,n,s,i={}){return n===void 0?this.exec("cmd_no_range_check",e,{},i):this._cmd("cmd_no_range_check",e,n,s,i)}cmd_raw(e,n,s,i={}){return n===void 0?this.exec("cmd_raw",e,{},i):this._cmd("cmd_raw",e,n,s,i)}cmd_raw_no_range_check(e,n,s,i={}){return n===void 0?this.exec("cmd_raw_no_range_check",e,{},i):this._cmd("cmd_raw_no_range_check",e,n,s,i)}cmd_no_hazardous_check(e,n,s,i={}){return n===void 0?this.exec("cmd_no_hazardous_check",e,{},i):this._cmd("cmd_no_hazardous_check",e,n,s,i)}cmd_no_checks(e,n,s,i={}){return n===void 0?this.exec("cmd_no_checks",e,{},i):this._cmd("cmd_no_checks",e,n,s,i)}cmd_raw_no_hazardous_check(e,n,s,i={}){return n===void 0?this.exec("cmd_raw_no_hazardous_check",e,{},i):this._cmd("cmd_raw_no_hazardous_check",e,n,s,i)}cmd_raw_no_checks(e,n,s,i={}){return n===void 0?this.exec("cmd_raw_no_checks",e,{},i):this._cmd("cmd_raw_no_checks",e,n,s,i)}build_cmd(e,n,s){return n===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,n,s)}build_command(e,n,s){return n===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,n,s)}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,s){return this.exec("save_config",[e,n,s])}delete_config(e,n){return this.exec("delete_config",[e,n])}enable_limits(e,n,s){return this.exec("enable_limits",[e,n,s])}disable_limits(e,n,s){return this.exec("disable_limits",[e,n,s])}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])}update_news(){return this.exec("update_news",[])}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),s=await crypto.subtle.digest("SHA-256",n),i=new Uint8Array(s);return Array.from(i).map(r=>r.toString(16).padStart(2,"0")).join("")}}}function ud(t,e,n){const{years:s=0,months:i=0,weeks:r=0,days:o=0,hours:a=0,minutes:u=0,seconds:d=0}=e,h=Xn(t,void 0),m=i||s?is(h,i+s*12):h,g=o||r?Zn(m,o+r*7):m,b=u+a*60,y=(d+b*60)*1e3;return Qn(t,+g+y)}const zn={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=Ke(new Date,"yyyy-MM-dd"),this.endDate=Ke(new Date,"yyyy-MM-dd"));let t=1e3*60*30,e=null;this.time?(e=Kn(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=Ke(e,"HH:mm:ss"),this.endTime=Ke(ud(e,{minutes:30}),"HH:mm:ss")}}},dd={components:{EnvironmentChooser:as,ScriptChooser:Er},props:{modelValue:Boolean,timelines:{type:Array,required:!0},activity:{type:Object,default:null}},mixins:[zn,Ye],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 s=new Date(this.activity.recurring.end*1e3);this.recurringEndDate=this.formatDate(s,this.timeZone),this.recurringEndTime=this.formatTimeHMS(s,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 s=this.kind.toLowerCase();let i={environment:this.activityEnvironment};i[s]=this.activityData;let r={};this.recurring&&(r={frequency:this.frequency,span:this.timeSpan,end:n}),this.activity?be.put(`/openc3-api/timeline/${this.activity.name}/activity/${this.activity.start}`,{data:{start:t,stop:e,kind:s,data:i,recurring:r}}).then(o=>{const a=this.formatSeconds(new Date(o.data.start*1e3));this.$notify.normal({title:"Updated Activity",body:`${a} (${o.data.start}) on timeline: ${o.data.name}`}),this.$emit("update",o.data),this.show=!this.show}).catch(o=>{this.show=!this.show}):be.post(`/openc3-api/timeline/${this.timeline}/activities`,{data:{start:t,stop:e,kind:s,data:i,recurring:r}}).then(o=>{const a=this.formatSeconds(new Date(o.data.start*1e3));this.$notify.normal({title:"Created Activity",body:`${a} (${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()}}},hd={key:0},pd={key:1},md={class:"pr-2"},fd=["textContent"],gd={class:"pr-2"},bd={key:0},yd={key:1,class:"ma-3"},wd={key:2},_d=["textContent"];function vd(t,e,n,s,i,r){const o=p("v-spacer"),a=p("v-icon"),u=p("v-tooltip"),d=p("v-toolbar"),h=p("v-btn"),m=p("v-row"),g=p("v-select"),b=p("v-text-field"),y=p("v-checkbox"),f=p("v-col"),v=p("v-card-text"),T=p("script-chooser"),C=p("environment-chooser"),A=p("v-stepper"),B=p("v-card"),E=p("v-dialog");return k(),D("div",null,[l(E,{persistent:"",modelValue:r.show,"onUpdate:modelValue":e[15]||(e[15]=R=>r.show=R),width:"600"},{default:c(()=>[l(B,null,{default:c(()=>[l(d,{height:"24"},{default:c(()=>[l(o),n.activity?(k(),D("span",hd,"Edit Activity")):(k(),D("span",pd,"Create Activity")),l(o),l(u,{location:"top"},{activator:c(({props:R})=>[S("div",Y(K(R)),[l(a,{"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]=S("span",null," Close ",-1))]),_:1})]),_:1}),l(A,{modelValue:i.dialogStep,"onUpdate:modelValue":e[14]||(e[14]=R=>i.dialogStep=R),editable:"",items:["Activity Times","Activity Type"]},ze({"item.1":c(()=>[l(v,null,{default:c(()=>[S("div",md,[l(g,{density:"compact","hide-details":"",variant:"outlined",modelValue:i.timeline,"onUpdate:modelValue":e[1]||(e[1]=R=>i.timeline=R),items:r.timelineNames,label:"Timeline","data-test":"activity-select-timeline",class:"pb-2"},null,8,["modelValue","items"]),l(m,{dense:""},{default:c(()=>[l(b,{modelValue:t.startDate,"onUpdate:modelValue":e[2]||(e[2]=R=>t.startDate=R),type:"date",label:"Start Date",class:"mx-1",rules:[i.rules.required],"data-test":"activity-start-date"},null,8,["modelValue","rules"]),l(b,{modelValue:t.startTime,"onUpdate:modelValue":e[3]||(e[3]=R=>t.startTime=R),type:"time",step:"1",label:"Start Time",class:"mx-1",rules:[i.rules.required],"data-test":"activity-start-time"},null,8,["modelValue","rules"])]),_:1}),l(m,{dense:""},{default:c(()=>[l(b,{modelValue:t.endDate,"onUpdate:modelValue":e[4]||(e[4]=R=>t.endDate=R),type:"date",label:"End Date",class:"mx-1",rules:[i.rules.required],"data-test":"activity-end-date"},null,8,["modelValue","rules"]),l(b,{modelValue:t.endTime,"onUpdate:modelValue":e[5]||(e[5]=R=>t.endTime=R),type:"time",step:"1",label:"End Time",class:"mx-1",rules:[i.rules.required],"data-test":"activity-end-time"},null,8,["modelValue","rules"])]),_:1}),l(m,{class:"pl-3"},{default:c(()=>[l(y,{modelValue:i.recurring,"onUpdate:modelValue":e[6]||(e[6]=R=>i.recurring=R),disabled:!!n.activity,label:"Recurring","hide-details":"","data-test":"recurring"},null,8,["modelValue","disabled"])]),_:1}),i.recurring?(k(),P(m,{key:0},{default:c(()=>[l(f,null,{default:c(()=>e[21]||(e[21]=[S("div",{class:"repeat"},"Repeat every",-1)])),_:1}),l(f,null,{default:c(()=>[l(b,{modelValue:i.frequency,"onUpdate:modelValue":e[7]||(e[7]=R=>i.frequency=R),disabled:!!n.activity,density:"compact",variant:"outlined","single-line":"","hide-details":"","data-test":"recurring-frequency"},null,8,["modelValue","disabled"])]),_:1}),l(f,null,{default:c(()=>[l(g,{modelValue:i.timeSpan,"onUpdate:modelValue":e[8]||(e[8]=R=>i.timeSpan=R),disabled:!!n.activity,items:i.timeSpans,style:{},"hide-details":"",density:"compact",variant:"outlined","data-test":"recurring-span"},null,8,["modelValue","disabled","items"])]),_:1})]),_:1})):L("",!0),i.recurring?(k(),P(m,{key:1,style:{"padding-bottom":"10px"}},{default:c(()=>[l(f,null,{default:c(()=>e[22]||(e[22]=[S("div",{class:"repeat"},"Ending",-1)])),_:1}),l(f,null,{default:c(()=>[l(b,{modelValue:i.recurringEndDate,"onUpdate:modelValue":e[9]||(e[9]=R=>i.recurringEndDate=R),type:"date",label:"End Date",class:"mx-1",rules:[i.rules.required],disabled:!!n.activity,"data-test":"recurring-end-date"},null,8,["modelValue","rules","disabled"])]),_:1}),l(f,null,{default:c(()=>[l(b,{modelValue:i.recurringEndTime,"onUpdate:modelValue":e[10]||(e[10]=R=>i.recurringEndTime=R),type:"time",step:"1",label:"End Time",class:"mx-1",rules:[i.rules.required],disabled:!!n.activity,"data-test":"recurring-end-time"},null,8,["modelValue","rules","disabled"])]),_:1})]),_:1})):L("",!0),l(m,null,{default:c(()=>[Oe(S("span",{class:"ma-2 text-red",textContent:F(r.timeError)},null,8,fd),[[Te,r.timeError]])]),_:1})])]),_:1})]),"item.2":c(()=>[l(v,null,{default:c(()=>[S("div",gd,[l(g,{density:"compact","hide-details":"",variant:"outlined",modelValue:i.kind,"onUpdate:modelValue":e[11]||(e[11]=R=>i.kind=R),items:i.types,label:"Activity Type","data-test":"activity-select-type",class:"pb-2"},null,8,["modelValue","items"]),i.kind==="COMMAND"?(k(),D("div",bd,[l(b,{modelValue:i.activityData,"onUpdate:modelValue":e[12]||(e[12]=R=>i.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"])])):i.kind==="SCRIPT"?(k(),D("div",yd,[l(T,{onFile:r.fileHandler},null,8,["onFile"]),l(C,{modelValue:i.activityEnvironment,"onUpdate:modelValue":e[13]||(e[13]=R=>i.activityEnvironment=R)},null,8,["modelValue"])])):(k(),D("div",wd,e[23]||(e[23]=[S("span",{class:"ma-2"}," No required input ",-1)]))),Oe(l(m,{class:"mt-2"},{default:c(()=>[S("span",{class:"ma-2 text-red",textContent:F(r.typeError)},null,8,_d)]),_:1},512),[[Te,r.typeError]])])]),_:1})]),_:2},[i.dialogStep===2?{name:"actions",fn:c(()=>[l(m,{class:"ma-0 px-6 pb-4"},{default:c(()=>[l(h,{onClick:e[0]||(e[0]=()=>i.dialogStep-=1),variant:"text"},{default:c(()=>e[18]||(e[18]=[x(" Previous ")])),_:1}),l(o),l(h,{onClick:r.clearHandler,variant:"outlined",class:"mr-4"},{default:c(()=>e[19]||(e[19]=[x(" Cancel ")])),_:1},8,["onClick"]),l(h,{onClick:Se(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 Sd=ue(dd,[["render",vd],["__scopeId","data-v-9ad41f9b"]]),kd={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 xd(t,e,n,s,i,r){const o=p("v-icon"),a=p("v-list-item"),u=p("v-select");return k(),D("div",null,[l(u,{label:"Color",items:r.swatches,modelValue:r.color,"onUpdate:modelValue":e[0]||(e[0]=d=>r.color=d)},{"prepend-inner":c(()=>[l(o,{color:r.color},{default:c(()=>e[1]||(e[1]=[x(" mdi-square ")])),_:1},8,["color"])]),item:c(({props:d,item:h})=>[l(a,ce(d,{value:h.raw}),{prepend:c(()=>[l(o,{color:h.raw},{default:c(()=>e[2]||(e[2]=[x(" mdi-square ")])),_:2},1032,["color"])]),_:2},1040,["value"])]),_:1},8,["items","modelValue"])])}const or=ue(kd,[["render",xd]]),Ed={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(()=>be.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(()=>{})}}},Cd={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)}}},Od={scope:"col",class:"text-right"};function Td(t,e,n,s,i,r){const o=p("v-icon"),a=p("v-tooltip"),u=p("v-text-field"),d=p("v-table");return k(),D("div",null,[l(d,{dense:""},{default:c(()=>[S("tbody",null,[S("tr",null,[e[2]||(e[2]=S("th",{scope:"col",class:"text-left"},"Key",-1)),e[3]||(e[3]=S("th",{scope:"col",class:"text-left"},"Value",-1)),S("th",Od,[l(a,{location:"top"},{activator:c(({props:h})=>[S("div",Y(K(h)),[l(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]=S("span",null," New Metadata ",-1))]),_:1})])]),(k(!0),D(re,null,he(r.metadata,(h,m)=>(k(),D("tr",{key:`tr-${m}`},[S("td",null,[l(u,{modelValue:h.key,"onUpdate:modelValue":g=>h.key=g,type:"text",density:"compact","data-test":`key-${m}`},null,8,["modelValue","onUpdate:modelValue","data-test"])]),S("td",null,[l(u,{modelValue:h.value,"onUpdate:modelValue":g=>h.value=g,type:"text",density:"compact","data-test":`value-${m}`},null,8,["modelValue","onUpdate:modelValue","data-test"])]),S("td",null,[l(a,{location:"top"},{activator:c(({props:g})=>[S("div",ce({ref_for:!0},g),[l(o,{"data-test":`delete-metadata-icon-${m}`,onClick:b=>r.rm(m)},{default:c(()=>e[4]||(e[4]=[x(" mdi-delete ")])),_:2},1032,["data-test","onClick"])],16)]),default:c(()=>[e[5]||(e[5]=S("span",null," Delete Metadata ",-1))]),_:2},1024)])]))),128))])]),_:1})])}const Rd=ue(Cd,[["render",Td]]),Ad={components:{ColorSelectForm:or,MetadataInputForm:Rd},props:{modelValue:Boolean,metadata:{type:Object,default:null}},mixins:[zn,Ye],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((s,i)=>(s[i.key]=i.value,s),{}),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?be.put(`/openc3-api/metadata/${this.metadata.start}`,{data:n}).then(s=>{this.$notify.normal({title:"Updated Metadata",body:`Metadata updated: (${s.data.start})`}),this.$emit("update",s.data),this.show=!this.show}):be.post("/openc3-api/metadata",{data:n}).then(s=>{this.$notify.normal({title:"Created new Metadata",body:`Metadata: (${s.data.start})`}),this.$emit("update",s.data),this.show=!this.show})}}},Pd={key:0},Dd={key:1},Md={class:"pa-2"},Vd={class:"pa-2"},Nd={style:{"min-height":"200px"}},Ud=["textContent"];function Id(t,e,n,s,i,r){const o=p("v-spacer"),a=p("v-icon"),u=p("v-tooltip"),d=p("v-toolbar"),h=p("v-btn"),m=p("v-row"),g=p("color-select-form"),b=p("v-text-field"),y=p("v-card-text"),f=p("metadata-input-form"),v=p("v-stepper"),T=p("v-card"),C=p("v-dialog");return k(),D("div",null,[l(C,{persistent:"",modelValue:r.show,"onUpdate:modelValue":e[6]||(e[6]=A=>r.show=A),width:"600"},{default:c(()=>[l(T,null,{default:c(()=>[l(d,{height:"24"},{default:c(()=>[l(o),n.metadata?(k(),D("span",Pd,"Update Metadata")):(k(),D("span",Dd,"Create Metadata")),l(o),l(u,{location:"top"},{activator:c(({props:A})=>[S("div",Y(K(A)),[l(a,{"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]=S("span",null,"Close",-1))]),_:1})]),_:1}),l(v,{modelValue:i.dialogStep,"onUpdate:modelValue":e[5]||(e[5]=A=>i.dialogStep=A),editable:"",items:["Metadata Times","Metadata Input"]},ze({"item.1":c(()=>[l(y,null,{default:c(()=>[S("div",Md,[l(g,{modelValue:i.color,"onUpdate:modelValue":e[1]||(e[1]=A=>i.color=A)},null,8,["modelValue"]),l(m,{dense:""},{default:c(()=>[l(b,{modelValue:t.startDate,"onUpdate:modelValue":e[2]||(e[2]=A=>t.startDate=A),type:"date",label:"Start Date",class:"mx-1",rules:[i.rules.required],"data-test":"metadata-start-date"},null,8,["modelValue","rules"]),l(b,{modelValue:t.startTime,"onUpdate:modelValue":e[3]||(e[3]=A=>t.startTime=A),type:"time",step:"1",label:"Start Time",class:"mx-1",rules:[i.rules.required],"data-test":"metadata-start-time"},null,8,["modelValue","rules"])]),_:1})])]),_:1})]),"item.2":c(()=>[l(y,null,{default:c(()=>[S("div",Vd,[S("div",Nd,[l(f,{modelValue:i.metadataVals,"onUpdate:modelValue":e[4]||(e[4]=A=>i.metadataVals=A)},null,8,["modelValue"])]),Oe(l(m,null,{default:c(()=>[S("span",{class:"ma-2 text-red",textContent:F(r.typeError)},null,8,Ud)]),_:1},512),[[Te,r.typeError]])])]),_:1})]),_:2},[i.dialogStep===2?{name:"actions",fn:c(()=>[l(m,{class:"ma-0 px-6 pb-4"},{default:c(()=>[l(h,{onClick:e[0]||(e[0]=()=>i.dialogStep-=1),variant:"text"},{default:c(()=>e[9]||(e[9]=[x(" Previous ")])),_:1}),l(o),l(h,{onClick:r.clearHandler,variant:"outlined",class:"mr-4"},{default:c(()=>e[10]||(e[10]=[x(" Cancel ")])),_:1},8,["onClick"]),l(h,{onClick:Se(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 Fd=ue(Ad,[["render",Id],["__scopeId","data-v-364c2ff6"]]),Ld={components:{ColorSelectForm:or},props:{modelValue:Boolean,note:{type:Object}},mixins:[zn,Ye],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,s=this.description;this.note?be.put(`/openc3-api/notes/${this.note.start}`,{data:{start:t,stop:e,color:n,description:s}}).then(i=>{const r=i.data.description.length>16?`${i.data.description.substring(0,16)}...`:i.data.description;this.$notify.normal({title:"Updated Note",body:`Note updated: (${i.data.start}): "${r}"`}),this.$emit("update",i.data),this.show=!this.show}):be.post("/openc3-api/notes",{data:{start:t,stop:e,color:n,description:s}}).then(i=>{const r=i.data.description.length>16?`${i.data.description.substring(0,16)}...`:i.data.description;this.$notify.normal({title:"Created new Note",body:`Note: (${i.data.start}) created: "${r}"`}),this.$emit("update",i.data),this.show=!this.show})}}},zd={key:0},qd={key:1},Bd={class:"pa-2"},jd=["textContent"],$d={class:"pa-2"},Hd=["textContent"];function Wd(t,e,n,s,i,r){const o=p("v-spacer"),a=p("v-icon"),u=p("v-tooltip"),d=p("v-toolbar"),h=p("v-btn"),m=p("v-row"),g=p("v-text-field"),b=p("v-card-text"),y=p("color-select-form"),f=p("v-stepper"),v=p("v-card"),T=p("v-dialog");return k(),D("div",null,[l(T,{persistent:"",modelValue:r.show,"onUpdate:modelValue":e[8]||(e[8]=C=>r.show=C),width:"600"},{default:c(()=>[l(v,null,{default:c(()=>[l(d,{height:"24"},{default:c(()=>[l(o),n.note?(k(),D("span",zd,"Update Note")):(k(),D("span",qd,"Create Note")),l(o),l(u,{location:"top"},{activator:c(({props:C})=>[S("div",Y(K(C)),[l(a,{"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]=S("span",null," Close ",-1))]),_:1})]),_:1}),l(f,{modelValue:i.dialogStep,"onUpdate:modelValue":e[7]||(e[7]=C=>i.dialogStep=C),editable:"",items:["Note Times","Note Input"]},ze({"item.1":c(()=>[l(b,null,{default:c(()=>[S("div",Bd,[l(m,{dense:""},{default:c(()=>[l(g,{modelValue:t.startDate,"onUpdate:modelValue":e[1]||(e[1]=C=>t.startDate=C),type:"date",label:"Start Date",class:"mx-1",rules:[i.rules.required],"data-test":"note-start-date"},null,8,["modelValue","rules"]),l(g,{modelValue:t.startTime,"onUpdate:modelValue":e[2]||(e[2]=C=>t.startTime=C),type:"time",step:"1",label:"Start Time",class:"mx-1",rules:[i.rules.required],"data-test":"note-start-time"},null,8,["modelValue","rules"])]),_:1}),l(m,{dense:""},{default:c(()=>[l(g,{modelValue:t.endDate,"onUpdate:modelValue":e[3]||(e[3]=C=>t.endDate=C),type:"date",label:"End Date",class:"mx-1",rules:[i.rules.required],"data-test":"note-end-date"},null,8,["modelValue","rules"]),l(g,{modelValue:t.endTime,"onUpdate:modelValue":e[4]||(e[4]=C=>t.endTime=C),type:"time",step:"1",label:"End Time",class:"mx-1",rules:[i.rules.required],"data-test":"note-end-time"},null,8,["modelValue","rules"])]),_:1}),l(m,null,{default:c(()=>[Oe(S("span",{class:"ma-2 text-red",textContent:F(r.timeError)},null,8,jd),[[Te,r.timeError]])]),_:1})])]),_:1})]),"item.2":c(()=>[l(b,null,{default:c(()=>[S("div",$d,[S("div",null,[l(y,{modelValue:i.color,"onUpdate:modelValue":e[5]||(e[5]=C=>i.color=C)},null,8,["modelValue"])]),S("div",null,[l(g,{modelValue:i.description,"onUpdate:modelValue":e[6]||(e[6]=C=>i.description=C),type:"text",label:"Note Description","data-test":"note-description"},null,8,["modelValue"])]),Oe(l(m,null,{default:c(()=>[S("span",{class:"ma-2 text-red",textContent:F(r.typeError)},null,8,Hd)]),_:1},512),[[Te,r.typeError]])])]),_:1})]),_:2},[i.dialogStep===2?{name:"actions",fn:c(()=>[l(m,{class:"ma-0 px-6 pb-4"},{default:c(()=>[l(h,{onClick:e[0]||(e[0]=()=>i.dialogStep-=1),variant:"text"},{default:c(()=>e[11]||(e[11]=[x(" Previous ")])),_:1}),l(o),l(h,{onClick:r.clearHandler,variant:"outlined",class:"mr-4"},{default:c(()=>e[12]||(e[12]=[x(" Cancel ")])),_:1},8,["onClick"]),l(h,{onClick:Se(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 Jd=ue(Ld,[["render",Wd],["__scopeId","data-v-87960c87"]]),Gd={components:{ActivityCreateDialog:Sd,MetadataCreateDialog:Fd,NoteCreateDialog:Jd},mixins:[Ye,Ed],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(([s,i])=>n.push(`${s}: ${i}`)),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,s=null,i=null;switch(t.type){case"activity":n=`timeline/${t.activity.name}/activity`,s=t.activity.start,i=t.activity.uuid;break;case"metadata":n="metadata",s=t.metadata.start;break;case"note":n="notes",s=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}/${s}`;return i&&(o+=`/${i}`),be.delete(o)}).then(r=>{this.$emit("update"),this.$notify.normal({title:`Deleted ${t.type}`,body:`Deleted ${t.type} at ${s}`})}).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)}}},Yd={key:0},Kd={key:1},Xd={key:0},Zd={key:1};function Qd(t,e,n,s,i,r){const o=p("v-spacer"),a=p("v-icon"),u=p("v-tooltip"),d=p("v-toolbar"),h=p("v-text-field"),m=p("v-row"),g=p("v-card-title"),b=p("v-data-table"),y=p("v-btn"),f=p("v-card-actions"),v=p("v-card"),T=p("v-dialog"),C=p("activity-create-dialog"),A=p("metadata-create-dialog"),B=p("note-create-dialog");return k(),D("div",null,[l(T,{persistent:"",modelValue:r.show,"onUpdate:modelValue":e[2]||(e[2]=E=>r.show=E),width:"80vw"},{default:c(()=>[l(v,null,{default:c(()=>[l(d,{height:"24"},{default:c(()=>[l(o),n.newMetadata?(k(),D("span",Yd,"Metadata")):(k(),D("span",Kd,"Events")),l(o),l(u,{location:"top"},{activator:c(({props:E})=>[S("div",Y(K(E)),[l(a,{"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]=S("span",null,"Close",-1))]),_:1})]),_:1}),l(g,null,{default:c(()=>[l(m,{class:"pa-3"},{default:c(()=>[n.newMetadata?(k(),D("span",Xd,"Metadata")):(k(),D("span",Zd,"Events")),l(o),l(h,{modelValue:i.search,"onUpdate:modelValue":e[0]||(e[0]=E=>i.search=E),label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":""},null,8,["modelValue"])]),_:1})]),_:1}),l(b,{headers:i.eventHeaders,items:i.localEvents,search:i.search},{"no-data":c(()=>e[9]||(e[9]=[S("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})=>[l(a,{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"]),l(a,{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"]),l(f,{class:"px-2"},{default:c(()=>[l(o),l(y,{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(y,{key:0,variant:"flat","data-test":"new-event",onClick:e[1]||(e[1]=E=>i.showMetadataCreate=!0)},{default:c(()=>e[13]||(e[13]=[x(" New Metadata ")])),_:1})):L("",!0)]),_:1})]),_:1})]),_:1},8,["modelValue"]),i.showActivityUpdate?(k(),P(C,{key:0,modelValue:i.showActivityUpdate,"onUpdate:modelValue":e[3]||(e[3]=E=>i.showActivityUpdate=E),activity:i.editActivity,"time-zone":n.timeZone,onUpdate:r.updateActivity},null,8,["modelValue","activity","time-zone","onUpdate"])):L("",!0),i.showMetadataUpdate?(k(),P(A,{key:1,modelValue:i.showMetadataUpdate,"onUpdate:modelValue":e[4]||(e[4]=E=>i.showMetadataUpdate=E),metadata:i.editMetadata,"time-zone":n.timeZone,onUpdate:r.updateMetadata},null,8,["modelValue","metadata","time-zone","onUpdate"])):L("",!0),i.showNoteUpdate?(k(),P(B,{key:2,modelValue:i.showNoteUpdate,"onUpdate:modelValue":e[5]||(e[5]=E=>i.showNoteUpdate=E),note:i.editNote,"time-zone":n.timeZone,onUpdate:r.updateNote},null,8,["modelValue","note","time-zone","onUpdate"])):L("",!0),i.showMetadataCreate?(k(),P(A,{key:3,modelValue:i.showMetadataCreate,"onUpdate:modelValue":e[6]||(e[6]=E=>i.showMetadataCreate=E),"time-zone":n.timeZone,onUpdate:r.addMetadata},null,8,["modelValue","time-zone","onUpdate"])):L("",!0)])}const eh=ue(Gd,[["render",Qd]]),th={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")}}},nh={class:"pa-2"},sh={class:"question"};function ih(t,e,n,s,i,r){const o=p("v-spacer"),a=p("v-toolbar"),u=p("v-text-field"),d=p("v-card-text"),h=p("v-btn"),m=p("v-card-actions"),g=p("v-form"),b=p("v-card"),y=p("v-dialog");return k(),P(y,{persistent:"",modelValue:r.show,"onUpdate:modelValue":e[2]||(e[2]=f=>r.show=f),width:"600"},{default:c(()=>[l(b,null,{default:c(()=>[l(g,{modelValue:i.valid,"onUpdate:modelValue":e[1]||(e[1]=f=>i.valid=f),onSubmit:Se(r.submitHandler,["prevent"])},{default:c(()=>[l(a,{height:"24"},{default:c(()=>[l(o),e[3]||(e[3]=S("span",null," User Input Required ",-1)),l(o)]),_:1}),S("div",nh,[l(d,null,{default:c(()=>[S("div",sh,F(n.question),1),l(u,{modelValue:i.inputValue,"onUpdate:modelValue":e[0]||(e[0]=f=>i.inputValue=f),autofocus:"","data-test":"ask-value-input",type:n.password?"password":"text",rules:i.rules},null,8,["modelValue","type","rules"])]),_:1})]),l(m,{class:"px-2"},{default:c(()=>[l(o),l(h,{onClick:r.cancelHandler,variant:"outlined","data-test":"ask-cancel"},{default:c(()=>e[4]||(e[4]=[x(" Cancel ")])),_:1},8,["onClick"]),l(h,{onClick:Se(r.submitHandler,["prevent"]),variant:"flat",type:"submit","data-test":"ask-ok",disabled:!i.valid},{default:c(()=>e[5]||(e[5]=[x(" Ok ")])),_:1},8,["onClick","disabled"])]),_:1})]),_:1},8,["modelValue","onSubmit"])]),_:1})]),_:1},8,["modelValue"])}const rh=de(th,[["render",ih],["__scopeId","data-v-b44e26bc"]]),oh={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,valid:null,rules:[t=>this.multiple?t.length!=0||"Required":!!t||"Required"]}},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")}}},ah={class:"pa-2"},lh={class:"title"},ch=["textContent"];function uh(t,e,n,s,i,r){const o=p("v-spacer"),a=p("v-toolbar"),u=p("v-row"),d=p("v-file-input"),h=p("v-card-text"),m=p("v-btn"),g=p("v-card-actions"),b=p("v-form"),y=p("v-card"),f=p("v-dialog");return k(),P(f,{persistent:"",modelValue:r.show,"onUpdate:modelValue":e[2]||(e[2]=v=>r.show=v),width:"600"},{default:c(()=>[l(y,null,{default:c(()=>[l(b,{modelValue:i.valid,"onUpdate:modelValue":e[1]||(e[1]=v=>i.valid=v),onSubmit:Se(r.submitHandler,["prevent"])},{default:c(()=>[l(a,{height:"24"},{default:c(()=>[l(o),e[3]||(e[3]=S("span",null," File Dialog ",-1)),l(o)]),_:1}),S("div",ah,[l(h,null,{default:c(()=>[l(u,null,{default:c(()=>[S("span",lh,F(n.title),1)]),_:1}),n.message?(k(),P(u,{key:0},{default:c(()=>[S("span",{class:"ma-3",style:{"white-space":"pre-line"},textContent:F(n.message)},null,8,ch)]),_:1})):L("",!0),l(u,{class:"my-1"},{default:c(()=>[l(d,{label:"Choose File",modelValue:i.inputValue,"onUpdate:modelValue":e[0]||(e[0]=v=>i.inputValue=v),rules:i.rules,autofocus:"","data-test":"file-input",accept:n.filter,"small-chips":"",multiple:n.multiple},null,8,["modelValue","rules","accept","multiple"])]),_:1})]),_:1})]),l(g,{class:"px-2"},{default:c(()=>[l(o),l(m,{onClick:r.cancelHandler,variant:"outlined","data-test":"file-cancel"},{default:c(()=>e[4]||(e[4]=[x(" Cancel ")])),_:1},8,["onClick"]),l(m,{onClick:Se(r.submitHandler,["prevent"]),variant:"flat",type:"submit","data-test":"file-ok",disabled:!i.valid},{default:c(()=>e[5]||(e[5]=[x(" Ok ")])),_:1},8,["onClick","disabled"])]),_:1})]),_:1},8,["modelValue","onSubmit"])]),_:1})]),_:1},8,["modelValue"])}const dh=de(oh,[["render",uh],["__scopeId","data-v-55f70e4e"]]),hh={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:{}},ph=["textContent"],mh={class:"pa-2"},fh=["textContent"];function gh(t,e,n,s,i,r){const o=p("v-spacer"),a=p("v-toolbar"),u=p("v-row"),d=p("v-card-text"),h=p("v-btn"),m=p("v-card-actions"),g=p("v-card"),b=p("v-dialog");return k(),P(b,{modelValue:r.show,"onUpdate:modelValue":e[1]||(e[1]=y=>r.show=y),width:n.width},{default:c(()=>[l(g,null,{default:c(()=>[l(a,{height:"24"},{default:c(()=>[l(o),S("span",{style:{"white-space":"pre-line"},textContent:F(n.title)},null,8,ph),l(o)]),_:1}),S("div",mh,[l(d,null,{default:c(()=>[(k(!0),D(re,null,he(n.text,(y,f)=>(k(),P(u,{"no-gutters":"",key:f},{default:c(()=>[S("span",{style:{"white-space":"pre-line"},textContent:F(y)},null,8,fh)]),_:2},1024))),128))]),_:1})]),l(m,{class:"px-2"},{default:c(()=>[l(o),l(h,{variant:"flat",onClick:e[0]||(e[0]=y=>r.show=!r.show)},{default:c(()=>e[2]||(e[2]=[x(" Ok ")])),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue","width"])}const bh=de(hh,[["render",gh]]),yh={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 Ln,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)})}}},wh={class:"pa-2"};function _h(t,e,n,s,i,r){const o=p("v-spacer"),a=p("v-toolbar"),u=p("v-btn"),d=p("v-text-field"),h=p("v-row"),m=p("v-icon"),g=p("v-tooltip"),b=p("v-data-table"),y=p("v-card-text"),f=p("v-card-actions"),v=p("v-card"),T=p("v-dialog");return k(),P(T,{modelValue:r.show,"onUpdate:modelValue":e[2]||(e[2]=C=>r.show=C),width:"1000"},{default:c(()=>[l(v,null,{default:c(()=>[l(a,{height:"24"},{default:c(()=>[l(o),e[3]||(e[3]=S("span",null,"Overrides",-1)),l(o)]),_:1}),S("div",wh,[l(y,null,{default:c(()=>[l(h,{class:"ma-1"},{default:c(()=>[l(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"]),l(o),l(d,{modelValue:i.search,"onUpdate:modelValue":e[0]||(e[0]=C=>i.search=C),label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":""},null,8,["modelValue"])]),_:1}),l(b,{headers:i.headers,items:i.overrides,search:i.search,"items-per-page-options":[100],"multi-sort":"",density:"compact"},{"item.delete":c(({item:C})=>[l(g,{location:"top"},{activator:c(({props:A})=>[l(m,ce({onClick:B=>r.deleteOverride(C)},A),{default:c(()=>e[5]||(e[5]=[x(" mdi-delete ")])),_:2},1040,["onClick"])]),default:c(()=>[e[6]||(e[6]=S("span",null,"Delete Override",-1))]),_:2},1024)]),_:1},8,["headers","items","search"])]),_:1})]),l(f,{class:"px-2"},{default:c(()=>[l(o),l(u,{variant:"flat",onClick:e[1]||(e[1]=C=>r.show=!r.show),"data-test":"overrides-dialog-ok"},{default:c(()=>e[7]||(e[7]=[x(" Ok ")])),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])}const vh=de(yh,[["render",_h]]),Sh={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")}}},kh=["textContent"],xh={class:"pa-2"},Eh=["textContent"],Ch=["textContent"],Oh={key:0},Th={key:1};function Rh(t,e,n,s,i,r){const o=p("v-spacer"),a=p("v-toolbar"),u=p("v-card-subtitle"),d=p("v-row"),h=p("v-card-text"),m=p("v-select"),g=p("v-btn"),b=p("v-card-actions"),y=p("v-card"),f=p("v-dialog");return k(),P(f,{persistent:"",modelValue:r.show,"onUpdate:modelValue":e[2]||(e[2]=v=>r.show=v),width:"600"},{default:c(()=>[l(y,null,{default:c(()=>[l(a,{height:"24"},{default:c(()=>[l(o),S("span",{class:"text",textContent:F(n.title)},null,8,kh),l(o)]),_:1}),S("div",xh,[l(h,{class:"text"},{default:c(()=>[n.subtitle?(k(),P(d,{key:0},{default:c(()=>[l(u,null,{default:c(()=>[x(F(n.subtitle),1)]),_:1})]),_:1})):L("",!0),l(d,{class:"mt-1"},{default:c(()=>[S("span",{textContent:F(n.message)},null,8,Eh)]),_:1}),n.details?(k(),P(d,{key:1,class:"mt-1"},{default:c(()=>[S("span",{textContent:F(n.details)},null,8,Ch)]),_:1})):L("",!0)]),_:1})]),n.layout==="combo"?(k(),D("div",Oh,[l(d,{class:"ma-2"},{default:c(()=>[l(m,{"onUpdate:modelValue":[e[0]||(e[0]=v=>i.selectOkDisabled=!1),e[1]||(e[1]=v=>i.selectedItem=v)],modelValue:i.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}),l(b,{class:"px-2"},{default:c(()=>[l(o),l(g,{onClick:r.cancelHandler,variant:"outlined","data-test":"prompt-cancel"},{default:c(()=>e[3]||(e[3]=[x(" Cancel ")])),_:1},8,["onClick"]),l(g,{variant:"flat",onClick:r.submitHandler,"data-test":"prompt-ok",disabled:i.selectOkDisabled},{default:c(()=>e[4]||(e[4]=[x(" Ok ")])),_:1},8,["onClick","disabled"])]),_:1})])):(k(),D("div",Th,[l(b,{class:Qt(r.layoutClass)},{default:c(()=>[l(o),l(g,{onClick:r.cancelHandler,variant:"outlined","data-test":"prompt-cancel"},{default:c(()=>e[5]||(e[5]=[x(" Cancel ")])),_:1},8,["onClick"]),(k(!0),D(re,null,he(n.buttons,(v,T)=>(k(),D("div",{key:T},[l(g,{variant:"flat",onClick:C=>r.submitWrapper(v.value),"data-test":`prompt-${v.text}`},{default:c(()=>[x(F(v.text),1)]),_:2},1032,["onClick","data-test"])]))),128))]),_:1},8,["class"])]))]),_:1})]),_:1},8,["modelValue"])}const Ah=de(Sh,[["render",Rh],["__scopeId","data-v-b04397fe"]]),Ph={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",it(Date.now(),"yyyy_MM_dd_HH_mm_ss")+"_suite_results.txt"),e.click()}}},Dh={class:"pa-2"};function Mh(t,e,n,s,i,r){const o=p("v-spacer"),a=p("v-toolbar"),u=p("v-textarea"),d=p("v-card-text"),h=p("v-btn"),m=p("v-card-actions"),g=p("v-card"),b=p("v-dialog");return k(),P(b,{modelValue:r.show,"onUpdate:modelValue":e[1]||(e[1]=y=>r.show=y),scrollable:"",width:"800"},{default:c(()=>[l(g,null,{default:c(()=>[l(a,{height:"24"},{default:c(()=>[l(o),e[2]||(e[2]=S("span",null," Script Results ",-1)),l(o)]),_:1}),S("div",Dh,[l(d,{style:{width:"100%","max-height":"80vh",overflow:"auto"}},{default:c(()=>[l(u,{readonly:"","hide-details":"",density:"compact","auto-grow":"","model-value":n.text},null,8,["model-value"])]),_:1})]),l(m,{class:"px-2"},{default:c(()=>[l(o),l(h,{variant:"outlined",onClick:r.downloadResults},{default:c(()=>e[3]||(e[3]=[x(" Download ")])),_:1},8,["onClick"]),l(h,{variant:"flat",onClick:e[0]||(e[0]=y=>r.show=!r.show),ref:"okButton"},{default:c(()=>e[4]||(e[4]=[x(" Ok ")])),_:1},512)]),_:1})]),_:1})]),_:1},8,["modelValue"])}const Vh=de(Ph,[["render",Mh]]),Nh={components:{EnvironmentChooser:as},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}}},Uh={class:"pa-2"};function Ih(t,e,n,s,i,r){const o=p("v-spacer"),a=p("v-toolbar"),u=p("environment-chooser"),d=p("v-card-text"),h=p("v-btn"),m=p("v-card-actions"),g=p("v-card"),b=p("v-dialog");return k(),P(b,{modelValue:r.show,"onUpdate:modelValue":e[1]||(e[1]=y=>r.show=y),width:"600"},{default:c(()=>[l(g,null,{default:c(()=>[l(a,{height:"24"},{default:c(()=>[l(o),e[2]||(e[2]=S("span",null,"Script Environment Variables",-1)),l(o)]),_:1}),S("div",Uh,[l(d,null,{default:c(()=>[l(u,{modelValue:i.selected,"onUpdate:modelValue":e[0]||(e[0]=y=>i.selected=y)},null,8,["modelValue"])]),_:1})]),l(m,{class:"px-2"},{default:c(()=>[l(o),l(h,{onClick:r.cancel,variant:"outlined","data-test":"environment-dialog-cancel"},{default:c(()=>e[3]||(e[3]=[x(" Cancel ")])),_:1},8,["onClick"]),l(h,{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 Fh=de(Nh,[["render",Ih]]),Lh={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}}},zh={id:"tr-container"};function qh(t,e,n,s,i,r){const o=p("v-checkbox"),a=p("v-tooltip"),u=p("v-col"),d=p("v-row"),h=p("v-select"),m=p("v-btn");return k(),D("div",null,[S("div",zh,[l(d,{"no-gutters":"",align:"center"},{default:c(()=>[l(u,{cols:"4"},{default:c(()=>[l(d,{"no-gutters":""},{default:c(()=>[l(u,{cols:"6"},{default:c(()=>[l(a,{location:"top"},{activator:c(({props:g})=>[S("div",Y(K(g)),[l(o,{modelValue:i.options,"onUpdate:modelValue":e[0]||(e[0]=b=>i.options=b),label:"Pause on Error",value:"pauseOnError","hide-details":"","data-test":"pause-on-error"},null,8,["modelValue"])],16)]),default:c(()=>[e[16]||(e[16]=S("span",null,[x("Checked pauses the script when an error is encountered"),S("br"),x("Unchecked continues without user interaction")],-1))]),_:1})]),_:1}),l(u,{cols:"6"},{default:c(()=>[l(a,{location:"top"},{activator:c(({props:g})=>[S("div",Y(K(g)),[l(o,{modelValue:i.options,"onUpdate:modelValue":e[1]||(e[1]=b=>i.options=b),label:"Manual",value:"manual","hide-details":"","data-test":"manual"},null,8,["modelValue"])],16)]),default:c(()=>[S("span",null,[x(F(r.checkedManualTooltip),1),e[17]||(e[17]=S("br",null,null,-1)),x(F(r.uncheckedManualTooltip),1)])]),_:1})]),_:1})]),_:1})]),_:1}),l(u,{cols:"8"},{default:c(()=>[l(d,{"no-gutters":"",justify:"end"},{default:c(()=>[l(u,{cols:"5"},{default:c(()=>[l(h,{label:"Suite:",class:"mb-2 mr-2","hide-details":"",density:"compact",variant:"outlined","onUpdate:modelValue":[r.suiteChanged,e[2]||(e[2]=g=>i.suite=g)],items:i.suites,modelValue:i.suite,"data-test":"select-suite"},null,8,["onUpdate:modelValue","items","modelValue"])]),_:1}),l(u,{cols:"auto"},{default:c(()=>[l(m,{color:"primary",class:"mr-2",disabled:n.disableButtons||!i.userInfo.execute,onClick:e[3]||(e[3]=g=>t.$emit("button",{method:"start",suite:i.suite,options:i.options})),"data-test":"start-suite"},{default:c(()=>e[18]||(e[18]=[x(" Start ")])),_:1},8,["disabled"]),l(m,{color:"primary",class:"mr-2",onClick:e[4]||(e[4]=g=>t.$emit("button",{method:"setup",suite:i.suite,options:i.options})),"data-test":"setup-suite",disabled:n.disableButtons||!r.setupSuiteEnabled||!i.userInfo.execute},{default:c(()=>e[19]||(e[19]=[x(" Setup ")])),_:1},8,["disabled"]),l(m,{color:"primary",onClick:e[5]||(e[5]=g=>t.$emit("button",{method:"teardown",suite:i.suite,options:i.options})),"data-test":"teardown-suite",disabled:n.disableButtons||!r.teardownSuiteEnabled||!i.userInfo.execute},{default:c(()=>e[20]||(e[20]=[x(" Teardown ")])),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1})]),_:1}),l(d,{"no-gutters":""},{default:c(()=>[l(u,{cols:"4"},{default:c(()=>[l(d,{"no-gutters":""},{default:c(()=>[l(u,{cols:"6"},{default:c(()=>[l(a,{location:"top"},{activator:c(({props:g})=>[S("div",Y(K(g)),[l(o,{modelValue:i.options,"onUpdate:modelValue":e[6]||(e[6]=b=>i.options=b),label:"Continue after Error",value:"continueAfterError","hide-details":"","data-test":"continue-after-error"},null,8,["modelValue"])],16)]),default:c(()=>[e[21]||(e[21]=S("span",null,[x("Checked allows the script to continue when an error is encountered"),S("br"),x("Unchecked forces the current script to end")],-1))]),_:1})]),_:1}),l(u,{cols:"6"},{default:c(()=>[l(a,{location:"top"},{activator:c(({props:g})=>[S("div",Y(K(g)),[l(o,{modelValue:i.options,"onUpdate:modelValue":e[7]||(e[7]=b=>i.options=b),label:"Loop",value:"loop","hide-details":"","data-test":"loop"},null,8,["modelValue"])],16)]),default:c(()=>[e[22]||(e[22]=S("span",null,[x("Checked continuously executes until explicitly stopped"),S("br"),x(" Unchecked executes only the started script(s)")],-1))]),_:1})]),_:1})]),_:1})]),_:1}),l(u,{cols:"8"},{default:c(()=>[l(d,{"no-gutters":"",justify:"end"},{default:c(()=>[l(u,{cols:"5"},{default:c(()=>[l(h,{label:"Group:",class:"mb-2 mr-2","hide-details":"",density:"compact",variant:"outlined","onUpdate:modelValue":[r.groupChanged,e[8]||(e[8]=g=>i.group=g)],items:i.groups,modelValue:i.group,"data-test":"select-group"},null,8,["onUpdate:modelValue","items","modelValue"])]),_:1}),l(u,{cols:"auto"},{default:c(()=>[l(m,{color:"primary",class:"mr-2",disabled:n.disableButtons||!i.userInfo.execute,onClick:e[9]||(e[9]=g=>t.$emit("button",{method:"start",suite:i.suite,group:i.group,options:i.options})),"data-test":"start-group"},{default:c(()=>e[23]||(e[23]=[x(" Start ")])),_:1},8,["disabled"]),l(m,{color:"primary",class:"mr-2",onClick:e[10]||(e[10]=g=>t.$emit("button",{method:"setup",suite:i.suite,group:i.group,options:i.options})),"data-test":"setup-group",disabled:n.disableButtons||!r.setupGroupEnabled||!i.userInfo.execute},{default:c(()=>e[24]||(e[24]=[x(" Setup ")])),_:1},8,["disabled"]),l(m,{color:"primary",onClick:e[11]||(e[11]=g=>t.$emit("button",{method:"teardown",suite:i.suite,group:i.group,options:i.options})),"data-test":"teardown-group",disabled:n.disableButtons||!r.teardownGroupEnabled||!i.userInfo.execute},{default:c(()=>e[25]||(e[25]=[x(" Teardown ")])),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1})]),_:1}),l(d,{"no-gutters":""},{default:c(()=>[l(u,{cols:"4"},{default:c(()=>[l(d,{"no-gutters":""},{default:c(()=>[l(u,{cols:"6"},{default:c(()=>[l(a,{location:"top"},{activator:c(({props:g})=>[S("div",Y(K(g)),[l(o,{modelValue:i.options,"onUpdate:modelValue":e[12]||(e[12]=b=>i.options=b),label:"Abort after Error",value:"abortAfterError","hide-details":"","data-test":"abort-after-error"},null,8,["modelValue"])],16)]),default:c(()=>[e[26]||(e[26]=S("span",null,[x("Checked stops additional script execution when an error is encountered"),S("br"),x(" Unchecked allows additional scripts to execute")],-1))]),_:1})]),_:1}),l(u,{cols:"6"},{default:c(()=>[l(a,{location:"top"},{activator:c(({props:g})=>[S("div",Y(K(g)),[l(o,{disabled:!i.options.includes("loop"),modelValue:i.options,"onUpdate:modelValue":e[13]||(e[13]=b=>i.options=b),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]=S("span",null,[x("Checked breaks the loop option when an error is encountered"),S("br"),x(" Unchecked allows the loop to run continuously"),S("br"),x(" Note: Abort after Error still breaks the loop")],-1))]),_:1})]),_:1})]),_:1})]),_:1}),l(u,{cols:"8"},{default:c(()=>[l(d,{"no-gutters":"",justify:"end"},{default:c(()=>[l(u,{cols:"5"},{default:c(()=>[l(h,{label:"Script:",class:"mb-2 mr-2","hide-details":"",density:"compact",variant:"outlined","onUpdate:modelValue":[r.scriptChanged,e[14]||(e[14]=g=>i.script=g)],items:r.scriptNames,"item-title":"title","item-value":"value",modelValue:i.script,"data-test":"select-script"},null,8,["onUpdate:modelValue","items","modelValue"])]),_:1}),l(u,{cols:"auto"},{default:c(()=>[l(m,{color:"primary",class:"mr-2",disabled:n.disableButtons||!i.userInfo.execute,onClick:e[15]||(e[15]=g=>t.$emit("button",{method:"start",suite:i.suite,group:i.group,script:i.script,options:i.options})),"data-test":"start-script"},{default:c(()=>e[28]||(e[28]=[x(" Start ")])),_:1},8,["disabled"]),l(m,{color:"primary",class:"mr-2 invisible"},{default:c(()=>e[29]||(e[29]=[x(" Setup ")])),_:1}),l(m,{color:"primary",class:"invisible"},{default:c(()=>e[30]||(e[30]=[x(" Teardown ")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1})])])}const Bh=de(Lh,[["render",qh],["__scopeId","data-v-40a2938d"]]),jh={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(s=>s.message).join(`
|
14
|
+
`),e=new Blob([t],{type:"text/plain"}),n=document.createElement("a");n.href=URL.createObjectURL(e),n.setAttribute("download",it(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 $h(t,e,n,s,i,r){const o=p("v-btn"),a=p("v-tooltip"),u=p("v-spacer"),d=p("v-select"),h=p("v-text-field"),m=p("v-row"),g=p("v-card-title"),b=p("v-data-table"),y=p("v-card");return k(),D("div",null,[l(y,null,{default:c(()=>[l(g,null,{default:c(()=>[l(m,{class:"pt-2"},{default:c(()=>[l(a,{location:"top"},{activator:c(({props:f})=>[S("div",Y(K(f)),[l(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]=S("span",null," Download Log ",-1))]),_:1}),e[4]||(e[4]=x(" Script Messages ")),l(u),l(d,{density:"compact","hide-details":"",variant:"outlined",items:i.messageOrderOptions,modelValue:i.messageOrder,"onUpdate:modelValue":e[0]||(e[0]=f=>i.messageOrder=f),class:"mr-2",style:{"max-width":"200px"},"data-test":"message-order"},null,8,["items","modelValue"]),l(u),l(h,{modelValue:i.search,"onUpdate:modelValue":e[1]||(e[1]=f=>i.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"]),l(a,{location:"top"},{activator:c(({props:f})=>[S("div",Y(K(f)),[l(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]=S("span",null," Clear Log ",-1))]),_:1})]),_:1})]),_:1}),l(b,{id:"script-log-messages",style:{overflow:"auto"},headers:i.headers,items:r.messages,search:i.search,"items-per-page":-1,"hide-default-footer":"",density:"compact","data-test":"output-messages"},{"item.message":c(({item:f})=>[S("div",{class:Qt(r.messageClass(f.message))},F(f.message),3)]),_:1},8,["headers","items","search"])]),_:1})])}const Hh=de(jh,[["render",$h]]),qn=t=>I.get(`/openc3-api/autocomplete/keywords/${t}`),Wh=t=>I.get(`/openc3-api/autocomplete/data/${t}`),ar=(t,e)=>t.reduce((n,s)=>{const i=e(s);return n[i]?n[i].push(s):n[i]=[s],n},{}),Jh=t=>{const e="(^|[{\\(\\s])",n=`[\\s\\(]f?['"]`,s="(\\S+\\s?){0,3}";return new RegExp(`${e}${t}${n}${s}$`)};class lr{constructor(e,n=()=>{},s=()=>{}){this.keywordExpressions=[],this.autocompleteData=[],qn(e).then(i=>{this.keywordExpressions=i.data.map(Jh),s()}),Wh(e).then(i=>{this.autocompleteData=i.data,n()})}getCompletions(e,n,s,i,r){let o=[];const a=n.doc.$lines[s.row].slice(0,s.column);this.keywordExpressions.some(u=>a.match(u))&&(o=this.autocompleteData),r(null,[...o])}}class Gh extends lr{constructor(){super("cmd")}}class Yh extends lr{constructor(){super("tlm",()=>{this.groupedPacketData=this.autocompleteData.reduce((e,n)=>{const s=n.caption.match(/\S+\s\S+/)[0],i=n.snippet.replace(`${s} `,""),r={caption:i,snippet:i,meta:"item"};return e[s]?e[s].push(r):e[s]=[r],e},{}),this.packets=Object.keys(this.groupedPacketData).map(e=>({caption:e,snippet:e,meta:"packet"}))})}getCompletions(e,n,s,i,r){let o=[];const a=n.doc.$lines[s.row].slice(0,s.column);if(this.keywordExpressions.some(u=>a.match(u))){const u=Object.keys(this.groupedPacketData).find(d=>a.includes(d));u?o=this.groupedPacketData[u]:o=this.packets}r(null,o)}}const cr=t=>{const e="(^|[{\\(\\s])",n="((\\s.+)|(\\(.+\\)))";return new RegExp(`${e}${t}${n}`)},Kh=/\{/,Xh=/['"],\s?['"]/;class Zh{constructor(){this.api=new Ln,this.targets={},this.api.get_target_names().then(e=>{e.forEach(n=>{this.targets[n]={cmd:null,tlm:null}})}),this.cmdKeywordExpressions=[],qn("cmd").then(e=>{this.cmdKeywordExpressions=e.data.map(cr)}),this.tlmKeywordExpressions=[],qn("tlm").then(e=>{this.tlmKeywordExpressions=e.data.map(cr)})}async checkText(e){const{linesToCheck:n,linesToSkip:s}=e.split(`
|
15
|
+
`).reduce((r,o,a)=>{if(o=o.trim(),o.match(/^#/))return r;const u=this.cmdKeywordExpressions.reduce((v,T)=>v||o.match(T),null),d=this.tlmKeywordExpressions.reduce((v,T)=>v||o.match(T),null);if(!u&&!d)return r;let h=u||d,m=h.length;h=h[m-1];const g=h.substring(h.match(/[\(\s)]/).index+1).replace(/\)+.*$/,"");if(g.match(Kh))return r.linesToSkip.push(a+1),r;const b=!!g.match(Xh),y=g.split(b?",":" ");if(y.length<2)return r;const f={target:y[0],packet:y[1]};if(d)f.item=y[2];else{const v=y.slice(2);b?f.params=v.map(T=>T.split("=>")[0]):f.params=v.filter((T,C)=>C%2)}for(const v in f)typeof f[v]=="string"?f[v]=f[v].replace(/['"]/g,"").trim():f[v]=f[v].map(T=>T.replace(/['"]/g,"").trim());return r.linesToCheck.push({line:o,mnemonic:f,lineNumber:a+1}),r},{linesToCheck:[],linesToSkip:[]}),i=await this._checkLines(n);return{skipped:s.sort(),problems:i.sort((r,o)=>r.lineNumber-o.lineNumber)}}async _checkLines(e){const n=[],s=ar(e,i=>i.mnemonic.target);for(const i in s){if(!this.targets[i]){for(const o of s[i])n.push({...o,error:`Target "${i}" does not exist.`});continue}const r=ar(s[i],o=>o.mnemonic.packet);for(const o in r)for(const a of r[o]){const u=a.mnemonic.item?"tlm":"cmd";if(!this.targets[i][u]){const h=a.mnemonic.item?"get_all_tlm":"get_all_cmds",m=await this.api[h](i);this.targets[i][u]=m.reduce((g,b)=>(g[b.packet_name]=b.items.map(y=>y.name),g),{})}const d=this.targets[i][u][o];if(!d){n.push({...a,error:`${u==="tlm"?"Packet":"Command"} "${i} ${o}" does not exist.`});continue}if(a.mnemonic.item){if(!d.some(h=>h===a.mnemonic.item)){n.push({...a,error:`Item "${i} ${o} ${a.mnemonic.item}" does not exist.`});continue}}else for(const h of a.mnemonic.params)if(!d.some(m=>m===h)){n.push({...a,error:`Command "${i} ${o}" param "${h}" does not exist.`});continue}}}return n}}class Qh{constructor(e,{pattern:n,text:s,type:i}){ve(this,Fe);ve(this,pt);ve(this,mt);ve(this,ft);ve(this,gt);Hn(this,"refresh",()=>{const e=ie(this,pt).session;ie(this,Zt).call(this,e);const n={lines:e.doc.$lines,action:"insert",start:{row:0},end:{row:e.doc.$lines.length}};this.annotate(n,e)});Hn(this,"annotate",(e,n)=>{var s,i;if(e.lines.length>1)switch(e.action){case"insert":ie(this,yt).call(this,n,e.start.row,e.lines.length-1);break;case"remove":ie(this,yt).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=(i=(s=n.doc.$lines[r])==null?void 0:s.match(ie(this,mt)))==null?void 0:i.index;o!==void 0?(o!==0&&(o+=1),ie(this,Xt).call(this,n,{row:r,column:o,text:ie(this,ft),type:ie(this,gt),openc3Id:ie(this,Fe)})):e.action==="remove"&&ie(this,bt).call(this,n,r)}});ve(this,Xt,(e,n)=>{ie(this,bt).call(this,e,n.row),e.setAnnotations([...e.getAnnotations(),n])});ve(this,bt,(e,n)=>{e.setAnnotations(e.getAnnotations().filter(s=>s.openc3Id!==ie(this,Fe)||s.row!==n))});ve(this,yt,(e,n,s)=>{e.setAnnotations(e.getAnnotations().map(i=>(i.row>n&&(i.row+=s),i)))});ve(this,Zt,e=>{e.setAnnotations(e.getAnnotations().filter(n=>n.openc3Id!==ie(this,Fe)))});Ge(this,Fe,`regexAnnotator-${Math.floor(Math.random()*1e7)}`),Ge(this,pt,e),Ge(this,mt,n),Ge(this,ft,s),Ge(this,gt,i)}}Fe=new WeakMap,pt=new WeakMap,mt=new WeakMap,ft=new WeakMap,gt=new WeakMap,Xt=new WeakMap,bt=new WeakMap,yt=new WeakMap,Zt=new WeakMap;class ep extends Qh{constructor(e){const n="(^|[{\\s])",s="sleep",i="[\\(\\s]";super(e,{pattern:new RegExp(`${n}${s}${i}`),text:"Use `wait` instead of `sleep` in OpenC3 scripts",type:"warning"})}}const tp={props:{tabId:Number,curTab:Number,connectInNewTab:Boolean},components:{OutputDialog:wr},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(){I.get("/script-api/running-script").then(t=>{this.runningScripts=t.data})},getCompletedScripts:function(){I.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=>I.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}?
|
16
|
+
Did you try to stop the script first to allow the script to stop gracefully?`,{okText:"Force Quit",cancelText:"Cancel"}).then(e=>I.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",I.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,I.get(`/openc3-api/storage/download/${encodeURIComponent(t.log)}?bucket=OPENC3_LOGS_BUCKET`).then(e=>{const n=t.log.split("/"),s=n[n.length-1],i=document.createElement("a");i.href=e.data.url,i.setAttribute("download",s),i.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}`})})}}},np={key:0},sp={key:1},ip={key:0},rp={key:1};function op(t,e,n,s,i,r){const o=p("v-spacer"),a=p("v-btn"),u=p("v-text-field"),d=p("v-row"),h=p("v-card-title"),m=p("v-icon"),g=p("v-data-table"),b=p("v-card"),y=p("output-dialog");return k(),D("div",null,[l(b,{flat:""},{default:c(()=>[l(h,null,{default:c(()=>[l(d,{dense:""},{default:c(()=>[e[5]||(e[5]=S("span",{class:"mr-2"},"Running Scripts",-1)),l(o),l(a,{class:"mr-2",color:"primary",onClick:r.getRunningScripts},{default:c(()=>e[4]||(e[4]=[x("Refresh")])),_:1},8,["onClick"]),l(o),l(u,{modelValue:i.runningSearch,"onUpdate:modelValue":e[0]||(e[0]=f=>i.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}),l(g,{headers:i.runningHeaders,items:i.runningScripts,search:i.runningSearch,density:"compact","data-test":"running-scripts","items-per-page-options":[3],"max-height":"400"},{"item.connect":c(({item:f})=>[l(a,{color:"primary",onClick:v=>r.connectScript(f)},{default:c(()=>[e[7]||(e[7]=S("span",null,"Connect",-1)),Oe(l(m,{end:""},{default:c(()=>e[6]||(e[6]=[x(" mdi-open-in-new ")])),_:1},512),[[Te,n.connectInNewTab]])]),_:2},1032,["onClick"])]),"item.stop":c(({item:f})=>[l(a,{color:"primary",onClick:v=>r.stopScript(f)},{default:c(()=>[e[9]||(e[9]=S("span",null,"Stop",-1)),l(m,{end:""},{default:c(()=>e[8]||(e[8]=[x(" mdi-close-circle-outline ")])),_:1})]),_:2},1032,["onClick"])]),"item.delete":c(({item:f})=>[l(a,{color:"primary",onClick:v=>r.deleteScript(f)},{default:c(()=>[e[11]||(e[11]=S("span",null,"Delete",-1)),l(m,{end:""},{default:c(()=>e[10]||(e[10]=[x(" mdi-alert-octagon-outline ")])),_:1})]),_:2},1032,["onClick"])]),_:1},8,["headers","items","search"])]),_:1}),l(b,{flat:""},{default:c(()=>[l(h,null,{default:c(()=>[l(d,{dense:""},{default:c(()=>[e[13]||(e[13]=S("span",{class:"mr-2"},"Completed Scripts",-1)),l(o),l(a,{color:"primary",onClick:r.getCompletedScripts},{default:c(()=>e[12]||(e[12]=[x("Refresh")])),_:1},8,["onClick"]),l(o),l(u,{modelValue:i.completedSearch,"onUpdate:modelValue":e[1]||(e[1]=f=>i.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}),l(g,{headers:i.completedHeaders,items:i.completedScripts,search:i.completedSearch,density:"compact","data-test":"completed-scripts","items-per-page-options":[5]},{"item.view":c(({item:f})=>[l(a,{color:"primary",onClick:v=>r.viewScriptLog(f)},{default:c(()=>[f.name.includes("(")&&f.name.includes(")")?(k(),D("span",np," Script Report ")):(k(),D("span",sp," Script Log ")),l(m,{right:""},{default:c(()=>e[14]||(e[14]=[x(" mdi-eye ")])),_:1})]),_:2},1032,["onClick"])]),"item.download":c(({item:f})=>[l(a,{disabled:i.downloadScript,loading:i.downloadScript&&i.downloadScript.name===f.name,onClick:v=>r.downloadScriptLog(f)},{loader:c(()=>e[16]||(e[16]=[S("span",null," Loading... ",-1)])),default:c(()=>[f.name.includes("(")&&f.name.includes(")")?(k(),D("span",ip," Script Report ")):(k(),D("span",rp," Script Log ")),l(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}),i.showDialog?(k(),P(y,{key:0,content:i.dialogContent,type:"Script",name:i.dialogName,filename:i.dialogFilename,modelValue:i.showDialog,"onUpdate:modelValue":e[2]||(e[2]=f=>i.showDialog=f),onSubmit:e[3]||(e[3]=f=>i.showDialog=!1)},null,8,["content","name","filename","modelValue"])):L("",!0)])}const ap=de(tp,[["render",op]]),Bn="__TEMP__",_e="<Untitled>",jn="Start",lp="Go",ht="Pause",cp="Retry",up={components:{FileOpenSaveDialog:ns,Openc3Screen:ts,EnvironmentDialog:es,Splitpanes:dl,Pane:fl,TopBar:Nr,AskDialog:rh,FileDialog:dh,InformationDialog:bh,EventListDialog:eh,OverridesDialog:vh,PromptDialog:Ah,ResultsDialog:Vh,ScriptEnvironmentDialog:Fh,SimpleTextDialog:Pr,SuiteRunner:Bh,RunningScripts:ap,ScriptLogMessages:Hh,CriticalCmdDialog:rs},mixins:[os],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:jn,startOrGoDisabled:!1,envDisabled:!1,pauseOrRetryButton:ht,pauseOrRetryDisabled:!1,stopDisabled:!1,showEnvironment:!1,showDebug:!1,debug:"",debugHistory:[],debugHistoryIndex:0,showDisconnect:!1,files:{},breakpoints:{},enableStackTraces:!1,filename:_e,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 Zh,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===_e?_e:`${this.filename} ${this.fileModified}`.trim()},filenameOrBlank:function(){return this.filename===_e?"":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===_e?localStorage.removeItem("script_runner__filename"):localStorage.script_runner__filename=t}},created:async function(){this.api=new Ln,this.api.ensure_offline_access(),this.api.get_setting("time_zone").then(n=>{n&&(this.timeZone=n)}).catch(n=>{}),this.NEW_FILENAME=_e,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 I.get(`/openc3-api/roles/${n}`).then(s=>{s.data!==null&&s.data.permissions!==void 0&&(s.data.permissions.some(i=>i.permission=="script_edit")&&(this.readOnlyUser=!1),s.data.permissions.some(i=>i.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}I.get("/openc3-api/autocomplete/keywords/screen").then(n=>{this.screenKeywords=n.data})},mounted:async function(){var s,i;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 Gh,new Yh],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 ep(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 Cu("/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()}}))),(s=this.$route.query)!=null&&s.file?(this.filename=this.$route.query.file,await this.reloadFile()):(i=this.$route.params)!=null&&i.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 s=0;const i=document.getElementsByClassName("suite-runner")[0];i&&(s=i.offsetHeight);let r=document.getElementById("script-log-messages");r&&(r.style.height=`${e-n-s}px`)},scriptDisconnect(){this.subscription&&(this.subscription.unsubscribe(),this.subscription=null),this.receivedEvents.length=0},showMetadata(){I.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 I.get("/script-api/running-script").then(e=>{const n=e.data.find(s=>`${s.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(){I.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(`
|
17
|
+
`),n=this.getBreakpointRows().filter(s=>s>=t).map(s=>s-t);this.executeText(e,n)},executeSelection:function(){const t=this.editor.getSelectedText(),e=this.editor.getSelectionRange(),n=this.getBreakpointRows().filter(s=>s<=e.end.row&&s>=e.start.row).map(s=>s-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 s=Bn+"/"+it(Date.now(),"yyyy_MM_dd_HH_mm_ss_SSS")+`_temp.${n}`;await I.post(`/script-api/scripts/${s}`,{data:{text:t,breakpoints:e}}).then(i=>{let r=this.scriptEnvironment.env;return this.enableStackTraces&&(r=r.concat({key:"OPENC3_FULL_BACKTRACE",value:"1"})),I.post(`/script-api/scripts/${s}/run`,{data:{environment:r}})}).then(i=>{window.open(`/tools/scriptrunner/${i.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 s=[],i=0;switch(t.action){case"insert":i=t.lines.length-1,n.reverse();break;case"remove":i=-t.lines.length+1,s=[...Array(t.lines.length).keys()].map(r=>r+t.start.row);break}n.forEach(r=>{e.clearBreakpoint(r),s.includes(r)||e.setBreakpoint(r+i)})},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=>I.delete("/script-api/breakpoints/delete/all")).then(t=>{this.clearBreakpoints()})},suiteRunnerButton(t){this.startOrGoButton===jn?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 s=e.map(i=>`${i.lineNumber}: ${i.error}`).join("<br/>");n+=`<strong>The following lines have problems:</strong><br/>${s}<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=lp,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=jn,this.pauseOrRetryButton=ht,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===_e&&(n=this.tempFilename);let s=`/script-api/scripts/${n}/run`;this.showDisconnect&&(s+="/disconnect");let i=this.scriptEnvironment.env;this.enableStackTraces&&(i=i.concat({key:"OPENC3_FULL_BACKTRACE",value:"1"}));let r={environment:i};e&&(r.suiteRunner=t),I.post(s,{data:r}).then(o=>{this.scriptStart(o.data)}).catch(o=>{this.scriptComplete()})},go(){this.filenameSelect=this.currentFilename,this.fileNameChanged(this.currentFilename),I.post(`/script-api/running-script/${this.scriptId}/go`)},pauseOrRetry(){this.pauseOrRetryButton===ht?I.post(`/script-api/running-script/${this.scriptId}/pause`):(this.pauseOrRetryButton=ht,I.post(`/script-api/running-script/${this.scriptId}/retry`))},stop(){this.fatal?(this.removeAllMarkers(),this.scriptComplete()):I.post(`/script-api/running-script/${this.scriptId}/stop`)},step(){I.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},I.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=ht,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=cp;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(s=>e[s].clazz===`${this.state}Marker`).length===0){this.removeAllMarkers();let s=t.line_no>0?t.line_no:1;this.editor.session.addMarker(new this.Range(s-1,0,s-1,1),`${this.state}Marker`,"fullLine"),this.editor.gotoLine(s),t.filename&&(this.files[t.filename].lineNo=s)}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(`
|
18
|
+
`))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 s=!1,i={};for(screen of this.screens){if(screen.target==e.target_name&&screen.screen==e.screen_name){i=screen,s=!0;break}n+=1}i.target=e.target_name,i.screen=e.screen_name,i.definition=e.definition,e.x?i.left=e.x:i.left=0,e.y?i.top=e.y:i.top=0,i.count=this.updateCounter++,s?this.screens[n]=i:(i.id=this.idCounter++,this.screens[this.screens.length]=i);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,I.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?I.post(`/script-api/running-script/${this.scriptId}/prompt`,{data:{method:t.method,password:e,prompt_id:this.activePromptId}}):I.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,I.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(s=>{e.push(s.name),n.push(I.get(`/openc3-api/storage/upload/${encodeURIComponent(`${window.openc3Scope}/tmp/${s.name}`)}?bucket=OPENC3_CONFIG_BUCKET`).then(i=>{n.push(H({...i.data,data:s}))}))})),Promise.all(n).then(s=>{I.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(i=>{this.file.show=!1})})},setError(t){this.alertType="error",this.alertText=`Error: ${t}`,this.showAlert=!0},newFile(){this.unlockFile(),this.filename=_e,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'
|
19
|
+
|
20
|
+
# Group class name should indicate what the scripts are testing
|
21
|
+
class Power < OpenC3::Group
|
22
|
+
# Methods beginning with script_ are added to Script dropdown
|
23
|
+
def script_power_on
|
24
|
+
# Using OpenC3::Group.puts adds the output to the Test Report
|
25
|
+
# This can be useful for requirements verification, QA notes, etc
|
26
|
+
OpenC3::Group.puts "Verifying requirement SR-1"
|
27
|
+
configure()
|
28
|
+
end
|
29
|
+
|
30
|
+
# Other methods are not added to Script dropdown
|
31
|
+
def configure
|
32
|
+
end
|
33
|
+
|
34
|
+
def setup
|
35
|
+
# Run when Group Setup button is pressed
|
36
|
+
# Run before all scripts when Group Start is pressed
|
37
|
+
end
|
38
|
+
|
39
|
+
def teardown
|
40
|
+
# Run when Group Teardown button is pressed
|
41
|
+
# Run after all scripts when Group Start is pressed
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
class TestSuite < OpenC3::Suite
|
46
|
+
def initialize
|
47
|
+
add_group('Power')
|
48
|
+
end
|
49
|
+
def setup
|
50
|
+
# Run when Suite Setup button is pressed
|
51
|
+
# Run before all groups when Suite Start is pressed
|
52
|
+
end
|
53
|
+
def teardown
|
54
|
+
# Run when Suite Teardown button is pressed
|
55
|
+
# Run after all groups when Suite Start is pressed
|
56
|
+
end
|
57
|
+
end
|
58
|
+
`),await this.saveFile("auto")},async newPythonTestSuite(){this.newFile(),this.editor.session.setValue(`from openc3.script.suite import Suite, Group
|
59
|
+
|
60
|
+
# Group class name should indicate what the scripts are testing
|
61
|
+
class Power(Group):
|
62
|
+
# Methods beginning with script_ are added to Script dropdown
|
63
|
+
def script_power_on(self):
|
64
|
+
# Using Group.print adds the output to the Test Report
|
65
|
+
# This can be useful for requirements verification, QA notes, etc
|
66
|
+
Group.print("Verifying requirement SR-1")
|
67
|
+
self.configure()
|
68
|
+
|
69
|
+
# Other methods are not added to Script dropdown
|
70
|
+
def configure(self):
|
71
|
+
pass
|
72
|
+
|
73
|
+
def setup(self):
|
74
|
+
# Run when Group Setup button is pressed
|
75
|
+
# Run before all scripts when Group Start is pressed
|
76
|
+
pass
|
77
|
+
|
78
|
+
def teardown(self):
|
79
|
+
# Run when Group Teardown button is pressed
|
80
|
+
# Run after all scripts when Group Start is pressed
|
81
|
+
pass
|
82
|
+
|
83
|
+
class TestSuite(Suite):
|
84
|
+
def __init__(self):
|
85
|
+
self.add_group(Power)
|
86
|
+
|
87
|
+
def setup(self):
|
88
|
+
# Run when Suite Setup button is pressed
|
89
|
+
# Run before all groups when Suite Start is pressed
|
90
|
+
pass
|
91
|
+
|
92
|
+
def teardown(self):
|
93
|
+
# Run when Suite Teardown button is pressed
|
94
|
+
# Run after all groups when Suite Start is pressed
|
95
|
+
pass
|
96
|
+
`),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:ss(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 I.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 s=e.data.locked,i=e.data.breakpoints;this.setFile({file:n,locked:s,breakpoints:i},!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},s=!1){this.files={};let i=t.name.split("*")[0];s===!1&&this.filename!==i&&(this.unlockFile(),this.lockedBy=e),this.filename=i,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*$"),s=new RegExp("^\\s*(if|def|while|else|elif|class).*:\\s*$"),i=new RegExp('\\(f"'),o=this.editor.getValue().split(`
|
97
|
+
`);for(let a of o){if(a.match(t))return"ruby";if(a.match(e))return"python";if(a.match(n))return"ruby";if(a.match(s)||a.match(i))return"python"}return"unknown"},async saveFile(t="menu"){if(!this.readOnlyUser)if(this.saveAllowed){const e=this.getBreakpointRows();if(this.filename===_e){if(t==="menu"){this.saveAs();return}else if(this.tempFilename===null){let n=this.detectLanguage();if(n==="ruby"||t!=="auto"&&n=="unknown")this.tempFilename=Bn+"/"+it(Date.now(),"yyyy_MM_dd_HH_mm_ss_SSS")+"_temp.rb";else if(n==="python")this.tempFilename=Bn+"/"+it(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 I.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&&(I.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=>I.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(){I.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(){I.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(){I.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,I.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 I.post(`/script-api/scripts/${this.filename}/lock`)},unlockFile:function(){this.filename!==_e&&!this.readOnly&&!this.readOnlyUser&&I.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}}}},dp={class:"grid"},hp=["id"],pp={class:"item-content"},mp={id:"sr-controls"},fp={key:2,style:{width:"40px",height:"40px"},class:"ml-2 mr-2"},gp={key:3},bp={key:4},yp={key:0,id:"debug",class:"pa-0"};function wp(t,e,n,s,i,r){const o=p("top-bar"),a=p("v-icon"),u=p("v-btn"),d=p("v-snackbar"),h=p("openc3-screen"),m=p("suite-runner"),g=p("v-tooltip"),b=p("v-select"),y=p("v-text-field"),f=p("v-progress-circular"),v=p("v-spacer"),T=p("v-row"),C=p("v-card"),A=p("v-list-item-title"),B=p("v-list-item"),E=p("v-list"),R=p("v-menu"),z=p("pane"),G=p("script-log-messages"),te=p("splitpanes"),Je=p("file-open-save-dialog"),le=p("environment-dialog"),Ce=p("ask-dialog"),ee=p("file-dialog"),U=p("information-dialog"),J=p("event-list-dialog"),ke=p("overrides-dialog"),Le=p("prompt-dialog"),wt=p("results-dialog"),_p=p("script-environment-dialog"),vp=p("simple-text-dialog"),Sp=p("critical-cmd-dialog"),kp=p("running-scripts"),xp=p("v-sheet"),Ep=p("v-bottom-sheet");return k(),D(re,null,[l(o,{menus:r.menus,title:i.title},null,8,["menus","title"]),l(d,{modelValue:i.showAlert,"onUpdate:modelValue":e[1]||(e[1]=O=>i.showAlert=O),location:"top",color:i.alertType,timeout:3e3},{actions:c(({attrs:O})=>[l(u,ce({variant:"text"},O,{onClick:e[0]||(e[0]=$n=>i.showAlert=!1)}),{default:c(()=>e[34]||(e[34]=[x(" Close ")])),_:2},1040)]),default:c(()=>[l(a,null,{default:c(()=>[x(" mdi-"+F(i.alertType),1)]),_:1}),x(" "+F(i.alertText)+" ",1)]),_:1},8,["modelValue","color"]),l(d,{modelValue:i.showEditingToast,"onUpdate:modelValue":e[3]||(e[3]=O=>i.showEditingToast=O),location:"top",timeout:-1,color:"orange"},{actions:c(({attrs:O})=>[l(u,ce({variant:"text"},O,{color:"danger",onClick:r.confirmLocalUnlock,"data-test":"unlock-button"}),{default:c(()=>e[36]||(e[36]=[x(" Unlock ")])),_:2},1040,["onClick"]),l(u,ce({variant:"text"},O,{onClick:e[2]||(e[2]=()=>{i.showEditingToast=!1})}),{default:c(()=>e[37]||(e[37]=[x(" dismiss ")])),_:2},1040)]),default:c(()=>[l(a,null,{default:c(()=>e[35]||(e[35]=[x(" mdi-pencil-off ")])),_:1}),x(" "+F(i.lockedBy)+" is editing this script. Editor is in read-only mode ",1)]),_:1},8,["modelValue"]),S("div",dp,[(k(!0),D(re,null,he(i.screens,O=>(k(),D("div",{class:"item",key:O.id,id:r.screenId(O.id),ref_for:!0,ref:"gridItem"},[S("div",pp,[l(h,{target:O.target,screen:O.screen,definition:O.definition,keywords:i.screenKeywords,initialFloated:!0,initialTop:O.top,initialLeft:O.left,initialZ:3,minZ:3,fixFloated:!0,count:O.count,onCloseScreen:$n=>r.closeScreen(O.id),onDeleteScreen:$n=>r.closeScreen(O.id)},null,8,["target","screen","definition","keywords","initialTop","initialLeft","count","onCloseScreen","onDeleteScreen"])])],8,hp))),128))]),l(C,{style:{padding:"10px"}},{default:c(()=>[i.suiteRunner?(k(),P(m,{key:0,class:"suite-runner","suite-map":i.suiteMap,"disable-buttons":i.disableSuiteButtons,filename:r.fullFilename,onButton:r.suiteRunnerButton,onLoaded:r.doResize},null,8,["suite-map","disable-buttons","filename","onButton","onLoaded"])):L("",!0),S("div",mp,[l(T,{"no-gutters":"",justify:"space-between"},{default:c(()=>[i.showDisconnect?(k(),P(a,{key:0,class:"mt-2",color:"red"},{default:c(()=>e[38]||(e[38]=[x(" mdi-connection ")])),_:1})):L("",!0),l(g,{location:"top"},{activator:c(({props:O})=>[l(u,ce(O,{icon:"mdi-cached",variant:"text",onClick:r.reloadFile,disabled:i.filename===t.NEW_FILENAME}),null,16,["onClick","disabled"])]),default:c(()=>[e[39]||(e[39]=S("span",null," Reload File ",-1))]),_:1}),l(b,{modelValue:i.filenameSelect,"onUpdate:modelValue":[e[4]||(e[4]=O=>i.filenameSelect=O),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"]),l(y,{modelValue:i.scriptId,"onUpdate:modelValue":e[5]||(e[5]=O=>i.scriptId=O),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"]),l(y,{modelValue:r.stateTimer,"onUpdate:modelValue":e[6]||(e[6]=O=>r.stateTimer=O),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"]),i.state==="Connecting..."?(k(),P(f,{key:1,size:40,class:"ml-2 mr-2",indeterminate:"",color:"primary"})):(k(),D("div",fp)),l(v),i.startOrGoButton==="Start"?(k(),D("div",gp,[l(u,{onClick:r.startHandler,class:"mx-1",color:"primary","data-test":"start-button",disabled:i.startOrGoDisabled||!i.executeUser,hidden:i.suiteRunner},{default:c(()=>e[40]||(e[40]=[S("span",null," Start ",-1)])),_:1},8,["onClick","disabled","hidden"]),l(g,{location:"top"},{activator:c(({props:O})=>[l(u,ce(O,{onClick:e[7]||(e[7]=$n=>i.scriptEnvironment.show=!i.scriptEnvironment.show),class:"mx-1","data-test":"env-button",color:r.environmentIconColor,disabled:i.envDisabled}),{default:c(()=>[l(a,null,{default:c(()=>[x(F(r.environmentIcon),1)]),_:1})]),_:2},1040,["color","disabled"])]),default:c(()=>[e[41]||(e[41]=S("span",null,"Script Environment",-1))]),_:1})])):(k(),D("div",bp,[l(u,{onClick:r.go,color:"primary",class:"mr-2",disabled:i.startOrGoDisabled,"data-test":"go-button"},{default:c(()=>e[42]||(e[42]=[x(" Go ")])),_:1},8,["onClick","disabled"]),l(u,{color:"primary",onClick:r.pauseOrRetry,class:"mr-2",disabled:i.pauseOrRetryDisabled,"data-test":"pause-retry-button"},{default:c(()=>[x(F(i.pauseOrRetryButton),1)]),_:1},8,["onClick","disabled"]),l(u,{color:"primary",onClick:r.stop,"data-test":"stop-button",disabled:i.stopDisabled},{default:c(()=>e[43]||(e[43]=[x(" Stop ")])),_:1},8,["onClick","disabled"])]))]),_:1})])]),_:1}),l(te,{horizontal:"",onResize:r.calcHeight,style:{height:"100%"}},{default:c(()=>[l(z,{class:"editorbox",size:"50"},{default:c(()=>[l(d,{modelValue:i.showSave,"onUpdate:modelValue":e[8]||(e[8]=O=>i.showSave=O),absolute:"",location:"top right",timeout:-1,class:"saving"},{default:c(()=>e[44]||(e[44]=[x(" Saving... ")])),_:1},8,["modelValue"]),S("pre",{ref:"editor",class:"editor",onContextmenu:e[9]||(e[9]=Se((...O)=>r.showExecuteSelectionMenu&&r.showExecuteSelectionMenu(...O),["prevent"]))},null,544),l(R,{modelValue:i.executeSelectionMenu,"onUpdate:modelValue":e[10]||(e[10]=O=>i.executeSelectionMenu=O),target:[i.menuX,i.menuY]},{default:c(()=>[l(E,null,{default:c(()=>[(k(!0),D(re,null,he(r.executeSelectionMenuItems,O=>(k(),P(B,{link:"",key:O.label,disabled:i.scriptId},{default:c(()=>[l(A,{onClick:O.command},{default:c(()=>[x(F(O.label),1)]),_:2},1032,["onClick"])]),_:2},1032,["disabled"]))),128))]),_:1})]),_:1},8,["modelValue","target"])]),_:1}),l(z,{id:"messages",class:"mt-2",ref:"messagesDiv"},{default:c(()=>[i.showDebug?(k(),D("div",yp,[l(T,{"no-gutters":""},{default:c(()=>[l(u,{color:"primary",onClick:r.step,style:{width:"100px"},class:"mr-4",disabled:!i.scriptId,"data-test":"step-button"},{default:c(()=>[e[46]||(e[46]=x(" Step ")),l(a,{end:""},{default:c(()=>e[45]||(e[45]=[x(" mdi-step-forward ")])),_:1})]),_:1},8,["onClick","disabled"]),l(y,{ref:"debug",class:"mb-2",variant:"outlined",density:"compact","hide-details":"",label:"Debug",modelValue:i.debug,"onUpdate:modelValue":e[11]||(e[11]=O=>i.debug=O),onKeydown:r.debugKeydown,"data-test":"debug-text"},null,8,["modelValue","onKeydown"])]),_:1})])):L("",!0),l(G,{id:"log-messages",modelValue:i.messages,"onUpdate:modelValue":e[12]||(e[12]=O=>i.messages=O),onSort:r.messageSortOrder},null,8,["modelValue","onSort"])]),_:1},512)]),_:1},8,["onResize"]),i.fileOpen?(k(),P(Je,{key:0,modelValue:i.fileOpen,"onUpdate:modelValue":e[13]||(e[13]=O=>i.fileOpen=O),type:"open","api-url":"/script-api/scripts",onFile:e[14]||(e[14]=O=>r.setFile(O)),onError:e[15]||(e[15]=O=>r.setError(O)),onClearTemp:e[16]||(e[16]=O=>r.clearTemp(O))},null,8,["modelValue"])):L("",!0),i.showSaveAs?(k(),P(Je,{key:1,modelValue:i.showSaveAs,"onUpdate:modelValue":e[17]||(e[17]=O=>i.showSaveAs=O),type:"save","api-url":"/script-api/scripts","require-target-parent-dir":"","input-filename":r.filenameOrBlank,onFilename:e[18]||(e[18]=O=>r.saveAsFilename(O)),onError:e[19]||(e[19]=O=>r.setError(O)),onClearTemp:e[20]||(e[20]=O=>r.clearTemp(O))},null,8,["modelValue","input-filename"])):L("",!0),i.showEnvironment?(k(),P(le,{key:2,modelValue:i.showEnvironment,"onUpdate:modelValue":e[21]||(e[21]=O=>i.showEnvironment=O)},null,8,["modelValue"])):L("",!0),i.ask.show?(k(),P(Ce,{key:3,modelValue:i.ask.show,"onUpdate:modelValue":e[22]||(e[22]=O=>i.ask.show=O),question:i.ask.question,default:i.ask.default,password:i.ask.password,"answer-required":i.ask.answerRequired,onResponse:i.ask.callback},null,8,["modelValue","question","default","password","answer-required","onResponse"])):L("",!0),i.file.show?(k(),P(ee,{key:4,modelValue:i.file.show,"onUpdate:modelValue":e[23]||(e[23]=O=>i.file.show=O),title:i.file.title,message:i.file.message,multiple:i.file.multiple,filter:i.file.filter,onResponse:r.fileDialogCallback},null,8,["modelValue","title","message","multiple","filter","onResponse"])):L("",!0),i.information.show?(k(),P(U,{key:5,modelValue:i.information.show,"onUpdate:modelValue":e[24]||(e[24]=O=>i.information.show=O),title:i.information.title,text:i.information.text,width:i.information.width},null,8,["modelValue","title","text","width"])):L("",!0),i.inputMetadata.show?(k(),P(J,{key:6,modelValue:i.inputMetadata.show,"onUpdate:modelValue":e[25]||(e[25]=O=>i.inputMetadata.show=O),events:i.inputMetadata.events,"time-zone":i.timeZone,"new-metadata":"",onClose:i.inputMetadata.callback},null,8,["modelValue","events","time-zone","onClose"])):L("",!0),i.showOverrides?(k(),P(ke,{key:7,modelValue:i.showOverrides,"onUpdate:modelValue":e[26]||(e[26]=O=>i.showOverrides=O)},null,8,["modelValue"])):L("",!0),i.prompt.show?(k(),P(Le,{key:8,modelValue:i.prompt.show,"onUpdate:modelValue":e[27]||(e[27]=O=>i.prompt.show=O),title:i.prompt.title,subtitle:i.prompt.subtitle,message:i.prompt.message,details:i.prompt.details,buttons:i.prompt.buttons,layout:i.prompt.layout,multiple:i.prompt.multiple,onResponse:i.prompt.callback},null,8,["modelValue","title","subtitle","message","details","buttons","layout","multiple","onResponse"])):L("",!0),i.results.show?(k(),P(wt,{key:9,modelValue:i.results.show,"onUpdate:modelValue":e[28]||(e[28]=O=>i.results.show=O),text:i.results.text},null,8,["modelValue","text"])):L("",!0),i.scriptEnvironment.show?(k(),P(_p,{key:10,modelValue:i.scriptEnvironment.show,"onUpdate:modelValue":e[29]||(e[29]=O=>i.scriptEnvironment.show=O),"input-environment":i.scriptEnvironment.env,onEnvironment:r.environmentHandler},null,8,["modelValue","input-environment","onEnvironment"])):L("",!0),l(vp,{modelValue:i.showSuiteError,"onUpdate:modelValue":e[30]||(e[30]=O=>i.showSuiteError=O),title:"Suite Analysis Error",text:i.suiteError,width:1e3},null,8,["modelValue","text"]),l(Sp,{uuid:i.criticalCmdUuid,cmdString:i.criticalCmdString,cmdUser:i.criticalCmdUser,persistent:!0,modelValue:i.displayCriticalCmd,"onUpdate:modelValue":e[31]||(e[31]=O=>i.displayCriticalCmd=O),onStatus:r.promptDialogCallback},null,8,["uuid","cmdString","cmdUser","modelValue","onStatus"]),l(Ep,{modelValue:i.showScripts,"onUpdate:modelValue":e[33]||(e[33]=O=>i.showScripts=O)},{default:c(()=>[l(xp,{class:"pb-11 pt-5 px-5"},{default:c(()=>[i.showScripts?(k(),P(kp,{key:0,"connect-in-new-tab":!!i.fileModified,onDisconnect:r.scriptDisconnect,onClose:e[32]||(e[32]=()=>{i.showScripts=!1})},null,8,["connect-in-new-tab","onDisconnect"])):L("",!0)]),_:1})]),_:1},8,["modelValue"])],64)}const mm=j("default",de(up,[["render",wp],["__scopeId","data-v-415f09d1"]]))}}});
|