qrdx 0.0.51 → 0.0.52

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 (436) hide show
  1. package/README.md +102 -6
  2. package/dist/angular.js +252 -0
  3. package/dist/angular.js.map +1 -0
  4. package/dist/angular.mjs +226 -0
  5. package/dist/angular.mjs.map +1 -0
  6. package/dist/core.js +7 -7
  7. package/dist/core.js.map +1 -1
  8. package/dist/core.mjs +7 -7
  9. package/dist/core.mjs.map +1 -1
  10. package/dist/element-define.browser.mjs +2 -0
  11. package/dist/element-define.browser.mjs.map +1 -0
  12. package/dist/element-define.js +2 -0
  13. package/dist/element-define.js.map +1 -0
  14. package/dist/element-define.mjs +2 -0
  15. package/dist/element-define.mjs.map +1 -0
  16. package/dist/element.browser.mjs +91 -0
  17. package/dist/element.browser.mjs.map +1 -0
  18. package/dist/element.js +2 -0
  19. package/dist/element.js.map +1 -0
  20. package/dist/element.mjs +2 -0
  21. package/dist/element.mjs.map +1 -0
  22. package/dist/frames-index.js +1 -1
  23. package/dist/frames-index.js.map +1 -1
  24. package/dist/frames-index.mjs +1 -1
  25. package/dist/frames-index.mjs.map +1 -1
  26. package/dist/frames-official.js +1 -1
  27. package/dist/frames-official.js.map +1 -1
  28. package/dist/frames-official.mjs +1 -1
  29. package/dist/frames-official.mjs.map +1 -1
  30. package/dist/index.js +7 -7
  31. package/dist/index.js.map +1 -1
  32. package/dist/index.mjs +7 -7
  33. package/dist/index.mjs.map +1 -1
  34. package/dist/preact.js +2 -0
  35. package/dist/preact.js.map +1 -0
  36. package/dist/preact.mjs +2 -0
  37. package/dist/preact.mjs.map +1 -0
  38. package/dist/qr-code-canvas.js +1 -1
  39. package/dist/qr-code-canvas.js.map +1 -1
  40. package/dist/qr-code-canvas.mjs +1 -1
  41. package/dist/qr-code-canvas.mjs.map +1 -1
  42. package/dist/solid.js +2 -0
  43. package/dist/solid.js.map +1 -0
  44. package/dist/solid.mjs +2 -0
  45. package/dist/solid.mjs.map +1 -0
  46. package/dist/src/angular.d.ts +94 -0
  47. package/dist/src/element-define.d.ts +3 -0
  48. package/dist/src/element-define.d.ts.map +1 -0
  49. package/dist/src/element.d.ts +150 -0
  50. package/dist/src/element.d.ts.map +1 -0
  51. package/dist/src/engine.d.ts +3 -3
  52. package/dist/src/engine.d.ts.map +1 -1
  53. package/dist/src/frame-spec.d.ts +22 -4
  54. package/dist/src/frame-spec.d.ts.map +1 -1
  55. package/dist/src/frame-text.d.ts +19 -0
  56. package/dist/src/frame-text.d.ts.map +1 -0
  57. package/dist/src/frame.d.ts +12 -7
  58. package/dist/src/frame.d.ts.map +1 -1
  59. package/dist/src/frames/builtin.d.ts +53 -5
  60. package/dist/src/frames/builtin.d.ts.map +1 -1
  61. package/dist/src/frames/catalogue/all.d.ts.map +1 -1
  62. package/dist/src/frames/catalogue/automotive.d.ts.map +1 -1
  63. package/dist/src/frames/catalogue/counts.d.ts +6 -6
  64. package/dist/src/frames/catalogue/counts.d.ts.map +1 -1
  65. package/dist/src/frames/catalogue/events.d.ts.map +1 -1
  66. package/dist/src/frames/catalogue/holidays.d.ts.map +1 -1
  67. package/dist/src/frames/catalogue/index.d.ts.map +1 -1
  68. package/dist/src/frames/catalogue/places.d.ts.map +1 -1
  69. package/dist/src/frames/catalogue/seasons.d.ts.map +1 -1
  70. package/dist/src/frames/catalogue/tags.d.ts.map +1 -1
  71. package/dist/src/preact.d.ts +29 -0
  72. package/dist/src/preact.d.ts.map +1 -0
  73. package/dist/src/scan-score.d.ts +4 -3
  74. package/dist/src/scan-score.d.ts.map +1 -1
  75. package/dist/src/solid.d.ts +21 -0
  76. package/dist/src/solid.d.ts.map +1 -0
  77. package/dist/src/template/dot-ring-layout.d.ts +44 -0
  78. package/dist/src/template/dot-ring-layout.d.ts.map +1 -0
  79. package/dist/src/template/dot-ring.d.ts +41 -0
  80. package/dist/src/template/dot-ring.d.ts.map +1 -0
  81. package/dist/src/template/index.d.ts +1 -0
  82. package/dist/src/template/index.d.ts.map +1 -1
  83. package/dist/src/template-placement.d.ts +8 -0
  84. package/dist/src/template-placement.d.ts.map +1 -0
  85. package/dist/src/templates.d.ts.map +1 -1
  86. package/dist/types/frame-spec.d.ts +149 -14
  87. package/dist/types/frame-spec.d.ts.map +1 -1
  88. package/dist/types/index.js +2 -2
  89. package/dist/types/index.js.map +1 -1
  90. package/dist/types/index.mjs +2 -2
  91. package/dist/types/index.mjs.map +1 -1
  92. package/dist/types/qr.d.ts +26 -3
  93. package/dist/types/qr.d.ts.map +1 -1
  94. package/dist/vanilla.browser.mjs +30 -30
  95. package/dist/vanilla.browser.mjs.map +1 -1
  96. package/package.json +81 -5
  97. package/src/angular.ts +218 -0
  98. package/src/element-define.ts +9 -0
  99. package/src/element.ts +608 -0
  100. package/src/engine.ts +13 -2
  101. package/src/frame-spec.ts +314 -54
  102. package/src/frame-text.ts +111 -0
  103. package/src/frame.tsx +17 -280
  104. package/src/frames/builtin/badge.json +108 -0
  105. package/src/frames/builtin/banner-bottom.json +2 -1
  106. package/src/frames/builtin/banner-top-bottom.json +72 -0
  107. package/src/frames/builtin/banner-top.json +59 -0
  108. package/src/frames/builtin/border.json +62 -0
  109. package/src/frames/builtin/chat-bubble.json +54 -0
  110. package/src/frames/builtin/circle.json +2 -1
  111. package/src/frames/builtin/envelope.json +81 -0
  112. package/src/frames/builtin/focus.json +88 -0
  113. package/src/frames/builtin/gradient-border.json +76 -0
  114. package/src/frames/builtin/menu-card.json +108 -0
  115. package/src/frames/builtin/phone.json +75 -0
  116. package/src/frames/builtin/polaroid.json +56 -0
  117. package/src/frames/builtin/rounded-border.json +8 -4
  118. package/src/frames/builtin/speech-bubble-top.json +76 -0
  119. package/src/frames/builtin/speech-bubble.json +76 -0
  120. package/src/frames/builtin/sticker.json +78 -0
  121. package/src/frames/builtin/tag.json +55 -0
  122. package/src/frames/builtin.ts +181 -12
  123. package/src/frames/catalogue/all.ts +584 -0
  124. package/src/frames/catalogue/automotive.ts +2 -0
  125. package/src/frames/catalogue/counts.ts +6 -6
  126. package/src/frames/catalogue/events.ts +90 -0
  127. package/src/frames/catalogue/holidays.ts +336 -0
  128. package/src/frames/catalogue/index.ts +2733 -0
  129. package/src/frames/catalogue/places.ts +92 -0
  130. package/src/frames/catalogue/seasons.ts +64 -0
  131. package/src/frames/catalogue/tags.ts +384 -0
  132. package/src/frames/official/africa-day.json +110 -0
  133. package/src/frames/official/aquarium-feeding.json +113 -0
  134. package/src/frames/official/autumn-apple-picking.json +81 -0
  135. package/src/frames/official/autumn-mushroom.json +72 -0
  136. package/src/frames/official/autumn-pumpkin-patch.json +83 -0
  137. package/src/frames/official/avurudu-pot.json +87 -0
  138. package/src/frames/official/beach-conditions.json +113 -0
  139. package/src/frames/official/beach-info-sticker.json +81 -0
  140. package/src/frames/official/beach-lifeguard.json +71 -0
  141. package/src/frames/official/blood-donor-drop.json +87 -0
  142. package/src/frames/official/blood-donor-sticker.json +94 -0
  143. package/src/frames/official/book-day-arch.json +71 -0
  144. package/src/frames/official/book-day-list.json +114 -0
  145. package/src/frames/official/camp-check-in.json +74 -0
  146. package/src/frames/official/camp-fire-rules.json +114 -0
  147. package/src/frames/official/camp-map.json +85 -0
  148. package/src/frames/official/carnival-mask.json +76 -0
  149. package/src/frames/official/carnival-pass.json +85 -0
  150. package/src/frames/official/carnival-plume.json +71 -0
  151. package/src/frames/official/childrens-day-carp.json +114 -0
  152. package/src/frames/official/childrens-day-sticker.json +88 -0
  153. package/src/frames/official/chuseok-gift-tag.json +59 -0
  154. package/src/frames/official/chuseok-moon.json +99 -0
  155. package/src/frames/official/chuseok-songpyeon.json +114 -0
  156. package/src/frames/official/cowork-desk.json +82 -0
  157. package/src/frames/official/cowork-meeting-room.json +107 -0
  158. package/src/frames/official/dragon-boat-race.json +83 -0
  159. package/src/frames/official/dragon-boat-ticket.json +98 -0
  160. package/src/frames/official/dragon-boat-zongzi.json +81 -0
  161. package/src/frames/official/durga-puja-lotus.json +114 -0
  162. package/src/frames/official/dussehra-seal.json +187 -0
  163. package/src/frames/official/earth-day-globe.json +77 -0
  164. package/src/frames/official/earth-day-pledge.json +66 -0
  165. package/src/frames/official/earth-day-recycle.json +109 -0
  166. package/src/frames/official/enkutatash-daisy.json +87 -0
  167. package/src/frames/official/enkutatash-seal.json +179 -0
  168. package/src/frames/official/environment-day.json +83 -0
  169. package/src/frames/official/event-anniversary.json +107 -0
  170. package/src/frames/official/event-awards.json +93 -0
  171. package/src/frames/official/event-baby-gifts.json +113 -0
  172. package/src/frames/official/event-baby-shower.json +70 -0
  173. package/src/frames/official/event-birth-announcement.json +71 -0
  174. package/src/frames/official/event-book-fair.json +142 -0
  175. package/src/frames/official/event-booth.json +98 -0
  176. package/src/frames/official/event-craft-fair.json +96 -0
  177. package/src/frames/official/event-cupcake.json +81 -0
  178. package/src/frames/official/event-engagement.json +116 -0
  179. package/src/frames/official/event-film-festival.json +92 -0
  180. package/src/frames/official/event-food-festival.json +108 -0
  181. package/src/frames/official/event-fun-run.json +107 -0
  182. package/src/frames/official/event-gala.json +121 -0
  183. package/src/frames/official/event-game-night.json +97 -0
  184. package/src/frames/official/event-grad-diploma.json +126 -0
  185. package/src/frames/official/event-grad-party.json +108 -0
  186. package/src/frames/official/event-grad-seal.json +186 -0
  187. package/src/frames/official/event-grad-stream.json +94 -0
  188. package/src/frames/official/event-guest-book.json +121 -0
  189. package/src/frames/official/event-hackathon.json +82 -0
  190. package/src/frames/official/event-keynote.json +74 -0
  191. package/src/frames/official/event-match-lineup.json +66 -0
  192. package/src/frames/official/event-meetup.json +86 -0
  193. package/src/frames/official/event-memorial.json +124 -0
  194. package/src/frames/official/event-milestone.json +168 -0
  195. package/src/frames/official/event-night-market.json +88 -0
  196. package/src/frames/official/event-open-mic.json +94 -0
  197. package/src/frames/official/event-party-hat.json +74 -0
  198. package/src/frames/official/event-prom.json +82 -0
  199. package/src/frames/official/event-quince.json +70 -0
  200. package/src/frames/official/event-retirement.json +92 -0
  201. package/src/frames/official/event-reunion.json +98 -0
  202. package/src/frames/official/event-runner-tracker.json +101 -0
  203. package/src/frames/official/event-season-ticket.json +89 -0
  204. package/src/frames/official/event-session-feedback.json +89 -0
  205. package/src/frames/official/event-setlist.json +70 -0
  206. package/src/frames/official/event-short-films.json +113 -0
  207. package/src/frames/official/event-slides.json +85 -0
  208. package/src/frames/official/event-speaker-qa.json +112 -0
  209. package/src/frames/official/event-talent-show.json +130 -0
  210. package/src/frames/official/event-tour-merch.json +63 -0
  211. package/src/frames/official/event-tournament.json +98 -0
  212. package/src/frames/official/event-trivia.json +79 -0
  213. package/src/frames/official/event-workshop.json +127 -0
  214. package/src/frames/official/festa-della-repubblica.json +100 -0
  215. package/src/frames/official/festa-junina-bonfire.json +81 -0
  216. package/src/frames/official/festa-junina-corn.json +72 -0
  217. package/src/frames/official/festa-junina-flags.json +110 -0
  218. package/src/frames/official/fiestas-patrias-chile.json +76 -0
  219. package/src/frames/official/food-day-wheat.json +109 -0
  220. package/src/frames/official/freedom-day-south-africa.json +109 -0
  221. package/src/frames/official/ganesh-marigold.json +71 -0
  222. package/src/frames/official/ganesh-modak.json +81 -0
  223. package/src/frames/official/ganesh-pandal.json +109 -0
  224. package/src/frames/official/garden-plant-label.json +98 -0
  225. package/src/frames/official/german-unity-day.json +100 -0
  226. package/src/frames/official/green-ribbon.json +123 -0
  227. package/src/frames/official/gudi-padwa.json +81 -0
  228. package/src/frames/official/hanami-arch.json +71 -0
  229. package/src/frames/official/hanami-picnic.json +90 -0
  230. package/src/frames/official/hanami-sakura.json +81 -0
  231. package/src/frames/official/hari-raya-haji.json +122 -0
  232. package/src/frames/official/hari-raya-ketupat.json +81 -0
  233. package/src/frames/official/hari-raya-open-house.json +114 -0
  234. package/src/frames/official/hari-raya-pelita.json +77 -0
  235. package/src/frames/official/harvest-basket.json +87 -0
  236. package/src/frames/official/harvest-corn.json +115 -0
  237. package/src/frames/official/harvest-hay.json +89 -0
  238. package/src/frames/official/harvest-market.json +109 -0
  239. package/src/frames/official/hijri-new-year-stamp.json +77 -0
  240. package/src/frames/official/hijri-new-year.json +122 -0
  241. package/src/frames/official/historic-marker.json +176 -0
  242. package/src/frames/official/hostel-check-in.json +113 -0
  243. package/src/frames/official/hostel-house-rules.json +136 -0
  244. package/src/frames/official/hostel-local-tips.json +86 -0
  245. package/src/frames/official/independence-argentina.json +105 -0
  246. package/src/frames/official/independence-bangladesh.json +64 -0
  247. package/src/frames/official/independence-colombia.json +108 -0
  248. package/src/frames/official/independence-ghana.json +105 -0
  249. package/src/frames/official/independence-indonesia.json +92 -0
  250. package/src/frames/official/independence-nigeria.json +100 -0
  251. package/src/frames/official/independence-pakistan.json +95 -0
  252. package/src/frames/official/independence-peru.json +100 -0
  253. package/src/frames/official/independence-poland.json +92 -0
  254. package/src/frames/official/independence-ukraine.json +92 -0
  255. package/src/frames/official/inti-raymi-sun.json +183 -0
  256. package/src/frames/official/jamhuri-day.json +116 -0
  257. package/src/frames/official/janmashtami-feather.json +77 -0
  258. package/src/frames/official/janmashtami-flute.json +81 -0
  259. package/src/frames/official/juneteenth-seal.json +187 -0
  260. package/src/frames/official/juneteenth-star.json +81 -0
  261. package/src/frames/official/kindness-day.json +109 -0
  262. package/src/frames/official/kings-day-crown.json +88 -0
  263. package/src/frames/official/kwanzaa-bands.json +100 -0
  264. package/src/frames/official/kwanzaa-harvest.json +77 -0
  265. package/src/frames/official/kwanzaa-kinara.json +81 -0
  266. package/src/frames/official/lantern-festival-riddles.json +77 -0
  267. package/src/frames/official/lantern-festival-tangyuan.json +122 -0
  268. package/src/frames/official/library-catalog.json +120 -0
  269. package/src/frames/official/library-ebooks.json +107 -0
  270. package/src/frames/official/library-hours.json +107 -0
  271. package/src/frames/official/lohri-bonfire.json +81 -0
  272. package/src/frames/official/lohri-dhol.json +114 -0
  273. package/src/frames/official/loy-krathong-float.json +88 -0
  274. package/src/frames/official/loy-krathong-moon.json +96 -0
  275. package/src/frames/official/loy-krathong-program.json +128 -0
  276. package/src/frames/official/mardi-gras-seal.json +183 -0
  277. package/src/frames/official/marina-welcome.json +172 -0
  278. package/src/frames/official/maslenitsa-pancakes.json +81 -0
  279. package/src/frames/official/maslenitsa-sun.json +183 -0
  280. package/src/frames/official/mid-autumn-gift.json +105 -0
  281. package/src/frames/official/mid-autumn-lantern-walk.json +96 -0
  282. package/src/frames/official/mid-autumn-mooncake.json +81 -0
  283. package/src/frames/official/mid-autumn-rabbit.json +77 -0
  284. package/src/frames/official/mid-autumn-seal.json +178 -0
  285. package/src/frames/official/monsoon-boots.json +88 -0
  286. package/src/frames/official/monsoon-chai.json +82 -0
  287. package/src/frames/official/monsoon-cloud.json +114 -0
  288. package/src/frames/official/monsoon-paper-boat.json +71 -0
  289. package/src/frames/official/monsoon-umbrella.json +81 -0
  290. package/src/frames/official/muertos-marigold.json +87 -0
  291. package/src/frames/official/muertos-ofrenda.json +129 -0
  292. package/src/frames/official/muertos-pan.json +78 -0
  293. package/src/frames/official/muertos-papel-picado.json +120 -0
  294. package/src/frames/official/muertos-seal.json +185 -0
  295. package/src/frames/official/museum-artist-note.json +124 -0
  296. package/src/frames/official/museum-exhibit-label.json +106 -0
  297. package/src/frames/official/museum-gallery-map.json +99 -0
  298. package/src/frames/official/museum-ticket.json +86 -0
  299. package/src/frames/official/national-day-belgium.json +100 -0
  300. package/src/frames/official/national-day-singapore.json +120 -0
  301. package/src/frames/official/navratri-dandiya.json +88 -0
  302. package/src/frames/official/navratri-garba-pass.json +90 -0
  303. package/src/frames/official/navratri-lamp.json +72 -0
  304. package/src/frames/official/nowruz-goldfish.json +71 -0
  305. package/src/frames/official/nowruz-party.json +90 -0
  306. package/src/frames/official/nowruz-sabzeh.json +81 -0
  307. package/src/frames/official/nowruz-seal.json +187 -0
  308. package/src/frames/official/obon-lantern.json +81 -0
  309. package/src/frames/official/obon-sign.json +109 -0
  310. package/src/frames/official/ocean-day-waves.json +114 -0
  311. package/src/frames/official/onam-boat-race.json +83 -0
  312. package/src/frames/official/onam-kasavu.json +122 -0
  313. package/src/frames/official/onam-pookalam.json +175 -0
  314. package/src/frames/official/onam-sadya.json +114 -0
  315. package/src/frames/official/orthodox-christmas-candle.json +71 -0
  316. package/src/frames/official/orthodox-christmas-star.json +76 -0
  317. package/src/frames/official/orthodox-easter-arch.json +77 -0
  318. package/src/frames/official/orthodox-easter-pysanka.json +87 -0
  319. package/src/frames/official/orthodox-easter-seal.json +185 -0
  320. package/src/frames/official/pancake-day.json +114 -0
  321. package/src/frames/official/park-bench-walks.json +121 -0
  322. package/src/frames/official/park-dog-rules.json +88 -0
  323. package/src/frames/official/park-map.json +92 -0
  324. package/src/frames/official/park-playground.json +64 -0
  325. package/src/frames/official/park-report.json +118 -0
  326. package/src/frames/official/parking-find-car.json +89 -0
  327. package/src/frames/official/peace-day-dove.json +66 -0
  328. package/src/frames/official/pink-ribbon-seal.json +180 -0
  329. package/src/frames/official/pink-ribbon.json +82 -0
  330. package/src/frames/official/pohela-boishakh-mela.json +116 -0
  331. package/src/frames/official/pohela-boishakh.json +120 -0
  332. package/src/frames/official/pongal-offers.json +120 -0
  333. package/src/frames/official/pongal-pot.json +81 -0
  334. package/src/frames/official/pongal-sun.json +183 -0
  335. package/src/frames/official/posadas-candle.json +71 -0
  336. package/src/frames/official/posadas-pinata.json +114 -0
  337. package/src/frames/official/pride-flag.json +124 -0
  338. package/src/frames/official/pride-heart.json +83 -0
  339. package/src/frames/official/pride-rainbow.json +81 -0
  340. package/src/frames/official/purim-mask.json +109 -0
  341. package/src/frames/official/purim-pastry.json +71 -0
  342. package/src/frames/official/puthandu-sun.json +101 -0
  343. package/src/frames/official/rakhi-envelope.json +75 -0
  344. package/src/frames/official/rakhi-gift-tag.json +59 -0
  345. package/src/frames/official/rakhi-thread.json +114 -0
  346. package/src/frames/official/ramadan-dates.json +81 -0
  347. package/src/frames/official/ramadan-suhoor.json +94 -0
  348. package/src/frames/official/red-ribbon.json +66 -0
  349. package/src/frames/official/republic-day-india-bands.json +120 -0
  350. package/src/frames/official/republic-day-india.json +182 -0
  351. package/src/frames/official/reyes-crown.json +78 -0
  352. package/src/frames/official/reyes-rosca.json +89 -0
  353. package/src/frames/official/rosh-hashanah-apple.json +81 -0
  354. package/src/frames/official/rosh-hashanah-honey.json +71 -0
  355. package/src/frames/official/rosh-hashanah-shofar.json +128 -0
  356. package/src/frames/official/sankranti-kite.json +114 -0
  357. package/src/frames/official/sankranti-sky.json +98 -0
  358. package/src/frames/official/sankranti-sticker.json +90 -0
  359. package/src/frames/official/school-backpack.json +81 -0
  360. package/src/frames/official/school-bus-routes.json +83 -0
  361. package/src/frames/official/school-lunch-menu.json +81 -0
  362. package/src/frames/official/school-uniform.json +109 -0
  363. package/src/frames/official/school-welcome-apple.json +71 -0
  364. package/src/frames/official/seollal-knot.json +122 -0
  365. package/src/frames/official/sham-el-nessim.json +81 -0
  366. package/src/frames/official/shogatsu-kadomatsu.json +81 -0
  367. package/src/frames/official/songkran-bands.json +123 -0
  368. package/src/frames/official/songkran-bowl.json +81 -0
  369. package/src/frames/official/songkran-drop.json +90 -0
  370. package/src/frames/official/songkran-waves.json +96 -0
  371. package/src/frames/official/spring-cleaning.json +107 -0
  372. package/src/frames/official/spring-showers.json +71 -0
  373. package/src/frames/official/spring-watering-can.json +114 -0
  374. package/src/frames/official/summer-camp.json +90 -0
  375. package/src/frames/official/summer-pool.json +95 -0
  376. package/src/frames/official/summer-reading.json +81 -0
  377. package/src/frames/official/summer-sunglasses.json +114 -0
  378. package/src/frames/official/summer-watermelon.json +89 -0
  379. package/src/frames/official/tabaski.json +114 -0
  380. package/src/frames/official/tanabata-stars.json +170 -0
  381. package/src/frames/official/tanabata-wishes.json +114 -0
  382. package/src/frames/official/teachers-day-apple.json +81 -0
  383. package/src/frames/official/teachers-day-note.json +109 -0
  384. package/src/frames/official/tet-apricot.json +114 -0
  385. package/src/frames/official/tet-banh-chung.json +81 -0
  386. package/src/frames/official/transit-bike-share.json +94 -0
  387. package/src/frames/official/transit-bus-arrivals.json +113 -0
  388. package/src/frames/official/transit-fare.json +97 -0
  389. package/src/frames/official/transit-ferry.json +88 -0
  390. package/src/frames/official/transit-next-trains.json +119 -0
  391. package/src/frames/official/transit-report.json +99 -0
  392. package/src/frames/official/transit-train-timetable.json +98 -0
  393. package/src/frames/official/ugadi-leaves.json +66 -0
  394. package/src/frames/official/vaisakhi-bands.json +120 -0
  395. package/src/frames/official/vaisakhi-dhol.json +81 -0
  396. package/src/frames/official/vaisakhi-wheat.json +73 -0
  397. package/src/frames/official/vesak-candle.json +122 -0
  398. package/src/frames/official/vesak-lantern.json +114 -0
  399. package/src/frames/official/vesak-lotus.json +71 -0
  400. package/src/frames/official/vesak-seal.json +179 -0
  401. package/src/frames/official/visitor-info.json +78 -0
  402. package/src/frames/official/visitor-town-map.json +108 -0
  403. package/src/frames/official/visitor-wildlife.json +70 -0
  404. package/src/frames/official/water-day-drop.json +81 -0
  405. package/src/frames/official/wifi-cafe-cup.json +81 -0
  406. package/src/frames/official/wifi-cowork.json +63 -0
  407. package/src/frames/official/wifi-hostel-board.json +80 -0
  408. package/src/frames/official/wifi-library.json +96 -0
  409. package/src/frames/official/wifi-reception.json +118 -0
  410. package/src/frames/official/wifi-rental.json +91 -0
  411. package/src/frames/official/wifi-venue.json +80 -0
  412. package/src/frames/official/wifi-waiting-room.json +89 -0
  413. package/src/frames/official/winter-lift-pass.json +90 -0
  414. package/src/frames/official/winter-sale.json +120 -0
  415. package/src/frames/official/winter-skating.json +71 -0
  416. package/src/frames/official/winter-snowman.json +81 -0
  417. package/src/frames/official/womens-day-mimosa.json +81 -0
  418. package/src/frames/official/womens-day-seal.json +179 -0
  419. package/src/frames/official/yalda-poem.json +122 -0
  420. package/src/frames/official/yalda-pomegranate.json +81 -0
  421. package/src/frames/official/yalda-watermelon.json +72 -0
  422. package/src/frames/official/yoga-day-lotus.json +81 -0
  423. package/src/frames/official/zoo-animal-facts.json +109 -0
  424. package/src/preact.ts +80 -0
  425. package/src/scan-score.ts +14 -7
  426. package/src/solid.ts +75 -0
  427. package/src/template/dot-ring-layout.ts +230 -0
  428. package/src/template/dot-ring.tsx +165 -0
  429. package/src/template/index.ts +1 -0
  430. package/src/template-placement.ts +149 -0
  431. package/src/templates.tsx +16 -1
  432. package/types/frame-spec.ts +214 -10
  433. package/types/qr.ts +1 -1
  434. package/dist/src/frame-styles.d.ts +0 -50
  435. package/dist/src/frame-styles.d.ts.map +0 -1
  436. package/src/frame-styles.ts +0 -1095
package/dist/core.js CHANGED
@@ -1,6 +1,6 @@
1
- 'use strict';var zod=require('zod'),framesIndex_js=require('./frames-index.js'),framesOfficial_js=require('./frames-official.js');var sn;(a=>{class t{constructor(c,s,l,u){this.version=c;this.errorCorrectionLevel=s;if(c<t.MIN_VERSION||c>t.MAX_VERSION)throw new RangeError("Version value out of range");if(u<-1||u>7)throw new RangeError("Mask value out of range");this.size=c*4+17;let m=[];for(let d=0;d<this.size;d++)m.push(false);for(let d=0;d<this.size;d++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();let f=this.addEccAndInterleave(l);if(this.drawCodewords(f),u==-1){let d=1e9;for(let p=0;p<8;p++){this.applyMask(p),this.drawFormatBits(p);let h=this.getPenaltyScore();h<d&&(u=p,d=h),this.applyMask(p);}}o(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(c,s){let l=a.QrSegment.makeSegments(c);return t.encodeSegments(l,s)}static encodeBinary(c,s){let l=a.QrSegment.makeBytes(c);return t.encodeSegments([l],s)}static encodeSegments(c,s,l=1,u=40,m=-1,f=true){if(!(t.MIN_VERSION<=l&&l<=u&&u<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let d,p;for(d=l;;d++){let _=t.getNumDataCodewords(d,s)*8,y=r.getTotalBits(c,d);if(y<=_){p=y;break}if(d>=u)throw new RangeError("Data too long")}for(let _ of [t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])f&&p<=t.getNumDataCodewords(d,_)*8&&(s=_);let h=[];for(let _ of c){e(_.mode.modeBits,4,h),e(_.numChars,_.mode.numCharCountBits(d),h);for(let y of _.getData())h.push(y);}o(h.length==p);let g=t.getNumDataCodewords(d,s)*8;o(h.length<=g),e(0,Math.min(4,g-h.length),h),e(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let _=236;h.length<g;_^=253)e(_,8,h);let b=[];for(;b.length*8<h.length;)b.push(0);return h.forEach((_,y)=>b[y>>>3]|=_<<7-(y&7)),new t(d,s,b,m)}size;mask;modules=[];isFunction=[];getModule(c,s){return 0<=c&&c<this.size&&0<=s&&s<this.size&&this.modules[s][c]}getModules(){return this.modules}drawFunctionPatterns(){for(let l=0;l<this.size;l++)this.setFunctionModule(6,l,l%2==0),this.setFunctionModule(l,6,l%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let c=this.getAlignmentPatternPositions(),s=c.length;for(let l=0;l<s;l++)for(let u=0;u<s;u++)l==0&&u==0||l==0&&u==s-1||l==s-1&&u==0||this.drawAlignmentPattern(c[l],c[u]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(c){let s=this.errorCorrectionLevel.formatBits<<3|c,l=s;for(let m=0;m<10;m++)l=l<<1^(l>>>9)*1335;let u=(s<<10|l)^21522;o(u>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,n(u,m));this.setFunctionModule(8,7,n(u,6)),this.setFunctionModule(8,8,n(u,7)),this.setFunctionModule(7,8,n(u,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,n(u,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,n(u,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,n(u,m));this.setFunctionModule(8,this.size-8,true);}drawVersion(){if(this.version<7)return;let c=this.version;for(let l=0;l<12;l++)c=c<<1^(c>>>11)*7973;let s=this.version<<12|c;o(s>>>18==0);for(let l=0;l<18;l++){let u=n(s,l),m=this.size-11+l%3,f=Math.floor(l/3);this.setFunctionModule(m,f,u),this.setFunctionModule(f,m,u);}}drawFinderPattern(c,s){for(let l=-4;l<=4;l++)for(let u=-4;u<=4;u++){let m=Math.max(Math.abs(u),Math.abs(l)),f=c+u,d=s+l;0<=f&&f<this.size&&0<=d&&d<this.size&&this.setFunctionModule(f,d,m!=2&&m!=4);}}drawAlignmentPattern(c,s){for(let l=-2;l<=2;l++)for(let u=-2;u<=2;u++)this.setFunctionModule(c+u,s+l,Math.max(Math.abs(u),Math.abs(l))!=1);}setFunctionModule(c,s,l){this.modules[s][c]=l,this.isFunction[s][c]=true;}addEccAndInterleave(c){let s=this.version,l=this.errorCorrectionLevel;if(c.length!=t.getNumDataCodewords(s,l))throw new RangeError("Invalid argument");let u=t.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][s],m=t.ECC_CODEWORDS_PER_BLOCK[l.ordinal][s],f=Math.floor(t.getNumRawDataModules(s)/8),d=u-f%u,p=Math.floor(f/u),h=[],g=t.reedSolomonComputeDivisor(m);for(let _=0,y=0;_<u;_++){let C=c.slice(y,y+p-m+(_<d?0:1));y+=C.length;let M=t.reedSolomonComputeRemainder(C,g);_<d&&C.push(0),h.push(C.concat(M));}let b=[];for(let _=0;_<h[0].length;_++)h.forEach((y,C)=>{(_!=p-m||C>=d)&&b.push(y[_]);});return o(b.length==f),b}drawCodewords(c){if(c.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let s=0;for(let l=this.size-1;l>=1;l-=2){l==6&&(l=5);for(let u=0;u<this.size;u++)for(let m=0;m<2;m++){let f=l-m,p=(l+1&2)==0?this.size-1-u:u;!this.isFunction[p][f]&&s<c.length*8&&(this.modules[p][f]=n(c[s>>>3],7-(s&7)),s++);}}o(s==c.length*8);}applyMask(c){if(c<0||c>7)throw new RangeError("Mask value out of range");for(let s=0;s<this.size;s++)for(let l=0;l<this.size;l++){let u;switch(c){case 0:u=(l+s)%2==0;break;case 1:u=s%2==0;break;case 2:u=l%3==0;break;case 3:u=(l+s)%3==0;break;case 4:u=(Math.floor(l/3)+Math.floor(s/2))%2==0;break;case 5:u=l*s%2+l*s%3==0;break;case 6:u=(l*s%2+l*s%3)%2==0;break;case 7:u=((l+s)%2+l*s%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[s][l]&&u&&(this.modules[s][l]=!this.modules[s][l]);}}getPenaltyScore(){let c=0;for(let m=0;m<this.size;m++){let f=false,d=0,p=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[m][h]==f?(d++,d==5?c+=t.PENALTY_N1:d>5&&c++):(this.finderPenaltyAddHistory(d,p),f||(c+=this.finderPenaltyCountPatterns(p)*t.PENALTY_N3),f=this.modules[m][h],d=1);c+=this.finderPenaltyTerminateAndCount(f,d,p)*t.PENALTY_N3;}for(let m=0;m<this.size;m++){let f=false,d=0,p=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][m]==f?(d++,d==5?c+=t.PENALTY_N1:d>5&&c++):(this.finderPenaltyAddHistory(d,p),f||(c+=this.finderPenaltyCountPatterns(p)*t.PENALTY_N3),f=this.modules[h][m],d=1);c+=this.finderPenaltyTerminateAndCount(f,d,p)*t.PENALTY_N3;}for(let m=0;m<this.size-1;m++)for(let f=0;f<this.size-1;f++){let d=this.modules[m][f];d==this.modules[m][f+1]&&d==this.modules[m+1][f]&&d==this.modules[m+1][f+1]&&(c+=t.PENALTY_N2);}let s=0;for(let m of this.modules)s=m.reduce((f,d)=>f+(d?1:0),s);let l=this.size*this.size,u=Math.ceil(Math.abs(s*20-l*10)/l)-1;return o(0<=u&&u<=9),c+=u*t.PENALTY_N4,o(0<=c&&c<=2568888),c}getAlignmentPatternPositions(){if(this.version==1)return [];{let c=Math.floor(this.version/7)+2,s=this.version==32?26:Math.ceil((this.version*4+4)/(c*2-2))*2,l=[6];for(let u=this.size-7;l.length<c;u-=s)l.splice(1,0,u);return l}}static getNumRawDataModules(c){if(c<t.MIN_VERSION||c>t.MAX_VERSION)throw new RangeError("Version number out of range");let s=(16*c+128)*c+64;if(c>=2){let l=Math.floor(c/7)+2;s-=(25*l-10)*l-55,c>=7&&(s-=36);}return o(208<=s&&s<=29648),s}static getNumDataCodewords(c,s){return Math.floor(t.getNumRawDataModules(c)/8)-t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][c]*t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][c]}static reedSolomonComputeDivisor(c){if(c<1||c>255)throw new RangeError("Degree out of range");let s=[];for(let u=0;u<c-1;u++)s.push(0);s.push(1);let l=1;for(let u=0;u<c;u++){for(let m=0;m<s.length;m++)s[m]=t.reedSolomonMultiply(s[m],l),m+1<s.length&&(s[m]^=s[m+1]);l=t.reedSolomonMultiply(l,2);}return s}static reedSolomonComputeRemainder(c,s){let l=s.map(u=>0);for(let u of c){let m=u^l.shift();l.push(0),s.forEach((f,d)=>l[d]^=t.reedSolomonMultiply(f,m));}return l}static reedSolomonMultiply(c,s){if(c>>>8||s>>>8)throw new RangeError("Byte out of range");let l=0;for(let u=7;u>=0;u--)l=l<<1^(l>>>7)*285,l^=(s>>>u&1)*c;return o(l>>>8==0),l}finderPenaltyCountPatterns(c){let s=c[1];o(s<=this.size*3);let l=s>0&&c[2]==s&&c[3]==s*3&&c[4]==s&&c[5]==s;return (l&&c[0]>=s*4&&c[6]>=s?1:0)+(l&&c[6]>=s*4&&c[0]>=s?1:0)}finderPenaltyTerminateAndCount(c,s,l){return c&&(this.finderPenaltyAddHistory(s,l),s=0),s+=this.size,this.finderPenaltyAddHistory(s,l),this.finderPenaltyCountPatterns(l)}finderPenaltyAddHistory(c,s){s[0]==0&&(c+=this.size),s.pop(),s.unshift(c);}static MIN_VERSION=1;static MAX_VERSION=40;static PENALTY_N1=3;static PENALTY_N2=3;static PENALTY_N3=40;static PENALTY_N4=10;static ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]];static NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]]}a.QrCode=t;function e(i,c,s){if(c<0||c>31||i>>>c)throw new RangeError("Value out of range");for(let l=c-1;l>=0;l--)s.push(i>>>l&1);}function n(i,c){return (i>>>c&1)!=0}function o(i){if(!i)throw new Error("Assertion error")}class r{constructor(c,s,l){this.mode=c;this.numChars=s;this.bitData=l;if(s<0)throw new RangeError("Invalid argument");this.bitData=l.slice();}mode;numChars;bitData;static makeBytes(c){let s=[];for(let l of c)e(l,8,s);return new r(r.Mode.BYTE,c.length,s)}static makeNumeric(c){if(!r.isNumeric(c))throw new RangeError("String contains non-numeric characters");let s=[];for(let l=0;l<c.length;){let u=Math.min(c.length-l,3);e(parseInt(c.substr(l,u),10),u*3+1,s),l+=u;}return new r(r.Mode.NUMERIC,c.length,s)}static makeAlphanumeric(c){if(!r.isAlphanumeric(c))throw new RangeError("String contains unencodable characters in alphanumeric mode");let s=[],l;for(l=0;l+2<=c.length;l+=2){let u=r.ALPHANUMERIC_CHARSET.indexOf(c.charAt(l))*45;u+=r.ALPHANUMERIC_CHARSET.indexOf(c.charAt(l+1)),e(u,11,s);}return l<c.length&&e(r.ALPHANUMERIC_CHARSET.indexOf(c.charAt(l)),6,s),new r(r.Mode.ALPHANUMERIC,c.length,s)}static makeSegments(c){return c==""?[]:r.isNumeric(c)?[r.makeNumeric(c)]:r.isAlphanumeric(c)?[r.makeAlphanumeric(c)]:[r.makeBytes(r.toUtf8ByteArray(c))]}static makeEci(c){let s=[];if(c<0)throw new RangeError("ECI assignment value out of range");if(c<128)e(c,8,s);else if(c<16384)e(2,2,s),e(c,14,s);else if(c<1e6)e(6,3,s),e(c,21,s);else throw new RangeError("ECI assignment value out of range");return new r(r.Mode.ECI,0,s)}static isNumeric(c){return r.NUMERIC_REGEX.test(c)}static isAlphanumeric(c){return r.ALPHANUMERIC_REGEX.test(c)}getData(){return this.bitData.slice()}static getTotalBits(c,s){let l=0;for(let u of c){let m=u.mode.numCharCountBits(s);if(u.numChars>=1<<m)return 1/0;l+=4+m+u.bitData.length;}return l}static toUtf8ByteArray(c){c=encodeURI(c);let s=[];for(let l=0;l<c.length;l++)c.charAt(l)!="%"?s.push(c.charCodeAt(l)):(s.push(parseInt(c.substr(l+1,2),16)),l+=2);return s}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}a.QrSegment=r;})(sn||={});(e=>{(o=>{class n{constructor(a,i){this.ordinal=a;this.formatBits=i;}ordinal;formatBits;static LOW=new n(0,1);static MEDIUM=new n(1,0);static QUARTILE=new n(2,3);static HIGH=new n(3,2)}o.Ecc=n;})(e.QrCode||={});})(sn||={});(e=>{(o=>{class n{constructor(a,i){this.modeBits=a;this.numBitsCharCount=i;}modeBits;numBitsCharCount;static NUMERIC=new n(1,[10,12,14]);static ALPHANUMERIC=new n(2,[9,11,13]);static BYTE=new n(4,[8,16,16]);static KANJI=new n(8,[8,10,12]);static ECI=new n(7,[0,0,0]);numCharCountBits(a){return this.numBitsCharCount[Math.floor((a+7)/17)]}}o.Mode=n;})(e.QrSegment||={});})(sn||={});var xt=sn;var Et={L:xt.QrCode.Ecc.LOW,M:xt.QrCode.Ecc.MEDIUM,Q:xt.QrCode.Ecc.QUARTILE,H:xt.QrCode.Ecc.HIGH},ft=128,Yt="Q",gt="#FFFFFF",Mt="#000000";var $t=0;var er=.1;function wt(t,e="#000000"){return t?typeof t=="string"?t:t.type==="solid"?t.color:t.type==="image"?t.underlay||e:(t.type==="linear"||t.type==="radial"||t.type==="angular")&&t.stops[0]?.color||e:e}var Tn=["logo","halftone"],Ri=zod.z.enum(Tn),In={logo:["blend","badge"],halftone:["color","mono"]},Ei=zod.z.enum([...In.logo,...In.halftone]),ie=192,wi=t=>Math.ceil(t/3)*4,Ai=zod.z.object({width:zod.z.number().int().min(1).max(ie),height:zod.z.number().int().min(1).max(ie),data:zod.z.string().max(wi(ie*ie*4))}).refine(t=>t.data.length===wi(t.width*t.height*4),{message:"Art image data does not match its width and height"}),go=zod.z.object({mode:Ri,image:Ai,intensity:zod.z.number().min(0).max(1).optional(),variant:Ei.optional(),matchEyes:zod.z.boolean().optional()});var Ou=zod.z.enum(["solid","linear","radial","angular","image"]),Pi=zod.z.object({type:zod.z.literal("solid"),color:zod.z.string()}),nr=zod.z.object({color:zod.z.string(),offset:zod.z.number().min(0).max(100)}),vi=zod.z.object({type:zod.z.literal("linear"),stops:zod.z.array(nr).min(2),angle:zod.z.number().optional().default(0)}),Li=zod.z.object({type:zod.z.literal("radial"),stops:zod.z.array(nr).min(2)}),Ii=zod.z.object({type:zod.z.literal("angular"),stops:zod.z.array(nr).min(2),angle:zod.z.number().optional().default(0)}),Ti=zod.z.enum(["cover","contain","tile"]),Fi=zod.z.enum(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]),ki=zod.z.object({type:zod.z.literal("image"),src:zod.z.string().min(1),fit:Ti.optional().default("cover"),scale:zod.z.number().min(.1).max(4).optional().default(1),position:Fi.optional().default("center"),opacity:zod.z.number().min(0).max(1).optional().default(1),underlay:zod.z.string().optional()}),pe=zod.z.union([zod.z.string(),Pi,vi,Li,Ii,ki]);function Gt(t,e="#000000"){return t?typeof t=="string"?{type:"solid",color:t}:t:{type:"solid",color:e}}function cn(t){return !t||typeof t=="string"?false:t.type==="linear"||t.type==="radial"||t.type==="angular"}function bo(t){return typeof t=="object"&&t!==null&&t.type==="image"}function Du(t,e="#000000"){let n=Gt(t,e);return n.type==="solid"?n.color:n.type==="image"?n.underlay||e:n.stops[0]?.color||e}function Ni(t="center"){let[e,n]=t.split("-");return t==="center"?"center":n?`${n} ${e}`:e==="top"||e==="bottom"?`center ${e}`:`${e} center`}function Qu(t){if(!t)return "#000000";if(typeof t=="string")return t;let e=Gt(t);if(e.type==="solid")return e.color;if(e.type==="image"){let r=e.fit==="tile"?`${25*(e.scale??1)}% auto`:(e.scale??1)===1?e.fit==="contain"?"contain":"cover":`${100*(e.scale??1)}% auto`,a=e.fit==="tile"?"repeat":"no-repeat";return `${`url("${e.src.replace(/"/g,"%22")}")`} ${Ni(e.position)} / ${r} ${a}, ${e.underlay??"transparent"}`}let o=[...e.stops].sort((r,a)=>r.offset-a.offset).map(r=>`${r.color} ${r.offset}%`).join(", ");return e.type==="linear"?`linear-gradient(${(e.angle??0)+90}deg, ${o})`:e.type==="angular"?`conic-gradient(from ${e.angle??0}deg, ${o})`:`radial-gradient(circle, ${o})`}var Bu=zod.z.object({x:zod.z.number(),y:zod.z.number(),w:zod.z.number(),h:zod.z.number()});var _o=["square","rounded","circle","message","message-reverse","diya","diya-reverse","rounded-triangle","leaf","drop","plus","cross-rounded","hexagon","octagon","flower","heart","squircle","dots","extra-rounded","leaf-reverse","drop-reverse"],Di=["diamond","star","banner"],yo=zod.z.enum([..._o,...Di]),Gu=zod.z.enum(_o);var xo=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],Bi=["curly"],$o=zod.z.enum([...xo,...Bi]),Uu=zod.z.enum(xo);var Gi=["none","banner-bottom","banner-top","border","rounded-border","speech-bubble","banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"],Xt=24,So="Scan me",ln=.5,be=1.5,Ui=zod.z.enum(Gi),rr=zod.z.object({style:Ui,text:zod.z.string().max(Xt).optional(),color:zod.z.string().optional(),textColor:zod.z.string().optional(),secondaryText:zod.z.string().max(Xt).optional(),secondaryColor:zod.z.string().optional(),fontScale:zod.z.number().min(ln).max(be).optional()});function it(t,e=3){let n=10**e;return Math.round(t*n)/n+0}function x(t,e=3){return String(it(t,e))}function A(t,...e){let n=t[0]??"";for(let o=0;o<e.length;o++){let r=e[o];n+=(typeof r=="number"?x(r):r)+(t[o+1]??"");}return n}var qu={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},zu=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,Co=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function or(t,e=Number.POSITIVE_INFINITY){if(!zu.test(t))return null;let n=[],o=0,r=()=>{for(;o<t.length&&/[\s,]/.test(t[o]);)o++;},a=()=>{r(),Co.lastIndex=o;let s=Co.exec(t);if(!s)return null;let l=s[0],u=l.indexOf(".");if(u>=0&&l.length-u-1>e)return null;o=Co.lastIndex;let m=Number(l);return Number.isFinite(m)?m:null},i=()=>{r();let s=t[o];return s==="0"||s==="1"?(o++,s==="1"?1:0):null},c=()=>(r(),o<t.length&&/[0-9.+-]/.test(t[o]));for(r();o<t.length;){let s=t[o],l=s.toUpperCase(),u=qu[l];if(u===void 0||n.length===0&&l!=="M")return null;if(o++,u===0){n.push({command:s,values:[]}),r();continue}let m=s,f=true;for(;f||c();){let d=[];for(let p=0;p<u;p++){let h=l==="A"&&(p===3||p===4)?i():a();if(h===null)return null;d.push(h);}n.push({command:m,values:d}),l==="M"&&(m=s==="M"?"L":"l"),f=false;}r();}return n}function qi(t){let e=0;for(let{command:n}of t)e+=n.toUpperCase()==="A"?4:1;return e}function zi(t,e=1,n=0,o=0){let r="";for(let{command:a,values:i}of t){let c=a.toUpperCase(),s=a===c,l=s?n:0,u=s?o:0,m;switch(c){case "Z":m=[];break;case "H":m=[x(i[0]*e+l)];break;case "V":m=[x(i[0]*e+u)];break;case "A":m=[x(Math.abs(i[0])*e),x(Math.abs(i[1])*e),x(i[2]),String(i[3]),String(i[4]),x(i[5]*e+l),x(i[6]*e+u)];break;default:m=i.map((f,d)=>x(f*e+(d%2===0?l:u)));}r+=a+m.join(" ");}return r}function ar(t,e=.25){let n=[],o=[],r=[0,0],a=[0,0],i=()=>{o.length>2&&n.push(o),o=[];};for(let c of t)if(c.op==="M")i(),r=[c.x,c.y],a=r,o.push(r);else if(c.op==="L")a=[c.x,c.y],o.push(a);else if(c.op==="C"){let s=a,l=[c.x1,c.y1],u=[c.x2,c.y2],m=[c.x,c.y],f=Math.hypot(l[0]-s[0],l[1]-s[1])+Math.hypot(u[0]-l[0],u[1]-l[1])+Math.hypot(m[0]-u[0],m[1]-u[1]),d=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(f/(4*e)))));for(let p=1;p<=d;p++){let h=p/d,g=1-h;o.push([g*g*g*s[0]+3*g*g*h*l[0]+3*g*h*h*u[0]+h*h*h*m[0],g*g*g*s[1]+3*g*g*h*l[1]+3*g*h*h*u[1]+h*h*h*m[1]]);}a=m;}else i(),a=r;return i(),n}function ir(t,e){let n=[r=>r[0]-e.x0,r=>e.x1-r[0],r=>r[1]-e.y0,r=>e.y1-r[1]],o=t;for(let r of n){if(o.length===0)break;let a=o;o=[];for(let i=0;i<a.length;i++){let c=a[i],s=a[(i+a.length-1)%a.length],l=r(c),u=r(s);l>=0?(u<0&&o.push(Wi(s,c,u,l)),o.push(c)):u>=0&&o.push(Wi(s,c,u,l));}}return o.length>2?o:[]}function Wi(t,e,n,o){let r=n/(n-o);return [t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function Hi(t){return t.filter(e=>e.length>2).map(e=>`M${e.map(([n,o])=>`${x(n)} ${x(o)}`).join("L")}Z`).join("")}function Fe(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(i,c)=>{e=Math.min(e,i),n=Math.min(n,c),o=Math.max(o,i),r=Math.max(r,c);};for(let i of t)i.op==="C"?(a(i.x1,i.y1),a(i.x2,i.y2),a(i.x,i.y)):i.op!=="Z"&&a(i.x,i.y);return Number.isFinite(e)?{x0:e,y0:n,x1:o,y1:r}:null}var Wu={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function Yi(t){return t.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(e,n)=>{if(n[0]==="#"){let o=n[1].toLowerCase()==="x"?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return Number.isInteger(o)&&o>0&&o<=1114111&&!(o>=55296&&o<=57343)?String.fromCodePoint(o):e}return Wu[n.toLowerCase()]??e})}var Hu=60,Mo=62,wo=47,Vu=61,Vi=34,ji=39,Eo=/\s*/y,ju=/[^\s/>]*/y,Yu=/[^\s>]*/y,Xu=/[^\s=]*/y;function un(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function Zu(t,e){let n=t.length,o=$=>{let S=Number.POSITIVE_INFINITY,R=-1;return w=>((w<S||R>=0&&R<w)&&(S=w,R=t.indexOf($,w)),R)},r=o("-->"),a=o("?>"),i=o("]]>"),c=o(">"),s,l=$=>{let S=t.charCodeAt($);if(S!==Vi&&S!==ji)return $+1;let R=t.indexOf(t[$],$+1);return R<0?n:R+1},u=$=>{for(let S=$;S<n&&!s?.[S];S=l(S)){let R=t.charCodeAt(S);if(R===Mo||R===wo&&t.charCodeAt(S+1)===Mo)return S}s??=new Uint8Array(n);for(let S=$;S<n&&!s[S];S=l(S))s[S]=1;return -1},m=-1,f=-1,d=-1,p=-1,h=$=>{let S=$+1;if(S<m||S>=f){m=S,f=un(ju,t,S),d=-1;for(let w=f;w>S;w--){let P=t.charCodeAt(w);if((w===f||P===Vi||P===ji)&&(p=u(w),p>=0)){d=w;break}}}if(d<=S)return -1;let R=t.charCodeAt(p)===wo;return e.open(t.slice(S,d),t.slice(d,p),R),p+(R?2:1)},g=-1,b=-1,_=-1,y=$=>{let S=$+2;if(S<g||S>=b){g=S,b=un(Yu,t,S);let R=un(Eo,t,b);_=b>S&&t.charCodeAt(R)===Mo?R:-1;}return _},C=$=>{if(t.startsWith("<!--",$)){let S=r($+4);if(S>=0)return S+3}if(t.startsWith("<?",$)){let S=a($+2);if(S>=0)return S+2}if(t.startsWith("<![CDATA[",$)){let S=i($+9);if(S>=0)return e.cdata(t.slice($+9,S)),S+3}if(t.startsWith("<!",$)){let S=c($+2);if(S>=0)return S+1}if(t.charCodeAt($+1)===wo){let S=y($);return S<0?-1:(e.close(),S+1)}return h($)},M=0;for(;M<n;)if(t.charCodeAt(M)===Hu){let $=C(M);M=$<0?M+1:$;}else {let $=t.indexOf("<",M),S=$<0?n:$;e.text(t.slice(M,S)),M=S;}}function Ku(t){let e={},n=0;for(;n<t.length;){let o=un(Xu,t,n);if(o===n){n++;continue}let r=un(Eo,t,o);if(t.charCodeAt(r)===Vu){let a=un(Eo,t,r+1),i=t[a],c=i==='"'||i==="'"?t.indexOf(i,a+1):-1;if(c>=0){e[t.slice(n,o)]=Yi(t.slice(a+1,c)),n=c+1;continue}}n=o;}return e}function _e(t){let e={name:"#root",attrs:{},children:[],text:""},n=[e],o=()=>n.at(-1);Zu(t,{open(a,i,c){let s=Ku(i),l={name:a,attrs:s,children:[],text:""};o().children.push(l),c||n.push(l);},close(){n.length>1&&n.pop();},text(a){o().text+=Yi(a);},cdata(a){o().text+=a;}});let r=a=>{for(let i of a.children){if(i.name==="svg")return i;let c=r(i);if(c)return c}return null};return r(e)}var sr=[1,0,0,1,0,0];function ht(t,e){let[n,o,r,a,i,c]=t,[s,l,u,m,f,d]=e;return [n*s+r*l,o*s+a*l,n*u+r*m,o*u+a*m,n*f+r*d+i,o*f+a*d+c]}function j(t,e,n){return [t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}function mn(t){return Math.sqrt(Math.abs(t[0]*t[3]-t[1]*t[2]))}function ke(t){return t?(t.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function Zt(t){let e=sr;if(!t)return e;for(let[,n,o]of t.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let r=ke(o),a=sr;switch(n){case "matrix":r.length===6&&(a=r);break;case "translate":a=[1,0,0,1,r[0]??0,r[1]??0];break;case "scale":a=[r[0]??1,0,0,r[1]??r[0]??1,0,0];break;case "rotate":{let i=(r[0]??0)*Math.PI/180,c=Math.cos(i),s=Math.sin(i),[l,u]=[r[1]??0,r[2]??0];a=ht(ht([1,0,0,1,l,u],[c,s,-s,c,0,0]),[1,0,0,1,-l,-u]);break}case "skewX":a=[1,0,Math.tan((r[0]??0)*Math.PI/180),1,0,0];break;case "skewY":a=[1,Math.tan((r[0]??0)*Math.PI/180),0,1,0,0];break;}e=ht(e,a);}return e}var Ro=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function Ju(t,e,n,o,r,a,i,c,s){if(t===c&&e===s)return [];let l=Math.abs(n),u=Math.abs(o);if(l===0||u===0)return [{op:"L",x:c,y:s}];let m=r*Math.PI/180,f=Math.cos(m),d=Math.sin(m),p=(t-c)/2,h=(e-s)/2,g=f*p+d*h,b=-d*p+f*h,_=g*g/(l*l)+b*b/(u*u);_>1&&(l*=Math.sqrt(_),u*=Math.sqrt(_));let y=l*l*u*u-l*l*b*b-u*u*g*g,C=l*l*b*b+u*u*g*g,M=(a===i?-1:1)*Math.sqrt(Math.max(0,y/C)),$=M*l*b/u,S=-M*u*g/l,R=f*$-d*S+(t+c)/2,w=d*$+f*S+(e+s)/2,P=(H,Q,U,tt)=>Math.atan2(H*tt-Q*U,H*U+Q*tt),v=P(1,0,(g-$)/l,(b-S)/u),L=P((g-$)/l,(b-S)/u,(-g-$)/l,(-b-S)/u);!i&&L>0?L-=2*Math.PI:i&&L<0&&(L+=2*Math.PI);let I=Math.max(1,Math.ceil(Math.abs(L)/(Math.PI/2)-1e-9)),F=L/I,O=4/3*Math.tan(F/4),T=(H,Q)=>[R+l*f*H-u*d*Q,w+l*d*H+u*f*Q],B=[];for(let H=0;H<I;H++){let Q=v+H*F,U=Q+F,[tt,yt]=T(Math.cos(Q)-O*Math.sin(Q),Math.sin(Q)+O*Math.cos(Q)),[st,k]=T(Math.cos(U)+O*Math.sin(U),Math.sin(U)-O*Math.cos(U)),[q,z]=H===I-1?[c,s]:T(Math.cos(U),Math.sin(U));B.push({op:"C",x1:tt,y1:yt,x2:st,y2:k,x:q,y:z});}return B}function se(t){let e=[],n=0,o=0,r=0,a=0,i=0,c="",s=null,l=null,u=()=>{for(;n<t.length&&/[\s,]/.test(t[n]);)n++;},m=()=>{u(),Ro.lastIndex=n;let p=Ro.exec(t);return p?(n=Ro.lastIndex,Number(p[0])):null},f=()=>{u();let p=t[n];return p==="0"||p==="1"?(n++,p==="1"):null},d=p=>{let h=[];for(let g=0;g<p;g++){let b=m();if(b===null)return null;h.push(b);}return h};for(;u(),!(n>=t.length);){let p=t[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(p))c=p,n++;else if(!c||c==="Z"||c==="z")break;let h=c===c.toLowerCase(),g=h?o:0,b=h?r:0,_=c.toUpperCase();if(_==="Z"){e.push({op:"Z"}),o=a,r=i,s=null,l=null;continue}if(_==="A"){let $=d(3),S=f(),R=f(),w=d(2);if(!($&&w)||S===null||R===null)break;let[P,v,L]=$,I=w[0]+g,F=w[1]+b;e.push(...Ju(o,r,P,v,L,S,R,I,F)),o=I,r=F,s=null,l=null;continue}let y={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[_]??0,C=d(y);if(!C)break;let M=C;switch(_){case "M":o=M[0]+g,r=M[1]+b,a=o,i=r,e.push({op:"M",x:o,y:r}),c=h?"l":"L",s=null,l=null;break;case "L":case "H":case "V":_!=="V"&&(o=M[0]+g),_==="V"?r=M[0]+b:_==="L"&&(r=M[1]+b),e.push({op:"L",x:o,y:r}),s=null,l=null;break;case "C":case "S":{let $,S;_==="C"?($=[M[0]+g,M[1]+b],S=M.slice(2)):($=s?[2*o-s[0],2*r-s[1]]:[o,r],S=M);let R=[S[0]+g,S[1]+b],w=[S[2]+g,S[3]+b];e.push({op:"C",x1:$[0],y1:$[1],x2:R[0],y2:R[1],x:w[0],y:w[1]}),[o,r]=w,s=R,l=null;break}case "Q":case "T":{let $,S;_==="Q"?($=[M[0]+g,M[1]+b],S=[M[2]+g,M[3]+b]):($=l?[2*o-l[0],2*r-l[1]]:[o,r],S=[M[0]+g,M[1]+b]),e.push({op:"C",x1:o+2/3*($[0]-o),y1:r+2/3*($[1]-r),x2:S[0]+2/3*($[0]-S[0]),y2:S[1]+2/3*($[1]-S[1]),x:S[0],y:S[1]}),[o,r]=S,l=$,s=null;break}}}return e}var cr=.5522847498;function Kt(t,e,n,o){if(n<=0||o<=0)return [];let r=n*cr,a=o*cr;return [{op:"M",x:t+n,y:e},{op:"C",x1:t+n,y1:e+a,x2:t+r,y2:e+o,x:t,y:e+o},{op:"C",x1:t-r,y1:e+o,x2:t-n,y2:e+a,x:t-n,y:e},{op:"C",x1:t-n,y1:e-a,x2:t-r,y2:e-o,x:t,y:e-o},{op:"C",x1:t+r,y1:e-o,x2:t+n,y2:e-a,x:t+n,y:e},{op:"Z"}]}function Jt(t,e,n,o,r=0,a=0){if(n<=0||o<=0)return [];let i=Math.min(Math.max(r,0),n/2),c=Math.min(Math.max(a,0),o/2);if(i===0||c===0)return [{op:"M",x:t,y:e},{op:"L",x:t+n,y:e},{op:"L",x:t+n,y:e+o},{op:"L",x:t,y:e+o},{op:"Z"}];let s=i*cr,l=c*cr,u=t+n,m=e+o;return [{op:"M",x:t+i,y:e},{op:"L",x:u-i,y:e},{op:"C",x1:u-i+s,y1:e,x2:u,y2:e+c-l,x:u,y:e+c},{op:"L",x:u,y:m-c},{op:"C",x1:u,y1:m-c+l,x2:u-i+s,y2:m,x:u-i,y:m},{op:"L",x:t+i,y:m},{op:"C",x1:t+i-s,y1:m,x2:t,y2:m-c+l,x:t,y:m-c},{op:"L",x:t,y:e+c},{op:"C",x1:t,y1:e+c-l,x2:t+i-s,y2:e,x:t+i,y:e},{op:"Z"}]}var mr="qrdx.frame",dr=1,kn="custom",ct={minArtboard:50,maxArtboard:2e3,maxCoordinate:4e3,maxDecimals:3,maxShapes:64,maxLabels:8,maxPolygonPoints:256,maxPathLength:16e3,maxSegments:2e3,maxGradientSteps:64,maxGradientWork:16e3,maxBytes:32768,minQrShare:.5,minPadding:.04,defaultPadding:.08,maxTextLength:Xt},Zi=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],fr=.95,Ki=200,Ji=["frame","text","accent","background"],tm=/[\t\n\v\f\r\u0085\u2028\u2029]/g,em=/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u115f\u1160\u17b4\u17b5\u180b-\u180f\u200b-\u200f\u202a-\u202e\u2060-\u206f\u3164\ufe00-\ufe0f\ufeff\uffa0\ufff0-\ufffb]|\udb40[\udc00-\udcff]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/g;function hr(t,e=Xt){let n=t.slice(0,1e3).normalize("NFC").replace(tm," ").replace(em,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,e)).join("").trim()}function nm(t){for(let e of t)if((e.codePointAt(0)??0)>255)return false;return true}var vo=t=>Math.abs(t*1e3-Math.round(t*1e3))<1e-6,bt=zod.z.number().min(-ct.maxCoordinate).max(ct.maxCoordinate).refine(vo,{message:`Numbers may have at most ${ct.maxDecimals} decimals`}),Ft=bt.refine(t=>t>0,{message:"Must be greater than 0"}),ur=bt.refine(t=>t>=0,{message:"Must not be negative"}),lr=zod.z.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color"),Ao=zod.z.union([zod.z.enum(Ji),lr]),dn=zod.z.union([Ao,zod.z.object({mix:zod.z.tuple([Ao,Ao]),amount:zod.z.number().min(0).max(1).refine(vo)}).strict()]),ye=zod.z.union([dn,zod.z.object({gradient:zod.z.object({from:dn,to:dn,direction:zod.z.enum(["horizontal","vertical"]).optional(),steps:zod.z.int().min(2).max(ct.maxGradientSteps).optional()}).strict()}).strict()]),Po={x:bt,y:bt,width:Ft,height:Ft},rm=zod.z.object({type:zod.z.literal("rect"),...Po,radius:ur.optional(),fill:ye,hole:zod.z.object({...Po,radius:ur.optional()}).strict().optional()}).strict(),om=zod.z.object({type:zod.z.literal("circle"),cx:bt,cy:bt,r:Ft,hole:Ft.optional(),fill:ye}).strict(),am=zod.z.object({type:zod.z.literal("ellipse"),cx:bt,cy:bt,rx:Ft,ry:Ft,fill:ye}).strict(),im=zod.z.object({type:zod.z.literal("polygon"),points:zod.z.array(zod.z.tuple([bt,bt])).min(3).max(ct.maxPolygonPoints),fill:ye}).strict(),sm=zod.z.object({type:zod.z.literal("path"),d:zod.z.string().min(2).max(ct.maxPathLength),fill:ye,fillRule:zod.z.enum(["nonzero","evenodd"]).optional()}).strict(),cm=zod.z.object({type:zod.z.literal("line"),x1:bt,y1:bt,x2:bt,y2:bt,width:Ft,cap:zod.z.enum(["butt","round"]).optional(),dash:zod.z.tuple([Ft,Ft]).optional(),fill:ye}).strict(),lm=zod.z.object({type:zod.z.literal("icon"),icon:zod.z.enum(Zi),x:bt,y:bt,size:Ft,fill:ye}).strict(),ts=zod.z.discriminatedUnion("type",[rm,om,am,im,sm,cm,lm]),es={id:zod.z.string().regex(/^[a-z][a-z0-9-]{0,31}$/),slot:zod.z.enum(["primary","secondary","fixed"]),text:zod.z.string().max(200),maxLength:zod.z.int().min(1).max(Xt).optional(),color:dn,weight:zod.z.enum(["bold","regular"]).optional()},um=zod.z.object({type:zod.z.literal("text"),...es,box:zod.z.object(Po).strict(),align:zod.z.enum(["start","middle","end"]).optional(),fontSize:Ft.optional()}).strict(),mm=zod.z.object({type:zod.z.literal("curved"),...es,curve:zod.z.object({cx:bt,cy:bt,radius:Ft,side:zod.z.enum(["top","bottom"]),spread:zod.z.number().min(20).max(300).refine(vo).optional()}).strict(),fontSize:Ft}).strict(),ns=zod.z.discriminatedUnion("type",[um,mm]),Xi=bt.refine(t=>t>=ct.minArtboard&&t<=ct.maxArtboard,{message:`Artboard sides must be ${ct.minArtboard} to ${ct.maxArtboard} units`}),dm=zod.z.object({kind:zod.z.literal(mr),version:zod.z.literal(dr),artboard:zod.z.object({width:Xi,height:Xi}).strict(),qr:zod.z.object({x:bt,y:bt,size:Ft,padding:ur.optional(),radius:ur.optional()}).strict(),colors:zod.z.object({frame:lr,text:lr.optional(),accent:lr.optional()}).strict(),shapes:zod.z.array(ts).max(ct.maxShapes),labels:zod.z.array(ns).max(ct.maxLabels),bleed:zod.z.union([zod.z.literal("none"),dn]).optional()}).strict();function rs(t){let e=fn(t);return {x0:t.qr.x-e,y0:t.qr.y-e,x1:t.qr.x+t.qr.size+e,y1:t.qr.y+t.qr.size+e}}function fn(t){return t.qr.padding??t.qr.size*ct.defaultPadding}var fm=(t,e)=>Math.min(t.x1,e.x1)-Math.max(t.x0,e.x0)>1e-6&&Math.min(t.y1,e.y1)-Math.max(t.y0,e.y0)>1e-6;function hm(t){switch(t.type){case "rect":return {bounds:{x0:t.x,y0:t.y,x1:t.x+t.width,y1:t.y+t.height},segments:t.hole?18:9};case "circle":return {bounds:{x0:t.cx-t.r,y0:t.cy-t.r,x1:t.cx+t.r,y1:t.cy+t.r},segments:t.hole?10:5};case "ellipse":return {bounds:{x0:t.cx-t.rx,y0:t.cy-t.ry,x1:t.cx+t.rx,y1:t.cy+t.ry},segments:5};case "polygon":{let e=t.points.map(([o])=>o),n=t.points.map(([,o])=>o);return {bounds:{x0:Math.min(...e),y0:Math.min(...n),x1:Math.max(...e),y1:Math.max(...n)},segments:t.points.length}}case "path":{let e=or(t.d,ct.maxDecimals);return e?{bounds:Fe(se(t.d)),segments:qi(e)}:{bounds:null,segments:0}}case "line":{let e=t.width/2,n=Math.hypot(t.x2-t.x1,t.y2-t.y1),o=t.dash?Math.ceil(n/(t.dash[0]+t.dash[1])):1;return {bounds:{x0:Math.min(t.x1,t.x2)-e,y0:Math.min(t.y1,t.y2)-e,x1:Math.max(t.x1,t.x2)+e,y1:Math.max(t.y1,t.y2)+e},segments:o*(t.cap==="round"?4:5)}}default:return {bounds:{x0:t.x,y0:t.y,x1:t.x+t.size,y1:t.y+t.size},segments:Ki}}}function pm(t,e){let n=(b,_=[])=>e.addIssue({code:"custom",message:b,path:_}),o=ct,r=new TextEncoder().encode(JSON.stringify(t)).length;if(r>o.maxBytes){n(`The spec is ${r} bytes; the limit is ${o.maxBytes}`);return}let{width:a,height:i}=t.artboard,c=Math.max(a,i)*.005,s={x0:-c,y0:-c,x1:a+c,y1:i+c},l=b=>b.x0>=s.x0&&b.y0>=s.y0&&b.x1<=s.x1&&b.y1<=s.y1,{qr:u}=t,m=fn(t);m<u.size*o.minPadding-1e-9&&n(`qr.padding must be at least ${o.minPadding*100}% of qr.size`,["qr","padding"]),u.size<Math.min(a,i)*o.minQrShare-1e-9&&n(`qr.size must be at least ${o.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let f=rs(t);(f.x0<-1e-9||f.y0<-1e-9||f.x1>a+1e-9||f.y1>i+1e-9)&&n("The code and its padding must sit inside the artboard",["qr"]),(u.radius??0)>(u.size+2*m)/2&&n("qr.radius is larger than half the plate",["qr","radius"]);let d=0,p=0;t.shapes.forEach((b,_)=>{let y=["shapes",_],{bounds:C,segments:M}=hm(b);if(!C){n("Path data must use only M L H V C S Q T A Z, plain numbers (up to 3 decimals) and start with M",[...y,"d"]);return}if(l(C)||n("The shape extends outside the artboard",y),b.type==="rect"&&b.hole){let{hole:$}=b;($.x<b.x||$.y<b.y||$.x+$.width>b.x+b.width+1e-9||$.y+$.height>b.y+b.height+1e-9)&&n("The hole must sit inside its rect",[...y,"hole"]);}b.type==="circle"&&b.hole&&b.hole>=b.r&&n("The hole must be smaller than the circle",[...y,"hole"]),d+=M,typeof b.fill=="object"&&"gradient"in b.fill&&(p+=(b.fill.gradient.steps??32)*M);}),d>o.maxSegments&&n(`The shapes have ${d} segments; the limit is ${o.maxSegments}`,["shapes"]),p>o.maxGradientWork&&n("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let h=new Set,g=new Set;t.labels.forEach((b,_)=>{let y=["labels",_];h.has(b.id)&&n(`Label id "${b.id}" is used twice`,[...y,"id"]),h.add(b.id),b.slot!=="fixed"&&(g.has(b.slot)&&n(`Only one label may use the ${b.slot} slot`,[...y,"slot"]),g.add(b.slot));let C=b.maxLength??o.maxTextLength;b.text!==hr(b.text,C)&&n(`Label text must be at most ${C} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...y,"text"]);let M;if(b.type==="text")M={x0:b.box.x,y0:b.box.y,x1:b.box.x+b.box.width,y1:b.box.y+b.box.height},b.fontSize!==void 0&&b.fontSize>b.box.height*fr+1e-9&&n("fontSize may be at most 95% of the label's row height",[...y,"fontSize"]),fm(M,f)&&n("The label overlaps the code or its padding",[...y,"box"]);else {let{cx:$,cy:S,radius:R}=b.curve,w=b.fontSize*be*.6;M={x0:$-R-w,y0:S-R-w,x1:$+R+w,y1:S+R+w};let P=Math.hypot(Math.max(f.x0-$,0,$-f.x1),Math.max(f.y0-S,0,S-f.y1));Math.hypot(Math.max(Math.abs(f.x0-$),Math.abs(f.x1-$)),Math.max(Math.abs(f.y0-S),Math.abs(f.y1-S)))<=R-w||P>=R+w||n("The curved label crosses the code or its padding",[...y,"curve"]);}l(M)||n("The label extends outside the artboard",y);});}var Ne=dm.superRefine(pm);function gm(t){let e=Ne.safeParse(t);return e.success?[]:e.error.issues.map(n=>n.path.length>0?`${n.path.join(".")}: ${n.message}`:n.message)}var os=rr.extend({style:zod.z.literal(kn),spec:Ne}),Lo=zod.z.discriminatedUnion("style",[rr,os]);var as=["circle","circle-large","square","diamond","circle-mixed","pacman","rounded","small-square","vertical-line","horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"],Io=zod.z.enum(as);var is=["square","rounded","circle"],To=zod.z.enum(is),ss=zod.z.object({src:zod.z.string(),height:zod.z.number(),width:zod.z.number(),excavate:zod.z.boolean(),x:zod.z.number().optional(),y:zod.z.number().optional(),padding:zod.z.number().min(0).optional(),shape:To.optional(),plate:zod.z.string().optional()}),cs=.1,gr=.3,Fo=.25,ls=2,_m=zod.z.object({size:zod.z.number().min(cs).max(gr).optional(),padding:zod.z.number().min(0).max(ls).optional(),x:zod.z.number().min(0).max(1).optional(),y:zod.z.number().min(0).max(1).optional(),shape:To.optional(),plate:zod.z.string().optional()}),us=zod.z.enum(["L","M","Q","H"]),Nn=.5,br=1,ko=.07,ms=["square","circle","heart"],ds=zod.z.enum(ms),No=3,qt=64,te=8,Oo=.42,fs=zod.z.object({type:zod.z.literal("silhouette"),width:zod.z.number().int().min(te).max(qt),height:zod.z.number().int().min(te).max(qt),cells:zod.z.string().max(qt*qt).regex(/^[01]*$/).describe('Row by row, "1" inside the shape and "0" outside: width \xD7 height characters')}).refine(t=>t.cells.length===t.width*t.height,{message:"Silhouette cells do not match its width and height"}),hs=zod.z.union([ds,fs]),_r=["topLeft","topRight","bottomLeft"],pr=zod.z.object({outer:pe.optional(),inner:pe.optional()}),ps=zod.z.object({topLeft:pr.optional(),topRight:pr.optional(),bottomLeft:pr.optional()}),ym=zod.z.object({value:zod.z.string(),size:zod.z.number().optional(),level:us.optional(),bgColor:pe.optional(),fgColor:pe.optional(),eyeColor:pe.optional(),dotColor:pe.optional(),bodyPattern:Io.optional(),cornerEyePattern:$o.optional(),cornerEyeDotPattern:yo.optional(),margin:zod.z.number().optional(),imageSettings:ss.optional(),isOGContext:zod.z.boolean().optional(),templateId:zod.z.string().optional(),customProps:zod.z.record(zod.z.string(),zod.z.any()).optional(),frame:Lo.optional(),art:go.optional(),eyeColors:ps.optional(),moduleScale:zod.z.number().min(Nn).max(br).optional(),autoLevel:zod.z.boolean().optional(),shape:hs.optional()});var xm=zod.z.object({fgColor:zod.z.string().optional(),bgColor:zod.z.string().optional()}),$m=zod.z.object({pixelSize:zod.z.number(),url:zod.z.string()}),Sm=zod.z.object({id:zod.z.string(),name:zod.z.string(),description:zod.z.string().optional()});var At=t=>t/255,On=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,Z=t=>.2126*t[0]+.7152*t[1]+.0722*t[2];function Do(t){let{width:e,height:n,data:o}=t,r=[0,e-1,(n-1)*e,n*e-1].map(i=>{let c=i*4;return {color:[At(o[c]),At(o[c+1]),At(o[c+2])],alpha:o[c+3]/255}});if(r.some(i=>i.alpha<.9))return null;let a=r[0].color;return r.every(({color:i})=>On(i,a)<.006)?a:null}function Cm(t){let{width:e,height:n,data:o}=t,r=Do(t),a=new Float32Array(e*n);for(let i=0;i<a.length;i++){let c=i*4,s=o[c+3]/255;if(r&&s>0){let l=Math.sqrt(On([At(o[c]),At(o[c+1]),At(o[c+2])],r));s*=Math.min(1,Math.max(0,(l-.06)/.1));}a[i]=s;}return a}var Mm=8,wm=.14,gs=.006;function Rm(t,e){let{width:n,height:o,data:r}=t,a=new Float64Array(4096),i=new Float64Array(4096*3),c=0;for(let d=0;d<e.length;d++){if(e[d]<.9)continue;let p=d*4,h=Math.floor(r[p]/16)*256+Math.floor(r[p+1]/16)*16+Math.floor(r[p+2]/16);a[h]+=1,i[h*3]+=At(r[p]),i[h*3+1]+=At(r[p+1]),i[h*3+2]+=At(r[p+2]),c++;}if(c===0)return {palette:[],error:0};let s=[...a.keys()].filter(d=>a[d]>0).sort((d,p)=>a[p]-a[d]),l=[];for(let d of s){if(a[d]/c<gs/2||l.length>=Mm)break;let p=[i[d*3]/a[d],i[d*3+1]/a[d],i[d*3+2]/a[d]];l.every(h=>On(h,p)>=wm**2)&&l.push(p);}let u=[],m=0;for(let d=0;d<3;d++){u=l.map(()=>({n:0,r:0,g:0,b:0,x:0,y:0})),m=0;for(let p=0;p<e.length;p++){if(e[p]<.9)continue;let h=p*4,g=[At(r[h]),At(r[h+1]),At(r[h+2])],b=0,_=Number.POSITIVE_INFINITY;for(let[C,M]of l.entries()){let $=On(g,M);$<_&&(_=$,b=C);}let y=u[b];y.n++,y.r+=g[0],y.g+=g[1],y.b+=g[2],y.x+=p%n,y.y+=Math.floor(p/n),m+=Math.sqrt(_);}for(let[p,h]of u.entries())h.n>0&&(l[p]=[h.r/h.n,h.g/h.n,h.b/h.n]);}return {palette:l.map((d,p)=>({color:d,area:u[p].n/c,cx:u[p].n?u[p].x/u[p].n+.5:n/2,cy:u[p].n?u[p].y/u[p].n+.5:o/2})).filter(d=>d.area>=gs).sort((d,p)=>p.area-d.area),error:m/c}}function Em(t,e,n){let o=e+2,r=n+2,a=(m,f)=>m<=0||f<=0||m>e||f>n?0:t[(f-1)*e+(m-1)],i=new Map,c=new Map,s=m=>{let f=c.get(m);if(f)return f;let d=Math.floor(m/2),p=d%o,h=Math.floor(d/o),g=a(p,h),b=m%2===1,_=b?a(p,h+1):a(p+1,h),y=g===_?.5:Math.min(1,Math.max(0,(.5-g)/(_-g))),C=b?[p-.5,h-.5+y]:[p-.5+y,h-.5];return c.set(m,C),C},l=(m,f)=>{i.set(m,f);};for(let m=0;m<r-1;m++)for(let f=0;f<o-1;f++){let d=a(f,m)>=.5,p=a(f+1,m)>=.5,h=a(f+1,m+1)>=.5,g=a(f,m+1)>=.5,b=2*(m*o+f),_=2*((m+1)*o+f),y=2*(m*o+f)+1,C=2*(m*o+f+1)+1;switch((d?8:0)+(p?4:0)+(h?2:0)+(g?1:0)){case 1:l(_,y);break;case 2:l(C,_);break;case 3:l(C,y);break;case 4:l(b,C);break;case 5:{(a(f,m)+a(f+1,m)+a(f+1,m+1)+a(f,m+1))/4>=.5?(l(b,y),l(_,C)):(l(b,C),l(_,y));break}case 6:l(b,_);break;case 7:l(b,y);break;case 8:l(y,b);break;case 9:l(_,b);break;case 10:{(a(f,m)+a(f+1,m)+a(f+1,m+1)+a(f,m+1))/4>=.5?(l(y,_),l(C,b)):(l(y,b),l(C,_));break}case 11:l(C,b);break;case 12:l(y,C);break;case 13:l(_,C);break;case 14:l(y,_);break;}}let u=[];for(let m of i.keys()){if(!i.has(m))continue;let f=[],d=m;for(;d!==void 0&&i.has(d);){f.push(s(d));let p=i.get(d);i.delete(d),d=p;}f.length>=3&&u.push(f);}return u}function Am(t){let e=0;for(let n=0;n<t.length;n++){let o=t[n],r=t[(n+1)%t.length];e+=o[0]*r[1]-r[0]*o[1];}return e/2}function bs(t,e){if(t.length<=2)return t;let n=new Uint8Array(t.length);n[0]=1,n[t.length-1]=1;let o=[[0,t.length-1]];for(;o.length>0;){let[r,a]=o.pop(),i=t[r],c=t[a],s=c[0]-i[0],l=c[1]-i[1],u=Math.hypot(s,l)||1,m=-1,f=e;for(let d=r+1;d<a;d++){let p=t[d],h=Math.abs(l*(p[0]-i[0])-s*(p[1]-i[1]))/u;h>f&&(f=h,m=d);}m>=0&&(n[m]=1,o.push([r,m],[m,a]));}return t.filter((r,a)=>n[a]===1)}function Pm(t,e){let n=0,o=-1;for(let[i,c]of t.entries()){let s=(c[0]-t[0][0])**2+(c[1]-t[0][1])**2;s>o&&(o=s,n=i);}let r=bs(t.slice(0,n+1),e),a=bs([...t.slice(n),t[0]],e);return [...r.slice(0,-1),...a.slice(0,-1)]}var xe=t=>it(t,2);function vm(t,e){let n=t.length,o=(a,i)=>{let c=Math.hypot(i[0]-a[0],i[1]-a[1])||1,s=Math.min(.5,e/c);return [a[0]+(i[0]-a[0])*s,a[1]+(i[1]-a[1])*s]},r="";for(let a=0;a<n;a++){let i=t[a],c=o(i,t[(a-1+n)%n]),s=o(i,t[(a+1)%n]);r+=a===0?`M${xe(c[0])} ${xe(c[1])}`:`L${xe(c[0])} ${xe(c[1])}`,r+=`Q${xe(i[0])} ${xe(i[1])} ${xe(s[0])} ${xe(s[1])}`;}return `${r}Z`}function Lm(t,e,n){let o="";for(let r of Em(t,e,n)){if(Math.abs(Am(r))<.8)continue;let a=Pm(r,.18);a.length>=3&&(o+=vm(a,.9));}return o}var Im=.075;function _s(t){let{width:e,height:n,data:o}=t,r=Cm(t),a=0;for(let h of r)a+=h;let{palette:i,error:c}=Rm(t,r),s={width:e,height:n,palette:i,alpha:r,coverage:a/(e*n)};if(i.length===0||c>Im)return {...s,layers:[],photographic:i.length>0};let l=i.length,u=Array.from({length:l},()=>new Float32Array(e*n)),m=i.map(h=>h.color);for(let h=0;h<r.length;h++){let g=r[h];if(g<=0)continue;let b=h*4,_=[At(o[b]),At(o[b+1]),At(o[b+2])],y=0,C=-1,M=Number.POSITIVE_INFINITY,$=Number.POSITIVE_INFINITY;for(let v=0;v<l;v++){let L=On(_,m[v]);L<M?(C=y,$=M,y=v,M=L):L<$&&(C=v,$=L);}if(C<0||M<1e-6){u[y][h]=g;continue}let S=m[y],R=m[C],w=[R[0]-S[0],R[1]-S[1],R[2]-S[2]],P=Math.min(1,Math.max(0,((_[0]-S[0])*w[0]+(_[1]-S[1])*w[1]+(_[2]-S[2])*w[2])/(w[0]**2+w[1]**2+w[2]**2)));u[y][h]=g*(1-P),u[C][h]=g*P;}let f=[],d=new Float32Array(e*n),p=new Array(l);for(let h=l-1;h>=0;h--){let g=u[h];for(let b=0;b<d.length;b++)d[b]+=g[b];p[h]=d.slice();}for(let h=0;h<l;h++){let g=Lm(p[h],e,n);g&&f.push({color:m[h],d:g});}return {...s,layers:f,photographic:false}}var{QrCode:Qo}=xt,Tm={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function Fm(t){let e=t*4+17,n=new Uint8Array(e*e),o=(i,c)=>{i>=0&&c>=0&&i<e&&c<e&&(n[c*e+i]=1);};for(let i=0;i<e;i++)o(6,i),o(i,6);for(let[i,c]of [[3,3],[e-4,3],[3,e-4]])for(let s=-4;s<=4;s++)for(let l=-4;l<=4;l++)o(i+l,c+s);let r=[];if(t>1){let i=Math.floor(t/7)+2,c=t===32?26:Math.ceil((t*4+4)/(i*2-2))*2;r.push(6);for(let s=e-7;r.length<i;s-=c)r.splice(1,0,s);}let a=r.length-1;for(let[i,c]of r.entries())for(let[s,l]of r.entries())if(!(i===0&&s===0||i===0&&s===a||i===a&&s===0))for(let u=-2;u<=2;u++)for(let m=-2;m<=2;m++)o(c+m,l+u);for(let i=0;i<=8;i++)o(8,i),o(i,8);for(let i=0;i<8;i++)o(e-1-i,8),o(8,e-1-i);if(t>=7)for(let i=0;i<18;i++){let c=e-11+i%3,s=Math.floor(i/3);o(c,s),o(s,c);}return n}function km(t,e){let n=t*4+17,o=Et[e].ordinal,r=Qo.NUM_ERROR_CORRECTION_BLOCKS[o]?.[t]??0,a=Qo.ECC_CODEWORDS_PER_BLOCK[o]?.[t]??0,i=Math.floor(Qo.getNumRawDataModules(t)/8),c=r-i%r,s=Math.floor(i/r),l=Array.from({length:r},(C,M)=>s+(M<c?0:1)),u=[],m=[],f=s-a;for(let C=0;C<=s;C++)for(let M=0;M<r;M++)if(M<c){if(C===f)continue;u.push(M),m.push(C<f?C:C-1);}else u.push(M),m.push(C);if(u.length!==i)throw new Error(`Codeword map: interleave mismatch at version ${t}`);let d=Fm(t),p=new Int16Array(n*n).fill(-1),h=new Int16Array(n*n).fill(-1),g=new Int8Array(n*n).fill(-1),b=i*8,_=0;for(let C=n-1;C>=1;C-=2){C===6&&(C=5);let M=(C+1&2)===0;for(let $=0;$<n;$++)for(let S=0;S<2;S++){let R=C-S,P=(M?n-1-$:$)*n+R;if(!d[P]&&_<b){let v=_>>>3;p[P]=u[v],h[P]=m[v],g[P]=7-(_&7),_++;}}}if(_!==b)throw new Error(`Codeword map: placement mismatch at version ${t}`);let y=Tm[`${t}${e}`]??0;return {version:t,level:e,size:n,blocks:r,eccPerBlock:a,blockLengths:l,correctable:Math.floor((a-y)/2),block:p,codeword:h,bit:g}}var Nm=8,Oe=new Map;function Dn(t,e){if(!(Number.isInteger(t)&&t>=1&&t<=40))throw new RangeError(`QR version must be 1\u201340, got ${t}`);let n=`${t}${e}`,o=Oe.get(n);if(o)return Oe.delete(n),Oe.set(n,o),o;let r=km(t,e);if(Oe.size>=Nm){let a=Oe.keys().next().value;a!==void 0&&Oe.delete(a);}return Oe.set(n,r),r}function Qn(t,e){let n=new Array(t.blocks).fill(0),o=new Set;for(let r of e){let a=t.block[r]??-1;if(a<0)continue;let i=a*4096+t.codeword[r];o.has(i)||(o.add(i),n[a]=n[a]+1);}return n}var Om={black:[0,0,0],white:[255,255,255],red:[255,0,0],green:[0,128,0],lime:[0,255,0],blue:[0,0,255],navy:[0,0,128],yellow:[255,255,0],orange:[255,165,0],purple:[128,0,128],pink:[255,192,203],gray:[128,128,128],grey:[128,128,128],silver:[192,192,192],maroon:[128,0,0],olive:[128,128,0],teal:[0,128,128],aqua:[0,255,255],cyan:[0,255,255],fuchsia:[255,0,255],magenta:[255,0,255]};function ys(t,e){let n=t.trim(),o=Number.parseFloat(n);return Number.isNaN(o)?Number.NaN:n.endsWith("%")?o/100*e:o}function dt(t){if(!t)return null;let e=t.trim().toLowerCase();if(e==="transparent")return {r:0,g:0,b:0,a:0};let n=Om[e];if(n)return {r:n[0],g:n[1],b:n[2],a:1};if(e.startsWith("#")){let r=e.slice(1);return (r.length===3||r.length===4)&&(r=r.split("").map(a=>a+a).join("")),/^[0-9a-f]{6}([0-9a-f]{2})?$/.test(r)?{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16),a:r.length===8?Number.parseInt(r.slice(6,8),16)/255:1}:null}let o=/^rgba?\(([^)]*)\)$/.exec(e);if(o){let[r,a]=o[1].split("/"),i=r.split(/[\s,]+/).filter(Boolean);if(i.length!==(a===void 0&&i.length===4?4:3))return null;let c=a??i[3],[s,l,u]=i.slice(0,3).map(d=>ys(d,255)),m=c===void 0?1:ys(c,1);if([s,l,u,m].some(d=>Number.isNaN(d)))return null;let f=(d,p)=>Math.min(Math.max(d,0),p);return {r:f(s,255),g:f(l,255),b:f(u,255),a:f(m,1)}}return null}function $e(t,e,n){let o=t/255,r=e/255,a=n/255,i=1-Math.max(o,r,a);return i>=1?[0,0,0,1]:[it((1-o-i)/(1-i)),it((1-r-i)/(1-i)),it((1-a-i)/(1-i)),it(i)]}function ne(t){return t.children}var Dm=t=>t==null?null:`${t}`;function Bo(t,e,n){let o=e??{},r=n;if("key"in o){let{key:a,...i}=o;a!==void 0&&(r=a),o=i;}return {type:t,props:o,key:Dm(r)}}function Qm(t,e){let n=t;return {type:n.type,props:{...n.props,...e},key:n.key??null}}function Bm(t,e,...n){let o={...e};return n.length>0&&(o.children=n.length===1?n[0]:n),Bo(t,o)}var Gm={jsx:Bo,jsxs:Bo,createElement:Bm,cloneElement:Qm,Fragment:ne},Bn=Gm;var Go=t=>t===ne?Bn.Fragment:t;function E(t,e,n){return Bn.jsx(Go(t),e,n)}function ut(t,e,n){return Bn.jsxs(Go(t),e,n)}function Um(t,e,...n){return Bn.createElement(Go(t),e??null,...n)}function hn(t,e){return Bn.cloneElement(t,e)}var qm=new Set([Symbol.for("react.element"),Symbol.for("react.transitional.element")]),xs=Symbol.for("react.fragment");function De(t){if(typeof t!="object"||t===null||Array.isArray(t))return false;let e=t;return e.$$typeof!==void 0&&!qm.has(e.$$typeof)?false:(typeof e.type=="string"||typeof e.type=="function"||e.type===xs)&&typeof e.props=="object"&&e.props!==null}var pn=t=>t===ne||t===xs;var Rs=.6,zo={logo:160,halftone:160};function zm(t){let e="";for(let o=0;o<t.length;o+=32768)e+=String.fromCharCode(...t.subarray(o,o+32768));return btoa(e)}var gn=class{entries=new Map;limit;constructor(e){this.limit=e;}get(e,n){let o=this.entries.get(e);if(o!==void 0)return this.entries.delete(e),this.entries.set(e,o),o;let r=n();if(this.entries.size>=this.limit){let a=this.entries.keys().next().value;a!==void 0&&this.entries.delete(a);}return this.entries.set(e,r),r}},Wm=new gn(8);function Hm(t){return Wm.get(t,()=>{let e=atob(t),n=new Uint8Array(e.length);for(let o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return n})}function Wo(t){let{width:e,height:n,data:o}=t;if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>ie||n>ie||typeof o!="string")return null;try{let r=Hm(o);return r.length===e*n*4?{width:e,height:n,data:r}:null}catch{return null}}function Es(t,e={}){let{width:n,height:o,data:r}=t;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Art image pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=Math.min(n,o),i=e.square?Math.floor((n-a)/2):0,c=e.square?Math.floor((o-a)/2):0,s=e.square?a:n,l=e.square?a:o,u=Math.min(Math.max(Math.round(e.maxSize??zo.halftone),1),ie),m=Math.min(1,u/Math.max(s,l)),f=Math.max(1,Math.round(s*m)),d=Math.max(1,Math.round(l*m)),p=new Uint8Array(f*d*4);for(let h=0;h<d;h++){let g=Math.floor(h*l/d),b=Math.max(g+1,Math.floor((h+1)*l/d));for(let _=0;_<f;_++){let y=Math.floor(_*s/f),C=Math.max(y+1,Math.floor((_+1)*s/f)),M=0,$=0,S=0,R=0,w=0;for(let v=g;v<b;v++)for(let L=y;L<C;L++){let I=((v+c)*n+L+i)*4,F=r[I+3]/255;M+=r[I]*F,$+=r[I+1]*F,S+=r[I+2]*F,R+=F,w++;}let P=(h*f+_)*4;p[P]=R>0?Math.round(M/R):0,p[P+1]=R>0?Math.round($/R):0,p[P+2]=R>0?Math.round(S/R):0,p[P+3]=Math.round(R/w*255);}}return {width:f,height:d,data:zm(p)}}async function Vm(t){if(typeof t!="string"&&!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=typeof t=="string"?t:URL.createObjectURL(t);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the art image")),r.src=e;})}finally{typeof t!="string"&&setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function jm(t,e={}){if(typeof document>"u")throw new Error("loadQRArtImage needs a browser; pass decoded pixels to createQRArtImage instead");let n=e.mode??"halftone",o=e.maxSize??zo[n],r=await Vm(t),a=r.naturalWidth||r.width||o,i=r.naturalHeight||r.height||o,c=n==="halftone",s=Math.min(1,o*4/(c?Math.min(a,i):Math.max(a,i))),l=Math.max(1,Math.round(a*s)),u=Math.max(1,Math.round(i*s)),m=document.createElement("canvas");m.width=l,m.height=u;let f=m.getContext("2d",{willReadFrequently:true});if(!f)throw new Error("Could not get a canvas context");f.imageSmoothingQuality="high",f.drawImage(r,0,0,l,u);let d;try{d=f.getImageData(0,0,l,u);}catch{throw new Error("Could not read the art image (cross-origin images need CORS); upload it instead")}finally{m.remove();}return Es(d,{maxSize:o,square:c})}function Ho(t){return !!(t&&Tn.includes(t.mode)&&t.image&&Wo(t.image))}function $r(t){let e=In[t.mode];return t.variant&&e.includes(t.variant)?t.variant:e[0]}function Ym(t,e){if(t===1)return [];let n=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(n*2-2))*2,r=[6];for(let a=e-7;r.length<n;a-=o)r.splice(1,0,a);return r}function Gn(t,e){let n=Ym(t,e),o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[c,s]of n.entries())a===0&&c===0||a===0&&c===o||a===o&&c===0||r.push([i,s]);return r}var Xm=0,Ut=1,zt=2,Se=3,$s=4,Ss=new Map;function As(t){let e=Ss.get(t);if(e)return e;let n=t*4+17,o=new Uint8Array(n*n),r=(a,i,c,s,l)=>{for(let u=Math.max(0,i);u<Math.min(n,i+s);u++)for(let m=Math.max(0,a);m<Math.min(n,a+c);m++)o[u*n+m]=l;};r(6,0,1,n,$s),r(0,6,n,1,$s),r(0,8,9,1,Se),r(8,0,1,9,Se),r(n-8,8,8,1,Se),r(8,n-8,1,8,Se),t>=7&&(r(n-11,0,3,6,Se),r(0,n-11,6,3,Se));for(let[a,i]of Gn(t,n))r(a-2,i-2,5,5,zt);return r(0,0,8,8,Ut),r(n-8,0,8,8,Ut),r(0,n-8,8,8,Ut),Ss.set(t,o),o}function Zm(t){let e=t*4+17,n=As(t);return Array.from({length:e},(o,r)=>Array.from({length:e},(a,i)=>n[r*e+i]!==Xm))}function Km(t){let e=t[8],n=e?.[0]?1:0,o=e?.[1]?1:0,r=(1-n)*2+o;return ["M","L","H","Q"][r]??"M"}function bn(t,e){let n=dt(t);return !n||n.a===0?e:[n.r/255,n.g/255,n.b/255]}var Be=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n];function Ce(t,e,n,o){let r=Z(t);if(o?r<=n:r>=n)return t;let a=Z(e);return Math.abs(r-a)<1e-6?e:Be(t,e,Math.min(1,Math.max(0,(r-n)/(r-a))))}var Ps=t=>Math.max(...t)-Math.min(...t),Jm=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,Uo=t=>t.toString(16).padStart(2,"0");function Pt(t,e=1){let n=o=>Math.min(255,Math.round(Math.round(Math.min(Math.max(o,0),1)*255)/e)*e);return `#${Uo(n(t[0]))}${Uo(n(t[1]))}${Uo(n(t[2]))}`}function t0(t){let e=t<0?-1:1,n=Math.abs(t),o=1/(1+.3275911*n),r=1-((((1.061405429*o-1.453152027)*o+1.421413741)*o-.284496736)*o+.254829592)*o*Math.exp(-n*n);return e*r}var Vo=.3,Cs=t=>1-Math.exp(-((t/2)**2)/(2*Vo**2)),e0=t=>t0(t/(2*Vo*Math.SQRT2))**2,n0=(t,e,n)=>{let o=Math.min(1,Math.max(0,(n-t)/(e-t)));return o*o*(3-2*o)};function jo(t,e,n,o){let r=o==="cover"?Math.max(n/t,n/e):Math.min(n/t,n/e);return {scale:r,offsetX:(n-t*r)/2,offsetY:(n-e*r)/2}}function vs(t,e){let{width:n,height:o,data:r}=t,a=new Float32Array(n*o*3),i=e??new Float32Array(n*o);for(let c=0;c<n*o;c++)a[c*3]=r[c*4]/255,a[c*3+1]=r[c*4+1]/255,a[c*3+2]=r[c*4+2]/255,e||(i[c]=r[c*4+3]/255);return {width:n,height:o,rgb:a,alpha:i}}function r0(t){let e=vs(t),{rgb:n,alpha:o}=e,r=new Float64Array(256),a=0;for(let m=0;m<o.length;m++){if(o[m]<.5)continue;let f=Z([n[m*3],n[m*3+1],n[m*3+2]]);r[Math.min(255,Math.floor(f*256))]+=1,a++;}let i=m=>{let f=0;for(let d=0;d<256;d++)if(f+=r[d],f>=m*a)return d/255;return 1},c=a?i(.01):0,s=a?i(.99):1;s-c<.15&&(c=0,s=1);let l=Math.min(1.6,1/(s-c)),u=(c+s)/2;for(let m=0;m<o.length;m++){let f=[n[m*3],n[m*3+1],n[m*3+2]],d=Z(f),p=.5+(d-u)*l;for(let h=0;h<3;h++)n[m*3+h]=Math.min(1,Math.max(0,p+(f[h]-d)*1.12));}return e}function Ls(t,e,n,o,r=1){let{width:a,height:i,rgb:c,alpha:s}=t,l=Math.min(Math.max(e-.5,0),a-1),u=Math.min(Math.max(n-.5,0),i-1),m=Math.floor(l),f=Math.floor(u),d=Math.min(m+1,a-1),p=Math.min(f+1,i-1),h=l-m,g=u-f,b=0,_=0,y=0,C=0,M=(S,R,w)=>{let P=R*a+S,v=s[P]*w;b+=c[P*3]*v,_+=c[P*3+1]*v,y+=c[P*3+2]*v,C+=v;};if(M(m,f,(1-h)*(1-g)),M(d,f,h*(1-g)),M(m,p,(1-h)*g),M(d,p,h*g),C<=0)return o;let $=C*r;return [o[0]+(b/C-o[0])*$,o[1]+(_/C-o[1])*$,o[2]+(y/C-o[2])*$]}var o0=new gn(4),a0=new gn(6),i0=new gn(6);function Yo(t,e){return a0.get(t.image.data,()=>_s(e))}function Is(t,e,n){return i0.get(t.image.data,()=>vs(e,n.alpha))}var St=t=>it(t,2),Ts=t=>it(t,4),Ge=class{groups=new Map;add(e,n){let o=this.groups.get(e);o?o.push(n):this.groups.set(e,[n]);}cellRun(e,n,o,r){this.add(e,`M${n} ${o}h${r}.04v1.04h-${r}.04z`);}circle(e,n,o,r){this.add(e,s0(n,o,r));}toElements(e){return [...this.groups].map(([n,o],r)=>E("path",{d:o.join(""),fill:n},`${e}-${r}`))}};function s0(t,e,n){let o=St(n*2),r=St(n);return `M${St(t-n)} ${St(e)}a${r} ${r} 0 1 0 ${o} 0a${r} ${r} 0 1 0 ${-o} 0z`}function Qe(t,e,n,o,r){let a=Math.min(r,n/2,o/2);if(a<=0)return `M${St(t)} ${St(e)}h${St(n)}v${St(o)}h${St(-n)}z`;let i=St(a);return `M${St(t+a)} ${St(e)}h${St(n-2*a)}a${i} ${i} 0 0 1 ${i} ${i}v${St(o-2*a)}a${i} ${i} 0 0 1 ${-i} ${i}h${St(-(n-2*a))}a${i} ${i} 0 0 1 ${-i} ${-i}v${St(-(o-2*a))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function Fs(t,e,n){let o="";for(let[r,a]of t){let i=(r-2+e)*n,c=(a-2+e)*n;o+=Qe(i,c,5*n,5*n,n*.35),o+=Qe(i+n,c+n,3*n,3*n,n*.15),o+=Qe(i+2*n,c+2*n,n,n,n*.12);}return o}var c0={blend:1,badge:1,color:.9,mono:.7},xr=.35;function l0(t,e){let n=bn(t,[0,0,0]),o=bn(e,[1,1,1]),r=Z(o)-Z(n);return r>=xr?null:r<=-xr?"inverted":"low-contrast"}function ks(t,e,n){let o=Math.min(Math.max(t.intensity??Rs,0),c0[$r(t)]);return Z(n)-Z(e)>=xr?o:0}function u0(t){let{art:e,modules:n,version:o}=t,r=e.image&&Wo(e.image);if(!(r&&Tn.includes(e.mode)))return null;let a=n.length;if(a!==o*4+17)return null;let i=bn(t.fgColor,[0,0,0]),c=bn(t.bgColor,[1,1,1]),s=ks(e,i,c);return s<=0?null:{art:e,image:r,modules:n,size:a,version:o,kinds:As(o),margin:t.margin,pixelSize:t.pixelSize,t:s,fg:i,bg:c,variant:$r(e),body:t.body}}function Xo(t){let e=u0(t);if(!e)return null;let n;return e.art.mode==="halftone"?n=e.variant==="mono"?g0(e):p0(e):n=e.variant==="badge"?w0(e):b0(e),E("g",{"data-qrdx-art":e.art.mode,"data-qrdx-art-variant":e.variant,children:n})}function m0(t,e){return {margin:.42-.17*t+(e===3?.04:0),darkCap:.4+.3*t}}var Ns=8.5,Ms=new Map;function Zo(t){let e=t*4+17,n=Ms.get(t);if(!n){let a=e*2,i=new Uint8Array(a*a),c=Ns*2;for(let s=0;s<a;s++)for(let l=0;l<a;l++){let u=l<c||l>=a-c,m=s<c||s>=a-c;u&&m&&!(l>=a-c&&s>=a-c)&&(i[s*a+l]=1);}for(let[s,l]of Gn(t,e))for(let u=(l-2)*2-1;u<(l+3)*2+1;u++)for(let m=(s-2)*2-1;m<(s+3)*2+1;m++)m>=0&&u>=0&&m<a&&u<a&&(i[u*a+m]=1);Ms.set(t,i),n=i;}let o=n,r=e*2;return (a,i)=>{let c=Math.floor(a*2),s=Math.floor(i*2);return c>=0&&s>=0&&c<r&&s<r&&o[s*r+c]===1}}function Os(t,e,n=false){let{image:o,size:r,kinds:a,fg:i,bg:c}=t,s=o0.get(t.art.image.data,()=>r0(o)),l=jo(o.width,o.height,r,"cover"),u=r*e,m=new Float32Array(u*u*3).fill(Number.NaN),d=1/(e*l.scale)>1.3?2:1,p=Z(c)-.1*(Z(c)-Z(i)),h=Zo(t.version);for(let g=0;g<r;g++)for(let b=0;b<r;b++){let _=a[g*r+b],y=_===Ut||_===zt;if(!(y&&!n))for(let C=0;C<e;C++)for(let M=0;M<e;M++){let $=0,S=0,R=0;for(let O=0;O<d;O++)for(let T=0;T<d;T++){let B=b+(M+(T+.5)/d)/e,H=g+(C+(O+.5)/d)/e,Q=Ls(s,(B-l.offsetX)/l.scale,(H-l.offsetY)/l.scale,c);$+=Q[0],S+=Q[1],R+=Q[2];}let w=d*d,P=[$/w,S/w,R/w],v=b+(M+.5)/e,L=g+(C+.5)/e,I=Math.min(v,L,r-v,r-L);I<1.5&&(P=Be(P,c,.35*(1-I/1.5))),n&&(y||h(v,L))&&(P=Ce(P,c,p,false));let F=((g*e+C)*u+b*e+M)*3;m[F]=P[0],m[F+1]=P[1],m[F+2]=P[2];}}return {n:e,count:u,rgb:m}}function d0(t,e,n){let{size:o,kinds:r,modules:a,fg:i,bg:c,t:s}=t,{n:l,count:u,rgb:m}=e,f=Z(i),d=Z(c),p=d-f,h=m0(s,l),g=R=>.2126*m[R]+.7152*m[R+1]+.0722*m[R+2],b=new Float32Array(o*o),_=new Float32Array(o*o);for(let R=0;R<o;R++)for(let w=0;w<o;w++){let P=r[R*o+w];if(P===Ut){b[R*o+w]=d;continue}if(P===zt){b[R*o+w]=a[R]?.[w]?f:d;continue}let v=0,L=0,I=0;for(let F=0;F<l;F++)for(let O=0;O<l;O++){let T=g(((R*l+F)*u+w*l+O)*3);v+=T,n.under[F*l+O]||(L+=T,I++);}b[R*o+w]=v/(l*l),_[R*o+w]=I?L/I:v/(l*l);}let y=o+1,C=new Float64Array(y*y);for(let R=0;R<o;R++)for(let w=0;w<o;w++)C[(R+1)*y+w+1]=b[R*o+w]+C[R*y+w+1]+C[(R+1)*y+w]-C[R*y+w];let M=2,$=(R,w)=>{let P=Math.max(0,R-M),v=Math.max(0,w-M),L=Math.min(o,R+M+1),I=Math.min(o,w+M+1);return (C[I*y+L]-C[v*y+L]-C[I*y+P]+C[v*y+P])/((L-P)*(I-v))},S=n.weight;for(let R=0;R<o;R++)for(let w=0;w<o;w++){let P=r[R*o+w];if(P===Ut||P===zt)continue;let v=P===Se,L=(h.margin+(v?.08:0))*p,I=(h.darkCap-(v?.12:0))*p,F=(S*((n.light-n.dark)/2)-L)/(1-S),O=$(w,R),T=_[R*o+w],B=!!a[R]?.[w],H=0,Q=c;if(B){let U=Math.min(O+F,f+I);T>U&&(H=(T-U)/Math.max(T-f,1e-6),Q=i);}else {let U=Math.max(O-F,d-I);T<U&&(H=(U-T)/Math.max(d-T,1e-6));}if(!(H<=0)){H=Math.min(1,H);for(let U=0;U<l;U++)for(let tt=0;tt<l;tt++){let yt=((R*l+U)*u+w*l+tt)*3;for(let st=0;st<3;st++)m[yt+st]+=(Q[st]-m[yt+st])*H;}}}}function Ds(t,e,n,o){let{count:r}=e,a=new Ge;for(let s=0;s<r;s++){let l=0,u=n(s*r);for(let m=1;m<=r;m++){let f=m<r?n(s*r+m):null;(m===r||f!==u)&&(u&&a.cellRun(u,l,s,m-l),l=m,u=f);}}let i=t.pixelSize/e.n,c=St(t.margin*t.pixelSize);return E("g",{transform:`translate(${c} ${c}) scale(${Ts(i)})`,children:a.toElements(o)},o)}function Ko(t,e){let n=Gn(t.version,t.size);return n.length===0?[]:[E("path",{d:Fs(n,t.margin,t.pixelSize),fill:e,fillRule:"evenodd"},"art-alignment")]}function Qs(t){let{image:e,size:n}=t;return Math.floor(Math.min(e.width,e.height)/n)>=4&&n<=45?4:3}var f0=t=>2*Vo*Math.sqrt(-2*Math.log(1-Math.min(t,.95)));function h0(t,e,n){let o=e+1,r=new Float64Array(o*o);for(let i=0;i<e;i++)for(let c=0;c<e;c++)r[(i+1)*o+c+1]=t[i*e+c]+r[i*o+c+1]+r[(i+1)*o+c]-r[i*o+c];let a=new Float32Array(e*e);for(let i=0;i<e;i++)for(let c=0;c<e;c++){let s=Math.max(0,c-n),l=Math.max(0,i-n),u=Math.min(e,c+n+1),m=Math.min(e,i+n+1);a[i*e+c]=(r[m*o+u]-r[l*o+u]-r[m*o+s]+r[l*o+s])/((u-s)*(m-l));}return a}function Bs(t,e,n,o){let{size:r,kinds:a,modules:i,fg:c,bg:s}=t,l=Z(c),u=Z(s),m=u-l,f=h0(e,r,2),d=new Float32Array(r*r),p=new Float32Array(r*r).fill(Number.NaN);for(let h=0;h<r;h++)for(let g=0;g<r;g++){let b=h*r+g,_=a[b];if(_===Ut||_===zt)continue;let y=_===Se,C=o.base+(y?.08:0),M=(o.margin+(y?.03:0))*m,$=(o.cap-(y?.04:0))*m,S=Cs(C),R=Cs(y?Math.max(o.max,.94):o.max),w=S*((o.dark+o.light)/2)+(1-S)*f[b],P=n[b],v=!!i[h]?.[g],L=v?o.dark:o.light,I=v?Math.min(w-M,l+$):Math.max(w+M,u-$),O=(v?P<=I:P>=I)?0:(P-I)/(P-L);O>R&&(O=R,p[b]=Math.min(u,Math.max(l,(I-R*L)/(1-R))));let T=v?P<=I-.06:P>=I+.06;o.skip&&T&&!y||(O=Math.max(O,S)),d[b]=O>0?f0(O):0;}return {diameter:d,surround:p}}function p0(t){let{size:e,kinds:n,modules:o,fg:r,bg:a,t:i,margin:c,pixelSize:s}=t,l=Qs(t),u=Os(t,l,true),m=Z(r),f=Z(a),d=m+.1*(f-m),p=f-.05*(f-m),{count:h,rgb:g}=u,b=($,S,R,w)=>((S*l+w)*h+$*l+R)*3,_=new Float32Array(e*e);for(let $=0;$<e;$++)for(let S=0;S<e;S++){let R=n[$*e+S];if(R===Ut||R===zt){_[$*e+S]=R===zt&&o[$]?.[S]?m:f;continue}let w=0;for(let P=0;P<l;P++)for(let v=0;v<l;v++){let L=b(S,$,v,P);w+=.2126*g[L]+.7152*g[L+1]+.0722*g[L+2];}_[$*e+S]=w/(l*l);}let y=Bs(t,_,_,{base:.6-.28*i,max:.86,dark:d,light:p,margin:.2-.1*i,cap:.4+.14*i,skip:false});for(let $=0;$<e;$++)for(let S=0;S<e;S++){let R=y.surround[$*e+S];if(Number.isNaN(R))continue;let w=_[$*e+S],v=R<w?r:a,L=Math.min(1,Math.abs(w-R)/Math.max(Math.abs(w-Z(v)),1e-6));for(let I=0;I<l;I++)for(let F=0;F<l;F++){let O=b(S,$,F,I);for(let T=0;T<3;T++)g[O+T]+=(v[T]-g[O+T])*L;}}let C=[Ds(t,u,$=>{let S=$*3;return Number.isNaN(g[S])?null:Pt([g[S],g[S+1],g[S+2]],8)},"art-photo")],M=new Ge;for(let $=0;$<e;$++)for(let S=0;S<e;S++){let R=y.diameter[$*e+S];if(!(R>0))continue;let w=0,P=0,v=0;for(let F=0;F<l;F++)for(let O=0;O<l;O++){let T=b(S,$,O,F);w+=g[T],P+=g[T+1],v+=g[T+2];}let L=[w/(l*l),P/(l*l),v/(l*l)],I=o[$]?.[S]?Ce(L,r,d,true):Ce(L,a,p,false);M.circle(Pt(I,10),(S+c+.5)*s,($+c+.5)*s,R/2*s);}return C.push(...M.toElements("art-dot"),...Ko(t,Pt(r))),C}function g0(t){let{size:e,kinds:n,modules:o,fg:r,bg:a}=t,i=Qs(t),c=Os(t,i),s=Z(r),l=Z(a),u=i%2===1?1:2,m=(i-u)/2,f=w=>w>=m&&w<m+u,d=[];for(let w=0;w<i;w++)for(let P=0;P<i;P++)d.push(f(P)&&f(w));d0(t,c,{weight:e0(u/i),dark:s,light:l,under:d});let{count:p,rgb:h}=c,g=new Float32Array(p*p),b=new Int8Array(p*p).fill(-1);for(let w=0;w<p*p;w++){let P=w*3;if(Number.isNaN(h[P])){g[w]=Number.NaN;continue}let v=(.2126*h[P]+.7152*h[P+1]+.0722*h[P+2]-s)/(l-s);g[w]=.5+(n0(0,1,v)-.5)*1.15;}for(let w=0;w<e;w++)for(let P=0;P<e;P++){let v=n[w*e+P];if(!(v===Ut||v===zt))for(let L=m;L<m+u;L++)for(let I=m;I<m+u;I++)b[(w*i+L)*p+P*i+I]=o[w]?.[P]?0:1;}let _=Zo(t.version);for(let w=0;w<p;w++)for(let P=0;P<p;P++){let v=w*p+P;b[v]<0&&_((P+.5)/i,(w+.5)/i)&&(b[v]=1);}let y=new Uint8Array(p*p),C=.3,M=0,$=0,S=(w,P,v)=>{if(w<0||w>=p||P>=p)return;let L=P*p+w;if(!Number.isNaN(g[L])){let I=Math.floor(w/i)===Math.floor(M/i)&&Math.floor(P/i)===Math.floor($/i);g[L]+=I?v:v*C;}};for(let w=0;w<p;w++){let P=w%2===0?1:-1;for(let v=0;v<p;v++){let L=P===1?v:p-1-v,I=w*p+L,F=g[I];if(Number.isNaN(F))continue;let O=b[I]>=0?b[I]:F>=.5?1:0;y[I]=O===0?1:0;let T=Math.min(.75,Math.max(-0.75,F-O));M=L,$=w,S(L+P,w,T*7/16),S(L-P,w+1,T*3/16),S(L,w+1,T*5/16),S(L+P,w+1,T/16);}}let R=Pt(r);return [Ds(t,c,w=>y[w]?R:null,"art-halftone"),...Ko(t,R)]}function ws(t,e){let n=null,o=0;for(let r of t.palette){if(e&&Jm(r.color,e)<.02)continue;let a=r.area*(.35+Ps(r.color))*(Z(r.color)>.86?.05:1);a>o&&(o=a,n=r.color);}return n}function Gs(t,e,n,o,r){let a;if(t.photographic){let i=new Ge,{width:c,height:s,rgb:l,alpha:u}=e;for(let m=0;m<s;m++){let f=0,d=null;for(let p=0;p<=c;p++){let h=m*c+p,g=p<c&&u[h]>=.5?Pt(o([l[h*3],l[h*3+1],l[h*3+2]]),6):null;(p===c||g!==d)&&(d&&i.cellRun(d,f,m,p-f),f=p,d=g);}}a=i.toElements(`${r}-px`);}else a=t.layers.map((i,c)=>E("path",{d:i.d,fill:Pt(o(i.color)),fillRule:"evenodd"},`${r}-${c}`));return E("g",{transform:`translate(${St(n.x)} ${St(n.y)}) scale(${Ts(n.scale)})`,children:a},r)}function b0(t){let{art:e,image:n,size:o,kinds:r,modules:a,fg:i,bg:c,t:s,margin:l,pixelSize:u}=t,m=Yo(e,n),f=Is(e,n,m),d=jo(m.width,m.height,o,"contain"),p=Math.min(1,.3+1.4*s),h=T=>Be(c,T,p),g=Pt(c),b=Pt(i),_=[Gs(m,f,{x:(l+d.offsetX)*u,y:(l+d.offsetY)*u,scale:d.scale*u},h,"art-logo")],y=Ns,C=(T,B)=>Qe((T+l)*u,(B+l)*u,(y+.4)*u,(y+.4)*u,1.2*u),M=Gn(t.version,o).map(([T,B])=>Qe((T-2.5+l)*u,(B-2.5+l)*u,6*u,6*u,u*.8)).join("");_.push(E("path",{d:C(-0.4,-0.4)+C(o-y,-0.4)+C(-0.4,o-y)+M,fill:g},"art-plates"));let $=Zo(t.version),S=Z(c),R=Z(i),w=new Float32Array(o*o),P=new Float32Array(o*o),v=new Array(o*o);for(let T=0;T<o;T++)for(let B=0;B<o;B++){let H=T*o+B,Q=r[H];if(Q===Ut||Q===zt){w[H]=Q===zt&&a[T]?.[B]?R:S;continue}let U=1,tt=0,yt=0,st=0,k=0;for(let q=0;q<4;q++)for(let z=0;z<4;z++){let Ct=B+(z+.5)/4,Le=T+(q+.5)/4,Nt=$(Ct,Le)?c:Ls(f,(Ct-d.offsetX)/d.scale,(Le-d.offsetY)/d.scale,c,p),oe=Z(Nt);U=Math.min(U,oe),tt+=oe,yt+=Nt[0],st+=Nt[1],k+=Nt[2];}w[H]=tt/16,P[H]=U,v[H]=[yt/16,st/16,k/16];}let L=R+.08*(S-R),I=S-.04*(S-R),F=Bs(t,w,w,{base:.74-.26*s,max:.9,dark:L,light:I,margin:.23-.1*s,cap:.4+.1*s,skip:s>=.7}),O=new Ge;for(let T=0;T<o;T++)for(let B=0;B<o;B++){let H=T*o+B,Q=F.diameter[H],U=!!a[T]?.[B];if(!(Q>0)||!U&&P[H]>=S-.02)continue;let tt=U?Ce(v[H],i,L,true):Ce(v[H],c,I,false);O.circle(Pt(tt,8),(B+l+.5)*u,(T+l+.5)*u,Q/2*u);}return _.push(...O.toElements("art-dot")),_.push(...Ko(t,b)),_}var _0={L:.5,M:.72,Q:.88,H:1},Us=.32,qs=.55,y0=.6,x0=2;function zs(t,e,n){let o=e>=1?t:t*e,r=e>=1?t/e:t,a=Math.max(.7,t*.09),i=o+2*a,c=r+2*a;return {logoW:o,logoH:r,plateW:i,plateH:c,radius:Math.min(i,c)*.26,cx:n/2,cy:n/2}}var Ws=t=>({cx:t.cx,cy:t.cy,w:t.plateW,h:t.plateH,r:t.radius});function Hs(t,e,n){return js(e+.5,n+.5,t)<qs}function $0(t,e){let n=Ws(t),o=qs+1,r=Math.max(0,Math.floor(t.cx-t.plateW/2-o)),a=Math.min(e-1,Math.ceil(t.cx+t.plateW/2+o)),i=Math.max(0,Math.floor(t.cy-t.plateH/2-o)),c=Math.min(e-1,Math.ceil(t.cy+t.plateH/2+o)),s=[];for(let l=i;l<=c;l++)for(let u=r;u<=a;u++)Hs(n,u,l)&&s.push(l*e+u);return s}var S0=t=>Math.floor(t.correctable*y0);function qo(t,e,n){let o=zs(t,e,n.size),r=S0(n);return Qn(n,$0(o,n.size)).every(a=>a<=r)}function Vs(t,e,n){if(qo(n,e,t))return n;let o=0,r=n;if(!qo(o,e,t))return -1;for(;r-o>1/64;){let a=(o+r)/2;qo(a,e,t)?o=a:r=a;}return o}var yr=new Map;function C0(t,e){let n=`${t.version}${t.level}:${e.toFixed(3)}`,o=yr.get(n);return o===void 0&&(o=Vs(t,e,Us*t.size),yr.size>=64&&yr.clear(),yr.set(n,o)),o}function M0(t,e){let{size:n,t:o,modules:r,version:a}=t,i=Km(r),c=(.18+.15*o)*_0[i],s=e.width/e.height,l=Math.min(Us,c)*n,u=Dn(a,i),m=Math.max(0,C0(u,s));if(m<x0)return {wantedBox:l,maxBox:m,box:0,plate:null};let f=Vs(u,s,Math.min(l,m));return f<0?{wantedBox:l,maxBox:m,box:0,plate:null}:{wantedBox:l,maxBox:m,box:f,plate:zs(f,s,n)}}function js(t,e,n){let o=Math.abs(t-n.cx)-(n.w/2-n.r),r=Math.abs(e-n.cy)-(n.h/2-n.r);return Math.hypot(Math.max(o,0),Math.max(r,0))+Math.min(Math.max(o,r),0)-n.r}function Ys(t,e){let{fg:n,bg:o,t:r}=t,a=Z(n),i=Z(o),c=ws(e),s=Math.min(1,r/.6),l=c?Ce(c,n,a+.3*(i-a),true):n,u=Be(n,l,s),m=c?ws(e,c):null,f=a+.42*(i-a),d=m&&Z(m)<=f+.22?Be(n,Ce(m,n,f,true),s):u;return {body:u,inner:d}}function w0(t){let{art:e,image:n,size:o,kinds:r,modules:a,bg:i,margin:c,pixelSize:s,version:l}=t,u=Yo(e,n),m=M0(t,u).plate,{body:f}=Ys(t,u),d=Pt(f),p=m&&Ws(m),h=a.map(v=>[...v]);for(let v=0;v<o;v++)for(let L=0;L<o;L++){let I=r[v*o+L];(I===zt||p&&I!==Ut&&Hs(p,L,v))&&(h[v][L]=false);}let g=[],b=t.body?.(h);if(b)g.push(E("g",{fill:d,children:b},"art-body"));else {let v=new Ge;for(let L=0;L<o;L++)for(let I=0;I<o;I++)h[L]?.[I]&&r[L*o+I]!==Ut&&v.circle(d,(I+c+.5)*s,(L+c+.5)*s,.45*s);g.push(...v.toElements("art-body"));}let _=Gn(l,o).filter(([v,L])=>!p||js(v+.5,L+.5,p)>3.2);if(_.length>0&&g.push(E("path",{d:Fs(_,c,s),fill:d,fillRule:"evenodd"},"art-alignment")),!m)return g;let y=Is(e,n,u),C=(m.cx-m.plateW/2+c)*s,M=(m.cy-m.plateH/2+c)*s,$=m.plateW*s,S=m.plateH*s,R=m.radius*s,w=.1*s,P=Qe(C,M,$,S,R);return g.push(E("path",{d:P,fill:Pt(i)},"art-plate"),E("path",{d:P+Qe(C+w,M+w,$-2*w,S-2*w,R-w),fill:Pt(Be(i,f,.16)),fillRule:"evenodd"},"art-plate-ring"),Gs(u,y,{x:(m.cx-m.logoW/2+c)*s,y:(m.cy-m.logoH/2+c)*s,scale:m.logoW/u.width*s},v=>v,"art-logo")),g}function Jo(t){let{art:e}=t;if(e.mode!=="logo"||e.matchEyes===false)return null;let n=e.image&&Wo(e.image);if(!n)return null;let o=bn(t.fgColor,[0,0,0]),r=bn(t.bgColor,[1,1,1]),a=ks(e,o,r);if(a<=0)return null;let i=Yo(e,n);if(i.palette.length===0)return null;if($r(e)==="badge"){let{body:p,inner:h}=Ys({fg:o,bg:r,t:a},i),g={outer:Pt(p),inner:Pt(h)};return {topLeft:g,topRight:g,bottomLeft:g}}let c=Z(o),s=Z(r),l=Math.min(1,a/.6),u=t.version*4+17,m=jo(i.width,i.height,u,"contain"),f=.45*Math.max(i.width,i.height),d=(p,h)=>{let g=(p-m.offsetX)/m.scale,b=(h-m.offsetY)/m.scale,_=null,y=0;for(let M of i.palette){if(Z(M.color)>.86)continue;let $=(M.cx-g)**2+(M.cy-b)**2,S=M.area*(.35+Ps(M.color))*Math.exp(-$/(2*f**2));S>y&&(y=S,_=M.color);}if(!_)return {};let C=Ce(_,o,c+.42*(s-c),true);return {inner:Pt(Be(o,C,l))}};return {topLeft:d(3.5,3.5),topRight:d(u-3.5,3.5),bottomLeft:d(3.5,u-3.5)}}function J(t){if(t.length===0)return "";let[e,...n]=t;return `M${x(e[0])} ${x(e[1])}${n.map(([o,r])=>`L${x(o)} ${x(r)}`).join("")}Z`}function W(t,e,n){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(n)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(n)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function D(t,e,n,o,r=0){let a=Math.min(n,o)/2,[i,c,s,l]=(typeof r=="number"?[r,r,r,r]:r).map(m=>Math.max(0,Math.min(m,a))),u=(m,f,d)=>m>0?`A${x(m)} ${x(m)} 0 0 1 ${x(f)} ${x(d)}`:"";return `M${x(t+i)} ${x(e)}H${x(t+n-c)}${u(c,t+n,e+c)}V${x(e+o-s)}${u(s,t+n-s,e+o)}H${x(t+l)}${u(l,t,e+o-l)}V${x(e+i)}${u(i,t+i,e)}Z`}function _n(t,e,n,o,r=-90){return Array.from({length:o},(a,i)=>{let c=(r+360/o*i)*Math.PI/180;return [t+n*Math.cos(c),e+n*Math.sin(c)]})}function yn(t,e,n,o,r=5){return Array.from({length:r*2},(a,i)=>{let c=i%2===0?n:o,s=-Math.PI/2+Math.PI/r*i;return [t+c*Math.cos(s),e+c*Math.sin(s)]})}function Un(t,e,n,o,r=4,a=64){return Array.from({length:a},(i,c)=>{let s=2*Math.PI*c/a,l=Math.cos(s),u=Math.sin(s);return [t+n*Math.sign(l)*Math.abs(l)**(2/r),e+o*Math.sign(u)*Math.abs(u)**(2/r)]})}function xn(t,e,n){let o=n/2,r=(a,i)=>`${x(t+a*o)} ${x(e+i*o)}`;return `M${r(0,-0.52)}C${r(.18,-0.92)} ${r(.98,-0.94)} ${r(1,-0.34)}C${r(1,.12)} ${r(.5,.48)} ${r(0,.92)}C${r(-0.5,.48)} ${r(-1,.12)} ${r(-1,-0.34)}C${r(-0.98,-0.94)} ${r(-0.18,-0.92)} ${r(0,-0.52)}Z`}function Xs(t,e,n,o){if(o===0)return t;let r=o*Math.PI/180,a=Math.cos(r),i=Math.sin(r);return t.map(([c,s])=>[e+(c-e)*a-(s-n)*i,n+(c-e)*i+(s-n)*a])}function Sr(t,e,n=0){let o=Math.imul(t+2654435769,2246822507)^Math.imul(e+n,3266489909);return o=Math.imul(o^o>>>15,739982445),o=Math.imul(o^o>>>12,695872825),o^=o>>>15,(o>>>0)/4294967296}function Ue(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return (e>>>0).toString(36)}var R0=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];function Zs(t){return R0.includes(t)}var Ks={circle:.95,"circle-large":.85,square:.75,diamond:.95,pacman:.9,rounded:.75,"vertical-line":.8,liquid:.75,"liquid-horizontal":.85,"liquid-vertical":.85,classy:.7,"classy-rounded":.7,leaf:.75,plus:.8,hexagon:.75,star:.85,heart:.85,"random-dots":.85,mosaic:.8,octagon:.8};function Cr(t,e){if(t===void 0||!Number.isFinite(t))return 1;let n=e?Ks[e]??1:Nn;return Math.min(br,Math.max(Nn,n,t))}function E0(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}function A0(t,e){if(t===1)return [];let n=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(n*2-2))*2,r=[6];for(let a=e-7;r.length<n;a-=o)r.splice(1,0,a);return r}function ta(t){let e=(t-17)/4,n=Number.isInteger(e)?A0(e,t):[],o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[c,s]of n.entries())a===0&&c===0||a===0&&c===o||a===o&&c===0||r.push([i,s]);return (a,i)=>r.some(([c,s])=>Math.abs(a-c)<=2&&Math.abs(i-s)<=2)}var P0={liquid:{horizontal:true,vertical:true,thickness:1,radius:()=>1,fillets:true},"liquid-horizontal":{horizontal:true,vertical:false,thickness:.86,radius:()=>1,fillets:false},"liquid-vertical":{horizontal:false,vertical:true,thickness:.86,radius:()=>1,fillets:false},classy:{horizontal:true,vertical:true,thickness:1,radius:t=>t===0||t===2?1:0,fillets:false},"classy-rounded":{horizontal:true,vertical:true,thickness:1,radius:t=>t===0||t===2?1:.4,fillets:false}};function v0(t,e,n,o,r,a){switch(t){case "horizontal-line":{let i=o*.43;return D(e-o/2,n-i,o,2*i)}case "leaf":{let i=o*.5;return D(e-i,n-i,2*i,2*i,[o*.4,o*.05,o*.4,o*.05])}case "plus":{let i=o*.22,c=o*.5;return J([[e-i,n-c],[e+i,n-c],[e+i,n-i],[e+c,n-i],[e+c,n+i],[e+i,n+i],[e+i,n+c],[e-i,n+c],[e-i,n+i],[e-c,n+i],[e-c,n-i],[e-i,n-i]])}case "hexagon":return J(_n(e,n,o*.54,6));case "star":return J(yn(e,n+o*.04,o*.62,o*.34));case "heart":return xn(e,n+o*.02,o*1.08);case "random-dots":return W(e,n,o*(.38+.15*Sr(r,a)));case "mosaic":{let i=o*(.8+.14*Sr(r,a,1))/2,c=[[e-i,n-i],[e+i,n-i],[e+i,n+i],[e-i,n+i]];return J(Xs(c,e,n,(Sr(r,a,2)-.5)*16))}case "octagon":return J(_n(e,n,o*.48/Math.cos(Math.PI/8),8,22.5));default:return W(e,n,o*.45)}}function Js(t,e){let{margin:n,pixelSize:o,pattern:r}=e,a=Cr(e.scale,r),i=t.length,c=e.plain?()=>false:ta(i),s=(h,g)=>!e.plain&&E0(h,g,i),l=(h,g)=>h>=0&&g>=0&&h<i&&g<i&&!!t[g]?.[h]&&!s(h,g),u=h=>(h+.5+n)*o,m=[],f=[],d=P0[r];for(let h=0;h<i;h++)for(let g=0;g<i;g++){if(!l(g,h))continue;let b=u(g),_=u(h);if(c(g,h)){m.push(A`M${b-o/2} ${_-o/2}h${o}v${o}h${-o}z`);continue}if(!d){f.push(v0(r,b,_,o*a,g,h));continue}let y=o*d.thickness*a/2,C=d.horizontal&&l(g+1,h),M=d.horizontal&&l(g-1,h),$=d.vertical&&l(g,h-1),S=d.vertical&&l(g,h+1),w=[!($||M),!($||C),!(S||C),!(S||M)].map((P,v)=>P?y*d.radius(v):0);f.push(D(b-y,_-y,2*y,2*y,w)),2*y<o&&(C&&f.push(D(b,_-y,o,2*y)),S&&f.push(D(b-y,_,2*y,o)));}if(d?.fillets&&a===1){let h=o*.3;for(let g=0;g<i;g++)for(let b=0;b<i;b++){if(l(b,g)||s(b,g))continue;let _=u(b)-o/2,y=u(g)-o/2,C=_+o,M=y+o;l(b-1,g)&&l(b,g-1)&&l(b-1,g-1)&&f.push(A`M${_} ${y}h${h}A${h} ${h} 0 0 0 ${_} ${y+h}Z`),l(b+1,g)&&l(b,g-1)&&l(b+1,g-1)&&f.push(A`M${C} ${y}v${h}A${h} ${h} 0 0 0 ${C-h} ${y}Z`),l(b+1,g)&&l(b,g+1)&&l(b+1,g+1)&&f.push(A`M${C} ${M}h${-h}A${h} ${h} 0 0 0 ${C} ${M-h}Z`),l(b-1,g)&&l(b,g+1)&&l(b-1,g+1)&&f.push(A`M${_} ${M}v${-h}A${h} ${h} 0 0 0 ${_+h} ${M}Z`);}}let p=[];return f.length>0&&p.push(E("path",{d:f.join("")},"modules")),m.length>0&&p.push(E("path",{d:m.join("")},"alignment")),p}var zp=(t,e,n,o)=>{let r=document.createElement("canvas");r.width=e,r.height=n;let a=r.getContext("2d");if(!a)return;a.putImageData(t,0,0);let i=r.toDataURL("image/png"),c=document.createElement("a");c.href=i,c.download=o,document.body.appendChild(c),c.click(),document.body.removeChild(c);},L0=async(t,e,n,o)=>{let{default:r}=await import('jsqr');return new Promise(a=>{t.complete?i():(t.onload=()=>i(),t.onerror=()=>a(null));function i(){let c=document.createElement("canvas");requestAnimationFrame(()=>{if(!(t.naturalWidth&&t.naturalHeight)){a(null);return}let s=t.naturalWidth/t.naturalHeight<=.33||t.naturalWidth/t.naturalHeight>=3?Math.sqrt(t.naturalWidth*t.naturalHeight/12e5):t.naturalWidth/t.naturalHeight<=.5||t.naturalWidth/t.naturalHeight>=2?Math.sqrt(t.naturalWidth*t.naturalHeight/9e5):Math.sqrt(t.naturalWidth*t.naturalHeight/64e4),l=c.getContext("2d",{willReadFrequently:true});if(!l){a(null);return}let u=[1,.8,.6,.4,.2,.1];for(let m of u){let f=Math.floor(t.naturalWidth*e*m/s),d=Math.floor(t.naturalHeight*e*m/s);c.width=f,c.height=d,l.clearRect(0,0,f,d),l.imageSmoothingEnabled=true,l.imageSmoothingQuality="high";try{l.drawImage(t,Math.floor(n),Math.floor(o),Math.floor(t.naturalWidth*e),Math.floor(t.naturalHeight*e),0,0,f,d);let p=l.getImageData(0,0,f,d);try{let h=r(p.data,f,d);if(h?.data){a(h);return}}catch(h){console.error("QR Detection error:",h);}}catch(p){console.error("Canvas drawing error:",p);}}a(null);});}})},tc=async(t,e,n=false)=>{if(!t)return "NO_QR";await new Promise(r=>setTimeout(r,100));let o=[{dx:0,dy:0,ratio:1},{dx:0,dy:t.naturalHeight*.35,ratio:.65},{dx:t.naturalWidth*.35,dy:t.naturalHeight*.35,ratio:.65},{dx:t.naturalWidth*.35,dy:0,ratio:.65},{dx:t.naturalWidth*.35/2,dy:t.naturalHeight*.35/2,ratio:.65}];for(let r of o)try{let a=await L0(t,r.ratio,r.dx,r.dy);if(a?.data)return n?a:a.data}catch(a){console.warn("QR decode error:",a);}return "NO_QR"};function Wp(t,e,n){if(!(t&&e)||e.length!==4)return;let o=document.createElement("canvas");o.width=t.naturalWidth,o.height=t.naturalHeight;let r=o.getContext("2d");if(!r)return;r.drawImage(t,0,0),r.save(),r.strokeStyle="#ff0000",r.lineWidth=Math.max(5,Math.min(t.naturalWidth,t.naturalHeight)/200),r.shadowColor="transparent",r.shadowBlur=0,r.beginPath(),r.moveTo(e[0].x,e[0].y),r.lineTo(e[1].x,e[1].y),r.lineTo(e[3].x,e[3].y),r.lineTo(e[2].x,e[2].y),r.closePath(),r.stroke(),r.fillStyle="#ff0000",e.forEach((c,s)=>{r.fillRect(c.x-3,c.y-3,6,6),r.fillStyle="#ffffff",r.font="16px Arial",r.fillText(`${s}`,c.x+5,c.y-5),r.fillStyle="#ff0000";}),r.restore();let a=o.toDataURL("image/png"),i=document.createElement("a");i.href=a,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i);}var ea=24,Me=(t,e,n,o)=>{let r=o*Math.PI/180;return [t+n*Math.cos(r),e+n*Math.sin(r)]},Mr=([t,e])=>`${x(t)} ${x(e)}`;function $n(t,e,n,o,r,a){let i=a-r>180?1:0;return `M${Mr(Me(t,e,o,r))}A${x(o)} ${x(o)} 0 ${i} 1 ${Mr(Me(t,e,o,a))}L${Mr(Me(t,e,n,a))}A${x(n)} ${x(n)} 0 ${i} 0 ${Mr(Me(t,e,n,r))}Z`}function qn(t,e,n,o){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function I0(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),e/2}function ec(t){return J(I0(t)<0?[...t].reverse():t)}function wr(t,e,n,o,r){let a=Math.hypot(n-t,o-e)||1,i=-(o-e)/a*(r/2),c=(n-t)/a*(r/2);return ec([[t+i,e+c],[n+i,o+c],[n-i,o-c],[t-i,e-c]])}var vt=(...t)=>({d:t.join(""),fillRule:"nonzero"}),ce=(...t)=>({d:t.join(""),fillRule:"evenodd"});function T0(){let t=[];for(let e of [0,60,120]){let[n,o]=Me(12,12,10.5,e+180),[r,a]=Me(12,12,10.5,e);t.push(wr(n,o,r,a,2));}for(let e=0;e<6;e++){let n=e*60,[o,r]=Me(12,12,6.2,n);for(let a of [-45,45]){let[i,c]=Me(o,r,3.6,n+a);t.push(wr(o,r,i,c,1.7));}}return vt(...t)}var F0={wifi:()=>vt($n(12,20,4.6,7.2,-135,-45),$n(12,20,9.2,11.8,-135,-45),$n(12,20,13.8,16.4,-135,-45),W(12,20,2.2)),star:()=>vt(J(yn(12,12.8,11.6,4.8))),heart:()=>vt(xn(12,12.4,22)),phone:()=>ce(D(6,1.5,12,21,2.6),D(7.8,4.2,8.4,13.4,.6),W(12,19.8,1.1)),headphones:()=>vt($n(12,13,7.6,9.8,-180,0),D(2,12,5,9.5,2),D(17,12,5,9.5,2)),calendar:()=>ce(D(2.5,4,19,17.5,2.5),D(4.6,9,14.8,10.6,.8),D(7,11.4,2.6,2.6,.4),D(10.7,11.4,2.6,2.6,.4),D(14.4,11.4,2.6,2.6,.4),D(7,15.1,2.6,2.6,.4),D(10.7,15.1,2.6,2.6,.4),D(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),D(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>vt(W(12,7.5,4.6),"M3 21.5C3 16.2 7 13.6 12 13.6C17 13.6 21 16.2 21 21.5Z"),chat:()=>ce(D(2,3,20,14,4),J([[6.5,17],[11.5,17],[5.8,21.8]]),W(7.5,10,1.5),W(12,10,1.5),W(16.5,10,1.5)),bag:()=>vt(D(3.5,7.5,17,14.5,2),$n(12,7.5,3.1,4.8,-180,0)),bell:()=>vt("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",D(1.5,18.2,21,2.6,1.3),D(11.2,6.6,1.6,2.6,0),D(9.8,4.6,4.4,2.4,1.2)),cup:()=>vt("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",$n(17,10.2,1.7,3.6,-90,90),D(2,20.6,17,2,1),D(7,1.6,1.6,3.4,.8),D(11.6,1.6,1.6,3.4,.8)),card:()=>ce(D(1.5,4.5,21,15,2.5),D(1.5,8,21,3,0),D(4.5,13.6,4.6,3.2,.6)),check:()=>ce(W(12,12,10.5),J([[6.6,12.4],[8.4,10.6],[10.6,12.8],[15.8,7.6],[17.6,9.4],[10.6,16.4]])),info:()=>ce(W(12,12,10.5),W(12,7.2,1.6),D(10.6,10,2.8,8,.8)),home:()=>ce(J([[12,2.5],[22.5,11.5],[19.5,11.5],[19.5,21.5],[4.5,21.5],[4.5,11.5],[1.5,11.5]]),D(10,14.5,4,7,[.6,.6,0,0])),pin:()=>ce("M12 22.5C8.5 17.6 4.5 14 4.5 9.5A7.5 7.5 0 0 1 19.5 9.5C19.5 14 15.5 17.6 12 22.5Z",W(12,9.5,3)),share:()=>vt(wr(6,12,18,5,1.8),wr(6,12,18,19,1.8),W(18,5,3.2),W(6,12,3.2),W(18,19,3.2)),download:()=>vt(D(10.6,2,2.8,9.5,0),J([[6,10],[18,10],[12,16.5]]),J([[2.5,15],[5.3,15],[5.3,19],[18.7,19],[18.7,15],[21.5,15],[21.5,21.8],[2.5,21.8]])),clock:()=>ce(W(12,12,10.5),W(12,12,8.4),J([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:T0,pumpkin:()=>vt(qn(7.8,14.6,5.8,6.9),qn(16.2,14.6,5.8,6.9),qn(12,14.6,4.8,7.4),D(10.9,3.4,2.2,4.6,.8),ec([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>vt(J([[12,1.5],[16.8,8.2],[7.2,8.2]]),J([[12,5.2],[19,13.6],[5,13.6]]),J([[12,9.4],[21.2,19.2],[2.8,19.2]]),D(10.4,18.6,3.2,3.9,.4)),sparkle:()=>vt(J(yn(9.5,13.5,9,2.4,4)),J(yn(19,5,4,1.1,4))),gift:()=>vt(D(3,11.2,7.8,10.6,1),D(13.2,11.2,7.8,10.6,1),D(2,7.4,8.8,3.2,1),D(13.2,7.4,8.8,3.2,1),qn(8.8,4.8,2.9,1.9),qn(15.2,4.8,2.9,1.9))};function na(t){return F0[t]()}var k0=["banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"];function rc(t){return k0.includes(t)}var oa={from:"#7c3aed",to:"#db2777"},Rt="#FFFFFF";function oc(t){return t===" "?.3:/[MWmw@%]/.test(t)?.92:/[A-Z0-9#&]/.test(t)?.72:/[il.,:;!'|1]/.test(t)?.32:.6}function Cn(t){let e=0;for(let n of t)e+=oc(n);return Math.max(e,1)}var ra=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function Dt(t,e,n){let o=dt(t)??{r:0,g:0,b:0},r=dt(e)??{r:255,g:255,b:255},a=Math.min(1,Math.max(0,n));return `#${ra(o.r+(r.r-o.r)*a)}${ra(o.g+(r.g-o.g)*a)}${ra(o.b+(r.b-o.b)*a)}`}var Ot=(t,e,n,o,r=0)=>({x:t,y:e,width:n,height:o,radius:r}),lt=(t,e,n,o,r,a)=>({type:"rect",...Ot(t,e,n,o,r),fill:a}),Sn=(t,e,n)=>({type:"rect",...t,fill:n,hole:e}),Lt=(t,e)=>({type:"polygon",points:t,fill:e}),we=(t,e,n="nonzero")=>({type:"path",d:t,fill:e,fillRule:n}),ac=(...t)=>t.filter(e=>e!==null),N0=t=>{let{size:e,gap:n,border:o,band:r,color:a,background:i,frame:c,fitLabel:s}=t,l=e+2*(o+n),u=l-2*o,m=e+2*n,f=r+m+r,d=u-2*n,p=c.textColor||Rt;return {width:l,height:f,qrX:o+n,qrY:r+n,qrSize:e,shapes:[lt(o,r,u,m,0,i),Sn(Ot(0,0,l,f),Ot(o,r,u,m),a)],label:s(t.text,l/2,r/2,r,d,p),extraLabels:ac(s(t.secondaryText,l/2,r+m+r/2,r,d,p,"secondaryText")),squareEdges:true,color:a}},O0=t=>{let{size:e,gap:n,border:o,band:r,color:a,background:i,frame:c,fitLabel:s}=t,l=e+2*(o+n),u=l-2*o,m=e*.07,f=Math.max(m-o,0),d=e*.025,p=e*.08,h=r+p+d;return {width:l,height:h+l,qrX:o+n,qrY:h+o+n,qrSize:e,shapes:[lt(0,0,l,r,r/2,a),Lt([[l/2-p,r-p/2],[l/2+p,r-p/2],[l/2,r+p]],a),lt(o,h+o,u,u,f,i),Sn(Ot(0,h,l,l,m),Ot(o,h+o,u,u,f),a)],label:s(t.text,l/2,r/2,r,u-2*n,c.textColor||Rt),squareEdges:false,color:a}},D0=t=>{let{size:e,gap:n,border:o,color:r,background:a,frame:i,fitLabel:c}=t,s=e+2*(o+n),l=s-2*o,u=e*.12,m=e+2*n,f=t.text?e*.2:o,d=o+m+f,p=e*.13,h=d-e*.02;return {width:s,height:d+p,qrX:o+n,qrY:o+n,qrSize:e,shapes:[lt(0,0,s,d,u,r),we(A`M${s*.13} ${h}L${s*.05} ${d+p}`+A`Q${s*.16} ${d+p*.45} ${s*.32} ${h}Z`,r),lt(o,o,l,m,Math.max(u-o,0),a)],label:c(t.text,s/2,o+m+f/2,f,l-2*n,i.textColor||Rt),squareEdges:false,color:r}};function Rr(t,e,n,o,r,a,i,c){let s=[...t],l=r*.08,u=s.map(h=>oc(h)*r),m=u.reduce((h,g)=>h+g,0)+l*Math.max(0,s.length-1),f=a==="top"?o-r*.35:o+r*.35,d=[],p=0;return s.forEach((h,g)=>{let b=u[g],_=(p+b/2)/f;if(p+=b+l,h.trim()==="")return;let y=a==="top"?-Math.PI/2-m/2/f+_:Math.PI/2+m/2/f-_;d.push({text:h,x:e+f*Math.cos(y),y:n+f*Math.sin(y),fontSize:r,maxWidth:r*2,color:i,rotate:y*180/Math.PI+(a==="top"?90:-90),field:c});}),d}var Q0=t=>{let{size:e,gap:n,color:o,background:r,frame:a,fontScale:i}=t,c=e*Math.SQRT1_2+n*.9,s=e*.21,l=c+s,u=c+s/2,m=l,f=a.textColor||Rt,d=u*(140*Math.PI/180),p=_=>Math.min(s*.5*i,d/(Cn(_)+.08*_.length)),h=t.text?Rr(t.text,m,m,u,p(t.text),"top",f,"text"):[],g=t.secondaryText?Rr(t.secondaryText,m,m,u,p(t.secondaryText),"bottom",f,"secondaryText"):[],b=s*.07;return {width:2*l,height:2*l,qrX:m-e/2,qrY:m-e/2,qrSize:e,shapes:[we(W(m,m,c),r),we(W(m,m,l)+W(m,m,c),o,"evenodd"),we(W(m-u,m,b)+W(m+u,m,b),f)],label:null,extraLabels:[...h,...g],squareEdges:false,color:o}},B0=t=>{let{size:e,gap:n,color:o,background:r,frame:a,fitLabel:i}=t,c=e*.07,s=e+2*n,l=e*.3,u=e*.025,m=s+2*c,f=c+s+l,d=e*.015;return {width:m+u,height:f+u,qrX:c+n,qrY:c+n,qrSize:e,shapes:[lt(u,u,m,f,d,Dt(o,Rt,.72)),lt(0,0,m,f,d,o),lt(c,c,s,s,0,r)],label:i(t.text,m/2,c+s+l/2,l*.8,s-2*n,a.textColor||Rt),squareEdges:false,color:o}},G0=t=>{let{size:e,gap:n,color:o,background:r,frame:a,fitLabel:i}=t,c=e*.05,s=e*.17,l=e*.15,u=t.text?e*.17:0,m=e+2*n,f=n+e+(t.text?n*.5+u:n),d=m+2*c,p=s+f+l,h=e*.036,g=e*.03;return {width:d,height:p,qrX:c+n,qrY:s+n,qrSize:e,shapes:[lt(0,0,d,p,e*.17,o),lt(c,s,m,f,e*.06,r),lt(d/2-e*.11,s/2-h/2,e*.22,h,h/2,r),lt(d/2-e*.15,s+f+l/2-g/2,e*.3,g,g/2,r)],label:i(t.text,d/2,s+n+e+n*.5+u/2,u,m-2*n,a.textColor||o),squareEdges:false,color:o}},U0=t=>{let{size:e,gap:n,band:o,color:r,background:a,frame:i,fitLabel:c}=t,s=e*.05,l=e+2*n,u=l+2*s,m=it(s+l+s*1.2),f=m+o,d=it(e*.055),p=e*.04,h=A`M${p} 0H${u-p}A${p} ${p} 0 0 1 ${u} ${p}`+A`V${m-d}A${d} ${d} 0 0 0 ${u} ${m+d}`+A`V${f-p}A${p} ${p} 0 0 1 ${u-p} ${f}`+A`H${p}A${p} ${p} 0 0 1 0 ${f-p}`+A`V${m+d}A${d} ${d} 0 0 0 0 ${m-d}`+A`V${p}A${p} ${p} 0 0 1 ${p} 0Z`,g=[],b=e*.03,_=e*.022,y=e*.012;for(let C=d+_;C+b<=u-d-_/2;C+=b+_)g.push(D(C,m-y/2,b,y));return {width:u,height:f,qrX:s+n,qrY:s+n,qrSize:e,shapes:[we(h,r),lt(s,s,l,l,e*.02,a),we(g.join(""),a)],label:c(t.text,u/2,m+o/2,o,l-2*n,i.textColor||Rt),squareEdges:false,color:r}},q0=t=>{let{size:e,gap:n,border:o,band:r,color:a,background:i,frame:c,fitLabel:s}=t,l=e*.18,u=e*.05,m=e+2*(o+n),f=e*.06,d=Math.max(f-o,0),p=m+2*l,h=m-o,g=l*.5,b=h+u,_=g+u*2,y=l*.28,C=Dt(a,"#000000",.28),M=Dt(a,"#000000",.5);return {width:p,height:b+r,qrX:l+o+n,qrY:o+n,qrSize:e,shapes:[Lt([[0,b],[_,b],[_,b+r],[0,b+r],[y,b+r/2]],C),Lt([[p,b],[p-y,b+r/2],[p,b+r],[p-_,b+r],[p-_,b]],C),Lt([[g,h+r],[g+u*1.6,h+r+u],[g,h+r+u]],M),Lt([[p-g,h+r],[p-g,h+r+u],[p-g-u*1.6,h+r+u]],M),lt(l+o,o,m-2*o,m-2*o,d,i),Sn(Ot(l,0,m,m,f),Ot(l+o,o,m-2*o,m-2*o,d),a),lt(g,h,p-2*g,r,0,a)],label:s(t.text,p/2,h+r/2,r,p-2*g-2*n,c.textColor||Rt),squareEdges:false,color:a}},z0=t=>{let{size:e,gap:n,band:o,color:r,background:a,frame:i,fitLabel:c}=t,s=e*.08,l=e+2*n,u=l+2*s,m=e*.05,f=m+n+e+n*.6,d=e*.14,p=f+d+o+e*.02,h=m+e*.32,g=e*.012,b=f+d-m;return {width:u,height:p,qrX:s+n,qrY:m+n,qrSize:e,shapes:[lt(0,h,u,p-h,0,Dt(r,Rt,.45)),Lt([[0,h],[u/2,0],[u,h]],Dt(r,Rt,.25)),lt(s,m,l,b,0,a),Sn(Ot(s-g,m-g,l+2*g,b+g),Ot(s,m,l,b),r),Lt([[0,f],[u/2,f+d],[u,f],[u,p],[0,p]],r)],label:c(t.text,u/2,f+d+o/2,o,l-2*n,i.textColor||Rt),squareEdges:false,color:r}},W0=t=>{let{size:e,gap:n,band:o,color:r,background:a,frame:i,fitLabel:c}=t,s=e*.06,l=e+2*n,u=l+2*s,m=e*.24,f=e*.04,d=m*.48,p=e*.14,h=t.text?o:s,g=m+l+h,b=e*.04,_=A`M${p} 0H${u-p}L${u} ${p}`+A`V${g-b}A${b} ${b} 0 0 1 ${u-b} ${g}`+A`H${b}A${b} ${b} 0 0 1 0 ${g-b}V${p}Z`+W(u/2,d,f);return {width:u,height:g,qrX:s+n,qrY:m+n,qrSize:e,shapes:[we(_,r,"evenodd"),we(W(u/2,d,f*1.7)+W(u/2,d,f),Dt(r,Rt,.35),"evenodd"),lt(s,m,l,l,e*.02,a)],label:c(t.text,u/2,m+l+h/2,h,l-2*n,i.textColor||Rt),squareEdges:false,color:r}},H0=t=>{let{size:e,color:n,background:o,frame:r,fitLabel:a}=t,i=e*.13,c=t.text?e*.26:i,s=t.secondaryText?e*.2:i,l=e+2*i,u=c+e+s,m=e*.03,f=e*.022,d=e*.045,p=e*.008,h=r.textColor||n,g=[lt(0,0,l,u,m,o),Sn(Ot(0,0,l,u,m),Ot(f,f,l-2*f,u-2*f,Math.max(m-f,0)),n),Sn(Ot(d,d,l-2*d,u-2*d),Ot(d+p,d+p,l-2*(d+p),u-2*(d+p)),n)];if(t.text){let b=c-e*.075,_=e*.022;g.push(lt(l*.3,b-p/2,l*.4,p,0,n),Lt([[l/2,b-_],[l/2+_,b],[l/2,b+_],[l/2-_,b]],n));}return {width:l,height:u,qrX:i,qrY:c,qrSize:e,shapes:g,label:a(t.text,l/2,e*.115,e*.17,l-2*i,h),extraLabels:ac(a(t.secondaryText,l/2,c+e+s*.45,s*.8,l-2*i,h,"secondaryText")),squareEdges:false,color:n}},V0=t=>{let{size:e,gap:n,color:o,background:r,frame:a,fitLabel:i}=t,c=e*.025,s=e*.07,l=e*.03,u=e*.13,m=t.text?e*.17:0,f=n*1.25,d=e+2*f,p=d+2*s,h=d+2*s+m,g=p+2*c,b=h+2*c;return {width:g+l,height:b+l,qrX:c+s+f,qrY:c+s+f,qrSize:e,shapes:[lt(l,l,g,b,u+c,Dt(o,Rt,.7)),lt(0,0,g,b,u+c,Rt),lt(c,c,p,h,u,o),lt(c+s,c+s,d,d,e*.04,r)],label:i(t.text,c+p/2,c+s+d+(s+m)/2,s+m,d-2*n,a.textColor||Rt),squareEdges:false,color:o}};function nc(t,e,n,o){let r=t<e+o?e+o-t:t>e+n-o?t-(e+n-o):0;return o-Math.sqrt(Math.max(0,o*o-Math.min(r,o)**2))}function j0(t,e,n,o,r,a,i=48){let c=Math.max(n-o,0),s=t-2*o,l=new Set([o,t-o]);for(let g=0;g<=i;g++)l.add(t*g/i);let u=[...l].sort((g,b)=>g-b),m=t*.002,f=5,d=g=>nc(g,0,t,n),p=g=>o+nc(g,o,s,c),h=[];for(let g=0;g+1<u.length;g++){let b=u[g],_=Math.min(t,u[g+1]+(g+2<u.length?m:0)),y=Dt(r,a,(b+_)/2/t),C=$=>Array.from({length:f},(S,R)=>{let w=R/(f-1);return $?_+(b-_)*w:b+(_-b)*w});b>=o-1e-9&&u[g+1]<=t-o+1e-9?h.push(Lt([...C(false).map($=>[$,d($)]),...C(true).map($=>[$,p($)])],y),Lt([...C(false).map($=>[$,e-p($)]),...C(true).map($=>[$,e-d($)])],y)):h.push(Lt([...C(false).map($=>[$,d($)]),...C(true).map($=>[$,e-d($)])],y));}return h}var Y0=t=>{let{size:e,gap:n,background:o,frame:r,fitLabel:a}=t,i=r.color||oa.from,c=r.secondaryColor||oa.to,s=e*.05,l=e+2*(s+n),u=t.text?e*.18:0,m=e+(t.text?n+u:2*n),f=m+2*s,d=e*.1;return {width:l,height:f,qrX:s+n,qrY:s+n,qrSize:e,shapes:[lt(s,s,l-2*s,m,d-s,o),...j0(l,f,d,s,i,c)],label:a(t.text,l/2,s+n+e+u/2,u,l-2*s-2*n,r.textColor||Dt(i,c,.5)),squareEdges:false,color:i}},X0=t=>{let{size:e,gap:n,color:o,background:r,frame:a,fitLabel:i}=t,c=e*.035,s=e*.2,l=e+2*(n+c),u=t.text?e*.2:0,m=l,f=m+u,d=(p,h,g,b)=>[[p,h],[p+g*s,h],[p+g*s,h+b*c],[p+g*c,h+b*c],[p+g*c,h+b*s],[p,h+b*s]];return {width:l,height:f,qrX:c+n,qrY:c+n,qrSize:e,shapes:[lt(0,0,l,f,0,r),Lt(d(0,0,1,1),o),Lt(d(m,0,-1,1),o),Lt(d(m,m,-1,-1),o),Lt(d(0,m,1,-1),o)],label:i(t.text,l/2,m+u*.4,u,l-2*n,a.textColor||o),squareEdges:false,color:o}},ic={"banner-top-bottom":N0,"speech-bubble-top":O0,"chat-bubble":D0,circle:Q0,polaroid:B0,phone:G0,ticket:U0,badge:q0,envelope:z0,tag:W0,"menu-card":H0,sticker:V0,"gradient-border":Y0,focus:X0};var zn=class extends Error{issues;constructor(e){super(`Invalid frame spec: ${e.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=e;}},sc=new WeakMap;function aa(t){if(t&&typeof t=="object"){let n=sc.get(t);if(n)return n}if(t==null)throw new zn(['A "custom" frame needs a spec']);let e=Ne.safeParse(t);if(!e.success)throw new zn(e.error.issues.map(n=>n.path.length>0?`${n.path.join(".")}: ${n.message}`:n.message));return typeof t=="object"&&sc.set(t,e.data),e.data}function ia(t){let e=aa(t);return fn(e)/e.qr.size}function Z0(t){let e=wt(t,gt),n=dt(e);return n&&n.a>=1?e:gt}function K0(t,e,n){let o=t.color||e.colors.frame,r=t.textColor||e.colors.text||o,a=t.secondaryColor||e.colors.accent||o,i=c=>{switch(c){case "frame":return o;case "text":return r;case "accent":return a;case "background":return n;default:return c}};return c=>typeof c=="string"?i(c):Dt(i(c.mix[0]),i(c.mix[1]),c.amount)}function cc(t,e,n=0,o=0){let r=or(t);return r?zi(r,e,n,o):""}function J0(t,e,n,o){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function td(t,e){let[n,o,r,a]=[t.x1*e,t.y1*e,t.x2*e,t.y2*e],i=Math.hypot(r-n,a-o),c=t.width*e/2,s=i>0?(r-n)/i:1,l=i>0?(a-o)/i:0,u=-l*c,m=s*c,f=(g,b)=>{let _=[n+s*g,o+l*g],y=[n+s*b,o+l*b];if(t.cap==="round"&&b-g>2*c){let C=[_[0]+s*c,_[1]+l*c],M=[y[0]-s*c,y[1]-l*c];return `M${x(C[0]-u)} ${x(C[1]-m)}L${x(M[0]-u)} ${x(M[1]-m)}A${x(c)} ${x(c)} 0 0 1 ${x(M[0]+u)} ${x(M[1]+m)}L${x(C[0]+u)} ${x(C[1]+m)}A${x(c)} ${x(c)} 0 0 1 ${x(C[0]-u)} ${x(C[1]-m)}Z`}return `M${x(_[0]-u)} ${x(_[1]-m)}L${x(y[0]-u)} ${x(y[1]-m)}L${x(y[0]+u)} ${x(y[1]+m)}L${x(_[0]+u)} ${x(_[1]+m)}Z`};if(!t.dash)return {type:"path",d:f(0,i),fillRule:"nonzero"};let d=t.dash[0]*e,p=d+t.dash[1]*e,h=[];for(let g=0;g+d<=i+1e-6;g+=p)h.push(f(g,g+d));return {type:"path",d:h.join(""),fillRule:"nonzero"}}function ed(t,e){switch(t.type){case "rect":return {type:"rect",x:t.x*e,y:t.y*e,width:t.width*e,height:t.height*e,radius:(t.radius??0)*e,...t.hole&&{hole:{x:t.hole.x*e,y:t.hole.y*e,width:t.hole.width*e,height:t.hole.height*e,radius:(t.hole.radius??0)*e}}};case "circle":return {type:"path",d:W(t.cx*e,t.cy*e,t.r*e)+(t.hole?W(t.cx*e,t.cy*e,t.hole*e):""),fillRule:t.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:J0(t.cx*e,t.cy*e,t.rx*e,t.ry*e),fillRule:"nonzero"};case "polygon":return {type:"polygon",points:t.points.map(([n,o])=>[n*e,o*e])};case "path":return {type:"path",d:cc(t.d,e),fillRule:t.fillRule??"nonzero"};case "line":return td(t,e);default:{let n=na(t.icon);return {type:"path",d:cc(n.d,t.size*e/ea,t.x*e,t.y*e),fillRule:n.fillRule}}}}function nd(t){if(t.type==="rect"){let{x:e,y:n,width:o,height:r,radius:a,hole:i}=t;return [...Jt(e,n,o,r,a,a),...i?Jt(i.x,i.y,i.width,i.height,i.radius,i.radius):[]]}return t.type==="polygon"?[...t.points.map(([e,n],o)=>o===0?{op:"M",x:e,y:n}:{op:"L",x:e,y:n}),{op:"Z"}]:se(t.d)}function rd(t,e,n){let o=nd(t),r=ar(o,.2),a=t.type==="rect"?t.hole?"evenodd":"nonzero":t.type==="path"?t.fillRule??"nonzero":"nonzero",i=e.direction==="vertical",c=g=>i?g[1]:g[0],s=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let g of r)for(let b of g)s=Math.min(s,c(b)),l=Math.max(l,c(b));if(!(l>s))return [];let u=e.steps??32,m=n(e.from),f=n(e.to),d=l-s,p=d*.002,h=[];for(let g=0;g<u;g++){let b=s+d*g/u,_=Math.min(l,s+d*(g+1)/u+(g+1<u?p:0)),y=i?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:b,y1:_}:{x0:b,x1:_,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},C=r.map(M=>ir(M,y)).filter(M=>M.length>2);C.length!==0&&h.push({type:"path",d:Hi(C),fill:Dt(m,f,(g+.5)/u),fillRule:a});}return h}function od(t,e,n){let o=ed(t,e);return typeof t.fill=="object"&&"gradient"in t.fill?rd(o,t.fill.gradient,n):[{...o,fill:n(t.fill)}]}function ad(t,e){let n=Math.min(t.maxLength??ct.maxTextLength,ct.maxTextLength),o=t.slot==="primary"?e.text??t.text:t.slot==="secondary"?e.secondaryText??t.text:t.text;return hr(o,n)}function id(t){return t===void 0||!Number.isFinite(t)?1:Math.min(be,Math.max(ln,t))}function sd(t,e,n,o){let r=ad(t,e);if(!r)return [];let a=id(e.fontScale),i=o(t.color),c=t.weight==="regular"?{fontWeight:400}:{};if(t.type==="curved"){let{cx:h,cy:g,radius:b,side:_,spread:y=140}=t.curve,C=b*n*(y*Math.PI/180),M=Math.min(t.fontSize*n*a,C/(Cn(r)+.08*r.length));return Rr(r,h*n,g*n,b*n,M,_,i,t.id).map($=>({...$,...c}))}let s=t.box.x*n,l=t.box.y*n,u=t.box.width*n,m=t.box.height*n,f=(t.fontSize??t.box.height*.52)*n,d=Math.min(f*a,m*fr,u/Cn(r)),p=t.align??"middle";return [{text:r,x:p==="start"?s:p==="end"?s+u:s+u/2,y:l+m/2+d*.35,fontSize:d,maxWidth:u,color:i,...p!=="middle"&&{align:p},...c,field:t.id}]}function sa(t,e,n){let o=aa(e.spec),r=t/o.qr.size,a=Z0(n),i=K0(e,o,a),c=o.shapes.flatMap(d=>od(d,r,i)),s=fn(o)*r;c.push({type:"rect",x:o.qr.x*r-s,y:o.qr.y*r-s,width:t+2*s,height:t+2*s,radius:(o.qr.radius??0)*r,fill:a});let l=o.labels.flatMap(d=>sd(d,e,r,i)),u=l[0],m=u&&u.rotate===void 0?u:null,f=o.bleed??"none";return {width:o.artboard.width*r,height:o.artboard.height*r,qrX:o.qr.x*r,qrY:o.qr.y*r,qrSize:t,shapes:c,label:m,extraLabels:m?l.slice(1):l,squareEdges:f!=="none",color:i(f==="none"?"frame":f)}}var uc="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",la=.08,cd="#000000",ca="#FFFFFF",mc="data-qrdx-frame-label";function Qt(t){return !!(t?.style&&t.style!=="none")}function ua(t){return t.style===kn?ia(t.spec):la}function dc(t){return (t.text??So).trim().slice(0,Xt)}function fc(t){return (t.secondaryText??"").trim().slice(0,Xt)}function ld(t){return t===void 0||!Number.isFinite(t)?1:Math.min(be,Math.max(ln,t))}function ud(t,e,n,o,r,a,i,c){if(!t)return null;let s=Math.min(o*.52*i,r/Cn(t));return {text:t,x:e,y:n+s*.35,fontSize:s,maxWidth:r,color:a,field:c}}function qe(t,e,n){if(e.style===kn)return sa(t,e,n);let o=e.color||cd,r=wt(n,gt),a=dc(e),i=t*la,c=t*.04,s=t*.22,l=t+2*(c+i),u=l-2*c,m=u-2*i,f=c+i,d=ld(e.fontScale),p=(h,g,b,_,y,C,M="text")=>ud(h,g,b,_,y,C,d,M);if(rc(e.style))return ic[e.style]({size:t,frame:e,color:o,background:r,text:a,secondaryText:fc(e),gap:i,border:c,band:s,fontScale:d,fitLabel:p});switch(e.style){case "banner-top":{let h=t+2*i;return {width:l,height:s+h+c,qrX:f,qrY:s+i,qrSize:t,shapes:[Wn(c,s,u,h,0,r),Er(le(0,0,l,s+h+c,0),le(c,s,u,h,0),o)],label:p(a,l/2,s/2,s,m,e.textColor||ca),squareEdges:true,color:o}}case "border":case "rounded-border":{let h=a?t*.18:0,g=t+(a?i+h:2*i),b=g+2*c,_=e.style==="rounded-border"?t*.1:0,y=Math.max(_-c,0);return {width:l,height:b,qrX:f,qrY:c+i,qrSize:t,shapes:[Wn(c,c,u,g,y,r),Er(le(0,0,l,b,_),le(c,c,u,g,y),o)],label:p(a,l/2,c+i+t+h/2,h,m,e.textColor||o),squareEdges:_===0,color:o}}case "speech-bubble":{let h=t*.07,g=Math.max(h-c,0),b=t*.025,_=t*.08,y=l+b+_;return {width:l,height:y+s,qrX:f,qrY:c+i,qrSize:t,shapes:[Wn(c,c,u,u,g,r),Er(le(0,0,l,l,h),le(c,c,u,u,g),o),{type:"polygon",points:[[l/2-_,y+_/2],[l/2,l+b],[l/2+_,y+_/2]],fill:o},Wn(0,y,l,s,s/2,o)],label:p(a,l/2,y+s/2,s,m,e.textColor||ca),squareEdges:false,color:o}}default:{let h=t+2*i;return {width:l,height:c+h+s,qrX:f,qrY:c+i,qrSize:t,shapes:[Wn(c,c,u,h,0,r),Er(le(0,0,l,c+h+s,0),le(c,c,u,h,0),o)],label:p(a,l/2,c+h+s/2,s,m,e.textColor||ca),squareEdges:true,color:o}}}}function le(t,e,n,o,r){return {x:t,y:e,width:n,height:o,radius:r}}function Wn(t,e,n,o,r,a){return {type:"rect",...le(t,e,n,o,r),fill:a}}function Er(t,e,n){return {type:"rect",...t,fill:n,hole:e}}function ue(t,e){if(!Qt(e))return {width:t,height:t};let{width:n,height:o}=qe(t,e);return {width:n,height:o}}var rt=t=>it(t,2);function lc({x:t,y:e,width:n,height:o,radius:r}){let a=rt(Math.min(r,n/2,o/2)),[i,c,s,l]=[rt(t),rt(e),rt(n),rt(o)];return a<=0?A`M${i} ${c}h${s}v${l}h${-s}z`:A`M${i+a} ${c}h${rt(s-2*a)}a${a} ${a} 0 0 1 ${a} ${a}`+A`v${rt(l-2*a)}a${a} ${a} 0 0 1 ${-a} ${a}`+A`h${rt(-(s-2*a))}a${a} ${a} 0 0 1 ${-a} ${-a}`+A`v${rt(-(l-2*a))}a${a} ${a} 0 0 1 ${a} ${-a}z`}function md(t,e){return t.type==="rect"&&t.hole?E("path",{d:lc(t)+lc(t.hole),fill:t.fill,fillRule:"evenodd"},e):t.type==="polygon"?E("polygon",{fill:t.fill,points:t.points.map(([n,o])=>`${rt(n)},${rt(o)}`).join(" ")},e):t.type==="path"?E("path",{d:t.d,fill:t.fill,...t.fillRule==="evenodd"&&{fillRule:"evenodd"}},e):E("rect",{fill:t.fill,height:rt(t.height),width:rt(t.width),x:rt(t.x),y:rt(t.y),...t.radius>0&&{rx:rt(t.radius),ry:rt(t.radius)}},e)}function Ar(t,e){let{size:n,frame:o,bgColor:r,svgProps:a,markLabels:i}=e,c=qe(n,o,r),s=hc(c),l=rt(c.width),u=rt(c.height);return ut("svg",{height:u,viewBox:`0 0 ${l} ${u}`,width:l,xmlns:"http://www.w3.org/2000/svg",...a,children:[E("g",{"data-qrdx-frame":o.style,children:c.shapes.map((m,f)=>md(m,f))}),hn(t,{x:rt(c.qrX),y:rt(c.qrY),width:n,height:n}),s.map((m,f)=>E("text",{"data-max-width":rt(m.maxWidth),fill:m.color,fontFamily:uc,fontSize:rt(m.fontSize),fontWeight:m.fontWeight??700,textAnchor:m.align??"middle",x:rt(m.x),y:rt(m.y),...m.rotate&&{transform:`rotate(${rt(m.rotate)} ${rt(m.x)} ${rt(m.y)})`},...i&&m.field&&{[mc]:m.field},children:m.text},f))]})}function hc(t){return [...t.label?[t.label]:[],...t.extraLabels??[]]}var dd={2:6,3:12};function pc(t){let e=[t.start],n=t.start;for(let o of t.segments){let r=o.at(-1);if(o.length===1)e.push(r);else {let a=dd[o.length];for(let i=1;i<=a;i++){let c=i/a,s=1-c;if(o.length===2){let[l]=o;e.push([s*s*n[0]+2*s*c*l[0]+c*c*r[0],s*s*n[1]+2*s*c*l[1]+c*c*r[1]]);}else {let[l,u]=o;e.push([s*s*s*n[0]+3*s*s*c*l[0]+3*s*c*c*u[0]+c*c*c*r[0],s*s*s*n[1]+3*s*s*c*l[1]+3*s*c*c*u[1]+c*c*c*r[1]]);}}}n=r;}return e}function bc(t,e){let n=[];for(let o of t)for(let r=0;r<o.length;r++){let[a,i]=o[r],[c,s]=o[(r+1)%o.length];i<=e!=s<=e&&n.push(a+(e-i)/(s-i)*(c-a));}return n.sort((o,r)=>o-r)}function _c(t,e){let n=0;for(let o of t)if(o<e)n++;else break;return n%2===1}function fd(t,e,n){return _c(bc(t,n),e)}function yc(t){let e=new Map;return (n,o)=>{let r=e.get(o);return r||(r=bc(t,o),e.set(o,r)),_c(r,n)}}function hd(t,e,n,o){let r=n[0]-t,a=n[1]-e,i=o[0]-n[0],c=o[1]-n[1],s=u=>Math.max(Math.abs(r+u*i),Math.abs(a+u*c)),l=Math.min(s(0),s(1));for(let[u,m]of [[a-r,i-c],[-(r+a),i+c]])if(m!==0){let f=u/m;f>0&&f<1&&(l=Math.min(l,s(f)));}return l}function pd(t,e,n){if(!fd(t,e,n))return 0;let o=Number.POSITIVE_INFINITY;for(let r of t)for(let a=0;a<r.length;a++)o=Math.min(o,hd(e,n,r[a],r[(a+1)%r.length]));return Number.isFinite(o)?o:0}function gd(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let a of t)for(let[i,c]of a)e=Math.min(e,i),n=Math.min(n,c),o=Math.max(o,i),r=Math.max(r,c);return {x0:e,y0:n,x1:o,y1:r}}function xc(t){let e=t.map(pc),n=gd(e),o=n.x1-n.x0,r=n.y1-n.y0;if(!(o>0&&r>0))return null;let a=(p,h)=>{let g=Math.max(p-n.x0,n.x1-p,h-n.y0,n.y1-h);return g>0?pd(e,p,h)/(2*g):0},i={cx:n.x0+o/2,cy:n.y0+r/2,value:0};i.value=a(i.cx,i.cy);let c=32;for(let p=1;p<c;p++)for(let h=1;h<c;h++){let g=n.x0+o*h/c,b=n.y0+r*p/c,_=a(g,b);_>i.value&&(i={cx:g,cy:b,value:_});}let s=o/c,l=r/c;for(let p=0;p<6;p++){let h=i;for(let g=-2;g<=2;g++)for(let b=-2;b<=2;b++){let _=h.cx+s*b/2,y=h.cy+l*g/2,C=a(_,y);C>i.value&&(i={cx:_,cy:y,value:C});}s/=2,l/=2;}if(i.value<=0)return null;let m=.5/Math.max(i.cx-n.x0,n.x1-i.cx,i.cy-n.y0,n.y1-i.cy),f=([p,h])=>[.5+(p-i.cx)*m,.5+(h-i.cy)*m],d=t.map(p=>({start:f(p.start),segments:p.segments.map(h=>h.map(f))}));return {rings:d,polygons:d.map(pc),half:i.value}}function $c(t,e){let n=([r,a])=>`${x(r*e)} ${x(a*e)}`,o="";for(let r of t.rings){o+=`M${n(r.start)}`;for(let a of r.segments){let i=a.length===1?"L":a.length===2?"Q":"C";o+=i+a.map(n).join(" ");}o+="Z";}return o}var bd={start:[0,-0.58],segments:[[[.2,-0.92],[1,-0.97],[1,-0.3]],[[1,.3],[.62,.6],[0,.92]],[[-0.62,.6],[-1,.3],[-1,-0.3]],[[-1,-0.97],[-0.2,-0.92],[0,-0.58]]]},gc;function Sc(){return gc??=xc([bd]),gc}function _d(t){let{width:e,height:n,cells:o}=t;return Number.isInteger(e)&&Number.isInteger(n)&&e>=te&&n>=te&&e<=qt&&n<=qt&&typeof o=="string"&&o.length===e*n&&/^[01]*$/.test(o)?(r,a)=>r>=0&&a>=0&&r<e&&a<n&&o[a*e+r]==="1":null}var me=([t,e])=>`${t},${e}`;function yd(t,e,n){let o=(s,l)=>t(s-1,l-1),r=new Map,a=(s,l)=>{for(let[u,m]of [[s,l],[l,s]]){let f=r.get(me(u))??[];f.push(m),r.set(me(u),f);}};for(let s=0;s<=n;s++)for(let l=0;l<=e;l++){let u=o(l,s),m=o(l+1,s),f=o(l+1,s+1),d=o(l,s+1),p=[l,s-.5],h=[l+.5,s],g=[l,s+.5],b=[l-.5,s];switch((u?8:0)+(m?4:0)+(f?2:0)+(d?1:0)){case 1:case 14:a(b,g);break;case 2:case 13:a(g,h);break;case 3:case 12:a(b,h);break;case 4:case 11:a(p,h);break;case 6:case 9:a(p,g);break;case 7:case 8:a(b,p);break;case 5:a(p,h),a(b,g);break;case 10:a(b,p),a(g,h);break;}}let i=[],c=new Set;for(let[s,l]of r){if(c.has(s)||l.length===0)continue;let[u,m]=s.split(",").map(Number),f=[[u,m]];c.add(s);let d=[u,m],p=l[0];for(;!c.has(me(p));){c.add(me(p)),f.push(p);let h=xd(r.get(me(p))??[],d,c);if(!h)break;d=p,p=h;}f.length>=3&&i.push($d(f));}return i}function xd(t,e,n){let o=me(e);return t.find(r=>me(r)!==o&&!n.has(me(r)))??t.find(r=>me(r)!==o)}function $d(t){let e=[];for(let n=0;n<t.length;n++){let o=t[(n-1+t.length)%t.length],r=t[n],a=t[(n+1)%t.length],i=(r[0]-o[0])*(a[1]-r[1])-(r[1]-o[1])*(a[0]-r[0]);Math.abs(i)>1e-9&&e.push(r);}return e.length>=3?e:t}function Sd(t){let e=(a,i)=>[(a[0]+i[0])/2,(a[1]+i[1])/2],n=t.length,o=e(t[n-1],t[0]),r=t.map((a,i)=>[a,e(a,t[(i+1)%n])]);return {start:o,segments:r}}var Hn=new Map;function ma(t){let e=`${t.width}x${t.height}:${t.cells}`,n=Hn.get(e);if(n)return n;let o=_d(t),r;if(!o)r={outline:null,problem:"invalid"};else if(t.cells.includes("1")){let a=yd(o,t.width,t.height),i=a.length>0?xc(a.map(Sd)):null;r=i&&2*i.half>=Oo?{outline:i,problem:null}:{outline:null,problem:i?"thin":"empty"};}else r={outline:null,problem:"empty"};return Hn.size>16&&Hn.delete(Hn.keys().next().value),Hn.set(e,r),r}var Cd=1,Cc=.5,Mc=.5,Md=.5;function ze(t){return Math.max(t,No)}function Pr(t){return t==="heart"?Sc():typeof t=="object"&&t?.type==="silhouette"?ma(t).outline:null}function da(t){return t==="circle"||Pr(t)!==null}var wd={invalid:"This silhouette isn't a valid shape grid.",empty:"No shape found: use a picture with a dark or opaque shape on a light or clear background.",thin:"This shape is too thin to hold the code with its quiet zone. Try a rounder, fuller shape."};function Rd(t){let{outline:e,problem:n}=ma(t);if(e&&!n)return {ok:true,share:2*e.half};let o=n??"invalid";return {ok:false,reason:o,message:wd[o]}}function It(t,e,n){if(n==="circle"){let i=ze(e),c=(t/2+i)*Math.SQRT2+Cd;return Math.ceil(c-t/2)}let o=Pr(n);if(!o)return e;let r=ze(e),a=(t+2*(r+Md))/(2*o.half);return Math.ceil((a-t)/2-1e-9)}function wc(t){let e=t>>>0;return ()=>{e=e+1831565813>>>0;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function Ed(t,e,n){let o=It(e,n,"circle"),r=ze(n),a=e+2*o,i=a/2,c=i-Cc-.5,s=wc(Number.parseInt(Ue(t),36)||1),l=o-r,u=o+e+r;return Array.from({length:a},(m,f)=>Array.from({length:a},(d,p)=>{let h=s()<Mc;return p>=l&&p<u&&f>=l&&f<u?false:h&&Math.hypot(p+.5-i,f+.5-i)<=c}))}var Ad=Array.from({length:8},(t,e)=>{let n=e*Math.PI/4;return [Math.cos(n),Math.sin(n)]});function Rc(t,e,n,o){if(o==="circle")return Ed(t,e,n);let r=Pr(o);if(!r)return null;let a=It(e,n,o),i=ze(n),c=e+2*a,s=yc(r.polygons),l=.5+Cc,u=(p,h)=>{let g=p+.5,b=h+.5;return s(g/c,b/c)?Ad.every(([_,y])=>s((g+_*l)/c,(b+y*l)/c)):false},m=wc(Number.parseInt(Ue(t),36)||1),f=a-i,d=a+e+i;return Array.from({length:c},(p,h)=>Array.from({length:c},(g,b)=>{let _=m()<Mc;return b>=f&&b<d&&h>=f&&h<d?false:_&&u(b,h)}))}function fa(t,e){if(t==="circle")return {circle:e/2};let n=Pr(t);return n?{path:$c(n,e)}:null}function Pd(t,e){let n=fa(t,e);return n?"circle"in n?W(e/2,e/2,n.circle):n.path:null}function vd(t){return t==="top-left"?0:t==="top-right"?1:3}function vr(t,e,n,o="circle",r="top-left"){let a=n*2,i=n,c=a/3;switch(o){case "leaf":case "leaf-reverse":case "drop":case "drop-reverse":{let s=vd(r),l=(s+2)%4,u=1.3*c,m=.7*c,f=p=>{switch(o){case "leaf":return p===s||p===l;case "leaf-reverse":return !(p===s||p===l);case "drop":return p===s;default:return p===l}},d=[0,1,2,3].map(p=>f(p)?m:u);return E("path",{d:D(t-n,e-n,a,a,d)})}case "extra-rounded":return E("path",{d:D(t-n,e-n,a,a,1.15*c)});case "plus":{let s=1.15*c,l=n;return E("path",{d:J([[t-s,e-l],[t+s,e-l],[t+s,e-s],[t+l,e-s],[t+l,e+s],[t+s,e+s],[t+s,e+l],[t-s,e+l],[t-s,e+s],[t-l,e+s],[t-l,e-s],[t-s,e-s]])})}case "cross-rounded":{let s=1.15*c,l=.5*c;return E("path",{d:D(t-n,e-s,a,2*s,l)+D(t-s,e-n,2*s,a,l)})}case "hexagon":return E("path",{d:J(_n(t,e,1.72*c,6))});case "octagon":return E("path",{d:J(_n(t,e,n/Math.cos(Math.PI/8),8,22.5))});case "flower":{let s=.6*c,l=.9*c;return E("path",{d:W(t-s,e-s,l)+W(t+s,e-s,l)+W(t+s,e+s,l)+W(t-s,e+s,l)+W(t,e,1.2*c)})}case "heart":return E("path",{d:xn(t,e+.12*c,3.5*c)});case "squircle":return E("path",{d:J(Un(t,e,n,n,4,64))});case "dots":{let s=[];for(let l of [-1,0,1])for(let u of [-1,0,1])s.push(W(t+u*c*.82,e+l*c*.82,.58*c));return E("path",{d:s.join("")})}case "square":return E("rect",{height:x(a),transform:A`rotate(0,${t},${e})`,width:x(a),x:x(t-i),y:x(e-i)});case "rounded":return E("rect",{height:x(a),rx:x(n*.5),ry:x(n*.5),transform:A`rotate(0,${t},${e})`,width:x(a),x:x(t-i),y:x(e-i)});case "diamond":return E("path",{d:A`M ${t-i*.714286} ${e-i*.714286}v ${a*.714286}h ${a*.714286}v -${a*.714286}z`,transform:A`rotate(45,${t},${e})`});case "message":{let s=a/30,l=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${l(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}`;return E("path",{clipRule:"evenodd",d:m,transform:A`rotate(0,${t},${e})`})}case "message-reverse":{let s=a/30,l=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${l(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}`;return E("path",{clipRule:"evenodd",d:m,transform:A`rotate(-180,${t},${e})`})}case "diya":{let s=a/30,l=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${l(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}H ${l(25)}z`;return E("path",{clipRule:"evenodd",d:m,transform:A`rotate(0,${t},${e})`})}case "diya-reverse":{let s=a/30,l=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${l(25)} ${u(35.714285714285715)}v ${19.285714285714285*s}h ${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} -${10.714285714285714*s}v -${19.285714285714285*s}h -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}z`;return E("path",{clipRule:"evenodd",d:m,transform:A`rotate(0,${t},${e})`})}case "rounded-triangle":{let s=a/21,l=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${l(33.57142857142857)} ${u(29.285714285714285)}h ${12.857142857142856*s}c ${4.285714285714286*s} 0 ${4.285714285714286*s} ${4.285714285714286*s} ${4.285714285714286*s} ${4.285714285714286*s}v ${12.857142857142856*s}c 0 ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s}h -${12.857142857142856*s}c -${4.285714285714286*s} 0 -${4.285714285714286*s} -${4.285714285714286*s} -${4.285714285714286*s} -${4.285714285714286*s}v -${12.857142857142856*s}c 0 -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s}z`;return E("path",{d:m,transform:A`rotate(45,${t},${e})`})}case "star":{let s=a/27,l=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${l(38.84615384615385)},${u(26.546153846153846)}c${.6692307692307691*s},-${1.0153846153846153*s},${2.215384615384615*s},-${1.0153846153846153*s},${2.884615384615384*s},0l${4.038461538461538*s},${6.069230769230768*s}c${.23076923076923075*s},${.3461538461538461*s},${.6*s},${.6*s},${1.0153846153846153*s},${.7153846153846153*s}l${7.223076923076922*s},${1.823076923076923*s}c${1.2*s},${.3*s},${1.6846153846153844*s},${1.7076923076923076*s},${.8999999999999999*s},${2.6538461538461533*s}l-${4.73076923076923*s},${5.584615384615384*s}c-${.2769230769230769*s},${.3230769230769231*s},-${.41538461538461535*s},${.7384615384615384*s},-${.3923076923076923*s},${1.1307692307692307*s}l${.4384615384615384*s},${7.199999999999999*s}c${.06923076923076922*s},${1.2*s},-${1.1769230769230767*s},${2.0769230769230766*s},-${2.3307692307692305*s},${1.6384615384615382*s}l-${6.9692307692307685*s},-${2.6076923076923073*s}c-${.3923076923076923*s},-${.16153846153846155*s},-${.8538461538461538*s},-${.16153846153846155*s},-${1.2461538461538462*s},0l-${6.9692307692307685*s},${2.6076923076923073*s}c-${1.1538461538461537*s},${.4384615384615384*s},-${2.4*s},-${.4384615384615384*s},-${2.3307692307692305*s},-${1.6384615384615382*s}l${.4384615384615384*s},-${7.199999999999999*s}c${.023076923076923075*s},-${.41538461538461535*s},-${.11538461538461538*s},-${.8307692307692307*s},-${.3923076923076923*s},-${1.1307692307692307*s}l-${4.73076923076923*s},-${5.584615384615384*s}c-${.7846153846153846*s},-${.923076923076923*s},-${.3230769230769231*s},-${2.3307692307692305*s},${.8999999999999999*s},-${2.6538461538461533*s}l${7.223076923076922*s},-${1.823076923076923*s}c${.41538461538461535*s},-${.11538461538461538*s},${.7846153846153846*s},-${.3461538461538461*s},${1.0153846153846153*s},-${.7153846153846153*s}l${4.038461538461538*s},-${6.069230769230768*s}z`;return E("path",{clipRule:"evenodd",d:m,transform:A`rotate(0,${t},${e})`})}case "banner":{let s=a/28;return E("g",{transform:A`translate(${t-40*s},${e-40*s}) scale(${x(s,6)})`,children:E("path",{clipRule:"evenodd",d:"M38.235 26.104C38.759 25.677, 39.51 25.677, 40.034 26.104L41.776 27.52C42.091 27.777, 42.501 27.887, 42.902 27.822L45.118 27.466C45.785 27.359, 46.436 27.735, 46.677 28.366L47.477 30.464C47.621 30.843, 47.921 31.143, 48.301 31.288L50.399 32.088C51.03 32.328, 51.406 32.979, 51.298 33.646L50.942 35.863C50.878 36.264, 50.988 36.674, 51.244 36.989L52.661 38.73C53.087 39.254, 53.087 40.006, 52.661 40.53L51.244 42.271C50.988 42.587, 50.878 42.996, 50.942 43.397L51.298 45.614C51.406 46.281, 51.03 46.932, 50.399 47.173L48.301 47.972C47.921 48.117, 47.621 48.417, 47.477 48.797L46.677 50.894C46.436 51.526, 45.785 51.901, 45.118 51.794L42.902 51.438C42.501 51.374, 42.091 51.483, 41.776 51.74L40.034 53.157C39.51 53.583, 38.759 53.583, 38.235 53.157L36.493 51.74C36.178 51.483, 35.768 51.374, 35.367 51.438L33.15 51.794C32.483 51.901, 31.833 51.526, 31.592 50.894L30.792 48.797C30.647 48.417, 30.347 48.117, 29.968 47.972L27.87 47.173C27.239 46.932, 26.863 46.281, 26.97 45.614L27.326 43.397C27.391 42.996, 27.281 42.587, 27.025 42.271L25.608 40.53C25.182 40.006, 25.182 39.254, 25.608 38.73L27.025 36.989C27.281 36.674, 27.391 36.264, 27.326 35.863L26.97 33.646C26.863 32.979, 27.239 32.328, 27.87 32.088L29.968 31.288C30.347 31.143, 30.647 30.843, 30.792 30.464L31.592 28.366C31.833 27.735, 32.483 27.359, 33.15 27.466L35.367 27.822C35.768 27.887, 36.178 27.777, 36.493 27.52L38.235 26.104Z"})})}default:return E("circle",{cx:x(t),cy:x(e),r:x(n),transform:A`rotate(0,${t},${e})`})}}function Mn(t,e,n,o){let r=t==="top-left"?0:t==="top-right"?1:3,a=(r+2)%4;return [0,1,2,3].map(i=>i===r||o&&i===a?n:e)}function Ec(t,e,n,o){return [[t+o,e],[t+n-o,e],[t+n,e+o],[t+n,e+n-o],[t+n-o,e+n],[t+o,e+n],[t,e+n-o],[t,e+o]]}function Ac(t,e,n,o){let r=n/7,a=Math.max(0,(o+Math.SQRT2-2)*r);return J(Ec(t,e,n,o*r))+J(Ec(t+r,e+r,5*r,a))}function Pc(t,e,n,o,r=false){let a=n/7,i=c=>r?Mn(o,0,c,true):Mn(o,c,0,true);return D(t,e,n,n,i(2.5*a))+D(t+a,e+a,5*a,5*a,i(1.5*a))}function Ld(t,e,n,o){let r=n/7;return D(t,e,n,n,Mn(o,2.6*r,0,false))+D(t+r,e+r,5*r,5*r,Mn(o,1.6*r,0,false))}function Id(t,e,n){let o=n/7,r=t+n/2,a=e+n/2;return J(Un(r,a,3.5*o,3.5*o,4,96))+J(Un(r,a,2.5*o,2.5*o,4,96))}function vc(t,e,n,o,r){let a=o,i=n/2,c=(i-a)*.55,s=(l,u)=>A`${t+l} ${e+u}`;return A`M${s(a,0)}`+A`C${s(a+c,0)} ${s(i-c,r)} ${s(i,r)}`+A`C${s(i+c,r)} ${s(n-a-c,0)} ${s(n-a,0)}`+A`A${a} ${a} 0 0 1 ${s(n,a)}`+A`C${s(n,a+c)} ${s(n-r,i-c)} ${s(n-r,i)}`+A`C${s(n-r,i+c)} ${s(n,n-a-c)} ${s(n,n-a)}`+A`A${a} ${a} 0 0 1 ${s(n-a,n)}`+A`C${s(n-a-c,n)} ${s(i+c,n-r)} ${s(i,n-r)}`+A`C${s(i-c,n-r)} ${s(a+c,n)} ${s(a,n)}`+A`A${a} ${a} 0 0 1 ${s(0,n-a)}`+A`C${s(0,n-a-c)} ${s(r,i+c)} ${s(r,i)}`+A`C${s(r,i-c)} ${s(0,a+c)} ${s(0,a)}`+A`A${a} ${a} 0 0 1 ${s(a,0)}Z`}function Td(t,e,n){let o=n/7,r=.12*o;return vc(t,e,n,1.4*o,r)+vc(t+o,e+o,5*o,.7*o,r)}function Lc(t,e,n,o,r,a){let i=n/2,c=(s,l)=>A`${t+s} ${e+l}`;return A`M${c(o,0)}H${t+n-o}`+A`A${o} ${o} 0 0 1 ${c(n,o)}`+A`V${e+r}`+A`C${c(n,r+1.55*a)} ${c(i+1.6*a,n)} ${c(i,n)}`+A`C${c(i-1.6*a,n)} ${c(0,r+1.55*a)} ${c(0,r)}`+A`V${e+o}A${o} ${o} 0 0 1 ${c(o,0)}Z`}function Fd(t,e,n){let o=n/7;return Lc(t,e,n,.7*o,3.9*o,o)+Lc(t+o,e+o,5*o,.35*o,2.7*o,.8*o)}function kd(t,e,n,o){let r=n/7;return D(t,e,n,n,Mn(o,.5*r,2.5*r,false))+D(t+r,e+r,5*r,5*r,Mn(o,.25*r,1.5*r,false))}function Nd(t,e,n){let o=n/7;return A`M ${t} ${e}v ${n}h ${n}v -${n}z`+A`M ${t+o} ${e+o}h ${5*o}v ${5*o}h -${5*o}z`}function Od(t,e,n){let o=n/7,r=o*.875,a=o*.4375,i=A`M ${t+r} ${e}`+A`h ${n-2*r}`+A`a ${r} ${r} 0 0 1 ${r} ${r}`+A`v ${n-2*r}`+A`a ${r} ${r} 0 0 1 ${-r} ${r}`+A`h ${-(n-2*r)}`+A`a ${r} ${r} 0 0 1 ${-r} ${-r}`+A`v ${-(n-2*r)}`+A`a ${r} ${r} 0 0 1 ${r} ${-r}z`,c=A`M ${t+o+a} ${e+o}`+A`h ${5*o-2*a}`+A`a ${a} ${a} 0 0 1 ${a} ${a}`+A`v ${5*o-2*a}`+A`a ${a} ${a} 0 0 1 ${-a} ${a}`+A`h ${-(5*o-2*a)}`+A`a ${a} ${a} 0 0 1 ${-a} ${-a}`+A`v ${-(5*o-2*a)}`+A`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+c}function Dd(t,e,n){let o=t+n/2,r=e+n/2,a=it(n/2),i=it(n*(2.5/7));return A`M ${o-a} ${r}`+A`a ${a} ${a} 0 1 0 ${a*2} 0`+A`a ${a} ${a} 0 1 0 ${-a*2} 0z`+A`M ${o-i} ${r}`+A`a ${i} ${i} 0 1 1 ${i*2} 0`+A`a ${i} ${i} 0 1 1 ${-i*2} 0z`}function Qd(t,e,n){let o=n/74.7002,r=c=>c*o+t,a=c=>c*o+e;return A`M${r(37.3496)} ${a(0)}C${r(39.2939)} ${a(0)} ${r(40.9948)} ${a(1.03842)} ${r(41.9287)} ${a(2.59082)}C${r(43.2293)} ${a(1.34013)} ${r(45.1347)} ${a(.780267)} ${r(47.0098)} ${a(1.28027)}C${r(48.8871)} ${a(1.78928)} ${r(50.261)} ${a(3.23767)} ${r(50.7578)} ${a(4.98438)}C${r(52.3454)} ${a(4.0996)} ${r(54.3432)} ${a(4.047)} ${r(56.0303)} ${a(5.01953)}C${r(57.7094)} ${a(5.98752)} ${r(58.6586)} ${a(7.73647)} ${r(58.6924)} ${a(9.5459)}C${r(60.4517)} ${a(9.10661)} ${r(62.3883)} ${a(9.57215)} ${r(63.7598)} ${a(10.9502)}C${r(65.1282)} ${a(12.3253)} ${r(65.5963)} ${a(14.2585)} ${r(65.1641)} ${a(16.0127)}C${r(66.974)} ${a(16.044)} ${r(68.7242)} ${a(16.9982)} ${r(69.7002)} ${a(18.6797)}C${r(70.6781)} ${a(20.3647)} ${r(70.6241)} ${a(22.3635)} ${r(69.7402)} ${a(23.9502)}C${r(71.4776)} ${a(24.4496)} ${r(72.9194)} ${a(25.8232)} ${r(73.4199)} ${a(27.7002)}C${r(73.927)} ${a(29.5707)} ${r(73.3661)} ${a(31.4794)} ${r(72.1104)} ${a(32.7822)}C${r(73.6621)} ${a(33.7163)} ${r(74.7002)} ${a(35.4166)} ${r(74.7002)} ${a(37.3604)}C${r(74.7001)} ${a(39.307)} ${r(73.6582)} ${a(41.0084)} ${r(72.1025)} ${a(41.9414)}C${r(73.357)} ${a(43.245)} ${r(73.9207)} ${a(45.1525)} ${r(73.4199)} ${a(47.0303)}C${r(72.9187)} ${a(48.9027)} ${r(71.4782)} ${a(50.2735)} ${r(69.7383)} ${a(50.7734)}C${r(70.6201)} ${a(52.3601)} ${r(70.6716)} ${a(54.3549)} ${r(69.7002)} ${a(56.04)}C${r(68.7237)} ${a(57.7225)} ${r(66.9721)} ${a(58.6729)} ${r(65.1611)} ${a(58.7031)}C${r(65.598)} ${a(60.4623)} ${r(65.131)} ${a(62.3982)} ${r(63.7598)} ${a(63.7695)}C${r(62.3847)} ${a(65.138)} ${r(60.4515)} ${a(65.6061)} ${r(58.6973)} ${a(65.1738)}C${r(58.6635)} ${a(66.9833)} ${r(57.7094)} ${a(68.7322)} ${r(56.0303)} ${a(69.7002)}C${r(54.3461)} ${a(70.6777)} ${r(52.348)} ${a(70.6248)} ${r(50.7617)} ${a(69.7422)}C${r(50.2643)} ${a(71.4831)} ${r(48.8896)} ${a(72.9284)} ${r(47.0098)} ${a(73.4297)}C${r(45.1389)} ${a(73.9368)} ${r(43.2296)} ${a(73.3763)} ${r(41.9268)} ${a(72.1201)}C${r(40.9927)} ${a(73.6717)} ${r(39.2932)} ${a(74.71)} ${r(37.3496)} ${a(74.71)}C${r(35.4051)} ${a(74.7098)} ${r(33.7042)} ${a(73.6711)} ${r(32.7705)} ${a(72.1182)}C${r(31.4697)} ${a(73.3758)} ${r(29.5597)} ${a(73.9418)} ${r(27.6797)} ${a(73.4404)}V${a(73.4502)}C${r(25.8065)} ${a(72.9422)} ${r(24.434)} ${a(71.4985)} ${r(23.9346)} ${a(69.7568)}C${r(22.3504)} ${a(70.6301)} ${r(20.3591)} ${a(70.6781)} ${r(18.6797)} ${a(69.71)}C${r(16.9957)} ${a(68.7391)} ${r(16.045)} ${a(66.9831)} ${r(16.0166)} ${a(65.168)}C${r(14.2547)} ${a(65.6091)} ${r(12.3134)} ${a(65.1435)} ${r(10.9395)} ${a(63.7695)}C${r(9.5687)} ${a(62.3919)} ${r(9.10168)} ${a(60.454)} ${r(9.53809)} ${a(58.6973)}C${r(7.72791)} ${a(58.6641)} ${r(5.97815)} ${a(57.71)} ${r(5.00977)} ${a(56.0303)}C${r(4.03552)} ${a(54.3517)} ${r(4.08377)} ${a(52.3649)} ${r(4.95801)} ${a(50.7812)}C${r(3.21705)} ${a(50.2839)} ${r(1.77087)} ${a(48.9101)} ${r(1.26953)} ${a(47.0303)}V${a(47.0205)}C${r(.762081)} ${a(45.1489)} ${r(1.32758)} ${a(43.2375)} ${r(2.58496)} ${a(41.9346)}C${r(1.03604)} ${a(41)} ${r(108484e-9)} ${a(39.3019)} ${r(0)} ${a(37.3604)}C${r(0)} ${a(35.4159)} ${r(1.03815)} ${a(33.7141)} ${r(2.59082)} ${a(32.7803)}C${r(1.34044)} ${a(31.4797)} ${r(.780389)} ${a(29.575)} ${r(1.28027)} ${a(27.7002)}C${r(1.78258)} ${a(25.8232)} ${r(3.22806)} ${a(24.4482)} ${r(4.97363)} ${a(23.9512)}C${r(4.08938)} ${a(22.3638)} ${r(4.03743)} ${a(20.3664)} ${r(5.00977)} ${a(18.6797)}C${r(5.97815)} ${a(16.9999)} ${r(7.72788)} ${a(16.0496)} ${r(9.53809)} ${a(16.0166)}C${r(9.10139)} ${a(14.2576)} ${r(9.56846)} ${a(12.3214)} ${r(10.9395)} ${a(10.9502)}C${r(12.3171)} ${a(9.57911)} ${r(14.2558)} ${a(9.11137)} ${r(16.0127)} ${a(9.54785)}C${r(16.0426)} ${a(7.73421)} ${r(16.9969)} ${a(5.97989)} ${r(18.6797)} ${a(5.00977)}C${r(20.3596)} ${a(4.03474)} ${r(22.3521)} ${a(4.08468)} ${r(23.9365)} ${a(4.96094)}C${r(24.4378)} ${a(3.22749)} ${r(25.8059)} ${a(1.7898)} ${r(27.6797)} ${a(1.29004)}C${r(29.5511)} ${a(.78264)} ${r(31.4617)} ${a(1.34357)} ${r(32.7646)} ${a(2.60059)}C${r(33.6971)} ${a(1.04268)} ${r(35.4013)} ${a(152405e-9)} ${r(37.3496)} ${a(0)}ZM${r(41.0615)} ${a(9.17578)}C${r(40.1006)} ${a(10.1057)} ${r(38.793)} ${a(10.6797)} ${r(37.3496)} ${a(10.6797)}C${r(35.9064)} ${a(10.6796)} ${r(34.5985)} ${a(10.1066)} ${r(33.6377)} ${a(9.17676)}C${r(32.9511)} ${a(10.3241)} ${r(31.8358)} ${a(11.2176)} ${r(30.4404)} ${a(11.5898)}C${r(29.0527)} ${a(11.9661)} ${r(27.6436)} ${a(11.7542)} ${r(26.4766)} ${a(11.1074)}C${r(26.1072)} ${a(12.3879)} ${r(25.2629)} ${a(13.5333)} ${r(24.0195)} ${a(14.25)}C${r(22.7695)} ${a(14.9754)} ${r(21.347)} ${a(15.1322)} ${r(20.0479)} ${a(14.8047)}C${r(20.0289)} ${a(16.1454)} ${r(19.5108)} ${a(17.4793)} ${r(18.4902)} ${a(18.5)}C${r(17.4696)} ${a(19.5158)} ${r(16.1409)} ${a(20.033)} ${r(14.8066)} ${a(20.0566)}C${r(15.1312)} ${a(21.3534)} ${r(14.9738)} ${a(22.7723)} ${r(14.25)} ${a(24.0195)}C${r(13.5243)} ${a(25.2699)} ${r(12.3701)} ${a(26.1148)} ${r(11.082)} ${a(26.4795)}C${r(11.7347)} ${a(27.6479)} ${r(11.9529)} ${a(29.062)} ${r(11.5801)} ${a(30.46)}C${r(11.2085)} ${a(31.8485)} ${r(10.3194)} ${a(32.9607)} ${r(9.17578)} ${a(33.6475)}C${r(10.106)} ${a(34.6084)} ${r(10.6797)} ${a(35.9167)} ${r(10.6797)} ${a(37.3604)}C${r(10.6796)} ${a(38.805)} ${r(10.1053)} ${a(40.1141)} ${r(9.17383)} ${a(41.0752)}C${r(10.3132)} ${a(41.7614)} ${r(11.1999)} ${a(42.871)} ${r(11.5703)} ${a(44.2598)}C${r(11.946)} ${a(45.6504)} ${r(11.7335)} ${a(47.0592)} ${r(11.0889)} ${a(48.2266)}C${r(12.377)} ${a(48.593)} ${r(13.5297)} ${a(49.441)} ${r(14.25)} ${a(50.6904)}C${r(14.9754)} ${a(51.9405)} ${r(15.1322)} ${a(53.3629)} ${r(14.8047)} ${a(54.6621)}C${r(16.142)} ${a(54.6835)} ${r(17.4721)} ${a(55.2016)} ${r(18.4902)} ${a(56.2197)}C${r(19.5097)} ${a(57.2441)} ${r(20.0278)} ${a(58.5787)} ${r(20.0479)} ${a(59.918)}C${r(21.3469)} ${a(59.5917)} ${r(22.7696)} ${a(59.7493)} ${r(24.0195)} ${a(60.4697)}C${r(25.2676)} ${a(61.1892)} ${r(26.1117)} ${a(62.3406)} ${r(26.4775)} ${a(63.627)}C${r(27.6424)} ${a(62.9822)} ${r(29.0498)} ${a(62.7688)} ${r(30.4404)} ${a(63.1396)}C${r(31.8284)} ${a(63.5112)} ${r(32.9402)} ${a(64.3999)} ${r(33.627)} ${a(65.543)}C${r(34.5887)} ${a(64.6072)} ${r(35.9012)} ${a(64.0304)} ${r(37.3496)} ${a(64.0303)}C${r(38.7912)} ${a(64.0303)} ${r(40.098)} ${a(64.6023)} ${r(41.0586)} ${a(65.5303)}C${r(41.7458)} ${a(64.3887)} ${r(42.8594)} ${a(63.5007)} ${r(44.25)} ${a(63.1299)}C${r(45.643)} ${a(62.7522)} ${r(47.057)} ${a(62.9676)} ${r(48.2266)} ${a(63.6201)}C${r(48.5931)} ${a(62.3323)} ${r(49.4413)} ${a(61.1801)} ${r(50.6904)} ${a(60.46)}C${r(51.9373)} ${a(59.7364)} ${r(53.3558)} ${a(59.5781)} ${r(54.6523)} ${a(59.9023)}C${r(54.6744)} ${a(58.5659)} ${r(55.1925)} ${a(57.2372)} ${r(56.21)} ${a(56.2197)}C${r(57.2339)} ${a(55.2007)} ${r(58.5676)} ${a(54.6816)} ${r(59.9062)} ${a(54.6611)}C${r(59.5835)} ${a(53.3649)} ${r(59.7414)} ${a(51.9468)} ${r(60.46)} ${a(50.7002)}C${r(61.1797)} ${a(49.4517)} ${r(62.3312)} ${a(48.6068)} ${r(63.6182)} ${a(48.2412)}C${r(62.9651)} ${a(47.0726)} ${r(62.7473)} ${a(45.658)} ${r(63.1201)} ${a(44.2598)}C${r(63.4916)} ${a(42.8718)} ${r(64.3794)} ${a(41.7591)} ${r(65.5225)} ${a(41.0723)}C${r(64.5929)} ${a(40.1115)} ${r(64.0206)} ${a(38.8033)} ${r(64.0205)} ${a(37.3604)}C${r(64.0205)} ${a(35.9186)} ${r(64.5915)} ${a(34.611)} ${r(65.5195)} ${a(33.6504)}C${r(64.3785)} ${a(32.9631)} ${r(63.4908)} ${a(31.8501)} ${r(63.1201)} ${a(30.46)}C${r(62.7421)} ${a(29.0656)} ${r(62.9572)} ${a(27.6498)} ${r(63.6113)} ${a(26.4795)}C${r(62.3272)} ${a(26.1115)} ${r(61.1784)} ${a(25.2657)} ${r(60.46)} ${a(24.0195)}C${r(59.7364)} ${a(22.7727)} ${r(59.5781)} ${a(21.3541)} ${r(59.9023)} ${a(20.0576)}C${r(58.5626)} ${a(20.038)} ${r(57.23)} ${a(19.52)} ${r(56.21)} ${a(18.5)}C${r(55.1931)} ${a(17.4783)} ${r(54.675)} ${a(16.1482)} ${r(54.6523)} ${a(14.8125)}C${r(53.3557)} ${a(15.1357)} ${r(51.9374)} ${a(14.9785)} ${r(50.6904)} ${a(14.2598)}C${r(49.4399)} ${a(13.5339)} ${r(48.5931)} ${a(12.3801)} ${r(48.2285)} ${a(11.0918)}C${r(47.0603)} ${a(11.7439)} ${r(45.6474)} ${a(11.9624)} ${r(44.25)} ${a(11.5898)}V${a(11.5801)}C${r(42.8613)} ${a(11.2085)} ${r(41.7483)} ${a(10.3196)} ${r(41.0615)} ${a(9.17578)}Z`}function ha(t){let e=t/70;return {scale:e,transform:(o,r)=>(o-5)*e+r}}function Bd(t,e,n){let{scale:o,transform:r}=ha(n);return A`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}H ${r(5,t)}zM ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${35*o}z`}function Gd(t,e,n){let o=n/7,r=o*1.5,a=o*.75,i=A`M ${t+r} ${e}`+A`h ${n-2*r}`+A`a ${r} ${r} 0 0 1 ${r} ${r}`+A`v ${n-2*r}`+A`a ${r} ${r} 0 0 1 ${-r} ${r}`+A`h ${-(n-2*r)}`+A`a ${r} ${r} 0 0 1 ${-r} ${-r}`+A`v ${-(n-2*r)}`+A`a ${r} ${r} 0 0 1 ${r} ${-r}z`,c=A`M ${t+o+a} ${e+o}`+A`h ${5*o-2*a}`+A`a ${a} ${a} 0 0 1 ${a} ${a}`+A`v ${5*o-2*a}`+A`a ${a} ${a} 0 0 1 ${-a} ${a}`+A`h ${-(5*o-2*a)}`+A`a ${a} ${a} 0 0 1 ${-a} ${-a}`+A`v ${-(5*o-2*a)}`+A`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+c}function Ud(t,e,n){let{scale:o,transform:r}=ha(n);return A`M ${r(5,t)} ${r(40,e)}a ${35*o} ${35*o}, 0, 0, 0, ${35*o} ${35*o}h ${30*o}a ${5*o} ${5*o}, 0, 0, 0, ${5*o} -${5*o}v -${30*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} -${35*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} ${35*o}zM ${r(40,t)} ${r(15,e)}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} ${25*o}v ${25*o}h -${25*o}a ${25*o} ${25*o}, 0, 0, 1, -${25*o} -${25*o}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} -${25*o}z`}function qd(t,e,n){let{scale:o,transform:r}=ha(n);return A`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} ${25*o}M ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} -${15*o}z`}function zd(t,e,n){let o=n/70,r=t+n/2-40*o,a=e+n/2-40*o,i=(s,l)=>s*o+l;return A`M${i(35.19239999999999,r)} ${i(5.837547376725838,a)}C${i(37.69667692307692,r)} ${i(3.8737070690335305,a)}, ${i(41.218430769230764,r)} ${i(3.8737092228796843,a)}, ${i(43.722707692307694,r)} ${i(5.837547376725838,a)}L${i(46.62781538461539,r)} ${i(8.115648915187375,a)}L${i(50.23356923076923,r)} ${i(7.32361506903353,a)}C${i(53.342,r)} ${i(6.640824299802762,a)}, ${i(56.51483076923077,r)} ${i(8.168784299802759,a)}, ${i(57.91892307692308,r)} ${i(11.024719684418145,a)}L${i(59.54787692307692,r)} ${i(14.337679684418145,a)}L${i(63.14027692307692,r)} ${i(15.188578145956608,a)}C${i(66.23707692307693,r)} ${i(15.922091992110452,a)}, ${i(68.43270769230769,r)} ${i(18.675396607495067,a)}, ${i(68.45876923076924,r)} ${i(21.857768915187375,a)}L${i(68.48892307692307,r)} ${i(25.54931045364891,a)}L${i(71.35633846153846,r)} ${i(27.874602761341222,a)}C${i(73.82830769230769,r)} ${i(29.879187376725838,a)}, ${i(74.61187692307692,r)} ${i(33.312418145956606,a)}, ${i(73.25452307692306,r)} ${i(36.19103353057199,a)}L${i(71.68006153846153,r)} ${i(39.530141222879685,a)}L${i(73.25452307692306,r)} ${i(42.86924891518738,a)}C${i(74.61187692307692,r)} ${i(45.747864299802764,a)}, ${i(73.82830769230769,r)} ${i(49.18109506903353,a)}, ${i(71.35633846153846,r)} ${i(51.18567968441815,a)}L${i(68.48892307692307,r)} ${i(53.510971992110456,a)}L${i(68.45876923076924,r)} ${i(57.202664299802755,a)}C${i(68.43270769230769,r)} ${i(60.38497199211046,a)}, ${i(66.23707692307693,r)} ${i(63.13823353057199,a)}, ${i(63.14027692307692,r)} ${i(63.871833530572,a)}L${i(59.54787692307692,r)} ${i(64.72260276134121,a)}L${i(57.91892307692308,r)} ${i(68.03564891518737,a)}C${i(56.51483076923077,r)} ${i(70.89164891518737,a)}, ${i(53.342,r)} ${i(72.41958737672583,a)}, ${i(50.23356923076923,r)} ${i(71.7368181459566,a)}L${i(46.62781538461539,r)} ${i(70.94463353057199,a)}L${i(43.722707692307694,r)} ${i(73.22275660749506,a)}C${i(41.218430769230764,r)} ${i(75.18663353057198,a)}, ${i(37.69667692307692,r)} ${i(75.18663353057198,a)}, ${i(35.19239999999999,r)} ${i(73.22275660749506,a)}L${i(32.28729230769231,r)} ${i(70.94463353057199,a)}L${i(28.68153846153846,r)} ${i(71.7368181459566,a)}C${i(25.573215384615384,r)} ${i(72.41958737672583,a)}, ${i(22.400384615384613,r)} ${i(70.89164891518737,a)}, ${i(20.996141538461536,r)} ${i(68.03564891518737,a)}L${i(19.36720923076923,r)} ${i(64.72260276134121,a)}L${i(15.774852307692306,r)} ${i(63.871833530572,a)}C${i(12.67803076923077,r)} ${i(63.13823353057199,a)}, ${i(10.48237846153846,r)} ${i(60.38497199211046,a)}, ${i(10.45636,r)} ${i(57.202664299802755,a)}L${i(10.426163076923077,r)} ${i(53.510971992110456,a)}L${i(7.558747692307692,r)} ${i(51.18567968441815,a)}C${i(5.086880338461539,r)} ${i(49.18109506903353,a)}, ${i(4.303258769230769,r)} ${i(45.747864299802764,a)}, ${i(5.660599692307692,r)} ${i(42.86924891518738,a)}L${i(7.235153846153846,r)} ${i(39.530141222879685,a)}L${i(5.660599692307692,r)} ${i(36.19103353057199,a)}C${i(4.3032566153846155,r)} ${i(33.312418145956606,a)}, ${i(5.086885938461538,r)} ${i(29.879187376725838,a)}, ${i(7.558747692307692,r)} ${i(27.874602761341222,a)}L${i(10.426163076923077,r)} ${i(25.54931045364891,a)}L${i(10.45636,r)} ${i(21.857768915187375,a)}C${i(10.48237846153846,r)} ${i(18.67537506903353,a)}, ${i(12.678052307692308,r)} ${i(15.922091992110452,a)}, ${i(15.774852307692306,r)} ${i(15.188578145956608,a)}L${i(19.36720923076923,r)} ${i(14.337679684418145,a)}L${i(20.996141538461536,r)} ${i(11.024719684418145,a)}C${i(22.400384615384613,r)} ${i(8.168784299802759,a)}, ${i(25.573215384615384,r)} ${i(6.640824299802762,a)}, ${i(28.68153846153846,r)} ${i(7.32361506903353,a)}L${i(32.28729230769231,r)} ${i(8.115648915187375,a)}L${i(35.19239999999999,r)} ${i(5.837547376725838,a)}M${i(39.45766153846154,r)} ${i(13.665055069033532,a)}L${i(37.01498461538461,r)} ${i(15.58053506903353,a)}C${i(35.39098461538461,r)} ${i(16.854061222879682,a)}, ${i(33.282799999999995,r)} ${i(17.335251992110454,a)}, ${i(31.26701538461538,r)} ${i(16.892464299802757,a)}L${i(28.235046153846152,r)} ${i(16.22649506903353,a)}L${i(26.865415384615382,r)} ${i(19.012107376725837,a)}C${i(25.954812307692308,r)} ${i(20.864178145956608,a)}, ${i(24.264193846153844,r)} ${i(22.212399684418145,a)}, ${i(22.255926153846154,r)} ${i(22.688076607495066,a)}L${i(19.235393846153844,r)} ${i(23.40354122287968,a)}L${i(19.21,r)} ${i(26.507556607495065,a)}C${i(19.19313538461538,r)} ${i(28.57137199211045,a)}, ${i(18.25492,r)} ${i(30.519525838264297,a)}, ${i(16.651919999999997,r)} ${i(31.81937199211045,a)}L${i(14.240926153846154,r)} ${i(33.774633530572,a)}L${i(15.564830769230769,r)} ${i(36.58238737672584,a)}C${i(16.445064615384617,r)} ${i(38.44891045364892,a)}, ${i(16.445064615384617,r)} ${i(40.611371992110456,a)}, ${i(15.564830769230769,r)} ${i(42.47811045364892,a)}L${i(14.240926153846154,r)} ${i(45.28564891518738,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}L${i(13.883236923076923,r)} ${i(50.654971992110454,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}C${i(18.25492,r)} ${i(48.54075660749507,a)}, ${i(19.19313538461538,r)} ${i(50.4891258382643,a)}, ${i(19.21,r)} ${i(52.5527258382643,a)}L${i(19.235393846153844,r)} ${i(55.65684891518738,a)}L${i(22.255926153846154,r)} ${i(56.37235660749507,a)}C${i(24.264193846153844,r)} ${i(56.847925838264295,a)}, ${i(25.954812307692308,r)} ${i(58.196233530571995,a)}, ${i(26.865415384615382,r)} ${i(60.0483258382643,a)}L${i(28.235046153846152,r)} ${i(62.833895069033524,a)}L${i(31.26701538461538,r)} ${i(62.1679258382643,a)}C${i(33.282799999999995,r)} ${i(61.72509506903353,a)}, ${i(35.39098461538461,r)} ${i(62.20626429980276,a)}, ${i(37.01498461538461,r)} ${i(63.47983353057199,a)}L${i(39.45766153846154,r)} ${i(65.39524891518737,a)}L${i(41.90012307692308,r)} ${i(63.47983353057199,a)}C${i(43.524123076923075,r)} ${i(62.20626429980276,a)}, ${i(45.632307692307684,r)} ${i(61.72509506903353,a)}, ${i(47.6480923076923,r)} ${i(62.1679258382643,a)}L${i(50.68006153846154,r)} ${i(62.833895069033524,a)}L${i(52.049692307692304,r)} ${i(60.0483258382643,a)}C${i(52.960338461538456,r)} ${i(58.196233530571995,a)}, ${i(54.6508923076923,r)} ${i(56.847925838264295,a)}, ${i(56.65913846153846,r)} ${i(56.37235660749507,a)}L${i(59.67969230769231,r)} ${i(55.65684891518738,a)}L${i(59.70510769230769,r)} ${i(52.5527258382643,a)}C${i(59.72190769230769,r)} ${i(50.4891258382643,a)}, ${i(60.66012307692307,r)} ${i(48.54075660749507,a)}, ${i(62.263230769230766,r)} ${i(47.240910453648915,a)}L${i(64.67424615384616,r)} ${i(45.28564891518738,a)}L${i(63.35027692307692,r)} ${i(42.47811045364892,a)}C${i(62.47,r)} ${i(40.611371992110456,a)}, ${i(62.47,r)} ${i(38.44891045364892,a)}, ${i(63.35027692307692,r)} ${i(36.58238737672584,a)}L${i(64.67424615384616,r)} ${i(33.774633530572,a)}L${i(62.263230769230766,r)} ${i(31.81958737672584,a)}C${i(60.66012307692307,r)} ${i(30.519525838264297,a)}, ${i(59.72190769230769,r)} ${i(28.57137199211045,a)}, ${i(59.70510769230769,r)} ${i(26.507556607495065,a)}L${i(59.67969230769231,r)} ${i(23.40354122287968,a)}L${i(56.65913846153846,r)} ${i(22.688076607495066,a)}C${i(54.6508923076923,r)} ${i(22.212399684418145,a)}, ${i(52.960338461538456,r)} ${i(20.864178145956608,a)}, ${i(52.049692307692304,r)} ${i(19.012128915187375,a)}L${i(50.68006153846154,r)} ${i(16.22649506903353,a)}L${i(47.6480923076923,r)} ${i(16.892464299802757,a)}C${i(45.632307692307684,r)} ${i(17.335251992110454,a)}, ${i(43.524338461538456,r)} ${i(16.85408276134122,a)}, ${i(41.90012307692308,r)} ${i(15.58053506903353,a)}L${i(39.45766153846154,r)} ${i(13.665055069033532,a)}Z`}function Lr(t,e,n,o,r="top-left"){switch(o){case "leaf":return Pc(t,e,n,r);case "leaf-reverse":return Pc(t,e,n,r,true);case "drop":return Ld(t,e,n,r);case "octagon":return Ac(t,e,n,1.6);case "bevel":return Ac(t,e,n,1.1);case "squircle":return Id(t,e,n);case "cushion":return Td(t,e,n);case "shield":return Fd(t,e,n);case "petal":return kd(t,e,n,r);case "gear":return Qd(t,e,n);case "rounded":return Od(t,e,n);case "circle":return Dd(t,e,n);case "diya":return Bd(t,e,n);case "extra-rounded":return Gd(t,e,n);case "message":return Ud(t,e,n);case "pointy":return qd(t,e,n);case "curly":return zd(t,e,n);default:return Nd(t,e,n)}}var Ir=.22,Tr=.14;function Ic(t,e,n={}){if(t==="circle")return E("circle",{cx:x(e.x+e.w/2),cy:x(e.y+e.h/2),r:x(Math.min(e.w,e.h)/2),...n});let o=t==="rounded"?Math.min(e.w,e.h)*Ir:0;return E("rect",{height:x(e.h),width:x(e.w),x:x(e.x),y:x(e.y),...o>0&&{rx:x(o),ry:x(o)},...n})}function Wd(t,e){let n=t.w*e,o=t.h*e;return {x:t.x+n,y:t.y+o,w:t.w-2*n,h:t.h-2*o}}function Fr(t,e){let n=t.shape??"square",o=t.plate,r=o?Wd(e,Tr):e,a=c=>E("image",{height:x(r.h),href:t.src,preserveAspectRatio:"none",width:x(r.w),x:x(r.x),y:x(r.y),...c&&{clipPath:`url(#${c})`}});if(n==="square"&&!o)return a();let i=n==="square"?void 0:`qrdx-logo-${Ue(`${n}|${x(r.x)}|${x(r.y)}|${x(r.w)}|${x(r.h)}`)}`;return ut("g",{children:[o&&Ic(n,e,{fill:o}),i&&E("clipPath",{id:i,children:Ic(n,r)}),a(i)]})}var Tc=.6,Hd=["L","M","Q","H"];function Fc(t){let e=xt.QrCode.encodeText(t.value,Et[t.level]),n=Hd[e.errorCorrectionLevel.ordinal]??t.level;return {code:t,cells:e.getModules(),layoutMargin:It(e.size,t.margin,t.shape),map:Dn(e.version,n),level:n,version:e.version}}function kc(t,e){let{cells:n,map:o}=t,r=n.length,a=Re(n,t.code.size,t.layoutMargin,e);if(!a)return null;let i=a.excavation??{x:Math.floor(a.x),y:Math.floor(a.y),w:Math.ceil(a.x+a.w)-Math.floor(a.x),h:Math.ceil(a.y+a.h)-Math.floor(a.y)},c=[];for(let l=Math.max(0,i.y);l<Math.min(r,i.y+i.h);l++)for(let u=Math.max(0,i.x);u<Math.min(r,i.x+i.w);u++)c.push(l*r+u);let s=Qn(o,c);return {worst:Math.max(0,...s),correctable:o.correctable,budget:Math.floor(o.correctable*Tc),level:t.level,version:t.version}}function kr(t,e){return kc(Fc(t),e)}var Nc=t=>!t||t.worst<=t.budget;function Vd(t,e){return Nc(kr(t,e))}function pa(t,e,n,o){let r=e.map(c=>Fc({...t,level:c})),a=c=>{let s=o(c);return r.every(l=>Nc(kc(l,s)))};if(a(n))return n;let i=t.size*.005;for(let c=n-i;c>0;c-=i)if(a(c))return c;return 0}function Nr(t,e){if(!e)return;let n=Math.floor(t.size*er),o=e.width||n,r=e.height||n,a=f=>{if(f===o)return e;let d=r*f/o;return {...e,width:f,height:d,...e.x!=null&&{x:e.x+(o-f)/2},...e.y!=null&&{y:e.y+(r-d)/2}}},i=t.level??Yt,c={value:t.value,size:t.size,margin:t.margin,shape:t.shape},s=f=>Bt({...t,level:i,imageSettings:f}),l=f=>{let d=pa(c,[f],o,a);return d>0?a(d):void 0},u=s(e);if(u===i)return l(i);let m=l(u);return m&&s(m)===u?m:l(i)}var ga="data-qrdx-part",Oc="data-qrdx-eye",jd=["eye-outer","eye-centre","body","logo","background"];function ba(t,e,n){if(t)return n?{[ga]:e,[Oc]:n}:{[ga]:e}}var Dc={id:"Arrow",name:"Arrow",description:"QR code with arrow",wrapper:(t,e)=>E("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:ut("svg",{fill:"#000000",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[E("path",{d:"M73.57,175.23h0c.12-2.06.31-4.19.49-6.25s.48-4.13.85-6.13.79-4,1.27-5.95a30.21,30.21,0,0,1,1.94-5.28h0c.06-.18.13-.43.19-.67a3.55,3.55,0,0,0-2.8-4.19l-.18-.06a1.85,1.85,0,0,0-.54-.06c-.19,0-.31-.06-.49-.06s-.61-.06-.91-.06c-.61,0-1.21.06-1.82.06-1.21.12-2.37.25-3.52.43a62.08,62.08,0,0,0-6.8,1.45,58.45,58.45,0,0,0-6.43,2.31c-1,.42-2.07,1-3.1,1.4s-2,1.09-3,1.57a.76.76,0,0,0,.54,1.4h.07c1.09-.24,2.12-.55,3.15-.79s2.13-.48,3.16-.61A46,46,0,0,1,62,153c1.34-.06,2.73-.06,4.07-.06a62.58,62.58,0,0,0-7.23,10.43,85.58,85.58,0,0,0-6.55,15.36,107.86,107.86,0,0,0-5,32.53,104.06,104.06,0,0,0,5,32.29,90.47,90.47,0,0,0,15.54,28.52.94.94,0,0,0,1.27.19.89.89,0,0,0,.18-1.28h0a87.24,87.24,0,0,1-13.89-28.28A102.85,102.85,0,0,1,58,180.87a82.15,82.15,0,0,1,6.68-14,51.58,51.58,0,0,1,5.71-7.76c0,1.21,0,2.36.06,3.58.12,2.18.24,4.31.48,6.43s.49,4.25.85,6.37a1,1,0,0,0,.91.85A1.37,1.37,0,0,0,73.57,175.23Z",fill:e?.fgColor||"black",id:"CallToActionArrow"}),E("g",{fill:"none",transform:"translate(82, 95)scale(0.5)",children:t})]})})};var Qc={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:t=>E("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:E("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:t})})};var Bc={id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",wrapper:t=>E("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:E("svg",{fill:"none",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:ut("g",{transform:"translate(10, 10)",children:[E("circle",{cx:"138",cy:"167.682",fill:"white",r:"99.3177",stroke:"#F89941",strokeWidth:"20"}),E("rect",{fill:"url(#pattern0)",height:"110.806",width:"113",x:"81.0001",y:"124.097"}),E("ellipse",{cx:"167.989",cy:"67.8947",fill:"#F89941",rx:"35.4453",ry:"48.4419"}),E("path",{d:"M187.937 69.0763C187.937 82.6574 184.092 94.8451 178.005 103.57C171.912 112.304 163.736 117.381 154.992 117.381C146.247 117.381 138.072 112.304 131.979 103.57C125.891 94.8451 122.047 82.6574 122.047 69.0763C122.047 55.4952 125.891 43.3075 131.979 34.5823C138.072 25.8486 146.247 20.7714 154.992 20.7714C163.736 20.7714 171.912 25.8486 178.005 34.5823C184.092 43.3075 187.937 55.4952 187.937 69.0763Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),E("ellipse",{cx:"154.072",cy:"69.4866",fill:"#F89941",rx:"34.0512",ry:"50.6615"}),E("path",{d:"M171.396 69.667C171.396 82.7394 167.562 94.4717 161.488 102.874C155.412 111.279 147.235 116.2 138.451 116.2C129.666 116.2 121.489 111.279 115.413 102.874C109.34 94.4717 105.506 82.7394 105.506 69.667C105.506 56.5946 109.34 44.8624 115.413 36.4603C121.489 28.0551 129.666 23.1344 138.451 23.1344C147.235 23.1344 155.412 28.0551 161.488 36.4603C167.562 44.8624 171.396 56.5946 171.396 69.667Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),E("ellipse",{cx:"134.316",cy:"70.8486",fill:"#F89941",rx:"33.673",ry:"47.8511"}),E("ellipse",{fill:"#F89941",rx:"35.4453",ry:"48.4419",transform:"matrix(-1 0 0 1 106.743 68.4484)"}),E("path",{d:"M86.7942 69.6299C86.7942 83.2111 90.6388 95.3988 96.7262 104.124C102.819 112.858 110.995 117.935 119.739 117.935C128.484 117.935 136.659 112.858 142.753 104.124C148.84 95.3988 152.685 83.2111 152.685 69.6299C152.685 56.0488 148.84 43.8611 142.753 35.1359C136.659 26.4023 128.484 21.3251 119.739 21.3251C110.995 21.3251 102.819 26.4023 96.7262 35.1359C90.6388 43.8611 86.7942 56.0488 86.7942 69.6299Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),E("ellipse",{fill:"#F89941",rx:"32.9438",ry:"50.3847",transform:"matrix(-1 0 0 1 119.744 69.7634)"}),E("path",{d:"M103.335 70.2207C103.335 83.293 107.169 95.0253 113.243 103.427C119.319 111.833 127.496 116.753 136.281 116.753C145.065 116.753 153.242 111.833 159.318 103.427C165.392 95.0253 169.226 83.293 169.226 70.2207C169.226 57.1483 165.392 45.416 159.318 37.014C153.242 28.6088 145.065 23.688 136.281 23.688C127.496 23.688 119.319 28.6088 113.243 37.014C107.169 45.416 103.335 57.1483 103.335 70.2207Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),E("ellipse",{fill:"#F89941",rx:"32.3901",ry:"47.6163",transform:"matrix(-1 0 0 1 139.677 70.8708)"}),E("ellipse",{fill:"#F89941",rx:"33.2207",ry:"47.6163",transform:"matrix(-1 0 0 1 134.971 71.4245)"}),E("path",{d:"M158.85 46.6783C165.21 42.2516 166.538 40.633 167.867 39.0144C167.867 39.0144 169.806 43.8236 169.88 46.3566C169.954 48.8897 169.712 50.1469 167.248 51.6467C164.783 53.1464 155.406 53.0446 150.083 52.9746C149.31 52.5001 150.72 52.3371 158.85 46.6783Z",fill:"black"}),E("path",{d:"M115.765 46.5118C109.392 42.1412 108.058 40.5475 106.724 38.9538C106.724 38.9538 104.783 45.8361 104.758 46.822C104.733 47.808 104.657 50.8051 108.247 51.9995C111.837 53.194 119.234 52.7723 124.551 52.7272C125.322 52.2652 123.912 52.0991 115.765 46.5118Z",fill:"black"}),E("path",{d:"M160 90.4999C167.156 83.1595 169.5 78.2827 171.351 72.9348C172.24 70.3672 162.909 72.0429 158 72.9348C157.276 73.0664 155.751 76.9145 155 77C154.182 77.0932 151.841 73.0759 151 73.086C149.725 73.1013 147.727 73.086 145.875 73.4285C145.345 74.3645 146.367 77.5746 145.875 78.2827C145.321 78.2827 141.796 77.2604 141.242 76.4298C140.689 74.492 140.949 73.3629 140.118 72.5323C137.555 72.9075 138.023 72.6567 135.412 73.086C134.768 73.1919 133.09 77.7212 132.441 77.8195C131.615 77.9448 128.644 74.0088 127.809 74.1138C126.747 74.2475 124.821 74.4683 123.64 74.577C123.126 74.6244 123.554 77.5019 123.177 78.2827C122.898 78.8616 119.426 77.8921 118.5 77.5C118.037 76.5024 117.844 74.5583 117 74.577C111 74.1138 109.4 73.843 103.575 70.8713C103.575 70.8713 102.5 80 111 89C119.5 98 147.127 103.706 160 90.4999Z",fill:"black"}),E("path",{d:"M135.238 7.25181C137.192 1.73111 142.678 0.363204 145.935 0L148.377 1.81602C149.158 2.39714 149.842 2.40909 150.331 3.25657C150.331 4.22511 146.337 5.41975 142.429 6.582C137.545 8.03482 139.482 17.0534 142.429 19.2811C143.401 20.0152 143.524 19.9639 145.966 19.9639C148.029 19.9639 150.387 18.2474 151.566 17.3526C151.566 17.3526 151.861 20.2573 149.798 21.4777C147.735 22.698 143.578 21.8578 143.608 21.9658C144.493 23.9183 146.89 22.4887 148.029 23.3362C147.346 23.3362 146.556 24.2889 144.198 24.5329C142.672 24.5798 142.135 24.5329 140.956 23.9183C139.777 23.3037 139.482 22.8696 138.893 22.1395C136.83 23.3598 138.893 25.4305 138.893 25.4305C138.893 25.4305 134.472 25.8512 133.587 23.9183C133.264 23.2115 133.882 22.1395 133.587 21.9658C131.819 22.4539 130.935 23.4807 127.373 22.8696C124.312 22.3443 125.102 18.3211 124.451 17.3526C127.381 18.079 125.131 20.0392 129.327 19.9639C140.838 19.7576 132.796 14.1527 135.238 7.25181Z",fill:"#5D725F"}),ut("defs",{children:[E("pattern",{height:"1",id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1"}),E("clipPath",{id:"clip0_2087_156668",children:E("rect",{fill:"white",height:"276",width:"276"})})]}),E("g",{fill:"none",transform:"translate(80, 122)scale(0.38)",children:t})]})})})};var Gc={id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",wrapper:(t,e)=>E("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:E("svg",{fill:"black",height:"300",viewBox:"0 0 316 316",width:"300",xmlns:"http://www.w3.org/2000/svg",children:ut("g",{children:[E("path",{clipRule:"evenodd",d:"M308 8H8v300h300V8ZM0 0v316h316V0H0Z",fill:e?.fgColor||"black",fillRule:"evenodd"}),E("g",{fill:"none",transform:"translate(20, 20) scale(0.92)",children:t})]})})})};var Uc={id:"StandardBox",name:"Standard Box",description:"QR code with standard box",wrapper:(t,e)=>E("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:ut("svg",{fill:"#000000",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[E("path",{d:"M243,1.7h-186a10.25,10.25,0,0,0-10.2,10.12v186A10.13,10.13,0,0,0,57,208H243a10.13,10.13,0,0,0,10.12-10.12v-186A10.13,10.13,0,0,0,243,1.7Zm2.36,193.05a5.46,5.46,0,0,1-5.47,5.47H60.16a5.46,5.46,0,0,1-5.47-5.47V14.93a5.46,5.46,0,0,1,5.47-5.47H239.91a5.46,5.46,0,0,1,5.47,5.47Z",fill:e?.fgColor||"black"}),E("path",{d:"M243.54,238.81H173.61a2.29,2.29,0,0,1-1.62-.67l-20.55-20.55a2.33,2.33,0,0,0-3.25,0l-20.55,20.55a2.29,2.29,0,0,1-1.62.67H56.09A9.15,9.15,0,0,0,46.93,248v41.17a9.16,9.16,0,0,0,9.16,9.16H243.61a9.09,9.09,0,0,0,9.09-9.16V248A9.16,9.16,0,0,0,243.54,238.81Z",fill:e?.fgColor||"black"}),E("g",{fill:"none",transform:"translate(60, 15)scale(0.6)",children:t})]})})};var qc={id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",wrapper:t=>E("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:ut("svg",{fill:"#22071b",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[E("path",{d:"M195.11,290.77l-7.28,4.88a2.16,2.16,0,0,0-.57,3,2.21,2.21,0,0,0,1.77.92,2.4,2.4,0,0,0,1.2-.35l7.28-4.88a2.14,2.14,0,0,0-2.4-3.54Z"}),E("path",{d:"M266.85,227.52l-7.28,4.87a2.16,2.16,0,0,0-.57,3,2.21,2.21,0,0,0,1.77.92,1.86,1.86,0,0,0,1.2-.35l7.28-4.88a2.13,2.13,0,1,0-2.4-3.53Z"}),E("path",{d:"M41,176.34l-9.11,6.08a2.15,2.15,0,0,0-.57,3,2.19,2.19,0,0,0,1.77.92,2.14,2.14,0,0,0,1.2-.35l9.12-6.08A2.14,2.14,0,0,0,41,176.34Z"}),E("path",{d:"M41,269.08l-9.11,6.07a2.15,2.15,0,0,0-.57,3,2.19,2.19,0,0,0,1.77.92,2.92,2.92,0,0,0,1.2-.35l9.12-6.08A2.14,2.14,0,0,0,41,269.08Z"}),E("path",{d:"M147,10.1a2.4,2.4,0,0,0,1.14-.35l7.7-5.16a2.13,2.13,0,0,0-2.4-3.53l-7.64,5.15a2.15,2.15,0,0,0-.56,3A2.19,2.19,0,0,0,147,10.1Z"}),E("path",{d:"M275.54,54.77a2.14,2.14,0,0,0-3-.56l-17.1,11.45V31.31a10.18,10.18,0,0,0-10.18-10.18H137.22l-10.39,7a2.4,2.4,0,0,1-1.2.35,2.21,2.21,0,0,1-1.77-.92,2.15,2.15,0,0,1,.57-3l1.41-.92,13.64-8.76a2.1,2.1,0,1,0-2.26-3.54L122,21.2h-8.13l-10.39,7a2.37,2.37,0,0,1-1.2.35,2.19,2.19,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3L124,9.25a2.13,2.13,0,1,0-2.4-3.53l-23,15.48H58.2A10.18,10.18,0,0,0,48,31.38v28L31.34,70.46a2.09,2.09,0,0,0-.57,3,2,2,0,0,0,1.77.92,2.58,2.58,0,0,0,1.2-.35l14.35-9.54,3.18-2.12a2.14,2.14,0,1,1,2.41,3.53l-5.52,3.67V76.9l-7,4.66a2.15,2.15,0,0,0-.56,3,2,2,0,0,0,1.77.92,2.34,2.34,0,0,0,1.2-.36l7.35-4.94A2.13,2.13,0,0,1,52.69,84l-4.46,3v65.66L25.05,168.07a2.15,2.15,0,0,0-.57,3,2,2,0,0,0,1.77.92,2.37,2.37,0,0,0,1.2-.35l25-16.75a2,2,0,0,1,2.62.77,2.16,2.16,0,0,1-.57,3l-6.36,4.24V275a10.09,10.09,0,0,0,9.83,10.11l-5.87,4a2.15,2.15,0,0,0-.57,3,2.06,2.06,0,0,0,1.77.92,2.38,2.38,0,0,0,1.2-.36l23-15.41a2.14,2.14,0,0,1,2.41,3.54l-6.58,4.45h52l-5.58,3.75a2.14,2.14,0,0,0-.56,3,2,2,0,0,0,1.76.91,2.37,2.37,0,0,0,1.2-.35l30.54-20.28a2.15,2.15,0,0,1,3,.56,2.1,2.1,0,0,1-.57,3l-14.21,9.54H217l-4.6,3a2.16,2.16,0,0,0-.63,3,2.11,2.11,0,0,0,1.76,1,2,2,0,0,0,1.13-.36L237,277.35a2.14,2.14,0,1,1,2.33,3.6l-6.78,4.38h13a10.18,10.18,0,0,0,10.18-10.18v-91.1l-4.38,3a2.43,2.43,0,0,1-1.2.35,2.19,2.19,0,0,1-1.77-.92,2.15,2.15,0,0,1,.57-3l24.38-16.33a2.13,2.13,0,1,0-2.4-3.53l-15.48,10.25V91.53l-4.38,3a2.34,2.34,0,0,1-1.21.36,2.22,2.22,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3l6.72-4.52,13.71-9.19a2.14,2.14,0,0,0-2.4-3.54l-11.24,7.57V75.84l-4.38,3a2.34,2.34,0,0,1-1.21.36,2.22,2.22,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3l6.72-4.52,19.43-13.08A2.05,2.05,0,0,0,275.54,54.77ZM237,216.07h-172a5.23,5.23,0,0,1-5.23-5.24V38.94a5.22,5.22,0,0,1,5.23-5.23H237a5.22,5.22,0,0,1,5.23,5.23V210.83h.07A5.22,5.22,0,0,1,237,216.07Z"}),E("path",{d:"M270.45,139.8l-7.28,4.88a2.15,2.15,0,0,0-.56,3,2.22,2.22,0,0,0,1.76.92,2.44,2.44,0,0,0,1.21-.36l7.28-4.87a2.14,2.14,0,0,0-2.41-3.54Z"}),E("g",{fill:"none",transform:"translate(64, 38)scale(0.58)",children:t})]})})};var _a={default:Qc,Arrow:Dc,StandardBox:Uc,SquareBorder:Gc,StrikedBox:qc,Halloween:Bc},zc=t=>_a[t],s2=()=>Object.values(_a),c2=()=>Object.keys(_a);var ya=t=>Math.round(Math.min(Math.max(t,0),255)).toString(16).padStart(2,"0");function jc(t){return `#${ya(t.r)}${ya(t.g)}${ya(t.b)}`}function Or(t){let e=dt(t);return !e||e.a>=1||e.a<=0?{color:t}:{color:jc(e),opacity:it(e.a,3)}}function Dr(t,e){let n=Math.min(Math.max(t.a,0),1);return {r:t.r*n+e.r*(1-n),g:t.g*n+e.g*(1-n),b:t.b*n+e.b*(1-n),a:1}}var Yc={r:0,g:0,b:0,a:1};function Yd(t){return [...t].map(e=>({offset:Math.min(Math.max(e.offset/100,0),1),color:dt(e.color)??Yc})).sort((e,n)=>e.offset-n.offset)}function xa(t,e){let n=t[0],o=t.at(-1);if(!(n&&o))return Yc;if(e<=n.offset)return n.color;if(e>=o.offset)return o.color;for(let r=0;r+1<t.length;r++){let a=t[r],i=t[r+1];if(e>=a.offset&&e<=i.offset){let c=i.offset-a.offset,s=c>0?(e-a.offset)/c:1,l=a.color.a+(i.color.a-a.color.a)*s,u=(m,f)=>{let d=m*a.color.a+(f*i.color.a-m*a.color.a)*s;return l>0?d/l:m+(f-m)*s};return {r:u(a.color.r,i.color.r),g:u(a.color.g,i.color.g),b:u(a.color.b,i.color.b),a:l}}}return o.color}var Wc=4,Hc=720,Xd=2;function Xc(t,e,n,o,r){let a=Yd(t);if(a.length===0)return {wedges:[]};let i=a[0].color.a,c=a.every(_=>Math.abs(_.color.a-i)<.002),s=[...new Set([0,...a.map(_=>_.offset),1])].sort((_,y)=>_-y),l=[];for(let _=0;_+1<s.length;_++){let y=s[_],C=s[_+1];if(C<=y)continue;let M=xa(a,y+1e-9),$=xa(a,C-1e-9),S=Math.max(Math.abs(M.r*M.a-$.r*$.a),Math.abs(M.g*M.a-$.g*$.a),Math.abs(M.b*M.a-$.b*$.a),Math.abs(M.a-$.a)*255),R=Math.ceil(S/Xd),w=Math.ceil((C-y)*360/Wc),P=Math.max(1,R,w);for(let v=0;v<P;v++)l.push([y+(C-y)*v/P,y+(C-y)*(v+1)/P]);}let u=l;if(l.length>Hc){let _=Math.ceil(l.length/Hc);u=[];for(let y=0;y<l.length;y+=_){let C=l.slice(y,y+_);u.push([C[0][0],C.at(-1)[1]]);}}let m=e-90,f=r/Math.cos(2*Wc/2*(Math.PI/180)),d=_=>{let y=_*Math.PI/180;return [x(n+f*Math.cos(y)),x(o+f*Math.sin(y))]},p=`${x(n)} ${x(o)}`,h=_=>it((_%360+360)%360,4),g=u.length-1,b=u.map(([_,y],C)=>{let M=xa(a,(_+y)/2),$=(y-_)*360,S=c&&C===0&&g>0?$:0,R=c&&C<g?$:0,w=m+_*360-S,P=m+y*360+R,[v,L]=d(w),[I,F]=d(P);return {d:`M${p}L${v} ${L}L${I} ${F}Z`,color:jc(M),...c||M.a>=1?{}:{opacity:it(M.a,3)},from:h(w),sweep:it(P-w,4)}});return c&&i<1?{wedges:b,opacity:it(i,3)}:{wedges:b}}function Vc(t,e,n,o){return (Math.atan2(o-e,n-t)*180/Math.PI%360+360)%360}function Zc(t,e,n){if(t>=n.x-1e-6&&t<=n.x+n.width+1e-6&&e>=n.y-1e-6&&e<=n.y+n.height+1e-6)return null;let r=[[n.x,n.y],[n.x+n.width,n.y],[n.x,n.y+n.height],[n.x+n.width,n.y+n.height]],a=Vc(t,e,n.x+n.width/2,n.y+n.height/2),i=0,c=0;for(let[s,l]of r){let u=Vc(t,e,s,l)-a;u>180?u-=360:u<=-180&&(u+=360),i=Math.min(i,u),c=Math.max(c,u);}return [a+i,a+c]}function Kc(t,e){let n=t[1]-t[0],o=e[1]-e[0];if(n>=360||o>=360)return true;let r=((e[0]-t[0])%360+360)%360;return r<=n||r+o>=360}function Ca(t,e){return t.slice().map((n,o)=>o<e.y||o>=e.y+e.h?n:n.map((r,a)=>a<e.x||a>=e.x+e.w?r:false))}function el(t,e=0){let n=[];return t.forEach((o,r)=>{let a=null;o.forEach((i,c)=>{if(!i&&a!==null){n.push(A`M${a+e} ${r+e}h${c-a}v1H${a+e}z`),a=null;return}if(c===o.length-1){if(!i)return;a===null?n.push(A`M${c+e},${r+e} h1v1H${c+e}z`):n.push(A`M${a+e},${r+e} h${c+1-a}v1H${a+e}z`);return}i&&a===null&&(a=c);});}),n.join("")}function Zd(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}var Kd=.9;function $a(t,e){let{margin:n,pixelSize:o,pattern:r="circle",plain:a=false}=e;if(Zs(r))return Js(t,{margin:n,pixelSize:o,pattern:r,scale:e.scale,plain:a});let i=Cr(e.scale,r),c=[],s=t.length,l=o*.45,u=a?()=>false:ta(s);return t.forEach((m,f)=>{m.forEach((d,p)=>{if(d&&(a||!Zd(p,f,s))){let h=(p+.5+n)*o,g=(f+.5+n)*o,b=`${p}-${f}`,_=c.length;if(u(p,f)){c.push(E("rect",{height:x(o),width:x(o),x:x(h-o/2),y:x(g-o/2)},b));return}switch(r){case "circle":c.push(E("circle",{cx:x(h),cy:x(g),r:x(l),transform:A`rotate(0,${h},${g})`},b));break;case "circle-large":{let y=o*.5;c.push(E("circle",{cx:x(h),cy:x(g),r:x(y),transform:A`rotate(0,${h},${g})`},b));}break;case "small-square":{let y=o*.357143;c.push(E("path",{d:A`M ${h-y} ${g-y}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:A`rotate(0,${h},${g})`},b));}break;case "diamond":{let y=o*.357143;c.push(E("path",{d:A`M ${h-y} ${g-y}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:A`rotate(45,${h},${g})`},b));}break;case "circle-mixed":{let y=(p+f)%3===0?Kd:(p+f)%2===0?1:1.25,C=l*y;c.push(E("circle",{cx:x(h),cy:x(g),r:x(C),transform:A`rotate(0,${h},${g})`},b));}break;case "pacman":{let y=o*.5,C=o*.357143;c.push(E("path",{d:A`M ${h-y} ${g-C}v ${o*.714286}h ${y}a ${y*.5} ${y*.5}, 0, 0, 0, 0 -${o*.714286}h -${y}v -${o*.714286}z`,transform:A`rotate(${(p+f)%2===0?0:90},${h},${g})`},b));}break;case "rounded":{let y=o*.5,C=o*.2;c.push(E("rect",{height:x(o),rx:x(C),ry:x(C),transform:A`rotate(0,${h},${g})`,width:x(o),x:x(h-y),y:x(g-y)},b));}break;case "square":{let y=o*.5;c.push(E("rect",{height:x(o),transform:A`rotate(0,${h},${g})`,width:x(o),x:x(h-y),y:x(g-y)},b));}break;case "vertical-line":{let y=o*.714286,C=o;c.push(E("path",{d:A`M ${h-o*.5} ${g-y*.5}v ${y}h ${C}v -${y}z`,transform:A`rotate(90,${h},${g})`},b));}break;default:c.push(E("circle",{cx:x(h),cy:x(g),r:x(l),transform:A`rotate(0,${h},${g})`},b));}if(i!==1&&c.length>_){let y=c.pop();c.push(E("g",{transform:A`translate(${h},${g}) scale(${x(i,6)}) translate(${-h},${-g})`,children:y},b));}}});}),c}function Jd(t,e){let n=t*Math.PI/180,o=e/2,r=e/2,a=Math.sqrt(e*e+e*e)/2,i=o-a*Math.cos(n),c=r-a*Math.sin(n),s=o+a*Math.cos(n),l=r+a*Math.sin(n);return {x1:i,y1:c,x2:s,y2:l}}function Ma(t,e){return `${t}-${Ue(JSON.stringify(e))}`}function t1(t,e,n,o,r){let a=t;if(t===0)switch(r){case "top-left":a=0;break;case "top-right":a=90;break;case "bottom-left":a=270;break;default:a=0;}let i=a*Math.PI/180,c=e+o/2,s=n+o/2,l=Math.sqrt(o*o+o*o)/2,u=c-l*Math.cos(i),m=s-l*Math.sin(i),f=c+l*Math.cos(i),d=s+l*Math.sin(i);return {x1:u,y1:m,x2:f,y2:d}}function Br(t,e){return e.map((n,o)=>{let{color:r,opacity:a}=Or(n.color);return E("stop",{offset:`${n.offset}%`,stopColor:r,stopOpacity:a},`${t}-stop-${o}`)})}function nl(t,e,n,o,r,a){let i=Xc(e.stops,e.angle??0,n,o,r),c=i.wedges.map((s,l)=>E("path",{d:s.d,"data-arc":`${s.from} ${s.sweep}`,fill:s.color,fillOpacity:s.opacity,shapeRendering:s.opacity===void 0?void 0:"crispEdges"},`${t}-w-${l}`));return E("pattern",{"data-qrdx-conic":`${x(n)} ${x(o)}`,height:x(a),id:t,patternUnits:"userSpaceOnUse",width:x(a),x:0,y:0,children:i.opacity===void 0?c:E("g",{opacity:i.opacity,children:c})},t)}function e1(t="center"){let[e,n]=t.split("-"),o=t==="center"?"center":e,r=n??(e==="left"||e==="right"?e:"center");return {x:r==="left"?0:r==="right"?1:.5,y:o==="top"?0:o==="bottom"?1:.5}}var n1=["xMin","xMid","xMax"],r1=["YMin","YMid","YMax"];function rl(t,e,n){let o=e.scale??1,r=e.fit==="tile",a=r?n/4*o:n,i=e.underlay?Or(e.underlay):null,c=r?a:n*o,s=e1(e.position),l=r?0:s.x*(n-c),u=r?0:s.y*(n-c),m=r?"xMidYMid slice":`${n1[s.x*2]??"xMid"}${r1[s.y*2]??"YMid"} ${e.fit==="contain"?"meet":"slice"}`;return ut("pattern",{height:x(a),id:t,patternUnits:"userSpaceOnUse",width:x(a),x:0,y:0,children:[i&&E("rect",{fill:i.color,fillOpacity:i.opacity,height:x(a),width:x(a),x:0,y:0}),E("image",{height:x(c),href:e.src,opacity:(e.opacity??1)<1?e.opacity:void 0,preserveAspectRatio:m,width:x(c),x:x(l),y:x(u)})]},t)}var ol=(t,e)=>Ma("img",[t,e]);function o1(t,e,n,o,r,a,i){let c=Gt(t);if(c.type==="solid")return null;if(c.type==="image"){let l=ol(c,i);return {id:l,element:rl(l,c,i)}}let s=Ma(a,[c,e,n,o,r,...c.type==="angular"?[i]:[]]);if(c.type==="linear"){let l=c,u=l.angle??0,{x1:m,y1:f,x2:d,y2:p}=t1(u,e,n,o,r);return {id:s,element:E("linearGradient",{gradientUnits:"userSpaceOnUse",id:s,x1:x(m),x2:x(d),y1:x(f),y2:x(p),children:Br(s,l.stops)},s)}}if(c.type==="radial"){let l=c,u=e+o/2,m=n+o/2,f=o/2*.97;return {id:s,element:E("radialGradient",{cx:x(u),cy:x(m),fx:x(u),fy:x(m),gradientUnits:"userSpaceOnUse",id:s,r:x(f),children:Br(s,l.stops)},s)}}return c.type==="angular"?{id:s,element:nl(s,c,e+o/2,n+o/2,o*.75,i)}:null}function Sa(t,e,n){let o=Gt(t);if(o.type==="solid")return null;if(o.type==="image"){let a=ol(o,e);return {id:a,element:rl(a,o,e)}}let r=Ma(n,[o,e]);if(o.type==="linear"){let a=o,i=a.angle??0,{x1:c,y1:s,x2:l,y2:u}=Jd(i,e);return {id:r,element:E("linearGradient",{gradientUnits:"userSpaceOnUse",id:r,x1:x(c),x2:x(l),y1:x(s),y2:x(u),children:Br(r,a.stops)},r)}}if(o.type==="radial"){let a=o,i=e/2,c=e/2,s=e/2*.97;return {id:r,element:E("radialGradient",{cx:x(i),cy:x(c),fx:x(i),fy:x(c),gradientUnits:"userSpaceOnUse",id:r,r:x(s),children:Br(r,a.stops)},r)}}return o.type==="angular"?{id:r,element:nl(r,o,e/2,e/2,e*.75,e)}:null}var Qr=t=>cn(t)||bo(t);function Jc(t){let e=new Set,n=[];for(let o of t)o&&!e.has(o.id)&&(e.add(o.id),n.push(o.element));return n}function de(t,e,n){if(e)return {fill:`url(#${e})`};let o=Gt(t,n),r=o.type==="solid"?o.color:o.type==="image"?o.underlay??n:n,{color:a,opacity:i}=Or(r);return i===void 0?{fill:a}:{fill:a,fillOpacity:i}}function Re(t,e,n,o){if(o==null)return null;let r=t.length,a=Math.floor(e*er),i=(r+2*n)/e,c=(o.width||a)*i,s=(o.height||a)*i,l=o.x==null?r/2-c/2:o.x*i,u=o.y==null?r/2-s/2:o.y*i,m=null;if(o.excavate){let f=Math.max(0,o.padding??0)*i,d=Math.floor(l-f),p=Math.floor(u-f),h=Math.ceil(c+l+f-d),g=Math.ceil(s+u+f-p);m={x:d,y:p,w:h,h:g};}return {x:l,y:u,h:s,w:c,excavation:m}}function Bt(t){let e=t.level??Yt,{imageSettings:n}=t,o=t.isOGContext&&n?.excavate&&(e==="L"||e==="M")?"Q":e;if(t.autoLevel&&n&&o!=="H"){let r=xt.QrCode.encodeText(t.value,Et[o]).getModules(),a=Re(r,t.size??ft,It(r.length,t.margin??$t,t.shape),n);a&&(a.excavation?a.excavation.w*a.excavation.h:a.w*a.h)/(r.length*r.length)>ko&&(o="H");}return o}function a1(t,e,n,o){let r=e/n,a=t.w*r,i=t.h*r,c=(t.x+o)*r,s=(t.y+o)*r;return {imgWidth:a,imgHeight:i,imgLeft:c,imgTop:s}}function wa(t){let{value:e,size:n=ft,level:o=Yt,bgColor:r=gt,fgColor:a=Mt,eyeColor:i,dotColor:c,bodyPattern:s="circle",cornerEyePattern:l="gear",cornerEyeDotPattern:u="circle",margin:m=$t,isOGContext:f=false,imageSettings:d,templateId:p,customTemplate:h,customProps:g,frame:b,art:_,eyeColors:y,moduleScale:C,autoLevel:M,shape:$,frameLabelMarkers:S,partMarkers:R,...w}=t,P=Nr({value:e,size:n,margin:m,level:o,shape:$,autoLevel:M,isOGContext:f},d),v=Qt(b),L=v?{}:w,I=at=>v?Ar(at,{size:n,frame:b,bgColor:r,svgProps:w,markLabels:S}):at,F=Bt({value:e,size:n,level:o,margin:m,imageSettings:P,isOGContext:f,autoLevel:M,shape:$}),O=xt.QrCode.encodeText(e,Et[F]),T=O.getModules(),B=It(T.length,m,$),H=Rc(e,T.length,m,$),Q=(at,Tt)=>ba(R,at,Tt),U=(at,Tt)=>{let jt=fa($,at);return jt?"circle"in jt?E("circle",{cx:x(at/2),cy:x(at/2),...Tt,r:x(at/2),...Q("background")}):E("path",{d:jt.path,...Tt,...Q("background")}):E("rect",{...Tt,height:at,width:at,x:0,y:0,...Q("background")})},tt=T.length+B*2,yt=Re(T,n,B,P),st=null;if(P!=null&&yt!=null){yt.excavation!=null&&(T=Ca(T,yt.excavation));let{imgWidth:at,imgHeight:Tt,imgLeft:jt,imgTop:on}=a1(yt,n,tt,B);if(f){let an=P.shape??"square";st=E("img",{alt:"Logo",src:P.src,style:{position:"absolute",left:`${x(jt)}px`,top:`${x(on)}px`,width:`${x(at)}px`,height:`${x(Tt)}px`,...an!=="square"&&{borderRadius:an==="circle"?"50%":`${x(Math.min(at,Tt)*Ir)}px`},...P.plate&&{backgroundColor:P.plate,padding:`${x(at*Tr)}px`,boxSizing:"border-box"}}});}else st=Fr(P,{x:jt,y:on,w:at,h:Tt}),R&&(st=hn(st,Q("logo")));}let k=n/tt,q=T.length,z=7*k,Ct=1.5*k,Le={fgColor:wt(a,Mt),bgColor:wt(r,gt)},Nt=Ho(_)?Xo({art:_,modules:T,version:O.version,margin:B,pixelSize:k,...Le,body:at=>$a(at,{margin:B,pixelSize:k,pattern:s,scale:C})}):null,oe=Nt&&R?hn(Nt,Q("body")):Nt,Ie=Nt&&_?Jo({art:_,version:O.version,...Le}):null,G=Nt?null:$a(T,{margin:B,pixelSize:k,pattern:s,scale:C}),et=H?$a(H,{margin:0,pixelSize:k,pattern:s,scale:C,plain:true}):null,X=Gt(r,gt),pt=Gt(a,Mt),Ln=Qr(X)?Sa(X,n,"bg-color"):null,so=Qr(pt)?Sa(pt,n,"fg-color"):null,Tu=de(r,Ln?.id??null,gt),li=de(a,so?.id??null,Mt),ui=oe?ut(ne,{children:[oe,et&&E("g",{...li,...Q("body"),children:et})]}):ut("g",{...li,...Q("body"),children:[G,et]}),Ye=B*k,Xe=B*k,Ze=(q-7+B)*k,Ke=B*k,Je=B*k,tn=(q-7+B)*k,Te=wt(a,Mt),en=at=>y?.[at]?.outer??Ie?.[at]?.outer??i,nn=at=>y?.[at]?.inner??Ie?.[at]?.inner??c,rn=(at,Tt,jt,on,an)=>{let po=Gt(at,Te);return Qr(po)?o1(po,Tt,jt,z,on,an,n):null},co=rn(en("topLeft"),Ye,Xe,"top-left","corners-square-color-0-0"),lo=rn(en("topRight"),Ze,Ke,"top-right","corners-square-color-1-0"),uo=rn(en("bottomLeft"),Je,tn,"bottom-left","corners-square-color-0-1"),mo=rn(nn("topLeft"),Ye,Xe,"top-left","corners-dot-color-0-0"),fo=rn(nn("topRight"),Ze,Ke,"top-right","corners-dot-color-1-0"),ho=rn(nn("bottomLeft"),Je,tn,"bottom-left","corners-dot-color-0-1"),mi=de(en("topLeft"),co?.id??null,Te),di=de(en("topRight"),lo?.id??null,Te),fi=de(en("bottomLeft"),uo?.id??null,Te),hi=de(nn("topLeft"),mo?.id??null,Te),pi=de(nn("topRight"),fo?.id??null,Te),gi=de(nn("bottomLeft"),ho?.id??null,Te),bi=Lr(Ye,Xe,z,l,"top-left"),_i=vr(Ye+z/2,Xe+z/2,Ct,u,"top-left"),yi=Lr(Ze,Ke,z,l,"top-right"),xi=vr(Ze+z/2,Ke+z/2,Ct,u,"top-right"),$i=Lr(Je,tn,z,l,"bottom-left"),Si=vr(Je+z/2,tn+z/2,Ct,u,"bottom-left"),Fu=ut(ne,{children:[E("defs",{children:Jc([Ln,so,co,lo,uo,mo,fo,ho])}),U(n,Tu),ui,E("g",{...mi,...Q("eye-outer","top-left"),children:E("path",{d:bi,fillRule:"evenodd",transform:A`rotate(0,${Ye+z/2},${Xe+z/2})`})}),E("g",{...hi,...Q("eye-centre","top-left"),children:_i}),E("g",{...di,...Q("eye-outer","top-right"),children:E("path",{d:yi,fillRule:"evenodd",transform:A`rotate(0,${Ze+z/2},${Ke+z/2})`})}),E("g",{...pi,...Q("eye-centre","top-right"),children:xi}),E("g",{...fi,...Q("eye-outer","bottom-left"),children:E("path",{d:$i,fillRule:"evenodd",transform:A`rotate(0,${Je+z/2},${tn+z/2})`})}),E("g",{...gi,...Q("eye-centre","bottom-left"),children:Si}),st]}),Ci=h||(p?zc(p):void 0);if(Ci){let Tt=Qr(X)?Sa(X,300,"bg-color-template"):null,jt=de(r,Tt?.id??null,gt),on=ut("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[E("defs",{children:Jc([Tt,so,co,lo,uo,mo,fo,ho])}),U(300,jt),ut("g",{transform:`scale(${x(300/n,6)})`,children:[ui,E("g",{...mi,...Q("eye-outer","top-left"),children:E("path",{d:bi,fillRule:"evenodd",transform:A`rotate(0,${Ye+z/2},${Xe+z/2})`})}),E("g",{...hi,...Q("eye-centre","top-left"),children:_i}),E("g",{...di,...Q("eye-outer","top-right"),children:E("path",{d:yi,fillRule:"evenodd",transform:A`rotate(0,${Ze+z/2},${Ke+z/2})`})}),E("g",{...pi,...Q("eye-centre","top-right"),children:xi}),E("g",{...fi,...Q("eye-outer","bottom-left"),children:E("path",{d:$i,fillRule:"evenodd",transform:A`rotate(0,${Je+z/2},${tn+z/2})`})}),E("g",{...gi,...Q("eye-centre","bottom-left"),children:Si}),st]})]}),an=300/n,ku={pixelSize:k*an,url:e},Mi=Ci.wrapper(on,{fgColor:a,bgColor:r,...g||{},...w},ku),Nu={...Mi?.props?.style||{},width:void 0,height:void 0,...L.style};return I(hn(Mi,{...L,width:n,height:n,style:Nu}))}return I(E("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...L,children:Fu}))}var F2=(()=>{try{new Path2D().addPath(new Path2D);}catch{return false}return true})(),k2=t=>{let e=t.trim().replace(/^#/,"");e.length===3||e.length===4?e=e.slice(0,3).split("").map(o=>o+o).join(""):e.length===8&&(e=e.slice(0,6));let n=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:Number.parseInt(n[1],16),g:Number.parseInt(n[2],16),b:Number.parseInt(n[3],16)}:null},wn=(t,e,n)=>{let[o,r,a]=[t,e,n].map(i=>(i/=255,i<=.03928?i/12.92:((i+.055)/1.055)**2.4));return .2126*o+.7152*r+.0722*a},tl=t=>{let e=dt(t);if(!e)return null;let n=o=>o*e.a+255*(1-e.a);return {r:n(e.r),g:n(e.g),b:n(e.b)}},N2=(t,e)=>{let n=tl(t),o=tl(e);if(!(n&&o))return 1;let r=wn(n.r,n.g,n.b),a=wn(o.r,o.g,o.b),i=Math.max(r,a),c=Math.min(r,a);return (i+.05)/(c+.05)},O2=t=>t>=7?{level:"AAA",warning:false,message:"Excellent contrast"}:t>=4.5?{level:"AA",warning:false,message:"Good contrast"}:t>=3?{level:"AA Large",warning:true,message:"Low contrast - may be difficult to scan"}:{level:"Fail",warning:true,message:"Poor contrast - QR code may not scan properly"};var i1=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),s1=new Map([["className","class"],["tabIndex","tabindex"],["dir","dir"],["role","role"],["viewBox","viewBox"],["width","width"],["height","height"],["xlinkActuate","xlink:actuate"],["xlinkArcrole","xlink:arcrole"],["xlinkRole","xlink:role"],["xlinkShow","xlink:show"],["xlinkTitle","xlink:title"],["xlinkType","xlink:type"],["xmlBase","xml:base"],["xmlLang","xml:lang"],["xmlSpace","xml:space"]]),c1=new Set(["children","dangerouslySetInnerHTML","key","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","ref"]),l1=new Set(["inert","allowFullScreen","async","autoPlay","controls","credentialless","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"]),u1=new Set(["autoFocus","multiple","muted"]),m1=new Set(["contentEditable","spellCheck","draggable","value","autoReverse","externalResourcesRequired","focusable","preserveAlpha"]),d1=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" ")),al=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",f1=new RegExp(`^[${al}][${al}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Gr=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,h1=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i,p1="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')",g1=t=>h1.test(t)?p1:t,sl=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),b1=/["'&<>]/;function Ra(t){if(!b1.test(t))return t;let e="",n=0;for(let o=0;o<t.length;o++){let r;switch(t.charCodeAt(o)){case 34:r="&quot;";break;case 38:r="&amp;";break;case 39:r="&#x27;";break;case 60:r="&lt;";break;case 62:r="&gt;";break;default:continue}e+=t.slice(n,o)+r,n=o+1;}return e+t.slice(n)}var fe=t=>typeof t=="function"||typeof t=="symbol",il=new Map,_1=t=>{let e=il.get(t);return e===void 0&&(e=t.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^ms-/,"-ms-"),il.set(t,e)),e};function y1(t){if(typeof t=="string")return t;if(typeof t!="object"||t===null)return "";let e="";for(let n of Object.keys(t)){let o=t[n];if(o==null||typeof o=="boolean"||o==="")continue;let r;if(n.startsWith("--"))r=`${n}:${`${o}`.trim()}`;else {let a=typeof o=="number"?o===0||d1.has(n)?`${o}`:`${o}px`:`${o}`.trim();r=`${_1(n)}:${a}`;}e=e?`${e};${r}`:r;}return e}function Rn(t,e){if(e==null||c1.has(t))return null;let n=s1.get(t);if(n!==void 0)return fe(e)||typeof e=="boolean"?null:{name:n,value:`${e}`};switch(t){case "style":{let r=y1(e);return r?{name:"style",value:r}:null}case "src":case "href":case "action":case "formAction":case "xlinkHref":return (t==="src"||t==="href")&&e===""||fe(e)||typeof e=="boolean"?null:{name:t==="xlinkHref"?"xlink:href":t,value:g1(`${e}`)};case "capture":case "download":return e===true?{name:t,value:""}:e===false||fe(e)?null:{name:t,value:`${e}`};case "cols":case "rows":case "size":case "span":return fe(e)||Number.isNaN(Number(e))||!(e>=1)?null:{name:t,value:`${e}`};case "rowSpan":case "start":return fe(e)||Number.isNaN(Number(e))?null:{name:t,value:`${e}`};}if(u1.has(t))return e&&!fe(e)?{name:t.toLowerCase(),value:""}:null;if(m1.has(t))return fe(e)?null:{name:t,value:`${e}`};if(l1.has(t))return e&&!fe(e)?{name:t,value:""}:null;if(t.length>2&&(t[0]==="o"||t[0]==="O")&&(t[1]==="n"||t[1]==="N"))return null;let o=i1.get(t)??t;if(!f1.test(o)||fe(e))return null;if(typeof e=="boolean"){let r=o.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-")return null}return {name:o,value:`${e}`}}var cl="http://www.w3.org/2000/svg",ll="http://www.w3.org/1999/xhtml",x1="http://www.w3.org/1999/xlink",$1="http://www.w3.org/XML/1998/namespace",S1="http://www.w3.org/2000/xmlns/";function C1(t,e,n){e==="xmlns"||e.startsWith("xmlns:")?t.setAttributeNS(S1,e,n):e.startsWith("xlink:")?t.setAttributeNS(x1,e,n):e.startsWith("xml:")?t.setAttributeNS($1,e,n):t.setAttribute(e,n);}function Vn(t,e,n,o){if(e==null||typeof e=="boolean")return;if(typeof e=="string"||typeof e=="number"||typeof e=="bigint"){t.appendChild(o.createTextNode(`${e}`));return}if(Array.isArray(e)){for(let s of e)Vn(t,s,n,o);return}if(!De(e))throw new TypeError("qrdx: can't render this value as DOM nodes");let{type:r,props:a}=e;if(pn(r)){Vn(t,a.children,n,o);return}if(typeof r=="function"){Vn(t,r(a),n,o);return}if(!Gr.test(r))throw new TypeError(`qrdx: invalid element name: ${r}`);let i=r==="svg"?cl:n,c=o.createElementNS(i,r);for(let s of Object.keys(a)){let l=Rn(s,a[s]);l&&C1(c,l.name,l.value);}Vn(c,a.children,i===cl&&r==="foreignObject"?ll:i,o),t.appendChild(c);}function Ea(t,e=document){let n=e.createDocumentFragment();return Vn(n,t,ll,e),n}function He(t){if(t==null||typeof t=="boolean")return "";if(typeof t=="string")return Ra(t);if(typeof t=="number"||typeof t=="bigint")return `${t}`;if(Array.isArray(t)){let e="";for(let n of t)e+=He(n);return e}if(!De(t))throw new TypeError("qrdx: can't render this value as SVG markup");return M1(t)}function M1(t){let{type:e,props:n}=t;if(pn(e))return He(n.children);if(typeof e=="function")return He(e(n));if(!Gr.test(e))throw new TypeError(`qrdx: invalid element name: ${e}`);let o=`<${e}`;for(let i of Object.keys(n)){let c=Rn(i,n[i]);c&&(o+=` ${c.name}="${Ra(c.value)}"`);}if(sl.has(e))return `${o}/>`;let r=n.dangerouslySetInnerHTML?.__html,a=r==null?He(n.children):`${r}`;return `${o}>${a}</${e}>`}function Aa(t){return He(wa(t))}function w1(t,e=document){return Ea(wa(t),e).firstChild}var R1=16384;var Pa=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],E1=8,va=class{buffer;position=0;bits=0;used=0;constructor(e){this.buffer=new Uint8Array(Math.max(e,64));}write(e,n){if(n!==0)for(this.bits|=e<<this.used,this.used+=n;this.used>=8;){if(this.position===this.buffer.length){let o=new Uint8Array(this.buffer.length*2);o.set(this.buffer),this.buffer=o;}this.buffer[this.position++]=this.bits&255,this.bits>>>=8,this.used-=8;}}finish(){return this.used>0&&this.write(0,8-this.used),this.buffer.subarray(0,this.position)}};function pl(t,e){let n=new Uint8Array(t.length),o=[];for(let l=0;l<t.length;l++)(t[l]??0)>0&&o.push(l);if(o.length===0)return n;if(o.length===1)return n[o[0]]=1,n;let r=o.length,a=2*r-1,i=new Float64Array(a),c=new Int32Array(a),s=new Uint8Array(a);for(let l=1;;l*=2){for(let h=0;h<r;h++)i[h]=Math.max(t[o[h]]??0,l);let u=Array.from({length:r},(h,g)=>g).sort((h,g)=>i[h]-i[g]||h-g),m=0,f=r,d=h=>m<r&&(f>=h||i[u[m]]<=i[f])?u[m++]:f++;for(let h=r;h<a;h++){let g=d(h),b=d(h);i[h]=i[g]+i[b],c[g]=h,c[b]=h;}s[a-1]=0;let p=0;for(let h=a-2;h>=0;h--){let g=s[c[h]]+1;s[h]=g,h<r&&g>p&&(p=g);}if(p<=e){for(let h=0;h<r;h++)n[o[h]]=s[h];return n}}}function A1(t,e){let n=0;for(let o=0;o<e;o++)n=n<<1|t>>o&1;return n}function gl(t){let e=new Uint16Array(16),n=0;for(let c of t)c>0&&(e[c]=e[c]+1,n++);let o=new Uint16Array(16),r=0;for(let c=1;c<=15;c++)r=r+e[c-1]<<1,o[c]=r;let a=new Uint16Array(t.length),i=new Uint8Array(t.length);return t.forEach((c,s)=>{if(c===0)return;let l=o[c];o[c]=l+1,a[s]=A1(l,c),i[s]=n===1?0:c;}),{lengths:t,codes:a,emitted:i}}function Ve(t,e,n){t.write(e.codes[n],e.emitted[n]);}function P1(t){let e=[],n=a=>e.push({code:a,extra:0,extraBits:0}),o=E1,r=0;for(;r<t.length;){let a=t[r],i=1;for(;r+i<t.length&&t[r+i]===a;)i++;r+=i;let c=i;if(a===0){for(;c>0;)if(c<3)for(;c>0;c--)n(0);else if(c<=10)e.push({code:17,extra:c-3,extraBits:3}),c=0;else {let s=Math.min(c,138);e.push({code:18,extra:s-11,extraBits:7}),c-=s;}continue}for(a!==o&&(n(a),o=a,c--);c>0;)if(c<3)for(;c>0;c--)n(a);else {let s=Math.min(c,6);e.push({code:16,extra:s-3,extraBits:2}),c-=s;}}return e}function v1(t,e){let n=[];if(e.forEach((c,s)=>{c>0&&n.push(s);}),n.length<=2&&n.every(c=>c<256)){let[c=0,s]=n;t.write(1,1),t.write(n.length===2?1:0,1),c<2?(t.write(0,1),t.write(c,1)):(t.write(1,1),t.write(c,8)),s!==void 0&&t.write(s,8);return}let o=P1(e),r=new Uint32Array(19);for(let c of o)r[c.code]=r[c.code]+1;let a=gl(pl(r,7)),i=Pa.length;for(;i>4&&a.lengths[Pa[i-1]]===0;)i--;t.write(0,1),t.write(i-4,4);for(let c=0;c<i;c++)t.write(a.lengths[Pa[c]],3);t.write(0,1);for(let c of o)Ve(t,a,c.code),t.write(c.extra,c.extraBits);}function Ur(t){let e=t-1;if(e<4)return {symbol:e,extra:0,extraBits:0};let n=31-Math.clz32(e),o=e>>n-1&1,r=n-1;return {symbol:2*n+o,extra:e&(1<<r)-1,extraBits:r}}function ul(t,e,n,o){let r=0;for(;r<o&&t[e+r]===t[e+r-n];)r++;return r}function ml(t,e,n){let o=t.length,r=0;for(;r<o;){let a=Math.min(4096,o-r),i=r>=1?ul(t,r,1,a):0,c=r>=e?ul(t,r,e,a):0;if(Math.max(i,c)>=3){c>=i?(n.copy(c,e===1?2:1),r+=c):(n.copy(i,2),r+=i);continue}n.literal(t[r]),r++;}}var dl=20;function fl(t,e,n){for(let o=0;o<n.length;o++)t[e+o]=n.charCodeAt(o);}function hl(t,e,n){t[e]=n&255,t[e+1]=n>>>8&255,t[e+2]=n>>>16&255,t[e+3]=n>>>24&255;}function Ia(t,e,n){if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>16384||n>16384)throw new RangeError(`WebP images are 1 to 16384 pixels wide and high (got ${e} \xD7 ${n})`);let o=e*n;if(t.length<o*4)throw new RangeError(`Expected ${o*4} bytes of RGBA for ${e} \xD7 ${n}, got ${t.length}`);let r=new Uint32Array(o),a=false;for(let M=0;M<o;M++){let $=M*4,S=t[$],R=t[$+1],w=t[$+2],P=t[$+3];P!==255&&(a=true),r[M]=(P<<24|(S-R&255)<<16|R<<8|w-R&255)>>>0;}let i=new Uint32Array(280),c=new Uint32Array(256),s=new Uint32Array(256),l=new Uint32Array(256),u=new Uint32Array(40);ml(r,e,{literal(M){i[M>>>8&255]++,c[M>>>16&255]++,s[M&255]++,l[M>>>24]++;},copy(M,$){i[256+Ur(M).symbol]++,u[Ur($).symbol]++;}});let m=[i,c,s,l,u].map(M=>pl(M,15)),[f,d,p,h,g]=m.map(gl),b=new va(Math.ceil(o/4)+1024);b.write(47,8),b.write(e-1,14),b.write(n-1,14),b.write(a?1:0,1),b.write(0,3),b.write(1,1),b.write(2,2),b.write(0,1),b.write(0,1),b.write(0,1);for(let M of m)v1(b,M);ml(r,e,{literal(M){Ve(b,f,M>>>8&255),Ve(b,d,M>>>16&255),Ve(b,p,M&255),Ve(b,h,M>>>24);},copy(M,$){let S=Ur(M);Ve(b,f,256+S.symbol),b.write(S.extra,S.extraBits);let R=Ur($);Ve(b,g,R.symbol),b.write(R.extra,R.extraBits);}});let _=b.finish(),y=_.length+(_.length&1),C=new Uint8Array(dl+y);return fl(C,0,"RIFF"),hl(C,4,C.length-8),fl(C,8,"WEBPVP8L"),hl(C,16,_.length),C.set(_,dl),C}function La(t,e,n){return String.fromCharCode(...t.subarray(e,e+n))}function bl(t){return t.length>=12&&La(t,0,4)==="RIFF"&&La(t,8,4)==="WEBP"}function Ta(t){if(!bl(t))return null;let e=12;for(;e+8<=t.length;){let n=La(t,e,4);if(n==="VP8L")return "lossless";if(n==="VP8 ")return "lossy";let o=(t[e+4]|t[e+5]<<8|t[e+6]<<16|t[e+7]<<24)>>>0;e+=8+o+(o&1);}return null}function L1(t,e,n){return typeof t.toBlob!="function"?Promise.resolve(null):new Promise(o=>{try{t.toBlob(o,e,n);}catch{o(null);}})}async function qr(t,e={}){let n=e.quality!==void 0,o=n?Math.min(1,Math.max(0,Number(e.quality))):1,r=await L1(t,"image/webp",o);if(r){let s=new Uint8Array(await r.arrayBuffer()),l=Ta(s);if(l==="lossless"||n&&l==="lossy")return new Blob([s],{type:"image/webp"})}let a=t.getContext("2d");if(!a)throw new Error("Could not get canvas context");let{data:i}=a.getImageData(0,0,t.width,t.height),c=Ia(i,t.width,t.height);return new Blob([c],{type:"image/webp"})}var _l=32768;async function jn(t){let e=new Uint8Array(await t.arrayBuffer()),n="";for(let o=0;o<e.length;o+=_l)n+=String.fromCharCode(...e.subarray(o,o+_l));return `data:${t.type||"application/octet-stream"};base64,${btoa(n)}`}async function Wt(t){let e={...t};if(t.imageSettings?.src)try{let u=await I1(t.imageSettings.src);e={...t,imageSettings:{...t.imageSettings,src:u}};}catch{let{imageSettings:u,...m}=t;e=m;}let{hideLogo:n,url:o,logo:r,scale:a,frameLabelMarkers:i,partMarkers:c,...s}=e,l=Aa({...s,templateId:e.templateId,customTemplate:e.customTemplate});return `data:image/svg+xml,${encodeURIComponent(l)}`}var I1=t=>new Promise((e,n)=>{if(t.startsWith("data:")){e(t);return}let o=new Image;o.crossOrigin="anonymous",o.onload=()=>{try{let r=document.createElement("canvas");r.width=o.naturalWidth||o.width,r.height=o.naturalHeight||o.height;let a=r.getContext("2d");if(!a){n(new Error("Could not get canvas context"));return}a.drawImage(o,0,0);let i=r.toDataURL("image/png");r.remove(),e(i);}catch(r){n(new Error(`Failed to convert image to base64: ${r}`));}},o.onerror=()=>{n(new Error(`Could not load image from ${t.slice(0,100)}... Check CORS settings or use a data URL.`));},o.src=t;});async function En(t,e,n){let o=await Wt(t),r=decodeURIComponent(o.replace("data:image/svg+xml,","")),a;try{let i=new TextEncoder().encode(r),c=Array.from(i,l=>String.fromCharCode(l)).join("");a=`data:image/svg+xml;base64,${btoa(c)}`;}catch(i){throw new Error(`Failed to encode SVG for canvas conversion: ${i}`)}return new Promise((i,c)=>{let s=document.createElement("canvas"),l=s.getContext("2d");if(!l){c(new Error("Could not get canvas context"));return}let u=new Image,{width:m,height:f}=ue(t.size||ft,t.frame);s.width=Math.round(m),s.height=Math.round(f);let d=setTimeout(()=>{s.remove(),c(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);u.onload=()=>{clearTimeout(d);try{if(e==="image/jpeg"&&(l.fillStyle="white",l.fillRect(0,0,s.width,s.height)),l.drawImage(u,0,0,s.width,s.height),n)i(s);else if(e==="image/webp")qr(s).then(jn).then(i,c).finally(()=>s.remove());else {let p=s.toDataURL(e,1);s.remove(),i(p);}}catch(p){clearTimeout(d),s.remove(),c(new Error(`Failed to draw SVG to canvas: ${p}`));}},u.onerror=()=>{clearTimeout(d),s.remove(),c(new Error("Could not load SVG"));},u.src=a;})}var yl=["gradientUnits","gradientTransform","spreadMethod"],T1={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},F1={r:0,g:0,b:0,a:1};function xl(t,e){for(let n of (t.attrs.style??"").split(";")){let[o,...r]=n.split(":");if(o?.trim()===e)return r.join(":").trim()}return t.attrs[e]}function Fa(t){return t.name==="linearGradient"?"linear":t.name==="radialGradient"?"radial":null}function k1(t){let e=[],n=0;for(let o of t.children){if(o.name!=="stop")continue;let r=(o.attrs.offset??"0").trim(),a=Number.parseFloat(r),i=Number.isFinite(a)?r.endsWith("%")?a/100:a:0;n=Math.max(n,Math.min(Math.max(i,0),1));let c=xl(o,"stop-color")??"#000000",s=dt(c==="currentColor"?"#000000":c)??F1,l=Number.parseFloat(xl(o,"stop-opacity")??"1");e.push({offset:n,color:Number.isFinite(l)?{...s,a:s.a*Math.min(Math.max(l,0),1)}:s});}return e}function zr(t){let e=new Map,n=r=>{let a=r.attrs.id;Fa(r)&&a&&!e.has(a)&&e.set(a,r);for(let i of r.children)n(i);};n(t);let o=new Map;for(let[r,a]of e){let i=Fa(a),c={},s=[],l=new Set,u=a;for(;u&&!l.has(u);){l.add(u);let m=Fa(u)===i?[...yl,...T1[i]]:yl;for(let d of m){let p=u.attrs[d];c[d]===void 0&&p!==void 0&&(c[d]=p);}s.length===0&&(s=k1(u));let f=u.attrs.href??u.attrs["xlink:href"];u=f?.startsWith("#")?e.get(f.slice(1)):void 0;}o.set(r,{kind:i,attrs:c,stops:s});}return o}function ka(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(m,f)=>{e=Math.min(e,m),o=Math.max(o,m),n=Math.min(n,f),r=Math.max(r,f);},i=(m,f,d,p)=>{let h=-m+3*f-3*d+p,g=2*(m-2*f+d),b=f-m;if(Math.abs(h)<1e-12)return Math.abs(g)<1e-12?[]:[-b/g];let _=g*g-4*h*b;if(_<0)return [];let y=Math.sqrt(_);return [(-g+y)/(2*h),(-g-y)/(2*h)]},c=(m,f,d,p,h)=>{let g=1-m;return g*g*g*f+3*g*g*m*d+3*g*m*m*p+m**3*h},s=0,l=0,u=[0,0];for(let m of t)if(m.op==="M"&&(u=[m.x,m.y]),m.op==="M"||m.op==="L")a(m.x,m.y),s=m.x,l=m.y;else if(m.op==="C"){a(m.x,m.y);for(let f of [...i(s,m.x1,m.x2,m.x),...i(l,m.y1,m.y2,m.y)])f>0&&f<1&&a(c(f,s,m.x1,m.x2,m.x),c(f,l,m.y1,m.y2,m.y));s=m.x,l=m.y;}else [s,l]=u;return Number.isFinite(e)?{x:e,y:n,width:o-e,height:r-n}:null}var N1=t=>t[0]*t[3]-t[1]*t[2];function Ee(t){let e=N1(t);if(!Number.isFinite(e)||Math.abs(e)<1e-12)return null;let[n,o,r,a,i,c]=t;return [a/e,-o/e,-r/e,n/e,(r*c-a*i)/e,(o*i-n*c)/e]}function Sl(t,e,n){let{kind:o,attrs:r,stops:a}=t,i=a[0],c=a.at(-1);if(!(i&&c)||a.every($=>$.color.a===0))return null;if(a.length===1)return i.color;let s=r.gradientUnits==="userSpaceOnUse",l=sr;if(!s){let $=ka(e);if(!$||$.width<=0||$.height<=0)return null;l=[$.width,0,0,$.height,$.x,$.y];}let u=ht(l,Zt(r.gradientTransform));if(!Ee(u))return c.color;let[m,f]=n,d=Math.sqrt((m*m+f*f)/2),p=($,S)=>{let R=Number.parseFloat($);return Number.isFinite(R)?$.trim().endsWith("%")?R/100*(s?S:1):R:null},h=($,S,R)=>p(r[$]??S,R)??p(S,R)??0;if(o==="linear"){let $=[h("x1","0%",m),h("y1","0%",f),h("x2","100%",m),h("y2","0%",f)],[S,R,w,P]=$;return S===w&&R===P?c.color:{kind:o,coords:$,matrix:u,stops:a}}let g=h("cx","50%",m),b=h("cy","50%",f),_=h("r","50%",d),y=r.fx===void 0?g:h("fx","50%",m),C=r.fy===void 0?b:h("fy","50%",f),M=Math.max(0,h("fr","0%",d));return _<0?null:_===0?c.color:{kind:o,coords:[y,C,M,g,b,_],matrix:u,stops:a}}function Wr(t){return t.map(e=>x(e,6)).join(" ")}function O1(t,e){return (e==="cmyk"?$e(t.r,t.g,t.b):[t.r/255,t.g/255,t.b/255]).map(o=>x(o,4)).join(" ")}var $l=(t,e)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${t}] /C1 [${e}] /N 1 >>`;function D1(t,e){let n=[],o=t.map(c=>it(c.offset,4)),r=t.map(c=>O1(c.color,e)),a=o[0],i=o.at(-1);if(a>0){let c=r[0];n.push({from:0,to:a,c0:c,c1:c});}for(let c=0;c+1<t.length;c++){let s=o[c],l=o[c+1];l>s&&n.push({from:s,to:l,c0:r[c],c1:r[c+1]});}if(i<1){let c=r.at(-1);n.push({from:i,to:1,c0:c,c1:c});}if(n.length===1){let[c]=n;return $l(c.c0,c.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${n.map(c=>$l(c.c0,c.c1)).join(" ")}]`,`/Bounds [${n.slice(1).map(c=>x(c.from,4)).join(" ")}]`,`/Encode [${n.map(()=>"0 1").join(" ")}] >>`].join(" ")}function Hr(t,e){return [`<< /ShadingType ${t.kind==="linear"?2:3}`,`/ColorSpace /Device${e==="cmyk"?"CMYK":"RGB"}`,`/Coords [${t.coords.map(n=>x(n,6)).join(" ")}]`,`/Function ${D1(t.stops,e)}`,"/Extend [true true] >>"].join(" ")}function Q1(t,e){if(t.op==="Z")return t;if(t.op==="C"){let[r,a]=j(e,t.x1,t.y1),[i,c]=j(e,t.x2,t.y2),[s,l]=j(e,t.x,t.y);return {op:"C",x1:r,y1:a,x2:i,y2:c,x:s,y:l}}let[n,o]=j(e,t.x,t.y);return {op:t.op,x:n,y:o}}var Cl={r:255,g:255,b:255,a:1},B1=/^url\(\s*#bg-color-/,Vr=/^url\(\s*#([^)\s]+)\s*\)/,G1=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function K(t,e){let n=t.attrs.style;if(n)for(let o of n.split(";")){let[r,...a]=o.split(":");if(r?.trim()===e)return a.join(":").trim()}return t.attrs[e]}function Y(t,e,n=0){if(t===void 0||t==="")return n;let o=Number.parseFloat(t);return Number.isNaN(o)?n:t.trim().endsWith("%")?o/100*e:o}function Yn(t,e){if((t.name==="linearGradient"||t.name==="radialGradient")&&t.attrs.id){let n=t.children.find(r=>r.name==="stop"),o=n&&(K(n,"stop-color")??"#000000");o&&e.set(t.attrs.id,o);}for(let n of t.children)Yn(n,e);return e}function Xn(t,e){if(t.name==="image"){let n=t.attrs.href??t.attrs["xlink:href"];n&&e.add(n);}for(let n of t.children)Xn(n,e);return e}function jr(t){return /^data:image\/png[;,]/i.test(t)?"PNG":/^data:image\/jpe?g[;,]/i.test(t)?"JPEG":null}async function Yr(t){return typeof document>"u"||typeof Image>"u"?null:await new Promise(e=>{let n=new Image;n.crossOrigin="anonymous",n.onload=()=>{let o=document.createElement("canvas"),r=Math.max(n.naturalWidth||512,n.naturalHeight||512),a=Math.min(1024/r,4);o.width=Math.round((n.naturalWidth||512)*a),o.height=Math.round((n.naturalHeight||512)*a);let i=o.getContext("2d");if(!i){e(null);return}i.drawImage(n,0,0,o.width,o.height);try{e(o.toDataURL("image/png"));}catch{e(null);}},n.onerror=()=>e(null),n.src=t;})}function Ml(t,e,n){let o={x:Y(t.attrs.x,e[0]),y:Y(t.attrs.y,e[1]),width:Y(t.attrs.width,e[0]),height:Y(t.attrs.height,e[1])};if(o.width<=0||o.height<=0)return null;let r=(t.attrs.preserveAspectRatio??"").trim();if(!r||r.startsWith("none")||!n||!(n.width>0&&n.height>0))return {draw:o,clip:null};let[a="xMidYMid",i="meet"]=r.split(/\s+/),c=i==="slice",s=(c?Math.max:Math.min)(o.width/n.width,o.height/n.height),l=n.width*s,u=n.height*s,m=f=>{let d=f==="x"?a.slice(0,4):a.slice(4);return d.endsWith("Min")?0:d.endsWith("Max")?1:.5};return {draw:{x:o.x+(o.width-l)*m("x"),y:o.y+(o.height-u)*m("y"),width:l,height:u},clip:c?o:null}}function wl(t,e){t.name==="clipPath"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)wl(n,e);return e}function Rl(t,e){t.name==="pattern"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)Rl(n,e);return e}function U1(t,e){let[n,o]=e,r=(a,i)=>Y(t.attrs[a],i);switch(t.name){case "path":return se(t.attrs.d??"");case "rect":{let a=t.attrs.rx??t.attrs.ry,i=t.attrs.ry??t.attrs.rx;return Jt(r("x",n),r("y",o),r("width",n),r("height",o),Y(a,n),Y(i,o))}case "circle":{let a=r("r",Math.hypot(n,o)/Math.SQRT2);return Kt(r("cx",n),r("cy",o),a,a)}case "ellipse":return Kt(r("cx",n),r("cy",o),r("rx",n),r("ry",o));default:return []}}var An=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=Cl;paper=Cl;background=null;onPaper=false;inConic=false;constructor(e,n=null){this.gradients=e,this.shadings=n;}resolveColor(e){if(!e||e==="none")return null;let n=Vr.exec(e);if(n)return this.resolveColor(this.gradients.get(n[1]));let o=dt(e==="currentColor"?"#000000":e);return o&&o.a>0?o:null}shadedGradient(e){let n=e?Vr.exec(e)?.[1]:void 0;return n?this.shadings?.get(n):void 0}resolveFill(e,n,o,r=1){if(r<=0)return null;let a=this.patternOf(e);if(a)return {pattern:a,alpha:r};let i=this.shadedGradient(e);if(i){let l=Sl(i,n,o);if(!l)return null;if("coords"in l)return {gradient:l,alpha:r};let u={...l,a:l.a*r};return u.a>0?{color:u}:null}let c=this.resolveColor(e);if(!c)return null;let s={...c,a:c.a*r};return s.a>0?{color:s}:null}patternOf(e){let n=e?Vr.exec(e)?.[1]:void 0,o=n?this.patterns.get(n):void 0;if(!(o?.attrs.patternUnits!=="userSpaceOnUse"||(o.attrs.patternContentUnits??"userSpaceOnUse")!=="userSpaceOnUse"||o.attrs.viewBox))return o}flatten(e){if(e.a>=1)return e;let n=this.background,o=n!==null&&Math.abs(n.r-e.r)<.5&&Math.abs(n.g-e.g)<.5&&Math.abs(n.b-e.b)<.5&&Math.abs(n.a-e.a)<.002;return Dr(e,this.onPaper||o?this.paper:this.backdrop)}paintPattern(e,n,o,r){let a=ka(e);if(!a||a.width<=0||a.height<=0)return true;let[i,c]=n.viewport,s=Y(o.attrs.x,i),l=Y(o.attrs.y,c),u=Y(o.attrs.width,i),m=Y(o.attrs.height,c);if(!(u>0&&m>0))return true;let f=Zt(o.attrs.patternTransform),d=Ee(f);if(!d)return true;if(!this.beginClip(e,n.matrix,n.fillRule==="evenodd"))return false;let p=this.inConic;this.inConic=o.attrs["data-qrdx-conic"]!==void 0;try{let h=[j(d,a.x,a.y),j(d,a.x+a.width,a.y),j(d,a.x,a.y+a.height),j(d,a.x+a.width,a.y+a.height)],g=h.map(([I])=>I),b=h.map(([,I])=>I),_=Math.min(...g),y=Math.max(...g),C=Math.min(...b),M=Math.max(...b),$=Math.floor((_-s)/u),S=Math.ceil((y-s)/u)-1,R=Math.floor((C-l)/m),w=Math.ceil((M-l)/m)-1,P=(S-$+1)*(w-R+1);if(P>4096)return !0;let v=(o.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),L=ht(n.matrix,f);for(let I=R;I<=w;I++)for(let F=$;F<=S;F++){let O=s+F*u,T=l+I*m,B=ht(L,[1,0,0,1,O,T]),H={x:_-O,y:C-T,width:y-_,height:M-C},Q=v.length===2&&v.every(Number.isFinite)?Zc(v[0],v[1],H):null,U=P>1&&this.beginClip([{op:"M",x:0,y:0},{op:"L",x:u,y:0},{op:"L",x:u,y:m},{op:"L",x:0,y:m},{op:"Z"}],B,!1);try{let tt={matrix:B,viewport:n.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:r},yt=(st,k)=>{for(let q of st){if(q.name==="g"&&!q.attrs.transform){let z=Number.parseFloat(q.attrs.opacity??"1");yt(q.children,{...k,opacity:(k.opacity??1)*(Number.isFinite(z)?z:1)});continue}if(Q&&q.attrs["data-arc"]){let[z,Ct]=q.attrs["data-arc"].split(/\s+/).map(Number);if(!Kc([z,z+Ct],Q))continue}this.walk(q,k);}};yt(o.children,tt);}finally{U&&this.endClip();}}}finally{this.inConic=p,this.endClip();}return true}paintBleed(e,n,o,r){if(!this.shadedGradient(o))return false;let[a,i]=this.viewportMatrix({...e,attrs:{...e.attrs,x:"0",y:"0"}},{...n,matrix:ht(n.matrix,Zt(e.attrs.transform))}),c=Ee(a);if(!c)return false;let[s,l,u,m]=r,d=[[s,l],[u,l],[u,m],[s,m]].map(([p,h])=>j(c,p,h)).map(([p,h],g)=>({op:g===0?"M":"L",x:p,y:h}));return d.push({op:"Z"}),this.paint(d,{name:"rect",attrs:{},children:[],text:""},{...n,matrix:a,viewport:i,fill:o,fillRule:"nonzero",stroke:"none"}),true}beginClip(e,n,o){return false}endClip(){}clipOf(e,n){let o=K(e,"clip-path"),r=o?Vr.exec(o)?.[1]:void 0,a=r?this.clipPaths.get(r):void 0;if(!a)return null;let i=[],c=false;for(let s of a.children){let l=U1(s,n.viewport);if(l.length===0)continue;let u=Zt(s.attrs.transform),m=u[0]===1&&u[1]===0&&u[2]===0&&u[3]===1&&u[4]===0&&u[5]===0;i.push(...m?l:l.map(f=>Q1(f,u))),c||=K(s,"clip-rule")==="evenodd";}return i.length>0?{segments:i,matrix:n.matrix,evenOdd:c}:null}viewportMatrix(e,n){let o=Y(e.attrs.x,n.viewport[0]),r=Y(e.attrs.y,n.viewport[1]),a=Y(e.attrs.width,n.viewport[0],n.viewport[0]),i=Y(e.attrs.height,n.viewport[1],n.viewport[1]),c=ke(e.attrs.viewBox);if(c.length!==4||!(c[2]&&c[3]))return [ht(n.matrix,[1,0,0,1,o,r]),[a,i]];let[s,l,u,m]=c,f=a/u,d=i/m,p=o,h=r;if((e.attrs.preserveAspectRatio??"").trim()!=="none"){let g=e.attrs.preserveAspectRatio?.includes("slice")?Math.max(f,d):Math.min(f,d);p+=(a-u*g)/2,h+=(i-m*g)/2,f=g,d=g;}return [ht(n.matrix,[f,0,0,d,p-s*f,h-l*d]),[u,m]]}walk(e,n,o=false){if(o&&(this.clipPaths=wl(e,new Map),this.patterns=Rl(e,new Map)),G1.has(e.name)||K(e,"display")==="none"||K(e,"visibility")==="hidden")return;let r=ht(n.matrix,Zt(e.attrs.transform)),a=n.viewport;if(e.name==="svg"){let[f,d]=this.viewportMatrix(o?{...e,attrs:{...e.attrs,x:"0",y:"0"}}:e,{...n,matrix:r});r=f,a=d;}let i=K(e,"font-size"),c=Number.parseFloat(K(e,"opacity")??"1"),s=K(e,"fill-opacity"),l=s===void 0?n.fillOpacity??1:Number.parseFloat(s),u={fillOpacity:Number.isFinite(l)?Math.min(Math.max(l,0),1):1,opacity:(n.opacity??1)*(Number.isFinite(c)?Math.min(Math.max(c,0),1):1),matrix:r,viewport:a,fill:K(e,"fill")??n.fill,fillRule:K(e,"fill-rule")??n.fillRule,stroke:K(e,"stroke")??n.stroke,strokeWidth:K(e,"stroke-width")===void 0?n.strokeWidth:Y(K(e,"stroke-width"),a[0],1),fontSize:i===void 0?n.fontSize:Y(i,16,16),fontWeight:K(e,"font-weight")??n.fontWeight,textAnchor:K(e,"text-anchor")??n.textAnchor},m=this.onPaper;(e.name==="rect"||e.name==="circle"||e.name==="path")&&B1.test(K(e,"fill")??"")&&(this.onPaper=true);try{let f=e.attrs["clip-path"]?this.clipOf(e,u):null;if(f&&this.beginClip(f.segments,f.matrix,f.evenOdd)){try{this.paintNode(e,u);}finally{this.endClip();}return}this.paintNode(e,u);}finally{this.onPaper=m;}}paintNode(e,n){let[o,r]=n.viewport,a=(i,c)=>Y(e.attrs[i],c);switch(e.name){case "path":this.paint(se(e.attrs.d??""),e,n);return;case "rect":{let i=e.attrs.rx??e.attrs.ry,c=e.attrs.ry??e.attrs.rx;this.paint(Jt(a("x",o),a("y",r),a("width",o),a("height",r),Y(i,o),Y(c,r)),e,n);return}case "circle":{let i=a("r",Math.hypot(o,r)/Math.SQRT2);this.paint(Kt(a("cx",o),a("cy",r),i,i),e,n);return}case "ellipse":this.paint(Kt(a("cx",o),a("cy",r),a("rx",o),a("ry",r)),e,n);return;case "line":this.paint([{op:"M",x:a("x1",o),y:a("y1",r)},{op:"L",x:a("x2",o),y:a("y2",r)}],e,{...n,fill:"none"});return;case "polygon":case "polyline":{let i=ke(e.attrs.points),c=[];for(let s=0;s+1<i.length;s+=2)c.push({op:s===0?"M":"L",x:i[s],y:i[s+1]});e.name==="polygon"&&c.length>0&&c.push({op:"Z"}),this.paint(c,e,n);return}case "text":this.text(e,n);return;case "image":this.image(e,n);return;default:for(let i of e.children)this.walk(i,n);}}};var Xr=1e3;async function Zn(t){let e=await Wt(je({...t,size:t.size??ft},Xr));return decodeURIComponent(e.replace("data:image/svg+xml,",""))}function Na(t){if(Qt(t.frame)){let e=qe(Xr,t.frame);return e.squareEdges?e.color:null}return wt(t.bgColor,gt)}function Zr(t,e){let n=Na(t);if(!(n&&cn(t.bgColor))||Qt(t.frame)||t.templateId||t.customTemplate)return n;let o=_e(e)?.children.find(a=>a.name==="rect"),r=o&&K(o,"fill");return r?.startsWith("url(")?r:n}function Kr(t,e){let n={r:255,g:255,b:255,a:1},o=dt(wt(e.bgColor,gt));t.paper=n,t.background=o&&!cn(e.bgColor)?o:null,t.backdrop=o?Dr(o,n):n;}var Jr=25.4,El=5,Al=2e3,he=Xr,Oa=5,Pl=2,z1=.25*(Jr/72);function W1(t,e="mm"){return e==="in"?t*Jr:t}function H1(t){let e=Bt(t),n=xt.QrCode.encodeText(t.value,Et[e]).size;return n+It(n,t.margin??$t,t.shape)*2}function to(t,e){let n=W1(e.size,e.unit);if(!Number.isFinite(n)||n<El||n>Al)throw new Error(`Print size must be between ${El} mm and ${Al/1e3} m`);let o=Math.min(Math.max(e.bleed??0,0),20),r=n/he,a=Qt(t.frame)?qe(he,t.frame):null,i=(a?.width??he)*r,c=(a?.height??he)*r,s=e.cropMarks?o+Pl+Oa+1:o,l=H1(t);return {codeWidth:n,trimWidth:i,trimHeight:c,bleed:o,pageWidth:i+2*s,pageHeight:c+2*s,trimX:s,trimY:s,moduleSize:n/l,moduleCount:l,maxScanDistance:n*10}}var Da=class t{pdf;internals;names=new Map;constructor(e,n){this.pdf=e,this.internals=n;}static attach(e){let n=e.internal;return typeof e.advancedAPI!="function"||typeof e.addShadingPattern!="function"||typeof n.write!="function"||typeof n.events?.subscribe!="function"?null:new t(e,n)}name(e){let n=this.names.get(e);return n||(this.names.size===0&&this.install(),n=`Sh${this.names.size}`,this.names.set(e,n)),n}install(){this.pdf.advancedAPI(e=>{e.addShadingPattern("qrdx-shadings",{});}),this.internals.events.subscribe("putShadingPatternDict",()=>{for(let[e,n]of this.names)this.internals.write(`/${n} ${e}`);});}},Qa=class extends An{pdf;cmyk;images;shadingResources;constructor(e,n,o,r,a){super(o,r?.gradients??null),this.pdf=e,this.cmyk=n,this.images=a,this.shadingResources=r?.resources??null;}setColor(e,n){let o=e==="fill"?this.pdf.setFillColor.bind(this.pdf):e==="draw"?this.pdf.setDrawColor.bind(this.pdf):this.pdf.setTextColor.bind(this.pdf);if(this.cmyk){let[r,a,i,c]=$e(n.r,n.g,n.b);o(r,a,i,c);}else o(Math.round(n.r),Math.round(n.g),Math.round(n.b));}setRegistrationColor(){this.cmyk?this.pdf.setDrawColor(1,1,1,1):this.pdf.setDrawColor(0,0,0);}tracePath(e,n){let o=false;for(let r of e)if(r.op==="M"){let[a,i]=j(n,r.x,r.y);this.pdf.moveTo(a,i),o=true;}else if(r.op==="L"){let[a,i]=j(n,r.x,r.y);o?this.pdf.lineTo(a,i):(this.pdf.moveTo(a,i),o=true);}else if(r.op==="C"){let[a,i]=j(n,r.x1,r.y1),[c,s]=j(n,r.x2,r.y2),[l,u]=j(n,r.x,r.y);this.pdf.curveTo(a,i,c,s,l,u);}else o&&this.pdf.close();}shade(e,n,o){let r=this.pdf.internal,a=r.scaleFactor,i=[a,0,0,-a,0,r.pageSize.getHeight()*a],c=ht(i,ht(n.matrix,o.matrix));if(!(this.shadingResources&&Ee(c)))return;let s=this.shadingResources.name(Hr(o,this.cmyk?"cmyk":"rgb"));this.pdf.saveGraphicsState(),this.tracePath(e,n.matrix),this.pdf.clip(n.fillRule==="evenodd"?"evenodd":void 0),this.pdf.discardPath(),r.write(`${Wr(c)} cm /${s} sh`),this.pdf.restoreGraphicsState();}beginClip(e,n,o){return this.pdf.saveGraphicsState(),this.tracePath(e,n),this.pdf.clip(o?"evenodd":void 0),this.pdf.discardPath(),true}endClip(){this.pdf.restoreGraphicsState();}withAlpha(e,n,o){if(e>=1&&n>=1){o();return}this.pdf.saveGraphicsState();let r=this.pdf.GState;this.pdf.setGState(new r({opacity:e,"stroke-opacity":n}));try{o();}finally{this.pdf.restoreGraphicsState();}}opaqueGradient(e,n){let o=e.stops[0]?.color.a??1;return e.stops.every(a=>Math.abs(a.color.a-o)<.002)?{gradient:{...e,stops:e.stops.map(a=>({...a,color:{...a.color,a:1}}))},alpha:o*n}:{gradient:{...e,stops:e.stops.map(a=>({...a,color:this.flatten({...a.color,a:a.color.a*n})}))},alpha:1}}paint(e,n,o){if(e.length===0)return;let r=o.opacity??1;if(r<=0)return;let a=this.resolveFill(o.fill,e,o.viewport,(o.fillOpacity??1)*r);if(a&&"pattern"in a)this.paintPattern(e,o,a.pattern,a.alpha);else if(a&&"gradient"in a){let{gradient:m,alpha:f}=this.opaqueGradient(a.gradient,a.alpha);this.withAlpha(f,1,()=>this.shade(e,o,m));}let i=a&&"color"in a?a.color:null,c=i&&this.inConic?this.flatten(i):i,s=o.strokeWidth>0?this.resolveColor(o.stroke):null,l=s&&{...s,a:s.a*r};if(!(c||l))return;let u=o.fillRule==="evenodd";this.withAlpha(c?.a??1,l?.a??1,()=>{c&&this.setColor("fill",c),l&&(this.setColor("draw",l),this.pdf.setLineWidth(o.strokeWidth*mn(o.matrix))),this.tracePath(e,o.matrix),c&&l?u?this.pdf.fillStrokeEvenOdd():this.pdf.fillStroke():c?u?this.pdf.fillEvenOdd():this.pdf.fill():this.pdf.stroke();});}text(e,n){let o=e.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let a=mn(n.matrix),[i,c]=j(n.matrix,Y(e.attrs.x,n.viewport[0]),Y(e.attrs.y,n.viewport[1])),s=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600;this.pdf.setFont("helvetica",s?"bold":"normal");let l=n.fontSize*a*(72/Jr);this.pdf.setFontSize(l);let u=Number.parseFloat(e.attrs["data-max-width"]??"");if(u>0){let d=u*a,p=this.pdf.getTextWidth(o);p>d&&(l*=d/p,this.pdf.setFontSize(l));}this.setColor("text",r);let m=Math.atan2(n.matrix[1],n.matrix[0]);if(Math.abs(m)>2e-4){let d=n.textAnchor==="middle"?this.pdf.getTextWidth(o)/2:n.textAnchor==="end"?this.pdf.getTextWidth(o):0;this.pdf.text(o,i-d*Math.cos(m),c-d*Math.sin(m),{angle:-m*180/Math.PI,baseline:"alphabetic"});return}let f=n.textAnchor==="middle"?"center":n.textAnchor==="end"?"right":"left";this.pdf.text(o,i,c,{align:f,baseline:"alphabetic"});}aliases=new Map;image(e,n){let o=e.attrs.href??e.attrs["xlink:href"],r=o&&(jr(o)?o:this.images.get(o)),a=r&&jr(r);if(!(r&&a))return;let i=this.aliases.get(r);i||(i=`qrdx-image-${this.aliases.size}`,this.aliases.set(r,i));let c=null;if(e.attrs.preserveAspectRatio)try{let g=this.pdf.getImageProperties(r);c={width:g.width,height:g.height};}catch{c=null;}let s=Ml(e,n.viewport,c);if(!s)return;let{draw:l,clip:u}=s,[m,f]=j(n.matrix,l.x,l.y),[d,p]=j(n.matrix,l.x+l.width,l.y+l.height),h=u!==null&&this.beginClip([{op:"M",x:u.x,y:u.y},{op:"L",x:u.x+u.width,y:u.y},{op:"L",x:u.x+u.width,y:u.y+u.height},{op:"L",x:u.x,y:u.y+u.height},{op:"Z"}],n.matrix,false);try{this.withAlpha(n.opacity??1,1,()=>{this.pdf.addImage(r,a,Math.min(m,d),Math.min(f,p),Math.abs(d-m),Math.abs(p-f),i);});}finally{h&&this.endClip();}}};function V1(t,e,n){let{trimX:o,trimY:r,trimWidth:a,trimHeight:i,bleed:c}=n,s=c+Pl,l=o,u=o+a,m=r,f=r+i;e.setRegistrationColor(),t.setLineWidth(z1);for(let d of [l,u]){let p=d===l?-1:1;for(let h of [m,f]){let g=h===m?-1:1;t.line(d+p*s,h,d+p*(s+Oa),h),t.line(d,h+g*s,d,h+g*(s+Oa));}}}async function j1(t,e){return (await vl(t,e)).output("dataurlstring")}async function Db(t,e){return (await vl(t,e)).output("arraybuffer")}async function vl(t,e){let n=to(t,e),o;try{({jsPDF:o}=await import('jspdf'));}catch(b){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${b})`)}let r=await Zn(t),a=_e(r);if(!a)throw new Error("Failed to render the QR code for printing");let i=new Map;for(let b of Xn(a,new Set))if(!jr(b)){let _=await Yr(b);_&&i.set(b,_);}let c=new o({orientation:n.pageWidth>n.pageHeight?"landscape":"portrait",unit:"mm",format:[n.pageWidth,n.pageHeight],compress:true,floatPrecision:3});c.setProperties({title:"QR code",creator:"qrdx"});let s=zr(a),l=s.size>0?Da.attach(c):null,u=new Qa(c,e.colorMode==="cmyk",Yn(a,new Map),l?{gradients:s,resources:l}:null,i);Kr(u,t);let m=n.codeWidth/he,f=Y(a.attrs.width,he,he),d=Y(a.attrs.height,he,he),p={matrix:ht([1,0,0,1,n.trimX,n.trimY],[m,0,0,m,0,0]),viewport:[f,d],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},h=n.bleed>0?Zr(t,r):null,g=[n.trimX-n.bleed,n.trimY-n.bleed,n.trimX+n.trimWidth+n.bleed,n.trimY+n.trimHeight+n.bleed];if(!(h&&u.paintBleed(a,p,h,g))){let b=h?u.resolveColor(h):null;b&&(u.setColor("fill",b),c.rect(n.trimX-n.bleed,n.trimY-n.bleed,n.trimWidth+2*n.bleed,n.trimHeight+2*n.bleed,"F"));}return u.walk(a,p,true),e.cropMarks&&V1(c,u,n),c}async function Y1(t,e){let n=to(t,{size:e.size,unit:e.unit}),o=await Zn(t),r=e.unit??"mm",a=s=>`${x(r==="in"?s/Jr:s)}${r}`,i=/^<svg\b[^>]*>/.exec(o)?.[0];if(!i)throw new Error("Failed to render the QR code for printing");return `<?xml version="1.0" encoding="UTF-8"?>
2
- ${i.replace(/\swidth="[^"]*"/,` width="${a(n.trimWidth)}"`).replace(/\sheight="[^"]*"/,` height="${a(n.trimHeight)}"`)}${o.slice(i.length)}`}async function Qb(t,e){let n=await j1(t,e);re(n,e.filename??"qr-code-print.pdf");}async function Bb(t,e){let n=await Y1(t,e);re(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`,e.filename??"qr-code-print.svg");}var X1=[137,80,78,71,13,10,26,10];async function Il(t,e){let n=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(n).arrayBuffer())}async function Tl(t){return typeof CompressionStream>"u"?null:await Il(t,new CompressionStream("deflate"))}async function Z1(t){if(typeof DecompressionStream>"u")return null;try{return await Il(t,new DecompressionStream("deflate"))}catch{return null}}var Ba=(t,e)=>t[e]*2**24+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3]>>>0,Ll={0:1,2:3,3:1,4:2,6:4};function K1(t,e,n){let o=t+e-n,r=Math.abs(o-t),a=Math.abs(o-e),i=Math.abs(o-n);return r<=a&&r<=i?t:a<=i?e:n}async function Ga(t){if(X1.some((h,g)=>t[g]!==h))return null;let e=8,n=0,o=0,r=-1,a=null,i=null,c=[];for(;e+8<=t.length;){let h=Ba(t,e),g=String.fromCharCode(...t.subarray(e+4,e+8)),b=t.subarray(e+8,e+8+h);if(e+=12+h,g==="IHDR"){n=Ba(b,0),o=Ba(b,4);let _=b[8];r=b[9];let y=b[12];if(_!==8||y!==0||!(r in Ll))return null}else if(g==="PLTE")a=b;else if(g==="tRNS")i=b;else if(g==="IDAT")c.push(b);else if(g==="IEND")break}if(!(n&&o)||n*o>4096*4096)return null;let s=new Uint8Array(c.reduce((h,g)=>h+g.length,0)),l=0;for(let h of c)s.set(h,l),l+=h.length;let u=await Z1(s),m=Ll[r],f=n*m;if(!u||u.length<o*(f+1))return null;let d=new Uint8Array(o*f);for(let h=0;h<o;h++){let g=u[h*(f+1)],b=u.subarray(h*(f+1)+1,(h+1)*(f+1)),_=h*f;for(let y=0;y<f;y++){let C=y>=m?d[_+y-m]:0,M=h>0?d[_-f+y]:0,$=h>0&&y>=m?d[_-f+y-m]:0,S=b[y],R=0;g===1?R=C:g===2?R=M:g===3?R=C+M>>1:g===4&&(R=K1(C,M,$)),d[_+y]=S+R&255;}}let p=new Uint8Array(n*o*4);for(let h=0;h<n*o;h++){let g=h*4,b=h*m;if(r===3){let _=d[b];p[g]=a?.[_*3]??0,p[g+1]=a?.[_*3+1]??0,p[g+2]=a?.[_*3+2]??0,p[g+3]=i?.[_]??255;}else if(r===0||r===4){let _=d[b];p[g]=_,p[g+1]=_,p[g+2]=_,p[g+3]=r===4?d[b+1]:255;}else p[g]=d[b],p[g+1]=d[b+1],p[g+2]=d[b+2],p[g+3]=r===6?d[b+3]:255;}return {width:n,height:o,data:p}}var J1=25.4,Fl=72/J1,tf=50;function ef(t){let e=/^data:[^,]*?(;base64)?,(.*)$/s.exec(t);if(!e)return null;try{let n=e[1]?atob(e[2]):decodeURIComponent(e[2]),o=new Uint8Array(n.length);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r)&255;return o}catch{return null}}function nf(t){if(t[0]!==255||t[1]!==216)return null;let e=2;for(;e+9<t.length;){if(t[e]!==255)return null;let n=t[e+1];if(n===216||n>=208&&n<=215){e+=2;continue}let o=t[e+2]<<8|t[e+3];if(n===192||n===193||n===194){let r=t[e+5]<<8|t[e+6],a=t[e+7]<<8|t[e+8],i=t[e+9];return {width:a,height:r,components:i,progressive:n===194}}e+=2+o;}return null}async function rf(t,e){let{width:n,height:o,data:r}=t,a=e?4:3,i=new Uint8Array(n*o*a);for(let s=0;s<n*o;s++){let l=r[s*4+3]/255,u=r[s*4]*l+255*(1-l),m=r[s*4+1]*l+255*(1-l),f=r[s*4+2]*l+255*(1-l);if(e){let[d,p,h,g]=$e(u,m,f);i.set([d*255,p*255,h*255,g*255].map(Math.round),s*a);}else i.set([Math.round(u),Math.round(m),Math.round(f)],s*a);}let c=await Tl(i);return {kind:"raw",width:n,height:o,components:a,bytes:c??i,compressed:!!c}}async function of(t,e){let n=t;if(!/^data:image\/(png|jpe?g)[;,]/i.test(n)){let i=await Yr(n);if(!i)return null;n=i;}let o=ef(n);if(!o)return null;let r=nf(o);if(r)return r.components===1||r.components===3?{kind:"jpeg",width:r.width,height:r.height,components:r.components,bytes:o,progressive:r.progressive}:null;let a=await Ga(o);return a?await rf(a,e):null}function af(t){let e="",n=0,o=r=>{e+=r,n+=r.length,n>=76&&(e+=`
3
- `,n=0);};for(let r=0;r<t.length;r+=4){let a=Math.min(4,t.length-r),i=0;for(let s=0;s<4;s++)i=i*256+(s<a?t[r+s]:0);if(i===0&&a===4){o("z");continue}let c=[];for(let s=0;s<5;s++)c.unshift(String.fromCharCode(i%85+33)),i=Math.floor(i/85);o(c.slice(0,a+1).join(""));}return `${e}~>`}var sf=`/qrdxdict 40 dict def
1
+ 'use strict';var zod=require('zod'),framesIndex_js=require('./frames-index.js'),framesOfficial_js=require('./frames-official.js');var en;(a=>{class t{constructor(l,s,c,u){this.version=l;this.errorCorrectionLevel=s;if(l<t.MIN_VERSION||l>t.MAX_VERSION)throw new RangeError("Version value out of range");if(u<-1||u>7)throw new RangeError("Mask value out of range");this.size=l*4+17;let m=[];for(let d=0;d<this.size;d++)m.push(false);for(let d=0;d<this.size;d++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();let f=this.addEccAndInterleave(c);if(this.drawCodewords(f),u==-1){let d=1e9;for(let p=0;p<8;p++){this.applyMask(p),this.drawFormatBits(p);let h=this.getPenaltyScore();h<d&&(u=p,d=h),this.applyMask(p);}}o(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(l,s){let c=a.QrSegment.makeSegments(l);return t.encodeSegments(c,s)}static encodeBinary(l,s){let c=a.QrSegment.makeBytes(l);return t.encodeSegments([c],s)}static encodeSegments(l,s,c=1,u=40,m=-1,f=true){if(!(t.MIN_VERSION<=c&&c<=u&&u<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let d,p;for(d=c;;d++){let b=t.getNumDataCodewords(d,s)*8,_=r.getTotalBits(l,d);if(_<=b){p=_;break}if(d>=u)throw new RangeError("Data too long")}for(let b of [t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])f&&p<=t.getNumDataCodewords(d,b)*8&&(s=b);let h=[];for(let b of l){e(b.mode.modeBits,4,h),e(b.numChars,b.mode.numCharCountBits(d),h);for(let _ of b.getData())h.push(_);}o(h.length==p);let g=t.getNumDataCodewords(d,s)*8;o(h.length<=g),e(0,Math.min(4,g-h.length),h),e(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let b=236;h.length<g;b^=253)e(b,8,h);let y=[];for(;y.length*8<h.length;)y.push(0);return h.forEach((b,_)=>y[_>>>3]|=b<<7-(_&7)),new t(d,s,y,m)}size;mask;modules=[];isFunction=[];getModule(l,s){return 0<=l&&l<this.size&&0<=s&&s<this.size&&this.modules[s][l]}getModules(){return this.modules}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let l=this.getAlignmentPatternPositions(),s=l.length;for(let c=0;c<s;c++)for(let u=0;u<s;u++)c==0&&u==0||c==0&&u==s-1||c==s-1&&u==0||this.drawAlignmentPattern(l[c],l[u]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(l){let s=this.errorCorrectionLevel.formatBits<<3|l,c=s;for(let m=0;m<10;m++)c=c<<1^(c>>>9)*1335;let u=(s<<10|c)^21522;o(u>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,n(u,m));this.setFunctionModule(8,7,n(u,6)),this.setFunctionModule(8,8,n(u,7)),this.setFunctionModule(7,8,n(u,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,n(u,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,n(u,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,n(u,m));this.setFunctionModule(8,this.size-8,true);}drawVersion(){if(this.version<7)return;let l=this.version;for(let c=0;c<12;c++)l=l<<1^(l>>>11)*7973;let s=this.version<<12|l;o(s>>>18==0);for(let c=0;c<18;c++){let u=n(s,c),m=this.size-11+c%3,f=Math.floor(c/3);this.setFunctionModule(m,f,u),this.setFunctionModule(f,m,u);}}drawFinderPattern(l,s){for(let c=-4;c<=4;c++)for(let u=-4;u<=4;u++){let m=Math.max(Math.abs(u),Math.abs(c)),f=l+u,d=s+c;0<=f&&f<this.size&&0<=d&&d<this.size&&this.setFunctionModule(f,d,m!=2&&m!=4);}}drawAlignmentPattern(l,s){for(let c=-2;c<=2;c++)for(let u=-2;u<=2;u++)this.setFunctionModule(l+u,s+c,Math.max(Math.abs(u),Math.abs(c))!=1);}setFunctionModule(l,s,c){this.modules[s][l]=c,this.isFunction[s][l]=true;}addEccAndInterleave(l){let s=this.version,c=this.errorCorrectionLevel;if(l.length!=t.getNumDataCodewords(s,c))throw new RangeError("Invalid argument");let u=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][s],m=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][s],f=Math.floor(t.getNumRawDataModules(s)/8),d=u-f%u,p=Math.floor(f/u),h=[],g=t.reedSolomonComputeDivisor(m);for(let b=0,_=0;b<u;b++){let w=l.slice(_,_+p-m+(b<d?0:1));_+=w.length;let R=t.reedSolomonComputeRemainder(w,g);b<d&&w.push(0),h.push(w.concat(R));}let y=[];for(let b=0;b<h[0].length;b++)h.forEach((_,w)=>{(b!=p-m||w>=d)&&y.push(_[b]);});return o(y.length==f),y}drawCodewords(l){if(l.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let s=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let u=0;u<this.size;u++)for(let m=0;m<2;m++){let f=c-m,p=(c+1&2)==0?this.size-1-u:u;!this.isFunction[p][f]&&s<l.length*8&&(this.modules[p][f]=n(l[s>>>3],7-(s&7)),s++);}}o(s==l.length*8);}applyMask(l){if(l<0||l>7)throw new RangeError("Mask value out of range");for(let s=0;s<this.size;s++)for(let c=0;c<this.size;c++){let u;switch(l){case 0:u=(c+s)%2==0;break;case 1:u=s%2==0;break;case 2:u=c%3==0;break;case 3:u=(c+s)%3==0;break;case 4:u=(Math.floor(c/3)+Math.floor(s/2))%2==0;break;case 5:u=c*s%2+c*s%3==0;break;case 6:u=(c*s%2+c*s%3)%2==0;break;case 7:u=((c+s)%2+c*s%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[s][c]&&u&&(this.modules[s][c]=!this.modules[s][c]);}}getPenaltyScore(){let l=0;for(let m=0;m<this.size;m++){let f=false,d=0,p=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[m][h]==f?(d++,d==5?l+=t.PENALTY_N1:d>5&&l++):(this.finderPenaltyAddHistory(d,p),f||(l+=this.finderPenaltyCountPatterns(p)*t.PENALTY_N3),f=this.modules[m][h],d=1);l+=this.finderPenaltyTerminateAndCount(f,d,p)*t.PENALTY_N3;}for(let m=0;m<this.size;m++){let f=false,d=0,p=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][m]==f?(d++,d==5?l+=t.PENALTY_N1:d>5&&l++):(this.finderPenaltyAddHistory(d,p),f||(l+=this.finderPenaltyCountPatterns(p)*t.PENALTY_N3),f=this.modules[h][m],d=1);l+=this.finderPenaltyTerminateAndCount(f,d,p)*t.PENALTY_N3;}for(let m=0;m<this.size-1;m++)for(let f=0;f<this.size-1;f++){let d=this.modules[m][f];d==this.modules[m][f+1]&&d==this.modules[m+1][f]&&d==this.modules[m+1][f+1]&&(l+=t.PENALTY_N2);}let s=0;for(let m of this.modules)s=m.reduce((f,d)=>f+(d?1:0),s);let c=this.size*this.size,u=Math.ceil(Math.abs(s*20-c*10)/c)-1;return o(0<=u&&u<=9),l+=u*t.PENALTY_N4,o(0<=l&&l<=2568888),l}getAlignmentPatternPositions(){if(this.version==1)return [];{let l=Math.floor(this.version/7)+2,s=this.version==32?26:Math.ceil((this.version*4+4)/(l*2-2))*2,c=[6];for(let u=this.size-7;c.length<l;u-=s)c.splice(1,0,u);return c}}static getNumRawDataModules(l){if(l<t.MIN_VERSION||l>t.MAX_VERSION)throw new RangeError("Version number out of range");let s=(16*l+128)*l+64;if(l>=2){let c=Math.floor(l/7)+2;s-=(25*c-10)*c-55,l>=7&&(s-=36);}return o(208<=s&&s<=29648),s}static getNumDataCodewords(l,s){return Math.floor(t.getNumRawDataModules(l)/8)-t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][l]*t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][l]}static reedSolomonComputeDivisor(l){if(l<1||l>255)throw new RangeError("Degree out of range");let s=[];for(let u=0;u<l-1;u++)s.push(0);s.push(1);let c=1;for(let u=0;u<l;u++){for(let m=0;m<s.length;m++)s[m]=t.reedSolomonMultiply(s[m],c),m+1<s.length&&(s[m]^=s[m+1]);c=t.reedSolomonMultiply(c,2);}return s}static reedSolomonComputeRemainder(l,s){let c=s.map(u=>0);for(let u of l){let m=u^c.shift();c.push(0),s.forEach((f,d)=>c[d]^=t.reedSolomonMultiply(f,m));}return c}static reedSolomonMultiply(l,s){if(l>>>8||s>>>8)throw new RangeError("Byte out of range");let c=0;for(let u=7;u>=0;u--)c=c<<1^(c>>>7)*285,c^=(s>>>u&1)*l;return o(c>>>8==0),c}finderPenaltyCountPatterns(l){let s=l[1];o(s<=this.size*3);let c=s>0&&l[2]==s&&l[3]==s*3&&l[4]==s&&l[5]==s;return (c&&l[0]>=s*4&&l[6]>=s?1:0)+(c&&l[6]>=s*4&&l[0]>=s?1:0)}finderPenaltyTerminateAndCount(l,s,c){return l&&(this.finderPenaltyAddHistory(s,c),s=0),s+=this.size,this.finderPenaltyAddHistory(s,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(l,s){s[0]==0&&(l+=this.size),s.pop(),s.unshift(l);}static MIN_VERSION=1;static MAX_VERSION=40;static PENALTY_N1=3;static PENALTY_N2=3;static PENALTY_N3=40;static PENALTY_N4=10;static ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]];static NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]]}a.QrCode=t;function e(i,l,s){if(l<0||l>31||i>>>l)throw new RangeError("Value out of range");for(let c=l-1;c>=0;c--)s.push(i>>>c&1);}function n(i,l){return (i>>>l&1)!=0}function o(i){if(!i)throw new Error("Assertion error")}class r{constructor(l,s,c){this.mode=l;this.numChars=s;this.bitData=c;if(s<0)throw new RangeError("Invalid argument");this.bitData=c.slice();}mode;numChars;bitData;static makeBytes(l){let s=[];for(let c of l)e(c,8,s);return new r(r.Mode.BYTE,l.length,s)}static makeNumeric(l){if(!r.isNumeric(l))throw new RangeError("String contains non-numeric characters");let s=[];for(let c=0;c<l.length;){let u=Math.min(l.length-c,3);e(parseInt(l.substr(c,u),10),u*3+1,s),c+=u;}return new r(r.Mode.NUMERIC,l.length,s)}static makeAlphanumeric(l){if(!r.isAlphanumeric(l))throw new RangeError("String contains unencodable characters in alphanumeric mode");let s=[],c;for(c=0;c+2<=l.length;c+=2){let u=r.ALPHANUMERIC_CHARSET.indexOf(l.charAt(c))*45;u+=r.ALPHANUMERIC_CHARSET.indexOf(l.charAt(c+1)),e(u,11,s);}return c<l.length&&e(r.ALPHANUMERIC_CHARSET.indexOf(l.charAt(c)),6,s),new r(r.Mode.ALPHANUMERIC,l.length,s)}static makeSegments(l){return l==""?[]:r.isNumeric(l)?[r.makeNumeric(l)]:r.isAlphanumeric(l)?[r.makeAlphanumeric(l)]:[r.makeBytes(r.toUtf8ByteArray(l))]}static makeEci(l){let s=[];if(l<0)throw new RangeError("ECI assignment value out of range");if(l<128)e(l,8,s);else if(l<16384)e(2,2,s),e(l,14,s);else if(l<1e6)e(6,3,s),e(l,21,s);else throw new RangeError("ECI assignment value out of range");return new r(r.Mode.ECI,0,s)}static isNumeric(l){return r.NUMERIC_REGEX.test(l)}static isAlphanumeric(l){return r.ALPHANUMERIC_REGEX.test(l)}getData(){return this.bitData.slice()}static getTotalBits(l,s){let c=0;for(let u of l){let m=u.mode.numCharCountBits(s);if(u.numChars>=1<<m)return 1/0;c+=4+m+u.bitData.length;}return c}static toUtf8ByteArray(l){l=encodeURI(l);let s=[];for(let c=0;c<l.length;c++)l.charAt(c)!="%"?s.push(l.charCodeAt(c)):(s.push(parseInt(l.substr(c+1,2),16)),c+=2);return s}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}a.QrSegment=r;})(en||={});(e=>{(o=>{class n{constructor(a,i){this.ordinal=a;this.formatBits=i;}ordinal;formatBits;static LOW=new n(0,1);static MEDIUM=new n(1,0);static QUARTILE=new n(2,3);static HIGH=new n(3,2)}o.Ecc=n;})(e.QrCode||={});})(en||={});(e=>{(o=>{class n{constructor(a,i){this.modeBits=a;this.numBitsCharCount=i;}modeBits;numBitsCharCount;static NUMERIC=new n(1,[10,12,14]);static ALPHANUMERIC=new n(2,[9,11,13]);static BYTE=new n(4,[8,16,16]);static KANJI=new n(8,[8,10,12]);static ECI=new n(7,[0,0,0]);numCharCountBits(a){return this.numBitsCharCount[Math.floor((a+7)/17)]}}o.Mode=n;})(e.QrSegment||={});})(en||={});var yt=en;var Rt={L:yt.QrCode.Ecc.LOW,M:yt.QrCode.Ecc.MEDIUM,Q:yt.QrCode.Ecc.QUARTILE,H:yt.QrCode.Ecc.HIGH},ft=128,Ht="Q",_t="#FFFFFF",Mt="#000000";var xt=0;var ir=.1;function wt(t,e="#000000"){return t?typeof t=="string"?t:t.type==="solid"?t.color:t.type==="image"?t.underlay||e:(t.type==="linear"||t.type==="radial"||t.type==="angular")&&t.stops[0]?.color||e:e}var Ln=["logo","halftone"],Bi=zod.z.enum(Ln),vn={logo:["blend","badge"],halftone:["color","mono"]},Qi=zod.z.enum([...vn.logo,...vn.halftone]),re=192,Di=t=>Math.ceil(t/3)*4,Gi=zod.z.object({width:zod.z.number().int().min(1).max(re),height:zod.z.number().int().min(1).max(re),data:zod.z.string().max(Di(re*re*4))}).refine(t=>t.data.length===Di(t.width*t.height*4),{message:"Art image data does not match its width and height"}),xo=zod.z.object({mode:Bi,image:Gi,intensity:zod.z.number().min(0).max(1).optional(),variant:Qi.optional(),matchEyes:zod.z.boolean().optional()});var $0=zod.z.enum(["solid","linear","radial","angular","image"]),zi=zod.z.object({type:zod.z.literal("solid"),color:zod.z.string()}),sr=zod.z.object({color:zod.z.string(),offset:zod.z.number().min(0).max(100)}),Ui=zod.z.object({type:zod.z.literal("linear"),stops:zod.z.array(sr).min(2),angle:zod.z.number().optional().default(0)}),qi=zod.z.object({type:zod.z.literal("radial"),stops:zod.z.array(sr).min(2)}),Wi=zod.z.object({type:zod.z.literal("angular"),stops:zod.z.array(sr).min(2),angle:zod.z.number().optional().default(0)}),Hi=zod.z.enum(["cover","contain","tile"]),Vi=zod.z.enum(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]),ji=zod.z.object({type:zod.z.literal("image"),src:zod.z.string().min(1),fit:Hi.optional().default("cover"),scale:zod.z.number().min(.1).max(4).optional().default(1),position:Vi.optional().default("center"),opacity:zod.z.number().min(0).max(1).optional().default(1),underlay:zod.z.string().optional()}),me=zod.z.union([zod.z.string(),zi,Ui,qi,Wi,ji]);function Ot(t,e="#000000"){return t?typeof t=="string"?{type:"solid",color:t}:t:{type:"solid",color:e}}function nn(t){return !t||typeof t=="string"?false:t.type==="linear"||t.type==="radial"||t.type==="angular"}function $o(t){return typeof t=="object"&&t!==null&&t.type==="image"}function S0(t,e="#000000"){let n=Ot(t,e);return n.type==="solid"?n.color:n.type==="image"?n.underlay||e:n.stops[0]?.color||e}function Zi(t="center"){let[e,n]=t.split("-");return t==="center"?"center":n?`${n} ${e}`:e==="top"||e==="bottom"?`center ${e}`:`${e} center`}function w0(t){if(!t)return "#000000";if(typeof t=="string")return t;let e=Ot(t);if(e.type==="solid")return e.color;if(e.type==="image"){let r=e.fit==="tile"?`${25*(e.scale??1)}% auto`:(e.scale??1)===1?e.fit==="contain"?"contain":"cover":`${100*(e.scale??1)}% auto`,a=e.fit==="tile"?"repeat":"no-repeat";return `${`url("${e.src.replace(/"/g,"%22")}")`} ${Zi(e.position)} / ${r} ${a}, ${e.underlay??"transparent"}`}let o=[...e.stops].sort((r,a)=>r.offset-a.offset).map(r=>`${r.color} ${r.offset}%`).join(", ");return e.type==="linear"?`linear-gradient(${(e.angle??0)+90}deg, ${o})`:e.type==="angular"?`conic-gradient(from ${e.angle??0}deg, ${o})`:`radial-gradient(circle, ${o})`}var C0=zod.z.object({x:zod.z.number(),y:zod.z.number(),w:zod.z.number(),h:zod.z.number()});var So=["square","rounded","circle","message","message-reverse","diya","diya-reverse","rounded-triangle","leaf","drop","plus","cross-rounded","hexagon","octagon","flower","heart","squircle","dots","extra-rounded","leaf-reverse","drop-reverse"],Yi=["diamond","star","banner"],wo=zod.z.enum([...So,...Yi]),M0=zod.z.enum(So);var Co=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],Ji=["curly"],Mo=zod.z.enum([...Co,...Ji]),R0=zod.z.enum(Co);var ts=["none","banner-bottom","banner-top","border","rounded-border","speech-bubble","banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"],Vt=24,Ro="Scan me",lr=.5,Pe=1.5,es=zod.z.enum(ts),cr=zod.z.object({style:es,text:zod.z.string().max(Vt).optional(),color:zod.z.string().optional(),textColor:zod.z.string().optional(),secondaryText:zod.z.string().max(Vt).optional(),secondaryColor:zod.z.string().optional(),fontScale:zod.z.number().min(lr).max(Pe).optional()});function J(t,e=3){let n=10**e;return Math.round(t*n)/n+0}function x(t,e=3){return String(J(t,e))}function P(t,...e){let n=t[0]??"";for(let o=0;o<e.length;o++){let r=e[o];n+=(typeof r=="number"?x(r):r)+(t[o+1]??"");}return n}var E0={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},A0=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,Eo=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function In(t,e=Number.POSITIVE_INFINITY){if(!A0.test(t))return null;let n=[],o=0,r=()=>{for(;o<t.length&&/[\s,]/.test(t[o]);)o++;},a=()=>{r(),Eo.lastIndex=o;let s=Eo.exec(t);if(!s)return null;let c=s[0],u=c.indexOf(".");if(u>=0&&c.length-u-1>e)return null;o=Eo.lastIndex;let m=Number(c);return Number.isFinite(m)?m:null},i=()=>{r();let s=t[o];return s==="0"||s==="1"?(o++,s==="1"?1:0):null},l=()=>(r(),o<t.length&&/[0-9.+-]/.test(t[o]));for(r();o<t.length;){let s=t[o],c=s.toUpperCase(),u=E0[c];if(u===void 0||n.length===0&&c!=="M")return null;if(o++,u===0){n.push({command:s,values:[]}),r();continue}let m=s,f=true;for(;f||l();){let d=[];for(let p=0;p<u;p++){let h=c==="A"&&(p===3||p===4)?i():a();if(h===null)return null;d.push(h);}n.push({command:m,values:d}),c==="M"&&(m=s==="M"?"L":"l"),f=false;}r();}return n}function ns(t){let e=0;for(let{command:n}of t)e+=n.toUpperCase()==="A"?4:1;return e}function Ao(t,e=1,n=0,o=0){let r="";for(let{command:a,values:i}of t){let l=a.toUpperCase(),s=a===l,c=s?n:0,u=s?o:0,m;switch(l){case "Z":m=[];break;case "H":m=[x(i[0]*e+c)];break;case "V":m=[x(i[0]*e+u)];break;case "A":m=[x(Math.abs(i[0])*e),x(Math.abs(i[1])*e),x(i[2]),String(i[3]),String(i[4]),x(i[5]*e+c),x(i[6]*e+u)];break;default:m=i.map((f,d)=>x(f*e+(d%2===0?c:u)));}r+=a+m.join(" ");}return r}function ur(t,e=.25){let n=[],o=[],r=[0,0],a=[0,0],i=()=>{o.length>2&&n.push(o),o=[];};for(let l of t)if(l.op==="M")i(),r=[l.x,l.y],a=r,o.push(r);else if(l.op==="L")a=[l.x,l.y],o.push(a);else if(l.op==="C"){let s=a,c=[l.x1,l.y1],u=[l.x2,l.y2],m=[l.x,l.y],f=Math.hypot(c[0]-s[0],c[1]-s[1])+Math.hypot(u[0]-c[0],u[1]-c[1])+Math.hypot(m[0]-u[0],m[1]-u[1]),d=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(f/(4*e)))));for(let p=1;p<=d;p++){let h=p/d,g=1-h;o.push([g*g*g*s[0]+3*g*g*h*c[0]+3*g*h*h*u[0]+h*h*h*m[0],g*g*g*s[1]+3*g*g*h*c[1]+3*g*h*h*u[1]+h*h*h*m[1]]);}a=m;}else i(),a=r;return i(),n}function rn(t,e){let n=[r=>r[0]-e.x0,r=>e.x1-r[0],r=>r[1]-e.y0,r=>e.y1-r[1]],o=t;for(let r of n){if(o.length===0)break;let a=o;o=[];for(let i=0;i<a.length;i++){let l=a[i],s=a[(i+a.length-1)%a.length],c=r(l),u=r(s);c>=0?(u<0&&o.push(rs(s,l,u,c)),o.push(l)):u>=0&&o.push(rs(s,l,u,c));}}return o.length>2?o:[]}function rs(t,e,n,o){let r=n/(n-o);return [t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function os(t){return t.filter(e=>e.length>2).map(e=>`M${e.map(([n,o])=>`${x(n)} ${x(o)}`).join("L")}Z`).join("")}function ve(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(i,l)=>{e=Math.min(e,i),n=Math.min(n,l),o=Math.max(o,i),r=Math.max(r,l);};for(let i of t)i.op==="C"?(a(i.x1,i.y1),a(i.x2,i.y2),a(i.x,i.y)):i.op!=="Z"&&a(i.x,i.y);return Number.isFinite(e)?{x0:e,y0:n,x1:o,y1:r}:null}var P0={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function ss(t){return t.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(e,n)=>{if(n[0]==="#"){let o=n[1].toLowerCase()==="x"?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return Number.isInteger(o)&&o>0&&o<=1114111&&!(o>=55296&&o<=57343)?String.fromCodePoint(o):e}return P0[n.toLowerCase()]??e})}var v0=60,Po=62,vo=47,L0=61,as=34,is=39,Fo=/\s*/y,F0=/[^\s/>]*/y,I0=/[^\s>]*/y,T0=/[^\s=]*/y;function on(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function k0(t,e){let n=t.length,o=S=>{let $=Number.POSITIVE_INFINITY,M=-1;return C=>((C<$||M>=0&&M<C)&&($=C,M=t.indexOf(S,C)),M)},r=o("-->"),a=o("?>"),i=o("]]>"),l=o(">"),s,c=S=>{let $=t.charCodeAt(S);if($!==as&&$!==is)return S+1;let M=t.indexOf(t[S],S+1);return M<0?n:M+1},u=S=>{for(let $=S;$<n&&!s?.[$];$=c($)){let M=t.charCodeAt($);if(M===Po||M===vo&&t.charCodeAt($+1)===Po)return $}s??=new Uint8Array(n);for(let $=S;$<n&&!s[$];$=c($))s[$]=1;return -1},m=-1,f=-1,d=-1,p=-1,h=S=>{let $=S+1;if($<m||$>=f){m=$,f=on(F0,t,$),d=-1;for(let C=f;C>$;C--){let A=t.charCodeAt(C);if((C===f||A===as||A===is)&&(p=u(C),p>=0)){d=C;break}}}if(d<=$)return -1;let M=t.charCodeAt(p)===vo;return e.open(t.slice($,d),t.slice(d,p),M),p+(M?2:1)},g=-1,y=-1,b=-1,_=S=>{let $=S+2;if($<g||$>=y){g=$,y=on(I0,t,$);let M=on(Fo,t,y);b=y>$&&t.charCodeAt(M)===Po?M:-1;}return b},w=S=>{if(t.startsWith("<!--",S)){let $=r(S+4);if($>=0)return $+3}if(t.startsWith("<?",S)){let $=a(S+2);if($>=0)return $+2}if(t.startsWith("<![CDATA[",S)){let $=i(S+9);if($>=0)return e.cdata(t.slice(S+9,$)),$+3}if(t.startsWith("<!",S)){let $=l(S+2);if($>=0)return $+1}if(t.charCodeAt(S+1)===vo){let $=_(S);return $<0?-1:(e.close(),$+1)}return h(S)},R=0;for(;R<n;)if(t.charCodeAt(R)===v0){let S=w(R);R=S<0?R+1:S;}else {let S=t.indexOf("<",R),$=S<0?n:S;e.text(t.slice(R,$)),R=$;}}function N0(t){let e={},n=0;for(;n<t.length;){let o=on(T0,t,n);if(o===n){n++;continue}let r=on(Fo,t,o);if(t.charCodeAt(r)===L0){let a=on(Fo,t,r+1),i=t[a],l=i==='"'||i==="'"?t.indexOf(i,a+1):-1;if(l>=0){e[t.slice(n,o)]=ss(t.slice(a+1,l)),n=l+1;continue}}n=o;}return e}function fe(t){let e={name:"#root",attrs:{},children:[],text:""},n=[e],o=()=>n.at(-1);k0(t,{open(a,i,l){let s=N0(i),c={name:a,attrs:s,children:[],text:""};o().children.push(c),l||n.push(c);},close(){n.length>1&&n.pop();},text(a){o().text+=ss(a);},cdata(a){o().text+=a;}});let r=a=>{for(let i of a.children){if(i.name==="svg")return i;let l=r(i);if(l)return l}return null};return r(e)}var an=[1,0,0,1,0,0];function ut(t,e){let[n,o,r,a,i,l]=t,[s,c,u,m,f,d]=e;return [n*s+r*c,o*s+a*c,n*u+r*m,o*u+a*m,n*f+r*d+i,o*f+a*d+l]}function H(t,e,n){return [t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}function sn(t){return Math.sqrt(Math.abs(t[0]*t[3]-t[1]*t[2]))}function jt(t){return t?(t.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function Dt(t){let e=an;if(!t)return e;for(let[,n,o]of t.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let r=jt(o),a=an;switch(n){case "matrix":r.length===6&&(a=r);break;case "translate":a=[1,0,0,1,r[0]??0,r[1]??0];break;case "scale":a=[r[0]??1,0,0,r[1]??r[0]??1,0,0];break;case "rotate":{let i=(r[0]??0)*Math.PI/180,l=Math.cos(i),s=Math.sin(i),[c,u]=[r[1]??0,r[2]??0];a=ut(ut([1,0,0,1,c,u],[l,s,-s,l,0,0]),[1,0,0,1,-c,-u]);break}case "skewX":a=[1,0,Math.tan((r[0]??0)*Math.PI/180),1,0,0];break;case "skewY":a=[1,Math.tan((r[0]??0)*Math.PI/180),0,1,0,0];break;}e=ut(e,a);}return e}var Lo=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function O0(t,e,n,o,r,a,i,l,s){if(t===l&&e===s)return [];let c=Math.abs(n),u=Math.abs(o);if(c===0||u===0)return [{op:"L",x:l,y:s}];let m=r*Math.PI/180,f=Math.cos(m),d=Math.sin(m),p=(t-l)/2,h=(e-s)/2,g=f*p+d*h,y=-d*p+f*h,b=g*g/(c*c)+y*y/(u*u);b>1&&(c*=Math.sqrt(b),u*=Math.sqrt(b));let _=c*c*u*u-c*c*y*y-u*u*g*g,w=c*c*y*y+u*u*g*g,R=(a===i?-1:1)*Math.sqrt(Math.max(0,_/w)),S=R*c*y/u,$=-R*u*g/c,M=f*S-d*$+(t+l)/2,C=d*S+f*$+(e+s)/2,A=(W,D,z,et)=>Math.atan2(W*et-D*z,W*z+D*et),v=A(1,0,(g-S)/c,(y-$)/u),L=A((g-S)/c,(y-$)/u,(-g-S)/c,(-y-$)/u);!i&&L>0?L-=2*Math.PI:i&&L<0&&(L+=2*Math.PI);let F=Math.max(1,Math.ceil(Math.abs(L)/(Math.PI/2)-1e-9)),k=L/F,O=4/3*Math.tan(k/4),I=(W,D)=>[M+c*f*W-u*d*D,C+c*d*W+u*f*D],Q=[];for(let W=0;W<F;W++){let D=v+W*k,z=D+k,[et,bt]=I(Math.cos(D)-O*Math.sin(D),Math.sin(D)+O*Math.cos(D)),[lt,N]=I(Math.cos(z)+O*Math.sin(z),Math.sin(z)-O*Math.cos(z)),[U,q]=W===F-1?[l,s]:I(Math.cos(z),Math.sin(z));Q.push({op:"C",x1:et,y1:bt,x2:lt,y2:N,x:U,y:q});}return Q}function oe(t){let e=[],n=0,o=0,r=0,a=0,i=0,l="",s=null,c=null,u=()=>{for(;n<t.length&&/[\s,]/.test(t[n]);)n++;},m=()=>{u(),Lo.lastIndex=n;let p=Lo.exec(t);return p?(n=Lo.lastIndex,Number(p[0])):null},f=()=>{u();let p=t[n];return p==="0"||p==="1"?(n++,p==="1"):null},d=p=>{let h=[];for(let g=0;g<p;g++){let y=m();if(y===null)return null;h.push(y);}return h};for(;u(),!(n>=t.length);){let p=t[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(p))l=p,n++;else if(!l||l==="Z"||l==="z")break;let h=l===l.toLowerCase(),g=h?o:0,y=h?r:0,b=l.toUpperCase();if(b==="Z"){e.push({op:"Z"}),o=a,r=i,s=null,c=null;continue}if(b==="A"){let S=d(3),$=f(),M=f(),C=d(2);if(!(S&&C)||$===null||M===null)break;let[A,v,L]=S,F=C[0]+g,k=C[1]+y;e.push(...O0(o,r,A,v,L,$,M,F,k)),o=F,r=k,s=null,c=null;continue}let _={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[b]??0,w=d(_);if(!w)break;let R=w;switch(b){case "M":o=R[0]+g,r=R[1]+y,a=o,i=r,e.push({op:"M",x:o,y:r}),l=h?"l":"L",s=null,c=null;break;case "L":case "H":case "V":b!=="V"&&(o=R[0]+g),b==="V"?r=R[0]+y:b==="L"&&(r=R[1]+y),e.push({op:"L",x:o,y:r}),s=null,c=null;break;case "C":case "S":{let S,$;b==="C"?(S=[R[0]+g,R[1]+y],$=R.slice(2)):(S=s?[2*o-s[0],2*r-s[1]]:[o,r],$=R);let M=[$[0]+g,$[1]+y],C=[$[2]+g,$[3]+y];e.push({op:"C",x1:S[0],y1:S[1],x2:M[0],y2:M[1],x:C[0],y:C[1]}),[o,r]=C,s=M,c=null;break}case "Q":case "T":{let S,$;b==="Q"?(S=[R[0]+g,R[1]+y],$=[R[2]+g,R[3]+y]):(S=c?[2*o-c[0],2*r-c[1]]:[o,r],$=[R[0]+g,R[1]+y]),e.push({op:"C",x1:o+2/3*(S[0]-o),y1:r+2/3*(S[1]-r),x2:$[0]+2/3*(S[0]-$[0]),y2:$[1]+2/3*(S[1]-$[1]),x:$[0],y:$[1]}),[o,r]=$,c=S,s=null;break}}}return e}var mr=.5522847498;function Zt(t,e,n,o){if(n<=0||o<=0)return [];let r=n*mr,a=o*mr;return [{op:"M",x:t+n,y:e},{op:"C",x1:t+n,y1:e+a,x2:t+r,y2:e+o,x:t,y:e+o},{op:"C",x1:t-r,y1:e+o,x2:t-n,y2:e+a,x:t-n,y:e},{op:"C",x1:t-n,y1:e-a,x2:t-r,y2:e-o,x:t,y:e-o},{op:"C",x1:t+r,y1:e-o,x2:t+n,y2:e-a,x:t+n,y:e},{op:"Z"}]}function Xt(t,e,n,o,r=0,a=0){if(n<=0||o<=0)return [];let i=Math.min(Math.max(r,0),n/2),l=Math.min(Math.max(a,0),o/2);if(i===0||l===0)return [{op:"M",x:t,y:e},{op:"L",x:t+n,y:e},{op:"L",x:t+n,y:e+o},{op:"L",x:t,y:e+o},{op:"Z"}];let s=i*mr,c=l*mr,u=t+n,m=e+o;return [{op:"M",x:t+i,y:e},{op:"L",x:u-i,y:e},{op:"C",x1:u-i+s,y1:e,x2:u,y2:e+l-c,x:u,y:e+l},{op:"L",x:u,y:m-l},{op:"C",x1:u,y1:m-l+c,x2:u-i+s,y2:m,x:u-i,y:m},{op:"L",x:t+i,y:m},{op:"C",x1:t+i-s,y1:m,x2:t,y2:m-l+c,x:t,y:m-l},{op:"L",x:t,y:e+l},{op:"C",x1:t,y1:e+l-c,x2:t+i-s,y2:e,x:t+i,y:e},{op:"Z"}]}var fr="qrdx.frame",hr=1,cn="custom",ct={minArtboard:50,maxArtboard:2e3,maxCoordinate:4e3,maxDecimals:3,maxShapes:64,maxLabels:8,maxPolygonPoints:256,maxPathLength:16e3,maxSegments:2e3,maxGradientSteps:64,maxGradientWork:16e3,maxBytes:32768,minQrShare:.5,minPadding:.04,defaultPadding:.08,maxTextLength:Vt},ms=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],kn=.95,ds=200,fs=["frame","text","accent","background"],D0=/[\t\n\v\f\r\u0085\u2028\u2029]/g,B0=/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u115f\u1160\u17b4\u17b5\u180b-\u180f\u200b-\u200f\u202a-\u202e\u2060-\u206f\u3164\ufe00-\ufe0f\ufeff\uffa0\ufff0-\ufffb]|\udb40[\udc00-\udcff]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/g;function un(t,e=Vt){let n=t.slice(0,1e3).normalize("NFC").replace(D0," ").replace(B0,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,e)).join("").trim()}function Q0(t){for(let e of t)if((e.codePointAt(0)??0)>255)return false;return true}var ko=t=>Math.abs(t*1e3-Math.round(t*1e3))<1e-6,ht=zod.z.number().min(-ct.maxCoordinate).max(ct.maxCoordinate).refine(ko,{message:`Numbers may have at most ${ct.maxDecimals} decimals`}),Et=ht.refine(t=>t>0,{message:"Must be greater than 0"}),dr=ht.refine(t=>t>=0,{message:"Must not be negative"}),Tn=zod.z.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color"),ls=zod.z.union([zod.z.enum(fs),Tn]),hs=t=>zod.z.object({mix:zod.z.tuple([t,t]),amount:zod.z.number().min(0).max(1).refine(ko)}).strict(),ln=zod.z.union([ls,hs(ls)]),G0=zod.z.union([Tn,hs(zod.z.union([zod.z.enum(["frame","accent","background"]),Tn]))]),he=zod.z.union([ln,zod.z.object({gradient:zod.z.object({from:ln,to:ln,direction:zod.z.enum(["horizontal","vertical"]).optional(),steps:zod.z.int().min(2).max(ct.maxGradientSteps).optional()}).strict()}).strict()]),Io={x:ht,y:ht,width:Et,height:Et},z0=zod.z.object({type:zod.z.literal("rect"),...Io,radius:dr.optional(),fill:he,hole:zod.z.object({...Io,radius:dr.optional()}).strict().optional()}).strict(),U0=zod.z.object({type:zod.z.literal("circle"),cx:ht,cy:ht,r:Et,hole:Et.optional(),fill:he}).strict(),q0=zod.z.object({type:zod.z.literal("ellipse"),cx:ht,cy:ht,rx:Et,ry:Et,fill:he}).strict(),W0=zod.z.object({type:zod.z.literal("polygon"),points:zod.z.array(zod.z.tuple([ht,ht])).min(3).max(ct.maxPolygonPoints),fill:he}).strict(),H0=zod.z.object({type:zod.z.literal("path"),d:zod.z.string().min(2).max(ct.maxPathLength),fill:he,fillRule:zod.z.enum(["nonzero","evenodd"]).optional()}).strict(),V0=zod.z.object({type:zod.z.literal("line"),x1:ht,y1:ht,x2:ht,y2:ht,width:Et,cap:zod.z.enum(["butt","round"]).optional(),dash:zod.z.tuple([Et,Et]).optional(),fill:he}).strict(),j0=zod.z.object({type:zod.z.literal("icon"),icon:zod.z.enum(ms),x:ht,y:ht,size:Et,fill:he}).strict(),ps=zod.z.discriminatedUnion("type",[z0,U0,q0,W0,H0,V0,j0]),gs={id:zod.z.string().regex(/^[a-z][a-z0-9-]{0,31}$/),slot:zod.z.enum(["primary","secondary","fixed"]),text:zod.z.string().max(200),maxLength:zod.z.int().min(1).max(Vt).optional(),color:ln,weight:zod.z.enum(["bold","regular"]).optional(),collapse:zod.z.object({y:ht,height:Et}).strict().optional()},Z0=zod.z.object({type:zod.z.literal("text"),...gs,box:zod.z.object(Io).strict(),align:zod.z.enum(["start","middle","end"]).optional(),fontSize:Et.optional()}).strict(),X0=zod.z.object({type:zod.z.literal("curved"),...gs,curve:zod.z.object({cx:ht,cy:ht,radius:Et,side:zod.z.enum(["top","bottom"]),spread:zod.z.number().min(20).max(300).refine(ko).optional()}).strict(),fontSize:Et}).strict(),bs=zod.z.discriminatedUnion("type",[Z0,X0]),cs=ht.refine(t=>t>=ct.minArtboard&&t<=ct.maxArtboard,{message:`Artboard sides must be ${ct.minArtboard} to ${ct.maxArtboard} units`}),Y0=zod.z.object({kind:zod.z.literal(fr),version:zod.z.literal(hr),artboard:zod.z.object({width:cs,height:cs}).strict(),qr:zod.z.object({x:ht,y:ht,size:Et,padding:dr.optional(),radius:dr.optional(),plate:zod.z.enum(["opaque","background"]).optional()}).strict(),colors:zod.z.object({frame:Tn,text:G0.optional(),accent:Tn.optional()}).strict(),shapes:zod.z.array(ps).max(ct.maxShapes),labels:zod.z.array(bs).max(ct.maxLabels),bleed:zod.z.union([zod.z.literal("none"),ln]).optional()}).strict();function pr(t){let e=mn(t);return {x0:t.qr.x-e,y0:t.qr.y-e,x1:t.qr.x+t.qr.size+e,y1:t.qr.y+t.qr.size+e}}function K0(t){return {x0:t.qr.x,y0:t.qr.y,x1:t.qr.x+t.qr.size,y1:t.qr.y+t.qr.size}}function mn(t){return t.qr.padding??t.qr.size*ct.defaultPadding}var No=.52,J0=.35;function tm(t){let e=t.fontSize??t.box.height*No;return Math.min(e*Pe,t.box.height*kn)}var To=(t,e)=>Math.min(t.x1,e.x1)-Math.max(t.x0,e.x0)>1e-6&&Math.min(t.y1,e.y1)-Math.max(t.y0,e.y0)>1e-6;function us(t){let e=pr(t),n=Math.min(t.qr.radius??0,(e.x1-e.x0)/2,(e.y1-e.y0)/2),o=[[e.x0+n,e.y0+n,Math.PI],[e.x1-n,e.y0+n,-Math.PI/2],[e.x1-n,e.y1-n,0],[e.x0+n,e.y1-n,Math.PI/2]],r=[];for(let[a,i,l]of o)for(let s=0;s<=8;s++){let c=l+Math.PI/2*(s/8);r.push([a+n*Math.cos(c),i+n*Math.sin(c)]);}return r}function em([t,e],n,o){if(t<n.x-.01||e<n.y-.01||t>n.x+n.width+.01||e>n.y+n.height+.01)return false;let a=Math.min(o,n.width/2,n.height/2),i=Math.min(Math.max(t,n.x+a),n.x+n.width-a),l=Math.min(Math.max(e,n.y+a),n.y+n.height-a);return Math.hypot(t-i,e-l)<=a+.01}function nm(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),Math.abs(e)/2}function rm(t,e,n){let o=pr(e);if(t.fill==="background"||!To(n,o))return false;if(t.type==="rect"&&t.hole){let{hole:r}=t;return !us(e).every(a=>em(a,r,r.radius??0))}if(t.type==="circle"&&t.hole){let r=t.hole;return !us(e).every(([a,i])=>Math.hypot(a-t.cx,i-t.cy)<=r+.01)}if(t.type==="polygon"){let r=rn(t.points,o);return r.length>2&&nm(r)>1e-6}return true}function Oo(t){switch(t.type){case "rect":return {bounds:{x0:t.x,y0:t.y,x1:t.x+t.width,y1:t.y+t.height},segments:t.hole?18:9};case "circle":return {bounds:{x0:t.cx-t.r,y0:t.cy-t.r,x1:t.cx+t.r,y1:t.cy+t.r},segments:t.hole?10:5};case "ellipse":return {bounds:{x0:t.cx-t.rx,y0:t.cy-t.ry,x1:t.cx+t.rx,y1:t.cy+t.ry},segments:5};case "polygon":{let e=t.points.map(([o])=>o),n=t.points.map(([,o])=>o);return {bounds:{x0:Math.min(...e),y0:Math.min(...n),x1:Math.max(...e),y1:Math.max(...n)},segments:t.points.length}}case "path":{let e=In(t.d,ct.maxDecimals);return e?{bounds:ve(oe(t.d)),segments:ns(e)}:{bounds:null,segments:0}}case "line":{let e=t.width/2,n=Math.hypot(t.x2-t.x1,t.y2-t.y1),o=t.dash?Math.ceil(n/(t.dash[0]+t.dash[1])):1;return {bounds:{x0:Math.min(t.x1,t.x2)-e,y0:Math.min(t.y1,t.y2)-e,x1:Math.max(t.x1,t.x2)+e,y1:Math.max(t.y1,t.y2)+e},segments:o*(t.cap==="round"?4:5)}}default:return {bounds:{x0:t.x,y0:t.y,x1:t.x+t.size,y1:t.y+t.size},segments:ds}}}function om(t,e){let n=(b,_=[])=>e.addIssue({code:"custom",message:b,path:_}),o=ct,r=new TextEncoder().encode(JSON.stringify(t)).length;if(r>o.maxBytes){n(`The spec is ${r} bytes; the limit is ${o.maxBytes}`);return}let{width:a,height:i}=t.artboard,l=Math.max(a,i)*.005,s={x0:-l,y0:-l,x1:a+l,y1:i+l},c=b=>b.x0>=s.x0&&b.y0>=s.y0&&b.x1<=s.x1&&b.y1<=s.y1,{qr:u}=t,m=mn(t);m<u.size*o.minPadding-1e-9&&n(`qr.padding must be at least ${o.minPadding*100}% of qr.size`,["qr","padding"]),u.size<Math.min(a,i)*o.minQrShare-1e-9&&n(`qr.size must be at least ${o.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let f=pr(t);(f.x0<-1e-9||f.y0<-1e-9||f.x1>a+1e-9||f.y1>i+1e-9)&&n("The code and its padding must sit inside the artboard",["qr"]),(u.radius??0)>(u.size+2*m)/2&&n("qr.radius is larger than half the plate",["qr","radius"]);let d=0,p=0;t.shapes.forEach((b,_)=>{let w=["shapes",_],{bounds:R,segments:S}=Oo(b);if(!R){n("Path data must use only M L H V C S Q T A Z, plain numbers (up to 3 decimals) and start with M",[...w,"d"]);return}if(c(R)||n("The shape extends outside the artboard",w),b.type==="rect"&&b.hole){let{hole:$}=b;($.x<b.x||$.y<b.y||$.x+$.width>b.x+b.width+1e-9||$.y+$.height>b.y+b.height+1e-9)&&n("The hole must sit inside its rect",[...w,"hole"]);}b.type==="circle"&&b.hole&&b.hole>=b.r&&n("The hole must be smaller than the circle",[...w,"hole"]),u.plate==="background"&&rm(b,t,R)&&n('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',w),d+=S,typeof b.fill=="object"&&"gradient"in b.fill&&(p+=(b.fill.gradient.steps??32)*S);}),d>o.maxSegments&&n(`The shapes have ${d} segments; the limit is ${o.maxSegments}`,["shapes"]),p>o.maxGradientWork&&n("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let h=[],g=new Set,y=new Set;t.labels.forEach((b,_)=>{let w=["labels",_];g.has(b.id)&&n(`Label id "${b.id}" is used twice`,[...w,"id"]),g.add(b.id),b.slot!=="fixed"&&(y.has(b.slot)&&n(`Only one label may use the ${b.slot} slot`,[...w,"slot"]),y.add(b.slot));let R=b.maxLength??o.maxTextLength;b.text!==un(b.text,R)&&n(`Label text must be at most ${R} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...w,"text"]);let S;if(b.type==="text"){S={x0:b.box.x,y0:b.box.y,x1:b.box.x+b.box.width,y1:b.box.y+b.box.height},b.fontSize!==void 0&&b.fontSize>b.box.height*kn+1e-9&&n("fontSize may be at most 95% of the label's row height",[...w,"fontSize"]);let $=b.box.y+b.box.height/2,M=tm(b)*J0,C={x0:S.x0,x1:S.x1,y0:$-M,y1:$+M};(To(S,K0(t))||To(C,f))&&n("The label overlaps the code or its padding",[...w,"box"]);}else {let{cx:$,cy:M,radius:C}=b.curve,A=b.fontSize*Pe*.6;S={x0:$-C-A,y0:M-C-A,x1:$+C+A,y1:M+C+A};let v=Math.hypot(Math.max(f.x0-$,0,$-f.x1),Math.max(f.y0-M,0,M-f.y1));Math.hypot(Math.max(Math.abs(f.x0-$),Math.abs(f.x1-$)),Math.max(Math.abs(f.y0-M),Math.abs(f.y1-M)))<=C-A||v>=C+A||n("The curved label crosses the code or its padding",[...w,"curve"]);}if(c(S)||n("The label extends outside the artboard",w),b.collapse){let $=b.collapse,M=$.y+$.height;($.y<-1e-9||M>i+1e-9)&&n("The collapse band must sit inside the artboard",[...w,"collapse"]),M>f.y0+1e-6&&$.y<f.y1-1e-6&&n("The collapse band crosses the code or its padding",[...w,"collapse"]);for(let C of h)M>C.y+1e-6&&$.y<C.y+C.height-1e-6&&n("Collapse bands may not overlap",[...w,"collapse"]);h.push($);}});}var Le=Y0.superRefine(om);function am(t){let e=Le.safeParse(t);return e.success?[]:e.error.issues.map(n=>n.path.length>0?`${n.path.join(".")}: ${n.message}`:n.message)}var ys=cr.extend({style:zod.z.literal(cn),spec:Le}),Do=zod.z.discriminatedUnion("style",[cr,ys]);var _s=["circle","circle-large","square","diamond","circle-mixed","pacman","rounded","small-square","vertical-line","horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"],Bo=zod.z.enum(_s);var xs=["square","rounded","circle"],Qo=zod.z.enum(xs),$s=zod.z.object({src:zod.z.string(),height:zod.z.number(),width:zod.z.number(),excavate:zod.z.boolean(),x:zod.z.number().optional(),y:zod.z.number().optional(),padding:zod.z.number().min(0).optional(),shape:Qo.optional(),plate:zod.z.string().optional()}),Ss=.1,br=.3,Go=.25,ws=2,sm=zod.z.object({size:zod.z.number().min(Ss).max(br).optional(),padding:zod.z.number().min(0).max(ws).optional(),x:zod.z.number().min(0).max(1).optional(),y:zod.z.number().min(0).max(1).optional(),shape:Qo.optional(),plate:zod.z.string().optional()}),Cs=zod.z.enum(["L","M","Q","H"]),Nn=.5,yr=1,zo=.07,Ms=["square","circle","heart"],Rs=zod.z.enum(Ms),Uo=3,Qt=64,Yt=8,qo=.42,Es=zod.z.object({type:zod.z.literal("silhouette"),width:zod.z.number().int().min(Yt).max(Qt),height:zod.z.number().int().min(Yt).max(Qt),cells:zod.z.string().max(Qt*Qt).regex(/^[01]*$/).describe('Row by row, "1" inside the shape and "0" outside: width \xD7 height characters')}).refine(t=>t.cells.length===t.width*t.height,{message:"Silhouette cells do not match its width and height"}),As=zod.z.union([Rs,Es]),_r=["topLeft","topRight","bottomLeft"],gr=zod.z.object({outer:me.optional(),inner:me.optional()}),Ps=zod.z.object({topLeft:gr.optional(),topRight:gr.optional(),bottomLeft:gr.optional()}),lm=zod.z.object({value:zod.z.string(),size:zod.z.number().optional(),level:Cs.optional(),bgColor:me.optional(),fgColor:me.optional(),eyeColor:me.optional(),dotColor:me.optional(),bodyPattern:Bo.optional(),cornerEyePattern:Mo.optional(),cornerEyeDotPattern:wo.optional(),margin:zod.z.number().optional(),imageSettings:$s.optional(),isOGContext:zod.z.boolean().optional(),templateId:zod.z.string().optional(),customProps:zod.z.record(zod.z.string(),zod.z.any()).optional(),frame:Do.optional(),art:xo.optional(),eyeColors:Ps.optional(),moduleScale:zod.z.number().min(Nn).max(yr).optional(),autoLevel:zod.z.boolean().optional(),shape:As.optional()});var cm=zod.z.object({fgColor:zod.z.string().optional(),bgColor:zod.z.string().optional()}),um=zod.z.object({pixelSize:zod.z.number(),url:zod.z.string()}),mm=zod.z.object({id:zod.z.string(),name:zod.z.string(),description:zod.z.string().optional()});var At=t=>t/255,On=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,X=t=>.2126*t[0]+.7152*t[1]+.0722*t[2];function Wo(t){let{width:e,height:n,data:o}=t,r=[0,e-1,(n-1)*e,n*e-1].map(i=>{let l=i*4;return {color:[At(o[l]),At(o[l+1]),At(o[l+2])],alpha:o[l+3]/255}});if(r.some(i=>i.alpha<.9))return null;let a=r[0].color;return r.every(({color:i})=>On(i,a)<.006)?a:null}function dm(t){let{width:e,height:n,data:o}=t,r=Wo(t),a=new Float32Array(e*n);for(let i=0;i<a.length;i++){let l=i*4,s=o[l+3]/255;if(r&&s>0){let c=Math.sqrt(On([At(o[l]),At(o[l+1]),At(o[l+2])],r));s*=Math.min(1,Math.max(0,(c-.06)/.1));}a[i]=s;}return a}var fm=8,hm=.14,vs=.006;function pm(t,e){let{width:n,height:o,data:r}=t,a=new Float64Array(4096),i=new Float64Array(4096*3),l=0;for(let d=0;d<e.length;d++){if(e[d]<.9)continue;let p=d*4,h=Math.floor(r[p]/16)*256+Math.floor(r[p+1]/16)*16+Math.floor(r[p+2]/16);a[h]+=1,i[h*3]+=At(r[p]),i[h*3+1]+=At(r[p+1]),i[h*3+2]+=At(r[p+2]),l++;}if(l===0)return {palette:[],error:0};let s=[...a.keys()].filter(d=>a[d]>0).sort((d,p)=>a[p]-a[d]),c=[];for(let d of s){if(a[d]/l<vs/2||c.length>=fm)break;let p=[i[d*3]/a[d],i[d*3+1]/a[d],i[d*3+2]/a[d]];c.every(h=>On(h,p)>=hm**2)&&c.push(p);}let u=[],m=0;for(let d=0;d<3;d++){u=c.map(()=>({n:0,r:0,g:0,b:0,x:0,y:0})),m=0;for(let p=0;p<e.length;p++){if(e[p]<.9)continue;let h=p*4,g=[At(r[h]),At(r[h+1]),At(r[h+2])],y=0,b=Number.POSITIVE_INFINITY;for(let[w,R]of c.entries()){let S=On(g,R);S<b&&(b=S,y=w);}let _=u[y];_.n++,_.r+=g[0],_.g+=g[1],_.b+=g[2],_.x+=p%n,_.y+=Math.floor(p/n),m+=Math.sqrt(b);}for(let[p,h]of u.entries())h.n>0&&(c[p]=[h.r/h.n,h.g/h.n,h.b/h.n]);}return {palette:c.map((d,p)=>({color:d,area:u[p].n/l,cx:u[p].n?u[p].x/u[p].n+.5:n/2,cy:u[p].n?u[p].y/u[p].n+.5:o/2})).filter(d=>d.area>=vs).sort((d,p)=>p.area-d.area),error:m/l}}function gm(t,e,n){let o=e+2,r=n+2,a=(m,f)=>m<=0||f<=0||m>e||f>n?0:t[(f-1)*e+(m-1)],i=new Map,l=new Map,s=m=>{let f=l.get(m);if(f)return f;let d=Math.floor(m/2),p=d%o,h=Math.floor(d/o),g=a(p,h),y=m%2===1,b=y?a(p,h+1):a(p+1,h),_=g===b?.5:Math.min(1,Math.max(0,(.5-g)/(b-g))),w=y?[p-.5,h-.5+_]:[p-.5+_,h-.5];return l.set(m,w),w},c=(m,f)=>{i.set(m,f);};for(let m=0;m<r-1;m++)for(let f=0;f<o-1;f++){let d=a(f,m)>=.5,p=a(f+1,m)>=.5,h=a(f+1,m+1)>=.5,g=a(f,m+1)>=.5,y=2*(m*o+f),b=2*((m+1)*o+f),_=2*(m*o+f)+1,w=2*(m*o+f+1)+1;switch((d?8:0)+(p?4:0)+(h?2:0)+(g?1:0)){case 1:c(b,_);break;case 2:c(w,b);break;case 3:c(w,_);break;case 4:c(y,w);break;case 5:{(a(f,m)+a(f+1,m)+a(f+1,m+1)+a(f,m+1))/4>=.5?(c(y,_),c(b,w)):(c(y,w),c(b,_));break}case 6:c(y,b);break;case 7:c(y,_);break;case 8:c(_,y);break;case 9:c(b,y);break;case 10:{(a(f,m)+a(f+1,m)+a(f+1,m+1)+a(f,m+1))/4>=.5?(c(_,b),c(w,y)):(c(_,y),c(w,b));break}case 11:c(w,y);break;case 12:c(_,w);break;case 13:c(b,w);break;case 14:c(_,b);break;}}let u=[];for(let m of i.keys()){if(!i.has(m))continue;let f=[],d=m;for(;d!==void 0&&i.has(d);){f.push(s(d));let p=i.get(d);i.delete(d),d=p;}f.length>=3&&u.push(f);}return u}function bm(t){let e=0;for(let n=0;n<t.length;n++){let o=t[n],r=t[(n+1)%t.length];e+=o[0]*r[1]-r[0]*o[1];}return e/2}function Ls(t,e){if(t.length<=2)return t;let n=new Uint8Array(t.length);n[0]=1,n[t.length-1]=1;let o=[[0,t.length-1]];for(;o.length>0;){let[r,a]=o.pop(),i=t[r],l=t[a],s=l[0]-i[0],c=l[1]-i[1],u=Math.hypot(s,c)||1,m=-1,f=e;for(let d=r+1;d<a;d++){let p=t[d],h=Math.abs(c*(p[0]-i[0])-s*(p[1]-i[1]))/u;h>f&&(f=h,m=d);}m>=0&&(n[m]=1,o.push([r,m],[m,a]));}return t.filter((r,a)=>n[a]===1)}function ym(t,e){let n=0,o=-1;for(let[i,l]of t.entries()){let s=(l[0]-t[0][0])**2+(l[1]-t[0][1])**2;s>o&&(o=s,n=i);}let r=Ls(t.slice(0,n+1),e),a=Ls([...t.slice(n),t[0]],e);return [...r.slice(0,-1),...a.slice(0,-1)]}var pe=t=>J(t,2);function _m(t,e){let n=t.length,o=(a,i)=>{let l=Math.hypot(i[0]-a[0],i[1]-a[1])||1,s=Math.min(.5,e/l);return [a[0]+(i[0]-a[0])*s,a[1]+(i[1]-a[1])*s]},r="";for(let a=0;a<n;a++){let i=t[a],l=o(i,t[(a-1+n)%n]),s=o(i,t[(a+1)%n]);r+=a===0?`M${pe(l[0])} ${pe(l[1])}`:`L${pe(l[0])} ${pe(l[1])}`,r+=`Q${pe(i[0])} ${pe(i[1])} ${pe(s[0])} ${pe(s[1])}`;}return `${r}Z`}function xm(t,e,n){let o="";for(let r of gm(t,e,n)){if(Math.abs(bm(r))<.8)continue;let a=ym(r,.18);a.length>=3&&(o+=_m(a,.9));}return o}var $m=.075;function Fs(t){let{width:e,height:n,data:o}=t,r=dm(t),a=0;for(let h of r)a+=h;let{palette:i,error:l}=pm(t,r),s={width:e,height:n,palette:i,alpha:r,coverage:a/(e*n)};if(i.length===0||l>$m)return {...s,layers:[],photographic:i.length>0};let c=i.length,u=Array.from({length:c},()=>new Float32Array(e*n)),m=i.map(h=>h.color);for(let h=0;h<r.length;h++){let g=r[h];if(g<=0)continue;let y=h*4,b=[At(o[y]),At(o[y+1]),At(o[y+2])],_=0,w=-1,R=Number.POSITIVE_INFINITY,S=Number.POSITIVE_INFINITY;for(let v=0;v<c;v++){let L=On(b,m[v]);L<R?(w=_,S=R,_=v,R=L):L<S&&(w=v,S=L);}if(w<0||R<1e-6){u[_][h]=g;continue}let $=m[_],M=m[w],C=[M[0]-$[0],M[1]-$[1],M[2]-$[2]],A=Math.min(1,Math.max(0,((b[0]-$[0])*C[0]+(b[1]-$[1])*C[1]+(b[2]-$[2])*C[2])/(C[0]**2+C[1]**2+C[2]**2)));u[_][h]=g*(1-A),u[w][h]=g*A;}let f=[],d=new Float32Array(e*n),p=new Array(c);for(let h=c-1;h>=0;h--){let g=u[h];for(let y=0;y<d.length;y++)d[y]+=g[y];p[h]=d.slice();}for(let h=0;h<c;h++){let g=xm(p[h],e,n);g&&f.push({color:m[h],d:g});}return {...s,layers:f,photographic:false}}var{QrCode:Ho}=yt,Sm={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function wm(t){let e=t*4+17,n=new Uint8Array(e*e),o=(i,l)=>{i>=0&&l>=0&&i<e&&l<e&&(n[l*e+i]=1);};for(let i=0;i<e;i++)o(6,i),o(i,6);for(let[i,l]of [[3,3],[e-4,3],[3,e-4]])for(let s=-4;s<=4;s++)for(let c=-4;c<=4;c++)o(i+c,l+s);let r=[];if(t>1){let i=Math.floor(t/7)+2,l=t===32?26:Math.ceil((t*4+4)/(i*2-2))*2;r.push(6);for(let s=e-7;r.length<i;s-=l)r.splice(1,0,s);}let a=r.length-1;for(let[i,l]of r.entries())for(let[s,c]of r.entries())if(!(i===0&&s===0||i===0&&s===a||i===a&&s===0))for(let u=-2;u<=2;u++)for(let m=-2;m<=2;m++)o(l+m,c+u);for(let i=0;i<=8;i++)o(8,i),o(i,8);for(let i=0;i<8;i++)o(e-1-i,8),o(8,e-1-i);if(t>=7)for(let i=0;i<18;i++){let l=e-11+i%3,s=Math.floor(i/3);o(l,s),o(s,l);}return n}function Cm(t,e){let n=t*4+17,o=Rt[e].ordinal,r=Ho.NUM_ERROR_CORRECTION_BLOCKS[o]?.[t]??0,a=Ho.ECC_CODEWORDS_PER_BLOCK[o]?.[t]??0,i=Math.floor(Ho.getNumRawDataModules(t)/8),l=r-i%r,s=Math.floor(i/r),c=Array.from({length:r},(w,R)=>s+(R<l?0:1)),u=[],m=[],f=s-a;for(let w=0;w<=s;w++)for(let R=0;R<r;R++)if(R<l){if(w===f)continue;u.push(R),m.push(w<f?w:w-1);}else u.push(R),m.push(w);if(u.length!==i)throw new Error(`Codeword map: interleave mismatch at version ${t}`);let d=wm(t),p=new Int16Array(n*n).fill(-1),h=new Int16Array(n*n).fill(-1),g=new Int8Array(n*n).fill(-1),y=i*8,b=0;for(let w=n-1;w>=1;w-=2){w===6&&(w=5);let R=(w+1&2)===0;for(let S=0;S<n;S++)for(let $=0;$<2;$++){let M=w-$,A=(R?n-1-S:S)*n+M;if(!d[A]&&b<y){let v=b>>>3;p[A]=u[v],h[A]=m[v],g[A]=7-(b&7),b++;}}}if(b!==y)throw new Error(`Codeword map: placement mismatch at version ${t}`);let _=Sm[`${t}${e}`]??0;return {version:t,level:e,size:n,blocks:r,eccPerBlock:a,blockLengths:c,correctable:Math.floor((a-_)/2),block:p,codeword:h,bit:g}}var Mm=8,Fe=new Map;function Dn(t,e){if(!(Number.isInteger(t)&&t>=1&&t<=40))throw new RangeError(`QR version must be 1\u201340, got ${t}`);let n=`${t}${e}`,o=Fe.get(n);if(o)return Fe.delete(n),Fe.set(n,o),o;let r=Cm(t,e);if(Fe.size>=Mm){let a=Fe.keys().next().value;a!==void 0&&Fe.delete(a);}return Fe.set(n,r),r}function Bn(t,e){let n=new Array(t.blocks).fill(0),o=new Set;for(let r of e){let a=t.block[r]??-1;if(a<0)continue;let i=a*4096+t.codeword[r];o.has(i)||(o.add(i),n[a]=n[a]+1);}return n}var Rm={black:[0,0,0],white:[255,255,255],red:[255,0,0],green:[0,128,0],lime:[0,255,0],blue:[0,0,255],navy:[0,0,128],yellow:[255,255,0],orange:[255,165,0],purple:[128,0,128],pink:[255,192,203],gray:[128,128,128],grey:[128,128,128],silver:[192,192,192],maroon:[128,0,0],olive:[128,128,0],teal:[0,128,128],aqua:[0,255,255],cyan:[0,255,255],fuchsia:[255,0,255],magenta:[255,0,255]};function Is(t,e){let n=t.trim(),o=Number.parseFloat(n);return Number.isNaN(o)?Number.NaN:n.endsWith("%")?o/100*e:o}function dt(t){if(!t)return null;let e=t.trim().toLowerCase();if(e==="transparent")return {r:0,g:0,b:0,a:0};let n=Rm[e];if(n)return {r:n[0],g:n[1],b:n[2],a:1};if(e.startsWith("#")){let r=e.slice(1);return (r.length===3||r.length===4)&&(r=r.split("").map(a=>a+a).join("")),/^[0-9a-f]{6}([0-9a-f]{2})?$/.test(r)?{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16),a:r.length===8?Number.parseInt(r.slice(6,8),16)/255:1}:null}let o=/^rgba?\(([^)]*)\)$/.exec(e);if(o){let[r,a]=o[1].split("/"),i=r.split(/[\s,]+/).filter(Boolean);if(i.length!==(a===void 0&&i.length===4?4:3))return null;let l=a??i[3],[s,c,u]=i.slice(0,3).map(d=>Is(d,255)),m=l===void 0?1:Is(l,1);if([s,c,u,m].some(d=>Number.isNaN(d)))return null;let f=(d,p)=>Math.min(Math.max(d,0),p);return {r:f(s,255),g:f(c,255),b:f(u,255),a:f(m,1)}}return null}function ge(t,e,n){let o=t/255,r=e/255,a=n/255,i=1-Math.max(o,r,a);return i>=1?[0,0,0,1]:[J((1-o-i)/(1-i)),J((1-r-i)/(1-i)),J((1-a-i)/(1-i)),J(i)]}function Jt(t){return t.children}var Em=t=>t==null?null:`${t}`;function Vo(t,e,n){let o=e??{},r=n;if("key"in o){let{key:a,...i}=o;a!==void 0&&(r=a),o=i;}return {type:t,props:o,key:Em(r)}}function Am(t,e){let n=t;return {type:n.type,props:{...n.props,...e},key:n.key??null}}function Pm(t,e,...n){let o={...e};return n.length>0&&(o.children=n.length===1?n[0]:n),Vo(t,o)}var vm={jsx:Vo,jsxs:Vo,createElement:Pm,cloneElement:Am,Fragment:Jt},Qn=vm;var jo=t=>t===Jt?Qn.Fragment:t;function E(t,e,n){return Qn.jsx(jo(t),e,n)}function st(t,e,n){return Qn.jsxs(jo(t),e,n)}function Lm(t,e,...n){return Qn.createElement(jo(t),e??null,...n)}function dn(t,e){return Qn.cloneElement(t,e)}var Fm=new Set([Symbol.for("react.element"),Symbol.for("react.transitional.element")]),Ts=Symbol.for("react.fragment");function Ie(t){if(typeof t!="object"||t===null||Array.isArray(t))return false;let e=t;return e.$$typeof!==void 0&&!Fm.has(e.$$typeof)?false:(typeof e.type=="string"||typeof e.type=="function"||e.type===Ts)&&typeof e.props=="object"&&e.props!==null}var fn=t=>t===Jt||t===Ts;var Qs=.6,Yo={logo:160,halftone:160};function Im(t){let e="";for(let o=0;o<t.length;o+=32768)e+=String.fromCharCode(...t.subarray(o,o+32768));return btoa(e)}var hn=class{entries=new Map;limit;constructor(e){this.limit=e;}get(e,n){let o=this.entries.get(e);if(o!==void 0)return this.entries.delete(e),this.entries.set(e,o),o;let r=n();if(this.entries.size>=this.limit){let a=this.entries.keys().next().value;a!==void 0&&this.entries.delete(a);}return this.entries.set(e,r),r}},Tm=new hn(8);function km(t){return Tm.get(t,()=>{let e=atob(t),n=new Uint8Array(e.length);for(let o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return n})}function Ko(t){let{width:e,height:n,data:o}=t;if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>re||n>re||typeof o!="string")return null;try{let r=km(o);return r.length===e*n*4?{width:e,height:n,data:r}:null}catch{return null}}function Gs(t,e={}){let{width:n,height:o,data:r}=t;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Art image pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=Math.min(n,o),i=e.square?Math.floor((n-a)/2):0,l=e.square?Math.floor((o-a)/2):0,s=e.square?a:n,c=e.square?a:o,u=Math.min(Math.max(Math.round(e.maxSize??Yo.halftone),1),re),m=Math.min(1,u/Math.max(s,c)),f=Math.max(1,Math.round(s*m)),d=Math.max(1,Math.round(c*m)),p=new Uint8Array(f*d*4);for(let h=0;h<d;h++){let g=Math.floor(h*c/d),y=Math.max(g+1,Math.floor((h+1)*c/d));for(let b=0;b<f;b++){let _=Math.floor(b*s/f),w=Math.max(_+1,Math.floor((b+1)*s/f)),R=0,S=0,$=0,M=0,C=0;for(let v=g;v<y;v++)for(let L=_;L<w;L++){let F=((v+l)*n+L+i)*4,k=r[F+3]/255;R+=r[F]*k,S+=r[F+1]*k,$+=r[F+2]*k,M+=k,C++;}let A=(h*f+b)*4;p[A]=M>0?Math.round(R/M):0,p[A+1]=M>0?Math.round(S/M):0,p[A+2]=M>0?Math.round($/M):0,p[A+3]=Math.round(M/C*255);}}return {width:f,height:d,data:Im(p)}}async function Nm(t){if(typeof t!="string"&&!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=typeof t=="string"?t:URL.createObjectURL(t);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the art image")),r.src=e;})}finally{typeof t!="string"&&setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function Om(t,e={}){if(typeof document>"u")throw new Error("loadQRArtImage needs a browser; pass decoded pixels to createQRArtImage instead");let n=e.mode??"halftone",o=e.maxSize??Yo[n],r=await Nm(t),a=r.naturalWidth||r.width||o,i=r.naturalHeight||r.height||o,l=n==="halftone",s=Math.min(1,o*4/(l?Math.min(a,i):Math.max(a,i))),c=Math.max(1,Math.round(a*s)),u=Math.max(1,Math.round(i*s)),m=document.createElement("canvas");m.width=c,m.height=u;let f=m.getContext("2d",{willReadFrequently:true});if(!f)throw new Error("Could not get a canvas context");f.imageSmoothingQuality="high",f.drawImage(r,0,0,c,u);let d;try{d=f.getImageData(0,0,c,u);}catch{throw new Error("Could not read the art image (cross-origin images need CORS); upload it instead")}finally{m.remove();}return Gs(d,{maxSize:o,square:l})}function Jo(t){return !!(t&&Ln.includes(t.mode)&&t.image&&Ko(t.image))}function Sr(t){let e=vn[t.mode];return t.variant&&e.includes(t.variant)?t.variant:e[0]}function Dm(t,e){if(t===1)return [];let n=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(n*2-2))*2,r=[6];for(let a=e-7;r.length<n;a-=o)r.splice(1,0,a);return r}function Gn(t,e){let n=Dm(t,e),o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[l,s]of n.entries())a===0&&l===0||a===0&&l===o||a===o&&l===0||r.push([i,s]);return r}var Bm=0,Bt=1,Gt=2,be=3,ks=4,Ns=new Map;function zs(t){let e=Ns.get(t);if(e)return e;let n=t*4+17,o=new Uint8Array(n*n),r=(a,i,l,s,c)=>{for(let u=Math.max(0,i);u<Math.min(n,i+s);u++)for(let m=Math.max(0,a);m<Math.min(n,a+l);m++)o[u*n+m]=c;};r(6,0,1,n,ks),r(0,6,n,1,ks),r(0,8,9,1,be),r(8,0,1,9,be),r(n-8,8,8,1,be),r(8,n-8,1,8,be),t>=7&&(r(n-11,0,3,6,be),r(0,n-11,6,3,be));for(let[a,i]of Gn(t,n))r(a-2,i-2,5,5,Gt);return r(0,0,8,8,Bt),r(n-8,0,8,8,Bt),r(0,n-8,8,8,Bt),Ns.set(t,o),o}function Qm(t){let e=t*4+17,n=zs(t);return Array.from({length:e},(o,r)=>Array.from({length:e},(a,i)=>n[r*e+i]!==Bm))}function Gm(t){let e=t[8],n=e?.[0]?1:0,o=e?.[1]?1:0,r=(1-n)*2+o;return ["M","L","H","Q"][r]??"M"}function pn(t,e){let n=dt(t);return !n||n.a===0?e:[n.r/255,n.g/255,n.b/255]}var ke=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n];function ye(t,e,n,o){let r=X(t);if(o?r<=n:r>=n)return t;let a=X(e);return Math.abs(r-a)<1e-6?e:ke(t,e,Math.min(1,Math.max(0,(r-n)/(r-a))))}var Us=t=>Math.max(...t)-Math.min(...t),zm=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,Zo=t=>t.toString(16).padStart(2,"0");function Pt(t,e=1){let n=o=>Math.min(255,Math.round(Math.round(Math.min(Math.max(o,0),1)*255)/e)*e);return `#${Zo(n(t[0]))}${Zo(n(t[1]))}${Zo(n(t[2]))}`}function Um(t){let e=t<0?-1:1,n=Math.abs(t),o=1/(1+.3275911*n),r=1-((((1.061405429*o-1.453152027)*o+1.421413741)*o-.284496736)*o+.254829592)*o*Math.exp(-n*n);return e*r}var ta=.3,Os=t=>1-Math.exp(-((t/2)**2)/(2*ta**2)),qm=t=>Um(t/(2*ta*Math.SQRT2))**2,Wm=(t,e,n)=>{let o=Math.min(1,Math.max(0,(n-t)/(e-t)));return o*o*(3-2*o)};function ea(t,e,n,o){let r=o==="cover"?Math.max(n/t,n/e):Math.min(n/t,n/e);return {scale:r,offsetX:(n-t*r)/2,offsetY:(n-e*r)/2}}function qs(t,e){let{width:n,height:o,data:r}=t,a=new Float32Array(n*o*3),i=e??new Float32Array(n*o);for(let l=0;l<n*o;l++)a[l*3]=r[l*4]/255,a[l*3+1]=r[l*4+1]/255,a[l*3+2]=r[l*4+2]/255,e||(i[l]=r[l*4+3]/255);return {width:n,height:o,rgb:a,alpha:i}}function Hm(t){let e=qs(t),{rgb:n,alpha:o}=e,r=new Float64Array(256),a=0;for(let m=0;m<o.length;m++){if(o[m]<.5)continue;let f=X([n[m*3],n[m*3+1],n[m*3+2]]);r[Math.min(255,Math.floor(f*256))]+=1,a++;}let i=m=>{let f=0;for(let d=0;d<256;d++)if(f+=r[d],f>=m*a)return d/255;return 1},l=a?i(.01):0,s=a?i(.99):1;s-l<.15&&(l=0,s=1);let c=Math.min(1.6,1/(s-l)),u=(l+s)/2;for(let m=0;m<o.length;m++){let f=[n[m*3],n[m*3+1],n[m*3+2]],d=X(f),p=.5+(d-u)*c;for(let h=0;h<3;h++)n[m*3+h]=Math.min(1,Math.max(0,p+(f[h]-d)*1.12));}return e}function Ws(t,e,n,o,r=1){let{width:a,height:i,rgb:l,alpha:s}=t,c=Math.min(Math.max(e-.5,0),a-1),u=Math.min(Math.max(n-.5,0),i-1),m=Math.floor(c),f=Math.floor(u),d=Math.min(m+1,a-1),p=Math.min(f+1,i-1),h=c-m,g=u-f,y=0,b=0,_=0,w=0,R=($,M,C)=>{let A=M*a+$,v=s[A]*C;y+=l[A*3]*v,b+=l[A*3+1]*v,_+=l[A*3+2]*v,w+=v;};if(R(m,f,(1-h)*(1-g)),R(d,f,h*(1-g)),R(m,p,(1-h)*g),R(d,p,h*g),w<=0)return o;let S=w*r;return [o[0]+(y/w-o[0])*S,o[1]+(b/w-o[1])*S,o[2]+(_/w-o[2])*S]}var Vm=new hn(4),jm=new hn(6),Zm=new hn(6);function na(t,e){return jm.get(t.image.data,()=>Fs(e))}function Hs(t,e,n){return Zm.get(t.image.data,()=>qs(e,n.alpha))}var $t=t=>J(t,2),Vs=t=>J(t,4),Ne=class{groups=new Map;add(e,n){let o=this.groups.get(e);o?o.push(n):this.groups.set(e,[n]);}cellRun(e,n,o,r){this.add(e,`M${n} ${o}h${r}.04v1.04h-${r}.04z`);}circle(e,n,o,r){this.add(e,Xm(n,o,r));}toElements(e){return [...this.groups].map(([n,o],r)=>E("path",{d:o.join(""),fill:n},`${e}-${r}`))}};function Xm(t,e,n){let o=$t(n*2),r=$t(n);return `M${$t(t-n)} ${$t(e)}a${r} ${r} 0 1 0 ${o} 0a${r} ${r} 0 1 0 ${-o} 0z`}function Te(t,e,n,o,r){let a=Math.min(r,n/2,o/2);if(a<=0)return `M${$t(t)} ${$t(e)}h${$t(n)}v${$t(o)}h${$t(-n)}z`;let i=$t(a);return `M${$t(t+a)} ${$t(e)}h${$t(n-2*a)}a${i} ${i} 0 0 1 ${i} ${i}v${$t(o-2*a)}a${i} ${i} 0 0 1 ${-i} ${i}h${$t(-(n-2*a))}a${i} ${i} 0 0 1 ${-i} ${-i}v${$t(-(o-2*a))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function js(t,e,n){let o="";for(let[r,a]of t){let i=(r-2+e)*n,l=(a-2+e)*n;o+=Te(i,l,5*n,5*n,n*.35),o+=Te(i+n,l+n,3*n,3*n,n*.15),o+=Te(i+2*n,l+2*n,n,n,n*.12);}return o}var Ym={blend:1,badge:1,color:.9,mono:.7},$r=.35;function Km(t,e){let n=pn(t,[0,0,0]),o=pn(e,[1,1,1]),r=X(o)-X(n);return r>=$r?null:r<=-$r?"inverted":"low-contrast"}function Zs(t,e,n){let o=Math.min(Math.max(t.intensity??Qs,0),Ym[Sr(t)]);return X(n)-X(e)>=$r?o:0}function Jm(t){let{art:e,modules:n,version:o}=t,r=e.image&&Ko(e.image);if(!(r&&Ln.includes(e.mode)))return null;let a=n.length;if(a!==o*4+17)return null;let i=pn(t.fgColor,[0,0,0]),l=pn(t.bgColor,[1,1,1]),s=Zs(e,i,l);return s<=0?null:{art:e,image:r,modules:n,size:a,version:o,kinds:zs(o),margin:t.margin,pixelSize:t.pixelSize,t:s,fg:i,bg:l,variant:Sr(e),body:t.body}}function ra(t){let e=Jm(t);if(!e)return null;let n;return e.art.mode==="halftone"?n=e.variant==="mono"?a1(e):o1(e):n=e.variant==="badge"?h1(e):i1(e),E("g",{"data-qrdx-art":e.art.mode,"data-qrdx-art-variant":e.variant,children:n})}function t1(t,e){return {margin:.42-.17*t+(e===3?.04:0),darkCap:.4+.3*t}}var Xs=8.5,Ds=new Map;function oa(t){let e=t*4+17,n=Ds.get(t);if(!n){let a=e*2,i=new Uint8Array(a*a),l=Xs*2;for(let s=0;s<a;s++)for(let c=0;c<a;c++){let u=c<l||c>=a-l,m=s<l||s>=a-l;u&&m&&!(c>=a-l&&s>=a-l)&&(i[s*a+c]=1);}for(let[s,c]of Gn(t,e))for(let u=(c-2)*2-1;u<(c+3)*2+1;u++)for(let m=(s-2)*2-1;m<(s+3)*2+1;m++)m>=0&&u>=0&&m<a&&u<a&&(i[u*a+m]=1);Ds.set(t,i),n=i;}let o=n,r=e*2;return (a,i)=>{let l=Math.floor(a*2),s=Math.floor(i*2);return l>=0&&s>=0&&l<r&&s<r&&o[s*r+l]===1}}function Ys(t,e,n=false){let{image:o,size:r,kinds:a,fg:i,bg:l}=t,s=Vm.get(t.art.image.data,()=>Hm(o)),c=ea(o.width,o.height,r,"cover"),u=r*e,m=new Float32Array(u*u*3).fill(Number.NaN),d=1/(e*c.scale)>1.3?2:1,p=X(l)-.1*(X(l)-X(i)),h=oa(t.version);for(let g=0;g<r;g++)for(let y=0;y<r;y++){let b=a[g*r+y],_=b===Bt||b===Gt;if(!(_&&!n))for(let w=0;w<e;w++)for(let R=0;R<e;R++){let S=0,$=0,M=0;for(let O=0;O<d;O++)for(let I=0;I<d;I++){let Q=y+(R+(I+.5)/d)/e,W=g+(w+(O+.5)/d)/e,D=Ws(s,(Q-c.offsetX)/c.scale,(W-c.offsetY)/c.scale,l);S+=D[0],$+=D[1],M+=D[2];}let C=d*d,A=[S/C,$/C,M/C],v=y+(R+.5)/e,L=g+(w+.5)/e,F=Math.min(v,L,r-v,r-L);F<1.5&&(A=ke(A,l,.35*(1-F/1.5))),n&&(_||h(v,L))&&(A=ye(A,l,p,false));let k=((g*e+w)*u+y*e+R)*3;m[k]=A[0],m[k+1]=A[1],m[k+2]=A[2];}}return {n:e,count:u,rgb:m}}function e1(t,e,n){let{size:o,kinds:r,modules:a,fg:i,bg:l,t:s}=t,{n:c,count:u,rgb:m}=e,f=X(i),d=X(l),p=d-f,h=t1(s,c),g=M=>.2126*m[M]+.7152*m[M+1]+.0722*m[M+2],y=new Float32Array(o*o),b=new Float32Array(o*o);for(let M=0;M<o;M++)for(let C=0;C<o;C++){let A=r[M*o+C];if(A===Bt){y[M*o+C]=d;continue}if(A===Gt){y[M*o+C]=a[M]?.[C]?f:d;continue}let v=0,L=0,F=0;for(let k=0;k<c;k++)for(let O=0;O<c;O++){let I=g(((M*c+k)*u+C*c+O)*3);v+=I,n.under[k*c+O]||(L+=I,F++);}y[M*o+C]=v/(c*c),b[M*o+C]=F?L/F:v/(c*c);}let _=o+1,w=new Float64Array(_*_);for(let M=0;M<o;M++)for(let C=0;C<o;C++)w[(M+1)*_+C+1]=y[M*o+C]+w[M*_+C+1]+w[(M+1)*_+C]-w[M*_+C];let R=2,S=(M,C)=>{let A=Math.max(0,M-R),v=Math.max(0,C-R),L=Math.min(o,M+R+1),F=Math.min(o,C+R+1);return (w[F*_+L]-w[v*_+L]-w[F*_+A]+w[v*_+A])/((L-A)*(F-v))},$=n.weight;for(let M=0;M<o;M++)for(let C=0;C<o;C++){let A=r[M*o+C];if(A===Bt||A===Gt)continue;let v=A===be,L=(h.margin+(v?.08:0))*p,F=(h.darkCap-(v?.12:0))*p,k=($*((n.light-n.dark)/2)-L)/(1-$),O=S(C,M),I=b[M*o+C],Q=!!a[M]?.[C],W=0,D=l;if(Q){let z=Math.min(O+k,f+F);I>z&&(W=(I-z)/Math.max(I-f,1e-6),D=i);}else {let z=Math.max(O-k,d-F);I<z&&(W=(z-I)/Math.max(d-I,1e-6));}if(!(W<=0)){W=Math.min(1,W);for(let z=0;z<c;z++)for(let et=0;et<c;et++){let bt=((M*c+z)*u+C*c+et)*3;for(let lt=0;lt<3;lt++)m[bt+lt]+=(D[lt]-m[bt+lt])*W;}}}}function Ks(t,e,n,o){let{count:r}=e,a=new Ne;for(let s=0;s<r;s++){let c=0,u=n(s*r);for(let m=1;m<=r;m++){let f=m<r?n(s*r+m):null;(m===r||f!==u)&&(u&&a.cellRun(u,c,s,m-c),c=m,u=f);}}let i=t.pixelSize/e.n,l=$t(t.margin*t.pixelSize);return E("g",{transform:`translate(${l} ${l}) scale(${Vs(i)})`,children:a.toElements(o)},o)}function aa(t,e){let n=Gn(t.version,t.size);return n.length===0?[]:[E("path",{d:js(n,t.margin,t.pixelSize),fill:e,fillRule:"evenodd"},"art-alignment")]}function Js(t){let{image:e,size:n}=t;return Math.floor(Math.min(e.width,e.height)/n)>=4&&n<=45?4:3}var n1=t=>2*ta*Math.sqrt(-2*Math.log(1-Math.min(t,.95)));function r1(t,e,n){let o=e+1,r=new Float64Array(o*o);for(let i=0;i<e;i++)for(let l=0;l<e;l++)r[(i+1)*o+l+1]=t[i*e+l]+r[i*o+l+1]+r[(i+1)*o+l]-r[i*o+l];let a=new Float32Array(e*e);for(let i=0;i<e;i++)for(let l=0;l<e;l++){let s=Math.max(0,l-n),c=Math.max(0,i-n),u=Math.min(e,l+n+1),m=Math.min(e,i+n+1);a[i*e+l]=(r[m*o+u]-r[c*o+u]-r[m*o+s]+r[c*o+s])/((u-s)*(m-c));}return a}function tl(t,e,n,o){let{size:r,kinds:a,modules:i,fg:l,bg:s}=t,c=X(l),u=X(s),m=u-c,f=r1(e,r,2),d=new Float32Array(r*r),p=new Float32Array(r*r).fill(Number.NaN);for(let h=0;h<r;h++)for(let g=0;g<r;g++){let y=h*r+g,b=a[y];if(b===Bt||b===Gt)continue;let _=b===be,w=o.base+(_?.08:0),R=(o.margin+(_?.03:0))*m,S=(o.cap-(_?.04:0))*m,$=Os(w),M=Os(_?Math.max(o.max,.94):o.max),C=$*((o.dark+o.light)/2)+(1-$)*f[y],A=n[y],v=!!i[h]?.[g],L=v?o.dark:o.light,F=v?Math.min(C-R,c+S):Math.max(C+R,u-S),O=(v?A<=F:A>=F)?0:(A-F)/(A-L);O>M&&(O=M,p[y]=Math.min(u,Math.max(c,(F-M*L)/(1-M))));let I=v?A<=F-.06:A>=F+.06;o.skip&&I&&!_||(O=Math.max(O,$)),d[y]=O>0?n1(O):0;}return {diameter:d,surround:p}}function o1(t){let{size:e,kinds:n,modules:o,fg:r,bg:a,t:i,margin:l,pixelSize:s}=t,c=Js(t),u=Ys(t,c,true),m=X(r),f=X(a),d=m+.1*(f-m),p=f-.05*(f-m),{count:h,rgb:g}=u,y=(S,$,M,C)=>(($*c+C)*h+S*c+M)*3,b=new Float32Array(e*e);for(let S=0;S<e;S++)for(let $=0;$<e;$++){let M=n[S*e+$];if(M===Bt||M===Gt){b[S*e+$]=M===Gt&&o[S]?.[$]?m:f;continue}let C=0;for(let A=0;A<c;A++)for(let v=0;v<c;v++){let L=y($,S,v,A);C+=.2126*g[L]+.7152*g[L+1]+.0722*g[L+2];}b[S*e+$]=C/(c*c);}let _=tl(t,b,b,{base:.6-.28*i,max:.86,dark:d,light:p,margin:.2-.1*i,cap:.4+.14*i,skip:false});for(let S=0;S<e;S++)for(let $=0;$<e;$++){let M=_.surround[S*e+$];if(Number.isNaN(M))continue;let C=b[S*e+$],v=M<C?r:a,L=Math.min(1,Math.abs(C-M)/Math.max(Math.abs(C-X(v)),1e-6));for(let F=0;F<c;F++)for(let k=0;k<c;k++){let O=y($,S,k,F);for(let I=0;I<3;I++)g[O+I]+=(v[I]-g[O+I])*L;}}let w=[Ks(t,u,S=>{let $=S*3;return Number.isNaN(g[$])?null:Pt([g[$],g[$+1],g[$+2]],8)},"art-photo")],R=new Ne;for(let S=0;S<e;S++)for(let $=0;$<e;$++){let M=_.diameter[S*e+$];if(!(M>0))continue;let C=0,A=0,v=0;for(let k=0;k<c;k++)for(let O=0;O<c;O++){let I=y($,S,O,k);C+=g[I],A+=g[I+1],v+=g[I+2];}let L=[C/(c*c),A/(c*c),v/(c*c)],F=o[S]?.[$]?ye(L,r,d,true):ye(L,a,p,false);R.circle(Pt(F,10),($+l+.5)*s,(S+l+.5)*s,M/2*s);}return w.push(...R.toElements("art-dot"),...aa(t,Pt(r))),w}function a1(t){let{size:e,kinds:n,modules:o,fg:r,bg:a}=t,i=Js(t),l=Ys(t,i),s=X(r),c=X(a),u=i%2===1?1:2,m=(i-u)/2,f=C=>C>=m&&C<m+u,d=[];for(let C=0;C<i;C++)for(let A=0;A<i;A++)d.push(f(A)&&f(C));e1(t,l,{weight:qm(u/i),dark:s,light:c,under:d});let{count:p,rgb:h}=l,g=new Float32Array(p*p),y=new Int8Array(p*p).fill(-1);for(let C=0;C<p*p;C++){let A=C*3;if(Number.isNaN(h[A])){g[C]=Number.NaN;continue}let v=(.2126*h[A]+.7152*h[A+1]+.0722*h[A+2]-s)/(c-s);g[C]=.5+(Wm(0,1,v)-.5)*1.15;}for(let C=0;C<e;C++)for(let A=0;A<e;A++){let v=n[C*e+A];if(!(v===Bt||v===Gt))for(let L=m;L<m+u;L++)for(let F=m;F<m+u;F++)y[(C*i+L)*p+A*i+F]=o[C]?.[A]?0:1;}let b=oa(t.version);for(let C=0;C<p;C++)for(let A=0;A<p;A++){let v=C*p+A;y[v]<0&&b((A+.5)/i,(C+.5)/i)&&(y[v]=1);}let _=new Uint8Array(p*p),w=.3,R=0,S=0,$=(C,A,v)=>{if(C<0||C>=p||A>=p)return;let L=A*p+C;if(!Number.isNaN(g[L])){let F=Math.floor(C/i)===Math.floor(R/i)&&Math.floor(A/i)===Math.floor(S/i);g[L]+=F?v:v*w;}};for(let C=0;C<p;C++){let A=C%2===0?1:-1;for(let v=0;v<p;v++){let L=A===1?v:p-1-v,F=C*p+L,k=g[F];if(Number.isNaN(k))continue;let O=y[F]>=0?y[F]:k>=.5?1:0;_[F]=O===0?1:0;let I=Math.min(.75,Math.max(-0.75,k-O));R=L,S=C,$(L+A,C,I*7/16),$(L-A,C+1,I*3/16),$(L,C+1,I*5/16),$(L+A,C+1,I/16);}}let M=Pt(r);return [Ks(t,l,C=>_[C]?M:null,"art-halftone"),...aa(t,M)]}function Bs(t,e){let n=null,o=0;for(let r of t.palette){if(e&&zm(r.color,e)<.02)continue;let a=r.area*(.35+Us(r.color))*(X(r.color)>.86?.05:1);a>o&&(o=a,n=r.color);}return n}function el(t,e,n,o,r){let a;if(t.photographic){let i=new Ne,{width:l,height:s,rgb:c,alpha:u}=e;for(let m=0;m<s;m++){let f=0,d=null;for(let p=0;p<=l;p++){let h=m*l+p,g=p<l&&u[h]>=.5?Pt(o([c[h*3],c[h*3+1],c[h*3+2]]),6):null;(p===l||g!==d)&&(d&&i.cellRun(d,f,m,p-f),f=p,d=g);}}a=i.toElements(`${r}-px`);}else a=t.layers.map((i,l)=>E("path",{d:i.d,fill:Pt(o(i.color)),fillRule:"evenodd"},`${r}-${l}`));return E("g",{transform:`translate(${$t(n.x)} ${$t(n.y)}) scale(${Vs(n.scale)})`,children:a},r)}function i1(t){let{art:e,image:n,size:o,kinds:r,modules:a,fg:i,bg:l,t:s,margin:c,pixelSize:u}=t,m=na(e,n),f=Hs(e,n,m),d=ea(m.width,m.height,o,"contain"),p=Math.min(1,.3+1.4*s),h=I=>ke(l,I,p),g=Pt(l),y=Pt(i),b=[el(m,f,{x:(c+d.offsetX)*u,y:(c+d.offsetY)*u,scale:d.scale*u},h,"art-logo")],_=Xs,w=(I,Q)=>Te((I+c)*u,(Q+c)*u,(_+.4)*u,(_+.4)*u,1.2*u),R=Gn(t.version,o).map(([I,Q])=>Te((I-2.5+c)*u,(Q-2.5+c)*u,6*u,6*u,u*.8)).join("");b.push(E("path",{d:w(-0.4,-0.4)+w(o-_,-0.4)+w(-0.4,o-_)+R,fill:g},"art-plates"));let S=oa(t.version),$=X(l),M=X(i),C=new Float32Array(o*o),A=new Float32Array(o*o),v=new Array(o*o);for(let I=0;I<o;I++)for(let Q=0;Q<o;Q++){let W=I*o+Q,D=r[W];if(D===Bt||D===Gt){C[W]=D===Gt&&a[I]?.[Q]?M:$;continue}let z=1,et=0,bt=0,lt=0,N=0;for(let U=0;U<4;U++)for(let q=0;q<4;q++){let Ct=Q+(q+.5)/4,Re=I+(U+.5)/4,Tt=S(Ct,Re)?l:Ws(f,(Ct-d.offsetX)/d.scale,(Re-d.offsetY)/d.scale,l,p),ee=X(Tt);z=Math.min(z,ee),et+=ee,bt+=Tt[0],lt+=Tt[1],N+=Tt[2];}C[W]=et/16,A[W]=z,v[W]=[bt/16,lt/16,N/16];}let L=M+.08*($-M),F=$-.04*($-M),k=tl(t,C,C,{base:.74-.26*s,max:.9,dark:L,light:F,margin:.23-.1*s,cap:.4+.1*s,skip:s>=.7}),O=new Ne;for(let I=0;I<o;I++)for(let Q=0;Q<o;Q++){let W=I*o+Q,D=k.diameter[W],z=!!a[I]?.[Q];if(!(D>0)||!z&&A[W]>=$-.02)continue;let et=z?ye(v[W],i,L,true):ye(v[W],l,F,false);O.circle(Pt(et,8),(Q+c+.5)*u,(I+c+.5)*u,D/2*u);}return b.push(...O.toElements("art-dot")),b.push(...aa(t,y)),b}var s1={L:.5,M:.72,Q:.88,H:1},nl=.32,rl=.55,l1=.6,c1=2;function ol(t,e,n){let o=e>=1?t:t*e,r=e>=1?t/e:t,a=Math.max(.7,t*.09),i=o+2*a,l=r+2*a;return {logoW:o,logoH:r,plateW:i,plateH:l,radius:Math.min(i,l)*.26,cx:n/2,cy:n/2}}var al=t=>({cx:t.cx,cy:t.cy,w:t.plateW,h:t.plateH,r:t.radius});function il(t,e,n){return ll(e+.5,n+.5,t)<rl}function u1(t,e){let n=al(t),o=rl+1,r=Math.max(0,Math.floor(t.cx-t.plateW/2-o)),a=Math.min(e-1,Math.ceil(t.cx+t.plateW/2+o)),i=Math.max(0,Math.floor(t.cy-t.plateH/2-o)),l=Math.min(e-1,Math.ceil(t.cy+t.plateH/2+o)),s=[];for(let c=i;c<=l;c++)for(let u=r;u<=a;u++)il(n,u,c)&&s.push(c*e+u);return s}var m1=t=>Math.floor(t.correctable*l1);function Xo(t,e,n){let o=ol(t,e,n.size),r=m1(n);return Bn(n,u1(o,n.size)).every(a=>a<=r)}function sl(t,e,n){if(Xo(n,e,t))return n;let o=0,r=n;if(!Xo(o,e,t))return -1;for(;r-o>1/64;){let a=(o+r)/2;Xo(a,e,t)?o=a:r=a;}return o}var xr=new Map;function d1(t,e){let n=`${t.version}${t.level}:${e.toFixed(3)}`,o=xr.get(n);return o===void 0&&(o=sl(t,e,nl*t.size),xr.size>=64&&xr.clear(),xr.set(n,o)),o}function f1(t,e){let{size:n,t:o,modules:r,version:a}=t,i=Gm(r),l=(.18+.15*o)*s1[i],s=e.width/e.height,c=Math.min(nl,l)*n,u=Dn(a,i),m=Math.max(0,d1(u,s));if(m<c1)return {wantedBox:c,maxBox:m,box:0,plate:null};let f=sl(u,s,Math.min(c,m));return f<0?{wantedBox:c,maxBox:m,box:0,plate:null}:{wantedBox:c,maxBox:m,box:f,plate:ol(f,s,n)}}function ll(t,e,n){let o=Math.abs(t-n.cx)-(n.w/2-n.r),r=Math.abs(e-n.cy)-(n.h/2-n.r);return Math.hypot(Math.max(o,0),Math.max(r,0))+Math.min(Math.max(o,r),0)-n.r}function cl(t,e){let{fg:n,bg:o,t:r}=t,a=X(n),i=X(o),l=Bs(e),s=Math.min(1,r/.6),c=l?ye(l,n,a+.3*(i-a),true):n,u=ke(n,c,s),m=l?Bs(e,l):null,f=a+.42*(i-a),d=m&&X(m)<=f+.22?ke(n,ye(m,n,f,true),s):u;return {body:u,inner:d}}function h1(t){let{art:e,image:n,size:o,kinds:r,modules:a,bg:i,margin:l,pixelSize:s,version:c}=t,u=na(e,n),m=f1(t,u).plate,{body:f}=cl(t,u),d=Pt(f),p=m&&al(m),h=a.map(v=>[...v]);for(let v=0;v<o;v++)for(let L=0;L<o;L++){let F=r[v*o+L];(F===Gt||p&&F!==Bt&&il(p,L,v))&&(h[v][L]=false);}let g=[],y=t.body?.(h);if(y)g.push(E("g",{fill:d,children:y},"art-body"));else {let v=new Ne;for(let L=0;L<o;L++)for(let F=0;F<o;F++)h[L]?.[F]&&r[L*o+F]!==Bt&&v.circle(d,(F+l+.5)*s,(L+l+.5)*s,.45*s);g.push(...v.toElements("art-body"));}let b=Gn(c,o).filter(([v,L])=>!p||ll(v+.5,L+.5,p)>3.2);if(b.length>0&&g.push(E("path",{d:js(b,l,s),fill:d,fillRule:"evenodd"},"art-alignment")),!m)return g;let _=Hs(e,n,u),w=(m.cx-m.plateW/2+l)*s,R=(m.cy-m.plateH/2+l)*s,S=m.plateW*s,$=m.plateH*s,M=m.radius*s,C=.1*s,A=Te(w,R,S,$,M);return g.push(E("path",{d:A,fill:Pt(i)},"art-plate"),E("path",{d:A+Te(w+C,R+C,S-2*C,$-2*C,M-C),fill:Pt(ke(i,f,.16)),fillRule:"evenodd"},"art-plate-ring"),el(u,_,{x:(m.cx-m.logoW/2+l)*s,y:(m.cy-m.logoH/2+l)*s,scale:m.logoW/u.width*s},v=>v,"art-logo")),g}function ia(t){let{art:e}=t;if(e.mode!=="logo"||e.matchEyes===false)return null;let n=e.image&&Ko(e.image);if(!n)return null;let o=pn(t.fgColor,[0,0,0]),r=pn(t.bgColor,[1,1,1]),a=Zs(e,o,r);if(a<=0)return null;let i=na(e,n);if(i.palette.length===0)return null;if(Sr(e)==="badge"){let{body:p,inner:h}=cl({fg:o,bg:r,t:a},i),g={outer:Pt(p),inner:Pt(h)};return {topLeft:g,topRight:g,bottomLeft:g}}let l=X(o),s=X(r),c=Math.min(1,a/.6),u=t.version*4+17,m=ea(i.width,i.height,u,"contain"),f=.45*Math.max(i.width,i.height),d=(p,h)=>{let g=(p-m.offsetX)/m.scale,y=(h-m.offsetY)/m.scale,b=null,_=0;for(let R of i.palette){if(X(R.color)>.86)continue;let S=(R.cx-g)**2+(R.cy-y)**2,$=R.area*(.35+Us(R.color))*Math.exp(-S/(2*f**2));$>_&&(_=$,b=R.color);}if(!b)return {};let w=ye(b,o,l+.42*(s-l),true);return {inner:Pt(ke(o,w,c))}};return {topLeft:d(3.5,3.5),topRight:d(u-3.5,3.5),bottomLeft:d(3.5,u-3.5)}}function tt(t){if(t.length===0)return "";let[e,...n]=t;return `M${x(e[0])} ${x(e[1])}${n.map(([o,r])=>`L${x(o)} ${x(r)}`).join("")}Z`}function Y(t,e,n){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(n)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(n)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function B(t,e,n,o,r=0){let a=Math.min(n,o)/2,[i,l,s,c]=(typeof r=="number"?[r,r,r,r]:r).map(m=>Math.max(0,Math.min(m,a))),u=(m,f,d)=>m>0?`A${x(m)} ${x(m)} 0 0 1 ${x(f)} ${x(d)}`:"";return `M${x(t+i)} ${x(e)}H${x(t+n-l)}${u(l,t+n,e+l)}V${x(e+o-s)}${u(s,t+n-s,e+o)}H${x(t+c)}${u(c,t,e+o-c)}V${x(e+i)}${u(i,t+i,e)}Z`}function gn(t,e,n,o,r=-90){return Array.from({length:o},(a,i)=>{let l=(r+360/o*i)*Math.PI/180;return [t+n*Math.cos(l),e+n*Math.sin(l)]})}function bn(t,e,n,o,r=5){return Array.from({length:r*2},(a,i)=>{let l=i%2===0?n:o,s=-Math.PI/2+Math.PI/r*i;return [t+l*Math.cos(s),e+l*Math.sin(s)]})}function zn(t,e,n,o,r=4,a=64){return Array.from({length:a},(i,l)=>{let s=2*Math.PI*l/a,c=Math.cos(s),u=Math.sin(s);return [t+n*Math.sign(c)*Math.abs(c)**(2/r),e+o*Math.sign(u)*Math.abs(u)**(2/r)]})}function yn(t,e,n){let o=n/2,r=(a,i)=>`${x(t+a*o)} ${x(e+i*o)}`;return `M${r(0,-0.52)}C${r(.18,-0.92)} ${r(.98,-0.94)} ${r(1,-0.34)}C${r(1,.12)} ${r(.5,.48)} ${r(0,.92)}C${r(-0.5,.48)} ${r(-1,.12)} ${r(-1,-0.34)}C${r(-0.98,-0.94)} ${r(-0.18,-0.92)} ${r(0,-0.52)}Z`}function ul(t,e,n,o){if(o===0)return t;let r=o*Math.PI/180,a=Math.cos(r),i=Math.sin(r);return t.map(([l,s])=>[e+(l-e)*a-(s-n)*i,n+(l-e)*i+(s-n)*a])}function wr(t,e,n=0){let o=Math.imul(t+2654435769,2246822507)^Math.imul(e+n,3266489909);return o=Math.imul(o^o>>>15,739982445),o=Math.imul(o^o>>>12,695872825),o^=o>>>15,(o>>>0)/4294967296}function Oe(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return (e>>>0).toString(36)}var p1=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];function ml(t){return p1.includes(t)}var dl={circle:.95,"circle-large":.85,square:.75,diamond:.95,pacman:.9,rounded:.75,"vertical-line":.8,liquid:.75,"liquid-horizontal":.85,"liquid-vertical":.85,classy:.7,"classy-rounded":.7,leaf:.75,plus:.8,hexagon:.75,star:.85,heart:.85,"random-dots":.85,mosaic:.8,octagon:.8};function Cr(t,e){if(t===void 0||!Number.isFinite(t))return 1;let n=e?dl[e]??1:Nn;return Math.min(yr,Math.max(Nn,n,t))}function g1(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}function b1(t,e){if(t===1)return [];let n=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(n*2-2))*2,r=[6];for(let a=e-7;r.length<n;a-=o)r.splice(1,0,a);return r}function sa(t){let e=(t-17)/4,n=Number.isInteger(e)?b1(e,t):[],o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[l,s]of n.entries())a===0&&l===0||a===0&&l===o||a===o&&l===0||r.push([i,s]);return (a,i)=>r.some(([l,s])=>Math.abs(a-l)<=2&&Math.abs(i-s)<=2)}var y1={liquid:{horizontal:true,vertical:true,thickness:1,radius:()=>1,fillets:true},"liquid-horizontal":{horizontal:true,vertical:false,thickness:.86,radius:()=>1,fillets:false},"liquid-vertical":{horizontal:false,vertical:true,thickness:.86,radius:()=>1,fillets:false},classy:{horizontal:true,vertical:true,thickness:1,radius:t=>t===0||t===2?1:0,fillets:false},"classy-rounded":{horizontal:true,vertical:true,thickness:1,radius:t=>t===0||t===2?1:.4,fillets:false}};function _1(t,e,n,o,r,a){switch(t){case "horizontal-line":{let i=o*.43;return B(e-o/2,n-i,o,2*i)}case "leaf":{let i=o*.5;return B(e-i,n-i,2*i,2*i,[o*.4,o*.05,o*.4,o*.05])}case "plus":{let i=o*.22,l=o*.5;return tt([[e-i,n-l],[e+i,n-l],[e+i,n-i],[e+l,n-i],[e+l,n+i],[e+i,n+i],[e+i,n+l],[e-i,n+l],[e-i,n+i],[e-l,n+i],[e-l,n-i],[e-i,n-i]])}case "hexagon":return tt(gn(e,n,o*.54,6));case "star":return tt(bn(e,n+o*.04,o*.62,o*.34));case "heart":return yn(e,n+o*.02,o*1.08);case "random-dots":return Y(e,n,o*(.38+.15*wr(r,a)));case "mosaic":{let i=o*(.8+.14*wr(r,a,1))/2,l=[[e-i,n-i],[e+i,n-i],[e+i,n+i],[e-i,n+i]];return tt(ul(l,e,n,(wr(r,a,2)-.5)*16))}case "octagon":return tt(gn(e,n,o*.48/Math.cos(Math.PI/8),8,22.5));default:return Y(e,n,o*.45)}}function fl(t,e){let{margin:n,pixelSize:o,pattern:r}=e,a=Cr(e.scale,r),i=t.length,l=e.plain?()=>false:sa(i),s=(h,g)=>!e.plain&&g1(h,g,i),c=(h,g)=>h>=0&&g>=0&&h<i&&g<i&&!!t[g]?.[h]&&!s(h,g),u=h=>(h+.5+n)*o,m=[],f=[],d=y1[r];for(let h=0;h<i;h++)for(let g=0;g<i;g++){if(!c(g,h))continue;let y=u(g),b=u(h);if(l(g,h)){m.push(P`M${y-o/2} ${b-o/2}h${o}v${o}h${-o}z`);continue}if(!d){f.push(_1(r,y,b,o*a,g,h));continue}let _=o*d.thickness*a/2,w=d.horizontal&&c(g+1,h),R=d.horizontal&&c(g-1,h),S=d.vertical&&c(g,h-1),$=d.vertical&&c(g,h+1),C=[!(S||R),!(S||w),!($||w),!($||R)].map((A,v)=>A?_*d.radius(v):0);f.push(B(y-_,b-_,2*_,2*_,C)),2*_<o&&(w&&f.push(B(y,b-_,o,2*_)),$&&f.push(B(y-_,b,2*_,o)));}if(d?.fillets&&a===1){let h=o*.3;for(let g=0;g<i;g++)for(let y=0;y<i;y++){if(c(y,g)||s(y,g))continue;let b=u(y)-o/2,_=u(g)-o/2,w=b+o,R=_+o;c(y-1,g)&&c(y,g-1)&&c(y-1,g-1)&&f.push(P`M${b} ${_}h${h}A${h} ${h} 0 0 0 ${b} ${_+h}Z`),c(y+1,g)&&c(y,g-1)&&c(y+1,g-1)&&f.push(P`M${w} ${_}v${h}A${h} ${h} 0 0 0 ${w-h} ${_}Z`),c(y+1,g)&&c(y,g+1)&&c(y+1,g+1)&&f.push(P`M${w} ${R}h${-h}A${h} ${h} 0 0 0 ${w} ${R-h}Z`),c(y-1,g)&&c(y,g+1)&&c(y-1,g+1)&&f.push(P`M${b} ${R}v${-h}A${h} ${h} 0 0 0 ${b+h} ${R}Z`);}}let p=[];return f.length>0&&p.push(E("path",{d:f.join("")},"modules")),m.length>0&&p.push(E("path",{d:m.join("")},"alignment")),p}var Xg=(t,e,n,o)=>{let r=document.createElement("canvas");r.width=e,r.height=n;let a=r.getContext("2d");if(!a)return;a.putImageData(t,0,0);let i=r.toDataURL("image/png"),l=document.createElement("a");l.href=i,l.download=o,document.body.appendChild(l),l.click(),document.body.removeChild(l);},x1=async(t,e,n,o)=>{let{default:r}=await import('jsqr');return new Promise(a=>{t.complete?i():(t.onload=()=>i(),t.onerror=()=>a(null));function i(){let l=document.createElement("canvas");requestAnimationFrame(()=>{if(!(t.naturalWidth&&t.naturalHeight)){a(null);return}let s=t.naturalWidth/t.naturalHeight<=.33||t.naturalWidth/t.naturalHeight>=3?Math.sqrt(t.naturalWidth*t.naturalHeight/12e5):t.naturalWidth/t.naturalHeight<=.5||t.naturalWidth/t.naturalHeight>=2?Math.sqrt(t.naturalWidth*t.naturalHeight/9e5):Math.sqrt(t.naturalWidth*t.naturalHeight/64e4),c=l.getContext("2d",{willReadFrequently:true});if(!c){a(null);return}let u=[1,.8,.6,.4,.2,.1];for(let m of u){let f=Math.floor(t.naturalWidth*e*m/s),d=Math.floor(t.naturalHeight*e*m/s);l.width=f,l.height=d,c.clearRect(0,0,f,d),c.imageSmoothingEnabled=true,c.imageSmoothingQuality="high";try{c.drawImage(t,Math.floor(n),Math.floor(o),Math.floor(t.naturalWidth*e),Math.floor(t.naturalHeight*e),0,0,f,d);let p=c.getImageData(0,0,f,d);try{let h=r(p.data,f,d);if(h?.data){a(h);return}}catch(h){console.error("QR Detection error:",h);}}catch(p){console.error("Canvas drawing error:",p);}}a(null);});}})},hl=async(t,e,n=false)=>{if(!t)return "NO_QR";await new Promise(r=>setTimeout(r,100));let o=[{dx:0,dy:0,ratio:1},{dx:0,dy:t.naturalHeight*.35,ratio:.65},{dx:t.naturalWidth*.35,dy:t.naturalHeight*.35,ratio:.65},{dx:t.naturalWidth*.35,dy:0,ratio:.65},{dx:t.naturalWidth*.35/2,dy:t.naturalHeight*.35/2,ratio:.65}];for(let r of o)try{let a=await x1(t,r.ratio,r.dx,r.dy);if(a?.data)return n?a:a.data}catch(a){console.warn("QR decode error:",a);}return "NO_QR"};function Yg(t,e,n){if(!(t&&e)||e.length!==4)return;let o=document.createElement("canvas");o.width=t.naturalWidth,o.height=t.naturalHeight;let r=o.getContext("2d");if(!r)return;r.drawImage(t,0,0),r.save(),r.strokeStyle="#ff0000",r.lineWidth=Math.max(5,Math.min(t.naturalWidth,t.naturalHeight)/200),r.shadowColor="transparent",r.shadowBlur=0,r.beginPath(),r.moveTo(e[0].x,e[0].y),r.lineTo(e[1].x,e[1].y),r.lineTo(e[3].x,e[3].y),r.lineTo(e[2].x,e[2].y),r.closePath(),r.stroke(),r.fillStyle="#ff0000",e.forEach((l,s)=>{r.fillRect(l.x-3,l.y-3,6,6),r.fillStyle="#ffffff",r.font="16px Arial",r.fillText(`${s}`,l.x+5,l.y-5),r.fillStyle="#ff0000";}),r.restore();let a=o.toDataURL("image/png"),i=document.createElement("a");i.href=a,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i);}var la=24,_e=(t,e,n,o)=>{let r=o*Math.PI/180;return [t+n*Math.cos(r),e+n*Math.sin(r)]},Mr=([t,e])=>`${x(t)} ${x(e)}`;function _n(t,e,n,o,r,a){let i=a-r>180?1:0;return `M${Mr(_e(t,e,o,r))}A${x(o)} ${x(o)} 0 ${i} 1 ${Mr(_e(t,e,o,a))}L${Mr(_e(t,e,n,a))}A${x(n)} ${x(n)} 0 ${i} 0 ${Mr(_e(t,e,n,r))}Z`}function Un(t,e,n,o){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function $1(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),e/2}function pl(t){return tt($1(t)<0?[...t].reverse():t)}function Rr(t,e,n,o,r){let a=Math.hypot(n-t,o-e)||1,i=-(o-e)/a*(r/2),l=(n-t)/a*(r/2);return pl([[t+i,e+l],[n+i,o+l],[n-i,o-l],[t-i,e-l]])}var vt=(...t)=>({d:t.join(""),fillRule:"nonzero"}),ae=(...t)=>({d:t.join(""),fillRule:"evenodd"});function S1(){let t=[];for(let e of [0,60,120]){let[n,o]=_e(12,12,10.5,e+180),[r,a]=_e(12,12,10.5,e);t.push(Rr(n,o,r,a,2));}for(let e=0;e<6;e++){let n=e*60,[o,r]=_e(12,12,6.2,n);for(let a of [-45,45]){let[i,l]=_e(o,r,3.6,n+a);t.push(Rr(o,r,i,l,1.7));}}return vt(...t)}var w1={wifi:()=>vt(_n(12,20,4.6,7.2,-135,-45),_n(12,20,9.2,11.8,-135,-45),_n(12,20,13.8,16.4,-135,-45),Y(12,20,2.2)),star:()=>vt(tt(bn(12,12.8,11.6,4.8))),heart:()=>vt(yn(12,12.4,22)),phone:()=>ae(B(6,1.5,12,21,2.6),B(7.8,4.2,8.4,13.4,.6),Y(12,19.8,1.1)),headphones:()=>vt(_n(12,13,7.6,9.8,-180,0),B(2,12,5,9.5,2),B(17,12,5,9.5,2)),calendar:()=>ae(B(2.5,4,19,17.5,2.5),B(4.6,9,14.8,10.6,.8),B(7,11.4,2.6,2.6,.4),B(10.7,11.4,2.6,2.6,.4),B(14.4,11.4,2.6,2.6,.4),B(7,15.1,2.6,2.6,.4),B(10.7,15.1,2.6,2.6,.4),B(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),B(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>vt(Y(12,7.5,4.6),"M3 21.5C3 16.2 7 13.6 12 13.6C17 13.6 21 16.2 21 21.5Z"),chat:()=>ae(B(2,3,20,14,4),tt([[6.5,17],[11.5,17],[5.8,21.8]]),Y(7.5,10,1.5),Y(12,10,1.5),Y(16.5,10,1.5)),bag:()=>vt(B(3.5,7.5,17,14.5,2),_n(12,7.5,3.1,4.8,-180,0)),bell:()=>vt("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",B(1.5,18.2,21,2.6,1.3),B(11.2,6.6,1.6,2.6,0),B(9.8,4.6,4.4,2.4,1.2)),cup:()=>vt("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",_n(17,10.2,1.7,3.6,-90,90),B(2,20.6,17,2,1),B(7,1.6,1.6,3.4,.8),B(11.6,1.6,1.6,3.4,.8)),card:()=>ae(B(1.5,4.5,21,15,2.5),B(1.5,8,21,3,0),B(4.5,13.6,4.6,3.2,.6)),check:()=>ae(Y(12,12,10.5),tt([[6.6,12.4],[8.4,10.6],[10.6,12.8],[15.8,7.6],[17.6,9.4],[10.6,16.4]])),info:()=>ae(Y(12,12,10.5),Y(12,7.2,1.6),B(10.6,10,2.8,8,.8)),home:()=>ae(tt([[12,2.5],[22.5,11.5],[19.5,11.5],[19.5,21.5],[4.5,21.5],[4.5,11.5],[1.5,11.5]]),B(10,14.5,4,7,[.6,.6,0,0])),pin:()=>ae("M12 22.5C8.5 17.6 4.5 14 4.5 9.5A7.5 7.5 0 0 1 19.5 9.5C19.5 14 15.5 17.6 12 22.5Z",Y(12,9.5,3)),share:()=>vt(Rr(6,12,18,5,1.8),Rr(6,12,18,19,1.8),Y(18,5,3.2),Y(6,12,3.2),Y(18,19,3.2)),download:()=>vt(B(10.6,2,2.8,9.5,0),tt([[6,10],[18,10],[12,16.5]]),tt([[2.5,15],[5.3,15],[5.3,19],[18.7,19],[18.7,15],[21.5,15],[21.5,21.8],[2.5,21.8]])),clock:()=>ae(Y(12,12,10.5),Y(12,12,8.4),tt([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:S1,pumpkin:()=>vt(Un(7.8,14.6,5.8,6.9),Un(16.2,14.6,5.8,6.9),Un(12,14.6,4.8,7.4),B(10.9,3.4,2.2,4.6,.8),pl([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>vt(tt([[12,1.5],[16.8,8.2],[7.2,8.2]]),tt([[12,5.2],[19,13.6],[5,13.6]]),tt([[12,9.4],[21.2,19.2],[2.8,19.2]]),B(10.4,18.6,3.2,3.9,.4)),sparkle:()=>vt(tt(bn(9.5,13.5,9,2.4,4)),tt(bn(19,5,4,1.1,4))),gift:()=>vt(B(3,11.2,7.8,10.6,1),B(13.2,11.2,7.8,10.6,1),B(2,7.4,8.8,3.2,1),B(13.2,7.4,8.8,3.2,1),Un(8.8,4.8,2.9,1.9),Un(15.2,4.8,2.9,1.9))};function ca(t){return w1[t]()}function gl(t){return t===" "?.3:/[MWmw@%]/.test(t)?.92:/[A-Z0-9#&]/.test(t)?.72:/[il.,:;!'|1]/.test(t)?.32:.6}function ma(t){let e=0;for(let n of t)e+=gl(n);return Math.max(e,1)}var ua=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function qn(t,e,n){let o=dt(t)??{r:0,g:0,b:0},r=dt(e)??{r:255,g:255,b:255},a=Math.min(1,Math.max(0,n));return `#${ua(o.r+(r.r-o.r)*a)}${ua(o.g+(r.g-o.g)*a)}${ua(o.b+(r.b-o.b)*a)}`}function bl(t,e,n,o,r,a,i,l){let s=[...t],c=r*.08,u=s.map(h=>gl(h)*r),m=u.reduce((h,g)=>h+g,0)+c*Math.max(0,s.length-1),f=a==="top"?o-r*.35:o+r*.35,d=[],p=0;return s.forEach((h,g)=>{let y=u[g],b=(p+y/2)/f;if(p+=y+c,h.trim()==="")return;let _=a==="top"?-Math.PI/2-m/2/f+b:Math.PI/2+m/2/f-b;d.push({text:h,x:e+f*Math.cos(_),y:n+f*Math.sin(_),fontSize:r,maxWidth:r*2,color:i,rotate:_*180/Math.PI+(a==="top"?90:-90),field:l});}),d}var Wn=class extends Error{issues;constructor(e){super(`Invalid frame spec: ${e.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=e;}},yl=new WeakMap;function Hn(t){if(t&&typeof t=="object"){let n=yl.get(t);if(n)return n}if(t==null)throw new Wn(['A "custom" frame needs a spec']);let e=Le.safeParse(t);if(!e.success)throw new Wn(e.error.issues.map(n=>n.path.length>0?`${n.path.join(".")}: ${n.message}`:n.message));return typeof t=="object"&&yl.set(t,e.data),e.data}function da(t){let e=Hn(t);return mn(e)/e.qr.size}var C1=t=>{let e=dt(t);return !!(e&&e.a>=1)};function M1(t,e){let n=wt(e,_t);return C1(n)?{color:n,plate:true}:t.qr.plate==="background"?{color:n,plate:false}:{color:_t,plate:true}}function Er(t,e,n=_t){let o=e.color||t.colors.frame,r=e.secondaryColor||t.colors.accent||o,a=s=>s==="frame"?o:s==="accent"?r:s==="background"?n:s,i=t.colors.text,l=e.textColor||(i===void 0?o:typeof i=="string"?i:qn(a(i.mix[0]),a(i.mix[1]),i.amount));return {frame:o,text:l,accent:r}}function R1(t,e,n){let o=Er(e,t,n),r=a=>{switch(a){case "frame":return o.frame;case "text":return o.text;case "accent":return o.accent;case "background":return n;default:return a}};return a=>typeof a=="string"?r(a):qn(r(a.mix[0]),r(a.mix[1]),a.amount)}function _l(t,e,n=0,o=0){let r=In(t);return r?Ao(r,e,n,o):""}function E1(t,e,n,o){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function A1(t,e){let[n,o,r,a]=[t.x1*e,t.y1*e,t.x2*e,t.y2*e],i=Math.hypot(r-n,a-o),l=t.width*e/2,s=i>0?(r-n)/i:1,c=i>0?(a-o)/i:0,u=-c*l,m=s*l,f=(g,y)=>{let b=[n+s*g,o+c*g],_=[n+s*y,o+c*y];if(t.cap==="round"&&y-g>2*l){let w=[b[0]+s*l,b[1]+c*l],R=[_[0]-s*l,_[1]-c*l];return `M${x(w[0]-u)} ${x(w[1]-m)}L${x(R[0]-u)} ${x(R[1]-m)}A${x(l)} ${x(l)} 0 0 1 ${x(R[0]+u)} ${x(R[1]+m)}L${x(w[0]+u)} ${x(w[1]+m)}A${x(l)} ${x(l)} 0 0 1 ${x(w[0]-u)} ${x(w[1]-m)}Z`}return `M${x(b[0]-u)} ${x(b[1]-m)}L${x(_[0]-u)} ${x(_[1]-m)}L${x(_[0]+u)} ${x(_[1]+m)}L${x(b[0]+u)} ${x(b[1]+m)}Z`};if(!t.dash)return {type:"path",d:f(0,i),fillRule:"nonzero"};let d=t.dash[0]*e,p=d+t.dash[1]*e,h=[];for(let g=0;g+d<=i+1e-6;g+=p)h.push(f(g,g+d));return {type:"path",d:h.join(""),fillRule:"nonzero"}}function P1(t,e){switch(t.type){case "rect":return {type:"rect",x:t.x*e,y:t.y*e,width:t.width*e,height:t.height*e,radius:(t.radius??0)*e,...t.hole&&{hole:{x:t.hole.x*e,y:t.hole.y*e,width:t.hole.width*e,height:t.hole.height*e,radius:(t.hole.radius??0)*e}}};case "circle":return {type:"path",d:Y(t.cx*e,t.cy*e,t.r*e)+(t.hole?Y(t.cx*e,t.cy*e,t.hole*e):""),fillRule:t.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:E1(t.cx*e,t.cy*e,t.rx*e,t.ry*e),fillRule:"nonzero"};case "polygon":return {type:"polygon",points:t.points.map(([n,o])=>[n*e,o*e])};case "path":return {type:"path",d:_l(t.d,e),fillRule:t.fillRule??"nonzero"};case "line":return A1(t,e);default:{let n=ca(t.icon);return {type:"path",d:_l(n.d,t.size*e/la,t.x*e,t.y*e),fillRule:n.fillRule}}}}function v1(t){if(t.type==="rect"){let{x:e,y:n,width:o,height:r,radius:a,hole:i}=t;return [...Xt(e,n,o,r,a,a),...i?Xt(i.x,i.y,i.width,i.height,i.radius,i.radius):[]]}return t.type==="polygon"?[...t.points.map(([e,n],o)=>o===0?{op:"M",x:e,y:n}:{op:"L",x:e,y:n}),{op:"Z"}]:oe(t.d)}function L1(t,e,n){let o=v1(t),r=ur(o,.2),a=t.type==="rect"?t.hole?"evenodd":"nonzero":t.type==="path"?t.fillRule??"nonzero":"nonzero",i=e.direction==="vertical",l=g=>i?g[1]:g[0],s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;for(let g of r)for(let y of g)s=Math.min(s,l(y)),c=Math.max(c,l(y));if(!(c>s))return [];let u=e.steps??32,m=n(e.from),f=n(e.to),d=c-s,p=d*.002,h=[];for(let g=0;g<u;g++){let y=s+d*g/u,b=Math.min(c,s+d*(g+1)/u+(g+1<u?p:0)),_=i?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:y,y1:b}:{x0:y,x1:b,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},w=r.map(R=>rn(R,_)).filter(R=>R.length>2);w.length!==0&&h.push({type:"path",d:os(w),fill:qn(m,f,(g+.5)/u),fillRule:a});}return h}function F1(t,e,n){let o=P1(t,e);return typeof t.fill=="object"&&"gradient"in t.fill?L1(o,t.fill.gradient,n):[{...o,fill:n(t.fill)}]}function I1(t,e){let n=Math.min(t.maxLength??ct.maxTextLength,ct.maxTextLength),o=t.slot==="primary"?e.text??t.text:t.slot==="secondary"?e.secondaryText??t.text:t.text;return un(o,n)}function T1(t){return t===void 0||!Number.isFinite(t)?1:Math.min(Pe,Math.max(lr,t))}function k1(t,e,n,o,r,a){let i=r(t.color),l=t.weight==="regular"?{fontWeight:400}:{};if(t.type==="curved"){let{cx:h,cy:g,radius:y,side:b,spread:_=140}=t.curve,w=y*o*(_*Math.PI/180),R=Math.min(t.fontSize*o*n,w/(ma(e)+.08*e.length));return bl(e,h*o,g*o,y*o,R,b,i,a).map(S=>({...S,...l}))}let s=t.box.x*o,c=t.box.y*o,u=t.box.width*o,m=t.box.height*o;if(!(m>0))return [];let f=(t.fontSize??t.box.height*No)*o,d=Math.min(f*n,m*kn,u/ma(e)),p=t.align??"middle";return [{text:e,x:p==="start"?s:p==="end"?s+u:s+u/2,y:c+m/2+d*.35,fontSize:d,maxWidth:u,color:i,...p!=="middle"&&{align:p},...l,field:a}]}function N1(t){let e=0,n=0,o=0,r=0;return t.map(({command:a,values:i})=>{let l=a.toUpperCase(),s=a!==l;switch(l){case "Z":return e=o,n=r,{command:"Z",values:[]};case "H":return e=(s?e:0)+i[0],{command:"H",values:[e]};case "V":return n=(s?n:0)+i[0],{command:"V",values:[n]};case "A":return e=(s?e:0)+i[5],n=(s?n:0)+i[6],{command:"A",values:[...i.slice(0,5),e,n]};default:{let c=i.map((u,m)=>s?u+(m%2===0?e:n):u);return e=c.at(-2),n=c.at(-1),l==="M"&&(o=e,r=n),{command:l,values:c}}}})}function O1(t,e){let n=In(t);return n?Ao(N1(n).map(({command:o,values:r})=>o==="V"?{command:o,values:[e(r[0])]}:o==="H"||o==="Z"?{command:o,values:r}:o==="A"?{command:o,values:[...r.slice(0,6),e(r[6])]}:{command:o,values:r.map((a,i)=>i%2===1?e(a):a)})):t}function D1(t,e){let n=(o,r)=>{let a=e(o);return {y:a,height:e(o+r)-a}};switch(t.type){case "rect":return {...t,...n(t.y,t.height),...t.hole&&{hole:{...t.hole,...n(t.hole.y,t.hole.height)}}};case "circle":case "ellipse":return {...t,cy:e(t.cy)};case "polygon":return {...t,points:t.points.map(([o,r])=>[o,e(r)])};case "path":return {...t,d:O1(t.d,e)};case "line":return {...t,y1:e(t.y1),y2:e(t.y2)};default:return {...t,y:e(t.y)}}}function B1(t,e){if(e.length===0)return t;let n=r=>{let a=r;for(let i of e)a-=Math.min(Math.max(r-i.y,0),i.height);return a},o=(r,a)=>e.some(i=>r>=i.y-1e-6&&a<=i.y+i.height+1e-6);return {...t,artboard:{...t.artboard,height:n(t.artboard.height)},qr:{...t.qr,y:n(t.qr.y)},shapes:t.shapes.filter(r=>{let{bounds:a}=Oo(r);return !(a&&o(a.y0,a.y1))}).map(r=>D1(r,n)),labels:t.labels.map(r=>{if(r.type==="curved")return {...r,curve:{...r.curve,cy:n(r.curve.cy)}};let a=n(r.box.y);return {...r,box:{...r.box,y:a,height:n(r.box.y+r.box.height)-a}}})}}function fa(t,e,n,o,r={}){let a=new Map(e.labels.map(g=>[g.id,I1(g,n)])),i=B1(e,e.labels.flatMap(g=>g.collapse&&!a.get(g.id)?[g.collapse]:[])),l=t/i.qr.size,s=M1(i,o),c=R1(n,i,s.color),u=i.shapes.flatMap(g=>F1(g,l,c));if(s.plate){let g=mn(i)*l;u.push({type:"rect",x:i.qr.x*l-g,y:i.qr.y*l-g,width:t+2*g,height:t+2*g,radius:(i.qr.radius??0)*l,fill:s.color});}let m=T1(n.fontScale),f=i.labels.flatMap(g=>{let y=a.get(g.id);if(!y)return [];let b=(g.slot==="fixed"?void 0:r[g.slot])??g.id;return k1(g,y,m,l,c,b)}),d=f[0],p=d&&d.rotate===void 0?d:null,h=i.bleed??"none";return {width:i.artboard.width*l,height:i.artboard.height*l,qrX:i.qr.x*l,qrY:i.qr.y*l,qrSize:t,shapes:u,label:p,extraLabels:p?f.slice(1):f,squareEdges:h!=="none",color:c(h==="none"?"frame":h)}}function ha(t,e,n){return fa(t,Hn(e.spec),e,n)}var xl={kind:"qrdx.frame",version:1,artboard:{width:1600,height:1470},qr:{x:300,y:120,size:1e3,padding:70,radius:10,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"polygon",points:[[0,1250],[190,1250],[190,1470],[0,1470],[50.4,1360]],fill:{mix:["frame","#000000"],amount:.28}},{type:"polygon",points:[[1600,1250],[1549.6,1360],[1600,1470],[1410,1470],[1410,1250]],fill:{mix:["frame","#000000"],amount:.28}},{type:"polygon",points:[[90,1420],[170,1470],[90,1470]],fill:{mix:["frame","#000000"],amount:.5}},{type:"polygon",points:[[1510,1420],[1510,1470],[1430,1470]],fill:{mix:["frame","#000000"],amount:.5}},{type:"rect",x:220,y:40,width:1160,height:1160,radius:20,fill:"background"},{type:"rect",x:180,y:0,width:1240,height:1240,radius:60,fill:"frame",hole:{x:220,y:40,width:1160,height:1160,radius:20}},{type:"rect",x:90,y:1200,width:1420,height:220,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:170,y:1200,width:1260,height:220}}]};var pa={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1420},qr:{x:120,y:120,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1420,fill:"frame",hole:{x:40,y:40,width:1160,height:1160}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1200,width:1e3,height:220}}],bleed:"frame"};var $l={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1420},qr:{x:120,y:300,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:220,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1420,fill:"frame",hole:{x:40,y:220,width:1160,height:1160}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}}],bleed:"frame"};var Sl={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1600},qr:{x:120,y:300,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:220,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1600,fill:"frame",hole:{x:40,y:220,width:1160,height:1160}}],labels:[{type:"text",id:"top",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}},{type:"text",id:"bottom",slot:"secondary",text:"",color:"text",box:{x:120,y:1380,width:1e3,height:220}}],bleed:"frame"};var wl={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1340},qr:{x:120,y:120,size:1e3,padding:40,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1260,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1340,fill:"frame",hole:{x:40,y:40,width:1160,height:1260}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1120,width:1e3,height:180},collapse:{y:1200,height:100}}],bleed:"frame"};var Cl={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1530},qr:{x:120,y:120,size:1e3,padding:80,radius:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1400,radius:120,fill:"frame"},{type:"path",d:"M161.2 1380L62 1530Q198.4 1458.5 396.8 1380Z",fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1200,width:1e3,height:200},collapse:{y:1220,height:160}}]};var Ml={kind:"qrdx.frame",version:1,artboard:{width:1978.214,height:1978.214},qr:{x:489.107,y:489.107,size:1e3,padding:50,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"circle",cx:989.107,cy:989.107,r:779.107,fill:"background"},{type:"circle",cx:989.107,cy:989.107,r:989.107,hole:779.107,fill:"frame"},{type:"circle",cx:105,cy:989.107,r:14.7,fill:"text"},{type:"circle",cx:1873.214,cy:989.107,r:14.7,fill:"text"}],labels:[{type:"curved",id:"top",slot:"primary",text:"Scan me",color:"text",curve:{cx:989.107,cy:989.107,radius:884.107,side:"top",spread:140},fontSize:105},{type:"curved",id:"bottom",slot:"secondary",text:"",color:"text",curve:{cx:989.107,cy:989.107,radius:884.107,side:"bottom",spread:140},fontSize:105}]};var Rl={kind:"qrdx.frame",version:1,artboard:{width:1320,height:1558},qr:{x:160,y:130,size:1e3,padding:60},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:370,width:1320,height:1188,fill:{mix:["frame","#FFFFFF"],amount:.45}},{type:"polygon",points:[[0,370],[660,0],[1320,370]],fill:{mix:["frame","#FFFFFF"],amount:.25}},{type:"rect",x:80,y:50,width:1160,height:1268,fill:"background"},{type:"rect",x:68,y:38,width:1184,height:1280,fill:"frame",hole:{x:80,y:50,width:1160,height:1268}},{type:"polygon",points:[[0,1178],[660,1318],[1320,1178],[1320,1558],[0,1558]],fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:160,y:1318,width:1e3,height:220}}]};var El={kind:"qrdx.frame",version:1,artboard:{width:1230,height:1430},qr:{x:115,y:115,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1230,height:1430,fill:"background"},{type:"polygon",points:[[0,0],[200,0],[200,35],[35,35],[35,200],[0,200]],fill:"frame"},{type:"polygon",points:[[1230,0],[1030,0],[1030,35],[1195,35],[1195,200],[1230,200]],fill:"frame"},{type:"polygon",points:[[1230,1230],[1030,1230],[1030,1195],[1195,1195],[1195,1030],[1230,1030]],fill:"frame"},{type:"polygon",points:[[0,1230],[200,1230],[200,1195],[35,1195],[35,1030],[0,1030]],fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:80,y:1210,width:1070,height:200},collapse:{y:1230,height:200}}]};var Ar={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1360},qr:{x:130,y:130,size:1e3,padding:40,plate:"background"},colors:{frame:"#7c3aed",text:{mix:["frame","accent"],amount:.5},accent:"#db2777"},shapes:[{type:"rect",x:50,y:50,width:1160,height:1260,radius:50,fill:"background"},{type:"rect",x:0,y:0,width:1260,height:1360,radius:100,fill:{gradient:{from:"frame",to:"accent",direction:"horizontal",steps:48}},hole:{x:50,y:50,width:1160,height:1260,radius:50}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1130,width:1e3,height:180},collapse:{y:1210,height:100}}]};var Al={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1460},qr:{x:130,y:260,size:1e3,padding:46,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1260,height:1460,radius:30,fill:"background"},{type:"rect",x:0,y:0,width:1260,height:1460,radius:30,fill:"frame",hole:{x:22,y:22,width:1216,height:1416,radius:8}},{type:"rect",x:45,y:45,width:1170,height:1370,fill:"frame",hole:{x:53,y:53,width:1154,height:1354}},{type:"rect",x:378,y:181,width:504,height:8,fill:"frame"},{type:"polygon",points:[[630,163],[652,185],[630,207],[608,185]],fill:"frame"}],labels:[{type:"text",id:"title",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:30,width:1e3,height:170},collapse:{y:84,height:130}},{type:"text",id:"footer",slot:"secondary",text:"",color:"text",box:{x:130,y:1270,width:1e3,height:160},collapse:{y:1306,height:70}}]};var Pl={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1610},qr:{x:130,y:250,size:1e3,padding:75,radius:55},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1260,height:1610,radius:170,fill:"frame"},{type:"rect",x:50,y:170,width:1160,height:1290,radius:60,fill:"background"},{type:"rect",x:520,y:67,width:220,height:36,radius:18,fill:"background"},{type:"rect",x:480,y:1520,width:300,height:30,radius:15,fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1290,width:1e3,height:170},collapse:{y:1330,height:130}}]};var vl={kind:"qrdx.frame",version:1,artboard:{width:1325,height:1555},qr:{x:150,y:150,size:1e3,padding:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:25,y:25,width:1300,height:1530,radius:15,fill:{mix:["frame","#FFFFFF"],amount:.72}},{type:"rect",x:0,y:0,width:1300,height:1530,radius:15,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:150,y:1260,width:1e3,height:240}}]};var Ll={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1340},qr:{x:120,y:120,size:1e3,padding:40,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1260,radius:60,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1340,radius:100,fill:"frame",hole:{x:40,y:40,width:1160,height:1260,radius:60}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1120,width:1e3,height:180},collapse:{y:1200,height:100}}]};var Fl={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1565},qr:{x:120,y:120,size:1e3,padding:70,radius:20,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1160,radius:30,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1240,radius:70,fill:"frame",hole:{x:40,y:40,width:1160,height:1160,radius:30}},{type:"polygon",points:[[540,1385],[620,1265],[700,1385]],fill:"frame"},{type:"rect",x:0,y:1345,width:1240,height:220,radius:110,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1345,width:1e3,height:220}}]};var Il={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1565},qr:{x:120,y:445,size:1e3,padding:70,radius:20,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:0,width:1240,height:220,radius:110,fill:"frame"},{type:"polygon",points:[[540,180],[700,180],[620,300]],fill:"frame"},{type:"rect",x:40,y:365,width:1160,height:1160,radius:30,fill:"background"},{type:"rect",x:0,y:325,width:1240,height:1240,radius:70,fill:"frame",hole:{x:40,y:365,width:1160,height:1160,radius:30}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}}]};var Tl={kind:"qrdx.frame",version:1,artboard:{width:1420,height:1590},qr:{x:195,y:195,size:1e3,padding:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:30,y:30,width:1390,height:1560,radius:155,fill:{mix:["frame","#FFFFFF"],amount:.7}},{type:"rect",x:0,y:0,width:1390,height:1560,radius:155,fill:"#FFFFFF"},{type:"rect",x:25,y:25,width:1340,height:1510,radius:130,fill:"frame"},{type:"rect",x:95,y:95,width:1200,height:1200,radius:40,fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:175,y:1295,width:1040,height:240},collapse:{y:1365,height:170}}]};var kl={kind:"qrdx.frame",version:1,artboard:{width:1280,height:1620},qr:{x:140,y:320,size:1e3,padding:80,radius:20},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"path",d:"M140 0H1140L1280 140V1580A40 40 0 0 1 1240 1620H40A40 40 0 0 1 0 1580V140ZM600 115.2A40 40 0 1 1 680 115.2A40 40 0 1 1 600 115.2Z",fill:"frame",fillRule:"evenodd"},{type:"path",d:"M572 115.2A68 68 0 1 1 708 115.2A68 68 0 1 1 572 115.2ZM600 115.2A40 40 0 1 1 680 115.2A40 40 0 1 1 600 115.2Z",fill:{mix:["frame","#FFFFFF"],amount:.35},fillRule:"evenodd"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:140,y:1400,width:1e3,height:220},collapse:{y:1420,height:160}}]};var Nl={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1490},qr:{x:130,y:130,size:1e3,padding:80,radius:20},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"path",d:"M40 0H1220A40 40 0 0 1 1260 40V1215A55 55 0 0 0 1260 1325V1450A40 40 0 0 1 1220 1490H40A40 40 0 0 1 0 1450V1325A55 55 0 0 0 0 1215V40A40 40 0 0 1 40 0Z",fill:"frame"},{type:"line",x1:77,y1:1270,x2:1147,y2:1270,width:12,dash:[30,22],fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1270,width:1e3,height:220}}]};var St=(t,e,n,o,r)=>({style:t,name:e,tags:r,labelOn:o,spec:n}),ga=[St("banner-bottom","Banner",pa,"frame",["bottom","band"]),St("banner-top","Top banner",$l,"frame",["top","band"]),St("banner-top-bottom","Two banners",Sl,"frame",["top","bottom","band"]),St("border","Border",wl,"background",["square","outline"]),St("rounded-border","Rounded",Ll,"background",["border","outline"]),St("gradient-border","Gradient",Ar,"background",["border","colorful"]),St("focus","Focus",El,"background",["corners","brackets"]),St("speech-bubble","Bubble",Fl,"frame",["speech"]),St("speech-bubble-top","Bubble top",Il,"frame",["speech"]),St("chat-bubble","Chat",Cl,"frame",["message","bubble"]),St("circle","Circle",Ml,"frame",["round","ring","curved"]),St("badge","Ribbon",xl,"frame",["badge","banner"]),St("sticker","Sticker",Tl,"frame",["label"]),St("polaroid","Polaroid",vl,"frame",["photo","picture"]),St("phone","Phone",Pl,"background",["mobile","screen"]),St("ticket","Ticket",Nl,"frame",["event","pass"]),St("tag","Tag",kl,"frame",["price","label"]),St("envelope","Envelope",Rl,"frame",["mail","letter"]),St("menu-card","Menu card",Al,"background",["menu","restaurant"])],ad=new Map(ga.map(t=>[t.style,t]));function ba(t){return ad.get(t)}var id=Object.fromEntries(ga.map(t=>[t.style,t.spec])),sd={from:Ar.colors.frame,to:Ar.colors.accent};function Pr(t){return !t||t.style==="none"?null:t.style===cn?t.spec??null:ba(t.style)?.spec??null}function ld(t){let e=Pr(t);return t&&typeof e?.colors?.frame=="string"?Er(e,t):null}var cd={primary:"text",secondary:"secondaryText"};function Ol(t,e,n){let o=ba(e.style)?.spec??pa;return fa(t,Hn(o),e,n,cd)}var vr="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",Bl=.08,Ql="data-qrdx-frame-label";function kt(t){return !!(t?.style&&t.style!=="none")}function ya(t){let e=Pr(t);return e?da(e):Bl}function ud(t){return (t.text??Ro).trim().slice(0,Vt)}function md(t){return (t.secondaryText??"").trim().slice(0,Vt)}function De(t,e,n){return e.style===cn?ha(t,e,n):Ol(t,e,n)}function ie(t,e){if(!kt(e))return {width:t,height:t};let{width:n,height:o}=De(t,e);return {width:n,height:o}}var ot=t=>J(t,2);function Dl({x:t,y:e,width:n,height:o,radius:r}){let a=ot(Math.min(r,n/2,o/2)),[i,l,s,c]=[ot(t),ot(e),ot(n),ot(o)];return a<=0?P`M${i} ${l}h${s}v${c}h${-s}z`:P`M${i+a} ${l}h${ot(s-2*a)}a${a} ${a} 0 0 1 ${a} ${a}`+P`v${ot(c-2*a)}a${a} ${a} 0 0 1 ${-a} ${a}`+P`h${ot(-(s-2*a))}a${a} ${a} 0 0 1 ${-a} ${-a}`+P`v${ot(-(c-2*a))}a${a} ${a} 0 0 1 ${a} ${-a}z`}function dd(t,e){return t.type==="rect"&&t.hole?E("path",{d:Dl(t)+Dl(t.hole),fill:t.fill,fillRule:"evenodd"},e):t.type==="polygon"?E("polygon",{fill:t.fill,points:t.points.map(([n,o])=>`${ot(n)},${ot(o)}`).join(" ")},e):t.type==="path"?E("path",{d:t.d,fill:t.fill,...t.fillRule==="evenodd"&&{fillRule:"evenodd"}},e):E("rect",{fill:t.fill,height:ot(t.height),width:ot(t.width),x:ot(t.x),y:ot(t.y),...t.radius>0&&{rx:ot(t.radius),ry:ot(t.radius)}},e)}function Lr(t,e){let{size:n,frame:o,bgColor:r,svgProps:a,markLabels:i}=e,l=De(n,o,r),s=Gl(l),c=ot(l.width),u=ot(l.height);return st("svg",{height:u,viewBox:`0 0 ${c} ${u}`,width:c,xmlns:"http://www.w3.org/2000/svg",...a,children:[E("g",{"data-qrdx-frame":o.style,children:l.shapes.map((m,f)=>dd(m,f))}),dn(t,{x:ot(l.qrX),y:ot(l.qrY),width:n,height:n}),s.map((m,f)=>E("text",{"data-max-width":ot(m.maxWidth),fill:m.color,fontFamily:vr,fontSize:ot(m.fontSize),fontWeight:m.fontWeight??700,textAnchor:m.align??"middle",x:ot(m.x),y:ot(m.y),...m.rotate&&{transform:`rotate(${ot(m.rotate)} ${ot(m.x)} ${ot(m.y)})`},...i&&m.field&&{[Ql]:m.field},children:m.text},f))]})}function Gl(t){return [...t.label?[t.label]:[],...t.extraLabels??[]]}var fd={2:6,3:12};function zl(t){let e=[t.start],n=t.start;for(let o of t.segments){let r=o.at(-1);if(o.length===1)e.push(r);else {let a=fd[o.length];for(let i=1;i<=a;i++){let l=i/a,s=1-l;if(o.length===2){let[c]=o;e.push([s*s*n[0]+2*s*l*c[0]+l*l*r[0],s*s*n[1]+2*s*l*c[1]+l*l*r[1]]);}else {let[c,u]=o;e.push([s*s*s*n[0]+3*s*s*l*c[0]+3*s*l*l*u[0]+l*l*l*r[0],s*s*s*n[1]+3*s*s*l*c[1]+3*s*l*l*u[1]+l*l*l*r[1]]);}}}n=r;}return e}function ql(t,e){let n=[];for(let o of t)for(let r=0;r<o.length;r++){let[a,i]=o[r],[l,s]=o[(r+1)%o.length];i<=e!=s<=e&&n.push(a+(e-i)/(s-i)*(l-a));}return n.sort((o,r)=>o-r)}function Wl(t,e){let n=0;for(let o of t)if(o<e)n++;else break;return n%2===1}function hd(t,e,n){return Wl(ql(t,n),e)}function Hl(t){let e=new Map;return (n,o)=>{let r=e.get(o);return r||(r=ql(t,o),e.set(o,r)),Wl(r,n)}}function pd(t,e,n,o){let r=n[0]-t,a=n[1]-e,i=o[0]-n[0],l=o[1]-n[1],s=u=>Math.max(Math.abs(r+u*i),Math.abs(a+u*l)),c=Math.min(s(0),s(1));for(let[u,m]of [[a-r,i-l],[-(r+a),i+l]])if(m!==0){let f=u/m;f>0&&f<1&&(c=Math.min(c,s(f)));}return c}function gd(t,e,n){if(!hd(t,e,n))return 0;let o=Number.POSITIVE_INFINITY;for(let r of t)for(let a=0;a<r.length;a++)o=Math.min(o,pd(e,n,r[a],r[(a+1)%r.length]));return Number.isFinite(o)?o:0}function bd(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let a of t)for(let[i,l]of a)e=Math.min(e,i),n=Math.min(n,l),o=Math.max(o,i),r=Math.max(r,l);return {x0:e,y0:n,x1:o,y1:r}}function Vl(t){let e=t.map(zl),n=bd(e),o=n.x1-n.x0,r=n.y1-n.y0;if(!(o>0&&r>0))return null;let a=(p,h)=>{let g=Math.max(p-n.x0,n.x1-p,h-n.y0,n.y1-h);return g>0?gd(e,p,h)/(2*g):0},i={cx:n.x0+o/2,cy:n.y0+r/2,value:0};i.value=a(i.cx,i.cy);let l=32;for(let p=1;p<l;p++)for(let h=1;h<l;h++){let g=n.x0+o*h/l,y=n.y0+r*p/l,b=a(g,y);b>i.value&&(i={cx:g,cy:y,value:b});}let s=o/l,c=r/l;for(let p=0;p<6;p++){let h=i;for(let g=-2;g<=2;g++)for(let y=-2;y<=2;y++){let b=h.cx+s*y/2,_=h.cy+c*g/2,w=a(b,_);w>i.value&&(i={cx:b,cy:_,value:w});}s/=2,c/=2;}if(i.value<=0)return null;let m=.5/Math.max(i.cx-n.x0,n.x1-i.cx,i.cy-n.y0,n.y1-i.cy),f=([p,h])=>[.5+(p-i.cx)*m,.5+(h-i.cy)*m],d=t.map(p=>({start:f(p.start),segments:p.segments.map(h=>h.map(f))}));return {rings:d,polygons:d.map(zl),half:i.value}}function jl(t,e){let n=([r,a])=>`${x(r*e)} ${x(a*e)}`,o="";for(let r of t.rings){o+=`M${n(r.start)}`;for(let a of r.segments){let i=a.length===1?"L":a.length===2?"Q":"C";o+=i+a.map(n).join(" ");}o+="Z";}return o}var yd={start:[0,-0.58],segments:[[[.2,-0.92],[1,-0.97],[1,-0.3]],[[1,.3],[.62,.6],[0,.92]],[[-0.62,.6],[-1,.3],[-1,-0.3]],[[-1,-0.97],[-0.2,-0.92],[0,-0.58]]]},Ul;function Zl(){return Ul??=Vl([yd]),Ul}function _d(t){let{width:e,height:n,cells:o}=t;return Number.isInteger(e)&&Number.isInteger(n)&&e>=Yt&&n>=Yt&&e<=Qt&&n<=Qt&&typeof o=="string"&&o.length===e*n&&/^[01]*$/.test(o)?(r,a)=>r>=0&&a>=0&&r<e&&a<n&&o[a*e+r]==="1":null}var se=([t,e])=>`${t},${e}`;function xd(t,e,n){let o=(s,c)=>t(s-1,c-1),r=new Map,a=(s,c)=>{for(let[u,m]of [[s,c],[c,s]]){let f=r.get(se(u))??[];f.push(m),r.set(se(u),f);}};for(let s=0;s<=n;s++)for(let c=0;c<=e;c++){let u=o(c,s),m=o(c+1,s),f=o(c+1,s+1),d=o(c,s+1),p=[c,s-.5],h=[c+.5,s],g=[c,s+.5],y=[c-.5,s];switch((u?8:0)+(m?4:0)+(f?2:0)+(d?1:0)){case 1:case 14:a(y,g);break;case 2:case 13:a(g,h);break;case 3:case 12:a(y,h);break;case 4:case 11:a(p,h);break;case 6:case 9:a(p,g);break;case 7:case 8:a(y,p);break;case 5:a(p,h),a(y,g);break;case 10:a(y,p),a(g,h);break;}}let i=[],l=new Set;for(let[s,c]of r){if(l.has(s)||c.length===0)continue;let[u,m]=s.split(",").map(Number),f=[[u,m]];l.add(s);let d=[u,m],p=c[0];for(;!l.has(se(p));){l.add(se(p)),f.push(p);let h=$d(r.get(se(p))??[],d,l);if(!h)break;d=p,p=h;}f.length>=3&&i.push(Sd(f));}return i}function $d(t,e,n){let o=se(e);return t.find(r=>se(r)!==o&&!n.has(se(r)))??t.find(r=>se(r)!==o)}function Sd(t){let e=[];for(let n=0;n<t.length;n++){let o=t[(n-1+t.length)%t.length],r=t[n],a=t[(n+1)%t.length],i=(r[0]-o[0])*(a[1]-r[1])-(r[1]-o[1])*(a[0]-r[0]);Math.abs(i)>1e-9&&e.push(r);}return e.length>=3?e:t}function wd(t){let e=(a,i)=>[(a[0]+i[0])/2,(a[1]+i[1])/2],n=t.length,o=e(t[n-1],t[0]),r=t.map((a,i)=>[a,e(a,t[(i+1)%n])]);return {start:o,segments:r}}var Vn=new Map;function _a(t){let e=`${t.width}x${t.height}:${t.cells}`,n=Vn.get(e);if(n)return n;let o=_d(t),r;if(!o)r={outline:null,problem:"invalid"};else if(t.cells.includes("1")){let a=xd(o,t.width,t.height),i=a.length>0?Vl(a.map(wd)):null;r=i&&2*i.half>=qo?{outline:i,problem:null}:{outline:null,problem:i?"thin":"empty"};}else r={outline:null,problem:"empty"};return Vn.size>16&&Vn.delete(Vn.keys().next().value),Vn.set(e,r),r}var Cd=1,Xl=.5,Yl=.5,Md=.5;function Be(t){return Math.max(t,Uo)}function Fr(t){return t==="heart"?Zl():typeof t=="object"&&t?.type==="silhouette"?_a(t).outline:null}function xa(t){return t==="circle"||Fr(t)!==null}var Rd={invalid:"This silhouette isn't a valid shape grid.",empty:"No shape found: use a picture with a dark or opaque shape on a light or clear background.",thin:"This shape is too thin to hold the code with its quiet zone. Try a rounder, fuller shape."};function Ed(t){let{outline:e,problem:n}=_a(t);if(e&&!n)return {ok:true,share:2*e.half};let o=n??"invalid";return {ok:false,reason:o,message:Rd[o]}}function Lt(t,e,n){if(n==="circle"){let i=Be(e),l=(t/2+i)*Math.SQRT2+Cd;return Math.ceil(l-t/2)}let o=Fr(n);if(!o)return e;let r=Be(e),a=(t+2*(r+Md))/(2*o.half);return Math.ceil((a-t)/2-1e-9)}function Kl(t){let e=t>>>0;return ()=>{e=e+1831565813>>>0;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function Ad(t,e,n){let o=Lt(e,n,"circle"),r=Be(n),a=e+2*o,i=a/2,l=i-Xl-.5,s=Kl(Number.parseInt(Oe(t),36)||1),c=o-r,u=o+e+r;return Array.from({length:a},(m,f)=>Array.from({length:a},(d,p)=>{let h=s()<Yl;return p>=c&&p<u&&f>=c&&f<u?false:h&&Math.hypot(p+.5-i,f+.5-i)<=l}))}var Pd=Array.from({length:8},(t,e)=>{let n=e*Math.PI/4;return [Math.cos(n),Math.sin(n)]});function Jl(t,e,n,o){if(o==="circle")return Ad(t,e,n);let r=Fr(o);if(!r)return null;let a=Lt(e,n,o),i=Be(n),l=e+2*a,s=Hl(r.polygons),c=.5+Xl,u=(p,h)=>{let g=p+.5,y=h+.5;return s(g/l,y/l)?Pd.every(([b,_])=>s((g+b*c)/l,(y+_*c)/l)):false},m=Kl(Number.parseInt(Oe(t),36)||1),f=a-i,d=a+e+i;return Array.from({length:l},(p,h)=>Array.from({length:l},(g,y)=>{let b=m()<Yl;return y>=f&&y<d&&h>=f&&h<d?false:b&&u(y,h)}))}function $a(t,e){if(t==="circle")return {circle:e/2};let n=Fr(t);return n?{path:jl(n,e)}:null}function vd(t,e){let n=$a(t,e);return n?"circle"in n?Y(e/2,e/2,n.circle):n.path:null}function Ld(t){return t==="top-left"?0:t==="top-right"?1:3}function Ir(t,e,n,o="circle",r="top-left"){let a=n*2,i=n,l=a/3;switch(o){case "leaf":case "leaf-reverse":case "drop":case "drop-reverse":{let s=Ld(r),c=(s+2)%4,u=1.3*l,m=.7*l,f=p=>{switch(o){case "leaf":return p===s||p===c;case "leaf-reverse":return !(p===s||p===c);case "drop":return p===s;default:return p===c}},d=[0,1,2,3].map(p=>f(p)?m:u);return E("path",{d:B(t-n,e-n,a,a,d)})}case "extra-rounded":return E("path",{d:B(t-n,e-n,a,a,1.15*l)});case "plus":{let s=1.15*l,c=n;return E("path",{d:tt([[t-s,e-c],[t+s,e-c],[t+s,e-s],[t+c,e-s],[t+c,e+s],[t+s,e+s],[t+s,e+c],[t-s,e+c],[t-s,e+s],[t-c,e+s],[t-c,e-s],[t-s,e-s]])})}case "cross-rounded":{let s=1.15*l,c=.5*l;return E("path",{d:B(t-n,e-s,a,2*s,c)+B(t-s,e-n,2*s,a,c)})}case "hexagon":return E("path",{d:tt(gn(t,e,1.72*l,6))});case "octagon":return E("path",{d:tt(gn(t,e,n/Math.cos(Math.PI/8),8,22.5))});case "flower":{let s=.6*l,c=.9*l;return E("path",{d:Y(t-s,e-s,c)+Y(t+s,e-s,c)+Y(t+s,e+s,c)+Y(t-s,e+s,c)+Y(t,e,1.2*l)})}case "heart":return E("path",{d:yn(t,e+.12*l,3.5*l)});case "squircle":return E("path",{d:tt(zn(t,e,n,n,4,64))});case "dots":{let s=[];for(let c of [-1,0,1])for(let u of [-1,0,1])s.push(Y(t+u*l*.82,e+c*l*.82,.58*l));return E("path",{d:s.join("")})}case "square":return E("rect",{height:x(a),transform:P`rotate(0,${t},${e})`,width:x(a),x:x(t-i),y:x(e-i)});case "rounded":return E("rect",{height:x(a),rx:x(n*.5),ry:x(n*.5),transform:P`rotate(0,${t},${e})`,width:x(a),x:x(t-i),y:x(e-i)});case "diamond":return E("path",{d:P`M ${t-i*.714286} ${e-i*.714286}v ${a*.714286}h ${a*.714286}v -${a*.714286}z`,transform:P`rotate(45,${t},${e})`});case "message":{let s=a/30,c=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=P`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}`;return E("path",{clipRule:"evenodd",d:m,transform:P`rotate(0,${t},${e})`})}case "message-reverse":{let s=a/30,c=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=P`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}`;return E("path",{clipRule:"evenodd",d:m,transform:P`rotate(-180,${t},${e})`})}case "diya":{let s=a/30,c=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=P`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}H ${c(25)}z`;return E("path",{clipRule:"evenodd",d:m,transform:P`rotate(0,${t},${e})`})}case "diya-reverse":{let s=a/30,c=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=P`M ${c(25)} ${u(35.714285714285715)}v ${19.285714285714285*s}h ${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} -${10.714285714285714*s}v -${19.285714285714285*s}h -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}z`;return E("path",{clipRule:"evenodd",d:m,transform:P`rotate(0,${t},${e})`})}case "rounded-triangle":{let s=a/21,c=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=P`M ${c(33.57142857142857)} ${u(29.285714285714285)}h ${12.857142857142856*s}c ${4.285714285714286*s} 0 ${4.285714285714286*s} ${4.285714285714286*s} ${4.285714285714286*s} ${4.285714285714286*s}v ${12.857142857142856*s}c 0 ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s}h -${12.857142857142856*s}c -${4.285714285714286*s} 0 -${4.285714285714286*s} -${4.285714285714286*s} -${4.285714285714286*s} -${4.285714285714286*s}v -${12.857142857142856*s}c 0 -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s}z`;return E("path",{d:m,transform:P`rotate(45,${t},${e})`})}case "star":{let s=a/27,c=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=P`M ${c(38.84615384615385)},${u(26.546153846153846)}c${.6692307692307691*s},-${1.0153846153846153*s},${2.215384615384615*s},-${1.0153846153846153*s},${2.884615384615384*s},0l${4.038461538461538*s},${6.069230769230768*s}c${.23076923076923075*s},${.3461538461538461*s},${.6*s},${.6*s},${1.0153846153846153*s},${.7153846153846153*s}l${7.223076923076922*s},${1.823076923076923*s}c${1.2*s},${.3*s},${1.6846153846153844*s},${1.7076923076923076*s},${.8999999999999999*s},${2.6538461538461533*s}l-${4.73076923076923*s},${5.584615384615384*s}c-${.2769230769230769*s},${.3230769230769231*s},-${.41538461538461535*s},${.7384615384615384*s},-${.3923076923076923*s},${1.1307692307692307*s}l${.4384615384615384*s},${7.199999999999999*s}c${.06923076923076922*s},${1.2*s},-${1.1769230769230767*s},${2.0769230769230766*s},-${2.3307692307692305*s},${1.6384615384615382*s}l-${6.9692307692307685*s},-${2.6076923076923073*s}c-${.3923076923076923*s},-${.16153846153846155*s},-${.8538461538461538*s},-${.16153846153846155*s},-${1.2461538461538462*s},0l-${6.9692307692307685*s},${2.6076923076923073*s}c-${1.1538461538461537*s},${.4384615384615384*s},-${2.4*s},-${.4384615384615384*s},-${2.3307692307692305*s},-${1.6384615384615382*s}l${.4384615384615384*s},-${7.199999999999999*s}c${.023076923076923075*s},-${.41538461538461535*s},-${.11538461538461538*s},-${.8307692307692307*s},-${.3923076923076923*s},-${1.1307692307692307*s}l-${4.73076923076923*s},-${5.584615384615384*s}c-${.7846153846153846*s},-${.923076923076923*s},-${.3230769230769231*s},-${2.3307692307692305*s},${.8999999999999999*s},-${2.6538461538461533*s}l${7.223076923076922*s},-${1.823076923076923*s}c${.41538461538461535*s},-${.11538461538461538*s},${.7846153846153846*s},-${.3461538461538461*s},${1.0153846153846153*s},-${.7153846153846153*s}l${4.038461538461538*s},-${6.069230769230768*s}z`;return E("path",{clipRule:"evenodd",d:m,transform:P`rotate(0,${t},${e})`})}case "banner":{let s=a/28;return E("g",{transform:P`translate(${t-40*s},${e-40*s}) scale(${x(s,6)})`,children:E("path",{clipRule:"evenodd",d:"M38.235 26.104C38.759 25.677, 39.51 25.677, 40.034 26.104L41.776 27.52C42.091 27.777, 42.501 27.887, 42.902 27.822L45.118 27.466C45.785 27.359, 46.436 27.735, 46.677 28.366L47.477 30.464C47.621 30.843, 47.921 31.143, 48.301 31.288L50.399 32.088C51.03 32.328, 51.406 32.979, 51.298 33.646L50.942 35.863C50.878 36.264, 50.988 36.674, 51.244 36.989L52.661 38.73C53.087 39.254, 53.087 40.006, 52.661 40.53L51.244 42.271C50.988 42.587, 50.878 42.996, 50.942 43.397L51.298 45.614C51.406 46.281, 51.03 46.932, 50.399 47.173L48.301 47.972C47.921 48.117, 47.621 48.417, 47.477 48.797L46.677 50.894C46.436 51.526, 45.785 51.901, 45.118 51.794L42.902 51.438C42.501 51.374, 42.091 51.483, 41.776 51.74L40.034 53.157C39.51 53.583, 38.759 53.583, 38.235 53.157L36.493 51.74C36.178 51.483, 35.768 51.374, 35.367 51.438L33.15 51.794C32.483 51.901, 31.833 51.526, 31.592 50.894L30.792 48.797C30.647 48.417, 30.347 48.117, 29.968 47.972L27.87 47.173C27.239 46.932, 26.863 46.281, 26.97 45.614L27.326 43.397C27.391 42.996, 27.281 42.587, 27.025 42.271L25.608 40.53C25.182 40.006, 25.182 39.254, 25.608 38.73L27.025 36.989C27.281 36.674, 27.391 36.264, 27.326 35.863L26.97 33.646C26.863 32.979, 27.239 32.328, 27.87 32.088L29.968 31.288C30.347 31.143, 30.647 30.843, 30.792 30.464L31.592 28.366C31.833 27.735, 32.483 27.359, 33.15 27.466L35.367 27.822C35.768 27.887, 36.178 27.777, 36.493 27.52L38.235 26.104Z"})})}default:return E("circle",{cx:x(t),cy:x(e),r:x(n),transform:P`rotate(0,${t},${e})`})}}function xn(t,e,n,o){let r=t==="top-left"?0:t==="top-right"?1:3,a=(r+2)%4;return [0,1,2,3].map(i=>i===r||o&&i===a?n:e)}function tc(t,e,n,o){return [[t+o,e],[t+n-o,e],[t+n,e+o],[t+n,e+n-o],[t+n-o,e+n],[t+o,e+n],[t,e+n-o],[t,e+o]]}function ec(t,e,n,o){let r=n/7,a=Math.max(0,(o+Math.SQRT2-2)*r);return tt(tc(t,e,n,o*r))+tt(tc(t+r,e+r,5*r,a))}function nc(t,e,n,o,r=false){let a=n/7,i=l=>r?xn(o,0,l,true):xn(o,l,0,true);return B(t,e,n,n,i(2.5*a))+B(t+a,e+a,5*a,5*a,i(1.5*a))}function Fd(t,e,n,o){let r=n/7;return B(t,e,n,n,xn(o,2.6*r,0,false))+B(t+r,e+r,5*r,5*r,xn(o,1.6*r,0,false))}function Id(t,e,n){let o=n/7,r=t+n/2,a=e+n/2;return tt(zn(r,a,3.5*o,3.5*o,4,96))+tt(zn(r,a,2.5*o,2.5*o,4,96))}function rc(t,e,n,o,r){let a=o,i=n/2,l=(i-a)*.55,s=(c,u)=>P`${t+c} ${e+u}`;return P`M${s(a,0)}`+P`C${s(a+l,0)} ${s(i-l,r)} ${s(i,r)}`+P`C${s(i+l,r)} ${s(n-a-l,0)} ${s(n-a,0)}`+P`A${a} ${a} 0 0 1 ${s(n,a)}`+P`C${s(n,a+l)} ${s(n-r,i-l)} ${s(n-r,i)}`+P`C${s(n-r,i+l)} ${s(n,n-a-l)} ${s(n,n-a)}`+P`A${a} ${a} 0 0 1 ${s(n-a,n)}`+P`C${s(n-a-l,n)} ${s(i+l,n-r)} ${s(i,n-r)}`+P`C${s(i-l,n-r)} ${s(a+l,n)} ${s(a,n)}`+P`A${a} ${a} 0 0 1 ${s(0,n-a)}`+P`C${s(0,n-a-l)} ${s(r,i+l)} ${s(r,i)}`+P`C${s(r,i-l)} ${s(0,a+l)} ${s(0,a)}`+P`A${a} ${a} 0 0 1 ${s(a,0)}Z`}function Td(t,e,n){let o=n/7,r=.12*o;return rc(t,e,n,1.4*o,r)+rc(t+o,e+o,5*o,.7*o,r)}function oc(t,e,n,o,r,a){let i=n/2,l=(s,c)=>P`${t+s} ${e+c}`;return P`M${l(o,0)}H${t+n-o}`+P`A${o} ${o} 0 0 1 ${l(n,o)}`+P`V${e+r}`+P`C${l(n,r+1.55*a)} ${l(i+1.6*a,n)} ${l(i,n)}`+P`C${l(i-1.6*a,n)} ${l(0,r+1.55*a)} ${l(0,r)}`+P`V${e+o}A${o} ${o} 0 0 1 ${l(o,0)}Z`}function kd(t,e,n){let o=n/7;return oc(t,e,n,.7*o,3.9*o,o)+oc(t+o,e+o,5*o,.35*o,2.7*o,.8*o)}function Nd(t,e,n,o){let r=n/7;return B(t,e,n,n,xn(o,.5*r,2.5*r,false))+B(t+r,e+r,5*r,5*r,xn(o,.25*r,1.5*r,false))}function Od(t,e,n){let o=n/7;return P`M ${t} ${e}v ${n}h ${n}v -${n}z`+P`M ${t+o} ${e+o}h ${5*o}v ${5*o}h -${5*o}z`}function Dd(t,e,n){let o=n/7,r=o*.875,a=o*.4375,i=P`M ${t+r} ${e}`+P`h ${n-2*r}`+P`a ${r} ${r} 0 0 1 ${r} ${r}`+P`v ${n-2*r}`+P`a ${r} ${r} 0 0 1 ${-r} ${r}`+P`h ${-(n-2*r)}`+P`a ${r} ${r} 0 0 1 ${-r} ${-r}`+P`v ${-(n-2*r)}`+P`a ${r} ${r} 0 0 1 ${r} ${-r}z`,l=P`M ${t+o+a} ${e+o}`+P`h ${5*o-2*a}`+P`a ${a} ${a} 0 0 1 ${a} ${a}`+P`v ${5*o-2*a}`+P`a ${a} ${a} 0 0 1 ${-a} ${a}`+P`h ${-(5*o-2*a)}`+P`a ${a} ${a} 0 0 1 ${-a} ${-a}`+P`v ${-(5*o-2*a)}`+P`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+l}function Bd(t,e,n){let o=t+n/2,r=e+n/2,a=J(n/2),i=J(n*(2.5/7));return P`M ${o-a} ${r}`+P`a ${a} ${a} 0 1 0 ${a*2} 0`+P`a ${a} ${a} 0 1 0 ${-a*2} 0z`+P`M ${o-i} ${r}`+P`a ${i} ${i} 0 1 1 ${i*2} 0`+P`a ${i} ${i} 0 1 1 ${-i*2} 0z`}function Qd(t,e,n){let o=n/74.7002,r=l=>l*o+t,a=l=>l*o+e;return P`M${r(37.3496)} ${a(0)}C${r(39.2939)} ${a(0)} ${r(40.9948)} ${a(1.03842)} ${r(41.9287)} ${a(2.59082)}C${r(43.2293)} ${a(1.34013)} ${r(45.1347)} ${a(.780267)} ${r(47.0098)} ${a(1.28027)}C${r(48.8871)} ${a(1.78928)} ${r(50.261)} ${a(3.23767)} ${r(50.7578)} ${a(4.98438)}C${r(52.3454)} ${a(4.0996)} ${r(54.3432)} ${a(4.047)} ${r(56.0303)} ${a(5.01953)}C${r(57.7094)} ${a(5.98752)} ${r(58.6586)} ${a(7.73647)} ${r(58.6924)} ${a(9.5459)}C${r(60.4517)} ${a(9.10661)} ${r(62.3883)} ${a(9.57215)} ${r(63.7598)} ${a(10.9502)}C${r(65.1282)} ${a(12.3253)} ${r(65.5963)} ${a(14.2585)} ${r(65.1641)} ${a(16.0127)}C${r(66.974)} ${a(16.044)} ${r(68.7242)} ${a(16.9982)} ${r(69.7002)} ${a(18.6797)}C${r(70.6781)} ${a(20.3647)} ${r(70.6241)} ${a(22.3635)} ${r(69.7402)} ${a(23.9502)}C${r(71.4776)} ${a(24.4496)} ${r(72.9194)} ${a(25.8232)} ${r(73.4199)} ${a(27.7002)}C${r(73.927)} ${a(29.5707)} ${r(73.3661)} ${a(31.4794)} ${r(72.1104)} ${a(32.7822)}C${r(73.6621)} ${a(33.7163)} ${r(74.7002)} ${a(35.4166)} ${r(74.7002)} ${a(37.3604)}C${r(74.7001)} ${a(39.307)} ${r(73.6582)} ${a(41.0084)} ${r(72.1025)} ${a(41.9414)}C${r(73.357)} ${a(43.245)} ${r(73.9207)} ${a(45.1525)} ${r(73.4199)} ${a(47.0303)}C${r(72.9187)} ${a(48.9027)} ${r(71.4782)} ${a(50.2735)} ${r(69.7383)} ${a(50.7734)}C${r(70.6201)} ${a(52.3601)} ${r(70.6716)} ${a(54.3549)} ${r(69.7002)} ${a(56.04)}C${r(68.7237)} ${a(57.7225)} ${r(66.9721)} ${a(58.6729)} ${r(65.1611)} ${a(58.7031)}C${r(65.598)} ${a(60.4623)} ${r(65.131)} ${a(62.3982)} ${r(63.7598)} ${a(63.7695)}C${r(62.3847)} ${a(65.138)} ${r(60.4515)} ${a(65.6061)} ${r(58.6973)} ${a(65.1738)}C${r(58.6635)} ${a(66.9833)} ${r(57.7094)} ${a(68.7322)} ${r(56.0303)} ${a(69.7002)}C${r(54.3461)} ${a(70.6777)} ${r(52.348)} ${a(70.6248)} ${r(50.7617)} ${a(69.7422)}C${r(50.2643)} ${a(71.4831)} ${r(48.8896)} ${a(72.9284)} ${r(47.0098)} ${a(73.4297)}C${r(45.1389)} ${a(73.9368)} ${r(43.2296)} ${a(73.3763)} ${r(41.9268)} ${a(72.1201)}C${r(40.9927)} ${a(73.6717)} ${r(39.2932)} ${a(74.71)} ${r(37.3496)} ${a(74.71)}C${r(35.4051)} ${a(74.7098)} ${r(33.7042)} ${a(73.6711)} ${r(32.7705)} ${a(72.1182)}C${r(31.4697)} ${a(73.3758)} ${r(29.5597)} ${a(73.9418)} ${r(27.6797)} ${a(73.4404)}V${a(73.4502)}C${r(25.8065)} ${a(72.9422)} ${r(24.434)} ${a(71.4985)} ${r(23.9346)} ${a(69.7568)}C${r(22.3504)} ${a(70.6301)} ${r(20.3591)} ${a(70.6781)} ${r(18.6797)} ${a(69.71)}C${r(16.9957)} ${a(68.7391)} ${r(16.045)} ${a(66.9831)} ${r(16.0166)} ${a(65.168)}C${r(14.2547)} ${a(65.6091)} ${r(12.3134)} ${a(65.1435)} ${r(10.9395)} ${a(63.7695)}C${r(9.5687)} ${a(62.3919)} ${r(9.10168)} ${a(60.454)} ${r(9.53809)} ${a(58.6973)}C${r(7.72791)} ${a(58.6641)} ${r(5.97815)} ${a(57.71)} ${r(5.00977)} ${a(56.0303)}C${r(4.03552)} ${a(54.3517)} ${r(4.08377)} ${a(52.3649)} ${r(4.95801)} ${a(50.7812)}C${r(3.21705)} ${a(50.2839)} ${r(1.77087)} ${a(48.9101)} ${r(1.26953)} ${a(47.0303)}V${a(47.0205)}C${r(.762081)} ${a(45.1489)} ${r(1.32758)} ${a(43.2375)} ${r(2.58496)} ${a(41.9346)}C${r(1.03604)} ${a(41)} ${r(108484e-9)} ${a(39.3019)} ${r(0)} ${a(37.3604)}C${r(0)} ${a(35.4159)} ${r(1.03815)} ${a(33.7141)} ${r(2.59082)} ${a(32.7803)}C${r(1.34044)} ${a(31.4797)} ${r(.780389)} ${a(29.575)} ${r(1.28027)} ${a(27.7002)}C${r(1.78258)} ${a(25.8232)} ${r(3.22806)} ${a(24.4482)} ${r(4.97363)} ${a(23.9512)}C${r(4.08938)} ${a(22.3638)} ${r(4.03743)} ${a(20.3664)} ${r(5.00977)} ${a(18.6797)}C${r(5.97815)} ${a(16.9999)} ${r(7.72788)} ${a(16.0496)} ${r(9.53809)} ${a(16.0166)}C${r(9.10139)} ${a(14.2576)} ${r(9.56846)} ${a(12.3214)} ${r(10.9395)} ${a(10.9502)}C${r(12.3171)} ${a(9.57911)} ${r(14.2558)} ${a(9.11137)} ${r(16.0127)} ${a(9.54785)}C${r(16.0426)} ${a(7.73421)} ${r(16.9969)} ${a(5.97989)} ${r(18.6797)} ${a(5.00977)}C${r(20.3596)} ${a(4.03474)} ${r(22.3521)} ${a(4.08468)} ${r(23.9365)} ${a(4.96094)}C${r(24.4378)} ${a(3.22749)} ${r(25.8059)} ${a(1.7898)} ${r(27.6797)} ${a(1.29004)}C${r(29.5511)} ${a(.78264)} ${r(31.4617)} ${a(1.34357)} ${r(32.7646)} ${a(2.60059)}C${r(33.6971)} ${a(1.04268)} ${r(35.4013)} ${a(152405e-9)} ${r(37.3496)} ${a(0)}ZM${r(41.0615)} ${a(9.17578)}C${r(40.1006)} ${a(10.1057)} ${r(38.793)} ${a(10.6797)} ${r(37.3496)} ${a(10.6797)}C${r(35.9064)} ${a(10.6796)} ${r(34.5985)} ${a(10.1066)} ${r(33.6377)} ${a(9.17676)}C${r(32.9511)} ${a(10.3241)} ${r(31.8358)} ${a(11.2176)} ${r(30.4404)} ${a(11.5898)}C${r(29.0527)} ${a(11.9661)} ${r(27.6436)} ${a(11.7542)} ${r(26.4766)} ${a(11.1074)}C${r(26.1072)} ${a(12.3879)} ${r(25.2629)} ${a(13.5333)} ${r(24.0195)} ${a(14.25)}C${r(22.7695)} ${a(14.9754)} ${r(21.347)} ${a(15.1322)} ${r(20.0479)} ${a(14.8047)}C${r(20.0289)} ${a(16.1454)} ${r(19.5108)} ${a(17.4793)} ${r(18.4902)} ${a(18.5)}C${r(17.4696)} ${a(19.5158)} ${r(16.1409)} ${a(20.033)} ${r(14.8066)} ${a(20.0566)}C${r(15.1312)} ${a(21.3534)} ${r(14.9738)} ${a(22.7723)} ${r(14.25)} ${a(24.0195)}C${r(13.5243)} ${a(25.2699)} ${r(12.3701)} ${a(26.1148)} ${r(11.082)} ${a(26.4795)}C${r(11.7347)} ${a(27.6479)} ${r(11.9529)} ${a(29.062)} ${r(11.5801)} ${a(30.46)}C${r(11.2085)} ${a(31.8485)} ${r(10.3194)} ${a(32.9607)} ${r(9.17578)} ${a(33.6475)}C${r(10.106)} ${a(34.6084)} ${r(10.6797)} ${a(35.9167)} ${r(10.6797)} ${a(37.3604)}C${r(10.6796)} ${a(38.805)} ${r(10.1053)} ${a(40.1141)} ${r(9.17383)} ${a(41.0752)}C${r(10.3132)} ${a(41.7614)} ${r(11.1999)} ${a(42.871)} ${r(11.5703)} ${a(44.2598)}C${r(11.946)} ${a(45.6504)} ${r(11.7335)} ${a(47.0592)} ${r(11.0889)} ${a(48.2266)}C${r(12.377)} ${a(48.593)} ${r(13.5297)} ${a(49.441)} ${r(14.25)} ${a(50.6904)}C${r(14.9754)} ${a(51.9405)} ${r(15.1322)} ${a(53.3629)} ${r(14.8047)} ${a(54.6621)}C${r(16.142)} ${a(54.6835)} ${r(17.4721)} ${a(55.2016)} ${r(18.4902)} ${a(56.2197)}C${r(19.5097)} ${a(57.2441)} ${r(20.0278)} ${a(58.5787)} ${r(20.0479)} ${a(59.918)}C${r(21.3469)} ${a(59.5917)} ${r(22.7696)} ${a(59.7493)} ${r(24.0195)} ${a(60.4697)}C${r(25.2676)} ${a(61.1892)} ${r(26.1117)} ${a(62.3406)} ${r(26.4775)} ${a(63.627)}C${r(27.6424)} ${a(62.9822)} ${r(29.0498)} ${a(62.7688)} ${r(30.4404)} ${a(63.1396)}C${r(31.8284)} ${a(63.5112)} ${r(32.9402)} ${a(64.3999)} ${r(33.627)} ${a(65.543)}C${r(34.5887)} ${a(64.6072)} ${r(35.9012)} ${a(64.0304)} ${r(37.3496)} ${a(64.0303)}C${r(38.7912)} ${a(64.0303)} ${r(40.098)} ${a(64.6023)} ${r(41.0586)} ${a(65.5303)}C${r(41.7458)} ${a(64.3887)} ${r(42.8594)} ${a(63.5007)} ${r(44.25)} ${a(63.1299)}C${r(45.643)} ${a(62.7522)} ${r(47.057)} ${a(62.9676)} ${r(48.2266)} ${a(63.6201)}C${r(48.5931)} ${a(62.3323)} ${r(49.4413)} ${a(61.1801)} ${r(50.6904)} ${a(60.46)}C${r(51.9373)} ${a(59.7364)} ${r(53.3558)} ${a(59.5781)} ${r(54.6523)} ${a(59.9023)}C${r(54.6744)} ${a(58.5659)} ${r(55.1925)} ${a(57.2372)} ${r(56.21)} ${a(56.2197)}C${r(57.2339)} ${a(55.2007)} ${r(58.5676)} ${a(54.6816)} ${r(59.9062)} ${a(54.6611)}C${r(59.5835)} ${a(53.3649)} ${r(59.7414)} ${a(51.9468)} ${r(60.46)} ${a(50.7002)}C${r(61.1797)} ${a(49.4517)} ${r(62.3312)} ${a(48.6068)} ${r(63.6182)} ${a(48.2412)}C${r(62.9651)} ${a(47.0726)} ${r(62.7473)} ${a(45.658)} ${r(63.1201)} ${a(44.2598)}C${r(63.4916)} ${a(42.8718)} ${r(64.3794)} ${a(41.7591)} ${r(65.5225)} ${a(41.0723)}C${r(64.5929)} ${a(40.1115)} ${r(64.0206)} ${a(38.8033)} ${r(64.0205)} ${a(37.3604)}C${r(64.0205)} ${a(35.9186)} ${r(64.5915)} ${a(34.611)} ${r(65.5195)} ${a(33.6504)}C${r(64.3785)} ${a(32.9631)} ${r(63.4908)} ${a(31.8501)} ${r(63.1201)} ${a(30.46)}C${r(62.7421)} ${a(29.0656)} ${r(62.9572)} ${a(27.6498)} ${r(63.6113)} ${a(26.4795)}C${r(62.3272)} ${a(26.1115)} ${r(61.1784)} ${a(25.2657)} ${r(60.46)} ${a(24.0195)}C${r(59.7364)} ${a(22.7727)} ${r(59.5781)} ${a(21.3541)} ${r(59.9023)} ${a(20.0576)}C${r(58.5626)} ${a(20.038)} ${r(57.23)} ${a(19.52)} ${r(56.21)} ${a(18.5)}C${r(55.1931)} ${a(17.4783)} ${r(54.675)} ${a(16.1482)} ${r(54.6523)} ${a(14.8125)}C${r(53.3557)} ${a(15.1357)} ${r(51.9374)} ${a(14.9785)} ${r(50.6904)} ${a(14.2598)}C${r(49.4399)} ${a(13.5339)} ${r(48.5931)} ${a(12.3801)} ${r(48.2285)} ${a(11.0918)}C${r(47.0603)} ${a(11.7439)} ${r(45.6474)} ${a(11.9624)} ${r(44.25)} ${a(11.5898)}V${a(11.5801)}C${r(42.8613)} ${a(11.2085)} ${r(41.7483)} ${a(10.3196)} ${r(41.0615)} ${a(9.17578)}Z`}function Sa(t){let e=t/70;return {scale:e,transform:(o,r)=>(o-5)*e+r}}function Gd(t,e,n){let{scale:o,transform:r}=Sa(n);return P`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}H ${r(5,t)}zM ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${35*o}z`}function zd(t,e,n){let o=n/7,r=o*1.5,a=o*.75,i=P`M ${t+r} ${e}`+P`h ${n-2*r}`+P`a ${r} ${r} 0 0 1 ${r} ${r}`+P`v ${n-2*r}`+P`a ${r} ${r} 0 0 1 ${-r} ${r}`+P`h ${-(n-2*r)}`+P`a ${r} ${r} 0 0 1 ${-r} ${-r}`+P`v ${-(n-2*r)}`+P`a ${r} ${r} 0 0 1 ${r} ${-r}z`,l=P`M ${t+o+a} ${e+o}`+P`h ${5*o-2*a}`+P`a ${a} ${a} 0 0 1 ${a} ${a}`+P`v ${5*o-2*a}`+P`a ${a} ${a} 0 0 1 ${-a} ${a}`+P`h ${-(5*o-2*a)}`+P`a ${a} ${a} 0 0 1 ${-a} ${-a}`+P`v ${-(5*o-2*a)}`+P`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+l}function Ud(t,e,n){let{scale:o,transform:r}=Sa(n);return P`M ${r(5,t)} ${r(40,e)}a ${35*o} ${35*o}, 0, 0, 0, ${35*o} ${35*o}h ${30*o}a ${5*o} ${5*o}, 0, 0, 0, ${5*o} -${5*o}v -${30*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} -${35*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} ${35*o}zM ${r(40,t)} ${r(15,e)}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} ${25*o}v ${25*o}h -${25*o}a ${25*o} ${25*o}, 0, 0, 1, -${25*o} -${25*o}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} -${25*o}z`}function qd(t,e,n){let{scale:o,transform:r}=Sa(n);return P`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} ${25*o}M ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} -${15*o}z`}function Wd(t,e,n){let o=n/70,r=t+n/2-40*o,a=e+n/2-40*o,i=(s,c)=>s*o+c;return P`M${i(35.19239999999999,r)} ${i(5.837547376725838,a)}C${i(37.69667692307692,r)} ${i(3.8737070690335305,a)}, ${i(41.218430769230764,r)} ${i(3.8737092228796843,a)}, ${i(43.722707692307694,r)} ${i(5.837547376725838,a)}L${i(46.62781538461539,r)} ${i(8.115648915187375,a)}L${i(50.23356923076923,r)} ${i(7.32361506903353,a)}C${i(53.342,r)} ${i(6.640824299802762,a)}, ${i(56.51483076923077,r)} ${i(8.168784299802759,a)}, ${i(57.91892307692308,r)} ${i(11.024719684418145,a)}L${i(59.54787692307692,r)} ${i(14.337679684418145,a)}L${i(63.14027692307692,r)} ${i(15.188578145956608,a)}C${i(66.23707692307693,r)} ${i(15.922091992110452,a)}, ${i(68.43270769230769,r)} ${i(18.675396607495067,a)}, ${i(68.45876923076924,r)} ${i(21.857768915187375,a)}L${i(68.48892307692307,r)} ${i(25.54931045364891,a)}L${i(71.35633846153846,r)} ${i(27.874602761341222,a)}C${i(73.82830769230769,r)} ${i(29.879187376725838,a)}, ${i(74.61187692307692,r)} ${i(33.312418145956606,a)}, ${i(73.25452307692306,r)} ${i(36.19103353057199,a)}L${i(71.68006153846153,r)} ${i(39.530141222879685,a)}L${i(73.25452307692306,r)} ${i(42.86924891518738,a)}C${i(74.61187692307692,r)} ${i(45.747864299802764,a)}, ${i(73.82830769230769,r)} ${i(49.18109506903353,a)}, ${i(71.35633846153846,r)} ${i(51.18567968441815,a)}L${i(68.48892307692307,r)} ${i(53.510971992110456,a)}L${i(68.45876923076924,r)} ${i(57.202664299802755,a)}C${i(68.43270769230769,r)} ${i(60.38497199211046,a)}, ${i(66.23707692307693,r)} ${i(63.13823353057199,a)}, ${i(63.14027692307692,r)} ${i(63.871833530572,a)}L${i(59.54787692307692,r)} ${i(64.72260276134121,a)}L${i(57.91892307692308,r)} ${i(68.03564891518737,a)}C${i(56.51483076923077,r)} ${i(70.89164891518737,a)}, ${i(53.342,r)} ${i(72.41958737672583,a)}, ${i(50.23356923076923,r)} ${i(71.7368181459566,a)}L${i(46.62781538461539,r)} ${i(70.94463353057199,a)}L${i(43.722707692307694,r)} ${i(73.22275660749506,a)}C${i(41.218430769230764,r)} ${i(75.18663353057198,a)}, ${i(37.69667692307692,r)} ${i(75.18663353057198,a)}, ${i(35.19239999999999,r)} ${i(73.22275660749506,a)}L${i(32.28729230769231,r)} ${i(70.94463353057199,a)}L${i(28.68153846153846,r)} ${i(71.7368181459566,a)}C${i(25.573215384615384,r)} ${i(72.41958737672583,a)}, ${i(22.400384615384613,r)} ${i(70.89164891518737,a)}, ${i(20.996141538461536,r)} ${i(68.03564891518737,a)}L${i(19.36720923076923,r)} ${i(64.72260276134121,a)}L${i(15.774852307692306,r)} ${i(63.871833530572,a)}C${i(12.67803076923077,r)} ${i(63.13823353057199,a)}, ${i(10.48237846153846,r)} ${i(60.38497199211046,a)}, ${i(10.45636,r)} ${i(57.202664299802755,a)}L${i(10.426163076923077,r)} ${i(53.510971992110456,a)}L${i(7.558747692307692,r)} ${i(51.18567968441815,a)}C${i(5.086880338461539,r)} ${i(49.18109506903353,a)}, ${i(4.303258769230769,r)} ${i(45.747864299802764,a)}, ${i(5.660599692307692,r)} ${i(42.86924891518738,a)}L${i(7.235153846153846,r)} ${i(39.530141222879685,a)}L${i(5.660599692307692,r)} ${i(36.19103353057199,a)}C${i(4.3032566153846155,r)} ${i(33.312418145956606,a)}, ${i(5.086885938461538,r)} ${i(29.879187376725838,a)}, ${i(7.558747692307692,r)} ${i(27.874602761341222,a)}L${i(10.426163076923077,r)} ${i(25.54931045364891,a)}L${i(10.45636,r)} ${i(21.857768915187375,a)}C${i(10.48237846153846,r)} ${i(18.67537506903353,a)}, ${i(12.678052307692308,r)} ${i(15.922091992110452,a)}, ${i(15.774852307692306,r)} ${i(15.188578145956608,a)}L${i(19.36720923076923,r)} ${i(14.337679684418145,a)}L${i(20.996141538461536,r)} ${i(11.024719684418145,a)}C${i(22.400384615384613,r)} ${i(8.168784299802759,a)}, ${i(25.573215384615384,r)} ${i(6.640824299802762,a)}, ${i(28.68153846153846,r)} ${i(7.32361506903353,a)}L${i(32.28729230769231,r)} ${i(8.115648915187375,a)}L${i(35.19239999999999,r)} ${i(5.837547376725838,a)}M${i(39.45766153846154,r)} ${i(13.665055069033532,a)}L${i(37.01498461538461,r)} ${i(15.58053506903353,a)}C${i(35.39098461538461,r)} ${i(16.854061222879682,a)}, ${i(33.282799999999995,r)} ${i(17.335251992110454,a)}, ${i(31.26701538461538,r)} ${i(16.892464299802757,a)}L${i(28.235046153846152,r)} ${i(16.22649506903353,a)}L${i(26.865415384615382,r)} ${i(19.012107376725837,a)}C${i(25.954812307692308,r)} ${i(20.864178145956608,a)}, ${i(24.264193846153844,r)} ${i(22.212399684418145,a)}, ${i(22.255926153846154,r)} ${i(22.688076607495066,a)}L${i(19.235393846153844,r)} ${i(23.40354122287968,a)}L${i(19.21,r)} ${i(26.507556607495065,a)}C${i(19.19313538461538,r)} ${i(28.57137199211045,a)}, ${i(18.25492,r)} ${i(30.519525838264297,a)}, ${i(16.651919999999997,r)} ${i(31.81937199211045,a)}L${i(14.240926153846154,r)} ${i(33.774633530572,a)}L${i(15.564830769230769,r)} ${i(36.58238737672584,a)}C${i(16.445064615384617,r)} ${i(38.44891045364892,a)}, ${i(16.445064615384617,r)} ${i(40.611371992110456,a)}, ${i(15.564830769230769,r)} ${i(42.47811045364892,a)}L${i(14.240926153846154,r)} ${i(45.28564891518738,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}L${i(13.883236923076923,r)} ${i(50.654971992110454,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}C${i(18.25492,r)} ${i(48.54075660749507,a)}, ${i(19.19313538461538,r)} ${i(50.4891258382643,a)}, ${i(19.21,r)} ${i(52.5527258382643,a)}L${i(19.235393846153844,r)} ${i(55.65684891518738,a)}L${i(22.255926153846154,r)} ${i(56.37235660749507,a)}C${i(24.264193846153844,r)} ${i(56.847925838264295,a)}, ${i(25.954812307692308,r)} ${i(58.196233530571995,a)}, ${i(26.865415384615382,r)} ${i(60.0483258382643,a)}L${i(28.235046153846152,r)} ${i(62.833895069033524,a)}L${i(31.26701538461538,r)} ${i(62.1679258382643,a)}C${i(33.282799999999995,r)} ${i(61.72509506903353,a)}, ${i(35.39098461538461,r)} ${i(62.20626429980276,a)}, ${i(37.01498461538461,r)} ${i(63.47983353057199,a)}L${i(39.45766153846154,r)} ${i(65.39524891518737,a)}L${i(41.90012307692308,r)} ${i(63.47983353057199,a)}C${i(43.524123076923075,r)} ${i(62.20626429980276,a)}, ${i(45.632307692307684,r)} ${i(61.72509506903353,a)}, ${i(47.6480923076923,r)} ${i(62.1679258382643,a)}L${i(50.68006153846154,r)} ${i(62.833895069033524,a)}L${i(52.049692307692304,r)} ${i(60.0483258382643,a)}C${i(52.960338461538456,r)} ${i(58.196233530571995,a)}, ${i(54.6508923076923,r)} ${i(56.847925838264295,a)}, ${i(56.65913846153846,r)} ${i(56.37235660749507,a)}L${i(59.67969230769231,r)} ${i(55.65684891518738,a)}L${i(59.70510769230769,r)} ${i(52.5527258382643,a)}C${i(59.72190769230769,r)} ${i(50.4891258382643,a)}, ${i(60.66012307692307,r)} ${i(48.54075660749507,a)}, ${i(62.263230769230766,r)} ${i(47.240910453648915,a)}L${i(64.67424615384616,r)} ${i(45.28564891518738,a)}L${i(63.35027692307692,r)} ${i(42.47811045364892,a)}C${i(62.47,r)} ${i(40.611371992110456,a)}, ${i(62.47,r)} ${i(38.44891045364892,a)}, ${i(63.35027692307692,r)} ${i(36.58238737672584,a)}L${i(64.67424615384616,r)} ${i(33.774633530572,a)}L${i(62.263230769230766,r)} ${i(31.81958737672584,a)}C${i(60.66012307692307,r)} ${i(30.519525838264297,a)}, ${i(59.72190769230769,r)} ${i(28.57137199211045,a)}, ${i(59.70510769230769,r)} ${i(26.507556607495065,a)}L${i(59.67969230769231,r)} ${i(23.40354122287968,a)}L${i(56.65913846153846,r)} ${i(22.688076607495066,a)}C${i(54.6508923076923,r)} ${i(22.212399684418145,a)}, ${i(52.960338461538456,r)} ${i(20.864178145956608,a)}, ${i(52.049692307692304,r)} ${i(19.012128915187375,a)}L${i(50.68006153846154,r)} ${i(16.22649506903353,a)}L${i(47.6480923076923,r)} ${i(16.892464299802757,a)}C${i(45.632307692307684,r)} ${i(17.335251992110454,a)}, ${i(43.524338461538456,r)} ${i(16.85408276134122,a)}, ${i(41.90012307692308,r)} ${i(15.58053506903353,a)}L${i(39.45766153846154,r)} ${i(13.665055069033532,a)}Z`}function Tr(t,e,n,o,r="top-left"){switch(o){case "leaf":return nc(t,e,n,r);case "leaf-reverse":return nc(t,e,n,r,true);case "drop":return Fd(t,e,n,r);case "octagon":return ec(t,e,n,1.6);case "bevel":return ec(t,e,n,1.1);case "squircle":return Id(t,e,n);case "cushion":return Td(t,e,n);case "shield":return kd(t,e,n);case "petal":return Nd(t,e,n,r);case "gear":return Qd(t,e,n);case "rounded":return Dd(t,e,n);case "circle":return Bd(t,e,n);case "diya":return Gd(t,e,n);case "extra-rounded":return zd(t,e,n);case "message":return Ud(t,e,n);case "pointy":return qd(t,e,n);case "curly":return Wd(t,e,n);default:return Od(t,e,n)}}var kr=.22,Nr=.14;function ac(t,e,n={}){if(t==="circle")return E("circle",{cx:x(e.x+e.w/2),cy:x(e.y+e.h/2),r:x(Math.min(e.w,e.h)/2),...n});let o=t==="rounded"?Math.min(e.w,e.h)*kr:0;return E("rect",{height:x(e.h),width:x(e.w),x:x(e.x),y:x(e.y),...o>0&&{rx:x(o),ry:x(o)},...n})}function Hd(t,e){let n=t.w*e,o=t.h*e;return {x:t.x+n,y:t.y+o,w:t.w-2*n,h:t.h-2*o}}function Or(t,e){let n=t.shape??"square",o=t.plate,r=o?Hd(e,Nr):e,a=l=>E("image",{height:x(r.h),href:t.src,preserveAspectRatio:"none",width:x(r.w),x:x(r.x),y:x(r.y),...l&&{clipPath:`url(#${l})`}});if(n==="square"&&!o)return a();let i=n==="square"?void 0:`qrdx-logo-${Oe(`${n}|${x(r.x)}|${x(r.y)}|${x(r.w)}|${x(r.h)}`)}`;return st("g",{children:[o&&ac(n,e,{fill:o}),i&&E("clipPath",{id:i,children:ac(n,r)}),a(i)]})}var ic=.6,Vd=["L","M","Q","H"];function sc(t){let e=yt.QrCode.encodeText(t.value,Rt[t.level]),n=Vd[e.errorCorrectionLevel.ordinal]??t.level;return {code:t,cells:e.getModules(),layoutMargin:Lt(e.size,t.margin,t.shape),map:Dn(e.version,n),level:n,version:e.version}}function lc(t,e){let{cells:n,map:o}=t,r=n.length,a=xe(n,t.code.size,t.layoutMargin,e);if(!a)return null;let i=a.excavation??{x:Math.floor(a.x),y:Math.floor(a.y),w:Math.ceil(a.x+a.w)-Math.floor(a.x),h:Math.ceil(a.y+a.h)-Math.floor(a.y)},l=[];for(let c=Math.max(0,i.y);c<Math.min(r,i.y+i.h);c++)for(let u=Math.max(0,i.x);u<Math.min(r,i.x+i.w);u++)l.push(c*r+u);let s=Bn(o,l);return {worst:Math.max(0,...s),correctable:o.correctable,budget:Math.floor(o.correctable*ic),level:t.level,version:t.version}}function Dr(t,e){return lc(sc(t),e)}var cc=t=>!t||t.worst<=t.budget;function jd(t,e){return cc(Dr(t,e))}function wa(t,e,n,o){let r=e.map(l=>sc({...t,level:l})),a=l=>{let s=o(l);return r.every(c=>cc(lc(c,s)))};if(a(n))return n;let i=t.size*.005;for(let l=n-i;l>0;l-=i)if(a(l))return l;return 0}function Br(t,e){if(!e)return;let n=Math.floor(t.size*ir),o=e.width||n,r=e.height||n,a=f=>{if(f===o)return e;let d=r*f/o;return {...e,width:f,height:d,...e.x!=null&&{x:e.x+(o-f)/2},...e.y!=null&&{y:e.y+(r-d)/2}}},i=t.level??Ht,l={value:t.value,size:t.size,margin:t.margin,shape:t.shape},s=f=>Nt({...t,level:i,imageSettings:f}),c=f=>{let d=wa(l,[f],o,a);return d>0?a(d):void 0},u=s(e);if(u===i)return c(i);let m=c(u);return m&&s(m)===u?m:c(i)}var Ca="data-qrdx-part",uc="data-qrdx-eye",Zd=["eye-outer","eye-centre","body","logo","background"];function Ma(t,e,n){if(t)return n?{[Ca]:e,[uc]:n}:{[Ca]:e}}var mc={id:"Arrow",name:"Arrow",description:"QR code with arrow",wrapper:(t,e)=>E("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:st("svg",{fill:"#000000",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[E("path",{d:"M73.57,175.23h0c.12-2.06.31-4.19.49-6.25s.48-4.13.85-6.13.79-4,1.27-5.95a30.21,30.21,0,0,1,1.94-5.28h0c.06-.18.13-.43.19-.67a3.55,3.55,0,0,0-2.8-4.19l-.18-.06a1.85,1.85,0,0,0-.54-.06c-.19,0-.31-.06-.49-.06s-.61-.06-.91-.06c-.61,0-1.21.06-1.82.06-1.21.12-2.37.25-3.52.43a62.08,62.08,0,0,0-6.8,1.45,58.45,58.45,0,0,0-6.43,2.31c-1,.42-2.07,1-3.1,1.4s-2,1.09-3,1.57a.76.76,0,0,0,.54,1.4h.07c1.09-.24,2.12-.55,3.15-.79s2.13-.48,3.16-.61A46,46,0,0,1,62,153c1.34-.06,2.73-.06,4.07-.06a62.58,62.58,0,0,0-7.23,10.43,85.58,85.58,0,0,0-6.55,15.36,107.86,107.86,0,0,0-5,32.53,104.06,104.06,0,0,0,5,32.29,90.47,90.47,0,0,0,15.54,28.52.94.94,0,0,0,1.27.19.89.89,0,0,0,.18-1.28h0a87.24,87.24,0,0,1-13.89-28.28A102.85,102.85,0,0,1,58,180.87a82.15,82.15,0,0,1,6.68-14,51.58,51.58,0,0,1,5.71-7.76c0,1.21,0,2.36.06,3.58.12,2.18.24,4.31.48,6.43s.49,4.25.85,6.37a1,1,0,0,0,.91.85A1.37,1.37,0,0,0,73.57,175.23Z",fill:e?.fgColor||"black",id:"CallToActionArrow"}),E("g",{fill:"none",transform:"translate(82, 95)scale(0.5)",children:t})]})})};var dc={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:t=>E("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:E("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:t})})};var Zn=593,$e=296.5,jn=146.5,yc=294.5,_c=231.228,xc="M296.5 0C460.252 -7.15782e-06 593 132.748 593 296.5C593 460.252 460.253 593 296.5 593C132.748 593 7.15782e-06 460.252 0 296.5C-7.15788e-06 132.748 132.748 7.15788e-06 296.5 0ZM296.5 527.728C424.204 527.728 527.728 424.204 527.728 296.5C527.728 168.796 424.204 65.2713 296.5 65.2713C168.796 65.2713 65.2714 168.796 65.2714 296.5C65.2714 424.204 168.796 527.728 296.5 527.728Z",Xd="iaa2 1z3g 1z0y 1z18 1z18 1we8 2mq 1uta 47y 1rx4 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rzm 71m 1rzm 71m 1rzc 73u okq 13ce 744 1rx4 744 1rwu 744 1rx4 744 1rx4 73u 1rx4 744 1rx4 73u 1rx4 73u 1rx4 744 1rx4 73u 1rxe 73u 1rx4 73u 1rx4 744 1rzm 71c 1rzm 73u 1rxe 73u 1rx4 744 1rx4 73u 1rx4 73u 1rxe 73u 1rx4 618 12m 1rxe 73u 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z18",Yd="hqpr 5 1z36 1z0y 1z18 1z18 1z0y 1z0y 1a7w otc 1z0y 1z18 1z0y 1z18 1z0y 1z1i 1z0o 1z18 1z0y 1z3q 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1lk8 dgq 1z18 1z18 1z3g 1z0y 1z0y 1z18 1z18 1z0y 1z0y 1z18 1yx2 3w 1z18 60o 1t0a 1z18 1z0y 1z18 1z0y",fc="3cf27f17c00j3ch21n1ek00l1el3cj1vv1kd00n3cl3cn1q31q500p3cp1vx00r1kb3cs3aw1ej21p00t3ax3ay17b27h00w3b02g20yq01w2d611m01x3b52aa14i01y24i1bq0203bd3be1q21q60253bf39e39f39h14e2ae02d39j11i2da02e39l0ym02f39n2lt0sz03a39p2ix0vv03b39r2d511n39t03d27d17f03f39x39y21l1en03h3a03a11vt1kf03j37w37x1q11q703l37z1k903n1vz3821eh03p21r38714d03t11h03u2db38a0vp2j303w2lz38g03x0st2rk0n804o38l2oo0q404p38n2iw0vw04r36f36h2a814k04u36k36l1vs1kg04z36o36p1n41t405236q36x36y0ss2m005d3720n02rs05f3742uf0kd0633763772on0q506537834y2fz0yt06834z2d311p06935235424f1bt06c35621j1ep06d3581yn1hl06e35a1sv1nd06g35b1pz1q906h35d35e35g1ef21t06l35h1bj24p06m35k35l11f2dd06q35n0vn2j506s35p35q0pv2ox06u35s0mz2rt06v35t33h0k32up06w2x90hi08y2ud0ke08z33r2lp0t20922fx0yu0942a514m09624d1bu0983441yl1hm09a1vp1ki09b1px1qa09d34e1n11t609e1h91yy09g1ed21u09h1a227m0831492ai09l0yh2ga09n0sp2m209p0pt2oy09q0k12uq09s2xo0h52z209t31k0en0bt2780c319z0az0e831z0cq",hc=52,Kd=240;function pc(t){let e=0;return t.split(" ").map(n=>(e+=Number.parseInt(n,36),e/1e4))}var Ra;function Jd(){if(!Ra){let t=pc(Xd),e=pc(Yd),n=[];for(let o=0;o<fc.length;o+=3){let r=Number.parseInt(fc.slice(o,o+3),36);n.push({cx:t[Math.floor(r/hc)],cy:e[r%hc]});}Ra=n;}return Ra}function tf(t){let e=0;for(let n=0;n<t.length;n++)e=e*32-e+t.charCodeAt(n),e%=2147483647;return Math.abs(e)}function $c(t){let e=Jd(),n=tf(t),o=()=>(n=(n*9301+49297)%233280,n/233280),r=e.map((a,i)=>i);for(let a=r.length-1;a>0;a--){let i=Math.floor(o()*(a+1));[r[a],r[i]]=[r[i],r[a]];}return r.slice(0,Kd).sort((a,i)=>a-i).map(a=>e[a])}var gc=300,ef=49,nf=6;function Sc(t,e){if(gc/e<=ef+.5)return t;let n=jn,o=jn+gc,r=nf*e+e/2;return t.filter(({cx:a,cy:i})=>Math.max(n-a,a-o,n-i,i-o)>=r)}var wc="Scan the QR code * Scan the QR code * Scan the QR code * Scan the QR code *",Qr=32,Cc=3.5,Mc=246.5,Aa=.36,bc=Mc+Aa*Qr,Ea=400;function rf(t,e){return t===" "||/[il1|!']/.test(t)?e*.3:/[mwMW@%&]/.test(t)?e*.8:e*.6}function of(t){let e=t.slice(0,Ea).split(" ").map(n=>un(n,Ea)).join(" ");return Array.from(e).slice(0,Ea)}function Rc(t,e){let{fontSize:n,letterSpacing:o,position:r,rotation:a}=e,i=2*Math.PI*Mc,l=[],s=0;for(let p of of(t)){let h=rf(p,n);if(s+h>i)break;l.push({char:p,along:s+h/2}),s+=h+o;}let c=s-(l.length>0?o:0),u=r!=="bottom",m=u?bc-Aa*n:bc+Aa*n,f=c/i*180,d=[];for(let{char:p,along:h}of l){if(p.trim()==="")continue;let g=h/i*360,y=u?a-f+g:a+180+f-g,b=y*Math.PI/180;d.push({char:p,x:J($e+m*Math.sin(b)),y:J($e-m*Math.cos(b)),rotate:J(u?y:y-180)});}return d}var $n=(t,e)=>typeof t=="number"&&Number.isFinite(t)?t:e,Ec={id:"DotRing",name:"Dot Ring",description:"A round code in a ring of dots of its own for every link, with text along the ring",wrapper:(t,e,n)=>{let o=wt(e?.fgColor,"#000000"),r=wt(e?.bgColor,"#ffffff"),a=n?.pixelSize??9,i=J(a/2),l=Sc($c(n?.url??""),a),s=$n(e?.fontSize,Qr),c=s>0?s:Qr,u=typeof e?.customText=="string"?e.customText:wc,m=Rc(u,{fontSize:c,letterSpacing:$n(e?.fontLetterSpacing,Cc),position:e?.textPosition==="bottom"?"bottom":"top",rotation:$n(e?.textRotation,0)}),f=e?.textColor||"#ffffff",d=e?.fontFamily||vr,p=e?.fontWeight??900,h=$n(e?.strokeWidth,0),g=e?.strokeColor||"#000000",y=[{radius:$e,width:$n(e?.outerStrokeWidth,h),color:e?.outerStrokeColor||g},{radius:_c,width:$n(e?.innerStrokeWidth,h),color:e?.innerStrokeColor||g}].filter(b=>b.width>0);return st("svg",{height:Zn,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${Zn} ${Zn}`,width:Zn,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[E("circle",{cx:$e,cy:$e,fill:r,r:yc}),E("g",{fill:o,children:l.map((b,_)=>E("circle",{cx:b.cx,cy:b.cy,r:i},_))}),E("path",{d:xc,fill:e?.outerCircleColor||o}),y.map((b,_)=>E("circle",{cx:$e,cy:$e,fill:"none",r:b.radius,stroke:b.color,strokeWidth:b.width},_)),E("g",{"aria-hidden":"true",children:m.map((b,_)=>E("text",{fill:f,fontFamily:d,fontSize:c,fontWeight:p,textAnchor:"middle",transform:`rotate(${b.rotate} ${b.x} ${b.y})`,x:b.x,y:b.y,children:b.char},_))}),E("g",{transform:`translate(${jn} ${jn})`,children:t})]})}};var Ac={id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",wrapper:t=>E("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:E("svg",{fill:"none",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:st("g",{transform:"translate(10, 10)",children:[E("circle",{cx:"138",cy:"167.682",fill:"white",r:"99.3177",stroke:"#F89941",strokeWidth:"20"}),E("rect",{fill:"url(#pattern0)",height:"110.806",width:"113",x:"81.0001",y:"124.097"}),E("ellipse",{cx:"167.989",cy:"67.8947",fill:"#F89941",rx:"35.4453",ry:"48.4419"}),E("path",{d:"M187.937 69.0763C187.937 82.6574 184.092 94.8451 178.005 103.57C171.912 112.304 163.736 117.381 154.992 117.381C146.247 117.381 138.072 112.304 131.979 103.57C125.891 94.8451 122.047 82.6574 122.047 69.0763C122.047 55.4952 125.891 43.3075 131.979 34.5823C138.072 25.8486 146.247 20.7714 154.992 20.7714C163.736 20.7714 171.912 25.8486 178.005 34.5823C184.092 43.3075 187.937 55.4952 187.937 69.0763Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),E("ellipse",{cx:"154.072",cy:"69.4866",fill:"#F89941",rx:"34.0512",ry:"50.6615"}),E("path",{d:"M171.396 69.667C171.396 82.7394 167.562 94.4717 161.488 102.874C155.412 111.279 147.235 116.2 138.451 116.2C129.666 116.2 121.489 111.279 115.413 102.874C109.34 94.4717 105.506 82.7394 105.506 69.667C105.506 56.5946 109.34 44.8624 115.413 36.4603C121.489 28.0551 129.666 23.1344 138.451 23.1344C147.235 23.1344 155.412 28.0551 161.488 36.4603C167.562 44.8624 171.396 56.5946 171.396 69.667Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),E("ellipse",{cx:"134.316",cy:"70.8486",fill:"#F89941",rx:"33.673",ry:"47.8511"}),E("ellipse",{fill:"#F89941",rx:"35.4453",ry:"48.4419",transform:"matrix(-1 0 0 1 106.743 68.4484)"}),E("path",{d:"M86.7942 69.6299C86.7942 83.2111 90.6388 95.3988 96.7262 104.124C102.819 112.858 110.995 117.935 119.739 117.935C128.484 117.935 136.659 112.858 142.753 104.124C148.84 95.3988 152.685 83.2111 152.685 69.6299C152.685 56.0488 148.84 43.8611 142.753 35.1359C136.659 26.4023 128.484 21.3251 119.739 21.3251C110.995 21.3251 102.819 26.4023 96.7262 35.1359C90.6388 43.8611 86.7942 56.0488 86.7942 69.6299Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),E("ellipse",{fill:"#F89941",rx:"32.9438",ry:"50.3847",transform:"matrix(-1 0 0 1 119.744 69.7634)"}),E("path",{d:"M103.335 70.2207C103.335 83.293 107.169 95.0253 113.243 103.427C119.319 111.833 127.496 116.753 136.281 116.753C145.065 116.753 153.242 111.833 159.318 103.427C165.392 95.0253 169.226 83.293 169.226 70.2207C169.226 57.1483 165.392 45.416 159.318 37.014C153.242 28.6088 145.065 23.688 136.281 23.688C127.496 23.688 119.319 28.6088 113.243 37.014C107.169 45.416 103.335 57.1483 103.335 70.2207Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),E("ellipse",{fill:"#F89941",rx:"32.3901",ry:"47.6163",transform:"matrix(-1 0 0 1 139.677 70.8708)"}),E("ellipse",{fill:"#F89941",rx:"33.2207",ry:"47.6163",transform:"matrix(-1 0 0 1 134.971 71.4245)"}),E("path",{d:"M158.85 46.6783C165.21 42.2516 166.538 40.633 167.867 39.0144C167.867 39.0144 169.806 43.8236 169.88 46.3566C169.954 48.8897 169.712 50.1469 167.248 51.6467C164.783 53.1464 155.406 53.0446 150.083 52.9746C149.31 52.5001 150.72 52.3371 158.85 46.6783Z",fill:"black"}),E("path",{d:"M115.765 46.5118C109.392 42.1412 108.058 40.5475 106.724 38.9538C106.724 38.9538 104.783 45.8361 104.758 46.822C104.733 47.808 104.657 50.8051 108.247 51.9995C111.837 53.194 119.234 52.7723 124.551 52.7272C125.322 52.2652 123.912 52.0991 115.765 46.5118Z",fill:"black"}),E("path",{d:"M160 90.4999C167.156 83.1595 169.5 78.2827 171.351 72.9348C172.24 70.3672 162.909 72.0429 158 72.9348C157.276 73.0664 155.751 76.9145 155 77C154.182 77.0932 151.841 73.0759 151 73.086C149.725 73.1013 147.727 73.086 145.875 73.4285C145.345 74.3645 146.367 77.5746 145.875 78.2827C145.321 78.2827 141.796 77.2604 141.242 76.4298C140.689 74.492 140.949 73.3629 140.118 72.5323C137.555 72.9075 138.023 72.6567 135.412 73.086C134.768 73.1919 133.09 77.7212 132.441 77.8195C131.615 77.9448 128.644 74.0088 127.809 74.1138C126.747 74.2475 124.821 74.4683 123.64 74.577C123.126 74.6244 123.554 77.5019 123.177 78.2827C122.898 78.8616 119.426 77.8921 118.5 77.5C118.037 76.5024 117.844 74.5583 117 74.577C111 74.1138 109.4 73.843 103.575 70.8713C103.575 70.8713 102.5 80 111 89C119.5 98 147.127 103.706 160 90.4999Z",fill:"black"}),E("path",{d:"M135.238 7.25181C137.192 1.73111 142.678 0.363204 145.935 0L148.377 1.81602C149.158 2.39714 149.842 2.40909 150.331 3.25657C150.331 4.22511 146.337 5.41975 142.429 6.582C137.545 8.03482 139.482 17.0534 142.429 19.2811C143.401 20.0152 143.524 19.9639 145.966 19.9639C148.029 19.9639 150.387 18.2474 151.566 17.3526C151.566 17.3526 151.861 20.2573 149.798 21.4777C147.735 22.698 143.578 21.8578 143.608 21.9658C144.493 23.9183 146.89 22.4887 148.029 23.3362C147.346 23.3362 146.556 24.2889 144.198 24.5329C142.672 24.5798 142.135 24.5329 140.956 23.9183C139.777 23.3037 139.482 22.8696 138.893 22.1395C136.83 23.3598 138.893 25.4305 138.893 25.4305C138.893 25.4305 134.472 25.8512 133.587 23.9183C133.264 23.2115 133.882 22.1395 133.587 21.9658C131.819 22.4539 130.935 23.4807 127.373 22.8696C124.312 22.3443 125.102 18.3211 124.451 17.3526C127.381 18.079 125.131 20.0392 129.327 19.9639C140.838 19.7576 132.796 14.1527 135.238 7.25181Z",fill:"#5D725F"}),st("defs",{children:[E("pattern",{height:"1",id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1"}),E("clipPath",{id:"clip0_2087_156668",children:E("rect",{fill:"white",height:"276",width:"276"})})]}),E("g",{fill:"none",transform:"translate(80, 122)scale(0.38)",children:t})]})})})};var Pc={id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",wrapper:(t,e)=>E("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:E("svg",{fill:"black",height:"300",viewBox:"0 0 316 316",width:"300",xmlns:"http://www.w3.org/2000/svg",children:st("g",{children:[E("path",{clipRule:"evenodd",d:"M308 8H8v300h300V8ZM0 0v316h316V0H0Z",fill:e?.fgColor||"black",fillRule:"evenodd"}),E("g",{fill:"none",transform:"translate(20, 20) scale(0.92)",children:t})]})})})};var vc={id:"StandardBox",name:"Standard Box",description:"QR code with standard box",wrapper:(t,e)=>E("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:st("svg",{fill:"#000000",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[E("path",{d:"M243,1.7h-186a10.25,10.25,0,0,0-10.2,10.12v186A10.13,10.13,0,0,0,57,208H243a10.13,10.13,0,0,0,10.12-10.12v-186A10.13,10.13,0,0,0,243,1.7Zm2.36,193.05a5.46,5.46,0,0,1-5.47,5.47H60.16a5.46,5.46,0,0,1-5.47-5.47V14.93a5.46,5.46,0,0,1,5.47-5.47H239.91a5.46,5.46,0,0,1,5.47,5.47Z",fill:e?.fgColor||"black"}),E("path",{d:"M243.54,238.81H173.61a2.29,2.29,0,0,1-1.62-.67l-20.55-20.55a2.33,2.33,0,0,0-3.25,0l-20.55,20.55a2.29,2.29,0,0,1-1.62.67H56.09A9.15,9.15,0,0,0,46.93,248v41.17a9.16,9.16,0,0,0,9.16,9.16H243.61a9.09,9.09,0,0,0,9.09-9.16V248A9.16,9.16,0,0,0,243.54,238.81Z",fill:e?.fgColor||"black"}),E("g",{fill:"none",transform:"translate(60, 15)scale(0.6)",children:t})]})})};var Lc={id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",wrapper:t=>E("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:st("svg",{fill:"#22071b",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[E("path",{d:"M195.11,290.77l-7.28,4.88a2.16,2.16,0,0,0-.57,3,2.21,2.21,0,0,0,1.77.92,2.4,2.4,0,0,0,1.2-.35l7.28-4.88a2.14,2.14,0,0,0-2.4-3.54Z"}),E("path",{d:"M266.85,227.52l-7.28,4.87a2.16,2.16,0,0,0-.57,3,2.21,2.21,0,0,0,1.77.92,1.86,1.86,0,0,0,1.2-.35l7.28-4.88a2.13,2.13,0,1,0-2.4-3.53Z"}),E("path",{d:"M41,176.34l-9.11,6.08a2.15,2.15,0,0,0-.57,3,2.19,2.19,0,0,0,1.77.92,2.14,2.14,0,0,0,1.2-.35l9.12-6.08A2.14,2.14,0,0,0,41,176.34Z"}),E("path",{d:"M41,269.08l-9.11,6.07a2.15,2.15,0,0,0-.57,3,2.19,2.19,0,0,0,1.77.92,2.92,2.92,0,0,0,1.2-.35l9.12-6.08A2.14,2.14,0,0,0,41,269.08Z"}),E("path",{d:"M147,10.1a2.4,2.4,0,0,0,1.14-.35l7.7-5.16a2.13,2.13,0,0,0-2.4-3.53l-7.64,5.15a2.15,2.15,0,0,0-.56,3A2.19,2.19,0,0,0,147,10.1Z"}),E("path",{d:"M275.54,54.77a2.14,2.14,0,0,0-3-.56l-17.1,11.45V31.31a10.18,10.18,0,0,0-10.18-10.18H137.22l-10.39,7a2.4,2.4,0,0,1-1.2.35,2.21,2.21,0,0,1-1.77-.92,2.15,2.15,0,0,1,.57-3l1.41-.92,13.64-8.76a2.1,2.1,0,1,0-2.26-3.54L122,21.2h-8.13l-10.39,7a2.37,2.37,0,0,1-1.2.35,2.19,2.19,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3L124,9.25a2.13,2.13,0,1,0-2.4-3.53l-23,15.48H58.2A10.18,10.18,0,0,0,48,31.38v28L31.34,70.46a2.09,2.09,0,0,0-.57,3,2,2,0,0,0,1.77.92,2.58,2.58,0,0,0,1.2-.35l14.35-9.54,3.18-2.12a2.14,2.14,0,1,1,2.41,3.53l-5.52,3.67V76.9l-7,4.66a2.15,2.15,0,0,0-.56,3,2,2,0,0,0,1.77.92,2.34,2.34,0,0,0,1.2-.36l7.35-4.94A2.13,2.13,0,0,1,52.69,84l-4.46,3v65.66L25.05,168.07a2.15,2.15,0,0,0-.57,3,2,2,0,0,0,1.77.92,2.37,2.37,0,0,0,1.2-.35l25-16.75a2,2,0,0,1,2.62.77,2.16,2.16,0,0,1-.57,3l-6.36,4.24V275a10.09,10.09,0,0,0,9.83,10.11l-5.87,4a2.15,2.15,0,0,0-.57,3,2.06,2.06,0,0,0,1.77.92,2.38,2.38,0,0,0,1.2-.36l23-15.41a2.14,2.14,0,0,1,2.41,3.54l-6.58,4.45h52l-5.58,3.75a2.14,2.14,0,0,0-.56,3,2,2,0,0,0,1.76.91,2.37,2.37,0,0,0,1.2-.35l30.54-20.28a2.15,2.15,0,0,1,3,.56,2.1,2.1,0,0,1-.57,3l-14.21,9.54H217l-4.6,3a2.16,2.16,0,0,0-.63,3,2.11,2.11,0,0,0,1.76,1,2,2,0,0,0,1.13-.36L237,277.35a2.14,2.14,0,1,1,2.33,3.6l-6.78,4.38h13a10.18,10.18,0,0,0,10.18-10.18v-91.1l-4.38,3a2.43,2.43,0,0,1-1.2.35,2.19,2.19,0,0,1-1.77-.92,2.15,2.15,0,0,1,.57-3l24.38-16.33a2.13,2.13,0,1,0-2.4-3.53l-15.48,10.25V91.53l-4.38,3a2.34,2.34,0,0,1-1.21.36,2.22,2.22,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3l6.72-4.52,13.71-9.19a2.14,2.14,0,0,0-2.4-3.54l-11.24,7.57V75.84l-4.38,3a2.34,2.34,0,0,1-1.21.36,2.22,2.22,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3l6.72-4.52,19.43-13.08A2.05,2.05,0,0,0,275.54,54.77ZM237,216.07h-172a5.23,5.23,0,0,1-5.23-5.24V38.94a5.22,5.22,0,0,1,5.23-5.23H237a5.22,5.22,0,0,1,5.23,5.23V210.83h.07A5.22,5.22,0,0,1,237,216.07Z"}),E("path",{d:"M270.45,139.8l-7.28,4.88a2.15,2.15,0,0,0-.56,3,2.22,2.22,0,0,0,1.76.92,2.44,2.44,0,0,0,1.21-.36l7.28-4.87a2.14,2.14,0,0,0-2.41-3.54Z"}),E("g",{fill:"none",transform:"translate(64, 38)scale(0.58)",children:t})]})})};var Xn={default:dc,Arrow:mc,StandardBox:vc,SquareBorder:Pc,StrikedBox:Lc,Halloween:Ac,DotRing:Ec},Fc={FlamQR:"DotRing"},Gr=t=>{if(Object.hasOwn(Xn,t))return Xn[t];let e=Object.hasOwn(Fc,t)?Fc[t]:void 0;return e?Xn[e]:void 0},ay=()=>Object.values(Xn),iy=()=>Object.keys(Xn);var Pa=t=>Math.round(Math.min(Math.max(t,0),255)).toString(16).padStart(2,"0");function Nc(t){return `#${Pa(t.r)}${Pa(t.g)}${Pa(t.b)}`}function zr(t){let e=dt(t);return !e||e.a>=1||e.a<=0?{color:t}:{color:Nc(e),opacity:J(e.a,3)}}function Ur(t,e){let n=Math.min(Math.max(t.a,0),1);return {r:t.r*n+e.r*(1-n),g:t.g*n+e.g*(1-n),b:t.b*n+e.b*(1-n),a:1}}var Oc={r:0,g:0,b:0,a:1};function af(t){return [...t].map(e=>({offset:Math.min(Math.max(e.offset/100,0),1),color:dt(e.color)??Oc})).sort((e,n)=>e.offset-n.offset)}function va(t,e){let n=t[0],o=t.at(-1);if(!(n&&o))return Oc;if(e<=n.offset)return n.color;if(e>=o.offset)return o.color;for(let r=0;r+1<t.length;r++){let a=t[r],i=t[r+1];if(e>=a.offset&&e<=i.offset){let l=i.offset-a.offset,s=l>0?(e-a.offset)/l:1,c=a.color.a+(i.color.a-a.color.a)*s,u=(m,f)=>{let d=m*a.color.a+(f*i.color.a-m*a.color.a)*s;return c>0?d/c:m+(f-m)*s};return {r:u(a.color.r,i.color.r),g:u(a.color.g,i.color.g),b:u(a.color.b,i.color.b),a:c}}}return o.color}var Ic=4,Tc=720,sf=2;function Dc(t,e,n,o,r){let a=af(t);if(a.length===0)return {wedges:[]};let i=a[0].color.a,l=a.every(b=>Math.abs(b.color.a-i)<.002),s=[...new Set([0,...a.map(b=>b.offset),1])].sort((b,_)=>b-_),c=[];for(let b=0;b+1<s.length;b++){let _=s[b],w=s[b+1];if(w<=_)continue;let R=va(a,_+1e-9),S=va(a,w-1e-9),$=Math.max(Math.abs(R.r*R.a-S.r*S.a),Math.abs(R.g*R.a-S.g*S.a),Math.abs(R.b*R.a-S.b*S.a),Math.abs(R.a-S.a)*255),M=Math.ceil($/sf),C=Math.ceil((w-_)*360/Ic),A=Math.max(1,M,C);for(let v=0;v<A;v++)c.push([_+(w-_)*v/A,_+(w-_)*(v+1)/A]);}let u=c;if(c.length>Tc){let b=Math.ceil(c.length/Tc);u=[];for(let _=0;_<c.length;_+=b){let w=c.slice(_,_+b);u.push([w[0][0],w.at(-1)[1]]);}}let m=e-90,f=r/Math.cos(2*Ic/2*(Math.PI/180)),d=b=>{let _=b*Math.PI/180;return [x(n+f*Math.cos(_)),x(o+f*Math.sin(_))]},p=`${x(n)} ${x(o)}`,h=b=>J((b%360+360)%360,4),g=u.length-1,y=u.map(([b,_],w)=>{let R=va(a,(b+_)/2),S=(_-b)*360,$=l&&w===0&&g>0?S:0,M=l&&w<g?S:0,C=m+b*360-$,A=m+_*360+M,[v,L]=d(C),[F,k]=d(A);return {d:`M${p}L${v} ${L}L${F} ${k}Z`,color:Nc(R),...l||R.a>=1?{}:{opacity:J(R.a,3)},from:h(C),sweep:J(A-C,4)}});return l&&i<1?{wedges:y,opacity:J(i,3)}:{wedges:y}}function kc(t,e,n,o){return (Math.atan2(o-e,n-t)*180/Math.PI%360+360)%360}function Bc(t,e,n){if(t>=n.x-1e-6&&t<=n.x+n.width+1e-6&&e>=n.y-1e-6&&e<=n.y+n.height+1e-6)return null;let r=[[n.x,n.y],[n.x+n.width,n.y],[n.x,n.y+n.height],[n.x+n.width,n.y+n.height]],a=kc(t,e,n.x+n.width/2,n.y+n.height/2),i=0,l=0;for(let[s,c]of r){let u=kc(t,e,s,c)-a;u>180?u-=360:u<=-180&&(u+=360),i=Math.min(i,u),l=Math.max(l,u);}return [a+i,a+l]}function Qc(t,e){let n=t[1]-t[0],o=e[1]-e[0];if(n>=360||o>=360)return true;let r=((e[0]-t[0])%360+360)%360;return r<=n||r+o>=360}function Ia(t,e){return t.slice().map((n,o)=>o<e.y||o>=e.y+e.h?n:n.map((r,a)=>a<e.x||a>=e.x+e.w?r:false))}function Uc(t,e=0){let n=[];return t.forEach((o,r)=>{let a=null;o.forEach((i,l)=>{if(!i&&a!==null){n.push(P`M${a+e} ${r+e}h${l-a}v1H${a+e}z`),a=null;return}if(l===o.length-1){if(!i)return;a===null?n.push(P`M${l+e},${r+e} h1v1H${l+e}z`):n.push(P`M${a+e},${r+e} h${l+1-a}v1H${a+e}z`);return}i&&a===null&&(a=l);});}),n.join("")}function lf(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}var cf=.9;function La(t,e){let{margin:n,pixelSize:o,pattern:r="circle",plain:a=false}=e;if(ml(r))return fl(t,{margin:n,pixelSize:o,pattern:r,scale:e.scale,plain:a});let i=Cr(e.scale,r),l=[],s=t.length,c=o*.45,u=a?()=>false:sa(s);return t.forEach((m,f)=>{m.forEach((d,p)=>{if(d&&(a||!lf(p,f,s))){let h=(p+.5+n)*o,g=(f+.5+n)*o,y=`${p}-${f}`,b=l.length;if(u(p,f)){l.push(E("rect",{height:x(o),width:x(o),x:x(h-o/2),y:x(g-o/2)},y));return}switch(r){case "circle":l.push(E("circle",{cx:x(h),cy:x(g),r:x(c),transform:P`rotate(0,${h},${g})`},y));break;case "circle-large":{let _=o*.5;l.push(E("circle",{cx:x(h),cy:x(g),r:x(_),transform:P`rotate(0,${h},${g})`},y));}break;case "small-square":{let _=o*.357143;l.push(E("path",{d:P`M ${h-_} ${g-_}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:P`rotate(0,${h},${g})`},y));}break;case "diamond":{let _=o*.357143;l.push(E("path",{d:P`M ${h-_} ${g-_}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:P`rotate(45,${h},${g})`},y));}break;case "circle-mixed":{let _=(p+f)%3===0?cf:(p+f)%2===0?1:1.25,w=c*_;l.push(E("circle",{cx:x(h),cy:x(g),r:x(w),transform:P`rotate(0,${h},${g})`},y));}break;case "pacman":{let _=o*.5,w=o*.357143;l.push(E("path",{d:P`M ${h-_} ${g-w}v ${o*.714286}h ${_}a ${_*.5} ${_*.5}, 0, 0, 0, 0 -${o*.714286}h -${_}v -${o*.714286}z`,transform:P`rotate(${(p+f)%2===0?0:90},${h},${g})`},y));}break;case "rounded":{let _=o*.5,w=o*.2;l.push(E("rect",{height:x(o),rx:x(w),ry:x(w),transform:P`rotate(0,${h},${g})`,width:x(o),x:x(h-_),y:x(g-_)},y));}break;case "square":{let _=o*.5;l.push(E("rect",{height:x(o),transform:P`rotate(0,${h},${g})`,width:x(o),x:x(h-_),y:x(g-_)},y));}break;case "vertical-line":{let _=o*.714286,w=o;l.push(E("path",{d:P`M ${h-o*.5} ${g-_*.5}v ${_}h ${w}v -${_}z`,transform:P`rotate(90,${h},${g})`},y));}break;default:l.push(E("circle",{cx:x(h),cy:x(g),r:x(c),transform:P`rotate(0,${h},${g})`},y));}if(i!==1&&l.length>b){let _=l.pop();l.push(E("g",{transform:P`translate(${h},${g}) scale(${x(i,6)}) translate(${-h},${-g})`,children:_},y));}}});}),l}function uf(t,e){let n=t*Math.PI/180,o=e/2,r=e/2,a=Math.sqrt(e*e+e*e)/2,i=o-a*Math.cos(n),l=r-a*Math.sin(n),s=o+a*Math.cos(n),c=r+a*Math.sin(n);return {x1:i,y1:l,x2:s,y2:c}}function Ta(t,e){return `${t}-${Oe(JSON.stringify(e))}`}function mf(t,e,n,o,r){let a=t;if(t===0)switch(r){case "top-left":a=0;break;case "top-right":a=90;break;case "bottom-left":a=270;break;default:a=0;}let i=a*Math.PI/180,l=e+o/2,s=n+o/2,c=Math.sqrt(o*o+o*o)/2,u=l-c*Math.cos(i),m=s-c*Math.sin(i),f=l+c*Math.cos(i),d=s+c*Math.sin(i);return {x1:u,y1:m,x2:f,y2:d}}function Wr(t,e){return e.map((n,o)=>{let{color:r,opacity:a}=zr(n.color);return E("stop",{offset:`${n.offset}%`,stopColor:r,stopOpacity:a},`${t}-stop-${o}`)})}function qc(t,e,n,o,r,a){let i=Dc(e.stops,e.angle??0,n,o,r),l=i.wedges.map((s,c)=>E("path",{d:s.d,"data-arc":`${s.from} ${s.sweep}`,fill:s.color,fillOpacity:s.opacity,shapeRendering:s.opacity===void 0?void 0:"crispEdges"},`${t}-w-${c}`));return E("pattern",{"data-qrdx-conic":`${x(n)} ${x(o)}`,height:x(a),id:t,patternUnits:"userSpaceOnUse",width:x(a),x:0,y:0,children:i.opacity===void 0?l:E("g",{opacity:i.opacity,children:l})},t)}function df(t="center"){let[e,n]=t.split("-"),o=t==="center"?"center":e,r=n??(e==="left"||e==="right"?e:"center");return {x:r==="left"?0:r==="right"?1:.5,y:o==="top"?0:o==="bottom"?1:.5}}var ff=["xMin","xMid","xMax"],hf=["YMin","YMid","YMax"];function Wc(t,e,n){let o=e.scale??1,r=e.fit==="tile",a=r?n/4*o:n,i=e.underlay?zr(e.underlay):null,l=r?a:n*o,s=df(e.position),c=r?0:s.x*(n-l),u=r?0:s.y*(n-l),m=r?"xMidYMid slice":`${ff[s.x*2]??"xMid"}${hf[s.y*2]??"YMid"} ${e.fit==="contain"?"meet":"slice"}`;return st("pattern",{height:x(a),id:t,patternUnits:"userSpaceOnUse",width:x(a),x:0,y:0,children:[i&&E("rect",{fill:i.color,fillOpacity:i.opacity,height:x(a),width:x(a),x:0,y:0}),E("image",{height:x(l),href:e.src,opacity:(e.opacity??1)<1?e.opacity:void 0,preserveAspectRatio:m,width:x(l),x:x(c),y:x(u)})]},t)}var Hc=(t,e)=>Ta("img",[t,e]);function pf(t,e,n,o,r,a,i){let l=Ot(t);if(l.type==="solid")return null;if(l.type==="image"){let c=Hc(l,i);return {id:c,element:Wc(c,l,i)}}let s=Ta(a,[l,e,n,o,r,...l.type==="angular"?[i]:[]]);if(l.type==="linear"){let c=l,u=c.angle??0,{x1:m,y1:f,x2:d,y2:p}=mf(u,e,n,o,r);return {id:s,element:E("linearGradient",{gradientUnits:"userSpaceOnUse",id:s,x1:x(m),x2:x(d),y1:x(f),y2:x(p),children:Wr(s,c.stops)},s)}}if(l.type==="radial"){let c=l,u=e+o/2,m=n+o/2,f=o/2*.97;return {id:s,element:E("radialGradient",{cx:x(u),cy:x(m),fx:x(u),fy:x(m),gradientUnits:"userSpaceOnUse",id:s,r:x(f),children:Wr(s,c.stops)},s)}}return l.type==="angular"?{id:s,element:qc(s,l,e+o/2,n+o/2,o*.75,i)}:null}function Fa(t,e,n){let o=Ot(t);if(o.type==="solid")return null;if(o.type==="image"){let a=Hc(o,e);return {id:a,element:Wc(a,o,e)}}let r=Ta(n,[o,e]);if(o.type==="linear"){let a=o,i=a.angle??0,{x1:l,y1:s,x2:c,y2:u}=uf(i,e);return {id:r,element:E("linearGradient",{gradientUnits:"userSpaceOnUse",id:r,x1:x(l),x2:x(c),y1:x(s),y2:x(u),children:Wr(r,a.stops)},r)}}if(o.type==="radial"){let a=o,i=e/2,l=e/2,s=e/2*.97;return {id:r,element:E("radialGradient",{cx:x(i),cy:x(l),fx:x(i),fy:x(l),gradientUnits:"userSpaceOnUse",id:r,r:x(s),children:Wr(r,a.stops)},r)}}return o.type==="angular"?{id:r,element:qc(r,o,e/2,e/2,e*.75,e)}:null}var qr=t=>nn(t)||$o(t);function Gc(t){let e=new Set,n=[];for(let o of t)o&&!e.has(o.id)&&(e.add(o.id),n.push(o.element));return n}function le(t,e,n){if(e)return {fill:`url(#${e})`};let o=Ot(t,n),r=o.type==="solid"?o.color:o.type==="image"?o.underlay??n:n,{color:a,opacity:i}=zr(r);return i===void 0?{fill:a}:{fill:a,fillOpacity:i}}function xe(t,e,n,o){if(o==null)return null;let r=t.length,a=Math.floor(e*ir),i=(r+2*n)/e,l=(o.width||a)*i,s=(o.height||a)*i,c=o.x==null?r/2-l/2:o.x*i,u=o.y==null?r/2-s/2:o.y*i,m=null;if(o.excavate){let f=Math.max(0,o.padding??0)*i,d=Math.floor(c-f),p=Math.floor(u-f),h=Math.ceil(l+c+f-d),g=Math.ceil(s+u+f-p);m={x:d,y:p,w:h,h:g};}return {x:c,y:u,h:s,w:l,excavation:m}}function Nt(t){let e=t.level??Ht,{imageSettings:n}=t,o=t.isOGContext&&n?.excavate&&(e==="L"||e==="M")?"Q":e;if(t.autoLevel&&n&&o!=="H"){let r=yt.QrCode.encodeText(t.value,Rt[o]).getModules(),a=xe(r,t.size??ft,Lt(r.length,t.margin??xt,t.shape),n);a&&(a.excavation?a.excavation.w*a.excavation.h:a.w*a.h)/(r.length*r.length)>zo&&(o="H");}return o}function gf(t,e,n,o){let r=e/n,a=t.w*r,i=t.h*r,l=(t.x+o)*r,s=(t.y+o)*r;return {imgWidth:a,imgHeight:i,imgLeft:l,imgTop:s}}function ka(t){let{value:e,size:n=ft,level:o=Ht,bgColor:r=_t,fgColor:a=Mt,eyeColor:i,dotColor:l,bodyPattern:s="circle",cornerEyePattern:c="gear",cornerEyeDotPattern:u="circle",margin:m=xt,isOGContext:f=false,imageSettings:d,templateId:p,customTemplate:h,customProps:g,frame:y,art:b,eyeColors:_,moduleScale:w,autoLevel:R,shape:S,frameLabelMarkers:$,partMarkers:M,...C}=t,A=Br({value:e,size:n,margin:m,level:o,shape:S,autoLevel:R,isOGContext:f},d),v=kt(y),L=v?{}:C,F=it=>v?Lr(it,{size:n,frame:y,bgColor:r,svgProps:C,markLabels:$}):it,k=Nt({value:e,size:n,level:o,margin:m,imageSettings:A,isOGContext:f,autoLevel:R,shape:S}),O=yt.QrCode.encodeText(e,Rt[k]),I=O.getModules(),Q=Lt(I.length,m,S),W=Jl(e,I.length,m,S),D=(it,Ft)=>Ma(M,it,Ft),z=(it,Ft)=>{let Wt=$a(S,it);return Wt?"circle"in Wt?E("circle",{cx:x(it/2),cy:x(it/2),...Ft,r:x(it/2),...D("background")}):E("path",{d:Wt.path,...Ft,...D("background")}):E("rect",{...Ft,height:it,width:it,x:0,y:0,...D("background")})},et=I.length+Q*2,bt=xe(I,n,Q,A),lt=null;if(A!=null&&bt!=null){bt.excavation!=null&&(I=Ia(I,bt.excavation));let{imgWidth:it,imgHeight:Ft,imgLeft:Wt,imgTop:Je}=gf(bt,n,et,Q);if(f){let tn=A.shape??"square";lt=E("img",{alt:"Logo",src:A.src,style:{position:"absolute",left:`${x(Wt)}px`,top:`${x(Je)}px`,width:`${x(it)}px`,height:`${x(Ft)}px`,...tn!=="square"&&{borderRadius:tn==="circle"?"50%":`${x(Math.min(it,Ft)*kr)}px`},...A.plate&&{backgroundColor:A.plate,padding:`${x(it*Nr)}px`,boxSizing:"border-box"}}});}else lt=Or(A,{x:Wt,y:Je,w:it,h:Ft}),M&&(lt=dn(lt,D("logo")));}let N=n/et,U=I.length,q=7*N,Ct=1.5*N,Re={fgColor:wt(a,Mt),bgColor:wt(r,_t)},Tt=Jo(b)?ra({art:b,modules:I,version:O.version,margin:Q,pixelSize:N,...Re,body:it=>La(it,{margin:Q,pixelSize:N,pattern:s,scale:w})}):null,ee=Tt&&M?dn(Tt,D("body")):Tt,Ee=Tt&&b?ia({art:b,version:O.version,...Re}):null,G=Tt?null:La(I,{margin:Q,pixelSize:N,pattern:s,scale:w}),nt=W?La(W,{margin:0,pixelSize:N,pattern:s,scale:w,plain:true}):null,Z=Ot(r,_t),pt=Ot(a,Mt),Pn=qr(Z)?Fa(Z,n,"bg-color"):null,mo=qr(pt)?Fa(pt,n,"fg-color"):null,b0=le(r,Pn?.id??null,_t),Si=le(a,mo?.id??null,Mt),wi=ee?st(Jt,{children:[ee,nt&&E("g",{...Si,...D("body"),children:nt})]}):st("g",{...Si,...D("body"),children:[G,nt]}),qe=Q*N,We=Q*N,He=(U-7+Q)*N,Ve=Q*N,je=Q*N,Ze=(U-7+Q)*N,Ae=wt(a,Mt),Xe=it=>_?.[it]?.outer??Ee?.[it]?.outer??i,Ye=it=>_?.[it]?.inner??Ee?.[it]?.inner??l,Ke=(it,Ft,Wt,Je,tn)=>{let _o=Ot(it,Ae);return qr(_o)?pf(_o,Ft,Wt,q,Je,tn,n):null},fo=Ke(Xe("topLeft"),qe,We,"top-left","corners-square-color-0-0"),ho=Ke(Xe("topRight"),He,Ve,"top-right","corners-square-color-1-0"),po=Ke(Xe("bottomLeft"),je,Ze,"bottom-left","corners-square-color-0-1"),go=Ke(Ye("topLeft"),qe,We,"top-left","corners-dot-color-0-0"),bo=Ke(Ye("topRight"),He,Ve,"top-right","corners-dot-color-1-0"),yo=Ke(Ye("bottomLeft"),je,Ze,"bottom-left","corners-dot-color-0-1"),Ci=le(Xe("topLeft"),fo?.id??null,Ae),Mi=le(Xe("topRight"),ho?.id??null,Ae),Ri=le(Xe("bottomLeft"),po?.id??null,Ae),Ei=le(Ye("topLeft"),go?.id??null,Ae),Ai=le(Ye("topRight"),bo?.id??null,Ae),Pi=le(Ye("bottomLeft"),yo?.id??null,Ae),vi=Tr(qe,We,q,c,"top-left"),Li=Ir(qe+q/2,We+q/2,Ct,u,"top-left"),Fi=Tr(He,Ve,q,c,"top-right"),Ii=Ir(He+q/2,Ve+q/2,Ct,u,"top-right"),Ti=Tr(je,Ze,q,c,"bottom-left"),ki=Ir(je+q/2,Ze+q/2,Ct,u,"bottom-left"),y0=st(Jt,{children:[E("defs",{children:Gc([Pn,mo,fo,ho,po,go,bo,yo])}),z(n,b0),wi,E("g",{...Ci,...D("eye-outer","top-left"),children:E("path",{d:vi,fillRule:"evenodd",transform:P`rotate(0,${qe+q/2},${We+q/2})`})}),E("g",{...Ei,...D("eye-centre","top-left"),children:Li}),E("g",{...Mi,...D("eye-outer","top-right"),children:E("path",{d:Fi,fillRule:"evenodd",transform:P`rotate(0,${He+q/2},${Ve+q/2})`})}),E("g",{...Ai,...D("eye-centre","top-right"),children:Ii}),E("g",{...Ri,...D("eye-outer","bottom-left"),children:E("path",{d:Ti,fillRule:"evenodd",transform:P`rotate(0,${je+q/2},${Ze+q/2})`})}),E("g",{...Pi,...D("eye-centre","bottom-left"),children:ki}),lt]}),Ni=h||(p?Gr(p):void 0);if(Ni){let Ft=qr(Z)?Fa(Z,300,"bg-color-template"):null,Wt=le(r,Ft?.id??null,_t),Je=st("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[E("defs",{children:Gc([Ft,mo,fo,ho,po,go,bo,yo])}),z(300,Wt),st("g",{transform:`scale(${x(300/n,6)})`,children:[wi,E("g",{...Ci,...D("eye-outer","top-left"),children:E("path",{d:vi,fillRule:"evenodd",transform:P`rotate(0,${qe+q/2},${We+q/2})`})}),E("g",{...Ei,...D("eye-centre","top-left"),children:Li}),E("g",{...Mi,...D("eye-outer","top-right"),children:E("path",{d:Fi,fillRule:"evenodd",transform:P`rotate(0,${He+q/2},${Ve+q/2})`})}),E("g",{...Ai,...D("eye-centre","top-right"),children:Ii}),E("g",{...Ri,...D("eye-outer","bottom-left"),children:E("path",{d:Ti,fillRule:"evenodd",transform:P`rotate(0,${je+q/2},${Ze+q/2})`})}),E("g",{...Pi,...D("eye-centre","bottom-left"),children:ki}),lt]})]}),tn=300/n,_0={pixelSize:N*tn,url:e},Oi=Ni.wrapper(Je,{fgColor:a,bgColor:r,...g||{},...C},_0),x0={...Oi?.props?.style||{},width:void 0,height:void 0,...L.style};return F(dn(Oi,{...L,width:n,height:n,style:x0}))}return F(E("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...L,children:y0}))}var Fy=(()=>{try{new Path2D().addPath(new Path2D);}catch{return false}return true})(),Iy=t=>{let e=t.trim().replace(/^#/,"");e.length===3||e.length===4?e=e.slice(0,3).split("").map(o=>o+o).join(""):e.length===8&&(e=e.slice(0,6));let n=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:Number.parseInt(n[1],16),g:Number.parseInt(n[2],16),b:Number.parseInt(n[3],16)}:null},Sn=(t,e,n)=>{let[o,r,a]=[t,e,n].map(i=>(i/=255,i<=.03928?i/12.92:((i+.055)/1.055)**2.4));return .2126*o+.7152*r+.0722*a},zc=t=>{let e=dt(t);if(!e)return null;let n=o=>o*e.a+255*(1-e.a);return {r:n(e.r),g:n(e.g),b:n(e.b)}},Ty=(t,e)=>{let n=zc(t),o=zc(e);if(!(n&&o))return 1;let r=Sn(n.r,n.g,n.b),a=Sn(o.r,o.g,o.b),i=Math.max(r,a),l=Math.min(r,a);return (i+.05)/(l+.05)},ky=t=>t>=7?{level:"AAA",warning:false,message:"Excellent contrast"}:t>=4.5?{level:"AA",warning:false,message:"Good contrast"}:t>=3?{level:"AA Large",warning:true,message:"Low contrast - may be difficult to scan"}:{level:"Fail",warning:true,message:"Poor contrast - QR code may not scan properly"};var bf=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),yf=new Map([["className","class"],["tabIndex","tabindex"],["dir","dir"],["role","role"],["viewBox","viewBox"],["width","width"],["height","height"],["xlinkActuate","xlink:actuate"],["xlinkArcrole","xlink:arcrole"],["xlinkRole","xlink:role"],["xlinkShow","xlink:show"],["xlinkTitle","xlink:title"],["xlinkType","xlink:type"],["xmlBase","xml:base"],["xmlLang","xml:lang"],["xmlSpace","xml:space"]]),_f=new Set(["children","dangerouslySetInnerHTML","key","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","ref"]),xf=new Set(["inert","allowFullScreen","async","autoPlay","controls","credentialless","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"]),$f=new Set(["autoFocus","multiple","muted"]),Sf=new Set(["contentEditable","spellCheck","draggable","value","autoReverse","externalResourcesRequired","focusable","preserveAlpha"]),wf=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" ")),Vc=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",Cf=new RegExp(`^[${Vc}][${Vc}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Hr=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,Mf=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i,Rf="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')",Ef=t=>Mf.test(t)?Rf:t,Zc=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Af=/["'&<>]/;function Na(t){if(!Af.test(t))return t;let e="",n=0;for(let o=0;o<t.length;o++){let r;switch(t.charCodeAt(o)){case 34:r="&quot;";break;case 38:r="&amp;";break;case 39:r="&#x27;";break;case 60:r="&lt;";break;case 62:r="&gt;";break;default:continue}e+=t.slice(n,o)+r,n=o+1;}return e+t.slice(n)}var ce=t=>typeof t=="function"||typeof t=="symbol",jc=new Map,Pf=t=>{let e=jc.get(t);return e===void 0&&(e=t.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^ms-/,"-ms-"),jc.set(t,e)),e};function vf(t){if(typeof t=="string")return t;if(typeof t!="object"||t===null)return "";let e="";for(let n of Object.keys(t)){let o=t[n];if(o==null||typeof o=="boolean"||o==="")continue;let r;if(n.startsWith("--"))r=`${n}:${`${o}`.trim()}`;else {let a=typeof o=="number"?o===0||wf.has(n)?`${o}`:`${o}px`:`${o}`.trim();r=`${Pf(n)}:${a}`;}e=e?`${e};${r}`:r;}return e}function wn(t,e){if(e==null||_f.has(t))return null;let n=yf.get(t);if(n!==void 0)return ce(e)||typeof e=="boolean"?null:{name:n,value:`${e}`};switch(t){case "style":{let r=vf(e);return r?{name:"style",value:r}:null}case "src":case "href":case "action":case "formAction":case "xlinkHref":return (t==="src"||t==="href")&&e===""||ce(e)||typeof e=="boolean"?null:{name:t==="xlinkHref"?"xlink:href":t,value:Ef(`${e}`)};case "capture":case "download":return e===true?{name:t,value:""}:e===false||ce(e)?null:{name:t,value:`${e}`};case "cols":case "rows":case "size":case "span":return ce(e)||Number.isNaN(Number(e))||!(e>=1)?null:{name:t,value:`${e}`};case "rowSpan":case "start":return ce(e)||Number.isNaN(Number(e))?null:{name:t,value:`${e}`};}if($f.has(t))return e&&!ce(e)?{name:t.toLowerCase(),value:""}:null;if(Sf.has(t))return ce(e)?null:{name:t,value:`${e}`};if(xf.has(t))return e&&!ce(e)?{name:t,value:""}:null;if(t.length>2&&(t[0]==="o"||t[0]==="O")&&(t[1]==="n"||t[1]==="N"))return null;let o=bf.get(t)??t;if(!Cf.test(o)||ce(e))return null;if(typeof e=="boolean"){let r=o.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-")return null}return {name:o,value:`${e}`}}var Xc="http://www.w3.org/2000/svg",Yc="http://www.w3.org/1999/xhtml",Lf="http://www.w3.org/1999/xlink",Ff="http://www.w3.org/XML/1998/namespace",If="http://www.w3.org/2000/xmlns/";function Tf(t,e,n){e==="xmlns"||e.startsWith("xmlns:")?t.setAttributeNS(If,e,n):e.startsWith("xlink:")?t.setAttributeNS(Lf,e,n):e.startsWith("xml:")?t.setAttributeNS(Ff,e,n):t.setAttribute(e,n);}function Yn(t,e,n,o){if(e==null||typeof e=="boolean")return;if(typeof e=="string"||typeof e=="number"||typeof e=="bigint"){t.appendChild(o.createTextNode(`${e}`));return}if(Array.isArray(e)){for(let s of e)Yn(t,s,n,o);return}if(!Ie(e))throw new TypeError("qrdx: can't render this value as DOM nodes");let{type:r,props:a}=e;if(fn(r)){Yn(t,a.children,n,o);return}if(typeof r=="function"){Yn(t,r(a),n,o);return}if(!Hr.test(r))throw new TypeError(`qrdx: invalid element name: ${r}`);let i=r==="svg"?Xc:n,l=o.createElementNS(i,r);for(let s of Object.keys(a)){let c=wn(s,a[s]);c&&Tf(l,c.name,c.value);}Yn(l,a.children,i===Xc&&r==="foreignObject"?Yc:i,o),t.appendChild(l);}function Oa(t,e=document){let n=e.createDocumentFragment();return Yn(n,t,Yc,e),n}function Ge(t){if(t==null||typeof t=="boolean")return "";if(typeof t=="string")return Na(t);if(typeof t=="number"||typeof t=="bigint")return `${t}`;if(Array.isArray(t)){let e="";for(let n of t)e+=Ge(n);return e}if(!Ie(t))throw new TypeError("qrdx: can't render this value as SVG markup");return kf(t)}function kf(t){let{type:e,props:n}=t;if(fn(e))return Ge(n.children);if(typeof e=="function")return Ge(e(n));if(!Hr.test(e))throw new TypeError(`qrdx: invalid element name: ${e}`);let o=`<${e}`;for(let i of Object.keys(n)){let l=wn(i,n[i]);l&&(o+=` ${l.name}="${Na(l.value)}"`);}if(Zc.has(e))return `${o}/>`;let r=n.dangerouslySetInnerHTML?.__html,a=r==null?Ge(n.children):`${r}`;return `${o}>${a}</${e}>`}function Da(t){return Ge(ka(t))}function Nf(t,e=document){return Oa(ka(t),e).firstChild}var Of=16384;var Ba=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Df=8,Qa=class{buffer;position=0;bits=0;used=0;constructor(e){this.buffer=new Uint8Array(Math.max(e,64));}write(e,n){if(n!==0)for(this.bits|=e<<this.used,this.used+=n;this.used>=8;){if(this.position===this.buffer.length){let o=new Uint8Array(this.buffer.length*2);o.set(this.buffer),this.buffer=o;}this.buffer[this.position++]=this.bits&255,this.bits>>>=8,this.used-=8;}}finish(){return this.used>0&&this.write(0,8-this.used),this.buffer.subarray(0,this.position)}};function ru(t,e){let n=new Uint8Array(t.length),o=[];for(let c=0;c<t.length;c++)(t[c]??0)>0&&o.push(c);if(o.length===0)return n;if(o.length===1)return n[o[0]]=1,n;let r=o.length,a=2*r-1,i=new Float64Array(a),l=new Int32Array(a),s=new Uint8Array(a);for(let c=1;;c*=2){for(let h=0;h<r;h++)i[h]=Math.max(t[o[h]]??0,c);let u=Array.from({length:r},(h,g)=>g).sort((h,g)=>i[h]-i[g]||h-g),m=0,f=r,d=h=>m<r&&(f>=h||i[u[m]]<=i[f])?u[m++]:f++;for(let h=r;h<a;h++){let g=d(h),y=d(h);i[h]=i[g]+i[y],l[g]=h,l[y]=h;}s[a-1]=0;let p=0;for(let h=a-2;h>=0;h--){let g=s[l[h]]+1;s[h]=g,h<r&&g>p&&(p=g);}if(p<=e){for(let h=0;h<r;h++)n[o[h]]=s[h];return n}}}function Bf(t,e){let n=0;for(let o=0;o<e;o++)n=n<<1|t>>o&1;return n}function ou(t){let e=new Uint16Array(16),n=0;for(let l of t)l>0&&(e[l]=e[l]+1,n++);let o=new Uint16Array(16),r=0;for(let l=1;l<=15;l++)r=r+e[l-1]<<1,o[l]=r;let a=new Uint16Array(t.length),i=new Uint8Array(t.length);return t.forEach((l,s)=>{if(l===0)return;let c=o[l];o[l]=c+1,a[s]=Bf(c,l),i[s]=n===1?0:l;}),{lengths:t,codes:a,emitted:i}}function ze(t,e,n){t.write(e.codes[n],e.emitted[n]);}function Qf(t){let e=[],n=a=>e.push({code:a,extra:0,extraBits:0}),o=Df,r=0;for(;r<t.length;){let a=t[r],i=1;for(;r+i<t.length&&t[r+i]===a;)i++;r+=i;let l=i;if(a===0){for(;l>0;)if(l<3)for(;l>0;l--)n(0);else if(l<=10)e.push({code:17,extra:l-3,extraBits:3}),l=0;else {let s=Math.min(l,138);e.push({code:18,extra:s-11,extraBits:7}),l-=s;}continue}for(a!==o&&(n(a),o=a,l--);l>0;)if(l<3)for(;l>0;l--)n(a);else {let s=Math.min(l,6);e.push({code:16,extra:s-3,extraBits:2}),l-=s;}}return e}function Gf(t,e){let n=[];if(e.forEach((l,s)=>{l>0&&n.push(s);}),n.length<=2&&n.every(l=>l<256)){let[l=0,s]=n;t.write(1,1),t.write(n.length===2?1:0,1),l<2?(t.write(0,1),t.write(l,1)):(t.write(1,1),t.write(l,8)),s!==void 0&&t.write(s,8);return}let o=Qf(e),r=new Uint32Array(19);for(let l of o)r[l.code]=r[l.code]+1;let a=ou(ru(r,7)),i=Ba.length;for(;i>4&&a.lengths[Ba[i-1]]===0;)i--;t.write(0,1),t.write(i-4,4);for(let l=0;l<i;l++)t.write(a.lengths[Ba[l]],3);t.write(0,1);for(let l of o)ze(t,a,l.code),t.write(l.extra,l.extraBits);}function Vr(t){let e=t-1;if(e<4)return {symbol:e,extra:0,extraBits:0};let n=31-Math.clz32(e),o=e>>n-1&1,r=n-1;return {symbol:2*n+o,extra:e&(1<<r)-1,extraBits:r}}function Kc(t,e,n,o){let r=0;for(;r<o&&t[e+r]===t[e+r-n];)r++;return r}function Jc(t,e,n){let o=t.length,r=0;for(;r<o;){let a=Math.min(4096,o-r),i=r>=1?Kc(t,r,1,a):0,l=r>=e?Kc(t,r,e,a):0;if(Math.max(i,l)>=3){l>=i?(n.copy(l,e===1?2:1),r+=l):(n.copy(i,2),r+=i);continue}n.literal(t[r]),r++;}}var tu=20;function eu(t,e,n){for(let o=0;o<n.length;o++)t[e+o]=n.charCodeAt(o);}function nu(t,e,n){t[e]=n&255,t[e+1]=n>>>8&255,t[e+2]=n>>>16&255,t[e+3]=n>>>24&255;}function za(t,e,n){if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>16384||n>16384)throw new RangeError(`WebP images are 1 to 16384 pixels wide and high (got ${e} \xD7 ${n})`);let o=e*n;if(t.length<o*4)throw new RangeError(`Expected ${o*4} bytes of RGBA for ${e} \xD7 ${n}, got ${t.length}`);let r=new Uint32Array(o),a=false;for(let R=0;R<o;R++){let S=R*4,$=t[S],M=t[S+1],C=t[S+2],A=t[S+3];A!==255&&(a=true),r[R]=(A<<24|($-M&255)<<16|M<<8|C-M&255)>>>0;}let i=new Uint32Array(280),l=new Uint32Array(256),s=new Uint32Array(256),c=new Uint32Array(256),u=new Uint32Array(40);Jc(r,e,{literal(R){i[R>>>8&255]++,l[R>>>16&255]++,s[R&255]++,c[R>>>24]++;},copy(R,S){i[256+Vr(R).symbol]++,u[Vr(S).symbol]++;}});let m=[i,l,s,c,u].map(R=>ru(R,15)),[f,d,p,h,g]=m.map(ou),y=new Qa(Math.ceil(o/4)+1024);y.write(47,8),y.write(e-1,14),y.write(n-1,14),y.write(a?1:0,1),y.write(0,3),y.write(1,1),y.write(2,2),y.write(0,1),y.write(0,1),y.write(0,1);for(let R of m)Gf(y,R);Jc(r,e,{literal(R){ze(y,f,R>>>8&255),ze(y,d,R>>>16&255),ze(y,p,R&255),ze(y,h,R>>>24);},copy(R,S){let $=Vr(R);ze(y,f,256+$.symbol),y.write($.extra,$.extraBits);let M=Vr(S);ze(y,g,M.symbol),y.write(M.extra,M.extraBits);}});let b=y.finish(),_=b.length+(b.length&1),w=new Uint8Array(tu+_);return eu(w,0,"RIFF"),nu(w,4,w.length-8),eu(w,8,"WEBPVP8L"),nu(w,16,b.length),w.set(b,tu),w}function Ga(t,e,n){return String.fromCharCode(...t.subarray(e,e+n))}function au(t){return t.length>=12&&Ga(t,0,4)==="RIFF"&&Ga(t,8,4)==="WEBP"}function Ua(t){if(!au(t))return null;let e=12;for(;e+8<=t.length;){let n=Ga(t,e,4);if(n==="VP8L")return "lossless";if(n==="VP8 ")return "lossy";let o=(t[e+4]|t[e+5]<<8|t[e+6]<<16|t[e+7]<<24)>>>0;e+=8+o+(o&1);}return null}function zf(t,e,n){return typeof t.toBlob!="function"?Promise.resolve(null):new Promise(o=>{try{t.toBlob(o,e,n);}catch{o(null);}})}async function jr(t,e={}){let n=e.quality!==void 0,o=n?Math.min(1,Math.max(0,Number(e.quality))):1,r=await zf(t,"image/webp",o);if(r){let s=new Uint8Array(await r.arrayBuffer()),c=Ua(s);if(c==="lossless"||n&&c==="lossy")return new Blob([s],{type:"image/webp"})}let a=t.getContext("2d");if(!a)throw new Error("Could not get canvas context");let{data:i}=a.getImageData(0,0,t.width,t.height),l=za(i,t.width,t.height);return new Blob([l],{type:"image/webp"})}var iu=32768;async function Kn(t){let e=new Uint8Array(await t.arrayBuffer()),n="";for(let o=0;o<e.length;o+=iu)n+=String.fromCharCode(...e.subarray(o,o+iu));return `data:${t.type||"application/octet-stream"};base64,${btoa(n)}`}async function zt(t){let e={...t};if(t.imageSettings?.src)try{let u=await Uf(t.imageSettings.src);e={...t,imageSettings:{...t.imageSettings,src:u}};}catch{let{imageSettings:u,...m}=t;e=m;}let{hideLogo:n,url:o,logo:r,scale:a,frameLabelMarkers:i,partMarkers:l,...s}=e,c=Da({...s,templateId:e.templateId,customTemplate:e.customTemplate});return `data:image/svg+xml,${encodeURIComponent(c)}`}var Uf=t=>new Promise((e,n)=>{if(t.startsWith("data:")){e(t);return}let o=new Image;o.crossOrigin="anonymous",o.onload=()=>{try{let r=document.createElement("canvas");r.width=o.naturalWidth||o.width,r.height=o.naturalHeight||o.height;let a=r.getContext("2d");if(!a){n(new Error("Could not get canvas context"));return}a.drawImage(o,0,0);let i=r.toDataURL("image/png");r.remove(),e(i);}catch(r){n(new Error(`Failed to convert image to base64: ${r}`));}},o.onerror=()=>{n(new Error(`Could not load image from ${t.slice(0,100)}... Check CORS settings or use a data URL.`));},o.src=t;});async function Cn(t,e,n){let o=await zt(t),r=decodeURIComponent(o.replace("data:image/svg+xml,","")),a;try{let i=new TextEncoder().encode(r),l=Array.from(i,c=>String.fromCharCode(c)).join("");a=`data:image/svg+xml;base64,${btoa(l)}`;}catch(i){throw new Error(`Failed to encode SVG for canvas conversion: ${i}`)}return new Promise((i,l)=>{let s=document.createElement("canvas"),c=s.getContext("2d");if(!c){l(new Error("Could not get canvas context"));return}let u=new Image,{width:m,height:f}=ie(t.size||ft,t.frame);s.width=Math.round(m),s.height=Math.round(f);let d=setTimeout(()=>{s.remove(),l(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);u.onload=()=>{clearTimeout(d);try{if(e==="image/jpeg"&&(c.fillStyle="white",c.fillRect(0,0,s.width,s.height)),c.drawImage(u,0,0,s.width,s.height),n)i(s);else if(e==="image/webp")jr(s).then(Kn).then(i,l).finally(()=>s.remove());else {let p=s.toDataURL(e,1);s.remove(),i(p);}}catch(p){clearTimeout(d),s.remove(),l(new Error(`Failed to draw SVG to canvas: ${p}`));}},u.onerror=()=>{clearTimeout(d),s.remove(),l(new Error("Could not load SVG"));},u.src=a;})}var su=["gradientUnits","gradientTransform","spreadMethod"],qf={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},Wf={r:0,g:0,b:0,a:1};function lu(t,e){for(let n of (t.attrs.style??"").split(";")){let[o,...r]=n.split(":");if(o?.trim()===e)return r.join(":").trim()}return t.attrs[e]}function qa(t){return t.name==="linearGradient"?"linear":t.name==="radialGradient"?"radial":null}function Hf(t){let e=[],n=0;for(let o of t.children){if(o.name!=="stop")continue;let r=(o.attrs.offset??"0").trim(),a=Number.parseFloat(r),i=Number.isFinite(a)?r.endsWith("%")?a/100:a:0;n=Math.max(n,Math.min(Math.max(i,0),1));let l=lu(o,"stop-color")??"#000000",s=dt(l==="currentColor"?"#000000":l)??Wf,c=Number.parseFloat(lu(o,"stop-opacity")??"1");e.push({offset:n,color:Number.isFinite(c)?{...s,a:s.a*Math.min(Math.max(c,0),1)}:s});}return e}function Zr(t){let e=new Map,n=r=>{let a=r.attrs.id;qa(r)&&a&&!e.has(a)&&e.set(a,r);for(let i of r.children)n(i);};n(t);let o=new Map;for(let[r,a]of e){let i=qa(a),l={},s=[],c=new Set,u=a;for(;u&&!c.has(u);){c.add(u);let m=qa(u)===i?[...su,...qf[i]]:su;for(let d of m){let p=u.attrs[d];l[d]===void 0&&p!==void 0&&(l[d]=p);}s.length===0&&(s=Hf(u));let f=u.attrs.href??u.attrs["xlink:href"];u=f?.startsWith("#")?e.get(f.slice(1)):void 0;}o.set(r,{kind:i,attrs:l,stops:s});}return o}function Wa(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(m,f)=>{e=Math.min(e,m),o=Math.max(o,m),n=Math.min(n,f),r=Math.max(r,f);},i=(m,f,d,p)=>{let h=-m+3*f-3*d+p,g=2*(m-2*f+d),y=f-m;if(Math.abs(h)<1e-12)return Math.abs(g)<1e-12?[]:[-y/g];let b=g*g-4*h*y;if(b<0)return [];let _=Math.sqrt(b);return [(-g+_)/(2*h),(-g-_)/(2*h)]},l=(m,f,d,p,h)=>{let g=1-m;return g*g*g*f+3*g*g*m*d+3*g*m*m*p+m**3*h},s=0,c=0,u=[0,0];for(let m of t)if(m.op==="M"&&(u=[m.x,m.y]),m.op==="M"||m.op==="L")a(m.x,m.y),s=m.x,c=m.y;else if(m.op==="C"){a(m.x,m.y);for(let f of [...i(s,m.x1,m.x2,m.x),...i(c,m.y1,m.y2,m.y)])f>0&&f<1&&a(l(f,s,m.x1,m.x2,m.x),l(f,c,m.y1,m.y2,m.y));s=m.x,c=m.y;}else [s,c]=u;return Number.isFinite(e)?{x:e,y:n,width:o-e,height:r-n}:null}var Vf=t=>t[0]*t[3]-t[1]*t[2];function Se(t){let e=Vf(t);if(!Number.isFinite(e)||Math.abs(e)<1e-12)return null;let[n,o,r,a,i,l]=t;return [a/e,-o/e,-r/e,n/e,(r*l-a*i)/e,(o*i-n*l)/e]}function uu(t,e,n){let{kind:o,attrs:r,stops:a}=t,i=a[0],l=a.at(-1);if(!(i&&l)||a.every(S=>S.color.a===0))return null;if(a.length===1)return i.color;let s=r.gradientUnits==="userSpaceOnUse",c=an;if(!s){let S=Wa(e);if(!S||S.width<=0||S.height<=0)return null;c=[S.width,0,0,S.height,S.x,S.y];}let u=ut(c,Dt(r.gradientTransform));if(!Se(u))return l.color;let[m,f]=n,d=Math.sqrt((m*m+f*f)/2),p=(S,$)=>{let M=Number.parseFloat(S);return Number.isFinite(M)?S.trim().endsWith("%")?M/100*(s?$:1):M:null},h=(S,$,M)=>p(r[S]??$,M)??p($,M)??0;if(o==="linear"){let S=[h("x1","0%",m),h("y1","0%",f),h("x2","100%",m),h("y2","0%",f)],[$,M,C,A]=S;return $===C&&M===A?l.color:{kind:o,coords:S,matrix:u,stops:a}}let g=h("cx","50%",m),y=h("cy","50%",f),b=h("r","50%",d),_=r.fx===void 0?g:h("fx","50%",m),w=r.fy===void 0?y:h("fy","50%",f),R=Math.max(0,h("fr","0%",d));return b<0?null:b===0?l.color:{kind:o,coords:[_,w,R,g,y,b],matrix:u,stops:a}}function Xr(t){return t.map(e=>x(e,6)).join(" ")}function jf(t,e){return (e==="cmyk"?ge(t.r,t.g,t.b):[t.r/255,t.g/255,t.b/255]).map(o=>x(o,4)).join(" ")}var cu=(t,e)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${t}] /C1 [${e}] /N 1 >>`;function Zf(t,e){let n=[],o=t.map(l=>J(l.offset,4)),r=t.map(l=>jf(l.color,e)),a=o[0],i=o.at(-1);if(a>0){let l=r[0];n.push({from:0,to:a,c0:l,c1:l});}for(let l=0;l+1<t.length;l++){let s=o[l],c=o[l+1];c>s&&n.push({from:s,to:c,c0:r[l],c1:r[l+1]});}if(i<1){let l=r.at(-1);n.push({from:i,to:1,c0:l,c1:l});}if(n.length===1){let[l]=n;return cu(l.c0,l.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${n.map(l=>cu(l.c0,l.c1)).join(" ")}]`,`/Bounds [${n.slice(1).map(l=>x(l.from,4)).join(" ")}]`,`/Encode [${n.map(()=>"0 1").join(" ")}] >>`].join(" ")}function Yr(t,e){return [`<< /ShadingType ${t.kind==="linear"?2:3}`,`/ColorSpace /Device${e==="cmyk"?"CMYK":"RGB"}`,`/Coords [${t.coords.map(n=>x(n,6)).join(" ")}]`,`/Function ${Zf(t.stops,e)}`,"/Extend [true true] >>"].join(" ")}function Xf(t,e){if(t.op==="Z")return t;if(t.op==="C"){let[r,a]=H(e,t.x1,t.y1),[i,l]=H(e,t.x2,t.y2),[s,c]=H(e,t.x,t.y);return {op:"C",x1:r,y1:a,x2:i,y2:l,x:s,y:c}}let[n,o]=H(e,t.x,t.y);return {op:t.op,x:n,y:o}}var mu={r:255,g:255,b:255,a:1},Yf=/^url\(\s*#bg-color-/,Kr=/^url\(\s*#([^)\s]+)\s*\)/,Kf=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function K(t,e){let n=t.attrs.style;if(n)for(let o of n.split(";")){let[r,...a]=o.split(":");if(r?.trim()===e)return a.join(":").trim()}return t.attrs[e]}function j(t,e,n=0){if(t===void 0||t==="")return n;let o=Number.parseFloat(t);return Number.isNaN(o)?n:t.trim().endsWith("%")?o/100*e:o}function Jn(t,e){if((t.name==="linearGradient"||t.name==="radialGradient")&&t.attrs.id){let n=t.children.find(r=>r.name==="stop"),o=n&&(K(n,"stop-color")??"#000000");o&&e.set(t.attrs.id,o);}for(let n of t.children)Jn(n,e);return e}function tr(t,e){if(t.name==="image"){let n=t.attrs.href??t.attrs["xlink:href"];n&&e.add(n);}for(let n of t.children)tr(n,e);return e}function Jr(t){return /^data:image\/png[;,]/i.test(t)?"PNG":/^data:image\/jpe?g[;,]/i.test(t)?"JPEG":null}async function to(t){return typeof document>"u"||typeof Image>"u"?null:await new Promise(e=>{let n=new Image;n.crossOrigin="anonymous",n.onload=()=>{let o=document.createElement("canvas"),r=Math.max(n.naturalWidth||512,n.naturalHeight||512),a=Math.min(1024/r,4);o.width=Math.round((n.naturalWidth||512)*a),o.height=Math.round((n.naturalHeight||512)*a);let i=o.getContext("2d");if(!i){e(null);return}i.drawImage(n,0,0,o.width,o.height);try{e(o.toDataURL("image/png"));}catch{e(null);}},n.onerror=()=>e(null),n.src=t;})}function du(t,e,n){let o={x:j(t.attrs.x,e[0]),y:j(t.attrs.y,e[1]),width:j(t.attrs.width,e[0]),height:j(t.attrs.height,e[1])};if(o.width<=0||o.height<=0)return null;let r=(t.attrs.preserveAspectRatio??"").trim();if(!r||r.startsWith("none")||!n||!(n.width>0&&n.height>0))return {draw:o,clip:null};let[a="xMidYMid",i="meet"]=r.split(/\s+/),l=i==="slice",s=(l?Math.max:Math.min)(o.width/n.width,o.height/n.height),c=n.width*s,u=n.height*s,m=f=>{let d=f==="x"?a.slice(0,4):a.slice(4);return d.endsWith("Min")?0:d.endsWith("Max")?1:.5};return {draw:{x:o.x+(o.width-c)*m("x"),y:o.y+(o.height-u)*m("y"),width:c,height:u},clip:l?o:null}}function fu(t,e){t.name==="clipPath"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)fu(n,e);return e}function hu(t,e){t.name==="pattern"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)hu(n,e);return e}function Jf(t,e){let[n,o]=e,r=(a,i)=>j(t.attrs[a],i);switch(t.name){case "path":return oe(t.attrs.d??"");case "rect":{let a=t.attrs.rx??t.attrs.ry,i=t.attrs.ry??t.attrs.rx;return Xt(r("x",n),r("y",o),r("width",n),r("height",o),j(a,n),j(i,o))}case "circle":{let a=r("r",Math.hypot(n,o)/Math.SQRT2);return Zt(r("cx",n),r("cy",o),a,a)}case "ellipse":return Zt(r("cx",n),r("cy",o),r("rx",n),r("ry",o));default:return []}}var Mn=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=mu;paper=mu;background=null;onPaper=false;inConic=false;constructor(e,n=null){this.gradients=e,this.shadings=n;}resolveColor(e){if(!e||e==="none")return null;let n=Kr.exec(e);if(n)return this.resolveColor(this.gradients.get(n[1]));let o=dt(e==="currentColor"?"#000000":e);return o&&o.a>0?o:null}shadedGradient(e){let n=e?Kr.exec(e)?.[1]:void 0;return n?this.shadings?.get(n):void 0}resolveFill(e,n,o,r=1){if(r<=0)return null;let a=this.patternOf(e);if(a)return {pattern:a,alpha:r};let i=this.shadedGradient(e);if(i){let c=uu(i,n,o);if(!c)return null;if("coords"in c)return {gradient:c,alpha:r};let u={...c,a:c.a*r};return u.a>0?{color:u}:null}let l=this.resolveColor(e);if(!l)return null;let s={...l,a:l.a*r};return s.a>0?{color:s}:null}patternOf(e){let n=e?Kr.exec(e)?.[1]:void 0,o=n?this.patterns.get(n):void 0;if(!(o?.attrs.patternUnits!=="userSpaceOnUse"||(o.attrs.patternContentUnits??"userSpaceOnUse")!=="userSpaceOnUse"||o.attrs.viewBox))return o}flatten(e){if(e.a>=1)return e;let n=this.background,o=n!==null&&Math.abs(n.r-e.r)<.5&&Math.abs(n.g-e.g)<.5&&Math.abs(n.b-e.b)<.5&&Math.abs(n.a-e.a)<.002;return Ur(e,this.onPaper||o?this.paper:this.backdrop)}paintPattern(e,n,o,r){let a=Wa(e);if(!a||a.width<=0||a.height<=0)return true;let[i,l]=n.viewport,s=j(o.attrs.x,i),c=j(o.attrs.y,l),u=j(o.attrs.width,i),m=j(o.attrs.height,l);if(!(u>0&&m>0))return true;let f=Dt(o.attrs.patternTransform),d=Se(f);if(!d)return true;if(!this.beginClip(e,n.matrix,n.fillRule==="evenodd"))return false;let p=this.inConic;this.inConic=o.attrs["data-qrdx-conic"]!==void 0;try{let h=[H(d,a.x,a.y),H(d,a.x+a.width,a.y),H(d,a.x,a.y+a.height),H(d,a.x+a.width,a.y+a.height)],g=h.map(([F])=>F),y=h.map(([,F])=>F),b=Math.min(...g),_=Math.max(...g),w=Math.min(...y),R=Math.max(...y),S=Math.floor((b-s)/u),$=Math.ceil((_-s)/u)-1,M=Math.floor((w-c)/m),C=Math.ceil((R-c)/m)-1,A=($-S+1)*(C-M+1);if(A>4096)return !0;let v=(o.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),L=ut(n.matrix,f);for(let F=M;F<=C;F++)for(let k=S;k<=$;k++){let O=s+k*u,I=c+F*m,Q=ut(L,[1,0,0,1,O,I]),W={x:b-O,y:w-I,width:_-b,height:R-w},D=v.length===2&&v.every(Number.isFinite)?Bc(v[0],v[1],W):null,z=A>1&&this.beginClip([{op:"M",x:0,y:0},{op:"L",x:u,y:0},{op:"L",x:u,y:m},{op:"L",x:0,y:m},{op:"Z"}],Q,!1);try{let et={matrix:Q,viewport:n.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:r},bt=(lt,N)=>{for(let U of lt){if(U.name==="g"&&!U.attrs.transform){let q=Number.parseFloat(U.attrs.opacity??"1");bt(U.children,{...N,opacity:(N.opacity??1)*(Number.isFinite(q)?q:1)});continue}if(D&&U.attrs["data-arc"]){let[q,Ct]=U.attrs["data-arc"].split(/\s+/).map(Number);if(!Qc([q,q+Ct],D))continue}this.walk(U,N);}};bt(o.children,et);}finally{z&&this.endClip();}}}finally{this.inConic=p,this.endClip();}return true}paintBleed(e,n,o,r){if(!this.shadedGradient(o))return false;let[a,i]=this.viewportMatrix({...e,attrs:{...e.attrs,x:"0",y:"0"}},{...n,matrix:ut(n.matrix,Dt(e.attrs.transform))}),l=Se(a);if(!l)return false;let[s,c,u,m]=r,d=[[s,c],[u,c],[u,m],[s,m]].map(([p,h])=>H(l,p,h)).map(([p,h],g)=>({op:g===0?"M":"L",x:p,y:h}));return d.push({op:"Z"}),this.paint(d,{name:"rect",attrs:{},children:[],text:""},{...n,matrix:a,viewport:i,fill:o,fillRule:"nonzero",stroke:"none"}),true}beginClip(e,n,o){return false}endClip(){}clipOf(e,n){let o=K(e,"clip-path"),r=o?Kr.exec(o)?.[1]:void 0,a=r?this.clipPaths.get(r):void 0;if(!a)return null;let i=[],l=false;for(let s of a.children){let c=Jf(s,n.viewport);if(c.length===0)continue;let u=Dt(s.attrs.transform),m=u[0]===1&&u[1]===0&&u[2]===0&&u[3]===1&&u[4]===0&&u[5]===0;i.push(...m?c:c.map(f=>Xf(f,u))),l||=K(s,"clip-rule")==="evenodd";}return i.length>0?{segments:i,matrix:n.matrix,evenOdd:l}:null}viewportMatrix(e,n){let o=j(e.attrs.x,n.viewport[0]),r=j(e.attrs.y,n.viewport[1]),a=j(e.attrs.width,n.viewport[0],n.viewport[0]),i=j(e.attrs.height,n.viewport[1],n.viewport[1]),l=jt(e.attrs.viewBox);if(l.length!==4||!(l[2]&&l[3]))return [ut(n.matrix,[1,0,0,1,o,r]),[a,i]];let[s,c,u,m]=l,f=a/u,d=i/m,p=o,h=r;if((e.attrs.preserveAspectRatio??"").trim()!=="none"){let g=e.attrs.preserveAspectRatio?.includes("slice")?Math.max(f,d):Math.min(f,d);p+=(a-u*g)/2,h+=(i-m*g)/2,f=g,d=g;}return [ut(n.matrix,[f,0,0,d,p-s*f,h-c*d]),[u,m]]}walk(e,n,o=false){if(o&&(this.clipPaths=fu(e,new Map),this.patterns=hu(e,new Map)),Kf.has(e.name)||K(e,"display")==="none"||K(e,"visibility")==="hidden")return;let r=ut(n.matrix,Dt(e.attrs.transform)),a=n.viewport;if(e.name==="svg"){let[f,d]=this.viewportMatrix(o?{...e,attrs:{...e.attrs,x:"0",y:"0"}}:e,{...n,matrix:r});r=f,a=d;}let i=K(e,"font-size"),l=Number.parseFloat(K(e,"opacity")??"1"),s=K(e,"fill-opacity"),c=s===void 0?n.fillOpacity??1:Number.parseFloat(s),u={fillOpacity:Number.isFinite(c)?Math.min(Math.max(c,0),1):1,opacity:(n.opacity??1)*(Number.isFinite(l)?Math.min(Math.max(l,0),1):1),matrix:r,viewport:a,fill:K(e,"fill")??n.fill,fillRule:K(e,"fill-rule")??n.fillRule,stroke:K(e,"stroke")??n.stroke,strokeWidth:K(e,"stroke-width")===void 0?n.strokeWidth:j(K(e,"stroke-width"),a[0],1),fontSize:i===void 0?n.fontSize:j(i,16,16),fontWeight:K(e,"font-weight")??n.fontWeight,textAnchor:K(e,"text-anchor")??n.textAnchor},m=this.onPaper;(e.name==="rect"||e.name==="circle"||e.name==="path")&&Yf.test(K(e,"fill")??"")&&(this.onPaper=true);try{let f=e.attrs["clip-path"]?this.clipOf(e,u):null;if(f&&this.beginClip(f.segments,f.matrix,f.evenOdd)){try{this.paintNode(e,u);}finally{this.endClip();}return}this.paintNode(e,u);}finally{this.onPaper=m;}}paintNode(e,n){let[o,r]=n.viewport,a=(i,l)=>j(e.attrs[i],l);switch(e.name){case "path":this.paint(oe(e.attrs.d??""),e,n);return;case "rect":{let i=e.attrs.rx??e.attrs.ry,l=e.attrs.ry??e.attrs.rx;this.paint(Xt(a("x",o),a("y",r),a("width",o),a("height",r),j(i,o),j(l,r)),e,n);return}case "circle":{let i=a("r",Math.hypot(o,r)/Math.SQRT2);this.paint(Zt(a("cx",o),a("cy",r),i,i),e,n);return}case "ellipse":this.paint(Zt(a("cx",o),a("cy",r),a("rx",o),a("ry",r)),e,n);return;case "line":this.paint([{op:"M",x:a("x1",o),y:a("y1",r)},{op:"L",x:a("x2",o),y:a("y2",r)}],e,{...n,fill:"none"});return;case "polygon":case "polyline":{let i=jt(e.attrs.points),l=[];for(let s=0;s+1<i.length;s+=2)l.push({op:s===0?"M":"L",x:i[s],y:i[s+1]});e.name==="polygon"&&l.length>0&&l.push({op:"Z"}),this.paint(l,e,n);return}case "text":this.text(e,n);return;case "image":this.image(e,n);return;default:for(let i of e.children)this.walk(i,n);}}};var eo=1e3;async function er(t){let e=await zt(Ue({...t,size:t.size??ft},eo));return decodeURIComponent(e.replace("data:image/svg+xml,",""))}function Ha(t){if(kt(t.frame)){let e=De(eo,t.frame);return e.squareEdges?e.color:null}return wt(t.bgColor,_t)}function no(t,e){let n=Ha(t);if(!(n&&nn(t.bgColor))||kt(t.frame)||t.templateId||t.customTemplate)return n;let o=fe(e)?.children.find(a=>a.name==="rect"),r=o&&K(o,"fill");return r?.startsWith("url(")?r:n}function ro(t,e){let n={r:255,g:255,b:255,a:1},o=dt(wt(e.bgColor,_t));t.paper=n,t.background=o&&!nn(e.bgColor)?o:null,t.backdrop=o?Ur(o,n):n;}var oo=25.4,pu=5,gu=2e3,ue=eo,Va=5,bu=2,eh=.25*(oo/72);function nh(t,e="mm"){return e==="in"?t*oo:t}function rh(t){let e=Nt(t),n=yt.QrCode.encodeText(t.value,Rt[e]).size;return n+Lt(n,t.margin??xt,t.shape)*2}function ao(t,e){let n=nh(e.size,e.unit);if(!Number.isFinite(n)||n<pu||n>gu)throw new Error(`Print size must be between ${pu} mm and ${gu/1e3} m`);let o=Math.min(Math.max(e.bleed??0,0),20),r=n/ue,a=kt(t.frame)?De(ue,t.frame):null,i=(a?.width??ue)*r,l=(a?.height??ue)*r,s=e.cropMarks?o+bu+Va+1:o,c=rh(t);return {codeWidth:n,trimWidth:i,trimHeight:l,bleed:o,pageWidth:i+2*s,pageHeight:l+2*s,trimX:s,trimY:s,moduleSize:n/c,moduleCount:c,maxScanDistance:n*10}}var ja=class t{pdf;internals;names=new Map;constructor(e,n){this.pdf=e,this.internals=n;}static attach(e){let n=e.internal;return typeof e.advancedAPI!="function"||typeof e.addShadingPattern!="function"||typeof n.write!="function"||typeof n.events?.subscribe!="function"?null:new t(e,n)}name(e){let n=this.names.get(e);return n||(this.names.size===0&&this.install(),n=`Sh${this.names.size}`,this.names.set(e,n)),n}install(){this.pdf.advancedAPI(e=>{e.addShadingPattern("qrdx-shadings",{});}),this.internals.events.subscribe("putShadingPatternDict",()=>{for(let[e,n]of this.names)this.internals.write(`/${n} ${e}`);});}},Za=class extends Mn{pdf;cmyk;images;shadingResources;constructor(e,n,o,r,a){super(o,r?.gradients??null),this.pdf=e,this.cmyk=n,this.images=a,this.shadingResources=r?.resources??null;}setColor(e,n){let o=e==="fill"?this.pdf.setFillColor.bind(this.pdf):e==="draw"?this.pdf.setDrawColor.bind(this.pdf):this.pdf.setTextColor.bind(this.pdf);if(this.cmyk){let[r,a,i,l]=ge(n.r,n.g,n.b);o(r,a,i,l);}else o(Math.round(n.r),Math.round(n.g),Math.round(n.b));}setRegistrationColor(){this.cmyk?this.pdf.setDrawColor(1,1,1,1):this.pdf.setDrawColor(0,0,0);}tracePath(e,n){let o=false;for(let r of e)if(r.op==="M"){let[a,i]=H(n,r.x,r.y);this.pdf.moveTo(a,i),o=true;}else if(r.op==="L"){let[a,i]=H(n,r.x,r.y);o?this.pdf.lineTo(a,i):(this.pdf.moveTo(a,i),o=true);}else if(r.op==="C"){let[a,i]=H(n,r.x1,r.y1),[l,s]=H(n,r.x2,r.y2),[c,u]=H(n,r.x,r.y);this.pdf.curveTo(a,i,l,s,c,u);}else o&&this.pdf.close();}shade(e,n,o){let r=this.pdf.internal,a=r.scaleFactor,i=[a,0,0,-a,0,r.pageSize.getHeight()*a],l=ut(i,ut(n.matrix,o.matrix));if(!(this.shadingResources&&Se(l)))return;let s=this.shadingResources.name(Yr(o,this.cmyk?"cmyk":"rgb"));this.pdf.saveGraphicsState(),this.tracePath(e,n.matrix),this.pdf.clip(n.fillRule==="evenodd"?"evenodd":void 0),this.pdf.discardPath(),r.write(`${Xr(l)} cm /${s} sh`),this.pdf.restoreGraphicsState();}beginClip(e,n,o){return this.pdf.saveGraphicsState(),this.tracePath(e,n),this.pdf.clip(o?"evenodd":void 0),this.pdf.discardPath(),true}endClip(){this.pdf.restoreGraphicsState();}withAlpha(e,n,o){if(e>=1&&n>=1){o();return}this.pdf.saveGraphicsState();let r=this.pdf.GState;this.pdf.setGState(new r({opacity:e,"stroke-opacity":n}));try{o();}finally{this.pdf.restoreGraphicsState();}}opaqueGradient(e,n){let o=e.stops[0]?.color.a??1;return e.stops.every(a=>Math.abs(a.color.a-o)<.002)?{gradient:{...e,stops:e.stops.map(a=>({...a,color:{...a.color,a:1}}))},alpha:o*n}:{gradient:{...e,stops:e.stops.map(a=>({...a,color:this.flatten({...a.color,a:a.color.a*n})}))},alpha:1}}paint(e,n,o){if(e.length===0)return;let r=o.opacity??1;if(r<=0)return;let a=this.resolveFill(o.fill,e,o.viewport,(o.fillOpacity??1)*r);if(a&&"pattern"in a)this.paintPattern(e,o,a.pattern,a.alpha);else if(a&&"gradient"in a){let{gradient:m,alpha:f}=this.opaqueGradient(a.gradient,a.alpha);this.withAlpha(f,1,()=>this.shade(e,o,m));}let i=a&&"color"in a?a.color:null,l=i&&this.inConic?this.flatten(i):i,s=o.strokeWidth>0?this.resolveColor(o.stroke):null,c=s&&{...s,a:s.a*r};if(!(l||c))return;let u=o.fillRule==="evenodd";this.withAlpha(l?.a??1,c?.a??1,()=>{l&&this.setColor("fill",l),c&&(this.setColor("draw",c),this.pdf.setLineWidth(o.strokeWidth*sn(o.matrix))),this.tracePath(e,o.matrix),l&&c?u?this.pdf.fillStrokeEvenOdd():this.pdf.fillStroke():l?u?this.pdf.fillEvenOdd():this.pdf.fill():this.pdf.stroke();});}text(e,n){let o=e.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let a=sn(n.matrix),[i,l]=H(n.matrix,j(e.attrs.x,n.viewport[0]),j(e.attrs.y,n.viewport[1])),s=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600;this.pdf.setFont("helvetica",s?"bold":"normal");let c=n.fontSize*a*(72/oo);this.pdf.setFontSize(c);let u=Number.parseFloat(e.attrs["data-max-width"]??"");if(u>0){let d=u*a,p=this.pdf.getTextWidth(o);p>d&&(c*=d/p,this.pdf.setFontSize(c));}this.setColor("text",r);let m=Math.atan2(n.matrix[1],n.matrix[0]);if(Math.abs(m)>2e-4){let d=n.textAnchor==="middle"?this.pdf.getTextWidth(o)/2:n.textAnchor==="end"?this.pdf.getTextWidth(o):0;this.pdf.text(o,i-d*Math.cos(m),l-d*Math.sin(m),{angle:-m*180/Math.PI,baseline:"alphabetic"});return}let f=n.textAnchor==="middle"?"center":n.textAnchor==="end"?"right":"left";this.pdf.text(o,i,l,{align:f,baseline:"alphabetic"});}aliases=new Map;image(e,n){let o=e.attrs.href??e.attrs["xlink:href"],r=o&&(Jr(o)?o:this.images.get(o)),a=r&&Jr(r);if(!(r&&a))return;let i=this.aliases.get(r);i||(i=`qrdx-image-${this.aliases.size}`,this.aliases.set(r,i));let l=null;if(e.attrs.preserveAspectRatio)try{let g=this.pdf.getImageProperties(r);l={width:g.width,height:g.height};}catch{l=null;}let s=du(e,n.viewport,l);if(!s)return;let{draw:c,clip:u}=s,[m,f]=H(n.matrix,c.x,c.y),[d,p]=H(n.matrix,c.x+c.width,c.y+c.height),h=u!==null&&this.beginClip([{op:"M",x:u.x,y:u.y},{op:"L",x:u.x+u.width,y:u.y},{op:"L",x:u.x+u.width,y:u.y+u.height},{op:"L",x:u.x,y:u.y+u.height},{op:"Z"}],n.matrix,false);try{this.withAlpha(n.opacity??1,1,()=>{this.pdf.addImage(r,a,Math.min(m,d),Math.min(f,p),Math.abs(d-m),Math.abs(p-f),i);});}finally{h&&this.endClip();}}};function oh(t,e,n){let{trimX:o,trimY:r,trimWidth:a,trimHeight:i,bleed:l}=n,s=l+bu,c=o,u=o+a,m=r,f=r+i;e.setRegistrationColor(),t.setLineWidth(eh);for(let d of [c,u]){let p=d===c?-1:1;for(let h of [m,f]){let g=h===m?-1:1;t.line(d+p*s,h,d+p*(s+Va),h),t.line(d,h+g*s,d,h+g*(s+Va));}}}async function ah(t,e){return (await yu(t,e)).output("dataurlstring")}async function N5(t,e){return (await yu(t,e)).output("arraybuffer")}async function yu(t,e){let n=ao(t,e),o;try{({jsPDF:o}=await import('jspdf'));}catch(y){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${y})`)}let r=await er(t),a=fe(r);if(!a)throw new Error("Failed to render the QR code for printing");let i=new Map;for(let y of tr(a,new Set))if(!Jr(y)){let b=await to(y);b&&i.set(y,b);}let l=new o({orientation:n.pageWidth>n.pageHeight?"landscape":"portrait",unit:"mm",format:[n.pageWidth,n.pageHeight],compress:true,floatPrecision:3});l.setProperties({title:"QR code",creator:"qrdx"});let s=Zr(a),c=s.size>0?ja.attach(l):null,u=new Za(l,e.colorMode==="cmyk",Jn(a,new Map),c?{gradients:s,resources:c}:null,i);ro(u,t);let m=n.codeWidth/ue,f=j(a.attrs.width,ue,ue),d=j(a.attrs.height,ue,ue),p={matrix:ut([1,0,0,1,n.trimX,n.trimY],[m,0,0,m,0,0]),viewport:[f,d],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},h=n.bleed>0?no(t,r):null,g=[n.trimX-n.bleed,n.trimY-n.bleed,n.trimX+n.trimWidth+n.bleed,n.trimY+n.trimHeight+n.bleed];if(!(h&&u.paintBleed(a,p,h,g))){let y=h?u.resolveColor(h):null;y&&(u.setColor("fill",y),l.rect(n.trimX-n.bleed,n.trimY-n.bleed,n.trimWidth+2*n.bleed,n.trimHeight+2*n.bleed,"F"));}return u.walk(a,p,true),e.cropMarks&&oh(l,u,n),l}async function ih(t,e){let n=ao(t,{size:e.size,unit:e.unit}),o=await er(t),r=e.unit??"mm",a=s=>`${x(r==="in"?s/oo:s)}${r}`,i=/^<svg\b[^>]*>/.exec(o)?.[0];if(!i)throw new Error("Failed to render the QR code for printing");return `<?xml version="1.0" encoding="UTF-8"?>
2
+ ${i.replace(/\swidth="[^"]*"/,` width="${a(n.trimWidth)}"`).replace(/\sheight="[^"]*"/,` height="${a(n.trimHeight)}"`)}${o.slice(i.length)}`}async function O5(t,e){let n=await ah(t,e);te(n,e.filename??"qr-code-print.pdf");}async function D5(t,e){let n=await ih(t,e);te(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`,e.filename??"qr-code-print.svg");}var sh=[137,80,78,71,13,10,26,10];async function xu(t,e){let n=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(n).arrayBuffer())}async function $u(t){return typeof CompressionStream>"u"?null:await xu(t,new CompressionStream("deflate"))}async function lh(t){if(typeof DecompressionStream>"u")return null;try{return await xu(t,new DecompressionStream("deflate"))}catch{return null}}var Xa=(t,e)=>t[e]*2**24+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3]>>>0,_u={0:1,2:3,3:1,4:2,6:4};function ch(t,e,n){let o=t+e-n,r=Math.abs(o-t),a=Math.abs(o-e),i=Math.abs(o-n);return r<=a&&r<=i?t:a<=i?e:n}async function Ya(t){if(sh.some((h,g)=>t[g]!==h))return null;let e=8,n=0,o=0,r=-1,a=null,i=null,l=[];for(;e+8<=t.length;){let h=Xa(t,e),g=String.fromCharCode(...t.subarray(e+4,e+8)),y=t.subarray(e+8,e+8+h);if(e+=12+h,g==="IHDR"){n=Xa(y,0),o=Xa(y,4);let b=y[8];r=y[9];let _=y[12];if(b!==8||_!==0||!(r in _u))return null}else if(g==="PLTE")a=y;else if(g==="tRNS")i=y;else if(g==="IDAT")l.push(y);else if(g==="IEND")break}if(!(n&&o)||n*o>4096*4096)return null;let s=new Uint8Array(l.reduce((h,g)=>h+g.length,0)),c=0;for(let h of l)s.set(h,c),c+=h.length;let u=await lh(s),m=_u[r],f=n*m;if(!u||u.length<o*(f+1))return null;let d=new Uint8Array(o*f);for(let h=0;h<o;h++){let g=u[h*(f+1)],y=u.subarray(h*(f+1)+1,(h+1)*(f+1)),b=h*f;for(let _=0;_<f;_++){let w=_>=m?d[b+_-m]:0,R=h>0?d[b-f+_]:0,S=h>0&&_>=m?d[b-f+_-m]:0,$=y[_],M=0;g===1?M=w:g===2?M=R:g===3?M=w+R>>1:g===4&&(M=ch(w,R,S)),d[b+_]=$+M&255;}}let p=new Uint8Array(n*o*4);for(let h=0;h<n*o;h++){let g=h*4,y=h*m;if(r===3){let b=d[y];p[g]=a?.[b*3]??0,p[g+1]=a?.[b*3+1]??0,p[g+2]=a?.[b*3+2]??0,p[g+3]=i?.[b]??255;}else if(r===0||r===4){let b=d[y];p[g]=b,p[g+1]=b,p[g+2]=b,p[g+3]=r===4?d[y+1]:255;}else p[g]=d[y],p[g+1]=d[y+1],p[g+2]=d[y+2],p[g+3]=r===6?d[y+3]:255;}return {width:n,height:o,data:p}}var uh=25.4,Su=72/uh,mh=50;function dh(t){let e=/^data:[^,]*?(;base64)?,(.*)$/s.exec(t);if(!e)return null;try{let n=e[1]?atob(e[2]):decodeURIComponent(e[2]),o=new Uint8Array(n.length);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r)&255;return o}catch{return null}}function fh(t){if(t[0]!==255||t[1]!==216)return null;let e=2;for(;e+9<t.length;){if(t[e]!==255)return null;let n=t[e+1];if(n===216||n>=208&&n<=215){e+=2;continue}let o=t[e+2]<<8|t[e+3];if(n===192||n===193||n===194){let r=t[e+5]<<8|t[e+6],a=t[e+7]<<8|t[e+8],i=t[e+9];return {width:a,height:r,components:i,progressive:n===194}}e+=2+o;}return null}async function hh(t,e){let{width:n,height:o,data:r}=t,a=e?4:3,i=new Uint8Array(n*o*a);for(let s=0;s<n*o;s++){let c=r[s*4+3]/255,u=r[s*4]*c+255*(1-c),m=r[s*4+1]*c+255*(1-c),f=r[s*4+2]*c+255*(1-c);if(e){let[d,p,h,g]=ge(u,m,f);i.set([d*255,p*255,h*255,g*255].map(Math.round),s*a);}else i.set([Math.round(u),Math.round(m),Math.round(f)],s*a);}let l=await $u(i);return {kind:"raw",width:n,height:o,components:a,bytes:l??i,compressed:!!l}}async function ph(t,e){let n=t;if(!/^data:image\/(png|jpe?g)[;,]/i.test(n)){let i=await to(n);if(!i)return null;n=i;}let o=dh(n);if(!o)return null;let r=fh(o);if(r)return r.components===1||r.components===3?{kind:"jpeg",width:r.width,height:r.height,components:r.components,bytes:o,progressive:r.progressive}:null;let a=await Ya(o);return a?await hh(a,e):null}function gh(t){let e="",n=0,o=r=>{e+=r,n+=r.length,n>=76&&(e+=`
3
+ `,n=0);};for(let r=0;r<t.length;r+=4){let a=Math.min(4,t.length-r),i=0;for(let s=0;s<4;s++)i=i*256+(s<a?t[r+s]:0);if(i===0&&a===4){o("z");continue}let l=[];for(let s=0;s<5;s++)l.unshift(String.fromCharCode(i%85+33)),i=Math.floor(i/85);o(l.slice(0,a+1).join(""));}return `${e}~>`}var bh=`/qrdxdict 40 dict def
4
4
  qrdxdict begin
5
5
  /m {moveto} bind def
6
6
  /l {lineto} bind def
@@ -21,11 +21,11 @@ qrdxdict begin
21
21
  } bind def
22
22
  /QRDX-Regular /Helvetica latin1
23
23
  /QRDX-Bold /Helvetica-Bold latin1
24
- end`;function Ua(t){let e="(";for(let n of t){let o=n.codePointAt(0)??63;n==="("||n===")"||n==="\\"?e+=`\\${n}`:o>=32&&o<127?e+=n:o>=160&&o<=255?e+=`\\${o.toString(8).padStart(3,"0")}`:e+="?";}return `${e})`}var qa=class extends An{out=[];shadingNames=new Map;cmyk;images;usesLevel3=false;constructor(e,n,o,r){super(n,o),this.cmyk=e,this.images=r;}color(e){if(this.cmyk){let[n,o,r,a]=$e(e.r,e.g,e.b);return `${x(n)} ${x(o)} ${x(r)} ${x(a)} cmyk`}return `${x(e.r/255)} ${x(e.g/255)} ${x(e.b/255)} rg`}tracePath(e,n){let o=["n"],r=false;for(let a of e)if(a.op==="M"||a.op==="L"&&!r){let[i,c]=j(n,a.x,a.y);o.push(`${x(i)} ${x(c)} m`),r=true;}else if(a.op==="L"){let[i,c]=j(n,a.x,a.y);o.push(`${x(i)} ${x(c)} l`);}else if(a.op==="C"){if(!r)continue;let[i,c]=j(n,a.x1,a.y1),[s,l]=j(n,a.x2,a.y2),[u,m]=j(n,a.x,a.y);o.push(`${x(i)} ${x(c)} ${x(s)} ${x(l)} ${x(u)} ${x(m)} c`);}else r&&o.push("h");return o.join(" ")}beginClip(e,n,o){return this.out.push(`gsave ${this.tracePath(e,n)} ${o?"eoclip":"clip"} n`),true}endClip(){this.out.push("grestore");}rect(e,n,o,r,a){this.out.push(`${this.color(e)} n ${x(n)} ${x(o)} m ${x(n+r)} ${x(o)} l ${x(n+r)} ${x(o+a)} l ${x(n)} ${x(o+a)} l h f`);}shade(e,n,o){let r=ht(n.matrix,o.matrix);if(!Ee(r))return;let a=Hr(o,this.cmyk?"cmyk":"rgb"),i=this.shadingNames.get(a);i||(i=`Sh${this.shadingNames.size}`,this.shadingNames.set(a,i)),this.usesLevel3=true;let c=n.fillRule==="evenodd"?"eoclip":"clip";this.out.push(`gsave ${this.tracePath(e,n.matrix)} ${c} n [${Wr(r)}] concat ${i} shfill grestore`);}paint(e,n,o){if(e.length===0)return;let r=o.opacity??1;if(r<=0)return;let a=this.resolveFill(o.fill,e,o.viewport,(o.fillOpacity??1)*r);a&&"pattern"in a?this.paintPattern(e,o,a.pattern,a.alpha):a&&"gradient"in a&&this.shade(e,o,{...a.gradient,stops:a.gradient.stops.map(m=>({...m,color:this.flatten({...m.color,a:m.color.a*a.alpha})}))});let i=a&&"color"in a?this.flatten(a.color):null,c=o.strokeWidth>0?this.resolveColor(o.stroke):null,s=c&&this.flatten({...c,a:c.a*r});if(!(i||s))return;let l=this.tracePath(e,o.matrix),u=o.fillRule==="evenodd"?"ef":"f";i&&s?this.out.push(`gsave ${this.color(i)} ${l} ${u} grestore`):i&&this.out.push(`${this.color(i)} ${l} ${u}`),s&&this.out.push(`${this.color(s)} ${x(o.strokeWidth*mn(o.matrix))} w ${l} s`);}text(e,n){let o=e.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let a=mn(n.matrix),[i,c]=j(n.matrix,Y(e.attrs.x,n.viewport[0]),Y(e.attrs.y,n.viewport[1])),l=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600?"/QRDX-Bold":"/QRDX-Regular",u=x(n.fontSize*a),m=Number.parseFloat(e.attrs["data-max-width"]??""),f=m>0?` dup stringwidth pop dup ${x(m*a)} gt {${x(m*a)} exch div ${u} mul ${l} findfont exch scalefont setfont} {pop} ifelse`:"",d=n.textAnchor==="middle"?" dup stringwidth pop 2 div neg 0 rmoveto":n.textAnchor==="end"?" dup stringwidth pop neg 0 rmoveto":"",p=Math.atan2(n.matrix[1],n.matrix[0])*180/Math.PI;if(Math.abs(p)>.01){this.out.push(`gsave ${this.color(r)} ${l} findfont ${u} scalefont setfont ${x(i)} ${x(c)} translate ${x(p)} rotate ${Ua(o)}${f} 0 0 moveto${d} show grestore`);return}this.out.push(`gsave ${this.color(r)} ${l} findfont ${u} scalefont setfont ${Ua(o)}${f} ${x(i)} ${x(c)} moveto${d} show grestore`);}image(e,n){let o=e.attrs.href??e.attrs["xlink:href"],r=o?this.images.get(o):void 0;if(!r)return;let a=Y(e.attrs.x,n.viewport[0]),i=Y(e.attrs.y,n.viewport[1]),c=Y(e.attrs.width,n.viewport[0]),s=Y(e.attrs.height,n.viewport[1]);if(c<=0||s<=0)return;let[l,u]=j(n.matrix,a,i),[m,f]=j(n.matrix,a+c,i+s),{components:d}=r,p=d===1?"/DeviceGray":d===4?"/DeviceCMYK":"/DeviceRGB",h=Array.from({length:d},()=>"0 1").join(" "),g="/ASCII85Decode filter";r.kind==="jpeg"?(g+=" /DCTDecode filter",r.progressive&&(this.usesLevel3=true)):r.compressed&&(g+=" /FlateDecode filter",this.usesLevel3=true),this.out.push(["gsave",`${x(Math.min(l,m))} ${x(Math.min(u,f))} translate ${x(Math.abs(m-l))} ${x(Math.abs(f-u))} scale`,`${p} setcolorspace`,`<< /ImageType 1 /Width ${r.width} /Height ${r.height} /BitsPerComponent 8 /Decode [${h}] /ImageMatrix [${r.width} 0 0 -${r.height} 0 ${r.height}] /DataSource currentfile ${g} >> image`,af(r.bytes),"grestore"].join(`
25
- `));}};async function kl(t,e={}){let n=_e(t);if(!n)throw new Error("Could not read the SVG to convert to EPS");let o=Y(n.attrs.width,0,0)||512,r=Y(n.attrs.height,0,0)||o,a=e.width??o;if(!(Number.isFinite(a)&&a>0))throw new Error("EPS width must be a positive number of points");let i=a/o,c=r*i,s=Math.max(0,e.bleed??0),l=a+2*s,u=c+2*s,m=e.colorMode==="cmyk",f=new Map;for(let _ of Xn(n,new Set)){let y=await of(_,m);y&&f.set(_,y);}let d=new qa(m,Yn(n,new Map),zr(n),f);Kr(d,{bgColor:e.background??"#ffffff"});let h={matrix:ht([1,0,0,-1,s,u-s],[i,0,0,i,0,0]),viewport:[o,r],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},g=s>0?e.bleedColor??void 0:void 0;if(!(g&&d.paintBleed(n,h,g,[0,0,l,u]))){let _=g?d.resolveColor(g):null;_&&d.rect(_,0,0,l,u);}d.walk(n,h,true);let b=(e.title??"QR code").replace(/[^\x20-\x7e]/g,"?");return ["%!PS-Adobe-3.0 EPSF-3.0",`%%BoundingBox: 0 0 ${Math.ceil(l)} ${Math.ceil(u)}`,`%%HiResBoundingBox: 0 0 ${x(l)} ${x(u)}`,`%%Title: ${Ua(b)}`,"%%Creator: qrdx",`%%LanguageLevel: ${d.usesLevel3?3:2}`,"%%DocumentData: Clean7Bit","%%EndComments","%%BeginProlog",sf,"%%EndProlog","qrdxdict begin",...Array.from(d.shadingNames,([_,y])=>`/${y} ${_} def`),"gsave",...d.out,"grestore","end","showpage","%%Trailer","%%EOF",""].join(`
26
- `)}var Nl="EPS can't carry image fills: PostScript has no transparency and would repeat the picture for every dot. Download PDF, SVG or PNG instead.";function Ol(t){return [t.bgColor,t.fgColor,t.eyeColor,t.dotColor,...Object.values(t.eyeColors??{}).flatMap(n=>[n?.outer,n?.inner])].some(n=>typeof n=="object"&&n?.type==="image")}async function eo(t,e={}){if(Ol(t))throw new Error(Nl);let n=to(t,{size:e.sizeMm??tf,unit:"mm",bleed:e.bleedMm}),o=await Zn(t);return await kl(o,{width:n.trimWidth*Fl,bleed:n.bleed*Fl,bleedColor:n.bleed>0?Zr(t,o):Na(t),colorMode:e.colorMode,background:wt(t.bgColor,gt)})}function no(t){return `data:application/postscript;base64,${btoa(t)}`}async function cf(t,e={}){let n=await eo(t,e);re(no(n),e.filename??"qr-code-print.eps");}var za={png:{mimeType:"image/png",extension:"png",vector:false},jpg:{mimeType:"image/jpeg",extension:"jpg",vector:false},webp:{mimeType:"image/webp",extension:"webp",vector:false},svg:{mimeType:"image/svg+xml",extension:"svg",vector:true},pdf:{mimeType:"application/pdf",extension:"pdf",vector:false},eps:{mimeType:"application/postscript",extension:"eps",vector:true}},s_={small:{width:200,height:200},medium:{width:400,height:400},large:{width:800,height:800},xlarge:{width:1200,height:1200},"2xl":{width:1600,height:1600},"3xl":{width:2e3,height:2e3}};function Wa(t,e){return t<50||e<50?{isValid:false,error:"Size must be at least 50x50 pixels"}:t>5e3||e>5e3?{isValid:false,error:"Size must not exceed 5000x5000 pixels"}:t!==e?{isValid:false,error:"Width and height must be equal for QR codes"}:{isValid:true}}function je(t,e){let{imageSettings:n,size:o}=t;if(!(n&&o)||o===e)return {...t,size:e};let r=e/o;return {...t,size:e,imageSettings:{...n,width:n.width*r,height:n.height*r,...n.x!=null&&{x:n.x*r},...n.y!=null&&{y:n.y*r},...n.padding!=null&&{padding:n.padding*r}}}}function re(t,e){let n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n);}var Dl=t=>(za[t]??za.png).mimeType;function lf(t,e,n){let{extension:o,vector:r}=za[t];if(r)return `qr-code.${o}`;let{width:a,height:i}=ue(e.width,n);return `qr-code-${Math.round(a)}x${Math.round(i)}.${o}`}async function Ql(t,e={}){let n=await En(t,"image/webp",true);try{return await qr(n,e)}finally{n.remove();}}var uf=25.4/72;async function Bl(t){let e=await eo(t,{sizeMm:(t.size??ft)*uf});return no(e)}async function Gl(t){let e;try{({jsPDF:e}=await import('jspdf'));}catch(f){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${f})`)}let n=await Wt(t),o=decodeURIComponent(n.replace("data:image/svg+xml,","")),r;try{let f=new TextEncoder().encode(o),d=Array.from(f,h=>String.fromCharCode(h)).join("");r=`data:image/svg+xml;base64,${btoa(d)}`;}catch(f){throw new Error(`Failed to encode SVG for PDF conversion: ${f}`)}let{width:a,height:i}=ue(t.size||ft,t.frame),c=await new Promise((f,d)=>{let p=new Image,h=document.createElement("canvas");h.width=Math.round(a),h.height=Math.round(i);let g=h.getContext("2d");if(!g){d(new Error("Could not get canvas context"));return}let b=setTimeout(()=>{h.remove(),d(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);p.onload=()=>{clearTimeout(b);try{g.drawImage(p,0,0,h.width,h.height),f(h);}catch(_){clearTimeout(b),h.remove(),d(new Error(`Failed to draw image to canvas: ${_}`));}},p.onerror=()=>{clearTimeout(b),h.remove(),d(new Error("Could not load SVG for PDF conversion"));},p.src=r;}),s=c.toDataURL("image/png",1),l=a*.264583,u=i*.264583,m=new e({orientation:l>u?"landscape":"portrait",unit:"mm",format:[l,u]});return m.addImage(s,"PNG",0,0,l,u),c.remove(),m.output("dataurlstring")}async function c_(t,e){let{format:n,size:o,filename:r,quality:a}=e,i=Wa(o.width,o.height);if(!i.isValid)throw new Error(i.error);let c=je(t,o.width),s=r||lf(n,o,t.frame);try{if(n==="svg"){let l=await Wt(c);re(l,s);}else if(n==="pdf"){let l=await Gl(c);re(l,s);}else if(n==="eps")re(await Bl(c),s);else if(n==="webp"){let l=await Ql(c,{quality:a});re(await jn(l),s);}else {let l=Dl(n),u=await En(c,l);if(typeof u=="string")re(u,s);else throw new Error("Failed to generate image data URL")}}catch(l){throw console.error(`Error downloading ${n.toUpperCase()}:`,l),l}}async function l_(t,e,n,o={}){let r=Wa(n.width,n.height);if(!r.isValid)throw new Error(r.error);let a=je(t,n.width);if(e==="svg")return await Wt(a);if(e==="pdf")return await Gl(a);if(e==="eps")return await Bl(a);if(e==="webp")return await jn(await Ql(a,o));let i=Dl(e),c=await En(a,i);if(typeof c=="string")return c;throw new Error("Failed to generate QR code data URL")}async function u_(t,e={width:ft,height:ft}){try{let n=Wa(e.width,e.height);if(!n.isValid)throw new Error(n.error);let o=je(t,e.width),r=En(o,"image/png",!0).then(a=>new Promise((i,c)=>{let s=a;s.toBlob(l=>{s.remove(),l?i(l):c(new Error("Failed to create blob from canvas"));},"image/png");}));await navigator.clipboard.write([new ClipboardItem({"image/png":r})]);}catch(n){throw console.error("Error copying to clipboard:",n),n}}async function m_(t){let e=await Wt(t);return decodeURIComponent(e.replace("data:image/svg+xml,",""))}var kt={maxBytes:2e5,maxElements:500,maxDepth:16,maxInputSegments:4e3,maxColors:8,artboardSide:1e3,decimals:1,padding:.06},ot=class extends Error{},mf={script:t=>`Removed ${_t(t,"script")}`,style:t=>`Removed ${_t(t,"style sheet")}: colors set with CSS classes are lost. Export with presentation attributes (Illustrator: Styling \u2192 Presentation Attributes)`,"foreign-object":t=>`Removed ${_t(t,"foreignObject element")}`,image:t=>`Removed ${_t(t,"image")}: frames are vector shapes only`,use:t=>`Removed ${_t(t,"<use> reference")}: ungroup or detach symbols before exporting`,text:t=>`Removed ${_t(t,"text element")}: add text as labels in the frame editor`,effects:t=>`Removed ${_t(t,"filter, mask, clip path or pattern")}`,animation:t=>`Removed ${_t(t,"animation")}`,unknown:t=>`Removed ${_t(t,"unsupported element")}`,"nested-svg":t=>`Removed ${_t(t,"nested <svg>")}: flatten it first`,handlers:t=>`Removed ${_t(t,"event handler attribute")}`,links:t=>`Removed ${_t(t,"link")} (href)`,"external-paint":t=>`Removed ${_t(t,"fill or stroke")} that referenced something outside the file`,gradient:t=>`Flattened ${_t(t,"gradient")} to its first color: add gradients in the frame editor`,opacity:t=>`Made ${_t(t,"semi-transparent shape")} opaque (print files have no transparency)`,"invalid-paint":t=>`${_t(t,"color")} couldn't be read and fell back to the parent color`,stroke:t=>`Removed ${_t(t,"stroke")} on paths, polygons or polylines: outline strokes before exporting (Figma: Outline stroke)`,dash:t=>`Drew ${_t(t,"dashed stroke")} as solid`,clipped:t=>`Cut ${_t(t,"shape")} at the edge of the artboard`,outside:t=>`Removed ${_t(t,"shape")} outside the artboard`,colors:t=>`Merged ${_t(t,"color")} with similar ones (${kt.maxColors} at most)`,"qr-placed":()=>'No QR placeholder found (a rect with id "qr"): the code was centered; place it in the frame editor'};function _t(t,e){return `${t} ${e}${t===1?"":"s"}`}var Ya=class{counts=new Map;add(e,n=1){this.counts.set(e,(this.counts.get(e)??0)+n);}list(){return [...this.counts].map(([e,n])=>({code:e,count:n,message:mf[e](n)}))}},df=/^\s*<\?xml\s[^?>]*\?>/,Ha=/[A-Za-z_][\w:.-]*/y,Va=/<\/([A-Za-z_][\w:.-]*)\s*>/y,ro=/\s*/y,ff=/[A-Za-z_:][\w:.-]*/y,hf=/[^"<]*/y,pf=/[^'<]*/y;function Pn(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function Ul(t,e){let n=Pn(ro,t,e),o=Pn(ff,t,n);if(n===e||o===n)return -1;let r=Pn(ro,t,o);if(t[r]!=="=")return -1;let a=Pn(ro,t,r+1),i=t[a];if(i!=='"'&&i!=="'")return -1;let s=Pn(i==='"'?hf:pf,t,a+1);return t[s]===i?s+1:-1}function gf(t,e){let n=Pn(ro,t,e);return t[n]===">"?{end:n+1,selfClosing:false}:t.startsWith("/>",n)?{end:n+2,selfClosing:true}:null}function bf(t){let e=[],n=0,o="",r=0;for(;r<t.length;){let a=t.indexOf("<",r);if(a<0)break;if(r=a,t.startsWith("<!--",r)){let l=t.indexOf("-->",r+4);if(l<0)throw new ot("The SVG has an unclosed comment");r=l+3;continue}if(t.startsWith("<![CDATA[",r)){let l=t.indexOf("]]>",r+9);if(l<0)throw new ot("The SVG has an unclosed CDATA section");r=l+3;continue}if(t.startsWith("<?",r)){let l=t.indexOf("?>",r+2);if(l<0)throw new ot("The SVG has an unclosed declaration");r=l+2;continue}if(t.startsWith("<!",r))throw new ot("DOCTYPE and other declarations are not allowed");if(t[r+1]==="/"){Va.lastIndex=r;let l=Va.exec(t);if(!l)throw new ot("The SVG has a malformed closing tag");if(e.pop()!==l[1])throw new ot(`The SVG closes <${l[1]}> out of order`);r=Va.lastIndex;continue}Ha.lastIndex=r+1;let i=Ha.exec(t);if(!i)throw new ot("The SVG has a malformed tag");let c=Ha.lastIndex;for(let l=Ul(t,c);l>=0;l=Ul(t,c))c=l;let s=gf(t,c);if(!s)throw new ot(`The SVG has a malformed <${i[0]}> tag (attributes must be quoted and may not contain "<")`);if(n++,n>kt.maxElements)throw new ot(`The SVG has more than ${kt.maxElements} elements`);if(o||(o=i[0]),!s.selfClosing&&(e.push(i[0]),e.length>kt.maxDepth))throw new ot(`The SVG nests elements more than ${kt.maxDepth} deep`);r=s.end;}if(e.length>0)throw new ot(`The SVG doesn't close <${e.at(-1)}>`);return o}function _f(t){if(typeof t!="string")throw new ot("Expected SVG markup as a string");let e=new TextEncoder().encode(t).length;if(e>kt.maxBytes)throw new ot(`The SVG is ${Math.ceil(e/1e3)} KB; the limit is ${kt.maxBytes/1e3} KB`);if(/<!(?:DOCTYPE|ENTITY|ATTLIST|ELEMENT|NOTATION)/i.test(t))throw new ot("DOCTYPE and entity declarations are not allowed");let n=t.replace(df,"");if(n.includes("<?"))throw new ot("Processing instructions (such as xml-stylesheet) are not allowed");if(bf(n)!=="svg")throw new ot("The file must start with an <svg> element");return n}var ja=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function Ht(t){let e=t?.replace(/!important/i,"").trim();return e===""||e==="inherit"?void 0:e}function Xa(t,e,n,o){let r=t.trim();if(r==="none"||r==="transparent")return null;if(/^url\(/i.test(r)){let i=/^url\(\s*['"]?#([^)'"\s]+)['"]?\s*\)/i.exec(r)?.[1],c=i?n.get(i):void 0;return c?(o.add("gradient"),Xa(c,e,n,o)):(o.add("external-paint"),null)}let a=dt(r==="currentColor"?e.color:r);return a?a.a<=0?null:`#${ja(a.r)}${ja(a.g)}${ja(a.b)}`:(o.add("invalid-paint"),null)}function yf(t){let e=new Map,n=r=>{(r.name==="linearGradient"||r.name==="radialGradient")&&r.attrs.id&&e.set(r.attrs.id,r);for(let a of r.children)n(a);};n(t);let o=new Map;for(let[r,a]of e){let i=a.children.find(s=>s.name==="stop");if(!i){let s=(a.attrs.href??a.attrs["xlink:href"])?.match(/^#(.+)$/)?.[1];i=s?e.get(s)?.children.find(l=>l.name==="stop"):void 0;}let c=i&&Ht(K(i,"stop-color"));c&&o.set(r,c);}return o}function ql(t,e){return t.map(n=>{if(n.op==="Z")return n;if(n.op==="C"){let[a,i]=j(e,n.x1,n.y1),[c,s]=j(e,n.x2,n.y2),[l,u]=j(e,n.x,n.y);return {op:"C",x1:a,y1:i,x2:c,y2:s,x:l,y:u}}let[o,r]=j(e,n.x,n.y);return {op:n.op,x:o,y:r}})}function xf(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),e/2}function Ka(t){return t.length<3?[]:[...t.map(([e,n],o)=>({op:o===0?"M":"L",x:e,y:n})),{op:"Z"}]}var Ae=t=>Number.isFinite(t);function mt(t,e,n=0){let o=Number.parseFloat(t.attrs[e]??"");return Ae(o)?o:n}function zl(t){switch(t.name){case "path":return se(t.attrs.d??"");case "rect":{let e=t.attrs.rx??t.attrs.ry,n=t.attrs.ry??t.attrs.rx;return Jt(mt(t,"x"),mt(t,"y"),mt(t,"width"),mt(t,"height"),Number.parseFloat(e??"0")||0,Number.parseFloat(n??"0")||0)}case "circle":{let e=mt(t,"r");return Kt(mt(t,"cx"),mt(t,"cy"),e,e)}case "ellipse":return Kt(mt(t,"cx"),mt(t,"cy"),mt(t,"rx"),mt(t,"ry"));case "polygon":case "polyline":{let e=ke(t.attrs.points),n=[];for(let o=0;o+1<e.length;o+=2)n.push([e[o],e[o+1]]);return Ka(n)}default:return []}}function $f(t,e){let n=e/2;switch(t.name){case "rect":{let o=mt(t,"x"),r=mt(t,"y"),a=mt(t,"width"),i=mt(t,"height"),c=Number.parseFloat(t.attrs.rx??t.attrs.ry??"0")||0,s=Jt(o-n,r-n,a+e,i+e,c>0?c+n:0,c>0?c+n:0);if(a<=e||i<=e)return s;let l=Math.max(c-n,0);return [...s,...Jt(o+n,r+n,a-e,i-e,l,l)]}case "circle":case "ellipse":{let o=mt(t,"cx"),r=mt(t,"cy"),a=t.name==="circle"?mt(t,"r"):mt(t,"rx"),i=t.name==="circle"?mt(t,"r"):mt(t,"ry"),c=Kt(o,r,a+n,i+n);return a<=n||i<=n?c:[...c,...Kt(o,r,a-n,i-n)]}case "line":{let[o,r,a,i]=["x1","y1","x2","y2"].map(m=>mt(t,m)),c=Math.hypot(a-o,i-r);if(c===0)return [];let s=-(i-r)/c*n,l=(a-o)/c*n,u=[[o+s,r+l],[a+s,i+l],[a-s,i-l],[o-s,r-l]];return Ka(xf(u)<0?u.reverse():u)}default:return null}}var Sf=new Set(["path","rect","circle","ellipse","polygon","polyline","line"]),Cf=new Set(["defs","linearGradient","radialGradient","stop","title","desc","metadata"]),Mf={script:"script",style:"style",foreignObject:"foreign-object",image:"image",feImage:"image",use:"use",text:"text",tspan:"text",textPath:"text",filter:"effects",mask:"effects",clipPath:"effects",pattern:"effects",marker:"effects",symbol:"effects",animate:"animation",animateMotion:"animation",animateTransform:"animation",set:"animation"},wf=/^(?:qrdx[-_ ]?)?qr(?:[-_ ]?code)?$/i;function Hl(t,e){for(let n of Object.keys(t.attrs)){let o=n.toLowerCase();o.startsWith("on")?e.add("handlers"):o==="href"||o==="xlink:href"?t.name!=="linearGradient"&&t.name!=="radialGradient"&&e.add("links"):(o==="filter"||o==="mask"||o==="clip-path")&&e.add("effects");}}function Vl(t,e,n,o,r){if(Hl(t,o),Ht(K(t,"display"))==="none"||Ht(K(t,"visibility"))==="hidden")return;let a=Number.parseFloat(K(t,"opacity")??"1"),i=Ht(K(t,"fill-rule")),c=Number.parseFloat(Ht(K(t,"stroke-width"))??""),s={matrix:ht(e.matrix,Zt(t.attrs.transform)),fill:Ht(K(t,"fill"))??e.fill,fillRule:i==="evenodd"||i==="nonzero"?i:e.fillRule,stroke:Ht(K(t,"stroke"))??e.stroke,strokeWidth:Ae(c)&&c>=0?c:e.strokeWidth,color:Ht(K(t,"color"))??e.color,opacity:e.opacity*(Ae(a)?a:1)};for(let l of t.children){if(Cf.has(l.name))continue;let u=Mf[l.name];if(u){o.add(u);continue}if(l.name==="svg"){o.add("nested-svg");continue}if(l.name==="g"||l.name==="a"){Vl(l,s,n,o,r);continue}if(!Sf.has(l.name)){o.add("unknown");continue}Rf(l,s,n,o,r);}}function Rf(t,e,n,o,r){if(Hl(t,o),Ht(K(t,"display"))==="none"||Ht(K(t,"visibility"))==="hidden")return;let a=ht(e.matrix,Zt(t.attrs.transform));if(t.name==="rect"&&wf.test(t.attrs.id??"")&&!r.qrBox){r.qrBox=Fe(ql(zl(t),a));return}let i=g=>Ht(K(t,g)),c=e.opacity*Number.parseFloat(i("opacity")??"1"),s=Number.parseFloat(i("fill-opacity")??"1"),l=Number.parseFloat(i("stroke-opacity")??"1"),u=i("fill-rule"),m={...e,fill:i("fill")??e.fill,fillRule:u==="evenodd"||u==="nonzero"?u:e.fillRule,stroke:i("stroke")??e.stroke,color:i("color")??e.color},f=Number.parseFloat(i("stroke-width")??""),d=Ae(f)&&f>=0?f:e.strokeWidth,p=(g,b,_)=>{if(g.length!==0){if(r.segments+=g.length,r.segments>kt.maxInputSegments)throw new ot(`The SVG has more than ${kt.maxInputSegments} path segments; simplify it`);r.shapes.push({segments:ql(g,a),fill:b,fillRule:_});}},h=g=>{let b=(Ae(c)?c:1)*(Ae(g)?g:1);return b<=0?false:(b<1&&o.add("opacity"),true)};if(t.name!=="line"){let g=Xa(m.fill,m,n,o);g&&h(s)&&p(zl(t),g,m.fillRule);}if(d>0&&m.stroke!=="none"){let g=Xa(m.stroke,m,n,o);if(g&&h(l)){let b=$f(t,d);b?((i("stroke-dasharray")??"none")!=="none"&&o.add("dash"),p(b,g,t.name==="line"?"nonzero":"evenodd")):o.add("stroke");}}}function Ef(t,e){let n=l=>{let u=10**e;return Math.round(l*u)/u+0},o=l=>x(l,e),r="",a=0,i=0,c=0,s=0;for(let l of t){if(l.op==="Z"){r+="z",a=c,i=s;continue}let u=n(l.x),m=n(l.y);if(l.op==="M")r+=`m${o(u-a)} ${o(m-i)}`,c=u,s=m;else if(l.op==="L"){if(u===a&&m===i)continue;r+=m===i?`h${o(u-a)}`:u===a?`v${o(m-i)}`:`l${o(u-a)} ${o(m-i)}`;}else r+=`c${o(n(l.x1)-a)} ${o(n(l.y1)-i)} ${o(n(l.x2)-a)} ${o(n(l.y2)-i)} ${o(u-a)} ${o(m-i)}`;a=u,i=m;}return r}var Af=(t,e)=>t.x0<e.x1&&e.x0<t.x1&&t.y0<e.y1&&e.y0<t.y1;function Pf(t){let e=[];for(let n of t){let o=Fe(n.segments);if(!o)continue;let r=e.at(-1);r&&r.shape.fill===n.fill&&r.shape.fillRule===n.fillRule&&!r.boxes.some(a=>Af(a,o))?(r.shape={...r.shape,segments:[...r.shape.segments,...n.segments]},r.boxes.push(o)):e.push({shape:n,boxes:[o]});}return e.map(n=>n.shape)}var Za=t=>[Number.parseInt(t.slice(1,3),16),Number.parseInt(t.slice(3,5),16),Number.parseInt(t.slice(5,7),16)];function vf(t,e,n){let o=new Map;for(let i of t)o.set(i.fill,(o.get(i.fill)??0)+1);let r=new Map([...o.keys()].map(i=>[i,i])),a=0;for(;o.size>e;){let i=[...o.keys()],c=[i[0],i[1]],s=Number.POSITIVE_INFINITY;for(let d=0;d<i.length;d++)for(let p=d+1;p<i.length;p++){let h=Za(i[d]),g=Za(i[p]),b=Math.hypot(h[0]-g[0],h[1]-g[1],h[2]-g[2]);b<s&&(s=b,c=[i[d],i[p]]);}let[l,u]=c,[m,f]=(o.get(l)??0)>=(o.get(u)??0)?[l,u]:[u,l];o.set(m,(o.get(m)??0)+(o.get(f)??0)),o.delete(f);for(let[d,p]of r)p===f&&r.set(d,m);a++;}return a>0&&n.add("colors",a),r}var Wl=t=>{let[e,n,o]=Za(t);return .2126*e+.7152*n+.0722*o>235};function Lf(t,e={}){let n=new Ya;try{let o=_f(t),r=_e(o);if(!r)throw new ot("No <svg> element found");let a=ke(r.attrs.viewBox),[i,c,s,l]=[0,0,0,0];if(a.length===4&&a[2]>0&&a[3]>0?[i,c,s,l]=a:(s=mt(r,"width"),l=mt(r,"height")),!(Ae(s)&&Ae(l)&&s>0&&l>0))throw new ot("The SVG needs a viewBox (or a width and height)");let m=kt.artboardSide/Math.max(s,l),f=Math.round(s*m*10)/10,d=Math.round(l*m*10)/10;if(Math.min(f,d)<ct.minArtboard)throw new ot("The artboard is too narrow: its sides may differ by 20 times at most");let p=[m,0,0,m,-i*m,-c*m],h={shapes:[],qrBox:null,segments:0};Vl(r,{matrix:p,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,color:"#000000",opacity:1},yf(r),n,h);let g={x0:0,y0:0,x1:f,y1:d},b=Math.max(f,d)*.004,_=[],y=0,C=0;for(let k of h.shapes){let q=Fe(k.segments);if(!q||q.x1<=0||q.y1<=0||q.x0>=f||q.y0>=d){y++;continue}if(q.x0<-b||q.y0<-b||q.x1>f+b||q.y1>d+b){let z=ar(k.segments,.25).map(Ct=>ir(Ct,g)).filter(Ct=>Ct.length>2);if(z.length===0){y++;continue}C++,_.push({...k,segments:z.flatMap(Ct=>Ka(Ct))});}else _.push(k);}if(y>0&&n.add("outside",y),C>0&&n.add("clipped",C),_.length===0)throw new ot("The SVG has no filled shapes to use");let M=vf(_,kt.maxColors,n);for(let k of _)k.fill=M.get(k.fill)??k.fill;let $=new Map,S=new Map;for(let k of _){let q=Fe(k.segments);$.set(k.fill,($.get(k.fill)??0)+(q.x1-q.x0)*(q.y1-q.y0)),S.set(k.fill,(S.get(k.fill)??0)+1);}let R=[...$.keys()].sort((k,q)=>Number(Wl(k))-Number(Wl(q))||$.get(q)-$.get(k)),w=R[0],P=R[1],v=k=>k===w?"frame":k===P?"accent":k,L=h.qrBox;if(!L&&e.qr){let[k,q]=j(p,e.qr.x,e.qr.y);L={x0:k,y0:q,x1:k+e.qr.size*m,y1:q+e.qr.size*m};}let I,F,O;L?(I=Math.min(L.x1-L.x0,L.y1-L.y0),F=(L.x0+L.x1-I)/2,O=(L.y0+L.y1-I)/2):(n.add("qr-placed"),I=Math.min(f,d)*.6,F=(f-I)/2,O=(d-I)/2);let T=k=>Math.round(k*10)/10+0;if(I=Math.floor(I*10)/10,F=T(F),O=T(O),I<Math.min(f,d)*ct.minQrShare)throw new ot("The QR area must be at least half the frame's shorter side");let B=Math.min(F,O,f-F-I,d-O-I);if(B<I*ct.minPadding-1e-9)throw new ot("Leave room around the QR area: at least 4% of its size on every side, inside the artboard");let H=Math.min(Math.max(e.padding??kt.padding,ct.minPadding),.2),Q=Math.floor(Math.min(I*H,B)*10)/10,U=Pf(_);if(U.length>ct.maxShapes)throw new ot(`The artwork has ${U.length} separate shapes; the limit is ${ct.maxShapes}. Combine shapes of the same color first`);let tt={kind:mr,version:dr,artboard:{width:f,height:d},qr:{x:F,y:O,size:I,padding:Q},colors:{frame:w,...P&&{accent:P}},shapes:U.map(k=>({type:"path",d:Ef(k.segments,kt.decimals),fill:v(k.fill),...k.fillRule==="evenodd"&&{fillRule:"evenodd"}})),labels:[]},yt=Ne.safeParse(tt);if(!yt.success){let k=yt.error.issues[0];throw new ot(`The converted frame doesn't fit the frame format: ${k?.message??"invalid"}`)}let st=R.map(k=>({color:k,ref:k===w?"frame":k===P?"accent":"fixed",shapes:S.get(k)??0}));return {ok:!0,spec:yt.data,warnings:n.list(),palette:st}}catch(o){return {ok:false,error:o instanceof ot?o.message:`Could not read the SVG (${o instanceof Error?o.name:"error"})`,warnings:n.list()}}}var jl={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1420},qr:{x:120,y:120,size:1e3,padding:60},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1420,fill:"frame",hole:{x:40,y:40,width:1160,height:1160}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1200,width:1e3,height:220}}],bleed:"frame"};var Yl={kind:"qrdx.frame",version:1,artboard:{width:1978.214,height:1978.214},qr:{x:489.107,y:489.107,size:1e3,padding:50},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"circle",cx:989.107,cy:989.107,r:779.107,fill:"background"},{type:"circle",cx:989.107,cy:989.107,r:989.107,hole:779.107,fill:"frame"},{type:"circle",cx:105,cy:989.107,r:14.7,fill:"text"},{type:"circle",cx:1873.214,cy:989.107,r:14.7,fill:"text"}],labels:[{type:"curved",id:"top",slot:"primary",text:"Scan me",color:"text",curve:{cx:989.107,cy:989.107,radius:884.107,side:"top",spread:140},fontSize:105},{type:"curved",id:"bottom",slot:"secondary",text:"",color:"text",curve:{cx:989.107,cy:989.107,radius:884.107,side:"bottom",spread:140},fontSize:105}]};var Xl={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1340},qr:{x:120,y:120,size:1e3,padding:40},colors:{frame:"#000000"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1260,radius:60,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1340,radius:100,fill:"frame",hole:{x:40,y:40,width:1160,height:1260,radius:60}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1160,width:1e3,height:100},fontSize:93.6}]};var Zl={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1490},qr:{x:130,y:130,size:1e3,padding:80,radius:20},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"path",d:"M40 0H1220A40 40 0 0 1 1260 40V1215A55 55 0 0 0 1260 1325V1450A40 40 0 0 1 1220 1490H40A40 40 0 0 1 0 1450V1325A55 55 0 0 0 0 1215V40A40 40 0 0 1 40 0Z",fill:"frame"},{type:"line",x1:77,y1:1270,x2:1147,y2:1270,width:12,dash:[30,22],fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1270,width:1e3,height:220}}]};var Nf={"banner-bottom":jl,"rounded-border":Xl,circle:Yl,ticket:Zl};var Of=721,Df={"call-to-action":105,holidays:115,seasons:28,"food-drink":71,shopping:64,"beauty-wellness":26,events:32,places:25,"real-estate":35,automotive:26,"health-learning":48,"sports-fitness":36,business:82,nonprofit:28};var Qf=[{id:"call-to-action",label:"Call to action"},{id:"holidays",label:"Holidays"},{id:"seasons",label:"Seasons"},{id:"food-drink",label:"Food & drink"},{id:"shopping",label:"Shops & packaging"},{id:"beauty-wellness",label:"Beauty & wellness"},{id:"events",label:"Events & weddings"},{id:"places",label:"Places & Wi-Fi"},{id:"real-estate",label:"Real estate"},{id:"automotive",label:"Cars & parking"},{id:"health-learning",label:"Health & learning"},{id:"sports-fitness",label:"Sports & fitness"},{id:"business",label:"Business & social"},{id:"nonprofit",label:"Nonprofits & community"}];function Ja(t){return Array.isArray(t)?`[${t.map(Ja).join(",")}]`:t&&typeof t=="object"?`{${Object.keys(t).filter(n=>t[n]!==void 0).sort().map(n=>`${JSON.stringify(n)}:${Ja(t[n])}`).join(",")}}`:JSON.stringify(t)}function Bf(t){let e=Ja(t),n=2166136261;for(let o=0;o<e.length;o++)n^=e.charCodeAt(o),n=Math.imul(n,16777619)>>>0;return n.toString(16).padStart(8,"0")}function Gf(t,e){return xt.QrCode.encodeText(t,Et[e??Yt]).size}function Kl(t,e,n,o=n.size*(e?.size??Fo)){let r={src:t,width:o,height:o,excavate:true,...e?.shape&&e.shape!=="square"&&{shape:e.shape},...e?.plate&&{plate:e.plate}},a=e?.x!==void 0||e?.y!==void 0;if(!(e?.padding||a))return r;let i=Gf(n.value,n.level),c=It(i,n.margin,n.shape),s=n.size/(i+2*c);if(e.padding&&(r.padding=e.padding*s),a){let l=i*s,u=m=>Math.min(Math.max((m??.5)*l-o/2,0),l-o);r.x=u(e.x),r.y=u(e.y);}return r}function Jl(t,e,n,o){let r=n.level??Yt,a=r;o&&(a=Bt({...n,imageSettings:Kl(t,e,n),autoLevel:o}));let i=s=>{let l=m=>Kl(t,e,{...n,level:s},m),u=pa(n,[s],l().width,l);return u>0?l(u):void 0};if(a===r)return i(r);let c=i(a);return c&&Bt({...n,imageSettings:c,autoLevel:o})===a?c:i(r)}function Uf({value:t,level:e,margin:n,shape:o,autoLevel:r,logoOptions:a}){let c=Jl("data:,",{...a,size:gr},{value:`${t}`,size:1024,margin:n??$t,level:e,shape:o},r);return c?c.width/1024:0}function ti({value:t,size:e=1024,fgColor:n,bgColor:o,eyeColor:r,dotColor:a,bodyPattern:i,hideLogo:c,logo:s,logoOptions:l,margin:u,cornerEyePattern:m,cornerEyeDotPattern:f,level:d,templateId:p,frame:h,eyeColors:g,moduleScale:b,autoLevel:_,shape:y}){let C={value:`${t}`,size:e,margin:u??$t,level:d,shape:y},M=!c&&s?Jl(s,l,C,_):void 0;return {value:C.value,bgColor:o,fgColor:n,eyeColor:r,dotColor:a,bodyPattern:i,cornerEyePattern:m,cornerEyeDotPattern:f,level:d,templateId:p,size:e,margin:u,...h&&{frame:h},...g&&{eyeColors:g},...b!==void 0&&{moduleScale:b},..._&&{autoLevel:_},...y&&y!=="square"&&{shape:y},...M&&{imageSettings:M}}}var tu=.06,eu=.16,nu=512;function ru(t){let{width:e,height:n}=t;if(!(e>0&&n>0)||t.data.length<e*n*4)return null;let o=Uint8Array.from(t.data),r=Do({width:e,height:n,data:o});if(!r)return null;let a=d=>{let p=d*4;return Math.hypot(o[p]/255-r[0],o[p+1]/255-r[1],o[p+2]/255-r[2])},i=new Uint8Array(e*n),c=new Int32Array(e*n),s=0,l=0,u=d=>{i[d]||o[d*4+3]===0||a(d)>=eu||(i[d]=1,c[l++]=d);};for(let d=0;d<e;d++)u(d),u((n-1)*e+d);for(let d=0;d<n;d++)u(d*e),u(d*e+e-1);for(;s<l;){let d=c[s++],p=d%e;p>0&&u(d-1),p<e-1&&u(d+1),d>=e&&u(d-e),d<(n-1)*e&&u(d+e);}let m=new Uint8ClampedArray(o),f=r;for(let d=0;d<e*n;d++){if(!i[d])continue;let p=Math.min(1,Math.max(0,(a(d)-tu)/(eu-tu))),h=d*4;if(m[h+3]=Math.round(o[h+3]*p),p>0&&p<1)for(let g=0;g<3;g++){let _=(o[h+g]/255-(1-p)*f[g])/p;m[h+g]=Math.round(Math.min(1,Math.max(0,_))*255);}}return {width:e,height:n,data:m}}async function qf(t){if(typeof document>"u"||typeof Image>"u")throw new Error("removeLogoBackground needs a browser (canvas)");let e=await new Promise(c=>{let s=new Image;s.crossOrigin="anonymous",s.onload=()=>c(s),s.onerror=()=>c(null),s.src=t;});if(!e)return null;let n=e.naturalWidth||512,o=e.naturalHeight||512,r=Math.min(1,nu/Math.max(n,o)),a=document.createElement("canvas");a.width=Math.max(1,Math.round(n*r)),a.height=Math.max(1,Math.round(o*r));let i=a.getContext("2d",{willReadFrequently:true});if(!i)return null;try{i.drawImage(e,0,0,a.width,a.height);let c=i.getImageData(0,0,a.width,a.height),s=ru(c);return s?(c.data.set(s.data),i.putImageData(c,0,0),a.toDataURL("image/png")):null}catch{return null}finally{a.remove();}}async function zf(t){let{value:e,size:n=ft,level:o=Yt,bgColor:r=gt,fgColor:a=Mt,margin:i=$t,imageSettings:c,eyeColor:s,dotColor:l,bodyPattern:u,cornerEyePattern:m,cornerEyeDotPattern:f,isOGContext:d,templateId:p,customTemplate:h,customProps:g,frame:b,art:_,eyeColors:y,moduleScale:C,frameLabelMarkers:M,partMarkers:$,autoLevel:S,...R}=t,w=Nr({value:e,size:n,margin:i,level:o,autoLevel:S},c),P=Bt({value:e,size:n,level:o,margin:i,imageSettings:w,autoLevel:S}),v=xt.QrCode.encodeText(e,Et[P]).getModules(),L=v.length+i*2,I=Re(v,n,i,w),F=null;if(w!=null&&I!=null){I.excavation!=null&&(v=Ca(v,I.excavation));let T=w.src.startsWith("data:")?w.src:await fetch(`https://wsrv.nl/?url=${encodeURIComponent(w.src)}&w=100&h=100&encoding=base64`).then(B=>{if(!B.ok)throw new Error(`Failed to load QR logo (${B.status}): ${w.src}`);return B.text()});F={settings:{...w,src:T},box:{x:I.x+i,y:I.y+i,w:I.w,h:I.h}};}let O=el(v,i);return {size:n,numCells:L,fgPath:O,bgColor:r,fgColor:a,frame:b,svgProps:R,logo:F}}function Wf(t){let{size:e,numCells:n,fgPath:o,bgColor:r,fgColor:a,frame:i,svgProps:c,logo:s}=t,l=Qt(i),u=s?Fr(s.settings,s.box):E(ne,{}),m=ut("svg",{height:e,viewBox:`0 0 ${n} ${n}`,width:e,xmlns:"http://www.w3.org/2000/svg",...l?{}:c,children:[E("path",{d:`M0,0 h${n}v${n}H0z`,fill:wt(r,gt),shapeRendering:"crispEdges"}),E("path",{d:o,fill:wt(a,Mt),shapeRendering:"crispEdges"}),u]});return l&&i?Ar(m,{size:e,frame:i,bgColor:r,svgProps:c}):m}async function Hf(t){return Wf(await zf(t))}function ou(t){return ti({value:t.value,fgColor:t.fgColor,hideLogo:t.hideLogo,bgColor:t.bgColor,eyeColor:t.eyeColor,dotColor:t.dotColor,bodyPattern:t.bodyPattern,cornerEyePattern:t.cornerEyePattern,cornerEyeDotPattern:t.cornerEyeDotPattern,level:t.level,templateId:t.templateId,logo:t.logo,logoOptions:t.logoOptions,margin:t.margin??$t,autoLevel:t.autoLevel,shape:t.shape})}function au(t,e){let{size:n=ft,scale:o=1,level:r,style:a,customTemplate:i,customProps:c,frame:s,art:l,eyeColors:u,moduleScale:m,autoLevel:f,shape:d,frameLabelMarkers:p,partMarkers:h}=t,g=n*o,b=g/e.size,_=e.imageSettings&&{...e.imageSettings,height:e.imageSettings.height*b,width:e.imageSettings.width*b,...e.imageSettings.x!=null&&{x:e.imageSettings.x*b},...e.imageSettings.y!=null&&{y:e.imageSettings.y*b},...e.imageSettings.padding!=null&&{padding:e.imageSettings.padding*b}};return {art:l,bgColor:e.bgColor,bodyPattern:e.bodyPattern,cornerEyeDotPattern:e.cornerEyeDotPattern,cornerEyePattern:e.cornerEyePattern,customProps:c,customTemplate:i,dotColor:e.dotColor,eyeColor:e.eyeColor,fgColor:e.fgColor,frame:s,level:r||e.level,margin:e.margin,...u&&{eyeColors:u},...m!==void 0&&{moduleScale:m},...f&&{autoLevel:f},...d&&d!=="square"&&{shape:d},...p&&{frameLabelMarkers:p},...h&&{partMarkers:h},size:g,style:a,templateId:e.templateId,value:e.value,..._&&{imageSettings:_}}}function Vf(t){return au(t,ou(t))}function iu(t,e){let n=[],o=r=>{if(r==null||typeof r=="boolean")return;if(typeof r=="string"||typeof r=="number"||typeof r=="bigint"){n.push(`${r}`);return}if(Array.isArray(r)){for(let l of r)o(l);return}if(!De(r))throw new TypeError("qrdx: can't render this value");let{type:a,props:i,key:c}=r;if(pn(a)){o(i.children);return}if(typeof a=="function"){o(a(i));return}let s={};for(let l of Object.keys(i)){let u=Rn(l,i[l]);u&&(s[u.name]=u.value);}n.push(e(a,s,iu(i.children,e),c));};return o(t),n}var su={diamond:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"],banner:["square","rounded","diya","leaf"],square:["curly"],diya:["curly"],message:["curly"]},cu={diamond:["square"],pacman:["rounded"],"small-square":["square","rounded"]},lu=["circle","curly"],uu=["diamond","banner","star"],mu={circle:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"]},Vt=["square","liquid","classy","classy-rounded"],du={"circle/rounded":Vt,"circle/extra-rounded":Vt,"circle/message":[...Vt,"leaf"],"circle/pointy":Vt,"circle/leaf-reverse":Vt,"circle/drop":Vt,"circle/bevel":[...Vt,"leaf"],"circle/squircle":[...Vt,"circle","diamond","circle-mixed","rounded","horizontal-line","leaf","heart","mosaic","octagon"],"circle/cushion":Vt,"circle/shield":[...Vt,"rounded","horizontal-line","leaf"],"circle/petal":Vt};function fu(t,e,n){return (mu[t]?.includes(e)??false)&&!du[`${t}/${e}`]?.includes(n)}function ei(t){let e=t.bodyPattern??"circle",n=t.cornerEyePattern??"gear",o=t.cornerEyeDotPattern??"circle";return su[o]?.includes(n)?{kind:"dot-eye",message:`${o} centres in ${n} eyes are missed by strict decoders`,fix:"Pick a square, rounded or circle centre, or another eye shape"}:cu[e]?.includes(n)?{kind:"body-eye",message:`${e} dots next to ${n} eyes are missed up close`,fix:"Pick a fuller dot shape or another eye shape"}:uu.includes(o)?{kind:"dot",message:`${o} centres are missed in sharp renders and up close`,fix:"Pick a square, rounded or circle centre"}:lu.includes(n)?{kind:"eye",message:`${n} eyes only read in lenient decoders`,fix:"Pick square, rounded or gear eyes"}:fu(o,n,e)?{kind:"sharp-dot-eye",message:`${o} centres in ${n} eyes are missed by some decoders on screens and in sharp prints`,fix:"Pick a rounded centre, or gear or octagon eyes"}:null}var xu=[96,160,320],ao=640;function oi(){if(typeof document>"u")throw new Error("Scan scoring needs a browser (canvas + image decoding)")}function ve(t){if(t?.aborted)throw new DOMException("Scan scoring was aborted","AbortError")}var $u=()=>new Promise(t=>setTimeout(t,0));async function ai(){let{default:t}=await import('jsqr');return t}function ri(t,e){if(!t)return false;if(t.data===e)return true;try{return new TextDecoder().decode(Uint8Array.from(t.binaryData))===e}catch{return false}}function jf(t,e,n=.7){let{data:o,width:r,height:a}=t;for(let l=0;l<o.length;l+=4)for(let u=0;u<3;u++)o[l+u]=128+(o[l+u]-128)*n;let i=Math.max(1,Math.round(e*.25)),c=new Float32Array(r*a*3),s=l=>{let u=l?a:r,m=l?r:a,f=(p,h)=>l?p*r+h:h*r+p,d=[0,0,0];for(let p=0;p<u;p++){d.fill(0);for(let h=-i;h<=i;h++){let g=f(p,Math.min(Math.max(h,0),m-1))*4;for(let b=0;b<3;b++)d[b]=d[b]+o[g+b];}for(let h=0;h<m;h++){let g=f(p,h)*3;for(let y=0;y<3;y++)c[g+y]=d[y]/(2*i+1);let b=f(p,Math.max(h-i,0))*4,_=f(p,Math.min(h+i+1,m-1))*4;for(let y=0;y<3;y++)d[y]=d[y]-o[b+y]+o[_+y];}}for(let p=0;p<r*a;p++)for(let h=0;h<3;h++)o[p*4+h]=c[p*3+h];};for(let l=0;l<2;l++)s(true),s(false);}function vn(t,e){let n=document.createElement("canvas");n.width=Math.max(1,Math.round(t)),n.height=Math.max(1,Math.round(e));let o=n.getContext("2d",{willReadFrequently:true});if(!o)throw new Error("Could not get canvas context");return o.imageSmoothingEnabled=true,o.imageSmoothingQuality="high",{canvas:n,ctx:o}}var Yf=[.9,1,1.1];function ii(t,e,n,o,r){let a=0;for(let i of Yf){let c=n*i,s=e(c);jf(s,c/o),r(t(s.data,s.width,s.height))&&a++;}return a>=2?"pass":a===1?"fragile":"fail"}var ni={small:"small print or far away",medium:"typical phone distance",large:"close up"};function Xf(t,e){return t===e[0]&&e.length>1?ni.small:t===e.at(-1)?ni.large:ni.medium}function Su(t,e,n){if(n==="pass")return 0;let o=e===1?[45]:e===2?[20,45]:[15,20,45],r=o[Math.round(t*(o.length-1)/Math.max(e-1,1))]??20;return n==="fragile"?Math.round(r/2):r}function Cu(t,e,n){let o=`${t} px (${Xf(t,e)})`;return n==="pass"?{id:`decode-${t}`,passed:true,message:`Reads at ${o}, with camera blur`}:{id:`decode-${t}`,passed:false,message:n==="fragile"?`Reads at ${o} only some of the time`:`Doesn't read at ${o}`,fix:t===e[0]?"Print it bigger, shorten the content (fewer modules) or use solid square dots":"Raise the contrast, use bigger dots or a simpler eye shape"}}function Mu(t,e){return e?"fails":t>=85?"great":t>=65?"ok":"risky"}function Zf(t,e,n){let o=Gt(t,e);if(o.type==="solid")return [o.color];if(o.type!=="image")return o.stops.map(c=>c.color);let r=o.underlay?io(o.underlay):null,a=n?.[o.src];if(!a)return o.underlay?[o.underlay]:[];let i=o.opacity??1;return [a.light,a.dark].flatMap(c=>{let s=io(c);if(!s)return [];let l={...s,a:s.a*i};if(!r)return [hu(l)];let u=l.a+r.a*(1-l.a),m=(f,d)=>u>0?(f*l.a+d*r.a*(1-l.a))/u:0;return [hu({r:m(l.r,r.r),g:m(l.g,r.g),b:m(l.b,r.b),a:u})]})}var hu=({r:t,g:e,b:n,a:o})=>`rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(n)}, ${Math.round(o*1e3)/1e3})`;function Kf(t){let e=[],n=t.width*t.height;for(let a=0;a<n;a++){let i=t.data[a*4],c=t.data[a*4+1],s=t.data[a*4+2];t.data[a*4+3]<128||e.push({lum:wn(i,c,s),r:i,g:c,b:s});}if(e.length===0)return null;e.sort((a,i)=>a.lum-i.lum);let o=Math.max(1,Math.round(e.length/10)),r=a=>{let i=a.reduce((s,l)=>({r:s.r+l.r,g:s.g+l.g,b:s.b+l.b}),{r:0,g:0,b:0}),c=s=>Math.round(s/a.length).toString(16).padStart(2,"0");return `#${c(i.r)}${c(i.g)}${c(i.b)}`};return {dark:r(e.slice(0,o)),light:r(e.slice(-o))}}async function Jf(t){oi();let e=await tr(t),{canvas:n,ctx:o}=vn(64,64);o.drawImage(e,0,0,64,64);let r=Kf(o.getImageData(0,0,64,64));return n.remove(),r}function wu(t){let e=[t.bgColor,t.fgColor,t.eyeColor,t.dotColor,..._r.flatMap(o=>[t.eyeColors?.[o]?.outer,t.eyeColors?.[o]?.inner])],n=new Set;for(let o of e)typeof o=="object"&&o?.type==="image"&&n.add(o.src);return [...n]}var Kn=null;function io(t){let e=dt(t);if(e||typeof document>"u")return e;if(Kn??=document.createElement("canvas").getContext("2d"),!Kn)return null;Kn.fillStyle="#010203",Kn.fillStyle=t;let n=String(Kn.fillStyle);return n==="#010203"?null:dt(n)}var pu=t=>wn(t.r,t.g,t.b),Ru=(t,e)=>(Math.max(t,e)+.05)/(Math.min(t,e)+.05),Jn=4.5,th=3,gu=1.5,bu={code:7,background:12},_u={r:255,g:255,b:255,a:1},yu=(t,e)=>({r:t.r*t.a+e.r*(1-t.a),g:t.g*t.a+e.g*(1-t.a),b:t.b*t.a+e.b*(1-t.a),a:1});function eh(t,e={}){let n=e.imageTones,o=(d,p)=>{let h=typeof d=="object"&&d?.type==="image";return Zf(d,p,n).map(g=>({color:g,picture:h}))},r=t.fgColor??Mt,a=_r.flatMap(d=>{let p=t.eyeColors?.[d];return [...p?.outer?o(p.outer,Mt):[],...p?.inner?o(p.inner,Mt):[]]}),i=[...o(r,Mt),...o(t.eyeColor??r,Mt),...o(t.dotColor??r,Mt),...a],c=o(t.bgColor,gt),s=(c.length>0?c:[{color:"#ffffff",picture:false}]).map(d=>{let p=io(d.color);return {color:p?yu(p,_u):_u,picture:d.picture}}),l=i.flatMap(d=>{let p=io(d.color);return p?[{color:p,picture:d.picture}]:[]}),u=Number.POSITIVE_INFINITY,m=Jn,f=false;for(let d of l)for(let p of s){let h=pu(yu(d.color,p.color)),g=pu(p.color),b=Ru(h,g),_=p.picture?bu.background:d.picture?bu.code:Jn;b/_<u/m&&(u=b,m=_),h>g&&(f=true);}return {ratio:Number.isFinite(u)?u:Number.POSITIVE_INFINITY,required:m,inverted:f}}function nh(t,e){let{ratio:n,inverted:o,required:r}=eh(t,{imageTones:e});if(!Number.isFinite(n))return {checks:[],penalty:0,fails:false};let a=r/Jn,i=r!==Jn,c=Math.round(n*10)/10,s=[],l=0;return n>=r?s.push({id:"contrast",passed:true,message:`Contrast ${c}:1 between code and background`}):(l=n<gu*a?60:n<th*a?30:10,s.push({id:"contrast",passed:false,message:i?`Low contrast for a picture (${c}:1); ${r}:1 or more scans reliably`:`Low contrast (${c}:1); 4.5:1 or more scans reliably`,fix:i?"Lower the picture's opacity over a darker underlay (dots) or a lighter one (background)":"Use a darker code color or a lighter background"})),o?(l+=10,s.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):s.push({id:"polarity",passed:true,message:"Dark code on a light background"}),{checks:s,penalty:l,fails:n<gu*(r/Jn)}}function si(t){return xt.QrCode.encodeText(t.value,Et[Bt(t)]).getModules()}function rh(t){let{imageSettings:e}=t;if(!e)return {check:null,penalty:0};let n=si(t),o=Re(n,t.size??ft,It(n.length,t.margin??$t,t.shape),e);if(!o)return {check:null,penalty:0};let r=o.excavation??o,a=n.length,c=[[0,0],[a-8,0],[0,a-8]].some(([p,h])=>r.x<p+9&&r.x+r.w>p&&r.y<h+9&&r.y+r.h>h),s=a>21?a-9:null,l=s!==null&&r.x<s+5&&r.x+r.w>s&&r.y<s+5&&r.y+r.h>s;if(c||l)return {check:{id:"logo",passed:false,message:c?"The logo covers a corner eye":"The logo covers the small square near the bottom-right corner",fix:"Move the logo toward the center or make it smaller"},penalty:40};let u=r.w*r.h/(a*a),m=Bt(t),f=Math.round(u*100),d=kr({value:t.value,size:t.size??ft,margin:t.margin??$t,level:m,shape:t.shape},e);return !d||d.worst<=d.budget?{check:{id:"logo",passed:true,message:`Logo covers ${f}% of the code; error correction repairs it with room to spare`},penalty:0}:{check:{id:"logo",passed:false,message:`Logo covers ${f}% of the code and spoils ${d.worst} codewords in one block, which repairs ${d.correctable}`,fix:d.level==="H"?"Use a smaller logo":"Switch error correction to H or use a smaller logo"},penalty:d.worst>d.correctable?25:10}}function oh(t){let e=da(t.shape)?ze(t.margin??$t):t.margin??$t,n=si(t).length+2*e,o=e+(Qt(t.frame)?ua(t.frame)*n:0),r=Math.round(o*10)/10;return o>=4?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules`},penalty:0}:o>=1.5?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules (4 is ideal)`},penalty:0}:{check:{id:"quiet-zone",passed:false,message:"No quiet zone around the code",fix:"Leave clear space (about 10% of the code width) around it wherever you place it, or add a frame"},penalty:5}}function ah(t){let e=t.cornerEyePattern??"gear";return e==="curly"?{check:{id:"eye-shape",passed:false,message:"Curly eyes fail strict decoders such as ZXing-based apps",fix:"Pick square, rounded or gear eyes"},penalty:40}:e==="circle"?{check:{id:"eye-shape",passed:false,message:"Circle eyes only read in lenient decoders; many apps miss them",fix:"Pick square, rounded or gear eyes"},penalty:20}:{check:{id:"eye-shape",passed:true,message:`No known decoder issues with ${e} eyes`},penalty:0}}function tr(t){return new Promise((e,n)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>e(o),o.onerror=()=>n(new Error("Could not load image")),o.src=t;})}var ih=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><rect width="10" height="10" rx="2" fill="#808080"/></svg>')}`;async function sh(t){let{imageSettings:e}=t;if(!e||e.src.startsWith("data:"))return t;let n=ih;try{let o=await tr(e.src),{canvas:r,ctx:a}=vn(o.naturalWidth||256,o.naturalHeight||256);a.drawImage(o,0,0,r.width,r.height),n=r.toDataURL("image/png");}catch{}return {...t,imageSettings:{...e,src:n}}}async function ch(t){let e=new Map;for(let r of wu(t))if(!r.startsWith("data:"))try{let a=await tr(r),{canvas:i,ctx:c}=vn(a.naturalWidth||256,a.naturalHeight||256);c.drawImage(a,0,0,i.width,i.height),e.set(r,i.toDataURL("image/png")),i.remove();}catch{e.set(r,null);}if(e.size===0)return t;let n=r=>{if(typeof r!="object"||r?.type!=="image")return r;let a=e.get(r.src);return a===void 0?r:a?{...r,src:a}:r.underlay??Mt},o=t.eyeColors?Object.fromEntries(Object.entries(t.eyeColors).map(([r,a])=>[r,a&&{outer:n(a.outer),inner:n(a.inner)}])):void 0;return {...t,bgColor:n(t.bgColor),fgColor:n(t.fgColor),eyeColor:n(t.eyeColor),dotColor:n(t.dotColor),...o&&{eyeColors:o}}}async function Eu(t,e,n,o,r){let a=[],i=0,c=nh(t,r);i+=c.penalty;let s=rh(t);i+=s.penalty;let l=oh(t);i+=l.penalty;let u=ah(t);i+=u.penalty;let m=ei(t),f=m?.kind==="eye"?null:m;f&&f.kind!=="sharp-dot-eye"&&(i+=10);let d=await ai();ve(o);let p=si(t).length,h=p+2*It(p,t.margin??$t,t.shape),g=[],b=false;for(let[C,M]of n.entries()){await $u(),ve(o);let $=ii(d,e,M,h,S=>ri(S,t.value));i+=Su(C,n.length,$),g.push(Cu(M,n,$)),C===n.length-1&&$==="fail"&&(b=true);}a.push(...g,...c.checks),s.check&&a.push(s.check),a.push(u.check,l.check),f&&a.push({id:"style-pair",passed:false,message:f.message,fix:f.fix});let _=b||c.fails,y=Math.max(0,Math.min(100,100-i));return _&&(y=Math.min(y,30)),{score:y,grade:Mu(y,_),checks:a}}function Au(t){return [...t.sizes??xu].filter(e=>e>0).sort((e,n)=>e-n)}async function g5(t,e={}){oi();let{signal:n}=e,o=Au(e),r=await ch(await sh(je({...t,size:t.size??ft},ao)));ve(n);let a={};for(let u of wu(t))try{let m=await Jf(u);m&&(a[u]=m);}catch{}ve(n);let i=await Wt(r),c=await tr(i);ve(n);let s=ue(ao,t.frame);return await Eu(t,u=>{let m=u/ao,f=s.width*m,d=s.height*m,p=Math.max(8,Math.round(u*.12)),{canvas:h,ctx:g}=vn(f+2*p,d+2*p);g.fillStyle="#ffffff",g.fillRect(0,0,h.width,h.height),g.drawImage(c,p,p,f,d);let b=g.getImageData(0,0,h.width,h.height);return h.remove(),b},o,n,a)}var b5=ao;async function _5(t,e,n={}){let{width:o,height:r}=e;if(!(o>0&&r>0)||e.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=Au(n),i=t.size??ft,c=ue(i,t.frame),s=o*i/c.width,l={data:lh(e),width:o,height:r};return await Eu(t,m=>{let f=Pu(l,m/s),d=Math.max(8,Math.round(m*.12));return uh(f,d)},a,n.signal)}function lh(t){let{data:e,width:n,height:o}=t,r=new Uint8ClampedArray(n*o*4);for(let a=0;a<n*o*4;a+=4){let i=e[a+3]/255;for(let c=0;c<3;c++)r[a+c]=e[a+c]*i+255*(1-i);r[a+3]=255;}return r}function uh(t,e){let n=t.width+2*e,o=t.height+2*e,r=new Uint8ClampedArray(n*o*4).fill(255);for(let a=0;a<t.height;a++)r.set(t.data.subarray(a*t.width*4,(a+1)*t.width*4),((a+e)*n+e)*4);return {data:r,width:n,height:o,colorSpace:"srgb"}}var Pe=(t,e)=>Math.hypot(t.x-e.x,t.y-e.y);function oo(t,e){return .299*t[e]+.587*t[e+1]+.114*t[e+2]}function mh(t,e){let n=0;for(let c=0;c<256;c++)n+=c*t[c];let o=0,r=0,a=0,i=128;for(let c=0;c<256;c++){if(r+=t[c],r===0)continue;let s=e-r;if(s===0)break;o+=c*t[c];let l=o/r,u=(n-o)/s,m=r*s*(l-u)**2;m>a&&(a=m,i=c);}return i}async function dh(t){if(!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=URL.createObjectURL(t);try{let n=await tr(e);return await n.decode?.().catch(()=>{}),n}finally{setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function y5(t,e={}){oi();let{signal:n}=e,o=[...e.sizes??xu].filter(G=>G>0).sort((G,et)=>G-et),r=await ai(),a=await dh(t);ve(n);let i=a.naturalWidth||a.width,c=a.naturalHeight||a.height;if(!(i&&c))throw new Error("Could not read this image");let s=Math.min(1,1600/Math.max(i,c)),{canvas:l,ctx:u}=vn(i*s,c*s);u.fillStyle="#ffffff",u.fillRect(0,0,l.width,l.height),u.drawImage(a,0,0,l.width,l.height);let m=u.getImageData(0,0,l.width,l.height),f=r(m.data,m.width,m.height);if(ve(n),!f){let G=await tc(a,0,false);return l.remove(),typeof G!="string"||G==="NO_QR"?{data:null,version:null,score:0,grade:"fails",checks:[{id:"decode",passed:false,message:"No QR code found in this image",fix:"Try a sharper, well-lit, straight-on photo or a screenshot"}]}:{data:G,version:null,score:55,grade:"risky",checks:[{id:"decode",passed:false,message:"Decoded only after cropping; the code is small or hard to find in this image",fix:"Make the code bigger relative to its surroundings"}]}}let{location:d,version:p}=f,h=17+4*p,g=(Pe(d.topLeftCorner,d.topRightCorner)+Pe(d.bottomLeftCorner,d.bottomRightCorner)+Pe(d.topLeftCorner,d.bottomLeftCorner)+Pe(d.topRightCorner,d.bottomRightCorner))/4,b=g/h,_=[d.topLeftCorner,d.topRightCorner,d.bottomRightCorner,d.bottomLeftCorner],y=Math.max(0,Math.floor(Math.min(..._.map(G=>G.x)))),C=Math.min(m.width,Math.ceil(Math.max(..._.map(G=>G.x)))),M=Math.max(0,Math.floor(Math.min(..._.map(G=>G.y)))),$=Math.min(m.height,Math.ceil(Math.max(..._.map(G=>G.y)))),S=[],R=0,w=new Array(256).fill(0),P=0;for(let G=M;G<$;G++)for(let et=y;et<C;et++){let X=Math.round(oo(m.data,(G*m.width+et)*4));w[X]=w[X]+1,P++;}let v=mh(w,P),L={dark:[0,0,0,0],light:[0,0,0,0]};for(let G=M;G<$;G++)for(let et=y;et<C;et++){let X=(G*m.width+et)*4,pt=oo(m.data,X)<=v?L.dark:L.light;pt[0]=pt[0]+m.data[X],pt[1]=pt[1]+m.data[X+1],pt[2]=pt[2]+m.data[X+2],pt[3]=pt[3]+1;}let I=G=>{let et=Math.max(G[3],1);return wn(G[0]/et,G[1]/et,G[2]/et)},F=I(L.dark),O=I(L.light),T=Ru(F,O),B=Math.round(T*10)/10;T>=4.5?S.push({id:"contrast",passed:true,message:`Contrast ${B}:1 in the image`}):(R+=T<2?30:10,S.push({id:"contrast",passed:false,message:`Low contrast in the image (${B}:1)`,fix:"Use a darker code on a lighter background, or better lighting for photos"}));let Q=[d.topLeftFinderPattern,d.topRightFinderPattern,d.bottomLeftFinderPattern].map(G=>{let et=Math.min(m.width-1,Math.max(0,Math.round(G.x))),X=Math.min(m.height-1,Math.max(0,Math.round(G.y)));return oo(m.data,(X*m.width+et)*4)}).filter(G=>G>v).length>=2;Q?(R+=10,S.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):S.push({id:"polarity",passed:true,message:"Dark code on a light background"});let U=Math.max(2,Math.round(b*2)),tt={minX:y-U,maxX:C+U,minY:M-U,maxY:$+U};if(tt.minX<0||tt.minY<0||tt.maxX>m.width||tt.maxY>m.height)S.push({id:"quiet-zone",passed:true,skipped:true,message:"The image is cropped too tight to check the quiet zone"});else {let G=0,et=0;for(let X=tt.minY;X<tt.maxY;X++)for(let pt=tt.minX;pt<tt.maxX;pt++){if(pt>=y&&pt<C&&X>=M&&X<$)continue;let Ln=oo(m.data,(X*m.width+pt)*4);(Q?Ln>v:Ln<=v)&&G++,et++;}G/Math.max(et,1)>.12?(R+=10,S.push({id:"quiet-zone",passed:false,message:"Something dark touches the code; the quiet zone isn't clear",fix:"Leave clear space (about 4 modules) around the code"})):S.push({id:"quiet-zone",passed:true,message:"Clear space around the code"});}b<2?S.push({id:"resolution",passed:false,message:`Low resolution: about ${Math.round(b*10)/10} px per module`,fix:"Use a larger image, or export the code at a bigger size"}):S.push({id:"resolution",passed:true,message:`About ${Math.round(b)} px per module`});let st=Math.round(b*4),k=Math.max(0,y-st),q=Math.max(0,M-st),z=Math.min(m.width,C+st)-k,Ct=Math.min(m.height,$+st)-q,Le=G=>{let et=G/g,X=vn(z*et,Ct*et);X.ctx.drawImage(l,k,q,z,Ct,0,0,X.canvas.width,X.canvas.height);let pt=X.ctx.getImageData(0,0,X.canvas.width,X.canvas.height);return X.canvas.remove(),pt},Nt=[],oe=false;for(let[G,et]of o.entries()){await $u(),ve(n);let X=ii(r,Le,et,h,pt=>pt?.data===f.data);R+=Su(G,o.length,X),Nt.push(Cu(et,o,X)),G===o.length-1&&X==="fail"&&(oe=true);}l.remove();let Ie=Math.max(0,Math.min(100,100-R));return oe&&(Ie=Math.min(Ie,30)),{data:f.data,version:p,score:Ie,grade:Mu(Ie,oe),checks:[...Nt,...S]}}var fh=[320];function Pu(t,e){let n=Math.min(1,e),o=Math.max(1,Math.round(t.width*n)),r=Math.max(1,Math.round(t.height*n)),a=new Uint8ClampedArray(o*r*4),i=t.width/o,c=t.height/r;for(let s=0;s<r;s++){let l=Math.floor(s*c),u=Math.max(l+1,Math.min(t.height,Math.floor((s+1)*c)));for(let m=0;m<o;m++){let f=Math.floor(m*i),d=Math.max(f+1,Math.min(t.width,Math.floor((m+1)*i))),p=[0,0,0,0];for(let b=l;b<u;b++)for(let _=f;_<d;_++){let y=(b*t.width+_)*4;for(let C=0;C<4;C++)p[C]=p[C]+t.data[y+C];}let h=(u-l)*(d-f),g=(s*o+m)*4;for(let b=0;b<4;b++)a[g+b]=p[b]/h;}}return {data:a,width:o,height:r,colorSpace:"srgb"}}function hh(t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(Uint8Array.from(t.binaryData))}catch{return t.data}}async function x5(t,e,n={}){let{width:o,height:r}=t;if(!(o>0&&r>0)||t.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=await ai(),i={data:t.data instanceof Uint8ClampedArray?t.data:Uint8ClampedArray.from(t.data),width:o,height:r},c=a(i.data,o,r,{inversionAttempts:"dontInvert"});if(!c)return {data:null,version:null,passed:false};let s=hh(c),{version:l,location:u}=c;if(!ri(c,e))return {data:s,version:l,passed:false};let m=17+4*l,f=(Pe(u.topLeftCorner,u.topRightCorner)+Pe(u.bottomLeftCorner,u.bottomRightCorner)+Pe(u.topLeftCorner,u.bottomLeftCorner)+Pe(u.topRightCorner,u.bottomRightCorner))/4;for(let d of n.sizes??fh)if(ii(a,h=>Pu(i,h/f),d,m,h=>ri(h,e))!=="pass")return {data:s,version:l,passed:false};return {data:s,version:l,passed:true}}var ph=16,vu=.01;function gh(t){let e=new Float64Array(256);for(let s of t)e[Math.min(255,Math.max(0,Math.round(s*255)))]++;let n=t.length,o=0;for(let s=0;s<256;s++)o+=s*e[s];let r=0,a=0,i=0,c=128;for(let s=0;s<256;s++){if(a+=e[s],a===0)continue;let l=n-a;if(l===0)break;r+=s*e[s];let u=r/a,m=(o-r)/l,f=a*l*(u-m)**2;f>i&&(i=f,c=s);}return (c+.5)/255}function bh(t,e){let{width:n,height:o,data:r}=t,a=n*o,i=new Uint8Array(a),c=0;for(let d=0;d<a;d++)r[d*4+3]<128&&c++;if(e==="alpha"||e==="auto"&&c>a*.02&&c<a*.98){for(let d=0;d<a;d++)i[d]=r[d*4+3]>=128?1:0;return i}let l=new Float32Array(a);for(let d=0;d<a;d++){let p=r[d*4+3]/255,h=.2126*r[d*4]+.7152*r[d*4+1]+.0722*r[d*4+2];l[d]=1-(h*p+255*(1-p))/255;}let u=gh(l);for(let d=0;d<a;d++)i[d]=l[d]>u?1:0;let m=0,f=0;for(let d=0;d<n;d++)for(let p of [0,o-1])m++,f+=i[p*n+d];for(let d=1;d<o-1;d++)for(let p of [0,n-1])m++,f+=i[d*n+p];if(f>m/2)for(let d=0;d<a;d++)i[d]=i[d]?0:1;return i}function Lu(t,e,n,o){for(let r of [1,0]){let a=new Uint8Array(t.length);for(let i=0;i<t.length;i++){if(a[i]||t[i]!==r)continue;let c=[i];a[i]=1;let s=false;for(let u of c){let m=u%e,f=(u-m)/e;(m===0||f===0||m===e-1||f===n-1)&&(s=true);for(let[d,p]of [[m-1,f],[m+1,f],[m,f-1],[m,f+1]]){if(d<0||p<0||d>=e||p>=n)continue;let h=p*e+d;!a[h]&&t[h]===r&&(a[h]=1,c.push(h));}}if((r===1||!s)&&c.length<o)for(let u of c)t[u]=r?0:1;}}}function Iu(t,e={}){let{width:n,height:o,data:r}=t;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Silhouette pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=bh(t,e.mode??"auto"),i=a.reduce((S,R)=>S+R,0);Lu(a,n,o,Math.max(16,i*vu));let c=n,s=o,l=-1,u=-1;for(let S=0;S<o;S++)for(let R=0;R<n;R++)a[S*n+R]&&(c=Math.min(c,R),s=Math.min(s,S),l=Math.max(l,R),u=Math.max(u,S));if(l<0)throw new Error("No shape found: use a picture with a dark or opaque shape on a light or clear background");let m=l-c+1,f=u-s+1;if(Math.max(m,f)<ph)throw new Error("The shape is too small to trace; use a bigger picture");let p=Math.min(Math.max(Math.round(e.cells??qt),te),qt)/Math.max(m,f),h=Math.max(te,Math.round(m*p)),g=Math.max(te,Math.round(f*p)),b=Math.max(1,Math.round(m*p)),_=Math.max(1,Math.round(f*p)),y=Math.floor((h-b)/2),C=Math.floor((g-_)/2),M=new Uint8Array(h*g);for(let S=0;S<_;S++){let R=s+Math.floor(S*f/_),w=Math.max(R+1,s+Math.floor((S+1)*f/_));for(let P=0;P<b;P++){let v=c+Math.floor(P*m/b),L=Math.max(v+1,c+Math.floor((P+1)*m/b)),I=0;for(let F=R;F<w;F++)for(let O=v;O<L;O++)I+=a[F*n+O];M[(S+C)*h+P+y]=I*2>=(w-R)*(L-v)?1:0;}}let $=M.reduce((S,R)=>S+R,0);if(Lu(M,h,g,Math.max(4,$*vu)),!M.includes(1))throw new Error("The shape is too small to trace; use a bigger picture");return {type:"silhouette",width:h,height:g,cells:Array.from(M,S=>S?"1":"0").join("")}}var ci=512;async function _h(t){if(typeof t!="string"&&!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=typeof t=="string"?t:URL.createObjectURL(t);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the picture")),r.src=e;})}finally{typeof t!="string"&&setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function yh(t,e={}){if(typeof document>"u")throw new Error("loadQRSilhouette needs a browser; pass decoded pixels to createQRSilhouette instead");let n=await _h(t),o=n.naturalWidth||n.width||ci,r=n.naturalHeight||n.height||ci,a=ci/Math.max(o,r),i=Math.max(1,Math.round(o*a)),c=Math.max(1,Math.round(r*a)),s=document.createElement("canvas");s.width=i,s.height=c;let l=s.getContext("2d",{willReadFrequently:true});if(!l)throw new Error("Could not get a canvas context");l.drawImage(n,0,0,i,c);let u;try{u=l.getImageData(0,0,i,c);}catch{throw new Error("Could not read the picture (cross-origin images need CORS); upload it instead")}finally{s.remove();}return Iu(u,e)}/**
24
+ end`;function Ka(t){let e="(";for(let n of t){let o=n.codePointAt(0)??63;n==="("||n===")"||n==="\\"?e+=`\\${n}`:o>=32&&o<127?e+=n:o>=160&&o<=255?e+=`\\${o.toString(8).padStart(3,"0")}`:e+="?";}return `${e})`}var Ja=class extends Mn{out=[];shadingNames=new Map;cmyk;images;usesLevel3=false;constructor(e,n,o,r){super(n,o),this.cmyk=e,this.images=r;}color(e){if(this.cmyk){let[n,o,r,a]=ge(e.r,e.g,e.b);return `${x(n)} ${x(o)} ${x(r)} ${x(a)} cmyk`}return `${x(e.r/255)} ${x(e.g/255)} ${x(e.b/255)} rg`}tracePath(e,n){let o=["n"],r=false;for(let a of e)if(a.op==="M"||a.op==="L"&&!r){let[i,l]=H(n,a.x,a.y);o.push(`${x(i)} ${x(l)} m`),r=true;}else if(a.op==="L"){let[i,l]=H(n,a.x,a.y);o.push(`${x(i)} ${x(l)} l`);}else if(a.op==="C"){if(!r)continue;let[i,l]=H(n,a.x1,a.y1),[s,c]=H(n,a.x2,a.y2),[u,m]=H(n,a.x,a.y);o.push(`${x(i)} ${x(l)} ${x(s)} ${x(c)} ${x(u)} ${x(m)} c`);}else r&&o.push("h");return o.join(" ")}beginClip(e,n,o){return this.out.push(`gsave ${this.tracePath(e,n)} ${o?"eoclip":"clip"} n`),true}endClip(){this.out.push("grestore");}rect(e,n,o,r,a){this.out.push(`${this.color(e)} n ${x(n)} ${x(o)} m ${x(n+r)} ${x(o)} l ${x(n+r)} ${x(o+a)} l ${x(n)} ${x(o+a)} l h f`);}shade(e,n,o){let r=ut(n.matrix,o.matrix);if(!Se(r))return;let a=Yr(o,this.cmyk?"cmyk":"rgb"),i=this.shadingNames.get(a);i||(i=`Sh${this.shadingNames.size}`,this.shadingNames.set(a,i)),this.usesLevel3=true;let l=n.fillRule==="evenodd"?"eoclip":"clip";this.out.push(`gsave ${this.tracePath(e,n.matrix)} ${l} n [${Xr(r)}] concat ${i} shfill grestore`);}paint(e,n,o){if(e.length===0)return;let r=o.opacity??1;if(r<=0)return;let a=this.resolveFill(o.fill,e,o.viewport,(o.fillOpacity??1)*r);a&&"pattern"in a?this.paintPattern(e,o,a.pattern,a.alpha):a&&"gradient"in a&&this.shade(e,o,{...a.gradient,stops:a.gradient.stops.map(m=>({...m,color:this.flatten({...m.color,a:m.color.a*a.alpha})}))});let i=a&&"color"in a?this.flatten(a.color):null,l=o.strokeWidth>0?this.resolveColor(o.stroke):null,s=l&&this.flatten({...l,a:l.a*r});if(!(i||s))return;let c=this.tracePath(e,o.matrix),u=o.fillRule==="evenodd"?"ef":"f";i&&s?this.out.push(`gsave ${this.color(i)} ${c} ${u} grestore`):i&&this.out.push(`${this.color(i)} ${c} ${u}`),s&&this.out.push(`${this.color(s)} ${x(o.strokeWidth*sn(o.matrix))} w ${c} s`);}text(e,n){let o=e.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let a=sn(n.matrix),[i,l]=H(n.matrix,j(e.attrs.x,n.viewport[0]),j(e.attrs.y,n.viewport[1])),c=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600?"/QRDX-Bold":"/QRDX-Regular",u=x(n.fontSize*a),m=Number.parseFloat(e.attrs["data-max-width"]??""),f=m>0?` dup stringwidth pop dup ${x(m*a)} gt {${x(m*a)} exch div ${u} mul ${c} findfont exch scalefont setfont} {pop} ifelse`:"",d=n.textAnchor==="middle"?" dup stringwidth pop 2 div neg 0 rmoveto":n.textAnchor==="end"?" dup stringwidth pop neg 0 rmoveto":"",p=Math.atan2(n.matrix[1],n.matrix[0])*180/Math.PI;if(Math.abs(p)>.01){this.out.push(`gsave ${this.color(r)} ${c} findfont ${u} scalefont setfont ${x(i)} ${x(l)} translate ${x(p)} rotate ${Ka(o)}${f} 0 0 moveto${d} show grestore`);return}this.out.push(`gsave ${this.color(r)} ${c} findfont ${u} scalefont setfont ${Ka(o)}${f} ${x(i)} ${x(l)} moveto${d} show grestore`);}image(e,n){let o=e.attrs.href??e.attrs["xlink:href"],r=o?this.images.get(o):void 0;if(!r)return;let a=j(e.attrs.x,n.viewport[0]),i=j(e.attrs.y,n.viewport[1]),l=j(e.attrs.width,n.viewport[0]),s=j(e.attrs.height,n.viewport[1]);if(l<=0||s<=0)return;let[c,u]=H(n.matrix,a,i),[m,f]=H(n.matrix,a+l,i+s),{components:d}=r,p=d===1?"/DeviceGray":d===4?"/DeviceCMYK":"/DeviceRGB",h=Array.from({length:d},()=>"0 1").join(" "),g="/ASCII85Decode filter";r.kind==="jpeg"?(g+=" /DCTDecode filter",r.progressive&&(this.usesLevel3=true)):r.compressed&&(g+=" /FlateDecode filter",this.usesLevel3=true),this.out.push(["gsave",`${x(Math.min(c,m))} ${x(Math.min(u,f))} translate ${x(Math.abs(m-c))} ${x(Math.abs(f-u))} scale`,`${p} setcolorspace`,`<< /ImageType 1 /Width ${r.width} /Height ${r.height} /BitsPerComponent 8 /Decode [${h}] /ImageMatrix [${r.width} 0 0 -${r.height} 0 ${r.height}] /DataSource currentfile ${g} >> image`,gh(r.bytes),"grestore"].join(`
25
+ `));}};async function wu(t,e={}){let n=fe(t);if(!n)throw new Error("Could not read the SVG to convert to EPS");let o=j(n.attrs.width,0,0)||512,r=j(n.attrs.height,0,0)||o,a=e.width??o;if(!(Number.isFinite(a)&&a>0))throw new Error("EPS width must be a positive number of points");let i=a/o,l=r*i,s=Math.max(0,e.bleed??0),c=a+2*s,u=l+2*s,m=e.colorMode==="cmyk",f=new Map;for(let b of tr(n,new Set)){let _=await ph(b,m);_&&f.set(b,_);}let d=new Ja(m,Jn(n,new Map),Zr(n),f);ro(d,{bgColor:e.background??"#ffffff"});let h={matrix:ut([1,0,0,-1,s,u-s],[i,0,0,i,0,0]),viewport:[o,r],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},g=s>0?e.bleedColor??void 0:void 0;if(!(g&&d.paintBleed(n,h,g,[0,0,c,u]))){let b=g?d.resolveColor(g):null;b&&d.rect(b,0,0,c,u);}d.walk(n,h,true);let y=(e.title??"QR code").replace(/[^\x20-\x7e]/g,"?");return ["%!PS-Adobe-3.0 EPSF-3.0",`%%BoundingBox: 0 0 ${Math.ceil(c)} ${Math.ceil(u)}`,`%%HiResBoundingBox: 0 0 ${x(c)} ${x(u)}`,`%%Title: ${Ka(y)}`,"%%Creator: qrdx",`%%LanguageLevel: ${d.usesLevel3?3:2}`,"%%DocumentData: Clean7Bit","%%EndComments","%%BeginProlog",bh,"%%EndProlog","qrdxdict begin",...Array.from(d.shadingNames,([b,_])=>`/${_} ${b} def`),"gsave",...d.out,"grestore","end","showpage","%%Trailer","%%EOF",""].join(`
26
+ `)}var Cu="EPS can't carry image fills: PostScript has no transparency and would repeat the picture for every dot. Download PDF, SVG or PNG instead.";function Mu(t){return [t.bgColor,t.fgColor,t.eyeColor,t.dotColor,...Object.values(t.eyeColors??{}).flatMap(n=>[n?.outer,n?.inner])].some(n=>typeof n=="object"&&n?.type==="image")}async function io(t,e={}){if(Mu(t))throw new Error(Cu);let n=ao(t,{size:e.sizeMm??mh,unit:"mm",bleed:e.bleedMm}),o=await er(t);return await wu(o,{width:n.trimWidth*Su,bleed:n.bleed*Su,bleedColor:n.bleed>0?no(t,o):Ha(t),colorMode:e.colorMode,background:wt(t.bgColor,_t)})}function so(t){return `data:application/postscript;base64,${btoa(t)}`}async function yh(t,e={}){let n=await io(t,e);te(so(n),e.filename??"qr-code-print.eps");}var ti={png:{mimeType:"image/png",extension:"png",vector:false},jpg:{mimeType:"image/jpeg",extension:"jpg",vector:false},webp:{mimeType:"image/webp",extension:"webp",vector:false},svg:{mimeType:"image/svg+xml",extension:"svg",vector:true},pdf:{mimeType:"application/pdf",extension:"pdf",vector:false},eps:{mimeType:"application/postscript",extension:"eps",vector:true}},a_={small:{width:200,height:200},medium:{width:400,height:400},large:{width:800,height:800},xlarge:{width:1200,height:1200},"2xl":{width:1600,height:1600},"3xl":{width:2e3,height:2e3}};function ei(t,e){return t<50||e<50?{isValid:false,error:"Size must be at least 50x50 pixels"}:t>5e3||e>5e3?{isValid:false,error:"Size must not exceed 5000x5000 pixels"}:t!==e?{isValid:false,error:"Width and height must be equal for QR codes"}:{isValid:true}}function Ue(t,e){let{imageSettings:n,size:o}=t;if(!(n&&o)||o===e)return {...t,size:e};let r=e/o;return {...t,size:e,imageSettings:{...n,width:n.width*r,height:n.height*r,...n.x!=null&&{x:n.x*r},...n.y!=null&&{y:n.y*r},...n.padding!=null&&{padding:n.padding*r}}}}function te(t,e){let n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n);}var Ru=t=>(ti[t]??ti.png).mimeType;function _h(t,e,n){let{extension:o,vector:r}=ti[t];if(r)return `qr-code.${o}`;let{width:a,height:i}=ie(e.width,n);return `qr-code-${Math.round(a)}x${Math.round(i)}.${o}`}async function Eu(t,e={}){let n=await Cn(t,"image/webp",true);try{return await jr(n,e)}finally{n.remove();}}var xh=25.4/72;async function Au(t){let e=await io(t,{sizeMm:(t.size??ft)*xh});return so(e)}async function Pu(t){let e;try{({jsPDF:e}=await import('jspdf'));}catch(f){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${f})`)}let n=await zt(t),o=decodeURIComponent(n.replace("data:image/svg+xml,","")),r;try{let f=new TextEncoder().encode(o),d=Array.from(f,h=>String.fromCharCode(h)).join("");r=`data:image/svg+xml;base64,${btoa(d)}`;}catch(f){throw new Error(`Failed to encode SVG for PDF conversion: ${f}`)}let{width:a,height:i}=ie(t.size||ft,t.frame),l=await new Promise((f,d)=>{let p=new Image,h=document.createElement("canvas");h.width=Math.round(a),h.height=Math.round(i);let g=h.getContext("2d");if(!g){d(new Error("Could not get canvas context"));return}let y=setTimeout(()=>{h.remove(),d(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);p.onload=()=>{clearTimeout(y);try{g.drawImage(p,0,0,h.width,h.height),f(h);}catch(b){clearTimeout(y),h.remove(),d(new Error(`Failed to draw image to canvas: ${b}`));}},p.onerror=()=>{clearTimeout(y),h.remove(),d(new Error("Could not load SVG for PDF conversion"));},p.src=r;}),s=l.toDataURL("image/png",1),c=a*.264583,u=i*.264583,m=new e({orientation:c>u?"landscape":"portrait",unit:"mm",format:[c,u]});return m.addImage(s,"PNG",0,0,c,u),l.remove(),m.output("dataurlstring")}async function i_(t,e){let{format:n,size:o,filename:r,quality:a}=e,i=ei(o.width,o.height);if(!i.isValid)throw new Error(i.error);let l=Ue(t,o.width),s=r||_h(n,o,t.frame);try{if(n==="svg"){let c=await zt(l);te(c,s);}else if(n==="pdf"){let c=await Pu(l);te(c,s);}else if(n==="eps")te(await Au(l),s);else if(n==="webp"){let c=await Eu(l,{quality:a});te(await Kn(c),s);}else {let c=Ru(n),u=await Cn(l,c);if(typeof u=="string")te(u,s);else throw new Error("Failed to generate image data URL")}}catch(c){throw console.error(`Error downloading ${n.toUpperCase()}:`,c),c}}async function s_(t,e,n,o={}){let r=ei(n.width,n.height);if(!r.isValid)throw new Error(r.error);let a=Ue(t,n.width);if(e==="svg")return await zt(a);if(e==="pdf")return await Pu(a);if(e==="eps")return await Au(a);if(e==="webp")return await Kn(await Eu(a,o));let i=Ru(e),l=await Cn(a,i);if(typeof l=="string")return l;throw new Error("Failed to generate QR code data URL")}async function l_(t,e={width:ft,height:ft}){try{let n=ei(e.width,e.height);if(!n.isValid)throw new Error(n.error);let o=Ue(t,e.width),r=Cn(o,"image/png",!0).then(a=>new Promise((i,l)=>{let s=a;s.toBlob(c=>{s.remove(),c?i(c):l(new Error("Failed to create blob from canvas"));},"image/png");}));await navigator.clipboard.write([new ClipboardItem({"image/png":r})]);}catch(n){throw console.error("Error copying to clipboard:",n),n}}async function c_(t){let e=await zt(t);return decodeURIComponent(e.replace("data:image/svg+xml,",""))}var It={maxBytes:2e5,maxElements:500,maxDepth:16,maxInputSegments:4e3,maxColors:8,artboardSide:1e3,decimals:1,padding:.06},at=class extends Error{},$h={script:t=>`Removed ${gt(t,"script")}`,style:t=>`Removed ${gt(t,"style sheet")}: colors set with CSS classes are lost. Export with presentation attributes (Illustrator: Styling \u2192 Presentation Attributes)`,"foreign-object":t=>`Removed ${gt(t,"foreignObject element")}`,image:t=>`Removed ${gt(t,"image")}: frames are vector shapes only`,use:t=>`Removed ${gt(t,"<use> reference")}: ungroup or detach symbols before exporting`,text:t=>`Removed ${gt(t,"text element")}: add text as labels in the frame editor`,effects:t=>`Removed ${gt(t,"filter, mask, clip path or pattern")}`,animation:t=>`Removed ${gt(t,"animation")}`,unknown:t=>`Removed ${gt(t,"unsupported element")}`,"nested-svg":t=>`Removed ${gt(t,"nested <svg>")}: flatten it first`,handlers:t=>`Removed ${gt(t,"event handler attribute")}`,links:t=>`Removed ${gt(t,"link")} (href)`,"external-paint":t=>`Removed ${gt(t,"fill or stroke")} that referenced something outside the file`,gradient:t=>`Flattened ${gt(t,"gradient")} to its first color: add gradients in the frame editor`,opacity:t=>`Made ${gt(t,"semi-transparent shape")} opaque (print files have no transparency)`,"invalid-paint":t=>`${gt(t,"color")} couldn't be read and fell back to the parent color`,stroke:t=>`Removed ${gt(t,"stroke")} on paths, polygons or polylines: outline strokes before exporting (Figma: Outline stroke)`,dash:t=>`Drew ${gt(t,"dashed stroke")} as solid`,clipped:t=>`Cut ${gt(t,"shape")} at the edge of the artboard`,outside:t=>`Removed ${gt(t,"shape")} outside the artboard`,colors:t=>`Merged ${gt(t,"color")} with similar ones (${It.maxColors} at most)`,"qr-placed":()=>'No QR placeholder found (a rect with id "qr"): the code was centered; place it in the frame editor'};function gt(t,e){return `${t} ${e}${t===1?"":"s"}`}var ai=class{counts=new Map;add(e,n=1){this.counts.set(e,(this.counts.get(e)??0)+n);}list(){return [...this.counts].map(([e,n])=>({code:e,count:n,message:$h[e](n)}))}},Sh=/^\s*<\?xml\s[^?>]*\?>/,ni=/[A-Za-z_][\w:.-]*/y,ri=/<\/([A-Za-z_][\w:.-]*)\s*>/y,lo=/\s*/y,wh=/[A-Za-z_:][\w:.-]*/y,Ch=/[^"<]*/y,Mh=/[^'<]*/y;function Rn(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function vu(t,e){let n=Rn(lo,t,e),o=Rn(wh,t,n);if(n===e||o===n)return -1;let r=Rn(lo,t,o);if(t[r]!=="=")return -1;let a=Rn(lo,t,r+1),i=t[a];if(i!=='"'&&i!=="'")return -1;let s=Rn(i==='"'?Ch:Mh,t,a+1);return t[s]===i?s+1:-1}function Rh(t,e){let n=Rn(lo,t,e);return t[n]===">"?{end:n+1,selfClosing:false}:t.startsWith("/>",n)?{end:n+2,selfClosing:true}:null}function Eh(t){let e=[],n=0,o="",r=0;for(;r<t.length;){let a=t.indexOf("<",r);if(a<0)break;if(r=a,t.startsWith("<!--",r)){let c=t.indexOf("-->",r+4);if(c<0)throw new at("The SVG has an unclosed comment");r=c+3;continue}if(t.startsWith("<![CDATA[",r)){let c=t.indexOf("]]>",r+9);if(c<0)throw new at("The SVG has an unclosed CDATA section");r=c+3;continue}if(t.startsWith("<?",r)){let c=t.indexOf("?>",r+2);if(c<0)throw new at("The SVG has an unclosed declaration");r=c+2;continue}if(t.startsWith("<!",r))throw new at("DOCTYPE and other declarations are not allowed");if(t[r+1]==="/"){ri.lastIndex=r;let c=ri.exec(t);if(!c)throw new at("The SVG has a malformed closing tag");if(e.pop()!==c[1])throw new at(`The SVG closes <${c[1]}> out of order`);r=ri.lastIndex;continue}ni.lastIndex=r+1;let i=ni.exec(t);if(!i)throw new at("The SVG has a malformed tag");let l=ni.lastIndex;for(let c=vu(t,l);c>=0;c=vu(t,l))l=c;let s=Rh(t,l);if(!s)throw new at(`The SVG has a malformed <${i[0]}> tag (attributes must be quoted and may not contain "<")`);if(n++,n>It.maxElements)throw new at(`The SVG has more than ${It.maxElements} elements`);if(o||(o=i[0]),!s.selfClosing&&(e.push(i[0]),e.length>It.maxDepth))throw new at(`The SVG nests elements more than ${It.maxDepth} deep`);r=s.end;}if(e.length>0)throw new at(`The SVG doesn't close <${e.at(-1)}>`);return o}function Ah(t){if(typeof t!="string")throw new at("Expected SVG markup as a string");let e=new TextEncoder().encode(t).length;if(e>It.maxBytes)throw new at(`The SVG is ${Math.ceil(e/1e3)} KB; the limit is ${It.maxBytes/1e3} KB`);if(/<!(?:DOCTYPE|ENTITY|ATTLIST|ELEMENT|NOTATION)/i.test(t))throw new at("DOCTYPE and entity declarations are not allowed");let n=t.replace(Sh,"");if(n.includes("<?"))throw new at("Processing instructions (such as xml-stylesheet) are not allowed");if(Eh(n)!=="svg")throw new at("The file must start with an <svg> element");return n}var oi=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function Ut(t){let e=t?.replace(/!important/i,"").trim();return e===""||e==="inherit"?void 0:e}function ii(t,e,n,o){let r=t.trim();if(r==="none"||r==="transparent")return null;if(/^url\(/i.test(r)){let i=/^url\(\s*['"]?#([^)'"\s]+)['"]?\s*\)/i.exec(r)?.[1],l=i?n.get(i):void 0;return l?(o.add("gradient"),ii(l,e,n,o)):(o.add("external-paint"),null)}let a=dt(r==="currentColor"?e.color:r);return a?a.a<=0?null:`#${oi(a.r)}${oi(a.g)}${oi(a.b)}`:(o.add("invalid-paint"),null)}function Ph(t){let e=new Map,n=r=>{(r.name==="linearGradient"||r.name==="radialGradient")&&r.attrs.id&&e.set(r.attrs.id,r);for(let a of r.children)n(a);};n(t);let o=new Map;for(let[r,a]of e){let i=a.children.find(s=>s.name==="stop");if(!i){let s=(a.attrs.href??a.attrs["xlink:href"])?.match(/^#(.+)$/)?.[1];i=s?e.get(s)?.children.find(c=>c.name==="stop"):void 0;}let l=i&&Ut(K(i,"stop-color"));l&&o.set(r,l);}return o}function Lu(t,e){return t.map(n=>{if(n.op==="Z")return n;if(n.op==="C"){let[a,i]=H(e,n.x1,n.y1),[l,s]=H(e,n.x2,n.y2),[c,u]=H(e,n.x,n.y);return {op:"C",x1:a,y1:i,x2:l,y2:s,x:c,y:u}}let[o,r]=H(e,n.x,n.y);return {op:n.op,x:o,y:r}})}function vh(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),e/2}function li(t){return t.length<3?[]:[...t.map(([e,n],o)=>({op:o===0?"M":"L",x:e,y:n})),{op:"Z"}]}var we=t=>Number.isFinite(t);function mt(t,e,n=0){let o=Number.parseFloat(t.attrs[e]??"");return we(o)?o:n}function Fu(t){switch(t.name){case "path":return oe(t.attrs.d??"");case "rect":{let e=t.attrs.rx??t.attrs.ry,n=t.attrs.ry??t.attrs.rx;return Xt(mt(t,"x"),mt(t,"y"),mt(t,"width"),mt(t,"height"),Number.parseFloat(e??"0")||0,Number.parseFloat(n??"0")||0)}case "circle":{let e=mt(t,"r");return Zt(mt(t,"cx"),mt(t,"cy"),e,e)}case "ellipse":return Zt(mt(t,"cx"),mt(t,"cy"),mt(t,"rx"),mt(t,"ry"));case "polygon":case "polyline":{let e=jt(t.attrs.points),n=[];for(let o=0;o+1<e.length;o+=2)n.push([e[o],e[o+1]]);return li(n)}default:return []}}function Lh(t,e){let n=e/2;switch(t.name){case "rect":{let o=mt(t,"x"),r=mt(t,"y"),a=mt(t,"width"),i=mt(t,"height"),l=Number.parseFloat(t.attrs.rx??t.attrs.ry??"0")||0,s=Xt(o-n,r-n,a+e,i+e,l>0?l+n:0,l>0?l+n:0);if(a<=e||i<=e)return s;let c=Math.max(l-n,0);return [...s,...Xt(o+n,r+n,a-e,i-e,c,c)]}case "circle":case "ellipse":{let o=mt(t,"cx"),r=mt(t,"cy"),a=t.name==="circle"?mt(t,"r"):mt(t,"rx"),i=t.name==="circle"?mt(t,"r"):mt(t,"ry"),l=Zt(o,r,a+n,i+n);return a<=n||i<=n?l:[...l,...Zt(o,r,a-n,i-n)]}case "line":{let[o,r,a,i]=["x1","y1","x2","y2"].map(m=>mt(t,m)),l=Math.hypot(a-o,i-r);if(l===0)return [];let s=-(i-r)/l*n,c=(a-o)/l*n,u=[[o+s,r+c],[a+s,i+c],[a-s,i-c],[o-s,r-c]];return li(vh(u)<0?u.reverse():u)}default:return null}}var Fh=new Set(["path","rect","circle","ellipse","polygon","polyline","line"]),Ih=new Set(["defs","linearGradient","radialGradient","stop","title","desc","metadata"]),Th={script:"script",style:"style",foreignObject:"foreign-object",image:"image",feImage:"image",use:"use",text:"text",tspan:"text",textPath:"text",filter:"effects",mask:"effects",clipPath:"effects",pattern:"effects",marker:"effects",symbol:"effects",animate:"animation",animateMotion:"animation",animateTransform:"animation",set:"animation"},kh=/^(?:qrdx[-_ ]?)?qr(?:[-_ ]?code)?$/i;function Tu(t,e){for(let n of Object.keys(t.attrs)){let o=n.toLowerCase();o.startsWith("on")?e.add("handlers"):o==="href"||o==="xlink:href"?t.name!=="linearGradient"&&t.name!=="radialGradient"&&e.add("links"):(o==="filter"||o==="mask"||o==="clip-path")&&e.add("effects");}}function ku(t,e,n,o,r){if(Tu(t,o),Ut(K(t,"display"))==="none"||Ut(K(t,"visibility"))==="hidden")return;let a=Number.parseFloat(K(t,"opacity")??"1"),i=Ut(K(t,"fill-rule")),l=Number.parseFloat(Ut(K(t,"stroke-width"))??""),s={matrix:ut(e.matrix,Dt(t.attrs.transform)),fill:Ut(K(t,"fill"))??e.fill,fillRule:i==="evenodd"||i==="nonzero"?i:e.fillRule,stroke:Ut(K(t,"stroke"))??e.stroke,strokeWidth:we(l)&&l>=0?l:e.strokeWidth,color:Ut(K(t,"color"))??e.color,opacity:e.opacity*(we(a)?a:1)};for(let c of t.children){if(Ih.has(c.name))continue;let u=Th[c.name];if(u){o.add(u);continue}if(c.name==="svg"){o.add("nested-svg");continue}if(c.name==="g"||c.name==="a"){ku(c,s,n,o,r);continue}if(!Fh.has(c.name)){o.add("unknown");continue}Nh(c,s,n,o,r);}}function Nh(t,e,n,o,r){if(Tu(t,o),Ut(K(t,"display"))==="none"||Ut(K(t,"visibility"))==="hidden")return;let a=ut(e.matrix,Dt(t.attrs.transform));if(t.name==="rect"&&kh.test(t.attrs.id??"")&&!r.qrBox){r.qrBox=ve(Lu(Fu(t),a));return}let i=g=>Ut(K(t,g)),l=e.opacity*Number.parseFloat(i("opacity")??"1"),s=Number.parseFloat(i("fill-opacity")??"1"),c=Number.parseFloat(i("stroke-opacity")??"1"),u=i("fill-rule"),m={...e,fill:i("fill")??e.fill,fillRule:u==="evenodd"||u==="nonzero"?u:e.fillRule,stroke:i("stroke")??e.stroke,color:i("color")??e.color},f=Number.parseFloat(i("stroke-width")??""),d=we(f)&&f>=0?f:e.strokeWidth,p=(g,y,b)=>{if(g.length!==0){if(r.segments+=g.length,r.segments>It.maxInputSegments)throw new at(`The SVG has more than ${It.maxInputSegments} path segments; simplify it`);r.shapes.push({segments:Lu(g,a),fill:y,fillRule:b});}},h=g=>{let y=(we(l)?l:1)*(we(g)?g:1);return y<=0?false:(y<1&&o.add("opacity"),true)};if(t.name!=="line"){let g=ii(m.fill,m,n,o);g&&h(s)&&p(Fu(t),g,m.fillRule);}if(d>0&&m.stroke!=="none"){let g=ii(m.stroke,m,n,o);if(g&&h(c)){let y=Lh(t,d);y?((i("stroke-dasharray")??"none")!=="none"&&o.add("dash"),p(y,g,t.name==="line"?"nonzero":"evenodd")):o.add("stroke");}}}function Oh(t,e){let n=c=>{let u=10**e;return Math.round(c*u)/u+0},o=c=>x(c,e),r="",a=0,i=0,l=0,s=0;for(let c of t){if(c.op==="Z"){r+="z",a=l,i=s;continue}let u=n(c.x),m=n(c.y);if(c.op==="M")r+=`m${o(u-a)} ${o(m-i)}`,l=u,s=m;else if(c.op==="L"){if(u===a&&m===i)continue;r+=m===i?`h${o(u-a)}`:u===a?`v${o(m-i)}`:`l${o(u-a)} ${o(m-i)}`;}else r+=`c${o(n(c.x1)-a)} ${o(n(c.y1)-i)} ${o(n(c.x2)-a)} ${o(n(c.y2)-i)} ${o(u-a)} ${o(m-i)}`;a=u,i=m;}return r}var Dh=(t,e)=>t.x0<e.x1&&e.x0<t.x1&&t.y0<e.y1&&e.y0<t.y1;function Bh(t){let e=[];for(let n of t){let o=ve(n.segments);if(!o)continue;let r=e.at(-1);r&&r.shape.fill===n.fill&&r.shape.fillRule===n.fillRule&&!r.boxes.some(a=>Dh(a,o))?(r.shape={...r.shape,segments:[...r.shape.segments,...n.segments]},r.boxes.push(o)):e.push({shape:n,boxes:[o]});}return e.map(n=>n.shape)}var si=t=>[Number.parseInt(t.slice(1,3),16),Number.parseInt(t.slice(3,5),16),Number.parseInt(t.slice(5,7),16)];function Qh(t,e,n){let o=new Map;for(let i of t)o.set(i.fill,(o.get(i.fill)??0)+1);let r=new Map([...o.keys()].map(i=>[i,i])),a=0;for(;o.size>e;){let i=[...o.keys()],l=[i[0],i[1]],s=Number.POSITIVE_INFINITY;for(let d=0;d<i.length;d++)for(let p=d+1;p<i.length;p++){let h=si(i[d]),g=si(i[p]),y=Math.hypot(h[0]-g[0],h[1]-g[1],h[2]-g[2]);y<s&&(s=y,l=[i[d],i[p]]);}let[c,u]=l,[m,f]=(o.get(c)??0)>=(o.get(u)??0)?[c,u]:[u,c];o.set(m,(o.get(m)??0)+(o.get(f)??0)),o.delete(f);for(let[d,p]of r)p===f&&r.set(d,m);a++;}return a>0&&n.add("colors",a),r}var Iu=t=>{let[e,n,o]=si(t);return .2126*e+.7152*n+.0722*o>235};function Gh(t,e={}){let n=new ai;try{let o=Ah(t),r=fe(o);if(!r)throw new at("No <svg> element found");let a=jt(r.attrs.viewBox),[i,l,s,c]=[0,0,0,0];if(a.length===4&&a[2]>0&&a[3]>0?[i,l,s,c]=a:(s=mt(r,"width"),c=mt(r,"height")),!(we(s)&&we(c)&&s>0&&c>0))throw new at("The SVG needs a viewBox (or a width and height)");let m=It.artboardSide/Math.max(s,c),f=Math.round(s*m*10)/10,d=Math.round(c*m*10)/10;if(Math.min(f,d)<ct.minArtboard)throw new at("The artboard is too narrow: its sides may differ by 20 times at most");let p=[m,0,0,m,-i*m,-l*m],h={shapes:[],qrBox:null,segments:0};ku(r,{matrix:p,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,color:"#000000",opacity:1},Ph(r),n,h);let g={x0:0,y0:0,x1:f,y1:d},y=Math.max(f,d)*.004,b=[],_=0,w=0;for(let N of h.shapes){let U=ve(N.segments);if(!U||U.x1<=0||U.y1<=0||U.x0>=f||U.y0>=d){_++;continue}if(U.x0<-y||U.y0<-y||U.x1>f+y||U.y1>d+y){let q=ur(N.segments,.25).map(Ct=>rn(Ct,g)).filter(Ct=>Ct.length>2);if(q.length===0){_++;continue}w++,b.push({...N,segments:q.flatMap(Ct=>li(Ct))});}else b.push(N);}if(_>0&&n.add("outside",_),w>0&&n.add("clipped",w),b.length===0)throw new at("The SVG has no filled shapes to use");let R=Qh(b,It.maxColors,n);for(let N of b)N.fill=R.get(N.fill)??N.fill;let S=new Map,$=new Map;for(let N of b){let U=ve(N.segments);S.set(N.fill,(S.get(N.fill)??0)+(U.x1-U.x0)*(U.y1-U.y0)),$.set(N.fill,($.get(N.fill)??0)+1);}let M=[...S.keys()].sort((N,U)=>Number(Iu(N))-Number(Iu(U))||S.get(U)-S.get(N)),C=M[0],A=M[1],v=N=>N===C?"frame":N===A?"accent":N,L=h.qrBox;if(!L&&e.qr){let[N,U]=H(p,e.qr.x,e.qr.y);L={x0:N,y0:U,x1:N+e.qr.size*m,y1:U+e.qr.size*m};}let F,k,O;L?(F=Math.min(L.x1-L.x0,L.y1-L.y0),k=(L.x0+L.x1-F)/2,O=(L.y0+L.y1-F)/2):(n.add("qr-placed"),F=Math.min(f,d)*.6,k=(f-F)/2,O=(d-F)/2);let I=N=>Math.round(N*10)/10+0;if(F=Math.floor(F*10)/10,k=I(k),O=I(O),F<Math.min(f,d)*ct.minQrShare)throw new at("The QR area must be at least half the frame's shorter side");let Q=Math.min(k,O,f-k-F,d-O-F);if(Q<F*ct.minPadding-1e-9)throw new at("Leave room around the QR area: at least 4% of its size on every side, inside the artboard");let W=Math.min(Math.max(e.padding??It.padding,ct.minPadding),.2),D=Math.floor(Math.min(F*W,Q)*10)/10,z=Bh(b);if(z.length>ct.maxShapes)throw new at(`The artwork has ${z.length} separate shapes; the limit is ${ct.maxShapes}. Combine shapes of the same color first`);let et={kind:fr,version:hr,artboard:{width:f,height:d},qr:{x:k,y:O,size:F,padding:D},colors:{frame:C,...A&&{accent:A}},shapes:z.map(N=>({type:"path",d:Oh(N.segments,It.decimals),fill:v(N.fill),...N.fillRule==="evenodd"&&{fillRule:"evenodd"}})),labels:[]},bt=Le.safeParse(et);if(!bt.success){let N=bt.error.issues[0];throw new at(`The converted frame doesn't fit the frame format: ${N?.message??"invalid"}`)}let lt=M.map(N=>({color:N,ref:N===C?"frame":N===A?"accent":"fixed",shapes:$.get(N)??0}));return {ok:!0,spec:bt.data,warnings:n.list(),palette:lt}}catch(o){return {ok:false,error:o instanceof at?o.message:`Could not read the SVG (${o instanceof Error?o.name:"error"})`,warnings:n.list()}}}var zh=1013,Uh={"call-to-action":105,holidays:283,seasons:60,"food-drink":71,shopping:64,"beauty-wellness":26,events:77,places:71,"real-estate":35,automotive:27,"health-learning":48,"sports-fitness":36,business:82,nonprofit:28};var qh=[{id:"call-to-action",label:"Call to action"},{id:"holidays",label:"Holidays"},{id:"seasons",label:"Seasons"},{id:"food-drink",label:"Food & drink"},{id:"shopping",label:"Shops & packaging"},{id:"beauty-wellness",label:"Beauty & wellness"},{id:"events",label:"Events & weddings"},{id:"places",label:"Places & Wi-Fi"},{id:"real-estate",label:"Real estate"},{id:"automotive",label:"Cars & parking"},{id:"health-learning",label:"Health & learning"},{id:"sports-fitness",label:"Sports & fitness"},{id:"business",label:"Business & social"},{id:"nonprofit",label:"Nonprofits & community"}];function ci(t){return Array.isArray(t)?`[${t.map(ci).join(",")}]`:t&&typeof t=="object"?`{${Object.keys(t).filter(n=>t[n]!==void 0).sort().map(n=>`${JSON.stringify(n)}:${ci(t[n])}`).join(",")}}`:JSON.stringify(t)}function Wh(t){let e=ci(t),n=2166136261;for(let o=0;o<e.length;o++)n^=e.charCodeAt(o),n=Math.imul(n,16777619)>>>0;return n.toString(16).padStart(8,"0")}function Hh(t,e){return yt.QrCode.encodeText(t,Rt[e??Ht]).size}function Nu(t,e,n,o=n.size*(e?.size??Go)){let r={src:t,width:o,height:o,excavate:true,...e?.shape&&e.shape!=="square"&&{shape:e.shape},...e?.plate&&{plate:e.plate}},a=e?.x!==void 0||e?.y!==void 0;if(!(e?.padding||a))return r;let i=Hh(n.value,n.level),l=Lt(i,n.margin,n.shape),s=n.size/(i+2*l);if(e.padding&&(r.padding=e.padding*s),a){let c=i*s,u=m=>Math.min(Math.max((m??.5)*c-o/2,0),c-o);r.x=u(e.x),r.y=u(e.y);}return r}function Ou(t,e,n,o){let r=n.level??Ht,a=r;o&&(a=Nt({...n,imageSettings:Nu(t,e,n),autoLevel:o}));let i=s=>{let c=m=>Nu(t,e,{...n,level:s},m),u=wa(n,[s],c().width,c);return u>0?c(u):void 0};if(a===r)return i(r);let l=i(a);return l&&Nt({...n,imageSettings:l,autoLevel:o})===a?l:i(r)}function Vh({value:t,level:e,margin:n,shape:o,autoLevel:r,logoOptions:a}){let l=Ou("data:,",{...a,size:br},{value:`${t}`,size:1024,margin:n??xt,level:e,shape:o},r);return l?l.width/1024:0}function ui({value:t,size:e=1024,fgColor:n,bgColor:o,eyeColor:r,dotColor:a,bodyPattern:i,hideLogo:l,logo:s,logoOptions:c,margin:u,cornerEyePattern:m,cornerEyeDotPattern:f,level:d,templateId:p,frame:h,eyeColors:g,moduleScale:y,autoLevel:b,shape:_}){let w={value:`${t}`,size:e,margin:u??xt,level:d,shape:_},R=!l&&s?Ou(s,c,w,b):void 0;return {value:w.value,bgColor:o,fgColor:n,eyeColor:r,dotColor:a,bodyPattern:i,cornerEyePattern:m,cornerEyeDotPattern:f,level:d,templateId:p,size:e,margin:u,...h&&{frame:h},...g&&{eyeColors:g},...y!==void 0&&{moduleScale:y},...b&&{autoLevel:b},..._&&_!=="square"&&{shape:_},...R&&{imageSettings:R}}}var Du=.06,Bu=.16,Qu=512;function Gu(t){let{width:e,height:n}=t;if(!(e>0&&n>0)||t.data.length<e*n*4)return null;let o=Uint8Array.from(t.data),r=Wo({width:e,height:n,data:o});if(!r)return null;let a=d=>{let p=d*4;return Math.hypot(o[p]/255-r[0],o[p+1]/255-r[1],o[p+2]/255-r[2])},i=new Uint8Array(e*n),l=new Int32Array(e*n),s=0,c=0,u=d=>{i[d]||o[d*4+3]===0||a(d)>=Bu||(i[d]=1,l[c++]=d);};for(let d=0;d<e;d++)u(d),u((n-1)*e+d);for(let d=0;d<n;d++)u(d*e),u(d*e+e-1);for(;s<c;){let d=l[s++],p=d%e;p>0&&u(d-1),p<e-1&&u(d+1),d>=e&&u(d-e),d<(n-1)*e&&u(d+e);}let m=new Uint8ClampedArray(o),f=r;for(let d=0;d<e*n;d++){if(!i[d])continue;let p=Math.min(1,Math.max(0,(a(d)-Du)/(Bu-Du))),h=d*4;if(m[h+3]=Math.round(o[h+3]*p),p>0&&p<1)for(let g=0;g<3;g++){let b=(o[h+g]/255-(1-p)*f[g])/p;m[h+g]=Math.round(Math.min(1,Math.max(0,b))*255);}}return {width:e,height:n,data:m}}async function jh(t){if(typeof document>"u"||typeof Image>"u")throw new Error("removeLogoBackground needs a browser (canvas)");let e=await new Promise(l=>{let s=new Image;s.crossOrigin="anonymous",s.onload=()=>l(s),s.onerror=()=>l(null),s.src=t;});if(!e)return null;let n=e.naturalWidth||512,o=e.naturalHeight||512,r=Math.min(1,Qu/Math.max(n,o)),a=document.createElement("canvas");a.width=Math.max(1,Math.round(n*r)),a.height=Math.max(1,Math.round(o*r));let i=a.getContext("2d",{willReadFrequently:true});if(!i)return null;try{i.drawImage(e,0,0,a.width,a.height);let l=i.getImageData(0,0,a.width,a.height),s=Gu(l);return s?(l.data.set(s.data),i.putImageData(l,0,0),a.toDataURL("image/png")):null}catch{return null}finally{a.remove();}}async function Zh(t){let{value:e,size:n=ft,level:o=Ht,bgColor:r=_t,fgColor:a=Mt,margin:i=xt,imageSettings:l,eyeColor:s,dotColor:c,bodyPattern:u,cornerEyePattern:m,cornerEyeDotPattern:f,isOGContext:d,templateId:p,customTemplate:h,customProps:g,frame:y,art:b,eyeColors:_,moduleScale:w,frameLabelMarkers:R,partMarkers:S,autoLevel:$,...M}=t,C=Br({value:e,size:n,margin:i,level:o,autoLevel:$},l),A=Nt({value:e,size:n,level:o,margin:i,imageSettings:C,autoLevel:$}),v=yt.QrCode.encodeText(e,Rt[A]).getModules(),L=v.length+i*2,F=xe(v,n,i,C),k=null;if(C!=null&&F!=null){F.excavation!=null&&(v=Ia(v,F.excavation));let I=C.src.startsWith("data:")?C.src:await fetch(`https://wsrv.nl/?url=${encodeURIComponent(C.src)}&w=100&h=100&encoding=base64`).then(Q=>{if(!Q.ok)throw new Error(`Failed to load QR logo (${Q.status}): ${C.src}`);return Q.text()});k={settings:{...C,src:I},box:{x:F.x+i,y:F.y+i,w:F.w,h:F.h}};}let O=Uc(v,i);return {size:n,numCells:L,fgPath:O,bgColor:r,fgColor:a,frame:y,svgProps:M,logo:k}}function Xh(t){let{size:e,numCells:n,fgPath:o,bgColor:r,fgColor:a,frame:i,svgProps:l,logo:s}=t,c=kt(i),u=s?Or(s.settings,s.box):E(Jt,{}),m=st("svg",{height:e,viewBox:`0 0 ${n} ${n}`,width:e,xmlns:"http://www.w3.org/2000/svg",...c?{}:l,children:[E("path",{d:`M0,0 h${n}v${n}H0z`,fill:wt(r,_t),shapeRendering:"crispEdges"}),E("path",{d:o,fill:wt(a,Mt),shapeRendering:"crispEdges"}),u]});return c&&i?Lr(m,{size:e,frame:i,bgColor:r,svgProps:l}):m}async function Yh(t){return Xh(await Zh(t))}function zu(t){return ui({value:t.value,fgColor:t.fgColor,hideLogo:t.hideLogo,bgColor:t.bgColor,eyeColor:t.eyeColor,dotColor:t.dotColor,bodyPattern:t.bodyPattern,cornerEyePattern:t.cornerEyePattern,cornerEyeDotPattern:t.cornerEyeDotPattern,level:t.level,templateId:t.templateId,logo:t.logo,logoOptions:t.logoOptions,margin:t.margin??xt,autoLevel:t.autoLevel,shape:t.shape})}function Uu(t,e){let{size:n=ft,scale:o=1,level:r,style:a,customTemplate:i,customProps:l,frame:s,art:c,eyeColors:u,moduleScale:m,autoLevel:f,shape:d,frameLabelMarkers:p,partMarkers:h}=t,g=n*o,y=g/e.size,b=e.imageSettings&&{...e.imageSettings,height:e.imageSettings.height*y,width:e.imageSettings.width*y,...e.imageSettings.x!=null&&{x:e.imageSettings.x*y},...e.imageSettings.y!=null&&{y:e.imageSettings.y*y},...e.imageSettings.padding!=null&&{padding:e.imageSettings.padding*y}};return {art:c,bgColor:e.bgColor,bodyPattern:e.bodyPattern,cornerEyeDotPattern:e.cornerEyeDotPattern,cornerEyePattern:e.cornerEyePattern,customProps:l,customTemplate:i,dotColor:e.dotColor,eyeColor:e.eyeColor,fgColor:e.fgColor,frame:s,level:r||e.level,margin:e.margin,...u&&{eyeColors:u},...m!==void 0&&{moduleScale:m},...f&&{autoLevel:f},...d&&d!=="square"&&{shape:d},...p&&{frameLabelMarkers:p},...h&&{partMarkers:h},size:g,style:a,templateId:e.templateId,value:e.value,...b&&{imageSettings:b}}}function Kh(t){return Uu(t,zu(t))}function qu(t,e){let n=[],o=r=>{if(r==null||typeof r=="boolean")return;if(typeof r=="string"||typeof r=="number"||typeof r=="bigint"){n.push(`${r}`);return}if(Array.isArray(r)){for(let c of r)o(c);return}if(!Ie(r))throw new TypeError("qrdx: can't render this value");let{type:a,props:i,key:l}=r;if(fn(a)){o(i.children);return}if(typeof a=="function"){o(a(i));return}let s={};for(let c of Object.keys(i)){let u=wn(c,i[c]);u&&(s[u.name]=u.value);}n.push(e(a,s,qu(i.children,e),l));};return o(t),n}var Wu={diamond:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"],banner:["square","rounded","diya","leaf"],square:["curly"],diya:["curly"],message:["curly"]},Hu={diamond:["square"],pacman:["rounded"],"small-square":["square","rounded"]},Vu=["circle","curly"],ju=["diamond","banner","star"],Zu={circle:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"]},qt=["square","liquid","classy","classy-rounded"],Xu={"circle/rounded":qt,"circle/extra-rounded":qt,"circle/message":[...qt,"leaf"],"circle/pointy":qt,"circle/leaf-reverse":qt,"circle/drop":qt,"circle/bevel":[...qt,"leaf"],"circle/squircle":[...qt,"circle","diamond","circle-mixed","rounded","horizontal-line","leaf","heart","mosaic","octagon"],"circle/cushion":qt,"circle/shield":[...qt,"rounded","horizontal-line","leaf"],"circle/petal":qt};function Yu(t,e,n){return (Zu[t]?.includes(e)??false)&&!Xu[`${t}/${e}`]?.includes(n)}function mi(t){let e=t.bodyPattern??"circle",n=t.cornerEyePattern??"gear",o=t.cornerEyeDotPattern??"circle";return Wu[o]?.includes(n)?{kind:"dot-eye",message:`${o} centres in ${n} eyes are missed by strict decoders`,fix:"Pick a square, rounded or circle centre, or another eye shape"}:Hu[e]?.includes(n)?{kind:"body-eye",message:`${e} dots next to ${n} eyes are missed up close`,fix:"Pick a fuller dot shape or another eye shape"}:ju.includes(o)?{kind:"dot",message:`${o} centres are missed in sharp renders and up close`,fix:"Pick a square, rounded or circle centre"}:Vu.includes(n)?{kind:"eye",message:`${n} eyes only read in lenient decoders`,fix:"Pick square, rounded or gear eyes"}:Yu(o,n,e)?{kind:"sharp-dot-eye",message:`${o} centres in ${n} eyes are missed by some decoders on screens and in sharp prints`,fix:"Pick a rounded centre, or gear or octagon eyes"}:null}var En=300,nr=t=>{let e=typeof t=="number"?t:Number.parseFloat(String(t));return Number.isFinite(e)?e:void 0};function Jh(t){let e=nr(t.x)??0,n=nr(t.y)??0,o=jt(typeof t.viewBox=="string"?t.viewBox:void 0),r=nr(t.width),a=nr(t.height);if(o.length!==4||!(o[2]&&o[3]&&r&&a))return [1,0,0,1,e,n];let[i,l,s,c]=o,u=Math.min(r/s,a/c);return [u,0,0,u,e+(r-s*u)/2-i*u,n+(a-c*u)/2-l*u]}function di(t,e,n,o){if(t===e)return n;if(Array.isArray(t)){for(let l of t){let s=di(l,e,n,false);if(s)return s}return null}let r=t;if(!r||typeof r!="object"||!r.props)return null;let{props:a}=r,i=ut(n,Dt(typeof a.transform=="string"?a.transform:void 0));return r.type==="svg"&&!o&&(i=ut(i,Jh(a))),di(a.children,e,i,false)}function fi(t){let e=t.customTemplate||(t.templateId?Gr(t.templateId):void 0);if(!e)return 1;let n={type:"svg",props:{height:En,viewBox:`0 0 ${En} ${En}`,width:En},key:null},o;try{o=e.wrapper(n,{fgColor:typeof t.fgColor=="string"?t.fgColor:void 0,bgColor:typeof t.bgColor=="string"?t.bgColor:void 0,...t.customProps??{}},{pixelSize:10,url:t.value});}catch{return 1}let r=o?.props;if(!r)return 1;let a=jt(typeof r.viewBox=="string"?r.viewBox:void 0),i=a.length===4?a[2]:nr(r.width),l=di(o,n,an,true);if(!(l&&i))return 1;let[s,c]=H(l,0,0),[u,m]=H(l,En,En),d=Math.min(Math.abs(u-s),Math.abs(m-c))/i;return d>0&&d<=1?d:1}var o0=[96,160,320],pi=640;function bi(){if(typeof document>"u")throw new Error("Scan scoring needs a browser (canvas + image decoding)")}function Me(t){if(t?.aborted)throw new DOMException("Scan scoring was aborted","AbortError")}var a0=()=>new Promise(t=>setTimeout(t,0));async function yi(){let{default:t}=await import('jsqr');return t}function gi(t,e){if(!t)return false;if(t.data===e)return true;try{return new TextDecoder().decode(Uint8Array.from(t.binaryData))===e}catch{return false}}function tp(t,e,n=.7){let{data:o,width:r,height:a}=t;for(let c=0;c<o.length;c+=4)for(let u=0;u<3;u++)o[c+u]=128+(o[c+u]-128)*n;let i=Math.max(1,Math.round(e*.25)),l=new Float32Array(r*a*3),s=c=>{let u=c?a:r,m=c?r:a,f=(p,h)=>c?p*r+h:h*r+p,d=[0,0,0];for(let p=0;p<u;p++){d.fill(0);for(let h=-i;h<=i;h++){let g=f(p,Math.min(Math.max(h,0),m-1))*4;for(let y=0;y<3;y++)d[y]=d[y]+o[g+y];}for(let h=0;h<m;h++){let g=f(p,h)*3;for(let _=0;_<3;_++)l[g+_]=d[_]/(2*i+1);let y=f(p,Math.max(h-i,0))*4,b=f(p,Math.min(h+i+1,m-1))*4;for(let _=0;_<3;_++)d[_]=d[_]-o[y+_]+o[b+_];}}for(let p=0;p<r*a;p++)for(let h=0;h<3;h++)o[p*4+h]=l[p*3+h];};for(let c=0;c<2;c++)s(true),s(false);}function An(t,e){let n=document.createElement("canvas");n.width=Math.max(1,Math.round(t)),n.height=Math.max(1,Math.round(e));let o=n.getContext("2d",{willReadFrequently:true});if(!o)throw new Error("Could not get canvas context");return o.imageSmoothingEnabled=true,o.imageSmoothingQuality="high",{canvas:n,ctx:o}}var ep=[.9,1,1.1];function _i(t,e,n,o,r){let a=0;for(let i of ep){let l=n*i,s=e(l);tp(s,l/o),r(t(s.data,s.width,s.height))&&a++;}return a>=2?"pass":a===1?"fragile":"fail"}var hi={small:"small print or far away",medium:"typical phone distance",large:"close up"};function np(t,e){return t===e[0]&&e.length>1?hi.small:t===e.at(-1)?hi.large:hi.medium}function i0(t,e,n){if(n==="pass")return 0;let o=e===1?[45]:e===2?[20,45]:[15,20,45],r=o[Math.round(t*(o.length-1)/Math.max(e-1,1))]??20;return n==="fragile"?Math.round(r/2):r}function s0(t,e,n){let o=`${t} px (${np(t,e)})`;return n==="pass"?{id:`decode-${t}`,passed:true,message:`Reads at ${o}, with camera blur`}:{id:`decode-${t}`,passed:false,message:n==="fragile"?`Reads at ${o} only some of the time`:`Doesn't read at ${o}`,fix:t===e[0]?"Print it bigger, shorten the content (fewer modules) or use solid square dots":"Raise the contrast, use bigger dots or a simpler eye shape"}}function l0(t,e){return e?"fails":t>=85?"great":t>=65?"ok":"risky"}function rp(t,e,n){let o=Ot(t,e);if(o.type==="solid")return [o.color];if(o.type!=="image")return o.stops.map(l=>l.color);let r=o.underlay?uo(o.underlay):null,a=n?.[o.src];if(!a)return o.underlay?[o.underlay]:[];let i=o.opacity??1;return [a.light,a.dark].flatMap(l=>{let s=uo(l);if(!s)return [];let c={...s,a:s.a*i};if(!r)return [Ku(c)];let u=c.a+r.a*(1-c.a),m=(f,d)=>u>0?(f*c.a+d*r.a*(1-c.a))/u:0;return [Ku({r:m(c.r,r.r),g:m(c.g,r.g),b:m(c.b,r.b),a:u})]})}var Ku=({r:t,g:e,b:n,a:o})=>`rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(n)}, ${Math.round(o*1e3)/1e3})`;function op(t){let e=[],n=t.width*t.height;for(let a=0;a<n;a++){let i=t.data[a*4],l=t.data[a*4+1],s=t.data[a*4+2];t.data[a*4+3]<128||e.push({lum:Sn(i,l,s),r:i,g:l,b:s});}if(e.length===0)return null;e.sort((a,i)=>a.lum-i.lum);let o=Math.max(1,Math.round(e.length/10)),r=a=>{let i=a.reduce((s,c)=>({r:s.r+c.r,g:s.g+c.g,b:s.b+c.b}),{r:0,g:0,b:0}),l=s=>Math.round(s/a.length).toString(16).padStart(2,"0");return `#${l(i.r)}${l(i.g)}${l(i.b)}`};return {dark:r(e.slice(0,o)),light:r(e.slice(-o))}}async function ap(t){bi();let e=await ar(t),{canvas:n,ctx:o}=An(64,64);o.drawImage(e,0,0,64,64);let r=op(o.getImageData(0,0,64,64));return n.remove(),r}function c0(t){let e=[t.bgColor,t.fgColor,t.eyeColor,t.dotColor,..._r.flatMap(o=>[t.eyeColors?.[o]?.outer,t.eyeColors?.[o]?.inner])],n=new Set;for(let o of e)typeof o=="object"&&o?.type==="image"&&n.add(o.src);return [...n]}var rr=null;function uo(t){let e=dt(t);if(e||typeof document>"u")return e;if(rr??=document.createElement("canvas").getContext("2d"),!rr)return null;rr.fillStyle="#010203",rr.fillStyle=t;let n=String(rr.fillStyle);return n==="#010203"?null:dt(n)}var Ju=t=>Sn(t.r,t.g,t.b),u0=(t,e)=>(Math.max(t,e)+.05)/(Math.min(t,e)+.05),or=4.5,ip=3,t0=1.5,e0={code:7,background:12},n0={r:255,g:255,b:255,a:1},r0=(t,e)=>({r:t.r*t.a+e.r*(1-t.a),g:t.g*t.a+e.g*(1-t.a),b:t.b*t.a+e.b*(1-t.a),a:1});function sp(t,e={}){let n=e.imageTones,o=(d,p)=>{let h=typeof d=="object"&&d?.type==="image";return rp(d,p,n).map(g=>({color:g,picture:h}))},r=t.fgColor??Mt,a=_r.flatMap(d=>{let p=t.eyeColors?.[d];return [...p?.outer?o(p.outer,Mt):[],...p?.inner?o(p.inner,Mt):[]]}),i=[...o(r,Mt),...o(t.eyeColor??r,Mt),...o(t.dotColor??r,Mt),...a],l=o(t.bgColor,_t),s=(l.length>0?l:[{color:"#ffffff",picture:false}]).map(d=>{let p=uo(d.color);return {color:p?r0(p,n0):n0,picture:d.picture}}),c=i.flatMap(d=>{let p=uo(d.color);return p?[{color:p,picture:d.picture}]:[]}),u=Number.POSITIVE_INFINITY,m=or,f=false;for(let d of c)for(let p of s){let h=Ju(r0(d.color,p.color)),g=Ju(p.color),y=u0(h,g),b=p.picture?e0.background:d.picture?e0.code:or;y/b<u/m&&(u=y,m=b),h>g&&(f=true);}return {ratio:Number.isFinite(u)?u:Number.POSITIVE_INFINITY,required:m,inverted:f}}function lp(t,e){let{ratio:n,inverted:o,required:r}=sp(t,{imageTones:e});if(!Number.isFinite(n))return {checks:[],penalty:0,fails:false};let a=r/or,i=r!==or,l=Math.round(n*10)/10,s=[],c=0;return n>=r?s.push({id:"contrast",passed:true,message:`Contrast ${l}:1 between code and background`}):(c=n<t0*a?60:n<ip*a?30:10,s.push({id:"contrast",passed:false,message:i?`Low contrast for a picture (${l}:1); ${r}:1 or more scans reliably`:`Low contrast (${l}:1); 4.5:1 or more scans reliably`,fix:i?"Lower the picture's opacity over a darker underlay (dots) or a lighter one (background)":"Use a darker code color or a lighter background"})),o?(c+=10,s.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):s.push({id:"polarity",passed:true,message:"Dark code on a light background"}),{checks:s,penalty:c,fails:n<t0*(r/or)}}function xi(t){return yt.QrCode.encodeText(t.value,Rt[Nt(t)]).getModules()}function cp(t){let{imageSettings:e}=t;if(!e)return {check:null,penalty:0};let n=xi(t),o=xe(n,t.size??ft,Lt(n.length,t.margin??xt,t.shape),e);if(!o)return {check:null,penalty:0};let r=o.excavation??o,a=n.length,l=[[0,0],[a-8,0],[0,a-8]].some(([p,h])=>r.x<p+9&&r.x+r.w>p&&r.y<h+9&&r.y+r.h>h),s=a>21?a-9:null,c=s!==null&&r.x<s+5&&r.x+r.w>s&&r.y<s+5&&r.y+r.h>s;if(l||c)return {check:{id:"logo",passed:false,message:l?"The logo covers a corner eye":"The logo covers the small square near the bottom-right corner",fix:"Move the logo toward the center or make it smaller"},penalty:40};let u=r.w*r.h/(a*a),m=Nt(t),f=Math.round(u*100),d=Dr({value:t.value,size:t.size??ft,margin:t.margin??xt,level:m,shape:t.shape},e);return !d||d.worst<=d.budget?{check:{id:"logo",passed:true,message:`Logo covers ${f}% of the code; error correction repairs it with room to spare`},penalty:0}:{check:{id:"logo",passed:false,message:`Logo covers ${f}% of the code and spoils ${d.worst} codewords in one block, which repairs ${d.correctable}`,fix:d.level==="H"?"Use a smaller logo":"Switch error correction to H or use a smaller logo"},penalty:d.worst>d.correctable?25:10}}function up(t){let e=xa(t.shape)?Be(t.margin??xt):t.margin??xt,n=xi(t).length+2*e,o=e+(kt(t.frame)?ya(t.frame)*n:0),r=Math.round(o*10)/10;return o>=4?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules`},penalty:0}:o>=1.5?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules (4 is ideal)`},penalty:0}:{check:{id:"quiet-zone",passed:false,message:"No quiet zone around the code",fix:"Leave clear space (about 10% of the code width) around it wherever you place it, or add a frame"},penalty:5}}function mp(t){let e=t.cornerEyePattern??"gear";return e==="curly"?{check:{id:"eye-shape",passed:false,message:"Curly eyes fail strict decoders such as ZXing-based apps",fix:"Pick square, rounded or gear eyes"},penalty:40}:e==="circle"?{check:{id:"eye-shape",passed:false,message:"Circle eyes only read in lenient decoders; many apps miss them",fix:"Pick square, rounded or gear eyes"},penalty:20}:{check:{id:"eye-shape",passed:true,message:`No known decoder issues with ${e} eyes`},penalty:0}}function ar(t){return new Promise((e,n)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>e(o),o.onerror=()=>n(new Error("Could not load image")),o.src=t;})}var dp=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><rect width="10" height="10" rx="2" fill="#808080"/></svg>')}`;async function fp(t){let{imageSettings:e}=t;if(!e||e.src.startsWith("data:"))return t;let n=dp;try{let o=await ar(e.src),{canvas:r,ctx:a}=An(o.naturalWidth||256,o.naturalHeight||256);a.drawImage(o,0,0,r.width,r.height),n=r.toDataURL("image/png");}catch{}return {...t,imageSettings:{...e,src:n}}}async function hp(t){let e=new Map;for(let r of c0(t))if(!r.startsWith("data:"))try{let a=await ar(r),{canvas:i,ctx:l}=An(a.naturalWidth||256,a.naturalHeight||256);l.drawImage(a,0,0,i.width,i.height),e.set(r,i.toDataURL("image/png")),i.remove();}catch{e.set(r,null);}if(e.size===0)return t;let n=r=>{if(typeof r!="object"||r?.type!=="image")return r;let a=e.get(r.src);return a===void 0?r:a?{...r,src:a}:r.underlay??Mt},o=t.eyeColors?Object.fromEntries(Object.entries(t.eyeColors).map(([r,a])=>[r,a&&{outer:n(a.outer),inner:n(a.inner)}])):void 0;return {...t,bgColor:n(t.bgColor),fgColor:n(t.fgColor),eyeColor:n(t.eyeColor),dotColor:n(t.dotColor),...o&&{eyeColors:o}}}async function m0(t,e,n,o,r){let a=[],i=0,l=lp(t,r);i+=l.penalty;let s=cp(t);i+=s.penalty;let c=up(t);i+=c.penalty;let u=mp(t);i+=u.penalty;let m=mi(t),f=m?.kind==="eye"?null:m;f&&f.kind!=="sharp-dot-eye"&&(i+=10);let d=await yi();Me(o);let p=xi(t).length,h=p+2*Lt(p,t.margin??xt,t.shape),g=[],y=false;for(let[w,R]of n.entries()){await a0(),Me(o);let S=_i(d,e,R,h,$=>gi($,t.value));i+=i0(w,n.length,S),g.push(s0(R,n,S)),w===n.length-1&&S==="fail"&&(y=true);}a.push(...g,...l.checks),s.check&&a.push(s.check),a.push(u.check,c.check),f&&a.push({id:"style-pair",passed:false,message:f.message,fix:f.fix});let b=y||l.fails,_=Math.max(0,Math.min(100,100-i));return b&&(_=Math.min(_,30)),{score:_,grade:l0(_,b),checks:a}}function d0(t){return [...t.sizes??o0].filter(e=>e>0).sort((e,n)=>e-n)}async function c3(t,e={}){bi();let{signal:n}=e,o=d0(e),r=pi/fi(t),a=await hp(await fp(Ue({...t,size:t.size??ft},r)));Me(n);let i={};for(let m of c0(t))try{let f=await ap(m);f&&(i[m]=f);}catch{}Me(n);let l=await zt(a),s=await ar(l);Me(n);let c=ie(r,t.frame);return await m0(t,m=>{let f=m/pi,d=c.width*f,p=c.height*f,h=Math.max(8,Math.round(m*.12)),{canvas:g,ctx:y}=An(d+2*h,p+2*h);y.fillStyle="#ffffff",y.fillRect(0,0,g.width,g.height),y.drawImage(s,h,h,d,p);let b=y.getImageData(0,0,g.width,g.height);return g.remove(),b},o,n,i)}var u3=pi;async function m3(t,e,n={}){let{width:o,height:r}=e;if(!(o>0&&r>0)||e.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=d0(n),i=t.size??ft,l=ie(i,t.frame),s=o*i*fi(t)/l.width,c={data:pp(e),width:o,height:r};return await m0(t,m=>{let f=f0(c,m/s),d=Math.max(8,Math.round(m*.12));return gp(f,d)},a,n.signal)}function pp(t){let{data:e,width:n,height:o}=t,r=new Uint8ClampedArray(n*o*4);for(let a=0;a<n*o*4;a+=4){let i=e[a+3]/255;for(let l=0;l<3;l++)r[a+l]=e[a+l]*i+255*(1-i);r[a+3]=255;}return r}function gp(t,e){let n=t.width+2*e,o=t.height+2*e,r=new Uint8ClampedArray(n*o*4).fill(255);for(let a=0;a<t.height;a++)r.set(t.data.subarray(a*t.width*4,(a+1)*t.width*4),((a+e)*n+e)*4);return {data:r,width:n,height:o,colorSpace:"srgb"}}var Ce=(t,e)=>Math.hypot(t.x-e.x,t.y-e.y);function co(t,e){return .299*t[e]+.587*t[e+1]+.114*t[e+2]}function bp(t,e){let n=0;for(let l=0;l<256;l++)n+=l*t[l];let o=0,r=0,a=0,i=128;for(let l=0;l<256;l++){if(r+=t[l],r===0)continue;let s=e-r;if(s===0)break;o+=l*t[l];let c=o/r,u=(n-o)/s,m=r*s*(c-u)**2;m>a&&(a=m,i=l);}return i}async function yp(t){if(!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=URL.createObjectURL(t);try{let n=await ar(e);return await n.decode?.().catch(()=>{}),n}finally{setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function d3(t,e={}){bi();let{signal:n}=e,o=[...e.sizes??o0].filter(G=>G>0).sort((G,nt)=>G-nt),r=await yi(),a=await yp(t);Me(n);let i=a.naturalWidth||a.width,l=a.naturalHeight||a.height;if(!(i&&l))throw new Error("Could not read this image");let s=Math.min(1,1600/Math.max(i,l)),{canvas:c,ctx:u}=An(i*s,l*s);u.fillStyle="#ffffff",u.fillRect(0,0,c.width,c.height),u.drawImage(a,0,0,c.width,c.height);let m=u.getImageData(0,0,c.width,c.height),f=r(m.data,m.width,m.height);if(Me(n),!f){let G=await hl(a,0,false);return c.remove(),typeof G!="string"||G==="NO_QR"?{data:null,version:null,score:0,grade:"fails",checks:[{id:"decode",passed:false,message:"No QR code found in this image",fix:"Try a sharper, well-lit, straight-on photo or a screenshot"}]}:{data:G,version:null,score:55,grade:"risky",checks:[{id:"decode",passed:false,message:"Decoded only after cropping; the code is small or hard to find in this image",fix:"Make the code bigger relative to its surroundings"}]}}let{location:d,version:p}=f,h=17+4*p,g=(Ce(d.topLeftCorner,d.topRightCorner)+Ce(d.bottomLeftCorner,d.bottomRightCorner)+Ce(d.topLeftCorner,d.bottomLeftCorner)+Ce(d.topRightCorner,d.bottomRightCorner))/4,y=g/h,b=[d.topLeftCorner,d.topRightCorner,d.bottomRightCorner,d.bottomLeftCorner],_=Math.max(0,Math.floor(Math.min(...b.map(G=>G.x)))),w=Math.min(m.width,Math.ceil(Math.max(...b.map(G=>G.x)))),R=Math.max(0,Math.floor(Math.min(...b.map(G=>G.y)))),S=Math.min(m.height,Math.ceil(Math.max(...b.map(G=>G.y)))),$=[],M=0,C=new Array(256).fill(0),A=0;for(let G=R;G<S;G++)for(let nt=_;nt<w;nt++){let Z=Math.round(co(m.data,(G*m.width+nt)*4));C[Z]=C[Z]+1,A++;}let v=bp(C,A),L={dark:[0,0,0,0],light:[0,0,0,0]};for(let G=R;G<S;G++)for(let nt=_;nt<w;nt++){let Z=(G*m.width+nt)*4,pt=co(m.data,Z)<=v?L.dark:L.light;pt[0]=pt[0]+m.data[Z],pt[1]=pt[1]+m.data[Z+1],pt[2]=pt[2]+m.data[Z+2],pt[3]=pt[3]+1;}let F=G=>{let nt=Math.max(G[3],1);return Sn(G[0]/nt,G[1]/nt,G[2]/nt)},k=F(L.dark),O=F(L.light),I=u0(k,O),Q=Math.round(I*10)/10;I>=4.5?$.push({id:"contrast",passed:true,message:`Contrast ${Q}:1 in the image`}):(M+=I<2?30:10,$.push({id:"contrast",passed:false,message:`Low contrast in the image (${Q}:1)`,fix:"Use a darker code on a lighter background, or better lighting for photos"}));let D=[d.topLeftFinderPattern,d.topRightFinderPattern,d.bottomLeftFinderPattern].map(G=>{let nt=Math.min(m.width-1,Math.max(0,Math.round(G.x))),Z=Math.min(m.height-1,Math.max(0,Math.round(G.y)));return co(m.data,(Z*m.width+nt)*4)}).filter(G=>G>v).length>=2;D?(M+=10,$.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):$.push({id:"polarity",passed:true,message:"Dark code on a light background"});let z=Math.max(2,Math.round(y*2)),et={minX:_-z,maxX:w+z,minY:R-z,maxY:S+z};if(et.minX<0||et.minY<0||et.maxX>m.width||et.maxY>m.height)$.push({id:"quiet-zone",passed:true,skipped:true,message:"The image is cropped too tight to check the quiet zone"});else {let G=0,nt=0;for(let Z=et.minY;Z<et.maxY;Z++)for(let pt=et.minX;pt<et.maxX;pt++){if(pt>=_&&pt<w&&Z>=R&&Z<S)continue;let Pn=co(m.data,(Z*m.width+pt)*4);(D?Pn>v:Pn<=v)&&G++,nt++;}G/Math.max(nt,1)>.12?(M+=10,$.push({id:"quiet-zone",passed:false,message:"Something dark touches the code; the quiet zone isn't clear",fix:"Leave clear space (about 4 modules) around the code"})):$.push({id:"quiet-zone",passed:true,message:"Clear space around the code"});}y<2?$.push({id:"resolution",passed:false,message:`Low resolution: about ${Math.round(y*10)/10} px per module`,fix:"Use a larger image, or export the code at a bigger size"}):$.push({id:"resolution",passed:true,message:`About ${Math.round(y)} px per module`});let lt=Math.round(y*4),N=Math.max(0,_-lt),U=Math.max(0,R-lt),q=Math.min(m.width,w+lt)-N,Ct=Math.min(m.height,S+lt)-U,Re=G=>{let nt=G/g,Z=An(q*nt,Ct*nt);Z.ctx.drawImage(c,N,U,q,Ct,0,0,Z.canvas.width,Z.canvas.height);let pt=Z.ctx.getImageData(0,0,Z.canvas.width,Z.canvas.height);return Z.canvas.remove(),pt},Tt=[],ee=false;for(let[G,nt]of o.entries()){await a0(),Me(n);let Z=_i(r,Re,nt,h,pt=>pt?.data===f.data);M+=i0(G,o.length,Z),Tt.push(s0(nt,o,Z)),G===o.length-1&&Z==="fail"&&(ee=true);}c.remove();let Ee=Math.max(0,Math.min(100,100-M));return ee&&(Ee=Math.min(Ee,30)),{data:f.data,version:p,score:Ee,grade:l0(Ee,ee),checks:[...Tt,...$]}}var _p=[320];function f0(t,e){let n=Math.min(1,e),o=Math.max(1,Math.round(t.width*n)),r=Math.max(1,Math.round(t.height*n)),a=new Uint8ClampedArray(o*r*4),i=t.width/o,l=t.height/r;for(let s=0;s<r;s++){let c=Math.floor(s*l),u=Math.max(c+1,Math.min(t.height,Math.floor((s+1)*l)));for(let m=0;m<o;m++){let f=Math.floor(m*i),d=Math.max(f+1,Math.min(t.width,Math.floor((m+1)*i))),p=[0,0,0,0];for(let y=c;y<u;y++)for(let b=f;b<d;b++){let _=(y*t.width+b)*4;for(let w=0;w<4;w++)p[w]=p[w]+t.data[_+w];}let h=(u-c)*(d-f),g=(s*o+m)*4;for(let y=0;y<4;y++)a[g+y]=p[y]/h;}}return {data:a,width:o,height:r,colorSpace:"srgb"}}function xp(t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(Uint8Array.from(t.binaryData))}catch{return t.data}}async function f3(t,e,n={}){let{width:o,height:r}=t;if(!(o>0&&r>0)||t.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=await yi(),i={data:t.data instanceof Uint8ClampedArray?t.data:Uint8ClampedArray.from(t.data),width:o,height:r},l=a(i.data,o,r,{inversionAttempts:"dontInvert"});if(!l)return {data:null,version:null,passed:false};let s=xp(l),{version:c,location:u}=l;if(!gi(l,e))return {data:s,version:c,passed:false};let m=17+4*c,f=(Ce(u.topLeftCorner,u.topRightCorner)+Ce(u.bottomLeftCorner,u.bottomRightCorner)+Ce(u.topLeftCorner,u.bottomLeftCorner)+Ce(u.topRightCorner,u.bottomRightCorner))/4;for(let d of n.sizes??_p)if(_i(a,h=>f0(i,h/f),d,m,h=>gi(h,e))!=="pass")return {data:s,version:c,passed:false};return {data:s,version:c,passed:true}}var $p=16,h0=.01;function Sp(t){let e=new Float64Array(256);for(let s of t)e[Math.min(255,Math.max(0,Math.round(s*255)))]++;let n=t.length,o=0;for(let s=0;s<256;s++)o+=s*e[s];let r=0,a=0,i=0,l=128;for(let s=0;s<256;s++){if(a+=e[s],a===0)continue;let c=n-a;if(c===0)break;r+=s*e[s];let u=r/a,m=(o-r)/c,f=a*c*(u-m)**2;f>i&&(i=f,l=s);}return (l+.5)/255}function wp(t,e){let{width:n,height:o,data:r}=t,a=n*o,i=new Uint8Array(a),l=0;for(let d=0;d<a;d++)r[d*4+3]<128&&l++;if(e==="alpha"||e==="auto"&&l>a*.02&&l<a*.98){for(let d=0;d<a;d++)i[d]=r[d*4+3]>=128?1:0;return i}let c=new Float32Array(a);for(let d=0;d<a;d++){let p=r[d*4+3]/255,h=.2126*r[d*4]+.7152*r[d*4+1]+.0722*r[d*4+2];c[d]=1-(h*p+255*(1-p))/255;}let u=Sp(c);for(let d=0;d<a;d++)i[d]=c[d]>u?1:0;let m=0,f=0;for(let d=0;d<n;d++)for(let p of [0,o-1])m++,f+=i[p*n+d];for(let d=1;d<o-1;d++)for(let p of [0,n-1])m++,f+=i[d*n+p];if(f>m/2)for(let d=0;d<a;d++)i[d]=i[d]?0:1;return i}function p0(t,e,n,o){for(let r of [1,0]){let a=new Uint8Array(t.length);for(let i=0;i<t.length;i++){if(a[i]||t[i]!==r)continue;let l=[i];a[i]=1;let s=false;for(let u of l){let m=u%e,f=(u-m)/e;(m===0||f===0||m===e-1||f===n-1)&&(s=true);for(let[d,p]of [[m-1,f],[m+1,f],[m,f-1],[m,f+1]]){if(d<0||p<0||d>=e||p>=n)continue;let h=p*e+d;!a[h]&&t[h]===r&&(a[h]=1,l.push(h));}}if((r===1||!s)&&l.length<o)for(let u of l)t[u]=r?0:1;}}}function g0(t,e={}){let{width:n,height:o,data:r}=t;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Silhouette pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=wp(t,e.mode??"auto"),i=a.reduce(($,M)=>$+M,0);p0(a,n,o,Math.max(16,i*h0));let l=n,s=o,c=-1,u=-1;for(let $=0;$<o;$++)for(let M=0;M<n;M++)a[$*n+M]&&(l=Math.min(l,M),s=Math.min(s,$),c=Math.max(c,M),u=Math.max(u,$));if(c<0)throw new Error("No shape found: use a picture with a dark or opaque shape on a light or clear background");let m=c-l+1,f=u-s+1;if(Math.max(m,f)<$p)throw new Error("The shape is too small to trace; use a bigger picture");let p=Math.min(Math.max(Math.round(e.cells??Qt),Yt),Qt)/Math.max(m,f),h=Math.max(Yt,Math.round(m*p)),g=Math.max(Yt,Math.round(f*p)),y=Math.max(1,Math.round(m*p)),b=Math.max(1,Math.round(f*p)),_=Math.floor((h-y)/2),w=Math.floor((g-b)/2),R=new Uint8Array(h*g);for(let $=0;$<b;$++){let M=s+Math.floor($*f/b),C=Math.max(M+1,s+Math.floor(($+1)*f/b));for(let A=0;A<y;A++){let v=l+Math.floor(A*m/y),L=Math.max(v+1,l+Math.floor((A+1)*m/y)),F=0;for(let k=M;k<C;k++)for(let O=v;O<L;O++)F+=a[k*n+O];R[($+w)*h+A+_]=F*2>=(C-M)*(L-v)?1:0;}}let S=R.reduce(($,M)=>$+M,0);if(p0(R,h,g,Math.max(4,S*h0)),!R.includes(1))throw new Error("The shape is too small to trace; use a bigger picture");return {type:"silhouette",width:h,height:g,cells:Array.from(R,$=>$?"1":"0").join("")}}var $i=512;async function Cp(t){if(typeof t!="string"&&!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=typeof t=="string"?t:URL.createObjectURL(t);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the picture")),r.src=e;})}finally{typeof t!="string"&&setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function Mp(t,e={}){if(typeof document>"u")throw new Error("loadQRSilhouette needs a browser; pass decoded pixels to createQRSilhouette instead");let n=await Cp(t),o=n.naturalWidth||n.width||$i,r=n.naturalHeight||n.height||$i,a=$i/Math.max(o,r),i=Math.max(1,Math.round(o*a)),l=Math.max(1,Math.round(r*a)),s=document.createElement("canvas");s.width=i,s.height=l;let c=s.getContext("2d",{willReadFrequently:true});if(!c)throw new Error("Could not get a canvas context");c.drawImage(n,0,0,i,l);let u;try{u=c.getImageData(0,0,i,l);}catch{throw new Error("Could not read the picture (cross-origin images need CORS); upload it instead")}finally{s.remove();}return g0(u,e)}/**
27
27
  * @license QR Code generator library (TypeScript)
28
28
  * Copyright (c) Project Nayuki.
29
29
  * SPDX-License-Identifier: MIT
30
- */Object.defineProperty(exports,"OFFICIAL_FRAME_INDEX",{enumerable:true,get:function(){return framesIndex_js.OFFICIAL_FRAME_INDEX}});Object.defineProperty(exports,"OFFICIAL_FRAMES",{enumerable:true,get:function(){return framesOfficial_js.OFFICIAL_FRAMES}});Object.defineProperty(exports,"getOfficialFrame",{enumerable:true,get:function(){return framesOfficial_js.getOfficialFrame}});exports.AUTO_LEVEL_LOGO_COVERAGE=ko;exports.Arrow=Dc;exports.BODY_PATTERN=as;exports.BUILT_IN_FRAME_SPECS=Nf;exports.CORNER_EYE_DOT_PATTERNS=_o;exports.CORNER_EYE_PATTERNS=xo;exports.CUSTOM_FRAME_STYLE=kn;exports.DEFAULT_ART_INTENSITY=Rs;exports.DEFAULT_FRAME_TEXT=So;exports.DEFAULT_MARGIN=$t;exports.DEFAULT_SIZE=ft;exports.DOWNLOAD_FORMATS=za;exports.EPS_IMAGE_FILL_REASON=Nl;exports.EYE_POSITIONS=_r;exports.FRAME_COLOR_TOKENS=Ji;exports.FRAME_FONT_FAMILY=uc;exports.FRAME_FONT_SCALE_MAX=be;exports.FRAME_FONT_SCALE_MIN=ln;exports.FRAME_GAP_RATIO=la;exports.FRAME_ICONS=Zi;exports.FRAME_ICON_BOX=ea;exports.FRAME_ICON_MAX_SEGMENTS=Ki;exports.FRAME_IMPORT_LIMITS=kt;exports.FRAME_LABEL_ATTRIBUTE=mc;exports.FRAME_SPEC_KIND=mr;exports.FRAME_SPEC_LABEL_MAX_FONT=fr;exports.FRAME_SPEC_LIMITS=ct;exports.FRAME_SPEC_VERSION=dr;exports.FRAME_STYLES=Gi;exports.FRAME_TEXT_MAX_LENGTH=Xt;exports.Fragment=ne;exports.FrameSpecError=zn;exports.GRADIENT_FRAME_DEFAULTS=oa;exports.Halloween=Bc;exports.LOGO_CLEANUP_MAX_SIDE=nu;exports.LOGO_EC_SAFETY=Tc;exports.LOGO_PADDING_MAX=ls;exports.LOGO_PLATE_INSET=Tr;exports.LOGO_ROUNDED_RADIUS=Ir;exports.LOGO_SHAPES=is;exports.LOGO_SIZE_DEFAULT=Fo;exports.LOGO_SIZE_MAX=gr;exports.LOGO_SIZE_MIN=cs;exports.MODULE_SCALE_FLOOR=Ks;exports.MODULE_SCALE_MAX=br;exports.MODULE_SCALE_MIN=Nn;exports.OFFICIAL_FRAME_COLLECTIONS=Qf;exports.OFFICIAL_FRAME_COUNT=Of;exports.OFFICIAL_FRAME_COUNTS=Df;exports.PIXEL_SCAN_SIZES=fh;exports.PIXEL_SCORE_MIN_CODE_WIDTH=b5;exports.PRESET_SIZES=s_;exports.QR_ART_MAX_SAMPLE_SIZE=ie;exports.QR_ART_MIN_LUMA_GAP=xr;exports.QR_ART_MODES=Tn;exports.QR_ART_SAMPLE_SIZES=zo;exports.QR_ART_VARIANTS=In;exports.QR_CIRCLE_QUIET_MIN=No;exports.QR_EYE_ATTRIBUTE=Oc;exports.QR_PARTS=jd;exports.QR_PART_ATTRIBUTE=ga;exports.QR_SHAPES=ms;exports.QR_SILHOUETTE_MAX_CELLS=qt;exports.QR_SILHOUETTE_MIN_CELLS=te;exports.QR_SILHOUETTE_MIN_SHARE=Oo;exports.RETIRED_CORNER_EYE_DOT_PATTERNS=Di;exports.RETIRED_CORNER_EYE_PATTERNS=Bi;exports.SCAN_CONTRAST_FAIL=gu;exports.SCAN_CONTRAST_LOW=th;exports.SCAN_CONTRAST_MIN=Jn;exports.SCAN_IMAGE_CONTRAST_MIN=bu;exports.SCAN_TEST_SIZES=xu;exports.SHARP_DOT_EYE_SAFE_BODIES=du;exports.SUPPORTS_PATH2D=F2;exports.SquareBorder=Gc;exports.StandardBox=Uc;exports.StrikedBox=qc;exports.TEMPLATES=_a;exports.WEAK_BODY_EYES=cu;exports.WEAK_DOTS=uu;exports.WEAK_DOT_EYES=su;exports.WEAK_EYES=lu;exports.WEAK_SHARP_DOT_EYES=mu;exports.WEBP_MAX_DIMENSION=R1;exports.angularGradientSchema=Ii;exports.anyFrameSchema=Lo;exports.baseTemplatePropsSchema=xm;exports.blobToDataUrl=jn;exports.bodyPatternSchema=Io;exports.canvasToWebP=qr;exports.circleQuietZone=ze;exports.clampModuleScale=Cr;exports.colorConfigSchema=pe;exports.colorTypeSchema=Ou;exports.convertImageSettingsToPixels=a1;exports.copyQRCodeToClipboard=u_;exports.cornerEyeDotPatternSchema=yo;exports.cornerEyePatternSchema=$o;exports.createQRArtImage=Es;exports.createQRCodeTree=wa;exports.createQRSilhouette=Iu;exports.customFrameSchema=os;exports.damagedCodewords=Qn;exports.decodePNGPixels=Ga;exports.defaultTemplate=Qc;exports.downloadFile=re;exports.downloadImageData=zp;exports.downloadImageWithBoundingBox=Wp;exports.downloadPrintEPS=cf;exports.downloadPrintPDF=Qb;exports.downloadPrintSVG=Bb;exports.downloadQRCode=c_;exports.encodeWebPLossless=Ia;exports.epsToDataUrl=no;exports.errorLevelSchema=us;exports.excavateModules=Ca;exports.excavationSchema=Bu;exports.eyeColorOverrideSchema=pr;exports.eyeColorsSchema=ps;exports.frameLabels=hc;exports.frameSchema=rr;exports.frameSpecColorSchema=dn;exports.frameSpecHash=Bf;exports.frameSpecLabelSchema=ns;exports.frameSpecPadding=fn;exports.frameSpecPaintSchema=ye;exports.frameSpecQrZone=rs;exports.frameSpecSchema=Ne;exports.frameSpecShapeSchema=ts;exports.frameStyleSchema=Ui;exports.generatePath=el;exports.getAllTemplates=s2;exports.getCodewordMap=Dn;exports.getColorString=Du;exports.getContrastLevel=O2;exports.getContrastRatio=N2;exports.getCustomFrameLayout=sa;exports.getDownloadFilename=lf;exports.getFrameDimensions=ue;exports.getFrameGapRatio=ua;exports.getFrameIconPath=na;exports.getFrameLayout=qe;exports.getFrameSecondaryText=fc;exports.getFrameSpecGapRatio=ia;exports.getFrameSpecIssues=gm;exports.getFrameText=dc;exports.getImageScanScore=y5;exports.getImageSettings=Re;exports.getImageTones=Jf;exports.getImageTonesFromPixels=Kf;exports.getLayoutMargin=It;exports.getLogoBlockDamage=kr;exports.getLogoSizeLimit=Uf;exports.getLuminance=wn;exports.getNormalizedColor=Qu;exports.getPrintLayout=to;exports.getQRArtColorIssue=l0;exports.getQRArtEyeColors=Jo;exports.getQRArtVariant=$r;exports.getQRAsCanvas=En;exports.getQRAsEPS=eo;exports.getQRAsPrintPDF=j1;exports.getQRAsPrintPDFBuffer=Db;exports.getQRAsPrintSVG=Y1;exports.getQRAsSVGDataUri=Wt;exports.getQRAsSVGNode=Hf;exports.getQRAsWebP=Ql;exports.getQRCodeData=ou;exports.getQRCodeDataUrl=l_;exports.getQRCodeSVGProps=au;exports.getQRData=ti;exports.getQRFunctionModules=Zm;exports.getQRModuleCount=H1;exports.getQRShapePath=Pd;exports.getQRSilhouetteFit=Rd;exports.getSVGString=m_;exports.getScanContrast=eh;exports.getScanScore=g5;exports.getScanScoreFromPixels=_5;exports.getSolidColor=wt;exports.getStylePairRisk=ei;exports.getTemplate=zc;exports.getTemplateIds=c2;exports.getWebPCompression=Ta;exports.gradientStopSchema=nr;exports.h=Um;exports.handleImageLoad=tc;exports.hasImageFill=Ol;exports.hexToRgb=k2;exports.imageFitSchema=Ti;exports.imagePaintSchema=ki;exports.imagePositionCss=Ni;exports.imagePositionSchema=Fi;exports.imageSettingsSchema=ss;exports.importFrameSvg=Lf;exports.isFrameActive=Qt;exports.isGradient=cn;exports.isImagePaint=bo;exports.isLatin1Text=nm;exports.isQRArtActive=Ho;exports.isQRNode=De;exports.isShapedCode=da;exports.isWeakSharpPair=fu;exports.isWebPFile=bl;exports.linearGradientSchema=vi;exports.loadQRArtImage=jm;exports.loadQRSilhouette=yh;exports.logoFitsBudget=Vd;exports.logoOptionsSchema=_m;exports.logoShapeSchema=To;exports.mixFrameColors=Dt;exports.normalizeColorConfig=Gt;exports.partMarker=ba;exports.pickableCornerEyeDotPatternSchema=Gu;exports.pickableCornerEyePatternSchema=Uu;exports.qrArtImageSchema=Ai;exports.qrArtModeSchema=Ri;exports.qrArtSchema=go;exports.qrArtVariantSchema=Ei;exports.qrCodeShapeSchema=hs;exports.qrPropsSchema=ym;exports.qrShapeSchema=ds;exports.qrSilhouetteSchema=fs;exports.radialGradientSchema=Li;exports.removeLogoBackdrop=ru;exports.removeLogoBackground=qf;exports.renderQRArt=Xo;exports.renderToDOM=Ea;exports.renderToString=He;exports.resolveErrorLevel=Bt;exports.resolveFrameSpec=aa;exports.resolveQRCodeProps=Vf;exports.rgbToCmyk=$e;exports.sanitizeFrameText=hr;exports.scanQRPixels=x5;exports.solidColorSchema=Pi;exports.svgToEPS=kl;exports.templateConfigSchema=$m;exports.templateDefinitionBaseSchema=Sm;exports.toHyperscript=iu;exports.toSVGElement=w1;exports.toSVGString=Aa;exports.validateSize=Wa;exports.withQRSize=je;//# sourceMappingURL=core.js.map
30
+ */Object.defineProperty(exports,"OFFICIAL_FRAME_INDEX",{enumerable:true,get:function(){return framesIndex_js.OFFICIAL_FRAME_INDEX}});Object.defineProperty(exports,"OFFICIAL_FRAMES",{enumerable:true,get:function(){return framesOfficial_js.OFFICIAL_FRAMES}});Object.defineProperty(exports,"getOfficialFrame",{enumerable:true,get:function(){return framesOfficial_js.getOfficialFrame}});exports.AUTO_LEVEL_LOGO_COVERAGE=zo;exports.Arrow=mc;exports.BODY_PATTERN=_s;exports.BUILT_IN_FRAMES=ga;exports.BUILT_IN_FRAME_SPECS=id;exports.CORNER_EYE_DOT_PATTERNS=So;exports.CORNER_EYE_PATTERNS=Co;exports.CUSTOM_FRAME_STYLE=cn;exports.DEFAULT_ART_INTENSITY=Qs;exports.DEFAULT_FRAME_TEXT=Ro;exports.DEFAULT_MARGIN=xt;exports.DEFAULT_SIZE=ft;exports.DOWNLOAD_FORMATS=ti;exports.DotRing=Ec;exports.EPS_IMAGE_FILL_REASON=Cu;exports.EYE_POSITIONS=_r;exports.FRAME_COLOR_TOKENS=fs;exports.FRAME_FONT_FAMILY=vr;exports.FRAME_FONT_SCALE_MAX=Pe;exports.FRAME_FONT_SCALE_MIN=lr;exports.FRAME_GAP_RATIO=Bl;exports.FRAME_ICONS=ms;exports.FRAME_ICON_BOX=la;exports.FRAME_ICON_MAX_SEGMENTS=ds;exports.FRAME_IMPORT_LIMITS=It;exports.FRAME_LABEL_ATTRIBUTE=Ql;exports.FRAME_SPEC_KIND=fr;exports.FRAME_SPEC_LABEL_MAX_FONT=kn;exports.FRAME_SPEC_LIMITS=ct;exports.FRAME_SPEC_VERSION=hr;exports.FRAME_STYLES=ts;exports.FRAME_TEXT_MAX_LENGTH=Vt;exports.Fragment=Jt;exports.FrameSpecError=Wn;exports.GRADIENT_FRAME_DEFAULTS=sd;exports.Halloween=Ac;exports.LOGO_CLEANUP_MAX_SIDE=Qu;exports.LOGO_EC_SAFETY=ic;exports.LOGO_PADDING_MAX=ws;exports.LOGO_PLATE_INSET=Nr;exports.LOGO_ROUNDED_RADIUS=kr;exports.LOGO_SHAPES=xs;exports.LOGO_SIZE_DEFAULT=Go;exports.LOGO_SIZE_MAX=br;exports.LOGO_SIZE_MIN=Ss;exports.MODULE_SCALE_FLOOR=dl;exports.MODULE_SCALE_MAX=yr;exports.MODULE_SCALE_MIN=Nn;exports.OFFICIAL_FRAME_COLLECTIONS=qh;exports.OFFICIAL_FRAME_COUNT=zh;exports.OFFICIAL_FRAME_COUNTS=Uh;exports.PIXEL_SCAN_SIZES=_p;exports.PIXEL_SCORE_MIN_CODE_WIDTH=u3;exports.PRESET_SIZES=a_;exports.QR_ART_MAX_SAMPLE_SIZE=re;exports.QR_ART_MIN_LUMA_GAP=$r;exports.QR_ART_MODES=Ln;exports.QR_ART_SAMPLE_SIZES=Yo;exports.QR_ART_VARIANTS=vn;exports.QR_CIRCLE_QUIET_MIN=Uo;exports.QR_EYE_ATTRIBUTE=uc;exports.QR_PARTS=Zd;exports.QR_PART_ATTRIBUTE=Ca;exports.QR_SHAPES=Ms;exports.QR_SILHOUETTE_MAX_CELLS=Qt;exports.QR_SILHOUETTE_MIN_CELLS=Yt;exports.QR_SILHOUETTE_MIN_SHARE=qo;exports.RETIRED_CORNER_EYE_DOT_PATTERNS=Yi;exports.RETIRED_CORNER_EYE_PATTERNS=Ji;exports.SCAN_CONTRAST_FAIL=t0;exports.SCAN_CONTRAST_LOW=ip;exports.SCAN_CONTRAST_MIN=or;exports.SCAN_IMAGE_CONTRAST_MIN=e0;exports.SCAN_TEST_SIZES=o0;exports.SHARP_DOT_EYE_SAFE_BODIES=Xu;exports.SUPPORTS_PATH2D=Fy;exports.SquareBorder=Pc;exports.StandardBox=vc;exports.StrikedBox=Lc;exports.TEMPLATES=Xn;exports.WEAK_BODY_EYES=Hu;exports.WEAK_DOTS=ju;exports.WEAK_DOT_EYES=Wu;exports.WEAK_EYES=Vu;exports.WEAK_SHARP_DOT_EYES=Zu;exports.WEBP_MAX_DIMENSION=Of;exports.angularGradientSchema=Wi;exports.anyFrameSchema=Do;exports.baseTemplatePropsSchema=cm;exports.blobToDataUrl=Kn;exports.bodyPatternSchema=Bo;exports.canvasToWebP=jr;exports.circleQuietZone=Be;exports.clampModuleScale=Cr;exports.colorConfigSchema=me;exports.colorTypeSchema=$0;exports.convertImageSettingsToPixels=gf;exports.copyQRCodeToClipboard=l_;exports.cornerEyeDotPatternSchema=wo;exports.cornerEyePatternSchema=Mo;exports.createQRArtImage=Gs;exports.createQRCodeTree=ka;exports.createQRSilhouette=g0;exports.customFrameSchema=ys;exports.damagedCodewords=Bn;exports.decodePNGPixels=Ya;exports.defaultTemplate=dc;exports.downloadFile=te;exports.downloadImageData=Xg;exports.downloadImageWithBoundingBox=Yg;exports.downloadPrintEPS=yh;exports.downloadPrintPDF=O5;exports.downloadPrintSVG=D5;exports.downloadQRCode=i_;exports.encodeWebPLossless=za;exports.epsToDataUrl=so;exports.errorLevelSchema=Cs;exports.excavateModules=Ia;exports.excavationSchema=C0;exports.eyeColorOverrideSchema=gr;exports.eyeColorsSchema=Ps;exports.frameLabels=Gl;exports.frameSchema=cr;exports.frameSpecColorSchema=ln;exports.frameSpecHash=Wh;exports.frameSpecLabelSchema=bs;exports.frameSpecOf=Pr;exports.frameSpecPadding=mn;exports.frameSpecPaintSchema=he;exports.frameSpecQrZone=pr;exports.frameSpecSchema=Le;exports.frameSpecShapeSchema=ps;exports.frameStyleSchema=es;exports.generatePath=Uc;exports.getAllTemplates=ay;exports.getBuiltInFrame=ba;exports.getCodewordMap=Dn;exports.getColorString=S0;exports.getContrastLevel=ky;exports.getContrastRatio=Ty;exports.getCustomFrameLayout=ha;exports.getDownloadFilename=_h;exports.getFrameColors=ld;exports.getFrameDimensions=ie;exports.getFrameGapRatio=ya;exports.getFrameIconPath=ca;exports.getFrameLayout=De;exports.getFrameSecondaryText=md;exports.getFrameSpecColors=Er;exports.getFrameSpecGapRatio=da;exports.getFrameSpecIssues=am;exports.getFrameText=ud;exports.getImageScanScore=d3;exports.getImageSettings=xe;exports.getImageTones=ap;exports.getImageTonesFromPixels=op;exports.getLayoutMargin=Lt;exports.getLogoBlockDamage=Dr;exports.getLogoSizeLimit=Vh;exports.getLuminance=Sn;exports.getNormalizedColor=w0;exports.getPrintLayout=ao;exports.getQRArtColorIssue=Km;exports.getQRArtEyeColors=ia;exports.getQRArtVariant=Sr;exports.getQRAsCanvas=Cn;exports.getQRAsEPS=io;exports.getQRAsPrintPDF=ah;exports.getQRAsPrintPDFBuffer=N5;exports.getQRAsPrintSVG=ih;exports.getQRAsSVGDataUri=zt;exports.getQRAsSVGNode=Yh;exports.getQRAsWebP=Eu;exports.getQRCodeData=zu;exports.getQRCodeDataUrl=s_;exports.getQRCodeSVGProps=Uu;exports.getQRData=ui;exports.getQRFunctionModules=Qm;exports.getQRModuleCount=rh;exports.getQRShapePath=vd;exports.getQRSilhouetteFit=Ed;exports.getSVGString=c_;exports.getScanContrast=sp;exports.getScanScore=c3;exports.getScanScoreFromPixels=m3;exports.getSolidColor=wt;exports.getStylePairRisk=mi;exports.getTemplate=Gr;exports.getTemplateIds=iy;exports.getWebPCompression=Ua;exports.gradientStopSchema=sr;exports.h=Lm;exports.handleImageLoad=hl;exports.hasImageFill=Mu;exports.hexToRgb=Iy;exports.imageFitSchema=Hi;exports.imagePaintSchema=ji;exports.imagePositionCss=Zi;exports.imagePositionSchema=Vi;exports.imageSettingsSchema=$s;exports.importFrameSvg=Gh;exports.isFrameActive=kt;exports.isGradient=nn;exports.isImagePaint=$o;exports.isLatin1Text=Q0;exports.isQRArtActive=Jo;exports.isQRNode=Ie;exports.isShapedCode=xa;exports.isWeakSharpPair=Yu;exports.isWebPFile=au;exports.linearGradientSchema=Ui;exports.loadQRArtImage=Om;exports.loadQRSilhouette=Mp;exports.logoFitsBudget=jd;exports.logoOptionsSchema=sm;exports.logoShapeSchema=Qo;exports.mixFrameColors=qn;exports.normalizeColorConfig=Ot;exports.partMarker=Ma;exports.pickableCornerEyeDotPatternSchema=M0;exports.pickableCornerEyePatternSchema=R0;exports.qrArtImageSchema=Gi;exports.qrArtModeSchema=Bi;exports.qrArtSchema=xo;exports.qrArtVariantSchema=Qi;exports.qrCodeShapeSchema=As;exports.qrPropsSchema=lm;exports.qrShapeSchema=Rs;exports.qrSilhouetteSchema=Es;exports.radialGradientSchema=qi;exports.removeLogoBackdrop=Gu;exports.removeLogoBackground=jh;exports.renderQRArt=ra;exports.renderToDOM=Oa;exports.renderToString=Ge;exports.resolveErrorLevel=Nt;exports.resolveFrameSpec=Hn;exports.resolveQRCodeProps=Kh;exports.rgbToCmyk=ge;exports.sanitizeFrameText=un;exports.scanQRPixels=f3;exports.solidColorSchema=zi;exports.svgToEPS=wu;exports.templateConfigSchema=um;exports.templateDefinitionBaseSchema=mm;exports.toHyperscript=qu;exports.toSVGElement=Nf;exports.toSVGString=Da;exports.validateSize=ei;exports.withQRSize=Ue;//# sourceMappingURL=core.js.map
31
31
  //# sourceMappingURL=core.js.map