"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    ExpressionField: ()=>ExpressionField
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const external_lucide_react_namespaceObject = require("lucide-react");
function ExpressionField({ label, value, mode = 'expr', description, onModeChange }) {
    const expression = value ?? '';
    const activeMode = mode;
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
        className: "flex flex-col gap-2",
        children: [
            label && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
                className: "flex items-center justify-between",
                children: [
                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
                        className: "text-xs font-medium text-foreground-muted",
                        children: label
                    }),
                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
                        className: "flex items-center gap-0.5",
                        children: [
                            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
                                type: "button",
                                title: "AI assist",
                                "aria-label": "AI assist",
                                className: "grid size-7 place-items-center rounded-lg text-foreground-subtle transition hover:bg-surface-overlay hover:text-foreground",
                                children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Sparkles, {
                                    size: 12
                                })
                            }),
                            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("button", {
                                type: "button",
                                title: "Insert variable",
                                "aria-label": "Insert variable",
                                className: "flex h-7 items-center gap-1 rounded-lg px-2 text-[11px] text-foreground-subtle transition hover:bg-surface-overlay hover:text-foreground",
                                children: [
                                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
                                        className: "font-mono text-[10px]",
                                        children: '{x}'
                                    }),
                                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
                                        children: "Insert"
                                    }),
                                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDown, {
                                        size: 9
                                    })
                                ]
                            })
                        ]
                    })
                ]
            }),
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
                className: "overflow-hidden rounded-xl border border-border-subtle bg-surface-raised",
                children: [
                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
                        className: "flex items-center justify-between border-b border-border-subtle bg-surface px-3 py-2",
                        children: [
                            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
                                className: "font-mono text-xs text-foreground-muted",
                                children: "result"
                            }),
                            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
                                type: "button",
                                title: "Expand editor",
                                "aria-label": "Expand editor",
                                className: "grid size-6 place-items-center rounded text-foreground-subtle transition hover:text-foreground",
                                children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Maximize2, {
                                    size: 11
                                })
                            })
                        ]
                    }),
                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
                        className: "flex items-center gap-1 border-b border-border-subtle bg-surface px-2.5 py-1.5",
                        children: [
                            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
                                type: "button",
                                title: "Undo",
                                "aria-label": "Undo",
                                className: "grid size-6 place-items-center rounded text-foreground-subtle transition hover:text-foreground",
                                children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Undo2, {
                                    size: 12
                                })
                            }),
                            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
                                type: "button",
                                title: "Redo",
                                "aria-label": "Redo",
                                className: "grid size-6 place-items-center rounded text-foreground-subtle transition hover:text-foreground",
                                children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Redo2, {
                                    size: 12
                                })
                            }),
                            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
                                className: "mx-1 h-3 w-px shrink-0 bg-border-subtle"
                            }),
                            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
                                type: "button",
                                onClick: ()=>onModeChange?.('expr'),
                                "aria-pressed": 'expr' === activeMode,
                                className: "rounded px-2 py-0.5 text-[11px] transition",
                                style: {
                                    color: 'expr' === activeMode ? 'var(--foreground)' : 'var(--foreground-subtle)',
                                    fontWeight: 'expr' === activeMode ? 600 : 400
                                },
                                children: "expr"
                            }),
                            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
                                type: "button",
                                onClick: ()=>onModeChange?.('json'),
                                "aria-pressed": 'json' === activeMode,
                                className: "rounded px-2 py-0.5 text-[11px] transition",
                                style: {
                                    color: 'json' === activeMode ? 'var(--foreground)' : 'var(--foreground-subtle)',
                                    fontWeight: 'json' === activeMode ? 600 : 400
                                },
                                children: "json"
                            })
                        ]
                    }),
                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("pre", {
                        className: "overflow-auto whitespace-pre-wrap bg-surface-raised p-3 text-xs font-mono leading-5 text-foreground",
                        children: expression || '// Enter expression…'
                    }),
                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
                        className: "flex items-center justify-between border-t border-border-subtle bg-surface px-3 py-1.5",
                        children: [
                            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
                                className: "flex items-center gap-1.5",
                                children: [
                                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
                                        className: "size-1.5 shrink-0 rounded-full bg-[--success]"
                                    }),
                                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
                                        className: "text-[10px] text-foreground-subtle",
                                        children: "No errors"
                                    })
                                ]
                            }),
                            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
                                className: "text-[10px] text-foreground-subtle",
                                children: "Ln 1, Col 1"
                            })
                        ]
                    })
                ]
            }),
            description && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
                className: "block text-[11px] leading-4 text-foreground-subtle",
                children: description
            })
        ]
    });
}
exports.ExpressionField = __webpack_exports__.ExpressionField;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "ExpressionField"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
