import{P as ge,n as me,a as be,r as we,x as Ne,d as ke,g as Ce,j as xe,p as je,F as Oe}from"./index-BXySHhHT.js";var Se={207:(e,r,o)=>{e.exports=o(452)},452:e=>{var r=(function(o){var c,P=Object.prototype,C=P.hasOwnProperty,I=typeof Symbol=="function"?Symbol:{},p=I.iterator||"@@iterator",j=I.asyncIterator||"@@asyncIterator",N=I.toStringTag||"@@toStringTag";function S(t,n,l){return Object.defineProperty(t,n,{value:l,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{S({},"")}catch(t){S=function(n,l,h){return n[l]=h}}function B(t,n,l,h){var u=n&&n.prototype instanceof K?n:K,g=Object.create(u.prototype),w=new s(h||[]);return g._invoke=(function(x,L,d){var k=Q;return function(E,J){if(k===M)throw new Error("Generator is already running");if(k===V){if(E==="throw")throw J;return y()}for(d.method=E,d.arg=J;;){var Z=d.delegate;if(Z){var ee=q(Z,d);if(ee){if(ee===O)continue;return ee}}if(d.method==="next")d.sent=d._sent=d.arg;else if(d.method==="throw"){if(k===Q)throw k=V,d.arg;d.dispatchException(d.arg)}else d.method==="return"&&d.abrupt("return",d.arg);k=M;var W=_(x,L,d);if(W.type==="normal"){if(k=d.done?V:Y,W.arg===O)continue;return{value:W.arg,done:d.done}}W.type==="throw"&&(k=V,d.method="throw",d.arg=W.arg)}}})(t,l,w),g}function _(t,n,l){try{return{type:"normal",arg:t.call(n,l)}}catch(h){return{type:"throw",arg:h}}}o.wrap=B;var Q="suspendedStart",Y="suspendedYield",M="executing",V="completed",O={};function K(){}function R(){}function H(){}var z={};S(z,p,(function(){return this}));var b=Object.getPrototypeOf,v=b&&b(b(f([])));v&&v!==P&&C.call(v,p)&&(z=v);var m=H.prototype=K.prototype=Object.create(z);function F(t){["next","throw","return"].forEach((function(n){S(t,n,(function(l){return this._invoke(n,l)}))}))}function T(t,n){function l(u,g,w,x){var L=_(t[u],t,g);if(L.type!=="throw"){var d=L.arg,k=d.value;return k&&typeof k=="object"&&C.call(k,"__await")?n.resolve(k.__await).then((function(E){l("next",E,w,x)}),(function(E){l("throw",E,w,x)})):n.resolve(k).then((function(E){d.value=E,w(d)}),(function(E){return l("throw",E,w,x)}))}x(L.arg)}var h;this._invoke=function(u,g){function w(){return new n((function(x,L){l(u,g,x,L)}))}return h=h?h.then(w,w):w()}}function q(t,n){var l=t.iterator[n.method];if(l===c){if(n.delegate=null,n.method==="throw"){if(t.iterator.return&&(n.method="return",n.arg=c,q(t,n),n.method==="throw"))return O;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return O}var h=_(l,t.iterator,n.arg);if(h.type==="throw")return n.method="throw",n.arg=h.arg,n.delegate=null,O;var u=h.arg;return u?u.done?(n[t.resultName]=u.value,n.next=t.nextLoc,n.method!=="return"&&(n.method="next",n.arg=c),n.delegate=null,O):u:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,O)}function A(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function a(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function s(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function f(t){if(t){var n=t[p];if(n)return n.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var l=-1,h=function u(){for(;++l=0;--h){var u=this.tryEntries[h],g=u.completion;if(u.tryLoc==="root")return l("end");if(u.tryLoc<=this.prev){var w=C.call(u,"catchLoc"),x=C.call(u,"finallyLoc");if(w&&x){if(this.prev=0;--l){var h=this.tryEntries[l];if(h.tryLoc<=this.prev&&C.call(h,"finallyLoc")&&this.prev=0;--n){var l=this.tryEntries[n];if(l.finallyLoc===t)return this.complete(l.completion,l.afterLoc),a(l),O}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var l=this.tryEntries[n];if(l.tryLoc===t){var h=l.completion;if(h.type==="throw"){var u=h.arg;a(l)}return u}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,l){return this.delegate={iterator:f(t),resultName:n,nextLoc:l},this.method==="next"&&(this.arg=c),O}},o})(e.exports);try{regeneratorRuntime=r}catch(o){typeof globalThis=="object"?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},ae={};function G(e){var r=ae[e];if(r!==void 0)return r.exports;var o=ae[e]={exports:{}};return Se[e](o,o.exports,G),o.exports}G.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return G.d(r,{a:r}),r},G.d=(e,r)=>{for(var o in r)G.o(r,o)&&!G.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},G.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var fe={};function ne(e,r){(r==null||r>e.length)&&(r=e.length);for(var o=0,c=new Array(r);oAe});const i=(ie={Fragment:()=>Oe,computed:()=>je,createTextVNode:()=>xe,createVNode:()=>Ce,defineComponent:()=>ke,nextTick:()=>Ne,reactive:()=>we,ref:()=>be,watch:()=>me,watchEffect:()=>ge},te={},G.d(te,ie),te),Ve=(0,i.defineComponent)({props:{data:{required:!0,type:String},onClick:Function},render:function(){var e=this.data,r=this.onClick;return(0,i.createVNode)("span",{class:"vjs-tree-brackets",onClick:r},[e])}}),Le=(0,i.defineComponent)({emits:["change","update:modelValue"],props:{checked:{type:Boolean,default:!1},isMultiple:Boolean,onChange:Function},setup:function(e,r){var o=r.emit;return{uiType:(0,i.computed)((function(){return e.isMultiple?"checkbox":"radio"})),model:(0,i.computed)({get:function(){return e.checked},set:function(c){return o("update:modelValue",c)}})}},render:function(){var e=this.uiType,r=this.model,o=this.$emit;return(0,i.createVNode)("label",{class:["vjs-check-controller",r?"is-checked":""],onClick:function(c){return c.stopPropagation()}},[(0,i.createVNode)("span",{class:"vjs-check-controller-inner is-".concat(e)},null),(0,i.createVNode)("input",{checked:r,class:"vjs-check-controller-original is-".concat(e),type:e,onChange:function(){return o("change",r)}},null)])}}),Pe=(0,i.defineComponent)({props:{nodeType:{required:!0,type:String},onClick:Function},render:function(){var e=this.nodeType,r=this.onClick,o=e==="objectStart"||e==="arrayStart";return o||e==="objectCollapsed"||e==="arrayCollapsed"?(0,i.createVNode)("span",{class:"vjs-carets vjs-carets-".concat(o?"open":"close"),onClick:r},[(0,i.createVNode)("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},[(0,i.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 ie,te;function re(e){return re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},re(e)}function ve(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function $(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"root",o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,c=(arguments.length>3?arguments[3]:void 0)||{},P=c.key,C=c.index,I=c.type,p=I===void 0?"content":I,j=c.showComma,N=j!==void 0&&j,S=c.length,B=S===void 0?1:S,_=ve(e);if(_==="array"){var Q=le(e.map((function(V,O,K){return $(V,"".concat(r,"[").concat(O,"]"),o+1,{index:O,showComma:O!==K.length-1,length:B,type:p})})));return[$("[",r,o,{showComma:!1,key:P,length:e.length,type:"arrayStart"})[0]].concat(Q,$("]",r,o,{showComma:N,length:e.length,type:"arrayEnd"})[0])}if(_==="object"){var Y=Object.keys(e),M=le(Y.map((function(V,O,K){return $(e[V],/^[a-zA-Z_]\w*$/.test(V)?"".concat(r,".").concat(V):"".concat(r,'["').concat(V,'"]'),o+1,{key:V,showComma:O!==K.length-1,length:B,type:p})})));return[$("{",r,o,{showComma:!1,key:P,index:C,length:Y.length,type:"objectStart"})[0]].concat(M,$("}",r,o,{showComma:N,length:Y.length,type:"objectEnd"})[0])}return[{content:e,level:o,key:P,index:C,path:r,showComma:N,length:B,type:p}]}function le(e){if(typeof Array.prototype.flat=="function")return e.flat();for(var r=X(e),o=[];r.length;){var c=r.shift();Array.isArray(c)?r.unshift.apply(r,X(c)):o.push(c)}return o}function oe(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new WeakMap;if(e==null)return e;if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(re(e)!=="object")return e;if(r.get(e))return r.get(e);if(Array.isArray(e)){var o=e.map((function(C){return oe(C,r)}));return r.set(e,o),o}var c={};for(var P in e)c[P]=oe(e[P],r);return r.set(e,c),c}function ce(e,r,o,c,P,C,I){try{var p=e[C](I),j=p.value}catch(N){return void o(N)}p.done?r(j):Promise.resolve(j).then(c,P)}var Te=G(207),ue=G.n(Te);function se(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);r&&(c=c.filter((function(P){return Object.getOwnPropertyDescriptor(e,P).enumerable}))),o.push.apply(o,c)}return o}function de(e){for(var r=1;r=a||y.length>=s,l=(t=e.pathCollapsible)===null||t===void 0?void 0:t.call(e,y);return y.type!=="objectStart"&&y.type!=="arrayStart"||!n&&!l?f:D(D({},f),{},U({},y.path,1))}),{})},p=(0,i.reactive)({translateY:0,visibleData:null,hiddenPaths:I(e.deep,e.collapsedNodeLength),startIndex:0,endIndex:0}),j=[],N=[],S=0,B={},_=function(a){j=Array(a).fill(0).map((function(){return e.itemHeight||20})),(N=new Array(a+1))[0]=0;for(var s=0;ss&&(a=s);for(var f=a;f>>1;a[t]s.length?s.length-u:g;w<0&&(w=0);var x=w+u;p.translateY=w*e.itemHeight,p.startIndex=w,p.endIndex=x,p.visibleData=s.slice(w,x)}}else p.translateY=0,p.startIndex=0,p.endIndex=s.length,p.visibleData=s},H=null,z=function(){H&&cancelAnimationFrame(H),H=requestAnimationFrame((function(){R()}))},b=function(a){var s,f,y=a.path,t=e.selectableType;if(t==="multiple"){var n=V.value.findIndex((function(g){return g===y})),l=X(V.value);n!==-1?l.splice(n,1):l.push(y),o("update:selectedValue",l),o("selectedChange",l,X(V.value))}else if(t==="single"&&V.value[0]!==y){var h=(s=V.value,f=1,(function(g){if(Array.isArray(g))return g})(s)||(function(g,w){var x=g==null?null:typeof Symbol!="undefined"&&g[Symbol.iterator]||g["@@iterator"];if(x!=null){var L,d,k=[],E=!0,J=!1;try{for(x=x.call(g);!(E=(L=x.next()).done)&&(k.push(L.value),!w||k.length!==w);E=!0);}catch(Z){J=!0,d=Z}finally{try{E||x.return==null||x.return()}finally{if(J)throw d}}return k}})(s,f)||pe(s,f)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})())[0],u=y;o("update:selectedValue",u),o("selectedChange",u,h)}},v=function(a){o("nodeClick",a)},m=function(a){o("nodeMouseover",a)},F=function(a,s){if(a)p.hiddenPaths=D(D({},p.hiddenPaths),{},U({},s,1));else{var f=D({},p.hiddenPaths);delete f[s],p.hiddenPaths=f}},T=function(a,s){e.collapsedOnClickBrackets&&F(a,s.path),o("bracketsClick",a,s)},q=function(a,s){F(a,s.path),o("iconClick",a,s)},A=function(a,s){var f=oe(e.data),y=e.rootPath;new Function("data","val","data".concat(s.slice(y.length),"=val"))(f,a),o("update:data",f)};return(0,i.watchEffect)((function(){O.value&&(function(a){throw new Error("[VueJSONPretty] ".concat(a))})(O.value)})),(0,i.watchEffect)((function(){M.value&&(e.virtual&&e.dynamicHeight&&j.length!==M.value.length&&_(M.value.length),R())})),(0,i.watch)((function(){return[e.dynamicHeight,e.itemHeight,C.value.length]}),(function(){e.virtual&&e.dynamicHeight&&(_(M.value.length),(0,i.nextTick)(R))})),(0,i.watch)((function(){return e.deep}),(function(a){a&&(p.hiddenPaths=I(a,e.collapsedNodeLength))})),(0,i.watch)((function(){return e.collapsedNodeLength}),(function(a){a&&(p.hiddenPaths=I(e.deep,a))})),function(){var a,s,f,y,t,n=(a=e.renderNodeKey)!==null&&a!==void 0?a:c.renderNodeKey,l=(s=e.renderNodeValue)!==null&&s!==void 0?s:c.renderNodeValue,h=(f=(y=e.renderNodeActions)!==null&&y!==void 0?y:c.renderNodeActions)!==null&&f!==void 0&&f,u=(t=p.visibleData)===null||t===void 0?void 0:t.map((function(g,w){var x=p.startIndex+w;return(0,i.createVNode)("div",{key:g.id,ref:function(L){return(function(d,k){k?B[d]=k:delete B[d]})(x,L||null)}},[(0,i.createVNode)(Ee,{data:e.data,rootPath:e.rootPath,indent:e.indent,node:g,collapsed:!!p.hiddenPaths[g.path],theme:e.theme,showDoubleQuotes:e.showDoubleQuotes,showLength:e.showLength,checked:V.value.includes(g.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:n,renderNodeValue:l,renderNodeActions:h,onNodeClick:v,onNodeMouseover:m,onBracketsClick:T,onIconClick:q,onSelectedChange:b,onValueChange:A,class:e.dynamicHeight?"dynamic-height":void 0,style:e.dynamicHeight?{}:e.itemHeight&&e.itemHeight!==20?{lineHeight:"".concat(e.itemHeight,"px")}:{}},null)])}));return(0,i.createVNode)("div",{ref:P,class:{"vjs-tree":!0,"is-virtual":e.virtual,dark:e.theme==="dark"},onScroll:e.virtual?z:void 0,style:e.showLineNumber?D({paddingLeft:"".concat(12*Number(C.value.length.toString().length),"px")},e.style):e.style},[e.virtual?(0,i.createVNode)("div",{class:"vjs-tree-list",style:{height:"".concat(e.height,"px")}},[(0,i.createVNode)("div",{class:"vjs-tree-list-holder",style:{height:"".concat(K.value,"px")}},[(0,i.createVNode)("div",{class:"vjs-tree-list-holder-inner",style:{transform:"translateY(".concat(p.translateY,"px)")}},[u])])]):u])}}});var Ie=fe.A;export{Ie as P};