UNPKG

@finsel-dgi/flow-dialog

Version:

A reusable React component library for Pasby eID authentication flows with QR code scanning and signature verification

6 lines 139 kB
"use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom");function r(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var o=r(t),a=r(n),i=Array(12).fill(0),s=({visible:e,className:n})=>t.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},t.createElement("div",{className:"sonner-spinner"},i.map((e,n)=>t.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),l=t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},t.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),c=t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},t.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),u=t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},t.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),d=t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},t.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),f=t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),h=1,p=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:h++,a=this.toasts.find(e=>e.id===o),i=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(t=>t.id===o?(this.publish({...t,...e,id:o,title:n}),{...t,...e,id:o,dismissible:i,title:n}):t):this.addToast({title:n,...r,dismissible:i,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;void 0!==n.loading&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:"function"!=typeof n.description?n.description:void 0}));let o,a=e instanceof Promise?e:e(),i=void 0!==r,s=a.then(async e=>{if(o=["resolve",e],t.isValidElement(e))i=!1,this.create({id:r,type:"default",message:e});else if(m(e)&&!e.ok){i=!1;let t="function"==typeof n.error?await n.error(`HTTP error! status: ${e.status}`):n.error,o="function"==typeof n.description?await n.description(`HTTP error! status: ${e.status}`):n.description;this.create({id:r,type:"error",message:t,description:o})}else if(void 0!==n.success){i=!1;let t="function"==typeof n.success?await n.success(e):n.success,o="function"==typeof n.description?await n.description(e):n.description;this.create({id:r,type:"success",message:t,description:o})}}).catch(async e=>{if(o=["reject",e],void 0!==n.error){i=!1;let t="function"==typeof n.error?await n.error(e):n.error,o="function"==typeof n.description?await n.description(e):n.description;this.create({id:r,type:"error",message:t,description:o})}}).finally(()=>{var e;i&&(this.dismiss(r),r=void 0),null==(e=n.finally)||e.call(n)}),l=()=>new Promise((e,t)=>s.then(()=>"reject"===o[0]?t(o[1]):e(o[1])).catch(t));return"string"!=typeof r&&"number"!=typeof r?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let n=(null==t?void 0:t.id)||h++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},m=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,g=(e,t)=>{let n=(null==t?void 0:t.id)||h++;return p.addToast({title:e,...t,id:n}),n},v=Object.assign(g,{success:p.success,info:p.info,warning:p.warning,error:p.error,custom:p.custom,message:p.message,promise:p.promise,dismiss:p.dismiss,loading:p.loading},{getHistory:()=>p.toasts,getToasts:()=>p.getActiveToasts()});function y(e){return void 0!==e.label}!function(e,{insertAt:t}={}){if(!e||"undefined"==typeof document)return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===t&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}(':where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\n');var w=3,b=14;function x(...e){return e.filter(Boolean).join(" ")}var E=e=>{var n,r,o,a,i,h,p,m,g,v,w;let{invert:b,toast:E,unstyled:C,interacting:N,setHeights:R,visibleToasts:M,heights:S,index:A,toasts:T,expanded:k,removeToast:P,defaultRichColors:D,closeButton:j,style:O,cancelButtonStyle:L,actionButtonStyle:I,className:_="",descriptionClassName:z="",duration:B,position:F,gap:H,loadingIcon:$,expandByDefault:W,classNames:Y,icons:U,closeButtonAriaLabel:V="Close toast",pauseWhenPageIsHidden:X}=e,[K,Q]=t.useState(null),[q,Z]=t.useState(null),[G,J]=t.useState(!1),[ee,te]=t.useState(!1),[ne,re]=t.useState(!1),[oe,ae]=t.useState(!1),[ie,se]=t.useState(!1),[le,ce]=t.useState(0),[ue,de]=t.useState(0),fe=t.useRef(E.duration||B||4e3),he=t.useRef(null),pe=t.useRef(null),me=0===A,ge=A+1<=M,ve=E.type,ye=!1!==E.dismissible,we=E.className||"",be=E.descriptionClassName||"",xe=t.useMemo(()=>S.findIndex(e=>e.toastId===E.id)||0,[S,E.id]),Ee=t.useMemo(()=>{var e;return null!=(e=E.closeButton)?e:j},[E.closeButton,j]),Ce=t.useMemo(()=>E.duration||B||4e3,[E.duration,B]),Ne=t.useRef(0),Re=t.useRef(0),Me=t.useRef(0),Se=t.useRef(null),[Ae,Te]=F.split("-"),ke=t.useMemo(()=>S.reduce((e,t,n)=>n>=xe?e:e+t.height,0),[S,xe]),Pe=(()=>{let[e,n]=t.useState(document.hidden);return t.useEffect(()=>{let e=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e})(),De=E.invert||b,je="loading"===ve;Re.current=t.useMemo(()=>xe*H+ke,[xe,ke]),t.useEffect(()=>{fe.current=Ce},[Ce]),t.useEffect(()=>{J(!0)},[]),t.useEffect(()=>{let e=pe.current;if(e){let t=e.getBoundingClientRect().height;return de(t),R(e=>[{toastId:E.id,height:t,position:E.position},...e]),()=>R(e=>e.filter(e=>e.toastId!==E.id))}},[R,E.id]),t.useLayoutEffect(()=>{if(!G)return;let e=pe.current,t=e.style.height;e.style.height="auto";let n=e.getBoundingClientRect().height;e.style.height=t,de(n),R(e=>e.find(e=>e.toastId===E.id)?e.map(e=>e.toastId===E.id?{...e,height:n}:e):[{toastId:E.id,height:n,position:E.position},...e])},[G,E.title,E.description,R,E.id]);let Oe=t.useCallback(()=>{te(!0),ce(Re.current),R(e=>e.filter(e=>e.toastId!==E.id)),setTimeout(()=>{P(E)},200)},[E,P,R,Re]);return t.useEffect(()=>{if(E.promise&&"loading"===ve||E.duration===1/0||"loading"===E.type)return;let e;return k||N||X&&Pe?(()=>{if(Me.current<Ne.current){let e=(new Date).getTime()-Ne.current;fe.current=fe.current-e}Me.current=(new Date).getTime()})():fe.current!==1/0&&(Ne.current=(new Date).getTime(),e=setTimeout(()=>{var e;null==(e=E.onAutoClose)||e.call(E,E),Oe()},fe.current)),()=>clearTimeout(e)},[k,N,E,ve,X,Pe,Oe]),t.useEffect(()=>{E.delete&&Oe()},[Oe,E.delete]),t.createElement("li",{tabIndex:0,ref:pe,className:x(_,we,null==Y?void 0:Y.toast,null==(n=null==E?void 0:E.classNames)?void 0:n.toast,null==Y?void 0:Y.default,null==Y?void 0:Y[ve],null==(r=null==E?void 0:E.classNames)?void 0:r[ve]),"data-sonner-toast":"","data-rich-colors":null!=(o=E.richColors)?o:D,"data-styled":!(E.jsx||E.unstyled||C),"data-mounted":G,"data-promise":!!E.promise,"data-swiped":ie,"data-removed":ee,"data-visible":ge,"data-y-position":Ae,"data-x-position":Te,"data-index":A,"data-front":me,"data-swiping":ne,"data-dismissible":ye,"data-type":ve,"data-invert":De,"data-swipe-out":oe,"data-swipe-direction":q,"data-expanded":!!(k||W&&G),style:{"--index":A,"--toasts-before":A,"--z-index":T.length-A,"--offset":`${ee?le:Re.current}px`,"--initial-height":W?"auto":`${ue}px`,...O,...E.style},onDragEnd:()=>{re(!1),Q(null),Se.current=null},onPointerDown:e=>{je||!ye||(he.current=new Date,ce(Re.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(re(!0),Se.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,n,r;if(oe||!ye)return;Se.current=null;let o=Number((null==(e=pe.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),a=Number((null==(t=pe.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),i=(new Date).getTime()-(null==(n=he.current)?void 0:n.getTime()),s="x"===K?o:a,l=Math.abs(s)/i;if(Math.abs(s)>=20||l>.11)return ce(Re.current),null==(r=E.onDismiss)||r.call(E,E),Z("x"===K?o>0?"right":"left":a>0?"down":"up"),Oe(),ae(!0),void se(!1);re(!1),Q(null)},onPointerMove:t=>{var n,r,o,a;if(!Se.current||!ye||(null==(n=window.getSelection())?void 0:n.toString().length)>0)return;let i=t.clientY-Se.current.y,s=t.clientX-Se.current.x,l=null!=(r=e.swipeDirections)?r:function(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}(F);!K&&(Math.abs(s)>1||Math.abs(i)>1)&&Q(Math.abs(s)>Math.abs(i)?"x":"y");let c={x:0,y:0};"y"===K?(l.includes("top")||l.includes("bottom"))&&(l.includes("top")&&i<0||l.includes("bottom")&&i>0)&&(c.y=i):"x"===K&&(l.includes("left")||l.includes("right"))&&(l.includes("left")&&s<0||l.includes("right")&&s>0)&&(c.x=s),(Math.abs(c.x)>0||Math.abs(c.y)>0)&&se(!0),null==(o=pe.current)||o.style.setProperty("--swipe-amount-x",`${c.x}px`),null==(a=pe.current)||a.style.setProperty("--swipe-amount-y",`${c.y}px`)}},Ee&&!E.jsx?t.createElement("button",{"aria-label":V,"data-disabled":je,"data-close-button":!0,onClick:je||!ye?()=>{}:()=>{var e;Oe(),null==(e=E.onDismiss)||e.call(E,E)},className:x(null==Y?void 0:Y.closeButton,null==(a=null==E?void 0:E.classNames)?void 0:a.closeButton)},null!=(i=null==U?void 0:U.close)?i:f):null,E.jsx||t.isValidElement(E.title)?E.jsx?E.jsx:"function"==typeof E.title?E.title():E.title:t.createElement(t.Fragment,null,ve||E.icon||E.promise?t.createElement("div",{"data-icon":"",className:x(null==Y?void 0:Y.icon,null==(h=null==E?void 0:E.classNames)?void 0:h.icon)},E.promise||"loading"===E.type&&!E.icon?E.icon||function(){var e,n,r;return null!=U&&U.loading?t.createElement("div",{className:x(null==Y?void 0:Y.loader,null==(e=null==E?void 0:E.classNames)?void 0:e.loader,"sonner-loader"),"data-visible":"loading"===ve},U.loading):$?t.createElement("div",{className:x(null==Y?void 0:Y.loader,null==(n=null==E?void 0:E.classNames)?void 0:n.loader,"sonner-loader"),"data-visible":"loading"===ve},$):t.createElement(s,{className:x(null==Y?void 0:Y.loader,null==(r=null==E?void 0:E.classNames)?void 0:r.loader),visible:"loading"===ve})}():null,"loading"!==E.type?E.icon||(null==U?void 0:U[ve])||(e=>{switch(e){case"success":return l;case"info":return u;case"warning":return c;case"error":return d;default:return null}})(ve):null):null,t.createElement("div",{"data-content":"",className:x(null==Y?void 0:Y.content,null==(p=null==E?void 0:E.classNames)?void 0:p.content)},t.createElement("div",{"data-title":"",className:x(null==Y?void 0:Y.title,null==(m=null==E?void 0:E.classNames)?void 0:m.title)},"function"==typeof E.title?E.title():E.title),E.description?t.createElement("div",{"data-description":"",className:x(z,be,null==Y?void 0:Y.description,null==(g=null==E?void 0:E.classNames)?void 0:g.description)},"function"==typeof E.description?E.description():E.description):null),t.isValidElement(E.cancel)?E.cancel:E.cancel&&y(E.cancel)?t.createElement("button",{"data-button":!0,"data-cancel":!0,style:E.cancelButtonStyle||L,onClick:e=>{var t,n;y(E.cancel)&&ye&&(null==(n=(t=E.cancel).onClick)||n.call(t,e),Oe())},className:x(null==Y?void 0:Y.cancelButton,null==(v=null==E?void 0:E.classNames)?void 0:v.cancelButton)},E.cancel.label):null,t.isValidElement(E.action)?E.action:E.action&&y(E.action)?t.createElement("button",{"data-button":!0,"data-action":!0,style:E.actionButtonStyle||I,onClick:e=>{var t,n;y(E.action)&&(null==(n=(t=E.action).onClick)||n.call(t,e),!e.defaultPrevented&&Oe())},className:x(null==Y?void 0:Y.actionButton,null==(w=null==E?void 0:E.classNames)?void 0:w.actionButton)},E.action.label):null))};function C(){if("undefined"==typeof window||"undefined"==typeof document)return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}function N(e,t){let n={};return[e,t].forEach((e,t)=>{let r=1===t,o=r?"--mobile-offset":"--offset",a=r?"16px":"32px";function i(e){["top","right","bottom","left"].forEach(t=>{n[`${o}-${t}`]="number"==typeof e?`${e}px`:e})}"number"==typeof e||"string"==typeof e?i(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?n[`${o}-${t}`]=a:n[`${o}-${t}`]="number"==typeof e[t]?`${e[t]}px`:e[t]}):i(a)}),n}t.forwardRef(function(e,r){let{invert:o,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:s,closeButton:l,className:c,offset:u,mobileOffset:d,theme:f="light",richColors:h,duration:m,style:g,visibleToasts:v=w,toastOptions:y,dir:x=C(),gap:R=b,loadingIcon:M,icons:S,containerAriaLabel:A="Notifications",pauseWhenPageIsHidden:T}=e,[k,P]=t.useState([]),D=t.useMemo(()=>Array.from(new Set([a].concat(k.filter(e=>e.position).map(e=>e.position)))),[k,a]),[j,O]=t.useState([]),[L,I]=t.useState(!1),[_,z]=t.useState(!1),[B,F]=t.useState("system"!==f?f:"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=t.useRef(null),$=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=t.useRef(null),Y=t.useRef(!1),U=t.useCallback(e=>{P(t=>{var n;return null!=(n=t.find(t=>t.id===e.id))&&n.delete||p.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return t.useEffect(()=>p.subscribe(e=>{e.dismiss?P(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t)):setTimeout(()=>{n.flushSync(()=>{P(t=>{let n=t.findIndex(t=>t.id===e.id);return-1!==n?[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]:[e,...t]})})})}),[]),t.useEffect(()=>{if("system"!==f)return void F(f);if("system"===f&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),"undefined"==typeof window)return;let e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",({matches:e})=>{F(e?"dark":"light")})}catch(t){e.addListener(({matches:e})=>{try{F(e?"dark":"light")}catch(e){console.error(e)}})}},[f]),t.useEffect(()=>{k.length<=1&&I(!1)},[k]),t.useEffect(()=>{let e=e=>{var t,n;i.every(t=>e[t]||e.code===t)&&(I(!0),null==(t=H.current)||t.focus()),"Escape"===e.code&&(document.activeElement===H.current||null!=(n=H.current)&&n.contains(document.activeElement))&&I(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i]),t.useEffect(()=>{if(H.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,Y.current=!1)}},[H.current]),t.createElement("section",{ref:r,"aria-label":`${A} ${$}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((n,r)=>{var a;let[i,f]=n.split("-");return k.length?t.createElement("ol",{key:n,dir:"auto"===x?C():x,tabIndex:-1,ref:H,className:c,"data-sonner-toaster":!0,"data-theme":B,"data-y-position":i,"data-lifted":L&&k.length>1&&!s,"data-x-position":f,style:{"--front-toast-height":`${(null==(a=j[0])?void 0:a.height)||0}px`,"--width":"356px","--gap":`${R}px`,...g,...N(u,d)},onBlur:e=>{Y.current&&!e.currentTarget.contains(e.relatedTarget)&&(Y.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||Y.current||(Y.current=!0,W.current=e.relatedTarget)},onMouseEnter:()=>I(!0),onMouseMove:()=>I(!0),onMouseLeave:()=>{_||I(!1)},onDragEnd:()=>I(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||z(!0)},onPointerUp:()=>z(!1)},k.filter(e=>!e.position&&0===r||e.position===n).map((r,a)=>{var i,c;return t.createElement(E,{key:r.id,icons:S,index:a,toast:r,defaultRichColors:h,duration:null!=(i=null==y?void 0:y.duration)?i:m,className:null==y?void 0:y.className,descriptionClassName:null==y?void 0:y.descriptionClassName,invert:o,visibleToasts:v,closeButton:null!=(c=null==y?void 0:y.closeButton)?c:l,interacting:_,position:n,style:null==y?void 0:y.style,unstyled:null==y?void 0:y.unstyled,classNames:null==y?void 0:y.classNames,cancelButtonStyle:null==y?void 0:y.cancelButtonStyle,actionButtonStyle:null==y?void 0:y.actionButtonStyle,removeToast:U,toasts:k.filter(e=>e.position==r.position),heights:j.filter(e=>e.position==r.position),setHeights:O,expandByDefault:s,gap:R,loadingIcon:M,expanded:L,pauseWhenPageIsHidden:T,swipeDirections:e.swipeDirections})})):null}))});var R,M,S=["color"],A=t.forwardRef(function(e,n){var r=e.color,o=void 0===r?"currentColor":r,a=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,S);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:n}),t.createElement("path",{d:"M3 1C2.44771 1 2 1.44772 2 2V13C2 13.5523 2.44772 14 3 14H10.5C10.7761 14 11 13.7761 11 13.5C11 13.2239 10.7761 13 10.5 13H3V2L10.5 2C10.7761 2 11 1.77614 11 1.5C11 1.22386 10.7761 1 10.5 1H3ZM12.6036 4.89645C12.4083 4.70118 12.0917 4.70118 11.8964 4.89645C11.7012 5.09171 11.7012 5.40829 11.8964 5.60355L13.2929 7H6.5C6.22386 7 6 7.22386 6 7.5C6 7.77614 6.22386 8 6.5 8H13.2929L11.8964 9.39645C11.7012 9.59171 11.7012 9.90829 11.8964 10.1036C12.0917 10.2988 12.4083 10.2988 12.6036 10.1036L14.8536 7.85355C15.0488 7.65829 15.0488 7.34171 14.8536 7.14645L12.6036 4.89645Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),T=Object.defineProperty,k=Object.getOwnPropertySymbols,P=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable,j=(e,t,n)=>t in e?T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,O=(e,t)=>{for(var n in t||(t={}))P.call(t,n)&&j(e,n,t[n]);if(k)for(var n of k(t))D.call(t,n)&&j(e,n,t[n]);return e},L=(e,t)=>{var n={};for(var r in e)P.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&k)for(var r of k(e))t.indexOf(r)<0&&D.call(e,r)&&(n[r]=e[r]);return n};(e=>{const t=class{constructor(e,n,r,o){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let i=[];for(let e=0;e<this.size;e++)i.push(!1);for(let e=0;e<this.size;e++)this.modules.push(i.slice()),this.isFunction.push(i.slice());this.drawFunctionPatterns();const s=this.addEccAndInterleave(r);if(this.drawCodewords(s),-1==o){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(o=t,e=n),this.applyMask(t)}}a(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}static encodeText(n,r){const o=e.QrSegment.makeSegments(n);return t.encodeSegments(o,r)}static encodeBinary(n,r){const o=e.QrSegment.makeBytes(n);return t.encodeSegments([o],r)}static encodeSegments(e,n,o=1,i=40,l=-1,c=!0){if(!(t.MIN_VERSION<=o&&o<=i&&i<=t.MAX_VERSION)||l<-1||l>7)throw new RangeError("Invalid value");let u,d;for(u=o;;u++){const r=8*t.getNumDataCodewords(u,n),o=s.getTotalBits(e,u);if(o<=r){d=o;break}if(u>=i)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])c&&d<=8*t.getNumDataCodewords(u,e)&&(n=e);let f=[];for(const t of e){r(t.mode.modeBits,4,f),r(t.numChars,t.mode.numCharCountBits(u),f);for(const e of t.getData())f.push(e)}a(f.length==d);const h=8*t.getNumDataCodewords(u,n);a(f.length<=h),r(0,Math.min(4,h-f.length),f),r(0,(8-f.length%8)%8,f),a(f.length%8==0);for(let e=236;f.length<h;e^=253)r(e,8,f);let p=[];for(;8*p.length<f.length;)p.push(0);return f.forEach((e,t)=>p[t>>>3]|=e<<7-(7&t)),new t(u,n,p,l)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)0==n&&0==r||0==n&&r==t-1||n==t-1&&0==r||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let n=t;for(let e=0;e<10;e++)n=n<<1^1335*(n>>>9);const r=21522^(t<<10|n);a(r>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,o(r,e));this.setFunctionModule(8,7,o(r,6)),this.setFunctionModule(8,8,o(r,7)),this.setFunctionModule(7,8,o(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,o(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,o(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,o(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;a(t>>>18==0);for(let e=0;e<18;e++){const n=o(t,e),r=this.size-11+e%3,a=Math.floor(e/3);this.setFunctionModule(r,a,n),this.setFunctionModule(a,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const o=Math.max(Math.abs(r),Math.abs(n)),a=e+r,i=t+n;0<=a&&a<this.size&&0<=i&&i<this.size&&this.setFunctionModule(a,i,2!=o&&4!=o)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,1!=Math.max(Math.abs(r),Math.abs(n)))}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){const n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw new RangeError("Invalid argument");const o=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],i=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],s=Math.floor(t.getNumRawDataModules(n)/8),l=o-s%o,c=Math.floor(s/o);let u=[];const d=t.reedSolomonComputeDivisor(i);for(let n=0,r=0;n<o;n++){let o=e.slice(r,r+c-i+(n<l?0:1));r+=o.length;const a=t.reedSolomonComputeRemainder(o,d);n<l&&o.push(0),u.push(o.concat(a))}let f=[];for(let e=0;e<u[0].length;e++)u.forEach((t,n)=>{(e!=c-i||n>=l)&&f.push(t[e])});return a(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let r=0;r<this.size;r++)for(let a=0;a<2;a++){const i=t-a,s=!(t+1&2)?this.size-1-r:r;!this.isFunction[s][i]&&n<8*e.length&&(this.modules[s][i]=o(e[n>>>3],7-(7&n)),n++)}}a(n==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,o=0,a=[0,0,0,0,0,0,0];for(let i=0;i<this.size;i++)this.modules[n][i]==r?(o++,5==o?e+=t.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[n][i],o=1);e+=this.finderPenaltyTerminateAndCount(r,o,a)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,o=0,a=[0,0,0,0,0,0,0];for(let i=0;i<this.size;i++)this.modules[i][n]==r?(o++,5==o?e+=t.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[i][n],o=1);e+=this.finderPenaltyTerminateAndCount(r,o,a)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){const o=this.modules[n][r];o==this.modules[n][r+1]&&o==this.modules[n+1][r]&&o==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(const e of this.modules)n=e.reduce((e,t)=>e+(t?1:0),n);const r=this.size*this.size,o=Math.ceil(Math.abs(20*n-10*r)/r)-1;return a(0<=o&&o<=9),e+=o*t.PENALTY_N4,a(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return a(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let o=0;o<e;o++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map(e=>0);for(const o of e){const e=o^r.shift();r.push(0),n.forEach((n,o)=>r[o]^=t.reedSolomonMultiply(n,e))}return r}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let r=7;r>=0;r--)n=n<<1^285*(n>>>7),n^=(t>>>r&1)*e;return a(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];a(t<=3*this.size);const n=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};let n=t;function r(e,t,n){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function o(e,t){return!!(e>>>t&1)}function a(e){if(!e)throw new Error("Assertion error")}n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.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]],n.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]],e.QrCode=n;const i=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(e){let t=[];for(const n of e)r(n,8,t);return new i(i.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!i.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let n=0;n<e.length;){const o=Math.min(e.length-n,3);r(parseInt(e.substr(n,o),10),3*o+1,t),n+=o}return new i(i.Mode.NUMERIC,e.length,t)}static makeAlphanumeric(e){if(!i.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let t,n=[];for(t=0;t+2<=e.length;t+=2){let o=45*i.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t));o+=i.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),r(o,11,n)}return t<e.length&&r(i.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,n),new i(i.Mode.ALPHANUMERIC,e.length,n)}static makeSegments(e){return""==e?[]:i.isNumeric(e)?[i.makeNumeric(e)]:i.isAlphanumeric(e)?[i.makeAlphanumeric(e)]:[i.makeBytes(i.toUtf8ByteArray(e))]}static makeEci(e){let t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)r(e,8,t);else if(e<16384)r(2,2,t),r(e,14,t);else{if(!(e<1e6))throw new RangeError("ECI assignment value out of range");r(6,3,t),r(e,21,t)}return new i(i.Mode.ECI,0,t)}static isNumeric(e){return i.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return i.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(const r of e){const e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!=e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(parseInt(e.substr(n+1,2),16)),n+=2);return t}};let s=i;s.NUMERIC_REGEX=/^[0-9]*$/,s.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,s.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=s})(R||(R={})),(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};let n=t;n.LOW=new t(0,1),n.MEDIUM=new t(1,0),n.QUARTILE=new t(2,3),n.HIGH=new t(3,2),e.Ecc=n})((M=R||(R={})).QrCode||(M.QrCode={})),(e=>{(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let n=t;n.NUMERIC=new t(1,[10,12,14]),n.ALPHANUMERIC=new t(2,[9,11,13]),n.BYTE=new t(4,[8,16,16]),n.KANJI=new t(8,[8,10,12]),n.ECI=new t(7,[0,0,0]),e.Mode=n})(e.QrSegment||(e.QrSegment={}))})(R||(R={}));var I=R,_={L:I.QrCode.Ecc.LOW,M:I.QrCode.Ecc.MEDIUM,Q:I.QrCode.Ecc.QUARTILE,H:I.QrCode.Ecc.HIGH},z=128,B="L",F="#FFFFFF",H="#000000",$=!1; /** * @license qrcode.react * Copyright (c) Paul O'Shannessy * SPDX-License-Identifier: ISC */function W(e,t=0){const n=[];return e.forEach(function(e,r){let o=null;e.forEach(function(a,i){if(!a&&null!==o)return n.push(`M${o+t} ${r+t}h${i-o}v1H${o+t}z`),void(o=null);if(i!==e.length-1)a&&null===o&&(o=i);else{if(!a)return;null===o?n.push(`M${i+t},${r+t} h1v1H${i+t}z`):n.push(`M${o+t},${r+t} h${i+1-o}v1H${o+t}z`)}})}),n.join("")}function Y(e,t){return e.slice().map((e,n)=>n<t.y||n>=t.y+t.h?e:e.map((e,n)=>(n<t.x||n>=t.x+t.w)&&e))}function U(e,t,n,r){if(null==r)return null;const o=n?4:0,a=e.length+2*o,i=Math.floor(.1*t),s=a/t,l=(r.width||i)*s,c=(r.height||i)*s,u=null==r.x?e.length/2-l/2:r.x*s,d=null==r.y?e.length/2-c/2:r.y*s;let f=null;if(r.excavate){let e=Math.floor(u),t=Math.floor(d);f={x:e,y:t,w:Math.ceil(l+u-e),h:Math.ceil(c+d-t)}}return{x:u,y:d,h:c,w:l,excavation:f}}var V=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function X(e){const n=e,{value:r,size:o=z,level:a=B,bgColor:i=F,fgColor:s=H,includeMargin:l=$,style:c,imageSettings:u}=n,d=L(n,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),f=null==u?void 0:u.src,h=t.useRef(null),p=t.useRef(null),[m,g]=t.useState(!1);t.useEffect(()=>{if(null!=h.current){const e=h.current,t=e.getContext("2d");if(!t)return;let n=I.QrCode.encodeText(r,_[a]).getModules();const c=l?4:0,d=n.length+2*c,f=U(n,o,l,u),m=p.current,g=null!=f&&null!==m&&m.complete&&0!==m.naturalHeight&&0!==m.naturalWidth;g&&null!=f.excavation&&(n=Y(n,f.excavation));const v=window.devicePixelRatio||1;e.height=e.width=o*v;const y=o/d*v;t.scale(y,y),t.fillStyle=i,t.fillRect(0,0,d,d),t.fillStyle=s,V?t.fill(new Path2D(W(n,c))):n.forEach(function(e,n){e.forEach(function(e,r){e&&t.fillRect(r+c,n+c,1,1)})}),g&&t.drawImage(m,f.x+c,f.y+c,f.w,f.h)}}),t.useEffect(()=>{g(!1)},[f]);const v=O({height:o,width:o},c);let y=null;return null!=f&&(y=t.createElement("img",{src:f,key:f,style:{display:"none"},onLoad:()=>{g(!0)},ref:p})),t.createElement(t.Fragment,null,t.createElement("canvas",O({style:v,height:o,width:o,ref:h},d)),y)}function K(e){const n=e,{value:r,size:o=z,level:a=B,bgColor:i=F,fgColor:s=H,includeMargin:l=$,imageSettings:c}=n,u=L(n,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let d=I.QrCode.encodeText(r,_[a]).getModules();const f=l?4:0,h=d.length+2*f,p=U(d,o,l,c);let m=null;null!=c&&null!=p&&(null!=p.excavation&&(d=Y(d,p.excavation)),m=t.createElement("image",{xlinkHref:c.src,height:p.h,width:p.w,x:p.x+f,y:p.y+f,preserveAspectRatio:"none"}));const g=W(d,f);return t.createElement("svg",O({height:o,width:o,viewBox:`0 0 ${h} ${h}`},u),t.createElement("path",{fill:i,d:`M0,0 h${h}v${h}H0z`,shapeRendering:"crispEdges"}),t.createElement("path",{fill:s,d:g,shapeRendering:"crispEdges"}),m)}var Q=e=>{const n=e,{renderAs:r}=n,o=L(n,["renderAs"]);return"svg"===r?t.createElement(K,O({},o)):t.createElement(X,O({},o))};function q(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=q(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Z(...e){return function(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=q(e))&&(r&&(r+=" "),r+=t);return r}(e)}function G(e){return JSON.parse(JSON.stringify(e))}function J(e){return e instanceof Error?e.message:"Encountered an unreferenced exception handling this request. Try again or contact support"}const ee={apiBaseUrl:"/api",pollingInterval:3e3,maxRetries:3};function te(t,n=[]){let r=[];const a=()=>{const e=r.map(e=>o.createContext(e));return fun