@cartanova/qgrid-cli 2.11.1 → 2.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/README.ko.md +1 -1
  2. package/README.md +1 -1
  3. package/bundle/dist/_virtual/{_@oxc-project_runtime@0.140.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/decorate.js +1 -1
  4. package/bundle/dist/_virtual/{_@oxc-project_runtime@0.140.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/decorateMetadata.js +1 -1
  5. package/bundle/dist/_virtual/_rolldown/runtime.js +2 -2
  6. package/bundle/dist/application/monit/monit.frame.js +2 -2
  7. package/bundle/dist/application/qgrid/qgrid-response-format.js +9 -1
  8. package/bundle/dist/application/qgrid/qgrid-run-lifecycle.js +30 -6
  9. package/bundle/dist/application/qgrid/qgrid.dispatcher.js +7 -4
  10. package/bundle/dist/application/qgrid/qgrid.frame.js +30 -9
  11. package/bundle/dist/application/qgrid/qgrid.types.js +8 -8
  12. package/bundle/dist/application/qgrid/token-death.js +3 -2
  13. package/bundle/dist/application/qgrid/token-subscriber.js +2 -2
  14. package/bundle/dist/application/qgrid/token-window-keepalive.js +2 -2
  15. package/bundle/dist/application/qgrid/tool-emulation-schema.js +5 -3
  16. package/bundle/dist/application/qgrid/tool-emulation.js +2 -2
  17. package/bundle/dist/application/request-log/request-log.model.js +13 -7
  18. package/bundle/dist/application/request-log-step/request-log-step.model.js +11 -7
  19. package/bundle/dist/application/setting/setting.model.js +11 -7
  20. package/bundle/dist/application/token/token.model.js +15 -11
  21. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/2020.js +1 -1
  22. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js +1 -1
  23. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js +1 -1
  24. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/scope.js +1 -1
  25. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/errors.js +1 -1
  26. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/index.js +1 -1
  27. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/names.js +1 -1
  28. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/ref_error.js +1 -1
  29. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/resolve.js +7 -5
  30. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/rules.js +1 -1
  31. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/util.js +1 -1
  32. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/applicability.js +1 -1
  33. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/boolSchema.js +1 -1
  34. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/dataType.js +1 -1
  35. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/defaults.js +1 -1
  36. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/index.js +1 -1
  37. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/keyword.js +1 -1
  38. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/subschema.js +1 -1
  39. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/core.js +1 -1
  40. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/data.js +1 -1
  41. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +1 -1
  42. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.js +1 -1
  43. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.js +1 -1
  44. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.js +1 -1
  45. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.js +1 -1
  46. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.js +1 -1
  47. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.js +1 -1
  48. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.js +1 -1
  49. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/schema.js +1 -1
  50. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js +1 -1
  51. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js +1 -1
  52. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js +1 -1
  53. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/validation_error.js +1 -1
  54. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +1 -1
  55. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +1 -1
  56. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js +1 -1
  57. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +1 -1
  58. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js +1 -1
  59. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +1 -1
  60. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +1 -1
  61. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js +1 -1
  62. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js +1 -1
  63. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js +1 -1
  64. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js +1 -1
  65. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js +1 -1
  66. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +1 -1
  67. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +1 -1
  68. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +1 -1
  69. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js +1 -1
  70. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +1 -1
  71. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +1 -1
  72. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/code.js +1 -1
  73. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js +1 -1
  74. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js +1 -1
  75. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js +15 -11
  76. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js +1 -1
  77. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js +1 -1
  78. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft2020.js +1 -1
  79. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +1 -1
  80. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +1 -1
  81. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/index.js +1 -1
  82. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +1 -1
  83. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +1 -1
  84. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js +1 -1
  85. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js +1 -1
  86. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js +1 -1
  87. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/next.js +1 -1
  88. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/index.js +1 -1
  89. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +1 -1
  90. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +1 -1
  91. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js +1 -1
  92. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +1 -1
  93. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js +1 -1
  94. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js +1 -1
  95. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitContains.js +1 -1
  96. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js +1 -1
  97. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js +1 -1
  98. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +1 -1
  99. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +1 -1
  100. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +1 -1
  101. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js +1 -1
  102. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js +1 -1
  103. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +1 -1
  104. package/bundle/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +1 -1
  105. package/bundle/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js +18 -12
  106. package/bundle/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js +1 -1
  107. package/bundle/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js +16 -13
  108. package/bundle/dist/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js +1 -1
  109. package/bundle/dist/sonamu.config.js +11 -11
  110. package/bundle/dist/startup-migrations.js +1 -1
  111. package/bundle/dist/utils/providers/anthropic/anthropic-dispatcher.js +9 -3
  112. package/bundle/dist/utils/providers/anthropic/anthropic-thinking.js +5 -2
  113. package/bundle/dist/utils/providers/anthropic/claude-session.js +10 -2
  114. package/bundle/dist/utils/providers/anthropic/stream-json-adapter.js +9 -7
  115. package/bundle/dist/utils/providers/common/model-cost.js +7 -5
  116. package/bundle/dist/utils/providers/common/schema-validation.js +3 -3
  117. package/bundle/dist/utils/providers/grok/grok-backend-protocol.js +1 -1
  118. package/bundle/dist/utils/providers/grok/grok-constants.js +1 -1
  119. package/bundle/dist/utils/providers/grok/grok-dispatcher.js +47 -14
  120. package/bundle/dist/utils/providers/grok/grok-media-client.js +4 -4
  121. package/bundle/dist/utils/providers/grok/grok-oauth.js +2 -2
  122. package/bundle/dist/utils/providers/grok/grok-types.js +2 -2
  123. package/bundle/dist/utils/providers/openai/openai-dispatcher.js +16 -8
  124. package/bundle/dist/utils/providers/openai/openai-image-generation.js +4 -4
  125. package/bundle/src/application/qgrid/qgrid-response-format.ts +9 -0
  126. package/bundle/src/application/qgrid/qgrid-run-lifecycle.test.ts +63 -0
  127. package/bundle/src/application/qgrid/qgrid-run-lifecycle.ts +49 -7
  128. package/bundle/src/application/qgrid/qgrid.dispatcher.ts +6 -0
  129. package/bundle/src/application/qgrid/qgrid.frame.test.ts +12 -4
  130. package/bundle/src/application/qgrid/qgrid.frame.ts +39 -3
  131. package/bundle/src/application/qgrid/qgrid.types.ts +5 -5
  132. package/bundle/src/application/request-log/request-log.model.ts +12 -1
  133. package/bundle/src/sonamu.config.ts +14 -14
  134. package/bundle/src/utils/providers/anthropic/anthropic-dispatcher.ts +2 -0
  135. package/bundle/src/utils/providers/anthropic/claude-session.ts +15 -1
  136. package/bundle/src/utils/providers/common/model-cost.ts +8 -6
  137. package/bundle/src/utils/providers/common/provider-dispatcher.ts +10 -0
  138. package/bundle/src/utils/providers/grok/grok-backend-protocol.ts +6 -1
  139. package/bundle/src/utils/providers/grok/grok-constants.ts +7 -8
  140. package/bundle/src/utils/providers/grok/grok-dispatcher.test.ts +74 -3
  141. package/bundle/src/utils/providers/grok/grok-dispatcher.ts +66 -18
  142. package/bundle/src/utils/providers/grok/grok-quota.test.ts +18 -0
  143. package/bundle/src/utils/providers/grok/grok-types.ts +2 -1
  144. package/bundle/src/utils/providers/openai/openai-dispatcher.test.ts +18 -0
  145. package/bundle/src/utils/providers/openai/openai-dispatcher.ts +10 -2
  146. package/bundle/web-dist/client/assets/clsx-DB0hHKMi.js +1 -0
  147. package/bundle/web-dist/client/assets/cost-CZzlCFS2.js +1 -0
  148. package/bundle/web-dist/client/assets/index-DLo1QCw7.css +1 -0
  149. package/bundle/web-dist/client/assets/index-DplV-wqZ.js +104 -0
  150. package/bundle/web-dist/client/assets/logs-st46aRba.js +1 -0
  151. package/bundle/web-dist/client/assets/monit-BMXR2tY2.js +1 -0
  152. package/bundle/web-dist/client/assets/plus-Bab0ACnC.js +1 -0
  153. package/bundle/web-dist/client/assets/refresh-cw-BtYoFHVw.js +1 -0
  154. package/bundle/web-dist/client/assets/request-model-Dl31cZdf.js +1 -0
  155. package/bundle/web-dist/client/assets/rolldown-runtime-XKyaHtl9.js +1 -0
  156. package/bundle/web-dist/client/assets/routes-BWPjgvhg.js +5 -0
  157. package/bundle/web-dist/client/assets/settings-DTXZjDAw.js +1 -0
  158. package/bundle/web-dist/client/assets/show-CdWNFPyS.js +2 -0
  159. package/bundle/web-dist/client/assets/tokens-eA34Gw5f.js +1 -0
  160. package/bundle/web-dist/client/assets/use-oauth-login-flow-CcUdLsa7.js +1 -0
  161. package/bundle/web-dist/client/assets/use-update-token-mutation-D2r5K5Bz.js +1 -0
  162. package/bundle/web-dist/client/assets/vendor-react-8xo7RSum.js +9 -0
  163. package/bundle/web-dist/client/assets/vendor-tanstack-6B86itGS.js +2 -0
  164. package/bundle/web-dist/client/index.html +5 -7
  165. package/bundle/web-dist/server/assets/{logs-B7QmGJq3.js → logs-C0md5rmp.js} +67 -37
  166. package/bundle/web-dist/server/assets/monit-YVvwJuAF.js +479 -0
  167. package/bundle/web-dist/server/assets/plus-z5Hy__3C.js +26 -0
  168. package/bundle/web-dist/server/assets/refresh-cw-CNm0CERy.js +30 -0
  169. package/bundle/web-dist/server/assets/request-model-DIuPZZwu.js +38 -0
  170. package/bundle/web-dist/server/assets/{routes-_Y-PJfgO.js → routes-CjWxvHAO.js} +1745 -1120
  171. package/bundle/web-dist/server/assets/{services.generated-CMJ8AHbO.js → services.generated-CqS8DCjT.js} +11973 -6081
  172. package/bundle/web-dist/server/assets/{settings-JwJKxn2e.js → settings-CXwnKiMG.js} +40 -19
  173. package/bundle/web-dist/server/assets/{show-BEv6z1v_.js → show-G1t8dOEh.js} +274 -213
  174. package/bundle/web-dist/server/assets/{tokens-CNT4mI-f.js → tokens-C4D67FBX.js} +41 -18
  175. package/bundle/web-dist/server/assets/{use-oauth-login-flow-jkAkT3X6.js → use-oauth-login-flow-CFzShQtp.js} +1569 -38
  176. package/bundle/web-dist/server/assets/{use-update-token-mutation-Sm6kh02m.js → use-update-token-mutation-oH0O0n-g.js} +1 -1
  177. package/bundle/web-dist/server/entry-server.generated.js +11641 -5075
  178. package/dist/cli.js +20 -11
  179. package/package.json +24 -24
  180. package/skills/qgrid/references/ai-sdk-provider-contract.md +5 -5
  181. package/skills/qgrid/references/cli-env-and-server-boot.md +4 -3
  182. package/skills/qgrid/references/decision-rationale.md +5 -1
  183. package/skills/qgrid/references/grok-runtime.md +7 -1
  184. package/skills/qgrid/references/repo-map.md +2 -0
  185. package/skills/qgrid/references/request-log-run-lifecycle.md +6 -1
  186. package/skills/qgrid/references/tool-calling-and-multiturn.md +2 -2
  187. package/skills/qgrid/references/verification-and-debugging.md +24 -5
  188. package/bundle/web-dist/client/assets/clsx-5XM_pHvN.js +0 -1
  189. package/bundle/web-dist/client/assets/cost-DB3HbU7T.js +0 -1
  190. package/bundle/web-dist/client/assets/index-Be2qCZmI.css +0 -1
  191. package/bundle/web-dist/client/assets/index-C96h3feE.js +0 -32
  192. package/bundle/web-dist/client/assets/logs-DBM6U0QD.js +0 -1
  193. package/bundle/web-dist/client/assets/monit-BBjXa7vB.js +0 -1
  194. package/bundle/web-dist/client/assets/plus-BsQdY7PS.js +0 -1
  195. package/bundle/web-dist/client/assets/preload-helper-DWTEM3RW.js +0 -1
  196. package/bundle/web-dist/client/assets/refresh-cw-D9IUmT23.js +0 -1
  197. package/bundle/web-dist/client/assets/request-model-Bpp_rkK8.js +0 -1
  198. package/bundle/web-dist/client/assets/rolldown-runtime-Dw2cE7zH.js +0 -1
  199. package/bundle/web-dist/client/assets/routes-Crz_PQzi.js +0 -5
  200. package/bundle/web-dist/client/assets/services.generated-B5lc3aIC.js +0 -51
  201. package/bundle/web-dist/client/assets/settings-Cdwm3OBB.js +0 -1
  202. package/bundle/web-dist/client/assets/show-DBUhALT1.js +0 -2
  203. package/bundle/web-dist/client/assets/tokens-CVQAVJTo.js +0 -1
  204. package/bundle/web-dist/client/assets/total-cost-MnfKU8IN.js +0 -1
  205. package/bundle/web-dist/client/assets/use-oauth-login-flow-BfxYI4Oh.js +0 -1
  206. package/bundle/web-dist/client/assets/use-update-token-mutation-qKBC2sn7.js +0 -1
  207. package/bundle/web-dist/client/assets/vendor-react-DH4kUfK2.js +0 -9
  208. package/bundle/web-dist/client/assets/vendor-tanstack-DRPs09ai.js +0 -1
  209. package/bundle/web-dist/server/assets/lazyRouteComponent-AKiHfZWp.js +0 -1983
  210. package/bundle/web-dist/server/assets/monit-DFt7x3bh.js +0 -1652
  211. package/bundle/web-dist/server/assets/plus-DaYQRpBt.js +0 -19
  212. package/bundle/web-dist/server/assets/react-dom-Cv23mm1K.js +0 -335
  213. package/bundle/web-dist/server/assets/refresh-cw-BpXNsAy-.js +0 -23
  214. package/bundle/web-dist/server/assets/request-model-eHE6YbaF.js +0 -31
  215. package/bundle/web-dist/server/assets/total-cost-fTE9Xy82.js +0 -18
  216. /package/bundle/web-dist/server/assets/{clsx-D_N5PN_2.js → clsx-DgIEfj3H.js} +0 -0
  217. /package/bundle/web-dist/server/assets/{cost-BC9yzyA9.js → cost-oNK0T4Jo.js} +0 -0
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n}from"./vendor-react-8xo7RSum.js";import{d as r,u as i}from"./vendor-tanstack-6B86itGS.js";import{i as a,o,r as s,s as c,u as l}from"./index-DplV-wqZ.js";import{i as u,r as d,t as f}from"./cost-CZzlCFS2.js";import{t as p}from"./refresh-cw-BtYoFHVw.js";import{n as m,t as h}from"./request-model-Dl31cZdf.js";var g=e(t()),_=n(),v=(0,g.forwardRef)(({title:e,titleId:t,...n},r)=>(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,_.jsx)(`title`,{id:t,children:e}):null,(0,_.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m15 18l-6-6l6-6`})]})),y=(0,g.forwardRef)(({title:e,titleId:t,...n},r)=>(0,_.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,_.jsx)(`title`,{id:t,children:e}):null,(0,_.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m9 18l6-6l-6-6`})]})),b=50,x=`__unassigned__`;function S(e){let t=new Date(e);return`${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`}function C(e){return e.toLocaleString()}function w(e){let t=Math.round(e/1e3),n=Math.floor(t/60),r=t%60;return n>0?`${n}m ${r}s`:`${r}s`}var T=3e3;function E({status:e,requestedModel:t,servedModel:n,imageCostMethod:r,fallbackCount:i}){if(e===`running`){let i=h({status:e,requestedModel:t,servedModel:n,imageCostMethod:r});return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`span`,{className:`text-xs text-sand-500`,children:i.label}),(0,_.jsx)(`span`,{className:`ml-1 text-[9px] px-1.5 py-0.5 rounded-full bg-blue-100 text-blue-600 font-medium whitespace-nowrap`,children:`실행 중`})]})}let a=h({status:e,requestedModel:t,servedModel:n,imageCostMethod:r}),o=t!==null&&n===null;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`span`,{className:`text-xs text-sand-500`,children:a.label}),o&&(0,_.jsx)(`span`,{className:`ml-1 text-[9px] text-sand-400`,children:`요청`}),(i??0)>0&&(0,_.jsxs)(`span`,{className:`ml-1 text-[9px] text-caution-500`,children:[`×`,i]})]})}function D(e){return e<=0?`—`:e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}var O=[{label:`ID`,align:`left`,width:`w-12`,sortKey:`id`},{label:`Date`,align:`left`,width:`w-20`,sortKey:`created_at`},{label:`Project`,align:`left`,width:`w-20`},{label:`Token`,align:`left`,width:`w-24`},{label:`Model`,align:`left`,width:`w-20`},{label:`Fmt`,align:`left`,width:`w-12`},{label:`TTFT`,align:`right`,width:`w-16`,sortKey:`ttft_ms`},{label:`Duration`,align:`right`,width:`w-20`,sortKey:`duration_ms`},{label:`In`,align:`right`,width:`w-16`,sortKey:`input_tokens`},{label:`Out`,align:`right`,width:`w-20`,sortKey:`output_tokens`},{label:`C.Read`,align:`right`,width:`w-20`,sortKey:`cache_read_tokens`},{label:`C.Write`,align:`right`,width:`w-20`,sortKey:`cache_creation_tokens`},{label:`Hit`,align:`right`,width:`w-14`},{label:`Tools`,align:`right`,width:`w-14`},{label:`$`,align:`right`,width:`w-20`,sortKey:`cost_usd`}];function k({search:e,onSearchChange:t}){let n=r(),s=e.page??1,h=e.token??``,k=e.project??``,A=e.model??``,{data:j}=l.useTokens(`A`),M=(j?.rows??[]).map(e=>e.name).filter(Boolean),{data:ee}=o.useProjectNames(),te=ee?.names??[],{data:N}=o.useModelNames(),P=N?.names??[],F=k===x?{project_name_is_null:!0}:k?{project_name:k}:{},I={};h&&(I.token_name=h),Object.assign(I,F),A&&(I.model_name=A);let L=e.sort??`id-desc`,R=L.lastIndexOf(`-`),z=L.slice(0,R),B=L.slice(R+1)===`asc`?`asc`:`desc`,{data:V,isLoading:H,isError:U,refresh:W,isRefreshing:G}=c.useRequestLogs(`P`,{num:b,page:s,orderBy:L,...I}),{data:K,isError:q,refresh:J}=o.useTotalCost({num:0,page:1,...I}),Y=V?.rows??[],X=V?.total??0,Z=Y.some(e=>e.status===`running`);(0,g.useEffect)(()=>{let e=Z?setInterval(()=>{W(),J()},T):void 0;return()=>clearInterval(e)},[Z,W,J]);let Q=Math.ceil(X/b),$=n=>{t({...e,...n,page:1})};return(0,_.jsxs)(`div`,{className:`panel overflow-hidden`,children:[(0,_.jsxs)(`div`,{className:`panel-header flex items-center gap-2 px-3 py-2.5 flex-wrap sm:gap-3 sm:px-5`,children:[(0,_.jsxs)(`select`,{value:h,onChange:e=>$({token:e.target.value||void 0}),disabled:M.length===0,className:`border border-sand-200/80 rounded-lg px-2.5 py-1.5 text-[11px] text-sand-700 bg-sand-50/50 focus:outline-none focus:border-sienna-300 disabled:text-sand-300 disabled:cursor-not-allowed`,children:[(0,_.jsx)(`option`,{value:``,children:M.length>0?`All Tokens`:`Tokens —`}),M.map(e=>(0,_.jsx)(`option`,{value:e,children:e},e))]}),(0,_.jsxs)(`select`,{value:k,onChange:e=>$({project:e.target.value||void 0}),className:`border border-sand-200/80 rounded-lg px-2.5 py-1.5 text-[11px] text-sand-700 bg-sand-50/50 focus:outline-none focus:border-sienna-300`,children:[(0,_.jsx)(`option`,{value:``,children:`All Projects`}),(0,_.jsx)(`option`,{value:x,children:`(unassigned)`}),te.map(e=>(0,_.jsx)(`option`,{value:e,children:e},e))]}),(0,_.jsxs)(`select`,{value:A,onChange:e=>$({model:e.target.value||void 0}),disabled:P.length===0,className:`border border-sand-200/80 rounded-lg px-2.5 py-1.5 text-[11px] text-sand-700 bg-sand-50/50 focus:outline-none focus:border-sienna-300 disabled:text-sand-300 disabled:cursor-not-allowed`,children:[(0,_.jsx)(`option`,{value:``,children:P.length>0?`All Models`:`Models —`}),P.map(e=>(0,_.jsx)(`option`,{value:e,children:e},e))]}),(0,_.jsx)(`button`,{type:`button`,onClick:()=>void Promise.all([W(),J()]),disabled:G,"aria-label":`Reload`,title:`Reload`,className:`p-1 rounded text-sand-400 hover:text-sand-600 disabled:opacity-30 transition-colors`,children:(0,_.jsx)(p,{className:G?`size-3.5 animate-spin`:`size-3.5`})}),(0,_.jsx)(`div`,{className:`flex-1`}),(0,_.jsxs)(`span`,{className:`text-[11px] text-sand-400`,children:[U||!V?`—`:X,` results`]}),q?(0,_.jsx)(`span`,{role:`alert`,className:`text-[11px] text-danger-500`,children:`Failed to load total cost.`}):(0,_.jsx)(`span`,{className:`text-[11px] tabular-nums font-medium text-sienna-600`,children:K?u(K.usd):`—`})]}),U?(0,_.jsx)(`div`,{role:`alert`,className:`text-danger-500 text-center py-12 text-sm`,children:`Failed to load request logs.`}):H?(0,_.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:5}).map((e,t)=>(0,_.jsx)(`div`,{className:`h-8 bg-sand-100 rounded animate-pulse`},`skel-${t}`))}):Y.length===0?(0,_.jsx)(`div`,{className:`text-sand-400 text-center py-12 text-sm`,children:`No requests yet.`}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`div`,{className:`overflow-x-auto px-3 py-3 sm:px-5`,children:(0,_.jsxs)(`table`,{className:`w-full min-w-[900px] text-[13px]`,children:[(0,_.jsx)(`thead`,{children:(0,_.jsxs)(`tr`,{className:`border-b border-sand-100/60`,children:[O.map(e=>{let t=e.label===`Duration`?`pl-5 pr-3`:e.width?`px-4`:`px-3`,n=e.sortKey===z;return(0,_.jsx)(`th`,{className:`${e.align===`right`?`text-right`:`text-left`} ${e.width??``} ${e.width?`whitespace-nowrap`:``} ${t} py-1.5 text-[10px] uppercase font-medium ${n?`text-sienna-600`:`text-sand-400`}`,children:e.sortKey?(0,_.jsxs)(`button`,{type:`button`,onClick:()=>$({sort:a.parse(`${e.sortKey}-${n&&B===`desc`?`asc`:`desc`}`)}),className:`inline-flex items-center gap-0.5 text-[10px] uppercase font-medium hover:text-sienna-500 transition-colors duration-150 ${e.align===`right`?`justify-end w-full`:``}`,children:[e.label,(0,_.jsx)(`span`,{className:n?``:`text-sand-300`,children:n?B===`desc`?`↓`:`↑`:`↕`})]}):e.label},e.label)}),(0,_.jsx)(`th`,{className:`w-8`,children:(0,_.jsx)(`span`,{className:`sr-only`,children:`Details`})})]})}),(0,_.jsx)(`tbody`,{className:`divide-y divide-sand-100/60`,children:Y.map(e=>(0,_.jsxs)(`tr`,{className:`transition-colors duration-150 hover:bg-sand-100/60 cursor-pointer`,onClick:t=>{t.metaKey||t.ctrlKey?window.open(`/requests/show?id=${e.id}`,`_blank`):n({to:`/requests/show`,search:{id:e.id}})},children:[(0,_.jsx)(`td`,{className:`px-4 py-1.5 whitespace-nowrap`,children:(0,_.jsx)(i,{to:`/requests/show`,search:{id:e.id},onClick:e=>e.stopPropagation(),className:`text-xs text-sand-500 tabular-nums hover:text-sienna-500`,children:e.id})}),(0,_.jsx)(`td`,{className:`px-4 py-1.5 whitespace-nowrap`,children:(0,_.jsx)(`span`,{className:`text-xs text-sand-400 tabular-nums`,children:S(e.created_at)})}),(0,_.jsx)(`td`,{className:`px-4 py-1.5 whitespace-nowrap`,children:(0,_.jsx)(`span`,{className:`text-xs text-sand-600`,children:e.project_name??`—`})}),(0,_.jsx)(`td`,{className:`px-4 py-1.5 whitespace-nowrap`,children:(0,_.jsx)(`span`,{className:`text-xs text-sand-500`,children:e.token_name})}),(0,_.jsxs)(`td`,{className:`px-4 py-1.5 whitespace-nowrap`,children:[(0,_.jsx)(E,{status:e.status,requestedModel:e.requested_model_name,servedModel:e.model_name,imageCostMethod:e.image_cost_method,fallbackCount:e.fallback_count}),e.service_tier===`fast`&&(0,_.jsx)(`span`,{title:`Fast 모드`,className:`ml-1 inline-flex align-middle`,children:(0,_.jsx)(m,{"aria-label":`Fast 모드`,className:`size-3 text-[#1877F2] [&_path]:fill-current`})}),e.response_json_ok===!1&&(0,_.jsx)(`span`,{title:`structured 요청의 응답이 JSON 파싱에 실패했습니다`,className:`ml-1.5 rounded-full bg-caution-400/15 px-1.5 py-0.5 text-[9px] font-semibold text-caution-500`,children:`broken`})]}),(0,_.jsx)(`td`,{className:`px-4 py-1.5 whitespace-nowrap`,children:e.is_image_generation?(0,_.jsx)(`span`,{className:`rounded bg-sage-100 px-1.5 py-0.5 font-mono text-[10px] text-sage-700`,children:`img`}):e.is_structured?(0,_.jsx)(`span`,{className:`rounded bg-sienna-100 px-1.5 py-0.5 font-mono text-[10px] text-sienna-700`,children:`json`}):(0,_.jsx)(`span`,{className:`font-mono text-[10px] text-sand-400`,children:`text`})}),(0,_.jsx)(`td`,{className:`px-4 py-1.5 text-right tabular-nums text-sand-500 whitespace-nowrap`,children:D(e.ttft_ms)}),(0,_.jsx)(`td`,{className:`pl-5 pr-3 py-1.5 text-right tabular-nums text-sand-500 whitespace-nowrap`,children:w(e.duration_ms)}),(0,_.jsx)(`td`,{className:`px-3 py-1.5 text-right tabular-nums text-sand-700`,children:C(e.input_tokens)}),(0,_.jsx)(`td`,{className:`px-3 py-1.5 text-right tabular-nums text-sand-700`,children:C(e.output_tokens)}),(0,_.jsx)(`td`,{className:`px-3 py-1.5 text-right tabular-nums text-sand-700`,children:C(e.cache_read_tokens)}),(0,_.jsx)(`td`,{className:`px-3 py-1.5 text-right tabular-nums text-sand-700`,children:C(e.cache_creation_tokens)}),(0,_.jsx)(`td`,{className:`px-3 py-1.5 text-right tabular-nums text-sand-700`,children:f(e)}),(0,_.jsx)(`td`,{className:`px-3 py-1.5 text-right tabular-nums text-sand-500`,children:e.tool_call_count>0?e.tool_call_count:`—`}),(0,_.jsx)(`td`,{className:`px-3 py-1.5 text-right tabular-nums text-sand-700 whitespace-nowrap`,children:d(e)}),(0,_.jsx)(`td`,{className:`px-2 py-1.5`,children:(0,_.jsx)(y,{className:`size-4 text-sand-400`})})]},e.id))})]})}),Q>1&&(0,_.jsxs)(`div`,{className:`flex items-center justify-center gap-3 px-5 py-2.5 border-t border-sand-100/60`,children:[(0,_.jsx)(`button`,{type:`button`,className:`p-1 rounded text-sand-400 hover:text-sand-600 disabled:opacity-30 transition-colors`,disabled:s===1,onClick:()=>t({...e,page:s-1}),children:(0,_.jsx)(v,{className:`size-4`})}),(0,_.jsxs)(`span`,{className:`text-[11px] text-sand-400 tabular-nums`,children:[s,` / `,Q]}),(0,_.jsx)(`button`,{type:`button`,className:`p-1 rounded text-sand-400 hover:text-sand-600 disabled:opacity-30 transition-colors`,disabled:s===Q,onClick:()=>t({...e,page:s+1}),children:(0,_.jsx)(y,{className:`size-4`})})]})]})]})}function A(){let e=s.useSearch(),t=s.useNavigate();return(0,_.jsx)(`div`,{className:`max-w-[100rem] mx-auto`,children:(0,_.jsx)(k,{search:e,onSearchChange:e=>t({search:e})})})}export{A as component};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n}from"./vendor-react-8xo7RSum.js";import{g as r}from"./vendor-tanstack-6B86itGS.js";import{t as i}from"./clsx-DB0hHKMi.js";import{a,n as o}from"./index-DplV-wqZ.js";import{t as s}from"./cost-CZzlCFS2.js";import{t as c}from"./refresh-cw-BtYoFHVw.js";var l=e(t(),1),u=n(),d=1e3,f=5e3,p=4e3,m=80,h=[],g=class{cursor;epoch;lastKey=0;items=h;inFlightSamples=[];async poll(){let e=await a.monitLogs(this.cursor);return this.merge(e),this.inFlightSamples=S(this.inFlightSamples,e.vitals.openaiInFlight),{items:this.items,processStartedAt:e.processStartedAt,vitals:e.vitals,inFlightSamples:this.inFlightSamples}}nextKey(){return this.lastKey+=1,this.lastKey}merge(e){let t=this.items,n=[];this.epoch!==void 0&&e.processStartedAt!==this.epoch?(t=h,n.push({kind:`restart`,key:this.nextKey(),processStartedAt:e.processStartedAt})):e.dropped>0&&n.push({kind:`dropped`,key:this.nextKey(),count:e.dropped}),this.epoch=e.processStartedAt,this.cursor=e.nextCursor;let r=t.findLast(e=>e.kind===`log`)?.entry.seq;for(let t of e.entries)r!==void 0&&t.seq<=r||n.push({kind:`log`,key:this.nextKey(),entry:t});if(n.length===0)return;let i=[...t,...n];this.items=i.length>p?i.slice(-4e3):i}},_=new Map(Object.entries({trace:0,debug:1,info:2,warning:3,error:4,fatal:5})),v=new Map(Object.entries({trace:`TRC`,debug:`DBG`,info:`INF`,warning:`WRN`,error:`ERR`,fatal:`FTL`})),y=new Intl.DateTimeFormat(`en-GB`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1});function b(e){return y.format(new Date(e))}function x(e){return e.join(`·`)}function S(e,t){return[...e,t].slice(-120)}var C=56,w=14;function T({values:e}){if(e.length<2)return null;let t=C,n=w,r=Math.max(...e,1),i=t/119,a=t-(e.length-1)*i,o=e.map((e,t)=>{let n=a+t*i,o=13-e/r*12;return`${n.toFixed(1)},${o.toFixed(1)}`}).join(` `);return(0,u.jsx)(`svg`,{width:t,height:n,viewBox:`0 0 ${t} ${n}`,className:`shrink-0`,"aria-hidden":`true`,children:(0,u.jsx)(`polyline`,{points:o,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinejoin:`round`,strokeLinecap:`round`,className:`text-sand-300`})})}function E({usedPercent:e,threshold:t,blocked:n}){if(e===null)return null;let r=Math.max(0,Math.min(e,100)),a=n||t!==null&&e>=t;return(0,u.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,u.jsxs)(`span`,{className:`relative inline-block h-[4px] w-9 overflow-hidden rounded-full bg-sand-100`,children:[(0,u.jsx)(`span`,{className:i(`absolute inset-y-0 left-0 rounded-full`,a?`bg-caution-500`:`bg-sand-400`),style:{width:`${r}%`}}),t!==null&&(0,u.jsx)(`span`,{className:`absolute inset-y-0 w-px bg-sand-500`,style:{left:`${Math.min(t,100)}%`}})]}),(0,u.jsxs)(`span`,{className:i(`font-mono text-[10px] tabular-nums`,a?`font-semibold text-caution-500`:`text-sand-500`),children:[Math.round(e),`%`]})]})}function D({search:e,onSearchChange:t}){let[n]=(0,l.useState)(()=>new g),[o,p]=(0,l.useState)(()=>Date.now()),v=r({queryKey:[`Monit`,`monitLogs`],queryFn:()=>n.poll(),refetchInterval:d,retry:!1,structuralSharing:!1}),y=r({...a.monitInfoQueryOptions(),staleTime:1/0}).data,x=v.data,S=x?.items??h,C=x?.vitals,w=x?.processStartedAt,D=r({...a.monitStatsQueryOptions(),refetchInterval:3e4,retry:!1}).data;(0,l.useEffect)(()=>{let e=window.setInterval(()=>p(Date.now()),2e3);return()=>window.clearInterval(e)},[]);let k=S.length>0&&(v.isRefetchError||v.dataUpdatedAt>0&&o-v.dataUpdatedAt>f),A=(0,l.useMemo)(()=>S.filter(t=>{if(t.kind!==`log`)return!0;switch(e.level){case`warn`:return(_.get(t.entry.level)??2)>=3;case`error`:return(_.get(t.entry.level)??2)>=4;default:return!0}}),[S,e.level]),j=(0,l.useRef)(null),[M,N]=(0,l.useState)(!0),P=(0,l.useRef)(!0),F=()=>{let e=j.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<=m;P.current=t,N(t)},I=()=>{let e=j.current;e&&(e.scrollTop=e.scrollHeight)};(0,l.useLayoutEffect)(()=>{let e=j.current;e&&P.current&&A.length>0&&(e.scrollTop=e.scrollHeight)},[A]);let L=v.dataUpdatedAt>0,R=!L&&v.isError;return(0,u.jsxs)(`section`,{className:`panel overflow-hidden`,children:[(0,u.jsxs)(`header`,{className:`panel-header flex min-h-11 flex-wrap items-center gap-x-3 gap-y-2 px-4 py-2 sm:px-5`,children:[(0,u.jsx)(`h2`,{className:`text-[13px] font-semibold tracking-[-0.01em] text-sand-800`,children:`Server logs`}),(0,u.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[11px] font-medium text-sand-700`,children:[(0,u.jsx)(`span`,{className:i(`size-1.5 rounded-full`,k||R?`bg-danger-400`:`bg-sienna-500 motion-safe:animate-pulse`)}),R?`Disconnected`:k?`Stale`:L?`Live`:`…`]}),w!==void 0&&(0,u.jsxs)(`span`,{className:`text-[11px] text-sand-500`,children:[`ephemeral · resets on restart · since `,b(w)]}),(0,u.jsx)(`div`,{className:`ml-auto flex flex-wrap items-center gap-2`,children:(0,u.jsx)(`div`,{className:`segmented-control inline-flex`,role:`tablist`,"aria-label":`Log filter`,children:[{value:`all`,label:`All`},{value:`warn`,label:`Warn+`},{value:`error`,label:`Err+`}].map(n=>(0,u.jsx)(`button`,{type:`button`,"data-active":e.level===n.value,onClick:()=>t({...e,level:n.value}),className:`rounded-[6px] px-2.5 py-1 text-[11px] font-medium text-sand-500 transition-colors hover:text-sand-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sienna-300 data-[active=true]:text-sand-900`,children:n.label},n.value))})})]}),y&&(0,u.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-1 border-b border-sand-100 bg-sand-50/60 px-4 py-2 text-[11px] text-sand-600 sm:px-5`,children:[(0,u.jsxs)(`span`,{children:[`server `,(0,u.jsx)(`span`,{className:`font-mono text-sand-800`,children:y.serverUrl})]}),(0,u.jsxs)(`span`,{children:[`db`,` `,(0,u.jsxs)(`span`,{className:`font-mono text-sand-800`,children:[y.dbHost,`/`,y.dbName]})]}),(0,u.jsxs)(`span`,{children:[`openai transport`,` `,(0,u.jsx)(`span`,{className:`font-mono text-sand-800`,children:y.openai.transport})]}),C&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`openai in-flight`,` `,(0,u.jsx)(`span`,{className:`font-mono text-sand-800`,children:C.openaiInFlight}),(0,u.jsx)(T,{values:x?.inFlightSamples??[]})]}),C.anthropicTokenCount>0&&(0,u.jsxs)(`span`,{children:[`anthropic running`,` `,(0,u.jsx)(`span`,{className:`font-mono text-sand-800`,children:C.anthropicInFlight})]})]}),D?.providers.map(e=>(0,u.jsxs)(`span`,{className:`text-sand-500`,children:[`1h `,e.provider,` `,(0,u.jsx)(`span`,{className:`font-mono text-sand-700`,children:e.requests}),` req`,e.errors>0&&(0,u.jsxs)(u.Fragment,{children:[` · `,(0,u.jsx)(`span`,{className:`font-mono font-semibold text-caution-500`,children:e.errors}),` err`]}),` · hit `,(0,u.jsx)(`span`,{className:`font-mono text-sand-700`,children:s({input_tokens:e.inputTokens,cache_read_tokens:e.cacheReadTokens})})]},e.provider))]}),C&&(C.openaiQuotaByToken.length>0||C.anthropicTokenNames.length>0)&&(0,u.jsxs)(`div`,{className:`space-y-1.5 border-b border-sand-100 px-4 py-2.5 sm:px-5`,children:[C.openaiQuotaByToken.length>0&&(0,u.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,u.jsx)(`span`,{className:`w-[4.5rem] shrink-0 text-[10px] font-medium uppercase tracking-[0.08em] text-sand-400`,children:`openai`}),C.openaiQuotaByToken.map(e=>{let t=e.usedPercent===null?`quota not sampled yet`:`quota ${Math.round(e.usedPercent)}%${e.threshold===null?``:` / threshold ${e.threshold}%`}${e.resetsAt?` · resets ${b(e.resetsAt)}`:``}`;return(0,u.jsxs)(`span`,{title:`${e.name} · ${t}`,className:`inline-flex items-center gap-1.5 rounded-md border border-sand-200 bg-white px-2 py-1`,children:[(0,u.jsx)(`span`,{className:`font-mono text-[11px] text-sand-600`,children:e.name.split(`/`).pop()}),(0,u.jsx)(E,{usedPercent:e.usedPercent,threshold:e.threshold,blocked:e.blocked}),e.blocked&&(0,u.jsx)(`span`,{className:`rounded-full bg-caution-500/10 px-1.5 py-0.5 text-[9px] font-semibold text-caution-500`,children:`quota`})]},e.name)})]}),C.anthropicTokenNames.length>0&&(0,u.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,u.jsx)(`span`,{className:`w-[4.5rem] shrink-0 text-[10px] font-medium uppercase tracking-[0.08em] text-sand-400`,children:`anthropic`}),C.anthropicTokenNames.map(e=>(0,u.jsx)(`span`,{title:e,className:`inline-flex items-baseline rounded-md border border-sand-200 bg-white px-2 py-1 font-mono text-[11px] text-sand-600`,children:e.split(`/`).pop()},e))]})]}),(0,u.jsxs)(`div`,{className:`relative`,children:[(0,u.jsx)(`div`,{ref:j,onScroll:F,role:`log`,"aria-label":`Server process logs`,tabIndex:0,className:`main-scroll h-[calc(100vh-232px)] min-h-[320px] overflow-y-auto bg-sand-900 px-4 py-3 font-mono text-[12px] leading-[1.6] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-sienna-400`,children:R?(0,u.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 text-sand-400`,children:[(0,u.jsxs)(`p`,{className:`text-[12px]`,children:[`Could not reach the qgrid server — is it running?`,v.error instanceof Error&&(0,u.jsx)(`span`,{className:`block text-center text-[11px] text-sand-500`,children:v.error.message})]}),(0,u.jsxs)(`button`,{type:`button`,onClick:()=>void v.refetch(),className:`inline-flex items-center gap-1.5 rounded-md border border-sand-600 px-2.5 py-1.5 text-[11px] font-medium text-sand-300 transition-colors hover:bg-sand-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sienna-400`,children:[(0,u.jsx)(c,{className:`size-3`}),`Retry now`]})]}):L?A.length===0?(0,u.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-sand-500`,children:S.length===0?`No log lines yet — waiting for activity since ${w===void 0?`startup`:b(w)}.`:`No lines match the current filters.`}):(0,u.jsx)(`div`,{className:`w-full`,children:A.map(e=>(0,u.jsx)(`div`,{className:`[content-visibility:auto] [contain-intrinsic-size:auto_20px]`,children:(0,u.jsx)(O,{item:e})},e.key))}):(0,u.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-sand-500`,children:`Connecting to server logs…`})}),L&&!R&&!M&&(0,u.jsx)(`button`,{type:`button`,onClick:I,className:`absolute bottom-4 right-5 inline-flex items-center gap-1.5 rounded-full border border-sand-600 bg-sand-800/90 px-3 py-1.5 text-[11px] font-medium text-sand-200 shadow-lg backdrop-blur transition-colors hover:bg-sand-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sienna-400`,children:`↓ Jump to live`})]})]})}var O=(0,l.memo)(function({item:e}){if(e.kind===`restart`)return(0,u.jsxs)(`div`,{className:`py-1 text-center text-[11px] text-caution-400`,children:[`── process restarted · `,b(e.processStartedAt),` ──`]});if(e.kind===`dropped`)return(0,u.jsxs)(`div`,{className:`py-1 text-center text-[11px] italic text-sand-500`,children:[`── `,e.count,` lines dropped (buffer overflow) ──`]});let{entry:t}=e;return(0,u.jsxs)(`div`,{className:`whitespace-pre-wrap break-words text-sand-200`,children:[(0,u.jsx)(`span`,{className:`text-sand-500`,children:b(t.timestamp)}),` `,(0,u.jsx)(`span`,{className:i(`font-semibold`,t.level===`fatal`||t.level===`error`?`text-danger-400`:t.level===`warning`?`text-caution-400`:`text-sand-400`),children:v.get(t.level)??t.level.slice(0,3).toUpperCase()}),` `,(0,u.jsx)(`span`,{className:`text-sienna-300`,children:x(t.category)}),` `,(0,u.jsx)(`span`,{children:t.text})]})});function k(){let e=o.useSearch(),t=o.useNavigate();return(0,u.jsx)(`div`,{className:`max-w-[100rem] mx-auto`,children:(0,u.jsx)(D,{search:e,onSearchChange:e=>t({search:e,replace:!0})})})}export{k as component};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n}from"./vendor-react-8xo7RSum.js";var r=e(t()),i=n(),a=(0,r.forwardRef)(({title:e,titleId:t,...n},r)=>(0,i.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,i.jsx)(`title`,{id:t,children:e}):null,(0,i.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 12h14m-7-7v14`})]}));export{a as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n}from"./vendor-react-8xo7RSum.js";var r=e(t()),i=n(),a=(0,r.forwardRef)(({title:e,titleId:t,...n},r)=>(0,i.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,i.jsx)(`title`,{id:t,children:e}):null,(0,i.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,i.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9a9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,i.jsx)(`path`,{d:`M21 3v5h-5m5 4a9 9 0 0 1-9 9a9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,i.jsx)(`path`,{d:`M8 16H3v5`})]})]}));export{a as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n}from"./vendor-react-8xo7RSum.js";var r=e(t()),i=n(),a=(0,r.forwardRef)(({title:e,titleId:t,...n},r)=>(0,i.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,i.jsx)(`title`,{id:t,children:e}):null,(0,i.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M15.914 4a1.5 1.5 0 0 0-2.474-1.561l-9 9A1.5 1.5 0 0 0 5.5 14h4.002a.5.5 0 0 1 .471.666L8.086 20a1.5 1.5 0 0 0 2.475 1.56l9-9A1.5 1.5 0 0 0 18.5 10h-3.997a.5.5 0 0 1-.472-.667z`})]}));function o({status:e,requestedModel:t,servedModel:n,imageCostMethod:r}){if(e===`running`)return{label:t&&n&&t!==n?`${t} → ${n}`:n??t??`—`};let i=/^(?:assumed|estimated):(gpt-image-[^:]+):/.exec(r??``)?.[1],a=n?.startsWith(`openai/gpt-image-`)?n:i?`openai/${i}`:null;if(a){let e=t??n;return{label:e&&e!==a?`${e} → ${a}`:a}}return{label:t&&n&&t!==n?`${t} → ${n}`:n??t??`—`}}export{a as n,o as t};
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));export{s as n,l as r,o as t};
@@ -0,0 +1,5 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,n,r}from"./vendor-react-8xo7RSum.js";import{N as i}from"./vendor-tanstack-6B86itGS.js";import{i as a,n as o,r as s,t as c}from"./use-oauth-login-flow-CcUdLsa7.js";import{o as l,u}from"./index-DplV-wqZ.js";import{i as d}from"./cost-CZzlCFS2.js";import{t as f}from"./use-update-token-mutation-D2r5K5Bz.js";var p=e(n()),m=e(t());function h(){var e=[...arguments];return(0,m.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var g=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function _(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function v(e){return`nodeType`in e}function y(e){return e?_(e)?e:v(e)?e.ownerDocument?.defaultView??window:window:window}function b(e){let{Document:t}=y(e);return e instanceof t}function x(e){return!_(e)&&e instanceof y(e).HTMLElement}function S(e){return e instanceof y(e).SVGElement}function C(e){return e?_(e)?e.document:v(e)?b(e)?e:x(e)||S(e)?e.ownerDocument:document:document:document}var w=g?m.useLayoutEffect:m.useEffect;function T(e){let t=(0,m.useRef)(e);return w(()=>{t.current=e}),(0,m.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function ee(){let e=(0,m.useRef)(null);return[(0,m.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,m.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function te(e,t){t===void 0&&(t=[e]);let n=(0,m.useRef)(e);return w(()=>{n.current!==e&&(n.current=e)},t),n}function E(e,t){let n=(0,m.useRef)();return(0,m.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function D(e){let t=T(e),n=(0,m.useRef)(null);return[n,(0,m.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function ne(e){let t=(0,m.useRef)();return(0,m.useEffect)(()=>{t.current=e},[e]),t.current}var re={};function ie(e,t){return(0,m.useMemo)(()=>{if(t)return t;let n=re[e]==null?0:re[e]+1;return re[e]=n,e+`-`+n},[e,t])}function O(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var k=O(1),A=O(-1);function j(e){return`clientX`in e&&`clientY`in e}function ae(e){if(!e)return!1;let{KeyboardEvent:t}=y(e.target);return t&&e instanceof t}function oe(e){if(!e)return!1;let{TouchEvent:t}=y(e.target);return t&&e instanceof t}function se(e){if(oe(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return j(e)?{x:e.clientX,y:e.clientY}:null}var M=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[M.Translate.toString(e),M.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),N=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function P(e){return e.matches(N)?e:e.querySelector(N)}var ce={display:`none`};function F(e){let{id:t,value:n}=e;return m.createElement(`div`,{id:t,style:ce},n)}function le(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return m.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function I(){let[e,t]=(0,m.useState)(``);return{announce:(0,m.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var L=(0,m.createContext)(null);function R(e){let t=(0,m.useContext)(L);(0,m.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function ue(){let[e]=(0,m.useState)(()=>new Set),t=(0,m.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,m.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var z={draggable:`
2
+ To pick up a draggable item, press the space bar.
3
+ While dragging, use the arrow keys to move the item.
4
+ Press space again to drop the item in its new position, or press escape to cancel.
5
+ `},de={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function fe(e){let{announcements:t=de,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=z}=e,{announce:a,announcement:o}=I(),s=ie(`DndLiveRegion`),[c,l]=(0,m.useState)(!1);if((0,m.useEffect)(()=>{l(!0)},[]),R((0,m.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=m.createElement(m.Fragment,null,m.createElement(F,{id:r,value:i.draggable}),m.createElement(le,{id:s,announcement:o}));return n?(0,p.createPortal)(u,n):u}var B;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(B||={});function V(){}function pe(e,t){return(0,m.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function H(){var e=[...arguments];return(0,m.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var U=Object.freeze({x:0,y:0});function W(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function me(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function he(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function ge(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function _e(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var G=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=_e(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=W(_e(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(me)};function ve(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var ye=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=ve(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(he)};function be(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function xe(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:U}function Se(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var Ce=Se(1);function we(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Te(e,t,n){let r=we(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var Ee={ignoreTransform:!1};function K(e,t){t===void 0&&(t=Ee);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=y(e).getComputedStyle(e);t&&(n=Te(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function q(e){return K(e,{ignoreTransform:!0})}function De(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Oe(e,t){return t===void 0&&(t=y(e).getComputedStyle(e)),t.position===`fixed`}function J(e,t){t===void 0&&(t=y(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}function ke(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(b(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!x(i)||S(i)||n.includes(i))return n;let a=y(e).getComputedStyle(i);return i!==e&&J(i,a)&&n.push(i),Oe(i,a)?n:r(i.parentNode)}return e?r(e):n}function Ae(e){let[t]=ke(e,1);return t??null}function je(e){return!g||!e?null:_(e)?e:v(e)?b(e)||e===C(e).scrollingElement?window:x(e)?e:null:null}function Me(e){return _(e)?e.scrollX:e.scrollLeft}function Ne(e){return _(e)?e.scrollY:e.scrollTop}function Pe(e){return{x:Me(e),y:Ne(e)}}var Y;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(Y||={});function Fe(e){return!g||!e?!1:e===document.scrollingElement}function Ie(e){let t={x:0,y:0},n=Fe(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var Le={x:.2,y:.2};function Re(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=Le);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=Ie(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=Y.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=Y.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=Y.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=Y.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function ze(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Be(e){return e.reduce((e,t)=>k(e,Pe(t)),U)}function Ve(e){return e.reduce((e,t)=>e+Me(t),0)}function He(e){return e.reduce((e,t)=>e+Ne(t),0)}function Ue(e,t){if(t===void 0&&(t=K),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);Ae(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var We=[[`x`,[`left`,`right`],Ve],[`y`,[`top`,`bottom`],He]],Ge=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=ke(t),r=Be(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of We)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},Ke=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function qe(e){let{EventTarget:t}=y(e);return e instanceof t?e:C(e)}function Je(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}var X;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(X||={});function Ye(e){e.preventDefault()}function Xe(e){e.stopPropagation()}var Z;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(Z||={});var Ze={start:[Z.Space,Z.Enter],cancel:[Z.Esc],end:[Z.Space,Z.Enter,Z.Tab]},Qe=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Z.Right:return{...n,x:n.x+25};case Z.Left:return{...n,x:n.x-25};case Z.Down:return{...n,y:n.y+25};case Z.Up:return{...n,y:n.y-25}}},$e=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new Ke(C(t)),this.windowListeners=new Ke(y(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(X.Resize,this.handleCancel),this.windowListeners.add(X.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(X.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Ue(n),t(U)}handleKeyDown(e){if(ae(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=Ze,coordinateGetter:a=Qe,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:U;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=A(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=Ie(n),p=ze(n),m={x:Math.min(i===Z.Right?p.right-p.width/2:p.right,Math.max(i===Z.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===Z.Down?p.bottom-p.height/2:p.bottom,Math.max(i===Z.Down?p.top:p.top+p.height/2,u.y))},h=i===Z.Right&&!s||i===Z.Left&&!c,g=i===Z.Down&&!l||i===Z.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===Z.Right&&e<=d.x||i===Z.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}r.x=a?n.scrollLeft-e:i===Z.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===Z.Down&&e<=d.y||i===Z.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}r.y=a?n.scrollTop-e:i===Z.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,k(A(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};$e.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=Ze,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function et(e){return!!(e&&`distance`in e)}function tt(e){return!!(e&&`delay`in e)}var nt=class{constructor(e,t,n){n===void 0&&(n=qe(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=C(i),this.documentListeners=new Ke(this.document),this.listeners=new Ke(n),this.windowListeners=new Ke(y(i)),this.initialCoordinates=se(r)??U,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(X.Resize,this.handleCancel),this.windowListeners.add(X.DragStart,Ye),this.windowListeners.add(X.VisibilityChange,this.handleCancel),this.windowListeners.add(X.ContextMenu,Ye),this.documentListeners.add(X.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(tt(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(et(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(X.Click,Xe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(X.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=se(e)??U,s=A(n,o);if(!t&&a){if(et(a)){if(a.tolerance!=null&&Je(s,a.tolerance))return this.handleCancel();if(Je(s,a.distance))return this.handleStart()}if(tt(a)&&Je(s,a.tolerance))return this.handleCancel();this.handlePending(a,s)}else e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Z.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},rt={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},it=class extends nt{constructor(e){let{event:t}=e,n=C(t.target);super(e,rt,n)}};it.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var at={move:{name:`mousemove`},end:{name:`mouseup`}},ot;(function(e){e[e.RightClick=2]=`RightClick`})(ot||={});var st=class extends nt{constructor(e){super(e,at,C(e.event.target))}};st.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==ot.RightClick&&(r?.({event:n}),!0)}}];var ct={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},lt=class extends nt{constructor(e){super(e,ct)}static setup(){return window.addEventListener(ct.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ct.move.name,e)};function e(){}}};lt.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var ut;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(ut||={});var dt;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(dt||={});function ft(e){let{acceleration:t,activator:n=ut.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=dt.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=mt({delta:d,disabled:!a}),[h,g]=ee(),_=(0,m.useRef)({x:0,y:0}),v=(0,m.useRef)({x:0,y:0}),y=(0,m.useMemo)(()=>{switch(n){case ut.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case ut.DraggableRect:return i}},[n,i,c]),b=(0,m.useRef)(null),x=(0,m.useCallback)(()=>{let e=b.current;if(!e)return;let t=_.current.x*v.current.x,n=_.current.y*v.current.y;e.scrollBy(t,n)},[]),S=(0,m.useMemo)(()=>s===dt.TreeOrder?[...l].reverse():l,[s,l]);(0,m.useEffect)(()=>{if(!a||!l.length||!y)g();else{for(let e of S){if(r?.(e)===!1)continue;let n=l.indexOf(e),i=u[n];if(!i)continue;let{direction:a,speed:s}=Re(e,i,y,t,f);for(let e of[`x`,`y`])p[e][a[e]]||(s[e]=0,a[e]=0);if(s.x>0||s.y>0){g(),b.current=e,h(x,o),_.current=s,v.current=a;return}}_.current={x:0,y:0},v.current={x:0,y:0},g()}},[t,x,r,g,a,o,JSON.stringify(y),JSON.stringify(p),h,l,S,u,JSON.stringify(f)])}var pt={x:{[Y.Backward]:!1,[Y.Forward]:!1},y:{[Y.Backward]:!1,[Y.Forward]:!1}};function mt(e){let{delta:t,disabled:n}=e,r=ne(t);return E(e=>{if(n||!r||!e)return pt;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Y.Backward]:e.x[Y.Backward]||i.x===-1,[Y.Forward]:e.x[Y.Forward]||i.x===1},y:{[Y.Backward]:e.y[Y.Backward]||i.y===-1,[Y.Forward]:e.y[Y.Forward]||i.y===1}}},[n,t,r])}function ht(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return E(e=>t==null?null:r??e??null,[r,t])}function gt(e,t){return(0,m.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var _t;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(_t||={});var vt;(function(e){e.Optimized=`optimized`})(vt||={});var yt=new Map;function bt(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,m.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,m.useRef)(e),d=_(),f=te(d),p=(0,m.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),h=(0,m.useRef)(null),g=E(t=>{if(d&&!n)return yt;if(!t||t===yt||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new Ge(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,m.useEffect)(()=>{u.current=e},[e]),(0,m.useEffect)(()=>{d||p()},[n,d]),(0,m.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,m.useEffect)(()=>{d||typeof s!=`number`||h.current!==null||(h.current=setTimeout(()=>{p(),h.current=null},s))},[s,d,p,...r]),{droppableRects:g,measureDroppableContainers:p,measuringScheduled:a!=null};function _(){switch(l){case _t.Always:return!1;case _t.BeforeDragging:return n;default:return!n}}}function xt(e,t){return E(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function St(e,t){return xt(e,t)}function Ct(e){let{callback:t,disabled:n}=e,r=T(t),i=(0,m.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,m.useEffect)(()=>()=>i?.disconnect(),[i]),i}function wt(e){let{callback:t,disabled:n}=e,r=T(t),i=(0,m.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,m.useEffect)(()=>()=>i?.disconnect(),[i]),i}function Tt(e){return new Ge(K(e),e)}function Et(e,t,n){t===void 0&&(t=Tt);let[r,i]=(0,m.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=Ct({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=wt({callback:a});return w(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function Dt(e){return xe(e,xt(e))}var Ot=[];function kt(e){let t=(0,m.useRef)(e),n=E(n=>e?n&&n!==Ot&&e&&t.current&&e.parentNode===t.current.parentNode?n:ke(e):Ot,[e]);return(0,m.useEffect)(()=>{t.current=e},[e]),n}function At(e){let[t,n]=(0,m.useState)(null),r=(0,m.useRef)(e),i=(0,m.useCallback)(e=>{let t=je(e.target);t&&n(e=>e?(e.set(t,Pe(t)),new Map(e)):null)},[]);return(0,m.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=je(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,Pe(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{je(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,m.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>k(e,t),U):Be(e):U,[e,t])}function jt(e,t){t===void 0&&(t=[]);let n=(0,m.useRef)(null);return(0,m.useEffect)(()=>{n.current=null},t),(0,m.useEffect)(()=>{let t=e!==U;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?A(e,n.current):U}function Mt(e){(0,m.useEffect)(()=>{if(!g)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function Nt(e,t){return(0,m.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function Pt(e){return(0,m.useMemo)(()=>e?De(e):null,[e])}var Ft=[];function It(e,t){t===void 0&&(t=K);let[n]=e,r=Pt(n?y(n):null),[i,a]=(0,m.useState)(Ft);function o(){a(()=>e.length?e.map(e=>Fe(e)?r:new Ge(t(e),e)):Ft)}let s=wt({callback:o});return w(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function Lt(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return x(t)?t:e}function Rt(e){let{measure:t}=e,[n,r]=(0,m.useState)(null),i=wt({callback:(0,m.useCallback)(e=>{for(let{target:n}of e)if(x(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=D((0,m.useCallback)(e=>{let n=Lt(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,m.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var zt=[{sensor:it,options:{}},{sensor:$e,options:{}}],Bt={current:{}},Vt={draggable:{measure:q},droppable:{measure:q,strategy:_t.WhileDragging,frequency:vt.Optimized},dragOverlay:{measure:K}},Ht=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},Ut={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ht,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:V},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Vt,measureDroppableContainers:V,windowRect:null,measuringScheduled:!1},Wt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:V,draggableNodes:new Map,over:null,measureDroppableContainers:V},Gt=(0,m.createContext)(Wt),Kt=(0,m.createContext)(Ut);function qt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ht}}}function Jt(e,t){switch(t.type){case B.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case B.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case B.DragEnd:case B.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case B.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new Ht(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case B.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new Ht(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case B.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new Ht(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Yt(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,m.useContext)(Gt),a=ne(r),o=ne(n?.id);return(0,m.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!ae(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=P(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function Xt(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function Zt(e){return(0,m.useMemo)(()=>({draggable:{...Vt.draggable,...e?.draggable},droppable:{...Vt.droppable,...e?.droppable},dragOverlay:{...Vt.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Qt(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,m.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;w(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=xe(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=Ae(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var $t=(0,m.createContext)({...U,scaleX:1,scaleY:1}),Q;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(Q||={});var en=(0,m.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=zt,collisionDetection:o=ye,measuring:s,modifiers:c,...l}=e,[u,d]=(0,m.useReducer)(Jt,void 0,qt),[f,h]=ue(),[g,_]=(0,m.useState)(Q.Uninitialized),v=g===Q.Initialized,{draggable:{active:b,nodes:x,translate:S},droppable:{containers:C}}=u,T=b==null?null:x.get(b),ee=(0,m.useRef)({initial:null,translated:null}),E=(0,m.useMemo)(()=>b==null?null:{id:b,data:T?.data??Bt,rect:ee},[b,T]),D=(0,m.useRef)(null),[ne,re]=(0,m.useState)(null),[O,A]=(0,m.useState)(null),j=te(l,Object.values(l)),ae=ie(`DndDescribedBy`,t),oe=(0,m.useMemo)(()=>C.getEnabled(),[C]),M=Zt(s),{droppableRects:N,measureDroppableContainers:P,measuringScheduled:ce}=bt(oe,{dragging:v,dependencies:[S.x,S.y],config:M.droppable}),F=ht(x,b),le=(0,m.useMemo)(()=>O?se(O):null,[O]),I=Fe(),R=St(F,M.draggable.measure);Qt({activeNode:b==null?null:x.get(b),config:I.layoutShiftCompensation,initialRect:R,measure:M.draggable.measure});let z=Et(F,M.draggable.measure,R),de=Et(F?F.parentElement:null),V=(0,m.useRef)({activatorEvent:null,active:null,activeNode:F,collisionRect:null,collisions:null,droppableRects:N,draggableNodes:x,draggingNode:null,draggingNodeRect:null,droppableContainers:C,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),pe=C.getNodeFor(V.current.over?.id),H=Rt({measure:M.dragOverlay.measure}),U=H.nodeRef.current??F,W=v?H.rect??z:null,me=!!(H.nodeRef.current&&H.rect),he=Dt(me?null:z),_e=Pt(U?y(U):null),G=kt(v?pe??F:null),ve=It(G),xe=Xt(c,{transform:{x:S.x-he.x,y:S.y-he.y,scaleX:1,scaleY:1},activatorEvent:O,active:E,activeNodeRect:z,containerNodeRect:de,draggingNodeRect:W,over:V.current.over,overlayNodeRect:H.rect,scrollableAncestors:G,scrollableAncestorRects:ve,windowRect:_e}),Se=le?k(le,S):null,we=At(G),Te=jt(we),Ee=jt(we,[z]),K=k(xe,Te),q=W?Ce(W,xe):null,De=E&&q?o({active:E,collisionRect:q,droppableRects:N,droppableContainers:oe,pointerCoordinates:Se}):null,Oe=ge(De,`id`),[J,ke]=(0,m.useState)(null),Ae=be(me?xe:k(xe,Ee),J?.rect??null,z),je=(0,m.useRef)(null),Me=(0,m.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(D.current==null)return;let i=x.get(D.current);if(!i)return;let a=e.nativeEvent,o=new n({active:D.current,activeNode:i,event:a,options:r,context:V,onAbort(e){if(!x.get(e))return;let{onDragAbort:t}=j.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!x.get(e))return;let{onDragPending:i}=j.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=D.current;if(t==null)return;let n=x.get(t);if(!n)return;let{onDragStart:r}=j.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:ee}};(0,p.unstable_batchedUpdates)(()=>{r?.(i),_(Q.Initializing),d({type:B.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),re(je.current),A(a)})},onMove(e){d({type:B.DragMove,coordinates:e})},onEnd:s(B.DragEnd),onCancel:s(B.DragCancel)});je.current=o;function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=V.current,o=null;if(t&&i){let{cancelDrop:s}=j.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===B.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=B.DragCancel)}D.current=null,(0,p.unstable_batchedUpdates)(()=>{d({type:e}),_(Q.Uninitialized),ke(null),re(null),A(null),je.current=null;let t=e===B.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=j.current[t];e?.(o),f({type:t,event:o})}})}}},[x]),Ne=gt(a,(0,m.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=x.get(r);if(D.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},D.current=r,Me(n,t))},[x,Me]));Mt(a),w(()=>{z&&g===Q.Initializing&&_(Q.Initialized)},[z,g]),(0,m.useEffect)(()=>{let{onDragMove:e}=j.current,{active:t,activatorEvent:n,collisions:r,over:i}=V.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:K.x,y:K.y},over:i};(0,p.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[K.x,K.y]),(0,m.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=V.current;if(!e||D.current==null||!t||!i)return;let{onDragOver:a}=j.current,o=r.get(Oe),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,p.unstable_batchedUpdates)(()=>{ke(s),a?.(c),f({type:`onDragOver`,event:c})})},[Oe]),w(()=>{V.current={activatorEvent:O,active:E,activeNode:F,collisionRect:q,collisions:De,droppableRects:N,draggableNodes:x,draggingNode:U,draggingNodeRect:W,droppableContainers:C,over:J,scrollableAncestors:G,scrollAdjustedTranslate:K},ee.current={initial:W,translated:q}},[E,F,De,q,x,U,W,N,C,J,G,K]),ft({...I,delta:S,draggingRect:q,pointerCoordinates:Se,scrollableAncestors:G,scrollableAncestorRects:ve});let Pe=(0,m.useMemo)(()=>({active:E,activeNode:F,activeNodeRect:z,activatorEvent:O,collisions:De,containerNodeRect:de,dragOverlay:H,draggableNodes:x,droppableContainers:C,droppableRects:N,over:J,measureDroppableContainers:P,scrollableAncestors:G,scrollableAncestorRects:ve,measuringConfiguration:M,measuringScheduled:ce,windowRect:_e}),[E,F,z,O,De,de,H,x,C,N,J,P,G,ve,M,ce,_e]),Y=(0,m.useMemo)(()=>({activatorEvent:O,activators:Ne,active:E,activeNodeRect:z,ariaDescribedById:{draggable:ae},dispatch:d,draggableNodes:x,over:J,measureDroppableContainers:P}),[O,Ne,E,z,d,ae,x,J,P]);return m.createElement(L.Provider,{value:h},m.createElement(Gt.Provider,{value:Y},m.createElement(Kt.Provider,{value:Pe},m.createElement($t.Provider,{value:Ae},i)),m.createElement(Yt,{disabled:n?.restoreFocus===!1})),m.createElement(fe,{...n,hiddenTextDescribedById:ae}));function Fe(){let e=ne?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=v&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),tn=(0,m.createContext)(null),nn=`button`,rn=`Draggable`;function an(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=ie(rn),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,m.useContext)(Gt),{role:p=nn,roleDescription:h=`draggable`,tabIndex:g=0}=i??{},_=c?.id===t,v=(0,m.useContext)(_?$t:tn),[y,b]=D(),[x,S]=D(),C=Nt(o,t),T=te(n);return w(()=>(d.set(t,{id:t,key:a,node:y,activatorNode:x,data:T}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,m.useMemo)(()=>({role:p,tabIndex:g,"aria-disabled":r,"aria-pressed":_&&p===nn?!0:void 0,"aria-roledescription":h,"aria-describedby":u.draggable}),[r,p,g,_,h,u.draggable]),isDragging:_,listeners:r?void 0:C,node:y,over:f,setNodeRef:b,setActivatorNodeRef:S,transform:v}}function on(){return(0,m.useContext)(Kt)}var sn=`Droppable`,cn={timeout:25};function ln(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=ie(sn),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,m.useContext)(Gt),u=(0,m.useRef)({disabled:n}),d=(0,m.useRef)(!1),f=(0,m.useRef)(null),p=(0,m.useRef)(null),{disabled:h,updateMeasurementsFor:g,timeout:_}={...cn,...i},v=te(g??r),y=wt({callback:(0,m.useCallback)(()=>{d.current?(p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(v.current)?v.current:[v.current]),p.current=null},_)):d.current=!0},[_]),disabled:h||!o}),[b,x]=D((0,m.useCallback)((e,t)=>{y&&(t&&(y.unobserve(t),d.current=!1),e&&y.observe(e))},[y])),S=te(t);return(0,m.useEffect)(()=>{y&&b.current&&(y.disconnect(),d.current=!1,y.observe(b.current))},[b,y]),(0,m.useEffect)(()=>(s({type:B.RegisterDroppable,element:{id:r,key:a,disabled:n,node:b,rect:f,data:S}}),()=>s({type:B.UnregisterDroppable,key:a,id:r})),[r]),(0,m.useEffect)(()=>{n!==u.current.disabled&&(s({type:B.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:b,over:c,setNodeRef:x}}function un(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function dn(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function fn(e){return e!==null&&e>=0}function pn(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function mn(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var hn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=un(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},gn=`Sortable`,_n=m.createContext({activeIndex:-1,containerId:gn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:hn,disabled:{draggable:!1,droppable:!1}});function vn(e){let{children:t,id:n,items:r,strategy:i=hn,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=on(),d=ie(gn,n),f=s.rect!==null,p=(0,m.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),h=o!=null,g=o?p.indexOf(o.id):-1,_=l?p.indexOf(l.id):-1,v=(0,m.useRef)(p),y=!pn(p,v.current),b=_!==-1&&g===-1||y,x=mn(a);w(()=>{y&&h&&u(p)},[y,p,h,u]),(0,m.useEffect)(()=>{v.current=p},[p]);let S=(0,m.useMemo)(()=>({activeIndex:g,containerId:d,disabled:x,disableTransforms:b,items:p,overIndex:_,useDragOverlay:f,sortedRects:dn(p,c),strategy:i}),[g,d,x.draggable,x.droppable,b,p,_,c,f,i]);return m.createElement(_n.Provider,{value:S},t)}var yn=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return un(n,r,i).indexOf(t)},bn=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},xn={duration:200,easing:`ease`},Sn=`transform`,Cn=M.Transition.toString({property:Sn,duration:0,easing:`linear`}),wn={roleDescription:`sortable`};function Tn(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,m.useState)(null),s=(0,m.useRef)(n);return w(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=K(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,m.useEffect)(()=>{a&&o(null)},[a]),a}function En(e){let{animateLayoutChanges:t=bn,attributes:n,disabled:r,data:i,getNewIndex:a=yn,id:o,strategy:s,resizeObserverConfig:c,transition:l=xn}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:g,sortedRects:_,overIndex:v,useDragOverlay:y,strategy:b}=(0,m.useContext)(_n),x=Dn(r,p),S=u.indexOf(o),C=(0,m.useMemo)(()=>({sortable:{containerId:d,index:S,items:u},...i}),[d,i,S,u]),w=(0,m.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:T,node:ee,isOver:te,setNodeRef:E}=ln({id:o,data:C,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:w,...c}}),{active:D,activatorEvent:ne,activeNodeRect:re,attributes:ie,setNodeRef:O,listeners:k,isDragging:A,over:j,setActivatorNodeRef:oe,transform:se}=an({id:o,data:C,attributes:{...wn,...n},disabled:x.draggable}),N=h(E,O),P=!!D,ce=P&&!g&&fn(f)&&fn(v),F=!y&&A,le=ce?(F&&ce?se:null)??(s??b)({rects:_,activeNodeRect:re,activeIndex:f,overIndex:v,index:S}):null,I=fn(f)&&fn(v)?a({id:o,items:u,activeIndex:f,overIndex:v}):S,L=D?.id,R=(0,m.useRef)({activeId:L,items:u,newIndex:I,containerId:d}),ue=u!==R.current.items,z=t({active:D,containerId:d,isDragging:A,isSorting:P,id:o,index:S,items:u,newIndex:R.current.newIndex,previousItems:R.current.items,previousContainerId:R.current.containerId,transition:l,wasDragging:R.current.activeId!=null}),de=Tn({disabled:!z,index:S,node:ee,rect:T});return(0,m.useEffect)(()=>{P&&R.current.newIndex!==I&&(R.current.newIndex=I),d!==R.current.containerId&&(R.current.containerId=d),u!==R.current.items&&(R.current.items=u)},[P,I,d,u]),(0,m.useEffect)(()=>{if(L===R.current.activeId)return;if(L!=null&&R.current.activeId==null){R.current.activeId=L;return}let e=setTimeout(()=>{R.current.activeId=L},50);return()=>clearTimeout(e)},[L]),{active:D,activeIndex:f,attributes:ie,data:C,rect:T,index:S,newIndex:I,items:u,isOver:te,isSorting:P,isDragging:A,listeners:k,node:ee,overIndex:v,over:j,setNodeRef:N,setActivatorNodeRef:oe,setDroppableNodeRef:E,setDraggableNodeRef:O,transform:de??le,transition:fe()};function fe(){if(de||ue&&R.current.newIndex===S)return Cn;if(!(F&&!ae(ne)||!l)&&(P||z))return M.Transition.toString({...l,property:Sn})}}function Dn(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}Z.Down,Z.Right,Z.Up,Z.Left;var $=r(),On=(0,m.forwardRef)(({title:e,titleId:t,...n},r)=>(0,$.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,$.jsx)(`title`,{id:t,children:e}):null,(0,$.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m12 14l4-4M3.34 19a10 10 0 1 1 17.32 0`})]})),kn=(0,m.forwardRef)(({title:e,titleId:t,...n},r)=>(0,$.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,$.jsx)(`title`,{id:t,children:e}):null,(0,$.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,$.jsx)(`circle`,{cx:9,cy:12,r:1}),(0,$.jsx)(`circle`,{cx:9,cy:5,r:1}),(0,$.jsx)(`circle`,{cx:9,cy:19,r:1}),(0,$.jsx)(`circle`,{cx:15,cy:12,r:1}),(0,$.jsx)(`circle`,{cx:15,cy:5,r:1}),(0,$.jsx)(`circle`,{cx:15,cy:19,r:1})]})]})),An=new Set([`anthropic`,`openai`,`grok`]);function jn(e){let t=e.trim();if(t===``)return{ok:!0,value:null};if(!/^\d+$/.test(t))return{ok:!1,error:`정수만 입력하세요 (0–100)`};let n=Number(t);return n>100?{ok:!1,error:`100 이하여야 합니다`}:{ok:!0,value:n===0?null:n}}function Mn(e){let t=e.trim();if(!/^\d+$/.test(t))return{ok:!1,error:`1–100 사이 정수를 입력하세요`};let n=Number(t);return n<1||n>100?{ok:!1,error:`1–100 사이 정수를 입력하세요`}:{ok:!0,value:n}}var Nn=new Map(Object.entries({openai:{stripe:`bg-openai-400`,bar:`bg-openai-bar`,badge:`bg-openai-50 text-openai-600`,cost:`text-openai-600`},anthropic:{stripe:`bg-anthropic-400`,bar:`bg-anthropic-400`,badge:`bg-anthropic-50 text-anthropic-600`,cost:`text-anthropic-600`},google:{stripe:`bg-google-400`,bar:`bg-google-400`,badge:`bg-google-50 text-google-600`,cost:`text-google-600`},grok:{stripe:`bg-sand-800`,bar:`bg-sand-600`,badge:`bg-sand-800 text-sand-50`,cost:`text-sand-800`}})),Pn={stripe:`bg-sand-400`,bar:`bg-sienna-400`,badge:`bg-sand-200 text-sand-500`,cost:`text-sienna-600`};function Fn(e){return Nn.get(e)??Pn}function In(e,t){return e>=95?`bg-danger-400`:e>=80?`bg-caution-400`:t.bar}function Ln(e){if(!e)return``;let t=new Date(e).getTime()-Date.now();if(t<=0)return`resetting...`;let n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);return n>0?`resets ${n}h ${r}m`:`resets ${r}m`}function Rn(e,t){if(!t||t<=0)return e;let n=t/60;return n>=24?`${Math.round(n/24)}d`:`${Math.round(n)}h`}function zn(e){if(!e)return null;let t=e.replace(/^USAGE_PERIOD_TYPE_/,``).toLowerCase();return t&&t!==`unspecified`?t:null}function Bn({usage:e}){let t=zn(e.periodType);return e.onDemandExcluded===!0||t!==null||e.tier?(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 text-[10px]`,children:[e.onDemandExcluded===!0&&(0,$.jsx)(`span`,{className:`px-1.5 py-0.5 rounded-full bg-amber-50 text-amber-700`,title:`xAI에서 on-demand 과금을 끄면 다시 라우팅됩니다`,children:`excluded: on-demand billing enabled`}),t!==null&&(0,$.jsx)(`span`,{className:`px-1.5 py-0.5 rounded-full bg-sand-100 text-sand-600`,children:t}),e.tier&&(0,$.jsx)(`span`,{className:`px-1.5 py-0.5 rounded-full bg-sand-100 text-sand-600`,children:e.tier})]}):null}function Vn({label:e,utilization:t,resetsAt:n,windowDurationMins:r,theme:i,threshold:a}){let o=t??0,s=a!=null;return(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`text-xs text-sand-600 w-7 shrink-0`,children:Rn(e,r)}),(0,$.jsxs)(`div`,{className:`relative flex-1 min-w-0 h-2 bg-sand-200 rounded-full overflow-hidden`,children:[(0,$.jsx)(`div`,{className:`h-full rounded-full transition-all duration-300 ${In(o,i)}`,style:{width:`${Math.min(o,100)}%`}}),s&&(0,$.jsx)(`div`,{className:`absolute top-[-2px] bottom-[-2px] w-0.5 bg-sienna-500 rounded-full`,style:{left:`calc(${Math.min(a,100)}% - 1px)`}})]}),(0,$.jsxs)(`span`,{className:`text-xs tabular-nums text-sand-700 w-9 text-right shrink-0`,children:[o,`%`]}),(0,$.jsx)(`span`,{className:`hidden sm:inline text-[10px] text-sand-400 w-24 text-right shrink-0`,title:Ln(n),children:Ln(n)})]})}function Hn({token:e,theme:t}){let n=i(),{data:r,isLoading:a,dataUpdatedAt:o}=l.useUsage(e.id),s=r?.error?o:void 0;if((0,m.useEffect)(()=>{s!==void 0&&n.invalidateQueries({queryKey:[`Token`]})},[s,n]),e.reauth_required)return(0,$.jsxs)(`div`,{className:`py-1`,children:[(0,$.jsx)(`p`,{className:`text-[11px] text-amber-600`,children:`Session expired`}),(0,$.jsx)(`p`,{className:`text-[10px] text-sand-400 mt-0.5`,children:`Please re-login via OAuth`})]});if(a)return(0,$.jsxs)(`div`,{className:`animate-pulse space-y-2 py-2`,children:[(0,$.jsx)(`div`,{className:`h-2 w-full bg-sand-200 rounded-full`}),(0,$.jsx)(`div`,{className:`h-2 w-3/4 bg-sand-200 rounded-full`})]});if(r?.error)return(0,$.jsxs)(`div`,{className:`py-1`,children:[(0,$.jsx)(`p`,{className:`text-[11px] text-amber-600`,children:`Unavailable`}),(0,$.jsx)(`p`,{className:`text-[10px] text-sand-400 mt-0.5`,children:r.error})]});if(!r?.fiveHour&&!r?.sevenDay)return(0,$.jsxs)(`div`,{className:`space-y-1.5 py-1`,children:[r&&(0,$.jsx)(Bn,{usage:r}),(0,$.jsx)(`p`,{className:`text-[11px] text-sand-400`,children:`No usage data`})]});let c=An.has(e.provider)?e.quota_threshold:null;return(0,$.jsxs)(`div`,{className:`space-y-1.5 py-1`,children:[(0,$.jsx)(Bn,{usage:r}),r.fiveHour&&(0,$.jsx)(Vn,{label:`5h`,utilization:r.fiveHour.utilization,resetsAt:r.fiveHour.resetsAt,windowDurationMins:r.fiveHour.windowDurationMins,theme:t,threshold:c}),r.sevenDay&&(0,$.jsx)(Vn,{label:zn(r.periodType)===`monthly`?`1mo`:`7d`,utilization:r.sevenDay.utilization,resetsAt:r.sevenDay.resetsAt,windowDurationMins:r.sevenDay.windowDurationMins,theme:t,threshold:e.provider===`grok`?c:void 0})]})}function Un({token:e}){let[t,n]=(0,m.useState)(null),[r,o]=(0,m.useState)(``),s=(0,m.useRef)(null),c=i(),l=f(),u=An.has(e.provider),d=t!==null,p=jn(r),h=()=>{let t=s.current?.getBoundingClientRect();if(!t)return;let r=Math.min(Math.max(t.right-240,8),Math.max(window.innerWidth-240-8,8)),i=t.top-6-150,a=t.bottom+6,c=Math.min(Math.max(i>=8?i:a,8),Math.max(window.innerHeight-150-8,8));n({left:r,top:c}),o(String(e.quota_threshold??100))},g=()=>n(null);if(!u)return(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md text-[10px] text-sand-300 border border-sand-100`,title:`Quota threshold는 이 provider에서 지원되지 않습니다`,children:[(0,$.jsx)(On,{className:`size-3`}),`n/a`]});let _=e=>{let t=/^\d+$/.test(r.trim())?Number(r.trim()):0,n=Math.min(Math.max(t+e,0),100);o(String(n))};return(0,$.jsxs)(`div`,{className:`inline-flex`,children:[(0,$.jsxs)(`button`,{ref:s,type:`button`,title:`사용률 제한 설정`,onClick:d?g:h,className:`flex items-center gap-1 px-1.5 py-0.5 rounded-md text-[10px] border border-sand-200/80 text-sand-400 hover:text-sand-600 hover:border-sand-300 transition-colors duration-150`,children:[(0,$.jsx)(On,{className:`size-3`}),`Set limit`]}),d&&t&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`fixed inset-0 z-40`,onPointerDown:g}),(0,$.jsxs)(`div`,{className:`fixed z-50 w-60 panel shadow-xl p-3`,style:{top:t.top,left:t.left},children:[(0,$.jsx)(`label`,{htmlFor:`threshold-${e.id}`,className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium`,children:`사용률 제한`}),(0,$.jsxs)(`div`,{className:`mt-1 flex items-center gap-2`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>_(-10),className:`size-9 shrink-0 rounded-md border border-sand-200 text-sand-600 text-base leading-none hover:bg-sand-100 transition-colors duration-150`,children:`−`}),(0,$.jsx)(a,{id:`threshold-${e.id}`,value:r,onChange:e=>o(e.target.value),inputMode:`numeric`,className:`h-9 w-14 border rounded-md text-center text-sm text-sand-900 bg-white tabular-nums focus:outline-none ${p.ok?`border-sand-200 focus:border-sienna-300`:`border-red-300 focus:border-red-400`}`}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>_(10),className:`size-9 shrink-0 rounded-md border border-sand-200 text-sand-600 text-base leading-none hover:bg-sand-100 transition-colors duration-150`,children:`+`}),(0,$.jsx)(`span`,{className:`text-sm text-sand-500`,children:`%`})]}),p.ok?(0,$.jsx)(`p`,{className:`mt-1.5 text-[11px] text-sand-500 leading-snug`,children:p.value===null?`제한 없음 — 사용률과 무관하게 항상 사용합니다.`:`기준 사용률이 임계치에 달하면 해당 토큰을 건너뜁니다.`}):(0,$.jsx)(`p`,{className:`mt-1.5 text-[11px] text-red-500`,children:p.error}),(0,$.jsxs)(`div`,{className:`mt-2 flex items-center justify-end gap-1.5`,children:[(0,$.jsx)(`button`,{type:`button`,className:`px-2 py-1 text-[11px] font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150`,onClick:g,children:`Cancel`}),(0,$.jsx)(`button`,{type:`button`,className:`px-2 py-1 text-[11px] font-medium rounded-md bg-sienna-400 text-white hover:bg-sienna-500 disabled:opacity-50 transition-colors duration-150`,disabled:l.isPending||!p.ok,onClick:async()=>{p.ok&&(await l.mutateAsync({id:e.id,quotaThreshold:p.value}),await Promise.all([c.invalidateQueries({queryKey:[`Token`]}),c.invalidateQueries({queryKey:[`Qgrid`]})]),g())},children:l.isPending?`Saving...`:`Save`})]})]})]})]})}function Wn({token:e}){let[t,n]=(0,m.useState)(null),[r,o]=(0,m.useState)(``),s=(0,m.useRef)(null),c=i(),l=f(),u=Mn(r),d=()=>{let t=s.current?.getBoundingClientRect();if(!t)return;let r=Math.min(Math.max(t.right-240,8),Math.max(window.innerWidth-240-8,8)),i=t.top-6-150,a=Math.min(Math.max(i>=8?i:t.bottom+6,8),Math.max(window.innerHeight-150-8,8));o(String(e.weight)),n({left:r,top:a})},p=()=>n(null),h=e=>{let t=/^\d+$/.test(r.trim())?Number(r.trim()):1;o(String(Math.min(Math.max(t+e,1),100)))};return(0,$.jsxs)(`div`,{className:`inline-flex`,children:[(0,$.jsxs)(`button`,{ref:s,type:`button`,title:`라우팅 가중치 설정`,onClick:t?p:d,className:`flex items-center gap-1 px-1.5 py-0.5 rounded-md text-[10px] border border-sand-200/80 text-sand-400 hover:text-sand-600 hover:border-sand-300 transition-colors duration-150`,children:[`Weight `,e.weight]}),t&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`fixed inset-0 z-40`,onPointerDown:p}),(0,$.jsxs)(`div`,{className:`fixed z-50 w-60 panel shadow-xl p-3`,style:t,children:[(0,$.jsx)(`label`,{htmlFor:`weight-${e.id}`,className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium`,children:`라우팅 가중치`}),(0,$.jsxs)(`div`,{className:`mt-1 flex items-center gap-2`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>h(-1),className:`size-9 shrink-0 rounded-md border border-sand-200 text-sand-600`,children:`−`}),(0,$.jsx)(a,{id:`weight-${e.id}`,value:r,onChange:e=>o(e.target.value),inputMode:`numeric`,className:`h-9 w-16 border rounded-md text-center text-sm tabular-nums ${u.ok?`border-sand-200`:`border-red-300`}`}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>h(1),className:`size-9 shrink-0 rounded-md border border-sand-200 text-sand-600`,children:`+`})]}),(0,$.jsx)(`p`,{className:`mt-1.5 text-[11px] ${u.ok?`text-sand-500`:`text-red-500`}`,children:u.ok?`새 요청의 상대 배정 비율입니다.`:u.error}),(0,$.jsxs)(`div`,{className:`mt-2 flex items-center justify-end gap-1.5`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:p,className:`px-2 py-1 text-[11px]`,children:`Cancel`}),(0,$.jsx)(`button`,{type:`button`,onClick:async()=>{u.ok&&(await l.mutateAsync({id:e.id,weight:u.value}),await Promise.all([c.invalidateQueries({queryKey:[`Token`]}),c.invalidateQueries({queryKey:[`Qgrid`]})]),p())},disabled:l.isPending||!u.ok,className:`px-2 py-1 text-[11px] rounded-md bg-sienna-400 text-white disabled:opacity-50`,children:l.isPending?`Saving...`:`Save`})]})]})]})]})}function Gn({token:e}){let t=o(),n=c(e.provider)?e.provider:null,r=async e=>{await t.submitCode(e)&&t.reset()};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`button`,{type:`button`,title:`기존 이름으로 다시 로그인`,disabled:n===null||t.loadingProvider!==null,onClick:()=>{n&&t.start(n,e.name??``)},className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-[10px] font-medium border border-sienna-300 text-sienna-600 hover:bg-sienna-50 disabled:opacity-50 transition-colors duration-150`,children:t.loadingProvider===e.provider?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`size-2.5 border-2 border-sienna-400 border-t-transparent rounded-full animate-spin`}),`로그인 대기`]}):`재로그인`}),t.codeEntryProvider&&(0,$.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center pt-[15vh]`,children:[(0,$.jsx)(`div`,{className:`absolute inset-0 bg-sand-900/8 backdrop-blur-sm`,onClick:t.reset,onKeyDown:()=>{}}),(0,$.jsxs)(`div`,{className:`relative panel shadow-xl w-full max-w-md mx-4`,children:[(0,$.jsx)(`div`,{className:`px-5 py-4 border-b border-sand-100/60`,children:(0,$.jsx)(`h3`,{className:`text-base font-medium text-sand-900`,children:`재로그인`})}),(0,$.jsx)(`div`,{className:`px-5 py-4`,children:(0,$.jsx)(s,{provider:t.codeEntryProvider,isPending:t.completeMutation.isPending,isError:t.completeMutation.isError,onSubmit:e=>void r(e),onRestart:t.reset})})]})]})]})}function Kn({token:e}){let{attributes:t,listeners:n,setNodeRef:r,transform:i,transition:a,isDragging:o}=En({id:String(e.id),transition:{duration:200,easing:`ease`}}),s={num:0,page:1};e.name&&(s.token_name=e.name);let{data:c}=l.useTotalCost(s,{enabled:!!e.name}),u=Fn(e.provider),f={transform:M.Translate.toString(i),transition:a,opacity:o?.5:1,zIndex:o?10:void 0};return(0,$.jsxs)(`div`,{ref:r,style:f,className:`relative rounded-lg bg-white border border-sand-200/80 overflow-hidden shadow-sm hover:shadow-md transition-shadow duration-200`,children:[(0,$.jsx)(`div`,{className:`absolute inset-y-0 left-0 w-1 ${u.stripe}`}),(0,$.jsxs)(`div`,{className:`pl-4 pr-3 py-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2 mb-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,$.jsx)(`button`,{type:`button`,"aria-label":`순서 변경 핸들`,...t,...n,className:`shrink-0 -m-1 p-1 text-sand-300 hover:text-sand-500 cursor-grab active:cursor-grabbing touch-none`,children:(0,$.jsx)(kn,{className:`size-3.5`})}),(0,$.jsx)(`span`,{className:`text-[13px] font-medium text-sand-800 truncate select-none`,children:e.name??`Unnamed`})]}),(0,$.jsx)(`span`,{className:`text-[11px] tabular-nums font-medium shrink-0 ${u.cost}`,children:d(c?.usd??0)})]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 mb-2`,children:[(0,$.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full uppercase ${u.badge}`,children:e.provider}),(0,$.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full ${e.active?`bg-sage-100 text-sage-600`:`bg-sand-200 text-sand-500`}`,children:e.active?`Active`:`Inactive`}),An.has(e.provider)&&e.quota_threshold!==null&&(0,$.jsxs)(`span`,{className:`px-1.5 py-0.5 rounded-full bg-sienna-50 text-[10px] tabular-nums font-medium text-sienna-600`,title:`사용률 ${e.quota_threshold}% 이상이면 이 토큰 제외`,children:[`≤ `,e.quota_threshold,`%`]})]}),(0,$.jsx)(Hn,{token:e,theme:u}),(0,$.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5`,children:[e.reauth_required&&(0,$.jsx)(Gn,{token:e}),(0,$.jsx)(`div`,{className:`flex-1`}),(0,$.jsx)(Wn,{token:e}),(0,$.jsx)(Un,{token:e})]})]})]})}var qn=[`all`,`openai`,`anthropic`,`grok`],Jn={all:`All`,openai:`OpenAI`,anthropic:`Anthropic`,grok:`Grok`};function Yn(){let{data:e,isLoading:t}=u.useTokens(`A`,{orderBy:`ord-asc`}),n=i(),r=u.useReorderMutation(),[a,o]=(0,m.useState)(null),[s,c]=(0,m.useState)(`all`),l=e?.rows??[],d=a!==null&&a.from===e?.rows?a.tokens:l,f=H(pe(it,{activationConstraint:{distance:5}})),p=e=>{let{active:t,over:i}=e;if(!i||t.id===i.id)return;let a=Number(t.id),s=Number(i.id),c=d.findIndex(e=>e.id===a),f=d.findIndex(e=>e.id===s);if(c===-1||f===-1)return;let p=un(d,c,f);o({from:l,tokens:p});let m=u.getTokensQueryOptions(`A`,{orderBy:`ord-asc`}).queryKey,h=n.getQueryData(m);n.setQueryData(m,e=>e&&{...e,rows:p}),r.mutate({ids:p.map(e=>e.id)},{onError:()=>{n.setQueryData(m,h),o(null)},onSettled:()=>{Promise.all([n.invalidateQueries({queryKey:[`Token`]}),n.invalidateQueries({queryKey:[`Qgrid`]})])}})};if(t)return(0,$.jsx)(`div`,{className:`panel p-5`,children:(0,$.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:Array.from({length:4}).map((e,t)=>(0,$.jsxs)(`div`,{className:`rounded-lg bg-sand-50 px-4 py-3 animate-pulse`,children:[(0,$.jsx)(`div`,{className:`h-3 w-16 bg-sand-200 rounded mb-3`}),(0,$.jsx)(`div`,{className:`h-2 w-full bg-sand-200 rounded-full`})]},`skel-${t}`))})});if(d.length===0)return(0,$.jsx)(`div`,{className:`panel px-5 py-10`,children:(0,$.jsx)(`p`,{className:`text-sand-400 text-[13px] text-center`,children:`No tokens registered`})});let h=s===`all`?d:d.filter(e=>e.provider===s);return(0,$.jsxs)(`div`,{className:`panel overflow-hidden`,children:[(0,$.jsxs)(`div`,{className:`panel-header flex items-center justify-between px-5 py-2.5`,children:[(0,$.jsx)(`span`,{className:`text-[13px] font-medium text-sand-700`,children:`Token Usage`}),(0,$.jsx)(`div`,{className:`segmented-control flex gap-0.5`,children:qn.map(e=>(0,$.jsx)(`button`,{type:`button`,"data-active":s===e,className:`px-2.5 py-[3px] text-[11px] font-medium rounded-[6px] transition-all duration-150 ${s===e?`text-sand-800`:`text-sand-500 hover:text-sand-700`}`,onClick:()=>c(e),children:Jn[e]},e))})]}),(0,$.jsx)(`div`,{className:`p-4`,children:(0,$.jsx)(en,{sensors:f,collisionDetection:G,onDragEnd:p,children:(0,$.jsx)(vn,{items:h.map(e=>String(e.id)),strategy:hn,children:(0,$.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:h.map(e=>(0,$.jsx)(Kn,{token:e},e.id))})})})})]})}function Xn(){return(0,$.jsx)(`div`,{className:`max-w-6xl mx-auto`,children:(0,$.jsx)(Yn,{})})}export{Xn as component};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n}from"./vendor-react-8xo7RSum.js";import{N as r}from"./vendor-tanstack-6B86itGS.js";import{b as i,l as a,u as o}from"./index-DplV-wqZ.js";import{t as s}from"./use-update-token-mutation-D2r5K5Bz.js";import{t as c}from"./plus-Bab0ACnC.js";var l=e(t()),u=n(),d=(0,l.forwardRef)(({title:e,titleId:t,...n},r)=>(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,u.jsx)(`title`,{id:t,children:e}):null,(0,u.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,u.jsx)(`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0`}),(0,u.jsx)(`circle`,{cx:12,cy:12,r:3})]})]})),f=(0,l.forwardRef)(({title:e,titleId:t,...n},r)=>(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,u.jsx)(`title`,{id:t,children:e}):null,(0,u.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,u.jsx)(`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575a1 1 0 0 1 0 .696a10.8 10.8 0 0 1-1.444 2.49m-6.41-.679a3 3 0 0 1-4.242-4.242`}),(0,u.jsx)(`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 4.446-5.143M2 2l20 20`})]})]})),p=(0,l.forwardRef)(({title:e,titleId:t,...n},r)=>(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,u.jsx)(`title`,{id:t,children:e}):null,(0,u.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 12h14`})]})),m=new Map([[`qgrid`,`Qgrid`],[`slack`,`Slack 알림`],[`slackConnection`,`Slack 연결`]]);function h(e){return e?e.length<=12?`•`.repeat(e.length):`${e.slice(0,8)}${`•`.repeat(12)}${e.slice(-4)}`:``}function g({value:e,min:t,max:n,step:r,disabled:i,onChange:a}){let o=Number(e),s=Number.isFinite(o),l=t??-1/0,d=n??1/0,f=e=>{let n=Math.min(Math.max((s?o:t??0)+e,l),d);a(String(Number(n.toFixed(2))))};return(0,u.jsxs)(`div`,{className:`inline-flex items-center rounded-lg border border-sand-200/80 bg-white overflow-hidden`,children:[(0,u.jsx)(`button`,{type:`button`,"aria-label":`감소`,onClick:()=>f(-r),disabled:i||s&&o<=l,className:`size-7 grid place-items-center text-sand-500 hover:bg-sand-100 disabled:opacity-30 disabled:hover:bg-transparent transition-colors duration-150`,children:(0,u.jsx)(p,{className:`size-3`})}),(0,u.jsx)(`input`,{value:e,onChange:e=>a(e.target.value),disabled:i,inputMode:`decimal`,className:`w-12 text-center text-[12px] tabular-nums text-sand-800 bg-transparent border-x border-sand-200/80 py-1 focus:outline-none focus:bg-sand-50`}),(0,u.jsx)(`button`,{type:`button`,"aria-label":`증가`,onClick:()=>f(r),disabled:i||s&&o>=d,className:`size-7 grid place-items-center text-sand-500 hover:bg-sand-100 disabled:opacity-30 disabled:hover:bg-transparent transition-colors duration-150`,children:(0,u.jsx)(c,{className:`size-3`})})]})}function _({value:e,presets:t,disabled:n,onChange:r}){let i=Number(e);return(0,u.jsx)(`div`,{className:`segmented-control inline-flex`,children:t.map(e=>(0,u.jsx)(`button`,{type:`button`,disabled:n,"data-active":i===e,onClick:()=>r(String(e)),className:`rounded-[6px] px-2.5 py-1 text-[11px] font-medium tabular-nums text-sand-500 transition-colors hover:text-sand-800 disabled:opacity-50 data-[active=true]:text-sand-900`,children:e>=60?`${e/60}시간`:`${e}분`},e))})}function v({source:e}){return(0,u.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded ${e===`db`?`bg-sienna-50 text-sienna-600`:`bg-sand-100 text-sand-500`}`,children:e===`db`?`저장값`:e===`env`?`환경변수`:`기본값`})}function y({label:e,on:t,disabled:n,onChange:r}){return(0,u.jsx)(`button`,{type:`button`,role:`switch`,"aria-label":e,"aria-checked":t,disabled:n,onClick:()=>r(!t),className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors duration-200 disabled:opacity-50 ${t?`bg-sage-400`:`bg-sand-300`}`,children:(0,u.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform duration-200 ${t?`translate-x-4.5`:`translate-x-0.5`}`})})}function b({item:e,disabled:t=!1}){let[n,o]=(0,l.useState)(null),[s,c]=(0,l.useState)(!1),[p,m]=(0,l.useState)(null),b=r(),x=a.useUpdateSettingMutation(),S=a.useResetSettingMutation(),C=t||x.isPending||S.isPending,w=n??e.value,T=n!==null&&n!==e.value,E=()=>b.invalidateQueries({queryKey:a.getSettingListQueryOptions().queryKey}),D=async t=>{m(null);try{await x.mutateAsync({key:e.key,value:t}),await E(),o(null)}catch(e){m(e instanceof Error?e.message:String(e))}},O=async()=>{m(null);try{await S.mutateAsync({key:e.key}),await E(),o(null)}catch(e){m(e instanceof Error?e.message:String(e))}},k=e.kind===`secret`;return(0,u.jsxs)(`div`,{className:`px-4 py-3 sm:px-5`,children:[(0,u.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,u.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,u.jsx)(`span`,{className:`text-[13px] text-sand-800`,children:e.label}),(0,u.jsx)(v,{source:e.source}),e.applies===`restart`&&(0,u.jsx)(`span`,{className:`text-[10px] text-caution-500`,title:`저장해도 다음 재시작부터 반영됩니다`,children:`재시작 필요`})]}),e.help&&(0,u.jsx)(`p`,{className:`mt-0.5 text-[11px] text-sand-500`,children:e.help})]}),(0,u.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[e.kind===`boolean`&&(0,u.jsx)(y,{label:e.label,on:w===`true`,disabled:C,onChange:e=>void D(String(e))}),e.kind===`preset`&&(0,u.jsx)(_,{value:w,presets:e.presets,disabled:C,onChange:e=>void D(e)}),(e.kind===`integer`||e.kind===`number`)&&(0,u.jsx)(g,{value:w,min:e.min,max:e.max,step:e.kind===`integer`?1:.5,disabled:C,onChange:o}),(e.kind===`string`||k)&&(0,u.jsxs)(`div`,{className:`relative`,children:[(0,u.jsx)(`input`,{value:k&&!s?h(w):w,onChange:e=>o(e.target.value),onFocus:()=>k&&c(!0),disabled:C,className:`w-48 sm:w-64 rounded-lg border border-sand-200/80 bg-white py-1.5 pl-2.5 text-[12px] text-sand-800 focus:outline-none focus:border-sienna-300 ${k?`pr-8 font-mono`:`pr-2.5`}`}),k&&(0,u.jsx)(`button`,{type:`button`,"aria-label":s?`값 숨기기`:`값 보기`,onClick:()=>c(e=>!e),className:`absolute right-1.5 top-1/2 -translate-y-1/2 size-6 grid place-items-center text-sand-400 hover:text-sand-600 transition-colors duration-150`,children:s?(0,u.jsx)(f,{className:`size-3.5`}):(0,u.jsx)(d,{className:`size-3.5`})})]}),T&&(0,u.jsx)(`button`,{type:`button`,onClick:()=>void D(w),disabled:C,className:`px-2.5 py-1.5 text-[11px] font-medium rounded-lg bg-sienna-400 text-white hover:bg-sienna-500 disabled:opacity-50 transition-colors duration-150`,children:x.isPending?`저장 중`:`저장`}),!T&&e.source===`db`&&(0,u.jsx)(`button`,{type:`button`,title:`저장값을 지웁니다 — 환경변수 또는 기본값으로 돌아갑니다`,onClick:()=>void O(),disabled:C,className:`size-7 grid place-items-center rounded-lg text-sand-400 hover:text-sand-600 hover:bg-sand-100 disabled:opacity-50 transition-colors duration-150`,children:(0,u.jsx)(i,{className:`size-3.5`})})]})]}),p&&(0,u.jsx)(`p`,{className:`mt-1.5 text-[11px] text-red-500`,children:p})]})}function x({runnerEnabled:e}){let t=r(),[n,i]=(0,l.useState)(null),a=o.useTokens(`A`,{orderBy:`ord-asc`,num:100}),c=s(),d=(a.data?.rows??[]).filter(e=>e.provider===`anthropic`),f=async(e,n)=>{i(null);try{await c.mutateAsync({id:e,keepaliveEnabled:n}),await t.invalidateQueries({queryKey:[`Token`,`getTokens`]})}catch(e){i(e instanceof Error?e.message:String(e))}};return(0,u.jsxs)(`div`,{className:`border-t border-sand-100/80 bg-sand-50/40 px-4 py-3 sm:px-5`,children:[(0,u.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`text-[11px] font-medium text-sand-600`,children:`토큰별 keepalive`}),(0,u.jsx)(`p`,{className:`mt-0.5 text-[10px] text-sand-400`,children:e?`켜진 활성 Anthropic 토큰만 5시간 윈도우를 유지합니다`:`이 인스턴스는 keepalive runner로 지정되지 않았습니다`})]}),(0,u.jsx)(`span`,{className:`shrink-0 rounded px-1.5 py-0.5 text-[10px] ${e?`bg-sage-50 text-sage-600`:`bg-sand-100 text-sand-500`}`,children:e?`runner`:`실행 안 함`})]}),a.isLoading?(0,u.jsx)(`p`,{className:`py-2 text-[11px] text-sand-400`,children:`토큰을 불러오는 중…`}):d.length===0?(0,u.jsx)(`p`,{className:`py-2 text-[11px] text-sand-400`,children:`등록된 Anthropic 토큰이 없습니다`}):(0,u.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-sand-200/70 bg-white`,children:d.map(t=>(0,u.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-b border-sand-100/80 px-3 py-2 last:border-b-0`,children:[(0,u.jsxs)(`div`,{className:`min-w-0`,children:[(0,u.jsx)(`span`,{className:`block truncate text-[12px] text-sand-700`,children:t.name}),!t.active&&(0,u.jsx)(`span`,{className:`text-[10px] text-sand-400`,children:`토큰 비활성`})]}),(0,u.jsx)(y,{label:`${t.name} keepalive`,on:t.keepalive_enabled,disabled:!e||c.isPending,onChange:e=>void f(t.id,e)})]},t.id))}),n&&(0,u.jsx)(`p`,{className:`mt-2 text-[11px] text-red-500`,children:n})]})}function S(){let[e,t]=(0,l.useState)(null),n=a.useTriggerExpiryReminderMutation(),r=async()=>{t(null);try{let{sent:e}=await n.mutateAsync();t(e===0?`재로그인이 필요한 토큰이 없습니다`:`${e}건 발송`)}catch(e){t(e instanceof Error?e.message:String(e))}};return(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e&&(0,u.jsx)(`span`,{className:`text-[11px] text-sand-500`,children:e}),(0,u.jsx)(`button`,{type:`button`,onClick:()=>void r(),disabled:n.isPending,className:`px-2 py-1 text-[11px] rounded-lg border border-sand-200/80 text-sand-600 hover:bg-sand-100 disabled:opacity-50 transition-colors duration-150`,children:n.isPending?`보내는 중`:`지금 보내기`})]})}function C(){let e=a.useSettingList(),{data:t,isLoading:n}=e;if(n)return(0,u.jsx)(`div`,{className:`space-y-4`,children:[0,1].map(e=>(0,u.jsxs)(`div`,{className:`panel overflow-hidden`,children:[(0,u.jsx)(`div`,{className:`panel-header px-4 py-2.5 sm:px-5`,children:(0,u.jsx)(`div`,{className:`h-3 w-24 rounded bg-sand-200 animate-pulse`})}),(0,u.jsx)(`div`,{className:`divide-y divide-sand-100/80`,children:[0,1,2].map(e=>(0,u.jsxs)(`div`,{className:`px-4 py-3 sm:px-5 flex items-center justify-between gap-4`,children:[(0,u.jsx)(`div`,{className:`h-3 w-40 rounded bg-sand-100 animate-pulse`}),(0,u.jsx)(`div`,{className:`h-7 w-24 rounded-lg bg-sand-100 animate-pulse`})]},e))})]},e))});if(e.isError&&!t)return(0,u.jsxs)(`div`,{className:`panel px-5 py-6 text-center`,children:[(0,u.jsx)(`p`,{className:`text-[13px] font-medium text-sand-800`,children:`설정을 불러오지 못했습니다`}),(0,u.jsx)(`p`,{className:`mt-1 text-[11px] text-red-500`,children:e.error.message}),(0,u.jsx)(`button`,{type:`button`,onClick:()=>void e.refetch(),disabled:e.isFetching,className:`mt-3 px-3 py-1.5 text-[12px] rounded-lg border border-sand-200 text-sand-600 hover:bg-sand-100 disabled:opacity-50`,children:e.isFetching?`다시 불러오는 중`:`다시 시도`})]});let r=t?.settings??[],i=t?.runtime??[],o=[...new Set(r.map(e=>e.group))];return(0,u.jsxs)(`div`,{className:`space-y-4`,children:[(0,u.jsxs)(`div`,{className:`panel overflow-hidden`,children:[(0,u.jsxs)(`div`,{className:`panel-header flex items-center justify-between px-4 py-2.5 sm:px-5`,children:[(0,u.jsx)(`span`,{className:`text-[13px] font-medium text-sand-700`,children:`환경`}),(0,u.jsx)(`span`,{className:`text-[11px] text-sand-400`,children:`기동 시점 값`})]}),(0,u.jsx)(`dl`,{className:`px-4 py-3 sm:px-5 grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-1.5`,children:i.map(e=>(0,u.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 min-w-0`,children:[(0,u.jsx)(`dt`,{className:`text-[11px] text-sand-500 shrink-0`,children:e.label}),(0,u.jsx)(`dd`,{className:`text-[12px] font-mono text-sand-700 truncate`,children:e.value})]},e.label))})]}),o.map(e=>{let n=r.filter(t=>t.group===e);return(0,u.jsxs)(`div`,{className:`panel overflow-hidden`,children:[(0,u.jsxs)(`div`,{className:`panel-header flex items-center justify-between px-4 py-2.5 sm:px-5`,children:[(0,u.jsx)(`span`,{className:`text-[13px] font-medium text-sand-700`,children:m.get(e)??e}),e===`slack`&&(0,u.jsx)(S,{})]}),(0,u.jsx)(`div`,{className:`divide-y divide-sand-100/80`,children:n.map(e=>(0,u.jsxs)(`div`,{children:[(0,u.jsx)(b,{item:e,disabled:e.key===`qgrid.tokenWindowKeepaliveEnabled`&&!t?.keepaliveRunnerEnabled}),e.key===`qgrid.tokenWindowKeepaliveEnabled`&&(0,u.jsx)(x,{runnerEnabled:t?.keepaliveRunnerEnabled??!1})]},e.key))})]},e)})]})}function w(){return(0,u.jsx)(`div`,{className:`max-w-4xl mx-auto`,children:(0,u.jsx)(C,{})})}export{w as component};
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n}from"./vendor-react-8xo7RSum.js";import{g as r,u as i}from"./vendor-tanstack-6B86itGS.js";import{S as a,_ as o,c as s,d as c,f as l,g as u,h as d,m as f,p,s as m,t as h,v as g,x as _,y as v}from"./index-DplV-wqZ.js";import{n as y,t as b}from"./cost-CZzlCFS2.js";import{n as x,t as S}from"./request-model-Dl31cZdf.js";function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},C.apply(null,arguments)}function w(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var T=e(t()),E=n(),D={},ee=(0,T.createContext)(D),te=(e,t)=>C({},e,t),ne=()=>(0,T.useContext)(ee),O=(0,T.createContext)(()=>{});O.displayName=`JVR.DispatchShowTools`;function re(){return(0,T.useReducer)(te,D)}function ie(){return(0,T.useContext)(O)}var ae=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,E.jsx)(ee.Provider,{value:t,children:(0,E.jsx)(O.Provider,{value:n,children:r})})};ae.displayName=`JVR.ShowTools`;var oe={},se=(0,T.createContext)(oe),ce=(e,t)=>C({},e,t),k=()=>(0,T.useContext)(se),A=(0,T.createContext)(()=>{});A.displayName=`JVR.DispatchExpands`;function le(){return(0,T.useReducer)(ce,oe)}function ue(){return(0,T.useContext)(A)}var de=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,E.jsx)(se.Provider,{value:t,children:(0,E.jsx)(A.Provider,{value:n,children:r})})};de.displayName=`JVR.Expands`;var fe={Str:{as:`span`,"data-type":`string`,style:{color:`var(--w-rjv-type-string-color, #cb4b16)`},className:`w-rjv-type`,children:`string`},Url:{as:`a`,style:{color:`var(--w-rjv-type-url-color, #0969da)`},"data-type":`url`,className:`w-rjv-type`,children:`url`},Undefined:{style:{color:`var(--w-rjv-type-undefined-color, #586e75)`},as:`span`,"data-type":`undefined`,className:`w-rjv-type`,children:`undefined`},Null:{style:{color:`var(--w-rjv-type-null-color, #d33682)`},as:`span`,"data-type":`null`,className:`w-rjv-type`,children:`null`},Map:{style:{color:`var(--w-rjv-type-map-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`map`,className:`w-rjv-type`,children:`Map`},Nan:{style:{color:`var(--w-rjv-type-nan-color, #859900)`},as:`span`,"data-type":`nan`,className:`w-rjv-type`,children:`NaN`},Bigint:{style:{color:`var(--w-rjv-type-bigint-color, #268bd2)`},as:`span`,"data-type":`bigint`,className:`w-rjv-type`,children:`bigint`},Int:{style:{color:`var(--w-rjv-type-int-color, #268bd2)`},as:`span`,"data-type":`int`,className:`w-rjv-type`,children:`int`},Set:{style:{color:`var(--w-rjv-type-set-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`set`,className:`w-rjv-type`,children:`Set`},Float:{style:{color:`var(--w-rjv-type-float-color, #859900)`},as:`span`,"data-type":`float`,className:`w-rjv-type`,children:`float`},True:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},False:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},Date:{style:{color:`var(--w-rjv-type-date-color, #268bd2)`},as:`span`,"data-type":`date`,className:`w-rjv-type`,children:`date`}},pe=(0,T.createContext)(fe),me=(e,t)=>C({},e,t),j=()=>(0,T.useContext)(pe),he=(0,T.createContext)(()=>{});he.displayName=`JVR.DispatchTypes`;function ge(){return(0,T.useReducer)(me,fe)}function _e(){return(0,T.useContext)(he)}function ve(e){var{initial:t,dispatch:n,children:r}=e;return(0,E.jsx)(pe.Provider,{value:t,children:(0,E.jsx)(he.Provider,{value:n,children:r})})}ve.displayName=`JVR.Types`;var ye=[`style`];function be(e){var{style:t}=e,n=w(e,ye),r=C({cursor:`pointer`,height:`1em`,width:`1em`,userSelect:`none`,display:`inline-flex`},t);return(0,E.jsx)(`svg`,C({viewBox:`0 0 24 24`,fill:`var(--w-rjv-arrow-color, currentColor)`,style:r},n,{children:(0,E.jsx)(`path`,{d:`M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z`})}))}be.displayName=`JVR.TriangleArrow`;var xe={Arrow:{as:`span`,className:`w-rjv-arrow`,style:{transform:`rotate(0deg)`,transition:`all 0.3s`},children:(0,E.jsx)(be,{})},Colon:{as:`span`,style:{color:`var(--w-rjv-colon-color, var(--w-rjv-color))`,marginLeft:0,marginRight:2},className:`w-rjv-colon`,children:`:`},Quote:{as:`span`,style:{color:`var(--w-rjv-quotes-color, #236a7c)`},className:`w-rjv-quotes`,children:`"`},ValueQuote:{as:`span`,style:{color:`var(--w-rjv-quotes-string-color, #cb4b16)`},className:`w-rjv-quotes`,children:`"`},BracketsLeft:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-start`,children:`[`},BracketsRight:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-end`,children:`]`},BraceLeft:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-start`,children:`{`},BraceRight:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-end`,children:`}`}},Se=(0,T.createContext)(xe),Ce=(e,t)=>C({},e,t),M=()=>(0,T.useContext)(Se),we=(0,T.createContext)(()=>{});we.displayName=`JVR.DispatchSymbols`;function Te(){return(0,T.useReducer)(Ce,xe)}function Ee(){return(0,T.useContext)(we)}var De=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,E.jsx)(Se.Provider,{value:t,children:(0,E.jsx)(we.Provider,{value:n,children:r})})};De.displayName=`JVR.Symbols`;var Oe={Copied:{className:`w-rjv-copied`,style:{height:`1em`,width:`1em`,cursor:`pointer`,verticalAlign:`middle`,marginLeft:5}},CountInfo:{as:`span`,className:`w-rjv-object-size`,style:{color:`var(--w-rjv-info-color, #0000004d)`,paddingLeft:8,fontStyle:`italic`}},CountInfoExtra:{as:`span`,className:`w-rjv-object-extra`,style:{paddingLeft:8}},Ellipsis:{as:`span`,style:{cursor:`pointer`,color:`var(--w-rjv-ellipsis-color, #cb4b16)`,userSelect:`none`},className:`w-rjv-ellipsis`,children:`...`},Row:{as:`div`,className:`w-rjv-line`},KeyName:{as:`span`,className:`w-rjv-object-key`}},ke=(0,T.createContext)(Oe),Ae=(e,t)=>C({},e,t),N=()=>(0,T.useContext)(ke),je=(0,T.createContext)(()=>{});je.displayName=`JVR.DispatchSection`;function Me(){return(0,T.useReducer)(Ae,Oe)}function Ne(){return(0,T.useContext)(je)}var Pe=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,E.jsx)(ke.Provider,{value:t,children:(0,E.jsx)(je.Provider,{value:n,children:r})})};Pe.displayName=`JVR.Section`;var Fe={objectSortKeys:!1,indentWidth:15},P=(0,T.createContext)(Fe);P.displayName=`JVR.Context`;var Ie=(0,T.createContext)(()=>{});Ie.displayName=`JVR.DispatchContext`;function Le(e,t){return C({},e,t)}var F=()=>(0,T.useContext)(P),Re=e=>{var{children:t,initialState:n,initialTypes:r}=e,[i,a]=(0,T.useReducer)(Le,Object.assign({},Fe,n)),[o,s]=re(),[c,l]=le(),[u,d]=ge(),[f,p]=Te(),[m,h]=Me();return(0,T.useEffect)(()=>a(C({},n)),[n]),(0,E.jsx)(P.Provider,{value:i,children:(0,E.jsx)(Ie.Provider,{value:a,children:(0,E.jsx)(ae,{initial:o,dispatch:s,children:(0,E.jsx)(de,{initial:c,dispatch:l,children:(0,E.jsx)(ve,{initial:C({},u,r),dispatch:d,children:(0,E.jsx)(De,{initial:f,dispatch:p,children:(0,E.jsx)(Pe,{initial:m,dispatch:h,children:t})})})})})})})};Re.displayName=`JVR.Provider`;function ze(e){if(e==null)throw TypeError(`Cannot destructure `+e)}var Be=[`isNumber`,`value`,`parentValue`,`keyName`,`keys`],Ve=[`as`,`render`],He=[`as`,`render`],Ue=[`as`,`render`],We=[`as`,`style`,`render`],Ge=[`as`,`render`],Ke=[`as`,`render`],qe=[`as`,`render`],Je=[`as`,`render`],I=e=>{var{Quote:t={}}=M(),{isNumber:n,value:r,parentValue:i,keyName:a,keys:o}=e,s=w(e,Be);if(n)return null;var{as:c,render:l}=t,u=w(t,Ve),d=c||`span`,f=C({},s,u);return typeof f.children==`string`&&(f.children=f.children.trim()||void 0),l&&typeof l==`function`&&l(f,{value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])})||(0,E.jsx)(d,C({},f))};I.displayName=`JVR.Quote`;var L=e=>{var{ValueQuote:t={}}=M(),n=C({},(ze(e),e)),{as:r,render:i}=t,a=w(t,He),o=r||`span`,s=C({},n,a);return i&&typeof i==`function`&&i(s,{})||(0,E.jsx)(o,C({},s))};L.displayName=`JVR.ValueQuote`;var Ye=e=>{var{value:t,parentValue:n,keyName:r,keys:i}=e,{Colon:a={}}=M(),{as:o,render:s}=a,c=w(a,Ue),l=o||`span`;return s&&typeof s==`function`&&s(c,{value:t,parentValue:n,keyName:r,keys:i||(r?[r]:[])})||(0,E.jsx)(l,C({},c))};Ye.displayName=`JVR.Colon`;var Xe=e=>{var{Arrow:t={}}=M(),n=k(),{expandKey:r,style:i,value:a,parentValue:o,keyName:s,keys:c}=e,l=!!n[r],{as:u,style:d,render:f}=t,p=w(t,We),m=u||`span`,h=f&&typeof f==`function`,g=C({},p,{"data-expanded":l,style:C({},d,i)});return h&&f(g,{value:a,parentValue:o,keyName:s,keys:c||(s?[s]:[])})||(0,E.jsx)(m,C({},p,{style:C({},d,i)}))};Xe.displayName=`JVR.Arrow`;var Ze=e=>{var{isBrackets:t,value:n,parentValue:r,keyName:i,keys:a}=e,{BracketsLeft:o={},BraceLeft:s={}}=M(),c={value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])};if(t){var{as:l,render:u}=o,d=w(o,Ge),f=l||`span`;return u&&typeof u==`function`&&u(d,c)||(0,E.jsx)(f,C({},d))}var{as:p,render:m}=s,h=w(s,Ke),g=p||`span`;return m&&typeof m==`function`&&m(h,c)||(0,E.jsx)(g,C({},h))};Ze.displayName=`JVR.BracketsOpen`;var R=e=>{var{isBrackets:t,isVisiable:n,value:r,parentValue:i,keyName:a,keys:o}=e,s={value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])};if(!n)return null;var{BracketsRight:c={},BraceRight:l={}}=M();if(t){var{as:u,render:d}=c,f=w(c,qe),p=u||`span`;return d&&typeof d==`function`&&d(f,s)||(0,E.jsx)(p,C({},f))}var{as:m,render:h}=l,g=w(l,Je),_=m||`span`;return h&&typeof h==`function`&&h(g,s)||(0,E.jsx)(_,C({},g))};R.displayName=`JVR.BracketsClose`;var Qe=e=>{var{keyName:t,value:n,expandKey:r,parentValue:i,level:a,keys:o=[]}=e,s=k(),{collapsed:c,shouldExpandNodeInitially:l}=F(),u=typeof c==`boolean`?c:typeof c==`number`&&a>c,d=s[r]??(!l&&u),f=l&&l(!d,{value:n,keys:o,level:a,keyName:t,parentValue:i});if(l&&c===!1){if(s[r]===void 0&&!f)return null}else if(s[r]===void 0&&f)return null;var p=Object.keys(n).length;if(d||p===0)return null;var m={paddingLeft:4},h={keyName:t,value:n,keys:o,parentValue:i},g=Array.isArray(n),_=n instanceof Set;return(0,E.jsx)(`div`,{style:m,children:(0,E.jsx)(R,C({isBrackets:g||_},h,{isVisiable:!0}))})};Qe.displayName=`JVR.NestedClose`;var $e=[`as`,`render`],et=[`as`,`render`],tt=[`as`,`render`],nt=[`as`,`render`],rt=[`as`,`render`],it=[`as`,`render`],at=[`as`,`render`],ot=[`as`,`render`],st=[`as`,`render`],ct=[`as`,`render`],lt=[`as`,`render`],ut=[`as`,`render`],dt=[`as`,`render`],z=e=>{if(e===void 0)return`0n`;if(typeof e==`string`)try{e=BigInt(e)}catch{return`0n`}return e?e.toString()+`n`:`0n`},ft=e=>{var{value:t,keyName:n}=e,{Set:r={},displayDataTypes:i}=j();if(!(t instanceof Set)||!i)return null;var{as:a,render:o}=r,s=w(r,$e);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,E.jsx)(a||`span`,C({},s))};ft.displayName=`JVR.SetComp`;var pt=e=>{var{value:t,keyName:n}=e,{Map:r={},displayDataTypes:i}=j();if(!(t instanceof Map)||!i)return null;var{as:a,render:o}=r,s=w(r,et);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,E.jsx)(a||`span`,C({},s))};pt.displayName=`JVR.MapComp`;var B={opacity:.75,paddingRight:4},mt=e=>{var{children:t=``,keyName:n,keys:r}=e,{Str:i={},displayDataTypes:a}=j(),{shortenTextAfterLength:o=30,stringEllipsis:s=`...`}=F(),{as:c,render:l}=i,u=w(i,tt),d=t,[f,p]=(0,T.useState)(o&&d.length>o);(0,T.useEffect)(()=>p(o&&d.length>o),[o]);var m=c||`span`,h=C({},B,i.style||{});o>0&&(u.style=C({},u.style,{cursor:d.length<=o?`initial`:`pointer`}),d.length>o&&(u.onClick=()=>{p(!f)}));var g=f?``+d.slice(0,o)+s:d,_=l&&typeof l==`function`,v=_&&l(C({},u,{style:h}),{type:`type`,value:t,keyName:n,keys:r}),y=f?`w-rjv-value w-rjv-value-short`:`w-rjv-value`,b=_&&l(C({},u,{children:g,className:y}),{type:`value`,value:t,keyName:n,keys:r});return(0,E.jsxs)(T.Fragment,{children:[a&&(v||(0,E.jsx)(m,C({},u,{style:h}))),b||(0,E.jsxs)(T.Fragment,{children:[(0,E.jsx)(L,{}),(0,E.jsx)(m,C({},u,{className:y,children:g})),(0,E.jsx)(L,{})]})]})};mt.displayName=`JVR.TypeString`;var ht=e=>{var{children:t,keyName:n,keys:r}=e,{True:i={},displayDataTypes:a}=j(),{as:o,render:s}=i,c=w(i,nt),l=o||`span`,u=C({},B,i.style||{}),d=s&&typeof s==`function`,f=d&&s(C({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(C({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,E.jsxs)(T.Fragment,{children:[a&&(f||(0,E.jsx)(l,C({},c,{style:u}))),p||(0,E.jsx)(l,C({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};ht.displayName=`JVR.TypeTrue`;var gt=e=>{var{children:t,keyName:n,keys:r}=e,{False:i={},displayDataTypes:a}=j(),{as:o,render:s}=i,c=w(i,rt),l=o||`span`,u=C({},B,i.style||{}),d=s&&typeof s==`function`,f=d&&s(C({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(C({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,E.jsxs)(T.Fragment,{children:[a&&(f||(0,E.jsx)(l,C({},c,{style:u}))),p||(0,E.jsx)(l,C({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};gt.displayName=`JVR.TypeFalse`;var _t=e=>{var{children:t,keyName:n,keys:r}=e,{Float:i={},displayDataTypes:a}=j(),{as:o,render:s}=i,c=w(i,it),l=o||`span`,u=C({},B,i.style||{}),d=s&&typeof s==`function`,f=d&&s(C({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(C({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,E.jsxs)(T.Fragment,{children:[a&&(f||(0,E.jsx)(l,C({},c,{style:u}))),p||(0,E.jsx)(l,C({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};_t.displayName=`JVR.TypeFloat`;var vt=e=>{var{children:t,keyName:n,keys:r}=e,{Int:i={},displayDataTypes:a}=j(),{as:o,render:s}=i,c=w(i,at),l=o||`span`,u=C({},B,i.style||{}),d=s&&typeof s==`function`,f=d&&s(C({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(C({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,E.jsxs)(T.Fragment,{children:[a&&(f||(0,E.jsx)(l,C({},c,{style:u}))),p||(0,E.jsx)(l,C({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};vt.displayName=`JVR.TypeInt`;var yt=e=>{var{children:t,keyName:n,keys:r}=e,{Bigint:i={},displayDataTypes:a}=j(),{as:o,render:s}=i,c=w(i,ot),l=o||`span`,u=C({},B,i.style||{}),d=s&&typeof s==`function`,f=d&&s(C({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(C({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,E.jsxs)(T.Fragment,{children:[a&&(f||(0,E.jsx)(l,C({},c,{style:u}))),p||(0,E.jsx)(l,C({},c,{className:`w-rjv-value`,children:z(t?.toString())}))]})};yt.displayName=`JVR.TypeFloat`;var bt=e=>{var{children:t,keyName:n,keys:r}=e,{Url:i={},displayDataTypes:a}=j(),{as:o,render:s}=i,c=w(i,st),l=o||`span`,u=C({},B,i.style),d=s&&typeof s==`function`,f=d&&s(C({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(C({},c,{children:t?.href,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,E.jsxs)(T.Fragment,{children:[a&&(f||(0,E.jsx)(l,C({},c,{style:u}))),p||(0,E.jsxs)(`a`,C({href:t?.href,target:`_blank`},c,{className:`w-rjv-value`,children:[(0,E.jsx)(L,{}),t?.href,(0,E.jsx)(L,{})]}))]})};bt.displayName=`JVR.TypeUrl`;var xt=e=>{var{children:t,keyName:n,keys:r}=e,{Date:i={},displayDataTypes:a}=j(),{as:o,render:s}=i,c=w(i,ct),l=o||`span`,u=C({},B,i.style||{}),d=s&&typeof s==`function`,f=d&&s(C({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=t instanceof Date?t.toLocaleString():t,m=d&&s(C({},c,{children:p,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,E.jsxs)(T.Fragment,{children:[a&&(f||(0,E.jsx)(l,C({},c,{style:u}))),m||(0,E.jsx)(l,C({},c,{className:`w-rjv-value`,children:p}))]})};xt.displayName=`JVR.TypeDate`;var St=e=>{var{children:t,keyName:n,keys:r}=e,{Undefined:i={},displayDataTypes:a}=j(),{as:o,render:s}=i,c=w(i,lt),l=o||`span`,u=C({},B,i.style||{}),d=s&&typeof s==`function`,f=d&&s(C({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(C({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,E.jsxs)(T.Fragment,{children:[a&&(f||(0,E.jsx)(l,C({},c,{style:u}))),p]})};St.displayName=`JVR.TypeUndefined`;var Ct=e=>{var{children:t,keyName:n,keys:r}=e,{Null:i={},displayDataTypes:a}=j(),{as:o,render:s}=i,c=w(i,ut),l=o||`span`,u=C({},B,i.style||{}),d=s&&typeof s==`function`,f=d&&s(C({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(C({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,E.jsxs)(T.Fragment,{children:[a&&(f||(0,E.jsx)(l,C({},c,{style:u}))),p]})};Ct.displayName=`JVR.TypeNull`;var wt=e=>{var{children:t,keyName:n,keys:r}=e,{Nan:i={},displayDataTypes:a}=j(),{as:o,render:s}=i,c=w(i,dt),l=o||`span`,u=C({},B,i.style||{}),d=s&&typeof s==`function`,f=d&&s(C({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(C({},c,{children:t?.toString(),className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,E.jsxs)(T.Fragment,{children:[a&&(f||(0,E.jsx)(l,C({},c,{style:u}))),p]})};wt.displayName=`JVR.TypeNan`;var Tt=e=>Number(e)===e&&e%1!=0||isNaN(e),Et=e=>{var{value:t,keyName:n,keys:r}=e,i={keyName:n,keys:r};return t instanceof URL?(0,E.jsx)(bt,C({},i,{children:t})):typeof t==`string`?(0,E.jsx)(mt,C({},i,{children:t})):t===!0?(0,E.jsx)(ht,C({},i,{children:t})):t===!1?(0,E.jsx)(gt,C({},i,{children:t})):t===null?(0,E.jsx)(Ct,C({},i,{children:t})):t===void 0?(0,E.jsx)(St,C({},i,{children:t})):t instanceof Date?(0,E.jsx)(xt,C({},i,{children:t})):typeof t==`number`&&isNaN(t)?(0,E.jsx)(wt,C({},i,{children:t})):typeof t==`number`&&Tt(t)?(0,E.jsx)(_t,C({},i,{children:t})):typeof t==`bigint`?(0,E.jsx)(yt,C({},i,{children:t})):typeof t==`number`?(0,E.jsx)(vt,C({},i,{children:t})):null};Et.displayName=`JVR.Value`;function V(e,t,n){var r=Ee(),i=[e.className,t.className].filter(Boolean).join(` `),a=C({},e,t,{className:i,style:C({},e.style,t.style),children:t.children||e.children});(0,T.useEffect)(()=>r({[n]:a}),[t])}function H(e,t,n){var r=_e(),i=[e.className,t.className].filter(Boolean).join(` `),a=C({},e,t,{className:i,style:C({},e.style,t.style),children:t.children||e.children});(0,T.useEffect)(()=>r({[n]:a}),[t])}function U(e,t,n){var r=Ne(),i=[e.className,t.className].filter(Boolean).join(` `),a=C({},e,t,{className:i,style:C({},e.style,t.style),children:t.children||e.children});(0,T.useEffect)(()=>r({[n]:a}),[t])}var Dt=[`as`,`render`],Ot=e=>{var{KeyName:t={}}=N();return U(t,e,`KeyName`),null};Ot.displayName=`JVR.KeyName`;var kt=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o={color:typeof t==`number`?`var(--w-rjv-key-number, #268bd2)`:`var(--w-rjv-key-string, #002b36)`},{KeyName:s={}}=N(),{as:c,render:l}=s,u=w(s,Dt);u.style=C({},u.style,o);var d=c||`span`;return l&&typeof l==`function`&&l(C({},u,{children:t}),{value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])})||(0,E.jsx)(d,C({},u,{children:t}))};kt.displayName=`JVR.KeyNameComp`;var At=[`children`,`value`,`parentValue`,`keyName`,`keys`],jt=[`as`,`render`,`children`],Mt=e=>{var{Row:t={}}=N();return U(t,e,`Row`),null};Mt.displayName=`JVR.Row`;var Nt=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o=w(e,At),{Row:s={}}=N(),{as:c,render:l}=s,u=w(s,jt),d=c||`div`;return l&&typeof l==`function`&&l(C({},o,u,{children:t}),{value:n,keyName:i,parentValue:r,keys:a})||(0,E.jsx)(d,C({},o,u,{children:t}))};Nt.displayName=`JVR.RowComp`;function Pt(e){var t=(0,T.useRef)();return(0,T.useEffect)(()=>{t.current=e}),t.current}function Ft(e){var{value:t,highlightUpdates:n,highlightContainer:r}=e,i=Pt(t),a=(0,T.useMemo)(()=>{if(!n||i===void 0)return!1;if(typeof t!=typeof i)return!0;if(typeof t==`number`)return isNaN(t)&&isNaN(i)?!1:t!==i;if(Array.isArray(t)!==Array.isArray(i))return!0;if(typeof t==`object`||typeof t==`function`)return!1;if(t!==i)return!0},[n,t]);(0,T.useEffect)(()=>{r&&r.current&&a&&`animate`in r.current&&r.current.animate([{backgroundColor:`var(--w-rjv-update-color, #ebcb8b)`},{backgroundColor:``}],{duration:1e3,easing:`ease-in`})},[a,t,r])}var It=[`keyName`,`value`,`parentValue`,`expandKey`,`keys`,`beforeCopy`],Lt=[`as`,`render`],W=e=>{var{keyName:t,value:n,parentValue:r,expandKey:i,keys:a,beforeCopy:o}=e,s=w(e,It),{onCopied:c,enableClipboard:l,beforeCopy:u}=F(),d=ne()[i],[f,p]=(0,T.useState)(!1),{Copied:m={}}=N(),h=m?.beforeCopy;if(l===!1||!d)return null;var g={style:{display:`inline-flex`},fill:f?`var(--w-rjv-copied-success-color, #28a745)`:`var(--w-rjv-copied-color, currentColor)`,onClick:e=>{e.stopPropagation();var s=``;s=typeof n==`number`&&n===1/0?`Infinity`:typeof n==`number`&&isNaN(n)?`NaN`:typeof n==`bigint`?z(n):n instanceof Date?n.toLocaleString():JSON.stringify(n,(e,t)=>typeof t==`bigint`?z(t):t,2);var l=o||h||u;l&&typeof l==`function`&&(s=l(s,t,n,r,i,a)),c&&c(s,n),p(!0),(navigator.clipboard||{writeText(e){return new Promise((t,n)=>{var r=document.createElement(`textarea`);r.style.position=`absolute`,r.style.opacity=`0`,r.style.left=`-99999999px`,r.value=e,document.body.appendChild(r),r.select(),document.execCommand(`copy`)?t():n(),r.remove()})}}).writeText(s).then(()=>{var e=setTimeout(()=>{p(!1),clearTimeout(e)},3e3)}).catch(e=>{})}},{render:_}=m,v=w(m,Lt),y=C({},v,s,g,{style:C({},v.style,s.style,g.style)});return _&&typeof _==`function`&&_(C({},y,{"data-copied":f}),{value:n,keyName:t,keys:a,parentValue:r})||(f?(0,E.jsx)(`svg`,C({viewBox:`0 0 32 36`},y,{children:(0,E.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})):(0,E.jsx)(`svg`,C({viewBox:`0 0 32 36`},y,{children:(0,E.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})))};W.displayName=`JVR.Copied`;function Rt(){var e=(0,T.useRef)(null);return e.current===null&&(e.current=`custom-id-`+Math.random().toString(36).substr(2,9)),e.current}var zt=e=>{var{keyName:t,value:n,expandKey:r=``,level:i,keys:a=[],parentValue:o}=e,s=k(),{objectSortKeys:c,indentWidth:l,collapsed:u,shouldExpandNodeInitially:d}=F(),f=typeof u==`boolean`?u:typeof u==`number`&&i>u,p=s[r]??(!d&&f),m=d&&d(!p,{value:n,keys:a,level:i,keyName:t,parentValue:o});if(d&&u===!1){if(s[r]===void 0&&!m)return null}else if(s[r]===void 0&&m)return null;if(p)return null;var h=Array.isArray(n)?Object.entries(n).map(e=>[Number(e[0]),e[1]]):Object.entries(n);return c&&(h=c===!0?h.sort((e,t)=>{var[n]=e,[r]=t;return typeof n==`string`&&typeof r==`string`?n.localeCompare(r):0}):h.sort((e,t)=>{var[n,r]=e,[i,a]=t;return typeof n==`string`&&typeof i==`string`?c(n,i,r,a):0})),(0,E.jsx)(`div`,{className:`w-rjv-wrap`,style:{borderLeft:`var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)`,paddingLeft:l,marginLeft:6},children:h.map((e,t)=>{var[r,o]=e;return(0,E.jsx)(Vt,{parentValue:n,keyName:r,keys:[...a,r],value:o,level:i},t)})})};zt.displayName=`JVR.KeyValues`;var Bt=e=>{var{keyName:t,parentValue:n,keys:r,value:i}=e,{highlightUpdates:a}=F(),o=typeof t==`number`,s=(0,T.useRef)(null);Ft({value:i,highlightUpdates:a,highlightContainer:s});var c={keyName:t,value:i,keys:r,parentValue:n};return(0,E.jsxs)(T.Fragment,{children:[(0,E.jsxs)(`span`,{ref:s,children:[(0,E.jsx)(I,C({isNumber:o,"data-placement":`left`},c)),(0,E.jsx)(kt,C({},c,{children:t})),(0,E.jsx)(I,C({isNumber:o,"data-placement":`right`},c))]}),(0,E.jsx)(Ye,C({},c))]})};Bt.displayName=`JVR.KayName`;var Vt=e=>{var{keyName:t,value:n,parentValue:r,level:i=0,keys:a=[]}=e,o=ie(),s=Rt(),c=Array.isArray(n),l=n instanceof Set,u=n instanceof Map,d=n instanceof Date,f=n instanceof URL;if(n&&typeof n==`object`&&!c&&!l&&!u&&!d&&!f||c||l||u){var p=l?Array.from(n):u?Object.fromEntries(n):n;return(0,E.jsx)(tn,{keyName:t,value:p,parentValue:r,initialValue:n,keys:a,level:i+1})}return(0,E.jsxs)(Nt,C({className:`w-rjv-line`,value:n,keyName:t,keys:a,parentValue:r},{onMouseEnter:()=>o({[s]:!0}),onMouseLeave:()=>o({[s]:!1})},{children:[(0,E.jsx)(Bt,{keyName:t,value:n,keys:a,parentValue:r}),(0,E.jsx)(Et,{keyName:t,value:n,keys:a}),(0,E.jsx)(W,{keyName:t,value:n,keys:a,parentValue:r,expandKey:s})]}))};Vt.displayName=`JVR.KeyValuesItem`;var Ht=[`value`,`keyName`],Ut=[`as`,`render`],Wt=e=>{var{CountInfoExtra:t={}}=N();return U(t,e,`CountInfoExtra`),null};Wt.displayName=`JVR.CountInfoExtra`;var Gt=e=>{var{value:t={},keyName:n}=e,r=w(e,Ht),{CountInfoExtra:i={}}=N(),{as:a,render:o}=i,s=w(i,Ut);if(!o&&!s.children)return null;var c=a||`span`,l=o&&typeof o==`function`,u=C({},s,r);return l&&o(u,{value:t,keyName:n})||(0,E.jsx)(c,C({},u))};Gt.displayName=`JVR.CountInfoExtraComps`;var Kt=[`value`,`keyName`],qt=[`as`,`render`],Jt=e=>{var{CountInfo:t={}}=N();return U(t,e,`CountInfo`),null};Jt.displayName=`JVR.CountInfo`;var Yt=e=>{var{value:t={},keyName:n}=e,r=w(e,Kt),{displayObjectSize:i}=F(),{CountInfo:a={}}=N();if(!i)return null;var{as:o,render:s}=a,c=w(a,qt),l=o||`span`;c.style=C({},c.style,e.style);var u=Object.keys(t).length;c.children||=u+` item`+(u===1?``:`s`);var d=C({},c,r);return s&&typeof s==`function`&&s(C({},d,{"data-length":u}),{value:t,keyName:n})||(0,E.jsx)(l,C({},d))};Yt.displayName=`JVR.CountInfoComp`;var Xt=[`as`,`render`],Zt=e=>{var{Ellipsis:t={}}=N();return U(t,e,`Ellipsis`),null};Zt.displayName=`JVR.Ellipsis`;var Qt=e=>{var{isExpanded:t,value:n,keyName:r}=e,{Ellipsis:i={}}=N(),{as:a,render:o}=i,s=w(i,Xt),c=a||`span`;return o&&typeof o==`function`&&o(C({},s,{"data-expanded":t}),{value:n,keyName:r})||(!t||typeof n==`object`&&Object.keys(n).length==0?null:(0,E.jsx)(c,C({},s)))};Qt.displayName=`JVR.EllipsisComp`;var $t=e=>{var{keyName:t,expandKey:n,keys:r=[],initialValue:i,value:a,parentValue:o,level:s}=e,c=k(),l=ue(),{onExpand:u,collapsed:d,shouldExpandNodeInitially:f}=F(),p=typeof d==`boolean`?d:typeof d==`number`&&s>d,m=c[n]??(!f&&p),h=f&&f(!m,{value:a,keys:r,level:s,keyName:t,parentValue:o});c[n]===void 0&&f&&(m=!h);var g=()=>{var e={expand:!m,value:a,keyid:n,keyName:t};u&&u(e),l({[n]:e.expand})},_={display:`inline-flex`,alignItems:`center`},v={transform:`rotate(`+(m?`-90`:`0`)+`deg)`,transition:`all 0.3s`},y=Object.keys(a).length,b=typeof a==`object`,x=Array.isArray(a),S=a instanceof Set,w=y!==0&&(x||S||b),T={style:_};w&&(T.onClick=g);var D={keyName:t,value:a,keys:r,parentValue:o};return(0,E.jsxs)(`span`,C({},T,{children:[w&&(0,E.jsx)(Xe,C({style:v,expandKey:n},D)),(t||typeof t==`number`)&&(0,E.jsx)(Bt,C({},D)),(0,E.jsx)(ft,{value:i,keyName:t}),(0,E.jsx)(pt,{value:i,keyName:t}),(0,E.jsx)(Ze,C({isBrackets:x||S},D)),(0,E.jsx)(Qt,{keyName:t,value:a,isExpanded:m}),(0,E.jsx)(R,C({isVisiable:m||!w,isBrackets:x||S},D)),(0,E.jsx)(Yt,{value:a,keyName:t}),(0,E.jsx)(Gt,{value:a,keyName:t}),(0,E.jsx)(W,{keyName:t,value:a,expandKey:n,parentValue:o,keys:r})]}))};$t.displayName=`JVR.NestedOpen`;var en=[`className`,`children`,`parentValue`,`keyid`,`level`,`value`,`initialValue`,`keys`,`keyName`],tn=(0,T.forwardRef)((e,t)=>{var{className:n=``,parentValue:r,level:i=1,value:a,initialValue:o,keys:s,keyName:c}=e,l=w(e,en),u=ie(),d=Rt(),f=[n,`w-rjv-inner`].filter(Boolean).join(` `);return(0,E.jsxs)(`div`,C({className:f,ref:t},l,{onMouseEnter:()=>u({[d]:!0}),onMouseLeave:()=>u({[d]:!1})},{children:[(0,E.jsx)($t,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c,initialValue:o}),(0,E.jsx)(zt,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c}),(0,E.jsx)(Qe,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c})]}))});tn.displayName=`JVR.Container`;var nn=e=>{var{BraceLeft:t={}}=M();return V(t,e,`BraceLeft`),null};nn.displayName=`JVR.BraceLeft`;var rn=e=>{var{BraceRight:t={}}=M();return V(t,e,`BraceRight`),null};rn.displayName=`JVR.BraceRight`;var an=e=>{var{BracketsLeft:t={}}=M();return V(t,e,`BracketsLeft`),null};an.displayName=`JVR.BracketsLeft`;var on=e=>{var{BracketsRight:t={}}=M();return V(t,e,`BracketsRight`),null};on.displayName=`JVR.BracketsRight`;var sn=e=>{var{Arrow:t={}}=M();return V(t,e,`Arrow`),null};sn.displayName=`JVR.Arrow`;var cn=e=>{var{Colon:t={}}=M();return V(t,e,`Colon`),null};cn.displayName=`JVR.Colon`;var ln=e=>{var{Quote:t={}}=M();return V(t,e,`Quote`),null};ln.displayName=`JVR.Quote`;var un=e=>{var{ValueQuote:t={}}=M();return V(t,e,`ValueQuote`),null};un.displayName=`JVR.ValueQuote`;var dn=e=>{var{Bigint:t={}}=j();return H(t,e,`Bigint`),null};dn.displayName=`JVR.Bigint`;var fn=e=>{var{Date:t={}}=j();return H(t,e,`Date`),null};fn.displayName=`JVR.Date`;var pn=e=>{var{False:t={}}=j();return H(t,e,`False`),null};pn.displayName=`JVR.False`;var mn=e=>{var{Float:t={}}=j();return H(t,e,`Float`),null};mn.displayName=`JVR.Float`;var hn=e=>{var{Int:t={}}=j();return H(t,e,`Int`),null};hn.displayName=`JVR.Int`;var gn=e=>{var{Map:t={}}=j();return H(t,e,`Map`),null};gn.displayName=`JVR.Map`;var _n=e=>{var{Nan:t={}}=j();return H(t,e,`Nan`),null};_n.displayName=`JVR.Nan`;var vn=e=>{var{Null:t={}}=j();return H(t,e,`Null`),null};vn.displayName=`JVR.Null`;var yn=e=>{var{Set:t={}}=j();return H(t,e,`Set`),null};yn.displayName=`JVR.Set`;var bn=e=>{var{Str:t={}}=j();return H(t,e,`Str`),null};bn.displayName=`JVR.StringText`;var xn=e=>{var{True:t={}}=j();return H(t,e,`True`),null};xn.displayName=`JVR.True`;var Sn=e=>{var{Undefined:t={}}=j();return H(t,e,`Undefined`),null};Sn.displayName=`JVR.Undefined`;var Cn=e=>{var{Url:t={}}=j();return H(t,e,`Url`),null};Cn.displayName=`JVR.Url`;var wn=e=>{var{Copied:t={}}=N();return U(t,e,`Copied`),null};wn.displayName=`JVR.Copied`;var Tn=[`className`,`style`,`value`,`children`,`collapsed`,`shouldExpandNodeInitially`,`indentWidth`,`displayObjectSize`,`shortenTextAfterLength`,`stringEllipsis`,`highlightUpdates`,`enableClipboard`,`displayDataTypes`,`objectSortKeys`,`onExpand`,`onCopied`,`beforeCopy`],G=(0,T.forwardRef)((e,t)=>{var{className:n=``,style:r,value:i,children:a,collapsed:o=!1,shouldExpandNodeInitially:s,indentWidth:c=15,displayObjectSize:l=!0,shortenTextAfterLength:u=30,stringEllipsis:d,highlightUpdates:f=!0,enableClipboard:p=!0,displayDataTypes:m=!0,objectSortKeys:h=!1,onExpand:g,onCopied:_,beforeCopy:v}=e,y=w(e,Tn),b=C({lineHeight:1.4,fontFamily:`var(--w-rjv-font-family, Menlo, monospace)`,color:`var(--w-rjv-color, #002b36)`,backgroundColor:`var(--w-rjv-background-color, #00000000)`,fontSize:13},r),x=[`w-json-view-container`,`w-rjv`,n].filter(Boolean).join(` `);return(0,E.jsxs)(Re,{initialState:{value:i,objectSortKeys:h,indentWidth:c,shouldExpandNodeInitially:o===!1?s:void 0,displayObjectSize:l,collapsed:o,enableClipboard:p,shortenTextAfterLength:u,stringEllipsis:d,highlightUpdates:f,onCopied:_,onExpand:g,beforeCopy:v},initialTypes:{displayDataTypes:m},children:[(0,E.jsx)(tn,C({value:i},y,{ref:t,className:x,style:b})),a]})});G.Bigint=dn,G.Date=fn,G.False=pn,G.Float=mn,G.Int=hn,G.Map=gn,G.Nan=_n,G.Null=vn,G.Set=yn,G.String=bn,G.True=xn,G.Undefined=Sn,G.Url=Cn,G.ValueQuote=un,G.Arrow=sn,G.Colon=cn,G.Quote=ln,G.Ellipsis=Zt,G.BraceLeft=nn,G.BraceRight=rn,G.BracketsLeft=an,G.BracketsRight=on,G.Copied=wn,G.CountInfo=Jt,G.CountInfoExtra=Wt,G.KeyName=Ot,G.Row=Mt,G.displayName=`JVR.JsonView`;var En={"--w-rjv-font-family":`monospace`,"--w-rjv-color":`#002b36`,"--w-rjv-key-string":`#002b36`,"--w-rjv-background-color":`#ffffff`,"--w-rjv-line-color":`#ebebeb`,"--w-rjv-arrow-color":`var(--w-rjv-color)`,"--w-rjv-edit-color":`var(--w-rjv-color)`,"--w-rjv-info-color":`#0000004d`,"--w-rjv-update-color":`#ebcb8b`,"--w-rjv-copied-color":`#002b36`,"--w-rjv-copied-success-color":`#28a745`,"--w-rjv-curlybraces-color":`#236a7c`,"--w-rjv-colon-color":`#002b36`,"--w-rjv-brackets-color":`#236a7c`,"--w-rjv-quotes-color":`var(--w-rjv-key-string)`,"--w-rjv-quotes-string-color":`var(--w-rjv-type-string-color)`,"--w-rjv-type-string-color":`#cb4b16`,"--w-rjv-type-int-color":`#268bd2`,"--w-rjv-type-float-color":`#859900`,"--w-rjv-type-bigint-color":`#268bd2`,"--w-rjv-type-boolean-color":`#2aa198`,"--w-rjv-type-date-color":`#586e75`,"--w-rjv-type-url-color":`#0969da`,"--w-rjv-type-null-color":`#d33682`,"--w-rjv-type-nan-color":`#859900`,"--w-rjv-type-undefined-color":`#586e75`},Dn=(0,T.forwardRef)(({title:e,titleId:t,...n},r)=>(0,E.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,E.jsx)(`title`,{id:t,children:e}):null,(0,E.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m12 19l-7-7l7-7m7 7H5`})]})),On=(0,T.forwardRef)(({title:e,titleId:t,...n},r)=>(0,E.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,E.jsx)(`title`,{id:t,children:e}):null,(0,E.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M20 6L9 17l-5-5`})]})),K=(0,T.forwardRef)(({title:e,titleId:t,...n},r)=>(0,E.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,E.jsx)(`title`,{id:t,children:e}):null,(0,E.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m6 9l6 6l6-6`})]})),kn=(0,T.forwardRef)(({title:e,titleId:t,...n},r)=>(0,E.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,E.jsx)(`title`,{id:t,children:e}):null,(0,E.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,E.jsx)(`rect`,{width:14,height:14,x:8,y:8,rx:2,ry:2}),(0,E.jsx)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]})]}));function An(){let{id:e}=h.useSearch();return(0,E.jsx)(Cr,{id:e})}function q(e){return e.toLocaleString()}var jn=new Set,J=p();function Mn(e){try{return{ok:!0,value:J.parse(JSON.parse(e))}}catch{return{ok:!1}}}function Nn(e){if(!e)return{};try{return J.parse(JSON.parse(e))}catch{return e}}function Y({text:e,dark:t}){let[n,r]=(0,T.useState)(!1);return(0,T.useEffect)(()=>{if(!n)return;let e=setTimeout(()=>r(!1),1500);return()=>clearTimeout(e)},[n]),(0,E.jsx)(`button`,{type:`button`,className:`absolute top-2 right-2 p-1 rounded transition-colors ${t?`text-sand-500 hover:text-sand-300`:`text-sand-400 hover:text-sand-600`}`,onClick:()=>{navigator.clipboard.writeText(e),r(!0)},children:n?(0,E.jsx)(On,{className:`size-3.5 text-sage-500`}):(0,E.jsx)(kn,{className:`size-3.5`})})}var Pn=/<img\s+[^>]*src=["'](data:image\/[^"']+;base64,[^"']+)["'][^>]*(?:alt=["']([^"']*)["'][^>]*)?\/?>/gi;function Fn(e){let t=[],n=0;for(let r of e.matchAll(Pn)){let i=r.index??0;i>n&&t.push({type:`text`,text:e.slice(n,i)}),t.push({type:`image`,src:r[1],alt:r[2]??`generated image`}),n=i+r[0].length}return n<e.length&&t.push({type:`text`,text:e.slice(n)}),t.filter(e=>e.type===`image`||e.text.trim().length>0)}function In({text:e,markdown:t}){let[n,r]=(0,T.useState)(null),i=Fn(e);return i.some(e=>e.type===`image`)?(0,E.jsxs)(`div`,{className:`space-y-3`,children:[i.map((e,n)=>e.type===`text`?t?(0,E.jsx)(`div`,{className:`prose prose-sm prose-qgrid max-w-none`,children:(0,E.jsx)(a,{remarkPlugins:[_],children:e.text})},`text-${n}`):(0,E.jsx)(`pre`,{className:`text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed`,children:e.text},`text-${n}`):(0,E.jsx)(`button`,{type:`button`,className:`block max-w-full rounded-md border border-sand-200 overflow-hidden bg-white hover:border-sienna-300 transition-colors`,onClick:()=>r(e.src),title:`Open image`,children:(0,E.jsx)(`img`,{src:e.src,alt:e.alt,className:`max-h-[520px] max-w-full object-contain`,loading:`lazy`})},`image-${n}`)),n&&(0,E.jsxs)(`div`,{className:`fixed inset-0 z-50 bg-black/70 p-4 flex items-center justify-center`,onClick:e=>{e.target===e.currentTarget&&r(null)},children:[(0,E.jsx)(`button`,{type:`button`,className:`absolute top-4 right-4 p-2 rounded-full bg-white/90 text-sand-700 hover:bg-white`,onClick:()=>r(null),title:`Close image`,children:(0,E.jsx)(v,{className:`size-5`})}),(0,E.jsx)(`img`,{src:n,alt:`generated preview`,className:`max-h-full max-w-full object-contain rounded-md bg-white`})]})]}):t?(0,E.jsx)(`div`,{className:`prose prose-sm prose-qgrid max-w-none`,children:(0,E.jsx)(a,{remarkPlugins:[_],children:e})}):(0,E.jsx)(`pre`,{className:`text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed`,children:e})}function X({text:e,markdown:t}){let n=Mn(e),[r,i]=(0,T.useState)(`pretty`),a=n.ok&&n.value instanceof Object?n.value:null;return!n.ok||a===null?t?(0,E.jsx)(In,{text:e,markdown:!0}):(0,E.jsx)(In,{text:n.ok?JSON.stringify(n.value,null,2):e}):(0,E.jsxs)(`div`,{children:[(0,E.jsxs)(`div`,{className:`flex gap-1 mb-2`,children:[(0,E.jsx)(`button`,{type:`button`,className:`px-2 py-0.5 text-[10px] rounded-md transition-colors ${r===`plain`?`bg-sand-200 text-sand-700`:`text-sand-400 hover:text-sand-600`}`,onClick:()=>i(`plain`),children:`Plain`}),(0,E.jsx)(`button`,{type:`button`,className:`px-2 py-0.5 text-[10px] rounded-md transition-colors ${r===`pretty`?`bg-sand-200 text-sand-700`:`text-sand-400 hover:text-sand-600`}`,onClick:()=>i(`pretty`),children:`Pretty`})]}),r===`pretty`?(0,E.jsx)(G,{value:a,style:En,displayDataTypes:!1,enableClipboard:!0,collapsed:!1}):(0,E.jsx)(`pre`,{className:`text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed`,children:JSON.stringify(n.value,null,2)})]})}function Z({title:e,defaultOpen:t=!0,headerMetadata:n,onOpenChange:r,children:i}){let[a,o]=(0,T.useState)(t);return(0,E.jsxs)(`details`,{open:a,className:`group panel overflow-hidden`,onToggle:e=>{let t=e.currentTarget.open;o(t),r?.(t)},children:[(0,E.jsxs)(`summary`,{className:`panel-header flex min-w-0 items-center gap-1.5 whitespace-nowrap cursor-pointer select-none list-none px-4 py-2.5`,children:[(0,E.jsx)(K,{className:`size-3.5 shrink-0 text-sand-400 transition-transform group-open:rotate-0 -rotate-90`}),(0,E.jsx)(`span`,{className:`shrink-0 text-[11px] uppercase tracking-wider text-sand-500 font-medium`,children:e}),n&&(0,E.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden whitespace-nowrap text-[11px] normal-case text-sand-400`,children:n})]}),(0,E.jsx)(`div`,{className:`p-4`,children:i})]})}function Q({label:e,value:t}){return(0,E.jsxs)(`div`,{className:`min-w-0`,children:[(0,E.jsx)(`dt`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium truncate`,children:e}),(0,E.jsx)(`dd`,{className:`text-[15px] font-semibold text-sand-800 tabular-nums mt-0.5 truncate`,children:t})]})}var Ln=new Map([[`running`,`bg-blue-100 text-blue-600`],[`succeeded`,`bg-sage-100 text-sage-600`],[`error`,`bg-red-100 text-red-600`],[`aborted`,`bg-caution-400/15 text-caution-500`]]);function Rn({message:e}){return(0,E.jsxs)(`div`,{className:`panel overflow-hidden border border-red-200 bg-red-50/60`,children:[(0,E.jsx)(`div`,{className:`px-4 py-2.5 border-b border-red-100 flex items-center gap-1.5`,children:(0,E.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-red-600 font-medium`,children:`Error`})}),(0,E.jsx)(`div`,{className:`p-4`,children:(0,E.jsx)(`pre`,{className:`text-[12px] text-red-700 whitespace-pre-wrap break-words font-mono leading-relaxed max-h-80 overflow-auto`,children:e})})]})}function zn({data:e}){let t=e.status===`running`,n=S({status:e.status,requestedModel:e.requested_model_name,servedModel:e.model_name,imageCostMethod:e.image_cost_method}),r=!t&&e.requested_model_name!==null&&e.model_name===null;return(0,E.jsxs)(`div`,{className:`panel overflow-hidden px-4 py-3 flex flex-wrap items-center gap-x-2 gap-y-1.5 sm:px-5`,children:[(0,E.jsx)(`span`,{className:`text-[15px] font-semibold text-sand-900 break-all`,children:n.label===`—`?`Unknown model`:n.label}),r&&(0,E.jsx)(`span`,{className:`text-[10px] text-sand-400`,children:`요청`}),e.service_tier===`fast`&&(0,E.jsx)(`span`,{title:`Fast 모드`,className:`inline-flex shrink-0`,children:(0,E.jsx)(x,{"aria-label":`Fast 모드`,className:`size-3.5 text-[#1877F2] [&_path]:fill-current`})}),!t&&(e.fallback_count??0)>0&&(0,E.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-caution-400/15 text-caution-500 font-medium uppercase`,children:[`fallback ×`,e.fallback_count]}),e.status!==`succeeded`&&(0,E.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full font-medium uppercase ${Ln.get(e.status)??`bg-sand-100 text-sand-500`}`,children:e.status}),e.response_json_ok===!1&&(0,E.jsx)(`span`,{title:`structured 요청의 응답이 JSON 파싱에 실패했습니다`,className:`text-[10px] px-1.5 py-0.5 rounded-full bg-caution-400/15 text-caution-500 font-medium uppercase`,children:`broken json`}),e.effort&&(0,E.jsxs)(`span`,{className:`text-[11px] px-1.5 py-0.5 rounded-md bg-sand-100 text-sand-500 font-mono`,children:[`effort=`,e.effort]}),e.project_name&&(0,E.jsxs)(`span`,{className:`text-[12px] text-sand-400`,children:[`· project=`,e.project_name]}),(0,E.jsx)(`span`,{className:`ml-auto text-[11px] text-sand-400`,children:e.token_name})]})}function Bn({data:e,toolCallCount:t}){let n=qn(e);return(0,E.jsxs)(`div`,{className:`panel overflow-hidden px-5 py-3 space-y-3`,children:[(0,E.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-x-6 gap-y-3`,children:[(0,E.jsx)(Q,{label:`Duration`,value:`${(e.duration_ms/1e3).toFixed(1)}s`}),(0,E.jsx)(Q,{label:`TTFT`,value:Gn(e.ttft_ms)}),(0,E.jsx)(Q,{label:`Tokens/sec`,value:Jn(e.output_tokens,e.duration_ms,e.ttft_ms,n)}),(0,E.jsx)(Q,{label:`Driver`,value:e.cost_usd===null?`—`:y(e.cost_usd)}),(0,E.jsx)(Q,{label:`Image`,value:e.image_cost_usd===null?`—`:y(e.image_cost_usd)}),(0,E.jsx)(Q,{label:`Tool Calls`,value:`${t}회`})]}),(0,E.jsxs)(`div`,{className:`border-t border-sand-100/60 pt-3 grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-x-6 gap-y-3`,children:[(0,E.jsx)(Q,{label:`Input`,value:q(e.input_tokens)}),(0,E.jsx)(Q,{label:`Output`,value:q(e.output_tokens)}),(0,E.jsx)(Q,{label:`Cache Read`,value:q(e.cache_read_tokens)}),(0,E.jsx)(Q,{label:`Cache Write`,value:q(e.cache_creation_tokens)}),(0,E.jsx)(Q,{label:`Cache Write (5m)`,value:e.cache_creation_5m_tokens===null?`—`:q(e.cache_creation_5m_tokens)}),(0,E.jsx)(Q,{label:`Cache Write (1h)`,value:e.cache_creation_1h_tokens===null?`—`:q(e.cache_creation_1h_tokens)}),(0,E.jsx)(Q,{label:`Cache Hit`,value:b(e)})]})]})}var Vn=u({mediaType:o().optional(),data:o().optional(),url:o().optional(),byteSize:d().optional()}),Hn=f({inputImages:l(J)}),Un=f({mediaType:J.optional(),byteSize:J.optional(),url:J.optional(),data:J.optional()});function Wn(e){return e==null?`—`:e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function Gn(e){return e==null||e<=0?`—`:Wn(e)}function Kn(e){let t=e.model_name?.trim().toLowerCase();if(t){let e=t.includes(`/`)?t.split(`/`).pop():t;if(e.startsWith(`claude-`))return`anthropic`;if(/^(gpt-|codex-|o\d)/.test(e))return`openai`;if(e.startsWith(`grok-`))return`grok`}let n=e.token_name?.trim().toLowerCase();return n?.startsWith(`anthropic/`)?`anthropic`:n?.startsWith(`openai/`)?`openai`:n?.startsWith(`grok/`)?`grok`:null}function qn(e){let t=Kn(e);return t!==null&&jn.has(t)}function Jn(e,t,n,r){if(!r||e==null||t==null||n==null||n<=0)return`—`;let i=t-n;return e<=0||i<=0?`—`:`${Math.round(e/(i/1e3)).toLocaleString()} tok/s`}function $({label:e,value:t}){return(0,E.jsxs)(`div`,{className:`min-w-0 self-end`,children:[e&&(0,E.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium truncate`,children:e}),(0,E.jsx)(`div`,{className:`mt-0.5 text-[13px] font-semibold text-sand-800 tabular-nums truncate`,children:t})]})}function Yn(e){let t=Hn.safeParse(e);return t.success?t.data.inputImages.flatMap(e=>{let t=Vn.safeParse(e);return t.success&&(t.data.url||t.data.data)?[t.data]:[]}):[]}function Xn(e){let t=Un.safeParse(e);if(!t.success)return e;let n=t.data,r={};n.mediaType!==void 0&&(r.mediaType=n.mediaType),n.byteSize!==void 0&&(r.byteSize=n.byteSize);let i=o().safeParse(n.url),a=i.success&&i.data.toLowerCase().startsWith(`data:`)?`[data-url ${i.data.length} chars]`:n.url;if(a&&(r.url=a),n.data){let e=o().safeParse(n.data);r.data=e.success?`[base64 ${e.data.length} chars]`:`[base64 data]`}return r}function Zn(e){let t=Hn.safeParse(e);return!t.success||!(e instanceof Object)||Array.isArray(e)?e:{...e,inputImages:t.data.inputImages.map(Xn)}}function Qn({images:e}){let t=e.map((e,t)=>{let n=e.url&&!e.url.startsWith(`[`)?e.url:void 0,r=e.data?`data:${e.mediaType??`image/png`};base64,${e.data}`:``,i=n??r;return i?{image:e,index:t,src:i}:null}).filter(e=>e!==null);return t.length===0?null:(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2`,children:`Input Images`}),(0,E.jsx)(`div`,{className:`mt-1 grid grid-cols-1 sm:grid-cols-2 gap-2`,children:t.map(({image:e,index:t,src:n})=>(0,E.jsxs)(`div`,{className:`rounded-md border border-sand-200 bg-white overflow-hidden`,children:[(0,E.jsx)(`img`,{src:n,alt:`reference ${t+1}`,className:`max-h-64 w-full object-contain bg-white`,loading:`lazy`}),(0,E.jsxs)(`div`,{className:`px-2 py-1 text-[10px] text-sand-500 font-mono border-t border-sand-100`,children:[e.mediaType??`image`,` ·`,` `,e.byteSize===void 0?`url`:`${e.byteSize.toLocaleString()} bytes`]})]},`${e.mediaType??`image`}-${t}`))})]})}function $n({images:e,stepId:t}){let{data:n}=s.useRequestLogStep(`I`,t??0,{enabled:e===null&&t!==null}),r=n?Nn(n.tool_args):null;return(0,E.jsx)(Qn,{images:e??Yn(r)})}function er({entry:e}){let t=!!e.error,[n,r]=(0,T.useState)(!1),{data:i}=s.useRequestLogStep(`A`,e.id,{enabled:n}),a=Zn(i?Nn(i.tool_args):null),c=i?Nn(i.tool_result):null,l=o().safeParse(c),u=l.success?l.data:JSON.stringify(c),d=i?.error??e.error;return(0,E.jsxs)(`details`,{className:`group/tool`,onToggle:e=>r(e.currentTarget.open),children:[(0,E.jsxs)(`summary`,{className:`flex items-center gap-2 px-3 py-2 cursor-pointer select-none list-none hover:bg-sand-50 transition-colors rounded-md`,children:[(0,E.jsx)(K,{className:`size-3 text-sand-400 transition-transform group-open/tool:rotate-0 -rotate-90 shrink-0`}),(0,E.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-sand-100 text-sand-500 font-mono shrink-0`,children:[`call `,e.callIndex+1]}),(0,E.jsx)(`span`,{className:`text-[13px] font-medium text-sand-800 font-mono truncate`,children:e.toolName}),t&&(0,E.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-red-100 text-red-600 font-medium uppercase shrink-0`,children:`error`}),(0,E.jsx)(`span`,{className:`ml-auto text-[11px] text-sand-400 tabular-nums shrink-0`,children:Wn(e.durationMs)})]}),n&&(0,E.jsxs)(`div`,{className:`mt-1 mx-1 mb-3 space-y-2`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2`,children:`Request`}),(0,E.jsx)(`div`,{className:`mt-1 rounded-md bg-sand-50 p-3 overflow-auto`,children:(0,E.jsx)(X,{text:i?JSON.stringify(a):`Loading...`})})]}),d&&(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-red-500 font-medium px-2`,children:`Error`}),(0,E.jsx)(`div`,{className:`mt-1 rounded-md bg-red-50 border border-red-100 p-3 overflow-auto`,children:(0,E.jsx)(X,{text:d})})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2`,children:`Response`}),(0,E.jsx)(`div`,{className:`mt-1 rounded-md bg-sand-50 p-3 overflow-auto`,children:(0,E.jsx)(X,{text:i?u:`Loading...`,markdown:!0})})]})]})]})}function tr({stepId:e}){let[t,n]=(0,T.useState)(!1),{data:r}=s.useRequestLogStep(`A`,e,{enabled:t}),i=r?.reasoning_text??null;return(0,E.jsxs)(`details`,{className:`group/reason mt-3`,onToggle:e=>n(e.currentTarget.open),children:[(0,E.jsxs)(`summary`,{className:`flex items-center gap-2 cursor-pointer select-none list-none`,children:[(0,E.jsx)(K,{className:`size-3 text-sand-400 transition-transform group-open/reason:rotate-0 -rotate-90 shrink-0`}),(0,E.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium`,children:`Reasoning`})]}),t&&(0,E.jsx)(`div`,{className:`mt-2 rounded-md bg-white/70 border border-sand-100 p-3 overflow-auto`,children:i?(0,E.jsx)(X,{text:i,markdown:!0}):r?(0,E.jsx)(`p`,{className:`text-sm text-sand-400`,children:`No reasoning text captured.`}):(0,E.jsx)(`p`,{className:`text-sm text-sand-400`,children:`Loading...`})})]})}function nr({entry:e,tokensPerSecEnabled:t}){let n=e.generate,r=n!==null&&n.reasoningTokens!==null&&n.reasoningTokens!==void 0&&n.reasoningTokens>0,i=e.toolCalls.filter(e=>e.error).length;return(0,E.jsxs)(`details`,{open:!0,className:`group/step border-l border-sand-200 pl-3`,children:[(0,E.jsxs)(`summary`,{className:`flex items-center gap-2 py-2 cursor-pointer select-none list-none`,children:[(0,E.jsx)(K,{className:`size-3.5 text-sand-400 transition-transform group-open/step:rotate-0 -rotate-90 shrink-0`}),(0,E.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-sienna-100 text-sienna-700 font-mono shrink-0`,children:[`step `,e.stepIndex+1]}),(0,E.jsx)(`span`,{className:`text-[13px] font-semibold text-sand-900`,children:`LLM call`}),n?.finishReason&&(0,E.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-sand-100 text-sand-500 font-mono shrink-0`,children:n.finishReason}),n&&(n.fallbackCount??0)>0&&(0,E.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-caution-400/15 text-caution-500 font-medium uppercase shrink-0`,children:[n.requestedModelName,` → `,n.modelName]}),r&&(0,E.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-blue-100 text-blue-600 font-medium shrink-0`,children:`reasoning`}),i>0&&(0,E.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-red-100 text-red-600 font-medium uppercase shrink-0`,children:[i,` error`]}),(0,E.jsxs)(`span`,{className:`ml-auto text-[11px] text-sand-400 tabular-nums shrink-0`,children:[e.toolCalls.length,` tools`]})]}),(0,E.jsxs)(`div`,{className:`ml-4 mb-4 space-y-3`,children:[n&&(0,E.jsxs)(`div`,{className:`rounded-md border border-sand-100 bg-sand-50/70 p-3`,children:[(0,E.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 xl:grid-cols-8 gap-x-4 gap-y-3`,children:[(0,E.jsx)($,{label:`Duration`,value:Wn(n.durationMs)}),(0,E.jsx)($,{label:`TTFT`,value:Gn(n.ttftMs)}),(0,E.jsx)($,{label:`Tokens/sec`,value:Jn(n.outputTokens,n.durationMs,n.ttftMs,t)}),(0,E.jsx)($,{label:`Input`,value:q(n.inputTokens??0)}),(0,E.jsx)($,{label:`Output`,value:q(n.outputTokens??0)}),(0,E.jsx)($,{label:`Cache Read`,value:q(n.cacheReadTokens??0)}),(0,E.jsx)($,{label:`Cache Write`,value:q(n.cacheCreationTokens??0)}),(0,E.jsx)($,{label:`Cache 5m / 1h`,value:`${n.cacheCreation5mTokens===null?`—`:q(n.cacheCreation5mTokens)} / ${n.cacheCreation1hTokens===null?`—`:q(n.cacheCreation1hTokens)}`}),(0,E.jsx)($,{value:n.costUsd===null?`—`:y(n.costUsd)}),(0,E.jsx)($,{label:`Reasoning`,value:n.reasoningTokens!==null&&n.reasoningTokens!==void 0?q(n.reasoningTokens):`—`})]}),r&&(0,E.jsx)(tr,{stepId:n.id})]}),e.toolCalls.length>0&&(0,E.jsx)(`div`,{className:`space-y-0.5`,children:e.toolCalls.map(e=>(0,E.jsx)(er,{entry:e},`${e.stepIndex}-${e.callIndex}-${e.toolCallId}`))})]})]})}function rr({steps:e,tokensPerSecEnabled:t}){let n=e.reduce((e,t)=>e+t.toolCalls.length,0);return(0,E.jsx)(Z,{title:`Steps (${e.length} steps · ${n} tool calls)`,defaultOpen:!0,children:(0,E.jsx)(`div`,{className:`space-y-1`,children:e.map(e=>(0,E.jsx)(nr,{entry:e,tokensPerSecEnabled:t},e.stepIndex))})})}function ir(e){let t=new Map;function n(e){let n=t.get(e);if(n)return n;let r={stepIndex:e,generate:null,toolCalls:[]};return t.set(e,r),r}for(let t of e){let e=n(t.step_index);t.type===`generate`?e.generate={id:t.id,stepIndex:t.step_index,modelName:t.model_name,requestedModelName:t.requested_model_name,fallbackCount:t.fallback_count,inputTokens:t.input_tokens,outputTokens:t.output_tokens,cacheReadTokens:t.cache_read_tokens,cacheCreationTokens:t.cache_creation_tokens,cacheCreation5mTokens:t.cache_creation_5m_tokens,cacheCreation1hTokens:t.cache_creation_1h_tokens,costUsd:t.cost_usd,durationMs:t.duration_ms,ttftMs:t.ttft_ms,finishReason:t.finish_reason,reasoningTokens:t.reasoning_tokens}:t.type===`tool_call`&&e.toolCalls.push({id:t.id,stepIndex:t.step_index,callIndex:t.tool_call_index??e.toolCalls.length,toolCallId:t.tool_call_id??``,toolName:t.tool_name??``,durationMs:t.tool_duration_ms??0,error:t.error})}return[...t.values()].map(e=>({...e,toolCalls:e.toolCalls.toSorted((e,t)=>e.callIndex-t.callIndex)})).toSorted((e,t)=>e.stepIndex-t.stepIndex)}function ar(e){return e.type===`function_call`||e.type===`function_call_output`?`bg-caution-400/10`:e.role===`assistant`?`bg-sage-50`:`bg-sand-50`}function or(e){return e.type===`function_call`?`fn: ${e.name??`unknown`}`:e.type===`function_call_output`?`fn result`:e.role??e.type}var sr=f({text:o()}),cr=g([o(),l(g([sr,J])),J]);function lr(e){let t=o().safeParse(e);if(t.success)return t.data;let n=l(g([sr,J])).safeParse(e);return n.success?n.data.map(e=>{let t=sr.safeParse(e);return t.success?t.data.text:JSON.stringify(e)}).join(`
2
+ `):JSON.stringify(e)}function ur({className:e,children:t}){return(0,E.jsx)(`pre`,{className:`text-[12px] text-sand-700 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed max-h-40 overflow-auto ${e??``}`,children:t})}function dr({history:e}){return(0,E.jsx)(Z,{title:`History`,defaultOpen:!1,children:(0,E.jsx)(`div`,{className:`space-y-1.5`,children:e.map((e,t)=>{let n=cr.safeParse(e.content);return(0,E.jsxs)(`div`,{className:`rounded-md px-3 py-2 ${ar(e)}`,children:[(0,E.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium mb-1`,children:or(e)}),e.content!==null&&e.content!==void 0&&(0,E.jsx)(ur,{children:n.success?lr(n.data):JSON.stringify(e.content)}),e.arguments&&(0,E.jsx)(ur,{children:e.arguments}),e.output&&(0,E.jsx)(ur,{children:e.output})]},`hist-${t}`)})})})}var fr=60,pr=30,mr=18;function hr(e,t=fr){let n=[];for(let r of e){if([...n,r.name].join(`, `).length>t)break;n.push(r.name)}return{names:n,omittedCount:e.length-n.length}}function gr({tools:e}){let t=hr(e),n=hr(e,pr),r=hr(e,mr);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`span`,{className:`shrink-0`,children:`·`}),t.names.length>0&&(0,E.jsx)(`span`,{className:`hidden shrink-0 xl:inline`,children:t.names.join(`, `)}),t.omittedCount>0&&(0,E.jsxs)(`span`,{className:`hidden shrink-0 xl:inline`,children:[`+`,t.omittedCount]}),n.names.length>0&&(0,E.jsx)(`span`,{className:`hidden shrink-0 sm:inline xl:hidden`,children:n.names.join(`, `)}),n.omittedCount>0&&(0,E.jsxs)(`span`,{className:`hidden shrink-0 sm:inline xl:hidden`,children:[`+`,n.omittedCount]}),r.names.length>0&&(0,E.jsx)(`span`,{className:`shrink-0 sm:hidden`,children:r.names.join(`, `)}),r.omittedCount>0&&(0,E.jsxs)(`span`,{className:`shrink-0 sm:hidden`,children:[`+`,r.omittedCount]})]})}function _r({code:e,fullCode:t}){let n=(0,T.useMemo)(()=>xr(e),[e]);return(0,E.jsx)(`pre`,{"data-zod-parameter-schema":!0,className:`max-h-64 overflow-auto rounded-md bg-sand-900 px-3 py-2.5 font-mono text-[11px] leading-relaxed whitespace-pre text-sand-200 ${t?`cursor-help outline-none focus-visible:ring-2 focus-visible:ring-sienna-300`:``}`,tabIndex:t?0:void 0,title:t,children:t?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`span`,{"aria-hidden":`true`,children:n}),(0,E.jsx)(`span`,{className:`sr-only`,children:t})]}):n})}function vr({tool:e}){return(0,E.jsxs)(`div`,{className:`min-w-0 rounded-md border border-sand-100 bg-sand-50/70 p-3`,children:[(0,E.jsx)(`div`,{className:`break-all font-mono text-[13px] font-semibold text-sand-900`,children:e.name}),e.description&&(0,E.jsx)(`p`,{className:`mt-2 text-[12px] leading-relaxed text-sand-700`,children:e.description}),(0,E.jsxs)(`div`,{className:`mt-3`,children:[(0,E.jsxs)(`div`,{className:`mb-1.5 text-[10px] font-medium uppercase tracking-wider text-sand-400`,children:[`Parameters (`,e.parameterCount,`)`]}),(0,E.jsx)(_r,{code:e.inputZod,fullCode:e.fullInputZod})]})]})}function yr({id:e,tools:t}){let[n,i]=(0,T.useState)(!1),a=r({...m.toolsViewQueryOptions(e),enabled:n,staleTime:e=>e.state.data&&e.state.data.length>0?1/0:0,refetchOnWindowFocus:!1,refetchOnReconnect:!1}),o=a.data!==void 0&&a.data.length>0;return(0,E.jsx)(Z,{title:`Tools (${t.length})`,defaultOpen:!1,headerMetadata:(0,E.jsx)(gr,{tools:t}),onOpenChange:i,children:a.isFetching&&!o?(0,E.jsx)(`p`,{className:`text-[12px] text-sand-400`,children:`Loading tool contracts…`}):a.isError||!o?(0,E.jsx)(`p`,{className:`text-[12px] text-sand-400`,children:`Tool contracts could not be loaded.`}):(0,E.jsx)(`div`,{className:`space-y-2`,children:a.data.map((e,t)=>(0,E.jsx)(vr,{tool:e},`${e.name}-${t}`))})})}var br=/("(?:[^"\\]|\\.)*")|(\b\d+(?:\.\d+)?\b)|(\btype\b|\bz\b(?=\.))|(\b(?:string|number|boolean|null|unknown|Record)\b)|([{}[\]()<>|?:,.=])|([A-Za-z_$][\w$]*)|(\s+|.)/g;function xr(e){let t=[],n=!1;for(let r of e.matchAll(br)){let[e,i,a,o,s,c,l]=r,u=`${r.index}-${e}`;i||a?t.push((0,E.jsx)(`span`,{className:`text-sage-400`,children:e},u)):o?(n=e===`type`,t.push((0,E.jsx)(`span`,{className:`text-sienna-400`,children:e},u))):s?t.push((0,E.jsx)(`span`,{className:`text-blue-300`,children:e},u)):c?t.push((0,E.jsx)(`span`,{className:`text-sand-500`,children:e},u)):l&&n?(n=!1,t.push((0,E.jsx)(`span`,{className:`font-semibold text-sand-50`,children:e},u))):t.push(e)}return t}function Sr({id:e}){let{data:t}=m.useResponseTypeTs(e),[n,r]=(0,T.useState)(`zod`),{zod:i=null,typescript:a=null}=t??{},o=n===`zod`?i??a:a??i,s=(0,T.useMemo)(()=>o===null?null:xr(o),[o]);return!t||o===null||s===null?null:(0,E.jsxs)(`div`,{className:`panel overflow-hidden`,children:[(0,E.jsxs)(`div`,{className:`panel-header flex items-center px-4 py-2`,children:[(0,E.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-sand-500 font-medium`,children:`Response Type`}),(0,E.jsx)(`div`,{className:`ml-auto flex gap-1`,children:[{value:`zod`,label:`zod`,available:i!==null},{value:`ts`,label:`ts`,available:a!==null}].map(e=>(0,E.jsx)(`button`,{type:`button`,disabled:!e.available,className:`px-3 py-1 text-[12px] font-mono rounded-md transition-colors ${n===e.value?`bg-sand-200 text-sand-700`:`text-sand-400 hover:text-sand-600 disabled:text-sand-300 disabled:cursor-not-allowed`}`,onClick:()=>r(e.value),children:e.label},e.value))})]}),(0,E.jsxs)(`div`,{className:`relative`,children:[(0,E.jsx)(Y,{text:o,dark:!0}),(0,E.jsx)(`pre`,{className:`bg-sand-900 px-4 py-3 text-[12px] text-sand-200 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed max-h-64 overflow-auto`,children:s})]})]})}function Cr({id:e}){let{data:t,isLoading:n,error:r,isError:a,refresh:o}=m.useRequestLog(`A`,e),l=t?.status===`running`;(0,T.useEffect)(()=>{let e=l?setInterval(()=>void o(),3e3):void 0;return()=>clearInterval(e)},[l,o]);let{data:u,isLoading:d,isError:f}=s.useRequestLogSteps(`T`,{request_log_id:e,num:0,page:1,orderBy:`id-asc`}),p=ir(u?.rows??[]);if(n||d)return(0,E.jsxs)(`div`,{className:`max-w-6xl mx-auto space-y-4`,children:[(0,E.jsx)(`div`,{className:`h-4 w-32 bg-sand-200 rounded animate-pulse`}),(0,E.jsx)(`div`,{className:`h-40 panel animate-pulse`}),(0,E.jsx)(`div`,{className:`h-32 panel animate-pulse`})]});if(a||f||!t)return(0,E.jsxs)(`div`,{className:`max-w-6xl mx-auto`,children:[(0,E.jsxs)(i,{to:`/logs`,className:`flex items-center gap-1 text-[13px] text-sand-500 hover:text-sienna-500 mb-4`,children:[(0,E.jsx)(Dn,{className:`size-3.5`}),`Back to Logs`]}),(0,E.jsx)(`p`,{role:`alert`,className:`text-danger-500 text-sm`,children:a?c(r)&&r.code===404?`Request not found.`:`Failed to load request.`:f?`Failed to load request steps.`:`Request not found.`})]});let h=p.flatMap(e=>e.toolCalls),g=h.find(e=>e.toolName===`image_generation`)?.id??null,_=p.length>0,v=qn(t),y=t.history??null,b=y!==null&&y.length>0,x=t.tools??null,S=x!==null&&x.length>0,C=t.is_structured?(0,E.jsx)(Sr,{id:e}):null,w=(0,E.jsxs)(`div`,{className:`space-y-4`,children:[(0,E.jsx)(Z,{title:`System`,children:(0,E.jsxs)(`div`,{className:`relative`,children:[(0,E.jsx)(Y,{text:t.system_prompt??`null`}),(0,E.jsx)(X,{text:t.system_prompt??`null`,markdown:!0})]})}),(0,E.jsx)(Z,{title:`User`,children:(0,E.jsxs)(`div`,{className:`space-y-3`,children:[(0,E.jsxs)(`div`,{className:`relative`,children:[(0,E.jsx)(Y,{text:t.user_prompt??`null`}),(0,E.jsx)(X,{text:t.user_prompt??`null`,markdown:!0})]}),(0,E.jsx)($n,{images:t.input_images,stepId:g})]})})]});return(0,E.jsxs)(`div`,{className:`mx-auto space-y-4 ${_?`max-w-[120rem]`:`max-w-6xl`}`,children:[(0,E.jsxs)(i,{to:`/logs`,className:`inline-flex items-center gap-1 text-[13px] text-sand-500 hover:text-sienna-500 transition-colors`,children:[(0,E.jsx)(Dn,{className:`size-3.5`}),`Back to Logs`]}),(0,E.jsx)(zn,{data:t}),t.error_message&&(0,E.jsx)(Rn,{message:t.error_message}),b&&(0,E.jsx)(dr,{history:y}),_?(0,E.jsxs)(`div`,{className:`flex flex-col lg:flex-row gap-4 items-stretch lg:items-start`,children:[(0,E.jsxs)(`div`,{className:`order-1 lg:order-2 flex-1 min-w-0 space-y-4`,children:[C,S&&(0,E.jsx)(yr,{id:e,tools:x}),(0,E.jsx)(rr,{steps:p,tokensPerSecEnabled:v})]}),(0,E.jsx)(`div`,{className:`order-2 lg:order-1 flex-1 min-w-0`,children:w})]}):(0,E.jsxs)(E.Fragment,{children:[C,S&&(0,E.jsx)(yr,{id:e,tools:x}),w]}),(0,E.jsx)(Z,{title:`Response`,children:(0,E.jsxs)(`div`,{className:`relative`,children:[(0,E.jsx)(Y,{text:t.response}),(0,E.jsx)(X,{text:t.response,markdown:!0})]})}),(0,E.jsx)(Bn,{data:t,toolCallCount:h.length}),(0,E.jsx)(`div`,{className:`pb-8`})]})}export{An as component};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n}from"./vendor-react-8xo7RSum.js";import{N as r}from"./vendor-tanstack-6B86itGS.js";import{i,n as a,r as o}from"./use-oauth-login-flow-CcUdLsa7.js";import{C as s,o as c,u as l}from"./index-DplV-wqZ.js";import{t as u}from"./use-update-token-mutation-D2r5K5Bz.js";import{t as d}from"./plus-Bab0ACnC.js";var f=e(t(),1),p=n();function m(e){let t=Math.max(Math.ceil(e/1e3),0),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}function h({expiresAt:e}){let[t,n]=(0,f.useState)(()=>Date.now());return(0,f.useEffect)(()=>{let e=window.setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(e)},[]),(0,p.jsx)(`span`,{className:`tabular-nums`,children:m(e-t)})}function g({flow:e,onRestart:t}){return(0,p.jsxs)(`div`,{className:`space-y-2`,children:[e.status===`starting`&&(0,p.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[12px] text-sand-600`,children:[(0,p.jsx)(`span`,{className:`w-3.5 h-3.5 border-2 border-sand-400 border-t-transparent rounded-full animate-spin`}),`Requesting device code...`]}),e.status===`waiting`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`p`,{className:`text-[12px] text-sand-600 leading-relaxed`,children:`아래 링크를 열어 xAI 계정으로 로그인한 뒤 이 코드를 입력하세요. 승인되면 토큰이 자동으로 추가됩니다.`}),(0,p.jsxs)(`div`,{className:`rounded-md border border-sand-200 bg-sand-50 px-3 py-3 text-center`,children:[(0,p.jsx)(`p`,{className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium`,children:`Device code`}),(0,p.jsx)(`p`,{className:`mt-1 font-mono text-lg tracking-widest text-sand-900 select-all`,children:e.userCode})]}),(0,p.jsx)(`a`,{href:e.verificationUriComplete??e.verificationUri,target:`_blank`,rel:`noopener noreferrer`,className:`block w-full py-2.5 text-sm font-medium rounded-md bg-sand-900 text-white text-center hover:bg-sand-800 transition-colors duration-150`,children:`Open xAI to approve`}),(0,p.jsxs)(`p`,{className:`flex items-center justify-between text-[11px] text-sand-500`,children:[(0,p.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,p.jsx)(`span`,{className:`w-2.5 h-2.5 border-2 border-sand-400 border-t-transparent rounded-full animate-spin`}),e.slowDown?`Waiting for approval (polling slowed down)...`:`Waiting for approval...`]}),(0,p.jsxs)(`span`,{children:[`expires in `,(0,p.jsx)(h,{expiresAt:e.expiresAt})]})]})]}),e.status===`added`&&(0,p.jsxs)(`p`,{className:`text-[12px] text-sage-600`,children:[`Token "`,e.name,`" added.`]}),e.status===`expired`&&(0,p.jsx)(`p`,{className:`text-[11px] text-red-500`,children:`Device code가 만료되었습니다 — 로그인을 다시 시작하세요.`}),e.status===`error`&&(0,p.jsx)(`p`,{className:`text-[11px] text-red-500`,children:e.message}),(0,p.jsx)(`button`,{type:`button`,className:`w-full py-1.5 text-[12px] text-sand-500 hover:text-sand-700 transition-colors duration-150`,onClick:t,children:`처음부터 다시 시작`})]})}function _({light:e}){return(0,p.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,p.jsx)(`span`,{className:`w-3.5 h-3.5 border-2 border-t-transparent rounded-full animate-spin ${e?`border-white`:`border-sand-400`}`}),`Waiting for login...`]})}function v(){return(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`div`,{className:`flex-1 h-px bg-sand-200`}),(0,p.jsx)(`span`,{className:`text-[10px] text-sand-400 uppercase`,children:`or`}),(0,p.jsx)(`div`,{className:`flex-1 h-px bg-sand-200`})]})}function y({disabled:e,loadingProvider:t,onStart:n,onStartGrokDevice:r}){let i=`w-full py-2.5 text-sm font-medium rounded-md border border-sand-300 text-sand-700 hover:bg-sand-100 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2`;return(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`button`,{type:`button`,className:`w-full py-2.5 text-sm font-medium rounded-md bg-sand-900 text-white hover:bg-sand-800 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2`,disabled:e,onClick:()=>n(`openai`),children:t===`openai`?(0,p.jsx)(_,{light:!0}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(s,{className:`size-4`}),`Login with OpenAI`]})}),(0,p.jsx)(v,{}),(0,p.jsx)(`button`,{type:`button`,className:i,disabled:e,onClick:()=>n(`anthropic`),children:t===`anthropic`?(0,p.jsx)(_,{light:!1}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(s,{className:`size-4`}),`Login with Claude`]})}),(0,p.jsx)(v,{}),(0,p.jsx)(`button`,{type:`button`,className:i,disabled:e,onClick:r,children:t===`grok`?(0,p.jsx)(_,{light:!1}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(s,{className:`size-4`}),`Login with xAI`]})})]})}function b(){let[e,t]=(0,f.useState)(!1),[n,r]=(0,f.useState)(``),s=a(),c=()=>{t(!1),r(``),s.reset()},l=async e=>{await s.submitCode(e)&&c()};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`button`,{type:`button`,className:`px-3.5 py-1.5 text-[12px] font-medium rounded-lg bg-sienna-500 text-white hover:bg-sienna-600 disabled:opacity-50 transition-all duration-150 active:scale-[0.97] flex items-center gap-1.5 shadow-sm`,onClick:()=>t(!0),children:[(0,p.jsx)(d,{className:`size-3.5`}),`Add Token`]}),e&&(0,p.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center pt-[15vh]`,children:[(0,p.jsx)(`div`,{className:`absolute inset-0 bg-sand-900/8 backdrop-blur-sm`,onClick:c,onKeyDown:()=>{}}),(0,p.jsxs)(`div`,{className:`relative panel shadow-xl w-full max-w-md mx-4`,children:[(0,p.jsx)(`div`,{className:`px-5 py-4 border-b border-sand-100/50`,children:(0,p.jsx)(`h2`,{className:`text-base font-medium text-sand-900`,children:`Add Token`})}),(0,p.jsxs)(`div`,{className:`px-5 py-4 space-y-4`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{htmlFor:`token-name`,className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium`,children:`Name *`}),(0,p.jsx)(i,{value:n,onChange:e=>r(e.target.value),placeholder:`e.g. your-token-name`,className:`mt-1 w-full border border-sand-200 rounded-md px-3 py-2 text-sm text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300`})]}),s.codeEntryProvider?(0,p.jsx)(o,{provider:s.codeEntryProvider,isPending:s.completeMutation.isPending,isError:s.completeMutation.isError,onSubmit:e=>void l(e),onRestart:s.reset}):s.deviceFlow?(0,p.jsx)(g,{flow:s.deviceFlow,onRestart:s.reset}):(0,p.jsx)(y,{disabled:!n.trim()||s.loadingProvider!==null,loadingProvider:s.loadingProvider,onStart:e=>void s.start(e,n),onStartGrokDevice:()=>void s.startDevice(n,c)})]}),(0,p.jsx)(`div`,{className:`px-5 py-3 border-t border-sand-100/50 flex items-center justify-end gap-2`,children:(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150`,onClick:c,children:`Cancel`})})]})]})]})}var x=(0,f.forwardRef)(({title:e,titleId:t,...n},r)=>(0,p.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,p.jsx)(`title`,{id:t,children:e}):null,(0,p.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497zM15 5l4 4`})]})),S=(0,f.forwardRef)(({title:e,titleId:t,...n},r)=>(0,p.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,p.jsx)(`title`,{id:t,children:e}):null,(0,p.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M10 11v6m4-6v6m5-11v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})]}));function C(e){let t=e.accessToken;return t?t.length<=12?t:`${t.slice(0,8)}...${t.slice(-4)}`:`—`}function w(e){let t=e.credentials;if(`accessTokenExpiresAt`in t)return t.accessTokenExpiresAt;if(`authMode`in t){let e=Date.parse(t.expiresAt);return Number.isNaN(e)?null:e}return t.expiresAt}function T(e){if(!e)return{text:``,color:``};let t=e-Date.now();if(t<=0)return{text:`expired`,color:`text-red-500`};let n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4),i=n>0?`${n}h ${r}m`:`${r}m`;return t<36e5?{text:i,color:`text-amber-500`}:{text:i,color:`text-sand-400`}}function E({data:e,isLoading:t}){let[n,a]=(0,f.useState)(null),[o,s]=(0,f.useState)(null),[l,d]=(0,f.useState)(``),m=r(),h=c.useRemoveTokenMutation(),g=u(),_=c.useToggleTokenMutation(),v=()=>Promise.all([m.invalidateQueries({queryKey:[`Token`]}),m.invalidateQueries({queryKey:[`Qgrid`]})]),y=async e=>{await _.mutateAsync({id:e.id}),await v()},b=async()=>{n&&(await h.mutateAsync({id:n.id}),await v(),a(null))},E=e=>{s(e),d(e.name??``)},D=async()=>{o&&(await g.mutateAsync({id:o.id,name:l.trim()}),await v(),s(null))};if(t)return(0,p.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:3}).map((e,t)=>(0,p.jsx)(`div`,{className:`h-12 bg-sand-100 rounded-md animate-pulse`},`skeleton-${t}`))});let O=e??[];return O.length===0?(0,p.jsxs)(`div`,{className:`text-sand-400 text-center py-16 text-sm`,children:[`No tokens registered. Click `,(0,p.jsx)(`strong`,{className:`text-sand-600`,children:`Add Token`}),` to get started.`]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`div`,{className:`panel overflow-hidden`,children:(0,p.jsx)(`div`,{className:`overflow-x-auto`,children:(0,p.jsxs)(`table`,{className:`w-full min-w-[640px] text-[13px]`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{className:`panel-header`,children:[(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Provider`}),(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Name`}),(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Token`}),(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Status`}),(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Expires`}),(0,p.jsx)(`th`,{className:`w-20 px-3 py-2.5`,children:(0,p.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,p.jsx)(`tbody`,{className:`divide-y divide-sand-100/80`,children:O.map(e=>{let t=T(w(e));return(0,p.jsxs)(`tr`,{className:`transition-colors duration-150 hover:bg-sand-100/60 ${e.active?``:`opacity-50`}`,children:[(0,p.jsx)(`td`,{className:`px-5 py-3`,children:(0,p.jsx)(`span`,{className:`text-xs font-medium text-sand-500 uppercase`,children:e.provider})}),(0,p.jsx)(`td`,{className:`px-5 py-3`,children:e.name?(0,p.jsx)(`span`,{className:`text-sm text-sand-700`,children:e.name}):(0,p.jsx)(`span`,{className:`text-[11px] text-sand-400`,children:`—`})}),(0,p.jsx)(`td`,{className:`px-5 py-3`,children:(0,p.jsx)(`code`,{className:`text-[13px] font-mono text-sand-800`,children:C(e.credentials)})}),(0,p.jsx)(`td`,{className:`px-5 py-3`,children:(0,p.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e.active,"aria-label":`${e.name||e.provider} active`,className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors duration-200 ${e.active?`bg-sage-400`:`bg-sand-300`}`,onClick:()=>y(e),disabled:_.isPending||!e.active&&e.reauth_required,title:!e.active&&e.reauth_required?`재로그인이 필요한 토큰입니다`:void 0,children:(0,p.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform duration-200 ${e.active?`translate-x-4.5`:`translate-x-0.5`}`})})}),(0,p.jsx)(`td`,{className:`px-5 py-3`,children:t.text&&(0,p.jsx)(`span`,{className:`text-xs ${t.color}`,children:t.text})}),(0,p.jsx)(`td`,{className:`px-3 py-3`,children:(0,p.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,p.jsx)(`button`,{type:`button`,"aria-label":`Edit token`,className:`p-1 rounded text-sand-400 hover:text-sienna-500 transition-colors duration-150`,onClick:()=>E(e),children:(0,p.jsx)(x,{className:`size-4`})}),(0,p.jsx)(`button`,{type:`button`,"aria-label":`Delete token`,className:`p-1 rounded text-sand-400 hover:text-red-500 transition-colors duration-150`,onClick:()=>a(e),children:(0,p.jsx)(S,{className:`size-4`})})]})})]},e.id)})})]})})}),o&&(0,p.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center pt-[15vh]`,children:[(0,p.jsx)(`div`,{className:`absolute inset-0 bg-sand-900/8 backdrop-blur-sm`,onClick:()=>s(null),onKeyDown:()=>{}}),(0,p.jsxs)(`div`,{className:`relative panel shadow-xl w-full max-w-sm mx-4`,children:[(0,p.jsx)(`div`,{className:`px-5 py-4 border-b border-sand-100/60`,children:(0,p.jsx)(`h3`,{className:`text-base font-medium text-sand-900`,children:`Edit Token`})}),(0,p.jsx)(`div`,{className:`px-5 py-4 space-y-3`,children:(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{htmlFor:`token-name`,className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium`,children:`Name`}),(0,p.jsx)(i,{value:l,onChange:e=>d(e.target.value),placeholder:`e.g. prod, dev, team-a`,className:`mt-1 w-full border border-sand-200 rounded-md px-3 py-2 text-sm text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300`})]})}),(0,p.jsxs)(`div`,{className:`px-5 py-3 border-t border-sand-100/60 flex items-center justify-end gap-2`,children:[(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150`,onClick:()=>s(null),children:`Cancel`}),(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md bg-sienna-400 text-white hover:bg-sienna-500 disabled:opacity-50 transition-colors duration-150`,disabled:g.isPending,onClick:D,children:g.isPending?`Saving...`:`Save`})]})]})]}),n&&(0,p.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center pt-[15vh]`,children:[(0,p.jsx)(`div`,{className:`absolute inset-0 bg-sand-900/8 backdrop-blur-sm`,onClick:()=>a(null),onKeyDown:()=>{}}),(0,p.jsxs)(`div`,{className:`relative panel shadow-xl w-full max-w-sm mx-4`,children:[(0,p.jsxs)(`div`,{className:`px-5 py-4`,children:[(0,p.jsx)(`h3`,{className:`text-base font-medium text-sand-900`,children:`Remove Token`}),(0,p.jsxs)(`p`,{className:`text-sm text-sand-700 mt-2`,children:[`Are you sure you want to remove`,` `,(0,p.jsx)(`code`,{className:`text-[13px] font-mono text-sand-800`,children:C(n.credentials)}),n.name&&(0,p.jsxs)(`span`,{className:`text-sand-500`,children:[` (`,n.name,`)`]}),`?`]})]}),(0,p.jsxs)(`div`,{className:`px-5 py-3 border-t border-sand-100/60 flex items-center justify-end gap-2`,children:[(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150`,onClick:()=>a(null),children:`Cancel`}),(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md bg-red-500 text-white hover:bg-red-600 disabled:opacity-50 transition-colors duration-150`,disabled:h.isPending,onClick:b,children:h.isPending?`Removing...`:`Remove`})]})]})]})]})}function D(){let{data:e,isLoading:t}=l.useTokens(`A`);return(0,p.jsxs)(`div`,{className:`max-w-6xl mx-auto space-y-4`,children:[(0,p.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,p.jsx)(b,{})}),(0,p.jsx)(E,{data:e?.rows,isLoading:t})]})}export{D as component};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n}from"./vendor-react-8xo7RSum.js";import{N as r}from"./vendor-tanstack-6B86itGS.js";import{t as i}from"./clsx-DB0hHKMi.js";import{o as a,u as o}from"./index-DplV-wqZ.js";var s=e(t(),1),c=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},l=(e,t)=>({classGroupId:e,validator:t}),u=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),d=`-`,f=[],p=`arbitrary..`,m=e=>{let t=_(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return g(e);let n=e.split(d);return h(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?c(i,t):t:i||f}return n[e]||f}}},h=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=h(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(d):e.slice(t).join(d),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},g=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?p+r:void 0})(),_=e=>{let{theme:t,classGroups:n}=e;return v(n,t)},v=(e,t)=>{let n=u();for(let r in e){let i=e[r];y(i,n,r,t)}return n},y=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];b(i,t,n,r)}},b=(e,t,n,r)=>{typeof e==`string`?x(e,t,n):typeof e==`function`?S(e,t,n,r):C(e,t,n,r)},x=(e,t,n)=>{let r=e===``?t:w(t,e);r.classGroupId=n},S=(e,t,n,r)=>{T(e)?y(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(l(n,e)))},C=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];y(o,w(t,a),n,r)}},w=(e,t)=>{let n=e,r=t.split(d),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=u(),n.nextPart.set(t,i)),n=i}return n},T=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ee=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},E=`!`,D=`:`,te=[],O=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),k=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===D){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(E)?(c=s.slice(0,-1),l=!0):s.startsWith(E)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return O(t,l,c,u)};if(t){let e=t+D,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):O(te,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},A=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},j=e=>({cache:ee(e.cacheSize),parseClassName:k(e),sortModifiers:A(e),postfixLookupClassGroupIds:ne(e),...m(e)}),ne=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},re=/\s+/,M=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(re),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+E:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},ie=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=ae(n))&&(i&&(i+=` `),i+=r);return i},ae=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=ae(e[r]))&&(n&&(n+=` `),n+=t);return n},oe=(e,...t)=>{let n,r,i,a,o=o=>(n=j(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=M(e,n);return i(e,a),a};return a=o,(...e)=>a(ie(...e))},N=[],P=e=>{let t=t=>t[e]||N;return t.isThemeGetter=!0,t.themeKey=e,t},F=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,I=/^\((?:(\w[\w-]*):)?(.+)\)$/i,L=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,se=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,R=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ce=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,z=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,B=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,V=e=>L.test(e),H=e=>!!e&&!Number.isNaN(Number(e)),U=e=>!!e&&Number.isInteger(Number(e)),le=e=>e.endsWith(`%`)&&H(e.slice(0,-1)),W=e=>se.test(e),ue=()=>!0,G=e=>R.test(e)&&!ce.test(e),K=()=>!1,de=e=>z.test(e),fe=e=>B.test(e),pe=e=>!q(e)&&!Y(e),me=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),he=e=>Z(e,Ae,K),q=e=>F.test(e),J=e=>Z(e,je,G),ge=e=>Z(e,Me,H),_e=e=>Z(e,Pe,ue),ve=e=>Z(e,Ne,K),ye=e=>Z(e,Oe,K),be=e=>Z(e,ke,fe),xe=e=>Z(e,Fe,de),Y=e=>I.test(e),X=e=>Q(e,je),Se=e=>Q(e,Ne),Ce=e=>Q(e,Oe),we=e=>Q(e,Ae),Te=e=>Q(e,ke),Ee=e=>Q(e,Fe,!0),De=e=>Q(e,Pe,!0),Z=(e,t,n)=>{let r=F.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Q=(e,t,n=!1)=>{let r=I.exec(e);return r?r[1]?t(r[1]):n:!1},Oe=e=>e===`position`||e===`percentage`,ke=e=>e===`image`||e===`url`,Ae=e=>e===`length`||e===`size`||e===`bg-size`,je=e=>e===`length`,Me=e=>e===`number`,Ne=e=>e===`family-name`,Pe=e=>e===`number`||e===`weight`,Fe=e=>e===`shadow`,Ie=oe(()=>{let e=P(`color`),t=P(`font`),n=P(`text`),r=P(`font-weight`),i=P(`tracking`),a=P(`leading`),o=P(`breakpoint`),s=P(`container`),c=P(`spacing`),l=P(`radius`),u=P(`shadow`),d=P(`inset-shadow`),f=P(`text-shadow`),p=P(`drop-shadow`),m=P(`blur`),h=P(`perspective`),g=P(`aspect`),_=P(`ease`),v=P(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Y,q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Y,q,c],T=()=>[V,`full`,`auto`,...w()],ee=()=>[U,`none`,`subgrid`,Y,q],E=()=>[`auto`,{span:[`full`,U,Y,q]},U,Y,q],D=()=>[U,`auto`,Y,q],te=()=>[`auto`,`min`,`max`,`fr`,Y,q],O=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],k=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],A=()=>[`auto`,...w()],j=()=>[V,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ne=()=>[s,V,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],re=()=>[V,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],M=()=>[e,Y,q],ie=()=>[...b(),Ce,ye,{position:[Y,q]}],ae=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],oe=()=>[`auto`,`cover`,`contain`,we,he,{size:[Y,q]}],N=()=>[le,X,J],F=()=>[``,`none`,`full`,l,Y,q],I=()=>[``,H,X,J],L=()=>[`solid`,`dashed`,`dotted`,`double`],se=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],R=()=>[H,le,Ce,ye],ce=()=>[``,`none`,m,Y,q],z=()=>[`none`,H,Y,q],B=()=>[`none`,H,Y,q],G=()=>[H,Y,q],K=()=>[V,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[W],breakpoint:[W],color:[ue],container:[W],"drop-shadow":[W],ease:[`in`,`out`,`in-out`],font:[pe],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[W],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[W],shadow:[W],spacing:[`px`,H],text:[W],"text-shadow":[W],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,V,q,Y,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Y,q]}],"container-named":[me],columns:[{columns:[H,`auto`,q,Y,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[U,`auto`,Y,q]}],basis:[{basis:[V,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[H,V,`auto`,`initial`,`none`,q]}],grow:[{grow:[``,H,Y,q]}],shrink:[{shrink:[``,H,Y,q]}],order:[{order:[U,`first`,`last`,`none`,Y,q]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...O(),`normal`]}],"justify-items":[{"justify-items":[...k(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...k()]}],"align-content":[{content:[`normal`,...O()]}],"align-items":[{items:[...k(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...k(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...k(),`baseline`]}],"place-self":[{"place-self":[`auto`,...k()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...ne()]}],"min-inline-size":[{"min-inline":[`auto`,...ne()]}],"max-inline-size":[{"max-inline":[`none`,...ne()]}],"block-size":[{block:[`auto`,...re()]}],"min-block-size":[{"min-block":[`auto`,...re()]}],"max-block-size":[{"max-block":[`none`,...re()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...j()]}],"font-size":[{text:[`base`,n,X,J]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,De,_e]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,le,q]}],"font-family":[{font:[Se,ve,t]}],"font-features":[{"font-features":[q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Y,q]}],"line-clamp":[{"line-clamp":[H,`none`,Y,ge]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,Y,q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Y,q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...L(),`wavy`]}],"text-decoration-thickness":[{decoration:[H,`from-font`,`auto`,Y,J]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[H,`auto`,Y,q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[U,Y,q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Y,q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Y,q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},U,Y,q],radial:[``,Y,q],conic:[``,U,Y,q]},Te,be]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:N()}],"gradient-via-pos":[{via:N()}],"gradient-to-pos":[{to:N()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-bs":[{"border-bs":I()}],"border-w-be":[{"border-be":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":I()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...L(),`hidden`,`none`]}],"divide-style":[{divide:[...L(),`hidden`,`none`]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...L(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[H,Y,q]}],"outline-w":[{outline:[``,H,X,J]}],"outline-color":[{outline:M()}],shadow:[{shadow:[``,`inner`,`none`,u,Ee,xe]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":[`none`,d,Ee,xe]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:I()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[H,J]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":[`none`,f,Ee,xe]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[H,Y,q]}],"mix-blend":[{"mix-blend":[...se(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[H]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Y,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[H]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,q]}],filter:[{filter:[``,`none`,Y,q]}],blur:[{blur:ce()}],brightness:[{brightness:[H,Y,q]}],contrast:[{contrast:[H,Y,q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Ee,xe]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:[``,H,Y,q]}],"hue-rotate":[{"hue-rotate":[H,Y,q]}],invert:[{invert:[``,H,Y,q]}],saturate:[{saturate:[H,Y,q]}],sepia:[{sepia:[``,H,Y,q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Y,q]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[H,Y,q]}],"backdrop-contrast":[{"backdrop-contrast":[H,Y,q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,H,Y,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[H,Y,q]}],"backdrop-invert":[{"backdrop-invert":[``,H,Y,q]}],"backdrop-opacity":[{"backdrop-opacity":[H,Y,q]}],"backdrop-saturate":[{"backdrop-saturate":[H,Y,q]}],"backdrop-sepia":[{"backdrop-sepia":[``,H,Y,q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Y,q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[H,`initial`,Y,q]}],ease:[{ease:[`linear`,`initial`,_,Y,q]}],delay:[{delay:[H,Y,q]}],animate:[{animate:[`none`,v,Y,q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Y,q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:z()}],"rotate-x":[{"rotate-x":z()}],"rotate-y":[{"rotate-y":z()}],"rotate-z":[{"rotate-z":z()}],scale:[{scale:B()}],"scale-x":[{"scale-x":B()}],"scale-y":[{"scale-y":B()}],"scale-z":[{"scale-z":B()}],"scale-3d":[`scale-3d`],skew:[{skew:G()}],"skew-x":[{"skew-x":G()}],"skew-y":[{"skew-y":G()}],transform:[{transform:[Y,q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:K()}],"translate-x":[{"translate-x":K()}],"translate-y":[{"translate-y":K()}],"translate-z":[{"translate-z":K()}],"translate-none":[`translate-none`],zoom:[{zoom:[U,Y,q]}],accent:[{accent:M()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Y,q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Y,q]}],fill:[{fill:[`none`,...M()]}],"stroke-w":[{stroke:[H,X,J,ge]}],stroke:[{stroke:[`none`,...M()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Le(...e){return Ie(i(e))}var $=n(),Re=(0,s.forwardRef)(({title:e,titleId:t,...n},r)=>(0,$.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,$.jsx)(`title`,{id:t,children:e}):null,(0,$.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M18 6L6 18M6 6l12 12`})]}));new Map(Object.entries({Æ:`Ae`,Ð:`D`,Ø:`O`,Þ:`Th`,ß:`ss`,æ:`ae`,ð:`d`,ø:`o`,þ:`th`,Đ:`D`,đ:`d`,Ħ:`H`,ħ:`h`,ı:`i`,IJ:`IJ`,ij:`ij`,ĸ:`k`,Ŀ:`L`,ŀ:`l`,Ł:`L`,ł:`l`,ʼn:`'n`,Ŋ:`N`,ŋ:`n`,Œ:`Oe`,œ:`oe`,Ŧ:`T`,ŧ:`t`,ſ:`s`}));function ze(e){return typeof e==`function`}var Be=s.forwardRef(({className:e,type:t,onValueChange:n,onChange:r,clearable:i=!1,...a},o)=>{let c=s.useRef(null),l=s.useCallback(e=>{c.current=e,ze(o)?o(e):o&&(o.current=e)},[o]),u=a.value!==void 0,[d,f]=s.useState(()=>String(a.defaultValue??``).length>0),p=u?String(a.value??``).length>0:d,m=e=>{u||f(e.target.value.length>0),n?.(e.target.value),r?.(e)},h=()=>{let e=c.current;e&&((Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus()),u||f(!1)},g=i&&p&&!a.disabled&&!a.readOnly,_=(0,$.jsx)(`input`,{type:t,"data-slot":`input`,className:Le(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`,`aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,i&&`pr-8`,e),ref:l,...a,onChange:m});return i?(0,$.jsxs)(`div`,{className:`relative w-full`,children:[_,g&&(0,$.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":`Clear`,onMouseDown:e=>e.preventDefault(),onClick:h,className:`absolute right-2 top-1/2 -translate-y-1/2 flex items-center justify-center text-muted-foreground opacity-60 hover:opacity-100 transition-opacity cursor-pointer`,children:(0,$.jsx)(Re,{className:`h-4 w-4`})})]}):_});Be.displayName=`Input`;var Ve={openai:`새 탭에서 OpenAI 로그인을 완료한 뒤 연결 실패 화면이 나타나면, 주소창의 전체 URL을 아래에 붙여넣으세요.`,anthropic:`새 탭에서 Claude 로그인을 완료하면 코드가 표시됩니다. 코드 전체를 아래에 붙여넣으세요.`,grok:`새 탭에서 xAI(auth.x.ai) 로그인을 완료하면 127.0.0.1 주소로 이동하며 페이지가 열리지 않습니다. 주소창의 전체 URL(또는 그 안의 code 값)을 아래에 붙여넣으세요.`},He={openai:`http://localhost:1455/auth/callback?code=...&state=...`,anthropic:`code#state`,grok:`http://127.0.0.1:.../callback?code=...&state=...`};function Ue({provider:e,isPending:t,isError:n,onSubmit:r,onRestart:i}){let[a,o]=(0,s.useState)(``);return(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`p`,{className:`text-[12px] text-sand-600 leading-relaxed`,children:Ve[e]}),(0,$.jsx)(Be,{value:a,onChange:e=>o(e.target.value),placeholder:He[e],className:`w-full border border-sand-200 rounded-md px-3 py-2 text-sm font-mono text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300`}),n&&(0,$.jsx)(`p`,{className:`text-[11px] text-red-500`,children:`인증 결과 확인에 실패했습니다 — 전체 값을 다시 붙여넣거나 로그인을 다시 시작하세요.`}),(0,$.jsx)(`button`,{type:`button`,className:`w-full py-2.5 text-sm font-medium rounded-md bg-sand-900 text-white hover:bg-sand-800 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2`,disabled:!a.trim()||t,onClick:()=>r(a),children:t?(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`w-3.5 h-3.5 border-2 border-white border-t-transparent rounded-full animate-spin`}),`Verifying...`]}):`Complete login`}),(0,$.jsx)(`button`,{type:`button`,className:`w-full py-1.5 text-[12px] text-sand-500 hover:text-sand-700 transition-colors duration-150`,onClick:()=>{o(``),i()},children:`처음부터 다시 시작`})]})}var We=[`anthropic`,`openai`,`grok`];function Ge(e){return We.some(t=>t===e)}var Ke=3e3,qe=3e5,Je=5,Ye=3,Xe=`Grok login failed`;function Ze(e){if(e)try{return new URL(e).protocol===`https:`?e:void 0}catch{return}}async function Qe(e,t){let{rows:n}=await o.getTokens(`A`,{num:0,queryMode:`list`});return new Set(n.filter(n=>n.provider===e&&n.name===t).map(e=>e.id))}function $e(){let[e,t]=(0,s.useState)(null),[n,i]=(0,s.useState)(null),[o,c]=(0,s.useState)(null),l=r(),u=a.useOauthStartMutation(),d=a.useOauthStartOpenAIMutation(),f=a.useOauthStartGrokMutation(),p=a.useOauthCompleteMutation(),m=(0,s.useRef)({}),h=(0,s.useRef)(0),g=(0,s.useCallback)(()=>{h.current+=1,m.current.interval!==void 0&&clearInterval(m.current.interval),m.current.timeout!==void 0&&clearTimeout(m.current.timeout),m.current={}},[]);(0,s.useEffect)(()=>g,[g]);let _=()=>Promise.all([l.invalidateQueries({queryKey:[`Token`]}),l.invalidateQueries({queryKey:[`Qgrid`]})]);return{loadingProvider:e,codeEntryProvider:n,deviceFlow:o,start:async(e,n)=>{let r=n.trim();if(!r)return;g();let a=h.current;c(null);let o=window.open(`about:blank`,`_blank`);t(e);try{if(e===`grok`){let{authUrl:n}=await f.mutateAsync({name:r});if(a!==h.current){o?.close();return}let s=Ze(n);if(!s)throw Error(`Grok login URL is not https`);o?o.location.href=s:window.open(s,`_blank`),i(e),t(null);return}if(e===`openai`){let n=await Qe(e,r);if(a!==h.current){o?.close();return}let{authUrl:s,mode:c}=await d.mutateAsync({name:r});if(a!==h.current){o?.close();return}if(o?o.location.href=s:window.open(s,`_blank`),c===`code`){i(e),t(null);return}m.current.interval=window.setInterval(()=>{Qe(e,r).then(e=>{a===h.current&&[...e].some(e=>!n.has(e))&&(g(),t(null),_())}).catch(()=>{})},Ke),m.current.timeout=window.setTimeout(()=>{a===h.current&&(g(),t(null))},qe);return}let{authUrl:n,mode:s}=await u.mutateAsync({name:r});if(a!==h.current){o?.close();return}s===`code`?(o?o.location.href=n:window.open(n,`_blank`),i(e),t(null)):(o?.close(),window.location.href=n)}catch(e){if(o?.close(),a!==h.current)return;console.error(`OAuth start failed:`,e),t(null)}},startDevice:async(e,n)=>{let r=e.trim();if(!r)return;g();let o=h.current;i(null),t(null),c({status:`starting`});let s;try{s=await a.oauthStartGrokDevice(r)}catch(e){if(o!==h.current)return;console.error(`Grok device login start failed:`,e),c({status:`error`,message:e instanceof Error&&e.message?e.message:Xe});return}if(o!==h.current)return;let{deviceCode:l}=s,u=Ze(s.verificationUri);if(!u){c({status:`error`,message:`Grok verification URL is not https`});return}let d=Ze(s.verificationUriComplete),f=Date.now()+s.expiresIn*1e3,p=Math.max(s.interval,1),v=0,y={status:`waiting`,userCode:s.userCode,verificationUri:u,expiresAt:f,slowDown:!1};d&&(y.verificationUriComplete=d),c(y);let b=()=>{let e=Math.min(p*1e3,Math.max(f-Date.now(),0));m.current.timeout=window.setTimeout(()=>void x(),e)},x=async()=>{if(o!==h.current)return;if(Date.now()>=f){c({status:`expired`});return}let e;try{e=await a.oauthPollGrokDevice(l)}catch(e){if(o!==h.current)return;if(v+=1,v>=Ye){console.error(`Grok device login poll failed:`,e),c({status:`error`,message:e instanceof Error&&e.message?e.message:Xe});return}b();return}o===h.current&&(v=0,e.status===`added`?(c({status:`added`,name:e.name??r}),await _(),o===h.current&&n?.()):(e.status===`slow_down`?(p=e.intervalSec??p+Je,c(e=>e?.status===`waiting`?{...e,slowDown:!0}:e)):e.intervalSec!==void 0&&(p=e.intervalSec),p=Math.max(p,1),b()))};b()},submitCode:async e=>{let t=e.trim();if(!t)return!1;try{await p.mutateAsync({pastedCode:t})}catch(e){return console.error(`OAuth complete failed:`,e),!1}return await _(),!0},reset:()=>{g(),t(null),i(null),c(null),p.reset()},completeMutation:p}}export{Be as i,$e as n,Ue as r,Ge as t};
@@ -0,0 +1 @@
1
+ import{p as e}from"./vendor-tanstack-6B86itGS.js";import{o as t}from"./index-DplV-wqZ.js";function n(){return e({mutationFn:({id:e,name:n,quotaThreshold:r,weight:i,keepaliveEnabled:a})=>t.updateToken(e,n,r,i,a)})}export{n as t};