qrdx 0.0.50 → 0.0.51
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 +111 -3
- package/dist/core.js +31 -0
- package/dist/core.js.map +1 -0
- package/dist/core.mjs +31 -0
- package/dist/core.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/node.js +2 -5
- package/dist/node.js.map +1 -1
- package/dist/node.mjs +2 -5
- package/dist/node.mjs.map +1 -1
- 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/src/api.d.ts +8 -2
- package/dist/src/api.d.ts.map +1 -1
- package/dist/src/art.d.ts +4 -3
- package/dist/src/art.d.ts.map +1 -1
- package/dist/src/body-patterns.d.ts +3 -2
- package/dist/src/body-patterns.d.ts.map +1 -1
- package/dist/src/core.d.ts +5 -0
- package/dist/src/core.d.ts.map +1 -0
- package/dist/src/corner-dot.d.ts +3 -2
- package/dist/src/corner-dot.d.ts.map +1 -1
- package/dist/src/engine.d.ts +44 -0
- package/dist/src/engine.d.ts.map +1 -0
- package/dist/src/export.d.ts +5 -0
- package/dist/src/export.d.ts.map +1 -0
- package/dist/src/frame.d.ts +6 -4
- package/dist/src/frame.d.ts.map +1 -1
- package/dist/src/frames/catalogue/all.d.ts.map +1 -1
- package/dist/src/frames/catalogue/automotive.d.ts +5 -0
- package/dist/src/frames/catalogue/automotive.d.ts.map +1 -0
- package/dist/src/frames/catalogue/beauty-wellness.d.ts +5 -0
- package/dist/src/frames/catalogue/beauty-wellness.d.ts.map +1 -0
- package/dist/src/frames/catalogue/business.d.ts.map +1 -1
- package/dist/src/frames/catalogue/call-to-action.d.ts.map +1 -1
- package/dist/src/frames/catalogue/counts.d.ts +12 -7
- package/dist/src/frames/catalogue/counts.d.ts.map +1 -1
- package/dist/src/frames/catalogue/food-drink.d.ts.map +1 -1
- package/dist/src/frames/catalogue/health-learning.d.ts.map +1 -1
- package/dist/src/frames/catalogue/index.d.ts.map +1 -1
- package/dist/src/frames/catalogue/nonprofit.d.ts +5 -0
- package/dist/src/frames/catalogue/nonprofit.d.ts.map +1 -0
- package/dist/src/frames/catalogue/places.d.ts.map +1 -1
- package/dist/src/frames/catalogue/real-estate.d.ts +5 -0
- package/dist/src/frames/catalogue/real-estate.d.ts.map +1 -0
- package/dist/src/frames/catalogue/shopping.d.ts.map +1 -1
- package/dist/src/frames/catalogue/sports-fitness.d.ts +5 -0
- package/dist/src/frames/catalogue/sports-fitness.d.ts.map +1 -0
- package/dist/src/frames/catalogue/tags.d.ts.map +1 -1
- package/dist/src/frames/collections.d.ts.map +1 -1
- package/dist/src/frames/official-types.d.ts +1 -1
- package/dist/src/frames/official-types.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -38
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/jsx/index.d.ts +2 -0
- package/dist/src/jsx/index.d.ts.map +1 -0
- package/dist/src/jsx/jsx-dev-runtime.d.ts +5 -0
- package/dist/src/jsx/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/src/jsx/jsx-runtime.d.ts +30 -0
- package/dist/src/jsx/jsx-runtime.d.ts.map +1 -0
- package/dist/src/jsx/runtime.d.ts +73 -0
- package/dist/src/jsx/runtime.d.ts.map +1 -0
- package/dist/src/logo.d.ts +3 -2
- package/dist/src/logo.d.ts.map +1 -1
- package/dist/src/node.d.ts.map +1 -1
- package/dist/src/plain.d.ts +31 -0
- package/dist/src/plain.d.ts.map +1 -0
- package/dist/src/qr-code-canvas.d.ts +1 -1
- package/dist/src/qr-code-canvas.d.ts.map +1 -1
- package/dist/src/qr-code-props.d.ts +22 -0
- package/dist/src/qr-code-props.d.ts.map +1 -0
- package/dist/src/qr-code-svg.d.ts +10 -0
- package/dist/src/qr-code-svg.d.ts.map +1 -0
- package/dist/src/qr-code.d.ts +2 -10
- package/dist/src/qr-code.d.ts.map +1 -1
- package/dist/src/react-elements.d.ts +3 -0
- package/dist/src/react-elements.d.ts.map +1 -0
- package/dist/src/render/attributes.d.ts +33 -0
- package/dist/src/render/attributes.d.ts.map +1 -0
- package/dist/src/render/dom.d.ts +8 -0
- package/dist/src/render/dom.d.ts.map +1 -0
- package/dist/src/render/hyperscript.d.ts +10 -0
- package/dist/src/render/hyperscript.d.ts.map +1 -0
- package/dist/src/render/string.d.ts +8 -0
- package/dist/src/render/string.d.ts.map +1 -0
- package/dist/src/svg.d.ts +14 -0
- package/dist/src/svg.d.ts.map +1 -0
- package/dist/src/template/arrow.d.ts +1 -0
- package/dist/src/template/arrow.d.ts.map +1 -1
- package/dist/src/template/default.d.ts +1 -0
- package/dist/src/template/default.d.ts.map +1 -1
- package/dist/src/template/halloween.d.ts +1 -0
- package/dist/src/template/halloween.d.ts.map +1 -1
- package/dist/src/template/square-border.d.ts +1 -0
- package/dist/src/template/square-border.d.ts.map +1 -1
- package/dist/src/template/standard-box.d.ts +1 -0
- package/dist/src/template/standard-box.d.ts.map +1 -1
- package/dist/src/template/striked-box.d.ts +1 -0
- package/dist/src/template/striked-box.d.ts.map +1 -1
- package/dist/src/utils.d.ts +9 -3
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/vanilla-api.d.ts +47 -0
- package/dist/src/vanilla-api.d.ts.map +1 -0
- package/dist/src/vanilla-browser.d.ts +4 -0
- package/dist/src/vanilla-browser.d.ts.map +1 -0
- package/dist/src/vanilla.d.ts +4 -0
- package/dist/src/vanilla.d.ts.map +1 -0
- package/dist/src/vue.d.ts +56 -0
- package/dist/src/vue.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -2
- package/dist/types/index.mjs +2 -2
- package/dist/types/public.d.ts +3 -0
- package/dist/types/public.d.ts.map +1 -0
- package/dist/types/qr.d.ts +17 -4
- package/dist/types/qr.d.ts.map +1 -1
- package/dist/types/react.d.ts +5 -0
- package/dist/types/react.d.ts.map +1 -0
- package/dist/types/template.d.ts +7 -1
- package/dist/types/template.d.ts.map +1 -1
- package/dist/vanilla.browser.mjs +92 -0
- package/dist/vanilla.browser.mjs.map +1 -0
- package/dist/vanilla.js +2 -0
- package/dist/vanilla.js.map +1 -0
- package/dist/vanilla.mjs +2 -0
- package/dist/vanilla.mjs.map +1 -0
- package/dist/vue.js +2 -0
- package/dist/vue.js.map +1 -0
- package/dist/vue.mjs +2 -0
- package/dist/vue.mjs.map +1 -0
- package/package.json +52 -6
- package/src/api.tsx +16 -140
- package/src/art.tsx +18 -16
- package/src/body-patterns.tsx +5 -3
- package/src/core.ts +13 -0
- package/src/corner-dot.tsx +4 -2
- package/src/download.tsx +1 -1
- package/src/engine.ts +170 -0
- package/src/export.ts +212 -0
- package/src/frame.tsx +7 -6
- package/src/frames/catalogue/all.ts +606 -0
- package/src/frames/catalogue/automotive.ts +61 -0
- package/src/frames/catalogue/beauty-wellness.ts +61 -0
- package/src/frames/catalogue/business.ts +68 -0
- package/src/frames/catalogue/call-to-action.ts +60 -0
- package/src/frames/catalogue/counts.ts +12 -7
- package/src/frames/catalogue/food-drink.ts +78 -0
- package/src/frames/catalogue/health-learning.ts +62 -14
- package/src/frames/catalogue/index.ts +2440 -16
- package/src/frames/catalogue/nonprofit.ts +65 -0
- package/src/frames/catalogue/places.ts +0 -18
- package/src/frames/catalogue/real-estate.ts +79 -0
- package/src/frames/catalogue/shopping.ts +68 -0
- package/src/frames/catalogue/sports-fitness.ts +81 -0
- package/src/frames/catalogue/tags.ts +354 -0
- package/src/frames/collections.ts +5 -0
- package/src/frames/official/add-engraving.json +90 -0
- package/src/frames/official/add-to-calendar.json +98 -0
- package/src/frames/official/adopt-me.json +72 -0
- package/src/frames/official/aftercare-guide.json +98 -0
- package/src/frames/official/alterations.json +142 -0
- package/src/frames/official/annual-report.json +85 -0
- package/src/frames/official/archery-lesson.json +106 -0
- package/src/frames/official/arrival-guide.json +71 -0
- package/src/frames/official/art-class.json +137 -0
- package/src/frames/official/ask-a-stylist.json +112 -0
- package/src/frames/official/assembly-guide.json +93 -0
- package/src/frames/official/badminton-session.json +104 -0
- package/src/frames/official/bake-sale.json +158 -0
- package/src/frames/official/bakery-board.json +80 -0
- package/src/frames/official/barber-booking.json +64 -0
- package/src/frames/official/bath-ritual.json +70 -0
- package/src/frames/official/bathroom-showroom.json +113 -0
- package/src/frames/official/battery-check.json +95 -0
- package/src/frames/official/beauty-rewards.json +81 -0
- package/src/frames/official/become-a-member.json +79 -0
- package/src/frames/official/bike-service.json +113 -0
- package/src/frames/official/book-a-call.json +105 -0
- package/src/frames/official/book-a-cleaning.json +92 -0
- package/src/frames/official/book-a-consultation.json +101 -0
- package/src/frames/official/book-a-court.json +74 -0
- package/src/frames/official/book-a-facial.json +108 -0
- package/src/frames/official/book-a-massage.json +80 -0
- package/src/frames/official/book-a-vaccine.json +88 -0
- package/src/frames/official/book-this-room.json +80 -0
- package/src/frames/official/boxing-class.json +81 -0
- package/src/frames/official/brewery-tour.json +89 -0
- package/src/frames/official/bridal-beauty.json +80 -0
- package/src/frames/official/brunch-menu.json +79 -0
- package/src/frames/official/bubble-tea.json +81 -0
- package/src/frames/official/bulk-orders.json +108 -0
- package/src/frames/official/burger-order.json +80 -0
- package/src/frames/official/call-a-server.json +115 -0
- package/src/frames/official/car-detailing.json +102 -0
- package/src/frames/official/car-details.json +90 -0
- package/src/frames/official/car-for-sale.json +74 -0
- package/src/frames/official/car-service.json +92 -0
- package/src/frames/official/carpool.json +79 -0
- package/src/frames/official/catering-order.json +79 -0
- package/src/frames/official/charging-prices.json +105 -0
- package/src/frames/official/charity-shop.json +75 -0
- package/src/frames/official/check-symptoms.json +80 -0
- package/src/frames/official/cheese-pairing.json +91 -0
- package/src/frames/official/chess-club.json +64 -0
- package/src/frames/official/chess-lessons.json +83 -0
- package/src/frames/official/choose-your-plan.json +113 -0
- package/src/frames/official/choose-your-wash.json +86 -0
- package/src/frames/official/clean-beauty.json +94 -0
- package/src/frames/official/click-and-collect.json +85 -0
- package/src/frames/official/clock-in.json +101 -0
- package/src/frames/official/club-fees.json +94 -0
- package/src/frames/official/coach-sign-up.json +108 -0
- package/src/frames/official/community-notices.json +107 -0
- package/src/frames/official/compare-specs.json +112 -0
- package/src/frames/official/consultation-form.json +120 -0
- package/src/frames/official/continued-online.json +81 -0
- package/src/frames/official/cookie-box.json +88 -0
- package/src/frames/official/cooking-class.json +89 -0
- package/src/frames/official/coworking-pass.json +89 -0
- package/src/frames/official/cricket-club.json +158 -0
- package/src/frames/official/cupcake-order.json +108 -0
- package/src/frames/official/damage-report.json +114 -0
- package/src/frames/official/dashboard-lights.json +106 -0
- package/src/frames/official/delivery-instructions.json +98 -0
- package/src/frames/official/diy-how-to.json +87 -0
- package/src/frames/official/donate-coats.json +74 -0
- package/src/frames/official/donate-food.json +80 -0
- package/src/frames/official/donation-jar.json +101 -0
- package/src/frames/official/donut-shop.json +94 -0
- package/src/frames/official/dress-fitting.json +64 -0
- package/src/frames/official/driving-lessons.json +110 -0
- package/src/frames/official/dumpling-house.json +82 -0
- package/src/frames/official/eye-exam.json +70 -0
- package/src/frames/official/eyewear-try-on.json +99 -0
- package/src/frames/official/fan-club.json +152 -0
- package/src/frames/official/farm-stand.json +109 -0
- package/src/frames/official/farmers-market.json +74 -0
- package/src/frames/official/find-a-charger.json +107 -0
- package/src/frames/official/find-a-doctor.json +85 -0
- package/src/frames/official/find-it-in-store.json +101 -0
- package/src/frames/official/find-our-office.json +80 -0
- package/src/frames/official/first-aid-guide.json +109 -0
- package/src/frames/official/fish-market.json +113 -0
- package/src/frames/official/fitness-challenge.json +1 -1
- package/src/frames/official/fitness-equipment.json +1 -1
- package/src/frames/official/fitness-kettlebell.json +1 -1
- package/src/frames/official/fitness-schedule.json +1 -1
- package/src/frames/official/fitness-test.json +94 -0
- package/src/frames/official/fitness-timer.json +1 -1
- package/src/frames/official/fitness-trial.json +1 -1
- package/src/frames/official/fitness-yoga.json +1 -1
- package/src/frames/official/food-support.json +102 -0
- package/src/frames/official/food-truck-location.json +80 -0
- package/src/frames/official/furnished-rental.json +101 -0
- package/src/frames/official/game-night.json +79 -0
- package/src/frames/official/garden-design.json +70 -0
- package/src/frames/official/garden-plot.json +74 -0
- package/src/frames/official/get-a-quote.json +113 -0
- package/src/frames/official/get-it-delivered.json +82 -0
- package/src/frames/official/get-started-rocket.json +80 -0
- package/src/frames/official/get-the-brochure.json +116 -0
- package/src/frames/official/gift-ideas.json +86 -0
- package/src/frames/official/gift-message.json +85 -0
- package/src/frames/official/give-blood.json +88 -0
- package/src/frames/official/giving-jar.json +89 -0
- package/src/frames/official/golf-scorecard.json +120 -0
- package/src/frames/official/grand-opening.json +158 -0
- package/src/frames/official/grill-menu.json +92 -0
- package/src/frames/official/hand-washing.json +106 -0
- package/src/frames/official/handyman.json +130 -0
- package/src/frames/official/hear-it-spoken.json +86 -0
- package/src/frames/official/home-valuation.json +87 -0
- package/src/frames/official/homework-help.json +79 -0
- package/src/frames/official/hot-shave.json +121 -0
- package/src/frames/official/house-rules.json +121 -0
- package/src/frames/official/how-it-works.json +98 -0
- package/src/frames/official/how-to-apply.json +93 -0
- package/src/frames/official/impact-report.json +90 -0
- package/src/frames/official/intake-forms.json +114 -0
- package/src/frames/official/join-a-league.json +94 -0
- package/src/frames/official/join-the-cleanup.json +110 -0
- package/src/frames/official/join-the-waitlist.json +102 -0
- package/src/frames/official/join-the-webinar.json +108 -0
- package/src/frames/official/juice-bar.json +70 -0
- package/src/frames/official/kids-haircuts.json +75 -0
- package/src/frames/official/kids-menu.json +107 -0
- package/src/frames/official/large-print.json +80 -0
- package/src/frames/official/lash-bar.json +86 -0
- package/src/frames/official/last-chance.json +94 -0
- package/src/frames/official/late-night-menu.json +77 -0
- package/src/frames/official/learn-the-signs.json +107 -0
- package/src/frames/official/library-card.json +90 -0
- package/src/frames/official/live-scores.json +101 -0
- package/src/frames/official/lost-and-found.json +85 -0
- package/src/frames/official/lost-pet-tag.json +84 -0
- package/src/frames/official/make-a-claim.json +74 -0
- package/src/frames/official/makeup-artist.json +94 -0
- package/src/frames/official/math-practice.json +136 -0
- package/src/frames/official/meal-plan.json +121 -0
- package/src/frames/official/meet-the-maker.json +91 -0
- package/src/frames/official/meet-the-team.json +82 -0
- package/src/frames/official/membership-card.json +108 -0
- package/src/frames/official/mortgage-calculator.json +94 -0
- package/src/frames/official/moving-checklist.json +108 -0
- package/src/frames/official/music-lessons.json +64 -0
- package/src/frames/official/nail-studio.json +70 -0
- package/src/frames/official/neighborhood-guide.json +98 -0
- package/src/frames/official/nutrition-facts.json +98 -0
- package/src/frames/official/online-class.json +82 -0
- package/src/frames/official/open-an-account.json +88 -0
- package/src/frames/official/open-house-sign-in.json +104 -0
- package/src/frames/official/parcel-room.json +98 -0
- package/src/frames/official/parent-meeting.json +108 -0
- package/src/frames/official/parking-permit.json +74 -0
- package/src/frames/official/pay-at-the-pump.json +108 -0
- package/src/frames/official/pay-for-parking.json +89 -0
- package/src/frames/official/pay-it-forward.json +102 -0
- package/src/frames/official/pay-your-rent.json +105 -0
- package/src/frames/official/permission-form.json +120 -0
- package/src/frames/official/personal-trainer.json +76 -0
- package/src/frames/official/physio-exercises.json +86 -0
- package/src/frames/official/pick-your-own.json +158 -0
- package/src/frames/official/plant-a-tree.json +88 -0
- package/src/frames/official/plant-based-menu.json +103 -0
- package/src/frames/official/plant-care.json +84 -0
- package/src/frames/official/podcast.json +107 -0
- package/src/frames/official/polling-place.json +109 -0
- package/src/frames/official/pool-timetable.json +113 -0
- package/src/frames/official/portfolio-card.json +110 -0
- package/src/frames/official/pre-order-bread.json +110 -0
- package/src/frames/official/press-kit.json +136 -0
- package/src/frames/official/price-list.json +111 -0
- package/src/frames/official/privacy-notice.json +115 -0
- package/src/frames/official/property-floor-plan.json +1 -1
- package/src/frames/official/property-for-sale.json +1 -1
- package/src/frames/official/property-house-light.json +1 -1
- package/src/frames/official/property-house.json +1 -1
- package/src/frames/official/property-key.json +1 -1
- package/src/frames/official/property-open-house.json +1 -1
- package/src/frames/official/property-rent.json +1 -1
- package/src/frames/official/property-virtual-tour.json +1 -1
- package/src/frames/official/questions-cloud.json +65 -0
- package/src/frames/official/race-entry.json +90 -0
- package/src/frames/official/race-photos.json +93 -0
- package/src/frames/official/rate-your-ride.json +103 -0
- package/src/frames/official/read-a-sample.json +108 -0
- package/src/frames/official/read-the-ebook.json +116 -0
- package/src/frames/official/read-the-faq.json +88 -0
- package/src/frames/official/read-the-reviews.json +110 -0
- package/src/frames/official/read-the-story.json +90 -0
- package/src/frames/official/read-the-transcript.json +142 -0
- package/src/frames/official/reading-challenge.json +97 -0
- package/src/frames/official/rebook-visit.json +86 -0
- package/src/frames/official/recipe-card.json +120 -0
- package/src/frames/official/refill-reminder.json +104 -0
- package/src/frames/official/register-interest.json +82 -0
- package/src/frames/official/register-to-vote.json +80 -0
- package/src/frames/official/renovation-quote.json +80 -0
- package/src/frames/official/rent-a-bike.json +95 -0
- package/src/frames/official/rent-this-item.json +95 -0
- package/src/frames/official/rental-car-guide.json +115 -0
- package/src/frames/official/report-a-problem.json +114 -0
- package/src/frames/official/report-a-repair.json +79 -0
- package/src/frames/official/report-a-street-issue.json +113 -0
- package/src/frames/official/request-maintenance.json +74 -0
- package/src/frames/official/resident-portal.json +98 -0
- package/src/frames/official/restaurant-gift-card.json +94 -0
- package/src/frames/official/restock-alert.json +98 -0
- package/src/frames/official/restroom-feedback.json +86 -0
- package/src/frames/official/return-your-cup.json +130 -0
- package/src/frames/official/return-your-rental.json +113 -0
- package/src/frames/official/ring-size.json +107 -0
- package/src/frames/official/roadside-help.json +92 -0
- package/src/frames/official/run-club.json +79 -0
- package/src/frames/official/safety-information.json +92 -0
- package/src/frames/official/salon-prices.json +92 -0
- package/src/frames/official/save-for-later.json +79 -0
- package/src/frames/official/scan-for-the-answer.json +86 -0
- package/src/frames/official/scan-for-the-checklist.json +108 -0
- package/src/frames/official/scan-for-the-latest.json +74 -0
- package/src/frames/official/scan-for-translations.json +108 -0
- package/src/frames/official/scan-here-arrow.json +76 -0
- package/src/frames/official/scan-here-post.json +89 -0
- package/src/frames/official/scan-me-banner.json +147 -0
- package/src/frames/official/scan-me-cloud.json +73 -0
- package/src/frames/official/scan-me-folded.json +74 -0
- package/src/frames/official/scan-me-stack.json +93 -0
- package/src/frames/official/scan-to-unlock.json +107 -0
- package/src/frames/official/scent-finder.json +94 -0
- package/src/frames/official/scholarships.json +108 -0
- package/src/frames/official/school-supply-list.json +80 -0
- package/src/frames/official/science-fair.json +89 -0
- package/src/frames/official/season-schedule.json +66 -0
- package/src/frames/official/see-more-stack.json +91 -0
- package/src/frames/official/see-our-pitch.json +85 -0
- package/src/frames/official/see-the-full-list.json +107 -0
- package/src/frames/official/see-the-map.json +79 -0
- package/src/frames/official/send-flowers.json +93 -0
- package/src/frames/official/service-times.json +115 -0
- package/src/frames/official/shade-finder.json +113 -0
- package/src/frames/official/shoe-size-check.json +95 -0
- package/src/frames/official/sign-rider.json +1 -1
- package/src/frames/official/sign-the-agreement.json +120 -0
- package/src/frames/official/sign-the-petition.json +120 -0
- package/src/frames/official/site-hoarding.json +158 -0
- package/src/frames/official/site-induction.json +120 -0
- package/src/frames/official/size-guide.json +80 -0
- package/src/frames/official/skate-park-rules.json +109 -0
- package/src/frames/official/skincare-routine.json +85 -0
- package/src/frames/official/sofa-fabric.json +84 -0
- package/src/frames/official/spa-gift.json +90 -0
- package/src/frames/official/spa-menu.json +124 -0
- package/src/frames/official/split-the-bill.json +77 -0
- package/src/frames/official/sponsor-a-pet.json +102 -0
- package/src/frames/official/sponsor-my-run.json +136 -0
- package/src/frames/official/sports-camp.json +142 -0
- package/src/frames/official/staff-handbook.json +121 -0
- package/src/frames/official/staff-rota.json +112 -0
- package/src/frames/official/start-a-return.json +92 -0
- package/src/frames/official/start-charging.json +104 -0
- package/src/frames/official/start-here-arrow.json +79 -0
- package/src/frames/official/start-saving.json +74 -0
- package/src/frames/official/storage-units.json +79 -0
- package/src/frames/official/student-portal.json +80 -0
- package/src/frames/official/style-gallery.json +111 -0
- package/src/frames/official/sushi-menu.json +115 -0
- package/src/frames/official/swim-lessons.json +70 -0
- package/src/frames/official/table-tennis.json +116 -0
- package/src/frames/official/take-a-closer-look.json +94 -0
- package/src/frames/official/takeout-order.json +98 -0
- package/src/frames/official/talk-to-someone.json +115 -0
- package/src/frames/official/talk-to-the-agent.json +115 -0
- package/src/frames/official/tea-menu.json +70 -0
- package/src/frames/official/tea-time.json +124 -0
- package/src/frames/official/team-jersey.json +77 -0
- package/src/frames/official/team-kit.json +85 -0
- package/src/frames/official/tee-time.json +85 -0
- package/src/frames/official/tennis-court.json +94 -0
- package/src/frames/official/test-drive.json +88 -0
- package/src/frames/official/test-results.json +85 -0
- package/src/frames/official/tire-change.json +74 -0
- package/src/frames/official/town-hall.json +158 -0
- package/src/frames/official/toy-finder.json +81 -0
- package/src/frames/official/trace-your-coffee.json +87 -0
- package/src/frames/official/trade-it-in.json +97 -0
- package/src/frames/official/try-the-demo.json +106 -0
- package/src/frames/official/unlock-this-car.json +82 -0
- package/src/frames/official/upload-receipts.json +108 -0
- package/src/frames/official/validate-parking.json +91 -0
- package/src/frames/official/vehicle-history.json +106 -0
- package/src/frames/official/virtual-try-on.json +93 -0
- package/src/frames/official/visiting-hours.json +90 -0
- package/src/frames/official/visitor-map.json +92 -0
- package/src/frames/official/visitor-sign-in.json +98 -0
- package/src/frames/official/volunteer.json +74 -0
- package/src/frames/official/vote-for-us.json +103 -0
- package/src/frames/official/walk-in-queue.json +102 -0
- package/src/frames/official/wash-club.json +81 -0
- package/src/frames/official/watch-repair.json +115 -0
- package/src/frames/official/watch-the-experiment.json +93 -0
- package/src/frames/official/water-refill.json +95 -0
- package/src/frames/official/weekly-deals.json +107 -0
- package/src/frames/official/wellness-retreat.json +85 -0
- package/src/frames/official/whats-inside.json +91 -0
- package/src/frames/official/wholesale.json +85 -0
- package/src/frames/official/window-quote.json +121 -0
- package/src/frames/official/wine-pairings.json +142 -0
- package/src/frames/official/wine-staff-pick.json +100 -0
- package/src/frames/official/winery-tasting.json +94 -0
- package/src/frames/official/yard-sign-coming-soon.json +115 -0
- package/src/frames/official/yard-sign-for-sale.json +150 -0
- package/src/frames/official/yard-sign-sold.json +162 -0
- package/src/frames/official/yard-sign-viewing.json +121 -0
- package/src/frames/official/your-prescription.json +107 -0
- package/src/frames/official/youth-club.json +104 -0
- package/src/frames/official-types.ts +6 -1
- package/src/frames/official.ts +4 -4
- package/src/index.tsx +6 -361
- package/src/jsx/index.ts +3 -0
- package/src/jsx/jsx-dev-runtime.ts +14 -0
- package/src/jsx/jsx-runtime.ts +34 -0
- package/src/jsx/runtime.ts +209 -0
- package/src/logo.tsx +5 -3
- package/src/node.ts +3 -3
- package/src/plain.tsx +194 -0
- package/src/qr-code-canvas.tsx +1 -1
- package/src/qr-code-props.ts +115 -0
- package/src/qr-code-svg.tsx +17 -0
- package/src/qr-code.tsx +34 -114
- package/src/react-elements.ts +13 -0
- package/src/render/attributes.ts +404 -0
- package/src/render/dom.ts +90 -0
- package/src/render/hyperscript.ts +66 -0
- package/src/render/string.ts +70 -0
- package/src/scan-score.ts +1 -1
- package/src/svg.ts +27 -0
- package/src/template/arrow.tsx +1 -0
- package/src/template/default.tsx +1 -0
- package/src/template/halloween.tsx +1 -0
- package/src/template/square-border.tsx +1 -0
- package/src/template/standard-box.tsx +1 -0
- package/src/template/striked-box.tsx +1 -0
- package/src/utils/print-shared.ts +1 -1
- package/src/utils.tsx +24 -23
- package/src/vanilla-api.ts +146 -0
- package/src/vanilla-browser.ts +11 -0
- package/src/vanilla.ts +10 -0
- package/src/vue.ts +220 -0
- package/types/index.ts +4 -2
- package/types/public.ts +4 -0
- package/types/qr.ts +19 -5
- package/types/react.ts +8 -0
- package/types/template.ts +10 -3
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
var lx=Object.defineProperty;var un=(e,t)=>{for(var n in t)lx(e,n,{get:t[n],enumerable:true});};var Rr;(i=>{class e{constructor(a,c,u,l){this.version=a;this.errorCorrectionLevel=c;if(a<e.MIN_VERSION||a>e.MAX_VERSION)throw new RangeError("Version value out of range");if(l<-1||l>7)throw new RangeError("Mask value out of range");this.size=a*4+17;let f=[];for(let m=0;m<this.size;m++)f.push(false);for(let m=0;m<this.size;m++)this.modules.push(f.slice()),this.isFunction.push(f.slice());this.drawFunctionPatterns();let p=this.addEccAndInterleave(u);if(this.drawCodewords(p),l==-1){let m=1e9;for(let h=0;h<8;h++){this.applyMask(h),this.drawFormatBits(h);let d=this.getPenaltyScore();d<m&&(l=h,m=d),this.applyMask(h);}}r(0<=l&&l<=7),this.mask=l,this.applyMask(l),this.drawFormatBits(l),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(a,c){let u=i.QrSegment.makeSegments(a);return e.encodeSegments(u,c)}static encodeBinary(a,c){let u=i.QrSegment.makeBytes(a);return e.encodeSegments([u],c)}static encodeSegments(a,c,u=1,l=40,f=-1,p=true){if(!(e.MIN_VERSION<=u&&u<=l&&l<=e.MAX_VERSION)||f<-1||f>7)throw new RangeError("Invalid value");let m,h;for(m=u;;m++){let b=e.getNumDataCodewords(m,c)*8,y=o.getTotalBits(a,m);if(y<=b){h=y;break}if(m>=l)throw new RangeError("Data too long")}for(let b of [e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH])p&&h<=e.getNumDataCodewords(m,b)*8&&(c=b);let d=[];for(let b of a){t(b.mode.modeBits,4,d),t(b.numChars,b.mode.numCharCountBits(m),d);for(let y of b.getData())d.push(y);}r(d.length==h);let g=e.getNumDataCodewords(m,c)*8;r(d.length<=g),t(0,Math.min(4,g-d.length),d),t(0,(8-d.length%8)%8,d),r(d.length%8==0);for(let b=236;d.length<g;b^=253)t(b,8,d);let _=[];for(;_.length*8<d.length;)_.push(0);return d.forEach((b,y)=>_[y>>>3]|=b<<7-(y&7)),new e(m,c,_,f)}size;mask;modules=[];isFunction=[];getModule(a,c){return 0<=a&&a<this.size&&0<=c&&c<this.size&&this.modules[c][a]}getModules(){return this.modules}drawFunctionPatterns(){for(let u=0;u<this.size;u++)this.setFunctionModule(6,u,u%2==0),this.setFunctionModule(u,6,u%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let a=this.getAlignmentPatternPositions(),c=a.length;for(let u=0;u<c;u++)for(let l=0;l<c;l++)u==0&&l==0||u==0&&l==c-1||u==c-1&&l==0||this.drawAlignmentPattern(a[u],a[l]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(a){let c=this.errorCorrectionLevel.formatBits<<3|a,u=c;for(let f=0;f<10;f++)u=u<<1^(u>>>9)*1335;let l=(c<<10|u)^21522;r(l>>>15==0);for(let f=0;f<=5;f++)this.setFunctionModule(8,f,n(l,f));this.setFunctionModule(8,7,n(l,6)),this.setFunctionModule(8,8,n(l,7)),this.setFunctionModule(7,8,n(l,8));for(let f=9;f<15;f++)this.setFunctionModule(14-f,8,n(l,f));for(let f=0;f<8;f++)this.setFunctionModule(this.size-1-f,8,n(l,f));for(let f=8;f<15;f++)this.setFunctionModule(8,this.size-15+f,n(l,f));this.setFunctionModule(8,this.size-8,true);}drawVersion(){if(this.version<7)return;let a=this.version;for(let u=0;u<12;u++)a=a<<1^(a>>>11)*7973;let c=this.version<<12|a;r(c>>>18==0);for(let u=0;u<18;u++){let l=n(c,u),f=this.size-11+u%3,p=Math.floor(u/3);this.setFunctionModule(f,p,l),this.setFunctionModule(p,f,l);}}drawFinderPattern(a,c){for(let u=-4;u<=4;u++)for(let l=-4;l<=4;l++){let f=Math.max(Math.abs(l),Math.abs(u)),p=a+l,m=c+u;0<=p&&p<this.size&&0<=m&&m<this.size&&this.setFunctionModule(p,m,f!=2&&f!=4);}}drawAlignmentPattern(a,c){for(let u=-2;u<=2;u++)for(let l=-2;l<=2;l++)this.setFunctionModule(a+l,c+u,Math.max(Math.abs(l),Math.abs(u))!=1);}setFunctionModule(a,c,u){this.modules[c][a]=u,this.isFunction[c][a]=true;}addEccAndInterleave(a){let c=this.version,u=this.errorCorrectionLevel;if(a.length!=e.getNumDataCodewords(c,u))throw new RangeError("Invalid argument");let l=e.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][c],f=e.ECC_CODEWORDS_PER_BLOCK[u.ordinal][c],p=Math.floor(e.getNumRawDataModules(c)/8),m=l-p%l,h=Math.floor(p/l),d=[],g=e.reedSolomonComputeDivisor(f);for(let b=0,y=0;b<l;b++){let S=a.slice(y,y+h-f+(b<m?0:1));y+=S.length;let v=e.reedSolomonComputeRemainder(S,g);b<m&&S.push(0),d.push(S.concat(v));}let _=[];for(let b=0;b<d[0].length;b++)d.forEach((y,S)=>{(b!=h-f||S>=m)&&_.push(y[b]);});return r(_.length==p),_}drawCodewords(a){if(a.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let c=0;for(let u=this.size-1;u>=1;u-=2){u==6&&(u=5);for(let l=0;l<this.size;l++)for(let f=0;f<2;f++){let p=u-f,h=(u+1&2)==0?this.size-1-l:l;!this.isFunction[h][p]&&c<a.length*8&&(this.modules[h][p]=n(a[c>>>3],7-(c&7)),c++);}}r(c==a.length*8);}applyMask(a){if(a<0||a>7)throw new RangeError("Mask value out of range");for(let c=0;c<this.size;c++)for(let u=0;u<this.size;u++){let l;switch(a){case 0:l=(u+c)%2==0;break;case 1:l=c%2==0;break;case 2:l=u%3==0;break;case 3:l=(u+c)%3==0;break;case 4:l=(Math.floor(u/3)+Math.floor(c/2))%2==0;break;case 5:l=u*c%2+u*c%3==0;break;case 6:l=(u*c%2+u*c%3)%2==0;break;case 7:l=((u+c)%2+u*c%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[c][u]&&l&&(this.modules[c][u]=!this.modules[c][u]);}}getPenaltyScore(){let a=0;for(let f=0;f<this.size;f++){let p=false,m=0,h=[0,0,0,0,0,0,0];for(let d=0;d<this.size;d++)this.modules[f][d]==p?(m++,m==5?a+=e.PENALTY_N1:m>5&&a++):(this.finderPenaltyAddHistory(m,h),p||(a+=this.finderPenaltyCountPatterns(h)*e.PENALTY_N3),p=this.modules[f][d],m=1);a+=this.finderPenaltyTerminateAndCount(p,m,h)*e.PENALTY_N3;}for(let f=0;f<this.size;f++){let p=false,m=0,h=[0,0,0,0,0,0,0];for(let d=0;d<this.size;d++)this.modules[d][f]==p?(m++,m==5?a+=e.PENALTY_N1:m>5&&a++):(this.finderPenaltyAddHistory(m,h),p||(a+=this.finderPenaltyCountPatterns(h)*e.PENALTY_N3),p=this.modules[d][f],m=1);a+=this.finderPenaltyTerminateAndCount(p,m,h)*e.PENALTY_N3;}for(let f=0;f<this.size-1;f++)for(let p=0;p<this.size-1;p++){let m=this.modules[f][p];m==this.modules[f][p+1]&&m==this.modules[f+1][p]&&m==this.modules[f+1][p+1]&&(a+=e.PENALTY_N2);}let c=0;for(let f of this.modules)c=f.reduce((p,m)=>p+(m?1:0),c);let u=this.size*this.size,l=Math.ceil(Math.abs(c*20-u*10)/u)-1;return r(0<=l&&l<=9),a+=l*e.PENALTY_N4,r(0<=a&&a<=2568888),a}getAlignmentPatternPositions(){if(this.version==1)return [];{let a=Math.floor(this.version/7)+2,c=this.version==32?26:Math.ceil((this.version*4+4)/(a*2-2))*2,u=[6];for(let l=this.size-7;u.length<a;l-=c)u.splice(1,0,l);return u}}static getNumRawDataModules(a){if(a<e.MIN_VERSION||a>e.MAX_VERSION)throw new RangeError("Version number out of range");let c=(16*a+128)*a+64;if(a>=2){let u=Math.floor(a/7)+2;c-=(25*u-10)*u-55,a>=7&&(c-=36);}return r(208<=c&&c<=29648),c}static getNumDataCodewords(a,c){return Math.floor(e.getNumRawDataModules(a)/8)-e.ECC_CODEWORDS_PER_BLOCK[c.ordinal][a]*e.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][a]}static reedSolomonComputeDivisor(a){if(a<1||a>255)throw new RangeError("Degree out of range");let c=[];for(let l=0;l<a-1;l++)c.push(0);c.push(1);let u=1;for(let l=0;l<a;l++){for(let f=0;f<c.length;f++)c[f]=e.reedSolomonMultiply(c[f],u),f+1<c.length&&(c[f]^=c[f+1]);u=e.reedSolomonMultiply(u,2);}return c}static reedSolomonComputeRemainder(a,c){let u=c.map(l=>0);for(let l of a){let f=l^u.shift();u.push(0),c.forEach((p,m)=>u[m]^=e.reedSolomonMultiply(p,f));}return u}static reedSolomonMultiply(a,c){if(a>>>8||c>>>8)throw new RangeError("Byte out of range");let u=0;for(let l=7;l>=0;l--)u=u<<1^(u>>>7)*285,u^=(c>>>l&1)*a;return r(u>>>8==0),u}finderPenaltyCountPatterns(a){let c=a[1];r(c<=this.size*3);let u=c>0&&a[2]==c&&a[3]==c*3&&a[4]==c&&a[5]==c;return (u&&a[0]>=c*4&&a[6]>=c?1:0)+(u&&a[6]>=c*4&&a[0]>=c?1:0)}finderPenaltyTerminateAndCount(a,c,u){return a&&(this.finderPenaltyAddHistory(c,u),c=0),c+=this.size,this.finderPenaltyAddHistory(c,u),this.finderPenaltyCountPatterns(u)}finderPenaltyAddHistory(a,c){c[0]==0&&(a+=this.size),c.pop(),c.unshift(a);}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]]}i.QrCode=e;function t(s,a,c){if(a<0||a>31||s>>>a)throw new RangeError("Value out of range");for(let u=a-1;u>=0;u--)c.push(s>>>u&1);}function n(s,a){return (s>>>a&1)!=0}function r(s){if(!s)throw new Error("Assertion error")}class o{constructor(a,c,u){this.mode=a;this.numChars=c;this.bitData=u;if(c<0)throw new RangeError("Invalid argument");this.bitData=u.slice();}mode;numChars;bitData;static makeBytes(a){let c=[];for(let u of a)t(u,8,c);return new o(o.Mode.BYTE,a.length,c)}static makeNumeric(a){if(!o.isNumeric(a))throw new RangeError("String contains non-numeric characters");let c=[];for(let u=0;u<a.length;){let l=Math.min(a.length-u,3);t(parseInt(a.substr(u,l),10),l*3+1,c),u+=l;}return new o(o.Mode.NUMERIC,a.length,c)}static makeAlphanumeric(a){if(!o.isAlphanumeric(a))throw new RangeError("String contains unencodable characters in alphanumeric mode");let c=[],u;for(u=0;u+2<=a.length;u+=2){let l=o.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u))*45;l+=o.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u+1)),t(l,11,c);}return u<a.length&&t(o.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u)),6,c),new o(o.Mode.ALPHANUMERIC,a.length,c)}static makeSegments(a){return a==""?[]:o.isNumeric(a)?[o.makeNumeric(a)]:o.isAlphanumeric(a)?[o.makeAlphanumeric(a)]:[o.makeBytes(o.toUtf8ByteArray(a))]}static makeEci(a){let c=[];if(a<0)throw new RangeError("ECI assignment value out of range");if(a<128)t(a,8,c);else if(a<16384)t(2,2,c),t(a,14,c);else if(a<1e6)t(6,3,c),t(a,21,c);else throw new RangeError("ECI assignment value out of range");return new o(o.Mode.ECI,0,c)}static isNumeric(a){return o.NUMERIC_REGEX.test(a)}static isAlphanumeric(a){return o.ALPHANUMERIC_REGEX.test(a)}getData(){return this.bitData.slice()}static getTotalBits(a,c){let u=0;for(let l of a){let f=l.mode.numCharCountBits(c);if(l.numChars>=1<<f)return 1/0;u+=4+f+l.bitData.length;}return u}static toUtf8ByteArray(a){a=encodeURI(a);let c=[];for(let u=0;u<a.length;u++)a.charAt(u)!="%"?c.push(a.charCodeAt(u)):(c.push(parseInt(a.substr(u+1,2),16)),u+=2);return c}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}i.QrSegment=o;})(Rr||={});(t=>{(r=>{class n{constructor(i,s){this.ordinal=i;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)}r.Ecc=n;})(t.QrCode||={});})(Rr||={});(t=>{(r=>{class n{constructor(i,s){this.modeBits=i;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(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}}r.Mode=n;})(t.QrSegment||={});})(Rr||={});var Te=Rr;var We={L:Te.QrCode.Ecc.LOW,M:Te.QrCode.Ecc.MEDIUM,Q:Te.QrCode.Ecc.QUARTILE,H:Te.QrCode.Ecc.HIGH},ve=128,zt="Q",Me="#FFFFFF",Ge="#000000";var Ne=0;var cs=.1;function Ue(e,t="#000000"){return e?typeof e=="string"?e:e.type==="solid"?e.color:e.type==="image"?e.underlay||t:(e.type==="linear"||e.type==="radial"||e.type==="angular")&&e.stops[0]?.color||t:t}var E={};un(E,{$brand:()=>Bu,$input:()=>dm,$output:()=>pm,INVALID:()=>Xe,NEVER:()=>Zu,TimePrecision:()=>Pm,ZodAny:()=>pd,ZodArray:()=>_d,ZodBase64:()=>oc,ZodBase64URL:()=>ic,ZodBigInt:()=>po,ZodBigIntFormat:()=>cc,ZodBoolean:()=>mo,ZodCIDRv4:()=>nc,ZodCIDRv6:()=>rc,ZodCUID:()=>Ha,ZodCUID2:()=>Ya,ZodCatch:()=>Fd,ZodCodec:()=>zi,ZodCompileAsyncError:()=>Pt,ZodCompileUnsupportedError:()=>ne,ZodCreditCard:()=>id,ZodCustom:()=>Ti,ZodCustomStringFormat:()=>rr,ZodDate:()=>Ei,ZodDefault:()=>Id,ZodDiscriminatedUnion:()=>yd,ZodE164:()=>sc,ZodEmail:()=>Va,ZodEmoji:()=>qa,ZodEnum:()=>uo,ZodError:()=>Sw,ZodExactOptional:()=>mc,ZodFile:()=>Ed,ZodFirstPartyTypeKind:()=>Kd,ZodFunction:()=>Wd,ZodGUID:()=>ja,ZodIBAN:()=>sd,ZodIPv4:()=>ec,ZodIPv6:()=>tc,ZodISODate:()=>$n,ZodISODateTime:()=>yn,ZodISODuration:()=>wn,ZodISOTime:()=>xn,ZodInstanceOf:()=>Xd,ZodIntersection:()=>$d,ZodIssueCode:()=>Pw,ZodJWT:()=>ac,ZodKSUID:()=>Ja,ZodLazy:()=>Vd,ZodLiteral:()=>Ad,ZodMAC:()=>od,ZodMap:()=>Cd,ZodNaN:()=>Zd,ZodNanoID:()=>Wa,ZodNever:()=>hd,ZodNonOptional:()=>pc,ZodNull:()=>fd,ZodNullable:()=>Md,ZodNumber:()=>fo,ZodNumberFormat:()=>or,ZodObject:()=>Ri,ZodOptional:()=>Ii,ZodPipe:()=>Li,ZodPrefault:()=>zd,ZodPreprocess:()=>Bd,ZodPromise:()=>qd,ZodReadonly:()=>Gd,ZodRealError:()=>lt,ZodRecord:()=>co,ZodSet:()=>Pd,ZodString:()=>lo,ZodStringFormat:()=>pe,ZodSuccess:()=>Od,ZodSymbol:()=>ud,ZodTemplateLiteral:()=>Qd,ZodTransform:()=>kd,ZodTuple:()=>wd,ZodType:()=>H,ZodULID:()=>Xa,ZodURL:()=>Ai,ZodUUID:()=>Ft,ZodUndefined:()=>ld,ZodUnion:()=>Mi,ZodUnknown:()=>dd,ZodVoid:()=>gd,ZodXID:()=>Ka,ZodXor:()=>bd,_ZodString:()=>Qa,_default:()=>Ld,_function:()=>I_,any:()=>u_,array:()=>ki,base64:()=>U1,base64url:()=>Q1,bigint:()=>o_,boolean:()=>cd,catch:()=>Dd,check:()=>L_,cidrv4:()=>B1,cidrv6:()=>G1,clone:()=>ce,codec:()=>E_,coerce:()=>eh,compile:()=>bm,config:()=>Ee,core:()=>Kt,creditCard:()=>j1,cuid:()=>L1,cuid2:()=>z1,currencyCode:()=>K1,custom:()=>z_,date:()=>f_,decode:()=>Xp,decodeAsync:()=>Jp,deepPartial:()=>q_,describe:()=>T_,discriminatedUnion:()=>__,e164:()=>V1,email:()=>S1,emoji:()=>M1,encode:()=>Yp,encodeAsync:()=>Kp,endsWith:()=>Xr,enum:()=>lc,exactOptional:()=>Rd,file:()=>v_,flattenError:()=>Ko,float32:()=>e_,float64:()=>t_,formatError:()=>Jo,fromJSONSchema:()=>V_,function:()=>I_,getDiscriminatedOption:()=>Bf,getErrorMap:()=>Ew,globalRegistry:()=>Ve,gt:()=>Nt,gte:()=>ht,guid:()=>v1,hash:()=>J1,hex:()=>X1,hostname:()=>Y1,httpUrl:()=>R1,iban:()=>q1,includes:()=>Hr,input:()=>H_,instanceof:()=>O_,int:()=>Ga,int32:()=>n_,int64:()=>i_,intersection:()=>xd,invertCodec:()=>k_,ipv4:()=>F1,ipv6:()=>Z1,iso:()=>Ni,json:()=>D_,jwt:()=>W1,keyof:()=>m_,ksuid:()=>O1,lazy:()=>jd,length:()=>Kn,literal:()=>S_,locales:()=>ra,looseObject:()=>h_,looseRecord:()=>y_,lowercase:()=>qr,lt:()=>Tt,lte:()=>dt,mac:()=>D1,map:()=>$_,maxLength:()=>Xn,maxSize:()=>hn,memoizer:()=>_i,meta:()=>N_,mime:()=>Jr,minLength:()=>Xt,minSize:()=>Ot,multipleOf:()=>dn,nan:()=>A_,nanoid:()=>I1,nativeEnum:()=>w_,negative:()=>Ma,never:()=>uc,nonnegative:()=>La,nonoptional:()=>Nd,nonpositive:()=>Ia,normalize:()=>eo,null:()=>md,nullable:()=>Pi,nullish:()=>C_,number:()=>ad,object:()=>p_,optional:()=>tr,output:()=>Y_,overwrite:()=>At,parse:()=>jp,parseAsync:()=>qp,partialRecord:()=>b_,pipe:()=>Ua,positive:()=>Ra,prefault:()=>Td,preprocess:()=>Z_,prettifyError:()=>ju,promise:()=>M_,properties:()=>Kr,property:()=>za,readonly:()=>Ud,record:()=>vd,refine:()=>Hd,regex:()=>jr,regexes:()=>wt,registry:()=>ia,safeDecode:()=>td,safeDecodeAsync:()=>rd,safeEncode:()=>ed,safeEncodeAsync:()=>nd,safeParse:()=>Wp,safeParseAsync:()=>Hp,set:()=>x_,setErrorMap:()=>Aw,size:()=>Yn,slugify:()=>oo,startsWith:()=>Yr,strictObject:()=>d_,string:()=>Ci,stringFormat:()=>H1,stringbool:()=>F_,success:()=>P_,superRefine:()=>Yd,symbol:()=>a_,templateLiteral:()=>R_,toJSONSchema:()=>Fa,toLowerCase:()=>no,toUpperCase:()=>ro,toZod:()=>Go,transform:()=>fc,treeifyError:()=>Vu,trim:()=>to,tuple:()=>Sd,uint32:()=>r_,uint64:()=>s_,ulid:()=>T1,undefined:()=>c_,union:()=>ho,unknown:()=>er,uppercase:()=>Wr,url:()=>k1,util:()=>F,uuid:()=>C1,uuidv4:()=>P1,uuidv6:()=>A1,uuidv7:()=>E1,validate:()=>ei,validateAsync:()=>ti,void:()=>l_,withParser:()=>sa,xid:()=>N1,xor:()=>g_});var Kt={};un(Kt,{$ZodAny:()=>If,$ZodArray:()=>Ff,$ZodAsyncError:()=>ct,$ZodBase64:()=>$f,$ZodBase64URL:()=>xf,$ZodBigInt:()=>qs,$ZodBigIntFormat:()=>Ef,$ZodBoolean:()=>fi,$ZodCIDRv4:()=>bf,$ZodCIDRv6:()=>yf,$ZodCUID:()=>sf,$ZodCUID2:()=>af,$ZodCatch:()=>rm,$ZodCheck:()=>he,$ZodCheckBigIntFormat:()=>Il,$ZodCheckEndsWith:()=>Ql,$ZodCheckGreaterThan:()=>Ms,$ZodCheckIncludes:()=>Gl,$ZodCheckLengthEquals:()=>Fl,$ZodCheckLessThan:()=>Rs,$ZodCheckLowerCase:()=>Zl,$ZodCheckMaxLength:()=>Nl,$ZodCheckMaxSize:()=>Ll,$ZodCheckMimeType:()=>ql,$ZodCheckMinLength:()=>Ol,$ZodCheckMinSize:()=>zl,$ZodCheckMultipleOf:()=>Rl,$ZodCheckNumberFormat:()=>Ml,$ZodCheckOverwrite:()=>Wl,$ZodCheckProperties:()=>jl,$ZodCheckProperty:()=>Vl,$ZodCheckRegex:()=>Dl,$ZodCheckSizeEquals:()=>Tl,$ZodCheckStartsWith:()=>Ul,$ZodCheckStringFormat:()=>Gr,$ZodCheckUpperCase:()=>Bl,$ZodCodec:()=>pi,$ZodCreditCard:()=>Sf,$ZodCustom:()=>lm,$ZodCustomStringFormat:()=>Pf,$ZodCyclicError:()=>ea,$ZodDate:()=>Nf,$ZodDefault:()=>Jf,$ZodDiscriminatedUnion:()=>Gf,$ZodE164:()=>wf,$ZodEmail:()=>Jl,$ZodEmoji:()=>rf,$ZodEncodeError:()=>mn,$ZodEnum:()=>qf,$ZodError:()=>Qu,$ZodExactOptional:()=>Xf,$ZodFile:()=>Hf,$ZodFunction:()=>cm,$ZodGUID:()=>Xl,$ZodIBAN:()=>vf,$ZodIPv4:()=>hf,$ZodIPv6:()=>gf,$ZodISODate:()=>mf,$ZodISODateTime:()=>ff,$ZodISODuration:()=>df,$ZodISOTime:()=>pf,$ZodIntersection:()=>Uf,$ZodJWT:()=>Cf,$ZodKSUID:()=>lf,$ZodLazy:()=>di,$ZodLiteral:()=>Wf,$ZodMAC:()=>_f,$ZodMap:()=>Vf,$ZodNaN:()=>om,$ZodNanoID:()=>of,$ZodNever:()=>zf,$ZodNonOptional:()=>tm,$ZodNull:()=>Mf,$ZodNullable:()=>Kf,$ZodNumber:()=>js,$ZodNumberFormat:()=>Af,$ZodObject:()=>Gg,$ZodObjectJIT:()=>Df,$ZodOptional:()=>Hs,$ZodPipe:()=>Ys,$ZodPrefault:()=>em,$ZodPreprocess:()=>im,$ZodPromise:()=>um,$ZodReadonly:()=>sm,$ZodRealError:()=>ut,$ZodRecord:()=>Qf,$ZodRegistry:()=>oa,$ZodSet:()=>jf,$ZodString:()=>jn,$ZodStringFormat:()=>ue,$ZodSuccess:()=>nm,$ZodSymbol:()=>kf,$ZodTemplateLiteral:()=>am,$ZodTransform:()=>Yf,$ZodTuple:()=>Ws,$ZodType:()=>q,$ZodULID:()=>cf,$ZodURL:()=>nf,$ZodUUID:()=>Kl,$ZodUndefined:()=>Rf,$ZodUnion:()=>mi,$ZodUnknown:()=>Lf,$ZodVoid:()=>Tf,$ZodXID:()=>uf,$ZodXor:()=>Zf,$brand:()=>Bu,$constructor:()=>P,$input:()=>dm,$output:()=>pm,Doc:()=>Vn,INVALID:()=>Xe,JSONSchema:()=>y1,JSONSchemaGenerator:()=>Da,NEVER:()=>Zu,TimePrecision:()=>Pm,URL_BAD_FORMAT:()=>ef,URL_UNPARSEABLE:()=>si,ZodCompileAsyncError:()=>Pt,ZodCompileUnsupportedError:()=>ne,_any:()=>Um,_array:()=>Ym,_base64:()=>Pa,_base64url:()=>Aa,_bigint:()=>Nm,_boolean:()=>zm,_catch:()=>lw,_check:()=>r1,_cidrv4:()=>va,_cidrv6:()=>Ca,_coercedBigint:()=>Om,_coercedBoolean:()=>Tm,_coercedDate:()=>Wm,_coercedNumber:()=>Em,_coercedString:()=>wm,_creditCard:()=>vm,_cuid:()=>_a,_cuid2:()=>ba,_custom:()=>Km,_date:()=>qm,_decode:()=>ys,_decodeAsync:()=>xs,_default:()=>aw,_discriminatedUnion:()=>H4,_e164:()=>Ea,_email:()=>ua,_emoji:()=>ha,_encode:()=>bs,_encodeAsync:()=>$s,_endsWith:()=>Xr,_enum:()=>tw,_file:()=>Xm,_float32:()=>Rm,_float64:()=>Mm,_gt:()=>Nt,_gte:()=>ht,_guid:()=>la,_iban:()=>Cm,_includes:()=>Hr,_int:()=>km,_int32:()=>Im,_int64:()=>Fm,_intersection:()=>Y4,_ipv4:()=>wa,_ipv6:()=>Sa,_isoDate:()=>$i,_isoDateTime:()=>yi,_isoDuration:()=>wi,_isoTime:()=>xi,_jwt:()=>ka,_ksuid:()=>xa,_lazy:()=>dw,_length:()=>Kn,_literal:()=>rw,_lowercase:()=>qr,_lt:()=>Tt,_lte:()=>dt,_mac:()=>Sm,_map:()=>J4,_max:()=>dt,_maxLength:()=>Xn,_maxSize:()=>hn,_mime:()=>Jr,_min:()=>ht,_minLength:()=>Xt,_minSize:()=>Ot,_multipleOf:()=>dn,_nan:()=>Hm,_nanoid:()=>ga,_nativeEnum:()=>nw,_negative:()=>Ma,_never:()=>Vm,_nonnegative:()=>La,_nonoptional:()=>cw,_nonpositive:()=>Ia,_normalize:()=>eo,_null:()=>Gm,_nullable:()=>sw,_number:()=>Am,_optional:()=>iw,_overwrite:()=>At,_parse:()=>Fr,_parseAsync:()=>Dr,_pipe:()=>fw,_positive:()=>Ra,_promise:()=>hw,_properties:()=>Kr,_property:()=>za,_readonly:()=>mw,_record:()=>K4,_refine:()=>Jm,_regex:()=>jr,_safeDecode:()=>Ss,_safeDecodeAsync:()=>Cs,_safeEncode:()=>ws,_safeEncodeAsync:()=>vs,_safeParse:()=>Zr,_safeParseAsync:()=>Br,_set:()=>ew,_size:()=>Yn,_slugify:()=>oo,_startsWith:()=>Yr,_string:()=>xm,_stringFormat:()=>Jn,_stringbool:()=>rp,_success:()=>uw,_superRefine:()=>ep,_symbol:()=>Zm,_templateLiteral:()=>pw,_toLowerCase:()=>no,_toUpperCase:()=>ro,_transform:()=>ow,_trim:()=>to,_tuple:()=>X4,_uint32:()=>Lm,_uint64:()=>Dm,_ulid:()=>ya,_undefined:()=>Bm,_union:()=>q4,_unknown:()=>Qm,_uppercase:()=>Wr,_url:()=>bi,_uuid:()=>fa,_uuidv4:()=>ma,_uuidv6:()=>pa,_uuidv7:()=>da,_void:()=>jm,_xid:()=>$a,_xor:()=>W4,base64Charset:()=>Bs,base64urlCharset:()=>li,canParseURL:()=>tf,clone:()=>ce,compile:()=>bm,compileFn:()=>aa,config:()=>Ee,createStandardJSONSchemaMethod:()=>io,createToJSONSchemaMethod:()=>ip,decode:()=>t5,decodeAsync:()=>r5,describe:()=>tp,encode:()=>e5,encodeAsync:()=>n5,extractDefs:()=>_n,finalize:()=>bn,flattenError:()=>Ko,formatError:()=>Jo,getDiscriminatedOption:()=>Bf,globalConfig:()=>Ze,globalRegistry:()=>Ve,handleUnrepresentable:()=>Oe,initializeContext:()=>gn,isBackEdge:()=>na,isRecursiveSchema:()=>ta,isValidBase64:()=>ui,isValidBase64URL:()=>Gs,isValidCIDRv6:()=>Zs,isValidCreditCard:()=>Us,isValidIBAN:()=>Qs,isValidIPv6:()=>ci,isValidJWT:()=>Vs,locales:()=>ra,memoizer:()=>_i,mergeValues:()=>Ur,meta:()=>np,parse:()=>gs,parseAsync:()=>_s,parseURLObject:()=>Dg,prettifyError:()=>ju,process:()=>le,processSchema:()=>le,regexes:()=>wt,registry:()=>ia,safeDecode:()=>i5,safeDecodeAsync:()=>a5,safeEncode:()=>o5,safeEncodeAsync:()=>s5,safeParse:()=>Hx,safeParseAsync:()=>Yx,standardProps:()=>Ns,stripTabAndNewline:()=>ai,toDotPath:()=>bg,toJSONSchema:()=>Fa,toZod:()=>Go,treeifyError:()=>Vu,urlHostnameOk:()=>Fs,urlProtocolOk:()=>Ds,util:()=>F,validate:()=>ei,validateAsync:()=>ti,validateURL:()=>Os,version:()=>Hl,withParser:()=>sa});var F={};un(F,{BIGINT_FORMAT_RANGES:()=>qo,CONSTANT_CATCH:()=>ds,Class:()=>ku,NUMBER_FORMAT_RANGES:()=>jo,aborted:()=>Ye,allowsEval:()=>Iu,assert:()=>hx,assertEqual:()=>fx,assertIs:()=>px,assertNever:()=>dx,assertNotEqual:()=>mx,assignProp:()=>Qe,attachSchema:()=>Wo,base64ToUint8Array:()=>mg,base64urlToUint8Array:()=>zx,cached:()=>zr,captureStackTrace:()=>fs,cleanEnum:()=>Lx,cleanRegex:()=>Ht,clone:()=>ce,cloneDef:()=>bx,codePointLength:()=>Un,constantCatch:()=>Fu,createTransparentProxy:()=>vx,defineLazy:()=>Ru,defineLazyInternal:()=>Y,derived:()=>Fx,esc:()=>He,escapeRegex:()=>xt,explicitlyAborted:()=>Tu,extend:()=>Ax,finalizeIssue:()=>at,floatSafeRemainder:()=>Uo,getElementAtPath:()=>yx,getEnumValues:()=>Ir,getLengthableOrigin:()=>Yo,getParsedType:()=>Sx,getSizableOrigin:()=>Ho,hexToUint8Array:()=>Nx,hide:()=>Xo,installLazyProp:()=>Gx,isObject:()=>Gn,isPlainObject:()=>$t,issue:()=>Or,joinValues:()=>us,jsonStringifyReplacer:()=>Lr,members:()=>Ou,merge:()=>kx,mergeDefs:()=>Ct,normalizeParams:()=>T,nullish:()=>ls,numKeys:()=>wx,objectClone:()=>gx,omit:()=>Px,optionalKeys:()=>zu,own:()=>fn,parsedType:()=>Nu,partial:()=>Rx,pick:()=>Cx,prefixIssues:()=>st,primitiveTypes:()=>Lu,promiseAllObject:()=>$x,propertyKeyTypes:()=>Vo,randomString:()=>xx,rawShape:()=>Tr,required:()=>Mx,safeExtend:()=>Ex,shallowClone:()=>Qo,sizeCaps:()=>Nr,slugify:()=>Mu,stringifyPrimitive:()=>ms,toZod:()=>Go,uint8ArrayToBase64:()=>pg,uint8ArrayToBase64url:()=>Tx,uint8ArrayToHex:()=>Ox,unwrapMessage:()=>Mr});function fx(e){return e}function mx(e){return e}function Go(){return e=>e}function px(e){}function dx(e){throw new Error("Unexpected value in exhaustive check")}function hx(e){}function Ir(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function us(e,t="|"){return e.map(n=>ms(n)).join(t)}function Lr(e,t){return typeof t=="bigint"?t.toString():t}var Eu=class{constructor(t){this._getter=t,this._value=void 0;}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function zr(e){return new Eu(e)}function ls(e){return e==null}function Ht(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Uo(e,t){let n=e/t,r=Math.round(n),o=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}var cg=Symbol("evaluating");function Ru(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==cg)return r===void 0&&(r=cg,r=n()),r},set(o){Object.defineProperty(e,t,{value:o});},configurable:true});}function gx(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Qe(e,t,n){Object.defineProperty(e,t,{value:n,writable:true,enumerable:true,configurable:true});}function Tr(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Wt(e){return Tr(e._zod.def)??e._zod.def.shape}function ug(e,t,n){Object.defineProperty(e,t,{get(){let r=n();return Qe(this,t,r),r},enumerable:true,configurable:true});}function lg(e,t,n){t in e?Qe(e,t,n):e[t]=n;}function Bn(e,t,n,r){let o=Wt(t);for(let i of n){let s=Object.getOwnPropertyDescriptor(o,i);s.enumerable&&(s.get?ug(e,i,()=>{let a=t._zod.def.shape[i];return r?r(a,i):a}):lg(e,i,r?r(s.value,i):s.value));}}function _x(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?ug(e,n,()=>t[n]):lg(e,n,r.value));}}function Ct(...e){let t={};for(let n of e){let r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r);}return Object.defineProperties({},t)}function bx(e){return Ct(e._zod.def)}function yx(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function $x(e){let t=Object.keys(e),n=t.map(r=>e[r]);return Promise.all(n).then(r=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=r[i];return o})}function xx(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function He(e){return JSON.stringify(e)}function Mu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var fs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Gn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Iu=zr(()=>{if(Ze.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return false;try{let e=Function;return new e(""),!0}catch{return false}});function $t(e){if(Gn(e)===false)return false;let t=e.constructor;if(t===void 0||typeof t!="function")return true;let n=t.prototype;return !(Gn(n)===false||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===false)}function Qo(e){return $t(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function wx(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var Sx=e=>{let t=typeof e;switch(t){case "undefined":return "undefined";case "string":return "string";case "number":return Number.isNaN(e)?"nan":"number";case "boolean":return "boolean";case "function":return "function";case "bigint":return "bigint";case "symbol":return "symbol";case "object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Vo=new Set(["string","number","symbol"]),Lu=new Set(["string","number","bigint","boolean","symbol","undefined"]);function xt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ce(e,t,n){let r=new e._zod.constr(t??e._zod.def);return (!t||n?.parent)&&(r._zod.parent=e),r}function T(e){let t=e;if(!t)return {};if(typeof t=="string")return {error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message;}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function vx(e){let t;return new Proxy({},{get(n,r,o){return t??(t=e()),Reflect.get(t,r,o)},set(n,r,o,i){return t??(t=e()),Reflect.set(t,r,o,i)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,o){return t??(t=e()),Reflect.defineProperty(t,r,o)}})}function ms(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function zu(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var jo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},qo={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Cx(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i={};return Bn(i,e,ps(e,t)),ce(e,Ct(n,{shape:i,checks:[]}))}function ps(e,t){let n=Wt(e),r=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&r.push(o);}return r}function Px(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(ps(e,t)),s={};return Bn(s,e,Reflect.ownKeys(Wt(e)).filter(a=>!i.has(a))),ce(e,Ct(n,{shape:s,checks:[]}))}function Ax(e,t){if(!$t(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let o=Wt(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ce(e,Ct(e._zod.def,{shape:fg(e,t)}))}function fg(e,t){let n={};return Bn(n,e,Reflect.ownKeys(Wt(e))),_x(n,t),n}function Ex(e,t){if(!$t(t))throw new Error("Invalid input to safeExtend: expected a plain object");return ce(e,Ct(e._zod.def,{shape:fg(e,t)}))}function kx(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};Bn(n,e,Reflect.ownKeys(Wt(e))),Bn(n,t,Reflect.ownKeys(Wt(t)));let r=Ct(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ce(e,r)}function Rx(e,t,n,r="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(ps(t,n)):void 0,c={};return Bn(c,t,Reflect.ownKeys(Wt(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),ce(t,Ct(t._zod.def,{shape:c,checks:[]}))}function Mx(e,t,n){let r=n?new Set(ps(t,n)):void 0,o={};return Bn(o,t,Reflect.ownKeys(Wt(t)),(i,s)=>r&&!r.has(s)?i:new e({type:"nonoptional",innerType:i})),ce(t,Ct(t._zod.def,{shape:o}))}function Ye(e,t=0){if(e.aborted===true)return true;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==true)return true;return false}function Tu(e,t=0){if(e.aborted===true)return true;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===false)return true;return false}function st(e,t){return t.map(n=>{var r;return (r=n).path??(r.path=[]),n.path.unshift(e),n})}function Mr(e){return typeof e=="string"?e:e?.message}function Nr(e){let t=[];for(let n of e??[]){let r=n._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;let o=r.maximum??r.length??r.size;o>=0&&t.push([o,n]);}return t}function Wo(e,t,n){var r;for(let o=t;o<e.length;o++)(r=e[o]).schema??(r.schema=n);}function at(e,t,n){var r;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:Mr(e.inst?._zod.def?.error?.(e))??Mr(i?.(e))??Mr(t?.error?.(e))??Mr(n.customError?.(e))??Mr(n.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(a[c]=e[c]);return a.path??(a.path=[]),a.message=s,t?.reportInput&&(a.input=e.input),a}function Ho(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var Ix=/[\uD800-\uDBFF]/;function Un(e){let t=e.length;if(!Ix.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}function Yo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Nu(e){let t=typeof e;switch(t){case "number":return Number.isNaN(e)?"nan":"number";case "object":{if(e===null)return "null";if(Array.isArray(e))return "array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function Or(...e){let[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function Lx(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function mg(e){let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function pg(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function zx(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return mg(t+n)}function Tx(e){return pg(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Nx(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=Number.parseInt(t.slice(r,r+2),16);return n}function Ox(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var ku=class{constructor(...t){}};function Ou(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:false}):Dx(e,n,r.value);}}function fn(e,t,n,r=true){return Object.defineProperty(e,t,{configurable:true,writable:true,enumerable:r,value:n}),n}function Xo(e,t,n){return fn(e,t,n,false)}function Fx(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:true,enumerable:true,get(){return fn(this,n,r(this))},set(o){fn(this,n,o);}});}return t}function Dx(e,t,n){Object.defineProperty(e,t,{configurable:true,get(){return this==null?n:fn(this,t,n.bind(this))},set(r){fn(this,t,r);}});}function Zx(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Au,ln=false,Bx={configurable:true,get(){ln=true;}};function Y(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&Au!==e._zod){Au=void 0;return}Au=e._zod,Object.defineProperty(r,t,{configurable:true,get(){Object.defineProperty(this,t,Bx);let o=ln;ln=false;try{let i=n(this);return ln?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),ln=ln||o,i}catch(i){throw delete this[t],ln=ln||o,i}},set(o){Object.defineProperty(this,t,{configurable:true,writable:true,value:o});}});}function Gx(e,t,n,r){let o=Zx(e,t);o&&Object.defineProperty(o,t,{configurable:true,get(){let i={configurable:true,writable:true,enumerable:r,value:void 0};return Object.defineProperty(this,t,i),i.value=n(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:true,writable:true,enumerable:r,value:i});}});}var ds="~constantCatch";function Fu(e){let t=()=>e;return t[ds]=true,t}var dg,Zu=Object.freeze({status:"aborted"}),Du={value:void 0,enumerable:false},hg="captureStackTrace"in Error?Error:null;function Ux(e){let t=hg;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0;}catch{return hg=null,new e}try{return new e}finally{t.stackTraceLimit=n;}}}return new e}function P(e,t,n,r){let o={};function i(p){this.def=p,this.constr=f,this.traits=new Set;}i.prototype=o;let s=n,a=s&&new WeakSet;function c(p,m){if(p._zod){if(p._zod.traits.has(e))return}else {Du.value=new i(m);try{Object.defineProperty(p,"_zod",Du);}finally{Du.value=void 0;}}if(p._zod.traits.add(e),t(p,m),a){let d=Object.getPrototypeOf(p),g=p._zod.constr.prototype,_=d;for(;_&&_!==g;)_=Object.getPrototypeOf(_);let b=_??d;a.has(b)||(a.add(b),Ou(b,s));}let h=f.prototype;for(let d in h)Object.prototype.hasOwnProperty.call(h,d)&&(d in p||(p[d]=h[d].bind(p)));}let u=r?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function f(p){let m=r?.Parent?Ux(l):this;c(m,p);let h=m._zod.deferred;if(h){for(let g of h)g();m._zod.deferred=void 0;}let d=globalThis.__zod_globalConfig?.postProcessor;return d&&d(m),m}return Object.defineProperty(f,"init",{value:c}),Object.defineProperty(f,Symbol.hasInstance,{value:p=>r?.Parent&&p instanceof r.Parent?true:p?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}var Bu=Symbol("zod_brand"),ct=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");}},mn=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError";}};(dg=globalThis).__zod_globalConfig??(dg.__zod_globalConfig={});var Ze=globalThis.__zod_globalConfig;function Ee(e){return e&&Object.assign(Ze,e),Ze}function Qx(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Lr,2)),e.message}function Vx(e){this._zod.message=e;}var jx={get:Qx,set:Vx,enumerable:true,configurable:true},Uu={value:void 0,enumerable:false},gg=new WeakSet([Object.prototype,Error.prototype]),_g=(e,t)=>{e.name="$ZodError",Uu.value=t,Object.defineProperty(e,"issues",Uu),Uu.value=void 0,Object.defineProperty(e,"message",jx);let n=Object.getPrototypeOf(e);gg.has(n)||(gg.add(n),Object.defineProperty(n,"toString",{configurable:true,enumerable:false,get(){let r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:true,writable:true}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:true,writable:true});}}));},Qu=P("$ZodError",_g),ut=P("$ZodError",_g,void 0,{Parent:Error});function qx(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:true,enumerable:true,configurable:true}):e[t]=n()),e[t]}function Ko(e,t=n=>n.message){let n={},r=[];for(let o of e.issues)o.path.length>0?qx(n,o.path[0],()=>[]).push(t(o)):r.push(t(o));return {formErrors:r,fieldErrors:n}}function Jo(e,t=n=>n.message){let n={_errors:[]},r=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>r({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")r({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")r({issues:s.issues},[...i,...s.path]);else {let a=[...i,...s.path];if(a.length===0)n._errors.push(t(s));else {let c=n,u=0;for(;u<a.length;){let l=a[u],f=u===a.length-1;if(l==="_errors"){f&&c._errors.push(t(s)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:true,writable:true,configurable:true});let p=c[l];f&&p._errors.push(t(s)),c=p,u++;}}}};return r(e),n}function Vu(e,t=n=>n.message){let n={errors:[]},r=(o,i=[])=>{var s;for(let a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>r({issues:c},[...i,...a.path]));else if(a.code==="invalid_key")r({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")r({issues:a.issues},[...i,...a.path]);else {let c=[...i,...a.path];if(c.length===0){n.errors.push(t(a));continue}let u=n,l=0;for(;l<c.length;){let f=c[l],p=l===c.length-1;typeof f=="string"?(u.properties??(u.properties={}),Object.prototype.hasOwnProperty.call(u.properties,f)||Object.defineProperty(u.properties,f,{value:{errors:[]},enumerable:true,writable:true,configurable:true}),u=u.properties[f]):(u.items??(u.items=[]),(s=u.items)[f]??(s[f]={errors:[]}),u=u.items[f]),p&&u.errors.push(t(a)),l++;}}};return r(e),n}function bg(e){let t=[],n=e.map(r=>typeof r=="object"?r.key:r);for(let r of n)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function ju(e){let t=[],n=[...e.issues].sort((r,o)=>(r.path??[]).length-(o.path??[]).length);for(let r of n)t.push(`\u2716 ${r.message}`),r.path?.length&&t.push(` \u2192 at ${bg(r.path)}`);return t.join(`
|
|
2
|
+
`)}function hs(e,t){return {callee:t?.callee??e,Err:t?.Err}}var Fr=e=>{let t=(n,r,o,i)=>{let s=o?{...o,async:false}:{async:false},a=n._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new ct;if(a.issues.length){let c=new(i?.Err??e)(a.issues.map(u=>at(u,s,Ee())));throw fs(c,i?.callee??t),c}return a.value};return t},gs=Fr(ut),Dr=e=>{let t=async(n,r,o,i)=>{let s=o?{...o,async:true}:{async:true},a=n._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(i?.Err??e)(a.issues.map(u=>at(u,s,Ee())));throw fs(c,i?.callee??t),c}return a.value};return t},_s=Dr(ut),Zr=e=>(t,n,r)=>{let o=r?{...r,async:false}:{async:false},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new ct;return i.issues.length?yg(e,i.issues,o):{success:true,data:i.value}},Hx=Zr(ut);function yg(e,t,n){let r;return {success:false,get error(){return r||(r=new e(t.map(o=>at(o,n,Ee()))),t=void 0,n=void 0),r},set error(o){r=o,t=void 0,n=void 0;}}}var Br=e=>async(t,n,r)=>{let o=r?{...r,async:true}:{async:true},i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?yg(e,i.issues,o):{success:true,data:i.value}},Yx=Br(ut),Xx=Symbol.for("zod.compile.invalid"),Kx=Symbol.for("zod.compile.fallback"),ei=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Xx)return true;if(r.definite===true&&n===void 0)return false}return Jx(e,t,n)});function Jx(e,t,n){let r=n?{...n,async:false,abortEarly:true}:{async:false,abortEarly:true},o=e._zod.bag.fallbackRun,i;if(o?(r[Kx]=true,i=o({value:t,issues:[]},r)):i=e._zod.run({value:t,issues:[]},r),i instanceof Promise)throw new ct;return i.issues.length===0}var ti=async(e,t,n)=>{let r=n?{...n,async:true,abortEarly:true}:{async:true,abortEarly:true},o=e._zod.run({value:t,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length===0},bs=e=>{let t=Fr(e),n=(r,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return t(r,o,a,hs(n,s))};return n},e5=bs(ut),ys=e=>{let t=Fr(e),n=(r,o,i,s)=>t(r,o,i,hs(n,s));return n},t5=ys(ut),$s=e=>{let t=Dr(e),n=async(r,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return await t(r,o,a,hs(n,s))};return n},n5=$s(ut),xs=e=>{let t=Dr(e),n=async(r,o,i,s)=>await t(r,o,i,hs(n,s));return n},r5=xs(ut),ws=e=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return Zr(e)(t,n,o)},o5=ws(ut),Ss=e=>(t,n,r)=>Zr(e)(t,n,r),i5=Ss(ut),vs=e=>async(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return Br(e)(t,n,o)},s5=vs(ut),Cs=e=>async(t,n,r)=>Br(e)(t,n,r),a5=Cs(ut);var wt={};un(wt,{anyString:()=>yl,base64:()=>ll,base64url:()=>fl,bigint:()=>xl,boolean:()=>wl,browserEmail:()=>h5,cidrv4:()=>cl,cidrv6:()=>ul,creditCard:()=>Ps,cuid:()=>Wu,cuid2:()=>Hu,currencyCode:()=>hl,date:()=>gl,datetime:()=>bl,domain:()=>pl,duration:()=>tl,e164:()=>dl,email:()=>rl,emoji:()=>ol,extendedDuration:()=>c5,guid:()=>nl,hex:()=>Al,hostname:()=>ml,html5Email:()=>m5,httpProtocol:()=>ni,iban:()=>As,idnEmail:()=>d5,integer:()=>ri,ipv4:()=>il,ipv6:()=>sl,ksuid:()=>Ku,lowercase:()=>Cl,mac:()=>al,md5_base64:()=>y5,md5_base64url:()=>$5,md5_hex:()=>b5,nanoid:()=>Ju,nanoidOfLength:()=>el,null:()=>Sl,number:()=>Yt,rfc5322Email:()=>p5,sha1_base64:()=>w5,sha1_base64url:()=>S5,sha1_hex:()=>x5,sha256_base64:()=>C5,sha256_base64url:()=>P5,sha256_hex:()=>v5,sha384_base64:()=>E5,sha384_base64url:()=>k5,sha384_hex:()=>A5,sha512_base64:()=>M5,sha512_base64url:()=>I5,sha512_hex:()=>R5,string:()=>$l,time:()=>_l,ulid:()=>Yu,undefined:()=>vl,unicodeEmail:()=>$g,uppercase:()=>Pl,uuid:()=>Qn,uuid4:()=>u5,uuid6:()=>l5,uuid7:()=>f5,xid:()=>Xu});var Wu=/^[cC][0-9a-z]{6,}$/,Hu=/^[0-9a-z]+$/,Yu=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Xu=/^[0-9a-vA-V]{20}$/,Ku=/^[A-Za-z0-9]{27}$/,Ju=/^[a-zA-Z0-9_-]{21}$/;function el(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var tl=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,c5=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,nl=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Qn=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,u5=Qn(4),l5=Qn(6),f5=Qn(7),rl=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,m5=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,p5=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,$g=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,d5=$g,h5=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,g5="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function ol(){return new RegExp(g5,"u")}var il=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,sl=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,al=e=>{let t=xt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},cl=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ul=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ll=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fl=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,ml=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,pl=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,ni=/^https?$/,dl=/^\+[1-9]\d{6,14}$/,Ps=/^\d(?:[ -]?\d){11,18}$/,hl=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,As=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,xg="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function _5(e){return new RegExp(`^${e}$`)}var gl=_5(xg);function qu(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function _l(e){return new RegExp(`^${qu(e)}$`)}function bl(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${qu({precision:e.precision,seconds:true})}(?:${t.join("|")})`,r=e.local?`${n}|${qu({precision:e.precision})}`:n;return new RegExp(`^${xg}T(?:${r})$`)}var yl=/^[\s\S]{0,}$/,$l=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},xl=/^-?\d+n?$/,ri=/^-?\d+$/,Yt=/^-?\d+(?:\.\d+)?$/,wl=/^(?:true|false)$/i,Sl=/^null$/i;var vl=/^undefined$/i;var Cl=/^[^A-Z]*$/,Pl=/^[^a-z]*$/,Al=/^[0-9a-fA-F]*$/;function oi(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function ii(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var b5=/^[0-9a-fA-F]{32}$/,y5=oi(22,"=="),$5=ii(22),x5=/^[0-9a-fA-F]{40}$/,w5=oi(27,"="),S5=ii(27),v5=/^[0-9a-fA-F]{64}$/,C5=oi(43,"="),P5=ii(43),A5=/^[0-9a-fA-F]{96}$/,E5=oi(64,""),k5=ii(64),R5=/^[0-9a-fA-F]{128}$/,M5=oi(86,"=="),I5=ii(86);var he=P("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[]);}),El=e=>{let t=e.value;return !ls(t)&&t.size!==void 0},kl=e=>{let t=e.value;return !ls(t)&&t.length!==void 0},Es={number:"number",bigint:"bigint",object:"date"},Rs=P("$ZodCheckLessThan",(e,t)=>{he.init(e,t);let n=Es[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Es[typeof r.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort});};}),Ms=P("$ZodCheckGreaterThan",(e,t)=>{he.init(e,t);let n=Es[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Es[typeof r.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort});};}),Rl=P("$ZodCheckMultipleOf",(e,t)=>{he.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):Uo(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort});};}),Ml=P("$ZodCheckNumberFormat",(e,t)=>{he.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[o,i]=jo[t.format];e._zod.check=s=>{let a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:false,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:true,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:true,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:true,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:true,inst:e,continue:!t.abort});};}),Il=P("$ZodCheckBigIntFormat",(e,t)=>{he.init(e,t);let[n,r]=qo[t.format];e._zod.check=o=>{let i=o.value;i<n&&o.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:true,inst:e,continue:!t.abort}),i>r&&o.issues.push({origin:"bigint",input:i,code:"too_big",maximum:r,inclusive:true,inst:e,continue:!t.abort});};}),Ll=P("$ZodCheckMaxSize",(e,t)=>{var n;he.init(e,t),(n=e._zod.def).when??(n.when=El),e._zod.check=r=>{let o=r.value;o.size<=t.maximum||r.issues.push({origin:Ho(o),code:"too_big",maximum:t.maximum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),zl=P("$ZodCheckMinSize",(e,t)=>{var n;he.init(e,t),(n=e._zod.def).when??(n.when=El),e._zod.check=r=>{let o=r.value;o.size>=t.minimum||r.issues.push({origin:Ho(o),code:"too_small",minimum:t.minimum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),Tl=P("$ZodCheckSizeEquals",(e,t)=>{var n;he.init(e,t),(n=e._zod.def).when??(n.when=El),e._zod.check=r=>{let o=r.value,i=o.size;if(i===t.size)return;let s=i>t.size;r.issues.push({origin:Ho(o),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:true,exact:true,input:r.value,inst:e,continue:!t.abort});};}),Nl=P("$ZodCheckMaxLength",(e,t)=>{var n;he.init(e,t),(n=e._zod.def).when??(n.when=kl),e._zod.check=r=>{let o=r.value,i=o.length;if((typeof o=="string"&&i>t.maximum?Un(o):i)<=t.maximum)return;let a=Yo(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),Ol=P("$ZodCheckMinLength",(e,t)=>{var n;he.init(e,t),(n=e._zod.def).when??(n.when=kl),e._zod.check=r=>{let o=r.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?Un(o):i)>=t.minimum)return;let a=Yo(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),Fl=P("$ZodCheckLengthEquals",(e,t)=>{var n;he.init(e,t),(n=e._zod.def).when??(n.when=kl),e._zod.check=r=>{let o=r.value,i=o.length,s=typeof o=="string"&&i>=t.length&&i<=t.length*2?Un(o):i;if(s===t.length)return;let a=Yo(o),c=s>t.length;r.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:true,exact:true,input:r.value,inst:e,continue:!t.abort});};}),Gr=P("$ZodCheckStringFormat",(e,t)=>{var n,r;he.init(e,t),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort});}):(r=e._zod).check??(r.check=()=>{});}),Dl=P("$ZodCheckRegex",(e,t)=>{Gr.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort});};}),Zl=P("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Cl),Gr.init(e,t);}),Bl=P("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Pl),Gr.init(e,t);}),Gl=P("$ZodCheckIncludes",(e,t)=>{he.init(e,t);let n=xt(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort});};}),Ul=P("$ZodCheckStartsWith",(e,t)=>{he.init(e,t);let n=new RegExp(`^${xt(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort});};}),Ql=P("$ZodCheckEndsWith",(e,t)=>{he.init(e,t);let n=new RegExp(`.*${xt(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort});};});function ks(e,t,n){e.issues.length&&t.issues.push(...st(n,e.issues));}var Vl=P("$ZodCheckProperty",(e,t)=>{he.init(e,t),e._zod.check=n=>{let r=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(o=>ks(o,n,t.property));ks(r,n,t.property);};}),jl=P("$ZodCheckProperties",(e,t)=>{he.init(e,t),Xo(e,Symbol.iterator,function*(){yield e;});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:"object",code:"invalid_type",input:r.value,inst:e});return}n??(n=Reflect.ownKeys(t.shape).map(s=>[s,t.shape[s]]));let o=r.value,i;for(let[s,a]of n){let c=a._zod.run({value:o[s],issues:[]},{});c instanceof Promise?(i??(i=[]),i.push(c.then(u=>ks(u,r,s)))):ks(c,r,s);}if(i)return Promise.all(i).then(()=>{})};}),ql=P("$ZodCheckMimeType",(e,t)=>{he.init(e,t);let n=new Set(t.mime);e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort});};}),Wl=P("$ZodCheckOverwrite",(e,t)=>{he.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value);};});var Vn=class{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n;}indented(t){this.indent+=1;try{t(this);}finally{this.indent-=1;}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let r=t.split(`
|
|
3
|
+
`).filter(s=>s),o=Math.min(...r.map(s=>s.length-s.trimStart().length)),i=r.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s);}compile(){let t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
4
|
+
${n.join(`
|
|
5
|
+
`)}
|
|
6
|
+
};`)(...Object.values(this.closed))}};var Hl={major:4,minor:6,patch:7};var q=P("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Hl;let r=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r?.length?[...r]:[];for(let i of o)for(let s of i._zod.onattach)s(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse;});else {let i=(a,c,u)=>{if(a.memo)return a;let l=Ye(a),f;for(let p of c){if(p._zod.def.when){if(Tu(a)||!p._zod.def.when(a))continue}else if(l)continue;let m=a.issues.length,h=p._zod.check(a);if(h instanceof Promise&&u?.async===false)throw new ct;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,a.issues.length!==m&&(Wo(a.issues,m,e),l||(l=Ye(a,m)));});else {if(a.issues.length===m)continue;Wo(a.issues,m,e),l||(l=Ye(a,m));}}return f?f.then(()=>a):a},s=(a,c,u)=>{if(Ye(a))return a.aborted=true,a;let l=i(c,o,u);if(l instanceof Promise){if(u.async===false)throw new ct;return l.then(f=>e._zod.parse(f,u))}return e._zod.parse(l,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:true});return l instanceof Promise?l.then(f=>s(f,a,c)):s(l,a,c)}let u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===false)throw new ct;return u.then(l=>i(l,o,c))}return i(u,o,c)};}},{get"~standard"(){return Xo(this,"~standard",Ns(this))},set"~standard"(e){fn(this,"~standard",e);}}),Fg=(e,t)=>e.issues.length?{issues:e.issues.map(n=>at(n,t,Ee()))}:{value:e.value};async function L5(e,t){let n={async:true};return Fg(await e._zod.run({value:t,issues:[]},n),n)}function Ns(e){return {validate:t=>{let n={async:false};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Fg(r,n)}catch{}return L5(e,t)},vendor:"zod",version:1}}var jn=P("$ZodString",(e,t)=>{q.init(e,t),e._zod.pattern=t.pattern??yl,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value);}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n};}),ue=P("$ZodStringFormat",(e,t)=>{Gr.init(e,t),jn.init(e,t);}),Xl=P("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=nl),ue.init(e,t);}),Kl=P("$ZodUUID",(e,t)=>{if(t.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Qn(r));}else t.pattern??(t.pattern=Qn());ue.init(e,t);}),Jl=P("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=rl),ue.init(e,t);}),ef=1,si=2;function tf(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return false}}function Os(e,t){return !("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?tf(e)||si:Dg(e,t)}function Dg(e,t){if(!t.normalize&&t.protocol?.source===ni.source&&!/^https?:\/\//i.test(e))return ef;try{if(typeof URL<"u"){let n=URL;if(typeof n.parse=="function")return n.parse(e)??si}return new URL(e)}catch{return si}}var z5=/[\t\n\r]/g;function ai(e){return e.replace(z5,"")}function Fs(e,t){return t.lastIndex=0,t.test(e.hostname)}function Ds(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var nf=P("$ZodURL",(e,t)=>{ue.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),o=Os(r,t);if(o===ef){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(o===si){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}if(o===!0){n.value=ai(r);return}t.hostname&&!Fs(o,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Ds(o,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?o.href:ai(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});}};}),rf=P("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=ol()),ue.init(e,t);}),of=P("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Ju:el(t.length)),ue.init(e,t);}),sf=P("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Wu),ue.init(e,t);}),af=P("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Hu),ue.init(e,t);}),cf=P("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Yu),ue.init(e,t);}),uf=P("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Xu),ue.init(e,t);}),lf=P("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ku),ue.init(e,t);}),ff=P("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=bl(t)),ue.init(e,t);}),mf=P("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=gl),ue.init(e,t);}),pf=P("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=_l(t)),ue.init(e,t);}),df=P("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=tl),ue.init(e,t);}),hf=P("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=il),ue.init(e,t);}),T5=/^[0-9a-fA-F:.]+$/;function ci(e){return T5.test(e)?tf(`http://[${e}]`):false}var gf=P("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=sl),ue.init(e,t),e._zod.check=n=>{ci(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort});};}),_f=P("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=al(t.delimiter)),ue.init(e,t);}),bf=P("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=cl),ue.init(e,t);});function Zs(e){let t=e.split("/");if(t.length!==2)return false;let[n,r]=t;if(!r)return false;let o=Number(r);return `${o}`!==r||o<0||o>128?false:ci(n)}var yf=P("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ul),ue.init(e,t),e._zod.check=n=>{Zs(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort});};});function ui(e){if(e==="")return true;if(/\s/.test(e)||e.length%4!==0)return false;try{return atob(e),!0}catch{return false}}var Bs=/^[0-9a-zA-Z+/]*={0,2}$/,$f=P("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Bs),ue.init(e,t),e._zod.check=n=>{ui(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort});};}),li=/^[A-Za-z0-9_-]*$/;function Gs(e){if(!li.test(e))return false;let t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return ui(n)}var xf=P("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=li),ue.init(e,t),e._zod.check=n=>{Gs(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort});};}),wf=P("$ZodE164",(e,t)=>{t.pattern??(t.pattern=dl),ue.init(e,t);}),N5=/[- ]/g;function O5(e){let t=e.length,n=1,r=0;for(;t;){let o=e.charCodeAt(--t)-48;n^=1,r+=n?[0,2,4,6,8,1,3,5,7,9][o]:o;}return r%10===0}function Us(e){return Ps.test(e)?O5(e.replace(N5,"")):false}var Sf=P("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=Ps),ue.init(e,t),e._zod.check=n=>{Us(n.value)||n.issues.push({code:"invalid_format",format:"credit_card",input:n.value,inst:e,continue:!t.abort});};});function F5(e){let t=0,n=e.length;for(let r=4;r<n;r++){let o=e.charCodeAt(r);t=(o>=65?t*100+(o-55):t*10+(o-48))%97;}for(let r=0;r<4;r++){let o=e.charCodeAt(r);t=(o>=65?t*100+(o-55):t*10+(o-48))%97;}return t===1}function Qs(e){return As.test(e)?F5(e):false}var vf=P("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=As),ue.init(e,t),e._zod.check=n=>{Qs(n.value)||n.issues.push({code:"invalid_format",format:"iban",input:n.value,inst:e,continue:!t.abort});};});function Vs(e,t=null){try{let n=e.split(".");if(n.length!==3)return !1;let[r]=n;if(!r)return !1;let o=JSON.parse(atob(r));return !("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return false}}var Cf=P("$ZodJWT",(e,t)=>{ue.init(e,t),e._zod.check=n=>{Vs(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort});};}),Pf=P("$ZodCustomStringFormat",(e,t)=>{ue.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort});};}),js=P("$ZodNumber",(e,t)=>{q.init(e,t),e._zod.pattern=Yt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value);}catch{}let o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n};}),Af=P("$ZodNumberFormat",(e,t)=>{Ml.init(e,t),js.init(e,t);}),fi=P("$ZodBoolean",(e,t)=>{q.init(e,t),e._zod.pattern=wl,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value;}catch{}let o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n};}),qs=P("$ZodBigInt",(e,t)=>{q.init(e,t),e._zod.pattern=xl,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value);}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n};}),Ef=P("$ZodBigIntFormat",(e,t)=>{Il.init(e,t),qs.init(e,t);}),kf=P("$ZodSymbol",(e,t)=>{q.init(e,t),e._zod.parse=(n,r)=>{let o=n.value;return typeof o=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:e}),n};}),Rf=P("$ZodUndefined",(e,t)=>{q.init(e,t),e._zod.pattern=vl,e._zod.values=new Set([void 0]),e._zod.parse=(n,r)=>{let o=n.value;return typeof o>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:e}),n};}),Mf=P("$ZodNull",(e,t)=>{q.init(e,t),e._zod.pattern=Sl,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{let o=n.value;return o===null||n.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),n};}),If=P("$ZodAny",(e,t)=>{q.init(e,t),e._zod.parse=n=>n;}),Lf=P("$ZodUnknown",(e,t)=>{q.init(e,t),e._zod.parse=n=>n;}),zf=P("$ZodNever",(e,t)=>{q.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n);}),Tf=P("$ZodVoid",(e,t)=>{q.init(e,t),e._zod.parse=(n,r)=>{let o=n.value;return typeof o>"u"||n.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),n};}),Nf=P("$ZodDate",(e,t)=>{q.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value);}catch{}let o=n.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),n};});function Of(e,t){let n=Nr(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(i=>i[0])),o=e._zod.parse;e._zod.parse=(i,s)=>{let a=t(i.value);if(a>r&&!s?.skipChecks&&s?.direction!=="backward"){for(let[c,u]of Nr(e._zod.def.checks))if(a>c&&u._zod.def.when(i)){let l=i.issues.length;return u._zod.check(i),i.issues[l].continue=false,Wo(i.issues,l,e),i}}return o(i,s)};}var D5=e=>Array.isArray(e)?e.length:-1,Z5=e=>e instanceof Map?e.size:-1,B5=e=>e instanceof Set?e.size:-1;function Sg(e,t,n){e.issues.length&&t.issues.push(...st(n,e.issues)),t.value[n]=e.value;}var Ff=P("$ZodArray",(e,t)=>{q.init(e,t);let n=Ze.memoizer;n?.attach(e),e._zod.parse=(r,o)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=n?n.alloc(e,r,Array(i.length),o):Array(i.length);let s=[],a=o?.abortEarly;for(let c=0;c<i.length;c++){let u=i[c],l=t.element._zod.run({value:u,issues:[]},o);if(l instanceof Promise)s.push(l.then(f=>Sg(f,r,c)));else if(Sg(l,r,c),a&&l.issues.length!==0&&Ye(l))break}return s.length?Promise.all(s).then(()=>r):r},Of(e,D5);});function Ts(e,t,n,r,o,i){let s=n in r,a=i==="optional";if(!(!s&&a&&o==="optional")){if(e.issues.length){if(o!==void 0&&a&&!s)return;t.issues.push(...st(n,e.issues));}if(!s&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(s||o==="defaulted"&&!a)&&(t.value[n]=void 0):t.value[n]=e.value;}}var G5=[];function Zg(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:G5,o=r.length?[...t,...r]:t;for(let s of o)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=zu(e.shape);return {...e,allKeys:o,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function Bg(e,t,n,r,o,i,s){let a=[],c=o.keySet,u=o.catchall._zod,l=u.def.type,f=u.optin,p=u.optout,m=0;for(let h in t){if(s&&n.issues.length!==m){if(Ye(n,m))break;m=n.issues.length;}if(c.has(h))continue;if(h==="__proto__"){l==="never"&&a.push(h);continue}if(l==="never"){a.push(h);continue}let d=u.run({value:t[h],issues:[]},r);d instanceof Promise?e.push(d.then(g=>Ts(g,n,h,t,f,p))):Ts(d,n,h,t,f,p);}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i,continue:true}),e.length?Promise.all(e).then(()=>n):n}var Gg=P("$ZodObject",(e,t)=>{q.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape"),r=n?.get?n.get.raw:t.shape??{};if(r){let u=()=>{let l={...r};return Object.defineProperty(t,"shape",{value:l}),u.raw=l,l};u.raw=r,Object.defineProperty(t,"shape",{get:u});}let o=zr(()=>Zg(t));Y(e,"propValues",u=>{let l=u.def.shape,f={};for(let p in l){let m=l[p]._zod;if(m.values){Object.prototype.hasOwnProperty.call(f,p)||Qe(f,p,new Set);for(let h of m.values)f[p].add(h);m.optin!==void 0&&f[p].add(void 0);}}return f});let i=Gn,s=t.catchall,a,c=Ze.memoizer;c?.attach(e),e._zod.parse=(u,l)=>{a??(a=o.value);let f=u.value;if(!i(f))return u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u;u.value=c?c.alloc(e,u,{},l):{};let p=[],m=a.shape,h=l?.abortEarly,d=u.issues.length;for(let g of a.allKeys){if(h&&u.issues.length!==d){if(Ye(u,d))break;d=u.issues.length;}if(g==="__proto__")continue;let _=m[g],b=_._zod.optin,y=_._zod.optout,S=_._zod.run({value:f[g],issues:[]},l);S instanceof Promise?p.push(S.then(v=>Ts(v,u,g,f,b,y))):Ts(S,u,g,f,b,y);}return s?Bg(p,f,u,l,o.value,e,h===true):p.length?Promise.all(p).then(()=>u):u};}),Df=P("$ZodObjectJIT",(e,t)=>{Gg.init(e,t);let n=e._zod.parse,r=zr(()=>Zg(t)),o=Ze.memoizer,i=m=>{let h=r.value,d=h.symbolKeys,g=new Vn(["payload","ctx"],{shape:m,inst:e,memo:o,syms:d}),_=v=>`shape[${v}]._zod.run({ value: input[${v}], issues: [] }, ctx)`,b=(v,$)=>`
|
|
7
|
+
let ${v}_ab = false;
|
|
8
|
+
for (let i = 0; i < ${v}.issues.length; i++) {
|
|
9
|
+
const iss = ${v}.issues[i];
|
|
10
|
+
iss.path = iss.path ? [${$}, ...iss.path] : [${$}];
|
|
11
|
+
payload.issues.push(iss);
|
|
12
|
+
if (iss.continue !== true) ${v}_ab = true;
|
|
13
|
+
}
|
|
14
|
+
if (${v}_ab && ctx && ctx.abortEarly) {
|
|
15
|
+
payload.value = newResult;
|
|
16
|
+
return payload;
|
|
17
|
+
}`;g.write("const input = payload.value;");let y=Object.create(null),S=0;for(let v of h.allKeys)y[v]=`key_${S++}`;g.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let v of h.allKeys){if(v==="__proto__")continue;let $=y[v],w=typeof v=="symbol"?`syms[${d.indexOf(v)}]`:He(v),A=`${w} in input`,C=m[v],R=C?._zod?.optin,I=R!==void 0,L=C?._zod?.optout==="optional";if(g.write(`const ${$} = ${_(w)};`),I&&L){let z=R==="optional"?`${$}_present`:`${$}.value !== undefined || ${$}_present`;g.write(`
|
|
18
|
+
const ${$}_present = ${A};
|
|
19
|
+
if (!${$}.issues.length || ${$}_present) {
|
|
20
|
+
if (${$}.issues.length) {${b($,w)}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (${z}) {
|
|
24
|
+
newResult[${w}] = ${$}.value;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
`);}else I?(g.write(`
|
|
29
|
+
if (${$}.issues.length) {${b($,w)}
|
|
30
|
+
}
|
|
31
|
+
`),R==="defaulted"?g.write(`newResult[${w}] = ${$}.value;`):g.write(`
|
|
32
|
+
if (${$}.value !== undefined || ${A}) {
|
|
33
|
+
newResult[${w}] = ${$}.value;
|
|
34
|
+
}
|
|
35
|
+
`)):g.write(`
|
|
36
|
+
const ${$}_present = ${A};
|
|
37
|
+
if (${$}.issues.length) {${b($,w)}
|
|
38
|
+
}
|
|
39
|
+
if (!${$}_present && !${$}.issues.length) {
|
|
40
|
+
payload.issues.push({
|
|
41
|
+
code: "invalid_type",
|
|
42
|
+
expected: "nonoptional",
|
|
43
|
+
input: undefined,
|
|
44
|
+
path: [${w}]
|
|
45
|
+
});
|
|
46
|
+
if (ctx && ctx.abortEarly) {
|
|
47
|
+
payload.value = newResult;
|
|
48
|
+
return payload;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (${$}_present) {
|
|
53
|
+
newResult[${w}] = ${$}.value;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
`);}return g.write("payload.value = newResult;"),g.write("return payload;"),g.compile()},s,a=Gn,c=!Ze.jitless,l=c&&Iu.value,f=t.catchall,p;e._zod.parse=(m,h)=>{p??(p=r.value);let d=m.value;return a(d)?c&&l&&h?.async===false&&h.jitless!==true?(s||(s=i(t.shape)),m=s(m,h),f?Bg([],d,m,h,p,e,h?.abortEarly===true):m):n(m,h):(m.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),m)};});function vg(e,t,n,r){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter(i=>!Ye(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(s=>at(s,r,Ee())))}),t)}var mi=P("$ZodUnion",(e,t)=>{q.init(e,t),Y(e,"optin",r=>r.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":r.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),Y(e,"optout",r=>r.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Y(e,"values",r=>{if(r.def.options.every(o=>o._zod.values))return new Set(r.def.options.flatMap(o=>Array.from(o._zod.values)))}),Y(e,"pattern",r=>{if(r.def.options.every(o=>o._zod.pattern)){let o=r.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>Ht(i.source)).join("|")})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let i=false,s=[];for(let a of t.options){let c=a._zod.run({value:r.value,issues:[]},o);if(c instanceof Promise)s.push(c),i=true;else {if(c.issues.length===0)return c;s.push(c);}}return i?Promise.all(s).then(a=>vg(a,r,e,o)):vg(s,r,e,o)};});function Cg(e,t,n,r){let o=[];for(let i=0;i<e.length;i++)e[i].issues.length===0&&o.push(i);return o.length===1?(t.value=e[o[0]].value,t):(o.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(s=>at(s,r,Ee())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:false,matches:o}),t)}var Zf=P("$ZodXor",(e,t)=>{mi.init(e,t),t.inclusive=false;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let i=false,s=[];for(let a of t.options){let c=a._zod.run({value:r.value,issues:[]},o);c instanceof Promise?(s.push(c),i=true):s.push(c);}return i?Promise.all(s).then(a=>Cg(a,r,e,o)):Cg(s,r,e,o)};});function Bf(e,t){let n=e._zod,r=n.bag.optionsMap;r||(r=Ug(n.def),n.bag.optionsMap=r);let o=r.get(t);if(o===null)throw new Error(`Ambiguous discriminator value "${String(t)}"`);return o}function Ug(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let o of r)if(t.has(o)){if(o!==void 0)throw new Error(`Duplicate discriminator value "${String(o)}"`);t.set(o,null);}else t.set(o,n);}return t}var Gf=P("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=false,mi.init(e,t);let n=e._zod.parse;Y(e,"propValues",o=>{let i={},s=0;for(let a of o.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${o.def.options.indexOf(a)}"`);c[o.def.discriminator]?.has(void 0)&&s++;for(let[u,l]of Object.entries(c)){Object.prototype.hasOwnProperty.call(i,u)||Qe(i,u,new Set);for(let f of l)i[u].add(f);}}return !o.def.unionFallback&&s>1&&i[o.def.discriminator]?.delete(void 0),i}),t.options.forEach((o,i)=>{let s=Tr(o._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,t.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});let r=zr(()=>Ug(t));e._zod.parse=(o,i)=>{let s=o.value;if(!Gn(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let a=s?.[t.discriminator],c=r.value.get(a);return c&&(a!==void 0||i.direction!=="backward")?c._zod.run(o,i):t.unionFallback||i.direction==="backward"?n(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(u=>r.value.get(u)!==null),input:s,path:[t.discriminator],inst:e}),o)};}),Uf=P("$ZodIntersection",(e,t)=>{q.init(e,t),e._zod.parse=(n,r)=>{let o=n.value,i=t.left._zod.run({value:o,issues:[]},r),s=t.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([c,u])=>Pg(n,c,u)):Pg(n,i,s)};});function Ur(e,t){if(e===t)return {valid:true,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return {valid:true,data:e};if($t(e)&&$t(t)){let n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(let i of r){if(i==="__proto__")continue;let s=Ur(e[i],t[i]);if(!s.valid)return {valid:false,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data;}return {valid:true,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return {valid:false,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t[r],s=Ur(o,i);if(!s.valid)return {valid:false,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data);}return {valid:true,data:n}}return {valid:false,mergeErrorPath:[]}}function Pg(e,t,n){let r=new Map,o,i=new Map,s=(u,l)=>{let f;if(u.code==="unrecognized_keys"&&!u.path?.length)o??(o=u),f=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let p=String(u.path[0]);i.has(p)||i.set(p,u),f=[p];}else return false;for(let p of f)r.has(p)||r.set(p,{}),r.get(p)[l]=true;return true};for(let u of t.issues)s(u,"l")||e.issues.push(u);for(let u of n.issues)s(u,"r")||e.issues.push(u);let a=[...r].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){let u=o?a.filter(l=>o.keys.includes(l)):[];u.length&&e.issues.push({...o,keys:u});for(let l of a)!u.includes(l)&&i.has(l)&&e.issues.push(i.get(l));}let c=Ur(t.value,n.value);if(!c.valid){if(Ye(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Ws=P("$ZodTuple",(e,t)=>{q.init(e,t);let n=t.items,r=Ze.memoizer;r?.attach(e),e._zod.parse=(o,i)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=r?r.alloc(e,o,[],i):[];let a=[],c=Ag(n,"optin"),u=Ag(n,"optout");if(!t.rest){if(s.length<c)return o.issues.push({code:"too_small",minimum:c,inclusive:true,input:s,inst:e,origin:"array"}),o;s.length>n.length&&o.issues.push({code:"too_big",maximum:n.length,inclusive:true,input:s,inst:e,origin:"array"});}let l=new Array(n.length),f=t.rest?i?.abortEarly:void 0,p=false;for(let m=0;m<n.length;m++){let h=n[m]._zod.run({value:s[m],issues:[]},i);h instanceof Promise?a.push(h.then(d=>{l[m]=d;})):(l[m]=h,f&&!p&&h.issues.length&&(p=Ye(h)));}if(t.rest&&!p){let m=n.length-1,h=s.slice(n.length),d=o.issues.length;for(let g of h){if(f&&o.issues.length!==d){if(Ye(o,d))break;d=o.issues.length;}m++;let _=t.rest._zod.run({value:g,issues:[]},i);_ instanceof Promise?a.push(_.then(b=>Eg(b,o,m))):Eg(_,o,m);}}return a.length?Promise.all(a).then(()=>kg(l,o,n,s,u)):kg(l,o,n,s,u)};});function Ag(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function Eg(e,t,n){e.issues.length&&t.issues.push(...st(n,e.issues)),t.value[n]=e.value;}function kg(e,t,n,r,o){for(let i=0;i<n.length;i++){let s=e[i],a=i<r.length;if(!a&&i>=o&&n[i]._zod.optin==="optional"){t.value.length=i;break}if(s.issues.length){if(!a&&i>=o){t.value.length=i;break}t.issues.push(...st(i,s.issues));}t.value[i]=s.value;}for(let i=t.value.length-1;i>=r.length&&(n[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}var Qf=P("$ZodRecord",(e,t)=>{q.init(e,t);let n=Ze.memoizer;n?.attach(e),e._zod.parse=(r,o)=>{let i=r.value;if(!$t(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let s=[],a=t.keyType._zod.values;if(a&&!t.partial){r.value=n?n.alloc(e,r,{},o):{};let c=new Set;for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){if(c.add(typeof l=="number"?l.toString():l),l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(f.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(h=>at(h,o,Ee())),input:l,path:[l],inst:e});continue}let p=f.value;if(p==="__proto__")continue;let m=t.valueType._zod.run({value:i[l],issues:[]},o);m instanceof Promise?s.push(m.then(h=>{h.issues.length&&r.issues.push(...st(l,h.issues)),r.value[p]=h.value;})):(m.issues.length&&r.issues.push(...st(l,m.issues)),r.value[p]=m.value);}let u;for(let l in i)if(!c.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;r.value[l]=i[l];}else u=u??[],u.push(l);u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:u,continue:true});}else {r.value=n?n.alloc(e,r,{},o):{};let c;for(let u of Reflect.ownKeys(i)){if(u==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,u))continue;let l=t.keyType._zod.run({value:u,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&Yt.test(u)&&l.issues.length){let h=t.keyType._zod.run({value:Number(u),issues:[]},o);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(l=h);}if(l.issues.length){t.mode==="loose"?r.value[u]=i[u]:a?(c=c??[],c.push(u)):r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(h=>at(h,o,Ee())),input:u,path:[u],inst:e});continue}let p=l.value;if(p==="__proto__")continue;let m=t.valueType._zod.run({value:i[u],issues:[]},o);m instanceof Promise?s.push(m.then(h=>{h.issues.length&&r.issues.push(...st(u,h.issues)),r.value[p]=h.value;})):(m.issues.length&&r.issues.push(...st(u,m.issues)),r.value[p]=m.value);}c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c,continue:true});}return s.length?Promise.all(s).then(()=>r):r};}),Vf=P("$ZodMap",(e,t)=>{q.init(e,t);let n=Ze.memoizer;n?.attach(e),e._zod.parse=(r,o)=>{let i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),r;let s=[];r.value=n?n.alloc(e,r,new Map,o):new Map;let a=o?.abortEarly,c=r.issues.length;for(let[u,l]of i){if(a&&r.issues.length!==c){if(Ye(r,c))break;c=r.issues.length;}let f=t.keyType._zod.run({value:u,issues:[]},o),p=t.valueType._zod.run({value:l,issues:[]},o);f instanceof Promise||p instanceof Promise?s.push(Promise.all([f,p]).then(([m,h])=>{Rg(m,h,r,u,i,e,o);})):Rg(f,p,r,u,i,e,o);}return s.length?Promise.all(s).then(()=>r):r},Of(e,Z5);});function Rg(e,t,n,r,o,i,s){e.issues.length&&(Vo.has(typeof r)?n.issues.push(...st(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:o,inst:i,issues:e.issues.map(a=>at(a,s,Ee()))})),t.issues.length&&(Vo.has(typeof r)?n.issues.push(...st(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:o,inst:i,key:r,issues:t.issues.map(a=>at(a,s,Ee()))})),n.value.set(e.value,t.value);}var jf=P("$ZodSet",(e,t)=>{q.init(e,t);let n=Ze.memoizer;n?.attach(e),e._zod.parse=(r,o)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),r;let s=[];r.value=n?n.alloc(e,r,new Set,o):new Set;let a=o?.abortEarly,c=r.issues.length;for(let u of i){if(a&&r.issues.length!==c){if(Ye(r,c))break;c=r.issues.length;}let l=t.valueType._zod.run({value:u,issues:[]},o);l instanceof Promise?s.push(l.then(f=>Mg(f,r))):Mg(l,r);}return s.length?Promise.all(s).then(()=>r):r},Of(e,B5);});function Mg(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value);}var qf=P("$ZodEnum",(e,t)=>{q.init(e,t);let n=Ir(t.entries),r=new Set(n);e._zod.values=r,Y(e,"pattern",o=>{let i=Ir(o.def.entries).filter(s=>Vo.has(typeof s));return new RegExp(i.length?`^(${i.map(s=>xt(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:n,input:s,inst:e}),o};}),Wf=P("$ZodLiteral",(e,t)=>{q.init(e,t);let n=new Set(t.values);e._zod.values=n,Y(e,"pattern",r=>{let o=r.def.values;return new RegExp(o.length?`^(${o.map(i=>typeof i=="string"?xt(i):i?xt(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(r,o)=>{let i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r};}),Hf=P("$ZodFile",(e,t)=>{q.init(e,t),e._zod.parse=(n,r)=>{let o=n.value;return o instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:o,inst:e}),n};}),Yf=P("$ZodTransform",(e,t)=>{q.init(e,t),e._zod.optin="optional",Ze.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new mn(e.constructor.name);let o=t.transform(n.value,n);if(r.async)return (o instanceof Promise?o:Promise.resolve(o)).then(s=>(n.value=s,n));if(o instanceof Promise)throw new ct;return n.value=o,n};});function Ig(e,t){return e.value=t.issues.length?void 0:t.value,e}var Hs=P("$ZodOptional",(e,t)=>{q.init(e,t),Y(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Y(e,"values",n=>{let r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),Y(e,"pattern",n=>{let r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${Ht(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;let o=t.innerType._zod.run({value:n.value,issues:[]},r);return o instanceof Promise?o.then(i=>Ig(n,i)):Ig(n,o)}return t.innerType._zod.run(n,r)};}),Xf=P("$ZodExactOptional",(e,t)=>{Hs.init(e,t),Y(e,"values",n=>n.def.innerType._zod.values),Y(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r);}),Kf=P("$ZodNullable",(e,t)=>{q.init(e,t),Y(e,"optin",n=>n.def.innerType._zod.optin),Y(e,"optout",n=>n.def.innerType._zod.optout),Y(e,"pattern",n=>{let r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${Ht(r.source)}|null)$`):void 0}),Y(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r);}),Jf=P("$ZodDefault",(e,t)=>{q.init(e,t),e._zod.optin="defaulted",Y(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;let o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Lg(i,t)):Lg(o,t)};});function Lg(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var em=P("$ZodPrefault",(e,t)=>{q.init(e,t),e._zod.optin="defaulted",Y(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r));}),tm=P("$ZodNonOptional",(e,t)=>{q.init(e,t),Y(e,"values",n=>{let r=n.def.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,r)=>{let o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>zg(i,e)):zg(o,e)};});function zg(e,t){return !e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var nm=P("$ZodSuccess",(e,t)=>{q.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new mn("ZodSuccess");let o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.issues.length===0,n)):(n.value=o.issues.length===0,n)};});function Tg(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>at(o,r,Ee()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=true),e)}var rm=P("$ZodCatch",(e,t)=>{q.init(e,t),Y(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Y(e,"optout",n=>n.def.innerType._zod.optout),Y(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);let o=t.innerType._zod.run({value:n.value,issues:[]},r);return o instanceof Promise?o.then(i=>Tg(n,i,t,r)):Tg(n,o,t,r)};}),om=P("$ZodNaN",(e,t)=>{q.init(e,t),e._zod.parse=(n,r)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n);}),Ys=P("$ZodPipe",(e,t)=>{q.init(e,t),Y(e,"values",n=>n.def.in._zod.values),Y(e,"optin",n=>n.def.in._zod.optin),Y(e,"optout",n=>n.def.out._zod.optout),Y(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){let i=t.out._zod.run(n,r);return i instanceof Promise?i.then(s=>Is(s,t.in,r)):Is(i,t.in,r)}let o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>Is(i,t.out,r)):Is(o,t.out,r)};});function Is(e,t,n){return e.issues.some(r=>r.code!=="unrecognized_keys")?(e.aborted=true,e):t._zod.run({value:e.value,issues:e.issues},n)}var pi=P("$ZodCodec",(e,t)=>{q.init(e,t),Y(e,"values",n=>n.def.in._zod.values),Y(e,"optin",n=>n.def.in._zod.optin),Y(e,"optout",n=>n.def.out._zod.optout),Y(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if((r.direction||"forward")==="forward"){let i=t.in._zod.run(n,r);return i instanceof Promise?i.then(s=>Ls(s,t,r)):Ls(i,t,r)}else {let i=t.out._zod.run(n,r);return i instanceof Promise?i.then(s=>Ls(s,t,r)):Ls(i,t,r)}};});function Ls(e,t,n){if(e.issues.length)return e.aborted=true,e;if((n.direction||"forward")==="forward"){let o=t.transform(e.value,e);return o instanceof Promise?o.then(i=>zs(e,i,t.out,n)):zs(e,o,t.out,n)}else {let o=t.reverseTransform(e.value,e);return o instanceof Promise?o.then(i=>zs(e,i,t.in,n)):zs(e,o,t.in,n)}}function zs(e,t,n,r){return e.issues.length?(e.aborted=true,e):n._zod.run({value:t,issues:e.issues},r)}var im=P("$ZodPreprocess",(e,t)=>{Ys.init(e,t);}),sm=P("$ZodReadonly",(e,t)=>{q.init(e,t),Y(e,"propValues",n=>n.def.innerType._zod.propValues),Y(e,"values",n=>n.def.innerType._zod.values),Y(e,"optin",n=>n.def.innerType?._zod?.optin),Y(e,"optout",n=>n.def.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);let o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Ng):Ng(o)};});function Ng(e){return e.memo||(e.value=Object.freeze(e.value)),e}function U5(e){let t=e._zod.def,n=t.pattern,r=!!t.format?.includes("int"),o,i;for(let a of t.checks??[]){let c=a._zod.def;c.pattern&&(n=c.pattern),r||(r=!!c.format?.includes("int"));let u=c.minimum??c.length,l=c.maximum??c.length;u!==void 0&&(o===void 0||u>o)&&(o=u),l!==void 0&&(i===void 0||l<i)&&(i=l);}if(n)return n.source;if(o!==void 0&&i!==void 0&&o>i)return "(?!)";if(o!==void 0||i!==void 0)return $l({minimum:o,maximum:i}).source;let s=e._zod.pattern;return (r&&s===Yt?ri:s)?.source}function Yl(e){let t=e._zod.def,n=e._zod.pattern?.source,r=t.innerType??e._zod.innerType;if(r){let o=r._zod.pattern?.source,i=Yl(r);return n&&o&&i&&i!==o?n.replace(Ht(o),()=>Ht(i)):n}if(t.options){let o=t.options.map(Yl);if(o.every(Boolean))return `^(${o.map(i=>Ht(i)).join("|")})$`}return U5(e)}var am=P("$ZodTemplateLiteral",(e,t)=>{q.init(e,t);let n=[];for(let r of t.parts)if(typeof r=="object"&&r!==null){let o=Yl(r);if(!o)throw new Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);n.push(Ht(o));}else if(r===null||Lu.has(typeof r))n.push(xt(`${r}`));else throw new Error(`Invalid template literal part: ${r}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(r,o)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}),r):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),r);}),cm=P("$ZodFunction",(e,t)=>(q.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...r){let o=e._def.input?gs(e._def.input,r):r,i=Reflect.apply(n,this,o);return e._def.output?gs(e._def.output,i):i},"_zod",{value:e._zod,enumerable:false})},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...r){let o=e._def.input?await _s(e._def.input,r):r,i=await Reflect.apply(n,this,o);return e._def.output?await _s(e._def.output,i):i},"_zod",{value:e._zod,enumerable:false})},e._zod.parse=(n,r)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{let r=e.constructor;return Array.isArray(n[0])?new r({type:"function",input:new Ws({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new r({type:"function",input:n[0],output:e._def.output})},e.output=n=>{let r=e.constructor;return new r({type:"function",input:e._def.input,output:n})},e)),um=P("$ZodPromise",(e,t)=>{q.init(e,t),e._zod.parse=(n,r)=>Promise.resolve(n.value).then(o=>t.innerType._zod.run({value:o,issues:[]},r));}),di=P("$ZodLazy",(e,t)=>{q.init(e,t),Ru(e._zod,"innerType",()=>{let n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),Y(e,"pattern",n=>n.innerType?._zod?.pattern),Y(e,"propValues",n=>n.innerType?._zod?.propValues),Y(e,"optin",n=>n.innerType?._zod?.optin??void 0),Y(e,"optout",n=>n.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r);}),lm=P("$ZodCustom",(e,t)=>{he.init(e,t),q.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{let r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>Og(i,n,r,e));Og(o,n,r,e);};});function Og(e,t,n,r){if(!e){let o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Or(o));}}var ea=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError";}},mm="~memo",Vg=[];function jg(e){return e!==null&&typeof e=="object"}function fm(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var qg=new WeakMap,Qr=0,Js=1,hi=2;function gi(e,t,n){let r=qg.get(e);if(r!==void 0)return r?hi:Qr;if(t.has(e))return hi;t.add(e);let o=Qr,i=l=>{if(o!==hi&&l?._zod){let f=gi(l,t,n);f>o&&(o=f);}},s=(l,f)=>{let p=Qr;for(let m of Reflect.ownKeys(l)){let h=Object.getOwnPropertyDescriptor(l,m);if(!h.enumerable)continue;let d=h.get?Js:h.value?._zod?gi(h.value,t,n):Qr;d>p&&(p=d);}return p},a=l=>{l>o&&(o=l);},c=e._zod.def,u=c.type;switch(u){case "object":{let l=Tr(c);a(l?s(l):Js),i(c.catchall);break}case "array":i(c.element);break;case "tuple":for(let l of c.items)i(l);i(c.rest);break;case "record":case "map":i(c.keyType),i(c.valueType);break;case "set":i(c.valueType);break;case "union":for(let l of c.options)i(l);break;case "intersection":i(c.left),i(c.right);break;case "optional":case "nullable":case "default":case "prefault":case "catch":case "readonly":case "nonoptional":case "promise":case "success":i(c.innerType);break;case "pipe":i(c.in),i(c.out);break;case "function":i(c.input),i(c.output);break;case "lazy":{let l=c._cachedInner??(n?e._zod.innerType:void 0);a(l?gi(l,t,false):Js);break}case "template_literal":case "string":case "number":case "int":case "boolean":case "bigint":case "symbol":case "undefined":case "null":case "void":case "never":case "any":case "unknown":case "date":case "nan":case "enum":case "literal":case "file":case "transform":case "custom":break;default:for(let l in c){let f=Object.getOwnPropertyDescriptor(c,l);if(!f||f.get)continue;let p=f.value;if(!(!p||typeof p!="object")){if(p._zod)i(p);else if(Array.isArray(p))for(let m of p)i(m);}}}return t.delete(e),Q5(e,o)}function Q5(e,t){return t!==Js&&qg.set(e,t===hi),t}function ta(e){return gi(e,new Set,true)!==Qr}function V5(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Xs,Ks=[],j5={alloc(e,t,n){let r=Xs;if(!r)return n;Xs=void 0;let o={value:n,issues:null};return r.set(t.value,o),Ks.push(o),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let n=e._zod.parse,r=(o,i)=>{if(i.direction!=="backward"&&na(i,o.value))throw new ea;return n(o,i)};e._zod.parse=r,e._zod.run===n&&(e._zod.run=r);});},attach(e){var t;let n,r=false,o,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,a=(c,u)=>{if(n===void 0){let _=gi(e,new Set,false);if(_===Qr)return e._zod.parse=s,e._zod.run===a&&(e._zod.run=s),s(c,u);_===hi||r?n=true:r=true;}let l=c.value;if(!jg(l))return s(c,u);let f=u[mm];f||(f={buckets:new WeakMap,backEdges:void 0},u[mm]=f);let p;o===u?p=i:(p=V5(f,e),o=u,i=p);let m=p.get(l);if(m)return c.value=m.value,m.issues?m.issues.length&&c.issues.push(...fm(m.issues)):(c.memo=true,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(m.value)),c;Xs=p;let h=Ks.length,d=s(c,u);Xs=void 0;let g=Ks.length>h?Ks.pop():void 0;return d instanceof Promise?d.then(_=>(g&&(g.issues=_.issues.length?fm(_.issues):Vg),_)):(g&&(g.issues=d.issues.length?fm(d.issues):Vg),d)};e._zod.parse=a,e._zod.run===s&&(e._zod.run=a);});}};function _i(){return j5}function na(e,t){let n=e[mm]?.backEdges;return n!==void 0&&jg(t)&&n.has(t)}var ra={};var Wg,pm=Symbol("ZodOutput"),dm=Symbol("ZodInput"),oa=class{constructor(){this._map=new WeakMap,this._idmap=new Map;}add(t,...n){let r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let r={...this.get(n)??{}};delete r.id;let o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function ia(){return new oa}(Wg=globalThis).__zod_globalRegistry??(Wg.__zod_globalRegistry=ia());var Ve=globalThis.__zod_globalRegistry;var Xe=Symbol.for("zod.compile.invalid"),Hg=Symbol.for("zod.compile.fallback"),Pt=class extends Error{constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError";}},ne=class extends Error{constructor(t,n=true){super(`z.compile does not support ${t}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=n;}};function W5(e,t){try{return aa(e,{assertOnly:!0})}catch{return t}}function bm(e,t){try{let n=aa(e),r=sa(e,n);return r._zod.bag.validator=W5(e,n),r}catch(n){if(t?.strict)throw n;return e}}function sa(e,t){if(ta(e))throw new ne("a schema whose subtree contains a reference cycle");let n=ce(e),r=e._zod.run,o=r.__originalRun??r,i=(s,a)=>{if(a?.async||a?.direction==="backward"||a?.skipChecks||a?.[Hg]||a&&na(a,s.value))return o(s,a);let c=t(s.value);return c!==Xe?(s.value=c,s):(a&&(a[Hg]=true),o(s,a))};return i.__originalRun=o,n._zod.bag.fallbackRun=o,n._zod.bag.validator=t,n._zod.run=i,r.__originalRun||H5(n,e,t),n}function H5(e,t,n){let r=e,o=t;if(typeof o.safeParse=="function"){let i=o.safeParse;r.safeParse=(s,a)=>{let c=n(s);return c!==Xe?{success:true,data:c}:i(s,a)};}if(typeof o.parse=="function"){let i=o.parse;r.parse=(s,a)=>{let c=n(s);return c!==Xe?c:i(s,a)};}}function aa(e,t){let n=true;try{n=ta(e);}catch{}if(n)throw new ne("a schema whose subtree contains a reference cycle");let r={constants:new Map,constantCounter:0,varCounter:0,definite:true},o=new Vn(["input"]),i=Ce(o,r,e,"input",!t?.assertOnly);o.write(i===null?"return true;":`return ${i};`);let s=["INVALID",...r.constants.keys()],a=[Xe,...r.constants.values()],c=o.content.join(`
|
|
57
|
+
`),u=t?.debug?s.length>0?`// Constants: ${s.join(", ")}
|
|
58
|
+
${c}`:c:"",l=Function,f=`return (input) => {
|
|
59
|
+
${c}
|
|
60
|
+
}`,p;try{p=new l(...s,f)(...a);}catch(m){throw new ne(`this schema (generated code failed to evaluate: ${m.message})`)}return t?.debug&&(p.code=u),p.definite=r.definite,p}function V(e,t){for(let[r,o]of e.constants)if(o===t)return r;let n=`c${e.constantCounter++}`;return e.constants.set(n,t),n}function Wn(e,t){return e.definite=false,V(e,t)}function G(e){return `v${e.varCounter++}`}function Y5(e,t){let n=e._zod.run({value:t,issues:[]},{});if(n&&typeof n.then=="function")return Xe;let r=n;return r.issues.length===0?r.value:Xe}function je(e,t,n,r,o=true){let i=e.content.length,s=t.constants.size,a=t.constantCounter,c=t.varCounter;try{return Ce(e,t,n,r,o)}catch(u){if(!(u instanceof ne)||!u.islandable)throw u;if(e.content.length=i,t.constants.size>s){let l=Array.from(t.constants.keys()).slice(s);for(let f of l)t.constants.delete(f);}return t.constantCounter=a,t.varCounter=c,X5(e,t,n,r)}}function X5(e,t,n,r){t.definite=false;let o=V(t,n),i=V(t,Y5),s=G(t);return e.write(`const ${s} = ${i}(${o}, ${r});`),e.write(`if (${s} === INVALID) return INVALID;`),s}var K5=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function J5(e,t,n,r){let o=n._zod.def.checks;if(!o||o.length===0)return r;let i=r;for(let s of o){let a=s._zod.def;if(a.when&&!K5.has(a.check))throw new ne('check with a custom "when" condition');switch(a.check){case "greater_than":e4(e,t,a,i);break;case "less_than":t4(e,t,a,i);break;case "multiple_of":n4(e,t,a,i);break;case "number_format":t1(e,a,i);break;case "min_length":{let c=pn(a.minimum,"min_length"),u=hm(e,t,i,`${i}.length >= ${c} && ${i}.length < ${a.minimum*2}`);e.write(`if (${u} < ${c}) return INVALID;`);break}case "max_length":{let c=pn(a.maximum,"max_length"),u=hm(e,t,i,`${i}.length > ${c}`);e.write(`if (${u} > ${c}) return INVALID;`);break}case "length_equals":{let c=pn(a.length,"length_equals"),u=hm(e,t,i,`${i}.length >= ${c} && ${i}.length <= ${a.length*2}`);e.write(`if (${u} !== ${c}) return INVALID;`);break}case "min_size":e.write(`if (${i}.size < ${pn(a.minimum,"min_size")}) return INVALID;`);break;case "max_size":e.write(`if (${i}.size > ${pn(a.maximum,"max_size")}) return INVALID;`);break;case "size_equals":e.write(`if (${i}.size !== ${pn(a.size,"size_equals")}) return INVALID;`);break;case "string_format":i=n1(e,t,a,i);break;case "custom":i=c4(e,t,s,i);break;case "bigint_format":r4(e,a,i);break;case "mime_type":o4(e,t,a,i);break;case "property":s4(e,t,a,i);break;case "properties":i4(e,t,a,i);break;case "overwrite":{let c=G(t);a4(e,t,s,i,c),i=c;break}default:throw new ne(`check type ${a.check}`)}}return i}function hm(e,t,n,r){let o=V(t,Un),i=G(t);return e.write(`const ${i} = typeof ${n} === "string" && ${r} ? ${o}(${n}) : ${n}.length;`),i}function pn(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new ne(`${t} bound of type ${typeof e}`);return `${e}`}function e1(e,t){if(typeof t=="bigint")return `${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new ne("comparison check with NaN bound");return `${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new ne("comparison check with Invalid Date bound");return V(e,t)}throw new ne(`comparison check bound of type ${typeof t}`)}function e4(e,t,n,r){let o=n.inclusive?"<":"<=";e.write(`if (${r} ${o} ${e1(t,n.value)}) return INVALID;`);}function t4(e,t,n,r){let o=n.inclusive?">":">=";e.write(`if (${r} ${o} ${e1(t,n.value)}) return INVALID;`);}function n4(e,t,n,r){if(typeof n.value=="bigint"){if(n.value===BigInt(0))throw new ne("multiple_of check with a zero divisor");e.write(`if (${r} % ${n.value}n !== 0n) return INVALID;`);}else {let o=V(t,Uo);e.write(`if (${o}(${r}, ${pn(n.value,"multiple_of")}) !== 0) return INVALID;`);}}function t1(e,t,n){let r=t.format;switch(r){case "safeint":e.write(`if (!Number.isSafeInteger(${n})) return INVALID;`);break;case "int32":e.write(`if (!Number.isInteger(${n}) || ${n} < -2147483648 || ${n} > 2147483647) return INVALID;`);break;case "uint32":e.write(`if (!Number.isInteger(${n}) || ${n} < 0 || ${n} > 4294967295) return INVALID;`);break;case "float32":e.write(`if (!Number.isFinite(${n}) || ${n} < -3.4028234663852886e38 || ${n} > 3.4028234663852886e38) return INVALID;`);break;case "float64":e.write(`if (!Number.isFinite(${n})) return INVALID;`);break;default:throw new ne(`number format ${r}`)}}function r4(e,t,n){let r=t.format;if(r)switch(r){case "int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case "uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break;default:throw new ne(`bigint format ${r}`)}}function o4(e,t,n,r){let o=n.mime;if(o&&o.length>0){let i=V(t,new Set(o));e.write(`if (!${i}.has(${r}.type)) return INVALID;`);}}function i4(e,t,n,r){if(n.when)throw new ne('check with a custom "when" condition');e.write(`if (${r} == null) return INVALID;`);let o=n.shape;for(let i of Reflect.ownKeys(o)){let s=typeof i=="symbol"?V(t,i):He(i),a=G(t);e.write(`const ${a} = ${r}[${s}];`),je(e,t,o[i],a,false);}}function s4(e,t,n,r){let o=`${r}[${JSON.stringify(n.property)}]`;Ce(e,t,n.schema,o);}function a4(e,t,n,r,o){let i=n._zod.def.tx;if(!i)throw new ne("overwrite check without a transform function");if(Hn(i))throw new Pt("z.compile: async overwrite transforms are not supported");let s=V(t,i);e.write(`const ${o} = ${s}(${r});`);}function gm(){throw new ct}function ym(e){this.issues.push(e);}function c4(e,t,n,r){let o=n._zod.def;if(o.fn){if(Hn(o.fn))throw new Pt("z.compile: async .refine() predicates are not supported");let i=Wn(t,o.fn),s=V(t,gm),a=G(t);return e.write(`const ${a} = ${i}(${r});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`),r}if(n._zod.check){if(Hn(n._zod.check))throw new Pt("z.compile: async .superRefine() / check functions are not supported");let i=n._zod.check,a=Wn(t,u=>{let l={value:u,issues:[],addIssue:ym};return i(l)instanceof Promise&&gm(),l.issues.length===0?l.value:Xe}),c=G(t);return e.write(`const ${c} = ${a}(${r});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new ne("custom check without a predicate or check function")}var u4=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function n1(e,t,n,r,o=true){let i=n.format;if(i==="base64"){let u=V(t,ui);return e.write(`if (!${u}(${r})) return INVALID;`),r}if(i==="base64url"){let u=V(t,Gs);return e.write(`if (!${u}(${r})) return INVALID;`),r}if(i==="jwt"){let u=V(t,Vs),l=V(t,n.alg??null);return e.write(`if (!${u}(${r}, ${l})) return INVALID;`),r}if(i==="ipv6"){let u=V(t,ci);return e.write(`if (!${u}(${r})) return INVALID;`),r}if(i==="cidrv6"){let u=V(t,Zs);return e.write(`if (!${u}(${r})) return INVALID;`),r}if(i==="credit_card"){let u=V(t,Us);return e.write(`if (!${u}(${r})) return INVALID;`),r}if(i==="iban"){let u=V(t,Qs);return e.write(`if (!${u}(${r})) return INVALID;`),r}let s=n;if(i==="url"||i==="httpurl"||s.normalize||s.hostname!==void 0||s.protocol!==void 0){let u=V(t,Os),l=V(t,n),f=G(t),p=G(t);if(e.write(`const ${f} = ${r}.trim();`),e.write(`const ${p} = ${u}(${f}, ${l});`),e.write(`if (typeof ${p} === "number") return INVALID;`),s.hostname!==void 0){let d=V(t,Fs);e.write(`if (!${d}(${p}, ${l}.hostname)) return INVALID;`);}if(s.protocol!==void 0){let d=V(t,Ds);e.write(`if (!${d}(${p}, ${l}.protocol)) return INVALID;`);}if(!o)return null;let m=G(t),h=s.normalize?`${p}.href`:`${V(t,ai)}(${f})`;return e.write(`const ${m} = ${h};`),m}let a=n.fn;if(a){if(Hn(a))throw new ne(`async string format ${i}`);let u=V(t,a);return e.write(`if (!${u}(${r})) return INVALID;`),r}if(u4.has(i)&&n.pattern){let u=V(t,n.pattern);return e.write(`${u}.lastIndex = 0;`),e.write(`if (!${u}.test(${r})) return INVALID;`),r}let c=n.format;switch(c){case "regex":throw new ne("regex format without a pattern");case "lowercase":e.write(`if (${r} !== ${r}.toLowerCase()) return INVALID;`);break;case "uppercase":e.write(`if (${r} !== ${r}.toUpperCase()) return INVALID;`);break;case "includes":e.write(`if (!${r}.includes(${He(n.includes)})) return INVALID;`);break;case "starts_with":{let u=n.prefix;e.write(`if (${r}.slice(0, ${u.length}) !== ${He(u)}) return INVALID;`);break}case "ends_with":{let u=n.suffix;e.write(`if (${r}.slice(-${u.length}) !== ${He(u)}) return INVALID;`);break}default:throw new ne(`string format ${c}`)}return r}function Ce(e,t,n,r,o=true){let i=n._zod.def,s=i.type;if(i.coerce)throw new ne(`coercion (z.coerce.${s}())`);let a=o||!!i.checks?.length,c;switch(s){case "string":c=l4(e,t,n,r,a);break;case "number":c=f4(e,n,r);break;case "boolean":c=m4(e,r);break;case "bigint":c=p4(e,n,r);break;case "symbol":c=d4(e,r);break;case "undefined":c=h4(e,r);break;case "null":c=g4(e,r);break;case "any":case "unknown":c=r;break;case "never":e.write("return INVALID;"),c=r;break;case "void":c=_4(e,r);break;case "nan":c=b4(e,r);break;case "date":c=y4(e,r);break;case "object":c=$4(e,t,n,r,a);break;case "optional":c=x4(e,t,n,r,a);break;case "nullable":c=v4(e,t,n,r,a);break;case "array":c=C4(e,t,n,r,a);break;case "literal":c=P4(e,t,n,r);break;case "enum":c=A4(e,t,n,r);break;case "readonly":{let u=Xg(e,t,n,r),l=G(t);e.write(`const ${l} = Object.freeze(${u});`),c=l;break}case "success":Xg(e,t,n,r),c="true";break;case "default":case "prefault":c=E4(e,t,n,r);break;case "nonoptional":c=k4(e,t,n,r);break;case "tuple":c=R4(e,t,n,r);break;case "union":c=M4(e,t,n,r);break;case "intersection":c=z4(e,t,n,r);break;case "record":c=T4(e,t,n,r);break;case "map":c=O4(e,t,n,r);break;case "set":c=F4(e,t,n,r);break;case "file":c=D4(e,r);break;case "template_literal":c=Z4(e,t,n,r);break;case "lazy":c=B4(e,t,n,r);break;case "pipe":c=G4(e,t,n,r);break;case "custom":c=U4(e,t,n,r);break;case "transform":c=j4(e,t,n,r);break;case "catch":c=V4(e,t,n,r);break;default:throw new ne(`schema type ${s}`)}return c===null?null:J5(e,t,n,c)}function l4(e,t,n,r,o=true){e.write(`if (typeof ${r} !== "string") return INVALID;`);let i=n._zod.def;return i.format===void 0?r:n1(e,t,i,r,o)}function f4(e,t,n){e.write(`if (typeof ${n} !== "number" || !Number.isFinite(${n})) return INVALID;`);let r=t._zod.def;return r.check==="number_format"&&r.format&&t1(e,{format:r.format},n),n}function m4(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function p4(e,t,n){e.write(`if (typeof ${n} !== "bigint") return INVALID;`);let r=t._zod.def;if(r.format)switch(r.format){case "int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case "uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break}return n}function d4(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function h4(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function g4(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function _4(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function b4(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function y4(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function $4(e,t,n,r,o=true){let i=n._zod.def;e.write(`if (typeof ${r} !== "object" || ${r} === null || Array.isArray(${r})) return INVALID;`);let s=i.shape,a=Object.keys(s),c=Object.getOwnPropertySymbols(s),u=c.length?[...a,...c]:a,l=b=>typeof b=="symbol"?V(t,b):He(b),f=b=>typeof b=="symbol"?`[${l(b)}]`:He(b),p=s;if(a.includes("__proto__"))throw new ne('object shape key "__proto__"');let m=new Map;for(let b of u){let y=p[b],S=l(b),v=G(t);if(e.write(`const ${v} = ${r}[${S}];`),y._zod.optin!==void 0){let $=G(t);e.write(`let ${$} = (() => {`),e.indented(w=>{let A=je(w,t,y,v);w.write(`return ${A};`);}),e.write("})();"),y._zod.optout==="optional"?(e.write(`if (${$} === INVALID) {`),e.indented(w=>{w.write(`if (${S} in ${r}) return INVALID;`),w.write(`${$} = undefined;`);}),e.write("}")):e.write(`if (${$} === INVALID) return INVALID;`),m.set(b,$);}else {S4(y)&&e.write(`if (!(${S} in ${r})) return INVALID;`);let $=je(e,t,y,v,o);$!==null&&m.set(b,$);}}let h=i.catchall,d="none";if(h){let b=h._zod.def.type;if(b==="never"){let y=a.map(S=>`k !== ${He(S)}`).join(" && ")||"true";e.write(`for (const k in ${r}) {`),e.indented(S=>{S.write(`if (${y}) return INVALID;`);}),e.write("}");}else (b==="unknown"||b==="any")&&!h._zod.def.checks?.length?d="passthrough":d="schema";}let g=G(t),_=u.some(b=>Yg(p[b])||_m(p[b]));if(!o){if(d==="schema"){let b=a.length>0?V(t,new Set(a)):null;e.write(`for (const k in ${r}) {`),e.indented(y=>{y.write('if (k === "__proto__") continue;'),b&&y.write(`if (${b}.has(k)) continue;`);let S=G(t);y.write(`const ${S} = ${r}[k];`),je(y,t,h,S,false);}),e.write("}");}return null}if(_){e.write(`const ${g} = {};`);for(let b of u){let y=l(b),S=m.get(b);_m(p[b])?e.write(`if (${y} in ${r}) ${g}[${y}] = ${S};`):Yg(p[b])?e.write(`if (${S} !== undefined || ${y} in ${r}) ${g}[${y}] = ${S};`):e.write(`${g}[${y}] = ${S};`);}}else {let b=u.map(y=>`${f(y)}: ${m.get(y)}`).join(", ");e.write(`const ${g} = { ${b} };`);}if(d!=="none"){let b=a.length>0?V(t,new Set(a)):null;e.write(`for (const k in ${r}) {`),e.indented(y=>{if(y.write('if (k === "__proto__") continue;'),b&&y.write(`if (${b}.has(k)) continue;`),d==="passthrough")y.write(`${g}[k] = ${r}[k];`);else {let S=G(t);y.write(`const ${S} = ${r}[k];`);let v=je(y,t,h,S);y.write(`${g}[k] = ${v};`);}}),e.write("}");}return g}function x4(e,t,n,r,o=true){let i=n._zod.def;if(w4(n))return Ce(e,t,i.innerType,r,o);if(i.innerType._zod.optin==="defaulted"){let a=G(t),c=G(t);return e.write(`let ${a};`),e.write(`if (${r} === undefined) {`),e.indented(u=>{u.write(`const ${c} = (() => {`),u.indented(l=>{let f=Ce(l,t,i.innerType,r);l.write(`return ${f};`);}),u.write("})();"),u.write(`if (${c} !== INVALID) ${a} = ${c};`);}),e.write("} else {"),e.indented(u=>{let l=Ce(u,t,i.innerType,r);u.write(`${a} = ${l};`);}),e.write("}"),a}let s=o?G(t):null;return s&&e.write(`let ${s};`),e.write(`if (${r} !== undefined) {`),e.indented(a=>{let c=Ce(a,t,i.innerType,r,o);s&&c!==null&&a.write(`${s} = ${c};`);}),e.write("}"),s}function w4(e){return e._zod.traits?.has("$ZodExactOptional")===true}function S4(e){return e._zod.optin===void 0&&qn(e)}function qn(e){if(e._zod.def.coerce)return true;let t=e._zod.def;switch(t.type){case "any":case "unknown":case "undefined":case "void":case "default":case "prefault":case "transform":case "custom":case "lazy":return true;case "string":case "number":case "boolean":case "bigint":case "symbol":case "null":case "never":case "nan":case "date":case "object":case "array":case "tuple":case "record":case "map":case "set":case "file":case "template_literal":return false;case "nonoptional":return t.innerType?qn(t.innerType):false;case "literal":return !!t.values?.includes(void 0);case "enum":return !!e._zod.values?.has(void 0);case "optional":case "nullable":case "readonly":case "success":return t.innerType?qn(t.innerType):true;case "catch":return true;case "union":return t.options?t.options.some(qn):true;case "intersection":return !t.left||!t.right?true:qn(t.left)&&qn(t.right);case "pipe":return t.in?qn(t.in):true;default:return true}}function _m(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function Yg(e){return (e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&Vr(e)}function Vr(e){let t=e._zod.def;switch(t.type){case "string":case "number":case "boolean":case "bigint":case "symbol":case "null":case "nan":case "date":case "object":case "array":case "tuple":case "record":case "map":case "set":case "file":case "template_literal":case "never":case "success":return false;case "literal":return !!t.values?.includes(void 0);case "enum":return !!e._zod.values?.has(void 0);case "optional":return true;case "nullable":case "readonly":case "nonoptional":return t.innerType?Vr(t.innerType):true;case "union":return t.options?t.options.some(Vr):true;case "intersection":return !t.left||!t.right||Vr(t.left)||Vr(t.right);case "pipe":return t.out?Vr(t.out):true;default:return true}}function v4(e,t,n,r,o=true){let i=n._zod.def,s=o?G(t):null;return s&&e.write(`let ${s} = null;`),e.write(`if (${r} !== null) {`),e.indented(a=>{let c=Ce(a,t,i.innerType,r,o);s&&c!==null&&a.write(`${s} = ${c};`);}),e.write("}"),s}function $m(e,t,n){for(let[r,o]of Nr(t._zod.def.checks))e.write(`if (${n} > ${pn(r,o._zod.def.check)}) return INVALID;`);}function C4(e,t,n,r,o=true){let i=n._zod.def;e.write(`if (!Array.isArray(${r})) return INVALID;`),$m(e,n,`${r}.length`);let s=o?G(t):null,a=G(t),c=G(t);return s&&e.write(`const ${s} = new Array(${r}.length);`),e.write(`for (let ${a} = 0; ${a} < ${r}.length; ${a}++) {`),e.indented(u=>{u.write(`const ${c} = ${r}[${a}];`);let l=je(u,t,i.element,c,o);s&&l!==null&&u.write(`${s}[${a}] = ${l};`);}),e.write("}"),s}function P4(e,t,n,r){let i=n._zod.def.values;if(i.length!==1){let a=V(t,new Set(i));return e.write(`if (!${a}.has(${r})) return INVALID;`),r}let s=i[0];if(typeof s=="number"&&Number.isNaN(s)){let a=V(t,new Set(i));return e.write(`if (!${a}.has(${r})) return INVALID;`),r}if(typeof s=="string")e.write(`if (${r} !== ${He(s)}) return INVALID;`);else if(typeof s=="number"||typeof s=="boolean")e.write(`if (${r} !== ${s}) return INVALID;`);else if(s===null)e.write(`if (${r} !== null) return INVALID;`);else if(s===void 0)e.write(`if (${r} !== undefined) return INVALID;`);else if(typeof s=="bigint")e.write(`if (${r} !== ${s}n) return INVALID;`);else throw new ne(`literal type ${typeof s}`);return r}function A4(e,t,n,r){let o=n._zod.values;if(!o)throw new ne("enum schema without enumerated values");let i=V(t,o);return e.write(`if (!${i}.has(${r})) return INVALID;`),r}function Xg(e,t,n,r){let o=n._zod.def;return Ce(e,t,o.innerType,r)}function E4(e,t,n,r){let o=n._zod.def,s=Object.getOwnPropertyDescriptor(n._zod.def,"defaultValue")?()=>n._zod.def.defaultValue:void 0;if(n._zod.def.type==="prefault"){if(!s)return Ce(e,t,o.innerType,r);let c=V(t,s),u=G(t);return e.write(`let ${u} = ${r};`),e.write(`if (${r} === undefined) ${u} = ${c}();`),Ce(e,t,o.innerType,u)}let a=G(t);if(s){let c=V(t,s),u=V(t,Qo);e.write(`let ${a};`),e.write(`if (${r} === undefined) {`),e.indented(l=>{l.write(`${a} = ${u}(${c}());`);}),e.write("} else {"),e.indented(l=>{let f=Ce(l,t,o.innerType,r);l.write(`${a} = ${f} === undefined ? ${u}(${c}()) : ${f};`);}),e.write("}");}else e.write(`let ${a};`),e.write(`if (${r} !== undefined) {`),e.indented(c=>{let u=Ce(c,t,o.innerType,r);c.write(`${a} = ${u};`);}),e.write("}");return a}function k4(e,t,n,r){let o=n._zod.def,i=Ce(e,t,o.innerType,r),s=G(t);return e.write(`const ${s} = ${i};`),e.write(`if (${s} === undefined) return INVALID;`),s}function R4(e,t,n,r){let o=n._zod.def,i=o.items,s=o.rest;e.write(`if (!Array.isArray(${r})) return INVALID;`);let a=Kg(i,"optin"),c=Kg(i,"optout");s?e.write(`if (${r}.length < ${a}) return INVALID;`):e.write(`if (${r}.length < ${a} || ${r}.length > ${i.length}) return INVALID;`);let u=G(t);e.write(`const ${u} = [];`);for(let l=0;l<i.length;l++){let f=i[l];if(l>=c)e.write(`if (${u}.length === ${l}) {`),e.indented(p=>{p.write(`if (${l} < ${r}.length) {`),p.indented(m=>{let h=G(t);m.write(`const ${h} = ${r}[${l}];`);let d=je(m,t,f,h);m.write(`${u}[${l}] = ${d};`);}),p.write("} else {"),p.indented(m=>{if(_m(f)){m.write(`${u}.length = ${l};`);return}let h=G(t),d=G(t);m.write(`const ${h} = undefined;`),m.write(`const ${d} = (() => {`),m.indented(g=>{let _=je(g,t,f,h);g.write(`return ${_};`);}),m.write("})();"),m.write(`if (${d} === INVALID || ${d} === undefined) ${u}.length = ${l};`),m.write(`else ${u}[${l}] = ${d};`);}),p.write("}");}),e.write("}");else {let p=G(t);e.write(`const ${p} = ${r}[${l}];`);let m=je(e,t,f,p);e.write(`${u}[${l}] = ${m};`);}}if(s){let l=G(t),f=G(t);e.write(`for (let ${l} = ${i.length}; ${l} < ${r}.length; ${l}++) {`),e.indented(p=>{p.write(`const ${f} = ${r}[${l}];`);let m=je(p,t,s,f);p.write(`${u}[${l}] = ${m};`);}),e.write("}");}return u}function Kg(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function M4(e,t,n,r){let o=n._zod.def,i=o.options;if(o.discriminator)return I4(e,t,o,r);if(o.inclusive===false)throw new ne("exclusive unions (z.xor)");if(i.length===0)return e.write("return INVALID;"),r;if(i.length===1)return Ce(e,t,i[0],r);if(i.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(i.flatMap(l=>l._zod.def.values)),u=V(t,c);return e.write(`if (!${u}.has(${r})) return INVALID;`),r}let a=G(t);e.write(`let ${a};`);for(let c=0;c<i.length;c++){let u=i[c];c===0?e.write(`${a} = (() => {`):e.write(`if (${a} === INVALID) ${a} = (() => {`),e.indented(l=>{let f=Ce(l,t,u,r);l.write(`return ${f};`);}),e.write("})();");}return e.write(`if (${a} === INVALID) return INVALID;`),a}function I4(e,t,n,r){if(n.unionFallback)throw new ne("discriminated union with unionFallback");if(n.options.length===0)return e.write("return INVALID;"),r;let o=G(t),i=G(t);e.write(`const ${o} = ${r}?.[${He(n.discriminator)}];`),e.write(`let ${i};`);let s=true,a=new Set;for(let c of n.options){let u=c._zod.propValues?.[n.discriminator];if(!u||u.size===0)throw new ne("discriminated union option without static discriminator values");for(let p of u){if(a.has(p))throw new ne(`duplicate discriminator value ${String(p)}`);a.add(p);}let l=Array.from(u,p=>L4(t,o,p)),f=s?"if":"else if";e.write(`${f} (${l.join(" || ")}) {`),e.indented(p=>{let m=Ce(p,t,c,r);p.write(`${i} = ${m};`);}),e.write("}"),s=false;}return e.write("else { return INVALID; }"),i}function L4(e,t,n){if(typeof n=="string")return `${t} === ${He(n)}`;if(typeof n=="number")return Number.isNaN(n)?`Number.isNaN(${t})`:`${t} === ${n}`;if(typeof n=="boolean")return `${t} === ${n}`;if(n===null)return `${t} === null`;if(n===void 0)return `${t} === undefined`;if(typeof n=="bigint")return `${t} === ${n}n`;if(typeof n=="symbol"){let r=V(e,n);return `${t} === ${r}`}throw new ne(`literal discriminator value ${String(n)}`)}function z4(e,t,n,r){let o=n._zod.def;t.definite=false;let i=je(e,t,o.left,r),s=je(e,t,o.right,r),a=V(t,Ur),c=G(t);return e.write(`const ${c} = ${a}(${i}, ${s});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function T4(e,t,n,r){let o=n._zod.def,i=V(t,$t);e.write(`if (!${i}(${r})) return INVALID;`);let s=G(t),a=G(t),c=G(t);e.write(`const ${s} = {};`);let u=o,l=u.partial?void 0:o.keyType._zod.values;if(l){let m=[];for(let d of l){if(!(typeof d=="string"||typeof d=="number"||typeof d=="symbol"))throw new ne(`record key value ${String(d)}`);let g=typeof d=="number"?d.toString():d;if(g==="__proto__")throw new ne('record key "__proto__"');m.push(g);let _=V(t,d),b=Ce(e,t,o.keyType,_),y=G(t);e.write(`const ${y} = ${r}[${N4(t,g)}];`);let S=je(e,t,o.valueType,y);e.write(`${s}[${b}] = ${S};`);}let h=V(t,new Set(m));return e.write(`for (const ${a} in ${r}) {`),e.indented(d=>{d.write(`if (${h}.has(${a})) continue;`),u.mode==="loose"?d.write(`if (${a} !== "__proto__") ${s}[${a}] = ${r}[${a}];`):d.write("return INVALID;");}),e.write("}"),s}let f=o.keyType._zod.def;if(!(f.type==="string"&&f.format===void 0&&!f.coerce&&(f.checks?.length??0)===0)){let m=o.mode==="loose",h=aa(o.keyType);h.definite===false&&(t.definite=false);let d=V(t,h),g=V(t,Yt),_=G(t);return Jg(e,t,r,a,b=>{b.write(`let ${_} = ${d}(${a});`),b.write(`if (${_} === INVALID && typeof ${a} === "string" && ${g}.test(${a})) ${_} = ${d}(Number(${a}));`),m?b.write(`if (${_} === INVALID) { ${s}[${a}] = ${r}[${a}]; continue; }`):b.write(`if (${_} === INVALID) return INVALID;`),b.write(`if (${_} === "__proto__") continue;`);let y=G(t);b.write(`const ${y} = ${r}[${a}];`);let S=je(b,t,o.valueType,y);b.write(`${s}[${_}] = ${S};`);}),s}return Jg(e,t,r,a,m=>{m.write(`const ${c} = ${r}[${a}];`);let h=je(m,t,o.valueType,c);m.write(`${s}[${a}] = ${h};`);},"return INVALID;"),s}function Jg(e,t,n,r,o,i){let s=V(t,Object.prototype.propertyIsEnumerable),a=G(t),c=G(t),u=G(t);e.write(`const ${a} = Object.getOwnPropertySymbols(${n});`),e.write(`const ${c} = Object.getOwnPropertyNames(${n});`),e.write(`for (let ${u} = 0; ${u} < ${c}.length; ${u}++) {`),e.indented(l=>{l.write(`const ${r} = ${c}[${u}];`),l.write(`if (${r} === "__proto__" || !${s}.call(${n}, ${r})) continue;`),o(l);}),e.write("}"),e.write(`for (let ${u} = 0; ${u} < ${a}.length; ${u}++) {`),e.indented(l=>{l.write(`const ${r} = ${a}[${u}];`),l.write(`if (!${s}.call(${n}, ${r})) continue;`),i?l.write(i):o(l);}),e.write("}");}function N4(e,t){return typeof t=="string"?He(t):V(e,t)}function O4(e,t,n,r){let o=n._zod.def;e.write(`if (!(${r} instanceof Map)) return INVALID;`),$m(e,n,`${r}.size`);let i=G(t),s=G(t),a=G(t);return e.write(`const ${i} = new Map();`),e.write(`for (const [${s}, ${a}] of ${r}) {`),e.indented(c=>{let u=Ce(c,t,o.keyType,s),l=Ce(c,t,o.valueType,a);c.write(`${i}.set(${u}, ${l});`);}),e.write("}"),i}function F4(e,t,n,r){let o=n._zod.def;e.write(`if (!(${r} instanceof Set)) return INVALID;`),$m(e,n,`${r}.size`);let i=G(t),s=G(t);return e.write(`const ${i} = new Set();`),e.write(`for (const ${s} of ${r}) {`),e.indented(a=>{let c=Ce(a,t,o.valueType,s);a.write(`${i}.add(${c});`);}),e.write("}"),i}function D4(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function Z4(e,t,n,r){e.write(`if (typeof ${r} !== "string") return INVALID;`);let o=n._zod.pattern;if(o){let i=V(t,o);e.write(`${i}.lastIndex = 0;`),e.write(`if (!${i}.test(${r})) return INVALID;`);}return r}function B4(e,t,n,r){let o=n._zod.def,i=Wn(t,o.getter),s=V(t,{parser:null});e.write(`if (!${s}.parser) {`),e.indented(c=>{c.write(`const inner = ${i}();`),c.write(`${s}.parser = function(input) {`),c.indented(u=>{u.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),u.write("return result.issues.length === 0 ? result.value : INVALID;");}),c.write("};");}),e.write("}");let a=G(t);return e.write(`const ${a} = ${s}.parser(${r});`),e.write(`if (${a} === INVALID) return INVALID;`),a}function G4(e,t,n,r){let o=n._zod.def,i=Ce(e,t,o.in,r);if(o.transform){if(Hn(o.transform))throw new Pt("z.compile: async transforms in pipes are not supported");let s=o.transform,c=Wn(t,l=>{let f={value:l,issues:[],addIssue:ym},p=s(l,f);return p instanceof Promise?Xe:f.issues.length===0?p:Xe}),u=G(t);return e.write(`const ${u} = ${c}(${i});`),e.write(`if (${u} === INVALID) return INVALID;`),Ce(e,t,o.out,u)}else return Ce(e,t,o.out,i)}function Hn(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function U4(e,t,n,r){let o=n._zod.def;if(o.fn){if(Hn(o.fn))throw new Pt("z.compile: async custom predicates are not supported");let i=Wn(t,o.fn),s=V(t,gm),a=G(t);e.write(`const ${a} = ${i}(${r});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`);}else throw new ne("custom schema without a predicate function");return r}function Q4(e,t,n){let r=e._zod.run({value:n,issues:[]},{});if(r&&typeof r.then=="function")return Xe;let o=r;return o.issues.length===0?o.value:t()}function V4(e,t,n,r){let o=n._zod.def;if(!o.catchValue[ds])throw new ne("catch with a callback (only a constant catch value compiles)",false);let i=G(t);e.write(`let ${i} = (() => {`),e.indented(u=>{let l=je(u,t,o.innerType,r);u.write(`return ${l};`);}),e.write("})();");let s=V(t,o.innerType),a=Wn(t,o.catchValue),c=V(t,Q4);return e.write(`if (${i} === INVALID) {`),e.indented(u=>{u.write(`${i} = ${c}(${s}, ${a}, ${r});`),u.write(`if (${i} === INVALID) return INVALID;`);}),e.write("}"),i}function j4(e,t,n,r){let o=n._zod.def;if(o.transform){if(Hn(o.transform))throw new Pt("z.compile: async transforms are not supported");let i=o.transform,a=Wn(t,u=>{let l={value:u,issues:[],addIssue:ym},f=i(u,l);return f instanceof Promise?Xe:l.issues.length===0?f:Xe}),c=G(t);return e.write(`const ${c} = ${a}(${r});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return r}function ca(e){return e.checks&&(e.checks=[...e.checks]),e}function xm(e,t){return new e(ca({type:"string",...T(t)}))}function wm(e,t){return new e(ca({type:"string",coerce:true,...T(t)}))}function ua(e,t){return new e({type:"string",format:"email",check:"string_format",abort:false,...T(t)})}function la(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:false,...T(t)})}function fa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,...T(t)})}function ma(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v4",...T(t)})}function pa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v6",...T(t)})}function da(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v7",...T(t)})}function bi(e,t){return new e({type:"string",format:"url",check:"string_format",abort:false,...T(t)})}function ha(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:false,...T(t)})}function ga(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:false,...T(t)})}function _a(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:false,...T(t)})}function ba(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:false,...T(t)})}function ya(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:false,...T(t)})}function $a(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:false,...T(t)})}function xa(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:false,...T(t)})}function wa(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:false,...T(t)})}function Sa(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:false,...T(t)})}function Sm(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:false,...T(t)})}function va(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:false,...T(t)})}function Ca(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:false,...T(t)})}function Pa(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:false,...T(t)})}function Aa(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:false,...T(t)})}function Ea(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:false,...T(t)})}function vm(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:false,...T(t)})}function Cm(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:false,...T(t)})}function ka(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:false,...T(t)})}var Pm={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function yi(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:false,local:false,precision:null,...T(t)})}function $i(e,t){return new e({type:"string",format:"date",check:"string_format",...T(t)})}function xi(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...T(t)})}function wi(e,t){return new e({type:"string",format:"duration",check:"string_format",...T(t)})}function Am(e,t){return new e(ca({type:"number",checks:[],...T(t)}))}function Em(e,t){return new e(ca({type:"number",coerce:true,checks:[],...T(t)}))}function km(e,t){return new e({type:"number",check:"number_format",abort:false,format:"safeint",...T(t)})}function Rm(e,t){return new e({type:"number",check:"number_format",abort:false,format:"float32",...T(t)})}function Mm(e,t){return new e({type:"number",check:"number_format",abort:false,format:"float64",...T(t)})}function Im(e,t){return new e({type:"number",check:"number_format",abort:false,format:"int32",...T(t)})}function Lm(e,t){return new e({type:"number",check:"number_format",abort:false,format:"uint32",...T(t)})}function zm(e,t){return new e({type:"boolean",...T(t)})}function Tm(e,t){return new e({type:"boolean",coerce:true,...T(t)})}function Nm(e,t){return new e({type:"bigint",...T(t)})}function Om(e,t){return new e({type:"bigint",coerce:true,...T(t)})}function Fm(e,t){return new e({type:"bigint",check:"bigint_format",abort:false,format:"int64",...T(t)})}function Dm(e,t){return new e({type:"bigint",check:"bigint_format",abort:false,format:"uint64",...T(t)})}function Zm(e,t){return new e({type:"symbol",...T(t)})}function Bm(e,t){return new e({type:"undefined",...T(t)})}function Gm(e,t){return new e({type:"null",...T(t)})}function Um(e){return new e({type:"any"})}function Qm(e){return new e({type:"unknown"})}function Vm(e,t){return new e({type:"never",...T(t)})}function jm(e,t){return new e({type:"void",...T(t)})}function qm(e,t){return new e({type:"date",...T(t)})}function Wm(e,t){return new e({type:"date",coerce:true,...T(t)})}function Hm(e,t){return new e({type:"nan",...T(t)})}function Tt(e,t){return new Rs({check:"less_than",...T(t),value:e,inclusive:false})}function dt(e,t){return new Rs({check:"less_than",...T(t),value:e,inclusive:true})}function Nt(e,t){return new Ms({check:"greater_than",...T(t),value:e,inclusive:false})}function ht(e,t){return new Ms({check:"greater_than",...T(t),value:e,inclusive:true})}function Ra(e){return Nt(0,e)}function Ma(e){return Tt(0,e)}function Ia(e){return dt(0,e)}function La(e){return ht(0,e)}function dn(e,t){return new Rl({check:"multiple_of",...T(t),value:e})}function hn(e,t){return new Ll({check:"max_size",...T(t),maximum:e})}function Ot(e,t){return new zl({check:"min_size",...T(t),minimum:e})}function Yn(e,t){return new Tl({check:"size_equals",...T(t),size:e})}function Xn(e,t){return new Nl({check:"max_length",...T(t),maximum:e})}function Xt(e,t){return new Ol({check:"min_length",...T(t),minimum:e})}function Kn(e,t){return new Fl({check:"length_equals",...T(t),length:e})}function jr(e,t){return new Dl({check:"string_format",format:"regex",...T(t),pattern:e})}function qr(e){return new Zl({check:"string_format",format:"lowercase",...T(e)})}function Wr(e){return new Bl({check:"string_format",format:"uppercase",...T(e)})}function Hr(e,t){return new Gl({check:"string_format",format:"includes",...T(t),includes:e})}function Yr(e,t){return new Ul({check:"string_format",format:"starts_with",...T(t),prefix:e})}function Xr(e,t){return new Ql({check:"string_format",format:"ends_with",...T(t),suffix:e})}function za(e,t,n){return new Vl({check:"property",property:e,schema:t,...T(n)})}function Kr(e,t){return new jl({check:"properties",shape:e,...T(t)})}function Jr(e,t){return new ql({check:"mime_type",mime:e,...T(t)})}function At(e){return new Wl({check:"overwrite",tx:e})}function eo(e){return At(t=>t.normalize(e))}function to(){return At(e=>e.trim())}function no(){return At(e=>e.toLowerCase())}function ro(){return At(e=>e.toUpperCase())}function oo(){return At(e=>Mu(e))}function Ym(e,t,n){return new e({type:"array",element:t,...T(n)})}function q4(e,t,n){return new e({type:"union",options:t,...T(n)})}function W4(e,t,n){return new e({type:"union",options:t,inclusive:false,...T(n)})}function H4(e,t,n,r){return new e({type:"union",options:n,discriminator:t,...T(r)})}function Y4(e,t,n){return new e({type:"intersection",left:t,right:n})}function X4(e,t,n,r){let o=n instanceof q,i=o?r:n,s=o?n:null;return new e({type:"tuple",items:t,rest:s,...T(i)})}function K4(e,t,n,r){return new e({type:"record",keyType:t,valueType:n,...T(r)})}function J4(e,t,n,r){return new e({type:"map",keyType:t,valueType:n,...T(r)})}function ew(e,t,n){return new e({type:"set",valueType:t,...T(n)})}function tw(e,t,n){let r=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new e({type:"enum",entries:r,...T(n)})}function nw(e,t,n){return new e({type:"enum",entries:t,...T(n)})}function rw(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...T(n)})}function Xm(e,t){return new e({type:"file",...T(t)})}function ow(e,t){return new e({type:"transform",transform:t})}function iw(e,t){return new e({type:"optional",innerType:t})}function sw(e,t){return new e({type:"nullable",innerType:t})}function aw(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():Qo(n)}})}function cw(e,t,n){return new e({type:"nonoptional",innerType:t,...T(n)})}function uw(e,t){return new e({type:"success",innerType:t})}function lw(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:Fu(n)})}function fw(e,t,n){return new e({type:"pipe",in:t,out:n})}function mw(e,t){return new e({type:"readonly",innerType:t})}function pw(e,t,n){return new e({type:"template_literal",parts:t,...T(n)})}function dw(e,t){return new e({type:"lazy",getter:t})}function hw(e,t){return new e({type:"promise",innerType:t})}function Km(e,t,n){let r=T(n);return r.abort??(r.abort=true),new e({type:"custom",check:"custom",fn:t,...r})}function Jm(e,t,n){return new e({type:"custom",check:"custom",fn:t,...T(n)})}function ep(e,t){let n=r1(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(Or(o,r.value,n._zod.def));else {let i=o;i.fatal&&(i.continue=false),i.code??(i.code="custom"),"input"in i||(i.input=r.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),r.issues.push(Or(i));}},e(r.value,r)),t);return n}function r1(e,t){let n=new he({check:"custom",...T(t)});return n._zod.check=e,n}function tp(e){let t=new he({check:"describe"});return t._zod.onattach=[n=>{let r=Ve.get(n)??{};Ve.add(n,{...r,description:e});}],t._zod.check=()=>{},t}function np(e){let t=new he({check:"meta"});return t._zod.onattach=[n=>{let r=Ve.get(n)??{};Ve.add(n,{...r,...e});}],t._zod.check=()=>{},t}function rp(e,t){let n=T(t),r=n.truthy??["true","1","yes","on","y","enabled"],o=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(r=r.map(m=>typeof m=="string"?m.toLowerCase():m),o=o.map(m=>typeof m=="string"?m.toLowerCase():m));let i=new Set(r),s=new Set(o),a=e.Codec??pi,c=e.Boolean??fi,u=e.String??jn,l=new u({type:"string",error:n.error}),f=new c({type:"boolean",error:n.error}),p=new a({type:"pipe",in:l,out:f,transform:((m,h)=>{let d=m;return n.case!=="sensitive"&&(d=d.toLowerCase()),i.has(d)?true:s.has(d)?false:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:h.value,inst:p,continue:false}),{})}),reverseTransform:((m,h)=>m===true?r[0]||"true":o[0]||"false"),error:n.error});return p._zod.bag.truthy=r,p._zod.bag.falsy=o,p._zod.bag.case=n.case??"insensitive",p}function Jn(e,t,n,r={}){let o=T(r),i={check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:a=>n.test(a),...o};return n instanceof RegExp&&(i.pattern=n),new e(i)}function Si(e,...t){for(let n of t)for(let r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&Qe(e,r,n[r]);return e}function gn(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ve,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Oe(e,t,n,r,o){let i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:o}):t.unrepresentable;if(i==="any")return false;if(i===void 0||i==="throw")throw new Error(o);return Object.assign(n,i),true}function le(e,t,n={path:[],schemaPath:[]}){var r;let o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else {let l={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else {let p=s.schema,m=t.processors[o.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(e,t,p,l);}let f=e._zod.parent;f&&(s.ref||(s.ref=f),le(f,t,l),t.seen.get(f).isParent=true);}let c=t.metadataRegistry.get(e);return c&&Si(s.schema,c),t.io==="input"&&Ke(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function o1(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function _n(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=r.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,s[0]);}}let o=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,p=e.external.uri??(h=>h);if(f)return {ref:p(f)};let m=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=m,{defId:m,ref:`${p("__shared")}#/${a}/${o1(m)}`}}let c="#",u=`${c}/${a}/`;if(s[1]===n&&!s[1].schema.id)return {ref:c};let l=s[1].schema.id??`__schema${e.counter++}`;return {defId:l,ref:u+o1(l)}},i=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:u}=o(s);a.def={...a.schema},u&&(a.defId=u);let l=a.schema;for(let f in l)delete l[f];l.$ref=c;};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
61
|
+
|
|
62
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}a.count>1&&e.reused==="ref"&&i(s);}e.external&&(e.sharedDefsExtractedFor=e.external);}function a1(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let r of t){if(!r||typeof r!="object")return;a1(r);let o=Object.keys(r);if(o.length!==1||o[0]!=="type")return;let i=r.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!="string")return;n.includes(s)||n.push(s);}}delete e.anyOf,e.type=n.length===1?n[0]:n;}var c1=new Set(["type","properties","required","additionalProperties"]),i1=["oneOf","anyOf"];function s1(e){let t=e.additionalProperties;return t===void 0||t===false||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function op(e){let t=[];for(let i of e){if(typeof i!="object"||i.type!=="object")return null;for(let s in i)if(!c1.has(s))return null;t.push(i);}let n={},r=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(n,s))continue;let a=[];for(let u of t){let l=u.properties?.[s]??s1(u);l!=null&&(a.some(f=>JSON.stringify(f)===JSON.stringify(l))||a.push(l));}let c=a.length===1?a[0]:op(a)??{allOf:a};Qe(n,s,c);}for(let s of i.required??[])r.add(s);}let o={type:"object",properties:n};if(r.size&&(o.required=[...r]),t.every(i=>i.additionalProperties===false))o.additionalProperties=false;else {let i=[];for(let s of t){let a=s1(s);a&&!i.some(c=>JSON.stringify(c)===JSON.stringify(a))&&i.push(a);}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i});}return o}function gw(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of c1)if(o in e)return;let n=t.filter(o=>i1.some(i=>Array.isArray(o[i]))),r=null;if(!n.length)r=op(t);else {let o=n[0],i=i1.find(c=>Array.isArray(o[c]));if(Object.keys(o).length!==1)return;let s=t.filter(c=>c!==o),a=o[i].map(c=>op([...s,c]));if(a.some(c=>!c))return;r={[i]:a};}r&&(delete e.allOf,Si(e,r));}function bn(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=a=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},f=c.ref;if(c.ref=null,f){r(f);let m=e.seen.get(f),h=m.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(h)):Si(u,h),Si(u,l),a._zod.parent===f)for(let g in u)g==="$ref"||g==="allOf"||g in l||delete u[g];if(h.$ref&&m.def)for(let g in u)g==="$ref"||g==="allOf"||g in m.def&&JSON.stringify(u[g])===JSON.stringify(m.def[g])&&delete u[g];}let p=a._zod.parent;if(p&&p!==f){r(p);let m=e.seen.get(p);if(m?.schema.$ref&&(u.$ref=m.schema.$ref,m.def))for(let h in u)h==="$ref"||h==="allOf"||h in m.def&&JSON.stringify(u[h])===JSON.stringify(m.def[h])&&delete u[h];}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]});};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of [...e.seen.entries()].reverse())r(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())a1(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let u of [c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let f=a.get(l);f?f.push(u):a.set(l,[u]);}for(let c of e.intersections)for(let u of a.get(c)??[])gw(u);}}let o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a);}Si(o,n.defId?n.schema:n.def??n.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,Qe(s,c.defId,c.def));}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{let a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:io(t,"input",e.processors),output:io(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Ke(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return false;n.seen.add(e);let r=e._zod.def;if(r.type==="transform")return true;if(r.type==="array")return Ke(r.element,n);if(r.type==="set")return Ke(r.valueType,n);if(r.type==="lazy")return Ke(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return Ke(r.innerType,n);if(r.type==="intersection")return Ke(r.left,n)||Ke(r.right,n);if(r.type==="record"||r.type==="map")return Ke(r.keyType,n)||Ke(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?true:Ke(r.in,n)||Ke(r.out,n);if(r.type==="object"){for(let o in r.shape)if(Ke(r.shape[o],n))return true;return false}if(r.type==="union"){for(let o of r.options)if(Ke(o,n))return true;return false}if(r.type==="tuple"){for(let o of r.items)if(Ke(o,n))return true;return !!(r.rest&&Ke(r.rest,n))}return false}var ip=(e,t={})=>n=>{let r=gn({...n,processors:t});return le(e,r),_n(r,e),bn(r,e)},io=(e,t,n={})=>r=>{let{libraryOptions:o,target:i}=r??{},s=gn({...o??{},target:i,io:t,processors:n});return le(e,s),_n(s,e),bn(s,e)};var so=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n);},ao=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n);},u1=(e,t)=>{so(e,"minimum",t),ao(e,"maximum",t);},p1=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t);},d1=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t);},h1=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t];},g1=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=true);},l1=(e,t)=>so(e,"minimum",t.minimum),f1=(e,t)=>ao(e,"maximum",t.maximum),m1=e=>(t,n)=>{g1(t,n.format);let[r,o]=e[n.format];so(t,"minimum",r),ao(t,"maximum",o);},_w={greater_than:(e,t)=>so(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>ao(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>p1(e,t.value),number_format:m1(jo),bigint_format:m1(qo),min_length:l1,max_length:f1,length_equals:(e,t)=>u1(e,t.length),min_size:l1,max_size:f1,size_equals:(e,t)=>u1(e,t.size),string_format:(e,t)=>{g1(e,t.format),t.pattern&&d1(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=true);},mime_type:(e,t)=>h1(e,t.mime)};function Fe(e){let t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(let i of r)_w[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;o.minimum!==void 0&&so(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&so(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&ao(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&ao(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&p1(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=true)),o.mime&&h1(t,o.mime);for(let i of o.patterns??[])d1(t,i);return t}var bw={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},yw=new Map([[Bs,ll],[li,fl]]),_1=e=>yw.get(e)??e,cp=(e,t,n,r)=>{let o=n;o.type="string";let{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u,laxFormat:l}=Fe(e);if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=bw[a]??a,o.format===""&&delete o.format,(a==="time"||l)&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){let f=[...c].map(_1);f.length===1?o.pattern=f[0].source:f.length>1&&(o.allOf=[...f.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))]);}},up=(e,t,n,r)=>{let o=n,{minimum:i,maximum:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=Fe(e);o.type=l?"integer":"number";let f=typeof u=="number"&&u>=(i??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(s??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";if(f?m?(o.minimum=u,o.exclusiveMinimum=true):o.exclusiveMinimum=u:typeof i=="number"&&(o.minimum=i),p?m?(o.maximum=c,o.exclusiveMaximum=true):o.exclusiveMaximum=c:typeof s=="number"&&(o.maximum=s),a){let h=new Set;for(let _ of a)Number.isFinite(_)&&_!==0?h.add(Math.abs(_)):Oe(e,t,o,r,`A multipleOf divisor of ${_} cannot be represented in JSON Schema`);let[d,...g]=h;d!==void 0&&(o.multipleOf=d),g.length&&(o.allOf=[...o.allOf??[],...g.map(_=>({multipleOf:_}))]);}},lp=(e,t,n,r)=>{n.type="boolean";},fp=(e,t,n,r)=>{Oe(e,t,n,r,"BigInt cannot be represented in JSON Schema");},mp=(e,t,n,r)=>{Oe(e,t,n,r,"Symbols cannot be represented in JSON Schema");},pp=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=true,n.enum=[null]):n.type="null";},dp=(e,t,n,r)=>{Oe(e,t,n,r,"Undefined cannot be represented in JSON Schema");},hp=(e,t,n,r)=>{Oe(e,t,n,r,"Void cannot be represented in JSON Schema");},gp=(e,t,n,r)=>{n.not={};},_p=(e,t,n,r)=>{},bp=(e,t,n,r)=>{},yp=(e,t,n,r)=>{Oe(e,t,n,r,"Date cannot be represented in JSON Schema");},$p=(e,t,n,r)=>{let o=e._zod.def,i=Ir(o.entries);if(i.length===0){n.not={};return}i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i;},xp=(e,t,n,r)=>{let o=e._zod.def;if(o.values.length===0){n.not={};return}let i=[];for(let s of o.values)if(s===void 0){if(Oe(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(Oe(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(s));}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s;}else i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),i.every(s=>typeof s=="boolean")&&(n.type="boolean"),i.every(s=>s===null)&&(n.type="null"),n.enum=i;},wp=(e,t,n,r)=>{Oe(e,t,n,r,"NaN cannot be represented in JSON Schema");},Sp=(e,t,n,r)=>{let o=n,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=i.source;},vp=(e,t,n,r)=>{let o=n;o.type="string",o.format="binary",o.contentEncoding="binary";let{minimum:i,maximum:s,mime:a}=Fe(e);i!==void 0&&(o.minLength=i),s!==void 0&&(o.maxLength=s),a&&(a.length===0?o.not={}:a.length===1?o.contentMediaType=a[0]:o.anyOf=a.map(c=>({contentMediaType:c})));},Cp=(e,t,n,r)=>{n.type="boolean";},Pp=(e,t,n,r)=>{Oe(e,t,n,r,"Custom types cannot be represented in JSON Schema");},Ap=(e,t,n,r)=>{Oe(e,t,n,r,"Function types cannot be represented in JSON Schema");},Ep=(e,t,n,r)=>{Oe(e,t,n,r,"Transforms cannot be represented in JSON Schema");},kp=(e,t,n,r)=>{Oe(e,t,n,r,"Map cannot be represented in JSON Schema");},Rp=(e,t,n,r)=>{Oe(e,t,n,r,"Set cannot be represented in JSON Schema");},Mp=(e,t,n,r)=>{let o=n,i=e._zod.def,{minimum:s,maximum:a}=Fe(e);typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=le(i.element,t,{...r,path:[...r.path,"items"]});};function vi(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?vi(t.out):t.type==="catch"?vi(t.innerType):e._zod.optin}var Ip=(e,t,n,r)=>{let o=n,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&Oe(e,t,o,r,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let u in s)Qe(o.properties,u,le(s[u],t,{...r,path:[...r.path,"properties",u]}));let c=[];for(let u of Object.keys(s)){let l=i.shape[u];(t.io==="input"?vi(l)===void 0:l._zod.optout===void 0)&&c.push(u);}c.length>0&&(o.required=c),i.catchall?._zod.def.type==="never"?o.additionalProperties=false:i.catchall?i.catchall&&(o.additionalProperties=le(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=false);},Na=(e,t,n,r)=>{let o=e._zod.def,i=o.inclusive===false,s=o.options.map((a,c)=>le(a,t,{...r,path:[...r.path,i?"oneOf":"anyOf",c]}));i?n.oneOf=s:n.anyOf=s;},Lp=(e,t,n,r)=>{let o=e._zod.def,i=le(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=le(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=c,t.intersections.push(c);},zp=(e,t,n,r)=>{let o=n,i=e._zod.def;o.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((d,g)=>le(d,t,{...r,path:[...r.path,s,g]})),u=i.rest?le(i.rest,t,{...r,path:[...r.path,a,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null,l=i.items.length;for(;l>0;){let d=i.items[l-1];if(!(t.io==="input"?vi(d)!==void 0:d._zod.optout==="optional"))break;l--;}let f=i.items.length,p=!i.rest;t.target==="draft-2020-12"?(o.prefixItems=c,p?o.items=false:u&&(o.items=u),l>0&&(o.minItems=l),p&&(o.maxItems=f)):t.target==="openapi-3.0"?(o.items={anyOf:c},u&&o.items.anyOf.push(u),l>0&&(o.minItems=l),p&&(o.maxItems=f)):(o.items=c,p?o.additionalItems=false:u&&(o.additionalItems=u),l>0&&(o.minItems=l),p&&(o.maxItems=f));let{minimum:m,maximum:h}=Fe(e);typeof m=="number"&&(o.minItems=m),typeof h=="number"&&(o.maxItems=h);};function sp(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let h=e.get(t)?.def;if(!h)return t;let d=sp(e,h,n);return d===h?t:d}for(let h of ["anyOf","oneOf"]){let d=t[h];if(!Array.isArray(d))continue;let g=d.map(_=>sp(e,_,n));g.some((_,b)=>_!==d[b])&&(t={...t,[h]:g});}let r=Array.isArray(t.type)?t.type:[t.type],o=!r.includes("string")&&r.some(h=>h==="number"||h==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!i?.some(h=>typeof h=="number"))return t;let{minimum:s,maximum:a,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:f,id:p,...m}=t;return m.enum?m.enum=m.enum.map(h=>typeof h=="number"?String(h):h):typeof m.const=="number"&&(m.const=String(m.const)),o&&(m.type="string",i||(m.pattern=(r.includes("number")?Yt:ri).source)),m}var ap=new WeakMap;function $w(e){let t=new Map;for(let r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);let n=new Map;for(let r of ap.get(e)??[]){let o=e.seen.get(r),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===true||n.has(i))continue;let s=sp(t,i,new Set);s!==i&&n.set(i,s);}if(n.size)for(let r of e.seen.values())for(let o of [r.schema,r.def]){let i=o&&n.get(o.propertyNames);i&&(o.propertyNames=i);}}var Tp=(e,t,n,r)=>{let o=n,i=e._zod.def;o.type="object";let s=i.keyType,a=Fe(s).patterns;if(i.mode==="loose"&&a&&a.size>0){let l=le(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(let f of a)Qe(o.patternProperties,_1(f).source,l);}else {if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=le(i.keyType,t,{...r,path:[...r.path,"propertyNames"]});let l=ap.get(t);l||(l=[],ap.set(t,l),t.deferred.push(()=>$w(t))),l.push(e);}o.additionalProperties=le(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});}let c=s._zod.values,u=t.io==="input"&&vi(i.valueType)!==void 0;if(c&&!i.partial&&!u){let l=[...c].filter(f=>typeof f=="string"||typeof f=="number");l.length>0&&(o.required=l.map(String));}},Np=(e,t,n,r)=>{let o=e._zod.def,i=le(o.innerType,t,r),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,n.nullable=true):n.anyOf=[i,{type:"null"}];},Op=(e,t,n,r)=>{let o=e._zod.def;le(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType;},Fp=Symbol();function b1(e,t,n,r,o){let i=false,s=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(i=true,null));return i?(Oe(t,n,r,o,"BigInt defaults cannot be represented in JSON Schema"),Fp):JSON.parse(s)}var Dp=(e,t,n,r)=>{let o=e._zod.def;le(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType;let s=b1(o.defaultValue,e,t,n,r);s!==Fp&&(n.default=s);},Zp=(e,t,n,r)=>{let o=e._zod.def;le(o.innerType,t,r);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=b1(o.defaultValue,e,t,n,r);s!==Fp&&(n._prefault=s);},Bp=(e,t,n,r)=>{let o=e._zod.def;le(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0);}catch{Oe(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=s;},Gp=(e,t,n,r)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;le(s,t,r);let a=t.seen.get(e);a.ref=s;},Up=(e,t,n,r)=>{let o=e._zod.def;le(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType,n.readOnly=true;},Qp=(e,t,n,r)=>{let o=e._zod.def;le(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType;},Oa=(e,t,n,r)=>{let o=e._zod.def;le(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType;},Vp=(e,t,n,r)=>{let o=e._zod.innerType;le(o,t,r);let i=t.seen.get(e);i.ref=o;},Ta={string:cp,number:up,boolean:lp,bigint:fp,symbol:mp,null:pp,undefined:dp,void:hp,never:gp,any:_p,unknown:bp,date:yp,enum:$p,literal:xp,nan:wp,template_literal:Sp,file:vp,success:Cp,custom:Pp,function:Ap,transform:Ep,map:kp,set:Rp,array:Mp,object:Ip,union:Na,intersection:Lp,tuple:zp,record:Tp,nullable:Np,nonoptional:Op,default:Dp,prefault:Zp,catch:Bp,pipe:Gp,readonly:Up,promise:Qp,optional:Oa,lazy:Vp};function Fa(e,t){if("_idmap"in e){let r=e,o=gn({...t,processors:Ta}),i={};for(let c of r._idmap.entries()){let[u,l]=c;le(l,o);}let s={},a={registry:r,uri:t?.uri,defs:i};o.external=a;for(let c of r._idmap.entries()){let[u,l]=c;_n(o,l),Qe(s,u,bn(o,l));}if(Object.keys(i).length>0){let c=o.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:i};}return {schemas:s}}let n=gn({...t,processors:Ta});return le(e,n),_n(n,e),bn(n,e)}var Da=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t;}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=gn({processors:Ta,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}});}process(t,n={path:[],schemaPath:[]}){return le(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,_n(this.ctx,t);let r=bn(this.ctx,t),{"~standard":o,...i}=r;return i}};var y1={};var go={};un(go,{ZodAny:()=>pd,ZodArray:()=>_d,ZodBase64:()=>oc,ZodBase64URL:()=>ic,ZodBigInt:()=>po,ZodBigIntFormat:()=>cc,ZodBoolean:()=>mo,ZodCIDRv4:()=>nc,ZodCIDRv6:()=>rc,ZodCUID:()=>Ha,ZodCUID2:()=>Ya,ZodCatch:()=>Fd,ZodCodec:()=>zi,ZodCreditCard:()=>id,ZodCustom:()=>Ti,ZodCustomStringFormat:()=>rr,ZodDate:()=>Ei,ZodDefault:()=>Id,ZodDiscriminatedUnion:()=>yd,ZodE164:()=>sc,ZodEmail:()=>Va,ZodEmoji:()=>qa,ZodEnum:()=>uo,ZodExactOptional:()=>mc,ZodFile:()=>Ed,ZodFunction:()=>Wd,ZodGUID:()=>ja,ZodIBAN:()=>sd,ZodIPv4:()=>ec,ZodIPv6:()=>tc,ZodISODate:()=>$n,ZodISODateTime:()=>yn,ZodISODuration:()=>wn,ZodISOTime:()=>xn,ZodInstanceOf:()=>Xd,ZodIntersection:()=>$d,ZodJWT:()=>ac,ZodKSUID:()=>Ja,ZodLazy:()=>Vd,ZodLiteral:()=>Ad,ZodMAC:()=>od,ZodMap:()=>Cd,ZodNaN:()=>Zd,ZodNanoID:()=>Wa,ZodNever:()=>hd,ZodNonOptional:()=>pc,ZodNull:()=>fd,ZodNullable:()=>Md,ZodNumber:()=>fo,ZodNumberFormat:()=>or,ZodObject:()=>Ri,ZodOptional:()=>Ii,ZodPipe:()=>Li,ZodPrefault:()=>zd,ZodPreprocess:()=>Bd,ZodPromise:()=>qd,ZodReadonly:()=>Gd,ZodRecord:()=>co,ZodSet:()=>Pd,ZodString:()=>lo,ZodStringFormat:()=>pe,ZodSuccess:()=>Od,ZodSymbol:()=>ud,ZodTemplateLiteral:()=>Qd,ZodTransform:()=>kd,ZodTuple:()=>wd,ZodType:()=>H,ZodULID:()=>Xa,ZodURL:()=>Ai,ZodUUID:()=>Ft,ZodUndefined:()=>ld,ZodUnion:()=>Mi,ZodUnknown:()=>dd,ZodVoid:()=>gd,ZodXID:()=>Ka,ZodXor:()=>bd,_ZodString:()=>Qa,_default:()=>Ld,_function:()=>I_,any:()=>u_,array:()=>ki,base64:()=>U1,base64url:()=>Q1,bigint:()=>o_,boolean:()=>cd,catch:()=>Dd,check:()=>L_,cidrv4:()=>B1,cidrv6:()=>G1,codec:()=>E_,creditCard:()=>j1,cuid:()=>L1,cuid2:()=>z1,currencyCode:()=>K1,custom:()=>z_,date:()=>f_,describe:()=>T_,discriminatedUnion:()=>__,e164:()=>V1,email:()=>S1,emoji:()=>M1,enum:()=>lc,exactOptional:()=>Rd,file:()=>v_,float32:()=>e_,float64:()=>t_,function:()=>I_,guid:()=>v1,hash:()=>J1,hex:()=>X1,hostname:()=>Y1,httpUrl:()=>R1,iban:()=>q1,instanceof:()=>O_,int:()=>Ga,int32:()=>n_,int64:()=>i_,intersection:()=>xd,invertCodec:()=>k_,ipv4:()=>F1,ipv6:()=>Z1,json:()=>D_,jwt:()=>W1,keyof:()=>m_,ksuid:()=>O1,lazy:()=>jd,literal:()=>S_,looseObject:()=>h_,looseRecord:()=>y_,mac:()=>D1,map:()=>$_,meta:()=>N_,nan:()=>A_,nanoid:()=>I1,nativeEnum:()=>w_,never:()=>uc,nonoptional:()=>Nd,null:()=>md,nullable:()=>Pi,nullish:()=>C_,number:()=>ad,object:()=>p_,optional:()=>tr,partialRecord:()=>b_,pipe:()=>Ua,prefault:()=>Td,preprocess:()=>Z_,promise:()=>M_,readonly:()=>Ud,record:()=>vd,refine:()=>Hd,set:()=>x_,strictObject:()=>d_,string:()=>Ci,stringFormat:()=>H1,stringbool:()=>F_,success:()=>P_,superRefine:()=>Yd,symbol:()=>a_,templateLiteral:()=>R_,transform:()=>fc,tuple:()=>Sd,uint32:()=>r_,uint64:()=>s_,ulid:()=>T1,undefined:()=>c_,union:()=>ho,unknown:()=>er,url:()=>k1,uuid:()=>C1,uuidv4:()=>P1,uuidv6:()=>A1,uuidv7:()=>E1,void:()=>l_,xid:()=>N1,xor:()=>g_});var ww=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function o(i,s){return i==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):r[i]??i}return i=>{switch(i.code){case "invalid_type":{let s=o(i.expected),a=Nu(i.input),c=o(a,i.input);return `Invalid input: expected ${s}, received ${c}`}case "invalid_value":return i.values.length===1?`Invalid input: expected ${ms(i.values[0])}`:`Invalid option: expected one of ${us(i.values,"|")}`;case "too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",a=t(i.origin);return a?`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case "too_small":{let s=i.exact?"exactly ":i.inclusive?">=":">",a=t(i.origin);return a?`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${a.unit}`:`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case "invalid_format":{let s=i;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${n[s.format]??i.format}`}case "not_multiple_of":return `Invalid number: must be a multiple of ${i.divisor}`;case "unrecognized_keys":return `Unrecognized key${i.keys.length>1?"s":""}: ${us(i.keys,", ")}`;case "invalid_key":return `Invalid key in ${i.origin}`;case "invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(a=>`'${a}'`).join(" | ")}`:i.inclusive===false?"Invalid input: more than one option matched":"Invalid input";case "invalid_element":return `Invalid value in ${i.origin}`;default:return "Invalid input"}}};function $1(){return {localeError:ww()}}var Za={};un(Za,{endsWith:()=>Xr,gt:()=>Nt,gte:()=>ht,includes:()=>Hr,length:()=>Kn,lowercase:()=>qr,lt:()=>Tt,lte:()=>dt,maxLength:()=>Xn,maxSize:()=>hn,mime:()=>Jr,minLength:()=>Xt,minSize:()=>Ot,multipleOf:()=>dn,negative:()=>Ma,nonnegative:()=>La,nonpositive:()=>Ia,normalize:()=>eo,overwrite:()=>At,positive:()=>Ra,properties:()=>Kr,property:()=>za,regex:()=>jr,size:()=>Yn,slugify:()=>oo,startsWith:()=>Yr,toLowerCase:()=>no,toUpperCase:()=>ro,trim:()=>to,uppercase:()=>Wr});var x1=new WeakSet([Object.prototype,Error.prototype]);function Ba(e,t,n){Object.defineProperty(e,t,{configurable:true,enumerable:false,get(){let r=n(this);return Object.defineProperty(this,t,{value:r,configurable:true,writable:true}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:true,writable:true});}});}var w1=(e,t)=>{Qu.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);x1.has(n)||(x1.add(n),Ba(n,"format",r=>o=>Jo(r,o)),Ba(n,"flatten",r=>o=>Ko(r,o)),Ba(n,"addIssue",r=>o=>{r.issues.push(o),r.message=JSON.stringify(r.issues,Lr,2);}),Ba(n,"addIssues",r=>o=>{r.issues.push(...o),r.message=JSON.stringify(r.issues,Lr,2);}),Object.defineProperty(n,"isEmpty",{configurable:true,enumerable:false,get(){return this.issues.length===0}}));},Sw=P("ZodError",w1),lt=P("ZodError",w1,void 0,{Parent:Error});var jp=Fr(lt),qp=Dr(lt),Wp=Zr(lt),Hp=Br(lt),Yp=bs(lt),Xp=ys(lt),Kp=$s(lt),Jp=xs(lt),ed=ws(lt),td=Ss(lt),nd=vs(lt),rd=Cs(lt);function Cw(){Ze.localeError||Ee($1());}function nr(){Ze.memoizer||Ee({memoizer:_i()});}var H=P("ZodType",(e,t)=>(Cw(),q.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(F.mergeDefs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:true})},with(...e){return this.check(...e)},clone(e,t){return ce(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Hd(e,t))},superRefine(e,t){return this.check(Yd(e,t))},overwrite(e){return this.check(At(e))},optional(){return tr(this)},exactOptional(){return Rd(this)},nullable(){return Pi(this)},nullish(){return tr(Pi(this))},nonoptional(e){return Nd(this,e)},array(){return ki(this)},or(e){return ho([this,e])},and(e){return xd(this,e)},transform(e){return Ua(this,fc(e))},default(e){return Ld(this,e)},prefault(e){return Td(this,e)},catch(e){return Dd(this,e)},pipe(e){return Ua(this,e)},readonly(){return Ud(this)},describe(e){let t=this.clone();return Ve.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ve.get(this);let t=this.clone();return Ve.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return F.hide(this,"~standard",{...Ns(this),jsonSchema:{input:io(this,"input"),output:io(this,"output")}})},set"~standard"(e){F.own(this,"~standard",e);},parse:function e(t,n){return jp(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await qp(this,t,n,{callee:e})},safeParse(e,t){return Wp(this,e,t)},async safeParseAsync(e,t){return Hp(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){F.own(this,"spa",e);},validate(e,t){return ei(this,e,t)},validateAsync(e,t){return ti(this,e,t)},encode:function e(t,n){return Yp(this,t,n,{callee:e})},decode:function e(t,n){return Xp(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Kp(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Jp(this,t,n,{callee:e})},safeEncode(e,t){return ed(this,e,t)},safeDecode(e,t){return td(this,e,t)},async safeEncodeAsync(e,t){return nd(this,e,t)},async safeDecodeAsync(e,t){return rd(this,e,t)},toJSONSchema(e){return ip(this,{})(e)},get description(){return Ve.get(this)?.description},get _def(){return this._zod.def}}),Qa=P("_ZodString",(e,t)=>{jn.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>cp(e,n,r);},F.derived({format:e=>Fe(e).format??null,minLength:e=>Fe(e).minimum??null,maxLength:e=>Fe(e).maximum??null},{regex(...e){return this.check(jr(...e))},includes(...e){return this.check(Hr(...e))},startsWith(...e){return this.check(Yr(...e))},endsWith(...e){return this.check(Xr(...e))},min(...e){return this.check(Xt(...e))},max(...e){return this.check(Xn(...e))},length(...e){return this.check(Kn(...e))},nonempty(...e){return this.check(Xt(1,...e))},lowercase(e){return this.check(qr(e))},uppercase(e){return this.check(Wr(e))},trim(){return this.check(to())},normalize(...e){return this.check(eo(...e))},toLowerCase(){return this.check(no())},toUpperCase(){return this.check(ro())},slugify(){return this.check(oo())}})),lo=P("ZodString",(e,t)=>{jn.init(e,t),Qa.init(e,t);},{email(e){return this.check(ua(Va,e))},url(e){return this.check(bi(Ai,e))},jwt(e){return this.check(ka(ac,e))},emoji(e){return this.check(ha(qa,e))},guid(e){return this.check(la(ja,e))},uuid(e){return this.check(fa(Ft,e))},uuidv4(e){return this.check(ma(Ft,e))},uuidv6(e){return this.check(pa(Ft,e))},uuidv7(e){return this.check(da(Ft,e))},nanoid(e){return this.check(ga(Wa,e))},cuid(e){return this.check(_a(Ha,e))},cuid2(e){return this.check(ba(Ya,e))},ulid(e){return this.check(ya(Xa,e))},base64(e){return this.check(Pa(oc,e))},base64url(e){return this.check(Aa(ic,e))},xid(e){return this.check($a(Ka,e))},ksuid(e){return this.check(xa(Ja,e))},ipv4(e){return this.check(wa(ec,e))},ipv6(e){return this.check(Sa(tc,e))},cidrv4(e){return this.check(va(nc,e))},cidrv6(e){return this.check(Ca(rc,e))},e164(e){return this.check(Ea(sc,e))},datetime(e){return this.check(yi(yn,e))},date(e){return this.check($i($n,e))},time(e){return this.check(xi(xn,e))},duration(e){return this.check(wi(wn,e))}});function Ci(e){return xm(lo,e)}var pe=P("ZodStringFormat",(e,t)=>{ue.init(e,t),Qa.init(e,t);}),yn=P("ZodISODateTime",(e,t)=>{ff.init(e,t),pe.init(e,t);}),$n=P("ZodISODate",(e,t)=>{mf.init(e,t),pe.init(e,t);}),xn=P("ZodISOTime",(e,t)=>{pf.init(e,t),pe.init(e,t);}),wn=P("ZodISODuration",(e,t)=>{df.init(e,t),pe.init(e,t);}),Va=P("ZodEmail",(e,t)=>{Jl.init(e,t),pe.init(e,t);});function S1(e){return ua(Va,e)}var ja=P("ZodGUID",(e,t)=>{Xl.init(e,t),pe.init(e,t);});function v1(e){return la(ja,e)}var Ft=P("ZodUUID",(e,t)=>{Kl.init(e,t),pe.init(e,t);});function C1(e){return fa(Ft,e)}function P1(e){return ma(Ft,e)}function A1(e){return pa(Ft,e)}function E1(e){return da(Ft,e)}var Ai=P("ZodURL",(e,t)=>{nf.init(e,t),pe.init(e,t);});function k1(e){return bi(Ai,e)}function R1(e){return bi(Ai,{protocol:ni,hostname:pl,...F.normalizeParams(e)})}var qa=P("ZodEmoji",(e,t)=>{rf.init(e,t),pe.init(e,t);});function M1(e){return ha(qa,e)}var Wa=P("ZodNanoID",(e,t)=>{of.init(e,t),pe.init(e,t);});function I1(e){return ga(Wa,e)}var Ha=P("ZodCUID",(e,t)=>{sf.init(e,t),pe.init(e,t);});function L1(e){return _a(Ha,e)}var Ya=P("ZodCUID2",(e,t)=>{af.init(e,t),pe.init(e,t);});function z1(e){return ba(Ya,e)}var Xa=P("ZodULID",(e,t)=>{cf.init(e,t),pe.init(e,t);});function T1(e){return ya(Xa,e)}var Ka=P("ZodXID",(e,t)=>{uf.init(e,t),pe.init(e,t);});function N1(e){return $a(Ka,e)}var Ja=P("ZodKSUID",(e,t)=>{lf.init(e,t),pe.init(e,t);});function O1(e){return xa(Ja,e)}var ec=P("ZodIPv4",(e,t)=>{hf.init(e,t),pe.init(e,t);});function F1(e){return wa(ec,e)}var od=P("ZodMAC",(e,t)=>{_f.init(e,t),pe.init(e,t);});function D1(e){return Sm(od,e)}var tc=P("ZodIPv6",(e,t)=>{gf.init(e,t),pe.init(e,t);});function Z1(e){return Sa(tc,e)}var nc=P("ZodCIDRv4",(e,t)=>{bf.init(e,t),pe.init(e,t);});function B1(e){return va(nc,e)}var rc=P("ZodCIDRv6",(e,t)=>{yf.init(e,t),pe.init(e,t);});function G1(e){return Ca(rc,e)}var oc=P("ZodBase64",(e,t)=>{$f.init(e,t),pe.init(e,t);});function U1(e){return Pa(oc,e)}var ic=P("ZodBase64URL",(e,t)=>{xf.init(e,t),pe.init(e,t);});function Q1(e){return Aa(ic,e)}var sc=P("ZodE164",(e,t)=>{wf.init(e,t),pe.init(e,t);});function V1(e){return Ea(sc,e)}var id=P("ZodCreditCard",(e,t)=>{Sf.init(e,t),pe.init(e,t);});function j1(e){return vm(id,e)}var sd=P("ZodIBAN",(e,t)=>{vf.init(e,t),pe.init(e,t);});function q1(e){return Cm(sd,e)}var ac=P("ZodJWT",(e,t)=>{Cf.init(e,t),pe.init(e,t);});function W1(e){return ka(ac,e)}var rr=P("ZodCustomStringFormat",(e,t)=>{Pf.init(e,t),pe.init(e,t);});function H1(e,t,n={}){return Jn(rr,e,t,n)}function Y1(e){return Jn(rr,"hostname",ml,e)}function X1(e){return Jn(rr,"hex",Al,e)}function K1(e){return Jn(rr,"currency_code",hl,e)}function J1(e,t){let n=t?.enc??"hex",r=`${e}_${n}`,o=wt[r];if(!o)throw new Error(`Unrecognized hash format: ${r}`);return Jn(rr,r,o,t)}var fo=P("ZodNumber",(e,t)=>{js.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>up(e,n,r,o),e.isFinite=true;},F.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Fe(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Fe(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:n}=Fe(e);return !!t||!!n?.some(Number.isSafeInteger)},format:e=>Fe(e).format??null},{gt(e,t){return this.check(Nt(e,t))},gte(e,t){return this.check(ht(e,t))},min(e,t){return this.check(ht(e,t))},lt(e,t){return this.check(Tt(e,t))},lte(e,t){return this.check(dt(e,t))},max(e,t){return this.check(dt(e,t))},int(e){return this.check(Ga(e))},safe(e){return this.check(Ga(e))},positive(e){return this.check(Nt(0,e))},nonnegative(e){return this.check(ht(0,e))},negative(e){return this.check(Tt(0,e))},nonpositive(e){return this.check(dt(0,e))},multipleOf(e,t){return this.check(dn(e,t))},step(e,t){return this.check(dn(e,t))},finite(){return this}}));function ad(e){return Am(fo,e)}var or=P("ZodNumberFormat",(e,t)=>{Af.init(e,t),fo.init(e,t);});function Ga(e){return km(or,e)}function e_(e){return Rm(or,e)}function t_(e){return Mm(or,e)}function n_(e){return Im(or,e)}function r_(e){return Lm(or,e)}var mo=P("ZodBoolean",(e,t)=>{fi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>lp(e,n,r);});function cd(e){return zm(mo,e)}var po=P("ZodBigInt",(e,t)=>{qs.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fp(e,n,r,o);},F.derived({minValue:e=>Fe(e).minimum??null,maxValue:e=>Fe(e).maximum??null,format:e=>Fe(e).format??null},{gte(e,t){return this.check(ht(e,t))},min(e,t){return this.check(ht(e,t))},gt(e,t){return this.check(Nt(e,t))},lt(e,t){return this.check(Tt(e,t))},lte(e,t){return this.check(dt(e,t))},max(e,t){return this.check(dt(e,t))},positive(e){return this.check(Nt(BigInt(0),e))},negative(e){return this.check(Tt(BigInt(0),e))},nonpositive(e){return this.check(dt(BigInt(0),e))},nonnegative(e){return this.check(ht(BigInt(0),e))},multipleOf(e,t){return this.check(dn(e,t))}}));function o_(e){return Nm(po,e)}var cc=P("ZodBigIntFormat",(e,t)=>{Ef.init(e,t),po.init(e,t);});function i_(e){return Fm(cc,e)}function s_(e){return Dm(cc,e)}var ud=P("ZodSymbol",(e,t)=>{kf.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mp(e,n,r,o);});function a_(e){return Zm(ud,e)}var ld=P("ZodUndefined",(e,t)=>{Rf.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>dp(e,n,r,o);});function c_(e){return Bm(ld,e)}var fd=P("ZodNull",(e,t)=>{Mf.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>pp(e,n,r);});function md(e){return Gm(fd,e)}var pd=P("ZodAny",(e,t)=>{If.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_p();});function u_(){return Um(pd)}var dd=P("ZodUnknown",(e,t)=>{Lf.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bp();});function er(){return Qm(dd)}var hd=P("ZodNever",(e,t)=>{zf.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>gp(e,n,r);});function uc(e){return Vm(hd,e)}var gd=P("ZodVoid",(e,t)=>{Tf.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hp(e,n,r,o);});function l_(e){return jm(gd,e)}var Ei=P("ZodDate",(e,t)=>{Nf.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>yp(e,n,r,o),e.min=(n,r)=>e.check(ht(n,r)),e.max=(n,r)=>e.check(dt(n,r));},F.derived({minDate:e=>{let{minimum:t}=Fe(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=Fe(e);return t?new Date(t):null}},{}));function f_(e){return qm(Ei,e)}var _d=P("ZodArray",(e,t)=>{nr(),Ff.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Mp(e,n,r,o),e.element=t.element;},{min(e,t){return this.check(Xt(e,t))},nonempty(e){return this.check(Xt(1,e))},max(e,t){return this.check(Xn(e,t))},length(e,t){return this.check(Kn(e,t))},unwrap(){return this.element}});function ki(e,t){return Ym(_d,e,t)}function m_(e){let t=e._zod.def.shape;return lc(Object.keys(t))}var Ri=P("ZodObject",(e,t)=>{nr(),Df.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ip(e,n,r,o),F.installLazyProp(e,"shape",n=>n._zod.def.shape,false);},{keyof(){return lc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(F.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(F.mergeDefs(this._zod.def,{catchall:er()}))},loose(){return this.clone(F.mergeDefs(this._zod.def,{catchall:er()}))},strict(){return this.clone(F.mergeDefs(this._zod.def,{catchall:uc()}))},strip(){return this.clone(F.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return F.extend(this,e)},safeExtend(e){return F.safeExtend(this,e)},merge(e){return F.merge(this,e)},pick(e){return F.pick(this,e)},omit(e){return F.omit(this,e)},partial(...e){return F.partial(Ii,this,e[0])},exactPartial(...e){return F.partial(mc,this,e[0],"exactPartial")},required(...e){return F.required(pc,this,e[0])}});function p_(e,t){let n={type:"object",shape:e??{},...F.normalizeParams(t)};return new Ri(n)}function d_(e,t){return new Ri({type:"object",shape:e,catchall:uc(),...F.normalizeParams(t)})}function h_(e,t){return new Ri({type:"object",shape:e,catchall:er(),...F.normalizeParams(t)})}var Mi=P("ZodUnion",(e,t)=>{mi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Na(e,n,r,o),e.options=t.options;});function ho(e,t){return new Mi({type:"union",options:e,...F.normalizeParams(t)})}var bd=P("ZodXor",(e,t)=>{Mi.init(e,t),Zf.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Na(e,n,r,o),e.options=t.options;});function g_(e,t){return new bd({type:"union",options:e,inclusive:false,...F.normalizeParams(t)})}var yd=P("ZodDiscriminatedUnion",(e,t)=>{Mi.init(e,t),Gf.init(e,t);});function __(e,t,n){return new yd({type:"union",options:t,discriminator:e,...F.normalizeParams(n)})}var $d=P("ZodIntersection",(e,t)=>{Uf.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Lp(e,n,r,o);});function xd(e,t){return new $d({type:"intersection",left:e,right:t})}var wd=P("ZodTuple",(e,t)=>{nr(),Ws.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>zp(e,n,r,o);},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new Ii({type:"optional",innerType:t}))})}});function Sd(e,t,n){let r=t instanceof q,o=r?n:t,i=r?t:null;return new wd({type:"tuple",items:e,rest:i,...F.normalizeParams(o)})}var co=P("ZodRecord",(e,t)=>{nr(),Qf.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Tp(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType;});function vd(e,t,n){return !t||!t._zod?new co({type:"record",keyType:Ci(),valueType:e,...F.normalizeParams(t)}):new co({type:"record",keyType:e,valueType:t,...F.normalizeParams(n)})}function b_(e,t,n){return new co({type:"record",keyType:e,valueType:t,...F.normalizeParams(n),partial:true})}function y_(e,t,n){return new co({type:"record",keyType:e,valueType:t,mode:"loose",...F.normalizeParams(n)})}var Cd=P("ZodMap",(e,t)=>{nr(),Vf.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>kp(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(Ot(...n)),e.nonempty=n=>e.check(Ot(1,n)),e.max=(...n)=>e.check(hn(...n)),e.size=(...n)=>e.check(Yn(...n));});function $_(e,t,n){return new Cd({type:"map",keyType:e,valueType:t,...F.normalizeParams(n)})}var Pd=P("ZodSet",(e,t)=>{nr(),jf.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Rp(e,n,r,o),e.min=(...n)=>e.check(Ot(...n)),e.nonempty=n=>e.check(Ot(1,n)),e.max=(...n)=>e.check(hn(...n)),e.size=(...n)=>e.check(Yn(...n));});function x_(e,t){return new Pd({type:"set",valueType:e,...F.normalizeParams(t)})}var uo=P("ZodEnum",(e,t)=>{qf.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,i)=>$p(e,r,o),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{let i={};for(let s of r)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new uo({...t,checks:[],...F.normalizeParams(o),entries:i})},e.exclude=(r,o)=>{let i={...t.entries};for(let s of r)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new uo({...t,checks:[],...F.normalizeParams(o),entries:i})};});function lc(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new uo({type:"enum",entries:n,...F.normalizeParams(t)})}function w_(e,t){return new uo({type:"enum",entries:e,...F.normalizeParams(t)})}var Ad=P("ZodLiteral",(e,t)=>{Wf.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xp(e,n,r,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}});});function S_(e,t){return new Ad({type:"literal",values:Array.isArray(e)?e:[e],...F.normalizeParams(t)})}var Ed=P("ZodFile",(e,t)=>{Hf.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vp(e,n,r),e.min=(n,r)=>e.check(Ot(n,r)),e.max=(n,r)=>e.check(hn(n,r)),e.mime=(n,r)=>e.check(Jr(Array.isArray(n)?n:[n],r));});function v_(e){return Xm(Ed,e)}var kd=P("ZodTransform",(e,t)=>{nr(),Yf.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ep(e,n,r,o),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new mn(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(F.issue(i,n.value,t));else {let s=i;s.fatal&&(s.continue=false),s.code??(s.code="custom"),"input"in s||(s.input=n.value),s.inst??(s.inst=e),n.issues.push(F.issue(s));}};let o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)};});function fc(e){return new kd({type:"transform",transform:e})}var Ii=P("ZodOptional",(e,t)=>{Hs.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Oa(e,n,r,o),e.unwrap=()=>e._zod.def.innerType;});function tr(e){return new Ii({type:"optional",innerType:e})}var mc=P("ZodExactOptional",(e,t)=>{Xf.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Oa(e,n,r,o),e.unwrap=()=>e._zod.def.innerType;});function Rd(e){return new mc({type:"optional",innerType:e})}var Md=P("ZodNullable",(e,t)=>{Kf.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Np(e,n,r,o),e.unwrap=()=>e._zod.def.innerType;});function Pi(e){return new Md({type:"nullable",innerType:e})}function C_(e){return tr(Pi(e))}var Id=P("ZodDefault",(e,t)=>{Jf.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Dp(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap;});function Ld(e,t){return new Id({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():F.shallowClone(t)}})}var zd=P("ZodPrefault",(e,t)=>{em.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Zp(e,n,r,o),e.unwrap=()=>e._zod.def.innerType;});function Td(e,t){return new zd({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():F.shallowClone(t)}})}var pc=P("ZodNonOptional",(e,t)=>{tm.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Op(e,n,r,o),e.unwrap=()=>e._zod.def.innerType;});function Nd(e,t){return new pc({type:"nonoptional",innerType:e,...F.normalizeParams(t)})}var Od=P("ZodSuccess",(e,t)=>{nm.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Cp(e,n,r),e.unwrap=()=>e._zod.def.innerType;});function P_(e){return new Od({type:"success",innerType:e})}var Fd=P("ZodCatch",(e,t)=>{rm.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Bp(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap;});function Dd(e,t){return new Fd({type:"catch",innerType:e,catchValue:typeof t=="function"?t:F.constantCatch(t)})}var Zd=P("ZodNaN",(e,t)=>{om.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>wp(e,n,r,o);});function A_(e){return Hm(Zd,e)}var Li=P("ZodPipe",(e,t)=>{Ys.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Gp(e,n,r,o),e.in=t.in,e.out=t.out;});function Ua(e,t){return new Li({type:"pipe",in:e,out:t})}var zi=P("ZodCodec",(e,t)=>{Li.init(e,t),pi.init(e,t);});function E_(e,t,n){return new zi({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function k_(e){let t=e._zod.def;return new zi({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var Bd=P("ZodPreprocess",(e,t)=>{Li.init(e,t),im.init(e,t);}),Gd=P("ZodReadonly",(e,t)=>{sm.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Up(e,n,r,o),e.unwrap=()=>e._zod.def.innerType;});function Ud(e){return new Gd({type:"readonly",innerType:e})}var Qd=P("ZodTemplateLiteral",(e,t)=>{am.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Sp(e,n,r);});function R_(e,t){return new Qd({type:"template_literal",parts:e,...F.normalizeParams(t)})}var Vd=P("ZodLazy",(e,t)=>{di.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Vp(e,n,r,o),e.unwrap=()=>e._zod.def.getter();});function jd(e){return new Vd({type:"lazy",getter:e})}var qd=P("ZodPromise",(e,t)=>{um.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Qp(e,n,r,o),e.unwrap=()=>e._zod.def.innerType;});function M_(e){return new qd({type:"promise",innerType:e})}var Wd=P("ZodFunction",(e,t)=>{cm.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ap(e,n,r,o);});function I_(e){return new Wd({type:"function",input:Array.isArray(e?.input)?Sd(e?.input):e?.input??ki(er()),output:e?.output??er()})}var Ti=P("ZodCustom",(e,t)=>{lm.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Pp(e,n,r,o);});function L_(e){let t=new he({check:"custom"});return t._zod.check=e,t}function z_(e,t){return Km(Ti,e??(()=>true),t)}function Hd(e,t={}){return Jm(Ti,e,t)}function Yd(e,t){return ep(e,t)}var T_=tp,N_=np,Xd=P("ZodInstanceOf",(e,t)=>{Ti.init(e,t);},{properties(e,t){return this.check(Kr(e,t))}});function O_(e,t={}){let n=new Xd({type:"custom",check:"custom",fn:r=>r instanceof e,abort:true,...F.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]});},n}var F_=(...e)=>rp({Codec:zi,Boolean:mo,String:lo},...e);function D_(e){let t=jd(()=>ho([Ci(e),ad(),cd(),md(),ki(t),vd(Ci(),t)]));return t}function Z_(e,t){return new Bd({type:"pipe",in:fc(e),out:t})}var Pw={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Aw(e){Ee({customError:e});}function Ew(){return Ee().customError}var Kd;Kd||(Kd={});var Ni={};un(Ni,{ZodISODate:()=>$n,ZodISODateTime:()=>yn,ZodISODuration:()=>wn,ZodISOTime:()=>xn,date:()=>Rw,datetime:()=>kw,duration:()=>Iw,time:()=>Mw});function kw(e){return yi(yn,e)}function Rw(e){return $i($n,e)}function Mw(e){return xi(xn,e)}function Iw(e){return wi(wn,e)}var O={...go,...Za,iso:Ni},Lw=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function zw(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function B_(e,t){return e.map((n,r)=>r<t?n:n.optional())}function Tw(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Nw(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===r){let o=n[1]===void 0?void 0:Tw(n[1]);if(!o||!t.defs[o])throw new Error(`Reference not found: ${e}`);return t.defs[o]}throw new Error(`Reference not found: ${e}`)}function Ow(e,t){return O.transform(r=>r).check(r=>{let o=r.value;if(typeof o!="object"||o===null||Array.isArray(o))return;let i=Object.getOwnPropertyNames(o);if(t.minProperties!==void 0&&i.length<t.minProperties&&r.issues.push({origin:"object",code:"too_small",minimum:t.minProperties,inclusive:true,message:`Too small: expected object to have >=${t.minProperties} properties`,input:o,inst:e,continue:true}),t.maxProperties!==void 0&&i.length>t.maxProperties&&r.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:true,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:o,inst:e,continue:true}),t.keySchema)for(let s of i){let a=t.keySchema.safeParse(s);a.success||r.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:s,path:[s],continue:true});}}).pipe(e)}function Jd(e,t){if(e===null)return "z";let n=typeof e;if(n!=="object"){if(n==="number"&&Number.isNaN(e))return null;let r=String(e);return `${n[0]}${r.length}:${r}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let i=[];for(let s of e){let a=Jd(s,t);if(a===null)return null;i.push(a);}return `a${i.length}:[${i.join(",")}]`}let r=Object.keys(e).sort(),o=[];for(let i of r){let s=Jd(e[i],t);if(s===null)return null;o.push(`${i.length}:${i}=${s}`);}return `o${o.length}:{${o.join(",")}}`}finally{t.delete(e);}}var Fw=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),Dw=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function Oi(e){return typeof e!="object"||e===null?false:Array.isArray(e)?e.some(Oi):typeof e.$ref=="string"?true:Object.entries(e).some(([t,n])=>Fw.has(t)?Oi(n):!Dw.has(t)||typeof n!="object"||n===null?false:Object.values(n).some(Oi))}function G_(e){return e===1?"element":"elements"}function Zw(e,t){return O.transform(r=>r).check(r=>{let o=r.value;if(Array.isArray(o)){if(t.uniqueItems===true){let i=new Map;for(let s=0;s<o.length;s++){let a=Jd(o[s],new Set);if(a===null)continue;let c=i.get(a);if(c===void 0){i.set(a,s);continue}r.issues.push({code:"custom",message:`Array items must be unique: element at index ${s} duplicates the one at index ${c}`,input:o,path:[s],continue:true});}}if(t.containsSchema){let i=t.minContains??1,s=t.maxContains!==void 0?t.maxContains+1:Number.POSITIVE_INFINITY,a=0;for(let c of o)if(t.containsSchema.safeParse(c).success&&++a>=s)break;a<i&&r.issues.push({code:"custom",message:`Array must contain at least ${i} matching ${G_(i)}; found ${a}`,input:o,continue:true}),t.maxContains!==void 0&&a>t.maxContains&&r.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${G_(t.maxContains)}`,input:o,continue:true});}}}).pipe(e)}function U_(e,t){if(e!==false)return e===void 0||e===true?O.any():Je(e,t)}var Bw=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function Q_(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return O.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let o=e.$ref;if(t.refs.has(o))return t.refs.get(o);if(t.processing.has(o))return O.lazy(()=>{if(!t.refs.has(o))throw new Error(`Circular reference not resolved: ${o}`);return t.refs.get(o)});t.processing.add(o);let i=Nw(o,t),s=Je(i,t);return t.refs.set(o,s),t.processing.delete(o),s}if(e.enum!==void 0){let o=e.enum;if(t.version==="openapi-3.0"&&e.nullable===true&&o.length===1&&o[0]===null)return O.null();if(o.length===0)return O.never();if(o.length===1)return O.literal(o[0]);if(o.every(s=>typeof s=="string"))return O.enum(o);let i=o.map(s=>O.literal(s));return i.length<2?i[0]:O.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return O.literal(e.const);let n=e.type;if(Array.isArray(n)){let o=n.map(i=>{let s={...e,type:i};return Q_(s,t)});return o.length===0?O.never():o.length===1?o[0]:O.union(o)}if(!n)return O.any();let r;switch(n){case "string":{let o=O.string();if(e.format){let i=e.format;i==="email"?o=o.check(O.email()):i==="uri"||i==="uri-reference"?o=o.check(O.url()):i==="uuid"||i==="guid"?o=o.check(O.uuid()):i==="date-time"?o=o.check(O.iso.datetime({offset:true})):i==="date"?o=o.check(O.iso.date()):i==="time"?o=o.check(O.regex(Bw)):i==="duration"?o=o.check(O.iso.duration()):i==="hostname"?o=o.check(O.hostname()):i==="ipv4"?o=o.check(O.ipv4()):i==="ipv6"?o=o.check(O.ipv6()):i==="mac"?o=o.check(O.mac()):i==="cidr"?o=o.check(O.cidrv4()):i==="cidr-v6"?o=o.check(O.cidrv6()):i==="base64"?o=o.check(O.base64()):i==="base64url"?o=o.check(O.base64url()):i==="e164"?o=o.check(O.e164()):i==="credit_card"?o=o.check(O.creditCard()):i==="iban"?o=o.check(O.iban()):i==="jwt"?o=o.check(O.jwt()):i==="emoji"?o=o.check(O.emoji()):i==="nanoid"?o=o.check(O.nanoid()):i==="cuid"?o=o.check(O.cuid()):i==="cuid2"?o=o.check(O.cuid2()):i==="ulid"?o=o.check(O.ulid()):i==="xid"?o=o.check(O.xid()):i==="ksuid"&&(o=o.check(O.ksuid()));}typeof e.minLength=="number"&&(o=o.min(e.minLength)),typeof e.maxLength=="number"&&(o=o.max(e.maxLength)),e.pattern&&(o=o.regex(new RegExp(e.pattern))),r=o;break}case "number":case "integer":{let o=n==="integer"?O.number().int():O.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==true&&(o=o.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==true&&(o=o.max(e.maximum)),typeof e.exclusiveMinimum=="number"?o=o.gt(e.exclusiveMinimum):e.exclusiveMinimum===true&&typeof e.minimum=="number"&&(o=o.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?o=o.lt(e.exclusiveMaximum):e.exclusiveMaximum===true&&typeof e.maximum=="number"&&(o=o.lt(e.maximum)),typeof e.multipleOf=="number"&&(o=o.multipleOf(e.multipleOf)),r=o;break}case "boolean":{r=O.boolean();break}case "null":{r=O.null();break}case "object":{let o={},i=e.properties||{},s=new Set(e.required||[]),a=typeof e.additionalProperties=="object"?Je(e.additionalProperties,t):void 0;for(let[f,p]of Object.entries(i)){let m=Je(p,t);Qe(o,f,s.has(f)?m:m.optional());}if(e.patternProperties){let f=e.patternProperties,p=Object.keys(f),m=[];for(let d of p){let g=Je(f[d],t),_=O.string().regex(new RegExp(d));m.push(O.looseRecord(_,g));}let h=[];if(Object.keys(o).length>0&&h.push(O.object(o).passthrough()),h.push(...m),h.length===0)r=O.object({}).passthrough();else if(h.length===1)r=h[0];else {let d=O.intersection(h[0],h[1]);for(let g=2;g<h.length;g++)d=O.intersection(d,h[g]);r=d;}if(e.additionalProperties===false){let d=Object.keys(o),g=p.map(b=>new RegExp(b)),_=r;r=r.check(b=>{if(!$t(b.value))return;let y=[];for(let S of Object.keys(b.value))d.includes(S)||g.some(v=>v.test(S))||y.push(S);y.length&&b.issues.push({code:"unrecognized_keys",keys:y,input:b.value,inst:_});});}}else {let f=O.object(o);e.additionalProperties===false?r=f.strict():a?r=f.catchall(a):r=f.passthrough();}let c=e.propertyNames!==void 0&&e.propertyNames!==true,u=typeof e.minProperties=="number"?e.minProperties:void 0,l=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||u!==void 0||l!==void 0){let f;if(c){let p=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;f=Je(p,t);}r=Ow(r,{keySchema:f,minProperties:u,maxProperties:l});}break}case "array":{let o=e.prefixItems,i=e.items;if(o&&Array.isArray(o)){let s=typeof e.minItems=="number"?e.minItems:0,a=o.map(f=>Je(f,t)),c=B_(a,s),u=Array.isArray(i)?void 0:U_(i,t),l=O.tuple(c);r=u?l.rest(u):l,typeof e.minItems=="number"&&(r=r.check(O.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(O.maxLength(e.maxItems)));}else if(Array.isArray(i)){let s=typeof e.minItems=="number"?e.minItems:0,a=i.map(f=>Je(f,t)),c=B_(a,s),u=U_(e.additionalItems,t),l=O.tuple(c);r=u?l.rest(u):l,typeof e.minItems=="number"&&(r=r.check(O.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(O.maxLength(e.maxItems)));}else if(i!==void 0){let s=Je(i,t),a=O.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),r=a;}else r=O.array(O.any());(e.uniqueItems===true||e.contains!==void 0)&&(r=Zw(r,{uniqueItems:e.uniqueItems===true,containsSchema:e.contains!==void 0?Je(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${n}`)}return r}function Je(e,t){if(typeof e=="boolean")return e?O.any():O.never();let n=Q_(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(u=>Je(u,t)),c=O.union(a);n=r?O.intersection(n,c):c;}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(u=>Je(u,t)),c=O.xor(a);n=r?O.intersection(n,c):c;}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:O.any();else {let a=r?n:Je(e.allOf[0],t),c=r?0:1;for(let u=c;u<e.allOf.length;u++)a=O.intersection(a,Je(e.allOf[u],t));n=a;}e.nullable===true&&t.version==="openapi-3.0"&&(n=O.nullable(n)),e.readOnly===true&&(n=O.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let o={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of i)a in e&&(o[a]=e[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in e&&(o[a]=e[a]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!Oi(e.propertyNames)&&(o.propertyNames=e.propertyNames);for(let a of ["minProperties","maxProperties"])e[a]!==void 0&&(o[a]=e[a]);}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!Oi(e.contains)&&(o.contains=e.contains);for(let a of ["uniqueItems","minContains","maxContains"])e[a]!==void 0&&(o[a]=e[a]);}for(let a of Object.keys(e))Lw.has(a)||Qe(o,a,e[a]);return Object.keys(o).length>0&&t.registry.add(n,o),e.description&&(n=n.describe(e.description)),n}function V_(e,t){if(typeof e=="boolean")return e?O.any():O.never();let n;try{n=JSON.parse(JSON.stringify(e));}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let r=zw(n,t?.defaultTarget),o=n.$defs||n.definitions||{},i={version:r,defs:o,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??Ve};return Je(n,i)}var j_=Symbol("z.visit/resolving");function Fi(e,t){let n=typeof t=="function"?t:(s,a)=>{let c=t[s._zod.def.type];return c?c(s,a):s},r=new Map;function o(s){let a=r.get(s);if(a===j_)return new di({type:"lazy",getter:()=>r.get(s)});if(a!==void 0)return a;r.set(s,j_);let c=i(s),u=n(c,c!==s);return r.set(s,u),u}function i(s){let a=s._zod.def,c=a.type;switch(c){case "object":{let u=a.shape,l=Object.keys(u),f=false,p={};for(let h of l){let d=o(u[h]);d!==u[h]&&(f=true),p[h]=d;}let m=a.catchall;return a.catchall&&(m=o(a.catchall),m!==a.catchall&&(f=true)),f?ce(s,{...a,shape:p,catchall:m}):s}case "array":{let u=o(a.element);return u===a.element?s:ce(s,{...a,element:u})}case "tuple":{let u=a.items,l=false,f=[];for(let m of u){let h=o(m);h!==m&&(l=true),f.push(h);}let p=a.rest;return a.rest&&(p=o(a.rest),p!==a.rest&&(l=true)),l?ce(s,{...a,items:f,rest:p}):s}case "record":case "map":{let u=o(a.keyType),l=o(a.valueType);return u===a.keyType&&l===a.valueType?s:ce(s,{...a,keyType:u,valueType:l})}case "set":{let u=o(a.valueType);return u===a.valueType?s:ce(s,{...a,valueType:u})}case "union":{let u=a.options,l=false,f=[];for(let p of u){let m=o(p);m!==p&&(l=true),f.push(m);}return l?ce(s,{...a,options:f}):s}case "intersection":{let u=o(a.left),l=o(a.right);return u===a.left&&l===a.right?s:ce(s,{...a,left:u,right:l})}case "optional":case "nullable":case "default":case "prefault":case "catch":case "readonly":case "nonoptional":case "promise":case "success":{let u=o(a.innerType);return u===a.innerType?s:ce(s,{...a,innerType:u})}case "pipe":{let u=o(a.in),l=o(a.out);return u===a.in&&l===a.out?s:ce(s,{...a,in:u,out:l})}case "function":{let u=o(a.input),l=o(a.output);return u===a.input&&l===a.output?s:ce(s,{...a,input:u,output:l})}case "lazy":{let u=a.getter,{_cachedInner:l,...f}=a;return ce(s,{...f,getter:()=>o(u())})}case "template_literal":case "string":case "number":case "int":case "boolean":case "bigint":case "symbol":case "undefined":case "null":case "void":case "never":case "any":case "unknown":case "date":case "nan":case "enum":case "literal":case "file":case "transform":case "custom":return s;default:return s}}return o(e)}function q_(e){return Fi(e,{object:t=>t.partial(),union:t=>{let n=t._zod.def;return n.discriminator===void 0?t:ho(n.options)}})}function Gw(e,t){if(!t?.length)return e;let n=e._zod.def;return ce(e,Ct(n,{checks:[...n.checks??[],...t]}),{parent:true})}function W_(e){return Gw(e.out,e.checks)}function Uw(e){return e.in._zod.traits.has("$ZodTransform")?W_(e):e.in}function H_(e){return Fi(e,{pipe:t=>Uw(t._zod.def),default:(t,n)=>n?tr(t._zod.def.innerType):t,catch:(t,n)=>n?t._zod.def.innerType:t})}function Y_(e){return Fi(e,{pipe:t=>W_(t._zod.def),prefault:(t,n)=>n?t._zod.def.innerType:t})}var eh={};un(eh,{bigint:()=>qw,boolean:()=>jw,date:()=>Ww,number:()=>Vw,string:()=>Qw});function Qw(e){return wm(lo,e)}function Vw(e){return Em(fo,e)}function jw(e){return Tm(mo,e)}function qw(e){return Om(po,e)}function Ww(e){return Wm(Ei,e)}var Zi=["logo","halftone"],K_=E.enum(Zi),Di={logo:["blend","badge"],halftone:["color","mono"]},J_=E.enum([...Di.logo,...Di.halftone]),Jt=192,X_=e=>Math.ceil(e/3)*4,eb=E.object({width:E.number().int().min(1).max(Jt),height:E.number().int().min(1).max(Jt),data:E.string().max(X_(Jt*Jt*4))}).refine(e=>e.data.length===X_(e.width*e.height*4),{message:"Art image data does not match its width and height"}),th=E.object({mode:K_,image:eb,intensity:E.number().min(0).max(1).optional(),variant:J_.optional(),matchEyes:E.boolean().optional()});var Hw=E.enum(["solid","linear","radial","angular","image"]),tb=E.object({type:E.literal("solid"),color:E.string()}),dc=E.object({color:E.string(),offset:E.number().min(0).max(100)}),nb=E.object({type:E.literal("linear"),stops:E.array(dc).min(2),angle:E.number().optional().default(0)}),rb=E.object({type:E.literal("radial"),stops:E.array(dc).min(2)}),ob=E.object({type:E.literal("angular"),stops:E.array(dc).min(2),angle:E.number().optional().default(0)}),ib=E.enum(["cover","contain","tile"]),sb=E.enum(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]),ab=E.object({type:E.literal("image"),src:E.string().min(1),fit:ib.optional().default("cover"),scale:E.number().min(.1).max(4).optional().default(1),position:sb.optional().default("center"),opacity:E.number().min(0).max(1).optional().default(1),underlay:E.string().optional()}),Sn=E.union([E.string(),tb,nb,rb,ob,ab]);function St(e,t="#000000"){return e?typeof e=="string"?{type:"solid",color:e}:e:{type:"solid",color:t}}function _o(e){return !e||typeof e=="string"?false:e.type==="linear"||e.type==="radial"||e.type==="angular"}function nh(e){return typeof e=="object"&&e!==null&&e.type==="image"}function Yw(e,t="#000000"){let n=St(e,t);return n.type==="solid"?n.color:n.type==="image"?n.underlay||t:n.stops[0]?.color||t}function cb(e="center"){let[t,n]=e.split("-");return e==="center"?"center":n?`${n} ${t}`:t==="top"||t==="bottom"?`center ${t}`:`${t} center`}function Xw(e){if(!e)return "#000000";if(typeof e=="string")return e;let t=St(e);if(t.type==="solid")return t.color;if(t.type==="image"){let o=t.fit==="tile"?`${25*(t.scale??1)}% auto`:(t.scale??1)===1?t.fit==="contain"?"contain":"cover":`${100*(t.scale??1)}% auto`,i=t.fit==="tile"?"repeat":"no-repeat";return `${`url("${t.src.replace(/"/g,"%22")}")`} ${cb(t.position)} / ${o} ${i}, ${t.underlay??"transparent"}`}let r=[...t.stops].sort((o,i)=>o.offset-i.offset).map(o=>`${o.color} ${o.offset}%`).join(", ");return t.type==="linear"?`linear-gradient(${(t.angle??0)+90}deg, ${r})`:t.type==="angular"?`conic-gradient(from ${t.angle??0}deg, ${r})`:`radial-gradient(circle, ${r})`}var Kw=E.object({x:E.number(),y:E.number(),w:E.number(),h:E.number()});var rh=["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"],ub=["diamond","star","banner"],oh=E.enum([...rh,...ub]),Jw=E.enum(rh);var ih=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],lb=["curly"],sh=E.enum([...ih,...lb]),e3=E.enum(ih);var fb=["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"],Dt=24,ah="Scan me",bo=.5,vn=1.5,mb=E.enum(fb),hc=E.object({style:mb,text:E.string().max(Dt).optional(),color:E.string().optional(),textColor:E.string().optional(),secondaryText:E.string().max(Dt).optional(),secondaryColor:E.string().optional(),fontScale:E.number().min(bo).max(vn).optional()});function ye(e,t=3){let n=10**t;return Math.round(e*n)/n+0}function x(e,t=3){return String(ye(e,t))}function M(e,...t){let n=e[0]??"";for(let r=0;r<t.length;r++){let o=t[r];n+=(typeof o=="number"?x(o):o)+(e[r+1]??"");}return n}var t3={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},n3=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,ch=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function gc(e,t=Number.POSITIVE_INFINITY){if(!n3.test(e))return null;let n=[],r=0,o=()=>{for(;r<e.length&&/[\s,]/.test(e[r]);)r++;},i=()=>{o(),ch.lastIndex=r;let c=ch.exec(e);if(!c)return null;let u=c[0],l=u.indexOf(".");if(l>=0&&u.length-l-1>t)return null;r=ch.lastIndex;let f=Number(u);return Number.isFinite(f)?f:null},s=()=>{o();let c=e[r];return c==="0"||c==="1"?(r++,c==="1"?1:0):null},a=()=>(o(),r<e.length&&/[0-9.+-]/.test(e[r]));for(o();r<e.length;){let c=e[r],u=c.toUpperCase(),l=t3[u];if(l===void 0||n.length===0&&u!=="M")return null;if(r++,l===0){n.push({command:c,values:[]}),o();continue}let f=c,p=true;for(;p||a();){let m=[];for(let h=0;h<l;h++){let d=u==="A"&&(h===3||h===4)?s():i();if(d===null)return null;m.push(d);}n.push({command:f,values:m}),u==="M"&&(f=c==="M"?"L":"l"),p=false;}o();}return n}function pb(e){let t=0;for(let{command:n}of e)t+=n.toUpperCase()==="A"?4:1;return t}function db(e,t=1,n=0,r=0){let o="";for(let{command:i,values:s}of e){let a=i.toUpperCase(),c=i===a,u=c?n:0,l=c?r:0,f;switch(a){case "Z":f=[];break;case "H":f=[x(s[0]*t+u)];break;case "V":f=[x(s[0]*t+l)];break;case "A":f=[x(Math.abs(s[0])*t),x(Math.abs(s[1])*t),x(s[2]),String(s[3]),String(s[4]),x(s[5]*t+u),x(s[6]*t+l)];break;default:f=s.map((p,m)=>x(p*t+(m%2===0?u:l)));}o+=i+f.join(" ");}return o}function _c(e,t=.25){let n=[],r=[],o=[0,0],i=[0,0],s=()=>{r.length>2&&n.push(r),r=[];};for(let a of e)if(a.op==="M")s(),o=[a.x,a.y],i=o,r.push(o);else if(a.op==="L")i=[a.x,a.y],r.push(i);else if(a.op==="C"){let c=i,u=[a.x1,a.y1],l=[a.x2,a.y2],f=[a.x,a.y],p=Math.hypot(u[0]-c[0],u[1]-c[1])+Math.hypot(l[0]-u[0],l[1]-u[1])+Math.hypot(f[0]-l[0],f[1]-l[1]),m=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(p/(4*t)))));for(let h=1;h<=m;h++){let d=h/m,g=1-d;r.push([g*g*g*c[0]+3*g*g*d*u[0]+3*g*d*d*l[0]+d*d*d*f[0],g*g*g*c[1]+3*g*g*d*u[1]+3*g*d*d*l[1]+d*d*d*f[1]]);}i=f;}else s(),i=o;return s(),n}function bc(e,t){let n=[o=>o[0]-t.x0,o=>t.x1-o[0],o=>o[1]-t.y0,o=>t.y1-o[1]],r=e;for(let o of n){if(r.length===0)break;let i=r;r=[];for(let s=0;s<i.length;s++){let a=i[s],c=i[(s+i.length-1)%i.length],u=o(a),l=o(c);u>=0?(l<0&&r.push(hb(c,a,l,u)),r.push(a)):l>=0&&r.push(hb(c,a,l,u));}}return r.length>2?r:[]}function hb(e,t,n,r){let o=n/(n-r);return [e[0]+(t[0]-e[0])*o,e[1]+(t[1]-e[1])*o]}function gb(e){return e.filter(t=>t.length>2).map(t=>`M${t.map(([n,r])=>`${x(n)} ${x(r)}`).join("L")}Z`).join("")}function ir(e){let t=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=(s,a)=>{t=Math.min(t,s),n=Math.min(n,a),r=Math.max(r,s),o=Math.max(o,a);};for(let s of e)s.op==="C"?(i(s.x1,s.y1),i(s.x2,s.y2),i(s.x,s.y)):s.op!=="Z"&&i(s.x,s.y);return Number.isFinite(t)?{x0:t,y0:n,x1:r,y1:o}:null}var r3={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function yb(e){return e.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(t,n)=>{if(n[0]==="#"){let r=n[1].toLowerCase()==="x"?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return Number.isInteger(r)&&r>0&&r<=1114111&&!(r>=55296&&r<=57343)?String.fromCodePoint(r):t}return r3[n.toLowerCase()]??t})}var o3=60,uh=62,lh=47,i3=61,_b=34,bb=39,mh=/\s*/y,s3=/[^\s/>]*/y,a3=/[^\s>]*/y,c3=/[^\s=]*/y;function yo(e,t,n){return e.lastIndex=n,e.test(t)?e.lastIndex:n}function u3(e,t){let n=e.length,r=$=>{let w=Number.POSITIVE_INFINITY,A=-1;return C=>((C<w||A>=0&&A<C)&&(w=C,A=e.indexOf($,C)),A)},o=r("-->"),i=r("?>"),s=r("]]>"),a=r(">"),c,u=$=>{let w=e.charCodeAt($);if(w!==_b&&w!==bb)return $+1;let A=e.indexOf(e[$],$+1);return A<0?n:A+1},l=$=>{for(let w=$;w<n&&!c?.[w];w=u(w)){let A=e.charCodeAt(w);if(A===uh||A===lh&&e.charCodeAt(w+1)===uh)return w}c??=new Uint8Array(n);for(let w=$;w<n&&!c[w];w=u(w))c[w]=1;return -1},f=-1,p=-1,m=-1,h=-1,d=$=>{let w=$+1;if(w<f||w>=p){f=w,p=yo(s3,e,w),m=-1;for(let C=p;C>w;C--){let R=e.charCodeAt(C);if((C===p||R===_b||R===bb)&&(h=l(C),h>=0)){m=C;break}}}if(m<=w)return -1;let A=e.charCodeAt(h)===lh;return t.open(e.slice(w,m),e.slice(m,h),A),h+(A?2:1)},g=-1,_=-1,b=-1,y=$=>{let w=$+2;if(w<g||w>=_){g=w,_=yo(a3,e,w);let A=yo(mh,e,_);b=_>w&&e.charCodeAt(A)===uh?A:-1;}return b},S=$=>{if(e.startsWith("<!--",$)){let w=o($+4);if(w>=0)return w+3}if(e.startsWith("<?",$)){let w=i($+2);if(w>=0)return w+2}if(e.startsWith("<![CDATA[",$)){let w=s($+9);if(w>=0)return t.cdata(e.slice($+9,w)),w+3}if(e.startsWith("<!",$)){let w=a($+2);if(w>=0)return w+1}if(e.charCodeAt($+1)===lh){let w=y($);return w<0?-1:(t.close(),w+1)}return d($)},v=0;for(;v<n;)if(e.charCodeAt(v)===o3){let $=S(v);v=$<0?v+1:$;}else {let $=e.indexOf("<",v),w=$<0?n:$;t.text(e.slice(v,w)),v=w;}}function l3(e){let t={},n=0;for(;n<e.length;){let r=yo(c3,e,n);if(r===n){n++;continue}let o=yo(mh,e,r);if(e.charCodeAt(o)===i3){let i=yo(mh,e,o+1),s=e[i],a=s==='"'||s==="'"?e.indexOf(s,i+1):-1;if(a>=0){t[e.slice(n,r)]=yb(e.slice(i+1,a)),n=a+1;continue}}n=r;}return t}function Cn(e){let t={name:"#root",attrs:{},children:[],text:""},n=[t],r=()=>n.at(-1);u3(e,{open(i,s,a){let c=l3(s),u={name:i,attrs:c,children:[],text:""};r().children.push(u),a||n.push(u);},close(){n.length>1&&n.pop();},text(i){r().text+=yb(i);},cdata(i){r().text+=i;}});let o=i=>{for(let s of i.children){if(s.name==="svg")return s;let a=o(s);if(a)return a}return null};return o(t)}var yc=[1,0,0,1,0,0];function ke(e,t){let[n,r,o,i,s,a]=e,[c,u,l,f,p,m]=t;return [n*c+o*u,r*c+i*u,n*l+o*f,r*l+i*f,n*p+o*m+s,r*p+i*m+a]}function re(e,t,n){return [e[0]*t+e[2]*n+e[4],e[1]*t+e[3]*n+e[5]]}function $o(e){return Math.sqrt(Math.abs(e[0]*e[3]-e[1]*e[2]))}function sr(e){return e?(e.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function Zt(e){let t=yc;if(!e)return t;for(let[,n,r]of e.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let o=sr(r),i=yc;switch(n){case "matrix":o.length===6&&(i=o);break;case "translate":i=[1,0,0,1,o[0]??0,o[1]??0];break;case "scale":i=[o[0]??1,0,0,o[1]??o[0]??1,0,0];break;case "rotate":{let s=(o[0]??0)*Math.PI/180,a=Math.cos(s),c=Math.sin(s),[u,l]=[o[1]??0,o[2]??0];i=ke(ke([1,0,0,1,u,l],[a,c,-c,a,0,0]),[1,0,0,1,-u,-l]);break}case "skewX":i=[1,0,Math.tan((o[0]??0)*Math.PI/180),1,0,0];break;case "skewY":i=[1,Math.tan((o[0]??0)*Math.PI/180),0,1,0,0];break;}t=ke(t,i);}return t}var fh=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function f3(e,t,n,r,o,i,s,a,c){if(e===a&&t===c)return [];let u=Math.abs(n),l=Math.abs(r);if(u===0||l===0)return [{op:"L",x:a,y:c}];let f=o*Math.PI/180,p=Math.cos(f),m=Math.sin(f),h=(e-a)/2,d=(t-c)/2,g=p*h+m*d,_=-m*h+p*d,b=g*g/(u*u)+_*_/(l*l);b>1&&(u*=Math.sqrt(b),l*=Math.sqrt(b));let y=u*u*l*l-u*u*_*_-l*l*g*g,S=u*u*_*_+l*l*g*g,v=(i===s?-1:1)*Math.sqrt(Math.max(0,y/S)),$=v*u*_/l,w=-v*l*g/u,A=p*$-m*w+(e+a)/2,C=m*$+p*w+(t+c)/2,R=(te,Q,X,me)=>Math.atan2(te*me-Q*X,te*X+Q*me),I=R(1,0,(g-$)/u,(_-w)/l),L=R((g-$)/u,(_-w)/l,(-g-$)/u,(-_-w)/l);!s&&L>0?L-=2*Math.PI:s&&L<0&&(L+=2*Math.PI);let z=Math.max(1,Math.ceil(Math.abs(L)/(Math.PI/2)-1e-9)),D=L/z,B=4/3*Math.tan(D/4),N=(te,Q)=>[A+u*p*te-l*m*Q,C+u*m*te+l*p*Q],j=[];for(let te=0;te<z;te++){let Q=I+te*D,X=Q+D,[me,ze]=N(Math.cos(Q)-B*Math.sin(Q),Math.sin(Q)+B*Math.cos(Q)),[$e,Z]=N(Math.cos(X)+B*Math.sin(X),Math.sin(X)-B*Math.cos(X)),[K,J]=te===z-1?[a,c]:N(Math.cos(X),Math.sin(X));j.push({op:"C",x1:me,y1:ze,x2:$e,y2:Z,x:K,y:J});}return j}function en(e){let t=[],n=0,r=0,o=0,i=0,s=0,a="",c=null,u=null,l=()=>{for(;n<e.length&&/[\s,]/.test(e[n]);)n++;},f=()=>{l(),fh.lastIndex=n;let h=fh.exec(e);return h?(n=fh.lastIndex,Number(h[0])):null},p=()=>{l();let h=e[n];return h==="0"||h==="1"?(n++,h==="1"):null},m=h=>{let d=[];for(let g=0;g<h;g++){let _=f();if(_===null)return null;d.push(_);}return d};for(;l(),!(n>=e.length);){let h=e[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(h))a=h,n++;else if(!a||a==="Z"||a==="z")break;let d=a===a.toLowerCase(),g=d?r:0,_=d?o:0,b=a.toUpperCase();if(b==="Z"){t.push({op:"Z"}),r=i,o=s,c=null,u=null;continue}if(b==="A"){let $=m(3),w=p(),A=p(),C=m(2);if(!($&&C)||w===null||A===null)break;let[R,I,L]=$,z=C[0]+g,D=C[1]+_;t.push(...f3(r,o,R,I,L,w,A,z,D)),r=z,o=D,c=null,u=null;continue}let y={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[b]??0,S=m(y);if(!S)break;let v=S;switch(b){case "M":r=v[0]+g,o=v[1]+_,i=r,s=o,t.push({op:"M",x:r,y:o}),a=d?"l":"L",c=null,u=null;break;case "L":case "H":case "V":b!=="V"&&(r=v[0]+g),b==="V"?o=v[0]+_:b==="L"&&(o=v[1]+_),t.push({op:"L",x:r,y:o}),c=null,u=null;break;case "C":case "S":{let $,w;b==="C"?($=[v[0]+g,v[1]+_],w=v.slice(2)):($=c?[2*r-c[0],2*o-c[1]]:[r,o],w=v);let A=[w[0]+g,w[1]+_],C=[w[2]+g,w[3]+_];t.push({op:"C",x1:$[0],y1:$[1],x2:A[0],y2:A[1],x:C[0],y:C[1]}),[r,o]=C,c=A,u=null;break}case "Q":case "T":{let $,w;b==="Q"?($=[v[0]+g,v[1]+_],w=[v[2]+g,v[3]+_]):($=u?[2*r-u[0],2*o-u[1]]:[r,o],w=[v[0]+g,v[1]+_]),t.push({op:"C",x1:r+2/3*($[0]-r),y1:o+2/3*($[1]-o),x2:w[0]+2/3*($[0]-w[0]),y2:w[1]+2/3*($[1]-w[1]),x:w[0],y:w[1]}),[r,o]=w,u=$,c=null;break}}}return t}var $c=.5522847498;function Bt(e,t,n,r){if(n<=0||r<=0)return [];let o=n*$c,i=r*$c;return [{op:"M",x:e+n,y:t},{op:"C",x1:e+n,y1:t+i,x2:e+o,y2:t+r,x:e,y:t+r},{op:"C",x1:e-o,y1:t+r,x2:e-n,y2:t+i,x:e-n,y:t},{op:"C",x1:e-n,y1:t-i,x2:e-o,y2:t-r,x:e,y:t-r},{op:"C",x1:e+o,y1:t-r,x2:e+n,y2:t-i,x:e+n,y:t},{op:"Z"}]}function Gt(e,t,n,r,o=0,i=0){if(n<=0||r<=0)return [];let s=Math.min(Math.max(o,0),n/2),a=Math.min(Math.max(i,0),r/2);if(s===0||a===0)return [{op:"M",x:e,y:t},{op:"L",x:e+n,y:t},{op:"L",x:e+n,y:t+r},{op:"L",x:e,y:t+r},{op:"Z"}];let c=s*$c,u=a*$c,l=e+n,f=t+r;return [{op:"M",x:e+s,y:t},{op:"L",x:l-s,y:t},{op:"C",x1:l-s+c,y1:t,x2:l,y2:t+a-u,x:l,y:t+a},{op:"L",x:l,y:f-a},{op:"C",x1:l,y1:f-a+u,x2:l-s+c,y2:f,x:l-s,y:f},{op:"L",x:e+s,y:f},{op:"C",x1:e+s-c,y1:f,x2:e,y2:f-a+u,x:e,y:f-a},{op:"L",x:e,y:t+a},{op:"C",x1:e,y1:t+a-u,x2:e+s-c,y2:t,x:e+s,y:t},{op:"Z"}]}var Sc="qrdx.frame",vc=1,Bi="custom",xe={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:Dt},xb=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],Cc=.95,wb=200,Sb=["frame","text","accent","background"],m3=/[\t\n\v\f\r\u0085\u2028\u2029]/g,p3=/[\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 Pc(e,t=Dt){let n=e.slice(0,1e3).normalize("NFC").replace(m3," ").replace(p3,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,t)).join("").trim()}function d3(e){for(let t of e)if((t.codePointAt(0)??0)>255)return false;return true}var hh=e=>Math.abs(e*1e3-Math.round(e*1e3))<1e-6,Ie=E.number().min(-xe.maxCoordinate).max(xe.maxCoordinate).refine(hh,{message:`Numbers may have at most ${xe.maxDecimals} decimals`}),ft=Ie.refine(e=>e>0,{message:"Must be greater than 0"}),wc=Ie.refine(e=>e>=0,{message:"Must not be negative"}),xc=E.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color"),ph=E.union([E.enum(Sb),xc]),xo=E.union([ph,E.object({mix:E.tuple([ph,ph]),amount:E.number().min(0).max(1).refine(hh)}).strict()]),Pn=E.union([xo,E.object({gradient:E.object({from:xo,to:xo,direction:E.enum(["horizontal","vertical"]).optional(),steps:E.int().min(2).max(xe.maxGradientSteps).optional()}).strict()}).strict()]),dh={x:Ie,y:Ie,width:ft,height:ft},h3=E.object({type:E.literal("rect"),...dh,radius:wc.optional(),fill:Pn,hole:E.object({...dh,radius:wc.optional()}).strict().optional()}).strict(),g3=E.object({type:E.literal("circle"),cx:Ie,cy:Ie,r:ft,hole:ft.optional(),fill:Pn}).strict(),_3=E.object({type:E.literal("ellipse"),cx:Ie,cy:Ie,rx:ft,ry:ft,fill:Pn}).strict(),b3=E.object({type:E.literal("polygon"),points:E.array(E.tuple([Ie,Ie])).min(3).max(xe.maxPolygonPoints),fill:Pn}).strict(),y3=E.object({type:E.literal("path"),d:E.string().min(2).max(xe.maxPathLength),fill:Pn,fillRule:E.enum(["nonzero","evenodd"]).optional()}).strict(),$3=E.object({type:E.literal("line"),x1:Ie,y1:Ie,x2:Ie,y2:Ie,width:ft,cap:E.enum(["butt","round"]).optional(),dash:E.tuple([ft,ft]).optional(),fill:Pn}).strict(),x3=E.object({type:E.literal("icon"),icon:E.enum(xb),x:Ie,y:Ie,size:ft,fill:Pn}).strict(),vb=E.discriminatedUnion("type",[h3,g3,_3,b3,y3,$3,x3]),Cb={id:E.string().regex(/^[a-z][a-z0-9-]{0,31}$/),slot:E.enum(["primary","secondary","fixed"]),text:E.string().max(200),maxLength:E.int().min(1).max(Dt).optional(),color:xo,weight:E.enum(["bold","regular"]).optional()},w3=E.object({type:E.literal("text"),...Cb,box:E.object(dh).strict(),align:E.enum(["start","middle","end"]).optional(),fontSize:ft.optional()}).strict(),S3=E.object({type:E.literal("curved"),...Cb,curve:E.object({cx:Ie,cy:Ie,radius:ft,side:E.enum(["top","bottom"]),spread:E.number().min(20).max(300).refine(hh).optional()}).strict(),fontSize:ft}).strict(),Pb=E.discriminatedUnion("type",[w3,S3]),$b=Ie.refine(e=>e>=xe.minArtboard&&e<=xe.maxArtboard,{message:`Artboard sides must be ${xe.minArtboard} to ${xe.maxArtboard} units`}),v3=E.object({kind:E.literal(Sc),version:E.literal(vc),artboard:E.object({width:$b,height:$b}).strict(),qr:E.object({x:Ie,y:Ie,size:ft,padding:wc.optional(),radius:wc.optional()}).strict(),colors:E.object({frame:xc,text:xc.optional(),accent:xc.optional()}).strict(),shapes:E.array(vb).max(xe.maxShapes),labels:E.array(Pb).max(xe.maxLabels),bleed:E.union([E.literal("none"),xo]).optional()}).strict();function Ab(e){let t=wo(e);return {x0:e.qr.x-t,y0:e.qr.y-t,x1:e.qr.x+e.qr.size+t,y1:e.qr.y+e.qr.size+t}}function wo(e){return e.qr.padding??e.qr.size*xe.defaultPadding}var C3=(e,t)=>Math.min(e.x1,t.x1)-Math.max(e.x0,t.x0)>1e-6&&Math.min(e.y1,t.y1)-Math.max(e.y0,t.y0)>1e-6;function P3(e){switch(e.type){case "rect":return {bounds:{x0:e.x,y0:e.y,x1:e.x+e.width,y1:e.y+e.height},segments:e.hole?18:9};case "circle":return {bounds:{x0:e.cx-e.r,y0:e.cy-e.r,x1:e.cx+e.r,y1:e.cy+e.r},segments:e.hole?10:5};case "ellipse":return {bounds:{x0:e.cx-e.rx,y0:e.cy-e.ry,x1:e.cx+e.rx,y1:e.cy+e.ry},segments:5};case "polygon":{let t=e.points.map(([r])=>r),n=e.points.map(([,r])=>r);return {bounds:{x0:Math.min(...t),y0:Math.min(...n),x1:Math.max(...t),y1:Math.max(...n)},segments:e.points.length}}case "path":{let t=gc(e.d,xe.maxDecimals);return t?{bounds:ir(en(e.d)),segments:pb(t)}:{bounds:null,segments:0}}case "line":{let t=e.width/2,n=Math.hypot(e.x2-e.x1,e.y2-e.y1),r=e.dash?Math.ceil(n/(e.dash[0]+e.dash[1])):1;return {bounds:{x0:Math.min(e.x1,e.x2)-t,y0:Math.min(e.y1,e.y2)-t,x1:Math.max(e.x1,e.x2)+t,y1:Math.max(e.y1,e.y2)+t},segments:r*(e.cap==="round"?4:5)}}default:return {bounds:{x0:e.x,y0:e.y,x1:e.x+e.size,y1:e.y+e.size},segments:wb}}}function A3(e,t){let n=(_,b=[])=>t.addIssue({code:"custom",message:_,path:b}),r=xe,o=new TextEncoder().encode(JSON.stringify(e)).length;if(o>r.maxBytes){n(`The spec is ${o} bytes; the limit is ${r.maxBytes}`);return}let{width:i,height:s}=e.artboard,a=Math.max(i,s)*.005,c={x0:-a,y0:-a,x1:i+a,y1:s+a},u=_=>_.x0>=c.x0&&_.y0>=c.y0&&_.x1<=c.x1&&_.y1<=c.y1,{qr:l}=e,f=wo(e);f<l.size*r.minPadding-1e-9&&n(`qr.padding must be at least ${r.minPadding*100}% of qr.size`,["qr","padding"]),l.size<Math.min(i,s)*r.minQrShare-1e-9&&n(`qr.size must be at least ${r.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let p=Ab(e);(p.x0<-1e-9||p.y0<-1e-9||p.x1>i+1e-9||p.y1>s+1e-9)&&n("The code and its padding must sit inside the artboard",["qr"]),(l.radius??0)>(l.size+2*f)/2&&n("qr.radius is larger than half the plate",["qr","radius"]);let m=0,h=0;e.shapes.forEach((_,b)=>{let y=["shapes",b],{bounds:S,segments:v}=P3(_);if(!S){n("Path data must use only M L H V C S Q T A Z, plain numbers (up to 3 decimals) and start with M",[...y,"d"]);return}if(u(S)||n("The shape extends outside the artboard",y),_.type==="rect"&&_.hole){let{hole:$}=_;($.x<_.x||$.y<_.y||$.x+$.width>_.x+_.width+1e-9||$.y+$.height>_.y+_.height+1e-9)&&n("The hole must sit inside its rect",[...y,"hole"]);}_.type==="circle"&&_.hole&&_.hole>=_.r&&n("The hole must be smaller than the circle",[...y,"hole"]),m+=v,typeof _.fill=="object"&&"gradient"in _.fill&&(h+=(_.fill.gradient.steps??32)*v);}),m>r.maxSegments&&n(`The shapes have ${m} segments; the limit is ${r.maxSegments}`,["shapes"]),h>r.maxGradientWork&&n("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let d=new Set,g=new Set;e.labels.forEach((_,b)=>{let y=["labels",b];d.has(_.id)&&n(`Label id "${_.id}" is used twice`,[...y,"id"]),d.add(_.id),_.slot!=="fixed"&&(g.has(_.slot)&&n(`Only one label may use the ${_.slot} slot`,[...y,"slot"]),g.add(_.slot));let S=_.maxLength??r.maxTextLength;_.text!==Pc(_.text,S)&&n(`Label text must be at most ${S} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...y,"text"]);let v;if(_.type==="text")v={x0:_.box.x,y0:_.box.y,x1:_.box.x+_.box.width,y1:_.box.y+_.box.height},_.fontSize!==void 0&&_.fontSize>_.box.height*Cc+1e-9&&n("fontSize may be at most 95% of the label's row height",[...y,"fontSize"]),C3(v,p)&&n("The label overlaps the code or its padding",[...y,"box"]);else {let{cx:$,cy:w,radius:A}=_.curve,C=_.fontSize*vn*.6;v={x0:$-A-C,y0:w-A-C,x1:$+A+C,y1:w+A+C};let R=Math.hypot(Math.max(p.x0-$,0,$-p.x1),Math.max(p.y0-w,0,w-p.y1));Math.hypot(Math.max(Math.abs(p.x0-$),Math.abs(p.x1-$)),Math.max(Math.abs(p.y0-w),Math.abs(p.y1-w)))<=A-C||R>=A+C||n("The curved label crosses the code or its padding",[...y,"curve"]);}u(v)||n("The label extends outside the artboard",y);});}var ar=v3.superRefine(A3);function E3(e){let t=ar.safeParse(e);return t.success?[]:t.error.issues.map(n=>n.path.length>0?`${n.path.join(".")}: ${n.message}`:n.message)}var Eb=hc.extend({style:E.literal(Bi),spec:ar}),gh=E.discriminatedUnion("style",[hc,Eb]);var kb=["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"],_h=E.enum(kb);var Rb=["square","rounded","circle"],bh=E.enum(Rb),Mb=E.object({src:E.string(),height:E.number(),width:E.number(),excavate:E.boolean(),x:E.number().optional(),y:E.number().optional(),padding:E.number().min(0).optional(),shape:bh.optional(),plate:E.string().optional()}),Ib=.1,Ec=.3,yh=.25,Lb=2,k3=E.object({size:E.number().min(Ib).max(Ec).optional(),padding:E.number().min(0).max(Lb).optional(),x:E.number().min(0).max(1).optional(),y:E.number().min(0).max(1).optional(),shape:bh.optional(),plate:E.string().optional()}),zb=E.enum(["L","M","Q","H"]),Gi=.5,kc=1,$h=.07,Tb=["square","circle","heart"],Nb=E.enum(Tb),xh=3,Et=64,Ut=8,wh=.42,Ob=E.object({type:E.literal("silhouette"),width:E.number().int().min(Ut).max(Et),height:E.number().int().min(Ut).max(Et),cells:E.string().max(Et*Et).regex(/^[01]*$/).describe('Row by row, "1" inside the shape and "0" outside: width \xD7 height characters')}).refine(e=>e.cells.length===e.width*e.height,{message:"Silhouette cells do not match its width and height"}),Fb=E.union([Nb,Ob]),Rc=["topLeft","topRight","bottomLeft"],Ac=E.object({outer:Sn.optional(),inner:Sn.optional()}),Db=E.object({topLeft:Ac.optional(),topRight:Ac.optional(),bottomLeft:Ac.optional()}),R3=E.object({value:E.string(),size:E.number().optional(),level:zb.optional(),bgColor:Sn.optional(),fgColor:Sn.optional(),eyeColor:Sn.optional(),dotColor:Sn.optional(),bodyPattern:_h.optional(),cornerEyePattern:sh.optional(),cornerEyeDotPattern:oh.optional(),margin:E.number().optional(),imageSettings:Mb.optional(),isOGContext:E.boolean().optional(),templateId:E.string().optional(),customProps:E.record(E.string(),E.any()).optional(),frame:gh.optional(),art:th.optional(),eyeColors:Db.optional(),moduleScale:E.number().min(Gi).max(kc).optional(),autoLevel:E.boolean().optional(),shape:Fb.optional()});var M3=E.object({fgColor:E.string().optional(),bgColor:E.string().optional()}),I3=E.object({pixelSize:E.number(),url:E.string()}),L3=E.object({id:E.string(),name:E.string(),description:E.string().optional()});var et=e=>e/255,Ui=(e,t)=>(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2,se=e=>.2126*e[0]+.7152*e[1]+.0722*e[2];function Sh(e){let{width:t,height:n,data:r}=e,o=[0,t-1,(n-1)*t,n*t-1].map(s=>{let a=s*4;return {color:[et(r[a]),et(r[a+1]),et(r[a+2])],alpha:r[a+3]/255}});if(o.some(s=>s.alpha<.9))return null;let i=o[0].color;return o.every(({color:s})=>Ui(s,i)<.006)?i:null}function z3(e){let{width:t,height:n,data:r}=e,o=Sh(e),i=new Float32Array(t*n);for(let s=0;s<i.length;s++){let a=s*4,c=r[a+3]/255;if(o&&c>0){let u=Math.sqrt(Ui([et(r[a]),et(r[a+1]),et(r[a+2])],o));c*=Math.min(1,Math.max(0,(u-.06)/.1));}i[s]=c;}return i}var T3=8,N3=.14,Zb=.006;function O3(e,t){let{width:n,height:r,data:o}=e,i=new Float64Array(4096),s=new Float64Array(4096*3),a=0;for(let m=0;m<t.length;m++){if(t[m]<.9)continue;let h=m*4,d=Math.floor(o[h]/16)*256+Math.floor(o[h+1]/16)*16+Math.floor(o[h+2]/16);i[d]+=1,s[d*3]+=et(o[h]),s[d*3+1]+=et(o[h+1]),s[d*3+2]+=et(o[h+2]),a++;}if(a===0)return {palette:[],error:0};let c=[...i.keys()].filter(m=>i[m]>0).sort((m,h)=>i[h]-i[m]),u=[];for(let m of c){if(i[m]/a<Zb/2||u.length>=T3)break;let h=[s[m*3]/i[m],s[m*3+1]/i[m],s[m*3+2]/i[m]];u.every(d=>Ui(d,h)>=N3**2)&&u.push(h);}let l=[],f=0;for(let m=0;m<3;m++){l=u.map(()=>({n:0,r:0,g:0,b:0,x:0,y:0})),f=0;for(let h=0;h<t.length;h++){if(t[h]<.9)continue;let d=h*4,g=[et(o[d]),et(o[d+1]),et(o[d+2])],_=0,b=Number.POSITIVE_INFINITY;for(let[S,v]of u.entries()){let $=Ui(g,v);$<b&&(b=$,_=S);}let y=l[_];y.n++,y.r+=g[0],y.g+=g[1],y.b+=g[2],y.x+=h%n,y.y+=Math.floor(h/n),f+=Math.sqrt(b);}for(let[h,d]of l.entries())d.n>0&&(u[h]=[d.r/d.n,d.g/d.n,d.b/d.n]);}return {palette:u.map((m,h)=>({color:m,area:l[h].n/a,cx:l[h].n?l[h].x/l[h].n+.5:n/2,cy:l[h].n?l[h].y/l[h].n+.5:r/2})).filter(m=>m.area>=Zb).sort((m,h)=>h.area-m.area),error:f/a}}function F3(e,t,n){let r=t+2,o=n+2,i=(f,p)=>f<=0||p<=0||f>t||p>n?0:e[(p-1)*t+(f-1)],s=new Map,a=new Map,c=f=>{let p=a.get(f);if(p)return p;let m=Math.floor(f/2),h=m%r,d=Math.floor(m/r),g=i(h,d),_=f%2===1,b=_?i(h,d+1):i(h+1,d),y=g===b?.5:Math.min(1,Math.max(0,(.5-g)/(b-g))),S=_?[h-.5,d-.5+y]:[h-.5+y,d-.5];return a.set(f,S),S},u=(f,p)=>{s.set(f,p);};for(let f=0;f<o-1;f++)for(let p=0;p<r-1;p++){let m=i(p,f)>=.5,h=i(p+1,f)>=.5,d=i(p+1,f+1)>=.5,g=i(p,f+1)>=.5,_=2*(f*r+p),b=2*((f+1)*r+p),y=2*(f*r+p)+1,S=2*(f*r+p+1)+1;switch((m?8:0)+(h?4:0)+(d?2:0)+(g?1:0)){case 1:u(b,y);break;case 2:u(S,b);break;case 3:u(S,y);break;case 4:u(_,S);break;case 5:{(i(p,f)+i(p+1,f)+i(p+1,f+1)+i(p,f+1))/4>=.5?(u(_,y),u(b,S)):(u(_,S),u(b,y));break}case 6:u(_,b);break;case 7:u(_,y);break;case 8:u(y,_);break;case 9:u(b,_);break;case 10:{(i(p,f)+i(p+1,f)+i(p+1,f+1)+i(p,f+1))/4>=.5?(u(y,b),u(S,_)):(u(y,_),u(S,b));break}case 11:u(S,_);break;case 12:u(y,S);break;case 13:u(b,S);break;case 14:u(y,b);break;}}let l=[];for(let f of s.keys()){if(!s.has(f))continue;let p=[],m=f;for(;m!==void 0&&s.has(m);){p.push(c(m));let h=s.get(m);s.delete(m),m=h;}p.length>=3&&l.push(p);}return l}function D3(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n],o=e[(n+1)%e.length];t+=r[0]*o[1]-o[0]*r[1];}return t/2}function Bb(e,t){if(e.length<=2)return e;let n=new Uint8Array(e.length);n[0]=1,n[e.length-1]=1;let r=[[0,e.length-1]];for(;r.length>0;){let[o,i]=r.pop(),s=e[o],a=e[i],c=a[0]-s[0],u=a[1]-s[1],l=Math.hypot(c,u)||1,f=-1,p=t;for(let m=o+1;m<i;m++){let h=e[m],d=Math.abs(u*(h[0]-s[0])-c*(h[1]-s[1]))/l;d>p&&(p=d,f=m);}f>=0&&(n[f]=1,r.push([o,f],[f,i]));}return e.filter((o,i)=>n[i]===1)}function Z3(e,t){let n=0,r=-1;for(let[s,a]of e.entries()){let c=(a[0]-e[0][0])**2+(a[1]-e[0][1])**2;c>r&&(r=c,n=s);}let o=Bb(e.slice(0,n+1),t),i=Bb([...e.slice(n),e[0]],t);return [...o.slice(0,-1),...i.slice(0,-1)]}var An=e=>ye(e,2);function B3(e,t){let n=e.length,r=(i,s)=>{let a=Math.hypot(s[0]-i[0],s[1]-i[1])||1,c=Math.min(.5,t/a);return [i[0]+(s[0]-i[0])*c,i[1]+(s[1]-i[1])*c]},o="";for(let i=0;i<n;i++){let s=e[i],a=r(s,e[(i-1+n)%n]),c=r(s,e[(i+1)%n]);o+=i===0?`M${An(a[0])} ${An(a[1])}`:`L${An(a[0])} ${An(a[1])}`,o+=`Q${An(s[0])} ${An(s[1])} ${An(c[0])} ${An(c[1])}`;}return `${o}Z`}function G3(e,t,n){let r="";for(let o of F3(e,t,n)){if(Math.abs(D3(o))<.8)continue;let i=Z3(o,.18);i.length>=3&&(r+=B3(i,.9));}return r}var U3=.075;function Gb(e){let{width:t,height:n,data:r}=e,o=z3(e),i=0;for(let d of o)i+=d;let{palette:s,error:a}=O3(e,o),c={width:t,height:n,palette:s,alpha:o,coverage:i/(t*n)};if(s.length===0||a>U3)return {...c,layers:[],photographic:s.length>0};let u=s.length,l=Array.from({length:u},()=>new Float32Array(t*n)),f=s.map(d=>d.color);for(let d=0;d<o.length;d++){let g=o[d];if(g<=0)continue;let _=d*4,b=[et(r[_]),et(r[_+1]),et(r[_+2])],y=0,S=-1,v=Number.POSITIVE_INFINITY,$=Number.POSITIVE_INFINITY;for(let I=0;I<u;I++){let L=Ui(b,f[I]);L<v?(S=y,$=v,y=I,v=L):L<$&&(S=I,$=L);}if(S<0||v<1e-6){l[y][d]=g;continue}let w=f[y],A=f[S],C=[A[0]-w[0],A[1]-w[1],A[2]-w[2]],R=Math.min(1,Math.max(0,((b[0]-w[0])*C[0]+(b[1]-w[1])*C[1]+(b[2]-w[2])*C[2])/(C[0]**2+C[1]**2+C[2]**2)));l[y][d]=g*(1-R),l[S][d]=g*R;}let p=[],m=new Float32Array(t*n),h=new Array(u);for(let d=u-1;d>=0;d--){let g=l[d];for(let _=0;_<m.length;_++)m[_]+=g[_];h[d]=m.slice();}for(let d=0;d<u;d++){let g=G3(h[d],t,n);g&&p.push({color:f[d],d:g});}return {...c,layers:p,photographic:false}}var{QrCode:vh}=Te,Q3={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function V3(e){let t=e*4+17,n=new Uint8Array(t*t),r=(s,a)=>{s>=0&&a>=0&&s<t&&a<t&&(n[a*t+s]=1);};for(let s=0;s<t;s++)r(6,s),r(s,6);for(let[s,a]of [[3,3],[t-4,3],[3,t-4]])for(let c=-4;c<=4;c++)for(let u=-4;u<=4;u++)r(s+u,a+c);let o=[];if(e>1){let s=Math.floor(e/7)+2,a=e===32?26:Math.ceil((e*4+4)/(s*2-2))*2;o.push(6);for(let c=t-7;o.length<s;c-=a)o.splice(1,0,c);}let i=o.length-1;for(let[s,a]of o.entries())for(let[c,u]of o.entries())if(!(s===0&&c===0||s===0&&c===i||s===i&&c===0))for(let l=-2;l<=2;l++)for(let f=-2;f<=2;f++)r(a+f,u+l);for(let s=0;s<=8;s++)r(8,s),r(s,8);for(let s=0;s<8;s++)r(t-1-s,8),r(8,t-1-s);if(e>=7)for(let s=0;s<18;s++){let a=t-11+s%3,c=Math.floor(s/3);r(a,c),r(c,a);}return n}function j3(e,t){let n=e*4+17,r=We[t].ordinal,o=vh.NUM_ERROR_CORRECTION_BLOCKS[r]?.[e]??0,i=vh.ECC_CODEWORDS_PER_BLOCK[r]?.[e]??0,s=Math.floor(vh.getNumRawDataModules(e)/8),a=o-s%o,c=Math.floor(s/o),u=Array.from({length:o},(S,v)=>c+(v<a?0:1)),l=[],f=[],p=c-i;for(let S=0;S<=c;S++)for(let v=0;v<o;v++)if(v<a){if(S===p)continue;l.push(v),f.push(S<p?S:S-1);}else l.push(v),f.push(S);if(l.length!==s)throw new Error(`Codeword map: interleave mismatch at version ${e}`);let m=V3(e),h=new Int16Array(n*n).fill(-1),d=new Int16Array(n*n).fill(-1),g=new Int8Array(n*n).fill(-1),_=s*8,b=0;for(let S=n-1;S>=1;S-=2){S===6&&(S=5);let v=(S+1&2)===0;for(let $=0;$<n;$++)for(let w=0;w<2;w++){let A=S-w,R=(v?n-1-$:$)*n+A;if(!m[R]&&b<_){let I=b>>>3;h[R]=l[I],d[R]=f[I],g[R]=7-(b&7),b++;}}}if(b!==_)throw new Error(`Codeword map: placement mismatch at version ${e}`);let y=Q3[`${e}${t}`]??0;return {version:e,level:t,size:n,blocks:o,eccPerBlock:i,blockLengths:u,correctable:Math.floor((i-y)/2),block:h,codeword:d,bit:g}}var q3=8,cr=new Map;function Qi(e,t){if(!(Number.isInteger(e)&&e>=1&&e<=40))throw new RangeError(`QR version must be 1\u201340, got ${e}`);let n=`${e}${t}`,r=cr.get(n);if(r)return cr.delete(n),cr.set(n,r),r;let o=j3(e,t);if(cr.size>=q3){let i=cr.keys().next().value;i!==void 0&&cr.delete(i);}return cr.set(n,o),o}function Vi(e,t){let n=new Array(e.blocks).fill(0),r=new Set;for(let o of t){let i=e.block[o]??-1;if(i<0)continue;let s=i*4096+e.codeword[o];r.has(s)||(r.add(s),n[i]=n[i]+1);}return n}var W3={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 Ub(e,t){let n=e.trim(),r=Number.parseFloat(n);return Number.isNaN(r)?Number.NaN:n.endsWith("%")?r/100*t:r}function Ae(e){if(!e)return null;let t=e.trim().toLowerCase();if(t==="transparent")return {r:0,g:0,b:0,a:0};let n=W3[t];if(n)return {r:n[0],g:n[1],b:n[2],a:1};if(t.startsWith("#")){let o=t.slice(1);return (o.length===3||o.length===4)&&(o=o.split("").map(i=>i+i).join("")),/^[0-9a-f]{6}([0-9a-f]{2})?$/.test(o)?{r:Number.parseInt(o.slice(0,2),16),g:Number.parseInt(o.slice(2,4),16),b:Number.parseInt(o.slice(4,6),16),a:o.length===8?Number.parseInt(o.slice(6,8),16)/255:1}:null}let r=/^rgba?\(([^)]*)\)$/.exec(t);if(r){let[o,i]=r[1].split("/"),s=o.split(/[\s,]+/).filter(Boolean);if(s.length!==(i===void 0&&s.length===4?4:3))return null;let a=i??s[3],[c,u,l]=s.slice(0,3).map(m=>Ub(m,255)),f=a===void 0?1:Ub(a,1);if([c,u,l,f].some(m=>Number.isNaN(m)))return null;let p=(m,h)=>Math.min(Math.max(m,0),h);return {r:p(c,255),g:p(u,255),b:p(l,255),a:p(f,1)}}return null}function En(e,t,n){let r=e/255,o=t/255,i=n/255,s=1-Math.max(r,o,i);return s>=1?[0,0,0,1]:[ye((1-r-s)/(1-s)),ye((1-o-s)/(1-s)),ye((1-i-s)/(1-s)),ye(s)]}function Qt(e){return e.children}var H3=e=>e==null?null:`${e}`;function Ch(e,t,n){let r=t??{},o=n;if("key"in r){let{key:i,...s}=r;i!==void 0&&(o=i),r=s;}return {type:e,props:r,key:H3(o)}}function Y3(e,t){let n=e;return {type:n.type,props:{...n.props,...t},key:n.key??null}}function X3(e,t,...n){let r={...t};return n.length>0&&(r.children=n.length===1?n[0]:n),Ch(e,r)}var K3={jsx:Ch,jsxs:Ch,createElement:X3,cloneElement:Y3,Fragment:Qt},ji=K3;var Ph=e=>e===Qt?ji.Fragment:e;function k(e,t,n){return ji.jsx(Ph(e),t,n)}function Se(e,t,n){return ji.jsxs(Ph(e),t,n)}function J3(e,t,...n){return ji.createElement(Ph(e),t??null,...n)}function So(e,t){return ji.cloneElement(e,t)}var e6=new Set([Symbol.for("react.element"),Symbol.for("react.transitional.element")]),Qb=Symbol.for("react.fragment");function ur(e){if(typeof e!="object"||e===null||Array.isArray(e))return false;let t=e;return t.$$typeof!==void 0&&!e6.has(t.$$typeof)?false:(typeof t.type=="string"||typeof t.type=="function"||t.type===Qb)&&typeof t.props=="object"&&t.props!==null}var vo=e=>e===Qt||e===Qb;var Yb=.6,kh={logo:160,halftone:160};function t6(e){let t="";for(let r=0;r<e.length;r+=32768)t+=String.fromCharCode(...e.subarray(r,r+32768));return btoa(t)}var Co=class{entries=new Map;limit;constructor(t){this.limit=t;}get(t,n){let r=this.entries.get(t);if(r!==void 0)return this.entries.delete(t),this.entries.set(t,r),r;let o=n();if(this.entries.size>=this.limit){let i=this.entries.keys().next().value;i!==void 0&&this.entries.delete(i);}return this.entries.set(t,o),o}},n6=new Co(8);function r6(e){return n6.get(e,()=>{let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n})}function Rh(e){let{width:t,height:n,data:r}=e;if(!(Number.isInteger(t)&&Number.isInteger(n))||t<1||n<1||t>Jt||n>Jt||typeof r!="string")return null;try{let o=r6(r);return o.length===t*n*4?{width:t,height:n,data:o}:null}catch{return null}}function Xb(e,t={}){let{width:n,height:r,data:o}=e;if(!(n>0&&r>0)||o.length<n*r*4)throw new Error("Art image pixels must be width \xD7 height \xD7 4 RGBA bytes");let i=Math.min(n,r),s=t.square?Math.floor((n-i)/2):0,a=t.square?Math.floor((r-i)/2):0,c=t.square?i:n,u=t.square?i:r,l=Math.min(Math.max(Math.round(t.maxSize??kh.halftone),1),Jt),f=Math.min(1,l/Math.max(c,u)),p=Math.max(1,Math.round(c*f)),m=Math.max(1,Math.round(u*f)),h=new Uint8Array(p*m*4);for(let d=0;d<m;d++){let g=Math.floor(d*u/m),_=Math.max(g+1,Math.floor((d+1)*u/m));for(let b=0;b<p;b++){let y=Math.floor(b*c/p),S=Math.max(y+1,Math.floor((b+1)*c/p)),v=0,$=0,w=0,A=0,C=0;for(let I=g;I<_;I++)for(let L=y;L<S;L++){let z=((I+a)*n+L+s)*4,D=o[z+3]/255;v+=o[z]*D,$+=o[z+1]*D,w+=o[z+2]*D,A+=D,C++;}let R=(d*p+b)*4;h[R]=A>0?Math.round(v/A):0,h[R+1]=A>0?Math.round($/A):0,h[R+2]=A>0?Math.round(w/A):0,h[R+3]=Math.round(A/C*255);}}return {width:p,height:m,data:t6(h)}}async function o6(e){if(typeof e!="string"&&!(e instanceof Blob))return e.complete||await new Promise(n=>{e.addEventListener("load",n,{once:true}),e.addEventListener("error",n,{once:true});}),e;let t=typeof e=="string"?e:URL.createObjectURL(e);try{return await new Promise((n,r)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>n(o),o.onerror=()=>r(new Error("Could not load the art image")),o.src=t;})}finally{typeof e!="string"&&setTimeout(()=>URL.revokeObjectURL(t),1e3);}}async function i6(e,t={}){if(typeof document>"u")throw new Error("loadQRArtImage needs a browser; pass decoded pixels to createQRArtImage instead");let n=t.mode??"halftone",r=t.maxSize??kh[n],o=await o6(e),i=o.naturalWidth||o.width||r,s=o.naturalHeight||o.height||r,a=n==="halftone",c=Math.min(1,r*4/(a?Math.min(i,s):Math.max(i,s))),u=Math.max(1,Math.round(i*c)),l=Math.max(1,Math.round(s*c)),f=document.createElement("canvas");f.width=u,f.height=l;let p=f.getContext("2d",{willReadFrequently:true});if(!p)throw new Error("Could not get a canvas context");p.imageSmoothingQuality="high",p.drawImage(o,0,0,u,l);let m;try{m=p.getImageData(0,0,u,l);}catch{throw new Error("Could not read the art image (cross-origin images need CORS); upload it instead")}finally{f.remove();}return Xb(m,{maxSize:r,square:a})}function Mh(e){return !!(e&&Zi.includes(e.mode)&&e.image&&Rh(e.image))}function Lc(e){let t=Di[e.mode];return e.variant&&t.includes(e.variant)?e.variant:t[0]}function s6(e,t){if(e===1)return [];let n=Math.floor(e/7)+2,r=e===32?26:Math.ceil((e*4+4)/(n*2-2))*2,o=[6];for(let i=t-7;o.length<n;i-=r)o.splice(1,0,i);return o}function qi(e,t){let n=s6(e,t),r=n.length-1,o=[];for(let[i,s]of n.entries())for(let[a,c]of n.entries())i===0&&a===0||i===0&&a===r||i===r&&a===0||o.push([s,c]);return o}var a6=0,vt=1,kt=2,kn=3,Vb=4,jb=new Map;function Kb(e){let t=jb.get(e);if(t)return t;let n=e*4+17,r=new Uint8Array(n*n),o=(i,s,a,c,u)=>{for(let l=Math.max(0,s);l<Math.min(n,s+c);l++)for(let f=Math.max(0,i);f<Math.min(n,i+a);f++)r[l*n+f]=u;};o(6,0,1,n,Vb),o(0,6,n,1,Vb),o(0,8,9,1,kn),o(8,0,1,9,kn),o(n-8,8,8,1,kn),o(8,n-8,1,8,kn),e>=7&&(o(n-11,0,3,6,kn),o(0,n-11,6,3,kn));for(let[i,s]of qi(e,n))o(i-2,s-2,5,5,kt);return o(0,0,8,8,vt),o(n-8,0,8,8,vt),o(0,n-8,8,8,vt),jb.set(e,r),r}function c6(e){let t=e*4+17,n=Kb(e);return Array.from({length:t},(r,o)=>Array.from({length:t},(i,s)=>n[o*t+s]!==a6))}function u6(e){let t=e[8],n=t?.[0]?1:0,r=t?.[1]?1:0,o=(1-n)*2+r;return ["M","L","H","Q"][o]??"M"}function Po(e,t){let n=Ae(e);return !n||n.a===0?t:[n.r/255,n.g/255,n.b/255]}var fr=(e,t,n)=>[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n];function Rn(e,t,n,r){let o=se(e);if(r?o<=n:o>=n)return e;let i=se(t);return Math.abs(o-i)<1e-6?t:fr(e,t,Math.min(1,Math.max(0,(o-n)/(o-i))))}var Jb=e=>Math.max(...e)-Math.min(...e),l6=(e,t)=>(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2,Ah=e=>e.toString(16).padStart(2,"0");function tt(e,t=1){let n=r=>Math.min(255,Math.round(Math.round(Math.min(Math.max(r,0),1)*255)/t)*t);return `#${Ah(n(e[0]))}${Ah(n(e[1]))}${Ah(n(e[2]))}`}function f6(e){let t=e<0?-1:1,n=Math.abs(e),r=1/(1+.3275911*n),o=1-((((1.061405429*r-1.453152027)*r+1.421413741)*r-.284496736)*r+.254829592)*r*Math.exp(-n*n);return t*o}var Ih=.3,qb=e=>1-Math.exp(-((e/2)**2)/(2*Ih**2)),m6=e=>f6(e/(2*Ih*Math.SQRT2))**2,p6=(e,t,n)=>{let r=Math.min(1,Math.max(0,(n-e)/(t-e)));return r*r*(3-2*r)};function Lh(e,t,n,r){let o=r==="cover"?Math.max(n/e,n/t):Math.min(n/e,n/t);return {scale:o,offsetX:(n-e*o)/2,offsetY:(n-t*o)/2}}function ey(e,t){let{width:n,height:r,data:o}=e,i=new Float32Array(n*r*3),s=t??new Float32Array(n*r);for(let a=0;a<n*r;a++)i[a*3]=o[a*4]/255,i[a*3+1]=o[a*4+1]/255,i[a*3+2]=o[a*4+2]/255,t||(s[a]=o[a*4+3]/255);return {width:n,height:r,rgb:i,alpha:s}}function d6(e){let t=ey(e),{rgb:n,alpha:r}=t,o=new Float64Array(256),i=0;for(let f=0;f<r.length;f++){if(r[f]<.5)continue;let p=se([n[f*3],n[f*3+1],n[f*3+2]]);o[Math.min(255,Math.floor(p*256))]+=1,i++;}let s=f=>{let p=0;for(let m=0;m<256;m++)if(p+=o[m],p>=f*i)return m/255;return 1},a=i?s(.01):0,c=i?s(.99):1;c-a<.15&&(a=0,c=1);let u=Math.min(1.6,1/(c-a)),l=(a+c)/2;for(let f=0;f<r.length;f++){let p=[n[f*3],n[f*3+1],n[f*3+2]],m=se(p),h=.5+(m-l)*u;for(let d=0;d<3;d++)n[f*3+d]=Math.min(1,Math.max(0,h+(p[d]-m)*1.12));}return t}function ty(e,t,n,r,o=1){let{width:i,height:s,rgb:a,alpha:c}=e,u=Math.min(Math.max(t-.5,0),i-1),l=Math.min(Math.max(n-.5,0),s-1),f=Math.floor(u),p=Math.floor(l),m=Math.min(f+1,i-1),h=Math.min(p+1,s-1),d=u-f,g=l-p,_=0,b=0,y=0,S=0,v=(w,A,C)=>{let R=A*i+w,I=c[R]*C;_+=a[R*3]*I,b+=a[R*3+1]*I,y+=a[R*3+2]*I,S+=I;};if(v(f,p,(1-d)*(1-g)),v(m,p,d*(1-g)),v(f,h,(1-d)*g),v(m,h,d*g),S<=0)return r;let $=S*o;return [r[0]+(_/S-r[0])*$,r[1]+(b/S-r[1])*$,r[2]+(y/S-r[2])*$]}var h6=new Co(4),g6=new Co(6),_6=new Co(6);function zh(e,t){return g6.get(e.image.data,()=>Gb(t))}function ny(e,t,n){return _6.get(e.image.data,()=>ey(t,n.alpha))}var De=e=>ye(e,2),ry=e=>ye(e,4),mr=class{groups=new Map;add(t,n){let r=this.groups.get(t);r?r.push(n):this.groups.set(t,[n]);}cellRun(t,n,r,o){this.add(t,`M${n} ${r}h${o}.04v1.04h-${o}.04z`);}circle(t,n,r,o){this.add(t,b6(n,r,o));}toElements(t){return [...this.groups].map(([n,r],o)=>k("path",{d:r.join(""),fill:n},`${t}-${o}`))}};function b6(e,t,n){let r=De(n*2),o=De(n);return `M${De(e-n)} ${De(t)}a${o} ${o} 0 1 0 ${r} 0a${o} ${o} 0 1 0 ${-r} 0z`}function lr(e,t,n,r,o){let i=Math.min(o,n/2,r/2);if(i<=0)return `M${De(e)} ${De(t)}h${De(n)}v${De(r)}h${De(-n)}z`;let s=De(i);return `M${De(e+i)} ${De(t)}h${De(n-2*i)}a${s} ${s} 0 0 1 ${s} ${s}v${De(r-2*i)}a${s} ${s} 0 0 1 ${-s} ${s}h${De(-(n-2*i))}a${s} ${s} 0 0 1 ${-s} ${-s}v${De(-(r-2*i))}a${s} ${s} 0 0 1 ${s} ${-s}z`}function oy(e,t,n){let r="";for(let[o,i]of e){let s=(o-2+t)*n,a=(i-2+t)*n;r+=lr(s,a,5*n,5*n,n*.35),r+=lr(s+n,a+n,3*n,3*n,n*.15),r+=lr(s+2*n,a+2*n,n,n,n*.12);}return r}var y6={blend:1,badge:1,color:.9,mono:.7},Ic=.35;function $6(e,t){let n=Po(e,[0,0,0]),r=Po(t,[1,1,1]),o=se(r)-se(n);return o>=Ic?null:o<=-Ic?"inverted":"low-contrast"}function iy(e,t,n){let r=Math.min(Math.max(e.intensity??Yb,0),y6[Lc(e)]);return se(n)-se(t)>=Ic?r:0}function x6(e){let{art:t,modules:n,version:r}=e,o=t.image&&Rh(t.image);if(!(o&&Zi.includes(t.mode)))return null;let i=n.length;if(i!==r*4+17)return null;let s=Po(e.fgColor,[0,0,0]),a=Po(e.bgColor,[1,1,1]),c=iy(t,s,a);return c<=0?null:{art:t,image:o,modules:n,size:i,version:r,kinds:Kb(r),margin:e.margin,pixelSize:e.pixelSize,t:c,fg:s,bg:a,variant:Lc(t),body:e.body}}function Th(e){let t=x6(e);if(!t)return null;let n;return t.art.mode==="halftone"?n=t.variant==="mono"?A6(t):P6(t):n=t.variant==="badge"?N6(t):E6(t),k("g",{"data-qrdx-art":t.art.mode,"data-qrdx-art-variant":t.variant,children:n})}function w6(e,t){return {margin:.42-.17*e+(t===3?.04:0),darkCap:.4+.3*e}}var sy=8.5,Wb=new Map;function Nh(e){let t=e*4+17,n=Wb.get(e);if(!n){let i=t*2,s=new Uint8Array(i*i),a=sy*2;for(let c=0;c<i;c++)for(let u=0;u<i;u++){let l=u<a||u>=i-a,f=c<a||c>=i-a;l&&f&&!(u>=i-a&&c>=i-a)&&(s[c*i+u]=1);}for(let[c,u]of qi(e,t))for(let l=(u-2)*2-1;l<(u+3)*2+1;l++)for(let f=(c-2)*2-1;f<(c+3)*2+1;f++)f>=0&&l>=0&&f<i&&l<i&&(s[l*i+f]=1);Wb.set(e,s),n=s;}let r=n,o=t*2;return (i,s)=>{let a=Math.floor(i*2),c=Math.floor(s*2);return a>=0&&c>=0&&a<o&&c<o&&r[c*o+a]===1}}function ay(e,t,n=false){let{image:r,size:o,kinds:i,fg:s,bg:a}=e,c=h6.get(e.art.image.data,()=>d6(r)),u=Lh(r.width,r.height,o,"cover"),l=o*t,f=new Float32Array(l*l*3).fill(Number.NaN),m=1/(t*u.scale)>1.3?2:1,h=se(a)-.1*(se(a)-se(s)),d=Nh(e.version);for(let g=0;g<o;g++)for(let _=0;_<o;_++){let b=i[g*o+_],y=b===vt||b===kt;if(!(y&&!n))for(let S=0;S<t;S++)for(let v=0;v<t;v++){let $=0,w=0,A=0;for(let B=0;B<m;B++)for(let N=0;N<m;N++){let j=_+(v+(N+.5)/m)/t,te=g+(S+(B+.5)/m)/t,Q=ty(c,(j-u.offsetX)/u.scale,(te-u.offsetY)/u.scale,a);$+=Q[0],w+=Q[1],A+=Q[2];}let C=m*m,R=[$/C,w/C,A/C],I=_+(v+.5)/t,L=g+(S+.5)/t,z=Math.min(I,L,o-I,o-L);z<1.5&&(R=fr(R,a,.35*(1-z/1.5))),n&&(y||d(I,L))&&(R=Rn(R,a,h,false));let D=((g*t+S)*l+_*t+v)*3;f[D]=R[0],f[D+1]=R[1],f[D+2]=R[2];}}return {n:t,count:l,rgb:f}}function S6(e,t,n){let{size:r,kinds:o,modules:i,fg:s,bg:a,t:c}=e,{n:u,count:l,rgb:f}=t,p=se(s),m=se(a),h=m-p,d=w6(c,u),g=A=>.2126*f[A]+.7152*f[A+1]+.0722*f[A+2],_=new Float32Array(r*r),b=new Float32Array(r*r);for(let A=0;A<r;A++)for(let C=0;C<r;C++){let R=o[A*r+C];if(R===vt){_[A*r+C]=m;continue}if(R===kt){_[A*r+C]=i[A]?.[C]?p:m;continue}let I=0,L=0,z=0;for(let D=0;D<u;D++)for(let B=0;B<u;B++){let N=g(((A*u+D)*l+C*u+B)*3);I+=N,n.under[D*u+B]||(L+=N,z++);}_[A*r+C]=I/(u*u),b[A*r+C]=z?L/z:I/(u*u);}let y=r+1,S=new Float64Array(y*y);for(let A=0;A<r;A++)for(let C=0;C<r;C++)S[(A+1)*y+C+1]=_[A*r+C]+S[A*y+C+1]+S[(A+1)*y+C]-S[A*y+C];let v=2,$=(A,C)=>{let R=Math.max(0,A-v),I=Math.max(0,C-v),L=Math.min(r,A+v+1),z=Math.min(r,C+v+1);return (S[z*y+L]-S[I*y+L]-S[z*y+R]+S[I*y+R])/((L-R)*(z-I))},w=n.weight;for(let A=0;A<r;A++)for(let C=0;C<r;C++){let R=o[A*r+C];if(R===vt||R===kt)continue;let I=R===kn,L=(d.margin+(I?.08:0))*h,z=(d.darkCap-(I?.12:0))*h,D=(w*((n.light-n.dark)/2)-L)/(1-w),B=$(C,A),N=b[A*r+C],j=!!i[A]?.[C],te=0,Q=a;if(j){let X=Math.min(B+D,p+z);N>X&&(te=(N-X)/Math.max(N-p,1e-6),Q=s);}else {let X=Math.max(B-D,m-z);N<X&&(te=(X-N)/Math.max(m-N,1e-6));}if(!(te<=0)){te=Math.min(1,te);for(let X=0;X<u;X++)for(let me=0;me<u;me++){let ze=((A*u+X)*l+C*u+me)*3;for(let $e=0;$e<3;$e++)f[ze+$e]+=(Q[$e]-f[ze+$e])*te;}}}}function cy(e,t,n,r){let{count:o}=t,i=new mr;for(let c=0;c<o;c++){let u=0,l=n(c*o);for(let f=1;f<=o;f++){let p=f<o?n(c*o+f):null;(f===o||p!==l)&&(l&&i.cellRun(l,u,c,f-u),u=f,l=p);}}let s=e.pixelSize/t.n,a=De(e.margin*e.pixelSize);return k("g",{transform:`translate(${a} ${a}) scale(${ry(s)})`,children:i.toElements(r)},r)}function Oh(e,t){let n=qi(e.version,e.size);return n.length===0?[]:[k("path",{d:oy(n,e.margin,e.pixelSize),fill:t,fillRule:"evenodd"},"art-alignment")]}function uy(e){let{image:t,size:n}=e;return Math.floor(Math.min(t.width,t.height)/n)>=4&&n<=45?4:3}var v6=e=>2*Ih*Math.sqrt(-2*Math.log(1-Math.min(e,.95)));function C6(e,t,n){let r=t+1,o=new Float64Array(r*r);for(let s=0;s<t;s++)for(let a=0;a<t;a++)o[(s+1)*r+a+1]=e[s*t+a]+o[s*r+a+1]+o[(s+1)*r+a]-o[s*r+a];let i=new Float32Array(t*t);for(let s=0;s<t;s++)for(let a=0;a<t;a++){let c=Math.max(0,a-n),u=Math.max(0,s-n),l=Math.min(t,a+n+1),f=Math.min(t,s+n+1);i[s*t+a]=(o[f*r+l]-o[u*r+l]-o[f*r+c]+o[u*r+c])/((l-c)*(f-u));}return i}function ly(e,t,n,r){let{size:o,kinds:i,modules:s,fg:a,bg:c}=e,u=se(a),l=se(c),f=l-u,p=C6(t,o,2),m=new Float32Array(o*o),h=new Float32Array(o*o).fill(Number.NaN);for(let d=0;d<o;d++)for(let g=0;g<o;g++){let _=d*o+g,b=i[_];if(b===vt||b===kt)continue;let y=b===kn,S=r.base+(y?.08:0),v=(r.margin+(y?.03:0))*f,$=(r.cap-(y?.04:0))*f,w=qb(S),A=qb(y?Math.max(r.max,.94):r.max),C=w*((r.dark+r.light)/2)+(1-w)*p[_],R=n[_],I=!!s[d]?.[g],L=I?r.dark:r.light,z=I?Math.min(C-v,u+$):Math.max(C+v,l-$),B=(I?R<=z:R>=z)?0:(R-z)/(R-L);B>A&&(B=A,h[_]=Math.min(l,Math.max(u,(z-A*L)/(1-A))));let N=I?R<=z-.06:R>=z+.06;r.skip&&N&&!y||(B=Math.max(B,w)),m[_]=B>0?v6(B):0;}return {diameter:m,surround:h}}function P6(e){let{size:t,kinds:n,modules:r,fg:o,bg:i,t:s,margin:a,pixelSize:c}=e,u=uy(e),l=ay(e,u,true),f=se(o),p=se(i),m=f+.1*(p-f),h=p-.05*(p-f),{count:d,rgb:g}=l,_=($,w,A,C)=>((w*u+C)*d+$*u+A)*3,b=new Float32Array(t*t);for(let $=0;$<t;$++)for(let w=0;w<t;w++){let A=n[$*t+w];if(A===vt||A===kt){b[$*t+w]=A===kt&&r[$]?.[w]?f:p;continue}let C=0;for(let R=0;R<u;R++)for(let I=0;I<u;I++){let L=_(w,$,I,R);C+=.2126*g[L]+.7152*g[L+1]+.0722*g[L+2];}b[$*t+w]=C/(u*u);}let y=ly(e,b,b,{base:.6-.28*s,max:.86,dark:m,light:h,margin:.2-.1*s,cap:.4+.14*s,skip:false});for(let $=0;$<t;$++)for(let w=0;w<t;w++){let A=y.surround[$*t+w];if(Number.isNaN(A))continue;let C=b[$*t+w],I=A<C?o:i,L=Math.min(1,Math.abs(C-A)/Math.max(Math.abs(C-se(I)),1e-6));for(let z=0;z<u;z++)for(let D=0;D<u;D++){let B=_(w,$,D,z);for(let N=0;N<3;N++)g[B+N]+=(I[N]-g[B+N])*L;}}let S=[cy(e,l,$=>{let w=$*3;return Number.isNaN(g[w])?null:tt([g[w],g[w+1],g[w+2]],8)},"art-photo")],v=new mr;for(let $=0;$<t;$++)for(let w=0;w<t;w++){let A=y.diameter[$*t+w];if(!(A>0))continue;let C=0,R=0,I=0;for(let D=0;D<u;D++)for(let B=0;B<u;B++){let N=_(w,$,B,D);C+=g[N],R+=g[N+1],I+=g[N+2];}let L=[C/(u*u),R/(u*u),I/(u*u)],z=r[$]?.[w]?Rn(L,o,m,true):Rn(L,i,h,false);v.circle(tt(z,10),(w+a+.5)*c,($+a+.5)*c,A/2*c);}return S.push(...v.toElements("art-dot"),...Oh(e,tt(o))),S}function A6(e){let{size:t,kinds:n,modules:r,fg:o,bg:i}=e,s=uy(e),a=ay(e,s),c=se(o),u=se(i),l=s%2===1?1:2,f=(s-l)/2,p=C=>C>=f&&C<f+l,m=[];for(let C=0;C<s;C++)for(let R=0;R<s;R++)m.push(p(R)&&p(C));S6(e,a,{weight:m6(l/s),dark:c,light:u,under:m});let{count:h,rgb:d}=a,g=new Float32Array(h*h),_=new Int8Array(h*h).fill(-1);for(let C=0;C<h*h;C++){let R=C*3;if(Number.isNaN(d[R])){g[C]=Number.NaN;continue}let I=(.2126*d[R]+.7152*d[R+1]+.0722*d[R+2]-c)/(u-c);g[C]=.5+(p6(0,1,I)-.5)*1.15;}for(let C=0;C<t;C++)for(let R=0;R<t;R++){let I=n[C*t+R];if(!(I===vt||I===kt))for(let L=f;L<f+l;L++)for(let z=f;z<f+l;z++)_[(C*s+L)*h+R*s+z]=r[C]?.[R]?0:1;}let b=Nh(e.version);for(let C=0;C<h;C++)for(let R=0;R<h;R++){let I=C*h+R;_[I]<0&&b((R+.5)/s,(C+.5)/s)&&(_[I]=1);}let y=new Uint8Array(h*h),S=.3,v=0,$=0,w=(C,R,I)=>{if(C<0||C>=h||R>=h)return;let L=R*h+C;if(!Number.isNaN(g[L])){let z=Math.floor(C/s)===Math.floor(v/s)&&Math.floor(R/s)===Math.floor($/s);g[L]+=z?I:I*S;}};for(let C=0;C<h;C++){let R=C%2===0?1:-1;for(let I=0;I<h;I++){let L=R===1?I:h-1-I,z=C*h+L,D=g[z];if(Number.isNaN(D))continue;let B=_[z]>=0?_[z]:D>=.5?1:0;y[z]=B===0?1:0;let N=Math.min(.75,Math.max(-0.75,D-B));v=L,$=C,w(L+R,C,N*7/16),w(L-R,C+1,N*3/16),w(L,C+1,N*5/16),w(L+R,C+1,N/16);}}let A=tt(o);return [cy(e,a,C=>y[C]?A:null,"art-halftone"),...Oh(e,A)]}function Hb(e,t){let n=null,r=0;for(let o of e.palette){if(t&&l6(o.color,t)<.02)continue;let i=o.area*(.35+Jb(o.color))*(se(o.color)>.86?.05:1);i>r&&(r=i,n=o.color);}return n}function fy(e,t,n,r,o){let i;if(e.photographic){let s=new mr,{width:a,height:c,rgb:u,alpha:l}=t;for(let f=0;f<c;f++){let p=0,m=null;for(let h=0;h<=a;h++){let d=f*a+h,g=h<a&&l[d]>=.5?tt(r([u[d*3],u[d*3+1],u[d*3+2]]),6):null;(h===a||g!==m)&&(m&&s.cellRun(m,p,f,h-p),p=h,m=g);}}i=s.toElements(`${o}-px`);}else i=e.layers.map((s,a)=>k("path",{d:s.d,fill:tt(r(s.color)),fillRule:"evenodd"},`${o}-${a}`));return k("g",{transform:`translate(${De(n.x)} ${De(n.y)}) scale(${ry(n.scale)})`,children:i},o)}function E6(e){let{art:t,image:n,size:r,kinds:o,modules:i,fg:s,bg:a,t:c,margin:u,pixelSize:l}=e,f=zh(t,n),p=ny(t,n,f),m=Lh(f.width,f.height,r,"contain"),h=Math.min(1,.3+1.4*c),d=N=>fr(a,N,h),g=tt(a),_=tt(s),b=[fy(f,p,{x:(u+m.offsetX)*l,y:(u+m.offsetY)*l,scale:m.scale*l},d,"art-logo")],y=sy,S=(N,j)=>lr((N+u)*l,(j+u)*l,(y+.4)*l,(y+.4)*l,1.2*l),v=qi(e.version,r).map(([N,j])=>lr((N-2.5+u)*l,(j-2.5+u)*l,6*l,6*l,l*.8)).join("");b.push(k("path",{d:S(-0.4,-0.4)+S(r-y,-0.4)+S(-0.4,r-y)+v,fill:g},"art-plates"));let $=Nh(e.version),w=se(a),A=se(s),C=new Float32Array(r*r),R=new Float32Array(r*r),I=new Array(r*r);for(let N=0;N<r;N++)for(let j=0;j<r;j++){let te=N*r+j,Q=o[te];if(Q===vt||Q===kt){C[te]=Q===kt&&i[N]?.[j]?A:w;continue}let X=1,me=0,ze=0,$e=0,Z=0;for(let K=0;K<4;K++)for(let J=0;J<4;J++){let Be=j+(J+.5)/4,Fn=N+(K+.5)/4,pt=$(Be,Fn)?a:ty(p,(Be-m.offsetX)/m.scale,(Fn-m.offsetY)/m.scale,a,h),qt=se(pt);X=Math.min(X,qt),me+=qt,ze+=pt[0],$e+=pt[1],Z+=pt[2];}C[te]=me/16,R[te]=X,I[te]=[ze/16,$e/16,Z/16];}let L=A+.08*(w-A),z=w-.04*(w-A),D=ly(e,C,C,{base:.74-.26*c,max:.9,dark:L,light:z,margin:.23-.1*c,cap:.4+.1*c,skip:c>=.7}),B=new mr;for(let N=0;N<r;N++)for(let j=0;j<r;j++){let te=N*r+j,Q=D.diameter[te],X=!!i[N]?.[j];if(!(Q>0)||!X&&R[te]>=w-.02)continue;let me=X?Rn(I[te],s,L,true):Rn(I[te],a,z,false);B.circle(tt(me,8),(j+u+.5)*l,(N+u+.5)*l,Q/2*l);}return b.push(...B.toElements("art-dot")),b.push(...Oh(e,_)),b}var k6={L:.5,M:.72,Q:.88,H:1},my=.32,py=.55,R6=.6,M6=2;function dy(e,t,n){let r=t>=1?e:e*t,o=t>=1?e/t:e,i=Math.max(.7,e*.09),s=r+2*i,a=o+2*i;return {logoW:r,logoH:o,plateW:s,plateH:a,radius:Math.min(s,a)*.26,cx:n/2,cy:n/2}}var hy=e=>({cx:e.cx,cy:e.cy,w:e.plateW,h:e.plateH,r:e.radius});function gy(e,t,n){return by(t+.5,n+.5,e)<py}function I6(e,t){let n=hy(e),r=py+1,o=Math.max(0,Math.floor(e.cx-e.plateW/2-r)),i=Math.min(t-1,Math.ceil(e.cx+e.plateW/2+r)),s=Math.max(0,Math.floor(e.cy-e.plateH/2-r)),a=Math.min(t-1,Math.ceil(e.cy+e.plateH/2+r)),c=[];for(let u=s;u<=a;u++)for(let l=o;l<=i;l++)gy(n,l,u)&&c.push(u*t+l);return c}var L6=e=>Math.floor(e.correctable*R6);function Eh(e,t,n){let r=dy(e,t,n.size),o=L6(n);return Vi(n,I6(r,n.size)).every(i=>i<=o)}function _y(e,t,n){if(Eh(n,t,e))return n;let r=0,o=n;if(!Eh(r,t,e))return -1;for(;o-r>1/64;){let i=(r+o)/2;Eh(i,t,e)?r=i:o=i;}return r}var Mc=new Map;function z6(e,t){let n=`${e.version}${e.level}:${t.toFixed(3)}`,r=Mc.get(n);return r===void 0&&(r=_y(e,t,my*e.size),Mc.size>=64&&Mc.clear(),Mc.set(n,r)),r}function T6(e,t){let{size:n,t:r,modules:o,version:i}=e,s=u6(o),a=(.18+.15*r)*k6[s],c=t.width/t.height,u=Math.min(my,a)*n,l=Qi(i,s),f=Math.max(0,z6(l,c));if(f<M6)return {wantedBox:u,maxBox:f,box:0,plate:null};let p=_y(l,c,Math.min(u,f));return p<0?{wantedBox:u,maxBox:f,box:0,plate:null}:{wantedBox:u,maxBox:f,box:p,plate:dy(p,c,n)}}function by(e,t,n){let r=Math.abs(e-n.cx)-(n.w/2-n.r),o=Math.abs(t-n.cy)-(n.h/2-n.r);return Math.hypot(Math.max(r,0),Math.max(o,0))+Math.min(Math.max(r,o),0)-n.r}function yy(e,t){let{fg:n,bg:r,t:o}=e,i=se(n),s=se(r),a=Hb(t),c=Math.min(1,o/.6),u=a?Rn(a,n,i+.3*(s-i),true):n,l=fr(n,u,c),f=a?Hb(t,a):null,p=i+.42*(s-i),m=f&&se(f)<=p+.22?fr(n,Rn(f,n,p,true),c):l;return {body:l,inner:m}}function N6(e){let{art:t,image:n,size:r,kinds:o,modules:i,bg:s,margin:a,pixelSize:c,version:u}=e,l=zh(t,n),f=T6(e,l).plate,{body:p}=yy(e,l),m=tt(p),h=f&&hy(f),d=i.map(I=>[...I]);for(let I=0;I<r;I++)for(let L=0;L<r;L++){let z=o[I*r+L];(z===kt||h&&z!==vt&&gy(h,L,I))&&(d[I][L]=false);}let g=[],_=e.body?.(d);if(_)g.push(k("g",{fill:m,children:_},"art-body"));else {let I=new mr;for(let L=0;L<r;L++)for(let z=0;z<r;z++)d[L]?.[z]&&o[L*r+z]!==vt&&I.circle(m,(z+a+.5)*c,(L+a+.5)*c,.45*c);g.push(...I.toElements("art-body"));}let b=qi(u,r).filter(([I,L])=>!h||by(I+.5,L+.5,h)>3.2);if(b.length>0&&g.push(k("path",{d:oy(b,a,c),fill:m,fillRule:"evenodd"},"art-alignment")),!f)return g;let y=ny(t,n,l),S=(f.cx-f.plateW/2+a)*c,v=(f.cy-f.plateH/2+a)*c,$=f.plateW*c,w=f.plateH*c,A=f.radius*c,C=.1*c,R=lr(S,v,$,w,A);return g.push(k("path",{d:R,fill:tt(s)},"art-plate"),k("path",{d:R+lr(S+C,v+C,$-2*C,w-2*C,A-C),fill:tt(fr(s,p,.16)),fillRule:"evenodd"},"art-plate-ring"),fy(l,y,{x:(f.cx-f.logoW/2+a)*c,y:(f.cy-f.logoH/2+a)*c,scale:f.logoW/l.width*c},I=>I,"art-logo")),g}function Fh(e){let{art:t}=e;if(t.mode!=="logo"||t.matchEyes===false)return null;let n=t.image&&Rh(t.image);if(!n)return null;let r=Po(e.fgColor,[0,0,0]),o=Po(e.bgColor,[1,1,1]),i=iy(t,r,o);if(i<=0)return null;let s=zh(t,n);if(s.palette.length===0)return null;if(Lc(t)==="badge"){let{body:h,inner:d}=yy({fg:r,bg:o,t:i},s),g={outer:tt(h),inner:tt(d)};return {topLeft:g,topRight:g,bottomLeft:g}}let a=se(r),c=se(o),u=Math.min(1,i/.6),l=e.version*4+17,f=Lh(s.width,s.height,l,"contain"),p=.45*Math.max(s.width,s.height),m=(h,d)=>{let g=(h-f.offsetX)/f.scale,_=(d-f.offsetY)/f.scale,b=null,y=0;for(let v of s.palette){if(se(v.color)>.86)continue;let $=(v.cx-g)**2+(v.cy-_)**2,w=v.area*(.35+Jb(v.color))*Math.exp(-$/(2*p**2));w>y&&(y=w,b=v.color);}if(!b)return {};let S=Rn(b,r,a+.42*(c-a),true);return {inner:tt(fr(r,S,u))}};return {topLeft:m(3.5,3.5),topRight:m(l-3.5,3.5),bottomLeft:m(3.5,l-3.5)}}function fe(e){if(e.length===0)return "";let[t,...n]=e;return `M${x(t[0])} ${x(t[1])}${n.map(([r,o])=>`L${x(r)} ${x(o)}`).join("")}Z`}function ee(e,t,n){return `M${x(e-n)} ${x(t)}A${x(n)} ${x(n)} 0 1 1 ${x(e+n)} ${x(t)}A${x(n)} ${x(n)} 0 1 1 ${x(e-n)} ${x(t)}Z`}function U(e,t,n,r,o=0){let i=Math.min(n,r)/2,[s,a,c,u]=(typeof o=="number"?[o,o,o,o]:o).map(f=>Math.max(0,Math.min(f,i))),l=(f,p,m)=>f>0?`A${x(f)} ${x(f)} 0 0 1 ${x(p)} ${x(m)}`:"";return `M${x(e+s)} ${x(t)}H${x(e+n-a)}${l(a,e+n,t+a)}V${x(t+r-c)}${l(c,e+n-c,t+r)}H${x(e+u)}${l(u,e,t+r-u)}V${x(t+s)}${l(s,e+s,t)}Z`}function Ao(e,t,n,r,o=-90){return Array.from({length:r},(i,s)=>{let a=(o+360/r*s)*Math.PI/180;return [e+n*Math.cos(a),t+n*Math.sin(a)]})}function Eo(e,t,n,r,o=5){return Array.from({length:o*2},(i,s)=>{let a=s%2===0?n:r,c=-Math.PI/2+Math.PI/o*s;return [e+a*Math.cos(c),t+a*Math.sin(c)]})}function Wi(e,t,n,r,o=4,i=64){return Array.from({length:i},(s,a)=>{let c=2*Math.PI*a/i,u=Math.cos(c),l=Math.sin(c);return [e+n*Math.sign(u)*Math.abs(u)**(2/o),t+r*Math.sign(l)*Math.abs(l)**(2/o)]})}function ko(e,t,n){let r=n/2,o=(i,s)=>`${x(e+i*r)} ${x(t+s*r)}`;return `M${o(0,-0.52)}C${o(.18,-0.92)} ${o(.98,-0.94)} ${o(1,-0.34)}C${o(1,.12)} ${o(.5,.48)} ${o(0,.92)}C${o(-0.5,.48)} ${o(-1,.12)} ${o(-1,-0.34)}C${o(-0.98,-0.94)} ${o(-0.18,-0.92)} ${o(0,-0.52)}Z`}function $y(e,t,n,r){if(r===0)return e;let o=r*Math.PI/180,i=Math.cos(o),s=Math.sin(o);return e.map(([a,c])=>[t+(a-t)*i-(c-n)*s,n+(a-t)*s+(c-n)*i])}function zc(e,t,n=0){let r=Math.imul(e+2654435769,2246822507)^Math.imul(t+n,3266489909);return r=Math.imul(r^r>>>15,739982445),r=Math.imul(r^r>>>12,695872825),r^=r>>>15,(r>>>0)/4294967296}function pr(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return (t>>>0).toString(36)}var O6=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];function xy(e){return O6.includes(e)}var wy={circle:.95,"circle-large":.85,square:.75,diamond:.95,pacman:.9,rounded:.75,"vertical-line":.8,liquid:.75,"liquid-horizontal":.85,"liquid-vertical":.85,classy:.7,"classy-rounded":.7,leaf:.75,plus:.8,hexagon:.75,star:.85,heart:.85,"random-dots":.85,mosaic:.8,octagon:.8};function Tc(e,t){if(e===void 0||!Number.isFinite(e))return 1;let n=t?wy[t]??1:Gi;return Math.min(kc,Math.max(Gi,n,e))}function F6(e,t,n){return e<7&&t<7||e>=n-7&&t<7||e<7&&t>=n-7}function D6(e,t){if(e===1)return [];let n=Math.floor(e/7)+2,r=e===32?26:Math.ceil((e*4+4)/(n*2-2))*2,o=[6];for(let i=t-7;o.length<n;i-=r)o.splice(1,0,i);return o}function Dh(e){let t=(e-17)/4,n=Number.isInteger(t)?D6(t,e):[],r=n.length-1,o=[];for(let[i,s]of n.entries())for(let[a,c]of n.entries())i===0&&a===0||i===0&&a===r||i===r&&a===0||o.push([s,c]);return (i,s)=>o.some(([a,c])=>Math.abs(i-a)<=2&&Math.abs(s-c)<=2)}var Z6={liquid:{horizontal:true,vertical:true,thickness:1,radius:()=>1,fillets:true},"liquid-horizontal":{horizontal:true,vertical:false,thickness:.86,radius:()=>1,fillets:false},"liquid-vertical":{horizontal:false,vertical:true,thickness:.86,radius:()=>1,fillets:false},classy:{horizontal:true,vertical:true,thickness:1,radius:e=>e===0||e===2?1:0,fillets:false},"classy-rounded":{horizontal:true,vertical:true,thickness:1,radius:e=>e===0||e===2?1:.4,fillets:false}};function B6(e,t,n,r,o,i){switch(e){case "horizontal-line":{let s=r*.43;return U(t-r/2,n-s,r,2*s)}case "leaf":{let s=r*.5;return U(t-s,n-s,2*s,2*s,[r*.4,r*.05,r*.4,r*.05])}case "plus":{let s=r*.22,a=r*.5;return fe([[t-s,n-a],[t+s,n-a],[t+s,n-s],[t+a,n-s],[t+a,n+s],[t+s,n+s],[t+s,n+a],[t-s,n+a],[t-s,n+s],[t-a,n+s],[t-a,n-s],[t-s,n-s]])}case "hexagon":return fe(Ao(t,n,r*.54,6));case "star":return fe(Eo(t,n+r*.04,r*.62,r*.34));case "heart":return ko(t,n+r*.02,r*1.08);case "random-dots":return ee(t,n,r*(.38+.15*zc(o,i)));case "mosaic":{let s=r*(.8+.14*zc(o,i,1))/2,a=[[t-s,n-s],[t+s,n-s],[t+s,n+s],[t-s,n+s]];return fe($y(a,t,n,(zc(o,i,2)-.5)*16))}case "octagon":return fe(Ao(t,n,r*.48/Math.cos(Math.PI/8),8,22.5));default:return ee(t,n,r*.45)}}function Sy(e,t){let{margin:n,pixelSize:r,pattern:o}=t,i=Tc(t.scale,o),s=e.length,a=t.plain?()=>false:Dh(s),c=(d,g)=>!t.plain&&F6(d,g,s),u=(d,g)=>d>=0&&g>=0&&d<s&&g<s&&!!e[g]?.[d]&&!c(d,g),l=d=>(d+.5+n)*r,f=[],p=[],m=Z6[o];for(let d=0;d<s;d++)for(let g=0;g<s;g++){if(!u(g,d))continue;let _=l(g),b=l(d);if(a(g,d)){f.push(M`M${_-r/2} ${b-r/2}h${r}v${r}h${-r}z`);continue}if(!m){p.push(B6(o,_,b,r*i,g,d));continue}let y=r*m.thickness*i/2,S=m.horizontal&&u(g+1,d),v=m.horizontal&&u(g-1,d),$=m.vertical&&u(g,d-1),w=m.vertical&&u(g,d+1),C=[!($||v),!($||S),!(w||S),!(w||v)].map((R,I)=>R?y*m.radius(I):0);p.push(U(_-y,b-y,2*y,2*y,C)),2*y<r&&(S&&p.push(U(_,b-y,r,2*y)),w&&p.push(U(_-y,b,2*y,r)));}if(m?.fillets&&i===1){let d=r*.3;for(let g=0;g<s;g++)for(let _=0;_<s;_++){if(u(_,g)||c(_,g))continue;let b=l(_)-r/2,y=l(g)-r/2,S=b+r,v=y+r;u(_-1,g)&&u(_,g-1)&&u(_-1,g-1)&&p.push(M`M${b} ${y}h${d}A${d} ${d} 0 0 0 ${b} ${y+d}Z`),u(_+1,g)&&u(_,g-1)&&u(_+1,g-1)&&p.push(M`M${S} ${y}v${d}A${d} ${d} 0 0 0 ${S-d} ${y}Z`),u(_+1,g)&&u(_,g+1)&&u(_+1,g+1)&&p.push(M`M${S} ${v}h${-d}A${d} ${d} 0 0 0 ${S} ${v-d}Z`),u(_-1,g)&&u(_,g+1)&&u(_-1,g+1)&&p.push(M`M${b} ${v}v${-d}A${d} ${d} 0 0 0 ${b+d} ${v}Z`);}}let h=[];return p.length>0&&h.push(k("path",{d:p.join("")},"modules")),f.length>0&&h.push(k("path",{d:f.join("")},"alignment")),h}var S9=(e,t,n,r)=>{let o=document.createElement("canvas");o.width=t,o.height=n;let i=o.getContext("2d");if(!i)return;i.putImageData(e,0,0);let s=o.toDataURL("image/png"),a=document.createElement("a");a.href=s,a.download=r,document.body.appendChild(a),a.click(),document.body.removeChild(a);},G6=async(e,t,n,r)=>{let{default:o}=await import('jsqr');return new Promise(i=>{e.complete?s():(e.onload=()=>s(),e.onerror=()=>i(null));function s(){let a=document.createElement("canvas");requestAnimationFrame(()=>{if(!(e.naturalWidth&&e.naturalHeight)){i(null);return}let c=e.naturalWidth/e.naturalHeight<=.33||e.naturalWidth/e.naturalHeight>=3?Math.sqrt(e.naturalWidth*e.naturalHeight/12e5):e.naturalWidth/e.naturalHeight<=.5||e.naturalWidth/e.naturalHeight>=2?Math.sqrt(e.naturalWidth*e.naturalHeight/9e5):Math.sqrt(e.naturalWidth*e.naturalHeight/64e4),u=a.getContext("2d",{willReadFrequently:true});if(!u){i(null);return}let l=[1,.8,.6,.4,.2,.1];for(let f of l){let p=Math.floor(e.naturalWidth*t*f/c),m=Math.floor(e.naturalHeight*t*f/c);a.width=p,a.height=m,u.clearRect(0,0,p,m),u.imageSmoothingEnabled=true,u.imageSmoothingQuality="high";try{u.drawImage(e,Math.floor(n),Math.floor(r),Math.floor(e.naturalWidth*t),Math.floor(e.naturalHeight*t),0,0,p,m);let h=u.getImageData(0,0,p,m);try{let d=o(h.data,p,m);if(d?.data){i(d);return}}catch(d){console.error("QR Detection error:",d);}}catch(h){console.error("Canvas drawing error:",h);}}i(null);});}})},vy=async(e,t,n=false)=>{if(!e)return "NO_QR";await new Promise(o=>setTimeout(o,100));let r=[{dx:0,dy:0,ratio:1},{dx:0,dy:e.naturalHeight*.35,ratio:.65},{dx:e.naturalWidth*.35,dy:e.naturalHeight*.35,ratio:.65},{dx:e.naturalWidth*.35,dy:0,ratio:.65},{dx:e.naturalWidth*.35/2,dy:e.naturalHeight*.35/2,ratio:.65}];for(let o of r)try{let i=await G6(e,o.ratio,o.dx,o.dy);if(i?.data)return n?i:i.data}catch(i){console.warn("QR decode error:",i);}return "NO_QR"};function v9(e,t,n){if(!(e&&t)||t.length!==4)return;let r=document.createElement("canvas");r.width=e.naturalWidth,r.height=e.naturalHeight;let o=r.getContext("2d");if(!o)return;o.drawImage(e,0,0),o.save(),o.strokeStyle="#ff0000",o.lineWidth=Math.max(5,Math.min(e.naturalWidth,e.naturalHeight)/200),o.shadowColor="transparent",o.shadowBlur=0,o.beginPath(),o.moveTo(t[0].x,t[0].y),o.lineTo(t[1].x,t[1].y),o.lineTo(t[3].x,t[3].y),o.lineTo(t[2].x,t[2].y),o.closePath(),o.stroke(),o.fillStyle="#ff0000",t.forEach((a,c)=>{o.fillRect(a.x-3,a.y-3,6,6),o.fillStyle="#ffffff",o.font="16px Arial",o.fillText(`${c}`,a.x+5,a.y-5),o.fillStyle="#ff0000";}),o.restore();let i=r.toDataURL("image/png"),s=document.createElement("a");s.href=i,s.download=n,document.body.appendChild(s),s.click(),document.body.removeChild(s);}var Zh=24,Mn=(e,t,n,r)=>{let o=r*Math.PI/180;return [e+n*Math.cos(o),t+n*Math.sin(o)]},Nc=([e,t])=>`${x(e)} ${x(t)}`;function Ro(e,t,n,r,o,i){let s=i-o>180?1:0;return `M${Nc(Mn(e,t,r,o))}A${x(r)} ${x(r)} 0 ${s} 1 ${Nc(Mn(e,t,r,i))}L${Nc(Mn(e,t,n,i))}A${x(n)} ${x(n)} 0 ${s} 0 ${Nc(Mn(e,t,n,o))}Z`}function Hi(e,t,n,r){return `M${x(e-n)} ${x(t)}A${x(n)} ${x(r)} 0 1 1 ${x(e+n)} ${x(t)}A${x(n)} ${x(r)} 0 1 1 ${x(e-n)} ${x(t)}Z`}function U6(e){let t=0;return e.forEach(([n,r],o)=>{let[i,s]=e[(o+1)%e.length];t+=n*s-i*r;}),t/2}function Cy(e){return fe(U6(e)<0?[...e].reverse():e)}function Oc(e,t,n,r,o){let i=Math.hypot(n-e,r-t)||1,s=-(r-t)/i*(o/2),a=(n-e)/i*(o/2);return Cy([[e+s,t+a],[n+s,r+a],[n-s,r-a],[e-s,t-a]])}var nt=(...e)=>({d:e.join(""),fillRule:"nonzero"}),tn=(...e)=>({d:e.join(""),fillRule:"evenodd"});function Q6(){let e=[];for(let t of [0,60,120]){let[n,r]=Mn(12,12,10.5,t+180),[o,i]=Mn(12,12,10.5,t);e.push(Oc(n,r,o,i,2));}for(let t=0;t<6;t++){let n=t*60,[r,o]=Mn(12,12,6.2,n);for(let i of [-45,45]){let[s,a]=Mn(r,o,3.6,n+i);e.push(Oc(r,o,s,a,1.7));}}return nt(...e)}var V6={wifi:()=>nt(Ro(12,20,4.6,7.2,-135,-45),Ro(12,20,9.2,11.8,-135,-45),Ro(12,20,13.8,16.4,-135,-45),ee(12,20,2.2)),star:()=>nt(fe(Eo(12,12.8,11.6,4.8))),heart:()=>nt(ko(12,12.4,22)),phone:()=>tn(U(6,1.5,12,21,2.6),U(7.8,4.2,8.4,13.4,.6),ee(12,19.8,1.1)),headphones:()=>nt(Ro(12,13,7.6,9.8,-180,0),U(2,12,5,9.5,2),U(17,12,5,9.5,2)),calendar:()=>tn(U(2.5,4,19,17.5,2.5),U(4.6,9,14.8,10.6,.8),U(7,11.4,2.6,2.6,.4),U(10.7,11.4,2.6,2.6,.4),U(14.4,11.4,2.6,2.6,.4),U(7,15.1,2.6,2.6,.4),U(10.7,15.1,2.6,2.6,.4),U(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),U(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>nt(ee(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:()=>tn(U(2,3,20,14,4),fe([[6.5,17],[11.5,17],[5.8,21.8]]),ee(7.5,10,1.5),ee(12,10,1.5),ee(16.5,10,1.5)),bag:()=>nt(U(3.5,7.5,17,14.5,2),Ro(12,7.5,3.1,4.8,-180,0)),bell:()=>nt("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",U(1.5,18.2,21,2.6,1.3),U(11.2,6.6,1.6,2.6,0),U(9.8,4.6,4.4,2.4,1.2)),cup:()=>nt("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",Ro(17,10.2,1.7,3.6,-90,90),U(2,20.6,17,2,1),U(7,1.6,1.6,3.4,.8),U(11.6,1.6,1.6,3.4,.8)),card:()=>tn(U(1.5,4.5,21,15,2.5),U(1.5,8,21,3,0),U(4.5,13.6,4.6,3.2,.6)),check:()=>tn(ee(12,12,10.5),fe([[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:()=>tn(ee(12,12,10.5),ee(12,7.2,1.6),U(10.6,10,2.8,8,.8)),home:()=>tn(fe([[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]]),U(10,14.5,4,7,[.6,.6,0,0])),pin:()=>tn("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",ee(12,9.5,3)),share:()=>nt(Oc(6,12,18,5,1.8),Oc(6,12,18,19,1.8),ee(18,5,3.2),ee(6,12,3.2),ee(18,19,3.2)),download:()=>nt(U(10.6,2,2.8,9.5,0),fe([[6,10],[18,10],[12,16.5]]),fe([[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:()=>tn(ee(12,12,10.5),ee(12,12,8.4),fe([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:Q6,pumpkin:()=>nt(Hi(7.8,14.6,5.8,6.9),Hi(16.2,14.6,5.8,6.9),Hi(12,14.6,4.8,7.4),U(10.9,3.4,2.2,4.6,.8),Cy([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>nt(fe([[12,1.5],[16.8,8.2],[7.2,8.2]]),fe([[12,5.2],[19,13.6],[5,13.6]]),fe([[12,9.4],[21.2,19.2],[2.8,19.2]]),U(10.4,18.6,3.2,3.9,.4)),sparkle:()=>nt(fe(Eo(9.5,13.5,9,2.4,4)),fe(Eo(19,5,4,1.1,4))),gift:()=>nt(U(3,11.2,7.8,10.6,1),U(13.2,11.2,7.8,10.6,1),U(2,7.4,8.8,3.2,1),U(13.2,7.4,8.8,3.2,1),Hi(8.8,4.8,2.9,1.9),Hi(15.2,4.8,2.9,1.9))};function Bh(e){return V6[e]()}var j6=["banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"];function Ay(e){return j6.includes(e)}var Uh={from:"#7c3aed",to:"#db2777"},qe="#FFFFFF";function Ey(e){return e===" "?.3:/[MWmw@%]/.test(e)?.92:/[A-Z0-9#&]/.test(e)?.72:/[il.,:;!'|1]/.test(e)?.32:.6}function Io(e){let t=0;for(let n of e)t+=Ey(n);return Math.max(t,1)}var Gh=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,"0");function _t(e,t,n){let r=Ae(e)??{r:0,g:0,b:0},o=Ae(t)??{r:255,g:255,b:255},i=Math.min(1,Math.max(0,n));return `#${Gh(r.r+(o.r-r.r)*i)}${Gh(r.g+(o.g-r.g)*i)}${Gh(r.b+(o.b-r.b)*i)}`}var gt=(e,t,n,r,o=0)=>({x:e,y:t,width:n,height:r,radius:o}),we=(e,t,n,r,o,i)=>({type:"rect",...gt(e,t,n,r,o),fill:i}),Mo=(e,t,n)=>({type:"rect",...e,fill:n,hole:t}),rt=(e,t)=>({type:"polygon",points:e,fill:t}),In=(e,t,n="nonzero")=>({type:"path",d:e,fill:t,fillRule:n}),ky=(...e)=>e.filter(t=>t!==null),q6=e=>{let{size:t,gap:n,border:r,band:o,color:i,background:s,frame:a,fitLabel:c}=e,u=t+2*(r+n),l=u-2*r,f=t+2*n,p=o+f+o,m=l-2*n,h=a.textColor||qe;return {width:u,height:p,qrX:r+n,qrY:o+n,qrSize:t,shapes:[we(r,o,l,f,0,s),Mo(gt(0,0,u,p),gt(r,o,l,f),i)],label:c(e.text,u/2,o/2,o,m,h),extraLabels:ky(c(e.secondaryText,u/2,o+f+o/2,o,m,h,"secondaryText")),squareEdges:true,color:i}},W6=e=>{let{size:t,gap:n,border:r,band:o,color:i,background:s,frame:a,fitLabel:c}=e,u=t+2*(r+n),l=u-2*r,f=t*.07,p=Math.max(f-r,0),m=t*.025,h=t*.08,d=o+h+m;return {width:u,height:d+u,qrX:r+n,qrY:d+r+n,qrSize:t,shapes:[we(0,0,u,o,o/2,i),rt([[u/2-h,o-h/2],[u/2+h,o-h/2],[u/2,o+h]],i),we(r,d+r,l,l,p,s),Mo(gt(0,d,u,u,f),gt(r,d+r,l,l,p),i)],label:c(e.text,u/2,o/2,o,l-2*n,a.textColor||qe),squareEdges:false,color:i}},H6=e=>{let{size:t,gap:n,border:r,color:o,background:i,frame:s,fitLabel:a}=e,c=t+2*(r+n),u=c-2*r,l=t*.12,f=t+2*n,p=e.text?t*.2:r,m=r+f+p,h=t*.13,d=m-t*.02;return {width:c,height:m+h,qrX:r+n,qrY:r+n,qrSize:t,shapes:[we(0,0,c,m,l,o),In(M`M${c*.13} ${d}L${c*.05} ${m+h}`+M`Q${c*.16} ${m+h*.45} ${c*.32} ${d}Z`,o),we(r,r,u,f,Math.max(l-r,0),i)],label:a(e.text,c/2,r+f+p/2,p,u-2*n,s.textColor||qe),squareEdges:false,color:o}};function Fc(e,t,n,r,o,i,s,a){let c=[...e],u=o*.08,l=c.map(d=>Ey(d)*o),f=l.reduce((d,g)=>d+g,0)+u*Math.max(0,c.length-1),p=i==="top"?r-o*.35:r+o*.35,m=[],h=0;return c.forEach((d,g)=>{let _=l[g],b=(h+_/2)/p;if(h+=_+u,d.trim()==="")return;let y=i==="top"?-Math.PI/2-f/2/p+b:Math.PI/2+f/2/p-b;m.push({text:d,x:t+p*Math.cos(y),y:n+p*Math.sin(y),fontSize:o,maxWidth:o*2,color:s,rotate:y*180/Math.PI+(i==="top"?90:-90),field:a});}),m}var Y6=e=>{let{size:t,gap:n,color:r,background:o,frame:i,fontScale:s}=e,a=t*Math.SQRT1_2+n*.9,c=t*.21,u=a+c,l=a+c/2,f=u,p=i.textColor||qe,m=l*(140*Math.PI/180),h=b=>Math.min(c*.5*s,m/(Io(b)+.08*b.length)),d=e.text?Fc(e.text,f,f,l,h(e.text),"top",p,"text"):[],g=e.secondaryText?Fc(e.secondaryText,f,f,l,h(e.secondaryText),"bottom",p,"secondaryText"):[],_=c*.07;return {width:2*u,height:2*u,qrX:f-t/2,qrY:f-t/2,qrSize:t,shapes:[In(ee(f,f,a),o),In(ee(f,f,u)+ee(f,f,a),r,"evenodd"),In(ee(f-l,f,_)+ee(f+l,f,_),p)],label:null,extraLabels:[...d,...g],squareEdges:false,color:r}},X6=e=>{let{size:t,gap:n,color:r,background:o,frame:i,fitLabel:s}=e,a=t*.07,c=t+2*n,u=t*.3,l=t*.025,f=c+2*a,p=a+c+u,m=t*.015;return {width:f+l,height:p+l,qrX:a+n,qrY:a+n,qrSize:t,shapes:[we(l,l,f,p,m,_t(r,qe,.72)),we(0,0,f,p,m,r),we(a,a,c,c,0,o)],label:s(e.text,f/2,a+c+u/2,u*.8,c-2*n,i.textColor||qe),squareEdges:false,color:r}},K6=e=>{let{size:t,gap:n,color:r,background:o,frame:i,fitLabel:s}=e,a=t*.05,c=t*.17,u=t*.15,l=e.text?t*.17:0,f=t+2*n,p=n+t+(e.text?n*.5+l:n),m=f+2*a,h=c+p+u,d=t*.036,g=t*.03;return {width:m,height:h,qrX:a+n,qrY:c+n,qrSize:t,shapes:[we(0,0,m,h,t*.17,r),we(a,c,f,p,t*.06,o),we(m/2-t*.11,c/2-d/2,t*.22,d,d/2,o),we(m/2-t*.15,c+p+u/2-g/2,t*.3,g,g/2,o)],label:s(e.text,m/2,c+n+t+n*.5+l/2,l,f-2*n,i.textColor||r),squareEdges:false,color:r}},J6=e=>{let{size:t,gap:n,band:r,color:o,background:i,frame:s,fitLabel:a}=e,c=t*.05,u=t+2*n,l=u+2*c,f=ye(c+u+c*1.2),p=f+r,m=ye(t*.055),h=t*.04,d=M`M${h} 0H${l-h}A${h} ${h} 0 0 1 ${l} ${h}`+M`V${f-m}A${m} ${m} 0 0 0 ${l} ${f+m}`+M`V${p-h}A${h} ${h} 0 0 1 ${l-h} ${p}`+M`H${h}A${h} ${h} 0 0 1 0 ${p-h}`+M`V${f+m}A${m} ${m} 0 0 0 0 ${f-m}`+M`V${h}A${h} ${h} 0 0 1 ${h} 0Z`,g=[],_=t*.03,b=t*.022,y=t*.012;for(let S=m+b;S+_<=l-m-b/2;S+=_+b)g.push(U(S,f-y/2,_,y));return {width:l,height:p,qrX:c+n,qrY:c+n,qrSize:t,shapes:[In(d,o),we(c,c,u,u,t*.02,i),In(g.join(""),i)],label:a(e.text,l/2,f+r/2,r,u-2*n,s.textColor||qe),squareEdges:false,color:o}},eS=e=>{let{size:t,gap:n,border:r,band:o,color:i,background:s,frame:a,fitLabel:c}=e,u=t*.18,l=t*.05,f=t+2*(r+n),p=t*.06,m=Math.max(p-r,0),h=f+2*u,d=f-r,g=u*.5,_=d+l,b=g+l*2,y=u*.28,S=_t(i,"#000000",.28),v=_t(i,"#000000",.5);return {width:h,height:_+o,qrX:u+r+n,qrY:r+n,qrSize:t,shapes:[rt([[0,_],[b,_],[b,_+o],[0,_+o],[y,_+o/2]],S),rt([[h,_],[h-y,_+o/2],[h,_+o],[h-b,_+o],[h-b,_]],S),rt([[g,d+o],[g+l*1.6,d+o+l],[g,d+o+l]],v),rt([[h-g,d+o],[h-g,d+o+l],[h-g-l*1.6,d+o+l]],v),we(u+r,r,f-2*r,f-2*r,m,s),Mo(gt(u,0,f,f,p),gt(u+r,r,f-2*r,f-2*r,m),i),we(g,d,h-2*g,o,0,i)],label:c(e.text,h/2,d+o/2,o,h-2*g-2*n,a.textColor||qe),squareEdges:false,color:i}},tS=e=>{let{size:t,gap:n,band:r,color:o,background:i,frame:s,fitLabel:a}=e,c=t*.08,u=t+2*n,l=u+2*c,f=t*.05,p=f+n+t+n*.6,m=t*.14,h=p+m+r+t*.02,d=f+t*.32,g=t*.012,_=p+m-f;return {width:l,height:h,qrX:c+n,qrY:f+n,qrSize:t,shapes:[we(0,d,l,h-d,0,_t(o,qe,.45)),rt([[0,d],[l/2,0],[l,d]],_t(o,qe,.25)),we(c,f,u,_,0,i),Mo(gt(c-g,f-g,u+2*g,_+g),gt(c,f,u,_),o),rt([[0,p],[l/2,p+m],[l,p],[l,h],[0,h]],o)],label:a(e.text,l/2,p+m+r/2,r,u-2*n,s.textColor||qe),squareEdges:false,color:o}},nS=e=>{let{size:t,gap:n,band:r,color:o,background:i,frame:s,fitLabel:a}=e,c=t*.06,u=t+2*n,l=u+2*c,f=t*.24,p=t*.04,m=f*.48,h=t*.14,d=e.text?r:c,g=f+u+d,_=t*.04,b=M`M${h} 0H${l-h}L${l} ${h}`+M`V${g-_}A${_} ${_} 0 0 1 ${l-_} ${g}`+M`H${_}A${_} ${_} 0 0 1 0 ${g-_}V${h}Z`+ee(l/2,m,p);return {width:l,height:g,qrX:c+n,qrY:f+n,qrSize:t,shapes:[In(b,o,"evenodd"),In(ee(l/2,m,p*1.7)+ee(l/2,m,p),_t(o,qe,.35),"evenodd"),we(c,f,u,u,t*.02,i)],label:a(e.text,l/2,f+u+d/2,d,u-2*n,s.textColor||qe),squareEdges:false,color:o}},rS=e=>{let{size:t,color:n,background:r,frame:o,fitLabel:i}=e,s=t*.13,a=e.text?t*.26:s,c=e.secondaryText?t*.2:s,u=t+2*s,l=a+t+c,f=t*.03,p=t*.022,m=t*.045,h=t*.008,d=o.textColor||n,g=[we(0,0,u,l,f,r),Mo(gt(0,0,u,l,f),gt(p,p,u-2*p,l-2*p,Math.max(f-p,0)),n),Mo(gt(m,m,u-2*m,l-2*m),gt(m+h,m+h,u-2*(m+h),l-2*(m+h)),n)];if(e.text){let _=a-t*.075,b=t*.022;g.push(we(u*.3,_-h/2,u*.4,h,0,n),rt([[u/2,_-b],[u/2+b,_],[u/2,_+b],[u/2-b,_]],n));}return {width:u,height:l,qrX:s,qrY:a,qrSize:t,shapes:g,label:i(e.text,u/2,t*.115,t*.17,u-2*s,d),extraLabels:ky(i(e.secondaryText,u/2,a+t+c*.45,c*.8,u-2*s,d,"secondaryText")),squareEdges:false,color:n}},oS=e=>{let{size:t,gap:n,color:r,background:o,frame:i,fitLabel:s}=e,a=t*.025,c=t*.07,u=t*.03,l=t*.13,f=e.text?t*.17:0,p=n*1.25,m=t+2*p,h=m+2*c,d=m+2*c+f,g=h+2*a,_=d+2*a;return {width:g+u,height:_+u,qrX:a+c+p,qrY:a+c+p,qrSize:t,shapes:[we(u,u,g,_,l+a,_t(r,qe,.7)),we(0,0,g,_,l+a,qe),we(a,a,h,d,l,r),we(a+c,a+c,m,m,t*.04,o)],label:s(e.text,a+h/2,a+c+m+(c+f)/2,c+f,m-2*n,i.textColor||qe),squareEdges:false,color:r}};function Py(e,t,n,r){let o=e<t+r?t+r-e:e>t+n-r?e-(t+n-r):0;return r-Math.sqrt(Math.max(0,r*r-Math.min(o,r)**2))}function iS(e,t,n,r,o,i,s=48){let a=Math.max(n-r,0),c=e-2*r,u=new Set([r,e-r]);for(let g=0;g<=s;g++)u.add(e*g/s);let l=[...u].sort((g,_)=>g-_),f=e*.002,p=5,m=g=>Py(g,0,e,n),h=g=>r+Py(g,r,c,a),d=[];for(let g=0;g+1<l.length;g++){let _=l[g],b=Math.min(e,l[g+1]+(g+2<l.length?f:0)),y=_t(o,i,(_+b)/2/e),S=$=>Array.from({length:p},(w,A)=>{let C=A/(p-1);return $?b+(_-b)*C:_+(b-_)*C});_>=r-1e-9&&l[g+1]<=e-r+1e-9?d.push(rt([...S(false).map($=>[$,m($)]),...S(true).map($=>[$,h($)])],y),rt([...S(false).map($=>[$,t-h($)]),...S(true).map($=>[$,t-m($)])],y)):d.push(rt([...S(false).map($=>[$,m($)]),...S(true).map($=>[$,t-m($)])],y));}return d}var sS=e=>{let{size:t,gap:n,background:r,frame:o,fitLabel:i}=e,s=o.color||Uh.from,a=o.secondaryColor||Uh.to,c=t*.05,u=t+2*(c+n),l=e.text?t*.18:0,f=t+(e.text?n+l:2*n),p=f+2*c,m=t*.1;return {width:u,height:p,qrX:c+n,qrY:c+n,qrSize:t,shapes:[we(c,c,u-2*c,f,m-c,r),...iS(u,p,m,c,s,a)],label:i(e.text,u/2,c+n+t+l/2,l,u-2*c-2*n,o.textColor||_t(s,a,.5)),squareEdges:false,color:s}},aS=e=>{let{size:t,gap:n,color:r,background:o,frame:i,fitLabel:s}=e,a=t*.035,c=t*.2,u=t+2*(n+a),l=e.text?t*.2:0,f=u,p=f+l,m=(h,d,g,_)=>[[h,d],[h+g*c,d],[h+g*c,d+_*a],[h+g*a,d+_*a],[h+g*a,d+_*c],[h,d+_*c]];return {width:u,height:p,qrX:a+n,qrY:a+n,qrSize:t,shapes:[we(0,0,u,p,0,o),rt(m(0,0,1,1),r),rt(m(f,0,-1,1),r),rt(m(f,f,-1,-1),r),rt(m(0,f,1,-1),r)],label:s(e.text,u/2,f+l*.4,l,u-2*n,i.textColor||r),squareEdges:false,color:r}},Ry={"banner-top-bottom":q6,"speech-bubble-top":W6,"chat-bubble":H6,circle:Y6,polaroid:X6,phone:K6,ticket:J6,badge:eS,envelope:tS,tag:nS,"menu-card":rS,sticker:oS,"gradient-border":sS,focus:aS};var Yi=class extends Error{issues;constructor(t){super(`Invalid frame spec: ${t.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=t;}},My=new WeakMap;function Qh(e){if(e&&typeof e=="object"){let n=My.get(e);if(n)return n}if(e==null)throw new Yi(['A "custom" frame needs a spec']);let t=ar.safeParse(e);if(!t.success)throw new Yi(t.error.issues.map(n=>n.path.length>0?`${n.path.join(".")}: ${n.message}`:n.message));return typeof e=="object"&&My.set(e,t.data),t.data}function Vh(e){let t=Qh(e);return wo(t)/t.qr.size}function cS(e){let t=Ue(e,Me),n=Ae(t);return n&&n.a>=1?t:Me}function uS(e,t,n){let r=e.color||t.colors.frame,o=e.textColor||t.colors.text||r,i=e.secondaryColor||t.colors.accent||r,s=a=>{switch(a){case "frame":return r;case "text":return o;case "accent":return i;case "background":return n;default:return a}};return a=>typeof a=="string"?s(a):_t(s(a.mix[0]),s(a.mix[1]),a.amount)}function Iy(e,t,n=0,r=0){let o=gc(e);return o?db(o,t,n,r):""}function lS(e,t,n,r){return `M${x(e-n)} ${x(t)}A${x(n)} ${x(r)} 0 1 1 ${x(e+n)} ${x(t)}A${x(n)} ${x(r)} 0 1 1 ${x(e-n)} ${x(t)}Z`}function fS(e,t){let[n,r,o,i]=[e.x1*t,e.y1*t,e.x2*t,e.y2*t],s=Math.hypot(o-n,i-r),a=e.width*t/2,c=s>0?(o-n)/s:1,u=s>0?(i-r)/s:0,l=-u*a,f=c*a,p=(g,_)=>{let b=[n+c*g,r+u*g],y=[n+c*_,r+u*_];if(e.cap==="round"&&_-g>2*a){let S=[b[0]+c*a,b[1]+u*a],v=[y[0]-c*a,y[1]-u*a];return `M${x(S[0]-l)} ${x(S[1]-f)}L${x(v[0]-l)} ${x(v[1]-f)}A${x(a)} ${x(a)} 0 0 1 ${x(v[0]+l)} ${x(v[1]+f)}L${x(S[0]+l)} ${x(S[1]+f)}A${x(a)} ${x(a)} 0 0 1 ${x(S[0]-l)} ${x(S[1]-f)}Z`}return `M${x(b[0]-l)} ${x(b[1]-f)}L${x(y[0]-l)} ${x(y[1]-f)}L${x(y[0]+l)} ${x(y[1]+f)}L${x(b[0]+l)} ${x(b[1]+f)}Z`};if(!e.dash)return {type:"path",d:p(0,s),fillRule:"nonzero"};let m=e.dash[0]*t,h=m+e.dash[1]*t,d=[];for(let g=0;g+m<=s+1e-6;g+=h)d.push(p(g,g+m));return {type:"path",d:d.join(""),fillRule:"nonzero"}}function mS(e,t){switch(e.type){case "rect":return {type:"rect",x:e.x*t,y:e.y*t,width:e.width*t,height:e.height*t,radius:(e.radius??0)*t,...e.hole&&{hole:{x:e.hole.x*t,y:e.hole.y*t,width:e.hole.width*t,height:e.hole.height*t,radius:(e.hole.radius??0)*t}}};case "circle":return {type:"path",d:ee(e.cx*t,e.cy*t,e.r*t)+(e.hole?ee(e.cx*t,e.cy*t,e.hole*t):""),fillRule:e.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:lS(e.cx*t,e.cy*t,e.rx*t,e.ry*t),fillRule:"nonzero"};case "polygon":return {type:"polygon",points:e.points.map(([n,r])=>[n*t,r*t])};case "path":return {type:"path",d:Iy(e.d,t),fillRule:e.fillRule??"nonzero"};case "line":return fS(e,t);default:{let n=Bh(e.icon);return {type:"path",d:Iy(n.d,e.size*t/Zh,e.x*t,e.y*t),fillRule:n.fillRule}}}}function pS(e){if(e.type==="rect"){let{x:t,y:n,width:r,height:o,radius:i,hole:s}=e;return [...Gt(t,n,r,o,i,i),...s?Gt(s.x,s.y,s.width,s.height,s.radius,s.radius):[]]}return e.type==="polygon"?[...e.points.map(([t,n],r)=>r===0?{op:"M",x:t,y:n}:{op:"L",x:t,y:n}),{op:"Z"}]:en(e.d)}function dS(e,t,n){let r=pS(e),o=_c(r,.2),i=e.type==="rect"?e.hole?"evenodd":"nonzero":e.type==="path"?e.fillRule??"nonzero":"nonzero",s=t.direction==="vertical",a=g=>s?g[1]:g[0],c=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let g of o)for(let _ of g)c=Math.min(c,a(_)),u=Math.max(u,a(_));if(!(u>c))return [];let l=t.steps??32,f=n(t.from),p=n(t.to),m=u-c,h=m*.002,d=[];for(let g=0;g<l;g++){let _=c+m*g/l,b=Math.min(u,c+m*(g+1)/l+(g+1<l?h:0)),y=s?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:_,y1:b}:{x0:_,x1:b,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},S=o.map(v=>bc(v,y)).filter(v=>v.length>2);S.length!==0&&d.push({type:"path",d:gb(S),fill:_t(f,p,(g+.5)/l),fillRule:i});}return d}function hS(e,t,n){let r=mS(e,t);return typeof e.fill=="object"&&"gradient"in e.fill?dS(r,e.fill.gradient,n):[{...r,fill:n(e.fill)}]}function gS(e,t){let n=Math.min(e.maxLength??xe.maxTextLength,xe.maxTextLength),r=e.slot==="primary"?t.text??e.text:e.slot==="secondary"?t.secondaryText??e.text:e.text;return Pc(r,n)}function _S(e){return e===void 0||!Number.isFinite(e)?1:Math.min(vn,Math.max(bo,e))}function bS(e,t,n,r){let o=gS(e,t);if(!o)return [];let i=_S(t.fontScale),s=r(e.color),a=e.weight==="regular"?{fontWeight:400}:{};if(e.type==="curved"){let{cx:d,cy:g,radius:_,side:b,spread:y=140}=e.curve,S=_*n*(y*Math.PI/180),v=Math.min(e.fontSize*n*i,S/(Io(o)+.08*o.length));return Fc(o,d*n,g*n,_*n,v,b,s,e.id).map($=>({...$,...a}))}let c=e.box.x*n,u=e.box.y*n,l=e.box.width*n,f=e.box.height*n,p=(e.fontSize??e.box.height*.52)*n,m=Math.min(p*i,f*Cc,l/Io(o)),h=e.align??"middle";return [{text:o,x:h==="start"?c:h==="end"?c+l:c+l/2,y:u+f/2+m*.35,fontSize:m,maxWidth:l,color:s,...h!=="middle"&&{align:h},...a,field:e.id}]}function jh(e,t,n){let r=Qh(t.spec),o=e/r.qr.size,i=cS(n),s=uS(t,r,i),a=r.shapes.flatMap(m=>hS(m,o,s)),c=wo(r)*o;a.push({type:"rect",x:r.qr.x*o-c,y:r.qr.y*o-c,width:e+2*c,height:e+2*c,radius:(r.qr.radius??0)*o,fill:i});let u=r.labels.flatMap(m=>bS(m,t,o,s)),l=u[0],f=l&&l.rotate===void 0?l:null,p=r.bleed??"none";return {width:r.artboard.width*o,height:r.artboard.height*o,qrX:r.qr.x*o,qrY:r.qr.y*o,qrSize:e,shapes:a,label:f,extraLabels:f?u.slice(1):u,squareEdges:p!=="none",color:s(p==="none"?"frame":p)}}var zy="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",Wh=.08,yS="#000000",qh="#FFFFFF",Ty="data-qrdx-frame-label";function bt(e){return !!(e?.style&&e.style!=="none")}function Hh(e){return e.style===Bi?Vh(e.spec):Wh}function Ny(e){return (e.text??ah).trim().slice(0,Dt)}function Oy(e){return (e.secondaryText??"").trim().slice(0,Dt)}function $S(e){return e===void 0||!Number.isFinite(e)?1:Math.min(vn,Math.max(bo,e))}function xS(e,t,n,r,o,i,s,a){if(!e)return null;let c=Math.min(r*.52*s,o/Io(e));return {text:e,x:t,y:n+c*.35,fontSize:c,maxWidth:o,color:i,field:a}}function dr(e,t,n){if(t.style===Bi)return jh(e,t,n);let r=t.color||yS,o=Ue(n,Me),i=Ny(t),s=e*Wh,a=e*.04,c=e*.22,u=e+2*(a+s),l=u-2*a,f=l-2*s,p=a+s,m=$S(t.fontScale),h=(d,g,_,b,y,S,v="text")=>xS(d,g,_,b,y,S,m,v);if(Ay(t.style))return Ry[t.style]({size:e,frame:t,color:r,background:o,text:i,secondaryText:Oy(t),gap:s,border:a,band:c,fontScale:m,fitLabel:h});switch(t.style){case "banner-top":{let d=e+2*s;return {width:u,height:c+d+a,qrX:p,qrY:c+s,qrSize:e,shapes:[Xi(a,c,l,d,0,o),Dc(nn(0,0,u,c+d+a,0),nn(a,c,l,d,0),r)],label:h(i,u/2,c/2,c,f,t.textColor||qh),squareEdges:true,color:r}}case "border":case "rounded-border":{let d=i?e*.18:0,g=e+(i?s+d:2*s),_=g+2*a,b=t.style==="rounded-border"?e*.1:0,y=Math.max(b-a,0);return {width:u,height:_,qrX:p,qrY:a+s,qrSize:e,shapes:[Xi(a,a,l,g,y,o),Dc(nn(0,0,u,_,b),nn(a,a,l,g,y),r)],label:h(i,u/2,a+s+e+d/2,d,f,t.textColor||r),squareEdges:b===0,color:r}}case "speech-bubble":{let d=e*.07,g=Math.max(d-a,0),_=e*.025,b=e*.08,y=u+_+b;return {width:u,height:y+c,qrX:p,qrY:a+s,qrSize:e,shapes:[Xi(a,a,l,l,g,o),Dc(nn(0,0,u,u,d),nn(a,a,l,l,g),r),{type:"polygon",points:[[u/2-b,y+b/2],[u/2,u+_],[u/2+b,y+b/2]],fill:r},Xi(0,y,u,c,c/2,r)],label:h(i,u/2,y+c/2,c,f,t.textColor||qh),squareEdges:false,color:r}}default:{let d=e+2*s;return {width:u,height:a+d+c,qrX:p,qrY:a+s,qrSize:e,shapes:[Xi(a,a,l,d,0,o),Dc(nn(0,0,u,a+d+c,0),nn(a,a,l,d,0),r)],label:h(i,u/2,a+d+c/2,c,f,t.textColor||qh),squareEdges:true,color:r}}}}function nn(e,t,n,r,o){return {x:e,y:t,width:n,height:r,radius:o}}function Xi(e,t,n,r,o,i){return {type:"rect",...nn(e,t,n,r,o),fill:i}}function Dc(e,t,n){return {type:"rect",...e,fill:n,hole:t}}function rn(e,t){if(!bt(t))return {width:e,height:e};let{width:n,height:r}=dr(e,t);return {width:n,height:r}}var ge=e=>ye(e,2);function Ly({x:e,y:t,width:n,height:r,radius:o}){let i=ge(Math.min(o,n/2,r/2)),[s,a,c,u]=[ge(e),ge(t),ge(n),ge(r)];return i<=0?M`M${s} ${a}h${c}v${u}h${-c}z`:M`M${s+i} ${a}h${ge(c-2*i)}a${i} ${i} 0 0 1 ${i} ${i}`+M`v${ge(u-2*i)}a${i} ${i} 0 0 1 ${-i} ${i}`+M`h${ge(-(c-2*i))}a${i} ${i} 0 0 1 ${-i} ${-i}`+M`v${ge(-(u-2*i))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function wS(e,t){return e.type==="rect"&&e.hole?k("path",{d:Ly(e)+Ly(e.hole),fill:e.fill,fillRule:"evenodd"},t):e.type==="polygon"?k("polygon",{fill:e.fill,points:e.points.map(([n,r])=>`${ge(n)},${ge(r)}`).join(" ")},t):e.type==="path"?k("path",{d:e.d,fill:e.fill,...e.fillRule==="evenodd"&&{fillRule:"evenodd"}},t):k("rect",{fill:e.fill,height:ge(e.height),width:ge(e.width),x:ge(e.x),y:ge(e.y),...e.radius>0&&{rx:ge(e.radius),ry:ge(e.radius)}},t)}function Zc(e,t){let{size:n,frame:r,bgColor:o,svgProps:i,markLabels:s}=t,a=dr(n,r,o),c=Fy(a),u=ge(a.width),l=ge(a.height);return Se("svg",{height:l,viewBox:`0 0 ${u} ${l}`,width:u,xmlns:"http://www.w3.org/2000/svg",...i,children:[k("g",{"data-qrdx-frame":r.style,children:a.shapes.map((f,p)=>wS(f,p))}),So(e,{x:ge(a.qrX),y:ge(a.qrY),width:n,height:n}),c.map((f,p)=>k("text",{"data-max-width":ge(f.maxWidth),fill:f.color,fontFamily:zy,fontSize:ge(f.fontSize),fontWeight:f.fontWeight??700,textAnchor:f.align??"middle",x:ge(f.x),y:ge(f.y),...f.rotate&&{transform:`rotate(${ge(f.rotate)} ${ge(f.x)} ${ge(f.y)})`},...s&&f.field&&{[Ty]:f.field},children:f.text},p))]})}function Fy(e){return [...e.label?[e.label]:[],...e.extraLabels??[]]}var SS={2:6,3:12};function Dy(e){let t=[e.start],n=e.start;for(let r of e.segments){let o=r.at(-1);if(r.length===1)t.push(o);else {let i=SS[r.length];for(let s=1;s<=i;s++){let a=s/i,c=1-a;if(r.length===2){let[u]=r;t.push([c*c*n[0]+2*c*a*u[0]+a*a*o[0],c*c*n[1]+2*c*a*u[1]+a*a*o[1]]);}else {let[u,l]=r;t.push([c*c*c*n[0]+3*c*c*a*u[0]+3*c*a*a*l[0]+a*a*a*o[0],c*c*c*n[1]+3*c*c*a*u[1]+3*c*a*a*l[1]+a*a*a*o[1]]);}}}n=o;}return t}function By(e,t){let n=[];for(let r of e)for(let o=0;o<r.length;o++){let[i,s]=r[o],[a,c]=r[(o+1)%r.length];s<=t!=c<=t&&n.push(i+(t-s)/(c-s)*(a-i));}return n.sort((r,o)=>r-o)}function Gy(e,t){let n=0;for(let r of e)if(r<t)n++;else break;return n%2===1}function vS(e,t,n){return Gy(By(e,n),t)}function Uy(e){let t=new Map;return (n,r)=>{let o=t.get(r);return o||(o=By(e,r),t.set(r,o)),Gy(o,n)}}function CS(e,t,n,r){let o=n[0]-e,i=n[1]-t,s=r[0]-n[0],a=r[1]-n[1],c=l=>Math.max(Math.abs(o+l*s),Math.abs(i+l*a)),u=Math.min(c(0),c(1));for(let[l,f]of [[i-o,s-a],[-(o+i),s+a]])if(f!==0){let p=l/f;p>0&&p<1&&(u=Math.min(u,c(p)));}return u}function PS(e,t,n){if(!vS(e,t,n))return 0;let r=Number.POSITIVE_INFINITY;for(let o of e)for(let i=0;i<o.length;i++)r=Math.min(r,CS(t,n,o[i],o[(i+1)%o.length]));return Number.isFinite(r)?r:0}function AS(e){let t=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let i of e)for(let[s,a]of i)t=Math.min(t,s),n=Math.min(n,a),r=Math.max(r,s),o=Math.max(o,a);return {x0:t,y0:n,x1:r,y1:o}}function Qy(e){let t=e.map(Dy),n=AS(t),r=n.x1-n.x0,o=n.y1-n.y0;if(!(r>0&&o>0))return null;let i=(h,d)=>{let g=Math.max(h-n.x0,n.x1-h,d-n.y0,n.y1-d);return g>0?PS(t,h,d)/(2*g):0},s={cx:n.x0+r/2,cy:n.y0+o/2,value:0};s.value=i(s.cx,s.cy);let a=32;for(let h=1;h<a;h++)for(let d=1;d<a;d++){let g=n.x0+r*d/a,_=n.y0+o*h/a,b=i(g,_);b>s.value&&(s={cx:g,cy:_,value:b});}let c=r/a,u=o/a;for(let h=0;h<6;h++){let d=s;for(let g=-2;g<=2;g++)for(let _=-2;_<=2;_++){let b=d.cx+c*_/2,y=d.cy+u*g/2,S=i(b,y);S>s.value&&(s={cx:b,cy:y,value:S});}c/=2,u/=2;}if(s.value<=0)return null;let f=.5/Math.max(s.cx-n.x0,n.x1-s.cx,s.cy-n.y0,n.y1-s.cy),p=([h,d])=>[.5+(h-s.cx)*f,.5+(d-s.cy)*f],m=e.map(h=>({start:p(h.start),segments:h.segments.map(d=>d.map(p))}));return {rings:m,polygons:m.map(Dy),half:s.value}}function Vy(e,t){let n=([o,i])=>`${x(o*t)} ${x(i*t)}`,r="";for(let o of e.rings){r+=`M${n(o.start)}`;for(let i of o.segments){let s=i.length===1?"L":i.length===2?"Q":"C";r+=s+i.map(n).join(" ");}r+="Z";}return r}var ES={start:[0,-0.58],segments:[[[.2,-0.92],[1,-0.97],[1,-0.3]],[[1,.3],[.62,.6],[0,.92]],[[-0.62,.6],[-1,.3],[-1,-0.3]],[[-1,-0.97],[-0.2,-0.92],[0,-0.58]]]},Zy;function jy(){return Zy??=Qy([ES]),Zy}function kS(e){let{width:t,height:n,cells:r}=e;return Number.isInteger(t)&&Number.isInteger(n)&&t>=Ut&&n>=Ut&&t<=Et&&n<=Et&&typeof r=="string"&&r.length===t*n&&/^[01]*$/.test(r)?(o,i)=>o>=0&&i>=0&&o<t&&i<n&&r[i*t+o]==="1":null}var on=([e,t])=>`${e},${t}`;function RS(e,t,n){let r=(c,u)=>e(c-1,u-1),o=new Map,i=(c,u)=>{for(let[l,f]of [[c,u],[u,c]]){let p=o.get(on(l))??[];p.push(f),o.set(on(l),p);}};for(let c=0;c<=n;c++)for(let u=0;u<=t;u++){let l=r(u,c),f=r(u+1,c),p=r(u+1,c+1),m=r(u,c+1),h=[u,c-.5],d=[u+.5,c],g=[u,c+.5],_=[u-.5,c];switch((l?8:0)+(f?4:0)+(p?2:0)+(m?1:0)){case 1:case 14:i(_,g);break;case 2:case 13:i(g,d);break;case 3:case 12:i(_,d);break;case 4:case 11:i(h,d);break;case 6:case 9:i(h,g);break;case 7:case 8:i(_,h);break;case 5:i(h,d),i(_,g);break;case 10:i(_,h),i(g,d);break;}}let s=[],a=new Set;for(let[c,u]of o){if(a.has(c)||u.length===0)continue;let[l,f]=c.split(",").map(Number),p=[[l,f]];a.add(c);let m=[l,f],h=u[0];for(;!a.has(on(h));){a.add(on(h)),p.push(h);let d=MS(o.get(on(h))??[],m,a);if(!d)break;m=h,h=d;}p.length>=3&&s.push(IS(p));}return s}function MS(e,t,n){let r=on(t);return e.find(o=>on(o)!==r&&!n.has(on(o)))??e.find(o=>on(o)!==r)}function IS(e){let t=[];for(let n=0;n<e.length;n++){let r=e[(n-1+e.length)%e.length],o=e[n],i=e[(n+1)%e.length],s=(o[0]-r[0])*(i[1]-o[1])-(o[1]-r[1])*(i[0]-o[0]);Math.abs(s)>1e-9&&t.push(o);}return t.length>=3?t:e}function LS(e){let t=(i,s)=>[(i[0]+s[0])/2,(i[1]+s[1])/2],n=e.length,r=t(e[n-1],e[0]),o=e.map((i,s)=>[i,t(i,e[(s+1)%n])]);return {start:r,segments:o}}var Ki=new Map;function Yh(e){let t=`${e.width}x${e.height}:${e.cells}`,n=Ki.get(t);if(n)return n;let r=kS(e),o;if(!r)o={outline:null,problem:"invalid"};else if(e.cells.includes("1")){let i=RS(r,e.width,e.height),s=i.length>0?Qy(i.map(LS)):null;o=s&&2*s.half>=wh?{outline:s,problem:null}:{outline:null,problem:s?"thin":"empty"};}else o={outline:null,problem:"empty"};return Ki.size>16&&Ki.delete(Ki.keys().next().value),Ki.set(t,o),o}var zS=1,qy=.5,Wy=.5,TS=.5;function hr(e){return Math.max(e,xh)}function Bc(e){return e==="heart"?jy():typeof e=="object"&&e?.type==="silhouette"?Yh(e).outline:null}function Xh(e){return e==="circle"||Bc(e)!==null}var NS={invalid:"This silhouette isn't a valid shape grid.",empty:"No shape found: use a picture with a dark or opaque shape on a light or clear background.",thin:"This shape is too thin to hold the code with its quiet zone. Try a rounder, fuller shape."};function OS(e){let{outline:t,problem:n}=Yh(e);if(t&&!n)return {ok:true,share:2*t.half};let r=n??"invalid";return {ok:false,reason:r,message:NS[r]}}function ot(e,t,n){if(n==="circle"){let s=hr(t),a=(e/2+s)*Math.SQRT2+zS;return Math.ceil(a-e/2)}let r=Bc(n);if(!r)return t;let o=hr(t),i=(e+2*(o+TS))/(2*r.half);return Math.ceil((i-e)/2-1e-9)}function Hy(e){let t=e>>>0;return ()=>{t=t+1831565813>>>0;let n=t;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function FS(e,t,n){let r=ot(t,n,"circle"),o=hr(n),i=t+2*r,s=i/2,a=s-qy-.5,c=Hy(Number.parseInt(pr(e),36)||1),u=r-o,l=r+t+o;return Array.from({length:i},(f,p)=>Array.from({length:i},(m,h)=>{let d=c()<Wy;return h>=u&&h<l&&p>=u&&p<l?false:d&&Math.hypot(h+.5-s,p+.5-s)<=a}))}var DS=Array.from({length:8},(e,t)=>{let n=t*Math.PI/4;return [Math.cos(n),Math.sin(n)]});function Yy(e,t,n,r){if(r==="circle")return FS(e,t,n);let o=Bc(r);if(!o)return null;let i=ot(t,n,r),s=hr(n),a=t+2*i,c=Uy(o.polygons),u=.5+qy,l=(h,d)=>{let g=h+.5,_=d+.5;return c(g/a,_/a)?DS.every(([b,y])=>c((g+b*u)/a,(_+y*u)/a)):false},f=Hy(Number.parseInt(pr(e),36)||1),p=i-s,m=i+t+s;return Array.from({length:a},(h,d)=>Array.from({length:a},(g,_)=>{let b=f()<Wy;return _>=p&&_<m&&d>=p&&d<m?false:b&&l(_,d)}))}function Kh(e,t){if(e==="circle")return {circle:t/2};let n=Bc(e);return n?{path:Vy(n,t)}:null}function ZS(e,t){let n=Kh(e,t);return n?"circle"in n?ee(t/2,t/2,n.circle):n.path:null}function BS(e){return e==="top-left"?0:e==="top-right"?1:3}function Gc(e,t,n,r="circle",o="top-left"){let i=n*2,s=n,a=i/3;switch(r){case "leaf":case "leaf-reverse":case "drop":case "drop-reverse":{let c=BS(o),u=(c+2)%4,l=1.3*a,f=.7*a,p=h=>{switch(r){case "leaf":return h===c||h===u;case "leaf-reverse":return !(h===c||h===u);case "drop":return h===c;default:return h===u}},m=[0,1,2,3].map(h=>p(h)?f:l);return k("path",{d:U(e-n,t-n,i,i,m)})}case "extra-rounded":return k("path",{d:U(e-n,t-n,i,i,1.15*a)});case "plus":{let c=1.15*a,u=n;return k("path",{d:fe([[e-c,t-u],[e+c,t-u],[e+c,t-c],[e+u,t-c],[e+u,t+c],[e+c,t+c],[e+c,t+u],[e-c,t+u],[e-c,t+c],[e-u,t+c],[e-u,t-c],[e-c,t-c]])})}case "cross-rounded":{let c=1.15*a,u=.5*a;return k("path",{d:U(e-n,t-c,i,2*c,u)+U(e-c,t-n,2*c,i,u)})}case "hexagon":return k("path",{d:fe(Ao(e,t,1.72*a,6))});case "octagon":return k("path",{d:fe(Ao(e,t,n/Math.cos(Math.PI/8),8,22.5))});case "flower":{let c=.6*a,u=.9*a;return k("path",{d:ee(e-c,t-c,u)+ee(e+c,t-c,u)+ee(e+c,t+c,u)+ee(e-c,t+c,u)+ee(e,t,1.2*a)})}case "heart":return k("path",{d:ko(e,t+.12*a,3.5*a)});case "squircle":return k("path",{d:fe(Wi(e,t,n,n,4,64))});case "dots":{let c=[];for(let u of [-1,0,1])for(let l of [-1,0,1])c.push(ee(e+l*a*.82,t+u*a*.82,.58*a));return k("path",{d:c.join("")})}case "square":return k("rect",{height:x(i),transform:M`rotate(0,${e},${t})`,width:x(i),x:x(e-s),y:x(t-s)});case "rounded":return k("rect",{height:x(i),rx:x(n*.5),ry:x(n*.5),transform:M`rotate(0,${e},${t})`,width:x(i),x:x(e-s),y:x(t-s)});case "diamond":return k("path",{d:M`M ${e-s*.714286} ${t-s*.714286}v ${i*.714286}h ${i*.714286}v -${i*.714286}z`,transform:M`rotate(45,${e},${t})`});case "message":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(25)} ${l(35.714285714285715)}v ${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, ${10.714285714285714*c} ${10.714285714285714*c}h ${19.285714285714285*c}v -${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} -${10.714285714285714*c}h -${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} ${10.714285714285714*c}`;return k("path",{clipRule:"evenodd",d:f,transform:M`rotate(0,${e},${t})`})}case "message-reverse":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(25)} ${l(35.714285714285715)}v ${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, ${10.714285714285714*c} ${10.714285714285714*c}h ${19.285714285714285*c}v -${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} -${10.714285714285714*c}h -${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} ${10.714285714285714*c}`;return k("path",{clipRule:"evenodd",d:f,transform:M`rotate(-180,${e},${t})`})}case "diya":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(25)} ${l(35.714285714285715)}v ${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, ${10.714285714285714*c} ${10.714285714285714*c}h ${19.285714285714285*c}v -${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} -${10.714285714285714*c}h -${8.571428571428571*c}H ${u(25)}z`;return k("path",{clipRule:"evenodd",d:f,transform:M`rotate(0,${e},${t})`})}case "diya-reverse":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(25)} ${l(35.714285714285715)}v ${19.285714285714285*c}h ${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, ${10.714285714285714*c} -${10.714285714285714*c}v -${19.285714285714285*c}h -${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} ${10.714285714285714*c}z`;return k("path",{clipRule:"evenodd",d:f,transform:M`rotate(0,${e},${t})`})}case "rounded-triangle":{let c=i/21,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(33.57142857142857)} ${l(29.285714285714285)}h ${12.857142857142856*c}c ${4.285714285714286*c} 0 ${4.285714285714286*c} ${4.285714285714286*c} ${4.285714285714286*c} ${4.285714285714286*c}v ${12.857142857142856*c}c 0 ${4.285714285714286*c} -${4.285714285714286*c} ${4.285714285714286*c} -${4.285714285714286*c} ${4.285714285714286*c}h -${12.857142857142856*c}c -${4.285714285714286*c} 0 -${4.285714285714286*c} -${4.285714285714286*c} -${4.285714285714286*c} -${4.285714285714286*c}v -${12.857142857142856*c}c 0 -${4.285714285714286*c} ${4.285714285714286*c} -${4.285714285714286*c} ${4.285714285714286*c} -${4.285714285714286*c}z`;return k("path",{d:f,transform:M`rotate(45,${e},${t})`})}case "star":{let c=i/27,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(38.84615384615385)},${l(26.546153846153846)}c${.6692307692307691*c},-${1.0153846153846153*c},${2.215384615384615*c},-${1.0153846153846153*c},${2.884615384615384*c},0l${4.038461538461538*c},${6.069230769230768*c}c${.23076923076923075*c},${.3461538461538461*c},${.6*c},${.6*c},${1.0153846153846153*c},${.7153846153846153*c}l${7.223076923076922*c},${1.823076923076923*c}c${1.2*c},${.3*c},${1.6846153846153844*c},${1.7076923076923076*c},${.8999999999999999*c},${2.6538461538461533*c}l-${4.73076923076923*c},${5.584615384615384*c}c-${.2769230769230769*c},${.3230769230769231*c},-${.41538461538461535*c},${.7384615384615384*c},-${.3923076923076923*c},${1.1307692307692307*c}l${.4384615384615384*c},${7.199999999999999*c}c${.06923076923076922*c},${1.2*c},-${1.1769230769230767*c},${2.0769230769230766*c},-${2.3307692307692305*c},${1.6384615384615382*c}l-${6.9692307692307685*c},-${2.6076923076923073*c}c-${.3923076923076923*c},-${.16153846153846155*c},-${.8538461538461538*c},-${.16153846153846155*c},-${1.2461538461538462*c},0l-${6.9692307692307685*c},${2.6076923076923073*c}c-${1.1538461538461537*c},${.4384615384615384*c},-${2.4*c},-${.4384615384615384*c},-${2.3307692307692305*c},-${1.6384615384615382*c}l${.4384615384615384*c},-${7.199999999999999*c}c${.023076923076923075*c},-${.41538461538461535*c},-${.11538461538461538*c},-${.8307692307692307*c},-${.3923076923076923*c},-${1.1307692307692307*c}l-${4.73076923076923*c},-${5.584615384615384*c}c-${.7846153846153846*c},-${.923076923076923*c},-${.3230769230769231*c},-${2.3307692307692305*c},${.8999999999999999*c},-${2.6538461538461533*c}l${7.223076923076922*c},-${1.823076923076923*c}c${.41538461538461535*c},-${.11538461538461538*c},${.7846153846153846*c},-${.3461538461538461*c},${1.0153846153846153*c},-${.7153846153846153*c}l${4.038461538461538*c},-${6.069230769230768*c}z`;return k("path",{clipRule:"evenodd",d:f,transform:M`rotate(0,${e},${t})`})}case "banner":{let c=i/28;return k("g",{transform:M`translate(${e-40*c},${t-40*c}) scale(${x(c,6)})`,children:k("path",{clipRule:"evenodd",d:"M38.235 26.104C38.759 25.677, 39.51 25.677, 40.034 26.104L41.776 27.52C42.091 27.777, 42.501 27.887, 42.902 27.822L45.118 27.466C45.785 27.359, 46.436 27.735, 46.677 28.366L47.477 30.464C47.621 30.843, 47.921 31.143, 48.301 31.288L50.399 32.088C51.03 32.328, 51.406 32.979, 51.298 33.646L50.942 35.863C50.878 36.264, 50.988 36.674, 51.244 36.989L52.661 38.73C53.087 39.254, 53.087 40.006, 52.661 40.53L51.244 42.271C50.988 42.587, 50.878 42.996, 50.942 43.397L51.298 45.614C51.406 46.281, 51.03 46.932, 50.399 47.173L48.301 47.972C47.921 48.117, 47.621 48.417, 47.477 48.797L46.677 50.894C46.436 51.526, 45.785 51.901, 45.118 51.794L42.902 51.438C42.501 51.374, 42.091 51.483, 41.776 51.74L40.034 53.157C39.51 53.583, 38.759 53.583, 38.235 53.157L36.493 51.74C36.178 51.483, 35.768 51.374, 35.367 51.438L33.15 51.794C32.483 51.901, 31.833 51.526, 31.592 50.894L30.792 48.797C30.647 48.417, 30.347 48.117, 29.968 47.972L27.87 47.173C27.239 46.932, 26.863 46.281, 26.97 45.614L27.326 43.397C27.391 42.996, 27.281 42.587, 27.025 42.271L25.608 40.53C25.182 40.006, 25.182 39.254, 25.608 38.73L27.025 36.989C27.281 36.674, 27.391 36.264, 27.326 35.863L26.97 33.646C26.863 32.979, 27.239 32.328, 27.87 32.088L29.968 31.288C30.347 31.143, 30.647 30.843, 30.792 30.464L31.592 28.366C31.833 27.735, 32.483 27.359, 33.15 27.466L35.367 27.822C35.768 27.887, 36.178 27.777, 36.493 27.52L38.235 26.104Z"})})}default:return k("circle",{cx:x(e),cy:x(t),r:x(n),transform:M`rotate(0,${e},${t})`})}}function Lo(e,t,n,r){let o=e==="top-left"?0:e==="top-right"?1:3,i=(o+2)%4;return [0,1,2,3].map(s=>s===o||r&&s===i?n:t)}function Xy(e,t,n,r){return [[e+r,t],[e+n-r,t],[e+n,t+r],[e+n,t+n-r],[e+n-r,t+n],[e+r,t+n],[e,t+n-r],[e,t+r]]}function Ky(e,t,n,r){let o=n/7,i=Math.max(0,(r+Math.SQRT2-2)*o);return fe(Xy(e,t,n,r*o))+fe(Xy(e+o,t+o,5*o,i))}function Jy(e,t,n,r,o=false){let i=n/7,s=a=>o?Lo(r,0,a,true):Lo(r,a,0,true);return U(e,t,n,n,s(2.5*i))+U(e+i,t+i,5*i,5*i,s(1.5*i))}function GS(e,t,n,r){let o=n/7;return U(e,t,n,n,Lo(r,2.6*o,0,false))+U(e+o,t+o,5*o,5*o,Lo(r,1.6*o,0,false))}function US(e,t,n){let r=n/7,o=e+n/2,i=t+n/2;return fe(Wi(o,i,3.5*r,3.5*r,4,96))+fe(Wi(o,i,2.5*r,2.5*r,4,96))}function e2(e,t,n,r,o){let i=r,s=n/2,a=(s-i)*.55,c=(u,l)=>M`${e+u} ${t+l}`;return M`M${c(i,0)}`+M`C${c(i+a,0)} ${c(s-a,o)} ${c(s,o)}`+M`C${c(s+a,o)} ${c(n-i-a,0)} ${c(n-i,0)}`+M`A${i} ${i} 0 0 1 ${c(n,i)}`+M`C${c(n,i+a)} ${c(n-o,s-a)} ${c(n-o,s)}`+M`C${c(n-o,s+a)} ${c(n,n-i-a)} ${c(n,n-i)}`+M`A${i} ${i} 0 0 1 ${c(n-i,n)}`+M`C${c(n-i-a,n)} ${c(s+a,n-o)} ${c(s,n-o)}`+M`C${c(s-a,n-o)} ${c(i+a,n)} ${c(i,n)}`+M`A${i} ${i} 0 0 1 ${c(0,n-i)}`+M`C${c(0,n-i-a)} ${c(o,s+a)} ${c(o,s)}`+M`C${c(o,s-a)} ${c(0,i+a)} ${c(0,i)}`+M`A${i} ${i} 0 0 1 ${c(i,0)}Z`}function QS(e,t,n){let r=n/7,o=.12*r;return e2(e,t,n,1.4*r,o)+e2(e+r,t+r,5*r,.7*r,o)}function t2(e,t,n,r,o,i){let s=n/2,a=(c,u)=>M`${e+c} ${t+u}`;return M`M${a(r,0)}H${e+n-r}`+M`A${r} ${r} 0 0 1 ${a(n,r)}`+M`V${t+o}`+M`C${a(n,o+1.55*i)} ${a(s+1.6*i,n)} ${a(s,n)}`+M`C${a(s-1.6*i,n)} ${a(0,o+1.55*i)} ${a(0,o)}`+M`V${t+r}A${r} ${r} 0 0 1 ${a(r,0)}Z`}function VS(e,t,n){let r=n/7;return t2(e,t,n,.7*r,3.9*r,r)+t2(e+r,t+r,5*r,.35*r,2.7*r,.8*r)}function jS(e,t,n,r){let o=n/7;return U(e,t,n,n,Lo(r,.5*o,2.5*o,false))+U(e+o,t+o,5*o,5*o,Lo(r,.25*o,1.5*o,false))}function qS(e,t,n){let r=n/7;return M`M ${e} ${t}v ${n}h ${n}v -${n}z`+M`M ${e+r} ${t+r}h ${5*r}v ${5*r}h -${5*r}z`}function WS(e,t,n){let r=n/7,o=r*.875,i=r*.4375,s=M`M ${e+o} ${t}`+M`h ${n-2*o}`+M`a ${o} ${o} 0 0 1 ${o} ${o}`+M`v ${n-2*o}`+M`a ${o} ${o} 0 0 1 ${-o} ${o}`+M`h ${-(n-2*o)}`+M`a ${o} ${o} 0 0 1 ${-o} ${-o}`+M`v ${-(n-2*o)}`+M`a ${o} ${o} 0 0 1 ${o} ${-o}z`,a=M`M ${e+r+i} ${t+r}`+M`h ${5*r-2*i}`+M`a ${i} ${i} 0 0 1 ${i} ${i}`+M`v ${5*r-2*i}`+M`a ${i} ${i} 0 0 1 ${-i} ${i}`+M`h ${-(5*r-2*i)}`+M`a ${i} ${i} 0 0 1 ${-i} ${-i}`+M`v ${-(5*r-2*i)}`+M`a ${i} ${i} 0 0 1 ${i} ${-i}z`;return s+a}function HS(e,t,n){let r=e+n/2,o=t+n/2,i=ye(n/2),s=ye(n*(2.5/7));return M`M ${r-i} ${o}`+M`a ${i} ${i} 0 1 0 ${i*2} 0`+M`a ${i} ${i} 0 1 0 ${-i*2} 0z`+M`M ${r-s} ${o}`+M`a ${s} ${s} 0 1 1 ${s*2} 0`+M`a ${s} ${s} 0 1 1 ${-s*2} 0z`}function YS(e,t,n){let r=n/74.7002,o=a=>a*r+e,i=a=>a*r+t;return M`M${o(37.3496)} ${i(0)}C${o(39.2939)} ${i(0)} ${o(40.9948)} ${i(1.03842)} ${o(41.9287)} ${i(2.59082)}C${o(43.2293)} ${i(1.34013)} ${o(45.1347)} ${i(.780267)} ${o(47.0098)} ${i(1.28027)}C${o(48.8871)} ${i(1.78928)} ${o(50.261)} ${i(3.23767)} ${o(50.7578)} ${i(4.98438)}C${o(52.3454)} ${i(4.0996)} ${o(54.3432)} ${i(4.047)} ${o(56.0303)} ${i(5.01953)}C${o(57.7094)} ${i(5.98752)} ${o(58.6586)} ${i(7.73647)} ${o(58.6924)} ${i(9.5459)}C${o(60.4517)} ${i(9.10661)} ${o(62.3883)} ${i(9.57215)} ${o(63.7598)} ${i(10.9502)}C${o(65.1282)} ${i(12.3253)} ${o(65.5963)} ${i(14.2585)} ${o(65.1641)} ${i(16.0127)}C${o(66.974)} ${i(16.044)} ${o(68.7242)} ${i(16.9982)} ${o(69.7002)} ${i(18.6797)}C${o(70.6781)} ${i(20.3647)} ${o(70.6241)} ${i(22.3635)} ${o(69.7402)} ${i(23.9502)}C${o(71.4776)} ${i(24.4496)} ${o(72.9194)} ${i(25.8232)} ${o(73.4199)} ${i(27.7002)}C${o(73.927)} ${i(29.5707)} ${o(73.3661)} ${i(31.4794)} ${o(72.1104)} ${i(32.7822)}C${o(73.6621)} ${i(33.7163)} ${o(74.7002)} ${i(35.4166)} ${o(74.7002)} ${i(37.3604)}C${o(74.7001)} ${i(39.307)} ${o(73.6582)} ${i(41.0084)} ${o(72.1025)} ${i(41.9414)}C${o(73.357)} ${i(43.245)} ${o(73.9207)} ${i(45.1525)} ${o(73.4199)} ${i(47.0303)}C${o(72.9187)} ${i(48.9027)} ${o(71.4782)} ${i(50.2735)} ${o(69.7383)} ${i(50.7734)}C${o(70.6201)} ${i(52.3601)} ${o(70.6716)} ${i(54.3549)} ${o(69.7002)} ${i(56.04)}C${o(68.7237)} ${i(57.7225)} ${o(66.9721)} ${i(58.6729)} ${o(65.1611)} ${i(58.7031)}C${o(65.598)} ${i(60.4623)} ${o(65.131)} ${i(62.3982)} ${o(63.7598)} ${i(63.7695)}C${o(62.3847)} ${i(65.138)} ${o(60.4515)} ${i(65.6061)} ${o(58.6973)} ${i(65.1738)}C${o(58.6635)} ${i(66.9833)} ${o(57.7094)} ${i(68.7322)} ${o(56.0303)} ${i(69.7002)}C${o(54.3461)} ${i(70.6777)} ${o(52.348)} ${i(70.6248)} ${o(50.7617)} ${i(69.7422)}C${o(50.2643)} ${i(71.4831)} ${o(48.8896)} ${i(72.9284)} ${o(47.0098)} ${i(73.4297)}C${o(45.1389)} ${i(73.9368)} ${o(43.2296)} ${i(73.3763)} ${o(41.9268)} ${i(72.1201)}C${o(40.9927)} ${i(73.6717)} ${o(39.2932)} ${i(74.71)} ${o(37.3496)} ${i(74.71)}C${o(35.4051)} ${i(74.7098)} ${o(33.7042)} ${i(73.6711)} ${o(32.7705)} ${i(72.1182)}C${o(31.4697)} ${i(73.3758)} ${o(29.5597)} ${i(73.9418)} ${o(27.6797)} ${i(73.4404)}V${i(73.4502)}C${o(25.8065)} ${i(72.9422)} ${o(24.434)} ${i(71.4985)} ${o(23.9346)} ${i(69.7568)}C${o(22.3504)} ${i(70.6301)} ${o(20.3591)} ${i(70.6781)} ${o(18.6797)} ${i(69.71)}C${o(16.9957)} ${i(68.7391)} ${o(16.045)} ${i(66.9831)} ${o(16.0166)} ${i(65.168)}C${o(14.2547)} ${i(65.6091)} ${o(12.3134)} ${i(65.1435)} ${o(10.9395)} ${i(63.7695)}C${o(9.5687)} ${i(62.3919)} ${o(9.10168)} ${i(60.454)} ${o(9.53809)} ${i(58.6973)}C${o(7.72791)} ${i(58.6641)} ${o(5.97815)} ${i(57.71)} ${o(5.00977)} ${i(56.0303)}C${o(4.03552)} ${i(54.3517)} ${o(4.08377)} ${i(52.3649)} ${o(4.95801)} ${i(50.7812)}C${o(3.21705)} ${i(50.2839)} ${o(1.77087)} ${i(48.9101)} ${o(1.26953)} ${i(47.0303)}V${i(47.0205)}C${o(.762081)} ${i(45.1489)} ${o(1.32758)} ${i(43.2375)} ${o(2.58496)} ${i(41.9346)}C${o(1.03604)} ${i(41)} ${o(108484e-9)} ${i(39.3019)} ${o(0)} ${i(37.3604)}C${o(0)} ${i(35.4159)} ${o(1.03815)} ${i(33.7141)} ${o(2.59082)} ${i(32.7803)}C${o(1.34044)} ${i(31.4797)} ${o(.780389)} ${i(29.575)} ${o(1.28027)} ${i(27.7002)}C${o(1.78258)} ${i(25.8232)} ${o(3.22806)} ${i(24.4482)} ${o(4.97363)} ${i(23.9512)}C${o(4.08938)} ${i(22.3638)} ${o(4.03743)} ${i(20.3664)} ${o(5.00977)} ${i(18.6797)}C${o(5.97815)} ${i(16.9999)} ${o(7.72788)} ${i(16.0496)} ${o(9.53809)} ${i(16.0166)}C${o(9.10139)} ${i(14.2576)} ${o(9.56846)} ${i(12.3214)} ${o(10.9395)} ${i(10.9502)}C${o(12.3171)} ${i(9.57911)} ${o(14.2558)} ${i(9.11137)} ${o(16.0127)} ${i(9.54785)}C${o(16.0426)} ${i(7.73421)} ${o(16.9969)} ${i(5.97989)} ${o(18.6797)} ${i(5.00977)}C${o(20.3596)} ${i(4.03474)} ${o(22.3521)} ${i(4.08468)} ${o(23.9365)} ${i(4.96094)}C${o(24.4378)} ${i(3.22749)} ${o(25.8059)} ${i(1.7898)} ${o(27.6797)} ${i(1.29004)}C${o(29.5511)} ${i(.78264)} ${o(31.4617)} ${i(1.34357)} ${o(32.7646)} ${i(2.60059)}C${o(33.6971)} ${i(1.04268)} ${o(35.4013)} ${i(152405e-9)} ${o(37.3496)} ${i(0)}ZM${o(41.0615)} ${i(9.17578)}C${o(40.1006)} ${i(10.1057)} ${o(38.793)} ${i(10.6797)} ${o(37.3496)} ${i(10.6797)}C${o(35.9064)} ${i(10.6796)} ${o(34.5985)} ${i(10.1066)} ${o(33.6377)} ${i(9.17676)}C${o(32.9511)} ${i(10.3241)} ${o(31.8358)} ${i(11.2176)} ${o(30.4404)} ${i(11.5898)}C${o(29.0527)} ${i(11.9661)} ${o(27.6436)} ${i(11.7542)} ${o(26.4766)} ${i(11.1074)}C${o(26.1072)} ${i(12.3879)} ${o(25.2629)} ${i(13.5333)} ${o(24.0195)} ${i(14.25)}C${o(22.7695)} ${i(14.9754)} ${o(21.347)} ${i(15.1322)} ${o(20.0479)} ${i(14.8047)}C${o(20.0289)} ${i(16.1454)} ${o(19.5108)} ${i(17.4793)} ${o(18.4902)} ${i(18.5)}C${o(17.4696)} ${i(19.5158)} ${o(16.1409)} ${i(20.033)} ${o(14.8066)} ${i(20.0566)}C${o(15.1312)} ${i(21.3534)} ${o(14.9738)} ${i(22.7723)} ${o(14.25)} ${i(24.0195)}C${o(13.5243)} ${i(25.2699)} ${o(12.3701)} ${i(26.1148)} ${o(11.082)} ${i(26.4795)}C${o(11.7347)} ${i(27.6479)} ${o(11.9529)} ${i(29.062)} ${o(11.5801)} ${i(30.46)}C${o(11.2085)} ${i(31.8485)} ${o(10.3194)} ${i(32.9607)} ${o(9.17578)} ${i(33.6475)}C${o(10.106)} ${i(34.6084)} ${o(10.6797)} ${i(35.9167)} ${o(10.6797)} ${i(37.3604)}C${o(10.6796)} ${i(38.805)} ${o(10.1053)} ${i(40.1141)} ${o(9.17383)} ${i(41.0752)}C${o(10.3132)} ${i(41.7614)} ${o(11.1999)} ${i(42.871)} ${o(11.5703)} ${i(44.2598)}C${o(11.946)} ${i(45.6504)} ${o(11.7335)} ${i(47.0592)} ${o(11.0889)} ${i(48.2266)}C${o(12.377)} ${i(48.593)} ${o(13.5297)} ${i(49.441)} ${o(14.25)} ${i(50.6904)}C${o(14.9754)} ${i(51.9405)} ${o(15.1322)} ${i(53.3629)} ${o(14.8047)} ${i(54.6621)}C${o(16.142)} ${i(54.6835)} ${o(17.4721)} ${i(55.2016)} ${o(18.4902)} ${i(56.2197)}C${o(19.5097)} ${i(57.2441)} ${o(20.0278)} ${i(58.5787)} ${o(20.0479)} ${i(59.918)}C${o(21.3469)} ${i(59.5917)} ${o(22.7696)} ${i(59.7493)} ${o(24.0195)} ${i(60.4697)}C${o(25.2676)} ${i(61.1892)} ${o(26.1117)} ${i(62.3406)} ${o(26.4775)} ${i(63.627)}C${o(27.6424)} ${i(62.9822)} ${o(29.0498)} ${i(62.7688)} ${o(30.4404)} ${i(63.1396)}C${o(31.8284)} ${i(63.5112)} ${o(32.9402)} ${i(64.3999)} ${o(33.627)} ${i(65.543)}C${o(34.5887)} ${i(64.6072)} ${o(35.9012)} ${i(64.0304)} ${o(37.3496)} ${i(64.0303)}C${o(38.7912)} ${i(64.0303)} ${o(40.098)} ${i(64.6023)} ${o(41.0586)} ${i(65.5303)}C${o(41.7458)} ${i(64.3887)} ${o(42.8594)} ${i(63.5007)} ${o(44.25)} ${i(63.1299)}C${o(45.643)} ${i(62.7522)} ${o(47.057)} ${i(62.9676)} ${o(48.2266)} ${i(63.6201)}C${o(48.5931)} ${i(62.3323)} ${o(49.4413)} ${i(61.1801)} ${o(50.6904)} ${i(60.46)}C${o(51.9373)} ${i(59.7364)} ${o(53.3558)} ${i(59.5781)} ${o(54.6523)} ${i(59.9023)}C${o(54.6744)} ${i(58.5659)} ${o(55.1925)} ${i(57.2372)} ${o(56.21)} ${i(56.2197)}C${o(57.2339)} ${i(55.2007)} ${o(58.5676)} ${i(54.6816)} ${o(59.9062)} ${i(54.6611)}C${o(59.5835)} ${i(53.3649)} ${o(59.7414)} ${i(51.9468)} ${o(60.46)} ${i(50.7002)}C${o(61.1797)} ${i(49.4517)} ${o(62.3312)} ${i(48.6068)} ${o(63.6182)} ${i(48.2412)}C${o(62.9651)} ${i(47.0726)} ${o(62.7473)} ${i(45.658)} ${o(63.1201)} ${i(44.2598)}C${o(63.4916)} ${i(42.8718)} ${o(64.3794)} ${i(41.7591)} ${o(65.5225)} ${i(41.0723)}C${o(64.5929)} ${i(40.1115)} ${o(64.0206)} ${i(38.8033)} ${o(64.0205)} ${i(37.3604)}C${o(64.0205)} ${i(35.9186)} ${o(64.5915)} ${i(34.611)} ${o(65.5195)} ${i(33.6504)}C${o(64.3785)} ${i(32.9631)} ${o(63.4908)} ${i(31.8501)} ${o(63.1201)} ${i(30.46)}C${o(62.7421)} ${i(29.0656)} ${o(62.9572)} ${i(27.6498)} ${o(63.6113)} ${i(26.4795)}C${o(62.3272)} ${i(26.1115)} ${o(61.1784)} ${i(25.2657)} ${o(60.46)} ${i(24.0195)}C${o(59.7364)} ${i(22.7727)} ${o(59.5781)} ${i(21.3541)} ${o(59.9023)} ${i(20.0576)}C${o(58.5626)} ${i(20.038)} ${o(57.23)} ${i(19.52)} ${o(56.21)} ${i(18.5)}C${o(55.1931)} ${i(17.4783)} ${o(54.675)} ${i(16.1482)} ${o(54.6523)} ${i(14.8125)}C${o(53.3557)} ${i(15.1357)} ${o(51.9374)} ${i(14.9785)} ${o(50.6904)} ${i(14.2598)}C${o(49.4399)} ${i(13.5339)} ${o(48.5931)} ${i(12.3801)} ${o(48.2285)} ${i(11.0918)}C${o(47.0603)} ${i(11.7439)} ${o(45.6474)} ${i(11.9624)} ${o(44.25)} ${i(11.5898)}V${i(11.5801)}C${o(42.8613)} ${i(11.2085)} ${o(41.7483)} ${i(10.3196)} ${o(41.0615)} ${i(9.17578)}Z`}function Jh(e){let t=e/70;return {scale:t,transform:(r,o)=>(r-5)*t+o}}function XS(e,t,n){let{scale:r,transform:o}=Jh(n);return M`M ${o(5,e)} ${o(30,t)}v ${20*r}a ${25*r} ${25*r}, 0, 0, 0, ${25*r} ${25*r}h ${45*r}v -${45*r}a ${25*r} ${25*r}, 0, 0, 0, -${25*r} -${25*r}h -${20*r}H ${o(5,e)}zM ${o(30,e)} ${o(15,t)}h ${20*r}a ${15*r} ${15*r}, 0, 0, 1, ${15*r} ${15*r}v ${35*r}h -${35*r}a ${15*r} ${15*r}, 0, 0, 1, -${15*r} -${15*r}v -${35*r}z`}function KS(e,t,n){let r=n/7,o=r*1.5,i=r*.75,s=M`M ${e+o} ${t}`+M`h ${n-2*o}`+M`a ${o} ${o} 0 0 1 ${o} ${o}`+M`v ${n-2*o}`+M`a ${o} ${o} 0 0 1 ${-o} ${o}`+M`h ${-(n-2*o)}`+M`a ${o} ${o} 0 0 1 ${-o} ${-o}`+M`v ${-(n-2*o)}`+M`a ${o} ${o} 0 0 1 ${o} ${-o}z`,a=M`M ${e+r+i} ${t+r}`+M`h ${5*r-2*i}`+M`a ${i} ${i} 0 0 1 ${i} ${i}`+M`v ${5*r-2*i}`+M`a ${i} ${i} 0 0 1 ${-i} ${i}`+M`h ${-(5*r-2*i)}`+M`a ${i} ${i} 0 0 1 ${-i} ${-i}`+M`v ${-(5*r-2*i)}`+M`a ${i} ${i} 0 0 1 ${i} ${-i}z`;return s+a}function JS(e,t,n){let{scale:r,transform:o}=Jh(n);return M`M ${o(5,e)} ${o(40,t)}a ${35*r} ${35*r}, 0, 0, 0, ${35*r} ${35*r}h ${30*r}a ${5*r} ${5*r}, 0, 0, 0, ${5*r} -${5*r}v -${30*r}a ${35*r} ${35*r}, 0, 0, 0, -${35*r} -${35*r}a ${35*r} ${35*r}, 0, 0, 0, -${35*r} ${35*r}zM ${o(40,e)} ${o(15,t)}a ${25*r} ${25*r}, 0, 0, 1, ${25*r} ${25*r}v ${25*r}h -${25*r}a ${25*r} ${25*r}, 0, 0, 1, -${25*r} -${25*r}a ${25*r} ${25*r}, 0, 0, 1, ${25*r} -${25*r}z`}function ev(e,t,n){let{scale:r,transform:o}=Jh(n);return M`M ${o(5,e)} ${o(30,t)}v ${20*r}a ${25*r} ${25*r}, 0, 0, 0, ${25*r} ${25*r}h ${45*r}v -${45*r}a ${25*r} ${25*r}, 0, 0, 0, -${25*r} -${25*r}h -${20*r}a ${25*r} ${25*r}, 0, 0, 0, -${25*r} ${25*r}M ${o(30,e)} ${o(15,t)}h ${20*r}a ${15*r} ${15*r}, 0, 0, 1, ${15*r} ${15*r}v ${35*r}h -${35*r}a ${15*r} ${15*r}, 0, 0, 1, -${15*r} -${15*r}v -${20*r}a ${15*r} ${15*r}, 0, 0, 1, ${15*r} -${15*r}z`}function tv(e,t,n){let r=n/70,o=e+n/2-40*r,i=t+n/2-40*r,s=(c,u)=>c*r+u;return M`M${s(35.19239999999999,o)} ${s(5.837547376725838,i)}C${s(37.69667692307692,o)} ${s(3.8737070690335305,i)}, ${s(41.218430769230764,o)} ${s(3.8737092228796843,i)}, ${s(43.722707692307694,o)} ${s(5.837547376725838,i)}L${s(46.62781538461539,o)} ${s(8.115648915187375,i)}L${s(50.23356923076923,o)} ${s(7.32361506903353,i)}C${s(53.342,o)} ${s(6.640824299802762,i)}, ${s(56.51483076923077,o)} ${s(8.168784299802759,i)}, ${s(57.91892307692308,o)} ${s(11.024719684418145,i)}L${s(59.54787692307692,o)} ${s(14.337679684418145,i)}L${s(63.14027692307692,o)} ${s(15.188578145956608,i)}C${s(66.23707692307693,o)} ${s(15.922091992110452,i)}, ${s(68.43270769230769,o)} ${s(18.675396607495067,i)}, ${s(68.45876923076924,o)} ${s(21.857768915187375,i)}L${s(68.48892307692307,o)} ${s(25.54931045364891,i)}L${s(71.35633846153846,o)} ${s(27.874602761341222,i)}C${s(73.82830769230769,o)} ${s(29.879187376725838,i)}, ${s(74.61187692307692,o)} ${s(33.312418145956606,i)}, ${s(73.25452307692306,o)} ${s(36.19103353057199,i)}L${s(71.68006153846153,o)} ${s(39.530141222879685,i)}L${s(73.25452307692306,o)} ${s(42.86924891518738,i)}C${s(74.61187692307692,o)} ${s(45.747864299802764,i)}, ${s(73.82830769230769,o)} ${s(49.18109506903353,i)}, ${s(71.35633846153846,o)} ${s(51.18567968441815,i)}L${s(68.48892307692307,o)} ${s(53.510971992110456,i)}L${s(68.45876923076924,o)} ${s(57.202664299802755,i)}C${s(68.43270769230769,o)} ${s(60.38497199211046,i)}, ${s(66.23707692307693,o)} ${s(63.13823353057199,i)}, ${s(63.14027692307692,o)} ${s(63.871833530572,i)}L${s(59.54787692307692,o)} ${s(64.72260276134121,i)}L${s(57.91892307692308,o)} ${s(68.03564891518737,i)}C${s(56.51483076923077,o)} ${s(70.89164891518737,i)}, ${s(53.342,o)} ${s(72.41958737672583,i)}, ${s(50.23356923076923,o)} ${s(71.7368181459566,i)}L${s(46.62781538461539,o)} ${s(70.94463353057199,i)}L${s(43.722707692307694,o)} ${s(73.22275660749506,i)}C${s(41.218430769230764,o)} ${s(75.18663353057198,i)}, ${s(37.69667692307692,o)} ${s(75.18663353057198,i)}, ${s(35.19239999999999,o)} ${s(73.22275660749506,i)}L${s(32.28729230769231,o)} ${s(70.94463353057199,i)}L${s(28.68153846153846,o)} ${s(71.7368181459566,i)}C${s(25.573215384615384,o)} ${s(72.41958737672583,i)}, ${s(22.400384615384613,o)} ${s(70.89164891518737,i)}, ${s(20.996141538461536,o)} ${s(68.03564891518737,i)}L${s(19.36720923076923,o)} ${s(64.72260276134121,i)}L${s(15.774852307692306,o)} ${s(63.871833530572,i)}C${s(12.67803076923077,o)} ${s(63.13823353057199,i)}, ${s(10.48237846153846,o)} ${s(60.38497199211046,i)}, ${s(10.45636,o)} ${s(57.202664299802755,i)}L${s(10.426163076923077,o)} ${s(53.510971992110456,i)}L${s(7.558747692307692,o)} ${s(51.18567968441815,i)}C${s(5.086880338461539,o)} ${s(49.18109506903353,i)}, ${s(4.303258769230769,o)} ${s(45.747864299802764,i)}, ${s(5.660599692307692,o)} ${s(42.86924891518738,i)}L${s(7.235153846153846,o)} ${s(39.530141222879685,i)}L${s(5.660599692307692,o)} ${s(36.19103353057199,i)}C${s(4.3032566153846155,o)} ${s(33.312418145956606,i)}, ${s(5.086885938461538,o)} ${s(29.879187376725838,i)}, ${s(7.558747692307692,o)} ${s(27.874602761341222,i)}L${s(10.426163076923077,o)} ${s(25.54931045364891,i)}L${s(10.45636,o)} ${s(21.857768915187375,i)}C${s(10.48237846153846,o)} ${s(18.67537506903353,i)}, ${s(12.678052307692308,o)} ${s(15.922091992110452,i)}, ${s(15.774852307692306,o)} ${s(15.188578145956608,i)}L${s(19.36720923076923,o)} ${s(14.337679684418145,i)}L${s(20.996141538461536,o)} ${s(11.024719684418145,i)}C${s(22.400384615384613,o)} ${s(8.168784299802759,i)}, ${s(25.573215384615384,o)} ${s(6.640824299802762,i)}, ${s(28.68153846153846,o)} ${s(7.32361506903353,i)}L${s(32.28729230769231,o)} ${s(8.115648915187375,i)}L${s(35.19239999999999,o)} ${s(5.837547376725838,i)}M${s(39.45766153846154,o)} ${s(13.665055069033532,i)}L${s(37.01498461538461,o)} ${s(15.58053506903353,i)}C${s(35.39098461538461,o)} ${s(16.854061222879682,i)}, ${s(33.282799999999995,o)} ${s(17.335251992110454,i)}, ${s(31.26701538461538,o)} ${s(16.892464299802757,i)}L${s(28.235046153846152,o)} ${s(16.22649506903353,i)}L${s(26.865415384615382,o)} ${s(19.012107376725837,i)}C${s(25.954812307692308,o)} ${s(20.864178145956608,i)}, ${s(24.264193846153844,o)} ${s(22.212399684418145,i)}, ${s(22.255926153846154,o)} ${s(22.688076607495066,i)}L${s(19.235393846153844,o)} ${s(23.40354122287968,i)}L${s(19.21,o)} ${s(26.507556607495065,i)}C${s(19.19313538461538,o)} ${s(28.57137199211045,i)}, ${s(18.25492,o)} ${s(30.519525838264297,i)}, ${s(16.651919999999997,o)} ${s(31.81937199211045,i)}L${s(14.240926153846154,o)} ${s(33.774633530572,i)}L${s(15.564830769230769,o)} ${s(36.58238737672584,i)}C${s(16.445064615384617,o)} ${s(38.44891045364892,i)}, ${s(16.445064615384617,o)} ${s(40.611371992110456,i)}, ${s(15.564830769230769,o)} ${s(42.47811045364892,i)}L${s(14.240926153846154,o)} ${s(45.28564891518738,i)}L${s(16.651919999999997,o)} ${s(47.240910453648915,i)}L${s(13.883236923076923,o)} ${s(50.654971992110454,i)}L${s(16.651919999999997,o)} ${s(47.240910453648915,i)}C${s(18.25492,o)} ${s(48.54075660749507,i)}, ${s(19.19313538461538,o)} ${s(50.4891258382643,i)}, ${s(19.21,o)} ${s(52.5527258382643,i)}L${s(19.235393846153844,o)} ${s(55.65684891518738,i)}L${s(22.255926153846154,o)} ${s(56.37235660749507,i)}C${s(24.264193846153844,o)} ${s(56.847925838264295,i)}, ${s(25.954812307692308,o)} ${s(58.196233530571995,i)}, ${s(26.865415384615382,o)} ${s(60.0483258382643,i)}L${s(28.235046153846152,o)} ${s(62.833895069033524,i)}L${s(31.26701538461538,o)} ${s(62.1679258382643,i)}C${s(33.282799999999995,o)} ${s(61.72509506903353,i)}, ${s(35.39098461538461,o)} ${s(62.20626429980276,i)}, ${s(37.01498461538461,o)} ${s(63.47983353057199,i)}L${s(39.45766153846154,o)} ${s(65.39524891518737,i)}L${s(41.90012307692308,o)} ${s(63.47983353057199,i)}C${s(43.524123076923075,o)} ${s(62.20626429980276,i)}, ${s(45.632307692307684,o)} ${s(61.72509506903353,i)}, ${s(47.6480923076923,o)} ${s(62.1679258382643,i)}L${s(50.68006153846154,o)} ${s(62.833895069033524,i)}L${s(52.049692307692304,o)} ${s(60.0483258382643,i)}C${s(52.960338461538456,o)} ${s(58.196233530571995,i)}, ${s(54.6508923076923,o)} ${s(56.847925838264295,i)}, ${s(56.65913846153846,o)} ${s(56.37235660749507,i)}L${s(59.67969230769231,o)} ${s(55.65684891518738,i)}L${s(59.70510769230769,o)} ${s(52.5527258382643,i)}C${s(59.72190769230769,o)} ${s(50.4891258382643,i)}, ${s(60.66012307692307,o)} ${s(48.54075660749507,i)}, ${s(62.263230769230766,o)} ${s(47.240910453648915,i)}L${s(64.67424615384616,o)} ${s(45.28564891518738,i)}L${s(63.35027692307692,o)} ${s(42.47811045364892,i)}C${s(62.47,o)} ${s(40.611371992110456,i)}, ${s(62.47,o)} ${s(38.44891045364892,i)}, ${s(63.35027692307692,o)} ${s(36.58238737672584,i)}L${s(64.67424615384616,o)} ${s(33.774633530572,i)}L${s(62.263230769230766,o)} ${s(31.81958737672584,i)}C${s(60.66012307692307,o)} ${s(30.519525838264297,i)}, ${s(59.72190769230769,o)} ${s(28.57137199211045,i)}, ${s(59.70510769230769,o)} ${s(26.507556607495065,i)}L${s(59.67969230769231,o)} ${s(23.40354122287968,i)}L${s(56.65913846153846,o)} ${s(22.688076607495066,i)}C${s(54.6508923076923,o)} ${s(22.212399684418145,i)}, ${s(52.960338461538456,o)} ${s(20.864178145956608,i)}, ${s(52.049692307692304,o)} ${s(19.012128915187375,i)}L${s(50.68006153846154,o)} ${s(16.22649506903353,i)}L${s(47.6480923076923,o)} ${s(16.892464299802757,i)}C${s(45.632307692307684,o)} ${s(17.335251992110454,i)}, ${s(43.524338461538456,o)} ${s(16.85408276134122,i)}, ${s(41.90012307692308,o)} ${s(15.58053506903353,i)}L${s(39.45766153846154,o)} ${s(13.665055069033532,i)}Z`}function Uc(e,t,n,r,o="top-left"){switch(r){case "leaf":return Jy(e,t,n,o);case "leaf-reverse":return Jy(e,t,n,o,true);case "drop":return GS(e,t,n,o);case "octagon":return Ky(e,t,n,1.6);case "bevel":return Ky(e,t,n,1.1);case "squircle":return US(e,t,n);case "cushion":return QS(e,t,n);case "shield":return VS(e,t,n);case "petal":return jS(e,t,n,o);case "gear":return YS(e,t,n);case "rounded":return WS(e,t,n);case "circle":return HS(e,t,n);case "diya":return XS(e,t,n);case "extra-rounded":return KS(e,t,n);case "message":return JS(e,t,n);case "pointy":return ev(e,t,n);case "curly":return tv(e,t,n);default:return qS(e,t,n)}}var Qc=.22,Vc=.14;function n2(e,t,n={}){if(e==="circle")return k("circle",{cx:x(t.x+t.w/2),cy:x(t.y+t.h/2),r:x(Math.min(t.w,t.h)/2),...n});let r=e==="rounded"?Math.min(t.w,t.h)*Qc:0;return k("rect",{height:x(t.h),width:x(t.w),x:x(t.x),y:x(t.y),...r>0&&{rx:x(r),ry:x(r)},...n})}function nv(e,t){let n=e.w*t,r=e.h*t;return {x:e.x+n,y:e.y+r,w:e.w-2*n,h:e.h-2*r}}function jc(e,t){let n=e.shape??"square",r=e.plate,o=r?nv(t,Vc):t,i=a=>k("image",{height:x(o.h),href:e.src,preserveAspectRatio:"none",width:x(o.w),x:x(o.x),y:x(o.y),...a&&{clipPath:`url(#${a})`}});if(n==="square"&&!r)return i();let s=n==="square"?void 0:`qrdx-logo-${pr(`${n}|${x(o.x)}|${x(o.y)}|${x(o.w)}|${x(o.h)}`)}`;return Se("g",{children:[r&&n2(n,t,{fill:r}),s&&k("clipPath",{id:s,children:n2(n,o)}),i(s)]})}var r2=.6,rv=["L","M","Q","H"];function o2(e){let t=Te.QrCode.encodeText(e.value,We[e.level]),n=rv[t.errorCorrectionLevel.ordinal]??e.level;return {code:e,cells:t.getModules(),layoutMargin:ot(t.size,e.margin,e.shape),map:Qi(t.version,n),level:n,version:t.version}}function i2(e,t){let{cells:n,map:r}=e,o=n.length,i=Ln(n,e.code.size,e.layoutMargin,t);if(!i)return null;let s=i.excavation??{x:Math.floor(i.x),y:Math.floor(i.y),w:Math.ceil(i.x+i.w)-Math.floor(i.x),h:Math.ceil(i.y+i.h)-Math.floor(i.y)},a=[];for(let u=Math.max(0,s.y);u<Math.min(o,s.y+s.h);u++)for(let l=Math.max(0,s.x);l<Math.min(o,s.x+s.w);l++)a.push(u*o+l);let c=Vi(r,a);return {worst:Math.max(0,...c),correctable:r.correctable,budget:Math.floor(r.correctable*r2),level:e.level,version:e.version}}function qc(e,t){return i2(o2(e),t)}var s2=e=>!e||e.worst<=e.budget;function ov(e,t){return s2(qc(e,t))}function e0(e,t,n,r){let o=t.map(a=>o2({...e,level:a})),i=a=>{let c=r(a);return o.every(u=>s2(i2(u,c)))};if(i(n))return n;let s=e.size*.005;for(let a=n-s;a>0;a-=s)if(i(a))return a;return 0}function Wc(e,t){if(!t)return;let n=Math.floor(e.size*cs),r=t.width||n,o=t.height||n,i=p=>{if(p===r)return t;let m=o*p/r;return {...t,width:p,height:m,...t.x!=null&&{x:t.x+(r-p)/2},...t.y!=null&&{y:t.y+(o-m)/2}}},s=e.level??zt,a={value:e.value,size:e.size,margin:e.margin,shape:e.shape},c=p=>yt({...e,level:s,imageSettings:p}),u=p=>{let m=e0(a,[p],r,i);return m>0?i(m):void 0},l=c(t);if(l===s)return u(s);let f=u(l);return f&&c(f)===l?f:u(s)}var t0="data-qrdx-part",a2="data-qrdx-eye",iv=["eye-outer","eye-centre","body","logo","background"];function n0(e,t,n){if(e)return n?{[t0]:t,[a2]:n}:{[t0]:t}}var c2={id:"Arrow",name:"Arrow",description:"QR code with arrow",wrapper:(e,t)=>k("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:Se("svg",{fill:"#000000",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[k("path",{d:"M73.57,175.23h0c.12-2.06.31-4.19.49-6.25s.48-4.13.85-6.13.79-4,1.27-5.95a30.21,30.21,0,0,1,1.94-5.28h0c.06-.18.13-.43.19-.67a3.55,3.55,0,0,0-2.8-4.19l-.18-.06a1.85,1.85,0,0,0-.54-.06c-.19,0-.31-.06-.49-.06s-.61-.06-.91-.06c-.61,0-1.21.06-1.82.06-1.21.12-2.37.25-3.52.43a62.08,62.08,0,0,0-6.8,1.45,58.45,58.45,0,0,0-6.43,2.31c-1,.42-2.07,1-3.1,1.4s-2,1.09-3,1.57a.76.76,0,0,0,.54,1.4h.07c1.09-.24,2.12-.55,3.15-.79s2.13-.48,3.16-.61A46,46,0,0,1,62,153c1.34-.06,2.73-.06,4.07-.06a62.58,62.58,0,0,0-7.23,10.43,85.58,85.58,0,0,0-6.55,15.36,107.86,107.86,0,0,0-5,32.53,104.06,104.06,0,0,0,5,32.29,90.47,90.47,0,0,0,15.54,28.52.94.94,0,0,0,1.27.19.89.89,0,0,0,.18-1.28h0a87.24,87.24,0,0,1-13.89-28.28A102.85,102.85,0,0,1,58,180.87a82.15,82.15,0,0,1,6.68-14,51.58,51.58,0,0,1,5.71-7.76c0,1.21,0,2.36.06,3.58.12,2.18.24,4.31.48,6.43s.49,4.25.85,6.37a1,1,0,0,0,.91.85A1.37,1.37,0,0,0,73.57,175.23Z",fill:t?.fgColor||"black",id:"CallToActionArrow"}),k("g",{fill:"none",transform:"translate(82, 95)scale(0.5)",children:e})]})})};var u2={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:e=>k("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:k("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:e})})};var l2={id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",wrapper:e=>k("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:k("svg",{fill:"none",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:Se("g",{transform:"translate(10, 10)",children:[k("circle",{cx:"138",cy:"167.682",fill:"white",r:"99.3177",stroke:"#F89941",strokeWidth:"20"}),k("rect",{fill:"url(#pattern0)",height:"110.806",width:"113",x:"81.0001",y:"124.097"}),k("ellipse",{cx:"167.989",cy:"67.8947",fill:"#F89941",rx:"35.4453",ry:"48.4419"}),k("path",{d:"M187.937 69.0763C187.937 82.6574 184.092 94.8451 178.005 103.57C171.912 112.304 163.736 117.381 154.992 117.381C146.247 117.381 138.072 112.304 131.979 103.57C125.891 94.8451 122.047 82.6574 122.047 69.0763C122.047 55.4952 125.891 43.3075 131.979 34.5823C138.072 25.8486 146.247 20.7714 154.992 20.7714C163.736 20.7714 171.912 25.8486 178.005 34.5823C184.092 43.3075 187.937 55.4952 187.937 69.0763Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),k("ellipse",{cx:"154.072",cy:"69.4866",fill:"#F89941",rx:"34.0512",ry:"50.6615"}),k("path",{d:"M171.396 69.667C171.396 82.7394 167.562 94.4717 161.488 102.874C155.412 111.279 147.235 116.2 138.451 116.2C129.666 116.2 121.489 111.279 115.413 102.874C109.34 94.4717 105.506 82.7394 105.506 69.667C105.506 56.5946 109.34 44.8624 115.413 36.4603C121.489 28.0551 129.666 23.1344 138.451 23.1344C147.235 23.1344 155.412 28.0551 161.488 36.4603C167.562 44.8624 171.396 56.5946 171.396 69.667Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),k("ellipse",{cx:"134.316",cy:"70.8486",fill:"#F89941",rx:"33.673",ry:"47.8511"}),k("ellipse",{fill:"#F89941",rx:"35.4453",ry:"48.4419",transform:"matrix(-1 0 0 1 106.743 68.4484)"}),k("path",{d:"M86.7942 69.6299C86.7942 83.2111 90.6388 95.3988 96.7262 104.124C102.819 112.858 110.995 117.935 119.739 117.935C128.484 117.935 136.659 112.858 142.753 104.124C148.84 95.3988 152.685 83.2111 152.685 69.6299C152.685 56.0488 148.84 43.8611 142.753 35.1359C136.659 26.4023 128.484 21.3251 119.739 21.3251C110.995 21.3251 102.819 26.4023 96.7262 35.1359C90.6388 43.8611 86.7942 56.0488 86.7942 69.6299Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),k("ellipse",{fill:"#F89941",rx:"32.9438",ry:"50.3847",transform:"matrix(-1 0 0 1 119.744 69.7634)"}),k("path",{d:"M103.335 70.2207C103.335 83.293 107.169 95.0253 113.243 103.427C119.319 111.833 127.496 116.753 136.281 116.753C145.065 116.753 153.242 111.833 159.318 103.427C165.392 95.0253 169.226 83.293 169.226 70.2207C169.226 57.1483 165.392 45.416 159.318 37.014C153.242 28.6088 145.065 23.688 136.281 23.688C127.496 23.688 119.319 28.6088 113.243 37.014C107.169 45.416 103.335 57.1483 103.335 70.2207Z",fill:"#F89941",stroke:"#E78249",strokeWidth:"5"}),k("ellipse",{fill:"#F89941",rx:"32.3901",ry:"47.6163",transform:"matrix(-1 0 0 1 139.677 70.8708)"}),k("ellipse",{fill:"#F89941",rx:"33.2207",ry:"47.6163",transform:"matrix(-1 0 0 1 134.971 71.4245)"}),k("path",{d:"M158.85 46.6783C165.21 42.2516 166.538 40.633 167.867 39.0144C167.867 39.0144 169.806 43.8236 169.88 46.3566C169.954 48.8897 169.712 50.1469 167.248 51.6467C164.783 53.1464 155.406 53.0446 150.083 52.9746C149.31 52.5001 150.72 52.3371 158.85 46.6783Z",fill:"black"}),k("path",{d:"M115.765 46.5118C109.392 42.1412 108.058 40.5475 106.724 38.9538C106.724 38.9538 104.783 45.8361 104.758 46.822C104.733 47.808 104.657 50.8051 108.247 51.9995C111.837 53.194 119.234 52.7723 124.551 52.7272C125.322 52.2652 123.912 52.0991 115.765 46.5118Z",fill:"black"}),k("path",{d:"M160 90.4999C167.156 83.1595 169.5 78.2827 171.351 72.9348C172.24 70.3672 162.909 72.0429 158 72.9348C157.276 73.0664 155.751 76.9145 155 77C154.182 77.0932 151.841 73.0759 151 73.086C149.725 73.1013 147.727 73.086 145.875 73.4285C145.345 74.3645 146.367 77.5746 145.875 78.2827C145.321 78.2827 141.796 77.2604 141.242 76.4298C140.689 74.492 140.949 73.3629 140.118 72.5323C137.555 72.9075 138.023 72.6567 135.412 73.086C134.768 73.1919 133.09 77.7212 132.441 77.8195C131.615 77.9448 128.644 74.0088 127.809 74.1138C126.747 74.2475 124.821 74.4683 123.64 74.577C123.126 74.6244 123.554 77.5019 123.177 78.2827C122.898 78.8616 119.426 77.8921 118.5 77.5C118.037 76.5024 117.844 74.5583 117 74.577C111 74.1138 109.4 73.843 103.575 70.8713C103.575 70.8713 102.5 80 111 89C119.5 98 147.127 103.706 160 90.4999Z",fill:"black"}),k("path",{d:"M135.238 7.25181C137.192 1.73111 142.678 0.363204 145.935 0L148.377 1.81602C149.158 2.39714 149.842 2.40909 150.331 3.25657C150.331 4.22511 146.337 5.41975 142.429 6.582C137.545 8.03482 139.482 17.0534 142.429 19.2811C143.401 20.0152 143.524 19.9639 145.966 19.9639C148.029 19.9639 150.387 18.2474 151.566 17.3526C151.566 17.3526 151.861 20.2573 149.798 21.4777C147.735 22.698 143.578 21.8578 143.608 21.9658C144.493 23.9183 146.89 22.4887 148.029 23.3362C147.346 23.3362 146.556 24.2889 144.198 24.5329C142.672 24.5798 142.135 24.5329 140.956 23.9183C139.777 23.3037 139.482 22.8696 138.893 22.1395C136.83 23.3598 138.893 25.4305 138.893 25.4305C138.893 25.4305 134.472 25.8512 133.587 23.9183C133.264 23.2115 133.882 22.1395 133.587 21.9658C131.819 22.4539 130.935 23.4807 127.373 22.8696C124.312 22.3443 125.102 18.3211 124.451 17.3526C127.381 18.079 125.131 20.0392 129.327 19.9639C140.838 19.7576 132.796 14.1527 135.238 7.25181Z",fill:"#5D725F"}),Se("defs",{children:[k("pattern",{height:"1",id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1"}),k("clipPath",{id:"clip0_2087_156668",children:k("rect",{fill:"white",height:"276",width:"276"})})]}),k("g",{fill:"none",transform:"translate(80, 122)scale(0.38)",children:e})]})})})};var f2={id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",wrapper:(e,t)=>k("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:k("svg",{fill:"black",height:"300",viewBox:"0 0 316 316",width:"300",xmlns:"http://www.w3.org/2000/svg",children:Se("g",{children:[k("path",{clipRule:"evenodd",d:"M308 8H8v300h300V8ZM0 0v316h316V0H0Z",fill:t?.fgColor||"black",fillRule:"evenodd"}),k("g",{fill:"none",transform:"translate(20, 20) scale(0.92)",children:e})]})})})};var m2={id:"StandardBox",name:"Standard Box",description:"QR code with standard box",wrapper:(e,t)=>k("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:Se("svg",{fill:"#000000",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[k("path",{d:"M243,1.7h-186a10.25,10.25,0,0,0-10.2,10.12v186A10.13,10.13,0,0,0,57,208H243a10.13,10.13,0,0,0,10.12-10.12v-186A10.13,10.13,0,0,0,243,1.7Zm2.36,193.05a5.46,5.46,0,0,1-5.47,5.47H60.16a5.46,5.46,0,0,1-5.47-5.47V14.93a5.46,5.46,0,0,1,5.47-5.47H239.91a5.46,5.46,0,0,1,5.47,5.47Z",fill:t?.fgColor||"black"}),k("path",{d:"M243.54,238.81H173.61a2.29,2.29,0,0,1-1.62-.67l-20.55-20.55a2.33,2.33,0,0,0-3.25,0l-20.55,20.55a2.29,2.29,0,0,1-1.62.67H56.09A9.15,9.15,0,0,0,46.93,248v41.17a9.16,9.16,0,0,0,9.16,9.16H243.61a9.09,9.09,0,0,0,9.09-9.16V248A9.16,9.16,0,0,0,243.54,238.81Z",fill:t?.fgColor||"black"}),k("g",{fill:"none",transform:"translate(60, 15)scale(0.6)",children:e})]})})};var p2={id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",wrapper:e=>k("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:Se("svg",{fill:"#22071b",height:"300",viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",children:[k("path",{d:"M195.11,290.77l-7.28,4.88a2.16,2.16,0,0,0-.57,3,2.21,2.21,0,0,0,1.77.92,2.4,2.4,0,0,0,1.2-.35l7.28-4.88a2.14,2.14,0,0,0-2.4-3.54Z"}),k("path",{d:"M266.85,227.52l-7.28,4.87a2.16,2.16,0,0,0-.57,3,2.21,2.21,0,0,0,1.77.92,1.86,1.86,0,0,0,1.2-.35l7.28-4.88a2.13,2.13,0,1,0-2.4-3.53Z"}),k("path",{d:"M41,176.34l-9.11,6.08a2.15,2.15,0,0,0-.57,3,2.19,2.19,0,0,0,1.77.92,2.14,2.14,0,0,0,1.2-.35l9.12-6.08A2.14,2.14,0,0,0,41,176.34Z"}),k("path",{d:"M41,269.08l-9.11,6.07a2.15,2.15,0,0,0-.57,3,2.19,2.19,0,0,0,1.77.92,2.92,2.92,0,0,0,1.2-.35l9.12-6.08A2.14,2.14,0,0,0,41,269.08Z"}),k("path",{d:"M147,10.1a2.4,2.4,0,0,0,1.14-.35l7.7-5.16a2.13,2.13,0,0,0-2.4-3.53l-7.64,5.15a2.15,2.15,0,0,0-.56,3A2.19,2.19,0,0,0,147,10.1Z"}),k("path",{d:"M275.54,54.77a2.14,2.14,0,0,0-3-.56l-17.1,11.45V31.31a10.18,10.18,0,0,0-10.18-10.18H137.22l-10.39,7a2.4,2.4,0,0,1-1.2.35,2.21,2.21,0,0,1-1.77-.92,2.15,2.15,0,0,1,.57-3l1.41-.92,13.64-8.76a2.1,2.1,0,1,0-2.26-3.54L122,21.2h-8.13l-10.39,7a2.37,2.37,0,0,1-1.2.35,2.19,2.19,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3L124,9.25a2.13,2.13,0,1,0-2.4-3.53l-23,15.48H58.2A10.18,10.18,0,0,0,48,31.38v28L31.34,70.46a2.09,2.09,0,0,0-.57,3,2,2,0,0,0,1.77.92,2.58,2.58,0,0,0,1.2-.35l14.35-9.54,3.18-2.12a2.14,2.14,0,1,1,2.41,3.53l-5.52,3.67V76.9l-7,4.66a2.15,2.15,0,0,0-.56,3,2,2,0,0,0,1.77.92,2.34,2.34,0,0,0,1.2-.36l7.35-4.94A2.13,2.13,0,0,1,52.69,84l-4.46,3v65.66L25.05,168.07a2.15,2.15,0,0,0-.57,3,2,2,0,0,0,1.77.92,2.37,2.37,0,0,0,1.2-.35l25-16.75a2,2,0,0,1,2.62.77,2.16,2.16,0,0,1-.57,3l-6.36,4.24V275a10.09,10.09,0,0,0,9.83,10.11l-5.87,4a2.15,2.15,0,0,0-.57,3,2.06,2.06,0,0,0,1.77.92,2.38,2.38,0,0,0,1.2-.36l23-15.41a2.14,2.14,0,0,1,2.41,3.54l-6.58,4.45h52l-5.58,3.75a2.14,2.14,0,0,0-.56,3,2,2,0,0,0,1.76.91,2.37,2.37,0,0,0,1.2-.35l30.54-20.28a2.15,2.15,0,0,1,3,.56,2.1,2.1,0,0,1-.57,3l-14.21,9.54H217l-4.6,3a2.16,2.16,0,0,0-.63,3,2.11,2.11,0,0,0,1.76,1,2,2,0,0,0,1.13-.36L237,277.35a2.14,2.14,0,1,1,2.33,3.6l-6.78,4.38h13a10.18,10.18,0,0,0,10.18-10.18v-91.1l-4.38,3a2.43,2.43,0,0,1-1.2.35,2.19,2.19,0,0,1-1.77-.92,2.15,2.15,0,0,1,.57-3l24.38-16.33a2.13,2.13,0,1,0-2.4-3.53l-15.48,10.25V91.53l-4.38,3a2.34,2.34,0,0,1-1.21.36,2.22,2.22,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3l6.72-4.52,13.71-9.19a2.14,2.14,0,0,0-2.4-3.54l-11.24,7.57V75.84l-4.38,3a2.34,2.34,0,0,1-1.21.36,2.22,2.22,0,0,1-1.76-.92,2.15,2.15,0,0,1,.56-3l6.72-4.52,19.43-13.08A2.05,2.05,0,0,0,275.54,54.77ZM237,216.07h-172a5.23,5.23,0,0,1-5.23-5.24V38.94a5.22,5.22,0,0,1,5.23-5.23H237a5.22,5.22,0,0,1,5.23,5.23V210.83h.07A5.22,5.22,0,0,1,237,216.07Z"}),k("path",{d:"M270.45,139.8l-7.28,4.88a2.15,2.15,0,0,0-.56,3,2.22,2.22,0,0,0,1.76.92,2.44,2.44,0,0,0,1.21-.36l7.28-4.87a2.14,2.14,0,0,0-2.41-3.54Z"}),k("g",{fill:"none",transform:"translate(64, 38)scale(0.58)",children:e})]})})};var r0={default:u2,Arrow:c2,StandardBox:m2,SquareBorder:f2,StrikedBox:p2,Halloween:l2},d2=e=>r0[e],ZA=()=>Object.values(r0),BA=()=>Object.keys(r0);var o0=e=>Math.round(Math.min(Math.max(e,0),255)).toString(16).padStart(2,"0");function b2(e){return `#${o0(e.r)}${o0(e.g)}${o0(e.b)}`}function Hc(e){let t=Ae(e);return !t||t.a>=1||t.a<=0?{color:e}:{color:b2(t),opacity:ye(t.a,3)}}function Yc(e,t){let n=Math.min(Math.max(e.a,0),1);return {r:e.r*n+t.r*(1-n),g:e.g*n+t.g*(1-n),b:e.b*n+t.b*(1-n),a:1}}var y2={r:0,g:0,b:0,a:1};function sv(e){return [...e].map(t=>({offset:Math.min(Math.max(t.offset/100,0),1),color:Ae(t.color)??y2})).sort((t,n)=>t.offset-n.offset)}function i0(e,t){let n=e[0],r=e.at(-1);if(!(n&&r))return y2;if(t<=n.offset)return n.color;if(t>=r.offset)return r.color;for(let o=0;o+1<e.length;o++){let i=e[o],s=e[o+1];if(t>=i.offset&&t<=s.offset){let a=s.offset-i.offset,c=a>0?(t-i.offset)/a:1,u=i.color.a+(s.color.a-i.color.a)*c,l=(f,p)=>{let m=f*i.color.a+(p*s.color.a-f*i.color.a)*c;return u>0?m/u:f+(p-f)*c};return {r:l(i.color.r,s.color.r),g:l(i.color.g,s.color.g),b:l(i.color.b,s.color.b),a:u}}}return r.color}var h2=4,g2=720,av=2;function $2(e,t,n,r,o){let i=sv(e);if(i.length===0)return {wedges:[]};let s=i[0].color.a,a=i.every(b=>Math.abs(b.color.a-s)<.002),c=[...new Set([0,...i.map(b=>b.offset),1])].sort((b,y)=>b-y),u=[];for(let b=0;b+1<c.length;b++){let y=c[b],S=c[b+1];if(S<=y)continue;let v=i0(i,y+1e-9),$=i0(i,S-1e-9),w=Math.max(Math.abs(v.r*v.a-$.r*$.a),Math.abs(v.g*v.a-$.g*$.a),Math.abs(v.b*v.a-$.b*$.a),Math.abs(v.a-$.a)*255),A=Math.ceil(w/av),C=Math.ceil((S-y)*360/h2),R=Math.max(1,A,C);for(let I=0;I<R;I++)u.push([y+(S-y)*I/R,y+(S-y)*(I+1)/R]);}let l=u;if(u.length>g2){let b=Math.ceil(u.length/g2);l=[];for(let y=0;y<u.length;y+=b){let S=u.slice(y,y+b);l.push([S[0][0],S.at(-1)[1]]);}}let f=t-90,p=o/Math.cos(2*h2/2*(Math.PI/180)),m=b=>{let y=b*Math.PI/180;return [x(n+p*Math.cos(y)),x(r+p*Math.sin(y))]},h=`${x(n)} ${x(r)}`,d=b=>ye((b%360+360)%360,4),g=l.length-1,_=l.map(([b,y],S)=>{let v=i0(i,(b+y)/2),$=(y-b)*360,w=a&&S===0&&g>0?$:0,A=a&&S<g?$:0,C=f+b*360-w,R=f+y*360+A,[I,L]=m(C),[z,D]=m(R);return {d:`M${h}L${I} ${L}L${z} ${D}Z`,color:b2(v),...a||v.a>=1?{}:{opacity:ye(v.a,3)},from:d(C),sweep:ye(R-C,4)}});return a&&s<1?{wedges:_,opacity:ye(s,3)}:{wedges:_}}function _2(e,t,n,r){return (Math.atan2(r-t,n-e)*180/Math.PI%360+360)%360}function x2(e,t,n){if(e>=n.x-1e-6&&e<=n.x+n.width+1e-6&&t>=n.y-1e-6&&t<=n.y+n.height+1e-6)return null;let o=[[n.x,n.y],[n.x+n.width,n.y],[n.x,n.y+n.height],[n.x+n.width,n.y+n.height]],i=_2(e,t,n.x+n.width/2,n.y+n.height/2),s=0,a=0;for(let[c,u]of o){let l=_2(e,t,c,u)-i;l>180?l-=360:l<=-180&&(l+=360),s=Math.min(s,l),a=Math.max(a,l);}return [i+s,i+a]}function w2(e,t){let n=e[1]-e[0],r=t[1]-t[0];if(n>=360||r>=360)return true;let o=((t[0]-e[0])%360+360)%360;return o<=n||o+r>=360}function c0(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((o,i)=>i<t.x||i>=t.x+t.w?o:false))}function C2(e,t=0){let n=[];return e.forEach((r,o)=>{let i=null;r.forEach((s,a)=>{if(!s&&i!==null){n.push(M`M${i+t} ${o+t}h${a-i}v1H${i+t}z`),i=null;return}if(a===r.length-1){if(!s)return;i===null?n.push(M`M${a+t},${o+t} h1v1H${a+t}z`):n.push(M`M${i+t},${o+t} h${a+1-i}v1H${i+t}z`);return}s&&i===null&&(i=a);});}),n.join("")}function cv(e,t,n){return e<7&&t<7||e>=n-7&&t<7||e<7&&t>=n-7}var uv=.9;function s0(e,t){let{margin:n,pixelSize:r,pattern:o="circle",plain:i=false}=t;if(xy(o))return Sy(e,{margin:n,pixelSize:r,pattern:o,scale:t.scale,plain:i});let s=Tc(t.scale,o),a=[],c=e.length,u=r*.45,l=i?()=>false:Dh(c);return e.forEach((f,p)=>{f.forEach((m,h)=>{if(m&&(i||!cv(h,p,c))){let d=(h+.5+n)*r,g=(p+.5+n)*r,_=`${h}-${p}`,b=a.length;if(l(h,p)){a.push(k("rect",{height:x(r),width:x(r),x:x(d-r/2),y:x(g-r/2)},_));return}switch(o){case "circle":a.push(k("circle",{cx:x(d),cy:x(g),r:x(u),transform:M`rotate(0,${d},${g})`},_));break;case "circle-large":{let y=r*.5;a.push(k("circle",{cx:x(d),cy:x(g),r:x(y),transform:M`rotate(0,${d},${g})`},_));}break;case "small-square":{let y=r*.357143;a.push(k("path",{d:M`M ${d-y} ${g-y}v ${r*.714286}h ${r*.714286}v -${r*.714286}z`,transform:M`rotate(0,${d},${g})`},_));}break;case "diamond":{let y=r*.357143;a.push(k("path",{d:M`M ${d-y} ${g-y}v ${r*.714286}h ${r*.714286}v -${r*.714286}z`,transform:M`rotate(45,${d},${g})`},_));}break;case "circle-mixed":{let y=(h+p)%3===0?uv:(h+p)%2===0?1:1.25,S=u*y;a.push(k("circle",{cx:x(d),cy:x(g),r:x(S),transform:M`rotate(0,${d},${g})`},_));}break;case "pacman":{let y=r*.5,S=r*.357143;a.push(k("path",{d:M`M ${d-y} ${g-S}v ${r*.714286}h ${y}a ${y*.5} ${y*.5}, 0, 0, 0, 0 -${r*.714286}h -${y}v -${r*.714286}z`,transform:M`rotate(${(h+p)%2===0?0:90},${d},${g})`},_));}break;case "rounded":{let y=r*.5,S=r*.2;a.push(k("rect",{height:x(r),rx:x(S),ry:x(S),transform:M`rotate(0,${d},${g})`,width:x(r),x:x(d-y),y:x(g-y)},_));}break;case "square":{let y=r*.5;a.push(k("rect",{height:x(r),transform:M`rotate(0,${d},${g})`,width:x(r),x:x(d-y),y:x(g-y)},_));}break;case "vertical-line":{let y=r*.714286,S=r;a.push(k("path",{d:M`M ${d-r*.5} ${g-y*.5}v ${y}h ${S}v -${y}z`,transform:M`rotate(90,${d},${g})`},_));}break;default:a.push(k("circle",{cx:x(d),cy:x(g),r:x(u),transform:M`rotate(0,${d},${g})`},_));}if(s!==1&&a.length>b){let y=a.pop();a.push(k("g",{transform:M`translate(${d},${g}) scale(${x(s,6)}) translate(${-d},${-g})`,children:y},_));}}});}),a}function lv(e,t){let n=e*Math.PI/180,r=t/2,o=t/2,i=Math.sqrt(t*t+t*t)/2,s=r-i*Math.cos(n),a=o-i*Math.sin(n),c=r+i*Math.cos(n),u=o+i*Math.sin(n);return {x1:s,y1:a,x2:c,y2:u}}function u0(e,t){return `${e}-${pr(JSON.stringify(t))}`}function fv(e,t,n,r,o){let i=e;if(e===0)switch(o){case "top-left":i=0;break;case "top-right":i=90;break;case "bottom-left":i=270;break;default:i=0;}let s=i*Math.PI/180,a=t+r/2,c=n+r/2,u=Math.sqrt(r*r+r*r)/2,l=a-u*Math.cos(s),f=c-u*Math.sin(s),p=a+u*Math.cos(s),m=c+u*Math.sin(s);return {x1:l,y1:f,x2:p,y2:m}}function Kc(e,t){return t.map((n,r)=>{let{color:o,opacity:i}=Hc(n.color);return k("stop",{offset:`${n.offset}%`,stopColor:o,stopOpacity:i},`${e}-stop-${r}`)})}function P2(e,t,n,r,o,i){let s=$2(t.stops,t.angle??0,n,r,o),a=s.wedges.map((c,u)=>k("path",{d:c.d,"data-arc":`${c.from} ${c.sweep}`,fill:c.color,fillOpacity:c.opacity,shapeRendering:c.opacity===void 0?void 0:"crispEdges"},`${e}-w-${u}`));return k("pattern",{"data-qrdx-conic":`${x(n)} ${x(r)}`,height:x(i),id:e,patternUnits:"userSpaceOnUse",width:x(i),x:0,y:0,children:s.opacity===void 0?a:k("g",{opacity:s.opacity,children:a})},e)}function mv(e="center"){let[t,n]=e.split("-"),r=e==="center"?"center":t,o=n??(t==="left"||t==="right"?t:"center");return {x:o==="left"?0:o==="right"?1:.5,y:r==="top"?0:r==="bottom"?1:.5}}var pv=["xMin","xMid","xMax"],dv=["YMin","YMid","YMax"];function A2(e,t,n){let r=t.scale??1,o=t.fit==="tile",i=o?n/4*r:n,s=t.underlay?Hc(t.underlay):null,a=o?i:n*r,c=mv(t.position),u=o?0:c.x*(n-a),l=o?0:c.y*(n-a),f=o?"xMidYMid slice":`${pv[c.x*2]??"xMid"}${dv[c.y*2]??"YMid"} ${t.fit==="contain"?"meet":"slice"}`;return Se("pattern",{height:x(i),id:e,patternUnits:"userSpaceOnUse",width:x(i),x:0,y:0,children:[s&&k("rect",{fill:s.color,fillOpacity:s.opacity,height:x(i),width:x(i),x:0,y:0}),k("image",{height:x(a),href:t.src,opacity:(t.opacity??1)<1?t.opacity:void 0,preserveAspectRatio:f,width:x(a),x:x(u),y:x(l)})]},e)}var E2=(e,t)=>u0("img",[e,t]);function hv(e,t,n,r,o,i,s){let a=St(e);if(a.type==="solid")return null;if(a.type==="image"){let u=E2(a,s);return {id:u,element:A2(u,a,s)}}let c=u0(i,[a,t,n,r,o,...a.type==="angular"?[s]:[]]);if(a.type==="linear"){let u=a,l=u.angle??0,{x1:f,y1:p,x2:m,y2:h}=fv(l,t,n,r,o);return {id:c,element:k("linearGradient",{gradientUnits:"userSpaceOnUse",id:c,x1:x(f),x2:x(m),y1:x(p),y2:x(h),children:Kc(c,u.stops)},c)}}if(a.type==="radial"){let u=a,l=t+r/2,f=n+r/2,p=r/2*.97;return {id:c,element:k("radialGradient",{cx:x(l),cy:x(f),fx:x(l),fy:x(f),gradientUnits:"userSpaceOnUse",id:c,r:x(p),children:Kc(c,u.stops)},c)}}return a.type==="angular"?{id:c,element:P2(c,a,t+r/2,n+r/2,r*.75,s)}:null}function a0(e,t,n){let r=St(e);if(r.type==="solid")return null;if(r.type==="image"){let i=E2(r,t);return {id:i,element:A2(i,r,t)}}let o=u0(n,[r,t]);if(r.type==="linear"){let i=r,s=i.angle??0,{x1:a,y1:c,x2:u,y2:l}=lv(s,t);return {id:o,element:k("linearGradient",{gradientUnits:"userSpaceOnUse",id:o,x1:x(a),x2:x(u),y1:x(c),y2:x(l),children:Kc(o,i.stops)},o)}}if(r.type==="radial"){let i=r,s=t/2,a=t/2,c=t/2*.97;return {id:o,element:k("radialGradient",{cx:x(s),cy:x(a),fx:x(s),fy:x(a),gradientUnits:"userSpaceOnUse",id:o,r:x(c),children:Kc(o,i.stops)},o)}}return r.type==="angular"?{id:o,element:P2(o,r,t/2,t/2,t*.75,t)}:null}var Xc=e=>_o(e)||nh(e);function S2(e){let t=new Set,n=[];for(let r of e)r&&!t.has(r.id)&&(t.add(r.id),n.push(r.element));return n}function sn(e,t,n){if(t)return {fill:`url(#${t})`};let r=St(e,n),o=r.type==="solid"?r.color:r.type==="image"?r.underlay??n:n,{color:i,opacity:s}=Hc(o);return s===void 0?{fill:i}:{fill:i,fillOpacity:s}}function Ln(e,t,n,r){if(r==null)return null;let o=e.length,i=Math.floor(t*cs),s=(o+2*n)/t,a=(r.width||i)*s,c=(r.height||i)*s,u=r.x==null?o/2-a/2:r.x*s,l=r.y==null?o/2-c/2:r.y*s,f=null;if(r.excavate){let p=Math.max(0,r.padding??0)*s,m=Math.floor(u-p),h=Math.floor(l-p),d=Math.ceil(a+u+p-m),g=Math.ceil(c+l+p-h);f={x:m,y:h,w:d,h:g};}return {x:u,y:l,h:c,w:a,excavation:f}}function yt(e){let t=e.level??zt,{imageSettings:n}=e,r=e.isOGContext&&n?.excavate&&(t==="L"||t==="M")?"Q":t;if(e.autoLevel&&n&&r!=="H"){let o=Te.QrCode.encodeText(e.value,We[r]).getModules(),i=Ln(o,e.size??ve,ot(o.length,e.margin??Ne,e.shape),n);i&&(i.excavation?i.excavation.w*i.excavation.h:i.w*i.h)/(o.length*o.length)>$h&&(r="H");}return r}function gv(e,t,n,r){let o=t/n,i=e.w*o,s=e.h*o,a=(e.x+r)*o,c=(e.y+r)*o;return {imgWidth:i,imgHeight:s,imgLeft:a,imgTop:c}}function To(e){let{value:t,size:n=ve,level:r=zt,bgColor:o=Me,fgColor:i=Ge,eyeColor:s,dotColor:a,bodyPattern:c="circle",cornerEyePattern:u="gear",cornerEyeDotPattern:l="circle",margin:f=Ne,isOGContext:p=false,imageSettings:m,templateId:h,customTemplate:d,customProps:g,frame:_,art:b,eyeColors:y,moduleScale:S,autoLevel:v,shape:$,frameLabelMarkers:w,partMarkers:A,...C}=e,R=Wc({value:t,size:n,margin:f,level:r,shape:$,autoLevel:v,isOGContext:p},m),I=bt(_),L=I?{}:C,z=be=>I?Zc(be,{size:n,frame:_,bgColor:o,svgProps:C,markLabels:w}):be,D=yt({value:t,size:n,level:r,margin:f,imageSettings:R,isOGContext:p,autoLevel:v,shape:$}),B=Te.QrCode.encodeText(t,We[D]),N=B.getModules(),j=ot(N.length,f,$),te=Yy(t,N.length,f,$),Q=(be,it)=>n0(A,be,it),X=(be,it)=>{let Lt=Kh($,be);return Lt?"circle"in Lt?k("circle",{cx:x(be/2),cy:x(be/2),...it,r:x(be/2),...Q("background")}):k("path",{d:Lt.path,...it,...Q("background")}):k("rect",{...it,height:be,width:be,x:0,y:0,...Q("background")})},me=N.length+j*2,ze=Ln(N,n,j,R),$e=null;if(R!=null&&ze!=null){ze.excavation!=null&&(N=c0(N,ze.excavation));let{imgWidth:be,imgHeight:it,imgLeft:Lt,imgTop:Er}=gv(ze,n,me,j);if(p){let kr=R.shape??"square";$e=k("img",{alt:"Logo",src:R.src,style:{position:"absolute",left:`${x(Lt)}px`,top:`${x(Er)}px`,width:`${x(be)}px`,height:`${x(it)}px`,...kr!=="square"&&{borderRadius:kr==="circle"?"50%":`${x(Math.min(be,it)*Qc)}px`},...R.plate&&{backgroundColor:R.plate,padding:`${x(be*Vc)}px`,boxSizing:"border-box"}}});}else $e=jc(R,{x:Lt,y:Er,w:be,h:it}),A&&($e=So($e,Q("logo")));}let Z=n/me,K=N.length,J=7*Z,Be=1.5*Z,Fn={fgColor:Ue(i,Ge),bgColor:Ue(o,Me)},pt=Mh(b)?Th({art:b,modules:N,version:B.version,margin:j,pixelSize:Z,...Fn,body:be=>s0(be,{margin:j,pixelSize:Z,pattern:c,scale:S})}):null,qt=pt&&A?So(pt,Q("body")):pt,Dn=pt&&b?Fh({art:b,version:B.version,...Fn}):null,W=pt?null:s0(N,{margin:j,pixelSize:Z,pattern:c,scale:S}),de=te?s0(te,{margin:0,pixelSize:Z,pattern:c,scale:S,plain:true}):null,ie=St(o,Me),Re=St(i,Ge),Bo=Xc(ie)?a0(ie,n,"bg-color"):null,yu=Xc(Re)?a0(Re,n,"fg-color"):null,sx=sn(o,Bo?.id??null,Me),j0=sn(i,yu?.id??null,Ge),q0=qt?Se(Qt,{children:[qt,de&&k("g",{...j0,...Q("body"),children:de})]}):Se("g",{...j0,...Q("body"),children:[W,de]}),yr=j*Z,$r=j*Z,xr=(K-7+j)*Z,wr=j*Z,Sr=j*Z,vr=(K-7+j)*Z,Zn=Ue(i,Ge),Cr=be=>y?.[be]?.outer??Dn?.[be]?.outer??s,Pr=be=>y?.[be]?.inner??Dn?.[be]?.inner??a,Ar=(be,it,Lt,Er,kr)=>{let Pu=St(be,Zn);return Xc(Pu)?hv(Pu,it,Lt,J,Er,kr,n):null},$u=Ar(Cr("topLeft"),yr,$r,"top-left","corners-square-color-0-0"),xu=Ar(Cr("topRight"),xr,wr,"top-right","corners-square-color-1-0"),wu=Ar(Cr("bottomLeft"),Sr,vr,"bottom-left","corners-square-color-0-1"),Su=Ar(Pr("topLeft"),yr,$r,"top-left","corners-dot-color-0-0"),vu=Ar(Pr("topRight"),xr,wr,"top-right","corners-dot-color-1-0"),Cu=Ar(Pr("bottomLeft"),Sr,vr,"bottom-left","corners-dot-color-0-1"),W0=sn(Cr("topLeft"),$u?.id??null,Zn),H0=sn(Cr("topRight"),xu?.id??null,Zn),Y0=sn(Cr("bottomLeft"),wu?.id??null,Zn),X0=sn(Pr("topLeft"),Su?.id??null,Zn),K0=sn(Pr("topRight"),vu?.id??null,Zn),J0=sn(Pr("bottomLeft"),Cu?.id??null,Zn),eg=Uc(yr,$r,J,u,"top-left"),tg=Gc(yr+J/2,$r+J/2,Be,l,"top-left"),ng=Uc(xr,wr,J,u,"top-right"),rg=Gc(xr+J/2,wr+J/2,Be,l,"top-right"),og=Uc(Sr,vr,J,u,"bottom-left"),ig=Gc(Sr+J/2,vr+J/2,Be,l,"bottom-left"),ax=Se(Qt,{children:[k("defs",{children:S2([Bo,yu,$u,xu,wu,Su,vu,Cu])}),X(n,sx),q0,k("g",{...W0,...Q("eye-outer","top-left"),children:k("path",{d:eg,fillRule:"evenodd",transform:M`rotate(0,${yr+J/2},${$r+J/2})`})}),k("g",{...X0,...Q("eye-centre","top-left"),children:tg}),k("g",{...H0,...Q("eye-outer","top-right"),children:k("path",{d:ng,fillRule:"evenodd",transform:M`rotate(0,${xr+J/2},${wr+J/2})`})}),k("g",{...K0,...Q("eye-centre","top-right"),children:rg}),k("g",{...Y0,...Q("eye-outer","bottom-left"),children:k("path",{d:og,fillRule:"evenodd",transform:M`rotate(0,${Sr+J/2},${vr+J/2})`})}),k("g",{...J0,...Q("eye-centre","bottom-left"),children:ig}),$e]}),sg=d||(h?d2(h):void 0);if(sg){let it=Xc(ie)?a0(ie,300,"bg-color-template"):null,Lt=sn(o,it?.id??null,Me),Er=Se("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[k("defs",{children:S2([it,yu,$u,xu,wu,Su,vu,Cu])}),X(300,Lt),Se("g",{transform:`scale(${x(300/n,6)})`,children:[q0,k("g",{...W0,...Q("eye-outer","top-left"),children:k("path",{d:eg,fillRule:"evenodd",transform:M`rotate(0,${yr+J/2},${$r+J/2})`})}),k("g",{...X0,...Q("eye-centre","top-left"),children:tg}),k("g",{...H0,...Q("eye-outer","top-right"),children:k("path",{d:ng,fillRule:"evenodd",transform:M`rotate(0,${xr+J/2},${wr+J/2})`})}),k("g",{...K0,...Q("eye-centre","top-right"),children:rg}),k("g",{...Y0,...Q("eye-outer","bottom-left"),children:k("path",{d:og,fillRule:"evenodd",transform:M`rotate(0,${Sr+J/2},${vr+J/2})`})}),k("g",{...J0,...Q("eye-centre","bottom-left"),children:ig}),$e]})]}),kr=300/n,cx={pixelSize:Z*kr,url:t},ag=sg.wrapper(Er,{fgColor:i,bgColor:o,...g||{},...C},cx),ux={...ag?.props?.style||{},width:void 0,height:void 0,...L.style};return z(So(ag,{...L,width:n,height:n,style:ux}))}return z(k("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...L,children:ax}))}var pE=(()=>{try{new Path2D().addPath(new Path2D);}catch{return false}return true})(),dE=e=>{let t=e.trim().replace(/^#/,"");t.length===3||t.length===4?t=t.slice(0,3).split("").map(r=>r+r).join(""):t.length===8&&(t=t.slice(0,6));let n=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return n?{r:Number.parseInt(n[1],16),g:Number.parseInt(n[2],16),b:Number.parseInt(n[3],16)}:null},zo=(e,t,n)=>{let[r,o,i]=[e,t,n].map(s=>(s/=255,s<=.03928?s/12.92:((s+.055)/1.055)**2.4));return .2126*r+.7152*o+.0722*i},v2=e=>{let t=Ae(e);if(!t)return null;let n=r=>r*t.a+255*(1-t.a);return {r:n(t.r),g:n(t.g),b:n(t.b)}},hE=(e,t)=>{let n=v2(e),r=v2(t);if(!(n&&r))return 1;let o=zo(n.r,n.g,n.b),i=zo(r.r,r.g,r.b),s=Math.max(o,i),a=Math.min(o,i);return (s+.05)/(a+.05)},gE=e=>e>=7?{level:"AAA",warning:false,message:"Excellent contrast"}:e>=4.5?{level:"AA",warning:false,message:"Good contrast"}:e>=3?{level:"AA Large",warning:true,message:"Low contrast - may be difficult to scan"}:{level:"Fail",warning:true,message:"Poor contrast - QR code may not scan properly"};var _v=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),bv=new Map([["className","class"],["tabIndex","tabindex"],["dir","dir"],["role","role"],["viewBox","viewBox"],["width","width"],["height","height"],["xlinkActuate","xlink:actuate"],["xlinkArcrole","xlink:arcrole"],["xlinkRole","xlink:role"],["xlinkShow","xlink:show"],["xlinkTitle","xlink:title"],["xlinkType","xlink:type"],["xmlBase","xml:base"],["xmlLang","xml:lang"],["xmlSpace","xml:space"]]),yv=new Set(["children","dangerouslySetInnerHTML","key","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","ref"]),$v=new Set(["inert","allowFullScreen","async","autoPlay","controls","credentialless","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"]),xv=new Set(["autoFocus","multiple","muted"]),wv=new Set(["contentEditable","spellCheck","draggable","value","autoReverse","externalResourcesRequired","focusable","preserveAlpha"]),Sv=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" ")),k2=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",vv=new RegExp(`^[${k2}][${k2}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Jc=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,Cv=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i,Pv="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')",Av=e=>Cv.test(e)?Pv:e,M2=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Ev=/["'&<>]/;function l0(e){if(!Ev.test(e))return e;let t="",n=0;for(let r=0;r<e.length;r++){let o;switch(e.charCodeAt(r)){case 34:o=""";break;case 38:o="&";break;case 39:o="'";break;case 60:o="<";break;case 62:o=">";break;default:continue}t+=e.slice(n,r)+o,n=r+1;}return t+e.slice(n)}var an=e=>typeof e=="function"||typeof e=="symbol",R2=new Map,kv=e=>{let t=R2.get(e);return t===void 0&&(t=e.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^ms-/,"-ms-"),R2.set(e,t)),t};function Rv(e){if(typeof e=="string")return e;if(typeof e!="object"||e===null)return "";let t="";for(let n of Object.keys(e)){let r=e[n];if(r==null||typeof r=="boolean"||r==="")continue;let o;if(n.startsWith("--"))o=`${n}:${`${r}`.trim()}`;else {let i=typeof r=="number"?r===0||Sv.has(n)?`${r}`:`${r}px`:`${r}`.trim();o=`${kv(n)}:${i}`;}t=t?`${t};${o}`:o;}return t}function No(e,t){if(t==null||yv.has(e))return null;let n=bv.get(e);if(n!==void 0)return an(t)||typeof t=="boolean"?null:{name:n,value:`${t}`};switch(e){case "style":{let o=Rv(t);return o?{name:"style",value:o}:null}case "src":case "href":case "action":case "formAction":case "xlinkHref":return (e==="src"||e==="href")&&t===""||an(t)||typeof t=="boolean"?null:{name:e==="xlinkHref"?"xlink:href":e,value:Av(`${t}`)};case "capture":case "download":return t===true?{name:e,value:""}:t===false||an(t)?null:{name:e,value:`${t}`};case "cols":case "rows":case "size":case "span":return an(t)||Number.isNaN(Number(t))||!(t>=1)?null:{name:e,value:`${t}`};case "rowSpan":case "start":return an(t)||Number.isNaN(Number(t))?null:{name:e,value:`${t}`};}if(xv.has(e))return t&&!an(t)?{name:e.toLowerCase(),value:""}:null;if(wv.has(e))return an(t)?null:{name:e,value:`${t}`};if($v.has(e))return t&&!an(t)?{name:e,value:""}:null;if(e.length>2&&(e[0]==="o"||e[0]==="O")&&(e[1]==="n"||e[1]==="N"))return null;let r=_v.get(e)??e;if(!vv.test(r)||an(t))return null;if(typeof t=="boolean"){let o=r.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-")return null}return {name:r,value:`${t}`}}var I2="http://www.w3.org/2000/svg",L2="http://www.w3.org/1999/xhtml",Mv="http://www.w3.org/1999/xlink",Iv="http://www.w3.org/XML/1998/namespace",Lv="http://www.w3.org/2000/xmlns/";function zv(e,t,n){t==="xmlns"||t.startsWith("xmlns:")?e.setAttributeNS(Lv,t,n):t.startsWith("xlink:")?e.setAttributeNS(Mv,t,n):t.startsWith("xml:")?e.setAttributeNS(Iv,t,n):e.setAttribute(t,n);}function Ji(e,t,n,r){if(t==null||typeof t=="boolean")return;if(typeof t=="string"||typeof t=="number"||typeof t=="bigint"){e.appendChild(r.createTextNode(`${t}`));return}if(Array.isArray(t)){for(let c of t)Ji(e,c,n,r);return}if(!ur(t))throw new TypeError("qrdx: can't render this value as DOM nodes");let{type:o,props:i}=t;if(vo(o)){Ji(e,i.children,n,r);return}if(typeof o=="function"){Ji(e,o(i),n,r);return}if(!Jc.test(o))throw new TypeError(`qrdx: invalid element name: ${o}`);let s=o==="svg"?I2:n,a=r.createElementNS(s,o);for(let c of Object.keys(i)){let u=No(c,i[c]);u&&zv(a,u.name,u.value);}Ji(a,i.children,s===I2&&o==="foreignObject"?L2:s,r),e.appendChild(a);}function es(e,t=document){let n=t.createDocumentFragment();return Ji(n,e,L2,t),n}function Vt(e){if(e==null||typeof e=="boolean")return "";if(typeof e=="string")return l0(e);if(typeof e=="number"||typeof e=="bigint")return `${e}`;if(Array.isArray(e)){let t="";for(let n of e)t+=Vt(n);return t}if(!ur(e))throw new TypeError("qrdx: can't render this value as SVG markup");return Tv(e)}function Tv(e){let{type:t,props:n}=e;if(vo(t))return Vt(n.children);if(typeof t=="function")return Vt(t(n));if(!Jc.test(t))throw new TypeError(`qrdx: invalid element name: ${t}`);let r=`<${t}`;for(let s of Object.keys(n)){let a=No(s,n[s]);a&&(r+=` ${a.name}="${l0(a.value)}"`);}if(M2.has(t))return `${r}/>`;let o=n.dangerouslySetInnerHTML?.__html,i=o==null?Vt(n.children):`${o}`;return `${r}>${i}</${t}>`}function f0(e){return Vt(To(e))}function Nv(e,t=document){return es(To(e),t).firstChild}var Ov=16384;var m0=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Fv=8,p0=class{buffer;position=0;bits=0;used=0;constructor(t){this.buffer=new Uint8Array(Math.max(t,64));}write(t,n){if(n!==0)for(this.bits|=t<<this.used,this.used+=n;this.used>=8;){if(this.position===this.buffer.length){let r=new Uint8Array(this.buffer.length*2);r.set(this.buffer),this.buffer=r;}this.buffer[this.position++]=this.bits&255,this.bits>>>=8,this.used-=8;}}finish(){return this.used>0&&this.write(0,8-this.used),this.buffer.subarray(0,this.position)}};function D2(e,t){let n=new Uint8Array(e.length),r=[];for(let u=0;u<e.length;u++)(e[u]??0)>0&&r.push(u);if(r.length===0)return n;if(r.length===1)return n[r[0]]=1,n;let o=r.length,i=2*o-1,s=new Float64Array(i),a=new Int32Array(i),c=new Uint8Array(i);for(let u=1;;u*=2){for(let d=0;d<o;d++)s[d]=Math.max(e[r[d]]??0,u);let l=Array.from({length:o},(d,g)=>g).sort((d,g)=>s[d]-s[g]||d-g),f=0,p=o,m=d=>f<o&&(p>=d||s[l[f]]<=s[p])?l[f++]:p++;for(let d=o;d<i;d++){let g=m(d),_=m(d);s[d]=s[g]+s[_],a[g]=d,a[_]=d;}c[i-1]=0;let h=0;for(let d=i-2;d>=0;d--){let g=c[a[d]]+1;c[d]=g,d<o&&g>h&&(h=g);}if(h<=t){for(let d=0;d<o;d++)n[r[d]]=c[d];return n}}}function Dv(e,t){let n=0;for(let r=0;r<t;r++)n=n<<1|e>>r&1;return n}function Z2(e){let t=new Uint16Array(16),n=0;for(let a of e)a>0&&(t[a]=t[a]+1,n++);let r=new Uint16Array(16),o=0;for(let a=1;a<=15;a++)o=o+t[a-1]<<1,r[a]=o;let i=new Uint16Array(e.length),s=new Uint8Array(e.length);return e.forEach((a,c)=>{if(a===0)return;let u=r[a];r[a]=u+1,i[c]=Dv(u,a),s[c]=n===1?0:a;}),{lengths:e,codes:i,emitted:s}}function _r(e,t,n){e.write(t.codes[n],t.emitted[n]);}function Zv(e){let t=[],n=i=>t.push({code:i,extra:0,extraBits:0}),r=Fv,o=0;for(;o<e.length;){let i=e[o],s=1;for(;o+s<e.length&&e[o+s]===i;)s++;o+=s;let a=s;if(i===0){for(;a>0;)if(a<3)for(;a>0;a--)n(0);else if(a<=10)t.push({code:17,extra:a-3,extraBits:3}),a=0;else {let c=Math.min(a,138);t.push({code:18,extra:c-11,extraBits:7}),a-=c;}continue}for(i!==r&&(n(i),r=i,a--);a>0;)if(a<3)for(;a>0;a--)n(i);else {let c=Math.min(a,6);t.push({code:16,extra:c-3,extraBits:2}),a-=c;}}return t}function Bv(e,t){let n=[];if(t.forEach((a,c)=>{a>0&&n.push(c);}),n.length<=2&&n.every(a=>a<256)){let[a=0,c]=n;e.write(1,1),e.write(n.length===2?1:0,1),a<2?(e.write(0,1),e.write(a,1)):(e.write(1,1),e.write(a,8)),c!==void 0&&e.write(c,8);return}let r=Zv(t),o=new Uint32Array(19);for(let a of r)o[a.code]=o[a.code]+1;let i=Z2(D2(o,7)),s=m0.length;for(;s>4&&i.lengths[m0[s-1]]===0;)s--;e.write(0,1),e.write(s-4,4);for(let a=0;a<s;a++)e.write(i.lengths[m0[a]],3);e.write(0,1);for(let a of r)_r(e,i,a.code),e.write(a.extra,a.extraBits);}function eu(e){let t=e-1;if(t<4)return {symbol:t,extra:0,extraBits:0};let n=31-Math.clz32(t),r=t>>n-1&1,o=n-1;return {symbol:2*n+r,extra:t&(1<<o)-1,extraBits:o}}function z2(e,t,n,r){let o=0;for(;o<r&&e[t+o]===e[t+o-n];)o++;return o}function T2(e,t,n){let r=e.length,o=0;for(;o<r;){let i=Math.min(4096,r-o),s=o>=1?z2(e,o,1,i):0,a=o>=t?z2(e,o,t,i):0;if(Math.max(s,a)>=3){a>=s?(n.copy(a,t===1?2:1),o+=a):(n.copy(s,2),o+=s);continue}n.literal(e[o]),o++;}}var N2=20;function O2(e,t,n){for(let r=0;r<n.length;r++)e[t+r]=n.charCodeAt(r);}function F2(e,t,n){e[t]=n&255,e[t+1]=n>>>8&255,e[t+2]=n>>>16&255,e[t+3]=n>>>24&255;}function h0(e,t,n){if(!(Number.isInteger(t)&&Number.isInteger(n))||t<1||n<1||t>16384||n>16384)throw new RangeError(`WebP images are 1 to 16384 pixels wide and high (got ${t} \xD7 ${n})`);let r=t*n;if(e.length<r*4)throw new RangeError(`Expected ${r*4} bytes of RGBA for ${t} \xD7 ${n}, got ${e.length}`);let o=new Uint32Array(r),i=false;for(let v=0;v<r;v++){let $=v*4,w=e[$],A=e[$+1],C=e[$+2],R=e[$+3];R!==255&&(i=true),o[v]=(R<<24|(w-A&255)<<16|A<<8|C-A&255)>>>0;}let s=new Uint32Array(280),a=new Uint32Array(256),c=new Uint32Array(256),u=new Uint32Array(256),l=new Uint32Array(40);T2(o,t,{literal(v){s[v>>>8&255]++,a[v>>>16&255]++,c[v&255]++,u[v>>>24]++;},copy(v,$){s[256+eu(v).symbol]++,l[eu($).symbol]++;}});let f=[s,a,c,u,l].map(v=>D2(v,15)),[p,m,h,d,g]=f.map(Z2),_=new p0(Math.ceil(r/4)+1024);_.write(47,8),_.write(t-1,14),_.write(n-1,14),_.write(i?1:0,1),_.write(0,3),_.write(1,1),_.write(2,2),_.write(0,1),_.write(0,1),_.write(0,1);for(let v of f)Bv(_,v);T2(o,t,{literal(v){_r(_,p,v>>>8&255),_r(_,m,v>>>16&255),_r(_,h,v&255),_r(_,d,v>>>24);},copy(v,$){let w=eu(v);_r(_,p,256+w.symbol),_.write(w.extra,w.extraBits);let A=eu($);_r(_,g,A.symbol),_.write(A.extra,A.extraBits);}});let b=_.finish(),y=b.length+(b.length&1),S=new Uint8Array(N2+y);return O2(S,0,"RIFF"),F2(S,4,S.length-8),O2(S,8,"WEBPVP8L"),F2(S,16,b.length),S.set(b,N2),S}function d0(e,t,n){return String.fromCharCode(...e.subarray(t,t+n))}function B2(e){return e.length>=12&&d0(e,0,4)==="RIFF"&&d0(e,8,4)==="WEBP"}function g0(e){if(!B2(e))return null;let t=12;for(;t+8<=e.length;){let n=d0(e,t,4);if(n==="VP8L")return "lossless";if(n==="VP8 ")return "lossy";let r=(e[t+4]|e[t+5]<<8|e[t+6]<<16|e[t+7]<<24)>>>0;t+=8+r+(r&1);}return null}function Gv(e,t,n){return typeof e.toBlob!="function"?Promise.resolve(null):new Promise(r=>{try{e.toBlob(r,t,n);}catch{r(null);}})}async function tu(e,t={}){let n=t.quality!==void 0,r=n?Math.min(1,Math.max(0,Number(t.quality))):1,o=await Gv(e,"image/webp",r);if(o){let c=new Uint8Array(await o.arrayBuffer()),u=g0(c);if(u==="lossless"||n&&u==="lossy")return new Blob([c],{type:"image/webp"})}let i=e.getContext("2d");if(!i)throw new Error("Could not get canvas context");let{data:s}=i.getImageData(0,0,e.width,e.height),a=h0(s,e.width,e.height);return new Blob([a],{type:"image/webp"})}var G2=32768;async function ts(e){let t=new Uint8Array(await e.arrayBuffer()),n="";for(let r=0;r<t.length;r+=G2)n+=String.fromCharCode(...t.subarray(r,r+G2));return `data:${e.type||"application/octet-stream"};base64,${btoa(n)}`}async function Rt(e){let t={...e};if(e.imageSettings?.src)try{let l=await Uv(e.imageSettings.src);t={...e,imageSettings:{...e.imageSettings,src:l}};}catch{let{imageSettings:l,...f}=e;t=f;}let{hideLogo:n,url:r,logo:o,scale:i,frameLabelMarkers:s,partMarkers:a,...c}=t,u=f0({...c,templateId:t.templateId,customTemplate:t.customTemplate});return `data:image/svg+xml,${encodeURIComponent(u)}`}var Uv=e=>new Promise((t,n)=>{if(e.startsWith("data:")){t(e);return}let r=new Image;r.crossOrigin="anonymous",r.onload=()=>{try{let o=document.createElement("canvas");o.width=r.naturalWidth||r.width,o.height=r.naturalHeight||r.height;let i=o.getContext("2d");if(!i){n(new Error("Could not get canvas context"));return}i.drawImage(r,0,0);let s=o.toDataURL("image/png");o.remove(),t(s);}catch(o){n(new Error(`Failed to convert image to base64: ${o}`));}},r.onerror=()=>{n(new Error(`Could not load image from ${e.slice(0,100)}... Check CORS settings or use a data URL.`));},r.src=e;});async function Oo(e,t,n){let r=await Rt(e),o=decodeURIComponent(r.replace("data:image/svg+xml,","")),i;try{let s=new TextEncoder().encode(o),a=Array.from(s,u=>String.fromCharCode(u)).join("");i=`data:image/svg+xml;base64,${btoa(a)}`;}catch(s){throw new Error(`Failed to encode SVG for canvas conversion: ${s}`)}return new Promise((s,a)=>{let c=document.createElement("canvas"),u=c.getContext("2d");if(!u){a(new Error("Could not get canvas context"));return}let l=new Image,{width:f,height:p}=rn(e.size||ve,e.frame);c.width=Math.round(f),c.height=Math.round(p);let m=setTimeout(()=>{c.remove(),a(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);l.onload=()=>{clearTimeout(m);try{if(t==="image/jpeg"&&(u.fillStyle="white",u.fillRect(0,0,c.width,c.height)),u.drawImage(l,0,0,c.width,c.height),n)s(c);else if(t==="image/webp")tu(c).then(ts).then(s,a).finally(()=>c.remove());else {let h=c.toDataURL(t,1);c.remove(),s(h);}}catch(h){clearTimeout(m),c.remove(),a(new Error(`Failed to draw SVG to canvas: ${h}`));}},l.onerror=()=>{clearTimeout(m),c.remove(),a(new Error("Could not load SVG"));},l.src=i;})}var U2=["gradientUnits","gradientTransform","spreadMethod"],Qv={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},Vv={r:0,g:0,b:0,a:1};function Q2(e,t){for(let n of (e.attrs.style??"").split(";")){let[r,...o]=n.split(":");if(r?.trim()===t)return o.join(":").trim()}return e.attrs[t]}function _0(e){return e.name==="linearGradient"?"linear":e.name==="radialGradient"?"radial":null}function jv(e){let t=[],n=0;for(let r of e.children){if(r.name!=="stop")continue;let o=(r.attrs.offset??"0").trim(),i=Number.parseFloat(o),s=Number.isFinite(i)?o.endsWith("%")?i/100:i:0;n=Math.max(n,Math.min(Math.max(s,0),1));let a=Q2(r,"stop-color")??"#000000",c=Ae(a==="currentColor"?"#000000":a)??Vv,u=Number.parseFloat(Q2(r,"stop-opacity")??"1");t.push({offset:n,color:Number.isFinite(u)?{...c,a:c.a*Math.min(Math.max(u,0),1)}:c});}return t}function nu(e){let t=new Map,n=o=>{let i=o.attrs.id;_0(o)&&i&&!t.has(i)&&t.set(i,o);for(let s of o.children)n(s);};n(e);let r=new Map;for(let[o,i]of t){let s=_0(i),a={},c=[],u=new Set,l=i;for(;l&&!u.has(l);){u.add(l);let f=_0(l)===s?[...U2,...Qv[s]]:U2;for(let m of f){let h=l.attrs[m];a[m]===void 0&&h!==void 0&&(a[m]=h);}c.length===0&&(c=jv(l));let p=l.attrs.href??l.attrs["xlink:href"];l=p?.startsWith("#")?t.get(p.slice(1)):void 0;}r.set(o,{kind:s,attrs:a,stops:c});}return r}function b0(e){let t=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=(f,p)=>{t=Math.min(t,f),r=Math.max(r,f),n=Math.min(n,p),o=Math.max(o,p);},s=(f,p,m,h)=>{let d=-f+3*p-3*m+h,g=2*(f-2*p+m),_=p-f;if(Math.abs(d)<1e-12)return Math.abs(g)<1e-12?[]:[-_/g];let b=g*g-4*d*_;if(b<0)return [];let y=Math.sqrt(b);return [(-g+y)/(2*d),(-g-y)/(2*d)]},a=(f,p,m,h,d)=>{let g=1-f;return g*g*g*p+3*g*g*f*m+3*g*f*f*h+f**3*d},c=0,u=0,l=[0,0];for(let f of e)if(f.op==="M"&&(l=[f.x,f.y]),f.op==="M"||f.op==="L")i(f.x,f.y),c=f.x,u=f.y;else if(f.op==="C"){i(f.x,f.y);for(let p of [...s(c,f.x1,f.x2,f.x),...s(u,f.y1,f.y2,f.y)])p>0&&p<1&&i(a(p,c,f.x1,f.x2,f.x),a(p,u,f.y1,f.y2,f.y));c=f.x,u=f.y;}else [c,u]=l;return Number.isFinite(t)?{x:t,y:n,width:r-t,height:o-n}:null}var qv=e=>e[0]*e[3]-e[1]*e[2];function zn(e){let t=qv(e);if(!Number.isFinite(t)||Math.abs(t)<1e-12)return null;let[n,r,o,i,s,a]=e;return [i/t,-r/t,-o/t,n/t,(o*a-i*s)/t,(r*s-n*a)/t]}function j2(e,t,n){let{kind:r,attrs:o,stops:i}=e,s=i[0],a=i.at(-1);if(!(s&&a)||i.every($=>$.color.a===0))return null;if(i.length===1)return s.color;let c=o.gradientUnits==="userSpaceOnUse",u=yc;if(!c){let $=b0(t);if(!$||$.width<=0||$.height<=0)return null;u=[$.width,0,0,$.height,$.x,$.y];}let l=ke(u,Zt(o.gradientTransform));if(!zn(l))return a.color;let[f,p]=n,m=Math.sqrt((f*f+p*p)/2),h=($,w)=>{let A=Number.parseFloat($);return Number.isFinite(A)?$.trim().endsWith("%")?A/100*(c?w:1):A:null},d=($,w,A)=>h(o[$]??w,A)??h(w,A)??0;if(r==="linear"){let $=[d("x1","0%",f),d("y1","0%",p),d("x2","100%",f),d("y2","0%",p)],[w,A,C,R]=$;return w===C&&A===R?a.color:{kind:r,coords:$,matrix:l,stops:i}}let g=d("cx","50%",f),_=d("cy","50%",p),b=d("r","50%",m),y=o.fx===void 0?g:d("fx","50%",f),S=o.fy===void 0?_:d("fy","50%",p),v=Math.max(0,d("fr","0%",m));return b<0?null:b===0?a.color:{kind:r,coords:[y,S,v,g,_,b],matrix:l,stops:i}}function ru(e){return e.map(t=>x(t,6)).join(" ")}function Wv(e,t){return (t==="cmyk"?En(e.r,e.g,e.b):[e.r/255,e.g/255,e.b/255]).map(r=>x(r,4)).join(" ")}var V2=(e,t)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${e}] /C1 [${t}] /N 1 >>`;function Hv(e,t){let n=[],r=e.map(a=>ye(a.offset,4)),o=e.map(a=>Wv(a.color,t)),i=r[0],s=r.at(-1);if(i>0){let a=o[0];n.push({from:0,to:i,c0:a,c1:a});}for(let a=0;a+1<e.length;a++){let c=r[a],u=r[a+1];u>c&&n.push({from:c,to:u,c0:o[a],c1:o[a+1]});}if(s<1){let a=o.at(-1);n.push({from:s,to:1,c0:a,c1:a});}if(n.length===1){let[a]=n;return V2(a.c0,a.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${n.map(a=>V2(a.c0,a.c1)).join(" ")}]`,`/Bounds [${n.slice(1).map(a=>x(a.from,4)).join(" ")}]`,`/Encode [${n.map(()=>"0 1").join(" ")}] >>`].join(" ")}function ou(e,t){return [`<< /ShadingType ${e.kind==="linear"?2:3}`,`/ColorSpace /Device${t==="cmyk"?"CMYK":"RGB"}`,`/Coords [${e.coords.map(n=>x(n,6)).join(" ")}]`,`/Function ${Hv(e.stops,t)}`,"/Extend [true true] >>"].join(" ")}function Yv(e,t){if(e.op==="Z")return e;if(e.op==="C"){let[o,i]=re(t,e.x1,e.y1),[s,a]=re(t,e.x2,e.y2),[c,u]=re(t,e.x,e.y);return {op:"C",x1:o,y1:i,x2:s,y2:a,x:c,y:u}}let[n,r]=re(t,e.x,e.y);return {op:e.op,x:n,y:r}}var q2={r:255,g:255,b:255,a:1},Xv=/^url\(\s*#bg-color-/,iu=/^url\(\s*#([^)\s]+)\s*\)/,Kv=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function ae(e,t){let n=e.attrs.style;if(n)for(let r of n.split(";")){let[o,...i]=r.split(":");if(o?.trim()===t)return i.join(":").trim()}return e.attrs[t]}function oe(e,t,n=0){if(e===void 0||e==="")return n;let r=Number.parseFloat(e);return Number.isNaN(r)?n:e.trim().endsWith("%")?r/100*t:r}function ns(e,t){if((e.name==="linearGradient"||e.name==="radialGradient")&&e.attrs.id){let n=e.children.find(o=>o.name==="stop"),r=n&&(ae(n,"stop-color")??"#000000");r&&t.set(e.attrs.id,r);}for(let n of e.children)ns(n,t);return t}function rs(e,t){if(e.name==="image"){let n=e.attrs.href??e.attrs["xlink:href"];n&&t.add(n);}for(let n of e.children)rs(n,t);return t}function su(e){return /^data:image\/png[;,]/i.test(e)?"PNG":/^data:image\/jpe?g[;,]/i.test(e)?"JPEG":null}async function au(e){return typeof document>"u"||typeof Image>"u"?null:await new Promise(t=>{let n=new Image;n.crossOrigin="anonymous",n.onload=()=>{let r=document.createElement("canvas"),o=Math.max(n.naturalWidth||512,n.naturalHeight||512),i=Math.min(1024/o,4);r.width=Math.round((n.naturalWidth||512)*i),r.height=Math.round((n.naturalHeight||512)*i);let s=r.getContext("2d");if(!s){t(null);return}s.drawImage(n,0,0,r.width,r.height);try{t(r.toDataURL("image/png"));}catch{t(null);}},n.onerror=()=>t(null),n.src=e;})}function W2(e,t,n){let r={x:oe(e.attrs.x,t[0]),y:oe(e.attrs.y,t[1]),width:oe(e.attrs.width,t[0]),height:oe(e.attrs.height,t[1])};if(r.width<=0||r.height<=0)return null;let o=(e.attrs.preserveAspectRatio??"").trim();if(!o||o.startsWith("none")||!n||!(n.width>0&&n.height>0))return {draw:r,clip:null};let[i="xMidYMid",s="meet"]=o.split(/\s+/),a=s==="slice",c=(a?Math.max:Math.min)(r.width/n.width,r.height/n.height),u=n.width*c,l=n.height*c,f=p=>{let m=p==="x"?i.slice(0,4):i.slice(4);return m.endsWith("Min")?0:m.endsWith("Max")?1:.5};return {draw:{x:r.x+(r.width-u)*f("x"),y:r.y+(r.height-l)*f("y"),width:u,height:l},clip:a?r:null}}function H2(e,t){e.name==="clipPath"&&e.attrs.id&&t.set(e.attrs.id,e);for(let n of e.children)H2(n,t);return t}function Y2(e,t){e.name==="pattern"&&e.attrs.id&&t.set(e.attrs.id,e);for(let n of e.children)Y2(n,t);return t}function Jv(e,t){let[n,r]=t,o=(i,s)=>oe(e.attrs[i],s);switch(e.name){case "path":return en(e.attrs.d??"");case "rect":{let i=e.attrs.rx??e.attrs.ry,s=e.attrs.ry??e.attrs.rx;return Gt(o("x",n),o("y",r),o("width",n),o("height",r),oe(i,n),oe(s,r))}case "circle":{let i=o("r",Math.hypot(n,r)/Math.SQRT2);return Bt(o("cx",n),o("cy",r),i,i)}case "ellipse":return Bt(o("cx",n),o("cy",r),o("rx",n),o("ry",r));default:return []}}var Fo=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=q2;paper=q2;background=null;onPaper=false;inConic=false;constructor(t,n=null){this.gradients=t,this.shadings=n;}resolveColor(t){if(!t||t==="none")return null;let n=iu.exec(t);if(n)return this.resolveColor(this.gradients.get(n[1]));let r=Ae(t==="currentColor"?"#000000":t);return r&&r.a>0?r:null}shadedGradient(t){let n=t?iu.exec(t)?.[1]:void 0;return n?this.shadings?.get(n):void 0}resolveFill(t,n,r,o=1){if(o<=0)return null;let i=this.patternOf(t);if(i)return {pattern:i,alpha:o};let s=this.shadedGradient(t);if(s){let u=j2(s,n,r);if(!u)return null;if("coords"in u)return {gradient:u,alpha:o};let l={...u,a:u.a*o};return l.a>0?{color:l}:null}let a=this.resolveColor(t);if(!a)return null;let c={...a,a:a.a*o};return c.a>0?{color:c}:null}patternOf(t){let n=t?iu.exec(t)?.[1]:void 0,r=n?this.patterns.get(n):void 0;if(!(r?.attrs.patternUnits!=="userSpaceOnUse"||(r.attrs.patternContentUnits??"userSpaceOnUse")!=="userSpaceOnUse"||r.attrs.viewBox))return r}flatten(t){if(t.a>=1)return t;let n=this.background,r=n!==null&&Math.abs(n.r-t.r)<.5&&Math.abs(n.g-t.g)<.5&&Math.abs(n.b-t.b)<.5&&Math.abs(n.a-t.a)<.002;return Yc(t,this.onPaper||r?this.paper:this.backdrop)}paintPattern(t,n,r,o){let i=b0(t);if(!i||i.width<=0||i.height<=0)return true;let[s,a]=n.viewport,c=oe(r.attrs.x,s),u=oe(r.attrs.y,a),l=oe(r.attrs.width,s),f=oe(r.attrs.height,a);if(!(l>0&&f>0))return true;let p=Zt(r.attrs.patternTransform),m=zn(p);if(!m)return true;if(!this.beginClip(t,n.matrix,n.fillRule==="evenodd"))return false;let h=this.inConic;this.inConic=r.attrs["data-qrdx-conic"]!==void 0;try{let d=[re(m,i.x,i.y),re(m,i.x+i.width,i.y),re(m,i.x,i.y+i.height),re(m,i.x+i.width,i.y+i.height)],g=d.map(([z])=>z),_=d.map(([,z])=>z),b=Math.min(...g),y=Math.max(...g),S=Math.min(..._),v=Math.max(..._),$=Math.floor((b-c)/l),w=Math.ceil((y-c)/l)-1,A=Math.floor((S-u)/f),C=Math.ceil((v-u)/f)-1,R=(w-$+1)*(C-A+1);if(R>4096)return !0;let I=(r.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),L=ke(n.matrix,p);for(let z=A;z<=C;z++)for(let D=$;D<=w;D++){let B=c+D*l,N=u+z*f,j=ke(L,[1,0,0,1,B,N]),te={x:b-B,y:S-N,width:y-b,height:v-S},Q=I.length===2&&I.every(Number.isFinite)?x2(I[0],I[1],te):null,X=R>1&&this.beginClip([{op:"M",x:0,y:0},{op:"L",x:l,y:0},{op:"L",x:l,y:f},{op:"L",x:0,y:f},{op:"Z"}],j,!1);try{let me={matrix:j,viewport:n.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:o},ze=($e,Z)=>{for(let K of $e){if(K.name==="g"&&!K.attrs.transform){let J=Number.parseFloat(K.attrs.opacity??"1");ze(K.children,{...Z,opacity:(Z.opacity??1)*(Number.isFinite(J)?J:1)});continue}if(Q&&K.attrs["data-arc"]){let[J,Be]=K.attrs["data-arc"].split(/\s+/).map(Number);if(!w2([J,J+Be],Q))continue}this.walk(K,Z);}};ze(r.children,me);}finally{X&&this.endClip();}}}finally{this.inConic=h,this.endClip();}return true}paintBleed(t,n,r,o){if(!this.shadedGradient(r))return false;let[i,s]=this.viewportMatrix({...t,attrs:{...t.attrs,x:"0",y:"0"}},{...n,matrix:ke(n.matrix,Zt(t.attrs.transform))}),a=zn(i);if(!a)return false;let[c,u,l,f]=o,m=[[c,u],[l,u],[l,f],[c,f]].map(([h,d])=>re(a,h,d)).map(([h,d],g)=>({op:g===0?"M":"L",x:h,y:d}));return m.push({op:"Z"}),this.paint(m,{name:"rect",attrs:{},children:[],text:""},{...n,matrix:i,viewport:s,fill:r,fillRule:"nonzero",stroke:"none"}),true}beginClip(t,n,r){return false}endClip(){}clipOf(t,n){let r=ae(t,"clip-path"),o=r?iu.exec(r)?.[1]:void 0,i=o?this.clipPaths.get(o):void 0;if(!i)return null;let s=[],a=false;for(let c of i.children){let u=Jv(c,n.viewport);if(u.length===0)continue;let l=Zt(c.attrs.transform),f=l[0]===1&&l[1]===0&&l[2]===0&&l[3]===1&&l[4]===0&&l[5]===0;s.push(...f?u:u.map(p=>Yv(p,l))),a||=ae(c,"clip-rule")==="evenodd";}return s.length>0?{segments:s,matrix:n.matrix,evenOdd:a}:null}viewportMatrix(t,n){let r=oe(t.attrs.x,n.viewport[0]),o=oe(t.attrs.y,n.viewport[1]),i=oe(t.attrs.width,n.viewport[0],n.viewport[0]),s=oe(t.attrs.height,n.viewport[1],n.viewport[1]),a=sr(t.attrs.viewBox);if(a.length!==4||!(a[2]&&a[3]))return [ke(n.matrix,[1,0,0,1,r,o]),[i,s]];let[c,u,l,f]=a,p=i/l,m=s/f,h=r,d=o;if((t.attrs.preserveAspectRatio??"").trim()!=="none"){let g=t.attrs.preserveAspectRatio?.includes("slice")?Math.max(p,m):Math.min(p,m);h+=(i-l*g)/2,d+=(s-f*g)/2,p=g,m=g;}return [ke(n.matrix,[p,0,0,m,h-c*p,d-u*m]),[l,f]]}walk(t,n,r=false){if(r&&(this.clipPaths=H2(t,new Map),this.patterns=Y2(t,new Map)),Kv.has(t.name)||ae(t,"display")==="none"||ae(t,"visibility")==="hidden")return;let o=ke(n.matrix,Zt(t.attrs.transform)),i=n.viewport;if(t.name==="svg"){let[p,m]=this.viewportMatrix(r?{...t,attrs:{...t.attrs,x:"0",y:"0"}}:t,{...n,matrix:o});o=p,i=m;}let s=ae(t,"font-size"),a=Number.parseFloat(ae(t,"opacity")??"1"),c=ae(t,"fill-opacity"),u=c===void 0?n.fillOpacity??1:Number.parseFloat(c),l={fillOpacity:Number.isFinite(u)?Math.min(Math.max(u,0),1):1,opacity:(n.opacity??1)*(Number.isFinite(a)?Math.min(Math.max(a,0),1):1),matrix:o,viewport:i,fill:ae(t,"fill")??n.fill,fillRule:ae(t,"fill-rule")??n.fillRule,stroke:ae(t,"stroke")??n.stroke,strokeWidth:ae(t,"stroke-width")===void 0?n.strokeWidth:oe(ae(t,"stroke-width"),i[0],1),fontSize:s===void 0?n.fontSize:oe(s,16,16),fontWeight:ae(t,"font-weight")??n.fontWeight,textAnchor:ae(t,"text-anchor")??n.textAnchor},f=this.onPaper;(t.name==="rect"||t.name==="circle"||t.name==="path")&&Xv.test(ae(t,"fill")??"")&&(this.onPaper=true);try{let p=t.attrs["clip-path"]?this.clipOf(t,l):null;if(p&&this.beginClip(p.segments,p.matrix,p.evenOdd)){try{this.paintNode(t,l);}finally{this.endClip();}return}this.paintNode(t,l);}finally{this.onPaper=f;}}paintNode(t,n){let[r,o]=n.viewport,i=(s,a)=>oe(t.attrs[s],a);switch(t.name){case "path":this.paint(en(t.attrs.d??""),t,n);return;case "rect":{let s=t.attrs.rx??t.attrs.ry,a=t.attrs.ry??t.attrs.rx;this.paint(Gt(i("x",r),i("y",o),i("width",r),i("height",o),oe(s,r),oe(a,o)),t,n);return}case "circle":{let s=i("r",Math.hypot(r,o)/Math.SQRT2);this.paint(Bt(i("cx",r),i("cy",o),s,s),t,n);return}case "ellipse":this.paint(Bt(i("cx",r),i("cy",o),i("rx",r),i("ry",o)),t,n);return;case "line":this.paint([{op:"M",x:i("x1",r),y:i("y1",o)},{op:"L",x:i("x2",r),y:i("y2",o)}],t,{...n,fill:"none"});return;case "polygon":case "polyline":{let s=sr(t.attrs.points),a=[];for(let c=0;c+1<s.length;c+=2)a.push({op:c===0?"M":"L",x:s[c],y:s[c+1]});t.name==="polygon"&&a.length>0&&a.push({op:"Z"}),this.paint(a,t,n);return}case "text":this.text(t,n);return;case "image":this.image(t,n);return;default:for(let s of t.children)this.walk(s,n);}}};var cu=1e3;async function os(e){let t=await Rt(br({...e,size:e.size??ve},cu));return decodeURIComponent(t.replace("data:image/svg+xml,",""))}function y0(e){if(bt(e.frame)){let t=dr(cu,e.frame);return t.squareEdges?t.color:null}return Ue(e.bgColor,Me)}function uu(e,t){let n=y0(e);if(!(n&&_o(e.bgColor))||bt(e.frame)||e.templateId||e.customTemplate)return n;let r=Cn(t)?.children.find(i=>i.name==="rect"),o=r&&ae(r,"fill");return o?.startsWith("url(")?o:n}function lu(e,t){let n={r:255,g:255,b:255,a:1},r=Ae(Ue(t.bgColor,Me));e.paper=n,e.background=r&&!_o(t.bgColor)?r:null,e.backdrop=r?Yc(r,n):n;}var fu=25.4,X2=5,K2=2e3,cn=cu,$0=5,J2=2,t8=.25*(fu/72);function n8(e,t="mm"){return t==="in"?e*fu:e}function r8(e){let t=yt(e),n=Te.QrCode.encodeText(e.value,We[t]).size;return n+ot(n,e.margin??Ne,e.shape)*2}function mu(e,t){let n=n8(t.size,t.unit);if(!Number.isFinite(n)||n<X2||n>K2)throw new Error(`Print size must be between ${X2} mm and ${K2/1e3} m`);let r=Math.min(Math.max(t.bleed??0,0),20),o=n/cn,i=bt(e.frame)?dr(cn,e.frame):null,s=(i?.width??cn)*o,a=(i?.height??cn)*o,c=t.cropMarks?r+J2+$0+1:r,u=r8(e);return {codeWidth:n,trimWidth:s,trimHeight:a,bleed:r,pageWidth:s+2*c,pageHeight:a+2*c,trimX:c,trimY:c,moduleSize:n/u,moduleCount:u,maxScanDistance:n*10}}var x0=class e{pdf;internals;names=new Map;constructor(t,n){this.pdf=t,this.internals=n;}static attach(t){let n=t.internal;return typeof t.advancedAPI!="function"||typeof t.addShadingPattern!="function"||typeof n.write!="function"||typeof n.events?.subscribe!="function"?null:new e(t,n)}name(t){let n=this.names.get(t);return n||(this.names.size===0&&this.install(),n=`Sh${this.names.size}`,this.names.set(t,n)),n}install(){this.pdf.advancedAPI(t=>{t.addShadingPattern("qrdx-shadings",{});}),this.internals.events.subscribe("putShadingPatternDict",()=>{for(let[t,n]of this.names)this.internals.write(`/${n} ${t}`);});}},w0=class extends Fo{pdf;cmyk;images;shadingResources;constructor(t,n,r,o,i){super(r,o?.gradients??null),this.pdf=t,this.cmyk=n,this.images=i,this.shadingResources=o?.resources??null;}setColor(t,n){let r=t==="fill"?this.pdf.setFillColor.bind(this.pdf):t==="draw"?this.pdf.setDrawColor.bind(this.pdf):this.pdf.setTextColor.bind(this.pdf);if(this.cmyk){let[o,i,s,a]=En(n.r,n.g,n.b);r(o,i,s,a);}else r(Math.round(n.r),Math.round(n.g),Math.round(n.b));}setRegistrationColor(){this.cmyk?this.pdf.setDrawColor(1,1,1,1):this.pdf.setDrawColor(0,0,0);}tracePath(t,n){let r=false;for(let o of t)if(o.op==="M"){let[i,s]=re(n,o.x,o.y);this.pdf.moveTo(i,s),r=true;}else if(o.op==="L"){let[i,s]=re(n,o.x,o.y);r?this.pdf.lineTo(i,s):(this.pdf.moveTo(i,s),r=true);}else if(o.op==="C"){let[i,s]=re(n,o.x1,o.y1),[a,c]=re(n,o.x2,o.y2),[u,l]=re(n,o.x,o.y);this.pdf.curveTo(i,s,a,c,u,l);}else r&&this.pdf.close();}shade(t,n,r){let o=this.pdf.internal,i=o.scaleFactor,s=[i,0,0,-i,0,o.pageSize.getHeight()*i],a=ke(s,ke(n.matrix,r.matrix));if(!(this.shadingResources&&zn(a)))return;let c=this.shadingResources.name(ou(r,this.cmyk?"cmyk":"rgb"));this.pdf.saveGraphicsState(),this.tracePath(t,n.matrix),this.pdf.clip(n.fillRule==="evenodd"?"evenodd":void 0),this.pdf.discardPath(),o.write(`${ru(a)} cm /${c} sh`),this.pdf.restoreGraphicsState();}beginClip(t,n,r){return this.pdf.saveGraphicsState(),this.tracePath(t,n),this.pdf.clip(r?"evenodd":void 0),this.pdf.discardPath(),true}endClip(){this.pdf.restoreGraphicsState();}withAlpha(t,n,r){if(t>=1&&n>=1){r();return}this.pdf.saveGraphicsState();let o=this.pdf.GState;this.pdf.setGState(new o({opacity:t,"stroke-opacity":n}));try{r();}finally{this.pdf.restoreGraphicsState();}}opaqueGradient(t,n){let r=t.stops[0]?.color.a??1;return t.stops.every(i=>Math.abs(i.color.a-r)<.002)?{gradient:{...t,stops:t.stops.map(i=>({...i,color:{...i.color,a:1}}))},alpha:r*n}:{gradient:{...t,stops:t.stops.map(i=>({...i,color:this.flatten({...i.color,a:i.color.a*n})}))},alpha:1}}paint(t,n,r){if(t.length===0)return;let o=r.opacity??1;if(o<=0)return;let i=this.resolveFill(r.fill,t,r.viewport,(r.fillOpacity??1)*o);if(i&&"pattern"in i)this.paintPattern(t,r,i.pattern,i.alpha);else if(i&&"gradient"in i){let{gradient:f,alpha:p}=this.opaqueGradient(i.gradient,i.alpha);this.withAlpha(p,1,()=>this.shade(t,r,f));}let s=i&&"color"in i?i.color:null,a=s&&this.inConic?this.flatten(s):s,c=r.strokeWidth>0?this.resolveColor(r.stroke):null,u=c&&{...c,a:c.a*o};if(!(a||u))return;let l=r.fillRule==="evenodd";this.withAlpha(a?.a??1,u?.a??1,()=>{a&&this.setColor("fill",a),u&&(this.setColor("draw",u),this.pdf.setLineWidth(r.strokeWidth*$o(r.matrix))),this.tracePath(t,r.matrix),a&&u?l?this.pdf.fillStrokeEvenOdd():this.pdf.fillStroke():a?l?this.pdf.fillEvenOdd():this.pdf.fill():this.pdf.stroke();});}text(t,n){let r=t.text.replace(/\s+/g," ").trim(),o=this.resolveColor(n.fill);if(!(r&&o))return;let i=$o(n.matrix),[s,a]=re(n.matrix,oe(t.attrs.x,n.viewport[0]),oe(t.attrs.y,n.viewport[1])),c=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600;this.pdf.setFont("helvetica",c?"bold":"normal");let u=n.fontSize*i*(72/fu);this.pdf.setFontSize(u);let l=Number.parseFloat(t.attrs["data-max-width"]??"");if(l>0){let m=l*i,h=this.pdf.getTextWidth(r);h>m&&(u*=m/h,this.pdf.setFontSize(u));}this.setColor("text",o);let f=Math.atan2(n.matrix[1],n.matrix[0]);if(Math.abs(f)>2e-4){let m=n.textAnchor==="middle"?this.pdf.getTextWidth(r)/2:n.textAnchor==="end"?this.pdf.getTextWidth(r):0;this.pdf.text(r,s-m*Math.cos(f),a-m*Math.sin(f),{angle:-f*180/Math.PI,baseline:"alphabetic"});return}let p=n.textAnchor==="middle"?"center":n.textAnchor==="end"?"right":"left";this.pdf.text(r,s,a,{align:p,baseline:"alphabetic"});}aliases=new Map;image(t,n){let r=t.attrs.href??t.attrs["xlink:href"],o=r&&(su(r)?r:this.images.get(r)),i=o&&su(o);if(!(o&&i))return;let s=this.aliases.get(o);s||(s=`qrdx-image-${this.aliases.size}`,this.aliases.set(o,s));let a=null;if(t.attrs.preserveAspectRatio)try{let g=this.pdf.getImageProperties(o);a={width:g.width,height:g.height};}catch{a=null;}let c=W2(t,n.viewport,a);if(!c)return;let{draw:u,clip:l}=c,[f,p]=re(n.matrix,u.x,u.y),[m,h]=re(n.matrix,u.x+u.width,u.y+u.height),d=l!==null&&this.beginClip([{op:"M",x:l.x,y:l.y},{op:"L",x:l.x+l.width,y:l.y},{op:"L",x:l.x+l.width,y:l.y+l.height},{op:"L",x:l.x,y:l.y+l.height},{op:"Z"}],n.matrix,false);try{this.withAlpha(n.opacity??1,1,()=>{this.pdf.addImage(o,i,Math.min(f,m),Math.min(p,h),Math.abs(m-f),Math.abs(h-p),s);});}finally{d&&this.endClip();}}};function o8(e,t,n){let{trimX:r,trimY:o,trimWidth:i,trimHeight:s,bleed:a}=n,c=a+J2,u=r,l=r+i,f=o,p=o+s;t.setRegistrationColor(),e.setLineWidth(t8);for(let m of [u,l]){let h=m===u?-1:1;for(let d of [f,p]){let g=d===f?-1:1;e.line(m+h*c,d,m+h*(c+$0),d),e.line(m,d+g*c,m,d+g*(c+$0));}}}async function i8(e,t){return (await e$(e,t)).output("dataurlstring")}async function _k(e,t){return (await e$(e,t)).output("arraybuffer")}async function e$(e,t){let n=mu(e,t),r;try{({jsPDF:r}=await import('jspdf'));}catch(_){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${_})`)}let o=await os(e),i=Cn(o);if(!i)throw new Error("Failed to render the QR code for printing");let s=new Map;for(let _ of rs(i,new Set))if(!su(_)){let b=await au(_);b&&s.set(_,b);}let a=new r({orientation:n.pageWidth>n.pageHeight?"landscape":"portrait",unit:"mm",format:[n.pageWidth,n.pageHeight],compress:true,floatPrecision:3});a.setProperties({title:"QR code",creator:"qrdx"});let c=nu(i),u=c.size>0?x0.attach(a):null,l=new w0(a,t.colorMode==="cmyk",ns(i,new Map),u?{gradients:c,resources:u}:null,s);lu(l,e);let f=n.codeWidth/cn,p=oe(i.attrs.width,cn,cn),m=oe(i.attrs.height,cn,cn),h={matrix:ke([1,0,0,1,n.trimX,n.trimY],[f,0,0,f,0,0]),viewport:[p,m],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},d=n.bleed>0?uu(e,o):null,g=[n.trimX-n.bleed,n.trimY-n.bleed,n.trimX+n.trimWidth+n.bleed,n.trimY+n.trimHeight+n.bleed];if(!(d&&l.paintBleed(i,h,d,g))){let _=d?l.resolveColor(d):null;_&&(l.setColor("fill",_),a.rect(n.trimX-n.bleed,n.trimY-n.bleed,n.trimWidth+2*n.bleed,n.trimHeight+2*n.bleed,"F"));}return l.walk(i,h,true),t.cropMarks&&o8(a,l,n),a}async function s8(e,t){let n=mu(e,{size:t.size,unit:t.unit}),r=await os(e),o=t.unit??"mm",i=c=>`${x(o==="in"?c/fu:c)}${o}`,s=/^<svg\b[^>]*>/.exec(r)?.[0];if(!s)throw new Error("Failed to render the QR code for printing");return `<?xml version="1.0" encoding="UTF-8"?>
|
|
63
|
+
${s.replace(/\swidth="[^"]*"/,` width="${i(n.trimWidth)}"`).replace(/\sheight="[^"]*"/,` height="${i(n.trimHeight)}"`)}${r.slice(s.length)}`}async function bk(e,t){let n=await i8(e,t);jt(n,t.filename??"qr-code-print.pdf");}async function yk(e,t){let n=await s8(e,t);jt(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`,t.filename??"qr-code-print.svg");}var a8=[137,80,78,71,13,10,26,10];async function n$(e,t){let n=new Blob([e]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}async function r$(e){return typeof CompressionStream>"u"?null:await n$(e,new CompressionStream("deflate"))}async function c8(e){if(typeof DecompressionStream>"u")return null;try{return await n$(e,new DecompressionStream("deflate"))}catch{return null}}var S0=(e,t)=>e[t]*2**24+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0,t$={0:1,2:3,3:1,4:2,6:4};function u8(e,t,n){let r=e+t-n,o=Math.abs(r-e),i=Math.abs(r-t),s=Math.abs(r-n);return o<=i&&o<=s?e:i<=s?t:n}async function v0(e){if(a8.some((d,g)=>e[g]!==d))return null;let t=8,n=0,r=0,o=-1,i=null,s=null,a=[];for(;t+8<=e.length;){let d=S0(e,t),g=String.fromCharCode(...e.subarray(t+4,t+8)),_=e.subarray(t+8,t+8+d);if(t+=12+d,g==="IHDR"){n=S0(_,0),r=S0(_,4);let b=_[8];o=_[9];let y=_[12];if(b!==8||y!==0||!(o in t$))return null}else if(g==="PLTE")i=_;else if(g==="tRNS")s=_;else if(g==="IDAT")a.push(_);else if(g==="IEND")break}if(!(n&&r)||n*r>4096*4096)return null;let c=new Uint8Array(a.reduce((d,g)=>d+g.length,0)),u=0;for(let d of a)c.set(d,u),u+=d.length;let l=await c8(c),f=t$[o],p=n*f;if(!l||l.length<r*(p+1))return null;let m=new Uint8Array(r*p);for(let d=0;d<r;d++){let g=l[d*(p+1)],_=l.subarray(d*(p+1)+1,(d+1)*(p+1)),b=d*p;for(let y=0;y<p;y++){let S=y>=f?m[b+y-f]:0,v=d>0?m[b-p+y]:0,$=d>0&&y>=f?m[b-p+y-f]:0,w=_[y],A=0;g===1?A=S:g===2?A=v:g===3?A=S+v>>1:g===4&&(A=u8(S,v,$)),m[b+y]=w+A&255;}}let h=new Uint8Array(n*r*4);for(let d=0;d<n*r;d++){let g=d*4,_=d*f;if(o===3){let b=m[_];h[g]=i?.[b*3]??0,h[g+1]=i?.[b*3+1]??0,h[g+2]=i?.[b*3+2]??0,h[g+3]=s?.[b]??255;}else if(o===0||o===4){let b=m[_];h[g]=b,h[g+1]=b,h[g+2]=b,h[g+3]=o===4?m[_+1]:255;}else h[g]=m[_],h[g+1]=m[_+1],h[g+2]=m[_+2],h[g+3]=o===6?m[_+3]:255;}return {width:n,height:r,data:h}}var l8=25.4,o$=72/l8,f8=50;function m8(e){let t=/^data:[^,]*?(;base64)?,(.*)$/s.exec(e);if(!t)return null;try{let n=t[1]?atob(t[2]):decodeURIComponent(t[2]),r=new Uint8Array(n.length);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o)&255;return r}catch{return null}}function p8(e){if(e[0]!==255||e[1]!==216)return null;let t=2;for(;t+9<e.length;){if(e[t]!==255)return null;let n=e[t+1];if(n===216||n>=208&&n<=215){t+=2;continue}let r=e[t+2]<<8|e[t+3];if(n===192||n===193||n===194){let o=e[t+5]<<8|e[t+6],i=e[t+7]<<8|e[t+8],s=e[t+9];return {width:i,height:o,components:s,progressive:n===194}}t+=2+r;}return null}async function d8(e,t){let{width:n,height:r,data:o}=e,i=t?4:3,s=new Uint8Array(n*r*i);for(let c=0;c<n*r;c++){let u=o[c*4+3]/255,l=o[c*4]*u+255*(1-u),f=o[c*4+1]*u+255*(1-u),p=o[c*4+2]*u+255*(1-u);if(t){let[m,h,d,g]=En(l,f,p);s.set([m*255,h*255,d*255,g*255].map(Math.round),c*i);}else s.set([Math.round(l),Math.round(f),Math.round(p)],c*i);}let a=await r$(s);return {kind:"raw",width:n,height:r,components:i,bytes:a??s,compressed:!!a}}async function h8(e,t){let n=e;if(!/^data:image\/(png|jpe?g)[;,]/i.test(n)){let s=await au(n);if(!s)return null;n=s;}let r=m8(n);if(!r)return null;let o=p8(r);if(o)return o.components===1||o.components===3?{kind:"jpeg",width:o.width,height:o.height,components:o.components,bytes:r,progressive:o.progressive}:null;let i=await v0(r);return i?await d8(i,t):null}function g8(e){let t="",n=0,r=o=>{t+=o,n+=o.length,n>=76&&(t+=`
|
|
64
|
+
`,n=0);};for(let o=0;o<e.length;o+=4){let i=Math.min(4,e.length-o),s=0;for(let c=0;c<4;c++)s=s*256+(c<i?e[o+c]:0);if(s===0&&i===4){r("z");continue}let a=[];for(let c=0;c<5;c++)a.unshift(String.fromCharCode(s%85+33)),s=Math.floor(s/85);r(a.slice(0,i+1).join(""));}return `${t}~>`}var _8=`/qrdxdict 40 dict def
|
|
65
|
+
qrdxdict begin
|
|
66
|
+
/m {moveto} bind def
|
|
67
|
+
/l {lineto} bind def
|
|
68
|
+
/c {curveto} bind def
|
|
69
|
+
/h {closepath} bind def
|
|
70
|
+
/n {newpath} bind def
|
|
71
|
+
/f {fill} bind def
|
|
72
|
+
/ef {eofill} bind def
|
|
73
|
+
/s {stroke} bind def
|
|
74
|
+
/w {setlinewidth} bind def
|
|
75
|
+
/rg {setrgbcolor} bind def
|
|
76
|
+
/cmyk {setcmykcolor} bind def
|
|
77
|
+
/latin1 {
|
|
78
|
+
findfont dup length dict begin
|
|
79
|
+
{1 index /FID ne {def} {pop pop} ifelse} forall
|
|
80
|
+
/Encoding ISOLatin1Encoding def
|
|
81
|
+
currentdict end definefont pop
|
|
82
|
+
} bind def
|
|
83
|
+
/QRDX-Regular /Helvetica latin1
|
|
84
|
+
/QRDX-Bold /Helvetica-Bold latin1
|
|
85
|
+
end`;function C0(e){let t="(";for(let n of e){let r=n.codePointAt(0)??63;n==="("||n===")"||n==="\\"?t+=`\\${n}`:r>=32&&r<127?t+=n:r>=160&&r<=255?t+=`\\${r.toString(8).padStart(3,"0")}`:t+="?";}return `${t})`}var P0=class extends Fo{out=[];shadingNames=new Map;cmyk;images;usesLevel3=false;constructor(t,n,r,o){super(n,r),this.cmyk=t,this.images=o;}color(t){if(this.cmyk){let[n,r,o,i]=En(t.r,t.g,t.b);return `${x(n)} ${x(r)} ${x(o)} ${x(i)} cmyk`}return `${x(t.r/255)} ${x(t.g/255)} ${x(t.b/255)} rg`}tracePath(t,n){let r=["n"],o=false;for(let i of t)if(i.op==="M"||i.op==="L"&&!o){let[s,a]=re(n,i.x,i.y);r.push(`${x(s)} ${x(a)} m`),o=true;}else if(i.op==="L"){let[s,a]=re(n,i.x,i.y);r.push(`${x(s)} ${x(a)} l`);}else if(i.op==="C"){if(!o)continue;let[s,a]=re(n,i.x1,i.y1),[c,u]=re(n,i.x2,i.y2),[l,f]=re(n,i.x,i.y);r.push(`${x(s)} ${x(a)} ${x(c)} ${x(u)} ${x(l)} ${x(f)} c`);}else o&&r.push("h");return r.join(" ")}beginClip(t,n,r){return this.out.push(`gsave ${this.tracePath(t,n)} ${r?"eoclip":"clip"} n`),true}endClip(){this.out.push("grestore");}rect(t,n,r,o,i){this.out.push(`${this.color(t)} n ${x(n)} ${x(r)} m ${x(n+o)} ${x(r)} l ${x(n+o)} ${x(r+i)} l ${x(n)} ${x(r+i)} l h f`);}shade(t,n,r){let o=ke(n.matrix,r.matrix);if(!zn(o))return;let i=ou(r,this.cmyk?"cmyk":"rgb"),s=this.shadingNames.get(i);s||(s=`Sh${this.shadingNames.size}`,this.shadingNames.set(i,s)),this.usesLevel3=true;let a=n.fillRule==="evenodd"?"eoclip":"clip";this.out.push(`gsave ${this.tracePath(t,n.matrix)} ${a} n [${ru(o)}] concat ${s} shfill grestore`);}paint(t,n,r){if(t.length===0)return;let o=r.opacity??1;if(o<=0)return;let i=this.resolveFill(r.fill,t,r.viewport,(r.fillOpacity??1)*o);i&&"pattern"in i?this.paintPattern(t,r,i.pattern,i.alpha):i&&"gradient"in i&&this.shade(t,r,{...i.gradient,stops:i.gradient.stops.map(f=>({...f,color:this.flatten({...f.color,a:f.color.a*i.alpha})}))});let s=i&&"color"in i?this.flatten(i.color):null,a=r.strokeWidth>0?this.resolveColor(r.stroke):null,c=a&&this.flatten({...a,a:a.a*o});if(!(s||c))return;let u=this.tracePath(t,r.matrix),l=r.fillRule==="evenodd"?"ef":"f";s&&c?this.out.push(`gsave ${this.color(s)} ${u} ${l} grestore`):s&&this.out.push(`${this.color(s)} ${u} ${l}`),c&&this.out.push(`${this.color(c)} ${x(r.strokeWidth*$o(r.matrix))} w ${u} s`);}text(t,n){let r=t.text.replace(/\s+/g," ").trim(),o=this.resolveColor(n.fill);if(!(r&&o))return;let i=$o(n.matrix),[s,a]=re(n.matrix,oe(t.attrs.x,n.viewport[0]),oe(t.attrs.y,n.viewport[1])),u=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600?"/QRDX-Bold":"/QRDX-Regular",l=x(n.fontSize*i),f=Number.parseFloat(t.attrs["data-max-width"]??""),p=f>0?` dup stringwidth pop dup ${x(f*i)} gt {${x(f*i)} exch div ${l} mul ${u} findfont exch scalefont setfont} {pop} ifelse`:"",m=n.textAnchor==="middle"?" dup stringwidth pop 2 div neg 0 rmoveto":n.textAnchor==="end"?" dup stringwidth pop neg 0 rmoveto":"",h=Math.atan2(n.matrix[1],n.matrix[0])*180/Math.PI;if(Math.abs(h)>.01){this.out.push(`gsave ${this.color(o)} ${u} findfont ${l} scalefont setfont ${x(s)} ${x(a)} translate ${x(h)} rotate ${C0(r)}${p} 0 0 moveto${m} show grestore`);return}this.out.push(`gsave ${this.color(o)} ${u} findfont ${l} scalefont setfont ${C0(r)}${p} ${x(s)} ${x(a)} moveto${m} show grestore`);}image(t,n){let r=t.attrs.href??t.attrs["xlink:href"],o=r?this.images.get(r):void 0;if(!o)return;let i=oe(t.attrs.x,n.viewport[0]),s=oe(t.attrs.y,n.viewport[1]),a=oe(t.attrs.width,n.viewport[0]),c=oe(t.attrs.height,n.viewport[1]);if(a<=0||c<=0)return;let[u,l]=re(n.matrix,i,s),[f,p]=re(n.matrix,i+a,s+c),{components:m}=o,h=m===1?"/DeviceGray":m===4?"/DeviceCMYK":"/DeviceRGB",d=Array.from({length:m},()=>"0 1").join(" "),g="/ASCII85Decode filter";o.kind==="jpeg"?(g+=" /DCTDecode filter",o.progressive&&(this.usesLevel3=true)):o.compressed&&(g+=" /FlateDecode filter",this.usesLevel3=true),this.out.push(["gsave",`${x(Math.min(u,f))} ${x(Math.min(l,p))} translate ${x(Math.abs(f-u))} ${x(Math.abs(p-l))} scale`,`${h} setcolorspace`,`<< /ImageType 1 /Width ${o.width} /Height ${o.height} /BitsPerComponent 8 /Decode [${d}] /ImageMatrix [${o.width} 0 0 -${o.height} 0 ${o.height}] /DataSource currentfile ${g} >> image`,g8(o.bytes),"grestore"].join(`
|
|
86
|
+
`));}};async function i$(e,t={}){let n=Cn(e);if(!n)throw new Error("Could not read the SVG to convert to EPS");let r=oe(n.attrs.width,0,0)||512,o=oe(n.attrs.height,0,0)||r,i=t.width??r;if(!(Number.isFinite(i)&&i>0))throw new Error("EPS width must be a positive number of points");let s=i/r,a=o*s,c=Math.max(0,t.bleed??0),u=i+2*c,l=a+2*c,f=t.colorMode==="cmyk",p=new Map;for(let b of rs(n,new Set)){let y=await h8(b,f);y&&p.set(b,y);}let m=new P0(f,ns(n,new Map),nu(n),p);lu(m,{bgColor:t.background??"#ffffff"});let d={matrix:ke([1,0,0,-1,c,l-c],[s,0,0,s,0,0]),viewport:[r,o],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},g=c>0?t.bleedColor??void 0:void 0;if(!(g&&m.paintBleed(n,d,g,[0,0,u,l]))){let b=g?m.resolveColor(g):null;b&&m.rect(b,0,0,u,l);}m.walk(n,d,true);let _=(t.title??"QR code").replace(/[^\x20-\x7e]/g,"?");return ["%!PS-Adobe-3.0 EPSF-3.0",`%%BoundingBox: 0 0 ${Math.ceil(u)} ${Math.ceil(l)}`,`%%HiResBoundingBox: 0 0 ${x(u)} ${x(l)}`,`%%Title: ${C0(_)}`,"%%Creator: qrdx",`%%LanguageLevel: ${m.usesLevel3?3:2}`,"%%DocumentData: Clean7Bit","%%EndComments","%%BeginProlog",_8,"%%EndProlog","qrdxdict begin",...Array.from(m.shadingNames,([b,y])=>`/${y} ${b} def`),"gsave",...m.out,"grestore","end","showpage","%%Trailer","%%EOF",""].join(`
|
|
87
|
+
`)}var s$="EPS can't carry image fills: PostScript has no transparency and would repeat the picture for every dot. Download PDF, SVG or PNG instead.";function a$(e){return [e.bgColor,e.fgColor,e.eyeColor,e.dotColor,...Object.values(e.eyeColors??{}).flatMap(n=>[n?.outer,n?.inner])].some(n=>typeof n=="object"&&n?.type==="image")}async function pu(e,t={}){if(a$(e))throw new Error(s$);let n=mu(e,{size:t.sizeMm??f8,unit:"mm",bleed:t.bleedMm}),r=await os(e);return await i$(r,{width:n.trimWidth*o$,bleed:n.bleed*o$,bleedColor:n.bleed>0?uu(e,r):y0(e),colorMode:t.colorMode,background:Ue(e.bgColor,Me)})}function du(e){return `data:application/postscript;base64,${btoa(e)}`}async function b8(e,t={}){let n=await pu(e,t);jt(du(n),t.filename??"qr-code-print.eps");}var A0={png:{mimeType:"image/png",extension:"png",vector:false},jpg:{mimeType:"image/jpeg",extension:"jpg",vector:false},webp:{mimeType:"image/webp",extension:"webp",vector:false},svg:{mimeType:"image/svg+xml",extension:"svg",vector:true},pdf:{mimeType:"application/pdf",extension:"pdf",vector:false},eps:{mimeType:"application/postscript",extension:"eps",vector:true}},Zk={small:{width:200,height:200},medium:{width:400,height:400},large:{width:800,height:800},xlarge:{width:1200,height:1200},"2xl":{width:1600,height:1600},"3xl":{width:2e3,height:2e3}};function E0(e,t){return e<50||t<50?{isValid:false,error:"Size must be at least 50x50 pixels"}:e>5e3||t>5e3?{isValid:false,error:"Size must not exceed 5000x5000 pixels"}:e!==t?{isValid:false,error:"Width and height must be equal for QR codes"}:{isValid:true}}function br(e,t){let{imageSettings:n,size:r}=e;if(!(n&&r)||r===t)return {...e,size:t};let o=t/r;return {...e,size:t,imageSettings:{...n,width:n.width*o,height:n.height*o,...n.x!=null&&{x:n.x*o},...n.y!=null&&{y:n.y*o},...n.padding!=null&&{padding:n.padding*o}}}}function jt(e,t){let n=document.createElement("a");n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n);}var c$=e=>(A0[e]??A0.png).mimeType;function y8(e,t,n){let{extension:r,vector:o}=A0[e];if(o)return `qr-code.${r}`;let{width:i,height:s}=rn(t.width,n);return `qr-code-${Math.round(i)}x${Math.round(s)}.${r}`}async function u$(e,t={}){let n=await Oo(e,"image/webp",true);try{return await tu(n,t)}finally{n.remove();}}var $8=25.4/72;async function l$(e){let t=await pu(e,{sizeMm:(e.size??ve)*$8});return du(t)}async function f$(e){let t;try{({jsPDF:t}=await import('jspdf'));}catch(p){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${p})`)}let n=await Rt(e),r=decodeURIComponent(n.replace("data:image/svg+xml,","")),o;try{let p=new TextEncoder().encode(r),m=Array.from(p,d=>String.fromCharCode(d)).join("");o=`data:image/svg+xml;base64,${btoa(m)}`;}catch(p){throw new Error(`Failed to encode SVG for PDF conversion: ${p}`)}let{width:i,height:s}=rn(e.size||ve,e.frame),a=await new Promise((p,m)=>{let h=new Image,d=document.createElement("canvas");d.width=Math.round(i),d.height=Math.round(s);let g=d.getContext("2d");if(!g){m(new Error("Could not get canvas context"));return}let _=setTimeout(()=>{d.remove(),m(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);h.onload=()=>{clearTimeout(_);try{g.drawImage(h,0,0,d.width,d.height),p(d);}catch(b){clearTimeout(_),d.remove(),m(new Error(`Failed to draw image to canvas: ${b}`));}},h.onerror=()=>{clearTimeout(_),d.remove(),m(new Error("Could not load SVG for PDF conversion"));},h.src=o;}),c=a.toDataURL("image/png",1),u=i*.264583,l=s*.264583,f=new t({orientation:u>l?"landscape":"portrait",unit:"mm",format:[u,l]});return f.addImage(c,"PNG",0,0,u,l),a.remove(),f.output("dataurlstring")}async function m$(e,t){let{format:n,size:r,filename:o,quality:i}=t,s=E0(r.width,r.height);if(!s.isValid)throw new Error(s.error);let a=br(e,r.width),c=o||y8(n,r,e.frame);try{if(n==="svg"){let u=await Rt(a);jt(u,c);}else if(n==="pdf"){let u=await f$(a);jt(u,c);}else if(n==="eps")jt(await l$(a),c);else if(n==="webp"){let u=await u$(a,{quality:i});jt(await ts(u),c);}else {let u=c$(n),l=await Oo(a,u);if(typeof l=="string")jt(l,c);else throw new Error("Failed to generate image data URL")}}catch(u){throw console.error(`Error downloading ${n.toUpperCase()}:`,u),u}}async function p$(e,t,n,r={}){let o=E0(n.width,n.height);if(!o.isValid)throw new Error(o.error);let i=br(e,n.width);if(t==="svg")return await Rt(i);if(t==="pdf")return await f$(i);if(t==="eps")return await l$(i);if(t==="webp")return await ts(await u$(i,r));let s=c$(t),a=await Oo(i,s);if(typeof a=="string")return a;throw new Error("Failed to generate QR code data URL")}async function Bk(e,t={width:ve,height:ve}){try{let n=E0(t.width,t.height);if(!n.isValid)throw new Error(n.error);let r=br(e,t.width),o=Oo(r,"image/png",!0).then(i=>new Promise((s,a)=>{let c=i;c.toBlob(u=>{c.remove(),u?s(u):a(new Error("Failed to create blob from canvas"));},"image/png");}));await navigator.clipboard.write([new ClipboardItem({"image/png":o})]);}catch(n){throw console.error("Error copying to clipboard:",n),n}}async function Gk(e){let t=await Rt(e);return decodeURIComponent(t.replace("data:image/svg+xml,",""))}var mt={maxBytes:2e5,maxElements:500,maxDepth:16,maxInputSegments:4e3,maxColors:8,artboardSide:1e3,decimals:1,padding:.06},_e=class extends Error{},x8={script:e=>`Removed ${Le(e,"script")}`,style:e=>`Removed ${Le(e,"style sheet")}: colors set with CSS classes are lost. Export with presentation attributes (Illustrator: Styling \u2192 Presentation Attributes)`,"foreign-object":e=>`Removed ${Le(e,"foreignObject element")}`,image:e=>`Removed ${Le(e,"image")}: frames are vector shapes only`,use:e=>`Removed ${Le(e,"<use> reference")}: ungroup or detach symbols before exporting`,text:e=>`Removed ${Le(e,"text element")}: add text as labels in the frame editor`,effects:e=>`Removed ${Le(e,"filter, mask, clip path or pattern")}`,animation:e=>`Removed ${Le(e,"animation")}`,unknown:e=>`Removed ${Le(e,"unsupported element")}`,"nested-svg":e=>`Removed ${Le(e,"nested <svg>")}: flatten it first`,handlers:e=>`Removed ${Le(e,"event handler attribute")}`,links:e=>`Removed ${Le(e,"link")} (href)`,"external-paint":e=>`Removed ${Le(e,"fill or stroke")} that referenced something outside the file`,gradient:e=>`Flattened ${Le(e,"gradient")} to its first color: add gradients in the frame editor`,opacity:e=>`Made ${Le(e,"semi-transparent shape")} opaque (print files have no transparency)`,"invalid-paint":e=>`${Le(e,"color")} couldn't be read and fell back to the parent color`,stroke:e=>`Removed ${Le(e,"stroke")} on paths, polygons or polylines: outline strokes before exporting (Figma: Outline stroke)`,dash:e=>`Drew ${Le(e,"dashed stroke")} as solid`,clipped:e=>`Cut ${Le(e,"shape")} at the edge of the artboard`,outside:e=>`Removed ${Le(e,"shape")} outside the artboard`,colors:e=>`Merged ${Le(e,"color")} with similar ones (${mt.maxColors} at most)`,"qr-placed":()=>'No QR placeholder found (a rect with id "qr"): the code was centered; place it in the frame editor'};function Le(e,t){return `${e} ${t}${e===1?"":"s"}`}var I0=class{counts=new Map;add(t,n=1){this.counts.set(t,(this.counts.get(t)??0)+n);}list(){return [...this.counts].map(([t,n])=>({code:t,count:n,message:x8[t](n)}))}},w8=/^\s*<\?xml\s[^?>]*\?>/,k0=/[A-Za-z_][\w:.-]*/y,R0=/<\/([A-Za-z_][\w:.-]*)\s*>/y,hu=/\s*/y,S8=/[A-Za-z_:][\w:.-]*/y,v8=/[^"<]*/y,C8=/[^'<]*/y;function Do(e,t,n){return e.lastIndex=n,e.test(t)?e.lastIndex:n}function d$(e,t){let n=Do(hu,e,t),r=Do(S8,e,n);if(n===t||r===n)return -1;let o=Do(hu,e,r);if(e[o]!=="=")return -1;let i=Do(hu,e,o+1),s=e[i];if(s!=='"'&&s!=="'")return -1;let c=Do(s==='"'?v8:C8,e,i+1);return e[c]===s?c+1:-1}function P8(e,t){let n=Do(hu,e,t);return e[n]===">"?{end:n+1,selfClosing:false}:e.startsWith("/>",n)?{end:n+2,selfClosing:true}:null}function A8(e){let t=[],n=0,r="",o=0;for(;o<e.length;){let i=e.indexOf("<",o);if(i<0)break;if(o=i,e.startsWith("<!--",o)){let u=e.indexOf("-->",o+4);if(u<0)throw new _e("The SVG has an unclosed comment");o=u+3;continue}if(e.startsWith("<![CDATA[",o)){let u=e.indexOf("]]>",o+9);if(u<0)throw new _e("The SVG has an unclosed CDATA section");o=u+3;continue}if(e.startsWith("<?",o)){let u=e.indexOf("?>",o+2);if(u<0)throw new _e("The SVG has an unclosed declaration");o=u+2;continue}if(e.startsWith("<!",o))throw new _e("DOCTYPE and other declarations are not allowed");if(e[o+1]==="/"){R0.lastIndex=o;let u=R0.exec(e);if(!u)throw new _e("The SVG has a malformed closing tag");if(t.pop()!==u[1])throw new _e(`The SVG closes <${u[1]}> out of order`);o=R0.lastIndex;continue}k0.lastIndex=o+1;let s=k0.exec(e);if(!s)throw new _e("The SVG has a malformed tag");let a=k0.lastIndex;for(let u=d$(e,a);u>=0;u=d$(e,a))a=u;let c=P8(e,a);if(!c)throw new _e(`The SVG has a malformed <${s[0]}> tag (attributes must be quoted and may not contain "<")`);if(n++,n>mt.maxElements)throw new _e(`The SVG has more than ${mt.maxElements} elements`);if(r||(r=s[0]),!c.selfClosing&&(t.push(s[0]),t.length>mt.maxDepth))throw new _e(`The SVG nests elements more than ${mt.maxDepth} deep`);o=c.end;}if(t.length>0)throw new _e(`The SVG doesn't close <${t.at(-1)}>`);return r}function E8(e){if(typeof e!="string")throw new _e("Expected SVG markup as a string");let t=new TextEncoder().encode(e).length;if(t>mt.maxBytes)throw new _e(`The SVG is ${Math.ceil(t/1e3)} KB; the limit is ${mt.maxBytes/1e3} KB`);if(/<!(?:DOCTYPE|ENTITY|ATTLIST|ELEMENT|NOTATION)/i.test(e))throw new _e("DOCTYPE and entity declarations are not allowed");let n=e.replace(w8,"");if(n.includes("<?"))throw new _e("Processing instructions (such as xml-stylesheet) are not allowed");if(A8(n)!=="svg")throw new _e("The file must start with an <svg> element");return n}var M0=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,"0");function Mt(e){let t=e?.replace(/!important/i,"").trim();return t===""||t==="inherit"?void 0:t}function L0(e,t,n,r){let o=e.trim();if(o==="none"||o==="transparent")return null;if(/^url\(/i.test(o)){let s=/^url\(\s*['"]?#([^)'"\s]+)['"]?\s*\)/i.exec(o)?.[1],a=s?n.get(s):void 0;return a?(r.add("gradient"),L0(a,t,n,r)):(r.add("external-paint"),null)}let i=Ae(o==="currentColor"?t.color:o);return i?i.a<=0?null:`#${M0(i.r)}${M0(i.g)}${M0(i.b)}`:(r.add("invalid-paint"),null)}function k8(e){let t=new Map,n=o=>{(o.name==="linearGradient"||o.name==="radialGradient")&&o.attrs.id&&t.set(o.attrs.id,o);for(let i of o.children)n(i);};n(e);let r=new Map;for(let[o,i]of t){let s=i.children.find(c=>c.name==="stop");if(!s){let c=(i.attrs.href??i.attrs["xlink:href"])?.match(/^#(.+)$/)?.[1];s=c?t.get(c)?.children.find(u=>u.name==="stop"):void 0;}let a=s&&Mt(ae(s,"stop-color"));a&&r.set(o,a);}return r}function h$(e,t){return e.map(n=>{if(n.op==="Z")return n;if(n.op==="C"){let[i,s]=re(t,n.x1,n.y1),[a,c]=re(t,n.x2,n.y2),[u,l]=re(t,n.x,n.y);return {op:"C",x1:i,y1:s,x2:a,y2:c,x:u,y:l}}let[r,o]=re(t,n.x,n.y);return {op:n.op,x:r,y:o}})}function R8(e){let t=0;return e.forEach(([n,r],o)=>{let[i,s]=e[(o+1)%e.length];t+=n*s-i*r;}),t/2}function T0(e){return e.length<3?[]:[...e.map(([t,n],r)=>({op:r===0?"M":"L",x:t,y:n})),{op:"Z"}]}var Tn=e=>Number.isFinite(e);function Pe(e,t,n=0){let r=Number.parseFloat(e.attrs[t]??"");return Tn(r)?r:n}function g$(e){switch(e.name){case "path":return en(e.attrs.d??"");case "rect":{let t=e.attrs.rx??e.attrs.ry,n=e.attrs.ry??e.attrs.rx;return Gt(Pe(e,"x"),Pe(e,"y"),Pe(e,"width"),Pe(e,"height"),Number.parseFloat(t??"0")||0,Number.parseFloat(n??"0")||0)}case "circle":{let t=Pe(e,"r");return Bt(Pe(e,"cx"),Pe(e,"cy"),t,t)}case "ellipse":return Bt(Pe(e,"cx"),Pe(e,"cy"),Pe(e,"rx"),Pe(e,"ry"));case "polygon":case "polyline":{let t=sr(e.attrs.points),n=[];for(let r=0;r+1<t.length;r+=2)n.push([t[r],t[r+1]]);return T0(n)}default:return []}}function M8(e,t){let n=t/2;switch(e.name){case "rect":{let r=Pe(e,"x"),o=Pe(e,"y"),i=Pe(e,"width"),s=Pe(e,"height"),a=Number.parseFloat(e.attrs.rx??e.attrs.ry??"0")||0,c=Gt(r-n,o-n,i+t,s+t,a>0?a+n:0,a>0?a+n:0);if(i<=t||s<=t)return c;let u=Math.max(a-n,0);return [...c,...Gt(r+n,o+n,i-t,s-t,u,u)]}case "circle":case "ellipse":{let r=Pe(e,"cx"),o=Pe(e,"cy"),i=e.name==="circle"?Pe(e,"r"):Pe(e,"rx"),s=e.name==="circle"?Pe(e,"r"):Pe(e,"ry"),a=Bt(r,o,i+n,s+n);return i<=n||s<=n?a:[...a,...Bt(r,o,i-n,s-n)]}case "line":{let[r,o,i,s]=["x1","y1","x2","y2"].map(f=>Pe(e,f)),a=Math.hypot(i-r,s-o);if(a===0)return [];let c=-(s-o)/a*n,u=(i-r)/a*n,l=[[r+c,o+u],[i+c,s+u],[i-c,s-u],[r-c,o-u]];return T0(R8(l)<0?l.reverse():l)}default:return null}}var I8=new Set(["path","rect","circle","ellipse","polygon","polyline","line"]),L8=new Set(["defs","linearGradient","radialGradient","stop","title","desc","metadata"]),z8={script:"script",style:"style",foreignObject:"foreign-object",image:"image",feImage:"image",use:"use",text:"text",tspan:"text",textPath:"text",filter:"effects",mask:"effects",clipPath:"effects",pattern:"effects",marker:"effects",symbol:"effects",animate:"animation",animateMotion:"animation",animateTransform:"animation",set:"animation"},T8=/^(?:qrdx[-_ ]?)?qr(?:[-_ ]?code)?$/i;function b$(e,t){for(let n of Object.keys(e.attrs)){let r=n.toLowerCase();r.startsWith("on")?t.add("handlers"):r==="href"||r==="xlink:href"?e.name!=="linearGradient"&&e.name!=="radialGradient"&&t.add("links"):(r==="filter"||r==="mask"||r==="clip-path")&&t.add("effects");}}function y$(e,t,n,r,o){if(b$(e,r),Mt(ae(e,"display"))==="none"||Mt(ae(e,"visibility"))==="hidden")return;let i=Number.parseFloat(ae(e,"opacity")??"1"),s=Mt(ae(e,"fill-rule")),a=Number.parseFloat(Mt(ae(e,"stroke-width"))??""),c={matrix:ke(t.matrix,Zt(e.attrs.transform)),fill:Mt(ae(e,"fill"))??t.fill,fillRule:s==="evenodd"||s==="nonzero"?s:t.fillRule,stroke:Mt(ae(e,"stroke"))??t.stroke,strokeWidth:Tn(a)&&a>=0?a:t.strokeWidth,color:Mt(ae(e,"color"))??t.color,opacity:t.opacity*(Tn(i)?i:1)};for(let u of e.children){if(L8.has(u.name))continue;let l=z8[u.name];if(l){r.add(l);continue}if(u.name==="svg"){r.add("nested-svg");continue}if(u.name==="g"||u.name==="a"){y$(u,c,n,r,o);continue}if(!I8.has(u.name)){r.add("unknown");continue}N8(u,c,n,r,o);}}function N8(e,t,n,r,o){if(b$(e,r),Mt(ae(e,"display"))==="none"||Mt(ae(e,"visibility"))==="hidden")return;let i=ke(t.matrix,Zt(e.attrs.transform));if(e.name==="rect"&&T8.test(e.attrs.id??"")&&!o.qrBox){o.qrBox=ir(h$(g$(e),i));return}let s=g=>Mt(ae(e,g)),a=t.opacity*Number.parseFloat(s("opacity")??"1"),c=Number.parseFloat(s("fill-opacity")??"1"),u=Number.parseFloat(s("stroke-opacity")??"1"),l=s("fill-rule"),f={...t,fill:s("fill")??t.fill,fillRule:l==="evenodd"||l==="nonzero"?l:t.fillRule,stroke:s("stroke")??t.stroke,color:s("color")??t.color},p=Number.parseFloat(s("stroke-width")??""),m=Tn(p)&&p>=0?p:t.strokeWidth,h=(g,_,b)=>{if(g.length!==0){if(o.segments+=g.length,o.segments>mt.maxInputSegments)throw new _e(`The SVG has more than ${mt.maxInputSegments} path segments; simplify it`);o.shapes.push({segments:h$(g,i),fill:_,fillRule:b});}},d=g=>{let _=(Tn(a)?a:1)*(Tn(g)?g:1);return _<=0?false:(_<1&&r.add("opacity"),true)};if(e.name!=="line"){let g=L0(f.fill,f,n,r);g&&d(c)&&h(g$(e),g,f.fillRule);}if(m>0&&f.stroke!=="none"){let g=L0(f.stroke,f,n,r);if(g&&d(u)){let _=M8(e,m);_?((s("stroke-dasharray")??"none")!=="none"&&r.add("dash"),h(_,g,e.name==="line"?"nonzero":"evenodd")):r.add("stroke");}}}function O8(e,t){let n=u=>{let l=10**t;return Math.round(u*l)/l+0},r=u=>x(u,t),o="",i=0,s=0,a=0,c=0;for(let u of e){if(u.op==="Z"){o+="z",i=a,s=c;continue}let l=n(u.x),f=n(u.y);if(u.op==="M")o+=`m${r(l-i)} ${r(f-s)}`,a=l,c=f;else if(u.op==="L"){if(l===i&&f===s)continue;o+=f===s?`h${r(l-i)}`:l===i?`v${r(f-s)}`:`l${r(l-i)} ${r(f-s)}`;}else o+=`c${r(n(u.x1)-i)} ${r(n(u.y1)-s)} ${r(n(u.x2)-i)} ${r(n(u.y2)-s)} ${r(l-i)} ${r(f-s)}`;i=l,s=f;}return o}var F8=(e,t)=>e.x0<t.x1&&t.x0<e.x1&&e.y0<t.y1&&t.y0<e.y1;function D8(e){let t=[];for(let n of e){let r=ir(n.segments);if(!r)continue;let o=t.at(-1);o&&o.shape.fill===n.fill&&o.shape.fillRule===n.fillRule&&!o.boxes.some(i=>F8(i,r))?(o.shape={...o.shape,segments:[...o.shape.segments,...n.segments]},o.boxes.push(r)):t.push({shape:n,boxes:[r]});}return t.map(n=>n.shape)}var z0=e=>[Number.parseInt(e.slice(1,3),16),Number.parseInt(e.slice(3,5),16),Number.parseInt(e.slice(5,7),16)];function Z8(e,t,n){let r=new Map;for(let s of e)r.set(s.fill,(r.get(s.fill)??0)+1);let o=new Map([...r.keys()].map(s=>[s,s])),i=0;for(;r.size>t;){let s=[...r.keys()],a=[s[0],s[1]],c=Number.POSITIVE_INFINITY;for(let m=0;m<s.length;m++)for(let h=m+1;h<s.length;h++){let d=z0(s[m]),g=z0(s[h]),_=Math.hypot(d[0]-g[0],d[1]-g[1],d[2]-g[2]);_<c&&(c=_,a=[s[m],s[h]]);}let[u,l]=a,[f,p]=(r.get(u)??0)>=(r.get(l)??0)?[u,l]:[l,u];r.set(f,(r.get(f)??0)+(r.get(p)??0)),r.delete(p);for(let[m,h]of o)h===p&&o.set(m,f);i++;}return i>0&&n.add("colors",i),o}var _$=e=>{let[t,n,r]=z0(e);return .2126*t+.7152*n+.0722*r>235};function B8(e,t={}){let n=new I0;try{let r=E8(e),o=Cn(r);if(!o)throw new _e("No <svg> element found");let i=sr(o.attrs.viewBox),[s,a,c,u]=[0,0,0,0];if(i.length===4&&i[2]>0&&i[3]>0?[s,a,c,u]=i:(c=Pe(o,"width"),u=Pe(o,"height")),!(Tn(c)&&Tn(u)&&c>0&&u>0))throw new _e("The SVG needs a viewBox (or a width and height)");let f=mt.artboardSide/Math.max(c,u),p=Math.round(c*f*10)/10,m=Math.round(u*f*10)/10;if(Math.min(p,m)<xe.minArtboard)throw new _e("The artboard is too narrow: its sides may differ by 20 times at most");let h=[f,0,0,f,-s*f,-a*f],d={shapes:[],qrBox:null,segments:0};y$(o,{matrix:h,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,color:"#000000",opacity:1},k8(o),n,d);let g={x0:0,y0:0,x1:p,y1:m},_=Math.max(p,m)*.004,b=[],y=0,S=0;for(let Z of d.shapes){let K=ir(Z.segments);if(!K||K.x1<=0||K.y1<=0||K.x0>=p||K.y0>=m){y++;continue}if(K.x0<-_||K.y0<-_||K.x1>p+_||K.y1>m+_){let J=_c(Z.segments,.25).map(Be=>bc(Be,g)).filter(Be=>Be.length>2);if(J.length===0){y++;continue}S++,b.push({...Z,segments:J.flatMap(Be=>T0(Be))});}else b.push(Z);}if(y>0&&n.add("outside",y),S>0&&n.add("clipped",S),b.length===0)throw new _e("The SVG has no filled shapes to use");let v=Z8(b,mt.maxColors,n);for(let Z of b)Z.fill=v.get(Z.fill)??Z.fill;let $=new Map,w=new Map;for(let Z of b){let K=ir(Z.segments);$.set(Z.fill,($.get(Z.fill)??0)+(K.x1-K.x0)*(K.y1-K.y0)),w.set(Z.fill,(w.get(Z.fill)??0)+1);}let A=[...$.keys()].sort((Z,K)=>Number(_$(Z))-Number(_$(K))||$.get(K)-$.get(Z)),C=A[0],R=A[1],I=Z=>Z===C?"frame":Z===R?"accent":Z,L=d.qrBox;if(!L&&t.qr){let[Z,K]=re(h,t.qr.x,t.qr.y);L={x0:Z,y0:K,x1:Z+t.qr.size*f,y1:K+t.qr.size*f};}let z,D,B;L?(z=Math.min(L.x1-L.x0,L.y1-L.y0),D=(L.x0+L.x1-z)/2,B=(L.y0+L.y1-z)/2):(n.add("qr-placed"),z=Math.min(p,m)*.6,D=(p-z)/2,B=(m-z)/2);let N=Z=>Math.round(Z*10)/10+0;if(z=Math.floor(z*10)/10,D=N(D),B=N(B),z<Math.min(p,m)*xe.minQrShare)throw new _e("The QR area must be at least half the frame's shorter side");let j=Math.min(D,B,p-D-z,m-B-z);if(j<z*xe.minPadding-1e-9)throw new _e("Leave room around the QR area: at least 4% of its size on every side, inside the artboard");let te=Math.min(Math.max(t.padding??mt.padding,xe.minPadding),.2),Q=Math.floor(Math.min(z*te,j)*10)/10,X=D8(b);if(X.length>xe.maxShapes)throw new _e(`The artwork has ${X.length} separate shapes; the limit is ${xe.maxShapes}. Combine shapes of the same color first`);let me={kind:Sc,version:vc,artboard:{width:p,height:m},qr:{x:D,y:B,size:z,padding:Q},colors:{frame:C,...R&&{accent:R}},shapes:X.map(Z=>({type:"path",d:O8(Z.segments,mt.decimals),fill:I(Z.fill),...Z.fillRule==="evenodd"&&{fillRule:"evenodd"}})),labels:[]},ze=ar.safeParse(me);if(!ze.success){let Z=ze.error.issues[0];throw new _e(`The converted frame doesn't fit the frame format: ${Z?.message??"invalid"}`)}let $e=A.map(Z=>({color:Z,ref:Z===C?"frame":Z===R?"accent":"fixed",shapes:w.get(Z)??0}));return {ok:!0,spec:ze.data,warnings:n.list(),palette:$e}}catch(r){return {ok:false,error:r instanceof _e?r.message:`Could not read the SVG (${r instanceof Error?r.name:"error"})`,warnings:n.list()}}}var $$={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1420},qr:{x:120,y:120,size:1e3,padding:60},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1420,fill:"frame",hole:{x:40,y:40,width:1160,height:1160}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1200,width:1e3,height:220}}],bleed:"frame"};var x$={kind:"qrdx.frame",version:1,artboard:{width:1978.214,height:1978.214},qr:{x:489.107,y:489.107,size:1e3,padding:50},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"circle",cx:989.107,cy:989.107,r:779.107,fill:"background"},{type:"circle",cx:989.107,cy:989.107,r:989.107,hole:779.107,fill:"frame"},{type:"circle",cx:105,cy:989.107,r:14.7,fill:"text"},{type:"circle",cx:1873.214,cy:989.107,r:14.7,fill:"text"}],labels:[{type:"curved",id:"top",slot:"primary",text:"Scan me",color:"text",curve:{cx:989.107,cy:989.107,radius:884.107,side:"top",spread:140},fontSize:105},{type:"curved",id:"bottom",slot:"secondary",text:"",color:"text",curve:{cx:989.107,cy:989.107,radius:884.107,side:"bottom",spread:140},fontSize:105}]};var w$={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1340},qr:{x:120,y:120,size:1e3,padding:40},colors:{frame:"#000000"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1260,radius:60,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1340,radius:100,fill:"frame",hole:{x:40,y:40,width:1160,height:1260,radius:60}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1160,width:1e3,height:100},fontSize:93.6}]};var S$={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 j8={"banner-bottom":$$,"rounded-border":w$,circle:x$,ticket:S$};var q8=721,W8={"call-to-action":105,holidays:115,seasons:28,"food-drink":71,shopping:64,"beauty-wellness":26,events:32,places:25,"real-estate":35,automotive:26,"health-learning":48,"sports-fitness":36,business:82,nonprofit:28};var H8=[{id:"call-to-action",label:"Call to action"},{id:"holidays",label:"Holidays"},{id:"seasons",label:"Seasons"},{id:"food-drink",label:"Food & drink"},{id:"shopping",label:"Shops & packaging"},{id:"beauty-wellness",label:"Beauty & wellness"},{id:"events",label:"Events & weddings"},{id:"places",label:"Places & Wi-Fi"},{id:"real-estate",label:"Real estate"},{id:"automotive",label:"Cars & parking"},{id:"health-learning",label:"Health & learning"},{id:"sports-fitness",label:"Sports & fitness"},{id:"business",label:"Business & social"},{id:"nonprofit",label:"Nonprofits & community"}];function N0(e){return Array.isArray(e)?`[${e.map(N0).join(",")}]`:e&&typeof e=="object"?`{${Object.keys(e).filter(n=>e[n]!==void 0).sort().map(n=>`${JSON.stringify(n)}:${N0(e[n])}`).join(",")}}`:JSON.stringify(e)}function Y8(e){let t=N0(e),n=2166136261;for(let r=0;r<t.length;r++)n^=t.charCodeAt(r),n=Math.imul(n,16777619)>>>0;return n.toString(16).padStart(8,"0")}function X8(e,t){return Te.QrCode.encodeText(e,We[t??zt]).size}function v$(e,t,n,r=n.size*(t?.size??yh)){let o={src:e,width:r,height:r,excavate:true,...t?.shape&&t.shape!=="square"&&{shape:t.shape},...t?.plate&&{plate:t.plate}},i=t?.x!==void 0||t?.y!==void 0;if(!(t?.padding||i))return o;let s=X8(n.value,n.level),a=ot(s,n.margin,n.shape),c=n.size/(s+2*a);if(t.padding&&(o.padding=t.padding*c),i){let u=s*c,l=f=>Math.min(Math.max((f??.5)*u-r/2,0),u-r);o.x=l(t.x),o.y=l(t.y);}return o}function C$(e,t,n,r){let o=n.level??zt,i=o;r&&(i=yt({...n,imageSettings:v$(e,t,n),autoLevel:r}));let s=c=>{let u=f=>v$(e,t,{...n,level:c},f),l=e0(n,[c],u().width,u);return l>0?u(l):void 0};if(i===o)return s(o);let a=s(i);return a&&yt({...n,imageSettings:a,autoLevel:r})===i?a:s(o)}function K8({value:e,level:t,margin:n,shape:r,autoLevel:o,logoOptions:i}){let a=C$("data:,",{...i,size:Ec},{value:`${e}`,size:1024,margin:n??Ne,level:t,shape:r},o);return a?a.width/1024:0}function O0({value:e,size:t=1024,fgColor:n,bgColor:r,eyeColor:o,dotColor:i,bodyPattern:s,hideLogo:a,logo:c,logoOptions:u,margin:l,cornerEyePattern:f,cornerEyeDotPattern:p,level:m,templateId:h,frame:d,eyeColors:g,moduleScale:_,autoLevel:b,shape:y}){let S={value:`${e}`,size:t,margin:l??Ne,level:m,shape:y},v=!a&&c?C$(c,u,S,b):void 0;return {value:S.value,bgColor:r,fgColor:n,eyeColor:o,dotColor:i,bodyPattern:s,cornerEyePattern:f,cornerEyeDotPattern:p,level:m,templateId:h,size:t,margin:l,...d&&{frame:d},...g&&{eyeColors:g},..._!==void 0&&{moduleScale:_},...b&&{autoLevel:b},...y&&y!=="square"&&{shape:y},...v&&{imageSettings:v}}}var P$=.06,A$=.16,E$=512;function k$(e){let{width:t,height:n}=e;if(!(t>0&&n>0)||e.data.length<t*n*4)return null;let r=Uint8Array.from(e.data),o=Sh({width:t,height:n,data:r});if(!o)return null;let i=m=>{let h=m*4;return Math.hypot(r[h]/255-o[0],r[h+1]/255-o[1],r[h+2]/255-o[2])},s=new Uint8Array(t*n),a=new Int32Array(t*n),c=0,u=0,l=m=>{s[m]||r[m*4+3]===0||i(m)>=A$||(s[m]=1,a[u++]=m);};for(let m=0;m<t;m++)l(m),l((n-1)*t+m);for(let m=0;m<n;m++)l(m*t),l(m*t+t-1);for(;c<u;){let m=a[c++],h=m%t;h>0&&l(m-1),h<t-1&&l(m+1),m>=t&&l(m-t),m<(n-1)*t&&l(m+t);}let f=new Uint8ClampedArray(r),p=o;for(let m=0;m<t*n;m++){if(!s[m])continue;let h=Math.min(1,Math.max(0,(i(m)-P$)/(A$-P$))),d=m*4;if(f[d+3]=Math.round(r[d+3]*h),h>0&&h<1)for(let g=0;g<3;g++){let b=(r[d+g]/255-(1-h)*p[g])/h;f[d+g]=Math.round(Math.min(1,Math.max(0,b))*255);}}return {width:t,height:n,data:f}}async function J8(e){if(typeof document>"u"||typeof Image>"u")throw new Error("removeLogoBackground needs a browser (canvas)");let t=await new Promise(a=>{let c=new Image;c.crossOrigin="anonymous",c.onload=()=>a(c),c.onerror=()=>a(null),c.src=e;});if(!t)return null;let n=t.naturalWidth||512,r=t.naturalHeight||512,o=Math.min(1,E$/Math.max(n,r)),i=document.createElement("canvas");i.width=Math.max(1,Math.round(n*o)),i.height=Math.max(1,Math.round(r*o));let s=i.getContext("2d",{willReadFrequently:true});if(!s)return null;try{s.drawImage(t,0,0,i.width,i.height);let a=s.getImageData(0,0,i.width,i.height),c=k$(a);return c?(a.data.set(c.data),s.putImageData(a,0,0),i.toDataURL("image/png")):null}catch{return null}finally{i.remove();}}async function e7(e){let{value:t,size:n=ve,level:r=zt,bgColor:o=Me,fgColor:i=Ge,margin:s=Ne,imageSettings:a,eyeColor:c,dotColor:u,bodyPattern:l,cornerEyePattern:f,cornerEyeDotPattern:p,isOGContext:m,templateId:h,customTemplate:d,customProps:g,frame:_,art:b,eyeColors:y,moduleScale:S,frameLabelMarkers:v,partMarkers:$,autoLevel:w,...A}=e,C=Wc({value:t,size:n,margin:s,level:r,autoLevel:w},a),R=yt({value:t,size:n,level:r,margin:s,imageSettings:C,autoLevel:w}),I=Te.QrCode.encodeText(t,We[R]).getModules(),L=I.length+s*2,z=Ln(I,n,s,C),D=null;if(C!=null&&z!=null){z.excavation!=null&&(I=c0(I,z.excavation));let N=C.src.startsWith("data:")?C.src:await fetch(`https://wsrv.nl/?url=${encodeURIComponent(C.src)}&w=100&h=100&encoding=base64`).then(j=>{if(!j.ok)throw new Error(`Failed to load QR logo (${j.status}): ${C.src}`);return j.text()});D={settings:{...C,src:N},box:{x:z.x+s,y:z.y+s,w:z.w,h:z.h}};}let B=C2(I,s);return {size:n,numCells:L,fgPath:B,bgColor:o,fgColor:i,frame:_,svgProps:A,logo:D}}function t7(e){let{size:t,numCells:n,fgPath:r,bgColor:o,fgColor:i,frame:s,svgProps:a,logo:c}=e,u=bt(s),l=c?jc(c.settings,c.box):k(Qt,{}),f=Se("svg",{height:t,viewBox:`0 0 ${n} ${n}`,width:t,xmlns:"http://www.w3.org/2000/svg",...u?{}:a,children:[k("path",{d:`M0,0 h${n}v${n}H0z`,fill:Ue(o,Me),shapeRendering:"crispEdges"}),k("path",{d:r,fill:Ue(i,Ge),shapeRendering:"crispEdges"}),l]});return u&&s?Zc(f,{size:t,frame:s,bgColor:o,svgProps:a}):f}async function n7(e){return t7(await e7(e))}function R$(e){return O0({value:e.value,fgColor:e.fgColor,hideLogo:e.hideLogo,bgColor:e.bgColor,eyeColor:e.eyeColor,dotColor:e.dotColor,bodyPattern:e.bodyPattern,cornerEyePattern:e.cornerEyePattern,cornerEyeDotPattern:e.cornerEyeDotPattern,level:e.level,templateId:e.templateId,logo:e.logo,logoOptions:e.logoOptions,margin:e.margin??Ne,autoLevel:e.autoLevel,shape:e.shape})}function M$(e,t){let{size:n=ve,scale:r=1,level:o,style:i,customTemplate:s,customProps:a,frame:c,art:u,eyeColors:l,moduleScale:f,autoLevel:p,shape:m,frameLabelMarkers:h,partMarkers:d}=e,g=n*r,_=g/t.size,b=t.imageSettings&&{...t.imageSettings,height:t.imageSettings.height*_,width:t.imageSettings.width*_,...t.imageSettings.x!=null&&{x:t.imageSettings.x*_},...t.imageSettings.y!=null&&{y:t.imageSettings.y*_},...t.imageSettings.padding!=null&&{padding:t.imageSettings.padding*_}};return {art:u,bgColor:t.bgColor,bodyPattern:t.bodyPattern,cornerEyeDotPattern:t.cornerEyeDotPattern,cornerEyePattern:t.cornerEyePattern,customProps:a,customTemplate:s,dotColor:t.dotColor,eyeColor:t.eyeColor,fgColor:t.fgColor,frame:c,level:o||t.level,margin:t.margin,...l&&{eyeColors:l},...f!==void 0&&{moduleScale:f},...p&&{autoLevel:p},...m&&m!=="square"&&{shape:m},...h&&{frameLabelMarkers:h},...d&&{partMarkers:d},size:g,style:i,templateId:t.templateId,value:t.value,...b&&{imageSettings:b}}}function r7(e){return M$(e,R$(e))}function I$(e,t){let n=[],r=o=>{if(o==null||typeof o=="boolean")return;if(typeof o=="string"||typeof o=="number"||typeof o=="bigint"){n.push(`${o}`);return}if(Array.isArray(o)){for(let u of o)r(u);return}if(!ur(o))throw new TypeError("qrdx: can't render this value");let{type:i,props:s,key:a}=o;if(vo(i)){r(s.children);return}if(typeof i=="function"){r(i(s));return}let c={};for(let u of Object.keys(s)){let l=No(u,s[u]);l&&(c[l.name]=l.value);}n.push(t(i,c,I$(s.children,t),a));};return r(e),n}var L$={diamond:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"],banner:["square","rounded","diya","leaf"],square:["curly"],diya:["curly"],message:["curly"]},z$={diamond:["square"],pacman:["rounded"],"small-square":["square","rounded"]},T$=["circle","curly"],N$=["diamond","banner","star"],O$={circle:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"]},It=["square","liquid","classy","classy-rounded"],F$={"circle/rounded":It,"circle/extra-rounded":It,"circle/message":[...It,"leaf"],"circle/pointy":It,"circle/leaf-reverse":It,"circle/drop":It,"circle/bevel":[...It,"leaf"],"circle/squircle":[...It,"circle","diamond","circle-mixed","rounded","horizontal-line","leaf","heart","mosaic","octagon"],"circle/cushion":It,"circle/shield":[...It,"rounded","horizontal-line","leaf"],"circle/petal":It};function D$(e,t,n){return (O$[e]?.includes(t)??false)&&!F$[`${e}/${t}`]?.includes(n)}function F0(e){let t=e.bodyPattern??"circle",n=e.cornerEyePattern??"gear",r=e.cornerEyeDotPattern??"circle";return L$[r]?.includes(n)?{kind:"dot-eye",message:`${r} centres in ${n} eyes are missed by strict decoders`,fix:"Pick a square, rounded or circle centre, or another eye shape"}:z$[t]?.includes(n)?{kind:"body-eye",message:`${t} dots next to ${n} eyes are missed up close`,fix:"Pick a fuller dot shape or another eye shape"}:N$.includes(r)?{kind:"dot",message:`${r} centres are missed in sharp renders and up close`,fix:"Pick a square, rounded or circle centre"}:T$.includes(n)?{kind:"eye",message:`${n} eyes only read in lenient decoders`,fix:"Pick square, rounded or gear eyes"}:D$(r,n,t)?{kind:"sharp-dot-eye",message:`${r} centres in ${n} eyes are missed by some decoders on screens and in sharp prints`,fix:"Pick a rounded centre, or gear or octagon eyes"}:null}var j$=[96,160,320],_u=640;function B0(){if(typeof document>"u")throw new Error("Scan scoring needs a browser (canvas + image decoding)")}function On(e){if(e?.aborted)throw new DOMException("Scan scoring was aborted","AbortError")}var q$=()=>new Promise(e=>setTimeout(e,0));async function G0(){let{default:e}=await import('jsqr');return e}function Z0(e,t){if(!e)return false;if(e.data===t)return true;try{return new TextDecoder().decode(Uint8Array.from(e.binaryData))===t}catch{return false}}function o7(e,t,n=.7){let{data:r,width:o,height:i}=e;for(let u=0;u<r.length;u+=4)for(let l=0;l<3;l++)r[u+l]=128+(r[u+l]-128)*n;let s=Math.max(1,Math.round(t*.25)),a=new Float32Array(o*i*3),c=u=>{let l=u?i:o,f=u?o:i,p=(h,d)=>u?h*o+d:d*o+h,m=[0,0,0];for(let h=0;h<l;h++){m.fill(0);for(let d=-s;d<=s;d++){let g=p(h,Math.min(Math.max(d,0),f-1))*4;for(let _=0;_<3;_++)m[_]=m[_]+r[g+_];}for(let d=0;d<f;d++){let g=p(h,d)*3;for(let y=0;y<3;y++)a[g+y]=m[y]/(2*s+1);let _=p(h,Math.max(d-s,0))*4,b=p(h,Math.min(d+s+1,f-1))*4;for(let y=0;y<3;y++)m[y]=m[y]-r[_+y]+r[b+y];}}for(let h=0;h<o*i;h++)for(let d=0;d<3;d++)r[h*4+d]=a[h*3+d];};for(let u=0;u<2;u++)c(true),c(false);}function Zo(e,t){let n=document.createElement("canvas");n.width=Math.max(1,Math.round(e)),n.height=Math.max(1,Math.round(t));let r=n.getContext("2d",{willReadFrequently:true});if(!r)throw new Error("Could not get canvas context");return r.imageSmoothingEnabled=true,r.imageSmoothingQuality="high",{canvas:n,ctx:r}}var i7=[.9,1,1.1];function U0(e,t,n,r,o){let i=0;for(let s of i7){let a=n*s,c=t(a);o7(c,a/r),o(e(c.data,c.width,c.height))&&i++;}return i>=2?"pass":i===1?"fragile":"fail"}var D0={small:"small print or far away",medium:"typical phone distance",large:"close up"};function s7(e,t){return e===t[0]&&t.length>1?D0.small:e===t.at(-1)?D0.large:D0.medium}function W$(e,t,n){if(n==="pass")return 0;let r=t===1?[45]:t===2?[20,45]:[15,20,45],o=r[Math.round(e*(r.length-1)/Math.max(t-1,1))]??20;return n==="fragile"?Math.round(o/2):o}function H$(e,t,n){let r=`${e} px (${s7(e,t)})`;return n==="pass"?{id:`decode-${e}`,passed:true,message:`Reads at ${r}, with camera blur`}:{id:`decode-${e}`,passed:false,message:n==="fragile"?`Reads at ${r} only some of the time`:`Doesn't read at ${r}`,fix:e===t[0]?"Print it bigger, shorten the content (fewer modules) or use solid square dots":"Raise the contrast, use bigger dots or a simpler eye shape"}}function Y$(e,t){return t?"fails":e>=85?"great":e>=65?"ok":"risky"}function a7(e,t,n){let r=St(e,t);if(r.type==="solid")return [r.color];if(r.type!=="image")return r.stops.map(a=>a.color);let o=r.underlay?bu(r.underlay):null,i=n?.[r.src];if(!i)return r.underlay?[r.underlay]:[];let s=r.opacity??1;return [i.light,i.dark].flatMap(a=>{let c=bu(a);if(!c)return [];let u={...c,a:c.a*s};if(!o)return [Z$(u)];let l=u.a+o.a*(1-u.a),f=(p,m)=>l>0?(p*u.a+m*o.a*(1-u.a))/l:0;return [Z$({r:f(u.r,o.r),g:f(u.g,o.g),b:f(u.b,o.b),a:l})]})}var Z$=({r:e,g:t,b:n,a:r})=>`rgba(${Math.round(e)}, ${Math.round(t)}, ${Math.round(n)}, ${Math.round(r*1e3)/1e3})`;function c7(e){let t=[],n=e.width*e.height;for(let i=0;i<n;i++){let s=e.data[i*4],a=e.data[i*4+1],c=e.data[i*4+2];e.data[i*4+3]<128||t.push({lum:zo(s,a,c),r:s,g:a,b:c});}if(t.length===0)return null;t.sort((i,s)=>i.lum-s.lum);let r=Math.max(1,Math.round(t.length/10)),o=i=>{let s=i.reduce((c,u)=>({r:c.r+u.r,g:c.g+u.g,b:c.b+u.b}),{r:0,g:0,b:0}),a=c=>Math.round(c/i.length).toString(16).padStart(2,"0");return `#${a(s.r)}${a(s.g)}${a(s.b)}`};return {dark:o(t.slice(0,r)),light:o(t.slice(-r))}}async function u7(e){B0();let t=await as(e),{canvas:n,ctx:r}=Zo(64,64);r.drawImage(t,0,0,64,64);let o=c7(r.getImageData(0,0,64,64));return n.remove(),o}function X$(e){let t=[e.bgColor,e.fgColor,e.eyeColor,e.dotColor,...Rc.flatMap(r=>[e.eyeColors?.[r]?.outer,e.eyeColors?.[r]?.inner])],n=new Set;for(let r of t)typeof r=="object"&&r?.type==="image"&&n.add(r.src);return [...n]}var is=null;function bu(e){let t=Ae(e);if(t||typeof document>"u")return t;if(is??=document.createElement("canvas").getContext("2d"),!is)return null;is.fillStyle="#010203",is.fillStyle=e;let n=String(is.fillStyle);return n==="#010203"?null:Ae(n)}var B$=e=>zo(e.r,e.g,e.b),K$=(e,t)=>(Math.max(e,t)+.05)/(Math.min(e,t)+.05),ss=4.5,l7=3,G$=1.5,U$={code:7,background:12},Q$={r:255,g:255,b:255,a:1},V$=(e,t)=>({r:e.r*e.a+t.r*(1-e.a),g:e.g*e.a+t.g*(1-e.a),b:e.b*e.a+t.b*(1-e.a),a:1});function f7(e,t={}){let n=t.imageTones,r=(m,h)=>{let d=typeof m=="object"&&m?.type==="image";return a7(m,h,n).map(g=>({color:g,picture:d}))},o=e.fgColor??Ge,i=Rc.flatMap(m=>{let h=e.eyeColors?.[m];return [...h?.outer?r(h.outer,Ge):[],...h?.inner?r(h.inner,Ge):[]]}),s=[...r(o,Ge),...r(e.eyeColor??o,Ge),...r(e.dotColor??o,Ge),...i],a=r(e.bgColor,Me),c=(a.length>0?a:[{color:"#ffffff",picture:false}]).map(m=>{let h=bu(m.color);return {color:h?V$(h,Q$):Q$,picture:m.picture}}),u=s.flatMap(m=>{let h=bu(m.color);return h?[{color:h,picture:m.picture}]:[]}),l=Number.POSITIVE_INFINITY,f=ss,p=false;for(let m of u)for(let h of c){let d=B$(V$(m.color,h.color)),g=B$(h.color),_=K$(d,g),b=h.picture?U$.background:m.picture?U$.code:ss;_/b<l/f&&(l=_,f=b),d>g&&(p=true);}return {ratio:Number.isFinite(l)?l:Number.POSITIVE_INFINITY,required:f,inverted:p}}function m7(e,t){let{ratio:n,inverted:r,required:o}=f7(e,{imageTones:t});if(!Number.isFinite(n))return {checks:[],penalty:0,fails:false};let i=o/ss,s=o!==ss,a=Math.round(n*10)/10,c=[],u=0;return n>=o?c.push({id:"contrast",passed:true,message:`Contrast ${a}:1 between code and background`}):(u=n<G$*i?60:n<l7*i?30:10,c.push({id:"contrast",passed:false,message:s?`Low contrast for a picture (${a}:1); ${o}:1 or more scans reliably`:`Low contrast (${a}:1); 4.5:1 or more scans reliably`,fix:s?"Lower the picture's opacity over a darker underlay (dots) or a lighter one (background)":"Use a darker code color or a lighter background"})),r?(u+=10,c.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):c.push({id:"polarity",passed:true,message:"Dark code on a light background"}),{checks:c,penalty:u,fails:n<G$*(o/ss)}}function Q0(e){return Te.QrCode.encodeText(e.value,We[yt(e)]).getModules()}function p7(e){let{imageSettings:t}=e;if(!t)return {check:null,penalty:0};let n=Q0(e),r=Ln(n,e.size??ve,ot(n.length,e.margin??Ne,e.shape),t);if(!r)return {check:null,penalty:0};let o=r.excavation??r,i=n.length,a=[[0,0],[i-8,0],[0,i-8]].some(([h,d])=>o.x<h+9&&o.x+o.w>h&&o.y<d+9&&o.y+o.h>d),c=i>21?i-9:null,u=c!==null&&o.x<c+5&&o.x+o.w>c&&o.y<c+5&&o.y+o.h>c;if(a||u)return {check:{id:"logo",passed:false,message:a?"The logo covers a corner eye":"The logo covers the small square near the bottom-right corner",fix:"Move the logo toward the center or make it smaller"},penalty:40};let l=o.w*o.h/(i*i),f=yt(e),p=Math.round(l*100),m=qc({value:e.value,size:e.size??ve,margin:e.margin??Ne,level:f,shape:e.shape},t);return !m||m.worst<=m.budget?{check:{id:"logo",passed:true,message:`Logo covers ${p}% of the code; error correction repairs it with room to spare`},penalty:0}:{check:{id:"logo",passed:false,message:`Logo covers ${p}% of the code and spoils ${m.worst} codewords in one block, which repairs ${m.correctable}`,fix:m.level==="H"?"Use a smaller logo":"Switch error correction to H or use a smaller logo"},penalty:m.worst>m.correctable?25:10}}function d7(e){let t=Xh(e.shape)?hr(e.margin??Ne):e.margin??Ne,n=Q0(e).length+2*t,r=t+(bt(e.frame)?Hh(e.frame)*n:0),o=Math.round(r*10)/10;return r>=4?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${o} modules`},penalty:0}:r>=1.5?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${o} modules (4 is ideal)`},penalty:0}:{check:{id:"quiet-zone",passed:false,message:"No quiet zone around the code",fix:"Leave clear space (about 10% of the code width) around it wherever you place it, or add a frame"},penalty:5}}function h7(e){let t=e.cornerEyePattern??"gear";return t==="curly"?{check:{id:"eye-shape",passed:false,message:"Curly eyes fail strict decoders such as ZXing-based apps",fix:"Pick square, rounded or gear eyes"},penalty:40}:t==="circle"?{check:{id:"eye-shape",passed:false,message:"Circle eyes only read in lenient decoders; many apps miss them",fix:"Pick square, rounded or gear eyes"},penalty:20}:{check:{id:"eye-shape",passed:true,message:`No known decoder issues with ${t} eyes`},penalty:0}}function as(e){return new Promise((t,n)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>t(r),r.onerror=()=>n(new Error("Could not load image")),r.src=e;})}var g7=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><rect width="10" height="10" rx="2" fill="#808080"/></svg>')}`;async function _7(e){let{imageSettings:t}=e;if(!t||t.src.startsWith("data:"))return e;let n=g7;try{let r=await as(t.src),{canvas:o,ctx:i}=Zo(r.naturalWidth||256,r.naturalHeight||256);i.drawImage(r,0,0,o.width,o.height),n=o.toDataURL("image/png");}catch{}return {...e,imageSettings:{...t,src:n}}}async function b7(e){let t=new Map;for(let o of X$(e))if(!o.startsWith("data:"))try{let i=await as(o),{canvas:s,ctx:a}=Zo(i.naturalWidth||256,i.naturalHeight||256);a.drawImage(i,0,0,s.width,s.height),t.set(o,s.toDataURL("image/png")),s.remove();}catch{t.set(o,null);}if(t.size===0)return e;let n=o=>{if(typeof o!="object"||o?.type!=="image")return o;let i=t.get(o.src);return i===void 0?o:i?{...o,src:i}:o.underlay??Ge},r=e.eyeColors?Object.fromEntries(Object.entries(e.eyeColors).map(([o,i])=>[o,i&&{outer:n(i.outer),inner:n(i.inner)}])):void 0;return {...e,bgColor:n(e.bgColor),fgColor:n(e.fgColor),eyeColor:n(e.eyeColor),dotColor:n(e.dotColor),...r&&{eyeColors:r}}}async function J$(e,t,n,r,o){let i=[],s=0,a=m7(e,o);s+=a.penalty;let c=p7(e);s+=c.penalty;let u=d7(e);s+=u.penalty;let l=h7(e);s+=l.penalty;let f=F0(e),p=f?.kind==="eye"?null:f;p&&p.kind!=="sharp-dot-eye"&&(s+=10);let m=await G0();On(r);let h=Q0(e).length,d=h+2*ot(h,e.margin??Ne,e.shape),g=[],_=false;for(let[S,v]of n.entries()){await q$(),On(r);let $=U0(m,t,v,d,w=>Z0(w,e.value));s+=W$(S,n.length,$),g.push(H$(v,n,$)),S===n.length-1&&$==="fail"&&(_=true);}i.push(...g,...a.checks),c.check&&i.push(c.check),i.push(l.check,u.check),p&&i.push({id:"style-pair",passed:false,message:p.message,fix:p.fix});let b=_||a.fails,y=Math.max(0,Math.min(100,100-s));return b&&(y=Math.min(y,30)),{score:y,grade:Y$(y,b),checks:i}}function ex(e){return [...e.sizes??j$].filter(t=>t>0).sort((t,n)=>t-n)}async function qR(e,t={}){B0();let{signal:n}=t,r=ex(t),o=await b7(await _7(br({...e,size:e.size??ve},_u)));On(n);let i={};for(let l of X$(e))try{let f=await u7(l);f&&(i[l]=f);}catch{}On(n);let s=await Rt(o),a=await as(s);On(n);let c=rn(_u,e.frame);return await J$(e,l=>{let f=l/_u,p=c.width*f,m=c.height*f,h=Math.max(8,Math.round(l*.12)),{canvas:d,ctx:g}=Zo(p+2*h,m+2*h);g.fillStyle="#ffffff",g.fillRect(0,0,d.width,d.height),g.drawImage(a,h,h,p,m);let _=g.getImageData(0,0,d.width,d.height);return d.remove(),_},r,n,i)}var WR=_u;async function HR(e,t,n={}){let{width:r,height:o}=t;if(!(r>0&&o>0)||t.data.length<r*o*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let i=ex(n),s=e.size??ve,a=rn(s,e.frame),c=r*s/a.width,u={data:y7(t),width:r,height:o};return await J$(e,f=>{let p=tx(u,f/c),m=Math.max(8,Math.round(f*.12));return $7(p,m)},i,n.signal)}function y7(e){let{data:t,width:n,height:r}=e,o=new Uint8ClampedArray(n*r*4);for(let i=0;i<n*r*4;i+=4){let s=t[i+3]/255;for(let a=0;a<3;a++)o[i+a]=t[i+a]*s+255*(1-s);o[i+3]=255;}return o}function $7(e,t){let n=e.width+2*t,r=e.height+2*t,o=new Uint8ClampedArray(n*r*4).fill(255);for(let i=0;i<e.height;i++)o.set(e.data.subarray(i*e.width*4,(i+1)*e.width*4),((i+t)*n+t)*4);return {data:o,width:n,height:r,colorSpace:"srgb"}}var Nn=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y);function gu(e,t){return .299*e[t]+.587*e[t+1]+.114*e[t+2]}function x7(e,t){let n=0;for(let a=0;a<256;a++)n+=a*e[a];let r=0,o=0,i=0,s=128;for(let a=0;a<256;a++){if(o+=e[a],o===0)continue;let c=t-o;if(c===0)break;r+=a*e[a];let u=r/o,l=(n-r)/c,f=o*c*(u-l)**2;f>i&&(i=f,s=a);}return s}async function w7(e){if(!(e instanceof Blob))return e.complete||await new Promise(n=>{e.addEventListener("load",n,{once:true}),e.addEventListener("error",n,{once:true});}),e;let t=URL.createObjectURL(e);try{let n=await as(t);return await n.decode?.().catch(()=>{}),n}finally{setTimeout(()=>URL.revokeObjectURL(t),1e3);}}async function YR(e,t={}){B0();let{signal:n}=t,r=[...t.sizes??j$].filter(W=>W>0).sort((W,de)=>W-de),o=await G0(),i=await w7(e);On(n);let s=i.naturalWidth||i.width,a=i.naturalHeight||i.height;if(!(s&&a))throw new Error("Could not read this image");let c=Math.min(1,1600/Math.max(s,a)),{canvas:u,ctx:l}=Zo(s*c,a*c);l.fillStyle="#ffffff",l.fillRect(0,0,u.width,u.height),l.drawImage(i,0,0,u.width,u.height);let f=l.getImageData(0,0,u.width,u.height),p=o(f.data,f.width,f.height);if(On(n),!p){let W=await vy(i,0,false);return u.remove(),typeof W!="string"||W==="NO_QR"?{data:null,version:null,score:0,grade:"fails",checks:[{id:"decode",passed:false,message:"No QR code found in this image",fix:"Try a sharper, well-lit, straight-on photo or a screenshot"}]}:{data:W,version:null,score:55,grade:"risky",checks:[{id:"decode",passed:false,message:"Decoded only after cropping; the code is small or hard to find in this image",fix:"Make the code bigger relative to its surroundings"}]}}let{location:m,version:h}=p,d=17+4*h,g=(Nn(m.topLeftCorner,m.topRightCorner)+Nn(m.bottomLeftCorner,m.bottomRightCorner)+Nn(m.topLeftCorner,m.bottomLeftCorner)+Nn(m.topRightCorner,m.bottomRightCorner))/4,_=g/d,b=[m.topLeftCorner,m.topRightCorner,m.bottomRightCorner,m.bottomLeftCorner],y=Math.max(0,Math.floor(Math.min(...b.map(W=>W.x)))),S=Math.min(f.width,Math.ceil(Math.max(...b.map(W=>W.x)))),v=Math.max(0,Math.floor(Math.min(...b.map(W=>W.y)))),$=Math.min(f.height,Math.ceil(Math.max(...b.map(W=>W.y)))),w=[],A=0,C=new Array(256).fill(0),R=0;for(let W=v;W<$;W++)for(let de=y;de<S;de++){let ie=Math.round(gu(f.data,(W*f.width+de)*4));C[ie]=C[ie]+1,R++;}let I=x7(C,R),L={dark:[0,0,0,0],light:[0,0,0,0]};for(let W=v;W<$;W++)for(let de=y;de<S;de++){let ie=(W*f.width+de)*4,Re=gu(f.data,ie)<=I?L.dark:L.light;Re[0]=Re[0]+f.data[ie],Re[1]=Re[1]+f.data[ie+1],Re[2]=Re[2]+f.data[ie+2],Re[3]=Re[3]+1;}let z=W=>{let de=Math.max(W[3],1);return zo(W[0]/de,W[1]/de,W[2]/de)},D=z(L.dark),B=z(L.light),N=K$(D,B),j=Math.round(N*10)/10;N>=4.5?w.push({id:"contrast",passed:true,message:`Contrast ${j}:1 in the image`}):(A+=N<2?30:10,w.push({id:"contrast",passed:false,message:`Low contrast in the image (${j}:1)`,fix:"Use a darker code on a lighter background, or better lighting for photos"}));let Q=[m.topLeftFinderPattern,m.topRightFinderPattern,m.bottomLeftFinderPattern].map(W=>{let de=Math.min(f.width-1,Math.max(0,Math.round(W.x))),ie=Math.min(f.height-1,Math.max(0,Math.round(W.y)));return gu(f.data,(ie*f.width+de)*4)}).filter(W=>W>I).length>=2;Q?(A+=10,w.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):w.push({id:"polarity",passed:true,message:"Dark code on a light background"});let X=Math.max(2,Math.round(_*2)),me={minX:y-X,maxX:S+X,minY:v-X,maxY:$+X};if(me.minX<0||me.minY<0||me.maxX>f.width||me.maxY>f.height)w.push({id:"quiet-zone",passed:true,skipped:true,message:"The image is cropped too tight to check the quiet zone"});else {let W=0,de=0;for(let ie=me.minY;ie<me.maxY;ie++)for(let Re=me.minX;Re<me.maxX;Re++){if(Re>=y&&Re<S&&ie>=v&&ie<$)continue;let Bo=gu(f.data,(ie*f.width+Re)*4);(Q?Bo>I:Bo<=I)&&W++,de++;}W/Math.max(de,1)>.12?(A+=10,w.push({id:"quiet-zone",passed:false,message:"Something dark touches the code; the quiet zone isn't clear",fix:"Leave clear space (about 4 modules) around the code"})):w.push({id:"quiet-zone",passed:true,message:"Clear space around the code"});}_<2?w.push({id:"resolution",passed:false,message:`Low resolution: about ${Math.round(_*10)/10} px per module`,fix:"Use a larger image, or export the code at a bigger size"}):w.push({id:"resolution",passed:true,message:`About ${Math.round(_)} px per module`});let $e=Math.round(_*4),Z=Math.max(0,y-$e),K=Math.max(0,v-$e),J=Math.min(f.width,S+$e)-Z,Be=Math.min(f.height,$+$e)-K,Fn=W=>{let de=W/g,ie=Zo(J*de,Be*de);ie.ctx.drawImage(u,Z,K,J,Be,0,0,ie.canvas.width,ie.canvas.height);let Re=ie.ctx.getImageData(0,0,ie.canvas.width,ie.canvas.height);return ie.canvas.remove(),Re},pt=[],qt=false;for(let[W,de]of r.entries()){await q$(),On(n);let ie=U0(o,Fn,de,d,Re=>Re?.data===p.data);A+=W$(W,r.length,ie),pt.push(H$(de,r,ie)),W===r.length-1&&ie==="fail"&&(qt=true);}u.remove();let Dn=Math.max(0,Math.min(100,100-A));return qt&&(Dn=Math.min(Dn,30)),{data:p.data,version:h,score:Dn,grade:Y$(Dn,qt),checks:[...pt,...w]}}var S7=[320];function tx(e,t){let n=Math.min(1,t),r=Math.max(1,Math.round(e.width*n)),o=Math.max(1,Math.round(e.height*n)),i=new Uint8ClampedArray(r*o*4),s=e.width/r,a=e.height/o;for(let c=0;c<o;c++){let u=Math.floor(c*a),l=Math.max(u+1,Math.min(e.height,Math.floor((c+1)*a)));for(let f=0;f<r;f++){let p=Math.floor(f*s),m=Math.max(p+1,Math.min(e.width,Math.floor((f+1)*s))),h=[0,0,0,0];for(let _=u;_<l;_++)for(let b=p;b<m;b++){let y=(_*e.width+b)*4;for(let S=0;S<4;S++)h[S]=h[S]+e.data[y+S];}let d=(l-u)*(m-p),g=(c*r+f)*4;for(let _=0;_<4;_++)i[g+_]=h[_]/d;}}return {data:i,width:r,height:o,colorSpace:"srgb"}}function v7(e){try{return new TextDecoder("utf-8",{fatal:!0}).decode(Uint8Array.from(e.binaryData))}catch{return e.data}}async function XR(e,t,n={}){let{width:r,height:o}=e;if(!(r>0&&o>0)||e.data.length<r*o*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let i=await G0(),s={data:e.data instanceof Uint8ClampedArray?e.data:Uint8ClampedArray.from(e.data),width:r,height:o},a=i(s.data,r,o,{inversionAttempts:"dontInvert"});if(!a)return {data:null,version:null,passed:false};let c=v7(a),{version:u,location:l}=a;if(!Z0(a,t))return {data:c,version:u,passed:false};let f=17+4*u,p=(Nn(l.topLeftCorner,l.topRightCorner)+Nn(l.bottomLeftCorner,l.bottomRightCorner)+Nn(l.topLeftCorner,l.bottomLeftCorner)+Nn(l.topRightCorner,l.bottomRightCorner))/4;for(let m of n.sizes??S7)if(U0(i,d=>tx(s,d/p),m,f,d=>Z0(d,t))!=="pass")return {data:c,version:u,passed:false};return {data:c,version:u,passed:true}}var C7=16,nx=.01;function P7(e){let t=new Float64Array(256);for(let c of e)t[Math.min(255,Math.max(0,Math.round(c*255)))]++;let n=e.length,r=0;for(let c=0;c<256;c++)r+=c*t[c];let o=0,i=0,s=0,a=128;for(let c=0;c<256;c++){if(i+=t[c],i===0)continue;let u=n-i;if(u===0)break;o+=c*t[c];let l=o/i,f=(r-o)/u,p=i*u*(l-f)**2;p>s&&(s=p,a=c);}return (a+.5)/255}function A7(e,t){let{width:n,height:r,data:o}=e,i=n*r,s=new Uint8Array(i),a=0;for(let m=0;m<i;m++)o[m*4+3]<128&&a++;if(t==="alpha"||t==="auto"&&a>i*.02&&a<i*.98){for(let m=0;m<i;m++)s[m]=o[m*4+3]>=128?1:0;return s}let u=new Float32Array(i);for(let m=0;m<i;m++){let h=o[m*4+3]/255,d=.2126*o[m*4]+.7152*o[m*4+1]+.0722*o[m*4+2];u[m]=1-(d*h+255*(1-h))/255;}let l=P7(u);for(let m=0;m<i;m++)s[m]=u[m]>l?1:0;let f=0,p=0;for(let m=0;m<n;m++)for(let h of [0,r-1])f++,p+=s[h*n+m];for(let m=1;m<r-1;m++)for(let h of [0,n-1])f++,p+=s[m*n+h];if(p>f/2)for(let m=0;m<i;m++)s[m]=s[m]?0:1;return s}function rx(e,t,n,r){for(let o of [1,0]){let i=new Uint8Array(e.length);for(let s=0;s<e.length;s++){if(i[s]||e[s]!==o)continue;let a=[s];i[s]=1;let c=false;for(let l of a){let f=l%t,p=(l-f)/t;(f===0||p===0||f===t-1||p===n-1)&&(c=true);for(let[m,h]of [[f-1,p],[f+1,p],[f,p-1],[f,p+1]]){if(m<0||h<0||m>=t||h>=n)continue;let d=h*t+m;!i[d]&&e[d]===o&&(i[d]=1,a.push(d));}}if((o===1||!c)&&a.length<r)for(let l of a)e[l]=o?0:1;}}}function ox(e,t={}){let{width:n,height:r,data:o}=e;if(!(n>0&&r>0)||o.length<n*r*4)throw new Error("Silhouette pixels must be width \xD7 height \xD7 4 RGBA bytes");let i=A7(e,t.mode??"auto"),s=i.reduce((w,A)=>w+A,0);rx(i,n,r,Math.max(16,s*nx));let a=n,c=r,u=-1,l=-1;for(let w=0;w<r;w++)for(let A=0;A<n;A++)i[w*n+A]&&(a=Math.min(a,A),c=Math.min(c,w),u=Math.max(u,A),l=Math.max(l,w));if(u<0)throw new Error("No shape found: use a picture with a dark or opaque shape on a light or clear background");let f=u-a+1,p=l-c+1;if(Math.max(f,p)<C7)throw new Error("The shape is too small to trace; use a bigger picture");let h=Math.min(Math.max(Math.round(t.cells??Et),Ut),Et)/Math.max(f,p),d=Math.max(Ut,Math.round(f*h)),g=Math.max(Ut,Math.round(p*h)),_=Math.max(1,Math.round(f*h)),b=Math.max(1,Math.round(p*h)),y=Math.floor((d-_)/2),S=Math.floor((g-b)/2),v=new Uint8Array(d*g);for(let w=0;w<b;w++){let A=c+Math.floor(w*p/b),C=Math.max(A+1,c+Math.floor((w+1)*p/b));for(let R=0;R<_;R++){let I=a+Math.floor(R*f/_),L=Math.max(I+1,a+Math.floor((R+1)*f/_)),z=0;for(let D=A;D<C;D++)for(let B=I;B<L;B++)z+=i[D*n+B];v[(w+S)*d+R+y]=z*2>=(C-A)*(L-I)?1:0;}}let $=v.reduce((w,A)=>w+A,0);if(rx(v,d,g,Math.max(4,$*nx)),!v.includes(1))throw new Error("The shape is too small to trace; use a bigger picture");return {type:"silhouette",width:d,height:g,cells:Array.from(v,w=>w?"1":"0").join("")}}var V0=512;async function E7(e){if(typeof e!="string"&&!(e instanceof Blob))return e.complete||await new Promise(n=>{e.addEventListener("load",n,{once:true}),e.addEventListener("error",n,{once:true});}),e;let t=typeof e=="string"?e:URL.createObjectURL(e);try{return await new Promise((n,r)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>n(o),o.onerror=()=>r(new Error("Could not load the picture")),o.src=t;})}finally{typeof e!="string"&&setTimeout(()=>URL.revokeObjectURL(t),1e3);}}async function k7(e,t={}){if(typeof document>"u")throw new Error("loadQRSilhouette needs a browser; pass decoded pixels to createQRSilhouette instead");let n=await E7(e),r=n.naturalWidth||n.width||V0,o=n.naturalHeight||n.height||V0,i=V0/Math.max(r,o),s=Math.max(1,Math.round(r*i)),a=Math.max(1,Math.round(o*i)),c=document.createElement("canvas");c.width=s,c.height=a;let u=c.getContext("2d",{willReadFrequently:true});if(!u)throw new Error("Could not get a canvas context");u.drawImage(n,0,0,s,a);let l;try{l=u.getImageData(0,0,s,a);}catch{throw new Error("Could not read the picture (cross-origin images need CORS); upload it instead")}finally{c.remove();}return ox(l,t)}var ix=(e,t)=>{let n=t??e.size??ve;return {width:n,height:n}};function GM(e,t){let n=typeof e=="string"?document.querySelector(e):e;if(!n)throw new Error(`qrdx: no element matches ${String(e)}`);let r={...t},o=null,i="",s=false,a=()=>{let c=To(r),u=Vt(c);if(o&&u===i)return;let l=es(c,n.ownerDocument).firstChild;o?.parentNode===n?o.replaceWith(l):n.appendChild(l),o=l,i=u;};return a(),{get svg(){return o},get options(){return r},update(c){if(s)throw new Error("qrdx: this QR code was destroyed");r={...r,...c},a();},toSVGString(){return i||Vt(To(r))},toDataURL(c="png",u={}){return p$(r,c,ix(r,u.size),{quality:u.quality})},download(c={}){return m$(r,{format:c.format??"png",size:ix(r,c.size),filename:c.filename,quality:c.quality})},destroy(){s||(s=true,o?.remove(),o=null);}}}/**
|
|
88
|
+
* @license QR Code generator library (TypeScript)
|
|
89
|
+
* Copyright (c) Project Nayuki.
|
|
90
|
+
* SPDX-License-Identifier: MIT
|
|
91
|
+
*/export{$h as AUTO_LEVEL_LOGO_COVERAGE,c2 as Arrow,kb as BODY_PATTERN,j8 as BUILT_IN_FRAME_SPECS,rh as CORNER_EYE_DOT_PATTERNS,ih as CORNER_EYE_PATTERNS,Bi as CUSTOM_FRAME_STYLE,Yb as DEFAULT_ART_INTENSITY,ah as DEFAULT_FRAME_TEXT,Ne as DEFAULT_MARGIN,ve as DEFAULT_SIZE,A0 as DOWNLOAD_FORMATS,s$ as EPS_IMAGE_FILL_REASON,Rc as EYE_POSITIONS,Sb as FRAME_COLOR_TOKENS,zy as FRAME_FONT_FAMILY,vn as FRAME_FONT_SCALE_MAX,bo as FRAME_FONT_SCALE_MIN,Wh as FRAME_GAP_RATIO,xb as FRAME_ICONS,Zh as FRAME_ICON_BOX,wb as FRAME_ICON_MAX_SEGMENTS,mt as FRAME_IMPORT_LIMITS,Ty as FRAME_LABEL_ATTRIBUTE,Sc as FRAME_SPEC_KIND,Cc as FRAME_SPEC_LABEL_MAX_FONT,xe as FRAME_SPEC_LIMITS,vc as FRAME_SPEC_VERSION,fb as FRAME_STYLES,Dt as FRAME_TEXT_MAX_LENGTH,Qt as Fragment,Yi as FrameSpecError,Uh as GRADIENT_FRAME_DEFAULTS,l2 as Halloween,E$ as LOGO_CLEANUP_MAX_SIDE,r2 as LOGO_EC_SAFETY,Lb as LOGO_PADDING_MAX,Vc as LOGO_PLATE_INSET,Qc as LOGO_ROUNDED_RADIUS,Rb as LOGO_SHAPES,yh as LOGO_SIZE_DEFAULT,Ec as LOGO_SIZE_MAX,Ib as LOGO_SIZE_MIN,wy as MODULE_SCALE_FLOOR,kc as MODULE_SCALE_MAX,Gi as MODULE_SCALE_MIN,H8 as OFFICIAL_FRAME_COLLECTIONS,q8 as OFFICIAL_FRAME_COUNT,W8 as OFFICIAL_FRAME_COUNTS,S7 as PIXEL_SCAN_SIZES,WR as PIXEL_SCORE_MIN_CODE_WIDTH,Zk as PRESET_SIZES,Jt as QR_ART_MAX_SAMPLE_SIZE,Ic as QR_ART_MIN_LUMA_GAP,Zi as QR_ART_MODES,kh as QR_ART_SAMPLE_SIZES,Di as QR_ART_VARIANTS,xh as QR_CIRCLE_QUIET_MIN,a2 as QR_EYE_ATTRIBUTE,iv as QR_PARTS,t0 as QR_PART_ATTRIBUTE,Tb as QR_SHAPES,Et as QR_SILHOUETTE_MAX_CELLS,Ut as QR_SILHOUETTE_MIN_CELLS,wh as QR_SILHOUETTE_MIN_SHARE,ub as RETIRED_CORNER_EYE_DOT_PATTERNS,lb as RETIRED_CORNER_EYE_PATTERNS,G$ as SCAN_CONTRAST_FAIL,l7 as SCAN_CONTRAST_LOW,ss as SCAN_CONTRAST_MIN,U$ as SCAN_IMAGE_CONTRAST_MIN,j$ as SCAN_TEST_SIZES,F$ as SHARP_DOT_EYE_SAFE_BODIES,pE as SUPPORTS_PATH2D,f2 as SquareBorder,m2 as StandardBox,p2 as StrikedBox,r0 as TEMPLATES,z$ as WEAK_BODY_EYES,N$ as WEAK_DOTS,L$ as WEAK_DOT_EYES,T$ as WEAK_EYES,O$ as WEAK_SHARP_DOT_EYES,Ov as WEBP_MAX_DIMENSION,ob as angularGradientSchema,gh as anyFrameSchema,M3 as baseTemplatePropsSchema,ts as blobToDataUrl,_h as bodyPatternSchema,tu as canvasToWebP,hr as circleQuietZone,Tc as clampModuleScale,Sn as colorConfigSchema,Hw as colorTypeSchema,gv as convertImageSettingsToPixels,Bk as copyQRCodeToClipboard,oh as cornerEyeDotPatternSchema,sh as cornerEyePatternSchema,Xb as createQRArtImage,GM as createQRCode,To as createQRCodeTree,ox as createQRSilhouette,Eb as customFrameSchema,Vi as damagedCodewords,v0 as decodePNGPixels,u2 as defaultTemplate,jt as downloadFile,S9 as downloadImageData,v9 as downloadImageWithBoundingBox,b8 as downloadPrintEPS,bk as downloadPrintPDF,yk as downloadPrintSVG,m$ as downloadQRCode,h0 as encodeWebPLossless,du as epsToDataUrl,zb as errorLevelSchema,c0 as excavateModules,Kw as excavationSchema,Ac as eyeColorOverrideSchema,Db as eyeColorsSchema,Fy as frameLabels,hc as frameSchema,xo as frameSpecColorSchema,Y8 as frameSpecHash,Pb as frameSpecLabelSchema,wo as frameSpecPadding,Pn as frameSpecPaintSchema,Ab as frameSpecQrZone,ar as frameSpecSchema,vb as frameSpecShapeSchema,mb as frameStyleSchema,C2 as generatePath,ZA as getAllTemplates,Qi as getCodewordMap,Yw as getColorString,gE as getContrastLevel,hE as getContrastRatio,jh as getCustomFrameLayout,y8 as getDownloadFilename,rn as getFrameDimensions,Hh as getFrameGapRatio,Bh as getFrameIconPath,dr as getFrameLayout,Oy as getFrameSecondaryText,Vh as getFrameSpecGapRatio,E3 as getFrameSpecIssues,Ny as getFrameText,YR as getImageScanScore,Ln as getImageSettings,u7 as getImageTones,c7 as getImageTonesFromPixels,ot as getLayoutMargin,qc as getLogoBlockDamage,K8 as getLogoSizeLimit,zo as getLuminance,Xw as getNormalizedColor,mu as getPrintLayout,$6 as getQRArtColorIssue,Fh as getQRArtEyeColors,Lc as getQRArtVariant,Oo as getQRAsCanvas,pu as getQRAsEPS,i8 as getQRAsPrintPDF,_k as getQRAsPrintPDFBuffer,s8 as getQRAsPrintSVG,Rt as getQRAsSVGDataUri,n7 as getQRAsSVGNode,u$ as getQRAsWebP,R$ as getQRCodeData,p$ as getQRCodeDataUrl,M$ as getQRCodeSVGProps,O0 as getQRData,c6 as getQRFunctionModules,r8 as getQRModuleCount,ZS as getQRShapePath,OS as getQRSilhouetteFit,Gk as getSVGString,f7 as getScanContrast,qR as getScanScore,HR as getScanScoreFromPixels,Ue as getSolidColor,F0 as getStylePairRisk,d2 as getTemplate,BA as getTemplateIds,g0 as getWebPCompression,dc as gradientStopSchema,J3 as h,vy as handleImageLoad,a$ as hasImageFill,dE as hexToRgb,ib as imageFitSchema,ab as imagePaintSchema,cb as imagePositionCss,sb as imagePositionSchema,Mb as imageSettingsSchema,B8 as importFrameSvg,bt as isFrameActive,_o as isGradient,nh as isImagePaint,d3 as isLatin1Text,Mh as isQRArtActive,ur as isQRNode,Xh as isShapedCode,D$ as isWeakSharpPair,B2 as isWebPFile,nb as linearGradientSchema,i6 as loadQRArtImage,k7 as loadQRSilhouette,ov as logoFitsBudget,k3 as logoOptionsSchema,bh as logoShapeSchema,_t as mixFrameColors,St as normalizeColorConfig,n0 as partMarker,Jw as pickableCornerEyeDotPatternSchema,e3 as pickableCornerEyePatternSchema,eb as qrArtImageSchema,K_ as qrArtModeSchema,th as qrArtSchema,J_ as qrArtVariantSchema,Fb as qrCodeShapeSchema,R3 as qrPropsSchema,Nb as qrShapeSchema,Ob as qrSilhouetteSchema,rb as radialGradientSchema,k$ as removeLogoBackdrop,J8 as removeLogoBackground,Th as renderQRArt,es as renderToDOM,Vt as renderToString,yt as resolveErrorLevel,Qh as resolveFrameSpec,r7 as resolveQRCodeProps,En as rgbToCmyk,Pc as sanitizeFrameText,XR as scanQRPixels,tb as solidColorSchema,i$ as svgToEPS,I3 as templateConfigSchema,L3 as templateDefinitionBaseSchema,I$ as toHyperscript,Nv as toSVGElement,f0 as toSVGString,E0 as validateSize,br as withQRSize};//# sourceMappingURL=vanilla.browser.mjs.map
|
|
92
|
+
//# sourceMappingURL=vanilla.browser.mjs.map
|