lone-format 0.6.0 → 0.6.1

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.
@@ -1,16 +1,16 @@
1
- (function(q,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(q=typeof globalThis<"u"?globalThis:q||self,o(q.LoneFormat={},q.Vue))})(this,function(q,o){"use strict";class Ie{add(e,t,s){if(typeof arguments[0]!="string")for(let n in arguments[0])this.add(n,arguments[0][n],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(n){this[n]=this[n]||[],t&&this[n][s?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(s){s.call(t&&t.context?t.context:t,t)})}}class ve{constructor(e){this.jsep=e,this.registered={}}register(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}}class u{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+u.version}static addUnaryOp(e){return u.max_unop_len=Math.max(e.length,u.max_unop_len),u.unary_ops[e]=1,u}static addBinaryOp(e,t,s){return u.max_binop_len=Math.max(e.length,u.max_binop_len),u.binary_ops[e]=t,s?u.right_associative.add(e):u.right_associative.delete(e),u}static addIdentifierChar(e){return u.additional_identifier_chars.add(e),u}static addLiteral(e,t){return u.literals[e]=t,u}static removeUnaryOp(e){return delete u.unary_ops[e],e.length===u.max_unop_len&&(u.max_unop_len=u.getMaxKeyLen(u.unary_ops)),u}static removeAllUnaryOps(){return u.unary_ops={},u.max_unop_len=0,u}static removeIdentifierChar(e){return u.additional_identifier_chars.delete(e),u}static removeBinaryOp(e){return delete u.binary_ops[e],e.length===u.max_binop_len&&(u.max_binop_len=u.getMaxKeyLen(u.binary_ops)),u.right_associative.delete(e),u}static removeAllBinaryOps(){return u.binary_ops={},u.max_binop_len=0,u}static removeLiteral(e){return delete u.literals[e],u}static removeAllLiterals(){return u.literals={},u}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new u(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(t=>t.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return u.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!u.binary_ops[String.fromCharCode(e)]||u.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return u.isIdentifierStart(e)||u.isDecimalDigit(e)}throwError(e){const t=new Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,t){if(u.hooks[e]){const s={context:this,node:t};return u.hooks.run(e,s),s.node}return t}searchHook(e){if(u.hooks[e]){const t={context:this};return u.hooks[e].find(function(s){return s.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===u.SPACE_CODE||e===u.TAB_CODE||e===u.LF_CODE||e===u.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const e=this.gobbleExpressions(),t=e.length===1?e[0]:{type:u.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t=[],s,n;for(;this.index<this.expr.length;)if(s=this.code,s===u.SEMCOL_CODE||s===u.COMMA_CODE)this.index++;else if(n=this.gobbleExpression())t.push(n);else if(this.index<this.expr.length){if(s===e)break;this.throwError('Unexpected "'+this.char+'"')}return t}gobbleExpression(){const e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let e=this.expr.substr(this.index,u.max_binop_len),t=e.length;for(;t>0;){if(u.binary_ops.hasOwnProperty(e)&&(!u.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!u.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,s,n,l,i,d,a,c;if(i=this.gobbleToken(),!i||(t=this.gobbleBinaryOp(),!t))return i;for(l={value:t,prec:u.binaryPrecedence(t),right_a:u.right_associative.has(t)},d=this.gobbleToken(),d||this.throwError("Expected expression after "+t),n=[i,l,d];t=this.gobbleBinaryOp();){if(s=u.binaryPrecedence(t),s===0){this.index-=t.length;break}l={value:t,prec:s,right_a:u.right_associative.has(t)},c=t;const p=h=>l.right_a&&h.right_a?s>h.prec:s<=h.prec;for(;n.length>2&&p(n[n.length-2]);)d=n.pop(),t=n.pop().value,i=n.pop(),e={type:u.BINARY_EXP,operator:t,left:i,right:d},n.push(e);e=this.gobbleToken(),e||this.throwError("Expected expression after "+c),n.push(l,e)}for(a=n.length-1,e=n[a];a>1;)e={type:u.BINARY_EXP,operator:n[a-1].value,left:n[a-2],right:e},a-=2;return e}gobbleToken(){let e,t,s,n;if(this.gobbleSpaces(),n=this.searchHook("gobble-token"),n)return this.runHook("after-token",n);if(e=this.code,u.isDecimalDigit(e)||e===u.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===u.SQUOTE_CODE||e===u.DQUOTE_CODE)n=this.gobbleStringLiteral();else if(e===u.OBRACK_CODE)n=this.gobbleArray();else{for(t=this.expr.substr(this.index,u.max_unop_len),s=t.length;s>0;){if(u.unary_ops.hasOwnProperty(t)&&(!u.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!u.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=s;const l=this.gobbleToken();return l||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:u.UNARY_EXP,operator:t,argument:l,prefix:!0})}t=t.substr(0,--s)}u.isIdentifierStart(e)?(n=this.gobbleIdentifier(),u.literals.hasOwnProperty(n.name)?n={type:u.LITERAL,value:u.literals[n.name],raw:n.name}:n.name===u.this_str&&(n={type:u.THIS_EXP})):e===u.OPAREN_CODE&&(n=this.gobbleGroup())}return n?(n=this.gobbleTokenProperty(n),this.runHook("after-token",n)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===u.PERIOD_CODE||t===u.OBRACK_CODE||t===u.OPAREN_CODE||t===u.QUMARK_CODE;){let s;if(t===u.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==u.PERIOD_CODE)break;s=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===u.OBRACK_CODE?(e={type:u.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()},e.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),t=this.code,t!==u.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===u.OPAREN_CODE?e={type:u.CALL_EXP,arguments:this.gobbleArguments(u.CPAREN_CODE),callee:e}:(t===u.PERIOD_CODE||s)&&(s&&this.index--,this.gobbleSpaces(),e={type:u.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),s&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e="",t,s;for(;u.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(this.code===u.PERIOD_CODE)for(e+=this.expr.charAt(this.index++);u.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(t=this.char,t==="e"||t==="E"){for(e+=this.expr.charAt(this.index++),t=this.char,(t==="+"||t==="-")&&(e+=this.expr.charAt(this.index++));u.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);u.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+e+this.char+")")}return s=this.code,u.isIdentifierStart(s)?this.throwError("Variable names cannot start with a number ("+e+this.char+")"):(s===u.PERIOD_CODE||e.length===1&&e.charCodeAt(0)===u.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:u.LITERAL,value:parseFloat(e),raw:e}}gobbleStringLiteral(){let e="";const t=this.index,s=this.expr.charAt(this.index++);let n=!1;for(;this.index<this.expr.length;){let l=this.expr.charAt(this.index++);if(l===s){n=!0;break}else if(l==="\\")switch(l=this.expr.charAt(this.index++),l){case"n":e+=`
2
- `;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=l}else e+=l}return n||this.throwError('Unclosed quote after "'+e+'"'),{type:u.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(u.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(e=this.code,u.isIdentifierPart(e));)this.index++;return{type:u.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){const t=[];let s=!1,n=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let l=this.code;if(l===e){s=!0,this.index++,e===u.CPAREN_CODE&&n&&n>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}else if(l===u.COMMA_CODE){if(this.index++,n++,n!==t.length){if(e===u.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===u.CBRACK_CODE)for(let i=t.length;i<n;i++)t.push(null)}}else if(t.length!==n&&n!==0)this.throwError("Expected comma");else{const i=this.gobbleExpression();(!i||i.type===u.COMPOUND)&&this.throwError("Expected comma"),t.push(i)}}return s||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(u.CPAREN_CODE);if(this.code===u.CPAREN_CODE)return this.index++,e.length===1?e[0]:e.length?{type:u.SEQUENCE_EXP,expressions:e}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:u.ARRAY_EXP,elements:this.gobbleArguments(u.CBRACK_CODE)}}}const Le=new Ie;Object.assign(u,{hooks:Le,plugins:new ve(u),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),u.max_unop_len=u.getMaxKeyLen(u.unary_ops),u.max_binop_len=u.getMaxKeyLen(u.binary_ops);const Q=r=>new u(r).parse(),Re=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(u).filter(r=>!Re.includes(r)&&Q[r]===void 0).forEach(r=>{Q[r]=u[r]}),Q.Jsep=u;const je="ConditionalExpression";var Me={name:"ternary",init(r){r.hooks.add("after-expression",function(t){if(t.node&&this.code===r.QUMARK_CODE){this.index++;const s=t.node,n=this.gobbleExpression();if(n||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===r.COLON_CODE){this.index++;const l=this.gobbleExpression();if(l||this.throwError("Expected expression"),t.node={type:je,test:s,consequent:n,alternate:l},s.operator&&r.binary_ops[s.operator]<=.9){let i=s;for(;i.right.operator&&r.binary_ops[i.right.operator]<=.9;)i=i.right;t.node.test=i.right,i.right=t.node,t.node=s}}else this.throwError("Expected :")}})}};Q.plugins.register(Me);const ge=47,Fe=92;var Ue={name:"regex",init(r){r.hooks.add("gobble-token",function(t){if(this.code===ge){const s=++this.index;let n=!1;for(;this.index<this.expr.length;){if(this.code===ge&&!n){const l=this.expr.slice(s,this.index);let i="";for(;++this.index<this.expr.length;){const a=this.code;if(a>=97&&a<=122||a>=65&&a<=90||a>=48&&a<=57)i+=this.char;else break}let d;try{d=new RegExp(l,i)}catch(a){this.throwError(a.message)}return t.node={type:r.LITERAL,value:d,raw:this.expr.slice(s-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===r.OBRACK_CODE?n=!0:n&&this.code===r.CBRACK_CODE&&(n=!1),this.index+=this.code===Fe?2:1}this.throwError("Unclosed Regex")}})}};const de=43,re={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[de,45],assignmentPrecedence:.9,init(r){const e=[r.IDENTIFIER,r.MEMBER_EXP];re.assignmentOperators.forEach(s=>r.addBinaryOp(s,re.assignmentPrecedence,!0)),r.hooks.add("gobble-token",function(n){const l=this.code;re.updateOperators.some(i=>i===l&&i===this.expr.charCodeAt(this.index+1))&&(this.index+=2,n.node={type:"UpdateExpression",operator:l===de?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},(!n.node.argument||!e.includes(n.node.argument.type))&&this.throwError(`Unexpected ${n.node.operator}`))}),r.hooks.add("after-token",function(n){if(n.node){const l=this.code;re.updateOperators.some(i=>i===l&&i===this.expr.charCodeAt(this.index+1))&&(e.includes(n.node.type)||this.throwError(`Unexpected ${n.node.operator}`),this.index+=2,n.node={type:"UpdateExpression",operator:l===de?"++":"--",argument:n.node,prefix:!1})}}),r.hooks.add("after-expression",function(n){n.node&&t(n.node)});function t(s){re.assignmentOperators.has(s.operator)?(s.type="AssignmentExpression",t(s.left),t(s.right)):s.operator||Object.values(s).forEach(n=>{n&&typeof n=="object"&&t(n)})}}};Q.plugins.register(Ue,re),Q.addUnaryOp("typeof"),Q.addLiteral("null",null),Q.addLiteral("undefined",void 0);const Xe=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__"]),V={evalAst(r,e){switch(r.type){case"BinaryExpression":case"LogicalExpression":return V.evalBinaryExpression(r,e);case"Compound":return V.evalCompound(r,e);case"ConditionalExpression":return V.evalConditionalExpression(r,e);case"Identifier":return V.evalIdentifier(r,e);case"Literal":return V.evalLiteral(r,e);case"MemberExpression":return V.evalMemberExpression(r,e);case"UnaryExpression":return V.evalUnaryExpression(r,e);case"ArrayExpression":return V.evalArrayExpression(r,e);case"CallExpression":return V.evalCallExpression(r,e);case"AssignmentExpression":return V.evalAssignmentExpression(r,e);default:throw SyntaxError("Unexpected expression",r)}},evalBinaryExpression(r,e){return{"||":(s,n)=>s||n(),"&&":(s,n)=>s&&n(),"|":(s,n)=>s|n(),"^":(s,n)=>s^n(),"&":(s,n)=>s&n(),"==":(s,n)=>s==n(),"!=":(s,n)=>s!=n(),"===":(s,n)=>s===n(),"!==":(s,n)=>s!==n(),"<":(s,n)=>s<n(),">":(s,n)=>s>n(),"<=":(s,n)=>s<=n(),">=":(s,n)=>s>=n(),"<<":(s,n)=>s<<n(),">>":(s,n)=>s>>n(),">>>":(s,n)=>s>>>n(),"+":(s,n)=>s+n(),"-":(s,n)=>s-n(),"*":(s,n)=>s*n(),"/":(s,n)=>s/n(),"%":(s,n)=>s%n()}[r.operator](V.evalAst(r.left,e),()=>V.evalAst(r.right,e))},evalCompound(r,e){let t;for(let s=0;s<r.body.length;s++){r.body[s].type==="Identifier"&&["var","let","const"].includes(r.body[s].name)&&r.body[s+1]&&r.body[s+1].type==="AssignmentExpression"&&(s+=1);const n=r.body[s];t=V.evalAst(n,e)}return t},evalConditionalExpression(r,e){return V.evalAst(r.test,e)?V.evalAst(r.consequent,e):V.evalAst(r.alternate,e)},evalIdentifier(r,e){if(Object.hasOwn(e,r.name))return e[r.name];throw ReferenceError(`${r.name} is not defined`)},evalLiteral(r){return r.value},evalMemberExpression(r,e){const t=String(r.computed?V.evalAst(r.property):r.property.name),s=V.evalAst(r.object,e);if(s==null)throw TypeError(`Cannot read properties of ${s} (reading '${t}')`);if(!Object.hasOwn(s,t)&&Xe.has(t))throw TypeError(`Cannot read properties of ${s} (reading '${t}')`);const n=s[t];return typeof n=="function"?n.bind(s):n},evalUnaryExpression(r,e){return{"-":s=>-V.evalAst(s,e),"!":s=>!V.evalAst(s,e),"~":s=>~V.evalAst(s,e),"+":s=>+V.evalAst(s,e),typeof:s=>typeof V.evalAst(s,e)}[r.operator](r.argument)},evalArrayExpression(r,e){return r.elements.map(t=>V.evalAst(t,e))},evalCallExpression(r,e){const t=r.arguments.map(n=>V.evalAst(n,e));return V.evalAst(r.callee,e)(...t)},evalAssignmentExpression(r,e){if(r.left.type!=="Identifier")throw SyntaxError("Invalid left-hand side in assignment");const t=r.left.name,s=V.evalAst(r.right,e);return e[t]=s,e[t]}};class ze{constructor(e){this.code=e,this.ast=Q(this.code)}runInNewContext(e){const t=Object.assign(Object.create(null),e);return V.evalAst(this.ast,t)}}function Y(r,e){return r=r.slice(),r.push(e),r}function ue(r,e){return e=e.slice(),e.unshift(r),e}class He extends Error{constructor(e){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=e,this.name="NewError"}}function P(r,e,t,s,n){if(!(this instanceof P))try{return new P(r,e,t,s,n)}catch(i){if(!i.avoidNew)throw i;return i.value}typeof r=="string"&&(n=s,s=t,t=e,e=r,r=null);const l=r&&typeof r=="object";if(r=r||{},this.json=r.json||t,this.path=r.path||e,this.resultType=r.resultType||"value",this.flatten=r.flatten||!1,this.wrap=Object.hasOwn(r,"wrap")?r.wrap:!0,this.sandbox=r.sandbox||{},this.eval=r.eval===void 0?"safe":r.eval,this.ignoreEvalErrors=typeof r.ignoreEvalErrors>"u"?!1:r.ignoreEvalErrors,this.parent=r.parent||null,this.parentProperty=r.parentProperty||null,this.callback=r.callback||s||null,this.otherTypeCallback=r.otherTypeCallback||n||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},r.autostart!==!1){const i={path:l?r.path:e};l?"json"in r&&(i.json=r.json):i.json=t;const d=this.evaluate(i);if(!d||typeof d!="object")throw new He(d);return d}}P.prototype.evaluate=function(r,e,t,s){let n=this.parent,l=this.parentProperty,{flatten:i,wrap:d}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,t=t||this.callback,this.currOtherTypeCallback=s||this.otherTypeCallback,e=e||this.json,r=r||this.path,r&&typeof r=="object"&&!Array.isArray(r)){if(!r.path&&r.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(r,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:e}=r),i=Object.hasOwn(r,"flatten")?r.flatten:i,this.currResultType=Object.hasOwn(r,"resultType")?r.resultType:this.currResultType,this.currSandbox=Object.hasOwn(r,"sandbox")?r.sandbox:this.currSandbox,d=Object.hasOwn(r,"wrap")?r.wrap:d,this.currEval=Object.hasOwn(r,"eval")?r.eval:this.currEval,t=Object.hasOwn(r,"callback")?r.callback:t,this.currOtherTypeCallback=Object.hasOwn(r,"otherTypeCallback")?r.otherTypeCallback:this.currOtherTypeCallback,n=Object.hasOwn(r,"parent")?r.parent:n,l=Object.hasOwn(r,"parentProperty")?r.parentProperty:l,r=r.path}if(n=n||null,l=l||null,Array.isArray(r)&&(r=P.toPathString(r)),!r&&r!==""||!e)return;const a=P.toPathArray(r);a[0]==="$"&&a.length>1&&a.shift(),this._hasParentSelector=null;const c=this._trace(a,e,["$"],n,l,t).filter(function(p){return p&&!p.isParentSelector});return c.length?!d&&c.length===1&&!c[0].hasArrExpr?this._getPreferredOutput(c[0]):c.reduce((p,h)=>{const k=this._getPreferredOutput(h);return i&&Array.isArray(k)?p=p.concat(k):p.push(k),p},[]):d?[]:void 0},P.prototype._getPreferredOutput=function(r){const e=this.currResultType;switch(e){case"all":{const t=Array.isArray(r.path)?r.path:P.toPathArray(r.path);return r.pointer=P.toPointer(t),r.path=typeof r.path=="string"?r.path:P.toPathString(r.path),r}case"value":case"parent":case"parentProperty":return r[e];case"path":return P.toPathString(r[e]);case"pointer":return P.toPointer(r.path);default:throw new TypeError("Unknown result type")}},P.prototype._handleCallback=function(r,e,t){if(e){const s=this._getPreferredOutput(r);r.path=typeof r.path=="string"?r.path:P.toPathString(r.path),e(s,t,r)}},P.prototype._trace=function(r,e,t,s,n,l,i,d){let a;if(!r.length)return a={path:t,value:e,parent:s,parentProperty:n,hasArrExpr:i},this._handleCallback(a,l,"value"),a;const c=r[0],p=r.slice(1),h=[];function k(_){Array.isArray(_)?_.forEach(N=>{h.push(N)}):h.push(_)}if((typeof c!="string"||d)&&e&&Object.hasOwn(e,c))k(this._trace(p,e[c],Y(t,c),e,c,l,i));else if(c==="*")this._walk(e,_=>{k(this._trace(p,e[_],Y(t,_),e,_,l,!0,!0))});else if(c==="..")k(this._trace(p,e,t,s,n,l,i)),this._walk(e,_=>{typeof e[_]=="object"&&k(this._trace(r.slice(),e[_],Y(t,_),e,_,l,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:t.slice(0,-1),expr:p,isParentSelector:!0};if(c==="~")return a={path:Y(t,c),value:n,parent:s,parentProperty:null},this._handleCallback(a,l,"property"),a;if(c==="$")k(this._trace(p,e,t,null,null,l,i));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(c))k(this._slice(c,p,e,t,s,n,l));else if(c.indexOf("?(")===0){if(this.currEval===!1)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");const _=c.replace(/^\?\((.*?)\)$/u,"$1"),N=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(_);N?this._walk(e,C=>{const x=[N[2]],O=N[1]?e[C][N[1]]:e[C];this._trace(x,O,t,s,n,l,!0).length>0&&k(this._trace(p,e[C],Y(t,C),e,C,l,!0))}):this._walk(e,C=>{this._eval(_,e[C],C,t,s,n)&&k(this._trace(p,e[C],Y(t,C),e,C,l,!0))})}else if(c[0]==="("){if(this.currEval===!1)throw new Error("Eval [(expr)] prevented in JSONPath expression.");k(this._trace(ue(this._eval(c,e,t.at(-1),t.slice(0,-1),s,n),p),e,t,s,n,l,i))}else if(c[0]==="@"){let _=!1;const N=c.slice(1,-2);switch(N){case"scalar":(!e||!["object","function"].includes(typeof e))&&(_=!0);break;case"boolean":case"string":case"undefined":case"function":typeof e===N&&(_=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(_=!0);break;case"number":Number.isFinite(e)&&(_=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(_=!0);break;case"object":e&&typeof e===N&&(_=!0);break;case"array":Array.isArray(e)&&(_=!0);break;case"other":_=this.currOtherTypeCallback(e,t,s,n);break;case"null":e===null&&(_=!0);break;default:throw new TypeError("Unknown value type "+N)}if(_)return a={path:t,value:e,parent:s,parentProperty:n},this._handleCallback(a,l,"value"),a}else if(c[0]==="`"&&e&&Object.hasOwn(e,c.slice(1))){const _=c.slice(1);k(this._trace(p,e[_],Y(t,_),e,_,l,i,!0))}else if(c.includes(",")){const _=c.split(",");for(const N of _)k(this._trace(ue(N,p),e,t,s,n,l,!0))}else!d&&e&&Object.hasOwn(e,c)&&k(this._trace(p,e[c],Y(t,c),e,c,l,i,!0))}if(this._hasParentSelector)for(let _=0;_<h.length;_++){const N=h[_];if(N&&N.isParentSelector){const C=this._trace(N.expr,e,N.path,s,n,l,i);if(Array.isArray(C)){h[_]=C[0];const x=C.length;for(let O=1;O<x;O++)_++,h.splice(_,0,C[O])}else h[_]=C}}return h},P.prototype._walk=function(r,e){if(Array.isArray(r)){const t=r.length;for(let s=0;s<t;s++)e(s)}else r&&typeof r=="object"&&Object.keys(r).forEach(t=>{e(t)})},P.prototype._slice=function(r,e,t,s,n,l,i){if(!Array.isArray(t))return;const d=t.length,a=r.split(":"),c=a[2]&&Number.parseInt(a[2])||1;let p=a[0]&&Number.parseInt(a[0])||0,h=a[1]&&Number.parseInt(a[1])||d;p=p<0?Math.max(0,p+d):Math.min(d,p),h=h<0?Math.max(0,h+d):Math.min(d,h);const k=[];for(let _=p;_<h;_+=c)this._trace(ue(_,e),t,s,n,l,i,!0).forEach(C=>{k.push(C)});return k},P.prototype._eval=function(r,e,t,s,n,l){this.currSandbox._$_parentProperty=l,this.currSandbox._$_parent=n,this.currSandbox._$_property=t,this.currSandbox._$_root=this.json,this.currSandbox._$_v=e;const i=r.includes("@path");i&&(this.currSandbox._$_path=P.toPathString(s.concat([t])));const d=this.currEval+"Script:"+r;if(!P.cache[d]){let a=r.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");if(i&&(a=a.replaceAll("@path","_$_path")),this.currEval==="safe"||this.currEval===!0||this.currEval===void 0)P.cache[d]=new this.safeVm.Script(a);else if(this.currEval==="native")P.cache[d]=new this.vm.Script(a);else if(typeof this.currEval=="function"&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){const c=this.currEval;P.cache[d]=new c(a)}else if(typeof this.currEval=="function")P.cache[d]={runInNewContext:c=>this.currEval(a,c)};else throw new TypeError(`Unknown "eval" property "${this.currEval}"`)}try{return P.cache[d].runInNewContext(this.currSandbox)}catch(a){if(this.ignoreEvalErrors)return!1;throw new Error("jsonPath: "+a.message+": "+r)}},P.cache={},P.toPathString=function(r){const e=r,t=e.length;let s="$";for(let n=1;n<t;n++)/^(~|\^|@.*?\(\))$/u.test(e[n])||(s+=/^[0-9*]+$/u.test(e[n])?"["+e[n]+"]":"['"+e[n]+"']");return s},P.toPointer=function(r){const e=r,t=e.length;let s="";for(let n=1;n<t;n++)/^(~|\^|@.*?\(\))$/u.test(e[n])||(s+="/"+e[n].toString().replaceAll("~","~0").replaceAll("/","~1"));return s},P.toPathArray=function(r){const{cache:e}=P;if(e[r])return e[r].concat();const t=[],n=r.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu,function(l,i){return"[#"+(t.push(i)-1)+"]"}).replaceAll(/\[['"]([^'\]]*)['"]\]/gu,function(l,i){return"['"+i.replaceAll(".","%@%").replaceAll("~","%%@@%%")+"']"}).replaceAll("~",";~;").replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,";").replaceAll("%@%",".").replaceAll("%%@@%%","~").replaceAll(/(?:;)?(\^+)(?:;)?/gu,function(l,i){return";"+i.split("").join(";")+";"}).replaceAll(/;;;|;;/gu,";..;").replaceAll(/;$|'?\]|'$/gu,"").split(";").map(function(l){const i=l.match(/#(\d+)/u);return!i||!i[1]?l:t[i[1]]});return e[r]=n,e[r].concat()},P.prototype.safeVm={Script:ze};const Ke=function(r,e,t){const s=r.length;for(let n=0;n<s;n++){const l=r[n];t(l)&&e.push(r.splice(n--,1)[0])}};class qe{constructor(e){this.code=e}runInNewContext(e){let t=this.code;const s=Object.keys(e),n=[];Ke(s,n,c=>typeof e[c]=="function");const l=s.map(c=>e[c]);t=n.reduce((c,p)=>{let h=e[p].toString();return/function/u.test(h)||(h="function "+h),"var "+p+"="+h+";"+c},"")+t,!/(['"])use strict\1/u.test(t)&&!s.includes("arguments")&&(t="var arguments = undefined;"+t),t=t.replace(/;\s*$/u,"");const d=t.lastIndexOf(";"),a=d!==-1?t.slice(0,d+1)+" return "+t.slice(d+1):" return "+t;return new Function(...s,a)(...l)}}P.prototype.vm={Script:qe};const Qe={class:"json-node"},We={key:0,class:"json-node__container"},Ye={class:"json-node__line"},Ge=["contenteditable","onKeydown"],Ze={key:1,class:"json-node__colon"},De=["title"],Je=["title"],et={key:4,class:"json-node__comma"},tt={key:0,class:"json-node__children"},rt={class:"json-node__children-content"},nt={class:"json-node__line json-node__closing-bracket"},ot={class:"json-node__bracket"},st={key:0,class:"json-node__comma"},lt={key:1,class:"json-node__primitive"},it=["contenteditable","onKeydown"],at={key:1,class:"json-node__colon"},ct=["title"],dt=["contenteditable","onKeydown"],ut={key:0,class:"json-node__comma"},ft=o.defineComponent({name:"JsonNode",__name:"JsonNode",props:{value:{},keyName:{},level:{},path:{default:""},expanded:{},isLast:{type:Boolean,default:!1},theme:{}},emits:["update:value","toggle-expand","copy","update:key"],setup(r,{emit:e}){o.useCssVars(f=>({"2a18b018":f.level,"58a14b93":f.theme.colors.syntaxKey,"46fe1b3e":f.theme.colors.hoverBackground,fbe2c048:f.theme.colors.syntaxBracket,"4bd524bb":f.theme.colors.collapsedText,"3308d23c":f.theme.colors.collapsedBackground,"36380c60":f.theme.colors.collapsedBackgroundHover,"0892365d":f.theme.colors.syntaxString,"0015b195":f.theme.colors.syntaxNumber,"7db95f5c":f.theme.colors.syntaxBoolean,"88ec825a":f.theme.colors.syntaxNull,"537157f7":f.theme.colors.background,"3cee3331":f.theme.colors.selectionBackground,"81323cee":f.theme.colors.indentLine}));const t=r,s=e,n=o.ref(!1),l=o.ref(!1),i=o.ref(""),d=o.ref(""),a=o.ref("string"),c=o.ref(null),p=o.ref(null),h=f=>f!==null&&typeof f=="object"&&!Array.isArray(f)&&"__protected_number__"in f&&Object.keys(f).length===1,k=f=>h(f)?f.__protected_number__:"",_=o.computed(()=>h(t.value)?!1:t.value!==null&&typeof t.value=="object"),N=o.computed(()=>Array.isArray(t.value)),C=o.computed(()=>t.path?t.path:t.keyName?t.keyName:"root"),x=o.computed(()=>t.expanded.has(C.value)),O=o.computed(()=>t.keyName),R=o.computed(()=>N.value?"[":"{"),z=o.computed(()=>N.value?"]":"}"),m=o.computed(()=>{if(!t.value)return"";const y=Object.keys(t.value).length;return N.value?y>0?` ${y} items `:" ":y>0?` ${y} keys `:" "}),g=o.computed(()=>{const f=typeof t.value;return t.value===null?"json-node__value--null":f==="boolean"?"json-node__value--boolean":f==="number"||h(t.value)?"json-node__value--number":f==="string"?"json-node__value--string":""}),A=o.computed(()=>t.value===null?"null":typeof t.value=="boolean"||typeof t.value=="number"?String(t.value):h(t.value)?k(t.value):typeof t.value=="string"?`"${t.value}"`:String(t.value)),T=o.computed(()=>"Double-click to edit"),$=f=>t.level===0?f:C.value?`${C.value}.${f}`:f,j=f=>{const y=Object.keys(t.value);return y.indexOf(f)===y.length-1},X=()=>{s("toggle-expand",C.value)},F=()=>{t.level!==0&&(n.value=!0,i.value=t.keyName,o.nextTick(()=>{if(c.value){c.value.focus();const f=document.createRange();f.selectNodeContents(c.value);const y=window.getSelection();y?.removeAllRanges(),y?.addRange(f)}}))},ee=()=>{_.value||(l.value=!0,t.value===null?a.value="null":h(t.value)?a.value="protected-number":typeof t.value=="string"?a.value="string":typeof t.value=="number"?a.value="number":typeof t.value=="boolean"&&(a.value="boolean"),h(t.value)?d.value=k(t.value):typeof t.value=="string"?d.value=t.value:d.value=String(t.value),o.nextTick(()=>{if(p.value){p.value.focus();const f=document.createRange();f.selectNodeContents(p.value);const y=window.getSelection();y?.removeAllRanges(),y?.addRange(f)}}))},W=()=>{if(t.level===0||!n.value)return;const f=c.value?.innerText.trim()||"";if(!f){b();return}if(f===t.keyName){n.value=!1;return}n.value=!1,s("update:key",C.value,f)},te=()=>{if(l.value)try{let f;const y=p.value?.innerText.trim()||"";if(a.value==="string")y==="null"?f=null:y==="true"||y==="false"?f=y==="true":f=y;else if(a.value==="protected-number")f={__protected_number__:y};else if(y==="null")f=null;else if(y==="true"||y==="false")f=y==="true";else if(!isNaN(Number(y))&&y!==""){const w=Number(y);!Number.isSafeInteger(w)||y.length>15?f={__protected_number__:y}:f=w}else f=y;s("update:value",C.value,f),l.value=!1}catch(f){console.error("Failed to parse value:",f),l.value=!1}},b=()=>{n.value=!1,i.value=t.keyName},E=()=>{l.value=!1,h(t.value)?d.value=k(t.value):typeof t.value=="string"?d.value=t.value:d.value=String(t.value)};return(f,y)=>{const w=o.resolveComponent("JsonNode",!0);return o.openBlock(),o.createElementBlock("div",Qe,[_.value?(o.openBlock(),o.createElementBlock("div",We,[o.createElementVNode("div",Ye,[f.keyName?(o.openBlock(),o.createElementBlock("span",{key:0,class:"json-node__key",contenteditable:n.value,onDblclick:F,onKeydown:[o.withKeys(o.withModifiers(W,["prevent"]),["enter"]),o.withKeys(b,["escape"])],onBlur:W,ref_key:"keyRef",ref:c,title:"Double-click to edit key"},o.toDisplayString(n.value?i.value:`"${O.value}"`),41,Ge)):o.createCommentVNode("",!0),f.keyName?(o.openBlock(),o.createElementBlock("span",Ze,": ")):o.createCommentVNode("",!0),o.createElementVNode("span",{class:"json-node__bracket json-node__bracket--clickable",onClick:X,title:x.value?"Click to collapse":"Click to expand"},o.toDisplayString(R.value),9,De),x.value?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",{key:2,class:"json-node__collapsed-info",onClick:X,title:`Click to expand ${m.value.trim()}`},o.toDisplayString(m.value),9,Je)),x.value?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",{key:3,class:"json-node__bracket json-node__bracket--clickable",onClick:X,title:"Click to expand"},o.toDisplayString(z.value),1)),!x.value&&!f.isLast?(o.openBlock(),o.createElementBlock("span",et,",")):o.createCommentVNode("",!0)]),x.value?(o.openBlock(),o.createElementBlock("div",tt,[o.createElementVNode("div",rt,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(f.value,(B,S)=>(o.openBlock(),o.createElementBlock("div",{key:S,class:"json-node__child"},[o.createVNode(w,{value:B,"key-name":N.value?"":String(S),level:f.level+1,path:$(String(S)),expanded:f.expanded,theme:f.theme,"onUpdate:value":y[0]||(y[0]=(I,L)=>f.$emit("update:value",I,L)),onToggleExpand:y[1]||(y[1]=I=>f.$emit("toggle-expand",I)),onCopy:y[2]||(y[2]=I=>f.$emit("copy",I)),"onUpdate:key":y[3]||(y[3]=(I,L)=>f.$emit("update:key",I,L)),"is-last":j(String(S))},null,8,["value","key-name","level","path","expanded","theme","is-last"])]))),128))]),o.createElementVNode("div",nt,[o.createElementVNode("span",ot,o.toDisplayString(z.value),1),f.isLast?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",st,","))])])):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock("div",lt,[f.keyName?(o.openBlock(),o.createElementBlock("span",{key:0,class:"json-node__key",contenteditable:n.value,onDblclick:F,onKeydown:[o.withKeys(o.withModifiers(W,["prevent"]),["enter"]),o.withKeys(b,["escape"])],onBlur:W,ref_key:"keyRef",ref:c,title:"Double-click to edit key"},o.toDisplayString(n.value?i.value:`"${O.value}"`),41,it)):o.createCommentVNode("",!0),f.keyName?(o.openBlock(),o.createElementBlock("span",at,": ")):o.createCommentVNode("",!0),o.createElementVNode("span",{class:o.normalizeClass(["json-node__value-wrapper",g.value]),onDblclick:ee,title:T.value},[o.createElementVNode("span",{class:"json-node__value",contenteditable:l.value,onKeydown:[o.withKeys(o.withModifiers(te,["prevent"]),["enter"]),o.withKeys(E,["escape"])],onBlur:te,ref_key:"valueRef",ref:p},o.toDisplayString(l.value?d.value:A.value),41,dt),f.isLast?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",ut,","))],42,ct)]))])}}}),le=(r,e)=>{const t=r.__vccOpts||r;for(const[s,n]of e)t[s]=n;return t},ht=le(ft,[["__scopeId","data-v-1472a8af"]]),ye={name:"github-light",colors:{background:"#ffffff",surfaceBackground:"#f6f8fa",border:"#d0d7de",text:"#24292f",textSecondary:"#656d76",buttonBackground:"#f6f8fa",buttonBackgroundHover:"#f3f4f6",buttonBorder:"#d0d7de",buttonText:"#24292f",buttonPrimary:"#2da44e",buttonPrimaryHover:"#2c974b",success:"#1a7f37",successBackground:"#dafbe1",error:"#cf222e",errorBackground:"#ffebe9",syntaxString:"#0a3069",syntaxNumber:"#0969da",syntaxBoolean:"#8250df",syntaxNull:"#656d76",syntaxKey:"#0969da",syntaxBracket:"#24292f",hoverBackground:"#f6f8fa",selectionBackground:"rgba(9, 105, 218, 0.2)",collapsedBackground:"#ddf4ff",collapsedBackgroundHover:"#b6e3ff",collapsedText:"#0969da",indentLine:"#d0d7de"}},pt={"github-light":ye,"github-dark":{name:"github-dark",colors:{background:"#0d1117",surfaceBackground:"#161b22",border:"#30363d",text:"#e6edf3",textSecondary:"#7d8590",buttonBackground:"#21262d",buttonBackgroundHover:"#30363d",buttonBorder:"#30363d",buttonText:"#e6edf3",buttonPrimary:"#238636",buttonPrimaryHover:"#2ea043",success:"#3fb950",successBackground:"#0f2419",error:"#f85149",errorBackground:"#381921",syntaxString:"#a5d6ff",syntaxNumber:"#79c0ff",syntaxBoolean:"#d2a8ff",syntaxNull:"#7d8590",syntaxKey:"#79c0ff",syntaxBracket:"#e6edf3",hoverBackground:"#161b22",selectionBackground:"rgba(121, 192, 255, 0.2)",collapsedBackground:"#1c2128",collapsedBackgroundHover:"#2d333b",collapsedText:"#79c0ff",indentLine:"#30363d"}},"min-light":{name:"min-light",colors:{background:"#ffffff",surfaceBackground:"#fafafa",border:"#e5e5e5",text:"#333333",textSecondary:"#888888",buttonBackground:"#f8f8f8",buttonBackgroundHover:"#eeeeee",buttonBorder:"#e0e0e0",buttonText:"#333333",buttonPrimary:"#007acc",buttonPrimaryHover:"#005a9e",success:"#22c55e",successBackground:"#f0fdf4",error:"#ef4444",errorBackground:"#fef2f2",syntaxString:"#22c55e",syntaxNumber:"#3b82f6",syntaxBoolean:"#8b5cf6",syntaxNull:"#6b7280",syntaxKey:"#1f2937",syntaxBracket:"#374151",hoverBackground:"#f9f9f9",selectionBackground:"rgba(59, 130, 246, 0.2)",collapsedBackground:"#e0f2fe",collapsedBackgroundHover:"#bae6fd",collapsedText:"#0284c7",indentLine:"#e5e7eb"}},"slack-ochin":{name:"slack-ochin",colors:{background:"#fefbf6",surfaceBackground:"#faf6f0",border:"#e8d5b7",text:"#4a3b2a",textSecondary:"#8b7355",buttonBackground:"#f4ede4",buttonBackgroundHover:"#efe5d8",buttonBorder:"#e8d5b7",buttonText:"#4a3b2a",buttonPrimary:"#ff6b35",buttonPrimaryHover:"#e55a2b",success:"#ff9500",successBackground:"#fff8f0",error:"#d73502",errorBackground:"#ffeee8",syntaxString:"#d73502",syntaxNumber:"#ff6b35",syntaxBoolean:"#b7472a",syntaxNull:"#8b7355",syntaxKey:"#4a3b2a",syntaxBracket:"#6b5444",hoverBackground:"#f8f2eb",selectionBackground:"rgba(255, 107, 53, 0.2)",collapsedBackground:"#ffe8d6",collapsedBackgroundHover:"#ffd4b0",collapsedText:"#d73502",indentLine:"#e8d5b7"}}};function mt(r="github-light"){return pt[r]||ye}const gt={key:0,class:"json-format__toolbar"},yt={class:"json-format__actions"},bt=["disabled"],Et=["disabled"],_t=["disabled"],kt=["disabled"],xt={class:"json-format__info"},Nt={key:0,class:"json-format__status json-format__status--success"},At={key:1,class:"json-format__status json-format__status--error"},Ct={class:"json-format__content"},wt={key:0,class:"json-format__error"},Bt={key:1,class:"json-format__error"},Tt={key:2,class:"json-format__viewer"},be=le(o.defineComponent({name:"JsonFormat",__name:"index",props:{modelValue:{default:""},readonly:{type:Boolean,default:!1},maxDepth:{default:10},showToolbar:{type:Boolean,default:!0},theme:{default:"github-light"}},emits:["update:modelValue","copy-success","copy-error","expand-all","collapse-all","compress"],setup(r,{expose:e,emit:t}){o.useCssVars(b=>({"325d5f6b":h.value.colors.border,"407388ed":h.value.colors.background,"1276f42c":h.value.colors.text,"34805dc8":h.value.colors.surfaceBackground,"212f19fd":h.value.colors.buttonBorder,b83cab02:h.value.colors.buttonBackground,b58ba984:h.value.colors.buttonText,d50a3406:h.value.colors.buttonBackgroundHover,"2421bb5e":h.value.colors.buttonPrimary,"0299816b":h.value.colors.buttonPrimaryHover,"55f370f2":h.value.colors.successBackground,b3fc86b8:h.value.colors.success,"781064f7":h.value.colors.errorBackground,"3b9a02e9":h.value.colors.error}));const s=r,n=t,l=o.ref(null),i=o.ref(""),d=o.ref(new Set),a=o.ref(null),c=o.ref(""),p=o.computed(()=>i.value===""),h=o.computed(()=>mt(s.theme)),k=o.computed(()=>c.value?null:a.value!==null?a.value:l.value),_=b=>{if(!b.trim()){l.value=null,i.value="",a.value=null,c.value="";return}try{let E=b;const f=/(:\s*|,\s*|\[\s*)-?\d{16,}/.test(E),y=/(:\s*|,\s*|\[\s*)-?\d+\.\d*0+\s*[,}\]\s]*/.test(E);if(!f&&!y)try{l.value=JSON.parse(E),i.value="",a.value=null,c.value="",o.nextTick(()=>{k.value!==null&&m()});return}catch{}E=(B=>{let S="",I=!1,L=!1,K=0;for(;K<B.length;){const ne=B[K];if(I)L?L=!1:ne==="\\"?L=!0:ne==='"'&&(I=!1),S+=ne,K++;else if(ne==='"')I=!0,S+=ne,K++;else{const Ve=B.slice(K);let H=Ve.match(/^([:,\[\s]*)(-?\d{16,})(\s*[,\}\]\s]|$)/);if(H){S+=H[1]+'{"__protected_number__":"'+H[2]+'"}'+H[3],K+=H[0].length;continue}if(H=Ve.match(/^([:,\[\s]*)(-?\d+\.\d*0+)(\s*[,\}\]\s]|$)/),H){S+=H[1]+'{"__protected_number__":"'+H[2]+'"}'+H[3],K+=H[0].length;continue}S+=ne,K++}}return S})(E),l.value=JSON.parse(E),i.value="",a.value=null,c.value="",o.nextTick(()=>{k.value!==null&&m()})}catch(E){i.value=E instanceof Error?E.message:"Unknown parsing error",l.value=null,a.value=null,c.value=""}},N=b=>{if(!b||!b.expression.trim()){C();return}if(!l.value){c.value="No valid JSON data to filter";return}try{let E;if(b.type==="jsonpath")E=P({path:b.expression,json:l.value}),E.length===1&&b.expression.includes("$[")===!1&&!b.expression.endsWith("[*]")?a.value=E[0]:a.value=E;else if(b.type==="js")E=new Function("data",`
1
+ (function(te,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(te=typeof globalThis<"u"?globalThis:te||self,r(te.LoneFormat={},te.Vue))})(this,function(te,r){"use strict";class Xe{add(e,t,s){if(typeof arguments[0]!="string")for(let o in arguments[0])this.add(o,arguments[0][o],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(o){this[o]=this[o]||[],t&&this[o][s?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(s){s.call(t&&t.context?t.context:t,t)})}}class ze{constructor(e){this.jsep=e,this.registered={}}register(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];t.forEach(o=>{if(typeof o!="object"||!o.name||!o.init)throw new Error("Invalid JSEP plugin format");this.registered[o.name]||(o.init(this.jsep),this.registered[o.name]=o)})}}class f{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+f.version}static addUnaryOp(e){return f.max_unop_len=Math.max(e.length,f.max_unop_len),f.unary_ops[e]=1,f}static addBinaryOp(e,t,s){return f.max_binop_len=Math.max(e.length,f.max_binop_len),f.binary_ops[e]=t,s?f.right_associative.add(e):f.right_associative.delete(e),f}static addIdentifierChar(e){return f.additional_identifier_chars.add(e),f}static addLiteral(e,t){return f.literals[e]=t,f}static removeUnaryOp(e){return delete f.unary_ops[e],e.length===f.max_unop_len&&(f.max_unop_len=f.getMaxKeyLen(f.unary_ops)),f}static removeAllUnaryOps(){return f.unary_ops={},f.max_unop_len=0,f}static removeIdentifierChar(e){return f.additional_identifier_chars.delete(e),f}static removeBinaryOp(e){return delete f.binary_ops[e],e.length===f.max_binop_len&&(f.max_binop_len=f.getMaxKeyLen(f.binary_ops)),f.right_associative.delete(e),f}static removeAllBinaryOps(){return f.binary_ops={},f.max_binop_len=0,f}static removeLiteral(e){return delete f.literals[e],f}static removeAllLiterals(){return f.literals={},f}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new f(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(t=>t.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return f.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!f.binary_ops[String.fromCharCode(e)]||f.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return f.isIdentifierStart(e)||f.isDecimalDigit(e)}throwError(e){const t=new Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,t){if(f.hooks[e]){const s={context:this,node:t};return f.hooks.run(e,s),s.node}return t}searchHook(e){if(f.hooks[e]){const t={context:this};return f.hooks[e].find(function(s){return s.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===f.SPACE_CODE||e===f.TAB_CODE||e===f.LF_CODE||e===f.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const e=this.gobbleExpressions(),t=e.length===1?e[0]:{type:f.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t=[],s,o;for(;this.index<this.expr.length;)if(s=this.code,s===f.SEMCOL_CODE||s===f.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())t.push(o);else if(this.index<this.expr.length){if(s===e)break;this.throwError('Unexpected "'+this.char+'"')}return t}gobbleExpression(){const e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let e=this.expr.substr(this.index,f.max_binop_len),t=e.length;for(;t>0;){if(f.binary_ops.hasOwnProperty(e)&&(!f.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!f.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,s,o,l,i,d,a,c;if(i=this.gobbleToken(),!i||(t=this.gobbleBinaryOp(),!t))return i;for(l={value:t,prec:f.binaryPrecedence(t),right_a:f.right_associative.has(t)},d=this.gobbleToken(),d||this.throwError("Expected expression after "+t),o=[i,l,d];t=this.gobbleBinaryOp();){if(s=f.binaryPrecedence(t),s===0){this.index-=t.length;break}l={value:t,prec:s,right_a:f.right_associative.has(t)},c=t;const g=p=>l.right_a&&p.right_a?s>p.prec:s<=p.prec;for(;o.length>2&&g(o[o.length-2]);)d=o.pop(),t=o.pop().value,i=o.pop(),e={type:f.BINARY_EXP,operator:t,left:i,right:d},o.push(e);e=this.gobbleToken(),e||this.throwError("Expected expression after "+c),o.push(l,e)}for(a=o.length-1,e=o[a];a>1;)e={type:f.BINARY_EXP,operator:o[a-1].value,left:o[a-2],right:e},a-=2;return e}gobbleToken(){let e,t,s,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(e=this.code,f.isDecimalDigit(e)||e===f.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===f.SQUOTE_CODE||e===f.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(e===f.OBRACK_CODE)o=this.gobbleArray();else{for(t=this.expr.substr(this.index,f.max_unop_len),s=t.length;s>0;){if(f.unary_ops.hasOwnProperty(t)&&(!f.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!f.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=s;const l=this.gobbleToken();return l||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:f.UNARY_EXP,operator:t,argument:l,prefix:!0})}t=t.substr(0,--s)}f.isIdentifierStart(e)?(o=this.gobbleIdentifier(),f.literals.hasOwnProperty(o.name)?o={type:f.LITERAL,value:f.literals[o.name],raw:o.name}:o.name===f.this_str&&(o={type:f.THIS_EXP})):e===f.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===f.PERIOD_CODE||t===f.OBRACK_CODE||t===f.OPAREN_CODE||t===f.QUMARK_CODE;){let s;if(t===f.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==f.PERIOD_CODE)break;s=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===f.OBRACK_CODE?(e={type:f.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()},e.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),t=this.code,t!==f.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===f.OPAREN_CODE?e={type:f.CALL_EXP,arguments:this.gobbleArguments(f.CPAREN_CODE),callee:e}:(t===f.PERIOD_CODE||s)&&(s&&this.index--,this.gobbleSpaces(),e={type:f.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),s&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e="",t,s;for(;f.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(this.code===f.PERIOD_CODE)for(e+=this.expr.charAt(this.index++);f.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(t=this.char,t==="e"||t==="E"){for(e+=this.expr.charAt(this.index++),t=this.char,(t==="+"||t==="-")&&(e+=this.expr.charAt(this.index++));f.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);f.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+e+this.char+")")}return s=this.code,f.isIdentifierStart(s)?this.throwError("Variable names cannot start with a number ("+e+this.char+")"):(s===f.PERIOD_CODE||e.length===1&&e.charCodeAt(0)===f.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:f.LITERAL,value:parseFloat(e),raw:e}}gobbleStringLiteral(){let e="";const t=this.index,s=this.expr.charAt(this.index++);let o=!1;for(;this.index<this.expr.length;){let l=this.expr.charAt(this.index++);if(l===s){o=!0;break}else if(l==="\\")switch(l=this.expr.charAt(this.index++),l){case"n":e+=`
2
+ `;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=l}else e+=l}return o||this.throwError('Unclosed quote after "'+e+'"'),{type:f.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(f.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(e=this.code,f.isIdentifierPart(e));)this.index++;return{type:f.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){const t=[];let s=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let l=this.code;if(l===e){s=!0,this.index++,e===f.CPAREN_CODE&&o&&o>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}else if(l===f.COMMA_CODE){if(this.index++,o++,o!==t.length){if(e===f.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===f.CBRACK_CODE)for(let i=t.length;i<o;i++)t.push(null)}}else if(t.length!==o&&o!==0)this.throwError("Expected comma");else{const i=this.gobbleExpression();(!i||i.type===f.COMPOUND)&&this.throwError("Expected comma"),t.push(i)}}return s||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(f.CPAREN_CODE);if(this.code===f.CPAREN_CODE)return this.index++,e.length===1?e[0]:e.length?{type:f.SEQUENCE_EXP,expressions:e}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:f.ARRAY_EXP,elements:this.gobbleArguments(f.CBRACK_CODE)}}}const He=new Xe;Object.assign(f,{hooks:He,plugins:new ze(f),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),f.max_unop_len=f.getMaxKeyLen(f.unary_ops),f.max_binop_len=f.getMaxKeyLen(f.binary_ops);const ne=n=>new f(n).parse(),qe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(f).filter(n=>!qe.includes(n)&&ne[n]===void 0).forEach(n=>{ne[n]=f[n]}),ne.Jsep=f;const We="ConditionalExpression";var Qe={name:"ternary",init(n){n.hooks.add("after-expression",function(t){if(t.node&&this.code===n.QUMARK_CODE){this.index++;const s=t.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===n.COLON_CODE){this.index++;const l=this.gobbleExpression();if(l||this.throwError("Expected expression"),t.node={type:We,test:s,consequent:o,alternate:l},s.operator&&n.binary_ops[s.operator]<=.9){let i=s;for(;i.right.operator&&n.binary_ops[i.right.operator]<=.9;)i=i.right;t.node.test=i.right,i.right=t.node,t.node=s}}else this.throwError("Expected :")}})}};ne.plugins.register(Qe);const Ce=47,Ye=92;var De={name:"regex",init(n){n.hooks.add("gobble-token",function(t){if(this.code===Ce){const s=++this.index;let o=!1;for(;this.index<this.expr.length;){if(this.code===Ce&&!o){const l=this.expr.slice(s,this.index);let i="";for(;++this.index<this.expr.length;){const a=this.code;if(a>=97&&a<=122||a>=65&&a<=90||a>=48&&a<=57)i+=this.char;else break}let d;try{d=new RegExp(l,i)}catch(a){this.throwError(a.message)}return t.node={type:n.LITERAL,value:d,raw:this.expr.slice(s-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===n.OBRACK_CODE?o=!0:o&&this.code===n.CBRACK_CODE&&(o=!1),this.index+=this.code===Ye?2:1}this.throwError("Unclosed Regex")}})}};const _e=43,fe={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[_e,45],assignmentPrecedence:.9,init(n){const e=[n.IDENTIFIER,n.MEMBER_EXP];fe.assignmentOperators.forEach(s=>n.addBinaryOp(s,fe.assignmentPrecedence,!0)),n.hooks.add("gobble-token",function(o){const l=this.code;fe.updateOperators.some(i=>i===l&&i===this.expr.charCodeAt(this.index+1))&&(this.index+=2,o.node={type:"UpdateExpression",operator:l===_e?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},(!o.node.argument||!e.includes(o.node.argument.type))&&this.throwError(`Unexpected ${o.node.operator}`))}),n.hooks.add("after-token",function(o){if(o.node){const l=this.code;fe.updateOperators.some(i=>i===l&&i===this.expr.charCodeAt(this.index+1))&&(e.includes(o.node.type)||this.throwError(`Unexpected ${o.node.operator}`),this.index+=2,o.node={type:"UpdateExpression",operator:l===_e?"++":"--",argument:o.node,prefix:!1})}}),n.hooks.add("after-expression",function(o){o.node&&t(o.node)});function t(s){fe.assignmentOperators.has(s.operator)?(s.type="AssignmentExpression",t(s.left),t(s.right)):s.operator||Object.values(s).forEach(o=>{o&&typeof o=="object"&&t(o)})}}};ne.plugins.register(De,fe),ne.addUnaryOp("typeof"),ne.addLiteral("null",null),ne.addLiteral("undefined",void 0);const Ge=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__"]),M={evalAst(n,e){switch(n.type){case"BinaryExpression":case"LogicalExpression":return M.evalBinaryExpression(n,e);case"Compound":return M.evalCompound(n,e);case"ConditionalExpression":return M.evalConditionalExpression(n,e);case"Identifier":return M.evalIdentifier(n,e);case"Literal":return M.evalLiteral(n,e);case"MemberExpression":return M.evalMemberExpression(n,e);case"UnaryExpression":return M.evalUnaryExpression(n,e);case"ArrayExpression":return M.evalArrayExpression(n,e);case"CallExpression":return M.evalCallExpression(n,e);case"AssignmentExpression":return M.evalAssignmentExpression(n,e);default:throw SyntaxError("Unexpected expression",n)}},evalBinaryExpression(n,e){return{"||":(s,o)=>s||o(),"&&":(s,o)=>s&&o(),"|":(s,o)=>s|o(),"^":(s,o)=>s^o(),"&":(s,o)=>s&o(),"==":(s,o)=>s==o(),"!=":(s,o)=>s!=o(),"===":(s,o)=>s===o(),"!==":(s,o)=>s!==o(),"<":(s,o)=>s<o(),">":(s,o)=>s>o(),"<=":(s,o)=>s<=o(),">=":(s,o)=>s>=o(),"<<":(s,o)=>s<<o(),">>":(s,o)=>s>>o(),">>>":(s,o)=>s>>>o(),"+":(s,o)=>s+o(),"-":(s,o)=>s-o(),"*":(s,o)=>s*o(),"/":(s,o)=>s/o(),"%":(s,o)=>s%o()}[n.operator](M.evalAst(n.left,e),()=>M.evalAst(n.right,e))},evalCompound(n,e){let t;for(let s=0;s<n.body.length;s++){n.body[s].type==="Identifier"&&["var","let","const"].includes(n.body[s].name)&&n.body[s+1]&&n.body[s+1].type==="AssignmentExpression"&&(s+=1);const o=n.body[s];t=M.evalAst(o,e)}return t},evalConditionalExpression(n,e){return M.evalAst(n.test,e)?M.evalAst(n.consequent,e):M.evalAst(n.alternate,e)},evalIdentifier(n,e){if(Object.hasOwn(e,n.name))return e[n.name];throw ReferenceError(`${n.name} is not defined`)},evalLiteral(n){return n.value},evalMemberExpression(n,e){const t=String(n.computed?M.evalAst(n.property):n.property.name),s=M.evalAst(n.object,e);if(s==null)throw TypeError(`Cannot read properties of ${s} (reading '${t}')`);if(!Object.hasOwn(s,t)&&Ge.has(t))throw TypeError(`Cannot read properties of ${s} (reading '${t}')`);const o=s[t];return typeof o=="function"?o.bind(s):o},evalUnaryExpression(n,e){return{"-":s=>-M.evalAst(s,e),"!":s=>!M.evalAst(s,e),"~":s=>~M.evalAst(s,e),"+":s=>+M.evalAst(s,e),typeof:s=>typeof M.evalAst(s,e)}[n.operator](n.argument)},evalArrayExpression(n,e){return n.elements.map(t=>M.evalAst(t,e))},evalCallExpression(n,e){const t=n.arguments.map(o=>M.evalAst(o,e));return M.evalAst(n.callee,e)(...t)},evalAssignmentExpression(n,e){if(n.left.type!=="Identifier")throw SyntaxError("Invalid left-hand side in assignment");const t=n.left.name,s=M.evalAst(n.right,e);return e[t]=s,e[t]}};class Ze{constructor(e){this.code=e,this.ast=ne(this.code)}runInNewContext(e){const t=Object.assign(Object.create(null),e);return M.evalAst(this.ast,t)}}function re(n,e){return n=n.slice(),n.push(e),n}function xe(n,e){return e=e.slice(),e.unshift(n),e}class Je extends Error{constructor(e){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=e,this.name="NewError"}}function L(n,e,t,s,o){if(!(this instanceof L))try{return new L(n,e,t,s,o)}catch(i){if(!i.avoidNew)throw i;return i.value}typeof n=="string"&&(o=s,s=t,t=e,e=n,n=null);const l=n&&typeof n=="object";if(n=n||{},this.json=n.json||t,this.path=n.path||e,this.resultType=n.resultType||"value",this.flatten=n.flatten||!1,this.wrap=Object.hasOwn(n,"wrap")?n.wrap:!0,this.sandbox=n.sandbox||{},this.eval=n.eval===void 0?"safe":n.eval,this.ignoreEvalErrors=typeof n.ignoreEvalErrors>"u"?!1:n.ignoreEvalErrors,this.parent=n.parent||null,this.parentProperty=n.parentProperty||null,this.callback=n.callback||s||null,this.otherTypeCallback=n.otherTypeCallback||o||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},n.autostart!==!1){const i={path:l?n.path:e};l?"json"in n&&(i.json=n.json):i.json=t;const d=this.evaluate(i);if(!d||typeof d!="object")throw new Je(d);return d}}L.prototype.evaluate=function(n,e,t,s){let o=this.parent,l=this.parentProperty,{flatten:i,wrap:d}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,t=t||this.callback,this.currOtherTypeCallback=s||this.otherTypeCallback,e=e||this.json,n=n||this.path,n&&typeof n=="object"&&!Array.isArray(n)){if(!n.path&&n.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(n,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:e}=n),i=Object.hasOwn(n,"flatten")?n.flatten:i,this.currResultType=Object.hasOwn(n,"resultType")?n.resultType:this.currResultType,this.currSandbox=Object.hasOwn(n,"sandbox")?n.sandbox:this.currSandbox,d=Object.hasOwn(n,"wrap")?n.wrap:d,this.currEval=Object.hasOwn(n,"eval")?n.eval:this.currEval,t=Object.hasOwn(n,"callback")?n.callback:t,this.currOtherTypeCallback=Object.hasOwn(n,"otherTypeCallback")?n.otherTypeCallback:this.currOtherTypeCallback,o=Object.hasOwn(n,"parent")?n.parent:o,l=Object.hasOwn(n,"parentProperty")?n.parentProperty:l,n=n.path}if(o=o||null,l=l||null,Array.isArray(n)&&(n=L.toPathString(n)),!n&&n!==""||!e)return;const a=L.toPathArray(n);a[0]==="$"&&a.length>1&&a.shift(),this._hasParentSelector=null;const c=this._trace(a,e,["$"],o,l,t).filter(function(g){return g&&!g.isParentSelector});return c.length?!d&&c.length===1&&!c[0].hasArrExpr?this._getPreferredOutput(c[0]):c.reduce((g,p)=>{const x=this._getPreferredOutput(p);return i&&Array.isArray(x)?g=g.concat(x):g.push(x),g},[]):d?[]:void 0},L.prototype._getPreferredOutput=function(n){const e=this.currResultType;switch(e){case"all":{const t=Array.isArray(n.path)?n.path:L.toPathArray(n.path);return n.pointer=L.toPointer(t),n.path=typeof n.path=="string"?n.path:L.toPathString(n.path),n}case"value":case"parent":case"parentProperty":return n[e];case"path":return L.toPathString(n[e]);case"pointer":return L.toPointer(n.path);default:throw new TypeError("Unknown result type")}},L.prototype._handleCallback=function(n,e,t){if(e){const s=this._getPreferredOutput(n);n.path=typeof n.path=="string"?n.path:L.toPathString(n.path),e(s,t,n)}},L.prototype._trace=function(n,e,t,s,o,l,i,d){let a;if(!n.length)return a={path:t,value:e,parent:s,parentProperty:o,hasArrExpr:i},this._handleCallback(a,l,"value"),a;const c=n[0],g=n.slice(1),p=[];function x(E){Array.isArray(E)?E.forEach(v=>{p.push(v)}):p.push(E)}if((typeof c!="string"||d)&&e&&Object.hasOwn(e,c))x(this._trace(g,e[c],re(t,c),e,c,l,i));else if(c==="*")this._walk(e,E=>{x(this._trace(g,e[E],re(t,E),e,E,l,!0,!0))});else if(c==="..")x(this._trace(g,e,t,s,o,l,i)),this._walk(e,E=>{typeof e[E]=="object"&&x(this._trace(n.slice(),e[E],re(t,E),e,E,l,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:t.slice(0,-1),expr:g,isParentSelector:!0};if(c==="~")return a={path:re(t,c),value:o,parent:s,parentProperty:null},this._handleCallback(a,l,"property"),a;if(c==="$")x(this._trace(g,e,t,null,null,l,i));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(c))x(this._slice(c,g,e,t,s,o,l));else if(c.indexOf("?(")===0){if(this.currEval===!1)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");const E=c.replace(/^\?\((.*?)\)$/u,"$1"),v=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(E);v?this._walk(e,S=>{const _=[v[2]],I=v[1]?e[S][v[1]]:e[S];this._trace(_,I,t,s,o,l,!0).length>0&&x(this._trace(g,e[S],re(t,S),e,S,l,!0))}):this._walk(e,S=>{this._eval(E,e[S],S,t,s,o)&&x(this._trace(g,e[S],re(t,S),e,S,l,!0))})}else if(c[0]==="("){if(this.currEval===!1)throw new Error("Eval [(expr)] prevented in JSONPath expression.");x(this._trace(xe(this._eval(c,e,t.at(-1),t.slice(0,-1),s,o),g),e,t,s,o,l,i))}else if(c[0]==="@"){let E=!1;const v=c.slice(1,-2);switch(v){case"scalar":(!e||!["object","function"].includes(typeof e))&&(E=!0);break;case"boolean":case"string":case"undefined":case"function":typeof e===v&&(E=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(E=!0);break;case"number":Number.isFinite(e)&&(E=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(E=!0);break;case"object":e&&typeof e===v&&(E=!0);break;case"array":Array.isArray(e)&&(E=!0);break;case"other":E=this.currOtherTypeCallback(e,t,s,o);break;case"null":e===null&&(E=!0);break;default:throw new TypeError("Unknown value type "+v)}if(E)return a={path:t,value:e,parent:s,parentProperty:o},this._handleCallback(a,l,"value"),a}else if(c[0]==="`"&&e&&Object.hasOwn(e,c.slice(1))){const E=c.slice(1);x(this._trace(g,e[E],re(t,E),e,E,l,i,!0))}else if(c.includes(",")){const E=c.split(",");for(const v of E)x(this._trace(xe(v,g),e,t,s,o,l,!0))}else!d&&e&&Object.hasOwn(e,c)&&x(this._trace(g,e[c],re(t,c),e,c,l,i,!0))}if(this._hasParentSelector)for(let E=0;E<p.length;E++){const v=p[E];if(v&&v.isParentSelector){const S=this._trace(v.expr,e,v.path,s,o,l,i);if(Array.isArray(S)){p[E]=S[0];const _=S.length;for(let I=1;I<_;I++)E++,p.splice(E,0,S[I])}else p[E]=S}}return p},L.prototype._walk=function(n,e){if(Array.isArray(n)){const t=n.length;for(let s=0;s<t;s++)e(s)}else n&&typeof n=="object"&&Object.keys(n).forEach(t=>{e(t)})},L.prototype._slice=function(n,e,t,s,o,l,i){if(!Array.isArray(t))return;const d=t.length,a=n.split(":"),c=a[2]&&Number.parseInt(a[2])||1;let g=a[0]&&Number.parseInt(a[0])||0,p=a[1]&&Number.parseInt(a[1])||d;g=g<0?Math.max(0,g+d):Math.min(d,g),p=p<0?Math.max(0,p+d):Math.min(d,p);const x=[];for(let E=g;E<p;E+=c)this._trace(xe(E,e),t,s,o,l,i,!0).forEach(S=>{x.push(S)});return x},L.prototype._eval=function(n,e,t,s,o,l){this.currSandbox._$_parentProperty=l,this.currSandbox._$_parent=o,this.currSandbox._$_property=t,this.currSandbox._$_root=this.json,this.currSandbox._$_v=e;const i=n.includes("@path");i&&(this.currSandbox._$_path=L.toPathString(s.concat([t])));const d=this.currEval+"Script:"+n;if(!L.cache[d]){let a=n.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");if(i&&(a=a.replaceAll("@path","_$_path")),this.currEval==="safe"||this.currEval===!0||this.currEval===void 0)L.cache[d]=new this.safeVm.Script(a);else if(this.currEval==="native")L.cache[d]=new this.vm.Script(a);else if(typeof this.currEval=="function"&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){const c=this.currEval;L.cache[d]=new c(a)}else if(typeof this.currEval=="function")L.cache[d]={runInNewContext:c=>this.currEval(a,c)};else throw new TypeError(`Unknown "eval" property "${this.currEval}"`)}try{return L.cache[d].runInNewContext(this.currSandbox)}catch(a){if(this.ignoreEvalErrors)return!1;throw new Error("jsonPath: "+a.message+": "+n)}},L.cache={},L.toPathString=function(n){const e=n,t=e.length;let s="$";for(let o=1;o<t;o++)/^(~|\^|@.*?\(\))$/u.test(e[o])||(s+=/^[0-9*]+$/u.test(e[o])?"["+e[o]+"]":"['"+e[o]+"']");return s},L.toPointer=function(n){const e=n,t=e.length;let s="";for(let o=1;o<t;o++)/^(~|\^|@.*?\(\))$/u.test(e[o])||(s+="/"+e[o].toString().replaceAll("~","~0").replaceAll("/","~1"));return s},L.toPathArray=function(n){const{cache:e}=L;if(e[n])return e[n].concat();const t=[],o=n.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu,function(l,i){return"[#"+(t.push(i)-1)+"]"}).replaceAll(/\[['"]([^'\]]*)['"]\]/gu,function(l,i){return"['"+i.replaceAll(".","%@%").replaceAll("~","%%@@%%")+"']"}).replaceAll("~",";~;").replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,";").replaceAll("%@%",".").replaceAll("%%@@%%","~").replaceAll(/(?:;)?(\^+)(?:;)?/gu,function(l,i){return";"+i.split("").join(";")+";"}).replaceAll(/;;;|;;/gu,";..;").replaceAll(/;$|'?\]|'$/gu,"").split(";").map(function(l){const i=l.match(/#(\d+)/u);return!i||!i[1]?l:t[i[1]]});return e[n]=o,e[n].concat()},L.prototype.safeVm={Script:Ze};const et=function(n,e,t){const s=n.length;for(let o=0;o<s;o++){const l=n[o];t(l)&&e.push(n.splice(o--,1)[0])}};class tt{constructor(e){this.code=e}runInNewContext(e){let t=this.code;const s=Object.keys(e),o=[];et(s,o,c=>typeof e[c]=="function");const l=s.map(c=>e[c]);t=o.reduce((c,g)=>{let p=e[g].toString();return/function/u.test(p)||(p="function "+p),"var "+g+"="+p+";"+c},"")+t,!/(['"])use strict\1/u.test(t)&&!s.includes("arguments")&&(t="var arguments = undefined;"+t),t=t.replace(/;\s*$/u,"");const d=t.lastIndexOf(";"),a=d!==-1?t.slice(0,d+1)+" return "+t.slice(d+1):" return "+t;return new Function(...s,a)(...l)}}L.prototype.vm={Script:tt};const nt={class:"json-node"},rt={key:0,class:"json-node__container"},ot={class:"json-node__line"},st=["contenteditable","onKeydown"],lt={key:1,class:"json-node__colon"},it=["title"],at=["title"],ct={key:4,class:"json-node__comma"},dt={key:0,class:"json-node__children"},ut={class:"json-node__children-content"},ft={class:"json-node__line json-node__closing-bracket"},ht={class:"json-node__bracket"},pt={key:0,class:"json-node__comma"},mt={key:1,class:"json-node__primitive"},gt=["contenteditable","onKeydown"],yt={key:1,class:"json-node__colon"},bt=["title"],Et=["contenteditable","onKeydown"],_t={key:0,class:"json-node__comma"},xt=r.defineComponent({name:"JsonNode",__name:"JsonNode",props:{value:{},keyName:{},level:{},path:{default:""},expanded:{},isLast:{type:Boolean,default:!1},theme:{}},emits:["update:value","toggle-expand","copy","update:key"],setup(n,{emit:e}){r.useCssVars(u=>({"2a18b018":u.level,"58a14b93":u.theme.colors.syntaxKey,"46fe1b3e":u.theme.colors.hoverBackground,fbe2c048:u.theme.colors.syntaxBracket,"4bd524bb":u.theme.colors.collapsedText,"3308d23c":u.theme.colors.collapsedBackground,"36380c60":u.theme.colors.collapsedBackgroundHover,"0892365d":u.theme.colors.syntaxString,"0015b195":u.theme.colors.syntaxNumber,"7db95f5c":u.theme.colors.syntaxBoolean,"88ec825a":u.theme.colors.syntaxNull,"537157f7":u.theme.colors.background,"3cee3331":u.theme.colors.selectionBackground,"81323cee":u.theme.colors.indentLine}));const t=n,s=e,o=r.ref(!1),l=r.ref(!1),i=r.ref(""),d=r.ref(""),a=r.ref("string"),c=r.ref(null),g=r.ref(null),p=u=>u!==null&&typeof u=="object"&&!Array.isArray(u)&&"__protected_number__"in u&&Object.keys(u).length===1,x=u=>p(u)?u.__protected_number__:"",E=r.computed(()=>p(t.value)?!1:t.value!==null&&typeof t.value=="object"),v=r.computed(()=>Array.isArray(t.value)),S=r.computed(()=>t.path?t.path:t.keyName?t.keyName:"root"),_=r.computed(()=>t.expanded.has(S.value)),I=r.computed(()=>t.keyName),U=r.computed(()=>v.value?"[":"{"),H=r.computed(()=>v.value?"]":"}"),X=r.computed(()=>{if(!t.value)return"";const y=Object.keys(t.value).length;return v.value?y>0?` ${y} items `:" ":y>0?` ${y} keys `:" "}),Z=r.computed(()=>{const u=typeof t.value;return t.value===null?"json-node__value--null":u==="boolean"?"json-node__value--boolean":u==="number"||p(t.value)?"json-node__value--number":u==="string"?"json-node__value--string":""}),ee=r.computed(()=>t.value===null?"null":typeof t.value=="boolean"||typeof t.value=="number"?String(t.value):p(t.value)?x(t.value):typeof t.value=="string"?`"${t.value}"`:String(t.value)),le=r.computed(()=>"Double-click to edit"),D=u=>t.level===0?u:S.value?`${S.value}.${u}`:u,N=u=>{const y=Object.keys(t.value);return y.indexOf(u)===y.length-1},B=()=>{s("toggle-expand",S.value)},P=()=>{t.level!==0&&(o.value=!0,i.value=t.keyName,r.nextTick(()=>{if(c.value){c.value.focus();const u=document.createRange();u.selectNodeContents(c.value);const y=window.getSelection();y?.removeAllRanges(),y?.addRange(u)}}))},$=()=>{E.value||(l.value=!0,t.value===null?a.value="null":p(t.value)?a.value="protected-number":typeof t.value=="string"?a.value="string":typeof t.value=="number"?a.value="number":typeof t.value=="boolean"&&(a.value="boolean"),p(t.value)?d.value=x(t.value):typeof t.value=="string"?d.value=t.value:d.value=String(t.value),r.nextTick(()=>{if(g.value){g.value.focus();const u=document.createRange();u.selectNodeContents(g.value);const y=window.getSelection();y?.removeAllRanges(),y?.addRange(u)}}))},T=()=>{if(t.level===0||!o.value)return;const u=c.value?.innerText.trim()||"";if(!u){h();return}if(u===t.keyName){o.value=!1;return}o.value=!1,s("update:key",S.value,u)},j=()=>{if(l.value)try{let u;const y=g.value?.innerText.trim()||"";if(a.value==="string")y==="null"?u=null:y==="true"||y==="false"?u=y==="true":u=y;else if(a.value==="protected-number")u={__protected_number__:y};else if(y==="null")u=null;else if(y==="true"||y==="false")u=y==="true";else if(!isNaN(Number(y))&&y!==""){const k=Number(y);!Number.isSafeInteger(k)||y.length>15?u={__protected_number__:y}:u=k}else u=y;s("update:value",S.value,u),l.value=!1}catch(u){console.error("Failed to parse value:",u),l.value=!1}},h=()=>{o.value=!1,i.value=t.keyName},b=()=>{l.value=!1,p(t.value)?d.value=x(t.value):typeof t.value=="string"?d.value=t.value:d.value=String(t.value)};return(u,y)=>{const k=r.resolveComponent("JsonNode",!0);return r.openBlock(),r.createElementBlock("div",nt,[E.value?(r.openBlock(),r.createElementBlock("div",rt,[r.createElementVNode("div",ot,[u.keyName?(r.openBlock(),r.createElementBlock("span",{key:0,class:"json-node__key",contenteditable:o.value,onDblclick:P,onKeydown:[r.withKeys(r.withModifiers(T,["prevent"]),["enter"]),r.withKeys(h,["escape"])],onBlur:T,ref_key:"keyRef",ref:c,title:"Double-click to edit key"},r.toDisplayString(o.value?i.value:`"${I.value}"`),41,st)):r.createCommentVNode("",!0),u.keyName?(r.openBlock(),r.createElementBlock("span",lt,": ")):r.createCommentVNode("",!0),r.createElementVNode("span",{class:"json-node__bracket json-node__bracket--clickable",onClick:B,title:_.value?"Click to collapse":"Click to expand"},r.toDisplayString(U.value),9,it),_.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",{key:2,class:"json-node__collapsed-info",onClick:B,title:`Click to expand ${X.value.trim()}`},r.toDisplayString(X.value),9,at)),_.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",{key:3,class:"json-node__bracket json-node__bracket--clickable",onClick:B,title:"Click to expand"},r.toDisplayString(H.value),1)),!_.value&&!u.isLast?(r.openBlock(),r.createElementBlock("span",ct,",")):r.createCommentVNode("",!0)]),_.value?(r.openBlock(),r.createElementBlock("div",dt,[r.createElementVNode("div",ut,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,(w,A)=>(r.openBlock(),r.createElementBlock("div",{key:A,class:"json-node__child"},[r.createVNode(k,{value:w,"key-name":v.value?"":String(A),level:u.level+1,path:D(String(A)),expanded:u.expanded,theme:u.theme,"onUpdate:value":y[0]||(y[0]=(V,K)=>u.$emit("update:value",V,K)),onToggleExpand:y[1]||(y[1]=V=>u.$emit("toggle-expand",V)),onCopy:y[2]||(y[2]=V=>u.$emit("copy",V)),"onUpdate:key":y[3]||(y[3]=(V,K)=>u.$emit("update:key",V,K)),"is-last":N(String(A))},null,8,["value","key-name","level","path","expanded","theme","is-last"])]))),128))]),r.createElementVNode("div",ft,[r.createElementVNode("span",ht,r.toDisplayString(H.value),1),u.isLast?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",pt,","))])])):r.createCommentVNode("",!0)])):(r.openBlock(),r.createElementBlock("div",mt,[u.keyName?(r.openBlock(),r.createElementBlock("span",{key:0,class:"json-node__key",contenteditable:o.value,onDblclick:P,onKeydown:[r.withKeys(r.withModifiers(T,["prevent"]),["enter"]),r.withKeys(h,["escape"])],onBlur:T,ref_key:"keyRef",ref:c,title:"Double-click to edit key"},r.toDisplayString(o.value?i.value:`"${I.value}"`),41,gt)):r.createCommentVNode("",!0),u.keyName?(r.openBlock(),r.createElementBlock("span",yt,": ")):r.createCommentVNode("",!0),r.createElementVNode("span",{class:r.normalizeClass(["json-node__value-wrapper",Z.value]),onDblclick:$,title:le.value},[r.createElementVNode("span",{class:"json-node__value",contenteditable:l.value,onKeydown:[r.withKeys(r.withModifiers(j,["prevent"]),["enter"]),r.withKeys(b,["escape"])],onBlur:j,ref_key:"valueRef",ref:g},r.toDisplayString(l.value?d.value:ee.value),41,Et),u.isLast?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",_t,","))],42,bt)]))])}}}),ge=(n,e)=>{const t=n.__vccOpts||n;for(const[s,o]of e)t[s]=o;return t},kt=ge(xt,[["__scopeId","data-v-1472a8af"]]),Be={name:"github-light",colors:{background:"#ffffff",surfaceBackground:"#f6f8fa",border:"#d0d7de",text:"#24292f",textSecondary:"#656d76",buttonBackground:"#f6f8fa",buttonBackgroundHover:"#f3f4f6",buttonBorder:"#d0d7de",buttonText:"#24292f",buttonPrimary:"#2da44e",buttonPrimaryHover:"#2c974b",success:"#1a7f37",successBackground:"#dafbe1",error:"#cf222e",errorBackground:"#ffebe9",syntaxString:"#0a3069",syntaxNumber:"#0969da",syntaxBoolean:"#8250df",syntaxNull:"#656d76",syntaxKey:"#0969da",syntaxBracket:"#24292f",hoverBackground:"#f6f8fa",selectionBackground:"rgba(9, 105, 218, 0.2)",collapsedBackground:"#ddf4ff",collapsedBackgroundHover:"#b6e3ff",collapsedText:"#0969da",indentLine:"#d0d7de"}},Nt={"github-light":Be,"github-dark":{name:"github-dark",colors:{background:"#0d1117",surfaceBackground:"#161b22",border:"#30363d",text:"#e6edf3",textSecondary:"#7d8590",buttonBackground:"#21262d",buttonBackgroundHover:"#30363d",buttonBorder:"#30363d",buttonText:"#e6edf3",buttonPrimary:"#238636",buttonPrimaryHover:"#2ea043",success:"#3fb950",successBackground:"#0f2419",error:"#f85149",errorBackground:"#381921",syntaxString:"#a5d6ff",syntaxNumber:"#79c0ff",syntaxBoolean:"#d2a8ff",syntaxNull:"#7d8590",syntaxKey:"#79c0ff",syntaxBracket:"#e6edf3",hoverBackground:"#161b22",selectionBackground:"rgba(121, 192, 255, 0.2)",collapsedBackground:"#1c2128",collapsedBackgroundHover:"#2d333b",collapsedText:"#79c0ff",indentLine:"#30363d"}},"min-light":{name:"min-light",colors:{background:"#ffffff",surfaceBackground:"#fafafa",border:"#e5e5e5",text:"#333333",textSecondary:"#888888",buttonBackground:"#f8f8f8",buttonBackgroundHover:"#eeeeee",buttonBorder:"#e0e0e0",buttonText:"#333333",buttonPrimary:"#007acc",buttonPrimaryHover:"#005a9e",success:"#22c55e",successBackground:"#f0fdf4",error:"#ef4444",errorBackground:"#fef2f2",syntaxString:"#22c55e",syntaxNumber:"#3b82f6",syntaxBoolean:"#8b5cf6",syntaxNull:"#6b7280",syntaxKey:"#1f2937",syntaxBracket:"#374151",hoverBackground:"#f9f9f9",selectionBackground:"rgba(59, 130, 246, 0.2)",collapsedBackground:"#e0f2fe",collapsedBackgroundHover:"#bae6fd",collapsedText:"#0284c7",indentLine:"#e5e7eb"}},"slack-ochin":{name:"slack-ochin",colors:{background:"#fefbf6",surfaceBackground:"#faf6f0",border:"#e8d5b7",text:"#4a3b2a",textSecondary:"#8b7355",buttonBackground:"#f4ede4",buttonBackgroundHover:"#efe5d8",buttonBorder:"#e8d5b7",buttonText:"#4a3b2a",buttonPrimary:"#ff6b35",buttonPrimaryHover:"#e55a2b",success:"#ff9500",successBackground:"#fff8f0",error:"#d73502",errorBackground:"#ffeee8",syntaxString:"#d73502",syntaxNumber:"#ff6b35",syntaxBoolean:"#b7472a",syntaxNull:"#8b7355",syntaxKey:"#4a3b2a",syntaxBracket:"#6b5444",hoverBackground:"#f8f2eb",selectionBackground:"rgba(255, 107, 53, 0.2)",collapsedBackground:"#ffe8d6",collapsedBackgroundHover:"#ffd4b0",collapsedText:"#d73502",indentLine:"#e8d5b7"}}};function wt(n="github-light"){return Nt[n]||Be}const At={key:0,class:"json-format__toolbar"},Ct={class:"json-format__actions"},Bt=["disabled"],Tt=["disabled"],vt=["disabled"],St=["disabled"],Ot={class:"json-format__info"},$t={key:0,class:"json-format__status json-format__status--success"},Pt={key:1,class:"json-format__status json-format__status--error"},Vt={class:"json-format__content"},It={key:0,class:"json-format__error"},Rt={key:1,class:"json-format__error"},Lt={key:2,class:"json-format__viewer"},Te=ge(r.defineComponent({name:"JsonFormat",__name:"index",props:{modelValue:{default:""},readonly:{type:Boolean,default:!1},maxDepth:{default:10},showToolbar:{type:Boolean,default:!0},theme:{default:"github-light"}},emits:["update:modelValue","copy-success","copy-error","expand-all","collapse-all","compress"],setup(n,{expose:e,emit:t}){r.useCssVars(h=>({"325d5f6b":p.value.colors.border,"407388ed":p.value.colors.background,"1276f42c":p.value.colors.text,"34805dc8":p.value.colors.surfaceBackground,"212f19fd":p.value.colors.buttonBorder,b83cab02:p.value.colors.buttonBackground,b58ba984:p.value.colors.buttonText,d50a3406:p.value.colors.buttonBackgroundHover,"2421bb5e":p.value.colors.buttonPrimary,"0299816b":p.value.colors.buttonPrimaryHover,"55f370f2":p.value.colors.successBackground,b3fc86b8:p.value.colors.success,"781064f7":p.value.colors.errorBackground,"3b9a02e9":p.value.colors.error}));const s=n,o=t,l=r.ref(null),i=r.ref(""),d=r.ref(new Set),a=r.ref(null),c=r.ref(""),g=r.computed(()=>i.value===""),p=r.computed(()=>wt(s.theme)),x=r.computed(()=>c.value?null:a.value!==null?a.value:l.value),E=h=>{if(!h.trim()){l.value=null,i.value="",a.value=null,c.value="";return}try{let b=h;const u=/(:\s*|,\s*|\[\s*)-?\d{16,}/.test(b),y=/(:\s*|,\s*|\[\s*)-?\d+\.\d*0+\s*[,}\]\s]*/.test(b);if(!u&&!y)try{l.value=JSON.parse(b),i.value="",a.value=null,c.value="",r.nextTick(()=>{x.value!==null&&X()});return}catch{}b=(w=>{let A="",V=!1,K=!1,W=0;for(;W<w.length;){const J=w[W];if(V)K?K=!1:J==="\\"?K=!0:J==='"'&&(V=!1),A+=J,W++;else if(J==='"')V=!0,A+=J,W++;else{const de=w.slice(W);let G=de.match(/^([:,\[\s]*)(-?\d{16,})(\s*[,\}\]\s]|$)/);if(G){A+=G[1]+'{"__protected_number__":"'+G[2]+'"}'+G[3],W+=G[0].length;continue}if(G=de.match(/^([:,\[\s]*)(-?\d+\.\d*0+)(\s*[,\}\]\s]|$)/),G){A+=G[1]+'{"__protected_number__":"'+G[2]+'"}'+G[3],W+=G[0].length;continue}A+=J,W++}}return A})(b),l.value=JSON.parse(b),i.value="",a.value=null,c.value="",r.nextTick(()=>{x.value!==null&&X()})}catch(b){i.value=b instanceof Error?b.message:"Unknown parsing error",l.value=null,a.value=null,c.value=""}},v=h=>{if(!h||!h.expression.trim()){S();return}if(!l.value){c.value="No valid JSON data to filter";return}try{let b;if(h.type==="jsonpath")b=L({path:h.expression,json:l.value}),b.length===1&&h.expression.includes("$[")===!1&&!h.expression.endsWith("[*]")?a.value=b[0]:a.value=b;else if(h.type==="js")b=new Function("data",`
3
3
  try {
4
- return ${b.expression};
4
+ return ${h.expression};
5
5
  } catch (error) {
6
6
  throw new Error('JavaScript expression error: ' + error.message);
7
7
  }
8
- `)(l.value),a.value=E;else throw new Error(`Unsupported filter type: ${b.type}`);c.value="",o.nextTick(()=>{m()})}catch(E){c.value=E instanceof Error?E.message:"Filter execution error",a.value=null}},C=()=>{a.value=null,c.value=""};o.watch(()=>s.modelValue,b=>{_(b)},{immediate:!0});const x=(b,E,f)=>{const y=S=>{if(S===null||typeof S!="object")return S;if(!Array.isArray(S)&&"__protected_number__"in S&&Object.keys(S).length===1)return`__PROTECTED_NUMBER_${S.__protected_number__}_PROTECTED_NUMBER__`;if(Array.isArray(S))return S.map(L=>y(L));const I={};for(const[L,K]of Object.entries(S))I[L]=y(K);return I},w=y(b);return JSON.stringify(w,E,f).replace(/"__PROTECTED_NUMBER_(.+?)_PROTECTED_NUMBER__"/g,"$1")},O=(b,E)=>{if(!s.readonly)try{const f=R(l.value,b,E),y=x(f,null,2);n("update:modelValue",y)}catch(f){console.error("Failed to update JSON:",f)}},R=(b,E,f)=>{if(!E||E==="root")return f;const y=E.split("."),w=F(b,y.slice(0,-1));let B=w;for(let I=0;I<y.length-1;I++){const L=y[I];L!=="root"&&(Array.isArray(B)?B=B[parseInt(L)]:B=B[L])}const S=y[y.length-1];return S==="root"?f:(Array.isArray(B)?B[parseInt(S)]=f:B[S]=f,w)},z=b=>{d.value.has(b)?d.value.delete(b):d.value.add(b)},m=()=>{const b=new Set,E=(f,y="")=>{f!==null&&typeof f=="object"&&(b.add(y||"root"),Array.isArray(f)?f.forEach((w,B)=>{const S=y?`${y}.${B}`:`${B}`;E(w,S)}):Object.keys(f).forEach(w=>{const B=y?`${y}.${w}`:w;E(f[w],B)}))};E(k.value),d.value=b,n("expand-all")},g=()=>{d.value=new Set(["root"]),n("collapse-all")},A=async()=>{if(p.value)try{const b=k.value,E=x(b,null,2);await navigator.clipboard.writeText(E),n("copy-success",E)}catch(b){console.error("Failed to copy JSON:",b),n("copy-error",b instanceof Error?b:new Error("Failed to copy JSON"))}},T=()=>{if(p.value)try{const b=k.value,E=x(b);n("update:modelValue",E),n("compress",E)}catch(b){console.error("Failed to compress JSON:",b)}},$=async b=>{try{let E;typeof b=="object"&&b!==null&&!Array.isArray(b)&&"__protected_number__"in b&&Object.keys(b).length===1?E=b.__protected_number__:typeof b=="string"?E=`"${b}"`:E=JSON.stringify(b),await navigator.clipboard.writeText(E)}catch(E){console.error("Failed to copy value:",E)}},j=(b,E)=>{if(!s.readonly)try{const f=X(l.value,b,E),y=x(f,null,2);n("update:modelValue",y),te(b,E)}catch(f){console.error("Failed to rename key:",f)}},X=(b,E,f)=>{if(!E||E==="root")return b;const y=E.split("."),w=F(b,y.slice(0,-1));if(y.length===1){const I=y[0];return w&&typeof w=="object"&&!Array.isArray(w)?ee(w,I,f):w}let B=w;for(let I=0;I<y.length-1;I++){const L=y[I];Array.isArray(B)?B=B[parseInt(L)]:B=B[L]}const S=y[y.length-1];if(!Array.isArray(B)&&B&&typeof B=="object"){const I=ee(B,S,f),L=y.slice(0,-1);L.length>0&&W(w,L,I)}return w},F=(b,E)=>{if(E.length===0)return b;if(Array.isArray(b)){const f=[...b],y=E[0],w=parseInt(y);return E.length===1||(f[w]=F(b[w],E.slice(1))),f}else if(b&&typeof b=="object"){const f={...b},y=E[0];return E.length===1||(f[y]=F(b[y],E.slice(1))),f}return b},ee=(b,E,f)=>{if(!b||typeof b!="object"||Array.isArray(b))return b;const y=Object.keys(b),w={};for(const B of y)B===E?w[f]=b[B]:w[B]=b[B];return w},W=(b,E,f)=>{let y=b;for(let B=0;B<E.length-1;B++){const S=E[B];Array.isArray(y)?y=y[parseInt(S)]:y=y[S]}const w=E[E.length-1];Array.isArray(y)?y[parseInt(w)]=f:y[w]=f},te=(b,E)=>{const f=new Set;d.value.forEach(y=>{if(y===b){const w=b.split(".");w[w.length-1]=E,f.add(w.join("."))}else if(y.startsWith(b+".")){const w=b.split(".");w[w.length-1]=E;const B=w.join("."),S=y.substring(b.length);f.add(B+S)}else f.add(y)}),d.value=f};return e({copyJson:A,compressSource:T,expandAll:m,collapseAll:g,toggleExpand:z,updateValue:O,updateKey:j,filter:N,clearFilter:C,isValidJson:()=>p.value,getParsedJson:()=>l.value,getFilteredJson:()=>a.value,getExpandedNodes:()=>d.value,getParseError:()=>i.value,getFilterError:()=>c.value,parseJson:b=>_(b),copyValue:b=>$(b)}),(b,E)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["json-format",`json-format--${h.value.name}`])},[b.showToolbar?(o.openBlock(),o.createElementBlock("div",gt,[o.createElementVNode("div",yt,[o.createElementVNode("button",{class:"json-format__btn json-format__btn--primary",onClick:A,disabled:!p.value,title:"Copy JSON"}," 📋 Copy ",8,bt),o.createElementVNode("button",{class:"json-format__btn json-format__btn--secondary",onClick:m,disabled:!p.value,title:"Expand All"}," ⬇️ Expand All ",8,Et),o.createElementVNode("button",{class:"json-format__btn json-format__btn--secondary",onClick:g,disabled:!p.value,title:"Collapse All"}," ➡️ Collapse All ",8,_t),o.createElementVNode("button",{class:"json-format__btn json-format__btn--secondary",onClick:T,disabled:!p.value,title:"Compress JSON"}," 📦 Compress ",8,kt)]),o.createElementVNode("div",xt,[p.value?(o.openBlock(),o.createElementBlock("span",Nt," ✅ Valid JSON ")):(o.openBlock(),o.createElementBlock("span",At," ❌ Invalid JSON "))])])):o.createCommentVNode("",!0),o.createElementVNode("div",Ct,[p.value?c.value?(o.openBlock(),o.createElementBlock("div",Bt,[E[1]||(E[1]=o.createElementVNode("h4",null,"Filter Error:",-1)),o.createElementVNode("pre",null,o.toDisplayString(c.value),1)])):(o.openBlock(),o.createElementBlock("div",Tt,[o.createVNode(ht,{value:k.value,"key-name":"",level:0,expanded:d.value,"is-last":!0,theme:h.value,"onUpdate:value":O,onToggleExpand:z,onCopy:$,"onUpdate:key":j},null,8,["value","expanded","theme"])])):(o.openBlock(),o.createElementBlock("div",wt,[E[0]||(E[0]=o.createElementVNode("h4",null,"JSON Parse Error:",-1)),o.createElementVNode("pre",null,o.toDisplayString(i.value),1)]))])],2))}}),[["__scopeId","data-v-b956002c"]]),Ot={key:0,class:"xml-node__comment"},St={key:1,class:"xml-node__cdata"},Pt={key:2,class:"xml-node__element"},$t={key:0,class:"xml-node__line"},Vt={key:1,class:"xml-node__line"},It={key:2},vt={key:0,class:"xml-node__line"},Lt=["title"],Rt={class:"xml-node__line"},jt=["title"],Mt={key:1},Ft=["title"],Ut={key:0,class:"xml-node__children"},Xt={key:0,class:"xml-node__text"},zt={key:1,class:"xml-node__line"},Ht=le(o.defineComponent({__name:"XmlNode",props:{node:{},index:{},level:{default:0},parentPath:{default:""},expanded:{},theme:{}},emits:["toggle-expand","copy"],setup(r,{emit:e}){const t=r,s=e,n=o.computed(()=>Object.keys(t.node).find(g=>!g.startsWith(":")&&!g.startsWith("#"))||""),l=o.computed(()=>n.value?t.parentPath?`${t.parentPath}[${t.index}]`:`${n.value}[${t.index}]`:""),i=o.computed(()=>t.expanded.has(l.value)),d=o.computed(()=>t.node["#comment"]?"comment":t.node.__cdata?"cdata":n.value?"element":"unknown"),a=o.computed(()=>{const m=t.node[":@"]||{},g={};return Object.keys(m).forEach(A=>{A.startsWith("@_")&&(g[A.substring(2)]=m[A])}),g}),c=o.computed(()=>{if(d.value!=="element"||!n.value)return[];const m=t.node[n.value];return Array.isArray(m)?m:[]}),p=o.computed(()=>c.value.some(m=>m.__cdata)),h=o.computed(()=>{if(!p.value)return"";const m=c.value.find(g=>g.__cdata);if(m&&Array.isArray(m.__cdata)){const g=m.__cdata;if(g.length>0&&g[0]["#text"])return g[0]["#text"]}return""}),k=o.computed(()=>{if(d.value!=="element"||!n.value||p.value)return"";const m=t.node[n.value];if(!Array.isArray(m))return"";const g=m.find(A=>A["#text"]);return g?g["#text"]:""}),_=o.computed(()=>{if(d.value!=="comment")return"";const m=t.node["#comment"];return Array.isArray(m)&&m.length>0&&m[0]["#text"]||""}),N=o.computed(()=>c.value.some(m=>Object.keys(m).some(A=>!A.startsWith("#")&&!A.startsWith(":")))),C=o.computed(()=>N.value?c.value.filter(m=>Object.keys(m).some(A=>!A.startsWith("#")&&!A.startsWith(":"))).length:0),x=o.computed(()=>d.value==="element"&&!N.value&&k.value.trim()!==""),O=()=>{N.value&&s("toggle-expand",l.value)},R=(m,g)=>`${l.value}-child-${g}`,z=()=>`${l.value}.${n.value}`;return(m,g)=>{const A=o.resolveComponent("XmlNode",!0);return o.openBlock(),o.createElementBlock("div",{class:"xml-node",style:o.normalizeStyle({paddingLeft:m.level>0?"16px":"0"})},[d.value==="comment"?(o.openBlock(),o.createElementBlock("div",Ot,[o.createElementVNode("span",{style:o.normalizeStyle({color:m.theme.colors.xmlComment})}," <!-- "+o.toDisplayString(_.value)+" --> ",5)])):d.value==="cdata"?(o.openBlock(),o.createElementBlock("div",St,[o.createElementVNode("span",{style:o.normalizeStyle({color:m.theme.colors.xmlCdata})}," <![CDATA["+o.toDisplayString(m.node.__cdata)+"]]> ",5)])):d.value==="element"?(o.openBlock(),o.createElementBlock("div",Pt,[p.value?(o.openBlock(),o.createElementBlock("div",$t,[o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},"<",4),o.createElementVNode("span",{class:"xml-node__tag",style:o.normalizeStyle({color:m.theme.colors.xmlTag})},o.toDisplayString(n.value),5),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(T,$)=>(o.openBlock(),o.createElementBlock("span",{key:$,class:"xml-node__attribute"},[o.createElementVNode("span",{class:"xml-node__attr-name",style:o.normalizeStyle({color:m.theme.colors.xmlAttribute})},o.toDisplayString($),5),o.createElementVNode("span",{class:"xml-node__equals",style:o.normalizeStyle({color:m.theme.colors.xmlEquals})},"=",4),o.createElementVNode("span",{class:"xml-node__quote",style:o.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4),o.createElementVNode("span",{class:"xml-node__attr-value",style:o.normalizeStyle({color:m.theme.colors.xmlAttributeValue})},o.toDisplayString(T),5),o.createElementVNode("span",{class:"xml-node__quote",style:o.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4)]))),128)),o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4),o.createElementVNode("span",{class:"xml-node__cdata",style:o.normalizeStyle({color:m.theme.colors.xmlCdata})},"<![CDATA["+o.toDisplayString(h.value)+"]]>",5),o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},"</",4),o.createElementVNode("span",{class:"xml-node__tag",style:o.normalizeStyle({color:m.theme.colors.xmlTag})},o.toDisplayString(n.value),5),o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4)])):x.value?(o.openBlock(),o.createElementBlock("div",Vt,[o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},"<",4),o.createElementVNode("span",{class:"xml-node__tag",style:o.normalizeStyle({color:m.theme.colors.xmlTag})},o.toDisplayString(n.value),5),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(T,$)=>(o.openBlock(),o.createElementBlock("span",{key:$,class:"xml-node__attribute"},[o.createElementVNode("span",{class:"xml-node__attr-name",style:o.normalizeStyle({color:m.theme.colors.xmlAttribute})},o.toDisplayString($),5),o.createElementVNode("span",{class:"xml-node__equals",style:o.normalizeStyle({color:m.theme.colors.xmlEquals})},"=",4),o.createElementVNode("span",{class:"xml-node__quote",style:o.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4),o.createElementVNode("span",{class:"xml-node__attr-value",style:o.normalizeStyle({color:m.theme.colors.xmlAttributeValue})},o.toDisplayString(T),5),o.createElementVNode("span",{class:"xml-node__quote",style:o.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4)]))),128)),o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4),o.createElementVNode("span",{class:"xml-node__text-content",style:o.normalizeStyle({color:m.theme.colors.xmlText})},o.toDisplayString(k.value),5),o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},"</",4),o.createElementVNode("span",{class:"xml-node__tag",style:o.normalizeStyle({color:m.theme.colors.xmlTag})},o.toDisplayString(n.value),5),o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4)])):(o.openBlock(),o.createElementBlock("div",It,[!i.value&&N.value?(o.openBlock(),o.createElementBlock("div",vt,[o.createElementVNode("span",{class:"xml-node__clickable-part",onClick:g[0]||(g[0]=T=>O()),title:"Click to expand"},[o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},"<",4),o.createElementVNode("span",{class:"xml-node__tag",style:o.normalizeStyle({color:m.theme.colors.xmlTag})},o.toDisplayString(n.value),5)]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(T,$)=>(o.openBlock(),o.createElementBlock("span",{key:$,class:"xml-node__attribute"},[o.createElementVNode("span",{class:"xml-node__attr-name",style:o.normalizeStyle({color:m.theme.colors.xmlAttribute})},o.toDisplayString($),5),o.createElementVNode("span",{class:"xml-node__equals",style:o.normalizeStyle({color:m.theme.colors.xmlEquals})},"=",4),o.createElementVNode("span",{class:"xml-node__quote",style:o.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4),o.createElementVNode("span",{class:"xml-node__attr-value",style:o.normalizeStyle({color:m.theme.colors.xmlAttributeValue})},o.toDisplayString(T),5),o.createElementVNode("span",{class:"xml-node__quote",style:o.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4)]))),128)),o.createElementVNode("span",{class:"xml-node__clickable-part",onClick:g[1]||(g[1]=T=>O()),title:"Click to expand"},[o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4)]),o.createElementVNode("span",{class:"xml-node__collapsed-badge",style:o.normalizeStyle({backgroundColor:m.theme.colors.collapsedBackground,color:m.theme.colors.collapsedText}),onClick:g[2]||(g[2]=T=>O()),title:`Click to expand ${C.value} child element${C.value>1?"s":""}`},o.toDisplayString(C.value)+" child"+o.toDisplayString(C.value>1?"ren":""),13,Lt),o.createElementVNode("span",{class:"xml-node__clickable-part",onClick:g[3]||(g[3]=T=>O()),title:"Click to expand"},[o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},"</",4),o.createElementVNode("span",{class:"xml-node__tag",style:o.normalizeStyle({color:m.theme.colors.xmlTag})},o.toDisplayString(n.value),5),o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4)])])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("div",Rt,[N.value?(o.openBlock(),o.createElementBlock("span",{key:0,class:"xml-node__clickable-part",onClick:g[4]||(g[4]=T=>O()),title:i.value?"Click to collapse":"Click to expand"},[o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},"<",4),o.createElementVNode("span",{class:"xml-node__tag",style:o.normalizeStyle({color:m.theme.colors.xmlTag})},o.toDisplayString(n.value),5)],8,jt)):(o.openBlock(),o.createElementBlock("span",Mt,[o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},"<",4),o.createElementVNode("span",{class:"xml-node__tag",style:o.normalizeStyle({color:m.theme.colors.xmlTag})},o.toDisplayString(n.value),5)])),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(T,$)=>(o.openBlock(),o.createElementBlock("span",{key:$,class:"xml-node__attribute"},[o.createElementVNode("span",{class:"xml-node__attr-name",style:o.normalizeStyle({color:m.theme.colors.xmlAttribute})},o.toDisplayString($),5),o.createElementVNode("span",{class:"xml-node__equals",style:o.normalizeStyle({color:m.theme.colors.xmlEquals})},"=",4),o.createElementVNode("span",{class:"xml-node__quote",style:o.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4),o.createElementVNode("span",{class:"xml-node__attr-value",style:o.normalizeStyle({color:m.theme.colors.xmlAttributeValue})},o.toDisplayString(T),5),o.createElementVNode("span",{class:"xml-node__quote",style:o.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4)]))),128)),N.value?(o.openBlock(),o.createElementBlock("span",{key:2,class:"xml-node__clickable-part",onClick:g[5]||(g[5]=T=>O()),title:i.value?"Click to collapse":"Click to expand"},[o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4)],8,Ft)):(o.openBlock(),o.createElementBlock("span",{key:3,class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},o.toDisplayString(N.value?">":"/>"),5))]),i.value&&N.value?(o.openBlock(),o.createElementBlock("div",Ut,[c.value.length===0&&k.value.trim()?(o.openBlock(),o.createElementBlock("div",Xt,[o.createElementVNode("span",{class:"xml-node__text-content",style:o.normalizeStyle({color:m.theme.colors.xmlText})},o.toDisplayString(k.value),5)])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.value,(T,$)=>(o.openBlock(),o.createBlock(A,{key:R(T,$),node:T,index:$,level:m.level+1,"parent-path":z(),expanded:m.expanded,theme:m.theme,onToggleExpand:g[6]||(g[6]=j=>m.$emit("toggle-expand",j)),onCopy:g[7]||(g[7]=j=>m.$emit("copy",j))},null,8,["node","index","level","parent-path","expanded","theme"]))),128))])):o.createCommentVNode("",!0),i.value&&N.value?(o.openBlock(),o.createElementBlock("div",zt,[o.createElementVNode("span",{class:"xml-node__clickable-part",onClick:g[8]||(g[8]=T=>O()),title:"Click to collapse"},[o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},"</",4),o.createElementVNode("span",{class:"xml-node__tag",style:o.normalizeStyle({color:m.theme.colors.xmlTag})},o.toDisplayString(n.value),5),o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4)])])):o.createCommentVNode("",!0)],64))]))])):o.createCommentVNode("",!0)],4)}}}),[["__scopeId","data-v-afb7b2ab"]]),Ee={"github-light":{name:"github-light",colors:{background:"#ffffff",surfaceBackground:"#f6f8fa",border:"#d0d7de",text:"#24292f",textSecondary:"#57606a",buttonBackground:"#f6f8fa",buttonBackgroundHover:"#f3f4f6",buttonBorder:"#d0d7de",buttonText:"#24292f",buttonPrimary:"#1f883d",buttonPrimaryHover:"#1a7f37",success:"#1f883d",successBackground:"#dafbe1",error:"#cf222e",errorBackground:"#ffebe9",xmlTag:"#116329",xmlAttribute:"#0550ae",xmlAttributeValue:"#0a3069",xmlText:"#24292f",xmlComment:"#6e7781",xmlCdata:"#8250df",xmlDeclaration:"#953800",xmlBracket:"#6e7781",xmlEquals:"#6e7781",xmlQuote:"#0550ae",collapsedBackground:"#ddf4ff",collapsedText:"#0969da"}},"github-dark":{name:"github-dark",colors:{background:"#0d1117",surfaceBackground:"#161b22",border:"#30363d",text:"#c9d1d9",textSecondary:"#8b949e",buttonBackground:"#21262d",buttonBackgroundHover:"#30363d",buttonBorder:"#30363d",buttonText:"#c9d1d9",buttonPrimary:"#238636",buttonPrimaryHover:"#2ea043",success:"#3fb950",successBackground:"#0f2e1c",error:"#f85149",errorBackground:"#3d1319",xmlTag:"#7ee787",xmlAttribute:"#79c0ff",xmlAttributeValue:"#a5d6ff",xmlText:"#c9d1d9",xmlComment:"#8b949e",xmlCdata:"#d2a8ff",xmlDeclaration:"#ffa657",xmlBracket:"#8b949e",xmlEquals:"#8b949e",xmlQuote:"#79c0ff",collapsedBackground:"#1c2d41",collapsedText:"#58a6ff"}},"min-light":{name:"min-light",colors:{background:"#ffffff",surfaceBackground:"#fafafa",border:"#e5e5e5",text:"#171717",textSecondary:"#737373",buttonBackground:"#fafafa",buttonBackgroundHover:"#f5f5f5",buttonBorder:"#e5e5e5",buttonText:"#171717",buttonPrimary:"#22c55e",buttonPrimaryHover:"#16a34a",success:"#22c55e",successBackground:"#dcfce7",error:"#ef4444",errorBackground:"#fee2e2",xmlTag:"#16a34a",xmlAttribute:"#2563eb",xmlAttributeValue:"#1e40af",xmlText:"#171717",xmlComment:"#737373",xmlCdata:"#9333ea",xmlDeclaration:"#ea580c",xmlBracket:"#737373",xmlEquals:"#737373",xmlQuote:"#2563eb",collapsedBackground:"#dbeafe",collapsedText:"#1d4ed8"}},"slack-ochin":{name:"slack-ochin",colors:{background:"#fef5ed",surfaceBackground:"#fef9f3",border:"#e9dcc9",text:"#3d3c40",textSecondary:"#616061",buttonBackground:"#fef9f3",buttonBackgroundHover:"#f9f0e5",buttonBorder:"#e9dcc9",buttonText:"#3d3c40",buttonPrimary:"#007a5a",buttonPrimaryHover:"#006644",success:"#007a5a",successBackground:"#d1f4e0",error:"#e01e5a",errorBackground:"#ffdbea",xmlTag:"#007a5a",xmlAttribute:"#1264a3",xmlAttributeValue:"#0b4c8c",xmlText:"#3d3c40",xmlComment:"#616061",xmlCdata:"#8b2eff",xmlDeclaration:"#e8912d",xmlBracket:"#616061",xmlEquals:"#616061",xmlQuote:"#1264a3",collapsedBackground:"#d8eaf5",collapsedText:"#0b4c8c"}}},Kt=r=>Ee[r]||Ee["github-light"],_e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",qt=_e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Qt="["+_e+"]["+qt+"]*",Wt=new RegExp("^"+Qt+"$");function ke(r,e){const t=[];let s=e.exec(r);for(;s;){const n=[];n.startIndex=e.lastIndex-s[0].length;const l=s.length;for(let i=0;i<l;i++)n.push(s[i]);t.push(n),s=e.exec(r)}return t}const ie=function(r){const e=Wt.exec(r);return!(e===null||typeof e>"u")};function Yt(r){return typeof r<"u"}const Gt={allowBooleanAttributes:!1,unpairedTags:[]};function xe(r,e){e=Object.assign({},Gt,e);const t=[];let s=!1,n=!1;r[0]==="\uFEFF"&&(r=r.substr(1));for(let l=0;l<r.length;l++)if(r[l]==="<"&&r[l+1]==="?"){if(l+=2,l=Ae(r,l),l.err)return l}else if(r[l]==="<"){let i=l;if(l++,r[l]==="!"){l=Ce(r,l);continue}else{let d=!1;r[l]==="/"&&(d=!0,l++);let a="";for(;l<r.length&&r[l]!==">"&&r[l]!==" "&&r[l]!==" "&&r[l]!==`
9
- `&&r[l]!=="\r";l++)a+=r[l];if(a=a.trim(),a[a.length-1]==="/"&&(a=a.substring(0,a.length-1),l--),!or(a)){let h;return a.trim().length===0?h="Invalid space after '<'.":h="Tag '"+a+"' is an invalid name.",v("InvalidTag",h,M(r,l))}const c=Jt(r,l);if(c===!1)return v("InvalidAttr","Attributes for '"+a+"' have open quote.",M(r,l));let p=c.value;if(l=c.index,p[p.length-1]==="/"){const h=l-p.length;p=p.substring(0,p.length-1);const k=we(p,e);if(k===!0)s=!0;else return v(k.err.code,k.err.msg,M(r,h+k.err.line))}else if(d)if(c.tagClosed){if(p.trim().length>0)return v("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",M(r,i));if(t.length===0)return v("InvalidTag","Closing tag '"+a+"' has not been opened.",M(r,i));{const h=t.pop();if(a!==h.tagName){let k=M(r,h.tagStartPos);return v("InvalidTag","Expected closing tag '"+h.tagName+"' (opened in line "+k.line+", col "+k.col+") instead of closing tag '"+a+"'.",M(r,i))}t.length==0&&(n=!0)}}else return v("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",M(r,l));else{const h=we(p,e);if(h!==!0)return v(h.err.code,h.err.msg,M(r,l-p.length+h.err.line));if(n===!0)return v("InvalidXml","Multiple possible root nodes found.",M(r,l));e.unpairedTags.indexOf(a)!==-1||t.push({tagName:a,tagStartPos:i}),s=!0}for(l++;l<r.length;l++)if(r[l]==="<")if(r[l+1]==="!"){l++,l=Ce(r,l);continue}else if(r[l+1]==="?"){if(l=Ae(r,++l),l.err)return l}else break;else if(r[l]==="&"){const h=rr(r,l);if(h==-1)return v("InvalidChar","char '&' is not expected.",M(r,l));l=h}else if(n===!0&&!Ne(r[l]))return v("InvalidXml","Extra text at the end",M(r,l));r[l]==="<"&&l--}}else{if(Ne(r[l]))continue;return v("InvalidChar","char '"+r[l]+"' is not expected.",M(r,l))}if(s){if(t.length==1)return v("InvalidTag","Unclosed tag '"+t[0].tagName+"'.",M(r,t[0].tagStartPos));if(t.length>0)return v("InvalidXml","Invalid '"+JSON.stringify(t.map(l=>l.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return v("InvalidXml","Start tag expected.",1);return!0}function Ne(r){return r===" "||r===" "||r===`
10
- `||r==="\r"}function Ae(r,e){const t=e;for(;e<r.length;e++)if(r[e]=="?"||r[e]==" "){const s=r.substr(t,e-t);if(e>5&&s==="xml")return v("InvalidXml","XML declaration allowed only at the start of the document.",M(r,e));if(r[e]=="?"&&r[e+1]==">"){e++;break}else continue}return e}function Ce(r,e){if(r.length>e+5&&r[e+1]==="-"&&r[e+2]==="-"){for(e+=3;e<r.length;e++)if(r[e]==="-"&&r[e+1]==="-"&&r[e+2]===">"){e+=2;break}}else if(r.length>e+8&&r[e+1]==="D"&&r[e+2]==="O"&&r[e+3]==="C"&&r[e+4]==="T"&&r[e+5]==="Y"&&r[e+6]==="P"&&r[e+7]==="E"){let t=1;for(e+=8;e<r.length;e++)if(r[e]==="<")t++;else if(r[e]===">"&&(t--,t===0))break}else if(r.length>e+9&&r[e+1]==="["&&r[e+2]==="C"&&r[e+3]==="D"&&r[e+4]==="A"&&r[e+5]==="T"&&r[e+6]==="A"&&r[e+7]==="["){for(e+=8;e<r.length;e++)if(r[e]==="]"&&r[e+1]==="]"&&r[e+2]===">"){e+=2;break}}return e}const Zt='"',Dt="'";function Jt(r,e){let t="",s="",n=!1;for(;e<r.length;e++){if(r[e]===Zt||r[e]===Dt)s===""?s=r[e]:s!==r[e]||(s="");else if(r[e]===">"&&s===""){n=!0;break}t+=r[e]}return s!==""?!1:{value:t,index:e,tagClosed:n}}const er=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function we(r,e){const t=ke(r,er),s={};for(let n=0;n<t.length;n++){if(t[n][1].length===0)return v("InvalidAttr","Attribute '"+t[n][2]+"' has no space in starting.",oe(t[n]));if(t[n][3]!==void 0&&t[n][4]===void 0)return v("InvalidAttr","Attribute '"+t[n][2]+"' is without value.",oe(t[n]));if(t[n][3]===void 0&&!e.allowBooleanAttributes)return v("InvalidAttr","boolean attribute '"+t[n][2]+"' is not allowed.",oe(t[n]));const l=t[n][2];if(!nr(l))return v("InvalidAttr","Attribute '"+l+"' is an invalid name.",oe(t[n]));if(!s.hasOwnProperty(l))s[l]=1;else return v("InvalidAttr","Attribute '"+l+"' is repeated.",oe(t[n]))}return!0}function tr(r,e){let t=/\d/;for(r[e]==="x"&&(e++,t=/[\da-fA-F]/);e<r.length;e++){if(r[e]===";")return e;if(!r[e].match(t))break}return-1}function rr(r,e){if(e++,r[e]===";")return-1;if(r[e]==="#")return e++,tr(r,e);let t=0;for(;e<r.length;e++,t++)if(!(r[e].match(/\w/)&&t<20)){if(r[e]===";")break;return-1}return e}function v(r,e,t){return{err:{code:r,msg:e,line:t.line||t,col:t.col}}}function nr(r){return ie(r)}function or(r){return ie(r)}function M(r,e){const t=r.substring(0,e).split(/\r?\n/);return{line:t.length,col:t[t.length-1].length+1}}function oe(r){return r.startIndex+r[1].length}const sr={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(r,e){return e},attributeValueProcessor:function(r,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(r,e,t){return r},captureMetaData:!1},lr=function(r){return Object.assign({},sr,r)};let ae;typeof Symbol!="function"?ae="@@xmlMetadata":ae=Symbol("XML Node Metadata");class Z{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e,t){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][ae]={startIndex:t})}static getMetaDataSymbol(){return ae}}class ir{constructor(e){this.suppressValidationErr=!e}readDocType(e,t){const s={};if(e[t+3]==="O"&&e[t+4]==="C"&&e[t+5]==="T"&&e[t+6]==="Y"&&e[t+7]==="P"&&e[t+8]==="E"){t=t+9;let n=1,l=!1,i=!1,d="";for(;t<e.length;t++)if(e[t]==="<"&&!i){if(l&&D(e,"!ENTITY",t)){t+=7;let a,c;[a,c,t]=this.readEntityExp(e,t+1,this.suppressValidationErr),c.indexOf("&")===-1&&(s[a]={regx:RegExp(`&${a};`,"g"),val:c})}else if(l&&D(e,"!ELEMENT",t)){t+=8;const{index:a}=this.readElementExp(e,t+1);t=a}else if(l&&D(e,"!ATTLIST",t))t+=8;else if(l&&D(e,"!NOTATION",t)){t+=9;const{index:a}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=a}else if(D(e,"!--",t))i=!0;else throw new Error("Invalid DOCTYPE");n++,d=""}else if(e[t]===">"){if(i?e[t-1]==="-"&&e[t-2]==="-"&&(i=!1,n--):n--,n===0)break}else e[t]==="["?l=!0:d+=e[t];if(n!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:s,i:t}}readEntityExp(e,t){t=U(e,t);let s="";for(;t<e.length&&!/\s/.test(e[t])&&e[t]!=='"'&&e[t]!=="'";)s+=e[t],t++;if(se(s),t=U(e,t),!this.suppressValidationErr){if(e.substring(t,t+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(e[t]==="%")throw new Error("Parameter entities are not supported")}let n="";return[t,n]=this.readIdentifierVal(e,t,"entity"),t--,[s,n,t]}readNotationExp(e,t){t=U(e,t);let s="";for(;t<e.length&&!/\s/.test(e[t]);)s+=e[t],t++;!this.suppressValidationErr&&se(s),t=U(e,t);const n=e.substring(t,t+6).toUpperCase();if(!this.suppressValidationErr&&n!=="SYSTEM"&&n!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${n}"`);t+=n.length,t=U(e,t);let l=null,i=null;if(n==="PUBLIC")[t,l]=this.readIdentifierVal(e,t,"publicIdentifier"),t=U(e,t),(e[t]==='"'||e[t]==="'")&&([t,i]=this.readIdentifierVal(e,t,"systemIdentifier"));else if(n==="SYSTEM"&&([t,i]=this.readIdentifierVal(e,t,"systemIdentifier"),!this.suppressValidationErr&&!i))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:s,publicIdentifier:l,systemIdentifier:i,index:--t}}readIdentifierVal(e,t,s){let n="";const l=e[t];if(l!=='"'&&l!=="'")throw new Error(`Expected quoted string, found "${l}"`);for(t++;t<e.length&&e[t]!==l;)n+=e[t],t++;if(e[t]!==l)throw new Error(`Unterminated ${s} value`);return t++,[t,n]}readElementExp(e,t){t=U(e,t);let s="";for(;t<e.length&&!/\s/.test(e[t]);)s+=e[t],t++;if(!this.suppressValidationErr&&!ie(s))throw new Error(`Invalid element name: "${s}"`);t=U(e,t);let n="";if(e[t]==="E"&&D(e,"MPTY",t))t+=4;else if(e[t]==="A"&&D(e,"NY",t))t+=2;else if(e[t]==="("){for(t++;t<e.length&&e[t]!==")";)n+=e[t],t++;if(e[t]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${e[t]}"`);return{elementName:s,contentModel:n.trim(),index:t}}readAttlistExp(e,t){t=U(e,t);let s="";for(;t<e.length&&!/\s/.test(e[t]);)s+=e[t],t++;se(s),t=U(e,t);let n="";for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;if(!se(n))throw new Error(`Invalid attribute name: "${n}"`);t=U(e,t);let l="";if(e.substring(t,t+8).toUpperCase()==="NOTATION"){if(l="NOTATION",t+=8,t=U(e,t),e[t]!=="(")throw new Error(`Expected '(', found "${e[t]}"`);t++;let d=[];for(;t<e.length&&e[t]!==")";){let a="";for(;t<e.length&&e[t]!=="|"&&e[t]!==")";)a+=e[t],t++;if(a=a.trim(),!se(a))throw new Error(`Invalid notation name: "${a}"`);d.push(a),e[t]==="|"&&(t++,t=U(e,t))}if(e[t]!==")")throw new Error("Unterminated list of notations");t++,l+=" ("+d.join("|")+")"}else{for(;t<e.length&&!/\s/.test(e[t]);)l+=e[t],t++;const d=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!d.includes(l.toUpperCase()))throw new Error(`Invalid attribute type: "${l}"`)}t=U(e,t);let i="";return e.substring(t,t+8).toUpperCase()==="#REQUIRED"?(i="#REQUIRED",t+=8):e.substring(t,t+7).toUpperCase()==="#IMPLIED"?(i="#IMPLIED",t+=7):[t,i]=this.readIdentifierVal(e,t,"ATTLIST"),{elementName:s,attributeName:n,attributeType:l,defaultValue:i,index:t}}}const U=(r,e)=>{for(;e<r.length&&/\s/.test(r[e]);)e++;return e};function D(r,e,t){for(let s=0;s<e.length;s++)if(e[s]!==r[t+s+1])return!1;return!0}function se(r){if(ie(r))return r;throw new Error(`Invalid entity name ${r}`)}const ar=/^[-+]?0x[a-fA-F0-9]+$/,cr=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,dr={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function ur(r,e={}){if(e=Object.assign({},dr,e),!r||typeof r!="string")return r;let t=r.trim();if(e.skipLike!==void 0&&e.skipLike.test(t))return r;if(r==="0")return 0;if(e.hex&&ar.test(t))return mr(t,16);if(t.search(/.+[eE].+/)!==-1)return hr(r,t,e);{const s=cr.exec(t);if(s){const n=s[1]||"",l=s[2];let i=pr(s[3]);const d=n?r[l.length+1]===".":r[l.length]===".";if(!e.leadingZeros&&(l.length>1||l.length===1&&!d))return r;{const a=Number(t),c=String(a);if(a===0)return a;if(c.search(/[eE]/)!==-1)return e.eNotation?a:r;if(t.indexOf(".")!==-1)return c==="0"||c===i||c===`${n}${i}`?a:r;let p=l?i:t;return l?p===c||n+p===c?a:r:p===c||p===n+c?a:r}}else return r}}const fr=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function hr(r,e,t){if(!t.eNotation)return r;const s=e.match(fr);if(s){let n=s[1]||"";const l=s[3].indexOf("e")===-1?"E":"e",i=s[2],d=n?r[i.length+1]===l:r[i.length]===l;return i.length>1&&d?r:i.length===1&&(s[3].startsWith(`.${l}`)||s[3][0]===l)?Number(e):t.leadingZeros&&!d?(e=(s[1]||"")+s[3],Number(e)):r}else return r}function pr(r){return r&&r.indexOf(".")!==-1&&(r=r.replace(/0+$/,""),r==="."?r="0":r[0]==="."?r="0"+r:r[r.length-1]==="."&&(r=r.substring(0,r.length-1))),r}function mr(r,e){if(parseInt)return parseInt(r,e);if(Number.parseInt)return Number.parseInt(r,e);if(window&&window.parseInt)return window.parseInt(r,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function Be(r){return typeof r=="function"?r:Array.isArray(r)?e=>{for(const t of r)if(typeof t=="string"&&e===t||t instanceof RegExp&&t.test(e))return!0}:()=>!1}class gr{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,s)=>String.fromCodePoint(Number.parseInt(s,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,s)=>String.fromCodePoint(Number.parseInt(s,16))}},this.addExternalEntities=yr,this.parseXml=xr,this.parseTextData=br,this.resolveNameSpace=Er,this.buildAttributesMap=kr,this.isItStopNode=wr,this.replaceEntitiesValue=Ar,this.readStopNodeData=Tr,this.saveTextToParentTag=Cr,this.addChild=Nr,this.ignoreAttributesFn=Be(this.options.ignoreAttributes)}}function yr(r){const e=Object.keys(r);for(let t=0;t<e.length;t++){const s=e[t];this.lastEntities[s]={regex:new RegExp("&"+s+";","g"),val:r[s]}}}function br(r,e,t,s,n,l,i){if(r!==void 0&&(this.options.trimValues&&!s&&(r=r.trim()),r.length>0)){i||(r=this.replaceEntitiesValue(r));const d=this.options.tagValueProcessor(e,r,t,n,l);return d==null?r:typeof d!=typeof r||d!==r?d:this.options.trimValues?he(r,this.options.parseTagValue,this.options.numberParseOptions):r.trim()===r?he(r,this.options.parseTagValue,this.options.numberParseOptions):r}}function Er(r){if(this.options.removeNSPrefix){const e=r.split(":"),t=r.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(r=t+e[1])}return r}const _r=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function kr(r,e,t){if(this.options.ignoreAttributes!==!0&&typeof r=="string"){const s=ke(r,_r),n=s.length,l={};for(let i=0;i<n;i++){const d=this.resolveNameSpace(s[i][1]);if(this.ignoreAttributesFn(d,e))continue;let a=s[i][4],c=this.options.attributeNamePrefix+d;if(d.length)if(this.options.transformAttributeName&&(c=this.options.transformAttributeName(c)),c==="__proto__"&&(c="#__proto__"),a!==void 0){this.options.trimValues&&(a=a.trim()),a=this.replaceEntitiesValue(a);const p=this.options.attributeValueProcessor(d,a,e);p==null?l[c]=a:typeof p!=typeof a||p!==a?l[c]=p:l[c]=he(a,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(l[c]=!0)}if(!Object.keys(l).length)return;if(this.options.attributesGroupName){const i={};return i[this.options.attributesGroupName]=l,i}return l}}const xr=function(r){r=r.replace(/\r\n?/g,`
11
- `);const e=new Z("!xml");let t=e,s="",n="";const l=new ir(this.options.processEntities);for(let i=0;i<r.length;i++)if(r[i]==="<")if(r[i+1]==="/"){const a=J(r,">",i,"Closing Tag is not closed.");let c=r.substring(i+2,a).trim();if(this.options.removeNSPrefix){const k=c.indexOf(":");k!==-1&&(c=c.substr(k+1))}this.options.transformTagName&&(c=this.options.transformTagName(c)),t&&(s=this.saveTextToParentTag(s,t,n));const p=n.substring(n.lastIndexOf(".")+1);if(c&&this.options.unpairedTags.indexOf(c)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${c}>`);let h=0;p&&this.options.unpairedTags.indexOf(p)!==-1?(h=n.lastIndexOf(".",n.lastIndexOf(".")-1),this.tagsNodeStack.pop()):h=n.lastIndexOf("."),n=n.substring(0,h),t=this.tagsNodeStack.pop(),s="",i=a}else if(r[i+1]==="?"){let a=fe(r,i,!1,"?>");if(!a)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,t,n),!(this.options.ignoreDeclaration&&a.tagName==="?xml"||this.options.ignorePiTags)){const c=new Z(a.tagName);c.add(this.options.textNodeName,""),a.tagName!==a.tagExp&&a.attrExpPresent&&(c[":@"]=this.buildAttributesMap(a.tagExp,n,a.tagName)),this.addChild(t,c,n,i)}i=a.closeIndex+1}else if(r.substr(i+1,3)==="!--"){const a=J(r,"-->",i+4,"Comment is not closed.");if(this.options.commentPropName){const c=r.substring(i+4,a-2);s=this.saveTextToParentTag(s,t,n),t.add(this.options.commentPropName,[{[this.options.textNodeName]:c}])}i=a}else if(r.substr(i+1,2)==="!D"){const a=l.readDocType(r,i);this.docTypeEntities=a.entities,i=a.i}else if(r.substr(i+1,2)==="!["){const a=J(r,"]]>",i,"CDATA is not closed.")-2,c=r.substring(i+9,a);s=this.saveTextToParentTag(s,t,n);let p=this.parseTextData(c,t.tagname,n,!0,!1,!0,!0);p==null&&(p=""),this.options.cdataPropName?t.add(this.options.cdataPropName,[{[this.options.textNodeName]:c}]):t.add(this.options.textNodeName,p),i=a+2}else{let a=fe(r,i,this.options.removeNSPrefix),c=a.tagName;const p=a.rawTagName;let h=a.tagExp,k=a.attrExpPresent,_=a.closeIndex;this.options.transformTagName&&(c=this.options.transformTagName(c)),t&&s&&t.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,t,n,!1));const N=t;N&&this.options.unpairedTags.indexOf(N.tagname)!==-1&&(t=this.tagsNodeStack.pop(),n=n.substring(0,n.lastIndexOf("."))),c!==e.tagname&&(n+=n?"."+c:c);const C=i;if(this.isItStopNode(this.options.stopNodes,n,c)){let x="";if(h.length>0&&h.lastIndexOf("/")===h.length-1)c[c.length-1]==="/"?(c=c.substr(0,c.length-1),n=n.substr(0,n.length-1),h=c):h=h.substr(0,h.length-1),i=a.closeIndex;else if(this.options.unpairedTags.indexOf(c)!==-1)i=a.closeIndex;else{const R=this.readStopNodeData(r,p,_+1);if(!R)throw new Error(`Unexpected end of ${p}`);i=R.i,x=R.tagContent}const O=new Z(c);c!==h&&k&&(O[":@"]=this.buildAttributesMap(h,n,c)),x&&(x=this.parseTextData(x,c,n,!0,k,!0,!0)),n=n.substr(0,n.lastIndexOf(".")),O.add(this.options.textNodeName,x),this.addChild(t,O,n,C)}else{if(h.length>0&&h.lastIndexOf("/")===h.length-1){c[c.length-1]==="/"?(c=c.substr(0,c.length-1),n=n.substr(0,n.length-1),h=c):h=h.substr(0,h.length-1),this.options.transformTagName&&(c=this.options.transformTagName(c));const x=new Z(c);c!==h&&k&&(x[":@"]=this.buildAttributesMap(h,n,c)),this.addChild(t,x,n,C),n=n.substr(0,n.lastIndexOf("."))}else{const x=new Z(c);this.tagsNodeStack.push(t),c!==h&&k&&(x[":@"]=this.buildAttributesMap(h,n,c)),this.addChild(t,x,n,C),t=x}s="",i=_}}else s+=r[i];return e.child};function Nr(r,e,t,s){this.options.captureMetaData||(s=void 0);const n=this.options.updateTag(e.tagname,t,e[":@"]);n===!1||(typeof n=="string"&&(e.tagname=n),r.addChild(e,s))}const Ar=function(r){if(this.options.processEntities){for(let e in this.docTypeEntities){const t=this.docTypeEntities[e];r=r.replace(t.regx,t.val)}for(let e in this.lastEntities){const t=this.lastEntities[e];r=r.replace(t.regex,t.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const t=this.htmlEntities[e];r=r.replace(t.regex,t.val)}r=r.replace(this.ampEntity.regex,this.ampEntity.val)}return r};function Cr(r,e,t,s){return r&&(s===void 0&&(s=e.child.length===0),r=this.parseTextData(r,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,s),r!==void 0&&r!==""&&e.add(this.options.textNodeName,r),r=""),r}function wr(r,e,t){const s="*."+t;for(const n in r){const l=r[n];if(s===l||e===l)return!0}return!1}function Br(r,e,t=">"){let s,n="";for(let l=e;l<r.length;l++){let i=r[l];if(s)i===s&&(s="");else if(i==='"'||i==="'")s=i;else if(i===t[0])if(t[1]){if(r[l+1]===t[1])return{data:n,index:l}}else return{data:n,index:l};else i===" "&&(i=" ");n+=i}}function J(r,e,t,s){const n=r.indexOf(e,t);if(n===-1)throw new Error(s);return n+e.length-1}function fe(r,e,t,s=">"){const n=Br(r,e+1,s);if(!n)return;let l=n.data;const i=n.index,d=l.search(/\s/);let a=l,c=!0;d!==-1&&(a=l.substring(0,d),l=l.substring(d+1).trimStart());const p=a;if(t){const h=a.indexOf(":");h!==-1&&(a=a.substr(h+1),c=a!==n.data.substr(h+1))}return{tagName:a,tagExp:l,closeIndex:i,attrExpPresent:c,rawTagName:p}}function Tr(r,e,t){const s=t;let n=1;for(;t<r.length;t++)if(r[t]==="<")if(r[t+1]==="/"){const l=J(r,">",t,`${e} is not closed`);if(r.substring(t+2,l).trim()===e&&(n--,n===0))return{tagContent:r.substring(s,t),i:l};t=l}else if(r[t+1]==="?")t=J(r,"?>",t+1,"StopNode is not closed.");else if(r.substr(t+1,3)==="!--")t=J(r,"-->",t+3,"StopNode is not closed.");else if(r.substr(t+1,2)==="![")t=J(r,"]]>",t,"StopNode is not closed.")-2;else{const l=fe(r,t,">");l&&((l&&l.tagName)===e&&l.tagExp[l.tagExp.length-1]!=="/"&&n++,t=l.closeIndex)}}function he(r,e,t){if(e&&typeof r=="string"){const s=r.trim();return s==="true"?!0:s==="false"?!1:ur(r,t)}else return Yt(r)?r:""}const pe=Z.getMetaDataSymbol();function Or(r,e){return Te(r,e)}function Te(r,e,t){let s;const n={};for(let l=0;l<r.length;l++){const i=r[l],d=Sr(i);let a="";if(t===void 0?a=d:a=t+"."+d,d===e.textNodeName)s===void 0?s=i[d]:s+=""+i[d];else{if(d===void 0)continue;if(i[d]){let c=Te(i[d],e,a);const p=$r(c,e);i[pe]!==void 0&&(c[pe]=i[pe]),i[":@"]?Pr(c,i[":@"],a,e):Object.keys(c).length===1&&c[e.textNodeName]!==void 0&&!e.alwaysCreateTextNode?c=c[e.textNodeName]:Object.keys(c).length===0&&(e.alwaysCreateTextNode?c[e.textNodeName]="":c=""),n[d]!==void 0&&n.hasOwnProperty(d)?(Array.isArray(n[d])||(n[d]=[n[d]]),n[d].push(c)):e.isArray(d,a,p)?n[d]=[c]:n[d]=c}}}return typeof s=="string"?s.length>0&&(n[e.textNodeName]=s):s!==void 0&&(n[e.textNodeName]=s),n}function Sr(r){const e=Object.keys(r);for(let t=0;t<e.length;t++){const s=e[t];if(s!==":@")return s}}function Pr(r,e,t,s){if(e){const n=Object.keys(e),l=n.length;for(let i=0;i<l;i++){const d=n[i];s.isArray(d,t+"."+d,!0,!0)?r[d]=[e[d]]:r[d]=e[d]}}}function $r(r,e){const{textNodeName:t}=e,s=Object.keys(r).length;return!!(s===0||s===1&&(r[t]||typeof r[t]=="boolean"||r[t]===0))}class Vr{constructor(e){this.externalEntities={},this.options=lr(e)}parse(e,t){if(typeof e!="string"&&e.toString)e=e.toString();else if(typeof e!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(t){t===!0&&(t={});const l=xe(e,t);if(l!==!0)throw Error(`${l.err.msg}:${l.err.line}:${l.err.col}`)}const s=new gr(this.options);s.addExternalEntities(this.externalEntities);const n=s.parseXml(e);return this.options.preserveOrder||n===void 0?n:Or(n,this.options)}addEntity(e,t){if(t.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(e.indexOf("&")!==-1||e.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(t==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}static getMetaDataSymbol(){return Z.getMetaDataSymbol()}}const Ir=`
12
- `;function vr(r,e){let t="";return e.format&&e.indentBy.length>0&&(t=Ir),Oe(r,e,"",t)}function Oe(r,e,t,s){let n="",l=!1;for(let i=0;i<r.length;i++){const d=r[i],a=Lr(d);if(a===void 0)continue;let c="";if(t.length===0?c=a:c=`${t}.${a}`,a===e.textNodeName){let N=d[a];Rr(c,e)||(N=e.tagValueProcessor(a,N),N=Pe(N,e)),l&&(n+=s),n+=N,l=!1;continue}else if(a===e.cdataPropName){l&&(n+=s),n+=`<![CDATA[${d[a][0][e.textNodeName]}]]>`,l=!1;continue}else if(a===e.commentPropName){n+=s+`<!--${d[a][0][e.textNodeName]}-->`,l=!0;continue}else if(a[0]==="?"){const N=Se(d[":@"],e),C=a==="?xml"?"":s;let x=d[a][0][e.textNodeName];x=x.length!==0?" "+x:"",n+=C+`<${a}${x}${N}?>`,l=!0;continue}let p=s;p!==""&&(p+=e.indentBy);const h=Se(d[":@"],e),k=s+`<${a}${h}`,_=Oe(d[a],e,c,p);e.unpairedTags.indexOf(a)!==-1?e.suppressUnpairedNode?n+=k+">":n+=k+"/>":(!_||_.length===0)&&e.suppressEmptyNode?n+=k+"/>":_&&_.endsWith(">")?n+=k+`>${_}${s}</${a}>`:(n+=k+">",_&&s!==""&&(_.includes("/>")||_.includes("</"))?n+=s+e.indentBy+_+s:n+=_,n+=`</${a}>`),l=!0}return n}function Lr(r){const e=Object.keys(r);for(let t=0;t<e.length;t++){const s=e[t];if(r.hasOwnProperty(s)&&s!==":@")return s}}function Se(r,e){let t="";if(r&&!e.ignoreAttributes)for(let s in r){if(!r.hasOwnProperty(s))continue;let n=e.attributeValueProcessor(s,r[s]);n=Pe(n,e),n===!0&&e.suppressBooleanAttributes?t+=` ${s.substr(e.attributeNamePrefix.length)}`:t+=` ${s.substr(e.attributeNamePrefix.length)}="${n}"`}return t}function Rr(r,e){r=r.substr(0,r.length-e.textNodeName.length-1);let t=r.substr(r.lastIndexOf(".")+1);for(let s in e.stopNodes)if(e.stopNodes[s]===r||e.stopNodes[s]==="*."+t)return!0;return!1}function Pe(r,e){if(r&&r.length>0&&e.processEntities)for(let t=0;t<e.entities.length;t++){const s=e.entities[t];r=r.replace(s.regex,s.val)}return r}const jr={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(r,e){return e},attributeValueProcessor:function(r,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function G(r){this.options=Object.assign({},jr,r),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Be(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Ur),this.processTextOrObjNode=Mr,this.options.format?(this.indentate=Fr,this.tagEndChar=`>
8
+ `)(l.value),a.value=b;else throw new Error(`Unsupported filter type: ${h.type}`);c.value="",r.nextTick(()=>{X()})}catch(b){c.value=b instanceof Error?b.message:"Filter execution error",a.value=null}},S=()=>{a.value=null,c.value=""};r.watch(()=>s.modelValue,h=>{E(h)},{immediate:!0});const _=(h,b,u)=>{const y=A=>{if(A===null||typeof A!="object")return A;if(!Array.isArray(A)&&"__protected_number__"in A&&Object.keys(A).length===1)return`__PROTECTED_NUMBER_${A.__protected_number__}_PROTECTED_NUMBER__`;if(Array.isArray(A))return A.map(K=>y(K));const V={};for(const[K,W]of Object.entries(A))V[K]=y(W);return V},k=y(h);return JSON.stringify(k,b,u).replace(/"__PROTECTED_NUMBER_(.+?)_PROTECTED_NUMBER__"/g,"$1")},I=(h,b)=>{if(!s.readonly)try{const u=U(l.value,h,b),y=_(u,null,2);o("update:modelValue",y)}catch(u){console.error("Failed to update JSON:",u)}},U=(h,b,u)=>{if(!b||b==="root")return u;const y=b.split("."),k=P(h,y.slice(0,-1));let w=k;for(let V=0;V<y.length-1;V++){const K=y[V];K!=="root"&&(Array.isArray(w)?w=w[parseInt(K)]:w=w[K])}const A=y[y.length-1];return A==="root"?u:(Array.isArray(w)?w[parseInt(A)]=u:w[A]=u,k)},H=h=>{d.value.has(h)?d.value.delete(h):d.value.add(h)},X=()=>{const h=new Set,b=(u,y="")=>{u!==null&&typeof u=="object"&&(h.add(y||"root"),Array.isArray(u)?u.forEach((k,w)=>{const A=y?`${y}.${w}`:`${w}`;b(k,A)}):Object.keys(u).forEach(k=>{const w=y?`${y}.${k}`:k;b(u[k],w)}))};b(x.value),d.value=h,o("expand-all")},Z=()=>{d.value=new Set(["root"]),o("collapse-all")},ee=async()=>{if(g.value)try{const h=x.value,b=_(h,null,2);await navigator.clipboard.writeText(b),o("copy-success",b)}catch(h){console.error("Failed to copy JSON:",h),o("copy-error",h instanceof Error?h:new Error("Failed to copy JSON"))}},le=()=>{if(g.value)try{const h=x.value,b=_(h);o("update:modelValue",b),o("compress",b)}catch(h){console.error("Failed to compress JSON:",h)}},D=async h=>{try{let b;typeof h=="object"&&h!==null&&!Array.isArray(h)&&"__protected_number__"in h&&Object.keys(h).length===1?b=h.__protected_number__:typeof h=="string"?b=`"${h}"`:b=JSON.stringify(h),await navigator.clipboard.writeText(b)}catch(b){console.error("Failed to copy value:",b)}},N=(h,b)=>{if(!s.readonly)try{const u=B(l.value,h,b),y=_(u,null,2);o("update:modelValue",y),j(h,b)}catch(u){console.error("Failed to rename key:",u)}},B=(h,b,u)=>{if(!b||b==="root")return h;const y=b.split("."),k=P(h,y.slice(0,-1));if(y.length===1){const V=y[0];return k&&typeof k=="object"&&!Array.isArray(k)?$(k,V,u):k}let w=k;for(let V=0;V<y.length-1;V++){const K=y[V];Array.isArray(w)?w=w[parseInt(K)]:w=w[K]}const A=y[y.length-1];if(!Array.isArray(w)&&w&&typeof w=="object"){const V=$(w,A,u),K=y.slice(0,-1);K.length>0&&T(k,K,V)}return k},P=(h,b)=>{if(b.length===0)return h;if(Array.isArray(h)){const u=[...h],y=b[0],k=parseInt(y);return b.length===1||(u[k]=P(h[k],b.slice(1))),u}else if(h&&typeof h=="object"){const u={...h},y=b[0];return b.length===1||(u[y]=P(h[y],b.slice(1))),u}return h},$=(h,b,u)=>{if(!h||typeof h!="object"||Array.isArray(h))return h;const y=Object.keys(h),k={};for(const w of y)w===b?k[u]=h[w]:k[w]=h[w];return k},T=(h,b,u)=>{let y=h;for(let w=0;w<b.length-1;w++){const A=b[w];Array.isArray(y)?y=y[parseInt(A)]:y=y[A]}const k=b[b.length-1];Array.isArray(y)?y[parseInt(k)]=u:y[k]=u},j=(h,b)=>{const u=new Set;d.value.forEach(y=>{if(y===h){const k=h.split(".");k[k.length-1]=b,u.add(k.join("."))}else if(y.startsWith(h+".")){const k=h.split(".");k[k.length-1]=b;const w=k.join("."),A=y.substring(h.length);u.add(w+A)}else u.add(y)}),d.value=u};return e({copyJson:ee,compressSource:le,expandAll:X,collapseAll:Z,toggleExpand:H,updateValue:I,updateKey:N,filter:v,clearFilter:S,isValidJson:()=>g.value,getParsedJson:()=>l.value,getFilteredJson:()=>a.value,getExpandedNodes:()=>d.value,getParseError:()=>i.value,getFilterError:()=>c.value,parseJson:h=>E(h),copyValue:h=>D(h)}),(h,b)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["json-format",`json-format--${p.value.name}`])},[h.showToolbar?(r.openBlock(),r.createElementBlock("div",At,[r.createElementVNode("div",Ct,[r.createElementVNode("button",{class:"json-format__btn json-format__btn--primary",onClick:ee,disabled:!g.value,title:"Copy JSON"}," 📋 Copy ",8,Bt),r.createElementVNode("button",{class:"json-format__btn json-format__btn--secondary",onClick:X,disabled:!g.value,title:"Expand All"}," ⬇️ Expand All ",8,Tt),r.createElementVNode("button",{class:"json-format__btn json-format__btn--secondary",onClick:Z,disabled:!g.value,title:"Collapse All"}," ➡️ Collapse All ",8,vt),r.createElementVNode("button",{class:"json-format__btn json-format__btn--secondary",onClick:le,disabled:!g.value,title:"Compress JSON"}," 📦 Compress ",8,St)]),r.createElementVNode("div",Ot,[g.value?(r.openBlock(),r.createElementBlock("span",$t," ✅ Valid JSON ")):(r.openBlock(),r.createElementBlock("span",Pt," ❌ Invalid JSON "))])])):r.createCommentVNode("",!0),r.createElementVNode("div",Vt,[g.value?c.value?(r.openBlock(),r.createElementBlock("div",Rt,[b[1]||(b[1]=r.createElementVNode("h4",null,"Filter Error:",-1)),r.createElementVNode("pre",null,r.toDisplayString(c.value),1)])):(r.openBlock(),r.createElementBlock("div",Lt,[r.createVNode(kt,{value:x.value,"key-name":"",level:0,expanded:d.value,"is-last":!0,theme:p.value,"onUpdate:value":I,onToggleExpand:H,onCopy:D,"onUpdate:key":N},null,8,["value","expanded","theme"])])):(r.openBlock(),r.createElementBlock("div",It,[b[0]||(b[0]=r.createElementVNode("h4",null,"JSON Parse Error:",-1)),r.createElementVNode("pre",null,r.toDisplayString(i.value),1)]))])],2))}}),[["__scopeId","data-v-b956002c"]]),Mt={key:0,class:"xml-node__comment"},Kt={key:1,class:"xml-node__cdata"},jt={key:2,class:"xml-node__element"},Ut={key:0,class:"xml-node__line"},Ft=["contenteditable","onKeydown"],Xt=["contenteditable","onDblclick","onKeydown"],zt=["contenteditable","onDblclick","onKeydown"],Ht={key:1,class:"xml-node__line"},qt=["contenteditable","onKeydown"],Wt=["contenteditable","onDblclick","onKeydown"],Qt=["contenteditable","onDblclick","onKeydown"],Yt=["contenteditable","onKeydown"],Dt={key:2},Gt={key:0,class:"xml-node__line"},Zt=["contenteditable","onKeydown"],Jt=["contenteditable","onDblclick","onKeydown"],en=["contenteditable","onDblclick","onKeydown"],tn=["title"],nn={class:"xml-node__line"},rn=["title"],on=["contenteditable","onKeydown"],sn={key:1},ln=["contenteditable","onKeydown"],an=["contenteditable","onDblclick","onKeydown"],cn=["contenteditable","onDblclick","onKeydown"],dn=["title"],un={key:0,class:"xml-node__children"},fn={key:0,class:"xml-node__text"},hn=["contenteditable","onKeydown"],pn={key:1,class:"xml-node__line"},mn=ge(r.defineComponent({__name:"XmlNode",props:{node:{},index:{},level:{default:0},parentPath:{default:""},expanded:{},theme:{}},emits:["toggle-expand","copy","update:tagName","update:attributeName","update:attributeValue","update:textContent"],setup(n,{emit:e}){const t=n,s=e,o=r.ref(!1),l=r.ref(null),i=r.ref(null),d=r.ref(!1),a=r.ref(""),c=r.ref(""),g=r.ref(""),p=r.ref(""),x=r.ref(null),E=r.ref(null),v=r.ref(null),S=r.ref(null),_=r.computed(()=>Object.keys(t.node).find(C=>!C.startsWith(":")&&!C.startsWith("#"))||""),I=r.computed(()=>_.value?t.parentPath?`${t.parentPath}.${_.value}[${t.index}]`:`${_.value}[${t.index}]`:""),U=r.computed(()=>t.expanded.has(I.value)),H=r.computed(()=>t.node["#comment"]?"comment":t.node.__cdata?"cdata":_.value?"element":"unknown"),X=r.computed(()=>{const m=t.node[":@"]||{},C={};return Object.keys(m).forEach(z=>{z.startsWith("@_")&&(C[z.substring(2)]=m[z])}),C}),Z=r.computed(()=>{if(H.value!=="element"||!_.value)return[];const m=t.node[_.value];return Array.isArray(m)?m:[]}),ee=r.computed(()=>Z.value.some(m=>m.__cdata)),le=r.computed(()=>{if(!ee.value)return"";const m=Z.value.find(C=>C.__cdata);if(m&&Array.isArray(m.__cdata)){const C=m.__cdata;if(C.length>0&&C[0]["#text"])return C[0]["#text"]}return""}),D=r.computed(()=>{if(H.value!=="element"||!_.value||ee.value)return"";const m=t.node[_.value];if(!Array.isArray(m))return"";const C=m.find(z=>z["#text"]);return C?C["#text"]:""}),N=r.computed(()=>{if(H.value!=="comment")return"";const m=t.node["#comment"];return Array.isArray(m)&&m.length>0&&m[0]["#text"]||""}),B=r.computed(()=>Z.value.some(m=>Object.keys(m).some(z=>!z.startsWith("#")&&!z.startsWith(":")))),P=r.computed(()=>B.value?Z.value.filter(m=>Object.keys(m).some(z=>!z.startsWith("#")&&!z.startsWith(":"))).length:0),$=r.computed(()=>H.value==="element"&&!B.value&&D.value.trim()!==""),T=()=>{B.value&&s("toggle-expand",I.value)},j=(m,C)=>`${I.value}-child-${C}`,h=()=>`${I.value}.${_.value}`,b=()=>{o.value=!0,a.value=_.value,r.nextTick(()=>{if(x.value){x.value.focus();const m=document.createRange();m.selectNodeContents(x.value);const C=window.getSelection();C?.removeAllRanges(),C?.addRange(m)}})},u=m=>{l.value=m,c.value=m,r.nextTick(()=>{if(E.value){E.value.focus();const C=document.createRange();C.selectNodeContents(E.value);const z=window.getSelection();z?.removeAllRanges(),z?.addRange(C)}})},y=m=>{i.value=m,g.value=X.value[m]||"",r.nextTick(()=>{if(v.value){v.value.focus();const C=document.createRange();C.selectNodeContents(v.value);const z=window.getSelection();z?.removeAllRanges(),z?.addRange(C)}})},k=()=>{d.value=!0,p.value=D.value,r.nextTick(()=>{if(S.value){S.value.focus();const m=document.createRange();m.selectNodeContents(S.value);const C=window.getSelection();C?.removeAllRanges(),C?.addRange(m)}})},w=()=>{if(!o.value)return;const m=x.value?.innerText.trim()||"";if(!m||m===_.value){o.value=!1;return}o.value=!1,s("update:tagName",I.value,_.value,m)},A=()=>{if(!l.value)return;const m=l.value,C=E.value?.innerText.trim()||"";if(!C||C===m){l.value=null;return}l.value=null,s("update:attributeName",I.value,m,C)},V=()=>{if(!i.value)return;const m=i.value,C=v.value?.innerText.trim()||"";i.value=null,s("update:attributeValue",I.value,m,C)},K=()=>{if(!d.value)return;const m=S.value?.innerText||"";if(m===D.value){d.value=!1;return}d.value=!1,s("update:textContent",I.value,m)},W=()=>{o.value=!1,a.value=_.value},J=()=>{l.value&&(c.value=l.value,l.value=null)},de=()=>{i.value&&(g.value=X.value[i.value]||"",i.value=null)},G=()=>{d.value=!1,p.value=D.value},Ee=m=>{B.value&&(m.preventDefault(),b())};return(m,C)=>{const z=r.resolveComponent("XmlNode",!0);return r.openBlock(),r.createElementBlock("div",{class:"xml-node",style:r.normalizeStyle({paddingLeft:m.level>0?"16px":"0"})},[H.value==="comment"?(r.openBlock(),r.createElementBlock("div",Mt,[r.createElementVNode("span",{style:r.normalizeStyle({color:m.theme.colors.xmlComment})}," <!-- "+r.toDisplayString(N.value)+" --> ",5)])):H.value==="cdata"?(r.openBlock(),r.createElementBlock("div",Kt,[r.createElementVNode("span",{style:r.normalizeStyle({color:m.theme.colors.xmlCdata})}," <![CDATA["+r.toDisplayString(m.node.__cdata)+"]]> ",5)])):H.value==="element"?(r.openBlock(),r.createElementBlock("div",jt,[ee.value?(r.openBlock(),r.createElementBlock("div",Ut,[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:m.theme.colors.xmlBracket})},"<",4),r.createElementVNode("span",{class:"xml-node__tag xml-node__tag--editable",style:r.normalizeStyle({color:m.theme.colors.xmlTag}),contenteditable:o.value,onDblclick:b,onContextmenu:Ee,onKeydown:[r.withKeys(r.withModifiers(w,["prevent"]),["enter"]),r.withKeys(W,["escape"])],onBlur:w,ref_key:"tagNameRef",ref:x,title:"Double-click to edit tag name"},r.toDisplayString(o.value?a.value:_.value),45,Ft),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(X.value,(q,O)=>(r.openBlock(),r.createElementBlock("span",{key:O,class:"xml-node__attribute"},[r.createElementVNode("span",{class:"xml-node__attr-name xml-node__attr-name--editable",style:r.normalizeStyle({color:m.theme.colors.xmlAttribute}),contenteditable:l.value===O,onDblclick:R=>u(O),onKeydown:[r.withKeys(r.withModifiers(A,["prevent"]),["enter"]),r.withKeys(J,["escape"])],onBlur:A,ref_for:!0,ref:R=>{l.value===O&&(E.value=R)},title:"Double-click to edit attribute name"},r.toDisplayString(l.value===O?c.value:O),45,Xt),r.createElementVNode("span",{class:"xml-node__equals",style:r.normalizeStyle({color:m.theme.colors.xmlEquals})},"=",4),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4),r.createElementVNode("span",{class:"xml-node__attr-value xml-node__attr-value--editable",style:r.normalizeStyle({color:m.theme.colors.xmlAttributeValue}),contenteditable:i.value===O,onDblclick:R=>y(O),onKeydown:[r.withKeys(r.withModifiers(V,["prevent"]),["enter"]),r.withKeys(de,["escape"])],onBlur:V,ref_for:!0,ref:R=>{i.value===O&&(v.value=R)},title:"Double-click to edit attribute value"},r.toDisplayString(i.value===O?g.value:q),45,zt),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4)]))),128)),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4),r.createElementVNode("span",{class:"xml-node__cdata",style:r.normalizeStyle({color:m.theme.colors.xmlCdata})},"<![CDATA["+r.toDisplayString(le.value)+"]]>",5),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:m.theme.colors.xmlBracket})},"</",4),r.createElementVNode("span",{class:"xml-node__tag",style:r.normalizeStyle({color:m.theme.colors.xmlTag})},r.toDisplayString(o.value?a.value:_.value),5),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4)])):$.value?(r.openBlock(),r.createElementBlock("div",Ht,[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:m.theme.colors.xmlBracket})},"<",4),r.createElementVNode("span",{class:"xml-node__tag xml-node__tag--editable",style:r.normalizeStyle({color:m.theme.colors.xmlTag}),contenteditable:o.value,onDblclick:b,onContextmenu:Ee,onKeydown:[r.withKeys(r.withModifiers(w,["prevent"]),["enter"]),r.withKeys(W,["escape"])],onBlur:w,ref_key:"tagNameRef",ref:x,title:"Double-click to edit tag name"},r.toDisplayString(o.value?a.value:_.value),45,qt),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(X.value,(q,O)=>(r.openBlock(),r.createElementBlock("span",{key:O,class:"xml-node__attribute"},[r.createElementVNode("span",{class:"xml-node__attr-name xml-node__attr-name--editable",style:r.normalizeStyle({color:m.theme.colors.xmlAttribute}),contenteditable:l.value===O,onDblclick:R=>u(O),onKeydown:[r.withKeys(r.withModifiers(A,["prevent"]),["enter"]),r.withKeys(J,["escape"])],onBlur:A,ref_for:!0,ref:R=>{l.value===O&&(E.value=R)},title:"Double-click to edit attribute name"},r.toDisplayString(l.value===O?c.value:O),45,Wt),r.createElementVNode("span",{class:"xml-node__equals",style:r.normalizeStyle({color:m.theme.colors.xmlEquals})},"=",4),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4),r.createElementVNode("span",{class:"xml-node__attr-value xml-node__attr-value--editable",style:r.normalizeStyle({color:m.theme.colors.xmlAttributeValue}),contenteditable:i.value===O,onDblclick:R=>y(O),onKeydown:[r.withKeys(r.withModifiers(V,["prevent"]),["enter"]),r.withKeys(de,["escape"])],onBlur:V,ref_for:!0,ref:R=>{i.value===O&&(v.value=R)},title:"Double-click to edit attribute value"},r.toDisplayString(i.value===O?g.value:q),45,Qt),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4)]))),128)),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4),r.createElementVNode("span",{class:"xml-node__text-content xml-node__text-content--editable",style:r.normalizeStyle({color:m.theme.colors.xmlText}),contenteditable:d.value,onDblclick:k,onKeydown:[r.withKeys(r.withModifiers(K,["prevent"]),["enter"]),r.withKeys(G,["escape"])],onBlur:K,ref_key:"textContentRef",ref:S,title:"Double-click to edit text content"},r.toDisplayString(d.value?p.value:D.value),45,Yt),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:m.theme.colors.xmlBracket})},"</",4),r.createElementVNode("span",{class:"xml-node__tag",style:r.normalizeStyle({color:m.theme.colors.xmlTag})},r.toDisplayString(o.value?a.value:_.value),5),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4)])):(r.openBlock(),r.createElementBlock("div",Dt,[!U.value&&B.value?(r.openBlock(),r.createElementBlock("div",Gt,[r.createElementVNode("span",{class:"xml-node__clickable-part",onClick:C[0]||(C[0]=q=>T()),title:"Click to expand"},[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:m.theme.colors.xmlBracket})},"<",4),r.createElementVNode("span",{class:"xml-node__tag xml-node__tag--editable",style:r.normalizeStyle({color:m.theme.colors.xmlTag}),contenteditable:o.value,onDblclick:r.withModifiers(b,["stop"]),onContextmenu:Ee,onKeydown:[r.withKeys(r.withModifiers(w,["prevent"]),["enter"]),r.withKeys(W,["escape"])],onBlur:w,ref_key:"tagNameRef",ref:x,title:"Double-click or right-click to edit tag name"},r.toDisplayString(o.value?a.value:_.value),45,Zt)]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(X.value,(q,O)=>(r.openBlock(),r.createElementBlock("span",{key:O,class:"xml-node__attribute"},[r.createElementVNode("span",{class:"xml-node__attr-name xml-node__attr-name--editable",style:r.normalizeStyle({color:m.theme.colors.xmlAttribute}),contenteditable:l.value===O,onDblclick:R=>u(O),onKeydown:[r.withKeys(r.withModifiers(A,["prevent"]),["enter"]),r.withKeys(J,["escape"])],onBlur:A,ref_for:!0,ref:R=>{l.value===O&&(E.value=R)},title:"Double-click to edit attribute name"},r.toDisplayString(l.value===O?c.value:O),45,Jt),r.createElementVNode("span",{class:"xml-node__equals",style:r.normalizeStyle({color:m.theme.colors.xmlEquals})},"=",4),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4),r.createElementVNode("span",{class:"xml-node__attr-value xml-node__attr-value--editable",style:r.normalizeStyle({color:m.theme.colors.xmlAttributeValue}),contenteditable:i.value===O,onDblclick:R=>y(O),onKeydown:[r.withKeys(r.withModifiers(V,["prevent"]),["enter"]),r.withKeys(de,["escape"])],onBlur:V,ref_for:!0,ref:R=>{i.value===O&&(v.value=R)},title:"Double-click to edit attribute value"},r.toDisplayString(i.value===O?g.value:q),45,en),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4)]))),128)),r.createElementVNode("span",{class:"xml-node__clickable-part",onClick:C[1]||(C[1]=q=>T()),title:"Click to expand"},[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4)]),r.createElementVNode("span",{class:"xml-node__collapsed-badge",style:r.normalizeStyle({backgroundColor:m.theme.colors.collapsedBackground,color:m.theme.colors.collapsedText}),onClick:C[2]||(C[2]=q=>T()),title:`Click to expand ${P.value} child element${P.value>1?"s":""}`},r.toDisplayString(P.value)+" child"+r.toDisplayString(P.value>1?"ren":""),13,tn),r.createElementVNode("span",{class:"xml-node__clickable-part",onClick:C[3]||(C[3]=q=>T()),title:"Click to expand"},[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:m.theme.colors.xmlBracket})},"</",4),r.createElementVNode("span",{class:"xml-node__tag",style:r.normalizeStyle({color:m.theme.colors.xmlTag})},r.toDisplayString(o.value?a.value:_.value),5),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4)])])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createElementVNode("div",nn,[B.value?(r.openBlock(),r.createElementBlock("span",{key:0,class:"xml-node__clickable-part",onClick:C[4]||(C[4]=q=>T()),title:U.value?"Click to collapse":"Click to expand"},[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:m.theme.colors.xmlBracket})},"<",4),r.createElementVNode("span",{class:"xml-node__tag xml-node__tag--editable",style:r.normalizeStyle({color:m.theme.colors.xmlTag}),contenteditable:o.value,onDblclick:r.withModifiers(b,["stop"]),onContextmenu:Ee,onKeydown:[r.withKeys(r.withModifiers(w,["prevent"]),["enter"]),r.withKeys(W,["escape"])],onBlur:w,ref_key:"tagNameRef",ref:x,title:"Double-click or right-click to edit tag name"},r.toDisplayString(o.value?a.value:_.value),45,on)],8,rn)):(r.openBlock(),r.createElementBlock("span",sn,[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:m.theme.colors.xmlBracket})},"<",4),r.createElementVNode("span",{class:"xml-node__tag xml-node__tag--editable",style:r.normalizeStyle({color:m.theme.colors.xmlTag}),contenteditable:o.value,onDblclick:b,onKeydown:[r.withKeys(r.withModifiers(w,["prevent"]),["enter"]),r.withKeys(W,["escape"])],onBlur:w,ref_key:"tagNameRef",ref:x,title:"Double-click to edit tag name"},r.toDisplayString(o.value?a.value:_.value),45,ln)])),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(X.value,(q,O)=>(r.openBlock(),r.createElementBlock("span",{key:O,class:"xml-node__attribute"},[r.createElementVNode("span",{class:"xml-node__attr-name xml-node__attr-name--editable",style:r.normalizeStyle({color:m.theme.colors.xmlAttribute}),contenteditable:l.value===O,onDblclick:R=>u(O),onKeydown:[r.withKeys(r.withModifiers(A,["prevent"]),["enter"]),r.withKeys(J,["escape"])],onBlur:A,ref_for:!0,ref:R=>{l.value===O&&(E.value=R)},title:"Double-click to edit attribute name"},r.toDisplayString(l.value===O?c.value:O),45,an),r.createElementVNode("span",{class:"xml-node__equals",style:r.normalizeStyle({color:m.theme.colors.xmlEquals})},"=",4),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4),r.createElementVNode("span",{class:"xml-node__attr-value xml-node__attr-value--editable",style:r.normalizeStyle({color:m.theme.colors.xmlAttributeValue}),contenteditable:i.value===O,onDblclick:R=>y(O),onKeydown:[r.withKeys(r.withModifiers(V,["prevent"]),["enter"]),r.withKeys(de,["escape"])],onBlur:V,ref_for:!0,ref:R=>{i.value===O&&(v.value=R)},title:"Double-click to edit attribute value"},r.toDisplayString(i.value===O?g.value:q),45,cn),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4)]))),128)),B.value?(r.openBlock(),r.createElementBlock("span",{key:2,class:"xml-node__clickable-part",onClick:C[5]||(C[5]=q=>T()),title:U.value?"Click to collapse":"Click to expand"},[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4)],8,dn)):(r.openBlock(),r.createElementBlock("span",{key:3,class:"xml-node__bracket",style:r.normalizeStyle({color:m.theme.colors.xmlBracket})},r.toDisplayString(B.value?">":"/>"),5))]),U.value&&B.value?(r.openBlock(),r.createElementBlock("div",un,[Z.value.length===0&&D.value.trim()?(r.openBlock(),r.createElementBlock("div",fn,[r.createElementVNode("span",{class:"xml-node__text-content xml-node__text-content--editable",style:r.normalizeStyle({color:m.theme.colors.xmlText}),contenteditable:d.value,onDblclick:k,onKeydown:[r.withKeys(r.withModifiers(K,["prevent"]),["enter"]),r.withKeys(G,["escape"])],onBlur:K,ref_key:"textContentRef",ref:S,title:"Double-click to edit text content"},r.toDisplayString(d.value?p.value:D.value),45,hn)])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Z.value,(q,O)=>(r.openBlock(),r.createBlock(z,{key:j(q,O),node:q,index:O,level:m.level+1,"parent-path":h(),expanded:m.expanded,theme:m.theme,onToggleExpand:C[6]||(C[6]=R=>m.$emit("toggle-expand",R)),onCopy:C[7]||(C[7]=R=>m.$emit("copy",R)),"onUpdate:tagName":C[8]||(C[8]=(R,ue,me)=>m.$emit("update:tagName",R,ue,me)),"onUpdate:attributeName":C[9]||(C[9]=(R,ue,me)=>m.$emit("update:attributeName",R,ue,me)),"onUpdate:attributeValue":C[10]||(C[10]=(R,ue,me)=>m.$emit("update:attributeValue",R,ue,me)),"onUpdate:textContent":C[11]||(C[11]=(R,ue)=>m.$emit("update:textContent",R,ue))},null,8,["node","index","level","parent-path","expanded","theme"]))),128))])):r.createCommentVNode("",!0),U.value&&B.value?(r.openBlock(),r.createElementBlock("div",pn,[r.createElementVNode("span",{class:"xml-node__clickable-part",onClick:C[12]||(C[12]=q=>T()),title:"Click to collapse"},[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:m.theme.colors.xmlBracket})},"</",4),r.createElementVNode("span",{class:"xml-node__tag",style:r.normalizeStyle({color:m.theme.colors.xmlTag})},r.toDisplayString(o.value?a.value:_.value),5),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4)])])):r.createCommentVNode("",!0)],64))]))])):r.createCommentVNode("",!0)],4)}}}),[["__scopeId","data-v-9bd6cb1a"]]),ve={"github-light":{name:"github-light",colors:{background:"#ffffff",surfaceBackground:"#f6f8fa",border:"#d0d7de",text:"#24292f",textSecondary:"#57606a",buttonBackground:"#f6f8fa",buttonBackgroundHover:"#f3f4f6",buttonBorder:"#d0d7de",buttonText:"#24292f",buttonPrimary:"#1f883d",buttonPrimaryHover:"#1a7f37",success:"#1f883d",successBackground:"#dafbe1",error:"#cf222e",errorBackground:"#ffebe9",xmlTag:"#116329",xmlAttribute:"#0550ae",xmlAttributeValue:"#0a3069",xmlText:"#24292f",xmlComment:"#6e7781",xmlCdata:"#8250df",xmlDeclaration:"#953800",xmlBracket:"#6e7781",xmlEquals:"#6e7781",xmlQuote:"#0550ae",collapsedBackground:"#ddf4ff",collapsedText:"#0969da"}},"github-dark":{name:"github-dark",colors:{background:"#0d1117",surfaceBackground:"#161b22",border:"#30363d",text:"#c9d1d9",textSecondary:"#8b949e",buttonBackground:"#21262d",buttonBackgroundHover:"#30363d",buttonBorder:"#30363d",buttonText:"#c9d1d9",buttonPrimary:"#238636",buttonPrimaryHover:"#2ea043",success:"#3fb950",successBackground:"#0f2e1c",error:"#f85149",errorBackground:"#3d1319",xmlTag:"#7ee787",xmlAttribute:"#79c0ff",xmlAttributeValue:"#a5d6ff",xmlText:"#c9d1d9",xmlComment:"#8b949e",xmlCdata:"#d2a8ff",xmlDeclaration:"#ffa657",xmlBracket:"#8b949e",xmlEquals:"#8b949e",xmlQuote:"#79c0ff",collapsedBackground:"#1c2d41",collapsedText:"#58a6ff"}},"min-light":{name:"min-light",colors:{background:"#ffffff",surfaceBackground:"#fafafa",border:"#e5e5e5",text:"#171717",textSecondary:"#737373",buttonBackground:"#fafafa",buttonBackgroundHover:"#f5f5f5",buttonBorder:"#e5e5e5",buttonText:"#171717",buttonPrimary:"#22c55e",buttonPrimaryHover:"#16a34a",success:"#22c55e",successBackground:"#dcfce7",error:"#ef4444",errorBackground:"#fee2e2",xmlTag:"#16a34a",xmlAttribute:"#2563eb",xmlAttributeValue:"#1e40af",xmlText:"#171717",xmlComment:"#737373",xmlCdata:"#9333ea",xmlDeclaration:"#ea580c",xmlBracket:"#737373",xmlEquals:"#737373",xmlQuote:"#2563eb",collapsedBackground:"#dbeafe",collapsedText:"#1d4ed8"}},"slack-ochin":{name:"slack-ochin",colors:{background:"#fef5ed",surfaceBackground:"#fef9f3",border:"#e9dcc9",text:"#3d3c40",textSecondary:"#616061",buttonBackground:"#fef9f3",buttonBackgroundHover:"#f9f0e5",buttonBorder:"#e9dcc9",buttonText:"#3d3c40",buttonPrimary:"#007a5a",buttonPrimaryHover:"#006644",success:"#007a5a",successBackground:"#d1f4e0",error:"#e01e5a",errorBackground:"#ffdbea",xmlTag:"#007a5a",xmlAttribute:"#1264a3",xmlAttributeValue:"#0b4c8c",xmlText:"#3d3c40",xmlComment:"#616061",xmlCdata:"#8b2eff",xmlDeclaration:"#e8912d",xmlBracket:"#616061",xmlEquals:"#616061",xmlQuote:"#1264a3",collapsedBackground:"#d8eaf5",collapsedText:"#0b4c8c"}}},gn=n=>ve[n]||ve["github-light"],Se=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",yn=Se+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",bn="["+Se+"]["+yn+"]*",En=new RegExp("^"+bn+"$");function Oe(n,e){const t=[];let s=e.exec(n);for(;s;){const o=[];o.startIndex=e.lastIndex-s[0].length;const l=s.length;for(let i=0;i<l;i++)o.push(s[i]);t.push(o),s=e.exec(n)}return t}const ye=function(n){const e=En.exec(n);return!(e===null||typeof e>"u")};function _n(n){return typeof n<"u"}const xn={allowBooleanAttributes:!1,unpairedTags:[]};function $e(n,e){e=Object.assign({},xn,e);const t=[];let s=!1,o=!1;n[0]==="\uFEFF"&&(n=n.substr(1));for(let l=0;l<n.length;l++)if(n[l]==="<"&&n[l+1]==="?"){if(l+=2,l=Ve(n,l),l.err)return l}else if(n[l]==="<"){let i=l;if(l++,n[l]==="!"){l=Ie(n,l);continue}else{let d=!1;n[l]==="/"&&(d=!0,l++);let a="";for(;l<n.length&&n[l]!==">"&&n[l]!==" "&&n[l]!==" "&&n[l]!==`
9
+ `&&n[l]!=="\r";l++)a+=n[l];if(a=a.trim(),a[a.length-1]==="/"&&(a=a.substring(0,a.length-1),l--),!vn(a)){let p;return a.trim().length===0?p="Invalid space after '<'.":p="Tag '"+a+"' is an invalid name.",F("InvalidTag",p,Q(n,l))}const c=wn(n,l);if(c===!1)return F("InvalidAttr","Attributes for '"+a+"' have open quote.",Q(n,l));let g=c.value;if(l=c.index,g[g.length-1]==="/"){const p=l-g.length;g=g.substring(0,g.length-1);const x=Re(g,e);if(x===!0)s=!0;else return F(x.err.code,x.err.msg,Q(n,p+x.err.line))}else if(d)if(c.tagClosed){if(g.trim().length>0)return F("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",Q(n,i));if(t.length===0)return F("InvalidTag","Closing tag '"+a+"' has not been opened.",Q(n,i));{const p=t.pop();if(a!==p.tagName){let x=Q(n,p.tagStartPos);return F("InvalidTag","Expected closing tag '"+p.tagName+"' (opened in line "+x.line+", col "+x.col+") instead of closing tag '"+a+"'.",Q(n,i))}t.length==0&&(o=!0)}}else return F("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",Q(n,l));else{const p=Re(g,e);if(p!==!0)return F(p.err.code,p.err.msg,Q(n,l-g.length+p.err.line));if(o===!0)return F("InvalidXml","Multiple possible root nodes found.",Q(n,l));e.unpairedTags.indexOf(a)!==-1||t.push({tagName:a,tagStartPos:i}),s=!0}for(l++;l<n.length;l++)if(n[l]==="<")if(n[l+1]==="!"){l++,l=Ie(n,l);continue}else if(n[l+1]==="?"){if(l=Ve(n,++l),l.err)return l}else break;else if(n[l]==="&"){const p=Bn(n,l);if(p==-1)return F("InvalidChar","char '&' is not expected.",Q(n,l));l=p}else if(o===!0&&!Pe(n[l]))return F("InvalidXml","Extra text at the end",Q(n,l));n[l]==="<"&&l--}}else{if(Pe(n[l]))continue;return F("InvalidChar","char '"+n[l]+"' is not expected.",Q(n,l))}if(s){if(t.length==1)return F("InvalidTag","Unclosed tag '"+t[0].tagName+"'.",Q(n,t[0].tagStartPos));if(t.length>0)return F("InvalidXml","Invalid '"+JSON.stringify(t.map(l=>l.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return F("InvalidXml","Start tag expected.",1);return!0}function Pe(n){return n===" "||n===" "||n===`
10
+ `||n==="\r"}function Ve(n,e){const t=e;for(;e<n.length;e++)if(n[e]=="?"||n[e]==" "){const s=n.substr(t,e-t);if(e>5&&s==="xml")return F("InvalidXml","XML declaration allowed only at the start of the document.",Q(n,e));if(n[e]=="?"&&n[e+1]==">"){e++;break}else continue}return e}function Ie(n,e){if(n.length>e+5&&n[e+1]==="-"&&n[e+2]==="-"){for(e+=3;e<n.length;e++)if(n[e]==="-"&&n[e+1]==="-"&&n[e+2]===">"){e+=2;break}}else if(n.length>e+8&&n[e+1]==="D"&&n[e+2]==="O"&&n[e+3]==="C"&&n[e+4]==="T"&&n[e+5]==="Y"&&n[e+6]==="P"&&n[e+7]==="E"){let t=1;for(e+=8;e<n.length;e++)if(n[e]==="<")t++;else if(n[e]===">"&&(t--,t===0))break}else if(n.length>e+9&&n[e+1]==="["&&n[e+2]==="C"&&n[e+3]==="D"&&n[e+4]==="A"&&n[e+5]==="T"&&n[e+6]==="A"&&n[e+7]==="["){for(e+=8;e<n.length;e++)if(n[e]==="]"&&n[e+1]==="]"&&n[e+2]===">"){e+=2;break}}return e}const kn='"',Nn="'";function wn(n,e){let t="",s="",o=!1;for(;e<n.length;e++){if(n[e]===kn||n[e]===Nn)s===""?s=n[e]:s!==n[e]||(s="");else if(n[e]===">"&&s===""){o=!0;break}t+=n[e]}return s!==""?!1:{value:t,index:e,tagClosed:o}}const An=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Re(n,e){const t=Oe(n,An),s={};for(let o=0;o<t.length;o++){if(t[o][1].length===0)return F("InvalidAttr","Attribute '"+t[o][2]+"' has no space in starting.",he(t[o]));if(t[o][3]!==void 0&&t[o][4]===void 0)return F("InvalidAttr","Attribute '"+t[o][2]+"' is without value.",he(t[o]));if(t[o][3]===void 0&&!e.allowBooleanAttributes)return F("InvalidAttr","boolean attribute '"+t[o][2]+"' is not allowed.",he(t[o]));const l=t[o][2];if(!Tn(l))return F("InvalidAttr","Attribute '"+l+"' is an invalid name.",he(t[o]));if(!s.hasOwnProperty(l))s[l]=1;else return F("InvalidAttr","Attribute '"+l+"' is repeated.",he(t[o]))}return!0}function Cn(n,e){let t=/\d/;for(n[e]==="x"&&(e++,t=/[\da-fA-F]/);e<n.length;e++){if(n[e]===";")return e;if(!n[e].match(t))break}return-1}function Bn(n,e){if(e++,n[e]===";")return-1;if(n[e]==="#")return e++,Cn(n,e);let t=0;for(;e<n.length;e++,t++)if(!(n[e].match(/\w/)&&t<20)){if(n[e]===";")break;return-1}return e}function F(n,e,t){return{err:{code:n,msg:e,line:t.line||t,col:t.col}}}function Tn(n){return ye(n)}function vn(n){return ye(n)}function Q(n,e){const t=n.substring(0,e).split(/\r?\n/);return{line:t.length,col:t[t.length-1].length+1}}function he(n){return n.startIndex+n[1].length}const Sn={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(n,e){return e},attributeValueProcessor:function(n,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,e,t){return n},captureMetaData:!1},On=function(n){return Object.assign({},Sn,n)};let be;typeof Symbol!="function"?be="@@xmlMetadata":be=Symbol("XML Node Metadata");class ie{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e,t){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][be]={startIndex:t})}static getMetaDataSymbol(){return be}}class $n{constructor(e){this.suppressValidationErr=!e}readDocType(e,t){const s={};if(e[t+3]==="O"&&e[t+4]==="C"&&e[t+5]==="T"&&e[t+6]==="Y"&&e[t+7]==="P"&&e[t+8]==="E"){t=t+9;let o=1,l=!1,i=!1,d="";for(;t<e.length;t++)if(e[t]==="<"&&!i){if(l&&ae(e,"!ENTITY",t)){t+=7;let a,c;[a,c,t]=this.readEntityExp(e,t+1,this.suppressValidationErr),c.indexOf("&")===-1&&(s[a]={regx:RegExp(`&${a};`,"g"),val:c})}else if(l&&ae(e,"!ELEMENT",t)){t+=8;const{index:a}=this.readElementExp(e,t+1);t=a}else if(l&&ae(e,"!ATTLIST",t))t+=8;else if(l&&ae(e,"!NOTATION",t)){t+=9;const{index:a}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=a}else if(ae(e,"!--",t))i=!0;else throw new Error("Invalid DOCTYPE");o++,d=""}else if(e[t]===">"){if(i?e[t-1]==="-"&&e[t-2]==="-"&&(i=!1,o--):o--,o===0)break}else e[t]==="["?l=!0:d+=e[t];if(o!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:s,i:t}}readEntityExp(e,t){t=Y(e,t);let s="";for(;t<e.length&&!/\s/.test(e[t])&&e[t]!=='"'&&e[t]!=="'";)s+=e[t],t++;if(pe(s),t=Y(e,t),!this.suppressValidationErr){if(e.substring(t,t+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(e[t]==="%")throw new Error("Parameter entities are not supported")}let o="";return[t,o]=this.readIdentifierVal(e,t,"entity"),t--,[s,o,t]}readNotationExp(e,t){t=Y(e,t);let s="";for(;t<e.length&&!/\s/.test(e[t]);)s+=e[t],t++;!this.suppressValidationErr&&pe(s),t=Y(e,t);const o=e.substring(t,t+6).toUpperCase();if(!this.suppressValidationErr&&o!=="SYSTEM"&&o!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${o}"`);t+=o.length,t=Y(e,t);let l=null,i=null;if(o==="PUBLIC")[t,l]=this.readIdentifierVal(e,t,"publicIdentifier"),t=Y(e,t),(e[t]==='"'||e[t]==="'")&&([t,i]=this.readIdentifierVal(e,t,"systemIdentifier"));else if(o==="SYSTEM"&&([t,i]=this.readIdentifierVal(e,t,"systemIdentifier"),!this.suppressValidationErr&&!i))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:s,publicIdentifier:l,systemIdentifier:i,index:--t}}readIdentifierVal(e,t,s){let o="";const l=e[t];if(l!=='"'&&l!=="'")throw new Error(`Expected quoted string, found "${l}"`);for(t++;t<e.length&&e[t]!==l;)o+=e[t],t++;if(e[t]!==l)throw new Error(`Unterminated ${s} value`);return t++,[t,o]}readElementExp(e,t){t=Y(e,t);let s="";for(;t<e.length&&!/\s/.test(e[t]);)s+=e[t],t++;if(!this.suppressValidationErr&&!ye(s))throw new Error(`Invalid element name: "${s}"`);t=Y(e,t);let o="";if(e[t]==="E"&&ae(e,"MPTY",t))t+=4;else if(e[t]==="A"&&ae(e,"NY",t))t+=2;else if(e[t]==="("){for(t++;t<e.length&&e[t]!==")";)o+=e[t],t++;if(e[t]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${e[t]}"`);return{elementName:s,contentModel:o.trim(),index:t}}readAttlistExp(e,t){t=Y(e,t);let s="";for(;t<e.length&&!/\s/.test(e[t]);)s+=e[t],t++;pe(s),t=Y(e,t);let o="";for(;t<e.length&&!/\s/.test(e[t]);)o+=e[t],t++;if(!pe(o))throw new Error(`Invalid attribute name: "${o}"`);t=Y(e,t);let l="";if(e.substring(t,t+8).toUpperCase()==="NOTATION"){if(l="NOTATION",t+=8,t=Y(e,t),e[t]!=="(")throw new Error(`Expected '(', found "${e[t]}"`);t++;let d=[];for(;t<e.length&&e[t]!==")";){let a="";for(;t<e.length&&e[t]!=="|"&&e[t]!==")";)a+=e[t],t++;if(a=a.trim(),!pe(a))throw new Error(`Invalid notation name: "${a}"`);d.push(a),e[t]==="|"&&(t++,t=Y(e,t))}if(e[t]!==")")throw new Error("Unterminated list of notations");t++,l+=" ("+d.join("|")+")"}else{for(;t<e.length&&!/\s/.test(e[t]);)l+=e[t],t++;const d=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!d.includes(l.toUpperCase()))throw new Error(`Invalid attribute type: "${l}"`)}t=Y(e,t);let i="";return e.substring(t,t+8).toUpperCase()==="#REQUIRED"?(i="#REQUIRED",t+=8):e.substring(t,t+7).toUpperCase()==="#IMPLIED"?(i="#IMPLIED",t+=7):[t,i]=this.readIdentifierVal(e,t,"ATTLIST"),{elementName:s,attributeName:o,attributeType:l,defaultValue:i,index:t}}}const Y=(n,e)=>{for(;e<n.length&&/\s/.test(n[e]);)e++;return e};function ae(n,e,t){for(let s=0;s<e.length;s++)if(e[s]!==n[t+s+1])return!1;return!0}function pe(n){if(ye(n))return n;throw new Error(`Invalid entity name ${n}`)}const Pn=/^[-+]?0x[a-fA-F0-9]+$/,Vn=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,In={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function Rn(n,e={}){if(e=Object.assign({},In,e),!n||typeof n!="string")return n;let t=n.trim();if(e.skipLike!==void 0&&e.skipLike.test(t))return n;if(n==="0")return 0;if(e.hex&&Pn.test(t))return jn(t,16);if(t.search(/.+[eE].+/)!==-1)return Mn(n,t,e);{const s=Vn.exec(t);if(s){const o=s[1]||"",l=s[2];let i=Kn(s[3]);const d=o?n[l.length+1]===".":n[l.length]===".";if(!e.leadingZeros&&(l.length>1||l.length===1&&!d))return n;{const a=Number(t),c=String(a);if(a===0)return a;if(c.search(/[eE]/)!==-1)return e.eNotation?a:n;if(t.indexOf(".")!==-1)return c==="0"||c===i||c===`${o}${i}`?a:n;let g=l?i:t;return l?g===c||o+g===c?a:n:g===c||g===o+c?a:n}}else return n}}const Ln=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function Mn(n,e,t){if(!t.eNotation)return n;const s=e.match(Ln);if(s){let o=s[1]||"";const l=s[3].indexOf("e")===-1?"E":"e",i=s[2],d=o?n[i.length+1]===l:n[i.length]===l;return i.length>1&&d?n:i.length===1&&(s[3].startsWith(`.${l}`)||s[3][0]===l)?Number(e):t.leadingZeros&&!d?(e=(s[1]||"")+s[3],Number(e)):n}else return n}function Kn(n){return n&&n.indexOf(".")!==-1&&(n=n.replace(/0+$/,""),n==="."?n="0":n[0]==="."?n="0"+n:n[n.length-1]==="."&&(n=n.substring(0,n.length-1))),n}function jn(n,e){if(parseInt)return parseInt(n,e);if(Number.parseInt)return Number.parseInt(n,e);if(window&&window.parseInt)return window.parseInt(n,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function Le(n){return typeof n=="function"?n:Array.isArray(n)?e=>{for(const t of n)if(typeof t=="string"&&e===t||t instanceof RegExp&&t.test(e))return!0}:()=>!1}class Un{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,s)=>String.fromCodePoint(Number.parseInt(s,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,s)=>String.fromCodePoint(Number.parseInt(s,16))}},this.addExternalEntities=Fn,this.parseXml=Wn,this.parseTextData=Xn,this.resolveNameSpace=zn,this.buildAttributesMap=qn,this.isItStopNode=Gn,this.replaceEntitiesValue=Yn,this.readStopNodeData=Jn,this.saveTextToParentTag=Dn,this.addChild=Qn,this.ignoreAttributesFn=Le(this.options.ignoreAttributes)}}function Fn(n){const e=Object.keys(n);for(let t=0;t<e.length;t++){const s=e[t];this.lastEntities[s]={regex:new RegExp("&"+s+";","g"),val:n[s]}}}function Xn(n,e,t,s,o,l,i){if(n!==void 0&&(this.options.trimValues&&!s&&(n=n.trim()),n.length>0)){i||(n=this.replaceEntitiesValue(n));const d=this.options.tagValueProcessor(e,n,t,o,l);return d==null?n:typeof d!=typeof n||d!==n?d:this.options.trimValues?Ne(n,this.options.parseTagValue,this.options.numberParseOptions):n.trim()===n?Ne(n,this.options.parseTagValue,this.options.numberParseOptions):n}}function zn(n){if(this.options.removeNSPrefix){const e=n.split(":"),t=n.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(n=t+e[1])}return n}const Hn=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function qn(n,e,t){if(this.options.ignoreAttributes!==!0&&typeof n=="string"){const s=Oe(n,Hn),o=s.length,l={};for(let i=0;i<o;i++){const d=this.resolveNameSpace(s[i][1]);if(this.ignoreAttributesFn(d,e))continue;let a=s[i][4],c=this.options.attributeNamePrefix+d;if(d.length)if(this.options.transformAttributeName&&(c=this.options.transformAttributeName(c)),c==="__proto__"&&(c="#__proto__"),a!==void 0){this.options.trimValues&&(a=a.trim()),a=this.replaceEntitiesValue(a);const g=this.options.attributeValueProcessor(d,a,e);g==null?l[c]=a:typeof g!=typeof a||g!==a?l[c]=g:l[c]=Ne(a,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(l[c]=!0)}if(!Object.keys(l).length)return;if(this.options.attributesGroupName){const i={};return i[this.options.attributesGroupName]=l,i}return l}}const Wn=function(n){n=n.replace(/\r\n?/g,`
11
+ `);const e=new ie("!xml");let t=e,s="",o="";const l=new $n(this.options.processEntities);for(let i=0;i<n.length;i++)if(n[i]==="<")if(n[i+1]==="/"){const a=ce(n,">",i,"Closing Tag is not closed.");let c=n.substring(i+2,a).trim();if(this.options.removeNSPrefix){const x=c.indexOf(":");x!==-1&&(c=c.substr(x+1))}this.options.transformTagName&&(c=this.options.transformTagName(c)),t&&(s=this.saveTextToParentTag(s,t,o));const g=o.substring(o.lastIndexOf(".")+1);if(c&&this.options.unpairedTags.indexOf(c)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${c}>`);let p=0;g&&this.options.unpairedTags.indexOf(g)!==-1?(p=o.lastIndexOf(".",o.lastIndexOf(".")-1),this.tagsNodeStack.pop()):p=o.lastIndexOf("."),o=o.substring(0,p),t=this.tagsNodeStack.pop(),s="",i=a}else if(n[i+1]==="?"){let a=ke(n,i,!1,"?>");if(!a)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,t,o),!(this.options.ignoreDeclaration&&a.tagName==="?xml"||this.options.ignorePiTags)){const c=new ie(a.tagName);c.add(this.options.textNodeName,""),a.tagName!==a.tagExp&&a.attrExpPresent&&(c[":@"]=this.buildAttributesMap(a.tagExp,o,a.tagName)),this.addChild(t,c,o,i)}i=a.closeIndex+1}else if(n.substr(i+1,3)==="!--"){const a=ce(n,"-->",i+4,"Comment is not closed.");if(this.options.commentPropName){const c=n.substring(i+4,a-2);s=this.saveTextToParentTag(s,t,o),t.add(this.options.commentPropName,[{[this.options.textNodeName]:c}])}i=a}else if(n.substr(i+1,2)==="!D"){const a=l.readDocType(n,i);this.docTypeEntities=a.entities,i=a.i}else if(n.substr(i+1,2)==="!["){const a=ce(n,"]]>",i,"CDATA is not closed.")-2,c=n.substring(i+9,a);s=this.saveTextToParentTag(s,t,o);let g=this.parseTextData(c,t.tagname,o,!0,!1,!0,!0);g==null&&(g=""),this.options.cdataPropName?t.add(this.options.cdataPropName,[{[this.options.textNodeName]:c}]):t.add(this.options.textNodeName,g),i=a+2}else{let a=ke(n,i,this.options.removeNSPrefix),c=a.tagName;const g=a.rawTagName;let p=a.tagExp,x=a.attrExpPresent,E=a.closeIndex;this.options.transformTagName&&(c=this.options.transformTagName(c)),t&&s&&t.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,t,o,!1));const v=t;v&&this.options.unpairedTags.indexOf(v.tagname)!==-1&&(t=this.tagsNodeStack.pop(),o=o.substring(0,o.lastIndexOf("."))),c!==e.tagname&&(o+=o?"."+c:c);const S=i;if(this.isItStopNode(this.options.stopNodes,o,c)){let _="";if(p.length>0&&p.lastIndexOf("/")===p.length-1)c[c.length-1]==="/"?(c=c.substr(0,c.length-1),o=o.substr(0,o.length-1),p=c):p=p.substr(0,p.length-1),i=a.closeIndex;else if(this.options.unpairedTags.indexOf(c)!==-1)i=a.closeIndex;else{const U=this.readStopNodeData(n,g,E+1);if(!U)throw new Error(`Unexpected end of ${g}`);i=U.i,_=U.tagContent}const I=new ie(c);c!==p&&x&&(I[":@"]=this.buildAttributesMap(p,o,c)),_&&(_=this.parseTextData(_,c,o,!0,x,!0,!0)),o=o.substr(0,o.lastIndexOf(".")),I.add(this.options.textNodeName,_),this.addChild(t,I,o,S)}else{if(p.length>0&&p.lastIndexOf("/")===p.length-1){c[c.length-1]==="/"?(c=c.substr(0,c.length-1),o=o.substr(0,o.length-1),p=c):p=p.substr(0,p.length-1),this.options.transformTagName&&(c=this.options.transformTagName(c));const _=new ie(c);c!==p&&x&&(_[":@"]=this.buildAttributesMap(p,o,c)),this.addChild(t,_,o,S),o=o.substr(0,o.lastIndexOf("."))}else{const _=new ie(c);this.tagsNodeStack.push(t),c!==p&&x&&(_[":@"]=this.buildAttributesMap(p,o,c)),this.addChild(t,_,o,S),t=_}s="",i=E}}else s+=n[i];return e.child};function Qn(n,e,t,s){this.options.captureMetaData||(s=void 0);const o=this.options.updateTag(e.tagname,t,e[":@"]);o===!1||(typeof o=="string"&&(e.tagname=o),n.addChild(e,s))}const Yn=function(n){if(this.options.processEntities){for(let e in this.docTypeEntities){const t=this.docTypeEntities[e];n=n.replace(t.regx,t.val)}for(let e in this.lastEntities){const t=this.lastEntities[e];n=n.replace(t.regex,t.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const t=this.htmlEntities[e];n=n.replace(t.regex,t.val)}n=n.replace(this.ampEntity.regex,this.ampEntity.val)}return n};function Dn(n,e,t,s){return n&&(s===void 0&&(s=e.child.length===0),n=this.parseTextData(n,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,s),n!==void 0&&n!==""&&e.add(this.options.textNodeName,n),n=""),n}function Gn(n,e,t){const s="*."+t;for(const o in n){const l=n[o];if(s===l||e===l)return!0}return!1}function Zn(n,e,t=">"){let s,o="";for(let l=e;l<n.length;l++){let i=n[l];if(s)i===s&&(s="");else if(i==='"'||i==="'")s=i;else if(i===t[0])if(t[1]){if(n[l+1]===t[1])return{data:o,index:l}}else return{data:o,index:l};else i===" "&&(i=" ");o+=i}}function ce(n,e,t,s){const o=n.indexOf(e,t);if(o===-1)throw new Error(s);return o+e.length-1}function ke(n,e,t,s=">"){const o=Zn(n,e+1,s);if(!o)return;let l=o.data;const i=o.index,d=l.search(/\s/);let a=l,c=!0;d!==-1&&(a=l.substring(0,d),l=l.substring(d+1).trimStart());const g=a;if(t){const p=a.indexOf(":");p!==-1&&(a=a.substr(p+1),c=a!==o.data.substr(p+1))}return{tagName:a,tagExp:l,closeIndex:i,attrExpPresent:c,rawTagName:g}}function Jn(n,e,t){const s=t;let o=1;for(;t<n.length;t++)if(n[t]==="<")if(n[t+1]==="/"){const l=ce(n,">",t,`${e} is not closed`);if(n.substring(t+2,l).trim()===e&&(o--,o===0))return{tagContent:n.substring(s,t),i:l};t=l}else if(n[t+1]==="?")t=ce(n,"?>",t+1,"StopNode is not closed.");else if(n.substr(t+1,3)==="!--")t=ce(n,"-->",t+3,"StopNode is not closed.");else if(n.substr(t+1,2)==="![")t=ce(n,"]]>",t,"StopNode is not closed.")-2;else{const l=ke(n,t,">");l&&((l&&l.tagName)===e&&l.tagExp[l.tagExp.length-1]!=="/"&&o++,t=l.closeIndex)}}function Ne(n,e,t){if(e&&typeof n=="string"){const s=n.trim();return s==="true"?!0:s==="false"?!1:Rn(n,t)}else return _n(n)?n:""}const we=ie.getMetaDataSymbol();function er(n,e){return Me(n,e)}function Me(n,e,t){let s;const o={};for(let l=0;l<n.length;l++){const i=n[l],d=tr(i);let a="";if(t===void 0?a=d:a=t+"."+d,d===e.textNodeName)s===void 0?s=i[d]:s+=""+i[d];else{if(d===void 0)continue;if(i[d]){let c=Me(i[d],e,a);const g=rr(c,e);i[we]!==void 0&&(c[we]=i[we]),i[":@"]?nr(c,i[":@"],a,e):Object.keys(c).length===1&&c[e.textNodeName]!==void 0&&!e.alwaysCreateTextNode?c=c[e.textNodeName]:Object.keys(c).length===0&&(e.alwaysCreateTextNode?c[e.textNodeName]="":c=""),o[d]!==void 0&&o.hasOwnProperty(d)?(Array.isArray(o[d])||(o[d]=[o[d]]),o[d].push(c)):e.isArray(d,a,g)?o[d]=[c]:o[d]=c}}}return typeof s=="string"?s.length>0&&(o[e.textNodeName]=s):s!==void 0&&(o[e.textNodeName]=s),o}function tr(n){const e=Object.keys(n);for(let t=0;t<e.length;t++){const s=e[t];if(s!==":@")return s}}function nr(n,e,t,s){if(e){const o=Object.keys(e),l=o.length;for(let i=0;i<l;i++){const d=o[i];s.isArray(d,t+"."+d,!0,!0)?n[d]=[e[d]]:n[d]=e[d]}}}function rr(n,e){const{textNodeName:t}=e,s=Object.keys(n).length;return!!(s===0||s===1&&(n[t]||typeof n[t]=="boolean"||n[t]===0))}class or{constructor(e){this.externalEntities={},this.options=On(e)}parse(e,t){if(typeof e!="string"&&e.toString)e=e.toString();else if(typeof e!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(t){t===!0&&(t={});const l=$e(e,t);if(l!==!0)throw Error(`${l.err.msg}:${l.err.line}:${l.err.col}`)}const s=new Un(this.options);s.addExternalEntities(this.externalEntities);const o=s.parseXml(e);return this.options.preserveOrder||o===void 0?o:er(o,this.options)}addEntity(e,t){if(t.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(e.indexOf("&")!==-1||e.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(t==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}static getMetaDataSymbol(){return ie.getMetaDataSymbol()}}const sr=`
12
+ `;function lr(n,e){let t="";return e.format&&e.indentBy.length>0&&(t=sr),Ke(n,e,"",t)}function Ke(n,e,t,s){let o="",l=!1;for(let i=0;i<n.length;i++){const d=n[i],a=ir(d);if(a===void 0)continue;let c="";if(t.length===0?c=a:c=`${t}.${a}`,a===e.textNodeName){let v=d[a];ar(c,e)||(v=e.tagValueProcessor(a,v),v=Ue(v,e)),l&&(o+=s),o+=v,l=!1;continue}else if(a===e.cdataPropName){l&&(o+=s),o+=`<![CDATA[${d[a][0][e.textNodeName]}]]>`,l=!1;continue}else if(a===e.commentPropName){o+=s+`<!--${d[a][0][e.textNodeName]}-->`,l=!0;continue}else if(a[0]==="?"){const v=je(d[":@"],e),S=a==="?xml"?"":s;let _=d[a][0][e.textNodeName];_=_.length!==0?" "+_:"",o+=S+`<${a}${_}${v}?>`,l=!0;continue}let g=s;g!==""&&(g+=e.indentBy);const p=je(d[":@"],e),x=s+`<${a}${p}`,E=Ke(d[a],e,c,g);e.unpairedTags.indexOf(a)!==-1?e.suppressUnpairedNode?o+=x+">":o+=x+"/>":(!E||E.length===0)&&e.suppressEmptyNode?o+=x+"/>":E&&E.endsWith(">")?o+=x+`>${E}${s}</${a}>`:(o+=x+">",E&&s!==""&&(E.includes("/>")||E.includes("</"))?o+=s+e.indentBy+E+s:o+=E,o+=`</${a}>`),l=!0}return o}function ir(n){const e=Object.keys(n);for(let t=0;t<e.length;t++){const s=e[t];if(n.hasOwnProperty(s)&&s!==":@")return s}}function je(n,e){let t="";if(n&&!e.ignoreAttributes)for(let s in n){if(!n.hasOwnProperty(s))continue;let o=e.attributeValueProcessor(s,n[s]);o=Ue(o,e),o===!0&&e.suppressBooleanAttributes?t+=` ${s.substr(e.attributeNamePrefix.length)}`:t+=` ${s.substr(e.attributeNamePrefix.length)}="${o}"`}return t}function ar(n,e){n=n.substr(0,n.length-e.textNodeName.length-1);let t=n.substr(n.lastIndexOf(".")+1);for(let s in e.stopNodes)if(e.stopNodes[s]===n||e.stopNodes[s]==="*."+t)return!0;return!1}function Ue(n,e){if(n&&n.length>0&&e.processEntities)for(let t=0;t<e.entities.length;t++){const s=e.entities[t];n=n.replace(s.regex,s.val)}return n}const cr={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(n,e){return e},attributeValueProcessor:function(n,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function oe(n){this.options=Object.assign({},cr,n),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Le(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=fr),this.processTextOrObjNode=dr,this.options.format?(this.indentate=ur,this.tagEndChar=`>
13
13
  `,this.newLine=`
14
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}G.prototype.build=function(r){return this.options.preserveOrder?vr(r,this.options):(Array.isArray(r)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(r={[this.options.arrayNodeName]:r}),this.j2x(r,0,[]).val)},G.prototype.j2x=function(r,e,t){let s="",n="";const l=t.join(".");for(let i in r)if(Object.prototype.hasOwnProperty.call(r,i))if(typeof r[i]>"u")this.isAttribute(i)&&(n+="");else if(r[i]===null)this.isAttribute(i)||i===this.options.cdataPropName?n+="":i[0]==="?"?n+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(r[i]instanceof Date)n+=this.buildTextValNode(r[i],i,"",e);else if(typeof r[i]!="object"){const d=this.isAttribute(i);if(d&&!this.ignoreAttributesFn(d,l))s+=this.buildAttrPairStr(d,""+r[i]);else if(!d)if(i===this.options.textNodeName){let a=this.options.tagValueProcessor(i,""+r[i]);n+=this.replaceEntitiesValue(a)}else n+=this.buildTextValNode(r[i],i,"",e)}else if(Array.isArray(r[i])){const d=r[i].length;let a="",c="";for(let p=0;p<d;p++){const h=r[i][p];if(!(typeof h>"u"))if(h===null)i[0]==="?"?n+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(typeof h=="object")if(this.options.oneListGroup){const k=this.j2x(h,e+1,t.concat(i));a+=k.val,this.options.attributesGroupName&&h.hasOwnProperty(this.options.attributesGroupName)&&(c+=k.attrStr)}else a+=this.processTextOrObjNode(h,i,e,t);else if(this.options.oneListGroup){let k=this.options.tagValueProcessor(i,h);k=this.replaceEntitiesValue(k),a+=k}else a+=this.buildTextValNode(h,i,"",e)}this.options.oneListGroup&&(a=this.buildObjectNode(a,i,c,e)),n+=a}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const d=Object.keys(r[i]),a=d.length;for(let c=0;c<a;c++)s+=this.buildAttrPairStr(d[c],""+r[i][d[c]])}else n+=this.processTextOrObjNode(r[i],i,e,t);return{attrStr:s,val:n}},G.prototype.buildAttrPairStr=function(r,e){return e=this.options.attributeValueProcessor(r,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&e==="true"?" "+r:" "+r+'="'+e+'"'};function Mr(r,e,t,s){const n=this.j2x(r,t+1,s.concat(e));return r[this.options.textNodeName]!==void 0&&Object.keys(r).length===1?this.buildTextValNode(r[this.options.textNodeName],e,n.attrStr,t):this.buildObjectNode(n.val,e,n.attrStr,t)}G.prototype.buildObjectNode=function(r,e,t,s){if(r==="")return e[0]==="?"?this.indentate(s)+"<"+e+t+"?"+this.tagEndChar:this.indentate(s)+"<"+e+t+this.closeTag(e)+this.tagEndChar;{let n="</"+e+this.tagEndChar,l="";return e[0]==="?"&&(l="?",n=""),(t||t==="")&&r.indexOf("<")===-1?this.indentate(s)+"<"+e+t+l+">"+r+n:this.options.commentPropName!==!1&&e===this.options.commentPropName&&l.length===0?this.indentate(s)+`<!--${r}-->`+this.newLine:this.indentate(s)+"<"+e+t+l+this.tagEndChar+r+this.indentate(s)+n}},G.prototype.closeTag=function(r){let e="";return this.options.unpairedTags.indexOf(r)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`></${r}`,e},G.prototype.buildTextValNode=function(r,e,t,s){if(this.options.cdataPropName!==!1&&e===this.options.cdataPropName)return this.indentate(s)+`<![CDATA[${r}]]>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(s)+`<!--${r}-->`+this.newLine;if(e[0]==="?")return this.indentate(s)+"<"+e+t+"?"+this.tagEndChar;{let n=this.options.tagValueProcessor(e,r);return n=this.replaceEntitiesValue(n),n===""?this.indentate(s)+"<"+e+t+this.closeTag(e)+this.tagEndChar:this.indentate(s)+"<"+e+t+">"+n+"</"+e+this.tagEndChar}},G.prototype.replaceEntitiesValue=function(r){if(r&&r.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const t=this.options.entities[e];r=r.replace(t.regex,t.val)}return r};function Fr(r){return this.options.indentBy.repeat(r)}function Ur(r){return r.startsWith(this.options.attributeNamePrefix)&&r!==this.options.textNodeName?r.substr(this.attrPrefixLen):!1}const Xr={validate:xe},zr={ignoreAttributes:!1,attributeNamePrefix:"@_",textNodeName:"#text",ignoreDeclaration:!1,commentPropName:"#comment",cdataPropName:"__cdata",preserveOrder:!0,parseAttributeValue:!1,trimValues:!0,parseTagValue:!1,processEntities:!0,htmlEntities:!1,ignoreNameSpace:!1,allowBooleanAttributes:!0,unpairedTags:[],stopNodes:[],alwaysCreateTextNode:!1},Hr={ignoreAttributes:!1,attributeNamePrefix:"@_",textNodeName:"#text",format:!0,indentBy:" ",suppressEmptyNode:!1,suppressBooleanAttributes:!1,suppressUnpairedNode:!1},Kr=r=>{try{const e=Xr.validate(r,{allowBooleanAttributes:!0});return e===!0?{valid:!0}:{valid:!1,error:`Line ${e.err.line}: ${e.err.msg}`}}catch(e){return{valid:!1,error:e instanceof Error?e.message:"Unknown validation error"}}},$e=(r,e)=>{try{return new Vr({...zr,...e}).parse(r)}catch(t){throw new Error(`XML 解析失败: ${t instanceof Error?t.message:"Unknown error"}`)}},me=(r,e)=>{try{let s=new G({...Hr,format:e?.format??!0,indentBy:e?.indentBy??" "}).build(r);return e?.showDeclaration!==!1&&!s.startsWith("<?xml")&&(s=`<?xml version="1.0" encoding="UTF-8"?>
15
- `+s),s}catch(t){throw new Error(`XML 构建失败: ${t instanceof Error?t.message:"Unknown error"}`)}},qr=r=>Array.isArray(r)?ce(r,{format:!1}):me(r,{format:!1,showDeclaration:!1}),Qr=(r,e)=>{const t=$e(r);return Array.isArray(t)?ce(t,{indent:e?.indentBy}):me(t,e)},ce=(r,e={})=>{const t=e.indent!==void 0?e.indent:" ",s=e.level||0,n=e.format!==!1,l=n?t.repeat(s):"",i=n?`
16
- `:"";let d="";for(const a of r){if(a["?xml"]){const x=a[":@"]||{},O=Object.entries(x).map(([R,z])=>`${R.startsWith("@_")?R.substring(2):R}="${z}"`).join(" ");d+=`<?xml ${O}?>${i}`;continue}if(a["#comment"]){const x=a["#comment"];if(Array.isArray(x)&&x.length>0){const O=x[0]["#text"]||x[0];d+=`${l}<!--${O}-->${i}`}continue}const c=Object.keys(a).find(x=>!x.startsWith(":")&&!x.startsWith("#")&&!x.startsWith("__"));if(!c)continue;const p=a[c],h=a[":@"]||{},k=Object.entries(h).map(([x,O])=>`${x.startsWith("@_")?x.substring(2):x}="${O}"`).join(" "),_=k?" "+k:"";if(!Array.isArray(p)||p.length===0){d+=`${l}<${c}${_}/>${i}`;continue}const N=p.length===1&&p[0]["#text"]!==void 0;if(p.some(x=>x.__cdata)){const x=p.find(O=>O.__cdata);if(x){const O=x.__cdata[0]["#text"]||"";d+=`${l}<${c}${_}><![CDATA[${O}]]></${c}>${i}`}}else if(N){const x=p[0]["#text"];d+=`${l}<${c}${_}>${x}</${c}>${i}`}else d+=`${l}<${c}${_}>${i}`,d+=ce(p,{indent:t,level:s+1,format:n}),d+=`${l}</${c}>${i}`}return d},Wr={key:0,class:"xml-format__toolbar"},Yr={class:"xml-format__actions"},Gr=["disabled"],Zr=["disabled"],Dr=["disabled"],Jr=["disabled"],en=["disabled"],tn={class:"xml-format__info"},rn={key:0,class:"xml-format__status xml-format__status--success"},nn={key:1,class:"xml-format__status xml-format__status--error"},on={class:"xml-format__content"},sn={key:0,class:"xml-format__error"},ln={key:1,class:"xml-format__viewer"},an=le(o.defineComponent({__name:"index",props:{modelValue:{default:""},readonly:{type:Boolean,default:!1},maxDepth:{default:10},showToolbar:{type:Boolean,default:!0},theme:{default:"github-light"},showComments:{type:Boolean,default:!0},showCdata:{type:Boolean,default:!0},preserveWhitespace:{type:Boolean,default:!1}},emits:["update:modelValue","copy-success","copy-error","expand-all","collapse-all","compress","format"],setup(r,{expose:e,emit:t}){o.useCssVars(g=>({"0db40539":c.value.colors.border,bd72d08a:c.value.colors.background,"1738b57a":c.value.colors.text,"69331e8e":c.value.colors.surfaceBackground,cd0ca56a:c.value.colors.buttonBorder,"02f5e6cd":c.value.colors.buttonBackground,"060d3a0c":c.value.colors.buttonText,"6ac62a6f":c.value.colors.buttonBackgroundHover,"7ef6f8c3":c.value.colors.buttonPrimary,"24e03b8e":c.value.colors.buttonPrimaryHover,"357fd096":c.value.colors.success,"4d328338":c.value.colors.successBackground,"61df294a":c.value.colors.error,"3307322e":c.value.colors.errorBackground}));const s=r,n=t,l=o.ref(null),i=o.ref(""),d=o.ref(new Set),a=o.computed(()=>i.value===""),c=o.computed(()=>Kt(s.theme)),p=o.computed(()=>!l.value||!Array.isArray(l.value)?[]:l.value.filter(g=>!g["?xml"])),h=o.computed(()=>{if(!l.value||!Array.isArray(l.value))return null;const g=l.value.find($=>$["?xml"]);if(!g||!g[":@"])return null;const A=g[":@"],T=[];return A["@_version"]&&T.push(`version="${A["@_version"]}"`),A["@_encoding"]&&T.push(`encoding="${A["@_encoding"]}"`),A["@_standalone"]&&T.push(`standalone="${A["@_standalone"]}"`),T.length>0?`<?xml ${T.join(" ")}?>`:null}),k=o.computed(()=>p.value),_=g=>{if(!g||!g.trim()){i.value="",l.value=null;return}try{const A=Kr(g);if(!A.valid){i.value=A.error||"Invalid XML",l.value=null;return}l.value=$e(g),i.value="",o.nextTick(()=>{C()})}catch(A){i.value=A instanceof Error?A.message:"Unknown parse error",l.value=null}},N=g=>{d.value.has(g)?d.value.delete(g):d.value.add(g)},C=()=>{const g=new Set,A=(T,$="")=>{Array.isArray(T)&&T.forEach((j,X)=>{const F=Object.keys(j).find(te=>!te.startsWith(":")&&!te.startsWith("#"));if(!F)return;const ee=$?`${$}[${X}]`:`${F}[${X}]`;g.add(ee);const W=j[F];Array.isArray(W)&&A(W,ee+"."+F)})};p.value.forEach((T,$)=>{const j=Object.keys(T).find(X=>!X.startsWith(":")&&!X.startsWith("#"));if(j){const X=`${j}[${$}]`;g.add(X);const F=T[j];Array.isArray(F)&&A(F,X+"."+j)}}),d.value=g,n("expand-all")},x=()=>{d.value.clear(),n("collapse-all")},O=async()=>{if(!(!a.value||!l.value))try{const g=Array.isArray(l.value)?ce(l.value,{indent:" "}):me(l.value,{format:!0,indentBy:" "});await navigator.clipboard.writeText(g),n("copy-success",g)}catch(g){const A=g instanceof Error?g:new Error("Copy failed");n("copy-error",A),console.error("Failed to copy XML:",g)}},R=()=>{if(!(!a.value||!l.value))try{const g=qr(l.value);n("update:modelValue",g),n("compress",g)}catch(g){console.error("Failed to compress XML:",g)}},z=()=>{if(a.value)try{const g=Qr(s.modelValue,{format:!0,indentBy:" "});n("update:modelValue",g),n("format",g)}catch(g){console.error("Failed to format XML:",g)}},m=async g=>{try{const A=typeof g=="string"?g:JSON.stringify(g,null,2);await navigator.clipboard.writeText(A),n("copy-success",A)}catch(A){const T=A instanceof Error?A:new Error("Copy failed");n("copy-error",T),console.error("Failed to copy value:",A)}};return o.watch(()=>s.modelValue,g=>{_(g)},{immediate:!0}),e({copyXml:O,compressSource:R,formatSource:z,expandAll:C,collapseAll:x,toggleExpand:N,isValidXml:()=>a.value,getParsedXml:()=>l.value,getExpandedNodes:()=>d.value,getParseError:()=>i.value,parseXmlString:g=>_(g),copyValue:g=>m(g)}),(g,A)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["xml-format",`xml-format--${c.value.name}`])},[g.showToolbar?(o.openBlock(),o.createElementBlock("div",Wr,[o.createElementVNode("div",Yr,[o.createElementVNode("button",{class:"xml-format__btn xml-format__btn--primary",onClick:O,disabled:!a.value,title:"Copy XML"}," 📋 Copy ",8,Gr),o.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:C,disabled:!a.value,title:"Expand All"}," ⬇️ Expand All ",8,Zr),o.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:x,disabled:!a.value,title:"Collapse All"}," ➡️ Collapse All ",8,Dr),o.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:R,disabled:!a.value,title:"Compress XML"}," 📦 Compress ",8,Jr),o.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:z,disabled:!a.value,title:"Format XML"}," ✨ Format ",8,en)]),o.createElementVNode("div",tn,[a.value?(o.openBlock(),o.createElementBlock("span",rn," ✅ Valid XML ")):(o.openBlock(),o.createElementBlock("span",nn," ❌ Invalid XML "))])])):o.createCommentVNode("",!0),o.createElementVNode("div",on,[a.value?(o.openBlock(),o.createElementBlock("div",ln,[h.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"xml-declaration",style:o.normalizeStyle({color:c.value.colors.xmlDeclaration})},o.toDisplayString(h.value),5)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(k.value,(T,$)=>(o.openBlock(),o.createBlock(Ht,{key:$,node:T,index:$,level:0,expanded:d.value,theme:c.value,onToggleExpand:N,onCopy:m},null,8,["node","index","expanded","theme"]))),128))])):(o.openBlock(),o.createElementBlock("div",sn,[A[0]||(A[0]=o.createElementVNode("h4",null,"XML Parse Error:",-1)),o.createElementVNode("pre",null,o.toDisplayString(i.value),1)]))])],2))}}),[["__scopeId","data-v-f9125514"]]),cn=[be],dn={install:r=>{cn.forEach(e=>{const t=e.name||e.__name||"UnknownComponent";r.component(t,e)})}};q.JsonFormat=be,q.XmlFormat=an,q.default=dn,Object.defineProperties(q,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
14
+ `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}oe.prototype.build=function(n){return this.options.preserveOrder?lr(n,this.options):(Array.isArray(n)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(n={[this.options.arrayNodeName]:n}),this.j2x(n,0,[]).val)},oe.prototype.j2x=function(n,e,t){let s="",o="";const l=t.join(".");for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i))if(typeof n[i]>"u")this.isAttribute(i)&&(o+="");else if(n[i]===null)this.isAttribute(i)||i===this.options.cdataPropName?o+="":i[0]==="?"?o+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:o+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(n[i]instanceof Date)o+=this.buildTextValNode(n[i],i,"",e);else if(typeof n[i]!="object"){const d=this.isAttribute(i);if(d&&!this.ignoreAttributesFn(d,l))s+=this.buildAttrPairStr(d,""+n[i]);else if(!d)if(i===this.options.textNodeName){let a=this.options.tagValueProcessor(i,""+n[i]);o+=this.replaceEntitiesValue(a)}else o+=this.buildTextValNode(n[i],i,"",e)}else if(Array.isArray(n[i])){const d=n[i].length;let a="",c="";for(let g=0;g<d;g++){const p=n[i][g];if(!(typeof p>"u"))if(p===null)i[0]==="?"?o+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:o+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(typeof p=="object")if(this.options.oneListGroup){const x=this.j2x(p,e+1,t.concat(i));a+=x.val,this.options.attributesGroupName&&p.hasOwnProperty(this.options.attributesGroupName)&&(c+=x.attrStr)}else a+=this.processTextOrObjNode(p,i,e,t);else if(this.options.oneListGroup){let x=this.options.tagValueProcessor(i,p);x=this.replaceEntitiesValue(x),a+=x}else a+=this.buildTextValNode(p,i,"",e)}this.options.oneListGroup&&(a=this.buildObjectNode(a,i,c,e)),o+=a}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const d=Object.keys(n[i]),a=d.length;for(let c=0;c<a;c++)s+=this.buildAttrPairStr(d[c],""+n[i][d[c]])}else o+=this.processTextOrObjNode(n[i],i,e,t);return{attrStr:s,val:o}},oe.prototype.buildAttrPairStr=function(n,e){return e=this.options.attributeValueProcessor(n,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&e==="true"?" "+n:" "+n+'="'+e+'"'};function dr(n,e,t,s){const o=this.j2x(n,t+1,s.concat(e));return n[this.options.textNodeName]!==void 0&&Object.keys(n).length===1?this.buildTextValNode(n[this.options.textNodeName],e,o.attrStr,t):this.buildObjectNode(o.val,e,o.attrStr,t)}oe.prototype.buildObjectNode=function(n,e,t,s){if(n==="")return e[0]==="?"?this.indentate(s)+"<"+e+t+"?"+this.tagEndChar:this.indentate(s)+"<"+e+t+this.closeTag(e)+this.tagEndChar;{let o="</"+e+this.tagEndChar,l="";return e[0]==="?"&&(l="?",o=""),(t||t==="")&&n.indexOf("<")===-1?this.indentate(s)+"<"+e+t+l+">"+n+o:this.options.commentPropName!==!1&&e===this.options.commentPropName&&l.length===0?this.indentate(s)+`<!--${n}-->`+this.newLine:this.indentate(s)+"<"+e+t+l+this.tagEndChar+n+this.indentate(s)+o}},oe.prototype.closeTag=function(n){let e="";return this.options.unpairedTags.indexOf(n)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`></${n}`,e},oe.prototype.buildTextValNode=function(n,e,t,s){if(this.options.cdataPropName!==!1&&e===this.options.cdataPropName)return this.indentate(s)+`<![CDATA[${n}]]>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(s)+`<!--${n}-->`+this.newLine;if(e[0]==="?")return this.indentate(s)+"<"+e+t+"?"+this.tagEndChar;{let o=this.options.tagValueProcessor(e,n);return o=this.replaceEntitiesValue(o),o===""?this.indentate(s)+"<"+e+t+this.closeTag(e)+this.tagEndChar:this.indentate(s)+"<"+e+t+">"+o+"</"+e+this.tagEndChar}},oe.prototype.replaceEntitiesValue=function(n){if(n&&n.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const t=this.options.entities[e];n=n.replace(t.regex,t.val)}return n};function ur(n){return this.options.indentBy.repeat(n)}function fr(n){return n.startsWith(this.options.attributeNamePrefix)&&n!==this.options.textNodeName?n.substr(this.attrPrefixLen):!1}const hr={validate:$e},pr={ignoreAttributes:!1,attributeNamePrefix:"@_",textNodeName:"#text",ignoreDeclaration:!1,commentPropName:"#comment",cdataPropName:"__cdata",preserveOrder:!0,parseAttributeValue:!1,trimValues:!0,parseTagValue:!1,processEntities:!0,htmlEntities:!1,ignoreNameSpace:!1,allowBooleanAttributes:!0,unpairedTags:[],stopNodes:[],alwaysCreateTextNode:!1},mr={ignoreAttributes:!1,attributeNamePrefix:"@_",textNodeName:"#text",format:!0,indentBy:" ",suppressEmptyNode:!1,suppressBooleanAttributes:!1,suppressUnpairedNode:!1},gr=n=>{try{const e=hr.validate(n,{allowBooleanAttributes:!0});return e===!0?{valid:!0}:{valid:!1,error:`Line ${e.err.line}: ${e.err.msg}`}}catch(e){return{valid:!1,error:e instanceof Error?e.message:"Unknown validation error"}}},Fe=(n,e)=>{try{return new or({...pr,...e}).parse(n)}catch(t){throw new Error(`XML 解析失败: ${t instanceof Error?t.message:"Unknown error"}`)}},Ae=(n,e)=>{try{let s=new oe({...mr,format:e?.format??!0,indentBy:e?.indentBy??" "}).build(n);return e?.showDeclaration!==!1&&!s.startsWith("<?xml")&&(s=`<?xml version="1.0" encoding="UTF-8"?>
15
+ `+s),s}catch(t){throw new Error(`XML 构建失败: ${t instanceof Error?t.message:"Unknown error"}`)}},yr=n=>Array.isArray(n)?se(n,{format:!1}):Ae(n,{format:!1,showDeclaration:!1}),br=(n,e)=>{const t=Fe(n);return Array.isArray(t)?se(t,{indent:e?.indentBy}):Ae(t,e)},se=(n,e={})=>{const t=e.indent!==void 0?e.indent:" ",s=e.level||0,o=e.format!==!1,l=o?t.repeat(s):"",i=o?`
16
+ `:"";let d="";for(const a of n){if(a["?xml"]){const _=a[":@"]||{},I=Object.entries(_).map(([U,H])=>`${U.startsWith("@_")?U.substring(2):U}="${H}"`).join(" ");d+=`<?xml ${I}?>${i}`;continue}if(a["#comment"]){const _=a["#comment"];if(Array.isArray(_)&&_.length>0){const I=_[0]["#text"]||_[0];d+=`${l}<!--${I}-->${i}`}continue}const c=Object.keys(a).find(_=>!_.startsWith(":")&&!_.startsWith("#")&&!_.startsWith("__"));if(!c)continue;const g=a[c],p=a[":@"]||{},x=Object.entries(p).map(([_,I])=>`${_.startsWith("@_")?_.substring(2):_}="${I}"`).join(" "),E=x?" "+x:"";if(!Array.isArray(g)||g.length===0){d+=`${l}<${c}${E}/>${i}`;continue}const v=g.length===1&&g[0]["#text"]!==void 0;if(g.some(_=>_.__cdata)){const _=g.find(I=>I.__cdata);if(_){const I=_.__cdata[0]["#text"]||"";d+=`${l}<${c}${E}><![CDATA[${I}]]></${c}>${i}`}}else if(v){const _=g[0]["#text"];d+=`${l}<${c}${E}>${_}</${c}>${i}`}else d+=`${l}<${c}${E}>${i}`,d+=se(g,{indent:t,level:s+1,format:o}),d+=`${l}</${c}>${i}`}return d},Er={key:0,class:"xml-format__toolbar"},_r={class:"xml-format__actions"},xr=["disabled"],kr=["disabled"],Nr=["disabled"],wr=["disabled"],Ar=["disabled"],Cr={class:"xml-format__info"},Br={key:0,class:"xml-format__status xml-format__status--success"},Tr={key:1,class:"xml-format__status xml-format__status--error"},vr={class:"xml-format__content"},Sr={key:0,class:"xml-format__error"},Or={key:1,class:"xml-format__viewer"},$r=ge(r.defineComponent({__name:"index",props:{modelValue:{default:""},readonly:{type:Boolean,default:!1},maxDepth:{default:10},showToolbar:{type:Boolean,default:!0},theme:{default:"github-light"},showComments:{type:Boolean,default:!0},showCdata:{type:Boolean,default:!0},preserveWhitespace:{type:Boolean,default:!1}},emits:["update:modelValue","copy-success","copy-error","expand-all","collapse-all","compress","format"],setup(n,{expose:e,emit:t}){r.useCssVars(N=>({"1078f5f2":c.value.colors.border,"3b7af818":c.value.colors.background,e476ff1a:c.value.colors.text,"434e9f96":c.value.colors.surfaceBackground,e9a92178:c.value.colors.buttonBorder,61940446:c.value.colors.buttonBackground,47092645:c.value.colors.buttonText,"6c26ded4":c.value.colors.buttonBackgroundHover,"7905142c":c.value.colors.buttonPrimary,"1d1c8572":c.value.colors.buttonPrimaryHover,e94e1206:c.value.colors.success,"4e8c500b":c.value.colors.successBackground,"29fdff82":c.value.colors.error,23583650:c.value.colors.errorBackground}));const s=n,o=t,l=r.ref(null),i=r.ref(""),d=r.ref(new Set),a=r.computed(()=>i.value===""),c=r.computed(()=>gn(s.theme)),g=r.computed(()=>!l.value||!Array.isArray(l.value)?[]:l.value.map((N,B)=>({node:N,originalIndex:B})).filter(N=>!N.node["?xml"])),p=r.computed(()=>{if(!l.value||!Array.isArray(l.value))return null;const N=l.value.find($=>$["?xml"]);if(!N||!N[":@"])return null;const B=N[":@"],P=[];return B["@_version"]&&P.push(`version="${B["@_version"]}"`),B["@_encoding"]&&P.push(`encoding="${B["@_encoding"]}"`),B["@_standalone"]&&P.push(`standalone="${B["@_standalone"]}"`),P.length>0?`<?xml ${P.join(" ")}?>`:null}),x=r.computed(()=>g.value),E=N=>{if(!N||!N.trim()){i.value="",l.value=null;return}try{const B=gr(N);if(!B.valid){i.value=B.error||"Invalid XML",l.value=null;return}l.value=Fe(N),i.value="",r.nextTick(()=>{S()})}catch(B){i.value=B instanceof Error?B.message:"Unknown parse error",l.value=null}},v=N=>{d.value.has(N)?d.value.delete(N):d.value.add(N)},S=()=>{const N=new Set,B=(P,$="")=>{Array.isArray(P)&&P.forEach((T,j)=>{const h=Object.keys(T).find(y=>!y.startsWith(":")&&!y.startsWith("#"));if(!h)return;const b=$?`${$}.${h}[${j}]`:`${h}[${j}]`;N.add(b);const u=T[h];Array.isArray(u)&&B(u,b+"."+h)})};g.value.forEach(({node:P,originalIndex:$})=>{const T=Object.keys(P).find(j=>!j.startsWith(":")&&!j.startsWith("#"));if(T){const j=`${T}[${$}]`;N.add(j);const h=P[T];Array.isArray(h)&&B(h,j+"."+T)}}),d.value=N,o("expand-all")},_=()=>{d.value.clear(),o("collapse-all")},I=async()=>{if(!(!a.value||!l.value))try{const N=Array.isArray(l.value)?se(l.value,{indent:" "}):Ae(l.value,{format:!0,indentBy:" "});await navigator.clipboard.writeText(N),o("copy-success",N)}catch(N){const B=N instanceof Error?N:new Error("Copy failed");o("copy-error",B),console.error("Failed to copy XML:",N)}},U=()=>{if(!(!a.value||!l.value))try{const N=yr(l.value);o("update:modelValue",N),o("compress",N)}catch(N){console.error("Failed to compress XML:",N)}},H=()=>{if(a.value)try{const N=br(s.modelValue,{format:!0,indentBy:" "});o("update:modelValue",N),o("format",N)}catch(N){console.error("Failed to format XML:",N)}},X=async N=>{try{const B=typeof N=="string"?N:JSON.stringify(N,null,2);await navigator.clipboard.writeText(B),o("copy-success",B)}catch(B){const P=B instanceof Error?B:new Error("Copy failed");o("copy-error",P),console.error("Failed to copy value:",B)}},Z=(N,B,P)=>{if(!(!l.value||!Array.isArray(l.value)))try{const $=N.split(/\./).filter(Boolean);let T=l.value;for(let h=0;h<$.length;h++){const b=$[h],u=b.match(/^(.+?)\[(\d+)\]$/);if(u){const y=u[1],k=parseInt(u[2]);if(h===$.length-1){if(Array.isArray(T)&&T[k]){const w=T[k];if(w[B]){const A=w[B];delete w[B],w[P]=A}}}else Array.isArray(T)&&T[k]&&(T=T[k])}else T[b]&&(T=T[b])}const j=se(l.value,{indent:" "});o("update:modelValue",j)}catch($){console.error("Failed to update tag name:",$)}},ee=(N,B,P)=>{if(!(!l.value||!Array.isArray(l.value)))try{const $=N.split(/\./).filter(Boolean);let T=l.value;for(let h=0;h<$.length;h++){const b=$[h],u=b.match(/^(.+?)\[(\d+)\]$/);if(u){const y=u[1],k=parseInt(u[2]);if(h===$.length-1){if(Array.isArray(T)&&T[k]){const A=T[k][":@"];if(A&&A[`@_${B}`]!==void 0){const V=A[`@_${B}`];delete A[`@_${B}`],A[`@_${P}`]=V}}}else Array.isArray(T)&&T[k]&&(T=T[k])}else T[b]&&(T=T[b])}const j=se(l.value,{indent:" "});o("update:modelValue",j)}catch($){console.error("Failed to update attribute name:",$)}},le=(N,B,P)=>{if(!(!l.value||!Array.isArray(l.value)))try{const $=N.split(/\./).filter(Boolean);let T=l.value;for(let h=0;h<$.length;h++){const b=$[h],u=b.match(/^(.+?)\[(\d+)\]$/);if(u){const y=u[1],k=parseInt(u[2]);if(h===$.length-1){if(Array.isArray(T)&&T[k]){const A=T[k][":@"];A&&A[`@_${B}`]!==void 0&&(A[`@_${B}`]=P)}}else Array.isArray(T)&&T[k]&&(T=T[k])}else T[b]&&(T=T[b])}const j=se(l.value,{indent:" "});o("update:modelValue",j)}catch($){console.error("Failed to update attribute value:",$)}},D=(N,B)=>{if(!(!l.value||!Array.isArray(l.value)))try{const P=N.split(/\./).filter(Boolean);let $=l.value,T="";for(let h=0;h<P.length;h++){const b=P[h],u=b.match(/^(.+?)\[(\d+)\]$/);if(u){const y=u[1],k=parseInt(u[2]);if(h===P.length-1){if(Array.isArray($)&&$[k]){const w=$[k];if(T=Object.keys(w).find(A=>!A.startsWith(":")&&!A.startsWith("#"))||"",T&&Array.isArray(w[T])){const A=w[T],V=A.findIndex(K=>K["#text"]!==void 0);V!==-1?A[V]["#text"]=B:A.push({"#text":B})}}}else Array.isArray($)&&$[k]&&($=$[k])}else $[b]&&($=$[b])}const j=se(l.value,{indent:" "});o("update:modelValue",j)}catch(P){console.error("Failed to update text content:",P)}};return r.watch(()=>s.modelValue,N=>{E(N)},{immediate:!0}),e({copyXml:I,compressSource:U,formatSource:H,expandAll:S,collapseAll:_,toggleExpand:v,isValidXml:()=>a.value,getParsedXml:()=>l.value,getExpandedNodes:()=>d.value,getParseError:()=>i.value,parseXmlString:N=>E(N),copyValue:N=>X(N)}),(N,B)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["xml-format",`xml-format--${c.value.name}`])},[N.showToolbar?(r.openBlock(),r.createElementBlock("div",Er,[r.createElementVNode("div",_r,[r.createElementVNode("button",{class:"xml-format__btn xml-format__btn--primary",onClick:I,disabled:!a.value,title:"Copy XML"}," 📋 Copy ",8,xr),r.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:S,disabled:!a.value,title:"Expand All"}," ⬇️ Expand All ",8,kr),r.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:_,disabled:!a.value,title:"Collapse All"}," ➡️ Collapse All ",8,Nr),r.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:U,disabled:!a.value,title:"Compress XML"}," 📦 Compress ",8,wr),r.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:H,disabled:!a.value,title:"Format XML"}," ✨ Format ",8,Ar)]),r.createElementVNode("div",Cr,[a.value?(r.openBlock(),r.createElementBlock("span",Br," ✅ Valid XML ")):(r.openBlock(),r.createElementBlock("span",Tr," ❌ Invalid XML "))])])):r.createCommentVNode("",!0),r.createElementVNode("div",vr,[a.value?(r.openBlock(),r.createElementBlock("div",Or,[p.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"xml-declaration",style:r.normalizeStyle({color:c.value.colors.xmlDeclaration})},r.toDisplayString(p.value),5)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(x.value,(P,$)=>(r.openBlock(),r.createBlock(mn,{key:$,node:P.node,index:P.originalIndex,level:0,expanded:d.value,theme:c.value,onToggleExpand:v,onCopy:X,"onUpdate:tagName":Z,"onUpdate:attributeName":ee,"onUpdate:attributeValue":le,"onUpdate:textContent":D},null,8,["node","index","expanded","theme"]))),128))])):(r.openBlock(),r.createElementBlock("div",Sr,[B[0]||(B[0]=r.createElementVNode("h4",null,"XML Parse Error:",-1)),r.createElementVNode("pre",null,r.toDisplayString(i.value),1)]))])],2))}}),[["__scopeId","data-v-28f02178"]]),Pr=[Te],Vr={install:n=>{Pr.forEach(e=>{const t=e.name||e.__name||"UnknownComponent";n.component(t,e)})}};te.JsonFormat=Te,te.XmlFormat=$r,te.default=Vr,Object.defineProperties(te,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});