import{o as openBlock,c as createElementBlock,a as createBaseVNode,t as toDisplayString,F as Fragment,i as renderList,n as normalizeClass,f as createCommentVNode,k as withDirectives,v as vModelText,_ as _export_sfc}from"./index.js";const _hoisted_1={key:0,class:"console__body"},_hoisted_2={class:"console__content",ref:"content"},_hoisted_3={class:"console__message__content"},_hoisted_4={class:"console__message__value"},_hoisted_5=["onClick"],_hoisted_6={key:0,class:"console__stack"},_hoisted_7={class:"console__input"};function render(o,s,c,l,a,t){return openBlock(),createElementBlock("div",{class:normalizeClass(["console",{console_opened:o.isOpened}])},[createBaseVNode("div",{class:"console__head",onClick:s[0]||(s[0]=(...e)=>t.toggle&&t.toggle(...e))},toDisplayString(o.isOpened?"ЗАКРЫТЬ КОНСОЛЬ":"ОТКРЫТЬ КОНСОЛЬ"),1),o.isOpened?(openBlock(),createElementBlock("div",_hoisted_1,[createBaseVNode("div",_hoisted_2,[(openBlock(!0),createElementBlock(Fragment,null,renderList(o.messages,(e,n)=>(openBlock(),createElementBlock("div",{class:normalizeClass(["console__message",`console__message_${e.type}`]),key:n},[createBaseVNode("div",_hoisted_3,[createBaseVNode("div",_hoisted_4,toDisplayString(e.value),1),e.stack?(openBlock(),createElementBlock("div",{key:0,class:"console__message__button",onClick:i=>e.opened=!e.opened},toDisplayString(e.opened?"СВЕРНУТЬ":"РАЗВЕРНУТЬ"),9,_hoisted_5)):createCommentVNode("",!0)]),e.stack&&e.opened?(openBlock(),createElementBlock("pre",_hoisted_6,toDisplayString(e.stack),1)):createCommentVNode("",!0)],2))),128))],512)])):createCommentVNode("",!0),createBaseVNode("div",_hoisted_7,[withDirectives(createBaseVNode("input",{"onUpdate:modelValue":s[1]||(s[1]=e=>o.script=e)},null,512),[[vModelText,o.script]]),createBaseVNode("div",{class:"console__input__button",onClick:s[2]||(s[2]=(...e)=>t.executeScript&&t.executeScript(...e))},"Send")])],2)}const Console_vue_vue_type_style_index_0_scoped_aa469dc4_lang="",_sfc_main={data:()=>({isOpened:!1,messages:[],script:""}),methods:{executeScript(){eval(this.script),this.script=""},toggle(){this.isOpened=!this.isOpened,this.scrollBottom()},error(...o){for(const s of o)this.messages.push({type:"error",value:s.message,stack:s.stack});this.scrollBottom()},log(...o){this.messages.push({type:"log",value:o.join(" ")}),this.scrollBottom()},scrollBottom(){this.$nextTick(()=>{this.$refs.content})}}},Console=_export_sfc(_sfc_main,[["render",render],["__scopeId","data-v-aa469dc4"]]);export{Console as default};
