@epic-web/workshop-app 5.7.1 → 5.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.
Files changed (113) hide show
  1. package/build/client/assets/{_-CjjFMNGC.js → _-Dn1a0zwA.js} +2 -2
  2. package/build/client/assets/{_-CjjFMNGC.js.map → _-Dn1a0zwA.js.map} +1 -1
  3. package/build/client/assets/_exerciseNumber-BVCFK83o.js +2 -0
  4. package/build/client/assets/{_exerciseNumber-CqkGzsgV.js.map → _exerciseNumber-BVCFK83o.js.map} +1 -1
  5. package/build/client/assets/{_exerciseNumber_._stepNumber-BNWGPi9m.js → _exerciseNumber_._stepNumber-CAxJdIJe.js} +2 -2
  6. package/build/client/assets/{_exerciseNumber_._stepNumber-BNWGPi9m.js.map → _exerciseNumber_._stepNumber-CAxJdIJe.js.map} +1 -1
  7. package/build/client/assets/_exerciseNumber_.finished-DYebDhaK.js +2 -0
  8. package/build/client/assets/_exerciseNumber_.finished-DYebDhaK.js.map +1 -0
  9. package/build/client/assets/_layout-CyDc9BN3.js +6 -0
  10. package/build/client/assets/_layout-CyDc9BN3.js.map +1 -0
  11. package/build/client/assets/_layout-cu1Of_4G.js +2 -0
  12. package/build/client/assets/_layout-cu1Of_4G.js.map +1 -0
  13. package/build/client/assets/{accordion-C-sW--in.js → accordion-e-d1HozW.js} +2 -2
  14. package/build/client/assets/{accordion-C-sW--in.js.map → accordion-e-d1HozW.js.map} +1 -1
  15. package/build/client/assets/{account-Cc968svU.js → account-HU5gUm5Q.js} +2 -2
  16. package/build/client/assets/{account-Cc968svU.js.map → account-HU5gUm5Q.js.map} +1 -1
  17. package/build/client/assets/app-CWEUg7hY.js +2 -0
  18. package/build/client/assets/{app-BOqXK9hi.js.map → app-CWEUg7hY.js.map} +1 -1
  19. package/build/client/assets/{button-BS845Tjo.js → button-Hft_V1bH.js} +2 -2
  20. package/build/client/assets/{button-BS845Tjo.js.map → button-Hft_V1bH.js.map} +1 -1
  21. package/build/client/assets/diff-B_FrL8Cl.js +2 -0
  22. package/build/client/assets/diff-B_FrL8Cl.js.map +1 -0
  23. package/build/client/assets/diff-DmVm_N6W.js +2 -0
  24. package/build/client/assets/{diff-D0e_PrB7.js.map → diff-DmVm_N6W.js.map} +1 -1
  25. package/build/client/assets/{discord-BfP_Rny5.js → discord-C0ZkL9cR.js} +2 -2
  26. package/build/client/assets/{discord-BfP_Rny5.js.map → discord-C0ZkL9cR.js.map} +1 -1
  27. package/build/client/assets/discord-D6ZwxiZG.js +2 -0
  28. package/build/client/assets/discord-D6ZwxiZG.js.map +1 -0
  29. package/build/client/assets/{epic-video-qHKPWPt1.js → epic-video-75U1kyqf.js} +121 -121
  30. package/build/client/assets/{epic-video-qHKPWPt1.js.map → epic-video-75U1kyqf.js.map} +1 -1
  31. package/build/client/assets/{error-boundary-Beul7lrT.js → error-boundary-IvG0vuiP.js} +2 -2
  32. package/build/client/assets/{error-boundary-Beul7lrT.js.map → error-boundary-IvG0vuiP.js.map} +1 -1
  33. package/build/client/assets/finished-DDnBGcs8.js +2 -0
  34. package/build/client/assets/finished-DDnBGcs8.js.map +1 -0
  35. package/build/client/assets/{index-BOQWfIQC.js → index-9OWT3nC-.js} +3 -3
  36. package/build/client/assets/{index-BOQWfIQC.js.map → index-9OWT3nC-.js.map} +1 -1
  37. package/build/client/assets/{index-cZQeGrqL.js → index-BzN2y10J.js} +2 -2
  38. package/build/client/assets/{index-cZQeGrqL.js.map → index-BzN2y10J.js.map} +1 -1
  39. package/build/client/assets/index-CQEwwWTS.js +2 -0
  40. package/build/client/assets/{index-oED4uZLa.js.map → index-CQEwwWTS.js.map} +1 -1
  41. package/build/client/assets/index-DJhl_Q5J.js +2 -0
  42. package/build/client/assets/index-DJhl_Q5J.js.map +1 -0
  43. package/build/client/assets/{index-BHwOR8R1.js → index-c1IJ5ZX5.js} +2 -2
  44. package/build/client/assets/{index-BHwOR8R1.js.map → index-c1IJ5ZX5.js.map} +1 -1
  45. package/build/client/assets/{index-BPegC-d3.js → index-t6AA12_S.js} +2 -2
  46. package/build/client/assets/{index-BPegC-d3.js.map → index-t6AA12_S.js.map} +1 -1
  47. package/build/client/assets/{loading-C2wPVvQw.js → loading-DsHhjqzj.js} +2 -2
  48. package/build/client/assets/{loading-C2wPVvQw.js.map → loading-DsHhjqzj.js.map} +1 -1
  49. package/build/client/assets/{login-DoU7gifi.js → login-DJlKIofe.js} +2 -2
  50. package/build/client/assets/{login-DoU7gifi.js.map → login-DJlKIofe.js.map} +1 -1
  51. package/build/client/assets/manifest-3da21166.js +1 -0
  52. package/build/client/assets/{mdx-CsS30JUo.js → mdx-CsRMuEw9.js} +2 -2
  53. package/build/client/assets/{mdx-CsS30JUo.js.map → mdx-CsRMuEw9.js.map} +1 -1
  54. package/build/client/assets/{misc-BtjCSy-T.js → misc-DoGPlBur.js} +2 -2
  55. package/build/client/assets/{misc-BtjCSy-T.js.map → misc-DoGPlBur.js.map} +1 -1
  56. package/build/client/assets/{nav-chevrons-2hLTwAZb.js → nav-chevrons-CxWSSbTo.js} +2 -2
  57. package/build/client/assets/{nav-chevrons-2hLTwAZb.js.map → nav-chevrons-CxWSSbTo.js.map} +1 -1
  58. package/build/client/assets/onboarding-DssP5iXB.js +2 -0
  59. package/build/client/assets/{onboarding-Cu6eD7KS.js.map → onboarding-DssP5iXB.js.map} +1 -1
  60. package/build/client/assets/online-D33oijLr.js +2 -0
  61. package/build/client/assets/online-D33oijLr.js.map +1 -0
  62. package/build/client/assets/{preferences-br0VSK51.js → preferences-BIt5-Lgy.js} +2 -2
  63. package/build/client/assets/{preferences-br0VSK51.js.map → preferences-BIt5-Lgy.js.map} +1 -1
  64. package/build/client/assets/{presence-CrYBA3ta.js → presence-BsqTpSt4.js} +5 -5
  65. package/build/client/assets/{presence-CrYBA3ta.js.map → presence-BsqTpSt4.js.map} +1 -1
  66. package/build/client/assets/{preview-C2y4Z0qO.js → preview-CZwnFQrx.js} +2 -2
  67. package/build/client/assets/{preview-C2y4Z0qO.js.map → preview-CZwnFQrx.js.map} +1 -1
  68. package/build/client/assets/{product-gqq_YQBW.js → product-CVL4Z9c0.js} +2 -2
  69. package/build/client/assets/{product-gqq_YQBW.js.map → product-CVL4Z9c0.js.map} +1 -1
  70. package/build/client/assets/{progress-D-HsH4j3.js → progress-Dj5cyA_v.js} +2 -2
  71. package/build/client/assets/{progress-D-HsH4j3.js.map → progress-Dj5cyA_v.js.map} +1 -1
  72. package/build/client/assets/{progress-bar-CTPCfvDi.js → progress-bar-Dln7epYZ.js} +2 -2
  73. package/build/client/assets/{progress-bar-CTPCfvDi.js.map → progress-bar-Dln7epYZ.js.map} +1 -1
  74. package/build/client/assets/{revalidation-ws-DYaJNyw1.js → revalidation-ws-Bes2l3ma.js} +2 -2
  75. package/build/client/assets/{revalidation-ws-DYaJNyw1.js.map → revalidation-ws-Bes2l3ma.js.map} +1 -1
  76. package/build/client/assets/{root-C1pLsthM.js → root-Bb8fIt2z.js} +3 -3
  77. package/build/client/assets/{root-C1pLsthM.js.map → root-Bb8fIt2z.js.map} +1 -1
  78. package/build/client/assets/{set-playground-DQzAhC0t.js → set-playground-DOFTHWzE.js} +2 -2
  79. package/build/client/assets/{set-playground-DQzAhC0t.js.map → set-playground-DOFTHWzE.js.map} +1 -1
  80. package/build/client/assets/tailwind-4klXLdJc.css +1 -0
  81. package/build/client/assets/test-BwM0E8Mk.js +2 -0
  82. package/build/client/assets/{test-CDWRwwO-.js.map → test-BwM0E8Mk.js.map} +1 -1
  83. package/build/client/assets/{tests-LWW8wCYZ.js → tests-CDgBzBBo.js} +3 -3
  84. package/build/client/assets/tests-CDgBzBBo.js.map +1 -0
  85. package/build/client/assets/{tooltip-Bp9KHnLy.js → tooltip-DT9kZxPw.js} +2 -2
  86. package/build/client/assets/{tooltip-Bp9KHnLy.js.map → tooltip-DT9kZxPw.js.map} +1 -1
  87. package/build/server/index.js +161 -54
  88. package/build/server/index.js.map +1 -1
  89. package/dist/server/index.js +2 -0
  90. package/package.json +3 -3
  91. package/build/client/assets/_exerciseNumber-CqkGzsgV.js +0 -2
  92. package/build/client/assets/_exerciseNumber_.finished-CdNhLhKg.js +0 -2
  93. package/build/client/assets/_exerciseNumber_.finished-CdNhLhKg.js.map +0 -1
  94. package/build/client/assets/_layout-BMa5nZcJ.js +0 -2
  95. package/build/client/assets/_layout-BMa5nZcJ.js.map +0 -1
  96. package/build/client/assets/_layout-Muw3ERYT.js +0 -6
  97. package/build/client/assets/_layout-Muw3ERYT.js.map +0 -1
  98. package/build/client/assets/app-BOqXK9hi.js +0 -2
  99. package/build/client/assets/diff-D0e_PrB7.js +0 -2
  100. package/build/client/assets/diff-DtvfyjPI.js +0 -2
  101. package/build/client/assets/diff-DtvfyjPI.js.map +0 -1
  102. package/build/client/assets/discord-DILzAZN8.js +0 -2
  103. package/build/client/assets/discord-DILzAZN8.js.map +0 -1
  104. package/build/client/assets/finished-DUKfL220.js +0 -2
  105. package/build/client/assets/finished-DUKfL220.js.map +0 -1
  106. package/build/client/assets/index-DbCT6N5p.js +0 -2
  107. package/build/client/assets/index-DbCT6N5p.js.map +0 -1
  108. package/build/client/assets/index-oED4uZLa.js +0 -2
  109. package/build/client/assets/manifest-3096dc61.js +0 -1
  110. package/build/client/assets/onboarding-Cu6eD7KS.js +0 -2
  111. package/build/client/assets/tailwind-CRGTilRc.css +0 -1
  112. package/build/client/assets/test-CDWRwwO-.js +0 -2
  113. package/build/client/assets/tests-LWW8wCYZ.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tests-CDgBzBBo.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/__shared/playground-window.tsx","../../../../../node_modules/entities/lib/decode_codepoint.js","../../../../../node_modules/entities/lib/decode.js","../../../../../node_modules/entities/lib/encode.js","../../../../../node_modules/entities/lib/index.js","../../../../../node_modules/ansi-to-html/lib/ansi_to_html.js","../../../app/utils/ansi-text.ts","../../../app/components/in-browser-test-runner.tsx","../../../app/routes/test.tsx","../../../app/routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/__shared/tests.tsx"],"sourcesContent":["import { Icon } from '#app/components/icons'\nimport { SimpleTooltip } from '#app/components/ui/tooltip.js'\nimport { PlaygroundChooser, SetPlayground } from '#app/routes/set-playground'\n\nexport function PlaygroundWindow({\n\tplaygroundAppName,\n\tproblemAppName,\n\tisUpToDate,\n\tallApps,\n\tchildren,\n}: {\n\tplaygroundAppName?: string\n\tproblemAppName?: string\n\tisUpToDate: boolean\n\tallApps: Array<{ name: string; displayName: string }>\n\tchildren: React.ReactNode\n}) {\n\tconst isCorrectApp = playgroundAppName === problemAppName\n\tconst playgroundLinkedUI =\n\t\tisCorrectApp && isUpToDate ? (\n\t\t\t<Icon size=\"xl\" name=\"Linked\" />\n\t\t) : (\n\t\t\t<Icon\n\t\t\t\tsize=\"xl\"\n\t\t\t\tname=\"Unlinked\"\n\t\t\t\tclassName=\"text-foreground-destructive animate-pulse\"\n\t\t\t/>\n\t\t)\n\tlet setPlaygroundTooltipText = 'Click to reset Playground.'\n\tif (!isUpToDate) {\n\t\tsetPlaygroundTooltipText =\n\t\t\t'Playground is out of date. Click to reset Playground.'\n\t}\n\tif (!isCorrectApp) {\n\t\tsetPlaygroundTooltipText =\n\t\t\t'Playground is not set to the right app. Click to set Playground.'\n\t}\n\treturn (\n\t\t<div className=\"flex h-full w-full flex-col justify-between\">\n\t\t\t<div className=\"flex h-14 flex-shrink-0 items-center justify-start gap-2 border-b px-3\">\n\t\t\t\t<div className=\"display-alt-up\">\n\t\t\t\t\t{problemAppName ? (\n\t\t\t\t\t\t<SetPlayground\n\t\t\t\t\t\t\tappName={problemAppName}\n\t\t\t\t\t\t\ttooltipText={setPlaygroundTooltipText}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{playgroundLinkedUI}\n\t\t\t\t\t\t</SetPlayground>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<SimpleTooltip content=\"No problem app available for this step\">\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<Icon name=\"Question\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</SimpleTooltip>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t\t<div className=\"display-alt-down\">\n\t\t\t\t\t{playgroundAppName ? (\n\t\t\t\t\t\t<SetPlayground\n\t\t\t\t\t\t\tappName={playgroundAppName}\n\t\t\t\t\t\t\treset\n\t\t\t\t\t\t\ttooltipText=\"Reset Playground\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className=\"flex h-7 w-7 items-center justify-center\">\n\t\t\t\t\t\t\t\t<Icon name=\"Refresh\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</SetPlayground>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div className=\"h-7 w-7\" />\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t\t<PlaygroundChooser\n\t\t\t\t\tallApps={allApps}\n\t\t\t\t\tplaygroundAppName={playgroundAppName}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div className=\"flex h-full flex-1 flex-grow items-center justify-center\">\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar decode_json_1 = __importDefault(require(\"./maps/decode.json\"));\n// Adapted from https://github.com/mathiasbynens/he/blob/master/src/he.js#L94-L119\nvar fromCodePoint = \n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\nString.fromCodePoint ||\n function (codePoint) {\n var output = \"\";\n if (codePoint > 0xffff) {\n codePoint -= 0x10000;\n output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800);\n codePoint = 0xdc00 | (codePoint & 0x3ff);\n }\n output += String.fromCharCode(codePoint);\n return output;\n };\nfunction decodeCodePoint(codePoint) {\n if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {\n return \"\\uFFFD\";\n }\n if (codePoint in decode_json_1.default) {\n codePoint = decode_json_1.default[codePoint];\n }\n return fromCodePoint(codePoint);\n}\nexports.default = decodeCodePoint;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.decodeHTML = exports.decodeHTMLStrict = exports.decodeXML = void 0;\nvar entities_json_1 = __importDefault(require(\"./maps/entities.json\"));\nvar legacy_json_1 = __importDefault(require(\"./maps/legacy.json\"));\nvar xml_json_1 = __importDefault(require(\"./maps/xml.json\"));\nvar decode_codepoint_1 = __importDefault(require(\"./decode_codepoint\"));\nvar strictEntityRe = /&(?:[a-zA-Z0-9]+|#[xX][\\da-fA-F]+|#\\d+);/g;\nexports.decodeXML = getStrictDecoder(xml_json_1.default);\nexports.decodeHTMLStrict = getStrictDecoder(entities_json_1.default);\nfunction getStrictDecoder(map) {\n var replace = getReplacer(map);\n return function (str) { return String(str).replace(strictEntityRe, replace); };\n}\nvar sorter = function (a, b) { return (a < b ? 1 : -1); };\nexports.decodeHTML = (function () {\n var legacy = Object.keys(legacy_json_1.default).sort(sorter);\n var keys = Object.keys(entities_json_1.default).sort(sorter);\n for (var i = 0, j = 0; i < keys.length; i++) {\n if (legacy[j] === keys[i]) {\n keys[i] += \";?\";\n j++;\n }\n else {\n keys[i] += \";\";\n }\n }\n var re = new RegExp(\"&(?:\" + keys.join(\"|\") + \"|#[xX][\\\\da-fA-F]+;?|#\\\\d+;?)\", \"g\");\n var replace = getReplacer(entities_json_1.default);\n function replacer(str) {\n if (str.substr(-1) !== \";\")\n str += \";\";\n return replace(str);\n }\n // TODO consider creating a merged map\n return function (str) { return String(str).replace(re, replacer); };\n})();\nfunction getReplacer(map) {\n return function replace(str) {\n if (str.charAt(1) === \"#\") {\n var secondChar = str.charAt(2);\n if (secondChar === \"X\" || secondChar === \"x\") {\n return decode_codepoint_1.default(parseInt(str.substr(3), 16));\n }\n return decode_codepoint_1.default(parseInt(str.substr(2), 10));\n }\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n return map[str.slice(1, -1)] || str;\n };\n}\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.escapeUTF8 = exports.escape = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.encodeXML = void 0;\nvar xml_json_1 = __importDefault(require(\"./maps/xml.json\"));\nvar inverseXML = getInverseObj(xml_json_1.default);\nvar xmlReplacer = getInverseReplacer(inverseXML);\n/**\n * Encodes all non-ASCII characters, as well as characters not valid in XML\n * documents using XML entities.\n *\n * If a character has no equivalent entity, a\n * numeric hexadecimal reference (eg. `&#xfc;`) will be used.\n */\nexports.encodeXML = getASCIIEncoder(inverseXML);\nvar entities_json_1 = __importDefault(require(\"./maps/entities.json\"));\nvar inverseHTML = getInverseObj(entities_json_1.default);\nvar htmlReplacer = getInverseReplacer(inverseHTML);\n/**\n * Encodes all entities and non-ASCII characters in the input.\n *\n * This includes characters that are valid ASCII characters in HTML documents.\n * For example `#` will be encoded as `&num;`. To get a more compact output,\n * consider using the `encodeNonAsciiHTML` function.\n *\n * If a character has no equivalent entity, a\n * numeric hexadecimal reference (eg. `&#xfc;`) will be used.\n */\nexports.encodeHTML = getInverse(inverseHTML, htmlReplacer);\n/**\n * Encodes all non-ASCII characters, as well as characters not valid in HTML\n * documents using HTML entities.\n *\n * If a character has no equivalent entity, a\n * numeric hexadecimal reference (eg. `&#xfc;`) will be used.\n */\nexports.encodeNonAsciiHTML = getASCIIEncoder(inverseHTML);\nfunction getInverseObj(obj) {\n return Object.keys(obj)\n .sort()\n .reduce(function (inverse, name) {\n inverse[obj[name]] = \"&\" + name + \";\";\n return inverse;\n }, {});\n}\nfunction getInverseReplacer(inverse) {\n var single = [];\n var multiple = [];\n for (var _i = 0, _a = Object.keys(inverse); _i < _a.length; _i++) {\n var k = _a[_i];\n if (k.length === 1) {\n // Add value to single array\n single.push(\"\\\\\" + k);\n }\n else {\n // Add value to multiple array\n multiple.push(k);\n }\n }\n // Add ranges to single characters.\n single.sort();\n for (var start = 0; start < single.length - 1; start++) {\n // Find the end of a run of characters\n var end = start;\n while (end < single.length - 1 &&\n single[end].charCodeAt(1) + 1 === single[end + 1].charCodeAt(1)) {\n end += 1;\n }\n var count = 1 + end - start;\n // We want to replace at least three characters\n if (count < 3)\n continue;\n single.splice(start, count, single[start] + \"-\" + single[end]);\n }\n multiple.unshift(\"[\" + single.join(\"\") + \"]\");\n return new RegExp(multiple.join(\"|\"), \"g\");\n}\n// /[^\\0-\\x7F]/gu\nvar reNonASCII = /(?:[\\x80-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/g;\nvar getCodePoint = \n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\nString.prototype.codePointAt != null\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n function (str) { return str.codePointAt(0); }\n : // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n function (c) {\n return (c.charCodeAt(0) - 0xd800) * 0x400 +\n c.charCodeAt(1) -\n 0xdc00 +\n 0x10000;\n };\nfunction singleCharReplacer(c) {\n return \"&#x\" + (c.length > 1 ? getCodePoint(c) : c.charCodeAt(0))\n .toString(16)\n .toUpperCase() + \";\";\n}\nfunction getInverse(inverse, re) {\n return function (data) {\n return data\n .replace(re, function (name) { return inverse[name]; })\n .replace(reNonASCII, singleCharReplacer);\n };\n}\nvar reEscapeChars = new RegExp(xmlReplacer.source + \"|\" + reNonASCII.source, \"g\");\n/**\n * Encodes all non-ASCII characters, as well as characters not valid in XML\n * documents using numeric hexadecimal reference (eg. `&#xfc;`).\n *\n * Have a look at `escapeUTF8` if you want a more concise output at the expense\n * of reduced transportability.\n *\n * @param data String to escape.\n */\nfunction escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}\nexports.escape = escape;\n/**\n * Encodes all characters not valid in XML documents using numeric hexadecimal\n * reference (eg. `&#xfc;`).\n *\n * Note that the output will be character-set dependent.\n *\n * @param data String to escape.\n */\nfunction escapeUTF8(data) {\n return data.replace(xmlReplacer, singleCharReplacer);\n}\nexports.escapeUTF8 = escapeUTF8;\nfunction getASCIIEncoder(obj) {\n return function (data) {\n return data.replace(reEscapeChars, function (c) { return obj[c] || singleCharReplacer(c); });\n };\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.decodeXMLStrict = exports.decodeHTML5Strict = exports.decodeHTML4Strict = exports.decodeHTML5 = exports.decodeHTML4 = exports.decodeHTMLStrict = exports.decodeHTML = exports.decodeXML = exports.encodeHTML5 = exports.encodeHTML4 = exports.escapeUTF8 = exports.escape = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.encodeXML = exports.encode = exports.decodeStrict = exports.decode = void 0;\nvar decode_1 = require(\"./decode\");\nvar encode_1 = require(\"./encode\");\n/**\n * Decodes a string with entities.\n *\n * @param data String to decode.\n * @param level Optional level to decode at. 0 = XML, 1 = HTML. Default is 0.\n * @deprecated Use `decodeXML` or `decodeHTML` directly.\n */\nfunction decode(data, level) {\n return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTML)(data);\n}\nexports.decode = decode;\n/**\n * Decodes a string with entities. Does not allow missing trailing semicolons for entities.\n *\n * @param data String to decode.\n * @param level Optional level to decode at. 0 = XML, 1 = HTML. Default is 0.\n * @deprecated Use `decodeHTMLStrict` or `decodeXML` directly.\n */\nfunction decodeStrict(data, level) {\n return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTMLStrict)(data);\n}\nexports.decodeStrict = decodeStrict;\n/**\n * Encodes a string with entities.\n *\n * @param data String to encode.\n * @param level Optional level to encode at. 0 = XML, 1 = HTML. Default is 0.\n * @deprecated Use `encodeHTML`, `encodeXML` or `encodeNonAsciiHTML` directly.\n */\nfunction encode(data, level) {\n return (!level || level <= 0 ? encode_1.encodeXML : encode_1.encodeHTML)(data);\n}\nexports.encode = encode;\nvar encode_2 = require(\"./encode\");\nObject.defineProperty(exports, \"encodeXML\", { enumerable: true, get: function () { return encode_2.encodeXML; } });\nObject.defineProperty(exports, \"encodeHTML\", { enumerable: true, get: function () { return encode_2.encodeHTML; } });\nObject.defineProperty(exports, \"encodeNonAsciiHTML\", { enumerable: true, get: function () { return encode_2.encodeNonAsciiHTML; } });\nObject.defineProperty(exports, \"escape\", { enumerable: true, get: function () { return encode_2.escape; } });\nObject.defineProperty(exports, \"escapeUTF8\", { enumerable: true, get: function () { return encode_2.escapeUTF8; } });\n// Legacy aliases (deprecated)\nObject.defineProperty(exports, \"encodeHTML4\", { enumerable: true, get: function () { return encode_2.encodeHTML; } });\nObject.defineProperty(exports, \"encodeHTML5\", { enumerable: true, get: function () { return encode_2.encodeHTML; } });\nvar decode_2 = require(\"./decode\");\nObject.defineProperty(exports, \"decodeXML\", { enumerable: true, get: function () { return decode_2.decodeXML; } });\nObject.defineProperty(exports, \"decodeHTML\", { enumerable: true, get: function () { return decode_2.decodeHTML; } });\nObject.defineProperty(exports, \"decodeHTMLStrict\", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });\n// Legacy aliases (deprecated)\nObject.defineProperty(exports, \"decodeHTML4\", { enumerable: true, get: function () { return decode_2.decodeHTML; } });\nObject.defineProperty(exports, \"decodeHTML5\", { enumerable: true, get: function () { return decode_2.decodeHTML; } });\nObject.defineProperty(exports, \"decodeHTML4Strict\", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });\nObject.defineProperty(exports, \"decodeHTML5Strict\", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });\nObject.defineProperty(exports, \"decodeXMLStrict\", { enumerable: true, get: function () { return decode_2.decodeXML; } });\n","'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nvar entities = require('entities');\n\nvar defaults = {\n fg: '#FFF',\n bg: '#000',\n newline: false,\n escapeXML: false,\n stream: false,\n colors: getDefaultColors()\n};\n\nfunction getDefaultColors() {\n var colors = {\n 0: '#000',\n 1: '#A00',\n 2: '#0A0',\n 3: '#A50',\n 4: '#00A',\n 5: '#A0A',\n 6: '#0AA',\n 7: '#AAA',\n 8: '#555',\n 9: '#F55',\n 10: '#5F5',\n 11: '#FF5',\n 12: '#55F',\n 13: '#F5F',\n 14: '#5FF',\n 15: '#FFF'\n };\n range(0, 5).forEach(function (red) {\n range(0, 5).forEach(function (green) {\n range(0, 5).forEach(function (blue) {\n return setStyleColor(red, green, blue, colors);\n });\n });\n });\n range(0, 23).forEach(function (gray) {\n var c = gray + 232;\n var l = toHexString(gray * 10 + 8);\n colors[c] = '#' + l + l + l;\n });\n return colors;\n}\n/**\n * @param {number} red\n * @param {number} green\n * @param {number} blue\n * @param {object} colors\n */\n\n\nfunction setStyleColor(red, green, blue, colors) {\n var c = 16 + red * 36 + green * 6 + blue;\n var r = red > 0 ? red * 40 + 55 : 0;\n var g = green > 0 ? green * 40 + 55 : 0;\n var b = blue > 0 ? blue * 40 + 55 : 0;\n colors[c] = toColorHexString([r, g, b]);\n}\n/**\n * Converts from a number like 15 to a hex string like 'F'\n * @param {number} num\n * @returns {string}\n */\n\n\nfunction toHexString(num) {\n var str = num.toString(16);\n\n while (str.length < 2) {\n str = '0' + str;\n }\n\n return str;\n}\n/**\n * Converts from an array of numbers like [15, 15, 15] to a hex string like 'FFF'\n * @param {[red, green, blue]} ref\n * @returns {string}\n */\n\n\nfunction toColorHexString(ref) {\n var results = [];\n\n var _iterator = _createForOfIteratorHelper(ref),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var r = _step.value;\n results.push(toHexString(r));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return '#' + results.join('');\n}\n/**\n * @param {Array} stack\n * @param {string} token\n * @param {*} data\n * @param {object} options\n */\n\n\nfunction generateOutput(stack, token, data, options) {\n var result;\n\n if (token === 'text') {\n result = pushText(data, options);\n } else if (token === 'display') {\n result = handleDisplay(stack, data, options);\n } else if (token === 'xterm256Foreground') {\n result = pushForegroundColor(stack, options.colors[data]);\n } else if (token === 'xterm256Background') {\n result = pushBackgroundColor(stack, options.colors[data]);\n } else if (token === 'rgb') {\n result = handleRgb(stack, data);\n }\n\n return result;\n}\n/**\n * @param {Array} stack\n * @param {string} data\n * @returns {*}\n */\n\n\nfunction handleRgb(stack, data) {\n data = data.substring(2).slice(0, -1);\n var operation = +data.substr(0, 2);\n var color = data.substring(5).split(';');\n var rgb = color.map(function (value) {\n return ('0' + Number(value).toString(16)).substr(-2);\n }).join('');\n return pushStyle(stack, (operation === 38 ? 'color:#' : 'background-color:#') + rgb);\n}\n/**\n * @param {Array} stack\n * @param {number} code\n * @param {object} options\n * @returns {*}\n */\n\n\nfunction handleDisplay(stack, code, options) {\n code = parseInt(code, 10);\n var codeMap = {\n '-1': function _() {\n return '<br/>';\n },\n 0: function _() {\n return stack.length && resetStyles(stack);\n },\n 1: function _() {\n return pushTag(stack, 'b');\n },\n 3: function _() {\n return pushTag(stack, 'i');\n },\n 4: function _() {\n return pushTag(stack, 'u');\n },\n 8: function _() {\n return pushStyle(stack, 'display:none');\n },\n 9: function _() {\n return pushTag(stack, 'strike');\n },\n 22: function _() {\n return pushStyle(stack, 'font-weight:normal;text-decoration:none;font-style:normal');\n },\n 23: function _() {\n return closeTag(stack, 'i');\n },\n 24: function _() {\n return closeTag(stack, 'u');\n },\n 39: function _() {\n return pushForegroundColor(stack, options.fg);\n },\n 49: function _() {\n return pushBackgroundColor(stack, options.bg);\n },\n 53: function _() {\n return pushStyle(stack, 'text-decoration:overline');\n }\n };\n var result;\n\n if (codeMap[code]) {\n result = codeMap[code]();\n } else if (4 < code && code < 7) {\n result = pushTag(stack, 'blink');\n } else if (29 < code && code < 38) {\n result = pushForegroundColor(stack, options.colors[code - 30]);\n } else if (39 < code && code < 48) {\n result = pushBackgroundColor(stack, options.colors[code - 40]);\n } else if (89 < code && code < 98) {\n result = pushForegroundColor(stack, options.colors[8 + (code - 90)]);\n } else if (99 < code && code < 108) {\n result = pushBackgroundColor(stack, options.colors[8 + (code - 100)]);\n }\n\n return result;\n}\n/**\n * Clear all the styles\n * @returns {string}\n */\n\n\nfunction resetStyles(stack) {\n var stackClone = stack.slice(0);\n stack.length = 0;\n return stackClone.reverse().map(function (tag) {\n return '</' + tag + '>';\n }).join('');\n}\n/**\n * Creates an array of numbers ranging from low to high\n * @param {number} low\n * @param {number} high\n * @returns {Array}\n * @example range(3, 7); // creates [3, 4, 5, 6, 7]\n */\n\n\nfunction range(low, high) {\n var results = [];\n\n for (var j = low; j <= high; j++) {\n results.push(j);\n }\n\n return results;\n}\n/**\n * Returns a new function that is true if value is NOT the same category\n * @param {string} category\n * @returns {function}\n */\n\n\nfunction notCategory(category) {\n return function (e) {\n return (category === null || e.category !== category) && category !== 'all';\n };\n}\n/**\n * Converts a code into an ansi token type\n * @param {number} code\n * @returns {string}\n */\n\n\nfunction categoryForCode(code) {\n code = parseInt(code, 10);\n var result = null;\n\n if (code === 0) {\n result = 'all';\n } else if (code === 1) {\n result = 'bold';\n } else if (2 < code && code < 5) {\n result = 'underline';\n } else if (4 < code && code < 7) {\n result = 'blink';\n } else if (code === 8) {\n result = 'hide';\n } else if (code === 9) {\n result = 'strike';\n } else if (29 < code && code < 38 || code === 39 || 89 < code && code < 98) {\n result = 'foreground-color';\n } else if (39 < code && code < 48 || code === 49 || 99 < code && code < 108) {\n result = 'background-color';\n }\n\n return result;\n}\n/**\n * @param {string} text\n * @param {object} options\n * @returns {string}\n */\n\n\nfunction pushText(text, options) {\n if (options.escapeXML) {\n return entities.encodeXML(text);\n }\n\n return text;\n}\n/**\n * @param {Array} stack\n * @param {string} tag\n * @param {string} [style='']\n * @returns {string}\n */\n\n\nfunction pushTag(stack, tag, style) {\n if (!style) {\n style = '';\n }\n\n stack.push(tag);\n return \"<\".concat(tag).concat(style ? \" style=\\\"\".concat(style, \"\\\"\") : '', \">\");\n}\n/**\n * @param {Array} stack\n * @param {string} style\n * @returns {string}\n */\n\n\nfunction pushStyle(stack, style) {\n return pushTag(stack, 'span', style);\n}\n\nfunction pushForegroundColor(stack, color) {\n return pushTag(stack, 'span', 'color:' + color);\n}\n\nfunction pushBackgroundColor(stack, color) {\n return pushTag(stack, 'span', 'background-color:' + color);\n}\n/**\n * @param {Array} stack\n * @param {string} style\n * @returns {string}\n */\n\n\nfunction closeTag(stack, style) {\n var last;\n\n if (stack.slice(-1)[0] === style) {\n last = stack.pop();\n }\n\n if (last) {\n return '</' + style + '>';\n }\n}\n/**\n * @param {string} text\n * @param {object} options\n * @param {function} callback\n * @returns {Array}\n */\n\n\nfunction tokenize(text, options, callback) {\n var ansiMatch = false;\n var ansiHandler = 3;\n\n function remove() {\n return '';\n }\n\n function removeXterm256Foreground(m, g1) {\n callback('xterm256Foreground', g1);\n return '';\n }\n\n function removeXterm256Background(m, g1) {\n callback('xterm256Background', g1);\n return '';\n }\n\n function newline(m) {\n if (options.newline) {\n callback('display', -1);\n } else {\n callback('text', m);\n }\n\n return '';\n }\n\n function ansiMess(m, g1) {\n ansiMatch = true;\n\n if (g1.trim().length === 0) {\n g1 = '0';\n }\n\n g1 = g1.trimRight(';').split(';');\n\n var _iterator2 = _createForOfIteratorHelper(g1),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var g = _step2.value;\n callback('display', g);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n return '';\n }\n\n function realText(m) {\n callback('text', m);\n return '';\n }\n\n function rgb(m) {\n callback('rgb', m);\n return '';\n }\n /* eslint no-control-regex:0 */\n\n\n var tokens = [{\n pattern: /^\\x08+/,\n sub: remove\n }, {\n pattern: /^\\x1b\\[[012]?K/,\n sub: remove\n }, {\n pattern: /^\\x1b\\[\\(B/,\n sub: remove\n }, {\n pattern: /^\\x1b\\[[34]8;2;\\d+;\\d+;\\d+m/,\n sub: rgb\n }, {\n pattern: /^\\x1b\\[38;5;(\\d+)m/,\n sub: removeXterm256Foreground\n }, {\n pattern: /^\\x1b\\[48;5;(\\d+)m/,\n sub: removeXterm256Background\n }, {\n pattern: /^\\n/,\n sub: newline\n }, {\n pattern: /^\\r+\\n/,\n sub: newline\n }, {\n pattern: /^\\r/,\n sub: newline\n }, {\n pattern: /^\\x1b\\[((?:\\d{1,3};?)+|)m/,\n sub: ansiMess\n }, {\n // CSI n J\n // ED - Erase in Display Clears part of the screen.\n // If n is 0 (or missing), clear from cursor to end of screen.\n // If n is 1, clear from cursor to beginning of the screen.\n // If n is 2, clear entire screen (and moves cursor to upper left on DOS ANSI.SYS).\n // If n is 3, clear entire screen and delete all lines saved in the scrollback buffer\n // (this feature was added for xterm and is supported by other terminal applications).\n pattern: /^\\x1b\\[\\d?J/,\n sub: remove\n }, {\n // CSI n ; m f\n // HVP - Horizontal Vertical Position Same as CUP\n pattern: /^\\x1b\\[\\d{0,3};\\d{0,3}f/,\n sub: remove\n }, {\n // catch-all for CSI sequences?\n pattern: /^\\x1b\\[?[\\d;]{0,3}/,\n sub: remove\n }, {\n /**\n * extracts real text - not containing:\n * - `\\x1b' - ESC - escape (Ascii 27)\n * - '\\x08' - BS - backspace (Ascii 8)\n * - `\\n` - Newline - linefeed (LF) (ascii 10)\n * - `\\r` - Windows Carriage Return (CR)\n */\n pattern: /^(([^\\x1b\\x08\\r\\n])+)/,\n sub: realText\n }];\n\n function process(handler, i) {\n if (i > ansiHandler && ansiMatch) {\n return;\n }\n\n ansiMatch = false;\n text = text.replace(handler.pattern, handler.sub);\n }\n\n var results1 = [];\n var _text = text,\n length = _text.length;\n\n outer: while (length > 0) {\n for (var i = 0, o = 0, len = tokens.length; o < len; i = ++o) {\n var handler = tokens[i];\n process(handler, i);\n\n if (text.length !== length) {\n // We matched a token and removed it from the text. We need to\n // start matching *all* tokens against the new text.\n length = text.length;\n continue outer;\n }\n }\n\n if (text.length === length) {\n break;\n }\n\n results1.push(0);\n length = text.length;\n }\n\n return results1;\n}\n/**\n * If streaming, then the stack is \"sticky\"\n *\n * @param {Array} stickyStack\n * @param {string} token\n * @param {*} data\n * @returns {Array}\n */\n\n\nfunction updateStickyStack(stickyStack, token, data) {\n if (token !== 'text') {\n stickyStack = stickyStack.filter(notCategory(categoryForCode(data)));\n stickyStack.push({\n token: token,\n data: data,\n category: categoryForCode(data)\n });\n }\n\n return stickyStack;\n}\n\nvar Filter = /*#__PURE__*/function () {\n /**\n * @param {object} options\n * @param {string=} options.fg The default foreground color used when reset color codes are encountered.\n * @param {string=} options.bg The default background color used when reset color codes are encountered.\n * @param {boolean=} options.newline Convert newline characters to `<br/>`.\n * @param {boolean=} options.escapeXML Generate HTML/XML entities.\n * @param {boolean=} options.stream Save style state across invocations of `toHtml()`.\n * @param {(string[] | {[code: number]: string})=} options.colors Can override specific colors or the entire ANSI palette.\n */\n function Filter(options) {\n _classCallCheck(this, Filter);\n\n options = options || {};\n\n if (options.colors) {\n options.colors = Object.assign({}, defaults.colors, options.colors);\n }\n\n this.options = Object.assign({}, defaults, options);\n this.stack = [];\n this.stickyStack = [];\n }\n /**\n * @param {string | string[]} input\n * @returns {string}\n */\n\n\n _createClass(Filter, [{\n key: \"toHtml\",\n value: function toHtml(input) {\n var _this = this;\n\n input = typeof input === 'string' ? [input] : input;\n var stack = this.stack,\n options = this.options;\n var buf = [];\n this.stickyStack.forEach(function (element) {\n var output = generateOutput(stack, element.token, element.data, options);\n\n if (output) {\n buf.push(output);\n }\n });\n tokenize(input.join(''), options, function (token, data) {\n var output = generateOutput(stack, token, data, options);\n\n if (output) {\n buf.push(output);\n }\n\n if (options.stream) {\n _this.stickyStack = updateStickyStack(_this.stickyStack, token, data);\n }\n });\n\n if (stack.length) {\n buf.push(resetStyles(stack));\n }\n\n return buf.join('');\n }\n }]);\n\n return Filter;\n}();\n\nmodule.exports = Filter;\n//# sourceMappingURL=ansi_to_html.js.map","import AnsiToHTML from 'ansi-to-html'\nimport { useMemo } from 'react'\nimport { useTheme } from '#app/routes/theme/index.js'\n\nexport function useAnsiToHtml() {\n\tconst theme = useTheme()\n\tconst ansi = useMemo(\n\t\t() =>\n\t\t\tnew AnsiToHTML(\n\t\t\t\ttheme === 'dark'\n\t\t\t\t\t? { fg: '#d6deeb', bg: '#121318', escapeXML: true }\n\t\t\t\t\t: { fg: '#000000', bg: '#f3f3f3', escapeXML: true },\n\t\t\t),\n\t\t[theme],\n\t)\n\treturn ansi\n}\n\n// remove this when this is fixed: https://github.com/rburns/ansi-to-html/issues/112\nexport function stripCursorMovements(data: string) {\n\treturn data.replace(/\\u001b\\[\\d+A/g, '').replace(/\\u001b\\[\\d+K/g, '')\n}\n","import * as Accordion from '@radix-ui/react-accordion'\nimport { useEffect, useRef, useState } from 'react'\nimport { z } from 'zod'\nimport AccordionComponent from '#app/components/accordion.tsx'\nimport { stripCursorMovements, useAnsiToHtml } from '#app/utils/ansi-text.js'\nimport { AnimatedBars, Icon } from './icons.tsx'\n\nconst testRunnerStatusDataSchema = z.intersection(\n\tz.object({\n\t\ttype: z.literal('epicshop:test-status-update'),\n\t\ttimestamp: z.number(),\n\t}),\n\tz.union([\n\t\tz.object({ status: z.literal('pending') }),\n\t\tz.object({ status: z.literal('pass') }),\n\t\tz.object({ status: z.literal('fail'), error: z.string() }),\n\t]),\n)\n\nconst testRunnerTestStepDataSchema = z.object({\n\ttype: z.literal('epicshop:test-step-update'),\n\tstatus: z.literal('pass'),\n\ttitle: z.string(),\n\ttimestamp: z.number(),\n})\n\nconst testRunnerDataSchema = z.union([\n\ttestRunnerTestStepDataSchema,\n\ttestRunnerStatusDataSchema,\n])\n\ntype TestRunnerStatusData = z.infer<typeof testRunnerStatusDataSchema>\ntype TestRunnerTestStepData = z.infer<typeof testRunnerTestStepDataSchema>\n\nexport function InBrowserTestRunner({\n\tpathname,\n\ttestFile,\n}: {\n\tpathname: string\n\ttestFile: string\n}) {\n\tconst ansi = useAnsiToHtml()\n\tconst iframeRef = useRef<HTMLIFrameElement>(null)\n\tconst [message, setMessage] = useState<TestRunnerStatusData | null>(null)\n\tconst [testSteps, setTestSteps] = useState<Array<TestRunnerTestStepData>>([])\n\n\tuseEffect(() => {\n\t\tfunction handleMessage(messageEvent: MessageEvent) {\n\t\t\tif (messageEvent.source !== iframeRef.current?.contentWindow) return\n\t\t\tif ('request' in messageEvent.data) return\n\n\t\t\tconst result = testRunnerDataSchema.safeParse(messageEvent.data, {\n\t\t\t\tpath: ['messageEvent', 'data'],\n\t\t\t})\n\t\t\tif (!result.success) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t`Invalid message from test iframe`,\n\t\t\t\t\tmessageEvent.data,\n\t\t\t\t\tresult.error,\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst { data } = result\n\t\t\tif (data.type === 'epicshop:test-status-update') {\n\t\t\t\tif (data.status === 'pending') {\n\t\t\t\t\tsetTestSteps([])\n\t\t\t\t}\n\t\t\t\tsetMessage(data)\n\t\t\t}\n\t\t\tif (data.type === 'epicshop:test-step-update') {\n\t\t\t\tsetTestSteps((steps) => [...steps, data])\n\t\t\t}\n\t\t}\n\t\twindow.addEventListener('message', handleMessage)\n\t\treturn () => {\n\t\t\twindow.removeEventListener('message', handleMessage)\n\t\t}\n\t}, [])\n\n\tconst statusEmoji = {\n\t\tpending: <AnimatedBars size={14} aria-label=\"Pending\" />,\n\t\tpass: (\n\t\t\t<Icon\n\t\t\t\tname=\"CheckSmall\"\n\t\t\t\taria-label=\"Passed\"\n\t\t\t\tclassName=\"text-emerald-700\"\n\t\t\t/>\n\t\t),\n\t\tfail: (\n\t\t\t<Icon\n\t\t\t\tname=\"Remove\"\n\t\t\t\taria-label=\"Failed\"\n\t\t\t\tclassName=\"text-foreground-destructive\"\n\t\t\t/>\n\t\t),\n\t\tunknown: (\n\t\t\t<Icon name=\"Question\" aria-label=\"Unknown\" className=\"animate-pulse\" />\n\t\t),\n\t}[message?.status ?? 'unknown']\n\n\tconst sortedTestSteps = testSteps.sort((a, b) => a.timestamp - b.timestamp)\n\tconst testStepStatusEmojis = {\n\t\tpass: <Icon name=\"CheckSmall\" aria-label=\"Passed\" />,\n\t\tfail: <Icon name=\"Remove\" aria-label=\"Failed\" />,\n\t\tunknown: (\n\t\t\t<Icon name=\"Question\" aria-label=\"Unknown\" className=\"animate-pulse\" />\n\t\t),\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Accordion.Root className=\"w-full\" type=\"multiple\">\n\t\t\t\t<AccordionComponent\n\t\t\t\t\ticon={statusEmoji}\n\t\t\t\t\ttitle={testFile}\n\t\t\t\t\tforceMount={true}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"not-prose\">\n\t\t\t\t\t\t<div className=\"flex flex-col gap-2 p-5 pt-3\">\n\t\t\t\t\t\t\t<ul className=\"flex flex-col gap-2\">\n\t\t\t\t\t\t\t\t{sortedTestSteps.map((testStep, index) => (\n\t\t\t\t\t\t\t\t\t// sometimes the steps come in so fast that the timestamp is the same\n\t\t\t\t\t\t\t\t\t<li key={testStep.timestamp + testStep.title}>\n\t\t\t\t\t\t\t\t\t\t<div className=\"flex items-baseline gap-2 text-emerald-700\">\n\t\t\t\t\t\t\t\t\t\t\t<span>{index + 1}.</span>\n\t\t\t\t\t\t\t\t\t\t\t<span>{testStepStatusEmojis[testStep.status]}</span>\n\t\t\t\t\t\t\t\t\t\t\t<pre className=\"max-h-48 overflow-y-auto p-4 scrollbar-thin scrollbar-thumb-scrollbar\">\n\t\t\t\t\t\t\t\t\t\t\t\t{testStep.title}\n\t\t\t\t\t\t\t\t\t\t\t</pre>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t{message?.status === 'fail' ? (\n\t\t\t\t\t\t\t\t<div className=\"text-foreground-destructive flex items-baseline gap-2\">\n\t\t\t\t\t\t\t\t\t<span>{sortedTestSteps.length + 1}.</span>\n\t\t\t\t\t\t\t\t\t<span>{testStepStatusEmojis.fail}</span>\n\t\t\t\t\t\t\t\t\t<pre\n\t\t\t\t\t\t\t\t\t\tclassName=\"max-h-48 overflow-y-auto p-4 scrollbar-thin scrollbar-thumb-scrollbar\"\n\t\t\t\t\t\t\t\t\t\tdangerouslySetInnerHTML={{\n\t\t\t\t\t\t\t\t\t\t\t__html: ansi.toHtml(stripCursorMovements(message.error)),\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t<iframe\n\t\t\t\t\t\t\t\tref={iframeRef}\n\t\t\t\t\t\t\t\ttitle={testFile}\n\t\t\t\t\t\t\t\tsrc={pathname + testFile}\n\t\t\t\t\t\t\t\tclassName=\"mt-5 min-h-[420px] w-full border bg-white\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"flex border-y\">\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t\tiframeRef.current?.contentWindow?.location.reload()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tclassName=\"border-r p-3\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Icon name=\"Refresh\" aria-label=\"Rerun Tests\" />\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\thref={pathname + testFile}\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noreferrer\"\n\t\t\t\t\t\t\t\tclassName=\"border-r p-3\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Icon name=\"ExternalLink\" aria-label=\"Open in New Window\" />\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</AccordionComponent>\n\t\t\t</Accordion.Root>\n\t\t</>\n\t)\n}\n","import { getAppByName } from '@epic-web/workshop-utils/apps.server'\nimport { userHasAccessToWorkshop } from '@epic-web/workshop-utils/epic-api.server'\nimport {\n\tclearTestProcessEntry,\n\tgetTestProcessEntry,\n\tisTestRunning,\n\trunAppTests,\n} from '@epic-web/workshop-utils/process-manager.server'\nimport {\n\tunstable_data as data,\n\ttype ActionFunctionArgs,\n\ttype LoaderFunctionArgs,\n} from '@remix-run/node'\nimport { useFetcher } from '@remix-run/react'\nimport { useEffect, useReducer, useRef } from 'react'\nimport { useEventSource } from 'remix-utils/sse/react'\nimport { eventStream } from 'remix-utils/sse/server'\nimport { z } from 'zod'\nimport { AnimatedBars, Icon } from '#app/components/icons.tsx'\nimport { SimpleTooltip } from '#app/components/ui/tooltip.tsx'\nimport { stripCursorMovements, useAnsiToHtml } from '#app/utils/ansi-text.js'\nimport { ensureUndeployed } from '#app/utils/misc.tsx'\nimport { dataWithPE, usePERedirectInput } from '#app/utils/pe.js'\nimport { createToastHeaders } from '#app/utils/toast.server.js'\n\nconst testActionSchema = z.union([\n\tz.object({\n\t\tintent: z.literal('run'),\n\t\tname: z.string(),\n\t}),\n\tz.object({\n\t\tintent: z.literal('stop'),\n\t\tname: z.string(),\n\t}),\n\tz.object({\n\t\tintent: z.literal('clear'),\n\t\tname: z.string(),\n\t}),\n])\n\nconst testEventSchema = z.union([\n\tz.object({\n\t\ttype: z.literal('init'),\n\t\texitCode: z.number().nullable().optional(),\n\t\tisRunning: z.boolean(),\n\t\toutput: z.array(\n\t\t\tz.object({\n\t\t\t\ttype: z.union([z.literal('stdout'), z.literal('stderr')]),\n\t\t\t\tcontent: z.string(),\n\t\t\t\ttimestamp: z.number(),\n\t\t\t}),\n\t\t),\n\t}),\n\tz.object({\n\t\ttype: z.union([z.literal('stdout'), z.literal('stderr')]),\n\t\tdata: z.string(),\n\t\ttimestamp: z.number(),\n\t}),\n\tz.object({\n\t\ttype: z.literal('exit'),\n\t\tisRunning: z.literal(false),\n\t\tcode: z.number().nullable(),\n\t}),\n])\nconst testEventQueueSchema = z.array(testEventSchema)\n\ntype TestEvent = z.infer<typeof testEventSchema>\ntype TestEventQueue = z.infer<typeof testEventQueueSchema>\n\nexport async function loader({ request }: LoaderFunctionArgs) {\n\tensureUndeployed()\n\tconst url = new URL(request.url)\n\tconst name = url.searchParams.get('name')\n\tif (!name) {\n\t\treturn data({ error: 'Missing name' }, { status: 400 })\n\t}\n\tconst app = await getAppByName(name)\n\tif (!app) {\n\t\treturn data({ error: 'App not found' }, { status: 404 })\n\t}\n\tconst processEntry = getTestProcessEntry(app)\n\tif (!processEntry) {\n\t\treturn data({ error: 'App is not running tests' }, { status: 404 })\n\t}\n\treturn eventStream(request.signal, function setup(send) {\n\t\t// have to batch because the client may miss events if we send too many\n\t\t// too rapidly\n\t\tlet queue: TestEventQueue = []\n\t\tfunction sendEvent(event: TestEvent) {\n\t\t\tqueue.push(event)\n\t\t}\n\t\tconst interval = setInterval(() => {\n\t\t\tif (queue.length) {\n\t\t\t\tsend({ data: JSON.stringify(queue) })\n\t\t\t\tqueue = []\n\t\t\t}\n\t\t}, 10)\n\n\t\tconst isRunning = isTestRunning(app)\n\n\t\tsendEvent({\n\t\t\ttype: 'init',\n\t\t\texitCode: processEntry.exitCode,\n\t\t\tisRunning,\n\t\t\toutput: processEntry.output.map((line) => ({\n\t\t\t\ttype: line.type,\n\t\t\t\tcontent: line.content,\n\t\t\t\ttimestamp: line.timestamp,\n\t\t\t})),\n\t\t})\n\n\t\tconst testProcess = processEntry.process\n\t\tif (!testProcess) {\n\t\t\treturn () => {}\n\t\t}\n\n\t\tfunction handleStdOutData(data: Buffer) {\n\t\t\tsendEvent({\n\t\t\t\ttype: 'stdout',\n\t\t\t\tdata: data.toString('utf-8'),\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t})\n\t\t}\n\t\tfunction handleStdErrData(data: Buffer) {\n\t\t\tsendEvent({\n\t\t\t\ttype: 'stderr',\n\t\t\t\tdata: data.toString('utf-8'),\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t})\n\t\t}\n\t\tfunction handleExit(code: number) {\n\t\t\ttestProcess?.stdout?.off('data', handleStdOutData)\n\t\t\ttestProcess?.stderr?.off('data', handleStdErrData)\n\t\t\ttestProcess?.off('exit', handleExit)\n\t\t\tsendEvent({ type: 'exit', isRunning: false, code })\n\t\t}\n\t\ttestProcess.stdout?.on('data', handleStdOutData)\n\t\ttestProcess.stderr?.on('data', handleStdErrData)\n\t\ttestProcess.on('exit', handleExit)\n\t\treturn function cleanup() {\n\t\t\ttestProcess.stdout?.off('data', handleStdOutData)\n\t\t\ttestProcess.stderr?.off('data', handleStdErrData)\n\t\t\ttestProcess.off('exit', handleExit)\n\t\t\tclearInterval(interval)\n\t\t}\n\t})\n}\n\nexport async function action({ request }: ActionFunctionArgs) {\n\tensureUndeployed()\n\tconst formData = await request.formData()\n\tconst userHasAccess = await userHasAccessToWorkshop({\n\t\trequest,\n\t})\n\tif (!userHasAccess) {\n\t\treturn dataWithPE(\n\t\t\tformData,\n\t\t\t{\n\t\t\t\tsuccess: false,\n\t\t\t\terror:\n\t\t\t\t\t'You do not have access to this workshop. Login or register for the workshop to be able to run the tests.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tstatus: 403,\n\t\t\t\theaders: await createToastHeaders({\n\t\t\t\t\ttitle: 'Access denied',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'You do not have access to this workshop. Login or register for the workshop to be able to run the tests.',\n\t\t\t\t}),\n\t\t\t},\n\t\t)\n\t}\n\tconst result = testActionSchema.safeParse({\n\t\tintent: formData.get('intent'),\n\t\tname: formData.get('name'),\n\t})\n\tif (!result.success) {\n\t\treturn dataWithPE(\n\t\t\tformData,\n\t\t\t{ success: false, error: result.error.flatten() },\n\t\t\t{ status: 400 },\n\t\t)\n\t}\n\tconst app = await getAppByName(result.data.name)\n\tif (!app) {\n\t\treturn dataWithPE(\n\t\t\tformData,\n\t\t\t{ success: false, error: 'App not found' },\n\t\t\t{ status: 404 },\n\t\t)\n\t}\n\tswitch (result.data.intent) {\n\t\tcase 'run': {\n\t\t\tvoid runAppTests(app)\n\t\t\treturn dataWithPE(formData, { success: true })\n\t\t}\n\t\tcase 'stop': {\n\t\t\tconst processEntry = getTestProcessEntry(app)\n\t\t\tif (processEntry) {\n\t\t\t\tprocessEntry.process?.kill()\n\t\t\t}\n\t\t\treturn dataWithPE(formData, { success: true })\n\t\t}\n\t\tcase 'clear': {\n\t\t\tclearTestProcessEntry(app)\n\t\t\treturn dataWithPE(formData, { success: true })\n\t\t}\n\t}\n}\n\nfunction simpleReducer<State>(prev: State, getNext: (prev: State) => State) {\n\treturn getNext(prev)\n}\n\nexport function TestOutput({ name }: { name: string }) {\n\ttype State = {\n\t\t/** version is used to trigger an unsubscribe and resubscribe to the event source */\n\t\tversion: number\n\t\tisRunning: boolean\n\t\texitCode: number | null | undefined\n\t\tlines: Array<{\n\t\t\ttype: 'stdout' | 'stderr'\n\t\t\tcontent: string\n\t\t\ttimestamp: number\n\t\t}>\n\t}\n\tconst [state, dispatch] = useReducer(simpleReducer<State>, {\n\t\tversion: 0,\n\t\tisRunning: false,\n\t\texitCode: undefined,\n\t\tlines: [],\n\t})\n\tconst ansi = useAnsiToHtml()\n\tconst { version, isRunning, exitCode, lines } = state\n\tconst lastMessage = useEventSource(\n\t\t`/test?${new URLSearchParams({ name })}&v=${version}`,\n\t)\n\tuseEffect(() => {\n\t\tif (!lastMessage) return\n\n\t\tconst parsed = JSON.parse(lastMessage)\n\t\tconst result = testEventQueueSchema.safeParse(parsed)\n\t\tif (!result.success) {\n\t\t\tconsole.error(result.error.flatten())\n\t\t\treturn\n\t\t}\n\t\tfor (const event of result.data) {\n\t\t\tswitch (event.type) {\n\t\t\t\tcase 'exit': {\n\t\t\t\t\tconst { isRunning, code: exitCode } = event\n\t\t\t\t\tdispatch((prev) => ({ ...prev, isRunning, exitCode }))\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'init': {\n\t\t\t\t\tconst { output, exitCode, isRunning } = event\n\t\t\t\t\tdispatch((prev) => ({ ...prev, lines: output, exitCode, isRunning }))\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'stderr':\n\t\t\t\tcase 'stdout': {\n\t\t\t\t\tconst { type, data: content, timestamp } = event\n\t\t\t\t\tdispatch((prev) => ({\n\t\t\t\t\t\t...prev,\n\t\t\t\t\t\tlines: [...prev.lines, { type, content, timestamp }].sort(\n\t\t\t\t\t\t\t(a, b) => a.timestamp - b.timestamp,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tisRunning: true,\n\t\t\t\t\t}))\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [lastMessage])\n\n\treturn (\n\t\t<div className=\"relative flex h-full w-full flex-col overflow-y-auto\">\n\t\t\t<div className=\"flex h-12 w-full flex-shrink-0 items-center justify-between border-b\">\n\t\t\t\t<div className=\"flex h-full items-center\">\n\t\t\t\t\t{!isRunning && (\n\t\t\t\t\t\t<TestRunner\n\t\t\t\t\t\t\tname={name}\n\t\t\t\t\t\t\tonRun={() => {\n\t\t\t\t\t\t\t\tdispatch((prev) => ({\n\t\t\t\t\t\t\t\t\t...prev,\n\t\t\t\t\t\t\t\t\texitCode: undefined,\n\t\t\t\t\t\t\t\t\tlines: [],\n\t\t\t\t\t\t\t\t\tversion: prev.version + 1,\n\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{isRunning ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div className=\"flex h-full flex-grow items-center justify-center border-r px-3.5\">\n\t\t\t\t\t\t\t\t<AnimatedBars role=\"status\" aria-label=\"Running Tests\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<StopTest name={name} />\n\t\t\t\t\t\t</>\n\t\t\t\t\t) : null}\n\t\t\t\t</div>\n\n\t\t\t\t{!isRunning && exitCode !== undefined && (\n\t\t\t\t\t<p className=\"pr-3.5 leading-none\">\n\t\t\t\t\t\t{exitCode === 0\n\t\t\t\t\t\t\t? `Tests passed`\n\t\t\t\t\t\t\t: `Test failed (exit code ${String(exitCode)})`}\n\t\t\t\t\t</p>\n\t\t\t\t)}\n\t\t\t\t{!isRunning && exitCode !== undefined && (\n\t\t\t\t\t<ClearTest\n\t\t\t\t\t\tname={name}\n\t\t\t\t\t\tonClear={() => {\n\t\t\t\t\t\t\tdispatch((prev) => ({\n\t\t\t\t\t\t\t\t...prev,\n\t\t\t\t\t\t\t\texitCode: undefined,\n\t\t\t\t\t\t\t\tlines: [],\n\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t<div className=\"flex h-full flex-col gap-5 p-5\">\n\t\t\t\t<p className=\"font-mono text-sm font-medium uppercase\">Test Output</p>\n\t\t\t\t<pre className=\"shadow-on-scrollbox flex-1 overflow-y-scroll scrollbar-thin scrollbar-thumb-scrollbar\">\n\t\t\t\t\t{lines.map((line) => (\n\t\t\t\t\t\t<code\n\t\t\t\t\t\t\tkey={line.timestamp}\n\t\t\t\t\t\t\tdata-type={line.type}\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={{\n\t\t\t\t\t\t\t\t__html: ansi.toHtml(stripCursorMovements(line.content)),\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</pre>\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n\nexport function TestRunner({\n\tname,\n\tonRun,\n}: {\n\tname: string\n\tonRun?: () => void\n}) {\n\tconst fetcher = useFetcher<typeof action>()\n\tconst peRedirectInput = usePERedirectInput()\n\tconst latestOnRun = useRef(onRun)\n\tuseEffect(() => {\n\t\tlatestOnRun.current = onRun\n\t}, [onRun])\n\tuseEffect(() => {\n\t\tif (fetcher.data?.success) {\n\t\t\tlatestOnRun.current?.()\n\t\t}\n\t}, [fetcher.data])\n\treturn (\n\t\t<fetcher.Form method=\"POST\" action=\"/test\" className=\"h-full\">\n\t\t\t{peRedirectInput}\n\t\t\t<input type=\"hidden\" name=\"name\" value={name} />\n\t\t\t<SimpleTooltip\n\t\t\t\tcontent={fetcher.state === 'idle' ? 'Run Tests' : 'Running Tests...'}\n\t\t\t>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\tname=\"intent\"\n\t\t\t\t\tvalue=\"run\"\n\t\t\t\t\tclassName=\"flex h-full flex-grow items-center justify-center border-r px-3.5\"\n\t\t\t\t>\n\t\t\t\t\t{fetcher.state === 'idle' ? (\n\t\t\t\t\t\t<Icon name=\"TriangleSmall\" />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<AnimatedBars role=\"status\" />\n\t\t\t\t\t)}\n\t\t\t\t</button>\n\t\t\t</SimpleTooltip>\n\t\t</fetcher.Form>\n\t)\n}\n\nexport function ClearTest({\n\tname,\n\tonClear,\n}: {\n\tname: string\n\tonClear?: () => void\n}) {\n\tconst fetcher = useFetcher<typeof action>()\n\tconst peRedirectInput = usePERedirectInput()\n\tconst latestOnClear = useRef(onClear)\n\tuseEffect(() => {\n\t\tlatestOnClear.current = onClear\n\t}, [onClear])\n\tuseEffect(() => {\n\t\tif (fetcher.data?.success) {\n\t\t\tlatestOnClear.current?.()\n\t\t}\n\t}, [fetcher.data])\n\treturn (\n\t\t<fetcher.Form method=\"POST\" action=\"/test\" className=\"h-full\">\n\t\t\t{peRedirectInput}\n\t\t\t<input type=\"hidden\" name=\"name\" value={name} />\n\t\t\t<SimpleTooltip\n\t\t\t\tcontent={fetcher.state === 'idle' ? 'Clear Tests' : 'Clearing Tests...'}\n\t\t\t>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\tname=\"intent\"\n\t\t\t\t\tvalue=\"clear\"\n\t\t\t\t\tclassName=\"flex h-full flex-grow items-center justify-center border-l px-3.5\"\n\t\t\t\t>\n\t\t\t\t\t{fetcher.state === 'idle' ? (\n\t\t\t\t\t\t<Icon name=\"Clear\" />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Icon name=\"Clear\" className=\"animate-pulse\" role=\"status\" />\n\t\t\t\t\t)}\n\t\t\t\t</button>\n\t\t\t</SimpleTooltip>\n\t\t</fetcher.Form>\n\t)\n}\n\nexport function StopTest({\n\tname,\n\tonStop,\n}: {\n\tname: string\n\tonStop?: () => void\n}) {\n\tconst fetcher = useFetcher<typeof action>()\n\tconst peRedirectInput = usePERedirectInput()\n\tconst latestOnStop = useRef(onStop)\n\tuseEffect(() => {\n\t\tlatestOnStop.current = onStop\n\t}, [onStop])\n\tuseEffect(() => {\n\t\tif (fetcher.data?.success) {\n\t\t\tlatestOnStop.current?.()\n\t\t}\n\t}, [fetcher.data])\n\treturn (\n\t\t<fetcher.Form method=\"POST\" action=\"/test\" className=\"h-full\">\n\t\t\t{peRedirectInput}\n\t\t\t<input type=\"hidden\" name=\"name\" value={name} />\n\t\t\t<SimpleTooltip\n\t\t\t\tcontent={fetcher.state === 'idle' ? 'Stop Tests' : 'Stopping Tests...'}\n\t\t\t>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\tname=\"intent\"\n\t\t\t\t\tvalue=\"stop\"\n\t\t\t\t\tclassName=\"flex h-full flex-grow items-center justify-center border-r px-3.5\"\n\t\t\t\t>\n\t\t\t\t\t{fetcher.state === 'idle' ? (\n\t\t\t\t\t\t<Icon name=\"Stop\" />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Icon name=\"Stop\" className=\"animate-pulse\" role=\"status\" />\n\t\t\t\t\t)}\n\t\t\t\t</button>\n\t\t\t</SimpleTooltip>\n\t\t</fetcher.Form>\n\t)\n}\n","import { type PlaygroundApp } from '@epic-web/workshop-utils/apps.server'\nimport { useState } from 'react'\nimport { DeferredEpicVideo } from '#app/components/epic-video.js'\nimport { Icon } from '#app/components/icons'\nimport { InBrowserTestRunner } from '#app/components/in-browser-test-runner'\nimport { useUserHasAccess } from '#app/components/user.js'\nimport { TestOutput } from '#app/routes/test'\nimport { PlaygroundWindow } from './playground-window'\n\nexport function Tests({\n\tappInfo: playgroundAppInfo,\n\tproblemAppName,\n\tallApps,\n\tisUpToDate,\n}: {\n\tappInfo: Pick<PlaygroundApp, 'appName' | 'name' | 'test'> | null\n\tproblemAppName?: string\n\tallApps: Array<{ name: string; displayName: string }>\n\tisUpToDate: boolean\n}) {\n\treturn (\n\t\t<PlaygroundWindow\n\t\t\tplaygroundAppName={playgroundAppInfo?.appName}\n\t\t\tproblemAppName={problemAppName}\n\t\t\tallApps={allApps}\n\t\t\tisUpToDate={isUpToDate}\n\t\t>\n\t\t\t<TestUI playgroundAppInfo={playgroundAppInfo} />\n\t\t</PlaygroundWindow>\n\t)\n}\n\nexport function TestUI({\n\tplaygroundAppInfo,\n}: {\n\tplaygroundAppInfo: Pick<PlaygroundApp, 'name' | 'test'> | null\n}) {\n\tconst [inBrowserTestKey, setInBrowserTestKey] = useState(0)\n\tconst userHasAccess = useUserHasAccess()\n\n\tif (!userHasAccess) {\n\t\treturn (\n\t\t\t<div className=\"w-full p-12\">\n\t\t\t\t<div className=\"flex w-full flex-col gap-4 text-center\">\n\t\t\t\t\t<p className=\"text-2xl font-bold\">Access Denied</p>\n\t\t\t\t\t<p className=\"text-lg\">\n\t\t\t\t\t\tYou must login or register for the workshop to view and run the\n\t\t\t\t\t\ttests.\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"h-16\" />\n\t\t\t\t<p className=\"pb-4\">\n\t\t\t\t\tCheck out this video to see how the test tab works.\n\t\t\t\t</p>\n\t\t\t\t<DeferredEpicVideo url=\"https://www.epicweb.dev/tips/epic-workshop-test-tab-demo\" />\n\t\t\t</div>\n\t\t)\n\t}\n\n\tif (!playgroundAppInfo) {\n\t\treturn (\n\t\t\t<div className=\"flex h-full items-center justify-center text-lg\">\n\t\t\t\t<p>No tests here 😢 Sorry.</p>\n\t\t\t</div>\n\t\t)\n\t}\n\n\tif (playgroundAppInfo.test.type === 'script') {\n\t\treturn <TestOutput name={playgroundAppInfo.name} />\n\t}\n\n\tif (playgroundAppInfo.test.type === 'browser') {\n\t\tconst { pathname } = playgroundAppInfo.test\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName=\"flex h-full w-full flex-grow flex-col overflow-y-auto\"\n\t\t\t\tkey={inBrowserTestKey}\n\t\t\t>\n\t\t\t\t{playgroundAppInfo.test.testFiles.map((testFile) => (\n\t\t\t\t\t<div key={testFile}>\n\t\t\t\t\t\t<InBrowserTestRunner pathname={pathname} testFile={testFile} />\n\t\t\t\t\t</div>\n\t\t\t\t))}\n\t\t\t\t<div className=\"px-3 py-[21px]\">\n\t\t\t\t\t<button\n\t\t\t\t\t\tonClick={() => setInBrowserTestKey((c) => c + 1)}\n\t\t\t\t\t\tclassName=\"flex items-center gap-2 font-mono text-sm uppercase leading-none\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon name=\"Refresh\" aria-hidden /> Rerun All Tests\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t)\n\t}\n\n\treturn (\n\t\t<div className=\"flex h-full items-center justify-center text-lg\">\n\t\t\t<p>No tests here 😢 Sorry.</p>\n\t\t</div>\n\t)\n}\n"],"names":["PlaygroundWindow","playgroundAppName","problemAppName","isUpToDate","allApps","children","isCorrectApp","playgroundLinkedUI","jsx","Icon","setPlaygroundTooltipText","jsxs","SetPlayground","SimpleTooltip","PlaygroundChooser","__importDefault","this","mod","decode_codepoint","decode_json_1","require$$0","fromCodePoint","codePoint","output","decodeCodePoint","decode","entities_json_1","legacy_json_1","require$$1","xml_json_1","require$$2","decode_codepoint_1","require$$3","strictEntityRe","getStrictDecoder","map","replace","getReplacer","str","sorter","a","b","legacy","keys","i","j","re","replacer","secondChar","encode","inverseXML","getInverseObj","xmlReplacer","getInverseReplacer","getASCIIEncoder","inverseHTML","htmlReplacer","getInverse","obj","inverse","name","single","multiple","_i","_a","k","start","end","count","reNonASCII","getCodePoint","c","singleCharReplacer","data","reEscapeChars","escape","escapeUTF8","exports","decode_1","encode_1","level","decodeStrict","encode_2","decode_2","_classCallCheck","instance","Constructor","_defineProperties","target","props","descriptor","_createClass","protoProps","staticProps","_createForOfIteratorHelper","o","allowArrayLike","it","_unsupportedIterableToArray","F","_e","normalCompletion","didErr","err","step","_e2","minLen","_arrayLikeToArray","n","arr","len","arr2","entities","defaults","getDefaultColors","colors","range","red","green","blue","setStyleColor","gray","l","toHexString","r","g","toColorHexString","num","ref","results","_iterator","_step","generateOutput","stack","token","options","result","pushText","handleDisplay","pushForegroundColor","pushBackgroundColor","handleRgb","operation","color","rgb","value","pushStyle","code","codeMap","resetStyles","pushTag","closeTag","stackClone","tag","low","high","notCategory","category","e","categoryForCode","text","style","last","tokenize","callback","ansiMatch","ansiHandler","remove","removeXterm256Foreground","m","g1","removeXterm256Background","newline","ansiMess","_iterator2","_step2","realText","tokens","process","handler","results1","_text","length","outer","updateStickyStack","stickyStack","Filter","input","_this","buf","element","ansi_to_html","useAnsiToHtml","theme","useTheme","useMemo","AnsiToHTML","stripCursorMovements","testRunnerStatusDataSchema","z","testRunnerTestStepDataSchema","testRunnerDataSchema","InBrowserTestRunner","pathname","testFile","ansi","iframeRef","useRef","message","setMessage","useState","testSteps","setTestSteps","useEffect","handleMessage","messageEvent","steps","statusEmoji","AnimatedBars","sortedTestSteps","testStepStatusEmojis","Fragment","Accordion.Root","AccordionComponent","testStep","index","_b","testEventSchema","union","object","type","literal","exitCode","number","nullable","optional","isRunning","boolean","array","content","string","timestamp","testEventQueueSchema","simpleReducer","prev","getNext","TestOutput","state","dispatch","useReducer","version","lines","lastMessage","useEventSource","URLSearchParams","parsed","JSON","parse","safeParse","success","console","error","flatten","event","sort","className","TestRunner","onRun","role","StopTest","String","ClearTest","onClear","line","dangerouslySetInnerHTML","__html","toHtml","fetcher","useFetcher","peRedirectInput","usePERedirectInput","latestOnRun","current","Form","method","action","latestOnClear","onStop","latestOnStop","Tests","playgroundAppInfo","TestUI","inBrowserTestKey","setInBrowserTestKey","useUserHasAccess","DeferredEpicVideo"],"mappings":"ghBAIO,SAASA,GAAiB,CAChC,kBAAAC,EACA,eAAAC,EACA,WAAAC,EACA,QAAAC,EACA,SAAAC,CACD,EAMG,CACF,MAAMC,EAAeL,IAAsBC,EACrCK,EACLD,GAAgBH,EACfK,EAAA,IAACC,GAAK,KAAK,KAAK,KAAK,QAAA,CAAS,EAE9BD,EAAA,IAACC,EAAA,CACA,KAAK,KACL,KAAK,WACL,UAAU,2CAAA,CAAA,EAGb,IAAIC,EAA2B,6BAC/B,OAAKP,IAEHO,EAAA,yDAEGJ,IAEHI,EAAA,oEAGDC,EAAA,KAAC,MAAI,CAAA,UAAU,8CACd,SAAA,CAACA,EAAAA,KAAA,MAAA,CAAI,UAAU,yEACd,SAAA,CAACH,EAAA,IAAA,MAAA,CAAI,UAAU,iBACb,SACAN,EAAAM,EAAA,IAACI,EAAA,CACA,QAASV,EACT,YAAaQ,EAEZ,SAAAH,CAAA,CAAA,EAGFC,EAAAA,IAACK,EAAc,CAAA,QAAQ,yCACtB,SAAAL,EAAA,IAAC,MACA,CAAA,SAAAA,EAAA,IAACC,EAAK,CAAA,KAAK,UAAW,CAAA,CACvB,CAAA,CACD,CAAA,EAEF,EACCD,EAAA,IAAA,MAAA,CAAI,UAAU,mBACb,SACAP,EAAAO,EAAA,IAACI,EAAA,CACA,QAASX,EACT,MAAK,GACL,YAAY,mBAEZ,SAAAO,EAAAA,IAAC,OAAI,UAAU,2CACd,eAACC,EAAK,CAAA,KAAK,UAAU,CACtB,CAAA,CAAA,CAAA,EAGDD,EAAAA,IAAC,MAAI,CAAA,UAAU,UAAU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AA,UAAU,iBACd,SAAAG,EAAA,KAAC,SAAA,CACA,QAAS,IAAM0R,EAAqB9N,GAAMA,EAAI,CAAC,EAC/C,UAAU,mEAEV,SAAA,CAAA/D,EAAA,IAACC,EAAK,CAAA,KAAK,UAAU,cAAW,GAAC,EAAE,kBAAA,CAAA,CAAA,EAErC,CAAA,CAAA,EAdK2R,CAAA,CAiBR,CAEA,aACE,MAAI,CAAA,UAAU,kDACd,SAAC5R,MAAA,IAAA,CAAE,kCAAuB,CAAA,CAC3B,CAAA,CAEF","x_google_ignoreList":[1,2,3,4,5]}
@@ -1,2 +1,2 @@
1
- import{r as f,j as P,B as nn}from"./index-CGzylDPY.js";import{r as ut}from"./components-DrvY4pal.js";import{a as on}from"./misc-BtjCSy-T.js";function U(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function rn(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ft(...e){return t=>e.forEach(n=>rn(n,t))}function Q(...e){return f.useCallback(ft(...e),e)}function pr(e,t){const n=f.createContext(t),o=i=>{const{children:s,...c}=i,a=f.useMemo(()=>c,Object.values(c));return P.jsx(n.Provider,{value:a,children:s})};o.displayName=e+"Provider";function r(i){const s=f.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[o,r]}function sn(e,t=[]){let n=[];function o(i,s){const c=f.createContext(s),a=n.length;n=[...n,s];const l=d=>{var v;const{scope:m,children:p,...h}=d,g=((v=m==null?void 0:m[e])==null?void 0:v[a])||c,x=f.useMemo(()=>h,Object.values(h));return P.jsx(g.Provider,{value:x,children:p})};l.displayName=i+"Provider";function u(d,m){var g;const p=((g=m==null?void 0:m[e])==null?void 0:g[a])||c,h=f.useContext(p);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[l,u]}const r=()=>{const i=n.map(s=>f.createContext(s));return function(c){const a=(c==null?void 0:c[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...c,[e]:a}}),[c,a])}};return r.scopeName=e,[o,cn(r,...t)]}function cn(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((c,{useScope:a,scopeName:l})=>{const d=a(i)[`__scope${l}`];return{...c,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var dt=f.forwardRef((e,t)=>{const{children:n,...o}=e,r=f.Children.toArray(n),i=r.find(an);if(i){const s=i.props.children,c=r.map(a=>a===i?f.Children.count(s)>1?f.Children.only(null):f.isValidElement(s)?s.props.children:null:a);return P.jsx(De,{...o,ref:t,children:f.isValidElement(s)?f.cloneElement(s,void 0,c):null})}return P.jsx(De,{...o,ref:t,children:n})});dt.displayName="Slot";var De=f.forwardRef((e,t)=>{const{children:n,...o}=e;if(f.isValidElement(n)){const r=un(n);return f.cloneElement(n,{...ln(o,n.props),ref:t?ft(t,r):r})}return f.Children.count(n)>1?f.Children.only(null):null});De.displayName="SlotClone";var pt=({children:e})=>P.jsx(P.Fragment,{children:e});function an(e){return f.isValidElement(e)&&e.type===pt}function ln(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...c)=>{i(...c),r(...c)}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function un(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ee=fn.reduce((e,t)=>{const n=f.forwardRef((o,r)=>{const{asChild:i,...s}=o,c=i?dt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(c,{...s,ref:r})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function dn(e,t){e&&ut.flushSync(()=>e.dispatchEvent(t))}function ie(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}function pn(e,t=globalThis==null?void 0:globalThis.document){const n=ie(e);f.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var mn="DismissableLayer",Ne="dismissableLayer.update",hn="dismissableLayer.pointerDownOutside",gn="dismissableLayer.focusOutside",et,mt=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ht=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:s,onDismiss:c,...a}=e,l=f.useContext(mt),[u,d]=f.useState(null),m=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=f.useState({}),h=Q(t,E=>d(E)),g=Array.from(l.layers),[x]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(x),y=u?g.indexOf(u):-1,C=l.layersWithOutsidePointerEventsDisabled.size>0,w=y>=v,b=yn(E=>{const O=E.target,M=[...l.branches].some(T=>T.contains(O));!w||M||(r==null||r(E),s==null||s(E),E.defaultPrevented||c==null||c())},m),A=wn(E=>{const O=E.target;[...l.branches].some(T=>T.contains(O))||(i==null||i(E),s==null||s(E),E.defaultPrevented||c==null||c())},m);return pn(E=>{y===l.layers.size-1&&(o==null||o(E),!E.defaultPrevented&&c&&(E.preventDefault(),c()))},m),f.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(et=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),tt(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=et)}},[u,m,n,l]),f.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),tt())},[u,l]),f.useEffect(()=>{const E=()=>p({});return document.addEventListener(Ne,E),()=>document.removeEventListener(Ne,E)},[]),P.jsx(ee.div,{...a,ref:h,style:{pointerEvents:C?w?"auto":"none":void 0,...e.style},onFocusCapture:U(e.onFocusCapture,A.onFocusCapture),onBlurCapture:U(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:U(e.onPointerDownCapture,b.onPointerDownCapture)})});ht.displayName=mn;var xn="DismissableLayerBranch",vn=f.forwardRef((e,t)=>{const n=f.useContext(mt),o=f.useRef(null),r=Q(t,o);return f.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),P.jsx(ee.div,{...e,ref:r})});vn.displayName=xn;function yn(e,t=globalThis==null?void 0:globalThis.document){const n=ie(e),o=f.useRef(!1),r=f.useRef(()=>{});return f.useEffect(()=>{const i=c=>{if(c.target&&!o.current){let a=function(){gt(hn,n,l,{discrete:!0})};const l={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=a,t.addEventListener("click",r.current,{once:!0})):a()}else t.removeEventListener("click",r.current);o.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function wn(e,t=globalThis==null?void 0:globalThis.document){const n=ie(e),o=f.useRef(!1);return f.useEffect(()=>{const r=i=>{i.target&&!o.current&&gt(gn,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function tt(){const e=new CustomEvent(Ne);document.dispatchEvent(e)}function gt(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?dn(r,i):r.dispatchEvent(i)}var ne=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},bn=nn.useId||(()=>{}),Cn=0;function En(e){const[t,n]=f.useState(bn());return ne(()=>{e||n(o=>o??String(Cn++))},[e]),e||(t?`radix-${t}`:"")}const Pn=["top","right","bottom","left"],G=Math.min,j=Math.max,xe=Math.round,me=Math.floor,q=e=>({x:e,y:e}),An={left:"right",right:"left",bottom:"top",top:"bottom"},Rn={start:"end",end:"start"};function Le(e,t,n){return j(e,G(t,n))}function Y(e,t){return typeof e=="function"?e(t):e}function X(e){return e.split("-")[0]}function se(e){return e.split("-")[1]}function Fe(e){return e==="x"?"y":"x"}function We(e){return e==="y"?"height":"width"}function K(e){return["top","bottom"].includes(X(e))?"y":"x"}function Ie(e){return Fe(K(e))}function On(e,t,n){n===void 0&&(n=!1);const o=se(e),r=Ie(e),i=We(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ve(s)),[s,ve(s)]}function Tn(e){const t=ve(e);return[Me(e),t,Me(t)]}function Me(e){return e.replace(/start|end/g,t=>Rn[t])}function Sn(e,t,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:o:t?o:r;case"left":case"right":return t?i:s;default:return[]}}function Dn(e,t,n,o){const r=se(e);let i=Sn(X(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(Me)))),i}function ve(e){return e.replace(/left|right|bottom|top/g,t=>An[t])}function Nn(e){return{top:0,right:0,bottom:0,left:0,...e}}function xt(e){return typeof e!="number"?Nn(e):{top:e,right:e,bottom:e,left:e}}function ye(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function nt(e,t,n){let{reference:o,floating:r}=e;const i=K(t),s=Ie(t),c=We(s),a=X(t),l=i==="y",u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,m=o[c]/2-r[c]/2;let p;switch(a){case"top":p={x:u,y:o.y-r.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-r.width,y:d};break;default:p={x:o.x,y:o.y}}switch(se(t)){case"start":p[s]-=m*(n&&l?-1:1);break;case"end":p[s]+=m*(n&&l?-1:1);break}return p}const Ln=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,c=i.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:d}=nt(l,o,a),m=o,p={},h=0;for(let g=0;g<c.length;g++){const{name:x,fn:v}=c[g],{x:y,y:C,data:w,reset:b}=await v({x:u,y:d,initialPlacement:o,placement:m,strategy:r,middlewareData:p,rects:l,platform:s,elements:{reference:e,floating:t}});u=y??u,d=C??d,p={...p,[x]:{...p[x],...w}},b&&h<=50&&(h++,typeof b=="object"&&(b.placement&&(m=b.placement),b.rects&&(l=b.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):b.rects),{x:u,y:d}=nt(l,m,a)),g=-1)}return{x:u,y:d,placement:m,strategy:r,middlewareData:p}};async function le(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:c,strategy:a}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:p=0}=Y(t,e),h=xt(p),x=c[m?d==="floating"?"reference":"floating":d],v=ye(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:l,rootBoundary:u,strategy:a})),y=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),w=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},b=ye(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:C,strategy:a}):y);return{top:(v.top-b.top+h.top)/w.y,bottom:(b.bottom-v.bottom+h.bottom)/w.y,left:(v.left-b.left+h.left)/w.x,right:(b.right-v.right+h.right)/w.x}}const Mn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:c,middlewareData:a}=t,{element:l,padding:u=0}=Y(e,t)||{};if(l==null)return{};const d=xt(u),m={x:n,y:o},p=Ie(r),h=We(p),g=await s.getDimensions(l),x=p==="y",v=x?"top":"left",y=x?"bottom":"right",C=x?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[p]-m[p]-i.floating[h],b=m[p]-i.reference[p],A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let E=A?A[C]:0;(!E||!await(s.isElement==null?void 0:s.isElement(A)))&&(E=c.floating[C]||i.floating[h]);const O=w/2-b/2,M=E/2-g[h]/2-1,T=G(d[v],M),k=G(d[y],M),$=T,D=E-g[h]-k,S=E/2-g[h]/2+O,W=Le($,S,D),N=!a.arrow&&se(r)!=null&&S!==W&&i.reference[h]/2-(S<$?T:k)-g[h]/2<0,L=N?S<$?S-$:S-D:0;return{[p]:m[p]+L,data:{[p]:W,centerOffset:S-W-L,...N&&{alignmentOffset:L}},reset:N}}}),_n=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:c,platform:a,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...x}=Y(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=X(r),y=K(c),C=X(c)===c,w=await(a.isRTL==null?void 0:a.isRTL(l.floating)),b=m||(C||!g?[ve(c)]:Tn(c)),A=h!=="none";!m&&A&&b.push(...Dn(c,g,h,w));const E=[c,...b],O=await le(t,x),M=[];let T=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&M.push(O[v]),d){const S=On(r,s,w);M.push(O[S[0]],O[S[1]])}if(T=[...T,{placement:r,overflows:M}],!M.every(S=>S<=0)){var k,$;const S=(((k=i.flip)==null?void 0:k.index)||0)+1,W=E[S];if(W)return{data:{index:S,overflows:T},reset:{placement:W}};let N=($=T.filter(L=>L.overflows[0]<=0).sort((L,R)=>L.overflows[1]-R.overflows[1])[0])==null?void 0:$.placement;if(!N)switch(p){case"bestFit":{var D;const L=(D=T.filter(R=>{if(A){const _=K(R.placement);return _===y||_==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(_=>_>0).reduce((_,H)=>_+H,0)]).sort((R,_)=>R[1]-_[1])[0])==null?void 0:D[0];L&&(N=L);break}case"initialPlacement":N=c;break}if(r!==N)return{reset:{placement:N}}}return{}}}};function ot(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rt(e){return Pn.some(t=>e[t]>=0)}const kn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=Y(e,t);switch(o){case"referenceHidden":{const i=await le(t,{...r,elementContext:"reference"}),s=ot(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:rt(s)}}}case"escaped":{const i=await le(t,{...r,altBoundary:!0}),s=ot(i,n.floating);return{data:{escapedOffsets:s,escaped:rt(s)}}}default:return{}}}}};async function $n(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=X(n),c=se(n),a=K(n)==="y",l=["left","top"].includes(s)?-1:1,u=i&&a?-1:1,d=Y(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof h=="number"&&(p=c==="end"?h*-1:h),a?{x:p*u,y:m*l}:{x:m*l,y:p*u}}const jn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:c}=t,a=await $n(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+a.x,y:i+a.y,data:{...a,placement:s}}}}},Fn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:c={fn:x=>{let{x:v,y}=x;return{x:v,y}}},...a}=Y(e,t),l={x:n,y:o},u=await le(t,a),d=K(X(r)),m=Fe(d);let p=l[m],h=l[d];if(i){const x=m==="y"?"top":"left",v=m==="y"?"bottom":"right",y=p+u[x],C=p-u[v];p=Le(y,p,C)}if(s){const x=d==="y"?"top":"left",v=d==="y"?"bottom":"right",y=h+u[x],C=h-u[v];h=Le(y,h,C)}const g=c.fn({...t,[m]:p,[d]:h});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[m]:i,[d]:s}}}}}},Wn=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:s}=t,{offset:c=0,mainAxis:a=!0,crossAxis:l=!0}=Y(e,t),u={x:n,y:o},d=K(r),m=Fe(d);let p=u[m],h=u[d];const g=Y(c,t),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(a){const C=m==="y"?"height":"width",w=i.reference[m]-i.floating[C]+x.mainAxis,b=i.reference[m]+i.reference[C]-x.mainAxis;p<w?p=w:p>b&&(p=b)}if(l){var v,y;const C=m==="y"?"width":"height",w=["top","left"].includes(X(r)),b=i.reference[d]-i.floating[C]+(w&&((v=s.offset)==null?void 0:v[d])||0)+(w?0:x.crossAxis),A=i.reference[d]+i.reference[C]+(w?0:((y=s.offset)==null?void 0:y[d])||0)-(w?x.crossAxis:0);h<b?h=b:h>A&&(h=A)}return{[m]:p,[d]:h}}}},In=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:s,elements:c}=t,{apply:a=()=>{},...l}=Y(e,t),u=await le(t,l),d=X(r),m=se(r),p=K(r)==="y",{width:h,height:g}=i.floating;let x,v;d==="top"||d==="bottom"?(x=d,v=m===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(v=d,x=m==="end"?"top":"bottom");const y=g-u.top-u.bottom,C=h-u.left-u.right,w=G(g-u[x],y),b=G(h-u[v],C),A=!t.middlewareData.shift;let E=w,O=b;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=C),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(E=y),A&&!m){const T=j(u.left,0),k=j(u.right,0),$=j(u.top,0),D=j(u.bottom,0);p?O=h-2*(T!==0||k!==0?T+k:j(u.left,u.right)):E=g-2*($!==0||D!==0?$+D:j(u.top,u.bottom))}await a({...t,availableWidth:O,availableHeight:E});const M=await s.getDimensions(c.floating);return h!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}};function be(){return typeof window<"u"}function ce(e){return vt(e)?(e.nodeName||"").toLowerCase():"#document"}function F(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function V(e){var t;return(t=(vt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vt(e){return be()?e instanceof Node||e instanceof F(e).Node:!1}function I(e){return be()?e instanceof Element||e instanceof F(e).Element:!1}function z(e){return be()?e instanceof HTMLElement||e instanceof F(e).HTMLElement:!1}function it(e){return!be()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof F(e).ShadowRoot}function fe(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=B(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function Bn(e){return["table","td","th"].includes(ce(e))}function Ce(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Be(e){const t=He(),n=I(e)?B(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Hn(e){let t=Z(e);for(;z(t)&&!oe(t);){if(Be(t))return t;if(Ce(t))return null;t=Z(t)}return null}function He(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function oe(e){return["html","body","#document"].includes(ce(e))}function B(e){return F(e).getComputedStyle(e)}function Ee(e){return I(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Z(e){if(ce(e)==="html")return e;const t=e.assignedSlot||e.parentNode||it(e)&&e.host||V(e);return it(t)?t.host:t}function yt(e){const t=Z(e);return oe(t)?e.ownerDocument?e.ownerDocument.body:e.body:z(t)&&fe(t)?t:yt(t)}function ue(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=yt(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=F(r);if(i){const c=_e(s);return t.concat(s,s.visualViewport||[],fe(r)?r:[],c&&n?ue(c):[])}return t.concat(r,ue(r,[],n))}function _e(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wt(e){const t=B(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=z(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,c=xe(n)!==i||xe(o)!==s;return c&&(n=i,o=s),{width:n,height:o,$:c}}function ze(e){return I(e)?e:e.contextElement}function te(e){const t=ze(e);if(!z(t))return q(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=wt(t);let s=(i?xe(n.width):n.width)/o,c=(i?xe(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const zn=q(0);function bt(e){const t=F(e);return!He()||!t.visualViewport?zn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Vn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==F(e)?!1:t}function J(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=ze(e);let s=q(1);t&&(o?I(o)&&(s=te(o)):s=te(e));const c=Vn(i,n,o)?bt(i):q(0);let a=(r.left+c.x)/s.x,l=(r.top+c.y)/s.y,u=r.width/s.x,d=r.height/s.y;if(i){const m=F(i),p=o&&I(o)?F(o):o;let h=m,g=_e(h);for(;g&&o&&p!==h;){const x=te(g),v=g.getBoundingClientRect(),y=B(g),C=v.left+(g.clientLeft+parseFloat(y.paddingLeft))*x.x,w=v.top+(g.clientTop+parseFloat(y.paddingTop))*x.y;a*=x.x,l*=x.y,u*=x.x,d*=x.y,a+=C,l+=w,h=F(g),g=_e(h)}}return ye({width:u,height:d,x:a,y:l})}function Un(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=V(o),c=t?Ce(t.floating):!1;if(o===s||c&&i)return n;let a={scrollLeft:0,scrollTop:0},l=q(1);const u=q(0),d=z(o);if((d||!d&&!i)&&((ce(o)!=="body"||fe(s))&&(a=Ee(o)),z(o))){const m=J(o);l=te(o),u.x=m.x+o.clientLeft,u.y=m.y+o.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+u.x,y:n.y*l.y-a.scrollTop*l.y+u.y}}function Yn(e){return Array.from(e.getClientRects())}function ke(e,t){const n=Ee(e).scrollLeft;return t?t.left+n:J(V(e)).left+n}function Xn(e){const t=V(e),n=Ee(e),o=e.ownerDocument.body,r=j(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=j(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+ke(e);const c=-n.scrollTop;return B(o).direction==="rtl"&&(s+=j(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:c}}function Gn(e,t){const n=F(e),o=V(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,c=0,a=0;if(r){i=r.width,s=r.height;const l=He();(!l||l&&t==="fixed")&&(c=r.offsetLeft,a=r.offsetTop)}return{width:i,height:s,x:c,y:a}}function qn(e,t){const n=J(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=z(e)?te(e):q(1),s=e.clientWidth*i.x,c=e.clientHeight*i.y,a=r*i.x,l=o*i.y;return{width:s,height:c,x:a,y:l}}function st(e,t,n){let o;if(t==="viewport")o=Gn(e,n);else if(t==="document")o=Xn(V(e));else if(I(t))o=qn(t,n);else{const r=bt(e);o={...t,x:t.x-r.x,y:t.y-r.y}}return ye(o)}function Ct(e,t){const n=Z(e);return n===t||!I(n)||oe(n)?!1:B(n).position==="fixed"||Ct(n,t)}function Kn(e,t){const n=t.get(e);if(n)return n;let o=ue(e,[],!1).filter(c=>I(c)&&ce(c)!=="body"),r=null;const i=B(e).position==="fixed";let s=i?Z(e):e;for(;I(s)&&!oe(s);){const c=B(s),a=Be(s);!a&&c.position==="fixed"&&(r=null),(i?!a&&!r:!a&&c.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||fe(s)&&!a&&Ct(e,s))?o=o.filter(u=>u!==s):r=c,s=Z(s)}return t.set(e,o),o}function Zn(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?Ce(t)?[]:Kn(t,this._c):[].concat(n),o],c=s[0],a=s.reduce((l,u)=>{const d=st(t,u,r);return l.top=j(d.top,l.top),l.right=G(d.right,l.right),l.bottom=G(d.bottom,l.bottom),l.left=j(d.left,l.left),l},st(t,c,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Jn(e){const{width:t,height:n}=wt(e);return{width:t,height:n}}function Qn(e,t,n){const o=z(t),r=V(t),i=n==="fixed",s=J(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const a=q(0);if(o||!o&&!i)if((ce(t)!=="body"||fe(r))&&(c=Ee(t)),o){const p=J(t,!0,i,t);a.x=p.x+t.clientLeft,a.y=p.y+t.clientTop}else r&&(a.x=ke(r));let l=0,u=0;if(r&&!o&&!i){const p=r.getBoundingClientRect();u=p.top+c.scrollTop,l=p.left+c.scrollLeft-ke(r,p)}const d=s.left+c.scrollLeft-a.x-l,m=s.top+c.scrollTop-a.y-u;return{x:d,y:m,width:s.width,height:s.height}}function Te(e){return B(e).position==="static"}function ct(e,t){if(!z(e)||B(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return V(e)===n&&(n=n.ownerDocument.body),n}function Et(e,t){const n=F(e);if(Ce(e))return n;if(!z(e)){let r=Z(e);for(;r&&!oe(r);){if(I(r)&&!Te(r))return r;r=Z(r)}return n}let o=ct(e,t);for(;o&&Bn(o)&&Te(o);)o=ct(o,t);return o&&oe(o)&&Te(o)&&!Be(o)?n:o||Hn(e)||n}const eo=async function(e){const t=this.getOffsetParent||Et,n=this.getDimensions,o=await n(e.floating);return{reference:Qn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function to(e){return B(e).direction==="rtl"}const no={convertOffsetParentRelativeRectToViewportRelativeRect:Un,getDocumentElement:V,getClippingRect:Zn,getOffsetParent:Et,getElementRects:eo,getClientRects:Yn,getDimensions:Jn,getScale:te,isElement:I,isRTL:to};function oo(e,t){let n=null,o;const r=V(e);function i(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),i();const{left:l,top:u,width:d,height:m}=e.getBoundingClientRect();if(c||t(),!d||!m)return;const p=me(u),h=me(r.clientWidth-(l+d)),g=me(r.clientHeight-(u+m)),x=me(l),y={rootMargin:-p+"px "+-h+"px "+-g+"px "+-x+"px",threshold:j(0,G(1,a))||1};let C=!0;function w(b){const A=b[0].intersectionRatio;if(A!==a){if(!C)return s();A?s(!1,A):o=setTimeout(()=>{s(!1,1e-7)},1e3)}C=!1}try{n=new IntersectionObserver(w,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(w,y)}n.observe(e)}return s(!0),i}function ro(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,l=ze(e),u=r||i?[...l?ue(l):[],...ue(t)]:[];u.forEach(v=>{r&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=l&&c?oo(l,n):null;let m=-1,p=null;s&&(p=new ResizeObserver(v=>{let[y]=v;y&&y.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=p)==null||C.observe(t)})),n()}),l&&!a&&p.observe(l),p.observe(t));let h,g=a?J(e):null;a&&x();function x(){const v=J(e);g&&(v.x!==g.x||v.y!==g.y||v.width!==g.width||v.height!==g.height)&&n(),g=v,h=requestAnimationFrame(x)}return n(),()=>{var v;u.forEach(y=>{r&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),d==null||d(),(v=p)==null||v.disconnect(),p=null,a&&cancelAnimationFrame(h)}}const io=jn,so=Fn,co=_n,ao=In,lo=kn,at=Mn,uo=Wn,fo=(e,t,n)=>{const o=new Map,r={platform:no,...n},i={...r.platform,_c:o};return Ln(e,t,{...r,platform:i})};var ge=typeof document<"u"?f.useLayoutEffect:f.useEffect;function we(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!we(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!we(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Pt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lt(e,t){const n=Pt(e);return Math.round(t*n)/n}function Se(e){const t=f.useRef(e);return ge(()=>{t.current=e}),t}function po(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:a,open:l}=e,[u,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=f.useState(o);we(m,o)||p(o);const[h,g]=f.useState(null),[x,v]=f.useState(null),y=f.useCallback(R=>{R!==A.current&&(A.current=R,g(R))},[]),C=f.useCallback(R=>{R!==E.current&&(E.current=R,v(R))},[]),w=i||h,b=s||x,A=f.useRef(null),E=f.useRef(null),O=f.useRef(u),M=a!=null,T=Se(a),k=Se(r),$=Se(l),D=f.useCallback(()=>{if(!A.current||!E.current)return;const R={placement:t,strategy:n,middleware:m};k.current&&(R.platform=k.current),fo(A.current,E.current,R).then(_=>{const H={..._,isPositioned:$.current!==!1};S.current&&!we(O.current,H)&&(O.current=H,ut.flushSync(()=>{d(H)}))})},[m,t,n,k,$]);ge(()=>{l===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(R=>({...R,isPositioned:!1})))},[l]);const S=f.useRef(!1);ge(()=>(S.current=!0,()=>{S.current=!1}),[]),ge(()=>{if(w&&(A.current=w),b&&(E.current=b),w&&b){if(T.current)return T.current(w,b,D);D()}},[w,b,D,T,M]);const W=f.useMemo(()=>({reference:A,floating:E,setReference:y,setFloating:C}),[y,C]),N=f.useMemo(()=>({reference:w,floating:b}),[w,b]),L=f.useMemo(()=>{const R={position:n,left:0,top:0};if(!N.floating)return R;const _=lt(N.floating,u.x),H=lt(N.floating,u.y);return c?{...R,transform:"translate("+_+"px, "+H+"px)",...Pt(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:H}},[n,c,N.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:D,refs:W,elements:N,floatingStyles:L}),[u,D,W,N,L])}const mo=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?at({element:o.current,padding:r}).fn(n):{}:o?at({element:o,padding:r}).fn(n):{}}}},ho=(e,t)=>({...io(e),options:[e,t]}),go=(e,t)=>({...so(e),options:[e,t]}),xo=(e,t)=>({...uo(e),options:[e,t]}),vo=(e,t)=>({...co(e),options:[e,t]}),yo=(e,t)=>({...ao(e),options:[e,t]}),wo=(e,t)=>({...lo(e),options:[e,t]}),bo=(e,t)=>({...mo(e),options:[e,t]});var Co="Arrow",At=f.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...i}=e;return P.jsx(ee.svg,{...i,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:P.jsx("polygon",{points:"0,0 30,0 15,10"})})});At.displayName=Co;var Eo=At;function Po(e,t=[]){let n=[];function o(i,s){const c=f.createContext(s),a=n.length;n=[...n,s];function l(d){const{scope:m,children:p,...h}=d,g=(m==null?void 0:m[e][a])||c,x=f.useMemo(()=>h,Object.values(h));return P.jsx(g.Provider,{value:x,children:p})}function u(d,m){const p=(m==null?void 0:m[e][a])||c,h=f.useContext(p);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return l.displayName=i+"Provider",[l,u]}const r=()=>{const i=n.map(s=>f.createContext(s));return function(c){const a=(c==null?void 0:c[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...c,[e]:a}}),[c,a])}};return r.scopeName=e,[o,Ao(r,...t)]}function Ao(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((c,{useScope:a,scopeName:l})=>{const d=a(i)[`__scope${l}`];return{...c,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Ro(e){const[t,n]=f.useState(void 0);return ne(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let s,c;if("borderBoxSize"in i){const a=i.borderBoxSize,l=Array.isArray(a)?a[0]:a;s=l.inlineSize,c=l.blockSize}else s=e.offsetWidth,c=e.offsetHeight;n({width:s,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var Ve="Popper",[Rt,Ot]=Po(Ve),[Oo,Tt]=Rt(Ve),St=e=>{const{__scopePopper:t,children:n}=e,[o,r]=f.useState(null);return P.jsx(Oo,{scope:t,anchor:o,onAnchorChange:r,children:n})};St.displayName=Ve;var Dt="PopperAnchor",Nt=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,i=Tt(Dt,n),s=f.useRef(null),c=Q(t,s);return f.useEffect(()=>{i.onAnchorChange((o==null?void 0:o.current)||s.current)}),o?null:P.jsx(ee.div,{...r,ref:c})});Nt.displayName=Dt;var Ue="PopperContent",[To,So]=Rt(Ue),Lt=f.forwardRef((e,t)=>{var Xe,Ge,qe,Ke,Ze,Je;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:i="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:a=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:h,...g}=e,x=Tt(Ue,n),[v,y]=f.useState(null),C=Q(t,ae=>y(ae)),[w,b]=f.useState(null),A=Ro(w),E=(A==null?void 0:A.width)??0,O=(A==null?void 0:A.height)??0,M=o+(i!=="center"?"-"+i:""),T=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},k=Array.isArray(l)?l:[l],$=k.length>0,D={padding:T,boundary:k.filter(No),altBoundary:$},{refs:S,floatingStyles:W,placement:N,isPositioned:L,middlewareData:R}=po({strategy:"fixed",placement:M,whileElementsMounted:(...ae)=>ro(...ae,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[ho({mainAxis:r+O,alignmentAxis:s}),a&&go({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?xo():void 0,...D}),a&&vo({...D}),yo({...D,apply:({elements:ae,rects:Qe,availableWidth:Jt,availableHeight:Qt})=>{const{width:en,height:tn}=Qe.reference,pe=ae.floating.style;pe.setProperty("--radix-popper-available-width",`${Jt}px`),pe.setProperty("--radix-popper-available-height",`${Qt}px`),pe.setProperty("--radix-popper-anchor-width",`${en}px`),pe.setProperty("--radix-popper-anchor-height",`${tn}px`)}}),w&&bo({element:w,padding:c}),Lo({arrowWidth:E,arrowHeight:O}),m&&wo({strategy:"referenceHidden",...D})]}),[_,H]=kt(N),de=ie(h);ne(()=>{L&&(de==null||de())},[L,de]);const Xt=(Xe=R.arrow)==null?void 0:Xe.x,Gt=(Ge=R.arrow)==null?void 0:Ge.y,qt=((qe=R.arrow)==null?void 0:qe.centerOffset)!==0,[Kt,Zt]=f.useState();return ne(()=>{v&&Zt(window.getComputedStyle(v).zIndex)},[v]),P.jsx("div",{ref:S.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:L?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Kt,"--radix-popper-transform-origin":[(Ke=R.transformOrigin)==null?void 0:Ke.x,(Ze=R.transformOrigin)==null?void 0:Ze.y].join(" "),...((Je=R.hide)==null?void 0:Je.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:P.jsx(To,{scope:n,placedSide:_,onArrowChange:b,arrowX:Xt,arrowY:Gt,shouldHideArrow:qt,children:P.jsx(ee.div,{"data-side":_,"data-align":H,...g,ref:C,style:{...g.style,animation:L?void 0:"none"}})})})});Lt.displayName=Ue;var Mt="PopperArrow",Do={top:"bottom",right:"left",bottom:"top",left:"right"},_t=f.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,i=So(Mt,o),s=Do[i.placedSide];return P.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:P.jsx(Eo,{...r,ref:n,style:{...r.style,display:"block"}})})});_t.displayName=Mt;function No(e){return e!==null}var Lo=e=>({name:"transformOrigin",options:e,fn(t){var x,v,y;const{placement:n,rects:o,middlewareData:r}=t,s=((x=r.arrow)==null?void 0:x.centerOffset)!==0,c=s?0:e.arrowWidth,a=s?0:e.arrowHeight,[l,u]=kt(n),d={start:"0%",center:"50%",end:"100%"}[u],m=(((v=r.arrow)==null?void 0:v.x)??0)+c/2,p=(((y=r.arrow)==null?void 0:y.y)??0)+a/2;let h="",g="";return l==="bottom"?(h=s?d:`${m}px`,g=`${-a}px`):l==="top"?(h=s?d:`${m}px`,g=`${o.floating.height+a}px`):l==="right"?(h=`${-a}px`,g=s?d:`${p}px`):l==="left"&&(h=`${o.floating.width+a}px`,g=s?d:`${p}px`),{data:{x:h,y:g}}}});function kt(e){const[t,n="center"]=e.split("-");return[t,n]}var Mo=St,_o=Nt,ko=Lt,$o=_t;function jo(e,t){return f.useReducer((n,o)=>t[n][o]??n,e)}var $t=e=>{const{present:t,children:n}=e,o=Fo(t),r=typeof n=="function"?n({present:o.isPresent}):f.Children.only(n),i=Q(o.ref,Wo(r));return typeof n=="function"||o.isPresent?f.cloneElement(r,{ref:i}):null};$t.displayName="Presence";function Fo(e){const[t,n]=f.useState(),o=f.useRef({}),r=f.useRef(e),i=f.useRef("none"),s=e?"mounted":"unmounted",[c,a]=jo(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const l=he(o.current);i.current=c==="mounted"?l:"none"},[c]),ne(()=>{const l=o.current,u=r.current;if(u!==e){const m=i.current,p=he(l);e?a("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?a("UNMOUNT"):a(u&&m!==p?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,a]),ne(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=p=>{const g=he(o.current).includes(p.animationName);if(p.target===t&&g&&(a("ANIMATION_END"),!r.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},m=p=>{p.target===t&&(i.current=he(o.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:f.useCallback(l=>{l&&(o.current=getComputedStyle(l)),n(l)},[])}}function he(e){return(e==null?void 0:e.animationName)||"none"}function Wo(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Io({prop:e,defaultProp:t,onChange:n=()=>{}}){const[o,r]=Bo({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:o,c=ie(n),a=f.useCallback(l=>{if(i){const d=typeof l=="function"?l(e):l;d!==e&&c(d)}else r(l)},[i,e,r,c]);return[s,a]}function Bo({defaultProp:e,onChange:t}){const n=f.useState(e),[o]=n,r=f.useRef(o),i=ie(t);return f.useEffect(()=>{r.current!==o&&(i(o),r.current=o)},[o,r,i]),n}var Ho="VisuallyHidden",jt=f.forwardRef((e,t)=>P.jsx(ee.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));jt.displayName=Ho;var zo=jt,[Pe,mr]=sn("Tooltip",[Ot]),Ae=Ot(),Ft="TooltipProvider",Vo=700,$e="tooltip.open",[Uo,Ye]=Pe(Ft),Wt=e=>{const{__scopeTooltip:t,delayDuration:n=Vo,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:i}=e,[s,c]=f.useState(!0),a=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),P.jsx(Uo,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(l.current),c(!1)},[]),onClose:f.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>c(!0),o)},[o]),isPointerInTransitRef:a,onPointerInTransitChange:f.useCallback(u=>{a.current=u},[]),disableHoverableContent:r,children:i})};Wt.displayName=Ft;var Re="Tooltip",[Yo,Oe]=Pe(Re),It=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:c}=e,a=Ye(Re,e.__scopeTooltip),l=Ae(t),[u,d]=f.useState(null),m=En(),p=f.useRef(0),h=s??a.disableHoverableContent,g=c??a.delayDuration,x=f.useRef(!1),[v=!1,y]=Io({prop:o,defaultProp:r,onChange:E=>{E?(a.onOpen(),document.dispatchEvent(new CustomEvent($e))):a.onClose(),i==null||i(E)}}),C=f.useMemo(()=>v?x.current?"delayed-open":"instant-open":"closed",[v]),w=f.useCallback(()=>{window.clearTimeout(p.current),x.current=!1,y(!0)},[y]),b=f.useCallback(()=>{window.clearTimeout(p.current),y(!1)},[y]),A=f.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x.current=!0,y(!0)},g)},[g,y]);return f.useEffect(()=>()=>window.clearTimeout(p.current),[]),P.jsx(Mo,{...l,children:P.jsx(Yo,{scope:t,contentId:m,open:v,stateAttribute:C,trigger:u,onTriggerChange:d,onTriggerEnter:f.useCallback(()=>{a.isOpenDelayed?A():w()},[a.isOpenDelayed,A,w]),onTriggerLeave:f.useCallback(()=>{h?b():window.clearTimeout(p.current)},[b,h]),onOpen:w,onClose:b,disableHoverableContent:h,children:n})})};It.displayName=Re;var je="TooltipTrigger",Bt=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Oe(je,n),i=Ye(je,n),s=Ae(n),c=f.useRef(null),a=Q(t,c,r.onTriggerChange),l=f.useRef(!1),u=f.useRef(!1),d=f.useCallback(()=>l.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),P.jsx(_o,{asChild:!0,...s,children:P.jsx(ee.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:a,onPointerMove:U(e.onPointerMove,m=>{m.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(r.onTriggerEnter(),u.current=!0)}),onPointerLeave:U(e.onPointerLeave,()=>{r.onTriggerLeave(),u.current=!1}),onPointerDown:U(e.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:U(e.onFocus,()=>{l.current||r.onOpen()}),onBlur:U(e.onBlur,r.onClose),onClick:U(e.onClick,r.onClose)})})});Bt.displayName=je;var Xo="TooltipPortal",[hr,Go]=Pe(Xo,{forceMount:void 0}),re="TooltipContent",Ht=f.forwardRef((e,t)=>{const n=Go(re,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...i}=e,s=Oe(re,e.__scopeTooltip);return P.jsx($t,{present:o||s.open,children:s.disableHoverableContent?P.jsx(zt,{side:r,...i,ref:t}):P.jsx(qo,{side:r,...i,ref:t})})}),qo=f.forwardRef((e,t)=>{const n=Oe(re,e.__scopeTooltip),o=Ye(re,e.__scopeTooltip),r=f.useRef(null),i=Q(t,r),[s,c]=f.useState(null),{trigger:a,onClose:l}=n,u=r.current,{onPointerInTransitChange:d}=o,m=f.useCallback(()=>{c(null),d(!1)},[d]),p=f.useCallback((h,g)=>{const x=h.currentTarget,v={x:h.clientX,y:h.clientY},y=Qo(v,x.getBoundingClientRect()),C=er(v,y),w=tr(g.getBoundingClientRect()),b=or([...C,...w]);c(b),d(!0)},[d]);return f.useEffect(()=>()=>m(),[m]),f.useEffect(()=>{if(a&&u){const h=x=>p(x,u),g=x=>p(x,a);return a.addEventListener("pointerleave",h),u.addEventListener("pointerleave",g),()=>{a.removeEventListener("pointerleave",h),u.removeEventListener("pointerleave",g)}}},[a,u,p,m]),f.useEffect(()=>{if(s){const h=g=>{const x=g.target,v={x:g.clientX,y:g.clientY},y=(a==null?void 0:a.contains(x))||(u==null?void 0:u.contains(x)),C=!nr(v,s);y?m():C&&(m(),l())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[a,u,s,l,m]),P.jsx(zt,{...e,ref:i})}),[Ko,Zo]=Pe(Re,{isInside:!1}),zt=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:i,onPointerDownOutside:s,...c}=e,a=Oe(re,n),l=Ae(n),{onClose:u}=a;return f.useEffect(()=>(document.addEventListener($e,u),()=>document.removeEventListener($e,u)),[u]),f.useEffect(()=>{if(a.trigger){const d=m=>{const p=m.target;p!=null&&p.contains(a.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[a.trigger,u]),P.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:P.jsxs(ko,{"data-state":a.stateAttribute,...l,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[P.jsx(pt,{children:o}),P.jsx(Ko,{scope:n,isInside:!0,children:P.jsx(zo,{id:a.contentId,role:"tooltip",children:r||o})})]})})});Ht.displayName=re;var Vt="TooltipArrow",Jo=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Ae(n);return Zo(Vt,n).isInside?null:P.jsx($o,{...r,...o,ref:t})});Jo.displayName=Vt;function Qo(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function er(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function tr(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function nr(e,t){const{x:n,y:o}=e;let r=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const c=t[i].x,a=t[i].y,l=t[s].x,u=t[s].y;a>o!=u>o&&n<(l-c)*(o-a)/(u-a)+c&&(r=!r)}return r}function or(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),rr(t)}function rr(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const r=e[o];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var ir=Wt,sr=It,cr=Bt,Ut=Ht;const gr=ir,ar=sr,lr=cr;function Yt({className:e,sideOffset:t=4,ref:n,...o}){return P.jsx(Ut,{ref:n,sideOffset:t,className:on("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}Yt.displayName=Ut.displayName;function xr({content:e,children:t}){return e?P.jsxs(ar,{children:[P.jsx(lr,{asChild:!0,children:t}),P.jsx(Yt,{children:e})]}):t}export{_o as A,ko as C,ht as D,ee as P,Mo as R,xr as S,gr as T,jt as V,ar as a,lr as b,Yt as c,sn as d,En as e,U as f,$t as g,Q as h,ne as i,Ot as j,dt as k,$o as l,pr as m,ie as n,Io as u};
2
- //# sourceMappingURL=tooltip-Bp9KHnLy.js.map
1
+ import{r as f,j as P,B as nn}from"./index-CGzylDPY.js";import{r as ut}from"./components-DrvY4pal.js";import{a as on}from"./misc-DoGPlBur.js";function U(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function rn(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ft(...e){return t=>e.forEach(n=>rn(n,t))}function Q(...e){return f.useCallback(ft(...e),e)}function pr(e,t){const n=f.createContext(t),o=i=>{const{children:s,...c}=i,a=f.useMemo(()=>c,Object.values(c));return P.jsx(n.Provider,{value:a,children:s})};o.displayName=e+"Provider";function r(i){const s=f.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[o,r]}function sn(e,t=[]){let n=[];function o(i,s){const c=f.createContext(s),a=n.length;n=[...n,s];const l=d=>{var v;const{scope:m,children:p,...h}=d,g=((v=m==null?void 0:m[e])==null?void 0:v[a])||c,x=f.useMemo(()=>h,Object.values(h));return P.jsx(g.Provider,{value:x,children:p})};l.displayName=i+"Provider";function u(d,m){var g;const p=((g=m==null?void 0:m[e])==null?void 0:g[a])||c,h=f.useContext(p);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[l,u]}const r=()=>{const i=n.map(s=>f.createContext(s));return function(c){const a=(c==null?void 0:c[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...c,[e]:a}}),[c,a])}};return r.scopeName=e,[o,cn(r,...t)]}function cn(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((c,{useScope:a,scopeName:l})=>{const d=a(i)[`__scope${l}`];return{...c,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var dt=f.forwardRef((e,t)=>{const{children:n,...o}=e,r=f.Children.toArray(n),i=r.find(an);if(i){const s=i.props.children,c=r.map(a=>a===i?f.Children.count(s)>1?f.Children.only(null):f.isValidElement(s)?s.props.children:null:a);return P.jsx(De,{...o,ref:t,children:f.isValidElement(s)?f.cloneElement(s,void 0,c):null})}return P.jsx(De,{...o,ref:t,children:n})});dt.displayName="Slot";var De=f.forwardRef((e,t)=>{const{children:n,...o}=e;if(f.isValidElement(n)){const r=un(n);return f.cloneElement(n,{...ln(o,n.props),ref:t?ft(t,r):r})}return f.Children.count(n)>1?f.Children.only(null):null});De.displayName="SlotClone";var pt=({children:e})=>P.jsx(P.Fragment,{children:e});function an(e){return f.isValidElement(e)&&e.type===pt}function ln(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...c)=>{i(...c),r(...c)}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function un(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ee=fn.reduce((e,t)=>{const n=f.forwardRef((o,r)=>{const{asChild:i,...s}=o,c=i?dt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(c,{...s,ref:r})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function dn(e,t){e&&ut.flushSync(()=>e.dispatchEvent(t))}function ie(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}function pn(e,t=globalThis==null?void 0:globalThis.document){const n=ie(e);f.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var mn="DismissableLayer",Ne="dismissableLayer.update",hn="dismissableLayer.pointerDownOutside",gn="dismissableLayer.focusOutside",et,mt=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ht=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:s,onDismiss:c,...a}=e,l=f.useContext(mt),[u,d]=f.useState(null),m=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=f.useState({}),h=Q(t,E=>d(E)),g=Array.from(l.layers),[x]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(x),y=u?g.indexOf(u):-1,C=l.layersWithOutsidePointerEventsDisabled.size>0,w=y>=v,b=yn(E=>{const O=E.target,M=[...l.branches].some(T=>T.contains(O));!w||M||(r==null||r(E),s==null||s(E),E.defaultPrevented||c==null||c())},m),A=wn(E=>{const O=E.target;[...l.branches].some(T=>T.contains(O))||(i==null||i(E),s==null||s(E),E.defaultPrevented||c==null||c())},m);return pn(E=>{y===l.layers.size-1&&(o==null||o(E),!E.defaultPrevented&&c&&(E.preventDefault(),c()))},m),f.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(et=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),tt(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=et)}},[u,m,n,l]),f.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),tt())},[u,l]),f.useEffect(()=>{const E=()=>p({});return document.addEventListener(Ne,E),()=>document.removeEventListener(Ne,E)},[]),P.jsx(ee.div,{...a,ref:h,style:{pointerEvents:C?w?"auto":"none":void 0,...e.style},onFocusCapture:U(e.onFocusCapture,A.onFocusCapture),onBlurCapture:U(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:U(e.onPointerDownCapture,b.onPointerDownCapture)})});ht.displayName=mn;var xn="DismissableLayerBranch",vn=f.forwardRef((e,t)=>{const n=f.useContext(mt),o=f.useRef(null),r=Q(t,o);return f.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),P.jsx(ee.div,{...e,ref:r})});vn.displayName=xn;function yn(e,t=globalThis==null?void 0:globalThis.document){const n=ie(e),o=f.useRef(!1),r=f.useRef(()=>{});return f.useEffect(()=>{const i=c=>{if(c.target&&!o.current){let a=function(){gt(hn,n,l,{discrete:!0})};const l={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=a,t.addEventListener("click",r.current,{once:!0})):a()}else t.removeEventListener("click",r.current);o.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function wn(e,t=globalThis==null?void 0:globalThis.document){const n=ie(e),o=f.useRef(!1);return f.useEffect(()=>{const r=i=>{i.target&&!o.current&&gt(gn,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function tt(){const e=new CustomEvent(Ne);document.dispatchEvent(e)}function gt(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?dn(r,i):r.dispatchEvent(i)}var ne=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},bn=nn.useId||(()=>{}),Cn=0;function En(e){const[t,n]=f.useState(bn());return ne(()=>{e||n(o=>o??String(Cn++))},[e]),e||(t?`radix-${t}`:"")}const Pn=["top","right","bottom","left"],G=Math.min,j=Math.max,xe=Math.round,me=Math.floor,q=e=>({x:e,y:e}),An={left:"right",right:"left",bottom:"top",top:"bottom"},Rn={start:"end",end:"start"};function Le(e,t,n){return j(e,G(t,n))}function Y(e,t){return typeof e=="function"?e(t):e}function X(e){return e.split("-")[0]}function se(e){return e.split("-")[1]}function Fe(e){return e==="x"?"y":"x"}function We(e){return e==="y"?"height":"width"}function K(e){return["top","bottom"].includes(X(e))?"y":"x"}function Ie(e){return Fe(K(e))}function On(e,t,n){n===void 0&&(n=!1);const o=se(e),r=Ie(e),i=We(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ve(s)),[s,ve(s)]}function Tn(e){const t=ve(e);return[Me(e),t,Me(t)]}function Me(e){return e.replace(/start|end/g,t=>Rn[t])}function Sn(e,t,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:o:t?o:r;case"left":case"right":return t?i:s;default:return[]}}function Dn(e,t,n,o){const r=se(e);let i=Sn(X(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(Me)))),i}function ve(e){return e.replace(/left|right|bottom|top/g,t=>An[t])}function Nn(e){return{top:0,right:0,bottom:0,left:0,...e}}function xt(e){return typeof e!="number"?Nn(e):{top:e,right:e,bottom:e,left:e}}function ye(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function nt(e,t,n){let{reference:o,floating:r}=e;const i=K(t),s=Ie(t),c=We(s),a=X(t),l=i==="y",u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,m=o[c]/2-r[c]/2;let p;switch(a){case"top":p={x:u,y:o.y-r.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-r.width,y:d};break;default:p={x:o.x,y:o.y}}switch(se(t)){case"start":p[s]-=m*(n&&l?-1:1);break;case"end":p[s]+=m*(n&&l?-1:1);break}return p}const Ln=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,c=i.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:d}=nt(l,o,a),m=o,p={},h=0;for(let g=0;g<c.length;g++){const{name:x,fn:v}=c[g],{x:y,y:C,data:w,reset:b}=await v({x:u,y:d,initialPlacement:o,placement:m,strategy:r,middlewareData:p,rects:l,platform:s,elements:{reference:e,floating:t}});u=y??u,d=C??d,p={...p,[x]:{...p[x],...w}},b&&h<=50&&(h++,typeof b=="object"&&(b.placement&&(m=b.placement),b.rects&&(l=b.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):b.rects),{x:u,y:d}=nt(l,m,a)),g=-1)}return{x:u,y:d,placement:m,strategy:r,middlewareData:p}};async function le(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:c,strategy:a}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:p=0}=Y(t,e),h=xt(p),x=c[m?d==="floating"?"reference":"floating":d],v=ye(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:l,rootBoundary:u,strategy:a})),y=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),w=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},b=ye(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:C,strategy:a}):y);return{top:(v.top-b.top+h.top)/w.y,bottom:(b.bottom-v.bottom+h.bottom)/w.y,left:(v.left-b.left+h.left)/w.x,right:(b.right-v.right+h.right)/w.x}}const Mn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:c,middlewareData:a}=t,{element:l,padding:u=0}=Y(e,t)||{};if(l==null)return{};const d=xt(u),m={x:n,y:o},p=Ie(r),h=We(p),g=await s.getDimensions(l),x=p==="y",v=x?"top":"left",y=x?"bottom":"right",C=x?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[p]-m[p]-i.floating[h],b=m[p]-i.reference[p],A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let E=A?A[C]:0;(!E||!await(s.isElement==null?void 0:s.isElement(A)))&&(E=c.floating[C]||i.floating[h]);const O=w/2-b/2,M=E/2-g[h]/2-1,T=G(d[v],M),k=G(d[y],M),$=T,D=E-g[h]-k,S=E/2-g[h]/2+O,W=Le($,S,D),N=!a.arrow&&se(r)!=null&&S!==W&&i.reference[h]/2-(S<$?T:k)-g[h]/2<0,L=N?S<$?S-$:S-D:0;return{[p]:m[p]+L,data:{[p]:W,centerOffset:S-W-L,...N&&{alignmentOffset:L}},reset:N}}}),_n=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:c,platform:a,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...x}=Y(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=X(r),y=K(c),C=X(c)===c,w=await(a.isRTL==null?void 0:a.isRTL(l.floating)),b=m||(C||!g?[ve(c)]:Tn(c)),A=h!=="none";!m&&A&&b.push(...Dn(c,g,h,w));const E=[c,...b],O=await le(t,x),M=[];let T=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&M.push(O[v]),d){const S=On(r,s,w);M.push(O[S[0]],O[S[1]])}if(T=[...T,{placement:r,overflows:M}],!M.every(S=>S<=0)){var k,$;const S=(((k=i.flip)==null?void 0:k.index)||0)+1,W=E[S];if(W)return{data:{index:S,overflows:T},reset:{placement:W}};let N=($=T.filter(L=>L.overflows[0]<=0).sort((L,R)=>L.overflows[1]-R.overflows[1])[0])==null?void 0:$.placement;if(!N)switch(p){case"bestFit":{var D;const L=(D=T.filter(R=>{if(A){const _=K(R.placement);return _===y||_==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(_=>_>0).reduce((_,H)=>_+H,0)]).sort((R,_)=>R[1]-_[1])[0])==null?void 0:D[0];L&&(N=L);break}case"initialPlacement":N=c;break}if(r!==N)return{reset:{placement:N}}}return{}}}};function ot(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rt(e){return Pn.some(t=>e[t]>=0)}const kn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=Y(e,t);switch(o){case"referenceHidden":{const i=await le(t,{...r,elementContext:"reference"}),s=ot(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:rt(s)}}}case"escaped":{const i=await le(t,{...r,altBoundary:!0}),s=ot(i,n.floating);return{data:{escapedOffsets:s,escaped:rt(s)}}}default:return{}}}}};async function $n(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=X(n),c=se(n),a=K(n)==="y",l=["left","top"].includes(s)?-1:1,u=i&&a?-1:1,d=Y(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof h=="number"&&(p=c==="end"?h*-1:h),a?{x:p*u,y:m*l}:{x:m*l,y:p*u}}const jn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:c}=t,a=await $n(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+a.x,y:i+a.y,data:{...a,placement:s}}}}},Fn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:c={fn:x=>{let{x:v,y}=x;return{x:v,y}}},...a}=Y(e,t),l={x:n,y:o},u=await le(t,a),d=K(X(r)),m=Fe(d);let p=l[m],h=l[d];if(i){const x=m==="y"?"top":"left",v=m==="y"?"bottom":"right",y=p+u[x],C=p-u[v];p=Le(y,p,C)}if(s){const x=d==="y"?"top":"left",v=d==="y"?"bottom":"right",y=h+u[x],C=h-u[v];h=Le(y,h,C)}const g=c.fn({...t,[m]:p,[d]:h});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[m]:i,[d]:s}}}}}},Wn=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:s}=t,{offset:c=0,mainAxis:a=!0,crossAxis:l=!0}=Y(e,t),u={x:n,y:o},d=K(r),m=Fe(d);let p=u[m],h=u[d];const g=Y(c,t),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(a){const C=m==="y"?"height":"width",w=i.reference[m]-i.floating[C]+x.mainAxis,b=i.reference[m]+i.reference[C]-x.mainAxis;p<w?p=w:p>b&&(p=b)}if(l){var v,y;const C=m==="y"?"width":"height",w=["top","left"].includes(X(r)),b=i.reference[d]-i.floating[C]+(w&&((v=s.offset)==null?void 0:v[d])||0)+(w?0:x.crossAxis),A=i.reference[d]+i.reference[C]+(w?0:((y=s.offset)==null?void 0:y[d])||0)-(w?x.crossAxis:0);h<b?h=b:h>A&&(h=A)}return{[m]:p,[d]:h}}}},In=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:s,elements:c}=t,{apply:a=()=>{},...l}=Y(e,t),u=await le(t,l),d=X(r),m=se(r),p=K(r)==="y",{width:h,height:g}=i.floating;let x,v;d==="top"||d==="bottom"?(x=d,v=m===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(v=d,x=m==="end"?"top":"bottom");const y=g-u.top-u.bottom,C=h-u.left-u.right,w=G(g-u[x],y),b=G(h-u[v],C),A=!t.middlewareData.shift;let E=w,O=b;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=C),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(E=y),A&&!m){const T=j(u.left,0),k=j(u.right,0),$=j(u.top,0),D=j(u.bottom,0);p?O=h-2*(T!==0||k!==0?T+k:j(u.left,u.right)):E=g-2*($!==0||D!==0?$+D:j(u.top,u.bottom))}await a({...t,availableWidth:O,availableHeight:E});const M=await s.getDimensions(c.floating);return h!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}};function be(){return typeof window<"u"}function ce(e){return vt(e)?(e.nodeName||"").toLowerCase():"#document"}function F(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function V(e){var t;return(t=(vt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vt(e){return be()?e instanceof Node||e instanceof F(e).Node:!1}function I(e){return be()?e instanceof Element||e instanceof F(e).Element:!1}function z(e){return be()?e instanceof HTMLElement||e instanceof F(e).HTMLElement:!1}function it(e){return!be()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof F(e).ShadowRoot}function fe(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=B(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function Bn(e){return["table","td","th"].includes(ce(e))}function Ce(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Be(e){const t=He(),n=I(e)?B(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Hn(e){let t=Z(e);for(;z(t)&&!oe(t);){if(Be(t))return t;if(Ce(t))return null;t=Z(t)}return null}function He(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function oe(e){return["html","body","#document"].includes(ce(e))}function B(e){return F(e).getComputedStyle(e)}function Ee(e){return I(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Z(e){if(ce(e)==="html")return e;const t=e.assignedSlot||e.parentNode||it(e)&&e.host||V(e);return it(t)?t.host:t}function yt(e){const t=Z(e);return oe(t)?e.ownerDocument?e.ownerDocument.body:e.body:z(t)&&fe(t)?t:yt(t)}function ue(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=yt(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=F(r);if(i){const c=_e(s);return t.concat(s,s.visualViewport||[],fe(r)?r:[],c&&n?ue(c):[])}return t.concat(r,ue(r,[],n))}function _e(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wt(e){const t=B(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=z(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,c=xe(n)!==i||xe(o)!==s;return c&&(n=i,o=s),{width:n,height:o,$:c}}function ze(e){return I(e)?e:e.contextElement}function te(e){const t=ze(e);if(!z(t))return q(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=wt(t);let s=(i?xe(n.width):n.width)/o,c=(i?xe(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const zn=q(0);function bt(e){const t=F(e);return!He()||!t.visualViewport?zn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Vn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==F(e)?!1:t}function J(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=ze(e);let s=q(1);t&&(o?I(o)&&(s=te(o)):s=te(e));const c=Vn(i,n,o)?bt(i):q(0);let a=(r.left+c.x)/s.x,l=(r.top+c.y)/s.y,u=r.width/s.x,d=r.height/s.y;if(i){const m=F(i),p=o&&I(o)?F(o):o;let h=m,g=_e(h);for(;g&&o&&p!==h;){const x=te(g),v=g.getBoundingClientRect(),y=B(g),C=v.left+(g.clientLeft+parseFloat(y.paddingLeft))*x.x,w=v.top+(g.clientTop+parseFloat(y.paddingTop))*x.y;a*=x.x,l*=x.y,u*=x.x,d*=x.y,a+=C,l+=w,h=F(g),g=_e(h)}}return ye({width:u,height:d,x:a,y:l})}function Un(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=V(o),c=t?Ce(t.floating):!1;if(o===s||c&&i)return n;let a={scrollLeft:0,scrollTop:0},l=q(1);const u=q(0),d=z(o);if((d||!d&&!i)&&((ce(o)!=="body"||fe(s))&&(a=Ee(o)),z(o))){const m=J(o);l=te(o),u.x=m.x+o.clientLeft,u.y=m.y+o.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+u.x,y:n.y*l.y-a.scrollTop*l.y+u.y}}function Yn(e){return Array.from(e.getClientRects())}function ke(e,t){const n=Ee(e).scrollLeft;return t?t.left+n:J(V(e)).left+n}function Xn(e){const t=V(e),n=Ee(e),o=e.ownerDocument.body,r=j(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=j(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+ke(e);const c=-n.scrollTop;return B(o).direction==="rtl"&&(s+=j(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:c}}function Gn(e,t){const n=F(e),o=V(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,c=0,a=0;if(r){i=r.width,s=r.height;const l=He();(!l||l&&t==="fixed")&&(c=r.offsetLeft,a=r.offsetTop)}return{width:i,height:s,x:c,y:a}}function qn(e,t){const n=J(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=z(e)?te(e):q(1),s=e.clientWidth*i.x,c=e.clientHeight*i.y,a=r*i.x,l=o*i.y;return{width:s,height:c,x:a,y:l}}function st(e,t,n){let o;if(t==="viewport")o=Gn(e,n);else if(t==="document")o=Xn(V(e));else if(I(t))o=qn(t,n);else{const r=bt(e);o={...t,x:t.x-r.x,y:t.y-r.y}}return ye(o)}function Ct(e,t){const n=Z(e);return n===t||!I(n)||oe(n)?!1:B(n).position==="fixed"||Ct(n,t)}function Kn(e,t){const n=t.get(e);if(n)return n;let o=ue(e,[],!1).filter(c=>I(c)&&ce(c)!=="body"),r=null;const i=B(e).position==="fixed";let s=i?Z(e):e;for(;I(s)&&!oe(s);){const c=B(s),a=Be(s);!a&&c.position==="fixed"&&(r=null),(i?!a&&!r:!a&&c.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||fe(s)&&!a&&Ct(e,s))?o=o.filter(u=>u!==s):r=c,s=Z(s)}return t.set(e,o),o}function Zn(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?Ce(t)?[]:Kn(t,this._c):[].concat(n),o],c=s[0],a=s.reduce((l,u)=>{const d=st(t,u,r);return l.top=j(d.top,l.top),l.right=G(d.right,l.right),l.bottom=G(d.bottom,l.bottom),l.left=j(d.left,l.left),l},st(t,c,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Jn(e){const{width:t,height:n}=wt(e);return{width:t,height:n}}function Qn(e,t,n){const o=z(t),r=V(t),i=n==="fixed",s=J(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const a=q(0);if(o||!o&&!i)if((ce(t)!=="body"||fe(r))&&(c=Ee(t)),o){const p=J(t,!0,i,t);a.x=p.x+t.clientLeft,a.y=p.y+t.clientTop}else r&&(a.x=ke(r));let l=0,u=0;if(r&&!o&&!i){const p=r.getBoundingClientRect();u=p.top+c.scrollTop,l=p.left+c.scrollLeft-ke(r,p)}const d=s.left+c.scrollLeft-a.x-l,m=s.top+c.scrollTop-a.y-u;return{x:d,y:m,width:s.width,height:s.height}}function Te(e){return B(e).position==="static"}function ct(e,t){if(!z(e)||B(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return V(e)===n&&(n=n.ownerDocument.body),n}function Et(e,t){const n=F(e);if(Ce(e))return n;if(!z(e)){let r=Z(e);for(;r&&!oe(r);){if(I(r)&&!Te(r))return r;r=Z(r)}return n}let o=ct(e,t);for(;o&&Bn(o)&&Te(o);)o=ct(o,t);return o&&oe(o)&&Te(o)&&!Be(o)?n:o||Hn(e)||n}const eo=async function(e){const t=this.getOffsetParent||Et,n=this.getDimensions,o=await n(e.floating);return{reference:Qn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function to(e){return B(e).direction==="rtl"}const no={convertOffsetParentRelativeRectToViewportRelativeRect:Un,getDocumentElement:V,getClippingRect:Zn,getOffsetParent:Et,getElementRects:eo,getClientRects:Yn,getDimensions:Jn,getScale:te,isElement:I,isRTL:to};function oo(e,t){let n=null,o;const r=V(e);function i(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),i();const{left:l,top:u,width:d,height:m}=e.getBoundingClientRect();if(c||t(),!d||!m)return;const p=me(u),h=me(r.clientWidth-(l+d)),g=me(r.clientHeight-(u+m)),x=me(l),y={rootMargin:-p+"px "+-h+"px "+-g+"px "+-x+"px",threshold:j(0,G(1,a))||1};let C=!0;function w(b){const A=b[0].intersectionRatio;if(A!==a){if(!C)return s();A?s(!1,A):o=setTimeout(()=>{s(!1,1e-7)},1e3)}C=!1}try{n=new IntersectionObserver(w,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(w,y)}n.observe(e)}return s(!0),i}function ro(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,l=ze(e),u=r||i?[...l?ue(l):[],...ue(t)]:[];u.forEach(v=>{r&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=l&&c?oo(l,n):null;let m=-1,p=null;s&&(p=new ResizeObserver(v=>{let[y]=v;y&&y.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=p)==null||C.observe(t)})),n()}),l&&!a&&p.observe(l),p.observe(t));let h,g=a?J(e):null;a&&x();function x(){const v=J(e);g&&(v.x!==g.x||v.y!==g.y||v.width!==g.width||v.height!==g.height)&&n(),g=v,h=requestAnimationFrame(x)}return n(),()=>{var v;u.forEach(y=>{r&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),d==null||d(),(v=p)==null||v.disconnect(),p=null,a&&cancelAnimationFrame(h)}}const io=jn,so=Fn,co=_n,ao=In,lo=kn,at=Mn,uo=Wn,fo=(e,t,n)=>{const o=new Map,r={platform:no,...n},i={...r.platform,_c:o};return Ln(e,t,{...r,platform:i})};var ge=typeof document<"u"?f.useLayoutEffect:f.useEffect;function we(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!we(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!we(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Pt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lt(e,t){const n=Pt(e);return Math.round(t*n)/n}function Se(e){const t=f.useRef(e);return ge(()=>{t.current=e}),t}function po(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:a,open:l}=e,[u,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=f.useState(o);we(m,o)||p(o);const[h,g]=f.useState(null),[x,v]=f.useState(null),y=f.useCallback(R=>{R!==A.current&&(A.current=R,g(R))},[]),C=f.useCallback(R=>{R!==E.current&&(E.current=R,v(R))},[]),w=i||h,b=s||x,A=f.useRef(null),E=f.useRef(null),O=f.useRef(u),M=a!=null,T=Se(a),k=Se(r),$=Se(l),D=f.useCallback(()=>{if(!A.current||!E.current)return;const R={placement:t,strategy:n,middleware:m};k.current&&(R.platform=k.current),fo(A.current,E.current,R).then(_=>{const H={..._,isPositioned:$.current!==!1};S.current&&!we(O.current,H)&&(O.current=H,ut.flushSync(()=>{d(H)}))})},[m,t,n,k,$]);ge(()=>{l===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(R=>({...R,isPositioned:!1})))},[l]);const S=f.useRef(!1);ge(()=>(S.current=!0,()=>{S.current=!1}),[]),ge(()=>{if(w&&(A.current=w),b&&(E.current=b),w&&b){if(T.current)return T.current(w,b,D);D()}},[w,b,D,T,M]);const W=f.useMemo(()=>({reference:A,floating:E,setReference:y,setFloating:C}),[y,C]),N=f.useMemo(()=>({reference:w,floating:b}),[w,b]),L=f.useMemo(()=>{const R={position:n,left:0,top:0};if(!N.floating)return R;const _=lt(N.floating,u.x),H=lt(N.floating,u.y);return c?{...R,transform:"translate("+_+"px, "+H+"px)",...Pt(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:H}},[n,c,N.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:D,refs:W,elements:N,floatingStyles:L}),[u,D,W,N,L])}const mo=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?at({element:o.current,padding:r}).fn(n):{}:o?at({element:o,padding:r}).fn(n):{}}}},ho=(e,t)=>({...io(e),options:[e,t]}),go=(e,t)=>({...so(e),options:[e,t]}),xo=(e,t)=>({...uo(e),options:[e,t]}),vo=(e,t)=>({...co(e),options:[e,t]}),yo=(e,t)=>({...ao(e),options:[e,t]}),wo=(e,t)=>({...lo(e),options:[e,t]}),bo=(e,t)=>({...mo(e),options:[e,t]});var Co="Arrow",At=f.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...i}=e;return P.jsx(ee.svg,{...i,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:P.jsx("polygon",{points:"0,0 30,0 15,10"})})});At.displayName=Co;var Eo=At;function Po(e,t=[]){let n=[];function o(i,s){const c=f.createContext(s),a=n.length;n=[...n,s];function l(d){const{scope:m,children:p,...h}=d,g=(m==null?void 0:m[e][a])||c,x=f.useMemo(()=>h,Object.values(h));return P.jsx(g.Provider,{value:x,children:p})}function u(d,m){const p=(m==null?void 0:m[e][a])||c,h=f.useContext(p);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return l.displayName=i+"Provider",[l,u]}const r=()=>{const i=n.map(s=>f.createContext(s));return function(c){const a=(c==null?void 0:c[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...c,[e]:a}}),[c,a])}};return r.scopeName=e,[o,Ao(r,...t)]}function Ao(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((c,{useScope:a,scopeName:l})=>{const d=a(i)[`__scope${l}`];return{...c,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Ro(e){const[t,n]=f.useState(void 0);return ne(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let s,c;if("borderBoxSize"in i){const a=i.borderBoxSize,l=Array.isArray(a)?a[0]:a;s=l.inlineSize,c=l.blockSize}else s=e.offsetWidth,c=e.offsetHeight;n({width:s,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var Ve="Popper",[Rt,Ot]=Po(Ve),[Oo,Tt]=Rt(Ve),St=e=>{const{__scopePopper:t,children:n}=e,[o,r]=f.useState(null);return P.jsx(Oo,{scope:t,anchor:o,onAnchorChange:r,children:n})};St.displayName=Ve;var Dt="PopperAnchor",Nt=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,i=Tt(Dt,n),s=f.useRef(null),c=Q(t,s);return f.useEffect(()=>{i.onAnchorChange((o==null?void 0:o.current)||s.current)}),o?null:P.jsx(ee.div,{...r,ref:c})});Nt.displayName=Dt;var Ue="PopperContent",[To,So]=Rt(Ue),Lt=f.forwardRef((e,t)=>{var Xe,Ge,qe,Ke,Ze,Je;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:i="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:a=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:h,...g}=e,x=Tt(Ue,n),[v,y]=f.useState(null),C=Q(t,ae=>y(ae)),[w,b]=f.useState(null),A=Ro(w),E=(A==null?void 0:A.width)??0,O=(A==null?void 0:A.height)??0,M=o+(i!=="center"?"-"+i:""),T=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},k=Array.isArray(l)?l:[l],$=k.length>0,D={padding:T,boundary:k.filter(No),altBoundary:$},{refs:S,floatingStyles:W,placement:N,isPositioned:L,middlewareData:R}=po({strategy:"fixed",placement:M,whileElementsMounted:(...ae)=>ro(...ae,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[ho({mainAxis:r+O,alignmentAxis:s}),a&&go({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?xo():void 0,...D}),a&&vo({...D}),yo({...D,apply:({elements:ae,rects:Qe,availableWidth:Jt,availableHeight:Qt})=>{const{width:en,height:tn}=Qe.reference,pe=ae.floating.style;pe.setProperty("--radix-popper-available-width",`${Jt}px`),pe.setProperty("--radix-popper-available-height",`${Qt}px`),pe.setProperty("--radix-popper-anchor-width",`${en}px`),pe.setProperty("--radix-popper-anchor-height",`${tn}px`)}}),w&&bo({element:w,padding:c}),Lo({arrowWidth:E,arrowHeight:O}),m&&wo({strategy:"referenceHidden",...D})]}),[_,H]=kt(N),de=ie(h);ne(()=>{L&&(de==null||de())},[L,de]);const Xt=(Xe=R.arrow)==null?void 0:Xe.x,Gt=(Ge=R.arrow)==null?void 0:Ge.y,qt=((qe=R.arrow)==null?void 0:qe.centerOffset)!==0,[Kt,Zt]=f.useState();return ne(()=>{v&&Zt(window.getComputedStyle(v).zIndex)},[v]),P.jsx("div",{ref:S.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:L?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Kt,"--radix-popper-transform-origin":[(Ke=R.transformOrigin)==null?void 0:Ke.x,(Ze=R.transformOrigin)==null?void 0:Ze.y].join(" "),...((Je=R.hide)==null?void 0:Je.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:P.jsx(To,{scope:n,placedSide:_,onArrowChange:b,arrowX:Xt,arrowY:Gt,shouldHideArrow:qt,children:P.jsx(ee.div,{"data-side":_,"data-align":H,...g,ref:C,style:{...g.style,animation:L?void 0:"none"}})})})});Lt.displayName=Ue;var Mt="PopperArrow",Do={top:"bottom",right:"left",bottom:"top",left:"right"},_t=f.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,i=So(Mt,o),s=Do[i.placedSide];return P.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:P.jsx(Eo,{...r,ref:n,style:{...r.style,display:"block"}})})});_t.displayName=Mt;function No(e){return e!==null}var Lo=e=>({name:"transformOrigin",options:e,fn(t){var x,v,y;const{placement:n,rects:o,middlewareData:r}=t,s=((x=r.arrow)==null?void 0:x.centerOffset)!==0,c=s?0:e.arrowWidth,a=s?0:e.arrowHeight,[l,u]=kt(n),d={start:"0%",center:"50%",end:"100%"}[u],m=(((v=r.arrow)==null?void 0:v.x)??0)+c/2,p=(((y=r.arrow)==null?void 0:y.y)??0)+a/2;let h="",g="";return l==="bottom"?(h=s?d:`${m}px`,g=`${-a}px`):l==="top"?(h=s?d:`${m}px`,g=`${o.floating.height+a}px`):l==="right"?(h=`${-a}px`,g=s?d:`${p}px`):l==="left"&&(h=`${o.floating.width+a}px`,g=s?d:`${p}px`),{data:{x:h,y:g}}}});function kt(e){const[t,n="center"]=e.split("-");return[t,n]}var Mo=St,_o=Nt,ko=Lt,$o=_t;function jo(e,t){return f.useReducer((n,o)=>t[n][o]??n,e)}var $t=e=>{const{present:t,children:n}=e,o=Fo(t),r=typeof n=="function"?n({present:o.isPresent}):f.Children.only(n),i=Q(o.ref,Wo(r));return typeof n=="function"||o.isPresent?f.cloneElement(r,{ref:i}):null};$t.displayName="Presence";function Fo(e){const[t,n]=f.useState(),o=f.useRef({}),r=f.useRef(e),i=f.useRef("none"),s=e?"mounted":"unmounted",[c,a]=jo(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const l=he(o.current);i.current=c==="mounted"?l:"none"},[c]),ne(()=>{const l=o.current,u=r.current;if(u!==e){const m=i.current,p=he(l);e?a("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?a("UNMOUNT"):a(u&&m!==p?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,a]),ne(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=p=>{const g=he(o.current).includes(p.animationName);if(p.target===t&&g&&(a("ANIMATION_END"),!r.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},m=p=>{p.target===t&&(i.current=he(o.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:f.useCallback(l=>{l&&(o.current=getComputedStyle(l)),n(l)},[])}}function he(e){return(e==null?void 0:e.animationName)||"none"}function Wo(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Io({prop:e,defaultProp:t,onChange:n=()=>{}}){const[o,r]=Bo({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:o,c=ie(n),a=f.useCallback(l=>{if(i){const d=typeof l=="function"?l(e):l;d!==e&&c(d)}else r(l)},[i,e,r,c]);return[s,a]}function Bo({defaultProp:e,onChange:t}){const n=f.useState(e),[o]=n,r=f.useRef(o),i=ie(t);return f.useEffect(()=>{r.current!==o&&(i(o),r.current=o)},[o,r,i]),n}var Ho="VisuallyHidden",jt=f.forwardRef((e,t)=>P.jsx(ee.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));jt.displayName=Ho;var zo=jt,[Pe,mr]=sn("Tooltip",[Ot]),Ae=Ot(),Ft="TooltipProvider",Vo=700,$e="tooltip.open",[Uo,Ye]=Pe(Ft),Wt=e=>{const{__scopeTooltip:t,delayDuration:n=Vo,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:i}=e,[s,c]=f.useState(!0),a=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),P.jsx(Uo,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(l.current),c(!1)},[]),onClose:f.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>c(!0),o)},[o]),isPointerInTransitRef:a,onPointerInTransitChange:f.useCallback(u=>{a.current=u},[]),disableHoverableContent:r,children:i})};Wt.displayName=Ft;var Re="Tooltip",[Yo,Oe]=Pe(Re),It=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:c}=e,a=Ye(Re,e.__scopeTooltip),l=Ae(t),[u,d]=f.useState(null),m=En(),p=f.useRef(0),h=s??a.disableHoverableContent,g=c??a.delayDuration,x=f.useRef(!1),[v=!1,y]=Io({prop:o,defaultProp:r,onChange:E=>{E?(a.onOpen(),document.dispatchEvent(new CustomEvent($e))):a.onClose(),i==null||i(E)}}),C=f.useMemo(()=>v?x.current?"delayed-open":"instant-open":"closed",[v]),w=f.useCallback(()=>{window.clearTimeout(p.current),x.current=!1,y(!0)},[y]),b=f.useCallback(()=>{window.clearTimeout(p.current),y(!1)},[y]),A=f.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x.current=!0,y(!0)},g)},[g,y]);return f.useEffect(()=>()=>window.clearTimeout(p.current),[]),P.jsx(Mo,{...l,children:P.jsx(Yo,{scope:t,contentId:m,open:v,stateAttribute:C,trigger:u,onTriggerChange:d,onTriggerEnter:f.useCallback(()=>{a.isOpenDelayed?A():w()},[a.isOpenDelayed,A,w]),onTriggerLeave:f.useCallback(()=>{h?b():window.clearTimeout(p.current)},[b,h]),onOpen:w,onClose:b,disableHoverableContent:h,children:n})})};It.displayName=Re;var je="TooltipTrigger",Bt=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Oe(je,n),i=Ye(je,n),s=Ae(n),c=f.useRef(null),a=Q(t,c,r.onTriggerChange),l=f.useRef(!1),u=f.useRef(!1),d=f.useCallback(()=>l.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),P.jsx(_o,{asChild:!0,...s,children:P.jsx(ee.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:a,onPointerMove:U(e.onPointerMove,m=>{m.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(r.onTriggerEnter(),u.current=!0)}),onPointerLeave:U(e.onPointerLeave,()=>{r.onTriggerLeave(),u.current=!1}),onPointerDown:U(e.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:U(e.onFocus,()=>{l.current||r.onOpen()}),onBlur:U(e.onBlur,r.onClose),onClick:U(e.onClick,r.onClose)})})});Bt.displayName=je;var Xo="TooltipPortal",[hr,Go]=Pe(Xo,{forceMount:void 0}),re="TooltipContent",Ht=f.forwardRef((e,t)=>{const n=Go(re,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...i}=e,s=Oe(re,e.__scopeTooltip);return P.jsx($t,{present:o||s.open,children:s.disableHoverableContent?P.jsx(zt,{side:r,...i,ref:t}):P.jsx(qo,{side:r,...i,ref:t})})}),qo=f.forwardRef((e,t)=>{const n=Oe(re,e.__scopeTooltip),o=Ye(re,e.__scopeTooltip),r=f.useRef(null),i=Q(t,r),[s,c]=f.useState(null),{trigger:a,onClose:l}=n,u=r.current,{onPointerInTransitChange:d}=o,m=f.useCallback(()=>{c(null),d(!1)},[d]),p=f.useCallback((h,g)=>{const x=h.currentTarget,v={x:h.clientX,y:h.clientY},y=Qo(v,x.getBoundingClientRect()),C=er(v,y),w=tr(g.getBoundingClientRect()),b=or([...C,...w]);c(b),d(!0)},[d]);return f.useEffect(()=>()=>m(),[m]),f.useEffect(()=>{if(a&&u){const h=x=>p(x,u),g=x=>p(x,a);return a.addEventListener("pointerleave",h),u.addEventListener("pointerleave",g),()=>{a.removeEventListener("pointerleave",h),u.removeEventListener("pointerleave",g)}}},[a,u,p,m]),f.useEffect(()=>{if(s){const h=g=>{const x=g.target,v={x:g.clientX,y:g.clientY},y=(a==null?void 0:a.contains(x))||(u==null?void 0:u.contains(x)),C=!nr(v,s);y?m():C&&(m(),l())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[a,u,s,l,m]),P.jsx(zt,{...e,ref:i})}),[Ko,Zo]=Pe(Re,{isInside:!1}),zt=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:i,onPointerDownOutside:s,...c}=e,a=Oe(re,n),l=Ae(n),{onClose:u}=a;return f.useEffect(()=>(document.addEventListener($e,u),()=>document.removeEventListener($e,u)),[u]),f.useEffect(()=>{if(a.trigger){const d=m=>{const p=m.target;p!=null&&p.contains(a.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[a.trigger,u]),P.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:P.jsxs(ko,{"data-state":a.stateAttribute,...l,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[P.jsx(pt,{children:o}),P.jsx(Ko,{scope:n,isInside:!0,children:P.jsx(zo,{id:a.contentId,role:"tooltip",children:r||o})})]})})});Ht.displayName=re;var Vt="TooltipArrow",Jo=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Ae(n);return Zo(Vt,n).isInside?null:P.jsx($o,{...r,...o,ref:t})});Jo.displayName=Vt;function Qo(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function er(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function tr(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function nr(e,t){const{x:n,y:o}=e;let r=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const c=t[i].x,a=t[i].y,l=t[s].x,u=t[s].y;a>o!=u>o&&n<(l-c)*(o-a)/(u-a)+c&&(r=!r)}return r}function or(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),rr(t)}function rr(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const r=e[o];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var ir=Wt,sr=It,cr=Bt,Ut=Ht;const gr=ir,ar=sr,lr=cr;function Yt({className:e,sideOffset:t=4,ref:n,...o}){return P.jsx(Ut,{ref:n,sideOffset:t,className:on("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}Yt.displayName=Ut.displayName;function xr({content:e,children:t}){return e?P.jsxs(ar,{children:[P.jsx(lr,{asChild:!0,children:t}),P.jsx(Yt,{children:e})]}):t}export{_o as A,ko as C,ht as D,ee as P,Mo as R,xr as S,gr as T,jt as V,ar as a,lr as b,Yt as c,sn as d,En as e,U as f,$t as g,Q as h,ne as i,Ot as j,dt as k,$o as l,pr as m,ie as n,Io as u};
2
+ //# sourceMappingURL=tooltip-DT9kZxPw.js.map