qrdx 0.0.51 → 0.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -6
- package/dist/angular.js +252 -0
- package/dist/angular.js.map +1 -0
- package/dist/angular.mjs +226 -0
- package/dist/angular.mjs.map +1 -0
- package/dist/core.js +7 -7
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +7 -7
- package/dist/core.mjs.map +1 -1
- package/dist/element-define.browser.mjs +2 -0
- package/dist/element-define.browser.mjs.map +1 -0
- package/dist/element-define.js +2 -0
- package/dist/element-define.js.map +1 -0
- package/dist/element-define.mjs +2 -0
- package/dist/element-define.mjs.map +1 -0
- package/dist/element.browser.mjs +91 -0
- package/dist/element.browser.mjs.map +1 -0
- package/dist/element.js +2 -0
- package/dist/element.js.map +1 -0
- package/dist/element.mjs +2 -0
- package/dist/element.mjs.map +1 -0
- package/dist/frames-index.js +1 -1
- package/dist/frames-index.js.map +1 -1
- package/dist/frames-index.mjs +1 -1
- package/dist/frames-index.mjs.map +1 -1
- package/dist/frames-official.js +1 -1
- package/dist/frames-official.js.map +1 -1
- package/dist/frames-official.mjs +1 -1
- package/dist/frames-official.mjs.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/index.mjs.map +1 -1
- package/dist/preact.js +2 -0
- package/dist/preact.js.map +1 -0
- package/dist/preact.mjs +2 -0
- package/dist/preact.mjs.map +1 -0
- package/dist/qr-code-canvas.js +1 -1
- package/dist/qr-code-canvas.js.map +1 -1
- package/dist/qr-code-canvas.mjs +1 -1
- package/dist/qr-code-canvas.mjs.map +1 -1
- package/dist/solid.js +2 -0
- package/dist/solid.js.map +1 -0
- package/dist/solid.mjs +2 -0
- package/dist/solid.mjs.map +1 -0
- package/dist/src/angular.d.ts +94 -0
- package/dist/src/element-define.d.ts +3 -0
- package/dist/src/element-define.d.ts.map +1 -0
- package/dist/src/element.d.ts +150 -0
- package/dist/src/element.d.ts.map +1 -0
- package/dist/src/engine.d.ts +3 -3
- package/dist/src/engine.d.ts.map +1 -1
- package/dist/src/frame-spec.d.ts +22 -4
- package/dist/src/frame-spec.d.ts.map +1 -1
- package/dist/src/frame-text.d.ts +19 -0
- package/dist/src/frame-text.d.ts.map +1 -0
- package/dist/src/frame.d.ts +25 -10
- package/dist/src/frame.d.ts.map +1 -1
- package/dist/src/frames/builtin.d.ts +53 -5
- package/dist/src/frames/builtin.d.ts.map +1 -1
- package/dist/src/frames/catalogue/all.d.ts.map +1 -1
- package/dist/src/frames/catalogue/automotive.d.ts.map +1 -1
- package/dist/src/frames/catalogue/counts.d.ts +6 -6
- package/dist/src/frames/catalogue/counts.d.ts.map +1 -1
- package/dist/src/frames/catalogue/events.d.ts.map +1 -1
- package/dist/src/frames/catalogue/holidays.d.ts.map +1 -1
- package/dist/src/frames/catalogue/index.d.ts.map +1 -1
- package/dist/src/frames/catalogue/places.d.ts.map +1 -1
- package/dist/src/frames/catalogue/seasons.d.ts.map +1 -1
- package/dist/src/frames/catalogue/tags.d.ts.map +1 -1
- package/dist/src/preact.d.ts +29 -0
- package/dist/src/preact.d.ts.map +1 -0
- package/dist/src/scan-score.d.ts +4 -3
- package/dist/src/scan-score.d.ts.map +1 -1
- package/dist/src/solid.d.ts +21 -0
- package/dist/src/solid.d.ts.map +1 -0
- package/dist/src/template/arrow.d.ts +0 -1
- package/dist/src/template/arrow.d.ts.map +1 -1
- package/dist/src/template/dot-ring-layout.d.ts +44 -0
- package/dist/src/template/dot-ring-layout.d.ts.map +1 -0
- package/dist/src/template/dot-ring.d.ts +41 -0
- package/dist/src/template/dot-ring.d.ts.map +1 -0
- package/dist/src/template/frame-template.d.ts +19 -0
- package/dist/src/template/frame-template.d.ts.map +1 -0
- package/dist/src/template/halloween.d.ts +0 -1
- package/dist/src/template/halloween.d.ts.map +1 -1
- package/dist/src/template/index.d.ts +1 -0
- package/dist/src/template/index.d.ts.map +1 -1
- package/dist/src/template/square-border.d.ts +0 -1
- package/dist/src/template/square-border.d.ts.map +1 -1
- package/dist/src/template/standard-box.d.ts +0 -1
- package/dist/src/template/standard-box.d.ts.map +1 -1
- package/dist/src/template/striked-box.d.ts +0 -1
- package/dist/src/template/striked-box.d.ts.map +1 -1
- package/dist/src/template-placement.d.ts +8 -0
- package/dist/src/template-placement.d.ts.map +1 -0
- package/dist/src/templates.d.ts.map +1 -1
- package/dist/types/frame-spec.d.ts +703 -14
- package/dist/types/frame-spec.d.ts.map +1 -1
- package/dist/types/index.js +2 -2
- package/dist/types/index.js.map +1 -1
- package/dist/types/index.mjs +2 -2
- package/dist/types/index.mjs.map +1 -1
- package/dist/types/qr.d.ts +137 -3
- package/dist/types/qr.d.ts.map +1 -1
- package/dist/types/template.d.ts +7 -0
- package/dist/types/template.d.ts.map +1 -1
- package/dist/vanilla.browser.mjs +32 -32
- package/dist/vanilla.browser.mjs.map +1 -1
- package/package.json +81 -5
- package/src/angular.ts +218 -0
- package/src/element-define.ts +9 -0
- package/src/element.ts +608 -0
- package/src/engine.ts +13 -2
- package/src/frame-spec.ts +331 -56
- package/src/frame-text.ts +111 -0
- package/src/frame.tsx +74 -287
- package/src/frames/builtin/badge.json +108 -0
- package/src/frames/builtin/banner-bottom.json +2 -1
- package/src/frames/builtin/banner-top-bottom.json +72 -0
- package/src/frames/builtin/banner-top.json +59 -0
- package/src/frames/builtin/border.json +62 -0
- package/src/frames/builtin/chat-bubble.json +54 -0
- package/src/frames/builtin/circle.json +2 -1
- package/src/frames/builtin/envelope.json +81 -0
- package/src/frames/builtin/focus.json +88 -0
- package/src/frames/builtin/gradient-border.json +76 -0
- package/src/frames/builtin/menu-card.json +108 -0
- package/src/frames/builtin/phone.json +75 -0
- package/src/frames/builtin/polaroid.json +56 -0
- package/src/frames/builtin/rounded-border.json +8 -4
- package/src/frames/builtin/speech-bubble-top.json +76 -0
- package/src/frames/builtin/speech-bubble.json +76 -0
- package/src/frames/builtin/sticker.json +78 -0
- package/src/frames/builtin/tag.json +55 -0
- package/src/frames/builtin.ts +181 -12
- package/src/frames/catalogue/all.ts +584 -0
- package/src/frames/catalogue/automotive.ts +2 -0
- package/src/frames/catalogue/counts.ts +6 -6
- package/src/frames/catalogue/events.ts +90 -0
- package/src/frames/catalogue/holidays.ts +336 -0
- package/src/frames/catalogue/index.ts +2733 -0
- package/src/frames/catalogue/places.ts +92 -0
- package/src/frames/catalogue/seasons.ts +64 -0
- package/src/frames/catalogue/tags.ts +384 -0
- package/src/frames/official/africa-day.json +110 -0
- package/src/frames/official/aquarium-feeding.json +113 -0
- package/src/frames/official/autumn-apple-picking.json +81 -0
- package/src/frames/official/autumn-mushroom.json +72 -0
- package/src/frames/official/autumn-pumpkin-patch.json +83 -0
- package/src/frames/official/avurudu-pot.json +87 -0
- package/src/frames/official/beach-conditions.json +113 -0
- package/src/frames/official/beach-info-sticker.json +81 -0
- package/src/frames/official/beach-lifeguard.json +71 -0
- package/src/frames/official/blood-donor-drop.json +87 -0
- package/src/frames/official/blood-donor-sticker.json +94 -0
- package/src/frames/official/book-day-arch.json +71 -0
- package/src/frames/official/book-day-list.json +114 -0
- package/src/frames/official/camp-check-in.json +74 -0
- package/src/frames/official/camp-fire-rules.json +114 -0
- package/src/frames/official/camp-map.json +85 -0
- package/src/frames/official/carnival-mask.json +76 -0
- package/src/frames/official/carnival-pass.json +85 -0
- package/src/frames/official/carnival-plume.json +71 -0
- package/src/frames/official/childrens-day-carp.json +114 -0
- package/src/frames/official/childrens-day-sticker.json +88 -0
- package/src/frames/official/chuseok-gift-tag.json +59 -0
- package/src/frames/official/chuseok-moon.json +99 -0
- package/src/frames/official/chuseok-songpyeon.json +114 -0
- package/src/frames/official/cowork-desk.json +82 -0
- package/src/frames/official/cowork-meeting-room.json +107 -0
- package/src/frames/official/dragon-boat-race.json +83 -0
- package/src/frames/official/dragon-boat-ticket.json +98 -0
- package/src/frames/official/dragon-boat-zongzi.json +81 -0
- package/src/frames/official/durga-puja-lotus.json +114 -0
- package/src/frames/official/dussehra-seal.json +187 -0
- package/src/frames/official/earth-day-globe.json +77 -0
- package/src/frames/official/earth-day-pledge.json +66 -0
- package/src/frames/official/earth-day-recycle.json +109 -0
- package/src/frames/official/enkutatash-daisy.json +87 -0
- package/src/frames/official/enkutatash-seal.json +179 -0
- package/src/frames/official/environment-day.json +83 -0
- package/src/frames/official/event-anniversary.json +107 -0
- package/src/frames/official/event-awards.json +93 -0
- package/src/frames/official/event-baby-gifts.json +113 -0
- package/src/frames/official/event-baby-shower.json +70 -0
- package/src/frames/official/event-birth-announcement.json +71 -0
- package/src/frames/official/event-book-fair.json +142 -0
- package/src/frames/official/event-booth.json +98 -0
- package/src/frames/official/event-craft-fair.json +96 -0
- package/src/frames/official/event-cupcake.json +81 -0
- package/src/frames/official/event-engagement.json +116 -0
- package/src/frames/official/event-film-festival.json +92 -0
- package/src/frames/official/event-food-festival.json +108 -0
- package/src/frames/official/event-fun-run.json +107 -0
- package/src/frames/official/event-gala.json +121 -0
- package/src/frames/official/event-game-night.json +97 -0
- package/src/frames/official/event-grad-diploma.json +126 -0
- package/src/frames/official/event-grad-party.json +108 -0
- package/src/frames/official/event-grad-seal.json +186 -0
- package/src/frames/official/event-grad-stream.json +94 -0
- package/src/frames/official/event-guest-book.json +121 -0
- package/src/frames/official/event-hackathon.json +82 -0
- package/src/frames/official/event-keynote.json +74 -0
- package/src/frames/official/event-match-lineup.json +66 -0
- package/src/frames/official/event-meetup.json +86 -0
- package/src/frames/official/event-memorial.json +124 -0
- package/src/frames/official/event-milestone.json +168 -0
- package/src/frames/official/event-night-market.json +88 -0
- package/src/frames/official/event-open-mic.json +94 -0
- package/src/frames/official/event-party-hat.json +74 -0
- package/src/frames/official/event-prom.json +82 -0
- package/src/frames/official/event-quince.json +70 -0
- package/src/frames/official/event-retirement.json +92 -0
- package/src/frames/official/event-reunion.json +98 -0
- package/src/frames/official/event-runner-tracker.json +101 -0
- package/src/frames/official/event-season-ticket.json +89 -0
- package/src/frames/official/event-session-feedback.json +89 -0
- package/src/frames/official/event-setlist.json +70 -0
- package/src/frames/official/event-short-films.json +113 -0
- package/src/frames/official/event-slides.json +85 -0
- package/src/frames/official/event-speaker-qa.json +112 -0
- package/src/frames/official/event-talent-show.json +130 -0
- package/src/frames/official/event-tour-merch.json +63 -0
- package/src/frames/official/event-tournament.json +98 -0
- package/src/frames/official/event-trivia.json +79 -0
- package/src/frames/official/event-workshop.json +127 -0
- package/src/frames/official/festa-della-repubblica.json +100 -0
- package/src/frames/official/festa-junina-bonfire.json +81 -0
- package/src/frames/official/festa-junina-corn.json +72 -0
- package/src/frames/official/festa-junina-flags.json +110 -0
- package/src/frames/official/fiestas-patrias-chile.json +76 -0
- package/src/frames/official/food-day-wheat.json +109 -0
- package/src/frames/official/freedom-day-south-africa.json +109 -0
- package/src/frames/official/ganesh-marigold.json +71 -0
- package/src/frames/official/ganesh-modak.json +81 -0
- package/src/frames/official/ganesh-pandal.json +109 -0
- package/src/frames/official/garden-plant-label.json +98 -0
- package/src/frames/official/german-unity-day.json +100 -0
- package/src/frames/official/green-ribbon.json +123 -0
- package/src/frames/official/gudi-padwa.json +81 -0
- package/src/frames/official/hanami-arch.json +71 -0
- package/src/frames/official/hanami-picnic.json +90 -0
- package/src/frames/official/hanami-sakura.json +81 -0
- package/src/frames/official/hari-raya-haji.json +122 -0
- package/src/frames/official/hari-raya-ketupat.json +81 -0
- package/src/frames/official/hari-raya-open-house.json +114 -0
- package/src/frames/official/hari-raya-pelita.json +77 -0
- package/src/frames/official/harvest-basket.json +87 -0
- package/src/frames/official/harvest-corn.json +115 -0
- package/src/frames/official/harvest-hay.json +89 -0
- package/src/frames/official/harvest-market.json +109 -0
- package/src/frames/official/hijri-new-year-stamp.json +77 -0
- package/src/frames/official/hijri-new-year.json +122 -0
- package/src/frames/official/historic-marker.json +176 -0
- package/src/frames/official/hostel-check-in.json +113 -0
- package/src/frames/official/hostel-house-rules.json +136 -0
- package/src/frames/official/hostel-local-tips.json +86 -0
- package/src/frames/official/independence-argentina.json +105 -0
- package/src/frames/official/independence-bangladesh.json +64 -0
- package/src/frames/official/independence-colombia.json +108 -0
- package/src/frames/official/independence-ghana.json +105 -0
- package/src/frames/official/independence-indonesia.json +92 -0
- package/src/frames/official/independence-nigeria.json +100 -0
- package/src/frames/official/independence-pakistan.json +95 -0
- package/src/frames/official/independence-peru.json +100 -0
- package/src/frames/official/independence-poland.json +92 -0
- package/src/frames/official/independence-ukraine.json +92 -0
- package/src/frames/official/inti-raymi-sun.json +183 -0
- package/src/frames/official/jamhuri-day.json +116 -0
- package/src/frames/official/janmashtami-feather.json +77 -0
- package/src/frames/official/janmashtami-flute.json +81 -0
- package/src/frames/official/juneteenth-seal.json +187 -0
- package/src/frames/official/juneteenth-star.json +81 -0
- package/src/frames/official/kindness-day.json +109 -0
- package/src/frames/official/kings-day-crown.json +88 -0
- package/src/frames/official/kwanzaa-bands.json +100 -0
- package/src/frames/official/kwanzaa-harvest.json +77 -0
- package/src/frames/official/kwanzaa-kinara.json +81 -0
- package/src/frames/official/lantern-festival-riddles.json +77 -0
- package/src/frames/official/lantern-festival-tangyuan.json +122 -0
- package/src/frames/official/library-catalog.json +120 -0
- package/src/frames/official/library-ebooks.json +107 -0
- package/src/frames/official/library-hours.json +107 -0
- package/src/frames/official/lohri-bonfire.json +81 -0
- package/src/frames/official/lohri-dhol.json +114 -0
- package/src/frames/official/loy-krathong-float.json +88 -0
- package/src/frames/official/loy-krathong-moon.json +96 -0
- package/src/frames/official/loy-krathong-program.json +128 -0
- package/src/frames/official/mardi-gras-seal.json +183 -0
- package/src/frames/official/marina-welcome.json +172 -0
- package/src/frames/official/maslenitsa-pancakes.json +81 -0
- package/src/frames/official/maslenitsa-sun.json +183 -0
- package/src/frames/official/mid-autumn-gift.json +105 -0
- package/src/frames/official/mid-autumn-lantern-walk.json +96 -0
- package/src/frames/official/mid-autumn-mooncake.json +81 -0
- package/src/frames/official/mid-autumn-rabbit.json +77 -0
- package/src/frames/official/mid-autumn-seal.json +178 -0
- package/src/frames/official/monsoon-boots.json +88 -0
- package/src/frames/official/monsoon-chai.json +82 -0
- package/src/frames/official/monsoon-cloud.json +114 -0
- package/src/frames/official/monsoon-paper-boat.json +71 -0
- package/src/frames/official/monsoon-umbrella.json +81 -0
- package/src/frames/official/muertos-marigold.json +87 -0
- package/src/frames/official/muertos-ofrenda.json +129 -0
- package/src/frames/official/muertos-pan.json +78 -0
- package/src/frames/official/muertos-papel-picado.json +120 -0
- package/src/frames/official/muertos-seal.json +185 -0
- package/src/frames/official/museum-artist-note.json +124 -0
- package/src/frames/official/museum-exhibit-label.json +106 -0
- package/src/frames/official/museum-gallery-map.json +99 -0
- package/src/frames/official/museum-ticket.json +86 -0
- package/src/frames/official/national-day-belgium.json +100 -0
- package/src/frames/official/national-day-singapore.json +120 -0
- package/src/frames/official/navratri-dandiya.json +88 -0
- package/src/frames/official/navratri-garba-pass.json +90 -0
- package/src/frames/official/navratri-lamp.json +72 -0
- package/src/frames/official/nowruz-goldfish.json +71 -0
- package/src/frames/official/nowruz-party.json +90 -0
- package/src/frames/official/nowruz-sabzeh.json +81 -0
- package/src/frames/official/nowruz-seal.json +187 -0
- package/src/frames/official/obon-lantern.json +81 -0
- package/src/frames/official/obon-sign.json +109 -0
- package/src/frames/official/ocean-day-waves.json +114 -0
- package/src/frames/official/onam-boat-race.json +83 -0
- package/src/frames/official/onam-kasavu.json +122 -0
- package/src/frames/official/onam-pookalam.json +175 -0
- package/src/frames/official/onam-sadya.json +114 -0
- package/src/frames/official/orthodox-christmas-candle.json +71 -0
- package/src/frames/official/orthodox-christmas-star.json +76 -0
- package/src/frames/official/orthodox-easter-arch.json +77 -0
- package/src/frames/official/orthodox-easter-pysanka.json +87 -0
- package/src/frames/official/orthodox-easter-seal.json +185 -0
- package/src/frames/official/pancake-day.json +114 -0
- package/src/frames/official/park-bench-walks.json +121 -0
- package/src/frames/official/park-dog-rules.json +88 -0
- package/src/frames/official/park-map.json +92 -0
- package/src/frames/official/park-playground.json +64 -0
- package/src/frames/official/park-report.json +118 -0
- package/src/frames/official/parking-find-car.json +89 -0
- package/src/frames/official/peace-day-dove.json +66 -0
- package/src/frames/official/pink-ribbon-seal.json +180 -0
- package/src/frames/official/pink-ribbon.json +82 -0
- package/src/frames/official/pohela-boishakh-mela.json +116 -0
- package/src/frames/official/pohela-boishakh.json +120 -0
- package/src/frames/official/pongal-offers.json +120 -0
- package/src/frames/official/pongal-pot.json +81 -0
- package/src/frames/official/pongal-sun.json +183 -0
- package/src/frames/official/posadas-candle.json +71 -0
- package/src/frames/official/posadas-pinata.json +114 -0
- package/src/frames/official/pride-flag.json +124 -0
- package/src/frames/official/pride-heart.json +83 -0
- package/src/frames/official/pride-rainbow.json +81 -0
- package/src/frames/official/purim-mask.json +109 -0
- package/src/frames/official/purim-pastry.json +71 -0
- package/src/frames/official/puthandu-sun.json +101 -0
- package/src/frames/official/rakhi-envelope.json +75 -0
- package/src/frames/official/rakhi-gift-tag.json +59 -0
- package/src/frames/official/rakhi-thread.json +114 -0
- package/src/frames/official/ramadan-dates.json +81 -0
- package/src/frames/official/ramadan-suhoor.json +94 -0
- package/src/frames/official/red-ribbon.json +66 -0
- package/src/frames/official/republic-day-india-bands.json +120 -0
- package/src/frames/official/republic-day-india.json +182 -0
- package/src/frames/official/reyes-crown.json +78 -0
- package/src/frames/official/reyes-rosca.json +89 -0
- package/src/frames/official/rosh-hashanah-apple.json +81 -0
- package/src/frames/official/rosh-hashanah-honey.json +71 -0
- package/src/frames/official/rosh-hashanah-shofar.json +128 -0
- package/src/frames/official/sankranti-kite.json +114 -0
- package/src/frames/official/sankranti-sky.json +98 -0
- package/src/frames/official/sankranti-sticker.json +90 -0
- package/src/frames/official/school-backpack.json +81 -0
- package/src/frames/official/school-bus-routes.json +83 -0
- package/src/frames/official/school-lunch-menu.json +81 -0
- package/src/frames/official/school-uniform.json +109 -0
- package/src/frames/official/school-welcome-apple.json +71 -0
- package/src/frames/official/seollal-knot.json +122 -0
- package/src/frames/official/sham-el-nessim.json +81 -0
- package/src/frames/official/shogatsu-kadomatsu.json +81 -0
- package/src/frames/official/songkran-bands.json +123 -0
- package/src/frames/official/songkran-bowl.json +81 -0
- package/src/frames/official/songkran-drop.json +90 -0
- package/src/frames/official/songkran-waves.json +96 -0
- package/src/frames/official/spring-cleaning.json +107 -0
- package/src/frames/official/spring-showers.json +71 -0
- package/src/frames/official/spring-watering-can.json +114 -0
- package/src/frames/official/summer-camp.json +90 -0
- package/src/frames/official/summer-pool.json +95 -0
- package/src/frames/official/summer-reading.json +81 -0
- package/src/frames/official/summer-sunglasses.json +114 -0
- package/src/frames/official/summer-watermelon.json +89 -0
- package/src/frames/official/tabaski.json +114 -0
- package/src/frames/official/tanabata-stars.json +170 -0
- package/src/frames/official/tanabata-wishes.json +114 -0
- package/src/frames/official/teachers-day-apple.json +81 -0
- package/src/frames/official/teachers-day-note.json +109 -0
- package/src/frames/official/tet-apricot.json +114 -0
- package/src/frames/official/tet-banh-chung.json +81 -0
- package/src/frames/official/transit-bike-share.json +94 -0
- package/src/frames/official/transit-bus-arrivals.json +113 -0
- package/src/frames/official/transit-fare.json +97 -0
- package/src/frames/official/transit-ferry.json +88 -0
- package/src/frames/official/transit-next-trains.json +119 -0
- package/src/frames/official/transit-report.json +99 -0
- package/src/frames/official/transit-train-timetable.json +98 -0
- package/src/frames/official/ugadi-leaves.json +66 -0
- package/src/frames/official/vaisakhi-bands.json +120 -0
- package/src/frames/official/vaisakhi-dhol.json +81 -0
- package/src/frames/official/vaisakhi-wheat.json +73 -0
- package/src/frames/official/vesak-candle.json +122 -0
- package/src/frames/official/vesak-lantern.json +114 -0
- package/src/frames/official/vesak-lotus.json +71 -0
- package/src/frames/official/vesak-seal.json +179 -0
- package/src/frames/official/visitor-info.json +78 -0
- package/src/frames/official/visitor-town-map.json +108 -0
- package/src/frames/official/visitor-wildlife.json +70 -0
- package/src/frames/official/water-day-drop.json +81 -0
- package/src/frames/official/wifi-cafe-cup.json +81 -0
- package/src/frames/official/wifi-cowork.json +63 -0
- package/src/frames/official/wifi-hostel-board.json +80 -0
- package/src/frames/official/wifi-library.json +96 -0
- package/src/frames/official/wifi-reception.json +118 -0
- package/src/frames/official/wifi-rental.json +91 -0
- package/src/frames/official/wifi-venue.json +80 -0
- package/src/frames/official/wifi-waiting-room.json +89 -0
- package/src/frames/official/winter-lift-pass.json +90 -0
- package/src/frames/official/winter-sale.json +120 -0
- package/src/frames/official/winter-skating.json +71 -0
- package/src/frames/official/winter-snowman.json +81 -0
- package/src/frames/official/womens-day-mimosa.json +81 -0
- package/src/frames/official/womens-day-seal.json +179 -0
- package/src/frames/official/yalda-poem.json +122 -0
- package/src/frames/official/yalda-pomegranate.json +81 -0
- package/src/frames/official/yalda-watermelon.json +72 -0
- package/src/frames/official/yoga-day-lotus.json +81 -0
- package/src/frames/official/zoo-animal-facts.json +109 -0
- package/src/preact.ts +80 -0
- package/src/scan-score.ts +14 -7
- package/src/solid.ts +75 -0
- package/src/template/arrow.ts +14 -0
- package/src/template/dot-ring-layout.ts +230 -0
- package/src/template/dot-ring.tsx +165 -0
- package/src/template/frame-template.tsx +70 -0
- package/src/template/halloween.ts +14 -0
- package/src/template/index.ts +1 -0
- package/src/template/specs/arrow.json +26 -0
- package/src/template/specs/halloween.json +144 -0
- package/src/template/specs/square-border.json +27 -0
- package/src/template/specs/standard-box.json +31 -0
- package/src/template/specs/striked-box.json +56 -0
- package/src/template/square-border.ts +14 -0
- package/src/template/standard-box.ts +14 -0
- package/src/template/striked-box.ts +14 -0
- package/src/template-placement.ts +149 -0
- package/src/templates.tsx +16 -1
- package/types/frame-spec.ts +278 -11
- package/types/qr.ts +1 -1
- package/types/template.ts +7 -0
- package/dist/src/frame-styles.d.ts +0 -50
- package/dist/src/frame-styles.d.ts.map +0 -1
- package/src/frame-styles.ts +0 -1095
- package/src/template/arrow.tsx +0 -40
- package/src/template/halloween.tsx +0 -147
- package/src/template/square-border.tsx +0 -43
- package/src/template/standard-box.tsx +0 -43
- package/src/template/striked-box.tsx +0 -42
package/dist/qr-code-canvas.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";import{useEffect as di,useRef as Hn,useState as hi}from"react";var Lt;(u=>{class t{constructor(o,i,s,c){this.version=o;this.errorCorrectionLevel=i;if(o<t.MIN_VERSION||o>t.MAX_VERSION)throw new RangeError("Version value out of range");if(c<-1||c>7)throw new RangeError("Mask value out of range");this.size=o*4+17;let m=[];for(let f=0;f<this.size;f++)m.push(!1);for(let f=0;f<this.size;f++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();let p=this.addEccAndInterleave(s);if(this.drawCodewords(p),c==-1){let f=1e9;for(let d=0;d<8;d++){this.applyMask(d),this.drawFormatBits(d);let h=this.getPenaltyScore();h<f&&(c=d,f=h),this.applyMask(d)}}r(0<=c&&c<=7),this.mask=c,this.applyMask(c),this.drawFormatBits(c),this.isFunction=[]}version;errorCorrectionLevel;static encodeText(o,i){let s=u.QrSegment.makeSegments(o);return t.encodeSegments(s,i)}static encodeBinary(o,i){let s=u.QrSegment.makeBytes(o);return t.encodeSegments([s],i)}static encodeSegments(o,i,s=1,c=40,m=-1,p=!0){if(!(t.MIN_VERSION<=s&&s<=c&&c<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let f,d;for(f=s;;f++){let y=t.getNumDataCodewords(f,i)*8,S=a.getTotalBits(o,f);if(S<=y){d=S;break}if(f>=c)throw new RangeError("Data too long")}for(let y of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])p&&d<=t.getNumDataCodewords(f,y)*8&&(i=y);let h=[];for(let y of o){e(y.mode.modeBits,4,h),e(y.numChars,y.mode.numCharCountBits(f),h);for(let S of y.getData())h.push(S)}r(h.length==d);let b=t.getNumDataCodewords(f,i)*8;r(h.length<=b),e(0,Math.min(4,b-h.length),h),e(0,(8-h.length%8)%8,h),r(h.length%8==0);for(let y=236;h.length<b;y^=253)e(y,8,h);let g=[];for(;g.length*8<h.length;)g.push(0);return h.forEach((y,S)=>g[S>>>3]|=y<<7-(S&7)),new t(f,i,g,m)}size;mask;modules=[];isFunction=[];getModule(o,i){return 0<=o&&o<this.size&&0<=i&&i<this.size&&this.modules[i][o]}getModules(){return this.modules}drawFunctionPatterns(){for(let s=0;s<this.size;s++)this.setFunctionModule(6,s,s%2==0),this.setFunctionModule(s,6,s%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let o=this.getAlignmentPatternPositions(),i=o.length;for(let s=0;s<i;s++)for(let c=0;c<i;c++)s==0&&c==0||s==0&&c==i-1||s==i-1&&c==0||this.drawAlignmentPattern(o[s],o[c]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(o){let i=this.errorCorrectionLevel.formatBits<<3|o,s=i;for(let m=0;m<10;m++)s=s<<1^(s>>>9)*1335;let c=(i<<10|s)^21522;r(c>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,n(c,m));this.setFunctionModule(8,7,n(c,6)),this.setFunctionModule(8,8,n(c,7)),this.setFunctionModule(7,8,n(c,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,n(c,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,n(c,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,n(c,m));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let o=this.version;for(let s=0;s<12;s++)o=o<<1^(o>>>11)*7973;let i=this.version<<12|o;r(i>>>18==0);for(let s=0;s<18;s++){let c=n(i,s),m=this.size-11+s%3,p=Math.floor(s/3);this.setFunctionModule(m,p,c),this.setFunctionModule(p,m,c)}}drawFinderPattern(o,i){for(let s=-4;s<=4;s++)for(let c=-4;c<=4;c++){let m=Math.max(Math.abs(c),Math.abs(s)),p=o+c,f=i+s;0<=p&&p<this.size&&0<=f&&f<this.size&&this.setFunctionModule(p,f,m!=2&&m!=4)}}drawAlignmentPattern(o,i){for(let s=-2;s<=2;s++)for(let c=-2;c<=2;c++)this.setFunctionModule(o+c,i+s,Math.max(Math.abs(c),Math.abs(s))!=1)}setFunctionModule(o,i,s){this.modules[i][o]=s,this.isFunction[i][o]=!0}addEccAndInterleave(o){let i=this.version,s=this.errorCorrectionLevel;if(o.length!=t.getNumDataCodewords(i,s))throw new RangeError("Invalid argument");let c=t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][i],m=t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][i],p=Math.floor(t.getNumRawDataModules(i)/8),f=c-p%c,d=Math.floor(p/c),h=[],b=t.reedSolomonComputeDivisor(m);for(let y=0,S=0;y<c;y++){let E=o.slice(S,S+d-m+(y<f?0:1));S+=E.length;let R=t.reedSolomonComputeRemainder(E,b);y<f&&E.push(0),h.push(E.concat(R))}let g=[];for(let y=0;y<h[0].length;y++)h.forEach((S,E)=>{(y!=d-m||E>=f)&&g.push(S[y])});return r(g.length==p),g}drawCodewords(o){if(o.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let i=0;for(let s=this.size-1;s>=1;s-=2){s==6&&(s=5);for(let c=0;c<this.size;c++)for(let m=0;m<2;m++){let p=s-m,d=(s+1&2)==0?this.size-1-c:c;!this.isFunction[d][p]&&i<o.length*8&&(this.modules[d][p]=n(o[i>>>3],7-(i&7)),i++)}}r(i==o.length*8)}applyMask(o){if(o<0||o>7)throw new RangeError("Mask value out of range");for(let i=0;i<this.size;i++)for(let s=0;s<this.size;s++){let c;switch(o){case 0:c=(s+i)%2==0;break;case 1:c=i%2==0;break;case 2:c=s%3==0;break;case 3:c=(s+i)%3==0;break;case 4:c=(Math.floor(s/3)+Math.floor(i/2))%2==0;break;case 5:c=s*i%2+s*i%3==0;break;case 6:c=(s*i%2+s*i%3)%2==0;break;case 7:c=((s+i)%2+s*i%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[i][s]&&c&&(this.modules[i][s]=!this.modules[i][s])}}getPenaltyScore(){let o=0;for(let m=0;m<this.size;m++){let p=!1,f=0,d=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[m][h]==p?(f++,f==5?o+=t.PENALTY_N1:f>5&&o++):(this.finderPenaltyAddHistory(f,d),p||(o+=this.finderPenaltyCountPatterns(d)*t.PENALTY_N3),p=this.modules[m][h],f=1);o+=this.finderPenaltyTerminateAndCount(p,f,d)*t.PENALTY_N3}for(let m=0;m<this.size;m++){let p=!1,f=0,d=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][m]==p?(f++,f==5?o+=t.PENALTY_N1:f>5&&o++):(this.finderPenaltyAddHistory(f,d),p||(o+=this.finderPenaltyCountPatterns(d)*t.PENALTY_N3),p=this.modules[h][m],f=1);o+=this.finderPenaltyTerminateAndCount(p,f,d)*t.PENALTY_N3}for(let m=0;m<this.size-1;m++)for(let p=0;p<this.size-1;p++){let f=this.modules[m][p];f==this.modules[m][p+1]&&f==this.modules[m+1][p]&&f==this.modules[m+1][p+1]&&(o+=t.PENALTY_N2)}let i=0;for(let m of this.modules)i=m.reduce((p,f)=>p+(f?1:0),i);let s=this.size*this.size,c=Math.ceil(Math.abs(i*20-s*10)/s)-1;return r(0<=c&&c<=9),o+=c*t.PENALTY_N4,r(0<=o&&o<=2568888),o}getAlignmentPatternPositions(){if(this.version==1)return[];{let o=Math.floor(this.version/7)+2,i=this.version==32?26:Math.ceil((this.version*4+4)/(o*2-2))*2,s=[6];for(let c=this.size-7;s.length<o;c-=i)s.splice(1,0,c);return s}}static getNumRawDataModules(o){if(o<t.MIN_VERSION||o>t.MAX_VERSION)throw new RangeError("Version number out of range");let i=(16*o+128)*o+64;if(o>=2){let s=Math.floor(o/7)+2;i-=(25*s-10)*s-55,o>=7&&(i-=36)}return r(208<=i&&i<=29648),i}static getNumDataCodewords(o,i){return Math.floor(t.getNumRawDataModules(o)/8)-t.ECC_CODEWORDS_PER_BLOCK[i.ordinal][o]*t.NUM_ERROR_CORRECTION_BLOCKS[i.ordinal][o]}static reedSolomonComputeDivisor(o){if(o<1||o>255)throw new RangeError("Degree out of range");let i=[];for(let c=0;c<o-1;c++)i.push(0);i.push(1);let s=1;for(let c=0;c<o;c++){for(let m=0;m<i.length;m++)i[m]=t.reedSolomonMultiply(i[m],s),m+1<i.length&&(i[m]^=i[m+1]);s=t.reedSolomonMultiply(s,2)}return i}static reedSolomonComputeRemainder(o,i){let s=i.map(c=>0);for(let c of o){let m=c^s.shift();s.push(0),i.forEach((p,f)=>s[f]^=t.reedSolomonMultiply(p,m))}return s}static reedSolomonMultiply(o,i){if(o>>>8||i>>>8)throw new RangeError("Byte out of range");let s=0;for(let c=7;c>=0;c--)s=s<<1^(s>>>7)*285,s^=(i>>>c&1)*o;return r(s>>>8==0),s}finderPenaltyCountPatterns(o){let i=o[1];r(i<=this.size*3);let s=i>0&&o[2]==i&&o[3]==i*3&&o[4]==i&&o[5]==i;return(s&&o[0]>=i*4&&o[6]>=i?1:0)+(s&&o[6]>=i*4&&o[0]>=i?1:0)}finderPenaltyTerminateAndCount(o,i,s){return o&&(this.finderPenaltyAddHistory(i,s),i=0),i+=this.size,this.finderPenaltyAddHistory(i,s),this.finderPenaltyCountPatterns(s)}finderPenaltyAddHistory(o,i){i[0]==0&&(o+=this.size),i.pop(),i.unshift(o)}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]]}u.QrCode=t;function e(l,o,i){if(o<0||o>31||l>>>o)throw new RangeError("Value out of range");for(let s=o-1;s>=0;s--)i.push(l>>>s&1)}function n(l,o){return(l>>>o&1)!=0}function r(l){if(!l)throw new Error("Assertion error")}class a{constructor(o,i,s){this.mode=o;this.numChars=i;this.bitData=s;if(i<0)throw new RangeError("Invalid argument");this.bitData=s.slice()}mode;numChars;bitData;static makeBytes(o){let i=[];for(let s of o)e(s,8,i);return new a(a.Mode.BYTE,o.length,i)}static makeNumeric(o){if(!a.isNumeric(o))throw new RangeError("String contains non-numeric characters");let i=[];for(let s=0;s<o.length;){let c=Math.min(o.length-s,3);e(parseInt(o.substr(s,c),10),c*3+1,i),s+=c}return new a(a.Mode.NUMERIC,o.length,i)}static makeAlphanumeric(o){if(!a.isAlphanumeric(o))throw new RangeError("String contains unencodable characters in alphanumeric mode");let i=[],s;for(s=0;s+2<=o.length;s+=2){let c=a.ALPHANUMERIC_CHARSET.indexOf(o.charAt(s))*45;c+=a.ALPHANUMERIC_CHARSET.indexOf(o.charAt(s+1)),e(c,11,i)}return s<o.length&&e(a.ALPHANUMERIC_CHARSET.indexOf(o.charAt(s)),6,i),new a(a.Mode.ALPHANUMERIC,o.length,i)}static makeSegments(o){return o==""?[]:a.isNumeric(o)?[a.makeNumeric(o)]:a.isAlphanumeric(o)?[a.makeAlphanumeric(o)]:[a.makeBytes(a.toUtf8ByteArray(o))]}static makeEci(o){let i=[];if(o<0)throw new RangeError("ECI assignment value out of range");if(o<128)e(o,8,i);else if(o<16384)e(2,2,i),e(o,14,i);else if(o<1e6)e(6,3,i),e(o,21,i);else throw new RangeError("ECI assignment value out of range");return new a(a.Mode.ECI,0,i)}static isNumeric(o){return a.NUMERIC_REGEX.test(o)}static isAlphanumeric(o){return a.ALPHANUMERIC_REGEX.test(o)}getData(){return this.bitData.slice()}static getTotalBits(o,i){let s=0;for(let c of o){let m=c.mode.numCharCountBits(i);if(c.numChars>=1<<m)return 1/0;s+=4+m+c.bitData.length}return s}static toUtf8ByteArray(o){o=encodeURI(o);let i=[];for(let s=0;s<o.length;s++)o.charAt(s)!="%"?i.push(o.charCodeAt(s)):(i.push(parseInt(o.substr(s+1,2),16)),s+=2);return i}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}u.QrSegment=a})(Lt||={});(e=>{let t;(r=>{class n{constructor(u,l){this.ordinal=u;this.formatBits=l}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)}r.Ecc=n})(t=e.QrCode||={})})(Lt||={});(e=>{let t;(r=>{class n{constructor(u,l){this.modeBits=u;this.numBitsCharCount=l}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(u){return this.numBitsCharCount[Math.floor((u+7)/17)]}}r.Mode=n})(t=e.QrSegment||={})})(Lt||={});var H=Lt;var ct={L:H.QrCode.Ecc.LOW,M:H.QrCode.Ecc.MEDIUM,Q:H.QrCode.Ecc.QUARTILE,H:H.QrCode.Ecc.HIGH},Ht=128,At="Q",tt="#FFFFFF",Vt="#000000";var Xt=0;var jt=.1;import{z as lt}from"zod";var Wn=["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"],et=24,qe="Scan me",Tt=.5,gt=1.5,Zn=lt.enum(Wn),pe=lt.object({style:Zn,text:lt.string().max(et).optional(),color:lt.string().optional(),textColor:lt.string().optional(),secondaryText:lt.string().max(et).optional(),secondaryColor:lt.string().optional(),fontScale:lt.number().min(Tt).max(gt).optional()});import{z as C}from"zod";function Wt(t,e=3){let n=10**e;return Math.round(t*n)/n+0}function x(t,e=3){return String(Wt(t,e))}function O(t,...e){let n=t[0]??"";for(let r=0;r<e.length;r++){let a=e[r];n+=(typeof a=="number"?x(a):a)+(t[r+1]??"")}return n}var Kn={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Jn=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,fe=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function Zt(t,e=Number.POSITIVE_INFINITY){if(!Jn.test(t))return null;let n=[],r=0,a=()=>{for(;r<t.length&&/[\s,]/.test(t[r]);)r++},u=()=>{a(),fe.lastIndex=r;let i=fe.exec(t);if(!i)return null;let s=i[0],c=s.indexOf(".");if(c>=0&&s.length-c-1>e)return null;r=fe.lastIndex;let m=Number(s);return Number.isFinite(m)?m:null},l=()=>{a();let i=t[r];return i==="0"||i==="1"?(r++,i==="1"?1:0):null},o=()=>(a(),r<t.length&&/[0-9.+-]/.test(t[r]));for(a();r<t.length;){let i=t[r],s=i.toUpperCase(),c=Kn[s];if(c===void 0||n.length===0&&s!=="M")return null;if(r++,c===0){n.push({command:i,values:[]}),a();continue}let m=i,p=!0;for(;p||o();){let f=[];for(let d=0;d<c;d++){let h=s==="A"&&(d===3||d===4)?l():u();if(h===null)return null;f.push(h)}n.push({command:m,values:f}),s==="M"&&(m=i==="M"?"L":"l"),p=!1}a()}return n}function ze(t){let e=0;for(let{command:n}of t)e+=n.toUpperCase()==="A"?4:1;return e}function ke(t,e=1,n=0,r=0){let a="";for(let{command:u,values:l}of t){let o=u.toUpperCase(),i=u===o,s=i?n:0,c=i?r:0,m;switch(o){case"Z":m=[];break;case"H":m=[x(l[0]*e+s)];break;case"V":m=[x(l[0]*e+c)];break;case"A":m=[x(Math.abs(l[0])*e),x(Math.abs(l[1])*e),x(l[2]),String(l[3]),String(l[4]),x(l[5]*e+s),x(l[6]*e+c)];break;default:m=l.map((p,f)=>x(p*e+(f%2===0?s:c)))}a+=u+m.join(" ")}return a}function Be(t,e=.25){let n=[],r=[],a=[0,0],u=[0,0],l=()=>{r.length>2&&n.push(r),r=[]};for(let o of t)if(o.op==="M")l(),a=[o.x,o.y],u=a,r.push(a);else if(o.op==="L")u=[o.x,o.y],r.push(u);else if(o.op==="C"){let i=u,s=[o.x1,o.y1],c=[o.x2,o.y2],m=[o.x,o.y],p=Math.hypot(s[0]-i[0],s[1]-i[1])+Math.hypot(c[0]-s[0],c[1]-s[1])+Math.hypot(m[0]-c[0],m[1]-c[1]),f=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(p/(4*e)))));for(let d=1;d<=f;d++){let h=d/f,b=1-h;r.push([b*b*b*i[0]+3*b*b*h*s[0]+3*b*h*h*c[0]+h*h*h*m[0],b*b*b*i[1]+3*b*b*h*s[1]+3*b*h*h*c[1]+h*h*h*m[1]])}u=m}else l(),u=a;return l(),n}function Ge(t,e){let n=[a=>a[0]-e.x0,a=>e.x1-a[0],a=>a[1]-e.y0,a=>e.y1-a[1]],r=t;for(let a of n){if(r.length===0)break;let u=r;r=[];for(let l=0;l<u.length;l++){let o=u[l],i=u[(l+u.length-1)%u.length],s=a(o),c=a(i);s>=0?(c<0&&r.push(De(i,o,c,s)),r.push(o)):c>=0&&r.push(De(i,o,c,s))}}return r.length>2?r:[]}function De(t,e,n,r){let a=n/(n-r);return[t[0]+(e[0]-t[0])*a,t[1]+(e[1]-t[1])*a]}function Qe(t){return t.filter(e=>e.length>2).map(e=>`M${e.map(([n,r])=>`${x(n)} ${x(r)}`).join("L")}Z`).join("")}function Ue(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=Number.NEGATIVE_INFINITY,u=(l,o)=>{e=Math.min(e,l),n=Math.min(n,o),r=Math.max(r,l),a=Math.max(a,o)};for(let l of t)l.op==="C"?(u(l.x1,l.y1),u(l.x2,l.y2),u(l.x,l.y)):l.op!=="Z"&&u(l.x,l.y);return Number.isFinite(e)?{x0:e,y0:n,x1:r,y1:a}:null}var de=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function tr(t,e,n,r,a,u,l,o,i){if(t===o&&e===i)return[];let s=Math.abs(n),c=Math.abs(r);if(s===0||c===0)return[{op:"L",x:o,y:i}];let m=a*Math.PI/180,p=Math.cos(m),f=Math.sin(m),d=(t-o)/2,h=(e-i)/2,b=p*d+f*h,g=-f*d+p*h,y=b*b/(s*s)+g*g/(c*c);y>1&&(s*=Math.sqrt(y),c*=Math.sqrt(y));let S=s*s*c*c-s*s*g*g-c*c*b*b,E=s*s*g*g+c*c*b*b,R=(u===l?-1:1)*Math.sqrt(Math.max(0,S/E)),M=R*s*g/c,P=-R*c*b/s,_=p*M-f*P+(t+o)/2,I=f*M+p*P+(e+i)/2,G=(Y,X,W,Ct)=>Math.atan2(Y*Ct-X*W,Y*W+X*Ct),Q=G(1,0,(b-M)/s,(g-P)/c),Z=G((b-M)/s,(g-P)/c,(-b-M)/s,(-g-P)/c);!l&&Z>0?Z-=2*Math.PI:l&&Z<0&&(Z+=2*Math.PI);let K=Math.max(1,Math.ceil(Math.abs(Z)/(Math.PI/2)-1e-9)),U=Z/K,at=4/3*Math.tan(U/4),ft=(Y,X)=>[_+s*p*Y-c*f*X,I+s*f*Y+c*p*X],Mt=[];for(let Y=0;Y<K;Y++){let X=Q+Y*U,W=X+U,[Ct,Gt]=ft(Math.cos(X)-at*Math.sin(X),Math.sin(X)+at*Math.cos(X)),[wt,v]=ft(Math.cos(W)+at*Math.sin(W),Math.sin(W)-at*Math.cos(W)),[J,st]=Y===K-1?[o,i]:ft(Math.cos(W),Math.sin(W));Mt.push({op:"C",x1:Ct,y1:Gt,x2:wt,y2:v,x:J,y:st})}return Mt}function Kt(t){let e=[],n=0,r=0,a=0,u=0,l=0,o="",i=null,s=null,c=()=>{for(;n<t.length&&/[\s,]/.test(t[n]);)n++},m=()=>{c(),de.lastIndex=n;let d=de.exec(t);return d?(n=de.lastIndex,Number(d[0])):null},p=()=>{c();let d=t[n];return d==="0"||d==="1"?(n++,d==="1"):null},f=d=>{let h=[];for(let b=0;b<d;b++){let g=m();if(g===null)return null;h.push(g)}return h};for(;c(),!(n>=t.length);){let d=t[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(d))o=d,n++;else if(!o||o==="Z"||o==="z")break;let h=o===o.toLowerCase(),b=h?r:0,g=h?a:0,y=o.toUpperCase();if(y==="Z"){e.push({op:"Z"}),r=u,a=l,i=null,s=null;continue}if(y==="A"){let M=f(3),P=p(),_=p(),I=f(2);if(!(M&&I)||P===null||_===null)break;let[G,Q,Z]=M,K=I[0]+b,U=I[1]+g;e.push(...tr(r,a,G,Q,Z,P,_,K,U)),r=K,a=U,i=null,s=null;continue}let S={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[y]??0,E=f(S);if(!E)break;let R=E;switch(y){case"M":r=R[0]+b,a=R[1]+g,u=r,l=a,e.push({op:"M",x:r,y:a}),o=h?"l":"L",i=null,s=null;break;case"L":case"H":case"V":y!=="V"&&(r=R[0]+b),y==="V"?a=R[0]+g:y==="L"&&(a=R[1]+g),e.push({op:"L",x:r,y:a}),i=null,s=null;break;case"C":case"S":{let M,P;y==="C"?(M=[R[0]+b,R[1]+g],P=R.slice(2)):(M=i?[2*r-i[0],2*a-i[1]]:[r,a],P=R);let _=[P[0]+b,P[1]+g],I=[P[2]+b,P[3]+g];e.push({op:"C",x1:M[0],y1:M[1],x2:_[0],y2:_[1],x:I[0],y:I[1]}),[r,a]=I,i=_,s=null;break}case"Q":case"T":{let M,P;y==="Q"?(M=[R[0]+b,R[1]+g],P=[R[2]+b,R[3]+g]):(M=s?[2*r-s[0],2*a-s[1]]:[r,a],P=[R[0]+b,R[1]+g]),e.push({op:"C",x1:r+2/3*(M[0]-r),y1:a+2/3*(M[1]-a),x2:P[0]+2/3*(M[0]-P[0]),y2:P[1]+2/3*(M[1]-P[1]),x:P[0],y:P[1]}),[r,a]=P,s=M,i=null;break}default:break}}return e}var Ye=.5522847498;function he(t,e,n,r,a=0,u=0){if(n<=0||r<=0)return[];let l=Math.min(Math.max(a,0),n/2),o=Math.min(Math.max(u,0),r/2);if(l===0||o===0)return[{op:"M",x:t,y:e},{op:"L",x:t+n,y:e},{op:"L",x:t+n,y:e+r},{op:"L",x:t,y:e+r},{op:"Z"}];let i=l*Ye,s=o*Ye,c=t+n,m=e+r;return[{op:"M",x:t+l,y:e},{op:"L",x:c-l,y:e},{op:"C",x1:c-l+i,y1:e,x2:c,y2:e+o-s,x:c,y:e+o},{op:"L",x:c,y:m-o},{op:"C",x1:c,y1:m-o+s,x2:c-l+i,y2:m,x:c-l,y:m},{op:"L",x:t+l,y:m},{op:"C",x1:t+l-i,y1:m,x2:t,y2:m-o+s,x:t,y:m-o},{op:"L",x:t,y:e+o},{op:"C",x1:t,y1:e+o-s,x2:t+l-i,y2:e,x:t+l,y:e},{op:"Z"}]}var er="qrdx.frame",nr=1,ye="custom",N={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:et},rr=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],xe=.95,or=200,ir=["frame","text","accent","background"],ar=/[\t\n\v\f\r\u0085\u2028\u2029]/g,sr=/[\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 Se(t,e=et){let n=t.slice(0,1e3).normalize("NFC").replace(ar," ").replace(sr,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,e)).join("").trim()}var Ee=t=>Math.abs(t*1e3-Math.round(t*1e3))<1e-6,T=C.number().min(-N.maxCoordinate).max(N.maxCoordinate).refine(Ee,{message:`Numbers may have at most ${N.maxDecimals} decimals`}),D=T.refine(t=>t>0,{message:"Must be greater than 0"}),te=T.refine(t=>t>=0,{message:"Must not be negative"}),Jt=C.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color"),ge=C.union([C.enum(ir),Jt]),Nt=C.union([ge,C.object({mix:C.tuple([ge,ge]),amount:C.number().min(0).max(1).refine(Ee)}).strict()]),bt=C.union([Nt,C.object({gradient:C.object({from:Nt,to:Nt,direction:C.enum(["horizontal","vertical"]).optional(),steps:C.int().min(2).max(N.maxGradientSteps).optional()}).strict()}).strict()]),be={x:T,y:T,width:D,height:D},cr=C.object({type:C.literal("rect"),...be,radius:te.optional(),fill:bt,hole:C.object({...be,radius:te.optional()}).strict().optional()}).strict(),lr=C.object({type:C.literal("circle"),cx:T,cy:T,r:D,hole:D.optional(),fill:bt}).strict(),ur=C.object({type:C.literal("ellipse"),cx:T,cy:T,rx:D,ry:D,fill:bt}).strict(),mr=C.object({type:C.literal("polygon"),points:C.array(C.tuple([T,T])).min(3).max(N.maxPolygonPoints),fill:bt}).strict(),pr=C.object({type:C.literal("path"),d:C.string().min(2).max(N.maxPathLength),fill:bt,fillRule:C.enum(["nonzero","evenodd"]).optional()}).strict(),fr=C.object({type:C.literal("line"),x1:T,y1:T,x2:T,y2:T,width:D,cap:C.enum(["butt","round"]).optional(),dash:C.tuple([D,D]).optional(),fill:bt}).strict(),dr=C.object({type:C.literal("icon"),icon:C.enum(rr),x:T,y:T,size:D,fill:bt}).strict(),hr=C.discriminatedUnion("type",[cr,lr,ur,mr,pr,fr,dr]),Ve={id:C.string().regex(/^[a-z][a-z0-9-]{0,31}$/),slot:C.enum(["primary","secondary","fixed"]),text:C.string().max(200),maxLength:C.int().min(1).max(et).optional(),color:Nt,weight:C.enum(["bold","regular"]).optional()},gr=C.object({type:C.literal("text"),...Ve,box:C.object(be).strict(),align:C.enum(["start","middle","end"]).optional(),fontSize:D.optional()}).strict(),br=C.object({type:C.literal("curved"),...Ve,curve:C.object({cx:T,cy:T,radius:D,side:C.enum(["top","bottom"]),spread:C.number().min(20).max(300).refine(Ee).optional()}).strict(),fontSize:D}).strict(),yr=C.discriminatedUnion("type",[gr,br]),He=T.refine(t=>t>=N.minArtboard&&t<=N.maxArtboard,{message:`Artboard sides must be ${N.minArtboard} to ${N.maxArtboard} units`}),xr=C.object({kind:C.literal(er),version:C.literal(nr),artboard:C.object({width:He,height:He}).strict(),qr:C.object({x:T,y:T,size:D,padding:te.optional(),radius:te.optional()}).strict(),colors:C.object({frame:Jt,text:Jt.optional(),accent:Jt.optional()}).strict(),shapes:C.array(hr).max(N.maxShapes),labels:C.array(yr).max(N.maxLabels),bleed:C.union([C.literal("none"),Nt]).optional()}).strict();function Sr(t){let e=ee(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 ee(t){return t.qr.padding??t.qr.size*N.defaultPadding}var Er=(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 Mr(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(([r])=>r),n=t.points.map(([,r])=>r);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=Zt(t.d,N.maxDecimals);return e?{bounds:Ue(Kt(t.d)),segments:ze(e)}:{bounds:null,segments:0}}case"line":{let e=t.width/2,n=Math.hypot(t.x2-t.x1,t.y2-t.y1),r=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:r*(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:or}}}function Cr(t,e){let n=(g,y=[])=>e.addIssue({code:"custom",message:g,path:y}),r=N,a=new TextEncoder().encode(JSON.stringify(t)).length;if(a>r.maxBytes){n(`The spec is ${a} bytes; the limit is ${r.maxBytes}`);return}let{width:u,height:l}=t.artboard,o=Math.max(u,l)*.005,i={x0:-o,y0:-o,x1:u+o,y1:l+o},s=g=>g.x0>=i.x0&&g.y0>=i.y0&&g.x1<=i.x1&&g.y1<=i.y1,{qr:c}=t,m=ee(t);m<c.size*r.minPadding-1e-9&&n(`qr.padding must be at least ${r.minPadding*100}% of qr.size`,["qr","padding"]),c.size<Math.min(u,l)*r.minQrShare-1e-9&&n(`qr.size must be at least ${r.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let p=Sr(t);(p.x0<-1e-9||p.y0<-1e-9||p.x1>u+1e-9||p.y1>l+1e-9)&&n("The code and its padding must sit inside the artboard",["qr"]),(c.radius??0)>(c.size+2*m)/2&&n("qr.radius is larger than half the plate",["qr","radius"]);let f=0,d=0;t.shapes.forEach((g,y)=>{let S=["shapes",y],{bounds:E,segments:R}=Mr(g);if(!E){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",[...S,"d"]);return}if(s(E)||n("The shape extends outside the artboard",S),g.type==="rect"&&g.hole){let{hole:M}=g;(M.x<g.x||M.y<g.y||M.x+M.width>g.x+g.width+1e-9||M.y+M.height>g.y+g.height+1e-9)&&n("The hole must sit inside its rect",[...S,"hole"])}g.type==="circle"&&g.hole&&g.hole>=g.r&&n("The hole must be smaller than the circle",[...S,"hole"]),f+=R,typeof g.fill=="object"&&"gradient"in g.fill&&(d+=(g.fill.gradient.steps??32)*R)}),f>r.maxSegments&&n(`The shapes have ${f} segments; the limit is ${r.maxSegments}`,["shapes"]),d>r.maxGradientWork&&n("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let h=new Set,b=new Set;t.labels.forEach((g,y)=>{let S=["labels",y];h.has(g.id)&&n(`Label id "${g.id}" is used twice`,[...S,"id"]),h.add(g.id),g.slot!=="fixed"&&(b.has(g.slot)&&n(`Only one label may use the ${g.slot} slot`,[...S,"slot"]),b.add(g.slot));let E=g.maxLength??r.maxTextLength;g.text!==Se(g.text,E)&&n(`Label text must be at most ${E} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...S,"text"]);let R;if(g.type==="text")R={x0:g.box.x,y0:g.box.y,x1:g.box.x+g.box.width,y1:g.box.y+g.box.height},g.fontSize!==void 0&&g.fontSize>g.box.height*xe+1e-9&&n("fontSize may be at most 95% of the label's row height",[...S,"fontSize"]),Er(R,p)&&n("The label overlaps the code or its padding",[...S,"box"]);else{let{cx:M,cy:P,radius:_}=g.curve,I=g.fontSize*gt*.6;R={x0:M-_-I,y0:P-_-I,x1:M+_+I,y1:P+_+I};let G=Math.hypot(Math.max(p.x0-M,0,M-p.x1),Math.max(p.y0-P,0,P-p.y1));Math.hypot(Math.max(Math.abs(p.x0-M),Math.abs(p.x1-M)),Math.max(Math.abs(p.y0-P),Math.abs(p.y1-P)))<=_-I||G>=_+I||n("The curved label crosses the code or its padding",[...S,"curve"])}s(R)||n("The label extends outside the artboard",S)})}var Me=xr.superRefine(Cr);var Rr=pe.extend({style:C.literal(ye),spec:Me}),Xe=C.discriminatedUnion("style",[pe,Rr]);function B(t){if(t.length===0)return"";let[e,...n]=t;return`M${x(e[0])} ${x(e[1])}${n.map(([r,a])=>`L${x(r)} ${x(a)}`).join("")}Z`}function $(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 A(t,e,n,r,a=0){let u=Math.min(n,r)/2,[l,o,i,s]=(typeof a=="number"?[a,a,a,a]:a).map(m=>Math.max(0,Math.min(m,u))),c=(m,p,f)=>m>0?`A${x(m)} ${x(m)} 0 0 1 ${x(p)} ${x(f)}`:"";return`M${x(t+l)} ${x(e)}H${x(t+n-o)}${c(o,t+n,e+o)}V${x(e+r-i)}${c(i,t+n-i,e+r)}H${x(t+s)}${c(s,t,e+r-s)}V${x(e+l)}${c(l,t+l,e)}Z`}function ne(t,e,n,r,a=5){return Array.from({length:a*2},(u,l)=>{let o=l%2===0?n:r,i=-Math.PI/2+Math.PI/a*l;return[t+o*Math.cos(i),e+o*Math.sin(i)]})}function je(t,e,n){let r=n/2,a=(u,l)=>`${x(t+u*r)} ${x(e+l*r)}`;return`M${a(0,-.52)}C${a(.18,-.92)} ${a(.98,-.94)} ${a(1,-.34)}C${a(1,.12)} ${a(.5,.48)} ${a(0,.92)}C${a(-.5,.48)} ${a(-1,.12)} ${a(-1,-.34)}C${a(-.98,-.94)} ${a(-.18,-.92)} ${a(0,-.52)}Z`}function Ce(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 We=24,ut=(t,e,n,r)=>{let a=r*Math.PI/180;return[t+n*Math.cos(a),e+n*Math.sin(a)]},re=([t,e])=>`${x(t)} ${x(e)}`;function $t(t,e,n,r,a,u){let l=u-a>180?1:0;return`M${re(ut(t,e,r,a))}A${x(r)} ${x(r)} 0 ${l} 1 ${re(ut(t,e,r,u))}L${re(ut(t,e,n,u))}A${x(n)} ${x(n)} 0 ${l} 0 ${re(ut(t,e,n,a))}Z`}function Ot(t,e,n,r){return`M${x(t-n)} ${x(e)}A${x(n)} ${x(r)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(r)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function Pr(t){let e=0;return t.forEach(([n,r],a)=>{let[u,l]=t[(a+1)%t.length];e+=n*l-u*r}),e/2}function Ze(t){return B(Pr(t)<0?[...t].reverse():t)}function oe(t,e,n,r,a){let u=Math.hypot(n-t,r-e)||1,l=-(r-e)/u*(a/2),o=(n-t)/u*(a/2);return Ze([[t+l,e+o],[n+l,r+o],[n-l,r-o],[t-l,e-o]])}var z=(...t)=>({d:t.join(""),fillRule:"nonzero"}),nt=(...t)=>({d:t.join(""),fillRule:"evenodd"});function Lr(){let t=[];for(let e of[0,60,120]){let[n,r]=ut(12,12,10.5,e+180),[a,u]=ut(12,12,10.5,e);t.push(oe(n,r,a,u,2))}for(let e=0;e<6;e++){let n=e*60,[r,a]=ut(12,12,6.2,n);for(let u of[-45,45]){let[l,o]=ut(r,a,3.6,n+u);t.push(oe(r,a,l,o,1.7))}}return z(...t)}var Ar={wifi:()=>z($t(12,20,4.6,7.2,-135,-45),$t(12,20,9.2,11.8,-135,-45),$t(12,20,13.8,16.4,-135,-45),$(12,20,2.2)),star:()=>z(B(ne(12,12.8,11.6,4.8))),heart:()=>z(je(12,12.4,22)),phone:()=>nt(A(6,1.5,12,21,2.6),A(7.8,4.2,8.4,13.4,.6),$(12,19.8,1.1)),headphones:()=>z($t(12,13,7.6,9.8,-180,0),A(2,12,5,9.5,2),A(17,12,5,9.5,2)),calendar:()=>nt(A(2.5,4,19,17.5,2.5),A(4.6,9,14.8,10.6,.8),A(7,11.4,2.6,2.6,.4),A(10.7,11.4,2.6,2.6,.4),A(14.4,11.4,2.6,2.6,.4),A(7,15.1,2.6,2.6,.4),A(10.7,15.1,2.6,2.6,.4),A(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),A(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>z($(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:()=>nt(A(2,3,20,14,4),B([[6.5,17],[11.5,17],[5.8,21.8]]),$(7.5,10,1.5),$(12,10,1.5),$(16.5,10,1.5)),bag:()=>z(A(3.5,7.5,17,14.5,2),$t(12,7.5,3.1,4.8,-180,0)),bell:()=>z("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",A(1.5,18.2,21,2.6,1.3),A(11.2,6.6,1.6,2.6,0),A(9.8,4.6,4.4,2.4,1.2)),cup:()=>z("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",$t(17,10.2,1.7,3.6,-90,90),A(2,20.6,17,2,1),A(7,1.6,1.6,3.4,.8),A(11.6,1.6,1.6,3.4,.8)),card:()=>nt(A(1.5,4.5,21,15,2.5),A(1.5,8,21,3,0),A(4.5,13.6,4.6,3.2,.6)),check:()=>nt($(12,12,10.5),B([[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:()=>nt($(12,12,10.5),$(12,7.2,1.6),A(10.6,10,2.8,8,.8)),home:()=>nt(B([[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]]),A(10,14.5,4,7,[.6,.6,0,0])),pin:()=>nt("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",$(12,9.5,3)),share:()=>z(oe(6,12,18,5,1.8),oe(6,12,18,19,1.8),$(18,5,3.2),$(6,12,3.2),$(18,19,3.2)),download:()=>z(A(10.6,2,2.8,9.5,0),B([[6,10],[18,10],[12,16.5]]),B([[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:()=>nt($(12,12,10.5),$(12,12,8.4),B([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:Lr,pumpkin:()=>z(Ot(7.8,14.6,5.8,6.9),Ot(16.2,14.6,5.8,6.9),Ot(12,14.6,4.8,7.4),A(10.9,3.4,2.2,4.6,.8),Ze([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>z(B([[12,1.5],[16.8,8.2],[7.2,8.2]]),B([[12,5.2],[19,13.6],[5,13.6]]),B([[12,9.4],[21.2,19.2],[2.8,19.2]]),A(10.4,18.6,3.2,3.9,.4)),sparkle:()=>z(B(ne(9.5,13.5,9,2.4,4)),B(ne(19,5,4,1.1,4))),gift:()=>z(A(3,11.2,7.8,10.6,1),A(13.2,11.2,7.8,10.6,1),A(2,7.4,8.8,3.2,1),A(13.2,7.4,8.8,3.2,1),Ot(8.8,4.8,2.9,1.9),Ot(15.2,4.8,2.9,1.9))};function Ke(t){return Ar[t]()}var $r={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 Je(t,e){let n=t.trim(),r=Number.parseFloat(n);return Number.isNaN(r)?Number.NaN:n.endsWith("%")?r/100*e:r}function qt(t){if(!t)return null;let e=t.trim().toLowerCase();if(e==="transparent")return{r:0,g:0,b:0,a:0};let n=$r[e];if(n)return{r:n[0],g:n[1],b:n[2],a:1};if(e.startsWith("#")){let a=e.slice(1);return(a.length===3||a.length===4)&&(a=a.split("").map(u=>u+u).join("")),/^[0-9a-f]{6}([0-9a-f]{2})?$/.test(a)?{r:Number.parseInt(a.slice(0,2),16),g:Number.parseInt(a.slice(2,4),16),b:Number.parseInt(a.slice(4,6),16),a:a.length===8?Number.parseInt(a.slice(6,8),16)/255:1}:null}let r=/^rgba?\(([^)]*)\)$/.exec(e);if(r){let[a,u]=r[1].split("/"),l=a.split(/[\s,]+/).filter(Boolean);if(l.length!==(u===void 0&&l.length===4?4:3))return null;let o=u??l[3],[i,s,c]=l.slice(0,3).map(f=>Je(f,255)),m=o===void 0?1:Je(o,1);if([i,s,c,m].some(f=>Number.isNaN(f)))return null;let p=(f,d)=>Math.min(Math.max(f,0),d);return{r:p(i,255),g:p(s,255),b:p(c,255),a:p(m,1)}}return null}var Fr=["banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"];function nn(t){return Fr.includes(t)}var tn={from:"#7c3aed",to:"#db2777"},q="#FFFFFF";function rn(t){return t===" "?.3:/[MWmw@%]/.test(t)?.92:/[A-Z0-9#&]/.test(t)?.72:/[il.,:;!'|1]/.test(t)?.32:.6}function It(t){let e=0;for(let n of t)e+=rn(n);return Math.max(e,1)}var Re=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function j(t,e,n){let r=qt(t)??{r:0,g:0,b:0,a:1},a=qt(e)??{r:255,g:255,b:255,a:1},u=Math.min(1,Math.max(0,n));return`#${Re(r.r+(a.r-r.r)*u)}${Re(r.g+(a.g-r.g)*u)}${Re(r.b+(a.b-r.b)*u)}`}var V=(t,e,n,r,a=0)=>({x:t,y:e,width:n,height:r,radius:a}),w=(t,e,n,r,a,u)=>({type:"rect",...V(t,e,n,r,a),fill:u}),Ft=(t,e,n)=>({type:"rect",...t,fill:n,hole:e}),k=(t,e)=>({type:"polygon",points:t,fill:e}),mt=(t,e,n="nonzero")=>({type:"path",d:t,fill:e,fillRule:n}),on=(...t)=>t.filter(e=>e!==null),Ir=t=>{let{size:e,gap:n,border:r,band:a,color:u,background:l,frame:o,fitLabel:i}=t,s=e+2*(r+n),c=s-2*r,m=e+2*n,p=a+m+a,f=c-2*n,d=o.textColor||q;return{width:s,height:p,qrX:r+n,qrY:a+n,qrSize:e,shapes:[w(r,a,c,m,0,l),Ft(V(0,0,s,p),V(r,a,c,m),u)],label:i(t.text,s/2,a/2,a,f,d),extraLabels:on(i(t.secondaryText,s/2,a+m+a/2,a,f,d,"secondaryText")),squareEdges:!0,color:u}},wr=t=>{let{size:e,gap:n,border:r,band:a,color:u,background:l,frame:o,fitLabel:i}=t,s=e+2*(r+n),c=s-2*r,m=e*.07,p=Math.max(m-r,0),f=e*.025,d=e*.08,h=a+d+f;return{width:s,height:h+s,qrX:r+n,qrY:h+r+n,qrSize:e,shapes:[w(0,0,s,a,a/2,u),k([[s/2-d,a-d/2],[s/2+d,a-d/2],[s/2,a+d]],u),w(r,h+r,c,c,p,l),Ft(V(0,h,s,s,m),V(r,h+r,c,c,p),u)],label:i(t.text,s/2,a/2,a,c-2*n,o.textColor||q),squareEdges:!1,color:u}},vr=t=>{let{size:e,gap:n,border:r,color:a,background:u,frame:l,fitLabel:o}=t,i=e+2*(r+n),s=i-2*r,c=e*.12,m=e+2*n,p=t.text?e*.2:r,f=r+m+p,d=e*.13,h=f-e*.02;return{width:i,height:f+d,qrX:r+n,qrY:r+n,qrSize:e,shapes:[w(0,0,i,f,c,a),mt(O`M${i*.13} ${h}L${i*.05} ${f+d}`+O`Q${i*.16} ${f+d*.45} ${i*.32} ${h}Z`,a),w(r,r,s,m,Math.max(c-r,0),u)],label:o(t.text,i/2,r+m+p/2,p,s-2*n,l.textColor||q),squareEdges:!1,color:a}};function ie(t,e,n,r,a,u,l,o){let i=[...t],s=a*.08,c=i.map(h=>rn(h)*a),m=c.reduce((h,b)=>h+b,0)+s*Math.max(0,i.length-1),p=u==="top"?r-a*.35:r+a*.35,f=[],d=0;return i.forEach((h,b)=>{let g=c[b],y=(d+g/2)/p;if(d+=g+s,h.trim()==="")return;let S=u==="top"?-Math.PI/2-m/2/p+y:Math.PI/2+m/2/p-y;f.push({text:h,x:e+p*Math.cos(S),y:n+p*Math.sin(S),fontSize:a,maxWidth:a*2,color:l,rotate:S*180/Math.PI+(u==="top"?90:-90),field:o})}),f}var _r=t=>{let{size:e,gap:n,color:r,background:a,frame:u,fontScale:l}=t,o=e*Math.SQRT1_2+n*.9,i=e*.21,s=o+i,c=o+i/2,m=s,p=u.textColor||q,f=c*(140*Math.PI/180),d=y=>Math.min(i*.5*l,f/(It(y)+.08*y.length)),h=t.text?ie(t.text,m,m,c,d(t.text),"top",p,"text"):[],b=t.secondaryText?ie(t.secondaryText,m,m,c,d(t.secondaryText),"bottom",p,"secondaryText"):[],g=i*.07;return{width:2*s,height:2*s,qrX:m-e/2,qrY:m-e/2,qrSize:e,shapes:[mt($(m,m,o),a),mt($(m,m,s)+$(m,m,o),r,"evenodd"),mt($(m-c,m,g)+$(m+c,m,g),p)],label:null,extraLabels:[...h,...b],squareEdges:!1,color:r}},Tr=t=>{let{size:e,gap:n,color:r,background:a,frame:u,fitLabel:l}=t,o=e*.07,i=e+2*n,s=e*.3,c=e*.025,m=i+2*o,p=o+i+s,f=e*.015;return{width:m+c,height:p+c,qrX:o+n,qrY:o+n,qrSize:e,shapes:[w(c,c,m,p,f,j(r,q,.72)),w(0,0,m,p,f,r),w(o,o,i,i,0,a)],label:l(t.text,m/2,o+i+s/2,s*.8,i-2*n,u.textColor||q),squareEdges:!1,color:r}},Nr=t=>{let{size:e,gap:n,color:r,background:a,frame:u,fitLabel:l}=t,o=e*.05,i=e*.17,s=e*.15,c=t.text?e*.17:0,m=e+2*n,p=n+e+(t.text?n*.5+c:n),f=m+2*o,d=i+p+s,h=e*.036,b=e*.03;return{width:f,height:d,qrX:o+n,qrY:i+n,qrSize:e,shapes:[w(0,0,f,d,e*.17,r),w(o,i,m,p,e*.06,a),w(f/2-e*.11,i/2-h/2,e*.22,h,h/2,a),w(f/2-e*.15,i+p+s/2-b/2,e*.3,b,b/2,a)],label:l(t.text,f/2,i+n+e+n*.5+c/2,c,m-2*n,u.textColor||r),squareEdges:!1,color:r}},Or=t=>{let{size:e,gap:n,band:r,color:a,background:u,frame:l,fitLabel:o}=t,i=e*.05,s=e+2*n,c=s+2*i,m=Wt(i+s+i*1.2),p=m+r,f=Wt(e*.055),d=e*.04,h=O`M${d} 0H${c-d}A${d} ${d} 0 0 1 ${c} ${d}`+O`V${m-f}A${f} ${f} 0 0 0 ${c} ${m+f}`+O`V${p-d}A${d} ${d} 0 0 1 ${c-d} ${p}`+O`H${d}A${d} ${d} 0 0 1 0 ${p-d}`+O`V${m+f}A${f} ${f} 0 0 0 0 ${m-f}`+O`V${d}A${d} ${d} 0 0 1 ${d} 0Z`,b=[],g=e*.03,y=e*.022,S=e*.012;for(let E=f+y;E+g<=c-f-y/2;E+=g+y)b.push(A(E,m-S/2,g,S));return{width:c,height:p,qrX:i+n,qrY:i+n,qrSize:e,shapes:[mt(h,a),w(i,i,s,s,e*.02,u),mt(b.join(""),u)],label:o(t.text,c/2,m+r/2,r,s-2*n,l.textColor||q),squareEdges:!1,color:a}},qr=t=>{let{size:e,gap:n,border:r,band:a,color:u,background:l,frame:o,fitLabel:i}=t,s=e*.18,c=e*.05,m=e+2*(r+n),p=e*.06,f=Math.max(p-r,0),d=m+2*s,h=m-r,b=s*.5,g=h+c,y=b+c*2,S=s*.28,E=j(u,"#000000",.28),R=j(u,"#000000",.5);return{width:d,height:g+a,qrX:s+r+n,qrY:r+n,qrSize:e,shapes:[k([[0,g],[y,g],[y,g+a],[0,g+a],[S,g+a/2]],E),k([[d,g],[d-S,g+a/2],[d,g+a],[d-y,g+a],[d-y,g]],E),k([[b,h+a],[b+c*1.6,h+a+c],[b,h+a+c]],R),k([[d-b,h+a],[d-b,h+a+c],[d-b-c*1.6,h+a+c]],R),w(s+r,r,m-2*r,m-2*r,f,l),Ft(V(s,0,m,m,p),V(s+r,r,m-2*r,m-2*r,f),u),w(b,h,d-2*b,a,0,u)],label:i(t.text,d/2,h+a/2,a,d-2*b-2*n,o.textColor||q),squareEdges:!1,color:u}},zr=t=>{let{size:e,gap:n,band:r,color:a,background:u,frame:l,fitLabel:o}=t,i=e*.08,s=e+2*n,c=s+2*i,m=e*.05,p=m+n+e+n*.6,f=e*.14,d=p+f+r+e*.02,h=m+e*.32,b=e*.012,g=p+f-m;return{width:c,height:d,qrX:i+n,qrY:m+n,qrSize:e,shapes:[w(0,h,c,d-h,0,j(a,q,.45)),k([[0,h],[c/2,0],[c,h]],j(a,q,.25)),w(i,m,s,g,0,u),Ft(V(i-b,m-b,s+2*b,g+b),V(i,m,s,g),a),k([[0,p],[c/2,p+f],[c,p],[c,d],[0,d]],a)],label:o(t.text,c/2,p+f+r/2,r,s-2*n,l.textColor||q),squareEdges:!1,color:a}},kr=t=>{let{size:e,gap:n,band:r,color:a,background:u,frame:l,fitLabel:o}=t,i=e*.06,s=e+2*n,c=s+2*i,m=e*.24,p=e*.04,f=m*.48,d=e*.14,h=t.text?r:i,b=m+s+h,g=e*.04,y=O`M${d} 0H${c-d}L${c} ${d}`+O`V${b-g}A${g} ${g} 0 0 1 ${c-g} ${b}`+O`H${g}A${g} ${g} 0 0 1 0 ${b-g}V${d}Z`+$(c/2,f,p);return{width:c,height:b,qrX:i+n,qrY:m+n,qrSize:e,shapes:[mt(y,a,"evenodd"),mt($(c/2,f,p*1.7)+$(c/2,f,p),j(a,q,.35),"evenodd"),w(i,m,s,s,e*.02,u)],label:o(t.text,c/2,m+s+h/2,h,s-2*n,l.textColor||q),squareEdges:!1,color:a}},Dr=t=>{let{size:e,color:n,background:r,frame:a,fitLabel:u}=t,l=e*.13,o=t.text?e*.26:l,i=t.secondaryText?e*.2:l,s=e+2*l,c=o+e+i,m=e*.03,p=e*.022,f=e*.045,d=e*.008,h=a.textColor||n,b=[w(0,0,s,c,m,r),Ft(V(0,0,s,c,m),V(p,p,s-2*p,c-2*p,Math.max(m-p,0)),n),Ft(V(f,f,s-2*f,c-2*f),V(f+d,f+d,s-2*(f+d),c-2*(f+d)),n)];if(t.text){let g=o-e*.075,y=e*.022;b.push(w(s*.3,g-d/2,s*.4,d,0,n),k([[s/2,g-y],[s/2+y,g],[s/2,g+y],[s/2-y,g]],n))}return{width:s,height:c,qrX:l,qrY:o,qrSize:e,shapes:b,label:u(t.text,s/2,e*.115,e*.17,s-2*l,h),extraLabels:on(u(t.secondaryText,s/2,o+e+i*.45,i*.8,s-2*l,h,"secondaryText")),squareEdges:!1,color:n}},Br=t=>{let{size:e,gap:n,color:r,background:a,frame:u,fitLabel:l}=t,o=e*.025,i=e*.07,s=e*.03,c=e*.13,m=t.text?e*.17:0,p=n*1.25,f=e+2*p,d=f+2*i,h=f+2*i+m,b=d+2*o,g=h+2*o;return{width:b+s,height:g+s,qrX:o+i+p,qrY:o+i+p,qrSize:e,shapes:[w(s,s,b,g,c+o,j(r,q,.7)),w(0,0,b,g,c+o,q),w(o,o,d,h,c,r),w(o+i,o+i,f,f,e*.04,a)],label:l(t.text,o+d/2,o+i+f+(i+m)/2,i+m,f-2*n,u.textColor||q),squareEdges:!1,color:r}};function en(t,e,n,r){let a=t<e+r?e+r-t:t>e+n-r?t-(e+n-r):0;return r-Math.sqrt(Math.max(0,r*r-Math.min(a,r)**2))}function Gr(t,e,n,r,a,u,l=48){let o=Math.max(n-r,0),i=t-2*r,s=new Set([r,t-r]);for(let b=0;b<=l;b++)s.add(t*b/l);let c=[...s].sort((b,g)=>b-g),m=t*.002,p=5,f=b=>en(b,0,t,n),d=b=>r+en(b,r,i,o),h=[];for(let b=0;b+1<c.length;b++){let g=c[b],y=Math.min(t,c[b+1]+(b+2<c.length?m:0)),S=j(a,u,(g+y)/2/t),E=M=>Array.from({length:p},(P,_)=>{let I=_/(p-1);return M?y+(g-y)*I:g+(y-g)*I});g>=r-1e-9&&c[b+1]<=t-r+1e-9?h.push(k([...E(!1).map(M=>[M,f(M)]),...E(!0).map(M=>[M,d(M)])],S),k([...E(!1).map(M=>[M,e-d(M)]),...E(!0).map(M=>[M,e-f(M)])],S)):h.push(k([...E(!1).map(M=>[M,f(M)]),...E(!0).map(M=>[M,e-f(M)])],S))}return h}var Qr=t=>{let{size:e,gap:n,background:r,frame:a,fitLabel:u}=t,l=a.color||tn.from,o=a.secondaryColor||tn.to,i=e*.05,s=e+2*(i+n),c=t.text?e*.18:0,m=e+(t.text?n+c:2*n),p=m+2*i,f=e*.1;return{width:s,height:p,qrX:i+n,qrY:i+n,qrSize:e,shapes:[w(i,i,s-2*i,m,f-i,r),...Gr(s,p,f,i,l,o)],label:u(t.text,s/2,i+n+e+c/2,c,s-2*i-2*n,a.textColor||j(l,o,.5)),squareEdges:!1,color:l}},Ur=t=>{let{size:e,gap:n,color:r,background:a,frame:u,fitLabel:l}=t,o=e*.035,i=e*.2,s=e+2*(n+o),c=t.text?e*.2:0,m=s,p=m+c,f=(d,h,b,g)=>[[d,h],[d+b*i,h],[d+b*i,h+g*o],[d+b*o,h+g*o],[d+b*o,h+g*i],[d,h+g*i]];return{width:s,height:p,qrX:o+n,qrY:o+n,qrSize:e,shapes:[w(0,0,s,p,0,a),k(f(0,0,1,1),r),k(f(m,0,-1,1),r),k(f(m,m,-1,-1),r),k(f(0,m,1,-1),r)],label:l(t.text,s/2,m+c*.4,c,s-2*n,u.textColor||r),squareEdges:!1,color:r}},an={"banner-top-bottom":Ir,"speech-bubble-top":wr,"chat-bubble":vr,circle:_r,polaroid:Tr,phone:Nr,ticket:Or,badge:qr,envelope:zr,tag:kr,"menu-card":Dr,sticker:Br,"gradient-border":Qr,focus:Ur};function yt(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 ae=class extends Error{issues;constructor(e){super(`Invalid frame spec: ${e.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=e}},sn=new WeakMap;function Yr(t){if(t&&typeof t=="object"){let n=sn.get(t);if(n)return n}if(t==null)throw new ae(['A "custom" frame needs a spec']);let e=Me.safeParse(t);if(!e.success)throw new ae(e.error.issues.map(n=>n.path.length>0?`${n.path.join(".")}: ${n.message}`:n.message));return typeof t=="object"&&sn.set(t,e.data),e.data}function Hr(t){let e=yt(t,tt),n=qt(e);return n&&n.a>=1?e:tt}function Vr(t,e,n){let r=t.color||e.colors.frame,a=t.textColor||e.colors.text||r,u=t.secondaryColor||e.colors.accent||r,l=o=>{switch(o){case"frame":return r;case"text":return a;case"accent":return u;case"background":return n;default:return o}};return o=>typeof o=="string"?l(o):j(l(o.mix[0]),l(o.mix[1]),o.amount)}function cn(t,e,n=0,r=0){let a=Zt(t);return a?ke(a,e,n,r):""}function Xr(t,e,n,r){return`M${x(t-n)} ${x(e)}A${x(n)} ${x(r)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(r)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function jr(t,e){let[n,r,a,u]=[t.x1*e,t.y1*e,t.x2*e,t.y2*e],l=Math.hypot(a-n,u-r),o=t.width*e/2,i=l>0?(a-n)/l:1,s=l>0?(u-r)/l:0,c=-s*o,m=i*o,p=(b,g)=>{let y=[n+i*b,r+s*b],S=[n+i*g,r+s*g];if(t.cap==="round"&&g-b>2*o){let E=[y[0]+i*o,y[1]+s*o],R=[S[0]-i*o,S[1]-s*o];return`M${x(E[0]-c)} ${x(E[1]-m)}L${x(R[0]-c)} ${x(R[1]-m)}A${x(o)} ${x(o)} 0 0 1 ${x(R[0]+c)} ${x(R[1]+m)}L${x(E[0]+c)} ${x(E[1]+m)}A${x(o)} ${x(o)} 0 0 1 ${x(E[0]-c)} ${x(E[1]-m)}Z`}return`M${x(y[0]-c)} ${x(y[1]-m)}L${x(S[0]-c)} ${x(S[1]-m)}L${x(S[0]+c)} ${x(S[1]+m)}L${x(y[0]+c)} ${x(y[1]+m)}Z`};if(!t.dash)return{type:"path",d:p(0,l),fillRule:"nonzero"};let f=t.dash[0]*e,d=f+t.dash[1]*e,h=[];for(let b=0;b+f<=l+1e-6;b+=d)h.push(p(b,b+f));return{type:"path",d:h.join(""),fillRule:"nonzero"}}function Wr(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:$(t.cx*e,t.cy*e,t.r*e)+(t.hole?$(t.cx*e,t.cy*e,t.hole*e):""),fillRule:t.hole?"evenodd":"nonzero"};case"ellipse":return{type:"path",d:Xr(t.cx*e,t.cy*e,t.rx*e,t.ry*e),fillRule:"nonzero"};case"polygon":return{type:"polygon",points:t.points.map(([n,r])=>[n*e,r*e])};case"path":return{type:"path",d:cn(t.d,e),fillRule:t.fillRule??"nonzero"};case"line":return jr(t,e);default:{let n=Ke(t.icon);return{type:"path",d:cn(n.d,t.size*e/We,t.x*e,t.y*e),fillRule:n.fillRule}}}}function Zr(t){if(t.type==="rect"){let{x:e,y:n,width:r,height:a,radius:u,hole:l}=t;return[...he(e,n,r,a,u,u),...l?he(l.x,l.y,l.width,l.height,l.radius,l.radius):[]]}return t.type==="polygon"?[...t.points.map(([e,n],r)=>r===0?{op:"M",x:e,y:n}:{op:"L",x:e,y:n}),{op:"Z"}]:Kt(t.d)}function Kr(t,e,n){let r=Zr(t),a=Be(r,.2),u=t.type==="rect"?t.hole?"evenodd":"nonzero":t.type==="path"?t.fillRule??"nonzero":"nonzero",l=e.direction==="vertical",o=b=>l?b[1]:b[0],i=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(let b of a)for(let g of b)i=Math.min(i,o(g)),s=Math.max(s,o(g));if(!(s>i))return[];let c=e.steps??32,m=n(e.from),p=n(e.to),f=s-i,d=f*.002,h=[];for(let b=0;b<c;b++){let g=i+f*b/c,y=Math.min(s,i+f*(b+1)/c+(b+1<c?d:0)),S=l?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:g,y1:y}:{x0:g,x1:y,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},E=a.map(R=>Ge(R,S)).filter(R=>R.length>2);E.length!==0&&h.push({type:"path",d:Qe(E),fill:j(m,p,(b+.5)/c),fillRule:u})}return h}function Jr(t,e,n){let r=Wr(t,e);return typeof t.fill=="object"&&"gradient"in t.fill?Kr(r,t.fill.gradient,n):[{...r,fill:n(t.fill)}]}function to(t,e){let n=Math.min(t.maxLength??N.maxTextLength,N.maxTextLength),r=t.slot==="primary"?e.text??t.text:t.slot==="secondary"?e.secondaryText??t.text:t.text;return Se(r,n)}function eo(t){return t===void 0||!Number.isFinite(t)?1:Math.min(gt,Math.max(Tt,t))}function no(t,e,n,r){let a=to(t,e);if(!a)return[];let u=eo(e.fontScale),l=r(t.color),o=t.weight==="regular"?{fontWeight:400}:{};if(t.type==="curved"){let{cx:h,cy:b,radius:g,side:y,spread:S=140}=t.curve,E=g*n*(S*Math.PI/180),R=Math.min(t.fontSize*n*u,E/(It(a)+.08*a.length));return ie(a,h*n,b*n,g*n,R,y,l,t.id).map(M=>({...M,...o}))}let i=t.box.x*n,s=t.box.y*n,c=t.box.width*n,m=t.box.height*n,p=(t.fontSize??t.box.height*.52)*n,f=Math.min(p*u,m*xe,c/It(a)),d=t.align??"middle";return[{text:a,x:d==="start"?i:d==="end"?i+c:i+c/2,y:s+m/2+f*.35,fontSize:f,maxWidth:c,color:l,...d!=="middle"&&{align:d},...o,field:t.id}]}function ln(t,e,n){let r=Yr(e.spec),a=t/r.qr.size,u=Hr(n),l=Vr(e,r,u),o=r.shapes.flatMap(f=>Jr(f,a,l)),i=ee(r)*a;o.push({type:"rect",x:r.qr.x*a-i,y:r.qr.y*a-i,width:t+2*i,height:t+2*i,radius:(r.qr.radius??0)*a,fill:u});let s=r.labels.flatMap(f=>no(f,e,a,l)),c=s[0],m=c&&c.rotate===void 0?c:null,p=r.bleed??"none";return{width:r.artboard.width*a,height:r.artboard.height*a,qrX:r.qr.x*a,qrY:r.qr.y*a,qrSize:t,shapes:o,label:m,extraLabels:m?s.slice(1):s,squareEdges:p!=="none",color:l(p==="none"?"frame":p)}}var ro="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",oo=.08,io="#000000",Pe="#FFFFFF";function pn(t){return!!(t?.style&&t.style!=="none")}function ao(t){return(t.text??qe).trim().slice(0,et)}function so(t){return(t.secondaryText??"").trim().slice(0,et)}function co(t){return t===void 0||!Number.isFinite(t)?1:Math.min(gt,Math.max(Tt,t))}function lo(t,e,n,r,a,u,l,o){if(!t)return null;let i=Math.min(r*.52*l,a/It(t));return{text:t,x:e,y:n+i*.35,fontSize:i,maxWidth:a,color:u,field:o}}function fn(t,e,n){if(e.style===ye)return ln(t,e,n);let r=e.color||io,a=yt(n,tt),u=ao(e),l=t*oo,o=t*.04,i=t*.22,s=t+2*(o+l),c=s-2*o,m=c-2*l,p=o+l,f=co(e.fontScale),d=(h,b,g,y,S,E,R="text")=>lo(h,b,g,y,S,E,f,R);if(nn(e.style))return an[e.style]({size:t,frame:e,color:r,background:a,text:u,secondaryText:so(e),gap:l,border:o,band:i,fontScale:f,fitLabel:d});switch(e.style){case"banner-top":{let h=t+2*l;return{width:s,height:i+h+o,qrX:p,qrY:i+l,qrSize:t,shapes:[zt(o,i,c,h,0,a),se(rt(0,0,s,i+h+o,0),rt(o,i,c,h,0),r)],label:d(u,s/2,i/2,i,m,e.textColor||Pe),squareEdges:!0,color:r}}case"border":case"rounded-border":{let h=u?t*.18:0,b=t+(u?l+h:2*l),g=b+2*o,y=e.style==="rounded-border"?t*.1:0,S=Math.max(y-o,0);return{width:s,height:g,qrX:p,qrY:o+l,qrSize:t,shapes:[zt(o,o,c,b,S,a),se(rt(0,0,s,g,y),rt(o,o,c,b,S),r)],label:d(u,s/2,o+l+t+h/2,h,m,e.textColor||r),squareEdges:y===0,color:r}}case"speech-bubble":{let h=t*.07,b=Math.max(h-o,0),g=t*.025,y=t*.08,S=s+g+y;return{width:s,height:S+i,qrX:p,qrY:o+l,qrSize:t,shapes:[zt(o,o,c,c,b,a),se(rt(0,0,s,s,h),rt(o,o,c,c,b),r),{type:"polygon",points:[[s/2-y,S+y/2],[s/2,s+g],[s/2+y,S+y/2]],fill:r},zt(0,S,s,i,i/2,r)],label:d(u,s/2,S+i/2,i,m,e.textColor||Pe),squareEdges:!1,color:r}}default:{let h=t+2*l;return{width:s,height:o+h+i,qrX:p,qrY:o+l,qrSize:t,shapes:[zt(o,o,c,h,0,a),se(rt(0,0,s,o+h+i,0),rt(o,o,c,h,0),r)],label:d(u,s/2,o+h+i/2,i,m,e.textColor||Pe),squareEdges:!0,color:r}}}}function rt(t,e,n,r,a){return{x:t,y:e,width:n,height:r,radius:a}}function zt(t,e,n,r,a,u){return{type:"rect",...rt(t,e,n,r,a),fill:u}}function se(t,e,n){return{type:"rect",...t,fill:n,hole:e}}function uo(t){return[...t.label?[t.label]:[],...t.extraLabels??[]]}function dn(t,e){let n=({x:r,y:a,width:u,height:l,radius:o})=>{let i=Math.min(o,u/2,l/2);t.moveTo(r+i,a),t.arcTo(r+u,a,r+u,a+l,i),t.arcTo(r+u,a+l,r,a+l,i),t.arcTo(r,a+l,r,a,i),t.arcTo(r,a,r+u,a,i),t.closePath()};for(let r of e.shapes)if(!(r.fill==="transparent"||r.fill==="none")){if(t.fillStyle=r.fill,r.type==="path"){typeof Path2D<"u"&&t.fill(new Path2D(r.d),r.fillRule??"nonzero");continue}t.beginPath(),r.type==="polygon"?(r.points.forEach(([a,u],l)=>{l===0?t.moveTo(a,u):t.lineTo(a,u)}),t.closePath(),t.fill()):(n(r),r.hole&&n(r.hole),t.fill("evenodd"))}for(let r of uo(e))t.fillStyle=r.color,t.font=`${r.fontWeight??700} ${r.fontSize}px ${ro}`,t.textAlign=r.align==="start"?"left":r.align==="end"?"right":"center",t.textBaseline="alphabetic",r.rotate?(t.save(),t.translate(r.x,r.y),t.rotate(r.rotate*Math.PI/180),t.fillText(r.text,0,0,r.maxWidth),t.restore()):t.fillText(r.text,r.x,r.y,r.maxWidth)}var mo=.22,po=.14;function fo(t,e){let n=t.w*e,r=t.h*e;return{x:t.x+n,y:t.y+r,w:t.w-2*n,h:t.h-2*r}}function Le(t,e,n){if(t.beginPath(),e==="circle"){t.arc(n.x+n.w/2,n.y+n.h/2,Math.min(n.w,n.h)/2,0,Math.PI*2);return}let r=e==="rounded"?Math.min(n.w,n.h)*mo:0;r>0&&typeof t.roundRect=="function"?t.roundRect(n.x,n.y,n.w,n.h,r):t.rect(n.x,n.y,n.w,n.h)}function hn(t,e){return e?fo(t,po):t}var{QrCode:Ae}=H,ho={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function go(t){let e=t*4+17,n=new Uint8Array(e*e),r=(l,o)=>{l>=0&&o>=0&&l<e&&o<e&&(n[o*e+l]=1)};for(let l=0;l<e;l++)r(6,l),r(l,6);for(let[l,o]of[[3,3],[e-4,3],[3,e-4]])for(let i=-4;i<=4;i++)for(let s=-4;s<=4;s++)r(l+s,o+i);let a=[];if(t>1){let l=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(l*2-2))*2;a.push(6);for(let i=e-7;a.length<l;i-=o)a.splice(1,0,i)}let u=a.length-1;for(let[l,o]of a.entries())for(let[i,s]of a.entries())if(!(l===0&&i===0||l===0&&i===u||l===u&&i===0))for(let c=-2;c<=2;c++)for(let m=-2;m<=2;m++)r(o+m,s+c);for(let l=0;l<=8;l++)r(8,l),r(l,8);for(let l=0;l<8;l++)r(e-1-l,8),r(8,e-1-l);if(t>=7)for(let l=0;l<18;l++){let o=e-11+l%3,i=Math.floor(l/3);r(o,i),r(i,o)}return n}function bo(t,e){let n=t*4+17,r=ct[e].ordinal,a=Ae.NUM_ERROR_CORRECTION_BLOCKS[r]?.[t]??0,u=Ae.ECC_CODEWORDS_PER_BLOCK[r]?.[t]??0,l=Math.floor(Ae.getNumRawDataModules(t)/8),o=a-l%a,i=Math.floor(l/a),s=Array.from({length:a},(E,R)=>i+(R<o?0:1)),c=[],m=[],p=i-u;for(let E=0;E<=i;E++)for(let R=0;R<a;R++)if(R<o){if(E===p)continue;c.push(R),m.push(E<p?E:E-1)}else c.push(R),m.push(E);if(c.length!==l)throw new Error(`Codeword map: interleave mismatch at version ${t}`);let f=go(t),d=new Int16Array(n*n).fill(-1),h=new Int16Array(n*n).fill(-1),b=new Int8Array(n*n).fill(-1),g=l*8,y=0;for(let E=n-1;E>=1;E-=2){E===6&&(E=5);let R=(E+1&2)===0;for(let M=0;M<n;M++)for(let P=0;P<2;P++){let _=E-P,G=(R?n-1-M:M)*n+_;if(!f[G]&&y<g){let Q=y>>>3;d[G]=c[Q],h[G]=m[Q],b[G]=7-(y&7),y++}}}if(y!==g)throw new Error(`Codeword map: placement mismatch at version ${t}`);let S=ho[`${t}${e}`]??0;return{version:t,level:e,size:n,blocks:a,eccPerBlock:u,blockLengths:s,correctable:Math.floor((u-S)/2),block:d,codeword:h,bit:b}}var yo=8,xt=new Map;function gn(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}`,r=xt.get(n);if(r)return xt.delete(n),xt.set(n,r),r;let a=bo(t,e);if(xt.size>=yo){let u=xt.keys().next().value;u!==void 0&&xt.delete(u)}return xt.set(n,a),a}function bn(t,e){let n=new Array(t.blocks).fill(0),r=new Set;for(let a of e){let u=t.block[a]??-1;if(u<0)continue;let l=u*4096+t.codeword[a];r.has(l)||(r.add(l),n[u]=n[u]+1)}return n}import{z as L}from"zod";import{z as ot}from"zod";var xo=["logo","halftone"],So=ot.enum(xo),yn={logo:["blend","badge"],halftone:["color","mono"]},Eo=ot.enum([...yn.logo,...yn.halftone]),ce=192,xn=t=>Math.ceil(t/3)*4,Mo=ot.object({width:ot.number().int().min(1).max(ce),height:ot.number().int().min(1).max(ce),data:ot.string().max(xn(ce*ce*4))}).refine(t=>t.data.length===xn(t.width*t.height*4),{message:"Art image data does not match its width and height"}),Sn=ot.object({mode:So,image:Mo,intensity:ot.number().min(0).max(1).optional(),variant:Eo.optional(),matchEyes:ot.boolean().optional()});import{z as F}from"zod";var Ma=F.enum(["solid","linear","radial","angular","image"]),Co=F.object({type:F.literal("solid"),color:F.string()}),$e=F.object({color:F.string(),offset:F.number().min(0).max(100)}),Ro=F.object({type:F.literal("linear"),stops:F.array($e).min(2),angle:F.number().optional().default(0)}),Po=F.object({type:F.literal("radial"),stops:F.array($e).min(2)}),Lo=F.object({type:F.literal("angular"),stops:F.array($e).min(2),angle:F.number().optional().default(0)}),Ao=F.enum(["cover","contain","tile"]),$o=F.enum(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]),Fo=F.object({type:F.literal("image"),src:F.string().min(1),fit:Ao.optional().default("cover"),scale:F.number().min(.1).max(4).optional().default(1),position:$o.optional().default("center"),opacity:F.number().min(0).max(1).optional().default(1),underlay:F.string().optional()}),St=F.union([F.string(),Co,Ro,Po,Lo,Fo]);import{z as En}from"zod";var Mn=["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"],Io=["diamond","star","banner"],Cn=En.enum([...Mn,...Io]),Pa=En.enum(Mn);import{z as Rn}from"zod";var Pn=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],wo=["curly"],Ln=Rn.enum([...Pn,...wo]),$a=Rn.enum(Pn);import{z as vo}from"zod";var _o=["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"],An=vo.enum(_o);var To=["square","rounded","circle"],$n=L.enum(To),No=L.object({src:L.string(),height:L.number(),width:L.number(),excavate:L.boolean(),x:L.number().optional(),y:L.number().optional(),padding:L.number().min(0).optional(),shape:$n.optional(),plate:L.string().optional()}),Oo=.1,qo=.3;var zo=2,ka=L.object({size:L.number().min(Oo).max(qo).optional(),padding:L.number().min(0).max(zo).optional(),x:L.number().min(0).max(1).optional(),y:L.number().min(0).max(1).optional(),shape:$n.optional(),plate:L.string().optional()}),ko=L.enum(["L","M","Q","H"]),Do=.5,Bo=1,Fn=.07,Go=["square","circle","heart"],Qo=L.enum(Go),In=3,Et=64,kt=8,wn=.42,Uo=L.object({type:L.literal("silhouette"),width:L.number().int().min(kt).max(Et),height:L.number().int().min(kt).max(Et),cells:L.string().max(Et*Et).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"}),Yo=L.union([Qo,Uo]);var Fe=L.object({outer:St.optional(),inner:St.optional()}),Ho=L.object({topLeft:Fe.optional(),topRight:Fe.optional(),bottomLeft:Fe.optional()}),Da=L.object({value:L.string(),size:L.number().optional(),level:ko.optional(),bgColor:St.optional(),fgColor:St.optional(),eyeColor:St.optional(),dotColor:St.optional(),bodyPattern:An.optional(),cornerEyePattern:Ln.optional(),cornerEyeDotPattern:Cn.optional(),margin:L.number().optional(),imageSettings:No.optional(),isOGContext:L.boolean().optional(),templateId:L.string().optional(),customProps:L.record(L.string(),L.any()).optional(),frame:Xe.optional(),art:Sn.optional(),eyeColors:Ho.optional(),moduleScale:L.number().min(Do).max(Bo).optional(),autoLevel:L.boolean().optional(),shape:Yo.optional()});var Vo={2:6,3:12};function vn(t){let e=[t.start],n=t.start;for(let r of t.segments){let a=r.at(-1);if(r.length===1)e.push(a);else{let u=Vo[r.length];for(let l=1;l<=u;l++){let o=l/u,i=1-o;if(r.length===2){let[s]=r;e.push([i*i*n[0]+2*i*o*s[0]+o*o*a[0],i*i*n[1]+2*i*o*s[1]+o*o*a[1]])}else{let[s,c]=r;e.push([i*i*i*n[0]+3*i*i*o*s[0]+3*i*o*o*c[0]+o*o*o*a[0],i*i*i*n[1]+3*i*i*o*s[1]+3*i*o*o*c[1]+o*o*o*a[1]])}}}n=a}return e}function Tn(t,e){let n=[];for(let r of t)for(let a=0;a<r.length;a++){let[u,l]=r[a],[o,i]=r[(a+1)%r.length];l<=e!=i<=e&&n.push(u+(e-l)/(i-l)*(o-u))}return n.sort((r,a)=>r-a)}function Nn(t,e){let n=0;for(let r of t)if(r<e)n++;else break;return n%2===1}function Xo(t,e,n){return Nn(Tn(t,n),e)}function On(t){let e=new Map;return(n,r)=>{let a=e.get(r);return a||(a=Tn(t,r),e.set(r,a)),Nn(a,n)}}function jo(t,e,n,r){let a=n[0]-t,u=n[1]-e,l=r[0]-n[0],o=r[1]-n[1],i=c=>Math.max(Math.abs(a+c*l),Math.abs(u+c*o)),s=Math.min(i(0),i(1));for(let[c,m]of[[u-a,l-o],[-(a+u),l+o]])if(m!==0){let p=c/m;p>0&&p<1&&(s=Math.min(s,i(p)))}return s}function Wo(t,e,n){if(!Xo(t,e,n))return 0;let r=Number.POSITIVE_INFINITY;for(let a of t)for(let u=0;u<a.length;u++)r=Math.min(r,jo(e,n,a[u],a[(u+1)%a.length]));return Number.isFinite(r)?r:0}function Zo(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let u of t)for(let[l,o]of u)e=Math.min(e,l),n=Math.min(n,o),r=Math.max(r,l),a=Math.max(a,o);return{x0:e,y0:n,x1:r,y1:a}}function qn(t){let e=t.map(vn),n=Zo(e),r=n.x1-n.x0,a=n.y1-n.y0;if(!(r>0&&a>0))return null;let u=(d,h)=>{let b=Math.max(d-n.x0,n.x1-d,h-n.y0,n.y1-h);return b>0?Wo(e,d,h)/(2*b):0},l={cx:n.x0+r/2,cy:n.y0+a/2,value:0};l.value=u(l.cx,l.cy);let o=32;for(let d=1;d<o;d++)for(let h=1;h<o;h++){let b=n.x0+r*h/o,g=n.y0+a*d/o,y=u(b,g);y>l.value&&(l={cx:b,cy:g,value:y})}let i=r/o,s=a/o;for(let d=0;d<6;d++){let h=l;for(let b=-2;b<=2;b++)for(let g=-2;g<=2;g++){let y=h.cx+i*g/2,S=h.cy+s*b/2,E=u(y,S);E>l.value&&(l={cx:y,cy:S,value:E})}i/=2,s/=2}if(l.value<=0)return null;let m=.5/Math.max(l.cx-n.x0,n.x1-l.cx,l.cy-n.y0,n.y1-l.cy),p=([d,h])=>[.5+(d-l.cx)*m,.5+(h-l.cy)*m],f=t.map(d=>({start:p(d.start),segments:d.segments.map(h=>h.map(p))}));return{rings:f,polygons:f.map(vn),half:l.value}}function zn(t,e){let n=([a,u])=>`${x(a*e)} ${x(u*e)}`,r="";for(let a of t.rings){r+=`M${n(a.start)}`;for(let u of a.segments){let l=u.length===1?"L":u.length===2?"Q":"C";r+=l+u.map(n).join(" ")}r+="Z"}return r}var Ko={start:[0,-.58],segments:[[[.2,-.92],[1,-.97],[1,-.3]],[[1,.3],[.62,.6],[0,.92]],[[-.62,.6],[-1,.3],[-1,-.3]],[[-1,-.97],[-.2,-.92],[0,-.58]]]},_n;function kn(){return _n??=qn([Ko]),_n}function Jo(t){let{width:e,height:n,cells:r}=t;return Number.isInteger(e)&&Number.isInteger(n)&&e>=kt&&n>=kt&&e<=Et&&n<=Et&&typeof r=="string"&&r.length===e*n&&/^[01]*$/.test(r)?(a,u)=>a>=0&&u>=0&&a<e&&u<n&&r[u*e+a]==="1":null}var it=([t,e])=>`${t},${e}`;function ti(t,e,n){let r=(i,s)=>t(i-1,s-1),a=new Map,u=(i,s)=>{for(let[c,m]of[[i,s],[s,i]]){let p=a.get(it(c))??[];p.push(m),a.set(it(c),p)}};for(let i=0;i<=n;i++)for(let s=0;s<=e;s++){let c=r(s,i),m=r(s+1,i),p=r(s+1,i+1),f=r(s,i+1),d=[s,i-.5],h=[s+.5,i],b=[s,i+.5],g=[s-.5,i];switch((c?8:0)+(m?4:0)+(p?2:0)+(f?1:0)){case 1:case 14:u(g,b);break;case 2:case 13:u(b,h);break;case 3:case 12:u(g,h);break;case 4:case 11:u(d,h);break;case 6:case 9:u(d,b);break;case 7:case 8:u(g,d);break;case 5:u(d,h),u(g,b);break;case 10:u(g,d),u(b,h);break;default:break}}let l=[],o=new Set;for(let[i,s]of a){if(o.has(i)||s.length===0)continue;let[c,m]=i.split(",").map(Number),p=[[c,m]];o.add(i);let f=[c,m],d=s[0];for(;!o.has(it(d));){o.add(it(d)),p.push(d);let h=ei(a.get(it(d))??[],f,o);if(!h)break;f=d,d=h}p.length>=3&&l.push(ni(p))}return l}function ei(t,e,n){let r=it(e);return t.find(a=>it(a)!==r&&!n.has(it(a)))??t.find(a=>it(a)!==r)}function ni(t){let e=[];for(let n=0;n<t.length;n++){let r=t[(n-1+t.length)%t.length],a=t[n],u=t[(n+1)%t.length],l=(a[0]-r[0])*(u[1]-a[1])-(a[1]-r[1])*(u[0]-a[0]);Math.abs(l)>1e-9&&e.push(a)}return e.length>=3?e:t}function ri(t){let e=(u,l)=>[(u[0]+l[0])/2,(u[1]+l[1])/2],n=t.length,r=e(t[n-1],t[0]),a=t.map((u,l)=>[u,e(u,t[(l+1)%n])]);return{start:r,segments:a}}var Dt=new Map;function Dn(t){let e=`${t.width}x${t.height}:${t.cells}`,n=Dt.get(e);if(n)return n;let r=Jo(t),a;if(!r)a={outline:null,problem:"invalid"};else if(t.cells.includes("1")){let u=ti(r,t.width,t.height),l=u.length>0?qn(u.map(ri)):null;a=l&&2*l.half>=wn?{outline:l,problem:null}:{outline:null,problem:l?"thin":"empty"}}else a={outline:null,problem:"empty"};return Dt.size>16&&Dt.delete(Dt.keys().next().value),Dt.set(e,a),a}var oi=1,Bn=.5,Gn=.5,ii=.5;function le(t){return Math.max(t,In)}function Ie(t){return t==="heart"?kn():typeof t=="object"&&t?.type==="silhouette"?Dn(t).outline:null}function pt(t,e,n){if(n==="circle"){let l=le(e),o=(t/2+l)*Math.SQRT2+oi;return Math.ceil(o-t/2)}let r=Ie(n);if(!r)return e;let a=le(e),u=(t+2*(a+ii))/(2*r.half);return Math.ceil((u-t)/2-1e-9)}function Qn(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 ai(t,e,n){let r=pt(e,n,"circle"),a=le(n),u=e+2*r,l=u/2,o=l-Bn-.5,i=Qn(Number.parseInt(Ce(t),36)||1),s=r-a,c=r+e+a;return Array.from({length:u},(m,p)=>Array.from({length:u},(f,d)=>{let h=i()<Gn;return d>=s&&d<c&&p>=s&&p<c?!1:h&&Math.hypot(d+.5-l,p+.5-l)<=o}))}var si=Array.from({length:8},(t,e)=>{let n=e*Math.PI/4;return[Math.cos(n),Math.sin(n)]});function we(t,e,n,r){if(r==="circle")return ai(t,e,n);let a=Ie(r);if(!a)return null;let u=pt(e,n,r),l=le(n),o=e+2*u,i=On(a.polygons),s=.5+Bn,c=(d,h)=>{let b=d+.5,g=h+.5;return i(b/o,g/o)?si.every(([y,S])=>i((b+y*s)/o,(g+S*s)/o)):!1},m=Qn(Number.parseInt(Ce(t),36)||1),p=u-l,f=u+e+l;return Array.from({length:o},(d,h)=>Array.from({length:o},(b,g)=>{let y=m()<Gn;return g>=p&&g<f&&h>=p&&h<f?!1:y&&c(g,h)}))}function ve(t,e){if(t==="circle")return{circle:e/2};let n=Ie(t);return n?{path:zn(n,e)}:null}function Un(t,e){return t.slice().map((n,r)=>r<e.y||r>=e.y+e.h?n:n.map((a,u)=>u<e.x||u>=e.x+e.w?a:!1))}function _e(t,e=0){let n=[];return t.forEach((r,a)=>{let u=null;r.forEach((l,o)=>{if(!l&&u!==null){n.push(O`M${u+e} ${a+e}h${o-u}v1H${u+e}z`),u=null;return}if(o===r.length-1){if(!l)return;u===null?n.push(O`M${o+e},${a+e} h1v1H${o+e}z`):n.push(O`M${u+e},${a+e} h${o+1-u}v1H${u+e}z`);return}l&&u===null&&(u=o)})}),n.join("")}function Bt(t,e,n,r){if(r==null)return null;let a=t.length,u=Math.floor(e*jt),l=(a+2*n)/e,o=(r.width||u)*l,i=(r.height||u)*l,s=r.x==null?a/2-o/2:r.x*l,c=r.y==null?a/2-i/2:r.y*l,m=null;if(r.excavate){let p=Math.max(0,r.padding??0)*l,f=Math.floor(s-p),d=Math.floor(c-p),h=Math.ceil(o+s+p-f),b=Math.ceil(i+c+p-d);m={x:f,y:d,w:h,h:b}}return{x:s,y:c,h:i,w:o,excavation:m}}function ue(t){let e=t.level??At,{imageSettings:n}=t,r=t.isOGContext&&n?.excavate&&(e==="L"||e==="M")?"Q":e;if(t.autoLevel&&n&&r!=="H"){let a=H.QrCode.encodeText(t.value,ct[r]).getModules(),u=Bt(a,t.size??Ht,pt(a.length,t.margin??Xt,t.shape),n);u&&(u.excavation?u.excavation.w*u.excavation.h:u.w*u.h)/(a.length*a.length)>Fn&&(r="H")}return r}var Te=(()=>{try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})();var ci=.6,li=["L","M","Q","H"];function ui(t){let e=H.QrCode.encodeText(t.value,ct[t.level]),n=li[e.errorCorrectionLevel.ordinal]??t.level;return{code:t,cells:e.getModules(),layoutMargin:pt(e.size,t.margin,t.shape),map:gn(e.version,n),level:n,version:e.version}}function mi(t,e){let{cells:n,map:r}=t,a=n.length,u=Bt(n,t.code.size,t.layoutMargin,e);if(!u)return null;let l=u.excavation??{x:Math.floor(u.x),y:Math.floor(u.y),w:Math.ceil(u.x+u.w)-Math.floor(u.x),h:Math.ceil(u.y+u.h)-Math.floor(u.y)},o=[];for(let s=Math.max(0,l.y);s<Math.min(a,l.y+l.h);s++)for(let c=Math.max(0,l.x);c<Math.min(a,l.x+l.w);c++)o.push(s*a+c);let i=bn(r,o);return{worst:Math.max(0,...i),correctable:r.correctable,budget:Math.floor(r.correctable*ci),level:t.level,version:t.version}}var pi=t=>!t||t.worst<=t.budget;function fi(t,e,n,r){let a=e.map(o=>ui({...t,level:o})),u=o=>{let i=r(o);return a.every(s=>pi(mi(s,i)))};if(u(n))return n;let l=t.size*.005;for(let o=n-l;o>0;o-=l)if(u(o))return o;return 0}function Yn(t,e){if(!e)return;let n=Math.floor(t.size*jt),r=e.width||n,a=e.height||n,u=p=>{if(p===r)return e;let f=a*p/r;return{...e,width:p,height:f,...e.x!=null&&{x:e.x+(r-p)/2},...e.y!=null&&{y:e.y+(a-f)/2}}},l=t.level??At,o={value:t.value,size:t.size,margin:t.margin,shape:t.shape},i=p=>ue({...t,level:l,imageSettings:p}),s=p=>{let f=fi(o,[p],r,u);return f>0?u(f):void 0},c=i(e);if(c===l)return s(l);let m=s(c);return m&&i(m)===c?m:s(l)}import{Fragment as gi,jsx as Vn,jsxs as bi}from"react/jsx-runtime";function xs(t){let{value:e,size:n=Ht,level:r=At,bgColor:a=tt,fgColor:u=Vt,margin:l=Xt,style:o,imageSettings:i,eyeColor:s,dotColor:c,bodyPattern:m,cornerEyePattern:p,cornerEyeDotPattern:f,isOGContext:d,templateId:h,customTemplate:b,customProps:g,frame:y,art:S,eyeColors:E,moduleScale:R,frameLabelMarkers:M,partMarkers:P,autoLevel:_,shape:I,...G}=t,Q=Yn({value:e,size:n,margin:l,level:r,shape:I,autoLevel:_},i),Z=ue({value:e,size:n,level:r,margin:l,imageSettings:Q,autoLevel:_,shape:I}),K=Q?.src,U=pn(y)?fn(n,y,a):null,at=U?.width??n,ft=U?.height??n,Mt=Hn(null),Y=Hn(null),[X,W]=hi(!1);di(()=>{if(Mt.current!=null){let wt=Mt.current,v=wt.getContext("2d");if(!v)return;let J=H.QrCode.encodeText(e,ct[Z]).getModules(),st=pt(J.length,l,I),me=we(e,J.length,l,I),Rt=J.length+st*2,dt=Bt(J,n,st,Q),Qt=Y.current,Ne=dt!=null&&Qt?.complete&&Qt.naturalHeight!==0&&Qt.naturalWidth!==0;Ne&&dt.excavation!=null&&(J=Un(J,dt.excavation));let Ut=window.devicePixelRatio||1;wt.width=at*Ut,wt.height=ft*Ut,v.scale(Ut,Ut),U&&(dn(v,U),v.translate(U.qrX,U.qrY));let Oe=n/Rt;v.scale(Oe,Oe),v.fillStyle=yt(a,tt);let vt=ve(I,Rt);if(vt&&"circle"in vt?(v.beginPath(),v.arc(Rt/2,Rt/2,vt.circle,0,2*Math.PI),v.fill()):vt&&Te?v.fill(new Path2D(vt.path),"evenodd"):v.fillRect(0,0,Rt,Rt),v.fillStyle=yt(u,Vt),Te)v.fill(new Path2D(_e(J,st))),me&&v.fill(new Path2D(_e(me,0)));else for(let[Yt,Pt]of[[J,st],[me??[],0]])Yt.forEach((_t,ht)=>{_t.forEach((Xn,jn)=>{Xn&&v.fillRect(jn+Pt,ht+Pt,1,1)})});if(Ne){let Yt={x:dt.x+st,y:dt.y+st,w:dt.w,h:dt.h},Pt=Q?.shape??"square",_t=Q?.plate,ht=hn(Yt,_t);v.save(),_t&&(Le(v,Pt,Yt),v.fillStyle=_t,v.fill()),Pt!=="square"&&(Le(v,Pt,ht),v.clip()),v.drawImage(Qt,ht.x,ht.y,ht.w,ht.h),v.restore()}}});let Ct={height:ft,width:at,...o},Gt=null;return K!=null&&(Gt=Vn("img",{alt:"QR code",onLoad:()=>{W(!0)},ref:Y,src:K,style:{display:"none"}},K)),bi(gi,{children:[Vn("canvas",{height:ft,ref:Mt,style:Ct,width:at,...G}),Gt]})}export{xs as QRCodeCanvas};
|
|
1
|
+
"use client";import{useEffect as Bi,useRef as sr,useState as qi}from"react";var gt;(c=>{class t{constructor(i,a,l,u){this.version=i;this.errorCorrectionLevel=a;if(i<t.MIN_VERSION||i>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=i*4+17;let m=[];for(let f=0;f<this.size;f++)m.push(!1);for(let f=0;f<this.size;f++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();let p=this.addEccAndInterleave(l);if(this.drawCodewords(p),u==-1){let f=1e9;for(let y=0;y<8;y++){this.applyMask(y),this.drawFormatBits(y);let h=this.getPenaltyScore();h<f&&(u=y,f=h),this.applyMask(y)}}o(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),this.isFunction=[]}version;errorCorrectionLevel;static encodeText(i,a){let l=c.QrSegment.makeSegments(i);return t.encodeSegments(l,a)}static encodeBinary(i,a){let l=c.QrSegment.makeBytes(i);return t.encodeSegments([l],a)}static encodeSegments(i,a,l=1,u=40,m=-1,p=!0){if(!(t.MIN_VERSION<=l&&l<=u&&u<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let f,y;for(f=l;;f++){let d=t.getNumDataCodewords(f,a)*8,C=r.getTotalBits(i,f);if(C<=d){y=C;break}if(f>=u)throw new RangeError("Data too long")}for(let d of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])p&&y<=t.getNumDataCodewords(f,d)*8&&(a=d);let h=[];for(let d of i){e(d.mode.modeBits,4,h),e(d.numChars,d.mode.numCharCountBits(f),h);for(let C of d.getData())h.push(C)}o(h.length==y);let g=t.getNumDataCodewords(f,a)*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 d=236;h.length<g;d^=253)e(d,8,h);let x=[];for(;x.length*8<h.length;)x.push(0);return h.forEach((d,C)=>x[C>>>3]|=d<<7-(C&7)),new t(f,a,x,m)}size;mask;modules=[];isFunction=[];getModule(i,a){return 0<=i&&i<this.size&&0<=a&&a<this.size&&this.modules[a][i]}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 i=this.getAlignmentPatternPositions(),a=i.length;for(let l=0;l<a;l++)for(let u=0;u<a;u++)l==0&&u==0||l==0&&u==a-1||l==a-1&&u==0||this.drawAlignmentPattern(i[l],i[u]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(i){let a=this.errorCorrectionLevel.formatBits<<3|i,l=a;for(let m=0;m<10;m++)l=l<<1^(l>>>9)*1335;let u=(a<<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,!0)}drawVersion(){if(this.version<7)return;let i=this.version;for(let l=0;l<12;l++)i=i<<1^(i>>>11)*7973;let a=this.version<<12|i;o(a>>>18==0);for(let l=0;l<18;l++){let u=n(a,l),m=this.size-11+l%3,p=Math.floor(l/3);this.setFunctionModule(m,p,u),this.setFunctionModule(p,m,u)}}drawFinderPattern(i,a){for(let l=-4;l<=4;l++)for(let u=-4;u<=4;u++){let m=Math.max(Math.abs(u),Math.abs(l)),p=i+u,f=a+l;0<=p&&p<this.size&&0<=f&&f<this.size&&this.setFunctionModule(p,f,m!=2&&m!=4)}}drawAlignmentPattern(i,a){for(let l=-2;l<=2;l++)for(let u=-2;u<=2;u++)this.setFunctionModule(i+u,a+l,Math.max(Math.abs(u),Math.abs(l))!=1)}setFunctionModule(i,a,l){this.modules[a][i]=l,this.isFunction[a][i]=!0}addEccAndInterleave(i){let a=this.version,l=this.errorCorrectionLevel;if(i.length!=t.getNumDataCodewords(a,l))throw new RangeError("Invalid argument");let u=t.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][a],m=t.ECC_CODEWORDS_PER_BLOCK[l.ordinal][a],p=Math.floor(t.getNumRawDataModules(a)/8),f=u-p%u,y=Math.floor(p/u),h=[],g=t.reedSolomonComputeDivisor(m);for(let d=0,C=0;d<u;d++){let M=i.slice(C,C+y-m+(d<f?0:1));C+=M.length;let F=t.reedSolomonComputeRemainder(M,g);d<f&&M.push(0),h.push(M.concat(F))}let x=[];for(let d=0;d<h[0].length;d++)h.forEach((C,M)=>{(d!=y-m||M>=f)&&x.push(C[d])});return o(x.length==p),x}drawCodewords(i){if(i.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let a=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 p=l-m,y=(l+1&2)==0?this.size-1-u:u;!this.isFunction[y][p]&&a<i.length*8&&(this.modules[y][p]=n(i[a>>>3],7-(a&7)),a++)}}o(a==i.length*8)}applyMask(i){if(i<0||i>7)throw new RangeError("Mask value out of range");for(let a=0;a<this.size;a++)for(let l=0;l<this.size;l++){let u;switch(i){case 0:u=(l+a)%2==0;break;case 1:u=a%2==0;break;case 2:u=l%3==0;break;case 3:u=(l+a)%3==0;break;case 4:u=(Math.floor(l/3)+Math.floor(a/2))%2==0;break;case 5:u=l*a%2+l*a%3==0;break;case 6:u=(l*a%2+l*a%3)%2==0;break;case 7:u=((l+a)%2+l*a%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[a][l]&&u&&(this.modules[a][l]=!this.modules[a][l])}}getPenaltyScore(){let i=0;for(let m=0;m<this.size;m++){let p=!1,f=0,y=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[m][h]==p?(f++,f==5?i+=t.PENALTY_N1:f>5&&i++):(this.finderPenaltyAddHistory(f,y),p||(i+=this.finderPenaltyCountPatterns(y)*t.PENALTY_N3),p=this.modules[m][h],f=1);i+=this.finderPenaltyTerminateAndCount(p,f,y)*t.PENALTY_N3}for(let m=0;m<this.size;m++){let p=!1,f=0,y=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][m]==p?(f++,f==5?i+=t.PENALTY_N1:f>5&&i++):(this.finderPenaltyAddHistory(f,y),p||(i+=this.finderPenaltyCountPatterns(y)*t.PENALTY_N3),p=this.modules[h][m],f=1);i+=this.finderPenaltyTerminateAndCount(p,f,y)*t.PENALTY_N3}for(let m=0;m<this.size-1;m++)for(let p=0;p<this.size-1;p++){let f=this.modules[m][p];f==this.modules[m][p+1]&&f==this.modules[m+1][p]&&f==this.modules[m+1][p+1]&&(i+=t.PENALTY_N2)}let a=0;for(let m of this.modules)a=m.reduce((p,f)=>p+(f?1:0),a);let l=this.size*this.size,u=Math.ceil(Math.abs(a*20-l*10)/l)-1;return o(0<=u&&u<=9),i+=u*t.PENALTY_N4,o(0<=i&&i<=2568888),i}getAlignmentPatternPositions(){if(this.version==1)return[];{let i=Math.floor(this.version/7)+2,a=this.version==32?26:Math.ceil((this.version*4+4)/(i*2-2))*2,l=[6];for(let u=this.size-7;l.length<i;u-=a)l.splice(1,0,u);return l}}static getNumRawDataModules(i){if(i<t.MIN_VERSION||i>t.MAX_VERSION)throw new RangeError("Version number out of range");let a=(16*i+128)*i+64;if(i>=2){let l=Math.floor(i/7)+2;a-=(25*l-10)*l-55,i>=7&&(a-=36)}return o(208<=a&&a<=29648),a}static getNumDataCodewords(i,a){return Math.floor(t.getNumRawDataModules(i)/8)-t.ECC_CODEWORDS_PER_BLOCK[a.ordinal][i]*t.NUM_ERROR_CORRECTION_BLOCKS[a.ordinal][i]}static reedSolomonComputeDivisor(i){if(i<1||i>255)throw new RangeError("Degree out of range");let a=[];for(let u=0;u<i-1;u++)a.push(0);a.push(1);let l=1;for(let u=0;u<i;u++){for(let m=0;m<a.length;m++)a[m]=t.reedSolomonMultiply(a[m],l),m+1<a.length&&(a[m]^=a[m+1]);l=t.reedSolomonMultiply(l,2)}return a}static reedSolomonComputeRemainder(i,a){let l=a.map(u=>0);for(let u of i){let m=u^l.shift();l.push(0),a.forEach((p,f)=>l[f]^=t.reedSolomonMultiply(p,m))}return l}static reedSolomonMultiply(i,a){if(i>>>8||a>>>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^=(a>>>u&1)*i;return o(l>>>8==0),l}finderPenaltyCountPatterns(i){let a=i[1];o(a<=this.size*3);let l=a>0&&i[2]==a&&i[3]==a*3&&i[4]==a&&i[5]==a;return(l&&i[0]>=a*4&&i[6]>=a?1:0)+(l&&i[6]>=a*4&&i[0]>=a?1:0)}finderPenaltyTerminateAndCount(i,a,l){return i&&(this.finderPenaltyAddHistory(a,l),a=0),a+=this.size,this.finderPenaltyAddHistory(a,l),this.finderPenaltyCountPatterns(l)}finderPenaltyAddHistory(i,a){a[0]==0&&(i+=this.size),a.pop(),a.unshift(i)}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]]}c.QrCode=t;function e(s,i,a){if(i<0||i>31||s>>>i)throw new RangeError("Value out of range");for(let l=i-1;l>=0;l--)a.push(s>>>l&1)}function n(s,i){return(s>>>i&1)!=0}function o(s){if(!s)throw new Error("Assertion error")}class r{constructor(i,a,l){this.mode=i;this.numChars=a;this.bitData=l;if(a<0)throw new RangeError("Invalid argument");this.bitData=l.slice()}mode;numChars;bitData;static makeBytes(i){let a=[];for(let l of i)e(l,8,a);return new r(r.Mode.BYTE,i.length,a)}static makeNumeric(i){if(!r.isNumeric(i))throw new RangeError("String contains non-numeric characters");let a=[];for(let l=0;l<i.length;){let u=Math.min(i.length-l,3);e(parseInt(i.substr(l,u),10),u*3+1,a),l+=u}return new r(r.Mode.NUMERIC,i.length,a)}static makeAlphanumeric(i){if(!r.isAlphanumeric(i))throw new RangeError("String contains unencodable characters in alphanumeric mode");let a=[],l;for(l=0;l+2<=i.length;l+=2){let u=r.ALPHANUMERIC_CHARSET.indexOf(i.charAt(l))*45;u+=r.ALPHANUMERIC_CHARSET.indexOf(i.charAt(l+1)),e(u,11,a)}return l<i.length&&e(r.ALPHANUMERIC_CHARSET.indexOf(i.charAt(l)),6,a),new r(r.Mode.ALPHANUMERIC,i.length,a)}static makeSegments(i){return i==""?[]:r.isNumeric(i)?[r.makeNumeric(i)]:r.isAlphanumeric(i)?[r.makeAlphanumeric(i)]:[r.makeBytes(r.toUtf8ByteArray(i))]}static makeEci(i){let a=[];if(i<0)throw new RangeError("ECI assignment value out of range");if(i<128)e(i,8,a);else if(i<16384)e(2,2,a),e(i,14,a);else if(i<1e6)e(6,3,a),e(i,21,a);else throw new RangeError("ECI assignment value out of range");return new r(r.Mode.ECI,0,a)}static isNumeric(i){return r.NUMERIC_REGEX.test(i)}static isAlphanumeric(i){return r.ALPHANUMERIC_REGEX.test(i)}getData(){return this.bitData.slice()}static getTotalBits(i,a){let l=0;for(let u of i){let m=u.mode.numCharCountBits(a);if(u.numChars>=1<<m)return 1/0;l+=4+m+u.bitData.length}return l}static toUtf8ByteArray(i){i=encodeURI(i);let a=[];for(let l=0;l<i.length;l++)i.charAt(l)!="%"?a.push(i.charCodeAt(l)):(a.push(parseInt(i.substr(l+1,2),16)),l+=2);return a}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}c.QrSegment=r})(gt||={});(e=>{let t;(o=>{class n{constructor(c,s){this.ordinal=c;this.formatBits=s}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})(t=e.QrCode||={})})(gt||={});(e=>{let t;(o=>{class n{constructor(c,s){this.modeBits=c;this.numBitsCharCount=s}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(c){return this.numBitsCharCount[Math.floor((c+7)/17)]}}o.Mode=n})(t=e.QrSegment||={})})(gt||={});var Q=gt;var tt={L:Q.QrCode.Ecc.LOW,M:Q.QrCode.Ecc.MEDIUM,Q:Q.QrCode.Ecc.QUARTILE,H:Q.QrCode.Ecc.HIGH},zt=128,yt="Q",et="#FFFFFF",Bt="#000000";var qt=0;var Dt=.1;import{z as nt}from"zod";var mr=["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"],bt=24;var oe=.5,xt=1.5,pr=nt.enum(mr),ie=nt.object({style:pr,text:nt.string().max(bt).optional(),color:nt.string().optional(),textColor:nt.string().optional(),secondaryText:nt.string().max(bt).optional(),secondaryColor:nt.string().optional(),fontScale:nt.number().min(oe).max(xt).optional()});import{z as S}from"zod";function dr(t,e=3){let n=10**e;return Math.round(t*n)/n+0}function b(t,e=3){return String(dr(t,e))}function Gt(t,...e){let n=t[0]??"";for(let o=0;o<e.length;o++){let r=e[o];n+=(typeof r=="number"?b(r):r)+(t[o+1]??"")}return n}var fr={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},hr=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,ae=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function Pt(t,e=Number.POSITIVE_INFINITY){if(!hr.test(t))return null;let n=[],o=0,r=()=>{for(;o<t.length&&/[\s,]/.test(t[o]);)o++},c=()=>{r(),ae.lastIndex=o;let a=ae.exec(t);if(!a)return null;let l=a[0],u=l.indexOf(".");if(u>=0&&l.length-u-1>e)return null;o=ae.lastIndex;let m=Number(l);return Number.isFinite(m)?m:null},s=()=>{r();let a=t[o];return a==="0"||a==="1"?(o++,a==="1"?1:0):null},i=()=>(r(),o<t.length&&/[0-9.+-]/.test(t[o]));for(r();o<t.length;){let a=t[o],l=a.toUpperCase(),u=fr[l];if(u===void 0||n.length===0&&l!=="M")return null;if(o++,u===0){n.push({command:a,values:[]}),r();continue}let m=a,p=!0;for(;p||i();){let f=[];for(let y=0;y<u;y++){let h=l==="A"&&(y===3||y===4)?s():c();if(h===null)return null;f.push(h)}n.push({command:m,values:f}),l==="M"&&(m=a==="M"?"L":"l"),p=!1}r()}return n}function ke(t){let e=0;for(let{command:n}of t)e+=n.toUpperCase()==="A"?4:1;return e}function se(t,e=1,n=0,o=0){let r="";for(let{command:c,values:s}of t){let i=c.toUpperCase(),a=c===i,l=a?n:0,u=a?o:0,m;switch(i){case"Z":m=[];break;case"H":m=[b(s[0]*e+l)];break;case"V":m=[b(s[0]*e+u)];break;case"A":m=[b(Math.abs(s[0])*e),b(Math.abs(s[1])*e),b(s[2]),String(s[3]),String(s[4]),b(s[5]*e+l),b(s[6]*e+u)];break;default:m=s.map((p,f)=>b(p*e+(f%2===0?l:u)))}r+=c+m.join(" ")}return r}function ze(t,e=.25){let n=[],o=[],r=[0,0],c=[0,0],s=()=>{o.length>2&&n.push(o),o=[]};for(let i of t)if(i.op==="M")s(),r=[i.x,i.y],c=r,o.push(r);else if(i.op==="L")c=[i.x,i.y],o.push(c);else if(i.op==="C"){let a=c,l=[i.x1,i.y1],u=[i.x2,i.y2],m=[i.x,i.y],p=Math.hypot(l[0]-a[0],l[1]-a[1])+Math.hypot(u[0]-l[0],u[1]-l[1])+Math.hypot(m[0]-u[0],m[1]-u[1]),f=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(p/(4*e)))));for(let y=1;y<=f;y++){let h=y/f,g=1-h;o.push([g*g*g*a[0]+3*g*g*h*l[0]+3*g*h*h*u[0]+h*h*h*m[0],g*g*g*a[1]+3*g*g*h*l[1]+3*g*h*h*u[1]+h*h*h*m[1]])}c=m}else s(),c=r;return s(),n}function Qt(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 c=o;o=[];for(let s=0;s<c.length;s++){let i=c[s],a=c[(s+c.length-1)%c.length],l=r(i),u=r(a);l>=0?(u<0&&o.push(Oe(a,i,u,l)),o.push(i)):u>=0&&o.push(Oe(a,i,u,l))}}return o.length>2?o:[]}function Oe(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 Be(t){return t.filter(e=>e.length>2).map(e=>`M${e.map(([n,o])=>`${b(n)} ${b(o)}`).join("L")}Z`).join("")}function qe(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,c=(s,i)=>{e=Math.min(e,s),n=Math.min(n,i),o=Math.max(o,s),r=Math.max(r,i)};for(let s of t)s.op==="C"?(c(s.x1,s.y1),c(s.x2,s.y2),c(s.x,s.y)):s.op!=="Z"&&c(s.x,s.y);return Number.isFinite(e)?{x0:e,y0:n,x1:o,y1:r}:null}var le=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function gr(t,e,n,o,r,c,s,i,a){if(t===i&&e===a)return[];let l=Math.abs(n),u=Math.abs(o);if(l===0||u===0)return[{op:"L",x:i,y:a}];let m=r*Math.PI/180,p=Math.cos(m),f=Math.sin(m),y=(t-i)/2,h=(e-a)/2,g=p*y+f*h,x=-f*y+p*h,d=g*g/(l*l)+x*x/(u*u);d>1&&(l*=Math.sqrt(d),u*=Math.sqrt(d));let C=l*l*u*u-l*l*x*x-u*u*g*g,M=l*l*x*x+u*u*g*g,F=(c===s?-1:1)*Math.sqrt(Math.max(0,C/M)),P=F*l*x/u,E=-F*u*g/l,I=p*P-f*E+(t+i)/2,w=f*P+p*E+(e+a)/2,N=(G,U,V,dt)=>Math.atan2(G*dt-U*V,G*V+U*dt),B=N(1,0,(g-P)/l,(x-E)/u),H=N((g-P)/l,(x-E)/u,(-g-P)/l,(-x-E)/u);!s&&H>0?H-=2*Math.PI:s&&H<0&&(H+=2*Math.PI);let Y=Math.max(1,Math.ceil(Math.abs(H)/(Math.PI/2)-1e-9)),D=H/Y,K=4/3*Math.tan(D/4),it=(G,U)=>[I+l*p*G-u*f*U,w+l*f*G+u*p*U],pt=[];for(let G=0;G<Y;G++){let U=B+G*D,V=U+D,[dt,$t]=it(Math.cos(U)-K*Math.sin(U),Math.sin(U)+K*Math.cos(U)),[Et,v]=it(Math.cos(V)+K*Math.sin(V),Math.sin(V)-K*Math.cos(V)),[j,J]=G===Y-1?[i,a]:it(Math.cos(V),Math.sin(V));pt.push({op:"C",x1:dt,y1:$t,x2:Et,y2:v,x:j,y:J})}return pt}function Ut(t){let e=[],n=0,o=0,r=0,c=0,s=0,i="",a=null,l=null,u=()=>{for(;n<t.length&&/[\s,]/.test(t[n]);)n++},m=()=>{u(),le.lastIndex=n;let y=le.exec(t);return y?(n=le.lastIndex,Number(y[0])):null},p=()=>{u();let y=t[n];return y==="0"||y==="1"?(n++,y==="1"):null},f=y=>{let h=[];for(let g=0;g<y;g++){let x=m();if(x===null)return null;h.push(x)}return h};for(;u(),!(n>=t.length);){let y=t[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(y))i=y,n++;else if(!i||i==="Z"||i==="z")break;let h=i===i.toLowerCase(),g=h?o:0,x=h?r:0,d=i.toUpperCase();if(d==="Z"){e.push({op:"Z"}),o=c,r=s,a=null,l=null;continue}if(d==="A"){let P=f(3),E=p(),I=p(),w=f(2);if(!(P&&w)||E===null||I===null)break;let[N,B,H]=P,Y=w[0]+g,D=w[1]+x;e.push(...gr(o,r,N,B,H,E,I,Y,D)),o=Y,r=D,a=null,l=null;continue}let C={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[d]??0,M=f(C);if(!M)break;let F=M;switch(d){case"M":o=F[0]+g,r=F[1]+x,c=o,s=r,e.push({op:"M",x:o,y:r}),i=h?"l":"L",a=null,l=null;break;case"L":case"H":case"V":d!=="V"&&(o=F[0]+g),d==="V"?r=F[0]+x:d==="L"&&(r=F[1]+x),e.push({op:"L",x:o,y:r}),a=null,l=null;break;case"C":case"S":{let P,E;d==="C"?(P=[F[0]+g,F[1]+x],E=F.slice(2)):(P=a?[2*o-a[0],2*r-a[1]]:[o,r],E=F);let I=[E[0]+g,E[1]+x],w=[E[2]+g,E[3]+x];e.push({op:"C",x1:P[0],y1:P[1],x2:I[0],y2:I[1],x:w[0],y:w[1]}),[o,r]=w,a=I,l=null;break}case"Q":case"T":{let P,E;d==="Q"?(P=[F[0]+g,F[1]+x],E=[F[2]+g,F[3]+x]):(P=l?[2*o-l[0],2*r-l[1]]:[o,r],E=[F[0]+g,F[1]+x]),e.push({op:"C",x1:o+2/3*(P[0]-o),y1:r+2/3*(P[1]-r),x2:E[0]+2/3*(P[0]-E[0]),y2:E[1]+2/3*(P[1]-E[1]),x:E[0],y:E[1]}),[o,r]=E,l=P,a=null;break}default:break}}return e}var De=.5522847498;function ce(t,e,n,o,r=0,c=0){if(n<=0||o<=0)return[];let s=Math.min(Math.max(r,0),n/2),i=Math.min(Math.max(c,0),o/2);if(s===0||i===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 a=s*De,l=i*De,u=t+n,m=e+o;return[{op:"M",x:t+s,y:e},{op:"L",x:u-s,y:e},{op:"C",x1:u-s+a,y1:e,x2:u,y2:e+i-l,x:u,y:e+i},{op:"L",x:u,y:m-i},{op:"C",x1:u,y1:m-i+l,x2:u-s+a,y2:m,x:u-s,y:m},{op:"L",x:t+s,y:m},{op:"C",x1:t+s-a,y1:m,x2:t,y2:m-i+l,x:t,y:m-i},{op:"L",x:t,y:e+i},{op:"C",x1:t,y1:e+i-l,x2:t+s-a,y2:e,x:t+s,y:e},{op:"Z"}]}var yr="qrdx.frame",br=1,pe="custom",k={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:bt},xr=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],Vt=.95,Sr=200,Mr=["frame","text","accent","background"],Er=/[\t\n\v\f\r\u0085\u2028\u2029]/g,Fr=/[\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 de(t,e=bt){let n=t.slice(0,1e3).normalize("NFC").replace(Er," ").replace(Fr,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,e)).join("").trim()}var fe=t=>Math.abs(t*1e3-Math.round(t*1e3))<1e-6,_=S.number().min(-k.maxCoordinate).max(k.maxCoordinate).refine(fe,{message:`Numbers may have at most ${k.maxDecimals} decimals`}),O=_.refine(t=>t>0,{message:"Must be greater than 0"}),Ht=_.refine(t=>t>=0,{message:"Must not be negative"}),Rt=S.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color"),Ge=S.union([S.enum(Mr),Rt]),He=t=>S.object({mix:S.tuple([t,t]),amount:S.number().min(0).max(1).refine(fe)}).strict(),St=S.union([Ge,He(Ge)]),Cr=S.union([Rt,He(S.union([S.enum(["frame","accent","background"]),Rt]))]),lt=S.union([St,S.object({gradient:S.object({from:St,to:St,direction:S.enum(["horizontal","vertical"]).optional(),steps:S.int().min(2).max(k.maxGradientSteps).optional()}).strict()}).strict()]),ue={x:_,y:_,width:O,height:O},At=S.object({color:St,width:O}).strict(),Pr=S.object({type:S.literal("rect"),...ue,radius:Ht.optional(),fill:lt,hole:S.object({...ue,radius:Ht.optional()}).strict().optional(),stroke:At.optional()}).strict(),Rr=S.object({type:S.literal("circle"),cx:_,cy:_,r:O,hole:O.optional(),fill:lt,stroke:At.optional()}).strict(),Ar=S.object({type:S.literal("ellipse"),cx:_,cy:_,rx:O,ry:O,fill:lt,stroke:At.optional()}).strict(),wr=S.object({type:S.literal("polygon"),points:S.array(S.tuple([_,_])).min(3).max(k.maxPolygonPoints),fill:lt,stroke:At.optional()}).strict(),Lr=S.object({type:S.literal("path"),d:S.string().min(2).max(k.maxPathLength),fill:lt,fillRule:S.enum(["nonzero","evenodd"]).optional(),stroke:At.optional()}).strict(),Ir=S.object({type:S.literal("line"),x1:_,y1:_,x2:_,y2:_,width:O,cap:S.enum(["butt","round"]).optional(),dash:S.tuple([O,O]).optional(),fill:lt}).strict(),vr=S.object({type:S.literal("icon"),icon:S.enum(xr),x:_,y:_,size:O,fill:lt}).strict(),_r=S.discriminatedUnion("type",[Pr,Rr,Ar,wr,Lr,Ir,vr]),Ve={id:S.string().regex(/^[a-z][a-z0-9-]{0,31}$/),slot:S.enum(["primary","secondary","fixed"]),text:S.string().max(200),maxLength:S.int().min(1).max(bt).optional(),color:St,weight:S.enum(["bold","regular"]).optional(),collapse:S.object({y:_,height:O}).strict().optional()},Tr=S.object({type:S.literal("text"),...Ve,box:S.object(ue).strict(),align:S.enum(["start","middle","end"]).optional(),fontSize:O.optional()}).strict(),$r=S.object({type:S.literal("curved"),...Ve,curve:S.object({cx:_,cy:_,radius:O,side:S.enum(["top","bottom"]),spread:S.number().min(20).max(300).refine(fe).optional()}).strict(),fontSize:O}).strict(),Nr=S.discriminatedUnion("type",[Tr,$r]),Qe=_.refine(t=>t>=k.minArtboard&&t<=k.maxArtboard,{message:`Artboard sides must be ${k.minArtboard} to ${k.maxArtboard} units`}),kr=S.object({kind:S.literal(yr),version:S.literal(br),artboard:S.object({width:Qe,height:Qe}).strict(),qr:S.object({x:_,y:_,size:O,padding:Ht.optional(),radius:Ht.optional(),plate:S.enum(["opaque","background","none"]).optional()}).strict(),colors:S.object({frame:Rt,text:Cr.optional(),accent:Rt.optional()}).strict(),shapes:S.array(_r).max(k.maxShapes),labels:S.array(Nr).max(k.maxLabels),bleed:S.union([S.literal("none"),St]).optional()}).strict();function he(t){let e=Yt(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 Or(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 Yt(t){return t.qr.padding??t.qr.size*k.defaultPadding}var ge=.52,zr=.35;function Br(t){let e=t.fontSize??t.box.height*ge;return Math.min(e*xt,t.box.height*Vt)}var me=(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 Ue(t){let e=he(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[c,s,i]of o)for(let a=0;a<=8;a++){let l=i+Math.PI/2*(a/8);r.push([c+n*Math.cos(l),s+n*Math.sin(l)])}return r}function qr([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!1;let c=Math.min(o,n.width/2,n.height/2),s=Math.min(Math.max(t,n.x+c),n.x+n.width-c),i=Math.min(Math.max(e,n.y+c),n.y+n.height-c);return Math.hypot(t-s,e-i)<=c+.01}function Dr(t){let e=0;return t.forEach(([n,o],r)=>{let[c,s]=t[(r+1)%t.length];e+=n*s-c*o}),Math.abs(e)/2}function Gr(t,e,n){let o=he(e);if(!me(n,o))return!1;if("stroke"in t&&t.stroke)return!0;if(t.fill==="background")return!1;if(t.type==="rect"&&t.hole){let{hole:r}=t;return!Ue(e).every(c=>qr(c,r,r.radius??0))}if(t.type==="circle"&&t.hole){let r=t.hole;return!Ue(e).every(([c,s])=>Math.hypot(c-t.cx,s-t.cy)<=r+.01)}if(t.type==="polygon"){let r=Qt(t.points,o);return r.length>2&&Dr(r)>1e-6}return!0}function ye(t){let e=Qr(t),n="stroke"in t?t.stroke:void 0;if(!(n&&e.bounds))return e;let o=t.type==="circle"||t.type==="ellipse"?n.width/2:t.type==="rect"?n.width*Math.SQRT2/2:n.width*2,{x0:r,y0:c,x1:s,y1:i}=e.bounds;return{bounds:{x0:r-o,y0:c-o,x1:s+o,y1:i+o},segments:e.segments*2}}function Qr(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=Pt(t.d,k.maxDecimals);return e?{bounds:qe(Ut(t.d)),segments:ke(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:Sr}}}function Ur(t,e){let n=(d,C=[])=>e.addIssue({code:"custom",message:d,path:C}),o=k,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:c,height:s}=t.artboard,i=Math.max(c,s)*.005,a={x0:-i,y0:-i,x1:c+i,y1:s+i},l=d=>d.x0>=a.x0&&d.y0>=a.y0&&d.x1<=a.x1&&d.y1<=a.y1,{qr:u}=t,m=Yt(t);u.plate!=="none"&&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(c,s)*o.minQrShare-1e-9&&n(`qr.size must be at least ${o.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let p=he(t);(p.x0<-1e-9||p.y0<-1e-9||p.x1>c+1e-9||p.y1>s+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 f=0,y=0;t.shapes.forEach((d,C)=>{let M=["shapes",C],{bounds:F,segments:P}=ye(d);if(!F){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",[...M,"d"]);return}if(l(F)||n("The shape extends outside the artboard",M),d.type==="rect"&&d.hole){let{hole:E}=d;(E.x<d.x||E.y<d.y||E.x+E.width>d.x+d.width+1e-9||E.y+E.height>d.y+d.height+1e-9)&&n("The hole must sit inside its rect",[...M,"hole"])}d.type==="circle"&&d.hole&&d.hole>=d.r&&n("The hole must be smaller than the circle",[...M,"hole"]),"stroke"in d&&d.stroke&&d.stroke.width>Math.min(c,s)*.1+1e-9&&n("A stroke may be at most 10% of the artboard's shorter side",[...M,"stroke","width"]),u.plate==="background"&&Gr(d,t,F)&&n('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',M),f+=P,typeof d.fill=="object"&&"gradient"in d.fill&&(y+=(d.fill.gradient.steps??32)*P)}),f>o.maxSegments&&n(`The shapes have ${f} segments; the limit is ${o.maxSegments}`,["shapes"]),y>o.maxGradientWork&&n("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let h=[],g=new Set,x=new Set;t.labels.forEach((d,C)=>{let M=["labels",C];g.has(d.id)&&n(`Label id "${d.id}" is used twice`,[...M,"id"]),g.add(d.id),d.slot!=="fixed"&&(x.has(d.slot)&&n(`Only one label may use the ${d.slot} slot`,[...M,"slot"]),x.add(d.slot));let F=d.maxLength??o.maxTextLength;d.text!==de(d.text,F)&&n(`Label text must be at most ${F} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...M,"text"]);let P;if(d.type==="text"){P={x0:d.box.x,y0:d.box.y,x1:d.box.x+d.box.width,y1:d.box.y+d.box.height},d.fontSize!==void 0&&d.fontSize>d.box.height*Vt+1e-9&&n("fontSize may be at most 95% of the label's row height",[...M,"fontSize"]);let E=d.box.y+d.box.height/2,I=Br(d)*zr,w={x0:P.x0,x1:P.x1,y0:E-I,y1:E+I};(me(P,Or(t))||me(w,p))&&n("The label overlaps the code or its padding",[...M,"box"])}else{let{cx:E,cy:I,radius:w}=d.curve,N=d.fontSize*xt*.6;P={x0:E-w-N,y0:I-w-N,x1:E+w+N,y1:I+w+N};let B=Math.hypot(Math.max(p.x0-E,0,E-p.x1),Math.max(p.y0-I,0,I-p.y1));Math.hypot(Math.max(Math.abs(p.x0-E),Math.abs(p.x1-E)),Math.max(Math.abs(p.y0-I),Math.abs(p.y1-I)))<=w-N||B>=w+N||n("The curved label crosses the code or its padding",[...M,"curve"])}if(l(P)||n("The label extends outside the artboard",M),d.collapse){let E=d.collapse,I=E.y+E.height;(E.y<-1e-9||I>s+1e-9)&&n("The collapse band must sit inside the artboard",[...M,"collapse"]),I>p.y0+1e-6&&E.y<p.y1-1e-6&&n("The collapse band crosses the code or its padding",[...M,"collapse"]);for(let w of h)I>w.y+1e-6&&E.y<w.y+w.height-1e-6&&n("Collapse bands may not overlap",[...M,"collapse"]);h.push(E)}})}var be=kr.superRefine(Ur);var Hr=ie.extend({style:S.literal(pe),spec:be}),Ye=S.discriminatedUnion("style",[ie,Hr]);function q(t){if(t.length===0)return"";let[e,...n]=t;return`M${b(e[0])} ${b(e[1])}${n.map(([o,r])=>`L${b(o)} ${b(r)}`).join("")}Z`}function T(t,e,n){return`M${b(t-n)} ${b(e)}A${b(n)} ${b(n)} 0 1 1 ${b(t+n)} ${b(e)}A${b(n)} ${b(n)} 0 1 1 ${b(t-n)} ${b(e)}Z`}function A(t,e,n,o,r=0){let c=Math.min(n,o)/2,[s,i,a,l]=(typeof r=="number"?[r,r,r,r]:r).map(m=>Math.max(0,Math.min(m,c))),u=(m,p,f)=>m>0?`A${b(m)} ${b(m)} 0 0 1 ${b(p)} ${b(f)}`:"";return`M${b(t+s)} ${b(e)}H${b(t+n-i)}${u(i,t+n,e+i)}V${b(e+o-a)}${u(a,t+n-a,e+o)}H${b(t+l)}${u(l,t,e+o-l)}V${b(e+s)}${u(s,t+s,e)}Z`}function jt(t,e,n,o,r=5){return Array.from({length:r*2},(c,s)=>{let i=s%2===0?n:o,a=-Math.PI/2+Math.PI/r*s;return[t+i*Math.cos(a),e+i*Math.sin(a)]})}function je(t,e,n){let o=n/2,r=(c,s)=>`${b(t+c*o)} ${b(e+s*o)}`;return`M${r(0,-.52)}C${r(.18,-.92)} ${r(.98,-.94)} ${r(1,-.34)}C${r(1,.12)} ${r(.5,.48)} ${r(0,.92)}C${r(-.5,.48)} ${r(-1,.12)} ${r(-1,-.34)}C${r(-.98,-.94)} ${r(-.18,-.92)} ${r(0,-.52)}Z`}function xe(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 Ze=24,rt=(t,e,n,o)=>{let r=o*Math.PI/180;return[t+n*Math.cos(r),e+n*Math.sin(r)]},Zt=([t,e])=>`${b(t)} ${b(e)}`;function Mt(t,e,n,o,r,c){let s=c-r>180?1:0;return`M${Zt(rt(t,e,o,r))}A${b(o)} ${b(o)} 0 ${s} 1 ${Zt(rt(t,e,o,c))}L${Zt(rt(t,e,n,c))}A${b(n)} ${b(n)} 0 ${s} 0 ${Zt(rt(t,e,n,r))}Z`}function wt(t,e,n,o){return`M${b(t-n)} ${b(e)}A${b(n)} ${b(o)} 0 1 1 ${b(t+n)} ${b(e)}A${b(n)} ${b(o)} 0 1 1 ${b(t-n)} ${b(e)}Z`}function Vr(t){let e=0;return t.forEach(([n,o],r)=>{let[c,s]=t[(r+1)%t.length];e+=n*s-c*o}),e/2}function Xe(t){return q(Vr(t)<0?[...t].reverse():t)}function Xt(t,e,n,o,r){let c=Math.hypot(n-t,o-e)||1,s=-(o-e)/c*(r/2),i=(n-t)/c*(r/2);return Xe([[t+s,e+i],[n+s,o+i],[n-s,o-i],[t-s,e-i]])}var z=(...t)=>({d:t.join(""),fillRule:"nonzero"}),Z=(...t)=>({d:t.join(""),fillRule:"evenodd"});function Yr(){let t=[];for(let e of[0,60,120]){let[n,o]=rt(12,12,10.5,e+180),[r,c]=rt(12,12,10.5,e);t.push(Xt(n,o,r,c,2))}for(let e=0;e<6;e++){let n=e*60,[o,r]=rt(12,12,6.2,n);for(let c of[-45,45]){let[s,i]=rt(o,r,3.6,n+c);t.push(Xt(o,r,s,i,1.7))}}return z(...t)}var jr={wifi:()=>z(Mt(12,20,4.6,7.2,-135,-45),Mt(12,20,9.2,11.8,-135,-45),Mt(12,20,13.8,16.4,-135,-45),T(12,20,2.2)),star:()=>z(q(jt(12,12.8,11.6,4.8))),heart:()=>z(je(12,12.4,22)),phone:()=>Z(A(6,1.5,12,21,2.6),A(7.8,4.2,8.4,13.4,.6),T(12,19.8,1.1)),headphones:()=>z(Mt(12,13,7.6,9.8,-180,0),A(2,12,5,9.5,2),A(17,12,5,9.5,2)),calendar:()=>Z(A(2.5,4,19,17.5,2.5),A(4.6,9,14.8,10.6,.8),A(7,11.4,2.6,2.6,.4),A(10.7,11.4,2.6,2.6,.4),A(14.4,11.4,2.6,2.6,.4),A(7,15.1,2.6,2.6,.4),A(10.7,15.1,2.6,2.6,.4),A(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),A(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>z(T(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:()=>Z(A(2,3,20,14,4),q([[6.5,17],[11.5,17],[5.8,21.8]]),T(7.5,10,1.5),T(12,10,1.5),T(16.5,10,1.5)),bag:()=>z(A(3.5,7.5,17,14.5,2),Mt(12,7.5,3.1,4.8,-180,0)),bell:()=>z("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",A(1.5,18.2,21,2.6,1.3),A(11.2,6.6,1.6,2.6,0),A(9.8,4.6,4.4,2.4,1.2)),cup:()=>z("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",Mt(17,10.2,1.7,3.6,-90,90),A(2,20.6,17,2,1),A(7,1.6,1.6,3.4,.8),A(11.6,1.6,1.6,3.4,.8)),card:()=>Z(A(1.5,4.5,21,15,2.5),A(1.5,8,21,3,0),A(4.5,13.6,4.6,3.2,.6)),check:()=>Z(T(12,12,10.5),q([[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:()=>Z(T(12,12,10.5),T(12,7.2,1.6),A(10.6,10,2.8,8,.8)),home:()=>Z(q([[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]]),A(10,14.5,4,7,[.6,.6,0,0])),pin:()=>Z("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",T(12,9.5,3)),share:()=>z(Xt(6,12,18,5,1.8),Xt(6,12,18,19,1.8),T(18,5,3.2),T(6,12,3.2),T(18,19,3.2)),download:()=>z(A(10.6,2,2.8,9.5,0),q([[6,10],[18,10],[12,16.5]]),q([[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:()=>Z(T(12,12,10.5),T(12,12,8.4),q([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:Yr,pumpkin:()=>z(wt(7.8,14.6,5.8,6.9),wt(16.2,14.6,5.8,6.9),wt(12,14.6,4.8,7.4),A(10.9,3.4,2.2,4.6,.8),Xe([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>z(q([[12,1.5],[16.8,8.2],[7.2,8.2]]),q([[12,5.2],[19,13.6],[5,13.6]]),q([[12,9.4],[21.2,19.2],[2.8,19.2]]),A(10.4,18.6,3.2,3.9,.4)),sparkle:()=>z(q(jt(9.5,13.5,9,2.4,4)),q(jt(19,5,4,1.1,4))),gift:()=>z(A(3,11.2,7.8,10.6,1),A(13.2,11.2,7.8,10.6,1),A(2,7.4,8.8,3.2,1),A(13.2,7.4,8.8,3.2,1),wt(8.8,4.8,2.9,1.9),wt(15.2,4.8,2.9,1.9))};function We(t){return jr[t]()}var Zr={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 Ke(t,e){let n=t.trim(),o=Number.parseFloat(n);return Number.isNaN(o)?Number.NaN:n.endsWith("%")?o/100*e:o}function Lt(t){if(!t)return null;let e=t.trim().toLowerCase();if(e==="transparent")return{r:0,g:0,b:0,a:0};let n=Zr[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(c=>c+c).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,c]=o[1].split("/"),s=r.split(/[\s,]+/).filter(Boolean);if(s.length!==(c===void 0&&s.length===4?4:3))return null;let i=c??s[3],[a,l,u]=s.slice(0,3).map(f=>Ke(f,255)),m=i===void 0?1:Ke(i,1);if([a,l,u,m].some(f=>Number.isNaN(f)))return null;let p=(f,y)=>Math.min(Math.max(f,0),y);return{r:p(a,255),g:p(l,255),b:p(u,255),a:p(m,1)}}return null}function Je(t){return t===" "?.3:/[MWmw@%]/.test(t)?.92:/[A-Z0-9#&]/.test(t)?.72:/[il.,:;!'|1]/.test(t)?.32:.6}function Me(t){let e=0;for(let n of t)e+=Je(n);return Math.max(e,1)}var Se=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function Wt(t,e,n){let o=Lt(t)??{r:0,g:0,b:0,a:1},r=Lt(e)??{r:255,g:255,b:255,a:1},c=Math.min(1,Math.max(0,n));return`#${Se(o.r+(r.r-o.r)*c)}${Se(o.g+(r.g-o.g)*c)}${Se(o.b+(r.b-o.b)*c)}`}function tn(t,e,n,o,r,c,s,i){let a=[...t],l=r*.08,u=a.map(h=>Je(h)*r),m=u.reduce((h,g)=>h+g,0)+l*Math.max(0,a.length-1),p=c==="top"?o-r*.35:o+r*.35,f=[],y=0;return a.forEach((h,g)=>{let x=u[g],d=(y+x/2)/p;if(y+=x+l,h.trim()==="")return;let C=c==="top"?-Math.PI/2-m/2/p+d:Math.PI/2+m/2/p-d;f.push({text:h,x:e+p*Math.cos(C),y:n+p*Math.sin(C),fontSize:r,maxWidth:r*2,color:s,rotate:C*180/Math.PI+(c==="top"?90:-90),field:i})}),f}function It(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 Kt=class extends Error{issues;constructor(e){super(`Invalid frame spec: ${e.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=e}},en=new WeakMap;function Ee(t){if(t&&typeof t=="object"){let n=en.get(t);if(n)return n}if(t==null)throw new Kt(['A "custom" frame needs a spec']);let e=be.safeParse(t);if(!e.success)throw new Kt(e.error.issues.map(n=>n.path.length>0?`${n.path.join(".")}: ${n.message}`:n.message));return typeof t=="object"&&en.set(t,e.data),e.data}var Xr=t=>{let e=Lt(t);return!!(e&&e.a>=1)};function Wr(t,e){let n=It(e,et);return t.qr.plate==="none"?{color:n,plate:!1}:Xr(n)?{color:n,plate:!0}:t.qr.plate==="background"?{color:n,plate:!1}:{color:et,plate:!0}}function rn(t,e,n=et){let o=e.color||t.colors.frame,r=e.secondaryColor||t.colors.accent||o,c=a=>a==="frame"?o:a==="accent"?r:a==="background"?n:a,s=t.colors.text,i=e.textColor||(s===void 0?o:typeof s=="string"?s:Wt(c(s.mix[0]),c(s.mix[1]),s.amount));return{frame:o,text:i,accent:r}}function Kr(t,e,n){let o=rn(e,t,n),r=c=>{switch(c){case"frame":return o.frame;case"text":return o.text;case"accent":return o.accent;case"background":return n;default:return c}};return c=>typeof c=="string"?r(c):Wt(r(c.mix[0]),r(c.mix[1]),c.amount)}function nn(t,e,n=0,o=0){let r=Pt(t);return r?se(r,e,n,o):""}function Jr(t,e,n,o){return`M${b(t-n)} ${b(e)}A${b(n)} ${b(o)} 0 1 1 ${b(t+n)} ${b(e)}A${b(n)} ${b(o)} 0 1 1 ${b(t-n)} ${b(e)}Z`}function to(t,e){let[n,o,r,c]=[t.x1*e,t.y1*e,t.x2*e,t.y2*e],s=Math.hypot(r-n,c-o),i=t.width*e/2,a=s>0?(r-n)/s:1,l=s>0?(c-o)/s:0,u=-l*i,m=a*i,p=(g,x)=>{let d=[n+a*g,o+l*g],C=[n+a*x,o+l*x];if(t.cap==="round"&&x-g>2*i){let M=[d[0]+a*i,d[1]+l*i],F=[C[0]-a*i,C[1]-l*i];return`M${b(M[0]-u)} ${b(M[1]-m)}L${b(F[0]-u)} ${b(F[1]-m)}A${b(i)} ${b(i)} 0 0 1 ${b(F[0]+u)} ${b(F[1]+m)}L${b(M[0]+u)} ${b(M[1]+m)}A${b(i)} ${b(i)} 0 0 1 ${b(M[0]-u)} ${b(M[1]-m)}Z`}return`M${b(d[0]-u)} ${b(d[1]-m)}L${b(C[0]-u)} ${b(C[1]-m)}L${b(C[0]+u)} ${b(C[1]+m)}L${b(d[0]+u)} ${b(d[1]+m)}Z`};if(!t.dash)return{type:"path",d:p(0,s),fillRule:"nonzero"};let f=t.dash[0]*e,y=f+t.dash[1]*e,h=[];for(let g=0;g+f<=s+1e-6;g+=y)h.push(p(g,g+f));return{type:"path",d:h.join(""),fillRule:"nonzero"}}function eo(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:T(t.cx*e,t.cy*e,t.r*e)+(t.hole?T(t.cx*e,t.cy*e,t.hole*e):""),fillRule:t.hole?"evenodd":"nonzero"};case"ellipse":return{type:"path",d:Jr(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:nn(t.d,e),fillRule:t.fillRule??"nonzero"};case"line":return to(t,e);default:{let n=We(t.icon);return{type:"path",d:nn(n.d,t.size*e/Ze,t.x*e,t.y*e),fillRule:n.fillRule}}}}function no(t){if(t.type==="rect"){let{x:e,y:n,width:o,height:r,radius:c,hole:s}=t;return[...ce(e,n,o,r,c,c),...s?ce(s.x,s.y,s.width,s.height,s.radius,s.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"}]:Ut(t.d)}function ro(t,e,n){let o=no(t),r=ze(o,.2),c=t.type==="rect"?t.hole?"evenodd":"nonzero":t.type==="path"?t.fillRule??"nonzero":"nonzero",s=e.direction==="vertical",i=g=>s?g[1]:g[0],a=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let g of r)for(let x of g)a=Math.min(a,i(x)),l=Math.max(l,i(x));if(!(l>a))return[];let u=e.steps??32,m=n(e.from),p=n(e.to),f=l-a,y=f*.002,h=[];for(let g=0;g<u;g++){let x=a+f*g/u,d=Math.min(l,a+f*(g+1)/u+(g+1<u?y:0)),C=s?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:x,y1:d}:{x0:x,x1:d,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},M=r.map(F=>Qt(F,C)).filter(F=>F.length>2);M.length!==0&&h.push({type:"path",d:Be(M),fill:Wt(m,p,(g+.5)/u),fillRule:c})}return h}function oo(t,e,n){let o=eo(t,e),r="stroke"in t&&t.stroke?{stroke:n(t.stroke.color),strokeWidth:t.stroke.width*e}:void 0;if(typeof t.fill=="object"&&"gradient"in t.fill){let c=ro(o,t.fill.gradient,n);return r?[...c,{...o,fill:"none",...r}]:c}return[{...o,fill:n(t.fill),...r}]}function io(t,e){let n=Math.min(t.maxLength??k.maxTextLength,k.maxTextLength),o=t.slot==="primary"?e.text??t.text:t.slot==="secondary"?e.secondaryText??t.text:t.text;return de(o,n)}function ao(t){return t===void 0||!Number.isFinite(t)?1:Math.min(xt,Math.max(oe,t))}function so(t,e,n,o,r,c){let s=r(t.color),i=t.weight==="regular"?{fontWeight:400}:{};if(t.type==="curved"){let{cx:h,cy:g,radius:x,side:d,spread:C=140}=t.curve,M=x*o*(C*Math.PI/180),F=Math.min(t.fontSize*o*n,M/(Me(e)+.08*e.length));return tn(e,h*o,g*o,x*o,F,d,s,c).map(P=>({...P,...i}))}let a=t.box.x*o,l=t.box.y*o,u=t.box.width*o,m=t.box.height*o;if(!(m>0))return[];let p=(t.fontSize??t.box.height*ge)*o,f=Math.min(p*n,m*Vt,u/Me(e)),y=t.align??"middle";return[{text:e,x:y==="start"?a:y==="end"?a+u:a+u/2,y:l+m/2+f*.35,fontSize:f,maxWidth:u,color:s,...y!=="middle"&&{align:y},...i,field:c}]}function lo(t){let e=0,n=0,o=0,r=0;return t.map(({command:c,values:s})=>{let i=c.toUpperCase(),a=c!==i;switch(i){case"Z":return e=o,n=r,{command:"Z",values:[]};case"H":return e=(a?e:0)+s[0],{command:"H",values:[e]};case"V":return n=(a?n:0)+s[0],{command:"V",values:[n]};case"A":return e=(a?e:0)+s[5],n=(a?n:0)+s[6],{command:"A",values:[...s.slice(0,5),e,n]};default:{let l=s.map((u,m)=>a?u+(m%2===0?e:n):u);return e=l.at(-2),n=l.at(-1),i==="M"&&(o=e,r=n),{command:i,values:l}}}})}function co(t,e){let n=Pt(t);return n?se(lo(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((c,s)=>s%2===1?e(c):c)})):t}function uo(t,e){let n=(o,r)=>{let c=e(o);return{y:c,height:e(o+r)-c}};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:co(t.d,e)};case"line":return{...t,y1:e(t.y1),y2:e(t.y2)};default:return{...t,y:e(t.y)}}}function mo(t,e){if(e.length===0)return t;let n=r=>{let c=r;for(let s of e)c-=Math.min(Math.max(r-s.y,0),s.height);return c},o=(r,c)=>e.some(s=>r>=s.y-1e-6&&c<=s.y+s.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:c}=ye(r);return!(c&&o(c.y0,c.y1))}).map(r=>uo(r,n)),labels:t.labels.map(r=>{if(r.type==="curved")return{...r,curve:{...r.curve,cy:n(r.curve.cy)}};let c=n(r.box.y);return{...r,box:{...r.box,y:c,height:n(r.box.y+r.box.height)-c}}})}}function Fe(t,e,n,o,r={}){let c=new Map(e.labels.map(g=>[g.id,io(g,n)])),s=mo(e,e.labels.flatMap(g=>g.collapse&&!c.get(g.id)?[g.collapse]:[])),i=t/s.qr.size,a=Wr(s,o),l=Kr(n,s,a.color),u=s.shapes.flatMap(g=>oo(g,i,l));if(a.plate){let g=Yt(s)*i;u.push({type:"rect",x:s.qr.x*i-g,y:s.qr.y*i-g,width:t+2*g,height:t+2*g,radius:(s.qr.radius??0)*i,fill:a.color})}let m=ao(n.fontScale),p=s.labels.flatMap(g=>{let x=c.get(g.id);if(!x)return[];let d=(g.slot==="fixed"?void 0:r[g.slot])??g.id;return so(g,x,m,i,l,d)}),f=p[0],y=f&&f.rotate===void 0?f:null,h=s.bleed??"none";return{width:s.artboard.width*i,height:s.artboard.height*i,qrX:s.qr.x*i,qrY:s.qr.y*i,qrSize:t,shapes:u,label:y,extraLabels:y?p.slice(1):p,squareEdges:h!=="none",color:l(h==="none"?"frame":h)}}function on(t,e,n){return Fe(t,Ee(e.spec),e,n)}var an={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 Ce={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 sn={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 ln={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 cn={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 un={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 mn={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 pn={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 dn={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 Jt={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 fn={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 hn={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 gn={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 yn={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 bn={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 xn={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 Sn={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 Mn={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 En={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 $=(t,e,n,o,r)=>({style:t,name:e,tags:r,labelOn:o,spec:n}),Fn=[$("banner-bottom","Banner",Ce,"frame",["bottom","band"]),$("banner-top","Top banner",sn,"frame",["top","band"]),$("banner-top-bottom","Two banners",ln,"frame",["top","bottom","band"]),$("border","Border",cn,"background",["square","outline"]),$("rounded-border","Rounded",yn,"background",["border","outline"]),$("gradient-border","Gradient",Jt,"background",["border","colorful"]),$("focus","Focus",dn,"background",["corners","brackets"]),$("speech-bubble","Bubble",bn,"frame",["speech"]),$("speech-bubble-top","Bubble top",xn,"frame",["speech"]),$("chat-bubble","Chat",un,"frame",["message","bubble"]),$("circle","Circle",mn,"frame",["round","ring","curved"]),$("badge","Ribbon",an,"frame",["badge","banner"]),$("sticker","Sticker",Sn,"frame",["label"]),$("polaroid","Polaroid",gn,"frame",["photo","picture"]),$("phone","Phone",hn,"background",["mobile","screen"]),$("ticket","Ticket",En,"frame",["event","pass"]),$("tag","Tag",Mn,"frame",["price","label"]),$("envelope","Envelope",pn,"frame",["mail","letter"]),$("menu-card","Menu card",fn,"background",["menu","restaurant"])],_o=new Map(Fn.map(t=>[t.style,t]));function To(t){return _o.get(t)}var ds=Object.fromEntries(Fn.map(t=>[t.style,t.spec])),fs={from:Jt.colors.frame,to:Jt.colors.accent};var $o={primary:"text",secondary:"secondaryText"};function Cn(t,e,n){let o=To(e.style)?.spec??Ce;return Fe(t,Ee(o),e,n,$o)}var No="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif";function An(t){return!!(t?.style&&t.style!=="none")}function wn(t,e,n){return e.style===pe?on(t,e,n):Cn(t,e,n)}function ko(t){return[...t.label?[t.label]:[],...t.extraLabels??[]]}function Ln(t,e){let n=({x:r,y:c,width:s,height:i,radius:a})=>{let l=Math.min(a,s/2,i/2);t.moveTo(r+l,c),t.arcTo(r+s,c,r+s,c+i,l),t.arcTo(r+s,c+i,r,c+i,l),t.arcTo(r,c+i,r,c,l),t.arcTo(r,c,r+s,c,l),t.closePath()},o=(r,c)=>{r.stroke&&r.strokeWidth&&(t.strokeStyle=r.stroke,t.lineWidth=r.strokeWidth,t.lineJoin="miter",t.miterLimit=4,c?t.stroke(c):t.stroke())};for(let r of e.shapes){let c=!(r.fill==="transparent"||r.fill==="none");if(c||r.stroke){if(t.fillStyle=r.fill,r.type==="path"){if(typeof Path2D<"u"){let s=new Path2D(r.d);c&&t.fill(s,r.fillRule??"nonzero"),o(r,s)}continue}t.beginPath(),r.type==="polygon"?(r.points.forEach(([s,i],a)=>{a===0?t.moveTo(s,i):t.lineTo(s,i)}),t.closePath(),c&&t.fill()):(n(r),r.hole&&n(r.hole),c&&t.fill("evenodd")),o(r)}}for(let r of ko(e))t.fillStyle=r.color,t.font=`${r.fontWeight??700} ${r.fontSize}px ${No}`,t.textAlign=r.align==="start"?"left":r.align==="end"?"right":"center",t.textBaseline="alphabetic",r.rotate?(t.save(),t.translate(r.x,r.y),t.rotate(r.rotate*Math.PI/180),t.fillText(r.text,0,0,r.maxWidth),t.restore()):t.fillText(r.text,r.x,r.y,r.maxWidth)}var Oo=.22,zo=.14;function Bo(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 Pe(t,e,n){if(t.beginPath(),e==="circle"){t.arc(n.x+n.w/2,n.y+n.h/2,Math.min(n.w,n.h)/2,0,Math.PI*2);return}let o=e==="rounded"?Math.min(n.w,n.h)*Oo:0;o>0&&typeof t.roundRect=="function"?t.roundRect(n.x,n.y,n.w,n.h,o):t.rect(n.x,n.y,n.w,n.h)}function In(t,e){return e?Bo(t,zo):t}var{QrCode:Re}=Q,qo={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function Do(t){let e=t*4+17,n=new Uint8Array(e*e),o=(s,i)=>{s>=0&&i>=0&&s<e&&i<e&&(n[i*e+s]=1)};for(let s=0;s<e;s++)o(6,s),o(s,6);for(let[s,i]of[[3,3],[e-4,3],[3,e-4]])for(let a=-4;a<=4;a++)for(let l=-4;l<=4;l++)o(s+l,i+a);let r=[];if(t>1){let s=Math.floor(t/7)+2,i=t===32?26:Math.ceil((t*4+4)/(s*2-2))*2;r.push(6);for(let a=e-7;r.length<s;a-=i)r.splice(1,0,a)}let c=r.length-1;for(let[s,i]of r.entries())for(let[a,l]of r.entries())if(!(s===0&&a===0||s===0&&a===c||s===c&&a===0))for(let u=-2;u<=2;u++)for(let m=-2;m<=2;m++)o(i+m,l+u);for(let s=0;s<=8;s++)o(8,s),o(s,8);for(let s=0;s<8;s++)o(e-1-s,8),o(8,e-1-s);if(t>=7)for(let s=0;s<18;s++){let i=e-11+s%3,a=Math.floor(s/3);o(i,a),o(a,i)}return n}function Go(t,e){let n=t*4+17,o=tt[e].ordinal,r=Re.NUM_ERROR_CORRECTION_BLOCKS[o]?.[t]??0,c=Re.ECC_CODEWORDS_PER_BLOCK[o]?.[t]??0,s=Math.floor(Re.getNumRawDataModules(t)/8),i=r-s%r,a=Math.floor(s/r),l=Array.from({length:r},(M,F)=>a+(F<i?0:1)),u=[],m=[],p=a-c;for(let M=0;M<=a;M++)for(let F=0;F<r;F++)if(F<i){if(M===p)continue;u.push(F),m.push(M<p?M:M-1)}else u.push(F),m.push(M);if(u.length!==s)throw new Error(`Codeword map: interleave mismatch at version ${t}`);let f=Do(t),y=new Int16Array(n*n).fill(-1),h=new Int16Array(n*n).fill(-1),g=new Int8Array(n*n).fill(-1),x=s*8,d=0;for(let M=n-1;M>=1;M-=2){M===6&&(M=5);let F=(M+1&2)===0;for(let P=0;P<n;P++)for(let E=0;E<2;E++){let I=M-E,N=(F?n-1-P:P)*n+I;if(!f[N]&&d<x){let B=d>>>3;y[N]=u[B],h[N]=m[B],g[N]=7-(d&7),d++}}}if(d!==x)throw new Error(`Codeword map: placement mismatch at version ${t}`);let C=qo[`${t}${e}`]??0;return{version:t,level:e,size:n,blocks:r,eccPerBlock:c,blockLengths:l,correctable:Math.floor((c-C)/2),block:y,codeword:h,bit:g}}var Qo=8,ct=new Map;function vn(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=ct.get(n);if(o)return ct.delete(n),ct.set(n,o),o;let r=Go(t,e);if(ct.size>=Qo){let c=ct.keys().next().value;c!==void 0&&ct.delete(c)}return ct.set(n,r),r}function _n(t,e){let n=new Array(t.blocks).fill(0),o=new Set;for(let r of e){let c=t.block[r]??-1;if(c<0)continue;let s=c*4096+t.codeword[r];o.has(s)||(o.add(s),n[c]=n[c]+1)}return n}import{z as R}from"zod";import{z as X}from"zod";var Uo=["logo","halftone"],Ho=X.enum(Uo),Tn={logo:["blend","badge"],halftone:["color","mono"]},Vo=X.enum([...Tn.logo,...Tn.halftone]),te=192,$n=t=>Math.ceil(t/3)*4,Yo=X.object({width:X.number().int().min(1).max(te),height:X.number().int().min(1).max(te),data:X.string().max($n(te*te*4))}).refine(t=>t.data.length===$n(t.width*t.height*4),{message:"Art image data does not match its width and height"}),Nn=X.object({mode:Ho,image:Yo,intensity:X.number().min(0).max(1).optional(),variant:Vo.optional(),matchEyes:X.boolean().optional()});import{z as L}from"zod";var Ts=L.enum(["solid","linear","radial","angular","image"]),jo=L.object({type:L.literal("solid"),color:L.string()}),Ae=L.object({color:L.string(),offset:L.number().min(0).max(100)}),Zo=L.object({type:L.literal("linear"),stops:L.array(Ae).min(2),angle:L.number().optional().default(0)}),Xo=L.object({type:L.literal("radial"),stops:L.array(Ae).min(2)}),Wo=L.object({type:L.literal("angular"),stops:L.array(Ae).min(2),angle:L.number().optional().default(0)}),Ko=L.enum(["cover","contain","tile"]),Jo=L.enum(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]),ti=L.object({type:L.literal("image"),src:L.string().min(1),fit:Ko.optional().default("cover"),scale:L.number().min(.1).max(4).optional().default(1),position:Jo.optional().default("center"),opacity:L.number().min(0).max(1).optional().default(1),underlay:L.string().optional()}),ut=L.union([L.string(),jo,Zo,Xo,Wo,ti]);import{z as kn}from"zod";var On=["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"],ei=["diamond","star","banner"],zn=kn.enum([...On,...ei]),ks=kn.enum(On);import{z as Bn}from"zod";var qn=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],ni=["curly"],Dn=Bn.enum([...qn,...ni]),Bs=Bn.enum(qn);import{z as ri}from"zod";var oi=["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"],Gn=ri.enum(oi);var ii=["square","rounded","circle"],Qn=R.enum(ii),ai=R.object({src:R.string(),height:R.number(),width:R.number(),excavate:R.boolean(),x:R.number().optional(),y:R.number().optional(),padding:R.number().min(0).optional(),shape:Qn.optional(),plate:R.string().optional()}),si=.1,li=.3;var ci=2,Xs=R.object({size:R.number().min(si).max(li).optional(),padding:R.number().min(0).max(ci).optional(),x:R.number().min(0).max(1).optional(),y:R.number().min(0).max(1).optional(),shape:Qn.optional(),plate:R.string().optional()}),ui=R.enum(["L","M","Q","H"]),mi=.5,pi=1,Un=.07,di=["square","circle","heart"],fi=R.enum(di),Hn=3,mt=64,vt=8,Vn=.42,hi=R.object({type:R.literal("silhouette"),width:R.number().int().min(vt).max(mt),height:R.number().int().min(vt).max(mt),cells:R.string().max(mt*mt).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"}),gi=R.union([fi,hi]);var we=R.object({outer:ut.optional(),inner:ut.optional()}),yi=R.object({topLeft:we.optional(),topRight:we.optional(),bottomLeft:we.optional()}),Ws=R.object({value:R.string(),size:R.number().optional(),level:ui.optional(),bgColor:ut.optional(),fgColor:ut.optional(),eyeColor:ut.optional(),dotColor:ut.optional(),bodyPattern:Gn.optional(),cornerEyePattern:Dn.optional(),cornerEyeDotPattern:zn.optional(),margin:R.number().optional(),imageSettings:ai.optional(),isOGContext:R.boolean().optional(),templateId:R.string().optional(),customProps:R.record(R.string(),R.any()).optional(),frame:Ye.optional(),art:Nn.optional(),eyeColors:yi.optional(),moduleScale:R.number().min(mi).max(pi).optional(),autoLevel:R.boolean().optional(),shape:gi.optional()});var bi={2:6,3:12};function Yn(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 c=bi[o.length];for(let s=1;s<=c;s++){let i=s/c,a=1-i;if(o.length===2){let[l]=o;e.push([a*a*n[0]+2*a*i*l[0]+i*i*r[0],a*a*n[1]+2*a*i*l[1]+i*i*r[1]])}else{let[l,u]=o;e.push([a*a*a*n[0]+3*a*a*i*l[0]+3*a*i*i*u[0]+i*i*i*r[0],a*a*a*n[1]+3*a*a*i*l[1]+3*a*i*i*u[1]+i*i*i*r[1]])}}}n=r}return e}function Zn(t,e){let n=[];for(let o of t)for(let r=0;r<o.length;r++){let[c,s]=o[r],[i,a]=o[(r+1)%o.length];s<=e!=a<=e&&n.push(c+(e-s)/(a-s)*(i-c))}return n.sort((o,r)=>o-r)}function Xn(t,e){let n=0;for(let o of t)if(o<e)n++;else break;return n%2===1}function xi(t,e,n){return Xn(Zn(t,n),e)}function Wn(t){let e=new Map;return(n,o)=>{let r=e.get(o);return r||(r=Zn(t,o),e.set(o,r)),Xn(r,n)}}function Si(t,e,n,o){let r=n[0]-t,c=n[1]-e,s=o[0]-n[0],i=o[1]-n[1],a=u=>Math.max(Math.abs(r+u*s),Math.abs(c+u*i)),l=Math.min(a(0),a(1));for(let[u,m]of[[c-r,s-i],[-(r+c),s+i]])if(m!==0){let p=u/m;p>0&&p<1&&(l=Math.min(l,a(p)))}return l}function Mi(t,e,n){if(!xi(t,e,n))return 0;let o=Number.POSITIVE_INFINITY;for(let r of t)for(let c=0;c<r.length;c++)o=Math.min(o,Si(e,n,r[c],r[(c+1)%r.length]));return Number.isFinite(o)?o:0}function Ei(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let c of t)for(let[s,i]of c)e=Math.min(e,s),n=Math.min(n,i),o=Math.max(o,s),r=Math.max(r,i);return{x0:e,y0:n,x1:o,y1:r}}function Kn(t){let e=t.map(Yn),n=Ei(e),o=n.x1-n.x0,r=n.y1-n.y0;if(!(o>0&&r>0))return null;let c=(y,h)=>{let g=Math.max(y-n.x0,n.x1-y,h-n.y0,n.y1-h);return g>0?Mi(e,y,h)/(2*g):0},s={cx:n.x0+o/2,cy:n.y0+r/2,value:0};s.value=c(s.cx,s.cy);let i=32;for(let y=1;y<i;y++)for(let h=1;h<i;h++){let g=n.x0+o*h/i,x=n.y0+r*y/i,d=c(g,x);d>s.value&&(s={cx:g,cy:x,value:d})}let a=o/i,l=r/i;for(let y=0;y<6;y++){let h=s;for(let g=-2;g<=2;g++)for(let x=-2;x<=2;x++){let d=h.cx+a*x/2,C=h.cy+l*g/2,M=c(d,C);M>s.value&&(s={cx:d,cy:C,value:M})}a/=2,l/=2}if(s.value<=0)return null;let m=.5/Math.max(s.cx-n.x0,n.x1-s.cx,s.cy-n.y0,n.y1-s.cy),p=([y,h])=>[.5+(y-s.cx)*m,.5+(h-s.cy)*m],f=t.map(y=>({start:p(y.start),segments:y.segments.map(h=>h.map(p))}));return{rings:f,polygons:f.map(Yn),half:s.value}}function Jn(t,e){let n=([r,c])=>`${b(r*e)} ${b(c*e)}`,o="";for(let r of t.rings){o+=`M${n(r.start)}`;for(let c of r.segments){let s=c.length===1?"L":c.length===2?"Q":"C";o+=s+c.map(n).join(" ")}o+="Z"}return o}var Fi={start:[0,-.58],segments:[[[.2,-.92],[1,-.97],[1,-.3]],[[1,.3],[.62,.6],[0,.92]],[[-.62,.6],[-1,.3],[-1,-.3]],[[-1,-.97],[-.2,-.92],[0,-.58]]]},jn;function tr(){return jn??=Kn([Fi]),jn}function Ci(t){let{width:e,height:n,cells:o}=t;return Number.isInteger(e)&&Number.isInteger(n)&&e>=vt&&n>=vt&&e<=mt&&n<=mt&&typeof o=="string"&&o.length===e*n&&/^[01]*$/.test(o)?(r,c)=>r>=0&&c>=0&&r<e&&c<n&&o[c*e+r]==="1":null}var W=([t,e])=>`${t},${e}`;function Pi(t,e,n){let o=(a,l)=>t(a-1,l-1),r=new Map,c=(a,l)=>{for(let[u,m]of[[a,l],[l,a]]){let p=r.get(W(u))??[];p.push(m),r.set(W(u),p)}};for(let a=0;a<=n;a++)for(let l=0;l<=e;l++){let u=o(l,a),m=o(l+1,a),p=o(l+1,a+1),f=o(l,a+1),y=[l,a-.5],h=[l+.5,a],g=[l,a+.5],x=[l-.5,a];switch((u?8:0)+(m?4:0)+(p?2:0)+(f?1:0)){case 1:case 14:c(x,g);break;case 2:case 13:c(g,h);break;case 3:case 12:c(x,h);break;case 4:case 11:c(y,h);break;case 6:case 9:c(y,g);break;case 7:case 8:c(x,y);break;case 5:c(y,h),c(x,g);break;case 10:c(x,y),c(g,h);break;default:break}}let s=[],i=new Set;for(let[a,l]of r){if(i.has(a)||l.length===0)continue;let[u,m]=a.split(",").map(Number),p=[[u,m]];i.add(a);let f=[u,m],y=l[0];for(;!i.has(W(y));){i.add(W(y)),p.push(y);let h=Ri(r.get(W(y))??[],f,i);if(!h)break;f=y,y=h}p.length>=3&&s.push(Ai(p))}return s}function Ri(t,e,n){let o=W(e);return t.find(r=>W(r)!==o&&!n.has(W(r)))??t.find(r=>W(r)!==o)}function Ai(t){let e=[];for(let n=0;n<t.length;n++){let o=t[(n-1+t.length)%t.length],r=t[n],c=t[(n+1)%t.length],s=(r[0]-o[0])*(c[1]-r[1])-(r[1]-o[1])*(c[0]-r[0]);Math.abs(s)>1e-9&&e.push(r)}return e.length>=3?e:t}function wi(t){let e=(c,s)=>[(c[0]+s[0])/2,(c[1]+s[1])/2],n=t.length,o=e(t[n-1],t[0]),r=t.map((c,s)=>[c,e(c,t[(s+1)%n])]);return{start:o,segments:r}}var _t=new Map;function er(t){let e=`${t.width}x${t.height}:${t.cells}`,n=_t.get(e);if(n)return n;let o=Ci(t),r;if(!o)r={outline:null,problem:"invalid"};else if(t.cells.includes("1")){let c=Pi(o,t.width,t.height),s=c.length>0?Kn(c.map(wi)):null;r=s&&2*s.half>=Vn?{outline:s,problem:null}:{outline:null,problem:s?"thin":"empty"}}else r={outline:null,problem:"empty"};return _t.size>16&&_t.delete(_t.keys().next().value),_t.set(e,r),r}var Li=1,nr=.5,rr=.5,Ii=.5;function ee(t){return Math.max(t,Hn)}function Le(t){return t==="heart"?tr():typeof t=="object"&&t?.type==="silhouette"?er(t).outline:null}function ot(t,e,n){if(n==="circle"){let s=ee(e),i=(t/2+s)*Math.SQRT2+Li;return Math.ceil(i-t/2)}let o=Le(n);if(!o)return e;let r=ee(e),c=(t+2*(r+Ii))/(2*o.half);return Math.ceil((c-t)/2-1e-9)}function or(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 vi(t,e,n){let o=ot(e,n,"circle"),r=ee(n),c=e+2*o,s=c/2,i=s-nr-.5,a=or(Number.parseInt(xe(t),36)||1),l=o-r,u=o+e+r;return Array.from({length:c},(m,p)=>Array.from({length:c},(f,y)=>{let h=a()<rr;return y>=l&&y<u&&p>=l&&p<u?!1:h&&Math.hypot(y+.5-s,p+.5-s)<=i}))}var _i=Array.from({length:8},(t,e)=>{let n=e*Math.PI/4;return[Math.cos(n),Math.sin(n)]});function Ie(t,e,n,o){if(o==="circle")return vi(t,e,n);let r=Le(o);if(!r)return null;let c=ot(e,n,o),s=ee(n),i=e+2*c,a=Wn(r.polygons),l=.5+nr,u=(y,h)=>{let g=y+.5,x=h+.5;return a(g/i,x/i)?_i.every(([d,C])=>a((g+d*l)/i,(x+C*l)/i)):!1},m=or(Number.parseInt(xe(t),36)||1),p=c-s,f=c+e+s;return Array.from({length:i},(y,h)=>Array.from({length:i},(g,x)=>{let d=m()<rr;return x>=p&&x<f&&h>=p&&h<f?!1:d&&u(x,h)}))}function ve(t,e){if(t==="circle")return{circle:e/2};let n=Le(t);return n?{path:Jn(n,e)}:null}function ir(t,e){return t.slice().map((n,o)=>o<e.y||o>=e.y+e.h?n:n.map((r,c)=>c<e.x||c>=e.x+e.w?r:!1))}function _e(t,e=0){let n=[];return t.forEach((o,r)=>{let c=null;o.forEach((s,i)=>{if(!s&&c!==null){n.push(Gt`M${c+e} ${r+e}h${i-c}v1H${c+e}z`),c=null;return}if(i===o.length-1){if(!s)return;c===null?n.push(Gt`M${i+e},${r+e} h1v1H${i+e}z`):n.push(Gt`M${c+e},${r+e} h${i+1-c}v1H${c+e}z`);return}s&&c===null&&(c=i)})}),n.join("")}function Tt(t,e,n,o){if(o==null)return null;let r=t.length,c=Math.floor(e*Dt),s=(r+2*n)/e,i=(o.width||c)*s,a=(o.height||c)*s,l=o.x==null?r/2-i/2:o.x*s,u=o.y==null?r/2-a/2:o.y*s,m=null;if(o.excavate){let p=Math.max(0,o.padding??0)*s,f=Math.floor(l-p),y=Math.floor(u-p),h=Math.ceil(i+l+p-f),g=Math.ceil(a+u+p-y);m={x:f,y,w:h,h:g}}return{x:l,y:u,h:a,w:i,excavation:m}}function ne(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=Q.QrCode.encodeText(t.value,tt[o]).getModules(),c=Tt(r,t.size??zt,ot(r.length,t.margin??qt,t.shape),n);c&&(c.excavation?c.excavation.w*c.excavation.h:c.w*c.h)/(r.length*r.length)>Un&&(o="H")}return o}var Te=(()=>{try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})();var Ti=.6,$i=["L","M","Q","H"];function Ni(t){let e=Q.QrCode.encodeText(t.value,tt[t.level]),n=$i[e.errorCorrectionLevel.ordinal]??t.level;return{code:t,cells:e.getModules(),layoutMargin:ot(e.size,t.margin,t.shape),map:vn(e.version,n),level:n,version:e.version}}function ki(t,e){let{cells:n,map:o}=t,r=n.length,c=Tt(n,t.code.size,t.layoutMargin,e);if(!c)return null;let s=c.excavation??{x:Math.floor(c.x),y:Math.floor(c.y),w:Math.ceil(c.x+c.w)-Math.floor(c.x),h:Math.ceil(c.y+c.h)-Math.floor(c.y)},i=[];for(let l=Math.max(0,s.y);l<Math.min(r,s.y+s.h);l++)for(let u=Math.max(0,s.x);u<Math.min(r,s.x+s.w);u++)i.push(l*r+u);let a=_n(o,i);return{worst:Math.max(0,...a),correctable:o.correctable,budget:Math.floor(o.correctable*Ti),level:t.level,version:t.version}}var Oi=t=>!t||t.worst<=t.budget;function zi(t,e,n,o){let r=e.map(i=>Ni({...t,level:i})),c=i=>{let a=o(i);return r.every(l=>Oi(ki(l,a)))};if(c(n))return n;let s=t.size*.005;for(let i=n-s;i>0;i-=s)if(c(i))return i;return 0}function ar(t,e){if(!e)return;let n=Math.floor(t.size*Dt),o=e.width||n,r=e.height||n,c=p=>{if(p===o)return e;let f=r*p/o;return{...e,width:p,height:f,...e.x!=null&&{x:e.x+(o-p)/2},...e.y!=null&&{y:e.y+(r-f)/2}}},s=t.level??yt,i={value:t.value,size:t.size,margin:t.margin,shape:t.shape},a=p=>ne({...t,level:s,imageSettings:p}),l=p=>{let f=zi(i,[p],o,c);return f>0?c(f):void 0},u=a(e);if(u===s)return l(s);let m=l(u);return m&&a(m)===u?m:l(s)}import{Fragment as Di,jsx as lr,jsxs as Gi}from"react/jsx-runtime";function Il(t){let{value:e,size:n=zt,level:o=yt,bgColor:r=et,fgColor:c=Bt,margin:s=qt,style:i,imageSettings:a,eyeColor:l,dotColor:u,bodyPattern:m,cornerEyePattern:p,cornerEyeDotPattern:f,isOGContext:y,templateId:h,customTemplate:g,customProps:x,frame:d,art:C,eyeColors:M,moduleScale:F,frameLabelMarkers:P,partMarkers:E,autoLevel:I,shape:w,...N}=t,B=ar({value:e,size:n,margin:s,level:o,shape:w,autoLevel:I},a),H=ne({value:e,size:n,level:o,margin:s,imageSettings:B,autoLevel:I,shape:w}),Y=B?.src,D=An(d)?wn(n,d,r):null,K=D?.width??n,it=D?.height??n,pt=sr(null),G=sr(null),[U,V]=qi(!1);Bi(()=>{if(pt.current!=null){let Et=pt.current,v=Et.getContext("2d");if(!v)return;let j=Q.QrCode.encodeText(e,tt[H]).getModules(),J=ot(j.length,s,w),re=Ie(e,j.length,s,w),ft=j.length+J*2,at=Tt(j,n,J,B),Nt=G.current,$e=at!=null&&Nt?.complete&&Nt.naturalHeight!==0&&Nt.naturalWidth!==0;$e&&at.excavation!=null&&(j=ir(j,at.excavation));let kt=window.devicePixelRatio||1;Et.width=K*kt,Et.height=it*kt,v.scale(kt,kt),D&&(Ln(v,D),v.translate(D.qrX,D.qrY));let Ne=n/ft;v.scale(Ne,Ne),v.fillStyle=It(r,et);let Ft=ve(w,ft);if(Ft&&"circle"in Ft?(v.beginPath(),v.arc(ft/2,ft/2,Ft.circle,0,2*Math.PI),v.fill()):Ft&&Te?v.fill(new Path2D(Ft.path),"evenodd"):v.fillRect(0,0,ft,ft),v.fillStyle=It(c,Bt),Te)v.fill(new Path2D(_e(j,J))),re&&v.fill(new Path2D(_e(re,0)));else for(let[Ot,ht]of[[j,J],[re??[],0]])Ot.forEach((Ct,st)=>{Ct.forEach((cr,ur)=>{cr&&v.fillRect(ur+ht,st+ht,1,1)})});if($e){let Ot={x:at.x+J,y:at.y+J,w:at.w,h:at.h},ht=B?.shape??"square",Ct=B?.plate,st=In(Ot,Ct);v.save(),Ct&&(Pe(v,ht,Ot),v.fillStyle=Ct,v.fill()),ht!=="square"&&(Pe(v,ht,st),v.clip()),v.drawImage(Nt,st.x,st.y,st.w,st.h),v.restore()}}});let dt={height:it,width:K,...i},$t=null;return Y!=null&&($t=lr("img",{alt:"QR code",onLoad:()=>{V(!0)},ref:G,src:Y,style:{display:"none"}},Y)),Gi(Di,{children:[lr("canvas",{height:it,ref:pt,style:dt,width:K,...N}),$t]})}export{Il as QRCodeCanvas};
|
|
2
2
|
/**
|
|
3
3
|
* @license QR Code generator library (TypeScript)
|
|
4
4
|
* Copyright (c) Project Nayuki.
|