@vertesia/ui 0.81.0 → 0.81.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/lib/esm/core/components/shadcn/dialog.js +7 -3
  2. package/lib/esm/core/components/shadcn/dialog.js.map +1 -1
  3. package/lib/esm/core/components/shadcn/popover.js +3 -1
  4. package/lib/esm/core/components/shadcn/popover.js.map +1 -1
  5. package/lib/esm/core/components/shadcn/selectBox.js +1 -1
  6. package/lib/esm/core/components/shadcn/selectBox.js.map +1 -1
  7. package/lib/esm/core/components/shadcn/tooltip.js +5 -1
  8. package/lib/esm/core/components/shadcn/tooltip.js.map +1 -1
  9. package/lib/esm/features/agent/PayloadBuilder.js +22 -0
  10. package/lib/esm/features/agent/PayloadBuilder.js.map +1 -1
  11. package/lib/esm/features/agent/chat/ModernAgentConversation.js +6 -62
  12. package/lib/esm/features/agent/chat/ModernAgentConversation.js.map +1 -1
  13. package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js +1 -1
  14. package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
  15. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js +1 -1
  16. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -1
  17. package/lib/esm/features/facets/AgentRunnerFacetsNav.js +86 -0
  18. package/lib/esm/features/facets/AgentRunnerFacetsNav.js.map +1 -0
  19. package/lib/esm/features/facets/index.js +1 -0
  20. package/lib/esm/features/facets/index.js.map +1 -1
  21. package/lib/esm/features/store/collections/CreateCollection.js +1 -1
  22. package/lib/esm/features/store/collections/CreateCollection.js.map +1 -1
  23. package/lib/esm/features/store/collections/EditCollectionView.js +4 -6
  24. package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -1
  25. package/lib/esm/features/store/objects/components/PropertiesEditorModal.js +25 -39
  26. package/lib/esm/features/store/objects/components/PropertiesEditorModal.js.map +1 -1
  27. package/lib/esm/features/store/objects/components/useContentPanelHooks.js +3 -3
  28. package/lib/esm/features/store/objects/components/useContentPanelHooks.js.map +1 -1
  29. package/lib/esm/features/store/types/ObjectSchemaEditor.js +4 -6
  30. package/lib/esm/features/store/types/ObjectSchemaEditor.js.map +1 -1
  31. package/lib/esm/features/store/types/TableLayoutEditor.js +4 -6
  32. package/lib/esm/features/store/types/TableLayoutEditor.js.map +1 -1
  33. package/lib/esm/widgets/index.js +1 -1
  34. package/lib/esm/widgets/index.js.map +1 -1
  35. package/lib/esm/widgets/json-view/JSONCode.js +16 -151
  36. package/lib/esm/widgets/json-view/JSONCode.js.map +1 -1
  37. package/lib/esm/widgets/{codemirror → monacoEditor}/MonacoEditor.js +18 -6
  38. package/lib/esm/widgets/monacoEditor/MonacoEditor.js.map +1 -0
  39. package/lib/esm/widgets/monacoEditor/index.js +2 -0
  40. package/lib/esm/widgets/monacoEditor/index.js.map +1 -0
  41. package/lib/tsconfig.tsbuildinfo +1 -1
  42. package/lib/types/core/components/shadcn/dialog.d.ts.map +1 -1
  43. package/lib/types/core/components/shadcn/popover.d.ts.map +1 -1
  44. package/lib/types/core/components/shadcn/tooltip.d.ts.map +1 -1
  45. package/lib/types/features/agent/PayloadBuilder.d.ts +1 -0
  46. package/lib/types/features/agent/PayloadBuilder.d.ts.map +1 -1
  47. package/lib/types/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
  48. package/lib/types/features/facets/AgentRunnerFacetsNav.d.ts +14 -0
  49. package/lib/types/features/facets/AgentRunnerFacetsNav.d.ts.map +1 -0
  50. package/lib/types/features/facets/index.d.ts +1 -0
  51. package/lib/types/features/facets/index.d.ts.map +1 -1
  52. package/lib/types/features/store/collections/EditCollectionView.d.ts.map +1 -1
  53. package/lib/types/features/store/objects/components/PropertiesEditorModal.d.ts.map +1 -1
  54. package/lib/types/features/store/objects/components/useContentPanelHooks.d.ts.map +1 -1
  55. package/lib/types/features/store/types/ObjectSchemaEditor.d.ts.map +1 -1
  56. package/lib/types/features/store/types/TableLayoutEditor.d.ts.map +1 -1
  57. package/lib/types/widgets/index.d.ts +1 -1
  58. package/lib/types/widgets/index.d.ts.map +1 -1
  59. package/lib/types/widgets/json-view/JSONCode.d.ts +2 -19
  60. package/lib/types/widgets/json-view/JSONCode.d.ts.map +1 -1
  61. package/lib/types/widgets/{codemirror → monacoEditor}/MonacoEditor.d.ts +6 -3
  62. package/lib/types/widgets/monacoEditor/MonacoEditor.d.ts.map +1 -0
  63. package/lib/types/widgets/monacoEditor/index.d.ts +3 -0
  64. package/lib/types/widgets/monacoEditor/index.d.ts.map +1 -0
  65. package/lib/vertesia-ui-core.js +1 -1
  66. package/lib/vertesia-ui-core.js.map +1 -1
  67. package/lib/vertesia-ui-features.js +1 -1
  68. package/lib/vertesia-ui-features.js.map +1 -1
  69. package/lib/vertesia-ui-widgets.js +1 -1
  70. package/lib/vertesia-ui-widgets.js.map +1 -1
  71. package/package.json +6 -10
  72. package/src/core/components/shadcn/calendar.tsx +2 -2
  73. package/src/core/components/shadcn/dialog.tsx +23 -19
  74. package/src/core/components/shadcn/filters/index.ts +1 -1
  75. package/src/core/components/shadcn/popover.tsx +3 -1
  76. package/src/core/components/shadcn/selectBox.tsx +2 -2
  77. package/src/core/components/shadcn/tooltip.tsx +20 -16
  78. package/src/features/agent/PayloadBuilder.tsx +28 -0
  79. package/src/features/agent/chat/ModernAgentConversation.tsx +6 -104
  80. package/src/features/agent/chat/ModernAgentOutput/Header.tsx +1 -1
  81. package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +1 -1
  82. package/src/features/facets/AgentRunnerFacetsNav.tsx +125 -0
  83. package/src/features/facets/index.ts +1 -0
  84. package/src/features/store/collections/CreateCollection.tsx +1 -1
  85. package/src/features/store/collections/EditCollectionView.tsx +10 -8
  86. package/src/features/store/objects/components/PropertiesEditorModal.tsx +36 -51
  87. package/src/features/store/objects/components/useContentPanelHooks.ts +3 -3
  88. package/src/features/store/types/ObjectSchemaEditor.tsx +9 -7
  89. package/src/features/store/types/TableLayoutEditor.tsx +9 -7
  90. package/src/session/auth/auth-flow.md +1094 -0
  91. package/src/widgets/index.ts +1 -1
  92. package/src/widgets/json-view/JSONCode.tsx +30 -172
  93. package/src/widgets/{codemirror → monacoEditor}/MonacoEditor.tsx +30 -10
  94. package/src/widgets/monacoEditor/index.ts +3 -0
  95. package/lib/esm/widgets/codemirror/CodeMirrorEditor.js +0 -103
  96. package/lib/esm/widgets/codemirror/CodeMirrorEditor.js.map +0 -1
  97. package/lib/esm/widgets/codemirror/CodemirrorStateSingleton.js +0 -33
  98. package/lib/esm/widgets/codemirror/CodemirrorStateSingleton.js.map +0 -1
  99. package/lib/esm/widgets/codemirror/MonacoEditor.js.map +0 -1
  100. package/lib/esm/widgets/codemirror/index.js +0 -3
  101. package/lib/esm/widgets/codemirror/index.js.map +0 -1
  102. package/lib/types/widgets/codemirror/CodeMirrorEditor.d.ts +0 -24
  103. package/lib/types/widgets/codemirror/CodeMirrorEditor.d.ts.map +0 -1
  104. package/lib/types/widgets/codemirror/CodemirrorStateSingleton.d.ts +0 -15
  105. package/lib/types/widgets/codemirror/CodemirrorStateSingleton.d.ts.map +0 -1
  106. package/lib/types/widgets/codemirror/MonacoEditor.d.ts.map +0 -1
  107. package/lib/types/widgets/codemirror/index.d.ts +0 -5
  108. package/lib/types/widgets/codemirror/index.d.ts.map +0 -1
  109. package/src/widgets/codemirror/CodeMirrorEditor.tsx +0 -122
  110. package/src/widgets/codemirror/CodemirrorStateSingleton.tsx +0 -39
  111. package/src/widgets/codemirror/index.ts +0 -6
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import n from"debounce";import i,{useRef as s,useEffect as a,useMemo as o,useState as l,useCallback as c,createContext as d,useContext as h,memo as u,Component as p,Children as m,isValidElement as f}from"react";import{EditorView as g}from"@codemirror/view";import{useSafeLayoutEffect as y,useTheme as b,Styles as v,FormItem as x,Button as k,DotBadge as w,Table as N,VTooltip as C,VSelectBox as S,VModal as j,VModalTitle as A,ModalBody as O,ModalFooter as P,useFlag as $,useClickOutside as E,useToast as I}from"@vertesia/ui/core";import{Text as T,EditorState as F}from"@codemirror/state";import{Editor as M}from"@monaco-editor/react";import V from"clsx";import{Plus as D,Trash2 as L,Check as q,Copy as R,Download as K,Info as z,AlignLeft as _,SquarePen as U,ChevronDown as W,ChevronRight as B,UploadIcon as H,CheckCircleIcon as G,AlertCircleIcon as Z,XCircleIcon as J}from"lucide-react";import X from"ajv";import{ObjectWalker as Y}from"@vertesia/json";import Q,{defaultUrlTransform as ee}from"react-markdown";import te from"remark-gfm";import{visit as re,SKIP as ne}from"unist-util-visit";import{toPng as ie}from"html-to-image";import{XAxis as se,YAxis as ae,CartesianGrid as oe,Tooltip as le,Legend as ce,ReferenceLine as de,ResponsiveContainer as he,ComposedChart as ue,AreaChart as pe,LineChart as me,BarChart as fe,Line as ge,Area as ye,Bar as be,PieChart as ve,Pie as xe,Cell as ke,ScatterChart as we,Scatter as Ne,RadarChart as Ce,PolarGrid as Se,PolarAngleAxis as je,PolarRadiusAxis as Ae,Radar as Oe,RadialBarChart as Pe,RadialBar as $e,FunnelChart as Ee,Funnel as Ie,LabelList as Te,Treemap as Fe}from"recharts";import{useUserSession as Me}from"@vertesia/ui/session";import{offset as Ve,shift as De,flip as Le}from"@floating-ui/dom";import{useFloating as qe,autoUpdate as Re,useDismiss as Ke,useClick as ze,useHover as _e,useInteractions as Ue,useTransitionStyles as We,FloatingPortal as Be,FloatingFocusManager as He,safePolygon as Ge}from"@floating-ui/react";import{XMLParser as Ze,XMLValidator as Je}from"fast-xml-parser";import{isNil as Xe,omit as Ye}from"lodash-es";let Qe=null;class et{editor;constructor(e){this.editor=e}setValue(e){this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,insert:e||""}})}getValue(){return this.editor.state.doc.toString()}}const tt=[g.theme({"&":{fontSize:"14px",fontFamily:"monospace"},".cm-content":{fontFamily:"inherit"},".cm-scroller":{fontFamily:"inherit"},".cm-gutters":{backgroundColor:"transparent",color:"#ddd"},".cm-focused":{outline:"none"},".cm-cursor":{borderLeft:"2px solid #808080",borderLeftColor:"#808080",animation:"blink 1.2s step-start infinite"},"@keyframes blink":{"50%":{opacity:0}}}),g.lineWrapping];function rt({onChange:t,value:r,className:i,editorRef:l,extensions:c,debounceTimeout:d=0}){const h=s(null),u=s(void 0);a(()=>{if(t)return u.current=d>0?n(t,d):t,()=>{u.current=void 0}},[t,d]);const p=o(()=>e("div",{ref:h,className:i}),[i]);return y(()=>{if(h.current){let t=[...tt,(e=e=>{u.current?.(e)},g.updateListener.of(t=>{t.docChanged&&e(t)}))];Array.isArray(c)?t=t.concat(c):c&&t.push(c);const n=((e="",t=[])=>{const r="string"==typeof e?T.of(e.split("\n")):e;return Qe?Qe.doc.toString()!==r.toString()&&(Qe=F.create({doc:r,extensions:t})):Qe=F.create({doc:r,extensions:t}),Qe})(r,t),i=new g({state:n,parent:h.current}),s=new et(i);return l&&(l.current=s),()=>{i.destroy(),l&&(l.current=void 0)}}var e},[p,c]),p}class nt{VgetValue;VsetValue;constructor(e,t){this.VgetValue=e,this.VsetValue=t}getValue(){return this.VgetValue()}setValue(e){this.VsetValue(e||"")}}function it({onChange:t,value:r="",className:i,editorRef:d,language:h="javascript",debounceTimeout:u=0,options:p={},beforeMount:m,onMount:f,defaultValue:g}){const[y,v]=l(r),x=s(null),{theme:k}=b(),w=s(()=>y),N=s(e=>{v(e),x.current&&x.current.setValue(e)});a(()=>{w.current=()=>y},[y]),a(()=>(d&&(d.current=new nt(()=>w.current(),e=>N.current(e))),()=>{d&&(d.current=void 0)}),[d]);const C=o(()=>{if(t)return u>0?n(e=>t(e),u):t},[t,u]),S=c(e=>{const t=e||"";if(v(t),C){const e={docChanged:!0,state:{doc:{toString:()=>t,length:t.length}}};C(e)}},[C]),j=c((e,t)=>{x.current=e,N.current=t=>{v(t),e.setValue(t)},t.editor.defineTheme("errorLineTheme",{base:"dark"===k?"vs-dark":"vs",inherit:!0,rules:[],colors:{"editorError.background":"#ffebee","editorError.border":"#f44336"}}),t.editor.setTheme("errorLineTheme"),f?.(e)},[h,f,k]);a(()=>{r!==y&&(v(r),x.current&&x.current.setValue(r))},[r]);const A={fontSize:14,fontFamily:"monospace",minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:"on",lineNumbers:"on",folding:!1,lineDecorationsWidth:0,lineNumbersMinChars:3,automaticLayout:!0,glyphMargin:!0,renderValidationDecorations:"on",renderLineHighlight:"line",hover:{enabled:!0,delay:100},quickSuggestions:{other:!0,comments:!0,strings:!0},...p};return e("div",{className:i,children:e(M,{height:"100%",theme:"dark"===k?"vs-dark":"light",language:h,value:y,onChange:S,onMount:j,beforeMount:m,options:A,defaultValue:g||""})})}const st=d(void 0),at=st.Provider;function ot(){const e=h(st);if(!e)throw new Error("useFieldSet must be used within a Form or FieldSet element");return e}class lt{object;components;disabled;constructor(e,t={},r=!1){this.object=e,this.components=t,this.disabled=r}}const ct=d(void 0);function dt(){const e=h(ct);if(!e)throw new Error("useForm must be used within a Form element");return e}const ht=ct.Provider,ut=i.forwardRef(({object:t,type:r="text",onChange:n,...i},s)=>{const[a,o]=l(null!=t.value?String(t.value):""),[c,d]=l(t.schema.isBoolean&&!0===t.value);i.className?i.className=V(v.INPUT,i.className):i.className=v.INPUT;const h=e=>{i.disabled||(o(e.target.value),t.schema.isBoolean?(t.value=e.target.checked,d(t.value)):t.value=e.target.value,n&&n(e))};return"textarea"===r?e("textarea",{ref:s,...i,value:a,onChange:h}):e("input","checkbox"===r?{ref:s,...i,type:"checkbox",checked:c,onChange:h,className:"form-check-input"}:{ref:s,...i,type:r,value:a,onChange:h})});function pt({object:t,components:r,onSubmit:n,children:i,onChange:s,disabled:a}){return t.observer=s,e(ht,{value:new lt(t,r||{},a??!1),children:e("form",{className:"w-full",onSubmit:e=>{e.stopPropagation(),e.preventDefault(),n&&n(t.value)},children:i})})}function mt(){const t=dt();return e("div",{className:"flex flex-col gap-4 w-full",children:t.object.properties.map(gt)})}function ft({children:r,...n}){return t(pt,{...n,children:[e(mt,{}),r]})}function gt(t){return t.isList?e(vt,{object:t},t.name):t.isObject?e(bt,{object:t},t.name):e(yt,{object:t},t.name)}function yt({object:t,editor:r,inline:n=!1}){r||(r=t.schema.editor);const{components:i,disabled:s}=dt(),a=r&&i[r]||ut,o=t.getInputType();"checkbox"===o&&(n=!0);const l=e=>{s||(t.schema.isBoolean?t.value=e.target.checked:t.schema.isNumber?t.value=parseFloat(e.target.value):t.value=e.target.value)};return t.isListItem?e(a,{object:t,type:o,onChange:l,disabled:s}):e(x,{label:t.title,required:t.schema.isRequired,description:t.schema.description,className:V("flex",n?"flex-row items-center":"flex-col"),children:e(a,{object:t,type:o,onChange:l,disabled:s})})}function bt({object:r}){return t("div",{className:"flex flex-col gap-4 my-4 py-2 pl-4 border-l-4 border-l-solid border-l-slate-100 dark:border-l-slate-600",children:[!r.isListItem&&e("div",{className:"text-gray-900 dark:text-gray-200 font-semibold",children:r.title}),r.properties.map(gt)]})}function vt({object:r}){const[n,i]=l(r.value||[]),{disabled:s}=dt();return t("div",{className:"flex flex-col gap-4 my-4 py-2 pl-4 border-l-4 border-l-solid border-l-slate-100 darK:border-l-slate-600",children:[!r.isListItem&&e("div",{className:"text-gray-900 dark:text-gray-200 font-semibold",children:r.title}),r.items.map((t,a)=>e(xt,{object:t,list:r,onDelete:()=>(e=>{s||(r.remove(e),i([...r.value]))})(a),disabled:s},`${a}-${n[a]??""}`)),e("div",{children:t(k,{variant:"secondary",onClick:()=>{s||(r.add(),i([...r.value]))},disabled:s,children:[e(D,{className:"size-6"})," Add"]})})]})}function xt({list:r,object:n,onDelete:i,disabled:s}){return t("div",{className:"flex gap-2 w-full",children:[e("div",{className:"flex-1",children:(a=n,o=r.schema.arraySchema.editor,a.isList?e(vt,{object:a}):a.isObject?e(bt,{object:a}):e(yt,{object:a,editor:o}))}),e(k,{variant:"secondary",onClick:i,disabled:s,children:e(L,{className:"size-4"})})]});var a,o}class kt{schema;properties={};_validator;constructor(e){this.schema=e||{type:"object",properties:{}},this.load()}get validator(){if(!this._validator){const e=new X({allErrors:!0,strict:!1});this._validator=e.compile(this.schema)}return this._validator}load(){if(this.schema.properties){const e=this.schema.properties;Object.keys(e).forEach(t=>{this.loadProperty(t,e[t])})}}hasProperties(){return Object.keys(this.properties).length>0}get title(){return this.schema.title||this.schema.name}get description(){return this.schema.description}loadProperty(e,t){let r;return r="array"===t.type?new Nt(this,e,t):new wt(this,e,t),this.properties[e]=r,r}get type(){return this.schema.type}validate(e){return this.validator(e)?null:this.validator.errors||[]}addProperty(e,t,r=!1){"object"!==this.schema.type&&(this.schema.type="object"),this.schema.properties||(this.schema.properties={});const n="string"==typeof t?"object"===(i=t)?{type:"object",properties:{}}:"array"===i?{type:"array",items:{}}:{type:i}:t;var i;const s=this.loadProperty(e,n);return this.schema.properties[s.name]=s.schema,r&&(s.isRequired=!0),s}removeProperty(e){this.schema.properties&&(delete this.schema.properties[e],Array.isArray(this.schema.required)&&(this.schema.required=this.schema.required.filter(t=>t!==e))),delete this.properties[e]}getProperty(e){return this.properties[e]}get editor(){return this.schema.editor}}class wt extends kt{parent;name;constructor(e,t,r){if(super(r),this.parent=e,this.name=t,"array"===r.type)throw new Error("Array property must be instantiated using ArrayPropertySchema");"object"!==r.type||r.properties||(r.properties={})}get isMulti(){return!1}get isReadOnly(){return!!this.schema.readOnly}set isReadOnly(e){this.schema.readOnly=e}get defaultValue(){return this.schema.default}set defaultValue(e){this.schema.default=e}get enum(){return this.schema.enum}set enum(e){this.schema.enum=e}get isRequired(){const e=this.parent.schema.required;return!!e&&e.includes(this.name)}set isRequired(e){let t=Array.isArray(this.parent.schema.required)?this.parent.schema.required:[];t=e?t.concat(this.name):t.filter(e=>e!==this.name),this.parent.schema.required=t}get type(){return this.schema.type}set type(e){this.schema.type!==e&&(this.schema.type=e,"object"!==e&&(this.properties={},this.schema.properties=void 0))}remove(){this.parent.removeProperty(this.name)}get isBoolean(){return"boolean"===this.type}get isString(){return"string"===this.type}get isNumber(){return"number"===this.type||"integer"===this.type}get isObject(){return"object"===this.type}}class Nt extends wt{arraySchema;constructor(e,t,r){super(e,t,function(e){if("array"!==e.type)throw new Error("Expecting an array schema");if(e.items){if(Array.isArray(e.items))throw new Error("Tuple arrays are not supported")}else e.items={};return e.items}(r)),this.arraySchema=r}get isMulti(){return!0}}function Ct(e){return(e=e.replace(/_/g," ").replace(/([a-z0-9])&([A-Z])/g,"$1 $2"))[0].toUpperCase()+e.slice(1)}function St(e,t){if(t.editor)return t.editor;if(t.schema.format)return t.schema.format;switch(t.type){case"number":case"integer":return"number";case"boolean":return"checkbox";default:return"text"}}class jt{parent;schema;name;observer;constructor(e,t,r){this.parent=e,this.schema=t,this.name=r}get isRoot(){return!this.parent}get root(){return this.parent?this.parent.root:this}get path(){return this.parent?this.parent.path.concat(this.name):[]}get isScalar(){return!1}get isListItem(){return!1}get isObject(){return!1}get isList(){return!1}get title(){return this.schema.title||Ct(this.name)}onChange(e){this.observer&&!1===this.observer(this)||this.parent&&this.parent.onChange(e)}}class At extends jt{constructor(e,t,r){super(e,t,r)}get isObject(){return!0}getProperty(e){const t=this.schema.properties[e];return t.isMulti?new Et(this,t,this.getOrInitArrayProperty(e)):t.isObject?new Pt(this,t,t.name,this.getOrInitObjectProperty(e)):new $t(this,t)}getOrInitObjectProperty(e){let t=this.value[e];return t||(this.value[e]=t={}),t}getOrInitArrayProperty(e){let t=this.value[e];return t||(this.value[e]=t=[]),t}setPropertyValue(e,t){return this.value[e]!==t&&(this.value[e]=t,!0)}getPropertyValue(e){return this.value[e]}get properties(){const e=[];for(const t of Object.values(this.schema.properties))t.isMulti?e.push(new Et(this,t,this.getOrInitArrayProperty(t.name))):t.isObject?e.push(new Pt(this,t,t.name,this.getOrInitObjectProperty(t.name))):e.push(new $t(this,t));return e}[Symbol.iterator](){return this.properties[Symbol.iterator]()}}class Ot extends At{value;constructor(e,t={}){super(null,e instanceof kt?e:new kt(e),"#root"),this.value=t}}class Pt extends At{value;constructor(e,t,r,n){super(e,t,r),this.value=n}}class $t extends jt{constructor(e,t){super(e,t,t.name),void 0===e.value[this.name]&&void 0!==t.defaultValue&&(e.value[this.name]=t.defaultValue)}get isScalar(){return!0}set value(e){this.parent.setPropertyValue(this.name,e)&&this.onChange(this)}get value(){return this.parent.getPropertyValue(this.name)}getInputType(){return St(this.name,this.schema)}}class Et extends jt{value;items=[];constructor(e,t,r){super(e,t,t.name),this.value=r;for(const e of this.value)this.add()}get isList(){return!0}newItem(e){return this.schema.isObject?new It(this,e):new Tt(this,e)}add(){const e=this.newItem(this.items.length);return this.items.push(e),e}remove(e){const t=this.value;if(e>=0&&e<this.items.length){this.items.splice(e,1);for(let e=0,t=this.items.length;e<t;e++){const t=this.items[e];t.index=e,t.name=String(e)}}Array.isArray(t)&&e>=0&&e<t.length&&(t.splice(e,1),this.onChange(this))}[Symbol.iterator](){return this.items[Symbol.iterator]()}item(e){if(e<0||e>=this.value.length)return;const t=this.value[e];return this.schema.isObject?new Pt(this,this.schema,String(e),t):new Tt(this,e)}trim(){for(;void 0===this.items[this.items.length-1];)this.items.pop()}}class It extends At{index;key;constructor(e,t){super(e,e.schema,String(t)),this.index=t,void 0===e.value[t]&&(e.value[t]={}),this.key=this.name+"@"+Date.now()}get isListItem(){return!0}set value(e){this.parent.value[this.index]=e}get value(){return this.parent.value[this.index]}}class Tt extends jt{index;key;constructor(e,t){super(e,e.schema,String(t)),this.index=t,void 0===e.value[t]&&void 0!==e.schema.defaultValue&&(e.value[t]=e.schema.defaultValue),this.key=this.name+"@"+Date.now()}get isScalar(){return!0}get isListItem(){return!0}set value(e){this.parent.value[this.index]=e}get value(){return this.parent.value[this.index]}getInputType(){return St(this.name,this.schema)}}function Ft({label:t,required:r,children:n}){return e(x,{label:t,required:r,children:n})}function Mt({children:t}){return e("p",{className:"mt-2 text-sm text-gray-500",children:t})}function Vt({children:t}){return e("p",{className:"mt-2 text-sm text-red-600",children:t})}const Dt="text-pink-500 dark:text-pink-400",Lt="text-purple-500 dark:text-purple-400",qt="text-blue-500 dark:text-blue-400",Rt={code:"bg-gray-100 dark:bg-slate-800 whitespace-pre-wrap p-4 rounded-lg font-mono",comma:Dt,assign:Dt,startObject:Dt,endObject:Dt,startArray:Dt,endArray:Dt,boolean:Lt,null:Lt,key:qt,index:qt,string:"text-orange-500 dark:text-orange-400",number:"text-green-500 dark:text-green-400"};class Kt{renderer;parent;key;indent;result=[];constructor(e,t,r,n){this.renderer=e,this.parent=t,this.key=r,this.indent=n}get classMap(){return this.renderer.classMap}writeKey(e){const t=typeof e;"string"===t?(this.result.length>0&&this.result.push(`<span class='${this.classMap.comma}'>,\n</span>`),this.indent&&this.result.push(this.indent),this.result.push(`<span class="${this.classMap.key}">"${e}"</span><span class='${this.classMap.assign}'>: </span>`)):"number"===t&&(this.result.length>0&&this.result.push(`<span class='${this.classMap.comma}'>,\n</span>`),this.indent&&this.result.push(this.indent))}pushValue(e,t){if(this.writeKey(e),null===t)this.result.push(`<span class='${this.classMap.null}'>null</span>`);else if(t instanceof Kt)this.result.push(t.renderStart()+t.renderValue()+t.renderEnd());else{let e;const r=typeof t;"string"===r?(t=(t=`"${t}"`).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=this.classMap.string):"number"===r?e=this.classMap.number:"boolean"===r&&(e=this.classMap.boolean),this.result.push(`<span class='${e}'>${t}</span>`)}}renderValue(){return this.result.join("")}}class zt extends Kt{constructor(e,t,r,n){super(e,t,r,n)}renderStart(){return`<span class='${this.classMap.startObject}'>{\n</span>`}renderEnd(){const e=this.result.length>0?"\n":"";return`<span class='${this.classMap.endObject}'>${e}${this.parent?.indent||""}}</span>`}}class _t extends Kt{constructor(e,t,r,n){super(e,t,r,n)}renderStart(){return`<span class='${this.classMap.startArray}'>[\n</span>`}renderEnd(){const e=this.result.length>0?"\n":"";return`<span class='${this.classMap.endArray}'>${e}${this.parent?.indent||""}]</span>`}}class Ut{classMap;tab;stack=[];block=new zt(this,void 0,"","");constructor(e=Rt,t=" "){this.classMap=e,this.tab=t}onStartObject(e){const t=new zt(this,this.block,e,this.block.indent+this.tab);this.stack.push(this.block),this.block=t}onEndObject(){const e=this.block;this.block=this.stack.pop(),this.block.pushValue(e.key,e)}onStartIteration(e){const t=new _t(this,this.block,e,this.block.indent+this.tab);this.stack.push(this.block),this.block=t}onEndIteration(){const e=this.block;this.block=this.stack.pop(),this.block.pushValue(e.key,e)}onValue(e,t){this.block.pushValue(e,t)}}function Wt({data:t,className:r,classMap:n}){const[i,s]=l();return a(()=>{s(function(t,r,n){const i=new Ut(r);(new Y).walk(t,i);const s=i.block.renderValue();return e("div",{className:n,dangerouslySetInnerHTML:{__html:`<div class='${i.classMap.code}' style='overflow-x: scroll'>${s}</div>`}})}(t,n,r))},[t]),i}function Bt({value:t}){return e("div",{className:"flex flex-col gap-4",children:Object.entries(t).map(([t,r])=>e(Zt,{name:t,value:r},t))})}function Ht({name:t}){return e("div",{className:"text-md font-semibold",children:Ct(t)})}function Gt({children:t,className:r}){return e("div",{className:V("flex flex-col gap-4 py-2 pl-4 border-l-4 border-l-solid border-l-slate-100 dark:border-l-slate-600",r),children:t})}function Zt({name:r,value:n}){const i=Qt(n);switch(i.type){case Yt.Inline:return t("div",{className:"w-full flex gap-2",children:[e(Ht,{name:r+":"}),e("p",{children:i.value})]});case Yt.Paragraph:return t("div",{children:[e(Ht,{name:r}),e("p",{children:i.value})]});case Yt.Prose:return t("div",{className:"prose dark:prose-invert",children:[e(Ht,{name:r}),e("div",{className:"vprose dark:prose-invert",children:i.value})]});case Yt.Array:return e(Jt,{name:r,value:n});case Yt.Object:return t("div",{children:[e(Ht,{name:r}),e(Gt,{className:"mt-2",children:Object.entries(n).map(([t,r])=>e(Zt,{name:t,value:r},t))})]})}}function Jt({name:r,value:n}){const i=n.join(" ").length,s=i/n.length,a="string"==typeof n[0]&&(i<80||i<400&&s<32),o=n.length>9;return t("div",a?{className:"flex gap-2 flex-wrap",children:[r&&e(Ht,{name:r+":"}),n.map((t,r)=>e(w,{children:String(t)},r))]}:{children:[r&&e(Ht,{name:r}),e("div",{className:"flex flex-col gap-2",children:n.map((t,r)=>e(Xt,{index:r,value:t,useBullet:o},r))})]})}function Xt({index:r,value:n,useBullet:i}){const s=i?e("span",{className:"text-xl",children:"•"}):t("span",{children:[r+1,"."]}),a=Qt(n);let o;switch(a.type){case Yt.Object:o=e(Gt,{children:Object.entries(n).map(([t,r])=>e(Zt,{name:t,value:r},t))});break;case Yt.Array:o=e(Jt,{value:n});break;case Yt.Prose:o=e("div",{className:"prose dark:prose-invert",children:a.value});break;default:o=e("div",{children:a.value})}return t("div",{className:"flex gap-4 hover:bg-slate-50 dark:hover:bg-slate-800 py-2 pr-2 pl-4",children:[e("div",{className:"font-semibold text-gray-600 dark:text-gray-400",children:s}),e("div",{children:o})]})}var Yt;function Qt(e){if(null==e)return{value:"-",type:Yt.Inline};if(Array.isArray(e))return{value:e,type:Yt.Array};const t=typeof e;if("string"===t){const t=e.length;let r;return t<80?r=Yt.Inline:t>400?r=Yt.Prose:(r=Yt.Paragraph,e=e.replace(/(?:\n\n)+/g,"\n\n")),{type:r,value:e}}return"number"===t||"boolean"===t?{value:String(e),type:Yt.Inline}:{value:e,type:Yt.Object}}function er({value:t,viewCode:r=!1}){return t?e("div",{className:"relative w-full",children:r?e(Wt,{data:t}):e(Bt,{value:t})}):e("pre",{className:"whitespace-pre-wrap",children:"No Data to display"})}!function(e){e[e.Inline=0]="Inline",e[e.Paragraph=1]="Paragraph",e[e.Prose=2]="Prose",e[e.Array=3]="Array",e[e.Object=4]="Object"}(Yt||(Yt={}));const tr=["#4f46e5","#06b6d4","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6"];class rr extends p{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`Chart rendering error (${this.props.chartType}):`,e,t)}render(){return this.state.hasError?e("div",{className:"flex items-center justify-center h-full bg-red-50 dark:bg-red-950 rounded-md p-4",children:t("div",{className:"text-center",children:[t("p",{className:"text-sm font-medium text-red-600 dark:text-red-400",children:["Cannot render ",this.props.chartType," chart"]}),e("p",{className:"text-xs text-red-500 dark:text-red-500 mt-1 max-w-xs truncate",children:this.state.error?.message||"Unknown error"})]})}):this.props.children}}function nr(e){if(!isFinite(e))return String(e);const t=Math.abs(e);return t>=1e9?(e/1e9).toFixed(1)+"B":t>=1e6?(e/1e6).toFixed(1)+"M":t>=1e3?(e/1e3).toFixed(1)+"K":e.toLocaleString()}const ir=u(function({spec:n}){const{chart:i,title:a,description:o,data:d,xKey:h,series:u,yAxis:p,options:m,nameKey:f,valueKey:g,yKey:y,zKey:b,axisKey:v,dataKey:x}=n,[k,w]=l(!1),[N,C]=l(!1),S=s(null),j=c(async()=>{if(S.current&&!N)try{const e=await ie(S.current,{backgroundColor:"#ffffff",pixelRatio:2}),t=await fetch(e),r=await t.blob();await navigator.clipboard.write([new ClipboardItem({"image/png":r})]),C(!0),setTimeout(()=>C(!1),2e3)}catch(e){console.error("Failed to copy chart:",e)}},[N]),A=c(async()=>{if(S.current&&!k){w(!0);try{const e=await ie(S.current,{backgroundColor:"#ffffff",pixelRatio:2}),t=document.createElement("a");t.download=`${a||"chart"}.png`,t.href=e,t.click()}catch(e){console.error("Failed to export chart:",e)}finally{w(!1)}}},[a,k]),O=u||[],P=d||[],$=t(r,{children:[e(se,{dataKey:h,tick:{fontSize:12}}),e(ae,{yAxisId:"left",tickFormatter:nr,label:p?.left?.label?{value:p.left.label,angle:-90,position:"insideLeft"}:void 0}),O.some(e=>"right"===e.yAxisId)&&e(ae,{yAxisId:"right",orientation:"right",tickFormatter:nr,label:p?.right?.label?{value:p.right.label,angle:-90,position:"insideRight"}:void 0})]}),E=t(r,{children:[e(oe,{strokeDasharray:"3 3"}),e(le,{formatter:e=>"number"==typeof e?nr(e):String(e)}),e(ce,{}),m?.referenceZero&&e(de,{y:0,stroke:"#999",strokeDasharray:"3 3"})]}),I=()=>O.map((t,r)=>{const n=t.color||tr[r%tr.length],s=t.yAxisId||"left";return"line"===i?e(ge,{type:"monotone",dataKey:t.key,name:t.label||t.key,stroke:n,dot:t.dot??!1,yAxisId:s},t.key):"area"===i?e(ye,{type:"monotone",dataKey:t.key,name:t.label||t.key,stroke:n,fill:n,fillOpacity:.3,stackId:m?.stacked?t.stackId||"stack":void 0,yAxisId:s},t.key):"bar"===i||"bar"===t.type?e(be,{dataKey:t.key,name:t.label||t.key,fill:n,stackId:m?.stacked?t.stackId||"stack":void 0,yAxisId:s},t.key):"area"===t.type?e(ye,{type:"monotone",dataKey:t.key,name:t.label||t.key,stroke:n,fill:n,fillOpacity:.3,stackId:m?.stacked?t.stackId||"stack":void 0,yAxisId:s},t.key):e(ge,{type:"monotone",dataKey:t.key,name:t.label||t.key,stroke:n,dot:t.dot??!1,yAxisId:s},t.key)});return e("div",{className:"bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm",children:t("div",{className:"flex flex-col gap-2 p-3",children:[t("div",{className:"flex items-center justify-between",children:[e("span",{className:"font-medium text-sm text-gray-900 dark:text-gray-100",children:a||"Chart"}),t("div",{className:"flex items-center gap-2 print:hidden chart-actions",children:[t("button",{onClick:j,disabled:N,className:"text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50 flex items-center gap-1",title:"Copy to clipboard",children:[e(N?q:R,{className:"w-3 h-3"}),N?"Copied":"Copy"]}),t("button",{onClick:A,disabled:k,className:"text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1",title:"Export as PNG",children:[e(K,{className:"w-3 h-3"}),k?"Exporting...":"Export"]})]})]}),o&&e("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:o}),e("div",{ref:S,className:"bg-white dark:bg-gray-900 rounded",style:{width:"100%",height:280,minWidth:0},children:e(rr,{chartType:i,children:e(he,{width:"100%",height:"100%",children:(()=>{switch(i){case"bar":return t(fe,{data:P,children:[$,E,I()]});case"line":return t(me,{data:P,children:[$,E,I()]});case"area":return t(pe,{data:P,children:[$,E,I()]});case"composed":default:return t(ue,{data:P,children:[$,E,I()]});case"pie":return t(ve,{children:[e(xe,{data:P,dataKey:g||"value",nameKey:f||"name",cx:"50%",cy:"50%",innerRadius:m?.innerRadius||0,outerRadius:100,label:!1!==m?.showLabels,children:P.map((t,r)=>e(ke,{fill:tr[r%tr.length]},`cell-${r}`))}),e(le,{formatter:e=>"number"==typeof e?nr(e):String(e)}),e(ce,{})]});case"scatter":return(()=>{const r=h,n=y||"y";return t(we,{children:[e(oe,{strokeDasharray:"3 3"}),e(se,{dataKey:r,name:r,tick:{fontSize:12}}),e(ae,{dataKey:n,name:n,tickFormatter:nr}),e(le,{formatter:e=>"number"==typeof e?nr(e):String(e)}),e(ce,{}),O.length>0?O.map((t,r)=>e(Ne,{name:t.label||t.key,data:P,fill:t.color||tr[r%tr.length]},t.key)):e(Ne,{name:"Data",data:P,fill:tr[0]})]})})();case"radar":return(()=>{const r=v||h||"axis";return t(Ce,{cx:"50%",cy:"50%",outerRadius:100,data:P,children:[e(Se,{}),e(je,{dataKey:r,tick:{fontSize:11}}),e(Ae,{tickFormatter:nr}),O.map((t,r)=>e(Oe,{name:t.label||t.key,dataKey:t.key,stroke:t.color||tr[r%tr.length],fill:t.color||tr[r%tr.length],fillOpacity:.3},t.key)),e(le,{formatter:e=>"number"==typeof e?nr(e):String(e)}),e(ce,{})]})})();case"radialBar":return(()=>{const r=f||"name",n=g||"value",i=m?.startAngle??180,s=m?.endAngle??0;return t(Pe,{cx:"50%",cy:"50%",innerRadius:m?.innerRadius??30,outerRadius:100,barSize:15,data:P,startAngle:i,endAngle:s,children:[e($e,{label:{position:"insideStart",fill:"#fff",fontSize:11},background:!0,dataKey:n,children:P.map((t,r)=>e(ke,{fill:tr[r%tr.length]},`cell-${r}`))}),e(le,{formatter:e=>"number"==typeof e?nr(e):String(e)}),e(ce,{iconSize:10,layout:"vertical",verticalAlign:"middle",align:"right",formatter:(e,t)=>{const i=P.find(i=>i[r]===e||i[n]===t.payload?.value);return i?i[r]:e}})]})})();case"funnel":return(()=>{const r=f||"name",n=g||"value";return t(Ee,{children:[e(le,{formatter:e=>"number"==typeof e?nr(e):String(e)}),t(Ie,{dataKey:n,data:P,isAnimationActive:!0,children:[P.map((t,r)=>e(ke,{fill:tr[r%tr.length]},`cell-${r}`)),!1!==m?.showLabels&&e(Te,{position:"center",fill:"#fff",stroke:"none",dataKey:r})]})]})})();case"treemap":return e(Fe,{data:P,dataKey:x||g||"value",aspectRatio:4/3,stroke:"#fff",fill:"#4f46e5",content:({x:n,y:i,width:s,height:a,name:o,value:l,index:c})=>t("g",{children:[e("rect",{x:n,y:i,width:s,height:a,style:{fill:tr[c%tr.length],stroke:"#fff",strokeWidth:2}}),s>50&&a>30&&t(r,{children:[e("text",{x:n+s/2,y:i+a/2-7,textAnchor:"middle",fill:"#fff",fontSize:12,children:o}),e("text",{x:n+s/2,y:i+a/2+10,textAnchor:"middle",fill:"#fff",fontSize:11,children:nr(l)})]})]})})}})()})})})]})})},(e,t)=>JSON.stringify(e.spec)===JSON.stringify(t.spec)),sr=["artifact:","image:","store:","document:","document://","collection:"];function ar(e){return sr.some(t=>e.startsWith(t))?e:ee(e)}function or(){return e=>{re(e,"html",(e,t,r)=>{if(e.value&&/<!--[\s\S]*?-->/.test(e.value)&&r&&"number"==typeof t&&r.children)return r.children.splice(t,1),[ne,t]})}}function lr({children:t,components:r,remarkPlugins:n=[],removeComments:s=!0,artifactRunId:a}){const{client:o}=Me(),l=[te,...n];s&&l.push(or);const c=i.useMemo(()=>{const t=r||{},n=t.code,s=t.a,l=t.img;return{...t,code:({node:t,className:r,children:i,...s})=>{const a=/language-(\w+)/.exec(r||""),o=!a,l=a?a[1]:"";if(!o&&("chart"===l||r?.includes("language-chart")))try{const t=String(i||"").trim(),r=JSON.parse(t);if(r&&r.chart&&Array.isArray(r.data))return e(ir,{spec:r})}catch(e){console.warn("Failed to parse chart spec:",e)}return"function"==typeof n?e(n,{node:t,className:r,...s,children:i}):e("code",{...s,className:o?"px-1.5 py-0.5 rounded":"text-muted",children:i})},a:t=>{const{node:r,href:n,children:l,...c}=t,d=n||"",h=d.startsWith("artifact:"),u=h?d.replace(/^artifact:/,"").trim():"",p=d.startsWith("image:"),m=p?d.replace(/^image:/,"").trim():"",[f,g]=i.useState(void 0);if(i.useEffect(()=>{let e=!1;return(async()=>{if(h||p)try{if(h)if(a&&!u.startsWith("agents/")){const{url:t}=await o.files.getArtifactDownloadUrl(a,u,"attachment");e||g(t)}else{const{url:t}=await o.files.getDownloadUrl(u);e||g(t)}else if(p){const{url:t}=await o.files.getDownloadUrl(m);e||g(t)}}catch(t){const r=h?u:m;console.error("Failed to resolve link in MarkdownRenderer:",r,t),e||g(void 0)}else g(void 0)})(),()=>{e=!0}},[h,u,p,m,a,o]),d.startsWith("document://")){const t=d.replace(/^document:\/\//,"").trim(),n=t?`/store/objects/${t}`:d;return"function"==typeof s?e(s,{node:r,href:n,...c,children:l}):e("a",{href:n,...c,target:"_blank",rel:"noopener noreferrer",children:l})}if(d.startsWith("store:")){const t=d.replace(/^store:/,"").trim(),n=t?`/store/objects/${t}`:d;return"function"==typeof s?e(s,{node:r,href:n,...c,children:l}):e("a",{href:n,...c,target:"_blank",rel:"noopener noreferrer",children:l})}if(d.startsWith("collection:")){const t=d.replace(/^collection:/,"").trim(),n=t?`/store/collections/${t}`:d;return"function"==typeof s?e(s,{node:r,href:n,...c,children:l}):e("a",{href:n,...c,target:"_blank",rel:"noopener noreferrer",children:l})}if(!h&&!p&&"function"==typeof s)return e(s,{node:r,href:n,...c,children:l});if(h){return e("a",{href:f||"#",...c,target:"_blank",rel:"noopener noreferrer",children:l})}if(p){return e("a",{href:f||"#",...c,target:"_blank",rel:"noopener noreferrer",children:l})}return e("a",{href:n,...c,target:"_blank",rel:"noopener noreferrer",children:l})},img:t=>{const{node:r,src:n,alt:s,...c}=t,d=n||"",h=d.startsWith("artifact:"),u=d.startsWith("image:"),p=h||u,m=p?d.replace(/^artifact:/,"").replace(/^image:/,"").trim():"",[f,g]=i.useState(void 0);return i.useEffect(()=>{let e=!1;return(async()=>{if(p)try{if(h)if(a&&!m.startsWith("agents/")){const{url:t}=await o.files.getArtifactDownloadUrl(a,m,"inline");e||g(t)}else{const{url:t}=await o.files.getDownloadUrl(m);e||g(t)}else if(u){const{url:t}=await o.files.getDownloadUrl(m);e||g(t)}}catch(t){console.error("Failed to resolve image link in MarkdownRenderer:",m,t),e||g(void 0)}else g(void 0)})(),()=>{e=!0}},[p,m,a,o]),p||"function"!=typeof l?p?f?e("img",{src:f,alt:s,...c}):null:e("img",{src:n,alt:s,...c}):e(l,{node:r,src:n,alt:s,...c})}}},[r,o,a]);return e(Q,{remarkPlugins:l,components:c,urlTransform:ar,children:t})}const cr=d(void 0);function dr(){return h(cr)}const hr=Symbol("__SLOT_NAME");function ur(e,t){const r=[];return m.forEach(e,e=>{!function(e,t,r){let n;f(e)&&(n=e.type[hr])?r[n]=e:t.push(e)}(e,r,t)}),r.length>1?r:r[0]}function pr(e,t){t[hr]=e}function mr(e){return e?"boolean"==typeof e?{enabled:e}:e:{enabled:!1}}function fr(t){const r={};if(ur(t.children,r),!r.content)throw new Error("Popover must provide a content slot");const n=r.trigger?.props,i=r.content.props;return e(gr,{...t,trigger:n,content:i})}function gr({middleware:r,offset:n,trigger:i,dismiss:s=!0,content:a,placement:o,strategy:c,zIndex:d=40}){const[h,u]=l(!1),p=qe({open:h,placement:o,strategy:c,onOpenChange:u,middleware:r||[Ve(n||4),De(),Le()],whileElementsMounted:Re}),{floatingStyles:m,refs:{setReference:f,setFloating:g},context:y}=p,b=Ke(y,mr(s)),v=ze(y,mr(!(x=i)||x.hover||x.click?x?.click:{enabled:!0}));var x;const k=_e(y,mr(function(e){return!0===e?.hover?{enabled:!0,handleClose:Ge({blockPointerEvents:!0}),restMs:0}:e?.hover}(i))),{getReferenceProps:w,getFloatingProps:N}=Ue([b,v,k]),{isMounted:C,styles:S}=We(y,a.transition);return t(cr.Provider,{value:{...p,close:()=>u(!1)},children:[i&&e("div",{className:V(i.className,"inline-block"),ref:f,...w(),children:i.children}),e(Be,{children:C&&e("div",{ref:g,style:{...m,zIndex:d},...N(),children:e(He,{context:y,children:e("div",{className:V(a.className,"bg-popover rounded-md text-popover-foreground max-w-md"),style:S,children:a.children})})})})]})}function yr(e){return null}function br(e){return null}function vr({percent:t}){return e("div",{className:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700",children:e("div",{className:"bg-blue-600 h-2.5 rounded-full",style:{width:`${t}%`}})})}function xr({className:r,properties:n}){return e(N,{className:r,children:e("tbody",{children:n.map(r=>t("tr",{children:[t("td",{className:"w-1/3 font-semibold gap-2",children:[e("span",{children:r.name}),r.description&&e(C,{description:r.description,placement:"top",children:e(z,{className:"size-3 ml-2 text-muted-foreground"})})]}),e("td",{className:"w-2/3",children:r.value??"undefined"})]},r.name))})})}var kr;function wr(e,t){let r="any"===t.name?void 0:t.isNullable?[t.name,"null"]:t.name;if(t.isArray)if(e.type="array",e.properties=void 0,!e.items||Array.isArray(e.items))e.items={type:r,properties:t.isObject?{}:void 0};else{const n=e.items;n.type=r,t.isObject&&!n.properties&&(n.properties={})}else e.type=r,e.items=void 0,t.isObject?e.properties||(e.properties={}):e.properties=void 0}function Nr(e){let t,r=!1,n=!1;const i=e.type;if(Array.isArray(i))for(const e of i)"null"===e?r=!0:t||(t=e);else t=i;t||(t="any"),"array"===t&&(n=!0,t=function(e){if(!e)return"any";let t;t=Array.isArray(e)?Cr(e[0].type):Cr(e.type);"array"!==t&&"null"!==t||(t="any");return t}(e.items));let s=t;switch(e.editor){case"textarea":s="text";break;case"media":s="media";break;case"document":s="document"}return{isNullable:r,isArray:n,isObject:"object"===t,name:s}}function Cr(e){return e?Array.isArray(e)?e.find(e=>"null"!==e)||"any":e:"any"}pr("trigger",yr),pr("content",br),fr.Trigger=yr,fr.Content=br,function(e){e.string="string",e.number="number",e.integer="integer",e.boolean="boolean",e.object="object",e.any="any",e.text="text",e.media="media",e.document="document"}(kr||(kr={}));let Sr=0;class jr{source;onChange=()=>{};schema;root;constructor(e,t){this.schema=e?"string"==typeof e?JSON.parse(e):e:{title:t,type:"object",properties:{}},this.schema.properties||(this.schema.properties={}),this.root=new Ar("",this.schema,this),this.root.loadChildren()}get isEmpty(){return!this.root.children||0===this.root.children.length}get children(){return this.root.children}reload(){return this.root=new Ar("",this.schema,this),this.root.loadChildren(),this.onChange?.(this),this}withSource(e,t){return this.source={uri:t,name:e},this}withChangeListener(e){return this.onChange=e,this}replaceSchema(e){this.schema=e||{title:this.schema.title,type:"object",properties:{}},this.reload()}clone(){const e=new jr(this.schema);return e.source=this.source,this.onChange&&e.withChangeListener(this.onChange),e}}class Ar{schema;loader;parent;name;isRequired=!1;type;children;constructor(e,t,r,n){if(this.schema=t,this.loader=r,this.parent=n,this.name=e,this.type=Nr(t),this.parent){let t=this.parent._getPropertiesSchema().required;this.isRequired=!(!t||!Array.isArray(t))&&t.includes(e)}}get title(){return this.schema.title}set title(e){this.schema.title=e}get description(){return this.schema.description}set description(e){this.schema.description=e}get isParent(){return this.type.isObject}get isNew(){return!!this.schema.isNew}set isNew(e){e?this.schema.isNew=!0:delete this.schema.isNew}resetIsNew(){const e=this.isNew;return this.isNew=!1,e}getNameSignature(){return`${this.name}${this.isRequired?"":"?"}`}getTypeSignature(){return`${this.type.name}${this.type.isArray?"[]":""}${this.type.isNullable?"?":""}`}getSignature(){return`${this.getNameSignature()}: ${this.getTypeSignature()}`}reloadTree(){this.loader.reload()}loadChildren(){this.children=[],this.schema.items&&this.schema.items.properties?this._loadChildren(this.schema.items.properties):this.schema.properties&&this._loadChildren(this.schema.properties)}_loadChildren(e){for(const t of Object.keys(e)){const r=e[t],n=new Ar(t,r,this.loader,this);this.children.push(n),n.isParent&&n.loadChildren()}}_getPropertiesSchema(){return this.type.isArray&&this.type.isObject?this.schema.items:this.schema}findAvailableChildName(e){const t=this._getPropertiesSchema().properties||{};let r;do{r=e+ ++Sr}while(t[r]);return r}addChild(e,t,r=!1){if(!this.type.isObject)throw new Error("Cannot add child to a non object node");this.children||(this.children=[]);const n=function(e,t,r,n=!1){if("object"!==e.type)throw new Error("Cannot add property to a non-object schema");e.properties||(e.properties={});const i={};return wr(i,r),e.properties[t]=i,n&&(Array.isArray(e.required)?function(e,t){e.includes(t)||e.push(t)}(e.required,t):e.required=[t]),i}(this._getPropertiesSchema(),e,t,r),i=new Ar(e,n,this.loader,this);return this.children.push(i),i}remove(){if(this.parent&&this.parent.type.isObject){return function(e,t){e.properties&&(delete e.properties[t],Array.isArray(e.required)&&(e.required=e.required.filter(e=>e!==t)))}(this.parent._getPropertiesSchema(),this.name),this.parent.children&&(this.parent.children=this.parent.children.filter(e=>e.name!==this.name)),!0}return!1}update(e){let t=!1;null!=e.name&&this.name!==e.name&&(this.parent&&function(e,t,r){if(e.properties){const n=e.properties,i={};for(const e of Object.keys(n)){const s=n[e];e===t?i[r]=s:i[e]=s}e.properties=i}e.required&&(e.required=e.required.map(e=>e===t?r:e))}(this.parent._getPropertiesSchema(),this.name,e.name),this.name=e.name,t=!0),null!=e.isRequired&&this.isRequired!==e.isRequired&&(this.parent&&function(e,t,r){if(Array.isArray(e.required)){const n=e.required.indexOf(t);r?n<0&&e.required.push(t):n>-1&&e.required.splice(n,1)}else r&&(e.required=[t])}(this.parent._getPropertiesSchema(),this.name,e.isRequired),this.isRequired=e.isRequired,t=!0);let r=e.type?.name;"any"===r&&(r=void 0);const n=r!==this.schema.type;return e.type&&(wr(this.schema,e.type),this.type=e.type,this.type.isObject?this.children||(this.children=[]):this.children=void 0,t=!0),this.schema.editor&&null===e.editor?(this.schema.editor=void 0,t=!0):e.editor?(this.schema.editor=e.editor,t=!0):n&&(this.schema.editor=void 0,t=!0),e.description!==this.description&&(this.description=e.description,t=!0),t}getUpdateFromNameAndTypeSignature(e,t){let r=e.trim(),n=!0;r.endsWith("?")&&(r=r.substring(0,r.length-1).trim(),n=!1);const i=function(e){let t=!1,r=!1;(e=e.trim()).endsWith("?")&&(r=!0,e=e.substring(0,e.length-1).trim()),e.endsWith("[]")&&(t=!0,e=e.substring(0,e.length-2).trim());const n=kr[e];if(!n)throw new Error(`Unknown type "${e}"`);return{name:n,isArray:t,isNullable:r,isObject:n===kr.object}}(t);let s;return"text"===i.name?(i.name=kr.string,s="textarea"):"media"===i.name?(i.name=kr.any,s="media"):"document"===i.name?(i.name=kr.any,s="document"):s=null,{name:r,type:i,isRequired:n,editor:s}}updateFromNameAndTypeSignature(e,t){return this.update(this.getUpdateFromNameAndTypeSignature(e,t))}updateFromSignature(e){const t=(e=e.trim()).indexOf(":");if(t<0)throw new Error("Expecting a name and a type separated by a colon");const r=e.substring(0,t),n=e.substring(t+1);return this.updateFromNameAndTypeSignature(r,n)}}function Or(e){return{name:e.getNameSignature(),type:e.getTypeSignature(),description:e.description}}const Pr=function(){const e=Object.values(kr),t=[...e];for(const r of e)t.push(r+"[]");return e.sort(),t}();function $r({value:r,onChange:n,onCancel:i,onSave:s}){const[a,o]=l(!1);if(!r)return null;return t("div",{className:"flex items-center",children:[e("div",{className:"flex-1",children:e(Er,{value:r.name,onChange:e=>{n({...r,name:e})},onCancel:i,onSave:s})}),e("div",{className:"px-1 font-semibold",children:":"}),e("div",{className:"flex-1",children:e(Ir,{value:r.type,onChange:e=>{n({...r,type:e})},onCancel:i,onSave:s})}),t("div",{children:[e(k,{variant:"ghost",size:"xs",onClick:()=>o(!0),title:"Edit description",children:e(_,{className:"size-4"})}),e(Tr,{value:r.description,isOpen:a,onClose:e=>{void 0!==e&&"string"==typeof e&&n({...r,description:e},!0),o(!1)}})]})]})}function Er({value:t,onChange:r,onCancel:n,onSave:i}){const o=s(null);a(()=>{o.current?.focus()},[]);return e("input",{onKeyUp:e=>{switch(e.key){case"Enter":i?.();break;case"Escape":n?.()}},ref:o,value:t,onChange:e=>{r(e.target.value)},className:v.INPUT_UNSTYLED,style:{fontSize:"inherit",width:"",display:"inline"}})}function Ir({value:t,onChange:r,onCancel:n,onSave:i}){return e(S,{className:v.INPUT_UNSTYLED,options:Pr,value:t||"",onBlur:()=>{i?.()},onChange:r,onKeyDown:(e,t)=>{t||("Enter"===e.key?i?.():"Escape"===e.key&&n?.())},popupClass:"schema-type-suggest-popup z-90"})}function Tr({value:r,isOpen:n,onClose:i}){return t(j,{isOpen:n,onClose:i,children:[e(A,{children:"Edit description"}),e(Fr,{value:r,onSave:i})]})}function Fr({value:n,onSave:i}){const o=s(null),[c,d]=l(n||"");return a(()=>{o.current&&o.current.focus()},[o.current]),t(r,{children:[e(O,{className:"h-max",children:e("textarea",{ref:o,className:"dark:bg-gray-800 w-full h-full dark:text-white",value:c,onChange:e=>d(e.target.value)})}),e(P,{children:e(k,{onClick:()=>i(c),children:"Save Changes"})})]})}function Mr({value:r}){return r?t("div",{className:"w-full flex items-baseline",children:[e("div",{children:r.name||""}),e("div",{className:"ml-2 text-sm text-muted",children:r.type||""})]}):null}function Vr(e){const[t,r]=l(new jr(e||{type:"object",properties:{}}).withChangeListener(e=>{r(e.clone())}));return t}const Dr="block text-sm sm:leading-6 rounded-md border-0 py-1.5 px-4",Lr=`${Dr} hover:shadow-xs hover:ring-1 hover:ring-inset hover:ring-ring`,qr=`${Dr} shadow-xs ring-1 ring-inset ring-ring`;function Rr({value:r,onChange:n,onDelete:i,outlineOnHover:s=!1,editOnClick:a=!0,placeholder:o,viewer:c,editor:d,skipClickOutside:h,isEditing:u=!1,readonly:p=!1,onValidate:m}){const{on:f,off:g,isOn:y}=$(u),[b,v]=l();return t("div",{className:"",children:[y&&!p?e(zr,{value:r,onSave:e=>{if(m){const t=m(e);if(t)return void v(t);v(void 0)}n(e)&&g()},onCancel:g,editor:d,skipClickOutside:e=>!!h&&h(e)}):e(Kr,{value:r,onEdit:f,viewer:c,placeholder:o,outlineOnHover:s,editOnClick:a,onDelete:i,readonly:p}),b&&e("div",{className:"text-red-500 text-sm",children:b})]})}function Kr({viewer:r,value:n,onEdit:i,editOnClick:s,outlineOnHover:a,placeholder:o,onDelete:l,readonly:c}){const d="invisible group-hover:visible";return t("div",{tabIndex:0,onKeyUp:e=>{"Enter"===e.key&&i()},onClick:()=>{s&&i()},className:V("flex justify-start items-center group",a?Lr:Dr,{"cursor-pointer":s}),children:[e(r,{value:n,placeholder:o}),t("div",{className:"ml-auto flex space-x-2",children:[!c&&l&&e(k,{variant:"ghost",size:"sm",className:d,onClick:l,children:e(L,{className:"size-4"})}),c?null:e(k,{variant:"ghost",size:"sm",className:d,onClick:i,children:e(U,{className:"size-4"})})]})]})}function zr({editor:t,value:r,onSave:n,onCancel:i,skipClickOutside:a}){const[o,c]=l(r),d=s(r),[h,u]=l(null),p=()=>{n(d.current)},m=E(p,a);return e("div",{ref:m,children:e("div",{className:qr,children:e("div",{className:"w-full",onClick:e=>e.stopPropagation(),children:e(t,{value:o,onChange:(e,t=!1)=>{c(e),d.current=e,t&&(h&&clearTimeout(h),u(setTimeout(()=>{n(e)},500)))},onSave:p,onCancel:i})})})})}function _r(e){const t=e.target;return!(!t.closest||!t.closest(".schema-type-suggest-popup"))}function Ur({schema:r,readonly:n=!1}){return t("ul",{className:"",children:[r.children.map(e=>Wr(e,n)),n?null:e(Jr,{parent:r.root})]})}function Wr(t,r){return t.isParent?e(Hr,{property:t,readonly:r},t.name):e(Br,{node:t,readonly:r},t.name)}function Br({node:t,readonly:r}){return e("li",{children:e(Zr,{property:t,readonly:r})})}function Hr({property:r,readonly:n}){const[i,s]=l(!0);return t("li",{children:[t("div",{className:"flex items-center w-full",children:[e("button",{onClick:()=>s(!i),children:e(i?W:B,{className:"size-4"})}),e("div",{className:"flex-1",children:e(Zr,{property:r,readonly:n})})]}),i&&t("ul",{className:"ml-4 border-l border-gray-400 border-dashed",children:[(r.children||[]).map(e=>Wr(e,n)),n?null:e(Jr,{parent:r})]})]})}function Gr(e){return e?/^[a-zA-Z0-9_]+[?]?$/.test(e)?void 0:"Only letters, numbers, underscores or question mark are allowed (a-zA-Z0-9_?)":"Name is required"}function Zr({property:t,readonly:r}){const n=I(),i=t.resetIsNew(),s=Or(t);return e(Rr,{value:s,onChange:e=>{try{e.description&&"string"!=typeof e.description&&(e.description=void 0);const r=t.getUpdateFromNameAndTypeSignature(e.name,e.type);t.update({...r,description:e.description})&&t.reloadTree()}catch(e){return n({status:"error",title:"Invalid property declaration",description:e.message,duration:9e3}),!1}return!0},onDelete:()=>{t.remove(),t.reloadTree()},editor:$r,viewer:Mr,outlineOnHover:!0,isEditing:i,skipClickOutside:_r,readonly:r,onValidate:e=>Gr(e.name)})}function Jr({parent:r}){return t(k,{variant:"ghost",onClick:()=>{const e=r.findAvailableChildName("new_property_");r.addChild(e,{isObject:!1,isArray:!1,isNullable:!1,name:kr.string},!0).isNew=!0,r.reloadTree()},children:[e(D,{className:"size-4"}),"Add property"]})}function Xr({content:t,...r}){const n=s(null);return a(()=>{if(!n.current)return;const e=(new DOMParser).parseFromString(t,"image/svg+xml").querySelector("svg");if(!e)return console.warn("SvgIcon: No <svg> element found in provided string"),void(n.current.innerHTML="");r&&Object.entries(r).forEach(([t,r])=>{if(null==r)return;const n="className"===t?"class":t;e.setAttribute(n,String(r))}),n.current.innerHTML="",n.current.appendChild(e)},[t,r]),e("span",{ref:n})}function Yr(t){return r=>e(Xr,{content:t,...r})}function Qr({onDrop:r,message:n,buttonLabel:i="Upload Files",allowFolders:a=!0,className:o=""}){const[c,d]=l(!1),h=s(null),u=e=>{if(e.target.files&&e.target.files.length>0){const t=Array.from(e.target.files);if(t.some(e=>e.webkitRelativePath&&e.webkitRelativePath.includes("/"))){const e=new Set(t.map(e=>e.webkitRelativePath?.split("/")[0]).filter(Boolean)).size,n=t.length,i=1===e?`Preparing to upload 1 folder with ${n} files...`:`Preparing to upload ${e} folders with ${n} files...`,s={count:t.length,message:i};r(t,s)}else{const e={count:t.length,message:`Preparing to upload ${t.length} file${1===t.length?"":"s"}...`};r(t,e)}}};return t("div",{className:`flex flex-col items-center justify-center py-12 border-2 rounded-lg transition-colors ${c?"border-color-primary bg-color-primary/10":"border-dashed border-color-border"} ${o}`,onDragOver:e=>{e.preventDefault(),e.dataTransfer.types.includes("Files")&&d(!0)},onDragLeave:e=>{e.preventDefault(),h.current&&!h.current.contains(e.relatedTarget)&&d(!1)},onDrop:async e=>{if(e.preventDefault(),d(!1),e.dataTransfer.items&&e.dataTransfer.items.length>0){const t=Array.from(e.dataTransfer.items),n=[],i=new Set,s=async e=>{if(e.isFile){const t=await new Promise(t=>{e.file(r=>{Object.defineProperty(r,"webkitRelativePath",{writable:!0,value:e.fullPath.substring(1)}),t(r)})});!t.name.startsWith(".")&&t.size>0&&n.push(t);const r=e.fullPath.substring(1).split("/").slice(0,-1).join("/");r&&i.add(r)}else if(e.isDirectory){const t=e.createReader(),r=await new Promise(e=>{t.readEntries(t=>{e(t)})});await Promise.all(r.map(s));const n=e.fullPath.substring(1);n&&i.add(n)}};try{if(await Promise.all(t.map(e=>{const t=e.webkitGetAsEntry?e.webkitGetAsEntry():e;return t?s(t):Promise.resolve()})),n.length>0){const e=new Set(Array.from(i).map(e=>e.split("/")[0]).filter(Boolean)).size,t=n.length;let s="";s=e>0?1===e?`Preparing to upload 1 folder with ${t} files...`:`Preparing to upload ${e} folders with ${t} files...`:`Preparing to upload ${t} file${1===t?"":"s"}...`,r(n,{count:n.length,message:s})}}catch(t){console.error("Error processing dropped files:",t);const n=Array.from(e.dataTransfer.files);n.length>0&&r(n)}}else if(e.dataTransfer.files&&e.dataTransfer.files.length>0){const t=Array.from(e.dataTransfer.files);r(t)}},children:[e(H,{className:"h-12 w-12 mb-3 transition-colors "+(c?"text-primary":"text-muted/50")}),e("p",{className:"text-muted",children:n}),t("div",{className:"flex gap-2 justify-center mt-2",children:[e(k,{onClick:()=>{const e=document.createElement("input");e.type="file",e.multiple=!0,e.accept="*",e?.click(),e.onchange=e=>{u(e)}},children:i}),a&&e(k,{onClick:()=>{const e=document.createElement("input");e.type="file",e.multiple=!0,e.accept="*",e.webkitdirectory=!0,e?.click(),e.onchange=e=>{u(e)}},children:"Select Folder"})]})]})}function en({title:r,count:n,icon:i=e(G,{className:"h-4 w-4 text-green-500"}),items:s}){const[a,o]=l(!1);return t("div",{className:"border border-color-border rounded-md overflow-hidden",children:[t("div",{className:"flex items-center justify-between p-3 bg-color-muted/10 cursor-pointer",onClick:()=>o(!a),children:[t("div",{className:"flex items-center",children:[e("span",{className:"mr-2",children:i}),e("span",{className:"font-medium",children:r}),e("span",{className:"ml-2 px-2 py-0.5 bg-color-muted/20 rounded-full text-xs",children:n})]}),e("button",{className:"text-muted",children:e("svg",{className:"h-5 w-5 transition-transform "+(a?"transform rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]}),a&&e("div",{className:"p-3 border-t border-color-border max-h-48 overflow-y-auto",children:s.length>0?e("ul",{className:"space-y-1",children:s.map((t,r)=>e("li",{className:"text-sm py-1 px-2 rounded hover:bg-color-muted/10",children:t},r))}):e("div",{className:"text-sm text-muted py-2",children:"No items to display"})})]})}function tn({files:r,className:n="",location:i,collection:s}){const a=r.filter(e=>"success"===e.status),o=r.filter(e=>"updated"===e.status),l=r.filter(e=>"skipped"===e.status),c=r.filter(e=>"failed"===e.status),d=a.length,h=o.length,u=l.length,p=c.length,m=r.length;return t("div",{className:`flex flex-col py-2 ${n}`,children:[t("div",{className:"flex items-center mb-4",children:[e("div",{className:"size-8 mr-4 rounded-full bg-success/10 flex items-center justify-center",children:e(G,{className:"size-4 text-success"})}),e("div",{children:t("p",{className:"text-muted",children:[m," file",1!==m?"s":""," processed",s?` in collection '${s}'`:"",i?` in folder '${i}'`:""]})})]}),t("div",{className:"space-y-3 mt-2",children:[d>0&&e(en,{title:"Successfully Uploaded",count:d,icon:e(G,{className:"h-4 w-4 text-green-500"}),items:a.map(e=>e.name)}),h>0&&e(en,{title:"Successfully Updated",count:h,icon:e(G,{className:"h-4 w-4 text-blue-500"}),items:o.map(e=>e.name)}),u>0&&e(en,{title:"Skipped (Already Existed)",count:u,icon:e(Z,{className:"h-4 w-4 text-amber-500"}),items:l.map(e=>e.name)}),p>0&&e(en,{title:"Failed to Upload",count:p,icon:e(J,{className:"h-4 w-4 text-red-500"}),items:c.map(e=>e.name)})]})]})}const rn="#text",nn="#comment",sn="#cdata",an="DECLARATION_TAG",on={tagColor:"#d43900",textColor:"#333",attributeKeyColor:"#2a7ab0",attributeValueColor:"#008000",separatorColor:"#333",commentColor:"#aaa",cdataColor:"#1d781d",fontFamily:"monospace"},ln={attributeKeyColor:"#FFD700",attributeValueColor:"#FF4500",tagColor:"#87CEFA",textColor:"#00FF00",separatorColor:"#FFD700",commentColor:"#BEBEBE",cdataColor:"#33CC66",fontFamily:"monospace"},cn=d({theme:on,collapsible:!1,indentSize:2}),dn=()=>h(cn),hn=new Ze({preserveOrder:!0,ignoreAttributes:!1,attributeNamePrefix:"",allowBooleanAttributes:!0,commentPropName:nn,cdataPropName:sn,parseTagValue:!1});function un(r){const{indentation:n,children:i,isInline:s}=r,{theme:a}=dn();return t("div",{style:{color:a.cdataColor},children:[e("span",{children:`${n}<![CDATA[`}),i,e("span",{children:`${s?"":n}]]>`})]})}function pn(t){const{collapsible:r,theme:n}=dn(),{collapsed:i}=t;return r?e("span",{style:{position:"relative"},children:e("span",{style:{position:"absolute",right:"0",border:0,padding:0,background:"none"},children:e(mn,{fill:n.separatorColor,style:{transform:`rotate(${i?0:90}deg)`,transition:"transform 0.2s"}})})}):null}function mn({...t}){return e("svg",{width:"16px",height:"16px",viewBox:"0 0 24 24",...t,children:e("path",{d:"M9 17.898C9 18.972 10.2649 19.546 11.0731 18.8388L17.3838 13.3169C18.1806 12.6197 18.1806 11.3801 17.3838 10.6829L11.0731 5.16108C10.2649 4.45388 9 5.02785 9 6.1018V17.898Z"})})}function fn(e){const{collapsible:t,initialCollapsedDepth:r}=dn(),[n,i]=l(()=>!(Xe(r)||!t)&&e>=r);return a(()=>{i(!(Xe(r)||!t)&&e>=r)},[r,e,t]),{collapsed:n,buttonProps:t?{onClick:()=>i(e=>!e),role:"button",style:{cursor:"pointer"}}:{}}}function gn(r){const{indentation:n,children:i,isInline:s,level:a}=r,{theme:o}=dn(),{collapsed:l,buttonProps:c}=fn(a);return t("div",{style:{color:o.commentColor},children:[t("span",{...c,children:[e("span",{children:n}),e(pn,{collapsed:l}),e("span",{children:"\x3c!-- "})]}),!l&&i,l&&"...",e("span",{children:`${s||l?" ":n}--\x3e`})]})}function yn(r){const{attributes:n}=r,{theme:i}=dn();return n?e("span",{children:Object.entries(n).map(([r,n])=>t("span",{children:[e("span",{style:{color:i.attributeKeyColor},children:` ${r}`}),e("span",{style:{color:i.separatorColor},children:"="}),e("span",{style:{color:i.attributeValueColor},children:`"${n}"`})]},`attribute-${r}`))}):null}function bn(r){const{indentation:n,tagKey:i,attributes:s}=r,{theme:a}=dn();return t("div",{children:[e("span",{style:{color:a.separatorColor},children:`${n}<?`}),e("span",{style:{color:a.tagColor},children:`${i.slice(1)}`}),e(yn,{attributes:s}),e("span",{style:{color:a.separatorColor},children:"?>"})]})}function vn(e){return"string"==typeof e&&e.includes("\n")}function xn(e){const t=e[":@"],r=Ye(e,":@"),[[n,i]]=Object.entries(r),s=function(e){switch(e){case rn:case sn:case nn:return e;default:return e.startsWith("?")?an:"TAG"}}(n);return{attributes:t,tagKey:n,subElements:i,type:s}}function kn(e){return!!e&&Object.keys(e).length>0}function wn(n){const{indentation:i,tagKey:s,attributes:a,children:o,isInline:l,hasChildren:c,level:d}=n,{collapsed:h,buttonProps:u}=fn(d),{theme:p}=dn();return t("div",{children:[t("span",{...u,children:[e("span",{children:i}),e(pn,{collapsed:h}),e("span",{style:{color:p.separatorColor},children:"<"}),e("span",{style:{color:p.tagColor},children:`${s}`}),!h&&e(yn,{attributes:a}),h&&kn(a)&&" ...",e("span",{style:{color:p.separatorColor},children:c?">":" />"})]}),c&&t(r,{children:[!h&&o,h&&"...",e("span",{style:{color:p.separatorColor},children:`${l||h?"":i}</`}),e("span",{style:{color:p.tagColor},children:`${s}`}),e("span",{style:{color:p.separatorColor},children:">"})]})]})}function Nn(t){const{hasSiblings:r,text:n,indentation:i,isText:s}=t,{theme:a}=dn(),o=s?{color:a.textColor}:void 0;return vn(n)||r?e("div",{style:o,children:n.split("\n").filter(e=>!!e.trim()).map((t,r)=>e("div",{children:`${i}${t.trim()}`},`${r}`))}):e("span",{style:o,children:n})}function Cn(t){const{elements:n,level:i=0,isText:s=!0}=t,{indentSize:a}=dn();return Array.isArray(n)&&0!==n.length?e(r,{children:n.map((t,r)=>{const{tagKey:o,attributes:l,subElements:c,type:d}=xn(t),h=n.length>1,u=function(e,t){return new Array(t*e+1).join(" ")}(a,i),p=`${i}-${r}`,m=function(e){return"string"!=typeof e&&1===e.length&&rn in e[0]&&!vn(e[0][rn])}(c);switch(d){case rn:return e(Nn,{text:c,indentation:u,hasSiblings:h,isText:s},p);case nn:return e(gn,{isInline:m,indentation:u,level:i,children:e(Cn,{elements:c,level:i+1,isText:!1})},p);case sn:return e(un,{indentation:u,isInline:m,children:e(Cn,{elements:c,level:i+1,isText:!1})},p);case an:return e(bn,{indentation:u,tagKey:o,attributes:l},p);default:return e(wn,{indentation:u,tagKey:o,attributes:l,isInline:m,hasChildren:c.length>0,level:i,children:e(Cn,{elements:c,level:i+1})},p)}})}):null}function Sn(){return e("div",{children:"Invalid XML!"})}function jn(t){const{theme:r,xml:n,collapsible:i=!1,indentSize:s=2,invalidXml:c,initalCollapsedDepth:d,initialCollapsedDepth:h}=t,[u,p]=l(()=>document.documentElement.classList.contains("dark"));a(()=>{const e=document.documentElement,t=new MutationObserver(()=>{p(e.classList.contains("dark"))});return t.observe(e,{attributes:!0,attributeFilter:["class"]}),()=>t.disconnect()},[]);const m=o(()=>({...u?ln:on,...r}),[u,r]),{json:f,valid:g}=function(e){return o(()=>{try{if(!Je.validate(e))throw new Error("Invalid XML!");const t=hn.parse(e);if("string"==typeof e&&e.trim().length>0&&0===t.length)throw new Error("Invalid XML!");return{json:t,valid:!0}}catch(e){return{json:null,valid:!1,errorMessage:`Fail to parse: ${e.message}`}}},[e])}(n),y=o(()=>({theme:m,collapsible:i,indentSize:s,initialCollapsedDepth:h??d}),[m,i,s,d,h]);return g?e(cn.Provider,{value:y,children:e("div",{className:"rxv-container",style:{whiteSpace:"pre-wrap",fontFamily:m.fontFamily,overflowWrap:"break-word"},children:e(Cn,{elements:f})})}):c||e(Sn,{})}export{Nt as ArrayPropertySchema,rt as CodeMirrorEditor,Qr as DropZone,at as FieldSetContextProvider,pt as Form,lt as FormContext,ht as FormContextProvider,Vt as FormError,Mt as FormHelper,Ft as FormLabel,ft as GeneratedForm,ut as Input,Wt as JSONCode,er as JSONDisplay,Bt as JSONView,It as ManageObjectEntry,Et as ManagedListProperty,Ot as ManagedObject,At as ManagedObjectBase,Pt as ManagedObjectProperty,$t as ManagedProperty,Tt as ManagedScalarEntry,jr as ManagedSchema,lr as MarkdownRenderer,it as MonacoEditor,jt as Node,fr as Popover,cr as PopoverContext,vr as Progress,xr as PropertiesView,$r as PropertyEditor,Er as PropertyNameEditor,wt as PropertySchema,Mr as PropertyViewer,yt as ScalarField,kt as Schema,Ur as SchemaEditor,Ar as SchemaNode,Xr as SvgIcon,en as UploadResultCategory,tn as UploadSummary,nt as VEditorApi,jn as XMLViewer,Ct as computeTitleFromName,Yr as createSvgIcon,Or as getEditableSchemaProperty,ot as useFieldSet,dt as useForm,dr as usePopoverContext,Vr as useSchema,Gr as validatePropertyName};
1
+ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{Editor as n}from"@monaco-editor/react";import{useTheme as i,Styles as a,FormItem as s,Button as o,DotBadge as l,Table as c,VTooltip as d,VSelectBox as h,VModal as u,VModalTitle as m,ModalBody as p,ModalFooter as f,useFlag as g,useClickOutside as y,useToast as v}from"@vertesia/ui/core";import b from"debounce";import x from"clsx";import w,{useState as k,useRef as N,useEffect as C,useMemo as S,useCallback as A,createContext as j,useContext as O,memo as P,Component as E,Children as I,isValidElement as T}from"react";import{Plus as $,Trash2 as F,Check as D,Copy as L,Download as q,Info as R,AlignLeft as z,SquarePen as K,ChevronDown as V,ChevronRight as _,UploadIcon as M,CheckCircleIcon as U,AlertCircleIcon as W,XCircleIcon as B}from"lucide-react";import H from"ajv";import J,{defaultUrlTransform as G}from"react-markdown";import Z from"remark-gfm";import{visit as X,SKIP as Y}from"unist-util-visit";import{toPng as Q}from"html-to-image";import{XAxis as ee,YAxis as te,CartesianGrid as re,Tooltip as ne,Legend as ie,ReferenceLine as ae,ResponsiveContainer as se,ComposedChart as oe,AreaChart as le,LineChart as ce,BarChart as de,Line as he,Area as ue,Bar as me,PieChart as pe,Pie as fe,Cell as ge,ScatterChart as ye,Scatter as ve,RadarChart as be,PolarGrid as xe,PolarAngleAxis as we,PolarRadiusAxis as ke,Radar as Ne,RadialBarChart as Ce,RadialBar as Se,FunnelChart as Ae,Funnel as je,LabelList as Oe,Treemap as Pe}from"recharts";import{useUserSession as Ee}from"@vertesia/ui/session";import{offset as Ie,shift as Te,flip as $e}from"@floating-ui/dom";import{useFloating as Fe,autoUpdate as De,useDismiss as Le,useClick as qe,useHover as Re,useInteractions as ze,useTransitionStyles as Ke,FloatingPortal as Ve,FloatingFocusManager as _e,safePolygon as Me}from"@floating-ui/react";import{XMLParser as Ue,XMLValidator as We}from"fast-xml-parser";import{isNil as Be,omit as He}from"lodash-es";class Je{VgetValue;VsetValue;constructor(e,t){this.VgetValue=e,this.VsetValue=t}getValue(){return this.VgetValue()}setValue(e){this.VsetValue(e||"")}}function Ge({onChange:t,value:r="",className:a,editorRef:s,language:o="javascript",debounceTimeout:l=0,options:c={},beforeMount:d,onMount:h,defaultValue:u,minLines:m=10,maxLines:p}){const[f,g]=k(r),y=N(null),{theme:v}=i(),w=N(()=>f),j=N(e=>{g(e),y.current&&y.current.setValue(e)});C(()=>{w.current=()=>f},[f]),C(()=>(s&&(s.current=new Je(()=>w.current(),e=>j.current(e))),()=>{s&&(s.current=void 0)}),[s]);const O=S(()=>{if(t)return l>0?b(e=>t(e),l):t},[t,l]),P=A(e=>{const t=e||"";if(g(t),O){const e={docChanged:!0,state:{doc:{toString:()=>t,length:t.length}}};O(e)}},[O]),E=A((e,t)=>{y.current=e,j.current=t=>{g(t),e.setValue(t)},t.editor.defineTheme("errorLineTheme",{base:"dark"===v?"vs-dark":"vs",inherit:!0,rules:[],colors:{"editorError.background":"#ffebee","editorError.border":"#f44336"}}),t.editor.setTheme("errorLineTheme"),h?.(e,t)},[h,v]);C(()=>{r!==f&&(g(r),y.current&&y.current.setValue(r))},[r]);const I={fontSize:14,fontFamily:"monospace",minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:"on",lineNumbers:"on",folding:!1,lineDecorationsWidth:0,lineNumbersMinChars:3,automaticLayout:!0,formatOnPaste:!0,formatOnType:!0,tabSize:2,insertSpaces:!0,glyphMargin:!0,renderValidationDecorations:"on",renderLineHighlight:"line",hover:{enabled:!0,delay:100},quickSuggestions:{other:!0,comments:!0,strings:!0},...c},T=19*(p||m)+20;return e("div",{className:x(a,"w-full"),style:{height:`${T}px`},children:e(n,{className:"h-full w-full",height:"100%",theme:"dark"===v?"vs-dark":"light",language:o,value:f,onChange:P,onMount:E,beforeMount:d,options:I,defaultValue:u||""})})}const Ze=j(void 0),Xe=Ze.Provider;function Ye(){const e=O(Ze);if(!e)throw new Error("useFieldSet must be used within a Form or FieldSet element");return e}class Qe{object;components;disabled;constructor(e,t={},r=!1){this.object=e,this.components=t,this.disabled=r}}const et=j(void 0);function tt(){const e=O(et);if(!e)throw new Error("useForm must be used within a Form element");return e}const rt=et.Provider,nt=w.forwardRef(({object:t,type:r="text",onChange:n,...i},s)=>{const[o,l]=k(null!=t.value?String(t.value):""),[c,d]=k(t.schema.isBoolean&&!0===t.value);i.className?i.className=x(a.INPUT,i.className):i.className=a.INPUT;const h=e=>{i.disabled||(l(e.target.value),t.schema.isBoolean?(t.value=e.target.checked,d(t.value)):t.value=e.target.value,n&&n(e))};return"textarea"===r?e("textarea",{ref:s,...i,value:o,onChange:h}):e("input","checkbox"===r?{ref:s,...i,type:"checkbox",checked:c,onChange:h,className:"form-check-input"}:{ref:s,...i,type:r,value:o,onChange:h})});function it({object:t,components:r,onSubmit:n,children:i,onChange:a,disabled:s}){return t.observer=a,e(rt,{value:new Qe(t,r||{},s??!1),children:e("form",{className:"w-full",onSubmit:e=>{e.stopPropagation(),e.preventDefault(),n&&n(t.value)},children:i})})}function at(){const t=tt();return e("div",{className:"flex flex-col gap-4 w-full",children:t.object.properties.map(ot)})}function st({children:r,...n}){return t(it,{...n,children:[e(at,{}),r]})}function ot(t){return t.isList?e(dt,{object:t},t.name):t.isObject?e(ct,{object:t},t.name):e(lt,{object:t},t.name)}function lt({object:t,editor:r,inline:n=!1}){r||(r=t.schema.editor);const{components:i,disabled:a}=tt(),o=r&&i[r]||nt,l=t.getInputType();"checkbox"===l&&(n=!0);const c=e=>{a||(t.schema.isBoolean?t.value=e.target.checked:t.schema.isNumber?t.value=parseFloat(e.target.value):t.value=e.target.value)};return t.isListItem?e(o,{object:t,type:l,onChange:c,disabled:a}):e(s,{label:t.title,required:t.schema.isRequired,description:t.schema.description,className:x("flex",n?"flex-row items-center":"flex-col"),children:e(o,{object:t,type:l,onChange:c,disabled:a})})}function ct({object:r}){return t("div",{className:"flex flex-col gap-4 my-4 py-2 pl-4 border-l-4 border-l-solid border-l-slate-100 dark:border-l-slate-600",children:[!r.isListItem&&e("div",{className:"text-gray-900 dark:text-gray-200 font-semibold",children:r.title}),r.properties.map(ot)]})}function dt({object:r}){const[n,i]=k(r.value||[]),{disabled:a}=tt();return t("div",{className:"flex flex-col gap-4 my-4 py-2 pl-4 border-l-4 border-l-solid border-l-slate-100 darK:border-l-slate-600",children:[!r.isListItem&&e("div",{className:"text-gray-900 dark:text-gray-200 font-semibold",children:r.title}),r.items.map((t,s)=>e(ht,{object:t,list:r,onDelete:()=>(e=>{a||(r.remove(e),i([...r.value]))})(s),disabled:a},`${s}-${n[s]??""}`)),e("div",{children:t(o,{variant:"secondary",onClick:()=>{a||(r.add(),i([...r.value]))},disabled:a,children:[e($,{className:"size-6"})," Add"]})})]})}function ht({list:r,object:n,onDelete:i,disabled:a}){return t("div",{className:"flex gap-2 w-full",children:[e("div",{className:"flex-1",children:(s=n,l=r.schema.arraySchema.editor,s.isList?e(dt,{object:s}):s.isObject?e(ct,{object:s}):e(lt,{object:s,editor:l}))}),e(o,{variant:"secondary",onClick:i,disabled:a,children:e(F,{className:"size-4"})})]});var s,l}class ut{schema;properties={};_validator;constructor(e){this.schema=e||{type:"object",properties:{}},this.load()}get validator(){if(!this._validator){const e=new H({allErrors:!0,strict:!1});this._validator=e.compile(this.schema)}return this._validator}load(){if(this.schema.properties){const e=this.schema.properties;Object.keys(e).forEach(t=>{this.loadProperty(t,e[t])})}}hasProperties(){return Object.keys(this.properties).length>0}get title(){return this.schema.title||this.schema.name}get description(){return this.schema.description}loadProperty(e,t){let r;return r="array"===t.type?new pt(this,e,t):new mt(this,e,t),this.properties[e]=r,r}get type(){return this.schema.type}validate(e){return this.validator(e)?null:this.validator.errors||[]}addProperty(e,t,r=!1){"object"!==this.schema.type&&(this.schema.type="object"),this.schema.properties||(this.schema.properties={});const n="string"==typeof t?"object"===(i=t)?{type:"object",properties:{}}:"array"===i?{type:"array",items:{}}:{type:i}:t;var i;const a=this.loadProperty(e,n);return this.schema.properties[a.name]=a.schema,r&&(a.isRequired=!0),a}removeProperty(e){this.schema.properties&&(delete this.schema.properties[e],Array.isArray(this.schema.required)&&(this.schema.required=this.schema.required.filter(t=>t!==e))),delete this.properties[e]}getProperty(e){return this.properties[e]}get editor(){return this.schema.editor}}class mt extends ut{parent;name;constructor(e,t,r){if(super(r),this.parent=e,this.name=t,"array"===r.type)throw new Error("Array property must be instantiated using ArrayPropertySchema");"object"!==r.type||r.properties||(r.properties={})}get isMulti(){return!1}get isReadOnly(){return!!this.schema.readOnly}set isReadOnly(e){this.schema.readOnly=e}get defaultValue(){return this.schema.default}set defaultValue(e){this.schema.default=e}get enum(){return this.schema.enum}set enum(e){this.schema.enum=e}get isRequired(){const e=this.parent.schema.required;return!!e&&e.includes(this.name)}set isRequired(e){let t=Array.isArray(this.parent.schema.required)?this.parent.schema.required:[];t=e?t.concat(this.name):t.filter(e=>e!==this.name),this.parent.schema.required=t}get type(){return this.schema.type}set type(e){this.schema.type!==e&&(this.schema.type=e,"object"!==e&&(this.properties={},this.schema.properties=void 0))}remove(){this.parent.removeProperty(this.name)}get isBoolean(){return"boolean"===this.type}get isString(){return"string"===this.type}get isNumber(){return"number"===this.type||"integer"===this.type}get isObject(){return"object"===this.type}}class pt extends mt{arraySchema;constructor(e,t,r){super(e,t,function(e){if("array"!==e.type)throw new Error("Expecting an array schema");if(e.items){if(Array.isArray(e.items))throw new Error("Tuple arrays are not supported")}else e.items={};return e.items}(r)),this.arraySchema=r}get isMulti(){return!0}}function ft(e){return(e=e.replace(/_/g," ").replace(/([a-z0-9])&([A-Z])/g,"$1 $2"))[0].toUpperCase()+e.slice(1)}function gt(e,t){if(t.editor)return t.editor;if(t.schema.format)return t.schema.format;switch(t.type){case"number":case"integer":return"number";case"boolean":return"checkbox";default:return"text"}}class yt{parent;schema;name;observer;constructor(e,t,r){this.parent=e,this.schema=t,this.name=r}get isRoot(){return!this.parent}get root(){return this.parent?this.parent.root:this}get path(){return this.parent?this.parent.path.concat(this.name):[]}get isScalar(){return!1}get isListItem(){return!1}get isObject(){return!1}get isList(){return!1}get title(){return this.schema.title||ft(this.name)}onChange(e){this.observer&&!1===this.observer(this)||this.parent&&this.parent.onChange(e)}}class vt extends yt{constructor(e,t,r){super(e,t,r)}get isObject(){return!0}getProperty(e){const t=this.schema.properties[e];return t.isMulti?new kt(this,t,this.getOrInitArrayProperty(e)):t.isObject?new xt(this,t,t.name,this.getOrInitObjectProperty(e)):new wt(this,t)}getOrInitObjectProperty(e){let t=this.value[e];return t||(this.value[e]=t={}),t}getOrInitArrayProperty(e){let t=this.value[e];return t||(this.value[e]=t=[]),t}setPropertyValue(e,t){return this.value[e]!==t&&(this.value[e]=t,!0)}getPropertyValue(e){return this.value[e]}get properties(){const e=[];for(const t of Object.values(this.schema.properties))t.isMulti?e.push(new kt(this,t,this.getOrInitArrayProperty(t.name))):t.isObject?e.push(new xt(this,t,t.name,this.getOrInitObjectProperty(t.name))):e.push(new wt(this,t));return e}[Symbol.iterator](){return this.properties[Symbol.iterator]()}}class bt extends vt{value;constructor(e,t={}){super(null,e instanceof ut?e:new ut(e),"#root"),this.value=t}}class xt extends vt{value;constructor(e,t,r,n){super(e,t,r),this.value=n}}class wt extends yt{constructor(e,t){super(e,t,t.name),void 0===e.value[this.name]&&void 0!==t.defaultValue&&(e.value[this.name]=t.defaultValue)}get isScalar(){return!0}set value(e){this.parent.setPropertyValue(this.name,e)&&this.onChange(this)}get value(){return this.parent.getPropertyValue(this.name)}getInputType(){return gt(this.name,this.schema)}}class kt extends yt{value;items=[];constructor(e,t,r){super(e,t,t.name),this.value=r;for(const e of this.value)this.add()}get isList(){return!0}newItem(e){return this.schema.isObject?new Nt(this,e):new Ct(this,e)}add(){const e=this.newItem(this.items.length);return this.items.push(e),e}remove(e){const t=this.value;if(e>=0&&e<this.items.length){this.items.splice(e,1);for(let e=0,t=this.items.length;e<t;e++){const t=this.items[e];t.index=e,t.name=String(e)}}Array.isArray(t)&&e>=0&&e<t.length&&(t.splice(e,1),this.onChange(this))}[Symbol.iterator](){return this.items[Symbol.iterator]()}item(e){if(e<0||e>=this.value.length)return;const t=this.value[e];return this.schema.isObject?new xt(this,this.schema,String(e),t):new Ct(this,e)}trim(){for(;void 0===this.items[this.items.length-1];)this.items.pop()}}class Nt extends vt{index;key;constructor(e,t){super(e,e.schema,String(t)),this.index=t,void 0===e.value[t]&&(e.value[t]={}),this.key=this.name+"@"+Date.now()}get isListItem(){return!0}set value(e){this.parent.value[this.index]=e}get value(){return this.parent.value[this.index]}}class Ct extends yt{index;key;constructor(e,t){super(e,e.schema,String(t)),this.index=t,void 0===e.value[t]&&void 0!==e.schema.defaultValue&&(e.value[t]=e.schema.defaultValue),this.key=this.name+"@"+Date.now()}get isScalar(){return!0}get isListItem(){return!0}set value(e){this.parent.value[this.index]=e}get value(){return this.parent.value[this.index]}getInputType(){return gt(this.name,this.schema)}}function St({label:t,required:r,children:n}){return e(s,{label:t,required:r,children:n})}function At({children:t}){return e("p",{className:"mt-2 text-sm text-gray-500",children:t})}function jt({children:t}){return e("p",{className:"mt-2 text-sm text-red-600",children:t})}function Ot({data:t,className:r}){const{theme:n}=i(),a=S(()=>{try{return JSON.stringify(t,null,2)}catch(e){return console.error("Failed to stringify JSON:",e),"{}"}},[t]);return e("div",{className:r,children:e(Ge,{value:a,language:"json",theme:"dark"===n?"vs-dark":"vs",minLines:10,maxLines:50,options:{readOnly:!0,domReadOnly:!0}})})}function Pt({value:t}){return e("div",{className:"flex flex-col gap-4",children:Object.entries(t).map(([t,r])=>e(Tt,{name:t,value:r},t))})}function Et({name:t}){return e("div",{className:"text-md font-semibold",children:ft(t)})}function It({children:t,className:r}){return e("div",{className:x("flex flex-col gap-4 py-2 pl-4 border-l-4 border-l-solid border-l-slate-100 dark:border-l-slate-600",r),children:t})}function Tt({name:r,value:n}){const i=Lt(n);switch(i.type){case Dt.Inline:return t("div",{className:"w-full flex gap-2",children:[e(Et,{name:r+":"}),e("p",{children:i.value})]});case Dt.Paragraph:return t("div",{children:[e(Et,{name:r}),e("p",{children:i.value})]});case Dt.Prose:return t("div",{className:"prose dark:prose-invert",children:[e(Et,{name:r}),e("div",{className:"vprose dark:prose-invert",children:i.value})]});case Dt.Array:return e($t,{name:r,value:n});case Dt.Object:return t("div",{children:[e(Et,{name:r}),e(It,{className:"mt-2",children:Object.entries(n).map(([t,r])=>e(Tt,{name:t,value:r},t))})]})}}function $t({name:r,value:n}){const i=n.join(" ").length,a=i/n.length,s="string"==typeof n[0]&&(i<80||i<400&&a<32),o=n.length>9;return t("div",s?{className:"flex gap-2 flex-wrap",children:[r&&e(Et,{name:r+":"}),n.map((t,r)=>e(l,{children:String(t)},r))]}:{children:[r&&e(Et,{name:r}),e("div",{className:"flex flex-col gap-2",children:n.map((t,r)=>e(Ft,{index:r,value:t,useBullet:o},r))})]})}function Ft({index:r,value:n,useBullet:i}){const a=i?e("span",{className:"text-xl",children:"•"}):t("span",{children:[r+1,"."]}),s=Lt(n);let o;switch(s.type){case Dt.Object:o=e(It,{children:Object.entries(n).map(([t,r])=>e(Tt,{name:t,value:r},t))});break;case Dt.Array:o=e($t,{value:n});break;case Dt.Prose:o=e("div",{className:"prose dark:prose-invert",children:s.value});break;default:o=e("div",{children:s.value})}return t("div",{className:"flex gap-4 hover:bg-slate-50 dark:hover:bg-slate-800 py-2 pr-2 pl-4",children:[e("div",{className:"font-semibold text-gray-600 dark:text-gray-400",children:a}),e("div",{children:o})]})}var Dt;function Lt(e){if(null==e)return{value:"-",type:Dt.Inline};if(Array.isArray(e))return{value:e,type:Dt.Array};const t=typeof e;if("string"===t){const t=e.length;let r;return t<80?r=Dt.Inline:t>400?r=Dt.Prose:(r=Dt.Paragraph,e=e.replace(/(?:\n\n)+/g,"\n\n")),{type:r,value:e}}return"number"===t||"boolean"===t?{value:String(e),type:Dt.Inline}:{value:e,type:Dt.Object}}function qt({value:t,viewCode:r=!1}){return t?e("div",{className:"relative w-full",children:r?e(Ot,{data:t}):e(Pt,{value:t})}):e("pre",{className:"whitespace-pre-wrap",children:"No Data to display"})}!function(e){e[e.Inline=0]="Inline",e[e.Paragraph=1]="Paragraph",e[e.Prose=2]="Prose",e[e.Array=3]="Array",e[e.Object=4]="Object"}(Dt||(Dt={}));const Rt=["#4f46e5","#06b6d4","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6"];class zt extends E{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`Chart rendering error (${this.props.chartType}):`,e,t)}render(){return this.state.hasError?e("div",{className:"flex items-center justify-center h-full bg-red-50 dark:bg-red-950 rounded-md p-4",children:t("div",{className:"text-center",children:[t("p",{className:"text-sm font-medium text-red-600 dark:text-red-400",children:["Cannot render ",this.props.chartType," chart"]}),e("p",{className:"text-xs text-red-500 dark:text-red-500 mt-1 max-w-xs truncate",children:this.state.error?.message||"Unknown error"})]})}):this.props.children}}function Kt(e){if(!isFinite(e))return String(e);const t=Math.abs(e);return t>=1e9?(e/1e9).toFixed(1)+"B":t>=1e6?(e/1e6).toFixed(1)+"M":t>=1e3?(e/1e3).toFixed(1)+"K":e.toLocaleString()}const Vt=P(function({spec:n}){const{chart:i,title:a,description:s,data:o,xKey:l,series:c,yAxis:d,options:h,nameKey:u,valueKey:m,yKey:p,zKey:f,axisKey:g,dataKey:y}=n,[v,b]=k(!1),[x,w]=k(!1),C=N(null),S=A(async()=>{if(C.current&&!x)try{const e=await Q(C.current,{backgroundColor:"#ffffff",pixelRatio:2}),t=await fetch(e),r=await t.blob();await navigator.clipboard.write([new ClipboardItem({"image/png":r})]),w(!0),setTimeout(()=>w(!1),2e3)}catch(e){console.error("Failed to copy chart:",e)}},[x]),j=A(async()=>{if(C.current&&!v){b(!0);try{const e=await Q(C.current,{backgroundColor:"#ffffff",pixelRatio:2}),t=document.createElement("a");t.download=`${a||"chart"}.png`,t.href=e,t.click()}catch(e){console.error("Failed to export chart:",e)}finally{b(!1)}}},[a,v]),O=c||[],P=o||[],E=t(r,{children:[e(ee,{dataKey:l,tick:{fontSize:12}}),e(te,{yAxisId:"left",tickFormatter:Kt,label:d?.left?.label?{value:d.left.label,angle:-90,position:"insideLeft"}:void 0}),O.some(e=>"right"===e.yAxisId)&&e(te,{yAxisId:"right",orientation:"right",tickFormatter:Kt,label:d?.right?.label?{value:d.right.label,angle:-90,position:"insideRight"}:void 0})]}),I=t(r,{children:[e(re,{strokeDasharray:"3 3"}),e(ne,{formatter:e=>"number"==typeof e?Kt(e):String(e)}),e(ie,{}),h?.referenceZero&&e(ae,{y:0,stroke:"#999",strokeDasharray:"3 3"})]}),T=()=>O.map((t,r)=>{const n=t.color||Rt[r%Rt.length],a=t.yAxisId||"left";return"line"===i?e(he,{type:"monotone",dataKey:t.key,name:t.label||t.key,stroke:n,dot:t.dot??!1,yAxisId:a},t.key):"area"===i?e(ue,{type:"monotone",dataKey:t.key,name:t.label||t.key,stroke:n,fill:n,fillOpacity:.3,stackId:h?.stacked?t.stackId||"stack":void 0,yAxisId:a},t.key):"bar"===i||"bar"===t.type?e(me,{dataKey:t.key,name:t.label||t.key,fill:n,stackId:h?.stacked?t.stackId||"stack":void 0,yAxisId:a},t.key):"area"===t.type?e(ue,{type:"monotone",dataKey:t.key,name:t.label||t.key,stroke:n,fill:n,fillOpacity:.3,stackId:h?.stacked?t.stackId||"stack":void 0,yAxisId:a},t.key):e(he,{type:"monotone",dataKey:t.key,name:t.label||t.key,stroke:n,dot:t.dot??!1,yAxisId:a},t.key)});return e("div",{className:"bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm",children:t("div",{className:"flex flex-col gap-2 p-3",children:[t("div",{className:"flex items-center justify-between",children:[e("span",{className:"font-medium text-sm text-gray-900 dark:text-gray-100",children:a||"Chart"}),t("div",{className:"flex items-center gap-2 print:hidden chart-actions",children:[t("button",{onClick:S,disabled:x,className:"text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50 flex items-center gap-1",title:"Copy to clipboard",children:[e(x?D:L,{className:"w-3 h-3"}),x?"Copied":"Copy"]}),t("button",{onClick:j,disabled:v,className:"text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1",title:"Export as PNG",children:[e(q,{className:"w-3 h-3"}),v?"Exporting...":"Export"]})]})]}),s&&e("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:s}),e("div",{ref:C,className:"bg-white dark:bg-gray-900 rounded",style:{width:"100%",height:280,minWidth:0},children:e(zt,{chartType:i,children:e(se,{width:"100%",height:"100%",children:(()=>{switch(i){case"bar":return t(de,{data:P,children:[E,I,T()]});case"line":return t(ce,{data:P,children:[E,I,T()]});case"area":return t(le,{data:P,children:[E,I,T()]});case"composed":default:return t(oe,{data:P,children:[E,I,T()]});case"pie":return t(pe,{children:[e(fe,{data:P,dataKey:m||"value",nameKey:u||"name",cx:"50%",cy:"50%",innerRadius:h?.innerRadius||0,outerRadius:100,label:!1!==h?.showLabels,children:P.map((t,r)=>e(ge,{fill:Rt[r%Rt.length]},`cell-${r}`))}),e(ne,{formatter:e=>"number"==typeof e?Kt(e):String(e)}),e(ie,{})]});case"scatter":return(()=>{const r=l,n=p||"y";return t(ye,{children:[e(re,{strokeDasharray:"3 3"}),e(ee,{dataKey:r,name:r,tick:{fontSize:12}}),e(te,{dataKey:n,name:n,tickFormatter:Kt}),e(ne,{formatter:e=>"number"==typeof e?Kt(e):String(e)}),e(ie,{}),O.length>0?O.map((t,r)=>e(ve,{name:t.label||t.key,data:P,fill:t.color||Rt[r%Rt.length]},t.key)):e(ve,{name:"Data",data:P,fill:Rt[0]})]})})();case"radar":return(()=>{const r=g||l||"axis";return t(be,{cx:"50%",cy:"50%",outerRadius:100,data:P,children:[e(xe,{}),e(we,{dataKey:r,tick:{fontSize:11}}),e(ke,{tickFormatter:Kt}),O.map((t,r)=>e(Ne,{name:t.label||t.key,dataKey:t.key,stroke:t.color||Rt[r%Rt.length],fill:t.color||Rt[r%Rt.length],fillOpacity:.3},t.key)),e(ne,{formatter:e=>"number"==typeof e?Kt(e):String(e)}),e(ie,{})]})})();case"radialBar":return(()=>{const r=u||"name",n=m||"value",i=h?.startAngle??180,a=h?.endAngle??0;return t(Ce,{cx:"50%",cy:"50%",innerRadius:h?.innerRadius??30,outerRadius:100,barSize:15,data:P,startAngle:i,endAngle:a,children:[e(Se,{label:{position:"insideStart",fill:"#fff",fontSize:11},background:!0,dataKey:n,children:P.map((t,r)=>e(ge,{fill:Rt[r%Rt.length]},`cell-${r}`))}),e(ne,{formatter:e=>"number"==typeof e?Kt(e):String(e)}),e(ie,{iconSize:10,layout:"vertical",verticalAlign:"middle",align:"right",formatter:(e,t)=>{const i=P.find(i=>i[r]===e||i[n]===t.payload?.value);return i?i[r]:e}})]})})();case"funnel":return(()=>{const r=u||"name",n=m||"value";return t(Ae,{children:[e(ne,{formatter:e=>"number"==typeof e?Kt(e):String(e)}),t(je,{dataKey:n,data:P,isAnimationActive:!0,children:[P.map((t,r)=>e(ge,{fill:Rt[r%Rt.length]},`cell-${r}`)),!1!==h?.showLabels&&e(Oe,{position:"center",fill:"#fff",stroke:"none",dataKey:r})]})]})})();case"treemap":return e(Pe,{data:P,dataKey:y||m||"value",aspectRatio:4/3,stroke:"#fff",fill:"#4f46e5",content:({x:n,y:i,width:a,height:s,name:o,value:l,index:c})=>t("g",{children:[e("rect",{x:n,y:i,width:a,height:s,style:{fill:Rt[c%Rt.length],stroke:"#fff",strokeWidth:2}}),a>50&&s>30&&t(r,{children:[e("text",{x:n+a/2,y:i+s/2-7,textAnchor:"middle",fill:"#fff",fontSize:12,children:o}),e("text",{x:n+a/2,y:i+s/2+10,textAnchor:"middle",fill:"#fff",fontSize:11,children:Kt(l)})]})]})})}})()})})})]})})},(e,t)=>JSON.stringify(e.spec)===JSON.stringify(t.spec)),_t=["artifact:","image:","store:","document:","document://","collection:"];function Mt(e){return _t.some(t=>e.startsWith(t))?e:G(e)}function Ut(){return e=>{X(e,"html",(e,t,r)=>{if(e.value&&/<!--[\s\S]*?-->/.test(e.value)&&r&&"number"==typeof t&&r.children)return r.children.splice(t,1),[Y,t]})}}function Wt({children:t,components:r,remarkPlugins:n=[],removeComments:i=!0,artifactRunId:a}){const{client:s}=Ee(),o=[Z,...n];i&&o.push(Ut);const l=w.useMemo(()=>{const t=r||{},n=t.code,i=t.a,o=t.img;return{...t,code:({node:t,className:r,children:i,...a})=>{const s=/language-(\w+)/.exec(r||""),o=!s,l=s?s[1]:"";if(!o&&("chart"===l||r?.includes("language-chart")))try{const t=String(i||"").trim(),r=JSON.parse(t);if(r&&r.chart&&Array.isArray(r.data))return e(Vt,{spec:r})}catch(e){console.warn("Failed to parse chart spec:",e)}return"function"==typeof n?e(n,{node:t,className:r,...a,children:i}):e("code",{...a,className:o?"px-1.5 py-0.5 rounded":"text-muted",children:i})},a:t=>{const{node:r,href:n,children:o,...l}=t,c=n||"",d=c.startsWith("artifact:"),h=d?c.replace(/^artifact:/,"").trim():"",u=c.startsWith("image:"),m=u?c.replace(/^image:/,"").trim():"",[p,f]=w.useState(void 0);if(w.useEffect(()=>{let e=!1;return(async()=>{if(d||u)try{if(d)if(a&&!h.startsWith("agents/")){const{url:t}=await s.files.getArtifactDownloadUrl(a,h,"attachment");e||f(t)}else{const{url:t}=await s.files.getDownloadUrl(h);e||f(t)}else if(u){const{url:t}=await s.files.getDownloadUrl(m);e||f(t)}}catch(t){const r=d?h:m;console.error("Failed to resolve link in MarkdownRenderer:",r,t),e||f(void 0)}else f(void 0)})(),()=>{e=!0}},[d,h,u,m,a,s]),c.startsWith("document://")){const t=c.replace(/^document:\/\//,"").trim(),n=t?`/store/objects/${t}`:c;return"function"==typeof i?e(i,{node:r,href:n,...l,children:o}):e("a",{href:n,...l,target:"_blank",rel:"noopener noreferrer",children:o})}if(c.startsWith("store:")){const t=c.replace(/^store:/,"").trim(),n=t?`/store/objects/${t}`:c;return"function"==typeof i?e(i,{node:r,href:n,...l,children:o}):e("a",{href:n,...l,target:"_blank",rel:"noopener noreferrer",children:o})}if(c.startsWith("collection:")){const t=c.replace(/^collection:/,"").trim(),n=t?`/store/collections/${t}`:c;return"function"==typeof i?e(i,{node:r,href:n,...l,children:o}):e("a",{href:n,...l,target:"_blank",rel:"noopener noreferrer",children:o})}if(!d&&!u&&"function"==typeof i)return e(i,{node:r,href:n,...l,children:o});if(d){return e("a",{href:p||"#",...l,target:"_blank",rel:"noopener noreferrer",children:o})}if(u){return e("a",{href:p||"#",...l,target:"_blank",rel:"noopener noreferrer",children:o})}return e("a",{href:n,...l,target:"_blank",rel:"noopener noreferrer",children:o})},img:t=>{const{node:r,src:n,alt:i,...l}=t,c=n||"",d=c.startsWith("artifact:"),h=c.startsWith("image:"),u=d||h,m=u?c.replace(/^artifact:/,"").replace(/^image:/,"").trim():"",[p,f]=w.useState(void 0);return w.useEffect(()=>{let e=!1;return(async()=>{if(u)try{if(d)if(a&&!m.startsWith("agents/")){const{url:t}=await s.files.getArtifactDownloadUrl(a,m,"inline");e||f(t)}else{const{url:t}=await s.files.getDownloadUrl(m);e||f(t)}else if(h){const{url:t}=await s.files.getDownloadUrl(m);e||f(t)}}catch(t){console.error("Failed to resolve image link in MarkdownRenderer:",m,t),e||f(void 0)}else f(void 0)})(),()=>{e=!0}},[u,m,a,s]),u||"function"!=typeof o?u?p?e("img",{src:p,alt:i,...l}):null:e("img",{src:n,alt:i,...l}):e(o,{node:r,src:n,alt:i,...l})}}},[r,s,a]);return e(J,{remarkPlugins:o,components:l,urlTransform:Mt,children:t})}const Bt=j(void 0);function Ht(){return O(Bt)}const Jt=Symbol("__SLOT_NAME");function Gt(e,t){const r=[];return I.forEach(e,e=>{!function(e,t,r){let n;T(e)&&(n=e.type[Jt])?r[n]=e:t.push(e)}(e,r,t)}),r.length>1?r:r[0]}function Zt(e,t){t[Jt]=e}function Xt(e){return e?"boolean"==typeof e?{enabled:e}:e:{enabled:!1}}function Yt(t){const r={};if(Gt(t.children,r),!r.content)throw new Error("Popover must provide a content slot");const n=r.trigger?.props,i=r.content.props;return e(Qt,{...t,trigger:n,content:i})}function Qt({middleware:r,offset:n,trigger:i,dismiss:a=!0,content:s,placement:o,strategy:l,zIndex:c=40}){const[d,h]=k(!1),u=Fe({open:d,placement:o,strategy:l,onOpenChange:h,middleware:r||[Ie(n||4),Te(),$e()],whileElementsMounted:De}),{floatingStyles:m,refs:{setReference:p,setFloating:f},context:g}=u,y=Le(g,Xt(a)),v=qe(g,Xt(!(b=i)||b.hover||b.click?b?.click:{enabled:!0}));var b;const w=Re(g,Xt(function(e){return!0===e?.hover?{enabled:!0,handleClose:Me({blockPointerEvents:!0}),restMs:0}:e?.hover}(i))),{getReferenceProps:N,getFloatingProps:C}=ze([y,v,w]),{isMounted:S,styles:A}=Ke(g,s.transition);return t(Bt.Provider,{value:{...u,close:()=>h(!1)},children:[i&&e("div",{className:x(i.className,"inline-block"),ref:p,...N(),children:i.children}),e(Ve,{children:S&&e("div",{ref:f,style:{...m,zIndex:c},...C(),children:e(_e,{context:g,children:e("div",{className:x(s.className,"bg-popover rounded-md text-popover-foreground max-w-md"),style:A,children:s.children})})})})]})}function er(e){return null}function tr(e){return null}function rr({percent:t}){return e("div",{className:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700",children:e("div",{className:"bg-blue-600 h-2.5 rounded-full",style:{width:`${t}%`}})})}function nr({className:r,properties:n}){return e(c,{className:r,children:e("tbody",{children:n.map(r=>t("tr",{children:[t("td",{className:"w-1/3 font-semibold gap-2",children:[e("span",{children:r.name}),r.description&&e(d,{description:r.description,placement:"top",children:e(R,{className:"size-3 ml-2 text-muted-foreground"})})]}),e("td",{className:"w-2/3",children:r.value??"undefined"})]},r.name))})})}var ir;function ar(e,t){let r="any"===t.name?void 0:t.isNullable?[t.name,"null"]:t.name;if(t.isArray)if(e.type="array",e.properties=void 0,!e.items||Array.isArray(e.items))e.items={type:r,properties:t.isObject?{}:void 0};else{const n=e.items;n.type=r,t.isObject&&!n.properties&&(n.properties={})}else e.type=r,e.items=void 0,t.isObject?e.properties||(e.properties={}):e.properties=void 0}function sr(e){let t,r=!1,n=!1;const i=e.type;if(Array.isArray(i))for(const e of i)"null"===e?r=!0:t||(t=e);else t=i;t||(t="any"),"array"===t&&(n=!0,t=function(e){if(!e)return"any";let t;t=Array.isArray(e)?or(e[0].type):or(e.type);"array"!==t&&"null"!==t||(t="any");return t}(e.items));let a=t;switch(e.editor){case"textarea":a="text";break;case"media":a="media";break;case"document":a="document"}return{isNullable:r,isArray:n,isObject:"object"===t,name:a}}function or(e){return e?Array.isArray(e)?e.find(e=>"null"!==e)||"any":e:"any"}Zt("trigger",er),Zt("content",tr),Yt.Trigger=er,Yt.Content=tr,function(e){e.string="string",e.number="number",e.integer="integer",e.boolean="boolean",e.object="object",e.any="any",e.text="text",e.media="media",e.document="document"}(ir||(ir={}));let lr=0;class cr{source;onChange=()=>{};schema;root;constructor(e,t){this.schema=e?"string"==typeof e?JSON.parse(e):e:{title:t,type:"object",properties:{}},this.schema.properties||(this.schema.properties={}),this.root=new dr("",this.schema,this),this.root.loadChildren()}get isEmpty(){return!this.root.children||0===this.root.children.length}get children(){return this.root.children}reload(){return this.root=new dr("",this.schema,this),this.root.loadChildren(),this.onChange?.(this),this}withSource(e,t){return this.source={uri:t,name:e},this}withChangeListener(e){return this.onChange=e,this}replaceSchema(e){this.schema=e||{title:this.schema.title,type:"object",properties:{}},this.reload()}clone(){const e=new cr(this.schema);return e.source=this.source,this.onChange&&e.withChangeListener(this.onChange),e}}class dr{schema;loader;parent;name;isRequired=!1;type;children;constructor(e,t,r,n){if(this.schema=t,this.loader=r,this.parent=n,this.name=e,this.type=sr(t),this.parent){let t=this.parent._getPropertiesSchema().required;this.isRequired=!(!t||!Array.isArray(t))&&t.includes(e)}}get title(){return this.schema.title}set title(e){this.schema.title=e}get description(){return this.schema.description}set description(e){this.schema.description=e}get isParent(){return this.type.isObject}get isNew(){return!!this.schema.isNew}set isNew(e){e?this.schema.isNew=!0:delete this.schema.isNew}resetIsNew(){const e=this.isNew;return this.isNew=!1,e}getNameSignature(){return`${this.name}${this.isRequired?"":"?"}`}getTypeSignature(){return`${this.type.name}${this.type.isArray?"[]":""}${this.type.isNullable?"?":""}`}getSignature(){return`${this.getNameSignature()}: ${this.getTypeSignature()}`}reloadTree(){this.loader.reload()}loadChildren(){this.children=[],this.schema.items&&this.schema.items.properties?this._loadChildren(this.schema.items.properties):this.schema.properties&&this._loadChildren(this.schema.properties)}_loadChildren(e){for(const t of Object.keys(e)){const r=e[t],n=new dr(t,r,this.loader,this);this.children.push(n),n.isParent&&n.loadChildren()}}_getPropertiesSchema(){return this.type.isArray&&this.type.isObject?this.schema.items:this.schema}findAvailableChildName(e){const t=this._getPropertiesSchema().properties||{};let r;do{r=e+ ++lr}while(t[r]);return r}addChild(e,t,r=!1){if(!this.type.isObject)throw new Error("Cannot add child to a non object node");this.children||(this.children=[]);const n=function(e,t,r,n=!1){if("object"!==e.type)throw new Error("Cannot add property to a non-object schema");e.properties||(e.properties={});const i={};return ar(i,r),e.properties[t]=i,n&&(Array.isArray(e.required)?function(e,t){e.includes(t)||e.push(t)}(e.required,t):e.required=[t]),i}(this._getPropertiesSchema(),e,t,r),i=new dr(e,n,this.loader,this);return this.children.push(i),i}remove(){if(this.parent&&this.parent.type.isObject){return function(e,t){e.properties&&(delete e.properties[t],Array.isArray(e.required)&&(e.required=e.required.filter(e=>e!==t)))}(this.parent._getPropertiesSchema(),this.name),this.parent.children&&(this.parent.children=this.parent.children.filter(e=>e.name!==this.name)),!0}return!1}update(e){let t=!1;null!=e.name&&this.name!==e.name&&(this.parent&&function(e,t,r){if(e.properties){const n=e.properties,i={};for(const e of Object.keys(n)){const a=n[e];e===t?i[r]=a:i[e]=a}e.properties=i}e.required&&(e.required=e.required.map(e=>e===t?r:e))}(this.parent._getPropertiesSchema(),this.name,e.name),this.name=e.name,t=!0),null!=e.isRequired&&this.isRequired!==e.isRequired&&(this.parent&&function(e,t,r){if(Array.isArray(e.required)){const n=e.required.indexOf(t);r?n<0&&e.required.push(t):n>-1&&e.required.splice(n,1)}else r&&(e.required=[t])}(this.parent._getPropertiesSchema(),this.name,e.isRequired),this.isRequired=e.isRequired,t=!0);let r=e.type?.name;"any"===r&&(r=void 0);const n=r!==this.schema.type;return e.type&&(ar(this.schema,e.type),this.type=e.type,this.type.isObject?this.children||(this.children=[]):this.children=void 0,t=!0),this.schema.editor&&null===e.editor?(this.schema.editor=void 0,t=!0):e.editor?(this.schema.editor=e.editor,t=!0):n&&(this.schema.editor=void 0,t=!0),e.description!==this.description&&(this.description=e.description,t=!0),t}getUpdateFromNameAndTypeSignature(e,t){let r=e.trim(),n=!0;r.endsWith("?")&&(r=r.substring(0,r.length-1).trim(),n=!1);const i=function(e){let t=!1,r=!1;(e=e.trim()).endsWith("?")&&(r=!0,e=e.substring(0,e.length-1).trim()),e.endsWith("[]")&&(t=!0,e=e.substring(0,e.length-2).trim());const n=ir[e];if(!n)throw new Error(`Unknown type "${e}"`);return{name:n,isArray:t,isNullable:r,isObject:n===ir.object}}(t);let a;return"text"===i.name?(i.name=ir.string,a="textarea"):"media"===i.name?(i.name=ir.any,a="media"):"document"===i.name?(i.name=ir.any,a="document"):a=null,{name:r,type:i,isRequired:n,editor:a}}updateFromNameAndTypeSignature(e,t){return this.update(this.getUpdateFromNameAndTypeSignature(e,t))}updateFromSignature(e){const t=(e=e.trim()).indexOf(":");if(t<0)throw new Error("Expecting a name and a type separated by a colon");const r=e.substring(0,t),n=e.substring(t+1);return this.updateFromNameAndTypeSignature(r,n)}}function hr(e){return{name:e.getNameSignature(),type:e.getTypeSignature(),description:e.description}}const ur=function(){const e=Object.values(ir),t=[...e];for(const r of e)t.push(r+"[]");return e.sort(),t}();function mr({value:r,onChange:n,onCancel:i,onSave:a}){const[s,l]=k(!1);if(!r)return null;return t("div",{className:"flex items-center",children:[e("div",{className:"flex-1",children:e(pr,{value:r.name,onChange:e=>{n({...r,name:e})},onCancel:i,onSave:a})}),e("div",{className:"px-1 font-semibold",children:":"}),e("div",{className:"flex-1",children:e(fr,{value:r.type,onChange:e=>{n({...r,type:e})},onCancel:i,onSave:a})}),t("div",{children:[e(o,{variant:"ghost",size:"xs",onClick:()=>l(!0),title:"Edit description",children:e(z,{className:"size-4"})}),e(gr,{value:r.description,isOpen:s,onClose:e=>{void 0!==e&&"string"==typeof e&&n({...r,description:e},!0),l(!1)}})]})]})}function pr({value:t,onChange:r,onCancel:n,onSave:i}){const s=N(null);C(()=>{s.current?.focus()},[]);return e("input",{onKeyUp:e=>{switch(e.key){case"Enter":i?.();break;case"Escape":n?.()}},ref:s,value:t,onChange:e=>{r(e.target.value)},className:a.INPUT_UNSTYLED,style:{fontSize:"inherit",width:"",display:"inline"}})}function fr({value:t,onChange:r,onCancel:n,onSave:i}){return e(h,{className:a.INPUT_UNSTYLED,options:ur,value:t||"",onBlur:()=>{i?.()},onChange:r,onKeyDown:(e,t)=>{t||("Enter"===e.key?i?.():"Escape"===e.key&&n?.())},popupClass:"schema-type-suggest-popup z-90"})}function gr({value:r,isOpen:n,onClose:i}){return t(u,{isOpen:n,onClose:i,children:[e(m,{children:"Edit description"}),e(yr,{value:r,onSave:i})]})}function yr({value:n,onSave:i}){const a=N(null),[s,l]=k(n||"");return C(()=>{a.current&&a.current.focus()},[a.current]),t(r,{children:[e(p,{className:"h-max",children:e("textarea",{ref:a,className:"dark:bg-gray-800 w-full h-full dark:text-white",value:s,onChange:e=>l(e.target.value)})}),e(f,{children:e(o,{onClick:()=>i(s),children:"Save Changes"})})]})}function vr({value:r}){return r?t("div",{className:"w-full flex items-baseline",children:[e("div",{children:r.name||""}),e("div",{className:"ml-2 text-sm text-muted",children:r.type||""})]}):null}function br(e){const[t,r]=k(new cr(e||{type:"object",properties:{}}).withChangeListener(e=>{r(e.clone())}));return t}const xr="block text-sm sm:leading-6 rounded-md border-0 py-1.5 px-4",wr=`${xr} hover:shadow-xs hover:ring-1 hover:ring-inset hover:ring-ring`,kr=`${xr} shadow-xs ring-1 ring-inset ring-ring`;function Nr({value:r,onChange:n,onDelete:i,outlineOnHover:a=!1,editOnClick:s=!0,placeholder:o,viewer:l,editor:c,skipClickOutside:d,isEditing:h=!1,readonly:u=!1,onValidate:m}){const{on:p,off:f,isOn:y}=g(h),[v,b]=k();return t("div",{className:"",children:[y&&!u?e(Sr,{value:r,onSave:e=>{if(m){const t=m(e);if(t)return void b(t);b(void 0)}n(e)&&f()},onCancel:f,editor:c,skipClickOutside:e=>!!d&&d(e)}):e(Cr,{value:r,onEdit:p,viewer:l,placeholder:o,outlineOnHover:a,editOnClick:s,onDelete:i,readonly:u}),v&&e("div",{className:"text-red-500 text-sm",children:v})]})}function Cr({viewer:r,value:n,onEdit:i,editOnClick:a,outlineOnHover:s,placeholder:l,onDelete:c,readonly:d}){const h="invisible group-hover:visible";return t("div",{tabIndex:0,onKeyUp:e=>{"Enter"===e.key&&i()},onClick:()=>{a&&i()},className:x("flex justify-start items-center group",s?wr:xr,{"cursor-pointer":a}),children:[e(r,{value:n,placeholder:l}),t("div",{className:"ml-auto flex space-x-2",children:[!d&&c&&e(o,{variant:"ghost",size:"sm",className:h,onClick:c,children:e(F,{className:"size-4"})}),d?null:e(o,{variant:"ghost",size:"sm",className:h,onClick:i,children:e(K,{className:"size-4"})})]})]})}function Sr({editor:t,value:r,onSave:n,onCancel:i,skipClickOutside:a}){const[s,o]=k(r),l=N(r),[c,d]=k(null),h=()=>{n(l.current)},u=y(h,a);return e("div",{ref:u,children:e("div",{className:kr,children:e("div",{className:"w-full",onClick:e=>e.stopPropagation(),children:e(t,{value:s,onChange:(e,t=!1)=>{o(e),l.current=e,t&&(c&&clearTimeout(c),d(setTimeout(()=>{n(e)},500)))},onSave:h,onCancel:i})})})})}function Ar(e){const t=e.target;return!(!t.closest||!t.closest(".schema-type-suggest-popup"))}function jr({schema:r,readonly:n=!1}){return t("ul",{className:"",children:[r.children.map(e=>Or(e,n)),n?null:e($r,{parent:r.root})]})}function Or(t,r){return t.isParent?e(Er,{property:t,readonly:r},t.name):e(Pr,{node:t,readonly:r},t.name)}function Pr({node:t,readonly:r}){return e("li",{children:e(Tr,{property:t,readonly:r})})}function Er({property:r,readonly:n}){const[i,a]=k(!0);return t("li",{children:[t("div",{className:"flex items-center w-full",children:[e("button",{onClick:()=>a(!i),children:e(i?V:_,{className:"size-4"})}),e("div",{className:"flex-1",children:e(Tr,{property:r,readonly:n})})]}),i&&t("ul",{className:"ml-4 border-l border-gray-400 border-dashed",children:[(r.children||[]).map(e=>Or(e,n)),n?null:e($r,{parent:r})]})]})}function Ir(e){return e?/^[a-zA-Z0-9_]+[?]?$/.test(e)?void 0:"Only letters, numbers, underscores or question mark are allowed (a-zA-Z0-9_?)":"Name is required"}function Tr({property:t,readonly:r}){const n=v(),i=t.resetIsNew(),a=hr(t);return e(Nr,{value:a,onChange:e=>{try{e.description&&"string"!=typeof e.description&&(e.description=void 0);const r=t.getUpdateFromNameAndTypeSignature(e.name,e.type);t.update({...r,description:e.description})&&t.reloadTree()}catch(e){return n({status:"error",title:"Invalid property declaration",description:e.message,duration:9e3}),!1}return!0},onDelete:()=>{t.remove(),t.reloadTree()},editor:mr,viewer:vr,outlineOnHover:!0,isEditing:i,skipClickOutside:Ar,readonly:r,onValidate:e=>Ir(e.name)})}function $r({parent:r}){return t(o,{variant:"ghost",onClick:()=>{const e=r.findAvailableChildName("new_property_");r.addChild(e,{isObject:!1,isArray:!1,isNullable:!1,name:ir.string},!0).isNew=!0,r.reloadTree()},children:[e($,{className:"size-4"}),"Add property"]})}function Fr({content:t,...r}){const n=N(null);return C(()=>{if(!n.current)return;const e=(new DOMParser).parseFromString(t,"image/svg+xml").querySelector("svg");if(!e)return console.warn("SvgIcon: No <svg> element found in provided string"),void(n.current.innerHTML="");r&&Object.entries(r).forEach(([t,r])=>{if(null==r)return;const n="className"===t?"class":t;e.setAttribute(n,String(r))}),n.current.innerHTML="",n.current.appendChild(e)},[t,r]),e("span",{ref:n})}function Dr(t){return r=>e(Fr,{content:t,...r})}function Lr({onDrop:r,message:n,buttonLabel:i="Upload Files",allowFolders:a=!0,className:s=""}){const[l,c]=k(!1),d=N(null),h=e=>{if(e.target.files&&e.target.files.length>0){const t=Array.from(e.target.files);if(t.some(e=>e.webkitRelativePath&&e.webkitRelativePath.includes("/"))){const e=new Set(t.map(e=>e.webkitRelativePath?.split("/")[0]).filter(Boolean)).size,n=t.length,i=1===e?`Preparing to upload 1 folder with ${n} files...`:`Preparing to upload ${e} folders with ${n} files...`,a={count:t.length,message:i};r(t,a)}else{const e={count:t.length,message:`Preparing to upload ${t.length} file${1===t.length?"":"s"}...`};r(t,e)}}};return t("div",{className:`flex flex-col items-center justify-center py-12 border-2 rounded-lg transition-colors ${l?"border-color-primary bg-color-primary/10":"border-dashed border-color-border"} ${s}`,onDragOver:e=>{e.preventDefault(),e.dataTransfer.types.includes("Files")&&c(!0)},onDragLeave:e=>{e.preventDefault(),d.current&&!d.current.contains(e.relatedTarget)&&c(!1)},onDrop:async e=>{if(e.preventDefault(),c(!1),e.dataTransfer.items&&e.dataTransfer.items.length>0){const t=Array.from(e.dataTransfer.items),n=[],i=new Set,a=async e=>{if(e.isFile){const t=await new Promise(t=>{e.file(r=>{Object.defineProperty(r,"webkitRelativePath",{writable:!0,value:e.fullPath.substring(1)}),t(r)})});!t.name.startsWith(".")&&t.size>0&&n.push(t);const r=e.fullPath.substring(1).split("/").slice(0,-1).join("/");r&&i.add(r)}else if(e.isDirectory){const t=e.createReader(),r=await new Promise(e=>{t.readEntries(t=>{e(t)})});await Promise.all(r.map(a));const n=e.fullPath.substring(1);n&&i.add(n)}};try{if(await Promise.all(t.map(e=>{const t=e.webkitGetAsEntry?e.webkitGetAsEntry():e;return t?a(t):Promise.resolve()})),n.length>0){const e=new Set(Array.from(i).map(e=>e.split("/")[0]).filter(Boolean)).size,t=n.length;let a="";a=e>0?1===e?`Preparing to upload 1 folder with ${t} files...`:`Preparing to upload ${e} folders with ${t} files...`:`Preparing to upload ${t} file${1===t?"":"s"}...`,r(n,{count:n.length,message:a})}}catch(t){console.error("Error processing dropped files:",t);const n=Array.from(e.dataTransfer.files);n.length>0&&r(n)}}else if(e.dataTransfer.files&&e.dataTransfer.files.length>0){const t=Array.from(e.dataTransfer.files);r(t)}},children:[e(M,{className:"h-12 w-12 mb-3 transition-colors "+(l?"text-primary":"text-muted/50")}),e("p",{className:"text-muted",children:n}),t("div",{className:"flex gap-2 justify-center mt-2",children:[e(o,{onClick:()=>{const e=document.createElement("input");e.type="file",e.multiple=!0,e.accept="*",e?.click(),e.onchange=e=>{h(e)}},children:i}),a&&e(o,{onClick:()=>{const e=document.createElement("input");e.type="file",e.multiple=!0,e.accept="*",e.webkitdirectory=!0,e?.click(),e.onchange=e=>{h(e)}},children:"Select Folder"})]})]})}function qr({title:r,count:n,icon:i=e(U,{className:"h-4 w-4 text-green-500"}),items:a}){const[s,o]=k(!1);return t("div",{className:"border border-color-border rounded-md overflow-hidden",children:[t("div",{className:"flex items-center justify-between p-3 bg-color-muted/10 cursor-pointer",onClick:()=>o(!s),children:[t("div",{className:"flex items-center",children:[e("span",{className:"mr-2",children:i}),e("span",{className:"font-medium",children:r}),e("span",{className:"ml-2 px-2 py-0.5 bg-color-muted/20 rounded-full text-xs",children:n})]}),e("button",{className:"text-muted",children:e("svg",{className:"h-5 w-5 transition-transform "+(s?"transform rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]}),s&&e("div",{className:"p-3 border-t border-color-border max-h-48 overflow-y-auto",children:a.length>0?e("ul",{className:"space-y-1",children:a.map((t,r)=>e("li",{className:"text-sm py-1 px-2 rounded hover:bg-color-muted/10",children:t},r))}):e("div",{className:"text-sm text-muted py-2",children:"No items to display"})})]})}function Rr({files:r,className:n="",location:i,collection:a}){const s=r.filter(e=>"success"===e.status),o=r.filter(e=>"updated"===e.status),l=r.filter(e=>"skipped"===e.status),c=r.filter(e=>"failed"===e.status),d=s.length,h=o.length,u=l.length,m=c.length,p=r.length;return t("div",{className:`flex flex-col py-2 ${n}`,children:[t("div",{className:"flex items-center mb-4",children:[e("div",{className:"size-8 mr-4 rounded-full bg-success/10 flex items-center justify-center",children:e(U,{className:"size-4 text-success"})}),e("div",{children:t("p",{className:"text-muted",children:[p," file",1!==p?"s":""," processed",a?` in collection '${a}'`:"",i?` in folder '${i}'`:""]})})]}),t("div",{className:"space-y-3 mt-2",children:[d>0&&e(qr,{title:"Successfully Uploaded",count:d,icon:e(U,{className:"h-4 w-4 text-green-500"}),items:s.map(e=>e.name)}),h>0&&e(qr,{title:"Successfully Updated",count:h,icon:e(U,{className:"h-4 w-4 text-blue-500"}),items:o.map(e=>e.name)}),u>0&&e(qr,{title:"Skipped (Already Existed)",count:u,icon:e(W,{className:"h-4 w-4 text-amber-500"}),items:l.map(e=>e.name)}),m>0&&e(qr,{title:"Failed to Upload",count:m,icon:e(B,{className:"h-4 w-4 text-red-500"}),items:c.map(e=>e.name)})]})]})}const zr="#text",Kr="#comment",Vr="#cdata",_r="DECLARATION_TAG",Mr={tagColor:"#d43900",textColor:"#333",attributeKeyColor:"#2a7ab0",attributeValueColor:"#008000",separatorColor:"#333",commentColor:"#aaa",cdataColor:"#1d781d",fontFamily:"monospace"},Ur={attributeKeyColor:"#FFD700",attributeValueColor:"#FF4500",tagColor:"#87CEFA",textColor:"#00FF00",separatorColor:"#FFD700",commentColor:"#BEBEBE",cdataColor:"#33CC66",fontFamily:"monospace"},Wr=j({theme:Mr,collapsible:!1,indentSize:2}),Br=()=>O(Wr),Hr=new Ue({preserveOrder:!0,ignoreAttributes:!1,attributeNamePrefix:"",allowBooleanAttributes:!0,commentPropName:Kr,cdataPropName:Vr,parseTagValue:!1});function Jr(r){const{indentation:n,children:i,isInline:a}=r,{theme:s}=Br();return t("div",{style:{color:s.cdataColor},children:[e("span",{children:`${n}<![CDATA[`}),i,e("span",{children:`${a?"":n}]]>`})]})}function Gr(t){const{collapsible:r,theme:n}=Br(),{collapsed:i}=t;return r?e("span",{style:{position:"relative"},children:e("span",{style:{position:"absolute",right:"0",border:0,padding:0,background:"none"},children:e(Zr,{fill:n.separatorColor,style:{transform:`rotate(${i?0:90}deg)`,transition:"transform 0.2s"}})})}):null}function Zr({...t}){return e("svg",{width:"16px",height:"16px",viewBox:"0 0 24 24",...t,children:e("path",{d:"M9 17.898C9 18.972 10.2649 19.546 11.0731 18.8388L17.3838 13.3169C18.1806 12.6197 18.1806 11.3801 17.3838 10.6829L11.0731 5.16108C10.2649 4.45388 9 5.02785 9 6.1018V17.898Z"})})}function Xr(e){const{collapsible:t,initialCollapsedDepth:r}=Br(),[n,i]=k(()=>!(Be(r)||!t)&&e>=r);return C(()=>{i(!(Be(r)||!t)&&e>=r)},[r,e,t]),{collapsed:n,buttonProps:t?{onClick:()=>i(e=>!e),role:"button",style:{cursor:"pointer"}}:{}}}function Yr(r){const{indentation:n,children:i,isInline:a,level:s}=r,{theme:o}=Br(),{collapsed:l,buttonProps:c}=Xr(s);return t("div",{style:{color:o.commentColor},children:[t("span",{...c,children:[e("span",{children:n}),e(Gr,{collapsed:l}),e("span",{children:"\x3c!-- "})]}),!l&&i,l&&"...",e("span",{children:`${a||l?" ":n}--\x3e`})]})}function Qr(r){const{attributes:n}=r,{theme:i}=Br();return n?e("span",{children:Object.entries(n).map(([r,n])=>t("span",{children:[e("span",{style:{color:i.attributeKeyColor},children:` ${r}`}),e("span",{style:{color:i.separatorColor},children:"="}),e("span",{style:{color:i.attributeValueColor},children:`"${n}"`})]},`attribute-${r}`))}):null}function en(r){const{indentation:n,tagKey:i,attributes:a}=r,{theme:s}=Br();return t("div",{children:[e("span",{style:{color:s.separatorColor},children:`${n}<?`}),e("span",{style:{color:s.tagColor},children:`${i.slice(1)}`}),e(Qr,{attributes:a}),e("span",{style:{color:s.separatorColor},children:"?>"})]})}function tn(e){return"string"==typeof e&&e.includes("\n")}function rn(e){const t=e[":@"],r=He(e,":@"),[[n,i]]=Object.entries(r),a=function(e){switch(e){case zr:case Vr:case Kr:return e;default:return e.startsWith("?")?_r:"TAG"}}(n);return{attributes:t,tagKey:n,subElements:i,type:a}}function nn(e){return!!e&&Object.keys(e).length>0}function an(n){const{indentation:i,tagKey:a,attributes:s,children:o,isInline:l,hasChildren:c,level:d}=n,{collapsed:h,buttonProps:u}=Xr(d),{theme:m}=Br();return t("div",{children:[t("span",{...u,children:[e("span",{children:i}),e(Gr,{collapsed:h}),e("span",{style:{color:m.separatorColor},children:"<"}),e("span",{style:{color:m.tagColor},children:`${a}`}),!h&&e(Qr,{attributes:s}),h&&nn(s)&&" ...",e("span",{style:{color:m.separatorColor},children:c?">":" />"})]}),c&&t(r,{children:[!h&&o,h&&"...",e("span",{style:{color:m.separatorColor},children:`${l||h?"":i}</`}),e("span",{style:{color:m.tagColor},children:`${a}`}),e("span",{style:{color:m.separatorColor},children:">"})]})]})}function sn(t){const{hasSiblings:r,text:n,indentation:i,isText:a}=t,{theme:s}=Br(),o=a?{color:s.textColor}:void 0;return tn(n)||r?e("div",{style:o,children:n.split("\n").filter(e=>!!e.trim()).map((t,r)=>e("div",{children:`${i}${t.trim()}`},`${r}`))}):e("span",{style:o,children:n})}function on(t){const{elements:n,level:i=0,isText:a=!0}=t,{indentSize:s}=Br();return Array.isArray(n)&&0!==n.length?e(r,{children:n.map((t,r)=>{const{tagKey:o,attributes:l,subElements:c,type:d}=rn(t),h=n.length>1,u=function(e,t){return new Array(t*e+1).join(" ")}(s,i),m=`${i}-${r}`,p=function(e){return"string"!=typeof e&&1===e.length&&zr in e[0]&&!tn(e[0][zr])}(c);switch(d){case zr:return e(sn,{text:c,indentation:u,hasSiblings:h,isText:a},m);case Kr:return e(Yr,{isInline:p,indentation:u,level:i,children:e(on,{elements:c,level:i+1,isText:!1})},m);case Vr:return e(Jr,{indentation:u,isInline:p,children:e(on,{elements:c,level:i+1,isText:!1})},m);case _r:return e(en,{indentation:u,tagKey:o,attributes:l},m);default:return e(an,{indentation:u,tagKey:o,attributes:l,isInline:p,hasChildren:c.length>0,level:i,children:e(on,{elements:c,level:i+1})},m)}})}):null}function ln(){return e("div",{children:"Invalid XML!"})}function cn(t){const{theme:r,xml:n,collapsible:i=!1,indentSize:a=2,invalidXml:s,initalCollapsedDepth:o,initialCollapsedDepth:l}=t,[c,d]=k(()=>document.documentElement.classList.contains("dark"));C(()=>{const e=document.documentElement,t=new MutationObserver(()=>{d(e.classList.contains("dark"))});return t.observe(e,{attributes:!0,attributeFilter:["class"]}),()=>t.disconnect()},[]);const h=S(()=>({...c?Ur:Mr,...r}),[c,r]),{json:u,valid:m}=function(e){return S(()=>{try{if(!We.validate(e))throw new Error("Invalid XML!");const t=Hr.parse(e);if("string"==typeof e&&e.trim().length>0&&0===t.length)throw new Error("Invalid XML!");return{json:t,valid:!0}}catch(e){return{json:null,valid:!1,errorMessage:`Fail to parse: ${e.message}`}}},[e])}(n),p=S(()=>({theme:h,collapsible:i,indentSize:a,initialCollapsedDepth:l??o}),[h,i,a,o,l]);return m?e(Wr.Provider,{value:p,children:e("div",{className:"rxv-container",style:{whiteSpace:"pre-wrap",fontFamily:h.fontFamily,overflowWrap:"break-word"},children:e(on,{elements:u})})}):s||e(ln,{})}export{pt as ArrayPropertySchema,Lr as DropZone,Xe as FieldSetContextProvider,it as Form,Qe as FormContext,rt as FormContextProvider,jt as FormError,At as FormHelper,St as FormLabel,st as GeneratedForm,nt as Input,Ot as JSONCode,qt as JSONDisplay,Pt as JSONView,Nt as ManageObjectEntry,kt as ManagedListProperty,bt as ManagedObject,vt as ManagedObjectBase,xt as ManagedObjectProperty,wt as ManagedProperty,Ct as ManagedScalarEntry,cr as ManagedSchema,Wt as MarkdownRenderer,Ge as MonacoEditor,yt as Node,Yt as Popover,Bt as PopoverContext,rr as Progress,nr as PropertiesView,mr as PropertyEditor,pr as PropertyNameEditor,mt as PropertySchema,vr as PropertyViewer,lt as ScalarField,ut as Schema,jr as SchemaEditor,dr as SchemaNode,Fr as SvgIcon,qr as UploadResultCategory,Rr as UploadSummary,Je as VEditorApi,cn as XMLViewer,ft as computeTitleFromName,Dr as createSvgIcon,hr as getEditableSchemaProperty,Ye as useFieldSet,tt as useForm,Ht as usePopoverContext,br as useSchema,Ir as validatePropertyName};
2
2
  //# sourceMappingURL=vertesia-ui-widgets.js.map