Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json-edit-react

Package Overview
Dependencies
Maintainers
1
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-edit-react - npm Package Compare versions

Comparing version 1.19.0-beta1 to 1.19.0

2

build/index.cjs.js

@@ -1,1 +0,1 @@

"use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("object-property-assigner"),r=require("object-property-extractor");function o(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}l((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const a=({className:t,name:n,value:r,setValue:o,handleKeyPress:a,styles:i})=>{if("string"!=typeof r)return null;const s="\n"===r.slice(-1)?r+".":r;return e.jsxs("div",{style:{display:"grid"},children:[e.jsx("textarea",{id:`${n}_textarea`,style:Object.assign({height:"auto",gridArea:"1 / 1 / 2 / 2",overflowY:"auto",whiteSpace:"pre-wrap"},i),rows:1,className:t,name:`${n}_textarea`,value:r,onChange:e=>o(e.target.value),autoFocus:!0,onFocus:e=>{r.length<40&&e.target.select()},onKeyDown:a}),e.jsx("span",{className:t,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"},i),children:s})]})},i=e=>null!==e&&"object"==typeof e,s=(e,t,n,r="")=>{if(!n&&!r)return!0;switch(e){case"collection":if(n){if(n(t,r))return!0;if(!l(r,t,n))return!1}if(!n&&r&&!l(r,t))return!1;break;case"value":if(n&&!n(t,r))return!1;if(!n&&r&&!c(t,r))return!1}return!0},l=(e="",t,n=c)=>{const r=t.value;return Object.entries(r).some((([o,a])=>{const s=[...t.path,o],c=Object.assign(Object.assign({},t),{key:o,path:s,level:t.level+1,value:a,size:s.length,parentData:r});return i(a)?l(e,c,n):n(c,e)}))},c=(e,t="")=>{const{value:n}=e;if(null===n&&"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())||"1"===t:"false".includes(t.toLowerCase())||"0"===t;default:return!1}},d=({key:e,path:t},n="")=>!!c({value:e},n)||!!t.some((e=>c({value:e},n))),u=(e,t=200)=>"string"==typeof e?e.length<t?e:`${e.slice(0,t-2).trim()}...`:e,p=e=>e.map((e=>""===e?String.fromCharCode(0):e)).join("."),m=e=>e.shiftKey?"Shift":e.metaKey?"Meta":e.ctrlKey?"Control":e.altKey?"Alt":void 0,g=(e,t,n)=>{const r=e.key,o=m(e);if(Array.isArray(t))return!!o&&t.includes(o);const{key:a,modifier:i}=t;return("stringLineBreak"!==n||"Enter"!==r||"Shift"!==o||"Enter"!==a||!(null==i?void 0:i.includes("Shift")))&&(r===a&&(i===o||Array.isArray(i)&&i.includes(o)))},h={key:"Enter"},y={confirm:h,cancel:{key:"Escape"},objectConfirm:Object.assign(Object.assign({},h),{modifier:["Meta","Shift","Control"]}),objectLineBreak:h,stringConfirm:h,stringLineBreak:Object.assign(Object.assign({},h),{modifier:["Shift"]}),numberConfirm:h,numberUp:{key:"ArrowUp"},numberDown:{key:"ArrowDown"},booleanConfirm:h,clipboardModifier:["Meta","Control"],collapseModifier:["Alt"]},b={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)"}},f=t.createContext({getStyles:()=>({}),icons:{}}),j=({theme:t=b,icons:n={},children:r})=>{const o=x(t);return e.jsx(f.Provider,{value:{getStyles:(e,t)=>"function"==typeof o[e]?o[e](t):o[e],icons:n},children:r})},v=()=>t.useContext(f),x=e=>{var t,n,r,o;const a={},i=(Array.isArray(e)?e:[e]).map((e=>D(e)?E({fragments:{},styles:e},a):E(e,a))),s=E(b,{});Object.keys(s).forEach((e=>{const t=e;i.forEach((e=>{e[t]&&(s[t]=Object.assign(Object.assign({},s[t]),e[t]))}))}));const l=Object.assign({},s);return Object.entries(a).forEach((([e,t])=>{const n=e;l[n]=e=>{const r=t(e)||{};return Object.assign(Object.assign({},s[n]),r)}})),"function"!=typeof(null==l?void 0:l.inputHighlight)&&(null===(t=null==l?void 0:l.inputHighlight)||void 0===t?void 0:t.backgroundColor)&&document.documentElement.style.setProperty("--jer-highlight-color",null===(n=null==l?void 0:l.inputHighlight)||void 0===n?void 0:n.backgroundColor),"function"!=typeof(null==l?void 0:l.iconCopy)&&(null===(r=null==l?void 0:l.iconCopy)||void 0===r?void 0:r.color)&&document.documentElement.style.setProperty("--jer-icon-copy-color",null===(o=null==l?void 0:l.iconCopy)||void 0===o?void 0:o.color),l},E=(e,t)=>{const{fragments:n,styles:r}=e,o={};return Object.entries(r).forEach((([e,r])=>{const a=(Array.isArray(r)?r:[r]).reduce(((r,o)=>{var a,i;if("function"==typeof o)return t[e]=o,Object.assign({},r);if("string"==typeof o){const t=null!==(a=null==n?void 0:n[o])&&void 0!==a?a:o;return"string"==typeof t?Object.assign(Object.assign({},r),{[null!==(i=w[e])&&void 0!==i?i:"color"]:t}):Object.assign(Object.assign({},r),t)}return Object.assign(Object.assign({},r),o)}),{});o[e]=a})),o},D=e=>!("styles"in e),w={container:"backgroundColor",collection:"backgroundColor",collectionInner:"backgroundColor",collectionElement:"backgroundColor",dropZone:"borderColor",inputHighlight:"backgroundColor"},C=t.createContext({collapseState:null,setCollapseState:()=>{},doesPathMatch:()=>!1,currentlyEditingElement:null,setCurrentlyEditingElement:()=>{},areChildrenBeingEdited:()=>!1,dragSource:{path:null,pathString:null},setDragSource:()=>{}}),k=({children:n})=>{const[r,o]=t.useState(null),[a,i]=t.useState(null),[s,l]=t.useState({path:null,pathString:null});return e.jsx(C.Provider,{value:{collapseState:r,setCollapseState:e=>{o(e),null!==e&&setTimeout((()=>o(null)),2e3)},doesPathMatch:e=>{if(null===r)return!1;for(const[t,n]of r.path.entries())if(n!==e[t])return!1;return!0},currentlyEditingElement:a,setCurrentlyEditingElement:i,areChildrenBeingEdited:e=>null!==a&&a.includes(e),dragSource:s,setDragSource:l},children:n})},S=()=>t.useContext(C),O="**INVALID_FUNCTION**",N=({value:t,setValue:n,isEditing:r,path:o,setIsEditing:i,handleEdit:s,handleCancel:l,stringTruncate:c,showStringQuotes:d,nodeData:m,handleKeyboard:g})=>{const{getStyles:h}=v(),y=p(o),b=d?'"':"";return r?e.jsx(a,{className:"jer-input-text",name:y,value:t,setValue:n,isEditing:r,handleKeyPress:e=>{g(e,{stringConfirm:s,cancel:l,stringLineBreak:()=>{var r,o;const a=document.getElementById(`${y}_textarea`);if(a){const i=null!==(r=null==a?void 0:a.selectionStart)&&void 0!==r?r:1/0,s=null!==(o=null==a?void 0:a.selectionEnd)&&void 0!==o?o:1/0,l=t.slice(0,i),c=t.slice(s);e.target.value=l+"\n"+c,a.setSelectionRange(i+1,i+1),n(l+"\n"+c)}}})},styles:h("input",m)}):e.jsxs("div",{id:`${y}_display`,onDoubleClick:()=>i(!0),onClick:e=>{(e.getModifierState("Control")||e.getModifierState("Meta"))&&i(!0)},className:"jer-value-string",style:h("string",m),children:[b,u(t,c),b]})},A=({value:t,setValue:n,isEditing:r,path:o,setIsEditing:a,handleEdit:i,handleCancel:s,nodeData:l,handleKeyboard:c})=>{const{getStyles:d}=v();return r?e.jsx("input",{className:"jer-input-number",type:"text",name:p(o),value:t,onChange:e=>n(e.target.value.replace(/[^0-9.-]/g,"")),autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>c(e,{numberConfirm:i,cancel:s,numberUp:()=>n(Number(t)+1),numberDown:()=>n(Number(t)-1)}),style:Object.assign({width:String(t).length/1.5+2+"em"},d("input",l))}):e.jsx("span",{onDoubleClick:()=>a(!0),className:"jer-value-number",style:d("number",l),children:t})},T=({value:t,setValue:n,isEditing:r,path:o,setIsEditing:a,handleEdit:i,handleCancel:s,nodeData:l,handleKeyboard:c})=>{const{getStyles:d}=v();return r?e.jsx("input",{className:"jer-input-boolean",type:"checkbox",name:p(o),checked:t,onChange:()=>n(!t),onKeyDown:e=>c(e,{booleanConfirm:i,cancel:s}),autoFocus:!0}):e.jsx("span",{onDoubleClick:()=>a(!0),className:"jer-value-boolean",style:d("boolean",l),children:String(t)})},M=({value:n,isEditing:r,setIsEditing:o,handleEdit:a,handleCancel:i,nodeData:s,handleKeyboard:l})=>{const{getStyles:c}=v();t.useEffect((()=>(r&&document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d))),[r]);const d=e=>l(e,{confirm:a,cancel:i});return e.jsx("div",{onDoubleClick:()=>o(!0),className:"jer-value-null",style:c("null",s),children:String(n)})},P=({value:t})=>{let n="Error!";switch(typeof t){case"string":t===O&&(n="Function");break;case"undefined":n="Undefined";break;case"symbol":n="Symbol"}return e.jsx("span",{className:"jer-value-invalid",children:n})},R=({size:t,style:n,className:r})=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:t,height:t,className:r,style:n,children:[e.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z"}),e.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"})]}),V=({size:t,style:n,className:r})=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:t,height:t,className:r,style:n,transform:"translate(0, 0.5)",children:[e.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"}),e.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"})]}),z=({size:t,style:n,className:r})=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:t,height:t,className:r,style:n,children:e.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"})}),F=({size:t,style:n,className:r})=>e.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:t,height:t,className:r,style:n,children:[e.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"}),e.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"}),e.jsx("path",{d:"M15 10l-4 4 4 4"})]}),I=({size:t,style:n,className:r})=>e.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:t,height:t,className:r,style:n,children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"}),e.jsx("path",{d:"M22 4L12 14.01l-3-3"})]}),K=({size:t,style:n,className:r})=>e.jsx("svg",{baseProfile:"tiny",viewBox:"0 0 24 24",fill:"currentColor",width:t,height:t,className:r,style:n,children:e.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"})}),L=({size:t,style:n,className:r})=>e.jsx("svg",{viewBox:"0 0 512 512",fill:"currentColor",width:t,height:t,className:r,style:n,children:e.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"})}),_=({name:t,nodeData:n,rotate:r})=>{var o,a,i,s,l,c,d;const{getStyles:u,icons:p}=v(),m={size:"1.4em",className:"jer-icon"};switch(t){case"add":return null!==(o=null==p?void 0:p.add)&&void 0!==o?o:e.jsx(R,Object.assign({},m,{style:u("iconAdd",n)}));case"edit":return null!==(a=null==p?void 0:p.edit)&&void 0!==a?a:e.jsx(V,Object.assign({},m,{style:u("iconEdit",n)}));case"delete":return null!==(i=null==p?void 0:p.delete)&&void 0!==i?i:e.jsx(z,Object.assign({},m,{style:u("iconDelete",n),size:"1.45em"}));case"copy":return null!==(s=null==p?void 0:p.copy)&&void 0!==s?s:e.jsx(F,Object.assign({},m,{style:u("iconCopy",n),size:"1.2em"}));case"ok":return null!==(l=null==p?void 0:p.ok)&&void 0!==l?l:e.jsx(I,Object.assign({},m,{style:Object.assign({fontSize:"90%"},u("iconOk",n))}));case"cancel":return null!==(c=null==p?void 0:p.cancel)&&void 0!==c?c:e.jsx(K,Object.assign({},m,{style:Object.assign({fontSize:"130%"},u("iconCancel",n))}));case"chevron":return null!==(d=null==p?void 0:p.chevron)&&void 0!==d?d:e.jsx(L,{size:"1em",style:u("iconCollection",n)});default:return e.jsx(e.Fragment,{})}},B=({startEdit:n,handleDelete:r,handleAdd:o,enableClipboard:a,type:i,customButtons:s,nodeData:l,translate:c,keyboardControls:d,handleKeyboard:u})=>{const{getStyles:p}=v(),g=c("KEY_NEW",l),[h,y]=t.useState(!1),[b,f]=t.useState(g),{key:j,path:x,value:E}=l;return e.jsxs("div",{className:"jer-edit-buttons",style:{opacity:h?1:void 0},children:[a&&e.jsx("div",{onClick:e=>{e.stopPropagation();let t,n="value",r="";if(a){const o=m(e);o&&d.clipboardModifier.includes(o)?(t=G(x),r=t,n="path"):(t=E,r=i?JSON.stringify(E,null,2):String(t)),navigator.clipboard.writeText(r)}"function"==typeof a&&a({value:t,stringValue:r,path:x,key:j,type:n})},className:"jer-copy-pulse",children:e.jsx(_,{name:"copy",nodeData:l})}),n&&e.jsx("div",{onClick:e=>{e.stopPropagation(),n()},children:e.jsx(_,{name:"edit",nodeData:l})}),r&&e.jsx("div",{onClick:e=>{e.stopPropagation(),r()},children:e.jsx(_,{name:"delete",nodeData:l})}),o&&e.jsx("div",{onClick:e=>{e.stopPropagation(),"object"===i?y(!0):o("")},children:e.jsx(_,{name:"add",nodeData:l})}),null==s?void 0:s.map((({Element:t,onClick:n},r)=>e.jsx("div",{onClick:e=>n(l,e),children:e.jsx(t,{})},r))),h&&o&&"object"===i&&e.jsxs(e.Fragment,{children:[e.jsx("input",{className:"jer-input-new-key",type:"text",name:"new-object-key",value:b,onChange:e=>f(e.target.value),autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>{u(e,{stringConfirm:()=>{o&&(y(!1),o(b),f(g))},cancel:()=>{y(!1),f(g)}})},style:p("input",l)}),e.jsx(W,{onOk:e=>{b&&(e.stopPropagation(),y(!1),o(b))},onCancel:e=>{e.stopPropagation(),y(!1)},nodeData:l})]})]})},W=({onOk:t,onCancel:n,nodeData:r})=>e.jsxs("div",{className:"jer-confirm-buttons",children:[e.jsx("div",{onClick:t,children:e.jsx(_,{name:"ok",nodeData:r})}),e.jsx("div",{onClick:n,children:e.jsx(_,{name:"cancel",nodeData:r})})]}),G=e=>e.reduce(((e,t)=>"number"==typeof t?`${e}[${t}]`:""===e?t:`${e}.${t}`),""),U=["string","number","boolean","null","object","array"],H=(e=[],t)=>{const n=e.filter((({condition:e})=>e(t)));if(0===n.length)return{};const r=n[0],{element:o,wrapperElement:a,customNodeProps:i,wrapperProps:s,hideKey:l=!1,showEditTools:c=!0,showOnEdit:d=!1,showOnView:u=!0,showCollectionWrapper:p=!0}=r,m=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(r,["element","wrapperElement","customNodeProps","wrapperProps","hideKey","showEditTools","showOnEdit","showOnView","showCollectionWrapper"]);return Object.assign({CustomNode:o,CustomWrapper:a,customNodeProps:i,wrapperProps:s,hideKey:l,showEditTools:c,showOnEdit:d,showOnView:u,showCollectionWrapper:p},m)},Y=({props:e,collapsed:n})=>{const{data:r,nodeData:o,parentData:a,onEdit:i,onError:s,showErrorMessages:l,restrictEditFilter:c,restrictDeleteFilter:d,restrictAddFilter:u,restrictDragFilter:m,translate:g,errorMessageTimeout:h}=e,{currentlyEditingElement:y,setCurrentlyEditingElement:b}=S(),[f,j]=t.useState(null),v=Object.assign(Object.assign({},o),{collapsed:n}),{path:x,key:E,size:D}=v,w=p(x),C=t.useMemo((()=>!c(v)),[v]),k=t.useMemo((()=>!d(v)),[v]),O=t.useMemo((()=>!u(v)),[v]),N=t.useMemo((()=>!m(v)&&k&&null===y),[v]),A=e=>{l&&(j(e),setTimeout((()=>j(null)),h)),console.warn("Error",e)},T=t.useMemo((()=>(e,t)=>{A(e.message),s&&s({currentData:v.fullData,errorValue:t,currentValue:r,name:E,path:x,error:e})}),[s,l]),M=y===w,P=y===`key_${w}`,R="number"==typeof x.slice(-1)[0];return{pathString:w,nodeData:v,path:x,name:E,size:D,canEdit:C,canDelete:k,canAdd:O,canDrag:N,error:f,showError:A,onError:T,setError:j,handleEditKey:e=>{if(b(null),E===e)return;if(!a)return;const t=x.slice(0,-1);if(Object.keys(a).includes(e))return void T({code:"KEY_EXISTS",message:g("ERROR_KEY_EXISTS",v)},e);const n=Object.fromEntries(Object.entries(a).map((([t,n])=>t===E?[e,n]:[t,n])));i(n,t).then((t=>{t&&T({code:"UPDATE_ERROR",message:t},e)}))},derivedValues:{isEditing:M,isEditingKey:P,isArray:R,canEditKey:null!==a&&C&&O&&k&&!R}}},$=({canDrag:n,canDragOnto:r,path:o,nodeData:a,onMove:i,onError:s,translate:l})=>{const{getStyles:c}=v(),{dragSource:d,setDragSource:u}=S(),[m,g]=t.useState(!1),h=p(o),y=t.useMemo((()=>n?{onDragStart:e=>{e.stopPropagation(),u({path:o,pathString:h})},onDragEnd:e=>{e.stopPropagation(),u({path:null,pathString:null})}}:{}),[n]),b=t.useMemo((()=>e=>r?{onDragOver:e=>{e.stopPropagation(),e.preventDefault()},onDrop:t=>{t.stopPropagation(),j(e),u({path:null,pathString:null}),g(!1)},onDragEnter:t=>{var n;t.stopPropagation(),h.startsWith(null!==(n=d.pathString)&&void 0!==n?n:"")||g(e)},onDragExit:e=>{e.stopPropagation(),g(!1)}}:{}),[d,r]),f=t.useMemo((()=>r&&null!==d.pathString?e.jsx("div",Object.assign({className:"jer-drop-target-bottom",style:{height:"50%",position:"absolute",width:"100%",top:"50%",zIndex:o.length}},b("below"))):null),[d,r]),j=e=>{var t,n;const r=null===(t=d.path)||void 0===t?void 0:t.slice(-1)[0],c=null===(n=d.path)||void 0===n?void 0:n.slice(0,-1).join("."),u=o.slice(0,-1).join(""),{parentData:p}=a;"string"==typeof r&&p&&!Array.isArray(p)&&Object.keys(p).includes(r)&&r in p&&c!==u?s({code:"KEY_EXISTS",message:l("ERROR_KEY_EXISTS",a)},r):i(d.path,o,e).then((e=>{e&&s({code:"UPDATE_ERROR",message:e},a.value)}))};return{dragSourceProps:y,getDropTargetProps:b,BottomDropTarget:f,DropTargetPadding:({position:t,nodeData:n})=>m===t?e.jsx("div",{className:"jer-drag-n-drop-padding",style:c("dropZone",n)}):null,handleDrop:j}},J=(e,t)=>{var n,r;const o=document.getElementsByClassName("jer-editor-container"),a=parseInt(o.length>0?getComputedStyle(o[0]).getPropertyValue("line-height"):"16px"),i=(null!==(r=null===(n=t.current)||void 0===n?void 0:n.offsetWidth)&&void 0!==r?r:0)/(.5*a),s=JSON.stringify(e,null,2).replace(/\\n/g,"\n").split("\n").map((e=>Math.ceil(e.length/i))).reduce(((e,t)=>e+t),0)*a;return Math.min(s+30,window.innerHeight-50)},X=n=>{const{data:r,parentData:o,onEdit:a,onDelete:i,onChange:l,onMove:c,enableClipboard:d,canDragOnto:u,restrictTypeSelection:p,searchFilter:m,searchText:g,showLabel:h,stringTruncate:y,showStringQuotes:b,indent:f,translate:j,customNodeDefinitions:x,handleKeyboard:E,keyboardControls:D}=n,{getStyles:w}=v(),{setCurrentlyEditingElement:C,setCollapseState:k}=S(),[N,A]=t.useState("function"==typeof r?O:r),{pathString:T,nodeData:M,path:P,name:R,canEdit:V,canDelete:z,canDrag:F,error:I,onError:K,handleEditKey:L,derivedValues:_}=Y({props:n}),{dragSourceProps:G,getDropTargetProps:J,BottomDropTarget:X,DropTargetPadding:ee}=$({canDrag:F,canDragOnto:u,path:P,nodeData:M,onMove:c,onError:K,translate:j}),te=H(x,M),[ne,re]=t.useState(Z(r,te)),oe=t.useCallback((e=>{if(!l)return void A(e);const t=l({currentData:M.fullData,newValue:e,currentValue:N,name:R,path:P});A(t)}),[l]);t.useEffect((()=>{A("function"==typeof r?O:r),re(Z(r,te))}),[r,I]);const{CustomNode:ae,customNodeProps:ie,hideKey:se,showEditTools:le=!0,showOnEdit:ce,showOnView:de}=te,ue=[...U,...x.filter((({showInTypesSelector:e=!1,name:t})=>e&&!!t)).map((({name:e})=>e))],pe=t.useMemo((()=>{if("boolean"==typeof p)return p?[]:ue;if(Array.isArray(p))return p;const e=p(M);return"boolean"==typeof e?e?[]:ue:e}),[M,p]);if(!s("value",M,m,g))return null;const me=()=>{let e;switch(C(null),ne){case"object":e={[j("DEFAULT_NEW_KEY",M)]:N};break;case"array":e=null!=N?N:[];break;case"number":{const t=Number(N);e=isNaN(t)?0:t;break}default:e=N}a(e,P).then((t=>{t&&K({code:"UPDATE_ERROR",message:t},e)}))},ge=()=>{C(null),A(r),re(Z(r,te))},{isEditing:he,isEditingKey:ye,canEditKey:be}=_,fe=!he&&I,je=he&&pe.length>0,ve="invalid"!==ne&&!I&&le,xe=h&&ye,Ee=h&&!ye&&!se,De={value:N,parentData:o,setValue:oe,isEditing:he,setIsEditing:V?()=>C(T):()=>{},handleEdit:me,handleCancel:ge,path:P,stringTruncate:y,showStringQuotes:b,nodeData:M,translate:j,handleKeyboard:E},we=ae&&(he&&ce||!he&&de)?e.jsx(ae,Object.assign({},n,{value:N,customNodeProps:ie,setValue:oe,handleEdit:me,handleCancel:ge,handleKeyPress:e=>E(e,{stringConfirm:me,cancel:ge}),isEditing:he,setIsEditing:()=>C(T),getStyles:w})):q(Z(r),De);return e.jsxs("div",Object.assign({className:"jer-component jer-value-component",style:{marginLeft:f/2+"em",position:"relative"},draggable:F},G,J("above"),{children:[X,e.jsx(ee,{position:"above",nodeData:M}),e.jsxs("div",{className:"jer-value-main-row",style:{flexWrap:R.length>10?"wrap":"nowrap"},children:[Ee&&e.jsx("span",{className:"jer-key-text",style:Object.assign(Object.assign({},w("property",M)),{minWidth:`${Math.min(String(R).length+1,5)}ch`,flexShrink:R.length>10?1:0}),onDoubleClick:()=>be&&C(`key_${T}`),children:""===R?e.jsx("span",{className:P.length>0?"jer-empty-string":void 0}):`${R}:`}),xe&&e.jsx("input",{className:"jer-input-text jer-key-edit",type:"text",name:T,defaultValue:R,autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>E(e,{stringConfirm:()=>L(e.target.value),cancel:ge}),style:{width:String(R).length/1.5+.5+"em"}}),e.jsxs("div",{className:"jer-value-and-buttons",children:[e.jsx("div",{className:"jer-input-component",children:we}),he?e.jsx(W,{onOk:me,onCancel:ge,nodeData:M}):ve&&e.jsx(B,{startEdit:V?()=>C(T):void 0,handleDelete:z?()=>{i(N,P).then((e=>{e&&K({code:"DELETE_ERROR",message:e},N)}))}:void 0,enableClipboard:d,translate:j,customButtons:n.customButtons,nodeData:M,handleKeyboard:E,keyboardControls:D}),je&&e.jsxs("div",{className:"jer-select",children:[e.jsx("select",{name:`${R}-type-select`,className:"jer-type-select",onChange:e=>(e=>{const t=x.find((t=>t.name===e));if(t)a(t.defaultValue,P),re(e),C(null),k({path:P,collapsed:!1});else{const t=Q(N,e,j("DEFAULT_NEW_KEY",M),(null==te?void 0:te.CustomNode)?j("DEFAULT_STRING",M):void 0);oe(t),a(t,P).then((e=>{e&&(K({code:"UPDATE_ERROR",message:e},t),C(null))}))}})(e.target.value),value:ne,children:pe.map((t=>e.jsx("option",{value:t,children:t},t)))}),e.jsx("span",{className:"focus"})]}),fe&&e.jsx("span",{className:"jer-error-slug",style:w("error",M),children:I})]})]}),e.jsx(ee,{position:"below",nodeData:M})]}))},Z=(e,t)=>(null==t?void 0:t.CustomNode)&&(null==t?void 0:t.name)&&t.showInTypesSelector?t.name:"string"==typeof e?"string":"number"==typeof e?"number":"boolean"==typeof e?"boolean":null===e?"null":"invalid",q=(t,n)=>{const r=n.value;switch(t){case"string":return e.jsx(N,Object.assign({},n,{value:r}));case"number":return e.jsx(A,Object.assign({},n,{value:r}));case"boolean":return e.jsx(T,Object.assign({},n,{value:r}));case"null":return e.jsx(M,Object.assign({},n));default:return e.jsx(P,Object.assign({},n))}},Q=(e,t,n,r)=>{switch(t){case"string":return null!=r?r:String(e);case"number":{const t=Number(e);return isNaN(t)?0:t}case"boolean":return!!e;case"null":return null;case"object":return{[n]:e};case"array":return[e];default:return String(e)}},ee=n=>{const{getStyles:l}=v(),{collapseState:c,setCollapseState:d,doesPathMatch:u,currentlyEditingElement:p,setCurrentlyEditingElement:g,areChildrenBeingEdited:h}=S(),{data:y,nodeData:b,parentData:f,showCollectionCount:j,onEdit:x,onAdd:E,onDelete:D,canDragOnto:w,collapseFilter:C,collapseAnimationTime:k,onMove:O,enableClipboard:N,searchFilter:A,searchText:T,indent:M,keySort:P,showArrayIndices:R,defaultValue:V,translate:z,customNodeDefinitions:F,jsonParse:I,jsonStringify:K,keyboardControls:L,handleKeyboard:G,insertAtTop:U}=n,[Z,q]=t.useState(K(y)),Q=C(b),{contentRef:te,isAnimating:ne,maxHeight:re,collapsed:oe,animateCollapse:ae}=((e,n,r)=>{const[o,a]=t.useState(r?0:void 0),[i,s]=t.useState(r),l=t.useRef(!1),c=t.useRef(null),d=t.useRef(0),u=t.useRef();return{contentRef:c,isAnimating:l.current,animateCollapse:t=>{var r,o;if(i!==t){switch(window.clearTimeout(u.current),l.current=!0,t){case!0:{const e=null!==(o=null===(r=c.current)||void 0===r?void 0:r.offsetHeight)&&void 0!==o?o:0;d.current=e,a(e),setTimeout((()=>{a(0)}),5);break}case!1:a(d.current||J(e,c))}s(!i),u.current=window.setTimeout((()=>{l.current=!1,t||a(void 0)}),n)}},maxHeight:o,collapsed:i}})(y,k,Q),{pathString:ie,nodeData:se,path:le,name:ce,size:de,canEdit:ue,canDelete:pe,canAdd:me,canDrag:ge,error:he,setError:ye,onError:be,handleEditKey:fe,derivedValues:je}=Y({props:n,collapsed:oe}),{dragSourceProps:ve,getDropTargetProps:xe,BottomDropTarget:Ee,DropTargetPadding:De}=$({canDrag:ge,canDragOnto:w,path:le,nodeData:se,onMove:O,onError:be,translate:z}),we=t.useRef(!Q);t.useEffect((()=>{q(K(y))}),[y]),t.useEffect((()=>{const e=C(se)&&!je.isEditing;we.current=!e,ae(e)}),[C]),t.useEffect((()=>{null!==c&&u(le)&&(we.current=!0,ae(c.collapsed))}),[c]);const Ce=t.useMemo((()=>(e,t)=>"function"!=typeof V?V:V(e,t)),[V]),{CustomNode:ke,customNodeProps:Se,CustomWrapper:Oe,wrapperProps:Ne={},hideKey:Ae,showEditTools:Te=!0,showOnEdit:Me,showOnView:Pe,showCollectionWrapper:Re=!0}=t.useMemo((()=>H(F,se)),[]);if(!s("collection",se,A,T)&&se.level>0)return null;const Ve=Array.isArray(y)?"array":"object",ze="array"===Ve?{open:"[",close:"]"}:{open:"{",close:"}"},Fe=e=>G(e,{objectConfirm:Ke,cancel:_e}),Ie=e=>{const t=m(e);if(t&&L.collapseModifier.includes(t))return we.current=!0,void d({collapsed:!oe,path:le});p&&p.includes(ie)||(we.current=!0,d(null),ae(!oe))},Ke=()=>{try{const e=I(Z);if(g(null),ye(null),JSON.stringify(e)===JSON.stringify(y))return;x(e,le).then((t=>{t&&be({code:"UPDATE_ERROR",message:t},e)}))}catch(e){be({code:"INVALID_JSON",message:z("ERROR_INVALID_JSON",se)},Z)}},Le=le.length>0?()=>{D(y,le).then((e=>{e&&be({code:"DELETE_ERROR",message:e},r(y,le))}))}:void 0,_e=()=>{g(null),ye(null),q(K(y))},{isEditing:Be,isEditingKey:We,isArray:Ge,canEditKey:Ue}=je,He="when-closed"===j?oe:j,Ye=!Be&&Te,$e=(R||!Ge)&&!Ae&&void 0!==ce,Je=ke&&(Be&&Me||!Be&&Pe),Xe=P&&"object"===Ve,Ze=Object.entries(y).map((([e,t])=>["array"===Ve?Number(e):e,t]));Xe&&Ze.sort("function"==typeof P?(e,t)=>P(e[0],t[0]):void 0);const qe=we.current?Be?e.jsx("div",{className:"jer-collection-text-edit",children:e.jsxs("div",{children:[e.jsx(a,{className:"jer-collection-text-area",name:ie,value:Z,setValue:q,isEditing:Be,handleKeyPress:Fe,styles:l("input",se)}),e.jsx("div",{className:"jer-collection-input-button-row",children:e.jsx(W,{onOk:Ke,onCancel:_e,nodeData:se})})]})}):Ze.map((([t,r],o)=>{const a={key:t,value:r,path:[...le,t],level:le.length+1,index:o,size:i(r)?Object.keys(r).length:1,parentData:y,fullData:se.fullData};return e.jsx("div",{className:"jer-collection-element",style:l("collectionElement",a),children:i(r)?e.jsx(ee,Object.assign({},n,{data:r,parentData:y,nodeData:a,showCollectionCount:j,canDragOnto:ue}),t):e.jsx(X,Object.assign({},n,{data:r,parentData:y,nodeData:a,canDragOnto:ue,showLabel:"object"===Ve||R}),t)},t)})):null,Qe=!!Re&&oe;Qe||(we.current=!0);const et=Object.assign(Object.assign({},n),{data:y,value:y,parentData:f,nodeData:se,setValue:e=>o(void 0,void 0,void 0,(function*(){return yield x(e,le)})),handleEdit:Ke,handleCancel:_e,handleKeyPress:Fe,isEditing:Be,setIsEditing:()=>g(ie),getStyles:l,canDragOnto:ue}),tt=Je?e.jsx(ke,Object.assign({customNodeProps:Se},et,{children:qe})):qe,nt=We?e.jsx("input",{className:"jer-input-text jer-key-edit",type:"text",name:ie,defaultValue:ce,autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>G(e,{stringConfirm:()=>fe(e.target.value),cancel:_e}),style:{width:String(ce).length/1.5+.5+"em"}}):$e&&e.jsx("span",{className:"jer-key-text",style:l("property",se),onClick:e=>e.stopPropagation(),onDoubleClick:()=>Ue&&g(`key_${ie}`),children:""===ce?e.jsx("span",{className:le.length>0?"jer-empty-string":void 0}):`${ce}:`}),rt=Ye&&e.jsx(B,{startEdit:ue?()=>{we.current=!0,g(ie)}:void 0,handleAdd:me?e=>{ae(!1);const t=Ce(se,e);if("array"===Ve){const e=U.array?0:y.length,n=U.array?{insert:!0}:{};E(t,[...le,e],n).then((e=>{e&&be({code:"ADD_ERROR",message:e},t)}))}else if(e in y)be({code:"KEY_EXISTS",message:z("ERROR_KEY_EXISTS",se)},e);else{const n=U.object?{insertBefore:0}:{};E(t,[...le,e],n).then((e=>{e&&be({code:"ADD_ERROR",message:e},t)}))}}:void 0,handleDelete:pe?Le:void 0,enableClipboard:N,type:Ve,nodeData:se,translate:z,customButtons:n.customButtons,keyboardControls:L,handleKeyboard:G}),ot=e.jsxs("div",Object.assign({className:"jer-component jer-collection-component",style:Object.assign(Object.assign({marginLeft:(0===le.length?0:M/2)+"em"},l("collection",se)),{position:"relative"}),draggable:ge},ve,xe("above"),{children:[e.jsx("div",{className:"jer-clickzone",style:{width:M/2+1+"em",zIndex:10+2*se.level},onClick:e=>Ie(e)}),!Be&&Ee,e.jsx(De,{position:"above",nodeData:se}),Re?e.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},onClick:e=>Ie(e),children:[e.jsxs("div",{className:"jer-collection-name",children:[e.jsx("div",{className:"jer-collapse-icon jer-accordion-icon"+(oe?" jer-rotate-90":""),style:{zIndex:11+2*se.level},onClick:e=>Ie(e),children:e.jsx(_,{name:"chevron",rotate:oe,nodeData:se})}),nt,!Be&&e.jsx("span",{className:"jer-brackets jer-bracket-open",style:l("bracket",se),children:ze.open})]}),!Be&&He&&e.jsx("div",{className:"jer-collection-item-count"+(He?" jer-visible":" jer-hidden"),style:l("itemCount",se),children:1===de?z("ITEM_SINGLE",Object.assign(Object.assign({},se),{size:1}),1):z("ITEMS_MULTIPLE",se,de)}),e.jsx("div",{className:"jer-brackets"+(Qe?" jer-visible":" jer-hidden"),style:l("bracket",se),children:ze.close}),rt]}):Ae?e.jsx(e.Fragment,{}):e.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},children:[nt,rt]}),e.jsxs("div",{className:"jer-collection-inner",style:Object.assign({overflowY:Qe||ne?"clip":"visible",maxHeight:h(ie)?void 0:re},l("collectionInner",se)),ref:te,children:[tt,e.jsx("div",{className:Be?"jer-collection-error-row":"jer-collection-error-row-edit",children:he&&e.jsx("span",{className:"jer-error-slug",style:l("error",se),children:he})}),!Be&&Re&&e.jsx("div",{className:"jer-brackets jer-bracket-outside",style:Object.assign(Object.assign({},l("bracket",se)),{marginLeft:(M<3?-1:M<6?-.5:0)+"em"}),children:ze.close})]}),e.jsx(De,{position:"below",nodeData:se})]}));return Oe?e.jsx(Oe,Object.assign({customNodeProps:Ne},et,{children:ot})):ot},te={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"},ne=(e,t)=>(n,r,o)=>((e,t,n,r,o)=>{if(t[r]){const e=t[r](n);if(null!==e)return e}const a=r in e?e[r]:te[r];return void 0===o?a:null==a?void 0:a.replace("{{count}}",String(o))})(e,t,r,n,o);var re=[],oe=[];!function(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",o=!0===t.singleTag,a="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(o){var i=re.indexOf(a);-1===i&&(i=re.push(a)-1,oe[i]={}),n=oe[i]&&oe[i][r]?oe[i][r]:oe[i][r]=s()}else n=s();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function s(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),o=0;o<n.length;o++)e.setAttribute(n[o],t.attributes[n[o]]);var i="prepend"===r?"afterbegin":"beforeend";return a.insertAdjacentElement(i,e),e}}(':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}.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 ae=({data:n,setData:r,rootName:a="root",onUpdate:s=(()=>{}),onEdit:l=s,onDelete:c=s,onAdd:d=s,onChange:u,onError:p,showErrorMessages:m=!0,enableClipboard:h=!0,indent:b=2,collapse:f=!1,collapseAnimationTime:j=300,showCollectionCount:x=!0,restrictEdit:E=!1,restrictDelete:D=!1,restrictAdd:w=!1,restrictTypeSelection:C=!1,restrictDrag:k=!0,searchFilter:S,searchText:O,searchDebounceTime:N=350,keySort:A=!1,showArrayIndices:T=!0,showStringQuotes:M=!0,defaultValue:P=null,minWidth:R=250,maxWidth:V="min(600px, 90vw)",rootFontSize:z,stringTruncate:F=250,translations:I={},className:K,id:L,customText:_={},customNodeDefinitions:B=[],customButtons:W=[],jsonParse:G=JSON.parse,jsonStringify:U=(e=>JSON.stringify(e,null,2)),errorMessageTimeout:H=2500,keyboardControls:Y={},insertAtTop:$=!1})=>{const{getStyles:J}=v(),Z=t.useCallback(se(f),[f]),q=t.useCallback(ne(I,_),[I,_]),[Q,te]=t.useState(O),[re,oe]=(({setData:e,data:n})=>{const[r,o]=t.useState(e?void 0:n),a=t.useCallback((t=>{e?e(t):o(t)}),[e]);return t.useEffect((()=>{e||o(n)}),[n]),[e?n:r,a]})({setData:r,data:n}),ae=document.querySelector(":root"),de=getComputedStyle(document.documentElement).getPropertyValue("--jer-expand-transition-time");1e3*parseFloat(de)!==j&&(null==ae||ae.style.setProperty("--jer-expand-transition-time",j/1e3+"s")),t.useEffect((()=>{const e=setTimeout((()=>te(O)),N);return()=>clearTimeout(e)}),[O,N]);const ue={key:a,path:[],level:0,index:0,value:re,size:"object"==typeof re&&null!==re?Object.keys(re).length:1,parentData:null,fullData:re},pe=(e,t)=>o(void 0,void 0,void 0,(function*(){const n=yield e(t);if(!0===n||void 0===n)return void oe(t.newData);const r=ce(n)?n:["error",n],[o,a]=r;if("error"===o)return oe(t.currentData),!1===a?q("ERROR_UPDATE",ue):String(a);oe(a)})),me=t.useMemo((()=>se(E)),[E]),ge=t.useMemo((()=>se(D)),[D]),he=t.useMemo((()=>se(w)),[w]),ye=t.useMemo((()=>se(k)),[k]),be=t.useMemo((()=>le(S)),[S]),fe=t.useMemo((()=>(e=>{const t=Object.assign({},y);for(const n of Object.keys(y)){const r=n;if(e[r]){const o=e[r],a=["clipboardModifier","collapseModifier"].includes(n)?Array.isArray(o)?o:[o]:"string"==typeof o?{key:o}:o;t[r]=a,["stringConfirm","numberConfirm","booleanConfirm"].forEach((n=>{!e[n]&&e.confirm&&(t[n]=t.confirm)}))}}return t})(Y)),[Y]),je=t.useCallback(((e,t)=>((e,t,n)=>{const r=Object.entries(t);for(const[t,o]of r)if(g(n,e[t],t)){n.preventDefault(),o();break}})(fe,t,e)),[Y]),ve={name:a,nodeData:ue,onEdit:(e,t)=>o(void 0,void 0,void 0,(function*(){const{currentData:n,newData:r,currentValue:o,newValue:a}=ie(re,t,e,"update");if(o!==a)return yield pe(l,{currentData:n,newData:r,currentValue:o,newValue:a,name:t.slice(-1)[0],path:t})})),onDelete:(e,t)=>o(void 0,void 0,void 0,(function*(){const{currentData:n,newData:r,currentValue:o,newValue:a}=ie(re,t,e,"delete");return yield pe(c,{currentData:n,newData:r,currentValue:o,newValue:a,name:t.slice(-1)[0],path:t})})),onAdd:(e,t,n)=>o(void 0,void 0,void 0,(function*(){const{currentData:r,newData:o,currentValue:a,newValue:i}=ie(re,t,e,"add",n);return yield pe(d,{currentData:r,newData:o,currentValue:a,newValue:i,name:t.slice(-1)[0],path:t})})),onChange:u,onError:p,showErrorMessages:m,onMove:(e,t,n)=>o(void 0,void 0,void 0,(function*(){if(null===e)return;const{currentData:r,newData:o,currentValue:a}=ie(re,e,"","delete"),i=e.slice(-1)[0],s=t.slice(0,-1),c=t.slice(-1)[0];let d="number"==typeof c?"above"===n?c:c+1:"number"==typeof i?`arr_${i}`:i;e.slice(0,-1).join(".")===t.slice(0,-1).join(".")&&"number"==typeof i&&"number"==typeof d&&i<d&&(d-=1);const u="number"==typeof d?{insert:!0}:"above"===n?{insertBefore:c}:{insertAfter:c},{newData:p,newValue:m}=ie(o,[...s,d],a,"add",u);return yield pe(l,{currentData:r,newData:p,currentValue:a,newValue:m,name:t.slice(-1)[0],path:t})})),showCollectionCount:x,collapseFilter:Z,collapseAnimationTime:j,restrictEditFilter:me,restrictDeleteFilter:ge,restrictAddFilter:he,restrictTypeSelection:C,restrictDragFilter:ye,canDragOnto:!1,searchFilter:be,searchText:Q,enableClipboard:h,keySort:A,showArrayIndices:T,showStringQuotes:M,indent:b,defaultValue:P,stringTruncate:F,translate:q,customNodeDefinitions:B,customButtons:W,parentData:null,jsonParse:G,jsonStringify:U,errorMessageTimeout:H,handleKeyboard:je,keyboardControls:fe,insertAtTop:{object:!0===$||"object"===$,array:!0===$||"array"===$}},xe=Object.assign(Object.assign({},J("container",ue)),{minWidth:R,maxWidth:V});return xe.fontSize=null!=z?z:xe.fontSize,e.jsx("div",{id:L,className:"jer-editor-container "+K,style:xe,children:i(re)?e.jsx(ee,Object.assign({data:re},ve)):e.jsx(X,Object.assign({data:re,showLabel:!0},ve))})},ie=(e,t,o,a,i={})=>{if(0===t.length)return{currentData:e,newData:o,currentValue:e,newValue:o};const s=Object.assign({remove:"delete"===a},i),l="add"!==a?r(e,t):void 0;return{currentData:e,newData:n(e,t,o,s),currentValue:l,newValue:"delete"!==a?o:void 0}},se=e=>"boolean"==typeof e?()=>e:"number"==typeof e?({level:t})=>t>=e:e,le=e=>{if(void 0!==e)return"value"===e?c:"key"===e?d:"all"===e?(e,t)=>c(e,t)||d(e,t):e},ce=e=>Array.isArray(e)&&2===e.length&&["error","value"].includes(e[0]),de=({value:t,setIsEditing:n,getStyles:r,customNodeProps:o,nodeData:a})=>{var i,s;const l=null!==(i=null==o?void 0:o.stringTruncate)&&void 0!==i?i:100,c=r("string",a);return e.jsx("div",{onDoubleClick:()=>n(!0),onClick:e=>{(e.getModifierState("Control")||e.getModifierState("Meta"))&&n(!0)},className:"jer-value-string jer-hyperlink",style:c,children:e.jsxs("a",{href:t,target:"_blank",rel:"noreferrer",style:{color:null!==(s=c.color)&&void 0!==s?s:void 0},children:['"',u(t,l),'"']})})},ue={condition:({value:e})=>"string"==typeof e&&/^https?:\/\/.+\..+$/.test(e),element:de,showOnView:!0,showOnEdit:!1};exports.assign=n,exports.extract=r,exports.IconAdd=R,exports.IconCancel=K,exports.IconChevron=L,exports.IconCopy=F,exports.IconDelete=z,exports.IconEdit=V,exports.IconOk=I,exports.JsonEditor=t=>{var n;return e.jsx(j,{theme:null!==(n=t.theme)&&void 0!==n?n:b,icons:t.icons,children:e.jsx(k,{children:e.jsx(ae,Object.assign({},t))})})},exports.LinkCustomComponent=de,exports.LinkCustomNodeDefinition=ue,exports.candyWrapperTheme={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"}],input:{border:"1px solid rgb(115, 194, 198)"},iconCollection:"#1D3557",iconEdit:"#457B9D",iconDelete:"#E63946",iconAdd:"#2B2D42",iconCopy:"#1D3557",iconCancel:"#E63946"}},exports.defaultTheme=b,exports.githubDarkTheme={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)"}},exports.githubLightTheme={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"}},exports.isCollection=i,exports.matchNode=c,exports.matchNodeKey=d,exports.monoDarkTheme={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"}},exports.monoLightTheme={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"}},exports.psychedelicTheme={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"}},exports.truncate=u;
"use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("object-property-assigner"),r=require("object-property-extractor");function o(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}l((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const a=({className:t,name:n,value:r,setValue:o,handleKeyPress:a,styles:i})=>{if("string"!=typeof r)return null;const s="\n"===r.slice(-1)?r+".":r;return e.jsxs("div",{style:{display:"grid"},children:[e.jsx("textarea",{id:`${n}_textarea`,style:Object.assign({height:"auto",gridArea:"1 / 1 / 2 / 2",overflowY:"auto",whiteSpace:"pre-wrap"},i),rows:1,className:t,name:`${n}_textarea`,value:r,onChange:e=>o(e.target.value),autoFocus:!0,onFocus:e=>{r.length<40&&e.target.select()},onKeyDown:a}),e.jsx("span",{className:t,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"},i),children:s})]})},i=e=>null!==e&&"object"==typeof e,s=(e,t,n,r="")=>{if(!n&&!r)return!0;switch(e){case"collection":if(n){if(n(t,r))return!0;if(!l(r,t,n))return!1}if(!n&&r&&!l(r,t))return!1;break;case"value":if(n&&!n(t,r))return!1;if(!n&&r&&!c(t,r))return!1}return!0},l=(e="",t,n=c)=>{const r=t.value;return Object.entries(r).some((([o,a])=>{const s=[...t.path,o],c=Object.assign(Object.assign({},t),{key:o,path:s,level:t.level+1,value:a,size:s.length,parentData:r});return i(a)?l(e,c,n):n(c,e)}))},c=(e,t="")=>{const{value:n}=e;if(null===n&&"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())||"1"===t:"false".includes(t.toLowerCase())||"0"===t;default:return!1}},d=({key:e,path:t},n="")=>!!c({value:e},n)||!!t.some((e=>c({value:e},n))),u=(e,t=200)=>"string"==typeof e?e.length<t?e:`${e.slice(0,t-2).trim()}...`:e,p=e=>e.map((e=>""===e?String.fromCharCode(0):e)).join("."),m=e=>e.shiftKey?"Shift":e.metaKey?"Meta":e.ctrlKey?"Control":e.altKey?"Alt":void 0,g=(e,t,n)=>{const r=e.key,o=m(e);if(Array.isArray(t))return!!o&&t.includes(o);const{key:a,modifier:i}=t;return("stringLineBreak"!==n||"Enter"!==r||"Shift"!==o||"Enter"!==a||!(null==i?void 0:i.includes("Shift")))&&(r===a&&(i===o||Array.isArray(i)&&i.includes(o)))},h={key:"Enter"},y={confirm:h,cancel:{key:"Escape"},objectConfirm:Object.assign(Object.assign({},h),{modifier:["Meta","Shift","Control"]}),objectLineBreak:h,stringConfirm:h,stringLineBreak:Object.assign(Object.assign({},h),{modifier:["Shift"]}),numberConfirm:h,numberUp:{key:"ArrowUp"},numberDown:{key:"ArrowDown"},booleanConfirm:h,clipboardModifier:["Meta","Control"],collapseModifier:["Alt"]},b={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)"}},f=t.createContext({getStyles:()=>({}),icons:{}}),j=({theme:t=b,icons:n={},children:r})=>{const o=x(t);return e.jsx(f.Provider,{value:{getStyles:(e,t)=>"function"==typeof o[e]?o[e](t):o[e],icons:n},children:r})},v=()=>t.useContext(f),x=e=>{var t,n,r,o;const a={},i=(Array.isArray(e)?e:[e]).map((e=>D(e)?E({fragments:{},styles:e},a):E(e,a))),s=E(b,{});Object.keys(s).forEach((e=>{const t=e;i.forEach((e=>{e[t]&&(s[t]=Object.assign(Object.assign({},s[t]),e[t]))}))}));const l=Object.assign({},s);return Object.entries(a).forEach((([e,t])=>{const n=e;l[n]=e=>{const r=t(e)||{};return Object.assign(Object.assign({},s[n]),r)}})),"function"!=typeof(null==l?void 0:l.inputHighlight)&&(null===(t=null==l?void 0:l.inputHighlight)||void 0===t?void 0:t.backgroundColor)&&document.documentElement.style.setProperty("--jer-highlight-color",null===(n=null==l?void 0:l.inputHighlight)||void 0===n?void 0:n.backgroundColor),"function"!=typeof(null==l?void 0:l.iconCopy)&&(null===(r=null==l?void 0:l.iconCopy)||void 0===r?void 0:r.color)&&document.documentElement.style.setProperty("--jer-icon-copy-color",null===(o=null==l?void 0:l.iconCopy)||void 0===o?void 0:o.color),l},E=(e,t)=>{const{fragments:n,styles:r}=e,o={};return Object.entries(r).forEach((([e,r])=>{const a=(Array.isArray(r)?r:[r]).reduce(((r,o)=>{var a,i;if("function"==typeof o)return t[e]=o,Object.assign({},r);if("string"==typeof o){const t=null!==(a=null==n?void 0:n[o])&&void 0!==a?a:o;return"string"==typeof t?Object.assign(Object.assign({},r),{[null!==(i=w[e])&&void 0!==i?i:"color"]:t}):Object.assign(Object.assign({},r),t)}return Object.assign(Object.assign({},r),o)}),{});o[e]=a})),o},D=e=>!("styles"in e),w={container:"backgroundColor",collection:"backgroundColor",collectionInner:"backgroundColor",collectionElement:"backgroundColor",dropZone:"borderColor",inputHighlight:"backgroundColor"},C=t.createContext({collapseState:null,setCollapseState:()=>{},doesPathMatch:()=>!1,currentlyEditingElement:null,setCurrentlyEditingElement:()=>{},areChildrenBeingEdited:()=>!1,dragSource:{path:null,pathString:null},setDragSource:()=>{}}),k=({children:n})=>{const[r,o]=t.useState(null),[a,i]=t.useState(null),[s,l]=t.useState({path:null,pathString:null});return e.jsx(C.Provider,{value:{collapseState:r,setCollapseState:e=>{o(e),null!==e&&setTimeout((()=>o(null)),2e3)},doesPathMatch:e=>{if(null===r)return!1;for(const[t,n]of r.path.entries())if(n!==e[t])return!1;return!0},currentlyEditingElement:a,setCurrentlyEditingElement:i,areChildrenBeingEdited:e=>null!==a&&a.includes(e),dragSource:s,setDragSource:l},children:n})},S=()=>t.useContext(C),O="**INVALID_FUNCTION**",N=({value:t,setValue:n,isEditing:r,path:o,setIsEditing:i,handleEdit:s,handleCancel:l,stringTruncate:c,showStringQuotes:d,nodeData:m,handleKeyboard:g})=>{const{getStyles:h}=v(),y=p(o),b=d?'"':"";return r?e.jsx(a,{className:"jer-input-text",name:y,value:t,setValue:n,isEditing:r,handleKeyPress:e=>{g(e,{stringConfirm:s,cancel:l,stringLineBreak:()=>{var r,o;const a=document.getElementById(`${y}_textarea`);if(a){const i=null!==(r=null==a?void 0:a.selectionStart)&&void 0!==r?r:1/0,s=null!==(o=null==a?void 0:a.selectionEnd)&&void 0!==o?o:1/0,l=t.slice(0,i),c=t.slice(s);e.target.value=l+"\n"+c,a.setSelectionRange(i+1,i+1),n(l+"\n"+c)}}})},styles:h("input",m)}):e.jsxs("div",{id:`${y}_display`,onDoubleClick:()=>i(!0),onClick:e=>{(e.getModifierState("Control")||e.getModifierState("Meta"))&&i(!0)},className:"jer-value-string",style:h("string",m),children:[b,u(t,c),b]})},A=({value:t,setValue:n,isEditing:r,path:o,setIsEditing:a,handleEdit:i,handleCancel:s,nodeData:l,handleKeyboard:c})=>{const{getStyles:d}=v();return r?e.jsx("input",{className:"jer-input-number",type:"text",name:p(o),value:t,onChange:e=>n(e.target.value.replace(/[^0-9.-]/g,"")),autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>c(e,{numberConfirm:i,cancel:s,numberUp:()=>n(Number(t)+1),numberDown:()=>n(Number(t)-1)}),style:Object.assign({width:String(t).length/1.5+2+"em"},d("input",l))}):e.jsx("span",{onDoubleClick:()=>a(!0),className:"jer-value-number",style:d("number",l),children:t})},T=({value:t,setValue:n,isEditing:r,path:o,setIsEditing:a,handleEdit:i,handleCancel:s,nodeData:l,handleKeyboard:c})=>{const{getStyles:d}=v();return r?e.jsx("input",{className:"jer-input-boolean",type:"checkbox",name:p(o),checked:t,onChange:()=>n(!t),onKeyDown:e=>c(e,{booleanConfirm:i,cancel:s}),autoFocus:!0}):e.jsx("span",{onDoubleClick:()=>a(!0),className:"jer-value-boolean",style:d("boolean",l),children:String(t)})},M=({value:n,isEditing:r,setIsEditing:o,handleEdit:a,handleCancel:i,nodeData:s,handleKeyboard:l})=>{const{getStyles:c}=v();t.useEffect((()=>(r&&document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d))),[r]);const d=e=>l(e,{confirm:a,cancel:i});return e.jsx("div",{onDoubleClick:()=>o(!0),className:"jer-value-null",style:c("null",s),children:String(n)})},P=({value:t})=>{let n="Error!";switch(typeof t){case"string":t===O&&(n="Function");break;case"undefined":n="Undefined";break;case"symbol":n="Symbol"}return e.jsx("span",{className:"jer-value-invalid",children:n})},R=({size:t,style:n,className:r})=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:t,height:t,className:r,style:n,children:[e.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z"}),e.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"})]}),V=({size:t,style:n,className:r})=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:t,height:t,className:r,style:n,transform:"translate(0, 0.5)",children:[e.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"}),e.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"})]}),z=({size:t,style:n,className:r})=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:t,height:t,className:r,style:n,children:e.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"})}),F=({size:t,style:n,className:r})=>e.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:t,height:t,className:r,style:n,children:[e.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"}),e.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"}),e.jsx("path",{d:"M15 10l-4 4 4 4"})]}),I=({size:t,style:n,className:r})=>e.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:t,height:t,className:r,style:n,children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"}),e.jsx("path",{d:"M22 4L12 14.01l-3-3"})]}),K=({size:t,style:n,className:r})=>e.jsx("svg",{baseProfile:"tiny",viewBox:"0 0 24 24",fill:"currentColor",width:t,height:t,className:r,style:n,children:e.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"})}),L=({size:t,style:n,className:r})=>e.jsx("svg",{viewBox:"0 0 512 512",fill:"currentColor",width:t,height:t,className:r,style:n,children:e.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"})}),_=({name:t,nodeData:n,rotate:r})=>{var o,a,i,s,l,c,d;const{getStyles:u,icons:p}=v(),m={size:"1.4em",className:"jer-icon"};switch(t){case"add":return null!==(o=null==p?void 0:p.add)&&void 0!==o?o:e.jsx(R,Object.assign({},m,{style:u("iconAdd",n)}));case"edit":return null!==(a=null==p?void 0:p.edit)&&void 0!==a?a:e.jsx(V,Object.assign({},m,{style:u("iconEdit",n)}));case"delete":return null!==(i=null==p?void 0:p.delete)&&void 0!==i?i:e.jsx(z,Object.assign({},m,{style:u("iconDelete",n),size:"1.45em"}));case"copy":return null!==(s=null==p?void 0:p.copy)&&void 0!==s?s:e.jsx(F,Object.assign({},m,{style:u("iconCopy",n),size:"1.2em"}));case"ok":return null!==(l=null==p?void 0:p.ok)&&void 0!==l?l:e.jsx(I,Object.assign({},m,{style:Object.assign({fontSize:"90%"},u("iconOk",n))}));case"cancel":return null!==(c=null==p?void 0:p.cancel)&&void 0!==c?c:e.jsx(K,Object.assign({},m,{style:Object.assign({fontSize:"130%"},u("iconCancel",n))}));case"chevron":return null!==(d=null==p?void 0:p.chevron)&&void 0!==d?d:e.jsx(L,{size:"1em",style:u("iconCollection",n)});default:return e.jsx(e.Fragment,{})}},B=({startEdit:n,handleDelete:r,handleAdd:o,enableClipboard:a,type:i,customButtons:s,nodeData:l,translate:c,keyboardControls:d,handleKeyboard:u})=>{const{getStyles:p}=v(),g=c("KEY_NEW",l),[h,y]=t.useState(!1),[b,f]=t.useState(g),{key:j,path:x,value:E}=l;return e.jsxs("div",{className:"jer-edit-buttons",style:{opacity:h?1:void 0},children:[a&&e.jsx("div",{onClick:e=>{e.stopPropagation();let t,n="value",r="";if(a){const o=m(e);o&&d.clipboardModifier.includes(o)?(t=G(x),r=t,n="path"):(t=E,r=i?JSON.stringify(E,null,2):String(t)),navigator.clipboard.writeText(r)}"function"==typeof a&&a({value:t,stringValue:r,path:x,key:j,type:n})},className:"jer-copy-pulse",children:e.jsx(_,{name:"copy",nodeData:l})}),n&&e.jsx("div",{onClick:e=>{e.stopPropagation(),n()},children:e.jsx(_,{name:"edit",nodeData:l})}),r&&e.jsx("div",{onClick:e=>{e.stopPropagation(),r()},children:e.jsx(_,{name:"delete",nodeData:l})}),o&&e.jsx("div",{onClick:e=>{e.stopPropagation(),"object"===i?y(!0):o("")},children:e.jsx(_,{name:"add",nodeData:l})}),null==s?void 0:s.map((({Element:t,onClick:n},r)=>e.jsx("div",{onClick:e=>n(l,e),children:e.jsx(t,{})},r))),h&&o&&"object"===i&&e.jsxs(e.Fragment,{children:[e.jsx("input",{className:"jer-input-new-key",type:"text",name:"new-object-key",value:b,onChange:e=>f(e.target.value),autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>{u(e,{stringConfirm:()=>{o&&(y(!1),o(b),f(g))},cancel:()=>{y(!1),f(g)}})},style:p("input",l)}),e.jsx(W,{onOk:e=>{b&&(e.stopPropagation(),y(!1),o(b))},onCancel:e=>{e.stopPropagation(),y(!1)},nodeData:l})]})]})},W=({onOk:t,onCancel:n,nodeData:r})=>e.jsxs("div",{className:"jer-confirm-buttons",children:[e.jsx("div",{onClick:t,children:e.jsx(_,{name:"ok",nodeData:r})}),e.jsx("div",{onClick:n,children:e.jsx(_,{name:"cancel",nodeData:r})})]}),G=e=>e.reduce(((e,t)=>"number"==typeof t?`${e}[${t}]`:""===e?t:`${e}.${t}`),""),U=["string","number","boolean","null","object","array"],H=(e=[],t)=>{const n=e.filter((({condition:e})=>e(t)));if(0===n.length)return{};const r=n[0],{element:o,wrapperElement:a,customNodeProps:i,wrapperProps:s,hideKey:l=!1,showEditTools:c=!0,showOnEdit:d=!1,showOnView:u=!0,showCollectionWrapper:p=!0}=r,m=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(r,["element","wrapperElement","customNodeProps","wrapperProps","hideKey","showEditTools","showOnEdit","showOnView","showCollectionWrapper"]);return Object.assign({CustomNode:o,CustomWrapper:a,customNodeProps:i,wrapperProps:s,hideKey:l,showEditTools:c,showOnEdit:d,showOnView:u,showCollectionWrapper:p},m)},Y=({props:e,collapsed:n})=>{const{data:r,nodeData:o,parentData:a,onEdit:i,onError:s,showErrorMessages:l,restrictEditFilter:c,restrictDeleteFilter:d,restrictAddFilter:u,restrictDragFilter:m,translate:g,errorMessageTimeout:h}=e,{currentlyEditingElement:y,setCurrentlyEditingElement:b}=S(),[f,j]=t.useState(null),v=Object.assign(Object.assign({},o),{collapsed:n}),{path:x,key:E,size:D}=v,w=p(x),C=t.useMemo((()=>!c(v)),[v]),k=t.useMemo((()=>!d(v)),[v]),O=t.useMemo((()=>!u(v)),[v]),N=t.useMemo((()=>!m(v)&&k&&null===y),[v]),A=e=>{l&&(j(e),setTimeout((()=>j(null)),h)),console.warn("Error",e)},T=t.useMemo((()=>(e,t)=>{A(e.message),s&&s({currentData:v.fullData,errorValue:t,currentValue:r,name:E,path:x,error:e})}),[s,l]),M=y===w,P=y===`key_${w}`,R="number"==typeof x.slice(-1)[0];return{pathString:w,nodeData:v,path:x,name:E,size:D,canEdit:C,canDelete:k,canAdd:O,canDrag:N,error:f,showError:A,onError:T,setError:j,handleEditKey:e=>{if(b(null),E===e)return;if(!a)return;const t=x.slice(0,-1);if(Object.keys(a).includes(e))return void T({code:"KEY_EXISTS",message:g("ERROR_KEY_EXISTS",v)},e);const n=Object.fromEntries(Object.entries(a).map((([t,n])=>t===E?[e,n]:[t,n])));i(n,t).then((t=>{t&&T({code:"UPDATE_ERROR",message:t},e)}))},derivedValues:{isEditing:M,isEditingKey:P,isArray:R,canEditKey:null!==a&&C&&O&&k&&!R}}},$=({canDrag:n,canDragOnto:r,path:o,nodeData:a,onMove:i,onError:s,translate:l})=>{const{getStyles:c}=v(),{dragSource:d,setDragSource:u}=S(),[m,g]=t.useState(!1),h=p(o),y=t.useMemo((()=>n?{onDragStart:e=>{e.stopPropagation(),u({path:o,pathString:h})},onDragEnd:e=>{e.stopPropagation(),u({path:null,pathString:null})}}:{}),[n]),b=t.useMemo((()=>e=>r?{onDragOver:e=>{e.stopPropagation(),e.preventDefault()},onDrop:t=>{t.stopPropagation(),j(e),u({path:null,pathString:null}),g(!1)},onDragEnter:t=>{var n;t.stopPropagation(),h.startsWith(null!==(n=d.pathString)&&void 0!==n?n:"")||g(e)},onDragExit:e=>{e.stopPropagation(),g(!1)}}:{}),[d,r]),f=t.useMemo((()=>r&&null!==d.pathString?e.jsx("div",Object.assign({className:"jer-drop-target-bottom",style:{height:"50%",position:"absolute",width:"100%",top:"50%",zIndex:o.length}},b("below"))):null),[d,r]),j=e=>{var t,n;const r=null===(t=d.path)||void 0===t?void 0:t.slice(-1)[0],c=null===(n=d.path)||void 0===n?void 0:n.slice(0,-1).join("."),u=o.slice(0,-1).join(""),{parentData:p}=a;"string"==typeof r&&p&&!Array.isArray(p)&&Object.keys(p).includes(r)&&r in p&&c!==u?s({code:"KEY_EXISTS",message:l("ERROR_KEY_EXISTS",a)},r):i(d.path,o,e).then((e=>{e&&s({code:"UPDATE_ERROR",message:e},a.value)}))};return{dragSourceProps:y,getDropTargetProps:b,BottomDropTarget:f,DropTargetPadding:({position:t,nodeData:n})=>m===t?e.jsx("div",{className:"jer-drag-n-drop-padding",style:c("dropZone",n)}):null,handleDrop:j}},J=(e,t)=>{var n,r;const o=document.getElementsByClassName("jer-editor-container"),a=parseInt(o.length>0?getComputedStyle(o[0]).getPropertyValue("line-height"):"16px"),i=(null!==(r=null===(n=t.current)||void 0===n?void 0:n.offsetWidth)&&void 0!==r?r:0)/(.5*a),s=JSON.stringify(e,null,2).replace(/\\n/g,"\n").split("\n").map((e=>Math.ceil(e.length/i))).reduce(((e,t)=>e+t),0)*a;return Math.min(s+30,window.innerHeight-50)},X=n=>{const{data:r,parentData:o,onEdit:a,onDelete:i,onChange:l,onMove:c,enableClipboard:d,canDragOnto:u,restrictTypeSelection:p,searchFilter:m,searchText:g,showLabel:h,stringTruncate:y,showStringQuotes:b,indent:f,translate:j,customNodeDefinitions:x,handleKeyboard:E,keyboardControls:D}=n,{getStyles:w}=v(),{setCurrentlyEditingElement:C,setCollapseState:k}=S(),[N,A]=t.useState("function"==typeof r?O:r),{pathString:T,nodeData:M,path:P,name:R,canEdit:V,canDelete:z,canDrag:F,error:I,onError:K,handleEditKey:L,derivedValues:_}=Y({props:n}),{dragSourceProps:G,getDropTargetProps:J,BottomDropTarget:X,DropTargetPadding:ee}=$({canDrag:F,canDragOnto:u,path:P,nodeData:M,onMove:c,onError:K,translate:j}),te=H(x,M),[ne,re]=t.useState(Z(r,te)),oe=t.useCallback((e=>{if(!l)return void A(e);const t=l({currentData:M.fullData,newValue:e,currentValue:N,name:R,path:P});A(t)}),[l]);t.useEffect((()=>{A("function"==typeof r?O:r),re(Z(r,te))}),[r,I]);const{CustomNode:ae,customNodeProps:ie,hideKey:se,showEditTools:le=!0,showOnEdit:ce,showOnView:de}=te,ue=[...U,...x.filter((({showInTypesSelector:e=!1,name:t})=>e&&!!t)).map((({name:e})=>e))],pe=t.useMemo((()=>{if("boolean"==typeof p)return p?[]:ue;if(Array.isArray(p))return p;const e=p(M);return"boolean"==typeof e?e?[]:ue:e}),[M,p]);if(!s("value",M,m,g))return null;const me=()=>{let e;switch(C(null),ne){case"object":e={[j("DEFAULT_NEW_KEY",M)]:N};break;case"array":e=null!=N?N:[];break;case"number":{const t=Number(N);e=isNaN(t)?0:t;break}default:e=N}a(e,P).then((t=>{t&&K({code:"UPDATE_ERROR",message:t},e)}))},ge=()=>{C(null),A(r),re(Z(r,te))},{isEditing:he,isEditingKey:ye,canEditKey:be}=_,fe=!he&&I,je=he&&pe.length>0,ve="invalid"!==ne&&!I&&le,xe=h&&ye,Ee=h&&!ye&&!se,De={value:N,parentData:o,setValue:oe,isEditing:he,setIsEditing:V?()=>C(T):()=>{},handleEdit:me,handleCancel:ge,path:P,stringTruncate:y,showStringQuotes:b,nodeData:M,translate:j,handleKeyboard:E},we=ae&&(he&&ce||!he&&de)?e.jsx(ae,Object.assign({},n,{value:N,customNodeProps:ie,setValue:oe,handleEdit:me,handleCancel:ge,handleKeyPress:e=>E(e,{stringConfirm:me,cancel:ge}),isEditing:he,setIsEditing:()=>C(T),getStyles:w})):q(Z(r),De);return e.jsxs("div",Object.assign({className:"jer-component jer-value-component",style:{marginLeft:f/2+"em",position:"relative"},draggable:F},G,J("above"),{children:[X,e.jsx(ee,{position:"above",nodeData:M}),e.jsxs("div",{className:"jer-value-main-row",style:{flexWrap:R.length>10?"wrap":"nowrap"},children:[Ee&&e.jsx("span",{className:"jer-key-text",style:Object.assign(Object.assign({},w("property",M)),{minWidth:`${Math.min(String(R).length+1,5)}ch`,flexShrink:R.length>10?1:0}),onDoubleClick:()=>be&&C(`key_${T}`),children:""===R?e.jsx("span",{className:P.length>0?"jer-empty-string":void 0}):`${R}:`}),xe&&e.jsx("input",{className:"jer-input-text jer-key-edit",type:"text",name:T,defaultValue:R,autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>E(e,{stringConfirm:()=>L(e.target.value),cancel:ge}),style:{width:String(R).length/1.5+.5+"em"}}),e.jsxs("div",{className:"jer-value-and-buttons",children:[e.jsx("div",{className:"jer-input-component",children:we}),he?e.jsx(W,{onOk:me,onCancel:ge,nodeData:M}):ve&&e.jsx(B,{startEdit:V?()=>C(T):void 0,handleDelete:z?()=>{i(N,P).then((e=>{e&&K({code:"DELETE_ERROR",message:e},N)}))}:void 0,enableClipboard:d,translate:j,customButtons:n.customButtons,nodeData:M,handleKeyboard:E,keyboardControls:D}),je&&e.jsxs("div",{className:"jer-select",children:[e.jsx("select",{name:`${R}-type-select`,className:"jer-type-select",onChange:e=>(e=>{const t=x.find((t=>t.name===e));if(t)a(t.defaultValue,P),re(e),C(null),k({path:P,collapsed:!1});else{const t=Q(N,e,j("DEFAULT_NEW_KEY",M),(null==te?void 0:te.CustomNode)?j("DEFAULT_STRING",M):void 0);oe(t),a(t,P).then((e=>{e&&(K({code:"UPDATE_ERROR",message:e},t),C(null))}))}})(e.target.value),value:ne,children:pe.map((t=>e.jsx("option",{value:t,children:t},t)))}),e.jsx("span",{className:"focus"})]}),fe&&e.jsx("span",{className:"jer-error-slug",style:w("error",M),children:I})]})]}),e.jsx(ee,{position:"below",nodeData:M})]}))},Z=(e,t)=>(null==t?void 0:t.CustomNode)&&(null==t?void 0:t.name)&&t.showInTypesSelector?t.name:"string"==typeof e?"string":"number"==typeof e?"number":"boolean"==typeof e?"boolean":null===e?"null":"invalid",q=(t,n)=>{const r=n.value;switch(t){case"string":return e.jsx(N,Object.assign({},n,{value:r}));case"number":return e.jsx(A,Object.assign({},n,{value:r}));case"boolean":return e.jsx(T,Object.assign({},n,{value:r}));case"null":return e.jsx(M,Object.assign({},n));default:return e.jsx(P,Object.assign({},n))}},Q=(e,t,n,r)=>{switch(t){case"string":return null!=r?r:String(e);case"number":{const t=Number(e);return isNaN(t)?0:t}case"boolean":return!!e;case"null":return null;case"object":return{[n]:e};case"array":return[e];default:return String(e)}},ee=n=>{const{getStyles:l}=v(),{collapseState:c,setCollapseState:d,doesPathMatch:u,currentlyEditingElement:p,setCurrentlyEditingElement:g,areChildrenBeingEdited:h}=S(),{data:y,nodeData:b,parentData:f,showCollectionCount:j,onEdit:x,onAdd:E,onDelete:D,canDragOnto:w,collapseFilter:C,collapseAnimationTime:k,onMove:O,enableClipboard:N,searchFilter:A,searchText:T,indent:M,keySort:P,showArrayIndices:R,defaultValue:V,translate:z,customNodeDefinitions:F,jsonParse:I,jsonStringify:K,keyboardControls:L,handleKeyboard:G,insertAtTop:U}=n,[Z,q]=t.useState(K(y)),Q=C(b),{contentRef:te,isAnimating:ne,maxHeight:re,collapsed:oe,animateCollapse:ae}=((e,n,r)=>{const[o,a]=t.useState(r?0:void 0),[i,s]=t.useState(r),l=t.useRef(!1),c=t.useRef(null),d=t.useRef(0),u=t.useRef();return{contentRef:c,isAnimating:l.current,animateCollapse:t=>{var r,o;if(i!==t){switch(window.clearTimeout(u.current),l.current=!0,t){case!0:{const e=null!==(o=null===(r=c.current)||void 0===r?void 0:r.offsetHeight)&&void 0!==o?o:0;d.current=e,a(e),setTimeout((()=>{a(0)}),5);break}case!1:a(d.current||J(e,c))}s(!i),u.current=window.setTimeout((()=>{l.current=!1,t||a(void 0)}),n)}},maxHeight:o,collapsed:i}})(y,k,Q),{pathString:ie,nodeData:se,path:le,name:ce,size:de,canEdit:ue,canDelete:pe,canAdd:me,canDrag:ge,error:he,setError:ye,onError:be,handleEditKey:fe,derivedValues:je}=Y({props:n,collapsed:oe}),{dragSourceProps:ve,getDropTargetProps:xe,BottomDropTarget:Ee,DropTargetPadding:De}=$({canDrag:ge,canDragOnto:w,path:le,nodeData:se,onMove:O,onError:be,translate:z}),we=t.useRef(!Q);t.useEffect((()=>{q(K(y))}),[y]),t.useEffect((()=>{const e=C(se)&&!je.isEditing;we.current=!e,ae(e)}),[C]),t.useEffect((()=>{null!==c&&u(le)&&(we.current=!0,ae(c.collapsed))}),[c]);const Ce=t.useMemo((()=>(e,t)=>"function"!=typeof V?V:V(e,t)),[V]),{CustomNode:ke,customNodeProps:Se,CustomWrapper:Oe,wrapperProps:Ne={},hideKey:Ae,showEditTools:Te=!0,showOnEdit:Me,showOnView:Pe,showCollectionWrapper:Re=!0}=t.useMemo((()=>H(F,se)),[]);if(!s("collection",se,A,T)&&se.level>0)return null;const Ve=Array.isArray(y)?"array":"object",ze="array"===Ve?{open:"[",close:"]"}:{open:"{",close:"}"},Fe=e=>G(e,{objectConfirm:Ke,cancel:_e}),Ie=e=>{const t=m(e);if(t&&L.collapseModifier.includes(t))return we.current=!0,void d({collapsed:!oe,path:le});p&&p.includes(ie)||(we.current=!0,d(null),ae(!oe))},Ke=()=>{try{const e=I(Z);if(g(null),ye(null),JSON.stringify(e)===JSON.stringify(y))return;x(e,le).then((t=>{t&&be({code:"UPDATE_ERROR",message:t},e)}))}catch(e){be({code:"INVALID_JSON",message:z("ERROR_INVALID_JSON",se)},Z)}},Le=le.length>0?()=>{D(y,le).then((e=>{e&&be({code:"DELETE_ERROR",message:e},r(y,le))}))}:void 0,_e=()=>{g(null),ye(null),q(K(y))},{isEditing:Be,isEditingKey:We,isArray:Ge,canEditKey:Ue}=je,He="when-closed"===j?oe:j,Ye=!Be&&Te,$e=(R||!Ge)&&!Ae&&void 0!==ce,Je=ke&&(Be&&Me||!Be&&Pe),Xe=P&&"object"===Ve,Ze=Object.entries(y).map((([e,t])=>["array"===Ve?Number(e):e,t]));Xe&&Ze.sort("function"==typeof P?(e,t)=>P(e[0],t[0]):void 0);const qe=we.current?Be?e.jsx("div",{className:"jer-collection-text-edit",children:e.jsxs("div",{children:[e.jsx(a,{className:"jer-collection-text-area",name:ie,value:Z,setValue:q,isEditing:Be,handleKeyPress:Fe,styles:l("input",se)}),e.jsx("div",{className:"jer-collection-input-button-row",children:e.jsx(W,{onOk:Ke,onCancel:_e,nodeData:se})})]})}):Ze.map((([t,r],o)=>{const a={key:t,value:r,path:[...le,t],level:le.length+1,index:o,size:i(r)?Object.keys(r).length:1,parentData:y,fullData:se.fullData};return e.jsx("div",{className:"jer-collection-element",style:l("collectionElement",a),children:i(r)?e.jsx(ee,Object.assign({},n,{data:r,parentData:y,nodeData:a,showCollectionCount:j,canDragOnto:ue}),t):e.jsx(X,Object.assign({},n,{data:r,parentData:y,nodeData:a,canDragOnto:ue,showLabel:"object"===Ve||R}),t)},t)})):null,Qe=!!Re&&oe;Qe||(we.current=!0);const et=Object.assign(Object.assign({},n),{data:y,value:y,parentData:f,nodeData:se,setValue:e=>o(void 0,void 0,void 0,(function*(){return yield x(e,le)})),handleEdit:Ke,handleCancel:_e,handleKeyPress:Fe,isEditing:Be,setIsEditing:()=>g(ie),getStyles:l,canDragOnto:ue}),tt=Je?e.jsx(ke,Object.assign({customNodeProps:Se},et,{children:qe})):qe,nt=We?e.jsx("input",{className:"jer-input-text jer-key-edit",type:"text",name:ie,defaultValue:ce,autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>G(e,{stringConfirm:()=>fe(e.target.value),cancel:_e}),style:{width:String(ce).length/1.5+.5+"em"}}):$e&&e.jsx("span",{className:"jer-key-text",style:l("property",se),onClick:e=>e.stopPropagation(),onDoubleClick:()=>Ue&&g(`key_${ie}`),children:""===ce?e.jsx("span",{className:le.length>0?"jer-empty-string":void 0}):`${ce}:`}),rt=Ye&&e.jsx(B,{startEdit:ue?()=>{we.current=!0,g(ie)}:void 0,handleAdd:me?e=>{ae(!1);const t=Ce(se,e);if("array"===Ve){const e=U.array?0:y.length,n=U.array?{insert:!0}:{};E(t,[...le,e],n).then((e=>{e&&be({code:"ADD_ERROR",message:e},t)}))}else if(e in y)be({code:"KEY_EXISTS",message:z("ERROR_KEY_EXISTS",se)},e);else{const n=U.object?{insertBefore:0}:{};E(t,[...le,e],n).then((e=>{e&&be({code:"ADD_ERROR",message:e},t)}))}}:void 0,handleDelete:pe?Le:void 0,enableClipboard:N,type:Ve,nodeData:se,translate:z,customButtons:n.customButtons,keyboardControls:L,handleKeyboard:G}),ot=e.jsxs("div",Object.assign({className:"jer-component jer-collection-component",style:Object.assign(Object.assign({marginLeft:(0===le.length?0:M/2)+"em"},l("collection",se)),{position:"relative"}),draggable:ge},ve,xe("above"),{children:[e.jsx("div",{className:"jer-clickzone",style:{width:M/2+1+"em",zIndex:10+2*se.level},onClick:e=>Ie(e)}),!Be&&Ee,e.jsx(De,{position:"above",nodeData:se}),Re?e.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},onClick:e=>Ie(e),children:[e.jsxs("div",{className:"jer-collection-name",children:[e.jsx("div",{className:"jer-collapse-icon jer-accordion-icon"+(oe?" jer-rotate-90":""),style:{zIndex:11+2*se.level},onClick:e=>Ie(e),children:e.jsx(_,{name:"chevron",rotate:oe,nodeData:se})}),nt,!Be&&e.jsx("span",{className:"jer-brackets jer-bracket-open",style:l("bracket",se),children:ze.open})]}),!Be&&He&&e.jsx("div",{className:"jer-collection-item-count"+(He?" jer-visible":" jer-hidden"),style:l("itemCount",se),children:1===de?z("ITEM_SINGLE",Object.assign(Object.assign({},se),{size:1}),1):z("ITEMS_MULTIPLE",se,de)}),e.jsx("div",{className:"jer-brackets"+(Qe?" jer-visible":" jer-hidden"),style:l("bracket",se),children:ze.close}),rt]}):Ae?e.jsx(e.Fragment,{}):e.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},children:[nt,rt]}),e.jsxs("div",{className:"jer-collection-inner",style:Object.assign({overflowY:Qe||ne?"clip":"visible",maxHeight:h(ie)?void 0:re},l("collectionInner",se)),ref:te,children:[tt,e.jsx("div",{className:Be?"jer-collection-error-row":"jer-collection-error-row-edit",children:he&&e.jsx("span",{className:"jer-error-slug",style:l("error",se),children:he})}),!Be&&Re&&e.jsx("div",{className:"jer-brackets jer-bracket-outside",style:Object.assign(Object.assign({},l("bracket",se)),{marginLeft:(M<3?-1:M<6?-.5:0)+"em"}),children:ze.close})]}),e.jsx(De,{position:"below",nodeData:se})]}));return Oe?e.jsx(Oe,Object.assign({customNodeProps:Ne},et,{children:ot})):ot},te={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"},ne=(e,t)=>(n,r,o)=>((e,t,n,r,o)=>{if(t[r]){const e=t[r](n);if(null!==e)return e}const a=r in e?e[r]:te[r];return void 0===o?a:null==a?void 0:a.replace("{{count}}",String(o))})(e,t,r,n,o);var re=[],oe=[];!function(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",o=!0===t.singleTag,a="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(o){var i=re.indexOf(a);-1===i&&(i=re.push(a)-1,oe[i]={}),n=oe[i]&&oe[i][r]?oe[i][r]:oe[i][r]=s()}else n=s();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function s(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),o=0;o<n.length;o++)e.setAttribute(n[o],t.attributes[n[o]]);var i="prepend"===r?"afterbegin":"beforeend";return a.insertAdjacentElement(i,e),e}}(':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}.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 ae=({data:n,setData:r,rootName:a="root",onUpdate:s=(()=>{}),onEdit:l=s,onDelete:c=s,onAdd:d=s,onChange:u,onError:p,showErrorMessages:m=!0,enableClipboard:h=!0,indent:b=2,collapse:f=!1,collapseAnimationTime:j=300,showCollectionCount:x=!0,restrictEdit:E=!1,restrictDelete:D=!1,restrictAdd:w=!1,restrictTypeSelection:C=!1,restrictDrag:k=!0,searchFilter:S,searchText:O,searchDebounceTime:N=350,keySort:A=!1,showArrayIndices:T=!0,showStringQuotes:M=!0,defaultValue:P=null,minWidth:R=250,maxWidth:V="min(600px, 90vw)",rootFontSize:z,stringTruncate:F=250,translations:I={},className:K,id:L,customText:_={},customNodeDefinitions:B=[],customButtons:W=[],jsonParse:G=JSON.parse,jsonStringify:U=(e=>JSON.stringify(e,null,2)),errorMessageTimeout:H=2500,keyboardControls:Y={},insertAtTop:$=!1})=>{const{getStyles:J}=v(),Z=t.useCallback(se(f),[f]),q=t.useCallback(ne(I,_),[I,_]),[Q,te]=t.useState(O),[re,oe]=(({setData:e,data:n})=>{const[r,o]=t.useState(e?void 0:n),a=t.useCallback((t=>{e?e(t):o(t)}),[e]);return t.useEffect((()=>{e||o(n)}),[n]),[e?n:r,a]})({setData:r,data:n}),ae=document.querySelector(":root"),de=getComputedStyle(document.documentElement).getPropertyValue("--jer-expand-transition-time");1e3*parseFloat(de)!==j&&(null==ae||ae.style.setProperty("--jer-expand-transition-time",j/1e3+"s")),t.useEffect((()=>{const e=setTimeout((()=>te(O)),N);return()=>clearTimeout(e)}),[O,N]);const ue={key:a,path:[],level:0,index:0,value:re,size:"object"==typeof re&&null!==re?Object.keys(re).length:1,parentData:null,fullData:re},pe=(e,t)=>o(void 0,void 0,void 0,(function*(){const n=yield e(t);if(!0===n||void 0===n)return void oe(t.newData);const r=ce(n)?n:["error",n],[o,a]=r;if("error"===o)return oe(t.currentData),!1===a?q("ERROR_UPDATE",ue):String(a);oe(a)})),me=t.useMemo((()=>se(E)),[E]),ge=t.useMemo((()=>se(D)),[D]),he=t.useMemo((()=>se(w)),[w]),ye=t.useMemo((()=>se(k)),[k]),be=t.useMemo((()=>le(S)),[S]),fe=t.useMemo((()=>(e=>{const t=Object.assign({},y);for(const n of Object.keys(y)){const r=n;if(e[r]){const o=e[r],a=["clipboardModifier","collapseModifier"].includes(n)?Array.isArray(o)?o:[o]:"string"==typeof o?{key:o}:o;t[r]=a,["stringConfirm","numberConfirm","booleanConfirm"].forEach((n=>{!e[n]&&e.confirm&&(t[n]=t.confirm)}))}}return t})(Y)),[Y]),je=t.useCallback(((e,t)=>((e,t,n)=>{const r=Object.entries(t);for(const[t,o]of r)if(g(n,e[t],t)){n.preventDefault(),o();break}})(fe,t,e)),[Y]),ve={name:a,nodeData:ue,onEdit:(e,t)=>o(void 0,void 0,void 0,(function*(){const{currentData:n,newData:r,currentValue:o,newValue:a}=ie(re,t,e,"update");if(o!==a)return yield pe(l,{currentData:n,newData:r,currentValue:o,newValue:a,name:t.slice(-1)[0],path:t})})),onDelete:(e,t)=>o(void 0,void 0,void 0,(function*(){const{currentData:n,newData:r,currentValue:o,newValue:a}=ie(re,t,e,"delete");return yield pe(c,{currentData:n,newData:r,currentValue:o,newValue:a,name:t.slice(-1)[0],path:t})})),onAdd:(e,t,n)=>o(void 0,void 0,void 0,(function*(){const{currentData:r,newData:o,currentValue:a,newValue:i}=ie(re,t,e,"add",n);return yield pe(d,{currentData:r,newData:o,currentValue:a,newValue:i,name:t.slice(-1)[0],path:t})})),onChange:u,onError:p,showErrorMessages:m,onMove:(e,t,n)=>o(void 0,void 0,void 0,(function*(){if(null===e)return;const{currentData:r,newData:o,currentValue:a}=ie(re,e,"","delete"),i=e.slice(-1)[0],s=t.slice(0,-1),c=t.slice(-1)[0];let d="number"==typeof c?"above"===n?c:c+1:"number"==typeof i?`arr_${i}`:i;e.slice(0,-1).join(".")===t.slice(0,-1).join(".")&&"number"==typeof i&&"number"==typeof d&&i<d&&(d-=1);const u="number"==typeof d?{insert:!0}:"above"===n?{insertBefore:c}:{insertAfter:c},{newData:p,newValue:m}=ie(o,[...s,d],a,"add",u);return yield pe(l,{currentData:r,newData:p,currentValue:a,newValue:m,name:t.slice(-1)[0],path:t})})),showCollectionCount:x,collapseFilter:Z,collapseAnimationTime:j,restrictEditFilter:me,restrictDeleteFilter:ge,restrictAddFilter:he,restrictTypeSelection:C,restrictDragFilter:ye,canDragOnto:!1,searchFilter:be,searchText:Q,enableClipboard:h,keySort:A,showArrayIndices:T,showStringQuotes:M,indent:b,defaultValue:P,stringTruncate:F,translate:q,customNodeDefinitions:B,customButtons:W,parentData:null,jsonParse:G,jsonStringify:U,errorMessageTimeout:H,handleKeyboard:je,keyboardControls:fe,insertAtTop:{object:!0===$||"object"===$,array:!0===$||"array"===$}},xe=Object.assign(Object.assign({},J("container",ue)),{minWidth:R,maxWidth:V});return xe.fontSize=null!=z?z:xe.fontSize,e.jsx("div",{id:L,className:`jer-editor-container ${null!=K?K:""}`,style:xe,children:i(re)?e.jsx(ee,Object.assign({data:re},ve)):e.jsx(X,Object.assign({data:re,showLabel:!0},ve))})},ie=(e,t,o,a,i={})=>{if(0===t.length)return{currentData:e,newData:o,currentValue:e,newValue:o};const s=Object.assign({remove:"delete"===a},i),l="add"!==a?r(e,t):void 0;return{currentData:e,newData:n(e,t,o,s),currentValue:l,newValue:"delete"!==a?o:void 0}},se=e=>"boolean"==typeof e?()=>e:"number"==typeof e?({level:t})=>t>=e:e,le=e=>{if(void 0!==e)return"value"===e?c:"key"===e?d:"all"===e?(e,t)=>c(e,t)||d(e,t):e},ce=e=>Array.isArray(e)&&2===e.length&&["error","value"].includes(e[0]),de=({value:t,setIsEditing:n,getStyles:r,customNodeProps:o,nodeData:a})=>{var i,s;const l=null!==(i=null==o?void 0:o.stringTruncate)&&void 0!==i?i:100,c=r("string",a);return e.jsx("div",{onDoubleClick:()=>n(!0),onClick:e=>{(e.getModifierState("Control")||e.getModifierState("Meta"))&&n(!0)},className:"jer-value-string jer-hyperlink",style:c,children:e.jsxs("a",{href:t,target:"_blank",rel:"noreferrer",style:{color:null!==(s=c.color)&&void 0!==s?s:void 0},children:['"',u(t,l),'"']})})},ue={condition:({value:e})=>"string"==typeof e&&/^https?:\/\/.+\..+$/.test(e),element:de,showOnView:!0,showOnEdit:!1};exports.assign=n,exports.extract=r,exports.IconAdd=R,exports.IconCancel=K,exports.IconChevron=L,exports.IconCopy=F,exports.IconDelete=z,exports.IconEdit=V,exports.IconOk=I,exports.JsonEditor=t=>{var n;return e.jsx(j,{theme:null!==(n=t.theme)&&void 0!==n?n:b,icons:t.icons,children:e.jsx(k,{children:e.jsx(ae,Object.assign({},t))})})},exports.LinkCustomComponent=de,exports.LinkCustomNodeDefinition=ue,exports.candyWrapperTheme={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"}],input:{border:"1px solid rgb(115, 194, 198)"},iconCollection:"#1D3557",iconEdit:"#457B9D",iconDelete:"#E63946",iconAdd:"#2B2D42",iconCopy:"#1D3557",iconCancel:"#E63946"}},exports.defaultTheme=b,exports.githubDarkTheme={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)"}},exports.githubLightTheme={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"}},exports.isCollection=i,exports.matchNode=c,exports.matchNodeKey=d,exports.monoDarkTheme={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"}},exports.monoLightTheme={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"}},exports.psychedelicTheme={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"}},exports.truncate=u;

@@ -249,2 +249,3 @@ import React$1 from 'react';

}
type ThemeInput = Theme | Partial<ThemeStyles> | Array<Theme | Partial<ThemeStyles>>;
declare const themeableElements: readonly ["container", "collection", "collectionInner", "collectionElement", "dropZone", "property", "bracket", "itemCount", "string", "number", "boolean", "null", "input", "inputHighlight", "error", "iconCollection", "iconEdit", "iconDelete", "iconAdd", "iconCopy", "iconOk", "iconCancel"];

@@ -261,3 +262,2 @@ type ThemeableElement = (typeof themeableElements)[number];

}
type ThemeInput = Theme | Partial<ThemeStyles> | Array<Theme | Partial<ThemeStyles>>;

@@ -264,0 +264,0 @@ declare const JsonEditor: React$1.FC<JsonEditorProps>;

@@ -1,1 +0,1 @@

import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{createContext as r,useContext as o,useState as a,useEffect as i,useMemo as l,useCallback as s,useRef as c}from"react";import d from"object-property-assigner";export{default as assign}from"object-property-assigner";import u from"object-property-extractor";export{default as extract}from"object-property-extractor";function p(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{s(r.next(e))}catch(e){a(e)}}function l(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const g=({className:n,name:r,value:o,setValue:a,handleKeyPress:i,styles:l})=>{if("string"!=typeof o)return null;const s="\n"===o.slice(-1)?o+".":o;return e("div",{style:{display:"grid"},children:[t("textarea",{id:`${r}_textarea`,style:Object.assign({height:"auto",gridArea:"1 / 1 / 2 / 2",overflowY:"auto",whiteSpace:"pre-wrap"},l),rows:1,className:n,name:`${r}_textarea`,value:o,onChange:e=>a(e.target.value),autoFocus:!0,onFocus:e=>{o.length<40&&e.target.select()},onKeyDown:i}),t("span",{className:n,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:s})]})},m=e=>null!==e&&"object"==typeof e,h=(e,t,n,r="")=>{if(!n&&!r)return!0;switch(e){case"collection":if(n){if(n(t,r))return!0;if(!y(r,t,n))return!1}if(!n&&r&&!y(r,t))return!1;break;case"value":if(n&&!n(t,r))return!1;if(!n&&r&&!b(t,r))return!1}return!0},y=(e="",t,n=b)=>{const r=t.value;return Object.entries(r).some((([o,a])=>{const i=[...t.path,o],l=Object.assign(Object.assign({},t),{key:o,path:i,level:t.level+1,value:a,size:i.length,parentData:r});return m(a)?y(e,l,n):n(l,e)}))},b=(e,t="")=>{const{value:n}=e;if(null===n&&"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())||"1"===t:"false".includes(t.toLowerCase())||"0"===t;default:return!1}},f=({key:e,path:t},n="")=>!!b({value:e},n)||!!t.some((e=>b({value:e},n))),v=(e,t=200)=>"string"==typeof e?e.length<t?e:`${e.slice(0,t-2).trim()}...`:e,j=e=>e.map((e=>""===e?String.fromCharCode(0):e)).join("."),E=e=>e.shiftKey?"Shift":e.metaKey?"Meta":e.ctrlKey?"Control":e.altKey?"Alt":void 0,D=(e,t,n)=>{const r=e.key,o=E(e);if(Array.isArray(t))return!!o&&t.includes(o);const{key:a,modifier:i}=t;return("stringLineBreak"!==n||"Enter"!==r||"Shift"!==o||"Enter"!==a||!(null==i?void 0:i.includes("Shift")))&&(r===a&&(i===o||Array.isArray(i)&&i.includes(o)))},w={key:"Enter"},C={confirm:w,cancel:{key:"Escape"},objectConfirm:Object.assign(Object.assign({},w),{modifier:["Meta","Shift","Control"]}),objectLineBreak:w,stringConfirm:w,stringLineBreak:Object.assign(Object.assign({},w),{modifier:["Shift"]}),numberConfirm:w,numberUp:{key:"ArrowUp"},numberDown:{key:"ArrowDown"},booleanConfirm:w,clipboardModifier:["Meta","Control"],collapseModifier:["Alt"]},k={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)"}},O=r({getStyles:()=>({}),icons:{}}),S=({theme:e=k,icons:n={},children:r})=>{const o=x(e);return t(O.Provider,{value:{getStyles:(e,t)=>"function"==typeof o[e]?o[e](t):o[e],icons:n},children:r})},N=()=>o(O),x=e=>{var t,n,r,o;const a={},i=(Array.isArray(e)?e:[e]).map((e=>T(e)?A({fragments:{},styles:e},a):A(e,a))),l=A(k,{});Object.keys(l).forEach((e=>{const t=e;i.forEach((e=>{e[t]&&(l[t]=Object.assign(Object.assign({},l[t]),e[t]))}))}));const s=Object.assign({},l);return Object.entries(a).forEach((([e,t])=>{const n=e;s[n]=e=>{const r=t(e)||{};return Object.assign(Object.assign({},l[n]),r)}})),"function"!=typeof(null==s?void 0:s.inputHighlight)&&(null===(t=null==s?void 0:s.inputHighlight)||void 0===t?void 0:t.backgroundColor)&&document.documentElement.style.setProperty("--jer-highlight-color",null===(n=null==s?void 0:s.inputHighlight)||void 0===n?void 0:n.backgroundColor),"function"!=typeof(null==s?void 0:s.iconCopy)&&(null===(r=null==s?void 0:s.iconCopy)||void 0===r?void 0:r.color)&&document.documentElement.style.setProperty("--jer-icon-copy-color",null===(o=null==s?void 0:s.iconCopy)||void 0===o?void 0:o.color),s},A=(e,t)=>{const{fragments:n,styles:r}=e,o={};return Object.entries(r).forEach((([e,r])=>{const a=(Array.isArray(r)?r:[r]).reduce(((r,o)=>{var a,i;if("function"==typeof o)return t[e]=o,Object.assign({},r);if("string"==typeof o){const t=null!==(a=null==n?void 0:n[o])&&void 0!==a?a:o;return"string"==typeof t?Object.assign(Object.assign({},r),{[null!==(i=P[e])&&void 0!==i?i:"color"]:t}):Object.assign(Object.assign({},r),t)}return Object.assign(Object.assign({},r),o)}),{});o[e]=a})),o},T=e=>!("styles"in e),P={container:"backgroundColor",collection:"backgroundColor",collectionInner:"backgroundColor",collectionElement:"backgroundColor",dropZone:"borderColor",inputHighlight:"backgroundColor"},R=r({collapseState:null,setCollapseState:()=>{},doesPathMatch:()=>!1,currentlyEditingElement:null,setCurrentlyEditingElement:()=>{},areChildrenBeingEdited:()=>!1,dragSource:{path:null,pathString:null},setDragSource:()=>{}}),V=({children:e})=>{const[n,r]=a(null),[o,i]=a(null),[l,s]=a({path:null,pathString:null});return t(R.Provider,{value:{collapseState:n,setCollapseState:e=>{r(e),null!==e&&setTimeout((()=>r(null)),2e3)},doesPathMatch:e=>{if(null===n)return!1;for(const[t,r]of n.path.entries())if(r!==e[t])return!1;return!0},currentlyEditingElement:o,setCurrentlyEditingElement:i,areChildrenBeingEdited:e=>null!==o&&o.includes(e),dragSource:l,setDragSource:s},children:e})},z=()=>o(R),F="**INVALID_FUNCTION**",M=({value:n,setValue:r,isEditing:o,path:a,setIsEditing:i,handleEdit:l,handleCancel:s,stringTruncate:c,showStringQuotes:d,nodeData:u,handleKeyboard:p})=>{const{getStyles:m}=N(),h=j(a),y=d?'"':"";return o?t(g,{className:"jer-input-text",name:h,value:n,setValue:r,isEditing:o,handleKeyPress:e=>{p(e,{stringConfirm:l,cancel:s,stringLineBreak:()=>{var t,o;const a=document.getElementById(`${h}_textarea`);if(a){const i=null!==(t=null==a?void 0:a.selectionStart)&&void 0!==t?t:1/0,l=null!==(o=null==a?void 0:a.selectionEnd)&&void 0!==o?o:1/0,s=n.slice(0,i),c=n.slice(l);e.target.value=s+"\n"+c,a.setSelectionRange(i+1,i+1),r(s+"\n"+c)}}})},styles:m("input",u)}):e("div",{id:`${h}_display`,onDoubleClick:()=>i(!0),onClick:e=>{(e.getModifierState("Control")||e.getModifierState("Meta"))&&i(!0)},className:"jer-value-string",style:m("string",u),children:[y,v(n,c),y]})},K=({value:e,setValue:n,isEditing:r,path:o,setIsEditing:a,handleEdit:i,handleCancel:l,nodeData:s,handleKeyboard:c})=>{const{getStyles:d}=N();return r?t("input",{className:"jer-input-number",type:"text",name:j(o),value:e,onChange:e=>n(e.target.value.replace(/[^0-9.-]/g,"")),autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:t=>c(t,{numberConfirm:i,cancel:l,numberUp:()=>n(Number(e)+1),numberDown:()=>n(Number(e)-1)}),style:Object.assign({width:String(e).length/1.5+2+"em"},d("input",s))}):t("span",{onDoubleClick:()=>a(!0),className:"jer-value-number",style:d("number",s),children:e})},_=({value:e,setValue:n,isEditing:r,path:o,setIsEditing:a,handleEdit:i,handleCancel:l,nodeData:s,handleKeyboard:c})=>{const{getStyles:d}=N();return r?t("input",{className:"jer-input-boolean",type:"checkbox",name:j(o),checked:e,onChange:()=>n(!e),onKeyDown:e=>c(e,{booleanConfirm:i,cancel:l}),autoFocus:!0}):t("span",{onDoubleClick:()=>a(!0),className:"jer-value-boolean",style:d("boolean",s),children:String(e)})},I=({value:e,isEditing:n,setIsEditing:r,handleEdit:o,handleCancel:a,nodeData:l,handleKeyboard:s})=>{const{getStyles:c}=N();i((()=>(n&&document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d))),[n]);const d=e=>s(e,{confirm:o,cancel:a});return t("div",{onDoubleClick:()=>r(!0),className:"jer-value-null",style:c("null",l),children:String(e)})},L=({value:e})=>{let n="Error!";switch(typeof e){case"string":e===F&&(n="Function");break;case"undefined":n="Undefined";break;case"symbol":n="Symbol"}return t("span",{className:"jer-value-invalid",children:n})},B=({size:n,style:r,className:o})=>e("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:n,height:n,className:o,style:r,children:[t("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z"}),t("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"})]}),W=({size:n,style:r,className:o})=>e("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:n,height:n,className:o,style:r,transform:"translate(0, 0.5)",children:[t("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"}),t("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"})]}),G=({size:e,style:n,className:r})=>t("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:r,style:n,children:t("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"})}),U=({size:n,style:r,className:o})=>e("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:n,height:n,className:o,style:r,children:[t("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"}),t("path",{d:"M8 4H6a2 2 0 00-2 2v14a2 2 0 002 2h12a2 2 0 002-2v-2M16 4h2a2 2 0 012 2v4M21 14H11"}),t("path",{d:"M15 10l-4 4 4 4"})]}),H=({size:n,style:r,className:o})=>e("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:n,height:n,className:o,style:r,children:[t("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"}),t("path",{d:"M22 4L12 14.01l-3-3"})]}),Y=({size:e,style:n,className:r})=>t("svg",{baseProfile:"tiny",viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:r,style:n,children:t("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"})}),$=({size:e,style:n,className:r})=>t("svg",{viewBox:"0 0 512 512",fill:"currentColor",width:e,height:e,className:r,style:n,children:t("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"})}),J=({name:e,nodeData:r,rotate:o})=>{var a,i,l,s,c,d,u;const{getStyles:p,icons:g}=N(),m={size:"1.4em",className:"jer-icon"};switch(e){case"add":return null!==(a=null==g?void 0:g.add)&&void 0!==a?a:t(B,Object.assign({},m,{style:p("iconAdd",r)}));case"edit":return null!==(i=null==g?void 0:g.edit)&&void 0!==i?i:t(W,Object.assign({},m,{style:p("iconEdit",r)}));case"delete":return null!==(l=null==g?void 0:g.delete)&&void 0!==l?l:t(G,Object.assign({},m,{style:p("iconDelete",r),size:"1.45em"}));case"copy":return null!==(s=null==g?void 0:g.copy)&&void 0!==s?s:t(U,Object.assign({},m,{style:p("iconCopy",r),size:"1.2em"}));case"ok":return null!==(c=null==g?void 0:g.ok)&&void 0!==c?c:t(H,Object.assign({},m,{style:Object.assign({fontSize:"90%"},p("iconOk",r))}));case"cancel":return null!==(d=null==g?void 0:g.cancel)&&void 0!==d?d:t(Y,Object.assign({},m,{style:Object.assign({fontSize:"130%"},p("iconCancel",r))}));case"chevron":return null!==(u=null==g?void 0:g.chevron)&&void 0!==u?u:t($,{size:"1em",style:p("iconCollection",r)});default:return t(n,{})}},X=({startEdit:r,handleDelete:o,handleAdd:i,enableClipboard:l,type:s,customButtons:c,nodeData:d,translate:u,keyboardControls:p,handleKeyboard:g})=>{const{getStyles:m}=N(),h=u("KEY_NEW",d),[y,b]=a(!1),[f,v]=a(h),{key:j,path:D,value:w}=d;return e("div",{className:"jer-edit-buttons",style:{opacity:y?1:void 0},children:[l&&t("div",{onClick:e=>{e.stopPropagation();let t,n="value",r="";if(l){const o=E(e);o&&p.clipboardModifier.includes(o)?(t=Q(D),r=t,n="path"):(t=w,r=s?JSON.stringify(w,null,2):String(t)),navigator.clipboard.writeText(r)}"function"==typeof l&&l({value:t,stringValue:r,path:D,key:j,type:n})},className:"jer-copy-pulse",children:t(J,{name:"copy",nodeData:d})}),r&&t("div",{onClick:e=>{e.stopPropagation(),r()},children:t(J,{name:"edit",nodeData:d})}),o&&t("div",{onClick:e=>{e.stopPropagation(),o()},children:t(J,{name:"delete",nodeData:d})}),i&&t("div",{onClick:e=>{e.stopPropagation(),"object"===s?b(!0):i("")},children:t(J,{name:"add",nodeData:d})}),null==c?void 0:c.map((({Element:e,onClick:n},r)=>t("div",{onClick:e=>n(d,e),children:t(e,{})},r))),y&&i&&"object"===s&&e(n,{children:[t("input",{className:"jer-input-new-key",type:"text",name:"new-object-key",value:f,onChange:e=>v(e.target.value),autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>{g(e,{stringConfirm:()=>{i&&(b(!1),i(f),v(h))},cancel:()=>{b(!1),v(h)}})},style:m("input",d)}),t(Z,{onOk:e=>{f&&(e.stopPropagation(),b(!1),i(f))},onCancel:e=>{e.stopPropagation(),b(!1)},nodeData:d})]})]})},Z=({onOk:n,onCancel:r,nodeData:o})=>e("div",{className:"jer-confirm-buttons",children:[t("div",{onClick:n,children:t(J,{name:"ok",nodeData:o})}),t("div",{onClick:r,children:t(J,{name:"cancel",nodeData:o})})]}),Q=e=>e.reduce(((e,t)=>"number"==typeof t?`${e}[${t}]`:""===e?t:`${e}.${t}`),""),q=["string","number","boolean","null","object","array"],ee=(e=[],t)=>{const n=e.filter((({condition:e})=>e(t)));if(0===n.length)return{};const r=n[0],{element:o,wrapperElement:a,customNodeProps:i,wrapperProps:l,hideKey:s=!1,showEditTools:c=!0,showOnEdit:d=!1,showOnView:u=!0,showCollectionWrapper:p=!0}=r,g=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(r,["element","wrapperElement","customNodeProps","wrapperProps","hideKey","showEditTools","showOnEdit","showOnView","showCollectionWrapper"]);return Object.assign({CustomNode:o,CustomWrapper:a,customNodeProps:i,wrapperProps:l,hideKey:s,showEditTools:c,showOnEdit:d,showOnView:u,showCollectionWrapper:p},g)},te=({props:e,collapsed:t})=>{const{data:n,nodeData:r,parentData:o,onEdit:i,onError:s,showErrorMessages:c,restrictEditFilter:d,restrictDeleteFilter:u,restrictAddFilter:p,restrictDragFilter:g,translate:m,errorMessageTimeout:h}=e,{currentlyEditingElement:y,setCurrentlyEditingElement:b}=z(),[f,v]=a(null),E=Object.assign(Object.assign({},r),{collapsed:t}),{path:D,key:w,size:C}=E,k=j(D),O=l((()=>!d(E)),[E]),S=l((()=>!u(E)),[E]),N=l((()=>!p(E)),[E]),x=l((()=>!g(E)&&S&&null===y),[E]),A=e=>{c&&(v(e),setTimeout((()=>v(null)),h)),console.warn("Error",e)},T=l((()=>(e,t)=>{A(e.message),s&&s({currentData:E.fullData,errorValue:t,currentValue:n,name:w,path:D,error:e})}),[s,c]),P=y===k,R=y===`key_${k}`,V="number"==typeof D.slice(-1)[0];return{pathString:k,nodeData:E,path:D,name:w,size:C,canEdit:O,canDelete:S,canAdd:N,canDrag:x,error:f,showError:A,onError:T,setError:v,handleEditKey:e=>{if(b(null),w===e)return;if(!o)return;const t=D.slice(0,-1);if(Object.keys(o).includes(e))return void T({code:"KEY_EXISTS",message:m("ERROR_KEY_EXISTS",E)},e);const n=Object.fromEntries(Object.entries(o).map((([t,n])=>t===w?[e,n]:[t,n])));i(n,t).then((t=>{t&&T({code:"UPDATE_ERROR",message:t},e)}))},derivedValues:{isEditing:P,isEditingKey:R,isArray:V,canEditKey:null!==o&&O&&N&&S&&!V}}},ne=({canDrag:e,canDragOnto:n,path:r,nodeData:o,onMove:i,onError:s,translate:c})=>{const{getStyles:d}=N(),{dragSource:u,setDragSource:p}=z(),[g,m]=a(!1),h=j(r),y=l((()=>e?{onDragStart:e=>{e.stopPropagation(),p({path:r,pathString:h})},onDragEnd:e=>{e.stopPropagation(),p({path:null,pathString:null})}}:{}),[e]),b=l((()=>e=>n?{onDragOver:e=>{e.stopPropagation(),e.preventDefault()},onDrop:t=>{t.stopPropagation(),v(e),p({path:null,pathString:null}),m(!1)},onDragEnter:t=>{var n;t.stopPropagation(),h.startsWith(null!==(n=u.pathString)&&void 0!==n?n:"")||m(e)},onDragExit:e=>{e.stopPropagation(),m(!1)}}:{}),[u,n]),f=l((()=>n&&null!==u.pathString?t("div",Object.assign({className:"jer-drop-target-bottom",style:{height:"50%",position:"absolute",width:"100%",top:"50%",zIndex:r.length}},b("below"))):null),[u,n]),v=e=>{var t,n;const a=null===(t=u.path)||void 0===t?void 0:t.slice(-1)[0],l=null===(n=u.path)||void 0===n?void 0:n.slice(0,-1).join("."),d=r.slice(0,-1).join(""),{parentData:p}=o;"string"==typeof a&&p&&!Array.isArray(p)&&Object.keys(p).includes(a)&&a in p&&l!==d?s({code:"KEY_EXISTS",message:c("ERROR_KEY_EXISTS",o)},a):i(u.path,r,e).then((e=>{e&&s({code:"UPDATE_ERROR",message:e},o.value)}))};return{dragSourceProps:y,getDropTargetProps:b,BottomDropTarget:f,DropTargetPadding:({position:e,nodeData:n})=>g===e?t("div",{className:"jer-drag-n-drop-padding",style:d("dropZone",n)}):null,handleDrop:v}},re=(e,t)=>{var n,r;const o=document.getElementsByClassName("jer-editor-container"),a=parseInt(o.length>0?getComputedStyle(o[0]).getPropertyValue("line-height"):"16px"),i=(null!==(r=null===(n=t.current)||void 0===n?void 0:n.offsetWidth)&&void 0!==r?r:0)/(.5*a),l=JSON.stringify(e,null,2).replace(/\\n/g,"\n").split("\n").map((e=>Math.ceil(e.length/i))).reduce(((e,t)=>e+t),0)*a;return Math.min(l+30,window.innerHeight-50)},oe=n=>{const{data:r,parentData:o,onEdit:c,onDelete:d,onChange:u,onMove:p,enableClipboard:g,canDragOnto:m,restrictTypeSelection:y,searchFilter:b,searchText:f,showLabel:v,stringTruncate:j,showStringQuotes:E,indent:D,translate:w,customNodeDefinitions:C,handleKeyboard:k,keyboardControls:O}=n,{getStyles:S}=N(),{setCurrentlyEditingElement:x,setCollapseState:A}=z(),[T,P]=a("function"==typeof r?F:r),{pathString:R,nodeData:V,path:M,name:K,canEdit:_,canDelete:I,canDrag:L,error:B,onError:W,handleEditKey:G,derivedValues:U}=te({props:n}),{dragSourceProps:H,getDropTargetProps:Y,BottomDropTarget:$,DropTargetPadding:J}=ne({canDrag:L,canDragOnto:m,path:M,nodeData:V,onMove:p,onError:W,translate:w}),Q=ee(C,V),[re,oe]=a(ae(r,Q)),se=s((e=>{if(!u)return void P(e);const t=u({currentData:V.fullData,newValue:e,currentValue:T,name:K,path:M});P(t)}),[u]);i((()=>{P("function"==typeof r?F:r),oe(ae(r,Q))}),[r,B]);const{CustomNode:ce,customNodeProps:de,hideKey:ue,showEditTools:pe=!0,showOnEdit:ge,showOnView:me}=Q,he=[...q,...C.filter((({showInTypesSelector:e=!1,name:t})=>e&&!!t)).map((({name:e})=>e))],ye=l((()=>{if("boolean"==typeof y)return y?[]:he;if(Array.isArray(y))return y;const e=y(V);return"boolean"==typeof e?e?[]:he:e}),[V,y]);if(!h("value",V,b,f))return null;const be=()=>{let e;switch(x(null),re){case"object":e={[w("DEFAULT_NEW_KEY",V)]:T};break;case"array":e=null!=T?T:[];break;case"number":{const t=Number(T);e=isNaN(t)?0:t;break}default:e=T}c(e,M).then((t=>{t&&W({code:"UPDATE_ERROR",message:t},e)}))},fe=()=>{x(null),P(r),oe(ae(r,Q))},{isEditing:ve,isEditingKey:je,canEditKey:Ee}=U,De=!ve&&B,we=ve&&ye.length>0,Ce="invalid"!==re&&!B&&pe,ke=v&&je,Oe=v&&!je&&!ue,Se={value:T,parentData:o,setValue:se,isEditing:ve,setIsEditing:_?()=>x(R):()=>{},handleEdit:be,handleCancel:fe,path:M,stringTruncate:j,showStringQuotes:E,nodeData:V,translate:w,handleKeyboard:k},Ne=ce&&(ve&&ge||!ve&&me)?t(ce,Object.assign({},n,{value:T,customNodeProps:de,setValue:se,handleEdit:be,handleCancel:fe,handleKeyPress:e=>k(e,{stringConfirm:be,cancel:fe}),isEditing:ve,setIsEditing:()=>x(R),getStyles:S})):ie(ae(r),Se);return e("div",Object.assign({className:"jer-component jer-value-component",style:{marginLeft:D/2+"em",position:"relative"},draggable:L},H,Y("above"),{children:[$,t(J,{position:"above",nodeData:V}),e("div",{className:"jer-value-main-row",style:{flexWrap:K.length>10?"wrap":"nowrap"},children:[Oe&&t("span",{className:"jer-key-text",style:Object.assign(Object.assign({},S("property",V)),{minWidth:`${Math.min(String(K).length+1,5)}ch`,flexShrink:K.length>10?1:0}),onDoubleClick:()=>Ee&&x(`key_${R}`),children:""===K?t("span",{className:M.length>0?"jer-empty-string":void 0}):`${K}:`}),ke&&t("input",{className:"jer-input-text jer-key-edit",type:"text",name:R,defaultValue:K,autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>k(e,{stringConfirm:()=>G(e.target.value),cancel:fe}),style:{width:String(K).length/1.5+.5+"em"}}),e("div",{className:"jer-value-and-buttons",children:[t("div",{className:"jer-input-component",children:Ne}),ve?t(Z,{onOk:be,onCancel:fe,nodeData:V}):Ce&&t(X,{startEdit:_?()=>x(R):void 0,handleDelete:I?()=>{d(T,M).then((e=>{e&&W({code:"DELETE_ERROR",message:e},T)}))}:void 0,enableClipboard:g,translate:w,customButtons:n.customButtons,nodeData:V,handleKeyboard:k,keyboardControls:O}),we&&e("div",{className:"jer-select",children:[t("select",{name:`${K}-type-select`,className:"jer-type-select",onChange:e=>(e=>{const t=C.find((t=>t.name===e));if(t)c(t.defaultValue,M),oe(e),x(null),A({path:M,collapsed:!1});else{const t=le(T,e,w("DEFAULT_NEW_KEY",V),(null==Q?void 0:Q.CustomNode)?w("DEFAULT_STRING",V):void 0);se(t),c(t,M).then((e=>{e&&(W({code:"UPDATE_ERROR",message:e},t),x(null))}))}})(e.target.value),value:re,children:ye.map((e=>t("option",{value:e,children:e},e)))}),t("span",{className:"focus"})]}),De&&t("span",{className:"jer-error-slug",style:S("error",V),children:B})]})]}),t(J,{position:"below",nodeData:V})]}))},ae=(e,t)=>(null==t?void 0:t.CustomNode)&&(null==t?void 0:t.name)&&t.showInTypesSelector?t.name:"string"==typeof e?"string":"number"==typeof e?"number":"boolean"==typeof e?"boolean":null===e?"null":"invalid",ie=(e,n)=>{const r=n.value;switch(e){case"string":return t(M,Object.assign({},n,{value:r}));case"number":return t(K,Object.assign({},n,{value:r}));case"boolean":return t(_,Object.assign({},n,{value:r}));case"null":return t(I,Object.assign({},n));default:return t(L,Object.assign({},n))}},le=(e,t,n,r)=>{switch(t){case"string":return null!=r?r:String(e);case"number":{const t=Number(e);return isNaN(t)?0:t}case"boolean":return!!e;case"null":return null;case"object":return{[n]:e};case"array":return[e];default:return String(e)}},se=r=>{const{getStyles:o}=N(),{collapseState:s,setCollapseState:d,doesPathMatch:y,currentlyEditingElement:b,setCurrentlyEditingElement:f,areChildrenBeingEdited:v}=z(),{data:j,nodeData:D,parentData:w,showCollectionCount:C,onEdit:k,onAdd:O,onDelete:S,canDragOnto:x,collapseFilter:A,collapseAnimationTime:T,onMove:P,enableClipboard:R,searchFilter:V,searchText:F,indent:M,keySort:K,showArrayIndices:_,defaultValue:I,translate:L,customNodeDefinitions:B,jsonParse:W,jsonStringify:G,keyboardControls:U,handleKeyboard:H,insertAtTop:Y}=r,[$,Q]=a(G(j)),q=A(D),{contentRef:ae,isAnimating:ie,maxHeight:le,collapsed:ce,animateCollapse:de}=((e,t,n)=>{const[r,o]=a(n?0:void 0),[i,l]=a(n),s=c(!1),d=c(null),u=c(0),p=c();return{contentRef:d,isAnimating:s.current,animateCollapse:n=>{var r,a;if(i!==n){switch(window.clearTimeout(p.current),s.current=!0,n){case!0:{const e=null!==(a=null===(r=d.current)||void 0===r?void 0:r.offsetHeight)&&void 0!==a?a:0;u.current=e,o(e),setTimeout((()=>{o(0)}),5);break}case!1:o(u.current||re(e,d))}l(!i),p.current=window.setTimeout((()=>{s.current=!1,n||o(void 0)}),t)}},maxHeight:r,collapsed:i}})(j,T,q),{pathString:ue,nodeData:pe,path:ge,name:me,size:he,canEdit:ye,canDelete:be,canAdd:fe,canDrag:ve,error:je,setError:Ee,onError:De,handleEditKey:we,derivedValues:Ce}=te({props:r,collapsed:ce}),{dragSourceProps:ke,getDropTargetProps:Oe,BottomDropTarget:Se,DropTargetPadding:Ne}=ne({canDrag:ve,canDragOnto:x,path:ge,nodeData:pe,onMove:P,onError:De,translate:L}),xe=c(!q);i((()=>{Q(G(j))}),[j]),i((()=>{const e=A(pe)&&!Ce.isEditing;xe.current=!e,de(e)}),[A]),i((()=>{null!==s&&y(ge)&&(xe.current=!0,de(s.collapsed))}),[s]);const Ae=l((()=>(e,t)=>"function"!=typeof I?I:I(e,t)),[I]),{CustomNode:Te,customNodeProps:Pe,CustomWrapper:Re,wrapperProps:Ve={},hideKey:ze,showEditTools:Fe=!0,showOnEdit:Me,showOnView:Ke,showCollectionWrapper:_e=!0}=l((()=>ee(B,pe)),[]);if(!h("collection",pe,V,F)&&pe.level>0)return null;const Ie=Array.isArray(j)?"array":"object",Le="array"===Ie?{open:"[",close:"]"}:{open:"{",close:"}"},Be=e=>H(e,{objectConfirm:Ge,cancel:He}),We=e=>{const t=E(e);if(t&&U.collapseModifier.includes(t))return xe.current=!0,void d({collapsed:!ce,path:ge});b&&b.includes(ue)||(xe.current=!0,d(null),de(!ce))},Ge=()=>{try{const e=W($);if(f(null),Ee(null),JSON.stringify(e)===JSON.stringify(j))return;k(e,ge).then((t=>{t&&De({code:"UPDATE_ERROR",message:t},e)}))}catch(e){De({code:"INVALID_JSON",message:L("ERROR_INVALID_JSON",pe)},$)}},Ue=ge.length>0?()=>{S(j,ge).then((e=>{e&&De({code:"DELETE_ERROR",message:e},u(j,ge))}))}:void 0,He=()=>{f(null),Ee(null),Q(G(j))},{isEditing:Ye,isEditingKey:$e,isArray:Je,canEditKey:Xe}=Ce,Ze="when-closed"===C?ce:C,Qe=!Ye&&Fe,qe=(_||!Je)&&!ze&&void 0!==me,et=Te&&(Ye&&Me||!Ye&&Ke),tt=K&&"object"===Ie,nt=Object.entries(j).map((([e,t])=>["array"===Ie?Number(e):e,t]));tt&&nt.sort("function"==typeof K?(e,t)=>K(e[0],t[0]):void 0);const rt=xe.current?Ye?t("div",{className:"jer-collection-text-edit",children:e("div",{children:[t(g,{className:"jer-collection-text-area",name:ue,value:$,setValue:Q,isEditing:Ye,handleKeyPress:Be,styles:o("input",pe)}),t("div",{className:"jer-collection-input-button-row",children:t(Z,{onOk:Ge,onCancel:He,nodeData:pe})})]})}):nt.map((([e,n],a)=>{const i={key:e,value:n,path:[...ge,e],level:ge.length+1,index:a,size:m(n)?Object.keys(n).length:1,parentData:j,fullData:pe.fullData};return t("div",{className:"jer-collection-element",style:o("collectionElement",i),children:m(n)?t(se,Object.assign({},r,{data:n,parentData:j,nodeData:i,showCollectionCount:C,canDragOnto:ye}),e):t(oe,Object.assign({},r,{data:n,parentData:j,nodeData:i,canDragOnto:ye,showLabel:"object"===Ie||_}),e)},e)})):null,ot=!!_e&&ce;ot||(xe.current=!0);const at=Object.assign(Object.assign({},r),{data:j,value:j,parentData:w,nodeData:pe,setValue:e=>p(void 0,void 0,void 0,(function*(){return yield k(e,ge)})),handleEdit:Ge,handleCancel:He,handleKeyPress:Be,isEditing:Ye,setIsEditing:()=>f(ue),getStyles:o,canDragOnto:ye}),it=et?t(Te,Object.assign({customNodeProps:Pe},at,{children:rt})):rt,lt=$e?t("input",{className:"jer-input-text jer-key-edit",type:"text",name:ue,defaultValue:me,autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>H(e,{stringConfirm:()=>we(e.target.value),cancel:He}),style:{width:String(me).length/1.5+.5+"em"}}):qe&&t("span",{className:"jer-key-text",style:o("property",pe),onClick:e=>e.stopPropagation(),onDoubleClick:()=>Xe&&f(`key_${ue}`),children:""===me?t("span",{className:ge.length>0?"jer-empty-string":void 0}):`${me}:`}),st=Qe&&t(X,{startEdit:ye?()=>{xe.current=!0,f(ue)}:void 0,handleAdd:fe?e=>{de(!1);const t=Ae(pe,e);if("array"===Ie){const e=Y.array?0:j.length,n=Y.array?{insert:!0}:{};O(t,[...ge,e],n).then((e=>{e&&De({code:"ADD_ERROR",message:e},t)}))}else if(e in j)De({code:"KEY_EXISTS",message:L("ERROR_KEY_EXISTS",pe)},e);else{const n=Y.object?{insertBefore:0}:{};O(t,[...ge,e],n).then((e=>{e&&De({code:"ADD_ERROR",message:e},t)}))}}:void 0,handleDelete:be?Ue:void 0,enableClipboard:R,type:Ie,nodeData:pe,translate:L,customButtons:r.customButtons,keyboardControls:U,handleKeyboard:H}),ct=e("div",Object.assign({className:"jer-component jer-collection-component",style:Object.assign(Object.assign({marginLeft:(0===ge.length?0:M/2)+"em"},o("collection",pe)),{position:"relative"}),draggable:ve},ke,Oe("above"),{children:[t("div",{className:"jer-clickzone",style:{width:M/2+1+"em",zIndex:10+2*pe.level},onClick:e=>We(e)}),!Ye&&Se,t(Ne,{position:"above",nodeData:pe}),_e?e("div",{className:"jer-collection-header-row",style:{position:"relative"},onClick:e=>We(e),children:[e("div",{className:"jer-collection-name",children:[t("div",{className:"jer-collapse-icon jer-accordion-icon"+(ce?" jer-rotate-90":""),style:{zIndex:11+2*pe.level},onClick:e=>We(e),children:t(J,{name:"chevron",rotate:ce,nodeData:pe})}),lt,!Ye&&t("span",{className:"jer-brackets jer-bracket-open",style:o("bracket",pe),children:Le.open})]}),!Ye&&Ze&&t("div",{className:"jer-collection-item-count"+(Ze?" jer-visible":" jer-hidden"),style:o("itemCount",pe),children:1===he?L("ITEM_SINGLE",Object.assign(Object.assign({},pe),{size:1}),1):L("ITEMS_MULTIPLE",pe,he)}),t("div",{className:"jer-brackets"+(ot?" jer-visible":" jer-hidden"),style:o("bracket",pe),children:Le.close}),st]}):ze?t(n,{}):e("div",{className:"jer-collection-header-row",style:{position:"relative"},children:[lt,st]}),e("div",{className:"jer-collection-inner",style:Object.assign({overflowY:ot||ie?"clip":"visible",maxHeight:v(ue)?void 0:le},o("collectionInner",pe)),ref:ae,children:[it,t("div",{className:Ye?"jer-collection-error-row":"jer-collection-error-row-edit",children:je&&t("span",{className:"jer-error-slug",style:o("error",pe),children:je})}),!Ye&&_e&&t("div",{className:"jer-brackets jer-bracket-outside",style:Object.assign(Object.assign({},o("bracket",pe)),{marginLeft:(M<3?-1:M<6?-.5:0)+"em"}),children:Le.close})]}),t(Ne,{position:"below",nodeData:pe})]}));return Re?t(Re,Object.assign({customNodeProps:Ve},at,{children:ct})):ct},ce={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"},de=(e,t)=>(n,r,o)=>((e,t,n,r,o)=>{if(t[r]){const e=t[r](n);if(null!==e)return e}const a=r in e?e[r]:ce[r];return void 0===o?a:null==a?void 0:a.replace("{{count}}",String(o))})(e,t,r,n,o);var ue=[],pe=[];!function(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",o=!0===t.singleTag,a="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(o){var i=ue.indexOf(a);-1===i&&(i=ue.push(a)-1,pe[i]={}),n=pe[i]&&pe[i][r]?pe[i][r]:pe[i][r]=l()}else n=l();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function l(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),o=0;o<n.length;o++)e.setAttribute(n[o],t.attributes[n[o]]);var i="prepend"===r?"afterbegin":"beforeend";return a.insertAdjacentElement(i,e),e}}(':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}.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 ge=({data:e,setData:n,rootName:r="root",onUpdate:o=(()=>{}),onEdit:c=o,onDelete:d=o,onAdd:u=o,onChange:g,onError:h,showErrorMessages:y=!0,enableClipboard:b=!0,indent:f=2,collapse:v=!1,collapseAnimationTime:j=300,showCollectionCount:E=!0,restrictEdit:w=!1,restrictDelete:k=!1,restrictAdd:O=!1,restrictTypeSelection:S=!1,restrictDrag:x=!0,searchFilter:A,searchText:T,searchDebounceTime:P=350,keySort:R=!1,showArrayIndices:V=!0,showStringQuotes:z=!0,defaultValue:F=null,minWidth:M=250,maxWidth:K="min(600px, 90vw)",rootFontSize:_,stringTruncate:I=250,translations:L={},className:B,id:W,customText:G={},customNodeDefinitions:U=[],customButtons:H=[],jsonParse:Y=JSON.parse,jsonStringify:$=(e=>JSON.stringify(e,null,2)),errorMessageTimeout:J=2500,keyboardControls:X={},insertAtTop:Z=!1})=>{const{getStyles:Q}=N(),q=s(ye(v),[v]),ee=s(de(L,G),[L,G]),[te,ne]=a(T),[re,ae]=(({setData:e,data:t})=>{const[n,r]=a(e?void 0:t),o=s((t=>{e?e(t):r(t)}),[e]);return i((()=>{e||r(t)}),[t]),[e?t:n,o]})({setData:n,data:e}),ie=document.querySelector(":root"),le=getComputedStyle(document.documentElement).getPropertyValue("--jer-expand-transition-time");1e3*parseFloat(le)!==j&&(null==ie||ie.style.setProperty("--jer-expand-transition-time",j/1e3+"s")),i((()=>{const e=setTimeout((()=>ne(T)),P);return()=>clearTimeout(e)}),[T,P]);const ce={key:r,path:[],level:0,index:0,value:re,size:"object"==typeof re&&null!==re?Object.keys(re).length:1,parentData:null,fullData:re},ue=(e,t)=>p(void 0,void 0,void 0,(function*(){const n=yield e(t);if(!0===n||void 0===n)return void ae(t.newData);const r=fe(n)?n:["error",n],[o,a]=r;if("error"===o)return ae(t.currentData),!1===a?ee("ERROR_UPDATE",ce):String(a);ae(a)})),pe=l((()=>ye(w)),[w]),ge=l((()=>ye(k)),[k]),me=l((()=>ye(O)),[O]),ve=l((()=>ye(x)),[x]),je=l((()=>be(A)),[A]),Ee=l((()=>(e=>{const t=Object.assign({},C);for(const n of Object.keys(C)){const r=n;if(e[r]){const o=e[r],a=["clipboardModifier","collapseModifier"].includes(n)?Array.isArray(o)?o:[o]:"string"==typeof o?{key:o}:o;t[r]=a,["stringConfirm","numberConfirm","booleanConfirm"].forEach((n=>{!e[n]&&e.confirm&&(t[n]=t.confirm)}))}}return t})(X)),[X]),De=s(((e,t)=>((e,t,n)=>{const r=Object.entries(t);for(const[t,o]of r)if(D(n,e[t],t)){n.preventDefault(),o();break}})(Ee,t,e)),[X]),we={name:r,nodeData:ce,onEdit:(e,t)=>p(void 0,void 0,void 0,(function*(){const{currentData:n,newData:r,currentValue:o,newValue:a}=he(re,t,e,"update");if(o!==a)return yield ue(c,{currentData:n,newData:r,currentValue:o,newValue:a,name:t.slice(-1)[0],path:t})})),onDelete:(e,t)=>p(void 0,void 0,void 0,(function*(){const{currentData:n,newData:r,currentValue:o,newValue:a}=he(re,t,e,"delete");return yield ue(d,{currentData:n,newData:r,currentValue:o,newValue:a,name:t.slice(-1)[0],path:t})})),onAdd:(e,t,n)=>p(void 0,void 0,void 0,(function*(){const{currentData:r,newData:o,currentValue:a,newValue:i}=he(re,t,e,"add",n);return yield ue(u,{currentData:r,newData:o,currentValue:a,newValue:i,name:t.slice(-1)[0],path:t})})),onChange:g,onError:h,showErrorMessages:y,onMove:(e,t,n)=>p(void 0,void 0,void 0,(function*(){if(null===e)return;const{currentData:r,newData:o,currentValue:a}=he(re,e,"","delete"),i=e.slice(-1)[0],l=t.slice(0,-1),s=t.slice(-1)[0];let d="number"==typeof s?"above"===n?s:s+1:"number"==typeof i?`arr_${i}`:i;e.slice(0,-1).join(".")===t.slice(0,-1).join(".")&&"number"==typeof i&&"number"==typeof d&&i<d&&(d-=1);const u="number"==typeof d?{insert:!0}:"above"===n?{insertBefore:s}:{insertAfter:s},{newData:p,newValue:g}=he(o,[...l,d],a,"add",u);return yield ue(c,{currentData:r,newData:p,currentValue:a,newValue:g,name:t.slice(-1)[0],path:t})})),showCollectionCount:E,collapseFilter:q,collapseAnimationTime:j,restrictEditFilter:pe,restrictDeleteFilter:ge,restrictAddFilter:me,restrictTypeSelection:S,restrictDragFilter:ve,canDragOnto:!1,searchFilter:je,searchText:te,enableClipboard:b,keySort:R,showArrayIndices:V,showStringQuotes:z,indent:f,defaultValue:F,stringTruncate:I,translate:ee,customNodeDefinitions:U,customButtons:H,parentData:null,jsonParse:Y,jsonStringify:$,errorMessageTimeout:J,handleKeyboard:De,keyboardControls:Ee,insertAtTop:{object:!0===Z||"object"===Z,array:!0===Z||"array"===Z}},Ce=Object.assign(Object.assign({},Q("container",ce)),{minWidth:M,maxWidth:K});return Ce.fontSize=null!=_?_:Ce.fontSize,t("div",{id:W,className:"jer-editor-container "+B,style:Ce,children:m(re)?t(se,Object.assign({data:re},we)):t(oe,Object.assign({data:re,showLabel:!0},we))})},me=e=>{var n;return t(S,{theme:null!==(n=e.theme)&&void 0!==n?n:k,icons:e.icons,children:t(V,{children:t(ge,Object.assign({},e))})})},he=(e,t,n,r,o={})=>{if(0===t.length)return{currentData:e,newData:n,currentValue:e,newValue:n};const a=Object.assign({remove:"delete"===r},o),i="add"!==r?u(e,t):void 0;return{currentData:e,newData:d(e,t,n,a),currentValue:i,newValue:"delete"!==r?n:void 0}},ye=e=>"boolean"==typeof e?()=>e:"number"==typeof e?({level:t})=>t>=e:e,be=e=>{if(void 0!==e)return"value"===e?b:"key"===e?f:"all"===e?(e,t)=>b(e,t)||f(e,t):e},fe=e=>Array.isArray(e)&&2===e.length&&["error","value"].includes(e[0]),ve=({value:n,setIsEditing:r,getStyles:o,customNodeProps:a,nodeData:i})=>{var l,s;const c=null!==(l=null==a?void 0:a.stringTruncate)&&void 0!==l?l:100,d=o("string",i);return t("div",{onDoubleClick:()=>r(!0),onClick:e=>{(e.getModifierState("Control")||e.getModifierState("Meta"))&&r(!0)},className:"jer-value-string jer-hyperlink",style:d,children:e("a",{href:n,target:"_blank",rel:"noreferrer",style:{color:null!==(s=d.color)&&void 0!==s?s:void 0},children:['"',v(n,c),'"']})})},je={condition:({value:e})=>"string"==typeof e&&/^https?:\/\/.+\..+$/.test(e),element:ve,showOnView:!0,showOnEdit:!1},Ee={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)"}},De={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"}},we={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"}},Ce={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"}},ke={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"}],input:{border:"1px solid rgb(115, 194, 198)"},iconCollection:"#1D3557",iconEdit:"#457B9D",iconDelete:"#E63946",iconAdd:"#2B2D42",iconCopy:"#1D3557",iconCancel:"#E63946"}},Oe={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"}};export{B as IconAdd,Y as IconCancel,$ as IconChevron,U as IconCopy,G as IconDelete,W as IconEdit,H as IconOk,me as JsonEditor,ve as LinkCustomComponent,je as LinkCustomNodeDefinition,ke as candyWrapperTheme,k as defaultTheme,Ee as githubDarkTheme,De as githubLightTheme,m as isCollection,b as matchNode,f as matchNodeKey,we as monoDarkTheme,Ce as monoLightTheme,Oe as psychedelicTheme,v as truncate};
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import{createContext as r,useContext as o,useState as a,useEffect as i,useMemo as l,useCallback as s,useRef as c}from"react";import d from"object-property-assigner";export{default as assign}from"object-property-assigner";import u from"object-property-extractor";export{default as extract}from"object-property-extractor";function p(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{s(r.next(e))}catch(e){a(e)}}function l(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const g=({className:n,name:r,value:o,setValue:a,handleKeyPress:i,styles:l})=>{if("string"!=typeof o)return null;const s="\n"===o.slice(-1)?o+".":o;return e("div",{style:{display:"grid"},children:[t("textarea",{id:`${r}_textarea`,style:Object.assign({height:"auto",gridArea:"1 / 1 / 2 / 2",overflowY:"auto",whiteSpace:"pre-wrap"},l),rows:1,className:n,name:`${r}_textarea`,value:o,onChange:e=>a(e.target.value),autoFocus:!0,onFocus:e=>{o.length<40&&e.target.select()},onKeyDown:i}),t("span",{className:n,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:s})]})},m=e=>null!==e&&"object"==typeof e,h=(e,t,n,r="")=>{if(!n&&!r)return!0;switch(e){case"collection":if(n){if(n(t,r))return!0;if(!y(r,t,n))return!1}if(!n&&r&&!y(r,t))return!1;break;case"value":if(n&&!n(t,r))return!1;if(!n&&r&&!b(t,r))return!1}return!0},y=(e="",t,n=b)=>{const r=t.value;return Object.entries(r).some((([o,a])=>{const i=[...t.path,o],l=Object.assign(Object.assign({},t),{key:o,path:i,level:t.level+1,value:a,size:i.length,parentData:r});return m(a)?y(e,l,n):n(l,e)}))},b=(e,t="")=>{const{value:n}=e;if(null===n&&"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())||"1"===t:"false".includes(t.toLowerCase())||"0"===t;default:return!1}},f=({key:e,path:t},n="")=>!!b({value:e},n)||!!t.some((e=>b({value:e},n))),v=(e,t=200)=>"string"==typeof e?e.length<t?e:`${e.slice(0,t-2).trim()}...`:e,j=e=>e.map((e=>""===e?String.fromCharCode(0):e)).join("."),E=e=>e.shiftKey?"Shift":e.metaKey?"Meta":e.ctrlKey?"Control":e.altKey?"Alt":void 0,D=(e,t,n)=>{const r=e.key,o=E(e);if(Array.isArray(t))return!!o&&t.includes(o);const{key:a,modifier:i}=t;return("stringLineBreak"!==n||"Enter"!==r||"Shift"!==o||"Enter"!==a||!(null==i?void 0:i.includes("Shift")))&&(r===a&&(i===o||Array.isArray(i)&&i.includes(o)))},w={key:"Enter"},C={confirm:w,cancel:{key:"Escape"},objectConfirm:Object.assign(Object.assign({},w),{modifier:["Meta","Shift","Control"]}),objectLineBreak:w,stringConfirm:w,stringLineBreak:Object.assign(Object.assign({},w),{modifier:["Shift"]}),numberConfirm:w,numberUp:{key:"ArrowUp"},numberDown:{key:"ArrowDown"},booleanConfirm:w,clipboardModifier:["Meta","Control"],collapseModifier:["Alt"]},k={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)"}},O=r({getStyles:()=>({}),icons:{}}),S=({theme:e=k,icons:n={},children:r})=>{const o=x(e);return t(O.Provider,{value:{getStyles:(e,t)=>"function"==typeof o[e]?o[e](t):o[e],icons:n},children:r})},N=()=>o(O),x=e=>{var t,n,r,o;const a={},i=(Array.isArray(e)?e:[e]).map((e=>T(e)?A({fragments:{},styles:e},a):A(e,a))),l=A(k,{});Object.keys(l).forEach((e=>{const t=e;i.forEach((e=>{e[t]&&(l[t]=Object.assign(Object.assign({},l[t]),e[t]))}))}));const s=Object.assign({},l);return Object.entries(a).forEach((([e,t])=>{const n=e;s[n]=e=>{const r=t(e)||{};return Object.assign(Object.assign({},l[n]),r)}})),"function"!=typeof(null==s?void 0:s.inputHighlight)&&(null===(t=null==s?void 0:s.inputHighlight)||void 0===t?void 0:t.backgroundColor)&&document.documentElement.style.setProperty("--jer-highlight-color",null===(n=null==s?void 0:s.inputHighlight)||void 0===n?void 0:n.backgroundColor),"function"!=typeof(null==s?void 0:s.iconCopy)&&(null===(r=null==s?void 0:s.iconCopy)||void 0===r?void 0:r.color)&&document.documentElement.style.setProperty("--jer-icon-copy-color",null===(o=null==s?void 0:s.iconCopy)||void 0===o?void 0:o.color),s},A=(e,t)=>{const{fragments:n,styles:r}=e,o={};return Object.entries(r).forEach((([e,r])=>{const a=(Array.isArray(r)?r:[r]).reduce(((r,o)=>{var a,i;if("function"==typeof o)return t[e]=o,Object.assign({},r);if("string"==typeof o){const t=null!==(a=null==n?void 0:n[o])&&void 0!==a?a:o;return"string"==typeof t?Object.assign(Object.assign({},r),{[null!==(i=P[e])&&void 0!==i?i:"color"]:t}):Object.assign(Object.assign({},r),t)}return Object.assign(Object.assign({},r),o)}),{});o[e]=a})),o},T=e=>!("styles"in e),P={container:"backgroundColor",collection:"backgroundColor",collectionInner:"backgroundColor",collectionElement:"backgroundColor",dropZone:"borderColor",inputHighlight:"backgroundColor"},R=r({collapseState:null,setCollapseState:()=>{},doesPathMatch:()=>!1,currentlyEditingElement:null,setCurrentlyEditingElement:()=>{},areChildrenBeingEdited:()=>!1,dragSource:{path:null,pathString:null},setDragSource:()=>{}}),V=({children:e})=>{const[n,r]=a(null),[o,i]=a(null),[l,s]=a({path:null,pathString:null});return t(R.Provider,{value:{collapseState:n,setCollapseState:e=>{r(e),null!==e&&setTimeout((()=>r(null)),2e3)},doesPathMatch:e=>{if(null===n)return!1;for(const[t,r]of n.path.entries())if(r!==e[t])return!1;return!0},currentlyEditingElement:o,setCurrentlyEditingElement:i,areChildrenBeingEdited:e=>null!==o&&o.includes(e),dragSource:l,setDragSource:s},children:e})},z=()=>o(R),F="**INVALID_FUNCTION**",M=({value:n,setValue:r,isEditing:o,path:a,setIsEditing:i,handleEdit:l,handleCancel:s,stringTruncate:c,showStringQuotes:d,nodeData:u,handleKeyboard:p})=>{const{getStyles:m}=N(),h=j(a),y=d?'"':"";return o?t(g,{className:"jer-input-text",name:h,value:n,setValue:r,isEditing:o,handleKeyPress:e=>{p(e,{stringConfirm:l,cancel:s,stringLineBreak:()=>{var t,o;const a=document.getElementById(`${h}_textarea`);if(a){const i=null!==(t=null==a?void 0:a.selectionStart)&&void 0!==t?t:1/0,l=null!==(o=null==a?void 0:a.selectionEnd)&&void 0!==o?o:1/0,s=n.slice(0,i),c=n.slice(l);e.target.value=s+"\n"+c,a.setSelectionRange(i+1,i+1),r(s+"\n"+c)}}})},styles:m("input",u)}):e("div",{id:`${h}_display`,onDoubleClick:()=>i(!0),onClick:e=>{(e.getModifierState("Control")||e.getModifierState("Meta"))&&i(!0)},className:"jer-value-string",style:m("string",u),children:[y,v(n,c),y]})},K=({value:e,setValue:n,isEditing:r,path:o,setIsEditing:a,handleEdit:i,handleCancel:l,nodeData:s,handleKeyboard:c})=>{const{getStyles:d}=N();return r?t("input",{className:"jer-input-number",type:"text",name:j(o),value:e,onChange:e=>n(e.target.value.replace(/[^0-9.-]/g,"")),autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:t=>c(t,{numberConfirm:i,cancel:l,numberUp:()=>n(Number(e)+1),numberDown:()=>n(Number(e)-1)}),style:Object.assign({width:String(e).length/1.5+2+"em"},d("input",s))}):t("span",{onDoubleClick:()=>a(!0),className:"jer-value-number",style:d("number",s),children:e})},_=({value:e,setValue:n,isEditing:r,path:o,setIsEditing:a,handleEdit:i,handleCancel:l,nodeData:s,handleKeyboard:c})=>{const{getStyles:d}=N();return r?t("input",{className:"jer-input-boolean",type:"checkbox",name:j(o),checked:e,onChange:()=>n(!e),onKeyDown:e=>c(e,{booleanConfirm:i,cancel:l}),autoFocus:!0}):t("span",{onDoubleClick:()=>a(!0),className:"jer-value-boolean",style:d("boolean",s),children:String(e)})},I=({value:e,isEditing:n,setIsEditing:r,handleEdit:o,handleCancel:a,nodeData:l,handleKeyboard:s})=>{const{getStyles:c}=N();i((()=>(n&&document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d))),[n]);const d=e=>s(e,{confirm:o,cancel:a});return t("div",{onDoubleClick:()=>r(!0),className:"jer-value-null",style:c("null",l),children:String(e)})},L=({value:e})=>{let n="Error!";switch(typeof e){case"string":e===F&&(n="Function");break;case"undefined":n="Undefined";break;case"symbol":n="Symbol"}return t("span",{className:"jer-value-invalid",children:n})},B=({size:n,style:r,className:o})=>e("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:n,height:n,className:o,style:r,children:[t("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z"}),t("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"})]}),W=({size:n,style:r,className:o})=>e("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:n,height:n,className:o,style:r,transform:"translate(0, 0.5)",children:[t("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"}),t("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"})]}),G=({size:e,style:n,className:r})=>t("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:r,style:n,children:t("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"})}),U=({size:n,style:r,className:o})=>e("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:n,height:n,className:o,style:r,children:[t("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"}),t("path",{d:"M8 4H6a2 2 0 00-2 2v14a2 2 0 002 2h12a2 2 0 002-2v-2M16 4h2a2 2 0 012 2v4M21 14H11"}),t("path",{d:"M15 10l-4 4 4 4"})]}),H=({size:n,style:r,className:o})=>e("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:n,height:n,className:o,style:r,children:[t("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"}),t("path",{d:"M22 4L12 14.01l-3-3"})]}),Y=({size:e,style:n,className:r})=>t("svg",{baseProfile:"tiny",viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:r,style:n,children:t("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"})}),$=({size:e,style:n,className:r})=>t("svg",{viewBox:"0 0 512 512",fill:"currentColor",width:e,height:e,className:r,style:n,children:t("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"})}),J=({name:e,nodeData:r,rotate:o})=>{var a,i,l,s,c,d,u;const{getStyles:p,icons:g}=N(),m={size:"1.4em",className:"jer-icon"};switch(e){case"add":return null!==(a=null==g?void 0:g.add)&&void 0!==a?a:t(B,Object.assign({},m,{style:p("iconAdd",r)}));case"edit":return null!==(i=null==g?void 0:g.edit)&&void 0!==i?i:t(W,Object.assign({},m,{style:p("iconEdit",r)}));case"delete":return null!==(l=null==g?void 0:g.delete)&&void 0!==l?l:t(G,Object.assign({},m,{style:p("iconDelete",r),size:"1.45em"}));case"copy":return null!==(s=null==g?void 0:g.copy)&&void 0!==s?s:t(U,Object.assign({},m,{style:p("iconCopy",r),size:"1.2em"}));case"ok":return null!==(c=null==g?void 0:g.ok)&&void 0!==c?c:t(H,Object.assign({},m,{style:Object.assign({fontSize:"90%"},p("iconOk",r))}));case"cancel":return null!==(d=null==g?void 0:g.cancel)&&void 0!==d?d:t(Y,Object.assign({},m,{style:Object.assign({fontSize:"130%"},p("iconCancel",r))}));case"chevron":return null!==(u=null==g?void 0:g.chevron)&&void 0!==u?u:t($,{size:"1em",style:p("iconCollection",r)});default:return t(n,{})}},X=({startEdit:r,handleDelete:o,handleAdd:i,enableClipboard:l,type:s,customButtons:c,nodeData:d,translate:u,keyboardControls:p,handleKeyboard:g})=>{const{getStyles:m}=N(),h=u("KEY_NEW",d),[y,b]=a(!1),[f,v]=a(h),{key:j,path:D,value:w}=d;return e("div",{className:"jer-edit-buttons",style:{opacity:y?1:void 0},children:[l&&t("div",{onClick:e=>{e.stopPropagation();let t,n="value",r="";if(l){const o=E(e);o&&p.clipboardModifier.includes(o)?(t=Q(D),r=t,n="path"):(t=w,r=s?JSON.stringify(w,null,2):String(t)),navigator.clipboard.writeText(r)}"function"==typeof l&&l({value:t,stringValue:r,path:D,key:j,type:n})},className:"jer-copy-pulse",children:t(J,{name:"copy",nodeData:d})}),r&&t("div",{onClick:e=>{e.stopPropagation(),r()},children:t(J,{name:"edit",nodeData:d})}),o&&t("div",{onClick:e=>{e.stopPropagation(),o()},children:t(J,{name:"delete",nodeData:d})}),i&&t("div",{onClick:e=>{e.stopPropagation(),"object"===s?b(!0):i("")},children:t(J,{name:"add",nodeData:d})}),null==c?void 0:c.map((({Element:e,onClick:n},r)=>t("div",{onClick:e=>n(d,e),children:t(e,{})},r))),y&&i&&"object"===s&&e(n,{children:[t("input",{className:"jer-input-new-key",type:"text",name:"new-object-key",value:f,onChange:e=>v(e.target.value),autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>{g(e,{stringConfirm:()=>{i&&(b(!1),i(f),v(h))},cancel:()=>{b(!1),v(h)}})},style:m("input",d)}),t(Z,{onOk:e=>{f&&(e.stopPropagation(),b(!1),i(f))},onCancel:e=>{e.stopPropagation(),b(!1)},nodeData:d})]})]})},Z=({onOk:n,onCancel:r,nodeData:o})=>e("div",{className:"jer-confirm-buttons",children:[t("div",{onClick:n,children:t(J,{name:"ok",nodeData:o})}),t("div",{onClick:r,children:t(J,{name:"cancel",nodeData:o})})]}),Q=e=>e.reduce(((e,t)=>"number"==typeof t?`${e}[${t}]`:""===e?t:`${e}.${t}`),""),q=["string","number","boolean","null","object","array"],ee=(e=[],t)=>{const n=e.filter((({condition:e})=>e(t)));if(0===n.length)return{};const r=n[0],{element:o,wrapperElement:a,customNodeProps:i,wrapperProps:l,hideKey:s=!1,showEditTools:c=!0,showOnEdit:d=!1,showOnView:u=!0,showCollectionWrapper:p=!0}=r,g=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(r,["element","wrapperElement","customNodeProps","wrapperProps","hideKey","showEditTools","showOnEdit","showOnView","showCollectionWrapper"]);return Object.assign({CustomNode:o,CustomWrapper:a,customNodeProps:i,wrapperProps:l,hideKey:s,showEditTools:c,showOnEdit:d,showOnView:u,showCollectionWrapper:p},g)},te=({props:e,collapsed:t})=>{const{data:n,nodeData:r,parentData:o,onEdit:i,onError:s,showErrorMessages:c,restrictEditFilter:d,restrictDeleteFilter:u,restrictAddFilter:p,restrictDragFilter:g,translate:m,errorMessageTimeout:h}=e,{currentlyEditingElement:y,setCurrentlyEditingElement:b}=z(),[f,v]=a(null),E=Object.assign(Object.assign({},r),{collapsed:t}),{path:D,key:w,size:C}=E,k=j(D),O=l((()=>!d(E)),[E]),S=l((()=>!u(E)),[E]),N=l((()=>!p(E)),[E]),x=l((()=>!g(E)&&S&&null===y),[E]),A=e=>{c&&(v(e),setTimeout((()=>v(null)),h)),console.warn("Error",e)},T=l((()=>(e,t)=>{A(e.message),s&&s({currentData:E.fullData,errorValue:t,currentValue:n,name:w,path:D,error:e})}),[s,c]),P=y===k,R=y===`key_${k}`,V="number"==typeof D.slice(-1)[0];return{pathString:k,nodeData:E,path:D,name:w,size:C,canEdit:O,canDelete:S,canAdd:N,canDrag:x,error:f,showError:A,onError:T,setError:v,handleEditKey:e=>{if(b(null),w===e)return;if(!o)return;const t=D.slice(0,-1);if(Object.keys(o).includes(e))return void T({code:"KEY_EXISTS",message:m("ERROR_KEY_EXISTS",E)},e);const n=Object.fromEntries(Object.entries(o).map((([t,n])=>t===w?[e,n]:[t,n])));i(n,t).then((t=>{t&&T({code:"UPDATE_ERROR",message:t},e)}))},derivedValues:{isEditing:P,isEditingKey:R,isArray:V,canEditKey:null!==o&&O&&N&&S&&!V}}},ne=({canDrag:e,canDragOnto:n,path:r,nodeData:o,onMove:i,onError:s,translate:c})=>{const{getStyles:d}=N(),{dragSource:u,setDragSource:p}=z(),[g,m]=a(!1),h=j(r),y=l((()=>e?{onDragStart:e=>{e.stopPropagation(),p({path:r,pathString:h})},onDragEnd:e=>{e.stopPropagation(),p({path:null,pathString:null})}}:{}),[e]),b=l((()=>e=>n?{onDragOver:e=>{e.stopPropagation(),e.preventDefault()},onDrop:t=>{t.stopPropagation(),v(e),p({path:null,pathString:null}),m(!1)},onDragEnter:t=>{var n;t.stopPropagation(),h.startsWith(null!==(n=u.pathString)&&void 0!==n?n:"")||m(e)},onDragExit:e=>{e.stopPropagation(),m(!1)}}:{}),[u,n]),f=l((()=>n&&null!==u.pathString?t("div",Object.assign({className:"jer-drop-target-bottom",style:{height:"50%",position:"absolute",width:"100%",top:"50%",zIndex:r.length}},b("below"))):null),[u,n]),v=e=>{var t,n;const a=null===(t=u.path)||void 0===t?void 0:t.slice(-1)[0],l=null===(n=u.path)||void 0===n?void 0:n.slice(0,-1).join("."),d=r.slice(0,-1).join(""),{parentData:p}=o;"string"==typeof a&&p&&!Array.isArray(p)&&Object.keys(p).includes(a)&&a in p&&l!==d?s({code:"KEY_EXISTS",message:c("ERROR_KEY_EXISTS",o)},a):i(u.path,r,e).then((e=>{e&&s({code:"UPDATE_ERROR",message:e},o.value)}))};return{dragSourceProps:y,getDropTargetProps:b,BottomDropTarget:f,DropTargetPadding:({position:e,nodeData:n})=>g===e?t("div",{className:"jer-drag-n-drop-padding",style:d("dropZone",n)}):null,handleDrop:v}},re=(e,t)=>{var n,r;const o=document.getElementsByClassName("jer-editor-container"),a=parseInt(o.length>0?getComputedStyle(o[0]).getPropertyValue("line-height"):"16px"),i=(null!==(r=null===(n=t.current)||void 0===n?void 0:n.offsetWidth)&&void 0!==r?r:0)/(.5*a),l=JSON.stringify(e,null,2).replace(/\\n/g,"\n").split("\n").map((e=>Math.ceil(e.length/i))).reduce(((e,t)=>e+t),0)*a;return Math.min(l+30,window.innerHeight-50)},oe=n=>{const{data:r,parentData:o,onEdit:c,onDelete:d,onChange:u,onMove:p,enableClipboard:g,canDragOnto:m,restrictTypeSelection:y,searchFilter:b,searchText:f,showLabel:v,stringTruncate:j,showStringQuotes:E,indent:D,translate:w,customNodeDefinitions:C,handleKeyboard:k,keyboardControls:O}=n,{getStyles:S}=N(),{setCurrentlyEditingElement:x,setCollapseState:A}=z(),[T,P]=a("function"==typeof r?F:r),{pathString:R,nodeData:V,path:M,name:K,canEdit:_,canDelete:I,canDrag:L,error:B,onError:W,handleEditKey:G,derivedValues:U}=te({props:n}),{dragSourceProps:H,getDropTargetProps:Y,BottomDropTarget:$,DropTargetPadding:J}=ne({canDrag:L,canDragOnto:m,path:M,nodeData:V,onMove:p,onError:W,translate:w}),Q=ee(C,V),[re,oe]=a(ae(r,Q)),se=s((e=>{if(!u)return void P(e);const t=u({currentData:V.fullData,newValue:e,currentValue:T,name:K,path:M});P(t)}),[u]);i((()=>{P("function"==typeof r?F:r),oe(ae(r,Q))}),[r,B]);const{CustomNode:ce,customNodeProps:de,hideKey:ue,showEditTools:pe=!0,showOnEdit:ge,showOnView:me}=Q,he=[...q,...C.filter((({showInTypesSelector:e=!1,name:t})=>e&&!!t)).map((({name:e})=>e))],ye=l((()=>{if("boolean"==typeof y)return y?[]:he;if(Array.isArray(y))return y;const e=y(V);return"boolean"==typeof e?e?[]:he:e}),[V,y]);if(!h("value",V,b,f))return null;const be=()=>{let e;switch(x(null),re){case"object":e={[w("DEFAULT_NEW_KEY",V)]:T};break;case"array":e=null!=T?T:[];break;case"number":{const t=Number(T);e=isNaN(t)?0:t;break}default:e=T}c(e,M).then((t=>{t&&W({code:"UPDATE_ERROR",message:t},e)}))},fe=()=>{x(null),P(r),oe(ae(r,Q))},{isEditing:ve,isEditingKey:je,canEditKey:Ee}=U,De=!ve&&B,we=ve&&ye.length>0,Ce="invalid"!==re&&!B&&pe,ke=v&&je,Oe=v&&!je&&!ue,Se={value:T,parentData:o,setValue:se,isEditing:ve,setIsEditing:_?()=>x(R):()=>{},handleEdit:be,handleCancel:fe,path:M,stringTruncate:j,showStringQuotes:E,nodeData:V,translate:w,handleKeyboard:k},Ne=ce&&(ve&&ge||!ve&&me)?t(ce,Object.assign({},n,{value:T,customNodeProps:de,setValue:se,handleEdit:be,handleCancel:fe,handleKeyPress:e=>k(e,{stringConfirm:be,cancel:fe}),isEditing:ve,setIsEditing:()=>x(R),getStyles:S})):ie(ae(r),Se);return e("div",Object.assign({className:"jer-component jer-value-component",style:{marginLeft:D/2+"em",position:"relative"},draggable:L},H,Y("above"),{children:[$,t(J,{position:"above",nodeData:V}),e("div",{className:"jer-value-main-row",style:{flexWrap:K.length>10?"wrap":"nowrap"},children:[Oe&&t("span",{className:"jer-key-text",style:Object.assign(Object.assign({},S("property",V)),{minWidth:`${Math.min(String(K).length+1,5)}ch`,flexShrink:K.length>10?1:0}),onDoubleClick:()=>Ee&&x(`key_${R}`),children:""===K?t("span",{className:M.length>0?"jer-empty-string":void 0}):`${K}:`}),ke&&t("input",{className:"jer-input-text jer-key-edit",type:"text",name:R,defaultValue:K,autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>k(e,{stringConfirm:()=>G(e.target.value),cancel:fe}),style:{width:String(K).length/1.5+.5+"em"}}),e("div",{className:"jer-value-and-buttons",children:[t("div",{className:"jer-input-component",children:Ne}),ve?t(Z,{onOk:be,onCancel:fe,nodeData:V}):Ce&&t(X,{startEdit:_?()=>x(R):void 0,handleDelete:I?()=>{d(T,M).then((e=>{e&&W({code:"DELETE_ERROR",message:e},T)}))}:void 0,enableClipboard:g,translate:w,customButtons:n.customButtons,nodeData:V,handleKeyboard:k,keyboardControls:O}),we&&e("div",{className:"jer-select",children:[t("select",{name:`${K}-type-select`,className:"jer-type-select",onChange:e=>(e=>{const t=C.find((t=>t.name===e));if(t)c(t.defaultValue,M),oe(e),x(null),A({path:M,collapsed:!1});else{const t=le(T,e,w("DEFAULT_NEW_KEY",V),(null==Q?void 0:Q.CustomNode)?w("DEFAULT_STRING",V):void 0);se(t),c(t,M).then((e=>{e&&(W({code:"UPDATE_ERROR",message:e},t),x(null))}))}})(e.target.value),value:re,children:ye.map((e=>t("option",{value:e,children:e},e)))}),t("span",{className:"focus"})]}),De&&t("span",{className:"jer-error-slug",style:S("error",V),children:B})]})]}),t(J,{position:"below",nodeData:V})]}))},ae=(e,t)=>(null==t?void 0:t.CustomNode)&&(null==t?void 0:t.name)&&t.showInTypesSelector?t.name:"string"==typeof e?"string":"number"==typeof e?"number":"boolean"==typeof e?"boolean":null===e?"null":"invalid",ie=(e,n)=>{const r=n.value;switch(e){case"string":return t(M,Object.assign({},n,{value:r}));case"number":return t(K,Object.assign({},n,{value:r}));case"boolean":return t(_,Object.assign({},n,{value:r}));case"null":return t(I,Object.assign({},n));default:return t(L,Object.assign({},n))}},le=(e,t,n,r)=>{switch(t){case"string":return null!=r?r:String(e);case"number":{const t=Number(e);return isNaN(t)?0:t}case"boolean":return!!e;case"null":return null;case"object":return{[n]:e};case"array":return[e];default:return String(e)}},se=r=>{const{getStyles:o}=N(),{collapseState:s,setCollapseState:d,doesPathMatch:y,currentlyEditingElement:b,setCurrentlyEditingElement:f,areChildrenBeingEdited:v}=z(),{data:j,nodeData:D,parentData:w,showCollectionCount:C,onEdit:k,onAdd:O,onDelete:S,canDragOnto:x,collapseFilter:A,collapseAnimationTime:T,onMove:P,enableClipboard:R,searchFilter:V,searchText:F,indent:M,keySort:K,showArrayIndices:_,defaultValue:I,translate:L,customNodeDefinitions:B,jsonParse:W,jsonStringify:G,keyboardControls:U,handleKeyboard:H,insertAtTop:Y}=r,[$,Q]=a(G(j)),q=A(D),{contentRef:ae,isAnimating:ie,maxHeight:le,collapsed:ce,animateCollapse:de}=((e,t,n)=>{const[r,o]=a(n?0:void 0),[i,l]=a(n),s=c(!1),d=c(null),u=c(0),p=c();return{contentRef:d,isAnimating:s.current,animateCollapse:n=>{var r,a;if(i!==n){switch(window.clearTimeout(p.current),s.current=!0,n){case!0:{const e=null!==(a=null===(r=d.current)||void 0===r?void 0:r.offsetHeight)&&void 0!==a?a:0;u.current=e,o(e),setTimeout((()=>{o(0)}),5);break}case!1:o(u.current||re(e,d))}l(!i),p.current=window.setTimeout((()=>{s.current=!1,n||o(void 0)}),t)}},maxHeight:r,collapsed:i}})(j,T,q),{pathString:ue,nodeData:pe,path:ge,name:me,size:he,canEdit:ye,canDelete:be,canAdd:fe,canDrag:ve,error:je,setError:Ee,onError:De,handleEditKey:we,derivedValues:Ce}=te({props:r,collapsed:ce}),{dragSourceProps:ke,getDropTargetProps:Oe,BottomDropTarget:Se,DropTargetPadding:Ne}=ne({canDrag:ve,canDragOnto:x,path:ge,nodeData:pe,onMove:P,onError:De,translate:L}),xe=c(!q);i((()=>{Q(G(j))}),[j]),i((()=>{const e=A(pe)&&!Ce.isEditing;xe.current=!e,de(e)}),[A]),i((()=>{null!==s&&y(ge)&&(xe.current=!0,de(s.collapsed))}),[s]);const Ae=l((()=>(e,t)=>"function"!=typeof I?I:I(e,t)),[I]),{CustomNode:Te,customNodeProps:Pe,CustomWrapper:Re,wrapperProps:Ve={},hideKey:ze,showEditTools:Fe=!0,showOnEdit:Me,showOnView:Ke,showCollectionWrapper:_e=!0}=l((()=>ee(B,pe)),[]);if(!h("collection",pe,V,F)&&pe.level>0)return null;const Ie=Array.isArray(j)?"array":"object",Le="array"===Ie?{open:"[",close:"]"}:{open:"{",close:"}"},Be=e=>H(e,{objectConfirm:Ge,cancel:He}),We=e=>{const t=E(e);if(t&&U.collapseModifier.includes(t))return xe.current=!0,void d({collapsed:!ce,path:ge});b&&b.includes(ue)||(xe.current=!0,d(null),de(!ce))},Ge=()=>{try{const e=W($);if(f(null),Ee(null),JSON.stringify(e)===JSON.stringify(j))return;k(e,ge).then((t=>{t&&De({code:"UPDATE_ERROR",message:t},e)}))}catch(e){De({code:"INVALID_JSON",message:L("ERROR_INVALID_JSON",pe)},$)}},Ue=ge.length>0?()=>{S(j,ge).then((e=>{e&&De({code:"DELETE_ERROR",message:e},u(j,ge))}))}:void 0,He=()=>{f(null),Ee(null),Q(G(j))},{isEditing:Ye,isEditingKey:$e,isArray:Je,canEditKey:Xe}=Ce,Ze="when-closed"===C?ce:C,Qe=!Ye&&Fe,qe=(_||!Je)&&!ze&&void 0!==me,et=Te&&(Ye&&Me||!Ye&&Ke),tt=K&&"object"===Ie,nt=Object.entries(j).map((([e,t])=>["array"===Ie?Number(e):e,t]));tt&&nt.sort("function"==typeof K?(e,t)=>K(e[0],t[0]):void 0);const rt=xe.current?Ye?t("div",{className:"jer-collection-text-edit",children:e("div",{children:[t(g,{className:"jer-collection-text-area",name:ue,value:$,setValue:Q,isEditing:Ye,handleKeyPress:Be,styles:o("input",pe)}),t("div",{className:"jer-collection-input-button-row",children:t(Z,{onOk:Ge,onCancel:He,nodeData:pe})})]})}):nt.map((([e,n],a)=>{const i={key:e,value:n,path:[...ge,e],level:ge.length+1,index:a,size:m(n)?Object.keys(n).length:1,parentData:j,fullData:pe.fullData};return t("div",{className:"jer-collection-element",style:o("collectionElement",i),children:m(n)?t(se,Object.assign({},r,{data:n,parentData:j,nodeData:i,showCollectionCount:C,canDragOnto:ye}),e):t(oe,Object.assign({},r,{data:n,parentData:j,nodeData:i,canDragOnto:ye,showLabel:"object"===Ie||_}),e)},e)})):null,ot=!!_e&&ce;ot||(xe.current=!0);const at=Object.assign(Object.assign({},r),{data:j,value:j,parentData:w,nodeData:pe,setValue:e=>p(void 0,void 0,void 0,(function*(){return yield k(e,ge)})),handleEdit:Ge,handleCancel:He,handleKeyPress:Be,isEditing:Ye,setIsEditing:()=>f(ue),getStyles:o,canDragOnto:ye}),it=et?t(Te,Object.assign({customNodeProps:Pe},at,{children:rt})):rt,lt=$e?t("input",{className:"jer-input-text jer-key-edit",type:"text",name:ue,defaultValue:me,autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>H(e,{stringConfirm:()=>we(e.target.value),cancel:He}),style:{width:String(me).length/1.5+.5+"em"}}):qe&&t("span",{className:"jer-key-text",style:o("property",pe),onClick:e=>e.stopPropagation(),onDoubleClick:()=>Xe&&f(`key_${ue}`),children:""===me?t("span",{className:ge.length>0?"jer-empty-string":void 0}):`${me}:`}),st=Qe&&t(X,{startEdit:ye?()=>{xe.current=!0,f(ue)}:void 0,handleAdd:fe?e=>{de(!1);const t=Ae(pe,e);if("array"===Ie){const e=Y.array?0:j.length,n=Y.array?{insert:!0}:{};O(t,[...ge,e],n).then((e=>{e&&De({code:"ADD_ERROR",message:e},t)}))}else if(e in j)De({code:"KEY_EXISTS",message:L("ERROR_KEY_EXISTS",pe)},e);else{const n=Y.object?{insertBefore:0}:{};O(t,[...ge,e],n).then((e=>{e&&De({code:"ADD_ERROR",message:e},t)}))}}:void 0,handleDelete:be?Ue:void 0,enableClipboard:R,type:Ie,nodeData:pe,translate:L,customButtons:r.customButtons,keyboardControls:U,handleKeyboard:H}),ct=e("div",Object.assign({className:"jer-component jer-collection-component",style:Object.assign(Object.assign({marginLeft:(0===ge.length?0:M/2)+"em"},o("collection",pe)),{position:"relative"}),draggable:ve},ke,Oe("above"),{children:[t("div",{className:"jer-clickzone",style:{width:M/2+1+"em",zIndex:10+2*pe.level},onClick:e=>We(e)}),!Ye&&Se,t(Ne,{position:"above",nodeData:pe}),_e?e("div",{className:"jer-collection-header-row",style:{position:"relative"},onClick:e=>We(e),children:[e("div",{className:"jer-collection-name",children:[t("div",{className:"jer-collapse-icon jer-accordion-icon"+(ce?" jer-rotate-90":""),style:{zIndex:11+2*pe.level},onClick:e=>We(e),children:t(J,{name:"chevron",rotate:ce,nodeData:pe})}),lt,!Ye&&t("span",{className:"jer-brackets jer-bracket-open",style:o("bracket",pe),children:Le.open})]}),!Ye&&Ze&&t("div",{className:"jer-collection-item-count"+(Ze?" jer-visible":" jer-hidden"),style:o("itemCount",pe),children:1===he?L("ITEM_SINGLE",Object.assign(Object.assign({},pe),{size:1}),1):L("ITEMS_MULTIPLE",pe,he)}),t("div",{className:"jer-brackets"+(ot?" jer-visible":" jer-hidden"),style:o("bracket",pe),children:Le.close}),st]}):ze?t(n,{}):e("div",{className:"jer-collection-header-row",style:{position:"relative"},children:[lt,st]}),e("div",{className:"jer-collection-inner",style:Object.assign({overflowY:ot||ie?"clip":"visible",maxHeight:v(ue)?void 0:le},o("collectionInner",pe)),ref:ae,children:[it,t("div",{className:Ye?"jer-collection-error-row":"jer-collection-error-row-edit",children:je&&t("span",{className:"jer-error-slug",style:o("error",pe),children:je})}),!Ye&&_e&&t("div",{className:"jer-brackets jer-bracket-outside",style:Object.assign(Object.assign({},o("bracket",pe)),{marginLeft:(M<3?-1:M<6?-.5:0)+"em"}),children:Le.close})]}),t(Ne,{position:"below",nodeData:pe})]}));return Re?t(Re,Object.assign({customNodeProps:Ve},at,{children:ct})):ct},ce={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"},de=(e,t)=>(n,r,o)=>((e,t,n,r,o)=>{if(t[r]){const e=t[r](n);if(null!==e)return e}const a=r in e?e[r]:ce[r];return void 0===o?a:null==a?void 0:a.replace("{{count}}",String(o))})(e,t,r,n,o);var ue=[],pe=[];!function(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",o=!0===t.singleTag,a="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(o){var i=ue.indexOf(a);-1===i&&(i=ue.push(a)-1,pe[i]={}),n=pe[i]&&pe[i][r]?pe[i][r]:pe[i][r]=l()}else n=l();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function l(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),o=0;o<n.length;o++)e.setAttribute(n[o],t.attributes[n[o]]);var i="prepend"===r?"afterbegin":"beforeend";return a.insertAdjacentElement(i,e),e}}(':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}.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 ge=({data:e,setData:n,rootName:r="root",onUpdate:o=(()=>{}),onEdit:c=o,onDelete:d=o,onAdd:u=o,onChange:g,onError:h,showErrorMessages:y=!0,enableClipboard:b=!0,indent:f=2,collapse:v=!1,collapseAnimationTime:j=300,showCollectionCount:E=!0,restrictEdit:w=!1,restrictDelete:k=!1,restrictAdd:O=!1,restrictTypeSelection:S=!1,restrictDrag:x=!0,searchFilter:A,searchText:T,searchDebounceTime:P=350,keySort:R=!1,showArrayIndices:V=!0,showStringQuotes:z=!0,defaultValue:F=null,minWidth:M=250,maxWidth:K="min(600px, 90vw)",rootFontSize:_,stringTruncate:I=250,translations:L={},className:B,id:W,customText:G={},customNodeDefinitions:U=[],customButtons:H=[],jsonParse:Y=JSON.parse,jsonStringify:$=(e=>JSON.stringify(e,null,2)),errorMessageTimeout:J=2500,keyboardControls:X={},insertAtTop:Z=!1})=>{const{getStyles:Q}=N(),q=s(ye(v),[v]),ee=s(de(L,G),[L,G]),[te,ne]=a(T),[re,ae]=(({setData:e,data:t})=>{const[n,r]=a(e?void 0:t),o=s((t=>{e?e(t):r(t)}),[e]);return i((()=>{e||r(t)}),[t]),[e?t:n,o]})({setData:n,data:e}),ie=document.querySelector(":root"),le=getComputedStyle(document.documentElement).getPropertyValue("--jer-expand-transition-time");1e3*parseFloat(le)!==j&&(null==ie||ie.style.setProperty("--jer-expand-transition-time",j/1e3+"s")),i((()=>{const e=setTimeout((()=>ne(T)),P);return()=>clearTimeout(e)}),[T,P]);const ce={key:r,path:[],level:0,index:0,value:re,size:"object"==typeof re&&null!==re?Object.keys(re).length:1,parentData:null,fullData:re},ue=(e,t)=>p(void 0,void 0,void 0,(function*(){const n=yield e(t);if(!0===n||void 0===n)return void ae(t.newData);const r=fe(n)?n:["error",n],[o,a]=r;if("error"===o)return ae(t.currentData),!1===a?ee("ERROR_UPDATE",ce):String(a);ae(a)})),pe=l((()=>ye(w)),[w]),ge=l((()=>ye(k)),[k]),me=l((()=>ye(O)),[O]),ve=l((()=>ye(x)),[x]),je=l((()=>be(A)),[A]),Ee=l((()=>(e=>{const t=Object.assign({},C);for(const n of Object.keys(C)){const r=n;if(e[r]){const o=e[r],a=["clipboardModifier","collapseModifier"].includes(n)?Array.isArray(o)?o:[o]:"string"==typeof o?{key:o}:o;t[r]=a,["stringConfirm","numberConfirm","booleanConfirm"].forEach((n=>{!e[n]&&e.confirm&&(t[n]=t.confirm)}))}}return t})(X)),[X]),De=s(((e,t)=>((e,t,n)=>{const r=Object.entries(t);for(const[t,o]of r)if(D(n,e[t],t)){n.preventDefault(),o();break}})(Ee,t,e)),[X]),we={name:r,nodeData:ce,onEdit:(e,t)=>p(void 0,void 0,void 0,(function*(){const{currentData:n,newData:r,currentValue:o,newValue:a}=he(re,t,e,"update");if(o!==a)return yield ue(c,{currentData:n,newData:r,currentValue:o,newValue:a,name:t.slice(-1)[0],path:t})})),onDelete:(e,t)=>p(void 0,void 0,void 0,(function*(){const{currentData:n,newData:r,currentValue:o,newValue:a}=he(re,t,e,"delete");return yield ue(d,{currentData:n,newData:r,currentValue:o,newValue:a,name:t.slice(-1)[0],path:t})})),onAdd:(e,t,n)=>p(void 0,void 0,void 0,(function*(){const{currentData:r,newData:o,currentValue:a,newValue:i}=he(re,t,e,"add",n);return yield ue(u,{currentData:r,newData:o,currentValue:a,newValue:i,name:t.slice(-1)[0],path:t})})),onChange:g,onError:h,showErrorMessages:y,onMove:(e,t,n)=>p(void 0,void 0,void 0,(function*(){if(null===e)return;const{currentData:r,newData:o,currentValue:a}=he(re,e,"","delete"),i=e.slice(-1)[0],l=t.slice(0,-1),s=t.slice(-1)[0];let d="number"==typeof s?"above"===n?s:s+1:"number"==typeof i?`arr_${i}`:i;e.slice(0,-1).join(".")===t.slice(0,-1).join(".")&&"number"==typeof i&&"number"==typeof d&&i<d&&(d-=1);const u="number"==typeof d?{insert:!0}:"above"===n?{insertBefore:s}:{insertAfter:s},{newData:p,newValue:g}=he(o,[...l,d],a,"add",u);return yield ue(c,{currentData:r,newData:p,currentValue:a,newValue:g,name:t.slice(-1)[0],path:t})})),showCollectionCount:E,collapseFilter:q,collapseAnimationTime:j,restrictEditFilter:pe,restrictDeleteFilter:ge,restrictAddFilter:me,restrictTypeSelection:S,restrictDragFilter:ve,canDragOnto:!1,searchFilter:je,searchText:te,enableClipboard:b,keySort:R,showArrayIndices:V,showStringQuotes:z,indent:f,defaultValue:F,stringTruncate:I,translate:ee,customNodeDefinitions:U,customButtons:H,parentData:null,jsonParse:Y,jsonStringify:$,errorMessageTimeout:J,handleKeyboard:De,keyboardControls:Ee,insertAtTop:{object:!0===Z||"object"===Z,array:!0===Z||"array"===Z}},Ce=Object.assign(Object.assign({},Q("container",ce)),{minWidth:M,maxWidth:K});return Ce.fontSize=null!=_?_:Ce.fontSize,t("div",{id:W,className:`jer-editor-container ${null!=B?B:""}`,style:Ce,children:m(re)?t(se,Object.assign({data:re},we)):t(oe,Object.assign({data:re,showLabel:!0},we))})},me=e=>{var n;return t(S,{theme:null!==(n=e.theme)&&void 0!==n?n:k,icons:e.icons,children:t(V,{children:t(ge,Object.assign({},e))})})},he=(e,t,n,r,o={})=>{if(0===t.length)return{currentData:e,newData:n,currentValue:e,newValue:n};const a=Object.assign({remove:"delete"===r},o),i="add"!==r?u(e,t):void 0;return{currentData:e,newData:d(e,t,n,a),currentValue:i,newValue:"delete"!==r?n:void 0}},ye=e=>"boolean"==typeof e?()=>e:"number"==typeof e?({level:t})=>t>=e:e,be=e=>{if(void 0!==e)return"value"===e?b:"key"===e?f:"all"===e?(e,t)=>b(e,t)||f(e,t):e},fe=e=>Array.isArray(e)&&2===e.length&&["error","value"].includes(e[0]),ve=({value:n,setIsEditing:r,getStyles:o,customNodeProps:a,nodeData:i})=>{var l,s;const c=null!==(l=null==a?void 0:a.stringTruncate)&&void 0!==l?l:100,d=o("string",i);return t("div",{onDoubleClick:()=>r(!0),onClick:e=>{(e.getModifierState("Control")||e.getModifierState("Meta"))&&r(!0)},className:"jer-value-string jer-hyperlink",style:d,children:e("a",{href:n,target:"_blank",rel:"noreferrer",style:{color:null!==(s=d.color)&&void 0!==s?s:void 0},children:['"',v(n,c),'"']})})},je={condition:({value:e})=>"string"==typeof e&&/^https?:\/\/.+\..+$/.test(e),element:ve,showOnView:!0,showOnEdit:!1},Ee={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)"}},De={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"}},we={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"}},Ce={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"}},ke={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"}],input:{border:"1px solid rgb(115, 194, 198)"},iconCollection:"#1D3557",iconEdit:"#457B9D",iconDelete:"#E63946",iconAdd:"#2B2D42",iconCopy:"#1D3557",iconCancel:"#E63946"}},Oe={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"}};export{B as IconAdd,Y as IconCancel,$ as IconChevron,U as IconCopy,G as IconDelete,W as IconEdit,H as IconOk,me as JsonEditor,ve as LinkCustomComponent,je as LinkCustomNodeDefinition,ke as candyWrapperTheme,k as defaultTheme,Ee as githubDarkTheme,De as githubLightTheme,m as isCollection,b as matchNode,f as matchNodeKey,we as monoDarkTheme,Ce as monoLightTheme,Oe as psychedelicTheme,v as truncate};
{
"name": "json-edit-react",
"version": "1.19.0-beta1",
"version": "1.19.0",
"description": "React component for editing or viewing JSON/object data",

@@ -23,2 +23,3 @@ "main": "build/index.cjs.js",

"license": "MIT",
"homepage": "https://carlosnz.github.io/json-edit-react",
"scripts": {

@@ -48,2 +49,3 @@ "setup": "yarn install && cd demo && yarn install",

"devDependencies": {
"@rollup/plugin-node-resolve": "^16.0.0",
"@rollup/plugin-terser": "^0.4.4",

@@ -50,0 +52,0 @@ "@rollup/plugin-typescript": "^11.1.6",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc