@spencerboucher/switchyard 0.7.0 → 0.8.0
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/bridge/switchyard-terminal.js +96 -1
- package/dist/switchyard.mjs +463 -126
- package/package.json +1 -1
- package/web-dist/assets/{AutomationView-BIW_pO0M.js → AutomationView-GCthHkym.js} +2 -2
- package/web-dist/assets/{AutomationView-BIW_pO0M.js.map → AutomationView-GCthHkym.js.map} +1 -1
- package/web-dist/assets/{Badge-BiDp7NKI.js → Badge-CEMI3YyI.js} +2 -2
- package/web-dist/assets/{Badge-BiDp7NKI.js.map → Badge-CEMI3YyI.js.map} +1 -1
- package/web-dist/assets/{InteractionCard-CWxyDv81.js → InteractionCard-DaLqafmA.js} +2 -2
- package/web-dist/assets/{InteractionCard-CWxyDv81.js.map → InteractionCard-DaLqafmA.js.map} +1 -1
- package/web-dist/assets/{Menu-BDt1bxwz.js → Menu-BcKiEc6X.js} +2 -2
- package/web-dist/assets/{Menu-BDt1bxwz.js.map → Menu-BcKiEc6X.js.map} +1 -1
- package/web-dist/assets/{SegmentedControl-D-2BCZzd.js → SegmentedControl-BZPzNU08.js} +2 -2
- package/web-dist/assets/{SegmentedControl-D-2BCZzd.js.map → SegmentedControl-BZPzNU08.js.map} +1 -1
- package/web-dist/assets/{Tabs-ByiPklAw.js → Tabs-COH5EMql.js} +2 -2
- package/web-dist/assets/{Tabs-ByiPklAw.js.map → Tabs-COH5EMql.js.map} +1 -1
- package/web-dist/assets/{TextArea-BYr88SnV.js → TextArea-CeMEPZn4.js} +2 -2
- package/web-dist/assets/{TextArea-BYr88SnV.js.map → TextArea-CeMEPZn4.js.map} +1 -1
- package/web-dist/assets/{attention-Bya8XHKI.js → attention-BAdea2kA.js} +2 -2
- package/web-dist/assets/{attention-Bya8XHKI.js.map → attention-BAdea2kA.js.map} +1 -1
- package/web-dist/assets/{automations-DiXKRcnE.js → automations-DSFUzB0w.js} +2 -2
- package/web-dist/assets/{automations-DiXKRcnE.js.map → automations-DSFUzB0w.js.map} +1 -1
- package/web-dist/assets/{board-BrLaJwLJ.js → board-eQ3H8yCp.js} +2 -2
- package/web-dist/assets/{board-BrLaJwLJ.js.map → board-eQ3H8yCp.js.map} +1 -1
- package/web-dist/assets/code-D7JmYMKe.js +13 -0
- package/web-dist/assets/code-D7JmYMKe.js.map +1 -0
- package/web-dist/assets/{describe-DnvH6_fl.js → describe-C1YimBXJ.js} +2 -2
- package/web-dist/assets/{describe-DnvH6_fl.js.map → describe-C1YimBXJ.js.map} +1 -1
- package/web-dist/assets/dist-B_RpNOcK.js +56 -0
- package/web-dist/assets/dist-B_RpNOcK.js.map +1 -0
- package/web-dist/assets/{enroll-DUDpbJoB.js → enroll-1OCy5r50.js} +2 -2
- package/web-dist/assets/{enroll-DUDpbJoB.js.map → enroll-1OCy5r50.js.map} +1 -1
- package/web-dist/assets/{index-vIzH1m8u.js → index-BhpEXLav.js} +4 -4
- package/web-dist/assets/{index-vIzH1m8u.js.map → index-BhpEXLav.js.map} +1 -1
- package/web-dist/assets/index-DUeOwDZ6.css +2 -0
- package/web-dist/assets/{logic-xb-QF00E.js → logic-CBvFOyIo.js} +2 -2
- package/web-dist/assets/{logic-xb-QF00E.js.map → logic-CBvFOyIo.js.map} +1 -1
- package/web-dist/assets/{more-BP5x45cs.js → more-RjVyxPaz.js} +2 -2
- package/web-dist/assets/{more-BP5x45cs.js.map → more-RjVyxPaz.js.map} +1 -1
- package/web-dist/assets/{now--XjJC37b.js → now-CDjeFSLD.js} +2 -2
- package/web-dist/assets/{now--XjJC37b.js.map → now-CDjeFSLD.js.map} +1 -1
- package/web-dist/assets/{settings-D8T1esWq.js → settings-tH4UuIfJ.js} +2 -2
- package/web-dist/assets/{settings-D8T1esWq.js.map → settings-tH4UuIfJ.js.map} +1 -1
- package/web-dist/assets/{shared-CZ7fcu_B.js → shared-CRX6KSBm.js} +2 -2
- package/web-dist/assets/{shared-CZ7fcu_B.js.map → shared-CRX6KSBm.js.map} +1 -1
- package/web-dist/assets/states-DXozulGZ.js +2 -0
- package/web-dist/assets/states-DXozulGZ.js.map +1 -0
- package/web-dist/assets/{terminal-login-BJxV78au.js → terminal-login-CW2rE50W.js} +2 -2
- package/web-dist/assets/{terminal-login-BJxV78au.js.map → terminal-login-CW2rE50W.js.map} +1 -1
- package/web-dist/assets/{useNow-jxdoOC_1.js → useNow-C_B7JgMM.js} +2 -2
- package/web-dist/assets/{useNow-jxdoOC_1.js.map → useNow-C_B7JgMM.js.map} +1 -1
- package/web-dist/index.html +4 -4
- package/web-dist/sw.js +1 -1
- package/web-dist/assets/code-DKLO8bzz.js +0 -11
- package/web-dist/assets/code-DKLO8bzz.js.map +0 -1
- package/web-dist/assets/dist-BE_V9dwJ.js +0 -56
- package/web-dist/assets/dist-BE_V9dwJ.js.map +0 -1
- package/web-dist/assets/index-DvRcMGEe.css +0 -2
- package/web-dist/assets/states--geW2Ntl.js +0 -2
- package/web-dist/assets/states--geW2Ntl.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge-BiDp7NKI.js","names":["__commonJSMin","require_react","require_jsx_runtime","cn","require_react_dom_production","React","formatProdErrorMessage","url","code","i","noop","Internals","REACT_PORTAL_TYPE","REACT_RECOVERABLE_TYPE","REACT_OPTIMISTIC_KEY","createPortal$1","key","ReactSharedInternals","getCrossOriginStringAs","as","input","reason","container","children","previousTransition","previousUpdatePriority","fn","href","options","crossOrigin","integrity","fetchPriority","form","a","action","initialState","permalink","require_react_dom","checkDCE","err","import_jsx_runtime","TONE_CLASSES","Badge","tone","className","label","CountBadge","count"],"sources":["../../../../node_modules/.pnpm/react-dom@19.3.1_react@19.3.1/node_modules/react-dom/cjs/react-dom.production.js","../../../../node_modules/.pnpm/react-dom@19.3.1_react@19.3.1/node_modules/react-dom/index.js","../../src/components/ui/Badge.tsx"],"sourcesContent":["/**\n * @license React\n * react-dom.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction formatProdErrorMessage(code) {\n var url = \"https://react.dev/errors/\" + code;\n if (1 < arguments.length) {\n url += \"?args[]=\" + encodeURIComponent(arguments[1]);\n for (var i = 2; i < arguments.length; i++)\n url += \"&args[]=\" + encodeURIComponent(arguments[i]);\n }\n return (\n \"Minified React error #\" +\n code +\n \"; visit \" +\n url +\n \" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"\n );\n}\nfunction noop() {}\nvar Internals = {\n d: {\n f: noop,\n r: function () {\n throw Error(formatProdErrorMessage(522));\n },\n D: noop,\n C: noop,\n L: noop,\n m: noop,\n X: noop,\n S: noop,\n M: noop\n },\n p: 0,\n findDOMNode: null\n },\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_RECOVERABLE_TYPE = Symbol.for(\"react.recoverable\"),\n REACT_OPTIMISTIC_KEY = Symbol.for(\"react.optimistic_key\");\nfunction createPortal$1(children, containerInfo, implementation) {\n var key =\n 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;\n return {\n $$typeof: REACT_PORTAL_TYPE,\n key:\n null == key\n ? null\n : key === REACT_OPTIMISTIC_KEY\n ? REACT_OPTIMISTIC_KEY\n : \"\" + key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n}\nvar ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\nfunction getCrossOriginStringAs(as, input) {\n if (\"font\" === as) return \"\";\n if (\"string\" === typeof input)\n return \"use-credentials\" === input ? input : \"\";\n}\nexports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n Internals;\nexports.browser = function (reason) {\n return { $$typeof: REACT_RECOVERABLE_TYPE, _reason: reason };\n};\nexports.createPortal = function (children, container) {\n var key =\n 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;\n if (\n !container ||\n (1 !== container.nodeType &&\n 9 !== container.nodeType &&\n 11 !== container.nodeType)\n )\n throw Error(formatProdErrorMessage(299));\n return createPortal$1(children, container, null, key);\n};\nexports.flushSync = function (fn) {\n var previousTransition = ReactSharedInternals.T,\n previousUpdatePriority = Internals.p;\n try {\n if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn();\n } finally {\n (ReactSharedInternals.T = previousTransition),\n (Internals.p = previousUpdatePriority),\n Internals.d.f();\n }\n};\nexports.preconnect = function (href, options) {\n \"string\" === typeof href &&\n (options\n ? ((options = options.crossOrigin),\n (options =\n \"string\" === typeof options\n ? \"use-credentials\" === options\n ? options\n : \"\"\n : void 0))\n : (options = null),\n Internals.d.C(href, options));\n};\nexports.prefetchDNS = function (href) {\n \"string\" === typeof href && Internals.d.D(href);\n};\nexports.preinit = function (href, options) {\n if (\"string\" === typeof href && options && \"string\" === typeof options.as) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),\n integrity =\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n fetchPriority =\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0;\n \"style\" === as\n ? Internals.d.S(\n href,\n \"string\" === typeof options.precedence ? options.precedence : void 0,\n {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority\n }\n )\n : \"script\" === as &&\n Internals.d.X(href, {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n};\nexports.preinitModule = function (href, options) {\n if (\"string\" === typeof href)\n if (\"object\" === typeof options && null !== options) {\n if (null == options.as || \"script\" === options.as) {\n var crossOrigin = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n );\n Internals.d.M(href, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0\n });\n }\n } else null == options && Internals.d.M(href);\n};\nexports.preload = function (href, options) {\n if (\n \"string\" === typeof href &&\n \"object\" === typeof options &&\n null !== options &&\n \"string\" === typeof options.as\n ) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);\n Internals.d.L(href, as, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n type: \"string\" === typeof options.type ? options.type : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0,\n referrerPolicy:\n \"string\" === typeof options.referrerPolicy\n ? options.referrerPolicy\n : void 0,\n imageSrcSet:\n \"string\" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,\n imageSizes:\n \"string\" === typeof options.imageSizes ? options.imageSizes : void 0,\n media: \"string\" === typeof options.media ? options.media : void 0\n });\n }\n};\nexports.preloadModule = function (href, options) {\n if (\"string\" === typeof href)\n if (options) {\n var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);\n Internals.d.m(href, {\n as:\n \"string\" === typeof options.as && \"script\" !== options.as\n ? options.as\n : void 0,\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0\n });\n } else Internals.d.m(href);\n};\nexports.requestFormReset = function (form) {\n Internals.d.r(form);\n};\nexports.unstable_batchedUpdates = function (fn, a) {\n return fn(a);\n};\nexports.useFormState = function (action, initialState, permalink) {\n return ReactSharedInternals.H.useFormState(action, initialState, permalink);\n};\nexports.useFormStatus = function () {\n return ReactSharedInternals.H.useHostTransitionStatus();\n};\nexports.version = \"19.3.1\";\n","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}\n","import type { ReactNode } from \"react\";\nimport { cn } from \"../../lib/cn\";\n\nexport type Tone = \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\" | \"accent\";\n\nexport const TONE_CLASSES: Record<Tone, string> = {\n neutral: \"bg-surface-2 text-muted border-border\",\n info: \"bg-info-soft text-info border-transparent\",\n success: \"bg-success-soft text-success border-transparent\",\n warning: \"bg-warning-soft text-warning border-transparent\",\n danger: \"bg-danger-soft text-danger border-transparent\",\n accent: \"bg-accent text-accent-fg border-transparent\",\n};\n\nexport interface BadgeProps {\n children: ReactNode;\n tone?: Tone;\n /** Accessible text when the visible content is terse (e.g. a count). */\n label?: string;\n className?: string;\n}\n\n/** Small pill for counts and tags. */\nexport function Badge({ children, tone = \"neutral\", label, className }: BadgeProps) {\n return (\n <span\n className={cn(\n \"inline-flex min-w-5 items-center justify-center rounded-full border px-1.5 text-xs leading-5 font-medium tabular-nums\",\n TONE_CLASSES[tone],\n className,\n )}\n title={label}\n >\n <span aria-hidden={label ? true : undefined}>{children}</span>\n {label && <span className=\"sr-only\">{label}</span>}\n </span>\n );\n}\n\n/** Count badge; renders nothing at zero. Caps at 99+. */\nexport function CountBadge({\n count,\n label,\n tone = \"danger\",\n className,\n}: {\n count: number;\n label: string;\n tone?: Tone;\n className?: string;\n}) {\n if (count <= 0) return null;\n return (\n <Badge tone={tone} label={`${count} ${label}`} className={className}>\n {count > 99 ? \"99+\" : count}\n </Badge>\n );\n}\n"],"ignoreList":[0,1],"mappings":"A,kHAWA,IAAIK,EAAAJ,EAAA,EACJ,SAASK,EAAuB,EAAM,CACpC,IAAIC,EAAM,4BAA8BC,EACxC,GAAI,EAAI,UAAU,OAAQ,CACxB,GAAO,WAAa,mBAAmB,UAAU,EAAE,EACnD,IAAK,IAAIC,EAAI,EAAGA,EAAI,UAAU,OAAQ,IACpC,GAAO,WAAa,mBAAmB,UAAUA,EAAE,CACvD,CACA,MACE,yBACAD,EACA,WACAD,EACA,gHAEJ,CACA,SAASG,GAAO,CAAC,CACjB,IAAIC,EAAY,CACZ,EAAG,CACD,EAAGD,EACH,EAAG,UAAY,CACb,MAAM,MAAMJ,EAAuB,GAAG,CAAC,CACzC,EACA,EAAGI,EACH,EAAGA,EACH,EAAGA,EACH,EAAGA,EACH,EAAGA,EACH,EAAGA,EACH,EAAGA,CACL,EACA,EAAG,EACH,YAAa,IACf,EACAE,EAAoB,OAAO,IAAI,cAAc,EAC7CC,EAAyB,OAAO,IAAI,mBAAmB,EACvDC,EAAuB,OAAO,IAAI,sBAAsB,EAC1D,SAASC,EAAe,EAAU,EAAe,EAAgB,CAC/D,IAAIC,EACF,EAAI,UAAU,QAAqB,UAAU,KAArB,IAAK,GAAqB,UAAU,GAAK,KACnE,MAAO,CACL,SAAUJ,EACV,IACUI,GAAR,KACI,KACAA,IAAQF,EACNA,EACA,GAAKE,EACH,WACK,gBACC,gBAClB,CACF,CACA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ACxD,EACA,EAAQ,QAAU,Q,iBClOlB,SAASqB,GAAW,CAElB,GACE,OAAO,+BAAmC,KAC1C,OAAO,+BAA+B,UAAa,WAcrD,GAAI,CAEF,+BAA+B,SAASA,CAAQ,CAClD,OAASC,EAAK,CAGZ,QAAQ,MAAMA,CAAG,CACnB,CACF,CAKED,EAAS,EACT,EAAO,QAAAlC,EAAA,C,UC7BIqC,EAAqC,CAChD,QAAS,wCACT,KAAM,4CACN,QAAS,kDACT,QAAS,kDACT,OAAQ,gDACR,OAAQ,6CACV,EAWA,SAAgBC,EAAM,CAAE,WAAU,OAAO,UAAW,QAAO,aAAyB,CAClF,OACE,EAAAF,EAAA,KAAA,CAAC,OAAD,CACE,UAAWrC,EACT,wHACAsC,EAAaE,GACbC,CACF,EACA,MAAOC,EANT,SAAA,EAQE,EAAAL,EAAA,IAAA,CAAC,OAAD,CAAM,cAAaK,EAAQ,GAAO,IAAA,GAAY,UAAe,CAAA,EAC5DA,IAAS,EAAAL,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,UAAW,SAAAK,CAAY,CAAA,CAC7C,C,EAEV,CAGA,SAAgBC,EAAW,CACzB,QACA,QACA,OAAO,SACP,aAMC,CAED,OADIC,GAAS,EAAU,MAErB,EAAAP,EAAA,IAAA,CAACE,EAAD,CAAa,OAAM,MAAO,GAAGK,EAAM,GAAGF,IAAoB,YACvD,SAAAE,EAAQ,GAAK,MAAQA,CACjB,CAAA,CAEX,C"}
|
|
1
|
+
{"version":3,"file":"Badge-CEMI3YyI.js","names":["__commonJSMin","require_react","require_jsx_runtime","cn","require_react_dom_production","React","formatProdErrorMessage","url","code","i","noop","Internals","REACT_PORTAL_TYPE","REACT_RECOVERABLE_TYPE","REACT_OPTIMISTIC_KEY","createPortal$1","key","ReactSharedInternals","getCrossOriginStringAs","as","input","reason","container","children","previousTransition","previousUpdatePriority","fn","href","options","crossOrigin","integrity","fetchPriority","form","a","action","initialState","permalink","require_react_dom","checkDCE","err","import_jsx_runtime","TONE_CLASSES","Badge","tone","className","label","CountBadge","count"],"sources":["../../../../node_modules/.pnpm/react-dom@19.3.1_react@19.3.1/node_modules/react-dom/cjs/react-dom.production.js","../../../../node_modules/.pnpm/react-dom@19.3.1_react@19.3.1/node_modules/react-dom/index.js","../../src/components/ui/Badge.tsx"],"sourcesContent":["/**\n * @license React\n * react-dom.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction formatProdErrorMessage(code) {\n var url = \"https://react.dev/errors/\" + code;\n if (1 < arguments.length) {\n url += \"?args[]=\" + encodeURIComponent(arguments[1]);\n for (var i = 2; i < arguments.length; i++)\n url += \"&args[]=\" + encodeURIComponent(arguments[i]);\n }\n return (\n \"Minified React error #\" +\n code +\n \"; visit \" +\n url +\n \" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"\n );\n}\nfunction noop() {}\nvar Internals = {\n d: {\n f: noop,\n r: function () {\n throw Error(formatProdErrorMessage(522));\n },\n D: noop,\n C: noop,\n L: noop,\n m: noop,\n X: noop,\n S: noop,\n M: noop\n },\n p: 0,\n findDOMNode: null\n },\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_RECOVERABLE_TYPE = Symbol.for(\"react.recoverable\"),\n REACT_OPTIMISTIC_KEY = Symbol.for(\"react.optimistic_key\");\nfunction createPortal$1(children, containerInfo, implementation) {\n var key =\n 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;\n return {\n $$typeof: REACT_PORTAL_TYPE,\n key:\n null == key\n ? null\n : key === REACT_OPTIMISTIC_KEY\n ? REACT_OPTIMISTIC_KEY\n : \"\" + key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n}\nvar ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\nfunction getCrossOriginStringAs(as, input) {\n if (\"font\" === as) return \"\";\n if (\"string\" === typeof input)\n return \"use-credentials\" === input ? input : \"\";\n}\nexports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n Internals;\nexports.browser = function (reason) {\n return { $$typeof: REACT_RECOVERABLE_TYPE, _reason: reason };\n};\nexports.createPortal = function (children, container) {\n var key =\n 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;\n if (\n !container ||\n (1 !== container.nodeType &&\n 9 !== container.nodeType &&\n 11 !== container.nodeType)\n )\n throw Error(formatProdErrorMessage(299));\n return createPortal$1(children, container, null, key);\n};\nexports.flushSync = function (fn) {\n var previousTransition = ReactSharedInternals.T,\n previousUpdatePriority = Internals.p;\n try {\n if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn();\n } finally {\n (ReactSharedInternals.T = previousTransition),\n (Internals.p = previousUpdatePriority),\n Internals.d.f();\n }\n};\nexports.preconnect = function (href, options) {\n \"string\" === typeof href &&\n (options\n ? ((options = options.crossOrigin),\n (options =\n \"string\" === typeof options\n ? \"use-credentials\" === options\n ? options\n : \"\"\n : void 0))\n : (options = null),\n Internals.d.C(href, options));\n};\nexports.prefetchDNS = function (href) {\n \"string\" === typeof href && Internals.d.D(href);\n};\nexports.preinit = function (href, options) {\n if (\"string\" === typeof href && options && \"string\" === typeof options.as) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),\n integrity =\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n fetchPriority =\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0;\n \"style\" === as\n ? Internals.d.S(\n href,\n \"string\" === typeof options.precedence ? options.precedence : void 0,\n {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority\n }\n )\n : \"script\" === as &&\n Internals.d.X(href, {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n};\nexports.preinitModule = function (href, options) {\n if (\"string\" === typeof href)\n if (\"object\" === typeof options && null !== options) {\n if (null == options.as || \"script\" === options.as) {\n var crossOrigin = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n );\n Internals.d.M(href, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0\n });\n }\n } else null == options && Internals.d.M(href);\n};\nexports.preload = function (href, options) {\n if (\n \"string\" === typeof href &&\n \"object\" === typeof options &&\n null !== options &&\n \"string\" === typeof options.as\n ) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);\n Internals.d.L(href, as, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n type: \"string\" === typeof options.type ? options.type : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0,\n referrerPolicy:\n \"string\" === typeof options.referrerPolicy\n ? options.referrerPolicy\n : void 0,\n imageSrcSet:\n \"string\" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,\n imageSizes:\n \"string\" === typeof options.imageSizes ? options.imageSizes : void 0,\n media: \"string\" === typeof options.media ? options.media : void 0\n });\n }\n};\nexports.preloadModule = function (href, options) {\n if (\"string\" === typeof href)\n if (options) {\n var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);\n Internals.d.m(href, {\n as:\n \"string\" === typeof options.as && \"script\" !== options.as\n ? options.as\n : void 0,\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0\n });\n } else Internals.d.m(href);\n};\nexports.requestFormReset = function (form) {\n Internals.d.r(form);\n};\nexports.unstable_batchedUpdates = function (fn, a) {\n return fn(a);\n};\nexports.useFormState = function (action, initialState, permalink) {\n return ReactSharedInternals.H.useFormState(action, initialState, permalink);\n};\nexports.useFormStatus = function () {\n return ReactSharedInternals.H.useHostTransitionStatus();\n};\nexports.version = \"19.3.1\";\n","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}\n","import type { ReactNode } from \"react\";\nimport { cn } from \"../../lib/cn\";\n\nexport type Tone = \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\" | \"accent\";\n\nexport const TONE_CLASSES: Record<Tone, string> = {\n neutral: \"bg-surface-2 text-muted border-border\",\n info: \"bg-info-soft text-info border-transparent\",\n success: \"bg-success-soft text-success border-transparent\",\n warning: \"bg-warning-soft text-warning border-transparent\",\n danger: \"bg-danger-soft text-danger border-transparent\",\n accent: \"bg-accent text-accent-fg border-transparent\",\n};\n\nexport interface BadgeProps {\n children: ReactNode;\n tone?: Tone;\n /** Accessible text when the visible content is terse (e.g. a count). */\n label?: string;\n className?: string;\n}\n\n/** Small pill for counts and tags. */\nexport function Badge({ children, tone = \"neutral\", label, className }: BadgeProps) {\n return (\n <span\n className={cn(\n \"inline-flex min-w-5 items-center justify-center rounded-full border px-1.5 text-xs leading-5 font-medium tabular-nums\",\n TONE_CLASSES[tone],\n className,\n )}\n title={label}\n >\n <span aria-hidden={label ? true : undefined}>{children}</span>\n {label && <span className=\"sr-only\">{label}</span>}\n </span>\n );\n}\n\n/** Count badge; renders nothing at zero. Caps at 99+. */\nexport function CountBadge({\n count,\n label,\n tone = \"danger\",\n className,\n}: {\n count: number;\n label: string;\n tone?: Tone;\n className?: string;\n}) {\n if (count <= 0) return null;\n return (\n <Badge tone={tone} label={`${count} ${label}`} className={className}>\n {count > 99 ? \"99+\" : count}\n </Badge>\n );\n}\n"],"ignoreList":[0,1],"mappings":"A,kHAWA,IAAIK,EAAAJ,EAAA,EACJ,SAASK,EAAuB,EAAM,CACpC,IAAIC,EAAM,4BAA8BC,EACxC,GAAI,EAAI,UAAU,OAAQ,CACxB,GAAO,WAAa,mBAAmB,UAAU,EAAE,EACnD,IAAK,IAAIC,EAAI,EAAGA,EAAI,UAAU,OAAQ,IACpC,GAAO,WAAa,mBAAmB,UAAUA,EAAE,CACvD,CACA,MACE,yBACAD,EACA,WACAD,EACA,gHAEJ,CACA,SAASG,GAAO,CAAC,CACjB,IAAIC,EAAY,CACZ,EAAG,CACD,EAAGD,EACH,EAAG,UAAY,CACb,MAAM,MAAMJ,EAAuB,GAAG,CAAC,CACzC,EACA,EAAGI,EACH,EAAGA,EACH,EAAGA,EACH,EAAGA,EACH,EAAGA,EACH,EAAGA,EACH,EAAGA,CACL,EACA,EAAG,EACH,YAAa,IACf,EACAE,EAAoB,OAAO,IAAI,cAAc,EAC7CC,EAAyB,OAAO,IAAI,mBAAmB,EACvDC,EAAuB,OAAO,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js";import{G as a,P as o,U as s,W as c,d as l,h as u,l as d,n as f,p}from"./states
|
|
1
|
+
import{_ as e,i as t,m as n,n as r,t as i}from"./jsx-runtime-D13aM9HY.js";import{G as a,P as o,U as s,W as c,d as l,h as u,l as d,n as f,p}from"./states-DXozulGZ.js";import{a as m,c as h,i as g,n as _,r as v,t as y}from"./Tabs-COH5EMql.js";import{n as b}from"./server-SxFxIScj.js";import{t as x}from"./chevron-right-evVLS6hq.js";import{O as S,P as C,f as w,r as T,x as E}from"./index-BhpEXLav.js";import{a as D,n as O,s as k,t as A}from"./TextArea-CeMEPZn4.js";import{d as j}from"./dist-B_RpNOcK.js";var M={name:`file-code`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]};M.node;var N=r(M),P=e(n(),1),F=(0,P.createContext)({}),I=()=>(0,P.useContext)(F),L=i();function R({node:e}){let{onRespond:t,busy:n,disabled:r}=I();return(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(v,{text:e.message}),!r&&(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(d,{variant:e.destructive?`danger`:`primary`,busy:n,onClick:()=>t?.({kind:`confirm`,confirmed:!0}),children:e.confirmLabel||`Confirm`}),(0,L.jsx)(d,{disabled:n,onClick:()=>t?.({kind:`confirm`,confirmed:!1}),children:e.cancelLabel||`Cancel`})]})]})}function z(e){let t=e.trim().split(` `)[0];return t===`/dev/null`?null:t.replace(/^[ab]\//,``)}var B=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function V(e){let t=[],n=null,r=0,i=0,a=0,o=0,s=!1,c=()=>{a<=0&&o<=0&&(s=!1)},l=(e=``)=>{let n={path:e,oldPath:null,newPath:null,status:`modified`,additions:0,deletions:0,lines:[]};return t.push(n),s=!1,n},u=e.replace(/\r\n/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`);u[u.length-1]===``&&u.pop();for(let e of u){if(e.startsWith(`diff --git `)){let t=/^diff --git a\/(.+?) b\/(.+)$/.exec(e);n=l(t?.[2]??``),t&&(n.oldPath=t[1],n.newPath=t[2]);continue}if(!s&&e.startsWith(`--- `)){(!n||n.lines.some(e=>e.kind!==`meta`))&&(n=l()),n.oldPath=z(e.slice(4)),n.oldPath===null&&(n.status=`added`);continue}if(!s&&e.startsWith(`+++ `)&&n){n.newPath=z(e.slice(4)),n.newPath===null&&(n.status=`deleted`),n.path=n.newPath??n.oldPath??n.path;continue}let t=B.exec(e);t?(n||=l(),r=Number(t[1]),i=Number(t[3]),a=t[2]===void 0?1:Number(t[2]),o=t[4]===void 0?1:Number(t[4]),s=a>0||o>0,n.lines.push({kind:`hunk`,text:e,oldLine:null,newLine:null})):(n||=l(),s&&e.startsWith(`+`)?(n.lines.push({kind:`add`,text:e.slice(1),oldLine:null,newLine:i++}),n.additions++,o--,c()):s&&e.startsWith(`-`)?(n.lines.push({kind:`del`,text:e.slice(1),oldLine:r++,newLine:null}),n.deletions++,a--,c()):s&&(e.startsWith(` `)||e===``)?(n.lines.push({kind:`context`,text:e.slice(1),oldLine:r++,newLine:i++}),a--,o--,c()):(e.startsWith(`\\`)||(s=!1,e.startsWith(`new file mode`)?n.status=`added`:e.startsWith(`deleted file mode`)?n.status=`deleted`:e.startsWith(`rename from `)?(n.status=`renamed`,n.oldPath=e.slice(12)):e.startsWith(`rename to `)?(n.status=`renamed`,n.newPath=e.slice(10),n.path=n.newPath):e.startsWith(`Binary files`)&&(n.status=`binary`)),n.lines.push({kind:`meta`,text:e,oldLine:null,newLine:null})))}return t}var ee={add:`+`,del:`-`,context:` `,hunk:``,meta:``},te={add:`bg-diff-add`,del:`bg-diff-del`,hunk:`bg-diff-hunk`,context:`bg-surface`,meta:`bg-surface`};function ne({patch:e,files:t,showFileHeaders:n=!0,onLineClick:r,isLineMarked:i,className:a}){let o=(0,P.useMemo)(()=>t??V(e??``),[t,e]);return o.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted`,children:`No changes.`}):(0,L.jsx)(`div`,{className:u(`flex min-w-0 flex-col gap-3`,a),children:o.map((e,t)=>(0,L.jsxs)(`section`,{className:`min-w-0 overflow-hidden rounded-md border border-border`,"aria-label":`Diff of ${e.path||`file`}`,children:[n&&(0,L.jsxs)(`header`,{className:`flex min-w-0 items-center gap-2 border-b border-border bg-surface-2 px-3 py-1.5 text-sm`,children:[(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,title:e.path,children:e.status===`renamed`&&e.oldPath?`${e.oldPath} → ${e.path}`:e.path}),(0,L.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[(0,L.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions,(0,L.jsx)(`span`,{className:`sr-only`,children:` added`})]}),` `,(0,L.jsxs)(`span`,{className:`text-danger`,children:[`-`,e.deletions,(0,L.jsx)(`span`,{className:`sr-only`,children:` deleted`})]})]})]}),e.status===`binary`?(0,L.jsx)(`p`,{className:`px-3 py-2 text-sm text-muted`,children:`Binary file not shown.`}):(0,L.jsx)(`div`,{className:`max-w-full overflow-x-auto overscroll-x-contain`,children:(0,L.jsx)(`table`,{className:`w-full border-collapse font-mono text-xs leading-5`,children:(0,L.jsx)(`tbody`,{children:e.lines.map((t,n)=>{let a={file:e.path,line:t},o=!!r&&(t.kind===`add`||t.kind===`del`||t.kind===`context`),s=i?.(a)??!1;return(0,L.jsxs)(`tr`,{className:u(t.kind===`add`&&`bg-diff-add`,t.kind===`del`&&`bg-diff-del`,t.kind===`hunk`&&`bg-diff-hunk text-muted`,t.kind===`meta`&&`text-muted`,s&&`outline outline-1 -outline-offset-1 outline-warning`),children:[(0,L.jsx)(`td`,{className:u(`sticky left-0 z-[1] w-[6.25rem] min-w-[6.25rem] select-none whitespace-nowrap p-0`,te[t.kind]),children:(0,L.jsxs)(`span`,{className:`flex`,children:[(0,L.jsx)(`span`,{className:`w-10 shrink-0 border-r border-border px-1.5 text-right text-subtle tabular-nums`,children:t.oldLine??``}),(0,L.jsx)(`span`,{className:`w-10 shrink-0 border-r border-border px-1.5 text-right text-subtle tabular-nums`,children:t.newLine??``}),(0,L.jsx)(`span`,{"aria-hidden":!0,className:u(`w-5 shrink-0 text-center`,t.kind===`add`&&`text-success`,t.kind===`del`&&`text-danger`),children:ee[t.kind]}),(t.kind===`add`||t.kind===`del`)&&(0,L.jsx)(`span`,{className:`sr-only`,children:t.kind===`add`?`added`:`deleted`})]})}),(0,L.jsx)(`td`,{className:`whitespace-pre pr-3`,children:o?(0,L.jsx)(`button`,{type:`button`,"data-diff-line":t.newLine??t.oldLine??void 0,className:`block w-full scroll-ml-[6.25rem] cursor-pointer text-left whitespace-pre hover:underline focus-visible:underline`,onMouseDown:e=>e.preventDefault(),onClick:e=>{e.currentTarget.focus({preventScroll:!0}),r?.(a)},"aria-label":`Comment on line ${t.newLine??t.oldLine}`,children:t.text||` `}):t.text})]},n)})})})})]},`${e.path}-${t}`))})}function re(e){let t={};for(let n of e)t[n.name]={selected:[],otherChosen:!1,otherText:``,text:n.kind===`text`?n.prefill??``:``};return t}function H(e,t){if(t)switch(e.kind){case`text`:return t.text;case`select`:return t.otherChosen?{other:t.otherText}:t.selected[0];case`multiselect`:{let e=[...t.selected];return t.otherChosen&&t.otherText.trim()&&e.push(t.otherText.trim()),e}}}function U(e,t){let n={},r=[];for(let i of e)j(i,n)&&(r.push(i),n[i.name]=H(i,t[i.name]));return r}function ie(e,t){let n={};for(let r of U(e,t)){let e=H(r,t[r.name]);e!==void 0&&(n[r.name]=e)}return n}function ae(e,t){let n={};for(let r of U(e,t)){let e=t[r.name];if(e){if(r.kind===`select`)e.otherChosen?e.otherText.trim()||(n[r.name]=`Enter a value or choose an option`):e.selected.length===0&&(n[r.name]=`Choose an option`);else if(r.kind===`multiselect`){let t=e.selected.length+(e.otherChosen&&e.otherText.trim()?1:0);e.otherChosen&&!e.otherText.trim()?n[r.name]=`Enter a value for Other`:r.min!==void 0&&t<r.min?n[r.name]=`Choose at least ${r.min}`:r.max!==void 0&&t>r.max&&(n[r.name]=`Choose at most ${r.max}`)}}}return n}function oe(e,t){return{...e,selected:[t],otherChosen:!1}}function se(e){return{...e,selected:[],otherChosen:!0}}function ce(e,t,n){if(e.selected.includes(t))return{...e,selected:e.selected.filter(e=>e!==t)};let r=e.selected.length+ +!!e.otherChosen;return n!==void 0&&r>=n?e:{...e,selected:[...e.selected,t]}}function le({node:e,className:t}){let{onRespond:n,busy:r,disabled:i}=I(),[a,o]=(0,P.useState)(()=>re(e.fields)),[s,c]=(0,P.useState)(!1),l=(0,P.useMemo)(()=>U(e.fields,a),[e.fields,a]),f=(0,P.useMemo)(()=>ae(e.fields,a),[e.fields,a]),p=i||r,m=(e,t)=>o(n=>({...n,[e]:t}));return(0,L.jsxs)(`form`,{className:u(`flex flex-col gap-4`,t),noValidate:!0,onSubmit:t=>{t.preventDefault(),c(!0),!(Object.keys(f).length>0||p)&&n?.({kind:`form`,values:ie(e.fields,a)})},children:[l.map(e=>(0,L.jsx)(ue,{field:e,state:a[e.name],onChange:t=>m(e.name,t),error:s?f[e.name]:void 0,disabled:p},e.name)),!i&&(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(d,{type:`submit`,variant:`primary`,busy:r,children:e.submitLabel||`Submit`}),(0,L.jsx)(d,{type:`button`,variant:`secondary`,disabled:r,onClick:()=>n?.({kind:`cancel`}),children:e.cancelLabel||`Cancel`}),s&&Object.keys(f).length>0&&(0,L.jsx)(`span`,{role:`alert`,className:`text-sm text-danger`,children:`Complete the highlighted fields.`})]})]})}function ue({field:e,state:t,onChange:n,error:r,disabled:i}){let a=(0,P.useId)(),o=`${a}-err`;if(e.kind===`text`){let s={id:a,value:t.text,placeholder:e.placeholder,disabled:i,"aria-invalid":!!r||void 0,"aria-describedby":r?o:void 0};return(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(`label`,{htmlFor:a,className:`text-sm font-medium`,children:e.label}),e.multiline?(0,L.jsx)(A,{...s,minRows:3,onChange:e=>n({...t,text:e.target.value})}):(0,L.jsx)(O,{...s,onChange:e=>n({...t,text:e.target.value})}),r&&(0,L.jsx)(`p`,{id:o,className:`text-sm text-danger`,children:r})]})}let s=e.kind===`multiselect`,c=!s&&t.selected[0]?e.options.find(e=>e.value===t.selected[0])?.preview:void 0,l=s&&(e.min!==void 0||e.max!==void 0)?e.min!==void 0&&e.max!==void 0?`Choose ${e.min}–${e.max}`:e.min===void 0?`Choose up to ${e.max}`:`Choose at least ${e.min}`:s?`Choose any`:void 0;return(0,L.jsxs)(`fieldset`,{className:`flex min-w-0 flex-col gap-2`,"aria-describedby":r?o:void 0,"aria-invalid":!!r||void 0,children:[(0,L.jsxs)(`legend`,{className:`mb-2 text-sm font-medium`,children:[e.label,l&&(0,L.jsx)(`span`,{className:`ml-2 font-normal text-muted`,children:l})]}),(0,L.jsxs)(`div`,{className:`grid gap-2`,children:[e.options.map(r=>(0,L.jsx)(W,{name:a,option:r,multi:s,checked:t.selected.includes(r.value),disabled:i,onToggle:()=>n(s?ce(t,r.value,e.kind===`multiselect`?e.max:void 0):oe(t,r.value))},r.value)),e.allowOther&&(0,L.jsx)(W,{name:a,option:{value:`__other__`,label:e.allowOther.label||`Other`},multi:s,checked:t.otherChosen,disabled:i,onToggle:()=>n(s?{...t,otherChosen:!t.otherChosen}:se(t))})]}),e.allowOther&&t.otherChosen&&(0,L.jsx)(O,{"aria-label":e.allowOther.label||`Other`,placeholder:e.allowOther.placeholder??`Type your answer`,value:t.otherText,disabled:i,autoFocus:!0,onChange:e=>n({...t,otherText:e.target.value})}),c&&(0,L.jsx)(`pre`,{className:`max-h-64 max-w-full overflow-auto rounded-md border border-border bg-surface-2 px-3 py-2 text-xs leading-5`,children:c}),r&&(0,L.jsx)(`p`,{id:o,className:`text-sm text-danger`,children:r})]})}function W({name:e,option:t,multi:n,checked:r,disabled:i,onToggle:a}){return(0,L.jsxs)(`label`,{className:u(`tap flex min-w-0 cursor-pointer items-start gap-3 rounded-lg border px-3 py-2.5 text-sm`,`has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-accent`,r?`border-accent bg-accent-soft`:`border-border bg-surface hover:bg-surface-2`,i&&`cursor-not-allowed opacity-70`),children:[(0,L.jsx)(`input`,{type:n?`checkbox`:`radio`,name:e,value:t.value,checked:r,disabled:i,onChange:a,className:`sr-only`}),(0,L.jsx)(`span`,{"aria-hidden":!0,className:u(`mt-0.5 inline-flex size-4 shrink-0 items-center justify-center border`,n?`rounded`:`rounded-full`,r?`border-accent bg-accent text-accent-fg`:`border-border-strong bg-surface`),children:r&&(n?(0,L.jsx)(b,{className:`size-3`}):(0,L.jsx)(`span`,{className:`size-1.5 rounded-full bg-accent-fg`}))}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`span`,{className:`block font-medium break-words`,children:t.label}),t.description&&(0,L.jsx)(`span`,{className:`block text-muted break-words`,children:t.description})]})]})}function G({node:e,className:t,...n}){let r=I(),i=Object.values(n).some(e=>e!==void 0),a=(0,L.jsx)(`div`,{className:u(`flex min-w-0 flex-col gap-3`,t),children:(0,L.jsx)(K,{node:e})});return i?(0,L.jsx)(F.Provider,{value:{...r,...de(n)},children:a}):a}function de(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var fe={default:`text-text`,muted:`text-muted`,success:`text-success`,warning:`text-warning`,danger:`text-danger`};function K({node:e}){switch(e.t){case`text`:return(0,L.jsx)(`p`,{className:u(`text-sm break-words whitespace-pre-wrap`,fe[e.tone??`default`]),children:e.text});case`markdown`:return(0,L.jsx)(v,{text:e.text});case`code`:return(0,L.jsx)(m,{text:e.text,lang:e.lang,maxHeight:`24rem`});case`diff`:return(0,L.jsx)(ne,{patch:e.patch});case`list`:return(0,L.jsx)(pe,{node:e});case`table`:return(0,L.jsx)(`div`,{className:`max-w-full overflow-x-auto overscroll-x-contain rounded-md border border-border`,children:(0,L.jsxs)(`table`,{className:`w-full border-collapse text-sm`,children:[(0,L.jsx)(`thead`,{className:`bg-surface-2`,children:(0,L.jsx)(`tr`,{children:e.columns.map((e,t)=>(0,L.jsx)(`th`,{scope:`col`,className:`border-b border-border px-3 py-1.5 text-left font-medium`,children:e},t))})}),(0,L.jsx)(`tbody`,{children:e.rows.map((e,t)=>(0,L.jsx)(`tr`,{className:`border-b border-border last:border-b-0`,children:e.map((e,t)=>(0,L.jsx)(`td`,{className:`px-3 py-1.5 align-top break-words`,children:e},t))},t))})]})});case`section`:return(0,L.jsx)(me,{node:e});case`tabs`:return(0,L.jsx)(he,{node:e});case`progress`:return(0,L.jsx)(ge,{node:e});case`ref`:return(0,L.jsx)(ve,{refValue:e.ref,label:e.label});case`form`:return(0,L.jsx)(le,{node:e});case`confirm`:return(0,L.jsx)(R,{node:e});case`actions`:return(0,L.jsx)(ye,{node:e});default:return null}}function q({nodes:e}){return(0,L.jsx)(L.Fragment,{children:e.map((e,t)=>(0,L.jsx)(K,{node:e},t))})}function pe({node:e}){let t=e.ordered?`ol`:`ul`;return(0,L.jsx)(t,{className:u(`flex flex-col gap-1.5 pl-5 text-sm`,e.ordered?`list-decimal`:`list-disc`),children:e.items.map((e,t)=>(0,L.jsx)(`li`,{className:`min-w-0`,children:(0,L.jsx)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:(0,L.jsx)(K,{node:e})})},t))})}function me({node:e}){return e.collapsible?(0,L.jsxs)(`details`,{className:`group min-w-0`,open:!0,children:[(0,L.jsxs)(`summary`,{className:`tap flex cursor-pointer list-none items-center gap-1.5 py-1 text-sm font-medium [&::-webkit-details-marker]:hidden`,children:[(0,L.jsx)(x,{"aria-hidden":!0,className:`size-4 shrink-0 transition-transform group-open:rotate-90`}),e.title??`Details`]}),(0,L.jsx)(`div`,{className:`flex min-w-0 flex-col gap-3 border-l border-border pl-3 ml-2 mt-1`,children:(0,L.jsx)(q,{nodes:e.children})})]}):(0,L.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-2`,children:[e.title&&(0,L.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.title}),(0,L.jsx)(q,{nodes:e.children})]})}function he({node:e}){let t=(0,P.useId)(),[n,r]=(0,P.useState)(e.tabs[0]?.id??``),i=e.tabs.find(e=>e.id===n)??e.tabs[0];return i?(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,L.jsx)(_,{label:`Sections`,idPrefix:t,tabs:e.tabs.map(e=>({id:e.id,label:e.label})),value:i.id,onChange:r,scrollable:!0}),(0,L.jsx)(y,{idPrefix:t,id:i.id,className:`flex min-w-0 flex-col gap-3`,children:(0,L.jsx)(q,{nodes:i.children})})]}):null}function ge({node:e}){let t=e.status??`running`,n=t===`ok`?C:t===`error`?S:E,r=t===`ok`?`Done`:t===`error`?`Failed`:`In progress`,i=e.value===void 0?null:Math.round(e.value*100);return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[t===`running`?(0,L.jsx)(l,{className:`size-4 text-info`}):(0,L.jsx)(n,{"aria-hidden":!0,className:u(`size-4 shrink-0`,t===`ok`&&`text-success`,t===`error`&&`text-danger`)}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),(0,L.jsxs)(`span`,{className:`shrink-0 text-xs text-muted`,children:[r,i===null?``:` · ${i}%`]})]}),i!==null&&(0,L.jsx)(`div`,{role:`progressbar`,"aria-label":e.label,"aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,className:`h-1.5 overflow-hidden rounded-full bg-surface-3`,children:(0,L.jsx)(`div`,{className:u(`h-full rounded-full`,t===`error`?`bg-danger`:t===`ok`?`bg-success`:`bg-accent`),style:{width:`${i}%`}})})]})}function _e(e){switch(e.kind){case`session`:return`/code/${encodeURIComponent(e.sessionId)}`;case`task`:return`/tasks/${encodeURIComponent(e.taskId)}`;default:return null}}function ve({refValue:e,label:n}){let{onOpenFile:r}=I(),i=_e(e);return i?(0,L.jsx)(t,{to:i,className:`text-sm text-accent underline underline-offset-2`,children:n}):e.kind===`file`?r?(0,L.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),className:`inline-flex min-w-0 items-center gap-1 text-left text-sm text-accent underline underline-offset-2`,children:[(0,L.jsx)(N,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,L.jsx)(`span`,{className:`truncate`,children:n||e.path})]}):(0,L.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1 font-mono text-sm`,title:e.path,children:[(0,L.jsx)(N,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted`}),(0,L.jsx)(`span`,{className:`truncate`,children:n||e.path})]}):e.kind===`native_session`?(0,L.jsxs)(`span`,{className:`text-sm`,title:e.sessionFile,children:[n,` `,(0,L.jsx)(`span`,{className:`text-muted`,children:`(native Pi session, not imported)`})]}):(0,L.jsx)(`span`,{className:`text-sm`,children:n})}function ye({node:e}){let{onRespond:t,onAction:n,busy:r,disabled:i}=I();return i?null:(0,L.jsx)(`div`,{className:`flex min-w-0 flex-col gap-2 sm:flex-row sm:flex-wrap`,children:e.actions.map(e=>(0,L.jsx)(d,{className:`h-auto min-h-9 min-w-0 justify-start py-1.5 text-left whitespace-normal sm:justify-center sm:text-center`,variant:e.tone===`primary`?`primary`:e.tone===`danger`?`danger`:`secondary`,disabled:r||!t&&!n,onClick:()=>{t?t({kind:`action`,actionId:e.id}):n?.(e.id)},children:e.label},e.id))})}var be=`An extension opened a terminal-only dialog. In RPC mode Pi gave it no answer, so the extension continued without one.`,xe=[{id:`abort`,label:`Stop the run`,tone:`danger`},{id:`message`,label:`Send a message to the agent`,tone:`primary`}];function J(e){if(e.t===`actions`)return e;if(e.t===`section`)for(let t of e.children){let e=J(t);if(e)return e}return null}function Se(e){return e.state===`unsupported`||e.source.kind===`unsupported_custom`}function Ce(e){let t=(J(e.presentation)?.actions??[]).filter(e=>e.id===`abort`||e.id===`message`).map(e=>({id:e.id,label:e.label,tone:e.tone==="default"?`secondary`:e.tone??(e.id===`abort`?`danger`:`primary`)}));return{answerable:e.state===`unsupported`&&e.resolution===null,actions:t.length>0?t:xe,copy:be}}function we(e){return e===`running`||e===`waiting_input`?`followUp`:`prompt`}function Y(e){switch(e.t){case`form`:case`confirm`:case`actions`:return!0;case`list`:return e.items.some(Y);case`section`:return e.children.some(Y);case`tabs`:return e.tabs.some(e=>e.children.some(Y));default:return!1}}function X(e){return e===`host`?`the host`:e===`pi`?`Pi`:`a device`}function Te({interaction:e,readOnlyReason:t,className:n,onAnswered:r,id:i,sticky:l,flush:m}){let h=o(e=>e.upsertInteraction),[g,_]=(0,P.useState)(!1),[v,y]=(0,P.useState)(null),[b,x]=(0,P.useState)(null),[S,C]=(0,P.useState)(null),[E,D]=(0,P.useState)(null),O=E&&E.id===e.id&&E.revision>e.revision?E:e,k=O.state===`pending`,A=Se(O),j=o(e=>e.sessions[O.sessionId]?.runtime),[M,N]=(0,P.useState)(!1),[F,I]=(0,P.useState)(``),R=async e=>{_(!0),y(null),C(e);try{let t=await s(`/api/interactions/${encodeURIComponent(O.id)}/answer`,{revision:O.revision,response:e});return t?.interaction&&(h(t.interaction),D(t.interaction),r?.(t.interaction)),!0}catch(e){if(a(e,`already_answered`)){let t=e.details?.interaction;t&&(h(t),D(t)),x(t?.resolution?.summary??`answered on another device`)}else y(e);return!1}finally{_(!1)}},z=async()=>{let e=F.trim();if(e){_(!0),y(null);try{await s(`/api/sessions/${encodeURIComponent(O.sessionId)}/prompt`,{text:e,mode:we(j)})}catch(e){y(e),_(!1);return}_(!1),await R({kind:`action`,actionId:`message`})&&(N(!1),I(``))}},B=T();return k&&!b&&!A&&$(O.presentation)?(0,L.jsx)(Me,{id:i,interaction:O,node:O.presentation,onRespond:e=>void R(e),busy:g,disabled:!!t,mobile:B===`mobile`,sticky:l??!0,flush:m??!1,className:n}):(0,L.jsxs)(`article`,{id:i,"aria-label":`Question: ${O.title}`,className:u(`flex min-w-0 flex-col gap-3 border-l-2 py-1 pl-3`,k?`border-warning`:`border-border`,n),children:[(0,L.jsxs)(`header`,{className:`flex min-w-0 flex-wrap items-start gap-2`,children:[(0,L.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-semibold break-words`,children:O.title}),(0,L.jsx)(w,{kind:`interaction`,value:O.state,size:`sm`})]}),b&&(0,L.jsxs)(`p`,{role:`status`,className:`rounded-md bg-surface-2 px-3 py-2 text-sm`,children:[`Already answered: `,b]}),A?(0,L.jsx)(Ee,{interaction:O,readOnlyReason:t??null,busy:g,answered:b!==null,composing:M,message:F,setMessage:I,onAction:e=>{e===`message`?N(!0):R({kind:`action`,actionId:e})},onSend:()=>void z(),onCancelMessage:()=>N(!1)}):k&&!b?(0,L.jsxs)(L.Fragment,{children:[t&&(0,L.jsx)(`p`,{className:`text-sm text-muted`,children:t}),(0,L.jsx)(G,{node:O.presentation,onRespond:e=>void R(e),busy:g,disabled:!!t}),!t&&!Y(O.presentation)&&(0,L.jsx)(`div`,{children:(0,L.jsx)(d,{busy:g,onClick:()=>void R({kind:`cancel`}),children:`Dismiss`})}),g&&(0,L.jsx)(`p`,{role:`status`,className:`text-sm text-muted`,children:`Sending answer… waiting for the host to confirm.`})]}):b?null:O.resolution?(0,L.jsxs)(`p`,{className:`text-sm text-muted`,children:[O.state===`resolved`?`Answered`:`Closed`,` by`,` `,X(O.resolution.by),` `,p(O.resolution.at),`:`,` `,(0,L.jsx)(`span`,{className:`text-text`,children:O.resolution.summary})]}):(0,L.jsx)(`p`,{className:`text-sm text-muted`,children:O.state===`expired`?`This question expired before it was answered (Pi closed the dialog).`:`This question was cancelled.`}),v!==null&&(0,L.jsx)(f,{compact:!0,title:`Answer not delivered`,error:c(v),onRetry:S?()=>void R(S):void 0})]})}function Ee({interaction:e,readOnlyReason:t,busy:n,answered:r,composing:i,message:a,setMessage:o,onAction:s,onSend:c,onCancelMessage:l}){let u=Ce(e);return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,L.jsx)(`p`,{className:`text-sm text-muted`,children:u.copy}),e.resolution?(0,L.jsxs)(`p`,{className:`text-sm text-muted`,children:[`Chosen by `,X(e.resolution.by),` `,p(e.resolution.at),`: `,(0,L.jsx)(`span`,{className:`text-text`,children:e.resolution.summary})]}):!u.answerable||r?null:t?(0,L.jsx)(`p`,{className:`text-sm text-muted`,children:t}):i?(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,L.jsx)(A,{"aria-label":`Message to the agent`,value:a,onChange:e=>o(e.target.value),rows:3,autoFocus:!0,placeholder:`Tell the agent what to do instead`}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(d,{variant:`primary`,busy:n,disabled:!a.trim(),onClick:c,children:`Send message`}),(0,L.jsx)(d,{disabled:n,onClick:l,children:`Cancel`})]})]}):(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:u.actions.map(e=>(0,L.jsx)(d,{variant:e.tone,busy:n&&e.id===`abort`,disabled:n,onClick:()=>s(e.id),children:e.label},e.id))})]})}function Z(e){if(e.t!==`section`||e.children.length<2)return null;let t=e.children[e.children.length-1];if(t?.t!==`actions`)return null;let n=e.children.slice(0,-1);return n.some(Y)?null:{body:{...e,children:n},actions:t}}function Q(e,t){let n=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;e?.scrollIntoView({behavior:n?`auto`:`smooth`,block:t})}function De(e){let[t,n]=(0,P.useState)(!0);return(0,P.useEffect)(()=>{let t=e.current;if(!t||typeof IntersectionObserver>`u`)return;let r=new IntersectionObserver(([e])=>n(!!e?.isIntersecting));return r.observe(t),()=>r.disconnect()},[e]),t}function Oe(e){if(e.t===`markdown`)return e.text;if(e.t===`section`)for(let t of e.children){let e=Oe(t);if(e!==null)return e}return null}function $(e){if(!Z(e))return!1;let t=Oe(e);return t!==null&&(t.length>=400||t.split(`
|
|
4
4
|
`).length>=12)}function ke(e){let t=/^\s*#{1,6}\s+(.+?)\s*(?:\n+|$)/.exec(e);return t?.[1]?{title:t[1],rest:e.slice(t[0].length)}:{title:null,rest:e}}function Ae(e){let t=[],n=!1;for(let r of e.split(`
|
|
5
5
|
`)){/^\s*```/.test(r)&&(n=!n);let e=n?null:/^##\s+(.+?)\s*$/.exec(r);e?.[1]&&t.push({text:e[1],id:g(e[1])})}return t}function je(e,t){let[n,r]=(0,P.useState)(null),[i,a]=(0,P.useState)(null),o=e.join(`|`);(0,P.useEffect)(()=>{if(typeof IntersectionObserver>`u`||!e.length)return;let n=e.map(e=>t.current?.querySelector(`#${CSS.escape(e)}`)).filter(e=>!!e),i=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&r(t.target.id)},{rootMargin:`-56px 0px -70% 0px`});for(let e of n)i.observe(e);let o=()=>a(null);return window.addEventListener(`wheel`,o,{passive:!0}),window.addEventListener(`touchmove`,o,{passive:!0}),window.addEventListener(`keydown`,o),()=>{i.disconnect(),window.removeEventListener(`wheel`,o),window.removeEventListener(`touchmove`,o),window.removeEventListener(`keydown`,o)}},[o,t]);let s=i??n;return(0,P.useEffect)(()=>{let e=t.current;if(e){for(let t of e.querySelectorAll(`h2[data-active]`))delete t.dataset.active;if(s){let t=e.querySelector(`#${CSS.escape(s)}`);t&&(t.dataset.active=`true`)}}},[s,o,t]),[s,a]}function Me({id:e,interaction:t,node:n,onRespond:r,busy:i,disabled:a,mobile:o,sticky:s,flush:c,className:l}){let f=(0,P.useRef)(null),p=(0,P.useRef)(null),m=(0,P.useRef)(null),g=De(m),[_,y]=(0,P.useState)(!1),b=Z(n),{title:x,rest:S}=ke((b?.body.t===`section`?b.body.children.find(e=>e.t===`markdown`):void 0)?.text??``),C=Ae(S),[T,E]=je(C.map(e=>e.id),f);if(b?.body.t!==`section`)return null;let O=b.actions.actions,A=b.body.children.find(e=>e.t===`section`),j=t.title,M=x??j,N=e=>{y(!1),r({kind:`action`,actionId:e})},F=(e,t)=>e===0||t===`primary`?`primary`:t===`danger`?`danger`:`secondary`,I=!a&&!g,R=`h-auto min-h-9 min-w-0 py-1.5 text-left leading-tight whitespace-normal`,z=e=>Q(e,`start`);return(0,L.jsxs)(`article`,{id:e,"data-testid":`document-interaction`,"aria-label":`Question: ${j}`,className:u(`w-full min-w-0 self-stretch border-t border-border`,l),children:[(0,L.jsxs)(`header`,{className:u(`z-10 flex min-w-0 items-center gap-2 border-b border-border bg-bg px-4 py-2 md:px-6`,s&&(c?`md:sticky md:top-0`:`max-md:static md:sticky md:-top-3`)),children:[(0,L.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[15px] leading-snug font-semibold md:text-sm`,children:M}),(0,L.jsx)(w,{kind:`interaction`,value:t.state,size:`sm`,className:o?`[&>span]:sr-only`:void 0}),!a&&!g&&(0,L.jsx)(`button`,{type:`button`,className:`shrink-0 text-xs font-medium text-accent`,onClick:()=>Q(m.current,`center`),children:`Jump to options ↓`})]}),A&&(0,L.jsx)(`aside`,{className:`mx-4 mt-3 rounded-md bg-warning-soft px-3 py-2 text-sm md:mx-6`,children:(0,L.jsx)(G,{node:A})}),(0,L.jsxs)(`div`,{className:`px-4 py-4 md:grid md:grid-cols-[13rem_minmax(0,1fr)] 2xl:grid-cols-[15rem_minmax(0,1fr)] md:gap-8 md:px-6`,children:[C.length>0&&(0,L.jsx)(`nav`,{"aria-label":`Plan sections`,className:`hidden md:block`,children:(0,L.jsxs)(`ol`,{className:`sticky top-16 flex flex-col gap-0.5 border-l border-border text-sm`,children:[(0,L.jsx)(`li`,{children:(0,L.jsx)(`button`,{type:`button`,className:`-ml-px block w-full truncate border-l-2 border-transparent py-1 pl-3 text-left text-muted hover:text-text`,onClick:()=>z(p.current),children:`Start`})}),C.map(e=>(0,L.jsx)(`li`,{children:(0,L.jsx)(`button`,{type:`button`,"aria-current":T===e.id,className:`-ml-px block w-full truncate border-l-2 border-transparent py-1 pl-3 text-left text-muted hover:text-text aria-[current=true]:border-accent aria-[current=true]:text-text`,onClick:()=>{E(e.id),z(f.current?.querySelector(`#${CSS.escape(e.id)}`)??null)},children:e.text})},e.id))]})}),(0,L.jsx)(`div`,{ref:p,className:`min-w-0 scroll-mt-14`,children:(0,L.jsx)(`div`,{ref:f,className:`sy-prose-compact max-w-[80ch] min-w-0 2xl:max-w-[100ch] min-[1800px]:text-base [&_h2]:scroll-mt-14`,children:(0,L.jsx)(v,{text:S,headingIds:!0,className:`text-inherit`})})})]}),(0,L.jsxs)(`section`,{ref:m,"data-testid":`plan-options`,"aria-label":j,className:`border-t border-border px-4 py-3 md:px-6`,children:[(0,L.jsx)(`p`,{className:`mb-2 text-sm font-medium`,children:j}),!a&&(0,L.jsx)(`div`,{className:`flex min-w-0 flex-col gap-2 md:flex-row md:flex-wrap`,children:O.map((e,t)=>(0,L.jsx)(d,{variant:F(t,e.tone),size:`md`,disabled:i,className:u(R,`md:text-center`),onClick:()=>N(e.id),children:e.label},e.id))}),(0,L.jsxs)(`button`,{type:`button`,className:`mt-2 inline-flex items-center gap-1 text-xs font-medium text-accent`,onClick:()=>z(p.current),children:[(0,L.jsx)(h,{"aria-hidden":!0,className:`size-3.5`}),`Back to the plan start`]})]}),I&&(0,L.jsx)(`div`,{"data-testid":`answer-bar`,className:u(`z-10 flex min-w-0 items-center gap-2 border-t border-border bg-bg px-4 py-2 pb-[calc(0.5rem+var(--safe-bottom))] md:gap-3 md:px-6`,s&&!c?`sticky -bottom-3`:`sticky bottom-0`),children:o?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(k,{label:`Plan start`,icon:(0,L.jsx)(h,{className:`size-4`}),variant:`secondary`,onClick:()=>z(p.current)}),O.length>2?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(d,{variant:`primary`,disabled:i,className:u(R,`flex-1`),onClick:()=>N(O[0].id),children:O[0].label}),(0,L.jsxs)(d,{variant:`secondary`,onClick:()=>y(!0),children:[`More (`,O.length-1,`)`]})]}):O.map((e,t)=>(0,L.jsx)(d,{variant:F(t,e.tone),disabled:i,className:u(R,`flex-1`),onClick:()=>N(e.id),children:e.label},e.id))]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`shrink-0 text-sm font-medium`,children:j}),(0,L.jsx)(`div`,{className:`grid min-w-0 flex-1 grid-cols-3 gap-2 min-[2200px]:grid-cols-6`,children:O.map((e,t)=>(0,L.jsx)(d,{variant:F(t,e.tone),disabled:i,className:`w-full`,onClick:()=>N(e.id),children:e.label},e.id))}),(0,L.jsx)(k,{label:`Plan start`,icon:(0,L.jsx)(h,{className:`size-4`}),variant:`secondary`,size:`sm`,onClick:()=>z(p.current)})]})}),(0,L.jsx)(D,{open:_,onClose:()=>y(!1),title:j,children:(0,L.jsx)(`div`,{className:`flex flex-col gap-2`,children:O.map((e,t)=>(0,L.jsx)(d,{block:!0,variant:F(t,e.tone),disabled:i,className:R,onClick:()=>N(e.id),children:e.label},e.id))})})]})}export{V as a,ne as i,$ as n,N as o,G as r,Te as t};
|
|
6
|
-
//# sourceMappingURL=InteractionCard-
|
|
6
|
+
//# sourceMappingURL=InteractionCard-DaLqafmA.js.map
|