1import{j as r}from"./main-vender-CM-VP2-iR__IKzB-260610_2157.js";import{r as b}from"./chunk-vender-CM-VP2-Dcfnv5gk-260610_2157.js";import"./chunk-vender-CM-VP2-C1L4kzod-260610_2157.js";const fe=(e,t,n,o,s)=>{if(!o)throw new Error(s??`Invalid property path: ${t} 2Couldn't access "${n}" in ${JSON.stringify(e)}`)},ct=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Ie=e=>Array.isArray(e),pt=(e,t)=>e.filter(((n,o)=>o!==t)),Mt=(e,t,n,o={})=>{const{remove:s=!1,createNew:l=!0,noError:c=!1}=o,u=e,a=typeof(i=t)=="string"?i:typeof i=="number"?String(i):i.reduce(((p,j)=>typeof j=="number"?`${p}[${j}]`:p===""?j:`${p}.${j}`),"");var i;const g=Object.assign(Object.assign({},o),{remove:s,createNew:l,noError:c,fullData:u,fullPath:a}),d=Array.isArray(t)?t:(p=>Array.isArray(p)?p:p.split(/(\.|\[\d+\])/).filter((j=>j!=="."&&j!=="")).map((j=>{const E=/\[(\d+)\]/.exec(j);return E?Number(E[1]):j})).flat())(t).filter((p=>p!==""));return Ie(e)&&s&&d.length===1?pt(e,d[0]):Te(e,d,n,g)},Te=(e,t,n,o)=>{const s=ct(e)?Object.assign({},e):null,l=Ie(e)?[...e]:null;if(t.length===0)return e;if(!s&&!l)throw new Error("Can't assign property -- invalid input object");const{createNew:c,remove:u,noError:a,fullData:i,fullPath:g}=o,d=t[0];if(l&&typeof d=="string")return l.map((k=>Te(k,t,n,o)));if(t.length===1){if(s&&typeof d=="string"){const k=zt(s,d,n,o);return k??s}return l&&typeof d=="number"?(Ft(l,d,n,o),l):(fe(i,g,d,a),e)}const p=s||l||[];if(u&&t.length===2&&typeof t[1]=="number"){const k=p[d],w=t[1];return Ie(k)?p[d]=pt(k,w):fe(i,g,d,a,"Trying to remove an indexed item from an object that is not an array"),p}const j=t.slice(1);if(d in e){if(E=p[d],!Ie(E)&&!ct(E)){if(!c)return fe(i,g,d,a),p;p[d]={}}return p[d]=Te(p[d],j,n,o),p}var E;if(c){const k=typeof j[0]=="number"?[]:{};if(s)return p[d]=k,p[d]=Te(p[d],j,n,o),p;if(l&&Array.isArray(p)){p.push(k);const w=p.length-1;return p[w]=Te(p[w],j,n,o),p}}return fe(i,g,d,a),p},zt=(e,t,n,o)=>{const{remove:s,createNew:l,noError:c,insertAfter:u,insertBefore:a,fullData:i,fullPath:g}=o;if(a||u){const p=Object.entries(e);let j=p.findIndex((([E,k])=>E===(a??u)));return u&&j++,p.splice(j,0,[t,n]),Object.fromEntries(p)}const d=t in e;s?d?delete e[t]:fe(i,g,t,c):l||d?e[t]=n:fe(i,g,t,c)},Ft=(e,t,n,o)=>{const{noError:s,fullData:l,fullPath:c,createNew:u,insert:a}=o;a&&e.splice(t,0,n),t in e?e[t]=n:u?e.push(n):fe(l,c,t,s)},_e=(e,t,n)=>{const o=Array.isArray(t)?t:It(t);if(o.length===0)return e;const s=o[0];if(Array.isArray(e)&&typeof s!="number")return e.map((c=>_e(c,o,n)));if(typeof e!="object"||e===null||!(s in e))return _t(e,s,n);const l=e[s];return o.length===1?l:_e(l,o.slice(1),n)},It=e=>e.split(/(\.|\[\d+\])/).filter((t=>t!=="."&&t!=="")).map((t=>{const n=/\[(\d+)\]/.exec(t);return n?Number(n[1]):t})).flat(),_t=(e,t,n)=>{if(n===void 0)throw new Error(`Unable to extract object property 3Looking for property: ${t} 4In object: ${JSON.stringify(e)}`);return n};function Ee(e,t,n,o){return new(n||(n=Promise))((function(s,l){function c(i){try{a(o.next(i))}catch(g){l(g)}}function u(i){try{a(o.throw(i))}catch(g){l(g)}}function a(i){var g;i.done?s(i.value):(g=i.value,g instanceof n?g:new n((function(d){d(g)}))).then(c,u)}a((o=o.apply(e,[])).next())}))}const gt=({className:e,name:t,value:n,setValue:o,handleKeyPress:s,styles:l})=>{if(typeof n!="string")return null;const c=n.slice(-1)===` 5`?n+".":n;return r.jsxs("div",{style:{display:"grid"},children:[r.jsx("textarea",{id:`${t}
5_textarea`,style:Object.assign({height:"auto",gridArea:"1 / 1 / 2 / 2",overflowY:"auto",whiteSpace:"pre-wrap"},l),rows:1,className:e,name:`${t}_textarea`,value:n,onChange:u=>o(u.target.value),autoFocus:!0,onFocus:u=>{n.length<40&&u.target.select()},onKeyDown:s}),r.jsx("span",{className:e,style:Object.assign({visibility:"hidden",height:"auto",gridArea:"1 / 1 / 2 / 2",color:"red",opacity:.9,whiteSpace:"pre-wrap",overflowY:"auto",border:"1px solid transparent"},l),children:c})]})},Le=e=>e!==null&&typeof e=="object",mt=(e,t,n,o="")=>{if(!n&&!o)return!0;switch(e){case"collection":if(n){if(n(t,o))return!0;if(!Xe(o,t,n))return!1}if(!n&&o&&!Xe(o,t))return!1;break;case"value":if(n&&!n(t,o)||!n&&o&&!xe(t,o))return!1}return!0},Xe=(e="",t,n=xe)=>{const o=t.value;return Object.entries(o).some((([s,l])=>{const c=[...t.path,s],u=Object.assign(Object.assign({},t),{key:s,path:c,level:t.level+1,value:l,size:c.length,parentData:o});return Le(l)?Xe(e,u,n):n(u,e)}))},xe=(e,t="")=>{const{value:n}=e;if(n===null&&"null".includes(t.toLowerCase()))return!0;switch(typeof n){case"string":return n.toLowerCase().includes(t.toLowerCase());case"number":return!!String(n).includes(t);case"boolean":return n?"true".includes(t.toLowerCase())||t==="1":"false".includes(t.toLowerCase())||t==="0";default:return!1}},dt=({key:e,path:t},n="")=>!!xe({value:e},n)||!!t.some((o=>xe({value:o},n))),ht=(e,t=200)=>typeof e=="string"?e.length<t?e:`${e.slice(0,t-2).trim()}...`:e,Pe=e=>e.map((t=>t===""?"\0":t)).join("."),yt={default:{displayName:"Default",fragments:{edit:"rgb(42, 161, 152)"},styles:{container:{backgroundColor:"#f6f6f6",fontFamily:"monospace"},collection:{},collectionInner:{},collectionElement:{},dropZone:{},property:"#292929",bracket:{color:"rgb(0, 43, 54)",fontWeight:"bold"},itemCount:{color:"rgba(0, 0, 0, 0.3)",fontStyle:"italic"},string:"rgb(203, 75, 22)",number:"rgb(38, 139, 210)",boolean:"green",null:{color:"rgb(220, 50, 47)",fontVariant:"small-caps",fontWeight:"bold"},input:["#292929"],inputHighlight:"#b3d8ff",error:{fontSize:"0.8em",color:"red",fontWeight:"bold"},iconCollection:"rgb(0, 43, 54)",iconEdit:"edit",iconDelete:"rgb(203, 75, 22)",iconAdd:"edit",iconCopy:"rgb(38, 139, 210)",iconOk:"green",iconCancel:"rgb(203, 75, 22)"}},githubDark:{displayName:"Github Dark",styles:{container:{backgroundColor:"#0d1117",color:"white"},dropZone:"rgba(165, 214, 255, 0.17)",property:"#E6EDF3",bracket:"#56d364",itemCount:"#8B949E",string:"#A5D6FF",number:"#D2A8FF",boolean:{color:"#FF7B72",fontSize:"90%",fontWeight:"bold"},null:"green",iconCollection:"#D2A8FF",iconEdit:"#D2A8FF",iconDelete:"rgb(203, 75, 22)",iconAdd:"rgb(203, 75, 22)",iconCopy:"#A5D6FF",iconOk:"#56d364",iconCancel:"rgb(203, 75, 22)"}},githubLight:{displayName:"Github Light",styles:{container:"white",property:"#1F2328",bracket:"#00802e",itemCount:"#8B949E",string:"#0A3069",number:"#953800",boolean:{color:"#CF222E",fontSize:"90%",fontWeight:"bold"},null:"#FF7B72",iconCollection:"#8250DF",iconEdit:"#8250DF",iconDelete:"rgb(203, 75, 22)",iconAdd:"#8250DF",iconCopy:"#57606A"}},monoDark:{displayName:"Black & White",fragments:{lightText:{color:"white"},midGrey:"#5c5c5c"},styles:{container:["lightText",{backgroundColor:"black"}],dropZone:"#e0e0e029",property:"lightText",bracket:"midGrey",itemCount:"#4a4a4a",string:"#a8a8a8",number:"#666666",boolean:{color:"#848484",fontStyle:"italic"},null:"#333333",iconCollection:"midGrey",iconEdit:"midGrey",iconDelete:"midGrey",iconAdd:"midGrey",iconCopy:"midGrey",iconOk:"midGrey",iconCancel:"midGrey"}},monoLight:{fragments:{midGrey:"#a3a3a3"},displayName:"White & Black",styles:{container:"white",property:"black",bracket:"midGrey",itemCount:"#b5b5b5",string:"#575757",number:"#999999",boolean:{color:"#7b7b7b",fontStyle:"italic"},null:"#cccccc",iconCollection:"midGrey",iconEdit:"midGrey",iconDelete:"midGrey",iconAdd:"midGrey",iconCopy:"midGrey",iconOk:"midGrey",iconCancel:"midGrey"}},candyWrapper:{displayName:"Candy Wrapper",fragments:{minty:{backgroundColor:"#F1FAEE"},pale:{color:"#A8DADC"},mid:{color:"#457B9D"},dark:{color:"#1D3557"},pop:{color:"#E63946"},darkBlue:{color:"#2B2D42"}},styles:{container:"minty",property:"pop",dropZone:"#eb121217",bracket:"dark",itemCount:"pale",string:"mid",number:["darkBlue",{fontSize:"85%"}],boolean:["mid",{fontStyle:"italic",fontWeight:"bold",fontSize:"80%"}],null:["#cccccc",{fontWeight:"bold"}
5],input:{border:"1px solid rgb(115, 194, 198)"},iconCollection:"#1D3557",iconEdit:"#457B9D",iconDelete:"#E63946",iconAdd:"#2B2D42",iconCopy:"#1D3557",iconCancel:"#E63946"}},psychedelic:{displayName:"Psychedelic",fragments:{pale:{color:"#A8DADC"},fluroYellow:"rgb(242, 228, 21)",fluroGreen:"rgb(68, 255, 62)",hotPink:"#f7379a"},styles:{container:{backgroundColor:"unset",background:"linear-gradient(90deg, hsla(333, 100%, 53%, 1) 0%, hsla(33, 94%, 57%, 1) 100%)",color:"black"},dropZone:"fluroYellow",property:"black",bracket:"fluroYellow",itemCount:["pale",{opacity:.7}],string:"white",number:["#33d9ff",{fontSize:"90%",fontWeight:"bold"}],boolean:["fluroGreen",{fontWeight:"bold",fontSize:"80%"}],null:["black",{fontWeight:"bold",opacity:.3,backgroundColor:"rgb(255, 255, 255, 0.5)",padding:"0 0.4em",borderRadius:"0.4em"}],iconCollection:"fluroYellow",iconEdit:["black"],iconDelete:["white",{opacity:.5}],iconAdd:["white",{opacity:.5}],iconCopy:"rgb(32, 84, 242)",iconOk:"fluroGreen",iconCancel:"hotPink"}}},Lt=yt.default,ft=b.createContext({getStyles:()=>({}),icons:{}}),Kt=({theme:e="default",icons:t={},children:n})=>{const o=Bt(e);return r.jsx(ft.Provider,{value:{getStyles:(s,l)=>typeof o[s]=="function"?o[s](l):o[s],icons:t},children:n})},oe=()=>b.useContext(ft),Bt=e=>{var t,n,o,s;const l={},c=(Array.isArray(e)?e:[e]).map((i=>e==="default"?{}:typeof i=="string"?ze(yt[i],l):Wt(i)?ze({fragments:{},styles:i},l):ze(i,l))),u=ze(Lt,{});Object.keys(u).forEach((i=>{const g=i;c.forEach((d=>{d[g]&&(u[g]=Object.assign(Object.assign({},u[g]),d[g]))}))}));const a=Object.assign({},u);return Object.entries(l).forEach((([i,g])=>{const d=i;a[d]=p=>{const j=g(p)||{};return Object.assign(Object.assign({},u[d]),j)}})),typeof a?.inputHighlight!="function"&&(!((t=a?.inputHighlight)===null||t===void 0)&&t.backgroundColor)&&document.documentElement.style.setProperty("--jer-highlight-color",(n=a?.inputHighlight)===null||n===void 0?void 0:n.backgroundColor),typeof a?.iconCopy!="function"&&(!((o=a?.iconCopy)===null||o===void 0)&&o.color)&&document.documentElement.style.setProperty("--jer-icon-copy-color",(s=a?.iconCopy)===null||s===void 0?void 0:s.color),a},ze=(e,t)=>{const{fragments:n,styles:o}=e,s={};return Object.entries(o).forEach((([l,c])=>{const u=(Array.isArray(c)?c:[c]).reduce(((a,i)=>{var g;if(typeof i=="function")return t[l]=i,Object.assign({},a);if(typeof i=="string"){const d=(g=n?.[i])!==null&&g!==void 0?g:i;return typeof d=="string"?Object.assign(Object.assign({},a),{[Gt[l]]:d}):Object.assign(Object.assign({},a),d)}return Object.assign(Object.assign({},a),i)}),{});s[l]=u})),s},Wt=e=>!("styles"in e),Gt={container:"backgroundColor",collection:"backgroundColor",collectionInner:"backgroundColor",collectionElement:"backgroundColor",dropZone:"borderColor",property:"color",bracket:"color",itemCount:"color",string:"color",number:"color",boolean:"color",null:"color",input:"color",inputHighlight:"backgroundColor",error:"color",iconCollection:"color",iconEdit:"color",iconDelete:"color",iconAdd:"color",iconCopy:"color",iconOk:"color",iconCancel:"color"},Ze="**INVALID_FUNCTION**",$t=({value:e,setValue:t,isEditing:n,path:o,setIsEditing:s,handleEdit:l,handleCancel:c,stringTruncate:u,showStringQuotes:a,nodeData:i})=>{const{getStyles:g}=oe(),d=Pe(o),p=a?'"':"";return n?r.jsx(gt,{className:"jer-input-text",name:d,value:e,setValue:t,isEditing:n,handleKeyPress:j=>{j.key!=="Enter"||j.shiftKey?j.key==="Escape"&&c():l()},styles:g("input",i)}):r.jsxs("div",{id:`${d}_display`,onDoubleClick:()=>s(!0),onClick:j=>{(j.getModifierState("Control")||j.getModifierState("Meta"))&&s(!0)},className:"jer-value-string",style:g("string",i),children:[p,ht(e,u),p]})},Ut=({value:e,setValue:t,isEditing:n,path:o,setIsEditing:s,handleEdit:l,handleCancel:c,nodeData:u})=>{const{getStyles:a}=oe();return n?r.jsx("input",{className:"jer-input-number",type:"text",name:Pe(o),value:e,onChange:i=>t(i.target.value.replace(/[^0-9.-]/g,"")),autoFocus:!0,onFocus:i=>i.target.select(),onKeyDown:i=>{switch(i.key){case"Enter":l();break;case"Escape":c();break;case"ArrowUp":i.preventDefault(),t(Number(e)+1);break;case"ArrowDown":i.preventDefault(),t(Number(e)-1)}}
5,style:Object.assign({width:String(e).length/1.5+2+"em"},a("input",u))}):r.jsx("span",{onDoubleClick:()=>s(!0),className:"jer-value-number",style:a("number",u),children:e})},Ht=({value:e,setValue:t,isEditing:n,path:o,setIsEditing:s,handleEdit:l,handleCancel:c,nodeData:u})=>{const{getStyles:a}=oe();return n?r.jsx("input",{className:"jer-input-boolean",type:"checkbox",name:Pe(o),checked:e,onChange:()=>t(!e),onKeyDown:i=>{i.key==="Enter"?l():i.key==="Escape"&&c()},autoFocus:!0}):r.jsx("span",{onDoubleClick:()=>s(!0),className:"jer-value-boolean",style:a("boolean",u),children:String(e)})},Yt=({value:e,isEditing:t,setIsEditing:n,handleEdit:o,handleCancel:s,nodeData:l})=>{const{getStyles:c}=oe();b.useEffect((()=>(t&&document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u))),[t]);const u=a=>{a.key==="Enter"?o():a.key==="Escape"&&s()};return r.jsx("div",{onDoubleClick:()=>n(!0),className:"jer-value-null",style:c("null",l),children:String(e)})},Jt=({value:e})=>{let t="Error!";switch(typeof e){case"string":e===Ze&&(t="Function");break;case"undefined":t="Undefined";break;case"symbol":t="Symbol"}return r.jsx("span",{className:"jer-value-invalid",children:t})},Xt=({size:e,style:t,className:n})=>r.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:n,style:t,children:[r.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z"}),r.jsx("path",{d:"M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm0 18c-4.411 0-8-3.589-8-8s3.589-8 8-8 8 3.589 8 8-3.589 8-8 8z"})]}),Zt=({size:e,style:t,className:n})=>r.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:n,style:t,transform:"translate(0, 0.5)",children:[r.jsx("path",{d:"M7 17.013l4.413-.015 9.632-9.54c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.756-.756-2.075-.752-2.825-.003L7 12.583v4.43zM18.045 4.458l1.589 1.583-1.597 1.582-1.586-1.585 1.594-1.58zM9 13.417l6.03-5.973 1.586 1.586-6.029 5.971L9 15.006v-1.589z"}),r.jsx("path",{d:"M5 21h14c1.103 0 2-.897 2-2v-8.668l-2 2V19H8.158c-.026 0-.053.01-.079.01-.033 0-.066-.009-.1-.01H5V5h6.847l2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2z"})]}),Qt=({size:e,style:t,className:n})=>r.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:n,style:t,children:r.jsx("path",{d:"M6 19a2 2 0 002 2h8a2 2 0 002-2V7H6v12m2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12M15.5 4l-1-1h-5l-1 1H5v2h14V4h-3.5z"})}),qt=({size:e,style:t,className:n})=>r.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:e,height:e,className:n,style:t,children:[r.jsx("path",{d:"M9 2 H15 A1 1 0 0 1 16 3 V5 A1 1 0 0 1 15 6 H9 A1 1 0 0 1 8 5 V3 A1 1 0 0 1 9 2 z"}),r.jsx("path",{d:"M8 4H6a2 2 0 00-2 2v14a2 2 0 002 2h12a2 2 0 002-2v-2M16 4h2a2 2 0 012 2v4M21 14H11"}),r.jsx("path",{d:"M15 10l-4 4 4 4"})]}),en=({size:e,style:t,className:n})=>r.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:e,height:e,className:n,style:t,children:[r.jsx("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"}),r.jsx("path",{d:"M22 4L12 14.01l-3-3"})]}),tn=({size:e,style:t,className:n})=>r.jsx("svg",{baseProfile:"tiny",viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:n,style:t,children:r.jsx("path",{d:"M12 4c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8zm-5 8c0-.832.224-1.604.584-2.295l6.711 6.711A4.943 4.943 0 0112 17c-2.757 0-5-2.243-5-5zm9.416 2.295L9.705 7.584A4.943 4.943 0 0112 7c2.757 0 5 2.243 5 5 0 .832-.224 1.604-.584 2.295z"})}),nn=({size:e,style:t,className:n})=>r.jsx("svg",{viewBox:"0 0 512 512",fill:"currentColor",width:e,height:e,className:n,style:t,children:r.jsx("path",{d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})}),be=({name:e,nodeData:t,rotate:n})=>{var o,s,l,c,u,a,i;const{getStyles:g,icons:d}=oe(),p={size:"1.4em",className:"jer-icon"};switch(e){case"add":return(o=d?.add)!==null&&o!==void 0?o:r.jsx(Xt,Object.assign({},p,{style:g("iconAdd",t)}));case"edit":return(s=d?.edit)!==null&&s!==void 0?s:r.jsx(Zt,Object.assign({},p,{style:g("iconEdit",t)}));case"delete":return(l=d?.delete)!==null&&l!==void 0?l:r.jsx(Qt,Object.assign({},p,{style:g("iconDelete",t),size:"1.45em"}));case"copy":return(c=d?.copy)!==null&&c!==void 0?c:r.jsx(qt,Object.assign({},p,{style:g("iconCopy",t),size:"1.2em"}));case"ok":return(u=d?.ok)!==null&&u!==void 0?u:r.jsx(en,Object.assign({},p,{style:Object.assign({fontSize:"90%"},g("iconOk",t))}));case"cancel":return(a=d?.cancel)!==null&&a!==void 0?a:r.jsx(tn,Ob
5ject.assign({},p,{style:Object.assign({fontSize:"130%"},g("iconCancel",t))}));case"chevron":return(i=d?.chevron)!==null&&i!==void 0?i:r.jsx(nn,{size:"1em",style:g("iconCollection",t)});default:return r.jsx(r.Fragment,{})}},bt=({startEdit:e,handleDelete:t,handleAdd:n,enableClipboard:o,type:s,customButtons:l,nodeData:c,translate:u})=>{const{getStyles:a}=oe(),i=u("KEY_NEW",c),[g,d]=b.useState(!1),[p,j]=b.useState(i),{key:E,path:k,value:w}=c;return r.jsxs("div",{className:"jer-edit-buttons",style:{opacity:g?1:void 0},children:[o&&r.jsx("div",{onClick:m=>{m.stopPropagation();let f,x="value",N="";o&&((m.ctrlKey||m.metaKey)===!0?(f=rn(k),N=f,x="path"):(f=w,N=s?JSON.stringify(w,null,2):String(f)),navigator.clipboard.writeText(N)),typeof o=="function"&&o({value:f,stringValue:N,path:k,key:E,type:x})},className:"jer-copy-pulse",children:r.jsx(be,{name:"copy",nodeData:c})}),e&&r.jsx("div",{onClick:m=>{m.stopPropagation(),e()},children:r.jsx(be,{name:"edit",nodeData:c})}),t&&r.jsx("div",{onClick:m=>{m.stopPropagation(),t()},children:r.jsx(be,{name:"delete",nodeData:c})}),n&&r.jsx("div",{onClick:m=>{m.stopPropagation(),s==="object"?d(!0):n("")},children:r.jsx(be,{name:"add",nodeData:c})}),l?.map((({Element:m,onClick:f},x)=>r.jsx("div",{onClick:N=>f(c,N),children:r.jsx(m,{})},x))),g&&n&&s==="object"&&r.jsxs(r.Fragment,{children:[r.jsx("input",{className:"jer-input-new-key",type:"text",name:"new-object-key",value:p,onChange:m=>j(m.target.value),autoFocus:!0,onFocus:m=>m.target.select(),onKeyDown:m=>{m.key==="Enter"&&n?(d(!1),n(p),j(i)):m.key==="Escape"&&(d(!1),j(i))},style:a("input",c)}),r.jsx(Qe,{onOk:m=>{p&&(m.stopPropagation(),d(!1),n(p))},onCancel:m=>{m.stopPropagation(),d(!1)},nodeData:c})]})]})},Qe=({onOk:e,onCancel:t,nodeData:n})=>r.jsxs("div",{className:"jer-confirm-buttons",children:[r.jsx("div",{onClick:e,children:r.jsx(be,{name:"ok",nodeData:n})}),r.jsx("div",{onClick:t,children:r.jsx(be,{name:"cancel",nodeData:n})})]}),rn=e=>e.reduce(((t,n)=>typeof n=="number"?`${t}[${n}]`:t===""?n:`${t}.${n}`),""),on=["string","number","boolean","null","object","array"],jt=(e=[],t)=>{const n=e.filter((({condition:E})=>E(t)));if(n.length===0)return{};const o=n[0],{element:s,wrapperElement:l,customNodeProps:c,wrapperProps:u,hideKey:a=!1,showEditTools:i=!0,showOnEdit:g=!1,showOnView:d=!0,showCollectionWrapper:p=!0}=o,j=(function(E,k){var w={};for(var m in E)Object.prototype.hasOwnProperty.call(E,m)&&k.indexOf(m)<0&&(w[m]=E[m]);if(E!=null&&typeof Object.getOwnPropertySymbols=="function"){var f=0;for(m=Object.getOwnPropertySymbols(E);f<m.length;f++)k.indexOf(m[f])<0&&Object.prototype.propertyIsEnumerable.call(E,m[f])&&(w[m[f]]=E[m[f]])}return w})(o,["element","wrapperElement","customNodeProps","wrapperProps","hideKey","showEditTools","showOnEdit","showOnView","showCollectionWrapper"]);return Object.assign({CustomNode:s,CustomWrapper:l,customNodeProps:c,wrapperProps:u,hideKey:a,showEditTools:i,showOnEdit:g,showOnView:d,showCollectionWrapper:p},j)},vt=b.createContext({collapseState:null,setCollapseState:()=>{},doesPathMatch:()=>!1,currentlyEditingElement:null,setCurrentlyEditingElement:()=>{},areChildrenBeingEdited:()=>!1,dragSource:{path:null,pathString:null},setDragSource:()=>{}}),an=({children:e})=>{const[t,n]=b.useState(null),[o,s]=b.useState(null),[l,c]=b.useState({path:null,pathString:null});return r.jsx(vt.Provider,{value:{collapseState:t,setCollapseState:u=>{n(u),u!==null&&setTimeout((()=>n(null)),2e3)},doesPathMatch:u=>{if(t===null)return!1;for(const[a,i]of t.path.entries())if(i!==u[a])return!1;return!0},currentlyEditingElement:o,setCurrentlyEditingElement:s,areChildrenBeingEdited:u=>o!==null&&o.includes(u),dragSource:l,setDragSource:c},children:e})},Ke=()=>b.useContext(vt),Et=({props:e,collapsed:t})=>{const{data:n,nodeData:o,parentData:s,onEdit:l,onError:c,showErrorMessages:u,restrictEditFilter:a,restrictDeleteFilter:i,restrictAddFilter:g,restrictDragFilter:d,translate:p,errorMessageTimeout:j}=e,{currentlyEditingElement:E,setCurrentlyEditingElement:k}=Ke(),[w,m]=b.useState(null),f=Object.assign(Object.assign({},o),{collapsed:t}),{path:x,key:N,size:P}=f,F=Pe(x),M=b.useMemo((()=>!a(f)),[f]),S=b.useMemo((()=>!i(f)),[f]),z=b.useMemo((()=>!g(f)),[f]),V=b.useMemo((()=>!d(f)&&S&&E===null),[f]),ae=I=>{u&&(m(I),setTimeout((()=>m(null)),j)),console.warn("Error",I)},ie=b.useMemo((()=>(I,se)=>{ae(I.message),c&&c({currentData:f.fullData,errorValue:se,currentValue:n,name:N,path:x,error:I})}),[c,u]),J=E===F,$=E===`key_${F}`,B=typeof x.slice(-1)[0]=="number";return{pathString:F,nodeData:f,path:x,name:N,size:P,canEdit:M,canDelete:S,canAdd:z,canDrag:V,error:w,showError:ae,onError:ie,setError:m,handleEditKey:I=>{if(k(null),N===I||!s)return;const se=x.slice(0,-1);if(Object.keys(s).includes(I))return void ie({code:"KEY_EXISTS",message:p("ERROR_KEY_EXISTS",f)},I);const de=Object.fromEntries(Object.entries(s).map((([X,W])=>X===N?[I,W]:[X,W])));l(de,se).then((X=>{X&&ie({code:"UPDATE_ERROR",message:X},I)}))},derivedValues:{isEditing:J,isEditingKey:$,isArray:B,canEditKey:s!==null&&M&&z&&S&&!B}}},xt=({canDrag:e,canDragOnto:t,path:n,nodeData:o,onMove:s,onError:l,translate:c})=>{const{getStyles:u}=oe(),{dragSource:a,setDragSource:i}=Ke(),[g,d]=b.useState(!1),p=Pe(n),j=b.useMemo((()=>e?{onDragStart:m=>{m.stopPropagation(),i({path:n,pathString:p})},onDragEnd:m=>{m.stopPropagation(),i({path:null,pathString:null})}}:{}),[e]),E=b.useMemo((()=>m=>t?{onDragOver:f=>{f.stopPropagation(),f.preventDefault()},onDrop:f=>{f.stopPropagation(),w(m),i({path:null,pathString:null}),d(!1)},onDragEnter:f=>{var x;f.stopPropagation(),p.startsWith((x=a.pathString)!==null&&x!==void 0?x:"")||d(m)},onDragExit:f=>{f.stopPropagation(),d(!1)}}:{}),[a,t]),k=b.useMemo((()=>t&&a.pathString!==null?r.jsx("div",Object.assign({className:"jer-drop-target-bottom",style:{height:"50%",position:"absolute",width:"100%",top:"50%",zIndex:n.length}},E("below"))):null),[a,t]),w=m=>{var f,x;const N=(f=a.path)===null||f===void 0?void 0:f.slice(-1)[0],P=(x=a.path)===null||x===void 0?void 0:x.slice(0,-1).join("."),F=n.slice(0,-1).join(""),{parentData:M}=o;typeof N=="string"&&M&&!Array.isArray(M)&&Object.keys(M).includes(N)&&N in M&&P!==F?l({code:"KEY_EXISTS",message:c("ERROR_KEY_EXISTS",o)},N):s(a.path,n,m).then((S=>{S&&l({code:"UPDATE_ERROR",message:S},o.value)}))};return{dragSourceProps:j,getDropTargetProps:E,BottomDropTarget:k,DropTargetPadding:({position:m,nodeData:f})=>g===m?r.jsx("div",{className:"jer-drag-n-drop-padding",style:u("dropZone",f)}):null,handleDrop:w}},sn=(e,t)=>{var n,o;const s=document.getElementsByClassName("jer-editor-container"),l=parseInt(s.length>0?getComputedStyle(s[0]).getPropertyValue("line-height"):"16px"),c=((o=(n=t.current)===null||n===void 0?void 0:n.offsetWidth)!==null&&o!==void 0?o:0)/(.5*l),u=JSON.stringify(e,null,2).replace(/\\n
5/g,` 6`).split(` 7`).map((a=>Math.ceil(a.length/c))).reduce(((a,i)=>a+i),0)*l;return Math.min(u+30,window.innerHeight-50)},Dt=e=>{const{data:t,parentData:n,onEdit:o,onDelete:s,onChange:l,onMove:c,enableClipboard:u,canDragOnto:a,restrictTypeSelection:i,searchFilter:g,searchText:d,showLabel:p,stringTruncate:j,showStringQuotes:E,indent:k,translate:w,customNodeDefinitions:m}=e,{getStyles:f}=oe(),{setCurrentlyEditingElement:x,setCollapseState:N}=Ke(),[P,F]=b.useState(typeof t=="function"?Ze:t),{pathString:M,nodeData:S,path:z,name:V,canEdit:ae,canDelete:ie,canDrag:J,error:$,onError:B,handleEditKey:I,derivedValues:se}=Et({props:e}),{dragSourceProps:de,getDropTargetProps:X,BottomDropTarget:W,DropTargetPadding:le}=xt({canDrag:J,canDragOnto:a,path:z,nodeData:S,onMove:c,onError:B,translate:w}),_=jt(m,S),[v,A]=b.useState(Fe(t,_)),Z=b.useCallback((y=>{if(!l)return void F(y);const D=l({currentData:S.fullData,newValue:y,currentValue:P,name:V,path:z});F(D)}),[l]);b.useEffect((()=>{F(typeof t=="function"?Ze:t),A(Fe(t,_))}),[t,$]);const{CustomNode:ue,customNodeProps:pe,hideKey:De,showEditTools:L=!0,showOnEdit:ge,showOnView:me}=_,he=[...on,...m.filter((({showInTypesSelector:y=!1,name:D})=>y&&!!D)).map((({name:y})=>y))],G=b.useMemo((()=>{if(typeof i=="boolean")return i?[]:he;if(Array.isArray(i))return i;const y=i(S);return typeof y=="boolean"?y?[]:he:y}),[S,i]);if(!mt("value",S,g,d))return null;const Q=()=>{let y;switch(x(null),v){case"object":y={[w("DEFAULT_NEW_KEY",S)]:P};break;case"array":y=P??[];break;case"number":{const D=Number(P);y=isNaN(D)?0:D;break}default:y=P}o(y,z).then((D=>{D&&B({code:"UPDATE_ERROR",message:D},y)}))},te=()=>{x(null),F(t),A(Fe(t,_))},{isEditing:q,isEditingKey:je,canEditKey:we}=se,ve=!q&&$,U=q&&G.length>0,ye=v!=="invalid"&&!$&&L,O=p&&je,C=p&&!je&&!De,R={value:P,parentData:n,setValue:Z,isEditing:q,setIsEditing:ae?()=>x(M):()=>{},handleEdit:Q,handleCancel:te,path:z,stringTruncate:j,showStringQuotes:E,nodeData:S,translate:w},K=ue&&(q&&ge||!q&&me)?r.jsx(ue,Object.assign({},e,{value:P,customNodeProps:pe,setValue:Z,handleEdit:Q,handleCancel:te,handleKeyPress:y=>{y.key==="Enter"?Q():y.key==="Escape"&&te()},isEditing:q,setIsEditing:()=>x(M),getStyles:f})):ln(Fe(t),R);return r.jsxs("div",Object.assign({className:"jer-component jer-value-component",style:{marginLeft:k/2+"em",position:"relative"},draggable:J},de,X("above"),{children:[W,r.jsx(le,{position:"above",nodeData:S}),r.jsxs("div",{className:"jer-value-main-row",style:{flexWrap:V.length>10?"wrap":"nowrap"},children:[C&&r.jsx("span",{className:"jer-key-text",style:Object.assign(Object.assign({},f("property",S)),{minWidth:`${Math.min(String(V).length+1,5)}ch`,flexShrink:V.length>10?1:0}),onDoubleClick:()=>we&&x(`key_${M}`),children:V===""?r.jsx("span",{className:z.length>0?"jer-empty-string":void 0}):`${V}:`}),O&&r.jsx("input",{className:"jer-input-text jer-key-edit",type:"text",name:M,defaultValue:V,autoFocus:!0,onFocus:y=>y.target.select(),onKeyDown:y=>{y.key==="Enter"?I(y.target.value):y.key==="Escape"&&te()},style:{width:String(V).length/1.5+.5+"em"}}),r.jsxs("div",{className:"jer-value-and-buttons",children:[r.jsx("div",{className:"jer-input-component",children:K}),q?r.jsx(Qe,{onOk:Q,onCancel:te,nodeData:S}):ye&&r.jsx(bt,{startEdit:ae?()=>x(M):void 0,handleDelete:ie?()=>{s(P,z).then((y=>{y&&B({code:"DELETE_ERROR",message:y},P)}))}:void 0,enableClipboard:u,translate:w,customButtons:e.customButtons,nodeData:S}),U&&r.jsxs("div",{className:"jer-select",children:[r.jsx("select",{name:`${V}-type-select`,className:"jer-type-select",onChange:y=>(D=>{const ne=m.find((ce=>ce.name===D));if(ne)o(ne.defaultValue,z),A(D),x(null),N({path:z,collapsed:!1});else{const ce=cn(P,D,w("DEFAULT_NEW_KEY",S),_?.CustomNode?w("DEFAULT_STRING",S):void 0);Z(ce),o(ce,z).then((H=>{H&&(B({code:"UPDATE_ERROR",message:H},ce),x(null))}))}})(y.target.value),value:v,children:G.map((y=>r.jsx("option",{value:y,children:y},y)))}),r.jsx("span",{className:"focus"})]}),ve&&r.jsx("span",{className:"jer-error-slug",style:f("error",S),children:$})]})]}),r.jsx(le,{position:"below",nodeData:S})]}))},Fe=(e,t)=>t?.CustomNode&&t?.name&&t.showInTypesSelector?t.name:typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="boolean"?"boolean":e===null?"null":"invalid",ln=(e,t)=>{const n=t.value;switch(e){case"string":return r.jsx($t,Object.assign({},t,{value:n}));case"number":return r.jsx(Ut,Object.assign({},t,{value:n}));case"boolean":return r.jsx(Ht,Object.assign({},t,{value:n}));case"null":return r.jsx(Yt,Object.assign({},t));default:return r.jsx(Jt,Object.assign({},t))}},cn=(e,t,n,o)=>{switch(t){case"string":return o??String(e);case"number":{const s=Number(e);return isNaN(s)?0:s}case"boolean":return!!e;case"null":return null;case"object":return{[n]:e};case"array":return[e];default:return String(e)}},wt=e=>{const{getStyles:t}
7=oe(),{collapseState:n,setCollapseState:o,doesPathMatch:s,currentlyEditingElement:l,setCurrentlyEditingElement:c,areChildrenBeingEdited:u}=Ke(),{data:a,nodeData:i,parentData:g,showCollectionCount:d,onEdit:p,onAdd:j,onDelete:E,canDragOnto:k,collapseFilter:w,collapseAnimationTime:m,onMove:f,enableClipboard:x,searchFilter:N,searchText:P,indent:F,keySort:M,showArrayIndices:S,defaultValue:z,translate:V,customNodeDefinitions:ae,jsonParse:ie,jsonStringify:J}=e,[$,B]=b.useState(J(a)),I=w(i),{contentRef:se,isAnimating:de,maxHeight:X,collapsed:W,animateCollapse:le}=((h,T,re)=>{const[Se,Me]=b.useState(re?0:void 0),[Ge,Vt]=b.useState(re),$e=b.useRef(!1),Ue=b.useRef(null),it=b.useRef(0),st=b.useRef();return{contentRef:Ue,isAnimating:$e.current,animateCollapse:He=>{var Ye,Je;if(Ge!==He){switch(window.clearTimeout(st.current),$e.current=!0,He){case!0:{const lt=(Je=(Ye=Ue.current)===null||Ye===void 0?void 0:Ye.offsetHeight)!==null&&Je!==void 0?Je:0;it.current=lt,Me(lt),setTimeout((()=>{Me(0)}),5);break}case!1:Me(it.current||sn(h,Ue))}Vt(!Ge),st.current=window.setTimeout((()=>{$e.current=!1,He||Me(void 0)}),T)}},maxHeight:Se,collapsed:Ge}})(a,m,I),{pathString:_,nodeData:v,path:A,name:Z,size:ue,canEdit:pe,canDelete:De,canAdd:L,canDrag:ge,error:me,setError:he,onError:G,handleEditKey:Q,derivedValues:te}=Et({props:e,collapsed:W}),{dragSourceProps:q,getDropTargetProps:je,BottomDropTarget:we,DropTargetPadding:ve}=xt({canDrag:ge,canDragOnto:k,path:A,nodeData:v,onMove:f,onError:G,translate:V}),U=b.useRef(!I);b.useEffect((()=>{B(J(a))}),[a]),b.useEffect((()=>{const h=w(v)&&!te.isEditing;U.current=!h,le(h)}),[w]),b.useEffect((()=>{n!==null&&s(A)&&(U.current=!0,le(n.collapsed))}),[n]);const ye=b.useMemo((()=>(h,T)=>typeof z!="function"?z:z(h,T)),[z]),{CustomNode:O,customNodeProps:C,CustomWrapper:R,wrapperProps:K={},hideKey:y,showEditTools:D=!0,showOnEdit:ne,showOnView:ce,showCollectionWrapper:H=!0}=b.useMemo((()=>jt(ae,v)),[]);if(!mt("collection",v,N,P)&&v.level>0)return null;const Y=Array.isArray(a)?"array":"object",Ce=Y==="array"?{open:"[",close:"]"}:{open:"{",close:"}"},Re=h=>{h.key==="Enter"&&(h.metaKey||h.shiftKey||h.ctrlKey)?Be():h.key==="Escape"&&Ve()},ke=h=>{if(h.getModifierState("Alt"))return U.current=!0,void o({collapsed:!W,path:A});l&&l.includes(_)||(U.current=!0,o(null),le(!W))},Be=()=>{try{const h=ie($);if(c(null),he(null),JSON.stringify(h)===JSON.stringify(a))return;p(h,A).then((T=>{T&&G({code:"UPDATE_ERROR",message:T},h)}))}catch{G({code:"INVALID_JSON",message:V("ERROR_INVALID_JSON",v)},$)}},Ct=A.length>0?()=>{E(a,A).then((h=>{h&&G({code:"DELETE_ERROR",message:h},_e(a,A))}))}:void 0,Ve=()=>{c(null),he(null),B(J(a))},{isEditing:ee,isEditingKey:kt,isArray:St,canEditKey:Ot}=te,qe=d==="when-closed"?W:d,Nt=!ee&&D,At=(S||!St)&&!y&&Z!==void 0,Tt=O&&(ee&&ne||!ee&&ce),Pt=M&&Y==="object",et=Object.entries(a).map((([h,T])=>[Y==="array"?Number(h):h,T]));Pt&&et.sort(typeof M=="function"?(h,T)=>M(h[0],T[0]):void 0);const tt=U.current?ee?r.jsx("div",{className:"jer-collection-text-edit",children:r.jsxs("div",{children:[r.jsx(gt,{className:"jer-collection-text-area",name:_,value:$,setValue:B,isEditing:ee,handleKeyPress:Re,styles:t("input",v)}),r.jsx("div",{className:"jer-collection-input-button-row",children:r.jsx(Qe,{onOk:Be,onCancel:Ve,nodeData:v})})]})}):et.map((([h,T],re)=>{const Se={key:h,value:T,path:[...A,h],level:A.length+1,index:re,size:Le(T)?Object.keys(T).length:1,parentData:a,fullData:v.fullData};return r.jsx("div",{className:"jer-collection-element",style:t("collectionElement",Se),children:Le(T)?r.jsx(wt,Object.assign({},e,{data:T,parentData:a,nodeData:Se,showCollectionCount:d,canDragOnto:pe}),h):r.jsx(Dt,Object.assign({},e,{data:T,parentData:a,nodeData:Se,canDragOnto:pe,showLabel:Y==="object"||S}),h)},h)})):null,We=!!H&&W;We||(U.current=!0);const nt=Object.assign(Object.assign({},e),{data:a,value:a,parentData:g,nodeData:v,setValue:h=>Ee(void 0,void 0,void 0,(function*(){return yield p(h,A)})),handleEdit:Be,handleCancel:Ve,handleKeyPress:Re,isEditing:ee,setIsEditing:()=>c(_),getStyles:t,canDragOnto:pe}),Rt=Tt?r.jsx(O,Object.assign({customNodeProps:C},nt,{children:tt})):tt,rt=kt?r.jsx("input",{className:"jer-input-text jer-key-edit",type:"text",name:_,defaultValue:Z,autoFocus:!0,onFocus:h=>h.target.select(),onKeyDown:h=>{h.key==="Enter"?Q(h.target.value):h.key==="Escape"&&Ve()},style:{width:String(Z).length/1.5+.5+"em"}}):At&&r.jsx("span",{className:"jer-key-text",style:t("property",v),onClick:h=>h.stopPropagation(),onDoubleClick:()=>Ot&&c(`key_${_}`),children:Z===""?r.jsx("span",{className:A.length>0?"jer-empty-string":void 0}):`${Z}:`}),ot=Nt&&r.jsx(bt,{startEdit:pe?()=>
7{U.current=!0,c(_)}:void 0,handleAdd:L?h=>{le(!1);const T=ye(v,h);Y==="array"?j(T,[...A,a.length]).then((re=>{re&&G({code:"ADD_ERROR",message:re},T)})):h in a?G({code:"KEY_EXISTS",message:V("ERROR_KEY_EXISTS",v)},h):j(T,[...A,h]).then((re=>{re&&G({code:"ADD_ERROR",message:re},T)}))}:void 0,handleDelete:De?Ct:void 0,enableClipboard:x,type:Y,nodeData:v,translate:V,customButtons:e.customButtons}),at=r.jsxs("div",Object.assign({className:"jer-component jer-collection-component",style:Object.assign(Object.assign({marginLeft:(A.length===0?0:F/2)+"em"},t("collection",v)),{position:"relative"}),draggable:ge},q,je("above"),{children:[r.jsx("div",{className:"jer-clickzone",style:{width:F/2+1+"em",zIndex:10+2*v.level},onClick:h=>ke(h)}),!ee&&we,r.jsx(ve,{position:"above",nodeData:v}),H?r.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},onClick:h=>ke(h),children:[r.jsxs("div",{className:"jer-collection-name",children:[r.jsx("div",{className:"jer-collapse-icon jer-accordion-icon"+(W?" jer-rotate-90":""),style:{zIndex:11+2*v.level},onClick:h=>ke(h),children:r.jsx(be,{name:"chevron",rotate:W,nodeData:v})}),rt,!ee&&r.jsx("span",{className:"jer-brackets jer-bracket-open",style:t("bracket",v),children:Ce.open})]}),!ee&&qe&&r.jsx("div",{className:"jer-collection-item-count"+(qe?" jer-visible":" jer-hidden"),style:t("itemCount",v),children:ue===1?V("ITEM_SINGLE",Object.assign(Object.assign({},v),{size:1}),1):V("ITEMS_MULTIPLE",v,ue)}),r.jsx("div",{className:"jer-brackets"+(We?" jer-visible":" jer-hidden"),style:t("bracket",v),children:Ce.close}),ot]}):y?r.jsx(r.Fragment,{}):r.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},children:[rt,ot]}),r.jsxs("div",{className:"jer-collection-inner",style:Object.assign({overflowY:We||de?"clip":"visible",maxHeight:u(_)?void 0:X},t("collectionInner",v)),ref:se,children:[Rt,r.jsx("div",{className:ee?"jer-collection-error-row":"jer-collection-error-row-edit",children:me&&r.jsx("span",{className:"jer-error-slug",style:t("error",v),children:me})}),!ee&&H&&r.jsx("div",{className:"jer-brackets jer-bracket-outside",style:Object.assign(Object.assign({},t("bracket",v)),{marginLeft:(F<3?-1:F<6?-.5:0)+"em"}),children:Ce.close})]}),r.jsx(ve,{position:"below",nodeData:v})]}));return R?r.jsx(R,Object.assign({customNodeProps:K},nt,{children:at})):at},dn={ITEM_SINGLE:"{{count}} item",ITEMS_MULTIPLE:"{{count}} items",KEY_NEW:"Enter new key",ERROR_KEY_EXISTS:"Key already exists",ERROR_INVALID_JSON:"Invalid JSON",ERROR_UPDATE:"Update unsuccessful",ERROR_DELETE:"Delete unsuccessful",ERROR_ADD:"Adding node unsuccessful",DEFAULT_STRING:"New data!",DEFAULT_NEW_KEY:"key"},un=(e,t)=>(n,o,s)=>((l,c,u,a,i)=>{if(c[a]){const d=c[a](u);if(d!==null)return d}const g=a in l?l[a]:dn[a];return i===void 0?g:g?.replace("{{count}}",String(i))})(e,t,o,n,s);var ut=[],Oe=[];(function(e,t){if(e&&typeof document<"u"){var n,o=t.prepend===!0?"prepend":"append",s=t.singleTag===!0,l=typeof t.container=="string"?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(s){var c=ut.indexOf(l);c===-1&&(c=ut.push(l)-1,Oe[c]={}),n=Oe[c]&&Oe[c][o]?Oe[c][o]:Oe[c][o]=u()}else n=u();e.charCodeAt(0)===65279&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function u(){var a=document.createElement("style");if(a.setAttribute("type","text/css"),t.attributes)for(var i=Object.keys(t.attributes),g=0;g<i.length;g++)a.setAttribute(i[g],t.attributes[i[g]]);var d=o==="prepend"?"afterbegin":"beforeend";return l.insertAdjacentElement(d,a),a}})(':root{--jer-select-border:#b6b6b6;--jer-select-focus:#777;--jer-select-arrow:#777;--jer-form-border:1px solid #ededf0;--jer-form-border-focus:1px solid #e2e2e2;--jer-expand-transition-time:0.3s;--jer-highlight-color:#b3d8ff}.jer-visible{opacity:1}.jer-hidden,.jer-visible{transition:var(--jer-expand-transition-time)}.jer-hidden{opacity:0}
7.jer-select select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;color:#000;cursor:inherit;font-family:inherit;font-size:.8em;line-height:inherit;margin:0;outline:none;padding:0 1em 0 0;z-index:1}select::-ms-expand{display:none}.jer-select{align-items:center;background-color:#fff;background-image:linear-gradient(0deg,#f9f9f9,#fff 33%);border:1px solid var(--jer-select-border);border-radius:.25em;cursor:pointer;display:grid;grid-template-areas:"select";line-height:1.1;max-width:15ch;min-width:12ch;padding:.25em .5em;position:relative}.jer-select select,.jer-select:after{grid-area:select}.jer-select:not(.jer-select--multiple):after{background-color:var(--jer-select-arrow);clip-path:polygon(100% 0,0 0,50% 100%);content:"";height:.5em;justify-self:end;width:.8em}select:focus+.focus{border:1px solid var(--jer-select-focus);border-radius:inherit;bottom:-1px;left:-1px;position:absolute;right:-1px;top:-1px}.jer-editor-container{border-radius:.5em;font-size:16px;line-height:1;padding:1em 1em 1em 2em;position:relative;text-align:left}.jer-editor-container textarea{border:var(--jer-form-border);border-radius:.3em;color:var(--jer-input-color);outline:none}.jer-editor-container textarea:focus{border:var(--jer-form-border-focus)}.jer-editor-container input{border:var(--jer-form-border);border-radius:.3em;font-family:inherit;outline:none}.jer-editor-container input:focus{border:var(--jer-form-border-focus)}.jer-editor-container ::selection{background-color:var(--jer-highlight-color)}.jer-collection-header-row,.jer-value-main-row{align-items:center;display:flex;gap:.3em;min-height:1.7em}.jer-collection-header-row{display:flex;flex-wrap:wrap}.jer-collapse-icon{left:-1.2em;position:absolute;top:.35em}.jer-collection-inner{position:relative;transition:var(--jer-expand-transition-time)}.jer-collection-text-edit{align-items:flex-start;display:flex;flex-direction:column;gap:.3em}.jer-collection-text-area{font-family:inherit;font-size:.85em;max-height:40em;overflow:hidden;padding:.2em .5em 0;resize:both}.jer-collection-input-button-row{display:flex;font-size:150%;justify-content:flex-end;margin-top:.4em}.jer-collection-error-row{bottom:.5em;position:absolute}.jer-error-slug{margin-left:1em}.jer-value-component{position:relative}.jer-value-main-row{display:flex;gap:0}.jer-value-and-buttons{align-items:center;display:flex;justify-content:flex-start;padding-left:.5em}.jer-value-error-row{position:absolute}.jer-value-string{line-height:1.3em;overflow-wrap:anywhere;white-space:pre-wrap}.jer-hyperlink{text-decoration:underline}.jer-input-text{font-family:inherit;font-size:.9em;height:1.4em;line-height:1.2em;margin:0;min-width:6em;overflow:hidden;padding:.25em .5em .2em;resize:none}.jer-input-boolean{margin-left:.3em;margin-right:.3em;transform:scale(1.5)}.jer-key-text{line-height:1.1em;white-space:pre-wrap;word-break:break-word}.jer-key-edit{font-size:inherit;font-size:.9em;padding:0 .3em}.jer-value-invalid{font-style:italic;opacity:.5}.jer-input-number{font-size:90%;min-width:3em}.jer-confirm-buttons,.jer-edit-buttons{align-items:center;cursor:pointer;display:flex;height:1em}.jer-input-buttons{gap:.4em}.jer-edit-buttons{gap:.4em;margin-left:.5em;opacity:0}.jer-confirm-buttons{gap:.2em;margin-left:.4em}.jer-edit-buttons:hover{opacity:1;position:relative}.jer-collection-header-row:hover>.jer-edit-buttons,.jer-value-and-buttons:hover>.jer-edit-buttons,.jer-value-main-row:hover>.jer-edit-buttons{opacity:1}.jer-copy-pulse{position:relative;transition:transform var(--jer-expand-transition-time)}.jer-copy-pulse:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-copy-pulse:after{border-radius:50%;box-shadow:0 0 15px 5px var(--jer-icon-copy-color);content:"";display:block;height:100%;left:0;opacity:0;position:absolute;top:0;transition:all .5s;width:100%}.jer-copy-pulse:active:after{border-radius:4em;box-shadow:0 0 0 0 var(--jer-icon-copy-color);left:0;opacity:1;position:absolute;top:0;transition:0s}.jer-copy-pulse:active{top:.07em}.jer-rotate-90{transform:rotate(-90deg)}.jer-accordion-icon,.jer-rotate-90{transition:transform var(--jer-expand-transition-time)}.jer-icon:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-empty-string:after{content:"<empty string>:";font-size:90%;font-style:italic}.jer-drag-n-drop-padding{border:1px dashed #e0e0e0;border-radius:.3em;height:.5em}.jer-clickzone{height:calc(100% - .8em);left:-1em;position:absolute;top:1.2em}',{});const pn=({data:e,setData:t,rootName:n="root",onUpdate:o=(()=>{}),onEdit:s=o,onDelete:l=o,onAdd:c=o,onChange:u,onError:a,showErrorMessages:i=!0,enableClipboard:g=!0,indent:d=2,collapse:p=!1,collapseAnimationTime:j=300,showCollectionCount:E=!0,restrictEdit:k=!1,restrictDelete:w=!1,restrictAdd:m=!1,restrictType
7Selection:f=!1,restrictDrag:x=!0,searchFilter:N,searchText:P,searchDebounceTime:F=350,keySort:M=!1,showArrayIndices:S=!0,showStringQuotes:z=!0,defaultValue:V=null,minWidth:ae=250,maxWidth:ie="min(600px, 90vw)",rootFontSize:J,stringTruncate:$=250,translations:B={},className:I,id:se,customText:de={},customNodeDefinitions:X=[],customButtons:W=[],jsonParse:le=JSON.parse,jsonStringify:_=(A=>JSON.stringify(A,null,2)),errorMessageTimeout:v=2500})=>{const{getStyles:A}=oe(),Z=b.useCallback(Ae(p),[p]),ue=b.useCallback(un(B,de),[B,de]),[pe,De]=b.useState(P),[L,ge]=(({setData:O,data:C})=>{const[R,K]=b.useState(O?void 0:C),y=b.useCallback((D=>{O?O(D):K(D)}),[O]);return b.useEffect((()=>{O||K(C)}),[C]),[O?C:R,y]})({setData:t,data:e}),me=document.querySelector(":root"),he=getComputedStyle(document.documentElement).getPropertyValue("--jer-expand-transition-time");1e3*parseFloat(he)!==j&&me?.style.setProperty("--jer-expand-transition-time",j/1e3+"s"),b.useEffect((()=>{const O=setTimeout((()=>De(P)),F);return()=>clearTimeout(O)}),[P,F]);const G={key:n,path:[],level:0,index:0,value:L,size:typeof L=="object"&&L!==null?Object.keys(L).length:1,parentData:null,fullData:L},Q=(O,C)=>Ee(void 0,void 0,void 0,(function*(){const R=yield O(C);if(R===!0||R===void 0)return void ge(C.newData);const K=mn(R)?R:["error",R],[y,D]=K;if(y==="error")return ge(C.currentData),D===!1?ue("ERROR_UPDATE",G):String(D);ge(D)})),te=b.useMemo((()=>Ae(k)),[k]),q=b.useMemo((()=>Ae(w)),[w]),je=b.useMemo((()=>Ae(m)),[m]),we=b.useMemo((()=>Ae(x)),[x]),ve=b.useMemo((()=>gn(N)),[N]),U={name:n,nodeData:G,onEdit:(O,C)=>Ee(void 0,void 0,void 0,(function*(){const{currentData:R,newData:K,currentValue:y,newValue:D}=Ne(L,C,O,"update");if(y!==D)return yield Q(s,{currentData:R,newData:K,currentValue:y,newValue:D,name:C.slice(-1)[0],path:C})})),onDelete:(O,C)=>Ee(void 0,void 0,void 0,(function*(){const{currentData:R,newData:K,currentValue:y,newValue:D}=Ne(L,C,O,"delete");return yield Q(l,{currentData:R,newData:K,currentValue:y,newValue:D,name:C.slice(-1)[0],path:C})})),onAdd:(O,C)=>Ee(void 0,void 0,void 0,(function*(){const{currentData:R,newData:K,currentValue:y,newValue:D}=Ne(L,C,O,"add");return yield Q(c,{currentData:R,newData:K,currentValue:y,newValue:D,name:C.slice(-1)[0],path:C})})),onChange:u,onError:a,showErrorMessages:i,onMove:(O,C,R)=>Ee(void 0,void 0,void 0,(function*(){if(O===null)return;const{currentData:K,newData:y,currentValue:D}=Ne(L,O,"","delete"),ne=O.slice(-1)[0],ce=C.slice(0,-1),H=C.slice(-1)[0];let Y=typeof H=="number"?R==="above"?H:H+1:typeof ne=="number"?`arr_${ne}`:ne;O.slice(0,-1).join(".")===C.slice(0,-1).join(".")&&typeof ne=="number"&&typeof Y=="number"&&ne<Y&&(Y-=1);const Ce=typeof Y=="number"?{insert:!0}:R==="above"?{insertBefore:H}:{insertAfter:H},{newData:Re,newValue:ke}=Ne(y,[...ce,Y],D,"add",Ce);return yield Q(s,{currentData:K,newData:Re,currentValue:D,newValue:ke,name:C.slice(-1)[0],path:C})})),showCollectionCount:E,collapseFilter:Z,collapseAnimationTime:j,restrictEditFilter:te,restrictDeleteFilter:q,restrictAddFilter:je,restrictTypeSelection:f,restrictDragFilter:we,canDragOnto:!1,searchFilter:ve,searchText:pe,enableClipboard:g,keySort:M,showArrayIndices:S,showStringQuotes:z,indent:d,defaultValue:V,stringTruncate:$,translate:ue,customNodeDefinitions:X,customButtons:W,parentData:null,jsonParse:le,jsonStringify:_,errorMessageTimeout:v},ye=Object.assign(Object.assign({},A("container",G)),{minWidth:ae,maxWidth:ie});return ye.fontSize=J??ye.fontSize,r.jsx("div",{id:se,className:"jer-editor-container "+I,style:ye,children:Le(L)?r.jsx(wt,Object.assign({data:L},U)):r.jsx(Dt,Object.assign({data:L,showLabel:!0},U))})},jn=e=>r.jsx(Kt,{theme:e.theme,icons:e.icons,children:r.jsx(an,{children:r.jsx(pn,Object.assign({},e))})}),Ne=(e,t,n,o,s={})=>{if(t.length===0)return{currentData:e,newData:n,currentValue:e,newValue:n};const l=Object.assign({remove:o==="delete"},s),c=o!=="add"?_e(e,t):void 0;return{currentData:e,newData:Mt(e,t,n,l),currentValue:c,newValue:o!=="delete"?n:void 0}},Ae=e=>typeof e=="boolean"?()=>e:typeof e=="number"?({level:t})=>t>=e:e,gn=e=>{if(e!==void 0)return e==="value"?xe:e==="key"?dt:e==="all"?(t,n)=>xe(t,n)||dt(t,n):e},mn=e=>Array.isArray(e)&&e.length===2&&["error","value"].includes(e[0]),hn=({value:e,setIsEditing:t,getStyles:n,customNodeProps:o,nodeData:s})=>{var l,c;const u=(l=o?.stringTruncate)!==null&&l!==void 0?l:100,a=n("string",s);return r.jsx("div",{onDoubleClick:()=>t(!0),onClick:i=>{(i.getModifierState("Control")||i.getModifierState("Meta"))&&t(!0)},className:"jer-value-string jer-hyperlink",style:a,children:r.jsxs("a",{href:e,target:"_blank",rel:"noreferrer",style:{color:(c=a.color)!==null&&c!==void 0?c:void 0},children:['"',ht(e,u),'"']})})},vn={condition:({value:e})=>typeof e=="string"&&/^https?:\/\/.+\..+$/.test(e),element:hn,showOnView:!0,showOnEdit:!1};export{Xt as IconAdd,tn as IconCancel,nn as IconChevron,qt as IconCopy,Qt as IconDelete,Zt as IconEdit,en as IconOk,jn as JsonEditor,hn as LinkCustomComponent,vn as LinkCustomNodeDefinition,Mt as assign,_e as extract,Le as isCollection,xe as matchNode,dt as matchNodeKey,yt as themes,ht as truncate};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.