const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-B9CcSXi0.js","assets/index-BPRWoLf4.js","assets/index-4ekmjfYC.css"])))=>i.map(i=>d[i]);
import{f as r,o as K,dl as j,s as b,ai as D,v as f,w as v,z as c,P as g,Q as o,D as J}from"./index-BPRWoLf4.js";var P=r.lazy(function(){return K(()=>import("./main-B9CcSXi0.js").then(t=>t.m),__vite__mapDeps([0,1,2])).then(j)}),V=function(t){b(a,t);function a(){return t!==null&&t.apply(this,arguments)||this}return a.prototype.emitChange=function(l){var n=this.props,e=n.onChange,i=n.name;return!i||!e?!1:(e(l.updated_src,i),!0)},a.prototype.shouldExpandNode=function(l){var n=l.namespace,e=this.props.levelExpand;return typeof e!="number"?!1:n.length>e},a.prototype.render=function(){var l,n,e=this.props,i=e.className,_=e.style,p=e.jsonTheme,C=e.classnames,E=e.placeholder,d=e.source;e.levelExpand;var u=e.mutable,O=e.displayDataTypes,x=e.enableClipboard,N=e.iconStyle,S=e.quotesOnKeys,T=e.sortKeys,y=e.name,F=e.ellipsisThreshold,h=D(this.props),s=h;if(d!==void 0&&f(d))s=v(d,this.props.data,"| raw");else if(typeof h=="string")try{s=JSON.parse(h)}catch{}var m=p;return f(p)&&(m=v(p,this.props.data,"| raw")),~["string","number","boolean"].indexOf(typeof s)&&(s=(l={},l[typeof s]=s,l)),r.createElement("div",{className:C("JsonField",i),style:_},typeof s>"u"||s===null?E:r.createElement(r.Suspense,{fallback:r.createElement("div",null,"...")},r.createElement(P,{name:!1,src:s,theme:(n=m)!==null&&n!==void 0?n:"rjv-default",shouldCollapse:this.shouldExpandNode,enableClipboard:x,displayDataTypes:O,collapseStringsAfterLength:F,iconStyle:N,quotesOnKeys:S,sortKeys:T,onEdit:y&&u?this.emitChange:!1,onDelete:y&&u?this.emitChange:!1,onAdd:y&&u?this.emitChange:!1})))},a.defaultProps={placeholder:"-",levelExpand:1,source:"",displayDataTypes:!1,enableClipboard:!1,iconStyle:"square",quotesOnKeys:!0,sortKeys:!1,ellipsisThreshold:!1},c([g,o("design:type",Function),o("design:paramtypes",[Object]),o("design:returntype",void 0)],a.prototype,"emitChange",null),c([g,o("design:type",Function),o("design:paramtypes",[Object]),o("design:returntype",void 0)],a.prototype,"shouldExpandNode",null),a}(r.Component),w=function(t){b(a,t);function a(){return t!==null&&t.apply(this,arguments)||this}return a=c([J({type:"json"})],a),a}(V);export{V as JSONField,w as JSONFieldRenderer,P as JsonView};
