scenri 0.18.2 → 0.19.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 (621) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +4 -4
  3. package/dist/{chunk-VQPHG2GQ.js → chunk-4PJPJGGP.js} +33 -4
  4. package/dist/{cli-HHU7DUWE.js → cli-6LLQ5INA.js} +3 -3
  5. package/dist/index.js +2 -2
  6. package/dist/serve.js +2537 -1616
  7. package/dist/{src-CHSXV3ZA.js → src-7RKZJC7Y.js} +3 -3
  8. package/package.json +1 -1
  9. package/studio-dist/assets/index-C8NkERt4.js +108 -0
  10. package/studio-dist/assets/{index-DJoQ6v4Y.css → index-Cc29XMiU.css} +1 -1
  11. package/studio-dist/index.html +2 -2
  12. package/templates/balloon-knot.json +15 -0
  13. package/templates/beauty-dish.json +15 -0
  14. package/templates/block-tower.json +15 -0
  15. package/templates/chalk-steps.json +24 -0
  16. package/templates/chrome-bubble-warp.json +4 -3
  17. package/templates/clay-court.json +15 -0
  18. package/templates/coal-blind-light.json +24 -0
  19. package/templates/cobalt-color-room.json +15 -0
  20. package/templates/cobalt-container.json +15 -0
  21. package/templates/conversation-pit.json +24 -0
  22. package/templates/demo-products/aldergate-field-38.json +28 -0
  23. package/templates/demo-products/aubrey-lisle-court-72.json +19 -0
  24. package/templates/demo-products/birch-hollow-fig-leaf-candle.json +19 -0
  25. package/templates/demo-products/brixa-yuzu-tonic.json +19 -0
  26. package/templates/demo-products/calder-vane-c15-serum.json +19 -0
  27. package/templates/demo-products/carrick-stead-chug-710.json +19 -0
  28. package/templates/demo-products/dunmore-kerr-cricket-jumper.json +19 -0
  29. package/templates/demo-products/fenner-ross-aperitivo.json +19 -0
  30. package/templates/demo-products/fenwick-slade-barrier-cream.json +19 -0
  31. package/templates/demo-products/halden-bay-spf-50.json +19 -0
  32. package/templates/demo-products/harlow-made-fig-vetiver-wash.json +19 -0
  33. package/templates/demo-products/hollow-reed-sleep-gummies.json +19 -0
  34. package/templates/demo-products/ilse-varden-scarlet-11.json +19 -0
  35. package/templates/demo-products/lydford-forge-24-casserole.json +19 -0
  36. package/templates/demo-products/marden-cole-square-acetates.json +19 -0
  37. package/templates/demo-products/marrow-vale-noir-cedar.json +19 -0
  38. package/templates/demo-products/maud-ferrers-sun-coin.json +19 -0
  39. package/templates/demo-products/moss-larkin-oak-lounge-chair.json +19 -0
  40. package/templates/demo-products/nordhavn-over-ear.json +19 -0
  41. package/templates/demo-products/orchard-oat-green-04.json +19 -0
  42. package/templates/demo-products/ossett-hume-capsule.json +19 -0
  43. package/templates/demo-products/oswin-hale-open-buds.json +19 -0
  44. package/templates/demo-products/ottery-lane-72-dark.json +19 -0
  45. package/templates/demo-products/pellow-hibiscus-soda.json +19 -0
  46. package/templates/demo-products/rowan-ash-bowler-bag.json +19 -0
  47. package/templates/demo-products/slate-harbor-cropped-puffer.json +19 -0
  48. package/templates/demo-products/tanner-fielding-collagen.json +19 -0
  49. package/templates/demo-products/verity-stone-dome-hoops.json +19 -0
  50. package/templates/demo-products/verlaine-salt-orris.json +19 -0
  51. package/templates/demo-products/voss-rowe-ridgeline-trail.json +19 -0
  52. package/templates/foil-tent.json +15 -0
  53. package/templates/glass-block-room.json +15 -0
  54. package/templates/green-tyre-stack.json +15 -0
  55. package/templates/hair-nest.json +15 -0
  56. package/templates/hand-studio.json +15 -0
  57. package/templates/lantern-room.json +15 -0
  58. package/templates/laundry-line.json +15 -0
  59. package/templates/linen-morning-room.json +15 -0
  60. package/templates/martini-hour.json +15 -0
  61. package/templates/model-village.json +15 -0
  62. package/templates/painted-canvas.json +15 -0
  63. package/templates/palm-shade-garden.json +15 -0
  64. package/templates/paper-garden.json +25 -0
  65. package/templates/pink-ball-pit.json +15 -0
  66. package/templates/pink-smoke.json +15 -0
  67. package/templates/presenters/amara.json +18 -0
  68. package/templates/presenters/anaya.json +18 -0
  69. package/templates/presenters/anton.json +18 -0
  70. package/templates/presenters/elias.json +18 -0
  71. package/templates/presenters/finn.json +18 -0
  72. package/templates/presenters/helene.json +18 -0
  73. package/templates/presenters/kwame.json +18 -0
  74. package/templates/presenters/leila.json +18 -0
  75. package/templates/presenters/liv.json +18 -0
  76. package/templates/presenters/luz.json +18 -0
  77. package/templates/presenters/maeve.json +18 -0
  78. package/templates/presenters/nico.json +18 -0
  79. package/templates/presenters/odette.json +18 -0
  80. package/templates/presenters/paloma.json +18 -0
  81. package/templates/presenters/ren.json +18 -0
  82. package/templates/presenters/soren.json +18 -0
  83. package/templates/presenters/tove.json +18 -0
  84. package/templates/presenters/yuna.json +18 -0
  85. package/templates/presenters/zuri.json +18 -0
  86. package/templates/previews/balloon-knot.jpg +0 -0
  87. package/templates/previews/beauty-dish.jpg +0 -0
  88. package/templates/previews/block-tower.jpg +0 -0
  89. package/templates/previews/chalk-steps.jpg +0 -0
  90. package/templates/previews/chrome-bubble-warp.jpg +0 -0
  91. package/templates/previews/clay-court.jpg +0 -0
  92. package/templates/previews/coal-blind-light.jpg +0 -0
  93. package/templates/previews/cobalt-color-room.jpg +0 -0
  94. package/templates/previews/cobalt-container.jpg +0 -0
  95. package/templates/previews/conversation-pit.jpg +0 -0
  96. package/templates/previews/foil-tent.jpg +0 -0
  97. package/templates/previews/glass-block-room.jpg +0 -0
  98. package/templates/previews/green-tyre-stack.jpg +0 -0
  99. package/templates/previews/hair-nest.jpg +0 -0
  100. package/templates/previews/hand-studio.jpg +0 -0
  101. package/templates/previews/lantern-room.jpg +0 -0
  102. package/templates/previews/laundry-line.jpg +0 -0
  103. package/templates/previews/linen-morning-room.jpg +0 -0
  104. package/templates/previews/martini-hour.jpg +0 -0
  105. package/templates/previews/model-village.jpg +0 -0
  106. package/templates/previews/painted-canvas.jpg +0 -0
  107. package/templates/previews/palm-shade-garden.jpg +0 -0
  108. package/templates/previews/paper-garden.jpg +0 -0
  109. package/templates/previews/pink-ball-pit.jpg +0 -0
  110. package/templates/previews/pink-smoke.jpg +0 -0
  111. package/templates/previews/presenters/amara.jpg +0 -0
  112. package/templates/previews/presenters/anaya.jpg +0 -0
  113. package/templates/previews/presenters/anton.jpg +0 -0
  114. package/templates/previews/presenters/elias.jpg +0 -0
  115. package/templates/previews/presenters/finn.jpg +0 -0
  116. package/templates/previews/presenters/helene.jpg +0 -0
  117. package/templates/previews/presenters/kwame.jpg +0 -0
  118. package/templates/previews/presenters/leila.jpg +0 -0
  119. package/templates/previews/presenters/liv.jpg +0 -0
  120. package/templates/previews/presenters/luz.jpg +0 -0
  121. package/templates/previews/presenters/maeve.jpg +0 -0
  122. package/templates/previews/presenters/nico.jpg +0 -0
  123. package/templates/previews/presenters/odette.jpg +0 -0
  124. package/templates/previews/presenters/paloma.jpg +0 -0
  125. package/templates/previews/presenters/ren.jpg +0 -0
  126. package/templates/previews/presenters/soren.jpg +0 -0
  127. package/templates/previews/presenters/tove.jpg +0 -0
  128. package/templates/previews/presenters/yuna.jpg +0 -0
  129. package/templates/previews/presenters/zuri.jpg +0 -0
  130. package/templates/previews/red-light-blade.jpg +0 -0
  131. package/templates/previews/ruby-syrup-pour.jpg +0 -0
  132. package/templates/previews/sand-mound-spotlight.jpg +0 -0
  133. package/templates/previews/shadow-hand.jpg +0 -0
  134. package/templates/previews/showcase/acetates-salt-flat.jpg +0 -0
  135. package/templates/previews/showcase/bowler-car-exit.jpg +0 -0
  136. package/templates/previews/showcase/c15-orange-pool.jpg +0 -0
  137. package/templates/previews/showcase/fig-leaf-frost-window.jpg +0 -0
  138. package/templates/previews/showcase/hibiscus-pour.jpg +0 -0
  139. package/templates/previews/showcase/hoops-painted-canvas.jpg +0 -0
  140. package/templates/previews/showcase/noir-cedar-char.jpg +0 -0
  141. package/templates/previews/showcase/orris-waterline.jpg +0 -0
  142. package/templates/previews/showcase/over-ear-pool-edge.jpg +0 -0
  143. package/templates/previews/showcase/puffer-container-lean.jpg +0 -0
  144. package/templates/previews/showcase/puffer-ghost-snow.jpg +0 -0
  145. package/templates/previews/showcase/ridgeline-tyre-top.jpg +0 -0
  146. package/templates/previews/showcase/scarlet-red-blade.jpg +0 -0
  147. package/templates/previews/showcase/scarlet-summer-laugh.jpg +0 -0
  148. package/templates/previews/showcase/yuzu-ice-burst.jpg +0 -0
  149. package/templates/previews/sky-color-block.jpg +0 -0
  150. package/templates/previews/studio-boulder-gap.jpg +0 -0
  151. package/templates/previews/studio-glacier-ice-core.jpg +0 -0
  152. package/templates/previews/studio-soft-horizon.jpg +0 -0
  153. package/templates/previews/succulent-dew-bed.jpg +0 -0
  154. package/templates/previews/sunlit-color-field.jpg +0 -0
  155. package/templates/previews/teak-bath-caddy.jpg +0 -0
  156. package/templates/previews/tight-corner.jpg +0 -0
  157. package/templates/previews/tomato-vine.jpg +0 -0
  158. package/templates/previews/tonal-apricot-ledge.jpg +0 -0
  159. package/templates/previews/travertine-window-light.jpg +0 -0
  160. package/templates/previews/waterline-caustics.jpg +0 -0
  161. package/templates/previews/white-glove-tray.jpg +0 -0
  162. package/templates/red-light-blade.json +15 -0
  163. package/templates/ruby-syrup-pour.json +15 -0
  164. package/templates/sand-mound-spotlight.json +15 -0
  165. package/templates/shadow-hand.json +15 -0
  166. package/templates/showcase/72-dark-bite.json +33 -0
  167. package/templates/showcase/72-dark-palm-shade.json +33 -0
  168. package/templates/showcase/72-dark-snap.json +29 -0
  169. package/templates/showcase/acetates-harbour-light.json +33 -0
  170. package/templates/showcase/acetates-ice-block.json +29 -0
  171. package/templates/showcase/acetates-salt-flat.json +37 -0
  172. package/templates/showcase/acetates-silk-drape.json +33 -0
  173. package/templates/showcase/aperitivo-chrome-bar.json +33 -0
  174. package/templates/showcase/aperitivo-pit.json +37 -0
  175. package/templates/showcase/aperitivo-ruby-pour.json +33 -0
  176. package/templates/showcase/aperitivo-tomato-vine.json +35 -0
  177. package/templates/showcase/barrier-cream-caddy.json +33 -0
  178. package/templates/showcase/barrier-cream-cheek.json +33 -0
  179. package/templates/showcase/barrier-cream-ice-core.json +35 -0
  180. package/templates/showcase/barrier-cream-oats.json +29 -0
  181. package/templates/showcase/bowler-bonnet-rain.json +29 -0
  182. package/templates/showcase/bowler-car-exit.json +33 -0
  183. package/templates/showcase/bowler-cobalt-room.json +33 -0
  184. package/templates/showcase/bowler-red-blade.json +37 -0
  185. package/templates/showcase/c15-apricot-ledge.json +33 -0
  186. package/templates/showcase/c15-dew-bed.json +33 -0
  187. package/templates/showcase/c15-morning-drop.json +33 -0
  188. package/templates/showcase/c15-orange-pool.json +29 -0
  189. package/templates/showcase/capsule-block-tower.json +33 -0
  190. package/templates/showcase/capsule-model-village.json +33 -0
  191. package/templates/showcase/capsule-stoop.json +33 -0
  192. package/templates/showcase/casserole-long-table.json +33 -0
  193. package/templates/showcase/casserole-steam.json +29 -0
  194. package/templates/showcase/casserole-tomatoes.json +33 -0
  195. package/templates/showcase/chug-courtside.json +37 -0
  196. package/templates/showcase/chug-long-shadow.json +33 -0
  197. package/templates/showcase/chug-mountain-stream.json +29 -0
  198. package/templates/showcase/chug-waterline.json +35 -0
  199. package/templates/showcase/collagen-berry-splash.json +29 -0
  200. package/templates/showcase/collagen-morning-shake.json +33 -0
  201. package/templates/showcase/collagen-paper-garden.json +33 -0
  202. package/templates/showcase/court-72-baseline.json +33 -0
  203. package/templates/showcase/court-72-checker-sit.json +37 -0
  204. package/templates/showcase/court-72-fisheye-steps.json +33 -0
  205. package/templates/showcase/court-72-salt-flat.json +35 -0
  206. package/templates/showcase/cricket-jumper-green.json +33 -0
  207. package/templates/showcase/cricket-jumper-hamper.json +29 -0
  208. package/templates/showcase/cricket-jumper-sheets.json +37 -0
  209. package/templates/showcase/field-watch-boulder-gap.json +37 -0
  210. package/templates/showcase/field-watch-corner.json +37 -0
  211. package/templates/showcase/field-watch-helm.json +33 -0
  212. package/templates/showcase/field-watch-ice-core.json +33 -0
  213. package/templates/showcase/fig-leaf-frost-window.json +29 -0
  214. package/templates/showcase/fig-leaf-lanterns.json +33 -0
  215. package/templates/showcase/fig-leaf-still-life.json +29 -0
  216. package/templates/showcase/fig-vetiver-travertine.json +35 -0
  217. package/templates/showcase/green-04-ice-trough.json +29 -0
  218. package/templates/showcase/green-04-ingredients.json +29 -0
  219. package/templates/showcase/green-04-track.json +33 -0
  220. package/templates/showcase/gummies-bedside.json +33 -0
  221. package/templates/showcase/gummies-cherry-heap.json +29 -0
  222. package/templates/showcase/gummies-moonlit-pillow.json +29 -0
  223. package/templates/showcase/hibiscus-dew-bed.json +33 -0
  224. package/templates/showcase/hibiscus-flower-nest.json +29 -0
  225. package/templates/showcase/hibiscus-long-lunch.json +37 -0
  226. package/templates/showcase/hibiscus-pour.json +29 -0
  227. package/templates/showcase/hoops-honey-drip.json +29 -0
  228. package/templates/showcase/hoops-painted-canvas.json +37 -0
  229. package/templates/showcase/hoops-pink-smoke.json +37 -0
  230. package/templates/showcase/hoops-sculpted-hands.json +33 -0
  231. package/templates/showcase/lounge-chair-reading.json +33 -0
  232. package/templates/showcase/lounge-chair-snowfall.json +29 -0
  233. package/templates/showcase/lounge-chair-travertine.json +33 -0
  234. package/templates/showcase/noir-cedar-char.json +29 -0
  235. package/templates/showcase/noir-cedar-coal.json +33 -0
  236. package/templates/showcase/noir-cedar-silk-drape.json +33 -0
  237. package/templates/showcase/noir-cedar-smoke.json +33 -0
  238. package/templates/showcase/open-buds-hands.json +33 -0
  239. package/templates/showcase/open-buds-surf-check.json +33 -0
  240. package/templates/showcase/open-buds-vinyl.json +29 -0
  241. package/templates/showcase/orris-collarbone.json +33 -0
  242. package/templates/showcase/orris-salt-pan.json +29 -0
  243. package/templates/showcase/orris-waterline.json +33 -0
  244. package/templates/showcase/orris-window-stripe.json +33 -0
  245. package/templates/showcase/over-ear-arch.json +33 -0
  246. package/templates/showcase/over-ear-balloons.json +37 -0
  247. package/templates/showcase/over-ear-glass-blocks.json +37 -0
  248. package/templates/showcase/over-ear-pool-edge.json +29 -0
  249. package/templates/showcase/puffer-container-lean.json +37 -0
  250. package/templates/showcase/puffer-foil-jump.json +37 -0
  251. package/templates/showcase/puffer-ghost-snow.json +29 -0
  252. package/templates/showcase/puffer-snow-street.json +33 -0
  253. package/templates/showcase/ridgeline-boulder-gap.json +33 -0
  254. package/templates/showcase/ridgeline-chalk-sprint.json +37 -0
  255. package/templates/showcase/ridgeline-stream-leap.json +33 -0
  256. package/templates/showcase/ridgeline-tyre-top.json +33 -0
  257. package/templates/showcase/scarlet-beauty-dish.json +37 -0
  258. package/templates/showcase/scarlet-red-blade.json +33 -0
  259. package/templates/showcase/scarlet-summer-laugh.json +33 -0
  260. package/templates/showcase/scarlet-swatch.json +29 -0
  261. package/templates/showcase/spf-poolside.json +33 -0
  262. package/templates/showcase/spf-salt-flat.json +37 -0
  263. package/templates/showcase/spf-shadow-hand.json +33 -0
  264. package/templates/showcase/spf-yellow-field.json +33 -0
  265. package/templates/showcase/sun-coin-collarbone.json +33 -0
  266. package/templates/showcase/sun-coin-hair-nest.json +33 -0
  267. package/templates/showcase/sun-coin-sundial.json +29 -0
  268. package/templates/showcase/sun-coin-white-glove.json +33 -0
  269. package/templates/showcase/wash-fig-leaves.json +29 -0
  270. package/templates/showcase/wash-slate-shower.json +29 -0
  271. package/templates/showcase/wash-steam.json +33 -0
  272. package/templates/showcase/yuzu-arch-lean.json +37 -0
  273. package/templates/showcase/yuzu-container-sill.json +33 -0
  274. package/templates/showcase/yuzu-flash-walk.json +33 -0
  275. package/templates/showcase/yuzu-ice-burst.json +29 -0
  276. package/templates/sky-color-block.json +15 -0
  277. package/templates/studio-boulder-gap.json +5 -4
  278. package/templates/studio-glacier-ice-core.json +5 -4
  279. package/templates/studio-soft-horizon.json +5 -4
  280. package/templates/succulent-dew-bed.json +6 -5
  281. package/templates/sunlit-color-field.json +15 -0
  282. package/templates/teak-bath-caddy.json +15 -0
  283. package/templates/tight-corner.json +15 -0
  284. package/templates/tomato-vine.json +15 -0
  285. package/templates/tonal-apricot-ledge.json +15 -0
  286. package/templates/travertine-window-light.json +15 -0
  287. package/templates/waterline-caustics.json +15 -0
  288. package/templates/white-glove-tray.json +15 -0
  289. package/studio-dist/assets/index-VKUZvbLQ.js +0 -106
  290. package/templates/action-motion-freeze.json +0 -14
  291. package/templates/beauty-dish-glow-portrait.json +0 -15
  292. package/templates/closeup-face-product-interaction.json +0 -14
  293. package/templates/cold-table-clinic.json +0 -15
  294. package/templates/confetti-burst-freeze.json +0 -15
  295. package/templates/contour-key-portrait.json +0 -15
  296. package/templates/cut-paper-stage.json +0 -14
  297. package/templates/cut-shadow-pedestal.json +0 -15
  298. package/templates/demo-products/aldergate-frost-field-watch.json +0 -27
  299. package/templates/demo-products/almanac-supply-canvas-low-top.json +0 -18
  300. package/templates/demo-products/amble-roasting-co-ethiopia-light-roast.json +0 -18
  301. package/templates/demo-products/ashwell-kin-ribbed-table-lamp.json +0 -18
  302. package/templates/demo-products/aurelia-amber-serum.json +0 -18
  303. package/templates/demo-products/basalt-bloom-sparkling-mineral-water.json +0 -18
  304. package/templates/demo-products/birch-hollow-stoneware-vase.json +0 -18
  305. package/templates/demo-products/birchwood-page-leather-derby.json +0 -18
  306. package/templates/demo-products/cairn-mineral-sun-stick.json +0 -18
  307. package/templates/demo-products/calder-vane-boucle-two-seater.json +0 -18
  308. package/templates/demo-products/cypress-row-olive-oil.json +0 -18
  309. package/templates/demo-products/fenwick-slade-open-shelving.json +0 -18
  310. package/templates/demo-products/fernweg-wanderlust-oil.json +0 -18
  311. package/templates/demo-products/ferro-sons-yuzu-soda.json +0 -18
  312. package/templates/demo-products/fieldnote-rangefinder-camera.json +0 -18
  313. package/templates/demo-products/halcyon-aura-speaker.json +0 -18
  314. package/templates/demo-products/harlow-made-woven-rattan-basket.json +0 -18
  315. package/templates/demo-products/hollow-reed-wildflower-honey.json +0 -18
  316. package/templates/demo-products/holloway-stacked-band-set.json +0 -18
  317. package/templates/demo-products/kestrel-waxed-field-jacket.json +0 -18
  318. package/templates/demo-products/keystone-works-low-profile-keyboard.json +0 -29
  319. package/templates/demo-products/lumen-co-signet-ring.json +0 -18
  320. package/templates/demo-products/marden-cole-selvedge-denim-jacket.json +0 -18
  321. package/templates/demo-products/marrow-vale-nocturne.json +0 -18
  322. package/templates/demo-products/meridian-pulse-smartwatch.json +0 -18
  323. package/templates/demo-products/moss-larkin-sling-lounge-chair.json +0 -18
  324. package/templates/demo-products/nordhavn-canvas-over-ear-headphones.json +0 -18
  325. package/templates/demo-products/northward-vacuum-flask.json +0 -18
  326. package/templates/demo-products/orchard-oat-cold-pressed-juice.json +0 -18
  327. package/templates/demo-products/orla-mackenzie-cashmere-turtleneck.json +0 -18
  328. package/templates/demo-products/perihelion-pebble-earbuds.json +0 -18
  329. package/templates/demo-products/rowan-ash-leather-tote.json +0 -18
  330. package/templates/demo-products/slate-harbor-tech-shell.json +0 -28
  331. package/templates/demo-products/solenne-mineral-pressed-cream.json +0 -18
  332. package/templates/demo-products/solstice-titanium-aviators.json +0 -18
  333. package/templates/demo-products/tanner-fielding-single-origin-bar.json +0 -18
  334. package/templates/demo-products/thornebury-pedestal-dining-table.json +0 -18
  335. package/templates/demo-products/tidewater-grapefruit-seltzer.json +0 -18
  336. package/templates/demo-products/verity-stone-gold-hoop-earrings.json +0 -18
  337. package/templates/demo-products/verity-stone-pearl-drop-necklace.json +0 -18
  338. package/templates/demo-products/verlaine-lumiere.json +0 -18
  339. package/templates/demo-products/verse-beauty-sheer-bloom.json +0 -18
  340. package/templates/demo-products/voss-rowe-trail-runner.json +0 -18
  341. package/templates/demo-products/wavelength-studio-headphones.json +0 -18
  342. package/templates/editorial-fisheye-flash-studio.json +0 -15
  343. package/templates/editorial-pale-wrap-studio.json +0 -15
  344. package/templates/editorial-walk-fashion-strip.json +0 -14
  345. package/templates/full-length-mirror-ootd.json +0 -14
  346. package/templates/furniture-joiners-workshop.json +0 -14
  347. package/templates/furniture-lamplight-hours.json +0 -14
  348. package/templates/furniture-long-shadow-gallery.json +0 -15
  349. package/templates/furniture-low-sun-terrace.json +0 -14
  350. package/templates/furniture-snowlight-room.json +0 -14
  351. package/templates/furniture-travertine-atrium.json +0 -14
  352. package/templates/handheld-offer-crop.json +0 -14
  353. package/templates/heliconia-bloom-field.json +0 -15
  354. package/templates/indigo-fold.json +0 -14
  355. package/templates/interiors-attic-reading-nook.json +0 -15
  356. package/templates/interiors-bathroom-vanity.json +0 -15
  357. package/templates/interiors-greenhouse-potting-nook.json +0 -15
  358. package/templates/interiors-marble-kitchen-counter.json +0 -15
  359. package/templates/interiors-wood-table-flatlay.json +0 -15
  360. package/templates/lifestyle-incidental-tablescape.json +0 -15
  361. package/templates/liquid-marble-pour.json +0 -15
  362. package/templates/low-key-character-study.json +0 -15
  363. package/templates/macro-texture-detail.json +0 -15
  364. package/templates/neon-tube-corridor.json +0 -15
  365. package/templates/overhead-styled-flatlay-grid.json +0 -15
  366. package/templates/plain-light-portrait.json +0 -15
  367. package/templates/precision-bench-anodised.json +0 -14
  368. package/templates/presenters/astrid.json +0 -22
  369. package/templates/presenters/bree.json +0 -18
  370. package/templates/presenters/dax.json +0 -18
  371. package/templates/presenters/elin.json +0 -18
  372. package/templates/presenters/ines.json +0 -23
  373. package/templates/presenters/itai.json +0 -23
  374. package/templates/presenters/julien.json +0 -18
  375. package/templates/presenters/jun.json +0 -23
  376. package/templates/presenters/kenji.json +0 -18
  377. package/templates/presenters/malik.json +0 -23
  378. package/templates/presenters/maren.json +0 -18
  379. package/templates/presenters/mateo.json +0 -23
  380. package/templates/presenters/noa.json +0 -23
  381. package/templates/presenters/otis.json +0 -18
  382. package/templates/presenters/priya.json +0 -18
  383. package/templates/presenters/rafael.json +0 -18
  384. package/templates/presenters/sasha.json +0 -23
  385. package/templates/presenters/soraya.json +0 -22
  386. package/templates/presenters/tallulah.json +0 -18
  387. package/templates/presenters/theo.json +0 -18
  388. package/templates/presenters/wen.json +0 -18
  389. package/templates/previews/action-motion-freeze.jpg +0 -0
  390. package/templates/previews/beauty-dish-glow-portrait.jpg +0 -0
  391. package/templates/previews/closeup-face-product-interaction.jpg +0 -0
  392. package/templates/previews/cold-table-clinic.jpg +0 -0
  393. package/templates/previews/confetti-burst-freeze.jpg +0 -0
  394. package/templates/previews/contour-key-portrait.jpg +0 -0
  395. package/templates/previews/cut-paper-stage.jpg +0 -0
  396. package/templates/previews/cut-shadow-pedestal.jpg +0 -0
  397. package/templates/previews/editorial-fisheye-flash-studio.jpg +0 -0
  398. package/templates/previews/editorial-pale-wrap-studio.jpg +0 -0
  399. package/templates/previews/editorial-walk-fashion-strip.jpg +0 -0
  400. package/templates/previews/full-length-mirror-ootd.jpg +0 -0
  401. package/templates/previews/furniture-joiners-workshop.jpg +0 -0
  402. package/templates/previews/furniture-lamplight-hours.jpg +0 -0
  403. package/templates/previews/furniture-long-shadow-gallery.jpg +0 -0
  404. package/templates/previews/furniture-low-sun-terrace.jpg +0 -0
  405. package/templates/previews/furniture-snowlight-room.jpg +0 -0
  406. package/templates/previews/furniture-travertine-atrium.jpg +0 -0
  407. package/templates/previews/handheld-offer-crop.jpg +0 -0
  408. package/templates/previews/heliconia-bloom-field.jpg +0 -0
  409. package/templates/previews/indigo-fold.jpg +0 -0
  410. package/templates/previews/interiors-attic-reading-nook.jpg +0 -0
  411. package/templates/previews/interiors-bathroom-vanity.jpg +0 -0
  412. package/templates/previews/interiors-greenhouse-potting-nook.jpg +0 -0
  413. package/templates/previews/interiors-marble-kitchen-counter.jpg +0 -0
  414. package/templates/previews/interiors-wood-table-flatlay.jpg +0 -0
  415. package/templates/previews/lifestyle-incidental-tablescape.jpg +0 -0
  416. package/templates/previews/liquid-marble-pour.jpg +0 -0
  417. package/templates/previews/low-key-character-study.jpg +0 -0
  418. package/templates/previews/macro-texture-detail.jpg +0 -0
  419. package/templates/previews/neon-tube-corridor.jpg +0 -0
  420. package/templates/previews/overhead-styled-flatlay-grid.jpg +0 -0
  421. package/templates/previews/plain-light-portrait.jpg +0 -0
  422. package/templates/previews/precision-bench-anodised.jpg +0 -0
  423. package/templates/previews/presenters/astrid.jpg +0 -0
  424. package/templates/previews/presenters/bree.jpg +0 -0
  425. package/templates/previews/presenters/dax.jpg +0 -0
  426. package/templates/previews/presenters/elin.jpg +0 -0
  427. package/templates/previews/presenters/ines.jpg +0 -0
  428. package/templates/previews/presenters/itai.jpg +0 -0
  429. package/templates/previews/presenters/julien.jpg +0 -0
  430. package/templates/previews/presenters/jun.jpg +0 -0
  431. package/templates/previews/presenters/kenji.jpg +0 -0
  432. package/templates/previews/presenters/malik.jpg +0 -0
  433. package/templates/previews/presenters/maren.jpg +0 -0
  434. package/templates/previews/presenters/mateo.jpg +0 -0
  435. package/templates/previews/presenters/noa.jpg +0 -0
  436. package/templates/previews/presenters/otis.jpg +0 -0
  437. package/templates/previews/presenters/priya.jpg +0 -0
  438. package/templates/previews/presenters/rafael.jpg +0 -0
  439. package/templates/previews/presenters/sasha.jpg +0 -0
  440. package/templates/previews/presenters/soraya.jpg +0 -0
  441. package/templates/previews/presenters/tallulah.jpg +0 -0
  442. package/templates/previews/presenters/theo.jpg +0 -0
  443. package/templates/previews/presenters/wen.jpg +0 -0
  444. package/templates/previews/rain-glass-night-city.jpg +0 -0
  445. package/templates/previews/rembrandt-triangle-portrait.jpg +0 -0
  446. package/templates/previews/screen-print-duotone.jpg +0 -0
  447. package/templates/previews/showcase/almanac-canvas-theo-billboard.jpg +0 -0
  448. package/templates/previews/showcase/ashwell-kin-lamp-elin-lamplight.jpg +0 -0
  449. package/templates/previews/showcase/aurelia-serum-succulent-dew.jpg +0 -0
  450. package/templates/previews/showcase/basalt-snells-window.jpg +0 -0
  451. package/templates/previews/showcase/birchwood-salt-flat.jpg +0 -0
  452. package/templates/previews/showcase/cairn-sun-stick-agave-noon.jpg +0 -0
  453. package/templates/previews/showcase/calder-snow-loft.jpg +0 -0
  454. package/templates/previews/showcase/marrow-vale-halite-ledge.jpg +0 -0
  455. package/templates/previews/showcase/moss-larkin-chair-travertine-atrium.jpg +0 -0
  456. package/templates/previews/showcase/orchard-oat-orchard-burst.jpg +0 -0
  457. package/templates/previews/showcase/orla-priya-fjord-ferry.jpg +0 -0
  458. package/templates/previews/showcase/solstice-aviators-screen-print.jpg +0 -0
  459. package/templates/previews/showcase/verity-pearls-suspended-silk.jpg +0 -0
  460. package/templates/previews/showcase/voss-rowe-runner-volcanic-ash.jpg +0 -0
  461. package/templates/previews/showcase/wen-meridian-trailhead.jpg +0 -0
  462. package/templates/previews/social-amber-flare-motion.jpg +0 -0
  463. package/templates/previews/social-beauty-editorial-grid.jpg +0 -0
  464. package/templates/previews/social-beverage-launch-splash.jpg +0 -0
  465. package/templates/previews/social-cobalt-hand-reveal.jpg +0 -0
  466. package/templates/previews/social-fashion-campaign-billboard.jpg +0 -0
  467. package/templates/previews/social-product-drop-hype.jpg +0 -0
  468. package/templates/previews/social-vertical-story-motion.jpg +0 -0
  469. package/templates/previews/soft-diffusion-portrait.jpg +0 -0
  470. package/templates/previews/split-tone-color-gel-portrait.jpg +0 -0
  471. package/templates/previews/stitched-construction-detail.jpg +0 -0
  472. package/templates/previews/studio-aloe-flesh-macro.jpg +0 -0
  473. package/templates/previews/studio-amber-resin-suspension.jpg +0 -0
  474. package/templates/previews/studio-basalt-crust-glow.jpg +0 -0
  475. package/templates/previews/studio-blue-ice-melt-channel.jpg +0 -0
  476. package/templates/previews/studio-dune-slip-face.jpg +0 -0
  477. package/templates/previews/studio-molten-sugar-pull.jpg +0 -0
  478. package/templates/previews/studio-polished-pedestal.jpg +0 -0
  479. package/templates/previews/studio-rainforest-canopy.jpg +0 -0
  480. package/templates/previews/studio-reef-shelf-caustics.jpg +0 -0
  481. package/templates/previews/studio-salt-crystal-cavern.jpg +0 -0
  482. package/templates/previews/studio-sea-stack-horizon.jpg +0 -0
  483. package/templates/previews/studio-sharp-shadow-stage.jpg +0 -0
  484. package/templates/previews/studio-spotlit-vertical-stage.jpg +0 -0
  485. package/templates/previews/studio-submerged-bloom-drift.jpg +0 -0
  486. package/templates/previews/studio-vertical-light-well.jpg +0 -0
  487. package/templates/previews/studio-volcanic-ash-field.jpg +0 -0
  488. package/templates/previews/suspended-color-field.jpg +0 -0
  489. package/templates/previews/terracotta-ledge-glow.jpg +0 -0
  490. package/templates/previews/wide-establishing-environment.jpg +0 -0
  491. package/templates/previews/worn-scale-cropped-gesture.jpg +0 -0
  492. package/templates/rain-glass-night-city.json +0 -15
  493. package/templates/rembrandt-triangle-portrait.json +0 -15
  494. package/templates/screen-print-duotone.json +0 -15
  495. package/templates/showcase/aldergate-ice-core.json +0 -29
  496. package/templates/showcase/aldergate-watch-kenji-candid-crop.json +0 -37
  497. package/templates/showcase/almanac-canvas-theo-billboard.json +0 -37
  498. package/templates/showcase/amble-ethiopia-bloom-pour.json +0 -29
  499. package/templates/showcase/amble-fire-tower.json +0 -29
  500. package/templates/showcase/amble-roasting-doorway.json +0 -33
  501. package/templates/showcase/ashwell-kin-lamp-elin-lamplight.json +0 -37
  502. package/templates/showcase/aurelia-serum-succulent-dew.json +0 -33
  503. package/templates/showcase/basalt-bloom-water-bell.json +0 -29
  504. package/templates/showcase/basalt-hot-spring.json +0 -29
  505. package/templates/showcase/basalt-snells-window.json +0 -33
  506. package/templates/showcase/birch-hollow-vase-blossom-counter.json +0 -33
  507. package/templates/showcase/birch-hollow-vase-greenhouse-nook.json +0 -33
  508. package/templates/showcase/birch-hollow-vase-rosehip-frost.json +0 -29
  509. package/templates/showcase/birchwood-derby-night-train.json +0 -29
  510. package/templates/showcase/birchwood-salt-flat.json +0 -33
  511. package/templates/showcase/cairn-balm-drag-wet-slate.json +0 -29
  512. package/templates/showcase/cairn-sun-stick-agave-noon.json +0 -29
  513. package/templates/showcase/cairn-sun-stick-aloe-flesh.json +0 -33
  514. package/templates/showcase/calder-snow-loft.json +0 -29
  515. package/templates/showcase/cypress-row-oil-frosted-rosemary.json +0 -29
  516. package/templates/showcase/cypress-row-oil-olive-limb.json +0 -29
  517. package/templates/showcase/cypress-row-oil-running-glass.json +0 -29
  518. package/templates/showcase/fenwick-slade-long-shadow.json +0 -33
  519. package/templates/showcase/fernweg-cracked-clay-shadow.json +0 -29
  520. package/templates/showcase/fernweg-oil-heliconia-field.json +0 -33
  521. package/templates/showcase/fernweg-vial-soap-loaf.json +0 -29
  522. package/templates/showcase/ferro-beach-cooler.json +0 -29
  523. package/templates/showcase/ferro-yuzu-pressure-jet.json +0 -29
  524. package/templates/showcase/fieldnote-camera-precision-bench.json +0 -33
  525. package/templates/showcase/halcyon-drive-in.json +0 -29
  526. package/templates/showcase/harlow-basket-attic-light.json +0 -33
  527. package/templates/showcase/hollow-reed-honey-heather-wind.json +0 -29
  528. package/templates/showcase/hollow-reed-honey-light-well.json +0 -33
  529. package/templates/showcase/hollow-reed-honey-meadow-bee.json +0 -29
  530. package/templates/showcase/holloway-rings-gilders-cushion.json +0 -29
  531. package/templates/showcase/holloway-rings-indigo-fold-trough.json +0 -33
  532. package/templates/showcase/holloway-rings-loupe-surface-plate.json +0 -33
  533. package/templates/showcase/julien-almanac-fisheye.json +0 -37
  534. package/templates/showcase/kenji-wavelength-listening.json +0 -37
  535. package/templates/showcase/kestrel-jacket-julien-low-key.json +0 -37
  536. package/templates/showcase/kestrel-otis-alpine-ridge.json +0 -37
  537. package/templates/showcase/keystone-keyboard-cut-paper-poster.json +0 -33
  538. package/templates/showcase/keystone-keyboard-home-row-halo.json +0 -29
  539. package/templates/showcase/lumen-hotel-bar.json +0 -29
  540. package/templates/showcase/lumen-signet-clay-impression.json +0 -29
  541. package/templates/showcase/lumen-signet-ink-bloom.json +0 -29
  542. package/templates/showcase/marden-cole-denim-maren-editorial-walk.json +0 -37
  543. package/templates/showcase/marden-cole-denim-mateo-car-window.json +0 -33
  544. package/templates/showcase/marden-cole-denim-rain-glass-beads.json +0 -29
  545. package/templates/showcase/marrow-vale-flacon-boulder-gap.json +0 -33
  546. package/templates/showcase/marrow-vale-halite-ledge.json +0 -33
  547. package/templates/showcase/marrow-vale-reeded-colour-bands.json +0 -29
  548. package/templates/showcase/marrow-vale-resin-block.json +0 -33
  549. package/templates/showcase/moss-larkin-chair-travertine-atrium.json +0 -33
  550. package/templates/showcase/nordhavn-headphones-jun-light-bar.json +0 -33
  551. package/templates/showcase/nordhavn-headphones-wen-kitchen-seven.json +0 -33
  552. package/templates/showcase/northward-flask-hoarfrost-pavement.json +0 -29
  553. package/templates/showcase/northward-flask-melt-channel.json +0 -29
  554. package/templates/showcase/orchard-oat-orchard-burst.json +0 -33
  555. package/templates/showcase/orchard-oat-overhead-fold-pour.json +0 -29
  556. package/templates/showcase/orchard-oat-reeded-glass-refraction.json +0 -29
  557. package/templates/showcase/orla-priya-fjord-ferry.json +0 -33
  558. package/templates/showcase/orla-turtleneck-fennel-dawn.json +0 -29
  559. package/templates/showcase/perihelion-buds-astrid-beauty-crop.json +0 -33
  560. package/templates/showcase/perihelion-buds-gate-window-dawn.json +0 -29
  561. package/templates/showcase/rafael-aurelia-morning.json +0 -37
  562. package/templates/showcase/rowan-market-bike.json +0 -29
  563. package/templates/showcase/sasha-slate-harbor-spray-zone.json +0 -33
  564. package/templates/showcase/slate-harbor-shell-itai-neon-corridor.json +0 -37
  565. package/templates/showcase/slate-harbor-yoke-on-wet-slate.json +0 -29
  566. package/templates/showcase/solenne-cream-bree-closeup.json +0 -37
  567. package/templates/showcase/solenne-spa-ledge.json +0 -29
  568. package/templates/showcase/solstice-aviators-screen-print.json +0 -33
  569. package/templates/showcase/solstice-cracked-clay.json +0 -33
  570. package/templates/showcase/soraya-taxi-hoops.json +0 -33
  571. package/templates/showcase/tallulah-ferro-story-motion.json +0 -37
  572. package/templates/showcase/tanner-fielding-bar-sugar-pull.json +0 -33
  573. package/templates/showcase/tanner-fielding-cocoa-crown.json +0 -33
  574. package/templates/showcase/thornebury-table-dust-sheet.json +0 -33
  575. package/templates/showcase/tidewater-coral-can-melt-channel.json +0 -33
  576. package/templates/showcase/tidewater-seltzer-basalt-columns.json +0 -29
  577. package/templates/showcase/tidewater-seltzer-wave-break.json +0 -29
  578. package/templates/showcase/verity-hoops-charred-cedar.json +0 -29
  579. package/templates/showcase/verity-hoops-pigment-lift.json +0 -29
  580. package/templates/showcase/verity-pearls-suspended-silk.json +0 -33
  581. package/templates/showcase/verity-travel-case.json +0 -29
  582. package/templates/showcase/verlaine-flacon-amber-resin.json +0 -29
  583. package/templates/showcase/verlaine-molten-wax.json +0 -33
  584. package/templates/showcase/verlaine-vanity-mirror.json +0 -29
  585. package/templates/showcase/verse-color-court.json +0 -29
  586. package/templates/showcase/verse-lipstick-soraya-soft-diffusion.json +0 -37
  587. package/templates/showcase/voss-rowe-dune-slip-face.json +0 -33
  588. package/templates/showcase/voss-rowe-runner-volcanic-ash.json +0 -33
  589. package/templates/showcase/voss-rowe-sasha-grit-cut-freeze.json +0 -37
  590. package/templates/showcase/voss-rowe-tarn-refraction.json +0 -29
  591. package/templates/showcase/wen-meridian-trailhead.json +0 -33
  592. package/templates/social-amber-flare-motion.json +0 -15
  593. package/templates/social-beauty-editorial-grid.json +0 -15
  594. package/templates/social-beverage-launch-splash.json +0 -15
  595. package/templates/social-cobalt-hand-reveal.json +0 -15
  596. package/templates/social-fashion-campaign-billboard.json +0 -15
  597. package/templates/social-product-drop-hype.json +0 -15
  598. package/templates/social-vertical-story-motion.json +0 -15
  599. package/templates/soft-diffusion-portrait.json +0 -15
  600. package/templates/split-tone-color-gel-portrait.json +0 -15
  601. package/templates/stitched-construction-detail.json +0 -15
  602. package/templates/studio-aloe-flesh-macro.json +0 -15
  603. package/templates/studio-amber-resin-suspension.json +0 -15
  604. package/templates/studio-basalt-crust-glow.json +0 -15
  605. package/templates/studio-blue-ice-melt-channel.json +0 -15
  606. package/templates/studio-dune-slip-face.json +0 -14
  607. package/templates/studio-molten-sugar-pull.json +0 -15
  608. package/templates/studio-polished-pedestal.json +0 -15
  609. package/templates/studio-rainforest-canopy.json +0 -15
  610. package/templates/studio-reef-shelf-caustics.json +0 -15
  611. package/templates/studio-salt-crystal-cavern.json +0 -15
  612. package/templates/studio-sea-stack-horizon.json +0 -14
  613. package/templates/studio-sharp-shadow-stage.json +0 -15
  614. package/templates/studio-spotlit-vertical-stage.json +0 -15
  615. package/templates/studio-submerged-bloom-drift.json +0 -15
  616. package/templates/studio-vertical-light-well.json +0 -15
  617. package/templates/studio-volcanic-ash-field.json +0 -15
  618. package/templates/suspended-color-field.json +0 -15
  619. package/templates/terracotta-ledge-glow.json +0 -15
  620. package/templates/wide-establishing-environment.json +0 -15
  621. package/templates/worn-scale-cropped-gesture.json +0 -15
@@ -0,0 +1,108 @@
1
+ var dx=e=>{throw TypeError(e)};var fx=(e,t,n)=>t.has(e)||dx("Cannot "+n);var ns=(e,t,n)=>(fx(e,t,"read from private field"),n?n.call(e):t.get(e)),hx=(e,t,n)=>t.has(e)?dx("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),pg=(e,t,n,r)=>(fx(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function k$(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();function BS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mg={exports:{}},Xd={},gg={exports:{}},bn={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var px;function S$(){if(px)return bn;px=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;function v(V){return V===null||typeof V!="object"?null:(V=g&&V[g]||V["@@iterator"],typeof V=="function"?V:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,y={};function k(V,B,K){this.props=V,this.context=B,this.refs=y,this.updater=K||w}k.prototype.isReactComponent={},k.prototype.setState=function(V,B){if(typeof V!="object"&&typeof V!="function"&&V!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,V,B,"setState")},k.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function S(){}S.prototype=k.prototype;function E(V,B,K){this.props=V,this.context=B,this.refs=y,this.updater=K||w}var j=E.prototype=new S;j.constructor=E,b(j,k.prototype),j.isPureReactComponent=!0;var N=Array.isArray,A=Object.prototype.hasOwnProperty,T={current:null},P={key:!0,ref:!0,__self:!0,__source:!0};function C(V,B,K){var ee,se={},oe=null,me=null;if(B!=null)for(ee in B.ref!==void 0&&(me=B.ref),B.key!==void 0&&(oe=""+B.key),B)A.call(B,ee)&&!P.hasOwnProperty(ee)&&(se[ee]=B[ee]);var ce=arguments.length-2;if(ce===1)se.children=K;else if(1<ce){for(var we=Array(ce),G=0;G<ce;G++)we[G]=arguments[G+2];se.children=we}if(V&&V.defaultProps)for(ee in ce=V.defaultProps,ce)se[ee]===void 0&&(se[ee]=ce[ee]);return{$$typeof:e,type:V,key:oe,ref:me,props:se,_owner:T.current}}function R(V,B){return{$$typeof:e,type:V.type,key:B,ref:V.ref,props:V.props,_owner:V._owner}}function $(V){return typeof V=="object"&&V!==null&&V.$$typeof===e}function H(V){var B={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(K){return B[K]})}var D=/\/+/g;function q(V,B){return typeof V=="object"&&V!==null&&V.key!=null?H(""+V.key):B.toString(36)}function _(V,B,K,ee,se){var oe=typeof V;(oe==="undefined"||oe==="boolean")&&(V=null);var me=!1;if(V===null)me=!0;else switch(oe){case"string":case"number":me=!0;break;case"object":switch(V.$$typeof){case e:case t:me=!0}}if(me)return me=V,se=se(me),V=ee===""?"."+q(me,0):ee,N(se)?(K="",V!=null&&(K=V.replace(D,"$&/")+"/"),_(se,B,K,"",function(G){return G})):se!=null&&($(se)&&(se=R(se,K+(!se.key||me&&me.key===se.key?"":(""+se.key).replace(D,"$&/")+"/")+V)),B.push(se)),1;if(me=0,ee=ee===""?".":ee+":",N(V))for(var ce=0;ce<V.length;ce++){oe=V[ce];var we=ee+q(oe,ce);me+=_(oe,B,K,we,se)}else if(we=v(V),typeof we=="function")for(V=we.call(V),ce=0;!(oe=V.next()).done;)oe=oe.value,we=ee+q(oe,ce++),me+=_(oe,B,K,we,se);else if(oe==="object")throw B=String(V),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.");return me}function U(V,B,K){if(V==null)return V;var ee=[],se=0;return _(V,ee,"","",function(oe){return B.call(K,oe,se++)}),ee}function Y(V){if(V._status===-1){var B=V._result;B=B(),B.then(function(K){(V._status===0||V._status===-1)&&(V._status=1,V._result=K)},function(K){(V._status===0||V._status===-1)&&(V._status=2,V._result=K)}),V._status===-1&&(V._status=0,V._result=B)}if(V._status===1)return V._result.default;throw V._result}var I={current:null},F={transition:null},O={ReactCurrentDispatcher:I,ReactCurrentBatchConfig:F,ReactCurrentOwner:T};function Z(){throw Error("act(...) is not supported in production builds of React.")}return bn.Children={map:U,forEach:function(V,B,K){U(V,function(){B.apply(this,arguments)},K)},count:function(V){var B=0;return U(V,function(){B++}),B},toArray:function(V){return U(V,function(B){return B})||[]},only:function(V){if(!$(V))throw Error("React.Children.only expected to receive a single React element child.");return V}},bn.Component=k,bn.Fragment=n,bn.Profiler=a,bn.PureComponent=E,bn.StrictMode=r,bn.Suspense=f,bn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=O,bn.act=Z,bn.cloneElement=function(V,B,K){if(V==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+V+".");var ee=b({},V.props),se=V.key,oe=V.ref,me=V._owner;if(B!=null){if(B.ref!==void 0&&(oe=B.ref,me=T.current),B.key!==void 0&&(se=""+B.key),V.type&&V.type.defaultProps)var ce=V.type.defaultProps;for(we in B)A.call(B,we)&&!P.hasOwnProperty(we)&&(ee[we]=B[we]===void 0&&ce!==void 0?ce[we]:B[we])}var we=arguments.length-2;if(we===1)ee.children=K;else if(1<we){ce=Array(we);for(var G=0;G<we;G++)ce[G]=arguments[G+2];ee.children=ce}return{$$typeof:e,type:V.type,key:se,ref:oe,props:ee,_owner:me}},bn.createContext=function(V){return V={$$typeof:l,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},V.Provider={$$typeof:i,_context:V},V.Consumer=V},bn.createElement=C,bn.createFactory=function(V){var B=C.bind(null,V);return B.type=V,B},bn.createRef=function(){return{current:null}},bn.forwardRef=function(V){return{$$typeof:u,render:V}},bn.isValidElement=$,bn.lazy=function(V){return{$$typeof:p,_payload:{_status:-1,_result:V},_init:Y}},bn.memo=function(V,B){return{$$typeof:h,type:V,compare:B===void 0?null:B}},bn.startTransition=function(V){var B=F.transition;F.transition={};try{V()}finally{F.transition=B}},bn.unstable_act=Z,bn.useCallback=function(V,B){return I.current.useCallback(V,B)},bn.useContext=function(V){return I.current.useContext(V)},bn.useDebugValue=function(){},bn.useDeferredValue=function(V){return I.current.useDeferredValue(V)},bn.useEffect=function(V,B){return I.current.useEffect(V,B)},bn.useId=function(){return I.current.useId()},bn.useImperativeHandle=function(V,B,K){return I.current.useImperativeHandle(V,B,K)},bn.useInsertionEffect=function(V,B){return I.current.useInsertionEffect(V,B)},bn.useLayoutEffect=function(V,B){return I.current.useLayoutEffect(V,B)},bn.useMemo=function(V,B){return I.current.useMemo(V,B)},bn.useReducer=function(V,B,K){return I.current.useReducer(V,B,K)},bn.useRef=function(V){return I.current.useRef(V)},bn.useState=function(V){return I.current.useState(V)},bn.useSyncExternalStore=function(V,B,K){return I.current.useSyncExternalStore(V,B,K)},bn.useTransition=function(){return I.current.useTransition()},bn.version="18.3.1",bn}var mx;function k4(){return mx||(mx=1,gg.exports=S$()),gg.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var gx;function E$(){if(gx)return Xd;gx=1;var e=k4(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function l(u,f,h){var p,g={},v=null,w=null;h!==void 0&&(v=""+h),f.key!==void 0&&(v=""+f.key),f.ref!==void 0&&(w=f.ref);for(p in f)r.call(f,p)&&!i.hasOwnProperty(p)&&(g[p]=f[p]);if(u&&u.defaultProps)for(p in f=u.defaultProps,f)g[p]===void 0&&(g[p]=f[p]);return{$$typeof:t,type:u,key:v,ref:w,props:g,_owner:a.current}}return Xd.Fragment=n,Xd.jsx=l,Xd.jsxs=l,Xd}var vx;function C$(){return vx||(vx=1,mg.exports=E$()),mg.exports}var o=C$(),s=k4();const Fn=BS(s),vc=k$({__proto__:null,default:Fn},[s]);var Z1={},vg={exports:{}},Ps={},wg={exports:{}},yg={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var wx;function j$(){return wx||(wx=1,(function(e){function t(F,O){var Z=F.length;F.push(O);e:for(;0<Z;){var V=Z-1>>>1,B=F[V];if(0<a(B,O))F[V]=O,F[Z]=B,Z=V;else break e}}function n(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var O=F[0],Z=F.pop();if(Z!==O){F[0]=Z;e:for(var V=0,B=F.length,K=B>>>1;V<K;){var ee=2*(V+1)-1,se=F[ee],oe=ee+1,me=F[oe];if(0>a(se,Z))oe<B&&0>a(me,se)?(F[V]=me,F[oe]=Z,V=oe):(F[V]=se,F[ee]=Z,V=ee);else if(oe<B&&0>a(me,Z))F[V]=me,F[oe]=Z,V=oe;else break e}}return O}function a(F,O){var Z=F.sortIndex-O.sortIndex;return Z!==0?Z:F.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var f=[],h=[],p=1,g=null,v=3,w=!1,b=!1,y=!1,k=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function j(F){for(var O=n(h);O!==null;){if(O.callback===null)r(h);else if(O.startTime<=F)r(h),O.sortIndex=O.expirationTime,t(f,O);else break;O=n(h)}}function N(F){if(y=!1,j(F),!b)if(n(f)!==null)b=!0,Y(A);else{var O=n(h);O!==null&&I(N,O.startTime-F)}}function A(F,O){b=!1,y&&(y=!1,S(C),C=-1),w=!0;var Z=v;try{for(j(O),g=n(f);g!==null&&(!(g.expirationTime>O)||F&&!H());){var V=g.callback;if(typeof V=="function"){g.callback=null,v=g.priorityLevel;var B=V(g.expirationTime<=O);O=e.unstable_now(),typeof B=="function"?g.callback=B:g===n(f)&&r(f),j(O)}else r(f);g=n(f)}if(g!==null)var K=!0;else{var ee=n(h);ee!==null&&I(N,ee.startTime-O),K=!1}return K}finally{g=null,v=Z,w=!1}}var T=!1,P=null,C=-1,R=5,$=-1;function H(){return!(e.unstable_now()-$<R)}function D(){if(P!==null){var F=e.unstable_now();$=F;var O=!0;try{O=P(!0,F)}finally{O?q():(T=!1,P=null)}}else T=!1}var q;if(typeof E=="function")q=function(){E(D)};else if(typeof MessageChannel<"u"){var _=new MessageChannel,U=_.port2;_.port1.onmessage=D,q=function(){U.postMessage(null)}}else q=function(){k(D,0)};function Y(F){P=F,T||(T=!0,q())}function I(F,O){C=k(function(){F(e.unstable_now())},O)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(F){F.callback=null},e.unstable_continueExecution=function(){b||w||(b=!0,Y(A))},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(F){switch(v){case 1:case 2:case 3:var O=3;break;default:O=v}var Z=v;v=O;try{return F()}finally{v=Z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(F,O){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var Z=v;v=F;try{return O()}finally{v=Z}},e.unstable_scheduleCallback=function(F,O,Z){var V=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?V+Z:V):Z=V,F){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=Z+B,F={id:p++,callback:O,priorityLevel:F,startTime:Z,expirationTime:B,sortIndex:-1},Z>V?(F.sortIndex=Z,t(h,F),n(f)===null&&F===n(h)&&(y?(S(C),C=-1):y=!0,I(N,Z-V))):(F.sortIndex=B,t(f,F),b||w||(b=!0,Y(A))),F},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(F){var O=v;return function(){var Z=v;v=O;try{return F.apply(this,arguments)}finally{v=Z}}}})(yg)),yg}var yx;function A$(){return yx||(yx=1,wg.exports=j$()),wg.exports}/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var bx;function N$(){if(bx)return Ps;bx=1;var e=k4(),t=A$();function n(c){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+c,m=1;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m]);return"Minified React error #"+c+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,a={};function i(c,d){l(c,d),l(c+"Capture",d)}function l(c,d){for(a[c]=d,c=0;c<d.length;c++)r.add(d[c])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},g={};function v(c){return f.call(g,c)?!0:f.call(p,c)?!1:h.test(c)?g[c]=!0:(p[c]=!0,!1)}function w(c,d,m,x){if(m!==null&&m.type===0)return!1;switch(typeof d){case"function":case"symbol":return!0;case"boolean":return x?!1:m!==null?!m.acceptsBooleans:(c=c.toLowerCase().slice(0,5),c!=="data-"&&c!=="aria-");default:return!1}}function b(c,d,m,x){if(d===null||typeof d>"u"||w(c,d,m,x))return!0;if(x)return!1;if(m!==null)switch(m.type){case 3:return!d;case 4:return d===!1;case 5:return isNaN(d);case 6:return isNaN(d)||1>d}return!1}function y(c,d,m,x,M,L,z){this.acceptsBooleans=d===2||d===3||d===4,this.attributeName=x,this.attributeNamespace=M,this.mustUseProperty=m,this.propertyName=c,this.type=d,this.sanitizeURL=L,this.removeEmptyString=z}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(c){k[c]=new y(c,0,!1,c,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(c){var d=c[0];k[d]=new y(d,1,!1,c[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(c){k[c]=new y(c,2,!1,c.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(c){k[c]=new y(c,2,!1,c,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(c){k[c]=new y(c,3,!1,c.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(c){k[c]=new y(c,3,!0,c,null,!1,!1)}),["capture","download"].forEach(function(c){k[c]=new y(c,4,!1,c,null,!1,!1)}),["cols","rows","size","span"].forEach(function(c){k[c]=new y(c,6,!1,c,null,!1,!1)}),["rowSpan","start"].forEach(function(c){k[c]=new y(c,5,!1,c.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function E(c){return c[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(c){var d=c.replace(S,E);k[d]=new y(d,1,!1,c,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(c){var d=c.replace(S,E);k[d]=new y(d,1,!1,c,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(c){var d=c.replace(S,E);k[d]=new y(d,1,!1,c,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(c){k[c]=new y(c,1,!1,c.toLowerCase(),null,!1,!1)}),k.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(c){k[c]=new y(c,1,!1,c.toLowerCase(),null,!0,!0)});function j(c,d,m,x){var M=k.hasOwnProperty(d)?k[d]:null;(M!==null?M.type!==0:x||!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(b(d,m,M,x)&&(m=null),x||M===null?v(d)&&(m===null?c.removeAttribute(d):c.setAttribute(d,""+m)):M.mustUseProperty?c[M.propertyName]=m===null?M.type===3?!1:"":m:(d=M.attributeName,x=M.attributeNamespace,m===null?c.removeAttribute(d):(M=M.type,m=M===3||M===4&&m===!0?"":""+m,x?c.setAttributeNS(x,d,m):c.setAttribute(d,m))))}var N=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),T=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),$=Symbol.for("react.provider"),H=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),F=Symbol.iterator;function O(c){return c===null||typeof c!="object"?null:(c=F&&c[F]||c["@@iterator"],typeof c=="function"?c:null)}var Z=Object.assign,V;function B(c){if(V===void 0)try{throw Error()}catch(m){var d=m.stack.trim().match(/\n( *(at )?)/);V=d&&d[1]||""}return`
34
+ `+V+c}var K=!1;function ee(c,d){if(!c||K)return"";K=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(d)if(d=function(){throw Error()},Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(Ve){var x=Ve}Reflect.construct(c,[],d)}else{try{d.call()}catch(Ve){x=Ve}c.call(d.prototype)}else{try{throw Error()}catch(Ve){x=Ve}c()}}catch(Ve){if(Ve&&x&&typeof Ve.stack=="string"){for(var M=Ve.stack.split(`
35
+ `),L=x.stack.split(`
36
+ `),z=M.length-1,de=L.length-1;1<=z&&0<=de&&M[z]!==L[de];)de--;for(;1<=z&&0<=de;z--,de--)if(M[z]!==L[de]){if(z!==1||de!==1)do if(z--,de--,0>de||M[z]!==L[de]){var ye=`
37
+ `+M[z].replace(" at new "," at ");return c.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",c.displayName)),ye}while(1<=z&&0<=de);break}}}finally{K=!1,Error.prepareStackTrace=m}return(c=c?c.displayName||c.name:"")?B(c):""}function se(c){switch(c.tag){case 5:return B(c.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return c=ee(c.type,!1),c;case 11:return c=ee(c.type.render,!1),c;case 1:return c=ee(c.type,!0),c;default:return""}}function oe(c){if(c==null)return null;if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case P:return"Fragment";case T:return"Portal";case R:return"Profiler";case C:return"StrictMode";case q:return"Suspense";case _:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case H:return(c.displayName||"Context")+".Consumer";case $:return(c._context.displayName||"Context")+".Provider";case D:var d=c.render;return c=c.displayName,c||(c=d.displayName||d.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case U:return d=c.displayName||null,d!==null?d:oe(c.type)||"Memo";case Y:d=c._payload,c=c._init;try{return oe(c(d))}catch{}}return null}function me(c){var d=c.type;switch(c.tag){case 24:return"Cache";case 9:return(d.displayName||"Context")+".Consumer";case 10:return(d._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return c=d.render,c=c.displayName||c.name||"",d.displayName||(c!==""?"ForwardRef("+c+")":"ForwardRef");case 7:return"Fragment";case 5:return d;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return oe(d);case 8:return d===C?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d}return null}function ce(c){switch(typeof c){case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function we(c){var d=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function G(c){var d=we(c)?"checked":"value",m=Object.getOwnPropertyDescriptor(c.constructor.prototype,d),x=""+c[d];if(!c.hasOwnProperty(d)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var M=m.get,L=m.set;return Object.defineProperty(c,d,{configurable:!0,get:function(){return M.call(this)},set:function(z){x=""+z,L.call(this,z)}}),Object.defineProperty(c,d,{enumerable:m.enumerable}),{getValue:function(){return x},setValue:function(z){x=""+z},stopTracking:function(){c._valueTracker=null,delete c[d]}}}}function ue(c){c._valueTracker||(c._valueTracker=G(c))}function Ne(c){if(!c)return!1;var d=c._valueTracker;if(!d)return!0;var m=d.getValue(),x="";return c&&(x=we(c)?c.checked?"true":"false":c.value),c=x,c!==m?(d.setValue(c),!0):!1}function ne(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}function Fe(c,d){var m=d.checked;return Z({},d,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??c._wrapperState.initialChecked})}function Oe(c,d){var m=d.defaultValue==null?"":d.defaultValue,x=d.checked!=null?d.checked:d.defaultChecked;m=ce(d.value!=null?d.value:m),c._wrapperState={initialChecked:x,initialValue:m,controlled:d.type==="checkbox"||d.type==="radio"?d.checked!=null:d.value!=null}}function ot(c,d){d=d.checked,d!=null&&j(c,"checked",d,!1)}function Xe(c,d){ot(c,d);var m=ce(d.value),x=d.type;if(m!=null)x==="number"?(m===0&&c.value===""||c.value!=m)&&(c.value=""+m):c.value!==""+m&&(c.value=""+m);else if(x==="submit"||x==="reset"){c.removeAttribute("value");return}d.hasOwnProperty("value")?J(c,d.type,m):d.hasOwnProperty("defaultValue")&&J(c,d.type,ce(d.defaultValue)),d.checked==null&&d.defaultChecked!=null&&(c.defaultChecked=!!d.defaultChecked)}function X(c,d,m){if(d.hasOwnProperty("value")||d.hasOwnProperty("defaultValue")){var x=d.type;if(!(x!=="submit"&&x!=="reset"||d.value!==void 0&&d.value!==null))return;d=""+c._wrapperState.initialValue,m||d===c.value||(c.value=d),c.defaultValue=d}m=c.name,m!==""&&(c.name=""),c.defaultChecked=!!c._wrapperState.initialChecked,m!==""&&(c.name=m)}function J(c,d,m){(d!=="number"||ne(c.ownerDocument)!==c)&&(m==null?c.defaultValue=""+c._wrapperState.initialValue:c.defaultValue!==""+m&&(c.defaultValue=""+m))}var ge=Array.isArray;function ve(c,d,m,x){if(c=c.options,d){d={};for(var M=0;M<m.length;M++)d["$"+m[M]]=!0;for(m=0;m<c.length;m++)M=d.hasOwnProperty("$"+c[m].value),c[m].selected!==M&&(c[m].selected=M),M&&x&&(c[m].defaultSelected=!0)}else{for(m=""+ce(m),d=null,M=0;M<c.length;M++){if(c[M].value===m){c[M].selected=!0,x&&(c[M].defaultSelected=!0);return}d!==null||c[M].disabled||(d=c[M])}d!==null&&(d.selected=!0)}}function Ze(c,d){if(d.dangerouslySetInnerHTML!=null)throw Error(n(91));return Z({},d,{value:void 0,defaultValue:void 0,children:""+c._wrapperState.initialValue})}function Ye(c,d){var m=d.value;if(m==null){if(m=d.children,d=d.defaultValue,m!=null){if(d!=null)throw Error(n(92));if(ge(m)){if(1<m.length)throw Error(n(93));m=m[0]}d=m}d==null&&(d=""),m=d}c._wrapperState={initialValue:ce(m)}}function ke(c,d){var m=ce(d.value),x=ce(d.defaultValue);m!=null&&(m=""+m,m!==c.value&&(c.value=m),d.defaultValue==null&&c.defaultValue!==m&&(c.defaultValue=m)),x!=null&&(c.defaultValue=""+x)}function te(c){var d=c.textContent;d===c._wrapperState.initialValue&&d!==""&&d!==null&&(c.value=d)}function le(c){switch(c){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Me(c,d){return c==null||c==="http://www.w3.org/1999/xhtml"?le(d):c==="http://www.w3.org/2000/svg"&&d==="foreignObject"?"http://www.w3.org/1999/xhtml":c}var ze,Re=(function(c){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(d,m,x,M){MSApp.execUnsafeLocalFunction(function(){return c(d,m,x,M)})}:c})(function(c,d){if(c.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in c)c.innerHTML=d;else{for(ze=ze||document.createElement("div"),ze.innerHTML="<svg>"+d.valueOf().toString()+"</svg>",d=ze.firstChild;c.firstChild;)c.removeChild(c.firstChild);for(;d.firstChild;)c.appendChild(d.firstChild)}});function Be(c,d){if(d){var m=c.firstChild;if(m&&m===c.lastChild&&m.nodeType===3){m.nodeValue=d;return}}c.textContent=d}var Qe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rt=["Webkit","ms","Moz","O"];Object.keys(Qe).forEach(function(c){rt.forEach(function(d){d=d+c.charAt(0).toUpperCase()+c.substring(1),Qe[d]=Qe[c]})});function _e(c,d,m){return d==null||typeof d=="boolean"||d===""?"":m||typeof d!="number"||d===0||Qe.hasOwnProperty(c)&&Qe[c]?(""+d).trim():d+"px"}function zt(c,d){c=c.style;for(var m in d)if(d.hasOwnProperty(m)){var x=m.indexOf("--")===0,M=_e(m,d[m],x);m==="float"&&(m="cssFloat"),x?c.setProperty(m,M):c[m]=M}}var Et=Z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Zt(c,d){if(d){if(Et[c]&&(d.children!=null||d.dangerouslySetInnerHTML!=null))throw Error(n(137,c));if(d.dangerouslySetInnerHTML!=null){if(d.children!=null)throw Error(n(60));if(typeof d.dangerouslySetInnerHTML!="object"||!("__html"in d.dangerouslySetInnerHTML))throw Error(n(61))}if(d.style!=null&&typeof d.style!="object")throw Error(n(62))}}function He(c,d){if(c.indexOf("-")===-1)return typeof d.is=="string";switch(c){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var mt=null;function vt(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var St=null,kt=null,Nt=null;function Bt(c){if(c=Hd(c)){if(typeof St!="function")throw Error(n(280));var d=c.stateNode;d&&(d=r1(d),St(c.stateNode,c.type,d))}}function at(c){kt?Nt?Nt.push(c):Nt=[c]:kt=c}function Mt(){if(kt){var c=kt,d=Nt;if(Nt=kt=null,Bt(c),d)for(c=0;c<d.length;c++)Bt(d[c])}}function ft(c,d){return c(d)}function vn(){}var Qt=!1;function on(c,d,m){if(Qt)return c(d,m);Qt=!0;try{return ft(c,d,m)}finally{Qt=!1,(kt!==null||Nt!==null)&&(vn(),Mt())}}function Rt(c,d){var m=c.stateNode;if(m===null)return null;var x=r1(m);if(x===null)return null;m=x[d];e:switch(d){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(x=!x.disabled)||(c=c.type,x=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!x;break e;default:c=!1}if(c)return null;if(m&&typeof m!="function")throw Error(n(231,d,typeof m));return m}var An=!1;if(u)try{var Vt={};Object.defineProperty(Vt,"passive",{get:function(){An=!0}}),window.addEventListener("test",Vt,Vt),window.removeEventListener("test",Vt,Vt)}catch{An=!1}function re(c,d,m,x,M,L,z,de,ye){var Ve=Array.prototype.slice.call(arguments,3);try{d.apply(m,Ve)}catch(ct){this.onError(ct)}}var ae=!1,fe=null,Te=!1,Ue=null,ut={onError:function(c){ae=!0,fe=c}};function gt(c,d,m,x,M,L,z,de,ye){ae=!1,fe=null,re.apply(ut,arguments)}function Pt(c,d,m,x,M,L,z,de,ye){if(gt.apply(this,arguments),ae){if(ae){var Ve=fe;ae=!1,fe=null}else throw Error(n(198));Te||(Te=!0,Ue=Ve)}}function tt(c){var d=c,m=c;if(c.alternate)for(;d.return;)d=d.return;else{c=d;do d=c,(d.flags&4098)!==0&&(m=d.return),c=d.return;while(c)}return d.tag===3?m:null}function wt(c){if(c.tag===13){var d=c.memoizedState;if(d===null&&(c=c.alternate,c!==null&&(d=c.memoizedState)),d!==null)return d.dehydrated}return null}function Ce(c){if(tt(c)!==c)throw Error(n(188))}function xe(c){var d=c.alternate;if(!d){if(d=tt(c),d===null)throw Error(n(188));return d!==c?null:c}for(var m=c,x=d;;){var M=m.return;if(M===null)break;var L=M.alternate;if(L===null){if(x=M.return,x!==null){m=x;continue}break}if(M.child===L.child){for(L=M.child;L;){if(L===m)return Ce(M),c;if(L===x)return Ce(M),d;L=L.sibling}throw Error(n(188))}if(m.return!==x.return)m=M,x=L;else{for(var z=!1,de=M.child;de;){if(de===m){z=!0,m=M,x=L;break}if(de===x){z=!0,x=M,m=L;break}de=de.sibling}if(!z){for(de=L.child;de;){if(de===m){z=!0,m=L,x=M;break}if(de===x){z=!0,x=L,m=M;break}de=de.sibling}if(!z)throw Error(n(189))}}if(m.alternate!==x)throw Error(n(190))}if(m.tag!==3)throw Error(n(188));return m.stateNode.current===m?c:d}function et(c){return c=xe(c),c!==null?yt(c):null}function yt(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){var d=yt(c);if(d!==null)return d;c=c.sibling}return null}var Q=t.unstable_scheduleCallback,Pe=t.unstable_cancelCallback,Ke=t.unstable_shouldYield,xt=t.unstable_requestPaint,st=t.unstable_now,Kt=t.unstable_getCurrentPriorityLevel,mn=t.unstable_ImmediatePriority,$e=t.unstable_UserBlockingPriority,Ae=t.unstable_NormalPriority,nt=t.unstable_LowPriority,Ge=t.unstable_IdlePriority,Tt=null,W=null;function he(c){if(W&&typeof W.onCommitFiberRoot=="function")try{W.onCommitFiberRoot(Tt,c,void 0,(c.current.flags&128)===128)}catch{}}var pe=Math.clz32?Math.clz32:jt,qe=Math.log,We=Math.LN2;function jt(c){return c>>>=0,c===0?32:31-(qe(c)/We|0)|0}var Ct=64,Dt=4194304;function qt(c){switch(c&-c){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function Zn(c,d){var m=c.pendingLanes;if(m===0)return 0;var x=0,M=c.suspendedLanes,L=c.pingedLanes,z=m&268435455;if(z!==0){var de=z&~M;de!==0?x=qt(de):(L&=z,L!==0&&(x=qt(L)))}else z=m&~M,z!==0?x=qt(z):L!==0&&(x=qt(L));if(x===0)return 0;if(d!==0&&d!==x&&(d&M)===0&&(M=x&-x,L=d&-d,M>=L||M===16&&(L&4194240)!==0))return d;if((x&4)!==0&&(x|=m&16),d=c.entangledLanes,d!==0)for(c=c.entanglements,d&=x;0<d;)m=31-pe(d),M=1<<m,x|=c[m],d&=~M;return x}function nn(c,d){switch(c){case 1:case 2:case 4:return d+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return d+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ut(c,d){for(var m=c.suspendedLanes,x=c.pingedLanes,M=c.expirationTimes,L=c.pendingLanes;0<L;){var z=31-pe(L),de=1<<z,ye=M[z];ye===-1?((de&m)===0||(de&x)!==0)&&(M[z]=nn(de,d)):ye<=d&&(c.expiredLanes|=de),L&=~de}}function pr(c){return c=c.pendingLanes&-1073741825,c!==0?c:c&1073741824?1073741824:0}function Nn(){var c=Ct;return Ct<<=1,(Ct&4194240)===0&&(Ct=64),c}function nr(c){for(var d=[],m=0;31>m;m++)d.push(c);return d}function Jt(c,d,m){c.pendingLanes|=d,d!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,d=31-pe(d),c[d]=m}function ur(c,d){var m=c.pendingLanes&~d;c.pendingLanes=d,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=d,c.mutableReadLanes&=d,c.entangledLanes&=d,d=c.entanglements;var x=c.eventTimes;for(c=c.expirationTimes;0<m;){var M=31-pe(m),L=1<<M;d[M]=0,x[M]=-1,c[M]=-1,m&=~L}}function Cs(c,d){var m=c.entangledLanes|=d;for(c=c.entanglements;m;){var x=31-pe(m),M=1<<x;M&d|c[x]&d&&(c[x]|=d),m&=~M}}var kn=0;function Vs(c){return c&=-c,1<c?4<c?(c&268435455)!==0?16:536870912:4:1}var na,en,Cn,zn,Zr,Pr=!1,In=[],zr=null,Lr=null,us=null,ra=new Map,Aa=new Map,Er=[],Oc="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Ro(c,d){switch(c){case"focusin":case"focusout":zr=null;break;case"dragenter":case"dragleave":Lr=null;break;case"mouseover":case"mouseout":us=null;break;case"pointerover":case"pointerout":ra.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":Aa.delete(d.pointerId)}}function Na(c,d,m,x,M,L){return c===null||c.nativeEvent!==L?(c={blockedOn:d,domEventName:m,eventSystemFlags:x,nativeEvent:L,targetContainers:[M]},d!==null&&(d=Hd(d),d!==null&&en(d)),c):(c.eventSystemFlags|=x,d=c.targetContainers,M!==null&&d.indexOf(M)===-1&&d.push(M),c)}function ie(c,d,m,x,M){switch(d){case"focusin":return zr=Na(zr,c,d,m,x,M),!0;case"dragenter":return Lr=Na(Lr,c,d,m,x,M),!0;case"mouseover":return us=Na(us,c,d,m,x,M),!0;case"pointerover":var L=M.pointerId;return ra.set(L,Na(ra.get(L)||null,c,d,m,x,M)),!0;case"gotpointercapture":return L=M.pointerId,Aa.set(L,Na(Aa.get(L)||null,c,d,m,x,M)),!0}return!1}function De(c){var d=Cl(c.target);if(d!==null){var m=tt(d);if(m!==null){if(d=m.tag,d===13){if(d=wt(m),d!==null){c.blockedOn=d,Zr(c.priority,function(){Cn(m)});return}}else if(d===3&&m.stateNode.current.memoizedState.isDehydrated){c.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}c.blockedOn=null}function it(c){if(c.blockedOn!==null)return!1;for(var d=c.targetContainers;0<d.length;){var m=Sd(c.domEventName,c.eventSystemFlags,d[0],c.nativeEvent);if(m===null){m=c.nativeEvent;var x=new m.constructor(m.type,m);mt=x,m.target.dispatchEvent(x),mt=null}else return d=Hd(m),d!==null&&en(d),c.blockedOn=m,!1;d.shift()}return!0}function Ft(c,d,m){it(c)&&m.delete(d)}function an(){Pr=!1,zr!==null&&it(zr)&&(zr=null),Lr!==null&&it(Lr)&&(Lr=null),us!==null&&it(us)&&(us=null),ra.forEach(Ft),Aa.forEach(Ft)}function fn(c,d){c.blockedOn===d&&(c.blockedOn=null,Pr||(Pr=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,an)))}function $n(c){function d(M){return fn(M,c)}if(0<In.length){fn(In[0],c);for(var m=1;m<In.length;m++){var x=In[m];x.blockedOn===c&&(x.blockedOn=null)}}for(zr!==null&&fn(zr,c),Lr!==null&&fn(Lr,c),us!==null&&fn(us,c),ra.forEach(d),Aa.forEach(d),m=0;m<Er.length;m++)x=Er[m],x.blockedOn===c&&(x.blockedOn=null);for(;0<Er.length&&(m=Er[0],m.blockedOn===null);)De(m),m.blockedOn===null&&Er.shift()}var jn=N.ReactCurrentBatchConfig,Tn=!0;function Ma(c,d,m,x){var M=kn,L=jn.transition;jn.transition=null;try{kn=1,vi(c,d,m,x)}finally{kn=M,jn.transition=L}}function bl(c,d,m,x){var M=kn,L=jn.transition;jn.transition=null;try{kn=4,vi(c,d,m,x)}finally{kn=M,jn.transition=L}}function vi(c,d,m,x){if(Tn){var M=Sd(c,d,m,x);if(M===null)s2(c,d,x,Ic,m),Ro(c,x);else if(ie(M,c,d,m,x))x.stopPropagation();else if(Ro(c,x),d&4&&-1<Oc.indexOf(c)){for(;M!==null;){var L=Hd(M);if(L!==null&&na(L),L=Sd(c,d,m,x),L===null&&s2(c,d,x,Ic,m),L===M)break;M=L}M!==null&&x.stopPropagation()}else s2(c,d,x,null,m)}}var Ic=null;function Sd(c,d,m,x){if(Ic=null,c=vt(x),c=Cl(c),c!==null)if(d=tt(c),d===null)c=null;else if(m=d.tag,m===13){if(c=wt(d),c!==null)return c;c=null}else if(m===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;c=null}else d!==c&&(c=null);return Ic=c,null}function Fc(c){switch(c){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Kt()){case mn:return 1;case $e:return 4;case Ae:case nt:return 16;case Ge:return 536870912;default:return 16}default:return 16}}var Zs=null,_c=null,xl=null;function Ed(){if(xl)return xl;var c,d=_c,m=d.length,x,M="value"in Zs?Zs.value:Zs.textContent,L=M.length;for(c=0;c<m&&d[c]===M[c];c++);var z=m-c;for(x=1;x<=z&&d[m-x]===M[L-x];x++);return xl=M.slice(c,1<x?1-x:void 0)}function wi(c){var d=c.keyCode;return"charCode"in c?(c=c.charCode,c===0&&d===13&&(c=13)):c=d,c===10&&(c=13),32<=c||c===13?c:0}function kl(){return!0}function Cd(){return!1}function Xr(c){function d(m,x,M,L,z){this._reactName=m,this._targetInst=M,this.type=x,this.nativeEvent=L,this.target=z,this.currentTarget=null;for(var de in c)c.hasOwnProperty(de)&&(m=c[de],this[de]=m?m(L):L[de]);return this.isDefaultPrevented=(L.defaultPrevented!=null?L.defaultPrevented:L.returnValue===!1)?kl:Cd,this.isPropagationStopped=Cd,this}return Z(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=kl)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=kl)},persist:function(){},isPersistent:kl}),d}var Po={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Se=Xr(Po),ht=Z({},Po,{view:0,detail:0}),sn=Xr(ht),Xt,wn,yn,Br=Z({},ht,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Km,button:0,buttons:0,relatedTarget:function(c){return c.relatedTarget===void 0?c.fromElement===c.srcElement?c.toElement:c.fromElement:c.relatedTarget},movementX:function(c){return"movementX"in c?c.movementX:(c!==yn&&(yn&&c.type==="mousemove"?(Xt=c.screenX-yn.screenX,wn=c.screenY-yn.screenY):wn=Xt=0,yn=c),Xt)},movementY:function(c){return"movementY"in c?c.movementY:wn}}),tn=Xr(Br),Kn=Z({},Br,{dataTransfer:0}),Vn=Xr(Kn),Sl=Z({},ht,{relatedTarget:0}),El=Xr(Sl),jd=Z({},Po,{animationName:0,elapsedTime:0,pseudoElement:0}),Kf=Xr(jd),Ra=Z({},Po,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),Gf=Xr(Ra),Yf=Z({},Po,{data:0}),ty=Xr(Yf),sL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},aL={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},oL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function iL(c){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(c):(c=oL[c])?!!d[c]:!1}function Km(){return iL}var lL=Z({},ht,{key:function(c){if(c.key){var d=sL[c.key]||c.key;if(d!=="Unidentified")return d}return c.type==="keypress"?(c=wi(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?aL[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Km,charCode:function(c){return c.type==="keypress"?wi(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?wi(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),cL=Xr(lL),uL=Z({},Br,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ny=Xr(uL),dL=Z({},ht,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Km}),fL=Xr(dL),hL=Z({},Po,{propertyName:0,elapsedTime:0,pseudoElement:0}),pL=Xr(hL),mL=Z({},Br,{deltaX:function(c){return"deltaX"in c?c.deltaX:"wheelDeltaX"in c?-c.wheelDeltaX:0},deltaY:function(c){return"deltaY"in c?c.deltaY:"wheelDeltaY"in c?-c.wheelDeltaY:"wheelDelta"in c?-c.wheelDelta:0},deltaZ:0,deltaMode:0}),gL=Xr(mL),vL=[9,13,27,32],Gm=u&&"CompositionEvent"in window,Ad=null;u&&"documentMode"in document&&(Ad=document.documentMode);var wL=u&&"TextEvent"in window&&!Ad,ry=u&&(!Gm||Ad&&8<Ad&&11>=Ad),sy=" ",ay=!1;function oy(c,d){switch(c){case"keyup":return vL.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function iy(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var Vc=!1;function yL(c,d){switch(c){case"compositionend":return iy(d);case"keypress":return d.which!==32?null:(ay=!0,sy);case"textInput":return c=d.data,c===sy&&ay?null:c;default:return null}}function bL(c,d){if(Vc)return c==="compositionend"||!Gm&&oy(c,d)?(c=Ed(),xl=_c=Zs=null,Vc=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return ry&&d.locale!=="ko"?null:d.data;default:return null}}var xL={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ly(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d==="input"?!!xL[c.type]:d==="textarea"}function cy(c,d,m,x){at(x),d=e1(d,"onChange"),0<d.length&&(m=new Se("onChange","change",null,m,x),c.push({event:m,listeners:d}))}var Nd=null,Md=null;function kL(c){Ay(c,0)}function qf(c){var d=Wc(c);if(Ne(d))return c}function SL(c,d){if(c==="change")return d}var uy=!1;if(u){var Ym;if(u){var qm="oninput"in document;if(!qm){var dy=document.createElement("div");dy.setAttribute("oninput","return;"),qm=typeof dy.oninput=="function"}Ym=qm}else Ym=!1;uy=Ym&&(!document.documentMode||9<document.documentMode)}function fy(){Nd&&(Nd.detachEvent("onpropertychange",hy),Md=Nd=null)}function hy(c){if(c.propertyName==="value"&&qf(Md)){var d=[];cy(d,Md,c,vt(c)),on(kL,d)}}function EL(c,d,m){c==="focusin"?(fy(),Nd=d,Md=m,Nd.attachEvent("onpropertychange",hy)):c==="focusout"&&fy()}function CL(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return qf(Md)}function jL(c,d){if(c==="click")return qf(d)}function AL(c,d){if(c==="input"||c==="change")return qf(d)}function NL(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var Pa=typeof Object.is=="function"?Object.is:NL;function Rd(c,d){if(Pa(c,d))return!0;if(typeof c!="object"||c===null||typeof d!="object"||d===null)return!1;var m=Object.keys(c),x=Object.keys(d);if(m.length!==x.length)return!1;for(x=0;x<m.length;x++){var M=m[x];if(!f.call(d,M)||!Pa(c[M],d[M]))return!1}return!0}function py(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function my(c,d){var m=py(c);c=0;for(var x;m;){if(m.nodeType===3){if(x=c+m.textContent.length,c<=d&&x>=d)return{node:m,offset:d-c};c=x}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=py(m)}}function gy(c,d){return c&&d?c===d?!0:c&&c.nodeType===3?!1:d&&d.nodeType===3?gy(c,d.parentNode):"contains"in c?c.contains(d):c.compareDocumentPosition?!!(c.compareDocumentPosition(d)&16):!1:!1}function vy(){for(var c=window,d=ne();d instanceof c.HTMLIFrameElement;){try{var m=typeof d.contentWindow.location.href=="string"}catch{m=!1}if(m)c=d.contentWindow;else break;d=ne(c.document)}return d}function Xm(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d&&(d==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||d==="textarea"||c.contentEditable==="true")}function ML(c){var d=vy(),m=c.focusedElem,x=c.selectionRange;if(d!==m&&m&&m.ownerDocument&&gy(m.ownerDocument.documentElement,m)){if(x!==null&&Xm(m)){if(d=x.start,c=x.end,c===void 0&&(c=d),"selectionStart"in m)m.selectionStart=d,m.selectionEnd=Math.min(c,m.value.length);else if(c=(d=m.ownerDocument||document)&&d.defaultView||window,c.getSelection){c=c.getSelection();var M=m.textContent.length,L=Math.min(x.start,M);x=x.end===void 0?L:Math.min(x.end,M),!c.extend&&L>x&&(M=x,x=L,L=M),M=my(m,L);var z=my(m,x);M&&z&&(c.rangeCount!==1||c.anchorNode!==M.node||c.anchorOffset!==M.offset||c.focusNode!==z.node||c.focusOffset!==z.offset)&&(d=d.createRange(),d.setStart(M.node,M.offset),c.removeAllRanges(),L>x?(c.addRange(d),c.extend(z.node,z.offset)):(d.setEnd(z.node,z.offset),c.addRange(d)))}}for(d=[],c=m;c=c.parentNode;)c.nodeType===1&&d.push({element:c,left:c.scrollLeft,top:c.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<d.length;m++)c=d[m],c.element.scrollLeft=c.left,c.element.scrollTop=c.top}}var RL=u&&"documentMode"in document&&11>=document.documentMode,Zc=null,Qm=null,Pd=null,Jm=!1;function wy(c,d,m){var x=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;Jm||Zc==null||Zc!==ne(x)||(x=Zc,"selectionStart"in x&&Xm(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),Pd&&Rd(Pd,x)||(Pd=x,x=e1(Qm,"onSelect"),0<x.length&&(d=new Se("onSelect","select",null,d,m),c.push({event:d,listeners:x}),d.target=Zc)))}function Xf(c,d){var m={};return m[c.toLowerCase()]=d.toLowerCase(),m["Webkit"+c]="webkit"+d,m["Moz"+c]="moz"+d,m}var zc={animationend:Xf("Animation","AnimationEnd"),animationiteration:Xf("Animation","AnimationIteration"),animationstart:Xf("Animation","AnimationStart"),transitionend:Xf("Transition","TransitionEnd")},e2={},yy={};u&&(yy=document.createElement("div").style,"AnimationEvent"in window||(delete zc.animationend.animation,delete zc.animationiteration.animation,delete zc.animationstart.animation),"TransitionEvent"in window||delete zc.transitionend.transition);function Qf(c){if(e2[c])return e2[c];if(!zc[c])return c;var d=zc[c],m;for(m in d)if(d.hasOwnProperty(m)&&m in yy)return e2[c]=d[m];return c}var by=Qf("animationend"),xy=Qf("animationiteration"),ky=Qf("animationstart"),Sy=Qf("transitionend"),Ey=new Map,Cy="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function yi(c,d){Ey.set(c,d),i(d,[c])}for(var t2=0;t2<Cy.length;t2++){var n2=Cy[t2],PL=n2.toLowerCase(),LL=n2[0].toUpperCase()+n2.slice(1);yi(PL,"on"+LL)}yi(by,"onAnimationEnd"),yi(xy,"onAnimationIteration"),yi(ky,"onAnimationStart"),yi("dblclick","onDoubleClick"),yi("focusin","onFocus"),yi("focusout","onBlur"),yi(Sy,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ld="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),$L=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ld));function jy(c,d,m){var x=c.type||"unknown-event";c.currentTarget=m,Pt(x,d,void 0,c),c.currentTarget=null}function Ay(c,d){d=(d&4)!==0;for(var m=0;m<c.length;m++){var x=c[m],M=x.event;x=x.listeners;e:{var L=void 0;if(d)for(var z=x.length-1;0<=z;z--){var de=x[z],ye=de.instance,Ve=de.currentTarget;if(de=de.listener,ye!==L&&M.isPropagationStopped())break e;jy(M,de,Ve),L=ye}else for(z=0;z<x.length;z++){if(de=x[z],ye=de.instance,Ve=de.currentTarget,de=de.listener,ye!==L&&M.isPropagationStopped())break e;jy(M,de,Ve),L=ye}}}if(Te)throw c=Ue,Te=!1,Ue=null,c}function Xn(c,d){var m=d[u2];m===void 0&&(m=d[u2]=new Set);var x=c+"__bubble";m.has(x)||(Ny(d,c,2,!1),m.add(x))}function r2(c,d,m){var x=0;d&&(x|=4),Ny(m,c,x,d)}var Jf="_reactListening"+Math.random().toString(36).slice(2);function $d(c){if(!c[Jf]){c[Jf]=!0,r.forEach(function(m){m!=="selectionchange"&&($L.has(m)||r2(m,!1,c),r2(m,!0,c))});var d=c.nodeType===9?c:c.ownerDocument;d===null||d[Jf]||(d[Jf]=!0,r2("selectionchange",!1,d))}}function Ny(c,d,m,x){switch(Fc(d)){case 1:var M=Ma;break;case 4:M=bl;break;default:M=vi}m=M.bind(null,d,m,c),M=void 0,!An||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(M=!0),x?M!==void 0?c.addEventListener(d,m,{capture:!0,passive:M}):c.addEventListener(d,m,!0):M!==void 0?c.addEventListener(d,m,{passive:M}):c.addEventListener(d,m,!1)}function s2(c,d,m,x,M){var L=x;if((d&1)===0&&(d&2)===0&&x!==null)e:for(;;){if(x===null)return;var z=x.tag;if(z===3||z===4){var de=x.stateNode.containerInfo;if(de===M||de.nodeType===8&&de.parentNode===M)break;if(z===4)for(z=x.return;z!==null;){var ye=z.tag;if((ye===3||ye===4)&&(ye=z.stateNode.containerInfo,ye===M||ye.nodeType===8&&ye.parentNode===M))return;z=z.return}for(;de!==null;){if(z=Cl(de),z===null)return;if(ye=z.tag,ye===5||ye===6){x=L=z;continue e}de=de.parentNode}}x=x.return}on(function(){var Ve=L,ct=vt(m),dt=[];e:{var lt=Ey.get(c);if(lt!==void 0){var $t=Se,Ot=c;switch(c){case"keypress":if(wi(m)===0)break e;case"keydown":case"keyup":$t=cL;break;case"focusin":Ot="focus",$t=El;break;case"focusout":Ot="blur",$t=El;break;case"beforeblur":case"afterblur":$t=El;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":$t=tn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$t=Vn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$t=fL;break;case by:case xy:case ky:$t=Kf;break;case Sy:$t=pL;break;case"scroll":$t=sn;break;case"wheel":$t=gL;break;case"copy":case"cut":case"paste":$t=Gf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$t=ny}var It=(d&4)!==0,hr=!It&&c==="scroll",Le=It?lt!==null?lt+"Capture":null:lt;It=[];for(var Ee=Ve,Ie;Ee!==null;){Ie=Ee;var bt=Ie.stateNode;if(Ie.tag===5&&bt!==null&&(Ie=bt,Le!==null&&(bt=Rt(Ee,Le),bt!=null&&It.push(Td(Ee,bt,Ie)))),hr)break;Ee=Ee.return}0<It.length&&(lt=new $t(lt,Ot,null,m,ct),dt.push({event:lt,listeners:It}))}}if((d&7)===0){e:{if(lt=c==="mouseover"||c==="pointerover",$t=c==="mouseout"||c==="pointerout",lt&&m!==mt&&(Ot=m.relatedTarget||m.fromElement)&&(Cl(Ot)||Ot[Lo]))break e;if(($t||lt)&&(lt=ct.window===ct?ct:(lt=ct.ownerDocument)?lt.defaultView||lt.parentWindow:window,$t?(Ot=m.relatedTarget||m.toElement,$t=Ve,Ot=Ot?Cl(Ot):null,Ot!==null&&(hr=tt(Ot),Ot!==hr||Ot.tag!==5&&Ot.tag!==6)&&(Ot=null)):($t=null,Ot=Ve),$t!==Ot)){if(It=tn,bt="onMouseLeave",Le="onMouseEnter",Ee="mouse",(c==="pointerout"||c==="pointerover")&&(It=ny,bt="onPointerLeave",Le="onPointerEnter",Ee="pointer"),hr=$t==null?lt:Wc($t),Ie=Ot==null?lt:Wc(Ot),lt=new It(bt,Ee+"leave",$t,m,ct),lt.target=hr,lt.relatedTarget=Ie,bt=null,Cl(ct)===Ve&&(It=new It(Le,Ee+"enter",Ot,m,ct),It.target=Ie,It.relatedTarget=hr,bt=It),hr=bt,$t&&Ot)t:{for(It=$t,Le=Ot,Ee=0,Ie=It;Ie;Ie=Bc(Ie))Ee++;for(Ie=0,bt=Le;bt;bt=Bc(bt))Ie++;for(;0<Ee-Ie;)It=Bc(It),Ee--;for(;0<Ie-Ee;)Le=Bc(Le),Ie--;for(;Ee--;){if(It===Le||Le!==null&&It===Le.alternate)break t;It=Bc(It),Le=Bc(Le)}It=null}else It=null;$t!==null&&My(dt,lt,$t,It,!1),Ot!==null&&hr!==null&&My(dt,hr,Ot,It,!0)}}e:{if(lt=Ve?Wc(Ve):window,$t=lt.nodeName&&lt.nodeName.toLowerCase(),$t==="select"||$t==="input"&&lt.type==="file")var _t=SL;else if(ly(lt))if(uy)_t=AL;else{_t=CL;var Gt=EL}else($t=lt.nodeName)&&$t.toLowerCase()==="input"&&(lt.type==="checkbox"||lt.type==="radio")&&(_t=jL);if(_t&&(_t=_t(c,Ve))){cy(dt,_t,m,ct);break e}Gt&&Gt(c,lt,Ve),c==="focusout"&&(Gt=lt._wrapperState)&&Gt.controlled&&lt.type==="number"&&J(lt,"number",lt.value)}switch(Gt=Ve?Wc(Ve):window,c){case"focusin":(ly(Gt)||Gt.contentEditable==="true")&&(Zc=Gt,Qm=Ve,Pd=null);break;case"focusout":Pd=Qm=Zc=null;break;case"mousedown":Jm=!0;break;case"contextmenu":case"mouseup":case"dragend":Jm=!1,wy(dt,m,ct);break;case"selectionchange":if(RL)break;case"keydown":case"keyup":wy(dt,m,ct)}var Yt;if(Gm)e:{switch(c){case"compositionstart":var rn="onCompositionStart";break e;case"compositionend":rn="onCompositionEnd";break e;case"compositionupdate":rn="onCompositionUpdate";break e}rn=void 0}else Vc?oy(c,m)&&(rn="onCompositionEnd"):c==="keydown"&&m.keyCode===229&&(rn="onCompositionStart");rn&&(ry&&m.locale!=="ko"&&(Vc||rn!=="onCompositionStart"?rn==="onCompositionEnd"&&Vc&&(Yt=Ed()):(Zs=ct,_c="value"in Zs?Zs.value:Zs.textContent,Vc=!0)),Gt=e1(Ve,rn),0<Gt.length&&(rn=new ty(rn,c,null,m,ct),dt.push({event:rn,listeners:Gt}),Yt?rn.data=Yt:(Yt=iy(m),Yt!==null&&(rn.data=Yt)))),(Yt=wL?yL(c,m):bL(c,m))&&(Ve=e1(Ve,"onBeforeInput"),0<Ve.length&&(ct=new ty("onBeforeInput","beforeinput",null,m,ct),dt.push({event:ct,listeners:Ve}),ct.data=Yt))}Ay(dt,d)})}function Td(c,d,m){return{instance:c,listener:d,currentTarget:m}}function e1(c,d){for(var m=d+"Capture",x=[];c!==null;){var M=c,L=M.stateNode;M.tag===5&&L!==null&&(M=L,L=Rt(c,m),L!=null&&x.unshift(Td(c,L,M)),L=Rt(c,d),L!=null&&x.push(Td(c,L,M))),c=c.return}return x}function Bc(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5);return c||null}function My(c,d,m,x,M){for(var L=d._reactName,z=[];m!==null&&m!==x;){var de=m,ye=de.alternate,Ve=de.stateNode;if(ye!==null&&ye===x)break;de.tag===5&&Ve!==null&&(de=Ve,M?(ye=Rt(m,L),ye!=null&&z.unshift(Td(m,ye,de))):M||(ye=Rt(m,L),ye!=null&&z.push(Td(m,ye,de)))),m=m.return}z.length!==0&&c.push({event:d,listeners:z})}var TL=/\r\n?/g,DL=/\u0000|\uFFFD/g;function Ry(c){return(typeof c=="string"?c:""+c).replace(TL,`
38
+ `).replace(DL,"")}function t1(c,d,m){if(d=Ry(d),Ry(c)!==d&&m)throw Error(n(425))}function n1(){}var a2=null,o2=null;function i2(c,d){return c==="textarea"||c==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var l2=typeof setTimeout=="function"?setTimeout:void 0,HL=typeof clearTimeout=="function"?clearTimeout:void 0,Py=typeof Promise=="function"?Promise:void 0,OL=typeof queueMicrotask=="function"?queueMicrotask:typeof Py<"u"?function(c){return Py.resolve(null).then(c).catch(IL)}:l2;function IL(c){setTimeout(function(){throw c})}function c2(c,d){var m=d,x=0;do{var M=m.nextSibling;if(c.removeChild(m),M&&M.nodeType===8)if(m=M.data,m==="/$"){if(x===0){c.removeChild(M),$n(d);return}x--}else m!=="$"&&m!=="$?"&&m!=="$!"||x++;m=M}while(m);$n(d)}function bi(c){for(;c!=null;c=c.nextSibling){var d=c.nodeType;if(d===1||d===3)break;if(d===8){if(d=c.data,d==="$"||d==="$!"||d==="$?")break;if(d==="/$")return null}}return c}function Ly(c){c=c.previousSibling;for(var d=0;c;){if(c.nodeType===8){var m=c.data;if(m==="$"||m==="$!"||m==="$?"){if(d===0)return c;d--}else m==="/$"&&d++}c=c.previousSibling}return null}var Uc=Math.random().toString(36).slice(2),to="__reactFiber$"+Uc,Dd="__reactProps$"+Uc,Lo="__reactContainer$"+Uc,u2="__reactEvents$"+Uc,FL="__reactListeners$"+Uc,_L="__reactHandles$"+Uc;function Cl(c){var d=c[to];if(d)return d;for(var m=c.parentNode;m;){if(d=m[Lo]||m[to]){if(m=d.alternate,d.child!==null||m!==null&&m.child!==null)for(c=Ly(c);c!==null;){if(m=c[to])return m;c=Ly(c)}return d}c=m,m=c.parentNode}return null}function Hd(c){return c=c[to]||c[Lo],!c||c.tag!==5&&c.tag!==6&&c.tag!==13&&c.tag!==3?null:c}function Wc(c){if(c.tag===5||c.tag===6)return c.stateNode;throw Error(n(33))}function r1(c){return c[Dd]||null}var d2=[],Kc=-1;function xi(c){return{current:c}}function Qn(c){0>Kc||(c.current=d2[Kc],d2[Kc]=null,Kc--)}function Gn(c,d){Kc++,d2[Kc]=c.current,c.current=d}var ki={},Qr=xi(ki),js=xi(!1),jl=ki;function Gc(c,d){var m=c.type.contextTypes;if(!m)return ki;var x=c.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===d)return x.__reactInternalMemoizedMaskedChildContext;var M={},L;for(L in m)M[L]=d[L];return x&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=d,c.__reactInternalMemoizedMaskedChildContext=M),M}function As(c){return c=c.childContextTypes,c!=null}function s1(){Qn(js),Qn(Qr)}function $y(c,d,m){if(Qr.current!==ki)throw Error(n(168));Gn(Qr,d),Gn(js,m)}function Ty(c,d,m){var x=c.stateNode;if(d=d.childContextTypes,typeof x.getChildContext!="function")return m;x=x.getChildContext();for(var M in x)if(!(M in d))throw Error(n(108,me(c)||"Unknown",M));return Z({},m,x)}function a1(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||ki,jl=Qr.current,Gn(Qr,c),Gn(js,js.current),!0}function Dy(c,d,m){var x=c.stateNode;if(!x)throw Error(n(169));m?(c=Ty(c,d,jl),x.__reactInternalMemoizedMergedChildContext=c,Qn(js),Qn(Qr),Gn(Qr,c)):Qn(js),Gn(js,m)}var $o=null,o1=!1,f2=!1;function Hy(c){$o===null?$o=[c]:$o.push(c)}function VL(c){o1=!0,Hy(c)}function Si(){if(!f2&&$o!==null){f2=!0;var c=0,d=kn;try{var m=$o;for(kn=1;c<m.length;c++){var x=m[c];do x=x(!0);while(x!==null)}$o=null,o1=!1}catch(M){throw $o!==null&&($o=$o.slice(c+1)),Q(mn,Si),M}finally{kn=d,f2=!1}}return null}var Yc=[],qc=0,i1=null,l1=0,sa=[],aa=0,Al=null,To=1,Do="";function Nl(c,d){Yc[qc++]=l1,Yc[qc++]=i1,i1=c,l1=d}function Oy(c,d,m){sa[aa++]=To,sa[aa++]=Do,sa[aa++]=Al,Al=c;var x=To;c=Do;var M=32-pe(x)-1;x&=~(1<<M),m+=1;var L=32-pe(d)+M;if(30<L){var z=M-M%5;L=(x&(1<<z)-1).toString(32),x>>=z,M-=z,To=1<<32-pe(d)+M|m<<M|x,Do=L+c}else To=1<<L|m<<M|x,Do=c}function h2(c){c.return!==null&&(Nl(c,1),Oy(c,1,0))}function p2(c){for(;c===i1;)i1=Yc[--qc],Yc[qc]=null,l1=Yc[--qc],Yc[qc]=null;for(;c===Al;)Al=sa[--aa],sa[aa]=null,Do=sa[--aa],sa[aa]=null,To=sa[--aa],sa[aa]=null}var zs=null,Bs=null,tr=!1,La=null;function Iy(c,d){var m=ca(5,null,null,0);m.elementType="DELETED",m.stateNode=d,m.return=c,d=c.deletions,d===null?(c.deletions=[m],c.flags|=16):d.push(m)}function Fy(c,d){switch(c.tag){case 5:var m=c.type;return d=d.nodeType!==1||m.toLowerCase()!==d.nodeName.toLowerCase()?null:d,d!==null?(c.stateNode=d,zs=c,Bs=bi(d.firstChild),!0):!1;case 6:return d=c.pendingProps===""||d.nodeType!==3?null:d,d!==null?(c.stateNode=d,zs=c,Bs=null,!0):!1;case 13:return d=d.nodeType!==8?null:d,d!==null?(m=Al!==null?{id:To,overflow:Do}:null,c.memoizedState={dehydrated:d,treeContext:m,retryLane:1073741824},m=ca(18,null,null,0),m.stateNode=d,m.return=c,c.child=m,zs=c,Bs=null,!0):!1;default:return!1}}function m2(c){return(c.mode&1)!==0&&(c.flags&128)===0}function g2(c){if(tr){var d=Bs;if(d){var m=d;if(!Fy(c,d)){if(m2(c))throw Error(n(418));d=bi(m.nextSibling);var x=zs;d&&Fy(c,d)?Iy(x,m):(c.flags=c.flags&-4097|2,tr=!1,zs=c)}}else{if(m2(c))throw Error(n(418));c.flags=c.flags&-4097|2,tr=!1,zs=c}}}function _y(c){for(c=c.return;c!==null&&c.tag!==5&&c.tag!==3&&c.tag!==13;)c=c.return;zs=c}function c1(c){if(c!==zs)return!1;if(!tr)return _y(c),tr=!0,!1;var d;if((d=c.tag!==3)&&!(d=c.tag!==5)&&(d=c.type,d=d!=="head"&&d!=="body"&&!i2(c.type,c.memoizedProps)),d&&(d=Bs)){if(m2(c))throw Vy(),Error(n(418));for(;d;)Iy(c,d),d=bi(d.nextSibling)}if(_y(c),c.tag===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(n(317));e:{for(c=c.nextSibling,d=0;c;){if(c.nodeType===8){var m=c.data;if(m==="/$"){if(d===0){Bs=bi(c.nextSibling);break e}d--}else m!=="$"&&m!=="$!"&&m!=="$?"||d++}c=c.nextSibling}Bs=null}}else Bs=zs?bi(c.stateNode.nextSibling):null;return!0}function Vy(){for(var c=Bs;c;)c=bi(c.nextSibling)}function Xc(){Bs=zs=null,tr=!1}function v2(c){La===null?La=[c]:La.push(c)}var ZL=N.ReactCurrentBatchConfig;function Od(c,d,m){if(c=m.ref,c!==null&&typeof c!="function"&&typeof c!="object"){if(m._owner){if(m=m._owner,m){if(m.tag!==1)throw Error(n(309));var x=m.stateNode}if(!x)throw Error(n(147,c));var M=x,L=""+c;return d!==null&&d.ref!==null&&typeof d.ref=="function"&&d.ref._stringRef===L?d.ref:(d=function(z){var de=M.refs;z===null?delete de[L]:de[L]=z},d._stringRef=L,d)}if(typeof c!="string")throw Error(n(284));if(!m._owner)throw Error(n(290,c))}return c}function u1(c,d){throw c=Object.prototype.toString.call(d),Error(n(31,c==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":c))}function Zy(c){var d=c._init;return d(c._payload)}function zy(c){function d(Le,Ee){if(c){var Ie=Le.deletions;Ie===null?(Le.deletions=[Ee],Le.flags|=16):Ie.push(Ee)}}function m(Le,Ee){if(!c)return null;for(;Ee!==null;)d(Le,Ee),Ee=Ee.sibling;return null}function x(Le,Ee){for(Le=new Map;Ee!==null;)Ee.key!==null?Le.set(Ee.key,Ee):Le.set(Ee.index,Ee),Ee=Ee.sibling;return Le}function M(Le,Ee){return Le=Pi(Le,Ee),Le.index=0,Le.sibling=null,Le}function L(Le,Ee,Ie){return Le.index=Ie,c?(Ie=Le.alternate,Ie!==null?(Ie=Ie.index,Ie<Ee?(Le.flags|=2,Ee):Ie):(Le.flags|=2,Ee)):(Le.flags|=1048576,Ee)}function z(Le){return c&&Le.alternate===null&&(Le.flags|=2),Le}function de(Le,Ee,Ie,bt){return Ee===null||Ee.tag!==6?(Ee=lg(Ie,Le.mode,bt),Ee.return=Le,Ee):(Ee=M(Ee,Ie),Ee.return=Le,Ee)}function ye(Le,Ee,Ie,bt){var _t=Ie.type;return _t===P?ct(Le,Ee,Ie.props.children,bt,Ie.key):Ee!==null&&(Ee.elementType===_t||typeof _t=="object"&&_t!==null&&_t.$$typeof===Y&&Zy(_t)===Ee.type)?(bt=M(Ee,Ie.props),bt.ref=Od(Le,Ee,Ie),bt.return=Le,bt):(bt=T1(Ie.type,Ie.key,Ie.props,null,Le.mode,bt),bt.ref=Od(Le,Ee,Ie),bt.return=Le,bt)}function Ve(Le,Ee,Ie,bt){return Ee===null||Ee.tag!==4||Ee.stateNode.containerInfo!==Ie.containerInfo||Ee.stateNode.implementation!==Ie.implementation?(Ee=cg(Ie,Le.mode,bt),Ee.return=Le,Ee):(Ee=M(Ee,Ie.children||[]),Ee.return=Le,Ee)}function ct(Le,Ee,Ie,bt,_t){return Ee===null||Ee.tag!==7?(Ee=Hl(Ie,Le.mode,bt,_t),Ee.return=Le,Ee):(Ee=M(Ee,Ie),Ee.return=Le,Ee)}function dt(Le,Ee,Ie){if(typeof Ee=="string"&&Ee!==""||typeof Ee=="number")return Ee=lg(""+Ee,Le.mode,Ie),Ee.return=Le,Ee;if(typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case A:return Ie=T1(Ee.type,Ee.key,Ee.props,null,Le.mode,Ie),Ie.ref=Od(Le,null,Ee),Ie.return=Le,Ie;case T:return Ee=cg(Ee,Le.mode,Ie),Ee.return=Le,Ee;case Y:var bt=Ee._init;return dt(Le,bt(Ee._payload),Ie)}if(ge(Ee)||O(Ee))return Ee=Hl(Ee,Le.mode,Ie,null),Ee.return=Le,Ee;u1(Le,Ee)}return null}function lt(Le,Ee,Ie,bt){var _t=Ee!==null?Ee.key:null;if(typeof Ie=="string"&&Ie!==""||typeof Ie=="number")return _t!==null?null:de(Le,Ee,""+Ie,bt);if(typeof Ie=="object"&&Ie!==null){switch(Ie.$$typeof){case A:return Ie.key===_t?ye(Le,Ee,Ie,bt):null;case T:return Ie.key===_t?Ve(Le,Ee,Ie,bt):null;case Y:return _t=Ie._init,lt(Le,Ee,_t(Ie._payload),bt)}if(ge(Ie)||O(Ie))return _t!==null?null:ct(Le,Ee,Ie,bt,null);u1(Le,Ie)}return null}function $t(Le,Ee,Ie,bt,_t){if(typeof bt=="string"&&bt!==""||typeof bt=="number")return Le=Le.get(Ie)||null,de(Ee,Le,""+bt,_t);if(typeof bt=="object"&&bt!==null){switch(bt.$$typeof){case A:return Le=Le.get(bt.key===null?Ie:bt.key)||null,ye(Ee,Le,bt,_t);case T:return Le=Le.get(bt.key===null?Ie:bt.key)||null,Ve(Ee,Le,bt,_t);case Y:var Gt=bt._init;return $t(Le,Ee,Ie,Gt(bt._payload),_t)}if(ge(bt)||O(bt))return Le=Le.get(Ie)||null,ct(Ee,Le,bt,_t,null);u1(Ee,bt)}return null}function Ot(Le,Ee,Ie,bt){for(var _t=null,Gt=null,Yt=Ee,rn=Ee=0,Dr=null;Yt!==null&&rn<Ie.length;rn++){Yt.index>rn?(Dr=Yt,Yt=null):Dr=Yt.sibling;var Dn=lt(Le,Yt,Ie[rn],bt);if(Dn===null){Yt===null&&(Yt=Dr);break}c&&Yt&&Dn.alternate===null&&d(Le,Yt),Ee=L(Dn,Ee,rn),Gt===null?_t=Dn:Gt.sibling=Dn,Gt=Dn,Yt=Dr}if(rn===Ie.length)return m(Le,Yt),tr&&Nl(Le,rn),_t;if(Yt===null){for(;rn<Ie.length;rn++)Yt=dt(Le,Ie[rn],bt),Yt!==null&&(Ee=L(Yt,Ee,rn),Gt===null?_t=Yt:Gt.sibling=Yt,Gt=Yt);return tr&&Nl(Le,rn),_t}for(Yt=x(Le,Yt);rn<Ie.length;rn++)Dr=$t(Yt,Le,rn,Ie[rn],bt),Dr!==null&&(c&&Dr.alternate!==null&&Yt.delete(Dr.key===null?rn:Dr.key),Ee=L(Dr,Ee,rn),Gt===null?_t=Dr:Gt.sibling=Dr,Gt=Dr);return c&&Yt.forEach(function(Li){return d(Le,Li)}),tr&&Nl(Le,rn),_t}function It(Le,Ee,Ie,bt){var _t=O(Ie);if(typeof _t!="function")throw Error(n(150));if(Ie=_t.call(Ie),Ie==null)throw Error(n(151));for(var Gt=_t=null,Yt=Ee,rn=Ee=0,Dr=null,Dn=Ie.next();Yt!==null&&!Dn.done;rn++,Dn=Ie.next()){Yt.index>rn?(Dr=Yt,Yt=null):Dr=Yt.sibling;var Li=lt(Le,Yt,Dn.value,bt);if(Li===null){Yt===null&&(Yt=Dr);break}c&&Yt&&Li.alternate===null&&d(Le,Yt),Ee=L(Li,Ee,rn),Gt===null?_t=Li:Gt.sibling=Li,Gt=Li,Yt=Dr}if(Dn.done)return m(Le,Yt),tr&&Nl(Le,rn),_t;if(Yt===null){for(;!Dn.done;rn++,Dn=Ie.next())Dn=dt(Le,Dn.value,bt),Dn!==null&&(Ee=L(Dn,Ee,rn),Gt===null?_t=Dn:Gt.sibling=Dn,Gt=Dn);return tr&&Nl(Le,rn),_t}for(Yt=x(Le,Yt);!Dn.done;rn++,Dn=Ie.next())Dn=$t(Yt,Le,rn,Dn.value,bt),Dn!==null&&(c&&Dn.alternate!==null&&Yt.delete(Dn.key===null?rn:Dn.key),Ee=L(Dn,Ee,rn),Gt===null?_t=Dn:Gt.sibling=Dn,Gt=Dn);return c&&Yt.forEach(function(x$){return d(Le,x$)}),tr&&Nl(Le,rn),_t}function hr(Le,Ee,Ie,bt){if(typeof Ie=="object"&&Ie!==null&&Ie.type===P&&Ie.key===null&&(Ie=Ie.props.children),typeof Ie=="object"&&Ie!==null){switch(Ie.$$typeof){case A:e:{for(var _t=Ie.key,Gt=Ee;Gt!==null;){if(Gt.key===_t){if(_t=Ie.type,_t===P){if(Gt.tag===7){m(Le,Gt.sibling),Ee=M(Gt,Ie.props.children),Ee.return=Le,Le=Ee;break e}}else if(Gt.elementType===_t||typeof _t=="object"&&_t!==null&&_t.$$typeof===Y&&Zy(_t)===Gt.type){m(Le,Gt.sibling),Ee=M(Gt,Ie.props),Ee.ref=Od(Le,Gt,Ie),Ee.return=Le,Le=Ee;break e}m(Le,Gt);break}else d(Le,Gt);Gt=Gt.sibling}Ie.type===P?(Ee=Hl(Ie.props.children,Le.mode,bt,Ie.key),Ee.return=Le,Le=Ee):(bt=T1(Ie.type,Ie.key,Ie.props,null,Le.mode,bt),bt.ref=Od(Le,Ee,Ie),bt.return=Le,Le=bt)}return z(Le);case T:e:{for(Gt=Ie.key;Ee!==null;){if(Ee.key===Gt)if(Ee.tag===4&&Ee.stateNode.containerInfo===Ie.containerInfo&&Ee.stateNode.implementation===Ie.implementation){m(Le,Ee.sibling),Ee=M(Ee,Ie.children||[]),Ee.return=Le,Le=Ee;break e}else{m(Le,Ee);break}else d(Le,Ee);Ee=Ee.sibling}Ee=cg(Ie,Le.mode,bt),Ee.return=Le,Le=Ee}return z(Le);case Y:return Gt=Ie._init,hr(Le,Ee,Gt(Ie._payload),bt)}if(ge(Ie))return Ot(Le,Ee,Ie,bt);if(O(Ie))return It(Le,Ee,Ie,bt);u1(Le,Ie)}return typeof Ie=="string"&&Ie!==""||typeof Ie=="number"?(Ie=""+Ie,Ee!==null&&Ee.tag===6?(m(Le,Ee.sibling),Ee=M(Ee,Ie),Ee.return=Le,Le=Ee):(m(Le,Ee),Ee=lg(Ie,Le.mode,bt),Ee.return=Le,Le=Ee),z(Le)):m(Le,Ee)}return hr}var Qc=zy(!0),By=zy(!1),d1=xi(null),f1=null,Jc=null,w2=null;function y2(){w2=Jc=f1=null}function b2(c){var d=d1.current;Qn(d1),c._currentValue=d}function x2(c,d,m){for(;c!==null;){var x=c.alternate;if((c.childLanes&d)!==d?(c.childLanes|=d,x!==null&&(x.childLanes|=d)):x!==null&&(x.childLanes&d)!==d&&(x.childLanes|=d),c===m)break;c=c.return}}function eu(c,d){f1=c,w2=Jc=null,c=c.dependencies,c!==null&&c.firstContext!==null&&((c.lanes&d)!==0&&(Ns=!0),c.firstContext=null)}function oa(c){var d=c._currentValue;if(w2!==c)if(c={context:c,memoizedValue:d,next:null},Jc===null){if(f1===null)throw Error(n(308));Jc=c,f1.dependencies={lanes:0,firstContext:c}}else Jc=Jc.next=c;return d}var Ml=null;function k2(c){Ml===null?Ml=[c]:Ml.push(c)}function Uy(c,d,m,x){var M=d.interleaved;return M===null?(m.next=m,k2(d)):(m.next=M.next,M.next=m),d.interleaved=m,Ho(c,x)}function Ho(c,d){c.lanes|=d;var m=c.alternate;for(m!==null&&(m.lanes|=d),m=c,c=c.return;c!==null;)c.childLanes|=d,m=c.alternate,m!==null&&(m.childLanes|=d),m=c,c=c.return;return m.tag===3?m.stateNode:null}var Ei=!1;function S2(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Wy(c,d){c=c.updateQueue,d.updateQueue===c&&(d.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,effects:c.effects})}function Oo(c,d){return{eventTime:c,lane:d,tag:0,payload:null,callback:null,next:null}}function Ci(c,d,m){var x=c.updateQueue;if(x===null)return null;if(x=x.shared,(Ln&2)!==0){var M=x.pending;return M===null?d.next=d:(d.next=M.next,M.next=d),x.pending=d,Ho(c,m)}return M=x.interleaved,M===null?(d.next=d,k2(x)):(d.next=M.next,M.next=d),x.interleaved=d,Ho(c,m)}function h1(c,d,m){if(d=d.updateQueue,d!==null&&(d=d.shared,(m&4194240)!==0)){var x=d.lanes;x&=c.pendingLanes,m|=x,d.lanes=m,Cs(c,m)}}function Ky(c,d){var m=c.updateQueue,x=c.alternate;if(x!==null&&(x=x.updateQueue,m===x)){var M=null,L=null;if(m=m.firstBaseUpdate,m!==null){do{var z={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};L===null?M=L=z:L=L.next=z,m=m.next}while(m!==null);L===null?M=L=d:L=L.next=d}else M=L=d;m={baseState:x.baseState,firstBaseUpdate:M,lastBaseUpdate:L,shared:x.shared,effects:x.effects},c.updateQueue=m;return}c=m.lastBaseUpdate,c===null?m.firstBaseUpdate=d:c.next=d,m.lastBaseUpdate=d}function p1(c,d,m,x){var M=c.updateQueue;Ei=!1;var L=M.firstBaseUpdate,z=M.lastBaseUpdate,de=M.shared.pending;if(de!==null){M.shared.pending=null;var ye=de,Ve=ye.next;ye.next=null,z===null?L=Ve:z.next=Ve,z=ye;var ct=c.alternate;ct!==null&&(ct=ct.updateQueue,de=ct.lastBaseUpdate,de!==z&&(de===null?ct.firstBaseUpdate=Ve:de.next=Ve,ct.lastBaseUpdate=ye))}if(L!==null){var dt=M.baseState;z=0,ct=Ve=ye=null,de=L;do{var lt=de.lane,$t=de.eventTime;if((x&lt)===lt){ct!==null&&(ct=ct.next={eventTime:$t,lane:0,tag:de.tag,payload:de.payload,callback:de.callback,next:null});e:{var Ot=c,It=de;switch(lt=d,$t=m,It.tag){case 1:if(Ot=It.payload,typeof Ot=="function"){dt=Ot.call($t,dt,lt);break e}dt=Ot;break e;case 3:Ot.flags=Ot.flags&-65537|128;case 0:if(Ot=It.payload,lt=typeof Ot=="function"?Ot.call($t,dt,lt):Ot,lt==null)break e;dt=Z({},dt,lt);break e;case 2:Ei=!0}}de.callback!==null&&de.lane!==0&&(c.flags|=64,lt=M.effects,lt===null?M.effects=[de]:lt.push(de))}else $t={eventTime:$t,lane:lt,tag:de.tag,payload:de.payload,callback:de.callback,next:null},ct===null?(Ve=ct=$t,ye=dt):ct=ct.next=$t,z|=lt;if(de=de.next,de===null){if(de=M.shared.pending,de===null)break;lt=de,de=lt.next,lt.next=null,M.lastBaseUpdate=lt,M.shared.pending=null}}while(!0);if(ct===null&&(ye=dt),M.baseState=ye,M.firstBaseUpdate=Ve,M.lastBaseUpdate=ct,d=M.shared.interleaved,d!==null){M=d;do z|=M.lane,M=M.next;while(M!==d)}else L===null&&(M.shared.lanes=0);Ll|=z,c.lanes=z,c.memoizedState=dt}}function Gy(c,d,m){if(c=d.effects,d.effects=null,c!==null)for(d=0;d<c.length;d++){var x=c[d],M=x.callback;if(M!==null){if(x.callback=null,x=m,typeof M!="function")throw Error(n(191,M));M.call(x)}}}var Id={},no=xi(Id),Fd=xi(Id),_d=xi(Id);function Rl(c){if(c===Id)throw Error(n(174));return c}function E2(c,d){switch(Gn(_d,d),Gn(Fd,c),Gn(no,Id),c=d.nodeType,c){case 9:case 11:d=(d=d.documentElement)?d.namespaceURI:Me(null,"");break;default:c=c===8?d.parentNode:d,d=c.namespaceURI||null,c=c.tagName,d=Me(d,c)}Qn(no),Gn(no,d)}function tu(){Qn(no),Qn(Fd),Qn(_d)}function Yy(c){Rl(_d.current);var d=Rl(no.current),m=Me(d,c.type);d!==m&&(Gn(Fd,c),Gn(no,m))}function C2(c){Fd.current===c&&(Qn(no),Qn(Fd))}var rr=xi(0);function m1(c){for(var d=c;d!==null;){if(d.tag===13){var m=d.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||m.data==="$!"))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var j2=[];function A2(){for(var c=0;c<j2.length;c++)j2[c]._workInProgressVersionPrimary=null;j2.length=0}var g1=N.ReactCurrentDispatcher,N2=N.ReactCurrentBatchConfig,Pl=0,sr=null,Cr=null,$r=null,v1=!1,Vd=!1,Zd=0,zL=0;function Jr(){throw Error(n(321))}function M2(c,d){if(d===null)return!1;for(var m=0;m<d.length&&m<c.length;m++)if(!Pa(c[m],d[m]))return!1;return!0}function R2(c,d,m,x,M,L){if(Pl=L,sr=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,g1.current=c===null||c.memoizedState===null?KL:GL,c=m(x,M),Vd){L=0;do{if(Vd=!1,Zd=0,25<=L)throw Error(n(301));L+=1,$r=Cr=null,d.updateQueue=null,g1.current=YL,c=m(x,M)}while(Vd)}if(g1.current=b1,d=Cr!==null&&Cr.next!==null,Pl=0,$r=Cr=sr=null,v1=!1,d)throw Error(n(300));return c}function P2(){var c=Zd!==0;return Zd=0,c}function ro(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $r===null?sr.memoizedState=$r=c:$r=$r.next=c,$r}function ia(){if(Cr===null){var c=sr.alternate;c=c!==null?c.memoizedState:null}else c=Cr.next;var d=$r===null?sr.memoizedState:$r.next;if(d!==null)$r=d,Cr=c;else{if(c===null)throw Error(n(310));Cr=c,c={memoizedState:Cr.memoizedState,baseState:Cr.baseState,baseQueue:Cr.baseQueue,queue:Cr.queue,next:null},$r===null?sr.memoizedState=$r=c:$r=$r.next=c}return $r}function zd(c,d){return typeof d=="function"?d(c):d}function L2(c){var d=ia(),m=d.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=c;var x=Cr,M=x.baseQueue,L=m.pending;if(L!==null){if(M!==null){var z=M.next;M.next=L.next,L.next=z}x.baseQueue=M=L,m.pending=null}if(M!==null){L=M.next,x=x.baseState;var de=z=null,ye=null,Ve=L;do{var ct=Ve.lane;if((Pl&ct)===ct)ye!==null&&(ye=ye.next={lane:0,action:Ve.action,hasEagerState:Ve.hasEagerState,eagerState:Ve.eagerState,next:null}),x=Ve.hasEagerState?Ve.eagerState:c(x,Ve.action);else{var dt={lane:ct,action:Ve.action,hasEagerState:Ve.hasEagerState,eagerState:Ve.eagerState,next:null};ye===null?(de=ye=dt,z=x):ye=ye.next=dt,sr.lanes|=ct,Ll|=ct}Ve=Ve.next}while(Ve!==null&&Ve!==L);ye===null?z=x:ye.next=de,Pa(x,d.memoizedState)||(Ns=!0),d.memoizedState=x,d.baseState=z,d.baseQueue=ye,m.lastRenderedState=x}if(c=m.interleaved,c!==null){M=c;do L=M.lane,sr.lanes|=L,Ll|=L,M=M.next;while(M!==c)}else M===null&&(m.lanes=0);return[d.memoizedState,m.dispatch]}function $2(c){var d=ia(),m=d.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=c;var x=m.dispatch,M=m.pending,L=d.memoizedState;if(M!==null){m.pending=null;var z=M=M.next;do L=c(L,z.action),z=z.next;while(z!==M);Pa(L,d.memoizedState)||(Ns=!0),d.memoizedState=L,d.baseQueue===null&&(d.baseState=L),m.lastRenderedState=L}return[L,x]}function qy(){}function Xy(c,d){var m=sr,x=ia(),M=d(),L=!Pa(x.memoizedState,M);if(L&&(x.memoizedState=M,Ns=!0),x=x.queue,T2(eb.bind(null,m,x,c),[c]),x.getSnapshot!==d||L||$r!==null&&$r.memoizedState.tag&1){if(m.flags|=2048,Bd(9,Jy.bind(null,m,x,M,d),void 0,null),Tr===null)throw Error(n(349));(Pl&30)!==0||Qy(m,d,M)}return M}function Qy(c,d,m){c.flags|=16384,c={getSnapshot:d,value:m},d=sr.updateQueue,d===null?(d={lastEffect:null,stores:null},sr.updateQueue=d,d.stores=[c]):(m=d.stores,m===null?d.stores=[c]:m.push(c))}function Jy(c,d,m,x){d.value=m,d.getSnapshot=x,tb(d)&&nb(c)}function eb(c,d,m){return m(function(){tb(d)&&nb(c)})}function tb(c){var d=c.getSnapshot;c=c.value;try{var m=d();return!Pa(c,m)}catch{return!0}}function nb(c){var d=Ho(c,1);d!==null&&Ha(d,c,1,-1)}function rb(c){var d=ro();return typeof c=="function"&&(c=c()),d.memoizedState=d.baseState=c,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:zd,lastRenderedState:c},d.queue=c,c=c.dispatch=WL.bind(null,sr,c),[d.memoizedState,c]}function Bd(c,d,m,x){return c={tag:c,create:d,destroy:m,deps:x,next:null},d=sr.updateQueue,d===null?(d={lastEffect:null,stores:null},sr.updateQueue=d,d.lastEffect=c.next=c):(m=d.lastEffect,m===null?d.lastEffect=c.next=c:(x=m.next,m.next=c,c.next=x,d.lastEffect=c)),c}function sb(){return ia().memoizedState}function w1(c,d,m,x){var M=ro();sr.flags|=c,M.memoizedState=Bd(1|d,m,void 0,x===void 0?null:x)}function y1(c,d,m,x){var M=ia();x=x===void 0?null:x;var L=void 0;if(Cr!==null){var z=Cr.memoizedState;if(L=z.destroy,x!==null&&M2(x,z.deps)){M.memoizedState=Bd(d,m,L,x);return}}sr.flags|=c,M.memoizedState=Bd(1|d,m,L,x)}function ab(c,d){return w1(8390656,8,c,d)}function T2(c,d){return y1(2048,8,c,d)}function ob(c,d){return y1(4,2,c,d)}function ib(c,d){return y1(4,4,c,d)}function lb(c,d){if(typeof d=="function")return c=c(),d(c),function(){d(null)};if(d!=null)return c=c(),d.current=c,function(){d.current=null}}function cb(c,d,m){return m=m!=null?m.concat([c]):null,y1(4,4,lb.bind(null,d,c),m)}function D2(){}function ub(c,d){var m=ia();d=d===void 0?null:d;var x=m.memoizedState;return x!==null&&d!==null&&M2(d,x[1])?x[0]:(m.memoizedState=[c,d],c)}function db(c,d){var m=ia();d=d===void 0?null:d;var x=m.memoizedState;return x!==null&&d!==null&&M2(d,x[1])?x[0]:(c=c(),m.memoizedState=[c,d],c)}function fb(c,d,m){return(Pl&21)===0?(c.baseState&&(c.baseState=!1,Ns=!0),c.memoizedState=m):(Pa(m,d)||(m=Nn(),sr.lanes|=m,Ll|=m,c.baseState=!0),d)}function BL(c,d){var m=kn;kn=m!==0&&4>m?m:4,c(!0);var x=N2.transition;N2.transition={};try{c(!1),d()}finally{kn=m,N2.transition=x}}function hb(){return ia().memoizedState}function UL(c,d,m){var x=Mi(c);if(m={lane:x,action:m,hasEagerState:!1,eagerState:null,next:null},pb(c))mb(d,m);else if(m=Uy(c,d,m,x),m!==null){var M=fs();Ha(m,c,x,M),gb(m,d,x)}}function WL(c,d,m){var x=Mi(c),M={lane:x,action:m,hasEagerState:!1,eagerState:null,next:null};if(pb(c))mb(d,M);else{var L=c.alternate;if(c.lanes===0&&(L===null||L.lanes===0)&&(L=d.lastRenderedReducer,L!==null))try{var z=d.lastRenderedState,de=L(z,m);if(M.hasEagerState=!0,M.eagerState=de,Pa(de,z)){var ye=d.interleaved;ye===null?(M.next=M,k2(d)):(M.next=ye.next,ye.next=M),d.interleaved=M;return}}catch{}finally{}m=Uy(c,d,M,x),m!==null&&(M=fs(),Ha(m,c,x,M),gb(m,d,x))}}function pb(c){var d=c.alternate;return c===sr||d!==null&&d===sr}function mb(c,d){Vd=v1=!0;var m=c.pending;m===null?d.next=d:(d.next=m.next,m.next=d),c.pending=d}function gb(c,d,m){if((m&4194240)!==0){var x=d.lanes;x&=c.pendingLanes,m|=x,d.lanes=m,Cs(c,m)}}var b1={readContext:oa,useCallback:Jr,useContext:Jr,useEffect:Jr,useImperativeHandle:Jr,useInsertionEffect:Jr,useLayoutEffect:Jr,useMemo:Jr,useReducer:Jr,useRef:Jr,useState:Jr,useDebugValue:Jr,useDeferredValue:Jr,useTransition:Jr,useMutableSource:Jr,useSyncExternalStore:Jr,useId:Jr,unstable_isNewReconciler:!1},KL={readContext:oa,useCallback:function(c,d){return ro().memoizedState=[c,d===void 0?null:d],c},useContext:oa,useEffect:ab,useImperativeHandle:function(c,d,m){return m=m!=null?m.concat([c]):null,w1(4194308,4,lb.bind(null,d,c),m)},useLayoutEffect:function(c,d){return w1(4194308,4,c,d)},useInsertionEffect:function(c,d){return w1(4,2,c,d)},useMemo:function(c,d){var m=ro();return d=d===void 0?null:d,c=c(),m.memoizedState=[c,d],c},useReducer:function(c,d,m){var x=ro();return d=m!==void 0?m(d):d,x.memoizedState=x.baseState=d,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:d},x.queue=c,c=c.dispatch=UL.bind(null,sr,c),[x.memoizedState,c]},useRef:function(c){var d=ro();return c={current:c},d.memoizedState=c},useState:rb,useDebugValue:D2,useDeferredValue:function(c){return ro().memoizedState=c},useTransition:function(){var c=rb(!1),d=c[0];return c=BL.bind(null,c[1]),ro().memoizedState=c,[d,c]},useMutableSource:function(){},useSyncExternalStore:function(c,d,m){var x=sr,M=ro();if(tr){if(m===void 0)throw Error(n(407));m=m()}else{if(m=d(),Tr===null)throw Error(n(349));(Pl&30)!==0||Qy(x,d,m)}M.memoizedState=m;var L={value:m,getSnapshot:d};return M.queue=L,ab(eb.bind(null,x,L,c),[c]),x.flags|=2048,Bd(9,Jy.bind(null,x,L,m,d),void 0,null),m},useId:function(){var c=ro(),d=Tr.identifierPrefix;if(tr){var m=Do,x=To;m=(x&~(1<<32-pe(x)-1)).toString(32)+m,d=":"+d+"R"+m,m=Zd++,0<m&&(d+="H"+m.toString(32)),d+=":"}else m=zL++,d=":"+d+"r"+m.toString(32)+":";return c.memoizedState=d},unstable_isNewReconciler:!1},GL={readContext:oa,useCallback:ub,useContext:oa,useEffect:T2,useImperativeHandle:cb,useInsertionEffect:ob,useLayoutEffect:ib,useMemo:db,useReducer:L2,useRef:sb,useState:function(){return L2(zd)},useDebugValue:D2,useDeferredValue:function(c){var d=ia();return fb(d,Cr.memoizedState,c)},useTransition:function(){var c=L2(zd)[0],d=ia().memoizedState;return[c,d]},useMutableSource:qy,useSyncExternalStore:Xy,useId:hb,unstable_isNewReconciler:!1},YL={readContext:oa,useCallback:ub,useContext:oa,useEffect:T2,useImperativeHandle:cb,useInsertionEffect:ob,useLayoutEffect:ib,useMemo:db,useReducer:$2,useRef:sb,useState:function(){return $2(zd)},useDebugValue:D2,useDeferredValue:function(c){var d=ia();return Cr===null?d.memoizedState=c:fb(d,Cr.memoizedState,c)},useTransition:function(){var c=$2(zd)[0],d=ia().memoizedState;return[c,d]},useMutableSource:qy,useSyncExternalStore:Xy,useId:hb,unstable_isNewReconciler:!1};function $a(c,d){if(c&&c.defaultProps){d=Z({},d),c=c.defaultProps;for(var m in c)d[m]===void 0&&(d[m]=c[m]);return d}return d}function H2(c,d,m,x){d=c.memoizedState,m=m(x,d),m=m==null?d:Z({},d,m),c.memoizedState=m,c.lanes===0&&(c.updateQueue.baseState=m)}var x1={isMounted:function(c){return(c=c._reactInternals)?tt(c)===c:!1},enqueueSetState:function(c,d,m){c=c._reactInternals;var x=fs(),M=Mi(c),L=Oo(x,M);L.payload=d,m!=null&&(L.callback=m),d=Ci(c,L,M),d!==null&&(Ha(d,c,M,x),h1(d,c,M))},enqueueReplaceState:function(c,d,m){c=c._reactInternals;var x=fs(),M=Mi(c),L=Oo(x,M);L.tag=1,L.payload=d,m!=null&&(L.callback=m),d=Ci(c,L,M),d!==null&&(Ha(d,c,M,x),h1(d,c,M))},enqueueForceUpdate:function(c,d){c=c._reactInternals;var m=fs(),x=Mi(c),M=Oo(m,x);M.tag=2,d!=null&&(M.callback=d),d=Ci(c,M,x),d!==null&&(Ha(d,c,x,m),h1(d,c,x))}};function vb(c,d,m,x,M,L,z){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(x,L,z):d.prototype&&d.prototype.isPureReactComponent?!Rd(m,x)||!Rd(M,L):!0}function wb(c,d,m){var x=!1,M=ki,L=d.contextType;return typeof L=="object"&&L!==null?L=oa(L):(M=As(d)?jl:Qr.current,x=d.contextTypes,L=(x=x!=null)?Gc(c,M):ki),d=new d(m,L),c.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=x1,c.stateNode=d,d._reactInternals=c,x&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=M,c.__reactInternalMemoizedMaskedChildContext=L),d}function yb(c,d,m,x){c=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(m,x),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(m,x),d.state!==c&&x1.enqueueReplaceState(d,d.state,null)}function O2(c,d,m,x){var M=c.stateNode;M.props=m,M.state=c.memoizedState,M.refs={},S2(c);var L=d.contextType;typeof L=="object"&&L!==null?M.context=oa(L):(L=As(d)?jl:Qr.current,M.context=Gc(c,L)),M.state=c.memoizedState,L=d.getDerivedStateFromProps,typeof L=="function"&&(H2(c,d,L,m),M.state=c.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof M.getSnapshotBeforeUpdate=="function"||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(d=M.state,typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount(),d!==M.state&&x1.enqueueReplaceState(M,M.state,null),p1(c,m,M,x),M.state=c.memoizedState),typeof M.componentDidMount=="function"&&(c.flags|=4194308)}function nu(c,d){try{var m="",x=d;do m+=se(x),x=x.return;while(x);var M=m}catch(L){M=`
39
+ Error generating stack: `+L.message+`
40
+ `+L.stack}return{value:c,source:d,stack:M,digest:null}}function I2(c,d,m){return{value:c,source:null,stack:m??null,digest:d??null}}function F2(c,d){try{console.error(d.value)}catch(m){setTimeout(function(){throw m})}}var qL=typeof WeakMap=="function"?WeakMap:Map;function bb(c,d,m){m=Oo(-1,m),m.tag=3,m.payload={element:null};var x=d.value;return m.callback=function(){N1||(N1=!0,eg=x),F2(c,d)},m}function xb(c,d,m){m=Oo(-1,m),m.tag=3;var x=c.type.getDerivedStateFromError;if(typeof x=="function"){var M=d.value;m.payload=function(){return x(M)},m.callback=function(){F2(c,d)}}var L=c.stateNode;return L!==null&&typeof L.componentDidCatch=="function"&&(m.callback=function(){F2(c,d),typeof x!="function"&&(Ai===null?Ai=new Set([this]):Ai.add(this));var z=d.stack;this.componentDidCatch(d.value,{componentStack:z!==null?z:""})}),m}function kb(c,d,m){var x=c.pingCache;if(x===null){x=c.pingCache=new qL;var M=new Set;x.set(d,M)}else M=x.get(d),M===void 0&&(M=new Set,x.set(d,M));M.has(m)||(M.add(m),c=u$.bind(null,c,d,m),d.then(c,c))}function Sb(c){do{var d;if((d=c.tag===13)&&(d=c.memoizedState,d=d!==null?d.dehydrated!==null:!0),d)return c;c=c.return}while(c!==null);return null}function Eb(c,d,m,x,M){return(c.mode&1)===0?(c===d?c.flags|=65536:(c.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(d=Oo(-1,1),d.tag=2,Ci(m,d,1))),m.lanes|=1),c):(c.flags|=65536,c.lanes=M,c)}var XL=N.ReactCurrentOwner,Ns=!1;function ds(c,d,m,x){d.child=c===null?By(d,null,m,x):Qc(d,c.child,m,x)}function Cb(c,d,m,x,M){m=m.render;var L=d.ref;return eu(d,M),x=R2(c,d,m,x,L,M),m=P2(),c!==null&&!Ns?(d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~M,Io(c,d,M)):(tr&&m&&h2(d),d.flags|=1,ds(c,d,x,M),d.child)}function jb(c,d,m,x,M){if(c===null){var L=m.type;return typeof L=="function"&&!ig(L)&&L.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(d.tag=15,d.type=L,Ab(c,d,L,x,M)):(c=T1(m.type,null,x,d,d.mode,M),c.ref=d.ref,c.return=d,d.child=c)}if(L=c.child,(c.lanes&M)===0){var z=L.memoizedProps;if(m=m.compare,m=m!==null?m:Rd,m(z,x)&&c.ref===d.ref)return Io(c,d,M)}return d.flags|=1,c=Pi(L,x),c.ref=d.ref,c.return=d,d.child=c}function Ab(c,d,m,x,M){if(c!==null){var L=c.memoizedProps;if(Rd(L,x)&&c.ref===d.ref)if(Ns=!1,d.pendingProps=x=L,(c.lanes&M)!==0)(c.flags&131072)!==0&&(Ns=!0);else return d.lanes=c.lanes,Io(c,d,M)}return _2(c,d,m,x,M)}function Nb(c,d,m){var x=d.pendingProps,M=x.children,L=c!==null?c.memoizedState:null;if(x.mode==="hidden")if((d.mode&1)===0)d.memoizedState={baseLanes:0,cachePool:null,transitions:null},Gn(su,Us),Us|=m;else{if((m&1073741824)===0)return c=L!==null?L.baseLanes|m:m,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:c,cachePool:null,transitions:null},d.updateQueue=null,Gn(su,Us),Us|=c,null;d.memoizedState={baseLanes:0,cachePool:null,transitions:null},x=L!==null?L.baseLanes:m,Gn(su,Us),Us|=x}else L!==null?(x=L.baseLanes|m,d.memoizedState=null):x=m,Gn(su,Us),Us|=x;return ds(c,d,M,m),d.child}function Mb(c,d){var m=d.ref;(c===null&&m!==null||c!==null&&c.ref!==m)&&(d.flags|=512,d.flags|=2097152)}function _2(c,d,m,x,M){var L=As(m)?jl:Qr.current;return L=Gc(d,L),eu(d,M),m=R2(c,d,m,x,L,M),x=P2(),c!==null&&!Ns?(d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~M,Io(c,d,M)):(tr&&x&&h2(d),d.flags|=1,ds(c,d,m,M),d.child)}function Rb(c,d,m,x,M){if(As(m)){var L=!0;a1(d)}else L=!1;if(eu(d,M),d.stateNode===null)S1(c,d),wb(d,m,x),O2(d,m,x,M),x=!0;else if(c===null){var z=d.stateNode,de=d.memoizedProps;z.props=de;var ye=z.context,Ve=m.contextType;typeof Ve=="object"&&Ve!==null?Ve=oa(Ve):(Ve=As(m)?jl:Qr.current,Ve=Gc(d,Ve));var ct=m.getDerivedStateFromProps,dt=typeof ct=="function"||typeof z.getSnapshotBeforeUpdate=="function";dt||typeof z.UNSAFE_componentWillReceiveProps!="function"&&typeof z.componentWillReceiveProps!="function"||(de!==x||ye!==Ve)&&yb(d,z,x,Ve),Ei=!1;var lt=d.memoizedState;z.state=lt,p1(d,x,z,M),ye=d.memoizedState,de!==x||lt!==ye||js.current||Ei?(typeof ct=="function"&&(H2(d,m,ct,x),ye=d.memoizedState),(de=Ei||vb(d,m,de,x,lt,ye,Ve))?(dt||typeof z.UNSAFE_componentWillMount!="function"&&typeof z.componentWillMount!="function"||(typeof z.componentWillMount=="function"&&z.componentWillMount(),typeof z.UNSAFE_componentWillMount=="function"&&z.UNSAFE_componentWillMount()),typeof z.componentDidMount=="function"&&(d.flags|=4194308)):(typeof z.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=x,d.memoizedState=ye),z.props=x,z.state=ye,z.context=Ve,x=de):(typeof z.componentDidMount=="function"&&(d.flags|=4194308),x=!1)}else{z=d.stateNode,Wy(c,d),de=d.memoizedProps,Ve=d.type===d.elementType?de:$a(d.type,de),z.props=Ve,dt=d.pendingProps,lt=z.context,ye=m.contextType,typeof ye=="object"&&ye!==null?ye=oa(ye):(ye=As(m)?jl:Qr.current,ye=Gc(d,ye));var $t=m.getDerivedStateFromProps;(ct=typeof $t=="function"||typeof z.getSnapshotBeforeUpdate=="function")||typeof z.UNSAFE_componentWillReceiveProps!="function"&&typeof z.componentWillReceiveProps!="function"||(de!==dt||lt!==ye)&&yb(d,z,x,ye),Ei=!1,lt=d.memoizedState,z.state=lt,p1(d,x,z,M);var Ot=d.memoizedState;de!==dt||lt!==Ot||js.current||Ei?(typeof $t=="function"&&(H2(d,m,$t,x),Ot=d.memoizedState),(Ve=Ei||vb(d,m,Ve,x,lt,Ot,ye)||!1)?(ct||typeof z.UNSAFE_componentWillUpdate!="function"&&typeof z.componentWillUpdate!="function"||(typeof z.componentWillUpdate=="function"&&z.componentWillUpdate(x,Ot,ye),typeof z.UNSAFE_componentWillUpdate=="function"&&z.UNSAFE_componentWillUpdate(x,Ot,ye)),typeof z.componentDidUpdate=="function"&&(d.flags|=4),typeof z.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof z.componentDidUpdate!="function"||de===c.memoizedProps&&lt===c.memoizedState||(d.flags|=4),typeof z.getSnapshotBeforeUpdate!="function"||de===c.memoizedProps&&lt===c.memoizedState||(d.flags|=1024),d.memoizedProps=x,d.memoizedState=Ot),z.props=x,z.state=Ot,z.context=ye,x=Ve):(typeof z.componentDidUpdate!="function"||de===c.memoizedProps&&lt===c.memoizedState||(d.flags|=4),typeof z.getSnapshotBeforeUpdate!="function"||de===c.memoizedProps&&lt===c.memoizedState||(d.flags|=1024),x=!1)}return V2(c,d,m,x,L,M)}function V2(c,d,m,x,M,L){Mb(c,d);var z=(d.flags&128)!==0;if(!x&&!z)return M&&Dy(d,m,!1),Io(c,d,L);x=d.stateNode,XL.current=d;var de=z&&typeof m.getDerivedStateFromError!="function"?null:x.render();return d.flags|=1,c!==null&&z?(d.child=Qc(d,c.child,null,L),d.child=Qc(d,null,de,L)):ds(c,d,de,L),d.memoizedState=x.state,M&&Dy(d,m,!0),d.child}function Pb(c){var d=c.stateNode;d.pendingContext?$y(c,d.pendingContext,d.pendingContext!==d.context):d.context&&$y(c,d.context,!1),E2(c,d.containerInfo)}function Lb(c,d,m,x,M){return Xc(),v2(M),d.flags|=256,ds(c,d,m,x),d.child}var Z2={dehydrated:null,treeContext:null,retryLane:0};function z2(c){return{baseLanes:c,cachePool:null,transitions:null}}function $b(c,d,m){var x=d.pendingProps,M=rr.current,L=!1,z=(d.flags&128)!==0,de;if((de=z)||(de=c!==null&&c.memoizedState===null?!1:(M&2)!==0),de?(L=!0,d.flags&=-129):(c===null||c.memoizedState!==null)&&(M|=1),Gn(rr,M&1),c===null)return g2(d),c=d.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?((d.mode&1)===0?d.lanes=1:c.data==="$!"?d.lanes=8:d.lanes=1073741824,null):(z=x.children,c=x.fallback,L?(x=d.mode,L=d.child,z={mode:"hidden",children:z},(x&1)===0&&L!==null?(L.childLanes=0,L.pendingProps=z):L=D1(z,x,0,null),c=Hl(c,x,m,null),L.return=d,c.return=d,L.sibling=c,d.child=L,d.child.memoizedState=z2(m),d.memoizedState=Z2,c):B2(d,z));if(M=c.memoizedState,M!==null&&(de=M.dehydrated,de!==null))return QL(c,d,z,x,de,M,m);if(L){L=x.fallback,z=d.mode,M=c.child,de=M.sibling;var ye={mode:"hidden",children:x.children};return(z&1)===0&&d.child!==M?(x=d.child,x.childLanes=0,x.pendingProps=ye,d.deletions=null):(x=Pi(M,ye),x.subtreeFlags=M.subtreeFlags&14680064),de!==null?L=Pi(de,L):(L=Hl(L,z,m,null),L.flags|=2),L.return=d,x.return=d,x.sibling=L,d.child=x,x=L,L=d.child,z=c.child.memoizedState,z=z===null?z2(m):{baseLanes:z.baseLanes|m,cachePool:null,transitions:z.transitions},L.memoizedState=z,L.childLanes=c.childLanes&~m,d.memoizedState=Z2,x}return L=c.child,c=L.sibling,x=Pi(L,{mode:"visible",children:x.children}),(d.mode&1)===0&&(x.lanes=m),x.return=d,x.sibling=null,c!==null&&(m=d.deletions,m===null?(d.deletions=[c],d.flags|=16):m.push(c)),d.child=x,d.memoizedState=null,x}function B2(c,d){return d=D1({mode:"visible",children:d},c.mode,0,null),d.return=c,c.child=d}function k1(c,d,m,x){return x!==null&&v2(x),Qc(d,c.child,null,m),c=B2(d,d.pendingProps.children),c.flags|=2,d.memoizedState=null,c}function QL(c,d,m,x,M,L,z){if(m)return d.flags&256?(d.flags&=-257,x=I2(Error(n(422))),k1(c,d,z,x)):d.memoizedState!==null?(d.child=c.child,d.flags|=128,null):(L=x.fallback,M=d.mode,x=D1({mode:"visible",children:x.children},M,0,null),L=Hl(L,M,z,null),L.flags|=2,x.return=d,L.return=d,x.sibling=L,d.child=x,(d.mode&1)!==0&&Qc(d,c.child,null,z),d.child.memoizedState=z2(z),d.memoizedState=Z2,L);if((d.mode&1)===0)return k1(c,d,z,null);if(M.data==="$!"){if(x=M.nextSibling&&M.nextSibling.dataset,x)var de=x.dgst;return x=de,L=Error(n(419)),x=I2(L,x,void 0),k1(c,d,z,x)}if(de=(z&c.childLanes)!==0,Ns||de){if(x=Tr,x!==null){switch(z&-z){case 4:M=2;break;case 16:M=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:M=32;break;case 536870912:M=268435456;break;default:M=0}M=(M&(x.suspendedLanes|z))!==0?0:M,M!==0&&M!==L.retryLane&&(L.retryLane=M,Ho(c,M),Ha(x,c,M,-1))}return og(),x=I2(Error(n(421))),k1(c,d,z,x)}return M.data==="$?"?(d.flags|=128,d.child=c.child,d=d$.bind(null,c),M._reactRetry=d,null):(c=L.treeContext,Bs=bi(M.nextSibling),zs=d,tr=!0,La=null,c!==null&&(sa[aa++]=To,sa[aa++]=Do,sa[aa++]=Al,To=c.id,Do=c.overflow,Al=d),d=B2(d,x.children),d.flags|=4096,d)}function Tb(c,d,m){c.lanes|=d;var x=c.alternate;x!==null&&(x.lanes|=d),x2(c.return,d,m)}function U2(c,d,m,x,M){var L=c.memoizedState;L===null?c.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:x,tail:m,tailMode:M}:(L.isBackwards=d,L.rendering=null,L.renderingStartTime=0,L.last=x,L.tail=m,L.tailMode=M)}function Db(c,d,m){var x=d.pendingProps,M=x.revealOrder,L=x.tail;if(ds(c,d,x.children,m),x=rr.current,(x&2)!==0)x=x&1|2,d.flags|=128;else{if(c!==null&&(c.flags&128)!==0)e:for(c=d.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&Tb(c,m,d);else if(c.tag===19)Tb(c,m,d);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===d)break e;for(;c.sibling===null;){if(c.return===null||c.return===d)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}x&=1}if(Gn(rr,x),(d.mode&1)===0)d.memoizedState=null;else switch(M){case"forwards":for(m=d.child,M=null;m!==null;)c=m.alternate,c!==null&&m1(c)===null&&(M=m),m=m.sibling;m=M,m===null?(M=d.child,d.child=null):(M=m.sibling,m.sibling=null),U2(d,!1,M,m,L);break;case"backwards":for(m=null,M=d.child,d.child=null;M!==null;){if(c=M.alternate,c!==null&&m1(c)===null){d.child=M;break}c=M.sibling,M.sibling=m,m=M,M=c}U2(d,!0,m,null,L);break;case"together":U2(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function S1(c,d){(d.mode&1)===0&&c!==null&&(c.alternate=null,d.alternate=null,d.flags|=2)}function Io(c,d,m){if(c!==null&&(d.dependencies=c.dependencies),Ll|=d.lanes,(m&d.childLanes)===0)return null;if(c!==null&&d.child!==c.child)throw Error(n(153));if(d.child!==null){for(c=d.child,m=Pi(c,c.pendingProps),d.child=m,m.return=d;c.sibling!==null;)c=c.sibling,m=m.sibling=Pi(c,c.pendingProps),m.return=d;m.sibling=null}return d.child}function JL(c,d,m){switch(d.tag){case 3:Pb(d),Xc();break;case 5:Yy(d);break;case 1:As(d.type)&&a1(d);break;case 4:E2(d,d.stateNode.containerInfo);break;case 10:var x=d.type._context,M=d.memoizedProps.value;Gn(d1,x._currentValue),x._currentValue=M;break;case 13:if(x=d.memoizedState,x!==null)return x.dehydrated!==null?(Gn(rr,rr.current&1),d.flags|=128,null):(m&d.child.childLanes)!==0?$b(c,d,m):(Gn(rr,rr.current&1),c=Io(c,d,m),c!==null?c.sibling:null);Gn(rr,rr.current&1);break;case 19:if(x=(m&d.childLanes)!==0,(c.flags&128)!==0){if(x)return Db(c,d,m);d.flags|=128}if(M=d.memoizedState,M!==null&&(M.rendering=null,M.tail=null,M.lastEffect=null),Gn(rr,rr.current),x)break;return null;case 22:case 23:return d.lanes=0,Nb(c,d,m)}return Io(c,d,m)}var Hb,W2,Ob,Ib;Hb=function(c,d){for(var m=d.child;m!==null;){if(m.tag===5||m.tag===6)c.appendChild(m.stateNode);else if(m.tag!==4&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===d)break;for(;m.sibling===null;){if(m.return===null||m.return===d)return;m=m.return}m.sibling.return=m.return,m=m.sibling}},W2=function(){},Ob=function(c,d,m,x){var M=c.memoizedProps;if(M!==x){c=d.stateNode,Rl(no.current);var L=null;switch(m){case"input":M=Fe(c,M),x=Fe(c,x),L=[];break;case"select":M=Z({},M,{value:void 0}),x=Z({},x,{value:void 0}),L=[];break;case"textarea":M=Ze(c,M),x=Ze(c,x),L=[];break;default:typeof M.onClick!="function"&&typeof x.onClick=="function"&&(c.onclick=n1)}Zt(m,x);var z;m=null;for(Ve in M)if(!x.hasOwnProperty(Ve)&&M.hasOwnProperty(Ve)&&M[Ve]!=null)if(Ve==="style"){var de=M[Ve];for(z in de)de.hasOwnProperty(z)&&(m||(m={}),m[z]="")}else Ve!=="dangerouslySetInnerHTML"&&Ve!=="children"&&Ve!=="suppressContentEditableWarning"&&Ve!=="suppressHydrationWarning"&&Ve!=="autoFocus"&&(a.hasOwnProperty(Ve)?L||(L=[]):(L=L||[]).push(Ve,null));for(Ve in x){var ye=x[Ve];if(de=M!=null?M[Ve]:void 0,x.hasOwnProperty(Ve)&&ye!==de&&(ye!=null||de!=null))if(Ve==="style")if(de){for(z in de)!de.hasOwnProperty(z)||ye&&ye.hasOwnProperty(z)||(m||(m={}),m[z]="");for(z in ye)ye.hasOwnProperty(z)&&de[z]!==ye[z]&&(m||(m={}),m[z]=ye[z])}else m||(L||(L=[]),L.push(Ve,m)),m=ye;else Ve==="dangerouslySetInnerHTML"?(ye=ye?ye.__html:void 0,de=de?de.__html:void 0,ye!=null&&de!==ye&&(L=L||[]).push(Ve,ye)):Ve==="children"?typeof ye!="string"&&typeof ye!="number"||(L=L||[]).push(Ve,""+ye):Ve!=="suppressContentEditableWarning"&&Ve!=="suppressHydrationWarning"&&(a.hasOwnProperty(Ve)?(ye!=null&&Ve==="onScroll"&&Xn("scroll",c),L||de===ye||(L=[])):(L=L||[]).push(Ve,ye))}m&&(L=L||[]).push("style",m);var Ve=L;(d.updateQueue=Ve)&&(d.flags|=4)}},Ib=function(c,d,m,x){m!==x&&(d.flags|=4)};function Ud(c,d){if(!tr)switch(c.tailMode){case"hidden":d=c.tail;for(var m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?c.tail=null:m.sibling=null;break;case"collapsed":m=c.tail;for(var x=null;m!==null;)m.alternate!==null&&(x=m),m=m.sibling;x===null?d||c.tail===null?c.tail=null:c.tail.sibling=null:x.sibling=null}}function es(c){var d=c.alternate!==null&&c.alternate.child===c.child,m=0,x=0;if(d)for(var M=c.child;M!==null;)m|=M.lanes|M.childLanes,x|=M.subtreeFlags&14680064,x|=M.flags&14680064,M.return=c,M=M.sibling;else for(M=c.child;M!==null;)m|=M.lanes|M.childLanes,x|=M.subtreeFlags,x|=M.flags,M.return=c,M=M.sibling;return c.subtreeFlags|=x,c.childLanes=m,d}function e$(c,d,m){var x=d.pendingProps;switch(p2(d),d.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return es(d),null;case 1:return As(d.type)&&s1(),es(d),null;case 3:return x=d.stateNode,tu(),Qn(js),Qn(Qr),A2(),x.pendingContext&&(x.context=x.pendingContext,x.pendingContext=null),(c===null||c.child===null)&&(c1(d)?d.flags|=4:c===null||c.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,La!==null&&(rg(La),La=null))),W2(c,d),es(d),null;case 5:C2(d);var M=Rl(_d.current);if(m=d.type,c!==null&&d.stateNode!=null)Ob(c,d,m,x,M),c.ref!==d.ref&&(d.flags|=512,d.flags|=2097152);else{if(!x){if(d.stateNode===null)throw Error(n(166));return es(d),null}if(c=Rl(no.current),c1(d)){x=d.stateNode,m=d.type;var L=d.memoizedProps;switch(x[to]=d,x[Dd]=L,c=(d.mode&1)!==0,m){case"dialog":Xn("cancel",x),Xn("close",x);break;case"iframe":case"object":case"embed":Xn("load",x);break;case"video":case"audio":for(M=0;M<Ld.length;M++)Xn(Ld[M],x);break;case"source":Xn("error",x);break;case"img":case"image":case"link":Xn("error",x),Xn("load",x);break;case"details":Xn("toggle",x);break;case"input":Oe(x,L),Xn("invalid",x);break;case"select":x._wrapperState={wasMultiple:!!L.multiple},Xn("invalid",x);break;case"textarea":Ye(x,L),Xn("invalid",x)}Zt(m,L),M=null;for(var z in L)if(L.hasOwnProperty(z)){var de=L[z];z==="children"?typeof de=="string"?x.textContent!==de&&(L.suppressHydrationWarning!==!0&&t1(x.textContent,de,c),M=["children",de]):typeof de=="number"&&x.textContent!==""+de&&(L.suppressHydrationWarning!==!0&&t1(x.textContent,de,c),M=["children",""+de]):a.hasOwnProperty(z)&&de!=null&&z==="onScroll"&&Xn("scroll",x)}switch(m){case"input":ue(x),X(x,L,!0);break;case"textarea":ue(x),te(x);break;case"select":case"option":break;default:typeof L.onClick=="function"&&(x.onclick=n1)}x=M,d.updateQueue=x,x!==null&&(d.flags|=4)}else{z=M.nodeType===9?M:M.ownerDocument,c==="http://www.w3.org/1999/xhtml"&&(c=le(m)),c==="http://www.w3.org/1999/xhtml"?m==="script"?(c=z.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild)):typeof x.is=="string"?c=z.createElement(m,{is:x.is}):(c=z.createElement(m),m==="select"&&(z=c,x.multiple?z.multiple=!0:x.size&&(z.size=x.size))):c=z.createElementNS(c,m),c[to]=d,c[Dd]=x,Hb(c,d,!1,!1),d.stateNode=c;e:{switch(z=He(m,x),m){case"dialog":Xn("cancel",c),Xn("close",c),M=x;break;case"iframe":case"object":case"embed":Xn("load",c),M=x;break;case"video":case"audio":for(M=0;M<Ld.length;M++)Xn(Ld[M],c);M=x;break;case"source":Xn("error",c),M=x;break;case"img":case"image":case"link":Xn("error",c),Xn("load",c),M=x;break;case"details":Xn("toggle",c),M=x;break;case"input":Oe(c,x),M=Fe(c,x),Xn("invalid",c);break;case"option":M=x;break;case"select":c._wrapperState={wasMultiple:!!x.multiple},M=Z({},x,{value:void 0}),Xn("invalid",c);break;case"textarea":Ye(c,x),M=Ze(c,x),Xn("invalid",c);break;default:M=x}Zt(m,M),de=M;for(L in de)if(de.hasOwnProperty(L)){var ye=de[L];L==="style"?zt(c,ye):L==="dangerouslySetInnerHTML"?(ye=ye?ye.__html:void 0,ye!=null&&Re(c,ye)):L==="children"?typeof ye=="string"?(m!=="textarea"||ye!=="")&&Be(c,ye):typeof ye=="number"&&Be(c,""+ye):L!=="suppressContentEditableWarning"&&L!=="suppressHydrationWarning"&&L!=="autoFocus"&&(a.hasOwnProperty(L)?ye!=null&&L==="onScroll"&&Xn("scroll",c):ye!=null&&j(c,L,ye,z))}switch(m){case"input":ue(c),X(c,x,!1);break;case"textarea":ue(c),te(c);break;case"option":x.value!=null&&c.setAttribute("value",""+ce(x.value));break;case"select":c.multiple=!!x.multiple,L=x.value,L!=null?ve(c,!!x.multiple,L,!1):x.defaultValue!=null&&ve(c,!!x.multiple,x.defaultValue,!0);break;default:typeof M.onClick=="function"&&(c.onclick=n1)}switch(m){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}}x&&(d.flags|=4)}d.ref!==null&&(d.flags|=512,d.flags|=2097152)}return es(d),null;case 6:if(c&&d.stateNode!=null)Ib(c,d,c.memoizedProps,x);else{if(typeof x!="string"&&d.stateNode===null)throw Error(n(166));if(m=Rl(_d.current),Rl(no.current),c1(d)){if(x=d.stateNode,m=d.memoizedProps,x[to]=d,(L=x.nodeValue!==m)&&(c=zs,c!==null))switch(c.tag){case 3:t1(x.nodeValue,m,(c.mode&1)!==0);break;case 5:c.memoizedProps.suppressHydrationWarning!==!0&&t1(x.nodeValue,m,(c.mode&1)!==0)}L&&(d.flags|=4)}else x=(m.nodeType===9?m:m.ownerDocument).createTextNode(x),x[to]=d,d.stateNode=x}return es(d),null;case 13:if(Qn(rr),x=d.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(tr&&Bs!==null&&(d.mode&1)!==0&&(d.flags&128)===0)Vy(),Xc(),d.flags|=98560,L=!1;else if(L=c1(d),x!==null&&x.dehydrated!==null){if(c===null){if(!L)throw Error(n(318));if(L=d.memoizedState,L=L!==null?L.dehydrated:null,!L)throw Error(n(317));L[to]=d}else Xc(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;es(d),L=!1}else La!==null&&(rg(La),La=null),L=!0;if(!L)return d.flags&65536?d:null}return(d.flags&128)!==0?(d.lanes=m,d):(x=x!==null,x!==(c!==null&&c.memoizedState!==null)&&x&&(d.child.flags|=8192,(d.mode&1)!==0&&(c===null||(rr.current&1)!==0?jr===0&&(jr=3):og())),d.updateQueue!==null&&(d.flags|=4),es(d),null);case 4:return tu(),W2(c,d),c===null&&$d(d.stateNode.containerInfo),es(d),null;case 10:return b2(d.type._context),es(d),null;case 17:return As(d.type)&&s1(),es(d),null;case 19:if(Qn(rr),L=d.memoizedState,L===null)return es(d),null;if(x=(d.flags&128)!==0,z=L.rendering,z===null)if(x)Ud(L,!1);else{if(jr!==0||c!==null&&(c.flags&128)!==0)for(c=d.child;c!==null;){if(z=m1(c),z!==null){for(d.flags|=128,Ud(L,!1),x=z.updateQueue,x!==null&&(d.updateQueue=x,d.flags|=4),d.subtreeFlags=0,x=m,m=d.child;m!==null;)L=m,c=x,L.flags&=14680066,z=L.alternate,z===null?(L.childLanes=0,L.lanes=c,L.child=null,L.subtreeFlags=0,L.memoizedProps=null,L.memoizedState=null,L.updateQueue=null,L.dependencies=null,L.stateNode=null):(L.childLanes=z.childLanes,L.lanes=z.lanes,L.child=z.child,L.subtreeFlags=0,L.deletions=null,L.memoizedProps=z.memoizedProps,L.memoizedState=z.memoizedState,L.updateQueue=z.updateQueue,L.type=z.type,c=z.dependencies,L.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),m=m.sibling;return Gn(rr,rr.current&1|2),d.child}c=c.sibling}L.tail!==null&&st()>au&&(d.flags|=128,x=!0,Ud(L,!1),d.lanes=4194304)}else{if(!x)if(c=m1(z),c!==null){if(d.flags|=128,x=!0,m=c.updateQueue,m!==null&&(d.updateQueue=m,d.flags|=4),Ud(L,!0),L.tail===null&&L.tailMode==="hidden"&&!z.alternate&&!tr)return es(d),null}else 2*st()-L.renderingStartTime>au&&m!==1073741824&&(d.flags|=128,x=!0,Ud(L,!1),d.lanes=4194304);L.isBackwards?(z.sibling=d.child,d.child=z):(m=L.last,m!==null?m.sibling=z:d.child=z,L.last=z)}return L.tail!==null?(d=L.tail,L.rendering=d,L.tail=d.sibling,L.renderingStartTime=st(),d.sibling=null,m=rr.current,Gn(rr,x?m&1|2:m&1),d):(es(d),null);case 22:case 23:return ag(),x=d.memoizedState!==null,c!==null&&c.memoizedState!==null!==x&&(d.flags|=8192),x&&(d.mode&1)!==0?(Us&1073741824)!==0&&(es(d),d.subtreeFlags&6&&(d.flags|=8192)):es(d),null;case 24:return null;case 25:return null}throw Error(n(156,d.tag))}function t$(c,d){switch(p2(d),d.tag){case 1:return As(d.type)&&s1(),c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 3:return tu(),Qn(js),Qn(Qr),A2(),c=d.flags,(c&65536)!==0&&(c&128)===0?(d.flags=c&-65537|128,d):null;case 5:return C2(d),null;case 13:if(Qn(rr),c=d.memoizedState,c!==null&&c.dehydrated!==null){if(d.alternate===null)throw Error(n(340));Xc()}return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 19:return Qn(rr),null;case 4:return tu(),null;case 10:return b2(d.type._context),null;case 22:case 23:return ag(),null;case 24:return null;default:return null}}var E1=!1,ts=!1,n$=typeof WeakSet=="function"?WeakSet:Set,Ht=null;function ru(c,d){var m=c.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(x){dr(c,d,x)}else m.current=null}function K2(c,d,m){try{m()}catch(x){dr(c,d,x)}}var Fb=!1;function r$(c,d){if(a2=Tn,c=vy(),Xm(c)){if("selectionStart"in c)var m={start:c.selectionStart,end:c.selectionEnd};else e:{m=(m=c.ownerDocument)&&m.defaultView||window;var x=m.getSelection&&m.getSelection();if(x&&x.rangeCount!==0){m=x.anchorNode;var M=x.anchorOffset,L=x.focusNode;x=x.focusOffset;try{m.nodeType,L.nodeType}catch{m=null;break e}var z=0,de=-1,ye=-1,Ve=0,ct=0,dt=c,lt=null;t:for(;;){for(var $t;dt!==m||M!==0&&dt.nodeType!==3||(de=z+M),dt!==L||x!==0&&dt.nodeType!==3||(ye=z+x),dt.nodeType===3&&(z+=dt.nodeValue.length),($t=dt.firstChild)!==null;)lt=dt,dt=$t;for(;;){if(dt===c)break t;if(lt===m&&++Ve===M&&(de=z),lt===L&&++ct===x&&(ye=z),($t=dt.nextSibling)!==null)break;dt=lt,lt=dt.parentNode}dt=$t}m=de===-1||ye===-1?null:{start:de,end:ye}}else m=null}m=m||{start:0,end:0}}else m=null;for(o2={focusedElem:c,selectionRange:m},Tn=!1,Ht=d;Ht!==null;)if(d=Ht,c=d.child,(d.subtreeFlags&1028)!==0&&c!==null)c.return=d,Ht=c;else for(;Ht!==null;){d=Ht;try{var Ot=d.alternate;if((d.flags&1024)!==0)switch(d.tag){case 0:case 11:case 15:break;case 1:if(Ot!==null){var It=Ot.memoizedProps,hr=Ot.memoizedState,Le=d.stateNode,Ee=Le.getSnapshotBeforeUpdate(d.elementType===d.type?It:$a(d.type,It),hr);Le.__reactInternalSnapshotBeforeUpdate=Ee}break;case 3:var Ie=d.stateNode.containerInfo;Ie.nodeType===1?Ie.textContent="":Ie.nodeType===9&&Ie.documentElement&&Ie.removeChild(Ie.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(bt){dr(d,d.return,bt)}if(c=d.sibling,c!==null){c.return=d.return,Ht=c;break}Ht=d.return}return Ot=Fb,Fb=!1,Ot}function Wd(c,d,m){var x=d.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var M=x=x.next;do{if((M.tag&c)===c){var L=M.destroy;M.destroy=void 0,L!==void 0&&K2(d,m,L)}M=M.next}while(M!==x)}}function C1(c,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var m=d=d.next;do{if((m.tag&c)===c){var x=m.create;m.destroy=x()}m=m.next}while(m!==d)}}function G2(c){var d=c.ref;if(d!==null){var m=c.stateNode;switch(c.tag){case 5:c=m;break;default:c=m}typeof d=="function"?d(c):d.current=c}}function _b(c){var d=c.alternate;d!==null&&(c.alternate=null,_b(d)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(d=c.stateNode,d!==null&&(delete d[to],delete d[Dd],delete d[u2],delete d[FL],delete d[_L])),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function Vb(c){return c.tag===5||c.tag===3||c.tag===4}function Zb(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||Vb(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function Y2(c,d,m){var x=c.tag;if(x===5||x===6)c=c.stateNode,d?m.nodeType===8?m.parentNode.insertBefore(c,d):m.insertBefore(c,d):(m.nodeType===8?(d=m.parentNode,d.insertBefore(c,m)):(d=m,d.appendChild(c)),m=m._reactRootContainer,m!=null||d.onclick!==null||(d.onclick=n1));else if(x!==4&&(c=c.child,c!==null))for(Y2(c,d,m),c=c.sibling;c!==null;)Y2(c,d,m),c=c.sibling}function q2(c,d,m){var x=c.tag;if(x===5||x===6)c=c.stateNode,d?m.insertBefore(c,d):m.appendChild(c);else if(x!==4&&(c=c.child,c!==null))for(q2(c,d,m),c=c.sibling;c!==null;)q2(c,d,m),c=c.sibling}var Ur=null,Ta=!1;function ji(c,d,m){for(m=m.child;m!==null;)zb(c,d,m),m=m.sibling}function zb(c,d,m){if(W&&typeof W.onCommitFiberUnmount=="function")try{W.onCommitFiberUnmount(Tt,m)}catch{}switch(m.tag){case 5:ts||ru(m,d);case 6:var x=Ur,M=Ta;Ur=null,ji(c,d,m),Ur=x,Ta=M,Ur!==null&&(Ta?(c=Ur,m=m.stateNode,c.nodeType===8?c.parentNode.removeChild(m):c.removeChild(m)):Ur.removeChild(m.stateNode));break;case 18:Ur!==null&&(Ta?(c=Ur,m=m.stateNode,c.nodeType===8?c2(c.parentNode,m):c.nodeType===1&&c2(c,m),$n(c)):c2(Ur,m.stateNode));break;case 4:x=Ur,M=Ta,Ur=m.stateNode.containerInfo,Ta=!0,ji(c,d,m),Ur=x,Ta=M;break;case 0:case 11:case 14:case 15:if(!ts&&(x=m.updateQueue,x!==null&&(x=x.lastEffect,x!==null))){M=x=x.next;do{var L=M,z=L.destroy;L=L.tag,z!==void 0&&((L&2)!==0||(L&4)!==0)&&K2(m,d,z),M=M.next}while(M!==x)}ji(c,d,m);break;case 1:if(!ts&&(ru(m,d),x=m.stateNode,typeof x.componentWillUnmount=="function"))try{x.props=m.memoizedProps,x.state=m.memoizedState,x.componentWillUnmount()}catch(de){dr(m,d,de)}ji(c,d,m);break;case 21:ji(c,d,m);break;case 22:m.mode&1?(ts=(x=ts)||m.memoizedState!==null,ji(c,d,m),ts=x):ji(c,d,m);break;default:ji(c,d,m)}}function Bb(c){var d=c.updateQueue;if(d!==null){c.updateQueue=null;var m=c.stateNode;m===null&&(m=c.stateNode=new n$),d.forEach(function(x){var M=f$.bind(null,c,x);m.has(x)||(m.add(x),x.then(M,M))})}}function Da(c,d){var m=d.deletions;if(m!==null)for(var x=0;x<m.length;x++){var M=m[x];try{var L=c,z=d,de=z;e:for(;de!==null;){switch(de.tag){case 5:Ur=de.stateNode,Ta=!1;break e;case 3:Ur=de.stateNode.containerInfo,Ta=!0;break e;case 4:Ur=de.stateNode.containerInfo,Ta=!0;break e}de=de.return}if(Ur===null)throw Error(n(160));zb(L,z,M),Ur=null,Ta=!1;var ye=M.alternate;ye!==null&&(ye.return=null),M.return=null}catch(Ve){dr(M,d,Ve)}}if(d.subtreeFlags&12854)for(d=d.child;d!==null;)Ub(d,c),d=d.sibling}function Ub(c,d){var m=c.alternate,x=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:if(Da(d,c),so(c),x&4){try{Wd(3,c,c.return),C1(3,c)}catch(It){dr(c,c.return,It)}try{Wd(5,c,c.return)}catch(It){dr(c,c.return,It)}}break;case 1:Da(d,c),so(c),x&512&&m!==null&&ru(m,m.return);break;case 5:if(Da(d,c),so(c),x&512&&m!==null&&ru(m,m.return),c.flags&32){var M=c.stateNode;try{Be(M,"")}catch(It){dr(c,c.return,It)}}if(x&4&&(M=c.stateNode,M!=null)){var L=c.memoizedProps,z=m!==null?m.memoizedProps:L,de=c.type,ye=c.updateQueue;if(c.updateQueue=null,ye!==null)try{de==="input"&&L.type==="radio"&&L.name!=null&&ot(M,L),He(de,z);var Ve=He(de,L);for(z=0;z<ye.length;z+=2){var ct=ye[z],dt=ye[z+1];ct==="style"?zt(M,dt):ct==="dangerouslySetInnerHTML"?Re(M,dt):ct==="children"?Be(M,dt):j(M,ct,dt,Ve)}switch(de){case"input":Xe(M,L);break;case"textarea":ke(M,L);break;case"select":var lt=M._wrapperState.wasMultiple;M._wrapperState.wasMultiple=!!L.multiple;var $t=L.value;$t!=null?ve(M,!!L.multiple,$t,!1):lt!==!!L.multiple&&(L.defaultValue!=null?ve(M,!!L.multiple,L.defaultValue,!0):ve(M,!!L.multiple,L.multiple?[]:"",!1))}M[Dd]=L}catch(It){dr(c,c.return,It)}}break;case 6:if(Da(d,c),so(c),x&4){if(c.stateNode===null)throw Error(n(162));M=c.stateNode,L=c.memoizedProps;try{M.nodeValue=L}catch(It){dr(c,c.return,It)}}break;case 3:if(Da(d,c),so(c),x&4&&m!==null&&m.memoizedState.isDehydrated)try{$n(d.containerInfo)}catch(It){dr(c,c.return,It)}break;case 4:Da(d,c),so(c);break;case 13:Da(d,c),so(c),M=c.child,M.flags&8192&&(L=M.memoizedState!==null,M.stateNode.isHidden=L,!L||M.alternate!==null&&M.alternate.memoizedState!==null||(J2=st())),x&4&&Bb(c);break;case 22:if(ct=m!==null&&m.memoizedState!==null,c.mode&1?(ts=(Ve=ts)||ct,Da(d,c),ts=Ve):Da(d,c),so(c),x&8192){if(Ve=c.memoizedState!==null,(c.stateNode.isHidden=Ve)&&!ct&&(c.mode&1)!==0)for(Ht=c,ct=c.child;ct!==null;){for(dt=Ht=ct;Ht!==null;){switch(lt=Ht,$t=lt.child,lt.tag){case 0:case 11:case 14:case 15:Wd(4,lt,lt.return);break;case 1:ru(lt,lt.return);var Ot=lt.stateNode;if(typeof Ot.componentWillUnmount=="function"){x=lt,m=lt.return;try{d=x,Ot.props=d.memoizedProps,Ot.state=d.memoizedState,Ot.componentWillUnmount()}catch(It){dr(x,m,It)}}break;case 5:ru(lt,lt.return);break;case 22:if(lt.memoizedState!==null){Gb(dt);continue}}$t!==null?($t.return=lt,Ht=$t):Gb(dt)}ct=ct.sibling}e:for(ct=null,dt=c;;){if(dt.tag===5){if(ct===null){ct=dt;try{M=dt.stateNode,Ve?(L=M.style,typeof L.setProperty=="function"?L.setProperty("display","none","important"):L.display="none"):(de=dt.stateNode,ye=dt.memoizedProps.style,z=ye!=null&&ye.hasOwnProperty("display")?ye.display:null,de.style.display=_e("display",z))}catch(It){dr(c,c.return,It)}}}else if(dt.tag===6){if(ct===null)try{dt.stateNode.nodeValue=Ve?"":dt.memoizedProps}catch(It){dr(c,c.return,It)}}else if((dt.tag!==22&&dt.tag!==23||dt.memoizedState===null||dt===c)&&dt.child!==null){dt.child.return=dt,dt=dt.child;continue}if(dt===c)break e;for(;dt.sibling===null;){if(dt.return===null||dt.return===c)break e;ct===dt&&(ct=null),dt=dt.return}ct===dt&&(ct=null),dt.sibling.return=dt.return,dt=dt.sibling}}break;case 19:Da(d,c),so(c),x&4&&Bb(c);break;case 21:break;default:Da(d,c),so(c)}}function so(c){var d=c.flags;if(d&2){try{e:{for(var m=c.return;m!==null;){if(Vb(m)){var x=m;break e}m=m.return}throw Error(n(160))}switch(x.tag){case 5:var M=x.stateNode;x.flags&32&&(Be(M,""),x.flags&=-33);var L=Zb(c);q2(c,L,M);break;case 3:case 4:var z=x.stateNode.containerInfo,de=Zb(c);Y2(c,de,z);break;default:throw Error(n(161))}}catch(ye){dr(c,c.return,ye)}c.flags&=-3}d&4096&&(c.flags&=-4097)}function s$(c,d,m){Ht=c,Wb(c)}function Wb(c,d,m){for(var x=(c.mode&1)!==0;Ht!==null;){var M=Ht,L=M.child;if(M.tag===22&&x){var z=M.memoizedState!==null||E1;if(!z){var de=M.alternate,ye=de!==null&&de.memoizedState!==null||ts;de=E1;var Ve=ts;if(E1=z,(ts=ye)&&!Ve)for(Ht=M;Ht!==null;)z=Ht,ye=z.child,z.tag===22&&z.memoizedState!==null?Yb(M):ye!==null?(ye.return=z,Ht=ye):Yb(M);for(;L!==null;)Ht=L,Wb(L),L=L.sibling;Ht=M,E1=de,ts=Ve}Kb(c)}else(M.subtreeFlags&8772)!==0&&L!==null?(L.return=M,Ht=L):Kb(c)}}function Kb(c){for(;Ht!==null;){var d=Ht;if((d.flags&8772)!==0){var m=d.alternate;try{if((d.flags&8772)!==0)switch(d.tag){case 0:case 11:case 15:ts||C1(5,d);break;case 1:var x=d.stateNode;if(d.flags&4&&!ts)if(m===null)x.componentDidMount();else{var M=d.elementType===d.type?m.memoizedProps:$a(d.type,m.memoizedProps);x.componentDidUpdate(M,m.memoizedState,x.__reactInternalSnapshotBeforeUpdate)}var L=d.updateQueue;L!==null&&Gy(d,L,x);break;case 3:var z=d.updateQueue;if(z!==null){if(m=null,d.child!==null)switch(d.child.tag){case 5:m=d.child.stateNode;break;case 1:m=d.child.stateNode}Gy(d,z,m)}break;case 5:var de=d.stateNode;if(m===null&&d.flags&4){m=de;var ye=d.memoizedProps;switch(d.type){case"button":case"input":case"select":case"textarea":ye.autoFocus&&m.focus();break;case"img":ye.src&&(m.src=ye.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(d.memoizedState===null){var Ve=d.alternate;if(Ve!==null){var ct=Ve.memoizedState;if(ct!==null){var dt=ct.dehydrated;dt!==null&&$n(dt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}ts||d.flags&512&&G2(d)}catch(lt){dr(d,d.return,lt)}}if(d===c){Ht=null;break}if(m=d.sibling,m!==null){m.return=d.return,Ht=m;break}Ht=d.return}}function Gb(c){for(;Ht!==null;){var d=Ht;if(d===c){Ht=null;break}var m=d.sibling;if(m!==null){m.return=d.return,Ht=m;break}Ht=d.return}}function Yb(c){for(;Ht!==null;){var d=Ht;try{switch(d.tag){case 0:case 11:case 15:var m=d.return;try{C1(4,d)}catch(ye){dr(d,m,ye)}break;case 1:var x=d.stateNode;if(typeof x.componentDidMount=="function"){var M=d.return;try{x.componentDidMount()}catch(ye){dr(d,M,ye)}}var L=d.return;try{G2(d)}catch(ye){dr(d,L,ye)}break;case 5:var z=d.return;try{G2(d)}catch(ye){dr(d,z,ye)}}}catch(ye){dr(d,d.return,ye)}if(d===c){Ht=null;break}var de=d.sibling;if(de!==null){de.return=d.return,Ht=de;break}Ht=d.return}}var a$=Math.ceil,j1=N.ReactCurrentDispatcher,X2=N.ReactCurrentOwner,la=N.ReactCurrentBatchConfig,Ln=0,Tr=null,mr=null,Wr=0,Us=0,su=xi(0),jr=0,Kd=null,Ll=0,A1=0,Q2=0,Gd=null,Ms=null,J2=0,au=1/0,Fo=null,N1=!1,eg=null,Ai=null,M1=!1,Ni=null,R1=0,Yd=0,tg=null,P1=-1,L1=0;function fs(){return(Ln&6)!==0?st():P1!==-1?P1:P1=st()}function Mi(c){return(c.mode&1)===0?1:(Ln&2)!==0&&Wr!==0?Wr&-Wr:ZL.transition!==null?(L1===0&&(L1=Nn()),L1):(c=kn,c!==0||(c=window.event,c=c===void 0?16:Fc(c.type)),c)}function Ha(c,d,m,x){if(50<Yd)throw Yd=0,tg=null,Error(n(185));Jt(c,m,x),((Ln&2)===0||c!==Tr)&&(c===Tr&&((Ln&2)===0&&(A1|=m),jr===4&&Ri(c,Wr)),Rs(c,x),m===1&&Ln===0&&(d.mode&1)===0&&(au=st()+500,o1&&Si()))}function Rs(c,d){var m=c.callbackNode;Ut(c,d);var x=Zn(c,c===Tr?Wr:0);if(x===0)m!==null&&Pe(m),c.callbackNode=null,c.callbackPriority=0;else if(d=x&-x,c.callbackPriority!==d){if(m!=null&&Pe(m),d===1)c.tag===0?VL(Xb.bind(null,c)):Hy(Xb.bind(null,c)),OL(function(){(Ln&6)===0&&Si()}),m=null;else{switch(Vs(x)){case 1:m=mn;break;case 4:m=$e;break;case 16:m=Ae;break;case 536870912:m=Ge;break;default:m=Ae}m=ax(m,qb.bind(null,c))}c.callbackPriority=d,c.callbackNode=m}}function qb(c,d){if(P1=-1,L1=0,(Ln&6)!==0)throw Error(n(327));var m=c.callbackNode;if(ou()&&c.callbackNode!==m)return null;var x=Zn(c,c===Tr?Wr:0);if(x===0)return null;if((x&30)!==0||(x&c.expiredLanes)!==0||d)d=$1(c,x);else{d=x;var M=Ln;Ln|=2;var L=Jb();(Tr!==c||Wr!==d)&&(Fo=null,au=st()+500,Tl(c,d));do try{l$();break}catch(de){Qb(c,de)}while(!0);y2(),j1.current=L,Ln=M,mr!==null?d=0:(Tr=null,Wr=0,d=jr)}if(d!==0){if(d===2&&(M=pr(c),M!==0&&(x=M,d=ng(c,M))),d===1)throw m=Kd,Tl(c,0),Ri(c,x),Rs(c,st()),m;if(d===6)Ri(c,x);else{if(M=c.current.alternate,(x&30)===0&&!o$(M)&&(d=$1(c,x),d===2&&(L=pr(c),L!==0&&(x=L,d=ng(c,L))),d===1))throw m=Kd,Tl(c,0),Ri(c,x),Rs(c,st()),m;switch(c.finishedWork=M,c.finishedLanes=x,d){case 0:case 1:throw Error(n(345));case 2:Dl(c,Ms,Fo);break;case 3:if(Ri(c,x),(x&130023424)===x&&(d=J2+500-st(),10<d)){if(Zn(c,0)!==0)break;if(M=c.suspendedLanes,(M&x)!==x){fs(),c.pingedLanes|=c.suspendedLanes&M;break}c.timeoutHandle=l2(Dl.bind(null,c,Ms,Fo),d);break}Dl(c,Ms,Fo);break;case 4:if(Ri(c,x),(x&4194240)===x)break;for(d=c.eventTimes,M=-1;0<x;){var z=31-pe(x);L=1<<z,z=d[z],z>M&&(M=z),x&=~L}if(x=M,x=st()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*a$(x/1960))-x,10<x){c.timeoutHandle=l2(Dl.bind(null,c,Ms,Fo),x);break}Dl(c,Ms,Fo);break;case 5:Dl(c,Ms,Fo);break;default:throw Error(n(329))}}}return Rs(c,st()),c.callbackNode===m?qb.bind(null,c):null}function ng(c,d){var m=Gd;return c.current.memoizedState.isDehydrated&&(Tl(c,d).flags|=256),c=$1(c,d),c!==2&&(d=Ms,Ms=m,d!==null&&rg(d)),c}function rg(c){Ms===null?Ms=c:Ms.push.apply(Ms,c)}function o$(c){for(var d=c;;){if(d.flags&16384){var m=d.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var x=0;x<m.length;x++){var M=m[x],L=M.getSnapshot;M=M.value;try{if(!Pa(L(),M))return!1}catch{return!1}}}if(m=d.child,d.subtreeFlags&16384&&m!==null)m.return=d,d=m;else{if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Ri(c,d){for(d&=~Q2,d&=~A1,c.suspendedLanes|=d,c.pingedLanes&=~d,c=c.expirationTimes;0<d;){var m=31-pe(d),x=1<<m;c[m]=-1,d&=~x}}function Xb(c){if((Ln&6)!==0)throw Error(n(327));ou();var d=Zn(c,0);if((d&1)===0)return Rs(c,st()),null;var m=$1(c,d);if(c.tag!==0&&m===2){var x=pr(c);x!==0&&(d=x,m=ng(c,x))}if(m===1)throw m=Kd,Tl(c,0),Ri(c,d),Rs(c,st()),m;if(m===6)throw Error(n(345));return c.finishedWork=c.current.alternate,c.finishedLanes=d,Dl(c,Ms,Fo),Rs(c,st()),null}function sg(c,d){var m=Ln;Ln|=1;try{return c(d)}finally{Ln=m,Ln===0&&(au=st()+500,o1&&Si())}}function $l(c){Ni!==null&&Ni.tag===0&&(Ln&6)===0&&ou();var d=Ln;Ln|=1;var m=la.transition,x=kn;try{if(la.transition=null,kn=1,c)return c()}finally{kn=x,la.transition=m,Ln=d,(Ln&6)===0&&Si()}}function ag(){Us=su.current,Qn(su)}function Tl(c,d){c.finishedWork=null,c.finishedLanes=0;var m=c.timeoutHandle;if(m!==-1&&(c.timeoutHandle=-1,HL(m)),mr!==null)for(m=mr.return;m!==null;){var x=m;switch(p2(x),x.tag){case 1:x=x.type.childContextTypes,x!=null&&s1();break;case 3:tu(),Qn(js),Qn(Qr),A2();break;case 5:C2(x);break;case 4:tu();break;case 13:Qn(rr);break;case 19:Qn(rr);break;case 10:b2(x.type._context);break;case 22:case 23:ag()}m=m.return}if(Tr=c,mr=c=Pi(c.current,null),Wr=Us=d,jr=0,Kd=null,Q2=A1=Ll=0,Ms=Gd=null,Ml!==null){for(d=0;d<Ml.length;d++)if(m=Ml[d],x=m.interleaved,x!==null){m.interleaved=null;var M=x.next,L=m.pending;if(L!==null){var z=L.next;L.next=M,x.next=z}m.pending=x}Ml=null}return c}function Qb(c,d){do{var m=mr;try{if(y2(),g1.current=b1,v1){for(var x=sr.memoizedState;x!==null;){var M=x.queue;M!==null&&(M.pending=null),x=x.next}v1=!1}if(Pl=0,$r=Cr=sr=null,Vd=!1,Zd=0,X2.current=null,m===null||m.return===null){jr=1,Kd=d,mr=null;break}e:{var L=c,z=m.return,de=m,ye=d;if(d=Wr,de.flags|=32768,ye!==null&&typeof ye=="object"&&typeof ye.then=="function"){var Ve=ye,ct=de,dt=ct.tag;if((ct.mode&1)===0&&(dt===0||dt===11||dt===15)){var lt=ct.alternate;lt?(ct.updateQueue=lt.updateQueue,ct.memoizedState=lt.memoizedState,ct.lanes=lt.lanes):(ct.updateQueue=null,ct.memoizedState=null)}var $t=Sb(z);if($t!==null){$t.flags&=-257,Eb($t,z,de,L,d),$t.mode&1&&kb(L,Ve,d),d=$t,ye=Ve;var Ot=d.updateQueue;if(Ot===null){var It=new Set;It.add(ye),d.updateQueue=It}else Ot.add(ye);break e}else{if((d&1)===0){kb(L,Ve,d),og();break e}ye=Error(n(426))}}else if(tr&&de.mode&1){var hr=Sb(z);if(hr!==null){(hr.flags&65536)===0&&(hr.flags|=256),Eb(hr,z,de,L,d),v2(nu(ye,de));break e}}L=ye=nu(ye,de),jr!==4&&(jr=2),Gd===null?Gd=[L]:Gd.push(L),L=z;do{switch(L.tag){case 3:L.flags|=65536,d&=-d,L.lanes|=d;var Le=bb(L,ye,d);Ky(L,Le);break e;case 1:de=ye;var Ee=L.type,Ie=L.stateNode;if((L.flags&128)===0&&(typeof Ee.getDerivedStateFromError=="function"||Ie!==null&&typeof Ie.componentDidCatch=="function"&&(Ai===null||!Ai.has(Ie)))){L.flags|=65536,d&=-d,L.lanes|=d;var bt=xb(L,de,d);Ky(L,bt);break e}}L=L.return}while(L!==null)}tx(m)}catch(_t){d=_t,mr===m&&m!==null&&(mr=m=m.return);continue}break}while(!0)}function Jb(){var c=j1.current;return j1.current=b1,c===null?b1:c}function og(){(jr===0||jr===3||jr===2)&&(jr=4),Tr===null||(Ll&268435455)===0&&(A1&268435455)===0||Ri(Tr,Wr)}function $1(c,d){var m=Ln;Ln|=2;var x=Jb();(Tr!==c||Wr!==d)&&(Fo=null,Tl(c,d));do try{i$();break}catch(M){Qb(c,M)}while(!0);if(y2(),Ln=m,j1.current=x,mr!==null)throw Error(n(261));return Tr=null,Wr=0,jr}function i$(){for(;mr!==null;)ex(mr)}function l$(){for(;mr!==null&&!Ke();)ex(mr)}function ex(c){var d=sx(c.alternate,c,Us);c.memoizedProps=c.pendingProps,d===null?tx(c):mr=d,X2.current=null}function tx(c){var d=c;do{var m=d.alternate;if(c=d.return,(d.flags&32768)===0){if(m=e$(m,d,Us),m!==null){mr=m;return}}else{if(m=t$(m,d),m!==null){m.flags&=32767,mr=m;return}if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{jr=6,mr=null;return}}if(d=d.sibling,d!==null){mr=d;return}mr=d=c}while(d!==null);jr===0&&(jr=5)}function Dl(c,d,m){var x=kn,M=la.transition;try{la.transition=null,kn=1,c$(c,d,m,x)}finally{la.transition=M,kn=x}return null}function c$(c,d,m,x){do ou();while(Ni!==null);if((Ln&6)!==0)throw Error(n(327));m=c.finishedWork;var M=c.finishedLanes;if(m===null)return null;if(c.finishedWork=null,c.finishedLanes=0,m===c.current)throw Error(n(177));c.callbackNode=null,c.callbackPriority=0;var L=m.lanes|m.childLanes;if(ur(c,L),c===Tr&&(mr=Tr=null,Wr=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||M1||(M1=!0,ax(Ae,function(){return ou(),null})),L=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||L){L=la.transition,la.transition=null;var z=kn;kn=1;var de=Ln;Ln|=4,X2.current=null,r$(c,m),Ub(m,c),ML(o2),Tn=!!a2,o2=a2=null,c.current=m,s$(m),xt(),Ln=de,kn=z,la.transition=L}else c.current=m;if(M1&&(M1=!1,Ni=c,R1=M),L=c.pendingLanes,L===0&&(Ai=null),he(m.stateNode),Rs(c,st()),d!==null)for(x=c.onRecoverableError,m=0;m<d.length;m++)M=d[m],x(M.value,{componentStack:M.stack,digest:M.digest});if(N1)throw N1=!1,c=eg,eg=null,c;return(R1&1)!==0&&c.tag!==0&&ou(),L=c.pendingLanes,(L&1)!==0?c===tg?Yd++:(Yd=0,tg=c):Yd=0,Si(),null}function ou(){if(Ni!==null){var c=Vs(R1),d=la.transition,m=kn;try{if(la.transition=null,kn=16>c?16:c,Ni===null)var x=!1;else{if(c=Ni,Ni=null,R1=0,(Ln&6)!==0)throw Error(n(331));var M=Ln;for(Ln|=4,Ht=c.current;Ht!==null;){var L=Ht,z=L.child;if((Ht.flags&16)!==0){var de=L.deletions;if(de!==null){for(var ye=0;ye<de.length;ye++){var Ve=de[ye];for(Ht=Ve;Ht!==null;){var ct=Ht;switch(ct.tag){case 0:case 11:case 15:Wd(8,ct,L)}var dt=ct.child;if(dt!==null)dt.return=ct,Ht=dt;else for(;Ht!==null;){ct=Ht;var lt=ct.sibling,$t=ct.return;if(_b(ct),ct===Ve){Ht=null;break}if(lt!==null){lt.return=$t,Ht=lt;break}Ht=$t}}}var Ot=L.alternate;if(Ot!==null){var It=Ot.child;if(It!==null){Ot.child=null;do{var hr=It.sibling;It.sibling=null,It=hr}while(It!==null)}}Ht=L}}if((L.subtreeFlags&2064)!==0&&z!==null)z.return=L,Ht=z;else e:for(;Ht!==null;){if(L=Ht,(L.flags&2048)!==0)switch(L.tag){case 0:case 11:case 15:Wd(9,L,L.return)}var Le=L.sibling;if(Le!==null){Le.return=L.return,Ht=Le;break e}Ht=L.return}}var Ee=c.current;for(Ht=Ee;Ht!==null;){z=Ht;var Ie=z.child;if((z.subtreeFlags&2064)!==0&&Ie!==null)Ie.return=z,Ht=Ie;else e:for(z=Ee;Ht!==null;){if(de=Ht,(de.flags&2048)!==0)try{switch(de.tag){case 0:case 11:case 15:C1(9,de)}}catch(_t){dr(de,de.return,_t)}if(de===z){Ht=null;break e}var bt=de.sibling;if(bt!==null){bt.return=de.return,Ht=bt;break e}Ht=de.return}}if(Ln=M,Si(),W&&typeof W.onPostCommitFiberRoot=="function")try{W.onPostCommitFiberRoot(Tt,c)}catch{}x=!0}return x}finally{kn=m,la.transition=d}}return!1}function nx(c,d,m){d=nu(m,d),d=bb(c,d,1),c=Ci(c,d,1),d=fs(),c!==null&&(Jt(c,1,d),Rs(c,d))}function dr(c,d,m){if(c.tag===3)nx(c,c,m);else for(;d!==null;){if(d.tag===3){nx(d,c,m);break}else if(d.tag===1){var x=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(Ai===null||!Ai.has(x))){c=nu(m,c),c=xb(d,c,1),d=Ci(d,c,1),c=fs(),d!==null&&(Jt(d,1,c),Rs(d,c));break}}d=d.return}}function u$(c,d,m){var x=c.pingCache;x!==null&&x.delete(d),d=fs(),c.pingedLanes|=c.suspendedLanes&m,Tr===c&&(Wr&m)===m&&(jr===4||jr===3&&(Wr&130023424)===Wr&&500>st()-J2?Tl(c,0):Q2|=m),Rs(c,d)}function rx(c,d){d===0&&((c.mode&1)===0?d=1:(d=Dt,Dt<<=1,(Dt&130023424)===0&&(Dt=4194304)));var m=fs();c=Ho(c,d),c!==null&&(Jt(c,d,m),Rs(c,m))}function d$(c){var d=c.memoizedState,m=0;d!==null&&(m=d.retryLane),rx(c,m)}function f$(c,d){var m=0;switch(c.tag){case 13:var x=c.stateNode,M=c.memoizedState;M!==null&&(m=M.retryLane);break;case 19:x=c.stateNode;break;default:throw Error(n(314))}x!==null&&x.delete(d),rx(c,m)}var sx;sx=function(c,d,m){if(c!==null)if(c.memoizedProps!==d.pendingProps||js.current)Ns=!0;else{if((c.lanes&m)===0&&(d.flags&128)===0)return Ns=!1,JL(c,d,m);Ns=(c.flags&131072)!==0}else Ns=!1,tr&&(d.flags&1048576)!==0&&Oy(d,l1,d.index);switch(d.lanes=0,d.tag){case 2:var x=d.type;S1(c,d),c=d.pendingProps;var M=Gc(d,Qr.current);eu(d,m),M=R2(null,d,x,c,M,m);var L=P2();return d.flags|=1,typeof M=="object"&&M!==null&&typeof M.render=="function"&&M.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,As(x)?(L=!0,a1(d)):L=!1,d.memoizedState=M.state!==null&&M.state!==void 0?M.state:null,S2(d),M.updater=x1,d.stateNode=M,M._reactInternals=d,O2(d,x,c,m),d=V2(null,d,x,!0,L,m)):(d.tag=0,tr&&L&&h2(d),ds(null,d,M,m),d=d.child),d;case 16:x=d.elementType;e:{switch(S1(c,d),c=d.pendingProps,M=x._init,x=M(x._payload),d.type=x,M=d.tag=p$(x),c=$a(x,c),M){case 0:d=_2(null,d,x,c,m);break e;case 1:d=Rb(null,d,x,c,m);break e;case 11:d=Cb(null,d,x,c,m);break e;case 14:d=jb(null,d,x,$a(x.type,c),m);break e}throw Error(n(306,x,""))}return d;case 0:return x=d.type,M=d.pendingProps,M=d.elementType===x?M:$a(x,M),_2(c,d,x,M,m);case 1:return x=d.type,M=d.pendingProps,M=d.elementType===x?M:$a(x,M),Rb(c,d,x,M,m);case 3:e:{if(Pb(d),c===null)throw Error(n(387));x=d.pendingProps,L=d.memoizedState,M=L.element,Wy(c,d),p1(d,x,null,m);var z=d.memoizedState;if(x=z.element,L.isDehydrated)if(L={element:x,isDehydrated:!1,cache:z.cache,pendingSuspenseBoundaries:z.pendingSuspenseBoundaries,transitions:z.transitions},d.updateQueue.baseState=L,d.memoizedState=L,d.flags&256){M=nu(Error(n(423)),d),d=Lb(c,d,x,m,M);break e}else if(x!==M){M=nu(Error(n(424)),d),d=Lb(c,d,x,m,M);break e}else for(Bs=bi(d.stateNode.containerInfo.firstChild),zs=d,tr=!0,La=null,m=By(d,null,x,m),d.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(Xc(),x===M){d=Io(c,d,m);break e}ds(c,d,x,m)}d=d.child}return d;case 5:return Yy(d),c===null&&g2(d),x=d.type,M=d.pendingProps,L=c!==null?c.memoizedProps:null,z=M.children,i2(x,M)?z=null:L!==null&&i2(x,L)&&(d.flags|=32),Mb(c,d),ds(c,d,z,m),d.child;case 6:return c===null&&g2(d),null;case 13:return $b(c,d,m);case 4:return E2(d,d.stateNode.containerInfo),x=d.pendingProps,c===null?d.child=Qc(d,null,x,m):ds(c,d,x,m),d.child;case 11:return x=d.type,M=d.pendingProps,M=d.elementType===x?M:$a(x,M),Cb(c,d,x,M,m);case 7:return ds(c,d,d.pendingProps,m),d.child;case 8:return ds(c,d,d.pendingProps.children,m),d.child;case 12:return ds(c,d,d.pendingProps.children,m),d.child;case 10:e:{if(x=d.type._context,M=d.pendingProps,L=d.memoizedProps,z=M.value,Gn(d1,x._currentValue),x._currentValue=z,L!==null)if(Pa(L.value,z)){if(L.children===M.children&&!js.current){d=Io(c,d,m);break e}}else for(L=d.child,L!==null&&(L.return=d);L!==null;){var de=L.dependencies;if(de!==null){z=L.child;for(var ye=de.firstContext;ye!==null;){if(ye.context===x){if(L.tag===1){ye=Oo(-1,m&-m),ye.tag=2;var Ve=L.updateQueue;if(Ve!==null){Ve=Ve.shared;var ct=Ve.pending;ct===null?ye.next=ye:(ye.next=ct.next,ct.next=ye),Ve.pending=ye}}L.lanes|=m,ye=L.alternate,ye!==null&&(ye.lanes|=m),x2(L.return,m,d),de.lanes|=m;break}ye=ye.next}}else if(L.tag===10)z=L.type===d.type?null:L.child;else if(L.tag===18){if(z=L.return,z===null)throw Error(n(341));z.lanes|=m,de=z.alternate,de!==null&&(de.lanes|=m),x2(z,m,d),z=L.sibling}else z=L.child;if(z!==null)z.return=L;else for(z=L;z!==null;){if(z===d){z=null;break}if(L=z.sibling,L!==null){L.return=z.return,z=L;break}z=z.return}L=z}ds(c,d,M.children,m),d=d.child}return d;case 9:return M=d.type,x=d.pendingProps.children,eu(d,m),M=oa(M),x=x(M),d.flags|=1,ds(c,d,x,m),d.child;case 14:return x=d.type,M=$a(x,d.pendingProps),M=$a(x.type,M),jb(c,d,x,M,m);case 15:return Ab(c,d,d.type,d.pendingProps,m);case 17:return x=d.type,M=d.pendingProps,M=d.elementType===x?M:$a(x,M),S1(c,d),d.tag=1,As(x)?(c=!0,a1(d)):c=!1,eu(d,m),wb(d,x,M),O2(d,x,M,m),V2(null,d,x,!0,c,m);case 19:return Db(c,d,m);case 22:return Nb(c,d,m)}throw Error(n(156,d.tag))};function ax(c,d){return Q(c,d)}function h$(c,d,m,x){this.tag=c,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ca(c,d,m,x){return new h$(c,d,m,x)}function ig(c){return c=c.prototype,!(!c||!c.isReactComponent)}function p$(c){if(typeof c=="function")return ig(c)?1:0;if(c!=null){if(c=c.$$typeof,c===D)return 11;if(c===U)return 14}return 2}function Pi(c,d){var m=c.alternate;return m===null?(m=ca(c.tag,d,c.key,c.mode),m.elementType=c.elementType,m.type=c.type,m.stateNode=c.stateNode,m.alternate=c,c.alternate=m):(m.pendingProps=d,m.type=c.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=c.flags&14680064,m.childLanes=c.childLanes,m.lanes=c.lanes,m.child=c.child,m.memoizedProps=c.memoizedProps,m.memoizedState=c.memoizedState,m.updateQueue=c.updateQueue,d=c.dependencies,m.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},m.sibling=c.sibling,m.index=c.index,m.ref=c.ref,m}function T1(c,d,m,x,M,L){var z=2;if(x=c,typeof c=="function")ig(c)&&(z=1);else if(typeof c=="string")z=5;else e:switch(c){case P:return Hl(m.children,M,L,d);case C:z=8,M|=8;break;case R:return c=ca(12,m,d,M|2),c.elementType=R,c.lanes=L,c;case q:return c=ca(13,m,d,M),c.elementType=q,c.lanes=L,c;case _:return c=ca(19,m,d,M),c.elementType=_,c.lanes=L,c;case I:return D1(m,M,L,d);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case $:z=10;break e;case H:z=9;break e;case D:z=11;break e;case U:z=14;break e;case Y:z=16,x=null;break e}throw Error(n(130,c==null?c:typeof c,""))}return d=ca(z,m,d,M),d.elementType=c,d.type=x,d.lanes=L,d}function Hl(c,d,m,x){return c=ca(7,c,x,d),c.lanes=m,c}function D1(c,d,m,x){return c=ca(22,c,x,d),c.elementType=I,c.lanes=m,c.stateNode={isHidden:!1},c}function lg(c,d,m){return c=ca(6,c,null,d),c.lanes=m,c}function cg(c,d,m){return d=ca(4,c.children!==null?c.children:[],c.key,d),d.lanes=m,d.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},d}function m$(c,d,m,x,M){this.tag=d,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=nr(0),this.expirationTimes=nr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nr(0),this.identifierPrefix=x,this.onRecoverableError=M,this.mutableSourceEagerHydrationData=null}function ug(c,d,m,x,M,L,z,de,ye){return c=new m$(c,d,m,de,ye),d===1?(d=1,L===!0&&(d|=8)):d=0,L=ca(3,null,null,d),c.current=L,L.stateNode=c,L.memoizedState={element:x,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},S2(L),c}function g$(c,d,m){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:x==null?null:""+x,children:c,containerInfo:d,implementation:m}}function ox(c){if(!c)return ki;c=c._reactInternals;e:{if(tt(c)!==c||c.tag!==1)throw Error(n(170));var d=c;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if(As(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(n(171))}if(c.tag===1){var m=c.type;if(As(m))return Ty(c,m,d)}return d}function ix(c,d,m,x,M,L,z,de,ye){return c=ug(m,x,!0,c,M,L,z,de,ye),c.context=ox(null),m=c.current,x=fs(),M=Mi(m),L=Oo(x,M),L.callback=d??null,Ci(m,L,M),c.current.lanes=M,Jt(c,M,x),Rs(c,x),c}function H1(c,d,m,x){var M=d.current,L=fs(),z=Mi(M);return m=ox(m),d.context===null?d.context=m:d.pendingContext=m,d=Oo(L,z),d.payload={element:c},x=x===void 0?null:x,x!==null&&(d.callback=x),c=Ci(M,d,z),c!==null&&(Ha(c,M,z,L),h1(c,M,z)),z}function O1(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return c.child.stateNode;default:return c.child.stateNode}}function lx(c,d){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var m=c.retryLane;c.retryLane=m!==0&&m<d?m:d}}function dg(c,d){lx(c,d),(c=c.alternate)&&lx(c,d)}function v$(){return null}var cx=typeof reportError=="function"?reportError:function(c){console.error(c)};function fg(c){this._internalRoot=c}I1.prototype.render=fg.prototype.render=function(c){var d=this._internalRoot;if(d===null)throw Error(n(409));H1(c,d,null,null)},I1.prototype.unmount=fg.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var d=c.containerInfo;$l(function(){H1(null,c,null,null)}),d[Lo]=null}};function I1(c){this._internalRoot=c}I1.prototype.unstable_scheduleHydration=function(c){if(c){var d=zn();c={blockedOn:null,target:c,priority:d};for(var m=0;m<Er.length&&d!==0&&d<Er[m].priority;m++);Er.splice(m,0,c),m===0&&De(c)}};function hg(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)}function F1(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11&&(c.nodeType!==8||c.nodeValue!==" react-mount-point-unstable "))}function ux(){}function w$(c,d,m,x,M){if(M){if(typeof x=="function"){var L=x;x=function(){var Ve=O1(z);L.call(Ve)}}var z=ix(d,x,c,0,null,!1,!1,"",ux);return c._reactRootContainer=z,c[Lo]=z.current,$d(c.nodeType===8?c.parentNode:c),$l(),z}for(;M=c.lastChild;)c.removeChild(M);if(typeof x=="function"){var de=x;x=function(){var Ve=O1(ye);de.call(Ve)}}var ye=ug(c,0,!1,null,null,!1,!1,"",ux);return c._reactRootContainer=ye,c[Lo]=ye.current,$d(c.nodeType===8?c.parentNode:c),$l(function(){H1(d,ye,m,x)}),ye}function _1(c,d,m,x,M){var L=m._reactRootContainer;if(L){var z=L;if(typeof M=="function"){var de=M;M=function(){var ye=O1(z);de.call(ye)}}H1(d,z,c,M)}else z=w$(m,d,c,M,x);return O1(z)}na=function(c){switch(c.tag){case 3:var d=c.stateNode;if(d.current.memoizedState.isDehydrated){var m=qt(d.pendingLanes);m!==0&&(Cs(d,m|1),Rs(d,st()),(Ln&6)===0&&(au=st()+500,Si()))}break;case 13:$l(function(){var x=Ho(c,1);if(x!==null){var M=fs();Ha(x,c,1,M)}}),dg(c,1)}},en=function(c){if(c.tag===13){var d=Ho(c,134217728);if(d!==null){var m=fs();Ha(d,c,134217728,m)}dg(c,134217728)}},Cn=function(c){if(c.tag===13){var d=Mi(c),m=Ho(c,d);if(m!==null){var x=fs();Ha(m,c,d,x)}dg(c,d)}},zn=function(){return kn},Zr=function(c,d){var m=kn;try{return kn=c,d()}finally{kn=m}},St=function(c,d,m){switch(d){case"input":if(Xe(c,m),d=m.name,m.type==="radio"&&d!=null){for(m=c;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll("input[name="+JSON.stringify(""+d)+'][type="radio"]'),d=0;d<m.length;d++){var x=m[d];if(x!==c&&x.form===c.form){var M=r1(x);if(!M)throw Error(n(90));Ne(x),Xe(x,M)}}}break;case"textarea":ke(c,m);break;case"select":d=m.value,d!=null&&ve(c,!!m.multiple,d,!1)}},ft=sg,vn=$l;var y$={usingClientEntryPoint:!1,Events:[Hd,Wc,r1,at,Mt,sg]},qd={findFiberByHostInstance:Cl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},b$={bundleType:qd.bundleType,version:qd.version,rendererPackageName:qd.rendererPackageName,rendererConfig:qd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:N.ReactCurrentDispatcher,findHostInstanceByFiber:function(c){return c=et(c),c===null?null:c.stateNode},findFiberByHostInstance:qd.findFiberByHostInstance||v$,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var V1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!V1.isDisabled&&V1.supportsFiber)try{Tt=V1.inject(b$),W=V1}catch{}}return Ps.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=y$,Ps.createPortal=function(c,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!hg(d))throw Error(n(200));return g$(c,d,null,m)},Ps.createRoot=function(c,d){if(!hg(c))throw Error(n(299));var m=!1,x="",M=cx;return d!=null&&(d.unstable_strictMode===!0&&(m=!0),d.identifierPrefix!==void 0&&(x=d.identifierPrefix),d.onRecoverableError!==void 0&&(M=d.onRecoverableError)),d=ug(c,1,!1,null,null,m,!1,x,M),c[Lo]=d.current,$d(c.nodeType===8?c.parentNode:c),new fg(d)},Ps.findDOMNode=function(c){if(c==null)return null;if(c.nodeType===1)return c;var d=c._reactInternals;if(d===void 0)throw typeof c.render=="function"?Error(n(188)):(c=Object.keys(c).join(","),Error(n(268,c)));return c=et(d),c=c===null?null:c.stateNode,c},Ps.flushSync=function(c){return $l(c)},Ps.hydrate=function(c,d,m){if(!F1(d))throw Error(n(200));return _1(null,c,d,!0,m)},Ps.hydrateRoot=function(c,d,m){if(!hg(c))throw Error(n(405));var x=m!=null&&m.hydratedSources||null,M=!1,L="",z=cx;if(m!=null&&(m.unstable_strictMode===!0&&(M=!0),m.identifierPrefix!==void 0&&(L=m.identifierPrefix),m.onRecoverableError!==void 0&&(z=m.onRecoverableError)),d=ix(d,null,c,1,m??null,M,!1,L,z),c[Lo]=d.current,$d(c),x)for(c=0;c<x.length;c++)m=x[c],M=m._getVersion,M=M(m._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[m,M]:d.mutableSourceEagerHydrationData.push(m,M);return new I1(d)},Ps.render=function(c,d,m){if(!F1(d))throw Error(n(200));return _1(null,c,d,!1,m)},Ps.unmountComponentAtNode=function(c){if(!F1(c))throw Error(n(40));return c._reactRootContainer?($l(function(){_1(null,null,c,!1,function(){c._reactRootContainer=null,c[Lo]=null})}),!0):!1},Ps.unstable_batchedUpdates=sg,Ps.unstable_renderSubtreeIntoContainer=function(c,d,m,x){if(!F1(m))throw Error(n(200));if(c==null||c._reactInternals===void 0)throw Error(n(38));return _1(c,d,m,!1,x)},Ps.version="18.3.1-next-f1338f8080-20240426",Ps}var xx;function US(){if(xx)return vg.exports;xx=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),vg.exports=N$(),vg.exports}var kx;function M$(){if(kx)return Z1;kx=1;var e=US();return Z1.createRoot=e.createRoot,Z1.hydrateRoot=e.hydrateRoot,Z1}var R$=M$();/**
41
+ * react-router v7.18.3
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */var WS=e=>{throw TypeError(e)},KS=(e,t,n)=>t.has(e)||WS("Cannot "+n),da=(e,t,n)=>(KS(e,t,"read from private field"),n?n.call(e):t.get(e)),h0=(e,t,n)=>t.has(e)?WS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ao=(e,t,n,r)=>(KS(e,t,"write to private field"),t.set(e,n),n),Sp=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Ep=/^[\\/]{2}/;function GS(e,t){return t+e.replace(/\\/g,"/")}var Sx="popstate";function Ex(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function P$(e={}){function t(r,a){var h;let i=(h=a.state)==null?void 0:h.masked,{pathname:l,search:u,hash:f}=i||r.location;return $0("",{pathname:l,search:u,hash:f},a.state&&a.state.usr||null,a.state&&a.state.key||"default",i?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,a){return typeof a=="string"?a:vs(a)}return $$(t,n,null,e)}function cn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function er(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function L$(){return Math.random().toString(36).substring(2,10)}function Cx(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function $0(e,t,n=null,r,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ao(t):t,state:n,key:t&&t.key||r||L$(),mask:a}}function vs({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Ao(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function $$(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:i=!1}=r,l=a.history,u="POP",f=null,h=p();h==null&&(h=0,l.replaceState({...l.state,idx:h},""));function p(){return(l.state||{idx:null}).idx}function g(){u="POP";let k=p(),S=k==null?null:k-h;h=k,f&&f({action:u,location:y.location,delta:S})}function v(k,S){u="PUSH";let E=Ex(k)?k:$0(y.location,k,S);h=p()+1;let j=Cx(E,h),N=y.createHref(E.mask||E);try{l.pushState(j,"",N)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;a.location.assign(N)}i&&f&&f({action:u,location:y.location,delta:1})}function w(k,S){u="REPLACE";let E=Ex(k)?k:$0(y.location,k,S);h=p();let j=Cx(E,h),N=y.createHref(E.mask||E);l.replaceState(j,"",N),i&&f&&f({action:u,location:y.location,delta:0})}function b(k){return YS(a,k)}let y={get action(){return u},get location(){return e(a,l)},listen(k){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(Sx,g),f=k,()=>{a.removeEventListener(Sx,g),f=null}},createHref(k){return t(a,k)},createURL:b,encodeLocation(k){let S=b(k);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:v,replace:w,go(k){return l.go(k)}};return y}function YS(e,t,n=!1){let r="http://localhost";e&&(r=e.location.origin!=="null"?e.location.origin:e.location.href),cn(r,"No window.location.(origin|href) available to create URL");let a=typeof t=="string"?t:vs(t);return a=a.replace(/ $/,"%20"),!n&&Ep.test(a)&&(a=r+a),new URL(a,r)}var p0,jx=class{constructor(e){if(h0(this,p0,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(da(this,p0).has(e))return da(this,p0).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){da(this,p0).set(e,t)}};p0=new WeakMap;var T$=new Set(["lazy","caseSensitive","path","id","index","children"]);function D$(e){return T$.has(e)}var H$=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function O$(e){return H$.has(e)}function I$(e){return e.index===!0}function T0(e,t,n=[],r={},a=!1){return e.map((i,l)=>{let u=[...n,String(l)],f=typeof i.id=="string"?i.id:u.join("-");if(cn(i.index!==!0||!i.children,"Cannot specify children on an index route"),cn(a||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),I$(i)){let h={...i,id:f};return r[f]=Ax(h,t(h)),h}else{let h={...i,id:f,children:void 0};return r[f]=Ax(h,t(h)),i.children&&(h.children=T0(i.children,t,u,r,a)),h}})}function Ax(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function qS(e,t,n="/"){return Oa(e,t,n,!1)}function Oa(e,t,n,r,a){let i=typeof t=="string"?Ao(t):t,l=Xs(i.pathname||"/",n);if(l==null)return null;let u=a??bh(e),f=null,h=nE(l);for(let p=0;f==null&&p<u.length;++p)f=G$(u[p],h,r);return f}function XS(e,t){let{route:n,pathname:r,params:a}=e;return{id:n.id,pathname:r,params:a,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function bh(e){let t=QS(e);return F$(t),t}function QS(e,t=[],n=[],r="",a=!1){let i=(l,u,f=a,h)=>{let p={relativePath:h===void 0?l.path||"":h,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&f)return;cn(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let g=wa([r,p.relativePath]),v=n.concat(p);l.children&&l.children.length>0&&(cn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),QS(l.children,t,v,g,f)),!(l.path==null&&!l.index)&&t.push({path:g,score:W$(g,l.index),routesMeta:v.map((w,b)=>{let[y,k]=tE(w.relativePath,w.caseSensitive,b===v.length-1);return{...w,matcher:y,compiledParams:k}})})};return e.forEach((l,u)=>{var f;if(l.path===""||!((f=l.path)!=null&&f.includes("?")))i(l,u);else for(let h of JS(l.path))i(l,u,!0,h)}),t}function JS(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let l=JS(r.join("/")),u=[];return u.push(...l.map(f=>f===""?i:[i,f].join("/"))),a&&u.push(...l),u.map(f=>e.startsWith("/")&&f===""?"/":f)}function F$(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:K$(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var _$=/^:[\w-]+$/,V$=3,Z$=2,z$=1,B$=10,U$=-2,Nx=e=>e==="*";function W$(e,t){let n=e.split("/"),r=n.length;return n.some(Nx)&&(r+=U$),t&&(r+=Z$),n.filter(a=>!Nx(a)).reduce((a,i)=>a+(_$.test(i)?V$:i===""?z$:B$),r)}function K$(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function G$(e,t,n=!1){let{routesMeta:r}=e,a={},i="/",l=[];for(let u=0;u<r.length;++u){let f=r[u],h=u===r.length-1,p=i==="/"?t:t.slice(i.length)||"/",g={path:f.relativePath,caseSensitive:f.caseSensitive,end:h},v=f.matcher&&f.compiledParams?eE(g,p,f.matcher,f.compiledParams):tl(g,p),w=f.route;if(!v&&h&&n&&!r[r.length-1].route.index&&(v=tl({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},p)),!v)return null;Object.assign(a,v.params),l.push({params:a,pathname:wa([i,v.pathname]),pathnameBase:X$(wa([i,v.pathnameBase])),route:w}),v.pathnameBase!=="/"&&(i=wa([i,v.pathnameBase]))}return l}function xs(e,t={}){let n=e;n.endsWith("*")&&n!=="*"&&!n.endsWith("/*")&&(er(!1,`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`),n=n.replace(/\*$/,"/*"));const r=n.startsWith("/")?"/":"",a=l=>l==null?"":typeof l=="string"?l:String(l),i=n.split(/\/+/).map((l,u,f)=>{if(u===f.length-1&&l==="*")return a(t["*"]);const p=l.match(/^:([\w-]+)(\??)(.*)/);if(p){const[,g,v,w]=p;let b=t[g];return cn(v==="?"||b!=null,`Missing ":${g}" param`),encodeURIComponent(a(b))+w}return l.replace(/\?$/g,"")}).filter(l=>!!l);return r+i.join("/")}function tl(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=tE(e.path,e.caseSensitive,e.end);return eE(e,t,n,r)}function eE(e,t,n,r){let a=t.match(n);if(!a)return null;let i=a[0],l=Wu(i,1),u=a.slice(1);return{params:r.reduce((h,{paramName:p,isOptional:g},v)=>{if(p==="*"){let b=u[v]||"";l=Wu(i.slice(0,i.length-b.length),1)}const w=u[v];return g&&!w?h[p]=void 0:h[p]=(w||"").replace(/%2F/g,"/"),h},{}),pathname:i,pathnameBase:l,pattern:e}}function tE(e,t=!1,n=!0){er(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,f,h,p)=>{if(r.push({paramName:u,isOptional:f!=null}),f){let g=p.charAt(h+l.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function nE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return er(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Xs(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Y$({basename:e,pathname:t}){return t==="/"?e:wa([e,t])}var S4=e=>Sp.test(e);function q$(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Ao(e):e,i;return n?(n=E4(n),n.startsWith("/")||n.startsWith("\\")?i=Mx(n.substring(1),"/"):i=Mx(n,t)):i=t,{pathname:i,search:Q$(r),hash:J$(a)}}function Mx(e,t){let n=Wu(t).split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function bg(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function rE(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Cp(e){let t=rE(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function of(e,t,n,r=!1){let a;typeof e=="string"?a=Ao(e):(a={...e},cn(!a.pathname||!a.pathname.includes("?"),bg("?","pathname","search",a)),cn(!a.pathname||!a.pathname.includes("#"),bg("#","pathname","hash",a)),cn(!a.search||!a.search.includes("#"),bg("#","search","hash",a)));let i=e===""||a.pathname==="",l=i?"/":a.pathname,u;if(l==null)u=n;else{let g=t.length-1;if(!r&&l.startsWith("..")){let v=l.split("/");for(;v[0]==="..";)v.shift(),g-=1;a.pathname=v.join("/")}u=g>=0?t[g]:"/"}let f=q$(a,u),h=l&&l!=="/"&&l.endsWith("/"),p=(i||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||p)&&(f.pathname+="/"),f}var E4=e=>e.replace(/[\\/]{2,}/g,"/"),wa=e=>E4(e.join("/"));function Wu(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var X$=e=>Wu(e).replace(/^\/*/,"/"),Q$=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,J$=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,eT=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],lf=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function D0(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function cf(e){let t=e.map(n=>n.route.path).filter(Boolean);return wa(t)||"/"}var sE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function aE(e,t){let n=e;if(typeof n!="string"||!Sp.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(sE)try{let i=new URL(window.location.href),l=Ep.test(n)?new URL(GS(n,i.protocol)):new URL(n),u=Xs(l.pathname,t);l.origin===i.origin&&u!=null?n=u+l.search+l.hash:a=!0}catch{er(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}var Bi=Symbol("Uninstrumented");function tT(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(a=>a({id:t.id,index:t.index,path:t.path,instrument(i){let l=Object.keys(n);for(let u of l)i[u]&&n[u].push(i[u])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let a=Cu(n.lazy,t.lazy,()=>{});a&&(r.lazy=a)}if(typeof t.lazy=="object"){let a=t.lazy;["middleware","loader","action"].forEach(i=>{let l=a[i],u=n[`lazy.${i}`];if(typeof l=="function"&&u.length>0){let f=Cu(u,l,()=>{});f&&(r.lazy=Object.assign(r.lazy||{},{[i]:f}))}})}return["loader","action"].forEach(a=>{let i=t[a];if(typeof i=="function"&&n[a].length>0){let l=i[Bi]??i,u=Cu(n[a],l,(...f)=>Rx(f[0]));u&&(a==="loader"&&l.hydrate===!0&&(u.hydrate=!0),u[Bi]=l,r[a]=u)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(a=>{let i=a[Bi]??a,l=Cu(n.middleware,i,(...u)=>Rx(u[0]));return l?(l[Bi]=i,l):a})),r}function nT(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(a){let i=Object.keys(a);for(let l of i)a[l]&&n[l].push(a[l])}})),n.navigate.length>0){let r=e.navigate[Bi]??e.navigate,a=Cu(n.navigate,r,(...i)=>{let[l,u]=i;return{to:typeof l=="number"||typeof l=="string"?l:l?vs(l):".",...Px(e,u??{})}});a&&(a[Bi]=r,e.navigate=a)}if(n.fetch.length>0){let r=e.fetch[Bi]??e.fetch,a=Cu(n.fetch,r,(...i)=>{let[l,,u,f]=i;return{href:u??".",fetcherKey:l,...Px(e,f??{})}});a&&(a[Bi]=r,e.fetch=a)}return e}function Cu(e,t,n){return e.length===0?null:async(...r)=>{let a=await oE(e,n(...r),()=>t(...r),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function oE(e,t,n,r){let a=e[r],i;if(a){let l,u=async()=>(l?console.error("You cannot call instrumented handlers more than once"):l=oE(e,t,n,r-1),i=await l,cn(i,"Expected a result"),i.type==="error"&&i.value instanceof Error?{status:"error",error:i.value}:{status:"success",error:void 0});try{await a(u,t)}catch(f){console.error("An instrumentation function threw an error:",f)}l||await u(),await l}else try{i={type:"success",value:await n()}}catch(l){i={type:"error",value:l}}return i||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Rx(e){let{request:t,context:n,params:r,pattern:a}=e;return{request:rT(t),params:{...r},pattern:a,context:sT(n)}}function Px(e,t){return{currentUrl:vs(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function rT(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function sT(e){if(oT(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var aT=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function oT(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===aT}var Lx=new URL("http://localhost");function C4(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),Lx)}catch{return Lx}}function xg(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function iT(e,t){if(e.startsWith("//"))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===""||e.slice(n.length).startsWith("//"):!1}function Pu(e,t,n,r){let a=null;try{a=e==null?null:new URL(e,n)}catch{}let i=new URL(t,n),l=a!=null&&!xg(a,n),u=!xg(i,n);if(r==="reject"){if(l||u)throw new Error("External navigation is not allowed")}else if(u&&(a==null||!iT(e,a)||!xg(a,i)))throw new Error("External navigation is not allowed")}var iE=["POST","PUT","PATCH","DELETE"],lT=new Set(iE),cT=["GET",...iE],uT=new Set(cT),lE=new Set([301,302,303,307,308]),dT=new Set([307,308]),kg={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},fT={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Qd={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},hT=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),cE="remix-router-transitions",uE=Symbol("ResetLoaderData"),zl,vu,Di,wu,pT=class{constructor(e){h0(this,zl),h0(this,vu),h0(this,Di),h0(this,wu),ao(this,zl,e),ao(this,vu,bh(e))}get stableRoutes(){return da(this,zl)}get activeRoutes(){return da(this,Di)??da(this,zl)}get branches(){return da(this,wu)??da(this,vu)}get hasHMRRoutes(){return da(this,Di)!=null}setRoutes(e){ao(this,zl,e),ao(this,vu,bh(e))}setHmrRoutes(e){ao(this,Di,e),ao(this,wu,bh(e))}commitHmrRoutes(){da(this,Di)&&(ao(this,zl,da(this,Di)),ao(this,vu,da(this,wu)),ao(this,Di,void 0),ao(this,wu,void 0))}};zl=new WeakMap;vu=new WeakMap;Di=new WeakMap;wu=new WeakMap;function mT(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";cn(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],a=e.mapRouteProperties||hT,i=a;if(e.instrumentations){let re=e.instrumentations;i=ae=>({...a(ae),...tT(re.map(fe=>fe.route).filter(Boolean),ae)})}let l={},u=new pT(T0(e.routes,i,void 0,l)),f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let h=e.dataStrategy||bT,p={...e.future},g=null,v=new Set,w=null,b=null,y=null,k=null,S=e.hydrationData!=null,E=Oa(u.activeRoutes,e.history.location,f,!1,u.branches),j=!1,N=null,A,T;if(E==null&&!e.patchRoutesOnNavigation){let re=ha(404,{pathname:e.history.location.pathname}),{matches:ae,route:fe}=z1(u.activeRoutes);A=!0,T=!A,E=ae,N={[fe.id]:re}}else if(E&&!e.hydrationData&&Qt(E,u.activeRoutes,e.history.location.pathname).active&&(E=null),E)if(E.some(re=>re.route.lazy))A=!1,T=!A;else if(!E.some(re=>j4(re.route)))A=!0,T=!A;else{let re=e.hydrationData?e.hydrationData.loaderData:null,ae=e.hydrationData?e.hydrationData.errors:null,fe=E;if(ae){let Te=E.findIndex(Ue=>ae[Ue.route.id]!==void 0);fe=fe.slice(0,Te+1)}T=!1,A=!0,fe.forEach(Te=>{let Ue=dE(Te.route,re,ae);T=T||Ue.renderFallback,A=A&&!Ue.shouldLoad})}else{A=!1,T=!A,E=[];let re=Qt(null,u.activeRoutes,e.history.location.pathname);re.active&&re.matches&&(j=!0,E=re.matches)}let P,C={historyAction:e.history.action,location:e.history.location,matches:E,initialized:A,renderFallback:T,navigation:kg,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||N,fetchers:new Map,blockers:new Map},R="POP",$=null,H=!1,D,q=!1,_=new Map,U=null,Y=!1,I=!1,F=new Set,O=new Map,Z=0,V=-1,B=new Map,K=new Set,ee=new Map,se=new Map,oe=new Set,me=new Map,ce,we=null;function G(){if(g=e.history.listen(({action:re,location:ae,delta:fe})=>{if(ce){ce(),ce=void 0;return}er(me.size===0||fe!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Te=Nt({currentLocation:C.location,nextLocation:ae,historyAction:re});if(Te&&fe!=null){let Ue=new Promise(ut=>{ce=ut});e.history.go(fe*-1),kt(Te,{state:"blocked",location:ae,proceed(){kt(Te,{state:"proceeding",proceed:void 0,reset:void 0,location:ae}),Ue.then(()=>e.history.go(fe))},reset(){let ut=new Map(C.blockers);ut.set(Te,Qd),ne({blockers:ut})}}),$==null||$.resolve(),$=null;return}return Xe(re,ae)}),n){FT(t,_);let re=()=>_T(t,_);t.addEventListener("pagehide",re),U=()=>t.removeEventListener("pagehide",re)}return C.initialized||Xe("POP",C.location,{initialHydration:!0}),P}function ue(){g&&g(),U&&U(),v.clear(),D&&D.abort(),C.fetchers.forEach((re,ae)=>_e(C.fetchers,ae)),C.blockers.forEach((re,ae)=>St(ae))}function Ne(re){if(v.add(re),w){let{newErrors:ae}=w;w=null,re(C,{deletedFetchers:[],newErrors:ae,viewTransitionOpts:void 0,flushSync:!1})}return()=>v.delete(re)}function ne(re,ae={}){re.matches&&(re.matches=re.matches.map(Ue=>{let ut=l[Ue.route.id],gt=Ue.route;return gt.element!==ut.element||gt.errorElement!==ut.errorElement||gt.hydrateFallbackElement!==ut.hydrateFallbackElement?{...Ue,route:ut}:Ue})),C={...C,...re};let fe=[],Te=[];C.fetchers.forEach((Ue,ut)=>{Ue.state==="idle"&&(oe.has(ut)?fe.push(ut):Te.push(ut))}),oe.forEach(Ue=>{!C.fetchers.has(Ue)&&!O.has(Ue)&&fe.push(Ue)}),v.size===0&&(w={newErrors:re.errors??null}),[...v].forEach(Ue=>Ue(C,{deletedFetchers:fe,newErrors:re.errors??null,viewTransitionOpts:ae.viewTransitionOpts,flushSync:ae.flushSync===!0})),fe.forEach(Ue=>_e(C.fetchers,Ue)),Te.forEach(Ue=>C.fetchers.delete(Ue))}function Fe(re,ae,{flushSync:fe}={}){var Ce,xe;let Te=C.actionData!=null&&C.navigation.formMethod!=null&&ss(C.navigation.formMethod)&&C.navigation.state==="loading"&&((Ce=re.state)==null?void 0:Ce._isRedirect)!==!0,Ue;ae.actionData?Object.keys(ae.actionData).length>0?Ue=ae.actionData:Ue=null:Te?Ue=C.actionData:Ue=null;let ut=ae.loaderData?Zx(C.loaderData,ae.loaderData,ae.matches||[],ae.errors):C.loaderData,gt=C.blockers;gt.size>0&&(gt=new Map(gt),gt.forEach((et,yt)=>gt.set(yt,Qd)));let Pt=Y?!1:vn(re,ae.matches||C.matches),tt=H===!0||C.navigation.formMethod!=null&&ss(C.navigation.formMethod)&&((xe=re.state)==null?void 0:xe._isRedirect)!==!0;u.commitHmrRoutes(),Y||R==="POP"||(R==="PUSH"?e.history.push(re,re.state):R==="REPLACE"&&e.history.replace(re,re.state));let wt;if(R==="POP"){let et=_.get(C.location.pathname);et&&et.has(re.pathname)?wt={currentLocation:C.location,nextLocation:re}:_.has(re.pathname)&&(wt={currentLocation:re,nextLocation:C.location})}else if(q){let et=_.get(C.location.pathname);et?et.add(re.pathname):(et=new Set([re.pathname]),_.set(C.location.pathname,et)),wt={currentLocation:C.location,nextLocation:re}}ne({...ae,actionData:Ue,loaderData:ut,historyAction:R,location:re,initialized:!0,renderFallback:!1,navigation:kg,revalidation:"idle",restoreScrollPosition:Pt,preventScrollReset:tt,blockers:gt},{viewTransitionOpts:wt,flushSync:fe===!0}),R="POP",H=!1,q=!1,Y=!1,I=!1,$==null||$.resolve(),$=null,we==null||we.resolve(),we=null}async function Oe(re,ae){if($==null||$.resolve(),$=null,typeof re=="number"){$||($=Wx());let Q=$.promise;return e.history.go(re),Q}let fe=z8(C.location,C.matches,f,re,ae==null?void 0:ae.fromRouteId,ae==null?void 0:ae.relative),{path:Te,submission:Ue,error:ut}=$x(!1,fe,ae),gt;if(ae!=null&&ae.mask){let Q=typeof ae.mask=="string"?Ao(ae.mask):{...C.location.mask,...ae.mask};if(gt={pathname:Q.pathname??"",search:Q.search??"",hash:Q.hash??""},Ep.test(gt.pathname))throw new Error("External navigation is not allowed");gt.pathname.startsWith("\\")&&(gt.pathname=gt.pathname.replace(/^\\+/,"/")),Pu(typeof ae.mask=="string"?ae.mask:vs(ae.mask),vs(gt),e.history.createURL("/"),"reject")}let Pt=C.location,tt=$0(Pt,Te,ae&&ae.state,void 0,gt);tt={...tt,...e.history.encodeLocation(tt)},Pu(re==null?e.history.createHref(C.location):typeof re=="string"?re:vs(re),e.history.createHref(tt.mask||tt),e.history.createURL("/"),"reject");let wt=ae&&ae.replace!=null?ae.replace:void 0,Ce="PUSH";wt===!0?Ce="REPLACE":wt===!1||Ue!=null&&ss(Ue.formMethod)&&Ue.formAction===C.location.pathname+C.location.search&&(Ce="REPLACE");let xe=ae&&"preventScrollReset"in ae?ae.preventScrollReset===!0:void 0,et=(ae&&ae.flushSync)===!0,yt=Nt({currentLocation:Pt,nextLocation:tt,historyAction:Ce});if(yt){kt(yt,{state:"blocked",location:tt,proceed(){kt(yt,{state:"proceeding",proceed:void 0,reset:void 0,location:tt}),Oe(re,ae)},reset(){let Q=new Map(C.blockers);Q.set(yt,Qd),ne({blockers:Q})}});return}await Xe(Ce,tt,{submission:Ue,pendingError:ut,preventScrollReset:xe,replace:ae&&ae.replace,enableViewTransition:ae&&ae.viewTransition,flushSync:et,callSiteDefaultShouldRevalidate:ae&&ae.defaultShouldRevalidate})}function ot(){we||(we=Wx()),ze(),ne({revalidation:"loading"});let re=we.promise;return C.navigation.state==="submitting"?re:C.navigation.state==="idle"?(Xe(C.historyAction,C.location,{startUninterruptedRevalidation:!0}),re):(Xe(R||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation,enableViewTransition:q===!0}),re)}async function Xe(re,ae,fe){D&&D.abort(),D=null,R=re,Y=(fe&&fe.startUninterruptedRevalidation)===!0,ft(C.location,C.matches),H=(fe&&fe.preventScrollReset)===!0,q=(fe&&fe.enableViewTransition)===!0;let Te=u.activeRoutes,Ue=fe!=null&&fe.initialHydration&&C.matches&&C.matches.length>0&&!j?C.matches:Oa(Te,ae,f,!1,u.branches),ut=(fe&&fe.flushSync)===!0;if(Ue&&C.initialized&&!I&&MT(C.location,ae)&&!(fe&&fe.submission&&ss(fe.submission.formMethod))){Fe(ae,{matches:Ue},{flushSync:ut});return}let gt=Qt(Ue,Te,ae.pathname);if(gt.active&&gt.matches&&(Ue=gt.matches),!Ue){let{error:Ke,notFoundMatches:xt,route:st}=Bt(ae.pathname);Fe(ae,{matches:xt,loaderData:{},errors:{[st.id]:Ke}},{flushSync:ut});return}let Pt=fe&&fe.overrideNavigation?{...fe.overrideNavigation,matches:Ue,historyAction:re}:void 0;D=new AbortController;let tt=yu(e.history,ae,D.signal,fe&&fe.submission),wt=e.getContext?await e.getContext():new jx,Ce;if(fe&&fe.pendingError)Ce=[Vi(Ue).route.id,{type:"error",error:fe.pendingError}];else if(fe&&fe.submission&&ss(fe.submission.formMethod)){let Ke=await X(tt,ae,fe.submission,Ue,re,wt,gt.active,fe&&fe.initialHydration===!0,{replace:fe.replace,flushSync:ut});if(Ke.shortCircuited)return;if(Ke.pendingActionResult){let[xt,st]=Ke.pendingActionResult;if(Ks(st)&&D0(st.error)&&st.error.status===404){D=null,Fe(ae,{matches:Ke.matches,loaderData:{},errors:{[xt]:st.error}});return}}Ue=Ke.matches||Ue,Ce=Ke.pendingActionResult,Pt=Sg(ae,Ue,re,fe.submission),ut=!1,gt.active=!1,tt=yu(e.history,tt.url,tt.signal)}let{shortCircuited:xe,matches:et,loaderData:yt,errors:Q,workingFetchers:Pe}=await J(tt,ae,Ue,re,wt,gt.active,Pt,fe&&fe.submission,fe&&fe.fetcherSubmission,fe&&fe.replace,fe&&fe.initialHydration===!0,ut,Ce,fe&&fe.callSiteDefaultShouldRevalidate);xe||(D=null,Fe(ae,{matches:et||Ue,...zx(Ce),loaderData:yt,errors:Q,...Pe?{fetchers:Pe}:{}}))}async function X(re,ae,fe,Te,Ue,ut,gt,Pt,tt={}){ze();let wt=OT(ae,Te,Ue,fe);if(ne({navigation:wt},{flushSync:tt.flushSync===!0}),gt){let et=await on(Te,ae.pathname,re.signal);if(et.type==="aborted")return{shortCircuited:!0};if(et.type==="error"){if(et.partialMatches.length===0){let{matches:Q,route:Pe}=z1(u.activeRoutes);return{matches:Q,pendingActionResult:[Pe.id,{type:"error",error:et.error}]}}let yt=Vi(et.partialMatches).route.id;return{matches:et.partialMatches,pendingActionResult:[yt,{type:"error",error:et.error}]}}else if(et.matches)Te=et.matches;else{let{notFoundMatches:yt,error:Q,route:Pe}=Bt(ae.pathname);return{matches:yt,pendingActionResult:[Pe.id,{type:"error",error:Q}]}}}let Ce,xe=xh(Te,ae);if(!xe.route.action&&!xe.route.lazy)Ce={type:"error",error:ha(405,{method:re.method,pathname:ae.pathname,routeId:xe.route.id})};else{let et=Lu(i,l,re,ae,Te,xe,Pt?[]:r,ut),yt=await le(re,ae,et,ut,null);if(Ce=yt[xe.route.id],!Ce){for(let Q of Te)if(yt[Q.route.id]){Ce=yt[Q.route.id];break}}if(re.signal.aborted)return{shortCircuited:!0}}if(Ql(Ce)){let et;return tt&&tt.replace!=null?et=tt.replace:et=Fx(Ce.response.headers.get("Location"),new URL(re.url),f,e.history)===C.location.pathname+C.location.search,await te(re,Ce,!0,{submission:fe,replace:et}),{shortCircuited:!0}}if(Ks(Ce)){let et=Vi(Te,xe.route.id);return(tt&&tt.replace)!==!0&&(R="PUSH"),{matches:Te,pendingActionResult:[et.route.id,Ce,xe.route.id]}}return{matches:Te,pendingActionResult:[xe.route.id,Ce]}}async function J(re,ae,fe,Te,Ue,ut,gt,Pt,tt,wt,Ce,xe,et,yt){let Q=gt||Sg(ae,fe,Te,Pt),Pe=Pt||tt||Ux(Q),Ke=!Y&&!Ce;if(ut){if(Ke){let jt=ge(et);ne({navigation:Q,...jt!==void 0?{actionData:jt}:{}},{flushSync:xe})}let We=await on(fe,ae.pathname,re.signal);if(We.type==="aborted")return{shortCircuited:!0};if(We.type==="error"){if(We.partialMatches.length===0){let{matches:Ct,route:Dt}=z1(u.activeRoutes);return{matches:Ct,loaderData:{},errors:{[Dt.id]:We.error}}}let jt=Vi(We.partialMatches).route.id;return{matches:We.partialMatches,loaderData:{},errors:{[jt]:We.error}}}else if(We.matches)fe=We.matches;else{let{error:jt,notFoundMatches:Ct,route:Dt}=Bt(ae.pathname);return{matches:Ct,loaderData:{},errors:{[Dt.id]:jt}}}}let xt=u.activeRoutes,{dsMatches:st,revalidatingFetchers:Kt}=Tx(re,Ue,i,l,e.history,C,fe,Pe,ae,Ce?[]:r,Ce===!0,I,F,oe,ee,K,xt,f,e.patchRoutesOnNavigation!=null,u.branches,et,yt);if(V=++Z,!e.dataStrategy&&!st.some(We=>We.shouldLoad)&&!st.some(We=>We.route.middleware&&We.route.middleware.length>0)&&Kt.length===0){let We=new Map(C.fetchers),jt=He(We);return Fe(ae,{matches:fe,loaderData:{},errors:et&&Ks(et[1])?{[et[0]]:et[1].error}:null,...zx(et),...jt?{fetchers:We}:{}},{flushSync:xe}),{shortCircuited:!0}}if(Ke){let We={};if(!ut){We.navigation=Q;let jt=ge(et);jt!==void 0&&(We.actionData=jt)}Kt.length>0&&(We.fetchers=ve(Kt)),ne(We,{flushSync:xe})}Kt.forEach(We=>{Et(We.key),We.controller&&O.set(We.key,We.controller)});let mn=()=>Kt.forEach(We=>Et(We.key));D&&D.signal.addEventListener("abort",mn);let{loaderResults:$e,fetcherResults:Ae}=await Me(st,Kt,re,ae,Ue);if(re.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener("abort",mn),Kt.forEach(We=>O.delete(We.key));let nt=B1($e);if(nt)return await te(re,nt.result,!0,{replace:wt}),{shortCircuited:!0};if(nt=B1(Ae),nt)return K.add(nt.key),await te(re,nt.result,!0,{replace:wt}),{shortCircuited:!0};let Ge=new Map(C.fetchers),{loaderData:Tt,errors:W}=Vx(C,fe,$e,et,Kt,Ae,Ge);Ce&&C.errors&&(W={...C.errors,...W});let he=He(Ge),pe=mt(V,Ge),qe=he||pe||Kt.length>0;return{matches:fe,loaderData:Tt,errors:W,...qe?{workingFetchers:Ge}:{}}}function ge(re){if(re&&!Ks(re[1]))return{[re[0]]:re[1].data};if(C.actionData)return Object.keys(C.actionData).length===0?null:C.actionData}function ve(re){let ae=new Map(C.fetchers);return re.forEach(fe=>{let Te=ae.get(fe.key),Ue=Jd(void 0,Te?Te.data:void 0);ae.set(fe.key,Ue)}),ae}async function Ze(re,ae,fe,Te){Et(re);let Ue=(Te&&Te.flushSync)===!0,ut=u.activeRoutes,gt=z8(C.location,C.matches,f,fe,ae,Te==null?void 0:Te.relative),Pt=Oa(ut,gt,f,!1,u.branches),tt=Qt(Pt,ut,gt);if(tt.active&&tt.matches&&(Pt=tt.matches),!Pt){Be(re,ae,ha(404,{pathname:gt}),{flushSync:Ue});return}let{path:wt,submission:Ce,error:xe}=$x(!0,gt,Te);if(xe){Be(re,ae,xe,{flushSync:Ue});return}let et=e.getContext?await e.getContext():new jx,yt=(Te&&Te.preventScrollReset)===!0;if(Ce&&ss(Ce.formMethod)){await Ye(re,ae,wt,Pt,et,tt.active,Ue,yt,Ce,Te&&Te.defaultShouldRevalidate);return}ee.set(re,{routeId:ae,path:wt}),await ke(re,ae,wt,Pt,et,tt.active,Ue,yt,Ce)}async function Ye(re,ae,fe,Te,Ue,ut,gt,Pt,tt,wt){ze(),ee.delete(re);let Ce=C.fetchers.get(re);Re(re,IT(tt,Ce),{flushSync:gt});let xe=new AbortController,et=yu(e.history,fe,xe.signal,tt);if(ut){let nn=await on(Te,new URL(et.url).pathname,et.signal,re);if(nn.type==="aborted")return;if(nn.type==="error"){Be(re,ae,nn.error,{flushSync:gt});return}else if(nn.matches)Te=nn.matches;else{Be(re,ae,ha(404,{pathname:fe}),{flushSync:gt});return}}let yt=xh(Te,fe);if(!yt.route.action&&!yt.route.lazy){let nn=ha(405,{method:tt.formMethod,pathname:fe,routeId:ae});Be(re,ae,nn,{flushSync:gt});return}O.set(re,xe);let Q=Z,Pe=Lu(i,l,et,fe,Te,yt,r,Ue),Ke=await le(et,fe,Pe,Ue,re),xt=Ke[yt.route.id];if(!xt){for(let nn of Pe)if(Ke[nn.route.id]){xt=Ke[nn.route.id];break}}if(et.signal.aborted){O.get(re)===xe&&O.delete(re);return}if(oe.has(re)){if(Ql(xt)||Ks(xt)){Re(re,co(void 0));return}}else{if(Ql(xt))if(O.delete(re),V>Q){Re(re,co(void 0));return}else return K.add(re),Re(re,Jd(tt)),te(et,xt,!1,{fetcherSubmission:tt,preventScrollReset:Pt});if(Ks(xt)){Be(re,ae,xt.error);return}}let st=C.navigation.location||C.location,Kt=yu(e.history,st,xe.signal),mn=u.activeRoutes,$e=C.navigation.state!=="idle"?Oa(mn,C.navigation.location,f,!1,u.branches):C.matches;cn($e,"Didn't find any matches after fetcher action");let Ae=++Z;B.set(re,Ae);let{dsMatches:nt,revalidatingFetchers:Ge}=Tx(Kt,Ue,i,l,e.history,C,$e,tt,st,r,!1,I,F,oe,ee,K,mn,f,e.patchRoutesOnNavigation!=null,u.branches,[yt.route.id,xt],wt),Tt=Jd(tt,xt.data),W=new Map(C.fetchers);W.set(re,Tt),Ge.filter(nn=>nn.key!==re).forEach(nn=>{let Ut=nn.key,pr=W.get(Ut),Nn=Jd(void 0,pr?pr.data:void 0);W.set(Ut,Nn),Et(Ut),nn.controller&&O.set(Ut,nn.controller)}),ne({fetchers:W});let he=()=>Ge.forEach(nn=>Et(nn.key));xe.signal.addEventListener("abort",he);let{loaderResults:pe,fetcherResults:qe}=await Me(nt,Ge,Kt,st,Ue);if(xe.signal.aborted)return;xe.signal.removeEventListener("abort",he),B.delete(re),O.delete(re),Ge.forEach(nn=>O.delete(nn.key));let We=C.fetchers.has(re),jt=nn=>{if(!We)return nn;let Ut=new Map(nn.fetchers);return Ut.set(re,co(xt.data)),{...nn,fetchers:Ut}},Ct=B1(pe);if(Ct)return C=jt(C),te(Kt,Ct.result,!1,{preventScrollReset:Pt});if(Ct=B1(qe),Ct)return K.add(Ct.key),C=jt(C),te(Kt,Ct.result,!1,{preventScrollReset:Pt});let Dt=new Map(C.fetchers);We&&Dt.set(re,co(xt.data));let{loaderData:qt,errors:Zn}=Vx(C,$e,pe,void 0,Ge,qe,Dt);mt(Ae,Dt),C.navigation.state==="loading"&&Ae>V?(cn(R,"Expected pending action"),D&&D.abort(),Fe(C.navigation.location,{matches:$e,loaderData:qt,errors:Zn,fetchers:Dt})):(ne({errors:Zn,loaderData:Zx(C.loaderData,qt,$e,Zn),fetchers:Dt}),I=!1)}async function ke(re,ae,fe,Te,Ue,ut,gt,Pt,tt){let wt=C.fetchers.get(re);Re(re,Jd(tt,wt?wt.data:void 0),{flushSync:gt});let Ce=new AbortController,xe=yu(e.history,fe,Ce.signal);if(ut){let xt=await on(Te,new URL(xe.url).pathname,xe.signal,re);if(xt.type==="aborted")return;if(xt.type==="error"){Be(re,ae,xt.error,{flushSync:gt});return}else if(xt.matches)Te=xt.matches;else{Be(re,ae,ha(404,{pathname:fe}),{flushSync:gt});return}}let et=xh(Te,fe);O.set(re,Ce);let yt=Z,Q=Lu(i,l,xe,fe,Te,et,r,Ue),Pe=await le(xe,fe,Q,Ue,re),Ke=Pe[et.route.id];if(!Ke){for(let xt of Te)if(Pe[xt.route.id]){Ke=Pe[xt.route.id];break}}if(O.get(re)===Ce&&O.delete(re),!xe.signal.aborted){if(oe.has(re)){Re(re,co(void 0));return}if(Ql(Ke))if(V>yt){Re(re,co(void 0));return}else{K.add(re),await te(xe,Ke,!1,{preventScrollReset:Pt});return}if(Ks(Ke)){Be(re,ae,Ke.error);return}Re(re,co(Ke.data))}}async function te(re,ae,fe,{submission:Te,fetcherSubmission:Ue,preventScrollReset:ut,replace:gt}={}){fe||($==null||$.resolve(),$=null),ae.response.headers.has("X-Remix-Revalidate")&&(I=!0);let Pt=ae.response.headers.get("Location");cn(Pt,"Expected a Location header on the redirect Response");let tt=Pt,wt=new URL(re.url);Pt=Fx(Pt,wt,f,e.history),Pu(tt,Pt,wt,"allow-explicit");let Ce=$0(C.location,Pt,{_isRedirect:!0});if(n){let Ke=!1;if(ae.response.headers.has("X-Remix-Reload-Document"))Ke=!0;else if(S4(Pt)){const xt=YS(t,Pt,!0);Ke=xt.origin!==t.location.origin||Xs(xt.pathname,f)==null}if(Ke){gt?t.location.replace(Pt):t.location.assign(Pt);return}}D=null;let xe=gt===!0||ae.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:et,formAction:yt,formEncType:Q}=C.navigation;!Te&&!Ue&&et&&yt&&Q&&(Te=Ux(C.navigation));let Pe=Te||Ue;if(dT.has(ae.response.status)&&Pe&&ss(Pe.formMethod))await Xe(xe,Ce,{submission:{...Pe,formAction:Pt},preventScrollReset:ut||H,enableViewTransition:fe?q:void 0});else{let Ke=Sg(Ce,[],xe,Te);await Xe(xe,Ce,{overrideNavigation:Ke,fetcherSubmission:Ue,preventScrollReset:ut||H,enableViewTransition:fe?q:void 0})}}async function le(re,ae,fe,Te,Ue){var Pt;let ut,gt={};try{ut=await kT(h,re,ae,fe,Ue,Te,!1)}catch(tt){return fe.filter(wt=>wt.shouldLoad).forEach(wt=>{gt[wt.route.id]={type:"error",error:tt}}),gt}if(re.signal.aborted)return gt;if(!ss(re.method))for(let tt of fe){if(((Pt=ut[tt.route.id])==null?void 0:Pt.type)==="error")break;!ut.hasOwnProperty(tt.route.id)&&!C.loaderData.hasOwnProperty(tt.route.id)&&(!C.errors||!C.errors.hasOwnProperty(tt.route.id))&&tt.shouldCallHandler()&&(ut[tt.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${tt.route.id}`)})}for(let[tt,wt]of Object.entries(ut))if($T(wt)){let Ce=wt.result;gt[tt]={type:"redirect",response:jT(Ce,re,tt,fe,f)}}else gt[tt]=await CT(wt);return gt}async function Me(re,ae,fe,Te,Ue){let ut=le(fe,Te,re,Ue,null),gt=Promise.all(ae.map(async wt=>{if(wt.matches&&wt.match&&wt.request&&wt.controller){let xe=(await le(wt.request,wt.path,wt.matches,Ue,wt.key))[wt.match.route.id];return{[wt.key]:xe}}else return Promise.resolve({[wt.key]:{type:"error",error:ha(404,{pathname:wt.path})}})})),Pt=await ut,tt=(await gt).reduce((wt,Ce)=>Object.assign(wt,Ce),{});return{loaderResults:Pt,fetcherResults:tt}}function ze(){I=!0,ee.forEach((re,ae)=>{O.has(ae)&&F.add(ae),Et(ae)})}function Re(re,ae,fe={}){let Te=new Map(C.fetchers);Te.set(re,ae),ne({fetchers:Te},{flushSync:(fe&&fe.flushSync)===!0})}function Be(re,ae,fe,Te={}){let Ue=Vi(C.matches,ae),ut=new Map(C.fetchers);_e(ut,re),ne({errors:{[Ue.route.id]:fe},fetchers:ut},{flushSync:(Te&&Te.flushSync)===!0})}function Qe(re){return se.set(re,(se.get(re)||0)+1),oe.has(re)&&oe.delete(re),C.fetchers.get(re)||fT}function rt(re,ae){Et(re,ae==null?void 0:ae.reason),Re(re,co(null))}function _e(re,ae){let fe=C.fetchers.get(ae);O.has(ae)&&!(fe&&fe.state==="loading"&&B.has(ae))&&Et(ae),ee.delete(ae),B.delete(ae),K.delete(ae),oe.delete(ae),F.delete(ae),re.delete(ae)}function zt(re){let ae=(se.get(re)||0)-1;ae<=0?(se.delete(re),oe.add(re)):se.set(re,ae),ne({fetchers:new Map(C.fetchers)})}function Et(re,ae){let fe=O.get(re);fe&&(fe.abort(ae),O.delete(re))}function Zt(re,ae){for(let fe of re){let Te=ae.get(fe);cn(Te,`Expected fetcher: ${fe}`);let Ue=co(Te.data);ae.set(fe,Ue)}}function He(re){let ae=[],fe=!1;for(let Te of K){let Ue=re.get(Te);cn(Ue,`Expected fetcher: ${Te}`),Ue.state==="loading"&&(K.delete(Te),ae.push(Te),fe=!0)}return Zt(ae,re),fe}function mt(re,ae){let fe=[];for(let[Te,Ue]of B)if(Ue<re){let ut=ae.get(Te);cn(ut,`Expected fetcher: ${Te}`),ut.state==="loading"&&(Et(Te),B.delete(Te),fe.push(Te))}return Zt(fe,ae),fe.length>0}function vt(re,ae){let fe=C.blockers.get(re)||Qd;return me.get(re)!==ae&&me.set(re,ae),fe}function St(re){C.blockers.delete(re),me.delete(re)}function kt(re,ae){let fe=C.blockers.get(re)||Qd;cn(fe.state==="unblocked"&&ae.state==="blocked"||fe.state==="blocked"&&ae.state==="blocked"||fe.state==="blocked"&&ae.state==="proceeding"||fe.state==="blocked"&&ae.state==="unblocked"||fe.state==="proceeding"&&ae.state==="unblocked",`Invalid blocker state transition: ${fe.state} -> ${ae.state}`);let Te=new Map(C.blockers);Te.set(re,ae),ne({blockers:Te})}function Nt({currentLocation:re,nextLocation:ae,historyAction:fe}){if(me.size===0)return;me.size>1&&er(!1,"A router only supports one blocker at a time");let Te=Array.from(me.entries()),[Ue,ut]=Te[Te.length-1],gt=C.blockers.get(Ue);if(!(gt&&gt.state==="proceeding")&&ut({currentLocation:re,nextLocation:ae,historyAction:fe}))return Ue}function Bt(re){let ae=ha(404,{pathname:re}),fe=u.activeRoutes,{matches:Te,route:Ue}=z1(fe);return{notFoundMatches:Te,route:Ue,error:ae}}function at(re,ae,fe){if(b=re,k=ae,y=fe||null,!S&&C.navigation===kg){S=!0;let Te=vn(C.location,C.matches);Te!=null&&ne({restoreScrollPosition:Te})}return()=>{b=null,k=null,y=null}}function Mt(re,ae){return y&&y(re,ae.map(Te=>XS(Te,C.loaderData)))||re.key}function ft(re,ae){if(b&&k){let fe=Mt(re,ae);b[fe]=k()}}function vn(re,ae){if(b){let fe=Mt(re,ae),Te=b[fe];if(typeof Te=="number")return Te}return null}function Qt(re,ae,fe){if(e.patchRoutesOnNavigation){let Te=u.branches;if(re){if(Object.keys(re[0].params).length>0)return{active:!0,matches:Oa(ae,fe,f,!0,Te)}}else return{active:!0,matches:Oa(ae,fe,f,!0,Te)||[]}}return{active:!1,matches:null}}async function on(re,ae,fe,Te){if(!e.patchRoutesOnNavigation)return{type:"success",matches:re};let Ue=re;for(;;){let ut=l;try{await e.patchRoutesOnNavigation({signal:fe,path:ae,matches:Ue,fetcherKey:Te,patch:(wt,Ce)=>{fe.aborted||Dx(wt,Ce,u,ut,i,!1)}})}catch(wt){return{type:"error",error:wt,partialMatches:Ue}}if(fe.aborted)return{type:"aborted"};let gt=u.branches,Pt=Oa(u.activeRoutes,ae,f,!1,gt),tt=null;if(Pt){if(Object.keys(Pt[0].params).length===0)return{type:"success",matches:Pt};if(tt=Oa(u.activeRoutes,ae,f,!0,gt),!(tt&&Ue.length<tt.length&&Rt(Ue,tt.slice(0,Ue.length))))return{type:"success",matches:Pt}}if(tt||(tt=Oa(u.activeRoutes,ae,f,!0,gt)),!tt||Rt(Ue,tt))return{type:"success",matches:null};Ue=tt}}function Rt(re,ae){return re.length===ae.length&&re.every((fe,Te)=>fe.route.id===ae[Te].route.id)}function An(re){l={},u.setHmrRoutes(T0(re,i,void 0,l))}function Vt(re,ae,fe=!1){Dx(re,ae,u,l,i,fe),u.hasHMRRoutes||ne({})}return P={get basename(){return f},get future(){return p},get state(){return C},get routes(){return u.stableRoutes},get branches(){return u.branches},get manifest(){return l},get window(){return t},initialize:G,subscribe:Ne,enableScrollRestoration:at,navigate:Oe,fetch:Ze,revalidate:ot,createHref:re=>e.history.createHref(re),createURL:re=>e.history.createURL(re),encodeLocation:re=>e.history.encodeLocation(re),getFetcher:Qe,resetFetcher:rt,deleteFetcher:zt,dispose:ue,getBlocker:vt,deleteBlocker:St,patchRoutes:Vt,_internalFetchControllers:O,_internalSetRoutes:An,_internalSetStateDoNotUseOrYouWillBreakYourApp(re){ne(re)}},e.instrumentations&&(P=nT(P,e.instrumentations.map(re=>re.router).filter(Boolean))),P}function gT(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function z8(e,t,n,r,a,i){let l,u;if(a){l=[];for(let h of t)if(l.push(h),h.route.id===a){u=h;break}}else l=t,u=t[t.length-1];let f=of(r||".",Cp(l),Xs(e.pathname,n)||e.pathname,i==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&u){let h=N4(f.search);if(u.route.index&&!h)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&h){let p=new URLSearchParams(f.search),g=p.getAll("index");p.delete("index"),g.filter(w=>w).forEach(w=>p.append("index",w));let v=p.toString();f.search=v?`?${v}`:""}}return n!=="/"&&(f.pathname=Y$({basename:n,pathname:f.pathname})),vs(f)}function $x(e,t,n){if(!n||!gT(n))return{path:t};if(n.formMethod&&!HT(n.formMethod))return{path:t,error:ha(405,{method:n.formMethod})};let r=()=>({path:t,error:ha(400,{type:"invalid-body"})}),i=(n.formMethod||"get").toUpperCase(),l=wE(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!ss(i))return r();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((v,[w,b])=>`${v}${w}=${b}
50
+ `,""):String(n.body);return{path:t,submission:{formMethod:i,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!ss(i))return r();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:l,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return r()}}}cn(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=W8(n.formData),f=n.formData;else if(n.body instanceof FormData)u=W8(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=_x(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=_x(u)}catch{return r()}let h={formMethod:i,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(ss(h.formMethod))return{path:t,submission:h};let p=Ao(t);return e&&p.search&&N4(p.search)&&u.append("index",""),p.search=`?${u}`,{path:vs(p),submission:h}}function Tx(e,t,n,r,a,i,l,u,f,h,p,g,v,w,b,y,k,S,E,j,N,A){var Y;let T=N?Ks(N[1])?N[1].error:N[1].data:void 0,P=a.createURL(i.location),C=a.createURL(f),R;if(p&&i.errors){let I=Object.keys(i.errors)[0];R=l.findIndex(F=>F.route.id===I)}else if(N&&Ks(N[1])){let I=N[0];R=l.findIndex(F=>F.route.id===I)-1}let $=N?N[1].statusCode:void 0,H=$&&$>=400,D={currentUrl:P,currentParams:((Y=i.matches[0])==null?void 0:Y.params)||{},nextUrl:C,nextParams:l[0].params,...u,actionResult:T,actionStatus:$},q=cf(l),_=l.map((I,F)=>{let{route:O}=I,Z=null;if(R!=null&&F>R)Z=!1;else if(O.lazy)Z=!0;else if(!j4(O))Z=!1;else if(p){let{shouldLoad:ee}=dE(O,i.loaderData,i.errors);Z=ee}else vT(i.loaderData,i.matches[F],I)&&(Z=!0);if(Z!==null)return B8(n,r,e,f,q,I,h,t,Z);let V=!1;typeof A=="boolean"?V=A:H?V=!1:(g||P.pathname+P.search===C.pathname+C.search||P.search!==C.search||wT(i.matches[F],I))&&(V=!0);let B={...D,defaultShouldRevalidate:V},K=E0(I,B);return B8(n,r,e,f,q,I,h,t,K,B,A)}),U=[];return b.forEach((I,F)=>{if(p||!l.some(oe=>oe.route.id===I.routeId)||w.has(F))return;let O=i.fetchers.get(F),Z=O&&O.state!=="idle"&&O.data===void 0,V=Oa(k,I.path,S??"/",!1,j);if(!V){if(E&&Z)return;U.push({key:F,routeId:I.routeId,path:I.path,matches:null,match:null,request:null,controller:null});return}if(y.has(F))return;let B=xh(V,I.path),K=new AbortController,ee=yu(a,I.path,K.signal),se=null;if(v.has(F))v.delete(F),se=Lu(n,r,ee,I.path,V,B,h,t);else if(Z)g&&(se=Lu(n,r,ee,I.path,V,B,h,t));else{let oe;typeof A=="boolean"?oe=A:H?oe=!1:oe=g;let me={...D,defaultShouldRevalidate:oe};E0(B,me)&&(se=Lu(n,r,ee,I.path,V,B,h,t,me))}se&&U.push({key:F,routeId:I.routeId,path:I.path,matches:se,match:B,request:ee,controller:K})}),{dsMatches:_,revalidatingFetchers:U}}function j4(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function dE(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!j4(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,a=n!=null&&n[e.id]!==void 0;if(!r&&a)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let i=!r&&!a;return{shouldLoad:i,renderFallback:i}}function vT(e,t,n){let r=!t||n.route.id!==t.route.id,a=!e.hasOwnProperty(n.route.id);return r||a}function wT(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function E0(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function Dx(e,t,n,r,a,i){let l;if(e){let h=r[e];cn(h,`No route found to patch children into: routeId = ${e}`),h.children||(h.children=[]),l=h.children}else l=n.activeRoutes;let u=[],f=[];if(t.forEach(h=>{let p=l.find(g=>fE(h,g));p?f.push({existingRoute:p,newRoute:h}):u.push(h)}),u.length>0){let h=T0(u,a,[e||"_","patch",String((l==null?void 0:l.length)||"0")],r);l.push(...h)}if(i&&f.length>0)for(let h=0;h<f.length;h++){let{existingRoute:p,newRoute:g}=f[h],v=p,[w]=T0([g],a,[],{},!0);Object.assign(v,{element:w.element?w.element:v.element,errorElement:w.errorElement?w.errorElement:v.errorElement,hydrateFallbackElement:w.hydrateFallbackElement?w.hydrateFallbackElement:v.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function fE(e,t){var n;return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:((n=e.children)==null?void 0:n.every((r,a)=>{var i;return(i=t.children)==null?void 0:i.some(l=>fE(r,l))}))??!1:!1}var Hx=new WeakMap,hE=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let a=n[t.id];if(cn(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let i=a.lazy[e];if(!i)return;let l=Hx.get(a);l||(l={},Hx.set(a,l));let u=l[e];if(u)return u;let f=(async()=>{let h=D$(e),g=a[e]!==void 0&&e!=="hasErrorBoundary";if(h)er(!h,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(g)er(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let v=await i();v!=null&&(Object.assign(a,{[e]:v}),Object.assign(a,r(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(v=>v===void 0)&&(a.lazy=void 0))})();return l[e]=f,f},Ox=new WeakMap;function yT(e,t,n,r,a){let i=n[e.id];if(cn(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let p=Ox.get(i);if(p)return{lazyRoutePromise:p,lazyHandlerPromise:p};let g=(async()=>{cn(typeof e.lazy=="function","No lazy route function found");let v=await e.lazy(),w={};for(let b in v){let y=v[b];if(y===void 0)continue;let k=O$(b),E=i[b]!==void 0&&b!=="hasErrorBoundary";k?er(!k,"Route property "+b+" is not a supported property to be returned from a lazy route function. This property will be ignored."):E?er(!E,`Route "${i.id}" has a static property "${b}" defined but its lazy function is also returning a value for this property. The lazy route property "${b}" will be ignored.`):w[b]=y}Object.assign(i,w),Object.assign(i,{...r(i),lazy:void 0})})();return Ox.set(i,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let l=Object.keys(e.lazy),u=[],f;for(let p of l){if(a&&a.includes(p))continue;let g=hE({key:p,route:e,manifest:n,mapRouteProperties:r});g&&(u.push(g),p===t&&(f=g))}let h=u.length>0?Promise.all(u).then(()=>{}):void 0;return h==null||h.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:f}}async function Ix(e){let t=e.matches.filter(a=>a.shouldLoad),n={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,i)=>{n[t[i].route.id]=a}),n}async function bT(e){return e.matches.some(t=>t.route.middleware)?pE(e,()=>Ix(e)):Ix(e)}function pE(e,t){return xT(e,t,r=>{if(DT(r))throw r;return r},PT,n);function n(r,a,i){if(i)return Promise.resolve(Object.assign(i.value,{[a]:{type:"error",result:r}}));{let{matches:l}=e,u=Math.min(Math.max(l.findIndex(h=>h.route.id===a),0),Math.max(l.findIndex(h=>h.shouldCallHandler()),0)),f=Vi(l,l[u].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function xT(e,t,n,r,a){let{matches:i,...l}=e,u=i.flatMap(h=>h.route.middleware?h.route.middleware.map(p=>[h.route.id,p]):[]);return await mE(l,u,t,n,r,a)}async function mE(e,t,n,r,a,i,l=0){let{request:u}=e;if(u.signal.aborted)throw u.signal.reason??new Error(`Request aborted: ${u.method} ${u.url}`);let f=t[l];if(!f)return await n();let[h,p]=f,g,v=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await mE(e,t,n,r,a,i,l+1)},g.value}catch(w){return g={value:await i(w,h,g)},g.value}};try{let w=await p(e,v),b=w!=null?r(w):void 0;return a(b)?b:g?b??g.value:(g={value:await v()},g.value)}catch(w){return await i(w,h,g)}}function gE(e,t,n,r,a){let i=hE({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),l=yT(r.route,ss(n.method)?"action":"loader",t,e,a);return{middleware:i,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function B8(e,t,n,r,a,i,l,u,f,h=null,p){let g=!1,v=gE(e,t,n,i,l);return{...i,_lazyPromises:v,shouldLoad:f,shouldRevalidateArgs:h,shouldCallHandler(w){return g=!0,h?typeof p=="boolean"?E0(i,{...h,defaultShouldRevalidate:p}):typeof w=="boolean"?E0(i,{...h,defaultShouldRevalidate:w}):E0(i,h):f},resolve(w){let{lazy:b,loader:y,middleware:k}=i.route,S=g||f||w&&!ss(n.method)&&(b||y),E=k&&k.length>0&&!y&&!b;return S&&(ss(n.method)||!E)?ST({request:n,path:r,pattern:a,match:i,lazyHandlerPromise:v==null?void 0:v.handler,lazyRoutePromise:v==null?void 0:v.route,handlerOverride:w,scopedContext:u}):Promise.resolve({type:"data",result:void 0})}}}function Lu(e,t,n,r,a,i,l,u,f=null){return a.map(h=>h.route.id!==i.route.id?{...h,shouldLoad:!1,shouldRevalidateArgs:f,shouldCallHandler:()=>!1,_lazyPromises:gE(e,t,n,h,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:B8(e,t,n,r,cf(a),h,l,u,!0,f))}async function kT(e,t,n,r,a,i,l){r.some(p=>{var g;return(g=p._lazyPromises)==null?void 0:g.middleware})&&await Promise.all(r.map(p=>{var g;return(g=p._lazyPromises)==null?void 0:g.middleware}));let u={request:t,url:vE(t,n),pattern:cf(r),params:r[0].params,context:i,matches:r},h=await e({...u,fetcherKey:a,runClientMiddleware:p=>{let g=u;return pE(g,()=>p({...g,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(p=>{var g,v;return[(g=p._lazyPromises)==null?void 0:g.handler,(v=p._lazyPromises)==null?void 0:v.route]}))}catch{}return h}async function ST({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:a,lazyRoutePromise:i,handlerOverride:l,scopedContext:u}){let f,h,p=ss(e.method),g=p?"action":"loader",v=w=>{let b,y=new Promise((E,j)=>b=j);h=()=>b(),e.signal.addEventListener("abort",h);let k=E=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${r.route.id}]`)):w({request:e,url:vE(e,t),pattern:n,params:r.params,context:u},...E!==void 0?[E]:[]),S=(async()=>{try{return{type:"data",result:await(l?l(j=>k(j)):k())}}catch(E){return{type:"error",result:E}}})();return Promise.race([S,y])};try{let w=p?r.route.action:r.route.loader;if(a||i)if(w){let b,[y]=await Promise.all([v(w).catch(k=>{b=k}),a,i]);if(b!==void 0)throw b;f=y}else{await a;let b=p?r.route.action:r.route.loader;if(b)[f]=await Promise.all([v(b),i]);else if(g==="action"){let y=new URL(e.url),k=y.pathname+y.search;throw ha(405,{method:e.method,pathname:k,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(w)f=await v(w);else{let b=new URL(e.url),y=b.pathname+b.search;throw ha(404,{pathname:y})}}catch(w){return{type:"error",result:w}}finally{h&&e.signal.removeEventListener("abort",h)}return f}async function ET(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function CT(e){var r,a,i,l,u;let{result:t,type:n}=e;if(A4(t)){let f;try{f=await ET(t)}catch(h){return{type:"error",error:h}}return n==="error"?{type:"error",error:new lf(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:"data",data:f,statusCode:t.status,headers:t.headers}}return n==="error"?Bx(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:RT(t),statusCode:D0(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:D0(t)?t.status:void 0}:Bx(t)?{type:"data",data:t.data,statusCode:(l=t.init)==null?void 0:l.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function jT(e,t,n,r,a){let i=e.headers.get("Location");if(cn(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!S4(i)){let l=r.slice(0,r.findIndex(u=>u.route.id===n)+1);i=z8(new URL(t.url),l,a,i),e.headers.set("Location",i)}return e}var AT=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function U8(e){try{return AT.includes(new URL(e).protocol)}catch{return!1}}function Fx(e,t,n,r){if(S4(e)){let a=e,i=Ep.test(a)?new URL(GS(a,t.protocol)):new URL(a);if(U8(i.toString()))throw new Error("Invalid redirect location");let l=Xs(i.pathname,n)!=null;if(i.origin===t.origin&&l)return E4(i.pathname)+i.search+i.hash}try{let a=r.createURL(e);if(U8(a.toString()))throw new Error("Invalid redirect location")}catch{}return e}function yu(e,t,n,r){let a=e.createURL(wE(t)).toString(),i={signal:n};if(r&&ss(r.formMethod)){let{formMethod:l,formEncType:u}=r;i.method=l.toUpperCase(),u==="application/json"?(i.headers=new Headers({"Content-Type":u}),i.body=JSON.stringify(r.json)):u==="text/plain"?i.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?i.body=W8(r.formData):i.body=r.formData}return new Request(a,i)}function vE(e,t){let n=new URL(e.url),r=typeof t=="string"?Ao(t):t;if(n.pathname=r.pathname||"/",r.search){let a=new URLSearchParams(r.search),i=a.getAll("index");a.delete("index");for(let l of i.filter(Boolean))a.append("index",l);n.search=a.size?`?${a.toString()}`:""}else n.search="";return n.hash=r.hash||"",n}function W8(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function _x(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function NT(e,t,n,r=!1,a=!1){let i={},l=null,u,f=!1,h={},p=n&&Ks(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let v=g.route.id,w=t[v];if(cn(!Ql(w),"Cannot handle redirect results in processLoaderData"),Ks(w)){let b=w.error;if(p!==void 0&&(b=p,p=void 0),l=l||{},a)l[v]=b;else{let y=Vi(e,v);l[y.route.id]==null&&(l[y.route.id]=b)}r||(i[v]=uE),f||(f=!0,u=D0(w.error)?w.error.status:500),w.headers&&(h[v]=w.headers)}else i[v]=w.data,w.statusCode&&w.statusCode!==200&&!f&&(u=w.statusCode),w.headers&&(h[v]=w.headers)}),p!==void 0&&n&&(l={[n[0]]:p},n[2]&&(i[n[2]]=void 0)),{loaderData:i,errors:l,statusCode:u||200,loaderHeaders:h}}function Vx(e,t,n,r,a,i,l){let{loaderData:u,errors:f}=NT(t,n,r);return a.filter(h=>!h.matches||h.matches.some(p=>p.shouldLoad)).forEach(h=>{let{key:p,match:g,controller:v}=h;if(v&&v.signal.aborted)return;let w=i[p];if(cn(w,"Did not find corresponding fetcher result"),Ks(w)){let b=Vi(e.matches,g==null?void 0:g.route.id);f&&f[b.route.id]||(f={...f,[b.route.id]:w.error}),l.delete(p)}else if(Ql(w))cn(!1,"Unhandled fetcher revalidation redirect");else{let b=co(w.data);l.set(p,b)}}),{loaderData:u,errors:f}}function Zx(e,t,n,r){let a=Object.entries(t).filter(([,i])=>i!==uE).reduce((i,[l,u])=>(i[l]=u,i),{});for(let i of n){let l=i.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&i.route.loader&&(a[l]=e[l]),r&&r.hasOwnProperty(l))break}return a}function zx(e){return e?Ks(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Vi(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function z1(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function ha(e,{pathname:t,routeId:n,method:r,type:a,message:i}={}){let l="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(l="Bad Request",r&&t&&n?u=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:a==="invalid-body"&&(u="Unable to encode submission body")):e===403?(l="Forbidden",u=`Route "${n}" does not match URL "${t}"`):e===404?(l="Not Found",u=`No route matches URL "${t}"`):e===405&&(l="Method Not Allowed",r&&t&&n?u=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(u=`Invalid request method "${r.toUpperCase()}"`)),new lf(e||500,l,new Error(u),!0)}function B1(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,a]=t[n];if(Ql(a))return{key:r,result:a}}}function wE(e){let t=typeof e=="string"?Ao(e):e;return vs({...t,hash:""})}function MT(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function RT(e){var t,n;return new lf(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function PT(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&LT(n))}function LT(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function $T(e){return A4(e.result)&&lE.has(e.result.status)}function Ks(e){return e.type==="error"}function Ql(e){return(e&&e.type)==="redirect"}function Bx(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function A4(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function TT(e){return lE.has(e)}function DT(e){return A4(e)&&TT(e.status)&&e.headers.has("Location")}function HT(e){return uT.has(e.toUpperCase())}function ss(e){return lT.has(e.toUpperCase())}function N4(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function xh(e,t){let n=typeof t=="string"?Ao(t).search:t.search;if(e[e.length-1].route.index&&N4(n||""))return e[e.length-1];let r=rE(e);return r[r.length-1]}function Ux(e){let{formMethod:t,formAction:n,formEncType:r,text:a,formData:i,json:l}=e;if(!(!t||!n||!r)){if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:a};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function Sg(e,t,n,r){return r?{state:"loading",location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:"loading",location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function OT(e,t,n,r){return{state:"submitting",location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function Jd(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function IT(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function co(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function FT(e,t){try{let n=e.sessionStorage.getItem(cE);if(n){let r=JSON.parse(n);for(let[a,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(a,new Set(i||[]))}}catch{}}function _T(e,t){if(t.size>0){let n={};for(let[r,a]of t)n[r]=[...a];try{e.sessionStorage.setItem(cE,JSON.stringify(n))}catch(r){er(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function Wx(){let e,t,n=new Promise((r,a)=>{e=async i=>{r(i);try{await n}catch{}},t=async i=>{a(i);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var wc=s.createContext(null);wc.displayName="DataRouter";var od=s.createContext(null);od.displayName="DataRouterState";var yE=s.createContext(!1);function bE(){return s.useContext(yE)}var M4=s.createContext({isTransitioning:!1});M4.displayName="ViewTransition";var xE=s.createContext(new Map);xE.displayName="Fetchers";var VT=s.createContext(null);VT.displayName="Await";var Es=s.createContext(null);Es.displayName="Navigation";var jp=s.createContext(null);jp.displayName="Location";var ka=s.createContext({outlet:null,matches:[],isDataRoute:!1});ka.displayName="Route";var R4=s.createContext(null);R4.displayName="RouteError";var kE="REACT_ROUTER_ERROR",ZT="REDIRECT",zT="ROUTE_ERROR_RESPONSE";function BT(e){if(e.startsWith(`${kE}:${ZT}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function UT(e){if(e.startsWith(`${kE}:${zT}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new lf(t.status,t.statusText,t.data)}catch{}}function WT(e,{relative:t}={}){cn(yc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=s.useContext(Es),{hash:a,pathname:i,search:l}=uf(e,{relative:t}),u=i;return n!=="/"&&(u=i==="/"?n:wa([n,i])),r.createHref({pathname:u,search:l,hash:a})}function yc(){return s.useContext(jp)!=null}function Wn(){return cn(yc(),"useLocation() may be used only in the context of a <Router> component."),s.useContext(jp).location}function gn(e){cn(yc(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Wn();return s.useMemo(()=>tl(e,nE(t)),[t,e])}var SE="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function EE(e){s.useContext(Es).static||s.useLayoutEffect(e)}function _n(){let{isDataRoute:e}=s.useContext(ka);return e?oD():KT()}function KT(){cn(yc(),"useNavigate() may be used only in the context of a <Router> component.");let e=s.useContext(wc),{basename:t,navigator:n}=s.useContext(Es),{matches:r}=s.useContext(ka),{pathname:a}=Wn(),i=JSON.stringify(Cp(r)),l=s.useRef(!1);return EE(()=>{l.current=!0}),s.useCallback((f,h={})=>{if(er(l.current,SE),!l.current)return;if(typeof f=="number"){n.go(f);return}let p=of(f,JSON.parse(i),a,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:wa([t,p.pathname])),Pu(typeof f=="string"?f:vs(f),n.createHref(p),C4(n),"reject"),(h.replace?n.replace:n.push)(p,h.state,h)},[t,n,i,a,e])}var CE=s.createContext(null);function GT(){return s.useContext(CE)}function YT(e){let t=s.useContext(ka).outlet;return s.useMemo(()=>t&&s.createElement(CE.Provider,{value:e},t),[t,e])}function Qs(){let{matches:e}=s.useContext(ka),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function uf(e,{relative:t}={}){let{matches:n}=s.useContext(ka),{pathname:r}=Wn(),a=JSON.stringify(Cp(n));return s.useMemo(()=>of(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function qT(e,t,n){cn(yc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=s.useContext(Es),{matches:a}=s.useContext(ka),i=a[a.length-1],l=i?i.params:{},u=i?i.pathname:"/",f=i?i.pathnameBase:"/",h=i&&i.route;{let k=h&&h.path||"";ME(u,!h||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
51
+
52
+ Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let p=Wn(),g;g=p;let v=g.pathname||"/",w=v;if(f!=="/"){let k=f.replace(/^\//,"").split("/");w="/"+v.replace(/^\//,"").split("/").slice(k.length).join("/")}let b=n&&n.state.matches.length?n.state.matches.map(k=>Object.assign(k,{route:n.manifest[k.route.id]||k.route})):qS(e,{pathname:w});return er(h||b!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),er(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),tD(b&&b.map(k=>Object.assign({},k,{params:Object.assign({},l,k.params),pathname:wa([f,r.encodeLocation?r.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?f:wa([f,r.encodeLocation?r.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),a,n)}function XT(){let e=NE(),t=D0(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=s.createElement(s.Fragment,null,s.createElement("p",null,"💿 Hey developer 👋"),s.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",s.createElement("code",{style:i},"ErrorBoundary")," or"," ",s.createElement("code",{style:i},"errorElement")," prop on your route.")),s.createElement(s.Fragment,null,s.createElement("h2",null,"Unexpected Application Error!"),s.createElement("h3",{style:{fontStyle:"italic"}},t),n?s.createElement("pre",{style:a},n):null,l)}var QT=s.createElement(XT,null),jE=class extends s.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=UT(e.digest);n&&(e=n)}let t=e!==void 0?s.createElement(ka.Provider,{value:this.props.routeContext},s.createElement(R4.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?s.createElement(JT,{error:e},t):t}};jE.contextType=yE;var Eg=new WeakMap;function JT({children:e,error:t}){let{basename:n,navigator:r}=s.useContext(Es);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=BT(t.digest);if(a){let i=Eg.get(t);if(i)throw i;let l=aE(a.location,n),u=l.absoluteURL||l.to;if(Pu(a.location,u,C4(r),"allow-explicit"),U8(u))throw new Error("Invalid redirect location");if(sE&&!Eg.get(t))if(l.isExternal||a.reloadDocument)window.location.href=u;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:a.replace}));throw Eg.set(t,f),f}return s.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u}`})}}return e}function eD({routeContext:e,match:t,children:n}){let r=s.useContext(wc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),s.createElement(ka.Provider,{value:e},n)}function tD(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,i=r==null?void 0:r.errors;if(i!=null){let p=a.findIndex(g=>g.route.id&&(i==null?void 0:i[g.route.id])!==void 0);cn(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,p+1))}let l=!1,u=-1;if(n&&r){l=r.renderFallback;for(let p=0;p<a.length;p++){let g=a[p];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(u=p),g.route.id){let{loaderData:v,errors:w}=r,b=g.route.loader&&!v.hasOwnProperty(g.route.id)&&(!w||w[g.route.id]===void 0);if(g.route.lazy||b){n.isStatic&&(l=!0),u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}}let f=n==null?void 0:n.onError,h=r&&f?(p,g)=>{var v,w;f(p,{location:r.location,params:((w=(v=r.matches)==null?void 0:v[0])==null?void 0:w.params)??{},pattern:cf(r.matches),errorInfo:g})}:void 0;return a.reduceRight((p,g,v)=>{let w,b=!1,y=null,k=null;r&&(w=i&&g.route.id?i[g.route.id]:void 0,y=g.route.errorElement||QT,l&&(u<0&&v===0?(ME("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,k=null):u===v&&(b=!0,k=g.route.hydrateFallbackElement||null)));let S=t.concat(a.slice(0,v+1)),E=()=>{let j;return w?j=y:b?j=k:g.route.Component?j=s.createElement(g.route.Component,null):g.route.element?j=g.route.element:j=p,s.createElement(eD,{match:g,routeContext:{outlet:p,matches:S,isDataRoute:r!=null},children:j})};return r&&(g.route.ErrorBoundary||g.route.errorElement||v===0)?s.createElement(jE,{location:r.location,revalidation:r.revalidation,component:y,error:w,children:E(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:h}):E()},null)}function P4(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nD(e){let t=s.useContext(wc);return cn(t,P4(e)),t}function L4(e){let t=s.useContext(od);return cn(t,P4(e)),t}function rD(e){let t=s.useContext(ka);return cn(t,P4(e)),t}function $4(e){let t=rD(e),n=t.matches[t.matches.length-1];return cn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function sD(){return $4("useRouteId")}function aD(){let e=L4("useNavigation");return s.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function AE(){let{matches:e,loaderData:t}=L4("useMatches");return s.useMemo(()=>e.map(n=>XS(n,t)),[e,t])}function NE(){var r;let e=s.useContext(R4),t=L4("useRouteError"),n=$4("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function oD(){let{router:e}=nD("useNavigate"),t=$4("useNavigate"),n=s.useRef(!1);return EE(()=>{n.current=!0}),s.useCallback(async(a,i={})=>{er(n.current,SE),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...i}))},[e,t])}var Kx={};function ME(e,t,n){!t&&!Kx[e]&&(Kx[e]=!0,er(!1,n))}var Gx={};function Yx(e,t){!e&&!Gx[t]&&(Gx[t]=!0,console.warn(t))}var iD="useOptimistic",qx=vc[iD],lD=()=>{};function cD(e){return qx?qx(e):[e,lD]}function uD(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&er(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:s.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&er(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:s.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&er(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:s.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var dD=["HydrateFallback","hydrateFallbackElement"],fD=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function hD({router:e,flushSync:t,onError:n,useTransitions:r}){r=bE()||r;let[i,l]=s.useState(e.state),[u,f]=cD(i),[h,p]=s.useState(),[g,v]=s.useState({isTransitioning:!1}),[w,b]=s.useState(),[y,k]=s.useState(),[S,E]=s.useState(),j=s.useRef(new Map),N=s.useCallback((C,{deletedFetchers:R,newErrors:$,flushSync:H,viewTransitionOpts:D})=>{$&&n&&Object.values($).forEach(_=>{var U;return n(_,{location:C.location,params:((U=C.matches[0])==null?void 0:U.params)??{},pattern:cf(C.matches)})}),C.fetchers.forEach((_,U)=>{_.data!==void 0&&j.current.set(U,_.data)}),R.forEach(_=>j.current.delete(_)),Yx(H===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let q=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(Yx(D==null||q,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!D||!q){t&&H?t(()=>l(C)):r===!1?l(C):s.startTransition(()=>{r===!0&&f(_=>Xx(_,C)),l(C)});return}if(t&&H){t(()=>{y&&(w==null||w.resolve(),y.skipTransition()),v({isTransitioning:!0,flushSync:!0,currentLocation:D.currentLocation,nextLocation:D.nextLocation})});let _=e.window.document.startViewTransition(()=>{t(()=>l(C))});_.finished.finally(()=>{t(()=>{b(void 0),k(void 0),p(void 0),v({isTransitioning:!1})})}),t(()=>k(_));return}y?(w==null||w.resolve(),y.skipTransition(),E({state:C,currentLocation:D.currentLocation,nextLocation:D.nextLocation})):(p(C),v({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}))},[e.window,t,y,w,r,f,n]);s.useLayoutEffect(()=>e.subscribe(N),[e,N]),s.useEffect(()=>{g.isTransitioning&&!g.flushSync&&b(new fD)},[g]),s.useEffect(()=>{if(w&&h&&e.window){let C=h,R=w.promise,$=e.window.document.startViewTransition(async()=>{r===!1?l(C):s.startTransition(()=>{r===!0&&f(H=>Xx(H,C)),l(C)}),await R});$.finished.finally(()=>{b(void 0),k(void 0),p(void 0),v({isTransitioning:!1})}),k($)}},[h,w,e.window,r,f]),s.useEffect(()=>{w&&h&&u.location.key===h.location.key&&w.resolve()},[w,y,u.location,h]),s.useEffect(()=>{!g.isTransitioning&&S&&(p(S.state),v({isTransitioning:!0,flushSync:!1,currentLocation:S.currentLocation,nextLocation:S.nextLocation}),E(void 0))},[g.isTransitioning,S]);let A=s.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:C=>e.navigate(C),push:(C,R,$)=>e.navigate(C,{state:R,preventScrollReset:$==null?void 0:$.preventScrollReset}),replace:(C,R,$)=>e.navigate(C,{replace:!0,state:R,preventScrollReset:$==null?void 0:$.preventScrollReset})}),[e]),T=e.basename||"/",P=s.useMemo(()=>({router:e,navigator:A,static:!1,basename:T,onError:n}),[e,A,T,n]);return s.createElement(s.Fragment,null,s.createElement(wc.Provider,{value:P},s.createElement(od.Provider,{value:u},s.createElement(xE.Provider,{value:j.current},s.createElement(M4.Provider,{value:g},s.createElement(gD,{basename:T,location:u.location,navigationType:u.historyAction,navigator:A,useTransitions:r},s.createElement(pD,{routes:e.routes,manifest:e.manifest,future:e.future,state:u,isStatic:!1,onError:n})))))),null)}function Xx(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var pD=s.memo(mD);function mD({routes:e,manifest:t,future:n,state:r,isStatic:a,onError:i}){return qT(e,void 0,{manifest:t,state:r,isStatic:a,onError:i})}function Ba({to:e,replace:t,state:n,relative:r}){cn(yc(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a,navigator:i}=s.useContext(Es);er(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=s.useContext(ka),{pathname:u}=Wn(),f=_n(),h=of(e,Cp(l),u,r==="path");Pu(typeof e=="string"?e:vs(e),i.createHref(h),C4(i),"reject");let p=JSON.stringify(h);return s.useEffect(()=>{f(JSON.parse(p),{replace:t,state:n,relative:r})},[f,p,r,t,n]),null}function bc(e){return YT(e.context)}function gD({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:i=!1,useTransitions:l}){cn(!yc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),f=s.useMemo(()=>({basename:u,navigator:a,static:i,useTransitions:l,future:{}}),[u,a,i,l]);typeof n=="string"&&(n=Ao(n));let{pathname:h="/",search:p="",hash:g="",state:v=null,key:w="default",mask:b}=n,y=s.useMemo(()=>{let k=Xs(h,u);return k==null?null:{location:{pathname:k,search:p,hash:g,state:v,key:w,mask:b},navigationType:r}},[u,h,p,g,v,w,r,b]);return er(y!=null,`<Router basename="${u}"> is not able to match the URL "${h}${p}${g}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:s.createElement(Es.Provider,{value:f},s.createElement(jp.Provider,{children:t,value:y}))}var kh="get",Sh="application/x-www-form-urlencoded";function Ap(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function vD(e){return Ap(e)&&e.tagName.toLowerCase()==="button"}function wD(e){return Ap(e)&&e.tagName.toLowerCase()==="form"}function yD(e){return Ap(e)&&e.tagName.toLowerCase()==="input"}function bD(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function xD(e,t){return e.button===0&&(!t||t==="_self")&&!bD(e)}function K8(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function kD(e,t){let n=K8(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}var U1=null;function SD(){if(U1===null)try{new FormData(document.createElement("form"),0),U1=!1}catch{U1=!0}return U1}var ED=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Cg(e){return e!=null&&!ED.has(e)?(er(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Sh}"`),null):e}function CD(e,t){let n,r,a,i,l;if(wD(e)){let u=e.getAttribute("action");r=u?Xs(u,t):null,n=e.getAttribute("method")||kh,a=Cg(e.getAttribute("enctype"))||Sh,i=new FormData(e)}else if(vD(e)||yD(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||u.getAttribute("action");if(r=f?Xs(f,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||kh,a=Cg(e.getAttribute("formenctype"))||Cg(u.getAttribute("enctype"))||Sh,i=new FormData(u,e),!SD()){let{name:h,type:p,value:g}=e;if(p==="image"){let v=h?`${h}.`:"";i.append(`${v}x`,"0"),i.append(`${v}y`,"0")}else h&&i.append(h,g)}}else{if(Ap(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=kh,r=null,a=Sh,l=e}return i&&a==="text/plain"&&(l=i,i=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:i,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var jD={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},AD=/[&><\u2028\u2029]/g;function Qx(e){return e.replace(AD,t=>jD[t])}function T4(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function RE(e,t,n,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:t&&Xs(a.pathname,t)==="/"?a.pathname=`${Wu(t)}/_root.${r}`:a.pathname=`${Wu(a.pathname)}.${r}`,a}async function ND(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function MD(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function RD(e,t,n){let r=await Promise.all(e.map(async a=>{let i=t.routes[a.route.id];if(i){let l=await ND(i,n);return l.links?l.links():[]}return[]}));return TD(r.flat(1).filter(MD).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function Jx(e,t,n,r,a,i){let l=(f,h)=>n[h]?f.route.id!==n[h].route.id:!0,u=(f,h)=>{var p;return n[h].pathname!==f.pathname||((p=n[h].route.path)==null?void 0:p.endsWith("*"))&&n[h].params["*"]!==f.params["*"]};return i==="assets"?t.filter((f,h)=>l(f,h)||u(f,h)):i==="data"?t.filter((f,h)=>{var g;let p=r.routes[f.route.id];if(!p||!p.hasLoader)return!1;if(l(f,h)||u(f,h))return!0;if(f.route.shouldRevalidate){let v=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function PD(e,t,{includeHydrateFallback:n}={}){return LD(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let i=[a.module];return a.clientActionModule&&(i=i.concat(a.clientActionModule)),a.clientLoaderModule&&(i=i.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(i=i.concat(a.hydrateFallbackModule)),a.imports&&(i=i.concat(a.imports)),i}).flat(1))}function LD(e){return[...new Set(e)]}function $D(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function TD(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let i=JSON.stringify($D(a));return n.has(i)||(n.add(i),r.push({key:i,link:a})),r},[])}function D4(){let e=s.useContext(wc);return T4(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function DD(){let e=s.useContext(od);return T4(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Np=s.createContext(void 0);Np.displayName="FrameworkContext";function Mp(){let e=s.useContext(Np);return T4(e,"You must render this element inside a <HydratedRouter> element"),e}function HD(e,t){let n=s.useContext(Np),[r,a]=s.useState(!1),[i,l]=s.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:h,onMouseLeave:p,onTouchStart:g}=t,v=s.useRef(null);s.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let y=S=>{S.forEach(E=>{l(E.isIntersecting)})},k=new IntersectionObserver(y,{threshold:.5});return v.current&&k.observe(v.current),()=>{k.disconnect()}}},[e]),s.useEffect(()=>{if(r){let y=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(y)}}},[r]);let w=()=>{a(!0)},b=()=>{a(!1),l(!1)};return n?e!=="intent"?[i,v,{}]:[i,v,{onFocus:e0(u,w),onBlur:e0(f,b),onMouseEnter:e0(h,w),onMouseLeave:e0(p,b),onTouchStart:e0(g,w)}]:[!1,v,{}]}function e0(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function OD({page:e,...t}){let n=bE(),{nonce:r}=Mp(),{router:a}=D4(),i=s.useMemo(()=>qS(a.routes,e,a.basename),[a.routes,e,a.basename]);return i?(t.nonce==null&&r&&(t={...t,nonce:r}),n?s.createElement(FD,{page:e,matches:i,...t}):s.createElement(_D,{page:e,matches:i,...t})):null}function ID(e){let{manifest:t,routeModules:n}=Mp(),[r,a]=s.useState([]);return s.useEffect(()=>{let i=!1;return RD(e,t,n).then(l=>{i||a(l)}),()=>{i=!0}},[e,t,n]),r}function FD({page:e,matches:t,...n}){let r=Wn(),{future:a}=Mp(),{basename:i}=D4(),l=s.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let u=RE(e,i,a.v8_trailingSlashAwareDataRequests,"rsc"),f=!1,h=[];for(let p of t)typeof p.route.shouldRevalidate=="function"?f=!0:h.push(p.route.id);return f&&h.length>0&&u.searchParams.set("_routes",h.join(",")),[u.pathname+u.search]},[i,a.v8_trailingSlashAwareDataRequests,e,r,t]);return s.createElement(s.Fragment,null,l.map(u=>s.createElement("link",{key:u,rel:"prefetch",as:"fetch",href:u,...n})))}function _D({page:e,matches:t,...n}){let r=Wn(),{future:a,manifest:i,routeModules:l}=Mp(),{basename:u}=D4(),{loaderData:f,matches:h}=DD(),p=s.useMemo(()=>Jx(e,t,h,i,r,"data"),[e,t,h,i,r]),g=s.useMemo(()=>Jx(e,t,h,i,r,"assets"),[e,t,h,i,r]),v=s.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let y=new Set,k=!1;if(t.forEach(E=>{var N;let j=i.routes[E.route.id];!j||!j.hasLoader||(!p.some(A=>A.route.id===E.route.id)&&E.route.id in f&&((N=l[E.route.id])!=null&&N.shouldRevalidate)||j.hasClientLoader?k=!0:y.add(E.route.id))}),y.size===0)return[];let S=RE(e,u,a.v8_trailingSlashAwareDataRequests,"data");return k&&y.size>0&&S.searchParams.set("_routes",t.filter(E=>y.has(E.route.id)).map(E=>E.route.id).join(",")),[S.pathname+S.search]},[u,a.v8_trailingSlashAwareDataRequests,f,r,i,p,t,e,l]),w=s.useMemo(()=>PD(g,i),[g,i]),b=ID(g);return s.createElement(s.Fragment,null,v.map(y=>s.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...n})),w.map(y=>s.createElement("link",{key:y,rel:"modulepreload",href:y,...n})),b.map(({key:y,link:k})=>s.createElement("link",{key:y,nonce:n.nonce,...k,crossOrigin:k.crossOrigin??n.crossOrigin})))}function VD(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var ZD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ZD&&(window.__reactRouterVersion="7.18.3")}catch{}function zD(e,t){return mT({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:P$({window:t==null?void 0:t.window}),hydrationData:BD(),routes:e,mapRouteProperties:uD,hydrationRouteProperties:dD,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window,instrumentations:t==null?void 0:t.instrumentations}).initialize()}function BD(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:UD(e.errors)}),e}function UD(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,a]of t)if(a&&a.__type==="RouteErrorResponse")n[r]=new lf(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(typeof a.__subType=="string"&&eT.includes(a.__subType)){let i=window[a.__subType];if(typeof i=="function")try{let l=new i(a.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let i=new Error(a.message);i.stack="",n[r]=i}}else n[r]=a;return n}var Bn=s.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:i,replace:l,mask:u,state:f,target:h,to:p,preventScrollReset:g,viewTransition:v,defaultShouldRevalidate:w,...b},y){let{basename:k,navigator:S,useTransitions:E}=s.useContext(Es),j=typeof p=="string"&&Sp.test(p),N=aE(p,k);p=N.to;let A=WT(p,{relative:a}),T=Wn(),P=null;if(u){let U=of(u,[],T.mask?T.mask.pathname:"/",!0);k!=="/"&&(U.pathname=U.pathname==="/"?k:wa([k,U.pathname])),P=S.createHref(U)}let[C,R,$]=HD(r,b),H=YD(p,{replace:l,mask:u,state:f,target:h,preventScrollReset:g,relative:a,viewTransition:v,defaultShouldRevalidate:w,useTransitions:E});function D(U){t&&t(U),U.defaultPrevented||H(U)}let q=!(N.isExternal||i),_=s.createElement("a",{...b,...$,href:(q?P:void 0)||N.absoluteURL||A,onClick:q?D:t,ref:VD(y,R),target:h,"data-discover":!j&&n==="render"?"true":void 0});return C&&!j?s.createElement(s.Fragment,null,_,s.createElement(OD,{page:A})):_});Bn.displayName="Link";var WD=s.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:i,to:l,viewTransition:u,children:f,...h},p){let g=uf(l,{relative:h.relative}),v=Wn(),w=s.useContext(od),{navigator:b,basename:y}=s.useContext(Es),k=w!=null&&nH(g)&&u===!0,S=b.encodeLocation?b.encodeLocation(g).pathname:g.pathname,E=v.pathname,j=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;n||(E=E.toLowerCase(),j=j?j.toLowerCase():null,S=S.toLowerCase()),j&&y&&(j=Xs(j,y)||j);const N=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let A=E===S||!a&&E.startsWith(S)&&E.charAt(N)==="/",T=j!=null&&(j===S||!a&&j.startsWith(S)&&j.charAt(S.length)==="/"),P={isActive:A,isPending:T,isTransitioning:k},C=A?t:void 0,R;typeof r=="function"?R=r(P):R=[r,A?"active":null,T?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let $=typeof i=="function"?i(P):i;return s.createElement(Bn,{...h,"aria-current":C,className:R,ref:p,style:$,to:l,viewTransition:u},typeof f=="function"?f(P):f)});WD.displayName="NavLink";var KD=s.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:i,method:l=kh,action:u,onSubmit:f,relative:h,preventScrollReset:p,viewTransition:g,defaultShouldRevalidate:v,...w},b)=>{let{useTransitions:y}=s.useContext(Es),k=QD(),S=JD(u,{relative:h}),E=l.toLowerCase()==="get"?"get":"post",j=typeof u=="string"&&Sp.test(u),N=A=>{if(f&&f(A),A.defaultPrevented)return;A.preventDefault();let T=A.nativeEvent.submitter,P=(T==null?void 0:T.getAttribute("formmethod"))||l,C=()=>k(T||A.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:a,state:i,relative:h,preventScrollReset:p,viewTransition:g,defaultShouldRevalidate:v});y&&n!==!1?s.startTransition(()=>C()):C()};return s.createElement("form",{ref:b,method:E,action:S,onSubmit:r?f:N,...w,"data-discover":!j&&e==="render"?"true":void 0})});KD.displayName="Form";function PE({getKey:e,storageKey:t,...n}){let r=s.useContext(Np),{basename:a}=s.useContext(Es),i=Wn(),l=AE();eH({getKey:e,storageKey:t});let u=s.useMemo(()=>{if(!r||!e)return null;let h=Y8(i,l,a,e);return h!==i.key?h:null},[]);if(!r||r.isSpaMode)return null;let f=((h,p)=>{if(!window.history.state||!window.history.state.key){let g=Math.random().toString(32).slice(2);window.history.replaceState({key:g},"")}try{let v=JSON.parse(sessionStorage.getItem(h)||"{}")[p||window.history.state.key];typeof v=="number"&&window.scrollTo(0,v)}catch(g){console.error(g),sessionStorage.removeItem(h)}}).toString();return n.nonce==null&&(r!=null&&r.nonce)&&(n.nonce=r.nonce),s.createElement("script",{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${f})(${Qx(JSON.stringify(t||G8))}, ${Qx(JSON.stringify(u))})`}})}PE.displayName="ScrollRestoration";function LE(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function H4(e){let t=s.useContext(wc);return cn(t,LE(e)),t}function GD(e){let t=s.useContext(od);return cn(t,LE(e)),t}function YD(e,{target:t,replace:n,mask:r,state:a,preventScrollReset:i,relative:l,viewTransition:u,defaultShouldRevalidate:f,useTransitions:h}={}){let p=_n(),g=Wn(),v=uf(e,{relative:l});return s.useCallback(w=>{if(xD(w,t)){w.preventDefault();let b=n!==void 0?n:vs(g)===vs(v),y=()=>p(e,{replace:b,mask:r,state:a,preventScrollReset:i,relative:l,viewTransition:u,defaultShouldRevalidate:f});h?s.startTransition(()=>y()):y()}},[g,p,v,n,r,a,t,e,i,l,u,f,h])}function ll(e){er(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=s.useRef(K8(e)),n=s.useRef(!1),r=Wn(),a=s.useMemo(()=>kD(r.search,n.current?null:t.current),[r.search]),i=_n(),l=s.useCallback((u,f)=>{const h=K8(typeof u=="function"?u(new URLSearchParams(a)):u);n.current=!0,i("?"+h,f)},[i,a]);return[a,l]}var qD=0,XD=()=>`__${String(++qD)}__`;function QD(){let{router:e}=H4("useSubmit"),{basename:t}=s.useContext(Es),n=sD(),r=e.fetch,a=e.navigate;return s.useCallback(async(i,l={})=>{let{action:u,method:f,encType:h,formData:p,body:g}=CD(i,t);if(l.navigate===!1){let v=l.fetcherKey||XD();await r(v,n,l.action||u,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:g,formMethod:l.method||f,formEncType:l.encType||h,flushSync:l.flushSync})}else await a(l.action||u,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:g,formMethod:l.method||f,formEncType:l.encType||h,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,a,t,n])}function JD(e,{relative:t}={}){let{basename:n}=s.useContext(Es),r=s.useContext(ka);cn(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),i={...uf(e||".",{relative:t})},l=Wn();if(e==null){i.search=l.search;let u=new URLSearchParams(i.search),f=u.getAll("index");if(f.some(p=>p==="")){u.delete("index"),f.filter(g=>g).forEach(g=>u.append("index",g));let p=u.toString();i.search=p?`?${p}`:""}}return(!e||e===".")&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:wa([n,i.pathname])),vs(i)}var G8="react-router-scroll-positions",W1={};function Y8(e,t,n,r){let a=null;return r&&(n!=="/"?a=r({...e,pathname:Xs(e.pathname,n)||e.pathname},t):a=r(e,t)),a==null&&(a=e.key),a}function eH({getKey:e,storageKey:t}={}){let{router:n}=H4("useScrollRestoration"),{restoreScrollPosition:r,preventScrollReset:a}=GD("useScrollRestoration"),{basename:i}=s.useContext(Es),l=Wn(),u=AE(),f=aD();s.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),tH(s.useCallback(()=>{if(f.state==="idle"){let h=Y8(l,u,i,e);W1[h]=window.scrollY}try{sessionStorage.setItem(t||G8,JSON.stringify(W1))}catch(h){er(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${h}).`)}window.history.scrollRestoration="auto"},[f.state,e,i,l,u,t])),typeof document<"u"&&(s.useLayoutEffect(()=>{try{let h=sessionStorage.getItem(t||G8);h&&(W1=JSON.parse(h))}catch{}},[t]),s.useLayoutEffect(()=>{let h=n==null?void 0:n.enableScrollRestoration(W1,()=>window.scrollY,e?(p,g)=>Y8(p,g,i,e):void 0);return()=>h&&h()},[n,i,e]),s.useLayoutEffect(()=>{if(r!==!1){if(typeof r=="number"){window.scrollTo(0,r);return}try{if(l.hash){let h=document.getElementById(decodeURIComponent(l.hash.slice(1)));if(h){h.scrollIntoView();return}}}catch{er(!1,`"${l.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[l,r,a]))}function tH(e,t){let{capture:n}={};s.useEffect(()=>{let r=n!=null?{capture:n}:void 0;return window.addEventListener("pagehide",e,r),()=>{window.removeEventListener("pagehide",e,r)}},[e,n])}function nH(e,{relative:t}={}){let n=s.useContext(M4);cn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=H4("useViewTransitionState"),a=uf(e,{relative:t});if(!n.isTransitioning)return!1;let i=Xs(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Xs(n.nextLocation.pathname,r)||n.nextLocation.pathname;return tl(a.pathname,l)!=null||tl(a.pathname,i)!=null}const rH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M204.41,51.63a108,108,0,1,0,0,152.74A107.38,107.38,0,0,0,204.41,51.63Zm-17,17A83.85,83.85,0,0,1,196.26,79L169,111.09l-23.3-65.21A83.52,83.52,0,0,1,187.43,68.6Zm-118.85,0a83.44,83.44,0,0,1,51.11-24.2l14.16,39.65L65.71,71.61C66.64,70.59,67.59,69.59,68.58,68.6ZM48,153.7a84.48,84.48,0,0,1,3.4-60.3L92.84,101Zm20.55,33.7A83.94,83.94,0,0,1,59.74,177L87,144.91l23.3,65.21A83.53,83.53,0,0,1,68.58,187.4Zm36.36-63.61,15.18-17.85,23.06,4.21,7.88,22.06-15.17,17.85-23.06-4.21Zm82.49,63.61a83.49,83.49,0,0,1-51.11,24.2L122.15,172l68.14,12.44C189.36,185.41,188.41,186.41,187.43,187.4ZM163.16,155,208,102.3a84.43,84.43,0,0,1-3.41,60.3Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M195.88,60.12a96,96,0,1,0,0,135.76A96,96,0,0,0,195.88,60.12Zm-55.34,103h0l-36.68-6.69h0L91.32,121.3l24.14-28.41h0l36.68,6.69,12.54,35.12Z",opacity:"0.2"}),s.createElement("path",{d:"M201.54,54.46A104,104,0,0,0,54.46,201.54,104,104,0,0,0,201.54,54.46ZM190.23,65.78a88.18,88.18,0,0,1,11,13.48L167.55,119,139.63,40.78A87.34,87.34,0,0,1,190.23,65.78ZM155.59,133l-18.16,21.37-27.59-5L100.41,123l18.16-21.37,27.59,5ZM65.77,65.78a87.34,87.34,0,0,1,56.66-25.59l17.51,49L58.3,74.32A88,88,0,0,1,65.77,65.78ZM46.65,161.54a88.41,88.41,0,0,1,2.53-72.62l51.21,9.35Zm19.12,28.68a88.18,88.18,0,0,1-11-13.48L88.45,137l27.92,78.18A87.34,87.34,0,0,1,65.77,190.22Zm124.46,0a87.34,87.34,0,0,1-56.66,25.59l-17.51-49,81.64,14.91A88,88,0,0,1,190.23,190.22Zm-34.62-32.49,53.74-63.27a88.41,88.41,0,0,1-2.53,72.62Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,128A104,104,0,0,0,54.46,54.46,104,104,0,0,0,128,232h.09A104,104,0,0,0,232,128ZM49.18,88.92l51.21,9.35L46.65,161.53A88.39,88.39,0,0,1,49.18,88.92Zm160.17,5.54a88.41,88.41,0,0,1-2.53,72.62l-51.21-9.35Zm-8.08-15.2L167.55,119,139.63,40.78a87.38,87.38,0,0,1,50.6,25A88.74,88.74,0,0,1,201.27,79.26ZM122.43,40.19l17.51,49L58.3,74.32a89.28,89.28,0,0,1,7.47-8.55A87.37,87.37,0,0,1,122.43,40.19ZM54.73,176.74,88.45,137l27.92,78.18a88,88,0,0,1-61.64-38.48Zm78.84,39.06-17.51-49L139.14,171h0l58.52,10.69a87.5,87.5,0,0,1-64.13,34.12Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200.12,55.88A102,102,0,0,0,55.87,200.12,102,102,0,1,0,200.12,55.88Zm-102,66.67,19.65-23.14,29.86,5.46,10.21,28.58-19.65,23.14-29.86-5.46ZM209.93,90.69a90.24,90.24,0,0,1-2,78.63l-56.14-10.24Zm-6.16-11.28-36.94,43.48L136.66,38.42a89.31,89.31,0,0,1,55,25.94A91.33,91.33,0,0,1,203.77,79.41Zm-139.41-15A89.37,89.37,0,0,1,123.81,38.1L143,91.82,54.75,75.71A91.2,91.2,0,0,1,64.36,64.36ZM48,86.68l56.14,10.24L46.07,165.31a90.24,90.24,0,0,1,2-78.63Zm4.21,89.91,36.94-43.48,30.17,84.47a89.31,89.31,0,0,1-55-25.94A91.33,91.33,0,0,1,52.23,176.59Zm139.41,15a89.32,89.32,0,0,1-59.45,26.26L113,164.18l88.24,16.11A91.2,91.2,0,0,1,191.64,191.64Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M201.54,54.46A104,104,0,0,0,54.46,201.54,104,104,0,0,0,201.54,54.46ZM190.23,65.78a88.18,88.18,0,0,1,11,13.48L167.55,119,139.63,40.78A87.34,87.34,0,0,1,190.23,65.78ZM155.59,133l-18.16,21.37-27.59-5L100.41,123l18.16-21.37,27.59,5ZM65.77,65.78a87.34,87.34,0,0,1,56.66-25.59l17.51,49L58.3,74.32A88,88,0,0,1,65.77,65.78ZM46.65,161.54a88.41,88.41,0,0,1,2.53-72.62l51.21,9.35Zm19.12,28.68a88.18,88.18,0,0,1-11-13.48L88.45,137l27.92,78.18A87.34,87.34,0,0,1,65.77,190.22Zm124.46,0a87.34,87.34,0,0,1-56.66,25.59l-17.51-49,81.64,14.91A88,88,0,0,1,190.23,190.22Zm-34.62-32.49,53.74-63.27a88.41,88.41,0,0,1-2.53,72.62Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M198.71,57.29A100,100,0,1,0,57.29,198.71,100,100,0,1,0,198.71,57.29Zm10.37,114.27-61-11.14L210.4,87a92.26,92.26,0,0,1-1.32,84.52ZM95.87,122.13,117,97.24l32.14,5.86,11,30.77L139,158.76l-32.14-5.86ZM206.24,79.58l-40.13,47.25L133.75,36.2a92.09,92.09,0,0,1,72.49,43.38ZM63,63a91.31,91.31,0,0,1,62.26-26.88L146,94.41,51.32,77.11A92.94,92.94,0,0,1,63,63Zm-16,21.49,61,11.14L45.6,169a92.26,92.26,0,0,1,1.32-84.52Zm2.84,92,40.13-47.25,32.36,90.63a92.09,92.09,0,0,1-72.49-43.38Zm143.29,16.63a91.31,91.31,0,0,1-62.26,26.88L110,161.59l94.72,17.3A92.94,92.94,0,0,1,193.05,193.05Z"}))]]),sH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,44H32A20,20,0,0,0,12,64V88a20,20,0,0,0,16,19.6V192a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V107.6A20,20,0,0,0,244,88V64A20,20,0,0,0,224,44ZM36,68H220V84H36ZM52,188V108H204v80Zm112-52a12,12,0,0,1-12,12H104a12,12,0,0,1,0-24h48A12,12,0,0,1,164,136Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,96v96a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V96Z",opacity:"0.2"}),s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V88a16,16,0,0,0,16,16v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V104a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM208,192H48V104H208ZM224,88H32V64H224V88ZM96,136a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,136Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V88a16,16,0,0,0,16,16v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V104a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm-72,96H104a8,8,0,0,1,0-16h48a8,8,0,0,1,0,16Zm72-56H32V64H224V88Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,50H32A14,14,0,0,0,18,64V88a14,14,0,0,0,14,14h2v90a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V102h2a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50ZM210,192a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V102H210ZM226,88a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H224a2,2,0,0,1,2,2ZM98,136a6,6,0,0,1,6-6h48a6,6,0,0,1,0,12H104A6,6,0,0,1,98,136Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V88a16,16,0,0,0,16,16v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V104a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM208,192H48V104H208ZM224,88H32V64H224V88ZM96,136a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,136Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,52H32A12,12,0,0,0,20,64V88a12,12,0,0,0,12,12h4v92a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V100h4a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52ZM212,192a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V100H212ZM228,88a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H224a4,4,0,0,1,4,4ZM100,136a4,4,0,0,1,4-4h48a4,4,0,0,1,0,8H104A4,4,0,0,1,100,136Z"}))]]),aH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm40.49-100.49a12,12,0,0,1-17,17L140,117v51a12,12,0,0,1-24,0V117l-11.51,11.52a12,12,0,0,1-17-17l32-32a12,12,0,0,1,17,0Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm37.66-101.66a8,8,0,0,1-11.32,11.32L136,107.31V168a8,8,0,0,1-16,0V107.31l-18.34,18.35a8,8,0,0,1-11.32-11.32l32-32a8,8,0,0,1,11.32,0Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,101.66a8,8,0,0,1-11.32,0L136,107.31V168a8,8,0,0,1-16,0V107.31l-18.34,18.35a8,8,0,0,1-11.32-11.32l32-32a8,8,0,0,1,11.32,0l32,32A8,8,0,0,1,165.66,125.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm36.24-102.24a6,6,0,1,1-8.48,8.48L134,102.49V168a6,6,0,0,1-12,0V102.49l-21.76,21.75a6,6,0,0,1-8.48-8.48l32-32a6,6,0,0,1,8.48,0Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm37.66-101.66a8,8,0,0,1-11.32,11.32L136,107.31V168a8,8,0,0,1-16,0V107.31l-18.34,18.35a8,8,0,0,1-11.32-11.32l32-32a8,8,0,0,1,11.32,0Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm34.83-102.83a4,4,0,0,1-5.66,5.66L132,97.66V168a4,4,0,0,1-8,0V97.66L98.83,122.83a4,4,0,0,1-5.66-5.66l32-32a4,4,0,0,1,5.66,0Z"}))]]),oH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),s.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z"}))]]),iH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),s.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z"}))]]),lH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),s.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]),cH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208.49,143.51a12,12,0,0,1-17,17L140,109V224a12,12,0,0,1-24,0V109L64.49,160.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0ZM216,28H40a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,144H56l72-72Z",opacity:"0.2"}),s.createElement("path",{d:"M133.66,66.34a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,152h64v72a8,8,0,0,0,16,0V152h64a8,8,0,0,0,5.66-13.66ZM75.31,136,128,83.31,180.69,136ZM224,40a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,40Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M205.66,138.34A8,8,0,0,1,200,152H136v72a8,8,0,0,1-16,0V152H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0ZM216,32H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M204.24,139.76a6,6,0,1,1-8.48,8.48L134,86.49V224a6,6,0,0,1-12,0V86.49L60.24,148.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0ZM216,34H40a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M205.66,138.34a8,8,0,0,1-11.32,11.32L136,91.31V224a8,8,0,0,1-16,0V91.31L61.66,149.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0ZM216,32H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M202.83,141.17a4,4,0,0,1-5.66,5.66L132,81.66V224a4,4,0,0,1-8,0V81.66L58.83,146.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0ZM216,36H40a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8Z"}))]]),uH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128l-72,72V56Z",opacity:"0.2"}),s.createElement("path",{d:"M221.66,122.34l-72-72A8,8,0,0,0,136,56v64H40a8,8,0,0,0,0,16h96v64a8,8,0,0,0,13.66,5.66l72-72A8,8,0,0,0,221.66,122.34ZM152,180.69V75.31L204.69,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.66,133.66l-72,72A8,8,0,0,1,136,200V136H40a8,8,0,0,1,0-16h96V56a8,8,0,0,1,13.66-5.66l72,72A8,8,0,0,1,221.66,133.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z"}))]]),dH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,80V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H176A8,8,0,0,1,184,80Z",opacity:"0.2"}),s.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,136v72a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V80A16,16,0,0,1,48,64h72a8,8,0,0,1,0,16H48V208H176V136a8,8,0,0,1,16,0Zm32-96a8,8,0,0,0-8-8H152a8,8,0,0,0-5.66,13.66L172.69,72l-42.35,42.34a8,8,0,0,0,11.32,11.32L184,83.31l26.34,26.35A8,8,0,0,0,224,104Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,104a4,4,0,0,1-8,0V49.66l-73.16,73.17a4,4,0,0,1-5.66-5.66L206.34,44H152a4,4,0,0,1,0-8h64a4,4,0,0,1,4,4Zm-36,28a4,4,0,0,0-4,4v72a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4h72a4,4,0,0,0,0-8H48A12,12,0,0,0,36,80V208a12,12,0,0,0,12,12H176a12,12,0,0,0,12-12V136A4,4,0,0,0,184,132Z"}))]]),fH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),s.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]),hH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,48V96a12,12,0,0,1-12,12H168a12,12,0,0,1,0-24h19l-7.8-7.8a75.55,75.55,0,0,0-53.32-22.26h-.43A75.49,75.49,0,0,0,72.39,75.57,12,12,0,1,1,55.61,58.41a99.38,99.38,0,0,1,69.87-28.47H126A99.42,99.42,0,0,1,196.2,59.23L204,67V48a12,12,0,0,1,24,0ZM183.61,180.43a75.49,75.49,0,0,1-53.09,21.63h-.43A75.55,75.55,0,0,1,76.77,179.8L69,172H88a12,12,0,0,0,0-24H40a12,12,0,0,0-12,12v48a12,12,0,0,0,24,0V189l7.8,7.8A99.42,99.42,0,0,0,130,226.06h.56a99.38,99.38,0,0,0,69.87-28.47,12,12,0,0,0-16.78-17.16Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),s.createElement("path",{d:"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1-5.66-13.66L180.65,72a79.48,79.48,0,0,0-54.72-22.09h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27,96,96,0,0,1,192,60.7l18.36-18.36A8,8,0,0,1,224,48ZM186.41,183.29A80,80,0,0,1,75.35,184l18.31-18.31A8,8,0,0,0,88,152H40a8,8,0,0,0-8,8v48a8,8,0,0,0,13.66,5.66L64,195.3a95.42,95.42,0,0,0,66,26.76h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,48V96a6,6,0,0,1-6,6H168a6,6,0,0,1,0-12h33.52L183.47,72a81.51,81.51,0,0,0-57.53-24h-.46A81.5,81.5,0,0,0,68.19,71.28a6,6,0,1,1-8.38-8.58,93.38,93.38,0,0,1,65.67-26.76H126a93.45,93.45,0,0,1,66,27.53l18,18V48a6,6,0,0,1,12,0ZM187.81,184.72a81.5,81.5,0,0,1-57.29,23.34h-.46a81.51,81.51,0,0,1-57.53-24L54.48,166H88a6,6,0,0,0,0-12H40a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V174.48l18,18.05a93.45,93.45,0,0,0,66,27.53h.52a93.38,93.38,0,0,0,65.67-26.76,6,6,0,1,0-8.38-8.58Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,48V96a4,4,0,0,1-4,4H168a4,4,0,0,1,0-8h38.34L184.89,70.54A84,84,0,0,0,66.8,69.85a4,4,0,1,1-5.6-5.72,92,92,0,0,1,129.34.76L212,86.34V48a4,4,0,0,1,8,0ZM189.2,186.15a83.44,83.44,0,0,1-58.68,23.91h-.47a83.52,83.52,0,0,1-58.94-24.6L49.66,164H88a4,4,0,0,0,0-8H40a4,4,0,0,0-4,4v48a4,4,0,0,0,8,0V169.66l21.46,21.45A91.43,91.43,0,0,0,130,218.06h.51a91.45,91.45,0,0,0,64.28-26.19,4,4,0,1,0-5.6-5.72Z"}))]]),pH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M120.49,167.51a12,12,0,0,1,0,17l-32,32a12,12,0,0,1-17,0l-32-32a12,12,0,1,1,17-17L68,179V48a12,12,0,0,1,24,0V179l11.51-11.52A12,12,0,0,1,120.49,167.51Zm96-96-32-32a12,12,0,0,0-17,0l-32,32a12,12,0,0,0,17,17L164,77V208a12,12,0,0,0,24,0V77l11.51,11.52a12,12,0,0,0,17-17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,48V208H80V48Z",opacity:"0.2"}),s.createElement("path",{d:"M117.66,170.34a8,8,0,0,1,0,11.32l-32,32a8,8,0,0,1-11.32,0l-32-32a8,8,0,0,1,11.32-11.32L72,188.69V48a8,8,0,0,1,16,0V188.69l18.34-18.35A8,8,0,0,1,117.66,170.34Zm96-96-32-32a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32L168,67.31V208a8,8,0,0,0,16,0V67.31l18.34,18.35a8,8,0,0,0,11.32-11.32Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M119.39,172.94a8,8,0,0,1-1.73,8.72l-32,32a8,8,0,0,1-11.32,0l-32-32A8,8,0,0,1,48,168H72V48a8,8,0,0,1,16,0V168h24A8,8,0,0,1,119.39,172.94Zm94.27-98.6-32-32a8,8,0,0,0-11.32,0l-32,32A8,8,0,0,0,144,88h24V208a8,8,0,0,0,16,0V88h24a8,8,0,0,0,5.66-13.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M116.24,171.76a6,6,0,0,1,0,8.48l-32,32a6,6,0,0,1-8.48,0l-32-32a6,6,0,0,1,8.48-8.48L74,193.51V48a6,6,0,0,1,12,0V193.51l21.76-21.75A6,6,0,0,1,116.24,171.76Zm96-96-32-32a6,6,0,0,0-8.48,0l-32,32a6,6,0,0,0,8.48,8.48L170,62.49V208a6,6,0,0,0,12,0V62.49l21.76,21.75a6,6,0,0,0,8.48-8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M117.66,170.34a8,8,0,0,1,0,11.32l-32,32a8,8,0,0,1-11.32,0l-32-32a8,8,0,0,1,11.32-11.32L72,188.69V48a8,8,0,0,1,16,0V188.69l18.34-18.35A8,8,0,0,1,117.66,170.34Zm96-96-32-32a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32L168,67.31V208a8,8,0,0,0,16,0V67.31l18.34,18.35a8,8,0,0,0,11.32-11.32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M114.83,173.17a4,4,0,0,1,0,5.66l-32,32a4,4,0,0,1-5.66,0l-32-32a4,4,0,0,1,5.66-5.66L76,198.34V48a4,4,0,0,1,8,0V198.34l25.17-25.17A4,4,0,0,1,114.83,173.17Zm96-96-32-32a4,4,0,0,0-5.66,0l-32,32a4,4,0,0,0,5.66,5.66L172,57.66V208a4,4,0,0,0,8,0V57.66l25.17,25.17a4,4,0,1,0,5.66-5.66Z"}))]]),mH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.29,165.93C216.61,151,212,129.57,212,104a84,84,0,0,0-168,0c0,25.58-4.59,47-13.27,61.93A20.08,20.08,0,0,0,30.66,186,19.77,19.77,0,0,0,48,196H84.18a44,44,0,0,0,87.64,0H208a19.77,19.77,0,0,0,17.31-10A20.08,20.08,0,0,0,225.29,165.93ZM128,212a20,20,0,0,1-19.6-16h39.2A20,20,0,0,1,128,212ZM54.66,172C63.51,154,68,131.14,68,104a60,60,0,0,1,120,0c0,27.13,4.48,50,13.33,68Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,192H48a8,8,0,0,1-6.88-12C47.71,168.6,56,139.81,56,104a72,72,0,0,1,144,0c0,35.82,8.3,64.6,14.9,76A8,8,0,0,1,208,192Z",opacity:"0.2"}),s.createElement("path",{d:"M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216ZM48,184c7.7-13.24,16-43.92,16-80a64,64,0,1,1,128,0c0,36.05,8.28,66.73,16,80Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220.07,176.94C214.41,167.2,206,139.73,206,104a78,78,0,1,0-156,0c0,35.74-8.42,63.2-14.08,72.94A14,14,0,0,0,48,198H90.48a38,38,0,0,0,75,0H208a14,14,0,0,0,12.06-21.06ZM128,218a26,26,0,0,1-25.29-20h50.58A26,26,0,0,1,128,218Zm81.71-33a1.9,1.9,0,0,1-1.7,1H48a1.9,1.9,0,0,1-1.7-1,2,2,0,0,1,0-2C53.87,170,62,139.69,62,104a66,66,0,1,1,132,0c0,35.68,8.14,65.95,15.71,79A2,2,0,0,1,209.71,185Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216ZM48,184c7.7-13.24,16-43.92,16-80a64,64,0,1,1,128,0c0,36.05,8.28,66.73,16,80Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M218.35,178C212.58,168,204,140.13,204,104a76,76,0,1,0-152,0c0,36.13-8.59,64-14.36,73.95A12,12,0,0,0,48,196H92.23a36,36,0,0,0,71.54,0H208A12,12,0,0,0,218.35,178ZM128,220a28,28,0,0,1-27.71-24h55.42A28,28,0,0,1,128,220Zm83.45-34a3.91,3.91,0,0,1-3.44,2H48a3.91,3.91,0,0,1-3.44-2,4,4,0,0,1,0-4C52,169.17,60,139.32,60,104a68,68,0,1,1,136,0c0,35.31,8,65.17,15.44,78A4,4,0,0,1,211.45,186Z"}))]]),gH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),s.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),vH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M168.49,199.51a12,12,0,0,1-17,17l-80-80a12,12,0,0,1,0-17l80-80a12,12,0,0,1,17,17L97,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M160,48V208L80,128Z",opacity:"0.2"}),s.createElement("path",{d:"M163.06,40.61a8,8,0,0,0-8.72,1.73l-80,80a8,8,0,0,0,0,11.32l80,80A8,8,0,0,0,168,208V48A8,8,0,0,0,163.06,40.61ZM152,188.69,91.31,128,152,67.31Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M168,48V208a8,8,0,0,1-13.66,5.66l-80-80a8,8,0,0,1,0-11.32l80-80A8,8,0,0,1,168,48Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M164.24,203.76a6,6,0,1,1-8.48,8.48l-80-80a6,6,0,0,1,0-8.48l80-80a6,6,0,0,1,8.48,8.48L88.49,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M162.83,205.17a4,4,0,0,1-5.66,5.66l-80-80a4,4,0,0,1,0-5.66l80-80a4,4,0,1,1,5.66,5.66L85.66,128Z"}))]]),wH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),s.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]),yH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,160H48l80-80Z",opacity:"0.2"}),s.createElement("path",{d:"M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z"}))]]),bH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,196h-4V40a12,12,0,0,0-12-12H152a12,12,0,0,0-12,12V76H96A12,12,0,0,0,84,88v36H48a12,12,0,0,0-12,12v60H32a12,12,0,0,0,0,24H224a12,12,0,0,0,0-24ZM164,52h32V196H164Zm-56,48h32v96H108ZM60,148H84v48H60Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,40V208H152V40Z",opacity:"0.2"}),s.createElement("path",{d:"M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,208a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16h8V136a8,8,0,0,1,8-8H72a8,8,0,0,1,8,8v64H96V88a8,8,0,0,1,8-8h32a8,8,0,0,1,8,8V200h16V40a8,8,0,0,1,8-8h40a8,8,0,0,1,8,8V200h8A8,8,0,0,1,232,208Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,202H214V40a6,6,0,0,0-6-6H152a6,6,0,0,0-6,6V82H96a6,6,0,0,0-6,6v42H48a6,6,0,0,0-6,6v66H32a6,6,0,0,0,0,12H224a6,6,0,0,0,0-12ZM158,46h44V202H158ZM102,94h44V202H102ZM54,142H90v60H54Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,204H212V40a4,4,0,0,0-4-4H152a4,4,0,0,0-4,4V84H96a4,4,0,0,0-4,4v44H48a4,4,0,0,0-4,4v68H32a4,4,0,0,0,0,8H224a4,4,0,0,0,0-8ZM156,44h48V204H156ZM100,92h48V204H100ZM52,140H92v64H52Z"}))]]),xH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),s.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),kH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,128A104,104,0,1,1,128,24,104.13,104.13,0,0,1,232,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Z"}))]]),SH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm12,24.87a83.53,83.53,0,0,1,24,7.25V203.88a83.53,83.53,0,0,1-24,7.25ZM44,128a84.12,84.12,0,0,1,72-83.13V211.13A84.12,84.12,0,0,1,44,128Zm144,58.71V69.29a83.81,83.81,0,0,1,0,117.42Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,0,1-96,96V32A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM40,128a88.11,88.11,0,0,1,80-87.63V215.63A88.11,88.11,0,0,1,40,128Zm96,87.63V40.37a88,88,0,0,1,0,175.26Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM40,128a88.1,88.1,0,0,1,88-88V216A88.1,88.1,0,0,1,40,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm6,12.2a89.86,89.86,0,0,1,20,3.63V214.17a89.86,89.86,0,0,1-20,3.63Zm32,8.23a90.48,90.48,0,0,1,20,12.81V196.76a90.48,90.48,0,0,1-20,12.81ZM38,128a90.12,90.12,0,0,1,84-89.8V217.8A90.12,90.12,0,0,1,38,128Zm160,56.5V71.5a89.81,89.81,0,0,1,0,113Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm8,16.37a86.4,86.4,0,0,1,16,3V212.67a86.4,86.4,0,0,1-16,3Zm32,9.26a87.81,87.81,0,0,1,16,10.54V195.83a87.81,87.81,0,0,1-16,10.54ZM40,128a88.11,88.11,0,0,1,80-87.63V215.63A88.11,88.11,0,0,1,40,128Zm160,50.54V77.46a87.82,87.82,0,0,1,0,101.08Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm4,8.09a91.58,91.58,0,0,1,24,4.27V215.64a91.58,91.58,0,0,1-24,4.27Zm32,7.25a92.21,92.21,0,0,1,24,15V197.69a92.21,92.21,0,0,1-24,15ZM36,128a92.11,92.11,0,0,1,88-91.91V219.91A92.11,92.11,0,0,1,36,128Zm160,61.9V66.1a91.83,91.83,0,0,1,0,123.8Z"}))]]),EH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),s.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z"}))]]),CH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M180,64H40A12,12,0,0,0,28,76V216a12,12,0,0,0,12,12H180a12,12,0,0,0,12-12V76A12,12,0,0,0,180,64ZM168,204H52V88H168ZM228,40V180a12,12,0,0,1-24,0V52H76a12,12,0,0,1,0-24H216A12,12,0,0,1,228,40Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,72V216H40V72Z",opacity:"0.2"}),s.createElement("path",{d:"M184,64H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H184a8,8,0,0,0,8-8V72A8,8,0,0,0,184,64Zm-8,144H48V80H176ZM224,40V184a8,8,0,0,1-16,0V48H72a8,8,0,0,1,0-16H216A8,8,0,0,1,224,40Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,72V216a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V72a8,8,0,0,1,8-8H184A8,8,0,0,1,192,72Zm24-40H72a8,8,0,0,0,0,16H208V184a8,8,0,0,0,16,0V40A8,8,0,0,0,216,32Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,66H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H184a6,6,0,0,0,6-6V72A6,6,0,0,0,184,66Zm-6,144H46V78H178ZM222,40V184a6,6,0,0,1-12,0V46H72a6,6,0,0,1,0-12H216A6,6,0,0,1,222,40Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,64H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H184a8,8,0,0,0,8-8V72A8,8,0,0,0,184,64Zm-8,144H48V80H176ZM224,40V184a8,8,0,0,1-16,0V48H72a8,8,0,0,1,0-16H216A8,8,0,0,1,224,40Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,68H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H184a4,4,0,0,0,4-4V72A4,4,0,0,0,184,68Zm-4,144H44V76H180ZM220,40V184a4,4,0,0,1-8,0V44H72a4,4,0,0,1,0-8H216A4,4,0,0,1,220,40Z"}))]]),jH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,12H80A28,28,0,0,0,52,40V216a28,28,0,0,0,28,28h96a28,28,0,0,0,28-28V40A28,28,0,0,0,176,12ZM76,76H180V180H76Zm4-40h96a4,4,0,0,1,4,4V52H76V40A4,4,0,0,1,80,36Zm96,184H80a4,4,0,0,1-4-4V204H180v12A4,4,0,0,1,176,220Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,56V200H64V56Z",opacity:"0.2"}),s.createElement("path",{d:"M176,16H80A24,24,0,0,0,56,40V216a24,24,0,0,0,24,24h96a24,24,0,0,0,24-24V40A24,24,0,0,0,176,16ZM72,64H184V192H72Zm8-32h96a8,8,0,0,1,8,8v8H72V40A8,8,0,0,1,80,32Zm96,192H80a8,8,0,0,1-8-8v-8H184v8A8,8,0,0,1,176,224Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,16H80A24,24,0,0,0,56,40V216a24,24,0,0,0,24,24h96a24,24,0,0,0,24-24V40A24,24,0,0,0,176,16ZM80,32h96a8,8,0,0,1,8,8v8H72V40A8,8,0,0,1,80,32Zm96,192H80a8,8,0,0,1-8-8v-8H184v8A8,8,0,0,1,176,224Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,18H80A22,22,0,0,0,58,40V216a22,22,0,0,0,22,22h96a22,22,0,0,0,22-22V40A22,22,0,0,0,176,18ZM70,62H186V194H70ZM80,30h96a10,10,0,0,1,10,10V50H70V40A10,10,0,0,1,80,30Zm96,196H80a10,10,0,0,1-10-10V206H186v10A10,10,0,0,1,176,226Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,16H80A24,24,0,0,0,56,40V216a24,24,0,0,0,24,24h96a24,24,0,0,0,24-24V40A24,24,0,0,0,176,16ZM72,64H184V192H72Zm8-32h96a8,8,0,0,1,8,8v8H72V40A8,8,0,0,1,80,32Zm96,192H80a8,8,0,0,1-8-8v-8H184v8A8,8,0,0,1,176,224Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,20H80A20,20,0,0,0,60,40V216a20,20,0,0,0,20,20h96a20,20,0,0,0,20-20V40A20,20,0,0,0,176,20ZM68,60H188V196H68ZM80,28h96a12,12,0,0,1,12,12V52H68V40A12,12,0,0,1,80,28Zm96,200H80a12,12,0,0,1-12-12V204H188v12A12,12,0,0,1,176,228Z"}))]]),AH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z",opacity:"0.2"}),s.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z"}))]]),NH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M112,60a16,16,0,1,1,16,16A16,16,0,0,1,112,60Zm16,52a16,16,0,1,0,16,16A16,16,0,0,0,128,112Zm0,68a16,16,0,1,0,16,16A16,16,0,0,0,128,180Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,32V224a16,16,0,0,1-16,16H96a16,16,0,0,1-16-16V32A16,16,0,0,1,96,16h64A16,16,0,0,1,176,32Z",opacity:"0.2"}),s.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128ZM128,72a12,12,0,1,0-12-12A12,12,0,0,0,128,72Zm0,112a12,12,0,1,0,12,12A12,12,0,0,0,128,184Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M160,16H96A16,16,0,0,0,80,32V224a16,16,0,0,0,16,16h64a16,16,0,0,0,16-16V32A16,16,0,0,0,160,16ZM128,208a12,12,0,1,1,12-12A12,12,0,0,1,128,208Zm0-68a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm0-68a12,12,0,1,1,12-12A12,12,0,0,1,128,72Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M118,60a10,10,0,1,1,10,10A10,10,0,0,1,118,60Zm10,58a10,10,0,1,0,10,10A10,10,0,0,0,128,118Zm0,68a10,10,0,1,0,10,10A10,10,0,0,0,128,186Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128ZM128,72a12,12,0,1,0-12-12A12,12,0,0,0,128,72Zm0,112a12,12,0,1,0,12,12A12,12,0,0,0,128,184Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M120,60a8,8,0,1,1,8,8A8,8,0,0,1,120,60Zm8,60a8,8,0,1,0,8,8A8,8,0,0,0,128,120Zm0,68a8,8,0,1,0,8,8A8,8,0,0,0,128,188Z"}))]]),MH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,144v64a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V144a12,12,0,0,1,24,0v52H204V144a12,12,0,0,1,24,0Zm-108.49,8.49a12,12,0,0,0,17,0l40-40a12,12,0,0,0-17-17L140,115V32a12,12,0,0,0-24,0v83L96.49,95.51a12,12,0,0,0-17,17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z",opacity:"0.2"}),s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,168,96H136V32a8,8,0,0,0-16,0V96H88a8,8,0,0,0-5.66,13.66Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,144v64a6,6,0,0,1-6,6H40a6,6,0,0,1-6-6V144a6,6,0,0,1,12,0v58H210V144a6,6,0,0,1,12,0Zm-98.24,4.24a6,6,0,0,0,8.48,0l40-40a6,6,0,0,0-8.48-8.48L134,129.51V32a6,6,0,0,0-12,0v97.51L92.24,99.76a6,6,0,0,0-8.48,8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,144v64a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V144a4,4,0,0,1,8,0v60H212V144a4,4,0,0,1,8,0Zm-94.83,2.83a4,4,0,0,0,5.66,0l40-40a4,4,0,1,0-5.66-5.66L132,134.34V32a4,4,0,0,0-8,0V134.34L90.83,101.17a4,4,0,0,0-5.66,5.66Z"}))]]),RH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,100H132.92l78.14-20.63a12,12,0,0,0,8.52-14.75l-8.16-30a19.94,19.94,0,0,0-24.3-13.95L34.79,60.87a19.74,19.74,0,0,0-12.14,9.27,19.48,19.48,0,0,0-1.95,15L28,112v88a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V112A12,12,0,0,0,216,100ZM124.89,61.91l18.29,10.56-25.95,6.85L98.94,68.76Zm64.45-17,3.91,14.35-17.13,4.52L157.83,53.21ZM66,77.46,84.29,88l-35.4,9.35L45,83ZM204,196H52V124H204Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M67.71,64.59l47.79,27.6L40.43,112,32.27,82a7.76,7.76,0,0,1,5.58-9.52ZM199.84,37.76a7.9,7.9,0,0,0-9.66-5.49L126.61,49.05,174.4,76.64,208,67.77Z",opacity:"0.2"}),s.createElement("path",{d:"M216,104H102.09L210,75.51a8,8,0,0,0,5.68-9.84l-8.16-30a15.93,15.93,0,0,0-19.42-11.13L35.81,64.74a15.75,15.75,0,0,0-9.7,7.4,15.51,15.51,0,0,0-1.55,12L32,111.56c0,.14,0,.29,0,.44v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V112A8,8,0,0,0,216,104ZM192.16,40l6,22.07-22.62,6L147.42,51.83Zm-66.69,17.6,28.12,16.24-36.94,9.75L88.53,67.37Zm-79.4,44.62-6-22.08,26.5-7L94.69,89.4ZM208,200H48V120H208v80Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,104H102.09L210,75.51a8,8,0,0,0,5.68-9.84l-8.16-30a15.93,15.93,0,0,0-19.42-11.13L35.81,64.74a15.75,15.75,0,0,0-9.7,7.4,15.51,15.51,0,0,0-1.55,12L32,111.56c0,.14,0,.29,0,.44v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V112A8,8,0,0,0,216,104ZM192.16,40l6,22.07L164.57,71,136.44,54.72ZM77.55,70.27l28.12,16.24-59.6,15.73-6-22.08Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,106H86.68L209.53,73.57a6,6,0,0,0,4.26-7.38l-8.16-30a13.94,13.94,0,0,0-17-9.72L36.32,66.67a13.77,13.77,0,0,0-8.48,6.47,13.57,13.57,0,0,0-1.36,10.42L34,111.34c0,.22,0,.44,0,.66v88a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V112A6,6,0,0,0,216,106ZM125.75,55.48l33,19.07-42.43,11.2-33-19.07Zm66-17.41a1.92,1.92,0,0,1,2.34,1.26l6.57,24.18L175.26,70.2l-33-19.07ZM38.23,79.14a1.85,1.85,0,0,1,1.15-.87L66.86,71l33,19.08L44.66,104.68l-6.6-24.27A1.63,1.63,0,0,1,38.23,79.14ZM210,200a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V118H210Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,104H102.09L210,75.51a8,8,0,0,0,5.68-9.84l-8.16-30a15.93,15.93,0,0,0-19.42-11.13L35.81,64.74a15.75,15.75,0,0,0-9.7,7.4,15.51,15.51,0,0,0-1.55,12L32,111.56c0,.14,0,.29,0,.44v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V112A8,8,0,0,0,216,104ZM192.16,40l6,22.07-22.62,6L147.42,51.83Zm-66.69,17.6,28.12,16.24-36.94,9.75L88.53,67.37Zm-79.4,44.62-6-22.08,26.5-7L94.69,89.4ZM208,200H48V120H208v80Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,108H71.26L209,71.64a4,4,0,0,0,2.84-4.92l-8.16-30a11.92,11.92,0,0,0-14.54-8.31L36.83,68.61a11.78,11.78,0,0,0-7.26,5.53A11.59,11.59,0,0,0,28.41,83l7.67,28.19A3.87,3.87,0,0,0,36,112v88a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V112A4,4,0,0,0,216,108ZM126,53.33l38,21.92L116.08,87.9,78.12,66Zm65.16-17.2a4,4,0,0,1,1-.13A3.88,3.88,0,0,1,196,38.81l7.1,26.12L175,72.35,137,50.43Zm-154.7,42a3.86,3.86,0,0,1,2.37-1.8l28.27-7.46,38,21.91L43.25,107.12,36.13,80.94A3.66,3.66,0,0,1,36.5,78.14ZM212,200a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V116H212Z"}))]]),PH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z",opacity:"0.2"}),s.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,88V200.89A15.13,15.13,0,0,1,216.89,216H40a16,16,0,0,1-16-16V64A16,16,0,0,1,40,48H93.33a16.12,16.12,0,0,1,9.6,3.2L130.67,72H216A16,16,0,0,1,232,88Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4Z"}))]]),LH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84ZM104,132h48a12,12,0,0,1,0,24H104a12,12,0,0,1,0-24Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z",opacity:"0.2"}),s.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Zm-56-56a8,8,0,0,1-8,8H104a8,8,0,0,1,0-16h48A8,8,0,0,1,160,144Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm-64,80H104a8,8,0,0,1,0-16h48a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2ZM158,144a6,6,0,0,1-6,6H104a6,6,0,0,1,0-12h48A6,6,0,0,1,158,144Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Zm-56-56a8,8,0,0,1-8,8H104a8,8,0,0,1,0-16h48A8,8,0,0,1,160,144Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4ZM156,144a4,4,0,0,1-4,4H104a4,4,0,0,1,0-8h48A4,4,0,0,1,156,144Z"}))]]),$H=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,88a12,12,0,0,1,12-12h32a12,12,0,0,1,12,12v32a12,12,0,0,1-24,0V100H152A12,12,0,0,1,140,88ZM72,180h32a12,12,0,0,0,0-24H84V136a12,12,0,0,0-24,0v32A12,12,0,0,0,72,180ZM236,56V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56Zm-24,4H44V196H212Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,56V200a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),s.createElement("path",{d:"M200,80v32a8,8,0,0,1-16,0V88H160a8,8,0,0,1,0-16h32A8,8,0,0,1,200,80ZM96,168H72V144a8,8,0,0,0-16,0v32a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16ZM232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM88,192H56a8,8,0,0,1-8-8V152a8,8,0,0,1,16,0v24H88a8,8,0,0,1,0,16Zm120-88a8,8,0,0,1-16,0V80H168a8,8,0,0,1,0-16h32a8,8,0,0,1,8,8Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M198,80v32a6,6,0,0,1-12,0V86H160a6,6,0,0,1,0-12h32A6,6,0,0,1,198,80ZM96,170H70V144a6,6,0,0,0-12,0v32a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12ZM230,56V200a14,14,0,0,1-14,14H40a14,14,0,0,1-14-14V56A14,14,0,0,1,40,42H216A14,14,0,0,1,230,56Zm-12,0a2,2,0,0,0-2-2H40a2,2,0,0,0-2,2V200a2,2,0,0,0,2,2H216a2,2,0,0,0,2-2Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,80v32a8,8,0,0,1-16,0V88H160a8,8,0,0,1,0-16h32A8,8,0,0,1,200,80ZM96,168H72V144a8,8,0,0,0-16,0v32a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16ZM232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M196,80v32a4,4,0,0,1-8,0V84H160a4,4,0,0,1,0-8h32A4,4,0,0,1,196,80ZM96,172H68V144a4,4,0,0,0-8,0v32a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8ZM228,56V200a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V56A12,12,0,0,1,40,44H216A12,12,0,0,1,228,56Zm-8,0a4,4,0,0,0-4-4H40a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H216a4,4,0,0,0,4-4Z"}))]]),TH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,76a52,52,0,1,0,52,52A52.06,52.06,0,0,0,128,76Zm0,80a28,28,0,1,1,28-28A28,28,0,0,1,128,156Zm113.86-49.57A12,12,0,0,0,236,98.34L208.21,82.49l-.11-31.31a12,12,0,0,0-4.25-9.12,116,116,0,0,0-38-21.41,12,12,0,0,0-9.68.89L128,37.27,99.83,21.53a12,12,0,0,0-9.7-.9,116.06,116.06,0,0,0-38,21.47,12,12,0,0,0-4.24,9.1l-.14,31.34L20,98.35a12,12,0,0,0-5.85,8.11,110.7,110.7,0,0,0,0,43.11A12,12,0,0,0,20,157.66l27.82,15.85.11,31.31a12,12,0,0,0,4.25,9.12,116,116,0,0,0,38,21.41,12,12,0,0,0,9.68-.89L128,218.73l28.14,15.74a12,12,0,0,0,9.7.9,116.06,116.06,0,0,0,38-21.47,12,12,0,0,0,4.24-9.1l.14-31.34,27.81-15.81a12,12,0,0,0,5.85-8.11A110.7,110.7,0,0,0,241.86,106.43Zm-22.63,33.18-26.88,15.28a11.94,11.94,0,0,0-4.55,4.59c-.54,1-1.11,1.93-1.7,2.88a12,12,0,0,0-1.83,6.31L184.13,199a91.83,91.83,0,0,1-21.07,11.87l-27.15-15.19a12,12,0,0,0-5.86-1.53h-.29c-1.14,0-2.3,0-3.44,0a12.08,12.08,0,0,0-6.14,1.51L93,210.82A92.27,92.27,0,0,1,71.88,199l-.11-30.24a12,12,0,0,0-1.83-6.32c-.58-.94-1.16-1.91-1.7-2.88A11.92,11.92,0,0,0,63.7,155L36.8,139.63a86.53,86.53,0,0,1,0-23.24l26.88-15.28a12,12,0,0,0,4.55-4.58c.54-1,1.11-1.94,1.7-2.89a12,12,0,0,0,1.83-6.31L71.87,57A91.83,91.83,0,0,1,92.94,45.17l27.15,15.19a11.92,11.92,0,0,0,6.15,1.52c1.14,0,2.3,0,3.44,0a12.08,12.08,0,0,0,6.14-1.51L163,45.18A92.27,92.27,0,0,1,184.12,57l.11,30.24a12,12,0,0,0,1.83,6.32c.58.94,1.16,1.91,1.7,2.88A11.92,11.92,0,0,0,192.3,101l26.9,15.33A86.53,86.53,0,0,1,219.23,139.61Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.1,108.76,198.25,90.62c-.64-1.16-1.31-2.29-2-3.41l-.12-36A104.61,104.61,0,0,0,162,32L130,49.89c-1.34,0-2.69,0-4,0L94,32A104.58,104.58,0,0,0,59.89,51.25l-.16,36c-.7,1.12-1.37,2.26-2,3.41l-31.84,18.1a99.15,99.15,0,0,0,0,38.46l31.85,18.14c.64,1.16,1.31,2.29,2,3.41l.12,36A104.61,104.61,0,0,0,94,224l32-17.87c1.34,0,2.69,0,4,0L162,224a104.58,104.58,0,0,0,34.08-19.25l.16-36c.7-1.12,1.37-2.26,2-3.41l31.84-18.1A99.15,99.15,0,0,0,230.1,108.76ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z",opacity:"0.2"}),s.createElement("path",{d:"M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm109.94-52.79a8,8,0,0,0-3.89-5.4l-29.83-17-.12-33.62a8,8,0,0,0-2.83-6.08,111.91,111.91,0,0,0-36.72-20.67,8,8,0,0,0-6.46.59L128,41.85,97.88,25a8,8,0,0,0-6.47-.6A111.92,111.92,0,0,0,54.73,45.15a8,8,0,0,0-2.83,6.07l-.15,33.65-29.83,17a8,8,0,0,0-3.89,5.4,106.47,106.47,0,0,0,0,41.56,8,8,0,0,0,3.89,5.4l29.83,17,.12,33.63a8,8,0,0,0,2.83,6.08,111.91,111.91,0,0,0,36.72,20.67,8,8,0,0,0,6.46-.59L128,214.15,158.12,231a7.91,7.91,0,0,0,3.9,1,8.09,8.09,0,0,0,2.57-.42,112.1,112.1,0,0,0,36.68-20.73,8,8,0,0,0,2.83-6.07l.15-33.65,29.83-17a8,8,0,0,0,3.89-5.4A106.47,106.47,0,0,0,237.94,107.21Zm-15,34.91-28.57,16.25a8,8,0,0,0-3,3c-.58,1-1.19,2.06-1.81,3.06a7.94,7.94,0,0,0-1.22,4.21l-.15,32.25a95.89,95.89,0,0,1-25.37,14.3L134,199.13a8,8,0,0,0-3.91-1h-.19c-1.21,0-2.43,0-3.64,0a8.1,8.1,0,0,0-4.1,1l-28.84,16.1A96,96,0,0,1,67.88,201l-.11-32.2a8,8,0,0,0-1.22-4.22c-.62-1-1.23-2-1.8-3.06a8.09,8.09,0,0,0-3-3.06l-28.6-16.29a90.49,90.49,0,0,1,0-28.26L61.67,97.63a8,8,0,0,0,3-3c.58-1,1.19-2.06,1.81-3.06a7.94,7.94,0,0,0,1.22-4.21l.15-32.25a95.89,95.89,0,0,1,25.37-14.3L122,56.87a8,8,0,0,0,4.1,1c1.21,0,2.43,0,3.64,0a8,8,0,0,0,4.1-1l28.84-16.1A96,96,0,0,1,188.12,55l.11,32.2a8,8,0,0,0,1.22,4.22c.62,1,1.23,2,1.8,3.06a8.09,8.09,0,0,0,3,3.06l28.6,16.29A90.49,90.49,0,0,1,222.9,142.12Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M237.94,107.21a8,8,0,0,0-3.89-5.4l-29.83-17-.12-33.62a8,8,0,0,0-2.83-6.08,111.91,111.91,0,0,0-36.72-20.67,8,8,0,0,0-6.46.59L128,41.85,97.88,25a8,8,0,0,0-6.47-.6A111.92,111.92,0,0,0,54.73,45.15a8,8,0,0,0-2.83,6.07l-.15,33.65-29.83,17a8,8,0,0,0-3.89,5.4,106.47,106.47,0,0,0,0,41.56,8,8,0,0,0,3.89,5.4l29.83,17,.12,33.63a8,8,0,0,0,2.83,6.08,111.91,111.91,0,0,0,36.72,20.67,8,8,0,0,0,6.46-.59L128,214.15,158.12,231a7.91,7.91,0,0,0,3.9,1,8.09,8.09,0,0,0,2.57-.42,112.1,112.1,0,0,0,36.68-20.73,8,8,0,0,0,2.83-6.07l.15-33.65,29.83-17a8,8,0,0,0,3.89-5.4A106.47,106.47,0,0,0,237.94,107.21ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,82a46,46,0,1,0,46,46A46.06,46.06,0,0,0,128,82Zm0,80a34,34,0,1,1,34-34A34,34,0,0,1,128,162Zm108-54.4a6,6,0,0,0-2.92-4L202.64,86.22l-.42-.71L202.1,51.2A6,6,0,0,0,200,46.64a110.12,110.12,0,0,0-36.07-20.31,6,6,0,0,0-4.84.45L128.46,43.86h-1L96.91,26.76a6,6,0,0,0-4.86-.44A109.92,109.92,0,0,0,56,46.68a6,6,0,0,0-2.12,4.55l-.16,34.34c-.14.23-.28.47-.41.71L22.91,103.57A6,6,0,0,0,20,107.62a104.81,104.81,0,0,0,0,40.78,6,6,0,0,0,2.92,4l30.42,17.33.42.71.12,34.31A6,6,0,0,0,56,209.36a110.12,110.12,0,0,0,36.07,20.31,6,6,0,0,0,4.84-.45l30.61-17.08h1l30.56,17.1A6.09,6.09,0,0,0,162,230a5.83,5.83,0,0,0,1.93-.32,109.92,109.92,0,0,0,36-20.36,6,6,0,0,0,2.12-4.55l.16-34.34c.14-.23.28-.47.41-.71l30.42-17.29a6,6,0,0,0,2.92-4.05A104.81,104.81,0,0,0,236,107.6Zm-11.25,35.79L195.32,160.1a6.07,6.07,0,0,0-2.28,2.3c-.59,1-1.21,2.11-1.86,3.14a6,6,0,0,0-.91,3.16l-.16,33.21a98.15,98.15,0,0,1-27.52,15.53L133,200.88a6,6,0,0,0-2.93-.77h-.14c-1.24,0-2.5,0-3.74,0a6,6,0,0,0-3.07.76L93.45,217.43a98,98,0,0,1-27.56-15.49l-.12-33.17a6,6,0,0,0-.91-3.16c-.64-1-1.27-2.08-1.86-3.14a6,6,0,0,0-2.27-2.3L31.3,143.4a93,93,0,0,1,0-30.79L60.68,95.9A6.07,6.07,0,0,0,63,93.6c.59-1,1.21-2.11,1.86-3.14a6,6,0,0,0,.91-3.16l.16-33.21A98.15,98.15,0,0,1,93.41,38.56L123,55.12a5.81,5.81,0,0,0,3.07.76c1.24,0,2.5,0,3.74,0a6,6,0,0,0,3.07-.76l29.65-16.56a98,98,0,0,1,27.56,15.49l.12,33.17a6,6,0,0,0,.91,3.16c.64,1,1.27,2.08,1.86,3.14a6,6,0,0,0,2.27,2.3L224.7,112.6A93,93,0,0,1,224.73,143.39Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm109.94-52.79a8,8,0,0,0-3.89-5.4l-29.83-17-.12-33.62a8,8,0,0,0-2.83-6.08,111.91,111.91,0,0,0-36.72-20.67,8,8,0,0,0-6.46.59L128,41.85,97.88,25a8,8,0,0,0-6.47-.6A112.1,112.1,0,0,0,54.73,45.15a8,8,0,0,0-2.83,6.07l-.15,33.65-29.83,17a8,8,0,0,0-3.89,5.4,106.47,106.47,0,0,0,0,41.56,8,8,0,0,0,3.89,5.4l29.83,17,.12,33.62a8,8,0,0,0,2.83,6.08,111.91,111.91,0,0,0,36.72,20.67,8,8,0,0,0,6.46-.59L128,214.15,158.12,231a7.91,7.91,0,0,0,3.9,1,8.09,8.09,0,0,0,2.57-.42,112.1,112.1,0,0,0,36.68-20.73,8,8,0,0,0,2.83-6.07l.15-33.65,29.83-17a8,8,0,0,0,3.89-5.4A106.47,106.47,0,0,0,237.94,107.21Zm-15,34.91-28.57,16.25a8,8,0,0,0-3,3c-.58,1-1.19,2.06-1.81,3.06a7.94,7.94,0,0,0-1.22,4.21l-.15,32.25a95.89,95.89,0,0,1-25.37,14.3L134,199.13a8,8,0,0,0-3.91-1h-.19c-1.21,0-2.43,0-3.64,0a8.08,8.08,0,0,0-4.1,1l-28.84,16.1A96,96,0,0,1,67.88,201l-.11-32.2a8,8,0,0,0-1.22-4.22c-.62-1-1.23-2-1.8-3.06a8.09,8.09,0,0,0-3-3.06l-28.6-16.29a90.49,90.49,0,0,1,0-28.26L61.67,97.63a8,8,0,0,0,3-3c.58-1,1.19-2.06,1.81-3.06a7.94,7.94,0,0,0,1.22-4.21l.15-32.25a95.89,95.89,0,0,1,25.37-14.3L122,56.87a8,8,0,0,0,4.1,1c1.21,0,2.43,0,3.64,0a8.08,8.08,0,0,0,4.1-1l28.84-16.1A96,96,0,0,1,188.12,55l.11,32.2a8,8,0,0,0,1.22,4.22c.62,1,1.23,2,1.8,3.06a8.09,8.09,0,0,0,3,3.06l28.6,16.29A90.49,90.49,0,0,1,222.9,142.12Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,80a36,36,0,1,1,36-36A36,36,0,0,1,128,164Zm106-56a4,4,0,0,0-2-2.7l-30.89-17.6q-.47-.82-1-1.62L200.1,51.2a3.94,3.94,0,0,0-1.42-3,107.8,107.8,0,0,0-35.41-19.94,4,4,0,0,0-3.23.29L129,45.87h-2l-31-17.36a4,4,0,0,0-3.23-.3,108.05,108.05,0,0,0-35.39,20,4,4,0,0,0-1.41,3l-.16,34.9-1,1.62L23.9,105.3A4,4,0,0,0,22,108a102.76,102.76,0,0,0,0,40,4,4,0,0,0,1.95,2.7l30.89,17.6q.47.83,1,1.62l.12,34.87a3.94,3.94,0,0,0,1.42,3,107.8,107.8,0,0,0,35.41,19.94,4,4,0,0,0,3.23-.29L127,210.13h2l31,17.36a4,4,0,0,0,3.23.3,108.05,108.05,0,0,0,35.39-20,4,4,0,0,0,1.41-3l.16-34.9,1-1.62L232.1,150.7a4,4,0,0,0,2-2.71A102.76,102.76,0,0,0,234,108Zm-7.48,36.67L196.3,161.84a4,4,0,0,0-1.51,1.53c-.61,1.09-1.25,2.17-1.91,3.24a3.92,3.92,0,0,0-.61,2.1l-.16,34.15a99.8,99.8,0,0,1-29.7,16.77l-30.4-17a4.06,4.06,0,0,0-2-.51H130c-1.28,0-2.57,0-3.84,0a4.1,4.1,0,0,0-2.05.51l-30.45,17A100.23,100.23,0,0,1,63.89,202.9l-.12-34.12a3.93,3.93,0,0,0-.61-2.11c-.66-1-1.3-2.14-1.91-3.23a4,4,0,0,0-1.51-1.53L29.49,144.68a94.78,94.78,0,0,1,0-33.34L59.7,94.16a4,4,0,0,0,1.51-1.53c.61-1.09,1.25-2.17,1.91-3.23a4,4,0,0,0,.61-2.11l.16-34.15a99.8,99.8,0,0,1,29.7-16.77l30.4,17a4.1,4.1,0,0,0,2.05.51c1.28,0,2.57,0,3.84,0a4,4,0,0,0,2.05-.51l30.45-17A100.23,100.23,0,0,1,192.11,53.1l.12,34.12a3.93,3.93,0,0,0,.61,2.11c.66,1,1.3,2.14,1.91,3.23a4,4,0,0,0,1.51,1.53l30.25,17.23A94.78,94.78,0,0,1,226.54,144.66Z"}))]]),DH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,68H190.06A33.82,33.82,0,0,0,196,49.69,36.62,36.62,0,0,0,158.31,12,33.44,33.44,0,0,0,134,23.25a54.65,54.65,0,0,0-6,8.3,54.65,54.65,0,0,0-6-8.3A33.44,33.44,0,0,0,97.69,12,36.62,36.62,0,0,0,60,49.69,33.82,33.82,0,0,0,65.94,68H40A20,20,0,0,0,20,88v32a20,20,0,0,0,16,19.6V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V139.6A20,20,0,0,0,236,120V88A20,20,0,0,0,216,68Zm-4,48H140V92h72ZM152,39.17A9.59,9.59,0,0,1,159,36h.35A12.62,12.62,0,0,1,172,49,9.59,9.59,0,0,1,168.83,56c-6.9,6.12-18.25,9.26-27.63,10.76C142.7,57.42,145.84,46.07,152,39.17ZM87.7,39.7A12.8,12.8,0,0,1,96.61,36H97A9.59,9.59,0,0,1,104,39.17c6.12,6.9,9.26,18.24,10.75,27.61C105.45,65.27,94,62.13,87.17,56A9.59,9.59,0,0,1,84,49,12.72,12.72,0,0,1,87.7,39.7ZM44,92h72v24H44Zm16,48h56v56H60Zm80,56V140h56v56Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,128v72a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V128Z",opacity:"0.2"}),s.createElement("path",{d:"M216,72H180.92c.39-.33.79-.65,1.17-1A29.53,29.53,0,0,0,192,49.57,32.62,32.62,0,0,0,158.44,16,29.53,29.53,0,0,0,137,25.91a54.94,54.94,0,0,0-9,14.48,54.94,54.94,0,0,0-9-14.48A29.53,29.53,0,0,0,97.56,16,32.62,32.62,0,0,0,64,49.57,29.53,29.53,0,0,0,73.91,71c.38.33.78.65,1.17,1H40A16,16,0,0,0,24,88v32a16,16,0,0,0,16,16v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V136a16,16,0,0,0,16-16V88A16,16,0,0,0,216,72ZM149,36.51a13.69,13.69,0,0,1,10-4.5h.49A16.62,16.62,0,0,1,176,49.08a13.69,13.69,0,0,1-4.5,10c-9.49,8.4-25.24,11.36-35,12.4C137.7,60.89,141,45.5,149,36.51Zm-64.09.36A16.63,16.63,0,0,1,96.59,32h.49a13.69,13.69,0,0,1,10,4.5c8.39,9.48,11.35,25.2,12.39,34.92-9.72-1-25.44-4-34.92-12.39a13.69,13.69,0,0,1-4.5-10A16.6,16.6,0,0,1,84.87,36.87ZM40,88h80v32H40Zm16,48h64v64H56Zm144,64H136V136h64Zm16-80H136V88h80v32Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,72H180.92c.39-.33.79-.65,1.17-1A29.53,29.53,0,0,0,192,49.57,32.62,32.62,0,0,0,158.44,16,29.53,29.53,0,0,0,137,25.91a54.94,54.94,0,0,0-9,14.48,54.94,54.94,0,0,0-9-14.48A29.53,29.53,0,0,0,97.56,16,32.62,32.62,0,0,0,64,49.57,29.53,29.53,0,0,0,73.91,71c.38.33.78.65,1.17,1H40A16,16,0,0,0,24,88v32a16,16,0,0,0,16,16v64a16,16,0,0,0,16,16h60a4,4,0,0,0,4-4V120H40V88h80v32h16V88h80v32H136v92a4,4,0,0,0,4,4h60a16,16,0,0,0,16-16V136a16,16,0,0,0,16-16V88A16,16,0,0,0,216,72ZM84.51,59a13.69,13.69,0,0,1-4.5-10A16.62,16.62,0,0,1,96.59,32h.49a13.69,13.69,0,0,1,10,4.5c8.39,9.48,11.35,25.2,12.39,34.92C109.71,70.39,94,67.43,84.51,59Zm87,0c-9.49,8.4-25.24,11.36-35,12.4C137.7,60.89,141,45.5,149,36.51a13.69,13.69,0,0,1,10-4.5h.49A16.62,16.62,0,0,1,176,49.08,13.69,13.69,0,0,1,171.49,59Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,74H174.74a46.41,46.41,0,0,0,6-4.48,27.56,27.56,0,0,0,9.22-20A30.63,30.63,0,0,0,158.5,18a27.56,27.56,0,0,0-20,9.22A57.1,57.1,0,0,0,128,45.76a57.1,57.1,0,0,0-10.48-18.53A27.56,27.56,0,0,0,97.5,18,30.63,30.63,0,0,0,66,49.51a27.56,27.56,0,0,0,9.22,20,45.74,45.74,0,0,0,6,4.48H40A14,14,0,0,0,26,88v32a14,14,0,0,0,14,14h2v66a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V134h2a14,14,0,0,0,14-14V88A14,14,0,0,0,216,74ZM135.77,63c2.25-12.12,6.29-21.75,11.69-27.85A15.68,15.68,0,0,1,158.86,30h.55A18.6,18.6,0,0,1,178,49.14a15.68,15.68,0,0,1-5.18,11.4C162.1,70,143.92,72.83,134.34,73.65,134.59,70.76,135,67.08,135.77,63ZM83.45,35.45A18.69,18.69,0,0,1,96.59,30h.55a15.68,15.68,0,0,1,11.4,5.18C118,45.9,120.83,64.08,121.65,73.66c-2.89-.25-6.57-.68-10.61-1.43C98.92,70,89.29,65.94,83.19,60.53A15.64,15.64,0,0,1,78,49.14,18.65,18.65,0,0,1,83.45,35.45ZM38,120V88a2,2,0,0,1,2-2h82v36H40A2,2,0,0,1,38,120Zm16,80V134h68v68H56A2,2,0,0,1,54,200Zm148,0a2,2,0,0,1-2,2H134V134h68Zm16-80a2,2,0,0,1-2,2H134V86h82a2,2,0,0,1,2,2Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,72H180.92c.39-.33.79-.65,1.17-1A29.53,29.53,0,0,0,192,49.57,32.62,32.62,0,0,0,158.44,16,29.53,29.53,0,0,0,137,25.91a54.94,54.94,0,0,0-9,14.48,54.94,54.94,0,0,0-9-14.48A29.53,29.53,0,0,0,97.56,16,32.62,32.62,0,0,0,64,49.57,29.53,29.53,0,0,0,73.91,71c.38.33.78.65,1.17,1H40A16,16,0,0,0,24,88v32a16,16,0,0,0,16,16v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V136a16,16,0,0,0,16-16V88A16,16,0,0,0,216,72ZM149,36.51a13.69,13.69,0,0,1,10-4.5h.49A16.62,16.62,0,0,1,176,49.08a13.69,13.69,0,0,1-4.5,10c-9.49,8.4-25.24,11.36-35,12.4C137.7,60.89,141,45.5,149,36.51Zm-64.09.36A16.63,16.63,0,0,1,96.59,32h.49a13.69,13.69,0,0,1,10,4.5c8.39,9.48,11.35,25.2,12.39,34.92-9.72-1-25.44-4-34.92-12.39a13.69,13.69,0,0,1-4.5-10A16.6,16.6,0,0,1,84.87,36.87ZM40,88h80v32H40Zm16,48h64v64H56Zm144,64H136V136h64Zm16-80H136V88h80v32Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,76H166.81a50.54,50.54,0,0,0,12.63-8A25.53,25.53,0,0,0,188,49.44,28.62,28.62,0,0,0,158.56,20,25.53,25.53,0,0,0,140,28.56c-5.91,6.67-9.63,15.36-12,23.69-2.35-8.33-6.07-17-12-23.69A25.53,25.53,0,0,0,97.44,20,28.62,28.62,0,0,0,68,49.44,25.53,25.53,0,0,0,76.56,68a50.54,50.54,0,0,0,12.63,8H40A12,12,0,0,0,28,88v32a12,12,0,0,0,12,12h4v68a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V132h4a12,12,0,0,0,12-12V88A12,12,0,0,0,216,76ZM146,33.86A17.59,17.59,0,0,1,158.8,28h.61A20.62,20.62,0,0,1,180,49.2,17.6,17.6,0,0,1,174.14,62c-12.09,10.7-33.07,13.21-42,13.79C132.76,66.93,135.26,46,146,33.86ZM76,49.2A20.62,20.62,0,0,1,96.59,28h.61A17.59,17.59,0,0,1,110,33.86c10.71,12.09,13.21,33.07,13.79,42-8.89-.58-29.87-3.09-42-13.79A17.6,17.6,0,0,1,76,49.2ZM36,120V88a4,4,0,0,1,4-4h84v40H40A4,4,0,0,1,36,120Zm16,80V132h72v72H56A4,4,0,0,1,52,200Zm152,0a4,4,0,0,1-4,4H132V132h72Zm16-80a4,4,0,0,1-4,4H132V84h84a4,4,0,0,1,4,4Z"}))]]),HH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M212.62,75.17A63.7,63.7,0,0,0,206.39,26,12,12,0,0,0,196,20a63.71,63.71,0,0,0-50,24H126A63.71,63.71,0,0,0,76,20a12,12,0,0,0-10.39,6,63.7,63.7,0,0,0-6.23,49.17A61.5,61.5,0,0,0,52,104v8a60.1,60.1,0,0,0,45.76,58.28A43.66,43.66,0,0,0,92,192v4H76a20,20,0,0,1-20-20,44.05,44.05,0,0,0-44-44,12,12,0,0,0,0,24,20,20,0,0,1,20,20,44.05,44.05,0,0,0,44,44H92v12a12,12,0,0,0,24,0V192a20,20,0,0,1,40,0v40a12,12,0,0,0,24,0V192a43.66,43.66,0,0,0-5.76-21.72A60.1,60.1,0,0,0,220,112v-8A61.5,61.5,0,0,0,212.62,75.17ZM196,112a36,36,0,0,1-36,36H112a36,36,0,0,1-36-36v-8a37.87,37.87,0,0,1,6.13-20.12,11.65,11.65,0,0,0,1.58-11.49,39.9,39.9,0,0,1-.4-27.72,39.87,39.87,0,0,1,26.41,17.8A12,12,0,0,0,119.82,68h32.35a12,12,0,0,0,10.11-5.53,39.84,39.84,0,0,1,26.41-17.8,39.9,39.9,0,0,1-.4,27.72,12,12,0,0,0,1.61,11.53A37.85,37.85,0,0,1,196,104Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,104v8a48,48,0,0,1-48,48H136a32,32,0,0,1,32,32v40H104V192a32,32,0,0,1,32-32H112a48,48,0,0,1-48-48v-8a49.28,49.28,0,0,1,8.51-27.3A51.92,51.92,0,0,1,76,32a52,52,0,0,1,43.83,24h32.34A52,52,0,0,1,196,32a51.92,51.92,0,0,1,3.49,44.7A49.28,49.28,0,0,1,208,104Z",opacity:"0.2"}),s.createElement("path",{d:"M208.3,75.68A59.74,59.74,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58,58,0,0,0,208.3,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.76,41.76,0,0,1,200,104Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,104v8a56.06,56.06,0,0,1-48.44,55.47A39.8,39.8,0,0,1,176,192v40a8,8,0,0,1-8,8H104a8,8,0,0,1-8-8V216H72a40,40,0,0,1-40-40A24,24,0,0,0,8,152a8,8,0,0,1,0-16,40,40,0,0,1,40,40,24,24,0,0,0,24,24H96v-8a39.8,39.8,0,0,1,8.44-24.53A56.06,56.06,0,0,1,56,112v-8a58.14,58.14,0,0,1,7.69-28.32A59.78,59.78,0,0,1,69.07,28,8,8,0,0,1,76,24a59.75,59.75,0,0,1,48,24h24a59.75,59.75,0,0,1,48-24,8,8,0,0,1,6.93,4,59.74,59.74,0,0,1,5.37,47.68A58,58,0,0,1,216,104Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M206.13,75.92A57.79,57.79,0,0,0,201.2,29a6,6,0,0,0-5.2-3,57.77,57.77,0,0,0-47,24H123A57.77,57.77,0,0,0,76,26a6,6,0,0,0-5.2,3,57.79,57.79,0,0,0-4.93,46.92A55.88,55.88,0,0,0,58,104v8a54.06,54.06,0,0,0,50.45,53.87A37.85,37.85,0,0,0,98,192v10H72a26,26,0,0,1-26-26A38,38,0,0,0,8,138a6,6,0,0,0,0,12,26,26,0,0,1,26,26,38,38,0,0,0,38,38H98v18a6,6,0,0,0,12,0V192a26,26,0,0,1,52,0v40a6,6,0,0,0,12,0V192a37.85,37.85,0,0,0-10.45-26.13A54.06,54.06,0,0,0,214,112v-8A55.88,55.88,0,0,0,206.13,75.92ZM202,112a42,42,0,0,1-42,42H112a42,42,0,0,1-42-42v-8a43.86,43.86,0,0,1,7.3-23.69,6,6,0,0,0,.81-5.76,45.85,45.85,0,0,1,1.43-36.42,45.85,45.85,0,0,1,35.23,21.1A6,6,0,0,0,119.83,62h32.34a6,6,0,0,0,5.06-2.76,45.83,45.83,0,0,1,35.23-21.11,45.85,45.85,0,0,1,1.43,36.42,6,6,0,0,0,.79,5.74A43.78,43.78,0,0,1,202,104Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208.31,75.68A59.78,59.78,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58.14,58.14,0,0,0,208.31,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.72,41.72,0,0,1,200,104Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M203.94,76.16A55.73,55.73,0,0,0,199.46,30,4,4,0,0,0,196,28a55.78,55.78,0,0,0-46,24H122A55.78,55.78,0,0,0,76,28a4,4,0,0,0-3.46,2,55.73,55.73,0,0,0-4.48,46.16A53.78,53.78,0,0,0,60,104v8a52.06,52.06,0,0,0,52,52h1.41A36,36,0,0,0,100,192v12H72a28,28,0,0,1-28-28A36,36,0,0,0,8,140a4,4,0,0,0,0,8,28,28,0,0,1,28,28,36,36,0,0,0,36,36h28v20a4,4,0,0,0,8,0V192a28,28,0,0,1,56,0v40a4,4,0,0,0,8,0V192a36,36,0,0,0-13.41-28H160a52.06,52.06,0,0,0,52-52v-8A53.78,53.78,0,0,0,203.94,76.16ZM204,112a44.05,44.05,0,0,1-44,44H112a44.05,44.05,0,0,1-44-44v-8a45.76,45.76,0,0,1,7.71-24.89,4,4,0,0,0,.53-3.84,47.82,47.82,0,0,1,2.1-39.21,47.8,47.8,0,0,1,38.12,22.1A4,4,0,0,0,119.83,60h32.34a4,4,0,0,0,3.37-1.84,47.8,47.8,0,0,1,38.12-22.1,47.82,47.82,0,0,1,2.1,39.21,4,4,0,0,0,.53,3.83A45.85,45.85,0,0,1,204,104Z"}))]]),OH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M249.8,85.49l-116-64a12,12,0,0,0-11.6,0l-116,64a12,12,0,0,0,0,21l21.8,12v47.76a19.89,19.89,0,0,0,5.09,13.32C46.63,194.7,77,220,128,220a136.88,136.88,0,0,0,40-5.75V240a12,12,0,0,0,24,0V204.12a119.53,119.53,0,0,0,30.91-24.51A19.89,19.89,0,0,0,228,166.29V118.53l21.8-12a12,12,0,0,0,0-21ZM128,45.71,219.16,96,186,114.3a1.88,1.88,0,0,1-.18-.12l-52-28.69a12,12,0,0,0-11.6,21l39,21.49L128,146.3,36.84,96ZM128,196c-40.42,0-64.65-19.07-76-31.27v-33l70.2,38.74a12,12,0,0,0,11.6,0L168,151.64v37.23A110.46,110.46,0,0,1,128,196Zm76-31.27a93.21,93.21,0,0,1-12,10.81V138.39l12-6.62Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,113.07v53.22a8,8,0,0,1-2,5.31c-11.3,12.59-38.9,36.4-86,36.4s-74.68-23.81-86-36.4a8,8,0,0,1-2-5.31V113.07L128,160Z",opacity:"0.2"}),s.createElement("path",{d:"M251.76,88.94l-120-64a8,8,0,0,0-7.52,0l-120,64a8,8,0,0,0,0,14.12L32,117.87v48.42a15.91,15.91,0,0,0,4.06,10.65C49.16,191.53,78.51,216,128,216a130,130,0,0,0,48-8.76V240a8,8,0,0,0,16,0V199.51a115.63,115.63,0,0,0,27.94-22.57A15.91,15.91,0,0,0,224,166.29V117.87l27.76-14.81a8,8,0,0,0,0-14.12ZM128,200c-43.27,0-68.72-21.14-80-33.71V126.4l76.24,40.66a8,8,0,0,0,7.52,0L176,143.47v46.34C163.4,195.69,147.52,200,128,200Zm80-33.75a97.83,97.83,0,0,1-16,14.25V134.93l16-8.53ZM188,118.94l-.22-.13-56-29.87a8,8,0,0,0-7.52,14.12L171,128l-43,22.93L25,96,128,41.07,231,96Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M176,207.24a119,119,0,0,0,16-7.73V240a8,8,0,0,1-16,0Zm11.76-88.43-56-29.87a8,8,0,0,0-7.52,14.12L171,128l17-9.06Zm64-29.87-120-64a8,8,0,0,0-7.52,0l-120,64a8,8,0,0,0,0,14.12L32,117.87v48.42a15.91,15.91,0,0,0,4.06,10.65C49.16,191.53,78.51,216,128,216a130,130,0,0,0,48-8.76V130.67L171,128l-43,22.93L43.83,106l0,0L25,96,128,41.07,231,96l-18.78,10-.06,0L188,118.94a8,8,0,0,1,4,6.93v73.64a115.63,115.63,0,0,0,27.94-22.57A15.91,15.91,0,0,0,224,166.29V117.87l27.76-14.81a8,8,0,0,0,0-14.12Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M250.82,90.71l-120-64a5.94,5.94,0,0,0-5.64,0l-120,64a6,6,0,0,0,0,10.58L34,116.67v49.62a14,14,0,0,0,3.55,9.32C50.42,189.94,79.29,214,128,214a127.21,127.21,0,0,0,50-9.73V240a6,6,0,0,0,12,0V198.35a113.18,113.18,0,0,0,28.45-22.75,13.91,13.91,0,0,0,3.55-9.31V116.67l28.82-15.38a6,6,0,0,0,0-10.58ZM128,202c-44,0-70-21.56-81.52-34.41a2,2,0,0,1-.48-1.3V123.07l79.18,42.22a6,6,0,0,0,5.64,0L178,140.13v51C165,197.35,148.45,202,128,202Zm82-35.71a2,2,0,0,1-.48,1.3A100.25,100.25,0,0,1,190,184.3V133.73l20-10.66Zm-22.15-45a6.27,6.27,0,0,0-1-.71l-56-29.86a6,6,0,0,0-5.64,10.58L175.25,128,128,153.2,20.75,96,128,38.8,235.25,96Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M251.76,88.94l-120-64a8,8,0,0,0-7.52,0l-120,64a8,8,0,0,0,0,14.12L32,117.87v48.42a15.91,15.91,0,0,0,4.06,10.65C49.16,191.53,78.51,216,128,216a130,130,0,0,0,48-8.76V240a8,8,0,0,0,16,0V199.51a115.63,115.63,0,0,0,27.94-22.57A15.91,15.91,0,0,0,224,166.29V117.87l27.76-14.81a8,8,0,0,0,0-14.12ZM128,200c-43.27,0-68.72-21.14-80-33.71V126.4l76.24,40.66a8,8,0,0,0,7.52,0L176,143.47v46.34C163.4,195.69,147.52,200,128,200Zm80-33.75a97.83,97.83,0,0,1-16,14.25V134.93l16-8.53ZM188,118.94l-.22-.13-56-29.87a8,8,0,0,0-7.52,14.12L171,128l-43,22.93L25,96,128,41.07,231,96Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M249.88,92.47l-120-64a4,4,0,0,0-3.76,0l-120,64a4,4,0,0,0,0,7.06L36,115.47v50.82a11.92,11.92,0,0,0,3,8c12.65,14.09,41,37.73,89,37.73,21,0,38.2-4.52,52-10.79V240a4,4,0,0,0,8,0V197.18a111.64,111.64,0,0,0,29-22.91,11.94,11.94,0,0,0,3-8V115.47l29.88-15.94a4,4,0,0,0,0-7.06ZM128,204c-44.83,0-71.25-22-83-35.08a3.92,3.92,0,0,1-1-2.63V119.73l82.12,43.8a4,4,0,0,0,3.76,0L180,136.8v55.53C166.58,199,149.39,204,128,204Zm84-37.71a4,4,0,0,1-1,2.64,103.32,103.32,0,0,1-23,19v-55.4l24-12.8Zm-24.59-42.51a4,4,0,0,0-1.53-1.44l-56-29.87a4,4,0,0,0-3.76,7.06L179.5,128,128,155.47,16.5,96,128,36.53,239.5,96Z"}))]]),IH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184.63,23.14a12,12,0,0,1,15-8A72.34,72.34,0,0,1,228.4,32a12,12,0,0,1-16.58,17.35,48.31,48.31,0,0,0-19.2-11.2A12,12,0,0,1,184.63,23.14ZM232.85,167.8A92,92,0,0,1,64.31,190l-40-69.32A32,32,0,0,1,36,77a31.72,31.72,0,0,1,7.54-3.14A32,32,0,0,1,88.65,32.45a32,32,0,0,1,53,3.55l14.53,25.17A32,32,0,0,1,206.35,68l17.31,30A91.38,91.38,0,0,1,232.85,167.8Zm-30-57.81L185.57,80a8,8,0,0,0-13.86,8h0l6.68,11.57a12,12,0,0,1-3.18,15.59,28,28,0,0,0-6.41,38.1,12,12,0,1,1-19.86,13.46,52.05,52.05,0,0,1,3.9-63.4L120.9,48A8,8,0,0,0,107,56l24.25,42a12,12,0,1,1-20.78,12L79.33,56a8,8,0,0,0-13.85,8L99,122a12,12,0,0,1-20.78,12L58.93,100.67a8,8,0,1,0-13.85,8L85.1,178a68,68,0,0,0,117.78-68ZM50.46,198a12,12,0,1,0-20.78,12,132.79,132.79,0,0,0,20,26.38,12,12,0,1,0,17.17-16.76A109.2,109.2,0,0,1,50.46,198Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M184,213.27A80,80,0,0,1,74.7,184l-40-69.32a20,20,0,0,1,34.64-20L55.08,70A20,20,0,0,1,89.73,50l6.92,12h0a20,20,0,0,1,34.64-20l30,52A20,20,0,0,1,196,74l17.31,30A80,80,0,0,1,184,213.27Z",opacity:"0.2"}),s.createElement("path",{d:"M220.17,100,202.86,70a28,28,0,0,0-38.24-10.25,27.69,27.69,0,0,0-9,8.34L138.2,38a28,28,0,0,0-48.48,0A28,28,0,0,0,48.15,74l1.59,2.76A27.67,27.67,0,0,0,38,80.41a28,28,0,0,0-10.24,38.25l40,69.32a87.47,87.47,0,0,0,53.43,41,88.56,88.56,0,0,0,22.92,3,88,88,0,0,0,76.06-132Zm-6.66,62.64A72,72,0,0,1,81.62,180l-40-69.32a12,12,0,0,1,20.78-12L81.63,132a8,8,0,1,0,13.85-8L62,66A12,12,0,1,1,82.78,54L114,108a8,8,0,1,0,13.85-8L103.57,58h0a12,12,0,1,1,20.78-12l33.42,57.9a48,48,0,0,0-5.54,60.6,8,8,0,0,0,13.24-9A32,32,0,0,1,172.78,112a8,8,0,0,0,2.13-10.4L168.23,90A12,12,0,1,1,189,78l17.31,30A71.56,71.56,0,0,1,213.51,162.62ZM184.25,31.71A8,8,0,0,1,194,26a59.62,59.62,0,0,1,36.53,28l.33.57a8,8,0,1,1-13.85,8l-.33-.57a43.67,43.67,0,0,0-26.8-20.5A8,8,0,0,1,184.25,31.71ZM80.89,237a8,8,0,0,1-11.23,1.33A119.56,119.56,0,0,1,40.06,204a8,8,0,0,1,13.86-8,103.67,103.67,0,0,0,25.64,29.72A8,8,0,0,1,80.89,237Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M219.31,98.46A88,88,0,1,1,67.08,186.77h0L26.15,115.88a16,16,0,0,1,27.69-16L72.4,132a8,8,0,0,0,13.86-8L47,56A16,16,0,0,1,74.69,40L114,108a8,8,0,1,0,13.85-8l-30-52a16,16,0,0,1,27.71-16L166,102.12A48.25,48.25,0,0,0,152,136a47.59,47.59,0,0,0,9.6,28.8,8,8,0,1,0,12.79-9.61A32,32,0,0,1,181,110.26a8,8,0,0,0,2.17-10.43L171.71,80a16,16,0,0,1,27.71-16l19.89,34.46Zm-29.37-57A43.74,43.74,0,0,1,216.74,62l.33.57a8,8,0,0,0,13.86-8L230.6,54a59.64,59.64,0,0,0-36.54-28,8,8,0,0,0-4.12,15.46ZM79.58,225.72A103.58,103.58,0,0,1,53.93,196a8,8,0,0,0-13.86,8,119.56,119.56,0,0,0,29.6,34.28,8,8,0,0,0,9.91-12.56Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M218.44,101,201.13,71a26,26,0,0,0-45.58,1L136.47,39a26,26,0,0,0-46.14,2.19A26,26,0,0,0,49.88,73l3.29,5.7a26,26,0,0,0-23.69,39L69.5,187a85.44,85.44,0,0,0,52.21,40.08,86.71,86.71,0,0,0,22.4,3,86,86,0,0,0,74.33-129Zm-3,62.16A74,74,0,0,1,79.89,181l-40-69.32a14,14,0,0,1,24.25-14L83.36,131a6,6,0,0,0,10.39-6L60.27,67A14,14,0,1,1,84.52,53l31.17,54a6,6,0,0,0,5.2,3,5.9,5.9,0,0,0,3-.81,6,6,0,0,0,2.2-8.2L101.83,59a14,14,0,0,1,24.25-14l34.2,59.23a46,46,0,0,0-6.4,59.13,6,6,0,0,0,9.94-6.73,34,34,0,0,1,7.76-46.26,6,6,0,0,0,1.6-7.8L166.49,91a14,14,0,1,1,24.25-14l17.31,30A73.53,73.53,0,0,1,215.44,163.14ZM186.18,32.22A6,6,0,0,1,193.52,28a57.59,57.59,0,0,1,35.32,27l.33.57a6,6,0,1,1-10.39,6l-.33-.57a45.69,45.69,0,0,0-28-21.43A6,6,0,0,1,186.18,32.22ZM79.32,235.71a6,6,0,0,1-8.42,1A117.79,117.79,0,0,1,41.79,203a6,6,0,0,1,10.4-6,105.48,105.48,0,0,0,26.14,30.29A6,6,0,0,1,79.32,235.71Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220.17,100,202.86,70a28,28,0,0,0-38.24-10.25,27.69,27.69,0,0,0-9,8.34L138.2,38a28,28,0,0,0-48.48,0A28,28,0,0,0,48.15,74l1.59,2.76A27.67,27.67,0,0,0,38,80.41a28,28,0,0,0-10.24,38.25l40,69.32a87.47,87.47,0,0,0,53.43,41,88.56,88.56,0,0,0,22.92,3,88,88,0,0,0,76.06-132Zm-6.66,62.64A72,72,0,0,1,81.62,180l-40-69.32a12,12,0,0,1,20.78-12L81.63,132a8,8,0,1,0,13.85-8L62,66A12,12,0,1,1,82.78,54L114,108a8,8,0,1,0,13.85-8L103.57,58h0a12,12,0,1,1,20.78-12l33.42,57.9a48,48,0,0,0-5.54,60.6,8,8,0,0,0,13.24-9A32,32,0,0,1,172.78,112a8,8,0,0,0,2.13-10.4L168.23,90A12,12,0,1,1,189,78l17.31,30A71.56,71.56,0,0,1,213.51,162.62ZM184.25,31.71A8,8,0,0,1,194,26a59.62,59.62,0,0,1,36.53,28l.33.57a8,8,0,1,1-13.85,8l-.33-.57a43.67,43.67,0,0,0-26.8-20.5A8,8,0,0,1,184.25,31.71ZM80.89,237a8,8,0,0,1-11.23,1.33A119.56,119.56,0,0,1,40.06,204a8,8,0,0,1,13.86-8,103.67,103.67,0,0,0,25.64,29.72A8,8,0,0,1,80.89,237Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.71,102,199.4,72a24,24,0,0,0-43.57,4.52L134.74,40a24,24,0,0,0-43.69,4.9A24,24,0,0,0,51.61,72l5.31,9.19a24,24,0,0,0-25.71,35.47l40,69.32a83.4,83.4,0,0,0,51,39.14,84.45,84.45,0,0,0,21.88,2.9,84,84,0,0,0,72.6-126Zm.67,61.67A76,76,0,0,1,78.16,182l-40-69.32a16,16,0,0,1,27.71-16L85.09,130A4,4,0,0,0,92,126L58.54,68A16,16,0,1,1,86.25,52l31.17,54a4,4,0,1,0,6.93-4L100.1,60a16,16,0,0,1,27.72-16l35,60.63a44,44,0,0,0-7.28,57.61,4,4,0,1,0,6.62-4.49,36,36,0,0,1,8.22-49,4,4,0,0,0,1.07-5.2L164.76,92a16,16,0,1,1,27.71-16l17.31,30A75.52,75.52,0,0,1,217.38,163.65ZM188.12,32.74A4,4,0,0,1,193,29.9,55.65,55.65,0,0,1,227.11,56l.33.58A4,4,0,0,1,226,62a4,4,0,0,1-5.47-1.46l-.33-.57A47.62,47.62,0,0,0,191,37.63,4,4,0,0,1,188.12,32.74ZM77.75,234.48A4,4,0,0,1,74.61,236a4,4,0,0,1-2.47-.86A115.55,115.55,0,0,1,43.53,202a4,4,0,1,1,6.92-4,107.72,107.72,0,0,0,26.64,30.86A4,4,0,0,1,77.75,234.48Z"}))]]),FH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222.14,105.85l-80-80a20,20,0,0,0-28.28,0l-80,80A19.86,19.86,0,0,0,28,120v96a12,12,0,0,0,12,12h64a12,12,0,0,0,12-12V164h24v52a12,12,0,0,0,12,12h64a12,12,0,0,0,12-12V120A19.86,19.86,0,0,0,222.14,105.85ZM204,204H164V152a12,12,0,0,0-12-12H104a12,12,0,0,0-12,12v52H52V121.65l76-76,76,76Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,120v96H152V152H104v64H40V120a8,8,0,0,1,2.34-5.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,216,120Z",opacity:"0.2"}),s.createElement("path",{d:"M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,120v96a8,8,0,0,1-8,8H160a8,8,0,0,1-8-8V164a4,4,0,0,0-4-4H108a4,4,0,0,0-4,4v52a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V120a16,16,0,0,1,4.69-11.31l80-80a16,16,0,0,1,22.62,0l80,80A16,16,0,0,1,224,120Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M217.9,110.1l-80-80a14,14,0,0,0-19.8,0l-80,80A13.92,13.92,0,0,0,34,120v96a6,6,0,0,0,6,6h64a6,6,0,0,0,6-6V158h36v58a6,6,0,0,0,6,6h64a6,6,0,0,0,6-6V120A13.92,13.92,0,0,0,217.9,110.1ZM210,210H158V152a6,6,0,0,0-6-6H104a6,6,0,0,0-6,6v58H46V120a2,2,0,0,1,.58-1.42l80-80a2,2,0,0,1,2.84,0l80,80A2,2,0,0,1,210,120Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.49,111.51l-80-80a12,12,0,0,0-17,0l-80,80A12,12,0,0,0,36,120v96a4,4,0,0,0,4,4h64a4,4,0,0,0,4-4V156h40v60a4,4,0,0,0,4,4h64a4,4,0,0,0,4-4V120A12,12,0,0,0,216.49,111.51ZM212,212H156V152a4,4,0,0,0-4-4H104a4,4,0,0,0-4,4v60H44V120a4,4,0,0,1,1.17-2.83l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,212,120Z"}))]]),_H=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V40A20,20,0,0,0,200,20Zm-4,192H60V44H196ZM84,68A12,12,0,0,1,96,56h64a12,12,0,0,1,0,24H96A12,12,0,0,1,84,68Zm8.8,127.37a48,48,0,0,1,70.4,0,12,12,0,0,0,17.6-16.32,72,72,0,0,0-19.21-14.68,44,44,0,1,0-67.19,0,72.12,72.12,0,0,0-19.2,14.68,12,12,0,0,0,17.6,16.32ZM128,116a20,20,0,1,1-20,20A20,20,0,0,1,128,116Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,32H56a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H200a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32ZM128,168a32,32,0,1,1,32-32A32,32,0,0,1,128,168Z",opacity:"0.2"}),s.createElement("path",{d:"M75.19,198.4a8,8,0,0,0,11.21-1.6,52,52,0,0,1,83.2,0,8,8,0,1,0,12.8-9.6A67.88,67.88,0,0,0,155,165.51a40,40,0,1,0-53.94,0A67.88,67.88,0,0,0,73.6,187.2,8,8,0,0,0,75.19,198.4ZM128,112a24,24,0,1,1-24,24A24,24,0,0,1,128,112Zm72-88H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V40A16,16,0,0,0,200,24Zm0,192H56V40H200ZM88,64a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,64Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V40A16,16,0,0,0,200,24ZM96,48h64a8,8,0,0,1,0,16H96a8,8,0,0,1,0-16Zm84.81,150.4a8,8,0,0,1-11.21-1.6,52,52,0,0,0-83.2,0,8,8,0,1,1-12.8-9.6A67.88,67.88,0,0,1,101,165.51a40,40,0,1,1,53.94,0A67.88,67.88,0,0,1,182.4,187.2,8,8,0,0,1,180.81,198.4ZM152,136a24,24,0,1,1-24-24A24,24,0,0,1,152,136Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M151.11,166.13a38,38,0,1,0-46.22,0A65.75,65.75,0,0,0,75.2,188.4a6,6,0,0,0,9.6,7.2,54,54,0,0,1,86.4,0,6,6,0,0,0,9.6-7.2A65.75,65.75,0,0,0,151.11,166.13ZM128,110a26,26,0,1,1-26,26A26,26,0,0,1,128,110Zm72-84H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V40A14,14,0,0,0,200,26Zm2,190a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2ZM90,64a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H96A6,6,0,0,1,90,64Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M75.19,198.4a8,8,0,0,0,11.21-1.6,52,52,0,0,1,83.2,0,8,8,0,1,0,12.8-9.6A67.88,67.88,0,0,0,155,165.51a40,40,0,1,0-53.94,0A67.88,67.88,0,0,0,73.6,187.2,8,8,0,0,0,75.19,198.4ZM128,112a24,24,0,1,1-24,24A24,24,0,0,1,128,112Zm72-88H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V40A16,16,0,0,0,200,24Zm0,192H56V40H200ZM88,64a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,64Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M146.7,166.75a36,36,0,1,0-37.4,0A63.61,63.61,0,0,0,76.8,189.6a4,4,0,0,0,6.4,4.8,56,56,0,0,1,89.6,0,4,4,0,0,0,6.4-4.8A63.65,63.65,0,0,0,146.7,166.75ZM100,136a28,28,0,1,1,28,28A28,28,0,0,1,100,136ZM200,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V40A12,12,0,0,0,200,28Zm4,188a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4ZM92,64a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H96A4,4,0,0,1,92,64Z"}))]]),VH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M144,96a16,16,0,1,1,16,16A16,16,0,0,1,144,96Zm92-40V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56ZM44,60v79.72l33.86-33.86a20,20,0,0,1,28.28,0L147.31,147l17.18-17.17a20,20,0,0,1,28.28,0L212,149.09V60Zm0,136H162.34L92,125.66l-48,48Zm168,0V183l-33.37-33.37L164.28,164l32,32Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,56V178.06l-39.72-39.72a8,8,0,0,0-11.31,0L147.31,164,97.66,114.34a8,8,0,0,0-11.32,0L32,168.69V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM156,88a12,12,0,1,1-12,12A12,12,0,0,1,156,88Zm60,112H40V160.69l46.34-46.35a8,8,0,0,1,11.32,0h0L165,181.66a8,8,0,0,0,11.32-11.32l-17.66-17.65L173,138.34a8,8,0,0,1,11.31,0L216,170.07V200Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V163.57L188.53,134.1a14,14,0,0,0-19.8,0l-21.42,21.42L101.9,110.1a14,14,0,0,0-19.8,0L38,154.2V56A2,2,0,0,1,40,54ZM38,200V171.17l52.58-52.58a2,2,0,0,1,2.84,0L176.83,202H40A2,2,0,0,1,38,200Zm178,2H193.8l-38-38,21.41-21.42a2,2,0,0,1,2.83,0l38,38V200A2,2,0,0,1,216,202ZM146,100a10,10,0,1,1,10,10A10,10,0,0,1,146,100Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM40,52H216a4,4,0,0,1,4,4V168.4l-32.89-32.89a12,12,0,0,0-17,0l-22.83,22.83-46.82-46.83a12,12,0,0,0-17,0L36,159V56A4,4,0,0,1,40,52ZM36,200V170.34l53.17-53.17a4,4,0,0,1,5.66,0L181.66,204H40A4,4,0,0,1,36,200Zm180,4H193l-40-40,22.83-22.83a4,4,0,0,1,5.66,0L220,179.71V200A4,4,0,0,1,216,204ZM148,100a8,8,0,1,1,8,8A8,8,0,0,1,148,100Z"}))]]),ZH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,28H48A20,20,0,0,0,28,48V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V48A20,20,0,0,0,208,28Zm-4,24v63.72L186.14,97.86a20,20,0,0,0-28.28,0L52,203.72V52ZM85.66,204,172,117.66l32,32V204ZM76,96a20,20,0,1,1,20,20A20,20,0,0,1,76,96Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,40H48a8,8,0,0,0-8,8V208a8,8,0,0,0,8,8h8.69L166.34,106.34a8,8,0,0,1,11.32,0L216,144.69V48A8,8,0,0,0,208,40ZM96,112a16,16,0,1,1,16-16A16,16,0,0,1,96,112Z",opacity:"0.2"}),s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM48,48H208v77.38l-24.69-24.7a16,16,0,0,0-22.62,0L53.37,208H48ZM208,208H76l96-96,36,36v60ZM96,120A24,24,0,1,0,72,96,24,24,0,0,0,96,120Zm0-32a8,8,0,1,1-8,8A8,8,0,0,1,96,88Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM48,48H208v77.38l-24.69-24.7a16,16,0,0,0-22.62,0L53.37,208H48ZM80,96a16,16,0,1,1,16,16A16,16,0,0,1,80,96Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,34H48A14,14,0,0,0,34,48V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V48A14,14,0,0,0,208,34ZM46,208V48a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2v82.2l-28.1-28.1a14,14,0,0,0-19.8,0L54.2,210H48A2,2,0,0,1,46,208Zm162,2H71.17l99.41-99.41a2,2,0,0,1,2.83,0L210,147.17V208A2,2,0,0,1,208,210ZM96,118A22,22,0,1,0,74,96,22,22,0,0,0,96,118Zm0-32A10,10,0,1,1,86,96,10,10,0,0,1,96,86Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM48,48H208v77.38l-24.69-24.7a16,16,0,0,0-22.62,0L53.37,208H48ZM208,208H76l96-96,36,36v60ZM96,120A24,24,0,1,0,72,96,24,24,0,0,0,96,120Zm0-32a8,8,0,1,1-8,8A8,8,0,0,1,96,88Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36ZM44,208V48a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4v87l-31.51-31.52a12,12,0,0,0-17,0L55,212H48A4,4,0,0,1,44,208Zm164,4H66.34L169.17,109.17a4,4,0,0,1,5.66,0L212,146.34V208A4,4,0,0,1,208,212ZM96,116A20,20,0,1,0,76,96,20,20,0,0,0,96,116Zm0-32A12,12,0,1,1,84,96,12,12,0,0,1,96,84Z"}))]]),zH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M252,128a60,60,0,0,1-102.43,42.43l-.49-.53L89.22,102.31a36,36,0,1,0,0,51.38l3.08-3.48a12,12,0,1,1,18,15.91l-3.35,3.78-.49.53a60,60,0,1,1,0-84.86l.49.53,59.86,67.59a36,36,0,1,0,0-51.38l-3.08,3.48a12,12,0,1,1-18-15.91l3.35-3.78.49-.53A60,60,0,0,1,252,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.94,161.94a48,48,0,0,1-67.88,0L128,128l30.06-33.94a48,48,0,0,1,67.88,67.88ZM30.06,94.06a48,48,0,0,0,67.88,67.88L128,128,97.94,94.06A48,48,0,0,0,30.06,94.06Z",opacity:"0.2"}),s.createElement("path",{d:"M248,128a56,56,0,0,1-95.6,39.6l-.33-.35L92.12,99.55a40,40,0,1,0,0,56.9l8.52-9.62a8,8,0,1,1,12,10.61l-8.69,9.81-.33.35a56,56,0,1,1,0-79.2l.33.35,59.95,67.7a40,40,0,1,0,0-56.9l-8.52,9.62a8,8,0,1,1-12-10.61l8.69-9.81.33-.35A56,56,0,0,1,248,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM204.28,156.28a40,40,0,0,1-56.4.17L97.29,111.34,97,111A24,24,0,1,0,97,145c.36-.36.71-.73,1-1.1a8,8,0,1,1,12,10.6c-.55.62-1.13,1.23-1.71,1.81a40,40,0,1,1-.17-56.73l50.58,45.11.33.31A24,24,0,1,0,159,111c-.36.36-.7.72-1,1.1a8,8,0,0,1-12-10.59c.54-.62,1.12-1.24,1.71-1.82a40,40,0,0,1,56.57,56.56Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M246,128a54,54,0,0,1-92.18,38.18,3.07,3.07,0,0,1-.25-.26l-60-67.74a42,42,0,1,0,0,59.64l8.57-9.67a6,6,0,1,1,9,8l-8.69,9.81a3.07,3.07,0,0,1-.25.26,54,54,0,1,1,0-76.36,3.07,3.07,0,0,1,.25.26l60,67.74a42,42,0,1,0,0-59.64l-8.57,9.67a6,6,0,1,1-9-8l8.69-9.81a3.07,3.07,0,0,1,.25-.26A54,54,0,0,1,246,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M248,128a56,56,0,0,1-95.6,39.6l-.33-.35L92.12,99.55a40,40,0,1,0,0,56.9l8.52-9.62a8,8,0,1,1,12,10.61l-8.69,9.81-.33.35a56,56,0,1,1,0-79.2l.33.35,59.95,67.7a40,40,0,1,0,0-56.9l-8.52,9.62a8,8,0,1,1-12-10.61l8.69-9.81.33-.35A56,56,0,0,1,248,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M244,128a52,52,0,0,1-88.77,36.77l-.17-.18L95,96.8a44,44,0,1,0,0,62.4l8.6-9.72a4,4,0,0,1,6,5.3l-8.68,9.81-.17.18a52,52,0,1,1,0-73.54l.17.18,60,67.79a44,44,0,1,0,0-62.4l-8.6,9.72a4,4,0,0,1-6-5.3l8.68-9.81.17-.18A52,52,0,0,1,244,128Z"}))]]),BH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),UH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M196,76a16,16,0,1,1-16-16A16,16,0,0,1,196,76Zm48,22.74A84.3,84.3,0,0,1,160.11,180H160a83.52,83.52,0,0,1-23.65-3.38l-7.86,7.87A12,12,0,0,1,120,188H108v12a12,12,0,0,1-12,12H84v12a12,12,0,0,1-12,12H40a20,20,0,0,1-20-20V187.31a19.86,19.86,0,0,1,5.86-14.14l53.52-53.52A84,84,0,1,1,244,98.74ZM202.43,53.57A59.48,59.48,0,0,0,158,36c-32,1-58,27.89-58,59.89a59.69,59.69,0,0,0,4.2,22.19,12,12,0,0,1-2.55,13.21L44,189v23H60V200a12,12,0,0,1,12-12H84V176a12,12,0,0,1,12-12h19l9.65-9.65a12,12,0,0,1,13.22-2.55A59.58,59.58,0,0,0,160,156h.08c32,0,58.87-26.07,59.89-58A59.55,59.55,0,0,0,202.43,53.57Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,98.36C230.73,136.92,198.67,168,160.09,168a71.68,71.68,0,0,1-26.92-5.17h0L120,176H96v24H72v24H40a8,8,0,0,1-8-8V187.31a8,8,0,0,1,2.34-5.65l58.83-58.83h0A71.68,71.68,0,0,1,88,95.91c0-38.58,31.08-70.64,69.64-71.87A72,72,0,0,1,232,98.36Z",opacity:"0.2"}),s.createElement("path",{d:"M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM224,98.1c-1.09,34.09-29.75,61.86-63.89,61.9H160a63.7,63.7,0,0,1-23.65-4.51,8,8,0,0,0-8.84,1.68L116.69,168H96a8,8,0,0,0-8,8v16H72a8,8,0,0,0-8,8v16H40V187.31l58.83-58.82a8,8,0,0,0,1.68-8.84A63.72,63.72,0,0,1,96,95.92c0-34.14,27.81-62.8,61.9-63.89A64,64,0,0,1,224,98.1ZM192,76a12,12,0,1,1-12-12A12,12,0,0,1,192,76Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM180,92a16,16,0,1,1,16-16A16,16,0,0,1,180,92Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M215.15,40.85A78,78,0,0,0,86.2,121.31l-56.1,56.1a13.94,13.94,0,0,0-4.1,9.9V216a14,14,0,0,0,14,14H72a6,6,0,0,0,6-6V206H96a6,6,0,0,0,6-6V182h18a6,6,0,0,0,4.24-1.76l10.45-10.44A77.59,77.59,0,0,0,160,174h.1A78,78,0,0,0,215.15,40.85ZM226,98.16c-1.12,35.16-30.67,63.8-65.88,63.84a65.93,65.93,0,0,1-24.51-4.67,6,6,0,0,0-6.64,1.26L117.51,170H96a6,6,0,0,0-6,6v18H72a6,6,0,0,0-6,6v18H40a2,2,0,0,1-2-2V187.31a2,2,0,0,1,.58-1.41l58.83-58.83a6,6,0,0,0,1.26-6.64A65.61,65.61,0,0,1,94,95.92C94,60.71,122.68,31.16,157.83,30A66,66,0,0,1,226,98.16ZM190,76a10,10,0,1,1-10-10A10,10,0,0,1,190,76Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM224,98.1c-1.09,34.09-29.75,61.86-63.89,61.9H160a63.7,63.7,0,0,1-23.65-4.51,8,8,0,0,0-8.84,1.68L116.69,168H96a8,8,0,0,0-8,8v16H72a8,8,0,0,0-8,8v16H40V187.31l58.83-58.82a8,8,0,0,0,1.68-8.84A63.72,63.72,0,0,1,96,95.92c0-34.14,27.81-62.8,61.9-63.89A64,64,0,0,1,224,98.1ZM192,76a12,12,0,1,1-12-12A12,12,0,0,1,192,76Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.74,42.26A76,76,0,0,0,88.51,121.84l-57,57A11.93,11.93,0,0,0,28,187.31V216a12,12,0,0,0,12,12H72a4,4,0,0,0,4-4V204H96a4,4,0,0,0,4-4V180h20a4,4,0,0,0,2.83-1.17l11.33-11.34A75.72,75.72,0,0,0,160,172h.1A76,76,0,0,0,213.74,42.26Zm14.22,56c-1.15,36.22-31.6,65.72-67.87,65.77H160a67.52,67.52,0,0,1-25.21-4.83,4,4,0,0,0-4.45.83l-12,12H96a4,4,0,0,0-4,4v20H72a4,4,0,0,0-4,4v20H40a4,4,0,0,1-4-4V187.31a4.06,4.06,0,0,1,1.17-2.83L96,125.66a4,4,0,0,0,.83-4.45A67.51,67.51,0,0,1,92,95.91C92,59.64,121.55,29.19,157.77,28A68,68,0,0,1,228,98.23ZM188,76a8,8,0,1,1-8-8A8,8,0,0,1,188,76Z"}))]]),WH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,44H32A20,20,0,0,0,12,64V192a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V64A20,20,0,0,0,224,44Zm-4,144H36V68H220ZM52,128a12,12,0,0,1,12-12H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,128Zm0-36A12,12,0,0,1,64,80H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,92Zm0,72a12,12,0,0,1,12-12h8a12,12,0,0,1,0,24H64A12,12,0,0,1,52,164Zm108,0a12,12,0,0,1-12,12H108a12,12,0,0,1,0-24h40A12,12,0,0,1,160,164Zm44,0a12,12,0,0,1-12,12h-8a12,12,0,0,1,0-24h8A12,12,0,0,1,204,164Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,64V192a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H224A8,8,0,0,1,232,64Z",opacity:"0.2"}),s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM64,168H48a8,8,0,0,1,0-16H64a8,8,0,0,1,0,16Zm96,0H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm48,0H192a8,8,0,0,1,0-16h16a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,50H32A14,14,0,0,0,18,64V192a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50Zm2,142a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H224a2,2,0,0,1,2,2Zm-20-64a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,128Zm0-32a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,96ZM70,160a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12h8A6,6,0,0,1,70,160Zm96,0a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,160Zm40,0a6,6,0,0,1-6,6h-8a6,6,0,0,1,0-12h8A6,6,0,0,1,206,160Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,52H32A12,12,0,0,0,20,64V192a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52Zm4,140a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H224a4,4,0,0,1,4,4Zm-24-64a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,128Zm0-32a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,96ZM68,160a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8h8A4,4,0,0,1,68,160Zm96,0a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,160Zm40,0a4,4,0,0,1-4,4h-8a4,4,0,0,1,0-8h8A4,4,0,0,1,204,160Z"}))]]),KH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M219.71,117.38a12,12,0,0,0-7.25-8.52L161.28,88.39l10.59-70.61a12,12,0,0,0-20.64-10l-112,120a12,12,0,0,0,4.31,19.33l51.18,20.47L84.13,238.22a12,12,0,0,0,20.64,10l112-120A12,12,0,0,0,219.71,117.38ZM113.6,203.55l6.27-41.77a12,12,0,0,0-7.41-12.92L68.74,131.37,142.4,52.45l-6.27,41.77a12,12,0,0,0,7.41,12.92l43.72,17.49Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M96,240l16-80L48,136,160,16,144,96l64,24Z",opacity:"0.2"}),s.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.85,125.46l-112,120a8,8,0,0,1-13.69-7l14.66-73.33L45.19,143.49a8,8,0,0,1-3-13l112-120a8,8,0,0,1,13.69,7L153.18,90.9l57.63,21.61a8,8,0,0,1,3,12.95Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M213.84,118.63a6,6,0,0,0-3.73-4.25L150.88,92.17l15-75a6,6,0,0,0-10.27-5.27l-112,120a6,6,0,0,0,2.28,9.71l59.23,22.21-15,75a6,6,0,0,0,3.14,6.52A6.07,6.07,0,0,0,96,246a6,6,0,0,0,4.39-1.91l112-120A6,6,0,0,0,213.84,118.63ZM106,220.46l11.85-59.28a6,6,0,0,0-3.77-6.8l-55.6-20.85,91.46-98L138.12,94.82a6,6,0,0,0,3.77,6.8l55.6,20.85Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M211.89,119.09a4,4,0,0,0-2.49-2.84l-60.81-22.8,15.33-76.67a4,4,0,0,0-6.84-3.51l-112,120a4,4,0,0,0-1,3.64,4,4,0,0,0,2.49,2.84l60.81,22.8L92.08,239.22a4,4,0,0,0,6.84,3.51l112-120A4,4,0,0,0,211.89,119.09ZM102.68,227l13.24-66.2a4,4,0,0,0-2.52-4.53L55,134.36,153.32,29l-13.24,66.2a4,4,0,0,0,2.52,4.53L201,121.64Z"}))]]),GH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),s.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),YH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M252,120a52.06,52.06,0,0,0-52-52H160.32c-3.44-.21-52.6-4-99.46-43.3A20,20,0,0,0,28,40V200a19.8,19.8,0,0,0,11.54,18.12,19.86,19.86,0,0,0,21.32-2.81A192.92,192.92,0,0,1,144,174.47v26.2a20,20,0,0,0,8.9,16.64,11.35,11.35,0,0,0,1.39.8l14.44,7.06A20,20,0,0,0,198.37,213l11.09-41.82A52.07,52.07,0,0,0,252,120ZM52,191.63V48.4c36.17,28.07,72.17,38.1,92,41.66V150C124.17,153.52,88.17,163.55,52,191.63ZM176.39,202.2,168,198.1V172h16.4ZM200,148H168V92h32a28,28,0,1,1,0,56Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,120a40,40,0,0,1-40,40H160V80h40A40,40,0,0,1,240,120Z",opacity:"0.2"}),s.createElement("path",{d:"M248,120a48.05,48.05,0,0,0-48-48H160.2c-2.91-.17-53.62-3.74-101.91-44.24A16,16,0,0,0,32,40V200a16,16,0,0,0,26.29,12.25c37.77-31.68,77-40.76,93.71-43.3v31.72A16,16,0,0,0,159.12,214l11,7.33A16,16,0,0,0,194.5,212l11.77-44.36A48.07,48.07,0,0,0,248,120ZM48,199.93V40h0c42.81,35.91,86.63,45,104,47.24v65.48C134.65,155,90.84,164.07,48,199.93Zm131,8,0,.11-11-7.33V168h21.6ZM200,152H168V88h32a32,32,0,1,1,0,64Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,72H160.2c-2.91-.17-53.62-3.74-101.91-44.24A16,16,0,0,0,32,40V200a16,16,0,0,0,26.29,12.25c37.77-31.68,77-40.76,93.71-43.3v31.72A16,16,0,0,0,159.12,214l11,7.33A16,16,0,0,0,194.5,212l11.77-44.36A48,48,0,0,0,200,72ZM179,207.89l0,.11-11-7.33V168h21.6ZM200,152H168V88h32a32,32,0,1,1,0,64Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M246,120a46.05,46.05,0,0,0-46-46H160.15c-2.58-.15-54.1-3.57-103.15-44.71A14,14,0,0,0,34,40V200a13.85,13.85,0,0,0,8.07,12.68A14.16,14.16,0,0,0,48,214a13.9,13.9,0,0,0,9-3.3c40-33.52,81.57-42,97-44.07v34a14,14,0,0,0,6.23,11.65l11,7.33a14,14,0,0,0,21.32-8.17l12.13-45.71A46.07,46.07,0,0,0,246,120ZM49.29,201.52A2,2,0,0,1,46,200V40a1.9,1.9,0,0,1,1.15-1.8A2.08,2.08,0,0,1,48,38a1.91,1.91,0,0,1,1.26.48c44,36.92,89,45.19,104.71,47v69C138.29,156.33,93.3,164.61,49.29,201.52Zm131.64,7a2,2,0,0,1-3.05,1.18l-11-7.33a2,2,0,0,1-.89-1.67V166h26.2ZM200,154H166V86h34a34,34,0,1,1,0,68Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M248,120a48.05,48.05,0,0,0-48-48H160.2c-2.91-.17-53.62-3.74-101.91-44.24A16,16,0,0,0,32,40V200a16,16,0,0,0,26.29,12.25c37.77-31.68,77-40.76,93.71-43.3v31.72A16,16,0,0,0,159.12,214l11,7.33A16,16,0,0,0,194.5,212l11.77-44.36A48.07,48.07,0,0,0,248,120ZM48,199.93V40h0c42.81,35.91,86.63,45,104,47.24v65.48C134.65,155,90.84,164.07,48,199.93Zm131,8,0,.11-11-7.33V168h21.6ZM200,152H168V88h32a32,32,0,1,1,0,64Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,76H160.1c-2.19-.11-54.55-3.38-104.38-45.17A12,12,0,0,0,36,40V200a11.88,11.88,0,0,0,6.92,10.87A12.18,12.18,0,0,0,48,212a11.93,11.93,0,0,0,7.69-2.83c42.46-35.62,86.76-43.25,100.28-44.8v36.29a12,12,0,0,0,5.34,10l11,7.33a12,12,0,0,0,18.28-7l12.49-47.09A44,44,0,0,0,200,76Zm-44,80.3c-13.53,1.35-60,8.62-105.42,46.75A4,4,0,0,1,44,200V40a4,4,0,0,1,2.3-3.62A4.32,4.32,0,0,1,48.05,36a3.88,3.88,0,0,1,2.53,1C96,75.09,142.47,82.36,156,83.71ZM182.87,209a4,4,0,0,1-6.1,2.36l-11-7.33a4,4,0,0,1-1.78-3.33V164h30.8ZM200,156H164V84h36a36,36,0,0,1,0,72Z"}))]]),qH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H40a12,12,0,0,1,0-24H216A12,12,0,0,1,228,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H72a8,8,0,0,1,0-16H184a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H40a6,6,0,0,1,0-12H216A6,6,0,0,1,222,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H40a4,4,0,0,1,0-8H216A4,4,0,0,1,220,128Z"}))]]),XH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M160,80a32,32,0,1,0-32-32A32,32,0,0,0,160,80Zm0-40a8,8,0,1,1-8,8A8,8,0,0,1,160,40Zm94.32,153.88L199.76,101.8A19.85,19.85,0,0,0,182.55,92h0a19.83,19.83,0,0,0-17.2,9.8l-18.7,31.55-37.42-63.5a20,20,0,0,0-34.46,0L1.66,193.91A12,12,0,0,0,12,212H244a12,12,0,0,0,10.32-18.12ZM92,87.87,108.57,116H75.43ZM33,188l28.28-48h61.44L151,188Zm145.86,0L160.56,157l22-37.1L222.94,188Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M144,52a20,20,0,1,1,20,20A20,20,0,0,1,144,52Zm49.44,55.92a8,8,0,0,0-13.77,0l-33,55.75-21-35.67H50.35L8,200H248Z",opacity:"0.2"}),s.createElement("path",{d:"M164,80a28,28,0,1,0-28-28A28,28,0,0,0,164,80Zm0-40a12,12,0,1,1-12,12A12,12,0,0,1,164,40Zm90.88,155.92-54.56-92.08A15.87,15.87,0,0,0,186.55,96h0a15.85,15.85,0,0,0-13.76,7.84L146.63,148l-44.84-76.1a16,16,0,0,0-27.58,0L1.11,195.94A8,8,0,0,0,8,208H248a8,8,0,0,0,6.88-12.08ZM88,80l23.57,40H64.43ZM22,192l33-56h66l33,56Zm150.57,0-16.66-28.28L186.55,112,234,192Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M254.88,195.92l-54.56-92.08A15.87,15.87,0,0,0,186.55,96h0a15.85,15.85,0,0,0-13.76,7.84l-15.64,26.39a4,4,0,0,0,0,4.07l26.8,45.47a8.13,8.13,0,0,1-1.89,10.55,8,8,0,0,1-11.8-2.26L101.79,71.88a16,16,0,0,0-27.58,0L1.11,195.94a8,8,0,0,0,1,9.52A8.23,8.23,0,0,0,8.23,208H247.77a8.29,8.29,0,0,0,6.09-2.55A8,8,0,0,0,254.88,195.92ZM64.43,120,88,80l23.57,40ZM140,52a24,24,0,1,1,24,24A24,24,0,0,1,140,52Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M164,78a26,26,0,1,0-26-26A26,26,0,0,0,164,78Zm0-40a14,14,0,1,1-14,14A14,14,0,0,1,164,38Zm89.16,158.94L198.6,104.86a13.9,13.9,0,0,0-12-6.86h0a13.88,13.88,0,0,0-12,6.86l-27.88,47.05-46.56-79a14,14,0,0,0-24.13,0L2.83,197A6,6,0,0,0,8,206H248a6,6,0,0,0,5.16-9.06ZM86.27,79a2,2,0,0,1,3.46,0l25.34,43H60.93ZM18.5,194l35.36-60h68.29l19.3,32.77,0,0,16,27.2Zm152.93,0-17.85-30.29L184.83,111a2,2,0,0,1,1.72-1,1.93,1.93,0,0,1,1.72,1l49.2,83Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M164,80a28,28,0,1,0-28-28A28,28,0,0,0,164,80Zm0-40a12,12,0,1,1-12,12A12,12,0,0,1,164,40Zm90.88,155.92-54.56-92.08A15.87,15.87,0,0,0,186.55,96h0a15.85,15.85,0,0,0-13.76,7.84L146.63,148l-44.84-76.1a16,16,0,0,0-27.58,0L1.11,195.94A8,8,0,0,0,8,208H248a8,8,0,0,0,6.88-12.08ZM88,80l23.57,40H64.43ZM22,192l33-56h66l18.74,31.8,0,0L154,192Zm150.57,0-16.66-28.28L186.55,112,234,192Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M164,76a24,24,0,1,0-24-24A24,24,0,0,0,164,76Zm0-40a16,16,0,1,1-16,16A16,16,0,0,1,164,36Zm87.44,162-54.56-92.08A11.91,11.91,0,0,0,186.55,100h0a11.89,11.89,0,0,0-10.32,5.88l-29.61,50L98.34,73.91a12,12,0,0,0-20.68,0L4.55,198A4,4,0,0,0,8,204H248a4,4,0,0,0,3.44-6ZM84.55,78a4,4,0,0,1,6.9,0l27.12,46H57.43ZM15,196l37.71-64h70.58L161,196Zm155.29,0-19-32.29L183.11,110a4,4,0,0,1,6.88,0l51,86Z"}))]]),QH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.6,62.64l-88-48.17a19.91,19.91,0,0,0-19.2,0l-88,48.17A20,20,0,0,0,20,80.19v95.62a20,20,0,0,0,10.4,17.55l88,48.17a19.89,19.89,0,0,0,19.2,0l88-48.17A20,20,0,0,0,236,175.81V80.19A20,20,0,0,0,225.6,62.64ZM128,36.57,200,76,178.57,87.73l-72-39.42Zm0,78.83L56,76,81.56,62l72,39.41ZM44,96.79l72,39.4v76.67L44,173.44Zm96,116.07V136.19l24-13.13V152a12,12,0,0,0,24,0V109.92l24-13.13v76.65Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,129.09V232a8,8,0,0,1-3.84-1l-88-48.18a8,8,0,0,1-4.16-7V80.18a8,8,0,0,1,.7-3.25Z",opacity:"0.2"}),s.createElement("path",{d:"M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32l80.34,44-29.77,16.3-80.35-44ZM128,120,47.66,76l33.9-18.56,80.34,44ZM40,90l80,43.78v85.79L40,175.82Zm176,85.78h0l-80,43.79V133.82l32-17.51V152a8,8,0,0,0,16,0V107.55L216,90v85.77Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32l80.35,44L178.57,92.29l-80.35-44Zm0,88L47.65,76,81.56,57.43l80.35,44Zm88,55.85h0l-80,43.79V133.83l32-17.51V152a8,8,0,0,0,16,0V107.56l32-17.51v85.76Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222.72,67.91l-88-48.18a13.9,13.9,0,0,0-13.44,0l-88,48.18A14,14,0,0,0,26,80.18v95.64a14,14,0,0,0,7.28,12.27l88,48.18a13.92,13.92,0,0,0,13.44,0l88-48.18A14,14,0,0,0,230,175.82V80.18A14,14,0,0,0,222.72,67.91ZM127,30.25a2,2,0,0,1,1.92,0L212.51,76,178.57,94.57,94.05,48.31ZM122,223,39,177.57a2,2,0,0,1-1-1.75V86.66l84,46ZM43.49,76,81.56,55.15l84.51,46.26L128,122.24ZM218,175.82a2,2,0,0,1-1,1.75h0L134,223V132.64l36-19.71V152a6,6,0,0,0,12,0V106.37l36-19.71Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32l80.34,44-29.77,16.3-80.35-44ZM128,120,47.66,76l33.9-18.56,80.34,44ZM40,90l80,43.78v85.79L40,175.82Zm176,85.78h0l-80,43.79V133.82l32-17.51V152a8,8,0,0,0,16,0V107.55L216,90v85.77Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.76,69.66l-88-48.18a12,12,0,0,0-11.52,0l-88,48.18A12,12,0,0,0,28,80.18v95.64a12,12,0,0,0,6.24,10.52l88,48.18a11.95,11.95,0,0,0,11.52,0l88-48.18A12,12,0,0,0,228,175.82V80.18A12,12,0,0,0,221.76,69.66ZM126.08,28.5a3.94,3.94,0,0,1,3.84,0L216.67,76,178.5,96.89a4,4,0,0,0-.58-.4l-88-48.18Zm1.92,96L39.33,76,81.56,52.87l88.67,48.54Zm-89.92,54.8a4,4,0,0,1-2.08-3.5V83.29l88,48.16v94.91Zm179.84,0h0l-85.92,47V131.45l40-21.89V152a4,4,0,0,0,8,0V105.18l40-21.89v92.53A4,4,0,0,1,217.92,179.32Z"}))]]),JH=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M203.57,51A107.9,107.9,0,0,0,20,128c0,44.72,27.6,82.25,72,97.94A36,36,0,0,0,140,192a12,12,0,0,1,12-12h46.21a35.79,35.79,0,0,0,35.1-28A108.6,108.6,0,0,0,236,127.09,107.23,107.23,0,0,0,203.57,51Zm6.34,95.67a11.91,11.91,0,0,1-11.7,9.3H152a36,36,0,0,0-36,36,12,12,0,0,1-16,11.3c-16.65-5.88-30.65-15.76-40.48-28.56A76,76,0,0,1,44,128a84,84,0,0,1,83.13-84H128a84.35,84.35,0,0,1,84,83.29A84.72,84.72,0,0,1,209.91,146.71ZM144,76a16,16,0,1,1-16-16A16,16,0,0,1,144,76Zm-44,24A16,16,0,1,1,84,84,16,16,0,0,1,100,100Zm0,56a16,16,0,1,1-16-16A16,16,0,0,1,100,156Zm88-56a16,16,0,1,1-16-16A16,16,0,0,1,188,100Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,127.17a96.48,96.48,0,0,1-2.39,22.18A24,24,0,0,1,198.21,168H152a24,24,0,0,0-24,24,24,24,0,0,1-32,22.61C58.73,201.44,32,169.81,32,128a96,96,0,0,1,95-96C179.84,31.47,223.55,74.35,224,127.17Z",opacity:"0.2"}),s.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89ZM84,168a12,12,0,1,1,12-12A12,12,0,0,1,84,168Zm0-56a12,12,0,1,1,12-12A12,12,0,0,1,84,112Zm44-24a12,12,0,1,1,12-12A12,12,0,0,1,128,88Zm44,24a12,12,0,1,1,12-12A12,12,0,0,1,172,112Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M199.37,55.31A101.32,101.32,0,0,0,128,26h-1A102,102,0,0,0,26,128c0,42.09,26.07,77.44,68,92.26A30.21,30.21,0,0,0,104.11,222,30.06,30.06,0,0,0,134,192a18,18,0,0,1,18-18h46.21a29.82,29.82,0,0,0,29.25-23.31A102.71,102.71,0,0,0,230,127.11,101.25,101.25,0,0,0,199.37,55.31ZM215.76,148a17.89,17.89,0,0,1-17.55,14H152a30,30,0,0,0-30,30,18,18,0,0,1-24,17C61,195.86,38,164.85,38,128a90,90,0,0,1,89.07-90H128a90.34,90.34,0,0,1,90,89.22A90.46,90.46,0,0,1,215.76,148ZM138,76a10,10,0,1,1-10-10A10,10,0,0,1,138,76ZM94,100A10,10,0,1,1,84,90,10,10,0,0,1,94,100Zm0,56a10,10,0,1,1-10-10A10,10,0,0,1,94,156Zm88-56a10,10,0,1,1-10-10A10,10,0,0,1,182,100Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M198,56.74A99.31,99.31,0,0,0,128,28h-1A100,100,0,0,0,28,128c0,41.22,25.55,75.85,66.69,90.38a28.34,28.34,0,0,0,9.42,1.63A28,28,0,0,0,132,192a20,20,0,0,1,20-20h46.21a27.84,27.84,0,0,0,27.3-21.76,100.37,100.37,0,0,0,2.49-23.1A99.26,99.26,0,0,0,198,56.74Zm19.74,91.72A19.89,19.89,0,0,1,198.21,164H152a28,28,0,0,0-28,28,20,20,0,0,1-26.64,18.83C59.51,197.46,36,165.72,36,128a92,92,0,0,1,91.05-92H128a92,92,0,0,1,89.72,112.46ZM136,76a8,8,0,1,1-8-8A8,8,0,0,1,136,76ZM92,100a8,8,0,1,1-8-8A8,8,0,0,1,92,100Zm0,56a8,8,0,1,1-8-8A8,8,0,0,1,92,156Zm88-56a8,8,0,1,1-8-8A8,8,0,0,1,180,100Z"}))]]),eO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M212.48,136.49l-82.06,82a60,60,0,0,1-84.85-84.88l98.16-97.89a40,40,0,0,1,56.56,56.59l-.17.16-95.8,92.22a12,12,0,1,1-16.64-17.3l95.71-92.12a16,16,0,0,0-22.7-22.56L62.53,150.57a36,36,0,0,0,50.93,50.91l82.06-82a12,12,0,0,1,17,17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M180.75,104.75,204,128l-82.06,81.94a48,48,0,0,1-67.88-67.88L153.37,41.37a32,32,0,0,1,45.26,45.26Z",opacity:"0.2"}),s.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,50.34a8,8,0,0,0-11.32,0L87.09,143A24,24,0,1,0,121,177l49.32-50.32a8,8,0,1,1,11.42,11.2l-49.37,50.38a40,40,0,1,1-56.62-56.51L143,63.09A24,24,0,1,1,177,97L109.71,165.6a8,8,0,1,1-11.42-11.2L165.6,85.71a8,8,0,0,0,.06-11.37Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208.25,123.76a6,6,0,0,1,0,8.49l-82.06,82a54,54,0,0,1-76.36-76.39L149.1,37.14a38,38,0,1,1,53.77,53.72L103.59,191.54a22,22,0,1,1-31.15-31.09l83.28-84.67a6,6,0,0,1,8.56,8.42L81,168.91a10,10,0,1,0,14.11,14.18L194.35,82.4a26,26,0,1,0-36.74-36.8L58.33,146.28a42,42,0,1,0,59.37,59.44l82.06-82A6,6,0,0,1,208.25,123.76Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M206.83,125.17a4,4,0,0,1,0,5.66l-82.06,82a52,52,0,0,1-73.54-73.55L150.52,38.55a36,36,0,1,1,50.94,50.9l-99.3,100.69a20,20,0,1,1-28.3-28.27l83.29-84.68a4,4,0,1,1,5.7,5.61L79.54,167.5a12,12,0,1,0,16.95,17L195.78,83.81A28,28,0,1,0,156.2,44.18L56.91,144.87a44,44,0,1,0,62.21,62.26l82-82A4,4,0,0,1,206.83,125.17Z"}))]]),tO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),s.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),nO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.15,70.54,185.46,25.86a20,20,0,0,0-28.28,0L33.86,149.17A19.86,19.86,0,0,0,28,163.31V208a20,20,0,0,0,20,20H216a12,12,0,0,0,0-24H125L230.15,98.83A20,20,0,0,0,230.15,70.54ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),s.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM48,163.31l88-88L180.69,120l-88,88H48Zm144-54.62L147.32,64l24-24L216,84.69Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM192,108.69,147.32,64l24-24L216,84.69Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M225.91,74.79,181.22,30.1a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H216a6,6,0,0,0,0-12H110.49L225.91,94.59A14,14,0,0,0,225.91,74.79ZM93.52,210H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.49,183.52,120ZM217.42,86.1,192,111.52,144.49,64,169.9,38.59a2,2,0,0,1,2.83,0l44.69,44.68A2,2,0,0,1,217.42,86.1Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.69,147.32,64l24-24L216,84.69Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L39.51,154.83A12,12,0,0,0,36,163.31V208a12,12,0,0,0,12,12H216a4,4,0,0,0,0-8H105.66L224.49,93.17A12,12,0,0,0,224.49,76.2ZM94.34,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.82L136,69.66,186.35,120ZM218.83,87.51,192,114.34,141.66,64l26.83-26.83a4,4,0,0,1,5.66,0l44.68,44.69A4,4,0,0,1,218.83,87.51Z"}))]]),rO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]),sO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm52-84a12,12,0,0,1-12,12H140v28a12,12,0,0,1-24,0V140H88a12,12,0,0,1,0-24h28V88a12,12,0,0,1,24,0v28h28A12,12,0,0,1,180,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48-88a8,8,0,0,1-8,8H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32A8,8,0,0,1,176,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.13,104.13,0,0,0,128,24Zm40,112H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32a8,8,0,0,1,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm46-90a6,6,0,0,1-6,6H134v34a6,6,0,0,1-12,0V134H88a6,6,0,0,1,0-12h34V88a6,6,0,0,1,12,0v34h34A6,6,0,0,1,174,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48-88a8,8,0,0,1-8,8H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32A8,8,0,0,1,176,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm44-92a4,4,0,0,1-4,4H132v36a4,4,0,0,1-8,0V132H88a4,4,0,0,1,0-8h36V88a4,4,0,0,1,8,0v36h36A4,4,0,0,1,172,128Z"}))]]),aO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M116,128V48a12,12,0,0,1,24,0v80a12,12,0,0,1-24,0Zm66.55-82a12,12,0,0,0-13.1,20.1C191.41,80.37,204,103,204,128a76,76,0,0,1-152,0c0-25,12.59-47.63,34.55-61.95A12,12,0,0,0,73.45,46C44.56,64.78,28,94.69,28,128a100,100,0,0,0,200,0C228,94.69,211.44,64.78,182.55,46Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),s.createElement("path",{d:"M120,128V48a8,8,0,0,1,16,0v80a8,8,0,0,1-16,0Zm60.37-78.7a8,8,0,0,0-8.74,13.4C194.74,77.77,208,101.57,208,128a80,80,0,0,1-160,0c0-26.43,13.26-50.23,36.37-65.3a8,8,0,0,0-8.74-13.4C47.9,67.38,32,96.06,32,128a96,96,0,0,0,192,0C224,96.06,208.1,67.38,180.37,49.3Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104,104,0,0,0,128,24Zm-8,40a8,8,0,0,1,16,0v64a8,8,0,0,1-16,0Zm8,144A80,80,0,0,1,83.55,61.48a8,8,0,1,1,8.9,13.29,64,64,0,1,0,71.1,0,8,8,0,1,1,8.9-13.29A80,80,0,0,1,128,208Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M122,128V48a6,6,0,0,1,12,0v80a6,6,0,0,1-12,0Zm57.28-77A6,6,0,0,0,172.72,61C196.41,76.47,210,100.88,210,128a82,82,0,0,1-164,0c0-27.12,13.59-51.53,37.28-67A6,6,0,0,0,76.72,51C49.57,68.68,34,96.75,34,128a94,94,0,0,0,188,0C222,96.75,206.43,68.68,179.28,51Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M120,128V48a8,8,0,0,1,16,0v80a8,8,0,0,1-16,0Zm60.37-78.7a8,8,0,0,0-8.74,13.4C194.74,77.77,208,101.57,208,128a80,80,0,0,1-160,0c0-26.43,13.26-50.23,36.37-65.3a8,8,0,0,0-8.74-13.4C47.9,67.38,32,96.06,32,128a96,96,0,0,0,192,0C224,96.06,208.1,67.38,180.37,49.3Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M124,128V48a4,4,0,0,1,8,0v80a4,4,0,0,1-8,0Zm54.18-75.35a4,4,0,1,0-4.36,6.7C198.08,75.17,212,100.2,212,128a84,84,0,0,1-168,0c0-27.8,13.92-52.83,38.18-68.65a4,4,0,0,0-4.36-6.7C51.24,70,36,97.44,36,128a92,92,0,0,0,184,0C220,97.44,204.76,70,178.18,52.65Z"}))]]),oO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M144,180a16,16,0,1,1-16-16A16,16,0,0,1,144,180Zm92-52A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128ZM128,64c-24.26,0-44,17.94-44,40v4a12,12,0,0,0,24,0v-4c0-8.82,9-16,20-16s20,7.18,20,16-9,16-20,16a12,12,0,0,0-12,12v8a12,12,0,0,0,23.73,2.56C158.31,137.88,172,122.37,172,104,172,81.94,152.26,64,128,64Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,168a12,12,0,1,1,12-12A12,12,0,0,1,128,192Zm8-48.72V144a8,8,0,0,1-16,0v-8a8,8,0,0,1,8-8c13.23,0,24-9,24-20s-10.77-20-24-20-24,9-24,20v4a8,8,0,0,1-16,0v-4c0-19.85,17.94-36,40-36s40,16.15,40,36C168,125.38,154.24,139.93,136,143.28Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M138,180a10,10,0,1,1-10-10A10,10,0,0,1,138,180ZM128,74c-21,0-38,15.25-38,34v4a6,6,0,0,0,12,0v-4c0-12.13,11.66-22,26-22s26,9.87,26,22-11.66,22-26,22a6,6,0,0,0-6,6v8a6,6,0,0,0,12,0v-2.42c18.11-2.58,32-16.66,32-33.58C166,89.25,149,74,128,74Zm102,54A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M136,180a8,8,0,1,1-8-8A8,8,0,0,1,136,180ZM128,76c-19.85,0-36,14.36-36,32v4a4,4,0,0,0,8,0v-4c0-13.23,12.56-24,28-24s28,10.77,28,24-12.56,24-28,24a4,4,0,0,0-4,4v8a4,4,0,0,0,8,0v-4.2c18-1.77,32-15.36,32-31.8C164,90.36,147.85,76,128,76Zm100,52A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),iO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H88V56H216V200Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,200V56a2,2,0,0,1,2-2H82V202H40A2,2,0,0,1,38,200Zm180,0a2,2,0,0,1-2,2H94V54H216a2,2,0,0,1,2,2Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,200V56a4,4,0,0,1,4-4H84V204H40A4,4,0,0,1,36,200Zm184,0a4,4,0,0,1-4,4H92V52H216a4,4,0,0,1,4,4Z"}))]]),lO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M40,92H70.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24H137.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24Zm64-24A12,12,0,1,1,92,80,12,12,0,0,1,104,68Zm112,96H201.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24h94.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24Zm-48,24a12,12,0,1,1,12-12A12,12,0,0,1,168,188Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,80a24,24,0,1,1-24-24A24,24,0,0,1,128,80Zm40,72a24,24,0,1,0,24,24A24,24,0,0,0,168,152Z",opacity:"0.2"}),s.createElement("path",{d:"M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M32,80a8,8,0,0,1,8-8H77.17a28,28,0,0,1,53.66,0H216a8,8,0,0,1,0,16H130.83a28,28,0,0,1-53.66,0H40A8,8,0,0,1,32,80Zm184,88H194.83a28,28,0,0,0-53.66,0H40a8,8,0,0,0,0,16H141.17a28,28,0,0,0,53.66,0H216a8,8,0,0,0,0-16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M40,86H74.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12H133.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12Zm64-24A18,18,0,1,1,86,80,18,18,0,0,1,104,62ZM216,170H197.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12h98.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12Zm-48,24a18,18,0,1,1,18-18A18,18,0,0,1,168,194Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M40,84H76.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8H131.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8Zm64-24A20,20,0,1,1,84,80,20,20,0,0,1,104,60ZM216,172H195.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8H140.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8Zm-48,24a20,20,0,1,1,20-20A20,20,0,0,1,168,196Z"}))]]),cO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M234.36,170A12,12,0,0,1,230,186.37l-96,56a12,12,0,0,1-12.1,0l-96-56a12,12,0,0,1,12.09-20.74l90,52.48L218,165.63A12,12,0,0,1,234.36,170ZM218,117.63,128,170.11,38.05,117.63A12,12,0,0,0,26,138.37l96,56a12,12,0,0,0,12.1,0l96-56A12,12,0,0,0,218,117.63ZM20,80a12,12,0,0,1,6-10.37l96-56a12.06,12.06,0,0,1,12.1,0l96,56a12,12,0,0,1,0,20.74l-96,56a12,12,0,0,1-12.1,0l-96-56A12,12,0,0,1,20,80Zm35.82,0L128,122.11,200.18,80,128,37.89Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,80l-96,56L32,80l96-56Z",opacity:"0.2"}),s.createElement("path",{d:"M230.91,172A8,8,0,0,1,228,182.91l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,36,169.09l92,53.65,92-53.65A8,8,0,0,1,230.91,172ZM220,121.09l-92,53.65L36,121.09A8,8,0,0,0,28,134.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,121.09ZM24,80a8,8,0,0,1,4-6.91l96-56a8,8,0,0,1,8.06,0l96,56a8,8,0,0,1,0,13.82l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,24,80Zm23.88,0L128,126.74,208.12,80,128,33.26Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,169.09l-92,53.65L36,169.09A8,8,0,0,0,28,182.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,169.09Z"}),s.createElement("path",{d:"M220,121.09l-92,53.65L36,121.09A8,8,0,0,0,28,134.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,121.09Z"}),s.createElement("path",{d:"M28,86.91l96,56a8,8,0,0,0,8.06,0l96-56a8,8,0,0,0,0-13.82l-96-56a8,8,0,0,0-8.06,0l-96,56a8,8,0,0,0,0,13.82Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M229.18,173a6,6,0,0,1-2.16,8.2l-96,56a6,6,0,0,1-6,0l-96-56a6,6,0,0,1,6-10.36l93,54.23,93-54.23A6,6,0,0,1,229.18,173ZM221,122.82l-93,54.23L35,122.82a6,6,0,0,0-6,10.36l96,56a6,6,0,0,0,6,0l96-56a6,6,0,0,0-6-10.36ZM26,80a6,6,0,0,1,3-5.18l96-56a6,6,0,0,1,6,0l96,56a6,6,0,0,1,0,10.36l-96,56a6,6,0,0,1-6,0l-96-56A6,6,0,0,1,26,80Zm17.91,0L128,129.05,212.09,80,128,31Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.91,172A8,8,0,0,1,228,182.91l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,36,169.09l92,53.65,92-53.65A8,8,0,0,1,230.91,172ZM220,121.09l-92,53.65L36,121.09A8,8,0,0,0,28,134.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,121.09ZM24,80a8,8,0,0,1,4-6.91l96-56a8,8,0,0,1,8.06,0l96,56a8,8,0,0,1,0,13.82l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,24,80Zm23.88,0L128,126.74,208.12,80,128,33.26Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.45,174a4,4,0,0,1-1.44,5.48l-96,56a4,4,0,0,1-4,0l-96-56a4,4,0,0,1,4-6.92l94,54.83,94-54.83A4,4,0,0,1,227.45,174ZM222,124.54l-94,54.83L34,124.54a4,4,0,0,0-4,6.92l96,56a4,4,0,0,0,4,0l96-56a4,4,0,0,0-4-6.92ZM28,80a4,4,0,0,1,2-3.46l96-56a4,4,0,0,1,4,0l96,56a4,4,0,0,1,0,6.92l-96,56a4,4,0,0,1-4,0l-96-56A4,4,0,0,1,28,80Zm11.94,0L128,131.37,216.06,80,128,28.63Z"}))]]),uO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M243,96a20.33,20.33,0,0,0-17.74-14l-56.59-4.57L146.83,24.62a20.36,20.36,0,0,0-37.66,0L87.35,77.44,30.76,82A20.45,20.45,0,0,0,19.1,117.88l43.18,37.24-13.2,55.7A20.37,20.37,0,0,0,79.57,233L128,203.19,176.43,233a20.39,20.39,0,0,0,30.49-22.15l-13.2-55.7,43.18-37.24A20.43,20.43,0,0,0,243,96ZM172.53,141.7a12,12,0,0,0-3.84,11.86L181.58,208l-47.29-29.08a12,12,0,0,0-12.58,0L74.42,208l12.89-54.4a12,12,0,0,0-3.84-11.86L41.2,105.24l55.4-4.47a12,12,0,0,0,10.13-7.38L128,41.89l21.27,51.5a12,12,0,0,0,10.13,7.38l55.4,4.47Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M229.06,108.79l-48.7,42,14.88,62.79a8.4,8.4,0,0,1-12.52,9.17L128,189.09,73.28,222.74a8.4,8.4,0,0,1-12.52-9.17l14.88-62.79-48.7-42A8.46,8.46,0,0,1,31.73,94L95.64,88.8l24.62-59.6a8.36,8.36,0,0,1,15.48,0l24.62,59.6L224.27,94A8.46,8.46,0,0,1,229.06,108.79Z",opacity:"0.2"}),s.createElement("path",{d:"M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M234.29,114.85l-45,38.83L203,211.75a16.4,16.4,0,0,1-24.5,17.82L128,198.49,77.47,229.57A16.4,16.4,0,0,1,53,211.75l13.76-58.07-45-38.83A16.46,16.46,0,0,1,31.08,86l59-4.76,22.76-55.08a16.36,16.36,0,0,1,30.27,0l22.75,55.08,59,4.76a16.46,16.46,0,0,1,9.37,28.86Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M237.28,97.87A14.18,14.18,0,0,0,224.76,88l-60.25-4.87-23.22-56.2a14.37,14.37,0,0,0-26.58,0L91.49,83.11,31.24,88a14.18,14.18,0,0,0-12.52,9.89A14.43,14.43,0,0,0,23,113.32L69,152.93l-14,59.25a14.4,14.4,0,0,0,5.59,15,14.1,14.1,0,0,0,15.91.6L128,196.12l51.58,31.71a14.1,14.1,0,0,0,15.91-.6,14.4,14.4,0,0,0,5.59-15l-14-59.25L233,113.32A14.43,14.43,0,0,0,237.28,97.87Zm-12.14,6.37-48.69,42a6,6,0,0,0-1.92,5.92l14.88,62.79a2.35,2.35,0,0,1-.95,2.57,2.24,2.24,0,0,1-2.6.1L131.14,184a6,6,0,0,0-6.28,0L70.14,217.61a2.24,2.24,0,0,1-2.6-.1,2.35,2.35,0,0,1-1-2.57l14.88-62.79a6,6,0,0,0-1.92-5.92l-48.69-42a2.37,2.37,0,0,1-.73-2.65,2.28,2.28,0,0,1,2.07-1.65l63.92-5.16a6,6,0,0,0,5.06-3.69l24.63-59.6a2.35,2.35,0,0,1,4.38,0l24.63,59.6a6,6,0,0,0,5.06,3.69l63.92,5.16a2.28,2.28,0,0,1,2.07,1.65A2.37,2.37,0,0,1,225.14,104.24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M235.36,98.49A12.21,12.21,0,0,0,224.59,90l-61.47-5L139.44,27.67a12.37,12.37,0,0,0-22.88,0L92.88,85,31.41,90a12.45,12.45,0,0,0-7.07,21.84l46.85,40.41L56.87,212.64a12.35,12.35,0,0,0,18.51,13.49L128,193.77l52.62,32.36a12.12,12.12,0,0,0,13.69-.51,12.28,12.28,0,0,0,4.82-13l-14.32-60.42,46.85-40.41A12.29,12.29,0,0,0,235.36,98.49Zm-8.93,7.26-48.68,42a4,4,0,0,0-1.28,3.95l14.87,62.79a4.37,4.37,0,0,1-1.72,4.65,4.24,4.24,0,0,1-4.81.18L130.1,185.67a4,4,0,0,0-4.2,0L71.19,219.32a4.24,4.24,0,0,1-4.81-.18,4.37,4.37,0,0,1-1.72-4.65L79.53,151.7a4,4,0,0,0-1.28-3.95l-48.68-42A4.37,4.37,0,0,1,28.25,101a4.31,4.31,0,0,1,3.81-3L96,92.79a4,4,0,0,0,3.38-2.46L124,30.73a4.35,4.35,0,0,1,8.08,0l24.62,59.6A4,4,0,0,0,160,92.79l63.9,5.15a4.31,4.31,0,0,1,3.81,3A4.37,4.37,0,0,1,226.43,105.75Z"}))]]),dO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M236,96a12,12,0,0,0-.44-3.3L221.2,42.51A20.08,20.08,0,0,0,202,28H54A20.08,20.08,0,0,0,34.8,42.51L20.46,92.7A12,12,0,0,0,20,96h0v16a43.94,43.94,0,0,0,16,33.92V216a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V145.92A43.94,43.94,0,0,0,236,112V96ZM57.05,52H199l9.14,32H47.91Zm91,56v4a20,20,0,0,1-40,0v-4ZM53,128.71A20,20,0,0,1,44,112v-4H84v4a20,20,0,0,1-20,20,19.76,19.76,0,0,1-9.07-2.2A11.54,11.54,0,0,0,53,128.71ZM196,204H60V155.81c1.32.12,2.65.19,4,.19a43.86,43.86,0,0,0,32-13.85,43.89,43.89,0,0,0,64,0A43.86,43.86,0,0,0,192,156c1.35,0,2.68-.07,4-.19Zm16-92a20,20,0,0,1-9,16.71,11.66,11.66,0,0,0-1.88,1.09A20,20,0,0,1,172,112v-4h40Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,96v16a32,32,0,0,1-64,0V96H96v16a32,32,0,0,1-64,0V96L46.34,45.8A8,8,0,0,1,54,40H202a8,8,0,0,1,7.69,5.8Z",opacity:"0.2"}),s.createElement("path",{d:"M231.69,93.81,217.35,43.6A16.07,16.07,0,0,0,202,32H54A16.07,16.07,0,0,0,38.65,43.6L24.31,93.81A7.94,7.94,0,0,0,24,96v16a40,40,0,0,0,16,32v72a8,8,0,0,0,8,8H208a8,8,0,0,0,8-8V144a40,40,0,0,0,16-32V96A7.94,7.94,0,0,0,231.69,93.81ZM54,48H202l11.42,40H42.61Zm98,56v8a24,24,0,0,1-48,0v-8ZM51.06,132.2A24,24,0,0,1,40,112v-8H88v8a24,24,0,0,1-35.12,21.26A7.88,7.88,0,0,0,51.06,132.2ZM200,208H56V151.2a40.57,40.57,0,0,0,8,.8,40,40,0,0,0,32-16,40,40,0,0,0,64,0,40,40,0,0,0,32,16,40.57,40.57,0,0,0,8-.8Zm16-96a24,24,0,0,1-11.07,20.2,8.08,8.08,0,0,0-1.8,1.05A24,24,0,0,1,168,112v-8h48Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M231.69,93.81,217.35,43.6A16.07,16.07,0,0,0,202,32H54A16.07,16.07,0,0,0,38.65,43.6L24.31,93.81A7.94,7.94,0,0,0,24,96v16a40,40,0,0,0,16,32v72a8,8,0,0,0,8,8H208a8,8,0,0,0,8-8V144a40,40,0,0,0,16-32V96A7.94,7.94,0,0,0,231.69,93.81ZM88,112a24,24,0,0,1-35.12,21.26,7.88,7.88,0,0,0-1.82-1.06A24,24,0,0,1,40,112v-8H88Zm64,0a24,24,0,0,1-48,0v-8h48Zm64,0a24,24,0,0,1-11.07,20.2,8.08,8.08,0,0,0-1.8,1.05A24,24,0,0,1,168,112v-8h48Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M26.22,94.41A6,6,0,0,0,26,96v16A38,38,0,0,0,42,143V216a6,6,0,0,0,6,6H208a6,6,0,0,0,6-6V143A38,38,0,0,0,230,112V96a5.91,5.91,0,0,0-.23-1.64L215.43,44.15A14.07,14.07,0,0,0,202,34H54A14.07,14.07,0,0,0,40.57,44.15Zm25.89-47A2,2,0,0,1,54,46H202a2,2,0,0,1,1.92,1.45L216.05,90H40ZM102,102h52v10a26,26,0,0,1-52,0Zm-64,0H90v10a26,26,0,0,1-38.18,23,6,6,0,0,0-1.65-1A26,26,0,0,1,38,112ZM202,210H54V148.66a38,38,0,0,0,42-16.21,37.95,37.95,0,0,0,64,0,38,38,0,0,0,42,16.21Zm3.83-76a6,6,0,0,0-1.65,1A26,26,0,0,1,166,112V102h52v10A26,26,0,0,1,205.83,134Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M232,96a7.89,7.89,0,0,0-.3-2.2L217.35,43.6A16.07,16.07,0,0,0,202,32H54A16.07,16.07,0,0,0,38.65,43.6L24.31,93.8A7.89,7.89,0,0,0,24,96h0v16a40,40,0,0,0,16,32v72a8,8,0,0,0,8,8H208a8,8,0,0,0,8-8V144a40,40,0,0,0,16-32V96ZM54,48H202l11.42,40H42.61Zm50,56h48v8a24,24,0,0,1-48,0Zm-16,0v8a24,24,0,0,1-35.12,21.26,7.88,7.88,0,0,0-1.82-1.06A24,24,0,0,1,40,112v-8ZM200,208H56V151.2a40.57,40.57,0,0,0,8,.8,40,40,0,0,0,32-16,40,40,0,0,0,64,0,40,40,0,0,0,32,16,40.57,40.57,0,0,0,8-.8Zm4.93-75.8a8.08,8.08,0,0,0-1.8,1.05A24,24,0,0,1,168,112v-8h48v8A24,24,0,0,1,204.93,132.2Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M28.15,95A3.81,3.81,0,0,0,28,96v16a36,36,0,0,0,16,29.92V216a4,4,0,0,0,4,4H208a4,4,0,0,0,4-4V141.92A36,36,0,0,0,228,112V96a3.81,3.81,0,0,0-.17-1.08L213.5,44.7A12,12,0,0,0,202,36H54A12,12,0,0,0,42.5,44.7Zm22-48.08A4,4,0,0,1,54,44H202a4,4,0,0,1,3.84,2.9L218.7,92H37.3ZM100,100h56v12a28,28,0,0,1-56,0ZM36,112V100H92v12a28,28,0,0,1-41.37,24.59,4,4,0,0,0-1.31-.76A28,28,0,0,1,36,112ZM204,212H52V145.94a36,36,0,0,0,44-17.48,36,36,0,0,0,64,0,36,36,0,0,0,44,17.48Zm2.68-76.17a3.94,3.94,0,0,0-1.3.76A28,28,0,0,1,164,112V100h56v12A28,28,0,0,1,206.68,135.83Z"}))]]),fO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,148H203.89c.07-1.33.11-2.66.11-4a76,76,0,0,0-152,0c0,1.34,0,2.67.11,4H16a12,12,0,0,0,0,24H240a12,12,0,0,0,0-24ZM76,144a52,52,0,0,1,104,0c0,1.34-.07,2.67-.17,4H76.17C76.07,146.67,76,145.34,76,144Zm144,56a12,12,0,0,1-12,12H48a12,12,0,0,1,0-24H208A12,12,0,0,1,220,200ZM12.62,92.21a12,12,0,0,1,15.17-7.59l12,4a12,12,0,1,1-7.58,22.77l-12-4A12,12,0,0,1,12.62,92.21Zm56-48.41a12,12,0,1,1,22.76-7.59l4,12A12,12,0,1,1,72.62,55.8Zm140,60a12,12,0,0,1,7.59-15.18l12-4a12,12,0,0,1,7.58,22.77l-12,4a12,12,0,0,1-15.17-7.59Zm-48-55.59,4-12a12,12,0,1,1,22.76,7.59l-4,12a12,12,0,1,1-22.76-7.59Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,144a64.33,64.33,0,0,1-2,16H66a64,64,0,1,1,126-16Z",opacity:"0.2"}),s.createElement("path",{d:"M240,152H199.55a73.54,73.54,0,0,0,.45-8,72,72,0,0,0-144,0,73.54,73.54,0,0,0,.45,8H16a8,8,0,0,0,0,16H240a8,8,0,0,0,0-16ZM72,144a56,56,0,1,1,111.41,8H72.59A56.13,56.13,0,0,1,72,144Zm144,56a8,8,0,0,1-8,8H48a8,8,0,0,1,0-16H208A8,8,0,0,1,216,200ZM72.84,43.58a8,8,0,0,1,14.32-7.16l8,16a8,8,0,0,1-14.32,7.16Zm-56,48.84a8,8,0,0,1,10.74-3.57l16,8a8,8,0,0,1-7.16,14.31l-16-8A8,8,0,0,1,16.84,92.42Zm192,15.16a8,8,0,0,1,3.58-10.73l16-8a8,8,0,1,1,7.16,14.31l-16,8a8,8,0,0,1-10.74-3.58Zm-48-55.16,8-16a8,8,0,0,1,14.32,7.16l-8,16a8,8,0,1,1-14.32-7.16Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M248,160a8,8,0,0,1-8,8H16a8,8,0,0,1,0-16H56.45a73.54,73.54,0,0,1-.45-8,72,72,0,0,1,144,0,73.54,73.54,0,0,1-.45,8H240A8,8,0,0,1,248,160Zm-40,32H48a8,8,0,0,0,0,16H208a8,8,0,0,0,0-16ZM80.84,59.58a8,8,0,0,0,14.32-7.16l-8-16a8,8,0,0,0-14.32,7.16ZM20.42,103.16l16,8a8,8,0,1,0,7.16-14.31l-16-8a8,8,0,1,0-7.16,14.31ZM216,112a8,8,0,0,0,3.57-.84l16-8a8,8,0,1,0-7.16-14.31l-16,8A8,8,0,0,0,216,112ZM164.42,63.16a8,8,0,0,0,10.74-3.58l8-16a8,8,0,0,0-14.32-7.16l-8,16A8,8,0,0,0,164.42,63.16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,154H197.28a70.91,70.91,0,0,0,.72-10,70,70,0,0,0-140,0,70.91,70.91,0,0,0,.72,10H16a6,6,0,0,0,0,12H240a6,6,0,0,0,0-12ZM70,144a58,58,0,1,1,115.13,10H70.87A58.63,58.63,0,0,1,70,144Zm144,56a6,6,0,0,1-6,6H48a6,6,0,0,1,0-12H208A6,6,0,0,1,214,200ZM74.63,42.69a6,6,0,0,1,10.74-5.37l8,16a6,6,0,0,1-10.74,5.36Zm-56,50.63a6,6,0,0,1,8.05-2.69l16,8a6,6,0,0,1-5.36,10.74l-16-8A6,6,0,0,1,18.63,93.32Zm192,13.36a6,6,0,0,1,2.69-8.05l16-8a6,6,0,1,1,5.36,10.74l-16,8a6,6,0,0,1-8.05-2.69Zm-48-53.36,8-16a6,6,0,0,1,10.74,5.37l-8,16a6,6,0,1,1-10.74-5.36Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,152H199.55a73.54,73.54,0,0,0,.45-8,72,72,0,0,0-144,0,73.54,73.54,0,0,0,.45,8H16a8,8,0,0,0,0,16H240a8,8,0,0,0,0-16ZM72,144a56,56,0,1,1,111.41,8H72.59A56.13,56.13,0,0,1,72,144Zm144,56a8,8,0,0,1-8,8H48a8,8,0,0,1,0-16H208A8,8,0,0,1,216,200ZM72.84,43.58a8,8,0,0,1,14.32-7.16l8,16a8,8,0,0,1-14.32,7.16Zm-56,48.84a8,8,0,0,1,10.74-3.57l16,8a8,8,0,0,1-7.16,14.31l-16-8A8,8,0,0,1,16.84,92.42Zm192,15.16a8,8,0,0,1,3.58-10.73l16-8a8,8,0,1,1,7.16,14.31l-16,8a8,8,0,0,1-10.74-3.58Zm-48-55.16,8-16a8,8,0,0,1,14.32,7.16l-8,16a8,8,0,1,1-14.32-7.16Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240,156H194.94A68,68,0,1,0,60,144a68.73,68.73,0,0,0,1.06,12H16a4,4,0,0,0,0,8H240a4,4,0,0,0,0-8ZM68,144a60,60,0,1,1,118.79,12H69.21A60.16,60.16,0,0,1,68,144Zm144,56a4,4,0,0,1-4,4H48a4,4,0,0,1,0-8H208A4,4,0,0,1,212,200ZM76.42,41.79a4,4,0,0,1,7.16-3.58l8,16a4,4,0,0,1-7.16,3.58Zm-56,52.42a4,4,0,0,1,5.37-1.79l16,8a4,4,0,0,1-3.58,7.16l-16-8A4,4,0,0,1,20.42,94.21Zm192,11.58a4,4,0,0,1,1.79-5.37l16-8a4,4,0,1,1,3.58,7.16l-16,8a4,4,0,0,1-5.37-1.79Zm-48-51.58,8-16a4,4,0,1,1,7.16,3.58l-8,16a4,4,0,0,1-7.16-3.58Z"}))]]),hO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),s.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"}))]]),pO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM188,204H68V72H188ZM76,20A12,12,0,0,1,88,8h80a12,12,0,0,1,0,24H88A12,12,0,0,1,76,20Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),s.createElement("path",{d:"M216,48H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM192,208H64V64H192ZM80,24a8,8,0,0,1,8-8h80a8,8,0,0,1,0,16H88A8,8,0,0,1,80,24Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,56a8,8,0,0,1-8,8h-8V208a16,16,0,0,1-16,16H64a16,16,0,0,1-16-16V64H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,56ZM88,32h80a8,8,0,0,0,0-16H88a8,8,0,0,0,0,16Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM82,24a6,6,0,0,1,6-6h80a6,6,0,0,1,0,12H88A6,6,0,0,1,82,24Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM192,208H64V64H192ZM80,24a8,8,0,0,1,8-8h80a8,8,0,0,1,0,16H88A8,8,0,0,1,80,24Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM84,24a4,4,0,0,1,4-4h80a4,4,0,0,1,0,8H88A4,4,0,0,1,84,24Z"}))]]),mO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M228,144v64a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V144a12,12,0,0,1,24,0v52H204V144a12,12,0,0,1,24,0ZM96.49,80.49,116,61v83a12,12,0,0,0,24,0V61l19.51,19.52a12,12,0,1,0,17-17l-40-40a12,12,0,0,0-17,0l-40,40a12,12,0,1,0,17,17Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z",opacity:"0.2"}),s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM93.66,77.66,120,51.31V144a8,8,0,0,0,16,0V51.31l26.34,26.35a8,8,0,0,0,11.32-11.32l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,93.66,77.66Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM88,80h32v64a8,8,0,0,0,16,0V80h32a8,8,0,0,0,5.66-13.66l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,88,80Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M222,144v64a6,6,0,0,1-6,6H40a6,6,0,0,1-6-6V144a6,6,0,0,1,12,0v58H210V144a6,6,0,0,1,12,0ZM92.24,76.24,122,46.49V144a6,6,0,0,0,12,0V46.49l29.76,29.75a6,6,0,0,0,8.48-8.48l-40-40a6,6,0,0,0-8.48,0l-40,40a6,6,0,0,0,8.48,8.48Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM93.66,77.66,120,51.31V144a8,8,0,0,0,16,0V51.31l26.34,26.35a8,8,0,0,0,11.32-11.32l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,93.66,77.66Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M220,144v64a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V144a4,4,0,0,1,8,0v60H212V144a4,4,0,0,1,8,0ZM90.83,74.83,124,41.66V144a4,4,0,0,0,8,0V41.66l33.17,33.17a4,4,0,1,0,5.66-5.66l-40-40a4,4,0,0,0-5.66,0l-40,40a4,4,0,0,0,5.66,5.66Z"}))]]),gO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M234.38,210a123.36,123.36,0,0,0-60.78-53.23,76,76,0,1,0-91.2,0A123.36,123.36,0,0,0,21.62,210a12,12,0,1,0,20.77,12c18.12-31.32,50.12-50,85.61-50s67.49,18.69,85.61,50a12,12,0,0,0,20.77-12ZM76,96a52,52,0,1,1,52,52A52.06,52.06,0,0,1,76,96Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M192,96a64,64,0,1,1-64-64A64,64,0,0,1,192,96Z",opacity:"0.2"}),s.createElement("path",{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.93,220a8,8,0,0,1-6.93,4H32a8,8,0,0,1-6.92-12c15.23-26.33,38.7-45.21,66.09-54.16a72,72,0,1,1,73.66,0c27.39,8.95,50.86,27.83,66.09,54.16A8,8,0,0,1,230.93,220Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M229.19,213c-15.81-27.32-40.63-46.49-69.47-54.62a70,70,0,1,0-63.44,0C67.44,166.5,42.62,185.67,26.81,213a6,6,0,1,0,10.38,6C56.4,185.81,90.34,166,128,166s71.6,19.81,90.81,53a6,6,0,1,0,10.38-6ZM70,96a58,58,0,1,1,58,58A58.07,58.07,0,0,1,70,96Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M227.46,214c-16.52-28.56-43-48.06-73.68-55.09a68,68,0,1,0-51.56,0c-30.64,7-57.16,26.53-73.68,55.09a4,4,0,0,0,6.92,4C55,184.19,89.62,164,128,164s73,20.19,92.54,54a4,4,0,0,0,3.46,2,3.93,3.93,0,0,0,2-.54A4,4,0,0,0,227.46,214ZM68,96a60,60,0,1,1,60,60A60.07,60.07,0,0,1,68,96Z"}))]]),vO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20ZM79.57,196.57a60,60,0,0,1,96.86,0,83.72,83.72,0,0,1-96.86,0ZM100,120a28,28,0,1,1,28,28A28,28,0,0,1,100,120ZM194,179.94a83.48,83.48,0,0,0-29-23.42,52,52,0,1,0-74,0,83.48,83.48,0,0,0-29,23.42,84,84,0,1,1,131.9,0Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a95.76,95.76,0,0,1-31.8,71.37A72,72,0,0,0,128,160a40,40,0,1,0-40-40,40,40,0,0,0,40,40,72,72,0,0,0-64.2,39.37h0A96,96,0,1,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM74.08,197.5a64,64,0,0,1,107.84,0,87.83,87.83,0,0,1-107.84,0ZM96,120a32,32,0,1,1,32,32A32,32,0,0,1,96,120Zm97.76,66.41a79.66,79.66,0,0,0-36.06-28.75,48,48,0,1,0-59.4,0,79.66,79.66,0,0,0-36.06,28.75,88,88,0,1,1,131.52,0Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M172,120a44,44,0,1,1-44-44A44.05,44.05,0,0,1,172,120Zm60,8A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88.09,88.09,0,0,0-91.47-87.93C77.43,41.89,39.87,81.12,40,128.25a87.65,87.65,0,0,0,22.24,58.16A79.71,79.71,0,0,1,84,165.1a4,4,0,0,1,4.83.32,59.83,59.83,0,0,0,78.28,0,4,4,0,0,1,4.83-.32,79.71,79.71,0,0,1,21.79,21.31A87.62,87.62,0,0,0,216,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26ZM71.44,198a66,66,0,0,1,113.12,0,89.8,89.8,0,0,1-113.12,0ZM94,120a34,34,0,1,1,34,34A34,34,0,0,1,94,120Zm99.51,69.64a77.53,77.53,0,0,0-40-31.38,46,46,0,1,0-51,0,77.53,77.53,0,0,0-40,31.38,90,90,0,1,1,131,0Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM74.08,197.5a64,64,0,0,1,107.84,0,87.83,87.83,0,0,1-107.84,0ZM96,120a32,32,0,1,1,32,32A32,32,0,0,1,96,120Zm97.76,66.41a79.66,79.66,0,0,0-36.06-28.75,48,48,0,1,0-59.4,0,79.66,79.66,0,0,0-36.06,28.75,88,88,0,1,1,131.52,0Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28ZM68.87,198.42a68,68,0,0,1,118.26,0,91.8,91.8,0,0,1-118.26,0Zm124.3-5.55a75.61,75.61,0,0,0-44.51-34,44,44,0,1,0-41.32,0,75.61,75.61,0,0,0-44.51,34,92,92,0,1,1,130.34,0ZM128,156a36,36,0,1,1,36-36A36,36,0,0,1,128,156Z"}))]]),wO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M256,136a12,12,0,0,1-12,12h-8v8a12,12,0,0,1-24,0v-8h-8a12,12,0,0,1,0-24h8v-8a12,12,0,0,1,24,0v8h8A12,12,0,0,1,256,136Zm-54.81,56.28a12,12,0,1,1-18.38,15.44C169.12,191.42,145,172,108,172c-28.89,0-55.46,12.68-74.81,35.72a12,12,0,0,1-18.38-15.44A124.08,124.08,0,0,1,63.5,156.53a72,72,0,1,1,89,0A124,124,0,0,1,201.19,192.28ZM108,148a48,48,0,1,0-48-48A48.05,48.05,0,0,0,108,148Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M168,100a60,60,0,1,1-60-60A60,60,0,0,1,168,100Z",opacity:"0.2"}),s.createElement("path",{d:"M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136ZM144,157.68a68,68,0,1,0-71.9,0c-20.65,6.76-39.23,19.39-54.17,37.17A8,8,0,0,0,24,208H192a8,8,0,0,0,6.13-13.15C183.18,177.07,164.6,164.44,144,157.68Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M254,136a6,6,0,0,1-6,6H230v18a6,6,0,0,1-12,0V142H200a6,6,0,0,1,0-12h18V112a6,6,0,0,1,12,0v18h18A6,6,0,0,1,254,136Zm-57.41,60.14a6,6,0,1,1-9.18,7.72C166.9,179.45,138.69,166,108,166s-58.89,13.45-79.41,37.86a6,6,0,0,1-9.18-7.72C35.14,177.41,55,164.48,77,158.25a66,66,0,1,1,62,0C161,164.48,180.86,177.41,196.59,196.14ZM108,154a54,54,0,1,0-54-54A54.06,54.06,0,0,0,108,154Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M252,136a4,4,0,0,1-4,4H228v20a4,4,0,0,1-8,0V140H200a4,4,0,0,1,0-8h20V112a4,4,0,0,1,8,0v20h20A4,4,0,0,1,252,136Zm-56.94,61.43a4,4,0,0,1-6.12,5.14C168,177.7,139.3,164,108,164s-60,13.7-80.94,38.57a4,4,0,1,1-6.12-5.14c16.71-19.9,38.13-33.13,61.89-38.59a64,64,0,1,1,50.34,0C156.93,164.3,178.35,177.53,195.06,197.43ZM108,156a56,56,0,1,0-56-56A56.06,56.06,0,0,0,108,156Z"}))]]),yO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z",opacity:"0.2"}),s.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"}))]]),bO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z"}))]]),xO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),s.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]),kO=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M168.49,104.49,145,128l23.52,23.51a12,12,0,0,1-17,17L128,145l-23.51,23.52a12,12,0,0,1-17-17L111,128,87.51,104.49a12,12,0,0,1,17-17L128,111l23.51-23.52a12,12,0,0,1,17,17ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,130.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M164.24,100.24,136.48,128l27.76,27.76a6,6,0,1,1-8.48,8.48L128,136.48l-27.76,27.76a6,6,0,0,1-8.48-8.48L119.52,128,91.76,100.24a6,6,0,0,1,8.48-8.48L128,119.52l27.76-27.76a6,6,0,0,1,8.48,8.48ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M162.83,98.83,133.66,128l29.17,29.17a4,4,0,0,1-5.66,5.66L128,133.66,98.83,162.83a4,4,0,0,1-5.66-5.66L122.34,128,93.17,98.83a4,4,0,0,1,5.66-5.66L128,122.34l29.17-29.17a4,4,0,1,1,5.66,5.66ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),$E=s.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),Lt=s.forwardRef((e,t)=>{const{alt:n,color:r,size:a,weight:i,mirrored:l,children:u,weights:f,...h}=e,{color:p="currentColor",size:g,weight:v="regular",mirrored:w=!1,...b}=s.useContext($E);return s.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:a??g,height:a??g,fill:r??p,viewBox:"0 0 256 256",transform:l||w?"scale(-1, 1)":void 0,...b,...h},!!n&&s.createElement("title",null,n),u,f.get(i??v))});Lt.displayName="IconBase";const TE=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:rH}));TE.displayName="ApertureIcon";const DE=TE,HE=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:sH}));HE.displayName="ArchiveIcon";const Rp=HE,OE=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:aH}));OE.displayName="ArrowCircleUpIcon";const IE=OE,FE=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:oH}));FE.displayName="ArrowClockwiseIcon";const _E=FE,VE=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:iH}));VE.displayName="ArrowCounterClockwiseIcon";const H0=VE,ZE=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:lH}));ZE.displayName="ArrowLeftIcon";const O4=ZE,zE=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:cH}));zE.displayName="ArrowLineUpIcon";const SO=zE,BE=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:uH}));BE.displayName="ArrowRightIcon";const _a=BE,UE=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:dH}));UE.displayName="ArrowSquareOutIcon";const Ku=UE,WE=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:fH}));WE.displayName="ArrowUpIcon";const KE=WE,GE=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:hH}));GE.displayName="ArrowsClockwiseIcon";const Ih=GE,YE=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:pH}));YE.displayName="ArrowsDownUpIcon";const EO=YE,qE=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:mH}));qE.displayName="BellIcon";const jg=qE,XE=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:gH}));XE.displayName="CaretDownIcon";const nl=XE,QE=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:vH}));QE.displayName="CaretLeftIcon";const Sa=QE,JE=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:wH}));JE.displayName="CaretRightIcon";const cl=JE,e9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:yH}));e9.displayName="CaretUpIcon";const CO=e9,t9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:bH}));t9.displayName="ChartBarIcon";const jO=t9,n9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:xH}));n9.displayName="CheckIcon";const Un=n9,r9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:kH}));r9.displayName="CircleIcon";const AO=r9,s9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:SH}));s9.displayName="CircleHalfIcon";const NO=s9,a9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:EH}));a9.displayName="CopyIcon";const Fh=a9,o9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:CH}));o9.displayName="CopySimpleIcon";const e3=o9,i9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:jH}));i9.displayName="DeviceMobileIcon";const MO=i9,l9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:AH}));l9.displayName="DotsThreeIcon";const I4=l9,c9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:NH}));c9.displayName="DotsThreeVerticalIcon";const F4=c9,u9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:MH}));u9.displayName="DownloadSimpleIcon";const d9=u9,f9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:RH}));f9.displayName="FilmSlateIcon";const Pp=f9,h9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:PH}));h9.displayName="FolderSimpleIcon";const _4=h9,p9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:LH}));p9.displayName="FolderSimpleMinusIcon";const m9=p9,g9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:$H}));g9.displayName="FrameCornersIcon";const v9=g9,w9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:TH}));w9.displayName="GearSixIcon";const RO=w9,y9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:DH}));y9.displayName="GiftIcon";const PO=y9,b9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:HH}));b9.displayName="GithubLogoIcon";const LO=b9,x9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:OH}));x9.displayName="GraduationCapIcon";const $O=x9,k9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:IH}));k9.displayName="HandWavingIcon";const TO=k9,S9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:FH}));S9.displayName="HouseIcon";const DO=S9,E9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:_H}));E9.displayName="IdentificationBadgeIcon";const Lp=E9,C9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:VH}));C9.displayName="ImageIcon";const HO=C9,j9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:ZH}));j9.displayName="ImageSquareIcon";const Js=j9,A9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:zH}));A9.displayName="InfinityIcon";const N9=A9,M9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:BH}));M9.displayName="InfoIcon";const $p=M9,R9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:UH}));R9.displayName="KeyIcon";const P9=R9,L9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:WH}));L9.displayName="KeyboardIcon";const OO=L9,$9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:KH}));$9.displayName="LightningIcon";const O0=$9,T9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:GH}));T9.displayName="MagnifyingGlassIcon";const Gu=T9,D9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:YH}));D9.displayName="MegaphoneIcon";const IO=D9,H9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:qH}));H9.displayName="MinusIcon";const FO=H9,O9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:XH}));O9.displayName="MountainsIcon";const _O=O9,I9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:QH}));I9.displayName="PackageIcon";const Tp=I9,F9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:JH}));F9.displayName="PaletteIcon";const VO=F9,_9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:eO}));_9.displayName="PaperclipIcon";const ZO=_9,V9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:tO}));V9.displayName="PencilSimpleIcon";const id=V9,Z9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:nO}));Z9.displayName="PencilSimpleLineIcon";const zO=Z9,z9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:rO}));z9.displayName="PlusIcon";const fr=z9,B9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:sO}));B9.displayName="PlusCircleIcon";const BO=B9,U9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:aO}));U9.displayName="PowerIcon";const UO=U9,W9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:oO}));W9.displayName="QuestionIcon";const WO=W9,K9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:iO}));K9.displayName="SidebarSimpleIcon";const KO=K9,G9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:lO}));G9.displayName="SlidersHorizontalIcon";const V4=G9,Y9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:cO}));Y9.displayName="StackIcon";const q9=Y9,X9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:uO}));X9.displayName="StarIcon";const Ua=X9,Q9=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:dO}));Q9.displayName="StorefrontIcon";const J9=Q9,e7=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:fO}));e7.displayName="SunHorizonIcon";const t7=e7,n7=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:hO}));n7.displayName="TrashIcon";const ul=n7,r7=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:pO}));r7.displayName="TrashSimpleIcon";const Dp=r7,s7=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:mO}));s7.displayName="UploadSimpleIcon";const Z4=s7,a7=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:gO}));a7.displayName="UserIcon";const GO=a7,o7=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:vO}));o7.displayName="UserCircleIcon";const YO=o7,i7=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:wO}));i7.displayName="UserPlusIcon";const qO=i7,l7=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:yO}));l7.displayName="WarningIcon";const Hp=l7,c7=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:bO}));c7.displayName="WarningCircleIcon";const xc=c7,u7=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:xO}));u7.displayName="XIcon";const Mn=u7,d7=s.forwardRef((e,t)=>s.createElement(Lt,{ref:t,...e,weights:kO}));d7.displayName="XCircleIcon";const XO=d7;var _r=US(),QO=Object.defineProperty,z4=(e,t)=>QO(e,"name",{value:t,configurable:!0});function q8(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}z4(q8,"setRef");function f7(...e){return t=>{let n=!1;const r=e.map(a=>{const i=q8(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():q8(e[a],null)}}}}z4(f7,"composeRefs");function un(...e){return s.useCallback(f7(...e),e)}z4(un,"useComposedRefs");var JO=Object.defineProperty,qa=(e,t)=>JO(e,"name",{value:t,configurable:!0});function Wa(e){const t=s.forwardRef((n,r)=>{let{children:a,...i}=n,l=null,u=!1;const f=[];X8(a)&&typeof K1=="function"&&(a=K1(a._payload)),s.Children.forEach(a,v=>{var w;if(g7(v)){u=!0;const b=v;let y="child"in b.props?b.props.child:b.props.children;X8(y)&&typeof K1=="function"&&(y=K1(y._payload)),l=eI(b,y),f.push((w=l==null?void 0:l.props)==null?void 0:w.children)}else f.push(v)}),l?l=s.cloneElement(l,void 0,f):!u&&s.Children.count(a)===1&&s.isValidElement(a)&&(l=a);const h=l?m7(l):void 0,p=un(r,h);if(!l){if(a||a===0)throw new Error(u?rI(e):nI(e));return a}const g=p7(i,l.props??{});return l.type!==s.Fragment&&(g.ref=r?p:h),s.cloneElement(l,g)});return t.displayName=`${e}.Slot`,t}qa(Wa,"createSlot");var kc=Wa("Slot"),h7=Symbol.for("radix.slottable");function B4(e){const t=qa(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=h7,t}qa(B4,"createSlottable");var Op=B4("Slottable"),eI=qa((e,t)=>{if("child"in e.props){const n=e.props.child;return s.isValidElement(n)?s.cloneElement(n,void 0,e.props.children(n.props.children)):null}return s.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function p7(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...u)=>{const f=i(...u);return a(...u),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}qa(p7,"mergeProps");function m7(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}qa(m7,"getElementRef");function g7(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===h7}qa(g7,"isSlottable");var tI=Symbol.for("react.lazy");function X8(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===tI&&"_payload"in e&&v7(e._payload)}qa(X8,"isLazyComponent");function v7(e){return typeof e=="object"&&e!==null&&"then"in e}qa(v7,"isPromiseLike");var nI=qa(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),rI=qa(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),K1=vc[" use ".trim().toString()],sI=Object.defineProperty,aI=(e,t)=>sI(e,"name",{value:t,configurable:!0}),oI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pn=oI.reduce((e,t)=>{const n=Wa(`Primitive.${t}`),r=s.forwardRef((a,i)=>{const{asChild:l,...u}=a,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(f,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function U4(e,t){e&&_r.flushSync(()=>e.dispatchEvent(t))}aI(U4,"dispatchDiscreteCustomEvent");var iI=Object.defineProperty,lI=(e,t)=>iI(e,"name",{value:t,configurable:!0}),w7=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),cI=s.forwardRef(lI(function(t,n){return o.jsx(pn.span,{...t,ref:n,style:{...w7,...t.style}})},"VisuallyHidden")),y7=cI,uI=Object.defineProperty,pa=(e,t)=>uI(e,"name",{value:t,configurable:!0});function dI(e,t){const n=s.createContext(t);n.displayName=e+"Context";const r=pa(i=>{const{children:l,...u}=i,f=s.useMemo(()=>u,Object.values(u));return o.jsx(n.Provider,{value:f,children:l})},"Provider");r.displayName=e+"Provider";function a(i,l={}){const{optional:u=!1}=l,f=s.useContext(n);if(f)return f;if(t!==void 0)return t;if(!u)throw new Error(`\`${i}\` must be used within \`${e}\``)}return pa(a,"useContext"),[r,a]}pa(dI,"createContext");function Hs(e,t=[]){let n=[];function r(i,l){const u=s.createContext(l);u.displayName=i+"Context";const f=n.length;n=[...n,l];const h=pa(g=>{var S;const{scope:v,children:w,...b}=g,y=((S=v==null?void 0:v[e])==null?void 0:S[f])||u,k=s.useMemo(()=>b,Object.values(b));return o.jsx(y.Provider,{value:k,children:w})},"Provider");h.displayName=i+"Provider";function p(g,v,w={}){var S;const{optional:b=!1}=w,y=((S=v==null?void 0:v[e])==null?void 0:S[f])||u,k=s.useContext(y);if(k)return k;if(l!==void 0)return l;if(!b)throw new Error(`\`${g}\` must be used within \`${i}\``)}return pa(p,"useContext"),[h,p]}pa(r,"createContext");const a=pa(()=>{const i=n.map(l=>s.createContext(l));return pa(function(u){const f=(u==null?void 0:u[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])},"useScope")},"createScope");return a.scopeName=e,[r,b7(a,...t)]}pa(Hs,"createContextScope");function b7(...e){const t=e[0];if(e.length===1)return t;const n=pa(()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return pa(function(i){const l=r.reduce((u,{useScope:f,scopeName:h})=>{const g=f(i)[`__scope${h}`];return{...u,...g}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}pa(b7,"composeContextScopes");var fI=Object.defineProperty,Or=(e,t)=>fI(e,"name",{value:t,configurable:!0});function Ip(e){const t=e+"CollectionProvider",[n,r]=Hs(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=Or(y=>{const{scope:k,children:S}=y,E=s.useRef(null),j=s.useRef(new Map).current;return o.jsx(a,{scope:k,itemMap:j,collectionRef:E,children:S})},"CollectionProvider");l.displayName=t;const u=e+"CollectionSlot",f=Wa(u),h=s.forwardRef((y,k)=>{const{scope:S,children:E}=y,j=i(u,S),N=un(k,j.collectionRef);return o.jsx(f,{ref:N,children:E})});h.displayName=u;const p=e+"CollectionItemSlot",g="data-radix-collection-item",v=Wa(p),w=s.forwardRef((y,k)=>{const{scope:S,children:E,...j}=y,N=s.useRef(null),A=un(k,N),T=i(p,S);return s.useEffect(()=>(T.itemMap.set(N,{ref:N,...j}),()=>void T.itemMap.delete(N))),o.jsx(v,{[g]:"",ref:A,children:E})});w.displayName=p;function b(y){const k=i(e+"CollectionConsumer",y);return s.useCallback(()=>{const E=k.collectionRef.current;if(!E)return[];const j=Array.from(E.querySelectorAll(`[${g}]`));return Array.from(k.itemMap.values()).sort((T,P)=>j.indexOf(T.ref.current)-j.indexOf(P.ref.current))},[k.collectionRef,k.itemMap])}return Or(b,"useCollection"),[{Provider:l,Slot:h,ItemSlot:w},b,r]}Or(Ip,"createCollection");var t3=new WeakMap,gr,Ws,Ag=(Ws=class extends Map{constructor(n){super(n);hx(this,gr);pg(this,gr,[...super.keys()]),t3.set(this,!0)}set(n,r){return t3.get(this)&&(this.has(n)?ns(this,gr)[ns(this,gr).indexOf(n)]=n:ns(this,gr).push(n)),super.set(n,r),this}insert(n,r,a){const i=this.has(r),l=ns(this,gr).length,u=W4(n);let f=u>=0?u:l+u;const h=f<0||f>=l?-1:f;if(h===this.size||i&&h===this.size-1||h===-1)return this.set(r,a),this;const p=this.size+(i?0:1);u<0&&f++;const g=[...ns(this,gr)];let v,w=!1;for(let b=f;b<p;b++)if(f===b){let y=g[b];g[b]===r&&(y=g[b+1]),i&&this.delete(r),v=this.get(y),this.set(r,a)}else{!w&&g[b-1]===r&&(w=!0);const y=g[w?b:b-1],k=v;v=this.get(y),this.delete(y),this.set(y,k)}return this}with(n,r,a){const i=new Ws(this);return i.insert(n,r,a),i}before(n){const r=ns(this,gr).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,a){const i=ns(this,gr).indexOf(n);return i===-1?this:this.insert(i,r,a)}after(n){let r=ns(this,gr).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,a){const i=ns(this,gr).indexOf(n);return i===-1?this:this.insert(i+1,r,a)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return pg(this,gr,[]),super.clear()}delete(n){const r=super.delete(n);return r&&ns(this,gr).splice(ns(this,gr).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=Eh(ns(this,gr),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=Eh(ns(this,gr),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return ns(this,gr).indexOf(n)}keyAt(n){return Eh(ns(this,gr),n)}from(n,r){const a=this.indexOf(n);if(a===-1)return;let i=a+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(n,r){const a=this.indexOf(n);if(a===-1)return;let i=a+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(n,r){let a=0;for(const i of this){if(Reflect.apply(n,r,[i,a,this]))return i;a++}}findIndex(n,r){let a=0;for(const i of this){if(Reflect.apply(n,r,[i,a,this]))return a;a++}return-1}filter(n,r){const a=[];let i=0;for(const l of this)Reflect.apply(n,r,[l,i,this])&&a.push(l),i++;return new Ws(a)}map(n,r){const a=[];let i=0;for(const l of this)a.push([l[0],Reflect.apply(n,r,[l,i,this])]),i++;return new Ws(a)}reduce(...n){const[r,a]=n;let i=0,l=a??this.at(0);for(const u of this)i===0&&n.length===1?l=u:l=Reflect.apply(r,this,[l,u,i,this]),i++;return l}reduceRight(...n){const[r,a]=n;let i=a??this.at(-1);for(let l=this.size-1;l>=0;l--){const u=this.at(l);l===this.size-1&&n.length===1?i=u:i=Reflect.apply(r,this,[i,u,l,this])}return i}toSorted(n){const r=[...this.entries()].sort(n);return new Ws(r)}toReversed(){const n=new Ws;for(let r=this.size-1;r>=0;r--){const a=this.keyAt(r),i=this.get(a);n.set(a,i)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new Ws(r)}slice(n,r){const a=new Ws;let i=this.size-1;if(n===void 0)return a;n<0&&(n=n+this.size),r!==void 0&&r>0&&(i=r-1);for(let l=n;l<=i;l++){const u=this.keyAt(l),f=this.get(u);a.set(u,f)}return a}every(n,r){let a=0;for(const i of this){if(!Reflect.apply(n,r,[i,a,this]))return!1;a++}return!0}some(n,r){let a=0;for(const i of this){if(Reflect.apply(n,r,[i,a,this]))return!0;a++}return!1}},gr=new WeakMap,Or(Ws,"OrderedDict"),Ws);function Eh(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=x7(e,t);return n===-1?void 0:e[n]}Or(Eh,"at");function x7(e,t){const n=e.length,r=W4(t),a=r>=0?r:n+r;return a<0||a>=n?-1:a}Or(x7,"toSafeIndex");function W4(e){return e!==e||e===0?0:Math.trunc(e)}Or(W4,"toSafeInteger");function hI(e){const t=e+"CollectionProvider",[n,r]=Hs(t),[a,i]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Ag,setItemMap:Or(()=>{},"setItemMap")}),l=Or(({state:j,...N})=>j?o.jsx(f,{...N,state:j}):o.jsx(u,{...N}),"CollectionProvider");l.displayName=t;const u=Or(j=>{const N=k();return o.jsx(f,{...j,state:N})},"CollectionInit");u.displayName=t+"Init";const f=Or(j=>{const{scope:N,children:A,state:T}=j,P=s.useRef(null),[C,R]=s.useState(null),$=un(P,R),[H,D]=T;return s.useEffect(()=>{if(!C)return;const q=E7(()=>{});return q.observe(C,{childList:!0,subtree:!0}),()=>{q.disconnect()}},[C]),o.jsx(a,{scope:N,itemMap:H,setItemMap:D,collectionRef:$,collectionRefObject:P,collectionElement:C,children:A})},"CollectionProviderImpl");f.displayName=t+"Impl";const h=e+"CollectionSlot",p=Wa(h),g=s.forwardRef((j,N)=>{const{scope:A,children:T}=j,P=i(h,A),C=un(N,P.collectionRef);return o.jsx(p,{ref:C,children:T})});g.displayName=h;const v=e+"CollectionItemSlot",w="data-radix-collection-item",b=Wa(v),y=s.forwardRef((j,N)=>{const{scope:A,children:T,...P}=j,C=s.useRef(null),[R,$]=s.useState(null),H=un(N,C,$),D=i(v,A),{setItemMap:q}=D,_=s.useRef(P);k7(_.current,P)||(_.current=P);const U=_.current;return s.useEffect(()=>{const Y=U;return q(I=>R?I.has(R)?I.set(R,{...Y,element:R}).toSorted(Q8):(I.set(R,{...Y,element:R}),I.toSorted(Q8)):I),()=>{q(I=>!R||!I.has(R)?I:(I.delete(R),new Ag(I)))}},[R,U,q]),o.jsx(b,{[w]:"",ref:H,children:T})});y.displayName=v;function k(){return s.useState(new Ag)}Or(k,"useInitCollection");function S(j){const{itemMap:N}=i(e+"CollectionConsumer",j);return N}return Or(S,"useCollection"),[{Provider:l,Slot:g,ItemSlot:y},{createCollectionScope:r,useCollection:S,useInitCollection:k}]}Or(hI,"createCollection");function k7(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const a of n)if(!Object.prototype.hasOwnProperty.call(t,a)||e[a]!==t[a])return!1;return!0}Or(k7,"shallowEqual");function S7(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Or(S7,"isElementPreceding");function Q8(e,t){return!e[1].element||!t[1].element?0:S7(e[1].element,t[1].element)?-1:1}Or(Q8,"sortByDocumentPosition");function E7(e){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){e();return}})}Or(E7,"getChildListObserver");var pI=Object.defineProperty,ld=(e,t)=>pI(e,"name",{value:t,configurable:!0}),C7=!!(typeof window<"u"&&window.document&&window.document.createElement);function At(e,t,{checkForDefaultPrevented:n=!0}={}){return ld(function(a){if(e==null||e(a),n===!1||!a||!a.defaultPrevented)return t==null?void 0:t(a)},"handleEvent")}ld(At,"composeEventHandlers");function mI(e){var t;if(!C7)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}ld(mI,"getOwnerWindow");function J8(e){if(!C7)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}ld(J8,"getOwnerDocument");function j7(e,t=!1){const{activeElement:n}=J8(e);if(!(n!=null&&n.nodeName))return null;if(A7(n)&&n.contentDocument)return j7(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const a=J8(n).getElementById(r);if(a)return a}}return n}ld(j7,"getActiveElement");function A7(e){return e.tagName==="IFRAME"}ld(A7,"isFrame");var br=globalThis!=null&&globalThis.document?s.useLayoutEffect:()=>{},gI=Object.defineProperty,vI=(e,t)=>gI(e,"name",{value:t,configurable:!0}),n3=vc[" useEffectEvent ".trim().toString()],r3=vc[" useInsertionEffect ".trim().toString()];function N7(e){if(typeof n3=="function")return n3(e);const t=s.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof r3=="function"?r3(()=>{t.current=e}):br(()=>{t.current=e}),s.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}vI(N7,"useEffectEvent");var wI=Object.defineProperty,df=(e,t)=>wI(e,"name",{value:t,configurable:!0}),yI=vc[" useInsertionEffect ".trim().toString()]||br;function si({prop:e,defaultProp:t,onChange:n=df(()=>{},"onChange"),caller:r}){const[a,i,l]=M7({defaultProp:t,onChange:n}),u=e!==void 0,f=u?e:a,h=s.useCallback(p=>{var g;if(u){const v=R7(p)?p(e):p;v!==e&&((g=l.current)==null||g.call(l,v))}else i(p)},[u,e,i,l]);return[f,h]}df(si,"useControllableState");function M7({defaultProp:e,onChange:t}){const[n,r]=s.useState(e),a=s.useRef(n),i=s.useRef(t);return yI(()=>{i.current=t},[t]),s.useEffect(()=>{var l;a.current!==n&&((l=i.current)==null||l.call(i,n),a.current=n)},[n,a]),[n,r,i]}df(M7,"useUncontrolledState");function R7(e){return typeof e=="function"}df(R7,"isFunction");var s3=Symbol("RADIX:SYNC_STATE");function bI(e,t,n,r){const{prop:a,defaultProp:i,onChange:l,caller:u}=t,f=a!==void 0,h=N7(l),p=[{...n,state:i}];r&&p.push(r);const[g,v]=s.useReducer((k,S)=>{if(S.type===s3)return{...k,state:S.state};const E=e(k,S);return f&&!Object.is(E.state,k.state)&&h(E.state),E},...p),w=g.state,b=s.useRef(w);s.useEffect(()=>{b.current!==w&&(b.current=w,f||h(w))},[w,b,f]);const y=s.useMemo(()=>a!==void 0?{...g,state:a}:g,[g,a]);return s.useEffect(()=>{f&&!Object.is(a,g.state)&&v({type:s3,state:a})},[a,g.state,f]),[y,v]}df(bI,"useControllableStateReducer");var xI=Object.defineProperty,ai=(e,t)=>xI(e,"name",{value:t,configurable:!0});function P7(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}ai(P7,"useStateMachine");var cs=ai(e=>{const{present:t,children:n}=e,r=L7(t),a=typeof n=="function"?n({present:r.isPresent}):s.Children.only(n),i=$7(r.ref,T7(a));return typeof n=="function"||r.isPresent?s.cloneElement(a,{ref:i}):null},"Presence");function L7(e){const[t,n]=s.useState(),r=s.useRef(null),a=s.useRef(e),i=s.useRef("none"),l=s.useRef(void 0),u=e?"mounted":"unmounted",[f,h]=P7(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{f==="mounted"?(i.current=l.current??bu(r.current),l.current=void 0):i.current="none"},[f]),br(()=>{const p=r.current,g=a.current;if(g!==e){const w=i.current,b=bu(p);e?(l.current=b,h("MOUNT")):b==="none"||(p==null?void 0:p.display)==="none"?h("UNMOUNT"):h(g&&w!==b?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,h]),br(()=>{if(t){let p;const g=t.ownerDocument.defaultView??window,v=ai(b=>{const k=bu(r.current).includes(CSS.escape(b.animationName));if(b.target===t&&k&&(h("ANIMATION_END"),!a.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",p=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},"handleAnimationEnd"),w=ai(b=>{b.target===t&&(i.current=bu(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",w),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{g.clearTimeout(p),t.removeEventListener("animationstart",w),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:s.useCallback(p=>{if(p){const g=getComputedStyle(p);r.current=g,l.current=bu(g)}else r.current=null;n(p)},[])}}ai(L7,"usePresence");function e6(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}ai(e6,"setRef");function $7(...e){const t=s.useRef(e);return t.current=e,s.useCallback(n=>{const r=t.current;let a=!1;const i=r.map(l=>{const u=e6(l,n);return!a&&typeof u=="function"&&(a=!0),u});if(a)return()=>{for(let l=0;l<i.length;l++){const u=i[l];typeof u=="function"?u():e6(r[l],null)}}},[])}ai($7,"useStableComposedRefs");function bu(e){return(e==null?void 0:e.animationName)||"none"}ai(bu,"getAnimationName");function T7(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}ai(T7,"getElementRef");var kI=Object.defineProperty,SI=(e,t)=>kI(e,"name",{value:t,configurable:!0}),EI=vc[" useId ".trim().toString()]||(()=>{}),CI=0;function ya(e){const[t,n]=s.useState(EI());return br(()=>{e||n(r=>r??String(CI++))},[e]),e||(t?`radix-${t}`:"")}SI(ya,"useId");var jI=Object.defineProperty,D7=(e,t)=>jI(e,"name",{value:t,configurable:!0}),H7=s.createContext(void 0),AI=D7(e=>{const{dir:t,children:n}=e;return o.jsx(H7.Provider,{value:t,children:n})},"DirectionProvider");function ff(e){const t=s.useContext(H7);return e||t||"ltr"}D7(ff,"useDirection");var NI=AI,MI=Object.defineProperty,RI=(e,t)=>MI(e,"name",{value:t,configurable:!0});function wr(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}RI(wr,"useCallbackRef");var PI=Object.defineProperty,Hr=(e,t)=>PI(e,"name",{value:t,configurable:!0}),t6="dismissableLayer.update",LI="dismissableLayer.pointerDownOutside",$I="dismissableLayer.focusOutside",a3,O7=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),hf=s.forwardRef(Hr(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:a=!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:f,onDismiss:h,...p}=t,g=s.useContext(O7),[v,w]=s.useState(null),b=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=s.useState({}),k=un(n,w),S=Array.from(g.layers),[E]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),j=E?S.indexOf(E):-1,N=v?S.indexOf(v):-1,A=g.layersWithOutsidePointerEventsDisabled.size>0,T=N>=j,P=s.useRef(!1),C=F7(D=>{l==null||l(D),f==null||f(D),D.defaultPrevented||h==null||h()},{ownerDocument:b,deferPointerDownOutside:a,isDeferredPointerDownOutsideRef:P,dismissableSurfaces:g.dismissableSurfaces,shouldHandlePointerDownOutside:s.useCallback(D=>{if(!(D instanceof Node))return!1;const q=[...g.branches].some(_=>_.contains(D));return T&&!q},[g.branches,T])}),R=_7(D=>{if(a&&P.current)return;const q=D.target;[...g.branches].some(U=>U.contains(q))||(u==null||u(D),f==null||f(D),D.defaultPrevented||h==null||h())},b),$=v?N===S.length-1:!1,H=wr(D=>{D.key==="Escape"&&(i==null||i(D),!D.defaultPrevented&&h&&(D.preventDefault(),h()))});return s.useEffect(()=>{if($)return b.addEventListener("keydown",H,{capture:!0}),()=>b.removeEventListener("keydown",H,{capture:!0})},[b,$,H]),s.useEffect(()=>{if(v)return r&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(a3=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(v)),g.layers.add(v),n6(),()=>{r&&(g.layersWithOutsidePointerEventsDisabled.delete(v),g.layersWithOutsidePointerEventsDisabled.size===0&&(b.body.style.pointerEvents=a3))}},[v,b,r,g]),s.useEffect(()=>()=>{v&&(g.layers.delete(v),g.layersWithOutsidePointerEventsDisabled.delete(v),n6())},[v,g]),s.useEffect(()=>{const D=Hr(()=>y({}),"handleUpdate");return document.addEventListener(t6,D),()=>document.removeEventListener(t6,D)},[]),o.jsx(pn.div,{...p,ref:k,style:{pointerEvents:A?T?"auto":"none":void 0,...t.style},onFocusCapture:At(t.onFocusCapture,R.onFocusCapture),onBlurCapture:At(t.onBlurCapture,R.onBlurCapture),onPointerDownCapture:At(t.onPointerDownCapture,C.onPointerDownCapture)})},"DismissableLayer"));function I7(){const e=s.useContext(O7),[t,n]=s.useState(null);return s.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Hr(I7,"useDismissableLayerSurface");var TI=Hr(()=>!0,"IS_TRUE");function F7(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:i,shouldHandlePointerDownOutside:l=TI}=t,u=wr(e),f=s.useRef(!1),h=s.useRef(!1),p=s.useRef(new Map),g=s.useRef(()=>{});return s.useEffect(()=>{function v(){h.current=!1,a.current=!1,p.current.clear()}Hr(v,"resetOutsideInteraction");function w(){return Array.from(p.current.values()).some(Boolean)}Hr(w,"isOutsideInteractionIntercepted");function b(j){if(!h.current)return;const N=j.target;N instanceof Node&&[...i].some(T=>T.contains(N))||p.current.set(j.type,!0),j.type==="click"&&window.setTimeout(()=>{h.current&&g.current()},0)}Hr(b,"handleInteractionCapture");function y(j){h.current&&p.current.set(j.type,!1)}Hr(y,"handleInteractionBubble");const k=Hr(j=>{if(j.target&&!f.current){let N=function(){n.removeEventListener("click",g.current);const T=w();v(),T||K4(LI,u,A,{discrete:!0})};if(Hr(N,"handleAndDispatchPointerDownOutsideEvent"),!l(j.target)){n.removeEventListener("click",g.current),v(),f.current=!1;return}const A={originalEvent:j};h.current=!0,a.current=r&&j.button===0,p.current.clear(),!r||j.button!==0?N():(n.removeEventListener("click",g.current),g.current=N,n.addEventListener("click",g.current,{once:!0}))}else n.removeEventListener("click",g.current),v();f.current=!1},"handlePointerDown"),S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const j of S)n.addEventListener(j,b,!0),n.addEventListener(j,y);const E=window.setTimeout(()=>{n.addEventListener("pointerdown",k)},0);return()=>{window.clearTimeout(E),n.removeEventListener("pointerdown",k),n.removeEventListener("click",g.current);for(const j of S)n.removeEventListener(j,b,!0),n.removeEventListener(j,y)}},[n,u,r,a,i,l]),{onPointerDownCapture:Hr(()=>f.current=!0,"onPointerDownCapture")}}Hr(F7,"usePointerDownOutside");function _7(e,t=globalThis==null?void 0:globalThis.document){const n=wr(e),r=s.useRef(!1);return s.useEffect(()=>{const a=Hr(i=>{i.target&&!r.current&&K4($I,n,{originalEvent:i},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:Hr(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Hr(()=>r.current=!1,"onBlurCapture")}}Hr(_7,"useFocusOutside");function n6(){const e=new CustomEvent(t6);document.dispatchEvent(e)}Hr(n6,"dispatchUpdate");function K4(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?U4(a,i):a.dispatchEvent(i)}Hr(K4,"handleAndDispatchCustomEvent");var DI=Object.defineProperty,ms=(e,t)=>DI(e,"name",{value:t,configurable:!0}),Ng="focusScope.autoFocusOnMount",Mg="focusScope.autoFocusOnUnmount",o3={bubbles:!1,cancelable:!0},cd=s.forwardRef(ms(function(t,n){const{loop:r=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:l,...u}=t,[f,h]=s.useState(null),p=wr(i),g=wr(l),v=s.useRef(null),w=un(n,h),b=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(a){let k=function(N){if(b.paused||!f)return;const A=N.target;f.contains(A)?v.current=A:Vo(v.current,{select:!0})},S=function(N){if(b.paused||!f)return;const A=N.relatedTarget;A!==null&&(f.contains(A)||Vo(v.current,{select:!0}))},E=function(N){if(document.activeElement===document.body)for(const T of N)T.removedNodes.length>0&&Vo(f)};ms(k,"handleFocusIn"),ms(S,"handleFocusOut"),ms(E,"handleMutations"),document.addEventListener("focusin",k),document.addEventListener("focusout",S);const j=new MutationObserver(E);return f&&j.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",S),j.disconnect()}}},[a,f,b.paused]),s.useEffect(()=>{if(f){i3.add(b);const k=document.activeElement;if(!f.contains(k)){const E=new CustomEvent(Ng,o3);f.addEventListener(Ng,p),f.dispatchEvent(E),E.defaultPrevented||(V7(W7(G4(f)),{select:!0}),document.activeElement===k&&Vo(f))}return()=>{f.removeEventListener(Ng,p),setTimeout(()=>{const E=new CustomEvent(Mg,o3);f.addEventListener(Mg,g),f.dispatchEvent(E),E.defaultPrevented||Vo(k??document.body,{select:!0}),f.removeEventListener(Mg,g),i3.remove(b)},0)}}},[f,p,g,b]);const y=s.useCallback(k=>{if(!r&&!a||b.paused)return;const S=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,E=document.activeElement;if(S&&E){const j=k.currentTarget,[N,A]=Z7(j);N&&A?!k.shiftKey&&E===A?(k.preventDefault(),r&&Vo(N,{select:!0})):k.shiftKey&&E===N&&(k.preventDefault(),r&&Vo(A,{select:!0})):E===j&&k.preventDefault()}},[r,a,b.paused]);return o.jsx(pn.div,{tabIndex:-1,...u,ref:w,onKeyDown:y})},"FocusScope"));function V7(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Vo(r,{select:t}),document.activeElement!==n)return}ms(V7,"focusFirst");function Z7(e){const t=G4(e),n=r6(t,e),r=r6(t.reverse(),e);return[n,r]}ms(Z7,"getTabbableEdges");function G4(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ms(r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}ms(G4,"getTabbableCandidates");function r6(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):z7(r,{upTo:t})))return r}ms(r6,"findVisible");function z7(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}ms(z7,"isHidden");function B7(e){return e instanceof HTMLInputElement&&"select"in e}ms(B7,"isSelectableInput");function Vo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&B7(e)&&t&&e.select()}}ms(Vo,"focus");var i3=U7();function U7(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=s6(e,t),e.unshift(t)},remove(t){var n;e=s6(e,t),(n=e[0])==null||n.resume()}}}ms(U7,"createFocusScopesStack");function s6(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}ms(s6,"arrayRemove");function W7(e){return e.filter(t=>t.tagName!=="A")}ms(W7,"removeLinks");var HI=Object.defineProperty,OI=(e,t)=>HI(e,"name",{value:t,configurable:!0}),pf=s.forwardRef(OI(function(t,n){var f;const{container:r,...a}=t,[i,l]=s.useState(!1);br(()=>l(!0),[]);const u=r||i&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return u?_r.createPortal(o.jsx(pn.div,{...a,ref:n}),u):null},"Portal")),II=Object.defineProperty,Y4=(e,t)=>II(e,"name",{value:t,configurable:!0}),G1=0,oo=null;function FI(e){return ud(),e.children}Y4(FI,"FocusGuards");function ud(){s.useEffect(()=>{oo||(oo={start:a6(),end:a6()});const{start:e,end:t}=oo;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),G1++,()=>{G1===1&&(oo==null||oo.start.remove(),oo==null||oo.end.remove(),oo=null),G1=Math.max(0,G1-1)}},[])}Y4(ud,"useFocusGuards");function a6(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}Y4(a6,"createFocusGuard");var ho=function(){return ho=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ho.apply(this,arguments)};function K7(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function _I(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Ch="right-scroll-bar-position",jh="width-before-scroll-bar",VI="with-scroll-bars-hidden",ZI="--removed-body-scroll-bar-size";function Rg(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function zI(e,t){var n=s.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var BI=typeof window<"u"?s.useLayoutEffect:s.useEffect,l3=new WeakMap;function UI(e,t){var n=zI(null,function(r){return e.forEach(function(a){return Rg(a,r)})});return BI(function(){var r=l3.get(n);if(r){var a=new Set(r),i=new Set(e),l=n.current;a.forEach(function(u){i.has(u)||Rg(u,null)}),i.forEach(function(u){a.has(u)||Rg(u,l)})}l3.set(n,e)},[e]),n}function WI(e){return e}function KI(e,t){t===void 0&&(t=WI);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var l=t(i,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(i){for(r=!0;n.length;){var l=n;n=[],l.forEach(i)}n={push:function(u){return i(u)},filter:function(){return n}}},assignMedium:function(i){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(i),l=n}var f=function(){var p=l;l=[],p.forEach(i)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(p){l.push(p),h()},filter:function(p){return l=l.filter(p),n}}}};return a}function GI(e){e===void 0&&(e={});var t=KI(null);return t.options=ho({async:!0,ssr:!1},e),t}var G7=function(e){var t=e.sideCar,n=K7(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return s.createElement(r,ho({},n))};G7.isSideCarExport=!0;function YI(e,t){return e.useMedium(t),G7}var Y7=GI(),Pg=function(){},Fp=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:Pg,onWheelCapture:Pg,onTouchMoveCapture:Pg}),a=r[0],i=r[1],l=e.forwardProps,u=e.children,f=e.className,h=e.removeScrollBar,p=e.enabled,g=e.shards,v=e.sideCar,w=e.noRelative,b=e.noIsolation,y=e.inert,k=e.allowPinchZoom,S=e.as,E=S===void 0?"div":S,j=e.gapMode,N=K7(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=v,T=UI([n,t]),P=ho(ho({},N),a);return s.createElement(s.Fragment,null,p&&s.createElement(A,{sideCar:Y7,removeScrollBar:h,shards:g,noRelative:w,noIsolation:b,inert:y,setCallbacks:i,allowPinchZoom:!!k,lockRef:n,gapMode:j}),l?s.cloneElement(s.Children.only(u),ho(ho({},P),{ref:T})):s.createElement(E,ho({},P,{className:f,ref:T}),u))});Fp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Fp.classNames={fullWidth:jh,zeroRight:Ch};var qI=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function XI(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=qI();return t&&e.setAttribute("nonce",t),e}function QI(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function JI(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var eF=function(){var e=0,t=null;return{add:function(n){e==0&&(t=XI())&&(QI(t,n),JI(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tF=function(){var e=eF();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},q7=function(){var e=tF(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},nF={left:0,top:0,right:0,gap:0},Lg=function(e){return parseInt(e||"",10)||0},rF=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Lg(n),Lg(r),Lg(a)]},sF=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return nF;var t=rF(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},aF=q7(),$u="data-scroll-locked",oF=function(e,t,n,r){var a=e.left,i=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
53
+ .`.concat(VI,` {
54
+ overflow: hidden `).concat(r,`;
55
+ padding-right: `).concat(u,"px ").concat(r,`;
56
+ }
57
+ body[`).concat($u,`] {
58
+ overflow: hidden `).concat(r,`;
59
+ overscroll-behavior: contain;
60
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
61
+ padding-left: `.concat(a,`px;
62
+ padding-top: `).concat(i,`px;
63
+ padding-right: `).concat(l,`px;
64
+ margin-left:0;
65
+ margin-top:0;
66
+ margin-right: `).concat(u,"px ").concat(r,`;
67
+ `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
68
+ }
69
+
70
+ .`).concat(Ch,` {
71
+ right: `).concat(u,"px ").concat(r,`;
72
+ }
73
+
74
+ .`).concat(jh,` {
75
+ margin-right: `).concat(u,"px ").concat(r,`;
76
+ }
77
+
78
+ .`).concat(Ch," .").concat(Ch,` {
79
+ right: 0 `).concat(r,`;
80
+ }
81
+
82
+ .`).concat(jh," .").concat(jh,` {
83
+ margin-right: 0 `).concat(r,`;
84
+ }
85
+
86
+ body[`).concat($u,`] {
87
+ `).concat(ZI,": ").concat(u,`px;
88
+ }
89
+ `)},c3=function(){var e=parseInt(document.body.getAttribute($u)||"0",10);return isFinite(e)?e:0},iF=function(){s.useEffect(function(){return document.body.setAttribute($u,(c3()+1).toString()),function(){var e=c3()-1;e<=0?document.body.removeAttribute($u):document.body.setAttribute($u,e.toString())}},[])},lF=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;iF();var i=s.useMemo(function(){return sF(a)},[a]);return s.createElement(aF,{styles:oF(i,!t,a,n?"":"!important")})},o6=!1;if(typeof window<"u")try{var Y1=Object.defineProperty({},"passive",{get:function(){return o6=!0,!0}});window.addEventListener("test",Y1,Y1),window.removeEventListener("test",Y1,Y1)}catch{o6=!1}var iu=o6?{passive:!1}:!1,cF=function(e){return e.tagName==="TEXTAREA"},X7=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!cF(e)&&n[t]==="visible")},uF=function(e){return X7(e,"overflowY")},dF=function(e){return X7(e,"overflowX")},u3=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=Q7(e,r);if(a){var i=J7(e,r),l=i[1],u=i[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fF=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},hF=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Q7=function(e,t){return e==="v"?uF(t):dF(t)},J7=function(e,t){return e==="v"?fF(t):hF(t)},pF=function(e,t){return e==="h"&&t==="rtl"?-1:1},mF=function(e,t,n,r,a){var i=pF(e,window.getComputedStyle(t).direction),l=i*r,u=n.target,f=t.contains(u),h=!1,p=l>0,g=0,v=0;do{if(!u)break;var w=J7(e,u),b=w[0],y=w[1],k=w[2],S=y-k-i*b;(b||S)&&Q7(e,u)&&(g+=S,v+=b);var E=u.parentNode;u=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(p&&Math.abs(g)<1||!p&&Math.abs(v)<1)&&(h=!0),h},q1=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},d3=function(e){return[e.deltaX,e.deltaY]},f3=function(e){return e&&"current"in e?e.current:e},gF=function(e,t){return e[0]===t[0]&&e[1]===t[1]},vF=function(e){return`
90
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
91
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
92
+ `)},wF=0,lu=[];function yF(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),a=s.useState(wF++)[0],i=s.useState(q7)[0],l=s.useRef(e);s.useEffect(function(){l.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var y=_I([e.lockRef.current],(e.shards||[]).map(f3),!0).filter(Boolean);return y.forEach(function(k){return k.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),y.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=s.useCallback(function(y,k){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!l.current.allowPinchZoom;var S=q1(y),E=n.current,j="deltaX"in y?y.deltaX:E[0]-S[0],N="deltaY"in y?y.deltaY:E[1]-S[1],A,T=y.target,P=Math.abs(j)>Math.abs(N)?"h":"v";if("touches"in y&&P==="h"&&T.type==="range")return!1;var C=window.getSelection(),R=C&&C.anchorNode,$=R?R===T||R.contains(T):!1;if($)return!1;var H=u3(P,T);if(!H)return!0;if(H?A=P:(A=P==="v"?"h":"v",H=u3(P,T)),!H)return!1;if(!r.current&&"changedTouches"in y&&(j||N)&&(r.current=A),!A)return!0;var D=r.current||A;return mF(D,k,y,D==="h"?j:N)},[]),f=s.useCallback(function(y){var k=y;if(!(!lu.length||lu[lu.length-1]!==i)){var S="deltaY"in k?d3(k):q1(k),E=t.current.filter(function(A){return A.name===k.type&&(A.target===k.target||k.target===A.shadowParent)&&gF(A.delta,S)})[0];if(E&&E.should){k.cancelable&&k.preventDefault();return}if(!E){var j=(l.current.shards||[]).map(f3).filter(Boolean).filter(function(A){return A.contains(k.target)}),N=j.length>0?u(k,j[0]):!l.current.noIsolation;N&&k.cancelable&&k.preventDefault()}}},[]),h=s.useCallback(function(y,k,S,E){var j={name:y,delta:k,target:S,should:E,shadowParent:bF(S)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(N){return N!==j})},1)},[]),p=s.useCallback(function(y){n.current=q1(y),r.current=void 0},[]),g=s.useCallback(function(y){h(y.type,d3(y),y.target,u(y,e.lockRef.current))},[]),v=s.useCallback(function(y){h(y.type,q1(y),y.target,u(y,e.lockRef.current))},[]);s.useEffect(function(){return lu.push(i),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",f,iu),document.addEventListener("touchmove",f,iu),document.addEventListener("touchstart",p,iu),function(){lu=lu.filter(function(y){return y!==i}),document.removeEventListener("wheel",f,iu),document.removeEventListener("touchmove",f,iu),document.removeEventListener("touchstart",p,iu)}},[]);var w=e.removeScrollBar,b=e.inert;return s.createElement(s.Fragment,null,b?s.createElement(i,{styles:vF(a)}):null,w?s.createElement(lF,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function bF(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const xF=YI(Y7,yF);var mf=s.forwardRef(function(e,t){return s.createElement(Fp,ho({},e,{ref:t,sideCar:xF}))});mf.classNames=Fp.classNames;var kF=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},cu=new WeakMap,X1=new WeakMap,Q1={},$g=0,eC=function(e){return e&&(e.host||eC(e.parentNode))},SF=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=eC(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},EF=function(e,t,n,r){var a=SF(t,Array.isArray(e)?e:[e]);Q1[n]||(Q1[n]=new WeakMap);var i=Q1[n],l=[],u=new Set,f=new Set(a),h=function(g){!g||u.has(g)||(u.add(g),h(g.parentNode))};a.forEach(h);var p=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(v){if(u.has(v))p(v);else try{var w=v.getAttribute(r),b=w!==null&&w!=="false",y=(cu.get(v)||0)+1,k=(i.get(v)||0)+1;cu.set(v,y),i.set(v,k),l.push(v),y===1&&b&&X1.set(v,!0),k===1&&v.setAttribute(n,"true"),b||v.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",v,S)}})};return p(t),u.clear(),$g++,function(){l.forEach(function(g){var v=cu.get(g)-1,w=i.get(g)-1;cu.set(g,v),i.set(g,w),v||(X1.has(g)||g.removeAttribute(r),X1.delete(g)),w||g.removeAttribute(n)}),$g--,$g||(cu=new WeakMap,cu=new WeakMap,X1=new WeakMap,Q1={})}},_p=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=kF(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),EF(r,a,n,"aria-hidden")):function(){return null}},CF=Object.defineProperty,ea=(e,t)=>CF(e,"name",{value:t,configurable:!0}),q4="Dialog",[tC,nC]=Hs(q4),[jF,Xa]=tC(q4),Sc=ea(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!0}=e,u=s.useRef(null),f=s.useRef(null),[h,p]=si({prop:r,defaultProp:a??!1,onChange:i,caller:q4}),[g,v]=s.useState(0),[w,b]=s.useState(0);return o.jsx(jF,{scope:t,triggerRef:u,contentRef:f,contentId:ya(),titleId:ya(),descriptionId:ya(),titlePresent:g>0,descriptionPresent:w>0,setTitleCount:v,setDescriptionCount:b,open:h,onOpenChange:p,onOpenToggle:s.useCallback(()=>p(y=>!y),[p]),modal:l,children:n})},"Dialog"),AF="DialogTrigger",X4=s.forwardRef(ea(function(t,n){const{__scopeDialog:r,...a}=t,i=Xa(AF,r),l=un(n,i.triggerRef);return o.jsx(pn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Zp(i.open),...a,ref:l,onClick:At(t.onClick,i.onOpenToggle)})},"DialogTrigger")),rC="DialogPortal",[NF,sC]=tC(rC,{forceMount:void 0}),Ec=ea(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Xa(rC,t);return o.jsx(NF,{scope:t,forceMount:n,children:s.Children.map(r,l=>o.jsx(cs,{present:n||i.open,children:o.jsx(pf,{asChild:!0,container:a,children:l})}))})},"DialogPortal"),i6="DialogOverlay",Cc=s.forwardRef(ea(function(t,n){const r=sC(i6,t.__scopeDialog),{forceMount:a=r.forceMount,...i}=t,l=Xa(i6,t.__scopeDialog);return l.modal?o.jsx(cs,{present:a||l.open,children:o.jsx(RF,{...i,ref:n})}):null},"DialogOverlay")),MF=Wa("DialogOverlay.RemoveScroll"),RF=s.forwardRef(ea(function(t,n){const{__scopeDialog:r,...a}=t,i=Xa(i6,r),l=I7(),u=un(n,l);return o.jsx(mf,{as:MF,allowPinchZoom:!0,shards:[i.contentRef],children:o.jsx(pn.div,{"data-state":Zp(i.open),...a,ref:u,style:{pointerEvents:"auto",...a.style}})})},"DialogOverlayImpl")),I0="DialogContent",jc=s.forwardRef(ea(function(t,n){const r=sC(I0,t.__scopeDialog),{forceMount:a=r.forceMount,...i}=t,l=Xa(I0,t.__scopeDialog);return o.jsx(cs,{present:a||l.open,children:l.modal?o.jsx(PF,{...i,ref:n}):o.jsx(LF,{...i,ref:n})})},"DialogContent")),PF=s.forwardRef(ea(function(t,n){const r=Xa(I0,t.__scopeDialog),a=s.useRef(null),i=un(n,r.contentRef,a);return s.useEffect(()=>{const l=a.current;if(l)return _p(l)},[]),o.jsx(aC,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:At(t.onCloseAutoFocus,l=>{var u;l.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:At(t.onPointerDownOutside,l=>{const u=l.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&l.preventDefault()}),onFocusOutside:At(t.onFocusOutside,l=>l.preventDefault())})},"DialogContentModal")),LF=s.forwardRef(ea(function(t,n){const r=Xa(I0,t.__scopeDialog),a=s.useRef(!1),i=s.useRef(!1);return o.jsx(aC,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var u,f;(u=t.onCloseAutoFocus)==null||u.call(t,l),l.defaultPrevented||(a.current||(f=r.triggerRef.current)==null||f.focus(),l.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:l=>{var h,p;(h=t.onInteractOutside)==null||h.call(t,l),l.defaultPrevented||(a.current=!0,l.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=l.target;((p=r.triggerRef.current)==null?void 0:p.contains(u))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&i.current&&l.preventDefault()}})},"DialogContentNonModal")),aC=s.forwardRef(ea(function(t,n){const{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:l,...u}=t,f=Xa(I0,r);return ud(),o.jsx(o.Fragment,{children:o.jsx(cd,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:l,children:o.jsx(hf,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionPresent?f.descriptionId:void 0,"aria-labelledby":f.titlePresent?f.titleId:void 0,"data-state":Zp(f.open),...u,ref:n,deferPointerDownOutside:!0,onDismiss:()=>f.onOpenChange(!1)})})})},"DialogContentImpl")),$F="DialogTitle",Ac=s.forwardRef(ea(function(t,n){const{__scopeDialog:r,...a}=t,i=Xa($F,r),{setTitleCount:l}=i;return br(()=>(l(u=>u+1),()=>l(u=>u-1)),[l]),o.jsx(pn.h2,{id:i.titleId,...a,ref:n})},"DialogTitle")),TF="DialogDescription",Q4=s.forwardRef(ea(function(t,n){const{__scopeDialog:r,...a}=t,i=Xa(TF,r),{setDescriptionCount:l}=i;return br(()=>(l(u=>u+1),()=>l(u=>u-1)),[l]),o.jsx(pn.p,{id:i.descriptionId,...a,ref:n})},"DialogDescription")),DF="DialogClose",Vp=s.forwardRef(ea(function(t,n){const{__scopeDialog:r,...a}=t,i=Xa(DF,r);return o.jsx(pn.button,{type:"button",...a,ref:n,onClick:At(t.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function Zp(e){return e?"open":"closed"}ea(Zp,"getState");var HF=Object.defineProperty,fi=(e,t)=>HF(e,"name",{value:t,configurable:!0}),OF="AlertDialog",[IF,Uce]=Hs(OF,[nC]),hi=nC(),FF=fi(e=>{const{__scopeAlertDialog:t,...n}=e,r=hi(t);return o.jsx(Sc,{...r,...n,modal:!0})},"AlertDialog"),_F=s.forwardRef(fi(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=hi(r);return o.jsx(X4,{...i,...a,ref:n})},"AlertDialogTrigger")),VF=fi(e=>{const{__scopeAlertDialog:t,...n}=e,r=hi(t);return o.jsx(Ec,{...r,...n})},"AlertDialogPortal"),ZF=s.forwardRef(fi(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=hi(r);return o.jsx(Cc,{...i,...a,ref:n})},"AlertDialogOverlay")),zF="AlertDialogContent",[BF,UF]=IF(zF),WF=s.forwardRef(fi(function(t,n){const{__scopeAlertDialog:r,children:a,...i}=t,l=hi(r),u=s.useRef(null),f=un(n,u),h=s.useRef(null);return o.jsx(BF,{scope:r,cancelRef:h,children:o.jsx(jc,{role:"alertdialog",...l,...i,ref:f,onOpenAutoFocus:At(i.onOpenAutoFocus,p=>{var g;p.preventDefault(),(g=h.current)==null||g.focus({preventScroll:!0})}),onPointerDownOutside:p=>p.preventDefault(),onInteractOutside:p=>p.preventDefault(),children:a})})},"AlertDialogContent")),KF=s.forwardRef(fi(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=hi(r);return o.jsx(Ac,{...i,...a,ref:n})},"AlertDialogTitle")),GF=s.forwardRef(fi(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=hi(r);return o.jsx(Q4,{...i,...a,ref:n})},"AlertDialogDescription")),YF=s.forwardRef(fi(function(t,n){const{__scopeAlertDialog:r,...a}=t,i=hi(r);return o.jsx(Vp,{...i,...a,ref:n})},"AlertDialogAction")),qF="AlertDialogCancel",XF=s.forwardRef(fi(function(t,n){const{__scopeAlertDialog:r,...a}=t,{cancelRef:i}=UF(qF,r),l=hi(r),u=un(n,i);return o.jsx(Vp,{...l,...a,ref:u})},"AlertDialogCancel")),QF=FF,JF=_F,e_=VF,t_=ZF,n_=WF,r_=YF,s_=XF,a_=KF,o_=GF,i_=Object.defineProperty,l_=(e,t)=>i_(e,"name",{value:t,configurable:!0});function oC(e){const[t,n]=s.useState(void 0);return br(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let l,u;if("borderBoxSize"in i){const f=i.borderBoxSize,h=Array.isArray(f)?f[0]:f;l=h.inlineSize,u=h.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}l_(oC,"useSize");const c_=["top","right","bottom","left"],rl=Math.min,Go=Math.max,_h=Math.round,J1=Math.floor,Yo=e=>({x:e,y:e}),u_={left:"right",right:"left",bottom:"top",top:"bottom"};function iC(e,t,n){return Go(e,rl(t,n))}function oi(e,t){return typeof e=="function"?e(t):e}function sl(e){return e.split("-")[0]}function dd(e){return e.split("-")[1]}function J4(e){return e==="x"?"y":"x"}function ev(e){return e==="y"?"height":"width"}function mo(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function tv(e){return J4(mo(e))}function d_(e,t,n){n===void 0&&(n=!1);const r=dd(e),a=tv(e),i=ev(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Vh(l)),[l,Vh(l)]}function f_(e){const t=Vh(e);return[l6(e),t,l6(t)]}function l6(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const h3=["left","right"],p3=["right","left"],h_=["top","bottom"],p_=["bottom","top"];function m_(e,t,n){switch(e){case"top":case"bottom":return n?t?p3:h3:t?h3:p3;case"left":case"right":return t?h_:p_;default:return[]}}function g_(e,t,n,r){const a=dd(e);let i=m_(sl(e),n==="start",r);return a&&(i=i.map(l=>l+"-"+a),t&&(i=i.concat(i.map(l6)))),i}function Vh(e){const t=sl(e);return u_[t]+e.slice(t.length)}function v_(e){var t,n,r,a;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(a=e.left)!=null?a:0}}function lC(e){return typeof e!="number"?v_(e):{top:e,right:e,bottom:e,left:e}}function Zh(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function m3(e,t,n){let{reference:r,floating:a}=e;const i=mo(t),l=tv(t),u=ev(l),f=sl(t),h=i==="y",p=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,v=r[u]/2-a[u]/2;let w;switch(f){case"top":w={x:p,y:r.y-a.height};break;case"bottom":w={x:p,y:r.y+r.height};break;case"right":w={x:r.x+r.width,y:g};break;case"left":w={x:r.x-a.width,y:g};break;default:w={x:r.x,y:r.y}}const b=dd(t);return b&&(w[l]+=v*(b==="end"?1:-1)*(n&&h?-1:1)),w}async function w_(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:l,elements:u,strategy:f}=e,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:g="floating",altBoundary:v=!1,padding:w=0}=oi(t,e),b=lC(w),k=u[v?g==="floating"?"reference":"floating":g],S=Zh(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(k)))==null||n?k:k.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:h,rootBoundary:p,strategy:f})),E=g==="floating"?{x:r,y:a,width:l.floating.width,height:l.floating.height}:l.reference,j=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),N=await(i.isElement==null?void 0:i.isElement(j))&&await(i.getScale==null?void 0:i.getScale(j))||{x:1,y:1},A=Zh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:E,offsetParent:j,strategy:f}):E);return{top:(S.top-A.top+b.top)/N.y,bottom:(A.bottom-S.bottom+b.bottom)/N.y,left:(S.left-A.left+b.left)/N.x,right:(A.right-S.right+b.right)/N.x}}const y_=50,b_=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,u=l.detectOverflow?l:{...l,detectOverflow:w_},f=await(l.isRTL==null?void 0:l.isRTL(t));let h=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:p,y:g}=m3(h,r,f),v=r,w=0;const b={};for(let y=0;y<i.length;y++){const k=i[y];if(!k)continue;const{name:S,fn:E}=k,{x:j,y:N,data:A,reset:T}=await E({x:p,y:g,initialPlacement:r,placement:v,strategy:a,middlewareData:b,rects:h,platform:u,elements:{reference:e,floating:t}});p=j??p,g=N??g,b[S]={...b[S],...A},T&&w<y_&&(w++,typeof T=="object"&&(T.placement&&(v=T.placement),T.rects&&(h=T.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:a}):T.rects),{x:p,y:g}=m3(h,v,f)),y=-1)}return{x:p,y:g,placement:v,strategy:a,middlewareData:b}},x_=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:l,elements:u,middlewareData:f}=t,{element:h,padding:p=0}=oi(e,t)||{};if(h==null)return{};const g=lC(p),v={x:n,y:r},w=tv(a),b=ev(w),y=await l.getDimensions(h),k=w==="y",S=k?"top":"left",E=k?"bottom":"right",j=k?"clientHeight":"clientWidth",N=i.reference[b]+i.reference[w]-v[w]-i.floating[b],A=v[w]-i.reference[w],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(h));let P=T?T[j]:0;(!P||!await(l.isElement==null?void 0:l.isElement(T)))&&(P=u.floating[j]||i.floating[b]);const C=N/2-A/2,R=P/2-y[b]/2-1,$=rl(g[S],R),H=rl(g[E],R),D=P-y[b]-H,q=P/2-y[b]/2+C,_=iC($,q,D),U=!f.arrow&&dd(a)!=null&&q!==_&&i.reference[b]/2-(q<$?$:H)-y[b]/2<0,Y=U?q<$?q-$:q-D:0;return{[w]:v[w]+Y,data:{[w]:_,centerOffset:q-_-Y,...U&&{alignmentOffset:Y}},reset:U}}}),k_=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:l,initialPlacement:u,platform:f,elements:h}=t,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:y=!0,...k}=oi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=sl(a),E=mo(u),j=sl(u)===u,N=await(f.isRTL==null?void 0:f.isRTL(h.floating)),A=v||(j||!y?[Vh(u)]:f_(u)),T=b!=="none";!v&&T&&A.push(...g_(u,y,b,N));const P=[u,...A],C=await f.detectOverflow(t,k),R=[];let $=((r=i.flip)==null?void 0:r.overflows)||[];if(p&&R.push(C[S]),g){const _=d_(a,l,N);R.push(C[_[0]],C[_[1]])}if($=[...$,{placement:a,overflows:R}],!R.every(_=>_<=0)){var H,D;const _=(((H=i.flip)==null?void 0:H.index)||0)+1,U=P[_];if(U&&(!(g==="alignment"?E!==mo(U):!1)||$.every(F=>mo(F.placement)===E?F.overflows[0]>0:!0)))return{data:{index:_,overflows:$},reset:{placement:U}};let Y=(D=$.filter(I=>I.overflows[0]<=0).sort((I,F)=>I.overflows[1]-F.overflows[1])[0])==null?void 0:D.placement;if(!Y)switch(w){case"bestFit":{var q;const I=(q=$.filter(F=>{if(T){const O=mo(F.placement);return O===E||O==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(O=>O>0).reduce((O,Z)=>O+Z,0)]).sort((F,O)=>F[1]-O[1])[0])==null?void 0:q[0];I&&(Y=I);break}case"initialPlacement":Y=u;break}if(a!==Y)return{reset:{placement:Y}}}return{}}}};function g3(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function v3(e){return c_.some(t=>e[t]>=0)}const S_=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=oi(e,t);switch(a){case"referenceHidden":{const l=await r.detectOverflow(t,{...i,elementContext:"reference"}),u=g3(l,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:v3(u)}}}case"escaped":{const l=await r.detectOverflow(t,{...i,altBoundary:!0}),u=g3(l,n.floating);return{data:{escapedOffsets:u,escaped:v3(u)}}}default:return{}}}}},cC=new Set(["left","top"]);async function E_(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=sl(n),u=dd(n),f=mo(n)==="y",h=cC.has(l)?-1:1,p=i&&f?-1:1,g=oi(t,e);let{mainAxis:v,crossAxis:w,alignmentAxis:b}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof b=="number"&&(w=u==="end"?b*-1:b),f?{x:w*p,y:v*h}:{x:v*h,y:w*p}}const C_=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:l,middlewareData:u}=t,f=await E_(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:i+f.y,data:{...f,placement:l}}}}},j_=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:i}=t,{mainAxis:l=!0,crossAxis:u=!1,limiter:f={fn:E=>{let{x:j,y:N}=E;return{x:j,y:N}}},...h}=oi(e,t),p={x:n,y:r},g=await i.detectOverflow(t,h),v=mo(a),w=J4(v);let b=p[w],y=p[v];const k=(E,j)=>iC(j+g[E==="y"?"top":"left"],j,j-g[E==="y"?"bottom":"right"]);l&&(b=k(w,b)),u&&(y=k(v,y));const S=f.fn({...t,[w]:b,[v]:y});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[w]:l,[v]:u}}}}}},A_=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:a,y:i,placement:l,rects:u,middlewareData:f}=t,{offset:h=0,mainAxis:p=!0,crossAxis:g=!0}=oi(e,t),v={x:a,y:i},w=mo(l),b=J4(w);let y=v[b],k=v[w];const S=oi(h,t),E=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(p){const A=b==="y"?"height":"width",T=u.reference[b]-u.floating[A]+E.mainAxis,P=u.reference[b]+u.reference[A]-E.mainAxis;y<T?y=T:y>P&&(y=P)}if(g){var j,N;const A=b==="y"?"width":"height",T=cC.has(sl(l)),P=u.reference[w]-u.floating[A]+(T&&((j=f.offset)==null?void 0:j[w])||0)+(T?0:E.crossAxis),C=u.reference[w]+u.reference[A]+(T?0:((N=f.offset)==null?void 0:N[w])||0)-(T?E.crossAxis:0);k<P?k=P:k>C&&(k=C)}return{[b]:y,[w]:k}}}},N_=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:a,elements:i}=t,{apply:l=()=>{},...u}=oi(e,t),f=await a.detectOverflow(t,u),h=sl(n),p=dd(n),g=mo(n)==="y",{width:v,height:w}=r.floating;let b,y;h==="top"||h==="bottom"?(b=h,y=p===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(y=h,b=p==="end"?"top":"bottom");const k=w-f.top-f.bottom,S=v-f.left-f.right,E=rl(w-f[b],k),j=rl(v-f[y],S),N=t.middlewareData.shift,A=!N;let T=E,P=j;N!=null&&N.enabled.x&&(P=S),N!=null&&N.enabled.y&&(T=k),A&&!p&&(g?P=v-2*Go(f.left,f.right):T=w-2*Go(f.top,f.bottom)),await l({...t,availableWidth:P,availableHeight:T});const C=await a.getDimensions(i.floating);return v!==C.width||w!==C.height?{reset:{rects:!0}}:{}}}};function zp(){return typeof window<"u"}function fd(e){return uC(e)?(e.nodeName||"").toLowerCase():"#document"}function $s(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pi(e){var t;return(t=(uC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function uC(e){return zp()?e instanceof Node||e instanceof $s(e).Node:!1}function ko(e){return zp()?e instanceof Element||e instanceof $s(e).Element:!1}function dl(e){return zp()?e instanceof HTMLElement||e instanceof $s(e).HTMLElement:!1}function w3(e){return!zp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof $s(e).ShadowRoot}function Bp(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=So(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function M_(e){return/^(table|td|th)$/.test(fd(e))}function Up(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const R_=/transform|translate|scale|rotate|perspective|filter/,P_=/paint|layout|strict|content/,Ol=e=>!!e&&e!=="none";let Tg;function nv(e){const t=ko(e)?So(e):e;return Ol(t.transform)||Ol(t.translate)||Ol(t.scale)||Ol(t.rotate)||Ol(t.perspective)||!rv()&&(Ol(t.backdropFilter)||Ol(t.filter))||R_.test(t.willChange||"")||P_.test(t.contain||"")}function L_(e){let t=oc(e);for(;dl(t)&&!F0(t);){if(nv(t))return t;if(Up(t))return null;t=oc(t)}return null}function rv(){return Tg==null&&(Tg=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Tg}function F0(e){return/^(html|body|#document)$/.test(fd(e))}function So(e){return $s(e).getComputedStyle(e)}function Wp(e){return ko(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oc(e){if(fd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||w3(e)&&e.host||pi(e);return w3(t)?t.host:t}function dC(e){const t=oc(e);return F0(t)?(e.ownerDocument||e).body:dl(t)&&Bp(t)?t:dC(t)}function _0(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=dC(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),l=$s(a);if(i){const u=c6(l);return t.concat(l,l.visualViewport||[],Bp(a)?a:[],u&&n?_0(u):[])}else return t.concat(a,_0(a,[],n))}function c6(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fC(e){const t=So(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=dl(e),i=a?e.offsetWidth:n,l=a?e.offsetHeight:r,u=_h(n)!==i||_h(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function sv(e){return ko(e)?e:e.contextElement}function Tu(e){const t=sv(e);if(!dl(t))return Yo(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=fC(t);let l=(i?_h(n.width):n.width)/r,u=(i?_h(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const $_=Yo(0);function hC(e){const t=$s(e);return!rv()||!t.visualViewport?$_:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function T_(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===$s(e)}function ic(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=sv(e);let l=Yo(1);t&&(r?ko(r)&&(l=Tu(r)):l=Tu(e));const u=T_(i,n,r)?hC(i):Yo(0);let f=(a.left+u.x)/l.x,h=(a.top+u.y)/l.y,p=a.width/l.x,g=a.height/l.y;if(i&&r){const v=$s(i),w=ko(r)?$s(r):r;let b=v,y=c6(b);for(;y&&w!==b;){const k=Tu(y),S=y.getBoundingClientRect(),E=So(y),j=S.left+(y.clientLeft+parseFloat(E.paddingLeft))*k.x,N=S.top+(y.clientTop+parseFloat(E.paddingTop))*k.y;f*=k.x,h*=k.y,p*=k.x,g*=k.y,f+=j,h+=N,b=$s(y),y=c6(b)}}return Zh({width:p,height:g,x:f,y:h})}function Kp(e,t){const n=Wp(e).scrollLeft;return t?t.left+n:ic(pi(e)).left+n}function pC(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Kp(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function D_(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",l=pi(r),u=t?Up(t.floating):!1;if(r===l||u&&i)return n;let f={scrollLeft:0,scrollTop:0},h=Yo(1);const p=Yo(0),g=dl(r);if((g||!i)&&((fd(r)!=="body"||Bp(l))&&(f=Wp(r)),g)){const w=ic(r);h=Tu(r),p.x=w.x+r.clientLeft,p.y=w.y+r.clientTop}const v=l&&!g&&!i?pC(l,f):Yo(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+p.x+v.x,y:n.y*h.y-f.scrollTop*h.y+p.y+v.y}}function H_(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function O_(e){const t=Wp(e),n=e.ownerDocument.body,r=Go(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=Go(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+Kp(e);const l=-t.scrollTop;return So(n).direction==="rtl"&&(i+=Go(e.clientWidth,n.clientWidth)-r),{width:r,height:a,x:i,y:l}}const I_=25;function F_(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",a=$s(e),i=pi(e),l=a.visualViewport;let u=i.clientWidth,f=i.clientHeight,h=0,p=0;if(l){const v=!rv()||t==="fixed";r?v||(h=-l.offsetLeft,p=-l.offsetTop):(u=l.width,f=l.height,v&&(h=l.offsetLeft,p=l.offsetTop))}if(Kp(i)<=0){const v=i.ownerDocument,w=v.body,b=getComputedStyle(w),y=v.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,k=Math.abs(i.clientWidth-w.clientWidth-y),S=getComputedStyle(i).scrollbarGutter==="stable both-edges"?k/2:k;S<=I_&&(u-=S)}return{width:u,height:f,x:h,y:p}}function __(e,t){const n=ic(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Tu(e),l=e.clientWidth*i.x,u=e.clientHeight*i.y,f=a*i.x,h=r*i.y;return{width:l,height:u,x:f,y:h}}function y3(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=F_(e,n,t);else if(t==="document")r=O_(pi(e));else if(ko(t))r=__(t,n);else{const a=hC(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Zh(r)}function V_(e,t){const n=t.get(e);if(n)return n;let r=_0(e,[],!1).filter(u=>ko(u)&&fd(u)!=="body"),a=null;const i=So(e).position==="fixed";let l=i?oc(e):e;for(;ko(l)&&!F0(l);){const u=So(l),f=nv(l),h=a?a.position:i?"fixed":"";!f&&(h==="fixed"||h==="absolute"&&u.position==="static")?r=r.filter(g=>g!==l):a=u,l=oc(l)}return t.set(e,r),r}function Z_(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?Up(t)?[]:V_(t,this._c):[].concat(n),r],u=y3(t,l[0],a);let f=u.top,h=u.right,p=u.bottom,g=u.left;for(let v=1;v<l.length;v++){const w=y3(t,l[v],a);f=Go(w.top,f),h=rl(w.right,h),p=rl(w.bottom,p),g=Go(w.left,g)}return{width:h-g,height:p-f,x:g,y:f}}function z_(e){const{width:t,height:n}=fC(e);return{width:t,height:n}}function B_(e,t,n){const r=dl(t),a=pi(t),i=n==="fixed",l=ic(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const f=Yo(0);if((r||!i)&&((fd(t)!=="body"||Bp(a))&&(u=Wp(t)),r)){const v=ic(t,!0,i,t);f.x=v.x+t.clientLeft,f.y=v.y+t.clientTop}!r&&a&&(f.x=Kp(a));const h=a&&!r&&!i?pC(a,u):Yo(0),p=l.left+u.scrollLeft-f.x-h.x,g=l.top+u.scrollTop-f.y-h.y;return{x:p,y:g,width:l.width,height:l.height}}function Dg(e){return So(e).position==="static"}function b3(e,t){if(!dl(e)||So(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return pi(e)===n&&(n=n.ownerDocument.body),n}function mC(e,t){const n=$s(e);if(Up(e))return n;if(!dl(e)){let a=oc(e);for(;a&&!F0(a);){if(ko(a)&&!Dg(a))return a;a=oc(a)}return n}let r=b3(e,t);for(;r&&M_(r)&&Dg(r);)r=b3(r,t);return r&&F0(r)&&Dg(r)&&!nv(r)?n:r||L_(e)||n}const U_=async function(e){const t=this.getOffsetParent||mC,n=this.getDimensions,r=await n(e.floating);return{reference:B_(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function W_(e){return So(e).direction==="rtl"}const K_={convertOffsetParentRelativeRectToViewportRelativeRect:D_,getDocumentElement:pi,getClippingRect:Z_,getOffsetParent:mC,getElementRects:U_,getClientRects:H_,getDimensions:z_,getScale:Tu,isElement:ko,isRTL:W_};function gC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function G_(e,t,n){let r=null,a;const i=pi(e);function l(){var p;clearTimeout(a),(p=r)==null||p.disconnect(),r=null}function u(p,g){p===void 0&&(p=!1),g===void 0&&(g=1),l();const v=e.getBoundingClientRect(),{left:w,top:b,width:y,height:k}=v;if(p||t(),!y||!k)return;const S=J1(b),E=J1(i.clientWidth-(w+y)),j=J1(i.clientHeight-(b+k)),N=J1(w),T={rootMargin:-S+"px "+-E+"px "+-j+"px "+-N+"px",threshold:Go(0,rl(1,g))||1};let P=!0;function C(R){const $=R[0].intersectionRatio;if(!gC(v,e.getBoundingClientRect()))return u();if($!==g){if(!P)return u();$?u(!1,$):a=setTimeout(()=>{u(!1,1e-7)},1e3)}P=!1}try{r=new IntersectionObserver(C,{...T,root:i.ownerDocument})}catch{r=new IntersectionObserver(C,T)}r.observe(e)}const f=$s(e),h=()=>u(n);return f.addEventListener("resize",h),u(!0),()=>{f.removeEventListener("resize",h),l()}}function vC(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,h=sv(e),p=a||i?[...h?_0(h):[],...t?_0(t):[]]:[];p.forEach(S=>{a&&S.addEventListener("scroll",n),i&&S.addEventListener("resize",n)});const g=h&&u?G_(h,n,i):null;let v=-1,w=null;l&&(w=new ResizeObserver(S=>{let[E]=S;E&&E.target===h&&w&&t&&(w.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var j;(j=w)==null||j.observe(t)})),n()}),h&&!f&&w.observe(h),t&&w.observe(t));let b,y=f?ic(e):null;f&&k();function k(){const S=ic(e);y&&!gC(y,S)&&n(),y=S,b=requestAnimationFrame(k)}return n(),()=>{var S;p.forEach(E=>{a&&E.removeEventListener("scroll",n),i&&E.removeEventListener("resize",n)}),g==null||g(),(S=w)==null||S.disconnect(),w=null,f&&cancelAnimationFrame(b)}}const wC=C_,yC=j_,bC=k_,Y_=N_,q_=S_,u6=x_,X_=A_,xC=(e,t,n)=>{const r=new Map,a=n??{},i={...K_,...a.platform,_c:r};return b_(e,t,{...a,platform:i})};var Q_=typeof document<"u",J_=function(){},Ah=Q_?s.useLayoutEffect:J_;function zh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!zh(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!zh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function kC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function x3(e,t){const n=kC(e);return Math.round(t*n)/n}function Hg(e){const t=s.useRef(e);return Ah(()=>{t.current=e}),t}function eV(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:l}={},transform:u=!0,whileElementsMounted:f,open:h}=e,[p,g]=s.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,w]=s.useState(r);zh(v,r)||w(r);const[b,y]=s.useState(null),[k,S]=s.useState(null),E=s.useCallback(F=>{F!==T.current&&(T.current=F,y(F))},[]),j=s.useCallback(F=>{F!==P.current&&(P.current=F,S(F))},[]),N=i||b,A=l||k,T=s.useRef(null),P=s.useRef(null),C=s.useRef(p),R=f!=null,$=Hg(f),H=Hg(a),D=Hg(h),q=s.useCallback(()=>{if(!T.current||!P.current)return;const F={placement:t,strategy:n,middleware:v};H.current&&(F.platform=H.current),xC(T.current,P.current,F).then(O=>{const Z={...O,isPositioned:D.current!==!1};_.current&&!zh(C.current,Z)&&(C.current=Z,_r.flushSync(()=>{g(Z)}))})},[v,t,n,H,D]);Ah(()=>{h===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,g(F=>({...F,isPositioned:!1})))},[h]);const _=s.useRef(!1);Ah(()=>(_.current=!0,()=>{_.current=!1}),[]),Ah(()=>{if(N&&(T.current=N),A&&(P.current=A),N&&A){if($.current)return $.current(N,A,q);q()}},[N,A,q,$,R]);const U=s.useMemo(()=>({reference:T,floating:P,setReference:E,setFloating:j}),[E,j]),Y=s.useMemo(()=>({reference:N,floating:A}),[N,A]),I=s.useMemo(()=>{const F={position:n,left:0,top:0};if(!Y.floating)return F;const O=x3(Y.floating,p.x),Z=x3(Y.floating,p.y);return u?{...F,transform:"translate("+O+"px, "+Z+"px)",...kC(Y.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:Z}},[n,u,Y.floating,p.x,p.y]);return s.useMemo(()=>({...p,update:q,refs:U,elements:Y,floatingStyles:I}),[p,q,U,Y,I])}const tV=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?u6({element:r.current,padding:a}).fn(n):{}:r?u6({element:r,padding:a}).fn(n):{}}}},nV=(e,t)=>{const n=wC(e);return{name:n.name,fn:n.fn,options:[e,t]}},rV=(e,t)=>{const n=yC(e);return{name:n.name,fn:n.fn,options:[e,t]}},sV=(e,t)=>({fn:X_(e).fn,options:[e,t]}),aV=(e,t)=>{const n=bC(e);return{name:n.name,fn:n.fn,options:[e,t]}},oV=(e,t)=>{const n=Y_(e);return{name:n.name,fn:n.fn,options:[e,t]}},iV=(e,t)=>{const n=q_(e);return{name:n.name,fn:n.fn,options:[e,t]}},lV=(e,t)=>{const n=tV(e);return{name:n.name,fn:n.fn,options:[e,t]}};var cV=Object.defineProperty,uV=(e,t)=>cV(e,"name",{value:t,configurable:!0}),dV=s.forwardRef(uV(function(t,n){const{children:r,width:a=10,height:i=5,...l}=t;return o.jsx(pn.svg,{...l,ref:n,width:a,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:o.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),fV=dV,hV=Object.defineProperty,qo=(e,t)=>hV(e,"name",{value:t,configurable:!0}),SC="Popper",[EC,fl]=Hs(SC),[pV,CC]=EC(SC),mV=qo(e=>{const{__scopePopper:t,children:n}=e,[r,a]=s.useState(null),[i,l]=s.useState(void 0);return o.jsx(pV,{scope:t,anchor:r,onAnchorChange:a,placementState:i,setPlacementState:l,children:n})},"Popper"),gV="PopperAnchor",vV=s.forwardRef(qo(function(t,n){const{__scopePopper:r,virtualRef:a,...i}=t,l=CC(gV,r),u=s.useRef(null),f=l.onAnchorChange,h=s.useCallback(y=>{u.current=y,y&&f(y)},[f]),p=un(n,h),g=s.useRef(null);s.useEffect(()=>{if(!a)return;const y=g.current;g.current=a.current,y!==g.current&&f(g.current)});const v=l.placementState&&Gp(l.placementState),w=v==null?void 0:v[0],b=v==null?void 0:v[1];return a?null:o.jsx(pn.div,{"data-radix-popper-side":w,"data-radix-popper-align":b,...i,ref:p})},"PopperAnchor")),jC="PopperContent",[wV,yV]=EC(jC),bV=s.forwardRef(qo(function(t,n){var we,G,ue,Ne,ne,Fe,Oe;const{__scopePopper:r,side:a="bottom",sideOffset:i=0,align:l="center",alignOffset:u=0,arrowPadding:f=0,avoidCollisions:h=!0,collisionBoundary:p=[],collisionPadding:g=0,sticky:v="partial",hideWhenDetached:w=!1,updatePositionStrategy:b="optimized",onPlaced:y,...k}=t,S=CC(jC,r),[E,j]=s.useState(null),N=un(n,j),[A,T]=s.useState(null),P=oC(A),C=(P==null?void 0:P.width)??0,R=(P==null?void 0:P.height)??0,$=a+(l!=="center"?"-"+l:""),H=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},D=Array.isArray(p)?p:[p],q=D.length>0,_={padding:H,boundary:D.filter(AC),altBoundary:q},{refs:U,floatingStyles:Y,placement:I,isPositioned:F,middlewareData:O}=eV({strategy:"fixed",placement:$,whileElementsMounted:qo((...ot)=>vC(...ot,{animationFrame:b==="always"}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[nV({mainAxis:i+R,alignmentAxis:u}),h&&rV({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?sV():void 0,..._}),h&&aV({..._}),oV({..._,apply:qo(({elements:ot,rects:Xe,availableWidth:X,availableHeight:J})=>{const{width:ge,height:ve}=Xe.reference,Ze=ot.floating.style;Ze.setProperty("--radix-popper-available-width",`${X}px`),Ze.setProperty("--radix-popper-available-height",`${J}px`),Ze.setProperty("--radix-popper-anchor-width",`${ge}px`),Ze.setProperty("--radix-popper-anchor-height",`${ve}px`)},"apply")}),A&&lV({element:A,padding:f}),EV({arrowWidth:C,arrowHeight:R}),w&&iV({strategy:"referenceHidden",..._,boundary:q?_.boundary:void 0})]}),Z=S.setPlacementState;br(()=>(Z(I),()=>{Z(void 0)}),[I,Z]);const[V,B]=Gp(I),K=wr(y);br(()=>{F&&(K==null||K())},[F,K]);const ee=(we=O.arrow)==null?void 0:we.x,se=(G=O.arrow)==null?void 0:G.y,oe=((ue=O.arrow)==null?void 0:ue.centerOffset)!==0,[me,ce]=s.useState();return br(()=>{E&&ce(window.getComputedStyle(E).zIndex)},[E]),o.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:F?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(Ne=O.transformOrigin)==null?void 0:Ne.x,(ne=O.transformOrigin)==null?void 0:ne.y].join(" "),...((Fe=O.hide)==null?void 0:Fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:o.jsx(wV,{scope:r,placedSide:V,placedAlign:B,onArrowChange:T,arrowX:ee,arrowY:se,shouldHideArrow:oe,children:o.jsx(pn.div,{"data-side":V,"data-align":B,...k,ref:N,style:{...k.style,animation:F?(Oe=k.style)==null?void 0:Oe.animation:"none"}})})})},"PopperContent")),xV="PopperArrow",kV={top:"bottom",right:"left",bottom:"top",left:"right"},SV=s.forwardRef(qo(function(t,n){const{__scopePopper:r,...a}=t,i=yV(xV,r),l=kV[i.placedSide];return o.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:o.jsx(fV,{...a,ref:n,style:{...a.style,display:"block"}})})},"PopperArrow"));function AC(e){return e!==null}qo(AC,"isNotNull");var EV=qo(e=>({name:"transformOrigin",options:e,fn(t){var k,S,E;const{placement:n,rects:r,middlewareData:a}=t,l=((k=a.arrow)==null?void 0:k.centerOffset)!==0,u=l?0:e.arrowWidth,f=l?0:e.arrowHeight,[h,p]=Gp(n),g={start:"0%",center:"50%",end:"100%"}[p],v=(((S=a.arrow)==null?void 0:S.x)??0)+u/2,w=(((E=a.arrow)==null?void 0:E.y)??0)+f/2;let b="",y="";return h==="bottom"?(b=l?g:`${v}px`,y=`${-f}px`):h==="top"?(b=l?g:`${v}px`,y=`${r.floating.height+f}px`):h==="right"?(b=`${-f}px`,y=l?g:`${w}px`):h==="left"&&(b=`${r.floating.width+f}px`,y=l?g:`${w}px`),{data:{x:b,y}}}}),"transformOrigin");function Gp(e){const[t,n="center"]=e.split("-");return[t,n]}qo(Gp,"getSideAndAlignFromPlacement");var Yp=mV,gf=vV,qp=bV,CV=SV,jV=Object.defineProperty,av=(e,t)=>jV(e,"name",{value:t,configurable:!0}),Og=!1;function NC(){const[e,t]=s.useState(Og);return s.useEffect(()=>{Og||(Og=!0,t(!0))},[]),e}av(NC,"useIsHydrated");var MC=vc[" useSyncExternalStore ".trim().toString()];function RC(){return()=>{}}av(RC,"subscribe");function PC(){return MC(RC,()=>!0,()=>!1)}av(PC,"useIsHydratedModern");var AV=typeof MC=="function"?PC:NC,NV=Object.defineProperty,Nc=(e,t)=>NV(e,"name",{value:t,configurable:!0}),Ig="rovingFocusGroup.onEntryFocus",MV={bubbles:!1,cancelable:!0},Xp="RovingFocusGroup",[d6,LC,RV]=Ip(Xp),[PV,$C]=Hs(Xp,[RV]),[LV,$V]=PV(Xp),TV=s.forwardRef(Nc(function(t,n){return o.jsx(d6.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(d6.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx(DV,{...t,ref:n})})})},"RovingFocusGroup")),DV=s.forwardRef(Nc(function(t,n){const{__scopeRovingFocusGroup:r,orientation:a,loop:i=!1,dir:l,currentTabStopId:u,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:h,onEntryFocus:p,preventScrollOnEntryFocus:g=!1,...v}=t,w=s.useRef(null),b=un(n,w),y=ff(l),[k,S]=si({prop:u,defaultProp:f??null,onChange:h,caller:Xp}),[E,j]=s.useState(!1),N=wr(p),A=LC(r),T=s.useRef(!1),[P,C]=s.useState(0);return s.useEffect(()=>{const R=w.current;if(R)return R.addEventListener(Ig,N),()=>R.removeEventListener(Ig,N)},[N]),o.jsx(LV,{scope:r,orientation:a,dir:y,loop:i,currentTabStopId:k,onItemFocus:s.useCallback(R=>S(R),[S]),onItemShiftTab:s.useCallback(()=>j(!0),[]),onFocusableItemAdd:s.useCallback(()=>C(R=>R+1),[]),onFocusableItemRemove:s.useCallback(()=>C(R=>R-1),[]),children:o.jsx(pn.div,{tabIndex:E||P===0?-1:0,"data-orientation":a,...v,ref:b,style:{outline:"none",...t.style},onMouseDown:At(t.onMouseDown,()=>{T.current=!0}),onFocus:At(t.onFocus,R=>{const $=!T.current;if(R.target===R.currentTarget&&$&&!E){const H=new CustomEvent(Ig,MV);if(R.currentTarget.dispatchEvent(H),!H.defaultPrevented){const D=A().filter(I=>I.focusable),q=D.find(I=>I.active),_=D.find(I=>I.id===k),Y=[q,_,...D].filter(Boolean).map(I=>I.ref.current);ov(Y,g)}}T.current=!1}),onBlur:At(t.onBlur,()=>j(!1))})})},"RovingFocusGroupImpl")),HV="RovingFocusGroupItem",OV=s.forwardRef(Nc(function(t,n){const{__scopeRovingFocusGroup:r,focusable:a=!0,active:i=!1,tabStopId:l,children:u,...f}=t,h=ya(),p=l||h,g=$V(HV,r),v=g.currentTabStopId===p,w=LC(r),{onFocusableItemAdd:b,onFocusableItemRemove:y,currentTabStopId:k}=g,S=AV();return br(()=>{if(!(!S||!a))return b(),()=>y()},[S,a,b,y]),s.useEffect(()=>{if(!(S||!a))return b(),()=>y()},[S,a,b,y]),o.jsx(d6.ItemSlot,{scope:r,id:p,focusable:a,active:i,children:o.jsx(pn.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...f,ref:n,onMouseDown:At(t.onMouseDown,E=>{a?g.onItemFocus(p):E.preventDefault()}),onFocus:At(t.onFocus,()=>g.onItemFocus(p)),onKeyDown:At(t.onKeyDown,E=>{if(E.key==="Tab"&&E.shiftKey){g.onItemShiftTab();return}if(E.target!==E.currentTarget)return;const j=DC(E,g.orientation,g.dir);if(j!==void 0){if(E.metaKey||E.ctrlKey||E.altKey||E.shiftKey)return;E.preventDefault();let A=w().filter(T=>T.focusable).map(T=>T.ref.current);if(j==="last")A.reverse();else if(j==="prev"||j==="next"){j==="prev"&&A.reverse();const T=A.indexOf(E.currentTarget);A=g.loop?HC(A,T+1):A.slice(T+1)}setTimeout(()=>ov(A))}}),children:typeof u=="function"?u({isCurrentTabStop:v,hasTabStop:k!=null}):u})})},"RovingFocusGroupItem")),IV={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function TC(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Nc(TC,"getDirectionAwareKey");function DC(e,t,n){const r=TC(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return IV[r]}Nc(DC,"getFocusIntent");function ov(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Nc(ov,"focusFirst");function HC(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Nc(HC,"wrapArray");var FV=TV,_V=OV,VV=Object.defineProperty,Rn=(e,t)=>VV(e,"name",{value:t,configurable:!0}),f6=["Enter"," "],ZV=["ArrowDown","PageUp","Home"],OC=["ArrowUp","PageDown","End"],zV=[...ZV,...OC],BV={ltr:[...f6,"ArrowRight"],rtl:[...f6,"ArrowLeft"]},UV={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Qp="Menu",[V0,WV,KV]=Ip(Qp),[Mc,Jp]=Hs(Qp,[KV,fl,$C]),iv=fl(),IC=$C(),[GV,Rc]=Mc(Qp),[YV,vf]=Mc(Qp),qV=Rn(e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:l=!0}=e,u=iv(t),[f,h]=s.useState(null),p=s.useRef(!1),g=wr(i),v=ff(a);return s.useEffect(()=>{const w=Rn(()=>{p.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},"handleKeyDown"),b=Rn(()=>p.current=!1,"handlePointer");return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),s.useEffect(()=>{if(!n)return;const w=Rn(()=>g(!1),"handleBlur");return window.addEventListener("blur",w),()=>window.removeEventListener("blur",w)},[n,g]),o.jsx(Yp,{...u,children:o.jsx(GV,{scope:t,open:n,onOpenChange:g,content:f,onContentChange:h,children:o.jsx(YV,{scope:t,onClose:s.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:p,dir:v,modal:l,children:r})})})},"Menu"),FC=s.forwardRef(Rn(function(t,n){const{__scopeMenu:r,...a}=t,i=iv(r);return o.jsx(gf,{...i,...a,ref:n})},"MenuAnchor")),_C="MenuPortal",[XV,VC]=Mc(_C,{forceMount:void 0}),QV=Rn(e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=Rc(_C,t);return o.jsx(XV,{scope:t,forceMount:n,children:o.jsx(cs,{present:n||i.open,children:o.jsx(pf,{asChild:!0,container:a,children:r})})})},"MenuPortal"),Va="MenuContent",[JV,lv]=Mc(Va),eZ=s.forwardRef(Rn(function(t,n){const r=VC(Va,t.__scopeMenu),{forceMount:a=r.forceMount,...i}=t,l=Rc(Va,t.__scopeMenu),u=vf(Va,t.__scopeMenu);return o.jsx(V0.Provider,{scope:t.__scopeMenu,children:o.jsx(cs,{present:a||l.open,children:o.jsx(V0.Slot,{scope:t.__scopeMenu,children:u.modal?o.jsx(tZ,{...i,ref:n}):o.jsx(nZ,{...i,ref:n})})})})},"MenuContent")),tZ=s.forwardRef(Rn(function(t,n){const r=Rc(Va,t.__scopeMenu),a=s.useRef(null),i=un(n,a);return s.useEffect(()=>{const l=a.current;if(l)return _p(l)},[]),o.jsx(cv,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:At(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),nZ=s.forwardRef(Rn(function(t,n){const r=Rc(Va,t.__scopeMenu);return o.jsx(cv,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),rZ=Wa("MenuContent.ScrollLock"),cv=s.forwardRef(Rn(function(t,n){const{__scopeMenu:r,loop:a=!1,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:u,disableOutsidePointerEvents:f,onEntryFocus:h,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:w,onDismiss:b,disableOutsideScroll:y,...k}=t,S=Rc(Va,r),E=vf(Va,r),j=iv(r),N=IC(r),A=WV(r),[T,P]=s.useState(null),C=s.useRef(null),R=un(n,C,S.onContentChange),$=s.useRef(0),H=s.useRef(""),D=s.useRef(0),q=s.useRef(null),_=s.useRef("right"),U=s.useRef(0),Y=y?mf:s.Fragment,I=y?{as:rZ,allowPinchZoom:!0}:void 0,F=Rn(Z=>{var ce,we;const V=H.current+Z,B=A().filter(G=>!G.disabled),K=document.activeElement,ee=(ce=B.find(G=>G.ref.current===K))==null?void 0:ce.textValue,se=B.map(G=>G.textValue),oe=YC(se,V,ee),me=(we=B.find(G=>G.textValue===oe))==null?void 0:we.ref.current;Rn((function G(ue){H.current=ue,window.clearTimeout($.current),ue!==""&&($.current=window.setTimeout(()=>G(""),1e3))}),"updateSearch")(V),me&&setTimeout(()=>me.focus())},"handleTypeaheadSearch");s.useEffect(()=>()=>window.clearTimeout($.current),[]),ud();const O=s.useCallback(Z=>{var B,K;return _.current===((B=q.current)==null?void 0:B.side)&&XC(Z,(K=q.current)==null?void 0:K.area)},[]);return o.jsx(JV,{scope:r,searchRef:H,onItemEnter:s.useCallback(Z=>{O(Z)&&Z.preventDefault()},[O]),onItemLeave:s.useCallback(Z=>{var V;O(Z)||((V=C.current)==null||V.focus(),P(null))},[O]),onTriggerLeave:s.useCallback(Z=>{O(Z)&&Z.preventDefault()},[O]),pointerGraceTimerRef:D,onPointerGraceIntentChange:s.useCallback(Z=>{q.current=Z},[]),children:o.jsx(Y,{...I,children:o.jsx(cd,{asChild:!0,trapped:i,onMountAutoFocus:At(l,Z=>{var V;Z.preventDefault(),(V=C.current)==null||V.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:o.jsx(hf,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:w,onDismiss:b,children:o.jsx(FV,{asChild:!0,...N,dir:E.dir,orientation:"vertical",loop:a,currentTabStopId:T,onCurrentTabStopIdChange:P,onEntryFocus:At(h,Z=>{E.isUsingKeyboardRef.current||Z.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(qp,{role:"menu","aria-orientation":"vertical","data-state":dv(S.open),"data-radix-menu-content":"",dir:E.dir,...j,...k,ref:R,style:{outline:"none",...k.style},onKeyDown:At(k.onKeyDown,Z=>{const B=Z.target.closest("[data-radix-menu-content]")===Z.currentTarget,K=Z.ctrlKey||Z.altKey||Z.metaKey,ee=Z.key.length===1;B&&(Z.key==="Tab"&&Z.preventDefault(),!K&&ee&&F(Z.key));const se=C.current;if(Z.target!==se||!zV.includes(Z.key))return;Z.preventDefault();const me=A().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);OC.includes(Z.key)&&me.reverse(),KC(me)}),onBlur:At(t.onBlur,Z=>{Z.currentTarget.contains(Z.target)||(window.clearTimeout($.current),H.current="")}),onPointerMove:At(t.onPointerMove,Yu(Z=>{const V=Z.target,B=U.current!==Z.clientX;if(Z.currentTarget.contains(V)&&B){const K=Z.clientX>U.current?"right":"left";_.current=K,U.current=Z.clientX}}))})})})})})})},"MenuContentImpl")),ZC=s.forwardRef(Rn(function(t,n){const{__scopeMenu:r,...a}=t;return o.jsx(pn.div,{role:"group",...a,ref:n})},"MenuGroup")),sZ=s.forwardRef(Rn(function(t,n){const{__scopeMenu:r,...a}=t;return o.jsx(pn.div,{...a,ref:n})},"MenuLabel")),h6="MenuItem",k3="menu.itemSelect",uv=s.forwardRef(Rn(function(t,n){const{disabled:r=!1,onSelect:a,...i}=t,l=s.useRef(null),u=vf(h6,t.__scopeMenu),f=lv(h6,t.__scopeMenu),h=un(n,l),p=s.useRef(!1),g=Rn(()=>{const v=l.current;if(!r&&v){const w=new CustomEvent(k3,{bubbles:!0,cancelable:!0});v.addEventListener(k3,b=>a==null?void 0:a(b),{once:!0}),U4(v,w),w.defaultPrevented?p.current=!1:u.onClose()}},"handleSelect");return o.jsx(zC,{...i,ref:h,disabled:r,onClick:At(t.onClick,g),onPointerDown:v=>{var w;(w=t.onPointerDown)==null||w.call(t,v),p.current=!0},onPointerUp:At(t.onPointerUp,v=>{var w;p.current||(w=v.currentTarget)==null||w.click()}),onKeyDown:At(t.onKeyDown,v=>{r||v.target!==v.currentTarget||f.searchRef.current!==""&&v.key===" "||f6.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})},"MenuItem")),zC=s.forwardRef(Rn(function(t,n){const{__scopeMenu:r,disabled:a=!1,textValue:i,...l}=t,u=lv(h6,r),f=IC(r),h=s.useRef(null),p=un(n,h),[g,v]=s.useState(!1),[w,b]=s.useState("");return s.useEffect(()=>{const y=h.current;y&&b((y.textContent??"").trim())},[l.children]),o.jsx(V0.ItemSlot,{scope:r,disabled:a,textValue:i??w,children:o.jsx(_V,{asChild:!0,...f,focusable:!a,children:o.jsx(pn.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...l,ref:p,onPointerMove:At(t.onPointerMove,Yu(y=>{a?u.onItemLeave(y):(u.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:At(t.onPointerLeave,Yu(y=>u.onItemLeave(y))),onFocus:At(t.onFocus,()=>v(!0)),onBlur:At(t.onBlur,()=>v(!1))})})})},"MenuItemImpl")),aZ=s.forwardRef(Rn(function(t,n){const{checked:r=!1,onCheckedChange:a,...i}=t;return o.jsx(UC,{scope:t.__scopeMenu,checked:r,children:o.jsx(uv,{role:"menuitemcheckbox","aria-checked":Z0(r)?"mixed":r,...i,ref:n,"data-state":em(r),onSelect:At(i.onSelect,()=>a==null?void 0:a(Z0(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),oZ="MenuRadioGroup",[iZ,lZ]=Mc(oZ,{value:void 0,onValueChange:Rn(()=>{},"onValueChange")}),cZ=s.forwardRef(Rn(function(t,n){const{value:r,onValueChange:a,...i}=t,l=wr(a);return o.jsx(iZ,{scope:t.__scopeMenu,value:r,onValueChange:l,children:o.jsx(ZC,{...i,ref:n})})},"MenuRadioGroup")),uZ="MenuRadioItem",dZ=s.forwardRef(Rn(function(t,n){const{value:r,...a}=t,i=lZ(uZ,t.__scopeMenu),l=r===i.value;return o.jsx(UC,{scope:t.__scopeMenu,checked:l,children:o.jsx(uv,{role:"menuitemradio","aria-checked":l,...a,ref:n,"data-state":em(l),onSelect:At(a.onSelect,()=>{var u;return(u=i.onValueChange)==null?void 0:u.call(i,r)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),BC="MenuItemIndicator",[UC,fZ]=Mc(BC,{checked:!1}),hZ=s.forwardRef(Rn(function(t,n){const{__scopeMenu:r,forceMount:a,...i}=t,l=fZ(BC,r);return o.jsx(cs,{present:a||Z0(l.checked)||l.checked===!0,children:o.jsx(pn.span,{...i,ref:n,"data-state":em(l.checked)})})},"MenuItemIndicator")),pZ=s.forwardRef(Rn(function(t,n){const{__scopeMenu:r,...a}=t;return o.jsx(pn.div,{role:"separator","aria-orientation":"horizontal",...a,ref:n})},"MenuSeparator")),mZ="MenuSub",[Wce,WC]=Mc(mZ),eh="MenuSubTrigger",gZ=s.forwardRef(Rn(function(t,n){const r=Rc(eh,t.__scopeMenu),a=vf(eh,t.__scopeMenu),i=WC(eh,t.__scopeMenu),l=lv(eh,t.__scopeMenu),u=s.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:h}=l,p={__scopeMenu:t.__scopeMenu},g=s.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);s.useEffect(()=>g,[g]),s.useEffect(()=>{const w=f.current;return()=>{window.clearTimeout(w),h(null)}},[f,h]);const v=un(n,i.onTriggerChange);return o.jsx(FC,{asChild:!0,...p,children:o.jsx(zC,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?i.contentId:void 0,"data-state":dv(r.open),...t,ref:v,onClick:w=>{var b;(b=t.onClick)==null||b.call(t,w),!(t.disabled||w.defaultPrevented)&&(w.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:At(t.onPointerMove,Yu(w=>{l.onItemEnter(w),!w.defaultPrevented&&!t.disabled&&!r.open&&!u.current&&(l.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{r.onOpenChange(!0),g()},100))})),onPointerLeave:At(t.onPointerLeave,Yu(w=>{var y,k;g();const b=(y=r.content)==null?void 0:y.getBoundingClientRect();if(b){const S=(k=r.content)==null?void 0:k.dataset.side,E=S==="right",j=E?-5:5,N=b[E?"left":"right"],A=b[E?"right":"left"];l.onPointerGraceIntentChange({area:[{x:w.clientX+j,y:w.clientY},{x:N,y:b.top},{x:A,y:b.top},{x:A,y:b.bottom},{x:N,y:b.bottom}],side:S}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(w),w.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:At(t.onKeyDown,w=>{var y;t.disabled||w.target!==w.currentTarget||l.searchRef.current!==""&&w.key===" "||BV[a.dir].includes(w.key)&&(r.onOpenChange(!0),(y=r.content)==null||y.focus(),w.preventDefault())})})})},"MenuSubTrigger")),vZ="MenuSubContent",wZ=s.forwardRef(Rn(function(t,n){const r=VC(Va,t.__scopeMenu),{forceMount:a=r.forceMount,align:i="start",...l}=t,u=Rc(Va,t.__scopeMenu),f=vf(Va,t.__scopeMenu),h=WC(vZ,t.__scopeMenu),p=s.useRef(null),g=un(n,p);return o.jsx(V0.Provider,{scope:t.__scopeMenu,children:o.jsx(cs,{present:a||u.open,children:o.jsx(V0.Slot,{scope:t.__scopeMenu,children:o.jsx(cv,{id:h.contentId,"aria-labelledby":h.triggerId,...l,ref:g,align:i,side:f.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{var w;f.isUsingKeyboardRef.current&&((w=p.current)==null||w.focus()),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:At(t.onFocusOutside,v=>{v.target!==h.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:At(t.onEscapeKeyDown,v=>{f.onClose(),v.preventDefault()}),onKeyDown:At(t.onKeyDown,v=>{var y;const w=v.currentTarget.contains(v.target),b=UV[f.dir].includes(v.key);w&&b&&(u.onOpenChange(!1),(y=h.trigger)==null||y.focus(),v.preventDefault())})})})})})},"MenuSubContent"));function dv(e){return e?"open":"closed"}Rn(dv,"getOpenState");function Z0(e){return e==="indeterminate"}Rn(Z0,"isIndeterminate");function em(e){return Z0(e)?"indeterminate":e?"checked":"unchecked"}Rn(em,"getCheckedState");function KC(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}Rn(KC,"focusFirst");function GC(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Rn(GC,"wrapArray");function YC(e,t,n){const a=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=GC(e,Math.max(i,0));a.length===1&&(l=l.filter(h=>h!==n));const f=l.find(h=>h.toLowerCase().startsWith(a.toLowerCase()));return f!==n?f:void 0}Rn(YC,"getNextMatch");function qC(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const u=t[i],f=t[l],h=u.x,p=u.y,g=f.x,v=f.y;p>r!=v>r&&n<(g-h)*(r-p)/(v-p)+h&&(a=!a)}return a}Rn(qC,"isPointInPolygon");function XC(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return qC(n,t)}Rn(XC,"isPointerInGraceArea");function Yu(e){return t=>t.pointerType==="mouse"?e(t):void 0}Rn(Yu,"whenMouse");var QC=qV,JC=FC,ej=QV,tj=eZ,nj=ZC,rj=sZ,sj=uv,aj=aZ,oj=cZ,ij=dZ,lj=hZ,cj=pZ,uj=gZ,dj=wZ,yZ=Object.defineProperty,Yr=(e,t)=>yZ(e,"name",{value:t,configurable:!0}),fv="ContextMenu",[bZ,Kce]=Hs(fv,[Jp]),Os=Jp(),[xZ,fj]=bZ(fv),kZ=Yr(e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:a,dir:i,modal:l=!0}=e,u=s.useRef(!1),[f,h]=si({prop:a,defaultProp:!1,onChange:r,caller:fv}),p=Os(t);return o.jsx(xZ,{scope:t,open:f,onOpenChange:h,modal:l,hasInteractedRef:u,children:o.jsx(QC,{...p,dir:i,open:f,onOpenChange:h,modal:l,children:n})})},"ContextMenu"),SZ="ContextMenuTrigger",EZ=s.forwardRef(Yr(function(t,n){const{__scopeContextMenu:r,disabled:a=!1,...i}=t,l=fj(SZ,r),u=Os(r),[f,h]=s.useState({x:0,y:0}),p=s.useMemo(()=>({current:{getBoundingClientRect:Yr(()=>DOMRect.fromRect({width:0,height:0,...f}),"getBoundingClientRect")}}),[f]),g=s.useRef(0),v=s.useCallback(()=>window.clearTimeout(g.current),[]),w=Yr(b=>{l.hasInteractedRef.current=!0,h({x:b.clientX,y:b.clientY}),l.onOpenChange(!0)},"handleOpen");return s.useEffect(()=>v,[v]),s.useEffect(()=>void(a&&v()),[a,v]),o.jsxs(o.Fragment,{children:[o.jsx(JC,{...u,virtualRef:p}),o.jsx(pn.span,{"data-state":l.open?"open":"closed","data-disabled":a?"":void 0,...i,ref:n,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:a?t.onContextMenu:At(t.onContextMenu,b=>{v(),w(b),b.preventDefault()}),onPointerDown:a?t.onPointerDown:At(t.onPointerDown,m0(b=>{v(),l.open&&l.onOpenChange(!1),g.current=window.setTimeout(()=>w(b),700)})),onPointerMove:a?t.onPointerMove:At(t.onPointerMove,m0(v)),onPointerCancel:a?t.onPointerCancel:At(t.onPointerCancel,m0(v)),onPointerUp:a?t.onPointerUp:At(t.onPointerUp,m0(v))})]})},"ContextMenuTrigger")),CZ=Yr(e=>{const{__scopeContextMenu:t,...n}=e,r=Os(t);return o.jsx(ej,{...r,...n})},"ContextMenuPortal"),jZ="ContextMenuContent",AZ=s.forwardRef(Yr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=fj(jZ,r),l=Os(r),u=s.useRef(!1);return o.jsx(tj,{...l,...a,ref:n,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:f=>{var h;(h=t.onCloseAutoFocus)==null||h.call(t,f),!f.defaultPrevented&&u.current&&f.preventDefault(),u.current=!1},onInteractOutside:f=>{var h;(h=t.onInteractOutside)==null||h.call(t,f),!f.defaultPrevented&&!i.modal&&(u.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuContent")),NZ=s.forwardRef(Yr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Os(r);return o.jsx(nj,{...i,...a,ref:n})},"ContextMenuGroup")),MZ=s.forwardRef(Yr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Os(r);return o.jsx(rj,{...i,...a,ref:n})},"ContextMenuLabel")),RZ=s.forwardRef(Yr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Os(r);return o.jsx(sj,{...i,...a,ref:n})},"ContextMenuItem")),PZ=s.forwardRef(Yr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Os(r);return o.jsx(aj,{...i,...a,ref:n})},"ContextMenuCheckboxItem")),LZ=s.forwardRef(Yr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Os(r);return o.jsx(oj,{...i,...a,ref:n})},"ContextMenuRadioGroup")),$Z=s.forwardRef(Yr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Os(r);return o.jsx(ij,{...i,...a,ref:n})},"ContextMenuRadioItem")),TZ=s.forwardRef(Yr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Os(r);return o.jsx(lj,{...i,...a,ref:n})},"ContextMenuItemIndicator")),DZ=s.forwardRef(Yr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Os(r);return o.jsx(cj,{...i,...a,ref:n})},"ContextMenuSeparator")),HZ=s.forwardRef(Yr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Os(r);return o.jsx(uj,{...i,...a,ref:n})},"ContextMenuSubTrigger")),OZ=s.forwardRef(Yr(function(t,n){const{__scopeContextMenu:r,...a}=t,i=Os(r);return o.jsx(dj,{...i,...a,ref:n,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuSubContent"));function m0(e){return t=>t.pointerType!=="mouse"?e(t):void 0}Yr(m0,"whenTouchOrPen");var IZ=kZ,FZ=EZ,hj=CZ,_Z=AZ,VZ=NZ,ZZ=MZ,zZ=RZ,BZ=PZ,UZ=LZ,WZ=$Z,pj=TZ,KZ=DZ,GZ=HZ,YZ=OZ,qZ=Object.defineProperty,Is=(e,t)=>qZ(e,"name",{value:t,configurable:!0}),hv="DropdownMenu",[XZ,Gce]=Hs(hv,[Jp]),Fs=Jp(),[QZ,mj]=XZ(hv),JZ=Is(e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:l,modal:u=!0}=e,f=Fs(t),h=s.useRef(null),[p,g]=si({prop:a,defaultProp:i??!1,onChange:l,caller:hv});return o.jsx(QZ,{scope:t,triggerId:ya(),triggerRef:h,contentId:ya(),open:p,onOpenChange:g,onOpenToggle:s.useCallback(()=>g(v=>!v),[g]),modal:u,children:o.jsx(QC,{...f,open:p,onOpenChange:g,dir:r,modal:u,children:n})})},"DropdownMenu"),ez="DropdownMenuTrigger",tz=s.forwardRef(Is(function(t,n){const{__scopeDropdownMenu:r,disabled:a=!1,...i}=t,l=mj(ez,r),u=Fs(r),f=un(n,l.triggerRef);return o.jsx(JC,{asChild:!0,...u,children:o.jsx(pn.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...i,ref:f,onPointerDown:At(t.onPointerDown,h=>{!a&&h.button===0&&h.ctrlKey===!1&&(l.onOpenToggle(),l.open||h.preventDefault())}),onKeyDown:At(t.onKeyDown,h=>{a||(["Enter"," "].includes(h.key)&&l.onOpenToggle(),h.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(h.key)&&h.preventDefault())})})})},"DropdownMenuTrigger")),nz=Is(e=>{const{__scopeDropdownMenu:t,...n}=e,r=Fs(t);return o.jsx(ej,{...r,...n})},"DropdownMenuPortal"),rz="DropdownMenuContent",sz=s.forwardRef(Is(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=mj(rz,r),l=Fs(r),u=s.useRef(!1);return o.jsx(tj,{id:i.contentId,"aria-labelledby":i.triggerId,...l,...a,ref:n,onCloseAutoFocus:At(t.onCloseAutoFocus,f=>{var h;u.current||(h=i.triggerRef.current)==null||h.focus(),u.current=!1,f.preventDefault()}),onInteractOutside:At(t.onInteractOutside,f=>{const h=f.detail.originalEvent,p=h.button===0&&h.ctrlKey===!0,g=h.button===2||p;(!i.modal||g)&&(u.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),az=s.forwardRef(Is(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Fs(r);return o.jsx(nj,{...i,...a,ref:n})},"DropdownMenuGroup")),oz=s.forwardRef(Is(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Fs(r);return o.jsx(rj,{...i,...a,ref:n})},"DropdownMenuLabel")),iz=s.forwardRef(Is(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Fs(r);return o.jsx(sj,{...i,...a,ref:n})},"DropdownMenuItem")),lz=s.forwardRef(Is(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Fs(r);return o.jsx(aj,{...i,...a,ref:n})},"DropdownMenuCheckboxItem")),cz=s.forwardRef(Is(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Fs(r);return o.jsx(oj,{...i,...a,ref:n})},"DropdownMenuRadioGroup")),uz=s.forwardRef(Is(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Fs(r);return o.jsx(ij,{...i,...a,ref:n})},"DropdownMenuRadioItem")),dz=s.forwardRef(Is(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Fs(r);return o.jsx(lj,{...i,...a,ref:n})},"DropdownMenuItemIndicator")),fz=s.forwardRef(Is(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Fs(r);return o.jsx(cj,{...i,...a,ref:n})},"DropdownMenuSeparator")),hz=s.forwardRef(Is(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Fs(r);return o.jsx(uj,{...i,...a,ref:n})},"DropdownMenuSubTrigger")),pz=s.forwardRef(Is(function(t,n){const{__scopeDropdownMenu:r,...a}=t,i=Fs(r);return o.jsx(dj,{...i,...a,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),mz=JZ,gz=tz,gj=nz,vz=sz,wz=az,yz=oz,bz=iz,xz=lz,kz=cz,Sz=uz,vj=dz,Ez=fz,Cz=hz,jz=pz,Az=Object.defineProperty,Nz=(e,t)=>Az(e,"name",{value:t,configurable:!0});function wj(e){const t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Nz(wj,"usePrevious");var Mz=Object.defineProperty,Rz=(e,t)=>Mz(e,"name",{value:t,configurable:!0});function Bh(e,[t,n]){return Math.min(n,Math.max(t,e))}Rz(Bh,"clamp");var Pz=Object.defineProperty,No=(e,t)=>Pz(e,"name",{value:t,configurable:!0}),pv="Popover",[yj,Yce]=Hs(pv,[fl]),tm=fl(),[Lz,hl]=yj(pv),$z=No(e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!1}=e,u=tm(t),f=s.useRef(null),[h,p]=s.useState(!1),[g,v]=si({prop:r,defaultProp:a??!1,onChange:i,caller:pv});return o.jsx(Yp,{...u,children:o.jsx(Lz,{scope:t,contentId:ya(),triggerRef:f,open:g,onOpenChange:v,onOpenToggle:s.useCallback(()=>v(w=>!w),[v]),hasCustomAnchor:h,onCustomAnchorAdd:s.useCallback(()=>p(!0),[]),onCustomAnchorRemove:s.useCallback(()=>p(!1),[]),modal:l,children:n})})},"Popover"),Tz="PopoverAnchor",Dz=s.forwardRef(No(function(t,n){const{__scopePopover:r,...a}=t,i=hl(Tz,r),l=tm(r),{onCustomAnchorAdd:u,onCustomAnchorRemove:f}=i;return s.useEffect(()=>(u(),()=>f()),[u,f]),o.jsx(gf,{...l,...a,ref:n})},"PopoverAnchor")),Hz="PopoverTrigger",Oz=s.forwardRef(No(function(t,n){const{__scopePopover:r,...a}=t,i=hl(Hz,r),l=tm(r),u=un(n,i.triggerRef),f=o.jsx(pn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":mv(i.open),...a,ref:u,onClick:At(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?f:o.jsx(gf,{asChild:!0,...l,children:f})},"PopoverTrigger")),bj="PopoverPortal",[Iz,Fz]=yj(bj,{forceMount:void 0}),_z=No(e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=hl(bj,t);return o.jsx(Iz,{scope:t,forceMount:n,children:o.jsx(cs,{present:n||i.open,children:o.jsx(pf,{asChild:!0,container:a,children:r})})})},"PopoverPortal"),z0="PopoverContent",Vz=s.forwardRef(No(function(t,n){const r=Fz(z0,t.__scopePopover),{forceMount:a=r.forceMount,...i}=t,l=hl(z0,t.__scopePopover);return o.jsx(cs,{present:a||l.open,children:l.modal?o.jsx(zz,{...i,ref:n}):o.jsx(Bz,{...i,ref:n})})},"PopoverContent")),Zz=Wa("PopoverContent.RemoveScroll"),zz=s.forwardRef(No(function(t,n){const r=hl(z0,t.__scopePopover),a=s.useRef(null),i=un(n,a),l=s.useRef(!1);return s.useEffect(()=>{const u=a.current;if(u)return _p(u)},[]),o.jsx(mf,{as:Zz,allowPinchZoom:!0,children:o.jsx(xj,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:At(t.onCloseAutoFocus,u=>{var f;u.preventDefault(),l.current||(f=r.triggerRef.current)==null||f.focus()}),onPointerDownOutside:At(t.onPointerDownOutside,u=>{const f=u.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,p=f.button===2||h;l.current=p},{checkForDefaultPrevented:!1}),onFocusOutside:At(t.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),Bz=s.forwardRef(No(function(t,n){const r=hl(z0,t.__scopePopover),a=s.useRef(!1),i=s.useRef(!1);return o.jsx(xj,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var u,f;(u=t.onCloseAutoFocus)==null||u.call(t,l),l.defaultPrevented||(a.current||(f=r.triggerRef.current)==null||f.focus(),l.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:l=>{var h,p;(h=t.onInteractOutside)==null||h.call(t,l),l.defaultPrevented||(a.current=!0,l.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=l.target;((p=r.triggerRef.current)==null?void 0:p.contains(u))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&i.current&&l.preventDefault()}})},"PopoverContentNonModal")),xj=s.forwardRef(No(function(t,n){const{__scopePopover:r,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,...v}=t,w=hl(z0,r),b=tm(r);return ud(),o.jsx(cd,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:l,children:o.jsx(hf,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:g,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onDismiss:()=>w.onOpenChange(!1),deferPointerDownOutside:!0,children:o.jsx(qp,{"data-state":mv(w.open),role:"dialog",id:w.contentId,...b,...v,ref:n,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl")),Uz="PopoverClose",Wz=s.forwardRef(No(function(t,n){const{__scopePopover:r,...a}=t,i=hl(Uz,r);return o.jsx(pn.button,{type:"button",...a,ref:n,onClick:At(t.onClick,()=>i.onOpenChange(!1))})},"PopoverClose"));function mv(e){return e?"open":"closed"}No(mv,"getState");var Kz=$z,Gz=Dz,Yz=Oz,qz=_z,Xz=Vz,Qz=Wz,Jz=Object.defineProperty,En=(e,t)=>Jz(e,"name",{value:t,configurable:!0});function kj(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}En(kj,"useStateMachine");var Sj="ScrollArea",[Ej,qce]=Hs(Sj),[eB,Ea]=Ej(Sj),tB=s.forwardRef(En(function(t,n){const{__scopeScrollArea:r,type:a="hover",dir:i,scrollHideDelay:l=600,...u}=t,[f,h]=s.useState(null),[p,g]=s.useState(null),[v,w]=s.useState(null),[b,y]=s.useState(null),[k,S]=s.useState(null),[E,j]=s.useState(0),[N,A]=s.useState(0),[T,P]=s.useState(!1),[C,R]=s.useState(!1),$=un(n,h),H=ff(i);return o.jsx(eB,{scope:r,type:a,dir:H,scrollHideDelay:l,scrollArea:f,viewport:p,onViewportChange:g,content:v,onContentChange:w,scrollbarX:b,onScrollbarXChange:y,scrollbarXEnabled:T,onScrollbarXEnabledChange:P,scrollbarY:k,onScrollbarYChange:S,scrollbarYEnabled:C,onScrollbarYEnabledChange:R,onCornerWidthChange:j,onCornerHeightChange:A,children:o.jsx(pn.div,{dir:H,...u,ref:$,style:{position:"relative","--radix-scroll-area-corner-width":E+"px","--radix-scroll-area-corner-height":N+"px",...t.style}})})},"ScrollArea")),nB="ScrollAreaViewport",rB=s.forwardRef(En(function(t,n){const{__scopeScrollArea:r,children:a,nonce:i,...l}=t,u=Ea(nB,r),f=s.useRef(null),h=un(n,f,u.onViewportChange);return o.jsxs(o.Fragment,{children:[o.jsx(sB,{nonce:i}),o.jsx(pn.div,{"data-radix-scroll-area-viewport":"",...l,ref:h,style:{overflowX:u.scrollbarXEnabled?"scroll":"hidden",overflowY:u.scrollbarYEnabled?"scroll":"hidden",...t.style},children:o.jsx("div",{ref:u.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})},"ScrollAreaViewport")),sB=s.memo(En(function({nonce:t}){return o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t})},"ScrollAreaViewportStyle"),(e,t)=>e.nonce===t.nonce),mi="ScrollAreaScrollbar",aB=s.forwardRef(En(function(t,n){const{forceMount:r,...a}=t,i=Ea(mi,t.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:u}=i,f=t.orientation==="horizontal";return s.useEffect(()=>(f?l(!0):u(!0),()=>{f?l(!1):u(!1)}),[f,l,u]),i.type==="hover"?o.jsx(oB,{...a,ref:n,forceMount:r}):i.type==="scroll"?o.jsx(iB,{...a,ref:n,forceMount:r}):i.type==="auto"?o.jsx(Cj,{...a,ref:n,forceMount:r}):i.type==="always"?o.jsx(gv,{...a,ref:n,"data-state":"visible"}):null},"ScrollAreaScrollbar")),oB=s.forwardRef(En(function(t,n){const{forceMount:r,...a}=t,i=Ea(mi,t.__scopeScrollArea),[l,u]=s.useState(!1);return s.useEffect(()=>{const f=i.scrollArea;let h=0;if(f){const p=En(()=>{window.clearTimeout(h),u(!0)},"handlePointerEnter"),g=En(()=>{h=window.setTimeout(()=>u(!1),i.scrollHideDelay)},"handlePointerLeave");return f.addEventListener("pointerenter",p),f.addEventListener("pointerleave",g),()=>{window.clearTimeout(h),f.removeEventListener("pointerenter",p),f.removeEventListener("pointerleave",g)}}},[i.scrollArea,i.scrollHideDelay]),o.jsx(cs,{present:r||l,children:o.jsx(Cj,{"data-state":l?"visible":"hidden",...a,ref:n})})},"ScrollAreaScrollbarHover")),iB=s.forwardRef(En(function(t,n){const{forceMount:r,...a}=t,i=Ea(mi,t.__scopeScrollArea),l=t.orientation==="horizontal",u=yf(()=>h("SCROLL_END"),100),[f,h]=kj("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return s.useEffect(()=>{if(f==="idle"){const p=window.setTimeout(()=>h("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(p)}},[f,i.scrollHideDelay,h]),s.useEffect(()=>{const p=i.viewport,g=l?"scrollLeft":"scrollTop";if(p){let v=p[g];const w=En(()=>{const b=p[g];v!==b&&(h("SCROLL"),u()),v=b},"handleScroll");return p.addEventListener("scroll",w),()=>p.removeEventListener("scroll",w)}},[i.viewport,l,h,u]),o.jsx(cs,{present:r||f!=="hidden",children:o.jsx(gv,{"data-state":f==="hidden"?"hidden":"visible",...a,ref:n,onPointerEnter:At(t.onPointerEnter,()=>h("POINTER_ENTER")),onPointerLeave:At(t.onPointerLeave,()=>h("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),Cj=s.forwardRef(En(function(t,n){const r=Ea(mi,t.__scopeScrollArea),{forceMount:a,...i}=t,[l,u]=s.useState(!1),f=t.orientation==="horizontal",h=yf(()=>{if(r.viewport){const p=r.viewport.offsetWidth<r.viewport.scrollWidth,g=r.viewport.offsetHeight<r.viewport.scrollHeight;u(f?p:g)}},10);return lc(r.viewport,h),lc(r.content,h),o.jsx(cs,{present:a||l,children:o.jsx(gv,{"data-state":l?"visible":"hidden",...i,ref:n})})},"ScrollAreaScrollbarAuto")),gv=s.forwardRef(En(function(t,n){const{orientation:r="vertical",...a}=t,i=Ea(mi,t.__scopeScrollArea),l=s.useRef(null),u=s.useRef(0),[f,h]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=vv(f.viewport,f.content),g={...a,sizes:f,onSizesChange:h,hasThumb:p>0&&p<1,onThumbChange:En(w=>l.current=w,"onThumbChange"),onThumbPointerUp:En(()=>u.current=0,"onThumbPointerUp"),onThumbPointerDown:En(w=>u.current=w,"onThumbPointerDown")};function v(w,b){return Mj(w,u.current,f,b)}return En(v,"getScrollPosition"),r==="horizontal"?o.jsx(lB,{...g,ref:n,onThumbPositionChange:()=>{if(i.viewport&&l.current){const w=i.viewport.scrollLeft,b=m6(w,f,i.dir);l.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:w=>{i.viewport&&(i.viewport.scrollLeft=w)},onDragScroll:w=>{i.viewport&&(i.viewport.scrollLeft=v(w,i.dir))}}):r==="vertical"?o.jsx(cB,{...g,ref:n,onThumbPositionChange:()=>{if(i.viewport&&l.current){const w=i.viewport.scrollTop,b=m6(w,f);l.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:w=>{i.viewport&&(i.viewport.scrollTop=w)},onDragScroll:w=>{i.viewport&&(i.viewport.scrollTop=v(w))}}):null},"ScrollAreaScrollbarVisible")),lB=s.forwardRef(En(function(t,n){const{sizes:r,onSizesChange:a,...i}=t,l=Ea(mi,t.__scopeScrollArea),[u,f]=s.useState(),h=s.useRef(null),p=un(n,h,l.onScrollbarXChange);return s.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),o.jsx(Aj,{"data-orientation":"horizontal",...i,ref:p,sizes:r,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":wf(r)+"px",...t.style},onThumbPointerDown:g=>t.onThumbPointerDown(g.x),onDragScroll:g=>t.onDragScroll(g.x),onWheelScroll:(g,v)=>{if(l.viewport){const w=l.viewport.scrollLeft+g.deltaX;t.onWheelScroll(w),yv(w,v)&&g.preventDefault()}},onResize:()=>{h.current&&l.viewport&&u&&a({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:B0(u.paddingLeft),paddingEnd:B0(u.paddingRight)}})}})},"ScrollAreaScrollbarX")),cB=s.forwardRef(En(function(t,n){const{sizes:r,onSizesChange:a,...i}=t,l=Ea(mi,t.__scopeScrollArea),[u,f]=s.useState(),h=s.useRef(null),p=un(n,h,l.onScrollbarYChange);return s.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),o.jsx(Aj,{"data-orientation":"vertical",...i,ref:p,sizes:r,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":wf(r)+"px",...t.style},onThumbPointerDown:g=>t.onThumbPointerDown(g.y),onDragScroll:g=>t.onDragScroll(g.y),onWheelScroll:(g,v)=>{if(l.viewport){const w=l.viewport.scrollTop+g.deltaY;t.onWheelScroll(w),yv(w,v)&&g.preventDefault()}},onResize:()=>{h.current&&l.viewport&&u&&a({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:B0(u.paddingTop),paddingEnd:B0(u.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[uB,jj]=Ej(mi),Aj=s.forwardRef(En(function(t,n){const{__scopeScrollArea:r,sizes:a,hasThumb:i,onThumbChange:l,onThumbPointerUp:u,onThumbPointerDown:f,onThumbPositionChange:h,onDragScroll:p,onWheelScroll:g,onResize:v,...w}=t,b=Ea(mi,r),[y,k]=s.useState(null),S=un(n,k),E=s.useRef(null),j=s.useRef(""),N=b.viewport,A=a.content-a.viewport,T=wr(g),P=wr(h),C=yf(v,10);function R($){if(E.current){const H=$.clientX-E.current.left,D=$.clientY-E.current.top;p({x:H,y:D})}}return En(R,"handleDragScroll"),s.useEffect(()=>{const $=En(H=>{const D=H.target;(y==null?void 0:y.contains(D))&&T(H,A)},"handleWheel");return document.addEventListener("wheel",$,{passive:!1}),()=>document.removeEventListener("wheel",$,{passive:!1})},[N,y,A,T]),s.useEffect(P,[a,P]),lc(y,C),lc(b.content,C),o.jsx(uB,{scope:r,scrollbar:y,hasThumb:i,onThumbChange:wr(l),onThumbPointerUp:wr(u),onThumbPositionChange:P,onThumbPointerDown:wr(f),children:o.jsx(pn.div,{...w,ref:S,style:{position:"absolute",...w.style},onPointerDown:At(t.onPointerDown,$=>{$.button===0&&($.target.setPointerCapture($.pointerId),E.current=y.getBoundingClientRect(),j.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),R($))}),onPointerMove:At(t.onPointerMove,R),onPointerUp:At(t.onPointerUp,$=>{const H=$.target;H.hasPointerCapture($.pointerId)&&H.releasePointerCapture($.pointerId),document.body.style.webkitUserSelect=j.current,b.viewport&&(b.viewport.style.scrollBehavior=""),E.current=null})})})},"ScrollAreaScrollbarImpl")),p6="ScrollAreaThumb",dB=s.forwardRef(En(function(t,n){const{forceMount:r,...a}=t,i=jj(p6,t.__scopeScrollArea);return o.jsx(cs,{present:r||i.hasThumb,children:o.jsx(fB,{ref:n,...a})})},"ScrollAreaThumb")),fB=s.forwardRef(En(function(t,n){const{__scopeScrollArea:r,style:a,...i}=t,l=Ea(p6,r),u=jj(p6,r),{onThumbPositionChange:f}=u,h=un(n,u.onThumbChange),p=s.useRef(void 0),g=yf(()=>{p.current&&(p.current(),p.current=void 0)},100);return s.useEffect(()=>{const v=l.viewport;if(v){const w=En(()=>{if(g(),!p.current){const b=mB(v,f);p.current=b,f()}},"handleScroll");return f(),v.addEventListener("scroll",w),()=>v.removeEventListener("scroll",w)}},[l.viewport,g,f]),o.jsx(pn.div,{"data-state":u.hasThumb?"visible":"hidden",...i,ref:h,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:At(t.onPointerDownCapture,v=>{const b=v.target.getBoundingClientRect(),y=v.clientX-b.left,k=v.clientY-b.top;u.onThumbPointerDown({x:y,y:k})}),onPointerUp:At(t.onPointerUp,u.onThumbPointerUp)})},"ScrollAreaThumbImpl")),Nj="ScrollAreaCorner",hB=s.forwardRef(En(function(t,n){const r=Ea(Nj,t.__scopeScrollArea),a=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&a?o.jsx(pB,{...t,ref:n}):null},"ScrollAreaCorner")),pB=s.forwardRef(En(function(t,n){const{__scopeScrollArea:r,...a}=t,i=Ea(Nj,r),[l,u]=s.useState(0),[f,h]=s.useState(0),p=!!(l&&f),{onCornerWidthChange:g,onCornerHeightChange:v}=i;return lc(i.scrollbarX,()=>{var b;const w=((b=i.scrollbarX)==null?void 0:b.offsetHeight)||0;i.onCornerHeightChange(w),h(w)}),lc(i.scrollbarY,()=>{var b;const w=((b=i.scrollbarY)==null?void 0:b.offsetWidth)||0;i.onCornerWidthChange(w),u(w)}),s.useEffect(()=>()=>{g(0),v(0)},[g,v]),p?o.jsx(pn.div,{...a,ref:n,style:{width:l,height:f,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null},"ScrollAreaCornerImpl"));function B0(e){return e?parseInt(e,10):0}En(B0,"toInt");function vv(e,t){const n=e/t;return isNaN(n)?0:n}En(vv,"getThumbRatio");function wf(e){const t=vv(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}En(wf,"getThumbSize");function Mj(e,t,n,r="ltr"){const a=wf(n),i=a/2,l=t||i,u=a-l,f=n.scrollbar.paddingStart+l,h=n.scrollbar.size-n.scrollbar.paddingEnd-u,p=n.content-n.viewport,g=r==="ltr"?[0,p]:[p*-1,0];return wv([f,h],g)(e)}En(Mj,"getScrollPositionFromPointer");function m6(e,t,n="ltr"){const r=wf(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,l=t.content-t.viewport,u=i-r,f=n==="ltr"?[0,l]:[l*-1,0],h=Bh(e,f);return wv([0,l],[0,u])(h)}En(m6,"getThumbOffsetFromScroll");function wv(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}En(wv,"linearScale");function yv(e,t){return e>0&&e<t}En(yv,"isScrollingWithinScrollbarBounds");var mB=En((e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return En((function a(){const i={left:e.scrollLeft,top:e.scrollTop},l=n.left!==i.left,u=n.top!==i.top;(l||u)&&t(),n=i,r=window.requestAnimationFrame(a)}),"loop")(),()=>window.cancelAnimationFrame(r)},"addUnlinkedScrollListener");function yf(e,t){const n=wr(e),r=s.useRef(0);return s.useEffect(()=>()=>window.clearTimeout(r.current),[]),s.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}En(yf,"useDebounceCallback");function lc(e,t){const n=wr(t);br(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}En(lc,"useResizeObserver");var Rj=tB,Pj=rB,g6=aB,v6=dB,gB=hB,vB=Object.defineProperty,On=(e,t)=>vB(e,"name",{value:t,configurable:!0}),wB=[" ","Enter","ArrowUp","ArrowDown"],yB=[" ","Enter"],qu="Select",[nm,bv,bB]=Ip(qu),[Pc,Xce]=Hs(qu,[bB,fl]),xv=fl(),[xB,pl]=Pc(qu),[kB,SB]=Pc(qu);function Lj(e){const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:l,defaultValue:u,onValueChange:f,dir:h,name:p,autoComplete:g,disabled:v,required:w,form:b,internal_do_not_use_render:y}=e,k=xv(t),[S,E]=s.useState(null),[j,N]=s.useState(null),[A,T]=s.useState(!1),P=ff(h),[C,R]=si({prop:r,defaultProp:a??!1,onChange:i,caller:qu}),[$,H]=si({prop:l,defaultProp:u,onChange:f,caller:qu}),D=s.useRef(null),q=s.useRef($);s.useEffect(()=>{const B=b?S==null?void 0:S.ownerDocument.getElementById(b):S==null?void 0:S.form;if(B instanceof HTMLFormElement){const K=On(()=>H(q.current),"reset");return B.addEventListener("reset",K),()=>B.removeEventListener("reset",K)}},[b,S,H]);const _=S?!!b||!!S.closest("form"):!0,[U,Y]=s.useState(new Set),I=ya(),F=Array.from(U).map(B=>B.props.value).join(";"),O=s.useCallback(B=>{Y(K=>new Set(K).add(B))},[]),Z=s.useCallback(B=>{Y(K=>{const ee=new Set(K);return ee.delete(B),ee})},[]),V={required:w,trigger:S,onTriggerChange:E,valueNode:j,onValueNodeChange:N,valueNodeHasChildren:A,onValueNodeHasChildrenChange:T,contentId:I,value:$,onValueChange:H,open:C,onOpenChange:R,dir:P,triggerPointerDownPosRef:D,disabled:v,name:p,autoComplete:g,form:b,nativeOptions:U,nativeSelectKey:F,isFormControl:_};return o.jsx(Yp,{...k,children:o.jsx(xB,{scope:t,...V,children:o.jsx(nm.Provider,{scope:t,children:o.jsx(kB,{scope:t,onNativeOptionAdd:O,onNativeOptionRemove:Z,children:Dj(y)?y(V):n})})})})}On(Lj,"SelectProvider");var EB=On(e=>{const{__scopeSelect:t,children:n,...r}=e;return o.jsx(Lj,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:a})=>o.jsxs(o.Fragment,{children:[n,a?o.jsx(tU,{__scopeSelect:t}):null]})})},"Select"),CB="SelectTrigger",jB=s.forwardRef(On(function(t,n){const{__scopeSelect:r,disabled:a=!1,...i}=t,l=xv(r),u=pl(CB,r),f=u.disabled||a,h=un(n,u.onTriggerChange),p=bv(r),g=s.useRef("touch"),[v,w,b]=kv(k=>{const S=p().filter(N=>!N.disabled),E=S.find(N=>N.value===u.value),j=Sv(S,k,E);j!==void 0&&u.onValueChange(j.value)}),y=On(k=>{f||(u.onOpenChange(!0),b()),k&&(u.triggerPointerDownPosRef.current={x:Math.round(k.pageX),y:Math.round(k.pageY)})},"handleOpen");return o.jsx(gf,{asChild:!0,...l,children:o.jsx(pn.button,{type:"button",role:"combobox","aria-controls":u.open?u.contentId:void 0,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":bf(u.value)?"":void 0,...i,ref:h,onClick:At(i.onClick,k=>{k.currentTarget.focus(),g.current!=="mouse"&&y(k)}),onPointerDown:At(i.onPointerDown,k=>{g.current=k.pointerType;const S=k.target;S.hasPointerCapture(k.pointerId)&&S.releasePointerCapture(k.pointerId),k.button===0&&k.ctrlKey===!1&&k.pointerType==="mouse"&&(y(k),k.preventDefault())}),onKeyDown:At(i.onKeyDown,k=>{const S=v.current!=="";!(k.ctrlKey||k.altKey||k.metaKey)&&k.key.length===1&&w(k.key),!(S&&k.key===" ")&&wB.includes(k.key)&&(y(),k.preventDefault())})})})},"SelectTrigger")),AB="SelectValue",NB=s.forwardRef(On(function(t,n){const{__scopeSelect:r,className:a,style:i,children:l,placeholder:u="",...f}=t,h=pl(AB,r),{onValueNodeHasChildrenChange:p}=h,g=l!==void 0,v=un(n,h.onValueNodeChange);br(()=>{p(g)},[p,g]);const w=bf(h.value);return o.jsx(pn.span,{...f,asChild:w?!1:f.asChild,ref:v,style:{pointerEvents:"none"},children:o.jsx(s.Fragment,{children:w?u:l},w?"placeholder":"value")})},"SelectValue")),MB=s.forwardRef(On(function(t,n){const{__scopeSelect:r,children:a,...i}=t;return o.jsx(pn.span,{"aria-hidden":!0,...i,ref:n,children:a||"▼"})},"SelectIcon")),RB="SelectPortal",[PB,LB]=Pc(RB,{forceMount:void 0}),$B=On(e=>{const{__scopeSelect:t,forceMount:n,...r}=e;return o.jsx(PB,{scope:e.__scopeSelect,forceMount:n,children:o.jsx(pf,{asChild:!0,...r})})},"SelectPortal"),cc="SelectContent",TB=s.forwardRef(On(function(t,n){const r=LB(cc,t.__scopeSelect),{forceMount:a=r.forceMount,...i}=t,l=pl(cc,t.__scopeSelect),[u,f]=s.useState();return br(()=>{f(new DocumentFragment)},[]),o.jsx(cs,{present:a||l.open,children:({present:h})=>h?o.jsx(OB,{...i,ref:n}):o.jsx(DB,{...i,fragment:u})})},"SelectContent")),DB=s.forwardRef(On(function(t,n){const{__scopeSelect:r,children:a,fragment:i}=t;return i?_r.createPortal(o.jsx($j,{scope:r,children:o.jsx(nm.Slot,{scope:r,children:o.jsx("div",{ref:n,children:a})})}),i):null},"SelectContentFragment")),Ia=10,[$j,rm]=Pc(cc),HB=Wa("SelectContent.RemoveScroll"),OB=s.forwardRef(On(function(t,n){const{__scopeSelect:r}=t,{position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:l,onPointerDownOutside:u,side:f,sideOffset:h,align:p,alignOffset:g,arrowPadding:v,collisionBoundary:w,collisionPadding:b,sticky:y,hideWhenDetached:k,avoidCollisions:S,...E}=t,j=pl(cc,r),[N,A]=s.useState(null),[T,P]=s.useState(null),C=un(n,A),[R,$]=s.useState(null),[H,D]=s.useState(null),q=bv(r),[_,U]=s.useState(!1),Y=s.useRef(!1);s.useEffect(()=>{if(N)return _p(N)},[N]),ud();const I=s.useCallback(ce=>{const[we,...G]=q().map(ne=>ne.ref.current),[ue]=G.slice(-1),Ne=document.activeElement;for(const ne of ce)if(ne===Ne||(ne==null||ne.scrollIntoView({block:"nearest"}),ne===we&&T&&(T.scrollTop=0),ne===ue&&T&&(T.scrollTop=T.scrollHeight),ne==null||ne.focus(),document.activeElement!==Ne))return},[q,T]),F=s.useCallback(()=>I([R,N]),[I,R,N]);s.useEffect(()=>{_&&F()},[_,F]);const{onOpenChange:O,triggerPointerDownPosRef:Z}=j;s.useEffect(()=>{if(N){let ce={x:0,y:0};const we=On(ue=>{var Ne,ne;ce={x:Math.abs(Math.round(ue.pageX)-(((Ne=Z.current)==null?void 0:Ne.x)??0)),y:Math.abs(Math.round(ue.pageY)-(((ne=Z.current)==null?void 0:ne.y)??0))}},"handlePointerMove"),G=On(ue=>{ce.x<=10&&ce.y<=10?ue.preventDefault():ue.composedPath().includes(N)||O(!1),document.removeEventListener("pointermove",we),Z.current=null},"handlePointerUp");return Z.current!==null&&(document.addEventListener("pointermove",we),document.addEventListener("pointerup",G,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",we),document.removeEventListener("pointerup",G,{capture:!0})}}},[N,O,Z]),s.useEffect(()=>{const ce=On(()=>O(!1),"close");return window.addEventListener("blur",ce),window.addEventListener("resize",ce),()=>{window.removeEventListener("blur",ce),window.removeEventListener("resize",ce)}},[O]);const[V,B]=kv(ce=>{const we=q().filter(Ne=>!Ne.disabled),G=we.find(Ne=>Ne.ref.current===document.activeElement),ue=Sv(we,ce,G);ue&&setTimeout(()=>{var Ne;return(Ne=ue.ref.current)==null?void 0:Ne.focus()})}),K=s.useCallback((ce,we,G)=>{const ue=!Y.current&&!G;(j.value!==void 0&&j.value===we||ue)&&($(ce),ue&&(Y.current=!0))},[j.value]),ee=s.useCallback(()=>N==null?void 0:N.focus(),[N]),se=s.useCallback((ce,we,G)=>{const ue=!Y.current&&!G;(j.value!==void 0&&j.value===we||ue)&&D(ce)},[j.value]),oe=a==="popper"?S3:IB,me=oe===S3?{side:f,sideOffset:h,align:p,alignOffset:g,arrowPadding:v,collisionBoundary:w,collisionPadding:b,sticky:y,hideWhenDetached:k,avoidCollisions:S}:{};return o.jsx($j,{scope:r,content:N,viewport:T,onViewportChange:P,itemRefCallback:K,selectedItem:R,onItemLeave:ee,itemTextRefCallback:se,focusSelectedItem:F,selectedItemText:H,position:a,isPositioned:_,searchRef:V,children:o.jsx(mf,{as:HB,allowPinchZoom:!0,children:o.jsx(cd,{asChild:!0,trapped:j.open,onMountAutoFocus:ce=>{ce.preventDefault()},onUnmountAutoFocus:At(i,ce=>{var we;(we=j.trigger)==null||we.focus({preventScroll:!0}),ce.preventDefault()}),children:o.jsx(hf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:ce=>ce.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:o.jsx(oe,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:ce=>ce.preventDefault(),...E,...me,onPlaced:()=>U(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:At(E.onKeyDown,ce=>{const we=ce.ctrlKey||ce.altKey||ce.metaKey;if(ce.key==="Tab"&&ce.preventDefault(),!we&&ce.key.length===1&&B(ce.key),["ArrowUp","ArrowDown","Home","End"].includes(ce.key)){let ue=q().filter(Ne=>!Ne.disabled).map(Ne=>Ne.ref.current);if(["ArrowUp","End"].includes(ce.key)&&(ue=ue.slice().reverse()),["ArrowUp","ArrowDown"].includes(ce.key)){const Ne=ce.target,ne=ue.indexOf(Ne);ue=ue.slice(ne+1)}setTimeout(()=>I(ue)),ce.preventDefault()}})})})})})})},"SelectContentImpl")),IB=s.forwardRef(On(function(t,n){const{__scopeSelect:r,onPlaced:a,...i}=t,l=pl(cc,r),u=rm(cc,r),[f,h]=s.useState(null),[p,g]=s.useState(null),v=un(n,g),w=bv(r),b=s.useRef(!1),y=s.useRef(!0),{viewport:k,selectedItem:S,selectedItemText:E,focusSelectedItem:j}=u,N=s.useCallback(()=>{if(l.trigger&&l.valueNode&&f&&p&&k&&S&&E){const C=l.trigger.getBoundingClientRect(),R=p.getBoundingClientRect(),$=l.valueNode.getBoundingClientRect(),H=E.getBoundingClientRect();if(l.dir!=="rtl"){const Ne=H.left-R.left,ne=$.left-Ne,Fe=C.left-ne,Oe=C.width+Fe,ot=Math.max(Oe,R.width),Xe=window.innerWidth-Ia,X=Bh(ne,[Ia,Math.max(Ia,Xe-ot)]);f.style.minWidth=Oe+"px",f.style.left=X+"px"}else{const Ne=R.right-H.right,ne=window.innerWidth-$.right-Ne,Fe=window.innerWidth-C.right-ne,Oe=C.width+Fe,ot=Math.max(Oe,R.width),Xe=window.innerWidth-Ia,X=Bh(ne,[Ia,Math.max(Ia,Xe-ot)]);f.style.minWidth=Oe+"px",f.style.right=X+"px"}const D=w(),q=window.innerHeight-Ia*2,_=k.scrollHeight,U=window.getComputedStyle(p),Y=parseInt(U.borderTopWidth,10),I=parseInt(U.paddingTop,10),F=parseInt(U.borderBottomWidth,10),O=parseInt(U.paddingBottom,10),Z=Y+I+_+O+F,V=Math.min(S.offsetHeight*5,Z),B=window.getComputedStyle(k),K=parseInt(B.paddingTop,10),ee=parseInt(B.paddingBottom,10),se=C.top+C.height/2-Ia,oe=q-se,me=S.offsetHeight/2,ce=S.offsetTop+me,we=Y+I+ce,G=Z-we;if(we<=se){const Ne=D.length>0&&S===D[D.length-1].ref.current;f.style.bottom="0px";const ne=p.clientHeight-k.offsetTop-k.offsetHeight,Fe=Math.max(oe,me+(Ne?ee:0)+ne+F),Oe=we+Fe;f.style.height=Oe+"px"}else{const Ne=D.length>0&&S===D[0].ref.current;f.style.top="0px";const Fe=Math.max(se,Y+k.offsetTop+(Ne?K:0)+me)+G;f.style.height=Fe+"px",k.scrollTop=we-se+k.offsetTop}f.style.margin=`${Ia}px 0`,f.style.minHeight=V+"px",f.style.maxHeight=q+"px",a==null||a(),requestAnimationFrame(()=>b.current=!0)}},[w,l.trigger,l.valueNode,f,p,k,S,E,l.dir,a]);br(()=>N(),[N]);const[A,T]=s.useState();br(()=>{p&&T(window.getComputedStyle(p).zIndex)},[p]);const P=s.useCallback(C=>{C&&y.current===!0&&(N(),j==null||j(),y.current=!1)},[N,j]);return o.jsx(FB,{scope:r,contentWrapper:f,shouldExpandOnScrollRef:b,onScrollButtonChange:P,children:o.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:o.jsx(pn.div,{...i,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})},"SelectItemAlignedPosition")),S3=s.forwardRef(On(function(t,n){const{__scopeSelect:r,align:a="start",collisionPadding:i=Ia,...l}=t,u=xv(r);return o.jsx(qp,{...u,...l,ref:n,align:a,collisionPadding:i,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[FB,_B]=Pc(cc,{}),E3="SelectViewport",VB=s.forwardRef(On(function(t,n){const{__scopeSelect:r,nonce:a,...i}=t,l=rm(E3,r),u=_B(E3,r),f=un(n,l.onViewportChange),h=s.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),o.jsx(nm.Slot,{scope:r,children:o.jsx(pn.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:At(i.onScroll,p=>{const g=p.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:w}=u;if(w!=null&&w.current&&v){const b=Math.abs(h.current-g.scrollTop);if(b>0){const y=window.innerHeight-Ia*2,k=parseFloat(v.style.minHeight),S=parseFloat(v.style.height),E=Math.max(k,S);if(E<y){const j=E+b,N=Math.min(y,j),A=j-N;v.style.height=N+"px",v.style.bottom==="0px"&&(g.scrollTop=A>0?A:0,v.style.justifyContent="flex-end")}}}h.current=g.scrollTop})})})]})},"SelectViewport")),ZB="SelectGroup",[zB,BB]=Pc(ZB),UB=s.forwardRef(On(function(t,n){const{__scopeSelect:r,...a}=t,i=ya();return o.jsx(zB,{scope:r,id:i,children:o.jsx(pn.div,{role:"group","aria-labelledby":i,...a,ref:n})})},"SelectGroup")),WB="SelectLabel",KB=s.forwardRef(On(function(t,n){const{__scopeSelect:r,...a}=t,i=BB(WB,r);return o.jsx(pn.div,{id:i.id,...a,ref:n})},"SelectLabel")),w6="SelectItem",[GB,Tj]=Pc(w6),YB=s.forwardRef(On(function(t,n){const{__scopeSelect:r,value:a,disabled:i=!1,textValue:l,...u}=t,f=pl(w6,r),h=rm(w6,r),p=f.value===a,[g,v]=s.useState(l??""),[w,b]=s.useState(!1),y=wr(N=>{var A;return(A=h.itemRefCallback)==null?void 0:A.call(h,N,a,i)}),k=un(n,y),S=ya(),E=s.useRef("touch"),j=On(()=>{i||(f.onValueChange(a),f.onOpenChange(!1))},"handleSelect");return o.jsx(GB,{scope:r,value:a,disabled:i,textId:S,isSelected:p,onItemTextChange:s.useCallback(N=>{v(A=>A||((N==null?void 0:N.textContent)??"").trim())},[]),children:o.jsx(nm.ItemSlot,{scope:r,value:a,disabled:i,textValue:g,children:o.jsx(pn.div,{role:"option","aria-labelledby":S,"data-highlighted":w?"":void 0,"aria-selected":p&&w,"data-state":p?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...u,ref:k,onFocus:At(u.onFocus,()=>b(!0)),onBlur:At(u.onBlur,()=>b(!1)),onClick:At(u.onClick,()=>{E.current!=="mouse"&&j()}),onPointerUp:At(u.onPointerUp,()=>{E.current==="mouse"&&j()}),onPointerDown:At(u.onPointerDown,N=>{E.current=N.pointerType}),onPointerMove:At(u.onPointerMove,N=>{var A;E.current=N.pointerType,i?(A=h.onItemLeave)==null||A.call(h):E.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:At(u.onPointerLeave,N=>{var A;N.currentTarget===document.activeElement&&((A=h.onItemLeave)==null||A.call(h))}),onKeyDown:At(u.onKeyDown,N=>{var T;i||N.target!==N.currentTarget||((T=h.searchRef)==null?void 0:T.current)!==""&&N.key===" "||(yB.includes(N.key)&&j(),N.key===" "&&N.preventDefault())})})})})},"SelectItem")),th="SelectItemText",qB=s.forwardRef(On(function(t,n){const{__scopeSelect:r,className:a,style:i,...l}=t,u=pl(th,r),f=rm(th,r),h=Tj(th,r),p=SB(th,r),[g,v]=s.useState(null),w=wr(j=>{var N;return(N=f.itemTextRefCallback)==null?void 0:N.call(f,j,h.value,h.disabled)}),b=un(n,v,h.onItemTextChange,w),y=g==null?void 0:g.textContent,k=s.useMemo(()=>o.jsx("option",{value:h.value,disabled:h.disabled,children:y},h.value),[h.disabled,h.value,y]),{onNativeOptionAdd:S,onNativeOptionRemove:E}=p;return br(()=>(S(k),()=>E(k)),[S,E,k]),o.jsxs(o.Fragment,{children:[o.jsx(pn.span,{id:h.textId,...l,ref:b}),h.isSelected&&u.valueNode&&!u.valueNodeHasChildren&&!bf(u.value)?_r.createPortal(l.children,u.valueNode):null]})},"SelectItemText")),XB="SelectItemIndicator",QB=s.forwardRef(On(function(t,n){const{__scopeSelect:r,...a}=t;return Tj(XB,r).isSelected?o.jsx(pn.span,{"aria-hidden":!0,...a,ref:n}):null},"SelectItemIndicator")),JB=s.forwardRef(On(function(t,n){const{__scopeSelect:r,...a}=t;return o.jsx(pn.div,{"aria-hidden":!0,...a,ref:n})},"SelectSeparator")),eU="SelectBubbleInput",tU=s.forwardRef(On(function({__scopeSelect:t,...n},r){const a=pl(eU,t),{value:i,onValueChange:l,required:u,disabled:f,name:h,autoComplete:p,form:g}=a,{nativeOptions:v,nativeSelectKey:w}=a,b=s.useRef(null),y=un(r,b),k=i??"",S=wj(k),E=Array.from(v).some(j=>(j.props.value??"")==="");return s.useEffect(()=>{const j=b.current;if(!j)return;const N=window.HTMLSelectElement.prototype,T=Object.getOwnPropertyDescriptor(N,"value").set;if(S!==k&&T){const P=new Event("change",{bubbles:!0});T.call(j,k),j.dispatchEvent(P)}},[S,k]),o.jsxs(pn.select,{"aria-hidden":!0,required:u,tabIndex:-1,name:h,autoComplete:p,disabled:f,form:g,onChange:j=>l(j.target.value),...n,style:{...w7,...n.style},ref:y,defaultValue:k,children:[bf(i)&&!E?o.jsx("option",{value:""}):null,Array.from(v)]},w)},"SelectBubbleInput"));function Dj(e){return typeof e=="function"}On(Dj,"isFunction");function bf(e){return e===""||e===void 0}On(bf,"shouldShowPlaceholder");function kv(e){const t=wr(e),n=s.useRef(""),r=s.useRef(0),a=s.useCallback(l=>{const u=n.current+l;t(u),On((function f(h){n.current=h,window.clearTimeout(r.current),h!==""&&(r.current=window.setTimeout(()=>f(""),1e3))}),"updateSearch")(u)},[t]),i=s.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return s.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}On(kv,"useTypeaheadSearch");function Sv(e,t,n){const a=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=Hj(e,Math.max(i,0));a.length===1&&(l=l.filter(h=>h!==n));const f=l.find(h=>h.textValue.toLowerCase().startsWith(a.toLowerCase()));return f!==n?f:void 0}On(Sv,"findNextItem");function Hj(e,t){return e.map((n,r)=>e[(t+r)%e.length])}On(Hj,"wrapArray");var nU=Object.defineProperty,Nr=(e,t)=>nU(e,"name",{value:t,configurable:!0}),[Ev,Qce]=Hs("Tooltip",[fl]),sm=fl(),rU="TooltipProvider",sU=700,y6="tooltip.open",[aU,Cv]=Ev(rU),oU=Nr(e=>{const{__scopeTooltip:t,delayDuration:n=sU,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,l=s.useRef(!0),u=s.useRef(!1),f=s.useRef(0);return s.useEffect(()=>{const h=f.current;return()=>window.clearTimeout(h)},[]),o.jsx(aU,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:s.useCallback(()=>{r<=0||(window.clearTimeout(f.current),l.current=!1)},[r]),onClose:s.useCallback(()=>{r<=0||(window.clearTimeout(f.current),f.current=window.setTimeout(()=>l.current=!0,r))},[r]),isPointerInTransitRef:u,onPointerInTransitChange:s.useCallback(h=>{u.current=h},[]),disableHoverableContent:a,children:i})},"TooltipProvider"),b6="Tooltip",[iU,xf]=Ev(b6),lU=Nr(e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:l,delayDuration:u}=e,f=Cv(b6,e.__scopeTooltip),h=sm(t),[p,g]=s.useState(null),[v,w]=s.useState(void 0),b=ya(),y=s.useRef(0),k=l??f.disableHoverableContent,S=u??f.delayDuration,E=s.useRef(!1),[j,N]=si({prop:r,defaultProp:a??!1,onChange:Nr($=>{$?(f.onOpen(),document.dispatchEvent(new CustomEvent(y6))):f.onClose(),i==null||i($)},"onChange"),caller:b6}),A=s.useMemo(()=>j?E.current?"delayed-open":"instant-open":"closed",[j]),T=s.useCallback(()=>{window.clearTimeout(y.current),y.current=0,E.current=!1,N(!0)},[N]),P=s.useCallback(()=>{window.clearTimeout(y.current),y.current=0,N(!1)},[N]),C=s.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{E.current=!0,N(!0),y.current=0},S)},[S,N]);s.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]);const R=v??b;return o.jsx(Yp,{...h,children:o.jsx(iU,{scope:t,contentId:R,setContentId:w,open:j,stateAttribute:A,trigger:p,onTriggerChange:g,onTriggerEnter:s.useCallback(()=>{f.isOpenDelayedRef.current?C():T()},[f.isOpenDelayedRef,C,T]),onTriggerLeave:s.useCallback(()=>{k?P():(window.clearTimeout(y.current),y.current=0)},[P,k]),onOpen:T,onClose:P,disableHoverableContent:k,children:n})})},"Tooltip"),C3="TooltipTrigger",cU=s.forwardRef(Nr(function(t,n){const{__scopeTooltip:r,...a}=t,i=xf(C3,r),l=Cv(C3,r),u=sm(r),f=s.useRef(null),h=un(n,f,i.onTriggerChange),p=s.useRef(!1),g=s.useRef(!1),v=s.useCallback(()=>p.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),o.jsx(gf,{asChild:!0,...u,children:o.jsx(pn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...a,ref:h,onPointerMove:At(t.onPointerMove,w=>{w.pointerType!=="touch"&&!g.current&&!l.isPointerInTransitRef.current&&(i.onTriggerEnter(),g.current=!0)}),onPointerLeave:At(t.onPointerLeave,()=>{i.onTriggerLeave(),g.current=!1}),onPointerDown:At(t.onPointerDown,()=>{i.open&&i.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:At(t.onFocus,()=>{p.current||i.onOpen()}),onBlur:At(t.onBlur,i.onClose),onClick:At(t.onClick,i.onClose)})})},"TooltipTrigger")),Oj="TooltipPortal",[uU,dU]=Ev(Oj,{forceMount:void 0}),fU=Nr(e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,i=xf(Oj,t);return o.jsx(uU,{scope:t,forceMount:n,children:o.jsx(cs,{present:n||i.open,children:o.jsx(pf,{asChild:!0,container:a,children:r})})})},"TooltipPortal"),U0="TooltipContent",hU=s.forwardRef(Nr(function(t,n){const r=dU(U0,t.__scopeTooltip),{forceMount:a=r.forceMount,side:i="top",...l}=t,u=xf(U0,t.__scopeTooltip);return o.jsx(cs,{present:a||u.open,children:u.disableHoverableContent?o.jsx(Ij,{side:i,...l,ref:n}):o.jsx(pU,{side:i,...l,ref:n})})},"TooltipContent")),pU=s.forwardRef(Nr(function(t,n){const r=xf(U0,t.__scopeTooltip),a=Cv(U0,t.__scopeTooltip),i=s.useRef(null),l=un(n,i),[u,f]=s.useState(null),{trigger:h,onClose:p}=r,g=i.current,{onPointerInTransitChange:v}=a,w=s.useCallback(()=>{f(null),v(!1)},[v]),b=s.useCallback((y,k)=>{const S=y.currentTarget,E={x:y.clientX,y:y.clientY},j=Fj(E,S.getBoundingClientRect()),N=_j(E,j),A=Vj(k.getBoundingClientRect()),T=zj([...N,...A]);f(T),v(!0)},[v]);return s.useEffect(()=>()=>w(),[w]),s.useEffect(()=>{if(h&&g){const y=Nr(S=>b(S,g),"handleTriggerLeave"),k=Nr(S=>b(S,h),"handleContentLeave");return h.addEventListener("pointerleave",y),g.addEventListener("pointerleave",k),()=>{h.removeEventListener("pointerleave",y),g.removeEventListener("pointerleave",k)}}},[h,g,b,w]),s.useEffect(()=>{if(u){const y=Nr(k=>{const S=k.target,E={x:k.clientX,y:k.clientY},j=(h==null?void 0:h.contains(S))||(g==null?void 0:g.contains(S)),N=!Zj(E,u);j?w():N&&(w(),p())},"handleTrackPointerGrace");return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[h,g,u,p,w]),o.jsx(Ij,{...t,ref:l})},"TooltipContentHoverable")),mU=B4("TooltipContent"),Ij=s.forwardRef(Nr(function(t,n){const{__scopeTooltip:r,children:a,"aria-label":i,id:l,onEscapeKeyDown:u,onPointerDownOutside:f,...h}=t,p=xf(U0,r),g=sm(r),{onClose:v}=p;s.useEffect(()=>(document.addEventListener(y6,v),()=>document.removeEventListener(y6,v)),[v]),s.useEffect(()=>{if(p.trigger){const b=Nr(y=>{y.target instanceof Node&&y.target.contains(p.trigger)&&v()},"handleScroll");return window.addEventListener("scroll",b,{capture:!0}),()=>window.removeEventListener("scroll",b,{capture:!0})}},[p.trigger,v]);const{setContentId:w}=p;return br(()=>(w(l),()=>{w(void 0)}),[l,w]),o.jsx(hf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:b=>b.preventDefault(),onDismiss:v,children:o.jsxs(qp,{"data-state":p.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:p.contentId,...g,...h,ref:n,style:{...h.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(mU,{children:a}),i?o.jsx(y7,{id:p.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl")),gU=s.forwardRef(Nr(function(t,n){const{__scopeTooltip:r,...a}=t,i=sm(r);return o.jsx(CV,{...i,...a,ref:n})},"TooltipArrow"));function Fj(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}Nr(Fj,"getExitSideFromRect");function _j(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}Nr(_j,"getPaddedExitPoints");function Vj(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}Nr(Vj,"getPointsFromRect");function Zj(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const u=t[i],f=t[l],h=u.x,p=u.y,g=f.x,v=f.y;p>r!=v>r&&n<(g-h)*(r-p)/(v-p)+h&&(a=!a)}return a}Nr(Zj,"isPointInPolygon");function zj(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Bj(t)}Nr(zj,"getHull");function Bj(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Nr(Bj,"getHullPresorted");var vU=oU,wU=lU,yU=cU,bU=fU,xU=hU,kU=gU,Fg={exports:{}};/*!
93
+ Copyright (c) 2018 Jed Watson.
94
+ Licensed under the MIT License (MIT), see
95
+ http://jedwatson.github.io/classnames
96
+ */var j3;function SU(){return j3||(j3=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",l=0;l<arguments.length;l++){var u=arguments[l];u&&(i=a(i,r(u)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var l="";for(var u in i)t.call(i,u)&&i[u]&&(l=a(l,u));return l}function a(i,l){return l?i?i+" "+l:i+l:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Fg)),Fg.exports}var EU=SU();const Wt=BS(EU),Qa={asChild:{type:"boolean"}},yo={width:{type:"string",className:"rt-r-w",customProperties:["--width"],responsive:!0},minWidth:{type:"string",className:"rt-r-min-w",customProperties:["--min-width"],responsive:!0},maxWidth:{type:"string",className:"rt-r-max-w",customProperties:["--max-width"],responsive:!0}},jv={height:{type:"string",className:"rt-r-h",customProperties:["--height"],responsive:!0},minHeight:{type:"string",className:"rt-r-min-h",customProperties:["--min-height"],responsive:!0},maxHeight:{type:"string",className:"rt-r-max-h",customProperties:["--max-height"],responsive:!0}},CU=["1","2","3","4"],Uj={...Qa,align:{type:"enum",className:"rt-r-align",values:["start","center"],default:"center"},size:{type:"enum",className:"rt-r-size",values:CU,default:"3",responsive:!0},width:yo.width,minWidth:yo.minWidth,maxWidth:{...yo.maxWidth,default:"600px"},...jv},Wj=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"],ml={color:{type:"enum",values:Wj,default:void 0}},Av={color:{type:"enum",values:Wj,default:""}},Lc={highContrast:{type:"boolean",className:"rt-high-contrast",default:void 0}},jU=["normal","start","end","both"],Kj={trim:{type:"enum",className:"rt-r-lt",values:jU,responsive:!0}},AU=["left","center","right"],Gj={align:{type:"enum",className:"rt-r-ta",values:AU,responsive:!0}},NU=["wrap","nowrap","pretty","balance"],Yj={wrap:{type:"enum",className:"rt-r-tw",values:NU,responsive:!0}},qj={truncate:{type:"boolean",className:"rt-truncate"}},MU=["light","regular","medium","bold"],Xj={weight:{type:"enum",className:"rt-r-weight",values:MU,responsive:!0}},RU=["h1","h2","h3","h4","h5","h6"],PU=["1","2","3","4","5","6","7","8","9"],LU={as:{type:"enum",values:RU,default:"h1"},...Qa,size:{type:"enum",className:"rt-r-size",values:PU,default:"6",responsive:!0},...Xj,...Gj,...Kj,...qj,...Yj,...ml,...Lc},$U=["initial","xs","sm","md","lg","xl"],Nv=new Set($U);function Qj(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function C0(e){return typeof e=="object"&&e!==null&&Object.keys(e).some(t=>Nv.has(t))}function Hi({className:e,customProperties:t,...n}){const r=Uh({allowArbitraryValues:!0,className:e,...n}),a=TU({customProperties:t,...n});return[r,a]}function Uh({allowArbitraryValues:e,value:t,className:n,propValues:r,parseValue:a=i=>i}){const i=[];if(t){if(typeof t=="string"&&r.includes(t))return A3(n,t,a);if(C0(t)){const l=t;for(const u in l){if(!Qj(l,u)||!Nv.has(u))continue;const f=l[u];if(f!==void 0){if(r.includes(f)){const h=A3(n,f,a),p=u==="initial"?h:`${u}:${h}`;i.push(p)}else if(e){const h=u==="initial"?n:`${u}:${n}`;i.push(h)}}}return i.join(" ")}if(e)return n}}function A3(e,t,n){const r=e?"-":"",a=n(t),i=a==null?void 0:a.startsWith("-"),l=i?"-":"",u=i?a==null?void 0:a.substring(1):a;return`${l}${e}${r}${u}`}function TU({customProperties:e,value:t,propValues:n,parseValue:r=a=>a}){let a={};if(!(!t||typeof t=="string"&&n.includes(t))){if(typeof t=="string"&&(a=Object.fromEntries(e.map(i=>[i,t]))),C0(t)){const i=t;for(const l in i){if(!Qj(i,l)||!Nv.has(l))continue;const u=i[l];if(!n.includes(u))for(const f of e)a={[l==="initial"?f:`${f}-${l}`]:u,...a}}}for(const i in a){const l=a[i];l!==void 0&&(a[i]=r(l))}return a}}function Wh(...e){let t={};for(const n of e)n&&(t={...t,...n});return Object.keys(t).length?t:void 0}function DU(...e){return Object.assign({},...e)}function kr(e,...t){let n,r;const a={...e},i=DU(...t);for(const l in i){let u=a[l];const f=i[l];if(f.default!==void 0&&u===void 0&&(u=f.default),f.type==="enum"&&![f.default,...f.values].includes(u)&&!C0(u)&&(u=f.default),a[l]=u,"className"in f&&f.className){delete a[l];const h="responsive"in f;if(!u||C0(u)&&!h)continue;if(C0(u)&&(f.default!==void 0&&u.initial===void 0&&(u.initial=f.default),f.type==="enum"&&([f.default,...f.values].includes(u.initial)||(u.initial=f.default))),f.type==="enum"){const p=Uh({allowArbitraryValues:!1,value:u,className:f.className,propValues:f.values,parseValue:f.parseValue});n=Wt(n,p);continue}if(f.type==="string"||f.type==="enum | string"){const p=f.type==="string"?[]:f.values,[g,v]=Hi({className:f.className,customProperties:f.customProperties,propValues:p,parseValue:f.parseValue,value:u});r=Wh(r,v),n=Wt(n,g);continue}if(f.type==="boolean"&&u){n=Wt(n,f.className);continue}}}return a.className=Wt(n,e.className),a.style=Wh(r,e.style),a}const Il=["0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],Mo={m:{type:"enum | string",values:Il,responsive:!0,className:"rt-r-m",customProperties:["--m"]},mx:{type:"enum | string",values:Il,responsive:!0,className:"rt-r-mx",customProperties:["--ml","--mr"]},my:{type:"enum | string",values:Il,responsive:!0,className:"rt-r-my",customProperties:["--mt","--mb"]},mt:{type:"enum | string",values:Il,responsive:!0,className:"rt-r-mt",customProperties:["--mt"]},mr:{type:"enum | string",values:Il,responsive:!0,className:"rt-r-mr",customProperties:["--mr"]},mb:{type:"enum | string",values:Il,responsive:!0,className:"rt-r-mb",customProperties:["--mb"]},ml:{type:"enum | string",values:Il,responsive:!0,className:"rt-r-ml",customProperties:["--ml"]}},Mv=s.forwardRef((e,t)=>{const{children:n,className:r,asChild:a,as:i="h1",color:l,...u}=kr(e,LU,Mo);return s.createElement(kc,{"data-accent-color":l,...u,ref:t,className:Wt("rt-Heading",r)},a?n:s.createElement(i,null,n))});Mv.displayName="Heading";const HU=["span","div","label","p"],OU=["1","2","3","4","5","6","7","8","9"],IU={as:{type:"enum",values:HU,default:"span"},...Qa,size:{type:"enum",className:"rt-r-size",values:OU,responsive:!0},...Xj,...Gj,...Kj,...qj,...Yj,...ml,...Lc},uc=s.forwardRef((e,t)=>{const{children:n,className:r,asChild:a,as:i="span",color:l,...u}=kr(e,IU,Mo);return s.createElement(kc,{"data-accent-color":l,...u,ref:t,className:Wt("rt-Text",r)},a?n:s.createElement(i,null,n))});uc.displayName="Text";function FU(e){switch(e){case"tomato":case"red":case"ruby":case"crimson":case"pink":case"plum":case"purple":case"violet":return"mauve";case"iris":case"indigo":case"blue":case"sky":case"cyan":return"slate";case"teal":case"jade":case"mint":case"green":return"sage";case"grass":case"lime":return"olive";case"yellow":case"amber":case"orange":case"brown":case"gold":case"bronze":return"sand";case"gray":return"gray"}}const _U=["none","small","medium","large","full"],am={radius:{type:"enum",values:_U,default:void 0}},Gs={hasBackground:{default:!0},appearance:{default:"inherit"},accentColor:{default:"indigo"},grayColor:{default:"auto"},panelBackground:{default:"translucent"},radius:{default:"medium"},scaling:{default:"100%"}},uu=()=>{},Kh=s.createContext(void 0);function Rv(){const e=s.useContext(Kh);if(e===void 0)throw new Error("`useThemeContext` must be used within a `Theme`");return e}const Ja=s.forwardRef((e,t)=>s.useContext(Kh)===void 0?s.createElement(vU,{delayDuration:200},s.createElement(NI,{dir:"ltr"},s.createElement(Jj,{...e,ref:t}))):s.createElement(Pv,{...e,ref:t}));Ja.displayName="Theme";const Jj=s.forwardRef((e,t)=>{const{appearance:n=Gs.appearance.default,accentColor:r=Gs.accentColor.default,grayColor:a=Gs.grayColor.default,panelBackground:i=Gs.panelBackground.default,radius:l=Gs.radius.default,scaling:u=Gs.scaling.default,hasBackground:f=Gs.hasBackground.default,...h}=e,[p,g]=s.useState(n);s.useEffect(()=>g(n),[n]);const[v,w]=s.useState(r);s.useEffect(()=>w(r),[r]);const[b,y]=s.useState(a);s.useEffect(()=>y(a),[a]);const[k,S]=s.useState(i);s.useEffect(()=>S(i),[i]);const[E,j]=s.useState(l);s.useEffect(()=>j(l),[l]);const[N,A]=s.useState(u);return s.useEffect(()=>A(u),[u]),s.createElement(Pv,{...h,ref:t,isRoot:!0,hasBackground:f,appearance:p,accentColor:v,grayColor:b,panelBackground:k,radius:E,scaling:N,onAppearanceChange:g,onAccentColorChange:w,onGrayColorChange:y,onPanelBackgroundChange:S,onRadiusChange:j,onScalingChange:A})});Jj.displayName="ThemeRoot";const Pv=s.forwardRef((e,t)=>{const n=s.useContext(Kh),{asChild:r,isRoot:a,hasBackground:i,appearance:l=(n==null?void 0:n.appearance)??Gs.appearance.default,accentColor:u=(n==null?void 0:n.accentColor)??Gs.accentColor.default,grayColor:f=(n==null?void 0:n.resolvedGrayColor)??Gs.grayColor.default,panelBackground:h=(n==null?void 0:n.panelBackground)??Gs.panelBackground.default,radius:p=(n==null?void 0:n.radius)??Gs.radius.default,scaling:g=(n==null?void 0:n.scaling)??Gs.scaling.default,onAppearanceChange:v=uu,onAccentColorChange:w=uu,onGrayColorChange:b=uu,onPanelBackgroundChange:y=uu,onRadiusChange:k=uu,onScalingChange:S=uu,...E}=e,j=r?kc:"div",N=f==="auto"?FU(u):f,A=e.appearance==="light"||e.appearance==="dark",T=i===void 0?a||A:i;return s.createElement(Kh.Provider,{value:s.useMemo(()=>({appearance:l,accentColor:u,grayColor:f,resolvedGrayColor:N,panelBackground:h,radius:p,scaling:g,onAppearanceChange:v,onAccentColorChange:w,onGrayColorChange:b,onPanelBackgroundChange:y,onRadiusChange:k,onScalingChange:S}),[l,u,f,N,h,p,g,v,w,b,y,k,S])},s.createElement(j,{"data-is-root-theme":a?"true":"false","data-accent-color":u,"data-gray-color":N,"data-has-background":T?"true":"false","data-panel-background":h,"data-radius":p,"data-scaling":g,ref:t,...E,className:Wt("radix-themes",{light:l==="light",dark:l==="dark"},E.className)}))});Pv.displayName="ThemeImpl";const gi=e=>{if(!s.isValidElement(e))throw Error(`Expected a single React Element child, but got: ${s.Children.toArray(e).map(t=>typeof t=="object"&&"type"in t&&typeof t.type=="string"?t.type:typeof t).join(", ")}`);return e},kf=e=>s.createElement(QF,{...e});kf.displayName="AlertDialog.Root";const eA=s.forwardRef(({children:e,...t},n)=>s.createElement(JF,{...t,ref:n,asChild:!0},gi(e)));eA.displayName="AlertDialog.Trigger";const Sf=s.forwardRef(({align:e,...t},n)=>{const{align:r,...a}=Uj,{className:i}=kr({align:e},{align:r}),{className:l,forceMount:u,container:f,...h}=kr(t,a);return s.createElement(e_,{container:f,forceMount:u},s.createElement(Ja,{asChild:!0},s.createElement(t_,{className:"rt-BaseDialogOverlay rt-AlertDialogOverlay"},s.createElement("div",{className:"rt-BaseDialogScroll rt-AlertDialogScroll"},s.createElement("div",{className:`rt-BaseDialogScrollPadding rt-AlertDialogScrollPadding ${i}`},s.createElement(n_,{...h,ref:n,className:Wt("rt-BaseDialogContent","rt-AlertDialogContent",l)}))))))});Sf.displayName="AlertDialog.Content";const Ef=s.forwardRef((e,t)=>s.createElement(a_,{asChild:!0},s.createElement(Mv,{size:"5",mb:"3",trim:"start",...e,asChild:!1,ref:t})));Ef.displayName="AlertDialog.Title";const Cf=s.forwardRef((e,t)=>s.createElement(o_,{asChild:!0},s.createElement(uc,{as:"p",size:"3",...e,asChild:!1,ref:t})));Cf.displayName="AlertDialog.Description";const jf=s.forwardRef(({children:e,...t},n)=>s.createElement(r_,{...t,ref:n,asChild:!0},gi(e)));jf.displayName="AlertDialog.Action";const Af=s.forwardRef(({children:e,...t},n)=>s.createElement(s_,{...t,ref:n,asChild:!0},gi(e)));Af.displayName="AlertDialog.Cancel";function VU(e,t){const{asChild:n,children:r}=e;if(!n)return typeof t=="function"?t(r):t;const a=s.Children.only(r);return s.cloneElement(a,{children:typeof t=="function"?t(a.props.children):t})}const ZU=["1","2","3"],zU=["solid","soft","surface","outline"],BU={...Qa,size:{type:"enum",className:"rt-r-size",values:ZU,default:"1",responsive:!0},variant:{type:"enum",className:"rt-variant",values:zU,default:"soft"},...Av,...Lc,...am},tA=s.forwardRef((e,t)=>{const{asChild:n,className:r,color:a,radius:i,...l}=kr(e,BU,Mo),u=n?kc:"span";return s.createElement(u,{"data-accent-color":a,"data-radius":i,...l,ref:t,className:Wt("rt-reset","rt-Badge",r)})});tA.displayName="Badge";const nA=kc,UU=["div","span"],WU=["none","inline","inline-block","block","contents"],KU={as:{type:"enum",values:UU,default:"div"},...Qa,display:{type:"enum",className:"rt-r-display",values:WU,responsive:!0}},Fl=["0","1","2","3","4","5","6","7","8","9"],GU={p:{type:"enum | string",className:"rt-r-p",customProperties:["--p"],values:Fl,responsive:!0},px:{type:"enum | string",className:"rt-r-px",customProperties:["--pl","--pr"],values:Fl,responsive:!0},py:{type:"enum | string",className:"rt-r-py",customProperties:["--pt","--pb"],values:Fl,responsive:!0},pt:{type:"enum | string",className:"rt-r-pt",customProperties:["--pt"],values:Fl,responsive:!0},pr:{type:"enum | string",className:"rt-r-pr",customProperties:["--pr"],values:Fl,responsive:!0},pb:{type:"enum | string",className:"rt-r-pb",customProperties:["--pb"],values:Fl,responsive:!0},pl:{type:"enum | string",className:"rt-r-pl",customProperties:["--pl"],values:Fl,responsive:!0}},_g=["visible","hidden","clip","scroll","auto"],YU=["static","relative","absolute","fixed","sticky"],t0=["0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],qU=["0","1"],XU=["0","1"],QU=["start","center","end","baseline","stretch"],JU=["start","center","end","baseline","stretch"],rA={...GU,...yo,...jv,position:{type:"enum",className:"rt-r-position",values:YU,responsive:!0},inset:{type:"enum | string",className:"rt-r-inset",customProperties:["--inset"],values:t0,responsive:!0},top:{type:"enum | string",className:"rt-r-top",customProperties:["--top"],values:t0,responsive:!0},right:{type:"enum | string",className:"rt-r-right",customProperties:["--right"],values:t0,responsive:!0},bottom:{type:"enum | string",className:"rt-r-bottom",customProperties:["--bottom"],values:t0,responsive:!0},left:{type:"enum | string",className:"rt-r-left",customProperties:["--left"],values:t0,responsive:!0},overflow:{type:"enum",className:"rt-r-overflow",values:_g,responsive:!0},overflowX:{type:"enum",className:"rt-r-ox",values:_g,responsive:!0},overflowY:{type:"enum",className:"rt-r-oy",values:_g,responsive:!0},flexBasis:{type:"string",className:"rt-r-fb",customProperties:["--flex-basis"],responsive:!0},flexShrink:{type:"enum | string",className:"rt-r-fs",customProperties:["--flex-shrink"],values:qU,responsive:!0},flexGrow:{type:"enum | string",className:"rt-r-fg",customProperties:["--flex-grow"],values:XU,responsive:!0},gridArea:{type:"string",className:"rt-r-ga",customProperties:["--grid-area"],responsive:!0},gridColumn:{type:"string",className:"rt-r-gc",customProperties:["--grid-column"],responsive:!0},gridColumnStart:{type:"string",className:"rt-r-gcs",customProperties:["--grid-column-start"],responsive:!0},gridColumnEnd:{type:"string",className:"rt-r-gce",customProperties:["--grid-column-end"],responsive:!0},gridRow:{type:"string",className:"rt-r-gr",customProperties:["--grid-row"],responsive:!0},gridRowStart:{type:"string",className:"rt-r-grs",customProperties:["--grid-row-start"],responsive:!0},gridRowEnd:{type:"string",className:"rt-r-gre",customProperties:["--grid-row-end"],responsive:!0},alignSelf:{type:"enum",className:"rt-r-as",values:QU,responsive:!0},justifySelf:{type:"enum",className:"rt-r-js",values:JU,responsive:!0}},j0=s.forwardRef((e,t)=>{const{className:n,asChild:r,as:a="div",...i}=kr(e,KU,rA,Mo);return s.createElement(r?nA:a,{...i,ref:t,className:Wt("rt-Box",n)})});j0.displayName="Box";const eW=["1","2","3","4"],tW=["classic","solid","soft","surface","outline","ghost"],N3={...Qa,size:{type:"enum",className:"rt-r-size",values:eW,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:tW,default:"solid"},...Av,...Lc,...am,loading:{type:"boolean",className:"rt-loading",default:!1}},Vg=["0","1","2","3","4","5","6","7","8","9"],nW={gap:{type:"enum | string",className:"rt-r-gap",customProperties:["--gap"],values:Vg,responsive:!0},gapX:{type:"enum | string",className:"rt-r-cg",customProperties:["--column-gap"],values:Vg,responsive:!0},gapY:{type:"enum | string",className:"rt-r-rg",customProperties:["--row-gap"],values:Vg,responsive:!0}},rW=["div","span"],sW=["none","inline-flex","flex"],aW=["row","column","row-reverse","column-reverse"],oW=["start","center","end","baseline","stretch"],iW=["start","center","end","between"],lW=["nowrap","wrap","wrap-reverse"],cW={as:{type:"enum",values:rW,default:"div"},...Qa,display:{type:"enum",className:"rt-r-display",values:sW,responsive:!0},direction:{type:"enum",className:"rt-r-fd",values:aW,responsive:!0},align:{type:"enum",className:"rt-r-ai",values:oW,responsive:!0},justify:{type:"enum",className:"rt-r-jc",values:iW,parseValue:uW,responsive:!0},wrap:{type:"enum",className:"rt-r-fw",values:lW,responsive:!0},...nW};function uW(e){return e==="between"?"space-between":e}const Ds=s.forwardRef((e,t)=>{const{className:n,asChild:r,as:a="div",...i}=kr(e,cW,rA,Mo);return s.createElement(r?nA:a,{...i,ref:t,className:Wt("rt-Flex",n)})});Ds.displayName="Flex";const dW=["1","2","3"],fW={size:{type:"enum",className:"rt-r-size",values:dW,default:"2",responsive:!0},loading:{type:"boolean",default:!0}},Ar=s.forwardRef((e,t)=>{const{className:n,children:r,loading:a,...i}=kr(e,fW,Mo);if(!a)return r;const l=s.createElement("span",{...i,ref:t,className:Wt("rt-Spinner",n)},s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}),s.createElement("span",{className:"rt-SpinnerLeaf"}));return r===void 0?l:s.createElement(Ds,{asChild:!0,position:"relative",align:"center",justify:"center"},s.createElement("span",null,s.createElement("span",{"aria-hidden":!0,style:{display:"contents",visibility:"hidden"},inert:void 0},r),s.createElement(Ds,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},s.createElement("span",null,l))))});Ar.displayName="Spinner";const hW=y7;function sA(e,t){if(e!==void 0)return typeof e=="string"?t(e):Object.fromEntries(Object.entries(e).map(([n,r])=>[n,t(r)]))}function pW(e){return e==="3"?"3":"2"}function mW(e){switch(e){case"1":return"1";case"2":case"3":return"2";case"4":return"3"}}const aA=s.forwardRef((e,t)=>{const{size:n=N3.size.default}=e,{className:r,children:a,asChild:i,color:l,radius:u,disabled:f=e.loading,...h}=kr(e,N3,Mo),p=i?kc:"button";return s.createElement(p,{"data-disabled":f||void 0,"data-accent-color":l,"data-radius":u,...h,ref:t,className:Wt("rt-reset","rt-BaseButton",r),disabled:f},e.loading?s.createElement(s.Fragment,null,s.createElement("span",{style:{display:"contents",visibility:"hidden"},"aria-hidden":!0},a),s.createElement(hW,null,a),s.createElement(Ds,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},s.createElement("span",null,s.createElement(Ar,{size:sA(n,mW)})))):a)});aA.displayName="BaseButton";const ma=s.forwardRef(({className:e,...t},n)=>s.createElement(aA,{...t,ref:n,className:Wt("rt-Button",e)}));ma.displayName="Button";const gW=["1","2","3"],vW=["soft","surface","outline"],M3={...Qa,size:{type:"enum",className:"rt-r-size",values:gW,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:vW,default:"soft"},...Av,...Lc},oA=s.createContext({}),x6=s.forwardRef((e,t)=>{const{size:n=M3.size.default}=e,{asChild:r,children:a,className:i,color:l,...u}=kr(e,M3,Mo),f=r?kc:"div";return s.createElement(f,{"data-accent-color":l,...u,className:Wt("rt-CalloutRoot",i),ref:t},s.createElement(oA.Provider,{value:s.useMemo(()=>({size:n}),[n])},a))});x6.displayName="Callout.Root";const wW=s.forwardRef(({className:e,...t},n)=>s.createElement("div",{...t,className:Wt("rt-CalloutIcon",e),ref:n}));wW.displayName="Callout.Icon";const k6=s.forwardRef(({className:e,...t},n)=>{const{size:r}=s.useContext(oA);return s.createElement(uc,{as:"p",size:sA(r,pW),...t,asChild:!1,ref:n,className:Wt("rt-CalloutText",e)})});k6.displayName="Callout.Text";const yW=Fn.forwardRef((e,t)=>Fn.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},Fn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z"})));yW.displayName="ThickDividerHorizontalIcon";const hd=Fn.forwardRef((e,t)=>Fn.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},Fn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z"})));hd.displayName="ThickCheckIcon";const iA=Fn.forwardRef((e,t)=>Fn.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},Fn.createElement("path",{d:"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z"})));iA.displayName="ChevronDownIcon";const Lv=Fn.forwardRef((e,t)=>Fn.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},Fn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z"})));Lv.displayName="ThickChevronRightIcon";const bW=["1","2","3"],n0={...Qa,size:{values:bW,default:"1"},...am,scrollbars:{default:"both"}};function xW(e){const{m:t,mx:n,my:r,mt:a,mr:i,mb:l,ml:u,...f}=e;return{m:t,mx:n,my:r,mt:a,mr:i,mb:l,ml:u,rest:f}}const _l=Mo.m.values;function kW(e){const[t,n]=Hi({className:"rt-r-m",customProperties:["--margin"],propValues:_l,value:e.m}),[r,a]=Hi({className:"rt-r-mx",customProperties:["--margin-left","--margin-right"],propValues:_l,value:e.mx}),[i,l]=Hi({className:"rt-r-my",customProperties:["--margin-top","--margin-bottom"],propValues:_l,value:e.my}),[u,f]=Hi({className:"rt-r-mt",customProperties:["--margin-top"],propValues:_l,value:e.mt}),[h,p]=Hi({className:"rt-r-mr",customProperties:["--margin-right"],propValues:_l,value:e.mr}),[g,v]=Hi({className:"rt-r-mb",customProperties:["--margin-bottom"],propValues:_l,value:e.mb}),[w,b]=Hi({className:"rt-r-ml",customProperties:["--margin-left"],propValues:_l,value:e.ml});return[Wt(t,r,i,u,h,g,w),Wh(n,a,l,f,p,v,b)]}const Nf=s.forwardRef((e,t)=>{const{rest:n,...r}=xW(e),[a,i]=kW(r),{asChild:l,children:u,className:f,style:h,type:p,scrollHideDelay:g=p!=="scroll"?0:void 0,dir:v,size:w=n0.size.default,radius:b=n0.radius.default,scrollbars:y=n0.scrollbars.default,...k}=n;return s.createElement(Rj,{type:p,scrollHideDelay:g,className:Wt("rt-ScrollAreaRoot",a,f),style:Wh(i,h),asChild:l},VU({asChild:l,children:u},S=>s.createElement(s.Fragment,null,s.createElement(Pj,{...k,ref:t,className:"rt-ScrollAreaViewport"},S),s.createElement("div",{className:"rt-ScrollAreaViewportFocusRing"}),y!=="vertical"?s.createElement(g6,{"data-radius":b,orientation:"horizontal",className:Wt("rt-ScrollAreaScrollbar",Uh({className:"rt-r-size",value:w,propValues:n0.size.values}))},s.createElement(v6,{className:"rt-ScrollAreaThumb"})):null,y!=="horizontal"?s.createElement(g6,{"data-radius":b,orientation:"vertical",className:Wt("rt-ScrollAreaScrollbar",Uh({className:"rt-r-size",value:w,propValues:n0.size.values}))},s.createElement(v6,{className:"rt-ScrollAreaThumb"})):null,y==="both"?s.createElement(gB,{className:"rt-ScrollAreaCorner"}):null)))});Nf.displayName="ScrollArea";const SW=["1","2"],EW=["solid","soft"],go={size:{type:"enum",className:"rt-r-size",values:SW,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:EW,default:"solid"},...ml,...Lc},lA={...Qa,...ml},cA={...ml},uA={...ml},Mf=e=>s.createElement(IZ,{...e});Mf.displayName="ContextMenu.Root";const Rf=s.forwardRef(({children:e,...t},n)=>s.createElement(FZ,{...t,ref:n,asChild:!0},gi(e)));Rf.displayName="ContextMenu.Trigger";const dA=s.createContext({}),Pf=s.forwardRef((e,t)=>{const n=Rv(),{size:r=go.size.default,variant:a=go.variant.default,highContrast:i=go.highContrast.default}=e,{className:l,children:u,color:f,container:h,forceMount:p,...g}=kr(e,go),v=f||n.accentColor;return s.createElement(hj,{container:h,forceMount:p},s.createElement(Ja,{asChild:!0},s.createElement(_Z,{"data-accent-color":v,alignOffset:-Number(r)*4,collisionPadding:10,...g,asChild:!1,ref:t,className:Wt("rt-PopperContent","rt-BaseMenuContent","rt-ContextMenuContent",l)},s.createElement(Nf,{type:"auto"},s.createElement("div",{className:Wt("rt-BaseMenuViewport","rt-ContextMenuViewport")},s.createElement(dA.Provider,{value:s.useMemo(()=>({size:r,variant:a,color:v,highContrast:i}),[r,a,v,i])},u))))))});Pf.displayName="ContextMenu.Content";const CW=s.forwardRef(({className:e,...t},n)=>s.createElement(ZZ,{...t,asChild:!1,ref:n,className:Wt("rt-BaseMenuLabel","rt-ContextMenuLabel",e)}));CW.displayName="ContextMenu.Label";const Lf=s.forwardRef((e,t)=>{const{className:n,children:r,color:a=lA.color.default,shortcut:i,...l}=e;return s.createElement(zZ,{"data-accent-color":a,...l,ref:t,className:Wt("rt-reset","rt-BaseMenuItem","rt-ContextMenuItem",n)},s.createElement(Op,null,r),i&&s.createElement("div",{className:"rt-BaseMenuShortcut rt-ContextMenuShortcut"},i))});Lf.displayName="ContextMenu.Item";const jW=s.forwardRef(({className:e,...t},n)=>s.createElement(VZ,{...t,asChild:!1,ref:n,className:Wt("rt-BaseMenuGroup","rt-ContextMenuGroup",e)}));jW.displayName="ContextMenu.Group";const AW=s.forwardRef(({className:e,...t},n)=>s.createElement(UZ,{...t,asChild:!1,ref:n,className:Wt("rt-BaseMenuRadioGroup","rt-ContextMenuRadioGroup",e)}));AW.displayName="ContextMenu.RadioGroup";const NW=s.forwardRef((e,t)=>{const{children:n,className:r,color:a=uA.color.default,...i}=e;return s.createElement(WZ,{...i,asChild:!1,ref:t,"data-accent-color":a,className:Wt("rt-BaseMenuItem","rt-BaseMenuRadioItem","rt-ContextMenuItem","rt-ContextMenuRadioItem",r)},s.createElement(Op,null,n),s.createElement(pj,{className:"rt-BaseMenuItemIndicator rt-ContextMenuItemIndicator"},s.createElement(hd,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})))});NW.displayName="ContextMenu.RadioItem";const MW=s.forwardRef((e,t)=>{const{children:n,className:r,shortcut:a,color:i=cA.color.default,...l}=e;return s.createElement(BZ,{...l,asChild:!1,ref:t,"data-accent-color":i,className:Wt("rt-BaseMenuItem","rt-BaseMenuCheckboxItem","rt-ContextMenuItem","rt-ContextMenuCheckboxItem",r)},s.createElement(Op,null,n),s.createElement(pj,{className:"rt-BaseMenuItemIndicator rt-ContextMenuItemIndicator"},s.createElement(hd,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})),a&&s.createElement("div",{className:"rt-BaseMenuShortcut rt-ContextMenuShortcut"},a))});MW.displayName="ContextMenu.CheckboxItem";const RW=s.forwardRef((e,t)=>{const{className:n,children:r,...a}=e;return s.createElement(GZ,{...a,asChild:!1,ref:t,className:Wt("rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-ContextMenuItem","rt-ContextMenuSubTrigger",n)},r,s.createElement("div",{className:"rt-BaseMenuShortcut rt-ContextMenuShortcut"},s.createElement(Lv,{className:"rt-BaseMenuSubTriggerIcon rt-ContextMenuSubTriggerIcon"})))});RW.displayName="ContextMenu.SubTrigger";const PW=s.forwardRef((e,t)=>{const{size:n,variant:r,color:a,highContrast:i}=s.useContext(dA),{className:l,children:u,container:f,forceMount:h,...p}=kr({size:n,variant:r,color:a,highContrast:i,...e},go);return s.createElement(hj,{container:f,forceMount:h},s.createElement(Ja,{asChild:!0},s.createElement(YZ,{"data-accent-color":a,alignOffset:-Number(n)*4,sideOffset:1,collisionPadding:10,...p,asChild:!1,ref:t,className:Wt("rt-PopperContent","rt-BaseMenuContent","rt-BaseMenuSubContent","rt-ContextMenuContent","rt-ContextMenuSubContent",l)},s.createElement(Nf,{type:"auto"},s.createElement("div",{className:Wt("rt-BaseMenuViewport","rt-ContextMenuViewport")},u)))))});PW.displayName="ContextMenu.SubContent";const om=s.forwardRef(({className:e,...t},n)=>s.createElement(KZ,{...t,asChild:!1,ref:n,className:Wt("rt-BaseMenuSeparator","rt-ContextMenuSeparator",e)}));om.displayName="ContextMenu.Separator";const $v=e=>s.createElement(Sc,{...e,modal:!0});$v.displayName="Dialog.Root";const LW=s.forwardRef(({children:e,...t},n)=>s.createElement(X4,{...t,ref:n,asChild:!0},gi(e)));LW.displayName="Dialog.Trigger";const Tv=s.forwardRef(({align:e,...t},n)=>{const{align:r,...a}=Uj,{className:i}=kr({align:e},{align:r}),{className:l,forceMount:u,container:f,...h}=kr(t,a);return s.createElement(Ec,{container:f,forceMount:u},s.createElement(Ja,{asChild:!0},s.createElement(Cc,{className:"rt-BaseDialogOverlay rt-DialogOverlay"},s.createElement("div",{className:"rt-BaseDialogScroll rt-DialogScroll"},s.createElement("div",{className:`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${i}`},s.createElement(jc,{...h,ref:n,className:Wt("rt-BaseDialogContent","rt-DialogContent",l)}))))))});Tv.displayName="Dialog.Content";const Dv=s.forwardRef((e,t)=>s.createElement(Ac,{asChild:!0},s.createElement(Mv,{size:"5",mb:"3",trim:"start",...e,asChild:!1,ref:t})));Dv.displayName="Dialog.Title";const $W=s.forwardRef((e,t)=>s.createElement(Q4,{asChild:!0},s.createElement(uc,{as:"p",size:"3",...e,asChild:!1,ref:t})));$W.displayName="Dialog.Description";const TW=s.forwardRef(({children:e,...t},n)=>s.createElement(Vp,{...t,ref:n,asChild:!0},gi(e)));TW.displayName="Dialog.Close";const ws=e=>s.createElement(mz,{...e});ws.displayName="DropdownMenu.Root";const ys=s.forwardRef(({children:e,...t},n)=>s.createElement(gz,{...t,ref:n,asChild:!0},gi(e)));ys.displayName="DropdownMenu.Trigger";const fA=s.createContext({}),bs=s.forwardRef((e,t)=>{const n=Rv(),{size:r=go.size.default,variant:a=go.variant.default,highContrast:i=go.highContrast.default}=e,{className:l,children:u,color:f,container:h,forceMount:p,...g}=kr(e,go),v=f||n.accentColor;return s.createElement(gj,{container:h,forceMount:p},s.createElement(Ja,{asChild:!0},s.createElement(vz,{"data-accent-color":v,align:"start",sideOffset:4,collisionPadding:10,...g,asChild:!1,ref:t,className:Wt("rt-PopperContent","rt-BaseMenuContent","rt-DropdownMenuContent",l)},s.createElement(Nf,{type:"auto"},s.createElement("div",{className:Wt("rt-BaseMenuViewport","rt-DropdownMenuViewport")},s.createElement(fA.Provider,{value:s.useMemo(()=>({size:r,variant:a,color:v,highContrast:i}),[r,a,v,i])},u))))))});bs.displayName="DropdownMenu.Content";const S6=s.forwardRef(({className:e,...t},n)=>s.createElement(yz,{...t,asChild:!1,ref:n,className:Wt("rt-BaseMenuLabel","rt-DropdownMenuLabel",e)}));S6.displayName="DropdownMenu.Label";const Yn=s.forwardRef((e,t)=>{const{className:n,children:r,color:a=lA.color.default,shortcut:i,...l}=e;return s.createElement(bz,{"data-accent-color":a,...l,ref:t,className:Wt("rt-reset","rt-BaseMenuItem","rt-DropdownMenuItem",n)},s.createElement(Op,null,r),i&&s.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},i))});Yn.displayName="DropdownMenu.Item";const DW=s.forwardRef(({className:e,...t},n)=>s.createElement(wz,{...t,asChild:!1,ref:n,className:Wt("rt-BaseMenuGroup","rt-DropdownMenuGroup",e)}));DW.displayName="DropdownMenu.Group";const Gh=s.forwardRef(({className:e,...t},n)=>s.createElement(kz,{...t,asChild:!1,ref:n,className:Wt("rt-BaseMenuRadioGroup","rt-DropdownMenuRadioGroup",e)}));Gh.displayName="DropdownMenu.RadioGroup";const ju=s.forwardRef((e,t)=>{const{children:n,className:r,color:a=uA.color.default,...i}=e;return s.createElement(Sz,{...i,asChild:!1,ref:t,"data-accent-color":a,className:Wt("rt-BaseMenuItem","rt-BaseMenuRadioItem","rt-DropdownMenuItem","rt-DropdownMenuRadioItem",r)},n,s.createElement(vj,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},s.createElement(hd,{className:"rt-BaseMenuItemIndicatorIcon rt-DropdownMenuItemIndicatorIcon"})))});ju.displayName="DropdownMenu.RadioItem";const HW=s.forwardRef((e,t)=>{const{children:n,className:r,shortcut:a,color:i=cA.color.default,...l}=e;return s.createElement(xz,{...l,asChild:!1,ref:t,"data-accent-color":i,className:Wt("rt-BaseMenuItem","rt-BaseMenuCheckboxItem","rt-DropdownMenuItem","rt-DropdownMenuCheckboxItem",r)},n,s.createElement(vj,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},s.createElement(hd,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})),a&&s.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},a))});HW.displayName="DropdownMenu.CheckboxItem";const OW=s.forwardRef((e,t)=>{const{className:n,children:r,...a}=e;return s.createElement(Cz,{...a,asChild:!1,ref:t,className:Wt("rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-DropdownMenuItem","rt-DropdownMenuSubTrigger",n)},r,s.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},s.createElement(Lv,{className:"rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubtriggerIcon"})))});OW.displayName="DropdownMenu.SubTrigger";const IW=s.forwardRef((e,t)=>{const{size:n,variant:r,color:a,highContrast:i}=s.useContext(fA),{className:l,children:u,container:f,forceMount:h,...p}=kr({size:n,variant:r,color:a,highContrast:i,...e},go);return s.createElement(gj,{container:f,forceMount:h},s.createElement(Ja,{asChild:!0},s.createElement(jz,{"data-accent-color":a,alignOffset:-Number(n)*4,sideOffset:1,collisionPadding:10,...p,asChild:!1,ref:t,className:Wt("rt-PopperContent","rt-BaseMenuContent","rt-BaseMenuSubContent","rt-DropdownMenuContent","rt-DropdownMenuSubContent",l)},s.createElement(Nf,{type:"auto"},s.createElement("div",{className:Wt("rt-BaseMenuViewport","rt-DropdownMenuViewport")},u)))))});IW.displayName="DropdownMenu.SubContent";const nc=s.forwardRef(({className:e,...t},n)=>s.createElement(Ez,{...t,asChild:!1,ref:n,className:Wt("rt-BaseMenuSeparator","rt-DropdownMenuSeparator",e)}));nc.displayName="DropdownMenu.Separator";const FW=["1","2","3","4"],_W={...Qa,size:{type:"enum",className:"rt-r-size",values:FW,default:"2",responsive:!0},width:yo.width,minWidth:yo.minWidth,maxWidth:{...yo.maxWidth,default:"480px"},...jv},Xu=e=>s.createElement(Kz,{...e});Xu.displayName="Popover.Root";const Qu=s.forwardRef(({children:e,...t},n)=>s.createElement(Yz,{...t,ref:n,asChild:!0},gi(e)));Qu.displayName="Popover.Trigger";const Ju=s.forwardRef((e,t)=>{const{className:n,forceMount:r,container:a,...i}=kr(e,_W);return s.createElement(qz,{container:a,forceMount:r},s.createElement(Ja,{asChild:!0},s.createElement(Xz,{align:"start",sideOffset:8,collisionPadding:10,...i,ref:t,className:Wt("rt-PopperContent","rt-PopoverContent",n)})))});Ju.displayName="Popover.Content";const VW=s.forwardRef(({children:e,...t},n)=>s.createElement(Qz,{...t,ref:n,asChild:!0},gi(e)));VW.displayName="Popover.Close";const ZW=s.forwardRef(({children:e,...t},n)=>s.createElement(Gz,{...t,ref:n}));ZW.displayName="Popover.Anchor";const zW=["1","2","3"],Hv={size:{type:"enum",className:"rt-r-size",values:zW,default:"2",responsive:!0}},BW=["classic","surface","soft","ghost"],UW={variant:{type:"enum",className:"rt-variant",values:BW,default:"surface"},...ml,...am,placeholder:{type:"string"}},WW=["solid","soft"],KW={variant:{type:"enum",className:"rt-variant",values:WW,default:"solid"},...ml,...Lc},Ov=s.createContext({}),hA=e=>{const{children:t,size:n=Hv.size.default,...r}=e;return s.createElement(EB,{...r},s.createElement(Ov.Provider,{value:s.useMemo(()=>({size:n}),[n])},t))};hA.displayName="Select.Root";const pA=s.forwardRef((e,t)=>{const n=s.useContext(Ov),{children:r,className:a,color:i,radius:l,placeholder:u,...f}=kr({size:n==null?void 0:n.size,...e},{size:Hv.size},UW,Mo);return s.createElement(jB,{asChild:!0},s.createElement("button",{"data-accent-color":i,"data-radius":l,...f,ref:t,className:Wt("rt-reset","rt-SelectTrigger",a)},s.createElement("span",{className:"rt-SelectTriggerInner"},s.createElement(NB,{placeholder:u},r)),s.createElement(MB,{asChild:!0},s.createElement(iA,{className:"rt-SelectIcon"}))))});pA.displayName="Select.Trigger";const mA=s.forwardRef((e,t)=>{const n=s.useContext(Ov),{className:r,children:a,color:i,container:l,...u}=kr({size:n==null?void 0:n.size,...e},{size:Hv.size},KW),f=Rv(),h=i||f.accentColor;return s.createElement($B,{container:l},s.createElement(Ja,{asChild:!0},s.createElement(TB,{"data-accent-color":h,sideOffset:4,...u,asChild:!1,ref:t,className:Wt({"rt-PopperContent":u.position==="popper"},"rt-SelectContent",r)},s.createElement(Rj,{type:"auto",className:"rt-ScrollAreaRoot"},s.createElement(VB,{asChild:!0,className:"rt-SelectViewport"},s.createElement(Pj,{className:"rt-ScrollAreaViewport",style:{overflowY:void 0}},a)),s.createElement(g6,{className:"rt-ScrollAreaScrollbar rt-r-size-1",orientation:"vertical"},s.createElement(v6,{className:"rt-ScrollAreaThumb"}))))))});mA.displayName="Select.Content";const gA=s.forwardRef((e,t)=>{const{className:n,children:r,...a}=e;return s.createElement(YB,{...a,asChild:!1,ref:t,className:Wt("rt-SelectItem",n)},s.createElement(QB,{className:"rt-SelectItemIndicator"},s.createElement(hd,{className:"rt-SelectItemIndicatorIcon"})),s.createElement(qB,null,r))});gA.displayName="Select.Item";const GW=s.forwardRef(({className:e,...t},n)=>s.createElement(UB,{...t,asChild:!1,ref:n,className:Wt("rt-SelectGroup",e)}));GW.displayName="Select.Group";const YW=s.forwardRef(({className:e,...t},n)=>s.createElement(KB,{...t,asChild:!1,ref:n,className:Wt("rt-SelectLabel",e)}));YW.displayName="Select.Label";const qW=s.forwardRef(({className:e,...t},n)=>s.createElement(JB,{...t,asChild:!1,ref:n,className:Wt("rt-SelectSeparator",e)}));qW.displayName="Select.Separator";const XW={content:{type:"ReactNode",required:!0},width:yo.width,minWidth:yo.minWidth,maxWidth:{...yo.maxWidth,default:"360px"}},Iv=s.forwardRef((e,t)=>{const{children:n,className:r,open:a,defaultOpen:i,onOpenChange:l,delayDuration:u,disableHoverableContent:f,content:h,container:p,forceMount:g,...v}=kr(e,XW),w={open:a,defaultOpen:i,onOpenChange:l,delayDuration:u,disableHoverableContent:f};return s.createElement(wU,{...w},s.createElement(yU,{asChild:!0},n),s.createElement(bU,{container:p,forceMount:g},s.createElement(Ja,{asChild:!0},s.createElement(xU,{sideOffset:4,collisionPadding:10,...v,asChild:!1,ref:t,className:Wt("rt-TooltipContent",r)},s.createElement(uc,{as:"p",className:"rt-TooltipText",size:"1"},h),s.createElement(kU,{className:"rt-TooltipArrow"})))))});Iv.displayName="Tooltip";const Kr={lastBrand:"scenri:last-brand",engine:"scenri:engine",quality:"scenri:quality",count:"scenri:count",format:"scenri:format",assetsOpen:"scenri:assets-open",ovlPanelW:"scenri:ovl-panel-w",pstudioRailW:"scenri:pstudio-rail-w",assetsExpanded:"scenri:assets-expanded",tileSize:"scenri:tile-size",wallDensity:"scenri:wall-density",feedSort:"scenri:feed-sort",feedCounts:"scenri:feed-counts"};function vA(e,t){try{const n=localStorage.getItem(e);return n===null?t:JSON.parse(n)}catch{return t}}const E6="scenri:pref-changed";function wA(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}try{window.dispatchEvent(new CustomEvent(E6,{detail:{key:e,value:t}}))}catch{}}function C6(e,t){try{const n=localStorage.getItem(e);return n===null?null:(localStorage.setItem(t,n),localStorage.removeItem(e),n)}catch{return null}}function ba(e,t){const[n,r]=s.useState(()=>vA(e,t)),a=s.useRef(n);return s.useEffect(()=>{Object.is(a.current,n)||(a.current=n,wA(e,n))},[e,n]),s.useEffect(()=>{const i=l=>{const u=l.detail;(u==null?void 0:u.key)===e&&r(f=>Object.is(f,u.value)?f:u.value)};return window.addEventListener(E6,i),()=>window.removeEventListener(E6,i)},[e]),[n,r]}function QW(e,t){const[n,r]=s.useState(()=>{try{const a=sessionStorage.getItem(e);return a===null?t:JSON.parse(a)}catch{return t}});return s.useEffect(()=>{try{sessionStorage.setItem(e,JSON.stringify(n))}catch{}},[e,n]),[n,r]}function Zg(e,t){const[n,r]=ba(e,t),[a,i]=s.useState(null);return[a??n,u=>{i(null),r(u)},i]}const JW=()=>vA(Kr.lastBrand,null),eK=e=>wA(Kr.lastBrand,e),j6="sc-theme",tK="bt-theme",nK=()=>window.matchMedia("(prefers-color-scheme: light)").matches,yA=s.createContext({choice:"system",mode:"dark",setChoice:()=>{},toggle:()=>{}}),rK=()=>s.useContext(yA);function sK(){const e=localStorage.getItem(j6)??C6(tK,j6);return e==="light"||e==="dark"||e==="system"?e:"system"}function aK({children:e}){const[t,n]=s.useState(sK),[r,a]=s.useState(()=>nK()?"light":"dark");s.useEffect(()=>{const u=window.matchMedia("(prefers-color-scheme: light)"),f=()=>a(u.matches?"light":"dark");return u.addEventListener("change",f),()=>u.removeEventListener("change",f)},[]);const i=t==="system"?r:t;s.useEffect(()=>{document.documentElement.dataset.theme=i,localStorage.setItem(j6,t)},[i,t]);const l=s.useMemo(()=>({choice:t,mode:i,setChoice:n,toggle:()=>n(i==="dark"?"light":"dark")}),[t,i]);return o.jsx(yA.Provider,{value:l,children:o.jsx(Ja,{appearance:i,accentColor:"gray",grayColor:"gray",radius:"large",scaling:"100%",children:e})})}const bA=s.createContext({push:()=>{}}),cr=()=>s.useContext(bA),oK=3,iK=140,A0=e=>{var t;return!!(e.action||(t=e.actions)!=null&&t.length)},lK=e=>{var t;return((t=e.actions)!=null&&t.length?e.actions:e.action?[e.action]:[]).slice(0,2)};function zg(e){var a;if(e.kind==="error")return 1/0;const t=e.title.length+(((a=e.detail)==null?void 0:a.length)??0),n=A0(e)?9e3:4e3,r=A0(e)?14e3:8e3;return Math.min(n+Math.max(0,t-40)*45,r)}function cK(e,t,n){const r=n>1?` (${n} times)`:"";return`${e}${r}${t?` ${t}`:""}`}const uK=()=>typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function dK({kind:e}){if(e==="info")return null;const t=e==="success"?Un:e==="warning"?Hp:xc;return o.jsx(t,{className:"sc-toast-ic",size:16,weight:"regular","aria-hidden":"true"})}function fK({children:e}){const[t,n]=s.useState([]),r=s.useRef(1),a=s.useRef([]),i=s.useRef(new Map),l=s.useRef(null),u=s.useRef(null),f=s.useRef(null),h=s.useRef(new Map),p=s.useCallback(E=>{a.current=E,n(E)},[]),g=s.useCallback(E=>{const j=E.kind==="error"?u.current:l.current;if(!j)return;const N=cK(E.title,E.detail,E.count);j.textContent=N,window.setTimeout(()=>{j.textContent===N&&(j.textContent="")},1e3)},[]),v=s.useCallback(E=>{const j=i.current.get(E);(j==null?void 0:j.handle)!=null&&window.clearTimeout(j.handle),i.current.delete(E),p(a.current.map(N=>N.id===E&&!N.leaving?{...N,leaving:!0}:N)),window.setTimeout(()=>p(a.current.filter(N=>N.id!==E)),iK+40)},[p]),w=s.useCallback((E,j)=>{if(!Number.isFinite(j))return;const N=i.current.get(E)??{remaining:j,since:0,handle:null};N.handle!=null&&window.clearTimeout(N.handle),N.remaining=j,N.since=Date.now(),N.handle=window.setTimeout(()=>v(E),j),i.current.set(E,N)},[v]),b=s.useCallback(E=>{const j=i.current.get(E);!j||j.handle==null||(window.clearTimeout(j.handle),j.handle=null,j.remaining=Math.max(0,j.remaining-(Date.now()-j.since)))},[]),y=s.useCallback(E=>{const j=i.current.get(E);!j||j.handle!=null||w(E,j.remaining)},[w]);s.useEffect(()=>{const E=()=>{const j=[...i.current.keys()];document.hidden?j.forEach(b):j.forEach(y)};return document.addEventListener("visibilitychange",E),()=>document.removeEventListener("visibilitychange",E)},[b,y]),s.useLayoutEffect(()=>{const E=f.current;if(!E)return;const j=new Map,N=!uK();for(const A of E.querySelectorAll("[data-toast-id]")){const T=Number(A.dataset.toastId),P=A.getBoundingClientRect().top;j.set(T,P);const C=h.current.get(T);if(!N||C===void 0||A.hasAttribute("data-leaving"))continue;const R=C-P;R&&(A.style.transition="none",A.style.transform=`translateY(${R}px)`,A.getBoundingClientRect(),A.style.transition="transform 160ms cubic-bezier(.2, .7, .3, 1)",A.style.transform="")}h.current=j},[t]),s.useLayoutEffect(()=>{const E=f.current;if(!E)return;const j=()=>{const T=document.querySelector(".sc-canvas-dock");if(!T||!t.length){delete E.dataset.overDock;return}const P=E.getBoundingClientRect(),C=T.getBoundingClientRect();P.left<C.right&&C.left<P.right?(E.style.setProperty("--sc-toasts-over-dock",`${Math.round(window.innerHeight-C.top+10)}px`),E.dataset.overDock=""):delete E.dataset.overDock};j(),window.addEventListener("resize",j);const N=document.querySelector(".sc-canvas-dock"),A=typeof ResizeObserver>"u"||!N?null:new ResizeObserver(j);return A==null||A.observe(N),()=>{window.removeEventListener("resize",j),A==null||A.disconnect()}},[t]);const k=s.useCallback(E=>{const j=a.current.filter(C=>!C.leaving),N=A0(E)?void 0:j.find(C=>C.kind===E.kind&&C.title===E.title&&C.detail===E.detail&&!A0(C));if(N){const C={...N,count:N.count+1};p(a.current.map($=>$.id===N.id?C:$));const R=i.current.get(N.id);R&&R.handle==null?R.remaining=zg(C):w(N.id,zg(C)),C.quiet||g(C);return}const A={...E,id:r.current++,count:1},T=[...a.current,A],P=C=>!C.leaving;for(;T.filter(P).length>oK;){let C=T.findIndex(H=>P(H)&&H.kind!=="error"&&!A0(H));C===-1&&(C=T.findIndex(H=>P(H)&&H.kind!=="error")),C===-1&&(C=T.findIndex(P));const R=T.splice(C,1)[0],$=i.current.get(R.id);($==null?void 0:$.handle)!=null&&window.clearTimeout($.handle),i.current.delete(R.id)}p(T),w(A.id,zg(A)),A.quiet||g(A)},[g,w,p]),S=s.useMemo(()=>({push:k}),[k]);return s.useEffect(()=>{if(typeof localStorage<"u"&&localStorage.getItem("scenri:toast-probe"))return window.__scenriToast=k,()=>{delete window.__scenriToast}},[k]),o.jsxs(bA.Provider,{value:S,children:[e,_r.createPortal(o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:l,className:"sc-vh",role:"status","aria-live":"polite"}),o.jsx("div",{ref:u,className:"sc-vh","aria-live":"assertive","aria-atomic":"true"}),o.jsx("section",{className:"sc-toasts","aria-label":"Alerts",ref:f,onPointerDown:R3,onMouseDown:R3,children:t.map(E=>{const j=lK(E);return o.jsx("div",{className:"sc-toast-wrap","data-toast-id":E.id,"data-leaving":E.leaving||void 0,children:o.jsxs("article",{className:"sc-toast","data-kind":E.kind,onPointerEnter:()=>b(E.id),onPointerLeave:()=>y(E.id),onFocus:()=>b(E.id),onBlur:N=>{N.currentTarget.contains(N.relatedTarget)||y(E.id)},children:[o.jsx(dK,{kind:E.kind}),o.jsxs("div",{className:"sc-toast-body",children:[o.jsxs("div",{className:"sc-toast-top",children:[o.jsxs("div",{className:"sc-toast-txt",children:[o.jsxs("b",{children:[E.title,E.count>1?o.jsxs("span",{className:"sc-toast-n",children:["×",E.count]}):null]}),E.detail?o.jsx("small",{children:E.detail.slice(0,160)}):null]}),o.jsx("button",{type:"button",className:"sc-toast-x",onClick:()=>v(E.id),"aria-label":"Dismiss",children:o.jsx(Mn,{size:14,weight:"regular"})})]}),j.length?o.jsx("div",{className:"sc-toast-acts",children:j.map(N=>o.jsx("button",{type:"button",className:"sc-toast-act",onClick:()=>{N.onClick(),v(E.id)},children:N.label},N.label))}):null]})]})},E.id)})})]}),document.body)]})}function R3(e){e.stopPropagation(),e.type==="mousedown"&&e.target instanceof Element&&e.target.closest("button")&&e.preventDefault()}async function Je(e,t,n,r,a){const i=await fetch(t,{method:e,signal:r,keepalive:a==null?void 0:a.keepalive,headers:n!==void 0?{"content-type":"application/json"}:void 0,body:n!==void 0?JSON.stringify(n):void 0});if(!i.ok){let l=`HTTP ${i.status}`;try{const u=await i.json();l=u.error??l,u.details&&(l+=`: ${u.details.join("; ")}`)}catch{}throw Object.assign(new Error(l),{status:i.status,method:e,url:t})}return i.json()}const hK=(e,t,n)=>Je("DELETE",`/api/brands/${e}/${t}/${n}`),A6=(e,t)=>hK(e,"products",t);async function xA(e,t,n={}){const r=new FormData;n.role&&r.append("role",n.role),n.background&&r.append("background",n.background),r.append("file",t);const a=await fetch(`/api/brands/${e}/logos`,{method:"POST",body:r});if(!a.ok)throw new Error((await a.json().catch(()=>({}))).error??`HTTP ${a.status}`);return a.json()}const pK=e=>`/api/brands/${e}/export`;async function mK(e,t,n,r){const a=new FormData;a.append("file",n);const i=await fetch(`/api/brands/${e}/products/${t}/shots`,{method:"POST",body:a});if(!i.ok)throw new Error((await i.json().catch(()=>({}))).error??`HTTP ${i.status}`);return i.json()}async function W0(e){const t=new FormData;t.append("file",e);const n=await fetch("/api/images",{method:"POST",body:t});if(!n.ok)throw new Error((await n.json().catch(()=>({}))).error??`HTTP ${n.status}`);return(await n.json()).hash}function Yh(e){if(!e||typeof e!="object")return e;const{products:t,scenes:n,characters:r,...a}=e;return a}function gK(e,t,n){try{return fetch(`/api/brands/${e}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({brand:Yh(t),keepAssets:!0,base:Yh(n)}),keepalive:!0}).then(r=>r.ok?r.json():null).catch(()=>null)}catch{return Promise.resolve(null)}}const Fr=e=>`/api/images/${e}`,qr=e=>e!=null&&e.startsWith("asset:")?Fr(e.slice(6)):null,kA={large:960,tile:640,small:320,micro:160},hn=(e,t)=>`${Fr(e)}/thumb?w=${kA[t]}`,im=(e,t)=>e!=null&&e.startsWith("asset:")?hn(e.slice(6),t):null,vK=/^\/api\/images\/([a-f0-9]{32})(?:\/thumb\?w=\d+)?$/,wK=/^(\/api\/(?:(?:presenter-avatars|presenter-thumbnails|scene-thumbnails|demo-product-thumbnails|showcase-previews)\/[a-z0-9-]+|scene-previews\/[a-z0-9-]+\/ref-[0-9]{2})\.jpg)(?:\?v=(\d+))?(?:[?&]w=\d+)?$/;function Pn(e,t){if(!e)return e;const n=vK.exec(e);if(n)return t==="full"?Fr(n[1]):hn(n[1],t);const r=wK.exec(e);if(!r)return e;const a=r[2]?`${r[1]}?v=${r[2]}`:r[1];return t==="full"?a:`${a}${r[2]?"&":"?"}w=${kA[t]}`}function Jl(e){const t=Pn(e,"tile"),n=Pn(e,"large");if(!(!t||!n||t===n))return`${t} 640w, ${n} 960w`}const SA={large:"(max-width: 720px) 50vw, 360px",compact:"(max-width: 720px) 50vw, 240px"};function P3(e){return e.every(t=>t.kind==="root")}let EA=new Map;function yK(e){const t=new Map;for(const n of e)for(const r of n.legacyNames??[])r!==n.name&&t.set(r,n.name);EA=t}function bK(e){var r;const t=e.promptHead??"",n=(r=/^\[([^\]]+)\]/.exec(t))==null?void 0:r[1];if(n)return EA.get(n)??n;if(t.startsWith("Remove all overlaid marketing text")||t.startsWith("Remove ALL text"))return"Text lift"}function Rr(e){const t=bK(e);return t||(e.promptHead??"").trim().split(/\s+/).slice(0,6).join(" ")||(e.kind==="edit"?"Edit":"Generation")}const CA=[{id:"newest",label:"Newest first"},{id:"oldest",label:"Oldest first"},{id:"cost",label:"Highest cost"},{id:"keepers",label:"Keepers first"}];function xK(e){return CA.some(t=>t.id===e)}const jA=[{id:"all",label:"All"},{id:"keepers",label:"Keepers"},{id:"archived",label:"Archived"}];function kK(e){return jA.some(t=>t.id===e)}function SK(e){var r;const t=new URLSearchParams;e.lens&&e.lens!=="all"&&t.set("lens",e.lens),e.set&&t.set("set",e.set),e.ungrouped&&t.set("ungrouped","1"),e.lineage&&t.set("lineage",e.lineage),e.token&&t.set("token",e.token),(r=e.q)!=null&&r.trim()&&t.set("q",e.q.trim()),e.sort&&e.sort!=="newest"&&t.set("sort",e.sort),e.limit&&t.set("limit",String(e.limit)),e.cursor&&t.set("cursor",e.cursor);const n=t.toString();return n?`?${n}`:""}function N6(e,t){const n=e.findIndex(r=>r.id===t);return n<0?{at:n,prev:null,next:null}:{at:n,prev:e[n-1]??null,next:e[n+1]??null}}const Au=(e,t)=>t.createdAt.localeCompare(e.createdAt)||t.id.localeCompare(e.id),je={brands:()=>Je("GET","/api/brands"),createBrand:e=>Je("POST","/api/brands",{brand:e}),brandFromUrl:e=>Je("POST","/api/brands/from-url",{url:e}),updateBrand:(e,t,n)=>Je("PUT",`/api/brands/${e}`,{brand:Yh(t),keepAssets:!0,base:Yh(n)}),deleteBrand:e=>Je("DELETE",`/api/brands/${e}`),guide:()=>Je("GET","/api/guide"),guideIntent:e=>Je("POST","/api/guide",e,void 0,{keepalive:!0}),refreshBrandFromUrl:(e,t)=>Je("POST",`/api/brands/${e}/refresh-from-url`,t?{url:t}:{}),updateLogo:(e,t,n)=>Je("PATCH",`/api/brands/${e}/logos/${t}`,n),deleteLogo:(e,t)=>Je("DELETE",`/api/brands/${e}/logos/${t}`),projects:e=>Je("GET",`/api/projects?brandId=${encodeURIComponent(e)}`),createProject:(e,t)=>Je("POST","/api/projects",{brandId:e,name:t}),tree:e=>Je("GET",`/api/projects/${e}/tree`),activity:e=>Je("GET",`/api/brands/${e}/activity`),workspace:e=>Je("GET",`/api/brands/${e}/workspace`),feed:(e,t,n)=>Je("GET",`/api/brands/${e}/feed${SK(t)}`,void 0,n),node:e=>Je("GET",`/api/nodes/${e}`),lineage:e=>Je("GET",`/api/nodes/${e}/lineage`),usage:e=>Je("GET",`/api/brands/${e}/usage`),sets:e=>Je("GET",`/api/brands/${e}/sets`),createSet:(e,t)=>Je("POST",`/api/brands/${e}/sets`,{name:t}),renameSet:(e,t)=>Je("PATCH",`/api/sets/${e}`,{name:t}),deleteSet:e=>Je("DELETE",`/api/sets/${e}`),addToSet:(e,t)=>Je("POST",`/api/sets/${e}/nodes`,{nodeIds:t}),removeFromSet:(e,t)=>Je("POST",`/api/sets/${e}/nodes/remove`,{nodeIds:t}),engines:()=>Je("GET","/api/engines"),codexStatus:(e={})=>Je("GET",`/api/engines/codex/status${e.force?"?force=1":""}`),repairCodexEnv:e=>Je("POST","/api/engines/codex/repair-env",{keys:e}),restoreCodexEnv:()=>Je("POST","/api/engines/codex/restore-env"),installCodex:()=>Je("POST","/api/engines/codex/install"),loginCodex:()=>Je("POST","/api/engines/codex/login"),setCap:(e,t)=>Je("PUT","/api/caps",{engineId:e,capUsd:t}),addNode:e=>Je("POST","/api/nodes",e),cancelNode:e=>Je("POST",`/api/nodes/${e}/cancel`),retryNode:e=>Je("POST",`/api/nodes/${e}/retry`),scenes:()=>Je("GET","/api/scenes"),presenters:()=>Je("GET","/api/presenters"),presenterFrames:e=>Je("GET",`/api/presenter-previews/${e}`),demoProducts:()=>Je("GET","/api/demo-products"),demoProductFrames:e=>Je("GET",`/api/demo-product-previews/${e}`),showcase:()=>Je("GET","/api/showcase"),previewBrief:(e,t,n,r)=>Je("POST","/api/brief/preview",{brief:e,engineId:t,brandId:n,...r?{parentId:r}:{}}),keep:(e,t)=>Je("POST",`/api/nodes/${e}/keep`,{kept:t}),archiveNode:(e,t)=>Je("POST",`/api/nodes/${e}/archive`,{archived:t}),deleteNode:e=>Je("DELETE",`/api/nodes/${e}`),deleteNodesBatch:e=>Je("POST","/api/nodes/delete-batch",{nodeIds:e}),settings:()=>Je("GET","/api/settings"),saveSettings:e=>Je("PUT","/api/settings",e),costs:()=>Je("GET","/api/costs/summary"),home:()=>Je("GET","/api/home"),reveal:()=>Je("POST","/api/system/reveal"),version:()=>Je("GET","/api/version"),updateStatus:()=>Je("GET","/api/update/status"),updateCheck:()=>Je("POST","/api/update/check"),updateApply:()=>Je("POST","/api/update/apply"),updateRestart:()=>Je("POST","/api/update/restart"),desktop:()=>Je("GET","/api/desktop"),phone:(e=!1)=>Je("GET",e?"/api/phone?fresh=1":"/api/phone"),phoneNewCode:()=>Je("POST","/api/phone/code"),phoneHelp:()=>Je("GET","/api/phone/help"),phoneAllow:()=>Je("POST","/api/phone/allow"),desktopInstall:()=>Je("POST","/api/desktop/install"),quit:()=>Je("POST","/api/system/quit"),releaseNotes:()=>Je("GET","/api/release/notes"),releaseSeen:e=>Je("POST","/api/release/seen",{version:e}),sceneFrames:e=>Je("GET",`/api/scene-previews/${e}`),pickSceneView:(e,t)=>Je("POST",`/api/scenes/${e}/views/${t}/pick`),deleteData:e=>Je("DELETE",`/api/data?scope=${e}`),libraryProduct:(e,t)=>Je("GET",`/api/brands/${e}/products-library/${encodeURIComponent(t)}`),productsLibrary:e=>Je("GET",`/api/brands/${e}/products-library`),catalogImport:(e,t,n)=>Je("POST",`/api/brands/${e}/catalog/import`,n?{url:t,urls:n}:{url:t}),catalogScan:(e,t)=>Je("POST",`/api/brands/${e}/catalog/scan`,t?{url:t}:{}),catalogDetails:(e,t)=>Je("POST",`/api/brands/${e}/catalog/details`,{urls:t}),catalogScanState:(e,t,n)=>Je("GET",`/api/brands/${e}/catalog/scans/${t}`,void 0,n),cancelCatalogScan:(e,t)=>Je("POST",`/api/brands/${e}/catalog/scans/${t}/cancel`),catalogJob:(e,t)=>Je("GET",`/api/brands/${e}/catalog/jobs/${t}`),catalogJobs:e=>Je("GET",`/api/brands/${e}/catalog/jobs`),cancelCatalogJob:(e,t)=>Je("POST",`/api/brands/${e}/catalog/jobs/${t}/cancel`),deleteCatalogProduct:(e,t)=>Je("DELETE",`/api/brands/${e}/catalog/products/${t}`),updateProduct:(e,t,n)=>Je("PATCH",`/api/brands/${e}/products/${t}`,n),updateCatalogProduct:(e,t,n)=>Je("PATCH",`/api/brands/${e}/catalog/products/${t}`,n),productSize:(e,t)=>Je("GET",`/api/brands/${e}/products/${t}/size`),setProductSize:(e,t,n)=>Je("PUT",`/api/brands/${e}/products/${t}/size`,{size:n}),setProductShots:(e,t,n)=>Je("PUT",`/api/brands/${e}/products/${t}/shots`,{files:n}),assetBuildCapabilities:()=>Je("GET","/api/asset-builds/capabilities"),startAssetBuild:(e,t)=>Je("POST",`/api/brands/${e}/asset-builds`,t),assetBuild:(e,t)=>Je("GET",`/api/brands/${e}/asset-builds/${t}`),assetBuilds:e=>Je("GET",`/api/brands/${e}/asset-builds`),cancelAssetBuild:(e,t)=>Je("POST",`/api/brands/${e}/asset-builds/${t}/cancel`),deleteAssetBuild:(e,t)=>Je("DELETE",`/api/brands/${e}/asset-builds/${t}`),createProduct:(e,t)=>Je("POST",`/api/brands/${e}/products`,t),createPresenterDraft:(e,t)=>Je("POST",`/api/brands/${e}/presenter-drafts`,t),presenterDrafts:e=>Je("GET",`/api/brands/${e}/presenter-drafts`),presenterDraft:(e,t)=>Je("GET",`/api/brands/${e}/presenter-drafts/${t}`),updatePresenterDraft:(e,t,n)=>Je("PATCH",`/api/brands/${e}/presenter-drafts/${t}`,n),generateDraftView:(e,t,n,r={})=>Je("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/generate`,r),approveDraftView:(e,t,n)=>Je("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/approve`),redoDraftView:(e,t,n)=>Je("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/redo`),revertDraftView:(e,t,n)=>Je("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/revert`),stopDraft:(e,t)=>Je("POST",`/api/brands/${e}/presenter-drafts/${t}/stop`),restoreDraftView:(e,t,n,r)=>Je("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/restore`,{hash:r}),placeDraftPhoto:(e,t,n,r)=>Je("POST",`/api/brands/${e}/presenter-drafts/${t}/views/${n}/use-photo`,{hash:r}),savePresenterDraft:(e,t)=>Je("POST",`/api/brands/${e}/presenter-drafts/${t}/save`),deletePresenterDraft:(e,t)=>Je("DELETE",`/api/brands/${e}/presenter-drafts/${t}`),createPresenter:(e,t)=>Je("POST",`/api/brands/${e}/presenters`,t),updatePresenter:(e,t,n)=>Je("PATCH",`/api/brands/${e}/presenters/${t}`,n),deletePresenter:(e,t)=>Je("DELETE",`/api/brands/${e}/presenters/${t}`),duplicatePresenter:(e,t,n)=>Je("POST",`/api/brands/${e}/presenters/${t}/duplicate`,{name:n}),editPresenter:(e,t)=>Je("POST",`/api/brands/${e}/presenters/${t}/edit`),revertPresenter:(e,t)=>Je("POST",`/api/brands/${e}/presenters/${t}/revert`),createScene:(e,t)=>Je("POST",`/api/brands/${e}/scenes`,t),updateScene:(e,t,n)=>Je("PATCH",`/api/brands/${e}/scenes/${t}`,n),deleteScene:(e,t)=>Je("DELETE",`/api/brands/${e}/scenes/${t}`),sceneExamples:(e,t)=>Je("GET",`/api/brands/${e}/scenes/${t}/examples`),drawSceneExamples:(e,t,n)=>Je("POST",`/api/brands/${e}/scenes/${t}/examples`,n),stopSceneExamples:(e,t)=>Je("POST",`/api/brands/${e}/scenes/${t}/examples/stop`),removeSceneExample:(e,t,n)=>Je("DELETE",`/api/brands/${e}/scenes/${t}/examples/${n}`),generateScenePreview:(e,t)=>Je("POST",`/api/brands/${e}/scenes/${t}/preview`),rereadScene:(e,t,n)=>Je("POST",`/api/brands/${e}/scenes/${t}/reread`,{correction:n}),startSceneStudioJob:(e,t)=>Je("POST",`/api/brands/${e}/scene-studio/jobs`,t),sceneStudioJob:(e,t)=>Je("GET",`/api/brands/${e}/scene-studio/jobs/${t}`),cancelSceneStudioJob:(e,t)=>Je("POST",`/api/brands/${e}/scene-studio/jobs/${t}/cancel`),labelSceneStudioJob:(e,t,n)=>Je("POST",`/api/brands/${e}/scene-studio/jobs/${t}/label`,{label:n}),attachSceneStudioJob:(e,t,n)=>Je("POST",`/api/brands/${e}/scene-studio/jobs/${t}/attach`,{sceneId:n})},M6="scenri:guide-heading",EK=["first-shot","refine","product","presenter","scene","reuse"],CK=e=>EK.includes(e);function jK(){try{const e=typeof window>"u"?null:window.sessionStorage.getItem(M6);if(!e)return null;if(e.startsWith("{")){const t=JSON.parse(e);return typeof t.brandId=="string"&&CK(t.task)?{brandId:t.brandId,task:t.task}:null}return{brandId:e,task:"first-shot"}}catch{return null}}function AA(e){try{e?window.sessionStorage.setItem(M6,JSON.stringify(e)):window.sessionStorage.removeItem(M6)}catch{}}const AK={loaded:!1,heading:null,eligible:!1,welcome:null,hidden:!0,done:{},lessons:{},progress:{},dismissed:[],active:null,activeNodes:[],activeDraftId:null,counts:null};let Ka={...AK,heading:jK()},L3=null,Bg=null,$3=!1;const R6=new Set;function rc(e){Ka=e;for(const t of R6)t()}function NA(e){const t=e;return{...t,lessons:t.lessons??{},progress:t.progress??{},loaded:!0,heading:Ka.heading}}function qh(){return Bg??(Bg=je.guide().then(e=>rc(NA(e))).catch(()=>{Ka.loaded||rc({...Ka,loaded:!0})}).finally(()=>{Bg=null})),Bg}function NK(){return!$3&&typeof document<"u"&&($3=!0,document.addEventListener("visibilitychange",()=>{!document.hidden&&Ka.loaded&&qh()})),L3??(L3=qh()),L3}function Ug(){return qh()}function MK(e,t){var n,r;return"welcome"in t?{...e,welcome:t.welcome}:"hidden"in t?{...e,hidden:t.hidden}:"finish"in t?{...e,lessons:e.lessons[t.finish]?e.lessons:{...e.lessons,[t.finish]:new Date().toISOString()},...((n=e.active)==null?void 0:n.task)===t.finish?{active:null,activeNodes:[],activeDraftId:null}:{}}:"dismiss"in t?{...e,dismissed:e.dismissed.includes(t.dismiss)?e.dismissed:[...e.dismissed,t.dismiss],...((r=e.active)==null?void 0:r.task)===t.dismiss?{active:{...e.active,paused:!0}}:{}}:e}function Bl(e){const t=Ka;return rc(MK(Ka,e)),je.guideIntent(e).then(n=>rc(NA(n))).catch(()=>{rc(t),qh()})}function RK(e){return R6.add(e),()=>R6.delete(e)}const MA=e=>`scenri:guide-via-bar:${e}`,P6=(e,t)=>t==="first-shot"||t==="reuse"?MA(e):`scenri:guide-via:${e}:${t}`;function RA(e,t){const n={brandId:e,task:t};AA(n),rc({...Ka,heading:n})}function L6(){AA(null),Ka.heading&&rc({...Ka,heading:null})}function Nh(){return Ka}function Fv(){return s.useSyncExternalStore(RK,Nh)}const pt={root:"/",setup:"/setup",brand:"/:brandSlug",kit:"/:brandSlug/kit",products:"/:brandSlug/products",product:"/:brandSlug/products/:productId",scenes:"/:brandSlug/scenes",sceneStudio:"/:brandSlug/scenes/new/:convoId?",scene:"/:brandSlug/scenes/:sceneId",sceneEdit:"/:brandSlug/scenes/:sceneId/edit/:convoId?",presenters:"/:brandSlug/presenters",presenterStudio:"/:brandSlug/presenters/new/:draftId?",presenter:"/:brandSlug/presenters/:presenterId",presenterEdit:"/:brandSlug/presenters/:presenterId/edit",hub:"/:brandSlug/create",hubShot:"/:brandSlug/create/shots/:shotId",set:"/:brandSlug/sets/:setSlug",setShot:"/:brandSlug/sets/:setSlug/shots/:shotId",legacy:"/b/*",notFound:"*"},Eo=e=>xs(pt.brand,{brandSlug:e.slug}),Du=e=>xs(pt.products,{brandSlug:e.slug}),ga=(e,t)=>xs(pt.product,{brandSlug:e.slug,productId:t}),qi=e=>xs(pt.scenes,{brandSlug:e.slug}),Ir=(e,t)=>xs(pt.scene,{brandSlug:e.slug,sceneId:t}),Xi=(e,t)=>xs(pt.sceneStudio,{brandSlug:e.slug,convoId:t??void 0}),_v=(e,t,n)=>xs(pt.sceneEdit,{brandSlug:e.slug,sceneId:t,convoId:n??void 0}),Xo=e=>xs(pt.presenters,{brandSlug:e.slug}),xa=(e,t)=>xs(pt.presenter,{brandSlug:e.slug,presenterId:t}),Qi=(e,t)=>xs(pt.presenterStudio,{brandSlug:e.slug,draftId:t??void 0}),lm=(e,t)=>xs(pt.presenterEdit,{brandSlug:e.slug,presenterId:t}),yr=e=>xs(pt.hub,{brandSlug:e.slug}),g0=(e,t)=>xs(pt.set,{brandSlug:e.slug,setSlug:t.slug}),cm=(e,t,n)=>t?xs(pt.setShot,{brandSlug:e.slug,setSlug:t.slug,shotId:n}):xs(pt.hubShot,{brandSlug:e.slug,shotId:n});function PK(e,t=""){const[,,n,...r]=e.split("/");if(!n)return pt.root;const a=`/${n}${LK(r)}`;return t?a+t:a}function LK(e){const[t,n,r,a]=e;return t==="create"?r&&n==="n"?`/create/shots/${r}`:"/create":t==="s"&&n?a&&r==="n"?`/sets/${n}/shots/${a}`:`/sets/${n}`:t==="brand"?"/kit":t==="p"?"/create":t==="n"&&n?`/create/shots/${n}`:e.length?`/${e.join("/")}`:""}const Wg="Scenri",T3=" - ",D3=40,$K=[["whatsnew","What's new"],["setup","Providers"],["settings","Settings"]],TK=[[pt.setup,"Set up",!1],[pt.hubShot,"Shot",!1],[pt.setShot,"Shot",!1],[pt.hub,"Create",!1],[pt.set,"Create",!0],[pt.kit,"Brand kit",!1],[pt.product,"Products",!0],[pt.products,"Products",!1],[pt.scene,"Scenes",!0],[pt.scenes,"Scenes",!1],[pt.presenter,"Presenters",!0],[pt.presenters,"Presenters",!1],[pt.brand,"Home",!1]];function DK(e){if(!e)return null;const t=e.replace(/[\u0000-\u001F\u007F-\u009F]/g," ").replace(/\s+/g," ").trim();return t?t.length>D3?`${t.slice(0,D3-1).trimEnd()}…`:t:null}function HK(e,t="",n=null){const r=new URLSearchParams(t);for(const[a,i]of $K)if(r.has(a))return i+T3+Wg;for(const[a,i,l]of TK)if(tl(a,e))return((l?DK(n):null)??i)+T3+Wg;return Wg}const PA=s.createContext(null);function OK(){const{pathname:e,search:t}=Wn(),[n,r]=s.useState(null);return s.useEffect(()=>{document.title=HK(e,t,n)},[e,t,n]),r}function $c(e){const t=s.useContext(PA);s.useEffect(()=>{if(t)return t(e??null),()=>t(null)},[t,e])}const IK={scenes:[],collections:[],verticals:[],loaded:!1,error:!1};function FK(){const[e,t]=s.useState(IK),[n,r]=s.useState(0);s.useEffect(()=>{let i=!0;return je.scenes().then(l=>{yK(l.scenes),i&&t({scenes:l.scenes,collections:l.collections,verticals:l.verticals,loaded:!0,error:!1})}).catch(()=>{i&&t(l=>({...l,loaded:!0,error:!0}))}),()=>{i=!1}},[n]);const a=s.useCallback(()=>{t(i=>({...i,loaded:!1,error:!1})),r(i=>i+1)},[]);return{...e,refetch:a}}const _K={presenters:[],categories:[],styles:[],loaded:!1,error:!1};function VK(){const[e,t]=s.useState(_K),[n,r]=s.useState(0);s.useEffect(()=>{let i=!0;return je.presenters().then(l=>{i&&t({presenters:l.presenters,categories:l.categories,styles:l.styles,loaded:!0,error:!1})}).catch(()=>{i&&t(l=>({...l,loaded:!0,error:!0}))}),()=>{i=!1}},[n]);const a=s.useCallback(()=>{t(i=>({...i,loaded:!1,error:!1})),r(i=>i+1)},[]);return{...e,refetch:a}}const ZK={demoProducts:[],categories:[],loaded:!1,error:!1};function zK(){const[e,t]=s.useState(ZK),[n,r]=s.useState(0);s.useEffect(()=>{let i=!0;return je.demoProducts().then(l=>{i&&t({demoProducts:l.demoProducts,categories:l.categories,loaded:!0,error:!1})}).catch(()=>{i&&t(l=>({...l,loaded:!0,error:!0}))}),()=>{i=!1}},[n]);const a=s.useCallback(()=>{t(i=>({...i,loaded:!1,error:!1})),r(i=>i+1)},[]);return{...e,refetch:a}}const BK={showcase:[],categories:[],loaded:!1,error:!1};function UK(){const[e,t]=s.useState(BK),[n,r]=s.useState(0);s.useEffect(()=>{let i=!0;return je.showcase().then(l=>{i&&t({showcase:l.showcase,categories:l.categories,loaded:!0,error:!1})}).catch(()=>{i&&t(l=>({...l,loaded:!0,error:!0}))}),()=>{i=!1}},[n]);const a=s.useCallback(()=>{t(i=>({...i,loaded:!1,error:!1})),r(i=>i+1)},[]);return{...e,refetch:a}}const nh=[{id:"brand",label:"Brand kit",Icon:VO,scope:"brand",sub:e=>`What every shot for ${e} can draw on.`},{id:"usage",label:"Usage",Icon:jO,scope:"brand",sub:e=>`What ${e} has made, one square per day.`},{id:"engines",label:"Providers",Icon:O0,scope:"studio",sub:()=>"Where your images are made, and what each may spend."},{id:"appearance",label:"Appearance",Icon:NO,scope:"studio",sub:()=>"How Scenri looks on this device."},{id:"library",label:"Library",Icon:_4,scope:"studio",sub:()=>"Your work, as plain files on this computer. Back them up like anything else."},{id:"phone",label:"Local access",Icon:MO,scope:"studio",sub:()=>"Open Scenri on your phone, tablet or another computer, or from your desktop."},{id:"updates",label:"Updates",Icon:Ih,scope:"studio",sub:()=>"How this copy of Scenri stays current."},{id:"about",label:"About",Icon:$p,scope:"studio",sub:()=>"The copy of Scenri you are running."},{id:"danger",label:"Danger zone",Icon:Dp,scope:"apart",sub:()=>"These do not come back. Export from Library first if you are not certain."}],LA={brand:"brand",usage:"usage",engines:"engines",budget:"engines",general:"appearance",appearance:"appearance",library:"library",phone:"phone",updates:"updates",about:"about",danger:"danger"},WK="index",$A=e=>e!==null&&Object.prototype.hasOwnProperty.call(LA,e),KK=e=>$A(e)?LA[e]:"brand",GK=e=>!$A(e);function gl(){const{open:e}=Vr("settings");return s.useCallback(t=>e(t??WK),[e])}function YK(){const{open:e}=Vr("welcome");return s.useCallback(()=>e("1"),[e])}const $6={current:null};function TA(){const{open:e}=Vr("learn");return s.useCallback((t="lessons")=>e(t),[e])}const H3="codex-cli";function vl(){const{open:e}=Vr("setup");return s.useCallback((t=H3)=>{e(typeof t=="string"?t:H3)},[e])}function qK(e){var t;e.preventDefault(),(t=e.currentTarget)==null||t.focus({preventScroll:!0})}function DA({failure:e,density:t,onRetry:n,dismiss:r}){const a=gl(),i=vl(),{remedy:l}=e,u=t==="tile",f=()=>{l&&(l.opens==="setup"?i("codex-cli"):a(l.opens))},h=n&&e.retryable,p=w=>u?`sc-s${w?" sc-s-primary":""}`:`sc-btn ${w?"sc-btn-primary":"sc-btn-ghost"}`,g=!u&&!!e.fix,v=!u&&!!e.raw;return o.jsxs("div",{className:"sc-fail","data-density":t,"data-kind":e.kind,"data-long":e.title.length>90||void 0,role:"alert",children:[o.jsx("span",{className:"sc-fail-ic","aria-hidden":!0,children:o.jsx(xc,{size:u?15:21,weight:"fill"})}),o.jsxs("div",{className:"sc-fail-txt",children:[o.jsx("b",{children:e.title}),g&&o.jsx("small",{children:e.fix})]}),(l||h||r)&&o.jsxs("div",{className:"sc-fail-acts",children:[l&&o.jsx("button",{type:"button",className:p(!0),onClick:f,children:l.label}),h&&o.jsxs("button",{type:"button",className:p(!l),onClick:n,children:[o.jsx(H0,{size:u?12:14})," Try again"]}),r&&o.jsx("button",{type:"button",className:"sc-fail-alt",onClick:r.onClick,children:r.label})]}),v&&o.jsxs("details",{className:"sc-fail-raw",children:[o.jsx("summary",{children:"Details"}),o.jsx("pre",{children:e.raw})]})]})}function Vv({failure:e,action:t,tone:n="error"}){return o.jsx("div",{className:"sc-failrow","data-tone":n,role:n==="error"?"alert":"status",children:o.jsxs("div",{className:"sc-banner","data-tone":n==="error"?"error":void 0,children:[o.jsx("span",{className:"sc-banner-ic",children:n==="error"?o.jsx(xc,{size:16,weight:"fill"}):o.jsx($p,{size:16,weight:"fill"})}),o.jsxs("span",{className:"sc-banner-txt",children:[o.jsx("b",{children:e.title}),e.fix&&o.jsx("small",{children:e.fix})]}),t]})})}function HA(e){return{get(t){try{return e().getItem(t)}catch{return null}},set(t,n){try{e().setItem(t,n)}catch{}},del(t){try{e().removeItem(t)}catch{}},keys(t){try{const n=e(),r=[];for(let a=0;a<n.length;a++){const i=n.key(a);i!=null&&i.startsWith(t)&&r.push(i)}return r}catch{return[]}}}}const xr=HA(()=>localStorage),Tc=HA(()=>sessionStorage),OA=720*60*60*1e3;function IA(e){return e?e.phase==="ready"?e.blockReason!=="dev"&&e.blockReason!=="unsupervised"&&e.blockReason!=="launcher-too-old":e.canApply:!1}function XK(e){return!!(e!=null&&e.available)&&e.blockReason!=="dev"}function QK(e){return e.phase==="staging"?{kind:"downloading"}:e.phase==="ready"?{kind:"ready",version:e.stagedVersion??e.latest??e.current}:e.phase==="error"&&e.available?{kind:"stage-error"}:{kind:"announce",oneClick:IA(e)}}const JK=1800*1e3,O3=300*1e3,Kg=e=>new Promise(t=>setTimeout(t,e)),FA="scenri:update-dismissed",eG=()=>Tc.get(FA),tG=e=>Tc.set(FA,e),_A=s.createContext(null);function um(){const e=s.useContext(_A);if(!e)throw new Error("useUpdateCenter must be used inside UpdateCenterProvider");return e}function nG({children:e}){const[t,n]=s.useState(null),[r,a]=s.useState(!1),[i,l]=s.useState(eG),u=s.useRef(void 0),[f,h]=s.useState(!1);s.useEffect(()=>{let R=!0;return je.version().then($=>R&&h($.thisComputer===!0)).catch(()=>{}),()=>{R=!1}},[]),s.useEffect(()=>{let R=!0;const $=async()=>{if(R){if(!document.hidden)try{const D=await je.updateStatus();R&&n(D)}catch{}R&&(u.current=window.setTimeout($,JK))}};$();const H=()=>{document.hidden||!R||(window.clearTimeout(u.current),$())};return document.addEventListener("visibilitychange",H),window.addEventListener("focus",H),()=>{R=!1,window.clearTimeout(u.current),document.removeEventListener("visibilitychange",H),window.removeEventListener("focus",H)}},[]);const[p,g]=s.useState(null),v=s.useCallback(async()=>{a(!0);try{n(await je.updateCheck()),g(null)}catch(R){g(String((R==null?void 0:R.message)??R))}finally{a(!1)}},[]),w=s.useCallback(()=>{const R=t==null?void 0:t.latest;R&&(tG(R),l(R))},[t]),b=(t==null?void 0:t.latest)!=null&&t.latest===i,[y,k]=s.useState("idle"),[S,E]=s.useState(null),j=s.useCallback(async R=>{k("restarting");try{await je.updateRestart()}catch(H){if(typeof H.status=="number"){k("idle"),E(String((H==null?void 0:H.message)??H));return}}const $=Date.now()+3e4;for(;Date.now()<$;){await Kg(800);try{if((await je.version()).version!==R){location.reload();return}}catch{}}k("idle"),E("The restart did not complete. Check the terminal Scenri runs in.")},[]),N=s.useCallback(async()=>{if(y!=="idle")return null;try{await je.quit()}catch(R){if(typeof R.status=="number")return String((R==null?void 0:R.message)??R)}return window.close(),setTimeout(()=>{window.closed||location.replace("about:blank")},300),null},[y]),A=s.useCallback(async()=>{if(y!=="idle")return;E(null);const R=t==null?void 0:t.current;try{if((t==null?void 0:t.phase)!=="ready"){k("applying"),await je.updateApply();const $=Date.now()+O3;let H=!1;for(;Date.now()<$;){await Kg(1500);const D=await je.updateStatus();if(n(D),D.phase==="ready"){H=!0;break}if(D.phase==="error"){E(D.error??"The update could not be staged."),k("idle");return}}if(!H){E("Couldn't download the update. Try again."),k("idle");return}}await j(R)}catch($){E(String(($==null?void 0:$.message)??$)),k("idle")}},[y,t,j]),T=s.useRef(!1);s.useEffect(()=>{if((t==null?void 0:t.phase)!=="staging"||y!=="idle"||T.current)return;T.current=!0;let R=!0;const $=Date.now()+O3;return(async()=>{for(;R&&Date.now()<$;){if(await Kg(1500),!R)return;try{const D=await je.updateStatus();if(!R||(n(D),D.phase!=="staging"))return}catch{}}})().finally(()=>{T.current=!1}),()=>{R=!1}},[t==null?void 0:t.phase,y]);const{pathname:P}=Wn(),C=P===pt.setup;return o.jsxs(_A.Provider,{value:{status:t,checking:r,checkNow:v,checkError:p,dismissed:b,dismiss:w,apply:A,quit:N,thisComputer:f,busy:y,applyError:S},children:[e,y!=="restarting"&&f&&XK(t)&&!b&&!C&&o.jsx(aG,{}),y==="restarting"&&o.jsx(rG,{version:(t==null?void 0:t.stagedVersion)??(t==null?void 0:t.latest)??null})]})}function rG({version:e}){return o.jsxs(sG,{children:[o.jsx(IE,{size:22}),o.jsx("b",{children:e?`Updating to Scenri ${e}`:"Updating Scenri"}),o.jsx("small",{children:"Restarting. This page reconnects by itself."})]})}function sG({children:e,className:t}){return _r.createPortal(o.jsx("div",{className:t?`sc-upd-overlay ${t}`:"sc-upd-overlay",role:"status","aria-live":"polite",children:o.jsx("div",{className:"sc-upd-overlay-card",children:e})}),document.body)}function aG(){const{status:e,dismiss:t,apply:n,busy:r,applyError:a}=um(),i=gl();if(!e)return null;const l=QK(e),u=l.kind==="downloading"?"Downloading update…":l.kind==="ready"?`Scenri ${l.version} is ready`:l.kind==="stage-error"?"Couldn't download the update":"A new update is available",f=r==="applying"?"Updating…":l.kind==="stage-error"?"Try again":"Update",h=l.kind!=="announce"||l.oneClick;return o.jsxs("div",{className:"sc-upd-float",role:"status",children:[o.jsx(PO,{className:"sc-upd-float-dot",size:16,weight:"fill","aria-hidden":"true"}),o.jsxs("span",{className:"sc-upd-float-txt",children:[u,a&&l.kind!=="downloading"&&o.jsx("small",{children:a})]}),o.jsx("button",{type:"button",className:"sc-upd-float-later",onClick:t,children:l.kind==="ready"?"Later":"Not now"}),l.kind!=="downloading"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:r!=="idle",onClick:()=>h?void n():i("updates"),children:f})]})}function oG(e,t){return!e||t.updatedAt>=e.updatedAt}function iG(e,t){const n=e.findIndex(a=>a.id===t.id);if(n<0||e[n]===t||!oG(e[n],t))return e;const r=e.slice();return r[n]=t,r}function lG(e,t,n){if(!e)return t;const r=new Map(e.map(l=>[l.id,l]));let a=e.length===t.length;const i=t.map((l,u)=>{const f=r.get(l.id),h=f&&n.has(l.id)&&!(l.updatedAt>f.updatedAt)?f:l;return h!==e[u]&&(a=!1),h});return a?e:i}const Zv=(e,t)=>`scenri:new-${e}-${t}`,cG=e=>Tc.get(e),uG=(e,t)=>Tc.set(e,t);function v0(e){Tc.del(e),xr.del(e)}function Gg(e){var t,n,r;return!!((t=e.name)!=null&&t.trim())||!!((n=e.instruction)!=null&&n.trim())||!!((r=e.importUrl)!=null&&r.trim())||(e.facets??[]).length>0||(e.imageHashes??[]).length>0}const I3=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):[];function VA(e,t){const n=Zv(e,t),r=cG(n);if(!r)return null;let a;try{a=JSON.parse(r)}catch{return v0(n),null}if(typeof a!="object"||a===null)return v0(n),null;const i=a;if(i.v!==1||i.brandId!==e||i.kind!==t)return v0(n),null;const l=Date.now()-Date.parse(i.updatedAt??"");return!Number.isFinite(l)||l>OA?(v0(n),null):{v:1,brandId:e,kind:t,updatedAt:i.updatedAt,name:typeof i.name=="string"?i.name:"",instruction:typeof i.instruction=="string"?i.instruction:"",facets:I3(i.facets),imageHashes:I3(i.imageHashes),importUrl:typeof i.importUrl=="string"?i.importUrl:"",pending:typeof i.pending=="string"?i.pending:null}}function Yg(e,t,n){const r={v:1,brandId:e,kind:t,updatedAt:new Date().toISOString(),name:n.name??"",instruction:n.instruction??"",facets:n.facets??[],imageHashes:n.imageHashes??[],importUrl:n.importUrl??"",pending:n.pending??null};uG(Zv(e,t),JSON.stringify(r))}function xu(e,t){v0(Zv(e,t))}function dG(e,t,n){const r=VA(e,t);(r==null?void 0:r.pending)===n&&xu(e,t)}function fG(e,t){if(!e)return!1;if(e.pending===null)return!0;const n=t??"unknown";return n==="failed"||n==="cancelled"||n==="unknown"}const ZA="the engine",hG=[{re:/Codex plan's usage limit is used up/i,kind:"credit",title:()=>"",remedy:{label:"Use a provider key instead",opens:"engines"},retryable:!1},{re:/environment is overriding that sign-in/i,kind:"auth",title:()=>"An API key on this computer is overriding your Codex sign-in.",fix:"Tell Scenri to ignore it, then run this again.",remedy:{label:"Fix this",opens:"setup"},retryable:!0},{re:/codex.*(not logged in|login required|\b401\b|unauthorized|token.*expired)/i,kind:"auth",title:()=>"Codex is signed out on this machine.",fix:"Sign in with your ChatGPT account, then run this again.",remedy:{label:"Sign in",opens:"setup"},retryable:!1},{re:/HTTP 401\b|missing authentication|no auth credentials|invalid api key|unauthorized/i,kind:"auth",title:e=>`${io(e)} did not accept your API key.`,fix:"Add or replace the key, then run this again.",remedy:{label:"Add key",opens:"engines"},retryable:!1},{re:/HTTP 403\b|forbidden/i,kind:"auth",title:e=>`${io(e)} refused this key.`,fix:"It may not cover the model this shot asked for.",remedy:{label:"Check key",opens:"engines"},retryable:!1},{re:/spend cap for .*would exceed it|spend cap for/i,kind:"budget",title:e=>`This would go past your monthly cap for ${e}.`,fix:"Raise the cap, or wait for the month to roll over.",remedy:{label:"Open budget",opens:"budget"},retryable:!1},{re:/HTTP 402\b|insufficient (credit|funds|balance)|out of credit|billing|payment required/i,kind:"credit",title:e=>`${io(e)} is out of credit.`,fix:"Top up with the provider, then run this again.",retryable:!0},{re:/HTTP 429\b|rate.?limit|too many requests/i,kind:"rate",title:e=>`${io(e)} is rate limiting this key.`,fix:"Give it a minute, then try again.",retryable:!0},{re:/moderation|content policy|safety system|flagged|violat(es|ion)|blocked by/i,kind:"policy",title:e=>`${io(e)} declined this brief.`,fix:"Reword what you asked for and run it again.",retryable:!1},{re:/cannot carry enough reference images/i,kind:"references",title:()=>"",remedy:{label:"Choose engine",opens:"engines"},retryable:!1},{re:/no usable photo/i,kind:"references",title:()=>"",retryable:!1},{re:/cannot produce the requested aspect ratio|engine returned \d+x\d+ for a \d+x\d+ request/i,kind:"format",title:e=>`${io(e)} cannot make this shape.`,fix:"Pick another format, or an engine that can.",remedy:{label:"Choose engine",opens:"engines"},retryable:!1},{re:/HTTP 404\b|model not found|no endpoints found|no allowed providers/i,kind:"model",title:e=>`${io(e)} has no model for this shot.`,fix:"Pick another engine in the composer, or connect one in Providers.",remedy:{label:"Providers",opens:"engines"},retryable:!1},{re:/failed to spawn codex|codex.*enoent|command not found/i,kind:"setup",title:()=>"Codex is not installed on this machine.",fix:"Run setup once and this works from then on.",remedy:{label:"Set up Codex",opens:"setup"},retryable:!1},{re:/code-mode host/i,kind:"setup",title:()=>"Codex could not start its tool host.",fix:"A Windows setting is blocking it. Set SafeDllSearchMode to 1 and restart Windows.",retryable:!1},{re:/could not verify codex/i,kind:"setup",title:()=>"Scenri could not verify Codex.",fix:"Open setup and check again. If Codex was just installed, restart Scenri.",remedy:{label:"Check Codex",opens:"setup"},retryable:!0},{re:/codex cli .* is too old|Scenri needs \d+\.\d+\.\d+ or newer/i,kind:"setup",title:()=>"Codex CLI needs an update.",fix:"Update Codex, then run this again.",remedy:{label:"Update Codex",opens:"setup"},retryable:!1},{re:/\brun aborted\b/i,kind:"cancelled",title:()=>"You stopped this shot.",fix:"The prompt is kept. Run it again whenever.",retryable:!0},{re:/produced no output for \d+s/i,kind:"timeout",title:()=>"Codex never started answering.",fix:"Try again. If it keeps happening, run Codex once in a terminal to check it still works.",retryable:!0},{re:/Codex CLI timed out after/i,kind:"timeout",title:()=>"Codex ran out of time on this shot.",fix:"Try again. Fewer variants or fewer reference photos finish faster.",retryable:!0},{re:/generation timed out after \d+ minutes?/i,kind:"timeout",title:()=>"This run hit the overall time limit.",fix:"Try again, with fewer variants if it repeats.",retryable:!0},{re:/timed out|ETIMEDOUT/i,kind:"timeout",title:e=>`${io(e)} took too long to answer.`,fix:"Try again.",retryable:!0},{re:/ENOTFOUND|ECONNREFUSED|ECONNRESET|EAI_AGAIN|fetch failed|network error/i,kind:"network",title:e=>`Could not reach ${e}.`,fix:"Check your connection, then try again.",retryable:!0},{re:/interrupted\W+server restarted/i,kind:"restarted",title:()=>"Scenri restarted while this was rendering.",fix:"The shot was lost, not the brief. Run it again.",retryable:!0},{re:/HTTP 5\d\d\b|internal server error|bad gateway|service unavailable|overloaded|upstream/i,kind:"server",title:e=>`${io(e)} had a problem on its end.`,fix:"Nothing wrong on your side. Try again shortly.",retryable:!0},{re:/produced no images|returned no image|no images returned|finished but produced no/i,kind:"empty",title:e=>`${io(e)} finished without making a picture.`,fix:"Run it again. This usually clears on a second try.",retryable:!0}];function io(e){return e===ZA?"The engine":e}function eo(e,t){const n=(e??"").trim(),r=(t??"").replace(/\s*\(BYOK\)\s*$/i,"").trim()||ZA;if(!n)return{kind:"unknown",title:"This shot did not finish.",raw:"",retryable:!0};for(const a of hG){if(!a.re.test(n))continue;const i=a.title(r)||pG(n);return{kind:a.kind,title:i,fix:a.fix,raw:n,remedy:a.remedy,retryable:a.retryable}}return{kind:"unknown",title:"This shot did not finish.",raw:n,retryable:!0}}function zA(){return{kind:"cancelled",title:"You stopped this shot.",fix:"The prompt is kept. Run it again whenever.",raw:"",retryable:!0}}function ln(e,t,n){const r=e instanceof Error?e.message:typeof e=="string"?e:String((e==null?void 0:e.message)??e),a=eo(r,n),i=a.kind==="unknown"?a.raw||void 0:[a.title,a.fix].filter(Boolean).join(" ");return{kind:"error",title:t,detail:i}}function pG(e){const t=e.trim();if(!t)return t;const n=t[0].toUpperCase()+t.slice(1);return/[.!?]$/.test(n)?n:`${n}.`}const dm=[{id:"portrait",tier:"core",gate:!0,from:[],strip:"Face",name:"face"},{id:"front",tier:"core",gate:!0,from:["portrait"],strip:"Full body",name:"full body"},{id:"three-quarter",tier:"core",from:["portrait","front"],strip:"Three-quarter",name:"three-quarter view"},{id:"back",tier:"supplementary",from:["portrait","front"],strip:"Back",name:"back view"},{id:"left",tier:"supplementary",from:["portrait","front"],strip:"Left",name:"left view"},{id:"right",tier:"supplementary",from:["portrait","front"],strip:"Right",name:"right view"}],$f=e=>dm.filter(e).map(t=>t.id),BA=$f(()=>!0),mG=$f(e=>e.tier==="core"),UA=$f(e=>e.tier==="supplementary"),dc=Object.fromEntries(dm.map(e=>[e.id,e.strip])),xn=Object.fromEntries(dm.map(e=>[e.id,e.name])),sc=e=>xn[e],WA=Object.fromEntries(dm.map(e=>[e.id,e.from])),T6=new Set($f(e=>e.gate===!0)),Zo=e=>T6.has(e)?void 0:"auto",N0=4,F3=25*1024*1024,Qo=e=>$f(t=>{var n;return t.tier==="core"||!!e.extras||((n=e.views[t.id])==null?void 0:n.status)!=="empty"});function fm(e){return Qo(e).find(t=>e.views[t].status!=="approved")??null}const gG=e=>fm(e)===null,Jo=e=>e.views.portrait.status==="approved"||!!e.views.portrait.prior,fc=e=>e.stage!=="idle"||!!e.activeView;function KA(e){if(fc(e))return null;const t=fm(e);if(!t)return null;const n=e.views[t];return n.status!=="empty"&&n.status!=="stale"||n.error?null:WA[t].every(r=>e.views[r].status==="approved")?t:null}function GA(e,t){return t??(fc(e)?e.activeView:null)??fm(e)??"portrait"}function YA(e,t){return Qo(e).map(n=>{const r=e.views[n],a=n===t?"current":r.status==="approved"?"approved":r.status==="stale"?"stale":"todo";return{view:n,label:dc[n],state:a,hash:r.hash,photo:r.origin==="photo",drawing:e.activeView===n,approved:r.status==="approved",error:!!r.error}})}const vG={woman:"a woman",man:"a man",androgynous:"an androgynous person"},wG={woman:"her",man:"his",androgynous:"their"},Xh=/\b(wom[ae]n|m[ae]n|male|female|lady|ladies|girl|boy|guy|gentlem[ae]n|nonbinary|non-binary|androgynous|masculine|feminine|transgender|trans|mother|father|mum|mom|dad|sister|brother|daughter|son|grandmother|grandfather|she|he|her|his)\b/i,yG=/^(my|a|an|the|this|that|is|it|its|their|there|hey|hi|hello|yo|ok|okay|please|thanks|thank|you|your|dear|bro|bruh|dude|mate|sir|maam|madam|just|like|some)$/i;function bG(e){const t=e.trim().split(/[^\p{L}\p{N}']+/u).filter(Boolean);return t.some(n=>Xh.test(n))?t.every(n=>yG.test(n)||Xh.test(n)):!1}const zv=/\b(\d0s|\d{2}\s*(years|yo)|teen|twenties|thirties|forties|fifties|sixties|seventies|elderly|young|old(er)?|middle-aged|adult)\b/i,xG=120,kG=18;function SG(e){const t=e.match(/\d+/g);return t!=null&&t.length?t.every(n=>{const r=Number(n);return r>=kG&&r<=xG}):!1}const EG=/\b(hair|bald|shaved|buzz|blonde?|brunette|redhead|ginger|greying|silver|auburn|platinum)\b/i,CG=/\b(skin|complexion|fair|pale|light|olive|tan|tanned|brown|deep|dark|ebony|black|white|freckled|golden)\b/i,jG=/\b(wom[ae]n|m[ae]n|male|female|lady|ladies|girl|boy|guy|guys|gentlem[ae]n|nonbinary|non-binary|androgynous|masculine|feminine|transgender|trans|mother|father|mum|mom|dad|sister|brother|daughter|son|grandmother|grandfather|person|people|someone|somebody|model|teen|teenager|kid|child|adult|senior)\b/i,AG=/\b(hair|haired|curly|wavy|straight|braids?|bob|ponytail|bun|fringe|bangs|beard|beardless|moustache|mustache|stubble|goatee|clean-shaven|freckles?|glasses|spectacles|tattoos?|piercings?|eyes?|eyebrows?|brows|jaw|jawline|cheekbones|nose|lips|mouth|smile|smiling|face|features|forehead|dimples|scar|wrinkles|build|figure|frame|body|tall|short|slim|slender|athletic|average|fuller|curvy|broad|lean|muscular|petite|stocky|heavy|thin|plus.size|height|weight|presence|vibe|energy|look|looks|looking|calm|warm|confident|elegant|composed|friendly|serious|intense|soft|gentle|bright|energetic|quiet|poised|relaxed|playful|stern|kind|charming|handsome|beautiful|pretty|striking|rugged|graceful|sporty|nerdy|bookish|professional|corporate|casual|older|younger|taller|shorter|longer|slimmer|leaner|heavier|broader|bigger|smaller|thinner|thicker|softer|sharper|lighter|darker|natural|makeup|make-up|lipstick|jewelry|earrings)\b/i,NG=/\b(mediterranean|asian|indian|chinese|japanese|korean|african|nordic|scandinavian|latin[ao]?|hispanic|arab|arabic|middle eastern|european|caucasian|israeli|jewish|irish|italian|french|spanish|greek|turkish|persian|brazilian|mexican|american|british|german|dutch|russian|polish|thai|vietnamese|filipin[ao]|nigerian|ethiopian|moroccan|egyptian|australian|canadian|swedish|norwegian|danish|finnish|portuguese|indonesian|pakistani|iranian|lebanese|slavic|celtic|mixed|biracial)\b/i,fa=e=>jG.test(e)||zv.test(e)||EG.test(e)||CG.test(e)||AG.test(e)||NG.test(e);function MG(e,t){const n=t.trim();if(!n)return"";const r=[],a=e.steer&&!Xh.test(n)?vG[e.steer]:"";if(a&&r.push(a),e.age&&!zv.test(n)){const l=e.steer?wG[e.steer]:"their",u=e.age==="60+"?`in ${l} 60s or older`:`in ${l} ${e.age}`;r.push(a?u:`someone ${u}`)}const i=[];return i.length&&r.push(`with ${i.join(" and ")}`),r.length?`${r.join(" ")}, ${n}`:n}function RG(e,t){var r;const n=((r=e.analysis)==null?void 0:r.suitableCategories)??[];return!n.length||t.length?null:n}function qA(e){return BA.some(t=>{const n=e.views[t];return!!n.hash&&n.origin!=="photo"&&n.status!=="empty"})}function PG(e,t,n=!0){if(fc(e))return"Still drawing";const r=!n&&e.source==="photos"?["portrait"]:Qo(e);for(const a of r){const i=e.views[a];if(i.status==="candidate")return`Decide on the ${sc(a)} first`;if(i.status==="stale")return`Redo the ${sc(a)} first`;if(i.status!=="approved")return`Use the ${sc(a)} first`}return t.trim()?null:"Give them a name"}const XA=/\b(hair|bald|fringe|bangs|beard|moustache|mustache|stubble|skin|freckles?|complexion|age|older|younger|\d0s|face|facial|jaw|chin|cheek(bone)?s?|nose|eyes?|brows?|eyebrows?|lips?|mouth|teeth|wrinkles?|build|weight|heavier|slimmer|thinner|leaner|broader|muscular|athletic|curvier|taller|shorter|height|gender|woman|man|feminine|masculine|glasses|tattoo|scar)\b/i;function QA(e,t,n){if(!e.trim())return{blocked:"Say what should change."};if(!Jo(n))return n.views.portrait.status!=="candidate"?{blocked:"Nothing to adjust yet."}:{view:"portrait",scope:"identity"};if(t==="portrait"||XA.test(e))return n.source==="photos"?{blocked:"Their photos define who they are. Change a drawn view instead."}:{view:"portrait",scope:"identity"};const a=n.views[t];return a.origin==="photo"?{blocked:"Your photo stands as it is. Pick a drawn view to change."}:a.status!=="approved"&&a.status!=="candidate"?{blocked:`Nothing drawn for the ${sc(t)} yet.`}:{view:t,scope:"view"}}function _3(e,t){return Jo(t)?t.source==="photos"?"Changes this view only. Their photos define who they are.":e==="portrait"?"Changes the person. The other views are redrawn after you use it.":"Changes this view only. Hair, skin, age or build change the person.":"An adjustment keeps this person. Try again rolls a new one."}function LG(e,t,n){const r=e.trim(),a=QA(r||"this",t,n);if("blocked"in a)return r?{chip:null,hint:a.blocked,tone:"alert"}:{chip:null,hint:_3(t,n)};const i=Jo(n)?a.scope==="identity"?"Changing the person":`Refining the ${xn[a.view]}`:"Adjusting the face";return{chip:{view:a.view,label:i},hint:_3(t,n)}}const V3=e=>e.charAt(0).toUpperCase()+e.slice(1);function $G(e,t){var g,v,w,b;if(e.source!=="photos"||e.stage==="analyzing")return null;const n=(g=e.readError)==null?void 0:g.trim();if(n){const y=eo(n);return{text:`The photos could not be read${y.kind!=="unknown"?`. ${y.title}`:`: ${/[.!?]$/.test(n)?n:`${n}.`}`} Their face is drawn from them anyway.`,tone:"warn"}}const r=(w=(v=e.analysis)==null?void 0:v.conflict)==null?void 0:w.trim();if(r)return{text:`These photos may show more than one person: ${r}`,tone:"warn"};const a=((b=e.analysis)==null?void 0:b.photos)??[];if(a.length&&a.every(y=>y.usable===!1))return null;const i=Qo(e),l=i.filter(y=>e.views[y].origin==="photo"),u=i.filter(y=>e.views[y].origin!=="photo"),f=y=>y.length<=2?y.map(sc).join(" and "):`${y.slice(0,-1).map(sc).join(", ")} and ${sc(y[y.length-1])}`,h=l.length?`${V3(f(l))} from your ${l.length===1?"photo":"photos"}.`:"";if(!u.length)return{text:h};if(!t)return{text:[h||"The face is kept from your photo as it is.","The other views need an engine that can draw."].filter(Boolean).join(" ")};const p=u.length>=3&&l.length?"The rest are drawn from them.":`${V3(f(u))} ${u.length===1?"is":"are"} drawn from them.`;return{text:[h,p].filter(Boolean).join(" ")}}const JA=e=>{var t;return(e.activeView?(t=e.views[e.activeView])==null?void 0:t.startedAt:void 0)??e.updatedAt};function eN(e){var r;if(e.stage==="analyzing")return`Reading ${e.source==="photos"?"the photos":"the face"}`;const t=e.activeView;if(!t)return;const n=!!((r=e.views[t])!=null&&r.hash);return t==="portrait"?n?"Adjusting the face":"Drawing the face":`${n?"Redrawing":"Drawing"} the ${xn[t]}`}function Bv(e,t){return tN(t).some(n=>!!e.views[n].hash)}function tN(e){const t=new Set;for(let n=!0;n;){n=!1;for(const r of BA)r===e||t.has(r)||WA[r].some(a=>a===e||t.has(a))&&(t.add(r),n=!0)}return[...t]}function TG(e,t){const n=e.views[t].hash;return n?tN(t).some(r=>{const a=e.views[r];return!!a.hash&&!(a.conditionedOn??[]).includes(n)}):!1}function nN(e,t){const n=new Set,r=[];for(const a of e.results??[])a.view!==t||a.how==="restored"||n.has(a.hash)||(n.add(a.hash),r.push({n:r.length+1,hash:a.hash,current:e.views[t].hash===a.hash}));return r.length>1?r:[]}const DG=["hero","close","hands","angle","bold"],Za={hero:"Hero",close:"Close-up",hands:"Hands",angle:"Another angle",bold:"A bold one"},Hu={place:"Place",hero:"Hero",close:"Close-up",hands:"Hands",angle:"Angle",bold:"Bold"},Z3={hero:"hero",close:"close-up",hands:"hands",angle:"other angle",bold:"bold one"},rN=(e,t)=>!!e&&e.status==="running"&&e.roles.includes(t)&&!e.done.includes(t)&&!e.failed.some(n=>n.role===t);function sN(e=[],t){const n=[];for(const r of DG){const a=e.find(l=>l.role===r);if(rN(t,r)||(t==null?void 0:t.status)==="running"&&t.done.includes(r)&&!a){n.push({role:r,state:"drawing",...a?{url:a.url,hash:a.hash}:{}});continue}if(a){n.push({role:r,state:"shown",url:a.url,hash:a.hash,earlier:a.earlier,...a.setup?{setup:a.setup}:{}});continue}const i=t==null?void 0:t.failed.find(l=>l.role===r);i&&n.push({role:r,state:"failed",error:i.error})}return n}function HG(e,t=[],n){return e.filter(r=>!t.some(a=>a.role===r)&&!rN(n,r))}function OG(e=[]){return e.filter(t=>t.earlier).map(t=>t.role)}function Uv(e){if(e.status==="failed")return e.error??"The examples did not draw";if(e.status==="cancelled")return"Stopped";const t=e.total?` · ${e.done??0} of ${e.total}`:"";if(e.status==="running"){const n=e.step&&e.step in Z3?Z3[e.step]:null;return`${n?`Drawing the ${n}`:"Drawing examples"}${t}`}return e.done===1?"One example drawn":`${e.done??0} examples drawn`}function hm(e){const t=eo(e);return t.kind==="unknown"?null:[t.title,t.fix].filter(Boolean).join(" ")}const aN=50;function Bo(e){return Date.parse(e.includes("T")?e:`${e.replace(" ","T")}Z`)}function Ui(e){return e.startedAt||e.createdAt}function hc(e,t=Date.now()){const n=Bo(e);return Number.isNaN(n)?0:Math.max(0,Math.round((t-n)/1e3))}function Wv(e,t=Date.now()){const n=hc(e,t);return n<20?"generating":n<60?"still generating":"taking longer than usual"}function pc(e,t=Date.now()){const n=hc(e,t),r=u=>String(u).padStart(2,"0"),a=Math.floor(n/3600),i=Math.floor(n%3600/60),l=n%60;return a>0?`${a}:${r(i)}:${r(l)}`:`${i}:${r(l)}`}function oN(e,t=Date.now()){const n=hc(e,t);if(n<45)return"just now";if(n<3600)return`${Math.round(n/60)}m ago`;if(n<86400)return`${Math.floor(n/3600)}h ago`;const r=Math.floor(n/86400);return r===1?"Yesterday":`${r}d ago`}function iN(e){if(!e)return 0;if(e.stage==="discovering")return e.discovered?15:8;if(e.stage==="fetching_products"){const t=Math.max(e.discovered,e.fetched,1);return 15+Math.min(45,Math.round(e.fetched/t*45))}if(e.stage==="processing_assets"){const t=Math.max(e.imagesTotal,1);return 60+Math.min(35,Math.round(e.imagesDone/t*35))}return e.stage==="completed"||e.stage==="no_catalog"?100:e.stage==="partial"?95:5}const lN=e=>e.setNames.length>0?`${e.setNames.join(", ")} · `:"";function IG(e){const t=eo(e);return t.kind==="restarted"?t.title:e??"failed"}function D6(e,t,n=Date.now(),r=1){const a=lN(e),i=r>1?`${r} shots`:"ready",l=e.status==="running"?`${a}${Wv(Ui(e),n)}`:e.status==="error"?`${a}${IG(e.error)}`:e.status==="cancelled"?`${a}cancelled`:`${a}${i}`;return{id:`node:${e.id}`,kind:e.kind==="edit"?"edit":"generation",state:e.status,title:e.kind==="edit"?`Edit · ${Rr(e)}`:Rr(e),subtitle:l,thumb:e.images[0]??null,percent:null,startedAt:e.status==="running"?Ui(e):e.createdAt,href:cm(t,null,e.id)}}function FG(e,t,n=Date.now()){var f,h;const r=[...e].sort((p,g)=>(p.batchIndex??0)-(g.batchIndex??0)),a=r[0];if(r.length===1)return D6(a,t,n);const i=r.filter(p=>p.status==="done"&&p.images.length>0),l=r.some(p=>p.status==="running")?"running":i.length?"done":r.some(p=>p.status==="error")?"error":"cancelled",u=D6({...a,status:l,images:((f=i[0])==null?void 0:f.images)??[],error:l==="error"?((h=r.find(p=>p.status==="error"))==null?void 0:h.error)??null:a.error},t,n,r.length);return l==="done"&&i.length<r.length?{...u,subtitle:`${lN(a)}${i.length} of ${r.length} shots`}:u}function _G(e){var t,n;return e.stage==="no_catalog"||e.stage==="failed"&&((n=(t=e.errors)==null?void 0:t[0])==null?void 0:n.code)==="empty_catalog"}function VG(e,t){const n=_G(e),r=n||e.stage==="completed"?"done":e.stage==="partial"?"partial":e.stage==="cancelled"?"cancelled":e.stage==="failed"?"error":"running";let a=e.url;try{a=new URL(e.url).hostname.replace(/^www\./,"")}catch{}const i=e.stage==="discovering"?e.discovered?`Found ${e.discovered.toLocaleString()} products`:"Looking for products":e.stage==="processing_assets"&&e.imagesTotal?`${e.imagesDone.toLocaleString()} of ${e.imagesTotal.toLocaleString()} pictures`:e.stage==="fetching_products"&&e.fetched>e.upserted&&e.discovered?`Reading ${e.fetched.toLocaleString()} of ${e.discovered.toLocaleString()} products`:e.discovered?`${e.upserted.toLocaleString()} of ${e.discovered.toLocaleString()} products`:`${e.upserted.toLocaleString()} products`;return{id:`catalog:${e.id}`,kind:"catalog",state:r,title:a,subtitle:n?"No shop on this site":r==="error"||r==="cancelled"||r==="partial"?e.message??"Import failed":i,thumb:null,percent:n?100:iN(e),startedAt:e.createdAt,href:Du(t)}}function ZG(e,t){const n=e.stage==="done"?"done":e.stage==="failed"?"error":e.stage==="cancelled"?"cancelled":"running",r=n==="error"?e.error??"failed":n==="cancelled"?"stopped":n==="done"?e.warnings[0]??e.coverage[0]??(e.kind==="presenter"?"Ready to cast":"Ready to use"):e.message??(e.kind==="presenter"?"Building the studio views":"Reading the references");return{id:`build:${e.id}`,kind:e.kind,state:n,title:e.name,subtitle:r,thumb:e.previewHash,percent:e.steps>0?Math.min(100,Math.round(e.step/e.steps*100)):null,startedAt:e.startedAt,href:e.assetId?e.kind==="presenter"?xa(t,e.assetId):Ir(t,e.assetId):null}}function zG(e){if(e.kind==="examples"){const n=Uv(e);return e.status==="done"&&e.error?`${n} · ${Math.max(1,(e.total??0)-(e.done??0))} did not draw`:n}if(e.status==="failed")return e.error??"It did not finish";if(e.status==="cancelled")return"Stopped";if(e.kind==="scene")return e.status==="running"?e.step==="reading"?"Reading the place":e.step==="changing"?"Changing the words":"Drawing the picture":e.job==="change"&&!e.thumb?"The words are changed":e.attachTo?"On its scene now":"The picture is drawn";const t=e.step&&e.step in xn?xn[e.step]:null;return e.status==="running"?t?`Drawing the ${t}`:"Reading the photos":e.awaiting&&t?`The ${t} is ready to look at`:e.total&&e.done===e.total?"Every view is drawn":e.total?`${e.done??0} of ${e.total} views`:"Drawn"}function BG(e,t){const n=e.status==="failed"?"error":e.status==="done"&&e.error?"partial":e.status,r=e.kind==="examples"?e.sceneId?Ir(t,e.sceneId):null:e.kind==="scene"?e.conversation?e.sceneId?_v(t,e.sceneId,e.conversation):Xi(t,e.conversation):e.attachTo?Ir(t,e.attachTo):null:e.presenterId?lm(t,e.presenterId):e.draftId?Qi(t,e.draftId):null;return{id:e.id,kind:e.kind==="examples"?"scene":e.kind,state:n,title:e.name.trim()||(e.kind==="presenter"?"New presenter":"New scene"),subtitle:zG(e),thumb:e.thumb,percent:e.kind!=="scene"&&e.total?Math.round((e.done??0)/e.total*100):null,startedAt:e.startedAt,href:r}}const H6=e=>e.startsWith("scene:")||e.startsWith("presenter:")||e.startsWith("examples:");function z3(e,t){return e?e.split("?")[0].replace(/\/$/,"")===t.replace(/\/$/,""):!1}function B3(e,t,n){var l;if(!e.id.startsWith("examples:")||!e.href)return!1;const r=e.href.split("?")[0].split("/").pop(),a=t.match(/\/scenes\/([^/]+)\/edit(?:\/|$)/);if(a)return a[1]===r;const i=t.match(/\/scenes\/new\/([^/]+)/);if(!i)return!1;try{return((l=JSON.parse(xr.get(`scenri:scene-studio:${n}:${i[1]}`)??"null"))==null?void 0:l.sceneId)===r}catch{return!1}}function UG(e,t=12){const n=e.filter(a=>a.state==="running"),r=e.filter(a=>a.state!=="running").sort((a,i)=>Bo(i.startedAt)-Bo(a.startedAt)).slice(0,t);return n.sort((a,i)=>Bo(a.startedAt)-Bo(i.startedAt)),[...n,...r]}function WG(e,t,n=new Date){if(!e)return[];const r=[];for(const a of t){if(a.state==="running")continue;const i=e.get(a.id);i&&i.state!=="running"||r.push({id:a.id,kind:a.kind,state:a.state,title:a.title,subtitle:a.subtitle,thumb:a.thumb,at:n.toISOString(),href:a.href})}return r}function KG(e,t){if(!e)return[];const n=new Set(t.map(r=>r.id));return[...e.values()].filter(r=>r.state==="running"&&!n.has(r.id)&&(H6(r.id)||r.id.startsWith("build:"))).map(r=>({...r,state:"error",subtitle:"Lost when Scenri restarted. Start it again."}))}function GG(e,t){return e.length===0?null:new Map([...t.map(n=>[n.id,n]),...e.map(n=>[n.id,n])])}function YG(e,t,n=aN){if(t.length===0)return e;const r=new Set(t.map(a=>a.id));return[...t,...e.filter(a=>!r.has(a.id))].sort((a,i)=>Bo(i.at)-Bo(a.at)).slice(0,n)}function qG(e,t){const n=e.filter(a=>!a.watched);if(!t)return n.length;const r=Bo(t);return n.filter(a=>Bo(a.at)>r).length}const cN=e=>`scenri:notifications-${e}`,uN=e=>`scenri:notifications-seen-${e}`,dN=e=>xr.get(e),fN=(e,t)=>xr.set(e,t);function U3(e){const t=dN(cN(e));if(!t)return[];try{const n=JSON.parse(t);return Array.isArray(n)?n:[]}catch{return[]}}const W3=(e,t)=>fN(cN(e),JSON.stringify(t.slice(0,aN))),K3=e=>dN(uN(e)),XG=(e,t)=>fN(uN(e),t),hN=e=>`scenri:activity-running-${e}`;function QG(e){const t=Tc.get(hN(e));if(!t)return[];try{const n=JSON.parse(t);return Array.isArray(n)?n.filter(r=>(r==null?void 0:r.state)==="running"):[]}catch{return[]}}const JG=(e,t)=>Tc.set(hN(e),JSON.stringify(t.filter(n=>n.state==="running")));function qg(e,t){return e===t?!0:e.length!==t.length?!1:JSON.stringify(e)===JSON.stringify(t)}const eY=1500,tY=5e3,pN=s.createContext(null);function Ca(){const e=s.useContext(pN);if(!e)throw new Error("useTaskCenter must be used inside TaskCenterProvider");return e}function nY({brand:e,onActivity:t,children:n}){const r=_n(),{push:a}=cr(),{refreshBrands:i}=Hn(),l=e.id,[u,f]=s.useState([]),[h,p]=s.useState([]),[g,v]=s.useState([]),w=s.useRef(e);w.current=e;const b=s.useRef([]);b.current=h;const[y,k]=s.useState(()=>U3(l)),[S,E]=s.useState(()=>K3(l)),[j,N]=s.useState(!1),A=s.useRef(null),T=s.useRef(!1),P=s.useRef(null),C=s.useRef(new Set),R=s.useRef(0),$=s.useRef(new Set),H=s.useRef(i);H.current=i;const D=s.useRef(null),q=s.useRef(j);q.current=j;const _=s.useRef(r);_.current=r;const{pathname:U}=Wn(),Y=s.useRef(!1);Y.current=/\/(create|sets)(\/|$)/.test(U);const I=s.useRef(a);I.current=a;const F=s.useRef(t);F.current=t,s.useEffect(()=>{A.current=null,C.current=new Set,R.current=0,$.current=new Set,f([]),p([]),v([]),k(U3(l)),E(K3(l))},[l]);const O=s.useCallback(async()=>{var ot,Xe;let ee,se,oe;try{const[{nodes:X,jobs:J,studio:ge=[],boot:ve},{builds:Ze}]=await Promise.all([je.activity(l),je.assetBuilds(l)]);if(w.current.id!==l)return;se=Ze,oe=ge,ve&&P.current&&ve!==P.current&&(T.current=!0),ve&&(P.current=ve),(ot=F.current)==null||ot.call(F,l,X);const Ye=new Map,ke=[];for(const le of X)le.batchId?Ye.set(le.batchId,[...Ye.get(le.batchId)??[],le]):ke.push(le);const te=Date.now();ee=[...ke.map(le=>D6(le,w.current,te)),...[...Ye.values()].map(le=>FG(le,w.current,te)),...J.map(le=>VG(le,w.current)),...Ze.map(le=>ZG(le,w.current)),...ge.map(le=>BG(le,w.current))]}catch{T.current=!0;return}const me=se.filter(X=>X.finished&&X.assetId&&!$.current.has(X.id)),ce=new Set(se.map(X=>X.id)),we=b.current.some(X=>!X.finished&&!ce.has(X.id)),G=oe.filter(X=>X.kind==="scene"&&X.status==="done"&&!!X.attachTo&&!$.current.has(X.id));for(const X of G)$.current.add(X.id);const ue=oe.filter(X=>X.kind==="examples"&&(X.done??0)>0).map(X=>`${X.id}:${X.done}`).filter(X=>!$.current.has(X));for(const X of ue)$.current.add(X);if(me.length||we||G.length||ue.length){for(const X of me)$.current.add(X.id),dG(l,X.kind,X.id);if(await H.current(),w.current.id!==l)return}p(X=>qg(X,se)?X:se),v(X=>qg(X,oe)?X:oe);const Ne=A.current??GG(QG(l),ee),ne=T.current?KG(Ne,ee):[];T.current=!1;const Fe=WG(Ne,[...ee,...ne]);A.current=new Map(ee.map(X=>[X.id,X])),JG(l,ee),R.current=ee.filter(X=>X.state==="running").length;const Oe=UG(ee);if(f(X=>qg(X,Oe)?X:Oe),Fe.length!==0&&(k(X=>{const J=window.location.pathname,ge=Fe.map(Ze=>H6(Ze.id)&&(z3(Ze.href,J)||B3(Ze,J,l))?{...Ze,watched:!0}:Y.current&&Ze.state!=="error"?{...Ze,watched:!0}:Ze),ve=YG(X,ge);return W3(l,ve),ve}),!q.current))for(const X of Fe){if(C.current.has(X.id)||(C.current.add(X.id),X.state==="cancelled"))continue;if(H6(X.id)){const ve=window.location.pathname;if(z3(X.href,ve)||B3(X,ve,l))continue;const Ze=X.href,Ye=Ze?[{label:"Open",onClick:()=>_.current(Ze)}]:void 0;if(X.state==="error"){I.current({kind:"error",title:`${X.title} did not finish`,detail:X.subtitle,actions:Ye});continue}if(X.state==="partial"){I.current({kind:"warning",title:X.id.startsWith("examples:")?`Some ${X.title} examples did not draw`:`${X.title} did not fully finish`,detail:X.subtitle,actions:Ye});continue}I.current({kind:"success",title:X.id.startsWith("examples:")?`${X.title} examples are ready`:X.kind==="scene"&&!X.thumb?`${X.title} is changed`:`${X.title} is drawn`,detail:X.kind==="presenter"?X.subtitle:void 0,actions:Ye});continue}if(X.state!=="error"&&Y.current&&X.kind!=="presenter"&&X.kind!=="scene")continue;const J=X.href,ge=J?{label:"View",onClick:()=>_.current(J)}:void 0;if(X.state==="error"){const ve=Y.current&&(X.kind==="generation"||X.kind==="edit");I.current({kind:"error",title:`${X.title} failed`,detail:X.subtitle,action:ge,quiet:ve});continue}if(X.kind==="presenter"||X.kind==="scene"){const ve=X.id.startsWith("build:")?((Xe=se.find(Ye=>`build:${Ye.id}`===X.id))==null?void 0:Xe.assetId)??null:null,Ze=yr(w.current);I.current({kind:"success",title:`${X.title} is ready`,detail:X.subtitle,actions:J?[{label:X.kind==="presenter"?"View presenter":"View scene",onClick:()=>_.current(J)},{label:"Use in a shot",onClick:()=>_.current(`${Ze}?${X.kind==="presenter"?"presenter":"scene"}=${ve}&compose=1`)}]:void 0});continue}if(X.kind==="catalog"&&X.state==="partial"){I.current({kind:"warning",title:"Some products did not import",detail:X.subtitle,action:ge});continue}I.current({kind:"success",title:X.kind==="catalog"?"Import finished":"Generation finished",detail:X.kind==="catalog"?X.title:void 0,action:ge})}},[l]);s.useEffect(()=>{let ee=null,se=!0;const oe=async()=>{if(!se||(document.hidden||await O(),!se))return;const ce=!document.hidden&&R.current>0;ee=setTimeout(oe,ce?eY:tY)},me=()=>{ee&&clearTimeout(ee),ee=null,document.hidden||oe()};return D.current=me,oe(),document.addEventListener("visibilitychange",me),window.addEventListener("focus",me),()=>{se=!1,D.current=null,ee&&clearTimeout(ee),document.removeEventListener("visibilitychange",me),window.removeEventListener("focus",me)}},[O]);const Z=s.useCallback(()=>{var ee;return(ee=D.current)==null?void 0:ee.call(D)},[]),V=s.useCallback(()=>{const ee=new Date().toISOString();E(ee),XG(l,ee)},[l]),B=s.useCallback(()=>{k([]),W3(l,[]),V()},[l,V]),K=s.useMemo(()=>({tasks:u,running:u.filter(ee=>ee.state==="running").length,builds:h,studio:g,feed:y,unread:qG(y,S),markSeen:V,clearFeed:B,panelOpen:j,setPanelOpen:N,poke:Z}),[u,h,g,y,S,V,B,j,Z]);return o.jsx(pN.Provider,{value:K,children:n})}const mN=["primary","mark","wordmark","monochrome","alternate"],Kv=["light","dark","any"],rh={primary:"Primary logo",mark:"Mark",wordmark:"Wordmark",monochrome:"Monochrome",alternate:"Alternate"},rY=/^[a-f0-9]{32}$/,sY=e=>{const t=String(e??"");if(!t.startsWith("asset:"))return null;const n=t.slice(6);return rY.test(n)?n:null},aY=e=>mN.includes(e)?e:"primary",oY=e=>Kv.includes(e)?e:"any";function Tf(e){return(Array.isArray(e==null?void 0:e.logos)?e.logos:[]).filter(n=>n&&String(n.file??"").trim()).map(n=>{const r=sY(n.file),a=String(n.clearSpace??"").trim();return{hash:r,file:String(n.file),role:aY(n.role),background:oY(n.background),...a?{clearSpace:a}:{},attachable:r!==null}})}function Df(e){return Tf(e).filter(t=>t.attachable)}function pm(e){return e.find(t=>t.role==="primary")??e[0]??null}function iY(e){return pm(Tf(e))}function lY(e){const t=Tf(e);return t.find(n=>n.role==="mark")??pm(t)}function cY(e){const t=Tf(e).filter(a=>a.hash),n=t.find(a=>a.role==="mark");if(n)return{mark:n,square:!0};const r=pm(t);return!r||r.role==="wordmark"?null:{mark:r,square:!1}}const uY=1.6,dY=(e,t)=>t>0&&e/t<=uY;function fY(e,t){const n=(i,l)=>Math.min(l-1,Math.max(0,Math.round(i*(l-1))));return[[n(.5,e),n(.03,t)],[n(.5,e),n(1-.03,t)],[n(.03,e),n(.5,t)],[n(1-.03,e),n(.5,t)],[n(.12,e),n(.12,t)],[n(1-.12,e),n(.12,t)],[n(.12,e),n(1-.12,t)],[n(1-.12,e),n(1-.12,t)]]}const hY=e=>e.length>0&&e.every(t=>t>=200);function mm(e,t){var a;const n={primary:"logo",mark:"mark",wordmark:"wordmark",monochrome:"monochrome logo",alternate:"alternate logo"},r=String(((a=e==null?void 0:e.meta)==null?void 0:a.name)??"").trim();return r?`${r} ${n[t.role]}`:`Brand ${n[t.role]}`}function Gv(e){const{brand:t}=dn(),{pathname:n}=Wn(),r=!!gn(pt.brand),a=!!gn({path:pt.hub,end:!1}),i=!!gn({path:pt.set,end:!1}),l=a||i,u=!!gn({path:pt.products,end:!1}),f=!!gn({path:pt.scenes,end:!1}),h=!!gn({path:pt.presenters,end:!1}),p=g=>g?"fill":"regular";return[{key:"home",label:"Home",icon:o.jsx(DO,{size:e,weight:p(r)}),active:r,to:Eo(t)},{key:"create",label:"Create",icon:o.jsx(BO,{size:e,weight:p(l)}),active:l,to:l?`${n}?compose=1`:`${yr(t)}?compose=1`},{key:"products",label:"Products",icon:o.jsx(Tp,{size:e,weight:p(u)}),active:u,to:Du(t)},{key:"presenters",label:"Presenters",icon:o.jsx(Lp,{size:e,weight:p(h)}),active:h,to:Xo(t)},{key:"scenes",label:"Scenes",icon:o.jsx(Pp,{size:e,weight:p(f)}),active:f,to:qi(t)}]}const va=e=>{var t,n;return((n=(t=e.json)==null?void 0:t.meta)==null?void 0:n.name)??e.slug};function pY(e){return([...e.trim()].find(n=>new RegExp("\\p{L}|\\p{N}","u").test(n))??"?").toUpperCase()}function mY(e){const t=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!t)return"#ffffff";const[n,r,a]=[0,2,4].map(l=>Number.parseInt(t[1].slice(l,l+2),16)/255),i=l=>l<=.03928?l/12.92:((l+.055)/1.055)**2.4;return .2126*i(n)+.7152*i(r)+.0722*i(a)>.42?"#0a0a0a":"#ffffff"}const G3=new Map;function gY(e,t){const n=e.naturalWidth,r=e.naturalHeight,a=t||dY(n,r);let i=!1;try{const l=document.createElement("canvas");l.width=n,l.height=r;const u=l.getContext("2d",{willReadFrequently:!0});u&&(u.drawImage(e,0,0),i=hY(fY(n,r).map(([f,h])=>u.getImageData(f,h,1,1).data[3])))}catch{}return{fits:a,bleed:i}}function gN({brand:e,size:t=20,round:n=!1}){var h,p,g;const[,r]=s.useReducer(v=>v+1,0),a=cY(e.json),i=a?im(a.mark.file,"micro"):null,l=i?G3.get(i):void 0,u=i&&(l!=null&&l.fits)?i:null,f=((g=(p=(h=e.json)==null?void 0:h.palette)==null?void 0:p.primary)==null?void 0:g.hex)??"#6b6b6b";return o.jsxs("span",{className:"sc-brand-av","data-logo":u?"":void 0,"data-bleed":u&&(l!=null&&l.bleed)?"":void 0,"data-round":n||void 0,style:{width:t,height:t,fontSize:Math.round(t*.5),...u?{}:{background:f,color:mY(f)}},"aria-hidden":!0,children:[u?o.jsx("img",{src:u,alt:""}):pY(va(e)),i&&!l&&o.jsx("img",{src:i,alt:"",hidden:!0,onLoad:v=>{G3.set(i,gY(v.currentTarget,!!(a!=null&&a.square))),r()}})]})}function vY(){const e=Gv(22);return o.jsx("nav",{className:"sc-tabbar","aria-label":"Main",children:o.jsx("ul",{children:e.map(t=>o.jsx("li",{children:o.jsxs(Bn,{to:t.to,"data-on":t.active||void 0,"data-guide":`nav.${t.key}`,"aria-current":t.active?"page":void 0,children:[o.jsx("span",{className:"sc-tab-ic",children:t.icon}),o.jsx("span",{className:"sc-tab-lb",children:t.label})]})},t.key))})})}function wY({value:e,size:t,stroke:n=1.5,indeterminate:r=!1}){const a=(t-n)/2,i=2*Math.PI*a,l=Math.max(0,Math.min(1,e)),u=f=>o.jsx("circle",{className:"sc-ring-arc",cx:t/2,cy:t/2,r:a,fill:"none",strokeWidth:n,strokeLinecap:"round",strokeDasharray:f,strokeDashoffset:r?0:i*(1-l),transform:`rotate(-90 ${t/2} ${t/2})`});return o.jsxs("svg",{className:"sc-ring",width:t,height:t,viewBox:`0 0 ${t} ${t}`,"aria-hidden":"true",children:[!r&&o.jsx("circle",{className:"sc-ring-track",cx:t/2,cy:t/2,r:a,fill:"none",strokeWidth:n}),r?o.jsx("g",{className:"sc-ring-spin",children:u(`${i*.28} ${i}`)}):null,!r&&l>0?u(String(i)):null]})}function yY({mode:e,lead:t,running:n,unread:r,animate:a}){const i=bY(a);if(e==="busy"&&t){const l=t.percent!==null;return o.jsx("span",{className:"sc-act-face","data-swap":i||void 0,"aria-hidden":"true",children:o.jsxs("span",{className:"sc-act-ring","data-bare":t.thumb?void 0:"",children:[o.jsx(wY,{value:l?(t.percent??0)/100:0,indeterminate:!l,size:32}),t.thumb?o.jsx("img",{src:hn(t.thumb,"micro"),alt:"",loading:"lazy",decoding:"async"}):o.jsx(jg,{size:16}),n>1&&o.jsx("span",{className:"sc-act-n",children:n})]})})}return e==="new"?o.jsx("span",{className:"sc-act-face","data-swap":i||void 0,"aria-hidden":"true",children:o.jsxs("span",{className:"sc-act-bell",children:[o.jsx(jg,{size:18}),o.jsx("span",{className:"sc-act-n",children:r>9?"9+":r})]})}):o.jsx("span",{className:"sc-act-face","data-swap":i||void 0,"aria-hidden":"true",children:o.jsx(jg,{size:18})})}function bY(e){return s.useRef(e).current}function Y3({onClose:e,onSeen:t,onOpenDetail:n}){const{tasks:r,feed:a,unread:i,clearFeed:l}=Ca(),u=r.filter(S=>S.state==="running"),{brand:f}=dn(),{push:h}=cr(),p=SY(1e3),g=s.useRef(null),v=s.useRef(null),w=s.useRef(!1);s.useEffect(()=>{var S;!w.current||a.length>0||(w.current=!1,(S=g.current)==null||S.focus({preventScroll:!0}))},[a.length]);const b=()=>{w.current=!0,l()},y=S=>{var E;S.detail===0&&((E=v.current)==null||E.focus({preventScroll:!0})),t()},k=S=>{if(S.startsWith("node:")){je.cancelNode(S.slice(5)).catch(E=>h(ln(E,"Could not cancel this shot")));return}if(S.startsWith("build:")){je.cancelAssetBuild(f.id,S.slice(6)).catch(E=>h(ln(E,"Could not stop this build")));return}if(S.startsWith("scene:")){je.cancelSceneStudioJob(f.id,S.slice(6)).catch(E=>h(ln(E,"Could not stop this scene")));return}if(S.startsWith("presenter:")){const E=S.split(":")[1]??"";je.stopDraft(f.id,E).catch(j=>h(ln(j,"Could not stop this presenter")));return}S.startsWith("catalog:")&&je.cancelCatalogJob(f.id,S.slice(8)).catch(E=>h(ln(E,"Could not stop this import")))};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-menu-head",children:"Activity"}),u.length>0&&o.jsxs("section",{"aria-label":"In progress",children:[o.jsx("h3",{className:"sc-notif-label",children:"In progress"}),u.map(S=>o.jsx(xY,{task:S,now:p,onNavigate:e,onCancel:k,onOpenDetail:n},S.id))]}),a.length===0&&u.length===0?o.jsx("p",{ref:g,tabIndex:-1,className:"sc-notif-empty",children:"Work that finishes shows up here."}):o.jsxs("section",{"aria-label":"Notifications",children:[o.jsxs("div",{className:"sc-notif-label",children:[o.jsx("h3",{children:"Notifications"}),a.length>0&&o.jsxs("span",{className:"sc-notif-acts",children:[i>0&&o.jsx("button",{type:"button",className:"sc-notif-seen",onClick:y,children:"Mark all read"}),o.jsx("button",{ref:v,type:"button",className:"sc-notif-clear",onClick:b,children:"Clear all"})]})]}),a.length===0?o.jsx("p",{ref:g,tabIndex:-1,className:"sc-notif-empty",children:"Work that finishes shows up here."}):o.jsx("div",{className:"sc-notif-scroll",children:a.map(S=>o.jsx(kY,{item:S,now:p,onNavigate:e,onSeen:t},S.id))})]})]})}function vN({task:e}){return e.thumb?o.jsx("img",{src:hn(e.thumb,"micro"),alt:"",loading:"lazy",decoding:"async"}):e.state==="running"?o.jsx("span",{className:"sc-shimmer"}):e.state==="error"?o.jsx(xc,{size:17,weight:"fill"}):e.state==="cancelled"?o.jsx(XO,{size:17,color:"var(--sc-fg3)"}):e.kind==="catalog"?o.jsx(J9,{size:17}):e.kind==="presenter"?o.jsx(Lp,{size:17}):e.kind==="scene"?o.jsx(Pp,{size:17}):o.jsx(Js,{size:17})}function xY({task:e,now:t,onNavigate:n,onCancel:r,onOpenDetail:a}){const i=e.state==="running",l=e.id.startsWith("node:")||e.id.startsWith("build:")||e.id.startsWith("catalog:"),u=i&&hc(e.startedAt,t)>=60,f=i&&e.id.startsWith("catalog:")?e.id.slice(8):null,h=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-notif-thumb",children:o.jsx(vN,{task:e})}),o.jsxs("span",{className:"sc-notif-txt",children:[o.jsx("b",{dir:"auto",children:e.title}),o.jsx("small",{dir:"auto",children:e.subtitle}),i&&e.percent!==null?o.jsx("span",{className:"sc-notif-meter",children:o.jsx("div",{style:{width:`${e.percent}%`}})}):null]}),o.jsx("span",{className:"sc-notif-time",children:i?pc(e.startedAt,t):oN(e.startedAt,t)})]});return o.jsxs("div",{className:"sc-notif-row-wrap",children:[f?o.jsx("button",{type:"button",className:"sc-notif-row","data-state":e.state,"data-running":i||void 0,onClick:()=>a(f),children:h}):e.href?o.jsx(Bn,{className:"sc-notif-row","data-state":e.state,"data-running":i||void 0,to:e.href,onClick:n,children:h}):o.jsx("button",{type:"button",className:"sc-notif-row","data-state":e.state,"data-running":i||void 0,disabled:!0,children:h}),i&&l&&o.jsx("button",{type:"button",className:"sc-notif-row-cancel","data-urgent":u||void 0,onClick:p=>{p.stopPropagation(),r(e.id)},children:"Cancel"})]})}function kY({item:e,now:t,onNavigate:n,onSeen:r}){const a=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-notif-thumb",children:o.jsx(vN,{task:e})}),o.jsxs("span",{className:"sc-notif-txt",children:[o.jsx("b",{dir:"auto",children:e.title}),o.jsx("small",{dir:"auto",children:e.subtitle})]}),o.jsx("span",{className:"sc-notif-time",children:oN(e.at,t)})]});return e.href?o.jsx(Bn,{className:"sc-notif-row","data-state":e.state,to:e.href,onClick:()=>{r(),n()},children:a}):o.jsx("button",{type:"button",className:"sc-notif-row","data-state":e.state,disabled:!0,children:a})}function SY(e){const[t,n]=s.useState(()=>Date.now());return s.useEffect(()=>{const r=setInterval(()=>n(Date.now()),e);return()=>clearInterval(r)},[e]),t}function pd(e){const t=s.useRef(null),n=s.useRef(null),r=s.useRef(0),a=u=>{u.pointerType==="mouse"&&u.button!==0||(n.current={y:u.clientY,t:u.timeStamp},r.current=0,t.current&&(t.current.style.transition="none"),u.currentTarget.setPointerCapture(u.pointerId))},i=u=>{!n.current||!t.current||(r.current=Math.max(0,u.clientY-n.current.y),t.current.style.transform=`translateY(${r.current}px)`)},l=u=>{const f=n.current;if(n.current=null,!f||!t.current)return;t.current.style.transition="";const h=r.current/Math.max(1,u.timeStamp-f.t);if(r.current>96||h>.45){e();return}t.current.style.transform=""};return{sheet:t,grip:{onPointerDown:a,onPointerMove:i,onPointerUp:l,onPointerCancel:l}}}function wN({label:e,onClose:t,children:n}){const{sheet:r,grip:a}=pd(t);return s.useEffect(()=>{const i=l=>{l.key==="Escape"&&t()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[t]),_r.createPortal(o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-notif-scrim",onClick:t,"aria-hidden":!0}),o.jsxs("div",{ref:r,className:"sc-notif-sheet",role:"dialog","aria-modal":"true","aria-label":e,children:[o.jsx("div",{className:"sc-shotsheet-grip",...a,children:o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0})}),n]})]}),document.body)}function yN(e,t){const{pathname:n}=Wn(),r=s.useRef(t);r.current=t,s.useEffect(()=>{r.current()},[n]),s.useEffect(()=>{if(!e)return;const a=()=>r.current();return window.addEventListener("scenri:modal-open",a),()=>window.removeEventListener("scenri:modal-open",a)},[e])}const EY=new Set(["Shift","Control","Alt","AltGraph","Meta","CapsLock","Fn","FnLock","Hyper","Super","OS"]);let Qh=null;function q3(e){Qh!==e&&(Qh=e,document.documentElement.dataset.input=e)}function CY(){const e=n=>{n.isComposing||n.key==="Unidentified"||EY.has(n.key)||q3("keyboard")},t=()=>q3("pointer");return window.addEventListener("keydown",e,!0),window.addEventListener("pointerdown",t,!0),()=>{window.removeEventListener("keydown",e,!0),window.removeEventListener("pointerdown",t,!0)}}function jY(){return Qh}function gm(e){return Qh!=="pointer"&&e.matches(":focus-visible")}function lr({label:e,open:t,children:n}){return o.jsx(Iv,{content:e,className:"sc-tip",maxWidth:"220px",...t?{open:!0}:{},children:xN(n)})}function bN(e,t,n){return n?t:o.jsx(lr,{label:e,children:t})}function xN(e){const t=e.props.onFocus;return s.cloneElement(e,{onFocus:n=>{t==null||t(n),jY()==="pointer"&&n.preventDefault()}})}function _s({open:e=!0,className:t,maxWidth:n,described:r,children:a,onDismiss:i,onOpenAutoFocus:l,onCloseAutoFocus:u,onPaste:f,tone:h}){const{sheet:p,grip:g}=pd(i);s.useEffect(()=>{e&&window.dispatchEvent(new CustomEvent("scenri:modal-open"))},[e]);const v=l??qK,w=u;return o.jsx(Sc,{open:e,onOpenChange:b=>!b&&i(),children:o.jsxs(Ec,{children:[o.jsx(Cc,{className:"sc-newdlg-scrim","data-tone":h}),o.jsx(jc,{className:"sc-newdlg-layer",...r?{}:{"aria-describedby":void 0},onOpenAutoFocus:v,onCloseAutoFocus:w,onPaste:f,onPointerDown:b=>{b.target===b.currentTarget&&i()},children:o.jsxs("div",{ref:p,className:["sc-newdlg",t].filter(Boolean).join(" "),style:n?{"--sc-newdlg-max":n}:void 0,children:[o.jsx("div",{className:"sc-shotsheet-grip",...g,children:o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0})}),a]})})]})})}function ks({className:e,children:t}){return o.jsx(Ac,{className:e,children:t})}const Ss=s.forwardRef(function({children:t,...n},r){return o.jsx(Vp,{asChild:!0,ref:r,...n,children:t})});function md({className:e,children:t}){return o.jsx(Q4,{className:e,children:t})}const X3=300,AY={queued:"Waiting to start",discovering:"Looking through the site",fetching_products:"Reading products",processing_assets:"Saving pictures",completed:"Finished",partial:"Finished, with some gaps",no_catalog:"No shop on this site",cancelled:"Stopped",failed:"Could not finish"};function O6({brandId:e,jobId:t,onDismiss:n}){const[r,a]=s.useState(null),[i,l]=s.useState(!1);s.useEffect(()=>{let g=!1,v;const w=async()=>{try{const b=await je.catalogJob(e,t);if(g)return;a(b),b.finishedAt||(v=setTimeout(w,X3))}catch{g||(v=setTimeout(w,X3*3))}};return w(),()=>{g=!0,v&&clearTimeout(v)}},[e,t]);const u=!!r&&!r.finishedAt,f=r?iN(r):0,h=(r==null?void 0:r.errors)??[],p=async()=>{l(!0);try{await je.cancelCatalogJob(e,t)}catch{l(!1)}};return o.jsxs(_s,{open:!0,className:"sc-imp",maxWidth:"440px",described:!0,onDismiss:n,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ks,{className:"sc-newdlg-title",children:"Importing products"}),o.jsx(Ss,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(Mn,{size:16})})})]}),o.jsx(md,{className:"sc-imp-sub",children:o.jsxs("span",{role:"status",children:[r?AY[r.stage]??"Working":"Getting the details",r!=null&&r.message?` · ${r.message}`:""]})}),u&&o.jsx("span",{className:"sc-imp-meter",role:"progressbar","aria-label":"Import progress","aria-valuenow":f,"aria-valuemin":0,"aria-valuemax":100,children:o.jsx("div",{style:{width:`${f}%`}})}),o.jsxs("ul",{className:"sc-imp-lines",children:[o.jsxs("li",{children:[o.jsx("span",{children:"Found on the site"}),o.jsx("b",{children:((r==null?void 0:r.discovered)??0).toLocaleString()})]}),o.jsxs("li",{children:[o.jsx("span",{children:"Read"}),o.jsx("b",{children:((r==null?void 0:r.fetched)??0).toLocaleString()})]}),o.jsxs("li",{children:[o.jsx("span",{children:"Saved"}),o.jsx("b",{children:((r==null?void 0:r.upserted)??0).toLocaleString()})]}),o.jsxs("li",{children:[o.jsx("span",{children:"Pictures"}),o.jsxs("b",{children:[((r==null?void 0:r.imagesDone)??0).toLocaleString(),r!=null&&r.imagesTotal?` of ${r.imagesTotal.toLocaleString()}`:""]})]})]}),h.length>0&&o.jsxs("details",{className:"sc-imp-errs",children:[o.jsx("summary",{children:h.length===1?"1 thing went wrong":`${h.length} things went wrong`}),o.jsx("ul",{children:h.slice(0,8).map((g,v)=>o.jsx("li",{children:g.message},v))})]}),o.jsxs("div",{className:"sc-imp-foot",children:[u?o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void p(),disabled:i,children:i?"Stopping":"Stop importing"}):o.jsx("span",{className:"sc-imp-done",children:(r==null?void 0:r.stage)==="cancelled"?"Stopped. What was already imported is kept.":"Nothing left to do."}),o.jsx("button",{type:"button",className:"sc-wiz-cta",onClick:n,children:u?"Leave it running":"Close"})]})]})}const ta="(max-width: 767px)";function Sr(e){const[t,n]=s.useState(()=>window.matchMedia(e).matches);return s.useEffect(()=>{const r=window.matchMedia(e),a=()=>n(r.matches);return a(),r.addEventListener("change",a),()=>r.removeEventListener("change",a)},[e]),t}const Q3=new Map;function NY(e){let t=Q3.get(e);if(!t){const n=window.matchMedia(e);t={mq:n,subscribe:r=>(n.addEventListener("change",r),()=>n.removeEventListener("change",r))},Q3.set(e,t)}return t}function Yv(){const e=NY("(hover: none)");return s.useSyncExternalStore(e.subscribe,()=>e.mq.matches,()=>!1)}function MY(){const{tasks:e,running:t,unread:n,panelOpen:r,setPanelOpen:a,markSeen:i}=Ca(),{brand:l}=dn(),u=Sr(ta),f=RY(),[h,p]=s.useState(null);s.useEffect(()=>p(null),[l.id]),yN(r,()=>a(!1));const g=e.find(k=>k.state==="running")??null,v=t>0?"busy":n>0?"new":"quiet",w="Activity"+(n?`, ${n} unread`:"")+(t?`, ${t} task${t===1?"":"s"} running`:""),b=v==="busy"&&g?`Rendering, ${pc(g.startedAt,Date.now())}`:"Activity",y=o.jsx(yY,{mode:v,lead:g,running:t,unread:n,animate:f});return u?o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"sc-act-btn sc-notif-btn","data-mode":v,"data-on":r||void 0,"aria-label":w,"aria-expanded":r,onClick:()=>a(!r),children:y}),r?o.jsx(wN,{label:"Activity",onClose:()=>a(!1),children:o.jsx(Y3,{onClose:()=>a(!1),onSeen:i,onOpenDetail:p})}):null,h?o.jsx(O6,{brandId:l.id,jobId:h,onDismiss:()=>p(null)}):null]}):o.jsxs(o.Fragment,{children:[o.jsxs(Xu,{open:r,onOpenChange:a,children:[o.jsx(lr,{label:b,children:o.jsx(Qu,{children:o.jsx("button",{type:"button",className:"sc-act-btn sc-notif-btn","data-mode":v,"aria-label":w,children:y})})}),o.jsx(Ju,{align:"end",sideOffset:20,className:"sc-notif-pop","aria-label":"Activity",children:o.jsx(Y3,{onClose:()=>a(!1),onSeen:i,onOpenDetail:p})})]}),h?o.jsx(O6,{brandId:l.id,jobId:h,onDismiss:()=>p(null)}):null]})}function RY(){const[e,t]=s.useState(!1),n=s.useRef(!1);return s.useEffect(()=>{n.current||(n.current=!0,t(!0))},[]),e}function PY(){const e=Gv(16);return o.jsx("nav",{className:"sc-nav sc-desktop-only","aria-label":"Main",children:o.jsx("ul",{children:e.map(t=>o.jsx("li",{children:o.jsx(Bn,{to:t.to,"data-active":t.active||void 0,"data-guide":`nav.${t.key}`,"aria-current":t.active?"page":void 0,children:t.label})},t.key))})})}const I6=s.createContext(null);function kN({label:e,className:t,offset:n=22,trigger:r,children:a}){const i=Sr(ta),[l,u]=s.useState(!1),f=s.useRef(null),h=()=>u(!1),p=s.useCallback(()=>{var g;return(g=f.current)==null?void 0:g.focus({preventScroll:!0})},[]);return yN(l,h),i?o.jsxs(o.Fragment,{children:[s.cloneElement(r,{ref:f,onClick:()=>u(!l),"aria-haspopup":"dialog","aria-expanded":l,"data-on":l||void 0}),l&&o.jsx(wN,{label:e,onClose:h,children:o.jsxs("div",{className:"sc-menu-sheet",children:[o.jsx("div",{className:"sc-menu-head",children:e}),o.jsx(I6.Provider,{value:{close:h,focusTrigger:p},children:a})]})})]}):o.jsxs(ws,{open:l,onOpenChange:u,modal:!1,children:[o.jsx(ys,{children:s.cloneElement(r,{ref:f})}),o.jsxs(bs,{align:"end",sideOffset:n,className:`sc-menu ${t??""}`,onPointerDownOutside:g=>{var v;(v=f.current)!=null&&v.contains(g.target)&&g.preventDefault()},onCloseAutoFocus:g=>{g.preventDefault();const v=document.activeElement;(!v||v===document.body)&&p()},children:[o.jsx("div",{className:"sc-menu-head",children:e}),o.jsx(I6.Provider,{value:{close:null,focusTrigger:p},children:a})]})]})}function Ou({className:e="sc-menu-item",to:t,onSelect:n,disabled:r,children:a,...i}){const l=s.useContext(I6),u=l==null?void 0:l.close,f=n?()=>{l==null||l.focusTrigger(),setTimeout(()=>{l==null||l.focusTrigger(),n()},0)}:void 0;if(u){const h=()=>{u(),f==null||f()};return t?o.jsx(Bn,{className:e,to:t,onClick:u,...i,children:a}):o.jsx("button",{type:"button",className:e,onClick:h,disabled:r,...i,children:a})}return t?o.jsx(Yn,{asChild:!0,className:e,...i,children:o.jsx(Bn,{to:t,children:a})}):o.jsx(Yn,{className:e,onSelect:f,disabled:r,...i,children:a})}function SN(e,t){return[...e].sort((n,r)=>t(n).localeCompare(t(r),void 0,{sensitivity:"base"})||n.slug.localeCompare(r.slug))}function LY(e,t,n){const r=t.trim().toLowerCase(),a=r?e.filter(i=>n(i).toLowerCase().includes(r)||i.slug.toLowerCase().includes(r)):e;return SN(a,n)}function qn({label:e,title:t,body:n,busy:r,onConfirm:a,fullWidth:i,open:l,onOpenChange:u,tone:f="red"}){const h=s.useRef(!1);s.useEffect(()=>{h.current=!1},[l]);const p=()=>{h.current||(h.current=!0,a())},g=s.useRef(null),v=l!==void 0;return o.jsxs(kf,{open:l,onOpenChange:w=>{w&&(h.current=!1),u==null||u(w)},children:[l===void 0&&o.jsx(eA,{children:o.jsx("button",{type:"button",className:f==="red"?"sc-btn sc-btn-ghost sc-btn-red":"sc-btn sc-btn-ghost",disabled:r,style:i?{width:"100%"}:void 0,children:e})}),o.jsxs(Sf,{maxWidth:"420px",onOpenAutoFocus:()=>{v&&(g.current=document.activeElement)},onCloseAutoFocus:w=>{var b;!v||!((b=g.current)!=null&&b.isConnected)||(w.preventDefault(),g.current.focus())},children:[o.jsx(Ef,{children:t}),o.jsx(Cf,{size:"2",children:n}),o.jsxs(Ds,{gap:"3",mt:"4",justify:"end",children:[o.jsx(Af,{children:o.jsx(ma,{variant:"soft",color:"gray",children:"Cancel"})}),o.jsx(jf,{children:o.jsx(ma,{color:"red",onClick:p,disabled:r,children:e})})]})]})]})}function $Y(){const{brand:e}=dn(),t=gl(),n=_n(),r=um(),{push:a}=cr(),[i,l]=s.useState(!1),u=async()=>{const f=await r.quit();f&&a({kind:"warning",title:"Scenri is still working",detail:f})};return o.jsxs(o.Fragment,{children:[o.jsxs(kN,{label:"Brands",className:"sc-menu-brand",trigger:o.jsx("button",{type:"button",className:"sc-org-btn","aria-label":`${va(e)}, brand and settings`,children:o.jsx(gN,{brand:e,size:32,round:!0})}),children:[o.jsx(DY,{}),o.jsx("div",{className:"sc-menu-rule"}),o.jsxs(Ou,{onSelect:()=>n("/setup"),children:[o.jsx(fr,{size:16,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Set up a brand"})]}),o.jsxs(Ou,{onSelect:()=>t(),children:[o.jsx(RO,{size:16,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Settings"})]}),r.thisComputer&&o.jsxs(Ou,{"data-quit":"",onSelect:()=>l(!0),children:[o.jsx(UO,{size:16,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Shut down Scenri"})]})]}),o.jsx(qn,{open:i,onOpenChange:l,label:"Shut down Scenri",title:"Shut down Scenri?",body:"This stops the Scenri server on this machine. Every open tab loses the studio until you start it again, from your desktop icon or with npx scenri.",busy:r.busy!=="idle",onConfirm:()=>void u()})]})}const TY=7;function DY(){const{brands:e}=Hn(),{brand:t}=dn(),n=_n(),[r,a]=s.useState(""),i=v=>va(v).trim().toLowerCase(),l=new Map;for(const v of e)l.set(i(v),(l.get(i(v))??0)+1);const u=e.length>=TY,f=r.trim(),h=u&&f?LY(e,f,va):[],p=v=>{const w=v.id===t.id,b=(l.get(i(v))??0)>1;return o.jsxs(Ou,{"data-current":w||void 0,"data-two-line":b||void 0,onSelect:w?void 0:()=>n(Eo(v)),children:[o.jsx(gN,{brand:v,size:20,round:!0}),o.jsxs("span",{className:"sc-menu-brand-lb",children:[o.jsx("span",{dir:"auto",children:va(v)}),b&&o.jsxs("span",{className:"sc-menu-brand-sub",children:["/",v.slug]})]}),w&&o.jsxs(o.Fragment,{children:[o.jsx(Un,{size:14,className:"sc-menu-check","aria-hidden":"true"}),o.jsx("span",{className:"sc-vh",children:", current brand"})]})]},v.id)},g=SN(e.filter(v=>v.id!==t.id),va);return u?o.jsxs(o.Fragment,{children:[o.jsxs("label",{className:"sc-menu-find",children:[o.jsx(Gu,{size:16,"aria-hidden":"true"}),o.jsx("input",{type:"search",value:r,placeholder:"Find a brand","aria-label":"Find a brand",onChange:v=>a(v.target.value),onKeyDown:v=>{const w=h.find(b=>b.id!==t.id);v.key!=="Enter"||!w||(v.preventDefault(),n(Eo(w)))}})]}),o.jsx("div",{className:"sc-menu-brands",children:f?h.length>0?h.map(p):o.jsx("p",{className:"sc-menu-none",children:"No brand by that name."}):o.jsxs(o.Fragment,{children:[p(t),g.map(p)]})})]}):o.jsxs(o.Fragment,{children:[p(t),g.map(p)]})}function HY(){const e=Sr("(min-width: 1024px)"),t=TA(),[n]=ll();return e?o.jsx("button",{type:"button",className:"sc-learn-btn","aria-haspopup":"dialog","data-on":n.has("learn")||void 0,onClick:()=>t(),children:"Learn"}):null}function ii(e){var n;if(e.avatarUrl)return{src:e.avatarUrl};const t=e.previewUrl??((n=e.shots)==null?void 0:n[0])??null;return t?{src:t,crop:"top"}:{src:null}}function qv(e){const t=qr(e.avatar);if(t)return{src:t};const n=a=>{var i;return Array.isArray(a)?qr((i=a[0])==null?void 0:i.file):null},r=qr(e.preview)??n(e.shots)??n(e.sourceRefs);return r?{src:r,crop:"top"}:{src:null}}const EN=["hero","close","hands","angle","bold"],F6=e=>Array.isArray(e)?e.map(t=>qr(t==null?void 0:t.file)).filter(t=>!!t):[],Xv=e=>{var t;return(((t=e==null?void 0:e.json)==null?void 0:t.characters)??[]).filter(n=>(n==null?void 0:n.origin)==="custom")};function K0(e){return e.length<2?[...e]:e.slice().reverse()}function CN(e){const t=e.filter(n=>n.origin!=="catalog");return t.length===e.length?K0(e):[...K0(t),...e.filter(n=>n.origin==="catalog")]}function Hf(e){return K0(Xv(e).filter(t=>!t.supersededBy).map(jN))}function OY(e,t){const n=Xv(e).find(r=>r.id===t);return n?jN(n):void 0}function Qv(e,t){var i;const n=Xv(e),r=new Set([t]);let a=t;for(;;){const l=(i=n.find(u=>u.id===a))==null?void 0:i.supersededBy;if(typeof l!="string"||!l||r.has(l)||!n.some(u=>u.id===l))return a;r.add(l),a=l}}function jN(e){var a;const t=F6(e.shots),n=F6(e.sourceRefs),r=qr(e.preview)??t[0]??n[0]??null;return{id:String(e.id),name:String(e.name??""),promptName:e.promptName,presentation:e.presentation==="man"?"man":"woman",descriptor:String(e.descriptor??""),ageRange:String(e.ageRange??""),hair:String(e.hair??""),identityNotes:String(e.identityNotes??""),negativeConstraints:Array.isArray(e.negativeConstraints)?e.negativeConstraints.map(String):[],facial:String(e.facial??""),skin:String(e.skin??""),build:String(e.build??""),wardrobeDefault:"",suitableCategories:Array.isArray(e.suitableCategories)?e.suitableCategories.map(String):[],suitableStyles:[],width:1024,height:1280,previewUrl:r,avatarUrl:qr(e.avatar),custom:!0,shots:t,sourceRefs:n,identityEdits:Array.isArray(e.identityEdits)?e.identityEdits.map(String):[],...e.revisionOf?{revisionOf:String(e.revisionOf)}:{},...e.supersededBy?{supersededBy:String(e.supersededBy)}:{},...e.source==="synthetic"||e.source==="photos"?{source:e.source}:{},...(a=e.likeness)!=null&&a.attestedAt?{likeness:{attestedAt:String(e.likeness.attestedAt),version:String(e.likeness.version??"v1")}}:{}}}function Dc(e){var n;const t=((n=e==null?void 0:e.json)==null?void 0:n.scenes)??[];return K0(t.map(FY))}function G0(e,t){return Dc(e).find(n=>n.id===t)}const IY=["place",...EN];function FY(e){var l;const t=F6(e.refs),n=qr(e.preview)??t[0]??null,r=Array.isArray(e.examples)?e.examples.filter(u=>EN.includes(u==null?void 0:u.role)&&qr(u==null?void 0:u.file)).map(u=>({role:u.role,url:qr(u.file),hash:String(u.file).slice(6),earlier:u.from!==e.preview,with:u.presenter?"presenter":"product",...u.setup?{setup:String(u.setup)}:{}})):void 0,a=IY.includes(e.cover)?e.cover:void 0,i=a&&a!=="place"?(l=r==null?void 0:r.find(u=>u.role===a&&!u.earlier))==null?void 0:l.url:void 0;return{id:String(e.id),name:String(e.name??""),promptName:e.promptName,description:String(e.description??""),lighting:String(e.lighting??""),subject:e.subject==="product"||e.subject==="person"?e.subject:"either",collections:Array.isArray(e.collections)?e.collections.map(String):[],verticals:Array.isArray(e.verticals)?e.verticals.map(String):[],keywords:Array.isArray(e.keywords)?e.keywords.map(String):void 0,prompt:String(e.prompt??""),width:Number(e.width)||1024,height:Number(e.height)||1280,previewUrl:i??n,placeUrl:n,...a?{cover:a}:{},previewColor:null,custom:!0,refs:t,previewHash:/^asset:[a-f0-9]{32}$/.test(String(e.preview??""))?String(e.preview).slice(6):null,...e.anchor===!0?{anchor:!0}:{},instruction:e.instruction?String(e.instruction):void 0,camera:e.camera?String(e.camera):void 0,figure:e.figure?String(e.figure):void 0,figureTreatment:e.figureTreatment?String(e.figureTreatment):void 0,setups:Array.isArray(e.setups)?e.setups.filter(u=>(u==null?void 0:u.id)&&(u==null?void 0:u.label)&&(u==null?void 0:u.camera)).map(u=>({id:String(u.id),label:String(u.label),camera:String(u.camera)})):void 0,examples:r}}function _Y(e){const t=e.cover;return!t||t==="place"?"place":!e.examples||e.examples.some(n=>n.role===t&&!n.earlier)?t:"place"}function Jh(e,t){const n=new Set(e.map(r=>r.id));return[...e,...t.filter(r=>!n.has(r.id))]}function _6(e,t){return t.map(n=>n.t==="character"&&n.id?{...n,id:Qv(e,n.id)}:n)}function AN(){const{brand:e,products:t}=dn(),{scenes:n,presenters:r,demoProducts:a,showcase:i}=Hn();return s.useMemo(()=>{const l={presenters:Hf(e),scenes:Dc(e)},u=new Set,f=b=>!b||u.has(b)?null:(u.add(b),b),h=(b,y)=>{for(const k of b){const S=f(y(k));if(S)return Pn(S,"tile")}return null},p=b=>h(i.filter(y=>{var k;return(((k=y.brief)==null?void 0:k.tokens)??[]).some(S=>(S==null?void 0:S.t)===b)}),y=>y.previewUrl),g=h([...t].reverse(),b=>{var y,k;return qr((k=(y=b==null?void 0:b.shots)==null?void 0:y[0])==null?void 0:k.file)}),v=h(l.presenters,b=>b.previewUrl??ii(b).src),w=h(l.scenes,b=>b.previewUrl);return{product:{url:g??p("product")??h(a,b=>b.previewUrl)??null,count:t.length,own:!!g},presenter:{url:v??p("character")??h(r,b=>b.previewUrl??ii(b).src)??null,count:l.presenters.length,own:!!v},scene:{url:w??h(n,b=>b.previewUrl)??p("template")??null,count:l.scenes.length,own:!!w}}},[e,t,n,r,a,i])}const VY=[{kind:"product",label:"Product",line:"What you are photographing",noun:"product",icon:Tp},{kind:"presenter",label:"Presenter",line:"Who appears in the shot",noun:"presenter",icon:Lp},{kind:"scene",label:"Scene",line:"Where it takes place",noun:"scene",icon:Pp}],J3=(e,t)=>e===0?"None yet":`${e} ${t}${e===1?"":"s"}`;function ZY({suggest:e,onPick:t}){const n=s.useRef(null),{close:r}=Vr("new"),a=AN(),i=()=>{var l,u;(u=(l=n.current)==null?void 0:l.querySelector(e?`[data-kind="${e}"]`:"[data-kind]"))==null||u.focus()};return s.useEffect(i,[e]),o.jsxs(_s,{className:"sc-newpick",maxWidth:"620px",onDismiss:r,onOpenAutoFocus:l=>{l.preventDefault(),i()},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ks,{className:"sc-newdlg-title",children:"Add to this brand"}),o.jsx(Ss,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(Mn,{size:16})})})]}),o.jsx("p",{className:"sc-newdlg-sub",children:"The three things every shot is made from."}),o.jsx("div",{className:"sc-newdlg-body",children:o.jsx("div",{className:"sc-pickgrid",ref:n,children:VY.map(({kind:l,label:u,line:f,noun:h,icon:p})=>{const{url:g,count:v,own:w}=a[l];return o.jsxs("button",{type:"button",className:"sc-pick","data-kind":l,onClick:()=>t(l),"aria-label":`${u}. ${f}. ${J3(v,h)}.`,children:[o.jsxs("span",{className:"sc-pick-media",children:[g?o.jsx("img",{src:g,alt:"",loading:"lazy"}):o.jsx("span",{className:"sc-pick-blank",children:o.jsx(p,{size:22})}),w&&o.jsx("span",{className:"sc-pick-mine",children:"Yours"})]}),o.jsxs("span",{className:"sc-pick-cap",children:[o.jsx("b",{children:u}),o.jsx("small",{children:f})]}),o.jsx("span",{className:"sc-pick-count",children:J3(v,h)})]},l)})})})]})}const Iu=14,zY=768,li=[{px:190,label:"Compact",cells:3,cols:6,min:200},{px:320,label:"Large",cells:2,cols:5,min:280}];function BY(e){let t=li[0];for(const n of li)Math.abs(n.px-e)<Math.abs(t.px-e)&&(t=n);return t}const NN=320;function MN(e){const t=typeof e=="number"&&Number.isFinite(e)?e:NN;let n=li[0].px;for(const r of li)Math.abs(r.px-t)<Math.abs(n-t)&&(n=r.px);return n}const ed=5;function Hc(e){const t=typeof e=="number"?e:ed;return t===7||t===5?t:t===6?5:ed}function UY(e){const[t,n]=s.useState(0);return s.useLayoutEffect(()=>{if(!e)return;const r=e.clientWidth;n(a=>a===r?a:r)}),s.useLayoutEffect(()=>{if(!e)return;const r=()=>{const i=e.clientWidth;n(l=>l===i?l:i)};r();const a=new ResizeObserver(r);return a.observe(e),()=>a.disconnect()},[e]),t}function WY(){const[e,t]=s.useState(()=>window.innerWidth);return s.useEffect(()=>{let n=0;const r=()=>{cancelAnimationFrame(n),n=requestAnimationFrame(()=>t(window.innerWidth))};return window.addEventListener("resize",r),()=>{cancelAnimationFrame(n),window.removeEventListener("resize",r)}},[]),e}function Xg(e,t){return Math.max(1,Math.floor((e-Iu*(t-1))/t))}function KY(e,t,n){if(e<=0)return{tile:t,cols:1};if(n)return{tile:Math.floor((e-Iu)/2),cols:2};const r=li[1],a=li[0],i=Math.min(r.cols,Math.max(1,Math.floor((e+Iu)/(r.min+Iu))));if(BY(t).px===r.px)return{tile:Xg(e,i),cols:i};let l=Math.min(a.cols,i+1);return l>1&&Xg(e,l)<a.min&&(l=i),{tile:Xg(e,l),cols:l}}function ek(e){return Math.max(1,e)}function vm(e){return Hc(e)===5?"large":"compact"}const Of=s.createContext("large");function RN(){return s.useContext(Of)}const GY=[{value:7,label:"Compact",hint:"More cards per row",cells:3},{value:5,label:"Large",hint:"Fewer, larger cards",cells:2}],YY=li.map(e=>({value:e.px,label:e.label,hint:e.label==="Compact"?"More shots per row":"Fewer, larger shots",cells:e.cells}));function wm({value:e,onChange:t}){return o.jsx(PN,{label:"Grid size",value:Hc(e),options:GY,onChange:n=>t(n)})}function qY({value:e,onChange:t}){return o.jsx(PN,{label:"Shot size",value:MN(e),options:YY,onChange:t})}function PN({label:e,value:t,options:n,onChange:r}){const a=s.useRef(null);return s.useLayoutEffect(()=>{const i=a.current;if(!i)return;const l=()=>{const f=i.querySelector(":scope > button[data-on]");if(!f){i.style.setProperty("--sc-density-x","0px"),i.style.setProperty("--sc-density-w","0px");return}i.style.setProperty("--sc-density-x",`${f.offsetLeft}px`),i.style.setProperty("--sc-density-w",`${f.offsetWidth}px`)};l(),i.dataset.inkReady||requestAnimationFrame(()=>{i.dataset.inkReady=""});const u=new ResizeObserver(l);return u.observe(i),()=>u.disconnect()},[t]),o.jsxs("div",{ref:a,className:"sc-density",role:"radiogroup","aria-label":e,children:[o.jsx("span",{className:"sc-density-ink","aria-hidden":!0}),n.map(i=>{const l=t===i.value;return o.jsx("button",{type:"button",role:"radio",className:"sc-density-opt","aria-checked":l,"aria-label":i.label,title:i.hint,"data-on":l||void 0,onClick:()=>{l||r(i.value)},children:o.jsx(XY,{cells:i.cells})},i.value)})]})}function XY({cells:e}){const t=e,n=16,r=1.5,a=1.5,l=(n-r*2-a*(t-1))/t,u=Math.max(.6,l*.22),f=[];for(let h=0;h<t;h++)for(let p=0;p<t;p++)f.push({x:r+p*(l+a),y:r+h*(l+a)});return o.jsx("svg",{className:"sc-density-icon",width:n,height:n,viewBox:`0 0 ${n} ${n}`,"aria-hidden":!0,children:f.map(h=>o.jsx("rect",{x:h.x,y:h.y,width:l,height:l,rx:u,ry:u,fill:"currentColor"},`${h.x}-${h.y}`))})}function ym(e){const t=Hc(e),n=(t===5?li[1]:li[0]).min;return{"--sc-wall-cols":String(t),"--sc-tile-min":`${n}px`}}function Fu({name:e}){const t={size:14,"aria-hidden":!0};switch(e){case"open":return o.jsx(v9,{...t});case"continue":return o.jsx(_a,{...t});case"open-tab":return o.jsx(Ku,{...t});case"refine":return o.jsx(N9,{...t});case"select":return o.jsx(Un,{...t,weight:"bold"});case"keep":return o.jsx(Ua,{...t});case"kept":return o.jsx(Ua,{...t,weight:"fill"});case"unset":return o.jsx(m9,{...t});case"versions":return o.jsx(q9,{...t});case"archive":return o.jsx(Rp,{...t});case"restore":return o.jsx(H0,{...t});case"delete":case"discard":return o.jsx(ul,{...t});case"use":return o.jsx(fr,{...t});case"duplicate":return o.jsx(Fh,{...t});case"rename":return o.jsx(zO,{...t});case"edit":return o.jsx(id,{...t});case"cover":return o.jsx(HO,{...t})}}function tk(e,t,n){return e.map(r=>o.jsxs("span",{style:{display:"contents"},children:[r.separated&&o.jsx(n,{}),o.jsxs(t,{color:r.danger?"red":void 0,onSelect:r.onSelect,children:[o.jsx(Fu,{name:r.icon}),r.label]})]},r.key))}function QY({id:e,previewUrl:t,pending:n,title:r,primary:a,secondary:i,useLabel:l,variant:u,onOpen:f,onUse:h,href:p,selected:g,onToggle:v,bookmarked:w,onBookmark:b,menu:y,fresh:k,size:S="grid",chosen:E,batching:j,onPick:N}){const[A,T]=s.useState(!1),[P,C]=s.useState(!1),R=s.useRef(null),$=Yv(),H=RN(),D=(oe,me)=>bN(oe,me,$),q=u==="use"&&!!f&&!!h&&!j,_=y??[],U=_.find(oe=>oe.key==="delete"),Y=_.length>0,I=oe=>{oe.preventDefault(),oe.stopPropagation(),N==null||N(e)};s.useEffect(()=>{if(!P)return;const oe=me=>{var ce;(ce=R.current)!=null&&ce.contains(me.target)||C(!1)};return document.addEventListener("pointerdown",oe),()=>document.removeEventListener("pointerdown",oe)},[P]);const F=t&&!A?o.jsx("img",{src:Pn(t,"tile"),srcSet:Jl(t),sizes:SA[H],alt:"",loading:"lazy",onError:()=>T(!0)}):n?o.jsx("span",{className:"sc-shimmer"}):o.jsx("span",{className:"sc-lookcard-blank",children:o.jsx(Js,{size:20})}),O=oe=>{oe.preventDefault(),oe.stopPropagation()},Z=Y?o.jsxs(ws,{children:[D("More",o.jsx(ys,{children:o.jsxs("button",{type:"button",className:"sc-cell-ctl sc-lookcard-more","aria-label":`More for ${a}`,onClick:oe=>oe.stopPropagation(),onContextMenu:oe=>oe.stopPropagation(),children:[o.jsx(F4,{className:"sc-lookcard-more-vert",size:16,weight:"bold"}),o.jsx(I4,{className:"sc-lookcard-more-horiz",size:16,weight:"bold"})]})})),o.jsx(bs,{side:"top",align:"end",sideOffset:4,collisionPadding:12,children:tk(_,Yn,nc)})]}):null,V=Z||U||b?o.jsxs("div",{className:"sc-corner",children:[Z,U&&D(U.label,o.jsx("button",{type:"button",className:"sc-cell-ctl sc-lookcard-remove sc-cell-danger","aria-label":U.label,onClick:oe=>{O(oe),U.onSelect()},children:o.jsx(ul,{size:15})})),b&&D(w?"Remove from Keepers":"Add to Keepers",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-lookcard-keep","data-on":w||void 0,"aria-pressed":!!w,"aria-label":w?`Remove ${a} from Keepers`:`Add ${a} to Keepers`,onClick:oe=>{O(oe),b(e)},children:o.jsx(Ua,{size:15,weight:w?"fill":"regular"})}))]}):null,B=o.jsx("span",{className:"sc-lookcard-cap",title:r,children:o.jsxs("span",{className:"sc-lookcard-copy",children:[o.jsx("b",{dir:"auto",children:a}),i&&o.jsx("span",{children:i})]})});if(u==="select")return o.jsxs("button",{type:"button",className:"sc-lookcard","data-fb-id":e,"data-variant":"select","data-size":S,"data-on":g||void 0,"data-just-added":k||void 0,"aria-pressed":!!g,"aria-label":r,onClick:()=>v==null?void 0:v(e),children:[o.jsxs("span",{className:"sc-lookcard-media",children:[F,o.jsx("span",{className:"sc-lookcard-veil","aria-hidden":!0}),o.jsx("span",{className:"sc-lookcard-tick","aria-hidden":!0,children:o.jsx(Un,{size:11,weight:"bold"})})]}),B]});const K=()=>{if(j&&N){N(e);return}if(q&&$){if(!P){C(!0);return}C(!1)}f?f(e):h==null||h(e)},ee=()=>{C(!1),h==null||h(e)},se=o.jsxs("div",{ref:R,className:"sc-lookcard","data-fb":"catalog-card","data-fb-id":e,"data-variant":u,"data-size":S,"data-armed":P||void 0,"data-just-added":k||void 0,"data-picked":E||void 0,"data-batching":j||void 0,children:[o.jsxs("div",{className:"sc-lookcard-media",children:[p?o.jsxs(Bn,{className:"sc-lookcard-open",to:p,"aria-label":j?`${E?"Deselect":"Select"} ${a}`:r,onClick:oe=>{if(j&&N){I(oe);return}if(q&&$){if(!P){oe.preventDefault(),C(!0);return}C(!1)}},children:[F,!j&&o.jsx("span",{className:"sc-lookcard-veil","aria-hidden":!0})]}):o.jsxs("button",{type:"button",className:"sc-lookcard-open",onClick:K,"aria-label":j?`${E?"Deselect":"Select"} ${a}`:r,children:[F,!j&&o.jsx("span",{className:"sc-lookcard-veil","aria-hidden":!0})]}),q&&o.jsx("button",{type:"button",className:"sc-lookcard-use",onClick:ee,children:l}),N&&D(E?"Deselect":"Select",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-lookcard-pick","data-on":E||void 0,"aria-pressed":!!E,"aria-label":E?`Deselect ${a}`:`Select ${a}`,onClick:I,children:o.jsx(Un,{size:13,weight:"bold"})}))]}),V,B]});return _.length===0||$?se:o.jsxs(Mf,{children:[o.jsx(Rf,{children:se}),o.jsx(Pf,{children:tk(_,Lf,om)})]})}function bm({size:e="grid",count:t=4,caption:n=!0}){return o.jsx(o.Fragment,{children:Array.from({length:t},(r,a)=>o.jsx("div",{className:"sc-lookcard","data-variant":"skeleton","data-size":e,"data-caption":n?void 0:"photo","aria-hidden":!0},a))})}const gd=s.memo(QY),JY=/^(p|product|products|item|items|dp|sku)$/i;function eq(e){let t="";try{const r=new URL(e).pathname.split("/").filter(Boolean);t=[...r].reverse().find(a=>!JY.test(a)&&!/^\d+$/.test(a))??r.at(-1)??""}catch{t=e}const n=decodeURIComponent(t).replace(/\.(html?|php|aspx?)$/i,"").replace(/[-_+]+/g," ").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):e}function tq(e,t){if(!t)return!0;const n=a=>a.toLowerCase().replace(/[^a-z0-9]+/g," "),r=n(e);return n(t).split(" ").filter(Boolean).every(a=>r.includes(a))}const Qg=24,nq=12;function LN({brandId:e,scan:t,busy:n,error:r,onImport:a,onImportAll:i,onDismiss:l}){const u=s.useMemo(()=>t.candidateUrls.length?t.candidateUrls:(t.cards??[]).map(K=>K.url).filter(Boolean),[t.candidateUrls,t.cards]),[f,h]=s.useState(""),[p,g]=s.useState(()=>new Set(u)),[v,w]=s.useState(Qg),[b,y]=s.useState(()=>{const K=new Map;for(const ee of t.cards??[])ee.url&&K.set(ee.url,{externalKey:ee.externalKey,title:ee.title,url:ee.url,images:ee.image?[{url:ee.image}]:[]});for(const ee of t.candidates)ee.url&&K.set(ee.url,ee);return K}),k=s.useRef(new Set),S=s.useRef(b),E=s.useRef(!0),[j,N]=s.useState(0);s.useEffect(()=>(E.current=!0,()=>{E.current=!1}),[]);const[A,T]=s.useState(null),P=s.useRef(null),C=s.useMemo(()=>u.map(K=>({url:K,name:eq(K)})),[u]),R=s.useMemo(()=>C.filter(K=>tq(K.name,f)),[C,f]),$=s.useMemo(()=>R.slice(0,v),[R,v]);s.useEffect(()=>w(Qg),[f]);const H=s.useRef([]),D=s.useRef(0),q=s.useRef(()=>{}),_=2,U=120,Y=s.useCallback(()=>{for(;D.current<_&&H.current.length;){const K=H.current.splice(Math.max(0,H.current.length-nq));if(!K.length)return;D.current++,N(D.current),je.catalogDetails(e,K).then(({products:ee})=>{if(!E.current)return;const se=new Map(S.current);for(const oe of ee)oe.url&&se.set(oe.url,oe);for(let oe=0;oe<ee.length&&oe<K.length;oe++)se.has(K[oe])||se.set(K[oe],ee[oe]);S.current=se,y(se)}).catch(()=>{for(const ee of K)k.current.delete(ee)}).finally(()=>{D.current=Math.max(0,D.current-1),E.current&&(N(D.current),q.current())})}},[e]);q.current=Y,s.useEffect(()=>{const K=P.current;if(!K)return;const ee=new IntersectionObserver(se=>{let oe=!1;for(const me of se){if(!me.isIntersecting)continue;const ce=me.target.dataset.fbId;if(ee.unobserve(me.target),!(!ce||S.current.has(ce)||k.current.has(ce))){for(k.current.add(ce),H.current.push(ce);H.current.length>U;){const we=H.current.shift();we&&k.current.delete(we)}oe=!0}}oe&&q.current()},{root:K,rootMargin:"250% 0px"});for(const se of K.querySelectorAll("[data-fb-id]"))ee.observe(se);return()=>ee.disconnect()},[v,f]),s.useEffect(()=>{if(!A||v>=R.length)return;const K=A.closest(".sc-wizpick-grid"),ee=new IntersectionObserver(se=>{se.some(oe=>oe.isIntersecting)&&w(oe=>oe+Qg)},{root:K,rootMargin:"0px 0px 300% 0px"});return ee.observe(A),()=>ee.disconnect()},[A,v,R.length]);const I=s.useCallback(K=>{g(ee=>{const se=new Set(ee);return se.delete(K)||se.add(K),se})},[]),F=R.length>0&&R.every(K=>p.has(K.url)),O=p.size===u.length,Z=()=>{g(K=>{const ee=new Set(K);for(const se of R)F?ee.delete(se.url):ee.add(se.url);return ee})},V=p.size,B=V===1?"1 product":`${V.toLocaleString()} products`;return o.jsxs(_s,{open:!0,className:"sc-wizpick",maxWidth:"760px",described:!0,onDismiss:l,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ks,{className:"sc-newdlg-title",children:"Products on your site"}),o.jsx(Ss,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(Mn,{size:16})})})]}),o.jsx(md,{className:"sc-wizpick-sub",children:`${u.length.toLocaleString()} found. Everything is selected; untick what you do not want, or search for what you do.`}),o.jsxs("div",{className:"sc-wizpick-tools",children:[o.jsxs("span",{className:"sc-wizpick-search",children:[o.jsx(Gu,{size:13}),o.jsx("input",{type:"search",value:f,onChange:K=>h(K.target.value),placeholder:`Search ${u.length.toLocaleString()} products`,"aria-label":"Search products"})]}),o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:Z,disabled:!R.length,children:F?"Select none":f?`Select these ${R.length.toLocaleString()}`:"Select all"}),o.jsxs("span",{className:"sc-wizpick-count",children:[V.toLocaleString()," selected"]})]}),o.jsxs("div",{className:"sc-wizpick-grid",ref:P,children:[$.map(K=>{var se,oe;const ee=b.get(K.url);return o.jsx(gd,{id:K.url,previewUrl:((oe=(se=ee==null?void 0:ee.images)==null?void 0:se[0])==null?void 0:oe.url)??null,pending:!ee,title:(ee==null?void 0:ee.title)??K.name,primary:(ee==null?void 0:ee.title)??K.name,secondary:(ee==null?void 0:ee.price)!=null?`${ee.currency??""} ${ee.price}`.trim():(ee==null?void 0:ee.category)??"",useLabel:"Import",variant:"select",selected:p.has(K.url),onToggle:I,size:"grid"},K.url)}),v<R.length&&o.jsx("div",{className:"sc-wizpick-end",ref:T,"aria-hidden":!0}),!R.length&&o.jsxs("p",{className:"sc-wizpick-empty",children:["Nothing here matches “",f,"”."]})]}),o.jsxs("div",{className:"sc-wizpick-foot",children:[o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:l,children:"Not now"}),r?o.jsx("span",{className:"sc-wizpick-error",role:"alert",children:r}):j>0&&o.jsx("span",{className:"sc-wizpick-loading",children:"Loading products"}),o.jsx("button",{type:"button",className:"sc-wiz-cta",disabled:!V||n||b.size===0&&j>0,onClick:()=>O?i():a([...p]),children:n?"Importing":`Import ${B}`})]})]})}const Jg=700,rq=45e3,sq=3e3;function $N(e,t){const[n,r]=s.useState(null),[a,i]=s.useState(!1),[l,u]=s.useState(!1),[f,h]=s.useState(null),[p,g]=s.useState(0),v=s.useRef(!0);s.useEffect(()=>(v.current=!0,()=>{v.current=!1}),[]),s.useEffect(()=>{if(!e)return;let y=!1,k,S=null;i(!0),u(!1),r(null),h(null);const E=(N,A)=>{r(N),h(A),i(!1),u(!0)};return(async()=>{try{const{scanId:N}=await je.catalogScan(e,t);if(S=N,y||!v.current){je.cancelCatalogScan(e,N).catch(()=>{});return}const A=Date.now()+rq,T=async()=>{if(!(y||!v.current)){if(Date.now()>A){E(null,{kind:"timeout"});return}try{const P=await je.catalogScanState(e,N,AbortSignal.timeout(sq));if(y||!v.current)return;if(P.status==="running"){k=setTimeout(T,Jg);return}P.result?E(P.result,null):E(null,{kind:"error",reason:P.error??"The look for a shop did not finish."})}catch(P){if(y||!v.current)return;if((P==null?void 0:P.status)===404){E(null,{kind:"error",reason:"The look for a shop was interrupted."});return}k=setTimeout(T,Jg)}}};k=setTimeout(T,Jg)}catch{y||E(null,{kind:"error",reason:"The look for a shop could not start."})}})(),()=>{y=!0,k&&clearTimeout(k),S&&je.cancelCatalogScan(e,S).catch(()=>{})}},[e,t,p]);const w=s.useCallback(()=>g(y=>y+1),[]);return{scan:n,scanning:a,settled:l,outcome:a?{kind:"scanning"}:f||(n?{kind:"result",scan:n}:{kind:"idle"}),retry:w}}const Y0=[{key:"fragrance",label:"Fragrance",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"footwear",label:"Footwear",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"lateral-side",label:"Lateral side"},{key:"medial-side",label:"Medial side"}]},{key:"apparel",label:"Apparel",angles:[{key:"front",label:"Front"},{key:"back",label:"Back"},{key:"three-quarter",label:"Three-quarter"}]},{key:"furniture",label:"Furniture",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"beauty",label:"Beauty / skincare",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"electronics",label:"Electronics",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"back",label:"Back"}]},{key:"jewelry",label:"Jewelry",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"accessories",label:"Accessories",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"beverage",label:"Beverage",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"food",label:"Food",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]},{key:"other",label:"Other",angles:[{key:"three-quarter",label:"Three-quarter"},{key:"front",label:"Front"},{key:"side",label:"Side"}]}],Jv=new Map(Y0.map(e=>[e.key,e]));Jv.get("other");function q0(e){var t;return e?((t=Jv.get(e))==null?void 0:t.label)??e:null}function aq(e,t){const n=[e??"",...t??[]].join(" ").toLowerCase();if(!n.trim())return;const r=[["fragrance",["fragrance","perfume","eau de","cologne"]],["footwear",["shoe","sneaker","boot","sandal","footwear"]],["apparel",["shirt","dress","jacket","pant","apparel","clothing","hoodie"]],["furniture",["chair","table","sofa","furniture","shelf","desk"]],["beauty",["skincare","serum","cream","lotion","cosmetic","makeup","beauty"]],["electronics",["electronic","headphone","speaker","charger","device","gadget"]],["jewelry",["jewelry","jewellery","necklace","bracelet","earring","ring"]],["accessories",["bag","handbag","wallet","watch","accessory","accessories"]],["beverage",["drink","beverage","soda","juice","coffee","tea"]],["food",["food","snack","grocery","sauce","spice","pantry"]]];for(const[a,i]of r)if(i.some(l=>n.includes(l)))return a}function ew(e){return e.category&&Jv.has(e.category)?e.category:aq(e.productType,e.tags)??null}function oq({title:e,sub:t,error:n,footnote:r,primaryLabel:a,ready:i,blocked:l,busy:u,width:f="440px",onBack:h,onPrimary:p,onPasteFiles:g,children:v}){const{close:w}=Vr("new");return o.jsxs(_s,{maxWidth:f,onDismiss:w,onPaste:b=>{var k;if(!g)return;const y=Array.from(((k=b.clipboardData)==null?void 0:k.files)??[]).filter(S=>S.type.startsWith("image/"));y.length&&(b.preventDefault(),g(y))},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[h&&o.jsx("button",{type:"button",className:"sc-newdlg-back",onClick:h,"aria-label":"Back",children:o.jsx(Sa,{size:15})}),o.jsx(ks,{className:"sc-newdlg-title",children:e}),o.jsx(Ss,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(Mn,{size:16})})})]}),t&&o.jsx("p",{className:"sc-newdlg-sub",children:t}),o.jsx("div",{className:"sc-newdlg-body",children:v}),o.jsxs("div",{className:"sc-newdlg-foot",children:[n&&o.jsx("p",{className:"sc-newdlg-err",role:"alert",children:n}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary sc-dlg-go","aria-disabled":!i||u||void 0,title:l,onClick:()=>{i&&!u&&p()},children:[u?o.jsx(Ar,{size:"1"}):null,a]}),r&&o.jsx("p",{className:"sc-dlg-foot",children:r})]})]})}function TN({onFiles:e,onReject:t,disabled:n}){const r=s.useRef(0),[a,i]=s.useState(!1),l=s.useCallback(()=>{r.current=0,i(!1)},[]);return{dragOver:a,dropProps:{"data-drag-over":a||void 0,onDragEnter:f=>{n||!Array.from(f.dataTransfer.types).includes("Files")||(f.preventDefault(),r.current++,i(!0))},onDragOver:f=>{n||f.preventDefault()},onDragLeave:()=>{r.current=Math.max(0,r.current-1),r.current===0&&i(!1)},onDrop:f=>{if(n)return;f.preventDefault(),l();const h=Array.from(f.dataTransfer.files).filter(p=>p.type.startsWith("image/"));h.length?e(h):t==null||t()}}}}function nk({label:e,hint:t,busy:n,disabled:r,multiple:a=!0,accept:i="image/*",onFiles:l,onReject:u,children:f}){const h=s.useRef(null),{dropProps:p}=TN({onFiles:l,onReject:u,disabled:r||n});return o.jsxs("button",{type:"button",className:"sc-dropzone",disabled:r||n,onClick:()=>{var g;return(g=h.current)==null?void 0:g.click()},...p,children:[o.jsx("input",{ref:h,type:"file",accept:i,multiple:a,hidden:!0,onChange:g=>{const v=Array.from(g.target.files??[]);g.target.value="",v.length&&l(v)}}),n?o.jsx(Ar,{}):f,o.jsx("span",{className:"sc-dropzone-label",children:e}),t&&o.jsx("small",{children:t})]})}function DN({hashes:e,max:t,label:n,hint:r,busy:a,onAdd:i,onRemove:l,onReject:u}){if(e.length===0)return o.jsx("div",{className:"sc-assetwell",children:o.jsx(nk,{label:n,hint:r,busy:a,onFiles:i,onReject:u,children:o.jsx(fr,{size:18})})});const f=t-e.length;return o.jsxs("div",{className:"sc-assetform-refs",children:[e.map((h,p)=>o.jsxs("span",{className:"sc-assetform-ref",children:[o.jsx("img",{src:hn(h,"micro"),alt:`Reference ${p+1}`,loading:"lazy",decoding:"async"}),o.jsx("button",{type:"button",className:"sc-assetform-drop","aria-label":`Remove reference ${p+1}`,onClick:()=>l(h),children:o.jsx(Mn,{size:11,weight:"bold"})})]},h)),f>0&&o.jsx(nk,{label:`${f} more`,busy:a,onFiles:i,onReject:u,children:o.jsx(fr,{size:15})})]})}let w0=null;const HN=(e,t)=>`${e}:${t}`;function iq(e,t,n){w0={key:HN(e,t),fields:n}}function lq(e,t){if(!w0||w0.key!==HN(e,t))return null;const{fields:n}=w0;return w0=null,n}const rk={name:"",instruction:"",facets:[],imageHashes:[],importUrl:""};function cq(e,t,n){const r=n.restore??!1,[a,i]=s.useState(rk),[l,u]=s.useState(!1),[f,h]=s.useState(null),p=s.useRef(null),g=s.useRef(null),v=s.useRef(n.pendingState);v.current=n.pendingState;const w=s.useRef(n.exists);w.current=n.exists;const b=s.useRef(n.onDiscarded);b.current=n.onDiscarded;const y=s.useRef(a);y.current=a,s.useEffect(()=>{var R;if(r){const $=lq(e,t);if($){i($);return}}const P=VA(e,t),C=P!=null&&P.pending?v.current(P.pending):null;if(P!=null&&P.pending&&C==="unknown"&&((R=w.current)!=null&&R.call(w,P.name))){xu(e,t);return}if(P&&!P.pending){xu(e,t);return}P&&fG(P,C)&&(g.current=P.pending,i({name:P.name,instruction:P.instruction,facets:P.facets,imageHashes:P.imageHashes,importUrl:P.importUrl}))},[e,t,r]);const k=s.useCallback(P=>{p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{g.current&&Gg(P)?Yg(e,t,{...P,pending:g.current}):xu(e,t)},400)},[e,t]),S=s.useCallback(P=>{i(C=>{const R={...C,...typeof P=="function"?P(C):P};return k(R),R})},[k]),E=s.useCallback(()=>{var C;p.current&&clearTimeout(p.current);const P=y.current;if(g.current&&Gg(P)){Yg(e,t,{...P,pending:g.current});return}xu(e,t),Gg(P)&&(iq(e,t,P),(C=b.current)==null||C.call(b))},[e,t]);s.useEffect(()=>(window.addEventListener("beforeunload",E),()=>{window.removeEventListener("beforeunload",E),E()}),[E]);const j=s.useCallback(async P=>{u(!0),h(null);try{const C=n.max-y.current.imageHashes.length,R=[];for(const $ of P.slice(0,C))R.push(await W0($));S($=>({imageHashes:[...new Set([...$.imageHashes,...R])].slice(0,n.max)}))}catch(C){h(String(C.message??C))}finally{u(!1)}},[n.max,S]),N=s.useCallback(P=>S(C=>({imageHashes:C.imageHashes.filter(R=>R!==P)})),[S]),A=s.useCallback(P=>S(C=>({facets:C.facets.includes(P)?C.facets.filter(R=>R!==P):[...C.facets,P]})),[S]),T=s.useCallback(P=>{if(p.current&&clearTimeout(p.current),!P){xu(e,t),g.current=null,i(rk);return}g.current=P,i(C=>(Yg(e,t,{...C,pending:P}),C))},[e,t]);return{fields:a,set:S,uploading:l,err:f,setErr:h,addFiles:j,removeHash:N,toggleFacet:A,submitted:T}}const sk=6,uq=3;function dq({onBack:e,onStarted:t,restore:n,onDiscarded:r}){var C,R;const{brand:a}=dn(),{applyBrand:i}=Hn(),[l,u]=s.useState(!1),[f,h]=s.useState(!1),[p,g]=s.useState(!1),v=cq(a.id,"product",{max:sk,pendingState:()=>"unknown",restore:n,onDiscarded:r}),w=v.fields.imageHashes.length>0,b=w?void 0:"Add at least one photo",y=async()=>{u(!0),v.setErr(null);try{const{productId:$,...H}=await je.createProduct(a.id,{name:v.fields.name.trim(),imageHashes:v.fields.imageHashes,category:v.fields.facets[0]});i(H);const D=v.fields.name.trim()||"Product";v.submitted(null),t({kind:"product",id:$,name:D})}catch($){v.setErr(String($.message??$))}finally{u(!1)}},[k,S]=s.useState(null),{scan:E,scanning:j,settled:N}=$N(k?a.id:null,k??void 0),A=async $=>{const H=k??v.fields.importUrl.trim()??"";h(!0),v.setErr(null);try{await je.catalogImport(a.id,H,$),v.set({importUrl:""}),S(null),t({kind:"product",id:"",name:H})}catch(D){v.setErr(String(D.message??D))}finally{h(!1)}},T=()=>{var H,D;const $=v.fields.importUrl.trim()||(((D=(H=a.json)==null?void 0:H.meta)==null?void 0:D.website)??"");$&&(v.setErr(null),S($))};s.useEffect(()=>{!k||!N||E&&E.verdict==="found"&&E.candidates.length||A()},[E,N,k]);const P=$=>{$.key==="Enter"&&($.preventDefault(),w&&!l&&y())};return o.jsxs(oq,{title:"New product",error:v.err,footnote:"Added to this brand. No preview.",primaryLabel:"Add product",ready:w,blocked:b,busy:l,onBack:e,onPrimary:()=>void y(),onPasteFiles:$=>void v.addFiles($),children:[o.jsxs("div",{className:"sc-assetform",children:[o.jsx(DN,{hashes:v.fields.imageHashes,max:sk,label:"Add packshots",hint:`Straight, well-lit packshots. The first ${uq} are the ones a shot attaches.`,busy:v.uploading,onAdd:$=>void v.addFiles($),onRemove:v.removeHash,onReject:()=>v.setErr("Drop an image file.")}),o.jsx("div",{className:"sc-assetform-fields",children:o.jsxs("div",{className:"sc-assetform-field",children:[o.jsx("label",{className:"sc-newdlg-seclabel",htmlFor:"sc-product-name",children:"Name"}),o.jsx("input",{id:"sc-product-name",className:"sc-in",type:"text",placeholder:"Name this product",value:v.fields.name,onChange:$=>v.set({name:$.target.value}),onKeyDown:P})]})}),o.jsxs("fieldset",{className:"sc-assetform-facets",children:[o.jsx("legend",{children:"Category"}),o.jsx("div",{className:"sc-assetform-facets-chips",children:Y0.map($=>o.jsx("button",{type:"button",className:"sc-chip","data-on":v.fields.facets[0]===$.key||void 0,"aria-pressed":v.fields.facets[0]===$.key,onClick:()=>v.set({facets:v.fields.facets[0]===$.key?[]:[$.key]}),children:$.label},$.key))})]})]}),o.jsx("div",{className:"sc-newdlg-secondary",children:p?o.jsxs(o.Fragment,{children:[o.jsx("label",{className:"sc-newdlg-seclabel",htmlFor:"sc-import-url",children:"Your store's address"}),o.jsxs("div",{className:"sc-newdlg-secrow",children:[o.jsx("input",{id:"sc-import-url",className:"sc-in",type:"url",placeholder:((R=(C=a.json)==null?void 0:C.meta)==null?void 0:R.website)??"https://yourstore.com",value:v.fields.importUrl,onChange:$=>v.set({importUrl:$.target.value}),onKeyDown:$=>{$.key==="Enter"&&T()}}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:f||j,onClick:T,children:j?"Looking…":f?"Starting…":"Import"})]})]}):o.jsx("button",{type:"button",className:"sc-newdlg-secmore",onClick:()=>g(!0),children:"Import a catalog from a store URL"})}),E&&E.verdict==="found"&&E.candidates.length>0&&o.jsx(LN,{brandId:a.id,scan:E,busy:f,onImport:$=>void A($),onImportAll:()=>void A(),onDismiss:()=>S(null)})]})}const e8="1",fq={product:"Product",presenter:"Presenter",scene:"Scene"},hq=["product","presenter","scene"],pq=e=>!!e&&hq.includes(e),ON=s.createContext(null);function IN(){const e=s.useContext(ON);if(!e)throw new Error("useCreateAsset must be used inside AssetCreateHost");return e}function wl(){return IN().open}function FN(){const e=!!gn({path:pt.products,end:!1}),t=!!gn({path:pt.presenters,end:!1}),n=!!gn({path:pt.scenes,end:!1});return e?"product":t?"presenter":n?"scene":null}function tw(){const{announce:e,caps:t}=IN();return{announce:e,caps:t}}function mq({children:e}){const{brand:t}=dn(),n=_n(),r=Wn(),{push:a}=cr(),{refreshBrands:i}=Hn(),{builds:l,poke:u}=Ca(),f=Vr("new"),h=f.value,p=FN(),g=!!gn({path:pt.presenterStudio}),v=!!gn({path:pt.presenterEdit}),w=!!gn({path:pt.sceneStudio}),b=!!gn({path:pt.sceneEdit}),[y,k]=s.useState(null),[S,E]=s.useState(!1),[j,N]=s.useState(!1),A=s.useRef(null),T=s.useRef(null),P=f.open,C=f.set,R=f.close,$=s.useCallback((Z,V)=>{if(A.current=Z==="choose"||!(V!=null&&V.onCreated)?null:{kind:Z,fn:V.onCreated},Z==="presenter"){n(Qi(t));return}if(Z==="scene"){n(Xi(t),{state:{from:r.pathname+r.search}});return}T.current=document.activeElement instanceof HTMLElement?document.activeElement:null,E(Z==="choose"),N(!1),P(Z==="choose"?e8:Z)},[P,n,t,r.pathname,r.search]);s.useEffect(()=>{h==="presenter"&&n(Qi(t),{replace:!0}),h==="scene"&&n(Xi(t),{replace:!0})},[h,n,t]);const H=s.useCallback(()=>{A.current=null,E(!1),R()},[R]),D=s.useCallback(Z=>{a({kind:"success",title:`${fq[Z]} discarded`,detail:"Nothing was saved.",action:{label:"Undo",onClick:()=>{N(!0),E(!1),P(Z)}}})},[P,a]);s.useEffect(()=>{h===null&&N(!1)},[h]),s.useEffect(()=>{if(h!==null)return;const Z=T.current;T.current=null,Z!=null&&Z.isConnected&&Z.focus()},[h]);const q=h!==null||g||v||w||b;s.useEffect(()=>{if(!q)return;let Z=!0,V=null;const B=K=>je.assetBuildCapabilities().then(ee=>Z&&k(ee)).catch(()=>{Z&&K&&(V=setTimeout(()=>B(!1),600))});return B(!0),()=>{Z=!1,V&&clearTimeout(V)}},[q]);const _=s.useCallback(Z=>{const V=l.find(B=>B.id===Z);return V?V.stage==="failed"?"failed":V.stage==="cancelled"?"cancelled":V.stage==="done"?"done":"running":"unknown"},[l]),U=s.useCallback((Z,V)=>{var se;const B=A.current;A.current=null,u();const K=!!(V!=null&&V.quiet);if(Z.kind==="product"){if(!Z.id){a({kind:"info",title:"Importing your catalog",detail:Z.name});return}(B==null?void 0:B.kind)==="product"&&B.fn(Z),a({kind:"success",title:`${Z.name} added`,actions:[{label:"Add details",onClick:()=>n(ga(t,Z.id))},{label:"Use in a shot",onClick:()=>n(`${yr(t)}?product=${Z.id}&compose=1`)}]});return}if(Z.kind==="presenter"){if((B==null?void 0:B.kind)==="presenter"&&B.fn(Z),K)return;a({kind:"success",title:`${Z.name} added`,actions:[{label:"Use in a shot",onClick:()=>n(`${yr(t)}?presenter=${Z.id}&compose=1`)}]});return}if(i(),(B==null?void 0:B.kind)==="scene"&&B.fn(Z),K)return;const ee=(se=Z.verticals)!=null&&se.length?`Filed under ${Z.verticals.join(" and ")}.`:void 0;a({kind:"success",title:Z.how==="updated"?`${Z.name} changed`:`${Z.name} saved`,detail:ee,actions:[{label:"Open",onClick:()=>n(Ir(t,Z.id))},{label:"Use in a shot",onClick:()=>n(`${yr(t)}?scene=${Z.id}&compose=1`)}]})},[t,n,u,a,i]),Y=s.useCallback(Z=>{U(Z),H()},[H,U]),I=s.useMemo(()=>({open:$,announce:U,caps:y}),[$,U,y]),F=pq(h)?h:null,O={onBack:S?()=>C(e8):void 0,onStarted:Y,caps:y,pendingState:_,restore:j,onDiscarded:()=>F&&D(F)};return o.jsxs(ON.Provider,{value:I,children:[e,h===e8&&o.jsx(ZY,{suggest:p,onPick:Z=>{if(Z==="presenter"){n(Qi(t),{replace:!0});return}if(Z==="scene"){n(Xi(t),{replace:!0});return}E(!0),C(Z)}}),F==="product"&&o.jsx(dq,{...O},"product")]})}const gq=[{kind:"product",label:"Product",line:"What you are photographing",noun:"product",icon:Tp},{kind:"presenter",label:"Presenter",line:"Who appears in the shot",noun:"presenter",icon:Lp},{kind:"scene",label:"Scene",line:"The place and its light",noun:"scene",icon:Pp}],vq={product:"New product",presenter:"New presenter",scene:"New scene"};function wq(){var f;const e=wl(),t=FN(),n=AN(),{showcase:r}=Hn(),a=((f=r.find(h=>h.previewUrl))==null?void 0:f.previewUrl)??null,i=Gv(16).find(h=>h.key==="create"),l=i?`${i.to}&attach=all`:"",u=t?vq[t]:"New";return o.jsxs("div",{className:"sc-new",children:[t?o.jsxs("button",{type:"button",className:"sc-new-go","aria-label":u,"data-guide":"library.new",onClick:()=>e(t),children:[o.jsx(fr,{size:14,weight:"bold",className:"sc-new-plus","aria-hidden":"true"}),o.jsxs("span",{className:"sc-new-lb",children:[o.jsx("span",{className:"sc-new-verb",children:"New "}),o.jsx("span",{className:"sc-new-kind",children:t})]})]}):o.jsxs(Bn,{className:"sc-new-go",to:l,"aria-label":"New shot","data-attach-opener":"",children:[o.jsx(fr,{size:14,weight:"bold",className:"sc-new-plus","aria-hidden":"true"}),o.jsx("span",{className:"sc-new-lb",children:"New"})]}),o.jsx("span",{className:"sc-new-split","aria-hidden":"true"}),o.jsxs(kN,{label:"New",className:"sc-menu-start",trigger:o.jsx("button",{type:"button",className:"sc-new-more","aria-label":"Other ways to start",children:o.jsx(nl,{size:12,weight:"bold",className:"sc-new-caret","aria-hidden":"true"})}),children:[o.jsxs(Ou,{className:"sc-menu-item sc-start-row","data-lead":"",to:l,children:[o.jsx("span",{className:"sc-start-pic",children:a?o.jsx("img",{src:Pn(a,"tile"),alt:"",loading:"lazy",decoding:"async"}):o.jsx("span",{className:"sc-start-glyph",children:o.jsx(DE,{size:22})})}),o.jsxs("span",{className:"sc-start-txt",children:[o.jsx("b",{children:"New shot"}),o.jsx("small",{children:"Write a brief, get a shot"})]})]}),o.jsx("div",{className:"sc-menu-label",children:"Add to this brand"}),gq.map(h=>{const{url:p,count:g}=n[h.kind];return o.jsxs(Ou,{className:"sc-menu-item sc-start-row",onSelect:()=>e(h.kind),children:[o.jsx("span",{className:"sc-start-pic",children:p?o.jsx("img",{src:p,alt:"",loading:"lazy",decoding:"async"}):o.jsx("span",{className:"sc-start-glyph",children:o.jsx(h.icon,{size:22})})}),o.jsxs("span",{className:"sc-start-txt",children:[o.jsx("b",{children:h.label}),o.jsx("small",{children:h.line})]}),o.jsxs("span",{className:"sc-start-n",children:[g===0?"None yet":g,o.jsx("span",{className:"sc-vh",children:` ${h.noun}${g===1?"":"s"} so far`})]})]},h.kind)})]})]})}const yq=24,bq=8;function xq(){const e=Sr(ta),{pathname:t}=Wn();s.useEffect(()=>{const n=document.querySelector(".sc-shell");if(!n||(delete n.dataset.condensed,e))return;let r=0;const a=i=>{const l=i.target;!(l!=null&&l.dataset)||!("pageScroll"in l.dataset)||r||(r=requestAnimationFrame(()=>{r=0;const u=n.dataset.condensed!==void 0,f=l.scrollTop;(u?f<=bq:f>yq)&&(u?delete n.dataset.condensed:n.dataset.condensed="")}))};return n.addEventListener("scroll",a,{capture:!0,passive:!0}),()=>{r&&cancelAnimationFrame(r),n.removeEventListener("scroll",a,{capture:!0}),delete n.dataset.condensed}},[e,t])}const _N=["M64 18.71V38.8L51.38 51.39V12.62H57.9C61.27 12.62 64 15.35 64 18.72V18.71Z","M12.62 12.62V51.39H6.1C2.73 51.39 0 48.66 0 45.29V25.2L12.62 12.61V12.62Z","M51.38 51.38L38.79 64H18.7C15.33 64 12.6 61.27 12.6 57.9V51.38H51.37H51.38Z","M12.62 12.62L25.2 0H45.29C48.66 0 51.39 2.73 51.39 6.1V12.62H12.62Z"],kq=["M100.99 28.93L91.76 27.8C88.5 27.41 87.19 26.58 87.19 25.1C87.19 23.45 89.98 22.49 94.29 22.49C99.38 22.49 102.43 23.36 104.17 26.58L111.61 24.27C108.65 17.87 102.08 16 94.98 16C85.1 16 78.7 19.31 78.7 25.97C78.7 31.02 82.49 33.81 90.28 34.76L98.68 35.8C102.29 36.24 103.3 37.19 103.3 38.5C103.3 40.24 100.64 41.46 95.59 41.46C89.41 41.46 87.01 40.2 85.31 37.02L77.52 39.33C80.31 45.77 86.92 47.95 95.07 47.95C105.17 47.95 111.88 44.55 111.88 37.72C111.88 32.84 108.53 29.84 101 28.93H100.99Z","M132.73 22.66C137 22.66 140.87 24.01 142.7 28.54L150.49 26.67C148.79 20.66 142.3 16.05 132.6 16.05C121.41 16.05 113.44 22.23 113.44 31.98C113.44 41.73 121.41 48 132.6 48C142.31 48 148.8 43.3 150.49 37.29L142.7 35.42C140.87 39.95 137 41.3 132.73 41.3C126.94 41.3 122.24 38.38 122.24 32.42V31.55C122.24 25.59 126.94 22.67 132.73 22.67V22.66Z","M161.51 34.89H179.58V28.71H161.51V22.97H181.54V16.52H152.8V47.43H181.84V40.99H161.51V34.89Z","M208.71 33.85H208.67L193.86 16.52H184.94V47.43H193.04V27.49H193.08L210.15 47.43H216.81V16.52H208.71V33.85Z","M252.25 26.8C252.25 20.14 248.07 16.52 239.84 16.52H220.77V47.43H229.48V37.5H236.62L242.63 47.43H252.56L245.55 36.37C249.9 34.8 252.25 31.62 252.25 26.79V26.8ZM243.54 27.32C243.54 29.98 242.06 31.28 239.06 31.28H229.48V22.96H239.06C242.06 22.96 243.54 24.27 243.54 26.88V27.32Z","M263.79 16.52H255.08V47.43H263.79V16.52Z"];function Sq(e){return o.jsx("svg",{viewBox:"0 0 263.79 64",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:[..._N,...kq].map(t=>o.jsx("path",{d:t},t))})}function Eq(e){return o.jsx("svg",{viewBox:"0 0 64 64",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:_N.map(t=>o.jsx("path",{d:t},t))})}function Cq(){const{brand:e}=dn();return xq(),o.jsxs("header",{className:"sc-topbar",children:[o.jsx("a",{className:"sc-skip",href:"#main",children:"Skip to content"}),o.jsx("div",{className:"sc-topbar-lead",children:o.jsx(Bn,{className:"sc-wordmark","aria-label":"Scenri home",to:Eo(e),children:o.jsx(Sq,{"aria-hidden":"true"})})}),o.jsx(PY,{}),o.jsxs("div",{className:"sc-topbar-end",children:[o.jsx(HY,{}),o.jsx(MY,{}),o.jsx(wq,{}),o.jsx($Y,{})]})]})}const jq=60;function Aq(){s.useEffect(()=>{const e=window.visualViewport;if(!e)return;const t=document.documentElement,n=()=>{const r=window.innerHeight-e.height-e.offsetTop;t.style.setProperty("--sc-kb",r>jq?`${Math.round(r)}px`:"0px")};return n(),e.addEventListener("resize",n),e.addEventListener("scroll",n),()=>{e.removeEventListener("resize",n),e.removeEventListener("scroll",n),t.style.removeProperty("--sc-kb")}},[])}const VN=s.createContext(null);function ZN(){return s.useContext(VN)}function Nq({brand:e,children:t}){const n=e.id,[r,a]=s.useState({products:[],loaded:!1}),i=s.useRef(null),{tasks:l}=Ca(),u=l.filter(w=>w.kind==="catalog").map(w=>`${w.id}:${w.state}`).join("|"),f=l.some(w=>w.kind==="catalog"&&w.state==="running"),h=s.useRef(0),p=s.useRef(n);p.current=n;const g=s.useCallback(async()=>{const w=++h.current;try{const b=await je.productsLibrary(n);if(w!==h.current||p.current!==n)return;const y=JSON.stringify(b.products);if(i.current===y)return;i.current=y,a({products:b.products,loaded:!0})}catch{if(w!==h.current||p.current!==n)return;a(b=>({products:b.products,loaded:!0}))}},[n]);s.useEffect(()=>{i.current=null,a({products:[],loaded:!1})},[n]),s.useEffect(()=>{g()},[g,e.updatedAt,u]),s.useEffect(()=>{if(!f)return;const w=setInterval(()=>void g(),2e3);return()=>clearInterval(w)},[f,g]);const v=s.useMemo(()=>({products:r.products,productsLoaded:r.loaded,importing:f,refreshProducts:g}),[r.products,r.loaded,f,g]);return o.jsx(VN.Provider,{value:v,children:t})}function is({title:e,sub:t,children:n}){return o.jsxs("section",{className:"sc-set-sec",children:[(e||t)&&o.jsxs("div",{className:"sc-set-sech",children:[e&&o.jsx("h3",{children:e}),t&&o.jsx("p",{children:t})]}),o.jsx("div",{className:"sc-set-card",children:n})]})}const Mq={npx:"run with npx",global:"installed with npm",managed:"managed install",dev:"running from source",unknown:"local studio"};function Rq({version:e}){return o.jsxs(is,{children:[o.jsx("div",{className:"sc-set-row",children:o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Scenri"}),o.jsxs("small",{children:[e?`v${e.version}`:""," · ",Mq[(e==null?void 0:e.installKind)??"unknown"]]})]})}),o.jsx("div",{className:"sc-set-row",children:o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"License"}),o.jsx("small",{children:"AGPL-3.0 for the app · Apache-2.0 for the .brand format"})]})}),o.jsx("div",{className:"sc-set-row",children:o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Open source"}),o.jsxs("small",{children:["Built by Tony Gorb ·"," ",o.jsx("a",{href:"https://github.com/tonygorb/scenri",target:"_blank",rel:"noreferrer",children:"GitHub"})]})]})})]})}function V6({w:e,h:t,slot:n,box:r}){const a=r/Math.max(e,t);return o.jsx("span",{className:"sc-ratio-slot",style:{width:n,height:n},"aria-hidden":!0,children:o.jsx("span",{className:"sc-ratio",style:{width:Math.round(e*a),height:Math.round(t*a)}})})}const ak=()=>o.jsx("span",{className:"sc-setpop-tick","aria-hidden":!0,children:o.jsx(Un,{size:12,weight:"bold"})});function Uo({label:e,value:t,ids:n,unavailable:r=[],onChange:a,className:i,children:l}){const u=s.useRef(null),f=n.filter(p=>!r.includes(p)),h=p=>{var b,y;const g=p.key==="ArrowDown"||p.key==="ArrowRight"?1:p.key==="ArrowUp"||p.key==="ArrowLeft"?-1:p.key==="Home"?"first":p.key==="End"?"last":null;if(g===null||!f.length)return;p.preventDefault();const v=f.indexOf(t),w=g==="first"?f[0]:g==="last"?f[f.length-1]:g===1?f[v<0||v===f.length-1?0:v+1]:f[v<=0?f.length-1:v-1];a(w),(y=(b=u.current)==null?void 0:b.querySelector(`[data-id="${w}"]`))==null||y.focus()};return o.jsx("div",{className:i,role:"radiogroup","aria-label":e,ref:u,tabIndex:-1,onKeyDown:h,children:l})}const Wo=s.forwardRef(function({id:t,on:n,unavailable:r,label:a,onPick:i,className:l,children:u,...f},h){return o.jsx("button",{...f,ref:h,type:"button",role:"radio","data-id":t,className:l,"aria-checked":n,"aria-label":a,"aria-disabled":r||void 0,"data-on":n||void 0,tabIndex:n?0:-1,onClick:p=>{var g;(g=f.onClick)==null||g.call(f,p),r||i()},children:u})}),Pq=({children:e})=>o.jsx("p",{className:"sc-setpop-foot",children:e}),ok=[{id:"light",label:"Light"},{id:"dark",label:"Dark"},{id:"system",label:"System"}];function Lq(){const{choice:e,setChoice:t}=rK();return o.jsx(is,{children:o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Theme"}),o.jsx("small",{children:"Follows your system unless you pick a side."})]}),o.jsx(Uo,{label:"Theme",className:"sc-seg",value:e,ids:ok.map(n=>n.id),onChange:n=>t(n),children:ok.map(n=>o.jsx(Wo,{id:n.id,className:"sc-seg-o",on:e===n.id,label:n.label,onPick:()=>t(n.id),children:n.label},n.id))})]})})}function $q({value:e,onChange:t,placeholder:n,label:r,suggestions:a,max:i=24,maxLength:l=200}){const[u,f]=s.useState(""),h=e.length>=i,p=v=>{const w=v.trim().slice(0,l);f(""),!(!w||h)&&(e.some(b=>b.toLowerCase()===w.toLowerCase())||t([...e,w]))},g=!h&&a&&a.length>0?o.jsx("div",{className:"sc-chips-sugg",children:a.map(v=>o.jsx("button",{type:"button",className:"sc-chip",onClick:()=>p(v),"aria-label":`Never show ${v}`,children:v},v))}):null;return o.jsxs(o.Fragment,{children:[e.length===0&&g,o.jsxs("div",{className:"sc-chips",children:[e.map((v,w)=>o.jsxs("span",{className:"sc-chips-item",children:[o.jsx("span",{dir:"auto",children:v}),o.jsx("button",{type:"button",onClick:()=>t(e.filter((b,y)=>y!==w)),"aria-label":`Remove ${v}`,children:o.jsx(Mn,{size:10,weight:"bold"})})]},v)),o.jsx("input",{className:"sc-chips-in",value:u,"aria-label":r,placeholder:h?void 0:e.length?"Add another…":n??"Add one…",disabled:h,dir:"auto",onChange:v=>{const w=v.target.value;if(w.includes(",")){const b=w.split(",");for(const y of b.slice(0,-1))p(y);f(b[b.length-1]);return}f(w.slice(0,l))},onKeyDown:v=>{v.key==="Enter"?(v.preventDefault(),p(u)):v.key==="Backspace"&&!u&&e.length&&t(e.slice(0,-1))},onBlur:()=>p(u)})]}),e.length>0&&g]})}const Tq=["competitor logos in frame","visible text or wordmarks on clothing","alcohol","children","visible clutter or mess","heavy skin retouching","neon or harsh colour","pure white studio backgrounds"],ik=e=>e.trim().toLowerCase();function Dq(e){const t=new Set((e??[]).map(ik));return Tq.filter(n=>!t.has(ik(n)))}function Hq({doc:e}){var a;const t=((a=e.json)==null?void 0:a.rules)??{},n=t.never??[],r=i=>{const l={...t};i.length?l.never=i:delete l.never,e.patch({rules:l})};return o.jsx("div",{className:"sc-nv",children:o.jsx($q,{label:"Things this brand never shows",value:n,placeholder:"Or type your own",suggestions:Dq(n),max:24,onChange:r})})}function Oq(){const{brand:e}=dn(),{applyBrand:t}=Hn(),{push:n}=cr(),[r,a]=s.useState({}),[i,l]=s.useState("idle"),u=s.useRef(r);u.current=r;const f=s.useRef(e);f.current=e;const h=s.useRef(null),p=s.useRef({}),g=s.useRef(!1),v=s.useRef(!1),w=s.useCallback(()=>({...f.current.json??{},...u.current}),[]),b=s.useCallback(async()=>{if(!Object.keys(u.current).length)return;if(g.current){v.current=!0;return}g.current=!0,l("saving");const j=u.current;try{const N=await je.updateBrand(f.current.id,w(),{...p.current});t(N);for(const A of Object.keys(j))u.current[A]===j[A]?delete p.current[A]:p.current[A]=j[A];a(A=>{const T={...A};for(const P of Object.keys(j))A[P]===j[P]&&delete T[P];return T}),l(v.current?"pending":"idle")}catch(N){l("error"),n({...ln(N,"Could not save the brand"),action:{label:"Retry",onClick:()=>void b()}})}finally{g.current=!1,v.current&&(v.current=!1,b())}},[t,w,n]),y=s.useCallback((j,N)=>{var P;h.current&&(clearTimeout(h.current),h.current=null);for(const C of Object.keys(j))C in p.current||(p.current[C]=((P=f.current.json)==null?void 0:P[C])??null);const A={...u.current,...j};u.current=A,a(A),l("pending");const T=(N==null?void 0:N.debounce)??0;T>0?h.current=setTimeout(()=>void b(),T):b()},[b]),k=s.useCallback(async()=>{h.current&&(clearTimeout(h.current),h.current=null),await b()},[b]),S=s.useCallback(j=>{a({}),u.current={},p.current={},t(j),l("idle")},[t]),E=e.id;return s.useEffect(()=>{a({}),u.current={},p.current={},l("idle")},[E]),s.useEffect(()=>{const j=()=>{Object.keys(u.current).length&&gK(f.current.id,w(),{...p.current}).then(N=>{N&&t(N)})};return window.addEventListener("beforeunload",j),()=>{window.removeEventListener("beforeunload",j),h.current&&clearTimeout(h.current),j()}},[w,t]),{json:w(),state:i,patch:y,flush:k,applyRow:S}}function nw(e){const t=s.useRef(e);t.current=e,s.useEffect(()=>()=>t.current(),[])}function Iq(e){return e==="saving"?"Saving…":e==="pending"?"Unsaved changes":e==="error"?"Not saved":"Saved"}function Fq({brand:e,doc:t}){const{push:n}=cr(),[r,a]=s.useState(!1),i=t.json??{},l=i.meta??{},u=l.name??e.slug,f=Tf(i),h=pm(f)??void 0,p=f.filter(y=>y!==h),g=y=>{const k={...l};for(const[S,E]of Object.entries(y)){const j=E.trim();j?k[S]=j:delete k[S]}k.name||(k.name=l.name),t.patch({meta:k})},v=async(y,k)=>{a(!0);try{await t.flush(),t.applyRow(await k())}catch(S){n(ln(S,y))}finally{a(!1)}},w=y=>void v("Could not upload that mark",async()=>{const k=await xA(e.id,y[0]),S=k.logoEdge;return S&&S<512&&n({kind:"warning",title:"Logo added, but it is small",detail:`Only ${S}px across. Fine lettering may not survive generation. Export it larger, or as SVG.`}),k}),{dropProps:b}=TN({onFiles:w,onReject:()=>n({kind:"warning",title:"That is not an image",detail:"Drop a PNG, SVG or JPG."}),disabled:r});return o.jsxs("div",{className:"sc-ident",...b,children:[o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Logo"}),o.jsx("small",{children:"Drop an image, or tap to add."})]}),o.jsxs("div",{className:"sc-set-controls",children:[o.jsx(_q,{mark:h,name:u,busy:r,onUpload:w}),(h==null?void 0:h.attachable)&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:r,onClick:()=>void v("Could not remove that mark",()=>je.deleteLogo(e.id,h.hash??"")),children:"Remove"})]})]}),h&&o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Sits on"}),o.jsx("small",{children:"So a dark mark is not shown on a dark ground."})]}),o.jsx("select",{className:"sc-in",value:h.background,disabled:r||!h.attachable,onChange:y=>void v("Could not update that mark",()=>je.updateLogo(e.id,h.hash??"",{background:y.target.value})),"aria-label":"Sits on",children:Kv.map(y=>o.jsx("option",{value:y,children:y==="any"?"Any background":`On ${y}`},y))})]}),o.jsx(lk,{label:"Name",value:l.name??"",placeholder:e.slug,maxLength:120,onCommit:y=>g({name:y})}),o.jsx(lk,{label:"Tagline",value:l.tagline??"",placeholder:"Add a tagline",maxLength:200,onCommit:y=>g({tagline:y})}),p.map(y=>o.jsx(Vq,{mark:y,busy:r,onRole:k=>void v("Could not retag that mark",()=>je.updateLogo(e.id,y.hash??"",{role:k})),onBackground:k=>void v("Could not update that mark",()=>je.updateLogo(e.id,y.hash??"",{background:k})),onRemove:()=>void v("Could not remove that mark",()=>je.deleteLogo(e.id,y.hash??""))},y.hash??y.file)),h&&o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Variant"}),o.jsx("small",{children:"A second mark for dark or light grounds."})]}),o.jsxs("label",{className:"sc-btn sc-btn-ghost",children:[o.jsx(fr,{size:12}),"Add",o.jsx("input",{type:"file",accept:"image/*",hidden:!0,disabled:r,onChange:y=>{const k=Array.from(y.target.files??[]);y.target.value="",k.length&&w(k)}})]})]})]})}function lk({label:e,value:t,placeholder:n,maxLength:r,onCommit:a}){const[i,l]=s.useState(t);return s.useEffect(()=>l(t),[t]),nw(()=>{const u=i.trim();u!==t&&a(u)}),o.jsxs("div",{className:"sc-set-row",children:[o.jsx("span",{className:"txt",children:o.jsx("b",{children:e})}),o.jsx("input",{className:"sc-in",value:i,placeholder:n,"aria-label":e,maxLength:r,dir:"auto",onChange:u=>l(u.target.value),onBlur:()=>{const u=i.trim();u!==t&&a(u),l(u)},onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),u.currentTarget.blur()),u.key==="Escape"&&(l(t),u.currentTarget.blur())}})]})}function _q({mark:e,name:t,busy:n,onUpload:r}){const[a,i]=s.useState(null);if(e){const l=e.hash?Fr(e.hash):e.file;return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-well","data-bg":e.background,children:o.jsx("img",{src:l,alt:`${t} logo`,onLoad:u=>{const f=u.currentTarget,h=Math.max(f.naturalWidth,f.naturalHeight);i(h>0&&h<512?h:null)}})}),a!==null&&o.jsxs("small",{className:"sc-mark-small",children:["Only ",a,"px across. Fine lettering may not survive generation."]})]})}return o.jsxs("label",{className:"sc-well","data-empty":"","aria-label":"Add logo",children:[o.jsx(Z4,{size:16}),o.jsx("input",{type:"file",accept:"image/*",hidden:!0,disabled:n,onChange:l=>{const u=Array.from(l.target.files??[]);l.target.value="",u.length&&r(u)}})]})}function Vq({mark:e,busy:t,onRole:n,onBackground:r,onRemove:a}){const i=e.hash?Fr(e.hash):e.file;return o.jsxs("div",{className:"sc-set-row",children:[o.jsx("span",{className:"txt",children:o.jsx("b",{children:rh[e.role]})}),o.jsxs("div",{className:"sc-set-controls",children:[o.jsx("span",{className:"sc-well","data-bg":e.background,children:o.jsx("img",{src:i,alt:rh[e.role]})}),o.jsx("select",{className:"sc-in",value:e.role,disabled:t||!e.attachable,onChange:l=>n(l.target.value),"aria-label":"Mark role",children:mN.map(l=>o.jsx("option",{value:l,children:rh[l]},l))}),o.jsx("select",{className:"sc-in",value:e.background,disabled:t||!e.attachable,onChange:l=>r(l.target.value),"aria-label":"Sits on",children:Kv.map(l=>o.jsx("option",{value:l,children:l==="any"?"Any background":`On ${l}`},l))}),e.attachable&&o.jsx("button",{type:"button",disabled:t,onClick:a,"aria-label":`Remove ${rh[e.role]}`,children:o.jsx(Dp,{size:13})})]})]})}const ck={primary:"Primary",secondary:"Secondary",accent:"Accent",neutral:"Neutral"},Zq=(e,t)=>t<=1?ck[e]:`${ck[e]} ${t}`;function zq(e){return/^(Primary|Secondary|Accent|Neutral)( [2-9]\d*)?$/.test(String(e??"").trim())}const Bq=/^#[0-9A-F]{6}$/;function or(e){const t=String(e??"").trim(),n=(t.startsWith("#")?t.slice(1):t).toUpperCase();if(/^[0-9A-F]{3}$/.test(n)){const[a,i,l]=n;return`#${a}${a}${i}${i}${l}${l}`}const r=`#${n}`;return Bq.test(r)?r:null}const Uq=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;function Wq(e){const t=String(e??"").trim();return Uq.test(t)?or(t):null}function qs(e){const t=[],n={primary:0,secondary:0,accent:0,neutral:0},r=(a,i)=>{const l=or(String((a==null?void 0:a.hex)??""));if(!l)return;n[i]+=1;const u=String((a==null?void 0:a.name)??"").trim();t.push({hex:l,name:u||Zq(i,n[i]),slot:i})};r(e==null?void 0:e.primary,"primary"),r(e==null?void 0:e.secondary,"secondary");for(const a of Array.isArray(e==null?void 0:e.accent)?e.accent:[])r(a,"accent");for(const a of Array.isArray(e==null?void 0:e.neutrals)?e.neutrals:[])r(a,"neutral");return t}function rw(e,t){const n={},r=[],a=[],i=p=>{const g=p.name.trim();return g&&!zq(g)?{hex:p.hex,name:g}:{hex:p.hex}};for(const p of e){const g=or(p.hex);if(!g)continue;const v=i({...p,hex:g});p.slot==="neutral"?a.push(v):r.push(v)}const[l,u,...f]=r;l&&(n.primary=l),u&&(n.secondary=u),f.length&&(n.accent=f),a.length&&(n.neutrals=a);const h=String((t==null?void 0:t.usage)??"").trim();return h&&(n.usage=h),n}const uk=e=>e.slot!=="neutral";function xm(e){var l;const t=(l=e[e.length-1])==null?void 0:l.hex;if(!t)return"#808080";const n=Number.parseInt(t.slice(1),16),[r,a,i]=[n>>16&255,n>>8&255,n&255];return`#${[i,r,a].map(u=>u.toString(16).padStart(2,"0")).join("").toUpperCase()}`}function zN(e,t){const n=or(t);if(!n)return{palette:e,added:!1,swatch:null};const r=qs(e),a=r.find(f=>f.hex===n);if(a)return{palette:e,added:!1,swatch:a};const i=[...r,{hex:n,name:"",slot:r.length?"accent":"primary"}],l=rw(i,e),u=qs(l).find(f=>f.hex===n)??null;return{palette:l,added:!0,swatch:u}}function Kq(e,t){const n=or(t);if(!n)return{palette:e,removed:!1};const r=qs(e),a=r.filter(i=>i.hex!==n);return a.length===r.length?{palette:e,removed:!1}:{palette:rw(a,e),removed:!0}}function km(){return(km=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function BN(e,t){if(e==null)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(a[n]=e[n]);return a}function M0(e){var t=s.useRef(e),n=s.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var X0=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},R0=function(e){return"touches"in e},Z6=function(e){return e&&e.ownerDocument.defaultView||self},dk=function(e,t,n){var r=e.getBoundingClientRect(),a=R0(t)?(function(i,l){for(var u=0;u<i.length;u++)if(i[u].identifier===l)return i[u];return i[0]})(t.touches,n):t;return{left:X0((a.pageX-(r.left+Z6(e).pageXOffset))/r.width),top:X0((a.pageY-(r.top+Z6(e).pageYOffset))/r.height)}},fk=function(e){!R0(e)&&e.preventDefault()},UN=Fn.memo(function(e){var t=e.onMove,n=e.onKey,r=e.onEnd,a=BN(e,["onMove","onKey","onEnd"]),i=s.useRef(null),l=M0(t),u=M0(n),f=M0(r),h=s.useRef(null),p=s.useRef(!1),g=s.useMemo(function(){var k=function(j){fk(j),(R0(j)?j.touches.length>0:j.buttons>0)&&i.current?l(dk(i.current,j,h.current)):(E(!1),f())},S=function(){E(!1),f()};function E(j){var N=p.current,A=Z6(i.current),T=j?A.addEventListener:A.removeEventListener;T(N?"touchmove":"mousemove",k),T(N?"touchend":"mouseup",S)}return[function(j){var N=j.nativeEvent,A=i.current;if(A&&(fk(N),!(function(P,C){return C&&!R0(P)})(N,p.current)&&A)){if(R0(N)){p.current=!0;var T=N.changedTouches||[];T.length&&(h.current=T[0].identifier)}A.focus(),l(dk(A,N,h.current)),E(!0)}},function(j){var N=j.which||j.keyCode;N<37||N>40||(j.preventDefault(),u({left:N===39?.05:N===37?-.05:0,top:N===40?.05:N===38?-.05:0}))},function(j){var N=j.which||j.keyCode;N>=37&&N<=40&&f()},E]},[u,l,f]),v=g[0],w=g[1],b=g[2],y=g[3];return s.useEffect(function(){return y},[y]),Fn.createElement("div",km({},a,{onTouchStart:v,onMouseDown:v,className:"react-colorful__interactive",ref:i,onKeyDown:w,onKeyUp:b,tabIndex:0,role:"slider"}))}),sw=function(e){return e.filter(Boolean).join(" ")},WN=function(e){var t=e.color,n=e.left,r=e.top,a=r===void 0?.5:r,i=sw(["react-colorful__pointer",e.className]);return Fn.createElement("div",{className:i,style:{top:100*a+"%",left:100*n+"%"}},Fn.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Gr=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},Gq=function(e){return Jq(z6(e))},z6=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Gr(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?Gr(parseInt(e.substring(6,8),16)/255,2):1}},Yq=function(e){return Qq(Xq(e))},qq=function(e){var t=e.s,n=e.v,r=e.a,a=(200-t)*n/100;return{h:Gr(e.h),s:Gr(a>0&&a<200?t*n/100/(a<=100?a:200-a)*100:0),l:Gr(a/2),a:Gr(r,2)}},B6=function(e){var t=qq(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},Xq=function(e){var t=e.h,n=e.s,r=e.v,a=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),l=r*(1-n),u=r*(1-(t-i)*n),f=r*(1-(1-t+i)*n),h=i%6;return{r:Gr(255*[r,u,l,l,f,r][h]),g:Gr(255*[f,r,r,u,l,l][h]),b:Gr(255*[l,l,f,r,r,u][h]),a:Gr(a,2)}},sh=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Qq=function(e){var t=e.r,n=e.g,r=e.b,a=e.a,i=a<1?sh(Gr(255*a)):"";return"#"+sh(t)+sh(n)+sh(r)+i},Jq=function(e){var t=e.r,n=e.g,r=e.b,a=e.a,i=Math.max(t,n,r),l=i-Math.min(t,n,r),u=l?i===t?(n-r)/l:i===n?2+(r-t)/l:4+(t-n)/l:0;return{h:Gr(60*(u<0?u+6:u)),s:Gr(i?l/i*100:0),v:Gr(i/255*100),a}},eX=Fn.memo(function(e){var t=e.hue,n=e.onChange,r=e.onChangeEnd,a=sw(["react-colorful__hue",e.className]);return Fn.createElement("div",{className:a},Fn.createElement(UN,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:X0(t+360*i.left,0,360)})},onEnd:r,"aria-label":"Hue","aria-valuenow":Gr(t),"aria-valuemax":"360","aria-valuemin":"0"},Fn.createElement(WN,{className:"react-colorful__hue-pointer",left:t/360,color:B6({h:t,s:100,v:100,a:1})})))}),tX=Fn.memo(function(e){var t=e.hsva,n=e.onChange,r=e.onChangeEnd,a={backgroundColor:B6({h:t.h,s:100,v:100,a:1})};return Fn.createElement("div",{className:"react-colorful__saturation",style:a},Fn.createElement(UN,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:X0(t.s+100*i.left,0,100),v:X0(t.v-100*i.top,0,100)})},onEnd:r,"aria-label":"Color","aria-valuetext":"Saturation "+Gr(t.s)+"%, Brightness "+Gr(t.v)+"%"},Fn.createElement(WN,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:B6(t)})))}),KN=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},nX=function(e,t){return e.toLowerCase()===t.toLowerCase()||KN(z6(e),z6(t))};function rX(e,t,n,r){var a=M0(n),i=M0(r),l=s.useState(function(){return e.toHsva(t)}),u=l[0],f=l[1],h=s.useRef({color:t,hsva:u}),p=s.useRef(!1);s.useEffect(function(){if(!e.equal(t,h.current.color)){var w=e.toHsva(t);h.current={hsva:w,color:t},f(w),p.current=!1}},[t,e]),s.useEffect(function(){var w;KN(u,h.current.hsva)||e.equal(w=e.fromHsva(u),h.current.color)||(h.current={hsva:u,color:w},a(w),p.current=!0)},[u,e,a]);var g=s.useCallback(function(w){f(function(b){return Object.assign({},b,w)})},[]),v=s.useCallback(function(){p.current&&(p.current=!1,i(h.current.color))},[i]);return[u,g,v]}var sX=typeof window<"u"?s.useLayoutEffect:s.useEffect,aX=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},hk=new WeakMap,oX=function(e){sX(function(){var t=e.current;if(typeof document<"u"&&t){var n=t.getRootNode?t.getRootNode():t.ownerDocument,r=n&&("head"in n||"host"in n)?n:t.ownerDocument;if(!hk.has(r)){var a="head"in r?r.head:r,i=(a.ownerDocument||document).createElement("style");i.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`;var l=aX();l&&i.setAttribute("nonce",l),hk.set(r,i),a.appendChild(i)}}},[])},iX=function(e){var t=e.className,n=e.colorModel,r=e.color,a=r===void 0?n.defaultColor:r,i=e.onChange,l=e.onChangeEnd,u=BN(e,["className","colorModel","color","onChange","onChangeEnd"]),f=s.useRef(null);oX(f);var h=rX(n,a,i,l),p=h[0],g=h[1],v=h[2],w=sw(["react-colorful",t]);return Fn.createElement("div",km({},u,{ref:f,className:w}),Fn.createElement(tX,{hsva:p,onChange:g,onChangeEnd:v}),Fn.createElement(eX,{hue:p.h,onChange:g,onChangeEnd:v,className:"react-colorful__last-control"}))},lX={defaultColor:"000",toHsva:Gq,fromHsva:function(e){return Yq({h:e.h,s:e.s,v:e.v,a:1})},equal:nX},cX=function(e){return Fn.createElement(iX,km({},e,{colorModel:lX}))};function td({value:e,onChange:t,label:n,presets:r,className:a,triggerStyle:i,triggerProps:l,tip:u,commitMode:f="live",align:h="start",children:p}){const g=or(e)??"#000000",[v,w]=s.useState(g),[b,y]=s.useState(!1);s.useEffect(()=>{b||w(g)},[g,b]);const k=A=>{const T=or(A);T&&(w(T),f==="live"&&t(T))},S=A=>{const T=or(A);T&&(w(T),t(T),f==="close"&&y(!1))},E=A=>{if(y(A),A||f!=="close")return;const T=or(v);T&&T!==g&&t(T)},j=[...new Set((r??[]).map(A=>or(A)).filter(A=>!!A))],N=o.jsx(Qu,{children:o.jsx("button",{type:"button",className:a??"sc-cp-trigger",style:{background:g,...i},"aria-label":n,...l,children:p})});return o.jsxs(Xu,{open:b,onOpenChange:E,children:[u?o.jsx(lr,{label:n,children:N}):N,o.jsxs(Ju,{className:"sc-cp",align:h,sideOffset:6,width:"232px",children:[o.jsx(cX,{color:v,onChange:k}),o.jsxs("div",{className:"sc-cp-foot",children:[o.jsx("span",{className:"sc-cp-preview",style:{background:v},"aria-hidden":!0}),o.jsx("input",{className:"sc-cp-hex",value:v,spellCheck:!1,maxLength:7,"aria-label":"Hex value",onChange:A=>{w(A.target.value);const T=or(A.target.value);T&&f==="live"&&t(T)},onBlur:()=>w(or(v)??g),onKeyDown:A=>{A.key==="Enter"&&(A.preventDefault(),f==="close"?S(v):y(!1))}})]}),j.length>0&&o.jsx("div",{className:"sc-cp-presets",children:j.map(A=>o.jsx("button",{type:"button",style:{background:A},"data-on":A===v||void 0,title:A,"aria-label":A,onClick:()=>f==="close"?S(A):k(A)},A))})]})]})}function uX({doc:e,suggestions:t}){var w;const n=(w=e.json)==null?void 0:w.palette,[r,a]=s.useState(()=>qs(n)),i=JSON.stringify(n??{});s.useEffect(()=>{a(qs(n))},[i]);const l=(b,y=0)=>{a(b),e.patch({palette:rw(b,n)},{debounce:y})},u=(b,y,k=0)=>l(r.map((S,E)=>E===b?{...S,...y}:S),k),f=()=>l([...r,{hex:xm(r),name:"",slot:r.length?"accent":"primary"}]),h=(t??[]).filter(b=>{const y=or(b.hex);return y&&!r.some(k=>k.hex===y)}),p=(b,y)=>o.jsx(dX,{swatch:b,presets:r.map(k=>k.hex),onHex:k=>u(y,{hex:k},300),onRemove:()=>l(r.filter((k,S)=>S!==y))},`${b.slot}-${y}`),g=r.map((b,y)=>[b,y]),v=g.filter(([b])=>!uk(b));return o.jsxs("div",{className:"sc-pal",children:[r.length===0&&o.jsx("p",{className:"sc-pal-empty",children:"No colours yet. Add one and it becomes a chip you can drop into any shot."}),g.filter(([b])=>uk(b)).map(([b,y])=>p(b,y)),v.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sc-pal-group",children:"Neutrals"}),v.map(([b,y])=>p(b,y))]}),o.jsxs("div",{className:"sc-pal-foot",children:[o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:f,children:[o.jsx(fr,{size:12}),"Add colour"]}),h.length>0&&o.jsxs("span",{className:"sc-pal-sugg",children:[o.jsx("small",{children:"From the website"}),h.map(b=>{const y=or(b.hex);return o.jsx("button",{type:"button",className:"sc-pal-sugg-chip",style:{background:y},title:`Add ${y}`,"aria-label":`Add ${y}`,onClick:()=>l([...r,{hex:y,name:"",slot:"accent"}])},y)})]})]})]})}function dX({swatch:e,presets:t,onHex:n,onRemove:r}){const[a,i]=s.useState(e.hex);s.useEffect(()=>i(e.hex),[e.hex]);const l=()=>{const u=or(a);u&&n(u),i(u??e.hex)};return nw(()=>{a!==e.hex&&l()}),o.jsxs("div",{className:"sc-pal-row",children:[o.jsx(td,{value:e.hex,onChange:n,label:`${e.name} color`,presets:t,className:"sc-pal-chip"}),o.jsx("span",{className:"sc-pal-name",children:e.name}),o.jsx("input",{className:"sc-in sc-pal-hex",value:a,spellCheck:!1,maxLength:7,"aria-label":`${e.name} hex`,onChange:u=>i(u.target.value),onBlur:l,onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),u.currentTarget.blur())}}),o.jsx("button",{type:"button",className:"sc-pal-act","data-danger":"",onClick:r,"aria-label":`Remove ${e.name}`,title:"Remove",children:o.jsx(Dp,{size:13})})]})}function fX({onSaveState:e}){var w,b;const{brand:t}=dn(),{push:n}=cr(),r=Oq();s.useEffect(()=>e(r.state),[r.state,e]);const[a,i]=s.useState(!1),[l,u]=s.useState([]),f=((b=(w=r.json)==null?void 0:w.meta)==null?void 0:b.website)??"",[h,p]=s.useState(f);s.useEffect(()=>p(f),[f]);const g=()=>{var E;const y=h.trim(),k=y&&!/^https?:\/\//i.test(y)?`https://${y}`:y;p(k);const S={...((E=r.json)==null?void 0:E.meta)??{}};k?S.website=k:delete S.website,r.patch({meta:S})};nw(()=>{h.trim()!==f&&g()});const v=async()=>{var y,k,S;i(!0);try{await r.flush();const E=await je.refreshBrandFromUrl(t.id);r.applyRow(E),u(((y=E.suggestions)==null?void 0:y.palette)??[]),n({kind:(k=E.warnings)!=null&&k.length?"warning":"success",title:"Read the website again",detail:(S=E.warnings)!=null&&S.length?E.warnings.join(" "):"Your edits were kept."})}catch(E){n(ln(E,"Could not read that website"))}finally{i(!1)}};return o.jsxs(o.Fragment,{children:[o.jsx(is,{title:"Identity",sub:"The name and the mark.",children:o.jsx(Fq,{brand:t,doc:r})}),o.jsx(is,{title:"Palette",sub:"Favoured on a shot that asks for the kit.",children:o.jsx("div",{className:"sc-set-block",children:o.jsx(uX,{doc:r,suggestions:l})})}),o.jsx(is,{title:"We never",sub:"Held on every shot, whether the kit is asked for or not.",children:o.jsx("div",{className:"sc-set-block",children:o.jsx(Hq,{doc:r})})}),o.jsxs(is,{title:"Website and file",sub:"The kit is a file, not a lock-in.",children:[o.jsxs("div",{className:"sc-set-row","data-stack":"",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Website"}),o.jsx("small",{children:"Reads colours and marks from the site again. Edits are kept; new colours are offered, not applied."})]}),o.jsxs("div",{className:"sc-set-controls",children:[o.jsx("input",{className:"sc-in",value:h,type:"url",inputMode:"url",placeholder:"acme.coffee","aria-label":"Brand website",onChange:y=>p(y.target.value),onBlur:g,onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),y.currentTarget.blur())}}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:!f||a,onClick:()=>void v(),children:[a?o.jsx(Ar,{size:"1"}):o.jsx(_E,{size:13})," Refresh"]})]})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Export .brand"}),o.jsx("small",{"data-prose":"",children:"A zip holding brand.json and every image it references: the form any tool can read."})]}),o.jsx("a",{className:"sc-btn sc-btn-ghost",href:pK(t.id),download:!0,onClick:()=>void r.flush(),children:"Export"})]})]})]})}const Ji=e=>e.replace(/\s*\(BYOK\)\s*$/i,""),Q0="codex-cli";function hX(e,t){var n;return e.some(r=>r.id===t)?t:((n=e[0])==null?void 0:n.id)??Q0}const pX=e=>e.toFixed(3).replace(/0+$/,"").replace(/\.$/,"");function mX(e){return e.free?e.localOnly?"Runs on your ChatGPT plan":"No cost per image":`$${pX(e.perGeneration)} / image`}function gX(e,t){if(t)return e.available?"Manage":"Connect";if(e.available)return e.id===Q0?"Manage":null;switch(e.code){case"update-needed":return"Update";case"env-conflict":return"Fix";case"not-installed":case"not-authenticated":case"unverified":return"Set up";default:return null}}function vX({engines:e,onSaved:t,thisComputer:n}){const r=e.filter(u=>!u.free),[a,i]=s.useState({});s.useEffect(()=>{i(Object.fromEntries(r.map(u=>[u.id,u.cap===null?"":String(u.cap)])))},[e]);const l=async u=>{const f=(a[u]??"").trim(),h=f===""?null:Number(f);h!==null&&(Number.isNaN(h)||h<0)||(await je.setCap(u,h),t())};return r.length?o.jsx(is,{title:"Monthly caps",sub:n?"Your own API budget. Generation stops before a cap is crossed, so a runaway loop cannot spend your month.":"Your own API budget. Generation stops before a cap is crossed. Caps are set on the computer running Scenri.",children:r.map(u=>{const f=u.generationsLeft,h=u.generationsTotal,p=h&&h>0?Math.min(100,Math.round((h-(f??0))/h*100)):0,g=`$${u.monthlySpend.toFixed(2)} this month`;return o.jsxs("div",{className:"sc-cap",children:[o.jsxs("div",{className:"sc-cap-top",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:Ji(u.displayName)}),o.jsx("small",{children:f===null?g:`${g} · ${f} left`})]}),o.jsxs("div",{className:"sc-cap-in",children:[o.jsx("span",{className:"sc-cap-dollar",children:"$"}),o.jsx("input",{className:"sc-in",inputMode:"decimal",placeholder:"None",value:a[u.id]??"",onChange:v=>i(w=>({...w,[u.id]:v.target.value})),onBlur:()=>void l(u.id),disabled:!n,"aria-label":`${Ji(u.displayName)} monthly cap in dollars`})]})]}),h!==null&&o.jsx("div",{className:"sc-meter",children:o.jsx("i",{style:{width:`${p}%`}})})]},u.id)})}):o.jsx(is,{title:"Monthly caps",sub:"Nothing to cap yet. Caps apply to engines you pay for per image. Codex usage counts against your ChatGPT plan, which OpenAI meters, not Scenri.",children:o.jsx("p",{className:"sc-set-empty",children:"Add a paid engine key and its cap appears here."})})}function wX({onDone:e,thisComputer:t}){const{brand:n,resetShots:r}=dn(),{refresh:a}=Hn(),i=_n(),[l,u]=s.useState(!1),f=s.useCallback(async h=>{u(!0);try{await je.deleteData(h),e(),h==="shots"&&r(),h==="all"&&window.location.replace("/")}finally{u(!1)}},[e,r]);return o.jsxs(o.Fragment,{children:[o.jsx(is,{title:"This brand",children:o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Delete this brand"}),o.jsxs("small",{"data-prose":"",children:["Removes ",va(n),", its sets and every shot. Other brands stay."]})]}),o.jsx(qn,{label:"Delete brand",title:`Delete ${va(n)}?`,body:"The kit, its sets and every shot go with it. Exports you already downloaded stay yours.",busy:l,onConfirm:()=>{u(!0),je.deleteBrand(n.id).then(()=>a()).then(()=>i("/",{replace:!0})).finally(()=>u(!1))}})]})}),t&&o.jsxs(is,{title:"Every brand",children:[o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Delete generated shots"}),o.jsx("small",{"data-prose":"",children:"Removes every set and every generated shot, in every brand. Brands, cast and scenes stay."})]}),o.jsx(qn,{label:"Delete shots",title:"Delete every generated shot?",body:"Brands, cast and scenes stay. Every set and every generated shot goes.",busy:l,onConfirm:()=>void f("shots")})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Delete all local data"}),o.jsx("small",{"data-prose":"",children:"Brands, cast, sets, shots and saved keys, in one go."})]}),o.jsx(qn,{label:"Delete everything",title:"Delete everything on this machine?",body:"The whole library folder is removed: brands, cast, sets, shots and your saved keys. There is no undo.",busy:l,onConfirm:()=>void f("all")})]})]})]})}function yX(e,t){return t?{body:t,action:"retry"}:e?e.installKind==="dev"?{body:"Running from source; nothing to put on a desktop.",action:null}:e.supported?e.installed?{body:"Scenri is on your desktop.",action:"recreate"}:{body:"Open Scenri without a terminal.",action:"add"}:{body:"Desktop shortcuts are not available on this system yet.",action:null}:{body:"Checking this machine.",action:null}}function bX({status:e,onStatus:t}){const[n,r]=s.useState(null),[a,i]=s.useState(!1),[l,u]=s.useState(!1),f=s.useRef(null);s.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const h=async()=>{if(!a){i(!0),r(null);try{await je.desktopInstall(),u(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>u(!1),1600),t(await je.desktop())}catch(g){r(String((g==null?void 0:g.message)??g))}finally{i(!1)}}},p=yX(e,n);return o.jsx(is,{title:"This computer",children:o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Desktop shortcut"}),o.jsx("small",{"data-prose":"",children:p.body})]}),p.action&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:a,onClick:()=>void h(),children:l?"Added":a?"Adding…":p.action==="add"?"Add to desktop":p.action==="recreate"?"Recreate":"Try again"})]})})}function GN(e){return o.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:o.jsx("path",{d:"M22.282 9.821a6 6 0 0 0-.516-4.91a6.05 6.05 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a6 6 0 0 0-3.998 2.9a6.05 6.05 0 0 0 .743 7.097a5.98 5.98 0 0 0 .51 4.911a6.05 6.05 0 0 0 6.515 2.9A6 6 0 0 0 13.26 24a6.06 6.06 0 0 0 5.772-4.206a6 6 0 0 0 3.997-2.9a6.06 6.06 0 0 0-.747-7.073M13.26 22.43a4.48 4.48 0 0 1-2.876-1.04l.141-.081l4.779-2.758a.8.8 0 0 0 .392-.681v-6.737l2.02 1.168a.07.07 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494M3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085l4.783 2.759a.77.77 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646M2.34 7.896a4.5 4.5 0 0 1 2.366-1.973V11.6a.77.77 0 0 0 .388.677l5.815 3.354l-2.02 1.168a.08.08 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855l-5.833-3.387L15.119 7.2a.08.08 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.407-.667m2.01-3.023l-.141-.085l-4.774-2.782a.78.78 0 0 0-.785 0L9.409 9.23V6.897a.07.07 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zm-12.64 4.135l-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.8.8 0 0 0-.393.681zm1.097-2.365l2.602-1.5l2.607 1.5v2.999l-2.597 1.5l-2.607-1.5Z"})})}function xX(e){return o.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:o.jsx("path",{d:"M16.778 1.844v1.919q-.569-.026-1.138-.032-.708-.008-1.415.037c-1.93.126-4.023.728-6.149 2.237-2.911 2.066-2.731 1.95-4.14 2.75-.396.223-1.342.574-2.185.798-.841.225-1.753.333-1.751.333v4.229s.768.108 1.61.333c.842.224 1.789.575 2.185.799 1.41.798 1.228.683 4.14 2.75 2.126 1.509 4.22 2.11 6.148 2.236.88.058 1.716.041 2.555.005v1.918l7.222-4.168-7.222-4.17v2.176c-.86.038-1.611.065-2.278.021-1.364-.09-2.417-.357-3.979-1.465-2.244-1.593-2.866-2.027-3.68-2.508.889-.518 1.449-.906 3.822-2.59 1.56-1.109 2.614-1.377 3.978-1.466.667-.044 1.418-.017 2.278.02v2.176L24 6.014Z"})})}function kX(e){return o.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor","aria-hidden":"true",focusable:"false",...e,children:o.jsx("path",{d:"M24 10.262v2.712h-9.518V24h-3.034V10.262zm0-5.131v2.717H8.755V24H5.722V5.131zM24 0v2.717H3.034V24H0V0z"})})}const SX=[{engineId:"openrouter",settingKey:"openrouter_api_key",hint:"sk-or-...",keysUrl:"https://openrouter.ai/keys"},{engineId:"replicate",settingKey:"replicate_api_token",hint:"r8_...",keysUrl:"https://replicate.com/account/api-tokens"},{engineId:"fal",settingKey:"fal_key",hint:"fal_...",keysUrl:"https://fal.ai/dashboard/keys"}],YN=e=>SX.find(t=>t.engineId===e),qN={"codex-cli":{Mark:GN,size:16,plate:"#FFFFFF",ink:"#000000"},openrouter:{Mark:xX,size:18,plate:"#FFFFFF",ink:"#7624F4"},replicate:{Mark:kX,size:15,plate:"#E42022",ink:"#FFFFFF"}},XN=e=>{const t=qN[e];return t?{plate:t.plate,ink:t.ink}:void 0},EX={demo:AO};function QN({engineId:e,scale:t=1}){const n=qN[e];if(n){const a=Math.round(n.size*t);return o.jsx(n.Mark,{width:a,height:a})}const r=EX[e]??O0;return o.jsx(r,{size:Math.round(15*t)})}const CX=e=>[...e].sort((t,n)=>+(n.id===Q0)-+(t.id===Q0));function jX({engines:e}){const t=vl(),r=e.filter(a=>a.available).length===0;return o.jsx(is,{children:CX(e).map(a=>{const i=YN(a.id),l=Ji(a.displayName),u=gX(a,!!i),f=a.available?"Connected":null,h=!f&&a.reason&&(!u||a.code==="unverified"),p=XN(a.id);return o.jsxs("div",{className:"sc-eng","data-connected":a.available?"":void 0,children:[o.jsx("span",{className:"sc-eng-ic","data-brand":p?"":void 0,style:p?{"--sc-plate":p.plate,"--sc-ink":p.ink}:void 0,children:o.jsx(QN,{engineId:a.id})}),o.jsxs("span",{className:"sc-eng-name",children:[o.jsx("b",{children:l}),o.jsx("small",{children:mX(a)})]}),f&&o.jsxs("span",{className:"sc-stat",children:[o.jsx("span",{className:"d"}),f]}),h&&o.jsx("span",{className:"sc-stat sc-stat-why",children:a.reason}),u&&o.jsx("button",{type:"button",className:`sc-btn ${r&&!i?"sc-btn-primary":"sc-btn-ghost"} sc-eng-act`,onClick:()=>t(a.id),"aria-label":`${u} ${l}`,children:u})]},a.id)})})}const AX=e=>e>1e9?`${(e/1e9).toFixed(1)} GB`:e>1e6?`${Math.round(e/1e6)} MB`:`${Math.round(e/1e3)} KB`,t8=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function NX(e){return e===0?0:e<3?1:e<6?2:e<12?3:4}function pk(e,t){const n=t*7,r=new Date,a=new Date(r);a.setDate(r.getDate()-(n-1)-r.getDay());const i=[],l=[];let u=-1,f=0;for(let h=0;h<n;h++){const p=new Date(a);p.setDate(a.getDate()+h);const g=p.toISOString().slice(0,10),v=e.get(g)??0;if(f+=v,i.push({key:g,level:NX(v),title:v?`${v} run${v===1?"":"s"} on ${p.getDate()} ${t8[p.getMonth()]}`:`nothing on ${p.getDate()} ${t8[p.getMonth()]}`}),p.getDay()===0){const w=p.getMonth()!==u&&p.getDate()<=7;w&&(u=p.getMonth()),l.push({key:g,label:w?t8[p.getMonth()]:""})}}return{cells:i,months:l,sum:f}}function MX({info:e,thisComputer:t}){return o.jsxs(is,{children:[o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Library folder"}),o.jsx("small",{children:e?[e.dir,`${AX(e.bytes)} across ${e.images} images`].filter(Boolean).join(" · "):"…"})]}),t&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void je.reveal(),children:"Reveal"})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Export everything"}),o.jsx("small",{children:"One zip: brands, cast, prompts, shots. Never keys."})]}),o.jsx("a",{className:"sc-btn sc-btn-ghost",href:"/api/export/all",download:!0,children:"Export"})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Telemetry"}),o.jsx("small",{children:"There is none. This row exists to say so."})]}),o.jsx("span",{className:"sc-tag",children:"off, permanently"})]})]})}async function RX(e,t){if(window.isSecureContext&&navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}const n=document.activeElement,r=document.createElement("textarea");r.value=e,r.readOnly=!0,r.setAttribute("aria-hidden","true"),r.style.cssText="position:fixed;top:0;left:0;width:1px;height:1px;opacity:0;",(t??document.body).appendChild(r);try{return r.focus(),r.select(),r.setSelectionRange(0,e.length),document.execCommand("copy")}catch{return!1}finally{r.remove(),n==null||n.focus()}}const vd=function(e,t){let a=e;const i=y0[t];let l=null,u=0,f=null;const h=[],p={},g=function(P,C){u=a*4+17,l=(function(R){const $=new Array(R);for(let H=0;H<R;H+=1){$[H]=new Array(R);for(let D=0;D<R;D+=1)$[H][D]=null}return $})(u),v(0,0),v(u-7,0),v(0,u-7),y(),b(),S(P,C),a>=7&&k(P),f==null&&(f=N(a,i,h)),E(f,C)},v=function(P,C){for(let R=-1;R<=7;R+=1)if(!(P+R<=-1||u<=P+R))for(let $=-1;$<=7;$+=1)C+$<=-1||u<=C+$||(0<=R&&R<=6&&($==0||$==6)||0<=$&&$<=6&&(R==0||R==6)||2<=R&&R<=4&&2<=$&&$<=4?l[P+R][C+$]=!0:l[P+R][C+$]=!1)},w=function(){let P=0,C=0;for(let R=0;R<8;R+=1){g(!0,R);const $=Ti.getLostPoint(p);(R==0||P>$)&&(P=$,C=R)}return C},b=function(){for(let P=8;P<u-8;P+=1)l[P][6]==null&&(l[P][6]=P%2==0);for(let P=8;P<u-8;P+=1)l[6][P]==null&&(l[6][P]=P%2==0)},y=function(){const P=Ti.getPatternPosition(a);for(let C=0;C<P.length;C+=1)for(let R=0;R<P.length;R+=1){const $=P[C],H=P[R];if(l[$][H]==null)for(let D=-2;D<=2;D+=1)for(let q=-2;q<=2;q+=1)D==-2||D==2||q==-2||q==2||D==0&&q==0?l[$+D][H+q]=!0:l[$+D][H+q]=!1}},k=function(P){const C=Ti.getBCHTypeNumber(a);for(let R=0;R<18;R+=1){const $=!P&&(C>>R&1)==1;l[Math.floor(R/3)][R%3+u-8-3]=$}for(let R=0;R<18;R+=1){const $=!P&&(C>>R&1)==1;l[R%3+u-8-3][Math.floor(R/3)]=$}},S=function(P,C){const R=i<<3|C,$=Ti.getBCHTypeInfo(R);for(let H=0;H<15;H+=1){const D=!P&&($>>H&1)==1;H<6?l[H][8]=D:H<8?l[H+1][8]=D:l[u-15+H][8]=D}for(let H=0;H<15;H+=1){const D=!P&&($>>H&1)==1;H<8?l[8][u-H-1]=D:H<9?l[8][15-H-1+1]=D:l[8][15-H-1]=D}l[u-8][8]=!P},E=function(P,C){let R=-1,$=u-1,H=7,D=0;const q=Ti.getMaskFunction(C);for(let _=u-1;_>0;_-=2)for(_==6&&(_-=1);;){for(let U=0;U<2;U+=1)if(l[$][_-U]==null){let Y=!1;D<P.length&&(Y=(P[D]>>>H&1)==1),q($,_-U)&&(Y=!Y),l[$][_-U]=Y,H-=1,H==-1&&(D+=1,H=7)}if($+=R,$<0||u<=$){$-=R,R=-R;break}}},j=function(P,C){let R=0,$=0,H=0;const D=new Array(C.length),q=new Array(C.length);for(let I=0;I<C.length;I+=1){const F=C[I].dataCount,O=C[I].totalCount-F;$=Math.max($,F),H=Math.max(H,O),D[I]=new Array(F);for(let K=0;K<D[I].length;K+=1)D[I][K]=255&P.getBuffer()[K+R];R+=F;const Z=Ti.getErrorCorrectPolynomial(O),B=J0(D[I],Z.getLength()-1).mod(Z);q[I]=new Array(Z.getLength()-1);for(let K=0;K<q[I].length;K+=1){const ee=K+B.getLength()-q[I].length;q[I][K]=ee>=0?B.getAt(ee):0}}let _=0;for(let I=0;I<C.length;I+=1)_+=C[I].totalCount;const U=new Array(_);let Y=0;for(let I=0;I<$;I+=1)for(let F=0;F<C.length;F+=1)I<D[F].length&&(U[Y]=D[F][I],Y+=1);for(let I=0;I<H;I+=1)for(let F=0;F<C.length;F+=1)I<q[F].length&&(U[Y]=q[F][I],Y+=1);return U},N=function(P,C,R){const $=mk.getRSBlocks(P,C),H=gk();for(let q=0;q<R.length;q+=1){const _=R[q];H.put(_.getMode(),4),H.put(_.getLength(),Ti.getLengthInBits(_.getMode(),P)),_.write(H)}let D=0;for(let q=0;q<$.length;q+=1)D+=$[q].dataCount;if(H.getLengthInBits()>D*8)throw"code length overflow. ("+H.getLengthInBits()+">"+D*8+")";for(H.getLengthInBits()+4<=D*8&&H.put(0,4);H.getLengthInBits()%8!=0;)H.putBit(!1);for(;!(H.getLengthInBits()>=D*8||(H.put(236,8),H.getLengthInBits()>=D*8));)H.put(17,8);return j(H,$)};p.addData=function(P,C){C=C||"Byte";let R=null;switch(C){case"Numeric":R=PX(P);break;case"Alphanumeric":R=LX(P);break;case"Byte":R=$X(P);break;case"Kanji":R=TX(P);break;default:throw"mode:"+C}h.push(R),f=null},p.isDark=function(P,C){if(P<0||u<=P||C<0||u<=C)throw P+","+C;return l[P][C]},p.getModuleCount=function(){return u},p.make=function(){if(a<1){let P=1;for(;P<40;P++){const C=mk.getRSBlocks(P,i),R=gk();for(let H=0;H<h.length;H++){const D=h[H];R.put(D.getMode(),4),R.put(D.getLength(),Ti.getLengthInBits(D.getMode(),P)),D.write(R)}let $=0;for(let H=0;H<C.length;H++)$+=C[H].dataCount;if(R.getLengthInBits()<=$*8)break}a=P}g(!1,w())},p.createTableTag=function(P,C){P=P||2,C=typeof C>"u"?P*4:C;let R="";R+='<table style="',R+=" border-width: 0px; border-style: none;",R+=" border-collapse: collapse;",R+=" padding: 0px; margin: "+C+"px;",R+='">',R+="<tbody>";for(let $=0;$<p.getModuleCount();$+=1){R+="<tr>";for(let H=0;H<p.getModuleCount();H+=1)R+='<td style="',R+=" border-width: 0px; border-style: none;",R+=" border-collapse: collapse;",R+=" padding: 0px; margin: 0px;",R+=" width: "+P+"px;",R+=" height: "+P+"px;",R+=" background-color: ",R+=p.isDark($,H)?"#000000":"#ffffff",R+=";",R+='"/>';R+="</tr>"}return R+="</tbody>",R+="</table>",R},p.createSvgTag=function(P,C,R,$){let H={};typeof arguments[0]=="object"&&(H=arguments[0],P=H.cellSize,C=H.margin,R=H.alt,$=H.title),P=P||2,C=typeof C>"u"?P*4:C,R=typeof R=="string"?{text:R}:R||{},R.text=R.text||null,R.id=R.text?R.id||"qrcode-description":null,$=typeof $=="string"?{text:$}:$||{},$.text=$.text||null,$.id=$.text?$.id||"qrcode-title":null;const D=p.getModuleCount()*P+C*2;let q,_,U,Y,I="",F;for(F="l"+P+",0 0,"+P+" -"+P+",0 0,-"+P+"z ",I+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',I+=H.scalable?"":' width="'+D+'px" height="'+D+'px"',I+=' viewBox="0 0 '+D+" "+D+'" ',I+=' preserveAspectRatio="xMinYMin meet"',I+=$.text||R.text?' role="img" aria-labelledby="'+A([$.id,R.id].join(" ").trim())+'"':"",I+=">",I+=$.text?'<title id="'+A($.id)+'">'+A($.text)+"</title>":"",I+=R.text?'<description id="'+A(R.id)+'">'+A(R.text)+"</description>":"",I+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',I+='<path d="',U=0;U<p.getModuleCount();U+=1)for(Y=U*P+C,q=0;q<p.getModuleCount();q+=1)p.isDark(U,q)&&(_=q*P+C,I+="M"+_+","+Y+F);return I+='" stroke="transparent" fill="black"/>',I+="</svg>",I},p.createDataURL=function(P,C){P=P||2,C=typeof C>"u"?P*4:C;const R=p.getModuleCount()*P+C*2,$=C,H=R-C;return IX(R,R,function(D,q){if($<=D&&D<H&&$<=q&&q<H){const _=Math.floor((D-$)/P),U=Math.floor((q-$)/P);return p.isDark(U,_)?0:1}else return 1})},p.createImgTag=function(P,C,R){P=P||2,C=typeof C>"u"?P*4:C;const $=p.getModuleCount()*P+C*2;let H="";return H+="<img",H+=' src="',H+=p.createDataURL(P,C),H+='"',H+=' width="',H+=$,H+='"',H+=' height="',H+=$,H+='"',R&&(H+=' alt="',H+=A(R),H+='"'),H+="/>",H};const A=function(P){let C="";for(let R=0;R<P.length;R+=1){const $=P.charAt(R);switch($){case"<":C+="&lt;";break;case">":C+="&gt;";break;case"&":C+="&amp;";break;case'"':C+="&quot;";break;default:C+=$;break}}return C},T=function(P){P=typeof P>"u"?2:P;const R=p.getModuleCount()*1+P*2,$=P,H=R-P;let D,q,_,U,Y;const I={"██":"█","█ ":"▀"," █":"▄"," ":" "},F={"██":"▀","█ ":"▀"," █":" "," ":" "};let O="";for(D=0;D<R;D+=2){for(_=Math.floor((D-$)/1),U=Math.floor((D+1-$)/1),q=0;q<R;q+=1)Y="█",$<=q&&q<H&&$<=D&&D<H&&p.isDark(_,Math.floor((q-$)/1))&&(Y=" "),$<=q&&q<H&&$<=D+1&&D+1<H&&p.isDark(U,Math.floor((q-$)/1))?Y+=" ":Y+="█",O+=P<1&&D+1>=H?F[Y]:I[Y];O+=`
97
+ `}return R%2&&P>0?O.substring(0,O.length-R-1)+Array(R+1).join("▀"):O.substring(0,O.length-1)};return p.createASCII=function(P,C){if(P=P||1,P<2)return T(C);P-=1,C=typeof C>"u"?P*2:C;const R=p.getModuleCount()*P+C*2,$=C,H=R-C;let D,q,_,U;const Y=Array(P+1).join("██"),I=Array(P+1).join(" ");let F="",O="";for(D=0;D<R;D+=1){for(_=Math.floor((D-$)/P),O="",q=0;q<R;q+=1)U=1,$<=q&&q<H&&$<=D&&D<H&&p.isDark(_,Math.floor((q-$)/P))&&(U=0),O+=U?Y:I;for(_=0;_<P;_+=1)F+=O+`
98
+ `}return F.substring(0,F.length-1)},p.renderTo2dContext=function(P,C){C=C||2;const R=p.getModuleCount();for(let $=0;$<R;$++)for(let H=0;H<R;H++)P.fillStyle=p.isDark($,H)?"black":"white",P.fillRect(H*C,$*C,C,C)},p};vd.stringToBytes=function(e){const t=[];for(let n=0;n<e.length;n+=1){const r=e.charCodeAt(n);t.push(r&255)}return t};vd.createStringToBytes=function(e,t){const n=(function(){const a=HX(e),i=function(){const f=a.read();if(f==-1)throw"eof";return f};let l=0;const u={};for(;;){const f=a.read();if(f==-1)break;const h=i(),p=i(),g=i(),v=String.fromCharCode(f<<8|h),w=p<<8|g;u[v]=w,l+=1}if(l!=t)throw l+" != "+t;return u})(),r=63;return function(a){const i=[];for(let l=0;l<a.length;l+=1){const u=a.charCodeAt(l);if(u<128)i.push(u);else{const f=n[a.charAt(l)];typeof f=="number"?(f&255)==f?i.push(f):(i.push(f>>>8),i.push(f&255)):i.push(r)}}return i}};const rs={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},y0={L:1,M:0,Q:3,H:2},$i={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Ti=(function(){const e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t=1335,n=7973,r=21522,a={},i=function(l){let u=0;for(;l!=0;)u+=1,l>>>=1;return u};return a.getBCHTypeInfo=function(l){let u=l<<10;for(;i(u)-i(t)>=0;)u^=t<<i(u)-i(t);return(l<<10|u)^r},a.getBCHTypeNumber=function(l){let u=l<<12;for(;i(u)-i(n)>=0;)u^=n<<i(u)-i(n);return l<<12|u},a.getPatternPosition=function(l){return e[l-1]},a.getMaskFunction=function(l){switch(l){case $i.PATTERN000:return function(u,f){return(u+f)%2==0};case $i.PATTERN001:return function(u,f){return u%2==0};case $i.PATTERN010:return function(u,f){return f%3==0};case $i.PATTERN011:return function(u,f){return(u+f)%3==0};case $i.PATTERN100:return function(u,f){return(Math.floor(u/2)+Math.floor(f/3))%2==0};case $i.PATTERN101:return function(u,f){return u*f%2+u*f%3==0};case $i.PATTERN110:return function(u,f){return(u*f%2+u*f%3)%2==0};case $i.PATTERN111:return function(u,f){return(u*f%3+(u+f)%2)%2==0};default:throw"bad maskPattern:"+l}},a.getErrorCorrectPolynomial=function(l){let u=J0([1],0);for(let f=0;f<l;f+=1)u=u.multiply(J0([1,Oi.gexp(f)],0));return u},a.getLengthInBits=function(l,u){if(1<=u&&u<10)switch(l){case rs.MODE_NUMBER:return 10;case rs.MODE_ALPHA_NUM:return 9;case rs.MODE_8BIT_BYTE:return 8;case rs.MODE_KANJI:return 8;default:throw"mode:"+l}else if(u<27)switch(l){case rs.MODE_NUMBER:return 12;case rs.MODE_ALPHA_NUM:return 11;case rs.MODE_8BIT_BYTE:return 16;case rs.MODE_KANJI:return 10;default:throw"mode:"+l}else if(u<41)switch(l){case rs.MODE_NUMBER:return 14;case rs.MODE_ALPHA_NUM:return 13;case rs.MODE_8BIT_BYTE:return 16;case rs.MODE_KANJI:return 12;default:throw"mode:"+l}else throw"type:"+u},a.getLostPoint=function(l){const u=l.getModuleCount();let f=0;for(let g=0;g<u;g+=1)for(let v=0;v<u;v+=1){let w=0;const b=l.isDark(g,v);for(let y=-1;y<=1;y+=1)if(!(g+y<0||u<=g+y))for(let k=-1;k<=1;k+=1)v+k<0||u<=v+k||y==0&&k==0||b==l.isDark(g+y,v+k)&&(w+=1);w>5&&(f+=3+w-5)}for(let g=0;g<u-1;g+=1)for(let v=0;v<u-1;v+=1){let w=0;l.isDark(g,v)&&(w+=1),l.isDark(g+1,v)&&(w+=1),l.isDark(g,v+1)&&(w+=1),l.isDark(g+1,v+1)&&(w+=1),(w==0||w==4)&&(f+=3)}for(let g=0;g<u;g+=1)for(let v=0;v<u-6;v+=1)l.isDark(g,v)&&!l.isDark(g,v+1)&&l.isDark(g,v+2)&&l.isDark(g,v+3)&&l.isDark(g,v+4)&&!l.isDark(g,v+5)&&l.isDark(g,v+6)&&(f+=40);for(let g=0;g<u;g+=1)for(let v=0;v<u-6;v+=1)l.isDark(v,g)&&!l.isDark(v+1,g)&&l.isDark(v+2,g)&&l.isDark(v+3,g)&&l.isDark(v+4,g)&&!l.isDark(v+5,g)&&l.isDark(v+6,g)&&(f+=40);let h=0;for(let g=0;g<u;g+=1)for(let v=0;v<u;v+=1)l.isDark(v,g)&&(h+=1);const p=Math.abs(100*h/u/u-50)/5;return f+=p*10,f},a})(),Oi=(function(){const e=new Array(256),t=new Array(256);for(let r=0;r<8;r+=1)e[r]=1<<r;for(let r=8;r<256;r+=1)e[r]=e[r-4]^e[r-5]^e[r-6]^e[r-8];for(let r=0;r<255;r+=1)t[e[r]]=r;const n={};return n.glog=function(r){if(r<1)throw"glog("+r+")";return t[r]},n.gexp=function(r){for(;r<0;)r+=255;for(;r>=256;)r-=255;return e[r]},n})(),J0=function(e,t){if(typeof e.length>"u")throw e.length+"/"+t;const n=(function(){let a=0;for(;a<e.length&&e[a]==0;)a+=1;const i=new Array(e.length-a+t);for(let l=0;l<e.length-a;l+=1)i[l]=e[l+a];return i})(),r={};return r.getAt=function(a){return n[a]},r.getLength=function(){return n.length},r.multiply=function(a){const i=new Array(r.getLength()+a.getLength()-1);for(let l=0;l<r.getLength();l+=1)for(let u=0;u<a.getLength();u+=1)i[l+u]^=Oi.gexp(Oi.glog(r.getAt(l))+Oi.glog(a.getAt(u)));return J0(i,0)},r.mod=function(a){if(r.getLength()-a.getLength()<0)return r;const i=Oi.glog(r.getAt(0))-Oi.glog(a.getAt(0)),l=new Array(r.getLength());for(let u=0;u<r.getLength();u+=1)l[u]=r.getAt(u);for(let u=0;u<a.getLength();u+=1)l[u]^=Oi.gexp(Oi.glog(a.getAt(u))+i);return J0(l,0).mod(a)},r},mk=(function(){const e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(a,i){const l={};return l.totalCount=a,l.dataCount=i,l},n={},r=function(a,i){switch(i){case y0.L:return e[(a-1)*4+0];case y0.M:return e[(a-1)*4+1];case y0.Q:return e[(a-1)*4+2];case y0.H:return e[(a-1)*4+3];default:return}};return n.getRSBlocks=function(a,i){const l=r(a,i);if(typeof l>"u")throw"bad rs block @ typeNumber:"+a+"/errorCorrectionLevel:"+i;const u=l.length/3,f=[];for(let h=0;h<u;h+=1){const p=l[h*3+0],g=l[h*3+1],v=l[h*3+2];for(let w=0;w<p;w+=1)f.push(t(g,v))}return f},n})(),gk=function(){const e=[];let t=0;const n={};return n.getBuffer=function(){return e},n.getAt=function(r){const a=Math.floor(r/8);return(e[a]>>>7-r%8&1)==1},n.put=function(r,a){for(let i=0;i<a;i+=1)n.putBit((r>>>a-i-1&1)==1)},n.getLengthInBits=function(){return t},n.putBit=function(r){const a=Math.floor(t/8);e.length<=a&&e.push(0),r&&(e[a]|=128>>>t%8),t+=1},n},PX=function(e){const t=rs.MODE_NUMBER,n=e,r={};r.getMode=function(){return t},r.getLength=function(l){return n.length},r.write=function(l){const u=n;let f=0;for(;f+2<u.length;)l.put(a(u.substring(f,f+3)),10),f+=3;f<u.length&&(u.length-f==1?l.put(a(u.substring(f,f+1)),4):u.length-f==2&&l.put(a(u.substring(f,f+2)),7))};const a=function(l){let u=0;for(let f=0;f<l.length;f+=1)u=u*10+i(l.charAt(f));return u},i=function(l){if("0"<=l&&l<="9")return l.charCodeAt(0)-48;throw"illegal char :"+l};return r},LX=function(e){const t=rs.MODE_ALPHA_NUM,n=e,r={};r.getMode=function(){return t},r.getLength=function(i){return n.length},r.write=function(i){const l=n;let u=0;for(;u+1<l.length;)i.put(a(l.charAt(u))*45+a(l.charAt(u+1)),11),u+=2;u<l.length&&i.put(a(l.charAt(u)),6)};const a=function(i){if("0"<=i&&i<="9")return i.charCodeAt(0)-48;if("A"<=i&&i<="Z")return i.charCodeAt(0)-65+10;switch(i){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+i}};return r},$X=function(e){const t=rs.MODE_8BIT_BYTE,n=vd.stringToBytes(e),r={};return r.getMode=function(){return t},r.getLength=function(a){return n.length},r.write=function(a){for(let i=0;i<n.length;i+=1)a.put(n[i],8)},r},TX=function(e){const t=rs.MODE_KANJI,n=vd.stringToBytes;(function(i,l){const u=n(i);if(u.length!=2||(u[0]<<8|u[1])!=l)throw"sjis not supported."})("友",38726);const r=n(e),a={};return a.getMode=function(){return t},a.getLength=function(i){return~~(r.length/2)},a.write=function(i){const l=r;let u=0;for(;u+1<l.length;){let f=(255&l[u])<<8|255&l[u+1];if(33088<=f&&f<=40956)f-=33088;else if(57408<=f&&f<=60351)f-=49472;else throw"illegal char at "+(u+1)+"/"+f;f=(f>>>8&255)*192+(f&255),i.put(f,13),u+=2}if(u<l.length)throw"illegal char at "+(u+1)},a},JN=function(){const e=[],t={};return t.writeByte=function(n){e.push(n&255)},t.writeShort=function(n){t.writeByte(n),t.writeByte(n>>>8)},t.writeBytes=function(n,r,a){r=r||0,a=a||n.length;for(let i=0;i<a;i+=1)t.writeByte(n[i+r])},t.writeString=function(n){for(let r=0;r<n.length;r+=1)t.writeByte(n.charCodeAt(r))},t.toByteArray=function(){return e},t.toString=function(){let n="";n+="[";for(let r=0;r<e.length;r+=1)r>0&&(n+=","),n+=e[r];return n+="]",n},t},DX=function(){let e=0,t=0,n=0,r="";const a={},i=function(u){r+=String.fromCharCode(l(u&63))},l=function(u){if(u<0)throw"n:"+u;if(u<26)return 65+u;if(u<52)return 97+(u-26);if(u<62)return 48+(u-52);if(u==62)return 43;if(u==63)return 47;throw"n:"+u};return a.writeByte=function(u){for(e=e<<8|u&255,t+=8,n+=1;t>=6;)i(e>>>t-6),t-=6},a.flush=function(){if(t>0&&(i(e<<6-t),e=0,t=0),n%3!=0){const u=3-n%3;for(let f=0;f<u;f+=1)r+="="}},a.toString=function(){return r},a},HX=function(e){const t=e;let n=0,r=0,a=0;const i={};i.read=function(){for(;a<8;){if(n>=t.length){if(a==0)return-1;throw"unexpected end of file./"+a}const f=t.charAt(n);if(n+=1,f=="=")return a=0,-1;if(f.match(/^\s$/))continue;r=r<<6|l(f.charCodeAt(0)),a+=6}const u=r>>>a-8&255;return a-=8,u};const l=function(u){if(65<=u&&u<=90)return u-65;if(97<=u&&u<=122)return u-97+26;if(48<=u&&u<=57)return u-48+52;if(u==43)return 62;if(u==47)return 63;throw"c:"+u};return i},OX=function(e,t){const n=e,r=t,a=new Array(e*t),i={};i.setPixel=function(h,p,g){a[p*n+h]=g},i.write=function(h){h.writeString("GIF87a"),h.writeShort(n),h.writeShort(r),h.writeByte(128),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(255),h.writeByte(255),h.writeByte(255),h.writeString(","),h.writeShort(0),h.writeShort(0),h.writeShort(n),h.writeShort(r),h.writeByte(0);const p=2,g=u(p);h.writeByte(p);let v=0;for(;g.length-v>255;)h.writeByte(255),h.writeBytes(g,v,255),v+=255;h.writeByte(g.length-v),h.writeBytes(g,v,g.length-v),h.writeByte(0),h.writeString(";")};const l=function(h){const p=h;let g=0,v=0;const w={};return w.write=function(b,y){if(b>>>y)throw"length over";for(;g+y>=8;)p.writeByte(255&(b<<g|v)),y-=8-g,b>>>=8-g,v=0,g=0;v=b<<g|v,g=g+y},w.flush=function(){g>0&&p.writeByte(v)},w},u=function(h){const p=1<<h,g=(1<<h)+1;let v=h+1;const w=f();for(let E=0;E<p;E+=1)w.add(String.fromCharCode(E));w.add(String.fromCharCode(p)),w.add(String.fromCharCode(g));const b=JN(),y=l(b);y.write(p,v);let k=0,S=String.fromCharCode(a[k]);for(k+=1;k<a.length;){const E=String.fromCharCode(a[k]);k+=1,w.contains(S+E)?S=S+E:(y.write(w.indexOf(S),v),w.size()<4095&&(w.size()==1<<v&&(v+=1),w.add(S+E)),S=E)}return y.write(w.indexOf(S),v),y.write(g,v),y.flush(),b.toByteArray()},f=function(){const h={};let p=0;const g={};return g.add=function(v){if(g.contains(v))throw"dup key:"+v;h[v]=p,p+=1},g.size=function(){return p},g.indexOf=function(v){return h[v]},g.contains=function(v){return typeof h[v]<"u"},g};return i},IX=function(e,t,n){const r=OX(e,t);for(let u=0;u<t;u+=1)for(let f=0;f<e;f+=1)r.setPixel(f,u,n(f,u));const a=JN();r.write(a);const i=DX(),l=a.toByteArray();for(let u=0;u<l.length;u+=1)i.writeByte(l[u]);return i.flush(),"data:image/gif;base64,"+i};vd.stringToBytes;const n8=4;function FX({value:e,label:t,size:n=200}){const{side:r,path:a}=s.useMemo(()=>{const i=vd(0,"M");i.addData(e),i.make();const l=i.getModuleCount();let u="";for(let f=0;f<l;f++)for(let h=0;h<l;h++)i.isDark(f,h)&&(u+=`M${h+n8} ${f+n8}h1v1h-1z`);return{side:l+n8*2,path:u}},[e]);return o.jsxs("svg",{className:"sc-qr",viewBox:`0 0 ${r} ${r}`,width:n,height:n,role:"img","aria-label":t,shapeRendering:"crispEdges",children:[o.jsx("rect",{className:"sc-qr-plate",width:r,height:r}),o.jsx("path",{className:"sc-qr-ink",d:a})]})}const _X=3e4,VX=5*6e4;function ZX(e,t=!1){return t?{sentence:"Could not read this computer's network.",action:"check"}:e?e.reach==="this-computer"?{sentence:"Scenri was started for this computer only. Start it without SCENRI_HOST to open it on your phone.",action:null}:e.problem==="no-network"?{sentence:"Connect this computer to Wi-Fi, then check again.",action:"check"}:e.problem==="blocked"||!e.url?{sentence:"Another app is holding this address, so phones cannot open Scenri yet.",action:"check"}:{sentence:"Point your phone's camera at the code, or copy the link for another computer.",action:"copy"}:{sentence:"Checking this computer's network.",action:null}}const zX=e=>e.url,BX=e=>`${e.slice(0,3)} ${e.slice(3)}`;function UX(e,t,n){return e.lastVisit&&e.lastVisit.at>=t-VX?"connected":n-t>=_X?"stuck":"waiting"}function WX(e,t){var n;return e==="connected"?`Connected. Scenri opened on your ${((n=t.lastVisit)==null?void 0:n.device)??"device"}.`:e==="stuck"?"No phone has opened it yet.":"Waiting for your phone…"}function KX(e,t){return e==="blocked"&&t==="darwin"?{text:"Your Mac's firewall is blocking Scenri, so your phone cannot open it yet.",canAllow:!0}:e==="blocked"&&t==="win32"?{text:"Windows Firewall is blocking Scenri on this network, so your phone cannot open it yet.",canAllow:!0}:e==="blocks-all"?{text:"Your Mac's firewall blocks every incoming connection. To open Scenri on your phone, turn off Block all incoming connections in System Settings, Network, Firewall, Options.",canAllow:!1}:null}function GX(e,t){const n=t==="darwin";switch(e){case"asking":return n?"Enter your Mac password to allow Scenri.":"Choose Yes when Windows asks to allow Scenri.";case"done":return"Allowed. Scan the code again.";case"cancelled":return"Nothing changed. Press Allow Scenri to try again.";case"failed":case"unsupported":return n?"Could not change the firewall. Open System Settings, Network, Firewall, Options, and set node to allow incoming connections.":"Could not change the firewall. Open Windows Security, Firewall and network protection, Allow an app through firewall, and tick Node.js for Private and Public.";default:return null}}function YX(e,t){const n=["Your phone has to be on the same Wi-Fi as this computer. Guest networks keep devices apart."];return e!=="blocked"&&e!=="blocks-all"&&e!=="ok"&&n.push("If this computer asks whether node may accept incoming connections, allow it."),n.push("If your phone's browser asks to find devices on your local network, allow it."),t.others.length&&n.push(`Or try ${t.others.join(" or ")}.`),n}const qX=2e3;function XX(){const[e,t]=s.useState(null),[n,r]=s.useState(!1),[a,i]=s.useState(null),[l,u]=s.useState(()=>Date.now()),[f,h]=s.useState(!1),[p,g]=s.useState(null),[v,w]=s.useState("idle"),[b,y]=s.useState(!1),k=s.useRef(null),S=s.useRef(null),{push:E}=cr(),j=s.useCallback(async(U=!1)=>{try{t(await je.phone(U)),r(!1)}catch{r(!0)}},[]),[N,A]=s.useState(!1),T=async()=>{A(!0);try{t(await je.phoneNewCode()),i(Date.now())}catch{E({kind:"warning",title:"Could not make a new code"})}finally{A(!1)}};s.useEffect(()=>{j();const U=setInterval(()=>{u(Date.now()),j()},qX);return()=>{clearInterval(U),k.current&&clearTimeout(k.current)}},[j]);const P=e?zX(e):null;s.useEffect(()=>{P&&a===null&&i(Date.now())},[P,a]);const C=e&&P&&a!==null?UX(e,a,l):null;s.useEffect(()=>{C==="stuck"&&h(!0)},[C]);const R=!!P&&!!(e!=null&&e.thisComputer);s.useEffect(()=>{if(!R)return;let U=!0;return je.phoneHelp().then(Y=>U&&g(Y.firewall)).catch(()=>U&&g("unknown")),()=>{U=!1}},[R]);const $=ZX(e,n),H=e?KX(p,e.platform):null,D=e?GX(v,e.platform):null,q=async()=>{P&&(await RX(P,S.current)?(y(!0),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>y(!1),1600)):E({kind:"warning",title:"Could not copy the link",detail:P}))},_=async()=>{w("asking");try{const U=await je.phoneAllow();g(U.firewall),w(U.result)}catch{w("failed")}};return o.jsxs(is,{title:"Other devices",children:[o.jsxs("div",{className:"sc-set-row",ref:S,children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Open on your phone"}),o.jsx("small",{"data-prose":"",children:$.sentence})]}),$.action==="copy"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void q(),children:o.jsx("span",{"aria-live":"polite",children:b?"Copied":"Copy link"})}),$.action==="check"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void j(!0),children:"Check again"})]}),e&&P&&o.jsxs("div",{className:"sc-phone",children:[o.jsx(FX,{value:P,label:`QR code for ${e.address}`}),o.jsxs("div",{className:"sc-phone-how",children:[o.jsxs("p",{children:["No camera? Go to ",o.jsx("b",{className:"sc-phone-key",children:e.address})," in any browser on the same Wi-Fi, then enter ",o.jsx("b",{className:"sc-phone-key",children:BX(e.code)}),"."]}),e.thisComputer&&H&&o.jsxs("div",{className:"sc-phone-fw",role:"status",children:[o.jsx("p",{children:H.text}),H.canAllow&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:v==="asking",onClick:()=>void _(),children:v==="asking"?"Waiting for your permission…":"Allow Scenri"})]}),e.thisComputer&&D&&o.jsx("p",{className:"sc-phone-allow","data-state":v,"aria-live":"polite",children:D}),e.thisComputer&&C&&o.jsx("p",{className:"sc-phone-arrival","data-state":C,"aria-live":"polite",children:WX(C,e)}),e.thisComputer&&o.jsxs("details",{className:"sc-phone-help",open:f,onToggle:U=>h(U.currentTarget.open),children:[o.jsx("summary",{children:"Not opening?"}),o.jsx("ul",{children:YX(p,e).map(U=>o.jsx("li",{children:U},U))})]})]})]}),(e==null?void 0:e.thisComputer)&&P&&o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"New code"}),o.jsx("small",{"data-prose":"",children:"Signs out every phone and tablet. They scan the new code to open Scenri again."})]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:N,onClick:()=>void T(),children:N?"Making…":"New code"})]})]})}function QX(e){switch(e){case"npx":return"npx scenri update";case"global":case"managed":return"scenri update";default:return"npx scenri@latest"}}function JX({version:e}){var y;const t=um(),n=Mm(),r=t.status,[a,i]=s.useState(null),[l,u]=s.useState(!1);s.useEffect(()=>{je.settings().then(k=>i(!!k.updateCheck)).catch(()=>{})},[]);const f=async()=>{if(a===null)return;const k=!a;i(k);try{await je.saveSettings({updateCheck:k})}catch{i(!k)}},h=s.useRef(null);s.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const p=QX(e==null?void 0:e.installKind),g=async()=>{try{await navigator.clipboard.writeText(p),u(!0),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>u(!1),1600)}catch{}},v=t.checking?o.jsx("span",{className:"sc-tag",children:"checking…"}):r!=null&&r.available?o.jsxs("span",{className:"sc-tag sc-tag-gold",children:[r.latest," available"]}):t.checkError||r!=null&&r.error?o.jsx("span",{className:"sc-tag",children:"couldn't check for updates"}):r!=null&&r.checkedAt?o.jsx("span",{className:"sc-tag",children:"up to date"}):null;let w,b;return r!=null&&r.available?(e==null?void 0:e.installKind)==="dev"?(w="Running from source. Pull and rebuild when you're ready; nothing here touches your checkout.",b=null):(e==null?void 0:e.thisComputer)!==!0?(w="Updates are installed on the computer running Scenri.",b=null):IA(r)?r.phase==="ready"?(w=t.applyError??`${r.stagedVersion} is downloaded and verified. Restarting finishes it.`,b="restart"):r.phase==="staging"?(w="Downloading in the background. Nothing interrupts your work.",b="downloading"):r.phase==="error"?(w=t.applyError??r.error??"Couldn't download the update. Try again.",b="update"):(w=`You are on ${r.current}.`,b="update"):(w=o.jsxs(o.Fragment,{children:["Run ",o.jsx("code",{children:p})," in a terminal, then start Scenri again. Your library is not part of the app and stays put."]}),b="copy"):(w=r&&!r.enabled?"Automatic checks are off. Checking here still works.":"New versions announce themselves here.",b="check"),o.jsxs(is,{children:[o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Updates"}),o.jsxs("small",{"data-prose":"",children:[w,(r==null?void 0:r.available)&&r.phase!=="ready"&&r.notesUrl&&o.jsxs(o.Fragment,{children:[" ",o.jsxs("a",{href:r.notesUrl,target:"_blank",rel:"noreferrer",children:["See what's in ",r.latest]})]})]})]}),v,b==="check"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:t.checking,onClick:()=>void t.checkNow(),children:"Check for updates"}),(b==="update"||b==="restart")&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:t.busy!=="idle",onClick:()=>void t.apply(),children:t.busy!=="idle"?"Updating…":(r==null?void 0:r.phase)==="error"?"Try again":"Update"}),b==="downloading"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:!0,children:"Downloading…"}),b==="copy"&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void g(),children:l?"Copied":"Copy command"})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"Automatic updates"}),o.jsx("small",{"data-prose":"",children:"A version check every six hours; new versions download in the background, and restarting is always your call. Off means Scenri never calls anywhere by itself."})]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:a===null,onClick:()=>void f(),children:a===null?"…":a?"Turn off":"Turn on"})]}),o.jsxs("div",{className:"sc-set-row",children:[o.jsxs("span",{className:"txt",children:[o.jsx("b",{children:"What's new"}),o.jsx("small",{children:((y=n.entry)==null?void 0:y.title)??`What changed in ${n.version?`v${n.version}`:"this version"}.`})]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>n.open(),children:"Show"})]})]})}function vk({weeks:e,months:t,cells:n}){return o.jsxs("div",{className:"sc-heat-range","data-weeks":e,children:[o.jsx("div",{className:"sc-heat-months",children:t.map(r=>o.jsx("span",{children:r.label},r.key))}),o.jsx("div",{className:"sc-heat-grid",children:n.map(r=>o.jsx("i",{"data-l":r.level||void 0,title:r.title},r.key))})]})}function eQ({brandId:e}){const[t,n]=s.useState(null);s.useEffect(()=>{let u=!0;return n(null),je.usage(e).then(f=>u&&n(f.days)).catch(()=>u&&n([])),()=>{u=!1}},[e]);const{year:r,quarter:a,total:i,byKind:l}=s.useMemo(()=>{const u=new Map,f={generation:0,edit:0};for(const g of t??[])u.set(g.day,(u.get(g.day)??0)+g.generations+g.edits),f.generation+=g.generations,f.edit+=g.edits;const h=pk(u,53),p=pk(u,13);return{year:h,quarter:p,total:h.sum,byKind:f}},[t]);return o.jsx(is,{sub:t===null?"Counting your runs…":i?`${i.toLocaleString()} runs in the last year: ${l.generation.toLocaleString()} generations, ${l.edit.toLocaleString()} edits.`:"Nothing made yet this year. The first shot lands here.",children:o.jsxs("div",{className:"sc-heat",children:[o.jsx(vk,{weeks:53,months:r.months,cells:r.cells}),o.jsx(vk,{weeks:13,months:a.months,cells:a.cells})]})})}function tQ({engines:e,brandId:t,onSaved:n}){const r=Vr("settings"),a=r.value!==null,[i,l]=s.useState(null);s.useEffect(()=>{if(!a||i)return;let b=!0;return je.version().then(y=>b&&l(y)).catch(()=>{}),()=>{b=!1}},[a,i]);const[u,f]=s.useState(null);s.useEffect(()=>{if(!a)return;let b=!0;return je.home().then(y=>b&&f(y)).catch(()=>{}),()=>{b=!1}},[a]);const[h,p]=s.useState(null),g=(i==null?void 0:i.thisComputer)===!0;s.useEffect(()=>{if(!a||!g)return;let b=!0;return je.desktop().then(y=>b&&p(y)).catch(()=>{}),()=>{b=!1}},[a,g]);const[v,w]=s.useState("idle");return o.jsx(_s,{open:a,className:"sc-set",maxWidth:"880px",onDismiss:r.close,children:o.jsx(nQ,{value:r.value,onPick:r.set,saved:o.jsx(rQ,{state:v}),page:b=>o.jsx(sQ,{page:b,engines:e,brandId:t,onSaved:n,onKitState:w,version:i,home:u,desktop:h,onDesktop:p})})})}function nQ({value:e,onPick:t,saved:n,page:r}){const a=Sr(ta),{brand:i}=dn(),l=KK(e),[u,f]=s.useState(()=>GK(e)),h=s.useRef(new Map),p=s.useRef(!1);s.useEffect(()=>{var b;!a||!u||!p.current||(p.current=!1,(b=h.current.get(l))==null||b.focus({preventScroll:!0}))},[a,u,l]);const g=b=>{t(b),f(!1)},v=nh.find(b=>b.id===l);if(a&&!u)return o.jsxs("div",{className:"sc-set-level",children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx("button",{type:"button",className:"sc-newdlg-back",onClick:()=>{p.current=!0,f(!0)},"aria-label":"Settings",children:o.jsx(Sa,{size:15})}),o.jsx(ks,{className:"sc-newdlg-title",children:v.label}),l==="brand"&&n,o.jsx(wk,{})]}),o.jsx("div",{className:"sc-newdlg-body sc-set-body",children:o.jsxs("div",{className:"sc-set-scroll",children:[o.jsx("p",{className:"sc-set-lede",children:v.sub(va(i))}),r(l)]})})]},`page-${l}`);const w=b=>o.jsx("li",{children:o.jsxs("button",{type:"button",className:"sc-set-item","data-danger":b.scope==="apart"?"":void 0,"aria-current":!a&&l===b.id?"page":void 0,ref:y=>{y?h.current.set(b.id,y):h.current.delete(b.id)},onClick:()=>g(b.id),children:[o.jsx(b.Icon,{size:16,className:"sc-set-item-ic"}),o.jsx("span",{className:"sc-set-item-lb",children:b.label}),a&&o.jsx(cl,{size:14,className:"sc-set-item-go"})]})},b.id);return o.jsxs("div",{className:"sc-set-level",children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ks,{className:"sc-newdlg-title",children:"Settings"}),o.jsx(wk,{})]}),o.jsxs("div",{className:"sc-newdlg-body sc-set-body",children:[o.jsxs("nav",{className:"sc-set-rail","aria-label":"Settings",children:[o.jsx("p",{className:"sc-set-group",children:"This brand"}),o.jsx("ul",{children:nh.filter(b=>b.scope==="brand").map(w)}),o.jsx("p",{className:"sc-set-group",children:"Studio"}),o.jsx("ul",{children:nh.filter(b=>b.scope==="studio").map(w)}),o.jsx("p",{className:"sc-set-group",children:"Delete"}),o.jsx("ul",{className:"sc-set-apart",children:nh.filter(b=>b.scope==="apart").map(w)})]}),!a&&o.jsxs("div",{className:"sc-set-scroll",children:[o.jsxs("header",{className:"sc-set-head",children:[o.jsxs("span",{className:"sc-set-head-say",children:[o.jsx("h2",{children:v.label}),o.jsx("p",{children:v.sub(va(i))})]}),l==="brand"&&n]}),r(l)]},l)]})]},"index")}function rQ({state:e}){const[t,n]=s.useState(!1),r=s.useRef(e);return s.useEffect(()=>{const a=r.current;if(r.current=e,e!=="idle"){n(!0);return}if(a==="idle")return;const i=setTimeout(()=>n(!1),1600);return()=>clearTimeout(i)},[e]),o.jsxs("span",{className:"sc-set-saved","data-on":t?"":void 0,"data-state":e,"aria-live":"polite",children:[e==="idle"&&o.jsx(Un,{size:12,weight:"bold"}),Iq(e)]})}function sQ({page:e,engines:t,brandId:n,onSaved:r,onKitState:a,version:i,home:l,desktop:u,onDesktop:f}){const h=(i==null?void 0:i.thisComputer)===!0;switch(e){case"brand":return o.jsx(fX,{onSaveState:a});case"usage":return o.jsx(eQ,{brandId:n});case"engines":return o.jsxs(o.Fragment,{children:[o.jsx(jX,{engines:t}),o.jsx(vX,{engines:t,onSaved:r,thisComputer:h})]});case"appearance":return o.jsx(Lq,{});case"library":return o.jsx(MX,{info:l,thisComputer:h});case"phone":return o.jsxs(o.Fragment,{children:[o.jsx(XX,{}),h&&o.jsx(bX,{status:u,onStatus:f})]});case"updates":return o.jsx(JX,{version:i});case"about":return o.jsx(Rq,{version:i});case"danger":return o.jsx(wX,{onDone:r,thisComputer:h})}}function wk(){return o.jsx(Ss,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(Mn,{size:16})})})}const aQ=["January","February","March","April","May","June","July","August","September","October","November","December"];function oQ(e){const t=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!t)return e;const n=aQ[Number(t[2])-1];return n?`${Number(t[3])} ${n} ${t[1]}`:e}function iQ(){const e=Vr("whatsnew"),{status:t,version:n,entry:r,changelogUrl:a,releasesUrl:i,markSeen:l}=Mm(),u=e.value!==null,f=()=>{l(),e.close()},h=s.useRef(u);s.useEffect(()=>{h.current&&!u&&l(),h.current=u},[u,l]);const p=t==="ready"&&!r&&!a,g=r!==null&&r.sections.length>1,v=t==="loading"?"Reading the release notes.":t==="failed"?"Scenri could not read its release notes. If you are running a development server, it may predate this feature; restart it and try again.":p?"You are running a development build. What changed in a version appears here once that version is published.":r?"Maintenance only. Nothing here changes how Scenri works for you.":"This version went out without a written summary.",w=r?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-vh",children:"Version "}),o.jsx("span",{className:"sc-wn-ver",children:r.version}),o.jsx("span",{"aria-hidden":"true",children:" · "}),oQ(r.date)]}):t==="failed"?"Release notes unavailable":t==="loading"?"Loading":p?"Development build":o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-vh",children:"Version "}),o.jsx("span",{className:"sc-wn-ver",children:n})]});return o.jsxs(_s,{open:u,className:"sc-wn",maxWidth:"420px",described:!0,onDismiss:f,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ks,{className:"sc-newdlg-title",children:"What's new"}),o.jsx(Ss,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(Mn,{size:16})})})]}),o.jsx(md,{className:"sc-wn-sub",children:w}),o.jsxs("div",{className:"sc-newdlg-body",children:[(r==null?void 0:r.title)&&o.jsx("p",{className:"sc-wn-lede sc-accent",children:r.title}),r&&r.sections.length>0?r.sections.map(b=>o.jsxs("section",{className:"sc-wn-sec",children:[g&&o.jsx("h3",{className:"sc-wn-head",children:b.heading}),o.jsx("p",{className:"sc-wn-txt",children:b.body})]},b.heading)):o.jsx("p",{className:"sc-wn-txt",children:v})]}),o.jsxs("div",{className:"sc-newdlg-foot sc-wn-foot",children:[i&&o.jsxs("a",{className:"sc-wn-link",href:i,target:"_blank",rel:"noreferrer",children:["All releases",o.jsx(Ku,{size:13})]}),o.jsx(Ss,{children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",children:"Got it"})})]})]})}function lQ(e){return{installed:e==="not-authenticated"||e==="signing-in"||e==="update-needed"||e==="env-conflict"||e==="repairing"||e==="ready",signedIn:e==="env-conflict"||e==="repairing"||e==="ready",connected:e==="ready",now:e==="not-installed"||e==="installing"?"install":e==="not-authenticated"||e==="signing-in"?"signin":e==="env-conflict"||e==="repairing"?"connect":null}}function eM(e){return e.length===0?"that key":e.length===1?`the ${e[0]} variable`:`the ${e.slice(0,-1).join(", ")} and ${e[e.length-1]} variables`}function cQ(e){return`Scenri will start Codex without ${eM(e)}. Nothing on your computer changes, and you can undo this here later.`}function uQ(e){return`Scenri is starting Codex without ${eM(e)} on this computer.`}const dQ=2e3,fQ=5*6e4;function hQ({engines:e,onSaved:t}){const n=Vr("setup"),r=n.close,a=n.value,i=a?YN(a):void 0,u=!!i||a==="codex-cli",f=e.find(g=>g.id===a),[h,p]=s.useState(!0);return s.useEffect(()=>{let g=!0;return je.version().then(v=>g&&p(v.thisComputer!==!1)).catch(()=>{}),()=>{g=!1}},[]),o.jsx(_s,{open:u,className:"sc-setup",maxWidth:"520px",onDismiss:r,onOpenAutoFocus:i&&h?g=>{var v;g.preventDefault(),(v=g.target.querySelector(".sc-setup-key input"))==null||v.focus()}:void 0,children:i?o.jsx(pQ,{provider:i,name:f?Ji(f.displayName):i.engineId,connected:!!(f!=null&&f.available),thisComputer:h,onSaved:t,onDone:r}):o.jsx(mQ,{engines:e,onSaved:t,onDone:r})})}function tM({title:e}){return o.jsxs("div",{className:"sc-newdlg-head sc-setup-head",children:[o.jsx(ks,{className:"sc-newdlg-title sc-setup-title",children:e}),o.jsx(Ss,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(Mn,{size:16})})})]})}function pQ({provider:e,name:t,connected:n,thisComputer:r,onSaved:a,onDone:i}){const[l,u]=s.useState(""),[f,h]=s.useState(!1),[p,g]=s.useState(null),[v,w]=s.useState(!1),b=async()=>{const k=l.trim();if(k){h(!0),g(null);try{await je.saveSettings({[e.settingKey]:k}),u(""),a(),i()}catch(S){g(S.message)}finally{h(!1)}}},y=async()=>{h(!0),g(null);try{await je.saveSettings({[e.settingKey]:""});const k=await je.settings();if(a(),k[e.settingKey]){w(!0);return}i()}catch(k){g(k.message)}finally{h(!1)}};return o.jsxs(o.Fragment,{children:[o.jsx(tM,{title:n?`${t} key`:`Connect ${t}`}),o.jsxs("div",{className:"sc-setup-body",children:[o.jsxs("div",{className:"sc-setup-intro",children:[o.jsx(nM,{engineId:e.engineId,name:t,state:n?"Connected":"Not connected",ready:n}),o.jsx("p",{className:"sc-setup-lead",children:r?n?`A key is saved for ${t}. Paste a new one to replace it, or disconnect to remove it from this computer.`:`Paste a key from ${t}. It is stored in your library folder on this computer, sent only to ${t}, and never shown again.`:"Keys are added on the computer running Scenri."})]}),r&&o.jsxs("form",{className:"sc-setup-key",onSubmit:k=>{k.preventDefault(),b()},children:[o.jsx("input",{className:"sc-in",type:"password",placeholder:e.hint,value:l,onChange:k=>u(k.target.value),autoComplete:"off",name:e.settingKey,"aria-label":`${t} key`}),o.jsxs("div",{className:"sc-setup-acts",children:[o.jsxs("button",{type:"submit",className:"sc-btn sc-btn-primary",disabled:f||!l.trim(),children:[f?o.jsx(Ar,{size:"1"}):o.jsx(P9,{size:15}),n?"Replace key":"Connect"]}),o.jsxs("a",{className:"sc-setup-alt",href:e.keysUrl,target:"_blank",rel:"noreferrer",children:["Get a key ",o.jsx(Ku,{size:13})]})]})]}),r&&n&&o.jsx("div",{className:"sc-setup-cut",children:o.jsx(qn,{label:"Disconnect",title:`Disconnect ${t}?`,body:"The key is deleted from this computer. Nothing you have already generated changes, and you can paste a new key at any time.",busy:f,onConfirm:()=>void y()})}),v&&o.jsxs("p",{className:"sc-setup-note",children:["The stored key is gone, but ",t," is still connected through the ",e.settingKey.toUpperCase()," ","environment variable on this computer. Remove it from your shell to disconnect fully."]}),p&&o.jsx("div",{className:"sc-setup-problem",children:o.jsxs("p",{"data-detail":"",children:[o.jsx(Hp,{size:15})," ",p]})})]})]})}function mQ({engines:e,onSaved:t,onDone:n}){const r=vl(),[a,i]=s.useState("checking"),[l,u]=s.useState(null),[f,h]=s.useState(!1),[p,g]=s.useState("mac"),[v,w]=s.useState(null),[b,y]=s.useState([]),[k,S]=s.useState([]),E=s.useRef(null),j=s.useCallback(()=>{E.current!==null&&(window.clearInterval(E.current),E.current=null)},[]),N=s.useCallback(async(Y=!1)=>{const{state:I,reason:F,platform:O,conflictKeys:Z,ignoredKeys:V}=await je.codexStatus({force:Y});return O&&g(O),w(F??null),y(Z??[]),S(V??[]),i(I),I},[]);s.useEffect(()=>(u(null),i("checking"),N().catch(()=>i("unverified")),j),[N,j]);const A=s.useCallback(()=>{u(null),i("checking"),N(!0).catch(()=>i("unverified"))},[N]),T=async()=>{u(null),i("repairing");try{const{state:Y,conflictKeys:I,ignoredKeys:F,reason:O}=await je.repairCodexEnv(b);y(I??[]),S(F??[]),w(O??null),i(Y)}catch(Y){u({detail:Y.message}),i("env-conflict")}},P=async()=>{u(null),i("checking");try{const{state:Y,conflictKeys:I,ignoredKeys:F}=await je.restoreCodexEnv();y(I??[]),S(F??[]),i(Y)}catch{N().catch(()=>i("unverified"))}};s.useEffect(()=>{a==="ready"&&t()},[a,t]);const C=async()=>{u(null),i("installing");try{const Y=await je.installCodex();if(Y.ok||Y.state!=="not-installed"){i(Y.state);return}u({detail:Y.detail,command:Y.fallbackCommand,docsUrl:Y.docsUrl}),i(Y.state)}catch(Y){u({detail:Y.message,command:"npm install -g @openai/codex"}),i("not-installed")}},R=async()=>{u(null),i("signing-in");const Y=Date.now();j(),E.current=window.setInterval(()=>{if(Date.now()-Y>fQ){j(),i("not-authenticated"),u({detail:"Sign-in did not finish. Try again, or use the command below.",command:"codex login"});return}je.codexStatus().then(({state:I})=>{I==="ready"&&(j(),i("ready"))}).catch(()=>{})},dQ);try{const I=await je.loginCodex();if(j(),I.ok||I.state==="ready"){i(I.state);return}u({detail:I.detail,command:I.fallbackCommand}),i(I.state)}catch(I){j(),u({detail:I.message,command:"codex login --device-auth"}),i("not-authenticated")}},$=s.useRef(null);s.useEffect(()=>()=>{$.current&&window.clearTimeout($.current)},[]);const H=Y=>{var I;(I=navigator.clipboard)==null||I.writeText(Y).then(()=>{h(!0),$.current&&window.clearTimeout($.current),$.current=window.setTimeout(()=>h(!1),1600)})},D=e.filter(Y=>Y.available&&Y.id!=="codex-cli"&&!Y.localOnly),q=a==="checking"||a==="installing"||a==="signing-in"||a==="repairing",_=a==="not-installed"||a==="installing"?{step:0,label:"Install Codex CLI",verb:a==="installing"?"Installing":"Install",busy:a==="installing",run:C}:a==="not-authenticated"||a==="signing-in"?{step:1,label:"Sign in with ChatGPT",verb:a==="signing-in"?"Waiting for your browser":"Sign in",busy:a==="signing-in",run:R}:a==="env-conflict"||a==="repairing"?{step:2,label:"Ignore that key",verb:a==="repairing"?"Ignoring":"Ignore that key",busy:a==="repairing",run:T}:null,U=a==="not-installed"||a==="installing"||a==="not-authenticated"||a==="signing-in";return o.jsxs(o.Fragment,{children:[o.jsx(tM,{title:"Set up image generation"}),o.jsxs("div",{className:"sc-setup-body",children:[o.jsxs("div",{className:"sc-setup-intro",children:[o.jsx(nM,{engineId:"codex-cli",name:"Codex CLI",state:gQ[a],ready:a==="ready",busy:q}),o.jsx("p",{className:"sc-setup-lead",children:vQ[a](v)}),a==="no-plan"&&o.jsx("p",{className:"sc-setup-lead",children:"You can use your own key from an image provider instead. You pay that provider directly, per image, and the key stays in your library folder on this computer."})]}),a!=="no-plan"&&o.jsx(wQ,{phase:a,act:_}),a==="signing-in"&&o.jsx("p",{className:"sc-setup-note",children:"Finish in the browser tab that just opened. This screen updates itself."}),(a==="env-conflict"||a==="repairing")&&o.jsx("p",{className:"sc-setup-note",children:cQ(b)}),a==="ready"&&k.length>0&&o.jsxs("p",{className:"sc-setup-note",children:[uQ(k)," ",o.jsx("button",{type:"button",className:"sc-setup-alt",onClick:P,children:"Use it again"})]}),a==="unverified"&&o.jsx("p",{className:"sc-setup-note",children:"If you just installed Codex, quit and reopen Scenri so it can see the new command."}),a==="update-needed"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"sc-setup-cmd",children:[o.jsx("code",{children:"npm install -g @openai/codex@latest"}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>H("npm install -g @openai/codex@latest"),children:[f?o.jsx(Un,{size:14}):o.jsx(Fh,{size:14}),f?"Copied":"Copy"]})]}),p==="windows"&&o.jsxs("p",{className:"sc-setup-note",children:["Installed with the standalone installer instead? Update it in PowerShell:"," ",o.jsx("code",{children:"irm https://chatgpt.com/codex/install.ps1 | iex"})]})]}),a==="no-plan"&&D.length>0&&o.jsxs("p",{className:"sc-setup-note",children:[D.map(Y=>Ji(Y.displayName)).join(", ")," is already connected, so you can generate now."]}),l&&o.jsxs("div",{className:"sc-setup-problem",children:[o.jsxs("p",{"data-detail":"",children:[o.jsx(Hp,{size:15})," ",l.detail??"That did not work."]}),l.command&&o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"sc-setup-note",children:["Run this in ",p==="windows"?"PowerShell":"Terminal",", then reopen this window:"]}),o.jsxs("div",{className:"sc-setup-cmd",children:[o.jsx("code",{children:l.command}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>H(l.command),children:[f?o.jsx(Un,{size:14}):o.jsx(Fh,{size:14}),f?"Copied":"Copy"]})]})]}),l.docsUrl&&o.jsxs("a",{className:"sc-setup-alt",href:l.docsUrl,target:"_blank",rel:"noreferrer",children:["Installation help ",o.jsx(Ku,{size:13})]})]}),a==="ready"&&o.jsxs("div",{className:"sc-setup-acts",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:n,children:"Start creating"}),o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:A,children:[o.jsx(Ih,{size:14})," Check again"]})]}),(a==="unverified"||a==="update-needed")&&o.jsxs("div",{className:"sc-setup-acts",children:[o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:A,children:[o.jsx(Ih,{size:15})," Check again"]}),a==="unverified"&&o.jsx("button",{type:"button",className:"sc-setup-alt",onClick:()=>i("no-plan"),children:"I do not have ChatGPT"})]}),a==="no-plan"&&o.jsxs("div",{className:"sc-setup-acts",children:[o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>r("openrouter"),children:[o.jsx(P9,{size:15})," Add a provider key"]}),o.jsx("button",{type:"button",className:"sc-setup-alt",onClick:()=>void N(),children:"Back to Codex setup"})]}),U&&o.jsx("div",{className:"sc-setup-acts",children:o.jsx("button",{type:"button",className:"sc-setup-alt",onClick:()=>i("no-plan"),children:"I do not have ChatGPT"})})]})]})}const gQ={checking:"Checking","not-installed":"Not installed",installing:"Installing","not-authenticated":"Not signed in","signing-in":"Waiting for your browser",ready:"Ready","env-conflict":"An old key is in the way",repairing:"Setting that key aside",unverified:"Could not verify","update-needed":"Needs an update","no-plan":"Needs a ChatGPT plan"},vQ={checking:()=>"Checking that Codex can actually reach OpenAI from this computer.","not-installed":()=>"Scenri generates with Codex CLI, a small official helper from OpenAI that runs on this computer and uses your own ChatGPT plan. It needs to be installed once.",installing:()=>"Scenri generates with Codex CLI, a small official helper from OpenAI that runs on this computer and uses your own ChatGPT plan. It needs to be installed once.","not-authenticated":()=>"Codex CLI is installed. Sign in with the ChatGPT account whose plan should cover your images. This opens your browser, and Scenri never sees your password or token.","signing-in":()=>"Codex CLI is installed. Sign in with the ChatGPT account whose plan should cover your images. This opens your browser, and Scenri never sees your password or token.",ready:()=>"Codex CLI is ready. Your images run on your own ChatGPT plan, and Scenri adds nothing to the bill.","env-conflict":()=>"Codex is signed in, but an old OpenAI API key on this computer is being used instead of your ChatGPT plan, and OpenAI turned it down.",repairing:()=>"Codex is signed in, but an old OpenAI API key on this computer is being used instead of your ChatGPT plan, and OpenAI turned it down.",unverified:()=>"Scenri could not verify Codex on this computer. Something answered too slowly or not at all, so nothing is assumed to work.","update-needed":e=>`${e??"Codex CLI on this computer is too old for Scenri."} Update it once, then check again.`,"no-plan":()=>"Codex CLI draws on a ChatGPT plan, so without one there is nothing behind it to generate your images."};function nM({engineId:e,name:t,state:n,ready:r,busy:a}){const i=XN(e);return o.jsxs("div",{className:"sc-setup-subject",children:[o.jsx("span",{className:"sc-eng-ic","data-brand":i?"":void 0,style:i?{"--sc-plate":i.plate,"--sc-ink":i.ink}:void 0,children:o.jsx(QN,{engineId:e})}),o.jsxs("span",{className:"sc-setup-say",children:[o.jsx("b",{className:"sc-setup-name",children:t}),o.jsxs("span",{className:"sc-setup-state",children:[a?o.jsx(Ar,{size:"1"}):r?o.jsx("span",{className:"d"}):null,n]})]})]})}function wQ({phase:e,act:t}){const{installed:n,signedIn:r,connected:a}=lQ(e),i=[n,r,a],l=["Install Codex CLI","Sign in with ChatGPT","Connect to Scenri"];return o.jsx("ol",{className:"sc-learn-steps sc-setup-steps",children:l.map((u,f)=>{const h=(t==null?void 0:t.step)===f,p=i[f]?"done":h?"active":"todo",g=o.jsx("span",{className:"sc-learn-n","aria-hidden":"true",children:i[f]?o.jsx(Un,{size:14,weight:"bold"}):f+1}),v=h&&t.busy;return o.jsx("li",{"data-on":i[f]?"":void 0,"data-now":h?"":void 0,children:h?o.jsxs("button",{type:"button",className:"sc-learn-step","data-state":p,"aria-label":t.label,disabled:v,onClick:t.run,children:[g,o.jsx("span",{className:"sc-learn-step-name",children:u}),o.jsxs("span",{className:"sc-learn-go","aria-hidden":"true",children:[v?o.jsx(Ar,{size:"1"}):null,t.verb,v?null:o.jsx(_a,{size:12,weight:"bold"})]})]}):o.jsxs("div",{className:"sc-learn-step","data-state":p,children:[g,o.jsx("span",{className:"sc-learn-step-name",children:u}),i[f]&&o.jsx("span",{className:"sc-vh",children:", done"})]})},u)})})}function yQ(){const{brands:e}=Hn(),t=rM(e);return t?o.jsx(Ba,{to:Eo(t),replace:!0}):o.jsx(Ba,{to:"/setup",replace:!0})}function rM(e){const t=JW();return e.find(n=>n.id===t)??e[0]??null}const bQ=48;function xQ(e,t,n=bQ){let r=null;for(const a of t){if(a.kind==="root")continue;const i=(r??e).findIndex(h=>h.id===a.id),l=a.status==="done"&&a.images.length>0&&!a.archived;if(i>=0){if((r??e)[i]===a)continue;r??(r=[...e]),l?r[i]=a:r.splice(i,1);continue}if(!l)continue;const u=r??e;if(u.length>=n&&Au(u[u.length-1],a)<0)continue;r??(r=[...e]);let f=0;for(;f<r.length&&Au(r[f],a)<=0;)f++;r.splice(f,0,a),r.length>n&&(r.length=n)}return r??e}const sM='[data-guide="library.new"]',wd=(e,t)=>({id:"go",voice:"ask",point:`[data-guide="nav.${e}"]`,side:"bottom",soft:!0,...t}),kQ='[data-guide="compose"] .sc-attachpanel',SQ='[data-guide="compose"] .sc-attachpanel .sc-ap-body',ep='[data-guide="compose"] .sc-promptcard',EQ='[data-guide="compose.add"]',aM='[data-guide="compose"] .sc-brief-line',tp='[data-guide="compose.send"]',oM='[data-guide="compose.engine"]',_u=".sc-pstudio",U6=`${_u} .sc-convo-card`,CQ=".sc-newdlg-layer",Vu=".sc-ovl",Sn={go:{title:"Shots are made in Create",body:"A shot is built from what you sell, who shows it and where. Open Create, and we'll make your first one together."},intro:{title:"This is Create, where shots are made",body:"A shot is built from three things Scenri keeps for you: what you sell, who shows it, and where it happens. Add them, say how to shoot it, and Scenri makes the picture in about a minute."},engine:{title:"Connect image generation",body:"Scenri needs an image engine before it can make anything. Setting one up takes about a minute."},product:{title:"Choose a product",body:"A product is the thing you are selling. Scenri keeps its real photos, so it looks the same in every shot you make."},presenter:{title:"Choose a presenter",body:"A presenter is a person Scenri keeps. Pick one and the same face shows your product in every shot."},scene:{title:"Choose a scene",body:"A scene is a place and its light. It decides where the shot happens and how it feels."},make:{title:"Say how to shoot it, then make it",body:"A few words about the moment, the light or the framing. Generate then puts your ingredients and your words together into a picture."},waiting:{title:"Scenri is making it",body:"This takes a moment. Your ingredients are kept, so you can change one thing later without starting over."},result:{title:"Your first shot",body:"The product, the presenter and the scene you chose are kept, so your next shot starts from them. Open it to change one thing."},failed:{title:"That one didn't work",body:"The tile says why. Put the shot together again and Scenri will try it again."},reuseProduct:{title:"Add the product you saved",body:"Yours sits in the shelf with ours. Putting it in again costs nothing: it is the same product, in a new shot."},reuseScene:{title:"Put it somewhere else",body:"A different place and light, so the two shots share the product and little else."},reuseResult:{title:"The same product, twice",body:"Two shots, one thing you added once. Anything Scenri keeps works this way: products, presenters and scenes."},refineAsk:{title:"Change one thing",body:"Say what to change, like warmer light or a closer crop. The rest of the shot stays."},refineResult:{title:"Here is the change",body:"The original stays one step back in the history, so nothing is lost."},refineFailed:{title:"That change didn't work",body:"Say the change again and Scenri will try it once more."},refineChoose:{title:"Choose a shot to change",body:"Open one from what you have made. You can also use Refine on its card."},refineGo:{title:"Your shots live in Create",body:"Refining starts from a picture you already have. Open Create to find one."},productGo:{title:"Your products live here",body:"Each one you add is kept, so it looks the same in every shot. Open Products to add yours."},productNew:{title:"Start a new product",body:"Add its real photos, or bring in your catalog from your store. Either way it is yours to reuse."},sceneGo:{title:"Your scenes live here",body:"A scene is a place and its light, saved to shoot in again. Open Scenes to make one."},sceneNew:{title:"Start a new scene",body:"Describe the place in a sentence, start from pictures of it, or let it guide you."},presenterGo:{title:"Your presenters live here",body:"A presenter is a person Scenri keeps, the same face in every shot. Open Presenters to make one."},presenterNew:{title:"Start a new presenter",body:"Describe someone, or add photos of a real person. The studio takes it from there."},presenterEngine:{title:"Set up image generation",body:"Drawing a face needs an engine. Setting one up takes about a minute, and the answers so far are kept."},presenterStart:{title:"Describe someone, or start from photos",body:"Photos keep a real face. Describing invents one, question by question."},presenterFace:{title:"Decide the face",body:"Every shot with this presenter uses this face, so take the one you want."},presenterSave:{title:"Save your presenter",body:"Once saved they are in your ingredients, ready for every shot."},sceneStart:{title:"Describe the place, or start from pictures",body:"A scene is the place and its light around your shot. Pictures are read for you; guided, it asks one thing at a time."},sceneWords:{title:"These words are the scene",body:"Every shot made in this scene is told exactly this. Draw it to see it, or say what to add."},productMake:{title:"Add your product",body:"Its real photos keep it the same in every shot. Add a few, or bring in your catalog from your store."}},el=e=>`.sc-feed .sc-cell[data-fb-node="${e}"]`,aw=e=>e.status==="done"&&e.images>0,ow=e=>e.status==="error"||e.status==="cancelled"||e.status==="done"&&e.images===0,W6=e=>e.products+e.presenters+(e.scene?1:0)+e.others,yk={product:"Products",presenter:"Presenters",scene:"Scenes"};function iM(e){if(!e.here)return e.heading?wd("create",Sn.go):null;const t=e.composer,n=e.nodes.find(aw);if(n)return{id:"result",voice:"note",point:el(n.id),side:"bottom",...Sn.result,done:!0};const r=e.nodes.find(u=>u.status==="running");if(r)return{id:"waiting",voice:"note",point:el(r.id),side:"bottom",...Sn.waiting};if(t!=null&&t.busy)return{id:"sending",voice:"quiet"};if(!t||t.refining)return null;const a=t.pickerOpen||W6(t)>0||t.words,i=e.nodes.find(ow);if(i&&!a)return{id:"failed",voice:"note",point:el(i.id),side:"bottom",...Sn.failed};if(t.engine!=="ready")return{id:"engine",voice:"ask",point:oM,side:"top",...Sn.engine};if(!e.begun&&W6(t)===0&&!t.words)return{id:"intro",voice:"ask",live:[],start:!0,...Sn.intro};const l=cM(t);return l?K6(l,t.pickerOpen):{id:"make",voice:"ask",point:tp,live:[aM,tp],side:"top",...Sn.make}}function lM(e){if(!e.here)return e.heading?wd("create",Sn.go):null;const t=e.composer,n=e.nodes.find(aw);if(n)return{id:"again",voice:"note",point:el(n.id),side:"bottom",...Sn.reuseResult,done:!0};const r=e.nodes.find(l=>l.status==="running");if(r)return{id:"waiting",voice:"note",point:el(r.id),side:"bottom",...Sn.waiting};if(t!=null&&t.busy)return{id:"sending",voice:"quiet"};if(!t||t.refining)return null;const a=t.pickerOpen||W6(t)>0||t.words,i=e.nodes.find(ow);return i&&!a?{id:"failed",voice:"note",point:el(i.id),side:"bottom",...Sn.failed}:t.engine!=="ready"?{id:"engine",voice:"ask",point:oM,side:"top",...Sn.engine}:t.products===0?K6("product",t.pickerOpen,Sn.reuseProduct):t.scene?{id:"make",voice:"ask",point:tp,live:[aM,tp],side:"top",...Sn.make}:K6("scene",t.pickerOpen,Sn.reuseScene)}function cM(e){return e.products===0?"product":e.presenters===0?"presenter":e.scene?null:"scene"}function K6(e,t,n){const r=n??Sn[e];return t?{id:e,voice:"ask",point:kQ,live:[SQ],lit:[ep],beside:!0,side:"right",...r}:{id:e,voice:"ask",point:EQ,side:"top",...r}}const uM=`${Vu} .sc-promptcard`,jQ=`${Vu} .sc-stage-img`,bk=`${Vu} .sc-trail`,xk=".sc-feed";function AQ(e){if(e.heading)return wd("create",Sn.refineGo);if(!e.here)return null;if(!e.open&&!e.armed)return{id:"choose",voice:"ask",point:xk,live:[xk],beside:!0,side:"left",...Sn.refineChoose};const t=e.nodes.find(aw);if(t)return e.open?{id:"refined",voice:"note",shell:Vu,point:bk,side:"top",...Sn.refineResult,done:!0}:{id:"refined",voice:"note",point:el(t.id),side:"bottom",...Sn.refineResult,done:!0};if(e.nodes.some(r=>r.status==="running"))return{id:"refining",voice:"quiet"};const n=e.nodes.find(ow);return n&&!e.asking?e.open?{id:"refine-failed",voice:"note",shell:Vu,point:bk,side:"top",...Sn.refineFailed}:{id:"refine-failed",voice:"note",point:el(n.id),side:"bottom",...Sn.refineFailed}:e.open?{id:"ask",voice:"ask",shell:Vu,point:uM,also:[jQ],beside:!0,side:"left",...Sn.refineAsk}:{id:"ask",voice:"ask",point:ep,live:[ep],beside:!0,side:"top",...Sn.refineAsk}}function dM(e){if(e.heading)return wd("presenters",Sn.presenterGo);const t=e.studio;if(t){const n=`${_u} [data-turn="q:${t.open}"]`,r=(a,i,l=[],u)=>({id:a,voice:"ask",shell:_u,point:`${n} .sc-convo-ask`,live:[n],also:l,...u?{lit:u}:{},beside:!0,side:"left",...i});switch(t.open){case"source":return r("start",Sn.presenterStart,[U6]);case"noengine":return r("engine",Sn.presenterEngine);case"identity":case"revision":return r("face",Sn.presenterFace,[".sc-pstudio-well",U6],[`${_u} [data-turn]:has(+ [data-turn="q:${t.open}"])`]);case"save":case"blind":return r("save",Sn.presenterSave);default:return{id:"studio",voice:"quiet"}}}return e.onPage?{id:"new",voice:"ask",point:sM,side:"bottom",...Sn.presenterNew}:null}function NQ(e,t){return{id:e,voice:"ask",shell:CQ,point:".sc-newdlg",beside:!0,side:"left",...t}}function fM(e){return{id:"new",voice:"ask",point:sM,side:"bottom",...e}}function MQ(e){var n,r;if(e.heading)return wd("scenes",Sn.sceneGo);const t=e.studio;if(t){const a=`${_u} [data-turn="q:${t.open}"]`,i=(l,u)=>({id:l,voice:"ask",shell:_u,point:`${a} .sc-convo-ask`,live:[a],also:[U6],beside:!0,side:"left",...u});return t.open==="source"?i("start",Sn.sceneStart):(n=t.open)!=null&&n.startsWith("agree-")?i("words",Sn.sceneWords):(r=t.open)!=null&&r.startsWith("decide-")?{id:"use",voice:"quiet"}:{id:"studio",voice:"quiet"}}return e.onPage?fM(Sn.sceneNew):null}function RQ(e){return e.heading?wd("products",Sn.productGo):e.dialogOpen?NQ("product",Sn.productMake):e.onPage?fM(Sn.productNew):null}function hM(e,t){if(e==="first-shot"){if(t==="presenter")return"product";if(t==="scene")return"presenter";if(t==="make")return"scene"}if(e==="reuse"){if(t==="scene")return"product";if(t==="make")return"scene"}return null}function PQ(e,t,n){return e?hM(e,t)||n&&(t==="new"||t==="choose"||(e==="first-shot"||e==="reuse")&&t==="product")||e==="presenter"&&(t==="start"||t==="face"||t==="save")||(e==="product"||e==="scene")&&t===e?!0:e==="refine"&&t==="ask":!1}function LQ(e,t){const n=e.active;return n?n.task==="presenter"?t.presenters>n.baseline.presenters:n.task==="scene"?t.scenes>n.baseline.scenes:n.task==="product"?t.products>n.baseline.products:!1:!1}const $Q={"first-shot":"shot",reuse:"shot",refine:"refine",product:"product",presenter:"presenter",scene:"scene"};function ah(e,t){return!(!t.eligible||t.hidden||t.active&&(t.active.task===e||t.active.task==="first-shot")||t.done[$Q[e]]||t.dismissed.includes(e)||e==="refine"&&!t.done.shot)}function TQ(e){return e.onMainPage&&e.eligible&&e.welcome===null&&e.ready&&e.visible&&!e.blocked&&!e.busy}const Nu={lede:"Scenri makes product shots for your brand. You choose the product, who shows it and where, and it makes the picture.",take:"Make your first shot",notNow:"Not now",again:"Welcome to Scenri",note:e=>e.engineReady?e.ownsProducts?"We'll make your first one together, a step at a time, with one of your products.":"We'll make your first one together, a step at a time. You can start with one of our products.":"First a short setup for image generation, then your first shot together, a step at a time."};function DQ(e){const t=e.filter(a=>a.previewUrl),n=(a,i)=>{var l,u;return(u=(((l=a.brief)==null?void 0:l.tokens)??[]).find(f=>(f==null?void 0:f.t)===i))==null?void 0:u.id},r=new Map;for(const a of t){const i=n(a,"product");i&&r.set(i,[...r.get(i)??[],a])}for(const a of r.values()){const i=new Map;for(const l of a){const u=n(l,"template");u&&!i.has(u)&&i.set(u,l)}if(i.size>=3)return[...i.values()].slice(0,3)}for(const a of r.values())if(a.length>=3)return a.slice(0,3);return t.slice(0,3)}function HQ(e,t,n,r){const a=new Map(e.map(l=>[l.id,l]));let i=!1;for(const l of t){if(l.kind!==r||l.createdAt<n)continue;const u={id:l.id,kind:l.kind,status:l.status,images:Array.isArray(l.images)?l.images.length:0,createdAt:l.createdAt},f=a.get(l.id);f&&f.status===u.status&&f.images===u.images||(a.set(l.id,u),i=!0)}return i?[...a.values()].sort((l,u)=>l.createdAt<u.createdAt?1:l.createdAt>u.createdAt?-1:0):e}const OQ="https://github.com/tonygorb/scenri";function IQ(){var w,b;const e=gn(pt.hub),t=gn(pt.set),n=!!e||!!t,r=Mm(),a=um(),i=!!((w=a.status)!=null&&w.available),l=i&&!a.dismissed||r.unread,u=gl(),f=vl(),h=TA(),p=YK(),{engines:g}=Hn(),v=!g.some(y=>y.available);return o.jsx("div",{className:"sc-help-float",children:o.jsxs(ws,{children:[o.jsx(lr,{label:"Help",children:o.jsx(ys,{children:o.jsxs("button",{type:"button",className:"sc-icon-btn sc-help-btn","aria-label":"Help",children:[o.jsx(WO,{size:16}),l&&o.jsx("span",{className:"sc-upd-dot","aria-hidden":"true"})]})})}),o.jsxs(bs,{align:"end",side:"top",sideOffset:8,className:"sc-menu sc-help-menu",children:[i&&o.jsxs(Yn,{className:"sc-menu-item","data-update":"",onSelect:()=>u("updates"),children:[o.jsx(IE,{size:18,className:"sc-menu-ic"}),o.jsxs("span",{className:"sc-menu-lb",children:["Update available · ",(b=a.status)==null?void 0:b.latest]})]}),o.jsxs(o.Fragment,{children:[o.jsxs(Yn,{className:"sc-menu-item",onSelect:()=>{$6.current="help",h()},children:[o.jsx($O,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Learn"})]}),o.jsxs(Yn,{className:"sc-menu-item",onSelect:()=>p(),children:[o.jsx(TO,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:Nu.again})]})]}),n&&o.jsxs(Yn,{className:"sc-menu-item",onSelect:()=>window.dispatchEvent(new Event("scenri:shortcuts")),children:[o.jsx(OO,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Keyboard shortcuts"})]}),o.jsxs(Yn,{className:"sc-menu-item",onSelect:()=>r.open(),children:[o.jsx(IO,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"What's new"}),r.unread&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-menu-new","aria-hidden":"true"}),o.jsx("span",{className:"sc-vh",children:", not read yet"})]})]}),v&&o.jsxs(Yn,{className:"sc-menu-item",onSelect:()=>f(),children:[o.jsx(O0,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Set up image generation"})]}),o.jsx("div",{className:"sc-menu-sep"}),o.jsxs(Yn,{className:"sc-menu-item",onSelect:()=>u("about"),children:[o.jsx($p,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"About Scenri"})]}),o.jsx(Yn,{className:"sc-menu-item",asChild:!0,children:o.jsxs("a",{href:OQ,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(LO,{size:18,className:"sc-menu-ic"}),o.jsx("span",{className:"sc-menu-lb",children:"Scenri on GitHub"})]})})]})]})})}function FQ(){return o.jsx(IQ,{})}const _Q={composer:null,overlay:null,studio:null,showing:!1};let Ga=_Q;const G6=new Set;function Sm(e){Ga=e;for(const t of G6)t()}const iw=(e,t)=>e===t||JSON.stringify(e)===JSON.stringify(t);function kk(e){iw(Ga.composer,e)||Sm({...Ga,composer:e})}function Sk(e){iw(Ga.overlay,e)||Sm({...Ga,overlay:e})}function np(e){iw(Ga.studio,e)||Sm({...Ga,studio:e})}function Ek(e){Ga.showing!==e&&Sm({...Ga,showing:e})}function pM(e){return G6.add(e),()=>G6.delete(e)}function VQ(){return Ga}function mM(){return s.useSyncExternalStore(pM,VQ)}function ZQ(){return s.useSyncExternalStore(pM,()=>Ga.showing)}function gM(e){return e.milestones.map(t=>t.label)}const Zi=[{id:"first-shot",title:"Make your first shot",summary:"A shot is three things Scenri keeps for you, put together and directed: what you sell, who shows it, and where it happens. Start with ours to see the shape of it, then swap in your own.",milestones:[{label:"Open Create",moments:["go"]},{label:"Choose a product",moments:["product"]},{label:"Choose a presenter",moments:["presenter"]},{label:"Choose a scene",moments:["scene"]},{label:"Say how to shoot it, then make it",moments:["make","sending","waiting","failed"]},{label:"Open your shot",moments:["result"]}]},{id:"product",title:"Add your product",summary:"Your own product, added once from its packshots or straight from your store, and exact in every shot you make from then on. Nothing is drawn here and nothing is spent.",milestones:[{label:"Find where your products live",moments:["go"]},{label:"Start a new one",moments:["new"]},{label:"Add its photos, or bring in your store",moments:["product"]}]},{id:"reuse",title:"Use it again",summary:"The same saved product in a different world. This is the whole point of keeping ingredients: one thing you added once, shot again and again without describing it twice.",milestones:[{label:"Open Create",moments:["go"]},{label:"Add the product you saved",moments:["product"]},{label:"Put it somewhere else",moments:["scene"]},{label:"Say how to shoot it, then make it",moments:["make","sending","waiting","failed"]},{label:"See the same product in both",moments:["again"]}],needs:"product"},{id:"presenter",title:"Create a presenter",summary:"One person Scenri keeps, invented question by question or built from photos of someone real, who stays the same face across every shot you put them in.",milestones:[{label:"Find where your presenters live",moments:["go"]},{label:"Start a new one",moments:["new"]},{label:"Describe someone, or add photos",moments:["start"]},{label:"Decide the face",moments:["face"]},{label:"Save them to the brand",moments:["save"]}]},{id:"scene",title:"Build a scene",summary:"A place and its light, saved to shoot in again, from pictures of it or a few questions.",milestones:[{label:"Find where your scenes live",moments:["go"]},{label:"Start a new one",moments:["new"]},{label:"Describe the place, or add pictures",moments:["start"]},{label:"Read what your shots are told",moments:["words"]},{label:"Use it",moments:["use"]}]},{id:"refine",title:"Refine a shot",summary:"Change one thing about a shot you already have and keep everything else, including the original. This is how a shot gets good: one change at a time, never a fresh start.",milestones:[{label:"Find the shots you have made",moments:["go"]},{label:"Choose a shot to change",moments:["choose"]},{label:"Say the one thing to change",moments:["ask","refine-failed"]},{label:"See the change on the trail",moments:["refining","refined"]}],needs:"shot"}],Y6={shot:{note:"Refining starts from a shot you have made.",action:"Make a shot first",status:"Needs a shot"},product:{note:"Using one again starts with a product of your own.",action:"Add a product first",status:"Needs a product"}};function zQ(e){return Zi.find(t=>t.id===e)??null}function BQ(e,t,n,r){var a,i,l;return((i=(a=t.progress)==null?void 0:a[e])==null?void 0:i.brandId)===n&&r>0?"active":(l=t.lessons)!=null&&l[e]?"done":"new"}function UQ(e,t){return e.find(n=>t(n)!=="done")??null}const lw=Object.fromEntries(Zi.map(e=>[e.id,Object.fromEntries(e.milestones.flatMap((t,n)=>t.moments.map(r=>[r,n])))]));function vM(e,t){let n=0;for(const r of t){const a=lw[e][r];a!==void 0&&a>n&&(n=a)}return n}function WQ(e,t){return vM(e,t)>0}function KQ(e,t){var a;const n=lw[e][t],r=((a=Zi.find(i=>i.id===e))==null?void 0:a.milestones.length)??0;return n===void 0||!r?null:{at:n+1,of:r}}const r8=e=>e.status==="done"&&e.images>0;function Ck(e,t,n){const r=vM(e,t);return n?Math.max(GQ(e,n),r):r}function GQ(e,t){const n=t.moment?lw[e][t.moment]:void 0;if(n!==void 0)return n;switch(e){case"first-shot":return t.nodes.some(r8)?5:t.nodes.length>0?4:0;case"reuse":return t.nodes.some(r8)?4:t.nodes.length>0?3:0;case"presenter":return t.draft?3:0;case"refine":return t.nodes.some(r8)||t.nodes.some(r=>r.status==="running")?3:0;default:return 0}}const q6={"first-shot":{square:new URL("/assets/first-shot-square-hTczF9bl.webp",import.meta.url).href,wide:new URL("/assets/first-shot-wide-BSpJwjNx.webp",import.meta.url).href},product:{square:new URL("/assets/product-square-DPR77tr0.webp",import.meta.url).href,wide:new URL("/assets/product-wide-DLSsO8IK.webp",import.meta.url).href},reuse:{square:new URL("/assets/reuse-square-CMLhjEwt.webp",import.meta.url).href,wide:new URL("/assets/reuse-wide-DbbTeKsL.webp",import.meta.url).href},presenter:{square:new URL("/assets/presenter-square-BpqHv8Aq.webp",import.meta.url).href,wide:new URL("/assets/presenter-wide-ecc4y7eJ.webp",import.meta.url).href},scene:{square:new URL("/assets/scene-square-CQBwEfXy.webp",import.meta.url).href,wide:new URL("/assets/scene-wide-CJ9ENIrh.webp",import.meta.url).href},refine:{square:new URL("/assets/refine-square-CietHTPe.webp",import.meta.url).href,wide:new URL("/assets/refine-wide-BM5sVq6w.webp",import.meta.url).href}};function YQ({open:e,pictures:t,note:n,onTake:r,onDecline:a}){return o.jsxs(_s,{open:e,className:"sc-welcome",maxWidth:"440px",described:!0,tone:"guide",onDismiss:a,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsxs(ks,{className:"sc-newdlg-title",children:["Welcome to ",o.jsx("span",{className:"sc-accent",children:"Scenri"})]}),o.jsx(Ss,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":Nu.notNow,children:o.jsx(Mn,{size:16})})})]}),o.jsx(md,{className:"sc-welcome-lede",children:Nu.lede}),t.length>0&&o.jsx("div",{className:"sc-welcome-pics","aria-hidden":"true",children:t.map((i,l)=>o.jsx("img",{src:i,alt:"",style:{animationDelay:`${120+l*60}ms`}},i))}),o.jsxs("div",{className:"sc-newdlg-foot sc-welcome-foot",children:[o.jsx("p",{className:"sc-welcome-note",children:n}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:a,children:Nu.notNow}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:r,children:Nu.take})]})]})}const jk=e=>e.t!=="format",fo=()=>[{t:"text",v:""}],za=e=>e.t==="product"?`p:${e.id}`:e.t==="template"?`t:${e.id}`:e.t==="ref"?`r:${e.imageHash}`:Em(e);function qQ(e,t){const n=new Set,r=l=>{const u=za(l);return u?n.has(u)?!1:(n.add(u),!0):!0},a=e.filter(jk).filter(r),i=t.filter(jk).filter(r);return{own:a,carried:i}}function cw(e){const{own:t,carried:n}=qQ(e.tokens??[],e.inherited??[]),r=[...t,...n],a=r.length?r:fo(),i=a.some(l=>l.t==="template");return e.templateId&&!i?[{t:"template",id:e.templateId},...a]:a}const Kl="sc-token",If=`.${Kl}`,Em=e=>e.t==="template"?`t:${e.id}${e.setup||e.view?`|${e.setup??""}`:""}${e.view?`|${e.view}|${e.viewName??""}`:""}`:e.t==="product"?`p:${e.id}${e.angle?`|${e.angle}`:""}`:e.t==="character"?`h:${e.id}`:e.t==="color"?`c:${e.hex}|${e.name??""}`:e.t==="ref"?`r:${e.imageHash}${e.label?`|${e.label}`:""}`:e.t==="mark"?`m:${e.imageHash}`:"",ps=e=>{const t=e.slice(0,1),n=e.slice(2);if(t==="t"){const[r,a,i,l]=n.split("|");return r?{t:"template",id:r,...a?{setup:a}:{},...i?{view:i,...l?{viewName:l}:{}}:{}}:null}if(t==="p"){const[r,a]=n.split("|");return r?{t:"product",id:r,...a?{angle:a}:{}}:null}if(t==="h")return n?{t:"character",id:n}:null;if(t==="r"){const r=n.indexOf("|"),a=r<0?n:n.slice(0,r),i=r<0?"":n.slice(r+1);return a?{t:"ref",imageHash:a,...i?{label:i}:{}}:null}if(t==="m")return n?{t:"mark",imageHash:n}:null;if(t==="c"){const[r,a]=n.split("|");return r?{t:"color",hex:r,name:a||void 0}:null}return null},ei="\uFEFF",yl=//g,ac=e=>!!e&&e.nodeType===Node.TEXT_NODE&&e.textContent===ei,wM=e=>{var t;return e.length-(((t=e.match(yl))==null?void 0:t.length)??0)};function uo(e){const t=typeof window>"u"?null:window.getSelection();if(!e||!t||t.rangeCount===0)return null;const n=t.getRangeAt(0);return e.contains(n.startContainer)?sp(e,n.startContainer,n.startOffset):null}function Fa(e,t){if(!e)return;let n=0;for(const r of Array.from(e.childNodes)){const a=nd(r);if(r.nodeType===Node.TEXT_NODE){if(t<=n+a){bo(e,r,rp(r,t-n));return}}else if(t<=n+a){const i=r.nextSibling;if((i==null?void 0:i.nodeType)===Node.TEXT_NODE){bo(e,i,rp(i,0));return}break}n+=a}Gl(e)}function rp(e,t){const n=e.textContent??"";if(n===ei)return 1;let r=0,a=0;for(;a<n.length&&r<t;)n[a]!==ei&&(r+=1),a+=1;return a}function Gl(e){if(!e)return;e.focus({preventScroll:!0});const t=e.lastChild;if((t==null?void 0:t.nodeType)===Node.TEXT_NODE){bo(e,t,t.length);return}const n=window.getSelection(),r=document.createRange();r.selectNodeContents(e),r.collapse(!1),n==null||n.removeAllRanges(),n==null||n.addRange(r)}function XQ(e){if(!e)return!1;const t=window.getSelection();if(!t||t.rangeCount===0||t.isCollapsed)return!1;const n=t.getRangeAt(0);return e.contains(n.startContainer)&&e.contains(n.endContainer)}function bo(e,t,n){const r=window.getSelection(),a=document.createRange();a.setStart(t,Math.max(0,Math.min(n,t.length))),a.collapse(!0),r==null||r.removeAllRanges(),r==null||r.addRange(a)}const nd=e=>e.nodeType===Node.TEXT_NODE?wM(e.textContent??""):1;function sp(e,t,n){if(t===e){let a=0;for(let i=0;i<n&&i<e.childNodes.length;i++)a+=nd(e.childNodes[i]);return a}let r=0;for(const a of Array.from(e.childNodes)){if(a===t)return r+wM((a.textContent??"").slice(0,n));if(a.contains(t))return r+1;r+=nd(a)}return r}function po(e){var n,r;if(!e)return;const t=uo(e);e.normalize();for(const a of Array.from(e.childNodes)){if(a.nodeType!==Node.TEXT_NODE)continue;const i=a.textContent??"",l=i.replace(yl,""),u=l.length?l:i.length?ei:"";u!==i&&(a.textContent=u),u||a.remove()}for(const a of Array.from(e.childNodes))ac(a)&&!Ts(a.previousSibling)&&!Ts(a.nextSibling)&&a.remove();for(const a of Array.from(e.childNodes))Ts(a)&&(((n=a.previousSibling)==null?void 0:n.nodeType)!==Node.TEXT_NODE&&e.insertBefore(document.createTextNode(ei),a),((r=a.nextSibling)==null?void 0:r.nodeType)!==Node.TEXT_NODE&&e.insertBefore(document.createTextNode(ei),a.nextSibling));b0(e)||t!==null&&Fa(e,t)}function QQ(e){var n,r,a;if(!e)return!0;const t=e.childNodes;for(let i=0;i<t.length;i++){const l=t[i];if(Ts(l)){if(((n=l.previousSibling)==null?void 0:n.nodeType)!==Node.TEXT_NODE||((r=l.nextSibling)==null?void 0:r.nodeType)!==Node.TEXT_NODE)return!1;continue}if(l.nodeType!==Node.TEXT_NODE)continue;const u=l.textContent??"";if(!u||((a=t[i+1])==null?void 0:a.nodeType)===Node.TEXT_NODE||u.includes(ei)&&(u!==ei||!Ts(l.previousSibling)&&!Ts(l.nextSibling)))return!1}return!0}function JQ(e){return e.querySelector(If)?!1:!(e.textContent??"").replace(/[​ ]/g,"").trim()}function b0(e){if(!e)return!1;const t=JQ(e);return t&&e.firstChild&&e.replaceChildren(),e.toggleAttribute("data-empty",t),t}const Ts=e=>!!e&&e.nodeType===Node.ELEMENT_NODE&&e.classList.contains(Kl);function uw(e){if(!e)return null;const t=typeof window>"u"?null:window.getSelection();if(!t||t.rangeCount===0||!t.getRangeAt(0).collapsed)return null;const n=t.getRangeAt(0),r=n.startContainer;return r.nodeType!==Node.TEXT_NODE||r.parentNode!==e?null:{text:r,at:n.startOffset}}function Ak(e){var a;if(!e)return fo();const t=[];let n="";const r=()=>{n&&(t.push({t:"text",v:n}),n="")};for(const i of Array.from(e.childNodes)){if(i.nodeType===Node.TEXT_NODE){n+=(i.textContent??"").replace(yl,"");continue}const l=i,u=(a=l.dataset)==null?void 0:a.tok;if(u){const f=ps(u);if(f){r(),t.push(f);continue}}if(l.tagName==="BR"){n+=`
99
+ `;continue}n+=l.textContent??""}return r(),t.some(i=>i.t==="text")||t.push({t:"text",v:""}),t}function Nk(e,t,n){if(e){e.textContent="";for(const r of eJ(t)){if(r.t==="text"){r.v&&e.appendChild(document.createTextNode(r.v));continue}e.appendChild(n(r))}po(e)}}function eJ(e){const t=n=>n>=0&&n<e.length&&e[n].t!=="text";return e.filter((n,r)=>{if(n.t!=="text"||!/^\s+$/.test(n.v))return!0;const a=r===0||t(r-1),i=r===e.length-1||t(r+1);return!(a&&i)})}function s8(e,t){for(const n of Array.from(e.querySelectorAll(If))){const r=ps(n.dataset.tok??"");if(r&&za(r)===t)return n}return null}function yM(e){const t=typeof window>"u"?null:window.getSelection();if(!e||!t||t.rangeCount===0)return"";const n=t.getRangeAt(0);if(n.startContainer.nodeType!==Node.TEXT_NODE||!e.contains(n.startContainer))return"";let r=(n.startContainer.textContent??"").slice(0,n.startOffset);for(let a=n.startContainer.previousSibling;a&&a.nodeType===Node.TEXT_NODE;a=a.previousSibling)r=(a.textContent??"")+r;return r}function bM(){const e=window.getSelection();if(!e||e.rangeCount===0)return null;const t=e.getRangeAt(0).cloneRange(),n=t.getBoundingClientRect();if(n.width||n.height)return n;const r=document.createElement("span");r.textContent="​",t.insertNode(r);const a=r.getBoundingClientRect(),i=r.parentNode;return r.remove(),i==null||i.normalize(),a}function ec(e,t,n){if(!e||!t)return;const r=n==="after"?t.nextSibling:t.previousSibling;if((r==null?void 0:r.nodeType)!==Node.TEXT_NODE)return;const a=r;bo(e,a,ac(a)?1:n==="after"?0:a.length)}const ap=9;function xM(e){if(!e.firstChild)return[];const t=document.createRange();return t.selectNodeContents(e),Array.from(t.getClientRects()).filter(n=>n.height>0)}function kM(e,t){let n=null,r=1/0;for(const a of e){const i=t<a.top?a.top-t:t>a.bottom?t-a.bottom:0;i<r&&(r=i,n=a)}return n}function Mk(e,t,n){if(!e)return!1;const r=xM(e),a=kM(r,n);if(!a)return!1;const i=a.top+a.height/2;for(const u of Array.from(e.querySelectorAll(If))){const f=u.getBoundingClientRect();if(!(f.bottom<a.top||f.top>a.bottom)&&!(t<f.left-ap||t>f.right+ap))return ec(e,u,t<f.left+f.width/2?"before":"after"),!0}if(n>=a.top&&n<=a.bottom)return!1;const l=SM(t,i);return!l||!e.contains(l.node)||l.node.nodeType!==Node.TEXT_NODE?!1:(bo(e,l.node,l.offset),!0)}function tJ(e,t,n){if(!e)return null;const r=kM(xM(e),n);if(!r)return null;const a=r.top+r.height/2;for(const l of Array.from(e.querySelectorAll(If))){const u=l.getBoundingClientRect();if(!(u.bottom<r.top||u.top>r.bottom)&&!(t<u.left-ap||t>u.right+ap))return{beside:l,side:t<u.left+u.width/2?"before":"after"}}const i=SM(t,a);return!i||!e.contains(i.node)?null:{node:i.node,offset:i.offset}}function SM(e,t){var i,l;const n=document,r=(i=n.caretRangeFromPoint)==null?void 0:i.call(n,e,t);if(r)return{node:r.startContainer,offset:r.startOffset};const a=(l=n.caretPositionFromPoint)==null?void 0:l.call(n,e,t);return a?{node:a.offsetNode,offset:a.offset}:null}function nJ(e,t,n={}){if(!e)return;const r=window.getSelection();let a=null;if(r&&r.rangeCount>0&&e.contains(r.getRangeAt(0).startContainer))a=r.getRangeAt(0);else if(n.fallbackUnits!=null){Fa(e,n.fallbackUnits);const l=window.getSelection();l&&l.rangeCount>0&&e.contains(l.getRangeAt(0).startContainer)&&(a=l.getRangeAt(0))}a||(a=document.createRange(),a.selectNodeContents(e),a.collapse(!1)),a.deleteContents();const i=a.startContainer;if(i.nodeType===Node.TEXT_NODE&&i.parentNode===e){const l=i,u=l.textContent??"";let f=u.slice(0,a.startOffset);const h=u.slice(a.startOffset);n.eatQuery&&(f=oJ(l,f)),l.textContent=f,e.insertBefore(t,l.nextSibling),h&&e.insertBefore(document.createTextNode(h),t.nextSibling)}else{const l=i===e?a.startOffset:e.childNodes.length;e.insertBefore(t,e.childNodes[l]??null)}po(e),Fa(e,Ya(e,t)+1)}const rJ=["$","/","@","#"],sJ=e=>rJ.includes(e),op=e=>e===" "||e===`
100
+ `||e===" "||e===ei;function aJ(e){const t=yM(e);for(let n=t.length-1;n>=0;n--){const r=t[n];if(op(r))return null;if(sJ(r))return n===0||op(t[n-1])?{sigil:r,query:t.slice(n+1)}:null}return null}function oJ(e,t){const n=i=>Math.max(i.lastIndexOf("$"),i.lastIndexOf("/"),i.lastIndexOf("@"),i.lastIndexOf("#")),r=n(t);if(r>=0)return t.slice(0,r);const a=[];for(let i=e.previousSibling;i&&i.nodeType===Node.TEXT_NODE;i=i.previousSibling){const l=i.textContent??"",u=n(l);if(u>=0){i.textContent=l.slice(0,u);for(const f of a)f.remove();return""}a.push(i)}return t}function a8(e,t){if(!e||!t)return;e.normalize();const n=Ya(e,t);t.remove(),po(e),Fa(e,n)}function Ya(e,t){let n=0;for(const r of Array.from(e.childNodes)){if(r===t)break;n+=nd(r)}return n}function iJ(e,t){var u,f;const n=uw(e);if(!n||!e)return!1;const{text:r,at:a}=n,i=ac(r);if(t==="right"){if(!Ts(r.nextSibling)||!i&&a!==r.length)return!1;const h=(u=r.nextSibling)==null?void 0:u.nextSibling;return(h==null?void 0:h.nodeType)!==Node.TEXT_NODE?!1:(bo(e,h,ac(h)?1:0),!0)}if(!Ts(r.previousSibling)||!i&&a!==0)return!1;const l=(f=r.previousSibling)==null?void 0:f.previousSibling;return(l==null?void 0:l.nodeType)!==Node.TEXT_NODE?!1:(bo(e,l,ac(l)?1:l.length),!0)}function Rk(e,t){const n=uw(e);if(!n)return null;const{text:r,at:a}=n,i=ac(r);return t==="Backspace"?Ts(r.previousSibling)&&(i||a===0)?r.previousSibling:null:Ts(r.nextSibling)&&(i||a===r.length)?r.nextSibling:null}function Pk(e,t){const n=uw(e);return!n||!ac(n.text)?!1:t==="Backspace"?!n.text.previousSibling:!n.text.nextSibling}function lJ(e,t){const n=uo(e);if(!e||n==null)return null;const r=Array.from(e.childNodes).filter(Ts);if(t==="forward")return r.find(a=>Ya(e,a)>=n)??null;for(let a=r.length-1;a>=0;a--)if(Ya(e,r[a])<n)return r[a];return null}const Zu=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");function cJ(e){let t="",n="",r=!1;const a=i=>{var f;if(i.nodeType===Node.TEXT_NODE){const h=(i.textContent??"").replace(yl,"");if(!h)return;t+=h,n+=Zu(h),r=!1;return}const l=i,u=(f=l.dataset)==null?void 0:f.tok;if(u){const h=zo(l);t+=(r?" ":"")+h,r=!0,n+=`<span data-sc-tok="${Zu(u)}">${Zu(h)}</span>`;return}i.childNodes.forEach(a)};return e.cloneContents().childNodes.forEach(a),{text:t,html:`<span data-sc-brief="1">${n}</span>`}}function uJ(e,t){const n=[],r=[];for(const a of e){if(a.t==="text"){const l=a.v.trim();if(!l)continue;n.push(l),r.push(Zu(l));continue}const i=t(a);n.push(i),r.push(`<span data-sc-tok="${Zu(Em(a))}">${Zu(i)}</span>`)}return{text:n.join(" "),html:`<span data-sc-brief="1">${r.join(" ")}</span>`}}function zo(e){var t;return(((t=e.querySelector(".sc-token-label"))==null?void 0:t.textContent)??"").trim()}function dJ(e){if(!e.includes("data-sc-brief")&&!e.includes("data-bt-brief"))return null;const n=new DOMParser().parseFromString(e,"text/html").querySelector("[data-sc-brief], [data-bt-brief]");if(!n)return null;const r=[],a=i=>{var h,p;if(i.nodeType===Node.TEXT_NODE){const g=(i.textContent??"").replace(yl,"");g&&r.push(g);return}const l=i,u=((h=l.dataset)==null?void 0:h.scTok)??((p=l.dataset)==null?void 0:p.btTok);if(u===void 0){i.childNodes.forEach(a);return}const f=ps(u);r.push(f??l.textContent??"")};return n.childNodes.forEach(a),r.length?r:null}function EM(e){const t=new Set([0]);let n=0;for(const i of e){if(i.t!=="text"){t.add(n),n+=1,t.add(n);continue}for(let l=0;l<i.v.length;l++)(i.v[l]===" "||i.v[l]===`
101
+ `)&&t.add(n+l+1);n+=i.v.length}t.add(n);const r=[...t].sort((i,l)=>i-l),a=Ff(e);return r.filter((i,l)=>l===r.length-1||!/^[ \n]*$/.test(a.slice(i,r[l+1])))}const Ff=e=>e.map(t=>t.t==="text"?t.v:"").join(""),dw=(e,t,n)=>{const r=n<=t?e.slice(n,t):e.slice(t+1,n);return/^[ \n]*$/.test(r)};function fJ(e,t){const n=Ff(e);return EM(e).filter(r=>!dw(n,t,r))}function hJ(e,t){return e.find(n=>n>=t)??(e.length?e[e.length-1]:null)}function pJ(e,t){let n=null,r=1/0;for(const a of e){const i=Math.abs(a-t);i<r&&(r=i,n=a)}return n}function CM(e,t,n){if(!e||!t.parentNode)return!1;const r=Ya(e,t);if(dw(Ff(Cm(e)),r,n))return!1;let a=null,i=0;for(const l of Array.from(e.childNodes)){const u=nd(l);if(n<=i+u){if(l.nodeType===Node.TEXT_NODE){const f=n-i;f<=0?a=l:f>=u?a=l.nextSibling:a=l.splitText(rp(l,f))}else a=n===i?l:l.nextSibling;break}i+=u}return a===t?!1:(t.remove(),e.insertBefore(t,a),po(e),!0)}function Lk(e,t,n){if(!e)return!1;const r=Ya(e,t),a=fJ(Cm(e),r),i=n===-1?[...a].reverse().find(l=>l<r):a.find(l=>l>r+1);return i===void 0?!1:CM(e,t,i)}function mJ(e,t){if(!e)return t;const n=Ff(Cm(e));let r=t;for(;r>0&&(n[r-1]===" "||n[r-1]===`
102
+ `);)r-=1;return r}function $k(e,t,n,r){if(!e)return null;const a=tJ(e,n,r);if(!a)return null;const i=Cm(e),l=Ya(e,t),u=EM(i),f="beside"in a?Ya(e,a.beside)+(a.side==="before"?0:1):a.node.nodeType===Node.TEXT_NODE||a.node===e?sp(e,a.node,a.offset):null;if(f===null)return null;const h="beside"in a&&a.side==="after"?hJ(u,f):pJ(u,f);return h===null?null:{units:h,noop:dw(Ff(i),l,h)}}function X6(e,t){const n=zo(t)||"the chip",r=gJ(t);if(r)return`Moved ${n} before ${r}.`;const a=vJ(t);return a?`Moved ${n} after ${a}.`:Ya(e,t)===0?`Moved ${n} to the start of the brief.`:`Moved ${n} to the end of the brief.`}const jM=3;function gJ(e){for(let t=e.nextSibling;t;t=t.nextSibling){if(Ts(t))return zo(t)||null;const n=(t.textContent??"").replace(yl,"").trim();if(n)return`"${n.split(/\s+/).slice(0,jM).join(" ")}"`}return null}function vJ(e){for(let t=e.previousSibling;t;t=t.previousSibling){if(Ts(t))return zo(t)||null;const n=(t.textContent??"").replace(yl,"").trim();if(n)return`"${n.split(/\s+/).slice(-jM).join(" ")}"`}return null}function Cm(e){const t=[];let n="";for(const r of Array.from(e.childNodes)){if(r.nodeType===Node.TEXT_NODE){n+=(r.textContent??"").replace(yl,"");continue}n&&(t.push({t:"text",v:n}),n=""),t.push({t:"ref",imageHash:""})}return n&&t.push({t:"text",v:n}),t}function Q6(e){var n;const t=e.target;(n=t==null?void 0:t.closest)!=null&&n.call(t,'input, textarea, select, [contenteditable=""], [contenteditable="true"]')||e.preventDefault()}const r0=e=>(e==null?void 0:e.querySelector('[data-kind="template"]'))??null,Ii=e=>{var t;return((t=e==null?void 0:e.closest)==null?void 0:t.call(e,If))??null};function o8(e,t,n={}){var a;if(!e)return!1;let r=!1;for(let i=0;i<32;i++){const l=yJ(e,!!n.commit);if(!l)break;const u={t:"color",hex:l.hex,name:(a=n.nameFor)==null?void 0:a.call(n,l.hex)};kJ(e,l.node,l.start,l.end,t(u)),r=!0}return r&&po(e),r}function wJ(e,t){var i;e.dataset.kind="color",e.dataset.tok=Em(t);const n=t.name??t.hex,r=e.querySelector(".sc-token-swatch");r&&(r.style.background=t.hex);const a=e.querySelector(".sc-token-label");a&&(a.textContent=n),e.getAttribute("role")==="button"&&e.setAttribute("aria-label",`colour: ${n}. Change or remove.`),(i=e.querySelector('[data-role="remove"]'))==null||i.setAttribute("aria-label",`Remove ${n}`)}function yJ(e,t){for(let n=e.childNodes.length-1;n>=0;n--){const r=e.childNodes[n];if(r.nodeType!==Node.TEXT_NODE)continue;const a=r,i=xJ(a.textContent??"",t,(u,f)=>bJ(a,f,u)),l=i[i.length-1];if(l)return{node:a,...l}}return null}function bJ(e,t,n){if(n>0)return op(t[n-1]);const r=e.previousSibling;if(!r||Ts(r))return!0;if(r.nodeType===Node.TEXT_NODE){const a=r.textContent??"";return!a.length||op(a[a.length-1]??"")}return!0}function xJ(e,t,n){const r=[];for(let a=0;a<e.length;a++){if(e[a]!=="#"||!n(a,e))continue;let i=a+1;for(;i<e.length&&/[0-9A-Fa-f]/.test(e[i]??"");)i++;const l=e.slice(a,i),u=Wq(l);if(!u)continue;if(i-a-1===3){const h=e[i];if(h===void 0?!t:/[0-9A-Za-z]/.test(h))continue}r.push({start:a,end:i,hex:u})}return r}function kJ(e,t,n,r,a){const i=t.textContent??"",l=i.slice(0,n),u=i.slice(r),f=typeof window>"u"?null:window.getSelection();let h=null;f&&f.rangeCount>0&&f.getRangeAt(0).startContainer===t&&(h=f.getRangeAt(0).startOffset);const p=t.parentNode;if(p&&(t.textContent=u.length?u:" ",p.insertBefore(a,t),l&&p.insertBefore(document.createTextNode(l),a),h!=null)){if(h<=n){const g=a.previousSibling;(g==null?void 0:g.nodeType)===Node.TEXT_NODE&&bo(e,g,Math.min(h,(g.textContent??"").length));return}if(h<=r||!u.length){bo(e,t,t.length);return}bo(e,t,Math.min(h-r,t.length))}}function zu(e){if(!e||!/^#[0-9a-f]{6}$/i.test(e))return;const t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,a=Math.max(t,n,r),i=Math.min(t,n,r),l=a-i;if(l<.02)return;let u;return a===t?u=((n-r)/l+(n<r?6:0))*60%360:a===n?u=((r-t)/l+2)*60:u=((t-n)/l+4)*60,`hsl(${Math.round(u)} 55% 55%)`}function SJ(){const e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");t.setAttribute("width","9"),t.setAttribute("height","9"),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","2.4");const n=document.createElementNS(e,"path");return n.setAttribute("d","m6 6 12 12M18 6 6 18"),t.appendChild(n),t}const s0="data-sc-coach-inert",EJ=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function CJ(e=document.body){let t=new Set;const n=a=>{a.hasAttribute("inert")&&!a.hasAttribute(s0)||(a.setAttribute(s0,""),a.setAttribute("inert",""))},r=a=>{a.hasAttribute(s0)&&(a.removeAttribute(s0),a.removeAttribute("inert"))};return{set(a){const i=new Set(a.filter(h=>h.isConnected&&e.contains(h)&&h!==e)),l=new Set;for(const h of i)for(let p=h.parentElement;p&&p!==e;p=p.parentElement)l.add(p);const u=new Set,f=h=>{for(const p of Array.from(h.children))i.has(p)||EJ.has(p.tagName)||(l.has(p)?f(p):u.add(p))};f(e);for(const h of t)u.has(h)||r(h);for(const h of u)t.has(h)||n(h);t=new Set([...u].filter(h=>h.hasAttribute(s0)))},release(){for(const a of t)r(a);t=new Set}}}const Mh=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom}),ti=e=>e.right-e.left,vo=e=>e.bottom-e.top;function AM(e,t){return{left:Math.min(e.left,t.left),top:Math.min(e.top,t.top),right:Math.max(e.right,t.right),bottom:Math.max(e.bottom,t.bottom)}}function a0(e,t){return{left:e.left-t,top:e.top-t,right:e.right+t,bottom:e.bottom+t}}function Tk(e,t=0,n=4,r=14,a=0,i=0,l=0){if(e>=4)return e+n;const u=i===0||a===0||a<=i+16;return t>=4&&u&&l<=1?t+n:r}function NM(e,t){return e.left<t.right&&t.left<e.right&&e.top<t.bottom&&t.top<e.bottom}function Dk(e,t){let n=e;for(const r of t)n={left:Math.max(n.left,r.left),top:Math.max(n.top,r.top),right:Math.min(n.right,r.right),bottom:Math.min(n.bottom,r.bottom)};return ti(n)>0&&vo(n)>0?n:null}function Hk(e,t){let{top:n,bottom:r}=e;const a=(e.top+e.bottom)/2;for(const i of t)NM(i,e)&&(i.bottom<=a?n=Math.max(n,i.bottom):r=Math.min(r,i.top));return r>n?{...e,top:n,bottom:r}:null}const jJ=e=>e==="top"||e==="bottom";function AJ(e,t,n){return t?jJ(n)?{left:e.left,right:e.right,top:t.top,bottom:t.bottom}:{left:t.left,right:t.right,top:e.top,bottom:e.bottom}:e}const Ok=e=>e==="top"?"bottom":e==="bottom"?"top":e==="left"?"right":"left",Ls=e=>Math.round(e*2)/2;function NJ(e,t,n){const r=Ls(t),a=Ls(n),i=e.map(u=>{const f=Math.max(0,Ls(ti(u))),h=Math.max(0,Ls(vo(u))),p=Ls(Math.max(0,Math.min(u.radius,f/2,h/2)));return`<rect x='${Ls(u.left)}' y='${Ls(u.top)}' width='${f}' height='${h}' rx='${p}' fill='black'/>`}).join(""),l=`<svg xmlns='http://www.w3.org/2000/svg' width='${r}' height='${a}'><defs><mask id='m' maskUnits='userSpaceOnUse' x='0' y='0' width='${r}' height='${a}'><rect width='${r}' height='${a}' fill='white'/>${i}</mask></defs><rect width='${r}' height='${a}' fill='black' mask='url(#m)'/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(l)}")`}function MJ(e,t,n,r){const a=Ls(t),i=Ls(n),l=e.map(p=>{const g=Math.max(0,Ls(ti(p))),v=Math.max(0,Ls(vo(p))),w=Ls(Math.max(0,Math.min(p.radius,g/2,v/2)));return{x:Ls(p.left),y:Ls(p.top),ww:g,hh:v,k:w}}),u=l.map(p=>`<rect x='${p.x}' y='${p.y}' width='${p.ww}' height='${p.hh}' rx='${p.k}' fill='black'/>`),f=l.map(p=>`<rect x='${p.x}' y='${p.y}' width='${p.ww}' height='${p.hh}' rx='${p.k}' fill='none' stroke='${r}' stroke-width='2'/>`),h=`<svg xmlns='http://www.w3.org/2000/svg' width='${a}' height='${i}'><defs><mask id='o' maskUnits='userSpaceOnUse' x='0' y='0' width='${a}' height='${i}'><rect width='${a}' height='${i}' fill='white'/>${u.join("")}</mask></defs><g mask='url(#o)'>${f.join("")}</g></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(h)}")`}function RJ(e,t,n){const r={left:Math.max(0,e.left),top:Math.max(0,e.top),right:Math.min(t,e.right),bottom:Math.min(n,e.bottom)};return[{left:0,top:0,right:t,bottom:r.top},{left:0,top:r.bottom,right:t,bottom:n},{left:0,top:r.top,right:r.left,bottom:r.bottom},{left:r.right,top:r.top,right:t,bottom:r.bottom}].filter(a=>ti(a)>0&&vo(a)>0)}const Ik=0,PJ=10,i8=14,o0=4,l8="data-guide-stage",LJ="rgba(255,255,255,0.05)",J6="[data-guide-shape]",Fk=[],$J="[data-radix-popper-content-wrapper], .sc-setpop, .sc-morepop, .sc-shotsheet, .sc-note-pop",_k='input, textarea, [contenteditable]:not([contenteditable="false"])',TJ=17,oh=12,DJ=20,HJ=450,OJ=768,Vk=90,IJ=8,Zk=12,FJ=2e3,_J=".sc-topbar, .sc-tabbar, .sc-filterbar, .sc-canvas-dock, .sc-help-float, .sc-pstudio-head, .sc-newdlg-head",VJ=120,ZJ="[aria-live], .sc-toasts, .sc-upd-float, .sc-upd-overlay, [data-radix-popper-content-wrapper], .sc-chip-preview, .sc-swap, .sc-shotsheet, .sc-shotsheet-scrim, .sc-cmd",c8=e=>({id:e.id,title:e.title,body:e.body,canBack:e.canBack,action:e.action,count:e.at&&e.of?`${e.at} of ${e.of}`:void 0});function zJ(e){const{id:t,voice:n,target:r,live:a,side:i,container:l,onShown:u}=e,f=e.lit??Fk,h=e.also??Fk,p=n==="ask",g=!r,v=!!(e.title||e.body),w=s.useId(),b=s.useId(),y=s.useRef(null),k=s.useRef(null),S=s.useRef(null),E=s.useRef(null),j=s.useRef(null),N=s.useRef(null),A=s.useRef(null),T=s.useRef(null),P=s.useRef(null),C=s.useRef(null),[R,$]=s.useState("moving"),[H]=s.useState(YJ),[D,q]=s.useState(()=>c8(e)),_=s.useRef(e);_.current=e;const U=s.useRef(!1),Y=s.useRef(null),I=s.useRef([]),F=R==="shown"&&D.id===t?c8(e):D,O=u8(a),Z=u8(h),V=u8(f);s.useEffect(()=>{if(p)return C.current=CJ(l),()=>{var K;(K=C.current)==null||K.release(),C.current=null;for(const ee of I.current)ee.removeAttribute(l8);I.current=[]}},[p,l]),s.useLayoutEffect(()=>{var Zt,He,mt;const K=y.current,ee=k.current,se=S.current,oe=E.current,me=j.current,ce=N.current;if(p&&(!se||!oe||!me||!ce)||v&&(!K||!ee))return;let we=!0,G=0,ue=0,Ne=!1,ne=!1,Fe="",Oe=0,ot=0,Xe=0,X=null,J=null,ge=null;const ve=window.matchMedia("(prefers-reduced-motion: reduce)").matches,Ze=a[0]??r??l;let Ye="",ke=r?ih(r):null;$("moving");const te=()=>{var vt;return(vt=C.current)==null?void 0:vt.set([...K?[K]:[],...se?[se]:[],...oe?[oe]:[],...me?[me]:[],...ce?[ce]:[],...a,...h,...[...document.querySelectorAll(ZJ)].filter(St=>![...a,...h].some(kt=>St.contains(kt)))])},le=()=>{var vt,St;(vt=C.current)==null||vt.release(),ne=!1,$("away"),(St=r??a[0])!=null&&St.isConnected&&Re()};if(p&&C.current&&U.current){te(),ne=!0;const vt=a.find(kt=>kt.matches(_k)),St=document.activeElement;vt&&!a.some(kt=>kt.contains(St))&&zk(vt)}const Me=async()=>{const vt=++G;if(r&&!r.isConnected||a.some(re=>!re.isConnected))return le(),_.current.onLost();const St=window.innerWidth,kt=window.innerHeight,Nt=window.visualViewport,Bt=[{left:0,top:0,right:St,bottom:kt},...Nt?[{left:Nt.offsetLeft,top:Nt.offsetTop,right:Nt.offsetLeft+Nt.width,bottom:Nt.offsetTop+Nt.height}]:[]],at=re=>{const ae=re===r?ke:ih(re);return ae?[...Bt,Mh(ae.getBoundingClientRect())]:Bt},Mt=BJ(Ze,l),ft=Mt.filter(re=>ti(re)>St/3),vn=r?Dk(Mh(r.getBoundingClientRect()),at(r)):null,Qt=vn&&Hk(vn,ft);if(r&&!Qt)return!Ne&&Xe<Zk&&(Xe++,ke=ih(r),d8(r,ke,ve).then(()=>we&&Be())),le();const on=[],Rt=[];for(const re of[...r?[r]:[],...a,...h,...f,...Bk()]){const ae=Uk(re);Rt.includes(ae)||Rt.push(ae)}const An=new Set([...r?[r]:[],...a,...f,...Bk()].map(Uk));let Vt=null;for(const re of Rt){const ae=Dk(Mh(re.getBoundingClientRect()),at(re)),fe=ae&&Hk(ae,ft);if(!fe)continue;const Te=Rh(re);on.push(Te>=4||re.matches("img, video, canvas")?{...a0(fe,Ik),radius:Te+Ik}:{...a0(fe,PJ),radius:i8}),An.has(re)&&(Vt=Vt?AM(Vt,fe):fe)}if(!g&&!Qt&&!Vt)return le();if(ne&&(a.some(re=>re.closest("[inert]"))||K!=null&&K.closest("[inert]"))&&(ne=!1),p&&se&&oe&&me&&ce){if(!on.length&&Qt){const fe=r,Te=Wk(fe);on.push({...a0(Qt,o0),radius:Tk(Rh(fe),Te.radius,o0,i8,vo(Qt),Te.height,Te.count)})}for(const fe of I.current)Rt.includes(fe)||fe.removeAttribute(l8);for(const fe of Rt)fe.setAttribute(l8,"");I.current=Rt;const ae=`${on.map(fe=>[fe.left,fe.top,fe.right,fe.bottom,fe.radius].map(Math.round).join(",")).join("|")}@${St}x${kt}`;if(ae!==Ye&&(Ye=ae,GJ(se,oe,ce,on,H)),r&&Qt){const fe=JJ(r),Te=Wk(r),Ue=fe??a0(Qt,o0);Object.assign(me.style,{left:`${Ue.left}px`,top:`${Ue.top}px`,width:`${ti(Ue)}px`,height:`${vo(Ue)}px`,borderRadius:`${fe?QJ:Tk(Rh(r),Te.radius,o0,i8,vo(Qt),Te.height,Te.count)}px`}),me.hidden=!1}else me.hidden=!0}if(K&&document.documentElement.style.setProperty("--sc-coach-h",`${Math.round(K.offsetHeight)}px`),K&&g&&(K.style.right="",K.style.left=`${Math.round((St-K.offsetWidth)/2)}px`,K.style.top=`${Math.round((kt-K.offsetHeight)/2)}px`,K.dataset.side="centre",ee&&(ee.hidden=!0)),K&&ee&&r&&Qt){K.style.right="";const re={top:oh+UJ(Mt,kt),bottom:oh+WJ(Mt,kt),left:oh,right:oh},ae=St>=OJ;J!==ae&&(J!==null&&r&&(ke=ih(r),d8(r,ke,ve)),X=null,J=ae);const fe=i==="left"||i==="right"?"top":i,Te=!ae&&ti(Qt)>St*.6,Ue=ae?i:Te?`${fe}-start`:fe,ut=(xt,st)=>xC(KJ(xt,r),K,{strategy:"fixed",placement:X??Ue,middleware:[wC(TJ),bC({padding:re,fallbackPlacements:st}),yC({padding:re}),u6({element:ee,padding:DJ})]}),gt=!ae&&Vt?{...Qt,top:Vt.top,bottom:Vt.bottom}:Qt,Pt=(xt,st)=>NM({left:xt,top:st,right:xt+K.offsetWidth,bottom:st+K.offsetHeight},a0(gt,o0)),Ce=ae&&(i==="left"||i==="right")?[Ok(i),"top","bottom"]:ae?void 0:Te?["bottom-start","top-start"]:["bottom","top"],xe=!p&&vo(Qt)>kt*.6,et=ae&&(e.beside||a.length>1),yt=xe?{...Qt,top:Qt.bottom-1}:et?AJ(Qt,Vt,i):gt;let Q=await ut(yt,xe?["top"]:Ce);if(!we||vt!==G||!xe&&Pt(Q.x,Q.y)&&(Q=await ut(gt,void 0),!we||vt!==G))return;if(!xe&&Pt(Q.x,Q.y))return $("stowed");X=Q.placement;const Pe=Q.placement.split("-")[0];K.style.left=`${Math.round(Q.x)}px`,K.style.top=`${Math.round(Q.y)}px`,K.dataset.side=Pe;const Ke=Q.middlewareData.arrow;ee.dataset.edge=Ok(Pe),ee.style.left=(Ke==null?void 0:Ke.x)!=null?`${Ke.x}px`:"",ee.style.top=(Ke==null?void 0:Ke.y)!=null?`${Ke.y}px`:"",ee.hidden=!Ke||Math.abs(Ke.centerOffset)>1}if(p&&!ne&&(te(),ne=!0),!Ne){if(eee([...r?[r]:[],...a])&&++ot<Zk){window.setTimeout(Be,Vk);return}const re=[...r?[r]:[],...a,...h,...f].map(ae=>{const fe=ae.getBoundingClientRect();return[fe.left,fe.top,fe.right,fe.bottom].map(Math.round).join(",")}).join("|");if(re!==Fe&&(Fe=re,Oe=0),++Oe<2&&Oe<IJ){window.setTimeout(Be,Vk);return}}$("shown"),Ne||(Ne=!0,Qe(),Re())};let ze=0;const Re=()=>{const vt=r??a[0];if(!vt)return;cancelAnimationFrame(ze);let St=vt.getBoundingClientRect();const kt=performance.now()+FJ,Nt=()=>{if(!we)return;const Bt=vt.getBoundingClientRect();(Bt.top!==St.top||Bt.left!==St.left||Bt.height!==St.height)&&(St=Bt,Be()),performance.now()<kt&&(ze=requestAnimationFrame(Nt))};ze=requestAnimationFrame(Nt)},Be=()=>{cancelAnimationFrame(ue),ue=requestAnimationFrame(()=>void Me())},Qe=()=>{U.current=!0;let vt=!1;if(p&&K){const St=Bt=>!!Bt&&a.some(at=>at.contains(Bt)),kt=document.activeElement,Nt=a.find(Bt=>Bt.matches(_k))??null;P.current&&St(kt)?P.current=null:P.current?(((P.current==="back"?A.current:null)??T.current??K).focus({preventScroll:!0}),P.current=null):Nt&&!St(kt)?zk(Nt):(!kt||kt===document.body||kt.closest("[inert]"))&&(K.focus({preventScroll:!0}),vt=!0)}u(t,vt)},rt=U.current&&!ve&&v&&Y.current!==t?VJ:0;Y.current=t,qJ(rt).then(()=>{if(we)return _r.flushSync(()=>q(c8(_.current))),r?d8(r,ke,ve):void 0}).then(()=>{we&&(ge=vC(Ze,K??se??Ze,Be))});const _e=new ResizeObserver(Be);for(const vt of a)_e.observe(vt);r&&_e.observe(r),K&&_e.observe(K);for(const vt of[...r?[r]:[],...a]){const St=(Zt=vt==null?void 0:vt.closest)==null?void 0:Zt.call(vt,J6);St&&_e.observe(St)}(He=window.visualViewport)==null||He.addEventListener("resize",Be),(mt=window.visualViewport)==null||mt.addEventListener("scroll",Be);let zt=0;const Et=p?new MutationObserver(()=>{ne&&(cancelAnimationFrame(zt),zt=requestAnimationFrame(te))}):null;return Et==null||Et.observe(l,{childList:!0,subtree:!0}),()=>{var vt,St;we=!1,document.documentElement.style.removeProperty("--sc-coach-h"),cancelAnimationFrame(ue),cancelAnimationFrame(ze),cancelAnimationFrame(zt),Et==null||Et.disconnect(),ge==null||ge(),_e.disconnect(),(vt=window.visualViewport)==null||vt.removeEventListener("resize",Be),(St=window.visualViewport)==null||St.removeEventListener("scroll",Be)}},[t,p,v,r,O,Z,V,i,l,u,H]),s.useEffect(()=>{if(!v||!r||!XJ(r))return;const K=(r.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean);if(!K.includes(b))return r.setAttribute("aria-describedby",[...K,b].join(" ")),()=>{const ee=(r.getAttribute("aria-describedby")??"").split(/\s+/).filter(se=>se&&se!==b);ee.length?r.setAttribute("aria-describedby",ee.join(" ")):r.removeAttribute("aria-describedby")}},[v,r,b]);const{onEscape:B}=e;return s.useEffect(()=>{if(!p)return;const K=we=>!!we&&a.some(G=>G.contains(we)),ee=we=>{var Fe;const G=y.current,ue=we.target instanceof Node?we.target:null,Ne=K(ue),ne=document.activeElement;if(we.key==="Escape"){if(we.defaultPrevented||ne!=null&&ne.closest('[role="dialog"]:not(.sc-coach):not(.sc-attachpanel)')||Ne&&(ne!=null&&ne.closest('input, textarea, select, [contenteditable="true"], [role="menu"], [role="listbox"]')))return;we.preventDefault(),we.stopPropagation(),B(t);return}Ne||(!ue||ue===document.body||ue===document.documentElement||G!=null&&G.contains(ue)||(Fe=E.current)!=null&&Fe.contains(ue))&&we.stopPropagation()};let se=0,oe=!1;const me=we=>{oe=we.target instanceof Node&&K(we.target)},ce=we=>{we.relatedTarget||oe||!y.current||(cancelAnimationFrame(se),se=requestAnimationFrame(()=>{var ue;if(!document.hasFocus())return;const G=document.activeElement;(!G||G===document.body||G.closest("[inert]"))&&((ue=y.current)==null||ue.focus({preventScroll:!0}))}))};return window.addEventListener("keydown",ee,!0),window.addEventListener("pointerdown",me,!0),document.addEventListener("focusout",ce,!0),()=>{cancelAnimationFrame(se),window.removeEventListener("keydown",ee,!0),window.removeEventListener("pointerdown",me,!0),document.removeEventListener("focusout",ce,!0)}},[t,p,O,B]),_r.createPortal(o.jsxs(o.Fragment,{children:[p&&o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:S,className:"sc-coach-veil","data-veil":H?"mask":"panels","data-soft":e.soft||void 0,"data-state":R,"aria-hidden":"true",children:Gk.map(K=>o.jsx("div",{className:"sc-coach-panel"},K))}),o.jsx("div",{ref:E,className:"sc-coach-catch","data-guide":"catch","data-state":R,"aria-hidden":"true",onMouseDown:K=>K.preventDefault(),children:Gk.map(K=>o.jsx("div",{className:"sc-coach-catch-part"},K))}),o.jsx("div",{ref:N,className:"sc-coach-rim","data-state":R,"aria-hidden":"true"}),o.jsx("div",{ref:j,className:"sc-coach-ring","data-state":R,"aria-hidden":"true",hidden:!0})]}),v&&o.jsxs("div",{ref:y,className:"sc-coach","data-guide":"card","data-voice":p?"coach":"card","data-beside":e.beside||void 0,...p?{role:"dialog","aria-labelledby":F.title?w:void 0}:{role:"note"},"aria-describedby":b,tabIndex:-1,"data-state":R,children:[o.jsx("div",{ref:k,className:"sc-coach-arrow","aria-hidden":"true",hidden:!0}),o.jsxs("div",{className:"sc-coach-head",children:[F.title?o.jsx("h2",{id:w,className:"sc-coach-title",children:F.title}):o.jsx("p",{id:b,className:"sc-coach-body","data-lead":"",children:F.body}),F.count&&o.jsxs("p",{className:"sc-coach-count",children:[o.jsx("span",{className:"sc-vh",children:"Step "}),F.count]}),o.jsx(lr,{label:e.closeLabel,children:o.jsx("button",{type:"button",className:"sc-coach-x","aria-label":e.closeLabel,onClick:()=>e.onClose(t),children:o.jsx(Mn,{size:16})})})]}),F.title&&F.body&&o.jsx("p",{id:b,className:"sc-coach-body",children:F.body}),(F.canBack||F.action)&&o.jsxs("div",{className:"sc-coach-foot",children:[F.canBack&&o.jsx("button",{ref:A,type:"button",className:"sc-coach-back",onClick:()=>{P.current="back",e.onBack(t)},children:"Back"}),F.action&&o.jsx("button",{ref:T,type:"button",className:"sc-btn sc-btn-primary sc-coach-next",onClick:()=>{P.current="action",e.onAction(t)},children:F.action.label})]})]})]}),l)}function zk(e){var t,n;if(e.focus({preventScroll:!0}),!e.isContentEditable){const r=e,a=((t=r.value)==null?void 0:t.length)??0;(n=r.setSelectionRange)==null||n.call(r,a,a);return}Gl(e)}function Bk(){return[...document.querySelectorAll($J)].filter(e=>e.getClientRects().length>0)}function u8(e){const t=s.useRef(e);return(t.current.length!==e.length||t.current.some((n,r)=>n!==e[r]))&&(t.current=e),t.current}function BJ(e,t){const n=[];for(const r of document.querySelectorAll(_J))t.contains(r)&&(r.contains(e)||e.contains(r)||r.getClientRects().length===0||n.push(Mh(r.getBoundingClientRect())));return n}function UJ(e,t){return Math.max(0,...e.filter(n=>n.top<=0&&n.bottom<t/3).map(n=>n.bottom))}function WJ(e,t){return Math.max(0,...e.filter(n=>n.bottom>=t&&n.top>t*2/3).map(n=>t-n.top))}function KJ(e,t){const n={x:e.left,y:e.top,left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:ti(e),height:vo(e)};return{getBoundingClientRect:()=>n,contextElement:t}}function GJ(e,t,n,r,a){const i=window.innerWidth,l=window.innerHeight,u=r.reduce((h,p)=>h?AM(h,p):p,null),f=u?RJ(u,i,l):[];if(a){const h=NJ(r,i,l),p=e.style;p.maskImage=h,p.webkitMaskImage=h,n.style.backgroundImage=MJ(r,i,l,LJ)}else Kk(e,f);Kk(t,f)}function Rh(e){return Number.parseFloat(getComputedStyle(e).borderTopLeftRadius)||0}function Uk(e){return e.closest(J6)??e.querySelector(J6)??e}function Wk(e){let t=0,n=0,r=0;for(const a of e.querySelectorAll("button, a[href], .sc-chip, .sc-btn"))a.getClientRects().length&&(r+=1,t=Math.max(t,Rh(a)),n=Math.max(n,a.getBoundingClientRect().height));return{radius:t,height:n,count:r}}function Kk(e,t){Array.from(e.children).forEach((n,r)=>{const a=t[r],i=n.style;if(!a){i.display="none";return}Object.assign(i,{display:"block",left:`${a.left}px`,top:`${a.top}px`,width:`${ti(a)}px`,height:`${vo(a)}px`})})}const Gk=[0,1,2,3];function YJ(){return typeof CSS>"u"?!1:CSS.supports("mask-image",'url("x.svg")')||CSS.supports("-webkit-mask-image",'url("x.svg")')}function ih(e){for(let t=e.parentElement;t&&t!==document.body;t=t.parentElement){const n=getComputedStyle(t).overflowY;if((n==="auto"||n==="scroll")&&t.scrollHeight>t.clientHeight)return t}return null}function d8(e,t,n){if(!t)return Promise.resolve();const r=e.getBoundingClientRect(),a=t.getBoundingClientRect();if(Math.max(0,Math.min(r.bottom,a.bottom,window.innerHeight)-Math.max(r.top,a.top,0))>=Math.min(120,r.height*.4))return Promise.resolve();const u=r.height>a.height*.8?r.top-a.top-16:(r.top+r.bottom)/2-(a.top+a.bottom)/2;return t.scrollBy({top:u,behavior:n?"auto":"smooth"}),n?Promise.resolve():new Promise(f=>{let h=!1;const p=()=>{h||(h=!0,t.removeEventListener("scrollend",p),f())};t.addEventListener("scrollend",p),window.setTimeout(p,HJ)})}function qJ(e){return e>0?new Promise(t=>window.setTimeout(t,e)):Promise.resolve()}function XJ(e){return e.matches('button, a[href], input, select, textarea, [tabindex], [contenteditable="true"]')}const QJ=10;function JJ(e){if(!e.matches("a[href], button")||e.getBoundingClientRect().height<=48)return null;const t=document.createRange();t.selectNodeContents(e);const n=t.getBoundingClientRect();return n.width?{left:n.left-12,top:n.top-7,right:n.right+12,bottom:n.bottom+7}:null}function eee(e){return document.getAnimations().some(t=>{var r,a;const n=(r=t.effect)==null?void 0:r.target;return!(n instanceof Element)||t.playState!=="running"||((a=t.effect)==null?void 0:a.getTiming().iterations)===Number.POSITIVE_INFINITY?!1:e.some(i=>n.contains(i))})}const ar=e=>e.kind==="question"?`q:${e.question.id}`:`${e.kind}:${e.id}`;function tee(e){const t=e[e.length-1];return(t==null?void 0:t.kind)!=="question"||t.question.kind!=="confirm"||t.question.quiet||t.question.noEnter||e.some(r=>r.kind==="question"&&r.question.reopened||r.kind==="you"&&r.editing)?null:t.question}const _f=320,fw=180,nee=28,ree=700;function jm(e){const t=e.split(/(\s+)/).filter(a=>a.length>0),n=t.filter(a=>!/^\s+$/.test(a)).length,r=Math.min(nee,Math.floor(ree/Math.max(1,n)));return{words:t,step:r,total:_f+fw+r*n+160}}function f8(e,t){return e.every(n=>!!t[n.id])}function see(e,t,n={}){const r=e.trim().toLowerCase();if(!r||r.split(/\s+/).length>6)return null;for(const i of t){const l=i.label.toLowerCase();if(r===l||r===i.id.toLowerCase())return i.id}for(const i of t){const l=n[i.id];if(l!=null&&l.test(r))return i.id}return null}function aee(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}const oee=/^(hi|hello|hey|heya|hiya|yo|hola|shalom|sup|good (morning|afternoon|evening)|thanks|thank you|thx|cheers)\b/i,iee=/^(ok|okay|k|kk|sure|fine|yes|yeah|yep|yup|no|nope|nah|cool|nice|great|alright|right|hmm+|hm+|uh+|um+|oh|ah|wow|haha+|hehe+|lol|lmao|omg|meh|really|seriously|interesting|whatever)[\s!.,?]*$/i,lee=/^(how|what|what's|whats|who|who's|whos|why|where|when|which|can|could|do|does|did|are|is|will|would|should|may|have|has|am|isn't|aren't|don't|doesn't)\b/i,cee=/^(start over|start again|restart|reset|cancel|stop|quit|exit|go back|back|undo|never ?mind|forget it|close)\b/i,uee=/^(skip|next|continue|go|go on|proceed|generate|draw|render|build|show me|show|try|do it|let'?s go|begin|start)\b/i,Yk=/^(help|help me|how does this work|what do i do|what should i (write|say|type)|instructions|\?+)[\s!.,?]*$/i,dee=/\b(presenters?|avatars?|characters?|Scenri|create|creating|generate|generating|images?|pictures?|shoot|campaign|brand|product)\b/i,fee=/^(test|testing|blah|lorem|ipsum|foo|bar|baz|dummy|sample|placeholder|xxx+|abc|asdf\w*|qwer\w*|zxcv\w*|hjkl|jkl|sdfg?|dfgh?|fghj?|bull\w*|shit\w*|crap|fuck\w*|damn|wtf|stfu|bs|rofl|lol+|lmao+|haha\w*|hehe\w*|meh|idk|nvm)$/i,hee=/^[b-df-hj-np-tv-xz]{3,}$/i,pee=/(.)\1{3,}/,mee=/\b(like|as|resembling|resembles|similar to|looks? like|looking like)\s+([A-Z][a-z]+)(?:\s+[A-Z][a-z]+)*\b/,gee=/^(mediterranean|asian|east|south|southeast|indian|chinese|japanese|korean|african|black|white|nordic|scandinavian|latin|latina|latino|hispanic|arab|arabic|middle|eastern|european|caucasian|israeli|jewish|irish|italian|french|spanish|greek|turkish|persian|brazilian|mexican|american|british|german|dutch|russian|polish|thai|vietnamese|filipino|filipina|nigerian|ethiopian|moroccan|egyptian|australian|canadian|swedish|norwegian|danish|finnish|portuguese|indonesian|pakistani|iranian|lebanese|slavic|celtic|west|north|central)$/i;function Ko(e,t){const n=e.trim();if(!n)return null;const r=mee.exec(n);if(r&&!gee.test(r[2]))return"likeness";if(t(n))return null;if(!new RegExp("\\p{L}","u").test(n))return Yk.test(n)?"help":"nonsense";const a=n.split(/\s+/).filter(Boolean),i=a.length;if(Yk.test(n))return"help";if(oee.test(n)&&i<=4)return"greeting";if(iee.test(n))return"ack";const l=u=>u.replace(/[^a-z]/gi,"");return i<=8&&a.some(u=>fee.test(l(u))||hee.test(l(u))||pee.test(l(u)||u))?"nonsense":lee.test(n)||/\?\s*$/.test(n)?"question":cee.test(n)&&i<=4?"nav":dee.test(n)&&i<=10?"intent":uee.test(n)&&i<=4?"go":i===1&&/^[A-Z][a-z]+$/.test(n)?null:i<=2?"vague":null}const vee=e=>`aside-said-${e}`,qk=e=>e.startsWith("aside-said-")?e.slice(11):null,ci=(e,t=!1,n=!1)=>[...n?[]:[{kind:"you",id:vee(e.at),text:e.said,editable:!0,editing:t||void 0}],{kind:"scenri",id:`aside-reply-${e.at}${e.rev?`-${e.rev}`:""}`,text:e.reply}],ip=e=>(e.kind==="you"||e.kind==="scenri")&&e.id.startsWith("aside-");function MM(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind==="question")return n.question.id;if(!ip(n))return null}return null}const lp=()=>new Date().toISOString();function wee({options:e,picked:t,onPick:n}){return o.jsx("div",{className:"sc-convo-grid",children:e.map(r=>o.jsxs("button",{type:"button",className:"sc-convo-plate","aria-label":r.label,"aria-pressed":t===r.id,"data-on":t===r.id||void 0,onClick:()=>n(r.id),children:[o.jsx("span",{className:"sc-convo-plate-in","data-card":r.card}),o.jsx("span",{className:"sc-convo-plate-lb",children:r.label})]},r.id))})}function yee({step:e,children:t}){const n=s.useRef(null),[r,a]=s.useState({back:!1,on:!0}),i=s.useCallback(()=>{const h=n.current;if(!h)return;const p=h.scrollWidth-h.clientWidth;a({back:h.scrollLeft>2,on:h.scrollLeft<p-2})},[]);s.useEffect(()=>{const h=n.current;if(!h)return;i(),h.addEventListener("scroll",i,{passive:!0});const p=new ResizeObserver(i);return p.observe(h),()=>{h.removeEventListener("scroll",i),p.disconnect()}},[i]);const l=h=>{const p=n.current;if(!p)return;const g=p.firstElementChild,v=Number.parseFloat(getComputedStyle(p).columnGap)||0,w=g?g.offsetWidth+v:e,b=!window.matchMedia("(prefers-reduced-motion: reduce)").matches;p.scrollBy({left:h*w,behavior:b?"smooth":"auto"})},u=r.back&&r.on?"both":r.back?"back":r.on?"on":void 0,f=r.back||r.on;return o.jsxs("div",{className:"sc-convo-strip","data-fade":u,children:[f&&o.jsx(Xk,{dir:-1,live:r.back,onGo:l}),o.jsx("div",{className:"sc-convo-plates",ref:n,children:t}),f&&o.jsx(Xk,{dir:1,live:r.on,onGo:l})]})}function Xk({dir:e,live:t,onGo:n}){const r=e<0;return o.jsx("button",{type:"button",className:"sc-convo-strip-go","data-dir":r?"back":"on","data-spent":!t||void 0,"aria-label":r?"Show earlier":"Show more","aria-disabled":!t||void 0,tabIndex:-1,onClick:a=>{a.currentTarget.blur(),t&&n(e)},children:r?o.jsx(Sa,{size:14,weight:"bold"}):o.jsx(cl,{size:14,weight:"bold"})})}const bee=106;function Qk({options:e,picked:t,onPick:n}){return o.jsx(yee,{step:bee,children:e.map(r=>o.jsxs("button",{type:"button",className:"sc-convo-plate","aria-label":r.label,"aria-pressed":t===r.id,"data-on":t===r.id||void 0,onClick:()=>n(r.id),children:[o.jsx("span",{className:"sc-convo-plate-in","data-card":r.card}),o.jsx("span",{className:"sc-convo-plate-lb",children:r.label})]},r.id))})}const RM=6e4,xee=60*RM,h8=e=>e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),kee=e=>e.toLocaleDateString([],{day:"numeric",month:"short"});function See(e,t){const n=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),r=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return Math.round((r-n)/864e5)}function Eee(e,t=Date.now()){const n=Math.max(0,t-e);if(n<45e3)return"just now";if(n<xee)return`${Math.max(1,Math.round(n/RM))} min ago`;const r=new Date(e),a=See(r,new Date(t));return a===0?h8(r):a===1?`Yesterday ${h8(r)}`:`${kee(r)} ${h8(r)}`}const Cee=e=>new Date(e).toLocaleString([],{dateStyle:"medium",timeStyle:"short"});function jee({text:e,tone:t,at:n,now:r,reveal:a,eyebrow:i=!0,delay:l=0,leave:u,turnId:f,dim:h,thumb:p,label:g,view:v,current:w,restore:b,onRestore:y,retry:k,onRetry:S,onShow:E}){const[j]=s.useState(l),N=pw(u,j),{playing:A,thinking:T}=DM(a,e,j,N==="true");return o.jsxs("div",{className:"sc-convo-turn","data-guide-shape":"","data-who":"scenri","data-arrive":A||void 0,"data-leave":N,"data-turn":f,"data-dim":h||void 0,style:A?{...PM(j),"--sc-convo-after":`${jm(e).total}ms`}:void 0,children:[i&&o.jsx(hw,{thinking:T,at:n,now:r}),o.jsxs("p",{className:"sc-convo-say","data-tone":t,"data-reveal":A||void 0,children:[T&&o.jsx($M,{}),o.jsx(TM,{text:e,playing:A})]}),p&&o.jsxs("span",{className:"sc-convo-shot","data-reveal":A||void 0,"data-current":w||void 0,children:[v&&E?o.jsx("button",{type:"button",className:"sc-convo-shot-pick","aria-label":g?`Show ${g} on the stage`:"Show this on the stage",onClick:()=>E(v),children:o.jsx(Jk,{thumb:p,label:g,current:w})}):o.jsx(Jk,{thumb:p,label:g,current:w}),b&&y?o.jsx("button",{type:"button",className:"sc-convo-shot-do sc-convo-restore",onClick:()=>y(b.view,b.hash),children:"Put back"}):k&&S?o.jsx("button",{type:"button",className:"sc-convo-shot-do sc-convo-restore",onClick:()=>S(k),children:"Try again"}):w&&o.jsx("span",{className:"sc-convo-shot-do",children:"Active"})]})]})}const PM=e=>({"--sc-convo-start":`${e}ms`,"--sc-convo-think":`${_f}ms`});function hw({thinking:e,at:t,now:n}){return o.jsxs("span",{className:"sc-convo-who","data-thinking":e||void 0,"aria-hidden":"true",children:[o.jsx(Eq,{className:"sc-convo-mark"}),"Scenri",t?o.jsx(LM,{at:t,now:n}):null]})}function LM({at:e,now:t}){return o.jsx("time",{className:"sc-convo-time",dateTime:new Date(e).toISOString(),title:Cee(e),children:Eee(e,t)})}function Aee({what:e="Thinking"}){return o.jsxs("div",{className:"sc-convo-turn","data-who":"scenri","data-working":"true",children:[o.jsx(hw,{thinking:!0}),o.jsx("p",{className:"sc-convo-say",children:o.jsxs("span",{className:"sc-convo-work",children:[e,o.jsx(Nee,{})]})})]})}function Nee(){return o.jsxs("span",{className:"sc-convo-ell","aria-hidden":"true",children:[o.jsx("i",{children:"."}),o.jsx("i",{children:"."}),o.jsx("i",{children:"."})]})}function $M(){return o.jsxs("span",{className:"sc-convo-dots","aria-hidden":"true",children:[o.jsx("i",{}),o.jsx("i",{}),o.jsx("i",{})]})}function TM({text:e,playing:t}){const n=s.useRef(t);if(t&&(n.current=!0),!n.current)return o.jsx(o.Fragment,{children:e});const{words:r,step:a}=jm(e);let i=0,l=0;return o.jsx(o.Fragment,{children:r.map(u=>{const f=l;if(l+=u.length,/^\s+$/.test(u))return u;const h=i++;return o.jsx("span",{className:"sc-convo-w",style:{"--sc-convo-word-delay":`${h*a}ms`},children:u},`${f}:${u}`)})})}function DM(e,t,n=0,r=!1){const[a,i]=s.useState(!!e),[l,u]=s.useState(!!e),f=s.useRef(!!e);return s.useEffect(()=>{e&&!f.current&&(i(!0),u(!0)),f.current=!!e},[e]),s.useEffect(()=>{if(!a)return;const h=setTimeout(()=>{u(!1),i(!1)},n+jm(t).total),p=setTimeout(()=>u(!1),n+_f);return()=>{clearTimeout(h),clearTimeout(p)}},[a,t,n]),{playing:a&&!r,thinking:a&&l&&!r}}function pw(e,t,n=_f+fw){const r=s.useRef(performance.now());if(e)return performance.now()-r.current<t+n?"early":"true"}function Jk({thumb:e,label:t,current:n}){return o.jsx("img",{src:hn(e,"micro"),srcSet:`${hn(e,"micro")} 160w, ${hn(e,"small")} 320w, ${hn(e,"tile")} 640w`,sizes:"(max-width: 767px) 248px, 128px",alt:n&&t?`${t}, active`:t??""})}const Mee=300,Ree=e=>typeof e=="string"?e:null,Pee=e=>Array.isArray(e)?e:[],Lee=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{};function $ee({question:e,reveal:t,busy:n,eyebrow:r=!0,delay:a=0,leave:i,spent:l,turnId:u,dim:f,at:h,now:p,onAnswer:g,onPick:v,onStarter:w,onDescribe:b,onAttachFiles:y,onCancel:k}){var ce,we,G,ue,Ne;const[S]=s.useState(a),E=pw(i,S),{playing:j,thinking:N}=DM(t,e.prompt,S,E==="true"),A="given"in e?e.given:void 0,[T,P]=s.useState(()=>Lee(A)),[C,R]=s.useState(null),[$,H]=s.useState(()=>new Set(Pee(A))),D=!!l||!!n,q=s.useRef(!1);s.useEffect(()=>{q.current&&!D&&R(null),q.current=D},[D]),s.useEffect(()=>{e.attempt&&R(null)},[e.attempt]);const _=(ne,Fe)=>{C||(R(ne),v==null||v(e.id,{picked:ne,picks:T}),g(Fe))},U=C??Ree(A),Y=s.useRef(null),I=s.useRef(null),F=s.useRef(()=>{});F.current=()=>{e.kind==="pick"&&e.more&&!e.loading&&g({kind:"pick",action:{type:"more"}})};const O=e.kind==="pick"?e.items.length:0,Z=e.kind==="pick"&&!!e.more;s.useEffect(()=>{const ne=I.current,Fe=Y.current;if(!ne||!Fe||!Z||typeof IntersectionObserver>"u")return;const Oe=new IntersectionObserver(ot=>ot.some(Xe=>Xe.isIntersecting)&&F.current(),{root:Fe,rootMargin:"0px 0px 240px 0px"});return Oe.observe(ne),()=>Oe.disconnect()},[O,Z]);const V=O>0;s.useLayoutEffect(()=>{const ne=Y.current;if(!ne||!V||typeof ResizeObserver>"u")return;const Fe=()=>{const ot=ne.querySelector(".sc-convo-plate");ot&&ne.style.setProperty("--sc-pick-row",`${ot.getBoundingClientRect().height}px`)};Fe();const Oe=new ResizeObserver(Fe);return Oe.observe(ne),()=>Oe.disconnect()},[V]);const B=e.kind==="pick"?(ce=e.search)==null?void 0:ce.value:void 0;s.useEffect(()=>{Y.current&&(Y.current.scrollTop=0)},[B]);const K=jm(e.prompt),ee=`sc-convo-q-${e.id}`,se=s.useRef(null),oe=e.reopened&&k&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost sc-convo-cancel",onClick:k,children:"Cancel"}),me="attach"in e&&e.attach&&y&&o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass",onClick:()=>{var ne;return(ne=se.current)==null?void 0:ne.click()},children:[o.jsx(ZO,{size:14,weight:"bold"}),e.attach]}),o.jsx("input",{ref:se,type:"file",accept:"image/*",hidden:!0,"aria-label":e.attach,onChange:ne=>{const Fe=Array.from(ne.target.files??[]).filter(Oe=>Oe.type.startsWith("image/"));ne.target.value="",Fe.length&&y(Fe)}})]});return o.jsxs("div",{className:"sc-convo-turn","data-who":"scenri","data-arrive":j||void 0,"data-leave":E,"data-turn":u,"data-dim":f||void 0,"data-reopened":e.reopened||void 0,style:j?{...PM(S),"--sc-convo-after":`${K.total}ms`}:void 0,children:[!e.reopened&&r&&o.jsx(hw,{thinking:N,at:h,now:p}),!e.reopened&&o.jsxs("p",{className:"sc-convo-say",id:ee,"data-tone":e.tone,"data-reveal":j||void 0,children:[N&&o.jsx($M,{}),o.jsx(TM,{text:e.prompt,playing:j})]}),e.reopened&&o.jsx("span",{id:ee,hidden:!0,children:e.prompt}),!e.reopened&&e.hint&&o.jsx("p",{className:"sc-convo-hint","data-reveal":j||void 0,children:e.hint}),o.jsxs("fieldset",{className:"sc-convo-q","aria-labelledby":ee,hidden:e.kind==="text"&&!((we=e.starters)!=null&&we.length)&&!e.cost&&!e.note?!0:void 0,tabIndex:-1,"data-kind":e.kind,"data-reveal":j||void 0,"data-picked":!!C||void 0,disabled:n||void 0,children:[e.starters&&e.starters.length>0&&o.jsx("div",{className:"sc-convo-starters",children:e.starters.map(ne=>o.jsx(lr,{label:ne.text,children:o.jsx("button",{type:"button",className:"sc-convo-starter",onClick:()=>w==null?void 0:w(ne.text),children:ne.label})},ne.text))}),e.kind==="choice"&&((G=e.options)==null?void 0:G.some(ne=>ne.card))&&o.jsx(Qk,{options:e.options,picked:U,onPick:ne=>_(ne,{kind:"choice",id:ne})}),e.kind==="choice"&&e.options&&!e.groups&&!e.options.some(ne=>ne.card)&&o.jsx("div",{className:"sc-convo-choices sc-convo-ask","data-guide-shape":"",children:e.options.map(ne=>o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice","aria-pressed":e.multi?$.has(ne.id):void 0,"data-on":(e.multi?$.has(ne.id):U===ne.id)||void 0,onClick:()=>e.multi?H(Fe=>{const Oe=new Set(Fe);return Oe.delete(ne.id)||Oe.add(ne.id),Oe}):_(ne.id,{kind:"choice",id:ne.id}),children:ne.label},ne.id))}),e.kind==="choice"&&(e.describe||e.attach||e.skip)&&o.jsxs("div",{className:"sc-convo-ways sc-convo-ask","data-guide-shape":"",children:[e.skip&&!e.multi&&!e.groups&&o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass","data-on":C==="skip"||!C&&e.skipped||void 0,onClick:()=>_("skip",{kind:"skip"}),children:e.skip}),e.describe&&b&&o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass","aria-pressed":e.saying===void 0?void 0:e.saying,"data-on":e.saying||void 0,onClick:b,children:e.describe}),me,!e.multi&&oe]}),e.kind==="choice"&&!e.groups&&!e.multi&&!e.describe&&!e.attach&&oe&&o.jsx("div",{className:"sc-convo-ways sc-convo-ask","data-guide-shape":"",children:oe}),e.kind==="choice"&&e.multi&&o.jsxs("div",{className:"sc-convo-decide sc-convo-ask","data-guide-shape":"",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","data-on":C==="submit"||void 0,onClick:()=>_("submit",{kind:"choices",picks:Object.fromEntries([...$].map(ne=>[ne,"on"]))}),children:e.submit??"Continue"}),e.skip&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","data-on":C==="skip"||!C&&e.skipped||void 0,onClick:()=>_("skip",{kind:"skip"}),children:e.skip}),oe]}),e.kind==="choice"&&e.groups&&o.jsxs("div",{className:"sc-convo-groups",children:[e.groups.map(ne=>o.jsxs("div",{className:"sc-convo-group",children:[o.jsx("span",{className:"sc-convo-group-lb",id:`sc-convo-g-${e.id}-${ne.id}`,children:ne.label}),o.jsx(Uo,{label:ne.label,value:T[ne.id]??"",ids:ne.options.map(Fe=>Fe.id),onChange:Fe=>P(Oe=>({...Oe,[ne.id]:Fe})),className:"sc-convo-choices",children:ne.options.map(Fe=>o.jsx(Wo,{id:Fe.id,on:T[ne.id]===Fe.id,label:Fe.label,className:"sc-chip sc-convo-choice",onPick:()=>P(Oe=>({...Oe,[ne.id]:Fe.id})),children:Fe.label},Fe.id))})]},ne.id)),o.jsxs("div",{className:"sc-convo-decide sc-convo-ask","data-guide-shape":"",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","aria-disabled":!f8(e.groups,T)||void 0,title:f8(e.groups,T)?void 0:"Pick one in each row, or skip.","data-on":C==="submit"||void 0,onClick:()=>{f8(e.groups??[],T)&&_("submit",{kind:"choices",picks:T})},children:e.submit??"Continue"}),e.skip&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","data-on":C==="skip"||!C&&e.skipped||void 0,onClick:()=>_("skip",{kind:"skip"}),children:e.skip}),oe]})]}),e.kind==="swatches"&&o.jsxs("div",{className:"sc-convo-look",children:[e.row.options.some(ne=>ne.card)?e.layout==="grid"?o.jsx(wee,{options:e.row.options,picked:U,onPick:ne=>_(ne,{kind:"swatches",picks:{[e.row.id]:ne}})}):o.jsx(Qk,{options:e.row.options,picked:U,onPick:ne=>_(ne,{kind:"swatches",picks:{[e.row.id]:ne}})}):o.jsx("div",{className:"sc-convo-swatches",children:e.row.options.map(ne=>o.jsx(lr,{label:ne.label,children:o.jsx("button",{type:"button",className:ne.color?"sc-convo-swatch":"sc-chip sc-convo-choice",style:ne.color?{"--sc-swatch":ne.color}:void 0,"aria-label":ne.label,"aria-pressed":U===ne.id,"data-on":U===ne.id||void 0,onClick:()=>_(ne.id,{kind:"swatches",picks:{[e.row.id]:ne.id}}),children:ne.color?null:ne.label})},ne.id))}),(e.skip||e.describe||oe)&&o.jsxs("div",{className:"sc-convo-ways sc-convo-ask","data-guide-shape":"",children:[e.skip&&o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass","aria-pressed":C==="skip"||!C&&e.skipped,"data-on":C==="skip"||!C&&e.skipped||void 0,onClick:()=>_("skip",{kind:"skip"}),children:e.skip}),e.describe&&b&&o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass","aria-pressed":e.saying===void 0?void 0:e.saying,"data-on":e.saying||void 0,onClick:b,children:e.describe}),oe]})]}),e.kind==="photos"&&o.jsxs("div",{className:"sc-convo-photos-q",children:[o.jsx(DN,{hashes:e.hashes,max:e.max,label:((ue=e.drop)==null?void 0:ue.label)??"Add a photo of their face",hint:((Ne=e.drop)==null?void 0:Ne.hint)??"Drop it here, or choose a file",busy:e.busy,onAdd:ne=>g({kind:"photos",action:{type:"add",files:ne}}),onRemove:ne=>g({kind:"photos",action:{type:"remove",hash:ne}}),onReject:()=>g({kind:"photos",action:{type:"reject"}})}),e.instead&&o.jsx("button",{type:"button",className:"sc-convo-other","data-on":C==="instead"||void 0,"data-waiting":e.insteadWaiting||void 0,"aria-hidden":e.insteadWaiting||void 0,tabIndex:e.insteadWaiting?-1:void 0,disabled:e.insteadWaiting||void 0,onClick:()=>_("instead",{kind:"photos",action:{type:"instead"}}),children:e.instead}),e.attest&&o.jsxs("label",{className:"sc-convo-attest",children:[o.jsx("input",{type:"checkbox",checked:e.attest.checked,onChange:ne=>g({kind:"photos",action:{type:"attest",checked:ne.target.checked}})}),o.jsx("span",{children:e.attest.text})]}),o.jsxs("div",{className:"sc-convo-decide sc-convo-ask","data-guide-shape":"",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","aria-disabled":!!p8(e)||void 0,title:p8(e)??void 0,"data-on":C==="submit"||void 0,onClick:()=>{p8(e)||_("submit",{kind:"photos",action:{type:"submit"}})},children:e.submit}),e.back&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","data-on":C==="back"||void 0,onClick:()=>_("back",{kind:"photos",action:{type:"back"}}),children:e.back}),oe]})]}),e.kind==="pick"&&o.jsxs("div",{className:"sc-convo-pick",children:[e.search&&o.jsx("input",{type:"search",className:"sc-convo-pick-q",value:e.search.value,placeholder:e.search.label,"aria-label":e.search.label,onChange:ne=>g({kind:"pick",action:{type:"query",text:ne.target.value}}),onKeyDown:ne=>{var Fe;ne.key!=="Escape"||!((Fe=e.search)!=null&&Fe.value)||(ne.preventDefault(),g({kind:"pick",action:{type:"query",text:""}}))}}),o.jsxs("fieldset",{ref:Y,className:"sc-convo-pick-scroll","aria-labelledby":ee,"aria-busy":e.loading||void 0,children:[e.items.length===0&&e.loading&&o.jsx("div",{className:"sc-convo-grid sc-convo-pick-grid","aria-hidden":!0,children:Array.from({length:8},(ne,Fe)=>o.jsx("span",{className:"sc-convo-plate sc-convo-pick-wait",children:o.jsx("span",{className:"sc-convo-plate-in"})},Fe))}),e.items.length>0&&o.jsx("div",{className:"sc-convo-grid sc-convo-pick-grid",children:e.items.map(ne=>o.jsx("button",{type:"button",className:"sc-convo-plate","aria-label":ne.alt,"aria-pressed":U===ne.id,"data-on":U===ne.id||void 0,onClick:()=>_(ne.id,{kind:"pick",action:{type:"pick",id:ne.id}}),children:o.jsx("span",{className:"sc-convo-plate-in",style:{backgroundImage:`url("${hn(ne.hash,"small")}")`}})},ne.id))}),e.items.length===0&&!e.loading&&e.empty&&o.jsx("p",{className:"sc-convo-pick-empty",children:e.empty}),e.more&&o.jsx("div",{ref:I,className:"sc-convo-pick-end","aria-hidden":!0})]}),o.jsx("p",{className:"sc-vh",role:"status",children:e.loading?"":e.status??""}),(e.back||oe)&&o.jsxs("div",{className:"sc-convo-ways sc-convo-ask","data-guide-shape":"",children:[e.back&&o.jsx("button",{type:"button",className:"sc-chip sc-convo-choice sc-convo-pass","data-on":C==="back"||void 0,onClick:()=>_("back",{kind:"pick",action:{type:"back"}}),children:e.back}),oe]})]}),e.kind==="confirm"&&e.quote&&o.jsx(Tee,{text:e.quote,label:e.quoteLabel,folded:e.quoteFolded}),e.kind==="confirm"&&o.jsxs("div",{className:"sc-convo-decide sc-convo-ask","data-guide-shape":"",children:[e.options.map((ne,Fe)=>o.jsx("button",{type:"button",className:`sc-btn ${Fe===0&&!e.quiet?"sc-btn-primary":"sc-btn-ghost"}`,"data-on":C===ne.id||void 0,onClick:()=>_(ne.id,{kind:"confirm",id:ne.id}),children:ne.label},ne.id)),e.describe&&b&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","aria-pressed":e.saying===void 0?void 0:e.saying,"data-on":e.saying||void 0,onClick:b,children:e.describe}),me,oe]}),e.cost&&o.jsx("p",{className:"sc-convo-note","data-cost":!0,children:e.cost}),e.note&&o.jsx("p",{className:"sc-convo-note",children:e.note})]})]})}function Tee({text:e,label:t="The brief",folded:n=!1}){const[r,a]=s.useState(!1),[i,l]=s.useState(!n);return s.useEffect(()=>{if(!r)return;const u=setTimeout(()=>a(!1),1600);return()=>clearTimeout(u)},[r]),o.jsxs("figure",{className:"sc-convo-brief",children:[o.jsxs("figcaption",{className:"sc-convo-brief-head",children:[o.jsx("span",{className:"sc-convo-brief-lb",children:t}),o.jsxs("button",{type:"button",className:"sc-convo-brief-copy","data-took":r||void 0,onClick:()=>{var u;(u=navigator.clipboard)==null||u.writeText(e).then(()=>a(!0),()=>{})},children:[r?o.jsx(Un,{size:13,weight:"bold"}):o.jsx(Fh,{size:13,weight:"bold"}),r?"Copied":"Copy"]})]}),o.jsx("p",{className:"sc-convo-brief-text","data-folded":!i||void 0,children:e}),n&&o.jsx("button",{type:"button",className:"sc-convo-brief-more","aria-expanded":i,onClick:()=>l(u=>!u),children:i?"Show less":"Show all"})]})}function p8(e){return e.busy?"Still uploading.":e.hashes.length===0?"Add at least one photo.":e.attest&&!e.attest.checked?"Confirm you have permission to use their likeness.":null}function Dee({text:e,photos:t,at:n,now:r,editable:a,editing:i,arrive:l,leave:u,delay:f=0,turnId:h,dim:p,onEdit:g,onSave:v,onCancel:w}){const[b]=s.useState(!!l),[y]=s.useState(f),k=pw(u,b?y:0,b?240:0);return o.jsxs("div",{className:"sc-convo-turn","data-guide-shape":"","data-who":"you","data-arrive":b||void 0,"data-leave":k,"data-turn":h,"data-dim":p||void 0,style:b?{"--sc-convo-start":`${y}ms`}:void 0,children:[n?o.jsx(LM,{at:n,now:r}):null,i&&v&&w?o.jsx(Hee,{text:e,onSave:v,onCancel:w}):o.jsxs("div",{className:"sc-convo-bubble",children:[a&&g&&o.jsx(lr,{label:"Change this answer",children:o.jsx("button",{type:"button",className:"sc-convo-edit","aria-label":"Change this answer",onClick:g,children:o.jsx(id,{size:13})})}),o.jsx("p",{children:e}),t&&t.length>0&&o.jsx("div",{className:"sc-convo-photos",children:t.map((S,E)=>o.jsx("img",{src:hn(S,"micro"),alt:`Yours, ${E+1} of ${t.length}`},S))})]})]})}function Hee({text:e,onSave:t,onCancel:n}){const[r,a]=s.useState(e),i=s.useRef(null);s.useEffect(()=>{const u=i.current;u&&(u.focus(),u.setSelectionRange(u.value.length,u.value.length))},[]);const l=()=>{const u=r.trim();u&&t(u)};return o.jsxs("div",{className:"sc-convo-bubble","data-editing":"true",children:[o.jsx("textarea",{ref:i,className:"sc-convo-rewrite","aria-label":"Your answer",rows:Math.min(6,Math.max(1,r.split(`
103
+ `).length)),value:r,onChange:u=>a(u.target.value),onKeyDown:u=>{u.key==="Escape"&&(u.preventDefault(),n()),u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),l())}}),o.jsxs("div",{className:"sc-convo-rewrite-do",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:n,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","aria-disabled":!r.trim()||void 0,onClick:l,children:"Save"})]})]})}const Oee=180,e5=3e3,HM=460,Iee="cubic-bezier(0.22, 1, 0.36, 1)",Fee=220,_ee=450,Vee=48;function Zee({turns:e,busy:t,working:n,memoryKey:r,resumed:a,onAnswer:i,onEdit:l,onSaveEdit:u,onCancelEdit:f,onStarter:h,onDescribe:p,onAttachFiles:g,onRestore:v,onRetry:w,onShow:b}){var Ye;const y=s.useRef(null),k=s.useRef(!0),S=s.useRef(!!a),E=s.useRef(performance.now());S.current&&performance.now()-E.current>e5&&(S.current=!1),s.useEffect(()=>{if(!S.current)return;const ke=()=>{S.current=!1},te=window.setTimeout(ke,e5);return window.addEventListener("pointerdown",ke,{capture:!0}),window.addEventListener("keydown",ke,{capture:!0}),()=>{window.clearTimeout(te),window.removeEventListener("pointerdown",ke,{capture:!0}),window.removeEventListener("keydown",ke,{capture:!0})}},[]);const j=aee(),N=s.useRef(e),A=s.useRef(null),T=s.useRef(null),P=s.useRef(null),C=s.useRef(null),R=s.useRef(null),$=s.useRef([]),[,H]=s.useState(0),D=s.useRef(new Map),q=s.useRef(0),_=performance.now(),U=s.useRef(!1),Y=Uee(e);if(Y!==A.current){A.current=Y,U.current=!0;const ke=C.current&&_<C.current.until?C.current:null,te=ke?t5(N.current,ke):N.current,le=new Set(e.map(ar)),Me=r5(e),ze=r5(te),Re=Be=>Be.startsWith("you:")&&Me.has(lh(Be))||Be.startsWith("q:")&&ze.has(Be)&&le.has(lh(Be));if($.current=te.map(ar).filter(Be=>!le.has(Be)&&!Re(Be)),Me.size&&!ze.size){const Be=lh([...Me][0]),Qe=te.find(rt=>ar(rt)===Be);P.current=(Qe==null?void 0:Qe.kind)==="you"?{key:Be,text:Qe.text}:null}if(ze.size>0&&Me.size===0){const Be=P.current;P.current=null;const Qe=Be?e.find(zt=>ar(zt)===Be.key):void 0,rt=!!Be&&((Qe==null?void 0:Qe.kind)!=="you"||Qe.text!==Be.text),_e=e[e.length-1];T.current=rt&&(_e==null?void 0:_e.kind)==="question"?ar(_e):null}if(!j&&$.current.length){const Be=$.current.some(_e=>!(ke!=null&&ke.gone.has(_e))),Qe=ke!=null&&ke.look&&$.current.includes(`q:${ke.look.qid}`)?ke.look:null,rt=R.current??Qe;C.current={from:te,gone:new Set($.current),look:rt,until:Be?_+(R.current?Mee:Oee):(ke==null?void 0:ke.until)??_}}else C.current=null;R.current=null,N.current=e}const I=C.current&&_<C.current.until?C.current:null;I||(C.current=null),s.useEffect(()=>{if(!I)return;const ke=window.setTimeout(()=>H(te=>te+1),Math.max(0,I.until-performance.now()));return()=>window.clearTimeout(ke)},[I]);const F=(ke,te)=>{R.current={qid:ke,look:te}},O=I?t5(e,I):e,Z=s.useRef(null);if(Z.current===null){const ke=r?Yee(r):null;Z.current=ke??new Set(a||e.length>2?e.map(ar):[])}const V=s.useRef(null);V.current===null&&(V.current=(r?Kee(r):null)??new Map);const[B,K]=s.useState(()=>Date.now()),ee=Math.max(0,...V.current.values()),se=B-ee<36e5;s.useEffect(()=>{if(!se)return;const ke=window.setInterval(()=>K(Date.now()),3e4);return()=>window.clearInterval(ke)},[se]),T.current&&(Z.current.delete(T.current),T.current=null);const oe=new Set;for(const ke of O){const te=ar(ke);ke.kind==="question"&&ke.question.reopened||Z.current.has(te)||oe.add(te)}if(a&&S.current&&oe.size){for(const ke of oe)Z.current.add(ke);oe.clear()}const me=[];let ce=Number.POSITIVE_INFINITY;{const ke=new Set(O.map(ar));for(const te of[...D.current.keys()])ke.has(te)||D.current.delete(te);for(const te of O){const le=ar(te);if(!oe.has(le)){me.push(te);continue}let Me=D.current.get(le);if(Me===void 0){const ze=te.kind==="you"||te.kind==="scenri"&&!!te.quiet;Me=Math.max(_,ze?0:q.current,(I==null?void 0:I.until)??0),D.current.set(le,Me),q.current=Math.max(q.current,Me+(ze?Fee:_f+fw))}Me<=_?me.push(te):ce=Math.min(ce,Me-_)}}s.useEffect(()=>{if(ce===Number.POSITIVE_INFINITY)return;const ke=window.setTimeout(()=>H(te=>te+1),ce);return()=>window.clearTimeout(ke)},[ce]),s.useEffect(()=>{const ke=Z.current;if(ke){for(const te of $.current)ke.delete(te);for(const te of me){if(te.kind==="question"&&te.question.reopened)continue;const le=ar(te);I!=null&&I.gone.has(le)||ke.add(le)}r&&qee(r,ke),r&&V.current&&Gee(r,V.current)}});const we=s.useRef(null),G=s.useCallback(()=>{const ke=y.current;if(!ke)return null;const te=we.current;return te!=null&&te.isConnected&&te.scrollHeight>te.clientHeight?te:(we.current=e4(ke),we.current)},[]);s.useEffect(()=>{const ke=()=>{const te=G();te&&(k.current=te.scrollHeight-te.scrollTop-te.clientHeight<24)};return document.addEventListener("scroll",ke,{passive:!0,capture:!0}),()=>document.removeEventListener("scroll",ke,{capture:!0})},[G]);const ue=(()=>{const ke=e.find(le=>le.kind==="question"&&le.question.reopened);if(ke)return ar(ke);const te=e.find(le=>le.kind==="you"&&le.editing);return te?ar(te):null})();s.useLayoutEffect(()=>{var le;if(!k.current||ue)return;const ke=document.activeElement;if(ke instanceof HTMLInputElement&&ke.type==="search"&&((le=y.current)!=null&&le.contains(ke)))return;const te=G();te&&(te.scrollTop=te.scrollHeight)});const Ne=s.useRef(ue);Ne.current=ue;const ne=e.length;s.useEffect(()=>{const ke=ne>0&&y.current?Wee(y.current):null;if(!ke||typeof ResizeObserver>"u")return;const te=new ResizeObserver(()=>{!k.current||Ne.current||(ke.scrollTop=ke.scrollHeight)});return te.observe(ke),()=>te.disconnect()},[ne]);const Fe=s.useRef(null);s.useLayoutEffect(()=>{var Re,Be,Qe,rt;if(ue===Fe.current)return;const ke=Fe.current;Fe.current=ue;const te=y.current;if(!te)return;const le=document.activeElement;if(!(!le||le===document.body||te.contains(le)))return;if(ue){if(k.current=!1,ue.startsWith("you:"))return;(Be=(Re=i0(te,ue))==null?void 0:Re.querySelector(".sc-convo-q"))==null||Be.focus({preventScroll:!0});return}if(!ke)return;const ze=ke.startsWith("q:")?lh(ke):ke;(rt=(Qe=i0(te,ze))==null?void 0:Qe.querySelector(".sc-convo-edit"))==null||rt.focus({preventScroll:!0})}),s.useEffect(()=>{if(!ue)return;const ke=window.setTimeout(()=>{const te=i0(y.current,ue),le=y.current&&e4(y.current);if(!te||!le)return;const Me=te.getBoundingClientRect(),ze=le.getBoundingClientRect();Me.bottom-ze.bottom>Vee&&n5(te,j)},HM);return()=>window.clearTimeout(ke)},[ue,j]);const Oe=e.length&&e[e.length-1].kind==="question"?ar(e[e.length-1]):null,ot=s.useRef(Oe);s.useLayoutEffect(()=>{var Re,Be;const ke=y.current;if(ue||!ke||Oe===ot.current)return;const te=document.activeElement,le=(Re=te==null?void 0:te.closest(".sc-convo-turn"))==null?void 0:Re.getAttribute("data-turn"),Me=!te||te===document.body||te!==ke&&te.contains(ke)||!!le&&le.startsWith("q:")&&le!==Oe;if(!Oe||!Me){ot.current=Oe;return}const ze=(Be=i0(ke,Oe))==null?void 0:Be.querySelector(".sc-convo-q:not([hidden])");ze&&(ot.current=Oe,ze.focus({preventScroll:!0}))});const Xe=s.useRef(Oe),X=s.useRef(null);s.useEffect(()=>{if(Oe===Xe.current)return;if(!Oe){ue&&(X.current=Xe.current),Xe.current=null;return}const ke=i0(y.current,Oe);if(!ke)return;Xe.current=Oe;const te=X.current!==null,le=X.current===Oe;if(X.current=null,k.current||te&&le)return;const Me=()=>{Bee(ke,y.current)||n5(ke,j)};if(!te){Me();return}const ze=window.setTimeout(Me,_ee);return()=>window.clearTimeout(ze)},[Oe,ue,j]);const J=s.useRef(new Map);s.useLayoutEffect(()=>{const ke=y.current;if(!ke)return;const te=new Map,le=U.current;U.current=!1;for(const Me of ke.querySelectorAll(".sc-convo-turn")){const ze=Me.dataset.turn??"",Re=Me.offsetTop;te.set(ze,Re);const Be=J.current.get(ze);!le||j||Be===void 0||Math.abs(Be-Re)<1||zee(Me,Be-Re)}J.current=te});const ge=new Set;if(ue){ge.add(ue);const ke=ue.slice(ue.indexOf(":")+1);ge.add(`scenri:asked-${ke}`);const te=me.findIndex(le=>ar(le)===ue);if(te>=0){for(let le=te+1;le<me.length&&ip(me[le]);le++)ge.add(ar(me[le]));for(let le=te-1;le>=0&&ip(me[le]);le--)ge.add(ar(me[le]))}}for(const ke of me){const te=ar(ke);V.current.has(te)||V.current.set(te,Date.now())}let ve=!1;const Ze=[];for(const ke of me){const te=ar(ke),le=!!ue&&!ge.has(te),Me=V.current.get(te),ze=!!(I!=null&&I.gone.has(te)),Re=ze&&ke.kind==="question"&&((Ye=I==null?void 0:I.look)==null?void 0:Ye.qid)===ke.question.id,Be=ke.kind==="scenri"&&!!ke.quiet,Qe=!j&&!ze&&oe.has(te)&&!Be,rt=0,_e=ve;ze||(ve=ke.kind==="scenri"||ke.kind==="question"&&!ke.question.reopened),ke.kind==="you"?Ze.push(o.jsx(Dee,{text:ke.text,photos:ke.photos,editable:ke.editable,editing:ke.editing,arrive:Qe,leave:ze,delay:rt,turnId:te,dim:le,at:Me,now:B,onEdit:ke.editable&&l?()=>l(ke.id):void 0,onSave:u?zt=>u(ke.id,zt):void 0,onCancel:f},te)):ke.kind==="scenri"?Ze.push(o.jsx(jee,{text:ke.text,tone:ke.tone,reveal:Qe,leave:ze,eyebrow:!_e,delay:rt,turnId:te,dim:le,at:Me,now:B,thumb:ke.thumb,label:ke.label,view:ke.view,current:ke.current,restore:ke.restore,onRestore:v,retry:ke.retry,onRetry:w,onShow:b},te)):Ze.push(o.jsx($ee,{question:ke.question,reveal:Qe,leave:ze&&!Re,spent:ze,delay:rt,turnId:te,dim:le,busy:t||le,eyebrow:!_e,at:Me,now:B,onAnswer:zt=>i(ke.question.id,zt),onPick:F,onStarter:h,onDescribe:p,onAttachFiles:g,onCancel:f},te))}return o.jsx("div",{ref:y,className:"sc-convo-log",role:"log","aria-live":"polite","aria-relevant":"additions","data-changing":ue?"true":void 0,children:o.jsxs("div",{className:"sc-convo-turns",children:[Ze,n&&o.jsx(Aee,{what:n===!0?void 0:n})]})})}function t5(e,t){const n=[],r=new Set(e.map(ar));let a=0;for(const i of t.from){const l=ar(i);if(t.gone.has(l)){r.has(l)||n.push(i);continue}for(;a<e.length&&ar(e[a])!==l;)n.push(e[a++]);a<e.length&&n.push(e[a++])}for(;a<e.length;)n.push(e[a++]);return n}function zee(e,t){for(const a of e.getAnimations())a.id==="slide"&&a.cancel();const n=`translateY(${t}px)`;e.style.transform=n;const r=e.animate([{transform:n},{transform:"translateY(0)"}],{duration:HM,easing:Iee,fill:"both"});r.id="slide",r.onfinish=()=>{e.style.transform="",r.cancel()}}function Bee(e,t){if(!t)return!1;const n=e4(t),r=e.getBoundingClientRect(),a=n.getBoundingClientRect();return r.top>=a.top&&r.top<=a.bottom-24}function n5(e,t){var n;(n=e==null?void 0:e.scrollIntoView)==null||n.call(e,{block:"nearest",behavior:t?"auto":"smooth"})}function i0(e,t){if(!e)return null;for(const n of e.querySelectorAll(".sc-convo-turn"))if(n.dataset.turn===t)return n;return null}function Uee(e){const t=[];for(const n of e){const r=ar(n);if(n.kind==="question"){const u=n.question,f="options"in u&&Array.isArray(u.options)?u.options.map(h=>h.id).join(","):"";t.push(`${r}~${u.reopened?1:0}~${u.prompt}~${u.hint??""}~${f}`);continue}const a="photos"in n&&Array.isArray(n.photos)?n.photos.length:0,i="thumb"in n?n.thumb??"":"",l="editing"in n&&n.editing?1:0;t.push(`${r}~${n.text??""}~${i}~${a}~${l}`)}return t.join("")}function r5(e){const t=new Set;for(const n of e)n.kind==="question"&&n.question.reopened&&t.add(ar(n));return t}function lh(e){return e.startsWith("you:")?`q:${e.slice(4)}`:e.startsWith("q:")?`you:${e.slice(2)}`:""}function e4(e){let t=e;for(;t;){const{overflowY:n}=getComputedStyle(t);if((n==="auto"||n==="scroll")&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return e}function Wee(e){for(let t=e;t;t=t.parentElement){const{overflowY:n}=getComputedStyle(t);if(n==="auto"||n==="scroll")return t}return null}const mw=e=>`scenri:convo-said:${e}`;function Wi(e){try{sessionStorage.removeItem(mw(e)),sessionStorage.removeItem(gw(e))}catch{}}const gw=e=>`scenri:convo-at:${e}`;function Kee(e){try{const t=sessionStorage.getItem(gw(e));return t?new Map(Object.entries(JSON.parse(t))):null}catch{return null}}function Gee(e,t){try{sessionStorage.setItem(gw(e),JSON.stringify(Object.fromEntries(t)))}catch{}}function Yee(e){try{const t=sessionStorage.getItem(mw(e));return t?new Set(JSON.parse(t)):null}catch{return null}}function qee(e,t){try{sessionStorage.setItem(mw(e),JSON.stringify([...t]))}catch{}}function m8(e){return`${["No","One","Two","Three","Four","Five"][e]??String(e)} picture${e===1?"":"s"}`}function g8(e){const[t,...n]=e,r=[t,...n.map(a=>a.toLowerCase())];return r.length>1?`${r.slice(0,-1).join(", ")} and ${r[r.length-1]}`:r[0]??""}const be={title:"Create scene",editTitle:"Edit scene",intent:"Create a scene",source:"Where are we shooting? Describe the place, or start from pictures of one.",addPictures:"Add pictures",guideMe:"Guide me",photos:"Add one to four pictures of the place. The more they share, the better it reads.",photosDrop:{label:"Add pictures of the place",hint:"Drop them here, or choose files"},fromShot:"Or start from one of your shots",fromShotAnswer:"Start from one of my shots",shot:"Which shot? I'll read the place in it and leave the product and people out.",shotSearch:"Find a shot",shotNone:"No shots to start from yet.",shotNotFound:e=>`No shot matches "${e}".`,shotsFailed:"The shots could not be read just now. Try the search again.",shotCount:(e,t)=>t?`${e} shots so far, more as you scroll`:`${e} ${e===1?"shot":"shots"}`,shotAnswer:"This shot",backToPictures:"Back to pictures",shotOff:"Choose a shot above.",madeIn:e=>`This shot was made in ${e}.`,takeScene:e=>`Use ${e}`,readNew:"Read a new scene from it",reuseOff:"Choose above.",anotherShot:"Choose another shot",stopped:"That was stopped. Nothing here was changed.",stoppedRead:"Stopped before the place was read. Read it again, or say it differently.",stoppedDraw:"Stopped. Nothing was drawn.",stoppedChange:"Stopped before the picture changed. The new words are kept: draw them, or put back the last picture.",readThem:"Read them",guideInstead:"Guide me instead",skip:"Skip",describeInstead:"Describe instead",worldHint:"Choose a starting world. You'll personalise it next.",worldLightPrompt:e=>`This world is already lit ${e}. Keep it, or choose another.`,keepWorldLight:"Keep it",keepWorldSurface:"Keep the world's own",suggestOne:"Suggest one",followWorld:"You have the feel of it. What kind of place is it?",followLight:"You have the place. What light is it in?",leaveToReading:"Leave it to the reading",worldIsAStart:"Treat this as a starting direction, not a picture to reproduce: keep the material language and the character of the light, and invent a specific original arrangement.",emptyLead:"The place appears here",emptyHint:"Describe it, or add pictures of it",sourcePlaceholder:"Describe the place, or choose above",nothingSaidPlaceholder:"Tell me where we are, in your own words",rowPlaceholder:e=>`Pick one above, or describe the ${e}`,photosOff:"Add the pictures above, then read them.",addPlaceholder:"Anything to add or leave out?",keepPlaceholder:"Anything to keep or ignore in them?",keepShotPlaceholder:"Anything to keep or ignore in it?",changePlaceholder:"Say what to change. The rest stays.",namePlaceholder:"Its name",nameIt:"Name this scene",attachLabel:"Add pictures of the place",send:"Send",lineLabel:"Your answer",change:"Change",reading:"Writing what your shots are told",readingPhotos:"Reading your pictures",changing:"Changing the words",drawing:"Drawing the scene",stillReading:"Still writing what your shots are told",readingHead:"What your shots are told",placeLabel:"The place",lightLabel:"Light",cameraLabel:"Camera",figureLabel:"Built around",agree:"Here is the place, in full. Ready to draw?",agreePhotos:"Here is the place I read in your pictures. Ready to draw?",agreeShot:"Here is the place I read in your shot. Ready to draw?",agreeChanged:"Here it is with that. Ready to draw?",drawsTwo:"It draws two pictures: the place, and the place in use.",agreeBlind:"Here is the place, in full. Nothing here can draw yet, so it is saved as words.",readAgain:"I read the place again.",draw:"Draw the scene",saveWords:"Save scene",here:"Here is the scene.",again:"Here it is again.",changed:"Here it is, changed.",decide:e=>`Here is ${e}. Use it, or change something.`,decideEdit:e=>`Here is ${e}. Save it, or change something.`,decideSaved:"Nothing has changed yet.",use:"Use this scene",saveChanges:"Save changes",tryAgain:"Try again",changeSomething:"Change something",name:"While it draws: what should we call it?",editOpen:e=>`Here is ${e}, as it is saved. Change something, or draw it again.`,failed:"That did not work. Nothing standing was touched.",failedFirst:e=>`That did not go through: ${e}. Nothing was drawn.`,failedSaid:e=>`${e} Nothing was drawn.`,failedKept:e=>`That did not go through: ${e}. The picture you had is kept.`,sayDifferently:"Say it differently",lost:"That work is gone: the server restarted while it ran. Try it again.",offline:"Lost touch with Scenri. Still trying.",stopLost:"Stop did not reach Scenri. Press it again.",busyElsewhere:"This scene is already being worked on in another window. Try again once that is done.",retry:"Try again",version:e=>`Version ${e}`,saved:"Saved.",savedQuiet:"Saved. Nothing is drawn until you ask.",usedOff:"The scene is saved. Choose above.",showInUse:(e,t)=>`Show it in use? ${m8(t.length)} with a Scenri demo ${e} in the place: ${g8(t.map(n=>n.toLowerCase()))}.`,staleSet:e=>`${m8(e)} here show${e===1?"s":""} the place as it was before. Draw ${e===1?"it":"them"} again?`,moreViews:e=>`Add ${m8(e.length).toLowerCase()} of it in use? ${g8(e)}.`,drawIt:"Draw it",drawThem:"Draw them",drawThemAgain:"Draw them again",inUse:e=>`Saved. Now it is shown in use, with a Scenri demo ${e}.`,noLibrary:"Saved. Scenri's library has not downloaded yet, so it cannot be shown in use for now.",exampleHere:{hero:"Here is the hero.",close:"Here is a close-up.",hands:"Here it is in hands.",angle:"Here is another angle.",bold:"Here is a bold one."},exampleFailed:(e,t)=>`The ${e.toLowerCase()} did not draw: ${t.replace(/[.\s]+$/,"")}.`,exampleFailedSaid:(e,t)=>`The ${e.toLowerCase()} did not draw. ${t}`,more:e=>`Add ${["no","one","two","three"][e.length]??e.length} more? ${g8(e)}.`,addThem:"Add them",notNow:"Not now",ready:e=>`${e} is ready.`,readyUndrawn:e=>`${e} is ready. It can be shown in use any time, from its page.`,readyMissing:e=>`${e} is ready. Some did not draw.`,openScene:"Open scene",useInAShot:"Use in a shot",notAPlace:"That did not read as a place. Try a few words about it, like 'a quiet concrete gallery at dusk'.",greet:"Hello. Describe the place, or choose above.",greetRow:"Pick one above, or say it in a few words.",askHelp:"Describe the place in a few words, or tap one above. Everything can be changed later.",goFirst:"Choose above, or describe the place first.",startOverIsUp:"Start over is at the top of this panel.",notInAScene:"A scene holds the place and its light. Add presenters and products in Create.",usePutBack:"Step back through the versions on the picture, and Put back the one you want.",sayAChange:"Say what to change about the place, and the rest stays as it is.",renamed:e=>`Called it ${e}.`,changeIt:"Change it",changeTitle:"Change this answer?",changeBody:"The picture was drawn from the answers as they are. Changing one asks again from there, and the pictures so far go. To keep the picture and change one thing, say it in the line instead.",onlyPictures:"Only pictures can show a place.",fourPictures:"Four pictures is the most a scene is read from.",heicNotYet:"HEIC pictures cannot be read yet. Export them as JPEG, then add them.",leaveTitle:"Leave this scene?",leaveBody:"Nothing has been read yet, so the answers here go.",leave:"Leave",discardTitle:"Discard the changes?",discardBody:"The scene stays as it was saved. What was drawn here is let go.",discard:"Discard changes",startOver:"Start over",startOverTitle:"Start over?",startOverBody:"This conversation begins again from the first question. Nothing here is saved yet."},Xee="part of the place itself, never a separate object that competes with the subject, and leaving the subject a clear place to stand",OM={water:{surface:[{key:"basalt",label:"Wet basalt",words:"a ledge of wet black basalt, glossy where the sea has just left it"},{key:"sand",label:"White sand",words:"rippled white sand under a few centimetres of clear water"},{key:"pebbles",label:"Sea pebbles",words:"a bed of smooth sea-worn pebbles, wet and gleaming"},{key:"awash",label:"Rock awash",words:"a flat rock just awash, a thin sheet of clear water sliding over it"}],light:[{key:"caustics",label:"Water caustics",words:"a live net of water caustics sliding across every surface"},{key:"sunset",label:"Low sun on water",words:"low sun skimming the water, long glittering reflections"},{key:"silver",label:"Silver overcast",words:"soft silver overcast light, the sea flat and pale"},{key:"backlit",label:"Backlit spray",words:"the sun behind the surf, the spray lit up like glass"}],signature:[{key:"wave",label:"Frozen wave",words:"a wave frozen mid-break behind the rock, its crest in glassy detail"},{key:"foam",label:"Foam lace",words:"a lace of sea foam drawn across the wet rock"},{key:"kelp",label:"Kelp ribbons",words:"glossy olive-gold ribbons of kelp draped over the rocks"},{key:"pool",label:"Mirror pool",words:"a still rock pool mirroring the sky"}]},stone:{surface:[{key:"travertine",label:"Travertine",words:"honed cream travertine up close, its pores and soft veins readable"},{key:"limestone",label:"Rough limestone",words:"a rough-cut block of warm limestone, chisel marks in its face"},{key:"terracotta",label:"Terracotta tile",words:"sun-baked terracotta floor tiles, worn at the edges"},{key:"marble",label:"Weathered marble",words:"weathered pale marble, its polish worn soft by years of sun"}],light:[{key:"shadow",label:"One long shadow",words:"one high hard light throwing a single long, precise shadow across the stone"},{key:"olive",label:"Olive-leaf dapple",words:"sun broken into moving dapples through olive leaves"},{key:"golden",label:"Low golden sun",words:"low golden sun raking almost flat across the stone, long warm shadows"},{key:"shade",label:"Cool shade",words:"the niche in open shade, cool bounced light and a bright sunlit world beyond"}],signature:[{key:"vines",label:"Vines taking over",words:"a vine growing down the stone, claiming its edges"},{key:"basin",label:"Water in the stone",words:"water trickling into a basin carved in the stone, glinting"},{key:"dust",label:"Dust in the sun",words:"fine dust hanging in one bright shaft of sun"},{key:"sphere",label:"A giant stone sphere",words:"one oversized stone sphere resting in the space, impossible in scale"}]},colour:{surface:[{key:"lacquer",label:"Glossy lacquer",words:"a glossy lacquered floor the same colour as the sweep, mirroring it"},{key:"paper",label:"Matte paper",words:"matte coloured paper, its fibres and one soft crease readable"},{key:"acrylic",label:"Frosted acrylic",words:"a sheet of frosted acrylic glowing softly with the colour behind it"},{key:"velvet",label:"Flocked velvet",words:"flocked velvet in the same colour, soaking up the light"}],light:[{key:"gobo",label:"Cut spotlight",words:"a hard spotlight cut into one graphic shape across the colour"},{key:"split",label:"Two-colour gels",words:"two coloured gels splitting the light, one warm and one cool edge"},{key:"wrap",label:"Soft studio wrap",words:"soft wrapping studio light, a gentle gradient across the sweep"},{key:"rim",label:"Neon rim",words:"one neon rim tracing the edges, the rest of the colour dimmed"}],signature:[{key:"shapes",label:"Floating shapes",words:"a few simple geometric shapes floating in the colour, frozen in place"},{key:"planes",label:"Cut-paper planes",words:"sharp-angled planes of cut paper converging in the colour"},{key:"block",label:"Colour-block shadow",words:"a hard shadow cut into a block of a second colour"},{key:"giant",label:"Surreal scale",words:"one oversized sphere or arch in the colour, impossible in scale"}]},citrus:{surface:[{key:"halves",label:"Cut citrus",words:"a bed of halved citrus, the flesh glistening with juice"},{key:"tile",label:"Glazed tile",words:"sun-bleached glazed tiles in white and cobalt"},{key:"ice",label:"Crushed ice",words:"crushed ice melting over the fruit"},{key:"cloth",label:"Crisp linen",words:"a crisp white linen cloth spread under the fruit"}],light:[{key:"glow",label:"Sun through fruit",words:"the sun behind the fruit, the flesh glowing like stained glass"},{key:"leaves",label:"Leaf shade",words:"sun broken into dapples through citrus leaves"},{key:"golden",label:"Late golden sun",words:"late golden sun, the sky deepening, long warm shadows"},{key:"flash",label:"Hard flash",words:"hard direct flash against the blue sky, crisp and saturated"}],signature:[{key:"blossom",label:"Blossom and leaves",words:"citrus blossom and glossy leaves threaded through the fruit"},{key:"melting",label:"Ice melting",words:"ice melting over the fruit, beads of water running down"},{key:"peel",label:"Peel spirals",words:"long spirals of peel curling across the mound"},{key:"giant",label:"Giant fruit",words:"one citrus fruit at an impossible, monumental scale on the horizon"}]},volcanic:{surface:[{key:"crust",label:"Lava crust",words:"a crust of cooled black lava, ropey and cracked"},{key:"sand",label:"Black sand",words:"fine black volcanic sand, wind-rippled"},{key:"pumice",label:"Pumice",words:"porous grey pumice, sharp and light"},{key:"obsidian",label:"Obsidian",words:"a slab of glassy black obsidian with conchoidal edges"}],light:[{key:"fissures",label:"Glow from below",words:"incandescent orange fissures lighting the rock from below"},{key:"raking",label:"Sun through haze",words:"a hard low sun raking through the orange haze"},{key:"ember",label:"Ember glow",words:"a deep ember glow, everything else falling into dark"},{key:"moon",label:"Blue moonlight",words:"cold blue moonlight on the black rock, the haze gone silver"}],signature:[{key:"lava",label:"Lava still moving",words:"lava still glowing in the cracks of the crust, cooling as it goes"},{key:"ash",label:"Ash in the air",words:"fine ash drifting through the haze"},{key:"steam",label:"Steam vents",words:"white steam rising from vents in the rock"},{key:"floating",label:"Floating rocks",words:"a few rocks hanging weightless in the haze, impossible and still"}]},dark:{surface:[{key:"mirror",label:"Black mirror",words:"black mirror glass, every reflection crisp"},{key:"steel",label:"Brushed steel",words:"brushed stainless steel with a fine directional grain"},{key:"marble",label:"Black marble",words:"polished black marble with thin white veins"},{key:"water",label:"Black water",words:"still black water, one faint ripple"}],light:[{key:"gobo",label:"Cut spotlight",words:"a hard spotlight cut into one graphic shape across the dark"},{key:"pool",label:"Pool of light",words:"one pool of light from above, the rest falling to true black"},{key:"neon",label:"Neon edge",words:"one line of coloured neon reflected in the black surface"},{key:"rim",label:"Thin rim",words:"a thin bright rim of light along every edge, nothing else lit"}],signature:[{key:"wax",label:"Wax cascading",words:"dark wax cascading down a wall into the mirror, glossy and still setting"},{key:"ripples",label:"Ripples",words:"slow concentric ripples crossing the black surface"},{key:"smoke",label:"Smoke curl",words:"one curl of smoke drifting through the light"},{key:"sphere",label:"Floating sphere",words:"a perfect sphere floating above the mirror, impossible and still"}]},plaster:{surface:[{key:"limewash",label:"Limewash floor",words:"a limewashed plaster floor, soft and chalky"},{key:"oak",label:"Pale oak",words:"pale oak boards, their grain soft in the light"},{key:"terrazzo",label:"Terrazzo",words:"pale terrazzo with small flecks of stone"},{key:"silk",label:"Silk drape",words:"a length of silk pooling on the floor in soft folds"}],light:[{key:"shadow",label:"Window shadow",words:"hard sun through the tall window, its shape laid long across the room"},{key:"leaves",label:"Leaf shadows",words:"soft moving leaf shadows thrown across the plaster"},{key:"golden",label:"Low golden sun",words:"low golden sun raking across the plaster, long warm shadows"},{key:"dusk",label:"Blue dusk",words:"cool blue dusk in the window, the room dim and quiet"}],signature:[{key:"curtain",label:"Curtain in the wind",words:"a sheer curtain lifted into the room by the wind"},{key:"plants",label:"Plants growing in",words:"green plants growing up the plaster walls, claiming the corners"},{key:"arch",label:"Arch shadow",words:"the hard shadow of an arch cut across the wall"},{key:"stair",label:"Surreal stair",words:"a plaster stair rising into the wall and going nowhere"}]},linen:{surface:[{key:"linen",label:"Raw linen",words:"raw undyed linen, its slub weave readable"},{key:"satin",label:"Silk satin",words:"heavy silk satin in deep folds, its sheen catching the light"},{key:"boucle",label:"Wool bouclé",words:"nubbly wool bouclé, soft and textured"},{key:"paper",label:"Crumpled paper",words:"large sheets of crumpled paper folded like cloth"}],light:[{key:"leaves",label:"Leaf dapple",words:"sun broken into soft dapples through leaves"},{key:"slice",label:"Slice of sun",words:"one hard slice of sun across the folds"},{key:"golden",label:"Low golden sun",words:"low golden sun raking across the folds, deep warm shadows"},{key:"through",label:"Light through cloth",words:"light glowing through the cloth from behind"}],signature:[{key:"wind",label:"Lifted by wind",words:"the cloth lifted by a gust and frozen mid-billow"},{key:"dried",label:"Dried flowers",words:"a few dried flowers and grasses caught in the folds"},{key:"thread",label:"One red thread",words:"a single red thread running through the folds"},{key:"landscape",label:"Folds as dunes",words:"the folds made vast, like a landscape of dunes"}]}};function vw(e,t){const n=e?OM[e]:void 0;return n?n[t].map((r,a)=>({id:`${e}-${r.key}`,label:r.label,words:r.words,card:`scene-${e}-${t}-${a+1}`})):null}function Qee(e){return Object.keys(OM).flatMap(t=>vw(t,e)??[])}const Jee=["water","stone","colour","citrus","volcanic","dark","plaster","linen"],Vf=["world","surface","light","signature"],ua=(e,t)=>`scene-${e}-${t}`,al={world:{prompt:"What world?",options:[{id:"water",label:"Rock and water",words:"a shoreline of wet dark rock and shallow turquoise water",light:"in hard midday sun",card:ua("world",1),cues:["water","sea","ocean","shore","shoreline","beach","wet","pool","underwater"]},{id:"stone",label:"Sunlit stone",words:"a niche of warm limestone and rough plaster",light:"in hard afternoon sun",card:ua("world",2),cues:["stone","limestone","wall","niche","arch","terracotta","mediterranean","sunlit"]},{id:"colour",label:"Colour field",words:"a seamless studio sweep in one saturated colour",light:"in flat hard poster light",card:ua("world",3),cues:["studio","sweep","seamless","backdrop","colour","color","paper","poster","graphic","flat"]},{id:"citrus",label:"Fruit and sky",words:"a mound of cut citrus under an open blue sky",light:"in bright direct sun",card:ua("world",4),cues:["fruit","citrus","orange","lemon","sky","outdoors","outdoor","summer","juice"]},{id:"volcanic",label:"Volcanic haze",words:"dark volcanic rock in a deep orange haze",light:"with one hard low light raking across it",card:ua("world",5),cues:["volcanic","lava","rock","ash","dust","haze","smoke","desert","mars"]},{id:"dark",label:"Dark mirror",words:"a near-black polished surface like a still pool",light:"in low-key light, with one bright edge",card:ua("world",6),cues:["mirror","reflection","polished","still pool"]},{id:"plaster",label:"Soft plaster",words:"a bare plaster room with one tall soft window",light:"in soft overcast daylight",card:ua("world",7),cues:["plaster","concrete","microcement","minimal","interior","room","window","raw","architectural","overcast"]},{id:"linen",label:"Linen fold",words:"a length of raw undyed linen folded in soft loose drapes",light:"in soft window light",card:ua("world",8),cues:["linen","fabric","textile","cloth","drape","fold","woven","cotton","soft fabric"]}]},surface:{prompt:"What is it made of, up close?",options:[{id:"travertine",label:"Travertine",words:"honed cream travertine up close, its pores and soft veins readable",cues:["travertine"]},{id:"steel",label:"Brushed steel",words:"brushed stainless steel with a fine directional grain",cues:["steel","stainless","brushed metal","aluminium","aluminum"]},{id:"clay",label:"Cracked clay",words:"sun-dried terracotta clay cracked into deep fissures",cues:["clay","terracotta","cracked earth"]},{id:"silk",label:"Silk folds",words:"heavy silk gathered into deep sculptural folds",cues:["silk","satin"]},{id:"sand",label:"Wet sand",words:"rippled wet sand, glossy where the water has just drawn back",cues:["sand","wet sand"]},{id:"moss",label:"Moss and roots",words:"damp moss over exposed roots, dense and living",cues:["moss","mossy","roots"]},{id:"ice",label:"Ice",words:"clear ice with trapped bubbles and a cold blue depth",cues:["ice","icy","glacial"]},{id:"concrete",label:"Raw concrete",words:"raw board-formed concrete with timber grain printed into it",cues:["board-formed","cement"]}]},light:{prompt:"What does the light do?",options:[{id:"shadow",label:"One long shadow",words:"one high hard light throwing a single long, precise shadow across the place",cues:["long shadow","skylight","shaft of light","single shadow"]},{id:"dapple",label:"Dappled leaves",words:"sun broken into soft moving dapples through leaves",cues:["dappled","dapple","through leaves","leaf shadows","canopy"]},{id:"caustics",label:"Water caustics",words:"a live net of water caustics sliding across every surface",cues:["caustics","caustic","rippling light","underwater light"]},{id:"gobo",label:"Cut spotlight",words:"a hard spotlight cut into one graphic shape across the set",cues:["gobo","spotlight","cut light","shaped light"]},{id:"window",label:"Soft window",words:"soft daylight from one large window, falling open and shadowless on the far side",card:ua("light",7),cues:["window light","side light","from a window","sidelit","window","soft","daylight","overcast","diffused"]},{id:"golden",label:"Low golden sun",words:"low golden sun raking almost flat across it, long warm shadows",card:ua("light",2),cues:["golden","golden hour","sunset","sunrise","dusk","warm"]},{id:"neon",label:"Neon glow",words:"coloured neon streaking its light across glossy surfaces at night",card:ua("light",4),cues:["neon","night","nocturnal","after dark"]},{id:"lowkey",label:"Pool of light",words:"one pool of light with a bright edge, the rest falling to true black",card:ua("light",6),cues:["low key","lowkey","dramatic","shadowy","chiaroscuro","rim light"]}]},signature:{prompt:"What makes it unforgettable?",options:[{id:"air",label:"Mist, snow or wind",words:"the air of the place alive, such as mist lying low, snow drifting down or wind moving through fabric or grass: one, chosen for this place",cues:["mist","misty","fog","foggy","snow","snowing","wind","windswept","haze"]},{id:"change",label:"Caught mid-change",words:"the place's own material caught mid-change, such as wax cascading down a wall, sugar pulled glassy across the surface or ice melting at its edge: one, chosen for this place",cues:["melting","molten","dripping","wax","resin","mid-change"]},{id:"graphic",label:"Graphic light and shadow",words:"one bold graphic device of light and shadow shaping the set, such as a cut shadow or a hard slice of colour",cues:["graphic","geometric","cut shadow","colour block","color block"]},{id:"nature",label:"Nature taking over",words:"nature growing through the set, such as moss, blooms or roots claiming its edges: one, chosen for this place",cues:["overgrown","blooms","flowers","vines","growing"]},{id:"water",label:"Glass and water",words:"water and reflection in the place, such as a still reflecting pool or rain-beaded glass: one, chosen for this place",cues:["reflection","reflecting","rain","puddle","rain glass"]},{id:"scale",label:"Surreal scale",words:"one surreal touch of scale, an oversized natural or architectural form that makes the place feel impossible",cues:["surreal","giant","oversized","impossible","dreamlike"]}]}},ete=new Set([...al.world.options.map(e=>e.card),...al.light.options.filter(e=>e.card).map(e=>e.card),...Jee.flatMap(e=>["surface","light","signature"].flatMap(t=>(vw(e,t)??[]).map(n=>n.card)))]);function tte(e,t){return e==="world"?al.world.options:vw(t,e)??al[e].options}function nte(e,t){const n=tte(e,t),r=n.every(a=>!!a.card&&ete.has(a.card));return{id:e,label:al[e].prompt,options:n.map(a=>({id:a.id,label:a.label,...r?{card:a.card}:{}}))}}const rte={world:"place",surface:"surface",light:"light",signature:"idea"},s5=e=>rte[e],xo=(e,t)=>{if(!t)return;const n=al[e].options.find(r=>r.id===t);return n||e==="world"?n:Qee(e).find(r=>r.id===t)},ste="one signature idea that makes this place unforgettable, invented for it and never generic";function ate(e){const t=` ${e.toLowerCase().replace(/[^a-z0-9]+/g," ")} `,n={};for(const r of Vf){let a=null;for(const i of al[r].options)for(const l of i.cues??[]){const u=` ${l.replace(/[^a-z0-9]+/g," ")} `;t.includes(u)&&(!a||l.length>a.len)&&(a={id:i.id,len:l.length})}a&&(n[r]=a.id)}return n}const ote=["studio","cyclorama","cyc","seamless","sweep","backdrop","set","room","interior","exterior","beach","shore","shoreline","coast","sea","ocean","lake","river","water","pool","forest","woods","woodland","jungle","garden","park","field","meadow","desert","dune","dunes","mountain","mountains","cliff","cave","canyon","street","city","urban","rooftop","loft","warehouse","gallery","museum","hotel","lobby","kitchen","bathroom","bedroom","living room","cafe","café","bar","restaurant","shop","store","boutique","market","library","courtyard","terrace","balcony","corridor","hallway","tunnel","bridge","station","greenhouse","spa","chapel","ruin","ruins","architecture","landscape","outdoors","indoors","sky"],t4=["stone","rock","rocks","marble","travertine","limestone","granite","basalt","concrete","plaster","terrazzo","tile","tiles","wood","wooden","oak","walnut","linen","fabric","velvet","silk","satin","glass","metal","steel","chrome","brass","mirror","sand","moss","ferns","foliage","flowers","paper","colour field","color field","colour block","color block","pastel","brutalist","minimal","wall","walls","clay","terracotta","ice","aluminium","aluminum","stainless","leather","felt","slate","onyx","salt"],IM=["splash","splashing","mid air","frozen","falling","petals","confetti","smoke","mist","fog","steam","dust","drifting","bubbles","melting","molten","dripping","wax","resin","pouring","overgrown","blooms","flowers","vines","reflection","reflections","reflecting","rain","puddle","ripples","surreal","giant","oversized","levitating","impossible","dreamlike","cut shadow","gobo"],FM=["light","lit","lighting","flash","strobe","strobes","sun","sunny","sunlight","sunlit","sunshine","daylight","golden hour","sunset","sunrise","dusk","dawn","twilight","blue hour","night","neon","moonlight","moonlit","candle","candlelight","candlelit","lamp","lamplight","spotlight","spotlit","softbox","overcast","shadow","shadows","shadowless","backlit","backlight","rim light","glow","glowing","noon","midday","low key","high key","chiaroscuro","hard sun","window light"],_M=["plinth","pedestal","podium","platform","block","cube","table","tabletop","counter","countertop","shelf","ledge","tray","on the floor","on the ground","in hand","in hands","hand","hands","held","holding","resting","rests","floating","floats","suspended","hanging","leaning","propped","nestled","nested","half buried","emerging","balanced","stacked","scattered"],VM=["top down","overhead","flat lay","flatlay","birds eye","bird s eye","aerial","from above","from below","low angle","high angle","eye level","worms eye","close up","closeup","macro","wide angle","wide shot","wide","telephoto","35mm","50mm","85mm","lens","shot from","framed","framing","straight on","profile"],ZM={world:[...ote,...t4],surface:t4,light:FM,signature:IM,stage:_M,camera:VM},ite=e=>` ${e.toLowerCase().replace(/[^a-z0-9é]+/g," ").trim()} `,lte=(e,t)=>e.includes(` ${t.replace(/[^a-z0-9é]+/g," ")} `);function zM(e){const t=ite(e),n=r=>r.some(a=>lte(t,a));return{world:n(ZM.world),surface:n(t4),light:n(FM),signature:n(IM),stage:n(_M),camera:n(VM)}}const cte=e=>Object.keys(ZM).filter(t=>e[t]);function ute(e){const t=["world","surface","light"].filter(r=>!e[r]),n=cte(e).length>=3?t.filter(r=>r==="world"):t.slice(0,2);return e.signature?n:[...n,"signature"]}const ni="__passed",x0=e=>{var t;return(t=e.source)==null?void 0:t.door},dte=e=>{var t;return x0(e)==="words"?ute(zM(((t=e.source)==null?void 0:t.text)??"")):[]},Am=[{id:"source",applies:()=>!0},{id:"photos",applies:e=>x0(e)==="photos"},{id:"shot",applies:e=>x0(e)==="shot"},{id:"reuse",applies:e=>{var t;return x0(e)==="shot"&&!!((t=e.shot)!=null&&t.scene)}},...Vf.map(e=>({id:e,applies:t=>x0(t)==="guided"||dte(t).includes(e)}))],Ph=Am.map(e=>e.id),cp=e=>Vf.includes(e),a5=e=>Ph.includes(e),fte=e=>{var t;return!!e&&(!!e.pick||!!((t=e.words)!=null&&t.trim()))};function ww(e,t){var n;return e==="source"?!!t.source:e==="photos"?!!((n=t.photos)!=null&&n.done)&&t.photos.hashes.length>0:e==="shot"?!!t.shot:e==="reuse"?t.reuse==="read":fte(t[e])}const hte=e=>Am.filter(t=>t.applies(e)&&ww(t.id,e)).map(t=>t.id);function BM(e){var t;return((t=Am.find(n=>n.applies(e)&&!ww(n.id,e)))==null?void 0:t.id)??null}const UM=e=>{var t,n,r,a,i;return((t=e.source)==null?void 0:t.door)==="words"?!!((n=e.source.text)!=null&&n.trim()):((r=e.source)==null?void 0:r.door)==="photos"?(((a=e.photos)==null?void 0:a.hashes.length)??0)>0:((i=e.source)==null?void 0:i.door)==="shot"?!!e.shot:Vf.some(l=>Fi(l,e[l])!==null)},o5=e=>!!e.source&&BM(e)===null&&UM(e),n4=(e,t)=>JSON.stringify(e)!==JSON.stringify(t);function yw(e,t){const n={...e},r=[];for(const[a,i]of Object.entries(t))n4(e[a],i)&&(i===void 0?delete n[a]:n[a]=i,r.push(a));if(r.length){const a=Math.min(...r.map(i=>Ph.indexOf(i)));for(const i of Ph)Ph.indexOf(i)<=a||i in t||delete n[i]}for(const a of Am)n[a.id]!==void 0&&!a.applies(n)&&delete n[a.id];return n}function pte(e,t,n){var r,a;if(e==="source")return t.kind!=="choice"?null:t.id==="photos"?{source:{door:"photos"},photos:{hashes:((r=n.photos)==null?void 0:r.hashes)??[],done:!1}}:t.id==="guided"?{source:{door:"guided"}}:null;if(e==="reuse")return t.kind==="choice"&&t.id==="read"?{reuse:"read"}:null;if(cp(e)){const i=(a=n[e])==null?void 0:a.words,l=t.kind==="swatches"?t.picks[e]??Object.values(t.picks)[0]:t.kind==="choice"?t.id:void 0;if(l)return{[e]:{pick:l,...i?{words:i}:{}}};if(t.kind==="skip")return{[e]:{pick:ni,...i?{words:i}:{}}}}return null}function i5(e){var t;return(e==null?void 0:e.pick)===ni?[ste,(t=e.words)==null?void 0:t.trim()].filter(Boolean).join(", "):Fi("signature",e)}function Fi(e,t){var a,i;if(!t)return null;const n=t.pick&&t.pick!==ni?(a=xo(e,t.pick))==null?void 0:a.words:void 0,r=(i=t.words)==null?void 0:i.trim();return n&&r?`${n}, ${r}`:n??r??null}const l5=e=>e?`, ${Xee}`:"";function mte(e){var l,u,f,h,p,g,v;if(((l=e.source)==null?void 0:l.door)==="words"){const w=(e.source.text??"").trim(),b=Fi("world",e.world),y=Fi("light",e.light)??(zM(w).light?null:((f=xo("world",(u=e.world)==null?void 0:u.pick))==null?void 0:f.light)??null),k=i5(e.signature),S=[b,Fi("surface",e.surface),y,k].filter(Boolean);return S.length?`${w.replace(/[.\s]+$/,"")}, ${S.join(", ")}${l5(k)}.`:w}if(((h=e.source)==null?void 0:h.door)!=="guided")return"";const t=Fi("world",e.world),n=Fi("light",e.light)??((g=xo("world",(p=e.world)==null?void 0:p.pick))==null?void 0:g.light)??null,r=i5(e.signature),i=`${[t??"a place",Fi("surface",e.surface),n,r].filter(Boolean).join(", ").replace(/^./,w=>w.toUpperCase())}${l5(r)}.`;return(v=e.world)!=null&&v.pick?`${i.slice(0,-1)}. ${be.worldIsAStart}`:i}function gte(e){var t,n,r;return((t=e.source)==null?void 0:t.door)==="shot"?e.shot?[e.shot.hash]:[]:((n=e.source)==null?void 0:n.door)==="photos"&&((r=e.photos)!=null&&r.done)?e.photos.hashes:[]}const c5=e=>/^image\/hei[cf]/i.test(e.type)||/\.hei[cf]$/i.test(e.name),vte={answers:{},revision:0,editing:null,held:null,asides:[]};function WM(e,t){var n,r;switch(t.type){case"answer":{const a=yw(e.answers,t.patch);return n4(a,e.answers)?{...e,answers:a,revision:e.revision+1,editing:null,held:null}:{...e,editing:null,held:null}}case"photos":{if(((n=e.answers.source)==null?void 0:n.door)!=="photos")return e;const a=[...new Set(t.hashes)].slice(0,4),i=e.editing==="photos";return{...e,answers:{...e.answers,photos:{hashes:a,done:i}},revision:e.revision+1}}case"photo":return WM(e,{type:"photos",hashes:[...((r=e.answers.photos)==null?void 0:r.hashes)??[],t.hash]});case"edit":return ww(t.id,e.answers)?{...e,editing:t.id,held:e.answers}:e;case"cancel-edit":return!e.held||!n4(e.held,e.answers)?{...e,editing:null,held:null}:{...e,answers:e.held,revision:e.revision+1,editing:null,held:null};case"aside":return{...e,asides:[...e.asides,t.aside].slice(-40)}}}const wte=e=>({answers:e.held??e.answers,revision:e.revision,asides:e.asides}),yte=/^[a-f0-9]{32}$/,u5=/^[\w.:-]{1,80}$/;function bte(e){const t=e;if(!t||typeof t!="object"||typeof t.answers!="object"||!t.answers)return null;const n={},r=t.answers.source;r&&["photos","shot","guided","words"].includes(r.door)&&(n.source={door:r.door,...typeof r.text=="string"?{text:r.text.slice(0,400)}:{}});const a=t.answers.photos;a&&Array.isArray(a.hashes)&&(n.photos={hashes:a.hashes.filter(u=>typeof u=="string").slice(0,4),done:!!a.done});const i=t.answers.shot;if(i&&typeof i.id=="string"&&u5.test(i.id)&&typeof i.hash=="string"&&yte.test(i.hash)){const u=i.scene,f=u&&typeof u.id=="string"&&u5.test(u.id)&&typeof u.name=="string"?{id:u.id,name:u.name.slice(0,120)}:void 0;n.shot={id:i.id,hash:i.hash,...f?{scene:f}:{}}}t.answers.reuse==="read"&&(n.reuse="read");for(const u of Vf){const f=t.answers[u];if(!f||typeof f!="object")continue;const h=typeof f.pick=="string"&&(f.pick===ni||xo(u,f.pick))?f.pick:void 0,p=typeof f.words=="string"?f.words.slice(0,200):void 0;(h||p)&&(n[u]={...h?{pick:h}:{},...p?{words:p}:{}})}const l=Array.isArray(t.asides)?t.asides.filter(u=>u&&typeof u.said=="string"&&typeof u.reply=="string"&&typeof u.at=="string").map(u=>({said:u.said,reply:u.reply,at:u.at,q:typeof u.q=="string"?u.q:null})):[];return{answers:yw({},n),revision:Number(t.revision)||0,editing:null,held:null,asides:l}}const up=4,KM=800,bw=60,GM={place:"",pictures:[],heldPictures:[],inputsRev:0,readRev:null,readTried:null,versions:[],current:-1,name:"",named:!1,job:null,error:null,saved:null,moreDeclined:!1,moreAsked:!1,setDrawn:!1,setDeclined:!1};function xte(e){return{...GM,place:e.place,pictures:e.pictures.slice(0,up),heldPictures:e.pictures.slice(up),readRev:0,versions:[{reading:e.reading,hash:e.hash,...e.anchor?{anchor:!0}:{},...e.hash&&e.hero?{hero:e.hero,...e.heroWith?{heroWith:e.heroWith}:{}}:{},coverage:[],how:"read"}],current:0,name:e.name,named:!0}}const Mr=e=>e.versions[e.current]??null,d5=e=>e.versions.some(t=>!!t.hash);function kte(e,t){return!t||e.job||e.inputsRev===0||e.readRev!==null&&e.readRev===e.inputsRev||e.readTried===e.inputsRev?null:e.inputsRev}const YM=e=>e.readRev!==null&&e.readRev!==e.inputsRev;function Ste(e,t){var n,r,a;switch(t.type){case"inputs":{const i=t.place.slice(0,KM),l=[...new Set(t.pictures)].slice(0,up);return i===e.place&&l.join()===e.pictures.join()?e:{...e,place:i,pictures:l,inputsRev:e.inputsRev+1}}case"name":return{...e,name:t.text.slice(0,bw),named:!0};case"started":return e.job?e:{...e,job:{id:t.id,kind:t.kind,ask:t.ask,inputsRev:e.inputsRev,pending:null,coverage:[],phase:t.kind==="again"?"drawing":t.kind==="change"?"changing":"reading",since:t.since},readTried:t.kind==="make"?e.inputsRev:e.readTried,error:null};case"stopping":return!e.job||e.job.id!==t.id||e.job.stopping?e:{...e,job:{...e.job,stopping:!0}};case"stop-failed":{if(!e.job||e.job.id!==t.id||!e.job.stopping)return e;const{stopping:i,...l}=e.job;return{...e,job:l}}case"progress":{if(!e.job||e.job.id!==t.job.id)return e;const i={...e.job,pending:t.job.reading??e.job.pending,coverage:t.job.coverage??e.job.coverage,phase:t.job.phase,since:t.job.phaseAt??e.job.since};return i.phase===e.job.phase&&i.since===e.job.since&&i.coverage.join(`
104
+ `)===e.job.coverage.join(`
105
+ `)&&JSON.stringify(i.pending)===JSON.stringify(e.job.pending)?e:f5({...e,job:i},i.pending)}case"finished":{if(!e.job||e.job.id!==t.job.id)return e;const i=e.job,l=t.job,u={...e,job:null};if(i.kind==="make"&&i.inputsRev!==e.inputsRev)return u;const f=l.reading??(i.kind==="again"?((n=Mr(e))==null?void 0:n.reading)??null:null),h=l.status==="failed"?l.error??be.failed:null;if(l.status==="cancelled"){if(!f)return{...u,error:i.kind==="make"?be.stoppedRead:be.stopped};if(i.kind==="again"&&!l.hash)return{...u,error:be.stoppedDraw}}const p=l.status==="cancelled"&&i.kind==="change"&&!l.hash;if(!f||i.kind==="again"&&!l.hash)return{...u,error:h};const g=i.kind==="make"?"read":i.kind==="change"?"change":e.versions.some(S=>S.hash)?"again":"draw",v={reading:f,hash:l.hash,...l.hash&&l.anchor?{anchor:!0}:{},...l.hash&&l.hero?{hero:l.hero,...l.heroWith?{heroWith:l.heroWith}:{}}:{},ask:i.kind==="change"?i.ask:void 0,coverage:(r=l.coverage)!=null&&r.length?l.coverage:i.kind==="again"?((a=Mr(e))==null?void 0:a.coverage)??[]:[],how:g},w=Mr(e),b=i.kind==="make"&&!l.hash&&w&&!w.hash&&w.how==="read",y=b?e.versions.map((S,E)=>E===e.current?v:S):[...e.versions,v],k={...u,versions:y,current:b?e.current:y.length-1,readRev:i.kind==="make"?i.inputsRev:e.readRev,error:p?be.stoppedChange:h};return f5(k,f)}case"lost":return!e.job||e.job.id!==t.id?e:{...e,job:null,error:t.error};case"put-back":return e.job||!e.versions[t.index]?e:{...e,current:t.index};case"forget-record":return e.job||!e.versions.length?e:{...e,versions:[],current:-1,error:null};case"edit-words":{const i=Mr(e);if(e.job||!i||!t.reading.prompt.trim()||JSON.stringify(t.reading)===JSON.stringify(i.reading))return e;const l=[...e.versions,{reading:t.reading,hash:i.hash,...i.anchor?{anchor:!0}:{},...i.hero?{hero:i.hero,...i.heroWith?{heroWith:i.heroWith}:{}}:{},coverage:i.coverage,how:"edit"}];return{...e,versions:l,current:l.length-1}}case"error":return{...e,error:t.text};case"saved":return{...e,saved:t.id,error:null};case"decline-more":return{...e,moreDeclined:!0};case"ask-more":return{...e,moreAsked:!0};case"set-drawn":return{...e,setDrawn:!0,setDeclined:!1};case"set-declined":return{...e,setDeclined:!0};case"set-failed":return t.more?{...e,moreAsked:!1}:{...e,setDrawn:!1}}}function f5(e,t){return e.named||!(t!=null&&t.name)?e:{...e,name:t.name.slice(0,bw)}}function Ete(e){var n;const t=e.job?e.job.phase==="drawing"?e.job.pending:null:((n=Mr(e))==null?void 0:n.reading)??null;return t?!e.job&&YM(e)?{can:!1,why:be.stillReading,words:t}:e.name.trim()?{can:!0,why:null,words:t}:{can:!1,why:be.nameIt,words:t}:{can:!1,why:e.job?be.stillReading:null,words:null}}const v8=e=>e.job?e.job.phase==="changing"?be.changing:e.job.phase==="drawing"?be.drawing:e.pictures.length?be.readingPhotos:be.reading:void 0;function Cte(e){var r;const t=new Map;e.versions.forEach((a,i)=>{a.hash&&t.set(a.hash,i)});const n=((r=Mr(e))==null?void 0:r.hash)??null;return[...t.entries()].sort((a,i)=>a[1]-i[1]).map(([a],i)=>({n:i+1,hash:a,current:a===n}))}const qM=e=>(e==null?void 0:e.hero)??(e==null?void 0:e.hash)??null,jte=(e,t)=>e.versions.slice(0,t+1).filter(n=>!!n.hash).length,Ate=(e,t)=>e.versions.map(n=>n.hash).lastIndexOf(t);function Nte(e){const t=[{label:be.placeLabel,text:e.prompt}];return e.lighting&&t.push({label:be.lightLabel,text:e.lighting}),e.camera&&t.push({label:be.cameraLabel,text:e.camera}),e.figure&&t.push({label:be.figureLabel,text:e.figureTreatment?`${h5(e.figure)}, ${h5(e.figureTreatment)}.`:e.figure}),t}const h5=e=>e.replace(/[.\s]+$/,""),Mte=/\b(presenters?|models?|influencers?|celebrit(y|ies)|actors?|actress(es)?)\b/i,Rte=/\b(my|our|the|a|an)\s+(\w+\s+)?(products?|bottles?|serum|perfume|shoes?|bag|jar|packaging|package|logos?|brand|brand name|wordmark)\b/i,Pte=/\b(add|put|place|include|show|feature|with|holding|wearing|sitting|standing)\b/i,Lte=/\b(no|without|remove|removing|empty|nobody|none|take out|get rid of|less)\b/i,$te=/^\s*(undo|go back|revert|back to|previous|the (first|last|previous|old|earlier) (one|version))\b/i,Tte=/^\s*(hi|hello|hey|thanks|thank you|ok|okay|cool|nice|great|good|wow|yes|no)\b[\s!.]*$/i,Dte=/^(?:please\s+)?(?:(?:call|name)\s+(?:it|this|the\s+scene)|rename(?:\s+(?:it|this|the\s+scene))?)\s+(?:to\s+|as\s+)?["'\u201c\u2018]?(.+?)["'\u201d\u2019]?[.!]?$/i,XM=e=>{var t,n;return((n=(t=Dte.exec(e.trim()))==null?void 0:t[1])==null?void 0:n.trim())||null};function Hte(e){const t=e.trim(),n=XM(t);return n?{kind:"rename",name:n}:$te.test(t)?{kind:"navigate",say:be.usePutBack}:Tte.test(t)||/\?\s*$/.test(t)&&!/\b(make|can you|could you|try)\b/i.test(t)?{kind:"chatter",say:be.sayAChange}:(Mte.test(t)||Rte.test(t))&&Pte.test(t)&&!Lte.test(t)?{kind:"refuse",say:be.notInAScene}:{kind:"change"}}const Ote=(e,t)=>{var n;return!!((n=Mr(e))!=null&&n.ask)&&Mr(e).ask.trim().toLowerCase()===t.trim().toLowerCase()},QM=e=>!e.saved&&(e.versions.length>0||!!e.job||!!e.error),p5=(e,t)=>e.saved?!1:t?e.versions.length>t.versions.length||e.current!==t.current||e.place!==t.place||e.pictures.join()!==t.pictures.join()||e.name!==t.name||!!e.job:!!(e.place.trim()||e.pictures.length||e.versions.length||e.job);function Ite(e,t){const n={};for(const[r,a]of Object.entries(e))JSON.stringify(a)!==JSON.stringify(t[r])&&(n[r]=a);return"previewHash"in n&&(n.anchor=e.anchor),"heroHash"in n&&e.heroWith&&(n.heroWith=e.heroWith),n}const JM=1;function Fte(e){return JSON.stringify({v:JM,...e})}function _te(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||t.v!==JM)return null;const n=u=>Array.isArray(u)?u.filter(f=>typeof f=="string"):[],r=u=>!!u&&typeof u.prompt=="string"&&typeof u.name=="string",a=Array.isArray(t.versions)?t.versions.filter(u=>u&&r(u.reading)).map(u=>({reading:u.reading,hash:typeof u.hash=="string"?u.hash:null,...u.anchor===!0&&typeof u.hash=="string"?{anchor:!0}:{},...typeof u.hero=="string"&&typeof u.hash=="string"?{hero:u.hero,...u.heroWith&&typeof u.heroWith=="object"?{heroWith:u.heroWith}:{}}:{},ask:typeof u.ask=="string"?u.ask:void 0,coverage:n(u.coverage),how:["read","draw","again","change","edit"].includes(u.how)?u.how:u.hash?"draw":"read"})):[],i=t.job&&typeof t.job.id=="string"&&["make","again","change"].includes(t.job.kind)?{id:t.job.id,kind:t.job.kind,ask:typeof t.job.ask=="string"?t.job.ask:void 0,inputsRev:Number(t.job.inputsRev)||0,pending:r(t.job.pending)?t.job.pending:null,coverage:n(t.job.coverage),phase:["reading","changing","drawing"].includes(t.job.phase)?t.job.phase:null,since:typeof t.job.since=="string"?t.job.since:null,...t.job.stopping===!0?{stopping:!0}:{}}:null,l=Number.isInteger(t.current)&&t.current>=-1&&t.current<a.length?t.current:a.length-1;return{place:typeof t.place=="string"?t.place.slice(0,KM):"",pictures:n(t.pictures).slice(0,up),heldPictures:n(t.heldPictures).slice(0,4),inputsRev:Number(t.inputsRev)||0,readRev:t.readRev===null||t.readRev===void 0?null:Number(t.readRev),readTried:t.readTried===null||t.readTried===void 0?null:Number(t.readTried),versions:a,current:l,name:typeof t.name=="string"?t.name.slice(0,bw):"",named:!!t.named,job:i,error:typeof t.error=="string"?t.error:null,saved:typeof t.saved=="string"&&t.saved?t.saved:null,moreDeclined:t.moreDeclined===!0,moreAsked:t.moreAsked===!0,setDrawn:t.setDrawn===!0,setDeclined:t.setDeclined===!0}}function Vte(e){if(!e||e.loading)return"";const t=e.items.length;return t?be.shotCount(t,e.more):e.error?be.shotsFailed:e.query.trim()?be.shotNotFound(e.query.trim()):be.shotNone}function m5(e){var n;const t=(n=e==null?void 0:e.tokens)==null?void 0:n.find(r=>(r==null?void 0:r.t)==="template");return typeof(t==null?void 0:t.id)=="string"&&t.id?t.id:typeof(e==null?void 0:e.templateId)=="string"&&e.templateId?e.templateId:null}function Zte(e){return Nte(e).map(t=>t.label===be.placeLabel?t.text:`${t.label}: ${t.text.replace(/[.\s]+$/,"")}.`).join(" ")}const Nm=new Set([be.stopped,be.stoppedRead,be.stoppedDraw,be.stoppedChange,be.lost,be.failed,be.busyElsewhere]),zte=e=>Nm.has(e)?e:hm(e)??be.failedKept(e.replace(/[.\s]+$/,"")),Bte=new Set([be.stopped,be.stoppedRead,be.stoppedDraw,be.stoppedChange]),w8=e=>Bte.has(e)?{}:{tone:"alert"},g5=e=>{if(Nm.has(e))return e;const t=hm(e);return t?be.failedSaid(t):be.failedFirst(e.replace(/[.\s]+$/,""))},eR=e=>e&&!Nm.has(e)?eo(e).remedy:void 0,r4=e=>{const t=eR(e);return t?[{id:`remedy:${t.opens}`,label:t.label}]:[]};function v5(e){const t=!eR(e)&&!Nm.has(e)&&!eo(e).retryable;return[...r4(e),...t?[{id:"reword",label:be.sayDifferently}]:[],{id:"retry",label:be.retry}]}function w5(e,t,n,r,a){var b,y,k,S,E,j,N,A,T,P,C,R,$,H;const i=t.answers,l=n?{reopened:!0}:{};if(e==="source")return{id:e,kind:"choice",prompt:be.source,options:[{id:"photos",label:be.addPictures},{id:"guided",label:be.guideMe}],given:((b=i.source)==null?void 0:b.door)==="words"?void 0:((y=i.source)==null?void 0:y.door)==="shot"?"photos":(k=i.source)==null?void 0:k.door,note:((S=i.source)==null?void 0:S.door)==="words"?i.source.text:void 0,...l};if(e==="photos")return{id:e,kind:"photos",prompt:be.photos,hashes:((E=i.photos)==null?void 0:E.hashes)??[],max:4,busy:r>0,submit:be.readThem,back:be.guideInstead,drop:be.photosDrop,...l,...a&&a.any!==!1&&!((j=i.photos)!=null&&j.hashes.length)&&r===0&&!n?{instead:be.fromShot,...a.any===null?{insteadWaiting:!0}:{}}:{}};if(e==="shot"){const D=(a==null?void 0:a.query.trim())??"";return{id:e,kind:"pick",prompt:be.shot,items:(a==null?void 0:a.items)??[],given:(N=i.shot)==null?void 0:N.id,search:{label:be.shotSearch,value:(a==null?void 0:a.query)??""},more:(a==null?void 0:a.more)??!1,loading:(a==null?void 0:a.loading)??!1,empty:a!=null&&a.error?be.shotsFailed:D?be.shotNotFound(D):be.shotNone,status:Vte(a),back:n?void 0:be.backToPictures,...l}}if(e==="reuse"){const D=((T=(A=i.shot)==null?void 0:A.scene)==null?void 0:T.name)??"";return{id:e,kind:"choice",prompt:be.madeIn(D),options:[{id:"use",label:be.takeScene(D)},{id:"read",label:be.readNew}],given:i.reuse,...l}}const u=i[e],f=e==="light"?(C=xo("world",(P=i.world)==null?void 0:P.pick))==null?void 0:C.light:void 0,h=e==="surface"&&!!xo("world",(R=i.world)==null?void 0:R.pick),p=(u==null?void 0:u.pick)===ni||u==null?void 0:u.pick,g=(u==null?void 0:u.pick)===ni,v=u==null?void 0:u.words,w=(($=i.source)==null?void 0:$.door)==="words";return{id:e,kind:"swatches",prompt:tR(e,i),row:nte(e,(H=i.world)==null?void 0:H.pick),layout:e==="world"?"grid":void 0,hint:e==="world"&&!w?be.worldHint:void 0,skip:f?be.keepWorldLight:h?be.keepWorldSurface:e==="signature"&&!w?be.suggestOne:w?be.leaveToReading:be.skip,describe:be.describeInstead,given:p,skipped:g,note:v,...l}}function tR(e,t){var r,a,i;const n=e==="light"?(a=xo("world",(r=t.world)==null?void 0:r.pick))==null?void 0:a.light:void 0;if(n)return be.worldLightPrompt(n);if(((i=t.source)==null?void 0:i.door)==="words"){if(e==="world")return be.followWorld;if(e==="light")return be.followLight}return al[e].prompt}function Ute(e,t){var n,r;return e==="source"?be.source:e==="photos"?be.photos:e==="shot"?be.shot:e==="reuse"?be.madeIn(((r=(n=t.shot)==null?void 0:n.scene)==null?void 0:r.name)??""):tR(e,t)}function Wte(e,t){var f,h,p,g,v,w,b,y,k,S,E;if(e==="source")return((f=t.source)==null?void 0:f.door)==="words"?{text:t.source.text??""}:((h=t.source)==null?void 0:h.door)==="shot"?{text:be.fromShotAnswer}:{text:((p=t.source)==null?void 0:p.door)==="photos"?be.addPictures:be.guideMe};if(e==="shot")return{text:be.shotAnswer,photos:t.shot?[t.shot.hash]:[]};if(e==="reuse")return{text:be.readNew};if(e==="photos"){const j=((g=t.photos)==null?void 0:g.hashes.length)??0;return{text:`${j} ${j===1?"picture":"pictures"}`,photos:(v=t.photos)==null?void 0:v.hashes}}const n=t[e],r=e==="light"&&(n==null?void 0:n.pick)===ni&&((b=xo("world",(w=t.world)==null?void 0:w.pick))==null?void 0:b.light),a=e==="surface"&&(n==null?void 0:n.pick)===ni&&!!xo("world",(y=t.world)==null?void 0:y.pick),i=r?be.keepWorldLight:a?be.keepWorldSurface:((k=t.source)==null?void 0:k.door)==="words"?be.leaveToReading:e==="signature"?be.suggestOne:be.skip,l=(n==null?void 0:n.pick)===ni?i:(S=xo(e,n==null?void 0:n.pick))==null?void 0:S.label,u=(E=n==null?void 0:n.words)==null?void 0:E.trim();return{text:l&&u?`${l}, ${u}`:u??l??""}}const y5=(e,t)=>e.at<t.at?-1:e.at>t.at?1:0,Kte=e=>{const t=Mr(e);return t?`${t.hash?"decide":"agree"}-${e.current}`:null};function Gte(e){var v,w,b,y;const{setup:t,studio:n,edit:r}=e,a=t.answers,i=[],l=new Set,u=k=>{for(const S of t.asides.filter(E=>E.q===k&&!l.has(E)).sort(y5))l.add(S),i.push(...ci(S))};r?i.push({kind:"scenri",id:"edit-open",text:be.editOpen(r.name)}):i.push({kind:"you",id:"intent",text:be.intent});const f=r?null:BM(a);if(!r)for(const k of hte(a)){if(i.push({kind:"scenri",id:`asked-${k}`,text:Ute(k,a),quiet:!0}),u(k),t.editing===k){i.push({kind:"question",question:w5(k,t,!0,e.uploading,e.shots)});continue}const S=Wte(k,a);i.push({kind:"you",id:k,text:S.text,photos:S.photos,editable:!n.job&&!n.saved})}const h=n.versions.findIndex(k=>!!k.hash);n.versions.forEach((k,S)=>{if(k.how==="read"&&S>0&&i.push({kind:"scenri",id:`reread-${S}`,text:be.readAgain}),k.how==="change"&&i.push({kind:"you",id:`ask-${S}`,text:k.ask??""}),k.hash&&(k.how==="draw"&&i.push({kind:"you",id:`draw-${S}`,text:be.draw}),k.how==="again"&&i.push({kind:"you",id:`again-${S}`,text:be.tryAgain}),S===h&&!r&&b5(i,e),i.push({kind:"scenri",id:`pic-${S}`,text:k.how==="change"?be.changed:k.how==="again"?be.again:be.here,thumb:qM(k)??k.hash,label:be.version(jte(n,S)),view:"scene",current:S===n.current,restore:S===n.current||n.saved?void 0:{view:"scene",hash:k.hash}})),S===n.current)for(const[E,j]of k.coverage.entries())i.push({kind:"scenri",id:`cover-${S}-${E}`,text:j});u(`agree-${S}`),u(`decide-${S}`)});const p=n.job;(p==null?void 0:p.kind)==="again"&&i.push({kind:"you",id:`pending-${p.id}`,text:h<0?be.draw:be.tryAgain}),(p==null?void 0:p.kind)==="change"&&i.push({kind:"you",id:`pending-${p.id}`,text:p.ask??""}),(p==null?void 0:p.kind)==="again"&&h<0&&!r&&b5(i,e),n.saved&&Yte(i,e);let g=null;if(f)g=w5(f,t,!1,e.uploading,e.shots);else if(p){if(p.kind==="again"&&h<0&&!n.named&&!e.editingName){const k=((w=p.pending??((v=Mr(n))==null?void 0:v.reading))==null?void 0:w.name)??n.name;g={id:"name",kind:"text",prompt:be.name,starters:k?[{label:k,text:k}]:void 0}}}else if(n.saved)g=qte(e);else{const k=Mr(n);if(e.stale&&!r)n.error&&(g={id:"retry",kind:"confirm",...w8(n.error),prompt:g5(n.error),options:v5(n.error)});else if(!k&&n.error)g={id:"retry",kind:"confirm",...w8(n.error),prompt:g5(n.error),options:v5(n.error)};else if(k){n.error&&i.push({kind:"scenri",id:`error-${n.versions.length}`,text:zte(n.error),...w8(n.error)});const S=Zte(k.reading);if(k.hash){const E=!!r&&!r.changed;g={id:`decide-${n.current}`,kind:"confirm",prompt:E?be.decideSaved:(r?be.decideEdit:be.decide)(n.name.trim()||k.reading.name),quote:S,quoteLabel:be.readingHead,...k.how==="draw"||k.how==="again"?{quoteFolded:!0}:{},options:[...r4(n.error),...E?[]:[{id:"use",label:r?be.saveChanges:be.use}],...e.canDraw?[{id:"again",label:be.tryAgain}]:[]],...E?{quiet:!0}:{},describe:be.changeSomething}}else{const E=!r&&((b=a.source)==null?void 0:b.door)==="photos",j=!r&&((y=a.source)==null?void 0:y.door)==="shot",N=j?[{id:"another-shot",label:be.anotherShot}]:[],A=k.how==="change"?be.agreeChanged:E?be.agreePhotos:j?be.agreeShot:be.agree;g={id:`agree-${n.current}`,kind:"confirm",prompt:e.canDraw?k.reading.hero==="place"?A:`${A} ${be.drawsTwo}`:be.agreeBlind,quote:S,quoteLabel:be.readingHead,options:[...r4(n.error),...e.canDraw?[{id:"draw",label:be.draw}]:[{id:"use",label:r?be.saveChanges:be.saveWords}],...N]}}}}for(const k of t.asides.filter(S=>!l.has(S)).sort(y5))i.push(...ci(k));return e.note&&i.push({kind:"scenri",id:`note-${e.note.length}-${e.note.slice(0,12)}`,text:e.note}),g&&i.push({kind:"question",question:g}),i}function Yte(e,t){const{studio:n,edit:r,set:a,canDraw:i}=t;if(e.push({kind:"you",id:"use",text:r?be.saveChanges:i?be.use:be.saveWords}),!a)return;const l=nR(t),u=a.tiles.filter(v=>!(v.role==="hero"&&v.hash===l)),f=u.length>0||a.running;e.push({kind:"scenri",id:"saved",text:f?be.inUse(a.who):a.read&&a.noSubject&&i?be.noLibrary:a.read&&i&&a.first.length?be.savedQuiet:be.saved}),(n.setDrawn||n.setDeclined)&&e.push({kind:"you",id:"set-start",text:n.setDrawn?a.stale?be.drawThemAgain:l?be.drawIt:be.drawThem:be.notNow});const h=n.moreAsked?be.addThem:n.moreDeclined?be.notNow:null;let p=!1;const g=()=>{!h||p||(p=!0,e.push({kind:"you",id:"more",text:h}))};for(const v of u)if(v.role!=="hero"&&v.role!=="close"&&g(),v.state==="shown"&&v.hash)e.push({kind:"scenri",id:`ex-${v.role}-${v.hash}`,text:be.exampleHere[v.role],thumb:v.hash,label:Za[v.role],view:v.role,...a.running||n.job?{}:{retry:v.role}});else if(v.state==="failed"){const w=v.error?hm(v.error):null;e.push({kind:"scenri",id:`ex-failed-${v.role}`,text:w?be.exampleFailedSaid(Za[v.role],w):be.exampleFailed(Za[v.role],v.error??be.failed),tone:"alert"})}g()}function qte(e){var u;const{set:t,studio:n}=e,r=n.name.trim()||((u=Mr(n))==null?void 0:u.reading.name)||"The scene";if(!t||t.running||!t.read)return null;const a=nR(e);if(e.canDraw&&t.first.length&&!n.setDrawn&&!n.setDeclined){const f=t.first.map(h=>Za[h]);return{id:"set-start",kind:"confirm",prompt:t.stale?be.staleSet(t.first.length):a?be.moreViews(f):be.showInUse(t.who,f),options:[{id:"draw-set",label:t.stale?be.drawThemAgain:t.first.length===1?be.drawIt:be.drawThem},{id:"not-now",label:be.notNow}]}}const i=t.tiles.some(f=>f.role==="hero"&&f.state==="shown");if(e.canDraw&&i&&t.missing.length&&!n.setDeclined&&!n.moreDeclined&&!n.moreAsked)return{id:"set-more",kind:"confirm",prompt:be.more(t.missing.map(f=>Za[f])),options:[{id:"more",label:be.addThem},{id:"not-now",label:be.notNow}]};const l=t.tiles.filter(f=>f.state==="failed");return{id:"set-done",kind:"confirm",prompt:l.length?be.readyMissing(r):t.tiles.length?be.ready(r):be.readyUndrawn(r),options:[...l.length&&e.canDraw?[{id:"retry-failed",label:be.tryAgain}]:[],{id:"done",label:t.finish}]}}function nR(e){var n,r;const t=((n=Mr(e.studio))==null?void 0:n.hero)??null;return t&&((r=e.set)!=null&&r.tiles.some(a=>a.role==="hero"&&a.state==="shown"&&a.hash===t))?t:null}function b5(e,t){if(!t.studio.named&&!t.editingName)return;e.push({kind:"scenri",id:"asked-name",text:be.name,quiet:!0});const n=!t.studio.saved;e.push({kind:"you",id:"name",text:t.studio.name,editable:n,editing:t.editingName||void 0})}function Xte(e,t){var l,u,f;const{setup:n,studio:r}=e,a=(h,p=!1)=>({target:{kind:"off",why:h},placeholder:"",label:be.lineLabel,action:be.send,working:p,attach:!1});if(r.saved){const h=!!r.job||!!((l=e.set)!=null&&l.running);return a(t&&!h?be.usedOff:"",h)}const i=n.editing;return i==="source"?_o({kind:"source"},be.sourcePlaceholder,!0):i&&cp(i)?_o({kind:"row",id:i},be.rowPlaceholder(s5(i))):i==="photos"?a(be.photosOff):i==="shot"?a(be.shotOff):i==="reuse"?a(be.reuseOff):!t&&!r.job&&n.answers.source&&!UM(n.answers)?_o({kind:"source"},be.nothingSaidPlaceholder,!0):t?t.id==="source"?_o({kind:"source"},be.sourcePlaceholder,!0):t.id==="photos"?{...a(be.photosOff),attach:!0}:t.id==="shot"?a(be.shotOff):t.id==="reuse"?a(be.reuseOff):cp(t.id)?_o({kind:"row",id:t.id},be.rowPlaceholder(s5(t.id))):t.id==="name"?_o({kind:"name"},be.namePlaceholder):t.id==="retry"?_o({kind:"source"},be.nothingSaidPlaceholder,!0):t.id.startsWith("agree-")?e.canDraw?_o({kind:"add"},e.edit?be.addPlaceholder:((u=n.answers.source)==null?void 0:u.door)==="photos"?be.keepPlaceholder:((f=n.answers.source)==null?void 0:f.door)==="shot"?be.keepShotPlaceholder:be.addPlaceholder):a(""):t.id.startsWith("decide-")?{..._o({kind:"change"},be.changePlaceholder),action:be.change}:a(""):r.job?a("",!0):a("")}function _o(e,t,n=!1){return{target:e,placeholder:t,label:t,action:be.send,working:!1,attach:n}}const Qte=/\b(studio|room|lobby|hall|beach|forest|desert|street|city|kitchen|bathroom|bedroom|office|garden|park|field|mountain|shore|sea|ocean|lake|river|cave|rooftop|roof|terrace|warehouse|loft|gallery|museum|church|hotel|restaurant|caf[eé]|bar|shop|store|market|set|stage|backdrop|wall|floor|marble|concrete|wood|stone|light|dusk|dawn|night|sun|neon|fog|rain|snow|sand|water|glass|metal|plaster|fabric|interior|outdoors?|indoors?|landscape|pool|library|station|tunnel|bridge|corridor|courtyard|balcony|window|sky|cyclorama|cyc|seamless|brutalist|minimal)\b/i,rR=e=>Qte.test(e)||e.trim().split(/\s+/).length>=5&&!/\?\s*$/.test(e);function x5(e,t){switch(e){case"greeting":case"ack":return t==="source"?be.greet:be.greetRow;case"question":case"help":return be.askHelp;case"nav":return be.startOverIsUp;case"go":return t==="source"?be.goFirst:be.greetRow;default:return be.notAPlace}}function k5(e,t){if(t==="source"){const r=Ko(e,rR);return r==="vague"?null:r}const n=Ko(e,()=>!1);return n==="vague"||n==="intent"||n==="likeness"?null:n}const sR=2;function Jte(e,t){return JSON.stringify({v:sR,setup:wte(e),studio:Fte(t)})}function aR(e){if(!e)return null;try{const t=JSON.parse(e);return(t==null?void 0:t.v)!==sR?null:{setup:bte(t.setup),studio:_te(typeof t.studio=="string"?t.studio:null)}}catch{return null}}const xw=e=>`scenri:scene-studio:${e}:`;function ene(e,t){var f,h,p;if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(n!=null&&n.sceneId)return null;const r=aR(typeof(n==null?void 0:n.session)=="string"?n.session:null),a=r==null?void 0:r.studio;if(!a||!QM(a))return null;const i=[a.versions[a.current],...[...a.versions].reverse()].find(g=>g==null?void 0:g.hash),l=Mr(a),u=a.place.trim().split(/\s+/).slice(0,5).join(" ");return{convo:e,name:a.name.trim()||(l==null?void 0:l.reading.name)||((h=(f=a.job)==null?void 0:f.pending)==null?void 0:h.name)||u,hash:(i==null?void 0:i.hash)??null,drawing:!!a.job,failed:!a.job&&!!a.error,read:a.versions.length>0,jobId:((p=a.job)==null?void 0:p.id)??null,at:Number(n.at)||0}}function tne(e,t,n=nne()){const r=new Map(t.filter(l=>l.kind==="scene").map(l=>[l.id.slice(6),l])),a=e.map(l=>{const u=l.jobId?r.get(l.jobId):void 0;return u?l.drawing?{...l,name:l.name||u.name,hash:u.status==="done"&&u.thumb?u.thumb:l.hash,drawing:u.status==="running",failed:u.status==="failed"}:l:{...l,drawing:!1}}),i=new Set([...e.map(l=>l.convo),...n]);for(const l of t)l.kind!=="scene"||l.status!=="running"||!l.conversation||l.sceneId||i.has(l.conversation)||(i.add(l.conversation),a.push({convo:l.conversation,name:l.name,hash:null,drawing:!0,failed:!1,read:!1,jobId:l.id.slice(6),at:Date.parse(l.startedAt)||0}));return a.filter(l=>l.drawing||l.hash||l.failed||l.read).sort((l,u)=>u.at-l.at)}function nne(){var t;const e=[];for(const n of xr.keys("scenri:scene-studio:"))try{(t=JSON.parse(xr.get(n)??"null"))!=null&&t.sceneId&&e.push(n.slice(n.lastIndexOf(":")+1))}catch{}return e}function rne(e){return e.drawing?"Drawing":e.hash?"Drawn, not used yet":e.failed?"Did not finish":"Not drawn yet"}function Lh(e){const t=xw(e);return xr.keys(t).map(n=>ene(n.slice(t.length),xr.get(n))).filter(n=>!!n)}function sne(e,t){xr.set(e,JSON.stringify({at:Date.now(),sceneId:t,done:!0}))}function ane(e,t){try{const n=JSON.parse(xr.get(`${xw(e)}${t}`)??"null");return(n==null?void 0:n.done)===!0&&typeof n.sceneId=="string"?n.sceneId:null}catch{return null}}function one(e,t){const n=`${xw(e)}${t}`;xr.del(n),Wi(n)}function ine(e,t,n,r){const a=WQ(e,n)||e==="presenter"&&!!r;switch(e){case"first-shot":case"reuse":return t.onHub?{kind:"stay"}:a?{kind:"hub"}:{kind:"head"};case"refine":return t.onShot||t.onHub?{kind:"stay"}:a?{kind:"hub"}:{kind:"head"};case"presenter":return r||n.some(i=>i==="start"||i==="face"||i==="save")?t.onStudio?{kind:"stay"}:{kind:"studio"}:t.onStudio||t.onPresenters?{kind:"stay"}:a?{kind:"presenters"}:{kind:"head"};case"product":return a&&n.includes("product")?{kind:"dialog",asset:"product"}:t.onProducts?{kind:"stay"}:a?{kind:"products"}:{kind:"head"};case"scene":return a&&n.some(i=>i==="start"||i==="words"||i==="use")?t.onSceneStudio?{kind:"stay"}:{kind:"sceneStudio"}:t.onSceneStudio||t.onScenes?{kind:"stay"}:a?{kind:"scenes"}:{kind:"head"}}}function oR(){const{brand:e,recent:t,products:n}=dn(),r=_n(),a=wl(),i=!!gn(pt.hub),l=!!gn(pt.hubShot),u=!!gn(pt.products),f=!!gn(pt.scenes),h=!!gn(pt.presenters),p=!!gn(pt.presenterStudio),g=!!gn(pt.sceneStudio);return s.useCallback(async v=>{var j,N;const w=t.find(A=>A.kind!=="root"&&A.status==="done"&&A.images.length>0),b=v==="refine"&&!w?"first-shot":v==="reuse"&&n.length===0?"product":v,y=Nh().active;(y==null?void 0:y.task)===b&&y.brandId===e.id&&!y.paused||await Bl({start:{task:b,brandId:e.id}});const k=((N=(j=Nh().progress)==null?void 0:j[b])==null?void 0:N.reached)??[],S=Nh().activeDraftId,E=ine(b,{onHub:i,onShot:l,onProducts:u,onScenes:f,onPresenters:h,onStudio:p,onSceneStudio:g},k,S);switch(E.kind!=="head"&&L6(),E.kind){case"stay":try{window.localStorage.removeItem(P6(e.id,b)),(b==="first-shot"||b==="reuse")&&window.localStorage.removeItem(MA(e.id))}catch{}return(b==="first-shot"||b==="reuse")&&i?r(yr(e)):void 0;case"head":return RA(e.id,b);case"hub":return r(yr(e));case"products":return r(Du(e));case"scenes":return r(qi(e));case"presenters":return r(Xo(e));case"studio":return r(Qi(e,S));case"sceneStudio":{const A=Lh(e.id).sort((T,P)=>P.at-T.at)[0];return r(Xi(e,(A==null?void 0:A.convo)??null))}case"dialog":return a(E.asset)}},[e,t,n,r,a,i,l,u,f,h,p,g])}const lne=Number(window.localStorage.getItem("scenri:welcome-settle-ms")??900),cne='[role="dialog"]:not(.sc-coach):not(.sc-attachpanel):not(.sc-swap), [role="alertdialog"], .sc-lightbox',une=["settings","setup","new","whatsnew","learn","welcome"],dne='[data-guide="compose"] .sc-attachpanel';function fne(){var Ue,ut,gt,Pt,tt,wt,Ce;const e=Fv(),t=mM(),n=Hn(),{brand:r,recent:a,subscribeActivity:i,products:l,importing:u}=dn(),{tasks:f,builds:h}=Ca(),{push:p}=cr(),g=oR(),v=_n(),[w]=ll(),b=Vr("new"),y=!!gn(pt.brand),k=!!gn(pt.hub),S=((Ue=gn(pt.hubShot))==null?void 0:Ue.params.shotId)??null,E=!!gn(pt.presenterStudio),j=!!gn(pt.sceneStudio),N=!!gn(pt.products),A=!!gn(pt.scenes),T=!!gn(pt.presenters),P=e.active,C=P&&P.brandId===r.id?P.task:null,R=C&&!(P!=null&&P.paused)?C:null,$=R==="first-shot"||R==="reuse"?"generation":R==="refine"?"edit":null,H=e.loaded&&e.eligible&&e.welcome===null,[D,q]=s.useState(e.activeNodes);s.useEffect(()=>q(e.activeNodes),[e.activeNodes]),s.useEffect(()=>{if(!(!$||!P))return i(xe=>q(et=>HQ(et,xe,P.since,$)))},[$,P,i]);const _=!!((ut=t.composer)!=null&&ut.busy),U=s.useRef(!1),[Y,I]=s.useState(!1);s.useEffect(()=>{U.current&&!_&&$&&(I(!0),Ug().finally(()=>I(!1))),U.current=_},[_,$]);const[,F]=s.useState(0),O=s.useRef(0),Z=s.useCallback(()=>{cancelAnimationFrame(O.current),O.current=requestAnimationFrame(()=>F(xe=>xe+1))},[]);s.useEffect(()=>{if(!R&&!H)return;const xe=new MutationObserver(Z);return xe.observe(document.body,{childList:!0,subtree:H}),window.addEventListener("resize",Z),()=>{cancelAnimationFrame(O.current),xe.disconnect(),window.removeEventListener("resize",Z)}},[R,H,Z]);const[V,B]=s.useState(()=>!document.hidden);s.useEffect(()=>{const xe=()=>B(!document.hidden);return document.addEventListener("visibilitychange",xe),()=>document.removeEventListener("visibilitychange",xe)},[]);const K=!!R||H,ee=une.some(xe=>w.has(xe)),se=K&&(ee||[...document.querySelectorAll(cne)].some(xe=>!xe.closest("[data-radix-popper-content-wrapper], .sc-shotsheet"))),oe=w.get("new"),me=R?`scenri:guide-begun:${r.id}:${R}`:null,[ce,we]=s.useState(!1);s.useEffect(()=>{we(!!me&&window.localStorage.getItem(me)==="1")},[me]);const G=s.useCallback(()=>{if(me)try{window.localStorage.setItem(me,"1")}catch{}we(!0)},[me]),ue=e.heading,Ne=xe=>!!xe&&(ue==null?void 0:ue.brandId)===r.id&&ue.task===xe&&!se,ne=xe=>xe==="first-shot"||xe==="reuse"||xe==="refine"?k:xe==="product"?N:xe==="scene"?A:xe==="presenter"?T||E:!1,[Fe,Oe]=s.useState(!1);s.useEffect(()=>{let xe=!1;try{xe=!!R&&window.localStorage.getItem(P6(r.id,R))==="1"}catch{}Oe(xe)},[R,r.id,ue]),s.useEffect(()=>{if(!(!ue||ue.brandId!==r.id)&&ne(ue.task)){try{window.localStorage.setItem(P6(r.id,ue.task),"1")}catch{}Oe(!0),(ue.task==="first-shot"||ue.task==="reuse")&&G(),L6()}},[ue,k,N,A,T,E,r.id,G]);const ot=s.useRef(null);s.useEffect(()=>{const xe=ot.current;!xe||ne(xe)||(ot.current=null,RA(r.id,xe))},[k,N,A,T,E,r.id]),s.useEffect(()=>{e.loaded&&!C&&ue&&L6()},[e.loaded,C,ue]);let Xe=null;if(R==="first-shot"||R==="reuse"){const xe=((gt=t.composer)==null?void 0:gt.brandId)===r.id?t.composer:null,et=k&&Ne(R),yt={here:k&&!se,heading:Ne(R)&&!k,composer:xe&&Y?{...xe,busy:!0}:xe,nodes:D,begun:ce||et||D.length>0};Xe=R==="reuse"?lM(yt):iM(yt)}else if(R==="refine"){const xe=((Pt=t.composer)==null?void 0:Pt.brandId)===r.id?t.composer:null,et=!!S;Xe=AQ({here:et||k&&!se,heading:Ne(R)&&!k&&!et,open:et,armed:k&&!!(xe!=null&&xe.refining),nodes:D,asking:et?!!Vl(uM):!!Vl(ep)})}else R==="presenter"?Xe=dM({heading:Ne(R)&&!T&&!E,onPage:T&&!E&&!se,studio:E?t.studio:null}):R==="scene"?Xe=MQ({heading:Ne(R)&&!A&&!j,onPage:A&&!j&&!se,studio:j?t.studio:null}):R==="product"&&(Xe=RQ({heading:Ne(R)&&!N,onPage:N&&!se&&oe!=="product",dialogOpen:oe==="product"}));const X=((tt=t.composer)==null?void 0:tt.brandId)===r.id?t.composer:null,J=R==="first-shot"&&X?cM(X):R==="reuse"&&X?X.products===0?"product":X.scene?null:"scene":null,ge=!!((wt=t.composer)!=null&&wt.pickerOpen);s.useEffect(()=>{ge&&(R==="first-shot"&&!J?window.dispatchEvent(new Event("scenri:guide-close-picker")):J&&window.dispatchEvent(new CustomEvent("scenri:guide-picker",{detail:{tab:yk[J]}})))},[R,ge,J]),s.useEffect(()=>{R==="first-shot"&&!J&&window.dispatchEvent(new CustomEvent("scenri:guide-picker",{detail:{tab:null}}))},[R,J]),s.useEffect(()=>{if(R)return document.documentElement.dataset.guideTask=R,()=>{delete document.documentElement.dataset.guideTask}},[R]);const ve=(Xe==null?void 0:Xe.point)===dne&&window.innerWidth<1024;if(s.useEffect(()=>{if(ve)return document.documentElement.dataset.guidePicker="",()=>{delete document.documentElement.dataset.guidePicker}},[ve]),R&&Xe&&Xe.voice!=="quiet"){const xe=KQ(R,Xe.id);xe&&(Xe={...Xe,...xe})}const Ze=R&&Xe&&Xe.voice!=="quiet"?Xe.id:null,Ye=s.useRef("");s.useEffect(()=>{var et,yt;if(!R||!Ze)return;const xe=`${R}:${Ze}`;Ye.current!==xe&&(Ye.current=xe,!((yt=(et=e.progress)==null?void 0:et[R])!=null&&yt.reached.includes(Ze))&&Bl({reached:{task:R,moment:Ze}}))},[R,Ze,e.progress]);const ke=Xe,te=s.useRef(new Set),le=s.useCallback(xe=>{te.current.add(xe),Bl({finish:xe})},[]),Me=s.useCallback(xe=>{Bl({dismiss:xe}),p({kind:"info",title:"Guide closed",detail:"Continue it any time from Learn."})},[p]);s.useEffect(()=>{R==="first-shot"&&S&&D.some(xe=>xe.id===S&&xe.status==="done"&&xe.images>0)&&le("first-shot")},[R,S,D,le]),s.useEffect(()=>{R==="refine"&&S&&Ug()},[R,S]);const ze=s.useRef(!1);s.useEffect(()=>{if(R!=="refine"){ze.current=!1;return}S?ze.current=!0:ze.current&&(ze.current=!1,le("refine"))},[R,S,le]);const Re=C==="presenter"||C==="scene"||C==="product",Be=h.filter(xe=>!xe.finished).length;s.useEffect(()=>{Re&&Ug()},[Re,r,l.length,Be,u]),s.useEffect(()=>{Re&&e.counts&&LQ(e,e.counts)&&le(P==null?void 0:P.task)},[Re,e,P,le]);const Qe=!!((Ce=t.overlay)!=null&&Ce.engaged);s.useEffect(()=>{if(!e.loaded||!e.eligible)return;const xe={eligible:e.eligible,hidden:e.hidden,done:e.done,dismissed:e.dismissed,active:P},yt=!!S&&Qe&&a.some(Q=>Q.id===S&&Q.status==="done")&&ah("refine",xe)?"refine":j&&ah("scene",xe)?"scene":oe==="product"&&ah("product",xe)?"product":E&&ah("presenter",xe)?"presenter":null;!yt||te.current.has(yt)||(te.current.add(yt),Bl({start:{task:yt,brandId:r.id}}))},[e,P,S,Qe,a,oe,E,j,r.id]);const[rt,_e]=s.useState(""),zt=s.useRef(ke);zt.current=ke;const Et=s.useCallback((xe,et)=>{if(_e(""),et)return;const yt=zt.current,Q=yt?[yt.title,yt.body].filter(Boolean).join(". "):"";Q&&requestAnimationFrame(()=>_e(Q))},[]),[Zt,He]=s.useState(!1),mt=Vr("welcome"),vt=mt.value!==null,St=y&&n.showcaseLoaded||k,kt=h.some(xe=>!xe.finished)||f.some(xe=>xe.state==="running"&&xe.kind!=="catalog"),Nt=TQ({onMainPage:y||k,eligible:e.eligible,welcome:e.welcome,ready:St&&!document.querySelector('[data-variant="skeleton"]'),visible:V,blocked:se,busy:kt});s.useEffect(()=>{if(!Nt)return;const xe=window.setTimeout(()=>He(!0),lne);return()=>window.clearTimeout(xe)},[Nt]);const Bt=s.useMemo(()=>DQ(n.showcase).map(xe=>hne(xe.previewUrl)),[n.showcase]),at=n.engines.some(xe=>xe.available),Mt=l.length>0,ft=ke&&(ke.voice==="ask"||ke.voice==="note")?ke:null,vn=ft!=null&&ft.shell?Vl(ft.shell):document.body,Qt=ft!=null&&ft.point?Vl(ft.point):null,on=(ft==null?void 0:ft.live)??(ft!=null&&ft.point?[ft.point]:[]),Rt=on.map(xe=>Vl(xe)).filter(xe=>!!xe),An=((ft==null?void 0:ft.also)??[]).map(xe=>Vl(xe)).filter(xe=>!!xe),Vt=((ft==null?void 0:ft.lit)??[]).map(xe=>Vl(xe)).filter(xe=>!!xe),re=!!ft&&!!vn&&(!ft.point||!!Qt)&&Rt.length===on.length,ae=ft&&!re?ft:null,fe=Zt||re;s.useEffect(()=>Ek(fe),[fe]),s.useEffect(()=>()=>Ek(!1),[]),s.useEffect(()=>{if(!ae)return;const xe=(ae.shell?document.querySelector(ae.shell):null)??document.querySelector(".sc-feed")??document.body,et=new MutationObserver(Z);return et.observe(xe,{childList:!0,subtree:!0}),()=>et.disconnect()},[ae==null?void 0:ae.id,ae==null?void 0:ae.shell,Z]);const Te=xe=>{R&&(xe.done?le(R):Me(R))};return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-vh",role:"status","aria-live":"polite",children:rt}),ft&&re&&o.jsx(zJ,{id:ft.id,voice:ft.voice,target:Qt,live:Rt,also:An,lit:Vt,side:ft.side??"top",beside:ft.beside,soft:ft.soft,container:vn,title:ft.title,body:ft.body,at:ft.at,of:ft.of,canBack:PQ(R,ft.id,Fe||!!(k&&Ne(R))),action:ft.start?{label:"Start"}:ft.done?{label:"Done"}:null,closeLabel:ft.done?"Close":"Close guide",onBack:()=>{const xe=R?hM(R,ft.id):null;if(xe){window.dispatchEvent(new CustomEvent("scenri:guide-take-back",{detail:{kind:xe}})),window.dispatchEvent(new CustomEvent("scenri:guide-picker",{detail:{tab:yk[xe]}}));return}if(R==="presenter"&&(ft.id==="start"||ft.id==="face"||ft.id==="save"))return v(Xo(r),{replace:!0});if((R==="product"||R==="scene")&&ft.id===R)return b.close();if(R==="refine"&&ft.id==="ask"){if(S)return v(yr(r),{replace:!0});window.dispatchEvent(new Event("scenri:guide-clear-refine"));return}if(Fe&&R&&(ft.id==="new"||ft.id==="choose"||ft.id==="product"))return window.dispatchEvent(new Event("scenri:guide-close-picker")),ot.current=R,v(Eo(r))},onAction:()=>{if(ft.start)return G();ft.done&&R&&le(R)},onClose:()=>Te(ft),onEscape:()=>Te(ft),onShown:Et,onLost:Z}),o.jsx(YQ,{open:Zt||vt,pictures:Bt,note:Nu.note({engineReady:at,ownsProducts:Mt}),onTake:()=>{const xe=Zt;He(!1),vt&&mt.close(),xe?Bl({welcome:"taken"}).then(()=>g("first-shot")):window.setTimeout(()=>void g("first-shot"),0)},onDecline:()=>{const xe=Zt;He(!1),vt&&mt.close(),xe&&Bl({welcome:"declined"})}})]})}function Vl(e){for(const t of document.querySelectorAll(e))if(t.getClientRects().length>0)return t;return null}function hne(e){return`${e}${e.includes("?")?"&":"?"}w=320`}const pne="lessons";function mne(){var I;const e=Vr("learn"),t=e.value!==null,n=zQ(e.value),r=Sr(ta),a=Fv(),i=mM(),{brand:l,recent:u,products:f}=dn(),h=oR(),[p,g]=s.useState(null);s.useEffect(()=>{t||!p||(g(null),h(p))},[t,p,h]);const v=s.useRef(!1),w=F=>{v.current=!0,g(F),e.close()},b=s.useRef(null);s.useEffect(()=>{t&&(b.current=$6.current,$6.current=null)},[t]);const y=()=>{const F=v.current;if(v.current=!1,F)return;const O=b.current==="help";requestAnimationFrame(()=>{var B;if(document.activeElement!==document.body)return;const Z=O?".sc-help-btn":".sc-learn-btn",V=O?".sc-learn-btn":".sc-help-btn";(B=document.querySelector(Z)??document.querySelector(V))==null||B.focus()})},k=!!gn(pt.hub),S=!!gn(pt.presenterStudio),E=!!gn(pt.presenters),j=F=>{var O;return((O=a.heading)==null?void 0:O.brandId)===l.id&&a.heading.task===F},N=((I=a.active)==null?void 0:I.brandId)===l.id&&!a.active.paused?a.active.task:null,A=u.some(F=>F.kind!=="root"&&F.status==="done"&&F.images.length>0),T=F=>F.needs==="shot"&&!A||F.needs==="product"&&f.length===0?F.needs??null:null,P=F=>{var K,ee,se,oe,me,ce;const O=((ee=(K=a.progress)==null?void 0:K[F.id])==null?void 0:ee.reached)??[];if(N!==F.id)return Ck(F.id,O,null);const Z=((se=i.composer)==null?void 0:se.brandId)===l.id?i.composer:null,V={here:k,heading:j(F.id),composer:k?Z:null,nodes:a.activeNodes,begun:!0},B=F.id==="first-shot"?((oe=iM(V))==null?void 0:oe.id)??null:F.id==="reuse"?((me=lM(V))==null?void 0:me.id)??null:F.id==="presenter"?((ce=dM({heading:j("presenter"),onPage:E&&!S,studio:S?i.studio:null}))==null?void 0:ce.id)??null:null;return Ck(F.id,O,{moment:B,nodes:a.activeNodes,draft:!!a.activeDraftId})},C=F=>BQ(F.id,a,l.id,P(F)),R=UQ(Zi,C),$=n??R??Zi[0],H=Zi.filter(F=>C(F)==="done").length;s.useEffect(()=>{if(t)for(const F of Object.values(q6))new Image().src=F.wide},[t]);const D=s.useRef(null),q=s.useRef(new Map),_=s.useRef(null),U=s.useRef(!1);s.useEffect(()=>{var Z;const F=t&&!U.current;if(U.current=t,!t)return;const O=()=>{var V,B;(V=D.current)==null||V.focus({preventScroll:!0}),(B=D.current)==null||B.scrollIntoView({block:"nearest"})};r&&n?(_.current=n.id,O()):r&&_.current?(Z=q.current.get(_.current))==null||Z.focus({preventScroll:!0}):F&&O()},[t,r,n]);const Y=(F,O)=>o.jsx(gne,{lesson:F,state:C(F),at:P(F),blocked:T(F),describe:O,actionRef:D,onBegin:()=>w(F.id)});return o.jsx(_s,{open:t,className:"sc-learn",maxWidth:"880px",described:!0,onDismiss:e.close,onCloseAutoFocus:y,children:r&&n?o.jsxs("div",{className:"sc-learn-level",children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx("button",{type:"button",className:"sc-newdlg-back",onClick:()=>e.set(pne),"aria-label":"All lessons",children:o.jsx(Sa,{size:15})}),o.jsx(ks,{className:"sc-newdlg-title",children:n.title}),o.jsx(S5,{})]}),o.jsx("div",{className:"sc-newdlg-body sc-learn-body",children:Y(n,!0)})]},`one-${n.id}`):o.jsxs("div",{className:"sc-learn-level",children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ks,{className:"sc-newdlg-title",children:"Learn"}),o.jsxs("span",{className:"sc-learn-count",children:[H," of ",Zi.length," done"]}),o.jsx(S5,{})]}),o.jsx(md,{className:"sc-vh",children:"Each one walks you through one real thing, a step at a time."}),o.jsxs("div",{className:"sc-newdlg-body sc-learn-body",children:[o.jsx("ul",{className:"sc-learn-list",children:Zi.map(F=>o.jsx("li",{children:o.jsxs("button",{type:"button",className:"sc-learn-row","data-state":C(F),"aria-current":!r&&$.id===F.id?"true":void 0,ref:O=>{O?q.current.set(F.id,O):q.current.delete(F.id)},onClick:()=>e.set(F.id),children:[o.jsx("span",{className:"sc-learn-thumb",children:o.jsx("img",{src:q6[F.id].square,alt:"",decoding:"async"})}),o.jsxs("span",{className:"sc-learn-say",children:[o.jsx("span",{className:"sc-learn-name",children:F.title}),o.jsx(iR,{lesson:F,state:C(F),at:P(F),blocked:T(F)})]}),(R==null?void 0:R.id)===F.id&&o.jsx("span",{className:"sc-learn-next",children:"Next"})]})},F.id))}),!r&&Y($,!1)]})]},"all")})}function gne({lesson:e,state:t,at:n,blocked:r,describe:a,actionRef:i,onBegin:l}){const u=r?Y6[r].action:t==="active"?"Continue":t==="done"?"Start again":"Start",f=t==="active"?n:0,h=g=>t==="done"?"done":t==="active"?g<n?"done":g===n?"active":"todo":g===0?"active":"todo",p=a?o.jsx(md,{className:"sc-learn-summary",children:e.summary}):o.jsx("p",{className:"sc-learn-summary",children:e.summary});return o.jsxs("section",{className:"sc-learn-lesson","aria-label":e.title,children:[o.jsx("span",{className:"sc-learn-hero",children:o.jsx("img",{src:q6[e.id].wide,alt:"",decoding:"async"})}),o.jsxs("div",{className:"sc-learn-copy",children:[o.jsx("div",{className:"sc-learn-kicker",children:o.jsx(iR,{lesson:e,state:t,at:n,blocked:r})}),o.jsx("h3",{className:"sc-learn-title",children:e.title}),p,o.jsxs("div",{className:"sc-learn-do",children:[o.jsx("ol",{className:"sc-learn-steps",children:gM(e).map((g,v)=>{const w=h(v),b=o.jsx("span",{className:"sc-learn-n","aria-hidden":"true",children:w==="done"?o.jsx(Un,{size:14,weight:"bold"}):v+1}),y=t==="active"&&v===n?"step":void 0,k=o.jsx("span",{className:"sc-learn-step-name",children:g});return o.jsx("li",{children:v===f?o.jsxs("button",{ref:i,type:"button",className:"sc-learn-step","data-state":w,"data-here":"","aria-current":y,"aria-label":`${u}: ${g}`,onClick:l,children:[b,k,o.jsxs("span",{className:"sc-learn-go","aria-hidden":"true",children:[u," ",o.jsx(_a,{size:12,weight:"bold"})]})]}):o.jsxs("div",{className:"sc-learn-step","data-state":w,"aria-current":y,children:[b,k,w==="done"&&o.jsx("span",{className:"sc-vh",children:", done"})]})},g)})}),r&&o.jsx("p",{className:"sc-learn-note",children:Y6[r].note})]})]})]})}function iR({lesson:e,state:t,at:n,blocked:r}){const a=gM(e).length;return t==="done"?o.jsxs("span",{className:"sc-learn-status","data-state":"done",children:[o.jsx("span",{className:"sc-learn-tick","aria-hidden":"true",children:o.jsx(Un,{size:9,weight:"bold"})}),"Done"]}):t==="active"?o.jsxs("span",{className:"sc-learn-status","data-state":"active",children:["Step ",Math.min(n+1,a)," of ",a]}):r?o.jsx("span",{className:"sc-learn-status",children:Y6[r].status}):o.jsxs("span",{className:"sc-learn-status",children:[a," step",a===1?"":"s"]})}function S5(){return o.jsx(Ss,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(Mn,{size:16})})})}const lR=s.createContext(null),vne={products:[],productsLoaded:!1,importing:!1,refreshProducts:async()=>{}};function dn(){const e=s.useContext(lR),t=ZN()??vne;if(!e)throw new Error("useBrand must be used inside BrandLayout");return s.useMemo(()=>({...e,...t}),[e,t])}const cR=s.createContext(null);function wne(){const e=s.useContext(cR);if(!e)throw new Error("useAssetsPanel must be used inside BrandLayout");return e}function yne(){const{brandSlug:e}=Qs(),{pathname:t,search:n}=Wn(),r=gn({path:pt.brand,end:!1}),{brands:a,engines:i,refresh:l}=Hn(),[u,f]=s.useState(null),[h,p]=s.useState(null),[g,v]=s.useState([]),[w,b]=s.useState([]),[y,k]=s.useState({}),[S,E]=s.useState(!1),[j,N]=s.useState(0),A=s.useCallback(()=>N(ce=>ce+1),[]),T=_n(),[P,C]=ba(Kr.assetsOpen,window.innerWidth>=1280),R=s.useCallback(()=>C(ce=>!ce),[]),$=s.useMemo(()=>({open:P,toggle:R,setOpen:C}),[P,R]);Aq();const H=s.useRef(null),D=a.find(ce=>ce.slug===e)??a.find(ce=>ce.id===e)??a.find(ce=>ce.id===H.current)??null;D&&(H.current=D.id);const q=s.useRef(D==null?void 0:D.id);q.current=D==null?void 0:D.id;const _=s.useCallback(async()=>{if(!D)return;const ce=D.id,we=await je.workspace(ce);q.current===ce&&(f(we.project),p(we.root),v(we.recent),b(we.sets),k(we.membership),E(!0))},[D==null?void 0:D.id]),U=s.useRef(new Set),Y=s.useCallback(ce=>(U.current.add(ce),()=>{U.current.delete(ce)}),[]),I=s.useCallback(ce=>{if(ce.length){v(we=>xQ(we,ce));for(const we of U.current)we(ce)}},[]),F=s.useCallback((ce,we)=>{!D||ce!==D.id||I(we)},[D==null?void 0:D.id,I]),O=s.useCallback(ce=>b(we=>we.map(G=>G.id===ce.id?ce:G)),[]),Z=s.useCallback(ce=>b(we=>we.filter(G=>G.id!==ce)),[]),V=s.useCallback(ce=>b(we=>we.some(G=>G.id===ce.id)?we:[ce,...we]),[]),B=s.useCallback((ce,we)=>k(G=>({...G,[ce]:we})),[]),K=s.useMemo(()=>D?{brand:D,workspace:(u==null?void 0:u.brandId)===D.id?u:null,root:h,recent:g,sets:w,membership:y,loaded:S,refresh:_,applySet:O,dropSet:Z,insertSet:V,applyMembership:B,applyNodes:I,subscribeActivity:Y,shotsEpoch:j,resetShots:A}:null,[D,u,h,g,w,y,S,_,O,Z,V,B,I,Y,j,A]);s.useEffect(()=>{E(!1),v([]),p(null)},[D==null?void 0:D.id]),s.useEffect(()=>{D&&eK(D.id)},[D==null?void 0:D.id]),s.useEffect(()=>{_()},[_]);const ee=s.useCallback(()=>{l(),_()},[l,_]),se=r?t.slice(r.pathnameBase.length):"",oe=!!D&&e!==D.slug,me=D?Eo(D)+se+n:"";if(s.useEffect(()=>{oe&&T(me,{replace:!0})},[oe,me,T]),!D){const ce=rM(a),we=!!H.current&&!a.some(Ne=>Ne.id===H.current),G=new URLSearchParams(n);we&&(G.delete("settings"),G.delete("new"));const ue=G.toString();return o.jsx(Ba,{to:ce?Eo(ce)+se+(ue?`?${ue}`:""):pt.root,replace:!0})}return o.jsxs(lR.Provider,{value:K,children:[o.jsx(tQ,{engines:i,brandId:D.id,onSaved:ee}),o.jsx(hQ,{engines:i,onSaved:l}),o.jsx(iQ,{}),o.jsx(nY,{brand:D,onActivity:F,children:o.jsxs(Nq,{brand:D,children:[o.jsx(Sne,{}),o.jsx(mq,{children:o.jsxs(cR.Provider,{value:$,children:[o.jsxs("div",{className:"sc-shell",children:[o.jsx(Cq,{}),o.jsx(bc,{}),o.jsx(vY,{})]}),o.jsx(fne,{}),o.jsx(mne,{}),o.jsx(FQ,{})]})})]})})]})}function bne(e){return!e.unread||e.spent||e.firstUse||!e.loaded||!e.visible||e.dialogOpen?!1:e.running===0&&e.builds===0}const xne=Number(window.localStorage.getItem("scenri:whatsnew-settle-ms")??2500)||2500,uR=s.createContext(null);function Mm(){const e=s.useContext(uR);if(!e)throw new Error("useWhatsNew must be used inside WhatsNewProvider");return e}function kne({children:e}){const[t,n]=s.useState(null),[r,a]=s.useState(null),[i,l]=s.useState(null),[u,f]=s.useState(null),[h,p]=s.useState(null),[g,v]=s.useState("loading"),[w,b]=s.useState(!1),y=Vr("whatsnew");s.useEffect(()=>{let T=!0;return je.releaseNotes().then(P=>{T&&(n(P.version),a(P.entry),l(P.changelogUrl),f(P.releasesUrl??null),p(P.seen),v("ready"))}).catch(()=>{T&&v("failed")}),()=>{T=!1}},[]);const k=y.open,S=s.useCallback(()=>k(t??"latest"),[k,t]),E=s.useCallback(()=>{b(!0),S()},[S]),j=s.useCallback(()=>{!t||h===t||(p(t),je.releaseSeen(t).catch(()=>{}))},[t,h]),N=t!==null&&h!==t&&r!==null&&r.sections.length>0,A=s.useMemo(()=>({status:g,version:t,entry:r,changelogUrl:i,releasesUrl:u,unread:N,open:S,autoOpenSpent:w,autoOpen:E,markSeen:j}),[g,t,r,i,u,N,S,w,E,j]);return o.jsx(uR.Provider,{value:A,children:e})}function Sne(){var k;const e=Mm(),{running:t,builds:n}=Ca(),{loaded:r}=dn(),[a]=ll(),[i,l]=s.useState(()=>!document.hidden),u=s.useRef(!1),f=Fv(),h=ZQ(),p=f.eligible&&f.welcome===null,g=p||h||((k=f.active)==null?void 0:k.task)==="first-shot"&&!f.active.paused,v=!f.loaded||g;g&&(u.current=!0);const w=s.useRef(!1),{markSeen:b}=e;s.useEffect(()=>{p?w.current=!0:w.current&&(w.current=!1,b())},[p,b]),s.useEffect(()=>{const S=()=>l(!document.hidden);return document.addEventListener("visibilitychange",S),()=>document.removeEventListener("visibilitychange",S)},[]);const y=a.has("settings")||a.has("setup")||a.has("new")||a.has("whatsnew");return s.useEffect(()=>{if(!bne({unread:e.unread,spent:u.current||e.autoOpenSpent,loaded:r,visible:i,dialogOpen:y,running:t,builds:n.length,firstUse:v}))return;const E=window.setTimeout(()=>{u.current=!0,e.autoOpen()},xne);return()=>window.clearTimeout(E)},[e,r,i,y,t,n.length,v]),null}const Ene=5e3,dR=s.createContext(null);function Hn(){const e=s.useContext(dR);if(!e)throw new Error("useAppData must be used inside AppShell");return e}function Cne(){const e=OK(),[t,n]=s.useState(null),[r,a]=s.useState([]),[i,l]=s.useState(null),u=FK(),f=VK(),h=zK(),p=UK(),g=s.useRef(0),v=s.useRef(new Map),w=s.useRef(0),b=s.useRef(!1),y=s.useCallback(N=>{v.current.set(N.id,++g.current),n(A=>A&&iG(A,N))},[]),k=s.useCallback(async()=>{const N=++g.current;w.current=N;const A=await je.brands();if(w.current!==N)return;const T=new Set;for(const[P,C]of v.current)C>N&&T.add(P);n(P=>lG(P,A,T))},[]),S=s.useCallback(()=>k().catch(()=>{}),[k]),E=s.useCallback(async()=>{try{await Promise.all([k(),je.engines().then(a)]),b.current=!0}catch(N){b.current||l(String(N.message??N))}},[k]);s.useEffect(()=>{E(),NK()},[E]),s.useEffect(()=>{let N=0;const A=()=>{document.hidden||Date.now()-N<Ene||(N=Date.now(),S())};return document.addEventListener("visibilitychange",A),window.addEventListener("focus",A),()=>{document.removeEventListener("visibilitychange",A),window.removeEventListener("focus",A)}},[S]);const j=s.useMemo(()=>t===null?null:{brands:t,engines:r,scenes:u.scenes,collections:u.collections,verticals:u.verticals,loaded:u.loaded,error:u.error,refetch:u.refetch,presenters:f.presenters,presenterCategories:f.categories,presenterStyles:f.styles,presentersLoaded:f.loaded,presentersError:f.error,refetchPresenters:f.refetch,demoProducts:h.demoProducts,demoProductCategories:h.categories,demoProductsLoaded:h.loaded,demoProductsError:h.error,showcase:p.showcase,showcaseCategories:p.categories,showcaseLoaded:p.loaded,showcaseError:p.error,refetchShowcase:p.refetch,refresh:E,refreshBrands:S,applyBrand:y},[t,r,u.scenes,u.collections,u.verticals,u.loaded,u.error,u.refetch,f.presenters,f.categories,f.styles,f.loaded,f.error,f.refetch,h.demoProducts,h.categories,h.loaded,h.error,p.showcase,p.categories,p.loaded,p.error,p.refetch,E,S,y]);return i?o.jsx(Ds,{align:"center",justify:"center",height:"100vh",p:"5",children:o.jsx(Vv,{failure:{kind:"unknown",title:"Scenri could not read your library.",fix:"Check that it is still running, then reload.",raw:i,retryable:!0}})}):t===null?o.jsx(Ds,{align:"center",justify:"center",height:"100vh",children:o.jsx(Ar,{size:"3"})}):o.jsx(dR.Provider,{value:j,children:o.jsx(PA.Provider,{value:e,children:o.jsx(nG,{children:o.jsxs(kne,{children:[o.jsx(PE,{}),o.jsx(bc,{})]})})})})}function Vr(e){const[t,n]=ll(),r=t.get(e),a=s.useCallback(u=>{n(f=>{const h=new URLSearchParams(f);return h.set(e,u),h},{replace:!1})},[e,n]),i=s.useCallback(u=>{n(f=>{const h=new URLSearchParams(f);return h.set(e,u),h},{replace:!0})},[e,n]),l=s.useCallback(()=>{n(u=>{const f=new URLSearchParams(u);return f.delete(e),f},{replace:!0})},[e,n]);return{value:r,open:a,set:i,close:l}}function ch(e,t=""){const[n,r]=ll(),a=n.get(e)??t,i=s.useCallback(l=>{r(u=>{const f=new URLSearchParams(u);return l===null||l===t?f.delete(e):f.set(e,l),f},{replace:!0})},[e,t,r]);return[a,i]}function E5(e,t){const n=C5(t.name),r=j5(t.url);return!n&&!r?null:e.find(a=>{var i,l,u,f;return!!(r&&j5((l=(i=a.json)==null?void 0:i.meta)==null?void 0:l.website)===r||n&&C5(((f=(u=a.json)==null?void 0:u.meta)==null?void 0:f.name)??a.slug)===n)})??null}const C5=e=>String(e??"").trim().replace(/\s+/g," ").toLowerCase()||null,j5=e=>{const t=String(e??"").trim();if(!t)return null;const n=/^https?:\/\//i.test(t)?t:`https://${t}`;try{return new URL(n).hostname.toLowerCase().replace(/^www\./,"")||null}catch{return null}};function jne(e){const t=e.name.source==="hostname"?{key:"name",found:!1,label:"Name",value:`taken from the address (${e.host})`}:{key:"name",found:!0,label:"Name",value:e.name.value},n=e.logo.status==="primary"?{key:"logo",found:!0,label:"Logo",value:"found on the site"}:e.logo.status==="alternate"?{key:"logo",found:!0,label:"Logo",value:"only a small mark, saved as an alternate"}:{key:"logo",found:!1,label:"Logo",value:"none found"},r=e.colors.count>0?{key:"colors",found:!0,label:"Colours",value:`${e.colors.count} taken from the site`}:{key:"colors",found:!1,label:"Colours",value:"none we could trust"};return[t,n,r]}function Ane(e){return e.logo.status!=="primary"||e.colors.count===0||e.name.source==="hostname"}const l0=(e,t=!1)=>({key:"products",found:t,label:"Products",value:e});function Nne(e){switch(e.kind){case"idle":return null;case"scanning":return l0("looking for a shop");case"timeout":return l0("this site took too long to search");case"error":return l0("the search did not finish");case"result":{const{scan:t}=e;if(t.verdict==="none")return null;if(t.verdict==="found"){const n=t.countSource==="sitemap"&&t.count>20;return l0(`${n?"about ":""}${t.count.toLocaleString()} found`,!0)}return l0("we could not load the catalogue")}}}function Mne(e){return e.kind==="timeout"||e.kind==="error"?!0:e.kind==="result"&&(e.scan.verdict==="blocked"||e.scan.verdict==="likely")}function Rne(e){var t;return!e||e.verdict!=="found"?!1:e.candidates.length>0||(((t=e.cards)==null?void 0:t.length)??0)>0}function Pne(e,t){const n=e.trim();if(n.length<=t)return n;const r=n.slice(0,t),a=r.lastIndexOf(" ");return`${(a>t*.6?r.slice(0,a):r).replace(/[\s,;:.]+$/,"")}...`}function Lne(){var me,ce,we,G,ue,Ne;const{brands:e,refresh:t}=Hn(),n=_n(),r=e.length>0,[a,i]=s.useState(""),[l,u]=s.useState(""),[f,h]=s.useState(!1),[p,g]=s.useState(!1),[v,w]=s.useState(null),[b,y]=s.useState(null),[k,S]=s.useState(!1),[E,j]=s.useState(!1),[N,A]=s.useState(null),[T,P]=s.useState(null),[C,R]=s.useState(null),[$,H]=s.useState(null),D=s.useRef(!1),q=s.useRef(null),_=async(ne,Fe)=>{D.current=!0,q.current=null,y(ne),await t(),n(`${Eo(ne)}${Fe?`?settings=${Fe}`:""}`,{replace:!0})};s.useEffect(()=>{const ne=()=>{const Fe=q.current;!Fe||D.current||(q.current=null,fetch(`/api/brands/${Fe}`,{method:"DELETE",keepalive:!0}).catch(()=>{}))};return window.addEventListener("pagehide",ne),()=>{window.removeEventListener("pagehide",ne),ne()}},[]);const U=async(ne=!1)=>{var Fe,Oe;if(!ne){const ot=E5(e,{url:a.trim()});if(ot){H(ot);return}}g(!0),w(null);try{const ot=await je.brandFromUrl(a);y(ot),q.current=ot.id,A(ot.report),P(((Fe=ot.report)==null?void 0:Fe.read)===!1&&((Oe=ot.warnings)==null?void 0:Oe.slice(0,2).join(" "))||null),g(!1)}catch(ot){w(String(ot.message??ot)),g(!1)}},Y=async(ne=!1)=>{if(!ne){const Fe=E5(e,{name:l});if(Fe){H(Fe);return}}g(!0),w(null);try{await _(await je.createBrand({specVersion:"0.1",meta:{name:l.trim()||"Untitled brand"}}))}catch(Fe){w(String(Fe.message??Fe)),g(!1)}},I=()=>n("/",{replace:!0}),{scan:F,scanning:O,outcome:Z,retry:V}=$N((b==null?void 0:b.id)??null),B=Nne(Z),K=Z.kind==="timeout"||Z.kind==="error",ee=async ne=>{var Fe,Oe;if(b){R(null),j(!0);try{await je.catalogImport(b.id,String(((Oe=(Fe=b.json)==null?void 0:Fe.meta)==null?void 0:Oe.website)??a),ne)}catch{R("That did not start. Check your connection and try again."),j(!1);return}j(!1),S(!1),await _(b)}},se=b?qs((me=b.json)==null?void 0:me.palette):[],oe=b?qr((ce=iY(b.json))==null?void 0:ce.file):null;return o.jsxs("div",{className:"sc-wiz",children:[o.jsxs("div",{className:"sc-wiz-form",children:[o.jsxs("div",{className:"sc-wiz-head",children:[o.jsxs("button",{type:"button",className:"sc-wiz-back",onClick:I,style:r?void 0:{visibility:"hidden"},children:[o.jsx(Sa,{size:11})," Back"]}),o.jsx("span",{}),o.jsx("span",{})]}),o.jsxs("h1",{children:["Your ",o.jsx("em",{children:"brand"})]}),o.jsx("p",{className:"sc-wiz-sub",children:b&&N?o.jsxs(o.Fragment,{children:["Built from ",N.host,". Everything here can be changed later, from Settings."]}):o.jsx(o.Fragment,{children:"Paste a website and the kit builds itself: name, logo, palette. You can also start from nothing and fill it in later from Settings."})}),o.jsxs("div",{className:"sc-wiz-fields",children:[b?o.jsx("div",{style:{textAlign:"center"},children:O?o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",disabled:!0,children:[o.jsx(Ar,{size:"1"})," Looking for products"]}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void _(b),children:"Skip and add the brand only"})})]}):K?o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",onClick:V,children:["Look for products again ",o.jsx(_a,{size:12})]}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void _(b),children:"Continue without products"})})]}):Rne(F)?o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",onClick:()=>S(!0),children:["Add brand and products ",o.jsx(_a,{size:12})]}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void _(b),children:"Just the brand"})})]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",onClick:()=>void _(b),children:["Looks right ",o.jsx(_a,{size:12})]}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>void _(b,"brand"),children:N&&Ane(N)?"Finish the kit first":"Edit the kit first"})})]})}):f?o.jsxs(o.Fragment,{children:[o.jsx("label",{htmlFor:"sc-wiz-name",children:"Brand name"}),o.jsx("input",{id:"sc-wiz-name",className:"sc-in",placeholder:"Brand name",value:l,onChange:ne=>{u(ne.target.value),H(null)},onKeyDown:ne=>ne.key==="Enter"&&l.trim()&&!p&&void Y()}),o.jsxs("div",{style:{textAlign:"center"},children:[o.jsx("button",{type:"button",className:"sc-wiz-cta",disabled:!l.trim()||p,onClick:()=>void Y(),children:p?o.jsx(Ar,{size:"1"}):o.jsxs(o.Fragment,{children:["Create it ",o.jsx(_a,{size:12})]})}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>{h(!1),H(null)},children:"Build from a website instead"})})]})]}):o.jsxs(o.Fragment,{children:[o.jsx("label",{htmlFor:"sc-wiz-url",children:"Website"}),o.jsx("input",{id:"sc-wiz-url",className:"sc-in",placeholder:"acme.com",value:a,onChange:ne=>{i(ne.target.value),H(null)},onKeyDown:ne=>ne.key==="Enter"&&a.trim()&&!p&&void U()}),o.jsx("p",{className:"sc-wiz-hint",children:"We only read public pages. Nothing leaves this machine."}),o.jsxs("div",{style:{textAlign:"center"},children:[o.jsx("button",{type:"button",className:"sc-wiz-cta",disabled:!a.trim()||p,onClick:()=>void U(),children:p?o.jsx(Ar,{size:"1"}):o.jsxs(o.Fragment,{children:["Build the kit ",o.jsx(_a,{size:12})]})}),o.jsx("div",{children:o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>{h(!0),H(null)},children:"Start from scratch instead"})})]})]}),$&&o.jsxs(x6,{color:"amber",mt:"3",size:"1",children:[o.jsxs(k6,{children:["You already have ",va($),". Creating another makes a second workspace with its own address."]}),o.jsxs("div",{style:{display:"flex",gap:10,marginTop:4,flexWrap:"wrap"},children:[o.jsxs("button",{type:"button",className:"sc-wiz-cta",onClick:()=>n(Eo($)),children:["Open ",va($)," instead"]}),o.jsx("button",{type:"button",className:"sc-wiz-skip",onClick:()=>{H(null),f?Y(!0):U(!0)},children:"Create anyway"})]})]}),v&&o.jsx(x6,{color:"red",mt:"3",size:"1",children:o.jsx(k6,{children:v})})]})]}),o.jsx("div",{className:"sc-wiz-preview",children:o.jsxs("div",{className:"sc-wiz-card",children:[o.jsx("div",{className:"sc-wiz-cap",children:b?"Your kit":p?`Reading ${a||"the site"}`:"Live kit preview"}),o.jsxs("div",{className:"sc-wiz-body",children:[p&&!b&&o.jsxs("div",{className:"sc-scrape-row",children:[o.jsx(Ar,{size:"1"})," Reading the site and building the kit"]}),!p&&!b&&o.jsx("p",{style:{color:"var(--sc-fg3)",fontSize:12.5,margin:0},children:"The kit appears here as it is found."}),b&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:se.length?16:0},children:[o.jsx("span",{className:"sc-kit-logo",style:{width:44,height:44,padding:7,borderRadius:12},children:oe?o.jsx("img",{src:oe,alt:""}):o.jsx(Js,{size:16,color:"var(--sc-fg3)"})}),o.jsxs("span",{children:[o.jsx("b",{dir:"auto",style:{fontFamily:"var(--sc-font-display)",fontSize:16},children:(G=(we=b.json)==null?void 0:we.meta)==null?void 0:G.name}),((Ne=(ue=b.json)==null?void 0:ue.meta)==null?void 0:Ne.tagline)&&o.jsx("small",{dir:"auto",style:{display:"block",color:"var(--sc-fg3)",fontSize:11.5},children:Pne(String(b.json.meta.tagline),72)})]})]}),se.length>0&&o.jsx("div",{style:{display:"flex",gap:8},children:se.slice(0,5).map(ne=>o.jsx("span",{style:{flex:1,height:44,borderRadius:9,border:"1px solid var(--sc-line)",background:ne.hex}},ne.hex))}),N&&o.jsx("ul",{className:"sc-kit-lines",role:"status",children:[...jne(N),...B?[B]:[]].map(ne=>o.jsxs("li",{"data-found":ne.found?"":void 0,children:[ne.key==="products"&&O?o.jsx(Ar,{size:"1"}):ne.found?o.jsx(Un,{size:12,weight:"bold"}):o.jsx(FO,{size:12}),o.jsx("span",{className:"sc-kit-line-label",children:ne.label}),o.jsx("span",{className:"sc-kit-line-value",children:ne.value})]},ne.key))}),T&&o.jsx("p",{className:"sc-kit-note",role:"status",children:T}),!O&&!K&&Mne(Z)&&o.jsx("button",{type:"button",className:"sc-wizpick-open",onClick:V,children:"Try the catalogue again"})]})]})]})}),k&&F&&b&&o.jsx(LN,{brandId:b.id,scan:F,busy:E,error:C,onImport:ne=>void ee(ne),onImportAll:()=>void ee(),onDismiss:()=>S(!1)})]})}const ku=e=>{const t=(e??"").trim();return t||null};function $ne(e){const t=e;return{name:e.name,brand:ku(t.brand)??ku(t.vendor),qualifier:ku(t.format)??ku(t.subcategory)??ku(t.variant)}}function Tne(e){return!e.brand||e.name.toLowerCase().startsWith(e.brand.toLowerCase())?e.name:`${e.brand} ${e.name}`}function Co(e,t){const n=$ne(e);if(t==="chip")return n.name;const r=Tne(n);return t==="tooltip"?[r,n.qualifier].filter(Boolean).join(" · "):r}function ol(e,t){return t==="tooltip"?[e.name,ku(e.lighting)].filter(Boolean).join(" · "):e.name}function dp(e){return[e.name,...e.legacyNames??[],...e.keywords??[],e.description,e.lighting,e.subject].concat(e.collections??[],e.verticals??[]).filter(Boolean).join(" ")}function kw(e){const t=e;return[e.name,...t.legacyNames??[],...t.keywords??[],t.brand,t.vendor,t.format,t.subcategory,t.variant,t.productType,...t.tags??[]].filter(Boolean).join(" ")}function fp(e){return[e.name,e.descriptor,e.presentation,e.ageRange,e.facial,e.skin,e.hair,e.build,e.wardrobeDefault,...e.suitableCategories,...e.suitableStyles].filter(Boolean).join(" ")}function Dne(e,t,n){return[e.title,e.category,n,t.product?kw(t.product):null,t.presenter?fp(t.presenter):null,t.scene?dp(t.scene):null].filter(Boolean).join(" ")}function Sw(){const{brand:e}=dn(),t=_n(),n=yr(e);return s.useCallback(r=>{t(`${n}?presenter=${encodeURIComponent(r)}&compose=1`)},[n,t])}function Rm(){const{brand:e}=dn(),t=_n(),n=yr(e);return s.useCallback((r,a,i,l)=>{const u=a?`&setup=${encodeURIComponent(a)}`:"",f=i?`&ref=${encodeURIComponent(i)}${l?`&view=${l}`:""}`:"";t(`${n}?scene=${encodeURIComponent(r)}${u}${f}&compose=1`)},[n,t])}function s4(e){return{...e.brief,...e.variants?{variants:e.variants}:{},...e.quality?{quality:e.quality}:{},_at:Date.now()}}function Hne(){const{brand:e}=dn(),t=_n(),n=yr(e);return s.useCallback(r=>{t(`${n}?showcase=${encodeURIComponent(r)}`)},[n,t])}const $h=e=>`sc-favscenes-${e}`,One=e=>`sc-favlooks-${e}`,Ine=e=>`bt-favlooks-${e}`;function fR(e,t){return e==="presenter"?`sc-favpresenters-${t}`:e==="product"?`sc-favproducts-${t}`:$h(t)}function hR(e){try{const t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function ui(e){try{const t=localStorage.getItem($h(e))??C6(One(e),$h(e))??C6(Ine(e),$h(e));return hR(t)}catch{return[]}}function rd(e,t){try{return e==="scene"?ui(t):hR(localStorage.getItem(fR(e,t)))}catch{return[]}}function pR(e,t,n){try{localStorage.setItem(fR(e,t),JSON.stringify(n))}catch{}}function Pm(e,t,n){const r=rd(e,t),a=r.includes(n)?r.filter(i=>i!==n):[...r,n];return pR(e,t,a),a}function Ew(e,t,n,r){const a=rd(e,t),i=r?[...a,...n.filter(l=>!a.includes(l))]:a.filter(l=>!n.includes(l));return pR(e,t,i),i}const mR=[{key:"campaign",label:"Product campaign"},{key:"lifestyle",label:"Lifestyle"},{key:"editorial",label:"Fashion & editorial"},{key:"beauty",label:"Beauty"},{key:"food-drink",label:"Food & drink"},{key:"launch",label:"Tech launch"},{key:"social",label:"Social"},{key:"cinematic",label:"Cinematic"},{key:"catalog",label:"Catalog"},{key:"seasonal",label:"Seasonal"}],Fne=new Map(mR.map(e=>[e.key,e]));function y8(e){var t;return e?((t=Fne.get(e))==null?void 0:t.label)??e:null}function _ne(e){const t=new Map(mR.map((n,r)=>[n.key,r]));return[...e].sort((n,r)=>(t.get(n)??99)-(t.get(r)??99)||n.localeCompare(r))}function Vne(e,t){let r=null,a=null,i=null,l=null,u=null,f=null,h=null,p={dx:0,dy:0},g={w:0,h:0},v=0;const w=R=>{R.style.position="fixed",R.style.left="0",R.style.top="0",R.style.margin="0",R.style.zIndex="var(--sc-z-popover)",R.style.pointerEvents="none"},b=()=>{const R=$=>{var H,D;window.removeEventListener("click",R,!0),!((D=(H=$.target).closest)!=null&&D.call(H,'[data-role="remove"]'))&&($.stopPropagation(),$.preventDefault())};window.addEventListener("click",R,!0),setTimeout(()=>window.removeEventListener("click",R,!0),250)},y=()=>{if(h!==null){try{e.releasePointerCapture(h)}catch{}h=null}i==null||i.remove(),l==null||l.remove(),i=null,l=null,u=null,a==null||a.removeAttribute("data-drag-src"),a=null,r=null,e.removeAttribute("data-chip-drag"),document.documentElement.style.cursor="",cancelAnimationFrame(v)},k=R=>{!e.isConnected||!e.contains(document.activeElement)||(f!==null?Fa(e,f):ec(e,R,"after"))},S=()=>{if(!a)return;const R=a;y(),b(),k(R),t.onCancelled()},E=R=>{if(R.button!==0||R.pointerType==="touch")return;const $=R.target;if($.closest('[data-role="remove"]'))return;const H=Ii($);H&&(r={chip:H,x:R.clientX,y:R.clientY})},j=R=>{var H,D;if(!r)return;f=uo(e),a=r.chip,t.onDragStart(),(H=window.getSelection())==null||H.removeAllRanges(),e.setAttribute("data-chip-drag","");const $=a.getBoundingClientRect();p={dx:r.x-$.left,dy:r.y-$.top},r=null;try{e.setPointerCapture(R.pointerId),h=R.pointerId}catch{}document.documentElement.style.cursor="grabbing",i=a.cloneNode(!0),(D=i.querySelector('[data-role="remove"]'))==null||D.remove(),i.className=`${a.className} sc-chip-ghost`,i.removeAttribute("data-drag-src"),i.removeAttribute("title"),w(i),i.style.width=`${$.width}px`,i.style.height=`${$.height}px`,i.style.fontSize=getComputedStyle(a).fontSize,g={w:$.width,h:$.height},document.body.appendChild(i),a.setAttribute("data-drag-src",""),l=document.createElement("div"),l.className="sc-drop-caret",w(l),l.style.display="none",document.body.appendChild(l),N(R)},N=R=>{if(!i||!a)return;const $=Math.min(Math.max(4,R.clientX-p.dx),window.innerWidth-g.w-4),H=Math.min(Math.max(4,R.clientY-p.dy),window.innerHeight-g.h-4);i.style.transform=`translate3d(${$}px, ${H}px, 0)`;const D=$k(e,a,R.clientX,R.clientY);if(u=D,!l)return;const q=D&&!D.noop?A5(e,D.units):null;if(!q||!D){l.style.display="none";return}const _=mJ(e,D.units),U=_<D.units?A5(e,_):null,Y=!!U&&Math.abs(U.top+U.height/2-(q.top+q.height/2))<q.height/2,I=U&&Y?(U.left+q.left)/2:q.left;l.style.display="",l.style.transform=`translate3d(${I-1.5}px, ${q.top-2}px, 0)`,l.style.height=`${q.height+4}px`},A=R=>{if(r){if(Math.hypot(R.clientX-r.x,R.clientY-r.y)<5)return;R.preventDefault(),j(R);return}if(!a)return;R.preventDefault(),cancelAnimationFrame(v);const{clientX:$,clientY:H}=R;v=requestAnimationFrame(()=>N({clientX:$,clientY:H}))},T=R=>{if(r){r=null;return}if(!a)return;const $=a;let H;try{H=$k(e,$,R.clientX,R.clientY)??u}catch{H=u}finally{y()}if(b(),H&&!H.noop&&CM(e,$,H.units)){ec(e,$,"after"),t.onMoved($,X6(e,$));return}k($),t.onCancelled()},P=R=>{R.key==="Escape"&&a&&(R.stopPropagation(),S())},C=R=>{Ii(R.target)&&R.preventDefault()};return e.addEventListener("pointerdown",E),e.addEventListener("dragstart",C),e.addEventListener("lostpointercapture",S),window.addEventListener("pointermove",A),window.addEventListener("pointerup",T),window.addEventListener("pointercancel",S),window.addEventListener("blur",S),window.addEventListener("keydown",P,!0),()=>{y(),e.removeEventListener("pointerdown",E),e.removeEventListener("dragstart",C),e.removeEventListener("lostpointercapture",S),window.removeEventListener("pointermove",A),window.removeEventListener("pointerup",T),window.removeEventListener("pointercancel",S),window.removeEventListener("blur",S),window.removeEventListener("keydown",P,!0)}}function A5(e,t){let n=0;const r=Array.from(e.childNodes);for(let l=0;l<r.length;l++){const u=r[l],f=nd(u),h=u.nodeType===Node.TEXT_NODE&&t===n+f&&l<r.length-1;if(t<=n+f&&!h){if(u.nodeType!==Node.TEXT_NODE){const v=u.getBoundingClientRect();return new DOMRect(t===n?v.left:v.right,v.top,0,v.height)}const p=document.createRange();p.setStart(u,rp(u,Math.max(0,Math.min(t-n,f)))),p.collapse(!0);const g=p.getBoundingClientRect();return g.height?g:null}n+=f}const i=(e.lastElementChild??e).getBoundingClientRect();return new DOMRect(i.right,i.top,0,i.height||18)}function Zne({kind:e,label:t,thumb:n,onInspect:r,onMove:a,onRemove:i,onClose:l}){const{sheet:u,grip:f}=pd(()=>l("dismiss")),h=e==="mark"?"brand mark":"reference image";return o.jsx(Sc,{open:!0,onOpenChange:p=>!p&&l("dismiss"),children:o.jsxs(Ec,{children:[o.jsx(Cc,{className:"sc-shotsheet-scrim"}),o.jsxs(jc,{ref:u,className:"sc-shotsheet sc-swapsheet","data-kind":e,"aria-describedby":void 0,onOpenAutoFocus:p=>{var g;p.preventDefault(),(g=u.current)==null||g.focus({preventScroll:!0})},onCloseAutoFocus:p=>p.preventDefault(),onEscapeKeyDown:p=>{p.preventDefault(),l("escape")},children:[o.jsxs("div",{className:"sc-shotsheet-grip",...f,children:[o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0}),o.jsxs(Ac,{className:"sc-vh",children:["Move or remove ",h]})]}),o.jsxs("div",{className:"sc-movesheet-head",children:[n&&o.jsx("button",{type:"button",className:"sc-movesheet-face",onClick:r,"aria-label":`Open ${h}`,children:o.jsx("img",{src:n,alt:"",onError:p=>p.currentTarget.remove()})}),o.jsxs("span",{className:"sc-movesheet-txt",children:[o.jsx("b",{dir:"auto",children:t||h}),o.jsx("span",{children:h})]})]}),o.jsxs("div",{className:"sc-swap-foot",children:[o.jsxs("div",{className:"sc-swap-move",children:[o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>a(-1),children:[o.jsx(O4,{size:13})," Move earlier"]}),o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>a(1),children:["Move later ",o.jsx(_a,{size:13})]})]}),i&&o.jsxs("button",{type:"button",className:"sc-swap-remove",onClick:i,children:[o.jsx(ul,{size:13}),"Remove ",e==="mark"?"mark":"reference"]})]})]})]})})}const zne=440,Bne=460,Une=600,N5=156,gR=8,Th=14,b8=20,vr=12,vR=200,Wne=240,wR=204;function Kne(e,t,n){if(e.bottom<0||e.top>t.height)return null;const r=Math.min(n==null?void 0:n.width,t.width-vr*2),i=e.right+Th+r+vr<=t.width?e.right+Th:Math.max(vr,e.left-Th-r),l=Math.max(vr,Math.min(e.top,t.height-vr-wR));return{left:i,top:l,width:r,maxHeight:Math.max(vR,t.height-l-vr),side:"beside"}}function Gne(e,t){const n=(r,a)=>Math.min(Math.max(r,b8),Math.max(b8,a-b8));return t.side==="beside"?{edge:t.left>=e.right?"left":"right",x:0,y:n((e.top+e.bottom)/2-t.top,wR)}:{edge:t.side==="above"?"bottom":"top",x:n((e.left+e.right)/2-t.left,t.width),y:0}}function Yne(e,t,n,r){if(e.bottom<0||e.top>t.height)return null;const a=gR,i=Math.min(n.width,t.width-vr*2),l=n.height,u=Math.min(Math.max(e.left+(e.right-e.left)/2-i/2,vr),Math.max(vr,t.width-i-vr)),h=e.top-a-vr>=l?e.top-a-l:Math.min(e.bottom+a,Math.max(vr,t.height-l-vr));return{left:u,top:h}}function Cw(e,t,n){if(e.bottom<0||e.top>t.height)return null;const r=Math.min((n==null?void 0:n.width)??zne,t.width-vr*2),a=(n==null?void 0:n.gap)??gR,i=e.top-a-vr,l=t.height-e.bottom-a-vr,u=i>=Wne||i>=l?"above":"below",f=u==="above"?i:l,h=Math.max(vR,Math.min((n==null?void 0:n.maxHeight)??Bne,f)),p=Math.min(Math.max(e.left,vr),Math.max(vr,t.width-r-vr)),g=u==="above"?Math.max(vr,e.top-a-h):e.bottom+a;return u==="above"?{left:p,top:g,width:r,maxHeight:h,side:u,bottomEdge:e.top-a}:{left:p,top:g,width:r,maxHeight:h,side:u}}function yR(e){return e.side==="above"&&e.bottomEdge!==void 0?{left:e.left,width:e.width,maxHeight:e.maxHeight,top:"auto",bottom:window.innerHeight-e.bottomEdge}:{left:e.left,width:e.width,maxHeight:e.maxHeight,top:e.top}}const qne=["ref","mark","product","presenter","scene","shot"],Dh=e=>qne.includes(e),bR={ref:"Reference image",mark:"Brand mark",product:"Product",presenter:"Presenter",scene:"Scene",shot:"Shot"};function Xne(e){return e.side==="below"||e.side==="beside"?{top:Math.round(e.top)}:{bottom:Math.round(window.innerHeight-(e.top+e.maxHeight))}}function yd({anchor:e,kind:t,src:n,label:r,warning:a,note:i,noun:l,side:u="auto",onOpen:f,onHoverIn:h,onHoverOut:p,onClose:g}){const[v,w]=s.useState(null),[b,y]=s.useState(!1);if(s.useEffect(()=>y(!1),[n]),s.useLayoutEffect(()=>{var E,j;const S=()=>{const N=window.visualViewport,A=e.getBoundingClientRect(),T={width:(N==null?void 0:N.width)??window.innerWidth,height:(N==null?void 0:N.height)??window.innerHeight},P=u==="beside"?Kne(A,T,{width:N5}):Cw(A,T,{width:N5,gap:Th});if(!P){g();return}w({...P,tail:Gne(A,P)})};return S(),window.addEventListener("resize",S),window.addEventListener("scroll",S,!0),(E=window.visualViewport)==null||E.addEventListener("resize",S),(j=window.visualViewport)==null||j.addEventListener("scroll",S),()=>{var N,A;window.removeEventListener("resize",S),window.removeEventListener("scroll",S,!0),(N=window.visualViewport)==null||N.removeEventListener("resize",S),(A=window.visualViewport)==null||A.removeEventListener("scroll",S)}},[e,u,g]),s.useEffect(()=>{const S=E=>{E.key==="Escape"&&g()};return window.addEventListener("keydown",S,!0),()=>window.removeEventListener("keydown",S,!0)},[g]),!v)return null;const k=l??bR[t];return _r.createPortal(o.jsxs("div",{className:"sc-chip-preview","data-kind":t,"data-side":v.side,"aria-hidden":"true",style:{left:Math.round(v.left),...Xne(v),maxWidth:v.width,maxHeight:v.maxHeight},onPointerEnter:h,onPointerLeave:p,children:[o.jsx("span",{className:"sc-chip-preview-tail","data-edge":v.tail.edge,style:v.tail.edge==="left"||v.tail.edge==="right"?{top:Math.round(v.tail.y)}:{left:Math.round(v.tail.x)}}),o.jsxs("button",{type:"button",className:"sc-chip-preview-hit",tabIndex:-1,onClick:f,children:[b?o.jsxs("span",{className:"sc-chip-preview-plate sc-chip-preview-blank",children:[o.jsx(Js,{size:20}),"Image unavailable"]}):o.jsx("img",{className:"sc-chip-preview-plate",src:n,alt:"",decoding:"async",onError:()=>y(!0)}),r&&o.jsx("b",{dir:"auto",children:r}),k&&o.jsx("span",{children:k})]}),i&&o.jsx("p",{className:"sc-chip-preview-note",children:i}),a&&o.jsx("p",{className:"sc-swap-warn",children:a})]}),document.body)}const Qne=160,Jne=120;function bd(){const[e,t]=s.useState(null),n=s.useRef(null),r=s.useRef(!1);r.current=e!==null;const a=s.useCallback(()=>{n.current&&clearTimeout(n.current),n.current=null},[]),i=s.useCallback(f=>{if(a(),r.current){t(f);return}n.current=setTimeout(()=>t(f),Qne)},[a]),l=s.useCallback(()=>{a(),n.current=setTimeout(()=>t(null),Jne)},[a]),u=s.useCallback(()=>{a(),t(null)},[a]);return s.useEffect(()=>a,[a]),{shown:e,open:i,keep:a,close:l,closeNow:u}}const k0="sc-insert-menu";function ere(e){var t;return!!(((t=e.nativeEvent)==null?void 0:t.isComposing)??e.isComposing)||e.keyCode===229}function tre(e){return e==="/"?"Scenes":e==="@"?"Presenters":e==="#"?"Colors":"Products"}function nre(e){return e==="/"?"No matching scenes":e==="#"?"No matching colours":e==="@"?"No matching presenters":"No matching products"}function rre({menuOpen:e,handled:t}){return!e&&!t}function sre(e,t){return t||!e?{open:!1}:{open:!0,sigil:e.sigil,query:e.query}}function are(e,t){const n=t.trim().split(/\s+/).filter(Boolean)[0];if(!n)return[{text:e,hit:!1}];const r=e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase());if(r<0)return[{text:e,hit:!1}];const a=r+n.length;return[...r>0?[{text:e.slice(0,r),hit:!1}]:[],{text:e.slice(r,a),hit:!0},...a<e.length?[{text:e.slice(a),hit:!1}]:[]]}function ore(e,t){return{x:e.left-t.left,y:e.top-t.top,w:e.right-e.left,h:e.bottom-e.top}}function ire(e,t){return{left:e.left+t.x,top:e.top+t.y,right:e.left+t.x+t.w,bottom:e.top+t.y+t.h}}function lre(e,t,n){return n?t:e||t}function cre(e,t){return!t||e==null?!0:e===t?!1:!t.contains(e)}function x8(e,t){return e===t?!0:!e||!t?!1:e.left===t.left&&e.top===t.top&&e.width===t.width&&e.maxHeight===t.maxHeight&&e.side===t.side&&e.shell===t.shell}function ure(e,t,n){return Math.min(n,Math.max(0,e)+Math.max(0,t))}function dre(e,t,n){return n>0&&t>0&&e!==t}function fre(e,t){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();n.bottom>r.bottom?e.scrollTop+=n.bottom-r.bottom:n.top<r.top&&(e.scrollTop-=r.top-n.top)}const xR=320,hp=320,hre=280,Yl=8,Ul=12,pre=8,M5=80,mre=120,kR=48;function SR(e,t){return!(!e||e.top===0&&e.left===0&&e.right===0&&e.bottom===0||e.bottom<0||e.top>t.height||e.right-e.left>kR)}function gre(e){return{top:e.top,bottom:Math.min(e.bottom,e.top+22),left:e.left,right:e.left+2}}function ER(e,t,n,r){return Math.min(Math.max(e,r),Math.max(r,n.width-t-r))}function a4(e,t,n,r){const a=n?pre:Ul,i=n?Math.max(0,e.right-e.left):Math.min(xR,t.width-a*2),l=n?e.left:ER(e.left,i,t,a),u=n?Math.min(hre,Math.floor(t.height*.4)):hp,f=Math.min(u,r??u),h=e.top-Yl-a,p=Math.max(0,Math.min(f,h)),g=Math.max(a,e.top-Yl-p);return{left:l,top:g,width:i,maxHeight:p,side:"above",shell:"dock"}}function R5(e,t,n,r){const a=Math.min(xR,n.width-Ul*2),i=ER(e.left,a,n,Ul),l=e.top-Yl-Ul,u=n.height-e.bottom-Yl-Ul,f=l>=mre||l>=u?"above":"below",h=Math.min(hp,r??hp),p=f==="above"?l:u,g=Math.min(h,r==null?Math.max(M5,p):p);if(f==="above"){const w=Math.max(Ul,e.top-Yl-Math.min(h,l)),b=Math.min(h,e.top-Yl-w);return r==null&&b<M5?a4(t,n,!1):{left:i,top:w,width:a,maxHeight:b,side:f,shell:"caret"}}const v=e.bottom+Yl;return v+Math.min(g,u)>n.height-Ul?a4(t,n,!1,r):{left:i,top:v,width:a,maxHeight:Math.min(h,u),side:f,shell:"caret"}}function vre(e,t,n,r={}){if(r.phone)return a4(t,n,!0,r.height);const a=r.line??t;if(SR(e,n)&&e)return R5(e,t,n,r.height);const i=e&&e.right-e.left>kR?e:a;return R5(gre(i),t,n,r.height)}function wre({anchor:e,composer:t,line:n,query:r,options:a,remaining:i=0,total:l=0,sigil:u,onMore:f,onActiveId:h,onClose:p}){const g=Sr(ta),[v,w]=s.useState(0),[b,y]=s.useState(null),k=s.useRef(null),S=s.useRef(null),E=s.useRef(null),j=s.useRef(null),N=`${u??""}\0${r}`,A=s.useRef({}),T=s.useRef(f);T.current=f;const P=s.useRef(i);P.current=i;const C=s.useRef(0),R=s.useCallback(()=>{var _;dre(C.current,a.length,P.current)&&(C.current=a.length,(_=T.current)==null||_.call(T))},[a.length]);s.useEffect(()=>{w(0),C.current=0},[r]),s.useEffect(()=>{w(_=>Math.min(_,Math.max(0,a.length-1)))},[a.length]),s.useEffect(()=>{j.current=null,A.current={}},[u]);const $=s.useCallback(_=>{var ee;const U=t==null?void 0:t.getBoundingClientRect();if(!U)return null;const Y=(n==null?void 0:n.getBoundingClientRect())??U,I=window.visualViewport,F={width:(I==null?void 0:I.width)??window.innerWidth,height:(I==null?void 0:I.height)??window.innerHeight},O=!!((ee=k.current)!=null&&ee.contains(document.activeElement)),Z=O?null:bM(),V=Z&&SR(Z,F)?Z:null;V&&(j.current=ore(V,Y));const B=j.current?ire(Y,j.current):null,K=lre(V,B,O)??(O?null:(e==null?void 0:e.getBoundingClientRect())??null);return vre(K,U,F,{phone:g,line:Y,height:_})},[e,t,n,g]);s.useLayoutEffect(()=>{var I,F;A.current.sigil!==u&&(A.current={sigil:u});const _=()=>{const O=P.current>0?void 0:A.current.height,Z=$(O);y(V=>x8(V,Z)?V:Z)},U=O=>{cre(O.target,k.current)&&_()};_();const Y=requestAnimationFrame(_);return window.addEventListener("resize",_),window.addEventListener("scroll",U,!0),(I=window.visualViewport)==null||I.addEventListener("resize",_),(F=window.visualViewport)==null||F.addEventListener("scroll",_),()=>{var O,Z;cancelAnimationFrame(Y),window.removeEventListener("resize",_),window.removeEventListener("scroll",U,!0),(O=window.visualViewport)==null||O.removeEventListener("resize",_),(Z=window.visualViewport)==null||Z.removeEventListener("scroll",_)}},[e,t,n,g,u,$]),s.useLayoutEffect(()=>{if(!b||!k.current)return;if(i>0){if(A.current.height==null&&A.current.sigil===(u??""))return;A.current={sigil:u??""};const O=$();O&&!x8(b,O)&&y(O);return}const _=k.current,U=S.current,Y=U?_.offsetHeight-U.clientHeight:_.offsetHeight,I=ure(Y,(U==null?void 0:U.scrollHeight)??0,hp);if(!(I>0)||A.current.height===I&&A.current.sigil===(u??""))return;A.current={sigil:u??"",height:I};const F=$(I);!F||x8(b,F)||y(F)},[b,N,$,i,a.length,u]),s.useLayoutEffect(()=>{const _=U=>{U.isComposing||U.keyCode===229||(U.key==="ArrowDown"?(U.preventDefault(),v>=a.length-1?R():w(Y=>Y+1)):U.key==="ArrowUp"?(U.preventDefault(),w(Y=>Math.max(0,Y-1))):(U.key==="Enter"||U.key==="Tab")&&a[v]?(U.preventDefault(),a[v].run()):U.key==="Escape"&&(U.preventDefault(),p()))};return window.addEventListener("keydown",_,!0),()=>window.removeEventListener("keydown",_,!0)},[a,v,p,R]),s.useEffect(()=>{const _=S.current,U=_==null?void 0:_.querySelector('[data-active="true"]');_&&U&&fre(_,U)},[v]),s.useEffect(()=>{const _=E.current,U=S.current;if(!_||!U)return;const Y=new IntersectionObserver(I=>{U.scrollTop<=0||I.some(F=>F.isIntersecting)&&R()},{root:U,rootMargin:"0px 0px 8px 0px"});return Y.observe(_),()=>Y.disconnect()},[b,N,R]);const H=a[v]?`${k0}-opt-${v}`:null;if(s.useEffect(()=>(h==null||h(H),()=>h==null?void 0:h(null)),[H,h]),s.useEffect(()=>{const _=U=>{U.target.closest(".sc-cmd")||(Q6(U),p())};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[p]),!b)return null;const D=`${k0}-list`,q=tre(u);return _r.createPortal(o.jsx("div",{className:"sc-cmd",id:k0,"data-shell":b.shell,style:{left:b.left,top:b.top,width:b.width,maxHeight:b.maxHeight,height:b.side==="above"&&i>0?b.maxHeight:void 0},ref:k,children:o.jsxs("div",{className:"sc-cmd-list",ref:S,role:"listbox","aria-label":q,id:D,children:[a.length?a.map((_,U)=>{var I;const Y=U===0||_.group!==((I=a[U-1])==null?void 0:I.group);return o.jsxs("div",{children:[Y&&o.jsx(P5,{name:_.group,total:l}),o.jsxs("button",{type:"button",id:`${k0}-opt-${U}`,className:"sc-cmd-row",role:"option","aria-selected":U===v,"data-active":U===v,onMouseEnter:()=>w(U),onMouseDown:F=>Q6(F),onClick:()=>_.run(),children:[_.thumb?o.jsx("img",{src:_.thumb,alt:"","data-crop":_.crop}):_.swatch?o.jsx("span",{className:"sc-cmd-swatch",style:{background:_.swatch}}):null,o.jsx(yre,{text:_.label,query:r}),_.hint&&o.jsx("span",{className:"sc-cmd-hint",children:_.hint})]})]},_.key)}):o.jsxs(o.Fragment,{children:[o.jsx(P5,{name:q,total:l}),o.jsx("div",{className:"sc-cmd-empty",children:nre(u)})]}),i>0&&a.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"sc-cmd-count","aria-live":"polite",children:[a.length," of ",l]}),o.jsx("div",{ref:E,className:"sc-cmd-sentinel","aria-hidden":!0})]})]})}),document.body)}function P5({name:e,total:t}){return o.jsxs("div",{className:"sc-cmd-group",children:[e," ",o.jsx("span",{className:"sc-cmd-n",children:t})]})}function yre({text:e,query:t}){return o.jsx("span",{className:"sc-cmd-label",children:are(e,t).map(n=>n.hit?o.jsx("b",{children:n.text},`h:${n.text}`):o.jsx("span",{children:n.text},`t:${n.text}`))})}const bre={fragrance:["Fragrance"],footwear:["Footwear"],apparel:["Apparel"],furniture:["Furniture","Home"],beauty:["Beauty"],electronics:["Electronics"],accessories:["Accessories"],beverage:["Food & drink"],jewelry:["Jewelry"],food:["Food & drink"]},xre={fragrance:["Fragrance"],footwear:["Footwear","Apparel"],apparel:["Apparel"],furniture:["Furniture","Home"],beauty:["Beauty"],electronics:["Electronics"],accessories:["Accessories"],beverage:["Food & drink"],jewelry:["Jewelry"],food:["Food & drink"]};function kre(e,t){if(!t)return!1;const n=bre[t];return!!n&&n.some(r=>e.verticals.includes(r))}function Sre(e,t){if(!t)return!1;const n=xre[t];return!!n&&n.some(r=>e.suitableCategories.includes(r))}function L5(e){return e.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").replace(/[\u200e\u200f\u061c\u202a-\u202e\u2066-\u2069]/g,"").toLowerCase()}const Ere=4;function jo(e,t){const n=L5(t).trim().split(/\s+/).filter(Boolean);if(!n.length)return!0;const r=L5(e);return n.every(a=>r.includes(a)||a.length>=Ere&&a.endsWith("s")&&r.includes(a.slice(0,-1)))}function jw(e,t){return{visible:e.slice(0,t),remaining:Math.max(0,e.length-t)}}function CR(e,t){return[...e].sort((n,r)=>Number(t(r))-Number(t(n)))}function jR(e,t){if(e.t==="product"){const n=t.products.find(a=>a.id===e.id)??null,r=n?null:t.demoProducts.find(a=>a.id===e.id)??null;return{kind:"product",product:n,demo:r}}if(e.t==="character"){const n=t.cast.find(a=>a.id===e.id)??null,r=n?null:t.presenters.find(a=>a.id===e.id)??null;return{kind:"presenter",character:n,presenter:r}}if(e.t==="template"){const n=t.scenes.find(r=>r.id===e.id)??null;return{kind:"scene",scene:n,custom:!!n&&"custom"in n&&!!n.custom}}return null}const Zf={product:"product",presenter:"presenter",scene:"scene"},Ki=48;function Cre(e){return e?e.t==="product"?"product":e.t==="character"?"presenter":e.t==="template"?"scene":null:null}function Su(e){const t=Cre(e);return t||((e==null?void 0:e.t)==="color"?"color":null)}function jre(e){const t=Su(e);return t||((e==null?void 0:e.t)==="ref"||(e==null?void 0:e.t)==="mark"?e.t:null)}function k8(e){return(e==null?void 0:e.t)==="ref"||(e==null?void 0:e.t)==="mark"?e.imageHash:null}const P0=e=>{const t=(e??"").trim();return t||void 0},$5=e=>(e==null?void 0:e.custom)===!0;function Gi(e,t){return e==="product"?[...(t.libraryProducts.length?t.libraryProducts:t.brandProducts).map(r=>{var a,i;return T5(r,"brand",im((i=(a=r.shots)==null?void 0:a[0])==null?void 0:i.file,"tile"))}),...t.demoProducts.map(r=>T5(r,"catalog",r.previewUrl??null))]:e==="presenter"?[...t.presenters.map(n=>{const r=ii(n);return{kind:"presenter",id:n.id,label:n.name,full:[n.name,P0(n.descriptor)].filter(Boolean).join(" · "),sub:P0(n.descriptor),search:fp(n),thumb:Pn(r.src,"tile"),crop:r.crop,source:$5(n)?"brand":"catalog",recommended:Sre(n,t.productCategory),token:{t:"character",id:n.id}}}),...t.cast.map(n=>{const r=qv(n);return{kind:"presenter",id:n.id,label:n.name,full:n.name,search:n.name,thumb:Pn(r.src,"tile"),crop:r.crop,source:"brand",token:{t:"character",id:n.id}}})]:t.scenes.map(n=>({kind:"scene",id:n.id,label:ol(n,"card"),full:ol(n,"tooltip"),sub:P0(n.lighting),search:dp(n),thumb:Pn(n.previewUrl??null,"tile"),tint:zu(n.previewColor),source:$5(n)?"brand":"catalog",recommended:kre(n,t.productCategory),token:{t:"template",id:n.id}}))}function T5(e,t,n){return{kind:"product",id:e.id,label:Co(e,"chip"),full:Co(e,"tooltip"),sub:Are(e),search:kw(e),thumb:n,source:t,token:{t:"product",id:e.id}}}function Are(e){const t=e;return P0(t.brand)??P0(t.vendor)}function Bu(e,t){const n=t.trim();return n?e.filter(r=>jo(r.search,n)):e}function D5(e,t,n){return t.source==="brand"?0:e==="scene"?n.has(t.id)?1:t.recommended?2:3:e==="presenter"?t.recommended?1:2:1}function Lm(e,t,n){const r=n.currentId?t.find(h=>h.id===n.currentId)??null:null,a=r?t.filter(h=>h.id!==r.id):t,l=[...Bu(a,n.query)].sort((h,p)=>D5(e,h,n.bookmarked)-D5(e,p,n.bookmarked)).map(h=>n.bookmarked.has(h.id)?{...h,bookmarked:!0}:h),{visible:u,remaining:f}=jw(l,n.shown??Ki);return{current:r,items:u,remaining:f,total:l.length}}const Nre={$:"product","/":"scene","@":"presenter"},AR={Products:8,Presenters:8,Colors:16,Scenes:8},NR={$:"Products","/":"Scenes","@":"Presenters","#":"Colors"};function c0(e){return AR[NR[e??"$"]]}function MR(e){return{key:`${e.kind}:${e.id}`,group:e.kind==="presenter"?"Presenters":e.kind==="scene"?"Scenes":"Products",label:e.label,hint:e.sub,search:e.search,thumb:e.thumb??void 0,crop:e.crop,token:e.token}}function Mre(e,t,n){return Lm(e,t,{currentId:null,query:"",bookmarked:n,shown:t.length}).items.map(MR)}function H5(e,t){const{visible:n,remaining:r}=jw(e,t);return{items:n,remaining:r,total:e.length}}function Rre(e,t,n={query:""}){const r=n.query.trim(),a=n.bookmarked??new Set,i=n.shown??AR[NR[e]];if(e==="#"){const h=(t.colors??[]).map(Pre),p=r?h.filter(g=>jo(g.search??g.label,r)):h;return H5(p,i)}const l=Nre[e],u=l==="product"?t.products:l==="presenter"?t.presenters:t.scenes??[],f=r?Bu(u,r).map(MR):Mre(l,u,a);return H5(f,i)}function Pre(e){return{key:`color:${e.hex}`,group:"Colors",label:e.name,hint:e.hex,search:`${e.name} ${e.hex}`,swatch:e.hex,token:{t:"color",hex:e.hex,name:e.name||void 0}}}const Lre="(pointer: coarse)";function $re(e){return Sr(ta)?o.jsx(Fre,{...e}):o.jsx(Ire,{...e,onMove:void 0})}function Tre(){return!Sr(Lre)}const Dre=e=>`Remove ${Zf[e]}`;function O5(e,t,n){const r={slug:t};return e==="product"?ga(r,n):e==="presenter"?xa(r,n):Ir(r,n)}function RR({kind:e,currentId:t,candidates:n,brandId:r,brandSlug:a,warning:i,note:l,onPick:u,onRemove:f,onClose:h,onAttachRequest:p,onMove:g,views:v,autoFocusSearch:w}){const[b,y]=s.useState(""),[k,S]=s.useState(!1),E=async I=>{if(!(!v||k)){S(!0);try{await v.onPick(I)}finally{S(!1)}}},[j,N]=s.useState(Ki),A=s.useRef(null),T=s.useRef(null),[P,C]=s.useState(0),R=s.useMemo(()=>e==="scene"?new Set(ui(r)):new Set,[e,r]);s.useEffect(()=>{N(Ki),C(0)},[b]);const $=s.useMemo(()=>Lm(e,n,{currentId:t,query:b,bookmarked:R,shown:j}),[e,n,t,b,R,j]);s.useLayoutEffect(()=>{var I;w&&((I=A.current)==null||I.focus({preventScroll:!0}))},[w]),s.useEffect(()=>{C(I=>Math.max(0,Math.min(I,$.items.length-1)))},[$.items.length]);const H=s.useCallback(I=>{var O;const F=(O=T.current)==null?void 0:O.querySelectorAll("[data-nav]")[I];F&&(C(I),F.focus({preventScroll:!0}),F.scrollIntoView({block:"nearest"}))},[]),D=s.useCallback(()=>{const I=T.current;return I?Math.max(1,getComputedStyle(I).gridTemplateColumns.split(" ").filter(Boolean).length):1},[]),q=I=>{var V;if(I.key==="Escape"){I.preventDefault(),I.stopPropagation(),h("escape");return}const F=I.target===A.current;if(F&&I.key==="ArrowDown"){I.preventDefault(),H(0);return}if(F&&I.key==="Enter"){I.preventDefault(),$.items[0]&&u($.items[0]);return}if(F)return;const O=D(),Z=I.key==="ArrowRight"?1:I.key==="ArrowLeft"?-1:I.key==="ArrowDown"?O:I.key==="ArrowUp"?-O:0;if(Z){I.preventDefault();const B=P+Z;B<0&&Z===-O?(V=A.current)==null||V.focus():B>=0&&B<$.items.length&&H(B);return}I.key==="Home"?(I.preventDefault(),H(0)):I.key==="End"&&(I.preventDefault(),H($.items.length-1))},_=Zf[e],U=e==="product",Y=!!$.current&&!!v&&v.options.length>1&&!b.trim();return o.jsxs("div",{className:"sc-swap-inner","data-sections":Y||void 0,onKeyDown:q,children:[o.jsx("div",{className:"sc-swap-head",children:o.jsxs("span",{className:"sc-swap-search",children:[o.jsx(Gu,{size:13}),o.jsx("input",{ref:A,type:"text",value:b,onChange:I=>y(I.target.value),placeholder:`Search ${_}s`,"aria-label":`Search ${_}s`,autoComplete:"off",spellCheck:!1})]})}),$.current&&!Y&&o.jsxs("div",{className:"sc-swap-cur",title:$.current.full,children:[o.jsx(I5,{src:$.current.thumb,tinted:!!$.current.tint,crop:$.current.crop}),o.jsxs("span",{className:"sc-swap-curtext",children:[o.jsx("b",{dir:"auto",children:$.current.label}),$.current.sub&&o.jsx("span",{dir:"auto",children:$.current.sub})]}),o.jsx("a",{className:"sc-swap-open",href:O5(e,a,$.current.id),target:"_blank",rel:"noreferrer",title:`Open this ${_} in a new tab`,"aria-label":`Open ${$.current.label} in a new tab`,children:o.jsx(Ku,{size:14})}),o.jsx("span",{className:"sc-swap-tick","aria-hidden":!0,children:o.jsx(Un,{size:11,weight:"bold"})})]}),o.jsxs("div",{className:"sc-swap-body",children:[Y&&$.current&&v&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"sc-ap-sec",children:[o.jsx("span",{className:"sc-ap-sec-title",dir:"auto",children:$.current.label}),o.jsxs("a",{className:"sc-ap-sec-act sc-swap-sec-open",href:O5(e,a,$.current.id),target:"_blank",rel:"noreferrer","aria-label":`Open ${$.current.label} in a new tab`,children:["Open",o.jsx(Ku,{size:12})]})]}),o.jsxs("fieldset",{className:"sc-swap-this","aria-label":`${$.current.label}: the picture a shot follows`,"aria-busy":k||void 0,children:[o.jsx(Hre,{views:v.options,on:!v.picked,disabled:k,onPress:()=>void E(null)}),v.options.map(I=>o.jsx(Ore,{option:I,on:v.picked===I.view,disabled:k,onPress:()=>void E(v.picked===I.view?null:I)},I.view))]}),o.jsx("div",{className:"sc-ap-sec sc-swap-sec-others",children:o.jsxs("span",{className:"sc-ap-sec-title",children:["Other ",_,"s",o.jsx("span",{className:"sc-ap-sec-n",children:$.total})]})})]}),$.items.length===0&&o.jsx("p",{className:"sc-swap-empty",children:b.trim()?`Nothing matches “${b.trim()}”.`:`No other ${_}s.`}),o.jsx("div",{className:"sc-swap-grid",ref:T,role:"listbox","aria-label":`Choose a ${_}`,children:$.items.map((I,F)=>o.jsxs("div",{className:"sc-swap-card",role:"option","aria-selected":!1,"data-nav":F,tabIndex:F===P?0:-1,title:I.full,style:I.tint?{"--tint":I.tint}:void 0,onFocus:()=>C(F),onClick:()=>u(I),onKeyDown:O=>{O.key!=="Enter"&&O.key!==" "||(O.preventDefault(),u(I))},children:[o.jsx(I5,{src:I.thumb,tinted:!!I.tint,crop:I.crop}),o.jsxs("b",{dir:"auto",children:[I.bookmarked&&o.jsxs(o.Fragment,{children:[o.jsx(Ua,{className:"sc-bm-mark",size:10,weight:"fill","aria-hidden":!0}),o.jsx("span",{className:"sc-vh",children:"Kept. "})]}),I.label]}),U&&I.sub&&o.jsx("span",{dir:"auto",children:I.sub}),e==="scene"&&o.jsx(Aw,{})]},I.id))}),$.remaining>0&&o.jsxs("button",{type:"button",className:"sc-swap-more",onClick:()=>N(I=>I+Ki),children:["Show ",Math.min(Ki,$.remaining)," more of ",$.total]})]}),o.jsxs("div",{className:"sc-swap-foot",children:[t&&!$.current&&o.jsxs("p",{className:"sc-swap-warn",children:["This ",_," is no longer available."]}),l&&o.jsx("p",{className:"sc-chip-preview-note",children:l}),i&&o.jsx("p",{className:"sc-swap-warn",children:i}),i&&p&&e==="scene"&&o.jsxs("div",{className:"sc-swap-attach",children:[i.includes("product")&&o.jsx("button",{type:"button",className:"sc-btn",onClick:()=>p("Products"),children:"Attach a product"}),i.includes("person")&&o.jsx("button",{type:"button",className:"sc-btn",onClick:()=>p("Presenters"),children:"Attach a presenter"})]}),g&&o.jsxs("div",{className:"sc-swap-move",children:[o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>g(-1),children:[o.jsx(O4,{size:13})," Move earlier"]}),o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>g(1),children:["Move later ",o.jsx(_a,{size:13})]})]}),f&&o.jsxs("button",{type:"button",className:"sc-swap-remove",onClick:f,children:[o.jsx(ul,{size:13}),Dre(e)]})]})]})}function Aw(){return o.jsxs("span",{className:"sc-ap-puck","aria-hidden":!0,children:[o.jsx(fr,{className:"sc-ap-puck-add",size:11,weight:"bold"}),o.jsx(Un,{className:"sc-ap-puck-on",size:11,weight:"bold"}),o.jsx(Mn,{className:"sc-ap-puck-off",size:11,weight:"bold"})]})}function Hre({views:e,on:t,disabled:n,onPress:r}){const a=e.slice(0,4),i=e.length-3;return o.jsxs("button",{type:"button",className:"sc-ap-card","data-on":t?"":void 0,"data-whole":"","aria-pressed":t,disabled:n,onClick:r,children:[o.jsx("span",{className:"sc-ap-thumb sc-swap-mosaic","data-count":a.length,children:a.map((l,u)=>o.jsxs("span",{className:"sc-swap-cut","data-more":u===3&&i>0?"":void 0,children:[o.jsx("img",{src:Pn(l.thumb,"micro"),alt:"",loading:"lazy"}),u===3&&i>0&&o.jsxs("span",{className:"sc-swap-cut-more",children:["+",i]})]},l.view))}),o.jsx("span",{className:"sc-ap-cap",children:o.jsx("b",{children:"Whole scene"})}),o.jsx(Aw,{})]})}function Ore({option:e,on:t,disabled:n,onPress:r}){return o.jsxs("button",{type:"button",className:"sc-ap-card","data-on":t?"":void 0,"aria-pressed":t,disabled:n,onClick:r,children:[o.jsx("span",{className:"sc-ap-thumb",children:o.jsx("img",{src:Pn(e.thumb,"small"),alt:"",loading:"lazy"})}),o.jsx("span",{className:"sc-ap-cap",children:o.jsx("b",{children:e.name})}),o.jsx(Aw,{})]})}function I5({src:e,tinted:t,crop:n}){const[r,a]=s.useState(!1);return s.useEffect(()=>a(!1),[e]),!e||r?o.jsx("span",{className:"sc-swap-thumb sc-swap-thumb-empty",children:o.jsx(Js,{size:18})}):o.jsx("img",{className:"sc-swap-thumb","data-tinted":t||void 0,"data-crop":n,src:e,alt:"",loading:"lazy",onError:()=>a(!0)})}function Ire(e){const{anchor:t,kind:n,onClose:r}=e,a=Tre(),[i,l]=s.useState(null),u=s.useRef(null);return s.useLayoutEffect(()=>{var h,p;const f=()=>{const g=window.visualViewport,v=Cw(t.getBoundingClientRect(),{width:(g==null?void 0:g.width)??window.innerWidth,height:(g==null?void 0:g.height)??window.innerHeight},n==="scene"?{maxHeight:Une}:void 0);if(!v){r("outside");return}l(v)};return f(),window.addEventListener("resize",f),window.addEventListener("scroll",f,!0),(h=window.visualViewport)==null||h.addEventListener("resize",f),(p=window.visualViewport)==null||p.addEventListener("scroll",f),()=>{var g,v;window.removeEventListener("resize",f),window.removeEventListener("scroll",f,!0),(g=window.visualViewport)==null||g.removeEventListener("resize",f),(v=window.visualViewport)==null||v.removeEventListener("scroll",f)}},[t,r]),s.useEffect(()=>{const f=h=>{var g;const p=h.target;(g=u.current)!=null&&g.contains(p)||t.contains(p)||r("outside")};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[r,t]),i?_r.createPortal(o.jsx("div",{ref:u,className:"sc-swap","data-kind":n,"data-side":i.side,role:"dialog","aria-label":`Change ${Zf[n]}`,style:yR(i),children:o.jsx(RR,{...e,autoFocusSearch:a})}),document.body):null}function Fre(e){const{kind:t,onClose:n}=e,{sheet:r,grip:a}=pd(()=>n("dismiss"));return o.jsx(Sc,{open:!0,onOpenChange:i=>!i&&n("dismiss"),children:o.jsxs(Ec,{children:[o.jsx(Cc,{className:"sc-shotsheet-scrim"}),o.jsxs(jc,{ref:r,className:"sc-shotsheet sc-swapsheet","data-kind":t,"aria-describedby":void 0,onOpenAutoFocus:i=>{var l;i.preventDefault(),(l=r.current)==null||l.focus({preventScroll:!0})},onCloseAutoFocus:i=>i.preventDefault(),onEscapeKeyDown:i=>{i.preventDefault(),n("escape")},children:[o.jsxs("div",{className:"sc-shotsheet-grip",...a,children:[o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0}),o.jsxs(Ac,{className:"sc-vh",children:["Change ",Zf[t]]})]}),o.jsx(RR,{...e,autoFocusSearch:!1})]})]})})}const _re=260;function Vre(e){return Sr(ta)?o.jsx(zre,{...e}):o.jsx(Zre,{...e,onMove:void 0})}function du(e,t){const n=e?or(e):null,r=t?or(t):null;return!!n&&n===r}function PR({currentHex:e,currentName:t,palette:n,onPick:r,onRemove:a,onClose:i,onMove:l}){const u=s.useMemo(()=>{const S=new Set,E=[],j=A=>{const T=or(A.hex);!T||S.has(T)||(S.add(T),E.push({...A,hex:T}))},N=e?or(e):null;N&&!n.some(A=>du(A.hex,N))&&j({hex:N,name:t||N,slot:"accent"});for(const A of n)j(A);return E},[n,e,t]),f=s.useRef(null),[h,p]=s.useState(()=>Math.max(0,u.findIndex(S=>du(S.hex,e))));s.useEffect(()=>{p(S=>Math.max(0,Math.min(S,Math.max(0,u.length-1))))},[u.length]),s.useLayoutEffect(()=>{var E,j;const S=Math.max(0,u.findIndex(N=>du(N.hex,e)));(j=(E=f.current)==null?void 0:E.querySelectorAll("[data-nav]")[S])==null||j.focus({preventScroll:!0})},[]);const g=s.useCallback(S=>{var j;const E=(j=f.current)==null?void 0:j.querySelectorAll("[data-nav]")[S];E&&(p(S),E.focus({preventScroll:!0}))},[]),v=S=>{if(S.key==="Escape"){S.preventDefault(),S.stopPropagation(),i("escape");return}if(S.key==="ArrowDown"||S.key==="ArrowUp"){S.preventDefault();const E=h+(S.key==="ArrowDown"?1:-1);E>=0&&E<u.length&&g(E)}},w=S=>r({t:"color",hex:S.hex,name:S.name||void 0}),b=(S,E)=>{const j=u.find(N=>du(N.hex,S));r({t:"color",hex:S,name:(j==null?void 0:j.name)||void 0},{live:!0})},y=e?or(e):null,k=!!y&&!n.some(S=>du(S.hex,y));return o.jsxs("div",{className:"sc-swap-inner",onKeyDown:v,children:[o.jsx("div",{className:"sc-swap-body",children:u.length===0?o.jsx("p",{className:"sc-swap-empty",children:"No brand colours yet."}):o.jsx("div",{className:"sc-swap-swatches",ref:f,role:"listbox","aria-label":"Choose a colour",children:u.map((S,E)=>{const j=du(S.hex,e),N=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-swap-dot",style:{background:S.hex},"aria-hidden":!0}),o.jsx("b",{dir:"auto",children:S.name}),o.jsx("span",{children:S.hex}),j&&o.jsx("span",{className:"sc-swap-tick","aria-hidden":!0,children:o.jsx(Un,{size:11,weight:"bold"})})]});return k&&j?o.jsx(td,{className:"sc-swap-swatch",triggerStyle:{background:"none"},value:S.hex,presets:n.map(A=>A.hex),commitMode:"live",align:"start",label:`Edit ${S.name}`,triggerProps:{role:"option","aria-selected":!0,"data-on":"","data-nav":E,tabIndex:E===h?0:-1,title:`${S.name} ${S.hex}`,onFocus:()=>p(E)},onChange:A=>b(A),children:N},"current-custom"):o.jsx("div",{className:"sc-swap-swatch",role:"option","aria-selected":j,"data-on":j||void 0,"data-nav":E,tabIndex:E===h?0:-1,title:`${S.name} ${S.hex}`,onFocus:()=>p(E),onClick:()=>w(S),onKeyDown:A=>{A.key!=="Enter"&&A.key!==" "||(A.preventDefault(),w(S))},children:N},S.hex)})})}),o.jsxs("div",{className:"sc-swap-foot",children:[o.jsxs(td,{className:"sc-swap-swatch sc-swap-custom",triggerStyle:{background:"none"},value:e??xm(n),presets:n.map(S=>S.hex),commitMode:"live",align:"start",label:"Custom colour",onChange:S=>b(S),children:[o.jsx(fr,{size:12}),o.jsx("b",{children:"Custom colour"})]}),l&&o.jsxs("div",{className:"sc-swap-move",children:[o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>l(-1),children:[o.jsx(O4,{size:13})," Move earlier"]}),o.jsxs("button",{type:"button",className:"sc-btn",onClick:()=>l(1),children:["Move later ",o.jsx(_a,{size:13})]})]}),a&&o.jsxs("button",{type:"button",className:"sc-swap-remove",onClick:a,children:[o.jsx(ul,{size:13}),"Remove colour"]})]})]})}function Zre(e){const{anchor:t,onClose:n}=e,[r,a]=s.useState(null),i=s.useRef(null);return s.useLayoutEffect(()=>{var u,f;const l=()=>{const h=window.visualViewport,p=Cw(t.getBoundingClientRect(),{width:(h==null?void 0:h.width)??window.innerWidth,height:(h==null?void 0:h.height)??window.innerHeight},{width:_re});if(!p){n("outside");return}a(p)};return l(),window.addEventListener("resize",l),window.addEventListener("scroll",l,!0),(u=window.visualViewport)==null||u.addEventListener("resize",l),(f=window.visualViewport)==null||f.addEventListener("scroll",l),()=>{var h,p;window.removeEventListener("resize",l),window.removeEventListener("scroll",l,!0),(h=window.visualViewport)==null||h.removeEventListener("resize",l),(p=window.visualViewport)==null||p.removeEventListener("scroll",l)}},[t,n]),s.useEffect(()=>{const l=u=>{var h,p;const f=u.target;(h=i.current)!=null&&h.contains(f)||t.contains(f)||(p=f.closest)!=null&&p.call(f,".sc-cp")||n("outside")};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[n,t]),r?_r.createPortal(o.jsx("div",{ref:i,className:"sc-swap","data-kind":"color","data-side":r.side,role:"dialog","aria-label":"Change colour",style:yR(r),children:o.jsx(PR,{...e})}),document.body):null}function zre(e){const{onClose:t}=e,{sheet:n,grip:r}=pd(()=>t("dismiss"));return o.jsx(Sc,{open:!0,onOpenChange:a=>!a&&t("dismiss"),children:o.jsxs(Ec,{children:[o.jsx(Cc,{className:"sc-shotsheet-scrim"}),o.jsxs(jc,{ref:n,className:"sc-shotsheet sc-swapsheet","data-kind":"color","aria-describedby":void 0,onOpenAutoFocus:a=>{var i;a.preventDefault(),(i=n.current)==null||i.focus({preventScroll:!0})},onCloseAutoFocus:a=>a.preventDefault(),onEscapeKeyDown:a=>{a.preventDefault(),t("escape")},children:[o.jsxs("div",{className:"sc-shotsheet-grip",...r,children:[o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0}),o.jsx(Ac,{className:"sc-vh",children:"Change colour"})]}),o.jsx(PR,{...e})]})]})})}function zf(e){const{brand:t,products:n}=dn(),{scenes:r,presenters:a,demoProducts:i}=Hn(),l=s.useMemo(()=>Jh(Dc(t),r),[t,r]),u=s.useMemo(()=>Jh(Hf(t),a),[t,a]),f=s.useMemo(()=>{var p;return(((p=t==null?void 0:t.json)==null?void 0:p.characters)??[]).filter(g=>(g==null?void 0:g.origin)!=="custom")},[t]),h=s.useMemo(()=>{var p;return K0(((p=t==null?void 0:t.json)==null?void 0:p.products)??[])},[t]);return s.useMemo(()=>({libraryProducts:CN(n),brandProducts:h,demoProducts:i,presenters:u,cast:f,scenes:l,productCategory:e??null}),[n,h,i,u,f,l,e])}const u0=new Map,Bre=64;function LR(e){let t=u0.get(e);if(!t)for(t=Wre(e).then(n=>n?Kre(n.data,4):null).catch(()=>null),u0.set(e,t);u0.size>Bre;)u0.delete(u0.keys().next().value);return t}function Ure(e,t){LR(t).then(n=>{const r=zu(n??void 0);!r||!e.isConnected||(e.dataset.tinted="true",e.style.setProperty("--tint",r))})}async function Wre(e){const t=new Image;t.decoding="async",t.src=e;try{await t.decode()}catch{return null}const n=Math.min(1,48/Math.max(t.naturalWidth,t.naturalHeight,1)),r=Math.max(1,Math.round(t.naturalWidth*n)),a=Math.max(1,Math.round(t.naturalHeight*n)),i=document.createElement("canvas");i.width=r,i.height=a;const l=i.getContext("2d",{willReadFrequently:!0});if(!l)return null;l.drawImage(t,0,0,r,a);try{return l.getImageData(0,0,r,a)}catch{return null}}function Kre(e,t){const n=Array.from({length:24},()=>({score:0,r:0,g:0,b:0}));for(let a=0;a+t-1<e.length;a+=t){if(e[a+3]<128)continue;const i=e[a],l=e[a+1],u=e[a+2],{h:f,s:h,l:p}=Gre(i,l,u);if(h<.18||p<.12||p>.92)continue;const g=h*(1-Math.abs(p-.5)*1.2),v=n[Math.min(23,Math.floor(f/360*24))];v.score+=g,v.r+=i*g,v.g+=l*g,v.b+=u*g}const r=n.reduce((a,i)=>i.score>a.score?i:a,n[0]);return r.score<=0?null:Yre(r.r/r.score,r.g/r.score,r.b/r.score)}function Gre(e,t,n){const r=e/255,a=t/255,i=n/255,l=Math.max(r,a,i),u=Math.min(r,a,i),f=(l+u)/2;if(l===u)return{h:0,s:0,l:f};const h=l-u,p=f>.5?h/(2-l-u):h/(l+u);let g;return l===r?g=((a-i)/h+(a<i?6:0))*60:l===a?g=((i-r)/h+2)*60:g=((r-a)/h+4)*60,{h:g,s:p,l:f}}function Yre(e,t,n){const r=a=>Math.max(0,Math.min(255,Math.round(a))).toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(n)}`}const F5=["hero","place","close","hands","angle","bold"],_5=e=>[...e].sort((t,n)=>F5.indexOf(t.view)-F5.indexOf(n.view));function qre(e){const t=e&&e.custom?e:null,n=e&&!t?e.id:null,[r,a]=s.useState(null);if(s.useEffect(()=>{if(!n)return;let i=!0;return je.sceneFrames(n).then(l=>{if(!i)return;const u=l.views.map(f=>({view:f.view,name:Hu[f.view],thumb:f.url,hash:null}));a({id:n,views:u})}).catch(()=>{}),()=>{i=!1}},[n]),t){const i=[];t.placeUrl&&t.previewHash&&i.push({view:"place",name:Hu.place,thumb:t.placeUrl,hash:t.previewHash});for(const l of t.examples??[])i.push({view:l.role,name:Hu[l.role],thumb:l.url,hash:l.hash});return _5(i)}return r&&r.id===n?_5(r.views):[]}function Xre(e){return!e||e.cap==null||e.cap<=0?null:e.cap}function Qre(e){const t=new Set;if(!e||e.cap==null||e.cap<=0)return t;const n=new Set(e.attachments.map(r=>ql(r.role,r.id??r.hash)));for(const r of e.dropped){const a=ql(r.role,r.id??r.hash);r.reason!=="missing"&&!n.has(a)&&t.add(a)}return t}const ql=(e,t)=>`${e}:${t}`,S0=new Set(["product","character","ref","mark","template"]),pp=12,o4=`Shot is full: ${pp} identities. Remove one to add another.`,os=[{id:"square",label:"Square",hint:"1:1",w:1024,h:1024},{id:"portrait",label:"Portrait",hint:"4:5",w:1024,h:1280},{id:"story",label:"Story",hint:"9:16",w:1080,h:1920},{id:"landscape",label:"Landscape",hint:"16:9",w:1600,h:900}];function sd(e){const t=os.find(n=>n.id===e);return t?t.w/t.h:1}function Jre(e,t=0){var i,l;const n=os.find(u=>u.id===(e==null?void 0:e.format));if(n)return n.id;const r=(l=(i=e==null?void 0:e.rendered)==null?void 0:i.sizes)==null?void 0:l[t];if(!r||!(r[0]>0)||!(r[1]>0))return;const a=Math.log(r[0]/r[1]);return os.reduce((u,f)=>Math.abs(Math.log(f.w/f.h)-a)<Math.abs(Math.log(u.w/u.h)-a)?f:u).id}const uh=6,ese=s.forwardRef(function({initialTokens:t,onChange:n,brand:r,templates:a,presenters:i,demoProducts:l,onTemplatePick:u,scenesSitOut:f,placeholder:h,placeholderSm:p,label:g="Brief",flag:v,described:w,describedNote:b,onInspect:y,activeProductCategory:k,onAttachRequest:S,onSubmit:E,onDropFiles:j},N){var Kt,mn,$e,Ae,nt,Ge,Tt;const A=s.useRef(null),T=s.useRef(null),P=s.useId(),[C,R]=s.useState(""),$=s.useCallback(W=>{R(""),requestAnimationFrame(()=>R(W))},[]),H=s.useRef(null),[D,q]=s.useState(null),[_,U]=s.useState(null),Y=bd(),{shown:I,closeNow:F}=Y,O=s.useRef(_);s.useEffect(()=>{O.current=_},[_]);const Z=s.useRef(v);s.useEffect(()=>{Z.current=v},[v]);const[V,B]=s.useState(""),[K,ee]=s.useState(c0("$")),[se,oe]=s.useState(null),me=s.useRef(!1),ce=s.useRef(0),[we,G]=s.useState(!1),ue=s.useRef(0),{products:Ne}=dn(),ne=Ne.length?Ne:((Kt=r.json)==null?void 0:Kt.products)??[],Fe=((mn=r.json)==null?void 0:mn.characters)??[],Oe=s.useMemo(()=>Df(r.json),[r]),ot=s.useCallback((W,he)=>{var pr,Nn,nr;const pe=document.createElement("span");pe.className=Kl,pe.contentEditable="false",pe.dir="ltr",pe.dataset.kind=W.t,pe.dataset.tok=Em(W),pe.dataset.uid=he??`u${ce.current++}`;let qe="",We=null,jt,Ct=null;const Dt=jR(W,{products:ne,demoProducts:l,cast:Fe,presenters:i,scenes:a});if((Dt==null?void 0:Dt.kind)==="scene"){const Jt=Dt.scene;qe=Jt?ol(Jt,"chip"):"missing template",We=Pn((Jt==null?void 0:Jt.previewUrl)??null,"micro"),Jt&&W.t==="template"&&W.view&&(We=hn(W.view,"micro"),W.viewName&&(qe=`${qe} · ${W.viewName}`));const ur=zu(Jt==null?void 0:Jt.previewColor);ur&&(pe.dataset.tinted="true",pe.style.setProperty("--tint",ur)),!ur&&We&&Dt.custom&&Ure(pe,We)}else if((Dt==null?void 0:Dt.kind)==="product"){const Jt=Dt.product??Dt.demo;qe=Jt?Co(Jt,"chip"):"missing product",We=Dt.product?im((Nn=(pr=Dt.product.shots)==null?void 0:pr[0])==null?void 0:Nn.file,"micro"):Pn(((nr=Dt.demo)==null?void 0:nr.previewUrl)??null,"micro")}else if((Dt==null?void 0:Dt.kind)==="presenter"){const{character:Jt,presenter:ur}=Dt;qe=(Jt==null?void 0:Jt.name)??(ur==null?void 0:ur.name)??"missing person";const Cs=Jt?qv(Jt):ur?ii(ur):{src:null};We=Pn(Cs.src,"micro"),jt=Cs.crop}else if(W.t==="color")qe=W.name??W.hex,Ct=W.hex;else if(W.t==="ref")qe=W.label??"Image",We=hn(W.imageHash,"micro");else if(W.t==="mark"){const Jt=Oe.find(ur=>ur.hash===W.imageHash);qe=Jt?mm(r.json,Jt):"missing mark",We=hn(W.imageHash,"micro")}if(qe.startsWith("missing ")&&(pe.dataset.missing=""),We){const Jt=document.createElement("img");Jt.src=We,Jt.alt="",jt&&(Jt.dataset.crop=jt),Jt.onerror=()=>Jt.remove(),pe.appendChild(Jt)}else if(Ct){const Jt=document.createElement("span");Jt.className="sc-token-swatch",Jt.style.background=Ct,pe.appendChild(Jt)}const qt=document.createElement("span");qt.className="sc-token-label",qt.dir="auto",qt.textContent=qe,pe.appendChild(qt);const Zn=(v==null?void 0:v(W))??null;Zn&&(pe.title=Zn,W.t!=="template"&&(pe.dataset.warn="1")),w!=null&&w(W)&&(pe.dataset.described="1");const nn=Su(W);if(nn){const Jt=nn==="color"?"colour":Zf[nn];pe.tabIndex=-1,pe.setAttribute("role","button"),pe.setAttribute("aria-haspopup","dialog"),pe.setAttribute("aria-expanded","false"),pe.setAttribute("aria-label",`${Jt}: ${qe}. Change or remove.`)}else pe.tabIndex=-1,pe.setAttribute("role","button"),pe.setAttribute("aria-haspopup","dialog"),pe.setAttribute("aria-expanded","false"),pe.setAttribute("aria-label",`${W.t==="mark"?"brand mark":"reference image"}: ${qe}. Open, remove or move.`);pe.setAttribute("aria-keyshortcuts","Alt+ArrowLeft Alt+ArrowRight"),pe.setAttribute("aria-describedby",P),pe.setAttribute("draggable","false");const Ut=document.createElement("button");return Ut.type="button",Ut.tabIndex=-1,Ut.setAttribute("aria-hidden","true"),Ut.dataset.role="remove",Ut.appendChild(SJ()),pe.appendChild(Ut),pe},[a,ne,Fe,i,l,Oe,r,v,w,P]),Xe=s.useCallback(()=>{const W=A.current;W&&n(Ak(W))},[n]);s.useEffect(()=>{const W=A.current;W&&(Nk(W,t!=null&&t.length?t:fo(),he=>ot(he)),b0(W))},[]);const X=s.useCallback((W,he)=>{var We;const pe=A.current,qe=pe==null?void 0:pe.querySelector(`[data-uid="${CSS.escape(W)}"]`);if(pe&&qe&&Lk(pe,qe,he)){ec(pe,qe,"after");const jt=uo(pe);jt!==null&&(H.current=jt,((We=O.current)==null?void 0:We.uid)===W&&(O.current={...O.current,caret:jt}),U(Ct=>Ct&&Ct.uid===W?{...Ct,caret:jt}:Ct)),Xe(),$(X6(pe,qe))}},[Xe,$]);s.useEffect(()=>{const W=A.current;if(W)return Vne(W,{onDragStart:()=>{q(null),B(""),F()},onMoved:(he,pe)=>{Xe(),$(pe)},onCancelled:()=>$("Reorder cancelled.")})},[Xe,$,F]),s.useEffect(()=>{const W=A.current;if(W)for(const he of W.querySelectorAll(`.${Kl}`)){const pe=ps(he.dataset.tok??"");if(!pe)continue;const qe=(v==null?void 0:v(pe))??null;qe&&pe.t!=="template"?he.dataset.warn="1":delete he.dataset.warn,w!=null&&w(pe)?he.dataset.described="1":delete he.dataset.described,qe&&!("open"in he.dataset)?he.title=qe:he.removeAttribute("title")}},[v,w]),s.useEffect(()=>{const W=()=>{const he=uo(A.current);he!==null&&(H.current=he)};return document.addEventListener("selectionchange",W),()=>document.removeEventListener("selectionchange",W)},[]);const J=s.useCallback(W=>{const he=A.current;if(!he)return;if(W.t==="template"){const jt=r0(he);if(jt){jt.replaceWith(ot(W,jt.dataset.uid)),po(he),Xe(),q(null),B("");return}}const pe=za(W);if(pe){const jt=s8(he,pe);if(jt){q(null),B(""),$(`${zo(jt)||"That"} is already in the brief.`);return}}if(S0.has(W.t)&&!(W.t==="template"&&r0(he))&&Array.from(he.querySelectorAll(`.${Kl}`)).filter(Ct=>S0.has(Ct.dataset.kind??"")).length>=pp){q(null),B(""),$(o4);return}nJ(he,ot(W),{eatQuery:!!D,fallbackUnits:H.current});const We=uo(he);We!==null&&(H.current=We),Xe(),q(null),B("")},[D,ot,Xe,$]),ge=s.useRef(J);s.useEffect(()=>{ge.current=J},[J]);const ve=s.useCallback((W,he)=>{const pe=A.current,qe=pe==null?void 0:pe.querySelector(`[data-uid="${CSS.escape(W)}"]`);return!pe||!qe?!1:(qe.replaceWith(ot(he,W)),po(pe),Xe(),!0)},[ot,Xe]),Ze=s.useCallback(W=>{const he=A.current,pe=he==null?void 0:he.querySelector(`[data-uid="${CSS.escape(W)}"]`);if(!he||!pe)return null;const qe=Ya(he,pe);return a8(he,pe),Xe(),qe},[Xe]),Ye=()=>{var W;return document.documentElement.dataset.guideTask==="first-shot"&&!!((W=A.current)!=null&&W.closest('[data-guide="compose"]'))},ke=(W,he)=>{var jt;const pe=[...W.querySelectorAll(".sc-token")];if(!pe.length)return!1;const[qe]=((jt=he.getTargetRanges)==null?void 0:jt.call(he))??[];if(!qe)return!1;const We=document.createRange();return We.setStart(qe.startContainer,qe.startOffset),We.setEnd(qe.endContainer,qe.endOffset),pe.some(Ct=>We.intersectsNode(Ct))},te=s.useRef(Ze);s.useEffect(()=>{te.current=Ze},[Ze]),s.useEffect(()=>{const W=A.current;if(!W)return;const he=pe=>{if(pe.inputType.startsWith("delete")&&Ye()&&ke(W,pe))return pe.preventDefault();const qe=pe.inputType==="deleteContentBackward"?"Backspace":pe.inputType==="deleteContentForward"?"Delete":null;if(!qe)return;const We=Rk(W,qe);if(!(We!=null&&We.dataset.uid)){Pk(W,qe)&&pe.preventDefault();return}pe.preventDefault();const jt=te.current(We.dataset.uid);jt!=null&&Fa(W,jt)};return W.addEventListener("beforeinput",he),()=>W.removeEventListener("beforeinput",he)},[]);const le=s.useCallback(W=>{const he=ps(W.dataset.tok??"");if(!he||he.t!=="ref"&&he.t!=="mark")return!1;const pe=A.current,qe=pe?uo(pe):null;return qe!=null&&(H.current=qe),F(),y==null||y({src:Fr(he.imageHash),kind:he.t,label:he.t==="mark"?zo(W):null}),!0},[y,F]),Me=s.useCallback((W,he,pe,qe)=>{const We=W.dataset.uid;We&&(F(),W.dataset.open="",W.hasAttribute("aria-haspopup")&&W.setAttribute("aria-expanded","true"),W.removeAttribute("title"),q(null),B(""),U({uid:We,kind:he,anchor:W,caret:pe,touch:qe}))},[F]),ze=s.useCallback((W,he)=>{var Ct;const pe=O.current;if(O.current=null,U(null),!pe)return;const qe=A.current,We=qe==null?void 0:qe.querySelector(`[data-uid="${CSS.escape(pe.uid)}"]`);if(We){delete We.dataset.open,We.hasAttribute("aria-haspopup")&&We.setAttribute("aria-expanded","false");const Dt=ps(We.dataset.tok??""),qt=Dt?((Ct=Z.current)==null?void 0:Ct.call(Z,Dt))??null:null;qt&&(We.title=qt)}const jt=he!==void 0?he:pe.caret;if(pe.touch){jt!=null&&(H.current=jt);return}qe&&(qe.focus({preventScroll:!0}),jt!=null?Fa(qe,jt):Gl(qe))},[]);s.useEffect(()=>{if(!_)return;const W=A.current;W!=null&&W.querySelector(`[data-uid="${CSS.escape(_.uid)}"]`)||ze("outside")},[_,ze]),s.useEffect(()=>{var W;I&&((W=A.current)!=null&&W.contains(I.anchor)||F())},[I,F]),s.useEffect(()=>{const W=I==null?void 0:I.anchor;if(!W)return;W.dataset.open="";const he=W.getAttribute("title");return he&&W.removeAttribute("title"),()=>{delete W.dataset.open,he&&W.setAttribute("title",he)}},[I]),s.useImperativeHandle(N,()=>({insert:W=>ge.current(W),setTokens:W=>{const he=A.current;he&&(Nk(he,W.length?W:fo(),pe=>ot(pe)),b0(he),n(Ak(he)))},removeTemplate:()=>{const W=A.current,he=W?r0(W):null;!W||!he||(a8(W,he),Xe())},remove:W=>{const he=A.current;if(!he)return;const pe=s8(he,za(W));pe&&(a8(he,pe),Xe())},openMenu:W=>{B(""),ee(c0("$")),q({anchor:W})},focus:()=>Gl(A.current),restoreCaret:()=>{const W=A.current;if(!W)return;W.focus({preventScroll:!0});const he=H.current;he!=null?Fa(W,he):Gl(W)}}));const Re=zf(k),Be=s.useCallback(W=>Gi(W,Re),[Re]),Qe=s.useMemo(()=>new Set(ui(r.id)),[r.id]),rt=s.useMemo(()=>{var W;return D?Rre(D.sigil??"$",{products:Gi("product",Re),presenters:Gi("presenter",Re),scenes:f?[]:Gi("scene",Re),colors:qs((W=r.json)==null?void 0:W.palette)},{query:V,bookmarked:Qe,shown:K}):{items:[],remaining:0,total:0}},[D,Re,V,Qe,K,f,($e=r.json)==null?void 0:$e.palette]),_e=s.useMemo(()=>rt.items.map(W=>({...W,run:()=>W.token.t==="template"?u(W.token.id):ge.current(W.token)})),[rt.items,u]),zt=s.useCallback(()=>{rt.remaining<=0||ee(W=>W+c0(D==null?void 0:D.sigil))},[rt.remaining,D==null?void 0:D.sigil]),Et=W=>{const he=A.current,pe=W.target;if(pe.closest('[data-role="remove"]')){if(W.preventDefault(),Ye())return;const qt=Ii(pe);_&&(qt==null?void 0:qt.dataset.uid)===_.uid&&ze("remove"),qt!=null&&qt.dataset.uid&&Ze(qt.dataset.uid),q(null);return}const qe=Ii(pe),We=qe==null?void 0:qe.getBoundingClientRect();if(!(!!qe&&!!We&&W.clientX-We.left>uh&&We.right-W.clientX>uh)){if(XQ(he))return;Mk(he,W.clientX,W.clientY);return}Mk(he,W.clientX,W.clientY);const Ct=qe.dataset.uid??null;if(Ct&&(_==null?void 0:_.uid)===Ct){W.detail!==0&&ze("outside");return}const Dt=Su(ps(qe.dataset.tok??""));if(!Dt){le(qe);return}Me(qe,Dt,uo(he),!1)},Zt=W=>{if(W.pointerType!=="mouse")return;const he=A.current;if(_||D||he&&"chipDrag"in he.dataset)return;const pe=Ii(W.target),qe=pe==null?void 0:pe.dataset.uid;if(!pe||!qe||!He(pe)){Y.close();return}if((I==null?void 0:I.uid)===qe){Y.keep();return}Y.open({uid:qe,anchor:pe})},He=W=>{const he=ps(W.dataset.tok??"");if(k8(he))return!0;const pe=Su(he);return!!(pe&&pe!=="color"&&Dh(pe)&&W.querySelector("img"))},mt=W=>{const he=Ii(W.target),pe=he==null?void 0:he.dataset.uid;!he||!pe||_||D||He(he)&&gm(he)&&Y.open({uid:pe,anchor:he})},vt=W=>{if(W.pointerType==="mouse")return;const he=W.target;if(he.closest('[data-role="remove"]'))return;const pe=Ii(he);if(!pe)return;const qe=pe.getBoundingClientRect();if(W.clientX-qe.left<=uh||qe.right-W.clientX<=uh)return;const We=jre(ps(pe.dataset.tok??""));if(!We||pe.dataset.uid&&(_==null?void 0:_.uid)===pe.dataset.uid)return;W.preventDefault();const jt=A.current,Ct=document.activeElement===jt,Dt=Ct?uo(jt):H.current;Ct&&(jt==null||jt.blur()),Me(pe,We,Dt,!0)},St=W=>{const he=A.current,pe=Ii(W.target);if(pe&&!_){const qe=()=>{ec(he,pe,"after"),he==null||he.focus({preventScroll:!0})};if(W.altKey&&(W.key==="ArrowLeft"||W.key==="ArrowRight")){W.preventDefault(),he&&Lk(he,pe,W.key==="ArrowLeft"?-1:1)&&(pe.focus({preventScroll:!0}),Xe(),$(X6(he,pe)));return}if(W.key==="ArrowLeft"||W.key==="ArrowRight"){W.preventDefault(),ec(he,pe,W.key==="ArrowLeft"?"before":"after"),he==null||he.focus({preventScroll:!0});return}if(W.key==="Tab"){W.preventDefault(),ec(he,pe,W.shiftKey?"before":"after"),he==null||he.focus({preventScroll:!0});return}if(W.key==="Enter"||W.key===" "){W.preventDefault();const We=Su(ps(pe.dataset.tok??""));We&&he?Me(pe,We,Ya(he,pe)+1,!1):le(pe);return}if(W.key==="Backspace"||W.key==="Delete"){if(W.preventDefault(),Ye())return;const We=pe.dataset.uid?Ze(pe.dataset.uid):null;he==null||he.focus({preventScroll:!0}),We!=null&&Fa(he,We);return}if(W.key==="Escape"){W.preventDefault(),qe();return}}if(W.key==="Escape"&&D){W.preventDefault(),q(null),B("");return}if(W.key==="Enter"&&!W.shiftKey){const qe=W.defaultPrevented;W.preventDefault(),rre({menuOpen:!!D,handled:qe})&&E();return}if(!(D||_)&&!ere(W)){if(W.key==="Tab"&&!W.altKey&&!W.metaKey&&!W.ctrlKey){const qe=lJ(he,W.shiftKey?"back":"forward");qe&&(W.preventDefault(),qe.focus({preventScroll:!0}));return}if(!W.shiftKey&&!W.altKey&&!W.metaKey&&!W.ctrlKey){if(W.key==="ArrowLeft"||W.key==="ArrowRight"){iJ(he,W.key==="ArrowLeft"?"left":"right")&&W.preventDefault();return}if(W.key==="Backspace"||W.key==="Delete"){const qe=Rk(he,W.key);if(qe!=null&&qe.dataset.uid){if(W.preventDefault(),Ye())return;const We=Ze(qe.dataset.uid);We!=null&&Fa(he,We);return}if(Pk(he,W.key)){W.preventDefault();return}}}if((W.key==="$"||W.key==="/"||W.key==="@"||W.key==="#")&&!Ye()){const qe=A.current,We=yM(qe),jt=We.slice(-1);if(We.length&&!/[\s\u00a0]/.test(jt))return;B(""),ee(c0(W.key)),q({anchor:{getBoundingClientRect:()=>bM()??(qe==null?void 0:qe.getBoundingClientRect())??new DOMRect},sigil:W.key})}}},kt=s.useCallback(W=>{var he,pe;return(pe=qs((he=r.json)==null?void 0:he.palette).find(qe=>qe.hex===W))==null?void 0:pe.name},[(Ae=r.json)==null?void 0:Ae.palette]),Nt=s.useCallback(()=>{requestAnimationFrame(()=>{const W=T.current;if(!W)return;W.scrollHeight-W.scrollTop-W.clientHeight>1?W.dataset.more="":delete W.dataset.more})},[]);s.useEffect(()=>{const W=T.current;if(!W)return;Nt();const he=new ResizeObserver(Nt);he.observe(W);for(const pe of W.children)he.observe(pe);return()=>he.disconnect()},[Nt]);const Bt=W=>{Nt();const he=A.current,pe=W==null?void 0:W.nativeEvent;if(pe!=null&&pe.isComposing)return;QQ(he)||po(he),b0(he)&&Gl(he);const qe=me.current;me.current=!1;const We=o8(he,Ct=>ot(Ct),{commit:qe,nameFor:kt});We&&(q(null),B(""));const jt=We?{open:!1}:sre(aJ(he),qe);jt.open?D&&(jt.query!==V&&ee(c0(jt.sigil)),B(jt.query)):D&&(q(null),B("")),Xe()},at=W=>{const he=window.getSelection();if(!he||he.rangeCount===0||he.isCollapsed)return null;const pe=he.getRangeAt(0),{text:qe,html:We}=cJ(pe);return qe?(W.clipboardData.setData("text/plain",qe),W.clipboardData.setData("text/html",We),W.preventDefault(),pe):null},Mt=W=>{at(W)},ft=W=>{const he=at(W);he&&(he.deleteContents(),po(A.current),Xe())},vn=s.useCallback(W=>W.t==="template"?a.some(he=>he.id===W.id):W.t==="product"?ne.some(he=>he.id===W.id)||l.some(he=>he.id===W.id):W.t==="character"?Fe.some(he=>he.id===W.id)||i.some(he=>he.id===W.id):W.t==="mark"?Oe.some(he=>he.hash===W.imageHash):!0,[a,ne,Fe,i,l,Oe]);s.useEffect(()=>{const W=A.current;if(W)for(const he of W.querySelectorAll(`.${Kl}[data-missing]`)){const pe=ps(he.dataset.tok??"");pe&&vn(pe)&&he.replaceWith(ot(pe,he.dataset.uid))}},[vn,ot]);const Qt=W=>{Array.from(W.dataTransfer.types).includes("Files")&&(W.preventDefault(),ue.current++,G(!0))},on=W=>W.preventDefault(),Rt=()=>{ue.current=Math.max(0,ue.current-1),ue.current===0&&G(!1)},An=W=>{W.preventDefault(),ue.current=0,G(!1),W.dataTransfer.files.length&&(j==null||j(W.dataTransfer.files))},Vt=W=>{W.preventDefault();const he=W.clipboardData.files;if(he.length&&Array.from(he).some(We=>We.type.startsWith("image/"))){j==null||j(he);return}me.current=!0;const pe=dJ(W.clipboardData.getData("text/html"));if(pe&&re(pe)){const We=A.current;o8(We,jt=>ot(jt),{commit:!0,nameFor:kt})&&Xe();return}const qe=W.clipboardData.getData("text/plain");qe&&document.execCommand("insertText",!1,qe)},re=W=>{const he=A.current,pe=window.getSelection();if(!he||!pe||pe.rangeCount===0||!he.contains(pe.getRangeAt(0).startContainer))return!1;const qe=pe.getRangeAt(0);qe.deleteContents();let We=!1,jt=Array.from(he.querySelectorAll(`.${Kl}`)).filter(Nn=>S0.has(Nn.dataset.kind??"")).length,Ct=!1;const Dt=new Set,qt=[];for(const Nn of W){if(typeof Nn=="string"){qt.push(Nn);continue}if(!vn(Nn)){qt.push(rse(Nn,a,ne));continue}if(Nn.t==="template"){if(We)continue;We=!0}const nr=za(Nn);if(nr){if(Dt.has(nr)||s8(he,nr))continue;Dt.add(nr)}if(S0.has(Nn.t)&&!(Nn.t==="template"&&r0(he))){if(jt>=pp){Ct=!0;continue}jt+=1}qt.push(Nn)}Ct&&$(o4);const Zn=We?r0(he):null,nn=document.createDocumentFragment();for(const Nn of qt)nn.appendChild(typeof Nn=="string"?document.createTextNode(Nn):ot(Nn));const Ut=nn.lastChild;qe.insertNode(nn),Zn&&Zn.remove();const pr=Ut?Ut.nodeType===Node.TEXT_NODE?sp(he,Ut,Ut.length):sp(he,he,Array.from(he.childNodes).indexOf(Ut)+1):uo(he)??0;return po(he),Fa(he,pr),Xe(),!0},ae=s.useCallback(()=>{requestAnimationFrame(()=>{const W=A.current;W&&document.activeElement===W&&b0(W)&&Gl(W)})},[]),fe=_?ps(_.anchor.dataset.tok??""):null,Te=k8(fe),Ue=(_==null?void 0:_.kind)==="scene"&&(fe==null?void 0:fe.t)==="template"?a.find(W=>W.id===fe.id)??null:null,ut=qre(Ue),gt=(fe==null?void 0:fe.t)==="template"&&fe.view?((nt=ut.find(W=>W.hash===fe.view)??ut.find(W=>W.name===fe.viewName))==null?void 0:nt.view)??null:null,Pt=async W=>{if(!_||(fe==null?void 0:fe.t)!=="template")return;const{uid:he}=_,{id:pe,setup:qe}=fe;let We=(W==null?void 0:W.hash)??null;if(W&&!We)try{We=(await je.pickSceneView(pe,W.view)).hash}catch{return}ve(he,{t:"template",id:pe,...qe?{setup:qe}:{},...W&&We?{view:We,viewName:W.name}:{}}),ze("pick")},tt=fe?(v==null?void 0:v(fe))??null:null,wt=fe&&(w!=null&&w(fe))?b??null:null,Ce=I?ps(I.anchor.dataset.tok??""):null,xe=k8(Ce),et=((Ge=I==null?void 0:I.anchor.querySelector("img"))==null?void 0:Ge.getAttribute("src"))??null,yt=xe?hn(xe,"tile"):Pn(et,"tile"),Q=Su(Ce),Pe=Ce&&Dh(Ce.t)?Ce.t:Q&&Q!=="color"&&Dh(Q)?Q:null,Ke=Ce?(v==null?void 0:v(Ce))??null:null,xt=Ce&&(w!=null&&w(Ce))?b??null:null,st=Ye()?void 0:()=>{if(!_)return;const W=Ze(_.uid);ze("remove",W)};return o.jsxs("div",{className:"sc-brief",ref:T,onScroll:Nt,"data-drag-over":we||void 0,children:[o.jsx("span",{id:P,className:"sc-vh",children:"Press Enter to open, Delete to remove, Alt plus arrow keys to move."}),o.jsx("span",{className:"sc-vh",role:"status","aria-live":"polite",children:C}),o.jsx("div",{ref:A,className:"sc-brief-line",contentEditable:!0,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":"true","aria-autocomplete":"list","aria-expanded":D?!0:void 0,"aria-controls":D?k0:void 0,"aria-activedescendant":D?se??void 0:void 0,"aria-label":g,"aria-placeholder":h,tabIndex:0,dir:"auto","data-ph":h,...p?{"data-ph-sm":p}:{},onClick:Et,onPointerDown:vt,onPointerOver:Zt,onPointerLeave:W=>W.pointerType==="mouse"&&Y.close(),onFocusCapture:mt,onKeyDown:St,onInput:Bt,onCopy:Mt,onCut:ft,onPaste:Vt,onDragEnter:Qt,onDragOver:on,onDragLeave:Rt,onDrop:An,onFocus:ae,onBlur:()=>{const W=A.current;o8(W,he=>ot(he),{commit:!0,nameFor:kt})&&(q(null),B("")),Xe()}}),D&&o.jsx(wre,{anchor:D.anchor,composer:{getBoundingClientRect:()=>{var W,he,pe;return((he=(W=A.current)==null?void 0:W.closest(".sc-promptcard"))==null?void 0:he.getBoundingClientRect())??((pe=A.current)==null?void 0:pe.getBoundingClientRect())??new DOMRect}},line:{getBoundingClientRect:()=>{var W;return((W=A.current)==null?void 0:W.getBoundingClientRect())??new DOMRect}},query:V,options:_e,remaining:rt.remaining,total:rt.total,sigil:D.sigil,onMore:zt,onActiveId:oe,onClose:()=>{q(null),B("")}}),I&&yt&&Pe&&o.jsx(yd,{anchor:I.anchor,kind:Pe,src:yt,label:zo(I.anchor),warning:Ke,note:xt,onOpen:()=>{const W=I.anchor;if(xe){le(W);return}F(),y==null||y({src:yt,kind:Pe,label:zo(W)})},onHoverIn:Y.keep,onHoverOut:Y.close,onClose:F},I.uid),(_==null?void 0:_.kind)==="ref"||(_==null?void 0:_.kind)==="mark"?o.jsx(Zne,{kind:_.kind,label:zo(_.anchor),thumb:Te?hn(Te,"micro"):null,onInspect:()=>le(_.anchor),onMove:W=>X(_.uid,W),onRemove:st,onClose:ze},_.uid):(_==null?void 0:_.kind)==="color"?o.jsx(Vre,{anchor:_.anchor,currentHex:dh(_.anchor),currentName:tse(_.anchor),palette:qs((Tt=r.json)==null?void 0:Tt.palette),onPick:(W,he)=>{var qe;const pe=_.uid;if(he!=null&&he.live){const We=(qe=A.current)==null?void 0:qe.querySelector(`[data-uid="${CSS.escape(pe)}"]`);We&&wJ(We,W),Xe();return}if(nse(W.hex,dh(_.anchor))){ze("pick");return}ve(pe,W),ze("pick")},onRemove:st,onMove:W=>X(_.uid,W),onClose:ze},_.uid):_?o.jsx($re,{kind:_.kind,anchor:_.anchor,currentId:dh(_.anchor),candidates:Be(_.kind),brandId:r.id,brandSlug:r.slug,warning:tt,note:wt,onAttachRequest:S?W=>{ze("outside"),S(W)}:void 0,onPick:W=>{const he=_.uid;if(W.id===dh(_.anchor)){ze("pick");return}W.kind==="scene"?u(W.id):ve(he,W.token),ze("pick")},onRemove:st,onMove:W=>X(_.uid,W),onClose:ze,views:_.kind==="scene"?{options:ut,picked:gt,onPick:Pt}:void 0},_.uid):null]})});function dh(e){const t=ps(e.dataset.tok??"");return t?t.t==="color"?t.hex:"id"in t?t.id:null:null}function tse(e){const t=ps(e.dataset.tok??"");return(t==null?void 0:t.t)==="color"?t.name:void 0}function nse(e,t){const n=e?or(e):null,r=t?or(t):null;return!!n&&n===r}function rse(e,t,n){var r,a;if(e.t==="template"){const i=((r=t.find(l=>l.id===e.id))==null?void 0:r.name)??"template";return e.view&&e.viewName?`${i} · ${e.viewName}`:i}return e.t==="product"?((a=n.find(i=>i.id===e.id))==null?void 0:a.name)??"product":e.t==="character"?"someone":e.t==="color"?e.name??e.hex:e.t==="mark"?"brand mark":e.t==="ref"?e.label??"Image":"reference"}function fh(e,t){return t===null?e===null:e===t}function sse(e){const t=e.closest(".sc-filterbar, .sc-toolbar"),n=t==null?void 0:t.closest("[data-page-scroll]");if(!t||!n)return;let r=t.nextElementSibling;for(;r&&r.getBoundingClientRect().height===0;)r=r.nextElementSibling;if(!r)return;const i=r.getBoundingClientRect().top-n.getBoundingClientRect().top+n.scrollTop-Number.parseFloat(getComputedStyle(t).marginBottom)-t.offsetHeight;if(n.scrollTop<=i+1)return;const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches;n.scrollTo({top:i,behavior:l?"auto":"smooth"})}function Nw({"aria-label":e,activeKey:t,items:n,onSelect:r}){const a=s.useRef(null),i=s.useRef(null),l=n.map(p=>`${p.value??""}:${p.count??""}`).join("|");s.useLayoutEffect(()=>{const p=a.current,g=i.current;if(!p||!g)return;let v=0;const w=()=>{const N=g.querySelector(":scope > button[data-on]");if(!N)return g.style.setProperty("--sc-ink-x","0px"),g.style.setProperty("--sc-ink-w","0px"),null;const A=N.querySelector(".sc-vlabel")??N;return g.style.setProperty("--sc-ink-x",`${N.offsetLeft+A.offsetLeft}px`),g.style.setProperty("--sc-ink-w",`${A.offsetWidth}px`),N},b=()=>{const N=g.scrollWidth-g.clientWidth;if(N<=1){delete p.dataset.overflowLeft,delete p.dataset.overflowRight;return}g.scrollLeft>2?p.dataset.overflowLeft="":delete p.dataset.overflowLeft,g.scrollLeft<N-2?p.dataset.overflowRight="":delete p.dataset.overflowRight},y=N=>{const A=g.scrollWidth-g.clientWidth;if(A<=0)return;const T=[...g.querySelectorAll(":scope > button")],P=T.indexOf(N);if(P<0)return;const C=72,R=g.scrollLeft,$=R+g.clientWidth,H=T[P-1],D=T[P+1],q=D?D.offsetLeft+Math.min(C,D.offsetWidth):N.offsetLeft+N.offsetWidth+8,_=H?Math.max(0,H.offsetLeft+H.offsetWidth-C):Math.max(0,N.offsetLeft-8);let U=R;if(q>$)U=Math.min(A,q-g.clientWidth);else if(_<R)U=_;else return;if(Math.abs(U-R)<1)return;const Y=window.matchMedia("(prefers-reduced-motion: reduce)").matches;g.scrollTo({left:U,behavior:Y?"auto":"smooth"})},k=w();k&&y(k),b(),g.dataset.inkReady||requestAnimationFrame(()=>{g.dataset.inkReady=""});const S=()=>{v||(v=requestAnimationFrame(()=>{v=0,b()}))},E=N=>{if(g.scrollWidth<=g.clientWidth+1||Math.abs(N.deltaX)>Math.abs(N.deltaY)||N.deltaY===0)return;const A=g.scrollWidth-g.clientWidth,T=Math.max(0,Math.min(A,g.scrollLeft+N.deltaY));T!==g.scrollLeft&&(N.preventDefault(),g.scrollLeft=T,b())},j=new ResizeObserver(()=>{w(),b()});j.observe(g);for(const N of g.querySelectorAll(":scope > button"))j.observe(N);return g.addEventListener("scroll",S,{passive:!0}),g.addEventListener("wheel",E,{passive:!1}),()=>{v&&cancelAnimationFrame(v),j.disconnect(),g.removeEventListener("scroll",S),g.removeEventListener("wheel",E)}},[t,l]);const u=p=>{fh(t,p)||(a.current&&sse(a.current),r(p))},f=p=>{var b;if(p.key!=="ArrowLeft"&&p.key!=="ArrowRight"&&p.key!=="Home"&&p.key!=="End"||n.length===0)return;p.preventDefault();const g=Math.max(0,n.findIndex(y=>fh(t,y.value)));let v=g;if(p.key==="ArrowRight"?v=Math.min(n.length-1,g+1):p.key==="ArrowLeft"?v=Math.max(0,g-1):p.key==="Home"?v=0:p.key==="End"&&(v=n.length-1),v===g)return;u(n[v].value);const w=(b=i.current)==null?void 0:b.querySelectorAll(":scope > button")[v];w==null||w.focus()},h=n.findIndex(p=>fh(t,p.value));return o.jsx("div",{ref:a,className:"sc-verticals-shell",children:o.jsxs("div",{ref:i,className:"sc-verticals",role:"tablist","aria-label":e,onKeyDown:f,children:[o.jsx("span",{className:"sc-verticals-ink","aria-hidden":!0}),n.map((p,g)=>{const v=fh(t,p.value);return o.jsxs("button",{type:"button",role:"tab","aria-selected":v,"data-on":v?"":void 0,tabIndex:v||h<0&&g===0?0:-1,onClick:()=>u(p.value),children:[o.jsx("span",{className:"sc-vlabel",children:p.label}),p.count!==void 0&&o.jsx("span",{className:"sc-vcount",children:p.count})]},p.value??"__all__")})]})})}function xd({value:e,onChange:t,noun:n,total:r,shortcut:a=!0}){const i=s.useRef(null),[l,u]=s.useState(e.trim().length>0),f=s.useCallback(()=>{var p;_r.flushSync(()=>u(!0)),(p=i.current)==null||p.focus()},[]);s.useEffect(()=>{e.trim().length>0&&u(!0)},[e]),s.useEffect(()=>{if(!a)return;const p=g=>{if(g.key!=="/"||g.metaKey||g.ctrlKey||g.altKey)return;const v=g.target;v!=null&&v.isContentEditable||v&&/^(input|textarea|select)$/i.test(v.tagName)||(g.preventDefault(),f())};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[f,a]);const h=p=>{var g;p.key==="Escape"&&(p.stopPropagation(),e?t(""):(u(!1),(g=i.current)==null||g.blur()))};return o.jsxs("div",{className:"sc-libsearch","data-open":l?"":void 0,children:[o.jsx("button",{type:"button",className:"sc-libsearch-toggle","aria-label":`Search ${n}`,"aria-expanded":l,tabIndex:l?-1:0,onClick:f,children:o.jsx(Gu,{size:16})}),o.jsxs("div",{className:"sc-libsearch-field",children:[o.jsx(Gu,{size:15,"aria-hidden":!0}),o.jsx("input",{ref:i,type:"search",value:e,placeholder:r==null?`Search ${n}`:`Search ${r} ${n}`,"aria-label":`Search ${n}`,autoComplete:"off",autoCorrect:"off",spellCheck:!1,tabIndex:l?0:-1,onChange:p=>t(p.target.value),onKeyDown:h,onBlur:()=>{e.trim()||u(!1)}}),o.jsx("button",{type:"button",className:"sc-libsearch-clear","aria-label":"Clear search",hidden:!e,tabIndex:e?0:-1,onMouseDown:p=>p.preventDefault(),onClick:()=>{var p;t(""),(p=i.current)==null||p.focus()},children:o.jsx(Mn,{size:12,weight:"bold"})})]})]})}function $R({why:e,children:t}){return e?o.jsx(Iv,{content:e,className:"sc-tip",maxWidth:"220px",children:xN(t)}):t}const ase=["All","Products","Presenters","Scenes","Colors","Brand","Shots"],mp=ase.filter(e=>e!=="All"),V5={Products:"Products",Presenters:"Presenters",Scenes:"Scenes",Colors:"Brand colors",Brand:"Brand marks",Shots:"Shots"},ose={Products:"Product",Presenters:"Presenter",Scenes:"Scene",Colors:"Brand color",Brand:"Brand mark",Shots:"Reference shot"},i4={Products:"products",Presenters:"presenters",Scenes:"scenes",Colors:"brand colors",Brand:"brand marks",Shots:"shots"},ise={Products:"square",Presenters:"square",Scenes:"square",Colors:"swatch",Brand:"square",Shots:"square"},TR={Products:132,Presenters:132,Scenes:132,Colors:132,Brand:132,Shots:132},l4={Products:96,Presenters:96,Scenes:96,Colors:96,Brand:96,Shots:96},Z5=10;function lse(e,t,n){const r=(n?l4:TR)[e];return r<=0||t<=0?1:Math.max(1,Math.floor((t+Z5)/(r+Z5)))}const cse={product:"Products",presenter:"Presenters",scene:"Scenes"};function use(e){const t=cse[e.kind];return{key:za(e.token),group:t,shape:ise[t],label:e.label,sub:e.kind==="product"?e.sub:void 0,full:e.recommended?`${e.full} · Recommended`:e.full,search:e.search,thumb:Pn(e.thumb??null,"small"),crop:e.crop,recommended:e.recommended,bookmarked:e.bookmarked,token:e.token}}function dse(e){const t=Df(e).map(r=>{const a=r.hash,i=mm(e,r);return{key:`m:${a}`,group:"Brand",shape:"square",label:i,full:`${i} · the mark itself`,search:i,thumb:hn(a,"micro"),token:{t:"mark",imageHash:a}}}),n=qs(e==null?void 0:e.palette).map(r=>{const a={t:"color",hex:r.hex,name:r.name};return{key:za(a),group:"Colors",shape:"swatch",label:r.name,full:`${r.name} · ${r.hex}`,search:`${r.name} ${r.hex}`,swatch:r.hex,token:a}});return[...t,...n]}function fse(e,t){return e.map((n,r)=>{const a=`Shot ${Math.max(1,t-r)}`;return{key:`r:${n.images[0]}`,group:"Shots",shape:"square",label:a,full:`${a} · joins the shot as a reference image`,search:a,thumb:hn(n.images[0],"micro"),token:{t:"ref",imageHash:n.images[0],label:"Shot"}}})}const z5=(e,t)=>jo(`${e.label} ${e.sub??""} ${e.search}`,t),DR=`
106
+ `;function hse(e){return e.map(za).filter(t=>t.length>0).join(DR)}function pse(e){return new Set(e?e.split(DR):[])}const mse=new Set(["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"]);function gse(e,t,n,r){const a=r.length?r[r.length-1].end+1:0;if(a===0)return t==="ArrowUp"?"search":null;const i=Math.max(1,n),l=r.findIndex(p=>e>=p.start&&e<=p.end),u=r[l]??{start:0,end:a-1},f=(e-u.start)%i,h=p=>p.start+Math.floor((p.end-p.start)/i)*i;switch(t){case"ArrowRight":return e+1<a?e+1:null;case"ArrowLeft":return e>0?e-1:null;case"Home":return 0;case"End":return a-1;case"ArrowDown":{if(e+i<=u.end)return e+i;if(e<h(u))return u.end;const p=r[l+1];return p?p.start+Math.min(f,p.end-p.start):null}case"ArrowUp":{if(e-i>=u.start)return e-i;const p=r[l-1];return p?Math.min(p.end,h(p)+f):"search"}}}function vse(e,t){const n=t.trim();return e==="All"?n?`Nothing matches “${n}”.`:"Nothing to add yet.":n?`No matching ${i4[e]}.`:e==="Shots"?"No finished shots yet.":`No ${i4[e]} yet.`}function wse(e){return[{value:null,label:"All",count:mp.reduce((n,r)=>n+e[r],0)},...mp.map(n=>({value:n,label:n,count:e[n]}))]}const yse=s.memo(function({card:t,index:n,active:r,ticked:a,why:i,onPick:l,onFocus:u}){const f=g=>{(g.key==="Enter"||g.key===" ")&&g.stopPropagation()},h=i&&!a?i:null,p=o.jsxs("button",{type:"button",className:"sc-ap-card","data-shape":t.shape,"data-group":t.group,"data-nav":n,"data-on":a?"":void 0,tabIndex:r?0:-1,"aria-disabled":h?!0:void 0,"aria-pressed":a,title:h??(a?`${t.label} is in the shot. Press to remove it.`:t.full),onClick:h?void 0:()=>l(n),onFocus:()=>u(n),onKeyDown:f,children:[t.shape==="swatch"?o.jsx("span",{className:"sc-ap-thumb sc-ap-swatch",style:{background:t.swatch},"aria-hidden":!0}):o.jsx(bse,{src:t.thumb,crop:t.crop}),o.jsxs("span",{className:"sc-ap-cap",children:[o.jsxs("span",{className:"sc-vh",children:[ose[t.group],": "]}),o.jsx("b",{dir:"auto",children:t.label}),t.sub&&o.jsx("span",{dir:"auto",children:t.sub})]}),(a||!i)&&o.jsxs("span",{className:"sc-ap-puck","aria-hidden":!0,children:[o.jsx(fr,{className:"sc-ap-puck-add",size:11,weight:"bold"}),o.jsx(Un,{className:"sc-ap-puck-on",size:11,weight:"bold"}),o.jsx(Mn,{className:"sc-ap-puck-off",size:11,weight:"bold"})]}),a&&o.jsx("span",{className:"sc-vh",children:" In the shot."})]});return o.jsx($R,{why:h,children:p})});function bse({src:e,crop:t}){const[n,r]=s.useState(!1);return s.useEffect(()=>r(!1),[e]),o.jsx("span",{className:"sc-ap-thumb","data-empty":!e||n?"":void 0,children:!e||n?o.jsx(Js,{size:16}):o.jsx("img",{src:e,alt:"",loading:"lazy",decoding:"async","data-crop":t,onError:()=>r(!0)})})}function B5({onClick:e}){return o.jsxs("button",{type:"button",className:"sc-ap-card sc-ap-add sc-ap-upload-tile",title:"Add an image from your phone. It joins the shot as a reference.",onClick:e,children:[o.jsx("span",{className:"sc-ap-thumb",children:o.jsx(Z4,{size:22,"aria-hidden":!0})}),o.jsx("span",{className:"sc-ap-cap",children:o.jsx("b",{children:"Upload image"})})]})}const xse=48,kse={items:[],total:0,hasMore:!1,loading:!1,settled:!1,error:null,loadMore:()=>{}};function Mw(e,t,n=!0){const r=t.trim(),{shotsEpoch:a,subscribeActivity:i}=dn(),l=`${e}|${r}|${a}`,[u,f]=s.useState({key:"",items:[],next:null,total:0}),[h,p]=s.useState(!1),[g,v]=s.useState(null),w=s.useRef(null),b=s.useCallback(async S=>{var j;(j=w.current)==null||j.abort();const E=new AbortController;w.current=E,p(!0),v(null);try{const N=await je.feed(e,{lens:"all",sort:"newest",q:r,limit:xse,cursor:S??void 0},E.signal);if(E.signal.aborted)return;f(A=>{var P;const T=S===null||A.key!==l;return{key:l,items:T?N.items:[...A.items,...N.items],next:N.next,total:((P=N.counts)==null?void 0:P.all)??(T?N.items.length:A.total)}})}catch(N){if(E.signal.aborted)return;v(String(N.message??N))}finally{E.signal.aborted||p(!1)}},[e,r,l]);s.useEffect(()=>{if(!n)return;const S=u.key===""?0:150,E=setTimeout(()=>void b(null),S);return()=>clearTimeout(E)},[b,n]),s.useEffect(()=>()=>{var S;return(S=w.current)==null?void 0:S.abort()},[]),s.useEffect(()=>i(S=>{const E=new Map(S.map(j=>[j.id,j]));f(j=>{if(!j.items.some(A=>E.has(A.id)))return j;const N=j.items.flatMap(A=>{const T=E.get(A.id);return T?T.archived?[]:[{...A,...T}]:[A]});return{...j,items:N,total:Math.max(0,j.total-(j.items.length-N.length))}})}),[i]);const y=u.key===l?u:null,k=s.useCallback(()=>{y!=null&&y.next&&b(y.next)},[y==null?void 0:y.next,b]);return y?{items:y.items.filter(S=>S.status==="done"&&S.images.length>0),total:y.total,hasMore:y.next!==null,loading:h,settled:!0,error:g,loadMore:k}:{...kse,loading:h,error:g,loadMore:k}}const S8={Products:"product",Presenters:"presenter",Scenes:"scene"};function Sse({brand:e,tab:t,onTab:n,only:r,activeProductCategory:a,refining:i,full:l,attached:u,phone:f,touch:h,onPick:p,onRemove:g,onUpload:v,onFiles:w,onClose:b}){const y=s.useRef(a).current,k=zf(y),S=s.useMemo(()=>new Set(ui(e.id)),[e.id]),E=wl(),{applyBrand:j}=Hn(),{push:N}=cr(),[A,T]=s.useState(!1),[P,C]=s.useState(""),R=s.useDeferredValue(P),[$,H]=s.useState(Ki),[D,q]=s.useState(0),[_,U]=s.useState(f?347:696),Y=s.useRef(null),I=s.useRef(null);s.useEffect(()=>{H(Ki),q(0)},[t,R]),s.useLayoutEffect(()=>{const J=I.current;if(!J)return;const ge=()=>U(J.clientWidth-2*Cse(J));ge();const ve=new ResizeObserver(ge);return ve.observe(J),()=>ve.disconnect()},[]);const F=s.useMemo(()=>({product:Gi("product",k),presenter:Gi("presenter",k),scene:Gi("scene",k)}),[k]),O=s.useMemo(()=>dse(e.json),[e.json]),Z=Mw(e.id,R),V=s.useMemo(()=>fse(Z.items,Z.total),[Z.items,Z.total]),B=s.useMemo(()=>{const J={};for(const ge of mp){const ve=S8[ge];J[ge]=ge==="Shots"?Z.total:ve?Bu(F[ve],R).length:O.filter(Ze=>Ze.group===ge&&z5(Ze,R)).length}return J},[F,O,R,Z.total]),K=s.useCallback((J,ge)=>{const ve=S8[J];if(ve){const Ye=Lm(ve,F[ve],{currentId:null,query:R,bookmarked:S,shown:ge});return{group:J,items:Ye.items.map(use),total:Ye.total,remaining:Ye.remaining}}if(J==="Shots"){const Ye=V.slice(0,ge),ke=Z.hasMore?Math.max(1,Z.total-V.length):Math.max(0,V.length-ge);return{group:J,items:Ye,total:Z.total,remaining:ke}}const Ze=O.filter(Ye=>Ye.group===J&&z5(Ye,R));return{group:J,items:Ze.slice(0,ge),total:Ze.length,remaining:Math.max(0,Ze.length-ge)}},[F,O,R,S,V,Z.hasMore,Z.total]),ee=s.useMemo(()=>{if(t==="All"){const J=[];for(const ge of mp){const ve=lse(ge,_,f),Ze=K(ge,f&&J.length===0?Math.max(1,ve-1):ve);Ze.items.length>0&&J.push(Ze)}return J}return[K(t,t==="Shots"?Number.MAX_SAFE_INTEGER:$)]},[t,K,$,_,f]),{flat:se,navGroups:oe}=s.useMemo(()=>{const J=[],ge=[];for(const ve of ee)ve.items.length&&(ge.push({start:J.length,end:J.length+ve.items.length-1}),J.push(...ve.items));return{flat:J,navGroups:ge}},[ee]);s.useEffect(()=>{q(J=>Math.max(0,Math.min(J,se.length-1)))},[se.length]);const me=s.useCallback(J=>{var ve;const ge=(ve=I.current)==null?void 0:ve.querySelector(`[data-nav="${J}"]`);ge&&(q(J),ge.focus({preventScroll:!0}),ge.scrollIntoView({block:"nearest"}))},[]),ce=s.useRef(null),we=s.useRef(()=>{});we.current=()=>{const J=ee[0];!J||t==="All"||J.remaining<=0||(J.group==="Shots"?Z.loading||Z.loadMore():H(ge=>ge+Ki))},s.useEffect(()=>{const J=ce.current,ge=I.current;if(!J||!ge)return;const ve=new IntersectionObserver(Ze=>{Ze.some(Ye=>Ye.isIntersecting)&&we.current()},{root:ge,rootMargin:"0px 0px 240px 0px"});return ve.observe(J),()=>ve.disconnect()},[t,ee]);const G=s.useCallback(J=>{var ve,Ze;const ge=se[J];ge&&(u.has(ge.key)?g(ge):p(ge),h&&((Ze=(ve=document.activeElement)==null?void 0:ve.blur)==null||Ze.call(ve)))},[se,u,h,p,g]),ue=J=>{const ge=J.clipboardData.files;!ge.length||!Array.from(ge).some(ve=>ve.type.startsWith("image/"))||(J.preventDefault(),w(ge))},Ne=J=>{var ke,te;const ge=J.target,ve=ge instanceof HTMLInputElement&&!!((ke=Y.current)!=null&&ke.contains(ge));if(J.key==="Escape"){if(ve)return;J.preventDefault(),J.stopPropagation(),b();return}if(ve){J.key==="ArrowDown"?(J.preventDefault(),J.stopPropagation(),me(0)):J.key==="Enter"&&(J.preventDefault(),J.stopPropagation(),G(0));return}if(!mse.has(J.key)||(J.stopPropagation(),ge.closest('[role="tablist"]')))return;const Ze=ge.closest("[data-nav]");if(!Ze)return;J.preventDefault();const Ye=gse(D,J.key,Ese(Ze.closest(".sc-ap-grid")),oe);if(Ye==="search"){const le=Y.current;(te=(le==null?void 0:le.querySelector(".sc-libsearch[data-open] input"))??(le==null?void 0:le.querySelector(".sc-libsearch-toggle")))==null||te.focus()}else Ye!=null&&me(Ye)},ne=async J=>{T(!0);try{const ge=await xA(e.id,J);j(ge);const ve=ge.logoHash;ve&&p({key:`m:${ve}`,group:"Brand",shape:"square",label:"Logo",full:"Logo",search:"",token:{t:"mark",imageHash:ve}});const Ze=ge.logoEdge;Ze&&Ze<512&&N({kind:"warning",title:"Logo added, but it is small",detail:`Only ${Ze}px across. Fine lettering may not survive generation. Export it larger, or as SVG.`})}catch(ge){N(ln(ge,"Could not upload that logo"))}finally{T(!1)}},Fe=J=>E(J,{onCreated:ge=>{if(ge.kind===J){if(ge.kind==="product"){const ve={t:"product",id:ge.id};p({key:za(ve),group:"Products",shape:"square",label:"Product",full:"",search:"",token:ve});return}if(ge.kind==="presenter"){const ve={t:"character",id:ge.id};p({key:za(ve),group:"Presenters",shape:"square",label:"Presenter",full:ge.name,search:ge.name,token:ve});return}n("Scenes")}}}),Oe=async J=>{var Ze;const ge=zN((Ze=e.json)==null?void 0:Ze.palette,J);if(!ge.swatch)return;if(ge.added)try{const Ye=await je.updateBrand(e.id,{...e.json??{},palette:ge.palette},e.json);j(Ye)}catch(Ye){N(ln(Ye,"Could not save the brand"));return}const ve={t:"color",hex:ge.swatch.hex,name:ge.swatch.name};p({key:za(ve),group:"Colors",shape:"swatch",label:ge.swatch.name,full:"",search:"",swatch:ge.swatch.hex,token:ve})},ot=J=>i&&J==="Scenes"?"Scenes set up a new shot. Press X on Refining to use one.":l&&J!=="Colors"?l:null,Xe=se.length===0;let X=0;return o.jsxs("div",{className:"sc-ap-inner",onKeyDown:Ne,onPaste:ue,children:[o.jsxs("div",{className:"sc-ap-head",ref:Y,children:[o.jsx("div",{className:"sc-ap-tabs",children:o.jsx(Nw,{"aria-label":"What to add",activeKey:t==="All"?null:t,items:wse(B),onSelect:J=>n(J??"All")})}),o.jsxs("div",{className:"sc-ap-actions",children:[o.jsxs("div",{className:"sc-ap-actions-add",children:[o.jsx(xd,{value:P,onChange:C,noun:t==="All"?"everything":i4[t],total:t==="All"?void 0:B[t],shortcut:!1}),!f&&o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary sc-ap-upload",onClick:v,title:"Add an image from your computer. It joins the shot as a reference.",children:[o.jsx(Z4,{size:14,"aria-hidden":!0}),o.jsx("span",{children:"Upload image"})]})]}),!f&&o.jsx("button",{type:"button",className:"sc-icon-btn sc-ap-close",onClick:b,"aria-label":"Close",children:o.jsx(Mn,{size:14})})]})]}),o.jsxs("div",{className:"sc-ap-body",ref:I,children:[i&&t==="Scenes"&&o.jsx("p",{className:"sc-ap-hint",children:"Scenes set up a new shot, so they sit out while you are refining. Press X on Refining to use one."}),ee.map((J,ge)=>{var le,Me,ze;const ve=ot(J.group),Ze=X;X+=J.items.length;const Ye=S8[J.group],te={"--ap-min":`${(f?l4:TR)[J.group]}px`,"--ap-lines":Ye==="product"?2:1};return o.jsxs("section",{className:"sc-ap-group","aria-label":V5[J.group],children:[o.jsxs("div",{className:"sc-ap-sec",children:[o.jsxs("span",{className:"sc-ap-sec-title",children:[V5[J.group],o.jsx("span",{className:"sc-ap-sec-n",children:J.total})]}),t==="All"&&J.total>J.items.length&&o.jsxs("button",{type:"button",className:"sc-ap-sec-act",onClick:()=>n(J.group),children:["Show all ",J.total]}),t==="Products"&&!r&&o.jsx("button",{type:"button",className:"sc-ap-sec-act sc-ap-add",onClick:()=>Fe("product"),children:"Add product"}),t==="Presenters"&&!r&&o.jsx("button",{type:"button",className:"sc-ap-sec-act sc-ap-add",onClick:()=>Fe("presenter"),children:"Create presenter"}),t==="Scenes"&&!r&&o.jsx("button",{type:"button",className:"sc-ap-sec-act sc-ap-add",onClick:()=>Fe("scene"),children:"Create scene"}),t==="Colors"&&o.jsx(td,{className:"sc-ap-sec-act sc-ap-add",triggerStyle:{background:"none"},value:xm(qs((le=e.json)==null?void 0:le.palette)),presets:qs((Me=e.json)==null?void 0:Me.palette).map(Re=>Re.hex),commitMode:"close",align:"end",label:"Add color",onChange:Re=>void Oe(Re),children:"Add color"}),t==="Brand"&&o.jsxs("label",{className:"sc-ap-sec-act sc-ap-add",title:"Add your logo to the brand kit","data-busy":A||void 0,children:[o.jsx("input",{type:"file",accept:"image/*",className:"sc-vh",disabled:A,onChange:Re=>{var Qe;const Be=(Qe=Re.target.files)==null?void 0:Qe[0];Re.target.value="",Be&&ne(Be)}}),"Add logo"]})]}),o.jsxs("div",{className:"sc-ap-grid","data-shape":((ze=J.items[0])==null?void 0:ze.shape)??"square",style:te,children:[f&&ge===0&&!r&&o.jsx(B5,{onClick:v}),J.items.map((Re,Be)=>o.jsx(yse,{card:Re,index:Ze+Be,active:Ze+Be===D,ticked:u.has(Re.key),why:ve,onPick:G,onFocus:q},Re.key))]}),t!=="All"&&J.remaining>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:ce,className:"sc-ap-sentinel","aria-hidden":!0}),o.jsxs("p",{className:"sc-ap-foot","aria-live":"polite",children:[J.items.length," of ",J.total]})]})]},J.group)}),t==="Shots"&&Z.error&&o.jsxs("p",{className:"sc-ap-empty",children:["Could not load the shots. ",Z.error]}),Xe&&f&&o.jsx("div",{className:"sc-ap-grid",style:{"--ap-min":`${l4.Products}px`},children:o.jsx(B5,{onClick:v})}),Xe&&!(t==="Shots"&&(!Z.settled||Z.loading||Z.error))&&o.jsx("p",{className:"sc-ap-empty",children:vse(t,P)})]})]})}function Ese(e){return e?Math.max(1,getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length):1}function Cse(e){return Number.parseFloat(getComputedStyle(e).paddingLeft)||0}const jse="(pointer: coarse)";function Ase(e){const t=Sr(ta),n=Sr(jse),[r,a]=s.useState(e.initialTab??"All");s.useEffect(()=>{a(e.initialTab??"All")},[e.initialTab,e.tabNonce]);const[i]=ll(),l=i.get("new")!==null;return o.jsx(Nse,{id:e.id,phone:t,touch:n,creating:l,onClose:e.onClose,children:o.jsx(Sse,{brand:e.brand,tab:e.only??r,onTab:a,only:e.only,activeProductCategory:e.activeProductCategory,refining:e.refining,full:e.full,attached:e.attached,phone:t,touch:n,onPick:e.onPick,onRemove:e.onRemove,onUpload:e.onUpload,onFiles:e.onFiles,onClose:()=>e.onClose({restore:!n})})})}function Nse({id:e,phone:t,touch:n,creating:r,onClose:a,children:i}){const l=s.useRef(null),u=()=>{var p;return a({restore:!n&&!!((p=l.current)!=null&&p.contains(document.activeElement))})},f=s.useRef(u);f.current=u,s.useEffect(()=>{var p,g;n&&((g=(p=document.activeElement)==null?void 0:p.blur)==null||g.call(p))},[n]),s.useLayoutEffect(()=>{var b,y;const p=l.current,g=p==null?void 0:p.parentElement;if(!t||!p||!g)return;const v=()=>{const k=p.closest(".sc-shell")??document.documentElement,S=Number.parseFloat(getComputedStyle(k).getPropertyValue("--sc-topbar-h"))||0,E=g.getBoundingClientRect().top-S-16;p.style.setProperty("--ap-avail",`${Math.max(160,Math.round(E))}px`)};v();const w=new ResizeObserver(v);return w.observe(g),window.addEventListener("resize",v),(b=window.visualViewport)==null||b.addEventListener("resize",v),(y=window.visualViewport)==null||y.addEventListener("scroll",v),()=>{var k,S;w.disconnect(),window.removeEventListener("resize",v),(k=window.visualViewport)==null||k.removeEventListener("resize",v),(S=window.visualViewport)==null||S.removeEventListener("scroll",v)}},[t]),s.useEffect(()=>{const p=g=>{var w;if(g.key!=="Escape"||r)return;const v=document.activeElement;v instanceof HTMLInputElement&&((w=l.current)!=null&&w.contains(v))||(g.preventDefault(),g.stopPropagation(),f.current())};return window.addEventListener("keydown",p,!0),()=>window.removeEventListener("keydown",p,!0)},[r]);const h=p=>{var w;const g=document.activeElement,v=p.target;g instanceof HTMLInputElement&&((w=l.current)!=null&&w.contains(g))&&!v.closest("input")&&g.blur(),Q6(p)};return s.useEffect(()=>{const p=g=>{if(r)return;const v=g.target;v.closest('[data-guide="catch"], [data-guide="card"], [data-guide="inline"]')||document.querySelector('[data-guide="catch"]')||v.closest(".sc-attachpanel, .sc-attach-toggle, [data-attach-opener]")||f.current()};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[r]),o.jsx("div",{ref:l,className:"sc-attachpanel","data-guide-shape":"",role:"dialog",id:e,"aria-label":"Add to shot",onMouseDownCapture:h,children:i})}function Mse({target:e,onOpenImage:t,onClear:n}){var f;const r=bd(),a=e.images[0],l=(((f=e.brief)==null?void 0:f.tokens)??[]).filter(h=>h.t==="text"&&typeof h.v=="string").map(h=>h.v.trim()).join(" ").trim()||Rr(e),u=s.useCallback(()=>{a&&(r.closeNow(),t())},[a,r.closeNow,t]);return o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"sc-token sc-target-chip",role:"button",tabIndex:0,"aria-haspopup":"dialog","aria-label":n?`Version being refined: ${l}. Open the image, or remove to make a new shot.`:`Version being refined: ${l}. Open the image.`,onPointerEnter:h=>{h.pointerType==="mouse"&&a&&r.open({anchor:h.currentTarget})},onPointerLeave:h=>h.pointerType==="mouse"&&r.close(),onClick:u,onKeyDown:h=>{h.target===h.currentTarget&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),u())},children:[a?o.jsx("img",{src:hn(a,"micro"),alt:""}):o.jsx("span",{className:"sc-target-thumb sc-shimmer"}),"Refining",n&&o.jsx("button",{type:"button",onClick:h=>{h.stopPropagation(),r.closeNow(),n()},"aria-label":"Make a new shot instead",children:o.jsx(Mn,{size:12})})]}),r.shown&&a&&o.jsx(yd,{anchor:r.shown.anchor,kind:"shot",src:hn(a,"tile"),label:l,noun:"Refining this shot",onOpen:u,onHoverIn:r.keep,onHoverOut:r.close,onClose:r.closeNow})]})}function ad({src:e,kind:t,label:n,noun:r,actions:a,onRestoreFocus:i,onClose:l}){const[u,f]=s.useState(!1),h=r??bR[t],p=s.useRef(null);return o.jsxs(_s,{className:"sc-lightbox",maxWidth:"min(880px, 92vw)",onOpenAutoFocus:()=>{p.current=document.activeElement},onCloseAutoFocus:g=>{var v;if(g.preventDefault(),i)return i();(v=p.current)!=null&&v.isConnected&&p.current.focus()},onDismiss:l,children:[o.jsx("div",{className:"sc-newdlg-head sc-lightbox-head",children:o.jsx(Ss,{children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx(Mn,{size:16})})})}),o.jsx("div",{className:"sc-lightbox-frame","data-kind":t,children:u?o.jsxs("span",{className:"sc-lightbox-blank",children:[o.jsx(Js,{size:28}),"Image unavailable"]}):o.jsx("img",{src:e,alt:n?`${n}, ${h.toLowerCase()}`:h,onError:()=>f(!0)})}),o.jsxs("p",{className:"sc-lightbox-cap",children:[n&&o.jsx("b",{dir:"auto",children:n}),o.jsx("span",{children:h})]}),a&&o.jsx("div",{className:"sc-lightbox-acts",children:a})]})}const Rse={"codex-cli":{sizing:"advisory"},openrouter:{sizing:"ratio"},replicate:{sizing:"ratio",formats:["square","story","landscape"]},fal:{sizing:"exact"},demo:{sizing:"exact"}},Pse={sizing:"exact"},HR=e=>Rse[e]??Pse;function Lse(e,t){const n=HR(e).formats;return!n||n.includes(t)}const Rw=e=>HR(e).sizing,$se="portrait",Tse=1,Dse="standard",Yi=[{id:"draft",label:"Draft",edge:768,note:"quick checks"},{id:"standard",label:"Standard",edge:1024,note:"everyday shots"},{id:"high",label:"High",edge:1536,note:"hero and print"}],gp=[1,2,3,4],OR=e=>os.filter(t=>!Lse(e,t.id)).map(t=>t.id),c4=(e,t)=>t.length===0?void 0:`${e} cannot make ${os.filter(n=>t.includes(n.id)).map(n=>n.hint).join(" or ")}.`,Pw=e=>{var n;e.preventDefault();const t=e.currentTarget??e.target;(n=t==null?void 0:t.querySelector('[role="radiogroup"]'))==null||n.focus()};function E8({aria:e,width:t,trigger:n,open:r,onOpenChange:a,children:i,onCloseAutoFocus:l,guide:u}){const f=s.useRef(null);return s.useEffect(()=>{var p;const h=(p=f.current)==null?void 0:p.parentElement;h&&(h.style.pointerEvents=r?"":"none")},[r]),o.jsxs(Xu,{open:r,onOpenChange:a,children:[o.jsx(Qu,{children:o.jsx("button",{type:"button",className:"sc-var","aria-label":e,"data-guide":u,children:n})}),o.jsx(Ju,{ref:f,className:"sc-setpop",align:"end",sideOffset:8,width:t,onOpenAutoFocus:Pw,onCloseAutoFocus:l,onInteractOutside:h=>{var p;(p=h.target)!=null&&p.closest(".sc-prompt-pills")&&h.preventDefault()},children:i(()=>a(!1))})]})}function Hse({mode:e,engineId:t,engineName:n,formatId:r,onFormat:a,count:i,onCount:l,quality:u,onQuality:f,onCloseAutoFocus:h,guided:p=!1,onSettle:g}){const v=os.find(T=>T.id===r)??os[0],w=Yi.find(T=>T.id===u)??Yi[1],b=OR(t),y=Rw(t),[k,S]=s.useState(null),E=s.useRef(null);E.current=k;const j=T=>{T.preventDefault(),E.current===null&&(h==null||h(T))},N={aspect:"shape",variants:"count",resolution:"quality"},A=T=>({open:k===T,onCloseAutoFocus:j,guide:p?`compose.${N[T]}`:void 0,onOpenChange:P=>{!P&&E.current===T&&(g==null||g(N[T])),S(C=>P?T:C===T?null:C)}});return o.jsxs("div",{className:"sc-prompt-pills","data-guide":p?"compose.settings-row":void 0,children:[o.jsx(E8,{...A("aspect"),aria:`Aspect ${v.label}, ${v.hint}`,width:"178px",trigger:o.jsxs(o.Fragment,{children:[o.jsx(V6,{w:v.w,h:v.h,slot:15,box:13}),v.label]}),children:T=>o.jsxs(o.Fragment,{children:[o.jsx(Uo,{label:"Aspect ratio",className:"sc-setpop-list",value:r,ids:os.map(P=>P.id),unavailable:b,onChange:a,children:os.map(P=>o.jsxs(Wo,{id:P.id,className:"sc-setrow",on:P.id===r,unavailable:b.includes(P.id),label:`${P.label}, ${P.hint}`,onPick:()=>{a(P.id),T()},children:[o.jsx(V6,{w:P.w,h:P.h,slot:20,box:17}),o.jsx("span",{className:"sc-setrow-n",children:P.label}),o.jsx("span",{className:"sc-setrow-v",children:P.hint}),o.jsx(ak,{})]},P.id))}),c4(n,b)&&o.jsx(Pq,{children:c4(n,b)})]})}),e==="generation"&&o.jsx(E8,{...A("variants"),aria:`${i} shot${i===1?"":"s"}`,width:"156px",trigger:o.jsxs(o.Fragment,{children:[o.jsx(q9,{size:14}),i]}),children:T=>o.jsx(o.Fragment,{children:o.jsx(Uo,{label:"Shots",className:"sc-seg",value:String(i),ids:gp.map(String),onChange:P=>l(Number(P)),children:gp.map(P=>o.jsx(Wo,{id:String(P),className:"sc-seg-o",on:P===i,label:`${P} shot${P===1?"":"s"}`,onPick:()=>{l(P),T()},children:P},P))})})}),e==="generation"&&y!=="ratio"&&o.jsx(E8,{...A("resolution"),aria:`Resolution ${w.label}, ${w.edge} px`,width:"192px",trigger:o.jsxs(o.Fragment,{children:[o.jsx(v9,{size:14}),w.label]}),children:T=>o.jsx(o.Fragment,{children:o.jsx(Uo,{label:"Resolution",className:"sc-setpop-list",value:u,ids:Yi.map(P=>P.id),onChange:P=>f(P),children:Yi.map(P=>o.jsxs(Wo,{id:P.id,className:"sc-setrow",on:P.id===u,label:`${P.label}, ${P.edge} px, ${P.note}`,onPick:()=>{f(P.id),T()},children:[o.jsx("span",{className:"sc-setrow-n",children:P.label}),o.jsxs("span",{className:"sc-setrow-v",children:[P.edge," px"]}),o.jsx(ak,{})]},P.id))})})})]})}function IR({mode:e,engineId:t,engineName:n,formatId:r,onFormat:a,count:i,onCount:l,quality:u,onQuality:f,engineChoices:h,onEngine:p}){const g=OR(t),v=Rw(t);return o.jsxs(o.Fragment,{children:[h&&p&&h.length>1&&o.jsx(hh,{label:"Engine",children:o.jsx(Uo,{label:"Engine",className:"sc-seg",value:t,ids:h.map(w=>w.id),onChange:p,children:h.map(w=>o.jsx(Wo,{id:w.id,className:"sc-seg-o",on:w.id===t,label:w.displayName,onPick:()=>p(w.id),children:w.displayName},w.id))})}),o.jsx(hh,{label:"Aspect ratio",note:c4(n,g),children:o.jsx(Uo,{label:"Aspect ratio",className:"sc-seg",value:r,ids:os.map(w=>w.id),unavailable:g,onChange:a,children:os.map(w=>o.jsxs(Wo,{id:w.id,className:"sc-seg-o sc-seg-ratio",on:w.id===r,unavailable:g.includes(w.id),label:`${w.label}, ${w.hint}`,onPick:()=>a(w.id),children:[o.jsx(V6,{w:w.w,h:w.h,slot:17,box:14}),w.hint]},w.id))})}),e==="generation"&&o.jsx(hh,{label:"Shots",children:o.jsx(Uo,{label:"Shots",className:"sc-seg",value:String(i),ids:gp.map(String),onChange:w=>l(Number(w)),children:gp.map(w=>o.jsx(Wo,{id:String(w),className:"sc-seg-o",on:w===i,label:`${w} shot${w===1?"":"s"}`,onPick:()=>l(w),children:w},w))})}),e==="generation"&&v!=="ratio"&&o.jsx(hh,{label:"Resolution",note:v==="advisory"?"This engine renders at its own size, so this is a request rather than a guarantee.":void 0,children:o.jsx(Uo,{label:"Resolution",className:"sc-seg",value:u,ids:Yi.map(w=>w.id),onChange:w=>f(w),children:Yi.map(w=>o.jsx(Wo,{id:w.id,className:"sc-seg-o",on:w.id===u,label:v==="advisory"?`${w.label}, asks for ${w.edge} px, ${w.note}`:`${w.label}, ${w.edge} px, ${w.note}`,onPick:()=>f(w.id),children:w.label},w.id))})})]})}function hh({label:e,note:t,children:n}){return o.jsxs("div",{className:"sc-shotfield",children:[o.jsx("span",{className:"sc-shotfield-lb",children:e}),n,t&&o.jsx("p",{className:"sc-shotfield-note",children:t})]})}function Ose({guide:e,onSettle:t,...n}){const[r,a]=s.useState(!1),i=f=>{!f&&r&&(t==null||t()),a(f)},{sheet:l,grip:u}=pd(()=>i(!1));return o.jsxs(Sc,{open:r,onOpenChange:i,children:[o.jsx(X4,{asChild:!0,children:o.jsx("button",{type:"button",className:"sc-var sc-shotset","aria-label":"Shot settings",title:"Shot settings","data-guide":e,children:o.jsx(V4,{size:16})})}),o.jsxs(Ec,{children:[o.jsx(Cc,{className:"sc-shotsheet-scrim"}),o.jsxs(jc,{ref:l,className:"sc-shotsheet","aria-describedby":void 0,onOpenAutoFocus:Pw,onCloseAutoFocus:f=>f.preventDefault(),children:[o.jsxs("div",{className:"sc-shotsheet-grip",...u,children:[o.jsx("span",{className:"sc-shotsheet-bar","aria-hidden":!0}),o.jsx(Ac,{className:"sc-vh",children:"Shot settings"})]}),o.jsx(IR,{...n})]})]})]})}const FR=e=>e.t==="template"&&typeof e.view=="string"&&Object.hasOwn(Hu,e.view);async function Ise(e){return Promise.all(e.map(async t=>{if(t.t!=="template"||!FR(t))return t;const{view:n,viewName:r,...a}=t,i=await je.pickSceneView(t.id,n).then(l=>l.hash,()=>null);return i?{...a,view:i,...r?{viewName:r}:{}}:a}))}const Mu=e=>`scenri:draft-${e}`,Fse=e=>xr.get(e),_se=(e,t)=>xr.set(e,t),Hh=e=>xr.del(e);function U5(e,t){return e.some(n=>n.t==="text"?!!n.v.trim():n.t!=="template")||Object.values(t).some(n=>!!n.trim())}function Vse(e){const t=Fse(Mu(e));if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(typeof n!="object"||n===null)return null;const r=n;if(r.v!==1||r.brandId!==e||!Array.isArray(r.tokens)||typeof r.tplFields!="object"||!r.tplFields||r.branchId)return Hh(Mu(e)),null;const a=Date.now()-Date.parse(r.updatedAt??"");return!Number.isFinite(a)||a>OA?(Hh(Mu(e)),null):{v:1,brandId:e,updatedAt:r.updatedAt,tokens:r.tokens,tplFields:r.tplFields,setSlug:r.setSlug??null}}function _R(e,t){const n={v:1,brandId:e,updatedAt:new Date().toISOString(),tokens:t.tokens,tplFields:t.tplFields,setSlug:t.setSlug??null};_se(Mu(e),JSON.stringify(n))}function W5(e){Hh(Mu(e))}function K5(e,t,n,r,a){if(e===t)return{changed:!1,toast:null};const i=!!r;return e===null&&!i?{changed:!0,toast:null}:{changed:!0,toast:{title:i?`Switched to ${n}. This starts a new shot instead of refining ${a??"that shot"}.`:`Switched to ${n}.`,prevSceneId:e,branchWasCleared:i}}}function Zse(e,t){return e>0&&t>0&&Math.abs(Math.log(t))<Math.abs(Math.log(e))-.01?"crop":"extend"}const C8=2,zse=.15;function Bse(e,t){if(Zse(e,t)==="crop")return"crop";if(!(e>0&&t>0))return"extend";const n=t>e?t/e:e/t;return(n>C8?Math.max(C8,n*(1-zse)):n)>C8+1e-9?"crop":"extend"}const u4=4,vp=24,L0=24,VR={product:[],presenter:[],scene:null,ref:[],color:[]};function Use(e){const t=[],n=[],r=[],a=[];let i=null;const l=(u,f)=>{u.includes(f)||u.push(f)};for(const u of e)u.t==="product"?l(t,u.id):u.t==="character"?l(n,u.id):u.t==="template"?i=u.id:u.t==="ref"?l(r,u.imageHash):u.t==="color"&&l(a,u.hex.toLowerCase());return{product:t,presenter:n,scene:i,ref:r,color:a}}function Wse(e){return`${e.product.join(",")}|${e.presenter.join(",")}|${e.scene??""}|${e.ref.join(",")}|${e.color.join(",")}`}function Kse(e,t,n){const r=e.slice(0,n);return{visible:r,more:Math.max(0,e.length-r.length)}}const Lw=s.forwardRef(function({projectId:t,brand:n,engines:r,parentId:a,initialBrief:i,suppressDraftRestore:l,startScene:u,startSetup:f,startPresenter:h,startProduct:p,startRef:g,startView:v,onSeedsSpent:w,openAttachTab:b,onQueued:y,onSending:k,onAttached:S,onCeiling:E,target:j,onClearTarget:N,sourceImage:A,onRestoreBranchId:T,setSlug:P,persistDraft:C=!0,variant:R="dock",guided:$=!1},H){var Xr,Po;const{products:D,productsLoaded:q}=dn(),{demoProducts:_,demoProductsLoaded:U,loaded:Y}=Hn(),I=zf(),F=I.scenes,O=I.presenters,Z=gl(),V=vl(),{push:B}=cr(),K=r.filter(Se=>Se.available),[ee,se]=ba(Kr.engine,Q0);s.useEffect(()=>{const Se=hX(K,ee);Se!==ee&&se(Se)},[K,ee,se]);const oe=K.length===0&&r.some(Se=>Se.code==="not-installed"||Se.code==="not-authenticated"),me=K.length===0,ce=me?oe?{icon:o.jsx(GN,{}),title:"Image generation is not set up yet",detail:"About a minute, using the ChatGPT account you already have.",action:"Set up",onAct:()=>V(),info:!0}:{icon:o.jsx(O0,{size:15}),title:"No image provider connected",detail:"Add a provider key and this prompt is ready to run.",action:"Open settings",onAct:()=>Z("engines"),info:!1}:null,[we,G]=s.useState(fo()),[ue,Ne]=s.useState(void 0),[ne,Fe,Oe]=Zg(Kr.format,$se),[ot,Xe]=s.useState({}),X=j&&j.kind!=="root"?j:null,J=X?Jre(X.brief):void 0,ge=X?ot[X.id]??J??ne:ne,ve=Se=>{X?Xe(ht=>({...ht,[X.id]:Se})):Fe(Se)},[Ze,Ye]=s.useState({}),[ke,te,le]=Zg(Kr.count,Tse),[Me,ze]=s.useState(!1),[Re,Be]=s.useState(null),[Qe,rt]=s.useState(null),[_e,zt]=s.useState(!1),[Et,Zt]=s.useState("All"),[He,mt]=s.useState(0),[vt,St]=s.useState(null),[kt,Nt,Bt]=Zg(Kr.quality,Dse),[at,Mt]=s.useState(!1),[ft,vn]=s.useState(!1),Qt=Se=>vn(Se);Sr("(hover: hover) and (min-width: 1024px)");const on=Sr("(max-width: 767px)"),Rt=s.useRef(null),An=s.useRef(null),Vt=s.useRef(null),re=s.useId(),ae=s.useRef({tokens:we,tplFields:Ze,branchId:(j==null?void 0:j.id)??null});ae.current={tokens:we,tplFields:Ze,branchId:(j==null?void 0:j.id)??null};const fe=s.useRef(null),Te=s.useRef(null),Ue=s.useRef(void 0),ut=s.useRef(void 0),gt=s.useRef(void 0),Pt=s.useRef(void 0),tt=s.useCallback(Se=>{if(Te.current&&(clearTimeout(Te.current),Te.current=null),!C)return;const ht=ae.current;ht.branchId||(U5(ht.tokens,ht.tplFields)?_R(Se,{tokens:ht.tokens,tplFields:ht.tplFields,setSlug:P}):W5(Se))},[P,C]);s.useEffect(()=>{b&&(Zt(b),zt(!0))},[b]),s.useEffect(()=>{if(!i)return;const Se=(i.tokens??[]).find(Xt=>Xt.t==="format");Se&&Oe(Se.id),i.variants&&le(i.variants),i.quality&&Bt(i.quality),Ye(i.templateFields??{});const ht=cw(i);if(!ht.some(FR)){Ne(ht);return}let sn=!0;return Ise(ht).then(Xt=>{sn&&Ne(Xt)}),()=>{sn=!1}},[i]),s.useEffect(()=>{var Br;const Se=fe.current;Se&&Se!==n.id&&tt(Se);const ht=!!i||!!l||!C,sn=Se!==n.id;let Xt=null,wn=null;if(!ht&&sn){const tn=Vse(n.id);tn&&U5(tn.tokens,tn.tplFields)&&(Xt=_6(n,tn.tokens),wn=tn.tplFields)}let yn=!1;if(u&&u!==Ue.current){Ue.current=u,yn=!0;const tn=Xt??fo(),Kn=tn.find(Ra=>Ra.t==="template"),Vn=(Kn==null?void 0:Kn.id)??null,Sl=((Br=F.find(Ra=>Ra.id===u))==null?void 0:Br.name)??"this scene",El=K5(Vn,u,Sl,null,null),jd=g&&/^[a-f0-9]{32}$/.test(g)?g:null,Kf=v&&v in Hu?Hu[v]:void 0;if((El.changed||jd)&&(Xt=[{t:"template",id:u,...f?{setup:f}:{},...jd?{view:jd,...Kf?{viewName:Kf}:{}}:{}},...tn.filter(Ra=>Ra.t!=="template")],El.toast)){const Ra=El.toast;B({kind:"info",title:Ra.title,action:{label:"Undo",onClick:()=>{var Gf,Yf;Ra.prevSceneId?(Gf=Rt.current)==null||Gf.insert({t:"template",id:Ra.prevSceneId}):(Yf=Rt.current)==null||Yf.removeTemplate()}}})}}if(h&&h!==ut.current){ut.current=h,yn=!0;const tn=Xt??fo();tn.some(Vn=>Vn.t==="character"&&Vn.id===h)||(Xt=[...tn,{t:"character",id:h}])}if(p&&p!==gt.current){gt.current=p,yn=!0;const tn=Xt??fo();tn.some(Vn=>Vn.t==="product"&&Vn.id===p)||(Xt=[...tn,{t:"product",id:p}])}if(g&&!u&&/^[a-f0-9]{32}$/.test(g)&&g!==Pt.current){Pt.current=g,yn=!0;const tn=Xt??fo();tn.some(Vn=>Vn.t==="ref"&&Vn.imageHash===g)||(Xt=[...tn,{t:"ref",imageHash:g,label:"Scene view"}])}Xt&&(Ne(Xt),Ye(wn??{})),yn&&(w==null||w()),fe.current=n.id},[n.id,u,h,p,g]),s.useEffect(()=>{var Se;ue&&((Se=Rt.current)==null||Se.setTokens(ue),Ne(void 0))},[ue]);const wt=s.useMemo(()=>{var wn;const Se=os.find(yn=>yn.id===ge)??os[0],sn=(((wn=Yi.find(yn=>yn.id===kt))==null?void 0:wn.edge)??1024)/Math.max(Se.w,Se.h),Xt=yn=>Math.max(256,Math.round(yn*sn/8)*8);return{t:"format",id:Se.id,w:Xt(Se.w),h:Xt(Se.h)}},[ge,kt]),Ce=s.useMemo(()=>[wt,...we],[wt,we]),xe=s.useMemo(()=>({tokens:Ce,templateFields:Ze,variants:ke,quality:kt,format:ge}),[Ce,Ze,ke,kt,ge]),et=we.some(Se=>Se.t==="text"?!!Se.v.trim():!0),yt=s.useMemo(()=>{const Se=we.find(ht=>ht.t==="template");return Se?F.find(ht=>ht.id===Se.id)??null:null},[we,F]),Q=s.useMemo(()=>{const Se=we.find(ht=>ht.t==="template");return(Se==null?void 0:Se.id)??null},[we]),Pe=s.useCallback(Se=>{var yn,Br;const ht=(yt==null?void 0:yt.id)??null,sn=(j==null?void 0:j.id)??null,Xt=((yn=F.find(tn=>tn.id===Se))==null?void 0:yn.name)??"this scene",wn=K5(ht,Se,Xt,sn,j?Rr(j):null);if(wn.changed&&((Br=Rt.current)==null||Br.insert({t:"template",id:Se}),wn.toast)){const tn=wn.toast;B({kind:"info",title:tn.title,action:{label:"Undo",onClick:()=>{var Kn,Vn;tn.prevSceneId?(Kn=Rt.current)==null||Kn.insert({t:"template",id:tn.prevSceneId}):(Vn=Rt.current)==null||Vn.removeTemplate(),tn.branchWasCleared&&sn&&(T==null||T(sn))}}})}},[yt,j,F,B,T]);s.useImperativeHandle(H,()=>({insertToken:Se=>{var ht;return(ht=Rt.current)==null?void 0:ht.insert(Se)},removeToken:Se=>{var ht;return(ht=Rt.current)==null?void 0:ht.remove(Se)},applyScene:Se=>Pe(Se),removeTemplate:()=>{var Se;return(Se=Rt.current)==null?void 0:Se.removeTemplate()},openAttach:Se=>zr(Se),showAttach:()=>{Lr.current||zr("All")},focus:()=>{var Se;return(Se=Rt.current)==null?void 0:Se.focus()},submit:()=>{Fc()}}));const Ke=s.useMemo(()=>Use(we),[we]),xt=Wse(Ke),st=hse(we),Kt=s.useMemo(()=>pse(st),[st]),mn=s.useRef(Ke);mn.current=Ke,s.useEffect(()=>{S==null||S(mn.current)},[xt,S]),s.useEffect(()=>{var Se;!Y||!Q||yt||((Se=Rt.current)==null||Se.removeTemplate(),B({kind:"warning",title:"That scene is no longer available",detail:"Removed from the brief."}))},[Y,Q,yt,B]);const $e=s.useRef(null);s.useEffect(()=>(Te.current&&clearTimeout(Te.current),Te.current=setTimeout(()=>tt(fe.current??n.id),500),()=>{Te.current&&clearTimeout(Te.current)}),[we,Ze,j==null?void 0:j.id,n.id,tt]),s.useEffect(()=>()=>tt(fe.current??n.id),[tt]),s.useEffect(()=>{const Se=()=>tt(fe.current??n.id);return window.addEventListener("beforeunload",Se),()=>window.removeEventListener("beforeunload",Se)},[tt,n.id]);const Ae=r.find(Se=>Se.id===ee),nt=Ae?Ji(Ae.displayName):"This engine",Ge=!!j&&j.kind!=="root"&&j.status==="running",Tt=j&&j.kind!=="root"&&j.status==="done"&&j.images.length>0||Ge,W=!!(Ae!=null&&Ae.supportsEdit),pe=!!X&&!!J&&J!==ge&&Tt&&!yt,qe=pe?Bse(sd(J),sd(ge)):null,We=qe==="crop",jt=qe==="extend"&&W,Ct=os.find(Se=>Se.id===ge),Dt=Ct?`${Ct.label} ${Ct.hint}`:ge,[qt,Zn]=s.useState(null),nn=()=>{j!=null&&j.images[0]&&Zn({src:Fr(j.images[0]),kind:"shot",label:Rr(j),noun:"Refining this shot"})},Ut=Tt&&!yt&&(W||We||jt)?"edit":"generation",pr=Ut==="edit"&&!!j&&R!=="overlay",Nn=Tt?yt?"A scene starts a new shot.":We||jt||W?null:`${(Ae==null?void 0:Ae.displayName)??"This engine"} cannot edit. This makes a new shot.`:null,nr=s.useMemo(()=>{const Se=os.find(yn=>yn.id===ge)??os[0],ht=`Aspect ${Se.label} ${Se.hint}`;if(Ut==="edit")return ht;const sn=Yi.find(yn=>yn.id===kt),Xt=Rw(ee),wn=Xt==="ratio"||!sn?null:Xt==="advisory"?`${sn.label}, asking for ${sn.edge} px`:`${sn.label} ${sn.edge} px`;return[ht,`${ke} shot${ke===1?"":"s"}`,wn&&`resolution ${wn}`].filter(Boolean).join(", ")},[Ut,ge,ke,kt,ee]),Jt=s.useRef(void 0),ur=s.useRef(void 0);s.useEffect(()=>{var Xt;const Se=Tt?(j==null?void 0:j.id)??null:null,ht=Se!==Jt.current&&Jt.current!==void 0;Jt.current=Se;const sn=Q!==ur.current;ur.current=Q,!(!yt||!Tt)&&(ht&&!sn&&Se?(Xt=Rt.current)==null||Xt.removeTemplate():N==null||N())},[yt,Q,Tt,j,N]);const Cs=(Qe==null?void 0:Qe.warnings.filter(Se=>Se.includes("built around a product")))??[],kn=pe&&!et,Vs=We&&et,na=O.length>0&&we.some(Se=>Se.t==="character"&&!O.some(ht=>ht.id===Se.id)),en=!Me&&(et||kn)&&!Vs&&!na&&!!t&&!Ge&&(We||!me),Cn=me&&!We?"Image generation is not set up yet":Me?"Working on the last one":t?Ge?"Wait for this version to finish, or press X to start a new shot":Vs?"This shape is reached by cropping, and a crop uses no words. Clear the prompt, or keep the current shape.":na?"Remove the presenter who is no longer in your roster":!et&&!kn?"Write a prompt first":null:"Still opening this brand";s.useEffect(()=>{const Se=Ut==="edit"&&!!j;if(We||!et&&!Se){rt(null);return}$e.current&&clearTimeout($e.current);const ht=xe;return $e.current=setTimeout(()=>{je.previewBrief(xe,ee,n.id,Se?j.id:void 0).then(sn=>rt({...sn,forBrief:ht})).catch(()=>rt(null))},280),()=>{$e.current&&clearTimeout($e.current)}},[xe,ee,n.id,et,Ut,j,We]);const zn=Se=>{var ht;ve(Se),(ht=Rt.current)==null||ht.focus()},Zr=Se=>{var ht;Nt(Se),(ht=Rt.current)==null||ht.focus()},Pr=Se=>{var ht;te(Se),(ht=Rt.current)==null||ht.focus()},In=Se=>{var ht;Se.preventDefault(),(ht=Rt.current)==null||ht.focus()},zr=Se=>{Zt(Se),mt(ht=>ht+1),zt(!0)},Lr=s.useRef(!1);Lr.current=_e;const us=s.useRef(zr);us.current=zr;const ra=s.useCallback(({restore:Se})=>{var ht;Lr.current&&(Lr.current=!1,zt(!1),Se&&((ht=Rt.current)==null||ht.restoreCaret()))},[]),Aa=s.useRef(Pe);Aa.current=Pe;const Er=s.useRef(we);Er.current=we;const Oc=s.useCallback(Se=>{var sn;const ht=Se.token;ht.t==="template"?Aa.current(ht.id):(sn=Rt.current)==null||sn.insert(ht)},[]),Ro=s.useCallback(Se=>{var sn,Xt;const ht=Se.token;ht.t==="template"?(sn=Rt.current)==null||sn.removeTemplate():(Xt=Rt.current)==null||Xt.remove(ht)},[]),Na=async Se=>{var sn;if(!(Se!=null&&Se.length))return;const ht=Array.from(Se).filter(Xt=>Xt.type.startsWith("image/"));if(!ht.length){B({kind:"warning",title:"Only images can be attached here"});return}Mt(!0),Be(null);try{for(const Xt of ht.slice(0,4)){const wn=await W0(Xt);(sn=Rt.current)==null||sn.insert({t:"ref",imageHash:wn,label:Gse(Xt.name)})}ht.length>4&&B({kind:"warning",title:"Only the first 4 images were attached",detail:`${ht.length-4} more ${ht.length-4===1?"was":"were"} skipped. Attach ${ht.length-4===1?"it":"them"} in another pick.`})}catch(Xt){Be(String(Xt.message??Xt)),B(ln(Xt,"Could not attach that image"))}finally{Mt(!1),Vt.current&&(Vt.current.value="")}},ie=Qe&&Qe.forBrief===xe?Qe:null,De=s.useMemo(()=>we.filter(Se=>S0.has(Se.t)).length,[we]),it=s.useRef(null),Ft=s.useMemo(()=>De===0?(it.current=null,null):(ie&&(it.current={cap:Xre(ie),described:Qre(ie),preview:ie}),it.current),[ie,De]),an=(Ft==null?void 0:Ft.cap)??null,fn=(Ft==null?void 0:Ft.preview)??null,$n=(Ae==null?void 0:Ae.displayName)??"This engine",jn=De>=pp?o4:null;s.useEffect(()=>{E==null||E(jn)},[jn,E]);const Tn=Se=>{const ht=Ft==null?void 0:Ft.described;return!ht||ht.size===0?!1:Se.t==="product"?ht.has(ql("product",Se.id)):Se.t==="character"?ht.has(ql("character",Se.id)):Se.t==="template"?ht.has(ql("scene",Se.id)):Se.t==="ref"?ht.has(ql("reference",Se.imageHash)):Se.t==="mark"?ht.has(ql("brand",Se.imageHash)):!1},Ma=an!=null?`Described in words: ${$n} pictures ${an} per shot, products and presenters first. Drag it earlier to picture it.`:null,bl=yt?Cs.length>0?"This scene builds around a product. Attach one.":(fn==null?void 0:fn.warnings.some(Se=>Se.includes("built around a person")))??!1?"This scene builds around a person. Without a presenter, only the set renders.":null:null,vi=Se=>{var yn,Br;if(Se.t==="template")return bl;if(Se.t==="product"&&q&&U&&!((D.length?D:((yn=n.json)==null?void 0:yn.products)??[]).some(Vn=>Vn.id===Se.id)||_.some(Vn=>Vn.id===Se.id)))return"This product is no longer in your library. Remove it from the brief.";if(Se.t==="mark"&&!Df(n.json).some(tn=>tn.hash===Se.imageHash))return"This mark is no longer in your brand kit. Remove it from the brief.";if(!fn)return null;const ht=(Ae==null?void 0:Ae.displayName)??"this engine",sn=fn.cap,Xt=tn=>`${tn} won't reach ${ht} this time.`,wn=(tn,Kn)=>{var Vn;return((Vn=fn.dropped)==null?void 0:Vn.some(Sl=>Sl.role===tn&&Sl.id===Kn&&Sl.reason==="missing"))??!1};if(Se.t==="ref"&&!fn.attachments.some(tn=>tn.hash===Se.imageHash))return sn===0?`This reference won't reach ${ht}. Choose an engine that reads images, or remove it.`:sn==null?Xt("This reference"):null;if(Se.t==="mark"&&!fn.attachments.some(tn=>tn.role==="brand"&&tn.hash===Se.imageHash))return sn===0?`The brand mark won't reach ${ht}, so the logo can't be drawn from it. Choose an engine that reads images.`:sn==null?`${Xt("The brand mark")} The logo can't be drawn from it.`:null;if(Se.t==="mark"){const tn=fn.warnings.find(Kn=>Kn.includes("px across"));if(tn)return tn}if(Se.t==="product"){const Kn=(D.length?D:((Br=n.json)==null?void 0:Br.products)??[]).find(Vn=>Vn.id===Se.id)??_.find(Vn=>Vn.id===Se.id);if(Kn&&!fn.attachments.some(Vn=>Vn.role==="product"&&Vn.id===Kn.id))return wn("product",Kn.id)?`${Kn.name} has no usable photo. Re-add one, or remove this.`:null}if(Se.t==="character"){const tn=O.find(Kn=>Kn.id===Se.id);if(!tn&&O.length>0)return"This presenter is no longer in your roster. Remove them from the brief.";if(tn&&!fn.attachments.some(Kn=>Kn.role==="character"&&Kn.id===tn.id))return wn("character",tn.id)?`${tn.name} has no usable photo. Re-add one, or remove this.`:null}return null},Ic=s.useCallback(vi,[fn,Ae==null?void 0:Ae.displayName,bl,D,q,n.json,_,U,O]),Sd=s.useCallback(Tn,[Ft]),Fc=async()=>{var ht,sn,Xt;if(!en)return;ze(!0),Be(null);const Se=we.flatMap(wn=>wn.t==="text"?[wn.v]:[]).join(" ").replace(/\s+/g," ").trim();k==null||k({said:Se||"Your shot",count:Ut==="generation"?ke:1});try{if(!t)throw new Error("the workspace is still loading");const wn=await je.addNode({projectId:t,parentId:Ut==="edit"&&j?j.id:a,kind:Ut,engineId:ee,count:ke,brief:{...xe,tokens:_6(n,xe.tokens)},...Ut==="edit"&&A?{sourceImage:A}:{},...Ut==="edit"&&qe?{reshape:qe}:{}}),yn=wn.warnings??[];yn.length===1?B({kind:"warning",title:"Sent, with one thing to know",detail:yn[0]}):yn.length>1&&B({kind:"warning",title:`Sent, with ${yn.length} things to know`,detail:yn.join(" ")}),(ht=Rt.current)==null||ht.setTokens(fo()),Ye({}),Oe(null),Xe({}),le(null),Bt(null),C&&W5(n.id),y(wn.id,Ut,(sn=wn.siblings)==null?void 0:sn.map(Br=>Br.id),(Xt=wn.siblings)!=null&&Xt.length?wn.siblings:[wn])}catch(wn){const yn=String(wn.message??wn);Be(yn),B(ln(wn,"That did not send",Ae==null?void 0:Ae.displayName)),k==null||k(null)}finally{ze(!1)}},Zs=(Xr=we.find(Se=>Se.t==="product"))==null?void 0:Xr.id,_c=Zs?D.find(Se=>Se.id===Zs)??(((Po=n.json)==null?void 0:Po.products)??[]).find(Se=>Se.id===Zs)??_.find(Se=>Se.id===Zs)??null:null,xl=_c?ew(_c):null,Ed=$?{brandId:n.id,products:we.filter(Se=>Se.t==="product").length,presenters:we.filter(Se=>Se.t==="character").length,scene:!!yt,others:we.filter(Se=>Se.t==="color"||Se.t==="ref"||Se.t==="mark").length,words:we.some(Se=>Se.t==="text"&&!!Se.v.trim()),busy:Me,pickerOpen:_e,refining:Ut==="edit"&&!!j,engine:me?oe?"setup":"settings":"ready"}:null;s.useEffect(()=>{Ed&&kk(Ed)}),s.useEffect(()=>{if($)return()=>kk(null)},[$]),s.useEffect(()=>{if(!$||!_e)return;const Se=()=>ra({restore:!0});return window.addEventListener("scenri:guide-close-picker",Se),()=>window.removeEventListener("scenri:guide-close-picker",Se)},[$,_e,ra]),s.useEffect(()=>{if(!$)return;const Se=ht=>{var yn;const{kind:sn}=ht.detail,Xt=sn==="presenter"?"character":sn==="scene"?"template":"product",wn=[...Er.current].reverse().find(Br=>Br.t===Xt);wn&&((yn=Rt.current)==null||yn.remove(wn))};return window.addEventListener("scenri:guide-take-back",Se),()=>window.removeEventListener("scenri:guide-take-back",Se)},[$]),s.useEffect(()=>{if(!N)return;const Se=()=>N();return window.addEventListener("scenri:guide-clear-refine",Se),()=>window.removeEventListener("scenri:guide-clear-refine",Se)},[N]),s.useEffect(()=>{if(!$)return;const Se=ht=>{const{tab:sn}=ht.detail;St(sn??null),sn&&us.current(sn)};return window.addEventListener("scenri:guide-picker",Se),()=>{window.removeEventListener("scenri:guide-picker",Se),St(null)}},[$]);const[wi,kl]=s.useState(!1),Cd=R==="overlay"&&(wi||we.some(Se=>Se.t==="text"&&!!Se.v.trim()));return s.useEffect(()=>{R==="overlay"&&Sk({engaged:Cd})},[R,Cd]),s.useEffect(()=>{if(R==="overlay")return()=>Sk(null)},[R]),o.jsxs("div",{className:"sc-composer","data-guide":$?"compose":void 0,onPointerDownCapture:R==="overlay"&&!wi?()=>kl(!0):void 0,onKeyDownCapture:R==="overlay"&&!wi?()=>kl(!0):void 0,children:[o.jsx("input",{ref:Vt,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:Se=>void Na(Se.target.files)}),qt&&o.jsx(ad,{src:qt.src,kind:qt.kind,label:qt.label,noun:qt.noun,onRestoreFocus:()=>{var Se;return(Se=Rt.current)==null?void 0:Se.restoreCaret()},onClose:()=>Zn(null)}),_e&&o.jsx(Ase,{brand:n,activeProductCategory:xl,refining:pr,full:jn,initialTab:Et,tabNonce:He,only:vt,id:re,attached:Kt,onUpload:()=>{var Se;return(Se=Vt.current)==null?void 0:Se.click()},onFiles:Se=>void Na(Se),onPick:Oc,onRemove:Ro,onClose:ra}),ce&&o.jsx("div",{className:"sc-notes","data-guide-shape":$?"":void 0,children:ce&&o.jsxs("div",{className:"sc-banner","data-tone":"action",children:[o.jsx("span",{className:"sc-banner-ic",children:ce.icon}),o.jsxs("span",{className:"sc-banner-txt",children:[o.jsx("b",{children:ce.title}),o.jsxs("small",{children:[ce.detail,ce.info&&o.jsxs(Xu,{children:[o.jsx(Qu,{children:o.jsx("button",{type:"button",className:"sc-note-info","aria-label":"What a ChatGPT account has to do with this",children:o.jsx($p,{size:13})})}),o.jsxs(Ju,{className:"sc-note-pop",align:"start",sideOffset:8,width:"300px",children:[o.jsx("p",{children:"Codex CLI signs in with your ChatGPT account and makes the images there. Every plan includes some Codex usage, so how many images you get depends on the plan you are on."}),o.jsx("p",{children:"No ChatGPT account, or run out for now? Use your own key from an image provider instead."}),o.jsx("p",{className:"sc-note-pop-fine",children:"Scenri never sees your password or token. The sign-in happens in your browser and stays with Codex."}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>Z("engines"),children:"Use a provider key instead"})]})]})]})]}),o.jsx("button",{type:"button",className:"sc-banner-act","data-primary":"","data-guide":$?"compose.engine":void 0,onClick:ce.onAct,children:ce.action})]})}),o.jsxs("div",{className:"sc-promptcard","data-guide-shape":$?"":void 0,children:[Tt&&(N||R==="overlay"&&Ut==="edit")&&o.jsxs("div",{className:"sc-target","data-note":Nn?"":void 0,children:[o.jsx(Mse,{target:j,onOpenImage:nn,onClear:N}),Nn&&o.jsx("small",{className:"sc-target-note",children:Nn})]}),Tt&&!N&&Nn&&!(R==="overlay"&&Ut==="edit")&&o.jsx("small",{className:"sc-target-note sc-target-note-alone",children:Nn}),pe&&(We||jt)&&o.jsxs("small",{className:"sc-reshape-hint","aria-live":"polite",children:[We?"Will crop to":"Will extend to"," ",Dt]}),o.jsx(ese,{ref:Rt,onChange:G,brand:n,templates:F,presenters:O,demoProducts:_,onTemplatePick:Pe,scenesSitOut:pr,flag:Ic,described:Sd,describedNote:Ma,onInspect:Se=>Zn(Se),onAttachRequest:Se=>zr(Se),activeProductCategory:xl,placeholder:yt?"Add art direction, or run it as written":Ut==="edit"?"Say what to change about this shot":"What should we shoot? (use $ / @ #)",placeholderSm:yt||Ut==="edit"?void 0:"What should we shoot? ($ / @ #)",label:yt?"Art direction":Ut==="edit"?"What to change":"Shot brief",onSubmit:()=>void Fc(),onDropFiles:Se=>void Na(Se)}),o.jsxs("div",{className:"sc-prompt-row",children:[o.jsxs("div",{className:"sc-prompt-left",children:[o.jsx("button",{type:"button",ref:An,className:"sc-icon-btn sc-attach-toggle","data-guide":$?"compose.add":void 0,"aria-expanded":_e,"aria-controls":_e?re:void 0,"aria-label":"Add to shot",title:"Add a product, a presenter, a scene, a colour or an image",onClick:()=>_e?ra({restore:!1}):zr("All"),children:at?o.jsx(Ar,{size:"1"}):o.jsx(fr,{size:16})}),K.length>1&&o.jsxs(hA,{value:ee,onValueChange:se,children:[o.jsxs(pA,{variant:"ghost",className:"sc-mini-sel",children:[o.jsx(O0,{size:14}),o.jsx("span",{className:"sc-mini-sel-t",children:Ae?Ji(Ae.displayName):"Demo"})]}),o.jsx(mA,{children:K.map(Se=>o.jsx(gA,{value:Se.id,children:Ji(Se.displayName)},Se.id))})]})]}),o.jsxs("div",{className:"sc-prompt-right",children:[o.jsx(Hse,{mode:Ut,engineId:ee,engineName:nt,formatId:ge,onFormat:zn,count:ke,onCount:Pr,quality:kt,onQuality:Zr,onCloseAutoFocus:In,guided:$}),o.jsxs(Xu,{open:ft,onOpenChange:Qt,children:[o.jsx(Qu,{children:o.jsxs("button",{type:"button",className:"sc-var sc-more","aria-label":`Shot settings. ${nr}`,"data-guide":$&&!on?"compose.settings":void 0,children:[o.jsx(V4,{size:14}),"More"]})}),o.jsx(Ju,{className:"sc-morepop",align:"end",sideOffset:8,width:"300px",onOpenAutoFocus:Pw,onCloseAutoFocus:In,children:o.jsx(IR,{mode:Ut,engineId:ee,engineName:nt,formatId:ge,onFormat:zn,count:ke,onCount:Pr,quality:kt,onQuality:Zr})})]}),o.jsx(Ose,{guide:$&&on?"compose.settings":void 0,mode:Ut,engineId:ee,engineName:nt,formatId:ge,onFormat:zn,count:ke,onCount:Pr,quality:kt,onQuality:Zr}),o.jsxs("button",{type:"button",className:"sc-send","data-guide":$?"compose.send":void 0,"aria-disabled":!en||void 0,onClick:()=>void Fc(),"aria-label":Ut==="edit"?"Refine":"Generate",title:Re??bl??Cn??`${Ut==="edit"?"Refine":"Generate"} (enter)`,children:[o.jsx("span",{className:"sc-send-ico",children:Me?o.jsx(Ar,{size:"1"}):o.jsx(KE,{size:17,weight:"bold"})}),o.jsx("span",{className:"sc-send-lb",children:Ut==="edit"?"Refine":"Generate"})]})]})]})]})]})});function Gse(e){return e.replace(/\.[a-z0-9]{2,5}$/i,"").trim()||"Image"}function $w(e,t){s.useLayoutEffect(()=>{if(!e||typeof ResizeObserver>"u")return;const n=document.documentElement,r=()=>n.style.setProperty(t,`${Math.round(e.offsetHeight)}px`);r();const a=new ResizeObserver(r);return a.observe(e),()=>{a.disconnect(),n.style.removeProperty(t)}},[e,t])}function ZR({full:e=!0,children:t}){const[n,r]=s.useState(null);return $w(n,"--sc-dock-h"),o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-dock-fade","data-full":e,"aria-hidden":!0}),o.jsx("div",{className:"sc-canvas-dock","data-full":e,ref:r,children:t})]})}function Tw(){const{brand:e}=dn(),{tasks:t}=Ca(),[n,r]=s.useState(null),[a,i]=s.useState(null),[l,u]=s.useState(()=>Date.now()),f=s.useRef({id:"",pct:0}),h=t.find(b=>b.kind==="catalog"&&b.state==="running");if(s.useEffect(()=>{if(!h)return;const b=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(b)},[h]),!h&&!a)return null;const p=h!=null&&h.id.startsWith("catalog:")?h.id.slice(8):null,g=h!=null&&n===h.id,v=lY(e.json),w=qr(v==null?void 0:v.file);return h&&(f.current.id!==h.id&&(f.current={id:h.id,pct:0}),f.current.pct=Math.max(f.current.pct,h.percent??0)),o.jsxs(o.Fragment,{children:[h&&o.jsxs("div",{className:"sc-impbar",role:"status",style:{"--sc-impbar-p":`${f.current.pct}%`},children:[o.jsx("span",{className:"sc-impbar-fill","aria-hidden":!0}),o.jsxs("button",{type:"button",className:"sc-impbar-open",onClick:()=>p&&i(p),disabled:!p,"aria-label":"Show import details",children:[o.jsx("span",{className:"sc-impbar-mark","aria-hidden":!0,children:w?o.jsx("img",{src:w,alt:"",className:(v==null?void 0:v.role)==="mark"?"sc-impbar-badge":void 0}):o.jsx(J9,{size:13,weight:"regular"})}),o.jsx("span",{className:"sc-impbar-count",children:h.subtitle}),o.jsx("span",{className:"sc-impbar-clock",children:pc(h.startedAt,l)})]}),p&&o.jsxs("button",{type:"button",className:"sc-impbar-stop",disabled:g,"aria-label":"Stop importing",onClick:()=>{r(h.id),je.cancelCatalogJob(e.id,p).catch(()=>r(null))},children:[o.jsx(Mn,{size:12,weight:"bold"}),g?"Stopping":"Stop"]})]}),a&&o.jsx(O6,{brandId:e.id,jobId:a,onDismiss:()=>i(null)})]})}const Yse={presenter:"Presenter",product:"Product",scene:"Scene"};function zR({entry:e,productName:t,productPreviewUrl:n,productId:r,presenterName:a,presenterPreviewUrl:i,presenterId:l,sceneName:u,scenePreviewUrl:f,sceneId:h,onOpen:p,productHref:g,presenterHref:v,sceneHref:w,active:b,hideRecipe:y,decorative:k,size:S="grid"}){const E=[t,a,u].filter(Boolean).join(" · "),j=a?{key:"presenter",name:a,previewUrl:i,linked:!!(v&&l),href:v&&l?v(l):void 0}:null,N=n&&t?{key:"product",name:t,previewUrl:n,linked:!!(g&&r),href:g&&r?g(r):void 0}:null,A=f&&u?{key:"scene",name:u,previewUrl:f,linked:!!(w&&h),href:w&&h?w(h):void 0}:null;return o.jsxs("div",{className:"sc-showcase-tile","data-active":b||void 0,"aria-hidden":k||void 0,...k?{inert:""}:{},children:[o.jsx(gd,{id:e.id,previewUrl:e.previewUrl,title:e.title,primary:e.title,secondary:y?"":E,useLabel:"Recreate this",variant:"use",onOpen:p,onUse:p,size:S}),(j||N||A)&&o.jsx(Xse,{presenter:j,product:N,scene:A})]})}function qse(e){return o.jsx(bm,{...e,caption:!1})}function Xse({presenter:e,product:t,scene:n}){const[r,a]=s.useState(null),i=[t,n].filter(Boolean),l=i.length+(e?1:0)+Math.max(0,i.length-1);let u=0;const f=()=>({"--i":u++});return o.jsxs("div",{className:"sc-showcase-chips",onMouseLeave:()=>a(null),children:[e&&o.jsx(G5,{credit:e,open:r==="presenter",onEnter:()=>a("presenter"),children:Jse(e)}),i.length>0&&o.jsxs("div",{className:"sc-showcase-recipe",style:{"--n":l},children:[e&&o.jsx("span",{className:"sc-showcase-join",style:f(),"aria-hidden":!0}),i.map((h,p)=>o.jsxs(s.Fragment,{children:[p>0&&o.jsx("span",{className:"sc-showcase-join",style:f(),"aria-hidden":!0}),o.jsx(G5,{credit:h,open:r===h.key,onEnter:()=>a(h.key),style:f(),children:Qse({credit:h,step:p===0?1:2})})]},h.key))]})]})}function G5({credit:e,open:t,onEnter:n,children:r,style:a}){const i=s.useRef(null),l=s.useRef(null),[u,f]=s.useState(null),h=RN(),p=h==="large"?144:88,g=h==="large"?168:112;if(s.useLayoutEffect(()=>{var S,E;if(!t||!e.previewUrl){f(null);return}const w=()=>{const j=i.current;if(!j)return;const N=j.getBoundingClientRect(),A=l.current,T=(A==null?void 0:A.offsetWidth)||p,P=(A==null?void 0:A.offsetHeight)||g,C=window.visualViewport,R=Yne(N,{width:(C==null?void 0:C.width)??window.innerWidth,height:(C==null?void 0:C.height)??window.innerHeight},{width:T,height:P});if(!R){f(null);return}f({left:Math.round(R.left),top:Math.round(R.top)})};w();const b=requestAnimationFrame(w),y=i.current,k=y?new ResizeObserver(w):null;return y&&k&&k.observe(y),window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),(S=window.visualViewport)==null||S.addEventListener("resize",w),(E=window.visualViewport)==null||E.addEventListener("scroll",w),()=>{var j,N;cancelAnimationFrame(b),k==null||k.disconnect(),window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w),(j=window.visualViewport)==null||j.removeEventListener("resize",w),(N=window.visualViewport)==null||N.removeEventListener("scroll",w)}},[t,e.previewUrl,e.key,p,g]),!e.previewUrl)return o.jsx("span",{ref:i,className:"sc-credit-tip",onPointerEnter:n,style:a,children:r});const v=Yse[e.key];return o.jsxs("span",{ref:i,className:"sc-credit-tip","data-open":t||void 0,onPointerEnter:n,style:a,children:[r,t&&_r.createPortal(o.jsx("span",{ref:l,className:"sc-credit-tip-pop","data-size":h,style:u?{left:u.left,top:u.top}:{left:-9999,top:0},role:"tooltip","aria-label":`${v}: ${e.name}`,children:o.jsxs("span",{className:"sc-credit-tip-card",children:[o.jsx("img",{src:Pn(e.previewUrl,"small"),alt:""}),o.jsx("span",{className:"sc-credit-tip-name",children:e.name}),o.jsx("span",{className:"sc-credit-tip-role",children:v})]})}),document.body)]})}function Qse({credit:e,step:t}){const{name:n,previewUrl:r,linked:a,href:i}=e;return a&&i?o.jsx(Bn,{className:"sc-showcase-chip",to:i,"data-link":!0,"data-step":t,"aria-label":`See ${n}`,onClick:l=>l.stopPropagation(),children:r?o.jsx("img",{src:Pn(r,"micro"),alt:""}):null}):o.jsx("span",{className:"sc-showcase-chip","data-step":t,children:r?o.jsx("img",{src:Pn(r,"micro"),alt:n}):o.jsx("span",{className:"sc-vh",children:n})})}function Jse(e){const{name:t,previewUrl:n,linked:r,href:a}=e;return r&&a?o.jsxs(Bn,{className:"sc-showcase-badge",to:a,"data-link":!0,"aria-label":`See ${t}`,onClick:i=>i.stopPropagation(),children:[n?o.jsx("img",{src:Pn(n,"micro"),alt:""}):null,o.jsx("span",{className:"sc-showcase-badge-name",children:t})]}):o.jsxs("span",{className:"sc-showcase-badge","aria-hidden":!0,children:[n?o.jsx("img",{src:Pn(n,"micro"),alt:""}):null,o.jsx("span",{className:"sc-showcase-badge-name",children:t})]})}function Y5(e){return{key:"open-tab",icon:"open-tab",label:"Open in new tab",onSelect:()=>window.open(e,"_blank")}}function q5(e){return{key:"select",icon:"select",label:"Select",onSelect:e}}function il(e){if(e.only)return[{key:"only",icon:"use",label:e.only.label,onSelect:e.only.run}];if(e.draft){const n=[{key:"continue",icon:"continue",label:"Continue",onSelect:e.draft.onContinue}];return e.draft.href&&n.push(Y5(e.draft.href)),e.select&&n.push(q5(e.select.run)),n.push({key:"discard",icon:"discard",label:"Discard",onSelect:e.draft.onDiscard,danger:!0,separated:!0}),n}const t=[];return e.onOpen&&t.push({key:"open",icon:"open",label:"Open",onSelect:e.onOpen}),e.href&&t.push(Y5(e.href)),e.use&&t.push({key:"use",icon:"use",label:e.use.label,onSelect:e.use.run}),e.select&&t.push(q5(e.select.run)),e.keep&&t.push({key:"keep",icon:e.keep.on?"kept":"keep",label:e.keep.on?"Remove from Keepers":"Add to Keepers",onSelect:e.keep.run}),e.onRename&&t.push({key:"rename",icon:"rename",label:"Rename",onSelect:e.onRename}),e.onDuplicate&&t.push({key:"duplicate",icon:"duplicate",label:"Duplicate presenter",onSelect:e.onDuplicate}),e.onEdit&&t.push({key:"edit",icon:"edit",label:"Edit presenter",onSelect:e.onEdit}),e.remove&&t.push({key:"delete",icon:"delete",label:e.remove.label,onSelect:e.remove.run,danger:!0,separated:!0}),t}function as(e,t){if(e==="draft")return{tool:"Discard",menu:t>1?`Discard ${t} drafts`:"Discard",icon:"discard",danger:!0};const n=e==="presenter"?"Delete presenter":e==="product"?"Delete product":"Delete scene",r=e==="presenter"?"presenters":e==="product"?"products":"scenes";return{tool:"Delete",menu:t>1?`Delete ${t} ${r}`:n,icon:"delete",danger:!0}}function di(e,t){const n=t>1;return e==="owned-scene"?n?"Shots already made here keep their images. Their recipe will say these scenes are gone, and building from one again will miss them.":"Shots already made here keep their images. Their recipe will say this scene is gone, and building from one again will miss it.":e==="product"?n?"Shots already made with them keep their images. Their recipe loses these products, and building from one again will miss them.":"Shots already made with it keep their images. Their recipe loses this product, and building from one again will miss it.":n?"Shots already made with them keep their images. Their recipe loses these people, and building from one again will miss them.":"Shots already made with them keep their images. Their recipe loses this person, and building from one again will miss them."}function $m(e,t,n){return{tool:t?"Remove from keepers":"Keep",menu:e>1?t?`Remove ${e} ${n} from Keepers`:`Add ${e} ${n} to Keepers`:t?"Remove from Keepers":"Add to Keepers",icon:t?"kept":"keep"}}function Tm({kind:e,count:t,openLabel:n,onOpen:r,href:a,onDeselect:i,onAct:l,onKeep:u,allKept:f}){const h=as(e,t),p=[{key:"open",icon:n==="Continue"?"continue":"open",label:n,onSelect:r}];if(a&&p.push({key:"open-tab",icon:"open-tab",label:"Open in new tab",onSelect:()=>window.open(a,"_blank")}),p.push({key:"deselect",icon:"select",label:t>1?"Deselect this":"Deselect",onSelect:i}),u&&e!=="draft"){const v=$m(t,!!f,e==="presenter"?"presenters":e==="product"?"products":"scenes");p.push({key:"keep",icon:v.icon,label:v.menu,onSelect:u})}return p.push({key:e==="draft"?"discard":"delete",icon:h.icon,label:h.menu,onSelect:l,danger:h.danger||void 0,separated:!0}),p}async function wp(e,t){const n=[];let r;for(const a of e)try{await t(a)}catch(i){if((i==null?void 0:i.status)===404)continue;n.push(a),r??(r=i)}return{failed:n,error:r}}function d4({presenter:e,variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,onDuplicate:u,onEdit:f,onDelete:h,onRename:p,bookmarked:g,onBookmark:v,fresh:w,chosen:b,batching:y,onPick:k,batch:S,size:E="grid"}){const N=S?Tm({kind:"presenter",count:S.count,openLabel:"Open",onOpen:()=>n==null?void 0:n(e.id),href:a,onDeselect:()=>k==null?void 0:k(e.id),onAct:S.onAct,onKeep:S.onKeep,allKept:S.allKept}):il(!a&&!r&&!!n?{only:{label:"Use in a shot",run:()=>n(e.id)}}:{onOpen:n?()=>n(e.id):void 0,href:a,use:r?{label:"Use in a shot",run:()=>r(e.id)}:void 0,select:k?{run:()=>k(e.id)}:void 0,keep:v?{on:!!g,run:()=>v(e.id)}:void 0,onRename:p?()=>p(e.id):void 0,onDuplicate:u?()=>u(e.id):void 0,onEdit:f?()=>f(e.id):void 0,remove:h?{label:"Delete presenter",run:()=>h(e.id)}:void 0});return o.jsx(gd,{id:e.id,previewUrl:e.previewUrl,title:e.descriptor||e.name,primary:e.name,secondary:"",useLabel:"Use in a shot",variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,menu:N,bookmarked:g,onBookmark:v,fresh:w,chosen:b,batching:y,onPick:k,size:E})}function BR(e){return o.jsx(bm,{...e})}function ef({scene:e,variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,bookmarked:u,onBookmark:f,onDelete:h,onRename:p,chosen:g,batching:v,onPick:w,batch:b,size:y="grid"}){const S=b&&h?Tm({kind:"owned-scene",count:b.count,openLabel:"Open",onOpen:()=>n==null?void 0:n(e.id),href:a,onDeselect:()=>w==null?void 0:w(e.id),onAct:b.onAct,onKeep:b.onKeep,allKept:b.allKept}):il(!a&&!r&&!!n?{only:{label:"Use in a shot",run:()=>n(e.id)}}:{onOpen:n?()=>n(e.id):void 0,href:a,use:r?{label:"Use in a shot",run:()=>r(e.id)}:void 0,select:w?{run:()=>w(e.id)}:void 0,keep:f?{on:!!u,run:()=>f(e.id)}:void 0,onRename:p?()=>p(e.id):void 0,remove:h?{label:"Delete scene",run:()=>h(e.id)}:void 0});return o.jsx(gd,{id:e.id,previewUrl:e.previewUrl,title:e.description||ol(e,"tooltip"),primary:ol(e,"card"),secondary:"",useLabel:"Use in a shot",variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,bookmarked:u,onBookmark:f,menu:S,chosen:g,batching:v,onPick:w,size:y})}function UR(e){return o.jsx(bm,{...e})}const Eu=new Map,eae=50;function tae(e,t){for(Eu.delete(e),Eu.set(e,t);Eu.size>eae;)Eu.delete(Eu.keys().next().value)}function nae(e){return Eu.get(e)}const rae=1e3;function gs({className:e="sc-home",children:t}){const n=s.useRef(null),{key:r}=Wn(),a=s.useRef(!1);return s.useLayoutEffect(()=>{const i=n.current,l=nae(r);if(!i||!l)return;let u=!1;const f=()=>{u||(u=!0,a.current=!1,p.disconnect(),clearTimeout(g),i.removeEventListener("wheel",f),i.removeEventListener("touchstart",f))},h=()=>{u||(i.scrollTop=l,Math.abs(i.scrollTop-l)<1&&f())};a.current=!0;const p=new ResizeObserver(h),g=setTimeout(f,rae);return i.addEventListener("wheel",f,{passive:!0}),i.addEventListener("touchstart",f,{passive:!0}),h(),p.observe(i),i.firstElementChild&&p.observe(i.firstElementChild),f},[r]),s.useEffect(()=>{const i=n.current;if(!i)return;const l=()=>{a.current||tae(r,i.scrollTop)};return i.addEventListener("scroll",l,{passive:!0}),()=>i.removeEventListener("scroll",l)},[r]),o.jsx("div",{ref:n,className:e,"data-page-scroll":"",children:t})}function Dm({title:e,filters:t,active:n,summary:r,onClear:a,density:i,search:l,action:u}){return o.jsxs("div",{className:"sc-filterbar",children:[e?o.jsx("h1",{className:"sc-vh",children:e}):null,t,o.jsxs("div",{className:"sc-filterbar-actions",children:[n&&o.jsxs("span",{className:"sc-lib-count",children:[r,a&&o.jsx("button",{type:"button",className:"sc-lib-clear",onClick:a,children:"Clear"})]}),l,i,u?o.jsx("span",{className:"sc-filterbar-cta",children:u}):null]})]})}function Hm({mode:e,group:t}){if(e==="none"||!t)return null;const n=[{value:null,label:t.everyLabel,count:t.everyCount},...t.options.map(r=>({value:r.value,label:r.label,count:r.count}))];return o.jsx(Nw,{"aria-label":t.label,activeKey:t.selected,items:n,onSelect:t.onSelect})}const Dw=o.jsx(Ua,{size:21,weight:"regular"});function wo({shape:e,title:t,body:n,action:r,mark:a,onRetry:i}){return e==="error"?o.jsxs(o.Fragment,{children:[o.jsx("h1",{children:t??"Couldn't load this library"}),o.jsx("p",{className:"sc-lookpage-lede",children:n}),o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:i,children:"Retry"})})]}):e==="cold"?o.jsxs("div",{className:"sc-canvas-empty",children:[t&&o.jsx("h3",{children:t}),o.jsx("p",{children:n}),r&&o.jsx("div",{className:"sc-lookpage-acts",children:r})]}):o.jsxs("div",{className:"sc-lib-zero",children:[a&&o.jsx("span",{className:"sc-lib-zero-mark","aria-hidden":!0,children:a}),t&&o.jsx("h3",{children:t}),o.jsx("p",{children:n}),r]})}function Om({noun:e,q:t,facet:n,onClearSearch:r,onClearAll:a}){const i=t.trim(),l=i?o.jsxs(o.Fragment,{children:["No ",e," found for ",o.jsxs("em",{children:["“",i,"”"]}),n?` in ${n}`:""]}):o.jsxs(o.Fragment,{children:["No ",e," in ",n]});return o.jsx(wo,{shape:"zero",body:l,action:o.jsxs("span",{className:"sc-lib-zero-acts",children:[i&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:r,children:"Clear search"}),i&&n&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:a,children:"Clear all"}),!i&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:a,children:"Clear filter"})]})})}const sae=150;function Bf(e){const[t,n]=ll(),r=t.get("q")??"",a=e.join(","),i=s.useMemo(()=>{const E={};for(const j of a.split(",").filter(Boolean))E[j]=t.get(j)||null;return E},[t,a]),l=s.useCallback(E=>{n(j=>{const N=new URLSearchParams(j);for(const[A,T]of Object.entries(E))T===null||T===""?N.delete(A):N.set(A,T);return N},{replace:!0})},[n]),[u,f]=s.useState(r),h=s.useRef(r),p=s.useRef(null),g=s.useCallback(()=>{p.current!==null&&(clearTimeout(p.current),p.current=null)},[]);s.useEffect(()=>{r!==h.current&&(h.current=r,g(),f(r))},[r,g]),s.useEffect(()=>g,[g]);const v=s.useCallback(E=>{f(E),g(),p.current=setTimeout(()=>{p.current=null,h.current=E,l({q:E||null})},sae)},[l,g]),w=s.useCallback((E,j)=>l({[E]:j}),[l]),b=l,y=u.trim().length>0||Object.values(i).some(Boolean),k=s.useCallback(()=>{g(),f(""),h.current="",l({q:null})},[l,g]),S=s.useCallback(()=>{g(),f(""),h.current="";const E={q:null};for(const j of a.split(",").filter(Boolean))E[j]=null;l(E)},[l,g,a]);return{q:u,setQ:v,facets:i,setFacet:w,setFacets:b,active:y,clearSearch:k,clear:S}}const aae=8;function oae(){var J;const{engines:e,scenes:t,loaded:n,presenters:r,presentersLoaded:a,demoProducts:i,showcase:l,showcaseCategories:u,showcaseLoaded:f,showcaseError:h,refetchShowcase:p}=Hn(),{brand:g,workspace:v,root:w,products:b,applyNodes:y}=dn(),k=t,{poke:S}=Ca(),E=wl(),j=_n(),{push:N}=cr(),A=Sw(),T=Rm(),P=Hne(),C=Sr(ta),{q:R,setQ:$,facets:H,setFacet:D,clearSearch:q,clear:_}=Bf(["category"]),U=H.category,Y=ge=>D("category",ge),I=R.trim().length>0,[F,O]=ba(Kr.wallDensity,ed),Z=Hc(F),V=ge=>O(ge),B=ym(Z),K=vm(Z),ee=ge=>{const ve=new URLSearchParams(ge??{}).toString();j(`${yr(g)}${ve?`?${ve}`:""}`)},se=b.length?b:((J=g.json)==null?void 0:J.products)??[],oe=ge=>{var ke,te,le;const ve=(ke=ge.brief.tokens.find(Me=>Me.t==="product"))==null?void 0:ke.id,Ze=(te=ge.brief.tokens.find(Me=>Me.t==="character"))==null?void 0:te.id,Ye=(le=ge.brief.tokens.find(Me=>Me.t==="template"))==null?void 0:le.id;return{product:ve?i.find(Me=>Me.id===ve):void 0,presenter:Ze?r.find(Me=>Me.id===Ze):void 0,scene:Ye?k.find(Me=>Me.id===Ye):void 0}},me=s.useMemo(()=>{const ge=new Map;for(const ve of l){const{product:Ze,presenter:Ye,scene:ke}=oe(ve);ge.set(ve.id,Dne(ve,{product:Ze,presenter:Ye,scene:ke},y8(ve.category)))}return ge},[l,i,r,k]),ce=s.useMemo(()=>(U?l.filter(ve=>ve.category===U):l).filter(ve=>jo(me.get(ve.id)??ve.title,R)),[l,U,R,me]),we=s.useMemo(()=>{const ge=_ne(u);return{key:"category",label:"Categories",everyLabel:"All examples",everyCount:l.length,selected:U,onSelect:Y,options:ge.map(ve=>({value:ve,label:y8(ve)??ve,count:l.filter(Ze=>Ze.category===ve).length}))}},[l,u,U,Y]),G=ge=>{const{product:ve,presenter:Ze,scene:Ye}=oe(ge);return{productName:ve?Co(ve,"chip"):null,productPreviewUrl:(ve==null?void 0:ve.previewUrl)??null,productId:(ve==null?void 0:ve.id)??null,presenterName:(Ze==null?void 0:Ze.name)??null,presenterPreviewUrl:Ze?ii(Ze).src:null,presenterId:(Ze==null?void 0:Ze.id)??null,sceneName:Ye?ol(Ye,"chip"):null,scenePreviewUrl:(Ye==null?void 0:Ye.previewUrl)??null,sceneId:(Ye==null?void 0:Ye.id)??null}},[ue,Ne]=s.useState(null),Fe=C?P:ge=>{const ve=l.find(Ze=>Ze.id===ge);ve&&(Ne(s4(ve)),N({kind:"info",title:`Starting from "${ve.title}"`}))},Oe=()=>{const ve=[...ui(g.id)].reverse().find(Ze=>k.some(Ye=>Ye.id===Ze));ee(ve?{scene:ve,attach:"products",compose:"1"}:{attach:"products",compose:"1"})},ot=s.useMemo(()=>Jh(Hf(g),r).slice(0,8),[g,r]),Xe=s.useMemo(()=>{const ge=ui(g.id);return Jh(Dc(g),CR(k,ve=>ge.includes(ve.id))).slice(0,8)},[k,g]),X=s.useMemo(()=>{var le,Me,ze,Re,Be;const ge=new Set,ve=Qe=>!Qe||ge.has(Qe)?null:(ge.add(Qe),Pn(Qe,"tile")),Ze=Qe=>{for(const rt of Qe){const _e=l.find(Et=>Et.id===rt&&Et.previewUrl),zt=ve(_e==null?void 0:_e.previewUrl);if(zt)return zt}return null},Ye=Qe=>{for(const rt of Qe){const _e=k.find(Et=>Et.id===rt&&Et.previewUrl),zt=ve(_e==null?void 0:_e.previewUrl);if(zt)return zt}return null},ke=Qe=>{for(const rt of l)if(!(!rt.previewUrl||ge.has(rt.previewUrl))&&!(Qe&&!rt.brief.tokens.some(_e=>_e.t===Qe)))return ve(rt.previewUrl);return null},te=se.find(Qe=>{var rt,_e;return qr((_e=(rt=Qe==null?void 0:Qe.shots)==null?void 0:rt[0])==null?void 0:_e.file)});return{compose:ve(te?qr((Me=(le=te.shots)==null?void 0:le[0])==null?void 0:Me.file):null)??Ze(["c15-orange-pool","orris-waterline","hoops-painted-canvas"])??ve((ze=i.find(Qe=>Qe.id==="calder-vane-c15-serum"))==null?void 0:ze.previewUrl)??ve((Re=i.find(Qe=>Qe.previewUrl))==null?void 0:Re.previewUrl)??ke("product"),product:Ze(["ridgeline-tyre-top","ridgeline-boulder-gap","yuzu-ice-burst"])??ve((Be=i.find(Qe=>Qe.id==="voss-rowe-ridgeline-trail"))==null?void 0:Be.previewUrl)??ke("product"),presenter:ve(ii(r.find(Qe=>Qe.id==="odette")??r.find(Qe=>Qe.avatarUrl)??r[0]??{}).src)??ke("character"),scene:Ye(["travertine-window-light","palm-shade-garden","lantern-room","cobalt-container","sunlit-color-field"])??Ze(["lounge-chair-travertine","lounge-chair-snowfall","capsule-model-village"])??ke("template")}},[k,r,se,i,l]);return o.jsx(Of.Provider,{value:K,children:o.jsxs(gs,{children:[o.jsxs("main",{className:"sc-main",id:"main","data-no-dock":C||void 0,children:[o.jsxs("h1",{className:"sc-greet",children:["Compose a shot ",o.jsx("em",{children:"on brand"})]}),o.jsxs("div",{className:"sc-create-grid",children:[o.jsxs("button",{type:"button",className:"sc-create-card","data-tone":"compose","data-main":"",onClick:Oe,children:[o.jsx(WR,{thumbUrl:X.compose,fallback:o.jsx(DE,{size:22,weight:"fill"})}),o.jsx("b",{children:"Create an image"})]}),o.jsx(j8,{tone:"product",title:"Add a product",count:se.length,thumbUrl:X.product,icon:o.jsx(Tp,{size:22,weight:"fill"}),onClick:()=>E("product")}),o.jsx(j8,{tone:"presenter",title:"Create a presenter",thumbUrl:X.presenter,icon:o.jsx(GO,{size:22,weight:"fill"}),onClick:()=>E("presenter")}),o.jsx(j8,{tone:"scene",title:"Create a scene",thumbUrl:X.scene,icon:o.jsx(_O,{size:22,weight:"fill"}),onClick:()=>E("scene")})]}),!f&&o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":K,style:B,"aria-hidden":!0,children:o.jsx(qse,{size:"grid",count:8})}),f&&h&&o.jsxs("p",{className:"sc-feed-empty",children:["Couldn't load the showcase gallery."," ",o.jsx("button",{type:"button",className:"sc-sec-more",onClick:()=>p(),children:"Retry"})]}),f&&!h&&l.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(Dm,{filters:o.jsx(Hm,{mode:"tabs",group:we}),search:l.length>=aae&&o.jsx(xd,{value:R,onChange:$,noun:"examples",total:l.length}),density:o.jsx(wm,{value:Z,onChange:V})}),ce.length>0&&o.jsx("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":K,style:B,children:ce.map(ge=>o.jsx(zR,{entry:ge,size:"grid",hideRecipe:!0,onOpen:Fe,productHref:ve=>ga(g,ve),presenterHref:ve=>xa(g,ve),sceneHref:ve=>Ir(g,ve),...G(ge)},ge.id))}),ce.length===0&&(I?o.jsx(Om,{noun:"examples",q:R,facet:U?y8(U):null,onClearSearch:q,onClearAll:_}):o.jsx("p",{className:"sc-looks-empty",children:"No example carries that category yet."}))]}),!a&&o.jsx("div",{className:"sc-masonry","aria-hidden":!0,children:o.jsx(BR,{size:"grid",count:8})}),a&&ot.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"sc-sec-head",children:[o.jsx("span",{className:"sc-sec-title",children:"Presenters"}),o.jsx(Bn,{className:"sc-sec-more",to:Xo(g),children:"Browse presenters"})]}),o.jsx("div",{className:"sc-masonry",children:ot.map(ge=>o.jsx(d4,{presenter:ge,variant:"navigate",size:"grid",onOpen:A},ge.id))})]}),!n&&o.jsx("div",{className:"sc-masonry","aria-hidden":!0,children:o.jsx(UR,{size:"grid",count:8})}),n&&k.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"sc-sec-head",children:[o.jsx("span",{className:"sc-sec-title",children:"Scenes"}),o.jsx(Bn,{className:"sc-sec-more",to:qi(g),children:"Browse scenes"})]}),o.jsx("div",{className:"sc-masonry",children:Xe.map(ge=>o.jsx(ef,{scene:ge,variant:"navigate",size:"grid",onOpen:T},ge.id))})]})]}),!C&&o.jsxs(ZR,{children:[o.jsx(Tw,{}),o.jsx(Lw,{projectId:(v==null?void 0:v.id)||null,brand:g,engines:e,parentId:w,initialBrief:ue,onQueued:(ge,ve,Ze,Ye)=>{Ye!=null&&Ye.length&&y(Ye),S(),j(yr(g))}})]})]})})}function j8({tone:e,title:t,icon:n,count:r,thumbUrl:a,onClick:i}){return o.jsxs("button",{type:"button",className:"sc-create-card","data-tone":e,onClick:i,children:[o.jsx(WR,{thumbUrl:a,fallback:n}),o.jsxs("b",{children:[t,r?o.jsx(tA,{variant:"soft",radius:"full",size:"1",children:r}):null]})]})}function WR({thumbUrl:e,fallback:t}){return o.jsx("span",{className:"sc-glyph","data-photo":e?"":void 0,"aria-hidden":!0,children:e?o.jsx("span",{className:"sc-glyph-shot",children:o.jsx("img",{src:e,alt:"",loading:"lazy"})}):t})}function KR({id:e,name:t,hash:n,drawing:r,state:a,href:i,blank:l,onDiscard:u,chosen:f,batching:h,onPick:p,batch:g}){const v=_n(),w=Yv(),b=g?Tm({kind:"draft",count:g.count,openLabel:"Continue",onOpen:()=>v(i),href:i,onDeselect:()=>p==null?void 0:p(e),onAct:g.onAct}):il(u?{draft:{onContinue:()=>v(i),href:i,onDiscard:()=>u(e)},select:p?{run:()=>p(e)}:void 0}:{onOpen:()=>v(i),href:i}),y=o.jsxs("div",{className:"sc-lookcard","data-variant":"plain","data-size":"grid","data-build":!0,"data-building":r||void 0,"data-picked":f||void 0,"data-batching":h||void 0,children:[o.jsxs(Bn,{className:"sc-lookcard-media",to:i,"aria-label":h?`${f?"Deselect":"Select"} ${t}`:`Continue ${t}`,onClick:k=>{h&&p&&(k.preventDefault(),p(e))},children:[n?o.jsx("img",{src:hn(n,"tile"),alt:""}):o.jsx("span",{className:"sc-lookcard-blank",children:l}),r&&o.jsx("span",{className:"sc-shimmer","aria-hidden":!0}),o.jsx("span",{className:"sc-draftmark",children:"Draft"})]}),p&&o.jsx("button",{type:"button",className:"sc-cell-ctl sc-lookcard-pick","data-on":f||void 0,"aria-pressed":!!f,"aria-label":f?`Deselect ${t}`:`Select ${t}`,onClick:k=>{k.preventDefault(),k.stopPropagation(),p(e)},children:o.jsx(Un,{size:13,weight:"bold"})}),u&&!h&&o.jsx("button",{type:"button",className:"sc-cardpuck","aria-label":`Discard ${t}`,onClick:()=>u(e),children:o.jsx(Mn,{size:13})}),o.jsxs("span",{className:"sc-lookcard-cap",children:[o.jsx("b",{dir:"auto",children:t}),o.jsx("span",{children:a})]})]});return w?y:o.jsxs(Mf,{children:[o.jsx(Rf,{children:y}),o.jsx(Pf,{children:b.map(k=>o.jsxs("span",{style:{display:"contents"},children:[k.separated&&o.jsx(om,{}),o.jsxs(Lf,{color:k.danger?"red":void 0,onSelect:k.onSelect,children:[o.jsx(Fu,{name:k.icon}),k.label]})]},k.key))})]})}function Hw({title:e,name:t,maxLength:n,busy:r,error:a,onConfirm:i,onDismiss:l}){const[u,f]=s.useState(t),h=s.useRef(null),p=s.useRef(!1),g=u.trim(),v=g.length>0,w=y=>{y&&(y.style.height="auto",y.style.height=`${y.scrollHeight}px`)};s.useEffect(()=>{p.current=!1,w(h.current)},[t]),s.useEffect(()=>{r||(p.current=!1)},[r]);const b=()=>{if(!(!v||r||p.current)){if(g===t.trim())return l();p.current=!0,i(g)}};return o.jsxs(_s,{className:"sc-newdlg sc-pdetails",maxWidth:"min(420px, 94vw)",onDismiss:l,onOpenAutoFocus:y=>{y.preventDefault();const k=h.current;k&&(k.focus(),k.select(),w(k))},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ks,{className:"sc-newdlg-title",children:e}),o.jsx(Ss,{asChild:!0,children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx("span",{"aria-hidden":!0,children:"×"})})})]}),o.jsxs("div",{className:"sc-newdlg-body",children:[o.jsxs("label",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Name"}),o.jsx("textarea",{ref:h,className:"sc-pdetails-field",value:u,dir:"auto",rows:1,maxLength:n,"aria-label":"Name",onChange:y=>{f(y.target.value),w(y.currentTarget)},onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),b())}})]}),a&&o.jsx("p",{className:"sc-assetform-err",children:a})]}),o.jsxs("div",{className:"sc-newdlg-foot",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:l,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:!v||r,"data-busy":r||void 0,onClick:b,children:r?"Saving":"Save"})]})]})}function GR({since:e}){const[t,n]=s.useState(Date.now());return s.useEffect(()=>{const r=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(r)},[]),o.jsx("span",{className:"sc-cell-tag",role:"status","aria-label":`${Wv(e,t)}, ${pc(e,t)}`,children:pc(e,t)})}function iae({build:e,onCancel:t,onRetry:n,onDismiss:r}){const a=e.stage==="failed",i=a?eo(e.error):null;return o.jsxs("div",{className:"sc-lookcard","data-variant":"plain","data-size":"grid","data-build":a||void 0,"data-building":!a||void 0,children:[o.jsxs("div",{className:"sc-lookcard-media",children:[o.jsx("span",{className:"sc-lookcard-blank"}),!a&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sc-shimmer"}),o.jsx(GR,{since:e.startedAt})]}),!a&&t&&o.jsx("button",{type:"button",className:"sc-cardpuck","aria-label":`Stop building ${e.name}`,onClick:()=>t(e.id),children:o.jsx(Mn,{size:13})}),a&&r&&o.jsx("button",{type:"button",className:"sc-cardpuck","aria-label":`Dismiss ${e.name}`,onClick:()=>r(e.id),children:o.jsx(Mn,{size:13})}),a&&n&&o.jsxs("button",{type:"button",className:"sc-lookcard-use",onClick:()=>n(e),children:[o.jsx(_E,{size:12})," Try again"]})]}),i?o.jsxs("span",{className:"sc-lookcard-cap",title:i.raw,children:[o.jsx("b",{dir:"auto",children:e.name}),o.jsx("span",{children:i.title})]}):null]})}function Ow({count:e,loaded:t,tool:n,icon:r,danger:a,onAct:i,keep:l,onClear:u,onSelectAll:f}){return o.jsxs("div",{className:"sc-picked",role:"toolbar","aria-label":"Selection",children:[o.jsxs("span",{className:"sc-picked-meta",children:[o.jsxs("span",{className:"sc-picked-n",role:"status",children:[e,o.jsx("span",{className:"sc-vh",children:" selected"})]}),t>1&&o.jsx("button",{type:"button",className:"sc-picked-all",onClick:e<t?f:u,children:e<t?"Select all":"Deselect all"})]}),o.jsx("span",{className:"sc-picked-rule","aria-hidden":!0}),o.jsxs("span",{className:"sc-picked-tools",children:[l&&o.jsx(A8,{label:l.label,onClick:l.onAct,children:o.jsx(Ua,{size:17,weight:l.filled?"fill":"regular"})}),o.jsx(A8,{label:n,tone:a?"danger":void 0,onClick:i,children:o.jsx(lae,{name:r})})]}),o.jsx("span",{className:"sc-picked-rule","aria-hidden":!0}),o.jsx("span",{className:"sc-picked-exit",children:o.jsx(A8,{label:"Done",onClick:u,children:o.jsx(Mn,{size:16,weight:"bold"})})})]})}function lae(e){return o.jsx(ul,{size:17})}function A8({label:e,tone:t,onClick:n,children:r}){return o.jsx(lr,{label:e,children:o.jsx("button",{type:"button",className:"sc-picked-tool","data-tone":t,"aria-label":e,onClick:n,children:r})})}const d0=()=>({kind:null,ids:new Set});function Iw(e){const[t,n]=s.useState(d0),r=s.useCallback(()=>n(d0()),[]);s.useEffect(()=>{r()},[e,r]),s.useEffect(()=>{if(t.ids.size===0)return;const p=g=>{g.defaultPrevented||g.key!=="Escape"||r()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[t.ids.size,r]);const a=s.useCallback((p,g)=>{n(v=>{if(v.kind&&v.kind!==p)return v;const w=new Set(v.ids);return w.has(g)?w.delete(g):w.add(g),w.size?{kind:v.kind??p,ids:w}:d0()})},[]),i=s.useCallback((p,g)=>{n({kind:p,ids:new Set(g)})},[]),l=s.useCallback(p=>{const g=new Set(p);n(v=>{const w=new Set([...v.ids].filter(b=>g.has(b)));return w.size?{kind:v.kind,ids:w}:d0()})},[]),u=s.useCallback(p=>{n(g=>{if(!g.ids.has(p))return g;const v=new Set(g.ids);return v.delete(p),v.size?{kind:g.kind,ids:v}:d0()})},[]),f=s.useCallback(p=>{t.ids.size===0||p.target.closest(".sc-lookcard, .sc-picked, button, a, input, select, textarea, label, [role], [contenteditable]")||r()},[t.ids.size,r]),h=s.useCallback(p=>t.kind===null||t.kind===p,[t.kind]);return{kind:t.kind,ids:t.ids,toggle:a,selectAll:i,clear:r,retain:l,forget:u,onBlank:f,picking:h,batching:t.kind}}function Fw({label:e}){return o.jsx("div",{className:"sc-starter-rule",children:o.jsx("span",{children:e})})}const N8=60;function tf(e,t){const[n,r]=s.useState(N8);s.useEffect(()=>{r(N8)},[t]);const{visible:a,remaining:i}=jw(e,n),l=s.useCallback(()=>r(u=>u+N8),[]);return{visible:a,remaining:i,showMore:l}}const cae=24,uae=8,M8="__bookmarked";function dae(){const{scenes:e,collections:t,verticals:n,loaded:r,error:a,refetch:i,applyBrand:l,refreshBrands:u}=Hn(),{brand:f}=dn(),h=e,{push:p}=cr(),g=_n(),[v,w]=s.useState(()=>ui(f.id)),b=Ce=>w(Pm("scene",f.id,Ce)),y=Rm(),{builds:k,poke:S,studio:E}=Ca(),j=wl(),N=s.useMemo(()=>Dc(f),[f]),A=k.filter(Ce=>Ce.kind==="scene"&&(!Ce.finished||Ce.stage==="failed")),T=!!gn({path:pt.sceneStudio}),[P,C]=s.useState(()=>Lh(f.id)),R=E.filter(Ce=>Ce.kind==="scene").map(Ce=>`${Ce.id}:${Ce.status}`).join("|");s.useEffect(()=>{T||C(Lh(f.id))},[T,f.id,R]);const $=s.useMemo(()=>tne(P,E),[P,E]),[H,D]=s.useState(null),q=Ce=>{Ce.drawing&&Ce.jobId&&je.cancelSceneStudioJob(f.id,Ce.jobId).catch(()=>{}),one(f.id,Ce.convo),C(Lh(f.id))},_=Ce=>{const xe=$.find(et=>et.convo===Ce);xe&&(xe.hash||xe.drawing?D(xe):q(xe))},{q:U,setQ:Y,facets:I,setFacets:F,clearSearch:O,clear:Z}=Bf(["vertical","bookmarked"]),V=I.vertical,B=I.bookmarked==="1",K=Iw(`${f.id}|${U}|${V??""}|${B?"1":""}`),ee=U.trim().length>0,[se,oe]=ba(Kr.wallDensity,ed),me=Hc(se),ce=Ce=>oe(Ce),we=ym(me),G=vm(me),ue=Ce=>g(Ir(f,Ce)),[Ne,ne]=s.useState(null),[Fe,Oe]=s.useState(!1),[ot,Xe]=s.useState(null),[X,J]=s.useState(!1),[ge,ve]=s.useState(null),[Ze,Ye]=s.useState(!1),ke=s.useCallback(Ce=>{const xe=N.find(et=>et.id===Ce);xe&&ne(xe)},[N]),te=s.useCallback(Ce=>{const xe=N.find(et=>et.id===Ce);xe&&(ve(null),Xe(xe))},[N]),le=async Ce=>{if(!(!ot||X)){J(!0),ve(null);try{l((await je.updateScene(f.id,ot.id,{name:Ce})).brand),Xe(null)}catch(xe){const et=ln(xe,"Could not rename this scene");ve([et.title,et.detail].filter(Boolean).join(" "))}finally{J(!1)}}},Me=async()=>{if(!(!Ne||Fe)){Oe(!0);try{l((await je.deleteScene(f.id,Ne.id)).brand),K.forget(Ne.id),ne(null)}catch(Ce){(Ce==null?void 0:Ce.status)===404?(await u(),K.forget(Ne.id),ne(null)):p(ln(Ce,"Could not delete this scene"))}finally{Oe(!1)}}},ze=s.useMemo(()=>B?h.filter(Ce=>v.includes(Ce.id)):V?h.filter(Ce=>Ce.verticals.includes(V)):h,[h,V,B,v]),Be=!(N.length>0||A.length>0||$.length>0),Qe=[...h,...N].reduce((Ce,xe)=>Ce+(v.includes(xe.id)?1:0),0),rt=B&&Qe===0,_e=rt&&Be,zt=rt&&!Be,Et=ee||B&&!_e,Zt=s.useMemo(()=>_e?h:ze,[_e,h,ze]),He=s.useMemo(()=>Zt.filter(Ce=>jo(dp(Ce),U)),[Zt,U]),[mt,vt]=s.useState(()=>new Set),{visible:St,remaining:kt,showMore:Nt}=tf(He,`${V??""}|${B?"bookmarked":""}|${_e?"browse":""}|${U}`),Bt=Ce=>[...N,...h].filter(xe=>!xe.verticals.length||xe.verticals.includes(Ce)).length,at=[{value:M8,label:"Keepers",count:Qe},...n.map(Ce=>({value:Ce,label:Ce,count:Bt(Ce)}))],Mt=h.length>0?"tabs":"none",ft={key:"vertical",label:"Vertical",everyLabel:"All scenes",everyCount:h.length+N.length,selected:B?M8:V,onSelect:Ce=>F(Ce===M8?{bookmarked:"1",vertical:null}:{bookmarked:null,vertical:Ce}),options:at},vn=s.useMemo(()=>N.filter(Ce=>V?!Ce.verticals.length||Ce.verticals.includes(V):!0).filter(Ce=>jo(dp(Ce),U)).filter(Ce=>B?v.includes(Ce.id):!0),[N,V,U,B,v]),Qt=B?vn.length>0:$.length>0||A.length>0||vn.length>0,{visible:on,remaining:Rt,showMore:An}=tf(vn,`${f.id}|${V??""}|${B?"bookmarked":""}|${U}`),[Vt,re]=s.useState(null);s.useEffect(()=>{if(!Vt||Rt<=0)return;const Ce=new IntersectionObserver(xe=>{xe.some(et=>et.isIntersecting)&&An()},{root:Vt.closest(".sc-home"),rootMargin:"200% 0px"});return Ce.observe(Vt),()=>Ce.disconnect()},[Vt,Rt,An]);const ae=()=>{K.ids.size===1?ke([...K.ids][0]):Ye(!0)},fe=[...K.ids],Te=fe.length>0&&fe.every(Ce=>v.includes(Ce)),Ue=()=>w(Ew("scene",f.id,fe,!Te)),ut=$m(K.ids.size,Te,"scenes"),gt=async()=>{if(Fe)return;const Ce=[...K.ids];Oe(!0);try{const{failed:xe,error:et}=await wp(Ce,yt=>je.deleteScene(f.id,yt));await u(),K.retain(xe),Ye(!1),et&&p(ln(et,"Could not delete these scenes"))}finally{Oe(!1)}},Pt=o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>j("scene"),children:[o.jsx(fr,{size:12})," Create scene"]}),tt=(Ce,xe=!1)=>o.jsx("div",{className:"sc-masonry","data-wall":xe||void 0,"data-density":!0,"data-density-size":G,style:we,children:Ce.map(et=>o.jsx(ef,{scene:et,variant:"use",size:"grid",onOpen:ue,href:Ir(f,et.id),onUse:y,bookmarked:v.includes(et.id),onBookmark:b},et.id))}),wt=o.jsx(Dm,{title:"Scenes",filters:o.jsx(Hm,{mode:Mt,group:ft}),density:o.jsx(wm,{value:me,onChange:ce}),search:h.length>=uae&&o.jsx(xd,{value:U,onChange:Y,noun:"scenes",total:h.length})});return o.jsxs(Of.Provider,{value:G,children:[o.jsx(gs,{children:o.jsxs("main",{className:"sc-looks sc-scenes",id:"main","data-hero":Be||void 0,onClick:K.onBlank,children:[!Be&&wt,Qt&&o.jsxs("section",{className:"sc-owned",children:[o.jsx("div",{className:"sc-sec-head",children:o.jsx("h2",{className:"sc-sec-title",children:"Your scenes"})}),o.jsxs("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":G,style:we,children:[!B&&$.map(Ce=>o.jsx(KR,{id:Ce.convo,name:Ce.name||"Untitled scene",hash:Ce.hash,drawing:Ce.drawing,state:rne(Ce),href:Xi(f,Ce.convo),blank:o.jsx(t7,{size:44,weight:"thin"}),onDiscard:_},Ce.convo)),H&&o.jsx(qn,{label:"Discard",title:`Discard ${H.name||"this unfinished scene"}?`,body:H.drawing?"The picture being drawn is stopped, and what was drawn here is thrown away. Nothing was saved to the library.":"What was drawn here is thrown away. Nothing was saved to the library.",open:!0,busy:!1,onOpenChange:Ce=>{Ce||D(null)},onConfirm:()=>{q(H),D(null)}}),!B&&A.map(Ce=>o.jsx(iae,{build:Ce,onCancel:xe=>void je.cancelAssetBuild(f.id,xe).then(S),onDismiss:xe=>void je.deleteAssetBuild(f.id,xe).then(S),onRetry:()=>j("scene")},Ce.id)),on.map(Ce=>o.jsx(ef,{scene:Ce,variant:"use",size:"grid",onOpen:ue,href:Ir(f,Ce.id),onUse:y,bookmarked:v.includes(Ce.id),onBookmark:b,onDelete:ke,onRename:te,chosen:K.ids.has(Ce.id),batching:K.batching==="owned-scene",onPick:K.picking("owned-scene")?xe=>K.toggle("owned-scene",xe):void 0,batch:K.kind==="owned-scene"&&K.ids.has(Ce.id)?{count:K.ids.size,onAct:ae,onKeep:Ue,allKept:Te}:null},Ce.id))]}),Rt>0&&o.jsx("div",{ref:re,"aria-hidden":!0}),Rt>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:An,children:["Show ",Math.min(Rt,60)," more"]})}),ot&&o.jsx(Hw,{title:"Rename scene",name:ot.name,maxLength:60,busy:X,error:ge,onConfirm:Ce=>void le(Ce),onDismiss:()=>{X||Xe(null)}}),Ne&&o.jsx(qn,{label:"Delete scene",title:`Delete ${Ne.name}?`,body:di("owned-scene",1),open:!0,busy:Fe,onOpenChange:Ce=>{!Ce&&!Fe&&ne(null)},onConfirm:()=>void Me()}),Ze&&o.jsx(qn,{label:as("owned-scene",K.ids.size).menu,title:`${as("owned-scene",K.ids.size).menu}?`,body:di("owned-scene",K.ids.size),open:!0,busy:Fe,onOpenChange:Ce=>{!Ce&&!Fe&&Ye(!1)},onConfirm:()=>void gt()})]}),Be&&r&&!a&&h.length>0&&o.jsx(wo,{shape:"cold",title:o.jsxs(o.Fragment,{children:["Build your own ",o.jsx("em",{children:"scene"})]}),body:"Upload a few references of a place, or describe it, and its light and materials carry into every image you make.",action:Pt}),Qt&&r&&!a&&ze.length>0&&o.jsx("div",{className:"sc-sec-head sc-owned-divider",children:o.jsx("h2",{className:"sc-sec-title",children:"Scenri scenes"})}),Be&&r&&!a&&h.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(Fw,{label:"Or start from one of ours"}),wt]}),!r&&o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":G,style:we,"aria-hidden":!0,children:o.jsx(UR,{size:"grid",count:8})}),r&&a&&o.jsx(wo,{shape:"error",title:"Couldn't load this library",body:"Something went wrong reaching the catalog.",onRetry:()=>i()}),r&&!a&&!Et&&t.map(Ce=>{const xe=Zt.filter(Q=>Q.collections.includes(Ce));if(!xe.length)return null;const yt=mt.has(Ce)?xe:xe.slice(0,cae);return o.jsxs("section",{className:"sc-coll",children:[o.jsx("h2",{children:Ce}),tt(yt),yt.length<xe.length&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>vt(Q=>new Set(Q).add(Ce)),children:["Show all ",xe.length]})})]},Ce)}),r&&!a&&Et&&St.length>0&&tt(St,!0),r&&!a&&zt&&o.jsx(wo,{shape:"zero",title:"Nothing in Keepers yet",body:"Keep a scene from its card and it stays here.",mark:Dw,action:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>F({bookmarked:null}),children:"Browse every scene"})}),r&&!a&&h.length>0&&!zt&&He.length===0&&vn.length===0&&o.jsx(Om,{noun:"scenes",q:U,facet:_e?null:B?"Keepers":V,onClearSearch:O,onClearAll:Z}),Et&&kt>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:Nt,children:["Show ",Math.min(kt,60)," more"]})})]})}),o.jsx(bc,{}),K.kind==="owned-scene"&&K.ids.size>0&&o.jsx("div",{className:"sc-wall-dock",children:o.jsx(Ow,{count:K.ids.size,loaded:on.length,tool:as("owned-scene",K.ids.size).tool,icon:as("owned-scene",K.ids.size).icon,danger:!0,onAct:ae,keep:{label:ut.tool,filled:Te,onAct:Ue},onClear:K.clear,onSelectAll:()=>K.selectAll("owned-scene",on.map(Ce=>Ce.id))})})]})}function _w(e,t,n=12){const r=t.filter(Boolean).join(","),[a,i]=s.useState({key:"",items:[]});return s.useEffect(()=>{if(!r)return;const l=new AbortController;return je.feed(e,{token:r,limit:n},l.signal).then(u=>{l.signal.aborted||i({key:r,items:u.items.filter(f=>f.status==="done"&&f.images.length>0)})}).catch(()=>{}),()=>l.abort()},[e,r,n]),a.key===r?a.items:[]}const f4=[{id:"top-down",label:"Top down",camera:"Directly overhead, looking straight down, the subject centred, deep focus"},{id:"eye-level",label:"Eye level",camera:"Eye level, the subject at a natural three-quarter angle, medium depth"},{id:"ground",label:"Ground level",camera:"Ground level, camera low, the subject close and large in frame, the place rising behind it"},{id:"wide",label:"Wide",camera:"A wide view, the subject small in the frame, the place around it doing the talking"},{id:"close",label:"Close",camera:"Close in on the subject, its surface, edge and material filling the frame"}],YR=4;function fae(e,t=""){var u,f;const n=[],r=((u=e.refs)==null?void 0:u.length)??0;r>0&&n.push(`read from ${r} ${r===1?"photograph":"photographs"}`);const a=((f=e.setups)==null?void 0:f.length)??0;a>0&&n.push(`${a} ${a===1?"way":"ways"} to shoot it`);const i=n.join(" · "),l=i?`${i.charAt(0).toUpperCase()}${i.slice(1)}.`:"";return[t.trim(),l].filter(Boolean).join(" ")}function Vw({to:e,wall:t,where:n}){return o.jsxs("div",{className:"sc-lookpage-crumb",children:[o.jsx(Bn,{to:e,children:t}),o.jsx("span",{children:"/"}),o.jsx("span",{children:n})]})}function Zw({kind:e,brandId:t,id:n}){const[r,a]=s.useState(()=>rd(e,t).includes(n));s.useEffect(()=>{a(rd(e,t).includes(n))},[e,t,n]);const i=r?"Remove from Keepers":"Add to Keepers";return o.jsx(lr,{label:i,children:o.jsx("button",{type:"button",className:"sc-icon-btn sc-lookpage-keep","data-kept":r||void 0,"aria-pressed":r,"aria-label":i,onClick:()=>a(Pm(e,t,n).includes(n)),children:o.jsx(Ua,{size:15,weight:r?"fill":"regular"})})})}function hae({items:e,placeholder:t,open:n,hit:r,onRemove:a,onOpen:i}){return o.jsxs("div",{className:"sc-chipfield","data-state":n?"open":void 0,children:[r,o.jsxs("span",{className:"sc-chipfield-row",children:[e.length===0&&t?o.jsx("span",{className:"sc-chipfield-ph",children:t}):null,e.map(l=>o.jsxs("span",{className:"sc-chipfield-chip",onClick:()=>i==null?void 0:i(),children:[l,a&&o.jsx("button",{type:"button","data-role":"remove","aria-label":`Remove ${l}`,onPointerDown:u=>u.stopPropagation(),onClick:u=>{u.preventDefault(),u.stopPropagation(),a(l)},children:o.jsx(Mn,{size:10,weight:"bold"})})]},l))]}),o.jsx(nl,{size:13,className:"sc-chipfield-caret","aria-hidden":!0})]})}function pae({value:e,onChange:t,options:n,label:r,placeholder:a="Any",findPlaceholder:i="Find or add",emptyNote:l="Nothing by that name.",max:u=12,maxLength:f=40}){const[h,p]=s.useState(!1),[g,v]=s.useState(""),w=s.useRef(null),b=[...n,...e.filter(A=>!n.some(T=>fu(T,A)))],y=g.trim(),k=y?b.filter(A=>A.toLowerCase().includes(y.toLowerCase())):b,S=e.length>=u,E=y.length>0&&!b.some(A=>fu(A,y))&&!S,j=A=>{const T=e.some(P=>fu(P,A));!T&&S||t(T?e.filter(P=>!fu(P,A)):[...e,A])},N=()=>{var A;E&&(t([...e,y.slice(0,f)]),v(""),(A=w.current)==null||A.focus())};return s.useEffect(()=>{if(!h)return;const A=setTimeout(()=>{var T;return(T=w.current)==null?void 0:T.focus()},0);return()=>clearTimeout(A)},[h]),o.jsxs(ws,{open:h,onOpenChange:A=>{p(A),A||v("")},children:[o.jsx(hae,{items:e,placeholder:a,open:h,onOpen:()=>p(!0),onRemove:A=>t(e.filter(T=>!fu(T,A))),hit:o.jsx(ys,{children:o.jsx("button",{type:"button",className:"sc-chipfield-hit","aria-label":r})})}),o.jsxs(bs,{align:"start",sideOffset:6,className:"sc-menu sc-chippick-menu",children:[o.jsx("input",{ref:w,className:"sc-chippick-find",type:"text",value:g,maxLength:f,placeholder:i,"aria-label":i,onChange:A=>v(A.target.value),onKeyDown:A=>{A.stopPropagation(),A.key==="Enter"?(A.preventDefault(),E?N():k.length===1&&j(k[0])):A.key==="Escape"&&p(!1)}}),o.jsxs("div",{className:"sc-chippick-list",children:[k.map(A=>{const T=e.some(P=>fu(P,A));return o.jsxs(Yn,{className:"sc-menu-item","data-on":T||void 0,"data-off":!T&&S?"":void 0,onSelect:P=>{P.preventDefault(),j(A)},children:[o.jsx("span",{className:"sc-menu-lb",children:A}),T&&o.jsx(Un,{size:14,className:"sc-menu-check","aria-hidden":"true"})]},A)}),!k.length&&!E&&o.jsx("p",{className:"sc-chippick-none",children:l})]}),E&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-menu-sep"}),o.jsxs(Yn,{className:"sc-menu-item",onSelect:A=>{A.preventDefault(),N()},children:[o.jsx(fr,{size:16,className:"sc-menu-ic"}),o.jsxs("span",{className:"sc-menu-lb",children:['Add "',y,'"']})]})]}),S&&o.jsx("p",{className:"sc-chippick-none",children:"That is as many as this holds."})]})]})}const fu=(e,t)=>e.trim().toLowerCase()===t.trim().toLowerCase();function qR({name:e,categories:t,known:n,hint:r,ways:a,wayChoices:i,wayMax:l,busy:u,error:f,onSave:h,onDismiss:p}){const[g,v]=s.useState(e),[w,b]=s.useState(t),[y,k]=s.useState(()=>[...a??[]]),S=g.trim(),E=S.length>0,j=P=>P.map(C=>C.id).join(" "),N=S!==e.trim()||w.join(" ")!==t.join(" ")||!!a&&j(y)!==j(a),A=y.length>=(l??Number.POSITIVE_INFINITY)?[]:(i??[]).filter(P=>!y.some(C=>C.id===P.id)),T=()=>{if(!(!E||u)){if(!N)return p();h({name:S,categories:w,...a?{ways:y}:{}})}};return o.jsxs(_s,{className:"sc-newdlg sc-pdetails",maxWidth:"min(460px, 94vw)",onDismiss:p,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ks,{className:"sc-newdlg-title",children:"Details"}),o.jsx(Ss,{asChild:!0,children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx("span",{"aria-hidden":!0,children:"×"})})})]}),o.jsxs("div",{className:"sc-newdlg-body",children:[o.jsxs("label",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Name"}),o.jsx("input",{className:"sc-pdetails-field",value:g,dir:"auto",onChange:P=>v(P.target.value),onKeyDown:P=>P.key==="Enter"&&T()})]}),o.jsxs("div",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Categories"}),o.jsx(pae,{value:w,onChange:b,options:n,label:"Categories",placeholder:"Any",findPlaceholder:"Find or add a category",emptyNote:"Nothing by that name.",maxLength:30}),o.jsx("span",{className:"sc-pdetails-hint",children:r})]}),a&&o.jsxs("div",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Ways to shoot it"}),o.jsxs("div",{className:"sc-pdetails-ways",children:[y.map(P=>o.jsxs("div",{className:"sc-pdetails-way",children:[o.jsx("span",{className:"sc-pdetails-way-lb",children:P.label}),o.jsx("span",{className:"sc-pdetails-way-sub",children:P.camera}),o.jsx("button",{type:"button",className:"sc-icon-btn","aria-label":`Remove ${P.label}`,onClick:()=>k(y.filter(C=>C.id!==P.id)),children:o.jsx(Mn,{size:13,weight:"bold","aria-hidden":!0})})]},P.id)),A.length>0&&o.jsxs(ws,{children:[o.jsx(ys,{children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost","aria-label":"Add a way to shoot it",children:[o.jsx(fr,{size:12,weight:"bold","aria-hidden":!0}),o.jsx("span",{children:"Add a way"})]})}),o.jsx(bs,{children:A.map(P=>o.jsx(Yn,{onSelect:()=>k([...y,P]),children:P.label},P.id))})]})]}),o.jsxs("span",{className:"sc-pdetails-hint",children:["A way moves the camera and leaves the world alone.",l?` ${l} at most.`:""]})]}),f&&o.jsx("p",{className:"sc-assetform-err",children:f})]}),o.jsxs("div",{className:"sc-newdlg-foot",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:p,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:!E,"data-busy":u||void 0,onClick:T,children:u?"Saving":"Save"})]})]})}function tc({src:e,srcSet:t,crop:n}){const[r,a]=s.useState(!1);return r?o.jsx("span",{className:"sc-lookpage-ref-blank","aria-hidden":!0,children:o.jsx(Js,{size:20})}):o.jsx("img",{src:e,...t?{srcSet:t,sizes:SA.large}:{},alt:"",loading:"lazy",decoding:"async",...n?{"data-crop":n}:{},onError:()=>a(!0)})}function zw(){return o.jsx("div",{className:"sc-lookpage-refs",children:o.jsx("div",{className:"sc-lookpage-ref",children:o.jsx("span",{className:"sc-lookpage-ref-blank",children:o.jsx(Js,{size:20})})})})}function Bw({node:e,to:t}){const[n,r]=s.useState(!1);return o.jsx(Bn,{className:"sc-lookcard","aria-label":`Open ${Rr(e)}`,to:t,children:n?o.jsx("span",{className:"sc-lookcard-blank",children:o.jsx(Js,{size:20})}):o.jsx("img",{src:hn(e.images[0],"tile"),alt:"",loading:"lazy",onError:()=>r(!0)})})}function Uu({label:e,children:t}){const n=s.useRef(null),r=s.useRef(null),a=s.useRef(!1),i=s.useRef(()=>{});s.useLayoutEffect(()=>{const u=n.current,f=r.current;if(!u||!f)return;let h=0;const p=()=>{const w=f.scrollWidth-f.clientWidth;if(w<=1){delete u.dataset.overflowLeft,delete u.dataset.overflowRight;return}f.scrollLeft>2?u.dataset.overflowLeft="":delete u.dataset.overflowLeft,f.scrollLeft<w-2?u.dataset.overflowRight="":delete u.dataset.overflowRight};i.current=p,p();const g=()=>{h||(h=requestAnimationFrame(()=>{h=0,p()}))},v=new ResizeObserver(()=>p());return v.observe(f),f.addEventListener("scroll",g,{passive:!0}),()=>{h&&cancelAnimationFrame(h),i.current=()=>{},v.disconnect(),f.removeEventListener("scroll",g)}},[]);const l=u=>{const f=r.current;if(!(f!=null&&f.firstElementChild)||a.current)return;const h=f.firstElementChild.getBoundingClientRect().width+16,p=f.scrollWidth/2;u<0&&f.scrollLeft<h&&(f.scrollLeft+=p);const g=f.scrollLeft,v=u*h,w=performance.now();a.current=!0;const b=y=>{const k=Math.min(1,(y-w)/420);f.scrollLeft=g+v*(1-(1-k)**3),i.current(),k<1?requestAnimationFrame(b):(a.current=!1,f.scrollLeft>=p&&(f.scrollLeft-=p),i.current())};requestAnimationFrame(b)};return o.jsxs("section",{className:"sc-lookpage-band",children:[o.jsx("p",{className:"sc-bandhead",children:e}),o.jsxs("div",{className:"sc-slider",ref:n,children:[o.jsx("button",{type:"button",className:"sc-slider-arrow prev","aria-label":"Previous",onClick:()=>l(-1),children:o.jsx(Sa,{size:13,weight:"bold"})}),o.jsx("button",{type:"button",className:"sc-slider-arrow next","aria-label":"Next",onClick:()=>l(1),children:o.jsx(cl,{size:13,weight:"bold"})}),o.jsxs("div",{className:"sc-slider-track",ref:r,children:[t,t]})]})]})}function XR(e){const t=s.useRef(null),n=s.useRef(null);s.useLayoutEffect(()=>{const a=t.current,i=n.current;if(!a||!i)return;let l=0;const u=()=>{const p=i.scrollWidth-i.clientWidth;if(p<=1){delete a.dataset.overflowLeft,delete a.dataset.overflowRight;return}i.scrollLeft>2?a.dataset.overflowLeft="":delete a.dataset.overflowLeft,i.scrollLeft<p-2?a.dataset.overflowRight="":delete a.dataset.overflowRight},f=()=>{l||(l=requestAnimationFrame(()=>{l=0,u()}))};u();const h=new ResizeObserver(()=>u());h.observe(i);for(const p of i.children)h.observe(p);return i.addEventListener("scroll",f,{passive:!0}),()=>{l&&cancelAnimationFrame(l),h.disconnect(),i.removeEventListener("scroll",f)}},[e]);const r=s.useCallback(a=>{const i=n.current;if(!(i!=null&&i.firstElementChild))return;const l=i.firstElementChild.getBoundingClientRect().width,u=Number.parseFloat(getComputedStyle(i).columnGap)||0,f=window.matchMedia("(prefers-reduced-motion: reduce)").matches;i.scrollBy({left:a*(l+u),behavior:f?"auto":"smooth"})},[]);return{shellRef:t,railRef:n,page:r}}function Uw({count:e,label:t,className:n,trackClassName:r,style:a,children:i}){const{shellRef:l,railRef:u,page:f}=XR(e);return o.jsxs("div",{className:n?`sc-rail ${n}`:"sc-rail",ref:l,style:{"--sc-rail-count":e},children:[o.jsx("button",{type:"button",className:"sc-rail-arrow prev","aria-label":`${t}, earlier`,onClick:()=>f(-1),children:o.jsx(Sa,{size:13,weight:"bold"})}),o.jsx("button",{type:"button",className:"sc-rail-arrow next","aria-label":`${t}, later`,onClick:()=>f(1),children:o.jsx(cl,{size:13,weight:"bold"})}),o.jsx("ol",{className:r?`sc-rail-track ${r}`:"sc-rail-track","aria-label":t,ref:u,style:a,children:i})]})}function Im(){const e=s.useRef(!1);return s.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),s.useCallback(()=>{const t=window.location.pathname;return()=>e.current&&window.location.pathname===t},[])}function Ru({variant:e,label:t,isCover:n,onOpen:r,onUse:a,onCover:i,busy:l=!1}){const u=!n&&!!i;return e==="sheet"?o.jsxs(o.Fragment,{children:[a&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:l,onClick:a,children:"Use this view"}),u&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:l,onClick:i,children:"Set as cover"})]}):o.jsxs(o.Fragment,{children:[a&&o.jsx("button",{type:"button",className:"sc-lookcard-use","aria-label":`Use this view: ${t}`,disabled:l,onClick:a,children:"Use this view"}),(r||a||u)&&o.jsx("div",{className:"sc-corner",children:o.jsxs(ws,{children:[o.jsx(lr,{label:"More",children:o.jsx(ys,{children:o.jsxs("button",{type:"button",className:"sc-cell-ctl sc-lookcard-more","aria-label":`More for ${t}`,children:[o.jsx(F4,{className:"sc-lookcard-more-vert",size:16,weight:"bold"}),o.jsx(I4,{className:"sc-lookcard-more-horiz",size:16,weight:"bold"})]})})}),o.jsxs(bs,{side:"bottom",align:"end",sideOffset:4,collisionPadding:12,children:[r&&o.jsxs(Yn,{onSelect:r,children:[o.jsx(Fu,{name:"open"}),"Open"]}),a&&o.jsxs(Yn,{disabled:l,onSelect:a,children:[o.jsx(Fu,{name:"use"}),"Use this view"]}),u&&o.jsxs(Yn,{disabled:l,onSelect:i,children:[o.jsx(Fu,{name:"cover"}),"Set as cover"]})]})]})})]})}function h4({label:e,isCover:t}){return o.jsxs("span",{className:"sc-refset-lb","data-cover":t||void 0,"aria-hidden":!0,children:[e,t&&o.jsx("span",{className:"sc-sceneview-cover",children:" · Cover"})]})}const X5=1500;function QR(e,t,n){const{refreshBrands:r}=Hn(),[a,i]=s.useState(null),[l,u]=s.useState([]),[f,h]=s.useState([]),[p,g]=s.useState(!1),[v,w]=s.useState(0),[b,y]=s.useState(!1),k=s.useRef(void 0),S=s.useRef(r);S.current=r,s.useEffect(()=>{if(!t)return;let j=!0,N=null;const A=async()=>{var T;try{const P=await je.sceneExamples(e,t);if(!j)return;const C=P.job?`${P.job.id}:${P.job.status}`:null;if(P.job&&P.job.status!=="running"&&k.current!==void 0&&C!==k.current&&await S.current(),!j)return;k.current=C,i(P.job),u(P.first),h(P.more),g(!0),y(!1),((T=P.job)==null?void 0:T.status)==="running"&&(N=setTimeout(A,X5))}catch(P){j&&(P==null?void 0:P.status)!==404&&(N=setTimeout(A,X5*2))}};return A(),()=>{j=!1,N&&clearTimeout(N)}},[e,t,n,v]);const E=s.useCallback(()=>{y(!0),w(j=>j+1)},[]);return{job:a,first:l,more:f,read:p,waiting:b,again:E}}const mae=["no","one","two","three","four","five"];function gae({brandId:e,scene:t,onError:n}){var F;const{applyBrand:r}=Hn(),a=Rm(),i=Im(),{job:l,first:u,again:f}=QR(e,t.id,t.placeUrl??null),[h,p]=s.useState(!1),[g,v]=s.useState(!1),[w,b]=s.useState(!1),[y,k]=s.useState(null),S=sN(t.examples,l),E=(l==null?void 0:l.status)==="running",j=OG(t.examples),N=async()=>{if(g||!u.length)return;const O=i();v(!0),n(null);try{await je.drawSceneExamples(e,t.id,{first:!0}),f()}catch(Z){O()&&n(String((Z==null?void 0:Z.message)??Z))}finally{O()&&v(!1)}},A=u.length&&(l==null?void 0:l.status)!=="running"?o.jsx("p",{className:"sc-scenepage-examples-ask",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:g,onClick:()=>void N(),children:[j.length?"Draw them again":"Draw it in use",`, ${mae[u.length]??u.length} picture${u.length===1?"":"s"}`]})}):null,T=async O=>{const Z=f4.find(B=>B.id===O);if(!Z||h)return;const V=i();p(!0),n(null);try{const B=t.setups??[];if(!B.some(K=>K.id===Z.id)){const K=await je.updateScene(e,t.id,{setups:[...B,Z]});r(K.brand)}if(!V())return;a(t.id,Z.id)}catch(B){V()&&n(String((B==null?void 0:B.message)??B))}finally{V()&&p(!1)}},P=async O=>{const Z=i();b(!0),n(null);try{const V=await je.updateScene(e,t.id,{cover:O});r(V.brand)}catch(V){Z()&&n(String((V==null?void 0:V.message)??V))}finally{Z()&&b(!1)}},C=_Y(t),R=(O,Z)=>O?()=>a(t.id,void 0,O,Z):void 0,$=t.placeUrl?{src:t.placeUrl,label:"The place",view:"place",...t.previewHash?{hash:t.previewHash}:{}}:null,H=O=>o.jsx(Ru,{variant:"sheet",label:O.label,isCover:O.view===C,onUse:R(O.hash,O.view),onCover:()=>void P(O.view),busy:w});if(!S.length&&!$)return o.jsx(zw,{});if(!S.length&&$)return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"sc-scenepage-place sc-sceneview-frame",children:[o.jsx("button",{type:"button",className:"sc-scenepage-open","aria-label":`${$.label}, open`,onClick:()=>k($),children:o.jsx(tc,{src:Pn($.src,"tile"),srcSet:Jl($.src)})}),o.jsx(Ru,{variant:"tile",label:$.label,isCover:!0,onOpen:()=>k($),onUse:R($.hash,"place")})]}),A,y&&o.jsx(ad,{src:y.src,kind:"scene",label:y.label,noun:t.name,onClose:()=>k(null),actions:H(y)})]});const D=y==null?void 0:y.tile,q=D!=null&&D.setup?f4.find(O=>O.id===D.setup):void 0,_=!!q&&((t.setups??[]).some(O=>O.id===q.id)||(t.setups??[]).length<YR),U=E&&l?Uv({status:l.status,step:l.current,done:l.done.length,total:l.roles.length,error:l.error}):j.length>0?`${j.length===1?`The ${Za[j[0]].toLowerCase()} shows`:"These show"} an earlier picture of this place.`:null,Y=((F=S[0])==null?void 0:F.role)==="hero",I=$?o.jsxs("li",{children:[o.jsxs("span",{className:"sc-sceneview-frame","data-cover":C==="place"||void 0,children:[o.jsx("button",{type:"button",className:"sc-refset-tile","aria-label":`The place${C==="place"?", the cover":""}, open`,onClick:()=>k($),children:o.jsx(tc,{src:Pn($.src,"tile"),srcSet:Jl($.src)})}),o.jsx(Ru,{variant:"tile",label:$.label,isCover:C==="place",onOpen:()=>k($),onUse:R($.hash,"place"),onCover:()=>void P("place"),busy:w})]}),o.jsx(h4,{label:"The place",isCover:C==="place"})]},"place"):null;return o.jsxs(o.Fragment,{children:[o.jsxs(Uw,{count:S.length+($?1:0),label:"Pictures of this place",className:"sc-refset-rail",trackClassName:"sc-refset",children:[!Y&&I,S.map((O,Z)=>{const V=Za[O.role],B=()=>k({src:O.url,label:V,view:O.role,tile:O,...O.hash?{hash:O.hash}:{}});return o.jsxs(s.Fragment,{children:[o.jsxs("li",{children:[O.state==="drawing"?o.jsxs("span",{className:"sc-refset-tile","data-state":"drawing",role:"img","aria-label":`${V}, drawing`,children:[O.url&&o.jsx(tc,{src:Pn(O.url,"tile"),srcSet:Jl(O.url)}),o.jsx("span",{className:"sc-shimmer","aria-hidden":!0})]}):O.state==="failed"?o.jsxs("span",{className:"sc-refset-tile","data-state":"failed",role:"img","aria-label":`${V} did not draw`,title:O.error?hm(O.error)??O.error:void 0,children:[o.jsx(xc,{size:20,"aria-hidden":!0}),o.jsx("span",{children:"Did not draw"})]}):o.jsxs("span",{className:"sc-sceneview-frame","data-cover":C===O.role||void 0,children:[o.jsx("button",{type:"button",className:"sc-refset-tile","aria-label":`${V}${C===O.role?", the cover":""}, open`,onClick:B,children:o.jsx(tc,{src:Pn(O.url,"tile"),srcSet:Jl(O.url)})}),o.jsx(Ru,{variant:"tile",label:V,isCover:C===O.role,onOpen:B,onUse:R(O.hash,O.role),onCover:()=>void P(O.role),busy:w})]}),o.jsx(h4,{label:V,isCover:C===O.role})]}),Y&&Z===0&&I]},O.role)})]}),U&&o.jsx("p",{className:"sc-scenepage-examples-state","aria-live":"polite",children:U}),A,y&&o.jsx(ad,{src:y.src,kind:"scene",label:y.label,noun:t.name,onClose:()=>k(null),actions:q&&_?o.jsxs(o.Fragment,{children:[H(y),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",disabled:h,onClick:()=>void T(q.id),children:"Shoot it this way"})]}):H(y)})]})}const Q5=["hero","place","close","hands","angle","bold"];function vae(){var ne,Fe,Oe,ot,Xe;const{sceneId:e}=Qs(),{scenes:t,loaded:n,error:r,refetch:a,applyBrand:i,refreshBrands:l}=Hn(),{brand:u}=dn(),f=t,h=_n(),p=Rm(),g=u.id,[v,w]=s.useState([]),[b,y]=s.useState([]),[k,S]=s.useState(!1),[E,j]=s.useState(null),N=X=>h(Ir(u,X)),A=G0(u,e??""),T=A??f.find(X=>X.id===e);$c(T==null?void 0:T.name);const P=!!A;s.useEffect(()=>{let X=!0;if(w([]),y([]),!P)return je.sceneFrames(e??"").then(J=>{X&&(w(J.frames),y(J.views??[]))}).catch(()=>{X&&w([])}),()=>{X=!1}},[e,P]);const C=_w(u.id,[e??""]),R=s.useMemo(()=>{if(!T||P)return[];return f.filter(ge=>ge.id!==T.id).sort((ge,ve)=>J(ve)-J(ge)).slice(0,8);function J(ge){const ve=ge.lighting.split(/[ ,]+/).some(Ye=>Ye.length>3&&T.lighting.toLowerCase().includes(Ye.toLowerCase())),Ze=ge.collections.some(Ye=>T.collections.includes(Ye));return(ve?2:0)+(Ze?1:0)}},[f,T,P]),$=s.useMemo(()=>{if(T||!n||r)return[];const X=ui(g);return CR(f,J=>X.includes(J.id)).slice(0,6)},[T,n,r,f,g]),[H,D]=s.useState(null),[q,_]=s.useState(!1),[U,Y]=s.useState(!1),[I,F]=s.useState(!1),O=s.useRef(!1),Z=Im(),V=s.useMemo(()=>[...new Set([...f.flatMap(X=>X.verticals),...Dc(u).flatMap(X=>X.verticals)])].sort((X,J)=>X.localeCompare(J)),[f,u]),B=async X=>{if(A){Y(!0),D(null);try{const J=await je.updateScene(u.id,A.id,{name:X.name,verticals:X.categories,...X.ways?{setups:X.ways}:{}});i(J.brand),F(!1)}catch(J){D(String(J.message??J))}finally{Y(!1)}}},K=async()=>{if(!A||O.current)return;O.current=!0;const X=Z(),J=qi(u);_(!0);try{const ge=await je.deleteScene(u.id,A.id);i(ge.brand)}catch(ge){if((ge==null?void 0:ge.status)!==404){O.current=!1,X()&&(D(String(ge.message??ge)),_(!1));return}await l()}X()&&h(J,{replace:!0})};if(!n&&!A)return o.jsx(gs,{children:o.jsx("main",{className:"sc-lookpage sc-scenepage",id:"main",children:o.jsx("div",{className:"sc-tplrow","aria-hidden":!0})})});if(r&&!A)return o.jsx(gs,{children:o.jsxs("main",{className:"sc-lookpage sc-scenepage",id:"main",children:[o.jsx("h1",{children:"Couldn't load this scene"}),o.jsx("p",{className:"sc-lookpage-lede",children:"Something went wrong reaching the catalog."}),o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>a(),children:"Retry"})})]})});if(!T)return o.jsx(gs,{children:o.jsxs("main",{className:"sc-lookpage sc-scenepage",id:"main",children:[o.jsx("h1",{children:"This scene isn't here anymore"}),o.jsx("p",{className:"sc-lookpage-lede",children:"It may have been removed from the catalog, or the link is out of date."}),o.jsxs("div",{className:"sc-lookpage-acts",children:[o.jsx(Bn,{className:"sc-btn sc-btn-primary",to:`${yr(u)}?compose=1`,children:"Start from scratch"}),o.jsx(Bn,{className:"sc-btn sc-btn-ghost",to:qi(u),children:"Browse all scenes"})]}),$.length>0&&o.jsx(Uu,{label:"You might like",children:$.map(X=>o.jsx(ef,{scene:X,variant:"navigate",size:"slider",onOpen:N,href:Ir(u,X.id)},X.id))})]})});const ee=b.length?[...b].sort((X,J)=>Q5.indexOf(X.view)-Q5.indexOf(J.view)).map(X=>({src:X.url,label:X.view==="place"?"The place":Za[X.view],view:X.view})):v.length?v.map((X,J)=>({src:X,label:`Example ${J+1}`})):T.previewUrl?[{src:T.previewUrl,label:T.cover&&T.cover!=="place"?Za[T.cover]:"The place"}]:[],se=async X=>{if(k)return;const J=Z();S(!0),D(null);try{const{hash:ge}=await je.pickSceneView(T.id,X);if(!J())return;p(T.id,void 0,ge,X)}catch(ge){D(String((ge==null?void 0:ge.message)??ge))}finally{S(!1)}},oe=(A==null?void 0:A.setups)??[],me=((A==null?void 0:A.refs)??[]).filter(X=>X!==(A==null?void 0:A.placeUrl)),ce=((Fe=(ne=A==null?void 0:A.examples)==null?void 0:ne.find(X=>!X.earlier))==null?void 0:Fe.with)??((ot=(Oe=A==null?void 0:A.examples)==null?void 0:Oe[0])==null?void 0:ot.with),we=!!A&&(A.anchor===!0||!!(A.figure&&A.figureTreatment)),G=A!=null&&A.previewHash||(Xe=A==null?void 0:A.examples)!=null&&Xe.length?" Use a view to shoot like it.":"",ue=A?A.figure&&we?`The person in it is a stand-in: with a presenter attached, the picture goes with the shot and they take the role.${G}`:we?`${ce?`Shown in use with a Scenri demo ${ce}. `:""}Shots are given its picture as their world and find their own frame in it.${G}`:ce?`Shown in use with a Scenri demo ${ce}. Shots are told the words.${G}`:A.placeUrl?`Shots are told the words.${G}`:"":"",Ne=A?fae({refs:me,setups:A.setups},ue):"";return o.jsx(gs,{children:o.jsxs("main",{className:"sc-lookpage sc-scenepage",id:"main",children:[o.jsx(Vw,{to:qi(u),wall:"Scenes",where:A?"Yours":"Scenri library"}),o.jsx("h1",{children:T.name}),T.verticals.length>0&&o.jsx("ul",{className:"sc-lookpage-cats","aria-label":"Filed under",children:T.verticals.map(X=>o.jsx("li",{className:"sc-chip","data-static":!0,children:X},X))}),o.jsx("p",{className:"sc-lookpage-lede",children:T.description}),o.jsxs("div",{className:"sc-lookpage-acts",children:[oe.length>0?o.jsxs("span",{className:"sc-splitbtn",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary sc-splitbtn-go",onClick:()=>void p(T.id),children:"Use in a shot"}),o.jsxs(ws,{children:[o.jsx(ys,{children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary sc-splitbtn-more","aria-label":"Use it a way",children:o.jsx(nl,{size:12,weight:"bold","aria-hidden":!0})})}),o.jsx(bs,{children:oe.map(X=>o.jsx(Yn,{onSelect:()=>void p(T.id,X.id),children:X.label},X.id))})]})]}):o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>void p(T.id),children:"Use in a shot"}),A&&o.jsx(Bn,{className:"sc-btn sc-btn-ghost",to:_v(u,A.id),children:"Edit scene"}),o.jsx(Zw,{kind:"scene",brandId:g,id:T.id}),A&&o.jsx(lr,{label:"Edit name, filing and ways",children:o.jsx("button",{type:"button",className:"sc-icon-btn","aria-label":"Edit name, filing and ways","aria-haspopup":"dialog",onClick:()=>F(!0),children:o.jsx(id,{size:17})})})]}),H&&o.jsx("p",{className:"sc-assetform-err",children:H}),A?o.jsx(gae,{brandId:u.id,scene:A,onError:D},A.id):ee.length>1?o.jsx(Uw,{count:ee.length,label:"Pictures of this place",className:"sc-refset-rail",trackClassName:"sc-refset",children:ee.map(X=>o.jsxs("li",{children:[o.jsxs("span",{className:"sc-sceneview-frame",children:[o.jsx("button",{type:"button",className:"sc-refset-tile","aria-label":`${X.label}, open`,onClick:()=>j(X),children:o.jsx(tc,{src:Pn(X.src,"tile"),srcSet:Jl(X.src)})}),X.view&&o.jsx(Ru,{variant:"tile",label:X.label,isCover:!1,onOpen:()=>j(X),onUse:()=>void se(X.view),busy:k})]}),o.jsx(h4,{label:X.label,isCover:!1})]},X.src))}):ee.length===1?o.jsx("div",{className:"sc-scenepage-place",children:o.jsx("button",{type:"button",className:"sc-scenepage-open","aria-label":`${ee[0].label}, open`,onClick:()=>j(ee[0]),children:o.jsx(tc,{src:Pn(ee[0].src,"tile"),srcSet:Jl(ee[0].src)})})}):o.jsx(zw,{}),A&&o.jsxs("section",{className:"sc-scenepage-told",children:[o.jsxs("dl",{className:"sc-lookpage-told",children:[o.jsxs("div",{children:[o.jsx("dt",{children:be.lightLabel}),o.jsx("dd",{dir:"auto",children:A.lighting})]}),A.camera&&o.jsxs("div",{children:[o.jsx("dt",{children:be.cameraLabel}),o.jsx("dd",{dir:"auto",children:A.camera})]}),A.figure&&o.jsxs("div",{children:[o.jsx("dt",{children:be.figureLabel}),o.jsx("dd",{dir:"auto",children:A.figure})]})]}),o.jsx("p",{className:"sc-lookpage-note",children:"Every shot made here is told this. Anything you write in the shot wins."})]}),me.length>0&&o.jsxs("section",{className:"sc-presenterpage-sources",children:[o.jsx("p",{className:"sc-presenterpage-sources-lb",children:"What it was read from"}),o.jsx("div",{className:"sc-presenterpage-sources-row",children:me.map((X,J)=>o.jsx("button",{type:"button",className:"sc-presenterpage-source","aria-label":`Source photo ${J+1}, open`,onClick:()=>j({src:X,label:`Source photo ${J+1}`}),children:o.jsx(tc,{src:Pn(X,"micro")})},X))})]}),A&&o.jsxs("div",{className:"sc-prec",children:[Ne&&o.jsx("p",{className:"sc-prec-note",children:Ne}),o.jsx(qn,{label:"Delete scene",title:`Delete ${A.name}?`,body:di("owned-scene",1),busy:q,onConfirm:()=>void K()})]}),C.length>0&&o.jsx(Uu,{label:`Shots made in ${T.name}`,children:C.map(X=>o.jsx(Bw,{node:X,to:cm(u,null,X.id)},X.id))}),R.length>0&&o.jsx(Uu,{label:"Other scenes, similar light",children:R.map(X=>o.jsx(ef,{scene:X,variant:"navigate",size:"slider",onOpen:N,href:Ir(u,X.id)},X.id))}),I&&A&&o.jsx(qR,{name:A.name,categories:A.verticals,known:V,hint:"The verticals this place suits, so it surfaces where you work.",ways:oe,wayChoices:f4,wayMax:YR,busy:U,error:H,onSave:X=>void B(X),onDismiss:()=>F(!1)}),E&&o.jsx(ad,{src:E.src,kind:"scene",label:E.label,noun:T.name,onClose:()=>j(null),actions:E.view?o.jsx(Ru,{variant:"sheet",label:E.label,isCover:!1,onUse:()=>void se(E.view),busy:k}):void 0})]})})}function wae({draft:e,href:t,onDiscard:n,chosen:r,batching:a,onPick:i,batch:l}){return o.jsx(KR,{id:e.id,name:e.name.trim()||"Untitled presenter",hash:e.hash,drawing:!!e.drawing,state:yae(e),href:t,blank:o.jsx(YO,{size:44,weight:"thin"}),onDiscard:n,chosen:r,batching:a,onPick:i,batch:l})}function yae(e){return e.drawing?"Drawing":e.approved?e.approved===1?"Face ready":e.approved>=e.of?"Ready to save":`${e.approved} of ${e.of} views ready`:e.hash?"A face to decide":e.source==="photos"?"Photos added":"Not drawn yet"}function bae({suggested:e,busy:t,error:n,onConfirm:r,onDismiss:a}){const[i,l]=s.useState(e),u=s.useRef(null),f=s.useRef(!1),h=i.trim(),p=h.length>0;s.useEffect(()=>{f.current=!1},[e]),s.useEffect(()=>{t||(f.current=!1)},[t]);const g=()=>{!p||t||f.current||(f.current=!0,r(h))};return o.jsxs(_s,{className:"sc-newdlg sc-pdetails",maxWidth:"min(420px, 94vw)",onDismiss:a,onOpenAutoFocus:v=>{v.preventDefault();const w=u.current;w&&(w.focus(),w.select())},children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ks,{className:"sc-newdlg-title",children:"Duplicate presenter"}),o.jsx(Ss,{asChild:!0,children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx("span",{"aria-hidden":!0,children:"×"})})})]}),o.jsxs("div",{className:"sc-newdlg-body",children:[o.jsxs("label",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Name"}),o.jsx("input",{ref:u,className:"sc-pdetails-field",value:i,dir:"auto",maxLength:60,onChange:v=>l(v.target.value),onKeyDown:v=>v.key==="Enter"&&g()})]}),n&&o.jsx("p",{className:"sc-assetform-err",children:n})]}),o.jsxs("div",{className:"sc-newdlg-foot",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:a,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:!p||t,"data-busy":t||void 0,onClick:g,children:t?"Duplicating":"Duplicate"})]})]})}const xae=60;function kae(e,t,n=xae){var l;const r=e.trim(),a=(((l=r.match(/^(.*?)(?: copy(?: \d+)?)?$/i))==null?void 0:l[1])??r).trim()||r,i=new Set(t.map(u=>u.trim().toLowerCase()).filter(Boolean));for(let u=1;u<1e4;u++){const f=u===1?" copy":` copy ${u}`,h=Math.max(1,n-f.length),p=`${a.slice(0,h).trimEnd()}${f}`;if(!i.has(p.toLowerCase()))return p}return`${a.slice(0,Math.max(1,n-5)).trimEnd()} copy`}const Sae=8,R8="__bookmarked";function Eae(){const{presenters:e,presenterCategories:t,presentersLoaded:n,presentersError:r,refetchPresenters:a,applyBrand:i,refreshBrands:l}=Hn(),{brand:u}=dn(),f=_n(),h=Sw(),{push:p}=cr(),{q:g,setQ:v,facets:w,setFacets:b,clearSearch:y,clear:k}=Bf(["category","bookmarked"]),S=w.category,E=w.bookmarked==="1",[j,N]=s.useState(()=>rd("presenter",u.id)),A=Q=>N(Pm("presenter",u.id,Q)),T=Iw(`${u.id}|${g}|${S??""}|${E?"1":""}`),P=wl(),C=s.useMemo(()=>Hf(u),[u]),[R,$]=ba(Kr.wallDensity,ed),H=Hc(R),D=Q=>$(Q),q=ym(H),_=vm(H),U=Q=>f(xa(u,Q)),Y=Q=>f(lm(u,Q)),I=s.useMemo(()=>S?e.filter(Q=>Q.suitableCategories.includes(S)):e,[e,S]),F=s.useMemo(()=>I.filter(Q=>jo(fp(Q),g)),[I,g]),O=s.useRef(null),Z=s.useRef(null),V=o.jsxs("button",{ref:Z,type:"button",className:"sc-btn sc-btn-primary",onClick:()=>P("presenter"),children:[o.jsx(fr,{size:12})," Create presenter"]}),[B,K]=s.useState([]),ee=s.useRef(0),se=s.useCallback(()=>{const Q=++ee.current;return je.presenterDrafts(u.id).then(Pe=>{Q===ee.current&&K(Pe.drafts.filter(Ke=>!Ke.presenterId))}).catch(()=>{}),()=>{Q===ee.current&&ee.current++}},[u.id]),oe=!!gn({path:pt.presenterStudio}),{tasks:me}=Ca(),ce=me.filter(Q=>Q.id.startsWith("presenter:")).map(Q=>`${Q.id}:${Q.state}:${Q.percent??""}`).join("|");s.useEffect(()=>{if(!oe)return se()},[oe,se,ce]);const we=s.useCallback(Q=>{const Pe=Math.max(0,B.findIndex(Ke=>Ke.id===Q));G.current=Pe,T.forget(Q),K(Ke=>Ke.filter(xt=>xt.id!==Q)),je.deletePresenterDraft(u.id,Q).finally(()=>se())},[u.id,B,se,T.forget]),G=s.useRef(null);s.useEffect(()=>{var xt;const Q=G.current;if(Q===null)return;G.current=null;const Pe=(xt=O.current)==null?void 0:xt.querySelectorAll("[data-build] .sc-cardpuck"),Ke=Pe!=null&&Pe.length?Pe[Math.min(Q,Pe.length-1)]:Z.current??document.querySelector(".sc-new-go");Ke==null||Ke.focus()},[B]);const[ue,Ne]=s.useState(null),[ne,Fe]=s.useState(!1),[Oe,ot]=s.useState(!1),Xe=s.useCallback(Q=>{const Pe=B.find(Ke=>Ke.id===Q);Pe!=null&&Pe.drawn?Ne(Pe):we(Q)},[B,we]),[X,J]=s.useState(null),[ge,ve]=s.useState(null),[Ze,Ye]=s.useState(null),[ke,te]=s.useState(!1),[le,Me]=s.useState(null),[ze,Re]=s.useState(null),Be=s.useCallback(Q=>{const Pe=C.find(Ke=>Ke.id===Q);Pe&&(Me(null),J(Pe))},[C]),Qe=s.useCallback(Q=>{const Pe=C.find(Ke=>Ke.id===Q);Pe&&(Me(null),ve(Pe))},[C]),rt=async Q=>{if(!(!ge||ke)){te(!0),Me(null);try{i((await je.updatePresenter(u.id,ge.id,{name:Q})).brand),ve(null)}catch(Pe){const Ke=ln(Pe,"Could not rename this presenter");Me([Ke.title,Ke.detail].filter(Boolean).join(" "))}finally{te(!1)}}},_e=s.useCallback(Q=>{const Pe=C.find(Ke=>Ke.id===Q);Pe&&Ye(Pe)},[C]),zt=s.useRef(null);s.useEffect(()=>{var xt;const Q=zt.current;if(Q===null)return;zt.current=null;const Pe=(xt=O.current)==null?void 0:xt.querySelectorAll(".sc-lookcard:not([data-build]) .sc-lookcard-more"),Ke=Pe!=null&&Pe.length?Pe[Math.min(Q,Pe.length-1)]:Z.current??document.querySelector(".sc-new-go");Ke==null||Ke.focus()},[e,u]);const Et=async Q=>{if(!(!X||ke)){te(!0),Me(null);try{const Pe=await je.duplicatePresenter(u.id,X.id,Q);i(Pe.brand),J(null),Re(Pe.presenter.id)}catch(Pe){const Ke=ln(Pe,"Could not duplicate this presenter");Me([Ke.title,Ke.detail].filter(Boolean).join(" "))}finally{te(!1)}}},Zt=async()=>{if(!(!Ze||ke)){zt.current=Math.max(0,He.findIndex(Q=>Q.id===Ze.id)),te(!0);try{const Q=await je.deletePresenter(u.id,Ze.id);i(Q.brand),T.forget(Ze.id),Ye(null)}catch(Q){(Q==null?void 0:Q.status)===404?(await l(),T.forget(Ze.id),Ye(null)):p(ln(Q,"Could not delete this presenter"))}finally{te(!1)}}};s.useEffect(()=>{var Pe,Ke;if(!ze)return;(Ke=(Pe=O.current)==null?void 0:Pe.querySelector(".sc-lookcard[data-just-added]"))==null||Ke.scrollIntoView({block:"nearest"});const Q=window.setTimeout(()=>Re(null),1800);return()=>window.clearTimeout(Q)},[ze]);const He=s.useMemo(()=>C.filter(Q=>S?!Q.suitableCategories.length||Q.suitableCategories.includes(S):!0).filter(Q=>jo(fp(Q),g)).filter(Q=>E?j.includes(Q.id):!0),[C,S,g,E,j]),vt=!(C.length>0||B.length>0),St=[...C,...e].reduce((Q,Pe)=>Q+(j.includes(Pe.id)?1:0),0),kt=E&&St===0,Nt=kt&&vt,Bt=kt&&!vt,at=!E||Nt,Mt=He.filter(Q=>!E||Nt||j.includes(Q.id)),ft=at&&B.length>0||Mt.length>0,{visible:vn,remaining:Qt,showMore:on}=tf(Mt,`${u.id}|${S??""}|${E?"keepers":""}|${Nt?"browse":""}|${g}`),[Rt,An]=s.useState(null);s.useEffect(()=>{if(!Rt||Qt<=0)return;const Q=new IntersectionObserver(Pe=>{Pe.some(Ke=>Ke.isIntersecting)&&on()},{root:Rt.closest(".sc-home"),rootMargin:"200% 0px"});return Q.observe(Rt),()=>Q.disconnect()},[Rt,Qt,on]);const Vt=s.useMemo(()=>!E||Nt?F:F.filter(Q=>j.includes(Q.id)),[F,E,Nt,j]),{visible:re,remaining:ae,showMore:fe}=tf(Vt,`${S??""}|${E?"keepers":""}|${Nt?"browse":""}|${g}`),Te=e.length+C.length>0?"tabs":"none",Ue=s.useCallback(async Q=>{const{failed:Pe,error:Ke}=await wp(Q,xt=>je.deletePresenterDraft(u.id,xt));K(xt=>xt.filter(st=>Pe.includes(st.id)||!Q.includes(st.id))),T.retain(Pe),se(),Ke&&p(ln(Ke,"Could not discard these drafts"))},[u.id,se,T.retain,p]),ut=()=>{const Q=B.filter(Pe=>T.ids.has(Pe.id));Q.some(Pe=>Pe.drawn)?Q.length===1?Ne(Q[0]):Fe(!0):Ue(Q.map(Pe=>Pe.id))},gt=()=>{const Q=[...T.ids];Q.length===1?_e(Q[0]):ot(!0)},Pt=[...T.ids],tt=T.kind==="presenter"&&Pt.length>0&&Pt.every(Q=>j.includes(Q)),wt=()=>N(Ew("presenter",u.id,Pt,!tt)),Ce=$m(T.ids.size,tt,"presenters"),xe=async()=>{if(ke)return;const Q=[...T.ids];te(!0);try{const{failed:Pe,error:Ke}=await wp(Q,xt=>je.deletePresenter(u.id,xt));await l(),T.retain(Pe),ot(!1),Ke&&p(ln(Ke,"Could not delete these presenters"))}finally{te(!1)}},et={key:"category",label:"Category",everyLabel:"All presenters",everyCount:e.length+C.length,selected:E?R8:S,onSelect:Q=>b(Q===R8?{bookmarked:"1",category:null}:{bookmarked:null,category:Q}),options:[{value:R8,label:"Keepers",count:St},...t.map(Q=>({value:Q,label:Q,count:[...C,...e].filter(Pe=>!Pe.suitableCategories.length||Pe.suitableCategories.includes(Q)).length}))]},yt=o.jsx(Dm,{title:"Presenters",filters:o.jsx(Hm,{mode:Te,group:et}),density:o.jsx(wm,{value:H,onChange:D}),search:e.length>=Sae&&o.jsx(xd,{value:g,onChange:v,noun:"presenters",total:e.length})});return o.jsxs(Of.Provider,{value:_,children:[o.jsx(gs,{children:o.jsxs("main",{className:"sc-looks sc-presenters",id:"main","data-hero":vt||void 0,onClick:T.onBlank,children:[!vt&&yt,ft&&o.jsxs("section",{className:"sc-owned",children:[o.jsx("div",{className:"sc-sec-head",children:o.jsx("h2",{className:"sc-sec-title",children:"Your presenters"})}),o.jsxs("div",{ref:O,className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":_,style:q,children:[at&&B.map(Q=>o.jsx(wae,{draft:Q,href:Qi(u,Q.id),onDiscard:Xe,chosen:T.ids.has(Q.id),batching:T.batching==="draft",onPick:T.picking("draft")?Pe=>T.toggle("draft",Pe):void 0,batch:T.kind==="draft"&&T.ids.has(Q.id)?{count:T.ids.size,onAct:ut}:null},Q.id)),ue&&o.jsx(qn,{label:"Discard",title:`Discard ${ue.name.trim()||"this unfinished presenter"}?`,body:"The views drawn so far are thrown away. Nothing was saved to the library.",open:!0,busy:!1,onOpenChange:Q=>{Q||Ne(null)},onConfirm:()=>{we(ue.id),Ne(null)}}),vn.map(Q=>o.jsx(d4,{presenter:Q,variant:"use",size:"grid",onOpen:U,href:xa(u,Q.id),onUse:h,onDuplicate:Be,onEdit:Y,onDelete:_e,onRename:Qe,bookmarked:j.includes(Q.id),onBookmark:A,fresh:Q.id===ze,chosen:T.ids.has(Q.id),batching:T.batching==="presenter",onPick:T.picking("presenter")?Pe=>T.toggle("presenter",Pe):void 0,batch:T.kind==="presenter"&&T.ids.has(Q.id)?{count:T.ids.size,onAct:gt,onKeep:wt,allKept:tt}:null},Q.id)),ge&&o.jsx(Hw,{title:"Rename presenter",name:ge.name,maxLength:60,busy:ke,error:le,onConfirm:Q=>void rt(Q),onDismiss:()=>{ke||ve(null)}}),X&&o.jsx(bae,{suggested:kae(X.name,C.map(Q=>Q.name)),busy:ke,error:le,onConfirm:Q=>void Et(Q),onDismiss:()=>{ke||J(null)}}),Ze&&o.jsx(qn,{label:"Delete presenter",title:`Delete ${Ze.name}?`,body:di("presenter",1),open:!0,busy:ke,onOpenChange:Q=>{!Q&&!ke&&Ye(null)},onConfirm:()=>void Zt()}),Oe&&o.jsx(qn,{label:as("presenter",T.ids.size).menu,title:`${as("presenter",T.ids.size).menu}?`,body:di("presenter",T.ids.size),open:!0,busy:ke,onOpenChange:Q=>{!Q&&!ke&&ot(!1)},onConfirm:()=>void xe()}),ne&&o.jsx(qn,{label:as("draft",T.ids.size).menu,title:`${as("draft",T.ids.size).menu}?`,body:"The views drawn so far are thrown away. Nothing was saved to the library.",open:!0,busy:!1,onOpenChange:Q=>{Q||Fe(!1)},onConfirm:()=>{const Q=[...T.ids];Fe(!1),Ue(Q)}})]}),Qt>0&&o.jsx("div",{ref:An,"aria-hidden":!0}),Qt>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:on,children:["Show ",Math.min(Qt,60)," more"]})})]}),vt&&n&&!r&&e.length>0&&o.jsx(wo,{shape:"cold",title:o.jsxs(o.Fragment,{children:["Cast your own ",o.jsx("em",{children:"presenter"})]}),body:"Describe someone new, or add photos of a real person. They stay the same person in every image you make.",action:V}),ft&&n&&!r&&re.length>0&&o.jsx("div",{className:"sc-sec-head sc-owned-divider",children:o.jsx("h2",{className:"sc-sec-title",children:"Scenri presenters"})}),!n&&o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":_,style:q,"aria-hidden":!0,children:o.jsx(BR,{size:"grid",count:8})}),n&&r&&o.jsx(wo,{shape:"error",title:"Couldn't load the presenter library",body:"Something went wrong reaching the catalog.",onRetry:()=>a()}),vt&&n&&!r&&e.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(Fw,{label:"Or cast someone from ours"}),yt]}),n&&!r&&re.length>0&&o.jsx("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":_,style:q,children:re.map(Q=>o.jsx(d4,{presenter:Q,variant:"use",size:"grid",onOpen:U,href:xa(u,Q.id),onUse:h,bookmarked:j.includes(Q.id),onBookmark:A},Q.id))}),n&&!r&&Bt&&o.jsx(wo,{shape:"zero",title:"Nothing in Keepers yet",body:"Keep a presenter from its card and it stays here.",mark:Dw,action:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>b({bookmarked:null}),children:"Browse every presenter"})}),n&&!r&&!Bt&&!Vt.length&&e.length>0&&o.jsx(Om,{noun:"presenters",q:g,facet:E?"Keepers":S,onClearSearch:y,onClearAll:k}),n&&!r&&!e.length&&o.jsx(wo,{shape:"zero",body:"The presenter library is still being cast. Check back soon."}),ae>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:fe,children:["Show ",Math.min(ae,60)," more"]})})]})}),T.ids.size>0&&(T.kind==="draft"||T.kind==="presenter")&&o.jsx("div",{className:"sc-wall-dock",children:o.jsx(Ow,{count:T.ids.size,loaded:T.kind==="draft"?B.length:vn.length,tool:as(T.kind,T.ids.size).tool,icon:as(T.kind,T.ids.size).icon,danger:as(T.kind,T.ids.size).danger,onAct:T.kind==="draft"?ut:gt,keep:T.kind==="presenter"?{label:Ce.tool,filled:tt,onAct:wt}:null,onClear:T.clear,onSelectAll:()=>T.selectAll(T.kind==="draft"?"draft":"presenter",(T.kind==="draft"?B:vn).map(Q=>Q.id))})}),o.jsx(bc,{})]})}const J5={portrait:"Face",identity:"Face",front:"Full body","three-quarter":"Three-quarter",back:"Back",left:"Left",right:"Right","left-profile":"Left","right-profile":"Right"};function Cae(){var ee;const{presenterId:e=""}=Qs(),{presenters:t,presentersLoaded:n,presentersError:r,refetchPresenters:a,applyBrand:i,refreshBrands:l,presenterCategories:u}=Hn(),{brand:f}=dn(),h=_n(),p=Im(),g=s.useRef(!1),v=Sw(),[w,b]=s.useState([]),[y,k]=s.useState(null),[S,E]=s.useState(null),j=OY(f,e),N=j??t.find(se=>se.id===e);$c(N==null?void 0:N.name);const A=!!j;s.useEffect(()=>{let se=!0;if(b([]),!A)return je.presenterFrames(e).then(oe=>{se&&b(oe.frames)}).catch(()=>{se&&b([])}),()=>{se=!1}},[e,A]);const T=!!gn({path:pt.presenterEdit});s.useEffect(()=>{let se=!0;if(E(null),!(!A||T))return je.presenterDrafts(f.id).then(oe=>{if(!se)return;const me=oe.drafts.find(ce=>ce.presenterId===e);E((me==null?void 0:me.id)??null)}).catch(()=>{}),()=>{se=!1}},[f.id,e,A,T]);const P=((ee=f.json)==null?void 0:ee.characters)??[],C=P.find(se=>se.presenterId===e),R=P.find(se=>se.id===e),$=_w(f.id,[e??"",(C==null?void 0:C.id)??""]),[H,D]=s.useState(null),[q,_]=s.useState(!1),[U,Y]=s.useState(!1),I=async se=>{if(j){_(!0),D(null);try{const oe=await je.updatePresenter(f.id,j.id,se);i(oe.brand),Y(!1)}catch(oe){D(String(oe.message??oe))}finally{_(!1)}}},F=async()=>{if(!j||g.current)return;g.current=!0;const se=p(),oe=Xo(f);_(!0);try{const me=await je.deletePresenter(f.id,j.id);i(me.brand)}catch(me){if((me==null?void 0:me.status)!==404){g.current=!1,se()&&(D(String(me.message??me)),_(!1));return}await l()}se()&&h(oe,{replace:!0})},O=Qv(f,e);if(O!==e)return o.jsx(Ba,{to:xa(f,O),replace:!0});if(!n&&!j)return o.jsx(gs,{children:o.jsx("main",{className:"sc-lookpage",id:"main",children:o.jsx("div",{className:"sc-tplrow","aria-hidden":!0})})});if(r&&!j)return o.jsx(gs,{children:o.jsxs("main",{className:"sc-lookpage",id:"main",children:[o.jsx("h1",{children:"Couldn't load this presenter"}),o.jsx("p",{className:"sc-lookpage-lede",children:"Something went wrong reaching the catalog."}),o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>a(),children:"Retry"})})]})});if(!N)return o.jsx(gs,{children:o.jsxs("main",{className:"sc-lookpage",id:"main",children:[o.jsx("h1",{children:"This presenter isn't here anymore"}),o.jsx("p",{className:"sc-lookpage-lede",children:"They may have been removed from the catalog, or the link is out of date."}),o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx(Bn,{className:"sc-btn sc-btn-primary",to:Xo(f),children:"Browse presenters"})})]})});const Z=j?(Array.isArray(R==null?void 0:R.shots)?R.shots:[]).map((se,oe)=>({src:qr(se==null?void 0:se.file),label:J5[(se==null?void 0:se.angle)??""]??`Reference ${oe+1}`,angle:typeof(se==null?void 0:se.angle)=="string"?se.angle:void 0})).filter(se=>!!se.src):w.length?w.map((se,oe)=>({src:se.url,label:J5[se.angle]??`Reference ${oe+1}`,angle:se.angle})):N.previewUrl?[{src:N.previewUrl,label:"Preview"}]:[],V=lm(f,e),B=ii(j??N),K=[...new Set([...u,...Hf(f).flatMap(se=>se.suitableCategories??[])])].sort((se,oe)=>se.localeCompare(oe));return o.jsx(gs,{children:o.jsxs("main",{className:"sc-lookpage sc-presenterpage",id:"main",children:[o.jsx(Vw,{to:Xo(f),wall:"Presenters",where:j?"Yours":"Scenri library"}),B.src&&o.jsx("div",{className:"sc-presenterpage-avatar",children:o.jsx(P8,{src:Pn(B.src,"small"),crop:B.crop})}),o.jsx("h1",{children:N.name}),N.suitableCategories.length>0&&o.jsx("ul",{className:"sc-lookpage-cats","aria-label":"Filed under",children:N.suitableCategories.map(se=>o.jsx("li",{className:"sc-chip","data-static":!0,children:se},se))}),N.descriptor&&o.jsx("p",{className:"sc-lookpage-lede",children:N.descriptor}),o.jsxs("div",{className:"sc-lookpage-acts",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>v(e),children:"Use in a shot"}),j&&o.jsx(Bn,{className:"sc-btn sc-btn-ghost",to:V,children:S?"Continue editing":"Edit presenter"}),o.jsx(Zw,{kind:"presenter",brandId:f.id,id:e}),j&&o.jsx(lr,{label:"Edit name and details",children:o.jsx("button",{type:"button",className:"sc-icon-btn","aria-label":"Edit name and details","aria-haspopup":"dialog",onClick:()=>Y(!0),children:o.jsx(id,{size:17})})})]}),H&&o.jsx("p",{className:"sc-assetform-err",children:H}),Z.length>0?o.jsx(Uw,{count:Z.length,label:"Reference set",className:"sc-refset-rail",trackClassName:"sc-refset",children:Z.map(se=>o.jsxs("li",{children:[o.jsx("button",{type:"button",className:"sc-refset-tile","data-role":se.angle,"aria-label":`${se.label}, open`,onClick:()=>k(se),children:o.jsx(P8,{src:Pn(se.src,"small")})}),o.jsx("span",{className:"sc-refset-lb","aria-hidden":!0,children:se.label})]},se.label))}):o.jsx(zw,{}),j&&j.sourceRefs.length>0&&o.jsxs("section",{className:"sc-presenterpage-sources",children:[o.jsx("p",{className:"sc-presenterpage-sources-lb",children:"From your photos"}),o.jsx("div",{className:"sc-presenterpage-sources-row",children:j.sourceRefs.map((se,oe)=>o.jsx("button",{type:"button",className:"sc-presenterpage-source","aria-label":`Source photo ${oe+1}, open`,onClick:()=>k({src:se,label:`Source photo ${oe+1}`}),children:o.jsx(P8,{src:Pn(se,"micro")})},se))})]}),j&&o.jsxs("div",{className:"sc-prec",children:[o.jsxs("p",{className:"sc-prec-note",children:[N.ageRange?`${N.ageRange} · `:"",j.source==="synthetic"?"Created in Scenri. Not a real person.":j.source==="photos"?"Built from your photographs.":"Saved in Scenri.",j.likeness?` Likeness confirmed ${new Date(j.likeness.attestedAt).toLocaleDateString()}.`:""]}),o.jsx(qn,{label:"Delete presenter",title:`Delete ${j.name}?`,body:di("presenter",1),busy:q,onConfirm:()=>void F()})]}),$.length>0&&o.jsx(Uu,{label:`Shots featuring ${N.name}`,children:$.map(se=>o.jsx(Bw,{node:se,to:cm(f,null,se.id)},se.id))}),U&&j&&o.jsx(qR,{name:j.name,categories:N.suitableCategories,known:K,hint:"The verticals they suit, so they surface where you work.",busy:q,error:H,onSave:se=>void I({name:se.name,suitableCategories:se.categories}),onDismiss:()=>Y(!1)}),y&&o.jsx(ad,{src:y.src,kind:"presenter",label:y.label,noun:N.name,onClose:()=>k(null)})]})})}function P8({src:e,crop:t}){const[n,r]=s.useState(!1);return n?o.jsx("span",{className:"sc-lookpage-ref-blank","aria-hidden":!0,children:o.jsx(Js,{size:20})}):o.jsx("img",{src:e,alt:"",loading:"lazy",decoding:"async",...t?{"data-crop":t}:{},onError:()=>r(!0)})}function jae({placeholder:e,label:t,action:n="Send",scope:r,hint:a,value:i,onValue:l,allowEmpty:u,disabled:f,why:h,quiet:p,working:g,error:v,focusKey:w,onStop:b,stopping:y,onAttach:k,onAttachFiles:S,attachLabel:E,colour:j,refs:N,onSend:A}){const T=s.useRef(null),P=s.useRef(null),[C,R]=s.useState(void 0);s.useLayoutEffect(()=>{const V=T.current;if(!V)return;V.style.height="auto";const B=Number.parseFloat(getComputedStyle(V).maxHeight)||Number.POSITIVE_INFINITY;V.style.height=`${Math.min(V.scrollHeight,B)}px`,V.style.overflowY=V.scrollHeight>B?"auto":"hidden"},[i]);const[$,H]=s.useState(!1),D=Sr(ta);s.useEffect(()=>{if(!w||w===C||f||(R(w),D))return;const V=T.current;if(V==null||V.focus({preventScroll:!0}),V!=null&&V.value){V.select(),H(!0);const B=setTimeout(()=>H(!1),700);return()=>clearTimeout(B)}},[w,C,f,D]);const q=f||g,_=!!(j!=null&&j.hex)||!!(N!=null&&N.some(V=>!V.busy)),U=!i.trim()&&!u&&!_,Y=()=>{q||U||A(i)},I=v?{text:v,tone:"alert"}:{text:(r==null?void 0:r.hint)??a??"",tone:r==null?void 0:r.tone},F=!!b&&(g||!i.trim()&&!_),O=g||F?null:f&&h?h:U&&!f?"Nothing typed yet.":null,Z=o.jsxs("button",{type:"button",className:"sc-convo-send","aria-disabled":(F?!!y:g||q||U)||void 0,"aria-busy":g||F||void 0,"data-stop":F||void 0,onClick:F?y?void 0:b:g?void 0:Y,children:[o.jsx("span",{className:"sc-convo-send-ico",children:g||F?o.jsx("span",{className:"sc-convo-spin","aria-hidden":"true"}):o.jsx(KE,{size:17,weight:"bold"})}),F?y?"Stopping":"Stop":g?"Working":n]});return o.jsxs("div",{className:"sc-convo-composer",children:[o.jsxs("div",{className:"sc-convo-card","data-quiet":p||void 0,"data-flash":$||void 0,children:[(r==null?void 0:r.chip)&&o.jsx("div",{className:"sc-convo-scope-row",children:o.jsxs("span",{className:"sc-convo-scope",children:[r.chip.thumb?o.jsx("img",{src:r.chip.thumb,alt:""}):null,r.chip.label]})}),o.jsxs("div",{className:"sc-convo-field",children:[N==null?void 0:N.map(V=>o.jsxs("span",{className:"sc-token","data-kind":"image","data-busy":V.busy||void 0,dir:"ltr",children:[o.jsx("img",{src:V.src,alt:""}),o.jsx("span",{className:"sc-token-label",children:V.label}),o.jsx("button",{type:"button",className:"sc-convo-chip-x","aria-label":`Remove ${V.label}`,onClick:V.onRemove,children:o.jsx(Mn,{size:11,weight:"bold"})})]},V.key)),j&&o.jsxs("span",{className:"sc-token","data-kind":"color","data-empty":j.hex?void 0:"",dir:"ltr",children:[o.jsxs(td,{className:"sc-convo-chip",triggerStyle:{background:"none"},value:j.hex??j.seed??"#808080",commitMode:"live",align:"start",label:j.hex?`${j.label}. Change the colour.`:"Pick a colour",onChange:j.onPick,children:[o.jsx("span",{className:"sc-token-swatch",style:j.hex?{background:j.hex}:void 0}),o.jsx("span",{className:"sc-token-label",children:j.label})]}),j.hex&&o.jsx("button",{type:"button",className:"sc-convo-chip-x","aria-label":"Remove colour",onClick:j.onClear,children:o.jsx(Mn,{size:11,weight:"bold"})})]}),o.jsx("textarea",{ref:T,className:"sc-in",rows:1,maxLength:400,"aria-label":t,placeholder:j!=null&&j.hex&&!i?"":f&&h?h:e,value:i,disabled:f,onChange:V=>l(V.target.value),onKeyDown:V=>{V.key!=="Enter"||V.shiftKey||(V.preventDefault(),Y())}})]}),o.jsxs("div",{className:"sc-convo-row",children:[(k||S)&&o.jsxs(o.Fragment,{children:[o.jsx(lr,{label:q&&h?h:E??"Add photos",children:o.jsx("button",{type:"button",className:"sc-convo-attach","aria-label":E??"Add photos","aria-disabled":q||void 0,onClick:q?void 0:S?()=>{var V;return(V=P.current)==null?void 0:V.click()}:k,children:o.jsx(fr,{size:16,weight:"bold"})})}),S&&o.jsx("input",{ref:P,type:"file",accept:"image/*",hidden:!0,"aria-label":E??"Add a picture",onChange:V=>{const B=Array.from(V.target.files??[]).filter(K=>K.type.startsWith("image/"));V.target.value="",B.length&&S(B)}})]}),O?o.jsx(lr,{label:O,children:Z}):Z]})]}),I.text?o.jsx("small",{className:"sc-convo-line",role:I.tone==="alert"?"alert":void 0,"data-tone":I.tone,children:I.text}):null]})}function JR({glyph:e,lead:t,hint:n}){return o.jsxs("div",{className:"sc-pstudio-empty",children:[o.jsxs("span",{className:"sc-pstudio-empty-mark","aria-hidden":!0,children:[o.jsx("span",{className:"sc-pstudio-empty-ring","data-at":"far"}),o.jsx("span",{className:"sc-pstudio-empty-ring","data-at":"near"}),e]}),t&&o.jsxs("span",{className:"sc-pstudio-empty-say",children:[o.jsx("span",{children:t}),n&&o.jsx("span",{children:n})]})]})}const eS=500,eP=400,tP=760,hu=e=>Math.min(tP,Math.max(eP,Math.round(e)));function Aae({title:e,headAction:t,stage:n,body:r,bodyProps:a,foot:i,overlay:l,kind:u,resizeLabel:f,onPaste:h,onDropFiles:p,onClose:g}){const v=s.useRef(null),[w,b]=s.useState(null);$w(w,"--sc-pstudio-dock-h"),s.useEffect(()=>{const N=A=>{A.key!=="Escape"||A.defaultPrevented||(A.preventDefault(),g())};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[g]);const[y,k]=ba(Kr.pstudioRailW,eS),S=s.useRef(0),E=s.useRef(0),j=s.useRef(null);return _r.createPortal(o.jsx(cd,{trapped:!0,loop:!0,asChild:!0,onMountAutoFocus:N=>{var A;j.current=document.activeElement instanceof HTMLElement?document.activeElement:null,N.preventDefault(),(A=v.current)==null||A.focus({preventScroll:!0})},onUnmountAutoFocus:N=>{var A,T;(A=j.current)!=null&&A.isConnected||(N.preventDefault(),(T=document.querySelector(".sc-new-go")??document.getElementById("main"))==null||T.focus())},children:o.jsxs("div",{ref:v,tabIndex:-1,className:"sc-pstudio","data-kind":u,style:{"--sc-pstudio-rail-set":`${hu(y)}px`},role:"dialog","aria-modal":"true","aria-labelledby":"sc-pstudio-title",onDragOver:N=>{p&&Array.from(N.dataTransfer.types).includes("Files")&&N.preventDefault()},onDrop:N=>{var T;if(!p||N.defaultPrevented)return;const A=Array.from(((T=N.dataTransfer)==null?void 0:T.files)??[]);A.length&&(N.preventDefault(),p(A))},onPaste:N=>{var T;if(!h)return;const A=Array.from(((T=N.clipboardData)==null?void 0:T.files)??[]).filter(P=>P.type.startsWith("image/"));A.length&&(N.preventDefault(),h(A))},children:[o.jsxs("div",{className:"sc-pstudio-grid",children:[o.jsx(lr,{label:"Close (esc)",children:o.jsx("button",{type:"button",className:"sc-pstudio-close",onClick:g,"aria-label":"Close",children:o.jsx(Mn,{size:13})})}),o.jsxs("div",{className:"sc-pstudio-head sc-newdlg-head",children:[o.jsx("h2",{id:"sc-pstudio-title",className:"sc-newdlg-title",children:e}),t,o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close",onClick:g,"aria-label":"Close",children:o.jsx(Mn,{size:16})})]}),o.jsxs("div",{className:"sc-pstudio-scroll",children:[n,o.jsx("div",{className:"sc-pstudio-body",...a,children:r})]}),o.jsx("div",{className:"sc-pstudio-foot sc-dock",ref:b,children:i}),o.jsx("div",{className:"sc-pstudio-resize",role:"separator","aria-orientation":"vertical","aria-label":f,"aria-valuemin":eP,"aria-valuemax":tP,"aria-valuenow":hu(y),tabIndex:0,onPointerDown:N=>{N.button===0&&(N.preventDefault(),N.stopPropagation(),N.currentTarget.setPointerCapture(N.pointerId))},onPointerMove:N=>{if(!N.currentTarget.hasPointerCapture(N.pointerId))return;const A=N.currentTarget.closest(".sc-pstudio");S.current=N.clientX,!E.current&&(E.current=requestAnimationFrame(()=>{E.current=0,A==null||A.style.setProperty("--sc-pstudio-rail-set",`${hu(window.innerWidth-S.current)}px`)}))},onPointerUp:N=>{N.currentTarget.releasePointerCapture(N.pointerId),E.current&&(cancelAnimationFrame(E.current),E.current=0),k(hu(window.innerWidth-N.clientX))},onDoubleClick:()=>k(eS),onKeyDown:N=>{if(N.key==="ArrowLeft")k(A=>hu(A+16));else if(N.key==="ArrowRight")k(A=>hu(A-16));else return;N.preventDefault()}})]}),l]})}),document.body)}function Nae({hash:e,alt:t,drawing:n,since:r,items:a,onPick:i,compare:l,doing:u,takes:f,onTake:h,empty:p,glyph:g}){const v=Mae(n),[w,b]=s.useState(null),y=f??[],k=Math.max(0,y.findIndex(R=>w?R.hash===w:R.current)),S=y[k];s.useEffect(()=>b(null),[e]);const E=Rae(w&&y.some(R=>R.hash===w)?w:e),[j,N]=s.useState(void 0);s.useEffect(()=>N(void 0),[e]);const A=R=>{const $=y[k+R];$&&b($.hash)},T=s.useRef(null),[P,C]=s.useState(!1);return s.useLayoutEffect(()=>{const R=T.current;C(!(R!=null&&R.complete&&R.naturalWidth))},[E]),o.jsxs("div",{className:"sc-pstudio-stage",children:[o.jsx("div",{className:"sc-pstudio-wrap",children:o.jsxs("div",{className:"sc-pstudio-well","data-drawing":n||void 0,"data-empty":!e||void 0,style:j?{"--sc-well-ar":j}:void 0,children:[e&&E?o.jsx("img",{ref:T,src:Fr(E),srcSet:`${hn(E,"tile")} 640w, ${Fr(E)} 1024w`,sizes:"(max-width: 767px) 92vw, 44vw",alt:t,decoding:"async","data-waiting":P||void 0,onLoad:R=>{const $=R.currentTarget;C(!1),$.naturalWidth&&$.naturalHeight&&N($.naturalWidth/$.naturalHeight)}}):o.jsx("span",{className:"sc-pstudio-well-blank",children:!n&&o.jsx(JR,{glyph:g,lead:p==null?void 0:p.lead,hint:p==null?void 0:p.hint})}),n&&!e&&o.jsx("span",{className:"sc-shimmer","aria-hidden":!0}),n&&e&&o.jsx("span",{className:"sc-pstudio-veil","aria-hidden":!0}),n&&o.jsxs("span",{className:"sc-pstudio-doing",children:[o.jsx("span",{className:"sc-pstudio-ring","aria-hidden":!0}),o.jsx("span",{children:u??"Drawing"}),r&&o.jsx("time",{"aria-hidden":"true",children:pc(r,v)})]}),y.length>1&&!n&&!(l!=null&&l.on)&&o.jsxs("div",{className:"sc-pstudio-vers",children:[o.jsx("button",{type:"button",className:"sc-pstudio-vers-step","aria-label":"The version before","aria-disabled":k===0||void 0,onClick:()=>k>0&&A(-1),children:o.jsx(Sa,{size:13,weight:"bold"})}),o.jsxs("span",{className:"sc-pstudio-vers-n","aria-live":"polite",children:["Version ",(S==null?void 0:S.n)??1," of ",y.length]}),o.jsx("button",{type:"button",className:"sc-pstudio-vers-step","aria-label":"The version after","aria-disabled":k===y.length-1||void 0,onClick:()=>k<y.length-1&&A(1),children:o.jsx(cl,{size:13,weight:"bold"})}),S&&!S.current&&h&&o.jsx("button",{type:"button",className:"sc-pstudio-vers-put",onClick:()=>h(S.hash),children:"Put back"}),(S==null?void 0:S.current)&&o.jsx("span",{className:"sc-pstudio-vers-on",children:"Active"})]}),l&&!n&&o.jsx("button",{type:"button",className:"sc-pstudio-compare","aria-pressed":l.on,onClick:l.toggle,children:l.on?"Showing current":"Compare"})]})}),a.length>0&&o.jsx("ol",{className:"sc-pstudio-strip","aria-label":"Views",children:a.map(R=>{const $=R.label+(R.approved?", used":R.state==="stale"?", to be drawn again":"")+(R.photo?", your photo":"")+(R.drawing?", drawing":"")+(R.error?", failed":"");return o.jsxs("li",{children:[o.jsx("button",{type:"button",className:"sc-pstudio-slot","data-state":R.state,"data-view":R.view,"aria-current":R.state==="current"?"step":void 0,"aria-label":$,disabled:!i,onClick:()=>i==null?void 0:i(R.view),children:o.jsxs("span",{className:"sc-pstudio-slot-inner",children:[R.hash?o.jsx("img",{src:hn(R.hash,"micro"),alt:""}):null,R.drawing&&!R.hash?o.jsx("span",{className:"sc-shimmer","aria-hidden":!0}):null,R.drawing&&R.hash?o.jsx("span",{className:"sc-pstudio-slot-work sc-pstudio-ring","aria-hidden":!0}):null,R.approved&&!R.drawing?o.jsx("span",{className:"sc-pstudio-slot-mark","aria-hidden":!0,children:o.jsx(Un,{size:11,weight:"bold"})}):null,R.error&&!R.drawing?o.jsx("span",{className:"sc-pstudio-slot-mark","data-tone":"alert","aria-hidden":!0,children:o.jsx(Hp,{size:11,weight:"bold"})}):null]})}),o.jsx("span",{className:"sc-pstudio-slot-lb","data-on":R.state==="current"||void 0,"aria-hidden":!0,children:R.label})]},R.view)})})]})}function Mae(e){const[t,n]=s.useState(()=>Date.now());return s.useEffect(()=>{if(!e)return;n(Date.now());const r=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(r)},[e]),t}function Rae(e){const[t,n]=s.useState(e);return s.useEffect(()=>{if(!e||e===t){e||n(void 0);return}let r=!0;const a=()=>{r&&n(e)},i=new Image;i.srcset=`${hn(e,"tile")} 640w, ${Fr(e)} 1024w`,i.sizes="(max-width: 767px) 92vw, 44vw",i.src=Fr(e),i.decode?i.decode().then(a,a):(i.onload=a,i.onerror=a);const l=window.setTimeout(a,3e3);return()=>{r=!1,window.clearTimeout(l)}},[e,t]),t}function Ww({surface:e,onClose:t}){var h,p,g;const n=Sr(ta),r=e,a=(h=r.stage)==null?void 0:h.onPick,i=a?v=>a(v):void 0,l=tee(r.turns);s.useEffect(()=>{if(!l||r.busy)return;let v=!1;const w=b=>{var k,S;if(b.key!=="Enter"||b.shiftKey||b.defaultPrevented||v)return;const y=b.target;!((k=y==null?void 0:y.matches)!=null&&k.call(y,".sc-convo-q"))||((S=y.closest(".sc-convo-turn"))==null?void 0:S.getAttribute("data-turn"))!==`q:${l.id}`||(b.preventDefault(),v=!0,r.onAnswer(l.id,{kind:"confirm",id:l.options[0].id}))};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[l,r.busy,r.onAnswer]);const u=r.glyph??o.jsx(qO,{size:32}),f=n?null:r.stage?o.jsx(Nae,{hash:r.stage.hash,alt:r.stage.alt,drawing:r.stage.drawing,since:r.stage.since,doing:r.stage.doing,takes:r.stage.takes,onTake:r.stage.onTake,items:r.stage.items,onPick:r.stage.onPick,compare:r.stage.compare,empty:r.stageEmpty,glyph:u}):o.jsx("div",{className:"sc-pstudio-stage","data-reserve":!0,children:o.jsx("div",{className:"sc-pstudio-wrap",children:o.jsx("div",{className:"sc-pstudio-well","data-empty":!0,children:o.jsx("span",{className:"sc-pstudio-well-blank",children:o.jsx(JR,{glyph:u,lead:(p=r.stageEmpty)==null?void 0:p.lead,hint:(g=r.stageEmpty)==null?void 0:g.hint})})})})});return o.jsx(Aae,{kind:r.kind??"presenter",title:r.title,headAction:r.headAction,resizeLabel:"Resize the conversation",onPaste:r.onPaste,onClose:t,overlay:r.overlay,stage:f,bodyProps:{"data-convo":!0},body:o.jsx(Zee,{turns:r.turns,busy:r.busy,working:r.working,memoryKey:r.memoryKey,resumed:r.resumed,onAnswer:r.onAnswer,onEdit:r.onEdit,onSaveEdit:r.onSaveEdit,onCancelEdit:r.onCancelEdit,onRestore:r.onRestore,onRetry:r.onRetry,onShow:i,onStarter:v=>(r.onStarter??r.onText)(v),onDescribe:r.onDescribe,onAttachFiles:r.onAttachRef}),foot:o.jsxs(o.Fragment,{children:[r.dock,r.composer&&o.jsx(jae,{quiet:!!r.composer.disabled&&!r.composer.working,placeholder:r.composer.placeholder,label:r.composer.label,action:r.composer.action,scope:r.composer.scope,hint:r.composer.hint,value:r.text,onValue:r.onText,allowEmpty:r.composer.allowEmpty,disabled:r.composer.disabled,why:r.composer.why,working:r.composer.working,error:r.composer.error,focusKey:r.composer.focusKey,onAttach:r.composer.onAttach,onAttachFiles:r.composer.onAttachFiles,attachLabel:r.composer.attachLabel,colour:r.composer.colour,refs:r.composer.refs,onStop:r.composer.onStop,stopping:r.composer.stopping,onSend:r.onSend})]})})}const kd=[{id:"glasses",label:"Glasses",ask:"What glasses do they wear?",options:[{id:"thin black rectangular metal frames",label:"Thin black",card:"glasses-1"},{id:"round thin gold metal frames",label:"Round metal",card:"glasses-2"},{id:"clear transparent acetate frames",label:"Clear acetate",card:"glasses-3"},{id:"bold thick black rectangular acetate frames",label:"Bold rectangular",card:"glasses-4"},{id:"tortoiseshell acetate frames",label:"Tortoiseshell",card:"glasses-5"},{id:"rimless frames with thin temples",label:"Rimless",card:"glasses-6"}],saying:"Describe the glasses",refHint:"A clear front or three-quarter view of the frames."},{id:"freckles",label:"Freckles or marks",ask:"What marks their skin?",options:[{id:"light freckles across the nose and cheeks",label:"Light freckles",card:"freckles-1"},{id:"dense freckles across the whole face",label:"Dense freckles",card:"freckles-2"},{id:"freckles across the face and shoulders",label:"Face and shoulders",card:"freckles-3"},{id:"a small birthmark on one cheek",label:"Birthmark",card:"freckles-4"},{id:"a beauty mark above the lip",label:"Beauty mark",card:"freckles-5"}],saying:"Describe it",refHint:"A clear, close photograph of it."},{id:"makeup",label:"Makeup",ask:"What makeup do they wear?",options:[{id:"natural, barely-there makeup",label:"Natural",card:"makeup-1"},{id:"black winged eyeliner",label:"Winged liner",card:"makeup-2"},{id:"a soft smoky eye",label:"Smoky eye",card:"makeup-3"},{id:"a bold red lip",label:"Bold red lip",card:"makeup-4"},{id:"soft glamorous makeup with a warm shimmer",label:"Soft glam",card:"makeup-5"},{id:"strong defined brows and a nude lip",label:"Strong brows",card:"makeup-6"}],saying:"Describe the makeup",refHint:"A clear face photograph showing the look."},{id:"scar",label:"Scar",ask:"What scar do they have?",options:[{id:"a thin pale scar through one eyebrow",label:"Through an eyebrow",card:"scar-1"},{id:"a small pale scar on one cheek",label:"On a cheek",card:"scar-2"},{id:"a small scar on the chin",label:"On the chin",card:"scar-3"},{id:"a fine scar along the jaw",label:"Along the jaw",card:"scar-4"},{id:"a small scar beside one eye",label:"Beside an eye",card:"scar-5"},{id:"a faded scar across the bridge of the nose",label:"Across the nose",card:"scar-6"}],saying:"Describe the scar",refHint:"A clear, close photograph of it."},{id:"piercing",label:"Piercing",ask:"What piercing do they wear?",options:[{id:"a small silver nose stud",label:"Nose stud",card:"piercing-1"},{id:"a silver septum ring",label:"Septum ring",card:"piercing-2"},{id:"a small silver hoop through one eyebrow",label:"Eyebrow hoop",card:"piercing-3"},{id:"several small silver hoops in one ear",label:"Ear hoops",card:"piercing-4"},{id:"a small silver lip ring",label:"Lip ring",card:"piercing-5"},{id:"a row of small silver studs up one ear",label:"Ear studs",card:"piercing-6"}],saying:"Describe the piercing",refHint:"A clear photograph of the jewellery."},{id:"tattoo",label:"Tattoo",ask:"What is their tattoo?",options:[{id:"a fine-line botanical tattoo",label:"Fine line",card:"tattoo-1"},{id:"a small geometric line tattoo",label:"Geometric",card:"tattoo-2"},{id:"a floral tattoo in soft grey shading",label:"Floral",card:"tattoo-3"},{id:"a bold traditional red rose tattoo with heavy black linework",label:"Traditional",card:"tattoo-4"},{id:"a solid blackwork snake tattoo in heavy black ink",label:"Blackwork",card:"tattoo-5"},{id:"a small script tattoo in thin lettering",label:"Script",card:"tattoo-6"}],saying:"Describe the tattoo",refHint:"A clear photograph of the design itself.",where:{ask:"And where is it?",options:[{id:"on their right forearm",label:"Right forearm"},{id:"on their left forearm",label:"Left forearm"},{id:"on their right upper arm",label:"Right upper arm"},{id:"on their left upper arm",label:"Left upper arm"},{id:"on one shoulder",label:"Shoulder"},{id:"on the side of their neck",label:"Neck"},{id:"on their hand",label:"Hand"},{id:"on their back",label:"Back"}]}},{id:"prosthetic",label:"Prosthetic limb",ask:"What does their limb look like?",options:[{id:"a matte black mechanical prosthetic limb with dark articulated joints",label:"Matte black",card:"prosthetic-1"},{id:"a brushed steel mechanical prosthetic limb with dark articulated joints",label:"Brushed steel",card:"prosthetic-2"},{id:"a woven carbon fibre mechanical prosthetic limb with dark articulated joints",label:"Carbon fibre",card:"prosthetic-3"},{id:"a skin-tone mechanical prosthetic limb with dark articulated joints",label:"Skin tone",card:"prosthetic-4"},{id:"a glossy bright red mechanical prosthetic limb with dark articulated joints",label:"Red",card:"prosthetic-5"},{id:"a matte white mechanical prosthetic limb with dark articulated joints",label:"Matte white",card:"prosthetic-6"}],saying:"Describe it",refHint:"A clear photograph showing its shape and finish.",where:{ask:"And which limb?",options:[{id:"in place of their left arm",label:"Left arm"},{id:"in place of their right arm",label:"Right arm"},{id:"in place of their left leg",label:"Left leg"},{id:"in place of their right leg",label:"Right leg"},{id:"in place of their left hand",label:"Left hand"},{id:"in place of their right hand",label:"Right hand"}]}}],ja=e=>kd.find(t=>t.id===e),Pae=/\b(forearm|upper arm|arm|shoulder|neck|throat|hand|wrist|back|chest|ribs|thigh|leg|calf|ankle|foot|cheek|eyebrow|brow|chin|lip|nose|ear|temple|jaw|collarbone)\b/i;function nP(e){return Pae.test(e??"")}function Lae(e,t){var a,i,l;const n=((a=t.words)==null?void 0:a.trim())??"",r=((i=t.where)==null?void 0:i.trim())??"";return n?r&&!nP(n)?`${n} ${r}`:n:r?`${((l=ja(e))==null?void 0:l.label.toLowerCase())??e} ${r}`:""}function tS(e,t){const n=(t??[]).filter(r=>/\b(left|right)\b/i.test(r.words)&&(e==="front"||!$ae.has(r.id)));if(n.length)return`Check the side: ${n.map(r=>r.words).join("; ")}. Facing you, their right is on your left.`}const $ae=new Set(["tattoo","prosthetic"]),Fm=["who","age","heritage","skin","hair","length","facial","eyes","build","height"],mc="either",gc=e=>{var t,n;return[(e==null?void 0:e.pick)===mc?"":(t=e==null?void 0:e.pick)==null?void 0:t.trim(),(n=e==null?void 0:e.words)==null?void 0:n.trim()].filter(Boolean).join(", ")},rP=e=>{var t;return!!(e!=null&&e.pick||(t=e==null?void 0:e.words)!=null&&t.trim())},_m=e=>{var t;return((t=e.source)==null?void 0:t.door)==="scratch"},p4=e=>{var t;return _m(e)&&((t=e.source)==null?void 0:t.via)==="taps"},Vm=e=>{var t;return _m(e)&&((t=e.source)==null?void 0:t.via)!=="taps"},Zm=e=>{var t;return((t=e.source)==null?void 0:t.door)==="photos"},Tae=/\b(slim|slender|athletic|average|fuller|curvy|broad|lean|muscular|petite|stocky|heavy|thin|plus.size)\b/i;function Kw(e){const t=e.trim(),n=t.split(/\s+/).filter(Boolean).length,r=[];return Xh.test(t)||r.push("who"),zv.test(t)||r.push("age"),r.length&&!Tae.test(t)&&n<8&&r.push("build"),r}const Dae=(e,t)=>Fm.every(n=>!uP(`look-${n}`,e,t)||e[`look-${n}`]!==void 0),sP=e=>Vm(e)&&e.describe!==void 0&&Kw(e.describe).length>0,Hae=e=>Vm(e)&&e.describe!==void 0&&(!sP(e)||e.gaps!==void 0),Oae=(e,t)=>{var n;return Zm(e)&&!!t.draft&&t.draft.source==="photos"&&t.canGenerate&&t.draft.stage!=="analyzing"&&(e.traits!==void 0||!((n=t.draft.keep)!=null&&n.trim()))},aP=(e,t)=>p4(e)?Dae(e,t):Vm(e)?Hae(e):Oae(e,t),Iae=(e,t)=>_m(e)||Zm(e)&&!!t.draft,oP=e=>t=>{var n;return!!((n=t.traits)!=null&&n.includes(e))},iP=e=>t=>rP(t[`trait-${e}`]),lP=e=>t=>{var n;return oP(e)(t)&&iP(e)(t)&&!!((n=ja(e))!=null&&n.where)&&!nP(gc(t[`trait-${e}`]))},ph=(e,t)=>Array.isArray(e)&&e.includes(t),Fae=(e,t)=>{var n;return aP(e,t)&&(((n=e.traits)==null?void 0:n.every(r=>iP(r)(e)&&(!lP(r)(e)||e[`trait-${r}-where`]!==void 0)))??!1)},_ae=(e,t)=>JSON.stringify(e)!==JSON.stringify(t),Vae=(e,t)=>{var r;if(!Zm(e)||!t.draft||t.draft.stage==="analyzing"||t.draft.views.portrait.status!=="empty")return!1;const n=((r=t.draft.analysis)==null?void 0:r.photos)??[];return n.length>0&&n.every(a=>a.usable===!1)},ri=[{id:"source",applies:()=>!0},{id:"photos",applies:Zm},{id:"weakphotos",applies:Vae},...Fm.map(e=>({id:`look-${e}`,applies:e==="facial"?t=>{var n;return p4(t)&&((n=t["look-who"])==null?void 0:n.pick)!=="woman"}:p4})),{id:"describe",applies:Vm},{id:"gaps",applies:sP,dependsOn:[{on:"describe"}]},{id:"traits",applies:Iae,ready:aP},...kd.flatMap(e=>[{id:`trait-${e.id}`,applies:oP(e.id),dependsOn:[{on:"traits",changed:(t,n)=>ph(t,e.id)!==ph(n,e.id)}]},{id:`trait-${e.id}-where`,applies:lP(e.id),dependsOn:[{on:`trait-${e.id}`,changed:(t,n)=>gc(t)!==gc(n)},{on:"traits",changed:(t,n)=>ph(t,e.id)!==ph(n,e.id)}]}]),{id:"keep",applies:_m,ready:Fae,optional:!0,sticky:!0}],cP=new Map(ri.map(e=>[e.id,e])),Zae=ri.map(e=>e.id),nf=e=>{const t=ri.findIndex(n=>n.id===e);return t<0?ri.length:t},zae=e=>cP.get(e);function uP(e,t,n){return zae(e).applies(t,n)}function dP(e,t,n){if(e==="photos")return!!n.draft&&n.draft.source==="photos";const r=t[e];return r===void 0?!1:ir(e)||Uae(e)?rP(r):!0}function fP(e,t){return ri.filter(n=>n.applies(e,t)&&dP(n.id,e,t)).map(n=>n.id)}function zm(e,t){var n;return((n=ri.find(r=>{var a;return!r.optional&&r.applies(e,t)&&(((a=r.ready)==null?void 0:a.call(r,e,t))??!0)&&!dP(r.id,e,t)}))==null?void 0:n.id)??null}function nS(e,t,n){const r={...e},a=new Set,i=new Set(Object.keys(t));for(const[u,f]of Object.entries(t))_ae(e[u],f)&&(f===void 0?delete r[u]:r[u]=f,a.add(u));if(a.size){const u=ri.map(g=>g.id),f=Math.min(...[...a].map(g=>u.indexOf(g))),h=new Set(a),p=g=>(g.dependsOn??[]).some(v=>h.has(v.on));for(const g of ri)u.indexOf(g.id)<=f||i.has(g.id)||r[g.id]===void 0||g.sticky||p(g)||(delete r[g.id],a.add(g.id))}let l=!0;for(;l;){l=!1;for(const u of ri){if(r[u.id]===void 0)continue;(!i.has(u.id)&&(u.dependsOn??[]).some(h=>a.has(h.on)&&(h.changed?h.changed(e[h.on],r[h.on]):!0))||!u.applies(r,n))&&(delete r[u.id],a.add(u.id),l=!0)}}return r}function Bae(e){const t={};for(const n of e.traits??[]){const r=e[`trait-${n}`];r&&(t[n]={words:gc(r)||void 0,where:gc(e[`trait-${n}-where`])||void 0,refs:r.refs.length?r.refs:void 0})}return t}function hP(e){const t={};for(const n of Fm){const r=e[`look-${n}`];r!==void 0&&(t[n]=r)}return t}const pP=e=>kd.map(t=>t.id).filter(t=>e.includes(t)),ir=e=>e.startsWith("look-"),Uae=e=>e.startsWith("trait-"),Ys=e=>cP.has(e);function ls(e){if(!e.startsWith("trait-"))return null;const t=e.endsWith("-where"),n=t?e.slice(6,-6):e.slice(6);return ja(n)?{id:n,part:t?"where":"what"}:null}const Wae=[{to:8,name:"red"},{to:16,name:"scarlet"},{to:30,name:"orange"},{to:36,name:"amber"},{to:46,name:"gold"},{to:64,name:"yellow"},{to:80,name:"lime"},{to:95,name:"yellow-green"},{to:158,name:"green"},{to:172,name:"sea green"},{to:183,name:"teal"},{to:196,name:"cyan"},{to:205,name:"sky blue"},{to:215,name:"azure"},{to:240,name:"blue"},{to:252,name:"indigo"},{to:268,name:"violet"},{to:285,name:"purple"},{to:300,name:"orchid"},{to:318,name:"magenta"},{to:330,name:"fuchsia"},{to:342,name:"pink"},{to:352,name:"rose"},{to:360,name:"red"}],Kae=[{to:.05,name:"black"},{to:.16,name:"charcoal"},{to:.32,name:"dark grey"},{to:.62,name:"grey"},{to:.76,name:"light grey"},{to:.88,name:"silver"},{to:.96,name:"off-white"},{to:1.01,name:"white"}],Gae=new Set(["black","charcoal","dark grey","grey","light grey","silver","off-white","white","dark brown","brown","chestnut","auburn","copper","tan","beige","cream","amber","gold","blonde"]),Yae=e=>{const t=String(e??"").replace("#","").trim();return(t.length===3?t.split("").map(r=>r+r):[t.slice(0,2),t.slice(2,4),t.slice(4,6)]).map(r=>{const a=Number.parseInt(r,16);return Number.isFinite(a)?a:0})};function qae(e){const[t,n,r]=Yae(e),a=t/255,i=n/255,l=r/255,u=Math.max(a,i,l),f=Math.min(a,i,l),h=(u+f)/2,p=u-f;if(p===0)return{h:0,s:0,l:h};const g=p/(1-Math.abs(2*h-1));return{h:((u===a?60*((i-l)/p%6):u===i?60*((l-a)/p+2):60*((a-i)/p+4))+360)%360,s:g,l:h}}const Xae=e=>{var t;return((t=Wae.find(n=>e<n.to))==null?void 0:t.name)??"red"};function Qae(e,t,n){return e==="orange"||e==="amber"||e==="scarlet"?n<.2?"dark brown":n<.32?e==="scarlet"?"chestnut":"brown":n>=.86&&t<.6?"cream":n>=.72&&t<.6?"beige":n<.44&&t<.7?"brown":n<.62&&t<.55?"tan":null:(e==="gold"||e==="yellow")&&n<.42?"olive":(e==="indigo"||e==="violet"||e==="purple")&&n>=.72&&t<.7?"lavender":(e==="blue"||e==="azure"||e==="indigo")&&n<.22?"navy":e==="red"&&n<.34?t<.55?"burgundy":"maroon":e==="rose"&&n<.34?"burgundy":null}function Jae(e){return e<.18?"deep":e<.34?"dark":e>=.88?"pale":e>=.74?"light":""}function mP(e){var u;const{h:t,s:n,l:r}=qae(e);if(n<.09){const f=((u=Kae.find(h=>r<h.to))==null?void 0:u.name)??"grey";return{name:f,family:f,h:t,s:n,l:r}}const a=Xae(t),i=Qae(a,n,r);if(i){const f=r<.12?"deep":r>=.93?"pale":"";return{name:f?`${f} ${i}`:i,family:i,h:t,s:n,l:r}}const l=Jae(r);return l?{name:`${l} ${a}`,family:a,h:t,s:n,l:r}:n<.22?{name:`muted ${a}`,family:a,h:t,s:n,l:r}:n>.85&&r>.4&&r<.65?{name:`vivid ${a}`,family:a,h:t,s:n,l:r}:{name:a,family:a,h:t,s:n,l:r}}function eoe(e){const{family:t,h:n,s:r,l:a}=mP(e);return Gae.has(t)?!0:n>=16&&n<=60&&a>=.7&&r<.7||r<.09}const Gw=[{id:"black",label:"Black",color:"#15120f"},{id:"dark brown",label:"Dark brown",color:"#3b2418"},{id:"brown",label:"Brown",color:"#6b4630"},{id:"auburn",label:"Auburn",color:"#8c3b26"},{id:"ginger",label:"Ginger",color:"#c2622a"},{id:"blonde",label:"Blonde",color:"#d8ac63"},{id:"platinum blonde",label:"Platinum",color:"#e9e1d0"},{id:"grey",label:"Grey",color:"#9b9b99"},{id:"white",label:"White",color:"#f0efed"}],gP=[{id:"buzzed",label:"Buzzed",card:"length-1"},{id:"cropped",label:"Cropped",card:"length-2"},{id:"short",label:"Short",card:"length-3"},{id:"chin-length",label:"Chin",card:"length-4"},{id:"shoulder-length",label:"Shoulder",card:"length-5"},{id:"long",label:"Long",card:"length-6"}],Yw=[{id:"porcelain",label:"Porcelain",color:"#f4e0d4"},{id:"fair",label:"Fair",color:"#edcdb6"},{id:"light olive",label:"Light olive",color:"#ddb894"},{id:"olive",label:"Olive",color:"#c2935f"},{id:"tan",label:"Tan",color:"#a9713f"},{id:"brown",label:"Brown",color:"#7c4f2c"},{id:"deep brown",label:"Deep brown",color:"#57351d"},{id:"deep",label:"Deep",color:"#3a2114"}],vP=[{id:"slight",label:"Slight",card:"build-1"},{id:"lean",label:"Lean",card:"build-2"},{id:"average",label:"Average",card:"build-3"},{id:"solid",label:"Solid",card:"build-4"},{id:"full",label:"Full",card:"build-5"}],toe=[{id:"East Asian",label:"East Asian"},{id:"South Asian",label:"South Asian"},{id:"Southeast Asian",label:"Southeast Asian"},{id:"Middle Eastern",label:"Middle Eastern"},{id:"Mediterranean",label:"Mediterranean"},{id:"North African",label:"North African"},{id:"West African",label:"West African"},{id:"East African",label:"East African"},{id:"Northern European",label:"Northern European"},{id:"Eastern European",label:"Eastern European"},{id:"Latin American",label:"Latin American"},{id:"Caribbean",label:"Caribbean"},{id:"mixed heritage",label:"Mixed"}],qw=[{id:"dark brown",label:"Dark brown",color:"#3b2a1d"},{id:"brown",label:"Brown",color:"#6b4423"},{id:"hazel",label:"Hazel",color:"#8a7340"},{id:"amber",label:"Amber",color:"#b07d1a"},{id:"green",label:"Green",color:"#5b7a4b"},{id:"blue",label:"Blue",color:"#4a7ba7"},{id:"grey",label:"Grey",color:"#8b949c"}],wP=[{id:"clean-shaven",label:"Clean shaven",card:"facial-1"},{id:"light stubble",label:"Stubble",card:"facial-2"},{id:"a moustache",label:"Moustache",card:"facial-3"},{id:"a goatee",label:"Goatee",card:"facial-4"},{id:"a short beard",label:"Short beard",card:"facial-5"},{id:"a full beard",label:"Full beard",card:"facial-6"}],yP=[{id:"very short",label:"Very short",card:"height-1"},{id:"short",label:"Short",card:"height-2"},{id:"average height",label:"Average",card:"height-3"},{id:"tall",label:"Tall",card:"height-4"},{id:"very tall",label:"Very tall",card:"height-5"}],noe={},bP=[{id:"woman",label:"Woman"},{id:"man",label:"Man"},{id:"androgynous",label:"Androgynous"}],xP=["20s","30s","40s","50s","60+"].map(e=>({id:e,label:e})),Uf={who:{row:{id:"who",label:"Who",options:bP},prompt:"Who are they?"},age:{row:{id:"age",label:"Age",options:xP},prompt:"Roughly how old?"},heritage:{row:{id:"heritage",label:"Heritage",options:toe},prompt:"Where are they from?"},skin:{row:{id:"skin",label:"Skin",options:Yw},prompt:"And their skin?"},eyes:{row:{id:"eyes",label:"Eyes",options:qw},prompt:"What colour are their eyes?"},facial:{row:{id:"facial",label:"Facial hair",options:wP},prompt:"Any facial hair?"},hair:{row:{id:"hair",label:"Hair",options:Gw},prompt:"What colour is their hair?"},length:{row:{id:"length",label:"Length",options:gP},prompt:"And the length?"},build:{row:{id:"build",label:"Build",options:vP},prompt:"And their build?"},height:{row:{id:"height",label:"Height",options:yP},prompt:"And how tall?"}};Fm.map(e=>Uf[e]);const rS=new Set(["hair","skin","eyes"]),roe={who:"Who they are, in your words",age:"Their age, in words or a number",heritage:"Where they are from, in your words",hair:"Their hair colour, in words or a swatch",length:"Their cut, in your words",facial:"Their facial hair, in your words",eyes:"Their eye colour, in words or a swatch",skin:"Their skin, in words or a swatch",build:"Their build, in your words",height:"How tall they are, in your words"},soe=e=>e==="man"?"man":e==="woman"?"woman":"androgynous",aoe=new Set(["length","height","build"]),ooe=900;function Xw(e,t,n){const r=ioe(e,t);if(r.far<ooe)return r.id;const a=mP(e).name;return n==="hair"&&!eoe(e)?`dyed ${a}`:a}function ioe(e,t,n){const r=h=>{const p=h.replace("#","");return(p.length===3?p.split("").map(v=>v+v):[p.slice(0,2),p.slice(2,4),p.slice(4,6)]).map(v=>Number.parseInt(v,16)||0)},[a,i,l]=r(e);let u=t[0],f=Number.POSITIVE_INFINITY;for(const h of t){if(!h.color)continue;const[p,g,v]=r(h.color),w=(a-p)**2+(i-g)**2+(l-v)**2;w<f&&(f=w,u=h)}return{id:u.id,far:f}}const sS=e=>e==="skin"?Yw:e==="eyes"?qw:Gw,Oh=e=>e.charAt(0).toUpperCase()+e.slice(1);function kP(e){const t=H=>H!=null&&H.pick&&H.pick!==mc?H.pick:"",n=(H,D,q)=>{var U;const _=t(H);return _?_.startsWith("#")?Xw(_,D,q):_:((U=H==null?void 0:H.words)==null?void 0:U.trim())??""},r=H=>{var D;return t(H)?((D=H==null?void 0:H.words)==null?void 0:D.trim())??"":""},a=(H,...D)=>[H,...D.filter(Boolean)].join(" "),i=(H,D,q)=>n(H,D,q).toLowerCase(),l={androgynous:"androgynous person",man:"man",woman:"woman"},u=i(e.who,[]),f=l[u]??u,p=[n(e.heritage,[]),f].filter(Boolean).join(" "),v=[p?/^(a|an|the)\s/i.test(p)?p:`${/^[aeiou]/i.test(p)?"an":"a"} ${p}`:"a person"],w=i(e.age,[]),b=w==="60+"?"in their 60s or older":/^\d{1,3}$/.test(w)?`aged ${w}`:`in their ${w}`;w&&v.push(a(b,r(e.age)));const y=[],k=i(e.length,gP),S=i(e.hair,Gw,"hair"),E=[k,S].filter(Boolean).join(" ");E&&y.push(a(`${E} hair`,r(e.length),r(e.hair)));const j=i(e.facial,wP);j&&y.push(a(j,r(e.facial)));const N=i(e.eyes,qw);N&&y.push(a(`${N} eyes`,r(e.eyes)));const A=i(e.skin,Yw,"skin");A&&y.push(a(`${A} skin`,r(e.skin)));const T=i(e.height,yP),P=i(e.build,vP),C=T?a(noe[T]??T,r(e.height)):"",R=P?a(`${/^[aeiou]/.test(P)?"an":"a"} ${P} build`,r(e.build)):"",$=[C,R&&(C?`with ${R}`:R)].filter(Boolean).join(" ");return $&&y.push($),y.length&&v.push(`with ${y.join(", ")}`),a(v.join(" "),r(e.who))}function loe(e,t){var i,l;const n=t.pick,r=n===mc?"Either way":n!=null&&n.startsWith("#")?Oh(Xw(n,e.options,e.id)):n?((i=e.options.find(u=>u.id===n))==null?void 0:i.label)??Oh(n):"",a=((l=t.words)==null?void 0:l.trim())??"";return r?a?`${r}, ${a}`:r:Oh(a)}function coe(e){return Oh(kP(e))}const rf=e=>typeof e=="string"&&e.startsWith("aside:"),uoe=e=>e.slice(6),yp={answers:{},revision:0,editing:null,saying:null,says:0,text:"",colour:null,composing:null,asides:[],unsure:null,extrasDeclined:!1,uploading:0},doe="That did not read as a description of someone.",SP=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function foe(e){if(!e||e==="name")return null;if(e==="keep")return"keep";const t=ls(e);return t&&t.part==="what"?`trait-${t.id}`:null}function aS(e,t){var r;const n=foe(t);return n?{id:n,refs:((r=e.answers[n])==null?void 0:r.refs)??[]}:null}function L8(e){const t=e.composing;if(!t)return e.answers;const n=e.answers[t.id];if(!n||SP(n.refs,t.refs))return e.answers;if(!gc(n)&&!t.refs.length){const r={...e.answers};return delete r[t.id],r}return{...e.answers,[t.id]:{...n,refs:t.refs}}}function hoe(e,t){var r;if(!ir(t)&&!ls(t))return;const n=e.answers[t];if(n)return{saying:t,text:n.words??"",colour:(r=n.pick)!=null&&r.startsWith("#")?{step:t,hex:n.pick}:null}}function m4(e,t,n,r){return e.filter(a=>!a.q||!Ys(a.q)?!0:!uP(a.q,t,n)||a.edit&&t[a.q]!==void 0?!1:r===void 0||nf(a.q)<=r)}function poe(e){const t=Object.keys(e).filter(n=>Ys(n));return t.length?Math.min(...t.map(nf)):void 0}function EP(e,t){if(!e.some(r=>r.at===t.at))return t;let n=1;for(;e.some(r=>r.at===`${t.at}#${n}`);)n+=1;return{...t,at:`${t.at}#${n}`}}function $8(e,t){const n=e.unsure;if(!n)return e;const r=zm(e.answers,t),a=u=>u&&(u===r||Ys(u)&&e.answers[u]!==void 0)?u:null,i=e.asides.map(u=>u.q==="unsure"?{...u,q:a(n.q)}:u),l=EP(i,{said:n.said,reply:doe,q:a(n.q),at:n.at});return{...e,unsure:null,asides:m4([...i,l],e.answers,t)}}function moe(e,t){var n,r,a;switch(t.type){case"answer":{const i=nS(e.answers,t.patch,t.ctx),l=!SP(i,e.answers),u=$8(e,t.ctx);return{...u,answers:i,revision:l?e.revision+1:e.revision,asides:m4(u.asides,i,t.ctx,poe(t.patch)),editing:null,saying:null,colour:null,composing:null,text:""}}case"edit":{const i=rf(t.id)||t.id==="name"?void 0:hoe(e,t.id);return{...e,answers:L8(e),composing:rf(t.id)?null:aS(e,t.id),editing:t.id,saying:(i==null?void 0:i.saying)??null,says:i?e.says+1:e.says,colour:(i==null?void 0:i.colour)??null,text:(i==null?void 0:i.text)??""}}case"amend-aside":{const i=e.asides.find(h=>h.at===t.at),l=i!=null&&i.q&&Ys(i.q)?i.q:null,u=l&&e.answers[l]!==void 0?nS(e.answers,{[l]:void 0},t.ctx):e.answers,f=m4(e.asides.filter(h=>h.at<=t.at),u,t.ctx,l?nf(l):void 0);return{...e,answers:u,revision:u===e.answers?e.revision:e.revision+1,editing:null,asides:f.map(h=>h.at===t.at?{...h,said:t.said,reply:t.reply,kind:t.kind,rev:(h.rev??0)+1}:h)}}case"drop-aside":return{...e,editing:null,asides:e.asides.filter(i=>i.at<t.at)};case"cancel-edit":return{...e,answers:L8(e),composing:null,editing:null,saying:null,colour:null,text:""};case"say":{const i=e.saying===t.id?null:t.id;return{...e,answers:L8(e),composing:aS(e,i),saying:i,says:e.says+1,colour:null,text:""}}case"text":return e.text===t.text?e:{...e,text:t.text};case"colour":return t.hex?t.step&&t.step!=="keep"?{...e,colour:{step:t.step,hex:t.hex}}:e:{...e,colour:null};case"aside":{if(!t.aside.said.trim()||!t.aside.reply.trim())return{...e,text:""};const l=!!t.aside.q&&Ys(t.aside.q)&&e.answers[t.aside.q]!==void 0?{...t.aside,after:!0}:t.aside;return{...e,asides:[...e.asides,EP(e.asides,l)],text:""}}case"unsure":return{...$8(e,t.ctx),unsure:t.unsure,text:""};case"settle-unsure":return $8(e,t.ctx);case"upload-begin":return{...e,uploading:e.uploading+1};case"upload-end":return{...e,uploading:Math.max(0,e.uploading-1)};case"uploaded":{if(((n=e.answers.source)==null?void 0:n.door)!=="photos")return e;const i=e.answers.photos??{hashes:[],attested:!1};return i.hashes.includes(t.hash)||i.hashes.length>=t.max?e:{...e,answers:{...e.answers,photos:{...i,hashes:[...i.hashes,t.hash]}},revision:e.revision+1}}case"remove-photo":{const i=e.answers.photos;if(!(i!=null&&i.hashes.includes(t.hash)))return e;const l=i.hashes.filter(u=>u!==t.hash);return{...e,answers:{...e.answers,photos:{hashes:l,attested:l.length?i.attested:!1}},revision:e.revision+1}}case"attest":{if(((r=e.answers.source)==null?void 0:r.door)!=="photos")return e;const i=e.answers.photos??{hashes:[],attested:!1};return i.attested===t.checked?e:{...e,answers:{...e.answers,photos:{...i,attested:t.checked}},revision:e.revision+1}}case"ref":{if(t.id!=="keep"){const u=t.id.slice(6);if(!((a=e.answers.traits)!=null&&a.includes(u)))return e}const i=e.answers[t.id]??{refs:[]},l=t.remove?i.refs.filter(u=>u!==t.hash):t.id==="keep"?[...i.refs.filter(u=>u!==t.hash),t.hash].slice(-4):[t.hash];return l.join()===i.refs.join()?e:{...e,answers:{...e.answers,[t.id]:{...i,refs:l}},revision:e.revision+1}}case"extras-declined":return{...e,extrasDeclined:!0};case"start-over":return{...yp,revision:e.revision+1,text:t.text??""};case"restore":return{...yp,answers:t.answers,revision:t.revision,asides:t.asides??[],extrasDeclined:!!t.extrasDeclined}}}function g4(e,t){return zm(e.answers,t)===null&&!e.editing&&!e.saying}const CP=5,jP=40;function goe(e){return JSON.stringify({v:CP,answers:e.answers,revision:e.revision,asides:e.asides.slice(-jP),...e.extrasDeclined?{extrasDeclined:!0}:{}})}function voe(e){if(!e||typeof e!="object")return null;const t=e;if(typeof t.said!="string"||typeof t.reply!="string"||typeof t.at!="string"||!t.said.trim()||!t.reply.trim())return null;const n=typeof t.q=="string"?t.q:null,r=typeof t.rev=="number"&&t.rev>0?t.rev:void 0,a=typeof t.kind=="string"?t.kind:void 0,i=t.after===!0?!0:void 0,l=t.edit===!0?!0:void 0;return{said:t.said,reply:t.reply,q:n,at:t.at,...r?{rev:r}:{},...a?{kind:a}:{},...i?{after:i}:{},...l?{edit:l}:{}}}function woe(e){var r;if(ir(e))return Uf[e.slice(5)].row.options;const t=ls(e),n=t&&ja(t.id);return n?t.part==="where"?((r=n.where)==null?void 0:r.options)??[]:n.options:[]}function oS(e,t){return t===mc||/^#[0-9a-f]{6}$/i.test(t)?{pick:t}:woe(e).some(n=>n.id===t)?{pick:t}:{words:t}}function yoe(e,t){if(e==="keep")return typeof t=="string"?{words:t,refs:[]}:t;if(typeof t=="string"&&(ir(e)||ls(e)))return oS(e,t);const n=ls(e);if((n==null?void 0:n.part)==="what"&&t&&typeof t=="object"){const r=t,a=Array.isArray(r.refs)?r.refs:[];return r.pick!==void 0||typeof r.words!="string"?{...r,refs:a}:{...oS(e,r.words),refs:a}}return t}function bp(e){if(!e)return null;try{const t=JSON.parse(e);if(t.v!==CP&&t.v!==4&&t.v!==3&&t.v!==2||!t.answers||typeof t.answers!="object")return null;const n={};for(const[a,i]of Object.entries(t.answers))Ys(a)&&(n[a]=yoe(a,i));const r=(Array.isArray(t.asides)?t.asides:[]).map(voe).filter(a=>a!==null).slice(-jP);return{answers:n,revision:typeof t.revision=="number"?t.revision:0,asides:r,...t.extrasDeclined===!0?{extrasDeclined:!0}:{}}}catch{return null}}const Jn={source:"Who are we making? Describe someone new, or add photos of a real person.",describe:"Describe them. Age, hair, build, skin and presence all help; one or two sentences is enough.",lookHint:"Skip anything you would rather leave to us.",photos:"Add one clear photo of their face. Up to three more angles hold the likeness better.",weakPhotos:"I cannot read a face in any of those photos, so anything I draw now would be a stranger rather than them.",name:"What should we call them?",traits:"Anything else that is always true of them?",traitsPhotos:"Anything in these photos that is always true of them?",keep:"Anything else about them?",agree:"Here is the presenter, in full. Ready to draw?",identity:e=>`Here is ${e==="them"?"the face":e}. Use this person to draw the rest from this face, or change something.`,change:"What should change?",landed:e=>`Here is the ${e}. Use it, or try again.`,extras:"Add back and profile views? Three more pictures, for shots from behind or in profile."},AP=e=>e==="photos"?"the photos":"the face",NP=[{id:"photos",label:"Add photos"},{id:"scratch",label:"Describe someone"}],boe={photos:/\b(photos?|pictures?|pics?|upload|images?|selfies?)\b/,scratch:/\b(scratch|describe|description|invent|make (someone|one|them) up|imagine|new person)\b/},xoe=[{label:"Late 30s, warm",text:"A woman in her late 30s, Mediterranean, olive skin, dark shoulder-length hair, slim build, warm and composed."},{label:"Early 20s, bright",text:"A man in his early 20s, fair skin with freckles, short blond hair, athletic build, bright and easygoing."},{label:"Mid 40s, quiet",text:"A man in his mid 40s, East Asian, close-cropped black hair, lean build, quietly confident."},{label:"Late 20s, easy",text:"A woman in her late 20s, deep brown skin, natural curls, tall and graceful, with an easy laugh."},{label:"Sixties, calm",text:"A woman in her early sixties, light skin, silver hair in a soft bob, broad build, calm and assured."}];function MP(e){const t=(e??"").replace(/\s*\(BYOK\)\s*$/i,"").trim();return`I have permission to use this person's likeness, and to send these photos ${t?/^codex/i.test(t)?"to OpenAI, through Codex, to draw them":`to ${t} to draw them`:"to the engine that draws them"}.`}MP(null);function koe(e){const t=[];return e.over>0&&t.push(e.over===1?`That is one more than ${e.max} photos, so the last one was not added.`:`That is ${e.over} more than ${e.max} photos, so the last ${e.over} were not added.`),e.same>0&&t.push(e.same===1?"One of those is already here.":`${e.same} of those are already here.`),e.failed.length&&t.push(e.failed.join(" ")),t.length?t.join(" "):null}const Soe=(e,t)=>`${e} is larger than ${Math.round(t/1024/1024)}MB. Choose a smaller copy of it.`,Eoe=e=>/\.hei[cf]$/i.test(e)?`${e} is a HEIC photo, which Scenri cannot read yet. Export it as JPEG and add that.`:`${e} could not be read as a photograph. JPEG, PNG and WebP all work.`,Coe="First portrait appears here",joe=(e,t)=>!e||e==="portrait"||!t?Coe:`The ${t} appears here`;function Aoe(e,t=0){return e==="agree"?"Ready when you are":e==="source"?"Describe them, or add photos":e==="photos"?t?"Continue when the photos are in":"Add their photos":e==="retry"?"Try again from the conversation":e==="noengine"?"Set up image generation, or add photos":"Keep describing your presenter"}const RP=e=>e===1?"One thing I cannot tell yet.":e===2?"Two things I cannot tell yet.":"A few things I cannot tell yet.";function Noe(e){return e===1?"One photo":`${e} photos`}function Moe(e,t){return e===0?"The same person, face clear. Add the clearest one first.":e===1?"One photo works. Two to four, from different angles, hold the likeness better.":e<t?`${e} photos. More angles hold the likeness better.`:"Four angles. The reference set comes from these, the first one leading."}const Roe="That does not read as a description yet. Draw from it anyway, or describe them: age, hair, build, skin, presence.",Poe=e=>e===0?void 0:e===1?"Changing this asks the one after it again.":`Changing this asks the ${e} after it again.`,Loe="Change this answer?",$oe="The face is drawn again from the change, and the views built on it follow. Nothing already saved changes.",Toe="The views drawn from the photos are drawn again with the change. The photos themselves stay as they are.",Doe={source:"describe them in a sentence, or pick one",describe:"a few words about them is enough: age, hair, build, skin, presence",look:"tap one, or say it in your own words",name:"a name, so the rest of the conversation can use it",refine:"say what should change: hair, age or build change the person; anything else changes the view on the stage",detail:"tap one, or say what it looks like"},Hoe={who:{thing:"a person",how:"tap who they are"},age:{thing:"an age",how:"tap an age, or type one: Scenri draws adults"},hair:{thing:"a hair colour",how:"tap a colour, or say it: dark auburn, salt and pepper"},length:{thing:"a length",how:"tap a length, or say it: a chin-length bob"},skin:{thing:"a skin tone",how:"tap a tone, or say it: warm olive"},build:{thing:"a build",how:"tap a build, or say it: lean and tall"}},hs=e=>e.charAt(0).toUpperCase()+e.slice(1);function Zl(e,t,n,r="",a,i=!1){const l=t==="look"?Hoe[a??""]??null:null,u=(l==null?void 0:l.how)??Doe[t],f=i?"":` ${hs(u)}.`;if(n>=2&&e!=="likeness"){const h=t==="look"||t==="detail"?"Or Skip it and we will choose.":"";return i?h||`${hs(u)}.`:`${hs(u)}.${h?` ${h}`:""}`}switch(e){case"likeness":return"Describe them by looks. Scenri does not draw a named person.";case"help":return l?`${hs(u)}.`:t==="refine"?"Select a view and say what is wrong with it, or say what should change about them: hair, age, build, skin.":t==="name"?"Any name will do; it can be changed later.":t==="detail"?`${hs(u)}.`:"Describe the person in a sentence: age, hair, build, skin, presence. Or add photos of a real person.";case"question":return l?`This step asks for ${l.thing}: ${u}.`:t==="refine"?`This is where the picture is changed: ${u}.`:t==="name"?`This is where they get a name: ${u}.`:t==="detail"?`This asks what the detail looks like: ${u}.`:`This is where the person is described: ${u}.`;case"nav":return"To begin again, use Start over at the top. Close keeps the draft where it is.";case"go":return t==="refine"?"Try again redraws it as it is; a sentence says what should change.":`Nothing to draw yet. ${hs(u)}.`;case"intent":return l?`${hs(u)}.`:t==="refine"?`Nothing changes until it is said what: ${u}.`:`That is what we are here for. Who are they? ${hs(u)}.`;case"nonsense":return l?`That is not ${l.thing}.${f}`:t==="name"?`That is not a name. ${hs(u)}.`:t==="refine"?`That does not say what should change. ${hs(u)}.`:t==="detail"?`That does not say what it looks like. ${hs(u)}.`:`That does not describe anyone. ${hs(u)}.`;case"greeting":return n?`Still here.${f}`:/^(hi|hello|hey|heya|hiya|yo|hola|shalom|good)\b/i.test(r.trim())?`Hi.${f}`:`${hs(u)}.`;case"ack":return n?`Still here.${f}`:i?"Go ahead.":`Go ahead: ${u}.`;case"vague":return n?`Still here. ${hs(u)}.`:`${hs(u)}.`}}const Ooe=e=>e.trim().replace(/[.\s]+$/,""),Qw=e=>e?e==="portrait"?"Everything else you had is kept.":"The face and everything else you had are kept.":"Everything you had is kept.";function Bm(e,t,n=Qw(null)){const r=eo(t);if(r.kind==="unknown")return{text:`${e}: ${Ooe(t)}. ${n}`};const a=r.remedy??(r.retryable?void 0:{label:"Providers",opens:"engines"});return{text:`${e}. ${r.fix?`${r.title} ${r.fix}`:r.title}`,remedy:a}}const v4=e=>e&&UA.includes(e)?[{id:"skip-extras",label:"Not now"}]:[];function PP(e,t=[]){return{id:"retry",kind:"confirm",tone:"alert",prompt:e.text,options:[...e.remedy?[{id:`remedy:${e.remedy.opens}`,label:e.remedy.label}]:[],{id:"retry",label:"Retry"},...t]}}function mh(e,t){const n=e==="portrait"?"face":xn[e];return t==="cancelled"?{id:"retry",kind:"confirm",quiet:!0,prompt:`Stopped drawing the ${n}. Nothing finished was touched.`,options:[{id:"retry",label:"Draw it again"},...v4(e)]}:PP(Bm(`The ${n} could not be drawn`,t,Qw(e)),v4(e))}function Ioe(e){var r;const t=(((r=e.analysis)==null?void 0:r.suitableCategories)??[]).filter(Boolean);return t.length?` Filed under ${t.length===1?t[0]:`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}; that can change on their page.`:""}function Foe(e){if(!e)return"";const t=[...e.asks??[],...e.results??[],...e.decisions??[]].map(n=>n.at);return t.length?t.reduce((n,r)=>r>n?r:n):""}const _oe=e=>e.charAt(0).toUpperCase()+e.slice(1);function Voe({draft:e,canGenerate:t,ui:n,afterCoverage:r,asides:a,openId:i,placed:l}){var we;const u=[],f=(G,ue,Ne)=>u.push({kind:"scenri",id:G,text:ue,tone:Ne}),h=G=>u.push({kind:"question",question:G}),p=((we=e.name)==null?void 0:we.trim())??"",g=p||"them",v=()=>{p&&(u.push({kind:"scenri",id:"asked-name",text:Jn.name,quiet:!0}),u.push({kind:"you",id:"name",text:p,editable:!0,editing:n.editingName||void 0}))},w=()=>h({id:"name",kind:"text",prompt:Jn.name}),b=(G,ue=[])=>n.failedView?mh(n.failedView,G):PP(Bm("That did not go through",G),ue),y=()=>{p||w()};if(e.stage==="analyzing")return f("reading",`Reading ${AP(e.source)}.`),p?v():w(),u;const k=$G(e,t);if(k&&f("coverage",k.text,k.tone),u.push(...r),!t&&e.source==="photos")return p&&v(),p?(h({id:"blind",kind:"confirm",prompt:"No engine here can draw the other views. Save them from the photos as they are?",options:[{id:"save",label:"Save with photos"},{id:"setup",label:"Set up"}]}),u):(w(),u);const S=e.views.portrait,E=e.activeView,j=e.asks??[],N=j[j.length-1],A=N?e.views[N.view]:null,T=!!N&&!!A&&(A.status==="generating"&&e.activeView===N.view||A.status==="candidate"&&A.adjustment===N.text||!!A.error),P=G=>G==="portrait"&&!Jo(e)?Jn.identity(g):Jn.change,C=(e.results??[]).filter(G=>G.how!=="restored"),R=e.decisions??[],$=!e.activeView&&e.stage==="idle",H=new Map,D=new Map,q=new Map;for(const G of C){const ue=`${G.view}:${G.hash}`;if(q.set(ue,G),H.has(ue))continue;const Ne=(D.get(G.view)??0)+1;D.set(G.view,Ne),H.set(ue,Ne)}const _=G=>H.get(`${G.view}:${G.hash}`)??1,U=(G,ue)=>{const Ne=_(G),ne=e.views[G.view].hash===G.hash,Fe=(D.get(G.view)??0)>1;return{kind:"scenri",id:ue,text:`Here is ${xn[G.view]} ${Ne}.`,thumb:G.hash,view:G.view,label:`${dc[G.view]} ${Ne}`,current:Fe&&ne&&q.get(`${G.view}:${G.hash}`)===G,restore:$&&!ne&&!Bv(e,G.view)?{view:G.view,hash:G.hash}:void 0}},Y=new Set,I=new Map(j.map(G=>{const ue=C.find(Ne=>!Y.has(Ne)&&Ne.how==="drawn"&&Ne.view===G.view&&Ne.ask===G.text&&Ne.at>=G.at);return ue&&Y.add(ue),[G,ue]})),F=new Map;for(const G of R)G.what==="use"&&!F.has(G.view)&&F.set(G.view,G);const O=G=>G==="portrait"?`Here is ${g} with the change. Use this, or keep the previous one. Using it redraws the views built on the face.`:`Redrew the ${xn[G]}. Use it, or keep the previous one.`,Z=G=>{const ue=G===F.get(G.view),Ne=G.view==="portrait"&&ue,ne=G.what==="again"?"Try again":G.what==="keep"?"Keep previous":Ne?"Use this person":G.view==="portrait"?"Use this":"Use it";return[{kind:"scenri",id:`asked-decided-${G.at}`,text:Ne?Jn.identity(g):ue?Jn.landed(xn[G.view]):O(G.view),quiet:!0},{kind:"you",id:`decided-${G.at}`,text:ne,editable:!1}]},V=()=>{const G=T?j.slice(0,-1):j,ue=Foe(e),Ne=a.filter(Oe=>!l.has(Oe)&&(Oe.q!==i||Oe.at<=ue));for(const Oe of Ne)l.add(Oe);const ne=C.find(Oe=>UA.includes(Oe.view)),Fe=[...G.map(Oe=>{const ot=I.get(Oe);return{at:Oe.at,turns:[{kind:"scenri",id:`asked-ask-${Oe.at}`,text:P(Oe.view),quiet:!0},{kind:"you",id:`ask-${Oe.at}`,text:Oe.text,editable:!1},...ot?[U(ot,`redrew-${Oe.at}`)]:[]]}}),...C.filter(Oe=>!Y.has(Oe)).map(Oe=>({at:Oe.at,turns:[U(Oe,`result-${Oe.at}`)]})),...R.map(Oe=>({at:Oe.at,turns:Z(Oe)})),...Ne.map(Oe=>({at:Oe.at,turns:ci(Oe)})),...Jo(e)&&(e.extras||n.extrasDeclined)?[{at:ne?ne.at.slice(0,-1):"~",turns:[{kind:"scenri",id:"asked-extras",text:Jn.extras,quiet:!0},{kind:"you",id:"extras",text:e.extras?"Add them":"Not now",editable:!1}]}]:[]];Fe.sort((Oe,ot)=>Oe.at<ot.at?-1:Oe.at>ot.at?1:0);for(const Oe of Fe)u.push(...Oe.turns)},B=()=>{!T||!N||(u.push({kind:"scenri",id:`asked-ask-${N.at}`,text:P(N.view),quiet:!0}),u.push({kind:"you",id:`ask-${N.at}`,text:N.text,editable:!1}))};if(!Jo(e)){const G=S.status==="generating"||E==="portrait"&&S.status!=="candidate";return G&&!j.length?(f("drawing-face","Drawing their face."),p?v():w(),u):(v(),V(),G?(B(),f("drawing-face",T?"Adjusting the face. Everything else stays.":"Drawing their face."),p||w(),u):n.failed?(y(),h(b(n.failed)),u):S.error?(y(),B(),h(mh("portrait",S.error)),u):(S.status==="candidate"&&(y(),B(),h({id:"identity",kind:"confirm",prompt:T?"Adjusted. Use this person, or try again.":Jn.identity(g),hint:tS("portrait",e.keepItems),options:[{id:"use",label:"Use this person"},{id:"again",label:"Try again"}],describe:"Change something"})),u))}v(),V();const K=Object.keys(e.views),ee=Qo(e),se=[...ee].reverse().find(G=>T6.has(G)),oe=ee.find(G=>!T6.has(G)),me=K.find(G=>e.views[G].status==="candidate"),ce=ee.find(G=>!!e.views[G].error);if(n.failed&&!E)return y(),h(b(n.failed,v4(fm(e)))),u;if(E)return B(),f(`drawing-${E}`,T&&(N==null?void 0:N.view)===E?`Redrawing the ${xn[E]}.`:E===se&&!e.views[E].hash?`Drawing the ${xn[E]} from this face.`:E===oe&&!e.views[E].hash&&se?`Building the rest of the set from the ${xn[se]}.`:`Drawing the ${xn[E]}.`),p||w(),u;if(me){y(),B();const G=e.views[me],ue=!!G.prior,Ne=Fe=>Fe?H.get(`${me}:${Fe}`)??0:0,ne=!!G.hash&&!!G.prior&&Ne(G.hash)<Ne(G.prior);if(G.error){const Fe=mh(me,G.error);f(`failed-${me}`,Fe.prompt,G.error==="cancelled"?void 0:"alert")}return G.hash&&u.push({kind:"scenri",id:`candidate-${me}-${G.hash}`,text:ne?`Here is ${xn[me]} ${Ne(G.hash)} again.`:G.error?`Here is the ${xn[me]} as it is.`:ue?me==="portrait"?`Here is ${g} with the change.`:`Redrew the ${xn[me]}.`:`Here is the ${xn[me]}.`,thumb:G.hash,label:dc[me],view:me,current:!0}),h({id:me==="portrait"?"revision":"view-revision",kind:"confirm",prompt:ue?me==="portrait"?`Use this, or keep the previous one.${TG(e,me)?" Using it redraws the views built on the face.":""}`:"Use it, or keep the previous one.":"Use it, or try again.",hint:me==="portrait"||me==="front"?tS(me,e.keepItems):void 0,options:[{id:"use",label:me==="portrait"?"Use this":"Use it"},...ue?[{id:"keep",label:"Keep previous"}]:[],{id:"again",label:"Try again"}]}),u}return ce?(y(),B(),h(mh(ce,e.views[ce].error??"")),u):gG(e)?!e.extras&&!n.extrasDeclined?(y(),f("set-ready","The set is ready. Select a view and say what is wrong to redraw it."),h({id:"extras",kind:"confirm",prompt:Jn.extras,noEnter:!0,options:[{id:"add",label:"Add them"},{id:"save",label:"Not now"}]}),u):p?(h({id:"save",kind:"confirm",prompt:`${_oe(g)} is ready.${Ioe(e)}`,options:[{id:"save",label:"Save presenter"}]}),u):(w(),u):(p||w(),u)}const Zoe={who:{label:"Who",options:bP},age:{label:"Age",options:xP},build:{label:"Build",options:["slender","average","athletic","fuller"].map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1)}))}},xp=e=>e.charAt(0).toUpperCase()+e.slice(1);function zoe(e){return!e||e==="skipped"?"Draw as is":Object.values(e).map(t=>xp(t)).join(", ")}function Boe(e){const t=e.map(n=>{var r;return((r=ja(n))==null?void 0:r.label)??n});return t.length?t.length===1?t[0]:`${t.slice(0,-1).join(", ")} and ${t.at(-1)}`:"Nothing distinctive"}const Uoe=e=>see(e,NP,boe),LP=(e,t)=>e.trim().slice(0,t).trimEnd(),Woe=400;function Um(e){return LP(Koe(e),Woe)}function Koe(e){var a;if(((a=e.source)==null?void 0:a.via)==="taps"){const i=hP(e),l=gc(i.who);return kP(l&&!fa(l)?{...i,who:void 0}:i)}const t=(e.describe??"").trim(),n=e.gaps&&e.gaps!=="skipped"?e.gaps:{},r=n.build?`${t.replace(/[.\s]+$/,"")}, ${n.build} build`:t;return MG({steer:n.who??null,age:n.age??null},r)}function Goe(e){return Wm(e).map(t=>t.words)}const Yoe=200,qoe=12;function Wm(e){var i,l;const t=Bae(e),n=(u,f,h)=>({id:u,words:LP(f,Yoe),...h!=null&&h.length?{refs:h.slice(0,4)}:{}}),r=[];for(const u of pP(e.traits??[])){const f=t[u],h=f?Lae(u,f):"";h&&r.push(n(u,h,f==null?void 0:f.refs))}const a=(((i=e.keep)==null?void 0:i.words)??"").trim();return a&&r.push(n("said",a,(l=e.keep)==null?void 0:l.refs)),r.slice(0,qoe)}function iS(e){const t=Goe(e);return t.length<2?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}function Xoe(e){const t=e.trim().replace(/[.\s]+$/,""),n=t.replace(/^(?:but|and|also|plus|though|although|however)\b[\s,]*/i,"");return n.replace(/^(?:he|she|they|it)\s+(?:has|have|had|has got|have got|is|are|wears?|carries)\s+/i,"")||n||t}function Qoe(e,t,n,r){const a=r.toLowerCase().split(/[^a-z0-9]+/).filter(l=>l.length>2);if(!a.length)return!0;const i=Um({...e,[t]:n}).toLowerCase();return a.every(l=>i.includes(l))}function Joe(e){const t=bp(e.setup??null);return t&&Object.keys(t.answers).length?{answers:t.answers,asides:t.asides,...t.extrasDeclined?{extrasDeclined:t.extrasDeclined}:{}}:{answers:eie(e),asides:[]}}function eie(e){const t=bp(e.setup??null);return t&&Object.keys(t.answers).length?t.answers:e.source==="photos"?{source:{door:"photos",via:"taps"},photos:{hashes:e.sources??[],attested:!0},...lS(e)}:{source:{door:"scratch",via:"typed"},describe:e.direction??"",gaps:"skipped",traits:[],...lS(e)}}function lS(e){const t=e.keepItems??[];if(!t.length)return{};const n={},r=[];let a;for(const i of t){const l=kd.find(u=>u.id===i.id);if(l){r.push(l.id),n[`trait-${l.id}`]={words:i.words,refs:i.refs??[]};continue}a={words:[a==null?void 0:a.words,i.words].filter(Boolean).join(", "),refs:[...(a==null?void 0:a.refs)??[],...i.refs??[]]}}return n.traits=r,a&&(n.keep=a),n}const $P=(e,t,n)=>({draft:e?{source:e.source,stage:e.stage,keep:e.keep,views:{portrait:{status:e.views.portrait.status}},analysis:e.analysis?{photos:e.analysis.photos}:void 0}:null,canGenerate:t,...n?{engine:n}:{}});function tie(e,t,n){var a,i;if(e==="source")return t.kind==="choice"?{source:{door:t.id,via:"taps"}}:null;if(ir(e)){const l=(a=n[e])==null?void 0:a.words,u=l?{words:l}:{};return t.kind==="swatches"?{[e]:{pick:t.picks[e.slice(5)]??Object.values(t.picks)[0],...u}}:t.kind==="skip"?{[e]:{pick:mc,...u}}:null}if(e==="gaps")return t.kind==="choices"?{gaps:t.picks}:t.kind==="skip"?{gaps:"skipped"}:null;if(e==="traits")return t.kind==="choices"?{traits:kd.map(l=>l.id).filter(l=>t.picks[l])}:t.kind==="skip"?{traits:[]}:null;const r=ls(e);if(r&&t.kind==="choice"){if(r.part==="where"){const u=(i=n[e])==null?void 0:i.words;return{[e]:{pick:t.id,...u?{words:u}:{}}}}const l=n[`trait-${r.id}`];return{[e]:{pick:t.id,...l!=null&&l.words?{words:l.words}:{},refs:(l==null?void 0:l.refs)??[]}}}return null}function nie(e,t){var r;return`the ${((r=ja(e))==null?void 0:r.label.toLowerCase())??"detail"} in the attached ${t===1?"picture":"pictures"}`}const cS="A scar, a ring, anything we missed",rie=new Set(["describe","keep"]),sie=new Set(["likeness","help","question","greeting","ack","nav","intent","go","nonsense"]);function uS(e,t){const n=(t==null?void 0:t.trim())??"";return e?n?`${e}, ${n}`:e:xp(n)}const aie=/^(?:but|and|though|although|only|just|except(?: that)?|with|without|plus)\s+/i,dS=e=>aie.test(e.trim());function T8(e){return e.trim().replace(/[.\s]+$/,"").replace(/^(?:but|and|though|although|only|just|except(?: that)?)\s+/i,"").trim()}function sf(e,t){if(!e)return!1;if(rie.has(e))return!0;if(!ir(e)&&!ls(e))return!1;const n=t[e];return!!n&&!n.pick&&!!n.words}function gh(e,t,n){const r=t.trim();return r?e==="look-age"&&SG(r)?null:e!=="look-who"&&(ir(e)||e.startsWith("trait-"))&&bG(r)?"nonsense":ir(e)||e.startsWith("trait-")||e==="keep"?iie(r,n):e==="describe"||e==="source"?Ko(r,n):null:"vague"}function D8(e,t,n){if(e&&ir(e))return"look";if(e==="keep"||e!=null&&e.startsWith("trait-"))return"detail";const r=e??t;if(r&&ir(r))return"look";if(r!=null&&r.startsWith("trait-"))return"detail";switch(r){case"source":return"source";case"describe":case"gaps":return"describe";case"name":return"name";case"traits":return"detail";default:return n?"refine":"describe"}}const fS=new Set(["who","age","hair","colour","color","length","cut","skin","build","body","name","look","style","face","person","presenter","glasses","scar","scars","tattoo","piercing","makeup","freckles","prosthetic"]),oie=/^[a-z]{1,10}\d+$/i,iie=(e,t)=>{const n=e.trim(),r=n.toLowerCase().replace(/[^a-z ]/g,"");if(fS.has(r)||fS.has(r.replace(/^(the|their|its|his|her)\s+/,"")))return"nonsense";const a=n.split(/\s+/).filter(Boolean);if(a.length<=2&&a.some(l=>oie.test(l)))return"nonsense";const i=Ko(e,t);return i&&sie.has(i)?i:null};function lie(e,t){return e==="name"?"metadata":t?e==="source"||e==="photos"?"start-over":"redraw":"plain"}function hS(e,t,n,r){var f,h,p,g,v,w,b,y,k;const a=t.answers,i=r?{reopened:!0,cost:Poe(fP(a,n).filter(S=>S!=="keep"&&nf(S)>nf(e)).length)}:{};switch(e){case"source":return{id:e,kind:"choice",prompt:Jn.source,options:NP,given:(f=a.source)==null?void 0:f.door,...i};case"weakphotos":return{id:e,kind:"confirm",prompt:Jn.weakPhotos,noEnter:!0,options:[{id:"again",label:"Use different photos"},{id:"anyway",label:"Draw from these anyway"}]};case"photos":{const S=a.photos??{hashes:[],attested:!1};return{id:e,kind:"photos",prompt:Jn.photos,hint:Moe(S.hashes.length,N0),hashes:S.hashes,max:N0,busy:t.uploading>0,attest:{text:MP(n.engine),checked:S.attested},submit:"Continue",back:"Describe someone instead"}}case"describe":return{id:e,kind:"text",prompt:Jn.describe,starters:xoe};case"gaps":{const S=Kw(a.describe??"");return{id:e,kind:"choice",prompt:RP(S.length),groups:S.map(E=>({id:E,...Zoe[E]})),submit:"Continue",skip:"Skip, draw as is",given:a.gaps&&a.gaps!=="skipped"?a.gaps:void 0,...i}}case"traits":{const S=((h=a.source)==null?void 0:h.door)==="photos";return{id:e,kind:"choice",prompt:S?Jn.traitsPhotos:Jn.traits,multi:!0,options:kd.map(E=>({id:E.id,label:E.label})),submit:"Continue",skip:S?"Nothing to add":"Nothing else",given:a.traits,...i}}case"keep":return{id:e,kind:"text",prompt:Jn.keep}}if(ir(e)){const S=e.slice(5),{row:E,prompt:j}=Uf[S],N=soe((p=a["look-who"])==null?void 0:p.pick),A=aoe.has(S)?{...E,options:E.options.map(T=>T.card?{...T,card:`${T.card}-${N}`}:T)}:E;return{id:e,kind:"swatches",prompt:j,hint:S==="who"?Jn.lookHint:void 0,row:A,skip:"Skip",describe:S==="who"?"Describe them instead":void 0,saying:t.saying===e,given:((g=a[e])==null?void 0:g.pick)===mc||(v=a[e])==null?void 0:v.pick,skipped:((w=a[e])==null?void 0:w.pick)===mc,note:(b=a[e])==null?void 0:b.words,...i}}const l=ls(e),u=l?ja(l.id):void 0;if(l&&u&&l.part==="where"&&u.where)return{id:e,kind:"choice",prompt:u.where.ask,options:u.where.options.map(S=>({id:S.id,label:S.label})),saying:t.saying===e,given:(y=a[e])==null?void 0:y.pick,note:(k=a[e])==null?void 0:k.words,...i};if(l&&u){const S=a[`trait-${l.id}`];return{id:e,kind:"choice",prompt:u.ask,hint:u.hint,options:u.options.map(E=>({id:E.id,label:E.label,card:E.card})),attach:S!=null&&S.refs.length?"Replace the reference":"Add a reference",saying:t.saying===e,given:S==null?void 0:S.pick,note:S==null?void 0:S.words,...i}}return{id:e,kind:"text",prompt:""}}function pS(e,t){var a,i,l;switch(e){case"source":return Jn.source;case"photos":return Jn.photos;case"describe":return((a=t.source)==null?void 0:a.via)==="typed"?Jn.source:Jn.describe;case"gaps":return RP(Kw(t.describe??"").length);case"traits":return((i=t.source)==null?void 0:i.door)==="photos"?Jn.traitsPhotos:Jn.traits;case"keep":return Jn.keep}if(ir(e))return Uf[e.slice(5)].prompt;const n=ls(e),r=n?ja(n.id):void 0;return!n||!r?"":n.part==="where"?((l=r.where)==null?void 0:l.ask)??"":r.ask}function cie(e,t,n){var u,f,h,p,g,v,w;switch(e){case"source":return{text:((u=t.source)==null?void 0:u.door)==="photos"?"Add photos":"Describe someone"};case"photos":{const b=(n==null?void 0:n.sources)??((f=t.photos)==null?void 0:f.hashes)??[];return{text:Noe(b.length),photos:b}}case"describe":return{text:(t.describe??"").trim()};case"gaps":return{text:zoe(t.gaps)};case"traits":return{text:Boe(pP(t.traits??[]))};case"keep":return{text:(((h=t.keep)==null?void 0:h.words)??"").trim(),photos:(p=t.keep)==null?void 0:p.refs}}if(ir(e)){const b=e.slice(5);return{text:loe(Uf[b].row,t[e]??{})}}const r=ls(e),a=r?ja(r.id):void 0;if(!r||!a)return{text:""};if(r.part==="where"){const b=t[e]??{},y=b.pick?((v=(g=a.where)==null?void 0:g.options.find(k=>k.id===b.pick))==null?void 0:v.label)??xp(b.pick):"";return{text:uS(y,b.words)}}const i=t[`trait-${r.id}`],l=i!=null&&i.pick?((w=a.options.find(b=>b.id===i.pick))==null?void 0:w.label)??xp(i.pick):"";return{text:uS(l,i==null?void 0:i.words),photos:i!=null&&i.refs.length?i.refs:void 0}}function uie(e){const t=e.state.asides,n=t.length?MM(mS(e,[],null)):null;return mS(e,t,n)}const TP=(e,t)=>e.at<t.at?-1:e.at>t.at?1:0,kp=(e,t)=>rf(e.editing)&&uoe(e.editing)===t.at;function mS(e,t,n){const r=new Set,a=die(e,t,n,r),i=a.length&&a[a.length-1].kind==="question"?a.pop():null,l=t.filter(f=>!r.has(f)).sort(TP),u=e.state.unsure;for(const f of l)(!u||f.at<u.at)&&a.push(...ci(f,kp(e.state,f)));if(i&&a.push(i),u){a.push({kind:"you",id:`unsure-${u.at}`,text:u.said,editable:!1}),a.push({kind:"question",question:{id:"unsure",kind:"confirm",quiet:!0,prompt:Roe,options:[{id:"use",label:"Use it anyway"}]}});for(const f of l)f.at>=u.at&&a.push(...ci(f,kp(e.state,f)))}return a}function die({state:e,draft:t,canGenerate:n,engine:r,failed:a,failedView:i,awaiting:l},u,f,h){var P,C,R,$;const p=$P(t,n,r),g=e.answers,v=[{kind:"you",id:"intent",text:"Create a presenter"}],w=[],b=((P=g.source)==null?void 0:P.door)==="photos",y=(H,D,q=!1)=>{const _=u.filter(U=>!h.has(U)&&!!U.q&&U.q!==f&&D.includes(U.q)&&!!U.after===q).sort(TP);for(const U of _)h.add(U),H.push(...ci(U,kp(e,U)))},k=H=>u.find(D=>D.edit&&D.q===H&&!h.has(D)),S=(H,D,q=!0)=>{var U;if(H.push({kind:"scenri",id:`asked-${D}`,text:pS(D,g),quiet:!0}),y(H,D==="describe"&&((U=g.source)==null?void 0:U.via)==="typed"?["source","describe"]:[D]),!q){const Y=k(D);Y&&(h.add(Y),H.push({kind:"you",id:D,text:Y.said}),H.push(...ci(Y,kp(e,Y),!0))),y(H,[D],!0);return}const _=cie(D,g,t);H.push({kind:"you",id:D,text:_.text,photos:_.photos,editable:!0,editing:e.editing===D&&sf(D,g)||void 0}),y(H,[D],!0)},E=new Set(fP(g,p)),j=Zae.filter(H=>E.has(H)||u.some(D=>D.edit&&D.q===H));for(const H of j){const D=b&&t&&H!=="source"&&H!=="photos"?w:v;if(e.editing===H&&!sf(H,g)){D.push({kind:"scenri",id:`asked-${H}`,text:pS(H,g),quiet:!0}),y(D,[H]),D.push({kind:"question",question:hS(H,e,p,!0)}),y(D,[H],!0);continue}H==="source"&&((C=g.source)==null?void 0:C.via)==="typed"||S(D,H,E.has(H))}let N=null;if(((R=g.source)==null?void 0:R.door)==="scratch"&&!n&&!t)N={id:"noengine",kind:"confirm",quiet:!0,prompt:"Describing someone needs image generation, which is not set up yet.",options:[{id:"setup",label:"Set up"},{id:"photos",label:"Add photos instead"}]};else{const H=zm(g,p);H?N=hS(H,e,p,!1):!t&&(($=g.source)==null?void 0:$.door)==="scratch"&&(g.source.via==="taps"?N={id:"agree",kind:"confirm",prompt:Jn.agree,quote:`${coe(hP(g))}${iS(g)?`, and always ${iS(g)}`:""}.`,options:[{id:"draw",label:"Draw the presenter"}]}:a&&(N={id:"retry",kind:"confirm",tone:"alert",prompt:`That did not go through: ${a}. Nothing was drawn.`,options:[{id:"retry",label:"Retry"}]}))}if(l&&(N=null),!t)return N&&v.push({kind:"question",question:N}),v;const A=Voe({draft:t,canGenerate:n,ui:{extrasDeclined:e.extrasDeclined,failed:a,failedView:i,editingName:e.editing==="name"},afterCoverage:w,asides:u,openId:f,placed:h}),T=[...v,...N?A.filter(H=>H.kind!=="question"):A];return N&&T.push({kind:"question",question:N}),T}function DP(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind==="question")return n.question;if(!ip(n))return null}return null}function fie(e,t,n){return e.some(r=>r.kind==="scenri"&&(r.id==="reading"||r.id.startsWith("drawing-")))?!1:(t==null?void 0:t.stage)==="analyzing"?`Reading ${AP(t.source)}`:t!=null&&t.activeView?"Drawing":n}const lo={placeholder:"Nothing to type yet",label:"Message",action:"Send"},gS=(e,t)=>({placeholder:t?roe[e]??"In your words":rS.has(e)?"Tap a swatch above, or say the colour":"Pick one above, or describe it",label:"Describe it",action:"Send",color:rS.has(e)});function vS(e,t){const n=ls(e),r=n?ja(n.id):void 0,a=(n==null?void 0:n.part)==="where"?"Where it is, in your words":(r==null?void 0:r.saying)??"What it looks like",i=(n==null?void 0:n.part)==="where"?"Pick one above, or say where it is":`Pick one above, or ${((r==null?void 0:r.saying)??"describe it").toLowerCase()}`;return{placeholder:t?a:i,label:(r==null?void 0:r.saying)??"Describe it",action:"Send"}}function HP(e,t,n){var a;const r=e.trim();return!!t&&!((a=t.name)!=null&&a.trim())&&n!=="name"&&/^[A-Z][a-z]+(?:\s[A-Z][a-z]+)?$/.test(r)&&!fa(r)}function hie(e,t,n,r){const a=pie(e,t,n,r);return a.action==="Refine"&&!a.off&&HP(t.text,n,(e==null?void 0:e.id)??null)?{...a,label:"Their name",action:"Send"}:a}function pie(e,t,n,r){if(t.editing!==null&&(t.editing==="name"||rf(t.editing)||sf(t.editing,t.answers)))return{...lo,off:"Finish the change above."};if(t.saying==="keep")return{placeholder:cS,label:"What should stay the same about them",action:"Send"};if(t.saying&&ir(t.saying))return gS(t.saying.slice(5),!0);if(t.saying)return vS(t.saying,!0);if(t.editing!==null)return{...lo,off:"Finish the change above."};if(e){if(ir(e.id))return gS(e.id.slice(5),!1);if(e.id.startsWith("trait-"))return vS(e.id,!1);switch(e.id){case"source":return{placeholder:"Describe them, or choose above",label:"Describe them",action:"Send"};case"describe":case"unsure":return{placeholder:"Describe them",label:"Describe them",action:"Send"};case"name":return{placeholder:"Their name",label:"Their name",action:"Send"};case"identity":return{placeholder:"What should change? Shorter hair, older",label:"What should change",action:"Refine"};case"agree":return{placeholder:cS,label:"Anything else that is always true of them",action:"Send"};case"traits":return{placeholder:"Tap any above, or say it in your own words",label:"Anything else that is always true of them",action:"Send"};case"gaps":return{placeholder:"Pick one above, or say it in your own words",label:"Fill in what is missing",action:"Send"};case"photos":return{...lo,off:"Add their photos above."};case"noengine":return{...lo,off:"Set up image generation, or add photos."};case"blind":return{...lo,off:"Decide above."};case"retry":return{...lo,off:"Retry above."}}}return n?n.stage==="analyzing"?{...lo,off:`Reading ${n.source==="photos"?"the photos":"the face"}.`}:fc(n)?Jo(n)?{placeholder:wS(r,n),label:"What should change",action:"Refine",off:""}:{...lo,off:""}:Jo(n)?{placeholder:wS(r,n),label:"What should change",action:"Refine"}:{...lo,off:"The face comes first."}:{...lo,off:"Starting the draft."}}function wS(e,t){var r;const n=((r=t.name)==null?void 0:r.trim())||"them";return e==="portrait"?`What should change about ${n}?`:`Change this view: ${xn[e]}`}function yS(e,t){return e.saying?e.saying:t&&Ys(t.id)&&(t.id==="source"||t.id==="describe")||t&&Ys(t.id)&&(ir(t.id)||t.id.startsWith("trait-"))?t.id:(t==null?void 0:t.id)==="agree"?"keep":(t==null?void 0:t.id)==="name"?"name":null}const mie=/\b(here|in this (view|one|picture|image|frame)|this (view|one|picture|image|frame))\b/i,gie=/\b(looks? like|doesn'?t look|does not look|not (her|him|them)|drift(s|ed|ing)?|wrong|\boff\b|different person|someone else|regenerate|redraw|again)\b/i,vie=/\b(dress|gown|outfit|wearing|wear|jacket|coat|suit|shirt|t-shirt|tee|hoodie|jeans|trousers|skirt|shoes|heels|sneakers|boots|hat|cap|sunglasses|jewell?ery|necklace|earrings|watch|holding|holds?|product|bottle|perfume|bag|handbag|phone|laptop|scene|beach|paris|london|tokyo|street|rooftop|office|kitchen|cafe|city|forest|desert|snow|rain|sunset|sunrise|golden hour|background|backdrop|lighting|campaign|shoot)\b/i,wie=/\b(simpler|plainer|plain|neutral|cleaner|tidier)\b/i,yie=/\b(outfit|clothes|clothing|top|wardrobe|wearing)\b/i;function OP(e,t,n){const r=e.trim();if(!r)return{blocked:"Say what should change."};if(vie.test(r)&&!(wie.test(r)&&yie.test(r)))return{scope:"out-of-scope"};const a=XA.test(r),i=gie.test(r),l=mie.test(r),u=n.source==="photos";if(t==="portrait")return u?{blocked:"Their photos define who they are. Change a drawn view instead."}:{scope:"identity",view:"portrait"};if(a&&i&&!l)return u?{scope:"view",view:t}:{scope:"ambiguous"};if(a&&!l)return u?{blocked:"Their photos define who they are. Change a drawn view instead."}:{scope:"identity",view:"portrait"};const f=n.views[t];return f.origin==="photo"?{blocked:"Your photo stands as it is. Pick a drawn view to change."}:f.status!=="approved"&&f.status!=="candidate"?{blocked:`Nothing drawn for the ${xn[t]} yet.`}:{scope:"view",view:t}}const IP=e=>`Use Create for wardrobe, products and scenes. Edits here change who ${e} is.`;function bie(e,t,n,r){const a=e.trim(),i=t==="portrait"?"Describe a change to who they are.":"Say what is wrong with this view, or describe a change to who they are.";if(!a){const u=n.views[t];return t!=="portrait"&&u.origin==="photo"?{chip:null,hint:"Your photo stands as it is. Pick a drawn view to change."}:{chip:null,hint:i}}const l=OP(a,t,n);return"blocked"in l?{chip:null,hint:l.blocked,tone:"alert"}:l.scope==="out-of-scope"?{chip:null,hint:IP(r),tone:"alert"}:l.scope==="ambiguous"?{chip:null,hint:"This reads as the view or the person. Send it and I will ask which."}:l.scope==="identity"?{chip:{view:"portrait",label:"Changing the person"},hint:"Changes the person. The other views are redrawn after you use it."}:{chip:{view:l.view,label:`Refining the ${xn[l.view]}`},hint:"Changes this view only. Hair, skin, age or build change the person."}}const xie=e=>e.replace(/^asset:/,"");function Jw(e,t){if((e.identityEdits??[]).join(`
107
+ `)!==(t.identityEdits??[]).join(`
108
+ `))return!0;const r=t.shots.some(i=>i.angle==="portrait"&&i.file),a=new Map(t.shots.map((i,l)=>[!r&&l===0?"portrait":i.angle??"",xie(i.file)]));for(const i of Qo(e)){const l=e.views[i];if(l.status==="candidate"||l.status==="stale"||l.prior)return!0;const u=a.get(i);if(l.status==="approved"&&l.hash&&l.hash!==u||l.status==="empty"&&u)return!0}return!1}function bS(e,t){var n,r;return!Jw(e,t)&&!e.activeView&&e.stage==="idle"&&!((n=e.asks)!=null&&n.length)&&(e.results??[]).every(a=>{var i;return((i=e.views[a.view])==null?void 0:i.hash)===a.hash})&&!((r=e.decisions)!=null&&r.length)}const xS=(e,t)=>t==="cancelled"?{text:`Stopped drawing the ${xn[e]}. Nothing finished was touched.`,stopped:!0}:{...Bm(`The ${xn[e]} could not be drawn`,t,Qw(e)),stopped:!1},kie=e=>mG.filter(t=>e.views[t].status==="empty"&&t!=="portrait"),Sie=e=>e.length<=2?e.map(t=>xn[t]).join(" and "):`${e.slice(0,-1).map(t=>xn[t]).join(", ")} and ${xn[e[e.length-1]]}`,Eie={building:!1,buildDeclined:!1,scopeAsk:null,failed:null,conflict:null},Cie="Say what should change: hair, age or build change the person; anything else changes the view on the stage.",jie="Still here. Select a view and say what is wrong with it, or say what should change about them.";function Aie(e,t,n){const r=`select a view and say what is wrong with it, or say what should change about ${t}`;switch(e){case"likeness":return"Describe the change by looks. Scenri does not draw a named person.";case"help":case"question":return`This is where ${t} is changed: ${r}.`;case"nav":return"Discard changes is at the top, and Save changes keeps what you did.";case"go":case"intent":return`Nothing changes until it is said what: ${r}.`;case"nonsense":return`That does not say what should change. ${r.charAt(0).toUpperCase()}${r.slice(1)}.`;default:return n?jie:Cie}}const Wl={opening:e=>`What would you like to change about ${e}? Select a view to work on it, or describe a change to who they are.`,scope:"Apply this to:",change:"What should change?",saved:"Save changes when you are done."};function Nie(e){const t=e.ui.asides??[],n=t.length?MM(kS(e,[],null)):null;return kS(e,t,n)}function kS({draft:e,base:t,name:n,selected:r,canGenerate:a,ui:i},l,u){var we;const f=[{kind:"scenri",id:"opening",text:Wl.opening(n)}],h=new Set,p=()=>{for(const G of l)h.has(G)||f.push(...ci(G));return f},g=(G,ue,Ne)=>{Ne&&f.push({kind:"scenri",id:`asked-${G}`,text:Ne}),f.push({kind:"you",id:G,text:ue,editable:!1})},v=(G,ue,Ne)=>f.push({kind:"scenri",id:G,text:ue,tone:Ne}),w=G=>f.push({kind:"question",question:G});if(!e)return p();const b=kie(e),y=e.source!=="synthetic"||!!((we=e.direction)!=null&&we.trim()),k=Qo(e).some(G=>e.views[G].status==="candidate");if(b.length&&y&&!k&&!i.building&&!i.buildDeclined&&!fc(e)&&a){const G=Qo(e).filter(ue=>e.views[ue].status==="approved").length;return w({id:"legacy",kind:"confirm",prompt:`${n} has ${G===1?"one reference":`${G} references`}. Build the ${Sie(b)} from it?`,options:[{id:"build",label:"Build them"},{id:"not",label:"Not now"}]}),p()}const S=Qo(e),E=e.activeView,j=S.find(G=>e.views[G].status==="candidate"),N=S.find(G=>!!e.views[G].error),A=(t==null?void 0:t.identityEdits)??[];(e.identityEdits??[]).filter(G=>!A.includes(G)).forEach((G,ue)=>{g(`edit-${ue}`,G,Wl.change),v(`changed-${ue}`,`Changed ${n}. The views built on the face were redrawn.`)});const P=e.asks??[],C=P[P.length-1],R=C?e.views[C.view]:null,$=!!C&&!!R&&(R.status==="generating"&&e.activeView===C.view||R.status==="candidate"&&R.adjustment===C.text||!!R.error),H=new Set((e.identityEdits??[]).map(G=>G.toLowerCase())),D=($?P.slice(0,-1):P).filter(G=>!(G.view==="portrait"&&H.has(G.text.replace(/\s+/g," ").toLowerCase()))),q=[...P,...e.results??[],...e.decisions??[]].map(G=>G.at).reduce((G,ue)=>ue>G?ue:G,""),_=l.filter(G=>!h.has(G)&&(G.q!==u||G.at<=q));for(const G of _)h.add(G);const U=(e.results??[]).filter(G=>G.how!=="restored"),Y=!e.activeView&&e.stage==="idle",I=new Map,F=new Map,O=new Map;for(const G of U){const ue=`${G.view}:${G.hash}`;if(O.set(ue,G),I.has(ue))continue;const Ne=(F.get(G.view)??0)+1;F.set(G.view,Ne),I.set(ue,Ne)}const Z=G=>I.get(`${G.view}:${G.hash}`)??1,V=(G,ue)=>{const Ne=Z(G),ne=e.views[G.view].hash===G.hash,Fe=(F.get(G.view)??0)>1;return{kind:"scenri",id:ue,text:`Here is ${xn[G.view]} ${Ne}.`,thumb:G.hash,view:G.view,label:`${dc[G.view]} ${Ne}`,current:Fe&&ne&&O.get(`${G.view}:${G.hash}`)===G,restore:Y&&!ne?{view:G.view,hash:G.hash}:void 0}},B=new Set,K=new Map(P.map(G=>{const ue=U.find(Ne=>!B.has(Ne)&&Ne.how==="drawn"&&Ne.view===G.view&&Ne.ask===G.text&&Ne.at>=G.at);return ue&&B.add(ue),[G,ue]})),ee=(e.decisions??[]).filter(G=>!(G.view==="portrait"&&G.what==="use")),se=G=>[{kind:"scenri",id:`asked-decided-${G.at}`,text:G.view==="portrait"?`Here is ${n} with the change. Use this, or keep the previous one. Using it redraws the views built on the face.`:`Redrew the ${xn[G.view]}. Use it, or keep the previous one.`},{kind:"you",id:`decided-${G.at}`,text:G.what==="again"?"Try again":G.what==="keep"?"Keep previous":"Use it",editable:!1}],oe=[...D.map(G=>{const ue=K.get(G);return{at:G.at,turns:[{kind:"scenri",id:`asked-ask-${G.at}`,text:Wl.change},{kind:"you",id:`ask-${G.at}`,text:G.text,editable:!1},...ue?[V(ue,`redrew-${G.at}`)]:[]]}}),...U.filter(G=>!B.has(G)).map(G=>({at:G.at,turns:[V(G,`result-${G.at}`)]})),...ee.map(G=>({at:G.at,turns:se(G)})),..._.map(G=>({at:G.at,turns:ci(G)}))];oe.sort((G,ue)=>G.at<ue.at?-1:G.at>ue.at?1:0);for(const G of oe)f.push(...G.turns);if(i.scopeAsk)return g("scope-ask",i.scopeAsk.said),w({id:"scope",kind:"choice",prompt:Wl.scope,options:[{id:"view",label:`This view (the ${xn[r]})`},{id:"identity",label:"The presenter"}]}),p();const me=()=>{$&&C&&g(`ask-${C.at}`,C.text,Wl.change)};if(E){const G=e.views[E];return me(),v(`drawing-${E}`,$&&(C==null?void 0:C.view)===E?E==="portrait"?`Changing ${n}. Everything else stays.`:`Redrawing the ${xn[E]}.`:G.status==="stale"||S.some(ue=>e.views[ue].status==="stale")?`Redrawing the views built on the face. The ${xn[E]} first.`:`Drawing the ${xn[E]}.`),p()}if(j){me();const G=e.views[j];if(G.error){const ue=xS(j,G.error);v(`failed-${j}`,ue.text,ue.stopped?void 0:"alert")}return G.hash&&f.push({kind:"scenri",id:`candidate-${j}-${G.hash}`,text:G.error?`Here is the ${xn[j]} as it is.`:j==="portrait"?`Here is ${n} with the change.`:`Redrew the ${xn[j]}.`,thumb:G.hash,label:dc[j],view:j,current:!0}),w({id:j==="portrait"?"revision":"view-revision",kind:"confirm",prompt:j==="portrait"?"Use this, or keep the previous one. Using it redraws the views built on the face.":"Use it, or keep the previous one.",options:[{id:"use",label:j==="portrait"?"Use this":"Use it"},{id:"keep",label:"Keep previous"},{id:"again",label:"Try again"}]}),p()}if(i.failed||N){me();const G=N?xS(N,e.views[N].error??""):{...Bm("That did not go through",i.failed??""),stopped:!1};return w({id:"retry",kind:"confirm",...G.stopped?{quiet:!0}:{tone:"alert"},prompt:G.text,options:[...G.remedy?[{id:`remedy:${G.remedy.opens}`,label:G.remedy.label}]:[],{id:"retry",label:G.stopped?"Draw it again":"Retry"}]}),p()}if(i.conflict)return w({id:"conflict",kind:"confirm",tone:"alert",prompt:`${n} changed in another tab. Reload to continue.`,options:[{id:"reload",label:"Reload"}]}),p();const ce=S.find(G=>e.views[G].status==="stale");return ce?(v(`drawing-${ce}`,`Redrawing the views built on the face. The ${xn[ce]} first.`),p()):(t&&Jw(e,t)&&w({id:"save",kind:"confirm",prompt:`The set is coherent. ${Wl.saved}`,options:[{id:"save",label:"Save changes"}]}),p())}function Mie(e,t,n){return!(!n||t.id!==n||e&&e.id===t.id&&t.updatedAt<e.updatedAt)}function FP(e,t){const[n,r]=s.useState(null),[a,i]=s.useState(!1),[l,u]=s.useState(null),[f,h]=s.useState(null),[p,g]=s.useState(!1),v=s.useRef(!0);s.useEffect(()=>(v.current=!0,()=>{v.current=!1}),[]);const w=s.useRef(t);w.current=t;const b=s.useCallback(Y=>{v.current&&r(I=>Mie(I,Y,w.current)?Y:I)},[]),y=s.useRef(!1);s.useEffect(()=>{r(null),i(!1),u(null),y.current=!1,g(!1)},[t]);const k=s.useCallback(async()=>{if(!t)return;const Y=t;try{b(await je.presenterDraft(e,Y)),y.current&&v.current&&w.current===Y&&(y.current=!1,u(null))}catch(I){if(!v.current||w.current!==Y)return;/HTTP 404|not found/i.test(String((I==null?void 0:I.message)??I))?i(!0):(y.current=!0,h(null),u(String((I==null?void 0:I.message)??I)))}},[e,t,b]);s.useEffect(()=>{k()},[k]);const S=!!n&&(n.stage!=="idle"||!!n.activeView);s.useEffect(()=>{if(!S)return;const Y=setInterval(()=>void k(),1500);return()=>clearInterval(Y)},[S,k]);const E=s.useCallback(async(Y,I=null)=>{const F=w.current;g(!0),u(null),y.current=!1;try{return b(await Y()),!0}catch(O){return!v.current||w.current!==F?!1:(O==null?void 0:O.status)===409?(k(),!1):(y.current=!1,h(I),u(String((O==null?void 0:O.message)??O)),!1)}finally{v.current&&g(!1)}},[b,k]),j=s.useCallback((Y,I,F)=>E(async()=>(await je.generateDraftView(e,t??"",Y,{...I?{adjustment:I}:{},...F?{decide:F}:{}})).draft,Y),[E,e,t]),N=s.useCallback(Y=>E(()=>je.approveDraftView(e,t??"",Y)),[E,e,t]),A=s.useCallback(Y=>E(()=>je.redoDraftView(e,t??"",Y)),[E,e,t]),T=s.useRef(!1),P=s.useCallback(async Y=>{if(T.current)return!1;T.current=!0;try{return await E(Y)}finally{T.current=!1}},[E]),C=s.useCallback(Y=>P(()=>je.revertDraftView(e,t??"",Y)),[P,e,t]),[R,$]=s.useState(!1),H=s.useCallback(async()=>{$(!0);try{return await E(()=>je.stopDraft(e,t??""))}finally{v.current&&$(!1)}},[E,e,t]),D=s.useCallback((Y,I)=>P(()=>je.restoreDraftView(e,t??"",Y,I)),[P,e,t]),q=s.useCallback((Y,I)=>E(()=>je.placeDraftPhoto(e,t??"",Y,I)),[E,e,t]),_=s.useCallback(Y=>E(()=>je.updatePresenterDraft(e,t??"",Y)),[E,e,t]),U=s.useCallback(()=>{y.current=!1,u(null)},[]);return{draft:n,gone:a,err:l,errView:f,busy:p,drawing:S,reload:k,generate:j,approve:N,redo:A,revert:C,stop:H,stopping:R,restore:D,placePhoto:q,update:_,clearErr:U}}function Rie({presenterId:e,onLeave:t,caps:n}){var Ye,ke;const{brand:r}=dn(),{applyBrand:a,refreshBrands:i}=Hn(),l=vl(),u=gl(),f=Vr("setup").value,h=Vr("settings").value,p=!!f||!!h,g=!!(n!=null&&n.canGenerate),[v,w]=s.useState(null),[b,y]=s.useState(null),[k,S]=s.useState(Eie),[E,j]=s.useState(""),[N,A]=s.useState(null),[T,P]=s.useState(!1),[C,R]=s.useState(null),[$,H]=s.useState(!1),[D,q]=s.useState(!1),_=s.useRef(new Set),U=(((Ye=r.json)==null?void 0:Ye.characters)??[]).find(te=>te.id===e),Y=((ke=U==null?void 0:U.name)==null?void 0:ke.trim())||"them",I=U?{shots:U.shots??[],identityEdits:U.identityEdits??[]}:null;s.useEffect(()=>{let te=!0;return w(null),y(null),je.editPresenter(r.id,e).then(le=>{te&&w(le.id)}).catch(le=>{te&&y(String((le==null?void 0:le.message)??le))}),()=>{te=!1}},[r.id,e]);const F=FP(r.id,v),O=F.draft,Z=O?`presenter-edit:${r.id}:${e}:${O.id}`:void 0,V=!0;s.useEffect(()=>{if(!O||F.busy||!g||F.err)return;const te=KA(O);if(!te||O.views[te].status==="empty"&&!k.building)return;const le=`${te}:${O.views[te].attempts}:${O.generations}:${O.views[te].status}`;_.current.has(le)||(_.current.add(le),F.generate(te,void 0,Zo(te)))},[O,F.busy,F.generate,g,F.err,k.building]);const B=O?GA(O,N):"portrait",K=O?O.views[B]:null,ee=!!O&&(O.activeView===B||O.stage==="analyzing"),se=!!O&&!O.activeView&&O.stage==="idle",oe=F.err&&O&&!O.activeView?F.err:null,me=s.useMemo(()=>Nie({draft:O,base:I,name:Y,selected:B,canGenerate:g,ui:{...k,failed:oe}}),[O,I,Y,B,g,k,oe]),ce=DP(me),we=!!O&&!!I&&Jw(O,I),G=!!O&&!!I&&bS(O,I),ue=s.useCallback(te=>{Z&&Wi(Z),t(te)},[Z,t]),Ne=s.useCallback(async()=>{if(!(!O||$)){H(!0),R(null);try{const te=await je.savePresenterDraft(r.id,O.id);ue(te.presenter.id),a(te.brand)}catch(te){H(!1);const le=String((te==null?void 0:te.message)??te);/changed elsewhere|HTTP 409/i.test(le)?S(Me=>({...Me,conflict:le})):R(le)}}},[O,$,r.id,a,ue]),ne=s.useCallback(async()=>{q(!0);try{O&&await je.deletePresenterDraft(r.id,O.id)}catch{}ue(e)},[O,r.id,e,ue]),Fe=s.useCallback(async()=>{if(!(!O||!I)){q(!0);try{bS(await je.presenterDraft(r.id,O.id),I)&&await je.deletePresenterDraft(r.id,O.id)}catch{}ue(e)}},[O,I,r.id,e,ue]),Oe=s.useCallback(async()=>{q(!0);try{const te=await je.revertPresenter(r.id,e);O&&await je.deletePresenterDraft(r.id,O.id).catch(()=>{}),ue(te.presenter.id),a(te.brand)}catch(te){q(!1),R(String((te==null?void 0:te.message)??te))}},[r.id,e,O,a,ue]),ot=s.useCallback((te,le)=>{var Me;if(R(null),!!O)switch(te){case"legacy":if(le.kind!=="confirm")return;S(ze=>({...ze,building:le.id==="build",buildDeclined:le.id!=="build"}));return;case"scope":{if(le.kind!=="choice")return;const ze=((Me=k.scopeAsk)==null?void 0:Me.said)??"";S(Re=>({...Re,scopeAsk:null})),le.id==="identity"?F.generate("portrait",ze):F.generate(B,ze,Zo(B)),A(le.id==="identity"?"portrait":B);return}case"revision":case"view-revision":{if(le.kind!=="confirm")return;const ze=Object.keys(O.views).find(Re=>O.views[Re].status==="candidate")??B;le.id==="use"&&F.approve(ze),le.id==="keep"&&F.revert(ze),le.id==="again"&&F.generate(ze,O.views[ze].adjustment,Zo(ze)),P(!1);return}case"retry":{if(le.kind==="confirm"&&le.id.startsWith("remedy:")){const Re=le.id.slice(7);Re==="setup"?l():u(Re);return}if(F.err){F.clearErr(),_.current=new Set;return}const ze=Object.keys(O.views).find(Re=>!!O.views[Re].error);ze&&F.generate(ze,O.views[ze].adjustment,Zo(ze));return}case"conflict":S(ze=>({...ze,conflict:null})),q(!0),Promise.all([i(),je.deletePresenterDraft(r.id,O.id).catch(()=>{})]).finally(()=>ue(e));return;case"save":Ne();return}},[O,k.scopeAsk,F,B,Ne,i,ue,e,r.id,l,u]),Xe=s.useCallback(te=>{const le=te.trim();if(!le||!O)return!1;R(null);const Me=(ce==null?void 0:ce.id)??null,ze=lp(),Re=(_e,zt)=>({..._e,asides:[..._e.asides??[],{said:le,reply:zt,q:Me,at:ze}]}),Be=_e=>_e.scopeAsk?{..._e,scopeAsk:null,asides:[..._e.asides??[],{said:_e.scopeAsk.said,reply:Wl.scope,q:"scope",at:_e.scopeAsk.at}]}:_e,Qe=Ko(le,fa);if(Qe&&Qe!=="vague")return S(_e=>Re(_e,Aie(Qe,Y,(_e.asides??[]).some(zt=>zt.q===Me)))),j(""),!0;if(!g)return R("Image generation is not set up, so nothing can be redrawn yet."),!1;const rt=OP(le,B,O);return"blocked"in rt?(R(rt.blocked),!1):rt.scope==="out-of-scope"?(S(_e=>Re(Be(_e),IP(Y))),j(""),!0):rt.scope==="ambiguous"?(S(_e=>({...Be(_e),scopeAsk:{said:le,at:ze}})),j(""),!0):(S(_e=>Be(_e)),A(rt.view),P(!1),F.generate(rt.view,le,rt.scope==="view"?Zo(rt.view):void 0),j(""),!0)},[O,g,B,F,ce==null?void 0:ce.id,Y]),X=O?bie(E,B,O,Y):null,J=X?{chip:X.chip?{label:X.chip.label,thumb:O!=null&&O.views[X.chip.view].hash?hn(O.views[X.chip.view].hash,"micro"):void 0}:null,hint:X.hint,tone:X.tone}:null,ge=T&&(K!=null&&K.prior)?K.prior:K==null?void 0:K.hash,ve=O?(ce==null?void 0:ce.id)==="legacy"?"Decide above.":(ce==null?void 0:ce.id)==="conflict"?"Reload to continue.":(ce==null?void 0:ce.id)==="scope"?"Pick above.":(ce==null?void 0:ce.id)==="retry"?"Retry above.":O.stage==="analyzing"?"Reading the photos.":O.activeView?"":null:null,Ze=!!O;return{d:O,record:U,name:Y,view:B,slot:K,dirty:we,saving:$,leaving:D,openErr:b,canRevert:!!(U!=null&&U.revisionOf),discard:ne,revert:Oe,closeUntouched:G?()=>void Fe():null,keepPrevious:K&&K.status==="approved"&&K.prior&&!ee&&!(O!=null&&O.activeView)&&(O==null?void 0:O.stage)==="idle"?()=>void F.revert(B):null,surface:{title:"Edit presenter",memoryKey:Z,resumed:V,turns:me,busy:F.busy||$||D||p,stage:O?{hash:ge,alt:`${dc[B]}${(K==null?void 0:K.status)==="candidate"?", candidate":""}`,drawing:ee,since:JA(O),doing:eN(O),takes:Bv(O,B)?[]:nN(O,B),onTake:se?te=>{F.busy||F.restore(B,te)}:void 0,items:YA(O,B),onPick:te=>{A(te),P(!1)},compare:K&&K.status==="candidate"&&K.prior?{on:T,toggle:()=>P(te=>!te)}:void 0}:null,composer:Ze?{placeholder:B==="portrait"?`What should change about ${Y}?`:`Change this view: ${xn[B]}`,label:"What should change",action:"Refine",scope:ve?null:J,hint:null,why:ve??void 0,error:C,disabled:F.busy||$||D||!!ve,working:!!(O!=null&&O.activeView),onStop:O!=null&&O.activeView?()=>void F.stop():void 0,stopping:F.stopping,focusKey:`${(ce==null?void 0:ce.id)??"open"}:${(O==null?void 0:O.id)??""}`}:null,text:E,onText:j,onSend:Xe,onAnswer:ot,onRestore:(te,le)=>{F.busy||(A(te),F.restore(te,le))}},setupNeeded:g?null:l}}function Pie({onClose:e,...t}){const n=Rie(t),r=o.jsxs(o.Fragment,{children:[n.canRevert&&o.jsx(qn,{label:"Revert last change",tone:"quiet",title:"Revert the last saved change?",body:`${n.name} goes back to the pictures and the person before the last save. Shots already made keep what they were made with.`,busy:n.leaving,onConfirm:()=>void n.revert()}),n.dirty&&o.jsx(qn,{label:"Discard changes",tone:"quiet",title:"Discard the changes?",body:"The views redrawn in this session are thrown away. The saved presenter stays as it was.",busy:n.leaving,onConfirm:()=>void n.discard()})]}),a=n.keepPrevious?o.jsxs("div",{className:"sc-pstudio-offer",children:[o.jsxs("span",{children:["Redrew the ",xn[n.view],"."]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:n.keepPrevious,disabled:n.surface.busy,children:"Keep previous"})]}):n.openErr?o.jsx("p",{className:"sc-newdlg-err",role:"alert",children:n.openErr}):null;return o.jsx(Ww,{surface:{...n.surface,headAction:r,dock:a},onClose:n.closeUntouched??e})}function Lie(){const{presenterId:e=""}=Qs(),{brand:t}=dn(),n=_n(),{caps:r}=tw();$c("Edit presenter");const a=s.useRef(!1);s.useEffect(()=>(a.current=!0,()=>{a.current=!1}),[]);const[i]=s.useState(()=>Qv(t,e)),l=s.useCallback(f=>{a.current&&n(xa(t,f),{replace:!0})},[n,t]),u=s.useCallback(()=>n(xa(t,e),{replace:!0}),[n,t,e]);return i!==e?o.jsx(Ba,{to:lm(t,i),replace:!0}):o.jsx(Pie,{presenterId:e,onLeave:l,onClose:u,caps:r})}function $ie(e,t){return(t.source!=="synthetic"||(t.direction??"")===Um(e.answers))&&Tie(t.keepItems,Wm(e.answers))}function Tie(e,t){const n=e??[];return n.length!==t.length?!1:t.every((r,a)=>{const i=n[a];return!i||i.id!==r.id||i.words!==r.words?!1:(i.refs??[]).every(l=>(r.refs??[]).includes(l))})}function Die(e,t){return{...t.source==="synthetic"?{direction:Um(e.answers)}:{},keepItems:Wm(e.answers)}}const Hie=e=>e.source==="photos"?e.views.front.hash?"front":null:e.views.portrait.hash?"portrait":null;function _P(e){if(!e.draftId)return!1;const t=e.draft;return t?e.seededFor!==t.id&&(!e.state.answers.source||!g4(e.state,e.ctx)):!0}function Oie(e){const{state:t,draft:n,ctx:r}=e;if(e.busy||e.err)return[];if(n){if(_P(e))return[{kind:"seed",...Joe(n)}];if(!g4(t,r))return[];const i=[];$ie(t,n)||i.push({kind:"sync",patch:Die(t,n),redo:Hie(n)});const l=e.canDraw?KA(n):null;return l&&i.push({kind:"draw",view:l,decide:Zo(l)}),i}if(e.draftId)return[];if(!e.canDraw||!g4(t,r))return[];const a=t.answers.source;return(a==null?void 0:a.door)==="scratch"&&a.via!=="taps"?[{kind:"start"}]:[]}function Iie(e){for(const t of Oie(e))if(!e.done.has(VP(t,e)))return t;return null}function VP(e,t){const n=t.draft;switch(e.kind){case"seed":return`seed:${n==null?void 0:n.id}`;case"start":return`start:${t.state.revision}`;case"sync":return`sync:${n==null?void 0:n.id}:${JSON.stringify(e.patch)}`;case"draw":{const r=n==null?void 0:n.views[e.view];return`draw:${n==null?void 0:n.id}:${e.view}:${(r==null?void 0:r.attempts)??0}:${(n==null?void 0:n.generations)??0}:${(r==null?void 0:r.status)??""}`}}}const pu=(e,t)=>`scenri:presenter-setup:${e}:${t}`,_i={read(e){try{return sessionStorage.getItem(e)}catch{return null}},write(e,t){try{sessionStorage.setItem(e,t)}catch{}},remove(e){try{sessionStorage.removeItem(e)}catch{}}};function SS(e,t){let n=_i.read("scenri:tab");return n||(n=[...crypto.getRandomValues(new Uint8Array(6))].map(r=>r.toString(16).padStart(2,"0")).join(""),_i.write("scenri:tab",n)),`${n}:${e}:${t}`}function Fie(e,t){var r,a,i;const n=t==="keep"?"detail":((a=ja(((r=ls(t))==null?void 0:r.id)??"glasses"))==null?void 0:a.label.toLowerCase())??"detail";return`${(i=e.answers[t])!=null&&i.refs.length?"Replace":"Add"} the picture of the ${n}`}function ES(e,t,n){const r=e.editing&&e.editing!=="name"?e.editing:e.saying??zm(e.answers,t);if(r==="keep"||!r&&n==="agree")return"keep";if(!r)return null;const a=ls(r);return a&&a.part==="what"?`trait-${a.id}`:null}function _ie({draftId:e,convoKey:t,onOpenDraft:n,onLeaveDraft:r,onStarted:a,caps:i}){var xt,st,Kt,mn;const{brand:l}=dn(),{presenterCategories:u,applyBrand:f}=Hn(),h=vl(),p=gl(),g=Vr("setup").value,v=Vr("settings").value,w=!!g||!!v,b=!!(i!=null&&i.canGenerate),[y,k]=s.useReducer(moe,{brandId:l.id,convoKey:t},$e=>{const Ae=bp(_i.read(pu($e.brandId,$e.convoKey)));return Ae?{...yp,answers:Ae.answers,revision:Ae.revision,asides:Ae.asides,extrasDeclined:!!Ae.extrasDeclined}:yp}),S=s.useRef(y);S.current=y;const E=goe(y),j=Object.keys(y.answers).length>0||y.asides.length>0,N=s.useRef(t);s.useEffect(()=>{j?_i.write(pu(l.id,t),E):_i.remove(pu(l.id,t));const $e=N.current;N.current=t,$e!==t&&e&&t===e&&(_i.remove(pu(l.id,$e)),Wi(`presenter-create:${l.id}:${$e}`))},[l.id,t,e,E,j]);const A=s.useRef(null);s.useEffect(()=>{if(!e||A.current===E)return;const $e=setTimeout(()=>{A.current=E,je.updatePresenterDraft(l.id,e,{setup:E}).catch(()=>{A.current=null})},800);return()=>clearTimeout($e)},[l.id,e,E]);const[T,P]=s.useState(null),[C,R]=s.useState(!1),[$,H]=s.useState(null),[D,q]=s.useState([]),[_,U]=s.useState(!1),[Y,I]=s.useState(null),[F,O]=s.useState(!1),[Z,V]=s.useState(null),[B,K]=s.useState(null),[ee,se]=s.useState(0),[oe,me]=s.useState([]),ce=s.useRef(new Map),[we]=s.useState(()=>!!e||!!bp(_i.read(pu(l.id,t))));s.useEffect(()=>()=>{for(const $e of ce.current.values())URL.revokeObjectURL($e)},[]);const G=s.useRef(!1),ue=s.useRef(new Set),Ne=s.useRef(!1),ne=s.useRef(null),Fe=s.useRef(!1),Oe=s.useRef(!0);s.useEffect(()=>(Oe.current=!0,()=>{Oe.current=!1}),[]);const ot=s.useRef(new Set),Xe=s.useRef(0),X=FP(l.id,e),J=X.draft,ge=(i==null?void 0:i.engineName)??null,ve=s.useMemo(()=>$P(J,b,ge),[J,b,ge]);s.useEffect(()=>{ue.current=new Set,G.current=!1,q([]),A.current=null,e||(Fe.current=!1)},[e]),s.useEffect(()=>{if(G.current||!J)return;const $e=RG(J,D);$e&&(G.current=!0,q($e))},[J,D]),s.useEffect(()=>{X.gone&&r()},[X.gone,r]);const Ze=s.useCallback(()=>{_i.remove(pu(l.id,t)),Wi(`presenter-create:${l.id}:${t}`)},[l.id,t]),Ye=s.useCallback($e=>n($e,!0),[n]),ke=s.useCallback(async()=>{const $e=S.current;if(!b||F)return;const Ae=$e.revision;O(!0),H(null);try{const nt=Wm($e.answers),Ge=await je.createPresenterDraft(l.id,{source:"synthetic",direction:Um($e.answers),...nt.length?{keepItems:nt}:{},clientKey:SS(t,Ae)});if(S.current.revision!==Ae||!Oe.current){je.deletePresenterDraft(l.id,Ge.id).catch(()=>{});return}Ye(Ge.id)}catch(nt){H(String((nt==null?void 0:nt.message)??nt))}finally{O(!1)}},[l.id,b,F,Ye,t]),te=s.useCallback(async()=>{const $e=S.current,Ae=$e.answers.photos;if(!(Ae!=null&&Ae.hashes.length)||!Ae.attested||F)return;const nt=$e.revision;O(!0),H(null);try{const Ge=await je.createPresenterDraft(l.id,{source:"photos",imageHashes:Ae.hashes,attestation:!0,clientKey:SS(t,nt)});if(S.current.revision!==nt||!Oe.current){je.deletePresenterDraft(l.id,Ge.id).catch(()=>{});return}Ye(Ge.id)}catch(Ge){H(String((Ge==null?void 0:Ge.message)??Ge))}finally{O(!1)}},[l.id,F,Ye,t]),le=s.useCallback(async $e=>{H(null);const Ae=()=>{var he;return((he=S.current.answers.photos)==null?void 0:he.hashes)??[]},nt=$e.slice(0,Math.max(0,N0-Ae().length-Xe.current));Xe.current+=nt.length;const Ge=[];let Tt=0;k({type:"upload-begin"});try{for(const he of nt){if(he.size>F3){Ge.push(Soe(he.name,F3));continue}try{const pe=await W0(he);Ae().includes(pe)&&(Tt+=1),k({type:"uploaded",hash:pe,max:N0})}catch{Ge.push(Eoe(he.name))}}}finally{Xe.current-=nt.length,k({type:"upload-end"})}const W=koe({over:$e.length-nt.length,same:Tt,failed:Ge,max:N0});W&&H(W)},[]),Me=s.useCallback($e=>{k({type:"answer",patch:$e,ctx:ve})},[ve]),ze=s.useCallback(async $e=>{const Ae=$e??J;if(!Ae||_)return;const nt=PG(Ae,Ae.name,b);if(nt){I(nt);return}U(!0),I(null);try{await je.updatePresenterDraft(l.id,Ae.id,{facets:D});const Ge=await je.savePresenterDraft(l.id,Ae.id);f(Ge.brand),Ze(),k({type:"start-over"}),a({kind:"presenter",id:Ge.presenter.id,name:Ge.presenter.name})}catch(Ge){U(!1),I(String((Ge==null?void 0:Ge.message)??Ge))}},[J,_,b,l.id,D,Ze,a,f]),Re=s.useCallback(async()=>{var Ae;if(!J||_)return;const $e=(Ae=J.sources)==null?void 0:Ae[0];if(!$e||J.views.portrait.status==="approved"){ze();return}U(!0),I(null);try{const nt=await je.placeDraftPhoto(l.id,J.id,"portrait",$e);U(!1),await ze(nt)}catch(nt){U(!1),I(String((nt==null?void 0:nt.message)??nt))}},[J,_,l.id,ze]),Be=s.useCallback(async()=>{const Ae=S.current.answers.describe||(J==null?void 0:J.direction)||"";Fe.current=!!e,Ze(),k({type:"start-over",text:Ae}),H(null),V(null),K(null),ue.current=new Set,J&&!qA(J)&&await je.deletePresenterDraft(l.id,J.id).catch(()=>{}),r()},[J,e,l.id,Ze,r]),Qe=J?X.err&&!fc(J)?X.err:null:$,rt=s.useMemo(()=>uie({state:y,draft:J,canGenerate:b,engine:ge,failed:Qe,failedView:X.errView,awaiting:_P({state:y,draft:J,ctx:ve,draftId:e,seededFor:ne.current})}),[y,J,b,ge,Qe,X.errView,e,ve]),_e=DP(rt),zt=s.useRef(null);zt.current=(_e==null?void 0:_e.id)??null;const Et=J?GA(J,T):"portrait",Zt=J?J.views[Et]:null,He=!!J&&(J.activeView===Et||J.stage==="analyzing"),mt=!!J&&!J.activeView&&J.stage==="idle",vt={state:y,draft:J,ctx:ve,canDraw:b,busy:X.busy||F||Ne.current||Fe.current||(J?fc(J):!1),err:!!X.err||!J&&!!$,draftId:e,seededFor:ne.current,done:ue.current},St=Iie(vt),kt=s.useRef(St);kt.current=St;const Nt=St?VP(St,vt):"";s.useEffect(()=>{var Ae;J&&ne.current!==J.id&&!vt.busy&&!vt.err&&((Ae=kt.current)==null?void 0:Ae.kind)!=="seed"&&(ne.current=J.id);const $e=kt.current;if(!(!$e||ue.current.has(Nt)))switch(ue.current.add(Nt),$e.kind){case"seed":ne.current=(J==null?void 0:J.id)??null,k({type:"restore",answers:$e.answers,revision:S.current.revision+1,asides:$e.asides,extrasDeclined:$e.extrasDeclined});return;case"start":ke();return;case"sync":Ne.current=!0,(async()=>{if(!(await X.update($e.patch)||await X.update($e.patch))){ue.current.delete(Nt);return}$e.redo&&await X.redo($e.redo)})().finally(()=>{Ne.current=!1});return;case"draw":X.generate($e.view,void 0,$e.decide);return}},[Nt,J,ke,X.update,X.redo,X.generate]);const Bt=s.useCallback(($e,Ae,nt,Ge,Tt=!1)=>{k({type:"aside",aside:{said:$e,reply:Ae,q:nt,at:lp(),kind:Ge,...Tt?{edit:!0}:{}}})},[]),at=s.useCallback(($e,Ae)=>{H(null);const nt=S.current;if(Ys($e)){if($e==="weakphotos"&&Ae.kind==="confirm"){Ae.id==="again"&&Be(),Ae.id==="anyway"&&Me({weakphotos:{pick:"anyway"}});return}const Ge=tie($e,Ae,nt.answers);if(Ge){const Tt=nt.text.trim(),W=Ge[$e],he=(ir($e)||!!ls($e))&&W&&typeof W=="object"&&!W.words;Me(he&&Tt?{...Ge,[$e]:{...W,words:T8(Tt)}}:Ge);return}if($e==="photos"&&Ae.kind==="photos"){const Tt=Ae.action;Tt.type==="add"&&le(Tt.files),Tt.type==="remove"&&k({type:"remove-photo",hash:Tt.hash}),Tt.type==="attest"&&k({type:"attest",checked:Tt.checked}),Tt.type==="reject"&&H("That was not an image. Drop a photo, or choose a file."),Tt.type==="submit"&&te(),Tt.type==="back"&&Me({source:{door:"scratch",via:"taps"}})}return}switch($e){case"unsure":{if(Ae.kind!=="confirm"||Ae.id!=="use"||!nt.unsure)return;const Ge=nt.unsure.said,Tt=nt.unsure.q==="describe"?"describe":"source";k({type:"settle-unsure",ctx:ve}),Me(Tt==="describe"?{describe:Ge}:{source:{door:"scratch",via:"typed"},describe:Ge});return}case"noengine":Ae.kind==="confirm"&&Ae.id==="setup"&&h(),Ae.kind==="confirm"&&Ae.id==="photos"&&Me({source:{door:"photos",via:"taps"}});return;case"agree":{if(Ae.kind!=="confirm")return;Ae.id==="draw"&&ke();return}case"identity":if(Ae.kind!=="confirm"||!J)return;Ae.id==="use"&&(X.approve("portrait"),P(null)),Ae.id==="again"&&X.generate("portrait");return;case"revision":case"view-revision":{if(Ae.kind!=="confirm"||!J)return;const Ge=$e==="revision"?"portrait":Object.keys(J.views).find(Tt=>J.views[Tt].status==="candidate")??Et;Ae.id==="use"&&X.approve(Ge),Ae.id==="keep"&&X.revert(Ge),Ae.id==="again"&&X.generate(Ge,J.views[Ge].adjustment,Zo(Ge)),R(!1);return}case"retry":{if(Ae.kind==="confirm"&&Ae.id.startsWith("remedy:")){const Tt=Ae.id.slice(7);Tt==="setup"?h():p(Tt);return}if(Ae.kind==="confirm"&&Ae.id==="skip-extras"){X.clearErr(),X.update({extras:!1}),k({type:"extras-declined"});return}if(!J){ue.current=new Set,H(null);return}if(X.err){X.clearErr(),ue.current=new Set([...ue.current].filter(Tt=>Tt.startsWith("sync:")));return}const Ge=Object.keys(J.views).find(Tt=>!!J.views[Tt].error);Ge&&X.generate(Ge,J.views[Ge].adjustment,Zo(Ge));return}case"extras":if(Ae.kind!=="confirm")return;Ae.id==="add"&&X.update({extras:!0}),Ae.id==="save"&&k({type:"extras-declined"});return;case"blind":if(Ae.kind!=="confirm")return;Ae.id==="save"&&Re(),Ae.id==="setup"&&h();return;case"save":ze();return}},[Me,le,te,ke,h,p,J,X,Et,ze]),Mt=s.useCallback($e=>{var pr,Nn,nr,Jt,ur,Cs,kn,Vs,na;const Ae=$e.trim(),nt=S.current,Ge=yS(nt,_e),Tt=Ge&&((pr=nt.colour)==null?void 0:pr.step)===Ge?nt.colour.hex:null,W=Ge&&ir(Ge)?Ge.slice(5):null,he=Ge==="keep"?(((Nn=nt.answers.keep)==null?void 0:Nn.refs)??[]).length:Ge!=null&&Ge.startsWith("trait-")?(((nr=nt.answers[Ge])==null?void 0:nr.refs)??[]).length:0,pe=Ae||Tt||"";if(!pe&&!he)return!1;if(H(null),Ge==="name"){const en=pe.replace(/^(?:(?:her|his|their|the|my)\s+name\s+is|call\s+(?:her|him|them)|name:)\s*/i,"").trim()||pe;return J&&X.update({name:en.slice(0,60)}),k({type:"text",text:""}),!0}const qe=(en,Cn)=>nt.asides.filter(zn=>zn.q===en&&zn.kind===Cn).length,We=(en,Cn=null)=>D8(en,Cn,!!(J!=null&&J.views.portrait.hash)),jt=(en,Cn,zn,Zr)=>{const Pr=zn!==null&&nt.editing===zn;Pr&&Me({[zn]:void 0}),Bt(en,Cn,zn,Zr,Pr)};if(Ge&&Ge!=="keep"&&Ge.startsWith("trait-")){const en=ls(Ge);if(!en)return!1;const Cn=en.part==="what"?((Jt=nt.answers[Ge])==null?void 0:Jt.refs)??[]:[];if(!Ae&&Cn.length)return Me({[Ge]:{pick:(ur=nt.answers[Ge])==null?void 0:ur.pick,words:nie(en.id,Cn.length),refs:Cn}}),!0;const zn=gh(Ge,Ae,fa);if(!Ae||zn)return jt(Ae,Zl(zn??"vague",We(Ge),qe(Ge,zn??"vague"),Ae,void 0,!0),Ge,zn??"vague"),!0;const Zr=dS(Ae),Pr=Zr?T8(Ae):Ae;if(en.part==="where"){const In=nt.answers[Ge];Me({[Ge]:{pick:Zr?In==null?void 0:In.pick:void 0,words:Pr}})}else{const In=nt.answers[Ge];Me({[Ge]:{pick:Zr?In==null?void 0:In.pick:void 0,words:Pr,refs:(In==null?void 0:In.refs)??[]}})}return!0}if(Ge==="keep"){const en=nt.answers.keep,Cn=(en==null?void 0:en.refs)??[],zn=Ae||(Cn.length&&!(en!=null&&en.words)?"the detail in the attached picture":"");return zn?(Me({keep:{words:[(Cs=en==null?void 0:en.words)==null?void 0:Cs.trim(),zn].filter(Boolean).join(", "),refs:Cn}}),!0):!1}if(Ge&&ir(Ge)&&W){const en=Ae&&!/^#[0-9a-f]{6}$/i.test(Ae)?gh(Ge,Ae,fa):null;if(en)return jt(Ae,Zl(en,We(Ge),qe(Ge,en),Ae,W,!0),Ge,en),!0;const Cn=nt.answers[Ge],zn=!Ae||dS(Ae),Zr=Tt??(zn?Cn==null?void 0:Cn.pick:void 0),Pr={pick:Zr,words:Ae?zn?T8(Ae):Ae:Cn==null?void 0:Cn.words};if(Ae&&!Zr&&!Qoe(nt.answers,Ge,Pr,Ae)){const In=nt.answers.keep;return Me({keep:{words:[(kn=In==null?void 0:In.words)==null?void 0:kn.trim(),Xoe(Ae)].filter(Boolean).join(", "),refs:(In==null?void 0:In.refs)??[]}}),!0}return Me({[Ge]:Pr}),!0}const Ct=(_e==null?void 0:_e.id)??null,Dt=Ct==="unsure"?((Vs=nt.unsure)==null?void 0:Vs.q)??"source":Ct;if(Ct==="traits"){const en=Ko(pe,fa);if(en)return Bt(pe,Zl(en,We(null,Ct),qe(Ct,en),pe),Ct,en),!0;const Cn=nt.answers.keep;return Me({traits:[],keep:{words:[(na=Cn==null?void 0:Cn.words)==null?void 0:na.trim(),pe].filter(Boolean).join(", "),refs:(Cn==null?void 0:Cn.refs)??[]}}),!0}if(Ct==="gaps"){const en=Ko(pe,fa);if(en)return Bt(pe,Zl(en,We(null,Ct),qe(Ct,en),pe),Ct,en),!0;const Cn=(nt.answers.describe??"").trim().replace(/[.\s]+$/,"");return Me({describe:Cn?`${Cn}, ${pe}`:pe}),!0}const qt=We(null,Dt),Zn=Dt==="source"?Uoe(pe):null,nn=Zn?null:Ko(pe,fa);if(nn&&(qt==="source"||qt==="describe"||nn!=="vague"))return Bt(pe,Zl(nn,qt,qe(Ct,nn),pe),Ct,nn),!0;if((Dt==="source"||Dt==="describe")&&!Zn&&!fa(pe))return k({type:"unsure",unsure:{said:pe,q:Ct,at:lp()},ctx:ve}),!0;if((Dt==="source"||Dt==="describe")&&k({type:"settle-unsure",ctx:ve}),Dt==="source")return Zn?(Me({source:{door:Zn,via:"taps"}}),!0):(Me({source:{door:"scratch",via:"typed"},describe:pe}),!0);if(Dt==="describe")return Me({describe:pe}),!0;if(HP(pe,J,Dt))return X.update({name:pe.slice(0,60)}),k({type:"text",text:""}),!0;if(Dt==="name"){const en=pe.replace(/^(?:(?:her|his|their|the|my)\s+name\s+is|call\s+(?:her|him|them)|name:)\s*/i,"").trim()||pe;return J&&X.update({name:en.slice(0,60)}),k({type:"text",text:""}),!0}if(!J)return!1;if(Dt==="identity")return X.generate("portrait",pe),k({type:"text",text:""}),!0;const Ut=QA(pe,Et,J);return"blocked"in Ut?(H(Ut.blocked),!1):(P(Ut.view),R(!1),X.generate(Ut.view,pe,Ut.scope==="view"?Zo(Ut.view):void 0),k({type:"text",text:""}),!0)},[_e,Me,Bt,J,X,Et]),ft=s.useCallback($e=>{if($e==="name"){k({type:"edit",id:"name"});return}const Ae=qk($e);if(Ae){k({type:"edit",id:`aside:${Ae}`});return}if(!Ys($e))return;const nt=lie($e,J);if(nt==="start-over"){V("start-over");return}if(nt==="redraw"){K($e),V("redraw");return}k({type:"edit",id:$e})},[J]),vn=s.useCallback(()=>{V(null),B&&k({type:"edit",id:B}),K(null)},[B]),Qt=s.useCallback(($e,Ae)=>{const nt=S.current.answers;if($e==="keep"||$e.startsWith("trait-")&&!$e.endsWith("-where")){const Ge=nt[$e];Me({[$e]:{pick:$e==="keep"||Ge==null?void 0:Ge.pick,words:Ae,refs:(Ge==null?void 0:Ge.refs)??[]}});return}if(ir($e)||$e.startsWith("trait-")){const Ge=nt[$e];Me({[$e]:{pick:Ge==null?void 0:Ge.pick,words:Ae}});return}Me({[$e]:Ae})},[Me]),on=s.useCallback(($e,Ae)=>{const nt=Ae.trim();if(!nt)return;if($e==="name"){k({type:"cancel-edit"}),J&&X.update({name:nt.slice(0,60)});return}const Ge=qk($e);if(Ge){const W=S.current,he=W.asides.find(qt=>qt.at===Ge);if(!he)return;const pe=he.q&&Ys(he.q)?he.q:null,qe=pe?gh(pe,nt,fa):Ko(nt,fa);if(!qe&&pe){k({type:"drop-aside",at:Ge}),Qt(pe,nt);return}const We=D8(pe,he.q,!!(J!=null&&J.views.portrait.hash)),jt=pe&&ir(pe)?pe.slice(5):void 0,Ct=qe??"vague",Dt=W.asides.filter(qt=>qt.q===he.q&&qt.at<he.at&&qt.kind===Ct).length;k({type:"amend-aside",at:Ge,said:nt,reply:Zl(Ct,We,Dt,nt,jt),kind:Ct,ctx:ve});return}if(!Ys($e)||!sf($e,S.current.answers))return;const Tt=gh($e,nt,fa);if(Tt){const W=S.current,he=D8($e,$e,!!(J!=null&&J.views.portrait.hash)),pe=ir($e)?$e.slice(5):void 0,qe=W.asides.filter(We=>We.q===$e&&We.kind===Tt).length;Me({[$e]:void 0}),Bt(nt,Zl(Tt,he,qe,nt,pe),$e,Tt);return}Qt($e,nt)},[J,X.update,Me,Qt,Mt,_e,ve]),Rt=s.useCallback(()=>k({type:"cancel-edit"}),[]),An=s.useCallback(()=>{const $e=S.current,Ae=$e.editing&&$e.editing!=="name"&&!rf($e.editing)?$e.editing:null,nt=Ae&&!sf(Ae,$e.answers)?Ae:_e==null?void 0:_e.id;if(nt==="agree"){k({type:"say",id:"keep"});return}if(nt==="identity"){se(Ge=>Ge+1);return}if(!(!nt||!Ys(nt))){if(nt==="look-who"){Me({source:{door:"scratch",via:"words"}});return}k({type:"say",id:nt})}},[_e==null?void 0:_e.id,Me]),Vt=s.useCallback(()=>ES(S.current,ve,zt.current),[ve]),re=s.useCallback($e=>{const Ae=Vt();if(Ae){H(null),S.current.saying!==Ae&&k({type:"say",id:Ae});for(const nt of $e.slice(0,1)){const Ge=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,Tt=URL.createObjectURL(nt);me(W=>[...W,{key:Ge,id:Ae,url:Tt}]),W0(nt).then(W=>{if(ot.current.delete(Ge)){URL.revokeObjectURL(Tt);return}ce.current.has(W)?URL.revokeObjectURL(Tt):ce.current.set(W,Tt),k({type:"ref",id:Ae,hash:W}),me(he=>he.filter(pe=>pe.key!==Ge))}).catch(W=>{ot.current.delete(Ge)||H(String((W==null?void 0:W.message)??W)),me(he=>he.filter(pe=>pe.key!==Ge)),URL.revokeObjectURL(Tt)})}}},[Vt]),ae=($e,Ae,nt)=>{const Ge=Xw($e,Ae,nt);return Ge.charAt(0).toUpperCase()+Ge.slice(1)},fe=$e=>sS($e).flatMap(Ae=>{const nt=Ae.color?or(Ae.color):null;return nt?[{hex:nt,name:Ae.label,slot:"accent"}]:[]}),Te=ES(y,ve,(_e==null?void 0:_e.id)??null),Ue=(()=>{var qe,We,jt;if(!Te)return;const $e=((qe=y.answers[Te])==null?void 0:qe.refs)??[],Ae=Te==="keep"?$e.slice(((We=y.composing)==null?void 0:We.id)==="keep"?y.composing.refs.length:$e.length):$e,nt=oe.filter(Ct=>Ct.id===Te);if(!Ae.length&&!nt.length)return;const Ge=Te==="keep"?null:ls(Te),Tt=Ge&&((jt=ja(Ge.id))==null?void 0:jt.label)||"Detail",W=Ae.length+nt.length>1;let he=0;const pe=()=>W?`${Tt} ${++he}`:Tt;return[...Ae.map(Ct=>({key:Ct,src:ce.current.get(Ct)??hn(Ct,"micro"),label:pe(),onRemove:()=>k({type:"ref",id:Te,hash:Ct,remove:!0})})),...nt.map(Ct=>({key:Ct.key,src:Ct.url,label:pe(),busy:!0,onRemove:()=>{ot.current.add(Ct.key),me(Dt=>Dt.filter(qt=>qt.key!==Ct.key))}}))]})(),ut=hie(_e,y,J,Et),gt=X.busy||F||!!ut.off,Pt=Te,tt=yS(y,_e),wt=tt==="name"?null:tt,Ce=wt&&ir(wt)?wt.slice(5):null,xe=ut.color&&Ce?fe(Ce):null,et=wt&&((xt=y.colour)==null?void 0:xt.step)===wt?y.colour.hex:null,yt=J&&Jo(J)&&!ut.off&&!(_e!=null&&_e.id.match(/^(name|describe)$/))?(()=>{const $e=LG(y.text,Et,J),Ae=$e.chip?J.views[$e.chip.view].hash:void 0;return{chip:$e.chip?{label:$e.chip.label,thumb:Ae?hn(Ae,"micro"):void 0}:null,hint:$e.hint,tone:$e.tone}})():null,Q=J?YA(J,Et):[],Pe=(Zt==null?void 0:Zt.hash)??((J==null?void 0:J.stage)==="analyzing"?J.sources[0]:void 0),Ke=C&&(Zt!=null&&Zt.prior)?Zt.prior:Pe;return{d:J,view:Et,slot:Zt,facets:D,setFacets:q,presenterCategories:u,saving:_,saveErr:Y,confirming:Z,setConfirming:V,confirmEdit:vn,pendingEdit:B,startOver:Be,begun:Object.keys(y.answers).length>0||!!J,unsaved:!e&&!J&&Object.keys(y.answers).length>0,leave:()=>{Ze(),k({type:"start-over"})},revision:y.revision,open:(_e==null?void 0:_e.id)??null,keepPrevious:Zt&&Zt.status==="approved"&&Zt.prior&&!He&&!(J!=null&&J.activeView)&&(J==null?void 0:J.stage)==="idle"?()=>void X.revert(Et):null,surface:{title:"Create presenter",memoryKey:`presenter-create:${l.id}:${t}`,resumed:we,turns:rt,busy:X.busy||F||w,working:fie(rt,J,F||X.busy),stageEmpty:{lead:joe(J?Et:void 0,xn[Et]),hint:Aoe((_e==null?void 0:_e.id)??null,((st=y.answers.photos)==null?void 0:st.hashes.length)??0)},stage:J?{hash:Ke,alt:`${dc[Et]}${(Zt==null?void 0:Zt.status)==="candidate"?", candidate":""}`,drawing:He,since:JA(J),doing:eN(J),takes:Bv(J,Et)?[]:nN(J,Et),onTake:mt?$e=>void X.restore(Et,$e):void 0,items:Q,onPick:$e=>{P($e),R(!1)},compare:Zt&&Zt.status==="candidate"&&Zt.prior?{on:C,toggle:()=>R($e=>!$e)}:void 0}:null,composer:{placeholder:ut.placeholder,label:ut.label,action:ut.action,scope:yt,hint:null,why:ut.off??void 0,error:$??Y,disabled:gt,working:!!J&&!!J.activeView&&(_e==null?void 0:_e.id)!=="name",onStop:J!=null&&J.activeView?()=>void X.stop():void 0,stopping:X.stopping,focusKey:_e&&!(_e.id==="agree"&&!y.saying)?`${_e.id}:${(J==null?void 0:J.id)??"setup"}:${ee}:${y.saying??""}:${y.says}`:void 0,onAttach:!Pt&&!J&&(_e==null?void 0:_e.id)==="source"?()=>Me({source:{door:"photos",via:"taps"}}):void 0,onAttachFiles:Pt?re:void 0,attachLabel:Pt?Fie(y,Pt):"Add photos",refs:Ue,colour:xe&&Ce?{hex:et,label:et?ae(et,sS(Ce),Ce):"Pick a colour",seed:(Kt=xe[Math.floor(xe.length/2)])==null?void 0:Kt.hex,onPick:$e=>k({type:"colour",hex:$e,step:wt}),onClear:()=>k({type:"colour",hex:null,step:wt})}:null},text:y.text,onText:$e=>k({type:"text",text:$e}),onSend:Mt,onAnswer:at,onRestore:($e,Ae)=>{P($e),X.restore($e,Ae)},onEdit:ft,onSaveEdit:on,onCancelEdit:Rt,onDescribe:An,onAttachRef:re,onStarter:$e=>{(_e==null?void 0:_e.id)==="agree"&&k({type:"say",id:"keep"}),k({type:"text",text:$e})},onPaste:!J&&((mn=y.answers.source)==null?void 0:mn.door)==="photos"?$e=>void le($e):void 0}}}function Vie({onClose:e,...t}){const n=_ie(t),r=n.d,{push:a}=cr();s.useEffect(()=>np({open:n.open}),[n.open]),s.useEffect(()=>()=>np(null),[]);const[i,l]=s.useState(!1);s.useEffect(()=>{i&&!n.unsaved&&l(!1)},[i,n.unsaved]);const u=()=>{if(n.unsaved){l(!0);return}r&&!n.saving&&a({kind:"info",title:"Kept on Presenters",detail:"Continue it from its card."}),e()},f=n.begun?r?o.jsx(qn,{label:"Start over",tone:"quiet",title:"Start over?",body:`This conversation begins again from the first question. ${qA(r)?"The views drawn so far are kept: the unfinished presenter stays on your wall.":"Nothing has been drawn yet, so nothing is kept."}`,open:n.confirming==="start-over"||void 0,busy:!1,onOpenChange:v=>{v||n.setConfirming(null)},onConfirm:()=>void n.startOver()}):o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:()=>void n.startOver(),children:"Start over"}):null,h=o.jsx(o.Fragment,{children:n.keepPrevious&&n.slot&&o.jsxs("div",{className:"sc-pstudio-offer",children:[o.jsxs("span",{children:["Redrew the ",xn[n.view],"."]}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:n.keepPrevious,children:"Keep previous"})]})}),p=o.jsx(qn,{label:"Change it",title:Loe,body:(r==null?void 0:r.source)==="photos"?Toe:$oe,busy:!1,open:n.confirming==="redraw",onOpenChange:v=>{v||n.setConfirming(null)},onConfirm:n.confirmEdit}),g=o.jsxs(o.Fragment,{children:[p,o.jsx(qn,{label:"Leave",title:"Leave without drawing them?",body:"Nothing has been drawn yet, so the answers are not kept. Starting again starts from the first question.",busy:!1,open:i,onOpenChange:v=>{v||l(!1)},onConfirm:()=>{l(!1),n.leave(),e()}})]});return o.jsx(Ww,{surface:{...n.surface,headAction:f,dock:h,overlay:g},onClose:u})}function Zie(){const{draftId:e=null}=Qs(),{key:t}=Wn(),{brand:n}=dn(),r=_n(),{announce:a,caps:i}=tw();$c("Create presenter");const l=s.useRef(!1);s.useEffect(()=>(l.current=!0,()=>{l.current=!1}),[]);const u=s.useRef(e),f=s.useRef(0);e!==u.current&&(u.current=e,f.current+=1);const h=s.useCallback((v,w=!1)=>{l.current&&(w&&(u.current=v),r(Qi(n,v),{replace:w}))},[r,n]),p=s.useCallback(()=>{l.current&&(u.current=null,r(Qi(n),{replace:!0}))},[r,n]),g=s.useCallback(()=>r(Xo(n),{replace:!0}),[r,n]);return o.jsx(Vie,{draftId:e,convoKey:e??t,onOpenDraft:h,onLeaveDraft:p,onClose:g,onStarted:v=>{a(v,{quiet:l.current&&v.kind==="presenter"}),l.current&&r(v.kind==="presenter"?xa(n,v.id):Xo(n),{replace:!0})},caps:i},f.current)}const CS=1e3,zie=3,Bie=1e3;function jS(e,t,n){return{name:e.name.trim()||t.name,prompt:t.prompt,lighting:t.lighting,description:t.description,subject:t.subject,camera:t.camera??"",figure:t.figure??"",figureTreatment:t.figureTreatment??"",keywords:t.keywords??[],collections:t.collections??[],verticals:t.verticals??[],...t.promptName?{promptName:t.promptName}:{},instruction:e.place.trim(),refHashes:[...e.pictures,...e.heldPictures],...n!=null&&n.hash?{previewHash:n.hash,anchor:n.anchor===!0}:{},...n!=null&&n.hash&&n.hero?{heroHash:n.hero,...n.heroWith?{heroWith:n.heroWith}:{}}:{}}}function Uie(e){var H,D;const{s:t,dispatch:n,brandId:r,sceneId:a,conversation:i,applyBrand:l}=e,[u,f]=s.useState(!1),[h,p]=s.useState(!1),[g,v]=s.useState(!1),[w,b]=s.useState(0),y=s.useRef(t);y.current=t;const k=s.useRef(e.seed);k.current=e.seed;const S=s.useRef(!1),E=s.useRef(e.onSaved);E.current=e.onSaved;const{poke:j}=Ca(),N=s.useCallback(async(q,_={})=>{if(!(S.current||y.current.job)){S.current=!0,v(!0);try{const U=y.current,Y=Mr(U),I=q==="make"?{kind:q,instruction:U.place,imageHashes:U.pictures,draw:_.draw??!1,..._.shot?{shot:!0}:{}}:q==="again"?{kind:q,reading:Y==null?void 0:Y.reading,imageHashes:U.pictures}:{kind:q,reading:Y==null?void 0:Y.reading,ask:_.ask,from:(Y==null?void 0:Y.hash)??void 0,...Y!=null&&Y.hash&&Y.anchor?{fromAnchor:!0}:{},...Y!=null&&Y.hash&&Y.hero?{fromHero:Y.hero,...Y.heroWith?{heroWith:Y.heroWith}:{}}:{},imageHashes:U.pictures,draw:_.draw},F=U.name.trim()||(Y==null?void 0:Y.reading.name)||void 0,{jobId:O,job:Z,existing:V}=await je.startSceneStudioJob(r,{...I,conversation:i,...a?{sceneId:a}:{},...F?{label:F}:{}});if(V&&Z.kind!==q){n({type:"error",text:be.busyElsewhere});return}n({type:"started",id:O,kind:Z.kind,ask:Z.kind===q?_.ask:void 0,since:Z.phaseAt}),j()}catch(U){n({type:"error",text:String((U==null?void 0:U.message)??U)}),b(Y=>Y+1)}finally{S.current=!1,v(!1)}}},[r,n,j]);s.useEffect(()=>{const q=y.current;if(q.job||!q.versions.length&&!q.inputsRev)return;let _=!0;return je.activity(r).then(U=>{var I;const Y=(I=U.studio)==null?void 0:I.find(F=>F.kind==="scene"&&F.conversation===i&&F.status==="running"&&!!F.job);!_||!(Y!=null&&Y.job)||y.current.job||S.current||n({type:"started",id:Y.id.slice(6),kind:Y.job,since:Y.startedAt})}).catch(()=>{}),()=>{_=!1}},[r,i,n]);const A=t.named?t.name.trim():"",T=((H=t.job)==null?void 0:H.id)??null;s.useEffect(()=>{!T||!A||je.labelSceneStudioJob(r,T,A).catch(()=>{})},[T,A,r]);const P=((D=t.job)==null?void 0:D.id)??null;s.useEffect(()=>{if(!P)return;let q=!0,_=0,U=!0,Y;const I=async()=>{var F;try{const O=await je.sceneStudioJob(r,P);if(!q)return;_=0,f(!1),U&&O.status==="running"&&((F=y.current.job)!=null&&F.stopping)&&je.cancelSceneStudioJob(r,P).catch(()=>{}),U=!1,O.status==="running"?(n({type:"progress",job:O}),Y=setTimeout(I,CS)):n({type:"finished",job:O})}catch(O){if(!q)return;if((O==null?void 0:O.status)===404){f(!1),n({type:"lost",id:P,error:be.lost});return}_++,_>=zie&&f(!0),Y=setTimeout(I,Math.min(CS*2**Math.min(_,3),8e3))}};return I(),()=>{q=!1,clearTimeout(Y)}},[P,r,n]);const C=s.useCallback(()=>{const q=y.current.job;if(!q||q.stopping)return Promise.resolve(!0);n({type:"stopping",id:q.id});const _=()=>je.cancelSceneStudioJob(r,q.id);return _().catch(()=>new Promise(U=>setTimeout(U,Bie)).then(_)).then(()=>!0,()=>(n({type:"stop-failed",id:q.id}),!1))},[r,n]),R=s.useCallback(q=>{const _=Ate(y.current,q);_>=0&&n({type:"put-back",index:_})},[n]),$=s.useCallback(async(q={})=>{var F,O,Z,V;const _=y.current,U=((F=Mr(_))==null?void 0:F.reading.name)||((Z=(O=_.job)==null?void 0:O.pending)==null?void 0:Z.name)||"",Y={..._,name:_.name.trim()||U},I=Ete(Y);if(!(!I.can||!I.words||S.current)){S.current=!0,p(!0);try{const B=((V=_.job)==null?void 0:V.phase)==="drawing"?_.job.id:null,K=jS(Y,I.words,B?null:Mr(_)??null),ee=k.current,se=ee?Mr(ee):null,oe=a&&!q.asNew?await je.updateScene(r,a,ee&&se?Ite(K,jS(ee,se.reading,se)):K):await je.createScene(r,{...K,conversation:i});l(oe.brand);const me=oe.scene;if(B){const ce=await je.attachSceneStudioJob(r,B,me.id).catch(()=>null);(ce==null?void 0:ce.state)==="landed"&&l(ce.brand)}n({type:"saved",id:me.id}),E.current({id:me.id,name:me.name,verticals:me.verticals??[]},!!q.asNew)}catch(B){n({type:"error",text:String((B==null?void 0:B.message)??B)})}finally{S.current=!1,p(!1)}}},[r,a,i,l,n]);return{offline:u,saving:h,starting:g,failed:w,start:N,stop:C,putBack:R,use:$}}const Wie="scenri:scene-studio:",Kie=10080*60*1e3;function ZP(e){const t=xr.get(e);if(!t)return null;try{return JSON.parse(t)}catch{return null}}function Gie(e){const t=ZP(e);return aR(typeof(t==null?void 0:t.session)=="string"?t.session:null)}function Yie(e,t,n){xr.set(e,JSON.stringify({at:Date.now(),sceneId:n,session:t}))}function qie(e){const t=e.trim();if(!t)return"A shot";if(t.length<=60)return t;const n=t.slice(0,60);return`${n.slice(0,Math.max(n.lastIndexOf(" "),40)).trim()}…`}function AS(e){xr.del(e)}function Xie(e=Date.now()){var t;for(const n of xr.keys(Wie)){let r=0;try{r=Number((t=JSON.parse(xr.get(n)??"null"))==null?void 0:t.at)||0}catch{}e-r>Kie&&xr.del(n)}}function Qie(e){var tt,wt,Ce,xe,et,yt;const{brand:t,applyBrand:n,sceneId:r,seed:a,conversation:i,storageKey:l,caps:u}=e,f=r&&a?{name:a.name}:null,[h]=s.useState(()=>{Xie();const Q=Gie(l);return Q||Wi(l),Q}),[p,g]=s.useReducer(WM,null,()=>(h==null?void 0:h.setup)??vte),[v,w]=s.useReducer(Ste,null,()=>(h==null?void 0:h.studio)??a??GM),[b,y]=s.useState(0),[k,S]=s.useState(""),E=s.useRef(null),[j,N]=s.useState(!1),[A,T]=s.useState(void 0),[P,C]=s.useState(null),R=s.useRef(!1),$=s.useRef(p);$.current=p;const H=s.useRef(v);H.current=v;const[D,q]=s.useState(null),_=s.useRef(e.onSaved);_.current=e.onSaved;const U=Uie({s:v,dispatch:w,brandId:t.id,sceneId:r,conversation:i,seed:a,applyBrand:n,onSaved:(Q,Pe)=>_.current(Q,r&&!Pe?"updated":"created")}),Y=s.useRef(!1);s.useEffect(()=>{if(R.current)return;const Q=ZP(l);if((Q==null?void 0:Q.done)===!0||Y.current&&!Q){R.current=!0;return}const Pe=typeof(Q==null?void 0:Q.sceneId)=="string"?Q.sceneId:null;Yie(l,Jte(p,v),r??v.saved??Pe),Y.current=!0},[p,v,l,r]);const I=v.saved,F=I?G0(t,I):void 0,O=QR(t.id,I,(F==null?void 0:F.placeUrl)??null),Z=((tt=O.job)==null?void 0:tt.status)==="running",[V,B]=s.useState(!1),[K,ee]=s.useState(0),[se,oe]=s.useState(!1);s.useEffect(()=>{Z||oe(!1)},[Z]);const me=s.useMemo(()=>sN(F==null?void 0:F.examples,O.job),[F==null?void 0:F.examples,O.job]),ce=s.useRef(e.onDone);ce.current=e.onDone;const we=s.useMemo(()=>{var Pe,Ke;if(!I)return;const Q=(F==null?void 0:F.examples)??[];return{tiles:me,running:Z||V||O.waiting,read:O.read,who:((Pe=Q[0])==null?void 0:Pe.with)??((Ke=O.job)==null?void 0:Ke.subject.kind)??((F==null?void 0:F.subject)==="person"||F!=null&&F.figure?"presenter":"product"),noSubject:O.read&&!O.job&&!Q.length&&O.more.length===0,missing:HG(O.more,Q,O.job),first:O.first,stale:O.first.length>0&&Q.some(xt=>xt.earlier),finish:e.finish}},[I,F,me,Z,V,O.waiting,O.read,O.job,O.first,O.more,e.finish]),G=s.useCallback(Q=>{I&&(C(null),B(!0),je.drawSceneExamples(t.id,I,Q).then(()=>{B(!1),O.again()}).catch(Pe=>{B(!1),ee(Ke=>Ke+1),"roles"in Q||w({type:"set-failed",more:"more"in Q}),C(String((Pe==null?void 0:Pe.message)??Pe))}))},[t.id,I,O.again]),ue=s.useCallback(()=>{I&&(R.current=!0,sne(l,I),Wi(l),ce.current(I))},[I,l]),[Ne,ne]=s.useState(null);s.useEffect(()=>ne(null),[v.current]),s.useEffect(()=>{f||p.editing||!o5(p.answers)||w({type:"inputs",place:mte(p.answers),pictures:gte(p.answers)})},[p.answers,p.editing,f]);const Fe=s.useRef(new Set),Oe=kte(v,!f&&o5(p.answers));s.useEffect(()=>{var Q;Oe===null||U.starting||Fe.current.has(Oe)||(Fe.current.add(Oe),U.start("make",{draw:!1,shot:((Q=$.current.answers.source)==null?void 0:Q.door)==="shot"}))},[Oe,U.starting,U.start]);const[ot,Xe]=s.useState(""),X=Mw(t.id,ot,!f),J=s.useRef(X);J.current=X;const ge=s.useRef([]);X.settled&&!X.error&&(ge.current=X.items);const ve=X.settled?X.items:ge.current,Ze=!X.error&&(!X.settled||X.loading),{recent:Ye,loaded:ke}=dn(),[te,le]=s.useState(null);s.useEffect(()=>{!ot.trim()&&X.settled&&!X.error&&le(X.items.length>0)},[ot,X.settled,X.error,X.items.length]);const Me=te??(Ye.length>0?!0:ke?!1:null),ze=s.useMemo(()=>({any:Me,items:ve.map(Q=>({id:Q.id,hash:Q.images[0],alt:qie(Q.promptHead)})),query:ot,more:X.settled&&X.hasMore,loading:Ze,error:X.error}),[Me,ve,ot,X.settled,X.hasMore,Ze,X.error]),Re=Hn().scenes,Be=s.useCallback(async Q=>{var Kt,mn,$e;const Pe=ge.current.find(Ae=>Ae.id===Q)??X.items.find(Ae=>Ae.id===Q);if(!(Pe!=null&&Pe.images[0]))return;const Ke=$.current.revision;let xt=m5(Pe.brief);if(!xt&&Pe.kind==="edit"){const Ae=await je.lineage(Pe.id).catch(()=>null);if(xt=m5((Kt=Ae==null?void 0:Ae.ancestors.find(nt=>nt.kind==="generation"))==null?void 0:Kt.brief),$.current.revision!==Ke)return}const st=xt?((mn=G0(t,xt))==null?void 0:mn.name)??(($e=Re.find(Ae=>Ae.id===xt))==null?void 0:$e.name):void 0;St({shot:{id:Pe.id,hash:Pe.images[0],...xt&&st?{scene:{id:xt,name:st}}:{}},reuse:void 0})},[t,Re,X.items]),Qe=s.useCallback(()=>{var Pe;const Q=(Pe=$.current.answers.shot)==null?void 0:Pe.scene;Q&&(R.current=!0,AS(l),Wi(l),ce.current(Q.id,{existing:!0}))},[l]),rt=(u==null?void 0:u.canDraw)??!0,_e=U.offline?be.offline:P,zt={setup:p,studio:v,canDraw:rt,uploading:b,edit:f&&{...f,changed:p5(v,a)},editingName:j,note:_e,stale:YM(v),shots:ze,set:we},Et=U.failed+K,Zt=s.useMemo(()=>Gte(zt).map(Q=>Q.kind==="question"&&Et?{...Q,question:{...Q.question,attempt:Et}}:Q),[p,v,rt,b,j,_e,f,ze,we,Et]),He=(()=>{const Q=Zt[Zt.length-1];return(Q==null?void 0:Q.kind)==="question"?Q.question:null})(),mt=Xte(zt,He),vt=(Q,Pe,Ke)=>g({type:"aside",aside:{said:Q,reply:Pe,q:Ke,at:lp()}}),St=s.useCallback(Q=>{const Pe=$.current,Ke=Pe.held??Pe.answers;Pe.editing&&d5(H.current)&&JSON.stringify(yw(Ke,Q))!==JSON.stringify(Ke)&&w({type:"forget-record"}),g({type:"answer",patch:Q})},[]),kt=s.useRef(0),Nt=s.useCallback(async Q=>{var mn,$e;const Pe=Q.some(c5),Ke=Q.filter(Ae=>Ae.type.startsWith("image/")&&!c5(Ae));if(!Ke.length){C(Pe?be.heicNotYet:be.onlyPictures);return}((mn=$.current.answers.source)==null?void 0:mn.door)!=="photos"&&St({source:{door:"photos"}});const st=4-((($e=$.current.answers.photos)==null?void 0:$e.hashes)??[]).length-kt.current;if(st<=0){C(be.fourPictures);return}const Kt=Ke.slice(0,st);C(Ke.length>st?be.fourPictures:Pe?be.heicNotYet:null),kt.current+=Kt.length,y(Ae=>Ae+1);try{for(const Ae of Kt)try{g({type:"photo",hash:await W0(Ae)})}catch(nt){C(`${Ae.name} could not be added: ${String((nt==null?void 0:nt.message)??nt)}`)}finally{kt.current-=1}}finally{y(Ae=>Ae-1)}},[St]),Bt=s.useRef(me);Bt.current=me;const at=gl(),Mt=vl(),ft=s.useCallback((Q,Pe)=>{var Ke,xt;if(C(null),Pe.kind==="confirm"&&Pe.id.startsWith("remedy:")){const st=Pe.id.slice(7);st==="setup"?Mt():(st==="engines"||st==="budget")&&at(st);return}if(Pe.kind==="confirm"&&Pe.id==="reword"){T(String(Date.now()));return}if(Q==="photos"&&Pe.kind==="photos"){const st=Pe.action,Kt=((Ke=$.current.answers.photos)==null?void 0:Ke.hashes)??[];st.type==="add"?Nt(st.files):st.type==="instead"?St({source:{door:"shot"}}):st.type==="remove"?g({type:"photos",hashes:Kt.filter(mn=>mn!==st.hash)}):st.type==="reject"?C(be.onlyPictures):st.type==="submit"&&Kt.length?St({photos:{hashes:Kt,done:!0}}):st.type==="back"&&St({source:{door:"guided"}});return}if(Q==="shot"&&Pe.kind==="pick"){const st=Pe.action;st.type==="pick"?Be(st.id):st.type==="query"?Xe(st.text):st.type==="more"?J.current.loading||J.current.loadMore():st.type==="back"&&(Xe(""),St({source:{door:"photos"},photos:{hashes:[],done:!1}}));return}if(Q==="reuse"&&Pe.kind==="choice"&&Pe.id==="use"){Qe();return}if(a5(Q)){const st=pte(Q,Pe,$.current.answers);st&&St(st);return}if(Q==="retry"){U.start("make",{draw:!1,shot:((xt=$.current.answers.source)==null?void 0:xt.door)==="shot"});return}if(Pe.kind==="confirm"){if(Q==="set-start"){Pe.id==="draw-set"?(w({type:"set-drawn"}),G({first:!0})):w({type:"set-declined"});return}if(Q==="set-more"){Pe.id==="more"?(w({type:"ask-more"}),G({more:!0})):w({type:"decline-more"});return}if(Q==="set-done"){Pe.id==="retry-failed"?G({roles:Bt.current.filter(st=>st.state==="failed").map(st=>st.role)}):ue();return}Pe.id==="draw"||Pe.id==="again"?U.start("again"):Pe.id==="use"?U.use():Pe.id==="another-shot"&&An.current("shot")}},[Nt,St,U.start,U.use,G,ue,Be,Qe,at,Mt]),vn=Q=>{Q.trim()?!E.current&&mt.target.kind!=="off"&&(E.current=mt.target):E.current=null,S(Q)},Qt=Q=>{const Pe=on(Q);return Pe&&(E.current=null,S("")),Pe};function on(Q){var Pe;{const Ke=Q.trim();if(!Ke)return!1;C(null);const xt=E.current??mt.target;if(xt.kind==="source"){if(rR(Ke))return St({source:{door:"words",text:Ke.slice(0,400)}}),!0;const st=ate(Ke),Kt=Object.keys(st);return Kt.length>0?(St({source:{door:"guided"},...Object.fromEntries(Kt.map(mn=>[mn,{pick:st[mn]}]))}),!0):(vt(Ke,x5(k5(Ke,"source")??"vague","source"),"source"),!0)}if(xt.kind==="row"&&cp(xt.id)){const st=k5(Ke,"row");if(st)return vt(Ke,x5(st,"row"),xt.id),!0;const Kt=(Pe=$.current.answers[xt.id])==null?void 0:Pe.pick;return St({[xt.id]:{...Kt?{pick:Kt}:{},words:Ke.slice(0,200)}}),!0}if(xt.kind==="name")return w({type:"name",text:XM(Ke)??Ke}),!0;if(xt.kind==="add"||xt.kind==="change"){if(v.job||U.starting)return!1;const st=Hte(Ke),Kt=Kte(v);return st.kind==="rename"?(w({type:"name",text:st.name}),vt(Ke,be.renamed(st.name),Kt),!0):st.kind!=="change"?(vt(Ke,st.say,Kt),st.kind!=="refuse"):(xt.kind==="add"?U.start("change",{ask:Ke,draw:!1}):Ote(v,Ke)?U.start("again"):U.start("change",{ask:Ke}),!0)}return!1}}const Rt=s.useCallback(Q=>{v.job||(Q==="name"?N(!0):a5(Q)&&(Q==="shot"&&Xe(""),d5(v)?q(Q):g({type:"edit",id:Q})))},[v]),An=s.useRef(Rt);An.current=Rt;const Vt=s.useCallback((Q,Pe)=>{Q==="name"&&(Pe.trim()&&w({type:"name",text:Pe.trim()}),N(!1))},[]),re=s.useCallback(()=>{N(!1),g({type:"cancel-edit"})},[]),ae=Mr(v),fe=Z&&O.job?Uv({status:O.job.status,step:O.job.current,done:O.job.done.length,total:O.job.roles.length,error:O.job.error}):void 0,Te=v.job?v8(v):U.saving?"Saving":fe,Ue=[];let ut=null;const gt=Q=>({view:"place",label:"The place",state:Q==="place"?"current":"approved",hash:(ae==null?void 0:ae.hash)??void 0,photo:!1,drawing:!1,approved:!0,error:!1});if(I){const Q=Z?(wt=O.job)==null?void 0:wt.current:null,Pe=((Ce=[...me].reverse().find(Kt=>Kt.state==="shown"))==null?void 0:Ce.role)??null,Ke=Ne??Q??Pe??"place",xt=((xe=me[0])==null?void 0:xe.role)==="hero"&&me[0].state==="shown";xt||Ue.push(gt(Ke));for(const[Kt,mn]of me.entries())Ue.push({view:mn.role,label:Za[mn.role],state:Ke===mn.role?"current":mn.state==="shown"?"approved":"todo",hash:mn.hash,photo:!1,drawing:mn.state==="drawing",approved:mn.state==="shown",error:mn.state==="failed"}),xt&&Kt===0&&Ue.push(gt(Ke));const st=Ue.find(Kt=>Kt.view===Ke)??Ue[0];ut={hash:st.hash,drawing:st.drawing}}else if(ae!=null&&ae.hash&&ae.hero){const Q=Ne==="place"?"place":"hero";Ue.push({view:"hero",label:Za.hero,state:Q==="hero"?"current":"approved",hash:ae.hero,photo:!1,drawing:!1,approved:!0,error:!1},gt(Q))}const Pt=!f&&(!!p.answers.source||v.versions.length>0);return{title:f?be.editTitle:be.title,turns:Zt,working:Te,busy:U.saving,resumed:!!h,memoryKey:l,stage:ut?{hash:ut.hash,alt:`${v.name.trim()||(ae==null?void 0:ae.reading.name)||"The scene"}, in use`,drawing:ut.drawing||!!v.job&&v.job.phase==="drawing",doing:fe??v8(v),items:Ue,onPick:Q=>ne(Q)}:{hash:(Ne==="place"?ae==null?void 0:ae.hash:qM(ae))??void 0,alt:`Preview of ${v.name.trim()||(ae==null?void 0:ae.reading.name)||"the scene"}`,drawing:!!v.job&&v.job.phase==="drawing",since:((et=v.job)==null?void 0:et.since)??void 0,doing:v8(v),takes:v.job?void 0:Cte(v),onTake:U.putBack,items:Ue,onPick:Q=>ne(Q)},composer:{placeholder:mt.placeholder,label:mt.label,action:mt.action,disabled:mt.target.kind==="off",why:mt.target.kind==="off"&&mt.target.why||null,working:mt.working,onStop:v.job?()=>{C(null),U.stop().then(Q=>{Q||C(be.stopLost)})}:Z&&I?()=>{oe(!0),je.stopSceneExamples(t.id,I).then(()=>O.again()).catch(()=>{oe(!1),C(be.stopLost)})}:void 0,stopping:!!((yt=v.job)!=null&&yt.stopping)||se,focusKey:A,onAttachFiles:mt.attach?Q=>void Nt(Q):void 0,attachLabel:be.attachLabel},text:k,onText:vn,onSend:Qt,onAnswer:ft,onEdit:Rt,onSaveEdit:Vt,onCancelEdit:re,confirmingEdit:D!==null,confirmEdit:()=>{D&&g({type:"edit",id:D}),q(null)},cancelConfirm:()=>q(null),onRestore:(Q,Pe)=>U.putBack(Pe),onRetry:Q=>G({roles:[Q]}),onDescribe:()=>T(String(Date.now())),onStarter:Q=>{vn(Q),T(String(Date.now()))},onPaste:(He==null?void 0:He.id)==="source"||(He==null?void 0:He.id)==="photos"?Q=>void Nt(Q):void 0,canDraw:rt,begun:Pt,unsaved:v.saved?!1:f?p5(v,a):Pt,running:!!v.job||Z,saved:!!I,finish:ue,keptAsDraft:!f&&QM(v),leave:()=>{U.stop(),R.current=!0,AS(l),Wi(l)}}}function Jie({brand:e,applyBrand:t,sceneId:n,seed:r,conversation:a,storageKey:i,caps:l,onClose:u,onStartOver:f,onSaved:h,onDone:p,finish:g}){const v=Qie({brand:e,applyBrand:t,sceneId:n,seed:r,conversation:a,storageKey:i,caps:l,onSaved:h,onDone:p,finish:g}),[w,b]=s.useState(!1),[y,k]=s.useState(!1),S=v.turns[v.turns.length-1],E=(S==null?void 0:S.kind)==="question"?S.question.id:null;s.useEffect(()=>np({open:E}),[E]),s.useEffect(()=>()=>np(null),[]);const j=!!n,N=()=>{if(v.busy){k(!0);return}if(v.saved){v.finish();return}if(v.running||v.keptAsDraft){u();return}if(v.unsaved){b(!0);return}v.leave(),u()};s.useEffect(()=>{!y||v.busy||(k(!1),N())},[y,v.busy]);const A=!j&&v.begun&&!v.saved?o.jsx(qn,{label:be.startOver,tone:"quiet",title:be.startOverTitle,body:be.startOverBody,busy:!1,onConfirm:()=>{v.leave(),f()}}):null;return o.jsx(Ww,{onClose:N,surface:{kind:"scene",glyph:o.jsx(t7,{size:32}),title:v.title,turns:v.turns,busy:v.busy,working:v.working,memoryKey:v.memoryKey,resumed:v.resumed,stage:v.stage,stageEmpty:{lead:be.emptyLead,hint:be.emptyHint},composer:v.composer,text:v.text,onText:v.onText,onSend:v.onSend,onAnswer:v.onAnswer,onEdit:v.onEdit,onSaveEdit:v.onSaveEdit,onCancelEdit:v.onCancelEdit,onRestore:v.onRestore,onRetry:v.onRetry,onDescribe:v.onDescribe,onStarter:v.onStarter,onPaste:v.onPaste,headAction:A,overlay:o.jsxs(o.Fragment,{children:[o.jsx(qn,{label:be.changeIt,title:be.changeTitle,body:be.changeBody,busy:!1,open:v.confirmingEdit,onOpenChange:T=>{T||v.cancelConfirm()},onConfirm:v.confirmEdit}),o.jsx(qn,{label:j?be.discard:be.leave,title:j?be.discardTitle:be.leaveTitle,body:j?be.discardBody:be.leaveBody,busy:!1,open:w,onOpenChange:T=>{T||b(!1)},onConfirm:()=>{b(!1),v.leave(),u()}})]})}})}const w4=e=>{const t=/^asset:([a-f0-9]{32})$/.exec(String(e??""));return t?t[1]:null};function ele(e,t){var l;const r=(((l=e.json)==null?void 0:l.scenes)??[]).find(u=>(u==null?void 0:u.id)===t);if(!r)return null;const a={name:String(r.name??""),prompt:String(r.prompt??""),lighting:String(r.lighting??""),subject:r.subject==="product"||r.subject==="person"?r.subject:"either",description:String(r.description??""),...r.promptName?{promptName:String(r.promptName)}:{},...r.camera?{camera:String(r.camera)}:{},...r.figure?{figure:String(r.figure)}:{},...r.figure&&r.figureTreatment?{figureTreatment:String(r.figureTreatment)}:{},...Array.isArray(r.keywords)?{keywords:r.keywords.map(String)}:{},...Array.isArray(r.collections)?{collections:r.collections.map(String)}:{},...Array.isArray(r.verticals)?{verticals:r.verticals.map(String)}:{}},i=(Array.isArray(r.refs)?r.refs:[]).map(u=>w4(u==null?void 0:u.file)).filter(Boolean);return xte({place:String(r.instruction??""),pictures:i,reading:a,hash:w4(r.preview)??null,anchor:r.anchor===!0,...tle(r),name:a.name})}function tle(e){const t=(Array.isArray(e.examples)?e.examples:[]).find(a=>(a==null?void 0:a.role)==="hero"&&(a==null?void 0:a.from)===e.preview),n=w4(t==null?void 0:t.file);if(!n)return{};const r={...t.product?{product:String(t.product)}:{},...t.presenter?{presenter:String(t.presenter)}:{}};return{hero:n,heroWith:r}}function nle(){return[...crypto.getRandomValues(new Uint8Array(6))].map(t=>t.toString(16).padStart(2,"0")).join("")}function NS(){const{sceneId:e=null,convoId:t=null}=Qs(),{key:n,state:r}=Wn(),{brand:a}=dn(),{applyBrand:i}=Hn(),l=_n(),{announce:u,caps:f}=tw();$c(e?"Edit scene":"Create scene");const[h]=s.useState(()=>e?ele(a,e):null),p=typeof(r==null?void 0:r.from)=="string"?r.from:null,g=p&&(tl(pt.hub,p.split("?")[0])||tl(pt.set,p.split("?")[0])),v=s.useCallback(()=>{var k;p&&(((k=window.history.state)==null?void 0:k.idx)??0)>0?l(-1):l(p??(e?Ir(a,e):qi(a)),{replace:!0})},[l,p,e,a]),w=s.useMemo(()=>t??nle(),[t,n]);s.useEffect(()=>{t||e&&!h||l(e?_v(a,e,w):Xi(a,w),{replace:!0,state:r})},[t,w,e,h,a,l,r]);const b=s.useRef(null),y=s.useMemo(()=>t?ane(a.id,t):null,[a.id,t]);return e&&!h?o.jsx(Ba,{to:Ir(a,e),replace:!0}):y?o.jsx(Ba,{to:Ir(a,y),replace:!0}):o.jsx(Jie,{brand:a,applyBrand:i,sceneId:e,seed:h,conversation:w,storageKey:`scenri:scene-studio:${a.id}:${w}`,caps:f?{canRead:f.canAnalyze,canDraw:f.canGenerate}:null,onClose:v,onStartOver:()=>l(Xi(a),{replace:!0,state:r}),onSaved:(k,S)=>{b.current={made:k,how:S}},finish:g?be.useInAShot:be.openScene,onDone:(k,S)=>{var E,j;if(!(S!=null&&S.existing)&&!G0(a,k)){l(qi(a),{replace:!0});return}if(!(S!=null&&S.existing)){const N=G0(a,k),A=((E=b.current)==null?void 0:E.made.id)===k?b.current.made:null;u({kind:"scene",id:k,name:(A==null?void 0:A.name)??(N==null?void 0:N.name)??"",verticals:(A==null?void 0:A.verticals)??(N==null?void 0:N.verticals)??[],how:((j=b.current)==null?void 0:j.how)??(e===k?"updated":"created")},{quiet:!(g&&p)})}g&&p?l(`${p.split("?")[0]}?scene=${encodeURIComponent(k)}&compose=1`,{replace:!0}):l(Ir(a,k),{replace:!0})}},w)}function zP(){const{brand:e}=dn(),t=_n(),n=yr(e);return s.useCallback(r=>{t(`${n}?product=${encodeURIComponent(r)}&compose=1`)},[n,t])}function rle({product:e,variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,onDelete:u,onRename:f,bookmarked:h,onBookmark:p,chosen:g,batching:v,onPick:w,batch:b,size:y="grid"}){var S,E;const k=s.useMemo(()=>b?Tm({kind:"product",count:b.count,openLabel:"Open",onOpen:()=>n==null?void 0:n(e.id),href:a,onDeselect:()=>w==null?void 0:w(e.id),onAct:b.onAct,onKeep:b.onKeep,allKept:b.allKept}):il({onOpen:n?()=>n(e.id):void 0,href:a,use:r?{label:"Use in a shot",run:()=>r(e.id)}:void 0,select:w?{run:()=>w(e.id)}:void 0,keep:p?{on:!!h,run:()=>p(e.id)}:void 0,onRename:f?()=>f(e.id):void 0,remove:u?{label:"Delete product",run:()=>u(e.id)}:void 0}),[n,r,u,f,w,p,h,a,e.id,b]);return o.jsx(gd,{id:e.id,previewUrl:qr((E=(S=e.shots)==null?void 0:S[0])==null?void 0:E.file),title:Co(e,"tooltip"),primary:Co(e,"card"),secondary:"",useLabel:"Use in a shot",variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,menu:k,bookmarked:h,onBookmark:p,chosen:g,batching:v,onPick:w,size:y})}function sle(e){return o.jsx(bm,{...e})}const BP=s.memo(rle);function ale({product:e,variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,bookmarked:u,onBookmark:f,size:h="grid"}){const p=q0(e.category)??e.category,g=s.useMemo(()=>il({onOpen:n?()=>n(e.id):void 0,href:a,use:r?{label:"Use in a shot",run:()=>r(e.id)}:void 0,keep:f?{on:!!u,run:()=>f(e.id)}:void 0}),[n,r,f,u,a,e.id]);return o.jsx(gd,{id:e.id,previewUrl:e.previewUrl,title:`${Co(e,"tooltip")} · ${p}`,primary:Co(e,"card"),secondary:"",useLabel:"Use in a shot",variant:t,onOpen:n,onUse:r,href:a,selected:i,onToggle:l,menu:g,bookmarked:u,onBookmark:f,size:h})}const UP=s.memo(ale),ole=8,H8="__bookmarked";function ile(){var Bt;const{brand:e,products:t,productsLoaded:n,refreshProducts:r}=dn(),a=((Bt=ZN())==null?void 0:Bt.importing)??!1,{demoProducts:i,applyBrand:l,refreshBrands:u}=Hn(),{push:f}=cr(),h=n&&t.length===0,p=_n(),g=zP(),v=wl(),{q:w,setQ:b,facets:y,setFacets:k,clearSearch:S,clear:E}=Bf(["category","bookmarked"]),j=y.category,N=y.bookmarked==="1",[A,T]=s.useState(()=>rd("product",e.id)),P=at=>T(Pm("product",e.id,at)),C=Iw(`${e.id}|${w}|${j??""}|${N?"1":""}`),[R,$]=ba(Kr.wallDensity,ed),H=Hc(R),D=s.useCallback(at=>$(at),[$]),q=s.useMemo(()=>ym(H),[H]),_=vm(H),U=s.useMemo(()=>{const at=a?t.filter(Mt=>{var ft;return(((ft=Mt.shots)==null?void 0:ft.length)??0)>0}):t;return CN(at).map(Mt=>({product:Mt,category:ew(Mt),own:!0}))},[t,a]),Y=s.useMemo(()=>i.map(at=>({product:at,category:at.category,own:!1})),[i]),I=s.useMemo(()=>[...U,...Y],[U,Y]),F=s.useMemo(()=>I.reduce((at,Mt)=>at+(A.includes(Mt.product.id)?1:0),0),[I,A]),O=N&&F===0,Z=O&&h,V=O&&!h,B=s.useMemo(()=>{const at=new Map;for(const{category:Mt}of I)Mt&&at.set(Mt,(at.get(Mt)??0)+1);return at},[I]),K=s.useMemo(()=>Y0.filter(at=>B.has(at.key)),[B]),ee=I.length>0?"tabs":"none",se=s.useCallback(at=>p(ga(e,at)),[p,e]),[oe,me]=s.useState(null),[ce,we]=s.useState(!1),[G,ue]=s.useState(null),[Ne,ne]=s.useState(!1),[Fe,Oe]=s.useState(null),[ot,Xe]=s.useState(!1),X=s.useCallback(at=>{const Mt=t.find(ft=>ft.id===at);Mt&&me(Mt)},[t]),J=at=>at.origin==="catalog"||at.id.startsWith("cat-"),ge=s.useCallback(at=>{const Mt=t.find(ft=>ft.id===at);!Mt||J(Mt)||(Oe(null),ue(Mt))},[t]),ve=async at=>{if(!(!G||Ne)){ne(!0),Oe(null);try{l(await je.updateProduct(e.id,G.id,{name:at})),ue(null)}catch(Mt){const ft=ln(Mt,"Could not rename this product");Oe([ft.title,ft.detail].filter(Boolean).join(" "))}finally{ne(!1)}}},Ze=async()=>{if(!oe||ce)return;we(!0);const at=oe.origin==="catalog"||oe.id.startsWith("cat-");try{at?(await je.deleteCatalogProduct(e.id,oe.id),await r()):l(await A6(e.id,oe.id)),C.forget(oe.id),me(null)}catch(Mt){(Mt==null?void 0:Mt.status)===404?(await Promise.all([u(),r()]),C.forget(oe.id),me(null)):f(ln(Mt,"Could not delete this product"))}finally{we(!1)}},Ye=s.useCallback(at=>at.filter(({product:Mt})=>Z||!N||A.includes(Mt.id)).filter(({category:Mt})=>!j||Mt===j).filter(({product:Mt,category:ft})=>jo([kw(Mt),q0(ft)].filter(Boolean).join(" "),w)).map(({product:Mt})=>Mt),[j,w,N,A,Z]),ke=s.useMemo(()=>Ye(U),[Ye,U]),te=s.useMemo(()=>Ye(Y),[Ye,Y]),{visible:le,remaining:Me,showMore:ze}=tf(ke,`${j??""}|${N?"keepers":""}|${w}`),[Re,Be]=s.useState(null);s.useEffect(()=>{if(!Re||Me<=0)return;const at=Re.closest(".sc-home"),Mt=new IntersectionObserver(ft=>{ft.some(vn=>vn.isIntersecting)&&ze()},{root:at,rootMargin:"200% 0px"});return Mt.observe(Re),()=>Mt.disconnect()},[Re,Me,ze]);const Qe={key:"category",label:"Category",everyLabel:"All products",everyCount:I.length,selected:N?H8:j,onSelect:at=>k(at===H8?{bookmarked:"1",category:null}:{bookmarked:null,category:at}),options:[{value:H8,label:"Keepers",count:F},...K.map(at=>({value:at.key,label:at.label,count:B.get(at.key)??0}))]},rt=o.jsxs("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>v("product"),children:[o.jsx(fr,{size:12})," Add product"]}),_e=h,zt=t.length>0,Et=o.jsx(Dm,{title:"Products",filters:o.jsx(Hm,{mode:ee,group:Qe}),density:o.jsx(wm,{value:H,onChange:D}),search:I.length>=ole&&o.jsx(xd,{value:w,onChange:b,noun:"products",total:I.length})}),Zt=at=>{const Mt=t.find(vn=>vn.id===at);return Mt&&Mt.origin==="catalog"||at.startsWith("cat-")?je.deleteCatalogProduct(e.id,at):A6(e.id,at)},He=()=>{const at=[...C.ids];at.length===1?X(at[0]):Xe(!0)},mt=[...C.ids],vt=mt.length>0&&mt.every(at=>A.includes(at)),St=()=>T(Ew("product",e.id,mt,!vt)),kt=$m(C.ids.size,vt,"products"),Nt=async()=>{if(ce)return;const at=[...C.ids];we(!0);try{const{failed:Mt,error:ft}=await wp(at,Zt);await Promise.all([u(),r()]),C.retain(Mt),Xe(!1),ft&&f(ln(ft,"Could not delete these products"))}finally{we(!1)}};return o.jsx(Of.Provider,{value:_,children:o.jsxs(gs,{children:[o.jsxs("main",{className:"sc-looks sc-products",id:"main","data-hero":_e||void 0,onClick:C.onBlank,children:[!_e&&Et,!n&&o.jsx("div",{className:"sc-masonry","data-density":!0,"data-density-size":_,style:q,"aria-hidden":!0,children:o.jsx(sle,{size:"grid",count:8})}),zt&&le.length>0&&o.jsxs("section",{className:"sc-owned",children:[o.jsx("div",{className:"sc-sec-head",children:o.jsx("h2",{className:"sc-sec-title",children:"Your products"})}),o.jsx("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":_,style:q,children:le.map(at=>o.jsx(BP,{product:at,variant:"use",size:"grid",onOpen:se,href:ga(e,at.id),onUse:g,bookmarked:A.includes(at.id),onBookmark:P,onDelete:X,onRename:J(at)?void 0:ge,chosen:C.ids.has(at.id),batching:C.batching==="product",onPick:C.picking("product")?Mt=>C.toggle("product",Mt):void 0,batch:C.kind==="product"&&C.ids.has(at.id)?{count:C.ids.size,onAct:He,onKeep:St,allKept:vt}:null},at.id))}),Me>0&&o.jsx("div",{ref:Be,"aria-hidden":!0}),Me>0&&o.jsx("div",{className:"sc-lib-more",children:o.jsxs("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:ze,children:["Show ",Math.min(Me,60)," more"]})}),G&&o.jsx(Hw,{title:"Rename product",name:G.name,maxLength:500,busy:Ne,error:Fe,onConfirm:at=>void ve(at),onDismiss:()=>{Ne||ue(null)}}),oe&&o.jsx(qn,{label:"Delete product",title:`Delete ${oe.name}?`,body:di("product",1),open:!0,busy:ce,onOpenChange:at=>{!at&&!ce&&me(null)},onConfirm:()=>void Ze()}),ot&&o.jsx(qn,{label:as("product",C.ids.size).menu,title:`${as("product",C.ids.size).menu}?`,body:di("product",C.ids.size),open:!0,busy:ce,onOpenChange:at=>{!at&&!ce&&Xe(!1)},onConfirm:()=>void Nt()})]}),_e&&o.jsx(wo,{shape:"cold",title:o.jsxs(o.Fragment,{children:["Bring in a ",o.jsx("em",{children:"product"})]}),body:"Upload a few clean shots, or import your store, and it stays exact in every image you make.",action:rt}),zt&&le.length>0&&te.length>0&&o.jsx("div",{className:"sc-sec-head sc-owned-divider",children:o.jsx("h2",{className:"sc-sec-title",children:"Scenri products"})}),_e&&Y.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(Fw,{label:"Or borrow one of ours"}),Et]}),te.length>0&&o.jsx("div",{className:"sc-masonry","data-wall":!0,"data-density":!0,"data-density-size":_,style:q,children:te.map(at=>o.jsx(UP,{product:at,variant:"use",size:"grid",onUse:g,onOpen:se,href:ga(e,at.id),bookmarked:A.includes(at.id),onBookmark:P},at.id))}),n&&V&&o.jsx(wo,{shape:"zero",title:"Nothing in Keepers yet",body:"Keep a product from its card and it stays here.",mark:Dw,action:o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>k({bookmarked:null}),children:"Browse every product"})}),n&&!V&&ke.length===0&&te.length===0&&o.jsx(Om,{noun:"products",q:w,facet:N?"Keepers":j?q0(j):null,onClearSearch:S,onClearAll:E})]}),o.jsxs("div",{className:"sc-wall-dock",children:[C.kind==="product"&&C.ids.size>0&&o.jsx(Ow,{count:C.ids.size,loaded:le.length,tool:as("product",C.ids.size).tool,icon:as("product",C.ids.size).icon,danger:!0,onAct:He,keep:{label:kt.tool,filled:vt,onAct:St},onClear:C.clear,onSelectAll:()=>C.selectAll("product",le.map(at=>at.id))}),o.jsx(Tw,{})]})]})})}function lle({refs:e,cap:t,note:n,addLabel:r,busy:a,onAdd:i,onPromote:l,onRemove:u}){const[f,h]=s.useState(null),p=s.useMemo(()=>e.find(N=>N.file===f)??e[0],[e,f]);s.useEffect(()=>{var N;e.length&&!e.some(A=>A.file===f)&&h(((N=e[0])==null?void 0:N.file)??null)},[e,f]);const g=p?e.findIndex(N=>N.file===p.file):-1,v=!!l&&g>0,w=!!u&&!!p&&e.length>1,b=!!(r&&i&&e.length>0),y=e.length>1||b,{shellRef:k,railRef:S,page:E}=XR(e.length),j=N=>{const A=N==null?void 0:N[0];A&&(i==null||i(A))};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-refstage",children:p?o.jsx("div",{className:"sc-refstage-frame",children:o.jsx("img",{src:p.url,alt:""})}):i?o.jsxs("label",{className:"sc-refstage-blank sc-refstage-drop","data-busy":a||void 0,onDragOver:N=>{N.preventDefault(),N.dataTransfer.dropEffect="copy"},onDrop:N=>{N.preventDefault(),j(N.dataTransfer.files)},children:[o.jsx("input",{type:"file",accept:"image/*",hidden:!0,disabled:a,onChange:N=>{j(N.target.files),N.target.value=""}}),a?o.jsx(Ar,{size:"2"}):o.jsx(fr,{size:22,weight:"bold"}),o.jsx("span",{children:"Add a reference"})]}):o.jsx("span",{className:"sc-refstage-blank",children:o.jsx(Js,{size:22})})}),y&&o.jsxs("div",{className:"sc-refrail-shell",ref:k,children:[o.jsxs("div",{className:"sc-refrail-track",children:[o.jsx("button",{type:"button",className:"sc-refrail-arrow prev","aria-label":"Previous references",onClick:()=>E(-1),children:o.jsx(Sa,{size:13,weight:"bold"})}),o.jsx("button",{type:"button",className:"sc-refrail-arrow next","aria-label":"Next references",onClick:()=>E(1),children:o.jsx(cl,{size:13,weight:"bold"})}),o.jsx("div",{className:"sc-refrail",ref:S,children:e.map((N,A)=>o.jsx("button",{type:"button",className:"sc-refrail-item","data-on":(p==null?void 0:p.file)===N.file?"":void 0,"data-spare":A>=t?"":void 0,"aria-label":`Reference ${A+1}`,"aria-pressed":(p==null?void 0:p.file)===N.file,onClick:()=>h(N.file),children:o.jsx("img",{src:N.url,alt:"",loading:"lazy"})},N.file))})]}),b&&o.jsxs("label",{className:"sc-refrail-item sc-refrail-add","data-busy":a||void 0,children:[o.jsx("input",{type:"file",accept:"image/*",hidden:!0,disabled:a,onChange:N=>{j(N.target.files),N.target.value=""}}),a?o.jsx(Ar,{size:"1"}):o.jsx(fr,{size:16,weight:"bold"}),o.jsx("span",{className:"sc-vh",children:r})]})]}),(v||w)&&o.jsx("div",{className:"sc-refacts",children:o.jsxs("span",{className:"sc-refacts-pair",children:[v&&o.jsxs("button",{type:"button",className:"sc-refact sc-refact-lead",onClick:()=>l==null?void 0:l(p.file),children:[o.jsx(SO,{size:14,weight:"bold"}),"Use first"]}),w&&o.jsx("button",{type:"button",className:"sc-refact sc-refact-aside",onClick:()=>u==null?void 0:u(p.file),children:"Remove"})]})}),o.jsx("p",{className:"sc-lookpage-note",children:n})]})}function cle({value:e,onChange:t,onBlur:n,label:r,placeholder:a,className:i="sc-lookpage-titleedit"}){const l=s.useRef(null),u=f=>{f&&(f.style.height="auto",f.style.height=`${f.scrollHeight}px`)};return s.useEffect(()=>u(l.current),[e]),o.jsx("textarea",{ref:l,className:i,rows:1,dir:"auto","aria-label":r,placeholder:a,value:e,onChange:f=>{u(f.currentTarget),t(f.target.value)},onBlur:n,onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),f.currentTarget.blur())}})}function ule({value:e,onChange:t}){const n=q0(e)??"Other",r=e&&Y0.some(a=>a.key===e)?e:"other";return o.jsxs(ws,{children:[o.jsx(ys,{children:o.jsxs("button",{type:"button",className:"sc-pdetails-field sc-catpick","aria-label":`Category: ${n}`,children:[n,o.jsx(nl,{size:11,weight:"bold"})]})}),o.jsx(bs,{align:"center",sideOffset:8,children:o.jsx(Gh,{value:r,children:Y0.map(a=>o.jsx(ju,{value:a.key,onSelect:()=>t(a.key),children:a.label},a.key))})})]})}const O8='mm|cm|inches|inch|in|m|"';function MS(e){if(!e)return;const t=e.toLowerCase();return t==='"'||t==="inch"||t==="inches"?"in":t==="mm"||t==="cm"||t==="m"||t==="in"?t:void 0}function af(e){const t=Number(e.trim().replace(",","."));return e.trim()&&Number.isFinite(t)&&t>0?String(t):""}const Wf=["height","width","depth"],y4={height:"Height",width:"Width",depth:"Depth"};function WP(e){var f,h,p,g,v,w;const t={unit:"cm",height:"",width:"",depth:""},n=e.trim();if(!n||!new RegExp(O8,"i").test(n))return t;const r={},a=(b,y)=>{if(r[y])return;const k=n.match(new RegExp(`(\\d+(?:[.,]\\d+)?)\\s*(${O8})?\\s*(?:${b})\\b`,"i"));if(!k)return;const S=af(k[1]);S&&(r[y]={value:S,unit:MS(k[2])})};a("tall|high","height"),a("across|wide","width"),a("long","width"),a("deep","depth");const i=Wf.filter(b=>r[b]);if(i.length){const b=new Set(i.map(y=>{var k;return(k=r[y])==null?void 0:k.unit}).filter(y=>!!y));return b.size>1?t:{unit:[...b][0]??"cm",height:((f=r.height)==null?void 0:f.value)??"",width:((h=r.width)==null?void 0:h.value)??"",depth:((p=r.depth)==null?void 0:p.value)??""}}const l=[];for(const b of n.matchAll(new RegExp(`(\\d+(?:[.,]\\d+)?)\\s*(${O8})?`,"gi"))){const y=af(b[1]);y&&l.push({value:y,unit:MS(b[2])})}if(!l.length)return t;const u=l.map(b=>b.unit).filter(b=>!!b);return!u.length||new Set(u).size>1?t:{unit:u[u.length-1],height:((g=l[0])==null?void 0:g.value)??"",width:((v=l[1])==null?void 0:v.value)??"",depth:((w=l[2])==null?void 0:w.value)??""}}function dle(e){const t=WP(e),n=Wf.flatMap(i=>t[i]?[`${y4[i]} ${t[i]} ${t.unit}`]:[]);if(n.length)return n;const r=e.trim();if(!r)return[];const a=r.replace(/^about\s+/i,"");return[a.charAt(0).toUpperCase()+a.slice(1)]}const fle={height:"tall",width:"across",depth:"deep"};function hle(e){return Wf.map(t=>{const n=af(e[t]);return n?`${n} ${e.unit} ${fle[t]}`:""}).filter(Boolean).join(" and ")}function ple(e,t){return Wf.every(n=>af(e[n])===af(t[n]))}function mle({size:e,category:t,busy:n,error:r,onSave:a,onDismiss:i}){const l=t??"other",u=(e==null?void 0:e.text)??"",[f]=s.useState(()=>WP(u)),[h,p]=s.useState(f),[g,v]=s.useState(l),w=(S,E)=>S.trim().toLowerCase()===E.trim().toLowerCase(),b=ple(h,f)?u:hle(h),y=()=>{if(!n){if(w(b,u)&&g===l)return i();a({size:b,category:g})}},k=(e==null?void 0:e.by)==="person"?"Yours. Clear it to go back to the size read from its photo.":(e==null?void 0:e.by)==="record"?"From your store's listing.":e?"Read from its photo.":"Not read yet.";return o.jsxs(_s,{className:"sc-newdlg sc-pdetails",maxWidth:"min(460px, 94vw)",onDismiss:i,children:[o.jsxs("div",{className:"sc-newdlg-head",children:[o.jsx(ks,{className:"sc-newdlg-title",children:"Details"}),o.jsx(Ss,{asChild:!0,children:o.jsx("button",{type:"button",className:"sc-set-close sc-newdlg-close","aria-label":"Close",children:o.jsx("span",{"aria-hidden":!0,children:"×"})})})]}),o.jsxs("div",{className:"sc-newdlg-body",children:[o.jsxs("div",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Category"}),o.jsx(ule,{value:g,onChange:v}),o.jsx("span",{className:"sc-pdetails-hint",children:"Where it is filed, so it surfaces with that kind of product."})]}),o.jsxs("div",{className:"sc-pdetails-row",children:[o.jsx("span",{className:"sc-pdetails-lb",children:"Size"}),o.jsx("div",{className:"sc-size",children:Wf.map(S=>o.jsxs("label",{className:"sc-size-dim",children:[o.jsx("span",{className:"sc-size-name",children:y4[S]}),o.jsxs("span",{className:"sc-size-box",children:[o.jsx("input",{className:"sc-pdetails-field",inputMode:"decimal","aria-label":y4[S],value:h[S],onChange:E=>p({...h,[S]:E.target.value}),onKeyDown:E=>E.key==="Enter"&&y()}),o.jsx("span",{className:"sc-size-unit","aria-hidden":!0,children:h.unit})]})]},S))}),o.jsx("span",{className:"sc-pdetails-hint",children:k})]}),r&&o.jsx("p",{className:"sc-assetform-err",children:r})]}),o.jsxs("div",{className:"sc-newdlg-foot",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost",onClick:i,children:"Cancel"}),o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary","data-busy":n||void 0,onClick:y,children:n?"Saving":"Save"})]})]})}const gle=3;function vle(e){const t=e,n=(t.brand??t.vendor??"").trim();return!n||e.name.toLowerCase().startsWith(n.toLowerCase())?null:n}function wle(e){return e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"").replace(/<[^>]+>/g," ").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/\s+/g," ").trim()}function yle(e,t){if(e.length<=t)return e;const n=e.slice(0,t+1).search(/[.!?](\s|$)/);if(n>40)return e.slice(0,n+1);const r=e.lastIndexOf(" ",t);return`${e.slice(0,r>40?r:t).trimEnd()}…`}function ble(){var ze;const{productId:e=""}=Qs(),{brand:t,products:n,refreshProducts:r}=dn(),{demoProducts:a,demoProductsLoaded:i,applyBrand:l,refreshBrands:u}=Hn(),f=_n(),h=zP(),{push:p}=cr(),[g,v]=s.useState(!1),[w,b]=s.useState(!1),[y,k]=s.useState(null),S=s.useRef(null),E=s.useRef({}),j=s.useRef(!1),N=Im(),A=n.find(Re=>Re.id===e),[T,P]=s.useState(null);s.useEffect(()=>{if((A==null?void 0:A.origin)!=="catalog"){P(null);return}let Re=!0;return je.libraryProduct(t.id,A.id).then(Be=>{Re&&P(Be.product)}).catch(()=>{}),()=>{Re=!1}},[t.id,A]);const C=T&&A&&T.id===A.id?{...T,...A,shots:T.shots}:A,R=s.useMemo(()=>C?void 0:a.find(Re=>Re.id===e),[C,a,e]);$c((ze=C??R)==null?void 0:ze.name);const[$,H]=s.useState([]);s.useEffect(()=>{if(!R){H([]);return}let Re=!0;return je.demoProductFrames(R.id).then(Be=>{Re&&H(Be.frames)}).catch(()=>{Re&&H([])}),()=>{Re=!1}},[R==null?void 0:R.id]);const[D,q]=s.useState((C==null?void 0:C.name)??"");s.useEffect(()=>{q((C==null?void 0:C.name)??"")},[C==null?void 0:C.id]);const _=_w(t.id,[e??""]),[U,Y]=s.useState(null),[I,F]=s.useState(!1),[O,Z]=s.useState(!1),[V,B]=s.useState(null),K=!!(C??R);s.useEffect(()=>{if(Y(null),!K||!e)return;let Re=!0;return je.productSize(t.id,e).then(Be=>{Re&&Y(Be.size)}).catch(()=>{}),()=>{Re=!1}},[t.id,e,K]);const ee=async Re=>{if(!e)return!1;const Be=N();Z(!0),B(null);try{const Qe=await je.setProductSize(t.id,e,Re);return Be()&&(Y(Qe.size),F(!1)),!0}catch(Qe){return B(String(Qe.message??Qe)),!1}finally{Z(!1)}},se=((C==null?void 0:C.origin)??"manual")==="manual",oe=async(Re,Be)=>{Be&&Re&&typeof Re=="object"&&"json"in Re?l(Re):await r()},me=Re=>{if(!C||j.current)return;E.current={...E.current,...Re},S.current&&clearTimeout(S.current);const Be=t.id,Qe=C.id,rt=se;S.current=setTimeout(()=>{S.current=null;const _e=E.current;E.current={},(rt?je.updateProduct(Be,Qe,_e):je.updateCatalogProduct(Be,Qe,_e)).then(Et=>oe(Et,rt)).catch(Et=>k(String(Et.message??Et)))},500)},ce=async Re=>{const Be=(U==null?void 0:U.text)??"",Qe=Re.size.trim().toLowerCase()!==Be.trim().toLowerCase();Qe&&!await ee(Re.size)||(Re.category!==(Fe??"other")&&me({category:Re.category}),Qe||F(!1))},we=async Re=>{const Be=se;v(!0),k(null);try{await oe(await Re,Be)}catch(Qe){k(String(Qe.message??Qe))}finally{v(!1)}},G=async()=>{if(!C||j.current)return;j.current=!0,S.current&&clearTimeout(S.current),S.current=null,E.current={};const Re=N(),Be=Du(t),Qe=C.origin==="catalog"||C.id.startsWith("cat-");b(!0),k(null);try{Qe?(await je.deleteCatalogProduct(t.id,C.id),await r()):l(await A6(t.id,C.id))}catch(rt){if((rt==null?void 0:rt.status)!==404){j.current=!1,Re()&&(k(String(rt.message??rt)),b(!1));return}await Promise.all([u(),r()])}Re()&&f(Be,{replace:!0})};if(!C&&!R&&!i)return o.jsx(gs,{children:o.jsxs("main",{className:"sc-lookpage sc-productpage",id:"main",children:[o.jsxs("div",{className:"sc-refskeleton","aria-hidden":!0,children:[o.jsx("span",{className:"sc-refskeleton-title"}),o.jsx("span",{className:"sc-refskeleton-stage"}),o.jsxs("span",{className:"sc-refskeleton-rail",children:[o.jsx("span",{}),o.jsx("span",{}),o.jsx("span",{})]})]}),o.jsx("p",{className:"sc-vh",role:"status",children:"Loading this product"})]})});if(!C&&!R)return o.jsx(gs,{children:o.jsxs("main",{className:"sc-lookpage",id:"main",children:[o.jsx("h1",{children:"This product isn't here anymore"}),o.jsx("p",{className:"sc-lookpage-lede",children:"It may have been removed, or the link is out of date."}),o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx(Bn,{className:"sc-btn sc-btn-primary",to:Du(t),children:"Browse products"})})]})});const ue=R?"none":se?"full":"fields",Ne=C??R,ne=(C==null?void 0:C.id)??R.id,Fe=C?ew(C):(R==null?void 0:R.category)??null,Oe=vle(Ne),ot=Re=>{const Be=qr(Re.file);return Be?[{file:Re.file,url:Be,angle:Re.angle}]:[]},Xe=R?$.map(Re=>({file:Re.angle,url:Re.url,angle:Re.angle})):((C==null?void 0:C.shots)??[]).flatMap(ot),X=Re=>{const Be=Xe.map(rt=>rt.file),Qe=Be.indexOf(Re)+1;we(je.setProductShots(t.id,ne,Be.filter(rt=>rt!==Re))).then(()=>p({kind:"success",title:"Reference removed",detail:`Reference ${Qe} of ${Be.length}`,action:{label:"Undo",onClick:()=>void we(je.setProductShots(t.id,ne,Be))}}))},J=R?"Our reference set. Yours replaces it.":Xe.length===0?se?"No reference yet.":"No reference yet. Images from your store are still arriving.":Xe.length===1?"One angle. A shot has to guess at every side it can't see.":Xe.length===2?"Two angles. A third pins the shape.":"The first three build every shot. Remove any that show a different colour or version.",ge=ue==="none"?null:"Add image",ve=C!=null&&C.descriptionHtml?yle(wle(C.descriptionHtml),200):"",Ze=(R==null?void 0:R.description)||ve||null,Ye=dle((U==null?void 0:U.text)??""),ke=R?[R.subcategory]:[C==null?void 0:C.variant,C==null?void 0:C.material,Ye.length?null:C==null?void 0:C.dimensions],te=q0(Fe),le=ke.filter(Boolean),Me=R?a.filter(Re=>Re.id!==ne).slice(0,8):n.filter(Re=>Re.id!==ne).slice(0,8);return o.jsx(gs,{children:o.jsxs("main",{className:"sc-lookpage sc-productpage",id:"main",children:[o.jsx(Vw,{to:Du(t),wall:"Products",where:R?"Scenri library":se?"Yours":"From your store"}),Oe&&o.jsx("p",{className:"sc-lookpage-house",children:o.jsx("em",{className:"sc-accent",children:Oe})}),ue==="full"?o.jsx(cle,{label:"Product name",value:D,onChange:Re=>{q(Re),me({name:Re})}}):o.jsx("h1",{dir:"auto",children:Ne.name}),(te||Ye.length>0)&&o.jsxs("div",{className:"sc-lookpage-marks",children:[te&&o.jsx("ul",{className:"sc-lookpage-cats","aria-label":"Filed under",children:o.jsx("li",{className:"sc-chip","data-static":!0,children:te})}),Ye.length>0&&o.jsx("ul",{className:"sc-lookpage-cats","aria-label":"Size",children:Ye.map(Re=>o.jsx("li",{className:"sc-chip","data-static":!0,children:Re},Re))})]}),Ze&&o.jsx("p",{className:"sc-lookpage-lede",children:Ze}),le.length>0&&o.jsx("p",{className:"sc-lookpage-facts",children:le.join(" · ")}),o.jsxs("div",{className:"sc-lookpage-acts",children:[o.jsx("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>h(ne),children:"Use in a shot"}),o.jsx(Zw,{kind:"product",brandId:t.id,id:ne}),ue!=="none"&&o.jsx(lr,{label:"Edit details",children:o.jsx("button",{type:"button",className:"sc-icon-btn","aria-label":"Edit details","aria-haspopup":"dialog",onClick:()=>{B(null),F(!0)},children:o.jsx(id,{size:17})})})]}),y&&o.jsx("p",{className:"sc-assetform-err",children:y}),o.jsx(lle,{refs:Xe,cap:gle,note:J,addLabel:ge,busy:g,onAdd:ue==="none"?void 0:Re=>void we(mK(t.id,ne,Re)),onPromote:ue==="none"?void 0:Re=>void we(je.setProductShots(t.id,ne,[Re,...Xe.map(Be=>Be.file).filter(Be=>Be!==Re)])),onRemove:ue==="none"?void 0:X}),_.length>0&&o.jsx(Uu,{label:`Shots featuring ${Ne.name}`,children:_.map(Re=>o.jsx(Bw,{node:Re,to:cm(t,null,Re.id)},Re.id))}),Me.length>0&&o.jsx(Uu,{label:R?"Other products in the library":"Other products",children:Me.map(Re=>R?o.jsx(UP,{product:Re,variant:"navigate",size:"slider",onOpen:Be=>f(ga(t,Be)),href:ga(t,Re.id)},Re.id):o.jsx(BP,{product:Re,variant:"navigate",size:"slider",onOpen:Be=>f(ga(t,Be)),href:ga(t,Re.id)},Re.id))}),I&&o.jsx(mle,{size:U,category:Fe,busy:O,error:V,onSave:Re=>void ce(Re),onDismiss:()=>F(!1)}),C&&o.jsx("div",{className:"sc-ownedbits",children:o.jsx("div",{className:"sc-lookpage-acts",children:o.jsx(qn,{label:"Delete product",title:`Delete ${C.name}?`,body:di("product",1),busy:w,onConfirm:()=>void G()})})})]})})}function xle(e,t){const n=new Map,r=[];for(const a of t){n.set(a.id,a.status);const i=e.get(a.id);if(i!==a.status){if(i===void 0){a.status==="running"&&r.push("Generating shot.");continue}a.status==="done"?r.push("Shot ready."):a.status==="error"?r.push(`Shot failed${a.error?`: ${a.error}`:"."}`):a.status==="cancelled"&&r.push("Shot cancelled.")}}return{messages:r,next:n}}const kle=[{label:"Generate",keys:["cmd","enter"]},{label:"Jump to the prompt",keys:["/"]},{label:"Product menu",keys:["$"]},{label:"Scene menu",keys:["/"]},{label:"Presenter menu",keys:["@"]},{label:"Colour menu",keys:["#"]},{label:"Previous or next shot",keys:["←","→"]},{label:"Previous or next in the history",keys:["↑","↓"]},{label:"Refine this shot",keys:["b"]},{label:"Keep or unkeep",keys:["k"]},{label:"Open the shot",keys:["enter"]},{label:"Close, or stop refining",keys:["esc"]},{label:"Assets panel",keys:["."]},{label:"This list",keys:["?"]}];function Sle({open:e,onOpenChange:t}){return o.jsx($v,{open:e,onOpenChange:t,children:o.jsxs(Tv,{maxWidth:"360px","aria-describedby":void 0,children:[o.jsx(Dv,{children:"Shortcuts"}),o.jsx("div",{className:"sc-keys",children:kle.map(n=>o.jsxs("div",{className:"sc-krow",children:[o.jsx("span",{children:n.label}),o.jsx("span",{className:"sc-ksp"}),n.keys.map(r=>o.jsx("kbd",{children:r},r))]},n.label))})]})})}const KP=new Set;function Ele(e){return KP.has(e)}function Cle(e){e&&KP.add(e)}function jle({src:e,fallback:t,alt:n="",aspect:r,guess:a=!0}){const[i,l]=s.useState(!1),u=i&&t?t:e,[f,h]=s.useState(!1),[p,g]=s.useState(u);u!==p&&(g(u),h(!1));const v=s.useRef(null),w=s.useCallback(()=>{Cle(u),h(!0)},[u]),b=s.useCallback(k=>{v.current=k,k!=null&&k.complete&&k.naturalWidth&&w()},[w]);s.useLayoutEffect(()=>{const k=v.current;k!=null&&k.complete&&k.naturalWidth&&w()},[w]);const y=Ele(u);return o.jsxs("span",{className:"sc-cellimg","data-loaded":f||void 0,"data-cached":y||void 0,"data-guess":a||void 0,style:r?{"--sc-cell-ar":r}:void 0,children:[!f&&!y&&o.jsx("span",{className:"sc-shimmer"}),o.jsx("img",{ref:b,src:u,alt:n,loading:y?"eager":"lazy",decoding:y?"sync":"async",onLoad:()=>w(),onError:()=>{t&&!i?l(!0):w()}})]})}function GP({name:e}){return o.jsx(Fu,{name:e})}function Ale({node:e,chosen:t,picking:n,batching:r,armed:a,menu:i,onPick:l,onBranch:u,onToggleKeep:f,onArchive:h,onDelete:p}){const g=Rr(e),v=Yv(),w=(y,k)=>bN(y,k,v),b=()=>{const y=e.images[0];if(!y)return;const k=e.promptHead.slice(0,40).replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"")||"shot",S=document.createElement("a");S.href=Fr(y),S.download=`${k}.png`,S.click()};return o.jsxs(o.Fragment,{children:[!r&&o.jsx("span",{className:"sc-cell-veil","aria-hidden":!0}),n&&w(t?"Deselect":"Select",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-pick","data-on":t||void 0,"aria-pressed":t,"aria-label":t?"Deselect shot":"Select shot",onClick:()=>l==null?void 0:l(e.id),children:o.jsx(Un,{size:13,weight:"bold"})})),a&&!n&&o.jsxs("span",{className:"sc-cell-ctl sc-cell-pick","data-on":!0,title:"Being refined",children:[o.jsx(Un,{size:13,weight:"bold"}),o.jsx("span",{className:"sc-vh",children:"Being refined"})]}),o.jsx("div",{className:"sc-shot-tools",children:f&&o.jsxs("div",{className:"sc-corner",children:[i.length>0&&o.jsxs(ws,{children:[w("More",o.jsx(ys,{children:o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-more","aria-label":`More for ${g}`,children:o.jsx(F4,{size:16,weight:"bold"})})})),o.jsx(bs,{align:"end",sideOffset:4,collisionPadding:12,children:i.map(y=>o.jsxs("span",{style:{display:"contents"},children:[y.separated&&o.jsx(nc,{}),o.jsxs(Yn,{color:y.danger?"red":void 0,onSelect:y.onSelect,children:[o.jsx(GP,{name:y.icon}),y.label]})]},y.key))})]}),u&&!r&&w("Refine",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-branch","data-on":a||void 0,"aria-label":`Refine ${g}`,onClick:()=>u(e.id),children:o.jsx(N9,{size:15,weight:"bold"})})),e.images[0]&&w("Download",o.jsx("button",{type:"button",className:"sc-cell-ctl","aria-label":`Download ${g}`,onClick:b,children:o.jsx(d9,{size:15})})),e.archived?p&&w("Delete permanently",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-danger","aria-label":`Delete ${g} permanently`,onClick:()=>p(e),children:o.jsx(ul,{size:15})})):h&&w("Archive",o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-danger","aria-label":`Archive ${g}`,onClick:()=>h(e),children:o.jsx(Rp,{size:15})})),w(e.kept?"Remove from Keepers":"Add to Keepers",o.jsx("button",{type:"button",className:`sc-cell-ctl sc-cell-keep${e.kept?" sc-cell-star":""}`,"data-on":e.kept||void 0,"aria-pressed":e.kept,"aria-label":e.kept?`Remove ${g} from Keepers`:`Add ${g} to Keepers`,onClick:()=>f(e),children:o.jsx(Ua,{size:15,weight:e.kept?"fill":"regular"})}))]})})]})}function YP(e,t){return e>1?`Remove ${e} shots from ${t}`:`Remove from ${t}`}function vh(e,t,n){return e>1?n(e):t}function Nle(e,{chosen:t,batching:n,versions:r,onOpen:a,onBranch:i,onPick:l,onVersions:u,onToggleKeep:f,onArchive:h,onDeletePermanently:p,shotHref:g,inSet:v,filedIn:w,onRemoveFromSet:b,batch:y}){const k=[{key:"open",icon:"open",label:"Open",onSelect:()=>a(e.id)}];g&&k.push({key:"open-tab",icon:"open-tab",label:"Open in new tab",onSelect:()=>window.open(g(e.id),"_blank")}),i&&!n&&k.push({key:"branch",icon:"refine",label:"Refine",onSelect:()=>i(e.id)});const S=!!(n&&t&&y&&y.count>0),E=!!(S&&y&&y.count>1);l&&k.push({key:"pick",icon:"select",label:t?E?"Deselect this shot":"Deselect":"Select",onSelect:()=>l(e.id)});const j=P=>P?"Remove from Keepers":"Add to Keepers",N=(P,C)=>P?`Remove ${C} shots from Keepers`:`Add ${C} shots to Keepers`;S&&y?k.push({key:"keep",icon:y.allKept?"kept":"keep",label:vh(y.count,j(y.allKept),P=>N(y.allKept,P)),onSelect:y.onKeep,separated:E}):f&&k.push({key:"keep",icon:e.kept?"kept":"keep",label:j(e.kept),onSelect:()=>f(e)});const A=S?y==null?void 0:y.onRemoveFromSet:b,T=S?v?[v]:[]:v?[v]:w??[];if(A)for(const P of T)k.push({key:`unset-${P.id}`,icon:"unset",label:YP(S&&y?y.count:1,P.name),onSelect:()=>A(P)});return r>0&&u&&!n&&k.push({key:"versions",icon:"versions",label:`Show ${r} version${r===1?"":"s"}`,onSelect:()=>u(e.id)}),S&&y?(k.push({key:"archive",icon:y.archived?"restore":"archive",label:y.archived?vh(y.count,"Restore",P=>`Restore ${P} shots`):vh(y.count,"Archive",P=>`Archive ${P} shots`),onSelect:y.archived?y.onRestore:y.onArchive,danger:!y.archived,separated:!0}),y.archived&&k.push({key:"delete",icon:"delete",label:vh(y.count,"Delete permanently",P=>`Delete ${P} shots permanently`),onSelect:y.onDelete,danger:!0,separated:!0})):(h&&k.push({key:"archive",icon:e.archived?"restore":"archive",label:e.archived?"Restore":"Archive",onSelect:()=>h(e),danger:!e.archived,separated:!0}),p&&e.archived&&k.push({key:"delete",icon:"delete",label:"Delete permanently",onSelect:()=>p(e),danger:!0,separated:!0})),k}function qP(e,t){var r,a,i,l;const n=(i=(a=(r=e.brief)==null?void 0:r.rendered)==null?void 0:a.sizes)==null?void 0:i[t];return n&&n[0]>0&&n[1]>0?{aspect:n[0]/n[1],guess:!1}:{aspect:sd((l=e.brief)==null?void 0:l.format),guess:!0}}const Mle=s.memo(function({node:t,selected:n,armed:r,chosen:a,picking:i,batching:l,versions:u,handlers:f,inSet:h,filedIn:p,pickedMeta:g}){const v=Nle(t,{chosen:a,batching:l,versions:u,onOpen:f.onOpen,shotHref:f.shotHref,onBranch:f.onBranch,onPick:f.onPick,onVersions:f.onVersions,onToggleKeep:f.onToggleKeep,onArchive:f.onArchive,onDeletePermanently:f.onDeleteAsk,inSet:h,filedIn:p,onRemoveFromSet:f.onRemoveFromSet?w=>{var b;return(b=f.onRemoveFromSet)==null?void 0:b.call(f,t,w)}:void 0,batch:l&&a&&g&&f.onKeepPicked?{...g,onKeep:f.onKeepPicked,onArchive:f.onArchivePicked??(()=>{}),onRestore:f.onRestorePicked??(()=>{}),onDelete:f.onDeletePickedAsk??(()=>{}),onRemoveFromSet:f.onRemovePickedFromSet}:null});return o.jsxs(Mf,{children:[o.jsx(Rf,{children:o.jsxs("div",{className:"sc-cell","data-fb-node":t.id,"data-selected":n,"data-armed":r||void 0,"data-batching":l||void 0,"data-picked":a||void 0,children:[o.jsx(Bn,{className:"sc-cell-open",to:f.shotHref(t.id),"aria-label":l?`${a?"Deselect":"Select"} ${Rr(t)}`:`Open ${Rr(t)}`,onClick:w=>{var b;l&&(w.preventDefault(),(b=f.onPick)==null||b.call(f,t.id))},children:o.jsx(jle,{src:hn(t.images[0],"tile"),fallback:Fr(t.images[0]),...qP(t,0)})}),o.jsx(Ale,{node:t,chosen:a,picking:i,batching:l,armed:r,menu:v,onPick:f.onPick,onBranch:f.onBranch,onToggleKeep:f.onToggleKeep,onArchive:f.onArchive,onDelete:f.onDeleteAsk})]})}),o.jsx(Pf,{children:v.map(w=>o.jsxs("span",{style:{display:"contents"},children:[w.separated&&o.jsx(om,{}),o.jsxs(Lf,{color:w.danger?"red":void 0,onSelect:w.onSelect,children:[o.jsx(GP,{name:w.icon}),w.label]})]},w.key))})]})}),Rle=s.memo(function({node:t,selected:n,shotHref:r,onCancel:a}){var i;return o.jsxs("div",{className:"sc-cell","data-running":"true","data-fb-node":t.id,"data-selected":n,style:{"--sc-cell-ar":sd((i=t.brief)==null?void 0:i.format)},children:[o.jsxs(Bn,{className:"sc-cell-open",to:r(t.id),"aria-label":`Open ${Rr(t)}, still rendering`,children:[o.jsx("span",{className:"sc-shimmer"}),o.jsx(GR,{since:Ui(t)})]}),a&&o.jsx("button",{type:"button",className:"sc-cell-ctl sc-cell-cancel","data-urgent":hc(Ui(t))>=60||void 0,onClick:()=>a(t),children:"Cancel"})]})}),Ple=s.memo(function({node:t,selected:n,shotHref:r,engineName:a,onRetry:i,onArchive:l}){const u=t.status==="cancelled",f=u?zA():eo(t.error,a==null?void 0:a(t.engineId));return o.jsxs("div",{className:"sc-cell","data-fb-node":t.id,"data-cancelled":u||void 0,"data-failed":!u||void 0,"data-selected":n,children:[o.jsx(Bn,{className:"sc-cell-open",to:r(t.id),"aria-label":`Open ${Rr(t)}`}),o.jsx("span",{className:"sc-cell-failed",children:o.jsx(DA,{failure:f,density:"tile",onRetry:()=>i(t),dismiss:l?{label:t.archived?"Restore":"Dismiss",onClick:()=>l(t)}:void 0})})]})}),Lle=40,$le=1,RS=64,Tle=e=>e>Lle,Dle=e=>Math.floor(e/RS)*RS;function wh(e,t,n){const r=Math.max(0,n-2),a=e!=="failed"&&t&&t>0?t:4/5;return Math.round(r/a)+2+Iu}function PS(e){const t=new Array(e.length+1);let n=0;for(let r=0;r<e.length;r++)t[r]=n,n+=e[r];return t[e.length]=n,t}function Hle(e,t,n){const r=e.length-1;if(r<=0||n<=t)return[0,0];let a=0,i=r;for(;a<i;){const u=a+i>>1;e[u+1]<=t?a=u+1:i=u}const l=a;for(a=l,i=r;a<i;){const u=a+i>>1;e[u]<n?a=u+1:i=u}return[l,a]}function LS(e,t){const n=Array.from({length:Math.max(1,t)},()=>[]);for(let r=0;r<e;r++)n[r%n.length].push(r);return n}function Ole(e,t){const n=t*$le;return[e-n,e+t+n]}function ey(e){const t=e.getBoundingClientRect().top,n=e.querySelector(".sc-toolbar");return n?Math.max(t,n.getBoundingClientRect().bottom):t}function Ile(e,t){const[n,r]=s.useState(()=>({top:0,height:typeof window>"u"?0:window.innerHeight})),a=s.useRef(null),i=s.useRef(null),l=s.useRef((h,p=0)=>{i.current=h?{anchor:h,until:p}:null}).current,u=s.useRef(()=>{}),f=s.useRef(()=>u.current()).current;return s.useLayoutEffect(()=>{if(!e)return;const h=e.closest(".sc-canvas");if(!h)return;let p=0,g=0;const v=()=>{var S;const k=i.current;if(k&&performance.now()<k.until){a.current=k.anchor;return}i.current=null,a.current=h.scrollTop>0?Fle(e,ey(h),(S=a.current)==null?void 0:S.id):null},w=()=>{if(p=0,t){const k=e.getBoundingClientRect().top-h.getBoundingClientRect().top+h.scrollTop,S={top:Dle(h.scrollTop-k),height:h.clientHeight};r(E=>E.top===S.top&&E.height===S.height?E:S)}v(),cancelAnimationFrame(g),g=requestAnimationFrame(v)},b=()=>{p||(p=requestAnimationFrame(w))};u.current=w,w(),h.addEventListener("scroll",b,{passive:!0});const y=new ResizeObserver(b);return y.observe(h),y.observe(e),()=>{cancelAnimationFrame(p),cancelAnimationFrame(g),u.current=()=>{},h.removeEventListener("scroll",b),y.disconnect()}},[e,t]),{...n,anchor:a,resync:f,hold:l}}function Fle(e,t,n){let r=null,a=null;for(const l of e.querySelectorAll(".sc-cell[data-fb-node]")){const u=l.getBoundingClientRect();if(u.bottom<=t||u.height===0)continue;const f=l.getAttribute("data-fb-node");if(!f)continue;const h={id:f,top:u.top,left:u.left};if(u.top>=t-1){const p=!!r&&Math.abs(u.top-r.top)<=1;(!r||u.top<r.top-1||p&&r.id!==n&&(f===n||u.left<r.left))&&(r=h)}else(!a||u.left<a.left)&&(a=h)}const i=r??a;return i?{id:i.id,offset:i.top-t}:null}function _le(e,t,n){const r=s.useRef(new Map),[,a]=s.useState(0),i=s.useRef(null),l=s.useRef(new Set);return s.useLayoutEffect(()=>{if(!t)return;let u=0;const f=new ResizeObserver(h=>{let p=!1;for(const g of h){const v=g.target.getAttribute("data-fb-node");if(!v)continue;const w=g.target;if(w.offsetHeight<=2||w.offsetWidth<=2)continue;const b=(w.offsetHeight-2)/(w.offsetWidth-2),y=r.current.get(v);(y===void 0||Math.abs(y-b)>.004)&&(r.current.set(v,b),p=!0)}p&&!u&&(u=requestAnimationFrame(()=>{u=0,a(g=>g+1)}))});return i.current=f,()=>{cancelAnimationFrame(u),f.disconnect(),i.current=null,l.current=new Set}},[t]),s.useLayoutEffect(()=>{const u=i.current;if(!(!t||!u||!e)){for(const f of l.current)f.isConnected||(u.unobserve(f),l.current.delete(f));for(const f of e.querySelectorAll(".sc-cell[data-fb-node]"))l.current.has(f)||(l.current.add(f),u.observe(f))}}),s.useCallback(u=>{const f=r.current.get(u);return f===void 0?void 0:Math.round(f*Math.max(0,n-2))+2+Iu},[n])}function Vle({nodes:e,selectedId:t,onOpen:n,shotHref:r,onRetry:a,onCancel:i,onToggleKeep:l,onArchive:u,onDeletePermanently:f,picked:h,onPick:p,empty:g,sending:v,onBranch:w,branchingFrom:b,onVersions:y,engineName:k,tile:S,pending:E,onNearEnd:j,inSet:N,setsFor:A,onRemoveFromSet:T,onKeepPicked:P,onArchivePicked:C,onRestorePicked:R,onDeletePicked:$,onRemovePickedFromSet:H}){const D=e.filter(te=>te.kind!=="root"),q=!!p,_=q&&((h==null?void 0:h.size)??0)>0,U=s.useMemo(()=>{if(!h||h.size===0)return null;let te=0,le=0,Me=0;for(const ze of e)!h.has(ze.id)||ze.kind==="root"||(te+=1,ze.kept&&(le+=1),ze.archived&&(Me+=1));return{count:h.size,allKept:te>0&&le===te,archived:te>0&&Me===te}},[e,h]),[Y,I]=s.useState(null),[F,O]=s.useState(!1),[Z,V]=s.useState(null),{tile:B,cols:K}=KY(UY(Z),S,WY()<zY),[ee,se]=s.useState(null);s.useEffect(()=>{if(!ee||!j)return;const te=ee.closest(".sc-canvas"),le=new IntersectionObserver(Me=>{Me.some(ze=>ze.isIntersecting)&&j()},{root:te,rootMargin:"200% 0px"});return le.observe(ee),()=>le.disconnect()},[ee,j]);const oe=s.useRef({onOpen:n,shotHref:r,onRetry:a,onCancel:i,onToggleKeep:l,onArchive:u,onBranch:w,onPick:p,onVersions:y,engineName:k,onRemoveFromSet:T,onKeepPicked:P,onArchivePicked:C,onRestorePicked:R,onDeletePicked:$,onRemovePickedFromSet:H});oe.current={onOpen:n,shotHref:r,onRetry:a,onCancel:i,onToggleKeep:l,onArchive:u,onBranch:w,onPick:p,onVersions:y,engineName:k,onRemoveFromSet:T,onKeepPicked:P,onArchivePicked:C,onRestorePicked:R,onDeletePicked:$,onRemovePickedFromSet:H};const me=!!f,ce=!!$,we=s.useMemo(()=>({onOpen:te=>oe.current.onOpen(te),shotHref:te=>oe.current.shotHref(te),onRetry:te=>oe.current.onRetry(te),onCancel:i?te=>{var le,Me;return(Me=(le=oe.current).onCancel)==null?void 0:Me.call(le,te)}:void 0,onToggleKeep:l?te=>{var le,Me;return(Me=(le=oe.current).onToggleKeep)==null?void 0:Me.call(le,te)}:void 0,onArchive:u?te=>{var le,Me;return(Me=(le=oe.current).onArchive)==null?void 0:Me.call(le,te)}:void 0,onBranch:w?te=>{var le,Me;return(Me=(le=oe.current).onBranch)==null?void 0:Me.call(le,te)}:void 0,onPick:p?te=>{var le,Me;return(Me=(le=oe.current).onPick)==null?void 0:Me.call(le,te)}:void 0,onVersions:y?te=>{var le,Me;return(Me=(le=oe.current).onVersions)==null?void 0:Me.call(le,te)}:void 0,onDeleteAsk:me?te=>I(te):void 0,engineName:k?te=>{var le,Me;return(Me=(le=oe.current).engineName)==null?void 0:Me.call(le,te)}:void 0,onRemoveFromSet:T?(te,le)=>{var Me,ze;return(ze=(Me=oe.current).onRemoveFromSet)==null?void 0:ze.call(Me,te,le)}:void 0,onKeepPicked:P?()=>{var te,le;return(le=(te=oe.current).onKeepPicked)==null?void 0:le.call(te)}:void 0,onArchivePicked:C?()=>{var te,le;return(le=(te=oe.current).onArchivePicked)==null?void 0:le.call(te)}:void 0,onRestorePicked:R?()=>{var te,le;return(le=(te=oe.current).onRestorePicked)==null?void 0:le.call(te)}:void 0,onDeletePickedAsk:ce?()=>O(!0):void 0,onRemovePickedFromSet:H?te=>{var le,Me;return(Me=(le=oe.current).onRemovePickedFromSet)==null?void 0:Me.call(le,te)}:void 0}),[!!i,!!l,!!u,!!w,!!p,!!y,me,ce,!!k,!!T,!!P,!!C,!!R,!!H]),G=[...v?Array.from({length:Math.max(1,v.count)},(te,le)=>({key:`sending-${le}`,node:null,said:v.said})):[],...D.map(te=>({key:te.id,node:te}))],ue=te=>te.status==="cancelled"||te.status==="error"||te.images.length===0,Ne=te=>{const le=te.node;return le?le.status==="running"?o.jsx(Rle,{node:le,selected:le.id===t,shotHref:we.shotHref,onCancel:we.onCancel},le.id):ue(le)?o.jsx(Ple,{node:le,selected:le.id===t,shotHref:we.shotHref,engineName:we.engineName,onRetry:we.onRetry,onArchive:we.onArchive},le.id):o.jsx(Mle,{node:le,selected:le.id===t,armed:le.id===b,chosen:(h==null?void 0:h.has(le.id))??!1,picking:q,batching:_,versions:le.childCount,handlers:we,inSet:N,filedIn:A==null?void 0:A(le.id),pickedMeta:U},le.id):o.jsxs("div",{className:"sc-cell","data-running":"true","data-sending":"true",children:[o.jsx("span",{className:"sc-shimmer"}),o.jsx("span",{className:"sc-cell-tag",children:"sending"}),o.jsx("span",{className:"sc-cell-said",dir:"auto",children:te.said})]},te.key)},ne=te=>{var Me;const le=te.node;return le?le.status==="running"?wh("running",sd((Me=le.brief)==null?void 0:Me.format),B):ue(le)?wh("failed",void 0,B):wh("done",qP(le,0).aspect,B):wh("sending",void 0,B)},Fe=Tle(G.length),Oe=Ile(Z,Fe),ot=_le(Z,Fe,B),Xe=ek(K),X=`${Xe}:${B}`,J=s.useRef(X),ge=s.useRef({items:G,heightOf:ot,estimate:ne});ge.current={items:G,heightOf:ot,estimate:ne};const ve=s.useRef(null);if(s.useLayoutEffect(()=>{const te=J.current;J.current=X;const le=Oe.anchor.current,Me=Z==null?void 0:Z.closest(".sc-canvas");if(!(te===X||!le||!Z||!Me)){if(ve.current={anchor:le,until:performance.now()+Zle},Oe.hold(le,ve.current.until),!$S(Z,Me,le)){const{items:ze,heightOf:Re,estimate:Be}=ge.current,Qe=ze.findIndex(Et=>{var Zt;return((Zt=Et.node)==null?void 0:Zt.id)===le.id});if(Qe<0)return;const rt=LS(ze.length,Xe)[Qe%Xe],_e=PS(rt.map(Et=>(ze[Et].node&&Re(ze[Et].node.id))??Be(ze[Et]))),zt=Z.getBoundingClientRect().top+_e[Math.floor(Qe/Xe)];Me.scrollTop+=zt-ey(Me)-le.offset}Oe.resync()}},[X,Xe,Z,Oe.anchor,Oe.resync,Oe.hold]),s.useLayoutEffect(()=>{const te=ve.current,le=Z==null?void 0:Z.closest(".sc-canvas");if(!(!te||!Z||!le)){if(performance.now()>te.until){ve.current=null;return}$S(Z,le,te.anchor)}}),s.useEffect(()=>{const te=Z==null?void 0:Z.closest(".sc-canvas");if(!te)return;const le=()=>{ve.current=null,Oe.hold(null)},Me=["wheel","touchstart","keydown","pointerdown"];for(const ze of Me)te.addEventListener(ze,le,{passive:!0});return()=>{for(const ze of Me)te.removeEventListener(ze,le)}},[Z,Oe.hold]),E&&P3(D)&&!v){const te=Math.max(1,Math.min(K,8));return o.jsx("div",{className:"sc-feed",ref:V,style:{"--sc-tile":`${B}px`,"--sc-cols":te},children:Array.from({length:te},(le,Me)=>o.jsx("div",{className:"sc-feed-col",children:Array.from({length:2},(ze,Re)=>o.jsx("div",{className:"sc-cell","data-running":"true","data-sending":"true",children:o.jsx("span",{className:"sc-shimmer"})},`pending-${Me}-${Re}`))},`col-${te}-${Me}`))})}if(P3(D)&&!v)return o.jsx(o.Fragment,{children:g??o.jsx("p",{className:"sc-feed-empty",children:"Nothing here yet."})});const Ze=ek(K),Ye=LS(G.length,Ze),ke=Fe?Ole(Oe.top,Oe.height):null;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-feed",ref:V,style:{"--sc-tile":`${B}px`,"--sc-cols":Ze},children:Ye.map((te,le)=>{const Me=`col-${Ze}-${le}`;if(!ke)return o.jsx("div",{className:"sc-feed-col",children:te.map(rt=>Ne(G[rt]))},Me);const ze=te.map(rt=>(G[rt].node&&ot(G[rt].node.id))??ne(G[rt])),Re=PS(ze),[Be,Qe]=Hle(Re,ke[0],ke[1]);return o.jsxs("div",{className:"sc-feed-col",children:[Be>0&&o.jsx("div",{className:"sc-feed-pad",style:{height:Re[Be]},"aria-hidden":!0}),te.slice(Be,Qe).map(rt=>Ne(G[rt])),Qe<te.length&&o.jsx("div",{className:"sc-feed-pad",style:{height:Re[te.length]-Re[Qe]},"aria-hidden":!0})]},Me)})}),j&&o.jsx("div",{className:"sc-feed-end",ref:se,"aria-hidden":!0}),o.jsx(kf,{open:!!Y||F,onOpenChange:te=>{te||(I(null),O(!1))},children:o.jsxs(Sf,{maxWidth:"420px",children:[o.jsx(Ef,{children:F?`Delete ${(U==null?void 0:U.count)??0} shot${((U==null?void 0:U.count)??0)===1?"":"s"} permanently?`:"Delete this shot permanently?"}),o.jsx(Cf,{size:"2",children:"This cannot be undone."}),o.jsxs(Ds,{gap:"3",mt:"4",justify:"end",children:[o.jsx(Af,{children:o.jsx(ma,{variant:"soft",color:"gray",children:"Cancel"})}),o.jsx(jf,{children:o.jsx(ma,{color:"red",onClick:()=>{F?$==null||$():Y&&(f==null||f(Y)),I(null),O(!1)},children:"Delete permanently"})})]})]})})]})}const Zle=800;function $S(e,t,n){const r=e.querySelector(`.sc-cell[data-fb-node="${CSS.escape(n.id)}"]`);if(!r)return!1;const a=r.getBoundingClientRect().top-ey(t)-n.offset;return Math.abs(a)>=1&&(t.scrollTop+=a),!0}function zle(e){return e==="open"||e==="result"?"open":"compact"}function b4({name:e,kind:t,count:n,mode:r,onToggle:a,action:i,children:l}){const u=zle(r);return o.jsxs("div",{className:"sc-agroup","data-mode":r,"data-kind":t,children:[o.jsxs("div",{className:"sc-agroup-h",children:[o.jsxs("button",{type:"button",className:"sc-agroup-t","aria-expanded":r==="open",onClick:a,children:[o.jsx("b",{children:e}),n!==void 0&&n>0&&o.jsx("span",{className:"sc-agroup-n",children:n}),o.jsx(nl,{size:11,className:"sc-agroup-caret","aria-hidden":"true"})]}),i]}),o.jsx("div",{className:"sc-agroup-body",children:o.jsx("div",{className:"sc-agroup-content",children:o.jsx("div",{className:"sc-agroup-layer",children:l(u)},u)})})]})}function XP({candidate:e,on:t,named:n,disabled:r,title:a,onClick:i}){const l=o.jsxs("button",{type:"button",className:"sc-acard","data-on":t||void 0,"aria-label":e.full,"aria-pressed":t,"aria-disabled":r||void 0,title:r?void 0:e.full,onClick:r?void 0:i,children:[o.jsxs("span",{className:"sc-acard-thumb",children:[e.thumb?o.jsx("img",{src:e.thumb,alt:"",loading:"lazy","data-crop":e.crop}):o.jsx("span",{className:"sc-aswatch",style:{display:"grid",placeItems:"center"},children:o.jsx(Js,{size:14})}),o.jsx("span",{className:"sc-acard-tick","aria-hidden":!0,children:o.jsx(Un,{size:10,weight:"bold"})})]}),n&&o.jsxs("span",{className:"sc-acard-label",children:[e.bookmarked&&o.jsxs(o.Fragment,{children:[o.jsx(Ua,{className:"sc-bm-mark",size:10,weight:"fill","aria-hidden":!0}),o.jsx("span",{className:"sc-vh",children:"Kept. "})]}),e.label]})]});return o.jsx($R,{why:r?a:null,children:l})}function I8({kind:e,title:t,items:n,attached:r,mode:a,onToggle:i,onPick:l,onUnpick:u,full:f,moreLabel:h,createLabel:p,onCreate:g}){const v=s.useMemo(()=>new Set(r),[r]),[w,b]=s.useState(vp);return s.useEffect(()=>{a!=="open"&&b(vp)},[a]),a==="result"&&n.length===0?null:o.jsx(b4,{name:t,kind:e,count:n.length,mode:a,onToggle:()=>i(e),action:o.jsx("button",{type:"button",className:"sc-aadd",title:p,"aria-label":p,onClick:g,children:o.jsx(fr,{size:10})}),children:y=>{const{visible:k,more:S}=Kse(n,v,y==="open"?w:u4);return o.jsxs("div",{className:y==="open"?"sc-acard-grid":"sc-arow",children:[k.map(E=>o.jsx(XP,{candidate:E,on:v.has(E.id),named:y==="open",disabled:!!f&&!v.has(E.id),title:f??void 0,onClick:()=>v.has(E.id)?u(E.id):l(E.id)},E.id)),y==="open"&&S>0&&o.jsxs("button",{type:"button",className:"sc-amore-tile",onClick:()=>b(E=>E+L0),"aria-label":`Show ${Math.min(S,L0)} more ${h}`,children:[o.jsxs("span",{className:"sc-amore-n",children:["+",S]}),o.jsx("span",{className:"sc-amore-t",children:"more"})]})]})}})}const TS=220,DS="cubic-bezier(0.32, 0.72, 0, 1)";function F8(e){const t=[];for(const n of e.querySelectorAll(".sc-agroup")){const r=n.querySelector(":scope > .sc-agroup-body");r&&t.push({group:n,body:r,height:r.getBoundingClientRect().height,marginBottom:Number.parseFloat(getComputedStyle(n).marginBottom)||0})}return t}function Ble(e,t){const n=s.useRef(null),r=()=>{const a=e.current;if(!(!a||window.matchMedia("(prefers-reduced-motion: reduce)").matches)){for(const i of F8(a))for(const l of[...i.body.getAnimations(),...i.group.getAnimations()])l.finish();n.current=F8(a)}};return s.useLayoutEffect(()=>{const a=n.current;n.current=null;const i=e.current;if(!(!a||!i))for(const l of F8(i)){const u=a.find(f=>f.group===l.group);if(u){if(Math.abs(u.height-l.height)>.5){const{body:f}=l;f.style.overflow="hidden";const h=f.animate([{height:`${u.height}px`},{height:`${l.height}px`}],{duration:TS,easing:DS}),p=()=>{f.style.overflow=""};h.onfinish=p,h.oncancel=p}Math.abs(u.marginBottom-l.marginBottom)>.5&&l.group.animate([{marginBottom:`${u.marginBottom}px`},{marginBottom:`${l.marginBottom}px`}],{duration:TS,easing:DS})}}},[t]),r}function Ule({brand:e,shots:t,shotsTotal:n,attached:r=VR,full:a,onToken:i,offToken:l,onTemplate:u,offTemplate:f,onClose:h}){const p=zf(),g=wl(),{applyBrand:v}=Hn(),{push:w}=cr(),[b,y]=QW(Kr.assetsExpanded,null),k=s.useRef(null),S=Ble(k,b),E=K=>{S(),y(ee=>ee===K?null:K)},[j,N]=s.useState(""),A=j.trim().length>0,T=K=>{S(),N(""),y(K)},P=K=>A?"result":b===null?"idle":b===K?"open":"collapsed",C=s.useMemo(()=>new Set(ui(e.id)),[e.id]),R=s.useMemo(()=>{const K=ee=>{const se=Gi(ee,p);return Lm(ee,se,{currentId:null,query:"",bookmarked:C,shown:se.length}).items};return{product:K("product"),presenter:K("presenter"),scene:K("scene")}},[p,C]),$=s.useMemo(()=>({product:Bu(R.product,j),presenter:Bu(R.presenter,j),scene:Bu(R.scene,j)}),[R,j]),H=s.useMemo(()=>{var K;return qs((K=e.json)==null?void 0:K.palette)},[e]),D=s.useMemo(()=>A?H.filter(K=>jo(`${K.name} ${K.hex}`,j)):H,[H,j,A]),q=K=>{(async()=>{var se;const ee=zN((se=e.json)==null?void 0:se.palette,K);if(ee.swatch){if(ee.added)try{const oe=await je.updateBrand(e.id,{...e.json??{},palette:ee.palette},e.json);v(oe)}catch(oe){w(ln(oe,"Could not save the brand"));return}T("colors")}})()},_=K=>{(async()=>{var se;const ee=Kq((se=e.json)==null?void 0:se.palette,K);if(ee.removed)try{const oe=await je.updateBrand(e.id,{...e.json??{},palette:ee.palette},e.json);v(oe)}catch(oe){w(ln(oe,"Could not save the brand"))}})()},U=P("shots")==="open",Y=Mw(e.id,"",U),I=s.useMemo(()=>{const K=new Set,ee=[];for(const se of[...t,...Y.items])se.status!=="done"||se.images.length===0||K.has(se.id)||(K.add(se.id),ee.push(se));return ee},[t,Y.items]),F=Math.max(n??0,Y.total,I.length),[O,Z]=s.useState(vp);s.useEffect(()=>{U||Z(vp)},[U]);const V=()=>{Z(K=>K+L0),Y.hasMore&&I.length<O+2*L0&&Y.loadMore()},B=A&&!$.product.length&&!$.presenter.length&&!$.scene.length&&!D.length;return o.jsxs("aside",{ref:k,className:"sc-assets","aria-label":"Assets",children:[o.jsxs("div",{className:"sc-assets-head",children:[o.jsx("b",{children:"Assets"}),o.jsx("button",{type:"button",className:"sc-icon-btn",onClick:h,"aria-label":"Close assets",style:{width:28,height:28},children:o.jsx(Mn,{size:12})})]}),o.jsx("div",{className:"sc-assets-searchbar",children:o.jsxs("div",{className:"sc-assets-search",children:[o.jsx(Gu,{size:12}),o.jsx("input",{value:j,onChange:K=>N(K.target.value),onKeyDown:K=>{K.key==="Escape"&&j&&(K.stopPropagation(),N(""))},placeholder:"Search assets","aria-label":"Search assets in this panel"}),A&&o.jsx("button",{type:"button",className:"sc-assets-clear",onClick:()=>N(""),"aria-label":"Clear search",children:o.jsx(Mn,{size:11})})]})}),B&&o.jsxs("p",{className:"sc-assets-zero",children:["Nothing here matches “",j.trim(),"”."]}),o.jsx(I8,{kind:"product",title:"Products",items:$.product,attached:r.product,mode:P("product"),onToggle:E,onPick:K=>i({t:"product",id:K}),onUnpick:K=>l({t:"product",id:K}),full:a,moreLabel:"products",createLabel:"Add product",onCreate:()=>g("product",{onCreated:K=>{K.kind==="product"&&(T("product"),i({t:"product",id:K.id}))}})}),o.jsx(I8,{kind:"presenter",title:"Presenters",items:$.presenter,attached:r.presenter,mode:P("presenter"),onToggle:E,onPick:K=>i({t:"character",id:K}),onUnpick:K=>l({t:"character",id:K}),full:a,moreLabel:"presenters",createLabel:"Create presenter",onCreate:()=>g("presenter",{onCreated:()=>T("presenter")})}),o.jsx(I8,{kind:"scene",title:"Scenes",items:$.scene,attached:r.scene?[r.scene]:[],mode:P("scene"),onToggle:E,onPick:u,onUnpick:()=>f(),full:a,moreLabel:"scenes",createLabel:"Create scene",onCreate:()=>g("scene",{onCreated:K=>{K.kind==="scene"&&T("scene")}})}),!(A&&D.length===0)&&o.jsx(b4,{name:"Brand colors",count:D.length,mode:P("colors"),onToggle:()=>E("colors"),action:o.jsx(td,{className:"sc-aadd",triggerStyle:{background:"none"},value:xm(H),presets:H.map(K=>K.hex),commitMode:"close",align:"end",label:"Add colour",onChange:q,children:o.jsx(fr,{size:10})}),children:K=>o.jsx("div",{className:"sc-arow",children:(K==="open"?D:D.slice(0,u4)).map(ee=>{const se=r.color.includes(ee.hex.toLowerCase());return o.jsxs("div",{className:"sc-aswatch-tile","data-on":se||void 0,children:[o.jsxs("button",{type:"button",title:`${ee.name} ${ee.hex}`,"aria-pressed":se,onClick:()=>se?l({t:"color",hex:ee.hex,name:ee.name}):i({t:"color",hex:ee.hex,name:ee.name}),children:[o.jsx("span",{className:"sc-aswatch",style:{background:ee.hex}}),o.jsx("span",{className:"sc-acard-tick","aria-hidden":!0,children:o.jsx(Un,{size:10,weight:"bold"})})]}),K==="open"&&o.jsx("button",{type:"button",className:"sc-aswatch-x","aria-label":`Remove ${ee.name}`,title:"Remove",onClick:()=>_(ee.hex),children:o.jsx(Mn,{size:10,weight:"bold"})})]},ee.hex)})})}),I.length>0&&!A&&o.jsx(b4,{name:"Recent shots",count:F,mode:P("shots"),onToggle:()=>E("shots"),children:K=>o.jsxs("div",{className:K==="open"?"sc-acard-grid":"sc-arow",children:[I.slice(0,K==="open"?O:u4).map((ee,se)=>{const oe=ee.images[0],me=r.ref.includes(oe);return o.jsx(XP,{candidate:{label:`Shot ${F-se}`,full:`Shot ${F-se} · as reference`,thumb:hn(oe,"micro")},on:me,named:K==="open",disabled:!!a&&!me,title:a??void 0,onClick:()=>me?l({t:"ref",imageHash:oe}):i({t:"ref",imageHash:oe,label:"Shot"})},ee.id)}),K==="open"&&(I.length>O||Y.hasMore)&&o.jsxs("button",{type:"button",className:"sc-amore-tile",onClick:V,"aria-label":`Show ${L0} more shots`,"aria-busy":Y.loading||void 0,children:[o.jsxs("span",{className:"sc-amore-n",children:["+",Math.max(1,F-Math.min(I.length,O))]}),o.jsx("span",{className:"sc-amore-t",children:"more"})]})]})})]})}function Wle({sets:e,active:t,ungrouped:n,ungroupedCount:r,onPlaceAll:a,onPlaceUngrouped:i,onOpenSet:l,onNewSet:u,onResetNewSet:f,onRenameSet:h,onDeleteSet:p,askCreate:g,lens:v,lensCounts:w,onLens:b,q:y,onQ:k,searchTotal:S,sort:E,onSort:j,tile:N,onTile:A,assets:T,onAssets:P,showAssets:C}){const R=t?t.id:n?"__ungrouped__":"__all__",$=t?t.name:n?"Not in a set":"All shots",H=!!t||n,D=Sr(ta),[q,_]=s.useState(!1),[U,Y]=s.useState(!1),[I,F]=s.useState(!1),[O,Z]=s.useState(""),V=s.useRef(null),B=s.useRef(!1),K=()=>{B.current=!0,Y(!0),Z(""),_(!0)},ee=()=>{t&&(B.current=!1,Y(!1),Z(t.name),_(!0))};s.useEffect(()=>{g&&K()},[g]);const se=()=>{const ue=O.trim();if(!ue)return;const Ne=B.current;B.current=!1,Y(!1),_(!1),Ne?u(ue):h==null||h(ue)},oe=ue=>{if(ue){_(!0);return}const Ne=B.current;B.current=!1,Y(!1),_(!1),Ne&&(f==null||f())},me=jA.map(ue=>({value:ue.id==="all"?null:ue.id,label:ue.label,count:w==null?void 0:w[ue.id]})),ce=o.jsxs(o.Fragment,{children:[o.jsxs(Gh,{value:R,children:[o.jsx(ju,{value:"__all__",onSelect:a,children:"All shots"}),o.jsxs(ju,{value:"__ungrouped__",onSelect:i,children:["Not in a set",r>0?` · ${r}`:""]}),e.length>0&&o.jsx(nc,{}),e.map(ue=>o.jsx(ju,{value:ue.id,onSelect:()=>l(ue),children:ue.name},ue.id))]}),o.jsx(nc,{}),o.jsx(Yn,{onSelect:()=>{f==null||f(),K()},children:"New set"}),t&&h&&o.jsx(Yn,{onSelect:ee,children:"Rename"}),t&&p&&o.jsx(Yn,{color:"red",onSelect:()=>F(!0),children:"Delete set"})]}),we=o.jsx(Gh,{value:E,onValueChange:ue=>j(ue),children:CA.map(ue=>o.jsx(ju,{value:ue.id,children:ue.label},ue.id))}),G=H||E!=="newest";return o.jsxs("div",{className:"sc-toolbar",children:[o.jsxs("div",{className:"sc-toolbar-scope",children:[!D&&o.jsxs("div",{className:"sc-toolbar-where",children:[H&&o.jsx("button",{type:"button",className:"sc-toolbar-back","aria-label":"All shots",onClick:a,children:o.jsx(Sa,{size:16})}),o.jsxs(ws,{children:[o.jsx(ys,{children:o.jsxs("button",{type:"button",className:"sc-toolbar-place","data-on":H||void 0,"aria-label":$,children:[o.jsx(_4,{className:"sc-toolbar-place-ic",size:16}),o.jsx("span",{className:"sc-toolbar-place-t",children:$}),o.jsx(nl,{size:10,className:"sc-caret"})]})}),o.jsx(bs,{align:"start",children:ce})]})]}),o.jsx($v,{open:q,onOpenChange:oe,children:o.jsxs(Tv,{maxWidth:"360px","aria-describedby":void 0,onOpenAutoFocus:ue=>{ue.preventDefault();const Ne=V.current;Ne&&(Ne.focus(),Ne.select())},children:[o.jsx(Dv,{children:U?"Name this set":"Rename set"}),o.jsx("input",{ref:V,className:"sc-in",style:{width:"100%",marginTop:8},value:O,"aria-label":"Set name",onChange:ue=>Z(ue.target.value),onKeyDown:ue=>{ue.key==="Enter"&&se()}}),o.jsxs(Ds,{gap:"3",mt:"4",justify:"end",children:[o.jsx(ma,{variant:"soft",color:"gray",onClick:()=>oe(!1),children:"Cancel"}),o.jsx(ma,{onClick:se,disabled:!O.trim(),children:"Save"})]})]})}),o.jsx(kf,{open:I,onOpenChange:F,children:o.jsxs(Sf,{maxWidth:"420px",children:[o.jsx(Ef,{children:"Delete this set?"}),o.jsx(Cf,{size:"2",children:"Shots stay in the library. Only the set goes."}),o.jsxs(Ds,{gap:"3",mt:"4",justify:"end",children:[o.jsx(Af,{children:o.jsx(ma,{variant:"soft",color:"gray",children:"Cancel"})}),o.jsx(jf,{children:o.jsx(ma,{color:"red",onClick:()=>{p==null||p(),F(!1)},children:"Delete set"})})]})]})}),o.jsx(Nw,{"aria-label":"Shot lenses",activeKey:v==="all"?null:v,items:me,onSelect:ue=>b(ue??"all")})]}),o.jsxs("div",{className:"sc-toolbar-actions",children:[o.jsx(xd,{value:y,onChange:k,noun:"shots",total:S}),D?o.jsxs(ws,{children:[o.jsx(ys,{children:o.jsxs("button",{type:"button",className:"sc-toolbar-btn sc-toolbar-view","data-on":G||void 0,"aria-label":`Set and sort: ${$}`,children:[o.jsx(V4,{size:15}),G&&o.jsx("span",{className:"sc-toolbar-view-dot","aria-hidden":!0})]})}),o.jsxs(bs,{align:"end",children:[o.jsx(S6,{children:"Set"}),ce,o.jsx(nc,{}),o.jsx(S6,{children:"Sort"}),we]})]}):o.jsxs(ws,{children:[o.jsx(ys,{children:o.jsxs("button",{type:"button",className:"sc-toolbar-btn","aria-label":"Sort shots",children:[o.jsx(EO,{size:14}),o.jsx("span",{className:"sc-toolbar-btn-t",children:"Sort"}),o.jsx(nl,{size:10})]})}),o.jsx(bs,{align:"end",children:we})]}),o.jsx(qY,{value:N,onChange:A}),C&&o.jsx("button",{type:"button",className:"sc-icon-btn sc-toolbar-assets","data-on":T||void 0,onClick:P,"aria-label":"Assets panel","aria-pressed":T,title:"Assets panel (.)",children:o.jsx(KO,{size:15,mirrored:!0})})]})]})}function Kle(e){const{push:t}=cr(),n=s.useCallback(l=>je.archiveNode(l.id,!0).then(u=>(e(u),t({kind:"success",title:"Archived",detail:Rr(l),action:{label:"Undo",onClick:()=>void je.archiveNode(l.id,!1).then(e)}}),!0)).catch(u=>(t(ln(u,"Could not archive this shot")),!1)),[e,t]),r=s.useCallback(l=>je.archiveNode(l.id,!1).then(u=>(e(u),!0)).catch(u=>(t(ln(u,"Could not restore this shot")),!1)),[e,t]),a=s.useCallback(l=>Promise.all(l.map(u=>je.archiveNode(u,!0))).then(u=>{for(const f of u)e(f);return t({kind:"success",title:`Archived ${u.length} shot${u.length===1?"":"s"}`,action:{label:"Undo",onClick:()=>{Promise.all(u.map(f=>je.archiveNode(f.id,!1))).then(f=>{for(const h of f)e(h)})}}}),!0}).catch(u=>(t(ln(u,"Could not archive these shots")),!1)),[e,t]),i=s.useCallback(l=>Promise.all(l.map(u=>je.archiveNode(u,!1))).then(u=>{for(const f of u)e(f);return!0}).catch(u=>(t(ln(u,"Could not restore these shots")),!1)),[e,t]);return{archive:n,archiveBatch:a,unarchive:r,unarchiveBatch:i}}function Gle(e){const{push:t}=cr(),n=s.useCallback(a=>je.deleteNode(a.id).then(()=>e([a.id])).catch(i=>t(ln(i,"Could not delete this shot"))),[e,t]),r=s.useCallback(a=>je.deleteNodesBatch(a).then(()=>e(a)).catch(i=>t(ln(i,"Could not delete these shots"))),[e,t]);return{remove:n,removeBatch:r}}function Yle(e,{demoProducts:t,presenters:n,scenes:r}){var f,h,p,g;const a=((f=e.brief)==null?void 0:f.tokens)??[],i=(h=a.find(v=>(v==null?void 0:v.t)==="product"))==null?void 0:h.id,l=(p=a.find(v=>(v==null?void 0:v.t)==="character"))==null?void 0:p.id,u=(g=a.find(v=>(v==null?void 0:v.t)==="template"))==null?void 0:g.id;return{product:i?t.find(v=>v.id===i):void 0,presenter:l?n.find(v=>v.id===l):void 0,scene:u?r.find(v=>v.id===u):void 0}}function qle(e,t){const{product:n,presenter:r,scene:a}=Yle(e,t);return{productName:n?Co(n,"chip"):null,productPreviewUrl:(n==null?void 0:n.previewUrl)??null,productId:(n==null?void 0:n.id)??null,presenterName:(r==null?void 0:r.name)??null,presenterPreviewUrl:r?ii(r).src:null,presenterId:(r==null?void 0:r.id)??null,sceneName:a?ol(a,"chip"):null,scenePreviewUrl:(a==null?void 0:a.previewUrl)??null,sceneId:(a==null?void 0:a.id)??null}}function Xle(e){const t=s.useRef(null),n=s.useRef(0),r=s.useRef(null),a=s.useRef(0),i=s.useCallback(()=>{const h=t.current;h&&(n.current=h.scrollWidth/3)},[]);s.useEffect(()=>{const h=t.current;if(!h||!e)return;i(),h.scrollLeft=n.current;const p=new ResizeObserver(()=>{const g=n.current;i(),g<=0&&n.current>0&&(h.scrollLeft=n.current)});p.observe(h);for(const g of h.children)p.observe(g);return()=>p.disconnect()},[e,i]);const l=s.useCallback(()=>{const h=t.current,p=n.current;!h||p<=0||(h.scrollLeft<p*.5?(h.scrollLeft+=p,r.current!==null&&(r.current+=p)):h.scrollLeft>p*1.5&&(h.scrollLeft-=p,r.current!==null&&(r.current-=p)))},[]),u=s.useCallback(()=>{r.current=null,cancelAnimationFrame(a.current)},[]);s.useEffect(()=>{const h=t.current;if(!h)return;let p=0;const g=()=>{p||(p=requestAnimationFrame(()=>{p=0,l()}))},v=b=>{Math.abs(b.deltaY)<=Math.abs(b.deltaX)||(b.preventDefault(),u(),h.scrollLeft+=b.deltaY)},w=b=>{b.target.closest(".sc-shelf-arrow")||u()};return h.addEventListener("scroll",g,{passive:!0}),h.addEventListener("wheel",v,{passive:!1}),h.addEventListener("pointerdown",w),()=>{p&&cancelAnimationFrame(p),u(),h.removeEventListener("scroll",g),h.removeEventListener("wheel",v),h.removeEventListener("pointerdown",w)}},[u,l]);const f=s.useCallback(h=>{const p=t.current,g=p==null?void 0:p.firstElementChild;if(!p||!g)return;const v=g.offsetWidth||232,w=Number.parseFloat(getComputedStyle(p).columnGap)||0,b=v+w,y=r.current??p.scrollLeft;r.current=y+b*h;const k=()=>{u()};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){p.scrollLeft=r.current,k(),l();return}cancelAnimationFrame(a.current);let S=0;const E=()=>{const j=r.current;if(j===null)return;const N=j-p.scrollLeft;if(S+=1,Math.abs(N)<.5||S>45){p.scrollLeft=j,k(),l();return}p.scrollLeft+=N*.16,a.current=requestAnimationFrame(E)};a.current=requestAnimationFrame(E)},[u,l]);return{ref:t,page:f}}function Qle(e){const t=[...e];for(let n=t.length-1;n>0;n--){const r=Math.floor(Math.random()*(n+1));[t[n],t[r]]=[t[r],t[n]]}return t}function Jle({entries:e,catalogs:t,stagedId:n,onUse:r,productHref:a,presenterHref:i,sceneHref:l}){const u=s.useMemo(()=>Qle(e).slice(0,10),[e]),{ref:f,page:h}=Xle(u.length);return o.jsxs("div",{className:"sc-canvas-empty",children:[o.jsxs("h3",{children:["Your first ",o.jsx("em",{children:"shot"})]}),o.jsx("p",{children:"Describe what you want in the prompt below, or open one of these."}),u.length>0&&o.jsxs("div",{className:"sc-shelf",children:[o.jsx("button",{type:"button",className:"sc-shelf-arrow prev","aria-label":"Previous examples",onClick:()=>h(-1),children:o.jsx(Sa,{size:13,weight:"bold"})}),o.jsx("button",{type:"button",className:"sc-shelf-arrow next","aria-label":"More examples",onClick:()=>h(1),children:o.jsx(cl,{size:13,weight:"bold"})}),o.jsx("div",{className:"sc-shelf-row",ref:f,children:[0,1,2].map(p=>u.map(g=>o.jsx(zR,{entry:g,size:"grid",hideRecipe:!0,decorative:p!==1,active:n===g.id,onOpen:()=>r(g),productHref:a,presenterHref:i,sceneHref:l,...qle(g,t)},`${p}-${g.id}`)))})]})]})}function f0({text:e,onAll:t,actionLabel:n="Show all shots"}){return o.jsxs("div",{className:"sc-feed-empty",children:[o.jsx("p",{children:e}),t&&o.jsx("button",{type:"button",className:"sc-btn",onClick:t,children:n})]})}function ece({count:e,sets:t,activeSet:n,onAdd:r,onRemove:a,onNew:i,onClear:l,onKeep:u,onArchiveBatch:f,allKept:h,archivedLens:p,pickedIds:g,onRestoreBatch:v,onDeleteBatch:w,loaded:b,onSelectAll:y}){const[k,S]=s.useState(!1);return o.jsxs("div",{className:"sc-picked","data-lens":p?"archived":void 0,role:"toolbar","aria-label":"Selection",children:[o.jsxs("span",{className:"sc-picked-meta",children:[o.jsxs("span",{className:"sc-picked-n",role:"status",children:[e,o.jsx("span",{className:"sc-vh",children:" selected"})]}),b>1&&o.jsx("button",{type:"button",className:"sc-picked-all",onClick:e<b?y:l,children:e<b?"Select all":"Deselect all"})]}),o.jsx("span",{className:"sc-picked-rule","aria-hidden":!0}),o.jsx("span",{className:"sc-picked-tools",children:p?o.jsxs(o.Fragment,{children:[o.jsx(mu,{label:"Restore",onClick:()=>v(g),children:o.jsx(H0,{size:17})}),o.jsx(mu,{label:`Delete ${e} permanently`,tone:"danger",onClick:()=>S(!0),children:o.jsx(ul,{size:17})})]}):o.jsxs(o.Fragment,{children:[o.jsx(mu,{label:h?"Remove from keepers":"Keep",onClick:u,children:o.jsx(Ua,{size:17,weight:h?"fill":"regular"})}),o.jsxs(ws,{children:[o.jsx(lr,{label:"Add to set",children:o.jsx(ys,{children:o.jsx("button",{type:"button",className:"sc-picked-tool","aria-label":"Add to set",children:o.jsx(_4,{size:17})})})}),o.jsxs(bs,{children:[t.filter(E=>E.id!==(n==null?void 0:n.id)).map(E=>o.jsx(Yn,{onSelect:()=>r(E),children:E.name},E.id)),t.some(E=>E.id!==(n==null?void 0:n.id))&&o.jsx(nc,{}),o.jsx(Yn,{onSelect:i,children:"New set…"})]})]}),n&&a&&o.jsx(mu,{label:YP(e,n.name),onClick:a,children:o.jsx(m9,{size:17})}),o.jsx(mu,{label:"Archive",tone:"danger",onClick:()=>f(g),children:o.jsx(Rp,{size:17})})]})}),o.jsx("span",{className:"sc-picked-rule","aria-hidden":!0}),o.jsx("span",{className:"sc-picked-exit",children:o.jsx(mu,{label:"Done",onClick:l,children:o.jsx(Mn,{size:16,weight:"bold"})})}),p&&o.jsx(qn,{label:`Delete ${e} permanently`,title:`Delete ${e} shot${e===1?"":"s"} permanently?`,body:"This cannot be undone.",busy:!1,open:k,onOpenChange:S,onConfirm:()=>w(g)})]})}function mu({label:e,tone:t,onClick:n,children:r}){return o.jsx(lr,{label:e,children:o.jsx("button",{type:"button",className:"sc-picked-tool","data-tone":t,"aria-label":e,onClick:n,children:r})})}function tce(e,t){return[e,t.lens??"all",t.set??"",t.ungrouped?"ungrouped":"",t.lineage??"",t.token??"",(t.q??"").trim(),t.sort??"newest",t.limit??""].join("|")}function nce(e){switch(e){case"oldest":return(t,n)=>Au(n,t);case"cost":return(t,n)=>n.costUsd-t.costUsd||Au(t,n);case"keepers":return(t,n)=>Number(n.kept)-Number(t.kept)||Au(t,n);default:return Au}}function QP(e,t,n){return e.kind==="root"?!1:t.lineage?n.inLineage?n.inLineage(e):!1:t.set?n.inSet?n.inSet(e.id):!1:t.ungrouped?n.inAnySet?!n.inAnySet(e.id):!1:!0}function rce(e,t){return t==="archived"?e.archived:t==="keepers"?!e.archived&&e.kept:!e.archived}function HS(e,t,n){var r;return(r=t.q)!=null&&r.trim()?null:QP(e,t,n)&&rce(e,t.lens)}function OS(e){return!e||e.kind==="root"?{all:0,keepers:0,archived:0}:{all:e.archived?0:1,keepers:!e.archived&&e.kept?1:0,archived:e.archived?1:0}}function _8(e,t,n,r){if(!r)return e;const a=OS(t),i=OS(n),l={...e,all:e.all+i.all-a.all,keepers:e.keepers+i.keepers-a.keepers,archived:e.archived+i.archived-a.archived};return l.all===e.all&&l.keepers===e.keepers&&l.archived===e.archived?e:l}function x4(e,t){const n=e.findIndex(a=>a.id===t.id);if(n===-1||e[n]===t)return e;const r=[...e];return r[n]=t,r}function IS(e,t){const n=new Set(t);return e.some(r=>n.has(r.id))?e.filter(r=>!n.has(r.id)):e}function sce(e,t,n,r){if(e.some(u=>u.id===t.id))return x4(e,t);const a=nce(n);let i=0;for(;i<e.length&&a(e[i],t)<=0;)i++;if(i===e.length&&!r)return e;const l=[...e];return l.splice(i,0,t),l}function ace(e,t){const n=new Set(e.map(a=>a.id)),r=t.filter(a=>!n.has(a.id));return r.length?[...e,...r]:e}function oce(e,t){const n=new Set(t.map(r=>r.id));return[...t,...e.filter(r=>!n.has(r.id))]}const V8=60;function ice(e,t,n){const{shotsEpoch:r}=dn(),a=`${tce(e,t)}#${r}`,[i,l]=s.useState({brandId:e,key:"",items:[],next:null,counts:null,error:null}),[u,f]=s.useState(!1),h=s.useRef(i);h.current=i;const p=s.useRef(t);p.current=t;const g=s.useRef(n);g.current=n;const v=s.useRef(!1);s.useEffect(()=>{const N=new AbortController;return f(!0),je.feed(e,{...p.current,limit:V8},N.signal).then(A=>{N.signal.aborted||l({brandId:e,key:a,items:A.items,next:A.next,counts:A.counts??null,error:null})}).catch(A=>{if(N.signal.aborted)return;const T=String((A==null?void 0:A.message)??A);l(P=>({...P,brandId:e,key:a,error:T}))}).finally(()=>{N.signal.aborted||f(!1)}),()=>N.abort()},[e,a]);const w=s.useCallback(()=>{const N=h.current;if(N.key!==a||!N.next||v.current)return;v.current=!0,f(!0);const A=N.next;je.feed(e,{...p.current,limit:V8,cursor:A}).then(T=>{l(P=>P.key!==a?P:{...P,items:ace(P.items,T.items),next:T.next,counts:T.counts??P.counts})}).catch(()=>{}).finally(()=>{v.current=!1,f(!1)})},[e,a]),b=s.useCallback(async()=>{const N=await je.feed(e,{...p.current,limit:V8});l(A=>A.key!==a?A:{...A,items:oce(A.items,N.items),next:A.items.length?A.next:N.next,counts:N.counts??A.counts,error:null})},[e,a]),y=s.useCallback(N=>{l(A=>{const T=A.items.find(H=>H.id===N.id);if(!T)return A;const P=p.current,R=HS(N,P,g.current)===!1?IS(A.items,[N.id]):x4(A.items,N),$=A.counts?_8(A.counts,T,N,!0):A.counts;return R===A.items&&$===A.counts?A:{...A,items:R,counts:$}})},[]),k=s.useCallback((N,A)=>{let T=!1;l(P=>{let C=P.items,R=P.counts;const $=p.current;for(const H of N){if(C.some(U=>U.id===H.id)){C=x4(C,H);continue}const D=HS(H,$,g.current);if(D===null){T=!0;continue}const q=QP(H,$,g.current);D&&(C=sce(C,H,$.sort,P.next===null));const _=(A==null?void 0:A.get(H.id))??null;R&&(R=_8(R,_,H,q))}return C===P.items&&R===P.counts?P:{...P,items:C,counts:R}}),T&&b().catch(()=>{})},[b]),S=s.useCallback(N=>{l(A=>{const T=A.items.filter(C=>N.includes(C.id));if(!T.length)return A;let P=A.counts;if(P)for(const C of T)P=_8(P,C,null,!0);return{...A,items:IS(A.items,N),counts:P}})},[]),E=i.brandId===e?i.items:[],j=s.useMemo(()=>new Map(E.map(N=>[N.id,N])),[E]);return{items:E,byId:j,counts:i.brandId===e?i.counts:null,ready:i.key===a&&!i.error,loading:u,complete:i.key===a&&i.next===null,error:i.key===a?i.error:null,loadMore:w,patch:y,insert:k,drop:S,refresh:b}}function lce(){const e=gn(pt.hubShot),t=gn(pt.setShot);return(e==null?void 0:e.params.shotId)??(t==null?void 0:t.params.shotId)??null}function FS(e,t){const n=e?t.get(e)??null:null,[r,a]=s.useState(null);return s.useEffect(()=>{if(!e||n)return;let i=!0;return je.node(e).then(l=>i&&a({id:e,node:l})).catch(()=>i&&a({id:e,node:null})),()=>{i=!1}},[e,n]),e?n?{node:n,missing:!1}:(r==null?void 0:r.id)===e?{node:r.node,missing:r.node===null}:{node:null,missing:!1}:{node:null,missing:!1}}function JP({set:e}){const{engines:t,scenes:n,presenters:r,demoProducts:a,showcase:i,showcaseLoaded:l}=Hn(),{brand:u,workspace:f,root:h,recent:p,sets:g,membership:v,loaded:w,refresh:b,applySet:y,dropSet:k,insertSet:S,applyMembership:E,applyNodes:j,subscribeActivity:N,products:A}=dn(),T=n,P=zf(),C=_n(),[R,$]=ll(),H=lce(),[D,q]=s.useState(null),[_,U]=s.useState(!1);s.useEffect(()=>{const ie=()=>U(!0);return window.addEventListener("scenri:shortcuts",ie),()=>window.removeEventListener("scenri:shortcuts",ie)},[]);const{open:Y,toggle:I,setOpen:F}=wne(),O=Sr("(min-width: 1280px)"),Z=O&&Y,[V,B]=s.useState(null),[K,ee]=s.useState(VR),[se,oe]=s.useState(null),[me,ce]=s.useState(null),we=s.useRef(!1);s.useEffect(()=>{if(!we.current||H)return;we.current=!1;const ie=requestAnimationFrame(()=>{var De;return(De=Qe.current)==null?void 0:De.focus()});return()=>cancelAnimationFrame(ie)},[H,me]);const[G,ue]=s.useState(null),[Ne,ne]=s.useState(new Set),[Fe,Oe]=ch("tab","all"),[ot,Xe]=ch("in",""),[X,J]=ch("branch",""),[ge,ve]=ch("lineage",""),[Ze,Ye]=ba(Kr.tileSize,NN),ke=MN(Ze),{q:te,setQ:le,clearSearch:Me}=Bf([]),[ze,Re]=ba(Kr.feedSort,"newest"),Be=xK(ze)?ze:"newest",Qe=s.useRef(null),{push:rt}=cr(),{poke:_e}=Ca(),[zt,Et]=s.useState(null),Zt=(f==null?void 0:f.id)??"",He=e?g0(u,e):yr(u),mt=s.useCallback(ie=>{const De=R.toString();return`${He}/shots/${ie}${De?`?${De}`:""}`},[He,R]),vt=s.useCallback((ie,De=!1)=>C(mt(ie),{replace:De}),[C,mt]),St=s.useCallback(()=>{const ie=new URLSearchParams(R);ie.delete("panel");const De=ie.toString();C(`${He}${De?`?${De}`:""}`,{replace:!0})},[He,C,R]),kt=kK(Fe)?Fe:"all",Nt=!e&&ot==="ungrouped";s.useEffect(()=>{Fe==="ungrouped"&&(Oe(null),Xe("ungrouped"))},[Fe,Oe,Xe]);const Bt=s.useMemo(()=>{const ie=new Map;for(const De of g)for(const it of v[De.id]??[])ie.has(it)||ie.set(it,[]),ie.get(it).push(De);return ie},[g,v]),at=s.useMemo(()=>({lens:kt,set:e==null?void 0:e.id,ungrouped:Nt||void 0,lineage:ge||void 0,q:te.trim()||void 0,sort:Be}),[kt,e==null?void 0:e.id,Nt,ge,te,Be]),Mt=s.useRef(v);Mt.current=v;const ft=s.useRef(Bt);ft.current=Bt;const vn=s.useRef(new Set),Qt=s.useMemo(()=>({inSet:ie=>e?(Mt.current[e.id]??[]).includes(ie):!1,inAnySet:ie=>ft.current.has(ie),inLineage:ie=>ie.id===ge||ie.parentId!==null&&vn.current.has(ie.parentId)}),[e==null?void 0:e.id,ge]),on=ice(u.id,at,Qt),{items:Rt,byId:An,counts:Vt}=on,re=s.useRef(on);re.current=on,vn.current=s.useMemo(()=>new Set(Rt.map(ie=>ie.id)),[Rt]);const ae=s.useRef(new Map);s.useEffect(()=>{for(const ie of Rt)ae.current.set(ie.id,ie)},[Rt]);const fe=s.useRef(null),[Te,Ue]=s.useState("");s.useEffect(()=>N(ie=>{const{messages:De,next:it}=xle(fe.current??new Map,ie),Ft=fe.current===null;fe.current=it,!Ft&&De.length&&Ue(De.join(" "));const an=re.current;let fn=!1;const $n=[],jn=new Map;for(const Tn of ie){if(an.byId.has(Tn.id))an.patch(Tn);else if(ae.current.has(Tn.id)){const Ma=ae.current.get(Tn.id);Ma&&jn.set(Tn.id,Ma),$n.push(Tn)}else Tn.kind!=="root"&&(fn=!0);ae.current.set(Tn.id,Tn)}$n.length&&an.insert($n,jn),fn&&an.ready&&an.refresh().catch(()=>{})}),[N]);const ut=w&&on.ready,gt=FS(ge||null,An);s.useEffect(()=>{!ge||!gt.missing||(ve(null),rt({kind:"info",title:"That shot is no longer available",detail:"Showing everything instead."}))},[ge,gt.missing,ve,rt]);const Pt=s.useMemo(()=>{var Ft,an;const ie=A.length?A:((Ft=u.json)==null?void 0:Ft.products)??[],De=((an=u.json)==null?void 0:an.characters)??[],it=P.scenes;return{product:fn=>{const $n=ie.find(jn=>jn.id===fn)??a.find(jn=>jn.id===fn);return $n?Co($n,"chip"):null},person:fn=>{var $n,jn;return(($n=De.find(Tn=>Tn.id===fn))==null?void 0:$n.name)??((jn=r.find(Tn=>Tn.id===fn))==null?void 0:jn.name)??null},scene:fn=>{const $n=it.find(jn=>jn.id===fn);return $n?ol($n,"chip"):null}}},[A,a,u,r,P.scenes]),tt=s.useMemo(()=>{const ie=D?An.get(D):void 0;return ie||(Rt.find(De=>De.status!=="error")??Rt[0]??null)},[An,Rt,D]),wt=FS(X||null,An),Ce=s.useMemo(()=>{const ie=wt.node;return!ie||ie.kind==="root"?null:ie.status==="running"||ie.status==="done"&&ie.images.length>0?ie:null},[wt.node]),xe=(Ce==null?void 0:Ce.images[0])??null,et=s.useCallback(()=>J(null),[J]),yt=s.useRef(null),Q=s.useCallback((...ie)=>{if(yt.current){for(const it of ie)yt.current.add(it);return}const De=new Set(ie);yt.current=De,queueMicrotask(()=>{yt.current=null,$(it=>{const Ft=new URLSearchParams(it);for(const an of De)Ft.delete(an);return Ft},{replace:!0})})},[$]),Pe=s.useCallback(()=>Q("scene","setup","presenter","product","ref","view"),[Q]);s.useEffect(()=>{!X||!ut||(wt.node&&!Ce?(et(),rt({kind:"info",title:"That shot is no longer available to refine",detail:"Making a new shot."})):wt.missing&&(et(),rt({kind:"info",title:"That shot is no longer available to refine",detail:"Making a new shot."})))},[X,wt.node,wt.missing,Ce,ut,et,rt]);const Ke=s.useCallback(ie=>{var De;J(ie),(De=Qe.current)==null||De.focus()},[J]),xt=ie=>q(ie),st=ie=>H||/\/shots\//.test(window.location.pathname)?vt(ie,!0):xt(ie),Kt=s.useCallback(ie=>{for(const De of ie)ae.current.set(De.id,De);re.current.insert(ie),j(ie),_e()},[j,_e]),mn=s.useCallback(async()=>{try{await b(),await re.current.refresh(),B(null)}catch(ie){B(String(ie.message??ie))}},[b]),$e=s.useCallback(ie=>j([ie]),[j]),{archive:Ae,archiveBatch:nt,unarchive:Ge,unarchiveBatch:Tt}=Kle($e),W=s.useCallback(ie=>re.current.drop(ie),[]),{remove:he,removeBatch:pe}=Gle(W);s.useEffect(()=>{H&&q(H)},[H]);const qe=s.useRef(new Set),We=async ie=>{var De,it;if(ie.status==="running"||qe.current.has(ie.id))return ie.id;if(ie.status==="error"||ie.status==="cancelled"){qe.current.add(ie.id);try{const Ft=await je.retryNode(ie.id);return j([Ft]),_e(),Ft.id}catch(Ft){return rt(ln(Ft,"Could not run this again")),null}finally{qe.current.delete(ie.id)}}try{const Ft=await je.node(ie.id),an=await je.addNode({projectId:Zt,parentId:ie.parentId,kind:ie.kind==="edit"?"edit":"generation",prompt:Ft.prompt,engineId:ie.engineId,count:1,brief:ie.brief,...ie.kind==="edit"&&((De=ie.brief)!=null&&De.sourceImage)?{sourceImage:ie.brief.sourceImage}:{}});return Kt((it=an.siblings)!=null&&it.length?an.siblings:[an]),(an==null?void 0:an.id)??null}catch(Ft){return rt(ln(Ft,"Could not run this again")),null}},jt=async ie=>{try{await je.cancelNode(ie.id),j([{...ie,status:"cancelled"}]),_e()}catch(De){rt(ln(De,"Could not cancel this shot"))}},Ct=s.useCallback(ie=>{var De,it,Ft;ie!=null&&ie.scene&&((De=Qe.current)==null||De.applyScene(ie.scene)),ie!=null&&ie.scenesPanel&&((it=Qe.current)==null||it.openAttach("Scenes")),(Ft=Qe.current)==null||Ft.focus()},[]);s.useEffect(()=>{var De;if(R.get("compose")===null)return;const ie=R.get("attach")==="all";Ct(),ie&&((De=Qe.current)==null||De.showAttach()),Q("compose",...ie?["attach"]:[])},[R,Ct,Q]);const Dt=R.get("showcase"),qt=s.useRef(null);s.useEffect(()=>{if(!Dt||!l||qt.current===Dt)return;qt.current=Dt;const ie=i.find(De=>De.id===Dt);ie?(ce(s4(ie)),rt({kind:"info",title:`Starting from "${ie.title}"`})):rt({kind:"info",title:"That example is no longer available",detail:"Starting from scratch instead."}),$(De=>{const it=new URLSearchParams(De);return it.delete("showcase"),it},{replace:!0})},[Dt,l,i,$,rt]);const Zn=async(ie,De=!ie.kept)=>{j([{...ie,kept:De}]);try{j([await je.keep(ie.id,De)])}catch(it){j([ie]),rt(ln(it,"Could not update keeper status"))}},nn=s.useMemo(()=>[...Ne].map(ie=>An.get(ie)).filter(ie=>!!ie),[An,Ne]),Ut=async()=>{const ie=!(nn.length>0&&nn.every(it=>it.kept)),De=nn.filter(it=>it.kept!==ie);j(De.map(it=>({...it,kept:ie})));try{j(await Promise.all(De.map(it=>je.keep(it.id,ie))))}catch(it){j(De),rt(ln(it,"Could not update keeper status"))}},pr=ie=>{const De=ie.map(it=>An.get(it)).filter(it=>!!it&&!it.archived);De.length&&j(De.map(it=>({...it,archived:!0}))),ne(new Set),nt(ie).then(it=>{it||j(De)})},Nn=ie=>{const De=ie.map(it=>An.get(it)).filter(it=>!!it&&it.archived);De.length&&j(De.map(it=>({...it,archived:!1}))),ne(new Set),Tt(ie).then(it=>{it||j(De)})},nr=s.useCallback((ie,De)=>{Mt.current={...Mt.current,[ie]:De},E(ie,De)},[E]),Jt=async ie=>{try{const De=await je.addToSet(ie.id,[...Ne]);nr(ie.id,De.nodeIds),ne(new Set),(e||Nt)&&re.current.refresh()}catch(De){rt(ln(De,"Could not add to the set"))}},ur=async(ie,De)=>{const it=Mt.current[ie.id]??[],Ft=it.filter(an=>!De.includes(an));nr(ie.id,Ft),ne(an=>{if(!De.some($n=>an.has($n)))return an;const fn=new Set(an);for(const $n of De)fn.delete($n);return fn}),(e==null?void 0:e.id)===ie.id&&re.current.drop(De);try{const an=await je.removeFromSet(ie.id,De);nr(ie.id,an.nodeIds),Nt&&re.current.refresh()}catch(an){nr(ie.id,it),((e==null?void 0:e.id)===ie.id||Nt)&&re.current.refresh(),rt(ln(an,"Could not remove from the set"))}},Cs=ie=>ur(ie,[...Ne]),kn=(ie,De)=>ur(De,[ie.id]),Vs=s.useRef([]),[na,en]=s.useState(!1);s.useEffect(()=>{na&&en(!1)},[na]);const Cn=async(ie,De)=>{const it=De.trim();if(it)try{const Ft=await je.createSet(u.id,it);if(S(Ft),ie.length>0){const an=await je.addToSet(Ft.id,ie);nr(Ft.id,an.nodeIds)}ne(new Set),C(g0(u,Ft))}catch(Ft){rt(ln(Ft,"Could not create the set"))}},zn=()=>{const ie=Vs.current;return Vs.current=[],ie},Zr=async ie=>{if(!e)return;const De=ie.trim();if(!(!De||De===e.name))try{const it=await je.renameSet(e.id,De);y(it),C(g0(u,it),{replace:!0}),b()}catch(it){rt(ln(it,"Could not rename the set"))}},Pr=async()=>{if(e)try{await je.deleteSet(e.id),k(e.id),C(yr(u),{replace:!0}),b()}catch(ie){rt(ln(ie,"Could not delete the set"))}},In=async ie=>{var Tn;const De=((Tn=/\/shots\/([^/?#]+)/.exec(window.location.pathname))==null?void 0:Tn[1])??null,it=De?An.get(De)??null:tt;if(!it)return;if(ie==="left"||ie==="right"){const{prev:Ma,next:bl}=N6(Rt,it.id),vi=ie==="left"?Ma:bl;vi&&st(vi.id);return}const Ft=await je.lineage(it.id).catch(()=>null);if(!Ft)return;const an=Ft.history??[...Ft.ancestors,it,...Ft.children.slice(0,1)],{prev:fn,next:$n}=N6(an.filter(Ma=>Ma.id===it.id||Ma.images[0]),it.id),jn=ie==="up"?fn:$n;jn&&st(jn.id)};s.useEffect(()=>{const ie=De=>{var $n,jn;if(De.defaultPrevented)return;const it=document.activeElement,Ft=((it==null?void 0:it.tagName)??"").toUpperCase(),an=Ft==="INPUT"||Ft==="TEXTAREA"||Ft==="SELECT"||!!(it!=null&&it.closest('[contenteditable="true"]'))||!!(it!=null&&it.closest('[role="separator"]')),fn=!!(it!=null&&it.closest('button, a[href], [role="button"], [role="tab"], [role="menuitem"]'));if(De.key==="Enter"&&(De.metaKey||De.ctrlKey)){($n=Qe.current)==null||$n.submit(),De.preventDefault();return}if(!an){if(De.key==="?"){U(!0),De.preventDefault();return}if(De.key==="/"&&!H){(jn=Qe.current)==null||jn.focus(),De.preventDefault();return}if(De.key==="Escape"&&_){U(!1),De.preventDefault();return}if(De.key==="Escape"&&H){St(),De.preventDefault();return}if(De.key==="Escape"&&Ne.size>0){ne(new Set),De.preventDefault();return}if(De.key==="Escape"&&X){et(),De.preventDefault();return}if(tt){if(De.key==="b"&&tt.kind!=="root"&&tt.status==="done"&&tt.images.length>0){Ke(tt.id),De.preventDefault();return}if(De.key==="k"&&tt.kind!=="root"&&tt.status==="done"){Zn(tt),De.preventDefault();return}De.key==="ArrowLeft"?(In("left"),De.preventDefault()):De.key==="ArrowRight"?(In("right"),De.preventDefault()):De.key==="ArrowUp"?(In("up"),De.preventDefault()):De.key==="ArrowDown"?(In("down"),De.preventDefault()):De.key==="Enter"&&!H&&tt.kind!=="root"&&!fn?vt(tt.id):De.key==="."&&!H&&O&&I()}}};return window.addEventListener("keydown",ie),()=>window.removeEventListener("keydown",ie)},[tt,H,_,Ne.size,X,Ke,J,h,O]);const zr=ie=>ne(De=>{const it=new Set(De);return it.delete(ie)||it.add(ie),it}),Lr=ut&&Vt!==null&&Vt.total===0,us=Z||Lr&&O,ra=Lr?o.jsx(Jle,{entries:i,catalogs:{demoProducts:a,presenters:r,scenes:T},stagedId:G,productHref:ie=>ga(u,ie),presenterHref:ie=>xa(u,ie),sceneHref:ie=>Ir(u,ie),onUse:ie=>{ue(ie.id),ce(s4(ie))}}):te.trim()?o.jsx(f0,{text:`No shots match “${te.trim()}”.`,onAll:Me,actionLabel:"Clear search"}):kt==="keepers"?o.jsx(f0,{text:"No keepers yet. Star a shot and it lands here.",onAll:()=>Oe(null)}):kt==="archived"?o.jsx(f0,{text:"Nothing archived.",onAll:()=>Oe(null)}):e?o.jsx(f0,{text:"Nothing in this set yet. Pick shots on All, then add them here."}):Nt?o.jsx(f0,{text:"Every shot is already in a set.",onAll:()=>Xe(null)}):null,Aa=s.useRef(0);!te.trim()&&Vt&&(Aa.current=Vt[kt]);const[Er,Oc]=ba(Kr.feedCounts,null);s.useEffect(()=>{if(!Vt)return;const ie={brandId:u.id,all:Vt.all,keepers:Vt.keepers,archived:Vt.archived};Oc(De=>De&&De.brandId===ie.brandId&&De.all===ie.all&&De.keepers===ie.keepers&&De.archived===ie.archived?De:ie)},[u.id,Vt,Oc]);const Ro=s.useMemo(()=>Vt?{all:Vt.all,keepers:Vt.keepers,archived:Vt.archived}:(Er==null?void 0:Er.brandId)===u.id?{all:Er.all,keepers:Er.keepers,archived:Er.archived}:null,[Vt,Er,u.id]),Na={byId:An,items:Rt,loadMore:on.loadMore,complete:on.complete,rootId:h,recent:p,loaded:ut,setsFor:ie=>Bt.get(ie)??[],brand:u,engines:t,projectId:Zt,close:St,select:st,retry:ie=>{We(ie).then(De=>{De&&st(De)})},cancel:ie=>void jt(ie),keep:ie=>void Zn(ie),reload:mn,remix:ie=>{var fn;const De=(fn=ie.brief)==null?void 0:fn.tokens,it=ie.prompt??ie.promptHead,Ft=De!=null&&De.length||!it?ie.brief:{...ie.brief,tokens:[{t:"text",v:it}]},an=Ft!=null&&Ft.tokens?{...Ft,tokens:_6(u,Ft.tokens)}:Ft;ce({...an,_at:Date.now()}),an&&_R(u.id,{tokens:cw(an),tplFields:an.templateFields??{}}),St(),rt({kind:"info",title:"Starting from this shot",detail:"Its prompt, chips and settings are in the composer. Change anything, then Generate."}),we.current=!0},branch:ie=>{Ke(ie.id),St()},archive:ie=>Ae(ie).then(De=>{De&&St()}),unarchive:ie=>Ge(ie).then(()=>{}),delete:ie=>void he(ie).then(()=>St()),landed:Kt,refined:(ie,De)=>{De==="edit"&&J(ie)},subscribeActivity:N,tokenNames:Pt};return o.jsxs("div",{className:"sc-work","data-assets":us,children:[o.jsxs("main",{className:"sc-canvas",id:"main","data-page-scroll":"","data-firstrun":Lr||void 0,onClick:ie=>{if(Ne.size===0&&!D)return;const De=ie.target;De.closest(".sc-cell")||De.closest("button, a, input, select, textarea, label, [role], [contenteditable]")||(ne(new Set),q(null))},children:[o.jsx("span",{className:"sc-vh",role:"status","aria-live":"polite",children:Te}),(V||on.error)&&o.jsx("div",{className:"sc-canvas-alert",children:o.jsx(Vv,{failure:eo(V??on.error??"")})}),(!Lr||e)&&o.jsx(Wle,{sets:g,active:e,ungrouped:Nt,ungroupedCount:(Vt==null?void 0:Vt.ungrouped)??0,onPlaceAll:()=>e?C(yr(u)):Xe(null),onPlaceUngrouped:()=>e?C(`${yr(u)}?in=ungrouped`):Xe("ungrouped"),onOpenSet:ie=>C(g0(u,ie)),onNewSet:ie=>void Cn(zn(),ie),onResetNewSet:()=>{Vs.current=[]},onRenameSet:ie=>void Zr(ie),onDeleteSet:()=>void Pr(),askCreate:na,lens:kt,lensCounts:Ro,onLens:ie=>Oe(ie==="all"?null:ie),q:te,onQ:le,searchTotal:te.trim()?Aa.current:(Vt==null?void 0:Vt[kt])??0,sort:Be,onSort:Re,tile:ke,onTile:Ye,assets:Z,onAssets:I,showAssets:O}),ge&&gt.node&&o.jsxs("div",{className:"sc-lineage-bar",children:[o.jsx("button",{type:"button",className:"sc-crumb-back",onClick:()=>ve(null),children:"All shots"}),o.jsx("span",{className:"sc-crumb-sep",children:"›"}),o.jsx("b",{dir:"auto",children:Rr(gt.node)}),o.jsx("span",{className:"sc-crumb-sep",children:"›"}),o.jsx("span",{className:"sc-crumb-here",children:"versions"})]}),o.jsx(Vle,{nodes:Rt,selectedId:D,onOpen:vt,shotHref:mt,onRetry:ie=>void We(ie),onCancel:ie=>void jt(ie),onToggleKeep:ie=>void Zn(ie),onArchive:ie=>ie.archived?Ge(ie):Ae(ie),onDeletePermanently:he,engineName:ie=>{var De;return(De=t.find(it=>it.id===ie))==null?void 0:De.displayName},picked:Ne,onPick:zr,sending:zt,onBranch:Ke,branchingFrom:(Ce==null?void 0:Ce.id)??null,onVersions:ve,tile:ke,empty:ut?ra:null,pending:!ut,onNearEnd:on.complete?void 0:on.loadMore,inSet:e,setsFor:ie=>Bt.get(ie)??[],onRemoveFromSet:(ie,De)=>void kn(ie,De),onKeepPicked:()=>void Ut(),onArchivePicked:()=>pr([...Ne]),onRestorePicked:()=>Nn([...Ne]),onDeletePicked:()=>void pe([...Ne]).then(()=>ne(new Set)),onRemovePickedFromSet:ie=>void Cs(ie)})]}),us&&o.jsx("div",{className:"sc-assets-backdrop",onClick:()=>F(!1),"aria-hidden":!0}),o.jsx(Sle,{open:_,onOpenChange:U}),O&&o.jsx(Ule,{brand:u,shots:p,shotsTotal:(Ro==null?void 0:Ro.all)??0,attached:K,full:se,onToken:ie=>{var De;return(De=Qe.current)==null?void 0:De.insertToken(ie)},offToken:ie=>{var De;return(De=Qe.current)==null?void 0:De.removeToken(ie)},onTemplate:ie=>{var De;return(De=Qe.current)==null?void 0:De.applyScene(ie)},offTemplate:()=>{var ie;return(ie=Qe.current)==null?void 0:ie.removeTemplate()},onClose:()=>F(!1)}),o.jsxs(ZR,{full:!us,children:[o.jsx(Tw,{}),Ne.size>0&&o.jsx(ece,{count:Ne.size,sets:g,activeSet:e,onAdd:ie=>void Jt(ie),onRemove:e?()=>void Cs(e):void 0,onNew:()=>{Vs.current=[...Ne],en(!0)},onClear:()=>ne(new Set),onKeep:()=>void Ut(),onArchiveBatch:ie=>pr(ie),allKept:nn.length>0&&nn.every(ie=>ie.kept),archivedLens:kt==="archived",pickedIds:[...Ne],onRestoreBatch:ie=>Nn(ie),onDeleteBatch:ie=>void pe(ie).then(()=>ne(new Set)),loaded:Rt.length,onSelectAll:()=>ne(new Set(Rt.map(ie=>ie.id)))}),o.jsx(Lw,{ref:Qe,projectId:Zt||null,brand:u,engines:t,parentId:h,initialBrief:me,suppressDraftRestore:Dt!==null,startScene:R.get("scene")??void 0,startSetup:R.get("setup")??void 0,startPresenter:R.get("presenter")??void 0,startProduct:R.get("product")??void 0,startRef:R.get("ref")??void 0,startView:R.get("view")??void 0,onSeedsSpent:Pe,openAttachTab:R.get("attach")==="scenes"?"Scenes":R.get("attach")==="products"?"Products":void 0,target:Ce,onClearTarget:et,onRestoreBranchId:J,guided:!0,setSlug:(e==null?void 0:e.slug)??null,onSending:Et,onAttached:ee,onCeiling:oe,sourceImage:xe??void 0,onQueued:(ie,De,it,Ft)=>{ce(null),$(jn=>{const Tn=new URLSearchParams(jn);return Tn.delete("scene"),Tn.delete("attach"),Tn.delete("presenter"),Tn.delete("product"),Tn},{replace:!0});const an=()=>Et(null),fn=()=>{De!=="edit"||!ie||$(jn=>{const Tn=new URLSearchParams(jn);return Tn.set("branch",ie),Tn},{replace:!0})},$n=()=>{Kt(Ft??[]),fn(),an()};e&&ie?je.addToSet(e.id,it!=null&&it.length?it:[ie]).then(jn=>nr(e.id,jn.nodeIds)).catch(jn=>rt(ln(jn,"Could not add to the set"))).finally($n):$n()}})]}),o.jsx(bc,{context:Na})]})}function cce(e){var t;return sd((t=e.brief)==null?void 0:t.format)}function uce(e){var n,r,a;const t=(a=(r=(n=e.brief)==null?void 0:n.rendered)==null?void 0:r.sizes)==null?void 0:a[0];return t&&t[0]>0&&t[1]>0?t:null}const dce=e=>({"--sc-pic-ar":e[0]/e[1],"--sc-pic-w":`${e[0]}px`});function fce({node:e,onRetry:t,onCancel:n,engineName:r,menu:a}){const[i,l]=s.useState(null),[,u]=s.useState(0);if(s.useEffect(()=>{if(e.status!=="running")return;const g=setInterval(()=>u(v=>v+1),1e3);return()=>clearInterval(g)},[e.status]),e.kind==="root")return o.jsx(j0,{className:"sc-frame",p:"8",children:o.jsxs(Ds,{direction:"column",align:"center",gap:"2",py:"6",children:[o.jsx(uc,{className:"sc-display",size:"7",align:"center",children:"Blank canvas, full brand."}),o.jsx(uc,{color:"gray",size:"2",align:"center",children:"Pick a Template below (engineered briefs, your product attached) or describe a visual."})]})});if(e.status==="running")return o.jsxs("div",{className:"sc-stage-wait",style:{"--sc-wait-ar":cce(e)},children:[o.jsx("span",{className:"sc-shimmer"}),o.jsxs("div",{className:"sc-stage-wait-say",children:[o.jsx("span",{className:"sc-stage-wait-t",role:"status","aria-label":`${Wv(Ui(e))}, ${hc(Ui(e))} seconds`,children:pc(Ui(e))}),n&&o.jsx("button",{type:"button",className:"sc-btn sc-btn-ghost","data-urgent":hc(Ui(e))>=60||void 0,onClick:n,children:"Cancel"})]})]});if(e.status==="cancelled"||e.status==="error"){const v=e.status==="cancelled"?zA():eo(e.error,r);return o.jsx(DA,{failure:v,density:"stage",onRetry:t})}const f=e.status==="done"?e.images[0]:void 0,h=f?uce(e)??(i==null?void 0:i.size)??null:null,p=f?o.jsx(j0,{className:h?"sc-frame sc-stage-pic":"sc-frame sc-stage-free",style:h?dce(h):void 0,children:o.jsx(hce,{hash:f,alt:e.promptHead,onPainted:(g,v,w)=>l({hash:g,size:[v,w]})})}):o.jsx(Ds,{justify:"center",children:o.jsx(j0,{className:"sc-frame",style:{display:"inline-block",maxWidth:"100%"}})});return a?o.jsxs(Mf,{children:[o.jsx(Rf,{children:p}),a]}):p}function hce({hash:e,alt:t,onPainted:n}){const[r,a]=s.useState(null),i=s.useRef(null),l=r===e,u=h=>{!(h!=null&&h.complete)||!h.naturalWidth||h.src!==new URL(Fr(e),location.href).href||i.current!==e&&(i.current=e,a(e),n==null||n(e,h.naturalWidth,h.naturalHeight))},f=i.current&&i.current!==e?Fr(i.current):hn(e,"tile");return o.jsxs(j0,{position:"relative",style:{lineHeight:0},children:[!l&&o.jsx("img",{className:"sc-stage-under",src:f,alt:"","aria-hidden":!0,decoding:"async"}),o.jsx("img",{ref:u,src:Fr(e),alt:t,className:"sc-stage-img","data-ready":l||void 0,onLoad:h=>u(h.currentTarget)})]})}const pce=e=>((e==null?void 0:e.tokens)??[]).filter(t=>t&&typeof t.t=="string");function eL(e,t){return pce(e.brief).map(r=>{var a;switch(r.t){case"text":return typeof r.v=="string"?r.v:"";case"product":return t.product(String(r.id))??"a product";case"character":return t.person(String(r.id))??"a presenter";case"template":return t.scene(String(r.id))??"a scene";case"color":return String(r.name??r.hex??"");case"ref":return"the attached reference";case"mark":return((a=t.mark)==null?void 0:a.call(t,String(r.imageHash)))??"the brand mark";default:return""}}).join(" ").replace(/\s+/g," ").replace(/\s+([.,!?;:])/g,"$1").trim()||e.prompt||e.promptHead||""}const mce=e=>e===0?"Original":`Refinement ${e}`,gce=e=>e===0?"the original":`Refinement ${e}`,vce=(e,t)=>e.createdAt.localeCompare(t.createdAt)||e.id.localeCompare(t.id);function wce(e,t,n){const r=new Set(e.map(g=>g.id)),a=n.filter(g=>!r.has(g.id)&&g.parentId!==null&&r.has(g.parentId)),i=a.length?[...e,...a].sort(vce):e,u=(i.some(g=>g.id===t.id)?i:[...i,t]).map(g=>g.id===t.id?t:g).filter(g=>g.id===t.id||g.images[0]);let f=0;const h=u.map(g=>{const v=g.kind==="edit"?++f:0;return{node:g,index:v,label:mce(v),from:null,state:g.images[0]?"ready":g.status==="running"?"pending":"failed"}}),p=new Map(h.map((g,v)=>[g.node.id,v]));return h.map((g,v)=>{if(v===0||!g.node.parentId||g.node.parentId===h[v-1].node.id)return g;const w=p.get(g.node.parentId);return w===void 0?g:{...g,from:gce(h[w].index)}})}function tL(e,t){var a;const n=e.find(i=>i.node.id===t);if(!n)return"";const r=((a=e[e.length-1])==null?void 0:a.index)??0;return n.index===0?"Original":`Refinement ${n.index} of ${r}`}const yh=28;function yce({trail:e,activeId:t,names:n,onSelect:r}){var w;const a=s.useRef(null),i=s.useMemo(()=>e.map(b=>eL(b.node,n)),[e,n]),l=bd(),u=(b,y,k)=>l.open({key:b.node.id,src:hn(b.node.images[0],"tile"),label:b.label,said:i[y],from:b.from,el:k,id:b.node.id});s.useEffect(()=>{var b,y;(y=(b=a.current)==null?void 0:b.querySelector('[aria-pressed="true"]'))==null||y.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},[t]);const[f,h]=s.useState(null);s.useEffect(()=>{const b=a.current;if(!b)return;const y=()=>{const E=b.scrollWidth-b.clientWidth;if(E<=1)return h(null);const j=b.scrollLeft;h(j<=1?"end":j>=E-1?"start":"both")},k=()=>{const E=b.querySelector('[aria-pressed="true"]');if(!E)return;const j=E.getBoundingClientRect(),N=b.getBoundingClientRect();j.left<N.left+yh?b.scrollLeft-=N.left+yh-j.left:j.right>N.right-yh&&(b.scrollLeft+=j.right-(N.right-yh))};y(),b.addEventListener("scroll",y,{passive:!0});const S=new ResizeObserver(()=>{k(),y()});return S.observe(b),()=>{b.removeEventListener("scroll",y),S.disconnect()}},[e.length]),s.useEffect(()=>{const b=a.current;if(!b)return;const y=k=>{b.scrollWidth<=b.clientWidth||Math.abs(k.deltaY)<=Math.abs(k.deltaX)||(k.preventDefault(),b.scrollLeft+=k.deltaY)};return b.addEventListener("wheel",y,{passive:!1}),()=>b.removeEventListener("wheel",y)},[]);const p=b=>{var E,j;const y=[...((E=a.current)==null?void 0:E.querySelectorAll(".sc-trail-tile:not([aria-disabled])"))??[]],k=y.indexOf(document.activeElement);let S=-1;if(b.key==="ArrowRight")S=Math.min(y.length-1,k+1);else if(b.key==="ArrowLeft")S=Math.max(0,k-1);else if(b.key==="Home")S=0;else if(b.key==="End")S=y.length-1;else return;b.preventDefault(),b.stopPropagation(),(j=y[S])==null||j.focus()},g=e.some(b=>b.node.id===t)?t:(w=e[0])==null?void 0:w.node.id,v=tL(e,t);return o.jsxs("div",{className:"sc-trail",children:[v&&o.jsx("span",{className:"sc-trail-say",children:v}),o.jsx("nav",{ref:a,className:"sc-thumbs","aria-label":"History of this shot","data-more":f??void 0,onKeyDown:p,children:e.map((b,y)=>{const k=b.node,S=k.id===t,E=b.state==="pending";return o.jsx("button",{type:"button",className:"sc-thumb-btn sc-trail-tile","data-original":b.index===0&&e.length>1?"":void 0,"aria-label":i[y]?`${b.label}: ${i[y]}`:b.label,"aria-pressed":S,"aria-disabled":E||void 0,tabIndex:k.id===g?0:-1,onClick:()=>{E||(l.closeNow(),r(k.id))},onPointerEnter:j=>j.pointerType==="mouse"&&b.state==="ready"&&u(b,y,j.currentTarget),onPointerLeave:j=>j.pointerType==="mouse"&&l.close(),onFocus:j=>gm(j.currentTarget)&&b.state==="ready"&&u(b,y,j.currentTarget),children:b.state==="ready"?o.jsx("img",{src:hn(k.images[0],"micro"),alt:"",className:"sc-thumb",loading:"lazy",decoding:"async","data-active":S,width:52,height:52}):E?o.jsx("span",{className:"sc-thumb sc-thumb-wait","data-active":S,children:o.jsx("span",{className:"sc-shimmer"})}):o.jsx("span",{className:"sc-thumb sc-thumb-failed","data-active":S,children:o.jsx(xc,{size:14})})},k.id)})}),l.shown&&o.jsx(yd,{anchor:l.shown.el,kind:"shot",src:l.shown.src,label:l.shown.label,noun:l.shown.said,note:l.shown.from?`From ${l.shown.from}`:null,onOpen:()=>{var y;const b=(y=l.shown)==null?void 0:y.id;l.closeNow(),b&&r(b)},onHoverIn:l.keep,onHoverOut:l.close,onClose:l.closeNow},l.shown.key)]})}const bce=200,_S=32;function xce({shots:e,activeId:t,onSelect:n,onEndReached:r,complete:a}){var b;const i=s.useRef(null),l=bd(),u=(y,k)=>l.open({key:y.id,src:hn(y.images[0],"tile"),label:Rr(y),el:k,id:y.id}),f=s.useRef(!1);s.useLayoutEffect(()=>{var k;const y=(k=i.current)==null?void 0:k.querySelector('[aria-pressed="true"]');y&&(y.scrollIntoView({block:"center",behavior:f.current?"smooth":"auto"}),f.current=!0)},[t]);const h=s.useRef(null),p=()=>{const y=i.current,k=h.current;if(!y||!k)return;const S=y.scrollHeight-y.clientHeight,E=y.scrollTop;k.style.setProperty("--sc-shotrail-start",S>1?Math.min(1,E/_S).toFixed(3):"0"),k.style.setProperty("--sc-shotrail-end",S>1?Math.min(1,(S-E)/_S).toFixed(3):"0")};s.useLayoutEffect(()=>{const y=i.current;if(!y)return;p();const k=new ResizeObserver(p);return k.observe(y),()=>k.disconnect()},[e.length]);const g=()=>{p();const y=i.current;!y||a||y.scrollTop+y.clientHeight>=y.scrollHeight-bce&&r()},v=y=>{var j,N;const k=[...((j=i.current)==null?void 0:j.querySelectorAll(".sc-shotrail-tile:not([aria-disabled])"))??[]],S=k.indexOf(document.activeElement);let E=-1;if(y.key==="ArrowDown")E=Math.min(k.length-1,S+1);else if(y.key==="ArrowUp")E=Math.max(0,S-1);else if(y.key==="Home")E=0;else if(y.key==="End")E=k.length-1;else return;y.preventDefault(),y.stopPropagation(),(N=k[E])==null||N.focus()},w=e.some(y=>y.id===t)?t:(b=e[0])==null?void 0:b.id;return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:h,className:"sc-shotrail-shell",children:o.jsx("nav",{ref:i,className:"sc-shotrail","aria-label":"Shots in this view",onScroll:g,onKeyDown:v,children:e.map(y=>{const k=y.id===t,S=y.status==="running",E=y.status==="done"&&!!y.images[0];return o.jsx("button",{type:"button",className:"sc-thumb-btn sc-shotrail-tile","aria-label":S?`${Rr(y)}, still rendering`:Rr(y),"aria-pressed":k,"aria-disabled":S||void 0,tabIndex:y.id===w?0:-1,onClick:()=>{S||(l.closeNow(),n(y.id))},onPointerEnter:j=>j.pointerType==="mouse"&&E&&u(y,j.currentTarget),onPointerLeave:j=>j.pointerType==="mouse"&&l.close(),onFocus:j=>gm(j.currentTarget)&&E&&u(y,j.currentTarget),children:E?o.jsx("img",{src:hn(y.images[0],"micro"),alt:"",className:"sc-thumb",loading:"lazy",decoding:"async","data-active":k,width:52,height:52}):S?o.jsx("span",{className:"sc-thumb sc-thumb-wait","data-active":k,children:o.jsx("span",{className:"sc-shimmer"})}):o.jsx("span",{className:"sc-thumb sc-thumb-failed","data-active":k,children:o.jsx(xc,{size:14})})},y.id)})})}),l.shown&&o.jsx(yd,{anchor:l.shown.el,kind:"shot",noun:"Shot",side:"beside",src:l.shown.src,label:l.shown.label,onOpen:()=>{var k;const y=(k=l.shown)==null?void 0:k.id;l.closeNow(),y&&n(y)},onHoverIn:l.keep,onHoverOut:l.close,onClose:l.closeNow},l.shown.key)]})}const kce=60;function Sce({onLeft:e,onRight:t}){const n=s.useRef(null);return{onPointerDown:r=>{r.pointerType!=="mouse"&&(n.current={id:r.pointerId,x:r.clientX,y:r.clientY})},onPointerUp:r=>{const a=n.current;if(n.current=null,!a||a.id!==r.pointerId)return;const i=r.clientX-a.x,l=r.clientY-a.y;Math.abs(i)<kce||Math.abs(i)<2*Math.abs(l)||(i<0?e():t())},onPointerCancel:()=>{n.current=null}}}function Ece(e){const t=_n(),n=bd(),{shown:r,closeNow:a}=n,[i,l]=s.useState(null),u=i??r,f=()=>{l(null),a()};s.useEffect(()=>{if(!i)return;const w=b=>{const y=b.target;y!=null&&y.closest(".sc-chip-preview")||y!=null&&y.closest(e)||l(null)};return document.addEventListener("pointerdown",w,!0),()=>document.removeEventListener("pointerdown",w,!0)},[i,e]);const[h,p]=s.useState(null),g=w=>({"data-open":(u==null?void 0:u.key)===w.key||void 0,"aria-haspopup":"dialog",onPointerEnter:b=>b.pointerType==="mouse"&&!i&&n.open({...w,el:b.currentTarget}),onPointerLeave:b=>b.pointerType==="mouse"&&n.close(),onFocus:b=>gm(b.currentTarget)&&!i&&n.open({...w,el:b.currentTarget}),onClick:b=>{if((i==null?void 0:i.key)===w.key){f();return}a(),l({...w,el:b.currentTarget})}}),v=o.jsxs(o.Fragment,{children:[u&&o.jsx(yd,{anchor:u.el,kind:u.kind,src:Pn(u.src,"tile"),label:u.label,onOpen:()=>{const w=u;f(),w.to?t(w.to):p({src:Pn(w.src,"full"),kind:w.kind,label:w.label})},onHoverIn:n.keep,onHoverOut:()=>!i&&n.close(),onClose:f},u.key),h&&o.jsx(ad,{src:h.src,kind:h.kind,label:h.label,onClose:()=>p(null)})]});return{bind:g,isOpen:w=>(u==null?void 0:u.key)===w,surface:v}}function Cce({brief:e,prompt:t,brand:n,saidRef:r,expanded:a,clamped:i}){var T,P;const{scenes:l,presenters:u,demoProducts:f}=Hn(),h=Ece(".sc-ingredient"),p=(e==null?void 0:e.tokens)??[],g=((T=n==null?void 0:n.json)==null?void 0:T.products)??[],v=((P=n==null?void 0:n.json)==null?void 0:P.characters)??[],w=Dc(n),b=Df(n==null?void 0:n.json),[y,k]=s.useState({});s.useEffect(()=>{for(const C of p){if((C==null?void 0:C.t)!=="template")continue;const R=w.find(H=>H.id===C.id);if(!(R!=null&&R.previewUrl)||zu(R.previewColor))continue;const $=`t${C.id}`;LR(R.previewUrl).then(H=>{const D=zu(H??void 0);D&&k(q=>q[$]?q:{...q,[$]:D})})}});const S={products:g,demoProducts:f,cast:v,presenters:u,scenes:[...w,...l]},E=C=>{var $,H;const R=jR(C,S);if((R==null?void 0:R.kind)==="product"){const{product:D,demo:q}=R;return{key:`p${C.id}`,kind:"product",label:(D==null?void 0:D.name)??(q==null?void 0:q.name)??"product",thumb:D?im((H=($=D==null?void 0:D.shots)==null?void 0:$[0])==null?void 0:H.file,"micro"):(q==null?void 0:q.previewUrl)??null,to:n&&(D||q)?ga(n,C.id):void 0}}if((R==null?void 0:R.kind)==="presenter"){const{character:D,presenter:q}=R,_=(q==null?void 0:q.id)??(D==null?void 0:D.presenterId)??((D==null?void 0:D.origin)==="custom"?D.id:void 0),U=D?qv(D):q?ii(q):{src:null};return{key:`h${C.id}`,kind:"presenter",label:D!=null&&D.supersededBy?`${D.name}, edited since`:(D==null?void 0:D.name)??(q==null?void 0:q.name)??"someone",thumb:U.src,crop:U.crop,to:n&&_?xa(n,_):void 0}}if((R==null?void 0:R.kind)==="scene"){const D=R.scene;return{key:`t${C.id}`,kind:"scene",label:(D==null?void 0:D.name)??"a scene no longer in the catalog",thumb:(D==null?void 0:D.previewUrl)??null,to:n&&D?Ir(n,D.id):void 0,tint:zu(D==null?void 0:D.previewColor),custom:R.custom}}if((C==null?void 0:C.t)==="color")return{key:`c${C.hex}`,kind:"color",label:C.name??C.hex,swatch:C.hex};if((C==null?void 0:C.t)==="ref")return{key:`r${C.imageHash}`,kind:"ref",label:C.label??"reference image",thumb:hn(C.imageHash,"micro"),previewHash:C.imageHash};if((C==null?void 0:C.t)==="mark"){const D=b.find(q=>q.hash===C.imageHash);return{key:`m${C.imageHash}`,kind:"mark",label:D?mm(n==null?void 0:n.json,D):"brand mark",thumb:hn(C.imageHash,"micro"),previewHash:C.imageHash}}return null},j=C=>{const R=o.jsxs(o.Fragment,{children:[C.thumb?o.jsx("img",{src:C.thumb,alt:"","data-crop":C.crop}):C.swatch?o.jsx("i",{style:{background:C.swatch}}):null,C.label]}),$=C.tint??(C.custom?y[C.key]:void 0),H=$?{"--tint":$}:void 0,D=(C.previewHash?hn(C.previewHash,"tile"):Pn(C.thumb,"tile"))??(C.to?"":null);if(D!==null&&Dh(C.kind)){const q=C.kind,_=h.isOpen(C.key),U={key:C.key,src:D,kind:q,label:C.label,to:C.to};return o.jsx("button",{type:"button",className:"sc-ingredient","data-kind":C.kind,"data-tinted":$?"":void 0,style:H,title:_?void 0:`${C.label}. Preview.`,"aria-label":`${C.label}. Preview.`,...h.bind(U),children:R},C.key)}return o.jsx("span",{className:"sc-ingredient","data-kind":C.kind,"data-tinted":$?"":void 0,style:H,title:`${C.kind}: ${C.label}`,children:R},C.key)},N=[];for(const C of p){if(C.t==="text"){const $=C.v.trim();$&&N.push($);continue}const R=E(C);R&&N.push(j(R))}if(!N.length&&!t)return null;const A=N.flatMap((C,R)=>R?[" ",C]:[C]);return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:r,className:"sc-brief-said","data-expanded":a||void 0,"data-clamped":i||void 0,dir:"auto",children:A.length?A:t||""}),h.surface]})}const jce=256,Xl=new Map;function VS(e,t){for(Xl.delete(e),Xl.set(e,t);Xl.size>jce;)Xl.delete(Xl.keys().next().value)}function Ace(e,t){const n=new Map(e.map(a=>[a.id,a])),r=[];for(let a=t.parentId?n.get(t.parentId):void 0;a;a=a.parentId?n.get(a.parentId):void 0)r.unshift(a);return{ancestors:r,siblings:e.filter(a=>a.parentId===t.parentId),children:e.filter(a=>a.parentId===t.id),history:e}}function Nce(e,t){VS(e,t);for(const n of t.history??[])n.id!==e&&VS(n.id,Ace(t.history??[],n))}function Mce(e){var i;const[t,n]=s.useState(()=>{const l=Xl.get(e.id);return l?{id:e.id,lineage:l}:null});s.useEffect(()=>{let l=!0;return je.lineage(e.id).then(u=>{l&&(Nce(e.id,u),n({id:e.id,lineage:u}))}).catch(()=>{}),()=>{l=!1}},[e.id,e.childCount,e.status,e.parentId]);const r=(t==null?void 0:t.id)===e.id?t.lineage:Xl.get(e.id)??null;if(!r)return{ancestors:[],children:[],siblings:[e],sibIndex:0,parentShot:null,history:null,rootId:e.id,loaded:!1};const a=r.siblings.some(l=>l.id===e.id)?r.siblings:[e,...r.siblings];return{ancestors:r.ancestors,children:r.children,siblings:a,sibIndex:a.findIndex(l=>l.id===e.id),parentShot:r.ancestors[r.ancestors.length-1]??null,history:r.history??null,rootId:((i=r.ancestors[0])==null?void 0:i.id)??e.id,loaded:!0}}const Rce=32,zi=new Map;function Pce(e){for(zi.delete(e.id),zi.set(e.id,e);zi.size>Rce;)zi.delete(zi.keys().next().value)}function Lce(e){const[t,n]=s.useState(()=>zi.get(e.id)??null);return s.useEffect(()=>{const r=zi.get(e.id);if(r){n(r);return}let a=!0;return je.node(e.id).then(i=>{a&&(Pce(i),n(i))}).catch(()=>{}),()=>{a=!1}},[e.id]),(t==null?void 0:t.id)===e.id?t:zi.get(e.id)??null}const $ce="(max-width: 1023px)",nL=380,rL=480,ZS=380,gu=e=>Math.min(rL,Math.max(nL,Math.round(e)));function Tce({node:e,rootId:t,items:n,loadMore:r,complete:a,brand:i,engines:l,projectId:u,onClose:f,onSelect:h,onRetry:p,onCancel:g,onKeep:v,onLanded:w,onRemix:b,onArchive:y,onUnarchive:k,onDelete:S,onRefined:E,tokenNames:j}){const{ancestors:N,children:A,history:T}=Mce(e),P=Lce(e),C=s.useMemo(()=>l.find(He=>He.id===e.engineId),[l,e.engineId]),{push:R}=cr(),[$,H]=ba(Kr.ovlPanelW,ZS),D=s.useRef(0),q=s.useRef(0),_=s.useRef(null),U=s.useMemo(()=>{var He;return(((He=e.brief)==null?void 0:He.tokens)??[]).some(mt=>(mt==null?void 0:mt.t)&&mt.t!=="text"&&mt.t!=="format")},[e.brief]),Y=s.useMemo(()=>{const He=Df(i.json);return{...j,mark:mt=>{const vt=He.find(St=>St.hash===mt);return vt?mm(i.json,vt):null}}},[j,i]),I=s.useMemo(()=>eL(P??e,Y),[P,e,Y]),[F,O]=s.useState(!1),[Z,V]=s.useState(!1),[B,K]=s.useState(!1),[ee,se]=s.useState(!1),[oe,me]=s.useState(!1),[ce,we]=s.useState(!1);s.useEffect(()=>{K(!1),we(!1),se(!1)},[e.id]),s.useEffect(()=>{if(!B)return;const He=setTimeout(()=>K(!1),1400);return()=>clearTimeout(He)},[B]),s.useEffect(()=>{if(!ce)return;const He=setTimeout(()=>we(!1),1400);return()=>clearTimeout(He)},[ce]);const[G,ue]=s.useState(null);$w(G,"--sc-ovl-dock-h");const Ne=s.useRef(null),[ne,Fe]=s.useState(!1),[Oe,ot]=s.useState(!1);s.useEffect(()=>Fe(!1),[e.id]),s.useLayoutEffect(()=>{const He=Ne.current;if(!He||ne)return;const mt=()=>ot(He.scrollHeight>He.clientHeight+1);mt();const vt=new ResizeObserver(mt);return vt.observe(He),()=>vt.disconnect()},[I,ne]);const Xe=s.useMemo(()=>wce(T??[...N,e,...A.slice(0,6)],e,n),[T,N,e,A,n]),X=s.useMemo(()=>Xe.find(He=>He.node.id===e.id)??null,[Xe,e.id]),J=Sr($ce),ge=Xe.length>1&&J?tL(Xe,e.id):e.kind!=="edit"?"Shot":T&&X?X.label:"Refinement",ve=s.useMemo(()=>N6(n,e.id),[n,e.id]);s.useEffect(()=>{ve.at>=0&&!a&&n.length-ve.at<=6&&r()},[ve.at,n.length,a,r]);const Ze=He=>{const mt=He>0?ve.next:ve.prev;mt&&h(mt.id)},Ye=bd(),ke=(He,mt)=>He!=null&&He.images[0]?{onPointerEnter:vt=>{vt.pointerType==="mouse"&&Ye.open({key:He.id,src:hn(He.images[0],"tile"),label:Rr(He),noun:mt,el:vt.currentTarget,id:He.id})},onPointerLeave:vt=>{vt.pointerType==="mouse"&&Ye.close()}}:{},te=Sce({onLeft:()=>Ze(1),onRight:()=>Ze(-1)});s.useEffect(()=>{const He=Ye.shown;if(!He)return;const mt=He.noun==="Next shot"?ve.next:ve.prev;mt!=null&&mt.images[0]?Ye.open({key:mt.id,src:hn(mt.images[0],"tile"),label:Rr(mt),noun:He.noun,el:He.el,id:mt.id}):Ye.closeNow()},[e.id]),s.useEffect(()=>{var St,kt;const He=Xe.findIndex(Nt=>Nt.node.id===e.id),vt=[(St=Xe[He-1])==null?void 0:St.node,(kt=Xe[He+1])==null?void 0:kt.node,ve.prev,ve.next].filter(Nt=>!!(Nt!=null&&Nt.images[0])).map(Nt=>{var at;const Bt=new Image;return Bt.decoding="async",Bt.src=hn(Nt.images[0],"tile"),(at=Bt.decode)==null||at.call(Bt).catch(()=>{}),Bt});return()=>{for(const Nt of vt)Nt.src=""}},[Xe,e.id,ve.prev,ve.next]);const le=e.images[0],Me=e.promptHead.slice(0,40).replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"")||"shot",ze=async(He=!1)=>{if(!Z){V(!0);try{const mt=fetch(Fr(le)).then(vt=>{if(!vt.ok)throw new Error(`HTTP ${vt.status}`);return vt.blob()});await navigator.clipboard.write([new ClipboardItem({"image/png":mt})]),He?R({kind:"success",title:"Copied to clipboard"}):K(!0)}catch(mt){R(ln(mt,"Copy failed"))}finally{V(!1)}}},Re=async()=>{if(!ee){se(!0);try{await(e.archived?k(e):y(e))}finally{se(!1)}}},Be=async()=>{if(!oe){me(!0);try{const He=e.brief?cw(e.brief):null;if(!He||He.every(mt=>mt.t==="text"&&!mt.v.trim()))await navigator.clipboard.writeText(I);else{const mt=kt=>{var Nt;switch(kt.t){case"text":return kt.v;case"product":return Y.product(kt.id)??"a product";case"character":return Y.person(kt.id)??"a presenter";case"template":return Y.scene(kt.id)??"a scene";case"color":return kt.name??kt.hex;case"ref":return"reference image";case"mark":return((Nt=Y.mark)==null?void 0:Nt.call(Y,kt.imageHash))??"brand mark"}},{text:vt,html:St}=uJ(He,mt);await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([vt],{type:"text/plain"}),"text/html":new Blob([St],{type:"text/html"})})])}we(!0)}catch(He){R(ln(He,"Copy failed"))}finally{me(!1)}}};s.useEffect(()=>{const He=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=He}},[]);const Qe=[{key:"download",label:"Download",icon:o.jsx(d9,{size:14}),onClick:()=>{const He=document.createElement("a");He.href=Fr(le),He.download=`${Me}.png`,He.click()}},{key:"keep",label:e.kept?"Remove from keepers":"Keep",icon:o.jsx(Ua,{size:14,weight:e.kept?"fill":"regular"}),onClick:()=>v(e),tint:e.kept?"var(--sc-star)":void 0,on:e.kept},{key:"copy",label:"Copy image",icon:B?o.jsx(Un,{size:14,weight:"bold"}):o.jsx(e3,{size:14}),onClick:()=>void ze(),onMenu:()=>void ze(!0),busy:Z,said:B?"Copied":void 0}],rt=[{key:"archive",label:e.archived?"Restore":"Archive",icon:e.archived?o.jsx(H0,{size:14}):o.jsx(Rp,{size:14}),onClick:()=>void Re(),busy:ee},...e.archived?[{key:"delete",label:"Delete permanently",icon:o.jsx(Dp,{size:14}),onClick:()=>O(!0),tint:"var(--sc-red)",dialog:!0}]:[]],_e=e.status==="done"&&e.images.length>0,zt=!_e&&e.kind!=="edit"&&!!e.brief,Et=_e?[...Qe,...rt]:rt,Zt=_e?o.jsx(Pf,{children:Et.map(He=>o.jsxs(Lf,{onSelect:He.onMenu??He.onClick,disabled:He.busy,color:He.tint?"red":void 0,children:[He.icon,He.label]},He.key))}):void 0;return _r.createPortal(o.jsx(cd,{trapped:!0,loop:!0,asChild:!0,onMountAutoFocus:He=>{var mt;He.preventDefault(),(mt=_.current)==null||mt.focus({preventScroll:!0})},children:o.jsxs("div",{ref:_,tabIndex:-1,className:"sc-ovl","data-fb":"shot-overlay","data-fb-node":e.id,role:"dialog","aria-modal":"true","aria-label":Rr(e),"data-rail":n.length>1?"":void 0,style:{"--sc-ovl-panel-w":`${gu($)}px`},children:[n.length>1&&o.jsx(xce,{shots:n,activeId:e.id,onSelect:h,onEndReached:r,complete:a}),o.jsxs("header",{className:"sc-ovl-bar",children:[o.jsxs("div",{className:"sc-ovl-bar-l",children:[o.jsx(lr,{label:"Close (esc)",children:o.jsx("button",{type:"button",className:"sc-icon-btn",onClick:f,"aria-label":"Close",children:o.jsx(Mn,{size:13})})}),ve.at>=0&&n.length>1&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"sc-icon-btn",disabled:!ve.prev,onClick:()=>ve.prev&&h(ve.prev.id),"aria-label":"Previous shot",...ke(ve.prev,"Previous shot"),children:o.jsx(Sa,{size:13})}),o.jsx("button",{type:"button",className:"sc-icon-btn",disabled:!ve.next,onClick:()=>ve.next&&h(ve.next.id),"aria-label":"Next shot",...ke(ve.next,"Next shot"),children:o.jsx(cl,{size:13})})]})]}),Et.length>0&&o.jsxs("div",{className:"sc-ovl-bar-r",children:[o.jsx("div",{className:"sc-ovl-acts",children:Et.map(He=>o.jsx(lr,{label:He.said??He.label,open:!!He.said,children:o.jsx("button",{type:"button",className:"sc-icon-btn",onClick:He.onClick,"aria-label":He.label,"aria-pressed":He.on===void 0?void 0:He.on,"data-on":He.on||void 0,"aria-haspopup":He.dialog?"dialog":void 0,"aria-busy":He.busy||void 0,"data-busy":He.busy||void 0,style:He.tint?{color:He.tint}:void 0,children:He.icon})},He.key))}),o.jsxs(ws,{children:[o.jsx(lr,{label:"More actions",children:o.jsx(ys,{children:o.jsx("button",{type:"button",className:"sc-icon-btn sc-ovl-overflow","aria-label":"More actions",children:o.jsx(I4,{size:18,weight:"bold"})})})}),o.jsx(bs,{align:"end",sideOffset:6,children:Et.map(He=>o.jsxs(Yn,{onSelect:He.onMenu??He.onClick,disabled:He.busy,color:He.tint?"red":void 0,children:[He.icon,He.label]},He.key))})]})]})]}),o.jsx(kf,{open:F,onOpenChange:O,children:o.jsxs(Sf,{maxWidth:"420px",children:[o.jsx(Ef,{children:"Delete this shot permanently?"}),o.jsx(Cf,{size:"2",children:"This cannot be undone."}),o.jsxs(Ds,{gap:"3",mt:"4",justify:"end",children:[o.jsx(Af,{children:o.jsx(ma,{variant:"soft",color:"gray",children:"Cancel"})}),o.jsx(jf,{children:o.jsx(ma,{color:"red",onClick:()=>S(e),children:"Delete permanently"})})]})]})}),Ye.shown&&o.jsx(yd,{anchor:Ye.shown.el,kind:"shot",noun:Ye.shown.noun,src:Ye.shown.src,label:Ye.shown.label,onOpen:()=>{var mt;const He=(mt=Ye.shown)==null?void 0:mt.id;Ye.closeNow(),He&&h(He)},onHoverIn:Ye.keep,onHoverOut:Ye.close,onClose:Ye.closeNow},Ye.shown.key),o.jsxs("div",{className:"sc-ovl-stage","data-takes":Xe.length>1?"":void 0,...te,children:[o.jsx(fce,{node:e,onRetry:()=>p(e),onCancel:()=>g(e),engineName:C==null?void 0:C.displayName,menu:Zt}),Xe.length>1?o.jsx(yce,{trail:Xe,activeId:e.id,names:Y,onSelect:h}):o.jsx("div",{className:"sc-trail sc-trail-empty","aria-hidden":!0})]}),o.jsx("div",{className:"sc-ovl-resize",role:"separator","aria-orientation":"vertical","aria-label":"Resize the details panel","aria-valuemin":nL,"aria-valuemax":rL,"aria-valuenow":gu($),tabIndex:0,onPointerDown:He=>{He.button===0&&(He.preventDefault(),He.stopPropagation(),He.currentTarget.setPointerCapture(He.pointerId))},onPointerMove:He=>{if(!He.currentTarget.hasPointerCapture(He.pointerId))return;const mt=He.currentTarget.closest(".sc-ovl");D.current=He.clientX,!q.current&&(q.current=requestAnimationFrame(()=>{q.current=0,mt==null||mt.style.setProperty("--sc-ovl-panel-w",`${gu(window.innerWidth-D.current)}px`)}))},onPointerUp:He=>{He.currentTarget.hasPointerCapture(He.pointerId)&&(He.currentTarget.releasePointerCapture(He.pointerId),H(gu(window.innerWidth-He.clientX)))},onDoubleClick:He=>{He.stopPropagation(),H(ZS)},onKeyDown:He=>{He.key==="ArrowLeft"?H(mt=>gu(mt+16)):He.key==="ArrowRight"&&H(mt=>gu(mt-16))}}),o.jsxs("aside",{className:"sc-ovl-meta",children:[o.jsxs("div",{className:"sc-ovl-scroll",children:[o.jsxs("div",{className:"sc-ovl-head",children:[o.jsx("b",{children:ge}),e.archived&&o.jsx("small",{className:"sc-ovl-flag",children:"archived"}),_e&&e.costUsd>0&&o.jsxs("small",{className:"sc-ovl-spend",title:"Of your API budget",children:["$",e.costUsd.toFixed(2)]})]}),e.kind!=="root"&&(I||U)&&o.jsxs("div",{className:"sc-ovl-sec sc-ovl-brief",children:[o.jsxs("div",{className:"sc-ovl-brief-head",children:[o.jsx("span",{className:"sc-eyebrow",children:"Prompt"}),o.jsx(lr,{label:ce?"Copied":"Copy the prompt",open:ce||void 0,children:o.jsx("button",{type:"button",className:"sc-icon-btn sc-ovl-copy","aria-label":"Copy the prompt","aria-busy":oe||void 0,"data-busy":oe?"":void 0,onClick:()=>void Be(),children:ce?o.jsx(Un,{size:14,weight:"bold"}):o.jsx(e3,{size:14})})})]}),o.jsx("div",{className:"sc-brief-record",children:o.jsx(Cce,{brief:e.brief,prompt:(P==null?void 0:P.prompt)??e.promptHead,brand:i,saidRef:Ne,expanded:ne,clamped:Oe&&!ne})}),(Oe||ne)&&o.jsx("button",{type:"button",className:"sc-s sc-ovl-more","aria-expanded":ne,onClick:()=>Fe(He=>!He),children:ne?o.jsxs(o.Fragment,{children:[o.jsx(CO,{size:12})," Show less"]}):o.jsxs(o.Fragment,{children:[o.jsx(nl,{size:12})," Show more"]})})]}),(_e||zt)&&o.jsxs("div",{className:"sc-sugg",children:[zt&&o.jsxs("button",{type:"button",className:"sc-s",onClick:()=>b(e),title:"Put this prompt back in the composer, to change and run again",children:[o.jsx(id,{size:12})," Edit the prompt"]}),_e&&o.jsxs("button",{type:"button",className:"sc-s",onClick:()=>p(e),title:"Run the same setup again for a different take",children:[o.jsx(H0,{size:12})," Try again"]}),_e&&o.jsxs("button",{type:"button",className:"sc-s",onClick:()=>b(e),title:"Start a new shot from this setup: same prompt, chips, shape and count, ready to change",children:[o.jsx(Ih,{size:12})," Reuse setup"]})]})]}),(_e||e.status==="running")&&o.jsx("div",{className:"sc-ovl-edit sc-dock",ref:ue,children:o.jsx(Lw,{variant:"overlay",projectId:u,brand:i,engines:l,parentId:t,target:e,sourceImage:le,persistDraft:!1,onQueued:(He,mt,vt,St)=>{w(St??[]),He&&h(He),He&&(E==null||E(He,mt))}})})]})]})}),document.body)}function zS(){const{shotId:e}=Qs(),t=GT(),{push:n}=cr(),r=e?t.byId.get(e)??null:null,[a,i]=s.useState(null);s.useEffect(()=>{if(!e||r)return;let f=!0;return je.node(e).then(h=>f&&i({id:e,node:h.kind==="root"?null:h})).catch(()=>f&&i({id:e,node:null})),()=>{f=!1}},[e,r]),s.useEffect(()=>{if(!(!e||r))return t.subscribeActivity(f=>{const h=f.find(p=>p.id===e);h&&i({id:e,node:h})})},[e,r,t.subscribeActivity]);const l=r??(a!==null&&a.id===e?a.node:null),u=!r&&a!==null&&a.id===e&&a.node===null;return s.useEffect(()=>{u&&(n({kind:"info",title:"That shot is no longer available",detail:"Back to the feed."}),t.close())},[u,t.close,n]),l?o.jsx(Tce,{node:l,rootId:t.rootId,items:t.items,loadMore:t.loadMore,complete:t.complete,brand:t.brand,engines:t.engines,projectId:t.projectId,onClose:t.close,onSelect:t.select,onRetry:t.retry,onCancel:t.cancel,onKeep:t.keep,onLanded:t.landed,onRefined:t.refined,tokenNames:t.tokenNames,onRemix:t.remix,onArchive:()=>t.archive(l),onUnarchive:()=>t.unarchive(l),onDelete:()=>t.delete(l)}):u?null:o.jsx("div",{className:"sc-ovl-wait",role:"status","aria-label":"Loading",children:o.jsx(Ar,{size:"3"})})}function Dce(){const e=NE();return o.jsx(Ds,{align:"center",justify:"center",height:"100vh",p:"5",children:o.jsx(Vv,{failure:{kind:"unknown",title:"This page could not be shown.",fix:"Reloading usually brings it back.",raw:String((e==null?void 0:e.message)??e??""),retryable:!0},action:o.jsx(ma,{size:"1",variant:"soft",color:"gray",onClick:()=>window.location.reload(),children:"Reload"})})})}function Hce(){const{setSlug:e=""}=Qs(),{pathname:t,search:n}=Wn(),{brand:r,sets:a,loaded:i,refresh:l}=dn(),u=_n(),f=gn({path:pt.set,end:!1}),h=a.find(v=>v.slug===e)??a.find(v=>v.id===e)??null;$c(h==null?void 0:h.name);const[p,g]=s.useState(null);if(s.useEffect(()=>{if(!i||h)return;if(p===e){u(yr(r),{replace:!0});return}let v=!0;return l().finally(()=>v&&g(e)),()=>{v=!1}},[i,h,e,p,r,u,l]),s.useEffect(()=>{h&&g(null)},[h]),!i||!h)return null;if(h.slug!==e){const v=f?t.slice(f.pathnameBase.length):"";return o.jsx(Ba,{to:g0(r,h)+v+n,replace:!0})}return o.jsx(JP,{set:h},h.id)}function Oce(){const{pathname:e,search:t}=Wn();return o.jsx(Ba,{to:PK(e,t),replace:!0})}function Ice(){const{brandSlug:e}=Qs();return o.jsx(Ba,{to:`/${e}?settings=brand`,replace:!0})}function Fce(){const{sceneId:e}=Qs();return o.jsxs(o.Fragment,{children:[o.jsx(vae,{},e),o.jsx(bc,{})]})}function _ce(){const{presenterId:e}=Qs();return o.jsxs(o.Fragment,{children:[o.jsx(Cae,{},e),o.jsx(bc,{},e)]})}function Vce(){const{productId:e}=Qs();return o.jsx(ble,{},e)}const Zce=zD([{element:o.jsx(Cne,{}),errorElement:o.jsx(Dce,{}),children:[{index:!0,element:o.jsx(yQ,{})},{path:pt.setup,element:o.jsx(Lne,{})},{path:pt.legacy,element:o.jsx(Oce,{})},{path:pt.brand,element:o.jsx(yne,{}),children:[{index:!0,element:o.jsx(oae,{})},{path:pt.hub,element:o.jsx(JP,{set:null}),children:[{path:pt.hubShot,element:o.jsx(zS,{})}]},{path:pt.set,element:o.jsx(Hce,{}),children:[{path:pt.setShot,element:o.jsx(zS,{})}]},{path:pt.kit,element:o.jsx(Ice,{})},{path:pt.products,element:o.jsx(ile,{})},{path:pt.product,element:o.jsx(Vce,{})},{path:pt.scenes,element:o.jsx(dae,{}),children:[{path:pt.sceneStudio,element:o.jsx(NS,{})}]},{path:pt.scene,element:o.jsx(Fce,{}),children:[{path:pt.sceneEdit,element:o.jsx(NS,{})}]},{path:pt.presenters,element:o.jsx(Eae,{}),children:[{path:pt.presenterStudio,element:o.jsx(Zie,{})}]},{path:pt.presenter,element:o.jsx(_ce,{}),children:[{path:pt.presenterEdit,element:o.jsx(Lie,{})}]}]},{path:pt.notFound,element:o.jsx(Ba,{to:pt.root,replace:!0})}]}]),Z8=localStorage.getItem("sc-theme")??localStorage.getItem("bt-theme");document.documentElement.dataset.theme=Z8==="light"||Z8==="dark"?Z8:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark";CY();const zce={color:"currentColor",size:"1em",weight:"regular",mirrored:!1,"aria-hidden":!0};R$.createRoot(document.getElementById("root")).render(o.jsx(Fn.StrictMode,{children:o.jsx($E.Provider,{value:zce,children:o.jsx(aK,{children:o.jsx(fK,{children:o.jsx(hD,{router:Zce})})})})}));