import{bF as e,bE as t,aU as n,aS as r,as as o,M as a,I as i,H as c,q as l,F as u}from"./@vue.DbmRtknU.js";var s={207:(e,t,n)=>{e.exports=n(452)},452:e=>{var t=function(e){var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(E){l=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof y?t:y,a=Object.create(o.prototype),i=new V(r||[]);return a._invoke=function(e,t,n){var r=d;return function(o,a){if(r===f)throw new Error("Generator is already running");if(r===p){if("throw"===o)throw a;return P()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=j(i,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var l=s(e,t,n);if("normal"===l.type){if(r=n.done?p:h,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=p,n.method="throw",n.arg=l.arg)}}}(e,n,i),a}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(r){return{type:"throw",arg:r}}}e.wrap=u;var d="suspendedStart",h="suspendedYield",f="executing",p="completed",v={};function y(){}function g(){}function m(){}var b={};l(b,a,function(){return this});var w=Object.getPrototypeOf,N=w&&w(w(L([])));N&&N!==n&&r.call(N,a)&&(b=N);var k=m.prototype=y.prototype=Object.create(b);function C(e){["next","throw","return"].forEach(function(t){l(e,t,function(e){return this._invoke(t,e)})})}function x(e,t){function n(o,a,i,c){var l=s(e[o],e,a);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then(function(e){n("next",e,i,c)},function(e){n("throw",e,i,c)}):t.resolve(d).then(function(e){u.value=e,i(u)},function(e){return n("throw",e,i,c)})}c(l.arg)}var o;this._invoke=function(e,r){function a(){return new t(function(t,o){n(e,r,t,o)})}return o=o?o.then(a,a):a()}}function j(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,j(e,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=s(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function V(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function L(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(l&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(n){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},d={};function h(e){var t=d[e];if(void 0!==t)return t.exports;var n=d[e]={exports:{}};return s[e](n,n.exports,h),n.exports}h.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return h.d(t,{a:t}),t},h.d=(e,t)=>{for(var n in t)h.o(t,n)&&!h.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},h.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var f={};function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nM});const m=(k={Fragment:()=>u,computed:()=>l,createTextVNode:()=>c,createVNode:()=>i,defineComponent:()=>a,nextTick:()=>o,reactive:()=>r,ref:()=>n,watch:()=>t,watchEffect:()=>e},C={},h.d(C,k),C),b=(0,m.defineComponent)({props:{data:{required:!0,type:String},onClick:Function},render:function(){var e=this.data,t=this.onClick;return(0,m.createVNode)("span",{class:"vjs-tree-brackets",onClick:t},[e])}}),w=(0,m.defineComponent)({emits:["change","update:modelValue"],props:{checked:{type:Boolean,default:!1},isMultiple:Boolean,onChange:Function},setup:function(e,t){var n=t.emit;return{uiType:(0,m.computed)(function(){return e.isMultiple?"checkbox":"radio"}),model:(0,m.computed)({get:function(){return e.checked},set:function(e){return n("update:modelValue",e)}})}},render:function(){var e=this.uiType,t=this.model,n=this.$emit;return(0,m.createVNode)("label",{class:["vjs-check-controller",t?"is-checked":""],onClick:function(e){return e.stopPropagation()}},[(0,m.createVNode)("span",{class:"vjs-check-controller-inner is-".concat(e)},null),(0,m.createVNode)("input",{checked:t,class:"vjs-check-controller-original is-".concat(e),type:e,onChange:function(){return n("change",t)}},null)])}}),N=(0,m.defineComponent)({props:{nodeType:{required:!0,type:String},onClick:Function},render:function(){var e=this.nodeType,t=this.onClick,n="objectStart"===e||"arrayStart"===e;return n||"objectCollapsed"===e||"arrayCollapsed"===e?(0,m.createVNode)("span",{class:"vjs-carets vjs-carets-".concat(n?"open":"close"),onClick:t},[(0,m.createVNode)("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},[(0,m.createVNode)("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"},null)])]):null}});var k,C;function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function j(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"root",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(arguments.length>3?arguments[3]:void 0)||{},o=r.key,a=r.index,i=r.type,c=void 0===i?"content":i,l=r.showComma,u=void 0!==l&&l,s=r.length,d=void 0===s?1:s,h=j(e);if("array"===h){var f=O(e.map(function(e,r,o){return S(e,"".concat(t,"[").concat(r,"]"),n+1,{index:r,showComma:r!==o.length-1,length:d,type:c})}));return[S("[",t,n,{showComma:!1,key:o,length:e.length,type:"arrayStart"})[0]].concat(f,S("]",t,n,{showComma:u,length:e.length,type:"arrayEnd"})[0])}if("object"===h){var p=Object.keys(e),v=O(p.map(function(r,o,a){return S(e[r],/^[a-zA-Z_]\w*$/.test(r)?"".concat(t,".").concat(r):"".concat(t,'["').concat(r,'"]'),n+1,{key:r,showComma:o!==a.length-1,length:d,type:c})}));return[S("{",t,n,{showComma:!1,key:o,index:a,length:p.length,type:"objectStart"})[0]].concat(v,S("}",t,n,{showComma:u,length:p.length,type:"objectEnd"})[0])}return[{content:e,level:n,key:o,index:a,path:t,showComma:u,length:d,type:c}]}function O(e){if("function"==typeof Array.prototype.flat)return e.flat();for(var t=y(e),n=[];t.length;){var r=t.shift();Array.isArray(r)?t.unshift.apply(t,y(r)):n.push(r)}return n}function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if(null==e)return e;if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if("object"!==x(e))return e;if(t.get(e))return t.get(e);if(Array.isArray(e)){var n=e.map(function(e){return V(e,t)});return t.set(e,n),n}var r={};for(var o in e)r[o]=V(e[o],t);return t.set(e,r),r}function L(e,t,n,r,o,a,i){try{var c=e[a](i),l=c.value}catch(u){return void n(u)}c.done?t(l):Promise.resolve(l).then(r,o)}var P=h(207),E=h.n(P);function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function A(e){for(var t=1;t=t||o.length>=n,c=null===(a=e.pathCollapsible)||void 0===a?void 0:a.call(e,o);return"objectStart"!==o.type&&"arrayStart"!==o.type||!i&&!c?r:H(H({},r),{},g({},o.path,1))},{})},c=(0,m.reactive)({translateY:0,visibleData:null,hiddenPaths:i(e.deep,e.collapsedNodeLength),startIndex:0,endIndex:0}),l=[],u=[],s=0,d={},h=function(t){l=Array(t).fill(0).map(function(){return e.itemHeight||20}),(u=new Array(t+1))[0]=0;for(var n=0;nt&&(e=t);for(var n=e;n>>1;e[o]r.length?r.length-w:N;k<0&&(k=0);var C=k+w;c.translateY=k*e.itemHeight,c.startIndex=k,c.endIndex=C,c.visibleData=r.slice(k,C)}}else c.translateY=0,c.startIndex=0,c.endIndex=r.length,c.visibleData=r},x=null,j=function(){x&&cancelAnimationFrame(x),x=requestAnimationFrame(function(){C()})},O=function(t){var r,o=t.path,a=e.selectableType;if("multiple"===a){var i=w.value.findIndex(function(e){return e===o}),c=y(w.value);-1!==i?c.splice(i,1):c.push(o),n("update:selectedValue",c),n("selectedChange",c,y(w.value))}else if("single"===a&&w.value[0]!==o){var l=(r=w.value,function(e){if(Array.isArray(e))return e}(r)||function(e){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,o=[],a=!0,i=!1;try{for(t=t.call(e);!(a=(n=t.next()).done)&&(o.push(n.value),1!==o.length);a=!0);}catch(c){i=!0,r=c}finally{try{a||null==t.return||t.return()}finally{if(i)throw r}}return o}}(r)||v(r,1)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],u=o;n("update:selectedValue",u),n("selectedChange",u,l)}},L=function(e){n("nodeClick",e)},P=function(e){n("nodeMouseover",e)},E=function(e,t){if(e)c.hiddenPaths=H(H({},c.hiddenPaths),{},g({},t,1));else{var n=H({},c.hiddenPaths);delete n[t],c.hiddenPaths=n}},T=function(t,r){e.collapsedOnClickBrackets&&E(t,r.path),n("bracketsClick",t,r)},A=function(e,t){E(e,t.path),n("iconClick",e,t)},F=function(t,r){var o=V(e.data),a=e.rootPath;new Function("data","val","data".concat(r.slice(a.length),"=val"))(o,t),n("update:data",o)};return(0,m.watchEffect)(function(){N.value&&function(e){throw new Error("[VueJSONPretty] ".concat(e))}(N.value)}),(0,m.watchEffect)(function(){b.value&&(e.virtual&&e.dynamicHeight&&l.length!==b.value.length&&h(b.value.length),C())}),(0,m.watch)(function(){return[e.dynamicHeight,e.itemHeight,a.value.length]},function(){e.virtual&&e.dynamicHeight&&(h(b.value.length),(0,m.nextTick)(C))}),(0,m.watch)(function(){return e.deep},function(t){t&&(c.hiddenPaths=i(t,e.collapsedNodeLength))}),(0,m.watch)(function(){return e.collapsedNodeLength},function(t){t&&(c.hiddenPaths=i(e.deep,t))}),function(){var t,n,i,l,u,s=null!==(t=e.renderNodeKey)&&void 0!==t?t:r.renderNodeKey,h=null!==(n=e.renderNodeValue)&&void 0!==n?n:r.renderNodeValue,f=null!==(i=null!==(l=e.renderNodeActions)&&void 0!==l?l:r.renderNodeActions)&&void 0!==i&&i,p=null===(u=c.visibleData)||void 0===u?void 0:u.map(function(t,n){var r=c.startIndex+n;return(0,m.createVNode)("div",{key:t.id,ref:function(e){return t=r,void((n=e||null)?d[t]=n:delete d[t]);var t,n}},[(0,m.createVNode)(I,{data:e.data,rootPath:e.rootPath,indent:e.indent,node:t,collapsed:!!c.hiddenPaths[t.path],theme:e.theme,showDoubleQuotes:e.showDoubleQuotes,showLength:e.showLength,checked:w.value.includes(t.path),selectableType:e.selectableType,showLine:e.showLine,showLineNumber:e.showLineNumber,showSelectController:e.showSelectController,selectOnClickNode:e.selectOnClickNode,nodeSelectable:e.nodeSelectable,highlightSelectedNode:e.highlightSelectedNode,editable:e.editable,editableTrigger:e.editableTrigger,showIcon:e.showIcon,showKeyValueSpace:e.showKeyValueSpace,renderNodeKey:s,renderNodeValue:h,renderNodeActions:f,onNodeClick:L,onNodeMouseover:P,onBracketsClick:T,onIconClick:A,onSelectedChange:O,onValueChange:F,class:e.dynamicHeight?"dynamic-height":void 0,style:e.dynamicHeight?{}:e.itemHeight&&20!==e.itemHeight?{lineHeight:"".concat(e.itemHeight,"px")}:{}},null)])});return(0,m.createVNode)("div",{ref:o,class:{"vjs-tree":!0,"is-virtual":e.virtual,dark:"dark"===e.theme},onScroll:e.virtual?j:void 0,style:e.showLineNumber?H({paddingLeft:"".concat(12*Number(a.value.length.toString().length),"px")},e.style):e.style},[e.virtual?(0,m.createVNode)("div",{class:"vjs-tree-list",style:{height:"".concat(e.height,"px")}},[(0,m.createVNode)("div",{class:"vjs-tree-list-holder",style:{height:"".concat(k.value,"px")}},[(0,m.createVNode)("div",{class:"vjs-tree-list-holder-inner",style:{transform:"translateY(".concat(c.translateY,"px)")}},[p])])]):p])}}});var D=f.A;export{D as P};