@qwickapps/server 1.1.6 → 1.1.9
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.
- package/README.md +1 -1
- package/dist/core/control-panel.d.ts.map +1 -1
- package/dist/core/control-panel.js +5 -8
- package/dist/core/control-panel.js.map +1 -1
- package/dist/core/gateway.d.ts +5 -0
- package/dist/core/gateway.d.ts.map +1 -1
- package/dist/core/gateway.js +390 -28
- package/dist/core/gateway.js.map +1 -1
- package/dist/core/health-manager.d.ts.map +1 -1
- package/dist/core/health-manager.js +3 -9
- package/dist/core/health-manager.js.map +1 -1
- package/dist/core/logging.d.ts.map +1 -1
- package/dist/core/logging.js +2 -6
- package/dist/core/logging.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/plugins/cache-plugin.d.ts +219 -0
- package/dist/plugins/cache-plugin.d.ts.map +1 -0
- package/dist/plugins/cache-plugin.js +326 -0
- package/dist/plugins/cache-plugin.js.map +1 -0
- package/dist/plugins/cache-plugin.test.d.ts +8 -0
- package/dist/plugins/cache-plugin.test.d.ts.map +1 -0
- package/dist/plugins/cache-plugin.test.js +188 -0
- package/dist/plugins/cache-plugin.test.js.map +1 -0
- package/dist/plugins/config-plugin.js +1 -1
- package/dist/plugins/config-plugin.js.map +1 -1
- package/dist/plugins/diagnostics-plugin.js +1 -1
- package/dist/plugins/diagnostics-plugin.js.map +1 -1
- package/dist/plugins/health-plugin.js +1 -1
- package/dist/plugins/health-plugin.js.map +1 -1
- package/dist/plugins/index.d.ts +6 -0
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +4 -0
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/logs-plugin.d.ts.map +1 -1
- package/dist/plugins/logs-plugin.js +1 -3
- package/dist/plugins/logs-plugin.js.map +1 -1
- package/dist/plugins/postgres-plugin.d.ts +155 -0
- package/dist/plugins/postgres-plugin.d.ts.map +1 -0
- package/dist/plugins/postgres-plugin.js +244 -0
- package/dist/plugins/postgres-plugin.js.map +1 -0
- package/dist/plugins/postgres-plugin.test.d.ts +8 -0
- package/dist/plugins/postgres-plugin.test.d.ts.map +1 -0
- package/dist/plugins/postgres-plugin.test.js +165 -0
- package/dist/plugins/postgres-plugin.test.js.map +1 -0
- package/dist-ui/assets/{index-Bk7ypbI4.js → index-CW1BviRn.js} +2 -2
- package/dist-ui/assets/{index-Bk7ypbI4.js.map → index-CW1BviRn.js.map} +1 -1
- package/dist-ui/index.html +1 -1
- package/package.json +13 -2
- package/src/core/control-panel.ts +5 -8
- package/src/core/gateway.ts +412 -30
- package/src/core/health-manager.ts +3 -9
- package/src/core/logging.ts +2 -6
- package/src/index.ts +22 -0
- package/src/plugins/cache-plugin.test.ts +241 -0
- package/src/plugins/cache-plugin.ts +503 -0
- package/src/plugins/config-plugin.ts +1 -1
- package/src/plugins/diagnostics-plugin.ts +1 -1
- package/src/plugins/health-plugin.ts +1 -1
- package/src/plugins/index.ts +10 -0
- package/src/plugins/logs-plugin.ts +1 -3
- package/src/plugins/postgres-plugin.test.ts +213 -0
- package/src/plugins/postgres-plugin.ts +345 -0
- package/ui/src/api/controlPanelApi.ts +1 -1
- package/ui/src/pages/LogsPage.tsx +6 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres-plugin.test.js","sourceRoot":"","sources":["../../src/plugins/postgres-plugin.test.ts"],"names":[],"mappings":"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"}
|
|
@@ -461,5 +461,5 @@ Please report this to https://github.com/markedjs/marked.`,t){const i="<p>An err
|
|
|
461
461
|
|
|
462
462
|
**Bold text** and *italic text*.`}),F(),te(),z("design:type",String)],ul.prototype,"children",void 0);R([L(),N({field_type:O.CHECKBOX,label:"Sanitize HTML",description:"Whether to sanitize HTML output for security"}),F(),gt(),z("design:type",Boolean)],ul.prototype,"sanitize",void 0);R([L(),N({field_type:O.TEXT,label:"Placeholder",description:"Fallback content to display when Markdown is empty",placeholder:"No content available"}),F(),te(),z("design:type",String)],ul.prototype,"placeholder",void 0);ul=R([bt("Markdown","1.0.0")],ul);var PD=ul;const MD=[{selector:"pre",transform:(t,e)=>{var s;const r=t.querySelector("code");if(!r)return null;const i={tagName:"Code",version:"1.0.0",data:{language:((s=Array.from(r.classList).find(l=>l.startsWith("language-")))==null?void 0:s.replace("language-",""))||"text",showCopy:!0,showLineNumbers:!1,children:r.textContent||""}};return h.jsx(Ce,{sx:{my:1.5},children:Sr.deserialize(i)},e)}},{selector:"code",transform:t=>(t.closest("pre"),null)}],_D=t=>({gfm:!0,breaks:!1,pedantic:!1,sanitize:!1,smartypants:!1,renderer:new it.Renderer,...t});function E0({children:t="",htmlTransformConfig:e,sanitize:r=!0,sanitizeOptions:n,placeholder:i,component:s="div",markedOptions:l,...c}){const{styleProps:d,htmlProps:p,restProps:m}=Vr(c);if(E0[Jr]=!0,!t||!t.trim())return i?h.jsx(Ce,{component:s,...p,...d,...m,sx:{opacity:.6,fontStyle:"italic",...d.sx},children:i}):null;try{const v=_D(l),g=it(t,v),y=e||{rules:MD,sanitize:r,sanitizeOptions:n};return h.jsx(Hn,{transformConfig:y,sanitize:r,sanitizeOptions:n,component:s,...p,...d,...m,children:g})}catch(v){return console.error("Error processing Markdown content:",v),h.jsxs(Ce,{component:s,...p,...d,...m,sx:{p:2,border:"1px solid orange",borderRadius:1,backgroundColor:"rgba(255, 165, 0, 0.1)",...d.sx},children:[h.jsx("strong",{children:"Markdown Processing Error:"})," ",v instanceof Error?v.message:"Unknown error",h.jsx(Pn,{html:t,placeholder:"Failed to process Markdown"})]})}}class lu extends es{getComponentSpecificProps(){return{children:this.props.children,sanitize:this.props.sanitize,placeholder:this.props.placeholder}}renderView(){const{...e}=this.props;return h.jsx(E0,{...e})}renderWithDataBinding(){return h.jsx(AD,{...this.props})}static registerPatternHandlers(e){e.hasPattern("div.markdown-content")||e.registerPattern("div.markdown-content",lu.transformMarkdownDiv),e.hasPattern("[data-markdown]")||e.registerPattern("[data-markdown]",lu.transformDataMarkdown)}static transformMarkdownDiv(e){const r=e.getAttribute("data-sanitize")!=="false",n=e.getAttribute("data-placeholder");return{tagName:"Markdown",props:{children:e.textContent||"",sanitize:r,placeholder:n||void 0}}}static transformDataMarkdown(e){const r=e.getAttribute("data-markdown")||e.textContent,n=e.getAttribute("data-sanitize")!=="false",i=e.getAttribute("data-placeholder");return{tagName:"Markdown",props:{children:r,sanitize:n,placeholder:i||void 0}}}}lu.tagName="Markdown";lu.version="1.0.0";function AD(t){const{dataSource:e,bindingOptions:r,...n}=t,{loading:i,error:s,...l}=Xi(e,n,PD.getSchema(),{...r});return i?h.jsx(Ce,{sx:{p:2,textAlign:"center",opacity:.6},children:"Loading Markdown content..."}):s?(console.error("Error loading Markdown content:",s),h.jsxs(Ce,{sx:{p:2,border:"1px solid orange",borderRadius:1,backgroundColor:"rgba(255, 165, 0, 0.1)"},children:[h.jsx("strong",{children:"Error Loading Markdown:"})," ",s.message]})):h.jsx(E0,{...l})}class RD{constructor(){this.measurements=[],this.isEnabled=!0,this.isEnabled&&this.initializeListeners()}initializeListeners(){typeof window>"u"||(window.addEventListener("theme-changed",e=>{var r;this.measureThemeSwitch("theme",(r=e.detail)==null?void 0:r.theme)}),window.addEventListener("palette-changed",e=>{var r;this.measureThemeSwitch("palette",(r=e.detail)==null?void 0:r.palette)}))}measureThemeSwitch(e,r){if(!this.isEnabled||typeof window>"u"||typeof performance>"u")return;const n=performance.now();requestAnimationFrame(()=>{requestAnimationFrame(()=>{const s=performance.now()-n,l={type:e,value:r,duration:s,timestamp:new Date().toISOString()};this.measurements.push(l),this.measurements.length>50&&this.measurements.shift(),s>100?console.warn(`Slow ${e} switch detected:`,l):console.log(`${e} switch performance:`,`${s.toFixed(2)}ms`)})})}getStatistics(){if(!this.isEnabled||this.measurements.length===0)return null;const e=this.measurements.map(s=>s.duration),r=e.reduce((s,l)=>s+l,0)/e.length,n=Math.min(...e),i=Math.max(...e);return{totalMeasurements:this.measurements.length,averageDuration:r.toFixed(2),minDuration:n.toFixed(2),maxDuration:i.toFixed(2),recentMeasurements:this.measurements.slice(-10)}}logStatistics(){if(!this.isEnabled)return;const e=this.getStatistics();e&&(console.group("Theme Performance Statistics"),console.log("Total measurements:",e.totalMeasurements),console.log("Average duration:",e.averageDuration+"ms"),console.log("Min duration:",e.minDuration+"ms"),console.log("Max duration:",e.maxDuration+"ms"),console.log("Recent measurements:",e.recentMeasurements),console.groupEnd())}reset(){this.measurements=[]}}new RD;var kS;(function(t){t.POST="POST",t.PUT="PUT",t.PATCH="PATCH"})(kS||(kS={}));var PS;(function(t){t.NAVIGATE="navigate",t.SUBMIT="submit",t.RESET="reset",t.CANCEL="cancel"})(PS||(PS={}));class T0{constructor(e){this.app=Object.freeze({...e.app}),this.build=Object.freeze({...e.build}),this.pwa=Object.freeze({...e.pwa}),this.ui=Object.freeze({...e.ui}),this.copyright=Object.freeze({...e.copyright}),Object.freeze(this)}get viteConfig(){return{server:{port:this.build.port,host:!0},preview:{port:this.build.previewPort,host:!0},build:{outDir:this.build.outputDir},base:this.build.base,publicDir:"public",define:{__APP_NAME__:JSON.stringify(this.app.name),__APP_ID__:JSON.stringify(this.app.id),__APP_VERSION__:JSON.stringify(this.app.version)}}}get pwaManifest(){return{name:this.app.name,short_name:this.app.shortName,description:this.app.description,start_url:this.pwa.startUrl,display:this.pwa.display,orientation:this.pwa.orientation,theme_color:this.pwa.themeColor,background_color:this.pwa.backgroundColor,scope:this.pwa.scope,icons:[{src:"pwa-192x192.png",sizes:"192x192",type:"image/png"},{src:"pwa-512x512.png",sizes:"512x512",type:"image/png"}]}}toJSON(){return{app:this.app,build:this.build,pwa:this.pwa,ui:this.ui,copyright:this.copyright}}with(e){return new T0({app:{...this.app,...e.app},build:{...this.build,...e.build},pwa:{...this.pwa,...e.pwa},ui:{...this.ui,...e.ui},copyright:{...this.copyright,...e.copyright}})}}let kc,Pc;try{typeof window>"u"&&typeof process<"u"&&(kc=require("fs"),Pc=require("path"))}catch{}class k0{constructor(){this.config={app:{},build:{},pwa:{},ui:{},copyright:{}},this.options={}}static create(){return new k0}withConfig(e){if(!kc||!Pc)return typeof window>"u"&&console.warn("Warning: File system operations not available in browser environment"),this;try{const r=Pc.resolve(e),n=JSON.parse(kc.readFileSync(r,"utf-8"));n.app&&Object.assign(this.config.app,n.app),n.build&&Object.assign(this.config.build,n.build),n.pwa&&Object.assign(this.config.pwa,n.pwa),n.ui&&Object.assign(this.config.ui,n.ui),n.copyright&&Object.assign(this.config.copyright,n.copyright)}catch{console.warn(`Warning: Could not load config file: ${e}`)}return this}withOptions(e){return this.options={...this.options,...e},this}withName(e){return this.config.app.name=e,this}withId(e){return this.config.app.id=e,this}withShortName(e){return this.config.app.shortName=e,this}withDescription(e){return this.config.app.description=e,this}withVersion(e){return this.config.app.version=e,this}withLogo(e){return this.config.app.logo=e,this}withAuthor(e){return this.config.app.author=e,this}withHomepage(e){return this.config.app.homepage=e,this}withPort(e){return this.config.build.port=e,this}withPreviewPort(e){return this.config.build.previewPort=e,this}withOutputDir(e){return this.config.build.outputDir=e,this}withPublicPath(e){return this.config.build.publicPath=e,this}withBase(e){return this.config.build.base=e,this}withThemeColor(e){return this.config.pwa.themeColor=e,this}withBackgroundColor(e){return this.config.pwa.backgroundColor=e,this}withStartUrl(e){return this.config.pwa.startUrl=e,this}withScope(e){return this.config.pwa.scope=e,this}withDisplay(e){return this.config.pwa.display=e,this}withOrientation(e){return this.config.pwa.orientation=e,this}withDefaultTheme(e){return this.config.ui.defaultTheme=e,this}withDefaultPalette(e){return this.config.ui.defaultPalette=e,this}withScaffolding(e){return this.config.ui.enableScaffolding=e,this}withThemeSwitcher(e){return this.config.ui.showThemeSwitcher=e,this}withPaletteSwitcher(e){return this.config.ui.showPaletteSwitcher=e,this}withCopyright(e,r,n){return this.config.copyright.year=e,this.config.copyright.author=r,n!==void 0&&(this.config.copyright.text=n),this}withCopyrightYear(e){return this.config.copyright.year=e,this}withCopyrightAuthor(e){return this.config.copyright.author=e,this}withCopyrightText(e){return this.config.copyright.text=e,this}build(){const e=this.validate();if(e.warnings.forEach(n=>{console.warn(`⚠️ AppConfig: ${n}`)}),!e.isValid)throw new Error(`AppConfig validation failed:
|
|
463
463
|
${e.errors.map(n=>` - ${n}`).join(`
|
|
464
|
-
`)}`);const r=this.applyDefaults();return new T0(r)}validate(){const e=[],r=[];if(this.config.app.name||r.push("App name is required"),this.config.app.id||r.push("App ID is required"),this.config.copyright.year&&this.config.copyright.year!=="auto"&&(!Number.isInteger(this.config.copyright.year)||this.config.copyright.year<1900)&&e.push('Copyright year should be "auto" or a valid year >= 1900'),this.config.app.logo&&!this.options.skipValidation&&kc&&Pc){const n=Pc.resolve(this.options.baseDir||process.cwd(),this.config.app.logo);kc.existsSync(n)||e.push(`Logo file not found: ${this.config.app.logo} (will use default)`)}return this.config.build.port!==void 0&&(!Number.isInteger(this.config.build.port)||this.config.build.port<1||this.config.build.port>65535)&&r.push("Port must be a valid integer between 1 and 65535"),this.config.build.previewPort!==void 0&&(!Number.isInteger(this.config.build.previewPort)||this.config.build.previewPort<1||this.config.build.previewPort>65535)&&r.push("Preview port must be a valid integer between 1 and 65535"),this.config.pwa.themeColor&&!this.isValidColor(this.config.pwa.themeColor)&&e.push(`Theme color may not be valid: ${this.config.pwa.themeColor}`),this.config.pwa.backgroundColor&&!this.isValidColor(this.config.pwa.backgroundColor)&&e.push(`Background color may not be valid: ${this.config.pwa.backgroundColor}`),{warnings:e,errors:r,isValid:r.length===0}}applyDefaults(){const e={id:this.config.app.id,name:this.config.app.name,shortName:this.config.app.shortName||this.config.app.name,description:this.config.app.description||this.config.app.name,version:this.config.app.version||"1.0.0",logo:this.config.app.logo||"/favicon.ico",author:this.config.app.author,homepage:this.config.app.homepage},r={port:this.config.build.port||3e3,previewPort:this.config.build.previewPort||4173,outputDir:this.config.build.outputDir||"dist",publicPath:this.config.build.publicPath||"/",base:this.config.build.base||"/"},n={themeColor:this.config.pwa.themeColor||"#000000",backgroundColor:this.config.pwa.backgroundColor||"#ffffff",startUrl:this.config.pwa.startUrl||"/",scope:this.config.pwa.scope||"/",display:this.config.pwa.display||"standalone",orientation:this.config.pwa.orientation},i={defaultTheme:this.config.ui.defaultTheme||"light",defaultPalette:this.config.ui.defaultPalette||"default",enableScaffolding:this.config.ui.enableScaffolding??!0,showThemeSwitcher:this.config.ui.showThemeSwitcher??!1,showPaletteSwitcher:this.config.ui.showPaletteSwitcher??!1},s={year:this.config.copyright.year||"auto",author:this.config.copyright.author||e.author||e.name,text:this.config.copyright.text};return{app:e,build:r,pwa:n,ui:i,copyright:s}}isValidColor(e){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e)||/^(black|white|red|green|blue|yellow|orange|purple|pink|gray|grey)$/i.test(e)||/^rgba?\([^)]+\)$/i.test(e)}}let vo=class extends tt{};R([L(),N({field_type:O.TEXT,label:"Field Label",description:"Label/title for the choice input field",placeholder:"Options"}),F(),te(),z("design:type",String)],vo.prototype,"label",void 0);R([L(),N({field_type:O.TEXTAREA,label:"Options",description:"Array of option values (HTML content supported) - JSON array format"}),F(),kr(),te({each:!0}),z("design:type",Array)],vo.prototype,"options",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Disabled",description:"Whether the input fields are disabled"}),F(),gt(),z("design:type",Boolean)],vo.prototype,"disabled",void 0);R([L(),N({field_type:O.TEXT,label:"Placeholder Text",description:"Placeholder text for option inputs",placeholder:"Enter option text. HTML formatting supported."}),F(),te(),z("design:type",String)],vo.prototype,"placeholder",void 0);R([L(),N({field_type:O.TEXT,label:"Option Label Prefix",description:'Prefix for each option label (e.g., "Option", "Choice")',placeholder:"Option"}),F(),te(),z("design:type",String)],vo.prototype,"optionLabelPrefix",void 0);R([L({defaultValue:2}),N({field_type:O.NUMBER,label:"Input Rows",description:"Number of rows for each option input field"}),F(),Qt(),z("design:type",Number)],vo.prototype,"rows",void 0);R([L(),N({field_type:O.TEXT,label:"Add Button Text",description:"Text for the add option button",placeholder:"Add Option"}),F(),te(),z("design:type",String)],vo.prototype,"addButtonText",void 0);vo=R([bt("ChoiceInputField","1.0.0")],vo);let bo=class extends WC{};R([L(),N({field_type:O.TEXTAREA,label:"Content",description:"Raw code text. If provided, React children are ignored in serialization.",placeholder:"Enter code content..."}),F(),te(),z("design:type",String)],bo.prototype,"content",void 0);R([L(),N({field_type:O.TEXT,label:"Language",description:"Programming language for syntax highlighting (e.g., typescript, javascript, python)",placeholder:"javascript"}),F(),te(),z("design:type",String)],bo.prototype,"language",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Show Copy Button",description:"Display a copy-to-clipboard button"}),F(),gt(),z("design:type",Boolean)],bo.prototype,"showCopy",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Show Line Numbers",description:"Display line numbers alongside the code"}),F(),gt(),z("design:type",Boolean)],bo.prototype,"showLineNumbers",void 0);R([L(),N({field_type:O.TEXT,label:"Title",description:"Optional title or filename to display above the code",placeholder:"File name or title"}),F(),te(),z("design:type",String)],bo.prototype,"title",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Wrap Long Lines",description:"Allow long lines to wrap instead of scrolling horizontally"}),F(),gt(),z("design:type",Boolean)],bo.prototype,"wrapLines",void 0);R([L(),N({field_type:O.TEXT,label:"Background Color",description:"Custom background color override",placeholder:"#f5f5f5"}),F(),te(),z("design:type",String)],bo.prototype,"codeBackground",void 0);bo=R([bt("Code","1.0.0")],bo);let hn=class extends mo{};R([L(),N({field_type:O.NUMBER,label:"Span",description:"Number of columns to span (1-12)",placeholder:"12"}),F(),Qt(),Re([1,2,3,4,5,6,7,8,9,10,11,12]),z("design:type",Number)],hn.prototype,"span",void 0);R([L(),N({field_type:O.NUMBER,label:"XS (Mobile)",description:"Columns on extra small screens (1-12)",placeholder:"12"}),F(),Qt(),Re([1,2,3,4,5,6,7,8,9,10,11,12]),z("design:type",Number)],hn.prototype,"xs",void 0);R([L(),N({field_type:O.NUMBER,label:"SM (Tablet)",description:"Columns on small screens (1-12)",placeholder:"6"}),F(),Qt(),Re([1,2,3,4,5,6,7,8,9,10,11,12]),z("design:type",Number)],hn.prototype,"sm",void 0);R([L(),N({field_type:O.NUMBER,label:"MD (Desktop)",description:"Columns on medium screens (1-12)",placeholder:"4"}),F(),Qt(),Re([1,2,3,4,5,6,7,8,9,10,11,12]),z("design:type",Number)],hn.prototype,"md",void 0);R([L(),N({field_type:O.NUMBER,label:"LG (Large Desktop)",description:"Columns on large screens (1-12)",placeholder:"3"}),F(),Qt(),Re([1,2,3,4,5,6,7,8,9,10,11,12]),z("design:type",Number)],hn.prototype,"lg",void 0);R([L(),N({field_type:O.NUMBER,label:"XL (Extra Large)",description:"Columns on extra large screens (1-12)",placeholder:"2"}),F(),Qt(),Re([1,2,3,4,5,6,7,8,9,10,11,12]),z("design:type",Number)],hn.prototype,"xl",void 0);R([L(),N({field_type:O.TEXT,label:"Background",description:'Background color or theme color (e.g., "primary.main", "#ffffff")',placeholder:"transparent"}),F(),te(),z("design:type",String)],hn.prototype,"background",void 0);R([L(),N({field_type:O.TEXT,label:"Padding",description:'Internal spacing (e.g., "medium", "16px", "1rem")',placeholder:"medium"}),F(),te(),z("design:type",String)],hn.prototype,"padding",void 0);R([L(),N({field_type:O.TEXT,label:"Margin",description:'External spacing (e.g., "small", "8px", "0.5rem")',placeholder:"0"}),F(),te(),z("design:type",String)],hn.prototype,"margin",void 0);R([L(),N({field_type:O.TEXT,label:"Height",description:'Cell height (e.g., "200px", "medium")',placeholder:"auto"}),F(),te(),z("design:type",String)],hn.prototype,"height",void 0);R([L(),N({field_type:O.TEXT,label:"Width",description:'Cell width (e.g., "100%", "300px")',placeholder:"100%"}),F(),te(),z("design:type",String)],hn.prototype,"width",void 0);R([L(),N({field_type:O.TEXT,label:"CSS Class",description:"Additional CSS class names",placeholder:"custom-cell-class"}),F(),te(),z("design:type",String)],hn.prototype,"className",void 0);hn=R([bt("GridCell","1.0.0")],hn);let Xn=class extends mo{};R([L(),N({field_type:O.NUMBER,label:"Columns",description:"Number of equal-width columns for auto-distribution"}),F(),Qt(),yn(1),z("design:type",Number)],Xn.prototype,"columns",void 0);R([L({defaultValue:"small"}),N({field_type:O.SELECT,label:"Spacing",description:"Spacing between grid items"}),F(),te(),Re(["tiny","small","medium","large","huge"]),z("design:type",String)],Xn.prototype,"spacing",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Equal Height",description:"Make all grid items the same height"}),F(),gt(),z("design:type",Boolean)],Xn.prototype,"equalHeight",void 0);R([L(),N({field_type:O.TEXT,label:"Height",description:'Grid container height (e.g., "400px", "50vh", "medium")',placeholder:"auto"}),F(),te(),z("design:type",String)],Xn.prototype,"height",void 0);R([L(),N({field_type:O.TEXT,label:"Width",description:'Grid container width (e.g., "100%", "800px", "large")',placeholder:"100%"}),F(),te(),z("design:type",String)],Xn.prototype,"width",void 0);R([L(),N({field_type:O.TEXT,label:"Min Height",description:"Minimum grid container height",placeholder:"auto"}),F(),te(),z("design:type",String)],Xn.prototype,"minHeight",void 0);R([L(),N({field_type:O.TEXT,label:"Min Width",description:"Minimum grid container width",placeholder:"auto"}),F(),te(),z("design:type",String)],Xn.prototype,"minWidth",void 0);R([L(),N({field_type:O.TEXT,label:"Max Height",description:"Maximum grid container height",placeholder:"none"}),F(),te(),z("design:type",String)],Xn.prototype,"maxHeight",void 0);R([L(),N({field_type:O.TEXT,label:"Max Width",description:"Maximum grid container width",placeholder:"none"}),F(),te(),z("design:type",String)],Xn.prototype,"maxWidth",void 0);R([L(),N({field_type:O.TEXT,label:"CSS Class",description:"Additional CSS class names",placeholder:"custom-grid-class"}),F(),te(),z("design:type",String)],Xn.prototype,"className",void 0);Xn=R([bt("GridLayout","1.0.0")],Xn);let Kn=class extends mo{};R([L(),N({field_type:O.TEXT,label:"Title",description:"Main headline text",placeholder:"Enter hero title..."}),te(),z("design:type",String)],Kn.prototype,"title",void 0);R([L(),N({field_type:O.TEXT,label:"Subtitle",description:"Subtitle or description text",placeholder:"Enter subtitle..."}),F(),te(),z("design:type",String)],Kn.prototype,"subtitle",void 0);R([L(),N({field_type:O.IMAGE,label:"Background Image",description:"Background image URL",placeholder:"https://..."}),F(),Mf(),z("design:type",String)],Kn.prototype,"backgroundImage",void 0);R([L(),N({field_type:O.TEXT,label:"Background Gradient",description:"Background gradient CSS value",placeholder:"linear-gradient(...)"}),F(),te(),z("design:type",String)],Kn.prototype,"backgroundGradient",void 0);R([L({defaultValue:"default"}),N({field_type:O.SELECT,label:"Background Color",description:"Background color theme variant",validation:{options:[{label:"Default",value:"default"},{label:"Primary",value:"primary"},{label:"Secondary",value:"secondary"},{label:"Surface",value:"surface"}]}}),F(),Re(["default","primary","secondary","surface"]),z("design:type",String)],Kn.prototype,"backgroundColor",void 0);R([L({type:Ge.ARRAY}),N({field_type:O.REPEATER,label:"Actions",description:"Action buttons for the hero section"}),F(),kr(),gn({each:!0}),vn(()=>pn),z("design:type",Array)],Kn.prototype,"actions",void 0);R([L({defaultValue:"center"}),N({field_type:O.SELECT,label:"Text Alignment",description:"Text alignment",validation:{options:[{label:"Left",value:"left"},{label:"Center",value:"center"},{label:"Right",value:"right"}]}}),F(),Re(["left","center","right"]),z("design:type",String)],Kn.prototype,"textAlign",void 0);R([L({defaultValue:"medium"}),N({field_type:O.SELECT,label:"Block Height",description:"Block height preset",validation:{options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"},{label:"Large",value:"large"},{label:"Viewport",value:"viewport"}]}}),F(),Re(["small","medium","large","viewport"]),z("design:type",String)],Kn.prototype,"blockHeight",void 0);R([L(),N({field_type:O.NUMBER,label:"Overlay Opacity",description:"Custom overlay opacity (0-1) when using background images",validation:{min:0,max:1}}),F(),Qt(),yn(0),Za(1),z("design:type",Number)],Kn.prototype,"overlayOpacity",void 0);R([L(),N({field_type:O.TEXT,label:"CSS Class",description:"Additional CSS class name",placeholder:"custom-hero-class"}),F(),te(),z("design:type",String)],Kn.prototype,"className",void 0);Kn=R([bt("HeroBlock","1.0.0")],Kn);let vr=class extends tt{};R([L({dataType:Ge.STRING}),N({field_type:O.IMAGE,label:"Image Source",description:"Image source URL or path",placeholder:"https://example.com/image.jpg"}),F(),te(),z("design:type",String)],vr.prototype,"src",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXT,label:"Alt Text",description:"Alternative text for accessibility (required for images with src)",placeholder:"Describe the image for screen readers"}),F(),te(),z("design:type",String)],vr.prototype,"alt",void 0);R([L({dataType:Ge.NUMBER}),N({field_type:O.NUMBER,label:"Width",description:"Image width in pixels (optional)",placeholder:"300"}),F(),Qt(),z("design:type",Number)],vr.prototype,"width",void 0);R([L({dataType:Ge.NUMBER}),N({field_type:O.NUMBER,label:"Height",description:"Image height in pixels (optional)",placeholder:"200"}),F(),Qt(),z("design:type",Number)],vr.prototype,"height",void 0);R([L({defaultValue:"cover",dataType:Ge.STRING}),N({field_type:O.SELECT,label:"Object Fit",description:"How the image should be resized to fit its container",validation:{options:[{label:"Fill",value:"fill"},{label:"Contain",value:"contain"},{label:"Cover",value:"cover"},{label:"None",value:"none"},{label:"Scale Down",value:"scale-down"}]}}),F(),te(),Re(["fill","contain","cover","none","scale-down"]),z("design:type",String)],vr.prototype,"objectFit",void 0);R([L({defaultValue:"center",dataType:Ge.STRING}),N({field_type:O.SELECT,label:"Object Position",description:"Position of the image within its container",validation:{options:[{label:"Center",value:"center"},{label:"Top",value:"top"},{label:"Bottom",value:"bottom"},{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Top Left",value:"top-left"},{label:"Top Right",value:"top-right"},{label:"Bottom Left",value:"bottom-left"},{label:"Bottom Right",value:"bottom-right"}]}}),F(),te(),Re(["center","top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]),z("design:type",String)],vr.prototype,"objectPosition",void 0);R([L({defaultValue:"lazy",dataType:Ge.STRING}),N({field_type:O.SELECT,label:"Loading",description:"Image loading behavior",validation:{options:[{label:"Lazy (load when visible)",value:"lazy"},{label:"Eager (load immediately)",value:"eager"}]}}),F(),te(),Re(["lazy","eager"]),z("design:type",String)],vr.prototype,"loading",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXT,label:"Title",description:"Image title (tooltip text)",placeholder:"Tooltip text on hover"}),F(),te(),z("design:type",String)],vr.prototype,"title",void 0);R([L({defaultValue:!1,dataType:Ge.BOOLEAN}),N({field_type:O.BOOLEAN,label:"Draggable",description:"Allow the image to be dragged"}),F(),gt(),z("design:type",Boolean)],vr.prototype,"draggable",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXT,label:"Border Radius",description:'CSS border radius (e.g., "8px", "50%", "1rem")',placeholder:"8px"}),F(),te(),z("design:type",String)],vr.prototype,"borderRadius",void 0);R([L({defaultValue:!1,dataType:Ge.BOOLEAN}),N({field_type:O.BOOLEAN,label:"Show Loading State",description:"Display a loading placeholder while the image loads"}),F(),gt(),z("design:type",Boolean)],vr.prototype,"showLoading",void 0);R([L({defaultValue:!1,dataType:Ge.BOOLEAN}),N({field_type:O.BOOLEAN,label:"Show Error State",description:"Display an error message if the image fails to load"}),F(),gt(),z("design:type",Boolean)],vr.prototype,"showError",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXT,label:"Fallback Image",description:"Fallback image URL to use if the main image fails to load",placeholder:"https://example.com/fallback.jpg"}),F(),te(),z("design:type",String)],vr.prototype,"fallbackSrc",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXTAREA,label:"Responsive Sizes",description:"Responsive image sizes attribute for optimized loading",placeholder:"(max-width: 768px) 100vw, 50vw"}),F(),te(),z("design:type",String)],vr.prototype,"sizes",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXTAREA,label:"Source Set",description:"Source set for responsive images (comma-separated)",placeholder:"image-320w.jpg 320w, image-640w.jpg 640w, image-1280w.jpg 1280w"}),F(),te(),z("design:type",String)],vr.prototype,"srcSet",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXTAREA,label:"Loading Placeholder",description:"Custom loading placeholder content (for advanced use)",placeholder:"Custom loading content..."}),F(),z("design:type",Object)],vr.prototype,"loadingPlaceholder",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXTAREA,label:"Error Placeholder",description:"Custom error placeholder content (for advanced use)",placeholder:"Custom error content..."}),F(),z("design:type",Object)],vr.prototype,"errorPlaceholder",void 0);vr=R([bt("Image","1.0.0")],vr);let Xa=class extends mo{};R([L(),N({field_type:O.TEXT,label:"Background Color",description:"Background color (CSS color, theme path, or palette color)",placeholder:"#ffffff or primary.main"}),F(),te(),z("design:type",String)],Xa.prototype,"background",void 0);R([L(),N({field_type:O.TEXT,label:"Text Color",description:"Text color (CSS color, theme path, or palette color)",placeholder:"#000000 or text.primary"}),F(),te(),z("design:type",String)],Xa.prototype,"color",void 0);R([L(),N({field_type:O.SELECT,label:"Section Padding",description:"Vertical padding/spacing for the section",validation:{options:[{value:"none",label:"None"},{value:"tiny",label:"Tiny (8px)"},{value:"small",label:"Small (16px)"},{value:"medium",label:"Medium (32px)"},{value:"large",label:"Large (64px)"},{value:"extra-large",label:"Extra Large (96px)"}]}}),F(),Re(["none","tiny","small","medium","large","extra-large"]),z("design:type",String)],Xa.prototype,"padding",void 0);R([L(),N({field_type:O.SELECT,label:"Content Max Width",description:"Maximum width for the content container",validation:{options:[{value:"xs",label:"Extra Small (444px)"},{value:"sm",label:"Small (600px)"},{value:"md",label:"Medium (900px)"},{value:"lg",label:"Large (1200px)"},{value:"xl",label:"Extra Large (1536px)"},{value:"false",label:"Full Width"}]}}),F(),Re(["xs","sm","md","lg","xl","false"]),z("design:type",String)],Xa.prototype,"contentMaxWidth",void 0);R([L(),N({field_type:O.SELECT,label:"HTML Element",description:"HTML element type to use for the section",validation:{options:[{value:"section",label:"Section"},{value:"div",label:"Div"},{value:"article",label:"Article"},{value:"main",label:"Main"}]}}),F(),Re(["section","div","article","main"]),z("design:type",String)],Xa.prototype,"component",void 0);Xa=R([bt("Section","1.0.0")],Xa);let In=class extends tt{};R([L(),N({field_type:O.TEXT,label:"Field Label",description:"The label displayed for the text input field",placeholder:"Enter field label..."}),te(),z("design:type",String)],In.prototype,"label",void 0);R([L(),N({field_type:O.TEXT,label:"Value",description:"Current field value",placeholder:"Enter value..."}),F(),te(),z("design:type",String)],In.prototype,"value",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Required",description:"Whether the field is required"}),F(),gt(),z("design:type",Boolean)],In.prototype,"required",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Disabled",description:"Whether the field is disabled"}),F(),gt(),z("design:type",Boolean)],In.prototype,"disabled",void 0);R([L(),N({field_type:O.TEXT,label:"Error Message",description:"Error message to display if validation fails",placeholder:"Enter error message..."}),F(),te(),z("design:type",String)],In.prototype,"error",void 0);R([L(),N({field_type:O.TEXT,label:"Helper Text",description:"Helper text to guide the user",placeholder:"Enter helper text..."}),F(),te(),z("design:type",String)],In.prototype,"helperText",void 0);R([L(),N({field_type:O.TEXT,label:"Placeholder",description:"Placeholder text shown when field is empty",placeholder:"Enter placeholder text..."}),F(),te(),z("design:type",String)],In.prototype,"placeholder",void 0);R([L(),N({field_type:O.TEXT,label:"Input Type",description:"HTML input type (text, email, number, password, etc.)",placeholder:"text"}),F(),te(),z("design:type",String)],In.prototype,"type",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Multiline",description:"Whether the field supports multiple lines (textarea)"}),F(),gt(),z("design:type",Boolean)],In.prototype,"multiline",void 0);R([L(),N({field_type:O.NUMBER,label:"Rows",description:"Number of rows for multiline fields"}),F(),Qt(),z("design:type",Number)],In.prototype,"rows",void 0);R([L(),N({field_type:O.NUMBER,label:"Max Rows",description:"Maximum number of rows for multiline fields"}),F(),Qt(),z("design:type",Number)],In.prototype,"maxRows",void 0);In=R([bt("TextInputField","1.0.0")],In);let pr=class extends Ft{};R([L({dataType:Ge.STRING}),N({field_type:O.TEXTAREA,label:"Text Content",description:"The text content to display",placeholder:"Enter your text content here..."}),F(),te(),z("design:type",String)],pr.prototype,"content",void 0);R([L({defaultValue:"body1",dataType:Ge.STRING}),N({field_type:O.SELECT,label:"Typography Variant",description:"Typography variant that determines font size, weight, and line height",validation:{options:[{label:"Heading 1",value:"h1"},{label:"Heading 2",value:"h2"},{label:"Heading 3",value:"h3"},{label:"Heading 4",value:"h4"},{label:"Heading 5",value:"h5"},{label:"Heading 6",value:"h6"},{label:"Subtitle 1",value:"subtitle1"},{label:"Subtitle 2",value:"subtitle2"},{label:"Body 1",value:"body1"},{label:"Body 2",value:"body2"},{label:"Button",value:"button"},{label:"Caption",value:"caption"},{label:"Overline",value:"overline"}]}}),F(),te(),Re(["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","button","caption","overline"]),z("design:type",String)],pr.prototype,"variant",void 0);R([L({defaultValue:"inherit",dataType:Ge.STRING}),N({field_type:O.SELECT,label:"Text Color",description:"Color variant for the text",validation:{options:[{label:"Primary",value:"primary"},{label:"Secondary",value:"secondary"},{label:"Text Primary",value:"textPrimary"},{label:"Text Secondary",value:"textSecondary"},{label:"Error",value:"error"},{label:"Warning",value:"warning"},{label:"Info",value:"info"},{label:"Success",value:"success"},{label:"Inherit",value:"inherit"}]}}),F(),te(),Re(["primary","secondary","textPrimary","textSecondary","error","warning","info","success","inherit"]),z("design:type",String)],pr.prototype,"color",void 0);R([L({defaultValue:"inherit",dataType:Ge.STRING}),N({field_type:O.SELECT,label:"Text Alignment",description:"How to align the text horizontally",validation:{options:[{label:"Left",value:"left"},{label:"Center",value:"center"},{label:"Right",value:"right"},{label:"Justify",value:"justify"},{label:"Inherit",value:"inherit"}]}}),F(),te(),Re(["left","center","right","justify","inherit"]),z("design:type",String)],pr.prototype,"align",void 0);R([L({defaultValue:"p",dataType:Ge.STRING}),N({field_type:O.SELECT,label:"HTML Element",description:"The HTML element to render (affects semantics and accessibility)",validation:{options:[{label:"Paragraph (p)",value:"p"},{label:"Span",value:"span"},{label:"Div",value:"div"},{label:"Heading 1 (h1)",value:"h1"},{label:"Heading 2 (h2)",value:"h2"},{label:"Heading 3 (h3)",value:"h3"},{label:"Heading 4 (h4)",value:"h4"},{label:"Heading 5 (h5)",value:"h5"},{label:"Heading 6 (h6)",value:"h6"},{label:"Label",value:"label"},{label:"Legend",value:"legend"}]}}),F(),te(),Re(["p","span","div","h1","h2","h3","h4","h5","h6","label","legend"]),z("design:type",String)],pr.prototype,"component",void 0);R([L({defaultValue:"inherit",dataType:Ge.STRING}),N({field_type:O.SELECT,label:"Font Weight",description:"The weight (thickness) of the font",validation:{options:[{label:"Inherit",value:"inherit"},{label:"Lighter",value:"lighter"},{label:"Normal",value:"normal"},{label:"Bold",value:"bold"},{label:"Bolder",value:"bolder"},{label:"100",value:"100"},{label:"200",value:"200"},{label:"300",value:"300"},{label:"400",value:"400"},{label:"500",value:"500"},{label:"600",value:"600"},{label:"700",value:"700"},{label:"800",value:"800"},{label:"900",value:"900"}]}}),F(),te(),Re(["inherit","lighter","normal","bold","bolder","100","200","300","400","500","600","700","800","900"]),z("design:type",String)],pr.prototype,"fontWeight",void 0);R([L({defaultValue:"none",dataType:Ge.STRING}),N({field_type:O.SELECT,label:"Text Decoration",description:"Text decoration style",validation:{options:[{label:"None",value:"none"},{label:"Underline",value:"underline"},{label:"Overline",value:"overline"},{label:"Line Through",value:"line-through"}]}}),F(),te(),Re(["none","underline","overline","line-through"]),z("design:type",String)],pr.prototype,"textDecoration",void 0);R([L({defaultValue:"none",dataType:Ge.STRING}),N({field_type:O.SELECT,label:"Text Transform",description:"How to transform the text case",validation:{options:[{label:"None",value:"none"},{label:"Capitalize",value:"capitalize"},{label:"Uppercase",value:"uppercase"},{label:"Lowercase",value:"lowercase"},{label:"Inherit",value:"inherit"}]}}),F(),te(),Re(["none","capitalize","uppercase","lowercase","inherit"]),z("design:type",String)],pr.prototype,"textTransform",void 0);R([L({defaultValue:!1,dataType:Ge.BOOLEAN}),N({field_type:O.BOOLEAN,label:"No Wrap",description:"Prevent text from wrapping to multiple lines"}),F(),gt(),z("design:type",Boolean)],pr.prototype,"noWrap",void 0);R([L({defaultValue:!1,dataType:Ge.BOOLEAN}),N({field_type:O.BOOLEAN,label:"Paragraph Mode",description:"Apply paragraph spacing and formatting"}),F(),gt(),z("design:type",Boolean)],pr.prototype,"paragraph",void 0);R([L({defaultValue:!1,dataType:Ge.BOOLEAN}),N({field_type:O.BOOLEAN,label:"Gutter Bottom",description:"Add margin bottom for spacing (useful for headings)"}),F(),gt(),z("design:type",Boolean)],pr.prototype,"gutterBottom",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXT,label:"Font Size",description:'Custom font size (overrides variant sizing, e.g., "16px", "1.2rem")',placeholder:"16px"}),F(),te(),z("design:type",String)],pr.prototype,"fontSize",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXT,label:"Line Height",description:'Custom line height (e.g., "1.5", "24px", "150%")',placeholder:"1.5"}),F(),te(),z("design:type",String)],pr.prototype,"lineHeight",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXT,label:"Letter Spacing",description:'Custom letter spacing (e.g., "0.1em", "1px")',placeholder:"0.1em"}),F(),te(),z("design:type",String)],pr.prototype,"letterSpacing",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXT,label:"Font Family",description:'Custom font family (e.g., "Arial, sans-serif")',placeholder:"Arial, sans-serif"}),F(),te(),z("design:type",String)],pr.prototype,"fontFamily",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXTAREA,label:"Custom Color",description:"Custom text color (CSS color value, overrides color variant)",placeholder:"#333333 or rgb(51, 51, 51)"}),F(),te(),z("design:type",String)],pr.prototype,"customColor",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXTAREA,label:"Max Width",description:'Maximum width for the text (e.g., "300px", "50%")',placeholder:"300px"}),F(),te(),z("design:type",String)],pr.prototype,"maxWidth",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXTAREA,label:"Rich Content",description:"Rich text content with React elements (for advanced use)",placeholder:"Rich content..."}),F(),z("design:type",Object)],pr.prototype,"children",void 0);pr=R([bt("Text","1.0.0")],pr);let fr=class extends Ft{};R([L({defaultValue:"light"}),N({field_type:O.SELECT,label:"Print Theme",description:"Theme mode to use when printing",validation:{options:[{label:"Light",value:"light"},{label:"Dark",value:"dark"}]}}),F(),Re(["light","dark"]),z("design:type",String)],fr.prototype,"theme",void 0);R([L({defaultValue:"default"}),N({field_type:O.SELECT,label:"Print Palette",description:"Color palette to use for print output",validation:{options:[{label:"Default",value:"default"},{label:"Autumn",value:"autumn"},{label:"Cosmic",value:"cosmic"},{label:"Ocean",value:"ocean"},{label:"Spring",value:"spring"},{label:"Winter",value:"winter"}]}}),F(),te(),z("design:type",String)],fr.prototype,"palette",void 0);R([L({defaultValue:!0}),N({field_type:O.BOOLEAN,label:"Hide Scaffolding",description:"Hide app scaffolding (navigation, headers) when printing"}),F(),gt(),z("design:type",Boolean)],fr.prototype,"hideScaffolding",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Hide Interactive Elements",description:"Hide buttons and interactive elements when printing"}),F(),gt(),z("design:type",Boolean)],fr.prototype,"hideInteractiveElements",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Optimize For Monochrome",description:"Optimize design for black and white printing"}),F(),gt(),z("design:type",Boolean)],fr.prototype,"optimizeForMonochrome",void 0);R([L(),N({field_type:O.TEXT,label:"Print Title",description:"Custom title to show when printing (optional)",placeholder:"Document Title"}),F(),te(),z("design:type",String)],fr.prototype,"printTitle",void 0);R([L({defaultValue:!0}),N({field_type:O.BOOLEAN,label:"Show Print Date",description:"Include print date and time in printed output"}),F(),gt(),z("design:type",Boolean)],fr.prototype,"showPrintDate",void 0);R([L(),N({field_type:O.TEXT,label:"Print Header",description:"Custom header content for printed pages (HTML string or React component)",placeholder:"<div>Custom header content...</div>"}),F(),z("design:type",Object)],fr.prototype,"printHeader",void 0);R([L(),N({field_type:O.TEXT,label:"Print Header (First Page)",description:"Different header for the first page only (overrides main header on page 1)",placeholder:"<div>First page header...</div>"}),F(),z("design:type",Object)],fr.prototype,"printHeaderFirstPage",void 0);R([L(),N({field_type:O.TEXT,label:"Print Footer",description:"Custom footer content for printed pages (HTML string or React component)",placeholder:"<div>Custom footer content...</div>"}),F(),z("design:type",Object)],fr.prototype,"printFooter",void 0);R([L(),N({field_type:O.TEXT,label:"Print Footer (First Page)",description:"Different footer for the first page only (overrides main footer on page 1)",placeholder:"<div>First page footer...</div>"}),F(),z("design:type",Object)],fr.prototype,"printFooterFirstPage",void 0);R([L({defaultValue:"12mm"}),N({field_type:O.SELECT,label:"Page Margins",description:"Print page margins",validation:{options:[{label:"Compact (6mm)",value:"6mm"},{label:"Standard (12mm)",value:"12mm"},{label:"Large (20mm)",value:"20mm"},{label:"Formal (25mm)",value:"25mm"}]}}),F(),te(),z("design:type",String)],fr.prototype,"pageMargins",void 0);R([L({defaultValue:"60px"}),N({field_type:O.TEXT,label:"Print Header Height",description:"Height allocated for print header (CSS units: px, mm, etc.)",placeholder:"60px"}),F(),te(),z("design:type",String)],fr.prototype,"printHeaderHeight",void 0);R([L({defaultValue:"40px"}),N({field_type:O.TEXT,label:"Print Footer Height",description:"Height allocated for print footer (CSS units: px, mm, etc.)",placeholder:"40px"}),F(),te(),z("design:type",String)],fr.prototype,"printFooterHeight",void 0);R([L(),N({field_type:O.TEXT,label:"Print Background",description:"CSS background for all printed pages (color, gradient, or image)",placeholder:"linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%)"}),F(),te(),z("design:type",String)],fr.prototype,"printBackground",void 0);R([L(),N({field_type:O.TEXT,label:"Print Background (First Page)",description:"Different background for the first page only",placeholder:"url(/logo-watermark.png) no-repeat center, #ffffff"}),F(),te(),z("design:type",String)],fr.prototype,"printBackgroundFirstPage",void 0);fr=R([bt("PrintConfig","1.0.0")],fr);let Tr=class extends tt{};R([L(),N({field_type:O.TEXT,label:"Page Slug",description:'URL-friendly page identifier (e.g., "about-us")',placeholder:"page-slug"}),F(),te(),z("design:type",String)],Tr.prototype,"slug",void 0);R([L(),N({field_type:O.TEXT,label:"Page Name",description:"Human-readable page name",placeholder:"About Us"}),F(),te(),z("design:type",String)],Tr.prototype,"name",void 0);R([L(),N({field_type:O.TEXTAREA,label:"Page Description",description:"Description of the page content (used for SEO)",placeholder:"Brief description of this page..."}),F(),te(),z("design:type",String)],Tr.prototype,"description",void 0);R([L(),N({field_type:O.TEXT,label:"Page Title",description:"HTML title tag content (defaults to name if not provided)",placeholder:"Page Title | Site Name"}),F(),te(),z("design:type",String)],Tr.prototype,"title",void 0);R([L(),N({field_type:O.TEXTAREA,label:"Meta Keywords",description:"SEO keywords (comma-separated)",placeholder:"keyword1, keyword2, keyword3"}),F(),te(),z("design:type",String)],Tr.prototype,"metaKeywords",void 0);R([L(),N({field_type:O.TEXT,label:"Meta Author",description:"Page author information",placeholder:"Author Name"}),F(),te(),z("design:type",String)],Tr.prototype,"metaAuthor",void 0);R([L(),N({field_type:O.URL,label:"Canonical URL",description:"Canonical URL for SEO (optional)",placeholder:"https://example.com/page"}),F(),te(),z("design:type",String)],Tr.prototype,"canonicalUrl",void 0);R([L(),N({field_type:O.TEXTAREA,label:"Page Content",description:"Main page content - can include React components and HTML"}),F(),z("design:type",Object)],Tr.prototype,"children",void 0);R([L(),N({field_type:O.FORM,label:"Print Configuration",description:"Configuration for print mode behavior"}),F(),gn(),vn(()=>fr),z("design:type",fr)],Tr.prototype,"printConfig",void 0);R([L(),N({field_type:O.TEXT,label:"Layout Template",description:"Layout template identifier to use for this page",placeholder:"default, fullwidth, sidebar, etc."}),F(),te(),z("design:type",String)],Tr.prototype,"layout",void 0);R([L(),N({field_type:O.TEXT,label:"Page Icon",description:"Icon identifier for page (used in navigation)",placeholder:"home, about, contact"}),F(),te(),z("design:type",String)],Tr.prototype,"icon",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Requires Authentication",description:"Whether this page requires user authentication"}),F(),z("design:type",Boolean)],Tr.prototype,"requiresAuth",void 0);R([L(),N({field_type:O.TEXT,label:"Required Roles",description:"Comma-separated list of roles required to access this page",placeholder:"admin, user, moderator"}),F(),te(),z("design:type",String)],Tr.prototype,"requiredRoles",void 0);R([L({defaultValue:!0}),N({field_type:O.BOOLEAN,label:"Show in Navigation",description:"Whether to include this page in navigation menus"}),F(),z("design:type",Boolean)],Tr.prototype,"showInNavigation",void 0);R([L({defaultValue:0}),N({field_type:O.NUMBER,label:"Navigation Priority",description:"Priority in navigation (lower numbers appear first)"}),F(),z("design:type",Number)],Tr.prototype,"navigationPriority",void 0);R([L({defaultValue:!0}),N({field_type:O.BOOLEAN,label:"Indexable",description:"Whether search engines should index this page"}),F(),z("design:type",Boolean)],Tr.prototype,"indexable",void 0);Tr=R([bt("PageTemplate","1.0.0")],Tr);const ID=k0.create().withName("Control Panel").withId("com.qwickapps.control-panel").withVersion("1.0.0").withDefaultTheme("dark").withDefaultPalette("cosmic").withThemeSwitcher(!0).withPaletteSwitcher(!0).withDisplay("standalone").build();class jD{constructor(e=""){ka(this,"baseUrl");this.baseUrl=e}async getHealth(){const e=await fetch(`${this.baseUrl}/api/health`);if(!e.ok)throw new Error(`Health check failed: ${e.statusText}`);return e.json()}async getInfo(){const e=await fetch(`${this.baseUrl}/api/info`);if(!e.ok)throw new Error(`Info request failed: ${e.statusText}`);return e.json()}async getDiagnostics(){const e=await fetch(`${this.baseUrl}/api/diagnostics`);if(!e.ok)throw new Error(`Diagnostics request failed: ${e.statusText}`);return e.json()}async getConfig(){const e=await fetch(`${this.baseUrl}/api/config`);if(!e.ok)throw new Error(`Config request failed: ${e.statusText}`);return e.json()}async getLogs(e={}){const r=new URLSearchParams;e.source&&r.set("source",e.source),e.level&&r.set("level",e.level),e.search&&r.set("search",e.search),e.limit&&r.set("limit",e.limit.toString()),e.page&&r.set("page",e.page.toString());const n=await fetch(`${this.baseUrl}/api/logs?${r}`);if(!n.ok)throw new Error(`Logs request failed: ${n.statusText}`);return n.json()}async getLogSources(){const e=await fetch(`${this.baseUrl}/api/logs/sources`);if(!e.ok)throw new Error(`Log sources request failed: ${e.statusText}`);return(await e.json()).sources}}const Ka=new jD;function OD(t){const e=Math.floor(t/1e3),r=Math.floor(e/60),n=Math.floor(r/60),i=Math.floor(n/24);return i>0?`${i}d ${n%24}h ${r%60}m`:n>0?`${n}h ${r%60}m`:r>0?`${r}m ${e%60}s`:`${e}s`}function MS(t){switch(t){case"healthy":return h.jsx(_f,{sx:{color:"var(--theme-success)"}});case"degraded":return h.jsx(LC,{sx:{color:"var(--theme-warning)"}});case"unhealthy":return h.jsx(AC,{sx:{color:"var(--theme-error)"}});default:return h.jsx(Gi,{size:20})}}function up(t){switch(t){case"healthy":return"var(--theme-success)";case"degraded":return"var(--theme-warning)";case"unhealthy":return"var(--theme-error)";default:return"var(--theme-text-secondary)"}}function LD(){var v,g;const[t,e]=T.useState(null),[r,n]=T.useState(null),[i,s]=T.useState(!0),[l,c]=T.useState(null);if(T.useEffect(()=>{const y=async()=>{try{const[x,C]=await Promise.all([Ka.getHealth(),Ka.getInfo()]);e(x),n(C),c(null)}catch(x){c(x instanceof Error?x.message:"Failed to fetch data")}finally{s(!1)}};y();const w=setInterval(y,1e4);return()=>clearInterval(w)},[]),i)return h.jsx(Ce,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"50vh"},children:h.jsx(Gi,{})});if(l)return h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",border:"1px solid var(--theme-error)"},children:h.jsx(or,{children:h.jsx(Te,{color:"error",children:l})})});const d=t?Object.entries(t.checks):[],p=d.filter(([,y])=>y.status==="healthy").length,m=d.length;return h.jsxs(Ce,{children:[h.jsx(Te,{variant:"h4",sx:{mb:1,color:"var(--theme-text-primary)"},children:"Dashboard"}),h.jsxs(Te,{variant:"body2",sx:{mb:4,color:"var(--theme-text-secondary)"},children:["Real-time overview of ",(r==null?void 0:r.product)||"your service"]}),h.jsx(rr,{sx:{mb:4,bgcolor:"var(--theme-surface)",border:`2px solid ${up((t==null?void 0:t.status)||"unknown")}`},children:h.jsxs(or,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:2},children:[MS((t==null?void 0:t.status)||"unknown"),h.jsxs(Ce,{children:[h.jsxs(Te,{variant:"h6",sx:{color:"var(--theme-text-primary)"},children:["Service Status: ",(v=t==null?void 0:t.status)==null?void 0:v.charAt(0).toUpperCase(),(g=t==null?void 0:t.status)==null?void 0:g.slice(1)]}),h.jsxs(Te,{variant:"body2",sx:{color:"var(--theme-text-secondary)"},children:["Last updated: ",t!=null&&t.timestamp?new Date(t.timestamp).toLocaleString():"N/A"]})]})]}),h.jsx(Ni,{label:`${p}/${m} checks passing`,sx:{bgcolor:up((t==null?void 0:t.status)||"unknown")+"20",color:up((t==null?void 0:t.status)||"unknown")}})]})}),h.jsxs(Yr,{container:!0,spacing:3,sx:{mb:4},children:[h.jsx(Yr,{size:{xs:12,sm:6,md:3},children:h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",height:"100%"},children:h.jsxs(or,{children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[h.jsx(TC,{sx:{color:"var(--theme-primary)"}}),h.jsx(Te,{variant:"body2",sx:{color:"var(--theme-text-secondary)"},children:"Uptime"})]}),h.jsx(Te,{variant:"h4",sx:{color:"var(--theme-primary)"},children:t?OD(t.uptime):"N/A"})]})})}),h.jsx(Yr,{size:{xs:12,sm:6,md:3},children:h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",height:"100%"},children:h.jsxs(or,{children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[h.jsx(_f,{sx:{color:"var(--theme-success)"}}),h.jsx(Te,{variant:"body2",sx:{color:"var(--theme-text-secondary)"},children:"Health Checks"})]}),h.jsxs(Te,{variant:"h4",sx:{color:"var(--theme-success)"},children:[p,"/",m]})]})})}),h.jsx(Yr,{size:{xs:12,sm:6,md:3},children:h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",height:"100%"},children:h.jsxs(or,{children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[h.jsx(qy,{sx:{color:"var(--theme-warning)"}}),h.jsx(Te,{variant:"body2",sx:{color:"var(--theme-text-secondary)"},children:"Version"})]}),h.jsx(Te,{variant:"h4",sx:{color:"var(--theme-text-primary)"},children:(r==null?void 0:r.version)||"N/A"})]})})}),h.jsx(Yr,{size:{xs:12,sm:6,md:3},children:h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",height:"100%"},children:h.jsxs(or,{children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[h.jsx(Xy,{sx:{color:"var(--theme-info)"}}),h.jsx(Te,{variant:"body2",sx:{color:"var(--theme-text-secondary)"},children:"Product"})]}),h.jsx(Te,{variant:"h5",sx:{color:"var(--theme-text-primary)"},children:(r==null?void 0:r.product)||"N/A"})]})})})]}),h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)"},children:h.jsxs(or,{children:[h.jsx(Te,{variant:"h6",sx:{mb:3,color:"var(--theme-text-primary)"},children:"Health Checks"}),h.jsx(Yr,{container:!0,spacing:2,children:d.map(([y,w])=>h.jsx(Yr,{size:{xs:12,sm:6,md:4},children:h.jsxs(Ce,{sx:{p:2,borderRadius:1,bgcolor:"var(--theme-background)",border:`1px solid ${up(w.status)}40`},children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1},children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1},children:[MS(w.status),h.jsx(Te,{sx:{color:"var(--theme-text-primary)",fontWeight:500},children:y})]}),w.latency!==void 0&&h.jsx(Ni,{label:`${w.latency}ms`,size:"small",sx:{bgcolor:"var(--theme-surface)",color:"var(--theme-text-secondary)"}})]}),w.error&&h.jsx(Te,{variant:"caption",sx:{color:"var(--theme-error)"},children:w.error})]})},y))})]})})]})}function _S(t,e=20){switch(t){case"healthy":return h.jsx(_f,{sx:{color:"var(--theme-success)",fontSize:e}});case"degraded":return h.jsx(LC,{sx:{color:"var(--theme-warning)",fontSize:e}});case"unhealthy":return h.jsx(AC,{sx:{color:"var(--theme-error)",fontSize:e}});default:return h.jsx(Gi,{size:e})}}function dp(t){switch(t){case"healthy":return"var(--theme-success)";case"degraded":return"var(--theme-warning)";case"unhealthy":return"var(--theme-error)";default:return"var(--theme-text-secondary)"}}function ND(t){return t===void 0?"-":t<1e3?`${t}ms`:`${(t/1e3).toFixed(2)}s`}function $D(){var m,v;const[t,e]=T.useState(null),[r,n]=T.useState(!0),[i,s]=T.useState(null);if(T.useEffect(()=>{const g=async()=>{try{const w=await Ka.getHealth();e(w),s(null)}catch(w){s(w instanceof Error?w.message:"Failed to fetch health")}finally{n(!1)}};g();const y=setInterval(g,5e3);return()=>clearInterval(y)},[]),r)return h.jsx(Ce,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"50vh"},children:h.jsx(Gi,{})});if(i)return h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",border:"1px solid var(--theme-error)"},children:h.jsx(or,{children:h.jsx(Te,{color:"error",children:i})})});const l=t?Object.entries(t.checks):[],c=l.filter(([,g])=>g.status==="healthy").length,d=l.length,p=d>0?c/d*100:0;return h.jsxs(Ce,{children:[h.jsx(Te,{variant:"h4",sx:{mb:1,color:"var(--theme-text-primary)"},children:"Health Checks"}),h.jsx(Te,{variant:"body2",sx:{mb:4,color:"var(--theme-text-secondary)"},children:"Detailed view of all service health checks"}),h.jsx(rr,{sx:{mb:4,bgcolor:"var(--theme-surface)"},children:h.jsxs(or,{children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:2},children:[_S((t==null?void 0:t.status)||"unknown",32),h.jsxs(Ce,{children:[h.jsxs(Te,{variant:"h5",sx:{color:"var(--theme-text-primary)"},children:["Overall Status: ",(m=t==null?void 0:t.status)==null?void 0:m.charAt(0).toUpperCase(),(v=t==null?void 0:t.status)==null?void 0:v.slice(1)]}),h.jsxs(Te,{variant:"body2",sx:{color:"var(--theme-text-secondary)"},children:[c," of ",d," checks passing"]})]})]}),h.jsxs(Te,{variant:"h3",sx:{color:dp((t==null?void 0:t.status)||"unknown")},children:[p.toFixed(0),"%"]})]}),h.jsx(sC,{variant:"determinate",value:p,sx:{height:8,borderRadius:4,bgcolor:"var(--theme-background)","& .MuiLinearProgress-bar":{bgcolor:dp((t==null?void 0:t.status)||"unknown"),borderRadius:4}}})]})}),h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)"},children:h.jsx(Dy,{children:h.jsxs(zy,{children:[h.jsx(Fy,{children:h.jsxs(tl,{children:[h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)"},children:"Check"}),h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)"},children:"Status"}),h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)"},children:"Latency"}),h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)"},children:"Last Checked"}),h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)"},children:"Error"})]})}),h.jsx(By,{children:l.map(([g,y])=>h.jsxs(tl,{children:[h.jsx(Gt,{sx:{color:"var(--theme-text-primary)",borderColor:"var(--theme-border)"},children:h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1},children:[_S(y.status),h.jsx(Te,{fontWeight:500,children:g})]})}),h.jsx(Gt,{sx:{borderColor:"var(--theme-border)"},children:h.jsx(Ni,{label:y.status,size:"small",sx:{bgcolor:dp(y.status)+"20",color:dp(y.status),textTransform:"capitalize"}})}),h.jsx(Gt,{sx:{color:"var(--theme-text-primary)",borderColor:"var(--theme-border)"},children:ND(y.latency)}),h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)"},children:new Date(y.lastChecked).toLocaleTimeString()}),h.jsx(Gt,{sx:{color:"var(--theme-error)",borderColor:"var(--theme-border)"},children:y.error||"-"})]},g))})]})})})]})}function AS(t){switch(t.toLowerCase()){case"error":return"var(--theme-error)";case"warn":case"warning":return"var(--theme-warning)";case"info":return"var(--theme-info)";case"debug":return"var(--theme-text-secondary)";default:return"var(--theme-text-primary)"}}function zD(){const[t,e]=T.useState([]),[r,n]=T.useState([]),[i,s]=T.useState(!0),[l,c]=T.useState(null),[d,p]=T.useState(""),[m,v]=T.useState(""),[g,y]=T.useState(""),[w,x]=T.useState(1),[C,P]=T.useState(0),k=50,_=async()=>{s(!0);try{const D=await Ka.getLogs({source:d||void 0,level:m||void 0,search:g||void 0,limit:k,page:w});e(D.logs),P(D.total),c(null)}catch(D){c(D instanceof Error?D.message:"Failed to fetch logs")}finally{s(!1)}},E=async()=>{try{const D=await Ka.getLogSources();n(D)}catch{}};T.useEffect(()=>{E()},[]),T.useEffect(()=>{_()},[d,m,w]);const A=()=>{x(1),_()},I=Math.ceil(C/k);return h.jsxs(Ce,{children:[h.jsx(Te,{variant:"h4",sx:{mb:1,color:"var(--theme-text-primary)"},children:"Logs"}),h.jsx(Te,{variant:"body2",sx:{mb:4,color:"var(--theme-text-secondary)"},children:"View and search application logs"}),h.jsx(rr,{sx:{mb:3,bgcolor:"var(--theme-surface)"},children:h.jsx(or,{children:h.jsxs(Ce,{sx:{display:"flex",gap:2,flexWrap:"wrap",alignItems:"center"},children:[r.length>0&&h.jsxs(Yo,{size:"small",sx:{minWidth:150},children:[h.jsx(Zs,{sx:{color:"var(--theme-text-secondary)"},children:"Source"}),h.jsxs(el,{value:d,label:"Source",onChange:D=>p(D.target.value),sx:{color:"var(--theme-text-primary)"},children:[h.jsx(Dr,{value:"",children:"All Sources"}),r.map(D=>h.jsx(Dr,{value:D.name,children:D.name},D.name))]})]}),h.jsxs(Yo,{size:"small",sx:{minWidth:120},children:[h.jsx(Zs,{sx:{color:"var(--theme-text-secondary)"},children:"Level"}),h.jsxs(el,{value:m,label:"Level",onChange:D=>v(D.target.value),sx:{color:"var(--theme-text-primary)"},children:[h.jsx(Dr,{value:"",children:"All Levels"}),h.jsx(Dr,{value:"error",children:"Error"}),h.jsx(Dr,{value:"warn",children:"Warning"}),h.jsx(Dr,{value:"info",children:"Info"}),h.jsx(Dr,{value:"debug",children:"Debug"})]})]}),h.jsx(Pf,{size:"small",placeholder:"Search logs...",value:g,onChange:D=>y(D.target.value),onKeyPress:D=>D.key==="Enter"&&A(),sx:{flex:1,minWidth:200,"& .MuiInputBase-input":{color:"var(--theme-text-primary)"}},InputProps:{startAdornment:h.jsx(OC,{sx:{mr:1,color:"var(--theme-text-secondary)"}})}}),h.jsx(Ar,{onClick:_,sx:{color:"var(--theme-primary)"},children:h.jsx(Gy,{})})]})})}),l&&h.jsx(rr,{sx:{mb:3,bgcolor:"var(--theme-surface)",border:"1px solid var(--theme-error)"},children:h.jsx(or,{children:h.jsx(Te,{color:"error",children:l})})}),h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)"},children:i?h.jsx(Ce,{sx:{display:"flex",justifyContent:"center",p:4},children:h.jsx(Gi,{})}):t.length===0?h.jsx(or,{children:h.jsx(Te,{sx:{color:"var(--theme-text-secondary)",textAlign:"center"},children:"No logs found"})}):h.jsxs(h.Fragment,{children:[h.jsx(Dy,{children:h.jsxs(zy,{size:"small",children:[h.jsx(Fy,{children:h.jsxs(tl,{children:[h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)",width:180},children:"Timestamp"}),h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)",width:100},children:"Level"}),r.length>0&&h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)",width:120},children:"Source"}),h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)"},children:"Message"})]})}),h.jsx(By,{children:t.map((D,$)=>h.jsxs(tl,{hover:!0,children:[h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)",fontFamily:"monospace",fontSize:"0.75rem"},children:new Date(D.timestamp).toLocaleString()}),h.jsx(Gt,{sx:{borderColor:"var(--theme-border)"},children:h.jsx(Ni,{label:D.level.toUpperCase(),size:"small",sx:{bgcolor:AS(D.level)+"20",color:AS(D.level),fontSize:"0.65rem",height:20}})}),r.length>0&&h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)"},children:D.source||"-"}),h.jsx(Gt,{sx:{color:"var(--theme-text-primary)",borderColor:"var(--theme-border)",fontFamily:"monospace",fontSize:"0.8rem",whiteSpace:"pre-wrap",wordBreak:"break-all"},children:D.message})]},$))})]})}),I>1&&h.jsx(Ce,{sx:{display:"flex",justifyContent:"center",p:2},children:h.jsx(yO,{count:I,page:w,onChange:(D,$)=>x($),sx:{"& .MuiPaginationItem-root":{color:"var(--theme-text-primary)"}}})})]})})]})}function BD(){const[t,e]=T.useState(null),[r,n]=T.useState(!0),[i,s]=T.useState(null),[l,c]=T.useState({}),[d,p]=T.useState({open:!1,message:""});T.useEffect(()=>{(async()=>{try{const C=await Ka.getConfig();e(C),s(null)}catch(C){s(C instanceof Error?C.message:"Failed to fetch config")}finally{n(!1)}})()},[]);const m=x=>{navigator.clipboard.writeText(x),p({open:!0,message:"Copied to clipboard"})},v=x=>{c(C=>({...C,[x]:!C[x]}))},g=x=>!(t!=null&&t.masked)||!Array.isArray(t.masked)?!1:t.masked.some(C=>x.toUpperCase().includes(C.toUpperCase())),y=(x,C)=>{const P=String(C);return g(x)&&!l[x]?"••••••••":P};if(r)return h.jsx(Ce,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"50vh"},children:h.jsx(Gi,{})});if(i)return h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",border:"1px solid var(--theme-error)"},children:h.jsx(or,{children:h.jsx(Te,{color:"error",children:i})})});const w=t?Object.entries(t.config):[];return h.jsxs(Ce,{children:[h.jsx(Te,{variant:"h4",sx:{mb:1,color:"var(--theme-text-primary)"},children:"Configuration"}),h.jsx(Te,{variant:"body2",sx:{mb:4,color:"var(--theme-text-secondary)"},children:"Current environment configuration (read-only)"}),h.jsxs(rr,{sx:{bgcolor:"var(--theme-surface)"},children:[h.jsx(Dy,{children:h.jsxs(zy,{children:[h.jsx(Fy,{children:h.jsxs(tl,{children:[h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)"},children:"Variable"}),h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)"},children:"Value"}),h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)",width:100},children:"Actions"})]})}),h.jsx(By,{children:w.map(([x,C])=>h.jsxs(tl,{children:[h.jsx(Gt,{sx:{borderColor:"var(--theme-border)"},children:h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1},children:[h.jsx(Te,{sx:{color:"var(--theme-text-primary)",fontFamily:"monospace"},children:x}),g(x)&&h.jsx(Ni,{icon:h.jsx(jC,{sx:{fontSize:14}}),label:"Sensitive",size:"small",sx:{bgcolor:"var(--theme-warning)20",color:"var(--theme-warning)",height:20,"& .MuiChip-icon":{color:"var(--theme-warning)"}}})]})}),h.jsx(Gt,{sx:{color:"var(--theme-text-primary)",borderColor:"var(--theme-border)",fontFamily:"monospace"},children:y(x,C)}),h.jsx(Gt,{sx:{borderColor:"var(--theme-border)"},children:h.jsxs(Ce,{sx:{display:"flex",gap:.5},children:[g(x)&&h.jsx(Tn,{title:l[x]?"Hide value":"Show value",children:h.jsx(Ar,{size:"small",onClick:()=>v(x),sx:{color:"var(--theme-text-secondary)"},children:l[x]?h.jsx(Qy,{fontSize:"small"}):h.jsx(Ky,{fontSize:"small"})})}),h.jsx(Tn,{title:"Copy value",children:h.jsx(Ar,{size:"small",onClick:()=>m(String(C)),sx:{color:"var(--theme-text-secondary)"},children:h.jsx(Wy,{fontSize:"small"})})})]})})]},x))})]})}),w.length===0&&h.jsx(or,{children:h.jsx(Te,{sx:{color:"var(--theme-text-secondary)",textAlign:"center"},children:"No configuration variables available"})})]}),h.jsx($y,{open:d.open,autoHideDuration:2e3,onClose:()=>p({...d,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:h.jsx(Qa,{severity:"success",variant:"filled",children:d.message})})]})}function tg(t){if(t===0)return"0 B";const e=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(t)/Math.log(e));return parseFloat((t/Math.pow(e,n)).toFixed(2))+" "+r[n]}function DD(t){const e=Math.floor(t/1e3),r=Math.floor(e/60),n=Math.floor(r/60),i=Math.floor(n/24);return i>0?`${i}d ${n%24}h ${r%60}m`:n>0?`${n}h ${r%60}m ${e%60}s`:r>0?`${r}m ${e%60}s`:`${e}s`}function FD(){const[t,e]=T.useState(null),[r,n]=T.useState(!0),[i,s]=T.useState(null),[l,c]=T.useState({open:!1,message:""}),d=async()=>{n(!0);try{const v=await Ka.getDiagnostics();e(v),s(null)}catch(v){s(v instanceof Error?v.message:"Failed to fetch diagnostics")}finally{n(!1)}};T.useEffect(()=>{d();const v=setInterval(d,3e4);return()=>clearInterval(v)},[]);const p=()=>{navigator.clipboard.writeText(JSON.stringify(t,null,2)),c({open:!0,message:"Diagnostics copied to clipboard"})};if(r&&!t)return h.jsx(Ce,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"50vh"},children:h.jsx(Gi,{})});if(i)return h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",border:"1px solid var(--theme-error)"},children:h.jsx(or,{children:h.jsx(Te,{color:"error",children:i})})});const m=t?t.system.memory.used/t.system.memory.total*100:0;return h.jsxs(Ce,{children:[h.jsxs(Ce,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[h.jsx(Te,{variant:"h4",sx:{color:"var(--theme-text-primary)"},children:"Diagnostics"}),h.jsxs(Ce,{sx:{display:"flex",gap:1},children:[h.jsx(Tn,{title:"Copy diagnostics JSON",children:h.jsx(Ar,{onClick:p,sx:{color:"var(--theme-primary)"},children:h.jsx(Wy,{})})}),h.jsx(Tn,{title:"Refresh",children:h.jsx(Ar,{onClick:d,sx:{color:"var(--theme-primary)"},children:h.jsx(Gy,{})})})]})]}),h.jsx(Te,{variant:"body2",sx:{mb:4,color:"var(--theme-text-secondary)"},children:"System information and health diagnostics for AI agents and troubleshooting"}),h.jsxs(Yr,{container:!0,spacing:3,children:[h.jsx(Yr,{size:{xs:12,md:6},children:h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",height:"100%"},children:h.jsxs(or,{children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1,mb:3},children:[h.jsx(_C,{sx:{color:"var(--theme-primary)"}}),h.jsx(Te,{variant:"h6",sx:{color:"var(--theme-text-primary)"},children:"System Information"})]}),h.jsxs(Ce,{sx:{display:"flex",flexDirection:"column",gap:2},children:[h.jsxs(Ce,{sx:{display:"flex",justifyContent:"space-between"},children:[h.jsx(Te,{sx:{color:"var(--theme-text-secondary)"},children:"Node.js"}),h.jsx(Ni,{label:t==null?void 0:t.system.nodeVersion,size:"small",sx:{bgcolor:"var(--theme-background)",color:"var(--theme-text-primary)"}})]}),h.jsxs(Ce,{sx:{display:"flex",justifyContent:"space-between"},children:[h.jsx(Te,{sx:{color:"var(--theme-text-secondary)"},children:"Platform"}),h.jsx(Ni,{label:t==null?void 0:t.system.platform,size:"small",sx:{bgcolor:"var(--theme-background)",color:"var(--theme-text-primary)"}})]}),h.jsxs(Ce,{sx:{display:"flex",justifyContent:"space-between"},children:[h.jsx(Te,{sx:{color:"var(--theme-text-secondary)"},children:"Architecture"}),h.jsx(Ni,{label:t==null?void 0:t.system.arch,size:"small",sx:{bgcolor:"var(--theme-background)",color:"var(--theme-text-primary)"}})]})]})]})})}),h.jsx(Yr,{size:{xs:12,md:6},children:h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",height:"100%"},children:h.jsxs(or,{children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1,mb:3},children:[h.jsx(qy,{sx:{color:"var(--theme-warning)"}}),h.jsx(Te,{variant:"h6",sx:{color:"var(--theme-text-primary)"},children:"Memory Usage"})]}),h.jsxs(Ce,{sx:{mb:2},children:[h.jsxs(Ce,{sx:{display:"flex",justifyContent:"space-between",mb:1},children:[h.jsx(Te,{sx:{color:"var(--theme-text-secondary)"},children:"Heap Used"}),h.jsx(Te,{sx:{color:"var(--theme-text-primary)"},children:tg((t==null?void 0:t.system.memory.used)||0)})]}),h.jsx(sC,{variant:"determinate",value:m,sx:{height:8,borderRadius:4,bgcolor:"var(--theme-background)","& .MuiLinearProgress-bar":{bgcolor:m>80?"var(--theme-error)":"var(--theme-warning)",borderRadius:4}}})]}),h.jsxs(Ce,{sx:{display:"flex",flexDirection:"column",gap:2},children:[h.jsxs(Ce,{sx:{display:"flex",justifyContent:"space-between"},children:[h.jsx(Te,{sx:{color:"var(--theme-text-secondary)"},children:"Heap Total"}),h.jsx(Te,{sx:{color:"var(--theme-text-primary)"},children:tg((t==null?void 0:t.system.memory.total)||0)})]}),h.jsxs(Ce,{sx:{display:"flex",justifyContent:"space-between"},children:[h.jsx(Te,{sx:{color:"var(--theme-text-secondary)"},children:"Heap Free"}),h.jsx(Te,{sx:{color:"var(--theme-text-primary)"},children:tg((t==null?void 0:t.system.memory.free)||0)})]})]})]})})}),h.jsx(Yr,{size:{xs:12,md:6},children:h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",height:"100%"},children:h.jsxs(or,{children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1,mb:3},children:[h.jsx(Xy,{sx:{color:"var(--theme-info)"}}),h.jsx(Te,{variant:"h6",sx:{color:"var(--theme-text-primary)"},children:"Service Info"})]}),h.jsxs(Ce,{sx:{display:"flex",flexDirection:"column",gap:2},children:[h.jsxs(Ce,{sx:{display:"flex",justifyContent:"space-between"},children:[h.jsx(Te,{sx:{color:"var(--theme-text-secondary)"},children:"Product"}),h.jsx(Te,{sx:{color:"var(--theme-text-primary)"},children:t==null?void 0:t.product})]}),h.jsxs(Ce,{sx:{display:"flex",justifyContent:"space-between"},children:[h.jsx(Te,{sx:{color:"var(--theme-text-secondary)"},children:"Version"}),h.jsx(Ni,{label:(t==null?void 0:t.version)||"N/A",size:"small",sx:{bgcolor:"var(--theme-primary)20",color:"var(--theme-primary)"}})]}),h.jsxs(Ce,{sx:{display:"flex",justifyContent:"space-between"},children:[h.jsx(Te,{sx:{color:"var(--theme-text-secondary)"},children:"Timestamp"}),h.jsx(Te,{sx:{color:"var(--theme-text-primary)",fontSize:"0.875rem"},children:t!=null&&t.timestamp?new Date(t.timestamp).toLocaleString():"N/A"})]})]})]})})}),h.jsx(Yr,{size:{xs:12,md:6},children:h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",height:"100%"},children:h.jsxs(or,{children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1,mb:3},children:[h.jsx(TC,{sx:{color:"var(--theme-success)"}}),h.jsx(Te,{variant:"h6",sx:{color:"var(--theme-text-primary)"},children:"Uptime"})]}),h.jsx(Te,{variant:"h3",sx:{color:"var(--theme-success)",mb:1},children:DD((t==null?void 0:t.uptime)||0)}),h.jsx(Te,{sx:{color:"var(--theme-text-secondary)"},children:"Service has been running without interruption"})]})})}),h.jsx(Yr,{size:{xs:12},children:h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)"},children:h.jsxs(or,{children:[h.jsx(Te,{variant:"h6",sx:{color:"var(--theme-text-primary)",mb:2},children:"Raw Diagnostics JSON (for AI agents)"}),h.jsx(Ce,{component:"pre",sx:{bgcolor:"var(--theme-background)",p:2,borderRadius:1,overflow:"auto",maxHeight:300,color:"var(--theme-text-primary)",fontFamily:"monospace",fontSize:"0.75rem"},children:JSON.stringify(t,null,2)})]})})})]}),h.jsx($y,{open:l.open,autoHideDuration:2e3,onClose:()=>c({...l,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:h.jsx(Qa,{severity:"success",variant:"filled",children:l.message})})]})}function HD(){const t=n3();return h.jsxs(Ce,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"50vh",textAlign:"center"},children:[h.jsx(Te,{variant:"h1",sx:{color:"var(--theme-primary)",mb:2},children:"404"}),h.jsx(Te,{variant:"h5",sx:{color:"var(--theme-text-primary)",mb:1},children:"Page Not Found"}),h.jsx(Te,{sx:{color:"var(--theme-text-secondary)",mb:4},children:"The page you're looking for doesn't exist or has been moved."}),h.jsx(qc,{variant:"contained",startIcon:h.jsx(IC,{}),onClick:()=>t("/"),sx:{bgcolor:"var(--theme-primary)","&:hover":{bgcolor:"var(--theme-primary)"}},children:"Back to Dashboard"})]})}const VD="1.0.0",UD=h.jsx(cD,{name:"Control Panel"}),WD=h.jsx(Ce,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:2},children:h.jsxs(ho,{variant:"caption",customColor:"var(--theme-text-secondary)",children:["Built with"," ",h.jsx(gj,{href:"https://qwickapps.com/products/qwickapps-server",target:"_blank",rel:"noopener noreferrer",sx:{color:"primary.main"},children:"QwickApps Server"})," ","v",VD]})});function qD(){return h.jsx(C3,{children:h.jsx(sD,{config:ID,logo:UD,footerContent:WD,enableScaffolding:!0,navigationItems:[{id:"dashboard",label:"Dashboard",route:"/",icon:"dashboard"},{id:"health",label:"Health",route:"/health",icon:"favorite"},{id:"logs",label:"Logs",route:"/logs",icon:"article"},{id:"config",label:"Config",route:"/config",icon:"settings"},{id:"diagnostics",label:"Diagnostics",route:"/diagnostics",icon:"bug_report"}],showThemeSwitcher:!0,showPaletteSwitcher:!0,children:h.jsxs(x3,{children:[h.jsx(Ra,{path:"/",element:h.jsx(LD,{})}),h.jsx(Ra,{path:"/health",element:h.jsx($D,{})}),h.jsx(Ra,{path:"/logs",element:h.jsx(zD,{})}),h.jsx(Ra,{path:"/config",element:h.jsx(BD,{})}),h.jsx(Ra,{path:"/diagnostics",element:h.jsx(FD,{})}),h.jsx(Ra,{path:"*",element:h.jsx(HD,{})})]})})})}kP.createRoot(document.getElementById("root")).render(h.jsx(pt.StrictMode,{children:h.jsx(qD,{})}));
|
|
465
|
-
//# sourceMappingURL=index-
|
|
464
|
+
`)}`);const r=this.applyDefaults();return new T0(r)}validate(){const e=[],r=[];if(this.config.app.name||r.push("App name is required"),this.config.app.id||r.push("App ID is required"),this.config.copyright.year&&this.config.copyright.year!=="auto"&&(!Number.isInteger(this.config.copyright.year)||this.config.copyright.year<1900)&&e.push('Copyright year should be "auto" or a valid year >= 1900'),this.config.app.logo&&!this.options.skipValidation&&kc&&Pc){const n=Pc.resolve(this.options.baseDir||process.cwd(),this.config.app.logo);kc.existsSync(n)||e.push(`Logo file not found: ${this.config.app.logo} (will use default)`)}return this.config.build.port!==void 0&&(!Number.isInteger(this.config.build.port)||this.config.build.port<1||this.config.build.port>65535)&&r.push("Port must be a valid integer between 1 and 65535"),this.config.build.previewPort!==void 0&&(!Number.isInteger(this.config.build.previewPort)||this.config.build.previewPort<1||this.config.build.previewPort>65535)&&r.push("Preview port must be a valid integer between 1 and 65535"),this.config.pwa.themeColor&&!this.isValidColor(this.config.pwa.themeColor)&&e.push(`Theme color may not be valid: ${this.config.pwa.themeColor}`),this.config.pwa.backgroundColor&&!this.isValidColor(this.config.pwa.backgroundColor)&&e.push(`Background color may not be valid: ${this.config.pwa.backgroundColor}`),{warnings:e,errors:r,isValid:r.length===0}}applyDefaults(){const e={id:this.config.app.id,name:this.config.app.name,shortName:this.config.app.shortName||this.config.app.name,description:this.config.app.description||this.config.app.name,version:this.config.app.version||"1.0.0",logo:this.config.app.logo||"/favicon.ico",author:this.config.app.author,homepage:this.config.app.homepage},r={port:this.config.build.port||3e3,previewPort:this.config.build.previewPort||4173,outputDir:this.config.build.outputDir||"dist",publicPath:this.config.build.publicPath||"/",base:this.config.build.base||"/"},n={themeColor:this.config.pwa.themeColor||"#000000",backgroundColor:this.config.pwa.backgroundColor||"#ffffff",startUrl:this.config.pwa.startUrl||"/",scope:this.config.pwa.scope||"/",display:this.config.pwa.display||"standalone",orientation:this.config.pwa.orientation},i={defaultTheme:this.config.ui.defaultTheme||"light",defaultPalette:this.config.ui.defaultPalette||"default",enableScaffolding:this.config.ui.enableScaffolding??!0,showThemeSwitcher:this.config.ui.showThemeSwitcher??!1,showPaletteSwitcher:this.config.ui.showPaletteSwitcher??!1},s={year:this.config.copyright.year||"auto",author:this.config.copyright.author||e.author||e.name,text:this.config.copyright.text};return{app:e,build:r,pwa:n,ui:i,copyright:s}}isValidColor(e){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e)||/^(black|white|red|green|blue|yellow|orange|purple|pink|gray|grey)$/i.test(e)||/^rgba?\([^)]+\)$/i.test(e)}}let vo=class extends tt{};R([L(),N({field_type:O.TEXT,label:"Field Label",description:"Label/title for the choice input field",placeholder:"Options"}),F(),te(),z("design:type",String)],vo.prototype,"label",void 0);R([L(),N({field_type:O.TEXTAREA,label:"Options",description:"Array of option values (HTML content supported) - JSON array format"}),F(),kr(),te({each:!0}),z("design:type",Array)],vo.prototype,"options",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Disabled",description:"Whether the input fields are disabled"}),F(),gt(),z("design:type",Boolean)],vo.prototype,"disabled",void 0);R([L(),N({field_type:O.TEXT,label:"Placeholder Text",description:"Placeholder text for option inputs",placeholder:"Enter option text. HTML formatting supported."}),F(),te(),z("design:type",String)],vo.prototype,"placeholder",void 0);R([L(),N({field_type:O.TEXT,label:"Option Label Prefix",description:'Prefix for each option label (e.g., "Option", "Choice")',placeholder:"Option"}),F(),te(),z("design:type",String)],vo.prototype,"optionLabelPrefix",void 0);R([L({defaultValue:2}),N({field_type:O.NUMBER,label:"Input Rows",description:"Number of rows for each option input field"}),F(),Qt(),z("design:type",Number)],vo.prototype,"rows",void 0);R([L(),N({field_type:O.TEXT,label:"Add Button Text",description:"Text for the add option button",placeholder:"Add Option"}),F(),te(),z("design:type",String)],vo.prototype,"addButtonText",void 0);vo=R([bt("ChoiceInputField","1.0.0")],vo);let bo=class extends WC{};R([L(),N({field_type:O.TEXTAREA,label:"Content",description:"Raw code text. If provided, React children are ignored in serialization.",placeholder:"Enter code content..."}),F(),te(),z("design:type",String)],bo.prototype,"content",void 0);R([L(),N({field_type:O.TEXT,label:"Language",description:"Programming language for syntax highlighting (e.g., typescript, javascript, python)",placeholder:"javascript"}),F(),te(),z("design:type",String)],bo.prototype,"language",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Show Copy Button",description:"Display a copy-to-clipboard button"}),F(),gt(),z("design:type",Boolean)],bo.prototype,"showCopy",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Show Line Numbers",description:"Display line numbers alongside the code"}),F(),gt(),z("design:type",Boolean)],bo.prototype,"showLineNumbers",void 0);R([L(),N({field_type:O.TEXT,label:"Title",description:"Optional title or filename to display above the code",placeholder:"File name or title"}),F(),te(),z("design:type",String)],bo.prototype,"title",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Wrap Long Lines",description:"Allow long lines to wrap instead of scrolling horizontally"}),F(),gt(),z("design:type",Boolean)],bo.prototype,"wrapLines",void 0);R([L(),N({field_type:O.TEXT,label:"Background Color",description:"Custom background color override",placeholder:"#f5f5f5"}),F(),te(),z("design:type",String)],bo.prototype,"codeBackground",void 0);bo=R([bt("Code","1.0.0")],bo);let hn=class extends mo{};R([L(),N({field_type:O.NUMBER,label:"Span",description:"Number of columns to span (1-12)",placeholder:"12"}),F(),Qt(),Re([1,2,3,4,5,6,7,8,9,10,11,12]),z("design:type",Number)],hn.prototype,"span",void 0);R([L(),N({field_type:O.NUMBER,label:"XS (Mobile)",description:"Columns on extra small screens (1-12)",placeholder:"12"}),F(),Qt(),Re([1,2,3,4,5,6,7,8,9,10,11,12]),z("design:type",Number)],hn.prototype,"xs",void 0);R([L(),N({field_type:O.NUMBER,label:"SM (Tablet)",description:"Columns on small screens (1-12)",placeholder:"6"}),F(),Qt(),Re([1,2,3,4,5,6,7,8,9,10,11,12]),z("design:type",Number)],hn.prototype,"sm",void 0);R([L(),N({field_type:O.NUMBER,label:"MD (Desktop)",description:"Columns on medium screens (1-12)",placeholder:"4"}),F(),Qt(),Re([1,2,3,4,5,6,7,8,9,10,11,12]),z("design:type",Number)],hn.prototype,"md",void 0);R([L(),N({field_type:O.NUMBER,label:"LG (Large Desktop)",description:"Columns on large screens (1-12)",placeholder:"3"}),F(),Qt(),Re([1,2,3,4,5,6,7,8,9,10,11,12]),z("design:type",Number)],hn.prototype,"lg",void 0);R([L(),N({field_type:O.NUMBER,label:"XL (Extra Large)",description:"Columns on extra large screens (1-12)",placeholder:"2"}),F(),Qt(),Re([1,2,3,4,5,6,7,8,9,10,11,12]),z("design:type",Number)],hn.prototype,"xl",void 0);R([L(),N({field_type:O.TEXT,label:"Background",description:'Background color or theme color (e.g., "primary.main", "#ffffff")',placeholder:"transparent"}),F(),te(),z("design:type",String)],hn.prototype,"background",void 0);R([L(),N({field_type:O.TEXT,label:"Padding",description:'Internal spacing (e.g., "medium", "16px", "1rem")',placeholder:"medium"}),F(),te(),z("design:type",String)],hn.prototype,"padding",void 0);R([L(),N({field_type:O.TEXT,label:"Margin",description:'External spacing (e.g., "small", "8px", "0.5rem")',placeholder:"0"}),F(),te(),z("design:type",String)],hn.prototype,"margin",void 0);R([L(),N({field_type:O.TEXT,label:"Height",description:'Cell height (e.g., "200px", "medium")',placeholder:"auto"}),F(),te(),z("design:type",String)],hn.prototype,"height",void 0);R([L(),N({field_type:O.TEXT,label:"Width",description:'Cell width (e.g., "100%", "300px")',placeholder:"100%"}),F(),te(),z("design:type",String)],hn.prototype,"width",void 0);R([L(),N({field_type:O.TEXT,label:"CSS Class",description:"Additional CSS class names",placeholder:"custom-cell-class"}),F(),te(),z("design:type",String)],hn.prototype,"className",void 0);hn=R([bt("GridCell","1.0.0")],hn);let Xn=class extends mo{};R([L(),N({field_type:O.NUMBER,label:"Columns",description:"Number of equal-width columns for auto-distribution"}),F(),Qt(),yn(1),z("design:type",Number)],Xn.prototype,"columns",void 0);R([L({defaultValue:"small"}),N({field_type:O.SELECT,label:"Spacing",description:"Spacing between grid items"}),F(),te(),Re(["tiny","small","medium","large","huge"]),z("design:type",String)],Xn.prototype,"spacing",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Equal Height",description:"Make all grid items the same height"}),F(),gt(),z("design:type",Boolean)],Xn.prototype,"equalHeight",void 0);R([L(),N({field_type:O.TEXT,label:"Height",description:'Grid container height (e.g., "400px", "50vh", "medium")',placeholder:"auto"}),F(),te(),z("design:type",String)],Xn.prototype,"height",void 0);R([L(),N({field_type:O.TEXT,label:"Width",description:'Grid container width (e.g., "100%", "800px", "large")',placeholder:"100%"}),F(),te(),z("design:type",String)],Xn.prototype,"width",void 0);R([L(),N({field_type:O.TEXT,label:"Min Height",description:"Minimum grid container height",placeholder:"auto"}),F(),te(),z("design:type",String)],Xn.prototype,"minHeight",void 0);R([L(),N({field_type:O.TEXT,label:"Min Width",description:"Minimum grid container width",placeholder:"auto"}),F(),te(),z("design:type",String)],Xn.prototype,"minWidth",void 0);R([L(),N({field_type:O.TEXT,label:"Max Height",description:"Maximum grid container height",placeholder:"none"}),F(),te(),z("design:type",String)],Xn.prototype,"maxHeight",void 0);R([L(),N({field_type:O.TEXT,label:"Max Width",description:"Maximum grid container width",placeholder:"none"}),F(),te(),z("design:type",String)],Xn.prototype,"maxWidth",void 0);R([L(),N({field_type:O.TEXT,label:"CSS Class",description:"Additional CSS class names",placeholder:"custom-grid-class"}),F(),te(),z("design:type",String)],Xn.prototype,"className",void 0);Xn=R([bt("GridLayout","1.0.0")],Xn);let Kn=class extends mo{};R([L(),N({field_type:O.TEXT,label:"Title",description:"Main headline text",placeholder:"Enter hero title..."}),te(),z("design:type",String)],Kn.prototype,"title",void 0);R([L(),N({field_type:O.TEXT,label:"Subtitle",description:"Subtitle or description text",placeholder:"Enter subtitle..."}),F(),te(),z("design:type",String)],Kn.prototype,"subtitle",void 0);R([L(),N({field_type:O.IMAGE,label:"Background Image",description:"Background image URL",placeholder:"https://..."}),F(),Mf(),z("design:type",String)],Kn.prototype,"backgroundImage",void 0);R([L(),N({field_type:O.TEXT,label:"Background Gradient",description:"Background gradient CSS value",placeholder:"linear-gradient(...)"}),F(),te(),z("design:type",String)],Kn.prototype,"backgroundGradient",void 0);R([L({defaultValue:"default"}),N({field_type:O.SELECT,label:"Background Color",description:"Background color theme variant",validation:{options:[{label:"Default",value:"default"},{label:"Primary",value:"primary"},{label:"Secondary",value:"secondary"},{label:"Surface",value:"surface"}]}}),F(),Re(["default","primary","secondary","surface"]),z("design:type",String)],Kn.prototype,"backgroundColor",void 0);R([L({type:Ge.ARRAY}),N({field_type:O.REPEATER,label:"Actions",description:"Action buttons for the hero section"}),F(),kr(),gn({each:!0}),vn(()=>pn),z("design:type",Array)],Kn.prototype,"actions",void 0);R([L({defaultValue:"center"}),N({field_type:O.SELECT,label:"Text Alignment",description:"Text alignment",validation:{options:[{label:"Left",value:"left"},{label:"Center",value:"center"},{label:"Right",value:"right"}]}}),F(),Re(["left","center","right"]),z("design:type",String)],Kn.prototype,"textAlign",void 0);R([L({defaultValue:"medium"}),N({field_type:O.SELECT,label:"Block Height",description:"Block height preset",validation:{options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"},{label:"Large",value:"large"},{label:"Viewport",value:"viewport"}]}}),F(),Re(["small","medium","large","viewport"]),z("design:type",String)],Kn.prototype,"blockHeight",void 0);R([L(),N({field_type:O.NUMBER,label:"Overlay Opacity",description:"Custom overlay opacity (0-1) when using background images",validation:{min:0,max:1}}),F(),Qt(),yn(0),Za(1),z("design:type",Number)],Kn.prototype,"overlayOpacity",void 0);R([L(),N({field_type:O.TEXT,label:"CSS Class",description:"Additional CSS class name",placeholder:"custom-hero-class"}),F(),te(),z("design:type",String)],Kn.prototype,"className",void 0);Kn=R([bt("HeroBlock","1.0.0")],Kn);let vr=class extends tt{};R([L({dataType:Ge.STRING}),N({field_type:O.IMAGE,label:"Image Source",description:"Image source URL or path",placeholder:"https://example.com/image.jpg"}),F(),te(),z("design:type",String)],vr.prototype,"src",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXT,label:"Alt Text",description:"Alternative text for accessibility (required for images with src)",placeholder:"Describe the image for screen readers"}),F(),te(),z("design:type",String)],vr.prototype,"alt",void 0);R([L({dataType:Ge.NUMBER}),N({field_type:O.NUMBER,label:"Width",description:"Image width in pixels (optional)",placeholder:"300"}),F(),Qt(),z("design:type",Number)],vr.prototype,"width",void 0);R([L({dataType:Ge.NUMBER}),N({field_type:O.NUMBER,label:"Height",description:"Image height in pixels (optional)",placeholder:"200"}),F(),Qt(),z("design:type",Number)],vr.prototype,"height",void 0);R([L({defaultValue:"cover",dataType:Ge.STRING}),N({field_type:O.SELECT,label:"Object Fit",description:"How the image should be resized to fit its container",validation:{options:[{label:"Fill",value:"fill"},{label:"Contain",value:"contain"},{label:"Cover",value:"cover"},{label:"None",value:"none"},{label:"Scale Down",value:"scale-down"}]}}),F(),te(),Re(["fill","contain","cover","none","scale-down"]),z("design:type",String)],vr.prototype,"objectFit",void 0);R([L({defaultValue:"center",dataType:Ge.STRING}),N({field_type:O.SELECT,label:"Object Position",description:"Position of the image within its container",validation:{options:[{label:"Center",value:"center"},{label:"Top",value:"top"},{label:"Bottom",value:"bottom"},{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Top Left",value:"top-left"},{label:"Top Right",value:"top-right"},{label:"Bottom Left",value:"bottom-left"},{label:"Bottom Right",value:"bottom-right"}]}}),F(),te(),Re(["center","top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]),z("design:type",String)],vr.prototype,"objectPosition",void 0);R([L({defaultValue:"lazy",dataType:Ge.STRING}),N({field_type:O.SELECT,label:"Loading",description:"Image loading behavior",validation:{options:[{label:"Lazy (load when visible)",value:"lazy"},{label:"Eager (load immediately)",value:"eager"}]}}),F(),te(),Re(["lazy","eager"]),z("design:type",String)],vr.prototype,"loading",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXT,label:"Title",description:"Image title (tooltip text)",placeholder:"Tooltip text on hover"}),F(),te(),z("design:type",String)],vr.prototype,"title",void 0);R([L({defaultValue:!1,dataType:Ge.BOOLEAN}),N({field_type:O.BOOLEAN,label:"Draggable",description:"Allow the image to be dragged"}),F(),gt(),z("design:type",Boolean)],vr.prototype,"draggable",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXT,label:"Border Radius",description:'CSS border radius (e.g., "8px", "50%", "1rem")',placeholder:"8px"}),F(),te(),z("design:type",String)],vr.prototype,"borderRadius",void 0);R([L({defaultValue:!1,dataType:Ge.BOOLEAN}),N({field_type:O.BOOLEAN,label:"Show Loading State",description:"Display a loading placeholder while the image loads"}),F(),gt(),z("design:type",Boolean)],vr.prototype,"showLoading",void 0);R([L({defaultValue:!1,dataType:Ge.BOOLEAN}),N({field_type:O.BOOLEAN,label:"Show Error State",description:"Display an error message if the image fails to load"}),F(),gt(),z("design:type",Boolean)],vr.prototype,"showError",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXT,label:"Fallback Image",description:"Fallback image URL to use if the main image fails to load",placeholder:"https://example.com/fallback.jpg"}),F(),te(),z("design:type",String)],vr.prototype,"fallbackSrc",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXTAREA,label:"Responsive Sizes",description:"Responsive image sizes attribute for optimized loading",placeholder:"(max-width: 768px) 100vw, 50vw"}),F(),te(),z("design:type",String)],vr.prototype,"sizes",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXTAREA,label:"Source Set",description:"Source set for responsive images (comma-separated)",placeholder:"image-320w.jpg 320w, image-640w.jpg 640w, image-1280w.jpg 1280w"}),F(),te(),z("design:type",String)],vr.prototype,"srcSet",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXTAREA,label:"Loading Placeholder",description:"Custom loading placeholder content (for advanced use)",placeholder:"Custom loading content..."}),F(),z("design:type",Object)],vr.prototype,"loadingPlaceholder",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXTAREA,label:"Error Placeholder",description:"Custom error placeholder content (for advanced use)",placeholder:"Custom error content..."}),F(),z("design:type",Object)],vr.prototype,"errorPlaceholder",void 0);vr=R([bt("Image","1.0.0")],vr);let Xa=class extends mo{};R([L(),N({field_type:O.TEXT,label:"Background Color",description:"Background color (CSS color, theme path, or palette color)",placeholder:"#ffffff or primary.main"}),F(),te(),z("design:type",String)],Xa.prototype,"background",void 0);R([L(),N({field_type:O.TEXT,label:"Text Color",description:"Text color (CSS color, theme path, or palette color)",placeholder:"#000000 or text.primary"}),F(),te(),z("design:type",String)],Xa.prototype,"color",void 0);R([L(),N({field_type:O.SELECT,label:"Section Padding",description:"Vertical padding/spacing for the section",validation:{options:[{value:"none",label:"None"},{value:"tiny",label:"Tiny (8px)"},{value:"small",label:"Small (16px)"},{value:"medium",label:"Medium (32px)"},{value:"large",label:"Large (64px)"},{value:"extra-large",label:"Extra Large (96px)"}]}}),F(),Re(["none","tiny","small","medium","large","extra-large"]),z("design:type",String)],Xa.prototype,"padding",void 0);R([L(),N({field_type:O.SELECT,label:"Content Max Width",description:"Maximum width for the content container",validation:{options:[{value:"xs",label:"Extra Small (444px)"},{value:"sm",label:"Small (600px)"},{value:"md",label:"Medium (900px)"},{value:"lg",label:"Large (1200px)"},{value:"xl",label:"Extra Large (1536px)"},{value:"false",label:"Full Width"}]}}),F(),Re(["xs","sm","md","lg","xl","false"]),z("design:type",String)],Xa.prototype,"contentMaxWidth",void 0);R([L(),N({field_type:O.SELECT,label:"HTML Element",description:"HTML element type to use for the section",validation:{options:[{value:"section",label:"Section"},{value:"div",label:"Div"},{value:"article",label:"Article"},{value:"main",label:"Main"}]}}),F(),Re(["section","div","article","main"]),z("design:type",String)],Xa.prototype,"component",void 0);Xa=R([bt("Section","1.0.0")],Xa);let In=class extends tt{};R([L(),N({field_type:O.TEXT,label:"Field Label",description:"The label displayed for the text input field",placeholder:"Enter field label..."}),te(),z("design:type",String)],In.prototype,"label",void 0);R([L(),N({field_type:O.TEXT,label:"Value",description:"Current field value",placeholder:"Enter value..."}),F(),te(),z("design:type",String)],In.prototype,"value",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Required",description:"Whether the field is required"}),F(),gt(),z("design:type",Boolean)],In.prototype,"required",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Disabled",description:"Whether the field is disabled"}),F(),gt(),z("design:type",Boolean)],In.prototype,"disabled",void 0);R([L(),N({field_type:O.TEXT,label:"Error Message",description:"Error message to display if validation fails",placeholder:"Enter error message..."}),F(),te(),z("design:type",String)],In.prototype,"error",void 0);R([L(),N({field_type:O.TEXT,label:"Helper Text",description:"Helper text to guide the user",placeholder:"Enter helper text..."}),F(),te(),z("design:type",String)],In.prototype,"helperText",void 0);R([L(),N({field_type:O.TEXT,label:"Placeholder",description:"Placeholder text shown when field is empty",placeholder:"Enter placeholder text..."}),F(),te(),z("design:type",String)],In.prototype,"placeholder",void 0);R([L(),N({field_type:O.TEXT,label:"Input Type",description:"HTML input type (text, email, number, password, etc.)",placeholder:"text"}),F(),te(),z("design:type",String)],In.prototype,"type",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Multiline",description:"Whether the field supports multiple lines (textarea)"}),F(),gt(),z("design:type",Boolean)],In.prototype,"multiline",void 0);R([L(),N({field_type:O.NUMBER,label:"Rows",description:"Number of rows for multiline fields"}),F(),Qt(),z("design:type",Number)],In.prototype,"rows",void 0);R([L(),N({field_type:O.NUMBER,label:"Max Rows",description:"Maximum number of rows for multiline fields"}),F(),Qt(),z("design:type",Number)],In.prototype,"maxRows",void 0);In=R([bt("TextInputField","1.0.0")],In);let pr=class extends Ft{};R([L({dataType:Ge.STRING}),N({field_type:O.TEXTAREA,label:"Text Content",description:"The text content to display",placeholder:"Enter your text content here..."}),F(),te(),z("design:type",String)],pr.prototype,"content",void 0);R([L({defaultValue:"body1",dataType:Ge.STRING}),N({field_type:O.SELECT,label:"Typography Variant",description:"Typography variant that determines font size, weight, and line height",validation:{options:[{label:"Heading 1",value:"h1"},{label:"Heading 2",value:"h2"},{label:"Heading 3",value:"h3"},{label:"Heading 4",value:"h4"},{label:"Heading 5",value:"h5"},{label:"Heading 6",value:"h6"},{label:"Subtitle 1",value:"subtitle1"},{label:"Subtitle 2",value:"subtitle2"},{label:"Body 1",value:"body1"},{label:"Body 2",value:"body2"},{label:"Button",value:"button"},{label:"Caption",value:"caption"},{label:"Overline",value:"overline"}]}}),F(),te(),Re(["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","button","caption","overline"]),z("design:type",String)],pr.prototype,"variant",void 0);R([L({defaultValue:"inherit",dataType:Ge.STRING}),N({field_type:O.SELECT,label:"Text Color",description:"Color variant for the text",validation:{options:[{label:"Primary",value:"primary"},{label:"Secondary",value:"secondary"},{label:"Text Primary",value:"textPrimary"},{label:"Text Secondary",value:"textSecondary"},{label:"Error",value:"error"},{label:"Warning",value:"warning"},{label:"Info",value:"info"},{label:"Success",value:"success"},{label:"Inherit",value:"inherit"}]}}),F(),te(),Re(["primary","secondary","textPrimary","textSecondary","error","warning","info","success","inherit"]),z("design:type",String)],pr.prototype,"color",void 0);R([L({defaultValue:"inherit",dataType:Ge.STRING}),N({field_type:O.SELECT,label:"Text Alignment",description:"How to align the text horizontally",validation:{options:[{label:"Left",value:"left"},{label:"Center",value:"center"},{label:"Right",value:"right"},{label:"Justify",value:"justify"},{label:"Inherit",value:"inherit"}]}}),F(),te(),Re(["left","center","right","justify","inherit"]),z("design:type",String)],pr.prototype,"align",void 0);R([L({defaultValue:"p",dataType:Ge.STRING}),N({field_type:O.SELECT,label:"HTML Element",description:"The HTML element to render (affects semantics and accessibility)",validation:{options:[{label:"Paragraph (p)",value:"p"},{label:"Span",value:"span"},{label:"Div",value:"div"},{label:"Heading 1 (h1)",value:"h1"},{label:"Heading 2 (h2)",value:"h2"},{label:"Heading 3 (h3)",value:"h3"},{label:"Heading 4 (h4)",value:"h4"},{label:"Heading 5 (h5)",value:"h5"},{label:"Heading 6 (h6)",value:"h6"},{label:"Label",value:"label"},{label:"Legend",value:"legend"}]}}),F(),te(),Re(["p","span","div","h1","h2","h3","h4","h5","h6","label","legend"]),z("design:type",String)],pr.prototype,"component",void 0);R([L({defaultValue:"inherit",dataType:Ge.STRING}),N({field_type:O.SELECT,label:"Font Weight",description:"The weight (thickness) of the font",validation:{options:[{label:"Inherit",value:"inherit"},{label:"Lighter",value:"lighter"},{label:"Normal",value:"normal"},{label:"Bold",value:"bold"},{label:"Bolder",value:"bolder"},{label:"100",value:"100"},{label:"200",value:"200"},{label:"300",value:"300"},{label:"400",value:"400"},{label:"500",value:"500"},{label:"600",value:"600"},{label:"700",value:"700"},{label:"800",value:"800"},{label:"900",value:"900"}]}}),F(),te(),Re(["inherit","lighter","normal","bold","bolder","100","200","300","400","500","600","700","800","900"]),z("design:type",String)],pr.prototype,"fontWeight",void 0);R([L({defaultValue:"none",dataType:Ge.STRING}),N({field_type:O.SELECT,label:"Text Decoration",description:"Text decoration style",validation:{options:[{label:"None",value:"none"},{label:"Underline",value:"underline"},{label:"Overline",value:"overline"},{label:"Line Through",value:"line-through"}]}}),F(),te(),Re(["none","underline","overline","line-through"]),z("design:type",String)],pr.prototype,"textDecoration",void 0);R([L({defaultValue:"none",dataType:Ge.STRING}),N({field_type:O.SELECT,label:"Text Transform",description:"How to transform the text case",validation:{options:[{label:"None",value:"none"},{label:"Capitalize",value:"capitalize"},{label:"Uppercase",value:"uppercase"},{label:"Lowercase",value:"lowercase"},{label:"Inherit",value:"inherit"}]}}),F(),te(),Re(["none","capitalize","uppercase","lowercase","inherit"]),z("design:type",String)],pr.prototype,"textTransform",void 0);R([L({defaultValue:!1,dataType:Ge.BOOLEAN}),N({field_type:O.BOOLEAN,label:"No Wrap",description:"Prevent text from wrapping to multiple lines"}),F(),gt(),z("design:type",Boolean)],pr.prototype,"noWrap",void 0);R([L({defaultValue:!1,dataType:Ge.BOOLEAN}),N({field_type:O.BOOLEAN,label:"Paragraph Mode",description:"Apply paragraph spacing and formatting"}),F(),gt(),z("design:type",Boolean)],pr.prototype,"paragraph",void 0);R([L({defaultValue:!1,dataType:Ge.BOOLEAN}),N({field_type:O.BOOLEAN,label:"Gutter Bottom",description:"Add margin bottom for spacing (useful for headings)"}),F(),gt(),z("design:type",Boolean)],pr.prototype,"gutterBottom",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXT,label:"Font Size",description:'Custom font size (overrides variant sizing, e.g., "16px", "1.2rem")',placeholder:"16px"}),F(),te(),z("design:type",String)],pr.prototype,"fontSize",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXT,label:"Line Height",description:'Custom line height (e.g., "1.5", "24px", "150%")',placeholder:"1.5"}),F(),te(),z("design:type",String)],pr.prototype,"lineHeight",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXT,label:"Letter Spacing",description:'Custom letter spacing (e.g., "0.1em", "1px")',placeholder:"0.1em"}),F(),te(),z("design:type",String)],pr.prototype,"letterSpacing",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXT,label:"Font Family",description:'Custom font family (e.g., "Arial, sans-serif")',placeholder:"Arial, sans-serif"}),F(),te(),z("design:type",String)],pr.prototype,"fontFamily",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXTAREA,label:"Custom Color",description:"Custom text color (CSS color value, overrides color variant)",placeholder:"#333333 or rgb(51, 51, 51)"}),F(),te(),z("design:type",String)],pr.prototype,"customColor",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXTAREA,label:"Max Width",description:'Maximum width for the text (e.g., "300px", "50%")',placeholder:"300px"}),F(),te(),z("design:type",String)],pr.prototype,"maxWidth",void 0);R([L({dataType:Ge.STRING}),N({field_type:O.TEXTAREA,label:"Rich Content",description:"Rich text content with React elements (for advanced use)",placeholder:"Rich content..."}),F(),z("design:type",Object)],pr.prototype,"children",void 0);pr=R([bt("Text","1.0.0")],pr);let fr=class extends Ft{};R([L({defaultValue:"light"}),N({field_type:O.SELECT,label:"Print Theme",description:"Theme mode to use when printing",validation:{options:[{label:"Light",value:"light"},{label:"Dark",value:"dark"}]}}),F(),Re(["light","dark"]),z("design:type",String)],fr.prototype,"theme",void 0);R([L({defaultValue:"default"}),N({field_type:O.SELECT,label:"Print Palette",description:"Color palette to use for print output",validation:{options:[{label:"Default",value:"default"},{label:"Autumn",value:"autumn"},{label:"Cosmic",value:"cosmic"},{label:"Ocean",value:"ocean"},{label:"Spring",value:"spring"},{label:"Winter",value:"winter"}]}}),F(),te(),z("design:type",String)],fr.prototype,"palette",void 0);R([L({defaultValue:!0}),N({field_type:O.BOOLEAN,label:"Hide Scaffolding",description:"Hide app scaffolding (navigation, headers) when printing"}),F(),gt(),z("design:type",Boolean)],fr.prototype,"hideScaffolding",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Hide Interactive Elements",description:"Hide buttons and interactive elements when printing"}),F(),gt(),z("design:type",Boolean)],fr.prototype,"hideInteractiveElements",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Optimize For Monochrome",description:"Optimize design for black and white printing"}),F(),gt(),z("design:type",Boolean)],fr.prototype,"optimizeForMonochrome",void 0);R([L(),N({field_type:O.TEXT,label:"Print Title",description:"Custom title to show when printing (optional)",placeholder:"Document Title"}),F(),te(),z("design:type",String)],fr.prototype,"printTitle",void 0);R([L({defaultValue:!0}),N({field_type:O.BOOLEAN,label:"Show Print Date",description:"Include print date and time in printed output"}),F(),gt(),z("design:type",Boolean)],fr.prototype,"showPrintDate",void 0);R([L(),N({field_type:O.TEXT,label:"Print Header",description:"Custom header content for printed pages (HTML string or React component)",placeholder:"<div>Custom header content...</div>"}),F(),z("design:type",Object)],fr.prototype,"printHeader",void 0);R([L(),N({field_type:O.TEXT,label:"Print Header (First Page)",description:"Different header for the first page only (overrides main header on page 1)",placeholder:"<div>First page header...</div>"}),F(),z("design:type",Object)],fr.prototype,"printHeaderFirstPage",void 0);R([L(),N({field_type:O.TEXT,label:"Print Footer",description:"Custom footer content for printed pages (HTML string or React component)",placeholder:"<div>Custom footer content...</div>"}),F(),z("design:type",Object)],fr.prototype,"printFooter",void 0);R([L(),N({field_type:O.TEXT,label:"Print Footer (First Page)",description:"Different footer for the first page only (overrides main footer on page 1)",placeholder:"<div>First page footer...</div>"}),F(),z("design:type",Object)],fr.prototype,"printFooterFirstPage",void 0);R([L({defaultValue:"12mm"}),N({field_type:O.SELECT,label:"Page Margins",description:"Print page margins",validation:{options:[{label:"Compact (6mm)",value:"6mm"},{label:"Standard (12mm)",value:"12mm"},{label:"Large (20mm)",value:"20mm"},{label:"Formal (25mm)",value:"25mm"}]}}),F(),te(),z("design:type",String)],fr.prototype,"pageMargins",void 0);R([L({defaultValue:"60px"}),N({field_type:O.TEXT,label:"Print Header Height",description:"Height allocated for print header (CSS units: px, mm, etc.)",placeholder:"60px"}),F(),te(),z("design:type",String)],fr.prototype,"printHeaderHeight",void 0);R([L({defaultValue:"40px"}),N({field_type:O.TEXT,label:"Print Footer Height",description:"Height allocated for print footer (CSS units: px, mm, etc.)",placeholder:"40px"}),F(),te(),z("design:type",String)],fr.prototype,"printFooterHeight",void 0);R([L(),N({field_type:O.TEXT,label:"Print Background",description:"CSS background for all printed pages (color, gradient, or image)",placeholder:"linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%)"}),F(),te(),z("design:type",String)],fr.prototype,"printBackground",void 0);R([L(),N({field_type:O.TEXT,label:"Print Background (First Page)",description:"Different background for the first page only",placeholder:"url(/logo-watermark.png) no-repeat center, #ffffff"}),F(),te(),z("design:type",String)],fr.prototype,"printBackgroundFirstPage",void 0);fr=R([bt("PrintConfig","1.0.0")],fr);let Tr=class extends tt{};R([L(),N({field_type:O.TEXT,label:"Page Slug",description:'URL-friendly page identifier (e.g., "about-us")',placeholder:"page-slug"}),F(),te(),z("design:type",String)],Tr.prototype,"slug",void 0);R([L(),N({field_type:O.TEXT,label:"Page Name",description:"Human-readable page name",placeholder:"About Us"}),F(),te(),z("design:type",String)],Tr.prototype,"name",void 0);R([L(),N({field_type:O.TEXTAREA,label:"Page Description",description:"Description of the page content (used for SEO)",placeholder:"Brief description of this page..."}),F(),te(),z("design:type",String)],Tr.prototype,"description",void 0);R([L(),N({field_type:O.TEXT,label:"Page Title",description:"HTML title tag content (defaults to name if not provided)",placeholder:"Page Title | Site Name"}),F(),te(),z("design:type",String)],Tr.prototype,"title",void 0);R([L(),N({field_type:O.TEXTAREA,label:"Meta Keywords",description:"SEO keywords (comma-separated)",placeholder:"keyword1, keyword2, keyword3"}),F(),te(),z("design:type",String)],Tr.prototype,"metaKeywords",void 0);R([L(),N({field_type:O.TEXT,label:"Meta Author",description:"Page author information",placeholder:"Author Name"}),F(),te(),z("design:type",String)],Tr.prototype,"metaAuthor",void 0);R([L(),N({field_type:O.URL,label:"Canonical URL",description:"Canonical URL for SEO (optional)",placeholder:"https://example.com/page"}),F(),te(),z("design:type",String)],Tr.prototype,"canonicalUrl",void 0);R([L(),N({field_type:O.TEXTAREA,label:"Page Content",description:"Main page content - can include React components and HTML"}),F(),z("design:type",Object)],Tr.prototype,"children",void 0);R([L(),N({field_type:O.FORM,label:"Print Configuration",description:"Configuration for print mode behavior"}),F(),gn(),vn(()=>fr),z("design:type",fr)],Tr.prototype,"printConfig",void 0);R([L(),N({field_type:O.TEXT,label:"Layout Template",description:"Layout template identifier to use for this page",placeholder:"default, fullwidth, sidebar, etc."}),F(),te(),z("design:type",String)],Tr.prototype,"layout",void 0);R([L(),N({field_type:O.TEXT,label:"Page Icon",description:"Icon identifier for page (used in navigation)",placeholder:"home, about, contact"}),F(),te(),z("design:type",String)],Tr.prototype,"icon",void 0);R([L({defaultValue:!1}),N({field_type:O.BOOLEAN,label:"Requires Authentication",description:"Whether this page requires user authentication"}),F(),z("design:type",Boolean)],Tr.prototype,"requiresAuth",void 0);R([L(),N({field_type:O.TEXT,label:"Required Roles",description:"Comma-separated list of roles required to access this page",placeholder:"admin, user, moderator"}),F(),te(),z("design:type",String)],Tr.prototype,"requiredRoles",void 0);R([L({defaultValue:!0}),N({field_type:O.BOOLEAN,label:"Show in Navigation",description:"Whether to include this page in navigation menus"}),F(),z("design:type",Boolean)],Tr.prototype,"showInNavigation",void 0);R([L({defaultValue:0}),N({field_type:O.NUMBER,label:"Navigation Priority",description:"Priority in navigation (lower numbers appear first)"}),F(),z("design:type",Number)],Tr.prototype,"navigationPriority",void 0);R([L({defaultValue:!0}),N({field_type:O.BOOLEAN,label:"Indexable",description:"Whether search engines should index this page"}),F(),z("design:type",Boolean)],Tr.prototype,"indexable",void 0);Tr=R([bt("PageTemplate","1.0.0")],Tr);const ID=k0.create().withName("Control Panel").withId("com.qwickapps.control-panel").withVersion("1.0.0").withDefaultTheme("dark").withDefaultPalette("cosmic").withThemeSwitcher(!0).withPaletteSwitcher(!0).withDisplay("standalone").build();class jD{constructor(e=""){ka(this,"baseUrl");this.baseUrl=e}async getHealth(){const e=await fetch(`${this.baseUrl}/api/health`);if(!e.ok)throw new Error(`Health check failed: ${e.statusText}`);return e.json()}async getInfo(){const e=await fetch(`${this.baseUrl}/api/info`);if(!e.ok)throw new Error(`Info request failed: ${e.statusText}`);return e.json()}async getDiagnostics(){const e=await fetch(`${this.baseUrl}/api/diagnostics`);if(!e.ok)throw new Error(`Diagnostics request failed: ${e.statusText}`);return e.json()}async getConfig(){const e=await fetch(`${this.baseUrl}/api/config`);if(!e.ok)throw new Error(`Config request failed: ${e.statusText}`);return e.json()}async getLogs(e={}){const r=new URLSearchParams;e.source&&r.set("source",e.source),e.level&&r.set("level",e.level),e.search&&r.set("search",e.search),e.limit&&r.set("limit",e.limit.toString()),e.page&&r.set("page",e.page.toString());const n=await fetch(`${this.baseUrl}/api/logs?${r}`);if(!n.ok)throw new Error(`Logs request failed: ${n.statusText}`);return n.json()}async getLogSources(){const e=await fetch(`${this.baseUrl}/api/logs/sources`);if(!e.ok)throw new Error(`Log sources request failed: ${e.statusText}`);return(await e.json()).sources}}const Ka=new jD;function OD(t){const e=Math.floor(t/1e3),r=Math.floor(e/60),n=Math.floor(r/60),i=Math.floor(n/24);return i>0?`${i}d ${n%24}h ${r%60}m`:n>0?`${n}h ${r%60}m`:r>0?`${r}m ${e%60}s`:`${e}s`}function MS(t){switch(t){case"healthy":return h.jsx(_f,{sx:{color:"var(--theme-success)"}});case"degraded":return h.jsx(LC,{sx:{color:"var(--theme-warning)"}});case"unhealthy":return h.jsx(AC,{sx:{color:"var(--theme-error)"}});default:return h.jsx(Gi,{size:20})}}function up(t){switch(t){case"healthy":return"var(--theme-success)";case"degraded":return"var(--theme-warning)";case"unhealthy":return"var(--theme-error)";default:return"var(--theme-text-secondary)"}}function LD(){var v,g;const[t,e]=T.useState(null),[r,n]=T.useState(null),[i,s]=T.useState(!0),[l,c]=T.useState(null);if(T.useEffect(()=>{const y=async()=>{try{const[x,C]=await Promise.all([Ka.getHealth(),Ka.getInfo()]);e(x),n(C),c(null)}catch(x){c(x instanceof Error?x.message:"Failed to fetch data")}finally{s(!1)}};y();const w=setInterval(y,1e4);return()=>clearInterval(w)},[]),i)return h.jsx(Ce,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"50vh"},children:h.jsx(Gi,{})});if(l)return h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",border:"1px solid var(--theme-error)"},children:h.jsx(or,{children:h.jsx(Te,{color:"error",children:l})})});const d=t?Object.entries(t.checks):[],p=d.filter(([,y])=>y.status==="healthy").length,m=d.length;return h.jsxs(Ce,{children:[h.jsx(Te,{variant:"h4",sx:{mb:1,color:"var(--theme-text-primary)"},children:"Dashboard"}),h.jsxs(Te,{variant:"body2",sx:{mb:4,color:"var(--theme-text-secondary)"},children:["Real-time overview of ",(r==null?void 0:r.product)||"your service"]}),h.jsx(rr,{sx:{mb:4,bgcolor:"var(--theme-surface)",border:`2px solid ${up((t==null?void 0:t.status)||"unknown")}`},children:h.jsxs(or,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:2},children:[MS((t==null?void 0:t.status)||"unknown"),h.jsxs(Ce,{children:[h.jsxs(Te,{variant:"h6",sx:{color:"var(--theme-text-primary)"},children:["Service Status: ",(v=t==null?void 0:t.status)==null?void 0:v.charAt(0).toUpperCase(),(g=t==null?void 0:t.status)==null?void 0:g.slice(1)]}),h.jsxs(Te,{variant:"body2",sx:{color:"var(--theme-text-secondary)"},children:["Last updated: ",t!=null&&t.timestamp?new Date(t.timestamp).toLocaleString():"N/A"]})]})]}),h.jsx(Ni,{label:`${p}/${m} checks passing`,sx:{bgcolor:up((t==null?void 0:t.status)||"unknown")+"20",color:up((t==null?void 0:t.status)||"unknown")}})]})}),h.jsxs(Yr,{container:!0,spacing:3,sx:{mb:4},children:[h.jsx(Yr,{size:{xs:12,sm:6,md:3},children:h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",height:"100%"},children:h.jsxs(or,{children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[h.jsx(TC,{sx:{color:"var(--theme-primary)"}}),h.jsx(Te,{variant:"body2",sx:{color:"var(--theme-text-secondary)"},children:"Uptime"})]}),h.jsx(Te,{variant:"h4",sx:{color:"var(--theme-primary)"},children:t?OD(t.uptime):"N/A"})]})})}),h.jsx(Yr,{size:{xs:12,sm:6,md:3},children:h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",height:"100%"},children:h.jsxs(or,{children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[h.jsx(_f,{sx:{color:"var(--theme-success)"}}),h.jsx(Te,{variant:"body2",sx:{color:"var(--theme-text-secondary)"},children:"Health Checks"})]}),h.jsxs(Te,{variant:"h4",sx:{color:"var(--theme-success)"},children:[p,"/",m]})]})})}),h.jsx(Yr,{size:{xs:12,sm:6,md:3},children:h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",height:"100%"},children:h.jsxs(or,{children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[h.jsx(qy,{sx:{color:"var(--theme-warning)"}}),h.jsx(Te,{variant:"body2",sx:{color:"var(--theme-text-secondary)"},children:"Version"})]}),h.jsx(Te,{variant:"h4",sx:{color:"var(--theme-text-primary)"},children:(r==null?void 0:r.version)||"N/A"})]})})}),h.jsx(Yr,{size:{xs:12,sm:6,md:3},children:h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",height:"100%"},children:h.jsxs(or,{children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[h.jsx(Xy,{sx:{color:"var(--theme-info)"}}),h.jsx(Te,{variant:"body2",sx:{color:"var(--theme-text-secondary)"},children:"Product"})]}),h.jsx(Te,{variant:"h5",sx:{color:"var(--theme-text-primary)"},children:(r==null?void 0:r.product)||"N/A"})]})})})]}),h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)"},children:h.jsxs(or,{children:[h.jsx(Te,{variant:"h6",sx:{mb:3,color:"var(--theme-text-primary)"},children:"Health Checks"}),h.jsx(Yr,{container:!0,spacing:2,children:d.map(([y,w])=>h.jsx(Yr,{size:{xs:12,sm:6,md:4},children:h.jsxs(Ce,{sx:{p:2,borderRadius:1,bgcolor:"var(--theme-background)",border:`1px solid ${up(w.status)}40`},children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1},children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1},children:[MS(w.status),h.jsx(Te,{sx:{color:"var(--theme-text-primary)",fontWeight:500},children:y})]}),w.latency!==void 0&&h.jsx(Ni,{label:`${w.latency}ms`,size:"small",sx:{bgcolor:"var(--theme-surface)",color:"var(--theme-text-secondary)"}})]}),w.error&&h.jsx(Te,{variant:"caption",sx:{color:"var(--theme-error)"},children:w.error})]})},y))})]})})]})}function _S(t,e=20){switch(t){case"healthy":return h.jsx(_f,{sx:{color:"var(--theme-success)",fontSize:e}});case"degraded":return h.jsx(LC,{sx:{color:"var(--theme-warning)",fontSize:e}});case"unhealthy":return h.jsx(AC,{sx:{color:"var(--theme-error)",fontSize:e}});default:return h.jsx(Gi,{size:e})}}function dp(t){switch(t){case"healthy":return"var(--theme-success)";case"degraded":return"var(--theme-warning)";case"unhealthy":return"var(--theme-error)";default:return"var(--theme-text-secondary)"}}function ND(t){return t===void 0?"-":t<1e3?`${t}ms`:`${(t/1e3).toFixed(2)}s`}function $D(){var m,v;const[t,e]=T.useState(null),[r,n]=T.useState(!0),[i,s]=T.useState(null);if(T.useEffect(()=>{const g=async()=>{try{const w=await Ka.getHealth();e(w),s(null)}catch(w){s(w instanceof Error?w.message:"Failed to fetch health")}finally{n(!1)}};g();const y=setInterval(g,5e3);return()=>clearInterval(y)},[]),r)return h.jsx(Ce,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"50vh"},children:h.jsx(Gi,{})});if(i)return h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",border:"1px solid var(--theme-error)"},children:h.jsx(or,{children:h.jsx(Te,{color:"error",children:i})})});const l=t?Object.entries(t.checks):[],c=l.filter(([,g])=>g.status==="healthy").length,d=l.length,p=d>0?c/d*100:0;return h.jsxs(Ce,{children:[h.jsx(Te,{variant:"h4",sx:{mb:1,color:"var(--theme-text-primary)"},children:"Health Checks"}),h.jsx(Te,{variant:"body2",sx:{mb:4,color:"var(--theme-text-secondary)"},children:"Detailed view of all service health checks"}),h.jsx(rr,{sx:{mb:4,bgcolor:"var(--theme-surface)"},children:h.jsxs(or,{children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:2},children:[_S((t==null?void 0:t.status)||"unknown",32),h.jsxs(Ce,{children:[h.jsxs(Te,{variant:"h5",sx:{color:"var(--theme-text-primary)"},children:["Overall Status: ",(m=t==null?void 0:t.status)==null?void 0:m.charAt(0).toUpperCase(),(v=t==null?void 0:t.status)==null?void 0:v.slice(1)]}),h.jsxs(Te,{variant:"body2",sx:{color:"var(--theme-text-secondary)"},children:[c," of ",d," checks passing"]})]})]}),h.jsxs(Te,{variant:"h3",sx:{color:dp((t==null?void 0:t.status)||"unknown")},children:[p.toFixed(0),"%"]})]}),h.jsx(sC,{variant:"determinate",value:p,sx:{height:8,borderRadius:4,bgcolor:"var(--theme-background)","& .MuiLinearProgress-bar":{bgcolor:dp((t==null?void 0:t.status)||"unknown"),borderRadius:4}}})]})}),h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)"},children:h.jsx(Dy,{children:h.jsxs(zy,{children:[h.jsx(Fy,{children:h.jsxs(tl,{children:[h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)"},children:"Check"}),h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)"},children:"Status"}),h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)"},children:"Latency"}),h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)"},children:"Last Checked"}),h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)"},children:"Error"})]})}),h.jsx(By,{children:l.map(([g,y])=>h.jsxs(tl,{children:[h.jsx(Gt,{sx:{color:"var(--theme-text-primary)",borderColor:"var(--theme-border)"},children:h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1},children:[_S(y.status),h.jsx(Te,{fontWeight:500,children:g})]})}),h.jsx(Gt,{sx:{borderColor:"var(--theme-border)"},children:h.jsx(Ni,{label:y.status,size:"small",sx:{bgcolor:dp(y.status)+"20",color:dp(y.status),textTransform:"capitalize"}})}),h.jsx(Gt,{sx:{color:"var(--theme-text-primary)",borderColor:"var(--theme-border)"},children:ND(y.latency)}),h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)"},children:new Date(y.lastChecked).toLocaleTimeString()}),h.jsx(Gt,{sx:{color:"var(--theme-error)",borderColor:"var(--theme-border)"},children:y.error||"-"})]},g))})]})})})]})}function AS(t){switch(t.toLowerCase()){case"error":return"var(--theme-error)";case"warn":case"warning":return"var(--theme-warning)";case"info":return"var(--theme-info)";case"debug":return"var(--theme-text-secondary)";default:return"var(--theme-text-primary)"}}function zD(){const[t,e]=T.useState([]),[r,n]=T.useState([]),[i,s]=T.useState(!0),[l,c]=T.useState(null),[d,p]=T.useState(""),[m,v]=T.useState(""),[g,y]=T.useState(""),[w,x]=T.useState(1),[C,P]=T.useState(0),k=50,_=async()=>{s(!0);try{const D=await Ka.getLogs({source:d||void 0,level:m||void 0,search:g||void 0,limit:k,page:w});e(D.logs),P(D.total),c(null)}catch(D){c(D instanceof Error?D.message:"Failed to fetch logs")}finally{s(!1)}},E=async()=>{try{const D=await Ka.getLogSources();n(D)}catch{}};T.useEffect(()=>{E()},[]),T.useEffect(()=>{_()},[d,m,w]);const A=()=>{x(1),_()},I=Math.ceil(C/k);return h.jsxs(Ce,{children:[h.jsx(Te,{variant:"h4",sx:{mb:1,color:"var(--theme-text-primary)"},children:"Logs"}),h.jsx(Te,{variant:"body2",sx:{mb:4,color:"var(--theme-text-secondary)"},children:"View and search application logs"}),h.jsx(rr,{sx:{mb:3,bgcolor:"var(--theme-surface)"},children:h.jsx(or,{children:h.jsxs(Ce,{sx:{display:"flex",gap:2,flexWrap:"wrap",alignItems:"center"},children:[r.length>0&&h.jsxs(Yo,{size:"small",sx:{minWidth:150},children:[h.jsx(Zs,{sx:{color:"var(--theme-text-secondary)"},children:"Source"}),h.jsxs(el,{value:d,label:"Source",onChange:D=>p(D.target.value),sx:{color:"var(--theme-text-primary)"},children:[h.jsx(Dr,{value:"",children:"All Sources"}),r.map(D=>h.jsx(Dr,{value:D.name,children:D.name},D.name))]})]}),h.jsxs(Yo,{size:"small",sx:{minWidth:120},children:[h.jsx(Zs,{sx:{color:"var(--theme-text-secondary)"},children:"Level"}),h.jsxs(el,{value:m,label:"Level",onChange:D=>v(D.target.value),sx:{color:"var(--theme-text-primary)"},children:[h.jsx(Dr,{value:"",children:"All Levels"}),h.jsx(Dr,{value:"error",children:"Error"}),h.jsx(Dr,{value:"warn",children:"Warning"}),h.jsx(Dr,{value:"info",children:"Info"}),h.jsx(Dr,{value:"debug",children:"Debug"})]})]}),h.jsx(Pf,{size:"small",placeholder:"Search logs...",value:g,onChange:D=>y(D.target.value),onKeyPress:D=>D.key==="Enter"&&A(),sx:{flex:1,minWidth:200,"& .MuiInputBase-input":{color:"var(--theme-text-primary)"}},InputProps:{startAdornment:h.jsx(OC,{sx:{mr:1,color:"var(--theme-text-secondary)"}})}}),h.jsx(Ar,{onClick:_,sx:{color:"var(--theme-primary)"},children:h.jsx(Gy,{})})]})})}),l&&h.jsx(rr,{sx:{mb:3,bgcolor:"var(--theme-surface)",border:"1px solid var(--theme-error)"},children:h.jsx(or,{children:h.jsx(Te,{color:"error",children:l})})}),h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)"},children:i?h.jsx(Ce,{sx:{display:"flex",justifyContent:"center",p:4},children:h.jsx(Gi,{})}):t.length===0?h.jsx(or,{children:h.jsx(Te,{sx:{color:"var(--theme-text-secondary)",textAlign:"center"},children:"No logs found"})}):h.jsxs(h.Fragment,{children:[h.jsx(Dy,{children:h.jsxs(zy,{size:"small",children:[h.jsx(Fy,{children:h.jsxs(tl,{children:[h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)",width:180},children:"Timestamp"}),h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)",width:100},children:"Level"}),h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)",width:120},children:"Component"}),h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)"},children:"Message"})]})}),h.jsx(By,{children:t.map((D,$)=>h.jsxs(tl,{hover:!0,children:[h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)",fontFamily:"monospace",fontSize:"0.75rem"},children:new Date(D.timestamp).toLocaleString()}),h.jsx(Gt,{sx:{borderColor:"var(--theme-border)"},children:h.jsx(Ni,{label:D.level.toUpperCase(),size:"small",sx:{bgcolor:AS(D.level)+"20",color:AS(D.level),fontSize:"0.65rem",height:20}})}),h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)",fontSize:"0.75rem"},children:D.namespace||"-"}),h.jsx(Gt,{sx:{color:"var(--theme-text-primary)",borderColor:"var(--theme-border)",fontFamily:"monospace",fontSize:"0.8rem",whiteSpace:"pre-wrap",wordBreak:"break-all"},children:D.message})]},$))})]})}),I>1&&h.jsx(Ce,{sx:{display:"flex",justifyContent:"center",p:2},children:h.jsx(yO,{count:I,page:w,onChange:(D,$)=>x($),sx:{"& .MuiPaginationItem-root":{color:"var(--theme-text-primary)"}}})})]})})]})}function BD(){const[t,e]=T.useState(null),[r,n]=T.useState(!0),[i,s]=T.useState(null),[l,c]=T.useState({}),[d,p]=T.useState({open:!1,message:""});T.useEffect(()=>{(async()=>{try{const C=await Ka.getConfig();e(C),s(null)}catch(C){s(C instanceof Error?C.message:"Failed to fetch config")}finally{n(!1)}})()},[]);const m=x=>{navigator.clipboard.writeText(x),p({open:!0,message:"Copied to clipboard"})},v=x=>{c(C=>({...C,[x]:!C[x]}))},g=x=>!(t!=null&&t.masked)||!Array.isArray(t.masked)?!1:t.masked.some(C=>x.toUpperCase().includes(C.toUpperCase())),y=(x,C)=>{const P=String(C);return g(x)&&!l[x]?"••••••••":P};if(r)return h.jsx(Ce,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"50vh"},children:h.jsx(Gi,{})});if(i)return h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",border:"1px solid var(--theme-error)"},children:h.jsx(or,{children:h.jsx(Te,{color:"error",children:i})})});const w=t?Object.entries(t.config):[];return h.jsxs(Ce,{children:[h.jsx(Te,{variant:"h4",sx:{mb:1,color:"var(--theme-text-primary)"},children:"Configuration"}),h.jsx(Te,{variant:"body2",sx:{mb:4,color:"var(--theme-text-secondary)"},children:"Current environment configuration (read-only)"}),h.jsxs(rr,{sx:{bgcolor:"var(--theme-surface)"},children:[h.jsx(Dy,{children:h.jsxs(zy,{children:[h.jsx(Fy,{children:h.jsxs(tl,{children:[h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)"},children:"Variable"}),h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)"},children:"Value"}),h.jsx(Gt,{sx:{color:"var(--theme-text-secondary)",borderColor:"var(--theme-border)",width:100},children:"Actions"})]})}),h.jsx(By,{children:w.map(([x,C])=>h.jsxs(tl,{children:[h.jsx(Gt,{sx:{borderColor:"var(--theme-border)"},children:h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1},children:[h.jsx(Te,{sx:{color:"var(--theme-text-primary)",fontFamily:"monospace"},children:x}),g(x)&&h.jsx(Ni,{icon:h.jsx(jC,{sx:{fontSize:14}}),label:"Sensitive",size:"small",sx:{bgcolor:"var(--theme-warning)20",color:"var(--theme-warning)",height:20,"& .MuiChip-icon":{color:"var(--theme-warning)"}}})]})}),h.jsx(Gt,{sx:{color:"var(--theme-text-primary)",borderColor:"var(--theme-border)",fontFamily:"monospace"},children:y(x,C)}),h.jsx(Gt,{sx:{borderColor:"var(--theme-border)"},children:h.jsxs(Ce,{sx:{display:"flex",gap:.5},children:[g(x)&&h.jsx(Tn,{title:l[x]?"Hide value":"Show value",children:h.jsx(Ar,{size:"small",onClick:()=>v(x),sx:{color:"var(--theme-text-secondary)"},children:l[x]?h.jsx(Qy,{fontSize:"small"}):h.jsx(Ky,{fontSize:"small"})})}),h.jsx(Tn,{title:"Copy value",children:h.jsx(Ar,{size:"small",onClick:()=>m(String(C)),sx:{color:"var(--theme-text-secondary)"},children:h.jsx(Wy,{fontSize:"small"})})})]})})]},x))})]})}),w.length===0&&h.jsx(or,{children:h.jsx(Te,{sx:{color:"var(--theme-text-secondary)",textAlign:"center"},children:"No configuration variables available"})})]}),h.jsx($y,{open:d.open,autoHideDuration:2e3,onClose:()=>p({...d,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:h.jsx(Qa,{severity:"success",variant:"filled",children:d.message})})]})}function tg(t){if(t===0)return"0 B";const e=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(t)/Math.log(e));return parseFloat((t/Math.pow(e,n)).toFixed(2))+" "+r[n]}function DD(t){const e=Math.floor(t/1e3),r=Math.floor(e/60),n=Math.floor(r/60),i=Math.floor(n/24);return i>0?`${i}d ${n%24}h ${r%60}m`:n>0?`${n}h ${r%60}m ${e%60}s`:r>0?`${r}m ${e%60}s`:`${e}s`}function FD(){const[t,e]=T.useState(null),[r,n]=T.useState(!0),[i,s]=T.useState(null),[l,c]=T.useState({open:!1,message:""}),d=async()=>{n(!0);try{const v=await Ka.getDiagnostics();e(v),s(null)}catch(v){s(v instanceof Error?v.message:"Failed to fetch diagnostics")}finally{n(!1)}};T.useEffect(()=>{d();const v=setInterval(d,3e4);return()=>clearInterval(v)},[]);const p=()=>{navigator.clipboard.writeText(JSON.stringify(t,null,2)),c({open:!0,message:"Diagnostics copied to clipboard"})};if(r&&!t)return h.jsx(Ce,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"50vh"},children:h.jsx(Gi,{})});if(i)return h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",border:"1px solid var(--theme-error)"},children:h.jsx(or,{children:h.jsx(Te,{color:"error",children:i})})});const m=t?t.system.memory.used/t.system.memory.total*100:0;return h.jsxs(Ce,{children:[h.jsxs(Ce,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[h.jsx(Te,{variant:"h4",sx:{color:"var(--theme-text-primary)"},children:"Diagnostics"}),h.jsxs(Ce,{sx:{display:"flex",gap:1},children:[h.jsx(Tn,{title:"Copy diagnostics JSON",children:h.jsx(Ar,{onClick:p,sx:{color:"var(--theme-primary)"},children:h.jsx(Wy,{})})}),h.jsx(Tn,{title:"Refresh",children:h.jsx(Ar,{onClick:d,sx:{color:"var(--theme-primary)"},children:h.jsx(Gy,{})})})]})]}),h.jsx(Te,{variant:"body2",sx:{mb:4,color:"var(--theme-text-secondary)"},children:"System information and health diagnostics for AI agents and troubleshooting"}),h.jsxs(Yr,{container:!0,spacing:3,children:[h.jsx(Yr,{size:{xs:12,md:6},children:h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",height:"100%"},children:h.jsxs(or,{children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1,mb:3},children:[h.jsx(_C,{sx:{color:"var(--theme-primary)"}}),h.jsx(Te,{variant:"h6",sx:{color:"var(--theme-text-primary)"},children:"System Information"})]}),h.jsxs(Ce,{sx:{display:"flex",flexDirection:"column",gap:2},children:[h.jsxs(Ce,{sx:{display:"flex",justifyContent:"space-between"},children:[h.jsx(Te,{sx:{color:"var(--theme-text-secondary)"},children:"Node.js"}),h.jsx(Ni,{label:t==null?void 0:t.system.nodeVersion,size:"small",sx:{bgcolor:"var(--theme-background)",color:"var(--theme-text-primary)"}})]}),h.jsxs(Ce,{sx:{display:"flex",justifyContent:"space-between"},children:[h.jsx(Te,{sx:{color:"var(--theme-text-secondary)"},children:"Platform"}),h.jsx(Ni,{label:t==null?void 0:t.system.platform,size:"small",sx:{bgcolor:"var(--theme-background)",color:"var(--theme-text-primary)"}})]}),h.jsxs(Ce,{sx:{display:"flex",justifyContent:"space-between"},children:[h.jsx(Te,{sx:{color:"var(--theme-text-secondary)"},children:"Architecture"}),h.jsx(Ni,{label:t==null?void 0:t.system.arch,size:"small",sx:{bgcolor:"var(--theme-background)",color:"var(--theme-text-primary)"}})]})]})]})})}),h.jsx(Yr,{size:{xs:12,md:6},children:h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",height:"100%"},children:h.jsxs(or,{children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1,mb:3},children:[h.jsx(qy,{sx:{color:"var(--theme-warning)"}}),h.jsx(Te,{variant:"h6",sx:{color:"var(--theme-text-primary)"},children:"Memory Usage"})]}),h.jsxs(Ce,{sx:{mb:2},children:[h.jsxs(Ce,{sx:{display:"flex",justifyContent:"space-between",mb:1},children:[h.jsx(Te,{sx:{color:"var(--theme-text-secondary)"},children:"Heap Used"}),h.jsx(Te,{sx:{color:"var(--theme-text-primary)"},children:tg((t==null?void 0:t.system.memory.used)||0)})]}),h.jsx(sC,{variant:"determinate",value:m,sx:{height:8,borderRadius:4,bgcolor:"var(--theme-background)","& .MuiLinearProgress-bar":{bgcolor:m>80?"var(--theme-error)":"var(--theme-warning)",borderRadius:4}}})]}),h.jsxs(Ce,{sx:{display:"flex",flexDirection:"column",gap:2},children:[h.jsxs(Ce,{sx:{display:"flex",justifyContent:"space-between"},children:[h.jsx(Te,{sx:{color:"var(--theme-text-secondary)"},children:"Heap Total"}),h.jsx(Te,{sx:{color:"var(--theme-text-primary)"},children:tg((t==null?void 0:t.system.memory.total)||0)})]}),h.jsxs(Ce,{sx:{display:"flex",justifyContent:"space-between"},children:[h.jsx(Te,{sx:{color:"var(--theme-text-secondary)"},children:"Heap Free"}),h.jsx(Te,{sx:{color:"var(--theme-text-primary)"},children:tg((t==null?void 0:t.system.memory.free)||0)})]})]})]})})}),h.jsx(Yr,{size:{xs:12,md:6},children:h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",height:"100%"},children:h.jsxs(or,{children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1,mb:3},children:[h.jsx(Xy,{sx:{color:"var(--theme-info)"}}),h.jsx(Te,{variant:"h6",sx:{color:"var(--theme-text-primary)"},children:"Service Info"})]}),h.jsxs(Ce,{sx:{display:"flex",flexDirection:"column",gap:2},children:[h.jsxs(Ce,{sx:{display:"flex",justifyContent:"space-between"},children:[h.jsx(Te,{sx:{color:"var(--theme-text-secondary)"},children:"Product"}),h.jsx(Te,{sx:{color:"var(--theme-text-primary)"},children:t==null?void 0:t.product})]}),h.jsxs(Ce,{sx:{display:"flex",justifyContent:"space-between"},children:[h.jsx(Te,{sx:{color:"var(--theme-text-secondary)"},children:"Version"}),h.jsx(Ni,{label:(t==null?void 0:t.version)||"N/A",size:"small",sx:{bgcolor:"var(--theme-primary)20",color:"var(--theme-primary)"}})]}),h.jsxs(Ce,{sx:{display:"flex",justifyContent:"space-between"},children:[h.jsx(Te,{sx:{color:"var(--theme-text-secondary)"},children:"Timestamp"}),h.jsx(Te,{sx:{color:"var(--theme-text-primary)",fontSize:"0.875rem"},children:t!=null&&t.timestamp?new Date(t.timestamp).toLocaleString():"N/A"})]})]})]})})}),h.jsx(Yr,{size:{xs:12,md:6},children:h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)",height:"100%"},children:h.jsxs(or,{children:[h.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:1,mb:3},children:[h.jsx(TC,{sx:{color:"var(--theme-success)"}}),h.jsx(Te,{variant:"h6",sx:{color:"var(--theme-text-primary)"},children:"Uptime"})]}),h.jsx(Te,{variant:"h3",sx:{color:"var(--theme-success)",mb:1},children:DD((t==null?void 0:t.uptime)||0)}),h.jsx(Te,{sx:{color:"var(--theme-text-secondary)"},children:"Service has been running without interruption"})]})})}),h.jsx(Yr,{size:{xs:12},children:h.jsx(rr,{sx:{bgcolor:"var(--theme-surface)"},children:h.jsxs(or,{children:[h.jsx(Te,{variant:"h6",sx:{color:"var(--theme-text-primary)",mb:2},children:"Raw Diagnostics JSON (for AI agents)"}),h.jsx(Ce,{component:"pre",sx:{bgcolor:"var(--theme-background)",p:2,borderRadius:1,overflow:"auto",maxHeight:300,color:"var(--theme-text-primary)",fontFamily:"monospace",fontSize:"0.75rem"},children:JSON.stringify(t,null,2)})]})})})]}),h.jsx($y,{open:l.open,autoHideDuration:2e3,onClose:()=>c({...l,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:h.jsx(Qa,{severity:"success",variant:"filled",children:l.message})})]})}function HD(){const t=n3();return h.jsxs(Ce,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"50vh",textAlign:"center"},children:[h.jsx(Te,{variant:"h1",sx:{color:"var(--theme-primary)",mb:2},children:"404"}),h.jsx(Te,{variant:"h5",sx:{color:"var(--theme-text-primary)",mb:1},children:"Page Not Found"}),h.jsx(Te,{sx:{color:"var(--theme-text-secondary)",mb:4},children:"The page you're looking for doesn't exist or has been moved."}),h.jsx(qc,{variant:"contained",startIcon:h.jsx(IC,{}),onClick:()=>t("/"),sx:{bgcolor:"var(--theme-primary)","&:hover":{bgcolor:"var(--theme-primary)"}},children:"Back to Dashboard"})]})}const VD="1.0.0",UD=h.jsx(cD,{name:"Control Panel"}),WD=h.jsx(Ce,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:2},children:h.jsxs(ho,{variant:"caption",customColor:"var(--theme-text-secondary)",children:["Built with"," ",h.jsx(gj,{href:"https://qwickapps.com/products/qwickapps-server",target:"_blank",rel:"noopener noreferrer",sx:{color:"primary.main"},children:"QwickApps Server"})," ","v",VD]})});function qD(){return h.jsx(C3,{children:h.jsx(sD,{config:ID,logo:UD,footerContent:WD,enableScaffolding:!0,navigationItems:[{id:"dashboard",label:"Dashboard",route:"/",icon:"dashboard"},{id:"health",label:"Health",route:"/health",icon:"favorite"},{id:"logs",label:"Logs",route:"/logs",icon:"article"},{id:"config",label:"Config",route:"/config",icon:"settings"},{id:"diagnostics",label:"Diagnostics",route:"/diagnostics",icon:"bug_report"}],showThemeSwitcher:!0,showPaletteSwitcher:!0,children:h.jsxs(x3,{children:[h.jsx(Ra,{path:"/",element:h.jsx(LD,{})}),h.jsx(Ra,{path:"/health",element:h.jsx($D,{})}),h.jsx(Ra,{path:"/logs",element:h.jsx(zD,{})}),h.jsx(Ra,{path:"/config",element:h.jsx(BD,{})}),h.jsx(Ra,{path:"/diagnostics",element:h.jsx(FD,{})}),h.jsx(Ra,{path:"*",element:h.jsx(HD,{})})]})})})}kP.createRoot(document.getElementById("root")).render(h.jsx(pt.StrictMode,{children:h.jsx(qD,{})}));
|
|
465
|
+
//# sourceMappingURL=index-CW1BviRn.js.map
|